csso-browser.js
93.4 KB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.csso=e()}}(function(){return function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return o(r?r:e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){t.exports=function(e,t,r){if(e.block){if(this.root.firstAtrulesAllowed=!1,"Block"===e.block.type&&e.block.declarations.isEmpty())return void r.remove(t);if("StyleSheet"===e.block.type&&e.block.rules.isEmpty())return void r.remove(t)}switch(e.name){case"charset":if(e.expression.sequence.isEmpty())return void r.remove(t);if(t.prev)return void r.remove(t);break;case"import":if(!this.root.firstAtrulesAllowed)return void r.remove(t);r.prevUntil(t.prev,function(e){return"Atrule"!==e.type||"import"!==e.name&&"charset"!==e.name?(this.root.firstAtrulesAllowed=!1,r.remove(t),!0):void 0},this)}}},{}],2:[function(e,t,r){t.exports=function(e,t,r){r.remove(t)}},{}],3:[function(e,t,r){t.exports=function(e,t,r){e.value.sequence.isEmpty()&&r.remove(t)}},{}],4:[function(e,t,r){t.exports=function(e,t,r){null!==this.selector&&"*"===e.name&&t.next&&"Combinator"!==t.next.data.type&&r.remove(t)}},{}],5:[function(e,t,r){function n(e,t){return e.selector.selectors.each(function(e,r,n){var i=e.sequence.some(function(e){switch(e.type){case"Class":return t.classes&&!o.call(t.classes,e.name);case"Id":return t.ids&&!o.call(t.ids,e.name);case"Identifier":if("*"!==e.name)return t.tags&&!o.call(t.tags,e.name.toLowerCase())}});i&&n.remove(r)})}var o=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,o){o&&n(e,o),(e.selector.selectors.isEmpty()||e.block.declarations.isEmpty())&&r.remove(t)}},{}],6:[function(e,t,r){function n(e){return"Operator"!==e.type?!1:"+"!==e.value&&"-"!==e.value}t.exports=function(e,t,r){var o=t.prev&&t.prev.data,i=t.next&&t.next.data;(n(o)||n(i))&&r.remove(t)}},{}],7:[function(e,t,r){var n=e("../../utils/walk.js").all,o={Space:e("./Space.js"),Atrule:e("./Atrule.js"),Ruleset:e("./Ruleset.js"),Declaration:e("./Declaration.js"),Identifier:e("./Identifier.js"),Comment:e("./Comment.js")};t.exports=function(e,t){n(e,function(e,r,n){o.hasOwnProperty(e.type)&&o[e.type].call(this,e,r,n,t)})}},{"../../utils/walk.js":45,"./Atrule.js":1,"./Comment.js":2,"./Declaration.js":3,"./Identifier.js":4,"./Ruleset.js":5,"./Space.js":6}],8:[function(e,t,r){var n=e("../../utils/names.js").keyword,o=e("./atrule/keyframes.js");t.exports=function(e){"keyframes"===n(e.name).name&&o(e)}},{"../../utils/names.js":42,"./atrule/keyframes.js":15}],9:[function(e,t,r){function n(e){return""!==e&&"-"!==e?(e=e.replace(o,"a"),!i.test(e)):void 0}var o=/\\([0-9A-Fa-f]{1,6})[ \t\n\f\r]?|\\./g,i=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;t.exports=function(e){var t=e.value;if(t&&"String"===t.type){var r=t.value.replace(/^(.)(.*)\1$/,"$2");n(r)&&(e.value={type:"Identifier",info:t.info,name:r})}}},{}],10:[function(e,t,r){var n=e("./Number.js").pack,o={px:!0,mm:!0,cm:!0,"in":!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vh:!0,vw:!0,vmin:!0,vmax:!0,vm:!0};t.exports=function(e,t){var r=n(e.value);if(e.value=r,"0"===r&&this.declaration){var i=e.unit.toLowerCase();if(!o.hasOwnProperty(i))return;if("flex"===this.declaration.property.name)return;if(this["function"]&&"calc"===this["function"].name)return;t.data={type:"Number",info:e.info,value:r}}}},{"./Number.js":11}],11:[function(e,t,r){function n(e){return e=String(e).replace(/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,"$1$2$3"),0!==e.length&&"-"!==e||(e="0"),e}t.exports=function(e){e.value=n(e.value)},t.exports.pack=n},{}],12:[function(e,t,r){t.exports=function(e){var t=e.value;t=t.replace(/\\\n/g,""),e.value=t}},{}],13:[function(e,t,r){var n="\\\\[0-9a-f]{1,6}(\\r\\n|[ \\n\\r\\t\\f])?",o="("+n+"|\\\\[^\\n\\r\\f0-9a-fA-F])",i="\x00\b\x0B-",a=new RegExp("^("+o+"|[^\"'\\(\\)\\\\\\s"+i+"])*$","i");t.exports=function(e){var t=e.value;if("String"===t.type){var r=t.value[0],n=t.value.substr(1,t.value.length-2);n=n.replace(/\\\\/g,"/"),a.test(n)?e.value={type:"Raw",info:e.value.info,value:n}:e.value.value=-1===n.indexOf('"')?'"'+n+'"':r+n+r}}},{}],14:[function(e,t,r){var n=e("../../utils/names.js").property,o={font:e("./property/font.js"),"font-weight":e("./property/font-weight.js"),background:e("./property/background.js")};t.exports=function(e){if(this.declaration){var t=n(this.declaration.property.name);o.hasOwnProperty(t.name)&&o[t.name](e)}}},{"../../utils/names.js":42,"./property/background.js":18,"./property/font-weight.js":19,"./property/font.js":20}],15:[function(e,t,r){t.exports=function(e){e.block.rules.each(function(e){e.selector.selectors.each(function(e){e.sequence.each(function(e,t){"Percentage"===e.type&&"100"===e.value?t.data={type:"Identifier",info:e.info,name:"to"}:"Identifier"===e.type&&"from"===e.name&&(t.data={type:"Percentage",info:e.info,value:"0"})})})})}},{}],16:[function(e,t,r){function n(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+(t-e)*(2/3-r)*6:e}function o(e,t,r,o){var i,a,s;if(0==t)i=a=s=r;else{var l=.5>r?r*(1+t):r+t-r*t,u=2*r-l;i=n(u,l,e+1/3),a=n(u,l,e),s=n(u,l,e-1/3)}return[Math.round(255*i),Math.round(255*a),Math.round(255*s),o]}function i(e){return e=e.toString(16),1===e.length?"0"+e:e}function a(e,t,r){for(var n=e.head,o=[];null!==n;){for(var i=n.data.sequence.head,a=!1;null!==i;){var s=i.data,l=s.type;switch(l){case"Number":case"Percentage":if(a)return;a=!0,o.push({type:l,value:Number(s.value)});break;case"Operator":if(a||"+"!==s.value)return;break;default:return}i=i.next}n=n.next}if(o.length===t){if(4===o.length){if("Number"!==o[3].type)return;o[3].type="Alpha"}if(r){if(o[0].type!==o[1].type||o[0].type!==o[2].type)return}else{if("Number"!==o[0].type||"Percentage"!==o[1].type||"Percentage"!==o[2].type)return;o[0].type="Angle"}return o.map(function(e){var t=Math.max(0,e.value);switch(e.type){case"Number":t=Math.min(t,255);break;case"Percentage":if(t=Math.min(t,100)/100,!r)return t;t=255*t;break;case"Angle":return(t%360+360)%360/360;case"Alpha":return Math.min(t,1)}return Math.round(t)})}}function s(e,t,r){var n,s=e.name;if("rgba"===s||"hsla"===s){if(n=a(e.arguments,4,"rgba"===s),!n)return;if("hsla"===s&&(n=o.apply(null,n),e.name="rgba"),1!==n[3])return void e.arguments.each(function(e){var t=e.sequence.head;"Operator"===t.data.type&&(t=t.next),e.sequence=new c([{type:"Number",info:t.data.info,value:p(n.shift())}])});s="rgb"}if("hsl"===s){if(n=n||a(e.arguments,3,!1),!n)return;n=o.apply(null,n),s="rgb"}if("rgb"===s){if(n=n||a(e.arguments,3,!0),!n)return;var l=t.next;l&&"Space"!==l.data.type&&r.insert(r.createItem({type:"Space"}),l),t.data={type:"Hash",info:e.info,value:i(n[0])+i(n[1])+i(n[2])},u(t.data,t)}}function l(e,t){if(null!==this.declaration){var r=e.name.toLowerCase();if(f.hasOwnProperty(r)){var n=f[r];n.length+1<=r.length?t.data={type:"Hash",info:e.info,value:n}:("grey"===r&&(r="gray"),e.name=r)}}}function u(e,t){var r=e.value.toLowerCase();6===r.length&&r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&(r=r[0]+r[2]+r[4]),h[r]?t.data={type:"Identifier",info:e.info,name:h[r]}:e.value=r}var c=e("../../utils/list.js"),p=e("./Number.js").pack,f={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},h={800000:"maroon",800080:"purple",808000:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"};t.exports={compressFunction:s,compressIdent:l,compressHex:u}},{"../../utils/list.js":41,"./Number.js":11}],17:[function(e,t,r){var n=e("../../utils/walk.js").all,o={Atrule:e("./Atrule.js"),Attribute:e("./Attribute.js"),Value:e("./Value.js"),Dimension:e("./Dimension.js"),Percentage:e("./Number.js"),Number:e("./Number.js"),String:e("./String.js"),Url:e("./Url.js"),Hash:e("./color.js").compressHex,Identifier:e("./color.js").compressIdent,Function:e("./color.js").compressFunction};t.exports=function(e){n(e,function(e,t,r){o.hasOwnProperty(e.type)&&o[e.type].call(this,e,t,r)})}},{"../../utils/walk.js":45,"./Atrule.js":8,"./Attribute.js":9,"./Dimension.js":10,"./Number.js":11,"./String.js":12,"./Url.js":13,"./Value.js":14,"./color.js":16}],18:[function(e,t,r){var n=e("../../../utils/list.js");t.exports=function(e){function t(){return i.length?i[i.length-1].type:void 0}function r(){"Space"===t()&&i.pop(),i.length||i.unshift({type:"Number",value:"0"},{type:"Space"},{type:"Number",value:"0"}),o.push.apply(o,i),i=[]}var o=[],i=[];e.sequence.each(function(e){return"Operator"===e.type&&","===e.value?(r(),void o.push(e)):void(("Identifier"!==e.type||"transparent"!==e.name&&"none"!==e.name&&"repeat"!==e.name&&"scroll"!==e.name)&&("Space"!==e.type||i.length&&"Space"!==t())&&i.push(e))}),r(),e.sequence=new n(o)}},{"../../../utils/list.js":41}],19:[function(e,t,r){t.exports=function(e){var t=e.sequence.head.data;if("Identifier"===t.type)switch(t.name){case"normal":e.sequence.head.data={type:"Number",info:t.info,value:"400"};break;case"bold":e.sequence.head.data={type:"Number",info:t.info,value:"700"}}}},{}],20:[function(e,t,r){t.exports=function(e){var t=e.sequence;t.eachRight(function(e,t){if("Identifier"===e.type)if("bold"===e.name)t.data={type:"Number",info:e.info,value:"700"};else if("normal"===e.name){var r=t.prev;r&&"Operator"===r.data.type&&"/"===r.data.value&&this.remove(r),this.remove(t)}else if("medium"===e.name){var n=t.next;n&&"Operator"===n.data.type||this.remove(t)}}),t.each(function(e,t){"Space"===e.type&&(t.prev&&t.next&&"Space"!==t.next.data.type||this.remove(t))}),t.isEmpty()&&t.insert(t.createItem({type:"Identifier",name:"normal"}))}},{}],21:[function(e,t,r){function n(e,t){var r,n=new l,o=!1;return e.nextUntil(e.head,function(e,i,a){return"Comment"===e.type?t&&"!"===e.value.charAt(0)?o||r?!0:(a.remove(i),void(r=e)):void a.remove(i):("Space"!==e.type&&(o=!0),void n.insert(a.remove(i)))}),{comment:r,stylesheet:{type:"StyleSheet",info:null,rules:n}}}function o(e,t,r,n,o){o("Compress block #"+n,null,!0);var i=1;return d(e,function(){"id"in this.stylesheet==!1&&(this.stylesheet.firstAtrulesAllowed=t,this.stylesheet.id=i++)}),o("init",e),p(e,r),o("clean",e),f(e,r),o("compress",e),e}function i(e){var t="comments"in e?e.comments:"exclamation";return"boolean"==typeof t?t=t?"exclamation":!1:"exclamation"!==t&&"first-exclamation"!==t&&(t=!1),t}function a(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function s(e){return new l([{type:"Ruleset",selector:{type:"Selector",selectors:new l([{type:"SimpleSelector",sequence:new l([{type:"Identifier",name:"x"}])}])},block:e}])}var l=e("../utils/list"),u=e("../utils/clone"),c=e("./usage"),p=e("./clean"),f=e("./compress"),h=e("./restructure"),d=e("../utils/walk").rules;t.exports=function(e,t){e=e||{type:"StyleSheet",info:null,rules:new l},t=t||{};var r,p,f,d="function"==typeof t.logger?t.logger:Function(),m=i(t),g=a(t),v=!0,y=!1,b=new l,k=1;t.clone&&(e=u(e)),"StyleSheet"===e.type?(r=e.rules,e.rules=b):r=s(e),t.usage&&(y=c.buildIndex(t.usage));do{if(p=n(r,Boolean(m)),o(p.stylesheet,v,y,k++,d),g&&h(p.stylesheet,y,d),f=p.stylesheet.rules,p.comment&&(b.isEmpty()||b.insert(l.createItem({type:"Raw",value:"\n"})),b.insert(l.createItem(p.comment)),f.isEmpty()||b.insert(l.createItem({type:"Raw",value:"\n"}))),v&&!f.isEmpty()){var w=f.last();("Atrule"!==w.type||"import"!==w.name&&"charset"!==w.name)&&(v=!1)}"exclamation"!==m&&(m=!1),b.appendList(f)}while(!r.isEmpty());return{ast:e}}},{"../utils/clone":40,"../utils/list":41,"../utils/walk":45,"./clean":7,"./compress":17,"./restructure":29,"./usage":35}],22:[function(e,t,r){function n(e,t,r){var n=e.selector.selectors,i=e.block.declarations;r.prevUntil(t.prev,function(a){if("Ruleset"!==a.type)return o.unsafeToSkipNode.call(n,a);var s=a.selector.selectors,l=a.block.declarations;if(e.pseudoSignature===a.pseudoSignature){if(o.isEqualLists(s,n))return l.appendList(i),r.remove(t),!0;if(o.isEqualDeclarations(i,l))return o.addSelectors(s,n),r.remove(t),!0}return o.hasSimilarSelectors(n,s)})}var o=e("./utils.js"),i=e("../../utils/walk.js").rules;t.exports=function(e){i(e,function(e,t,r){"Ruleset"===e.type&&n(e,t,r)})}},{"../../utils/walk.js":45,"./utils.js":34}],23:[function(e,t,r){function n(e){return"Atrule"===e.type&&"media"===e.name}function o(e,t,r){if(n(e)){var o=t.prev&&t.prev.data;o&&n(o)&&e.expression.id===o.expression.id&&(o.block.rules.appendList(e.block.rules),o.info={primary:o.info,merged:e.info},r.remove(t))}}var i=e("../../utils/walk.js").rulesRight;t.exports=function(e){i(e,function(e,t,r){"Atrule"===e.type&&o(e,t,r)})}},{"../../utils/walk.js":45}],24:[function(e,t,r){function n(e,t,r){for(var n=e.selector.selectors;n.head!==n.tail;){var i=new o;i.insert(n.remove(n.head)),r.insert(r.createItem({type:"Ruleset",info:e.info,pseudoSignature:e.pseudoSignature,selector:{type:"Selector",info:e.selector.info,selectors:i},block:{type:"Block",info:e.block.info,declarations:e.block.declarations.copy()}}),t)}}var o=e("../../utils/list.js"),i=e("../../utils/walk.js").rulesRight;t.exports=function(e){i(e,function(e,t,r){"Ruleset"===e.type&&n(e,t,r)})}},{"../../utils/list.js":41,"../../utils/walk.js":45}],25:[function(e,t,r){function n(e){this.name=e,this.info=null,this.iehack=void 0,this.sides={top:null,right:null,bottom:null,left:null}}function o(e,t,r,o){var i=e.block.declarations,a=e.selector.selectors.first().id;return e.block.declarations.eachRight(function(e,s){var l=e.property.name;if(v.hasOwnProperty(l)){var p,f,h=v[l];if(o&&a!==o||h in t&&(f=c,p=t[h]),!(p&&p.add(l,e.value,e.info)||(f=u,p=new n(h),p.add(l,e.value,e.info))))return void(o=null);t[h]=p,r.push({operation:f,block:i,item:s,shorthand:p}),o=a}}),o}function i(e,t){e.forEach(function(e){var r=e.shorthand;r.isOkToMinimize()&&(e.operation===u?e.item.data=t({type:"Declaration",info:r.info,property:r.getProperty(),value:r.getValue(),id:0,length:0,fingerprint:null}):e.block.remove(e.item))})}var a=e("../../utils/list.js"),s=e("../../utils/translate.js"),l=e("../../utils/walk.js").rulesRight,u=1,c=2,p=0,f=1,h=2,d=3,m=["top","right","bottom","left"],g={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"},v={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"};n.prototype.getValueSequence=function(e,t){var r=[],n="",o=e.sequence.some(function(t){var o=!1;switch(t.type){case"Identifier":switch(t.name){case"\\0":case"\\9":return void(n=t.name);case"inherit":case"initial":case"unset":case"revert":o=t.name}break;case"Dimension":switch(t.unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":o=t.unit}break;case"Hash":case"Number":case"Percentage":break;case"Function":o=t.name;break;case"Space":return!1;default:return!0}r.push({node:t,special:o,important:e.important})});return o||r.length>t?!1:"string"==typeof this.iehack&&this.iehack!==n?!1:(this.iehack=n,r)},n.prototype.canOverride=function(e,t){var r=this.sides[e];return!r||t.important&&!r.important},n.prototype.add=function(e,t,r){function n(){var r=this.sides,n=g[e];if(n){if(n in r==!1)return!1;var o=this.getValueSequence(t,1);if(!o||!o.length)return!1;for(var i in r)if(null!==r[i]&&r[i].special!==o[0].special)return!1;return this.canOverride(n,o[0])?(r[n]=o[0],!0):!0}if(e===this.name){var o=this.getValueSequence(t,4);if(!o||!o.length)return!1;switch(o.length){case 1:o[f]=o[p],o[h]=o[p],o[d]=o[p];break;case 2:o[h]=o[p],o[d]=o[f];break;case 3:o[d]=o[f]}for(var a=0;4>a;a++)for(var i in r)if(null!==r[i]&&r[i].special!==o[a].special)return!1;for(var a=0;4>a;a++)this.canOverride(m[a],o[a])&&(r[m[a]]=o[a]);return!0}}return n.call(this)?(this.info?this.info={primary:this.info,merged:r}:this.info=r,!0):!1},n.prototype.isOkToMinimize=function(){var e=this.sides.top,t=this.sides.right,r=this.sides.bottom,n=this.sides.left;if(e&&t&&r&&n){var o=e.important+t.important+r.important+n.important;return 0===o||4===o}return!1},n.prototype.getValue=function(){var e=[],t=this.sides,r=[t.top,t.right,t.bottom,t.left],n=[s(t.top.node),s(t.right.node),s(t.bottom.node),s(t.left.node)];n[d]===n[f]&&(r.pop(),n[h]===n[p]&&(r.pop(),n[f]===n[p]&&r.pop()));for(var o=0;o<r.length;o++)o&&e.push({type:"Space"}),e.push(r[o].node);return this.iehack&&e.push({type:"Space"},{type:"Identifier",info:{},name:this.iehack}),{type:"Value",info:{},important:t.top.important,sequence:new a(e)}},n.prototype.getProperty=function(){return{type:"Property",info:{},name:this.name}},t.exports=function(e,t){var r={},n=[];l(e,function(e){if("Ruleset"===e.type){var t,i,a=this.stylesheet,s=(e.pseudoSignature||"")+"|"+e.selector.selectors.first().id;r.hasOwnProperty(a.id)?t=r[a.id]:(t={lastShortSelector:null},r[a.id]=t),t.hasOwnProperty(s)?i=t[s]:(i={},t[s]=i),t.lastShortSelector=o.call(this,e,i,n,t.lastShortSelector)}}),i(n,t.declaration)}},{"../../utils/list.js":41,"../../utils/translate.js":43,"../../utils/walk.js":45}],26:[function(e,t,r){function n(e,t,r){var n=a(e).name;if("background"===n||"filter"===n&&"Progid"===t.value.sequence.first().type)return e+":"+u(t.value);var o=t.id,i=r[o];if(!i){var l="",c="",h={};t.value.sequence.each(function d(e){switch(e.type){case"Argument":case"Value":case"Braces":e.sequence.each(d);break;case"Identifier":var t=e.name;l||(l=s(t).vendor),/\\[09]/.test(t)&&(c=RegExp.lastMatch),"cursor"===n?-1===f.indexOf(t)&&(h[t]=!0):p.hasOwnProperty(n)&&p[n].test(t)&&(h[t]=!0);break;case"Function":var t=e.name;l||(l=s(t).vendor),"rect"===t&&e.arguments.size<4&&(t="rect-backward"),h[t+"()"]=!0,e.arguments.each(d);break;case"Dimension":var r=e.unit;switch(r){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":h[r]=!0}}}),i="|"+Object.keys(h).sort()+"|"+c+l,r[o]=i}return e+i}function o(e,t,r){var o=a(t.property.name);if(h.hasOwnProperty(o.name))for(var i=h[o.name],s=0;s<i.length;s++){var l=n(o.prefix+i[s],t,r),u=e[l];if(u&&(!t.value.important||u.item.data.value.important))return u}}function i(e,t,r,i,a){var s=e.block.declarations;s.eachRight(function(e,t){var r=e.property.name,l=n(r,e,a),u=i[l];if(u&&!c.hasOwnProperty(r))e.value.important&&!u.item.data.value.important?(i[l]={block:s,item:t},u.block.remove(u.item),e.info={primary:e.info,merged:u.item.data.info}):(s.remove(t),u.item.data.info={primary:u.item.data.info,merged:e.info});else{var u=o(i,e,a);u?(s.remove(t),u.item.data.info={primary:u.item.data.info,merged:e.info}):(e.fingerprint=l,i[l]={block:s,item:t})}}),s.isEmpty()&&r.remove(t)}var a=e("../../utils/names.js").property,s=e("../../utils/names.js").keyword,l=e("../../utils/walk.js").rulesRight,u=e("../../utils/translate.js"),c={src:1},p={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},f=["auto","crosshair","default","move","text","wait","help","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","pointer","progress","not-allowed","no-drop","vertical-text","all-scroll","col-resize","row-resize"],h={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]};t.exports=function(e){var t={},r=Object.create(null);l(e,function(e,n,o){if("Ruleset"===e.type){var a,s,l=this.stylesheet,u=(e.pseudoSignature||"")+"|"+e.selector.selectors.first().id;t.hasOwnProperty(l.id)?a=t[l.id]:(a={},t[l.id]=a),a.hasOwnProperty(u)?s=a[u]:(s={},a[u]=s),i.call(this,e,n,o,s,r)}})}},{"../../utils/names.js":42,"../../utils/translate.js":43,"../../utils/walk.js":45}],27:[function(e,t,r){function n(e,t,r){var n=e.selector.selectors,i=e.block.declarations,a=n.first().compareMarker,s={};r.nextUntil(t.next,function(t,l){if("Ruleset"!==t.type)return o.unsafeToSkipNode.call(n,t);if(e.pseudoSignature!==t.pseudoSignature)return!0;var u=t.selector.selectors.head,c=t.block.declarations,p=u.data.compareMarker;if(p in s)return!0;if(n.head===n.tail&&n.first().id===u.data.id)return i.appendList(c),void r.remove(l);if(o.isEqualDeclarations(i,c)){var f=u.data.id;return n.some(function(e,t){var r=e.id;return r>f?(n.insert(u,t),!0):t.next?void 0:(n.insert(u),!0)}),void r.remove(l)}return p===a?!0:void(s[p]=!0)})}var o=e("./utils.js"),i=e("../../utils/walk.js").rules;t.exports=function(e){i(e,function(e,t,r){"Ruleset"===e.type&&n(e,t,r)})}},{"../../utils/walk.js":45,"./utils.js":34}],28:[function(e,t,r){function n(e){var t=0;return e.each(function(e){t+=e.id.length+1}),t-1}function o(e){for(var t=0,r=0;r<e.length;r++)t+=e[r].length;return t+e.length-1}function i(e,t,r){var i=this.stylesheet.avoidRulesMerge,l=e.selector.selectors,u=e.block,c=Object.create(null),p=!0,f=!0;r.prevUntil(t.prev,function(h,d){if("Ruleset"!==h.type)return s.unsafeToSkipNode.call(l,h);var m=h.selector.selectors,g=h.block;if(e.pseudoSignature!==h.pseudoSignature)return!0;if(f=!m.some(function(e){return e.compareMarker in c}),!f&&!p)return!0;if(p&&s.isEqualLists(m,l))return g.declarations.appendList(u.declarations),r.remove(t),!0;var v=s.compareDeclarations(u.declarations,g.declarations);if(v.eq.length){if(!v.ne1.length&&!v.ne2.length)return f&&(s.addSelectors(l,m),r.remove(d)),!0;if(!i)if(v.ne1.length&&!v.ne2.length){var y=n(l),b=o(v.eq);p&&b>y&&(s.addSelectors(m,l),u.declarations=new a(v.ne1))}else if(!v.ne1.length&&v.ne2.length){var y=n(m),b=o(v.eq);f&&b>y&&(s.addSelectors(l,m),g.declarations=new a(v.ne2))}else{var k={type:"Selector",info:{},selectors:s.addSelectors(m.copy(),l)},w=n(k.selectors)+2,b=o(v.eq);if(f&&b>=w){var S={type:"Ruleset",info:{},pseudoSignature:e.pseudoSignature,selector:k,block:{type:"Block",info:{},declarations:new a(v.eq)}};return u.declarations=new a(v.ne1),g.declarations=new a(v.ne2.concat(v.ne2overrided)),r.insert(r.createItem(S),d),!0}}}p&&(p=!m.some(function(e){return l.some(function(t){return t.compareMarker===e.compareMarker})})),m.each(function(e){c[e.compareMarker]=!0})})}var a=e("../../utils/list.js"),s=e("./utils.js"),l=e("../../utils/walk.js").rulesRight;t.exports=function(e){l(e,function(e,t,r){"Ruleset"===e.type&&i.call(this,e,t,r)})}},{"../../utils/list.js":41,"../../utils/walk.js":45,"./utils.js":34}],29:[function(e,t,r){var n=e("./prepare/index.js"),o=e("./1-initialMergeRuleset.js"),i=e("./2-mergeAtrule.js"),a=e("./3-disjoinRuleset.js"),s=e("./4-restructShorthand.js"),l=e("./6-restructBlock.js"),u=e("./7-mergeRuleset.js"),c=e("./8-restructRuleset.js");t.exports=function(e,t,r){var p=n(e,t);r("prepare",e),o(e),r("initialMergeRuleset",e),i(e),r("mergeAtrule",e),a(e),r("disjoinRuleset",e),s(e,p),r("restructShorthand",e),l(e),r("restructBlock",e),u(e),r("mergeRuleset",e),c(e),r("restructRuleset",e)}},{"./1-initialMergeRuleset.js":22,"./2-mergeAtrule.js":23,"./3-disjoinRuleset.js":24,"./4-restructShorthand.js":25,"./6-restructBlock.js":26,"./7-mergeRuleset.js":27,"./8-restructRuleset.js":28,"./prepare/index.js":31}],30:[function(e,t,r){function n(){this.seed=0,this.map=Object.create(null)}var o=e("../../../utils/translate.js");n.prototype.resolve=function(e){var t=this.map[e];return t||(t=++this.seed,this.map[e]=t),t},t.exports=function(){var e=new n,t=new n;return function(r){var n=r.property.name,i=o(r.value);return r.id=e.resolve(n)+(t.resolve(i)<<12),r.length=n.length+1+i.length,r}}},{"../../../utils/translate.js":43}],31:[function(e,t,r){function n(e,t,r){switch(e.type){case"Ruleset":e.block.declarations.each(t),l(e,r);break;case"Atrule":e.expression&&(e.expression.id=a(e.expression)),"keyframes"===o(e.name).name&&(e.block.avoidRulesMerge=!0,e.block.rules.each(function(e){e.selector.selectors.each(function(e){e.compareMarker=e.id})}))}}var o=e("../../../utils/names.js").keyword,i=e("../../../utils/walk.js").rules,a=e("../../../utils/translate.js"),s=e("./createDeclarationIndexer.js"),l=e("./processSelector.js");t.exports=function(e,t){var r=s();return i(e,function(e){n(e,r,t)}),{declaration:r}}},{"../../../utils/names.js":42,"../../../utils/translate.js":43,"../../../utils/walk.js":45,"./createDeclarationIndexer.js":30,"./processSelector.js":32}],32:[function(e,t,r){var n=e("../../../utils/translate.js"),o=e("./specificity.js"),i={"first-letter":!0,"first-line":!0,after:!0,before:!0},a={link:!0,visited:!0,hover:!0,active:!0,"first-letter":!0,"first-line":!0,after:!0,before:!0};t.exports=function(e,t){var r=Object.create(null),s=!1;e.selector.selectors.each(function(e){var l="*",u=0;e.sequence.some(function(o){switch(o.type){case"Class":if(t&&t.scopes){var c=t.scopes[o.name]||0;if(0!==u&&c!==u)throw new Error("Selector can't has classes from different scopes: "+n(e));u=c}break;case"PseudoClass":a.hasOwnProperty(o.name)||(r[o.name]=!0,s=!0);break;case"PseudoElement":i.hasOwnProperty(o.name)||(r[o.name]=!0,s=!0);break;case"FunctionalPseudo":r[o.name]=!0,s=!0;break;case"Negation":r.not=!0,s=!0;break;case"Identifier":l=o.name;break;case"Attribute":o.flags&&(r["["+o.flags+"]"]=!0,s=!0);break;case"Combinator":l="*"}}),e.id=n(e),e.compareMarker=o(e).toString(),u&&(e.compareMarker+=":"+u),"*"!==l&&(e.compareMarker+=","+l)}),s&&(e.pseudoSignature=Object.keys(r).sort().join(","))}},{"../../../utils/translate.js":43,"./specificity.js":33}],33:[function(e,t,r){t.exports=function(e){var t=0,r=0,n=0;return e.sequence.each(function o(e){switch(e.type){case"SimpleSelector":case"Negation":e.sequence.each(o);break;case"Id":t++;break;case"Class":case"Attribute":case"FunctionalPseudo":r++;break;case"Identifier":"*"!==e.name&&n++;break;case"PseudoElement":n++;break;case"PseudoClass":var i=e.name.toLowerCase();"before"===i||"after"===i||"first-line"===i||"first-letter"===i?n++:r++}}),[t,r,n]}},{}],34:[function(e,t,r){function n(e,t){for(var r=e.head,n=t.head;null!==r&&null!==n&&r.data.id===n.data.id;)r=r.next,n=n.next;return null===r&&null===n}function o(e,t){for(var r=e.head,n=t.head;null!==r&&null!==n&&r.data.id===n.data.id;)r=r.next,n=n.next;return null===r&&null===n}function i(e,t){for(var r={eq:[],ne1:[],ne2:[],ne2overrided:[]},n=Object.create(null),o=Object.create(null),i=t.head;i;i=i.next)o[i.data.id]=!0;for(var i=e.head;i;i=i.next){var a=i.data;a.fingerprint&&(n[a.fingerprint]=a.value.important),o[a.id]?(o[a.id]=!1,r.eq.push(a)):r.ne1.push(a)}for(var i=t.head;i;i=i.next){var a=i.data;o[a.id]&&(u.call(n,a.fingerprint)&&Number(n[a.fingerprint])>=Number(a.value.important)?r.ne2overrided.push(a):r.ne2.push(a));
}return r}function a(e,t){return t.each(function(t){for(var r=t.id,n=e.head;n;){var o=n.data.id;if(o===r)return;if(o>r)break;n=n.next}e.insert(e.createItem(t),n)}),e}function s(e,t){return e.some(function(e){return t.some(function(t){return e.compareMarker===t.compareMarker})})}function l(e){switch(e.type){case"Ruleset":return s(e.selector.selectors,this);case"Atrule":if(e.block)return"StyleSheet"!==e.block.type?!1:e.block.rules.some(l,this)}return!0}var u=Object.prototype.hasOwnProperty;t.exports={isEqualLists:n,isEqualDeclarations:o,compareDeclarations:i,addSelectors:a,hasSimilarSelectors:s,unsafeToSkipNode:l}},{}],35:[function(e,t,r){function n(e,t){var r=Object.create(null);if(!Array.isArray(e))return!1;for(var n=0;n<e.length;n++){var o=e[n];t&&(o=o.toLowerCase()),r[o]=!0}return r}function o(e){var t=!1;if(e.scopes&&Array.isArray(e.scopes)){t=Object.create(null);for(var r=0;r<e.scopes.length;r++){var o=e.scopes[r];if(!o||!Array.isArray(o))throw new Error("Wrong usage format");for(var a=0;a<o.length;a++){var s=o[a];if(i.call(t,s))throw new Error("Class can't be used for several scopes: "+s);t[s]=r+1}}}return{tags:n(e.tags,!0),ids:n(e.ids),classes:n(e.classes),scopes:t}}var i=Object.prototype.hasOwnProperty;t.exports={buildIndex:o}},{}],36:[function(e,t,r){function n(e,t,r,n){return t.debug&&console.error("## "+e+" done in %d ms\n",Date.now()-r),n}function o(e){var t;return function(r,n){var o=r;if(n&&(o="["+((Date.now()-t)/1e3).toFixed(3)+"s] "+o),e>1&&n){var i=h(n,!0);2===e&&i.length>256&&(i=i.substr(0,256)+"..."),o+="\n "+i+"\n"}console.error(o),t=Date.now()}}function i(e){var t={};for(var r in e)t[r]=e[r];return t}function a(e){return e=i(e),"function"!=typeof e.logger&&e.debug&&(e.logger=o(e.debug)),e}function s(e,t,r){Array.isArray(r)||(r=[r]),r.forEach(function(r){r(e,t)})}function l(e,t,r){r=r||{};var o,i=r.filename||"<unknown>",l=n("parsing",r,Date.now(),p(t,{context:e,filename:i,positions:Boolean(r.sourceMap)}));r.beforeCompress&&n("beforeCompress",r,Date.now(),s(l,r,r.beforeCompress));var u=n("compress",r,Date.now(),f(l,a(r)));return r.afterCompress&&n("afterCompress",r,Date.now(),s(u,r,r.afterCompress)),o=r.sourceMap?n("translateWithSourceMap",r,Date.now(),function(){var e=d(u.ast);return e.map._file=i,e.map.setSourceContent(i,t),e}()):n("translate",r,Date.now(),{css:h(u.ast),map:null})}function u(e,t){return l("stylesheet",e,t)}function c(e,t){return l("block",e,t)}var p=e("./parser"),f=e("./compressor"),h=e("./utils/translate"),d=e("./utils/translateWithSourceMap"),m=e("./utils/walk"),g=e("./utils/clone"),v=e("./utils/list");t.exports={version:e("../package.json").version,List:v,minify:u,minifyBlock:c,parse:p,compress:f,translate:h,translateWithSourceMap:d,walk:m.all,walkRules:m.rules,walkRulesRight:m.rulesRight,clone:g}},{"../package.json":57,"./compressor":21,"./parser":38,"./utils/clone":40,"./utils/list":41,"./utils/translate":43,"./utils/translateWithSourceMap":44,"./utils/walk":45}],37:[function(e,t,r){r.TokenType={String:"String",Comment:"Comment",Unknown:"Unknown",Newline:"Newline",Space:"Space",Tab:"Tab",ExclamationMark:"ExclamationMark",QuotationMark:"QuotationMark",NumberSign:"NumberSign",DollarSign:"DollarSign",PercentSign:"PercentSign",Ampersand:"Ampersand",Apostrophe:"Apostrophe",LeftParenthesis:"LeftParenthesis",RightParenthesis:"RightParenthesis",Asterisk:"Asterisk",PlusSign:"PlusSign",Comma:"Comma",HyphenMinus:"HyphenMinus",FullStop:"FullStop",Solidus:"Solidus",Colon:"Colon",Semicolon:"Semicolon",LessThanSign:"LessThanSign",EqualsSign:"EqualsSign",GreaterThanSign:"GreaterThanSign",QuestionMark:"QuestionMark",CommercialAt:"CommercialAt",LeftSquareBracket:"LeftSquareBracket",ReverseSolidus:"ReverseSolidus",RightSquareBracket:"RightSquareBracket",CircumflexAccent:"CircumflexAccent",LowLine:"LowLine",LeftCurlyBracket:"LeftCurlyBracket",VerticalLine:"VerticalLine",RightCurlyBracket:"RightCurlyBracket",Tilde:"Tilde",Identifier:"Identifier",DecimalNumber:"DecimalNumber"}},{}],38:[function(e,t,r){"use strict";function n(e){var t,r=new Error(e),n=0,o=1,i=1;throw null!==fe.token?(n=fe.token.offset,o=fe.token.line,i=fe.token.column):null!==fe.prevToken&&(t=fe.prevToken.value.trimRight(),n=fe.prevToken.offset+t.length,t=t.split(/\n|\r\n?|\f/),o=fe.prevToken.line+t.length-1,i=t.length>1?t[t.length-1].length+1:fe.prevToken.column+t[t.length-1].length),r.name="CssSyntaxError",r.parseError={offset:n,line:o,column:i},r}function o(e){return null!==fe.token&&fe.token.type===e?(fe.next(),!0):void n(e+" is expected")}function i(e,t){return null!==fe.token&&fe.token.type===he.Identifier&&fe.token.value.toLowerCase()===e?(t&&fe.next(),!0):void n("Identifier `"+e+"` is expected")}function a(e){if(null!==fe.token)for(var t=1,r=fe.token.type;t<arguments.length;t++)if(r===arguments[t])return!0;n(e+" is expected")}function s(){return ce&&fe.token?{source:pe,offset:fe.token.offset,line:fe.token.line,column:fe.token.column}:null}function l(e){for(;e.tail&&"Space"===e.tail.data.type;)e.remove(e.tail)}function u(e){var t=null,r={type:"StyleSheet",info:s(),rules:new me};e:for(;null!==fe.token;){switch(fe.token.type){case he.Space:fe.next(),t=null;break;case he.Comment:e||"!"!==fe.token.value.charAt(2)?(fe.next(),t=null):t=R();break;case he.Unknown:t=c();break;case he.CommercialAt:t=h();break;case he.RightCurlyBracket:e||n("Unexpected right curly brace");break e;default:t=d()}null!==t&&r.rules.insert(me.createItem(t))}return r}function c(){var e=s(),t=fe.token.value;return o(he.Unknown),{type:"Unknown",info:e,value:t}}function p(){for(var e,t=1;e=fe.lookup(t);t++){var r=e.type;if(r===he.RightCurlyBracket)return!0;if(r===he.LeftCurlyBracket||r===he.CommercialAt)return!1}return!0}function f(){var e=null,t={type:"AtruleExpression",info:s(),sequence:new me};e:for(;null!==fe.token;){switch(fe.token.type){case he.Semicolon:break e;case he.LeftCurlyBracket:break e;case he.Space:t.sequence.isEmpty()?(fe.next(),e=null):e=ae();break;case he.Comment:fe.next(),e=null;break;case he.Comma:e=X();break;case he.Colon:e=ne();break;case he.LeftParenthesis:e=_(ge);break;default:e=C(ge)}null!==e&&t.sequence.insert(me.createItem(e))}return l(t.sequence),t}function h(){o(he.CommercialAt);var e={type:"Atrule",info:s(),name:V(!1),expression:f(),block:null};if(null!==fe.token)switch(fe.token.type){case he.Semicolon:fe.next();break;case he.LeftCurlyBracket:fe.next(),p()?e.block=b():e.block=u(!0),o(he.RightCurlyBracket);break;default:n("Unexpected input")}return e}function d(){return{type:"Ruleset",info:s(),selector:m(),block:y()}}function m(){var e=!1,t=!0,r={type:"Selector",info:s(),selectors:new me};e:for(;null!==fe.token;)switch(fe.token.type){case he.LeftCurlyBracket:break e;case he.Comma:t&&(e=!0),t=!0,fe.next();break;default:t||(e=!0),t=!1,r.selectors.insert(me.createItem(g())),r.selectors.tail.data.sequence.isEmpty()&&(e=!0)}return t&&(e=!0),e&&(r.selectors=new me),r}function g(e){var t=null,r=null,o={type:"SimpleSelector",info:s(),sequence:new me};e:for(;null!==fe.token;){switch(fe.token.type){case he.Comma:break e;case he.LeftCurlyBracket:e&&n("Unexpected input");break e;case he.RightParenthesis:e||n("Unexpected input");break e;case he.Comment:fe.next(),t=null;break;case he.Space:t=null,!r&&o.sequence.head?r=M():fe.next();break;case he.PlusSign:case he.GreaterThanSign:case he.Tilde:case he.Solidus:r&&" "!==r.name&&n("Unexpected combinator"),t=null,r=M();break;case he.FullStop:t=j();break;case he.LeftSquareBracket:t=A();break;case he.NumberSign:t=L();break;case he.Colon:t=ne();break;case he.LowLine:case he.Identifier:case he.Asterisk:t=$(!1);break;case he.HyphenMinus:case he.DecimalNumber:t=E()||$(!1);break;default:n("Unexpected input")}null!==t&&(null!==r&&(o.sequence.insert(me.createItem(r)),r=null),o.sequence.insert(me.createItem(t)))}return r&&" "!==r.name&&n("Unexpected combinator"),o}function v(){var e=null,t=new me;e:for(;null!==fe.token;){switch(fe.token.type){case he.RightCurlyBracket:break e;case he.Space:case he.Comment:fe.next(),e=null;break;case he.Semicolon:fe.next(),e=null;break;default:e=k()}null!==e&&t.insert(me.createItem(e))}return t}function y(){var e,t=s();return o(he.LeftCurlyBracket),e={type:"Block",info:t,declarations:v()},o(he.RightCurlyBracket),e}function b(){return{type:"Block",info:s(),declarations:v()}}function k(e){var t,r=s(),n=w();return o(he.Colon),t=/filter$/.test(n.name.toLowerCase())&&te()?ee():S(e),{type:"Declaration",info:r,property:n,value:t}}function w(){for(var e="",t={type:"Property",info:s(),name:null};null!==fe.token;fe.next()){var r=fe.token.type;if(r!==he.Solidus&&r!==he.Asterisk&&r!==he.DollarSign)break;e+=fe.token.value}return t.name=e+V(!0),se(),t}function S(e){var t=null,r={type:"Value",info:s(),important:!1,sequence:new me};se();e:for(;null!==fe.token;){switch(fe.token.type){case he.RightCurlyBracket:case he.Semicolon:break e;case he.RightParenthesis:e||n("Unexpected input");break e;case he.Space:t=ae();break;case he.Comment:fe.next(),t=null;break;case he.NumberSign:t=ue();break;case he.Solidus:case he.Comma:t=X();break;case he.LeftParenthesis:case he.LeftSquareBracket:t=_(ye);break;case he.ExclamationMark:r.important=J(),t=null;break;default:if(fe.token.type===he.Identifier){var o=fe.token.value;if(("U"===o||"u"===o)&&fe.lookupType(1,he.PlusSign)){fe.next(),fe.next(),t={type:"Identifier",info:s(),name:o+"+"+H(!0)};break}}t=C(ye)}null!==t&&r.sequence.insert(me.createItem(t))}return l(r.sequence),r}function C(e){switch(fe.token.type){case he.String:return le();case he.LowLine:case he.Identifier:break;case he.FullStop:case he.DecimalNumber:case he.HyphenMinus:case he.PlusSign:var t=Z();if(null!==t){if(null!==fe.token){if(fe.token.type===he.PercentSign)return q(t);if(fe.token.type===he.Identifier)return O(t.value)}return t}if(fe.token.type===he.HyphenMinus){var r=fe.lookup(1);if(r&&(r.type===he.Identifier||r.type===he.HyphenMinus))break}if(fe.token.type===he.HyphenMinus||fe.token.type===he.PlusSign)return X();n("Unexpected input");default:n("Unexpected input")}var o=W(!1);return null!==fe.token&&fe.token.type===he.LeftParenthesis?N(e,o):o}function x(){a("Attribute selector (=, ~=, ^=, $=, *=, |=)",he.EqualsSign,he.Tilde,he.CircumflexAccent,he.DollarSign,he.Asterisk,he.VerticalLine);var e;return fe.token.type===he.EqualsSign?(e="=",fe.next()):(e=fe.token.value+"=",fe.next(),o(he.EqualsSign)),e}function A(){var e={type:"Attribute",info:s(),name:null,operator:null,value:null,flags:null};return o(he.LeftSquareBracket),se(),e.name=$(!0),se(),null!==fe.token&&fe.token.type!==he.RightSquareBracket&&(fe.token.type!==he.Identifier&&(e.operator=x(),se(),null!==fe.token&&fe.token.type===he.String?e.value=le():e.value=W(!1),se()),null!==fe.token&&fe.token.type===he.Identifier&&(e.flags=fe.token.value,fe.next(),se())),o(he.RightSquareBracket),e}function _(e){var t,r=null,n={type:"Braces",info:s(),open:fe.token.value,close:null,sequence:new me};t=fe.token.type===he.LeftParenthesis?he.RightParenthesis:he.RightSquareBracket,fe.next(),se();e:for(;null!==fe.token;){switch(fe.token.type){case t:n.close=fe.token.value;break e;case he.Space:r=ae();break;case he.Comment:fe.next(),r=null;break;case he.NumberSign:r=ue();break;case he.LeftParenthesis:case he.LeftSquareBracket:r=_(e);break;case he.Solidus:case he.Asterisk:case he.Comma:case he.Colon:r=X();break;default:r=C(e)}null!==r&&n.sequence.insert(me.createItem(r))}return l(n.sequence),o(t),n}function j(){var e=s();return o(he.FullStop),{type:"Class",info:e,name:V(!1)}}function L(){var e=s();return o(he.NumberSign),{type:"Id",info:e,name:V(!1)}}function M(){var e,t=s();switch(fe.token.type){case he.Space:e=" ",fe.next();break;case he.PlusSign:case he.GreaterThanSign:case he.Tilde:e=fe.token.value,fe.next();break;case he.Solidus:e="/deep/",fe.next(),i("deep",!0),o(he.Solidus);break;default:n("Combinator (+, >, ~, /deep/) is expected")}return{type:"Combinator",info:t,name:e}}function R(){var e=s(),t=fe.token.value,r=t.length;return r>4&&"*"===t.charAt(r-2)&&"/"===t.charAt(r-1)&&(r-=2),fe.next(),{type:"Comment",info:e,value:t.substring(2,r)}}function P(){if(null!==fe.token&&fe.token.type===he.Identifier){var e=fe.token.value,t=e.indexOf("\\");return-1===t?(fe.next(),e):(fe.token.value=e.substr(t),fe.token.offset+=t,fe.token.column+=t,e.substr(0,t))}n("Identifier is expected")}function O(e){return{type:"Dimension",info:s(),value:e||Y(),unit:P()}}function E(){var e=Z();return e&&null!==fe.token&&fe.token.type===he.PercentSign?q(e):null}function q(e){var t;return e?(t=e.info,e=e.value):(t=s(),e=Y()),o(he.PercentSign),{type:"Percentage",info:t,value:e}}function N(e,t){var r=B;t||(t=W(!1));var n=t.name.toLowerCase();return be.hasOwnProperty(e)&&be[e].hasOwnProperty(n)?be[e][n](e,t):I(r,e,t)}function I(e,t,r){var n;return o(he.LeftParenthesis),n=e(t),o(he.RightParenthesis),{type:t===ve?"FunctionalPseudo":"Function",info:r.info,name:r.name,arguments:n}}function B(e){var t=new me,r=null,n=null;se();e:for(;null!==fe.token;){switch(fe.token.type){case he.RightParenthesis:break e;case he.Space:n=ae();break;case he.Comment:fe.next(),n=null;break;case he.NumberSign:n=ue();break;case he.LeftParenthesis:case he.LeftSquareBracket:n=_(e);break;case he.Comma:r?l(r.sequence):t.insert(me.createItem({type:"Argument",sequence:new me})),fe.next(),se(),r=null,n=null;break;case he.Solidus:case he.Asterisk:case he.Colon:case he.EqualsSign:n=X();break;default:n=C(e)}null===r&&(r={type:"Argument",sequence:new me},t.insert(me.createItem(r))),null!==n&&r.sequence.insert(me.createItem(n))}return null!==r&&l(r.sequence),t}function D(e,t){return I(F,e,t)}function T(){var e=new me,t=!1;e:for(;null!==fe.token;)switch(fe.token.type){case he.RightParenthesis:t||n("Simple selector is expected");break e;case he.Comma:t||n("Simple selector is expected"),t=!1,fe.next();break;default:t=!0,e.insert(me.createItem(g(!0)))}return e}function U(e,t){var r;return o(he.LeftParenthesis),r=T(e),o(he.RightParenthesis),{type:"Negation",info:t.info,sequence:r}}function F(){var e=new me;return se(),e.insert(me.createItem({type:"Argument",sequence:new me([W(!0)])})),se(),null!==fe.token&&fe.token.type===he.Comma&&(o(he.Comma),se(),e.insert(me.createItem({type:"Argument",sequence:new me([S(!0)])})),se()),e}function G(e,t){var r={type:"Url",info:t.info,value:null};if(o(he.LeftParenthesis),se(),fe.token.type===he.String)r.value=le(),se();else{for(var n=s(),i="";null!==fe.token;fe.next()){var a=fe.token.type;if(a===he.Space||a===he.LeftParenthesis||a===he.RightParenthesis)break;i+=fe.token.value}r.value={type:"Raw",info:n,value:i},se()}return o(he.RightParenthesis),r}function z(e,t){var r=0,n="";for(o(he.LeftParenthesis);null!==fe.token;fe.next()){if(fe.token.type===he.RightParenthesis){if(0===r)break;r--}else fe.token.type===he.LeftParenthesis&&r++;n+=fe.token.value}return o(he.RightParenthesis),{type:"Function",info:t.info,name:t.name,arguments:new me([{type:"Argument",sequence:new me([{type:"Raw",value:n}])}])}}function H(e){for(var t="";null!==fe.token&&(fe.token.type===he.DecimalNumber||fe.token.type===he.Identifier);fe.next())t+=fe.token.value;if(/^[0-9a-f]{1,6}$/i.test(t)||n("Unexpected input"),e)for(;t.length<6&&null!==fe.token&&fe.token.type===he.QuestionMark;fe.next())t+=fe.token.value,e=!1;if(e&&null!==fe.token&&fe.token.type===he.HyphenMinus){fe.next();var r=H(!1);r||n("Unexpected input"),t+="-"+r}return t}function V(e){var t="";if(null!==fe.token&&fe.token.type===he.HyphenMinus&&(t="-",fe.next(),e&&null!==fe.token&&fe.token.type===he.HyphenMinus&&(t="--",fe.next())),a("Identifier",he.LowLine,he.Identifier),null!==fe.token)for(t+=fe.token.value,fe.next();null!==fe.token;fe.next()){var r=fe.token.type;if(r!==he.LowLine&&r!==he.Identifier&&r!==he.DecimalNumber&&r!==he.HyphenMinus)break;t+=fe.token.value}return t}function $(e){null===fe.token&&n("Unexpected end of input");var t,r=s();return fe.token.type===he.Asterisk?(e=!1,t="*",fe.next()):t=V(!1),null!==fe.token&&fe.token.type===he.VerticalLine&&fe.lookupType(1,he.EqualsSign)===!1&&(t+="|",null!==fe.next()&&(fe.token.type===he.HyphenMinus||fe.token.type===he.Identifier||fe.token.type===he.LowLine?t+=V(!1):fe.token.type===he.Asterisk&&(e=!1,t+="*",fe.next()))),e&&null!==fe.token&&fe.token.type===he.Colon&&(fe.next(),t+=":"+V(!1)),{type:"Identifier",info:r,name:t}}function W(e){return{type:"Identifier",info:s(),name:V(e)}}function J(){return o(he.ExclamationMark),se(),i("important"),V(!1),!0}function Q(){a("Number, odd or even",he.Identifier,he.DecimalNumber);var e,t=s(),r=fe.token.value;if(fe.token.type===he.DecimalNumber){var o=fe.lookup(1);null!==o&&o.type===he.Identifier&&"n"===o.value.toLowerCase()&&(r+=o.value,fe.next())}else{var e=r.toLowerCase();"odd"!==e&&"even"!==e&&"n"!==e&&n("Unexpected identifier")}return fe.next(),{type:"Nth",info:t,value:r}}function K(){var e,t=s(),r=new me,n=null;o(he.Colon),i("nth",!1),e={type:"FunctionalPseudo",info:t,name:V(!1),arguments:new me([{type:"Argument",sequence:r}])},o(he.LeftParenthesis);e:for(;null!==fe.token;){switch(fe.token.type){case he.RightParenthesis:break e;case he.Space:case he.Comment:fe.next(),n=null;break;case he.HyphenMinus:case he.PlusSign:n=X();break;default:n=Q()}null!==n&&r.insert(me.createItem(n))}return o(he.RightParenthesis),e}function Y(){var e=!1,t="",r=0;if(fe.lookupType(r,he.HyphenMinus)&&(t="-",r++),fe.lookupType(r,he.DecimalNumber)&&(e=!0,t+=fe.lookup(r).value,r++),fe.lookupType(r,he.FullStop)&&(t+=".",r++),fe.lookupType(r,he.DecimalNumber)&&(e=!0,t+=fe.lookup(r).value,r++),e){for(;r--;)fe.next();return t}return null}function Z(){var e=s(),t=Y();return null!==t?{type:"Number",info:e,value:t}:null}function X(){var e={type:"Operator",info:s(),value:fe.token.value};return fe.next(),e}function ee(){for(var e,t={type:"Value",info:s(),important:!1,sequence:new me};e=te();)t.sequence.insert(me.createItem(re(e)));return se(t),null!==fe.token&&fe.token.type===he.ExclamationMark&&(t.important=J()),t}function te(){function e(e){for(var t;(t=fe.lookup(e))&&(t.type===he.Space||t.type===he.Comment);e++);return e}var t=e(0);if(null===fe.lookup(t+1)||"progid"!==fe.lookup(t+0).value.toLowerCase()||fe.lookup(t+1).type!==he.Colon)return!1;if(t+=2,t=e(t),null===fe.lookup(t+5)||"dximagetransform"!==fe.lookup(t+0).value.toLowerCase()||fe.lookup(t+1).type!==he.FullStop||"microsoft"!==fe.lookup(t+2).value.toLowerCase()||fe.lookup(t+3).type!==he.FullStop||fe.lookup(t+4).type!==he.Identifier)return!1;if(t+=5,t=e(t),fe.lookupType(t,he.LeftParenthesis)===!1)return!1;for(var r;r=fe.lookup(t);t++)if(r.type===he.RightParenthesis)return r;return!1}function re(e){var t="",r={type:"Progid",info:s(),value:null};e||(e=te()),e||n("progid is expected"),se(r);for(var i=s();fe.token&&fe.token!==e;fe.next())t+=fe.token.value;return o(he.RightParenthesis),t+=")",r.value={type:"Raw",info:i,value:t},se(r),r}function ne(){var e=fe.lookup(1);return null===e&&(fe.next(),n("Colon or identifier is expected")),e.type===he.Colon?oe():e.type===he.Identifier&&"nth"===e.value.toLowerCase()?K():ie()}function oe(){var e=s();return o(he.Colon),o(he.Colon),{type:"PseudoElement",info:e,name:V(!1)}}function ie(){var e=s(),t=o(he.Colon)&&W(!1);return null!==fe.token&&fe.token.type===he.LeftParenthesis?N(ve,t):{type:"PseudoClass",info:e,name:t.name}}function ae(){var e={type:"Space"};return fe.next(),e}function se(){e:for(;null!==fe.token;)switch(fe.token.type){case he.Space:fe.next();break;case he.Comment:fe.next();break;default:break e}return null}function le(){var e={type:"String",info:s(),value:fe.token.value};return fe.next(),e}function ue(){var e,t=s();return o(he.NumberSign),a("Number or identifier",he.DecimalNumber,he.Identifier),e=fe.token.value,fe.token.type===he.DecimalNumber&&fe.lookupType(1,he.Identifier)&&(fe.next(),e+=fe.token.value),fe.next(),{type:"Hash",info:t,value:e}}var ce,pe,fe,he=e("./const").TokenType,de=e("./scanner"),me=e("../utils/list"),ge=1,ve=2,ye=3,be={};be[ge]={url:G},be[ve]={url:G,not:U},be[ye]={url:G,expression:z,"var":D};var ke={stylesheet:u,atrule:h,atruleExpression:f,ruleset:d,selector:m,simpleSelector:g,block:b,declaration:k,value:S},we={declaration:!0,property:!0};t.exports=function(e,t){var r;t&&"object"==typeof t||(t={});var n=t.context||"stylesheet";if(ce=Boolean(t.positions),pe=t.filename||"<unknown>",!ke.hasOwnProperty(n))throw new Error("Unknown context `"+n+"`");return fe=new de(e,we.hasOwnProperty(n),t.line,t.column),fe.next(),r=ke[n](),fe=null,r}},{"../utils/list":41,"./const":37,"./scanner":39}],39:[function(e,t,r){"use strict";var n=e("./const.js").TokenType,o=9,i=10,a=12,s=13,l=32,u=34,c=39,p=41,f=42,h=47,d=92,m=95,g=123,v=125,y=1,b=2,k=3,w=4,S={9:n.Tab,10:n.Newline,13:n.Newline,32:n.Space,33:n.ExclamationMark,34:n.QuotationMark,35:n.NumberSign,36:n.DollarSign,37:n.PercentSign,38:n.Ampersand,39:n.Apostrophe,40:n.LeftParenthesis,41:n.RightParenthesis,42:n.Asterisk,43:n.PlusSign,44:n.Comma,45:n.HyphenMinus,46:n.FullStop,47:n.Solidus,58:n.Colon,59:n.Semicolon,60:n.LessThanSign,61:n.EqualsSign,62:n.GreaterThanSign,63:n.QuestionMark,64:n.CommercialAt,91:n.LeftSquareBracket,93:n.RightSquareBracket,94:n.CircumflexAccent,95:n.LowLine,123:n.LeftCurlyBracket,124:n.VerticalLine,125:n.RightCurlyBracket,126:n.Tilde},C=Math.max.apply(null,Object.keys(S))+1,x=new Uint32Array(C),A=new Uint32Array(C);Object.keys(S).forEach(function(e){x[Number(e)]=b,A[Number(e)]=b},x),A[m]=0;for(var _=48;57>=_;_++)x[_]=k;x[l]=y,x[o]=y,x[i]=y,x[s]=y,x[a]=y,x[c]=w,x[u]=w;var j=function(e,t,r,n){this.source=e,this.pos=65279===e.charCodeAt(0)?1:0,this.eof=this.pos===this.source.length,this.line="undefined"==typeof r?1:r,this.lineStartPos="undefined"==typeof n?-1:-n,this.minBlockMode=t?1:0,this.blockMode=this.minBlockMode,this.urlMode=!1,this.prevToken=null,this.token=null,this.buffer=[]};j.prototype={lookup:function(e){if(0===e)return this.token;for(var t=this.buffer.length;!this.eof&&e>t;t++)this.buffer.push(this.getToken());return e<=this.buffer.length?this.buffer[e-1]:null},lookupType:function(e,t){var r=this.lookup(e);return null!==r&&r.type===t},next:function(){var e=null;return 0!==this.buffer.length?e=this.buffer.shift():this.eof||(e=this.getToken()),this.prevToken=this.token,this.token=e,e},tokenize:function(){for(var e=[];this.pos<this.source.length;this.pos++)e.push(this.getToken());return e},getToken:function(){var e,t,r,o=this.source.charCodeAt(this.pos),i=this.line,a=this.pos-this.lineStartPos,s=this.pos;switch(C>o?x[o]:0){case k:t=n.DecimalNumber,r=this.readDecimalNumber();break;case w:t=n.String,r=this.readString(o);break;case y:t=n.Space,r=this.readSpaces();break;case b:if(o===h){if(e=this.pos+1<this.source.length?this.source.charCodeAt(this.pos+1):0,e===f){t=n.Comment,r=this.readComment();break}if(e===h&&!this.urlMode){if(this.blockMode>0){for(var l=2;this.source.charCodeAt(this.pos+2)===h;)l++;t=n.Identifier,r=this.readIdentifier(l),this.urlMode=this.urlMode||"url"===r}else t=n.Unknown,r=this.readUnknown();break}}t=S[o],r=String.fromCharCode(o),this.pos++,o===p?this.urlMode=!1:o===g?this.blockMode++:o===v&&this.blockMode>this.minBlockMode&&this.blockMode--;break;default:t=n.Identifier,r=this.readIdentifier(0),this.urlMode=this.urlMode||"url"===r}return this.eof=this.pos===this.source.length,{type:t,value:r,offset:s,line:i,column:a}},isNewline:function(e){return e===i||e===a||e===s?(e===s&&this.pos+1<this.source.length&&this.source.charCodeAt(this.pos+1)===i&&this.pos++,this.line++,this.lineStartPos=this.pos,!0):!1},readSpaces:function(){for(var e=this.pos;this.pos<this.source.length;this.pos++){var t=this.source.charCodeAt(this.pos);if(!this.isNewline(t)&&t!==l&&t!==o)break}return this.source.substring(e,this.pos)},readComment:function(){var e=this.pos;for(this.pos+=2;this.pos<this.source.length;this.pos++){var t=this.source.charCodeAt(this.pos);if(t===f){if(this.source.charCodeAt(this.pos+1)===h){this.pos+=2;break}}else this.isNewline(t)}return this.source.substring(e,this.pos)},readUnknown:function(){var e=this.pos;for(this.pos+=2;this.pos<this.source.length&&!this.isNewline(this.source.charCodeAt(this.pos),this.source);this.pos++);return this.source.substring(e,this.pos)},readString:function(e){var t=this.pos,r="";for(this.pos++;this.pos<this.source.length;this.pos++){var n=this.source.charCodeAt(this.pos);if(n===d){var o=this.pos++;this.isNewline(this.source.charCodeAt(this.pos),this.source)&&(r+=this.source.substring(t,o),t=this.pos+1)}else if(n===e){this.pos++;break}}return r+this.source.substring(t,this.pos)},readDecimalNumber:function(){var e,t=this.pos;for(this.pos++;this.pos<this.source.length&&(e=this.source.charCodeAt(this.pos),!(48>e||e>57));this.pos++);return this.source.substring(t,this.pos)},readIdentifier:function(e){var t=this.pos;for(this.pos+=e;this.pos<this.source.length;this.pos++){var r=this.source.charCodeAt(this.pos);if(r===d){this.pos++;for(var n=0;7>n&&this.pos+n<this.source.length;n++)if(r=this.source.charCodeAt(this.pos+n),6===n||!(r>=48&&57>=r||r>=65&&70>=r||r>=97&&102>=r)){n>0&&(this.pos+=n-1,(r===l||r===o||this.isNewline(r))&&this.pos++);break}}else if(C>r&&A[r]===b)break}return this.source.substring(t,this.pos)}},new j("\n\r\r\n\f//\"\"''/**/1a;.{url(a)}").lookup(1e3),t.exports=j},{"./const.js":37}],40:[function(e,t,r){var n=e("./list");t.exports=function o(e){var t={};for(var r in e){var i=e[r];i&&(Array.isArray(i)?i=i.slice(0):i instanceof n?i=new n(i.map(o)):i.constructor===Object&&(i=o(i))),t[r]=i}return t}},{"./list":41}],41:[function(e,t,r){function n(e){return{data:e,next:null,prev:null}}var o=function(e){if(this.cursor=null,this.head=null,this.tail=null,Array.isArray(e)){for(var t=null,r=0;r<e.length;r++){var o=n(e[r]);null!==t?t.next=o:this.head=o,o.prev=t,t=o}this.tail=t}};Object.defineProperty(o.prototype,"size",{get:function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e}}),o.createItem=n,o.prototype.createItem=n,o.prototype.toArray=function(){for(var e=this.head,t=[];e;)t.push(e.data),e=e.next;return t},o.prototype.toJSON=function(){return this.toArray()},o.prototype.isEmpty=function(){return null===this.head},o.prototype.first=function(){return this.head&&this.head.data},o.prototype.last=function(){return this.tail&&this.tail.data},o.prototype.each=function(e,t){var r,n={prev:null,next:this.head,cursor:this.cursor};for(void 0===t&&(t=this),this.cursor=n;null!==n.next;)r=n.next,n.next=r.next,e.call(t,r.data,r,this);this.cursor=this.cursor.cursor},o.prototype.eachRight=function(e,t){var r,n={prev:this.tail,next:null,cursor:this.cursor};for(void 0===t&&(t=this),this.cursor=n;null!==n.prev;)r=n.prev,n.prev=r.prev,e.call(t,r.data,r,this);this.cursor=this.cursor.cursor},o.prototype.nextUntil=function(e,t,r){if(null!==e){var n,o={prev:null,next:e,cursor:this.cursor};for(void 0===r&&(r=this),this.cursor=o;null!==o.next&&(n=o.next,o.next=n.next,!t.call(r,n.data,n,this)););this.cursor=this.cursor.cursor}},o.prototype.prevUntil=function(e,t,r){if(null!==e){var n,o={prev:e,next:null,cursor:this.cursor};for(void 0===r&&(r=this),this.cursor=o;null!==o.prev&&(n=o.prev,o.prev=n.prev,!t.call(r,n.data,n,this)););this.cursor=this.cursor.cursor}},o.prototype.some=function(e,t){var r=this.head;for(void 0===t&&(t=this);null!==r;){if(e.call(t,r.data,r,this))return!0;r=r.next}return!1},o.prototype.map=function(e,t){var r=[],n=this.head;for(void 0===t&&(t=this);null!==n;)r.push(e.call(t,n.data,n,this)),n=n.next;return r},o.prototype.copy=function(){for(var e=new o,t=this.head;null!==t;)e.insert(n(t.data)),t=t.next;return e},o.prototype.updateCursors=function(e,t,r,n){for(var o=this.cursor;null!==o;)t!==!0&&o.prev!==e||(o.prev=t),n!==!0&&o.next!==r||(o.next=n),o=o.cursor},o.prototype.insert=function(e,t){if(void 0!==t&&null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't below to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e},o.prototype.remove=function(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't below to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't below to list");this.tail=e.prev}return e.prev=null,e.next=null,e},o.prototype.appendList=function(e){null!==e.head&&(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail,e.head=null,e.tail=null)},t.exports=o},{}],42:[function(e,t,r){function n(e){if("-"===e[0]){var t=e.indexOf("-",2);if(-1!==t)return e.substr(0,t+1)}return""}function o(e){if(a.call(s,e))return s[e];var t=e.toLowerCase(),r=n(t),o=t;return r&&(o=o.substr(r.length)),s[e]=Object.freeze({vendor:r,prefix:r,name:o})}function i(e){if(a.call(l,e))return l[e];var t=e.toLowerCase(),r=t[0];"*"===r||"_"===r||"$"===r?t=t.substr(1):"/"===r&&"/"===e[1]?(r="//",t=t.substr(2)):r="";var o=n(t),i=t;return o&&(i=i.substr(o.length)),l[e]=Object.freeze({hack:r,vendor:o,prefix:r+o,name:i})}var a=Object.prototype.hasOwnProperty,s=Object.create(null),l=Object.create(null);t.exports={keyword:o,property:i}},{}],43:[function(e,t,r){function n(e){return null===e.head?"":e.head===e.tail?i(e.head.data):e.map(i).join("")}function o(e,t){return null===e.head?"":e.head===e.tail?i(e.head.data):e.map(i).join(t)}function i(e){switch(e.type){case"StyleSheet":return n(e.rules);case"Atrule":var t=["@",e.name];return e.expression&&!e.expression.sequence.isEmpty()&&t.push(" ",i(e.expression)),e.block?t.push("{",i(e.block),"}"):t.push(";"),t.join("");case"Ruleset":return i(e.selector)+"{"+i(e.block)+"}";case"Selector":return o(e.selectors,",");case"SimpleSelector":var t=e.sequence.map(function(e){return"Combinator"===e.type&&"/deep/"===e.name?" "+i(e)+" ":i(e)});return t.join("");case"Block":return o(e.declarations,";");case"Declaration":return i(e.property)+":"+i(e.value);case"Property":return e.name;case"Value":return e.important?n(e.sequence)+"!important":n(e.sequence);case"Attribute":var r=i(e.name),a=" ";return null!==e.operator&&(r+=e.operator,null!==e.value&&(r+=i(e.value),"String"===e.value.type&&(a=""))),null!==e.flags&&(r+=a+e.flags),"["+r+"]";case"FunctionalPseudo":return":"+e.name+"("+o(e.arguments,",")+")";case"Function":return e.name+"("+o(e.arguments,",")+")";case"Negation":return":not("+o(e.sequence,",")+")";case"Braces":return e.open+n(e.sequence)+e.close;case"Argument":case"AtruleExpression":return n(e.sequence);case"Url":return"url("+i(e.value)+")";case"Progid":return i(e.value);case"Combinator":return e.name;case"Identifier":return e.name;case"PseudoClass":return":"+e.name;case"PseudoElement":return"::"+e.name;case"Class":return"."+e.name;case"Id":return"#"+e.name;case"Hash":return"#"+e.value;case"Dimension":return e.value+e.unit;case"Nth":return e.value;case"Number":return e.value;case"String":return e.value;case"Operator":return e.value;case"Raw":return e.value;case"Unknown":return e.value;case"Percentage":return e.value+"%";case"Space":return" ";case"Comment":return"/*"+e.value+"*/";default:throw new Error("Unknown node type: "+e.type)}}t.exports=i},{}],44:[function(e,t,r){function n(e,t){for(var r,o=0;o<e.children.length;o++)r=e.children[o],r instanceof p?n(r,t):t(r,e)}function o(e){var t,r=new c,o="",i=!1,a=null,s=null,l={line:1,column:0},u={generated:l};return n(e,function(e,n){null!==n.line&&null!==n.column?(a===n.line&&s===n.column||r.addMapping({source:n.source,original:n,generated:l}),a=n.line,s=n.column,i=!0):i&&(r.addMapping(u),i=!1),o+=e,t=e.lastIndexOf("\n"),-1!==t?(l.line+=e.match(/\n/g).length,l.column=e.length-t-1):l.column+=e.length}),{css:o,map:r}}function i(e){return new p(null,null,null,e)}function a(e,t){return e.primary?a(e.primary,t):new p(e.line,e.column-1,e.source,t)}function s(e){return null===e.head?"":e.head===e.tail?u(e.head.data):e.map(u).join("")}function l(e,t){return null===e.head?"":e.head===e.tail?u(e.head.data):e.map(u).join(t)}function u(e){switch(e.type){
case"StyleSheet":return i(e.rules.map(u));case"Atrule":var t=["@",e.name];return e.expression&&!e.expression.sequence.isEmpty()&&t.push(" ",u(e.expression)),e.block?t.push("{",u(e.block),"}"):t.push(";"),a(e.info,t);case"Ruleset":return i([u(e.selector),"{",u(e.block),"}"]);case"Selector":return i(e.selectors.map(u)).join(",");case"SimpleSelector":var t=e.sequence.map(function(e){return"Combinator"===e.type&&"/deep/"===e.name?" "+u(e)+" ":u(e)});return a(e.info,t);case"Block":return i(e.declarations.map(u)).join(";");case"Declaration":return a(e.info,[u(e.property),":",u(e.value)]);case"Property":return e.name;case"Value":return e.important?s(e.sequence)+"!important":s(e.sequence);case"Attribute":var r=u(e.name),n=" ";return null!==e.operator&&(r+=e.operator,null!==e.value&&(r+=u(e.value),"String"===e.value.type&&(n=""))),null!==e.flags&&(r+=n+e.flags),"["+r+"]";case"FunctionalPseudo":return":"+e.name+"("+l(e.arguments,",")+")";case"Function":return e.name+"("+l(e.arguments,",")+")";case"Negation":return":not("+l(e.sequence,",")+")";case"Braces":return e.open+s(e.sequence)+e.close;case"Argument":case"AtruleExpression":return s(e.sequence);case"Url":return"url("+u(e.value)+")";case"Progid":return u(e.value);case"Combinator":return e.name;case"Identifier":return e.name;case"PseudoClass":return":"+e.name;case"PseudoElement":return"::"+e.name;case"Class":return"."+e.name;case"Id":return"#"+e.name;case"Hash":return"#"+e.value;case"Dimension":return e.value+e.unit;case"Nth":return e.value;case"Number":return e.value;case"String":return e.value;case"Operator":return e.value;case"Raw":return e.value;case"Unknown":return e.value;case"Percentage":return e.value+"%";case"Space":return" ";case"Comment":return"/*"+e.value+"*/";default:throw new Error("Unknown node type: "+e.type)}}var c=e("source-map").SourceMapGenerator,p=e("source-map").SourceNode;t.exports=function(e){return o(i(u(e)))}},{"source-map":56}],45:[function(e,t,r){function n(e,t,r){switch(e.type){case"StyleSheet":var o=this.stylesheet;this.stylesheet=e,e.rules.each(n,this),this.stylesheet=o;break;case"Atrule":null!==e.block&&n.call(this,e.block),this.fn(e,t,r);break;case"Ruleset":this.fn(e,t,r)}}function o(e,t,r){switch(e.type){case"StyleSheet":var n=this.stylesheet;this.stylesheet=e,e.rules.eachRight(o,this),this.stylesheet=n;break;case"Atrule":null!==e.block&&o.call(this,e.block),this.fn(e,t,r);break;case"Ruleset":this.fn(e,t,r)}}function i(e,t,r){switch(e.type){case"StyleSheet":var n=this.stylesheet;this.stylesheet=e,e.rules.each(i,this),this.stylesheet=n;break;case"Atrule":null!==e.expression&&i.call(this,e.expression),null!==e.block&&i.call(this,e.block);break;case"Ruleset":this.ruleset=e,null!==e.selector&&i.call(this,e.selector),i.call(this,e.block),this.ruleset=null;break;case"Selector":var o=this.selector;this.selector=e,e.selectors.each(i,this),this.selector=o;break;case"Block":e.declarations.each(i,this);break;case"Declaration":this.declaration=e,i.call(this,e.property),i.call(this,e.value),this.declaration=null;break;case"Attribute":i.call(this,e.name),null!==e.value&&i.call(this,e.value);break;case"FunctionalPseudo":case"Function":this["function"]=e,e.arguments.each(i,this),this["function"]=null;break;case"AtruleExpression":this.atruleExpression=e,e.sequence.each(i,this),this.atruleExpression=null;break;case"Value":case"Argument":case"SimpleSelector":case"Braces":case"Negation":e.sequence.each(i,this);break;case"Url":case"Progid":i.call(this,e.value)}this.fn(e,t,r)}function a(e,t){var r={fn:t,root:e,stylesheet:null,atruleExpression:null,ruleset:null,selector:null,declaration:null,"function":null};return r}t.exports={all:function(e,t){i.call(a(e,t),e)},rules:function(e,t){n.call(a(e,t),e)},rulesRight:function(e,t){o.call(a(e,t),e)}}},{}],46:[function(e,t,r){function n(){this._array=[],this._set=Object.create(null)}var o=e("./util"),i=Object.prototype.hasOwnProperty;n.fromArray=function(e,t){for(var r=new n,o=0,i=e.length;i>o;o++)r.add(e[o],t);return r},n.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(e,t){var r=o.toSetString(e),n=i.call(this._set,r),a=this._array.length;n&&!t||this._array.push(e),n||(this._set[r]=a)},n.prototype.has=function(e){var t=o.toSetString(e);return i.call(this._set,t)},n.prototype.indexOf=function(e){var t=o.toSetString(e);if(i.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},n.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},n.prototype.toArray=function(){return this._array.slice()},r.ArraySet=n},{"./util":55}],47:[function(e,t,r){function n(e){return 0>e?(-e<<1)+1:(e<<1)+0}function o(e){var t=1===(1&e),r=e>>1;return t?-r:r}var i=e("./base64"),a=5,s=1<<a,l=s-1,u=s;r.encode=function(e){var t,r="",o=n(e);do t=o&l,o>>>=a,o>0&&(t|=u),r+=i.encode(t);while(o>0);return r},r.decode=function(e,t,r){var n,s,c=e.length,p=0,f=0;do{if(t>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(s=i.decode(e.charCodeAt(t++)),-1===s)throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(s&u),s&=l,p+=s<<f,f+=a}while(n);r.value=o(p),r.rest=t}},{"./base64":48}],48:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(e>=0&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},r.decode=function(e){var t=65,r=90,n=97,o=122,i=48,a=57,s=43,l=47,u=26,c=52;return e>=t&&r>=e?e-t:e>=n&&o>=e?e-n+u:e>=i&&a>=e?e-i+c:e==s?62:e==l?63:-1}},{}],49:[function(e,t,r){function n(e,t,o,i,a,s){var l=Math.floor((t-e)/2)+e,u=a(o,i[l],!0);return 0===u?l:u>0?t-l>1?n(l,t,o,i,a,s):s==r.LEAST_UPPER_BOUND?t<i.length?t:-1:l:l-e>1?n(e,l,o,i,a,s):s==r.LEAST_UPPER_BOUND?l:0>e?-1:e}r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.search=function(e,t,o,i){if(0===t.length)return-1;var a=n(-1,t.length,e,t,o,i||r.GREATEST_LOWER_BOUND);if(0>a)return-1;for(;a-1>=0&&0===o(t[a],t[a-1],!0);)--a;return a}},{}],50:[function(e,t,r){function n(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,a=t.generatedColumn;return n>r||n==r&&a>=o||i.compareByGeneratedPositionsInflated(e,t)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=e("./util");o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},r.MappingList=o},{"./util":55}],51:[function(e,t,r){function n(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function o(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,r,a){if(a>r){var s=o(r,a),l=r-1;n(e,s,a);for(var u=e[a],c=r;a>c;c++)t(e[c],u)<=0&&(l+=1,n(e,l,c));n(e,l+1,c);var p=l+1;i(e,t,r,p-1),i(e,t,p+1,a)}}r.quickSort=function(e,t){i(e,t,0,e.length-1)}},{}],52:[function(e,t,r){function n(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new a(t):new o(t)}function o(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=s.getArg(t,"version"),n=s.getArg(t,"sources"),o=s.getArg(t,"names",[]),i=s.getArg(t,"sourceRoot",null),a=s.getArg(t,"sourcesContent",null),l=s.getArg(t,"mappings"),c=s.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);n=n.map(String).map(s.normalize).map(function(e){return i&&s.isAbsolute(i)&&s.isAbsolute(e)?s.relative(i,e):e}),this._names=u.fromArray(o.map(String),!0),this._sources=u.fromArray(n,!0),this.sourceRoot=i,this.sourcesContent=a,this._mappings=l,this.file=c}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function a(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=s.getArg(t,"version"),o=s.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new u,this._names=new u;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=s.getArg(e,"offset"),r=s.getArg(t,"line"),o=s.getArg(t,"column");if(r<i.line||r===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=t,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new n(s.getArg(e,"map"))}})}var s=e("./util"),l=e("./binary-search"),u=e("./array-set").ArraySet,c=e("./base64-vlq"),p=e("./quick-sort").quickSort;n.fromSourceMap=function(e){return o.fromSourceMap(e)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},n.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(e,t,r){var o,i=t||null,a=r||n.GENERATED_ORDER;switch(a){case n.GENERATED_ORDER:o=this._generatedMappings;break;case n.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;o.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=l&&(t=s.join(l,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},n.prototype.allGeneratedPositionsFor=function(e){var t=s.getArg(e,"line"),r={source:s.getArg(e,"source"),originalLine:t,originalColumn:s.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=s.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var n=[],o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,l.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var a=i.originalLine;i&&i.originalLine===a;)n.push({line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var u=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==u;)n.push({line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return n},r.SourceMapConsumer=n,o.prototype=Object.create(n.prototype),o.prototype.consumer=n,o.fromSourceMap=function(e){var t=Object.create(o.prototype),r=t._names=u.fromArray(e._names.toArray(),!0),n=t._sources=u.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),l=t.__generatedMappings=[],c=t.__originalMappings=[],f=0,h=a.length;h>f;f++){var d=a[f],m=new i;m.generatedLine=d.generatedLine,m.generatedColumn=d.generatedColumn,d.source&&(m.source=n.indexOf(d.source),m.originalLine=d.originalLine,m.originalColumn=d.originalColumn,d.name&&(m.name=r.indexOf(d.name)),c.push(m)),l.push(m)}return p(t.__originalMappings,s.compareByOriginalPositions),t},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?s.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,t){for(var r,n,o,a,l,u=1,f=0,h=0,d=0,m=0,g=0,v=e.length,y=0,b={},k={},w=[],S=[];v>y;)if(";"===e.charAt(y))u++,y++,f=0;else if(","===e.charAt(y))y++;else{for(r=new i,r.generatedLine=u,a=y;v>a&&!this._charIsMappingSeparator(e,a);a++);if(n=e.slice(y,a),o=b[n])y+=n.length;else{for(o=[];a>y;)c.decode(e,y,k),l=k.value,y=k.rest,o.push(l);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");b[n]=o}r.generatedColumn=f+o[0],f=r.generatedColumn,o.length>1&&(r.source=m+o[1],m+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=d+o[3],d=r.originalColumn,o.length>4&&(r.name=g+o[4],g+=o[4])),S.push(r),"number"==typeof r.originalLine&&w.push(r)}p(S,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,p(w,s.compareByOriginalPositions),this.__originalMappings=w},o.prototype._findMapping=function(e,t,r,n,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return l.search(e,t,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===t.generatedLine){var i=s.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=s.join(this.sourceRoot,i)));var a=s.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:s.getArg(o,"originalLine",null),column:s.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}):!1},o.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=s.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(n))return this.sourcesContent[this._sources.indexOf(n)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var r={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},r.BasicSourceMapConsumer=o,a.prototype=Object.create(n.prototype),a.prototype.constructor=n,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),a.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},r=l.search(t,this._sections,function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r?r:e.generatedColumn-t.generatedOffset.generatedColumn}),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},a.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r],o=n.consumer.sourceContentFor(e,!0);if(o)return o}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(s.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n){var o={line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},a.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],o=n.consumer._generatedMappings,i=0;i<o.length;i++){var a=o[i],l=n.consumer._sources.at(a.source);null!==n.consumer.sourceRoot&&(l=s.join(n.consumer.sourceRoot,l)),this._sources.add(l),l=this._sources.indexOf(l);var u=n.consumer._names.at(a.name);this._names.add(u),u=this._names.indexOf(u);var c={source:l,generatedLine:a.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(n.generatedOffset.generatedLine===a.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}p(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),p(this.__originalMappings,s.compareByOriginalPositions)},r.IndexedSourceMapConsumer=a},{"./array-set":46,"./base64-vlq":47,"./binary-search":49,"./quick-sort":51,"./util":55}],53:[function(e,t,r){function n(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new s,this._sourcesContents=null}var o=e("./base64-vlq"),i=e("./util"),a=e("./array-set").ArraySet,s=e("./mapping-list").MappingList;n.prototype._version=3,n.fromSourceMap=function(e){var t=e.sourceRoot,r=new n({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=i.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)}),e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)}),r},n.prototype.addMapping=function(e){var t=i.getArg(e,"generated"),r=i.getArg(e,"original",null),n=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:o})},n.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var o=this._sourceRoot;null!=o&&(n=i.relative(o,n));var s=new a,l=new a;this._mappings.unsortedForEach(function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=i.join(r,t.source)),null!=o&&(t.source=i.relative(o,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var u=t.source;null==u||s.has(u)||s.add(u);var c=t.name;null==c||l.has(c)||l.add(c)},this),this._sources=s,this._names=l,e.sources.forEach(function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),null!=o&&(t=i.relative(o,t)),this.setSourceContent(t,n))},this)},n.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},n.prototype._serializeMappings=function(){for(var e,t,r,n,a=0,s=1,l=0,u=0,c=0,p=0,f="",h=this._mappings.toArray(),d=0,m=h.length;m>d;d++){if(t=h[d],e="",t.generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(d>0){if(!i.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=o.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=o.encode(n-p),p=n,e+=o.encode(t.originalLine-1-u),u=t.originalLine-1,e+=o.encode(t.originalColumn-l),l=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=o.encode(r-c),c=r)),f+=e}return f},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},r.SourceMapGenerator=n},{"./array-set":46,"./base64-vlq":47,"./mapping-list":50,"./util":55}],54:[function(e,t,r){function n(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==o?null:o,this[l]=!0,null!=n&&this.add(n)}var o=e("./source-map-generator").SourceMapGenerator,i=e("./util"),a=/(\r?\n)/,s=10,l="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function o(e,t){if(null===e||void 0===e.source)s.add(t);else{var o=r?i.join(r,e.source):e.source;s.add(new n(e.originalLine,e.originalColumn,o,t,e.name))}}var s=new n,l=e.split(a),u=function(){var e=l.shift(),t=l.shift()||"";return e+t},c=1,p=0,f=null;return t.eachMapping(function(e){if(null!==f){if(!(c<e.generatedLine)){var t=l[0],r=t.substr(0,e.generatedColumn-p);return l[0]=t.substr(e.generatedColumn-p),p=e.generatedColumn,o(f,r),void(f=e)}o(f,u()),c++,p=0}for(;c<e.generatedLine;)s.add(u()),c++;if(p<e.generatedColumn){var t=l[0];s.add(t.substr(0,e.generatedColumn)),l[0]=t.substr(e.generatedColumn),p=e.generatedColumn}f=e},this),l.length>0&&(f&&o(f,u()),s.add(l.join(""))),t.sources.forEach(function(e){var n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=i.join(r,e)),s.setSourceContent(e,n))}),s},n.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},n.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,r=0,n=this.children.length;n>r;r++)t=this.children[r],t[l]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;n-1>r;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},n.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[l]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},n.prototype.setSourceContent=function(e,t){this.sourceContents[i.toSetString(e)]=t},n.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;r>t;t++)this.children[t][l]&&this.children[t].walkSourceContents(e);for(var n=Object.keys(this.sourceContents),t=0,r=n.length;r>t;t++)e(i.fromSetString(n[t]),this.sourceContents[n[t]])},n.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},n.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new o(e),n=!1,i=null,a=null,l=null,u=null;return this.walk(function(e,o){t.code+=e,null!==o.source&&null!==o.line&&null!==o.column?(i===o.source&&a===o.line&&l===o.column&&u===o.name||r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:t.line,column:t.column},name:o.name}),i=o.source,a=o.line,l=o.column,u=o.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),i=null,n=!1);for(var c=0,p=e.length;p>c;c++)e.charCodeAt(c)===s?(t.line++,t.column=0,c+1===p?(i=null,n=!1):n&&r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:t.line,column:t.column},name:o.name})):t.column++}),this.walkSourceContents(function(e,t){r.setSourceContent(e,t)}),{code:t.code,map:r}},r.SourceNode=n},{"./source-map-generator":53,"./util":55}],55:[function(e,t,r){function n(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')}function o(e){var t=e.match(v);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var t=e,n=o(e);if(n){if(!n.path)return e;t=n.path}for(var a,s=r.isAbsolute(t),l=t.split(/\/+/),u=0,c=l.length-1;c>=0;c--)a=l[c],"."===a?l.splice(c,1):".."===a?u++:u>0&&(""===a?(l.splice(c+1,u),u=0):(l.splice(c,2),u--));return t=l.join("/"),""===t&&(t=s?"/":"."),n?(n.path=t,i(n)):t}function s(e,t){""===e&&(e="."),""===t&&(t=".");var r=o(t),n=o(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),i(r);if(r||t.match(y))return t;if(n&&!n.host&&!n.path)return n.host=t,i(n);var s="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=s,i(n)):s}function l(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(0>n)return t;if(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}function u(e){return e}function c(e){return f(e)?"$"+e:e}function p(e){return f(e)?e.slice(1):e}function f(e){if(!e)return!1;var t=e.length;if(9>t)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function h(e,t,r){var n=e.source-t.source;return 0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n||r?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=e.generatedLine-t.generatedLine,0!==n?n:e.name-t.name))))}function d(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n||r?n:(n=e.source-t.source,0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:e.name-t.name))))}function m(e,t){return e===t?0:e>t?1:-1}function g(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=m(e.source,t.source),0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:m(e.name,t.name)))))}r.getArg=n;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,y=/^data:.+\,.+$/;r.urlParse=o,r.urlGenerate=i,r.normalize=a,r.join=s,r.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(v)},r.relative=l;var b=function(){var e=Object.create(null);return!("__proto__"in e)}();r.toSetString=b?u:c,r.fromSetString=b?u:p,r.compareByOriginalPositions=h,r.compareByGeneratedPositionsDeflated=d,r.compareByGeneratedPositionsInflated=g},{}],56:[function(e,t,r){r.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,r.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,r.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":52,"./lib/source-map-generator":53,"./lib/source-node":54}],57:[function(e,t,r){t.exports={name:"csso",version:"2.3.2",description:"CSSO (CSS Optimizer) is a CSS minifier with structural optimisations",keywords:["css","minifier","minify","compress","optimisation"],homepage:"https://github.com/css/csso",author:"Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (https://github.com/afelix)",maintainers:[{name:"Roman Dvornov",email:"rdvornov@gmail.com","github-username":"lahmatiy"}],license:"MIT",repository:"css/csso",bugs:{url:"https://github.com/css/csso/issues"},bin:{csso:"./bin/csso"},main:"./lib/index",eslintConfig:{env:{node:!0,mocha:!0,es6:!0},rules:{"no-duplicate-case":2,"no-undef":2,"no-unused-vars":[2,{vars:"all",args:"after-used"}]}},scripts:{test:"mocha --reporter dot",codestyle:"jscs lib && eslint lib test","codestyle-and-test":"npm run codestyle && npm test",hydrogen:"node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/csso --stat -o /dev/null",coverage:"istanbul cover _mocha -- -R dot",coveralls:"istanbul cover _mocha --report lcovonly -- -R dot && cat ./coverage/lcov.info | coveralls",travis:"npm run codestyle-and-test && npm run coveralls",browserify:"browserify --standalone csso lib/index.js | uglifyjs --compress --mangle -o dist/csso-browser.js","gh-pages":'git clone -b gh-pages https://github.com/css/csso.git .gh-pages && npm run browserify && cp dist/csso-browser.js .gh-pages/ && cd .gh-pages && git commit -am "update" && git push && cd .. && rm -rf .gh-pages',prepublish:"npm run browserify"},dependencies:{clap:"^1.0.9","source-map":"^0.5.3"},devDependencies:{browserify:"^13.0.0",coveralls:"^2.11.6",eslint:"^2.2.0",istanbul:"^0.4.2",jscs:"~2.10.0",mocha:"~2.4.2","uglify-js":"^2.6.1"},engines:{node:">=0.10.0"},files:["bin","dist/csso-browser.js","lib","HISTORY.md","LICENSE","README.md"]}},{}]},{},[36])(36)});