@turbodocx/html-to-docx
Version:
HTML to DOCX converter
1 lines • 1.73 MB
JavaScript
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("jszip"),require("http"),require("https"),require("url"),require("path"),require("fs"),require("xmlbuilder2"),require("html-entities"),require("htmlparser2"),require("crypto"),require("util"),require("stream"),require("http2"),require("assert"),require("tty"),require("os"),require("zlib"),require("events"),require("color-name"),require("lru-cache")):"function"==typeof define&&define.amd?define(["jszip","http","https","url","path","fs","xmlbuilder2","html-entities","htmlparser2","crypto","util","stream","http2","assert","tty","os","zlib","events","color-name","lru-cache"],factory):(global="undefined"!=typeof globalThis?globalThis:global||self).HTMLToDOCX=factory(global.JSZip,global.require$$0$1,global.require$$1,global.require$$1$1,global.require$$0$2,global.require$$0$3,global.xmlbuilder2,global.htmlEntities,global.htmlparser2,global.crypto,global.require$$1$2,global.stream,global.http2,global.require$$4,global.require$$1$3,global.require$$0$4,global.zlib,global.events,global.colorNames,global.lruCache)}(this,(function(JSZip,require$$0$1,require$$1,require$$1$1,require$$0$2,require$$0$3,xmlbuilder2,htmlEntities,htmlparser2,crypto,require$$1$2,stream,http2,require$$4,require$$1$3,require$$0$4,zlib,events,colorNames,lruCache){"use strict";function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(k){if("default"!==k){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})),n.default=e,Object.freeze(n)}var JSZip__default=_interopDefaultLegacy(JSZip),require$$0__default=_interopDefaultLegacy(require$$0$1),require$$1__default=_interopDefaultLegacy(require$$1),require$$1__default$1=_interopDefaultLegacy(require$$1$1),require$$0__default$1=_interopDefaultLegacy(require$$0$2),require$$0__default$2=_interopDefaultLegacy(require$$0$3),htmlparser2__namespace=_interopNamespace(htmlparser2),crypto__default=_interopDefaultLegacy(crypto),require$$1__default$2=_interopDefaultLegacy(require$$1$2),stream__default=_interopDefaultLegacy(stream),http2__default=_interopDefaultLegacy(http2),require$$4__default=_interopDefaultLegacy(require$$4),require$$1__default$3=_interopDefaultLegacy(require$$1$3),require$$0__default$3=_interopDefaultLegacy(require$$0$4),zlib__default=_interopDefaultLegacy(zlib),colorNames__default=_interopDefaultLegacy(colorNames),lruCache__namespace=_interopNamespace(lruCache),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}var global$1="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}"function"==typeof global$1.setTimeout&&(cachedSetTimeout=setTimeout),"function"==typeof global$1.clearTimeout&&(cachedClearTimeout=clearTimeout);var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,function(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};function noop$2(){}var on=noop$2,addListener=noop$2,once=noop$2,off=noop$2,removeListener=noop$2,removeAllListeners=noop$2,emit=noop$2;var performance=global$1.performance||{},performanceNow=performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow||function(){return(new Date).getTime()};var startTime=new Date;var optimize$3,hasRequiredOptimize$3,naturalCompare_1,hasRequiredNaturalCompare,sortSelectors_1,hasRequiredSortSelectors,override_1,hasRequiredOverride,format$1,hasRequiredFormat$1,marker,hasRequiredMarker,formatPosition_1,hasRequiredFormatPosition,tidyRules_1,hasRequiredTidyRules,tidyBlock_1,hasRequiredTidyBlock,tidyAtRule_1,hasRequiredTidyAtRule,hack,hasRequiredHack,removeUnused_1,hasRequiredRemoveUnused,restoreFromOptimizing_1,hasRequiredRestoreFromOptimizing,token,hasRequiredToken,wrapForOptimizing,hasRequiredWrapForOptimizing,invalidPropertyError,hasRequiredInvalidPropertyError,breakUp,hasRequiredBreakUp,vendorPrefixes,hasRequiredVendorPrefixes,understandable_1,hasRequiredUnderstandable,canOverride,hasRequiredCanOverride,clone$1,hasRequiredClone,restore,hasRequiredRestore,roundingPrecision,hasRequiredRoundingPrecision,optimizationLevel,hasRequiredOptimizationLevel,background,hasRequiredBackground,boxShadow,hasRequiredBoxShadow,borderRadius,hasRequiredBorderRadius,filter,hasRequiredFilter,fontWeight,hasRequiredFontWeight,margin,hasRequiredMargin,outline,hasRequiredOutline,padding,hasRequiredPadding,propertyOptimizers,hasRequiredPropertyOptimizers,shortenHex_1,hasRequiredShortenHex,shortenHsl_1,hasRequiredShortenHsl,shortenRgb_1,hasRequiredShortenRgb,split_1,hasRequiredSplit,color,hasRequiredColor,degrees,hasRequiredDegrees,startsAsUrl_1,hasRequiredStartsAsUrl,fraction,hasRequiredFraction,precision,hasRequiredPrecision,textQuotes,hasRequiredTextQuotes,time,hasRequiredTime,unit,hasRequiredUnit,urlPrefix,hasRequiredUrlPrefix,urlQuotes,hasRequiredUrlQuotes,urlWhitespace,hasRequiredUrlWhitespace,whitespace,hasRequiredWhitespace,zero,hasRequiredZero,valueOptimizers,hasRequiredValueOptimizers,configuration_1,hasRequiredConfiguration,helpers,hasRequiredHelpers,oneTime,hasRequiredOneTime,optimize$2,hasRequiredOptimize$2,isMergeable_1,hasRequiredIsMergeable,everyValuesPair_1,hasRequiredEveryValuesPair,hasInherit_1,hasRequiredHasInherit,hasSameValues_1,hasRequiredHasSameValues,populateComponents_1,hasRequiredPopulateComponents,restoreWithComponents_1,hasRequiredRestoreWithComponents,mergeIntoShorthands_1,hasRequiredMergeIntoShorthands,hasUnset_1,hasRequiredHasUnset,findComponentIn_1,hasRequiredFindComponentIn,isComponentOf_1,hasRequiredIsComponentOf,isMergeableShorthand_1,hasRequiredIsMergeableShorthand,overridesNonComponentShorthand_1,hasRequiredOverridesNonComponentShorthand,overrideProperties_1,hasRequiredOverrideProperties,optimize$1,hasRequiredOptimize$1,mergeAdjacent_1,hasRequiredMergeAdjacent,rulesOverlap_1,hasRequiredRulesOverlap,specificity_1,hasRequiredSpecificity,specificitiesOverlap_1,hasRequiredSpecificitiesOverlap,reorderable,hasRequiredReorderable,extractProperties_1,hasRequiredExtractProperties,mergeMediaQueries_1,hasRequiredMergeMediaQueries,mergeNonAdjacentByBody_1,hasRequiredMergeNonAdjacentByBody,mergeNonAdjacentBySelector_1,hasRequiredMergeNonAdjacentBySelector,cloneArray_1,hasRequiredCloneArray,reduceNonAdjacent_1,hasRequiredReduceNonAdjacent,removeDuplicateFontAtRules_1,hasRequiredRemoveDuplicateFontAtRules,removeDuplicateMediaQueries_1,hasRequiredRemoveDuplicateMediaQueries,removeDuplicates_1,hasRequiredRemoveDuplicates,removeUnusedAtRules_1,hasRequiredRemoveUnusedAtRules,tidyRuleDuplicates_1,hasRequiredTidyRuleDuplicates,restructure_1,hasRequiredRestructure,optimize,hasRequiredOptimize,validator_1,hasRequiredValidator,compatibility,hasRequiredCompatibility,isHttpResource_1,hasRequiredIsHttpResource,isHttpsResource_1,hasRequiredIsHttpsResource,loadRemoteResource_1,hasRequiredLoadRemoteResource,fetch$1,hasRequiredFetch,inline$1,hasRequiredInline,inlineRequest,hasRequiredInlineRequest,inlineTimeout,hasRequiredInlineTimeout,plugins,hasRequiredPlugins,rebase,hasRequiredRebase$1,rebaseTo,hasRequiredRebaseTo,browser$1$1={nextTick:function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:on,addListener:addListener,once:once,off:off,removeListener:removeListener,removeAllListeners:removeAllListeners,emit:emit,binding:function(name){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(dir){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(previousTimestamp){var clocktime=.001*performanceNow.call(performance),seconds=Math.floor(clocktime),nanoseconds=Math.floor(clocktime%1*1e9);return previousTimestamp&&(seconds-=previousTimestamp[0],(nanoseconds-=previousTimestamp[1])<0&&(seconds--,nanoseconds+=1e9)),[seconds,nanoseconds]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-startTime)/1e3}},clean={exports:{}};function requireSortSelectors(){if(hasRequiredSortSelectors)return sortSelectors_1;hasRequiredSortSelectors=1;var naturalCompare=function(){if(hasRequiredNaturalCompare)return naturalCompare_1;hasRequiredNaturalCompare=1;var NUMBER_PATTERN=/([0-9]+)/;function tryParseInt(value){return""+parseInt(value)==value?parseInt(value):value}return naturalCompare_1=function(value1,value2){var key1,key2,i,l,keys1=(""+value1).split(NUMBER_PATTERN).map(tryParseInt),keys2=(""+value2).split(NUMBER_PATTERN).map(tryParseInt);for(i=0,l=Math.min(keys1.length,keys2.length);i<l;i++)if((key1=keys1[i])!=(key2=keys2[i]))return key1>key2?1:-1;return keys1.length>keys2.length?1:keys1.length==keys2.length?0:-1}}();function naturalSorter(scope1,scope2){return naturalCompare(scope1[1],scope2[1])}function standardSorter(scope1,scope2){return scope1[1]>scope2[1]?1:-1}return sortSelectors_1=function(selectors,method){switch(method){case"natural":return selectors.sort(naturalSorter);case"standard":return selectors.sort(standardSorter);case"none":case!1:return selectors}}}function requireOverride(){if(hasRequiredOverride)return override_1;return hasRequiredOverride=1,override_1=function override(source1,source2){var key1,key2,item,target={};for(key1 in source1)item=source1[key1],Array.isArray(item)?target[key1]=item.slice(0):target[key1]="object"==typeof item&&null!==item?override(item,{}):item;for(key2 in source2)item=source2[key2],key2 in target&&Array.isArray(item)?target[key2]=item.slice(0):target[key2]=key2 in target&&"object"==typeof item&&null!==item?override(target[key2],item):item;return target},override_1}function requireFormat$1(){if(hasRequiredFormat$1)return format$1;hasRequiredFormat$1=1;var override=requireOverride();var Breaks={AfterAtRule:"afterAtRule",AfterBlockBegins:"afterBlockBegins",AfterBlockEnds:"afterBlockEnds",AfterComment:"afterComment",AfterProperty:"afterProperty",AfterRuleBegins:"afterRuleBegins",AfterRuleEnds:"afterRuleEnds",BeforeBlockEnds:"beforeBlockEnds",BetweenSelectors:"betweenSelectors"},BreakWith={CarriageReturnLineFeed:"\r\n",LineFeed:"\n",System:function(){var systemLineBreak="\n";try{systemLineBreak=require("os").EOL}catch(_){}return systemLineBreak}()},IndentWith_Space=" ",IndentWith_Tab="\t",Spaces={AroundSelectorRelation:"aroundSelectorRelation",BeforeBlockBegins:"beforeBlockBegins",BeforeValue:"beforeValue"},DEFAULTS={breaks:breaks(!1),breakWith:BreakWith.System,indentBy:0,indentWith:IndentWith_Space,spaces:spaces(!1),wrapAt:!1,semicolonAfterLastProperty:!1};function breaks(value){var breakOptions={};return breakOptions[Breaks.AfterAtRule]=value,breakOptions[Breaks.AfterBlockBegins]=value,breakOptions[Breaks.AfterBlockEnds]=value,breakOptions[Breaks.AfterComment]=value,breakOptions[Breaks.AfterProperty]=value,breakOptions[Breaks.AfterRuleBegins]=value,breakOptions[Breaks.AfterRuleEnds]=value,breakOptions[Breaks.BeforeBlockEnds]=value,breakOptions[Breaks.BetweenSelectors]=value,breakOptions}function spaces(value){var spaceOptions={};return spaceOptions[Spaces.AroundSelectorRelation]=value,spaceOptions[Spaces.BeforeBlockBegins]=value,spaceOptions[Spaces.BeforeValue]=value,spaceOptions}function mapBreakWith(value){switch(value){case"windows":case"crlf":case BreakWith.CarriageReturnLineFeed:return BreakWith.CarriageReturnLineFeed;case"unix":case"lf":case BreakWith.LineFeed:return BreakWith.LineFeed;default:return BreakWith.System}}function mapIndentWith(value){switch(value){case"space":return IndentWith_Space;case"tab":return IndentWith_Tab;default:return value}}function remapBreaks(source){for(var key in Breaks){var breakName=Breaks[key],breakValue=source.breaks[breakName];source.breaks[breakName]=!0===breakValue?source.breakWith:!1===breakValue?"":source.breakWith.repeat(parseInt(breakValue))}return source}return format$1={Breaks:Breaks,Spaces:Spaces,formatFrom:function(source){return void 0!==source&&!1!==source&&("object"==typeof source&&"breakWith"in source&&(source=override(source,{breakWith:mapBreakWith(source.breakWith)})),"object"==typeof source&&"indentBy"in source&&(source=override(source,{indentBy:parseInt(source.indentBy)})),"object"==typeof source&&"indentWith"in source&&(source=override(source,{indentWith:mapIndentWith(source.indentWith)})),"object"==typeof source?remapBreaks(override(DEFAULTS,source)):"string"==typeof source&&"beautify"==source?remapBreaks(override(DEFAULTS,{breaks:breaks(!0),indentBy:2,spaces:spaces(!0)})):"string"==typeof source&&"keep-breaks"==source?remapBreaks(override(DEFAULTS,{breaks:{afterAtRule:!0,afterBlockBegins:!0,afterBlockEnds:!0,afterComment:!0,afterRuleEnds:!0,beforeBlockEnds:!0}})):"string"==typeof source?remapBreaks(override(DEFAULTS,source.split(";").reduce((function(accumulator,directive){var parts=directive.split(":"),name=parts[0],value=parts[1];return"breaks"==name||"spaces"==name?accumulator[name]=function(string){return string.split(",").reduce((function(accumulator,directive){var parts=directive.split("="),name=parts[0],value=parts[1];return accumulator[name]=function(value){switch(value){case"false":case"off":return!1;case"true":case"on":return!0;default:return value}}(value),accumulator}),{})}(value):"indentBy"==name||"wrapAt"==name?accumulator[name]=parseInt(value):"indentWith"==name?accumulator[name]=mapIndentWith(value):"breakWith"==name&&(accumulator[name]=mapBreakWith(value)),accumulator}),{}))):DEFAULTS)}}}function requireMarker(){if(hasRequiredMarker)return marker;hasRequiredMarker=1;return marker={ASTERISK:"*",AT:"@",BACK_SLASH:"\\",CARRIAGE_RETURN:"\r",CLOSE_CURLY_BRACKET:"}",CLOSE_ROUND_BRACKET:")",CLOSE_SQUARE_BRACKET:"]",COLON:":",COMMA:",",DOUBLE_QUOTE:'"',EXCLAMATION:"!",FORWARD_SLASH:"/",INTERNAL:"-clean-css-",NEW_LINE_NIX:"\n",OPEN_CURLY_BRACKET:"{",OPEN_ROUND_BRACKET:"(",OPEN_SQUARE_BRACKET:"[",SEMICOLON:";",SINGLE_QUOTE:"'",SPACE:" ",TAB:"\t",UNDERSCORE:"_"}}function requireFormatPosition(){if(hasRequiredFormatPosition)return formatPosition_1;return hasRequiredFormatPosition=1,formatPosition_1=function(metadata){var line=metadata[0],column=metadata[1],source=metadata[2];return source?source+":"+line+":"+column:line+":"+column}}function requireTidyRules(){if(hasRequiredTidyRules)return tidyRules_1;hasRequiredTidyRules=1;var Spaces=requireFormat$1().Spaces,Marker=requireMarker(),formatPosition=requireFormatPosition(),CASE_ATTRIBUTE_PATTERN=/[\s"'][iI]\s*\]/,CASE_RESTORE_PATTERN=/([\d\w])([iI])\]/g,DOUBLE_QUOTE_CASE_PATTERN=/="([a-zA-Z][a-zA-Z\d\-_]+)"([iI])/g,DOUBLE_QUOTE_PATTERN=/="([a-zA-Z][a-zA-Z\d\-_]+)"(\s|\])/g,HTML_COMMENT_PATTERN=/^(?:(?:<!--|-->)\s*)+/,SINGLE_QUOTE_CASE_PATTERN=/='([a-zA-Z][a-zA-Z\d\-_]+)'([iI])/g,SINGLE_QUOTE_PATTERN=/='([a-zA-Z][a-zA-Z\d\-_]+)'(\s|\])/g,RELATION_PATTERN=/[>+~]/,WHITESPACE_PATTERN=/\s/,PSEUDO_CLASSES_WITH_SELECTORS=[":current",":future",":has",":host",":host-context",":is",":not",":past",":where"];function hasInvalidCharacters(value){var isEscaped,character,i,l,isInvalid=!1,isQuote=!1;for(i=0,l=value.length;i<l;i++){if(character=value[i],isEscaped);else if(character==Marker.SINGLE_QUOTE||character==Marker.DOUBLE_QUOTE)isQuote=!isQuote;else{if(!(isQuote||character!=Marker.CLOSE_CURLY_BRACKET&&character!=Marker.EXCLAMATION&&"<"!=character&&character!=Marker.SEMICOLON)){isInvalid=!0;break}if(!isQuote&&0===i&&RELATION_PATTERN.test(character)){isInvalid=!0;break}}isEscaped=character==Marker.BACK_SLASH}return isInvalid}function removeWhitespace(value,format){var character,isNewLineNix,isNewLineWin,isEscaped,wasEscaped,isQuoted,isSingleQuoted,isDoubleQuoted,isAttribute,isRelation,isWhitespace,isSpaceAwarePseudoClass,i,l,stripped=[],roundBracketLevel=0,wasComma=!1,wasRelation=!1,wasWhitespace=!1,withCaseAttribute=CASE_ATTRIBUTE_PATTERN.test(value),spaceAroundRelation=format&&format.spaces[Spaces.AroundSelectorRelation];for(i=0,l=value.length;i<l;i++){if(isNewLineNix=(character=value[i])==Marker.NEW_LINE_NIX,isNewLineWin=character==Marker.NEW_LINE_NIX&&value[i-1]==Marker.CARRIAGE_RETURN,isQuoted=isSingleQuoted||isDoubleQuoted,isRelation=!isAttribute&&!isEscaped&&0===roundBracketLevel&&RELATION_PATTERN.test(character),isWhitespace=WHITESPACE_PATTERN.test(character),isSpaceAwarePseudoClass=(1!=roundBracketLevel||character!=Marker.CLOSE_ROUND_BRACKET)&&(isSpaceAwarePseudoClass||0===roundBracketLevel&&character==Marker.COLON&&isPseudoClassWithSelectors(value,i)),wasEscaped&&isQuoted&&isNewLineWin)stripped.pop(),stripped.pop();else if(isEscaped&&isQuoted&&isNewLineNix)stripped.pop();else if(isEscaped)stripped.push(character);else if(character!=Marker.OPEN_SQUARE_BRACKET||isQuoted)if(character!=Marker.CLOSE_SQUARE_BRACKET||isQuoted)if(character!=Marker.OPEN_ROUND_BRACKET||isQuoted)if(character!=Marker.CLOSE_ROUND_BRACKET||isQuoted)if(character!=Marker.SINGLE_QUOTE||isQuoted)if(character!=Marker.DOUBLE_QUOTE||isQuoted)if(character==Marker.SINGLE_QUOTE&&isQuoted)stripped.push(character),isSingleQuoted=!1;else if(character==Marker.DOUBLE_QUOTE&&isQuoted)stripped.push(character),isDoubleQuoted=!1;else{if(isWhitespace&&wasRelation&&!spaceAroundRelation)continue;!isWhitespace&&wasRelation&&spaceAroundRelation?(stripped.push(Marker.SPACE),stripped.push(character)):isWhitespace&&!wasWhitespace&&wasComma&&roundBracketLevel>0&&isSpaceAwarePseudoClass||(isWhitespace&&!wasWhitespace&&roundBracketLevel>0&&isSpaceAwarePseudoClass?stripped.push(character):isWhitespace&&(isAttribute||roundBracketLevel>0)&&!isQuoted||isWhitespace&&wasWhitespace&&!isQuoted||(isNewLineWin||isNewLineNix)&&(isAttribute||roundBracketLevel>0)&&isQuoted||(isRelation&&wasWhitespace&&!spaceAroundRelation?(stripped.pop(),stripped.push(character)):isRelation&&!wasWhitespace&&spaceAroundRelation?(stripped.push(Marker.SPACE),stripped.push(character)):isWhitespace?stripped.push(Marker.SPACE):stripped.push(character)))}else stripped.push(character),isDoubleQuoted=!0;else stripped.push(character),isSingleQuoted=!0;else stripped.push(character),roundBracketLevel--;else stripped.push(character),roundBracketLevel++;else stripped.push(character),isAttribute=!1;else stripped.push(character),isAttribute=!0;wasEscaped=isEscaped,isEscaped=character==Marker.BACK_SLASH,wasRelation=isRelation,wasWhitespace=isWhitespace,wasComma=character==Marker.COMMA}return withCaseAttribute?stripped.join("").replace(CASE_RESTORE_PATTERN,"$1 $2]"):stripped.join("")}function isPseudoClassWithSelectors(value,colonPosition){var pseudoClass=value.substring(colonPosition,value.indexOf(Marker.OPEN_ROUND_BRACKET,colonPosition));return PSEUDO_CLASSES_WITH_SELECTORS.indexOf(pseudoClass)>-1}function replacePseudoClasses(value){return value.replace("nth-child(1)","first-child").replace("nth-of-type(1)","first-of-type").replace("nth-of-type(even)","nth-of-type(2n)").replace("nth-child(even)","nth-child(2n)").replace("nth-of-type(2n+1)","nth-of-type(odd)").replace("nth-child(2n+1)","nth-child(odd)").replace("nth-last-child(1)","last-child").replace("nth-last-of-type(1)","last-of-type").replace("nth-last-of-type(even)","nth-last-of-type(2n)").replace("nth-last-child(even)","nth-last-child(2n)").replace("nth-last-of-type(2n+1)","nth-last-of-type(odd)").replace("nth-last-child(2n+1)","nth-last-child(odd)")}return tidyRules_1=function(rules,removeUnsupported,adjacentSpace,format,warnings){var value,list=[],repeated=[];function removeHTMLComment(rule,match){return warnings.push("HTML comment '"+match+"' at "+formatPosition(rule[2][0])+". Removing."),""}for(var i=0,l=rules.length;i<l;i++){var rule=rules[i],reduced=rule[1];hasInvalidCharacters(reduced=reduced.replace(HTML_COMMENT_PATTERN,removeHTMLComment.bind(null,rule)))?warnings.push("Invalid selector '"+rule[1]+"' at "+formatPosition(rule[2][0])+". Ignoring."):(reduced=removeWhitespace(reduced,format),reduced=-1==(value=reduced).indexOf("'")&&-1==value.indexOf('"')?value:value.replace(SINGLE_QUOTE_CASE_PATTERN,"=$1 $2").replace(SINGLE_QUOTE_PATTERN,"=$1$2").replace(DOUBLE_QUOTE_CASE_PATTERN,"=$1 $2").replace(DOUBLE_QUOTE_PATTERN,"=$1$2"),adjacentSpace&&reduced.indexOf("nav")>0&&(reduced=reduced.replace(/\+nav(\S|$)/,"+ nav$1")),removeUnsupported&&reduced.indexOf("*+html ")>-1||removeUnsupported&&reduced.indexOf("*:first-child+html ")>-1||(reduced.indexOf("*")>-1&&(reduced=reduced.replace(/\*([:#.[])/g,"$1").replace(/^(:first-child)?\+html/,"*$1+html")),repeated.indexOf(reduced)>-1||(reduced=replacePseudoClasses(reduced),rule[1]=reduced,repeated.push(reduced),list.push(rule))))}return 1==list.length&&0===list[0][1].length&&(warnings.push("Empty selector '"+list[0][1]+"' at "+formatPosition(list[0][2][0])+". Ignoring."),list=[]),list},tidyRules_1}function requireHack(){if(hasRequiredHack)return hack;hasRequiredHack=1;return hack={ASTERISK:"asterisk",BANG:"bang",BACKSLASH:"backslash",UNDERSCORE:"underscore"}}function requireRemoveUnused(){if(hasRequiredRemoveUnused)return removeUnused_1;return hasRequiredRemoveUnused=1,removeUnused_1=function(properties){for(var i=properties.length-1;i>=0;i--){var property=properties[i];property.unused&&property.all.splice(property.position,1)}}}function requireRestoreFromOptimizing(){if(hasRequiredRestoreFromOptimizing)return restoreFromOptimizing_1;hasRequiredRestoreFromOptimizing=1;var Hack=requireHack(),Marker=requireMarker();function restoreImportant(property){property.value[property.value.length-1][1]+="!important"}function restoreHack(property){property.hack[0]==Hack.UNDERSCORE?property.name="_"+property.name:property.hack[0]==Hack.ASTERISK?property.name="*"+property.name:property.hack[0]==Hack.BACKSLASH?property.value[property.value.length-1][1]+="\\"+property.hack[1]:property.hack[0]==Hack.BANG&&(property.value[property.value.length-1][1]+=Marker.SPACE+"!ie")}return restoreFromOptimizing_1=function(properties,restoreCallback){var property,restored,current,i;for(i=properties.length-1;i>=0;i--)(property=properties[i]).dynamic&&property.important?restoreImportant(property):property.dynamic||property.unused||(property.dirty||property.important||property.hack)&&(property.optimizable&&restoreCallback?(restored=restoreCallback(property),property.value=restored):restored=property.value,property.important&&restoreImportant(property),property.hack&&restoreHack(property),"all"in property&&((current=property.all[property.position])[1][1]=property.name,current.splice(2,current.length-1),Array.prototype.push.apply(current,restored)))}}function requireToken(){if(hasRequiredToken)return token;hasRequiredToken=1;return token={AT_RULE:"at-rule",AT_RULE_BLOCK:"at-rule-block",AT_RULE_BLOCK_SCOPE:"at-rule-block-scope",COMMENT:"comment",NESTED_BLOCK:"nested-block",NESTED_BLOCK_SCOPE:"nested-block-scope",PROPERTY:"property",PROPERTY_BLOCK:"property-block",PROPERTY_NAME:"property-name",PROPERTY_VALUE:"property-value",RAW:"raw",RULE:"rule",RULE_SCOPE:"rule-scope"}}function requireWrapForOptimizing(){if(hasRequiredWrapForOptimizing)return wrapForOptimizing;hasRequiredWrapForOptimizing=1;var Hack=requireHack(),Marker=requireMarker(),Token=requireToken(),Match={ASTERISK:"*",BACKSLASH:"\\",BANG:"!",BANG_SUFFIX_PATTERN:/!\w+$/,IMPORTANT_TOKEN:"!important",IMPORTANT_TOKEN_PATTERN:new RegExp("!important$","i"),IMPORTANT_WORD:"important",IMPORTANT_WORD_PATTERN:new RegExp("important$","i"),SUFFIX_BANG_PATTERN:/!$/,UNDERSCORE:"_",VARIABLE_REFERENCE_PATTERN:/var\(--.+\)$/};function someVariableReferences(property){var i,l,value;for(i=2,l=property.length;i<l;i++)if((value=property[i])[0]==Token.PROPERTY_VALUE&&isVariableReference(value[1]))return!0;return!1}function isVariableReference(value){return Match.VARIABLE_REFERENCE_PATTERN.test(value)}function isMultiplex(property){var value,i,l;for(i=3,l=property.length;i<l;i++)if((value=property[i])[0]==Token.PROPERTY_VALUE&&(value[1]==Marker.COMMA||value[1]==Marker.FORWARD_SLASH))return!0;return!1}function wrapSingle(property){var importantProperty=function(property){if(property.length<3)return!1;var lastValue=property[property.length-1];return!!Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])||!(!Match.IMPORTANT_WORD_PATTERN.test(lastValue[1])||!Match.SUFFIX_BANG_PATTERN.test(property[property.length-2][1]))}(property);importantProperty&&function(property){var lastValue=property[property.length-1],oneButLastValue=property[property.length-2];Match.IMPORTANT_TOKEN_PATTERN.test(lastValue[1])?lastValue[1]=lastValue[1].replace(Match.IMPORTANT_TOKEN_PATTERN,""):(lastValue[1]=lastValue[1].replace(Match.IMPORTANT_WORD_PATTERN,""),oneButLastValue[1]=oneButLastValue[1].replace(Match.SUFFIX_BANG_PATTERN,"")),0===lastValue[1].length&&property.pop(),0===oneButLastValue[1].length&&property.pop()}(property);var whichHack=function(property){var match=!1,name=property[1][1],lastValue=property[property.length-1];return name[0]==Match.UNDERSCORE?match=[Hack.UNDERSCORE]:name[0]==Match.ASTERISK?match=[Hack.ASTERISK]:lastValue[1][0]!=Match.BANG||lastValue[1].match(Match.IMPORTANT_WORD_PATTERN)?lastValue[1].indexOf(Match.BANG)>0&&!lastValue[1].match(Match.IMPORTANT_WORD_PATTERN)&&Match.BANG_SUFFIX_PATTERN.test(lastValue[1])?match=[Hack.BANG]:lastValue[1].indexOf(Match.BACKSLASH)>0&&lastValue[1].indexOf(Match.BACKSLASH)==lastValue[1].length-Match.BACKSLASH.length-1?match=[Hack.BACKSLASH,lastValue[1].substring(lastValue[1].indexOf(Match.BACKSLASH)+1)]:0===lastValue[1].indexOf(Match.BACKSLASH)&&2==lastValue[1].length&&(match=[Hack.BACKSLASH,lastValue[1].substring(1)]):match=[Hack.BANG],match}(property);return whichHack[0]==Hack.ASTERISK||whichHack[0]==Hack.UNDERSCORE?function(property){property[1][1]=property[1][1].substring(1)}(property):whichHack[0]!=Hack.BACKSLASH&&whichHack[0]!=Hack.BANG||function(property,hackFrom){var lastValue=property[property.length-1];lastValue[1]=lastValue[1].substring(0,lastValue[1].indexOf(hackFrom[0]==Hack.BACKSLASH?Match.BACKSLASH:Match.BANG)).trim(),0===lastValue[1].length&&property.pop()}(property,whichHack),{block:property[2]&&property[2][0]==Token.PROPERTY_BLOCK,components:[],dirty:!1,dynamic:someVariableReferences(property),hack:whichHack,important:importantProperty,name:property[1][1],multiplex:property.length>3&&isMultiplex(property),optimizable:!0,position:0,shorthand:!1,unused:!1,value:property.slice(2)}}return wrapForOptimizing={all:function(properties,skipProperties){var single,property,i,wrapped=[];for(i=properties.length-1;i>=0;i--)(property=properties[i])[0]==Token.PROPERTY&&(skipProperties&&skipProperties.indexOf(property[1][1])>-1||((single=wrapSingle(property)).all=properties,single.position=i,wrapped.unshift(single)));return wrapped},single:wrapSingle}}function requireInvalidPropertyError(){if(hasRequiredInvalidPropertyError)return invalidPropertyError;function InvalidPropertyError(message){this.name="InvalidPropertyError",this.message=message,this.stack=(new Error).stack}return hasRequiredInvalidPropertyError=1,InvalidPropertyError.prototype=Object.create(Error.prototype),InvalidPropertyError.prototype.constructor=InvalidPropertyError,invalidPropertyError=InvalidPropertyError}function requireBreakUp(){if(hasRequiredBreakUp)return breakUp;hasRequiredBreakUp=1;var InvalidPropertyError=requireInvalidPropertyError(),wrapSingle=requireWrapForOptimizing().single,Token=requireToken(),Marker=requireMarker(),formatPosition=requireFormatPosition();function _anyIsInherit(values){var i,l;for(i=0,l=values.length;i<l;i++)if("inherit"==values[i][1])return!0;return!1}function _wrapDefault(name,property,configuration){var descriptor=configuration[name];return descriptor.doubleValues&&2==descriptor.defaultValue.length?wrapSingle([Token.PROPERTY,[Token.PROPERTY_NAME,name],[Token.PROPERTY_VALUE,descriptor.defaultValue[0]],[Token.PROPERTY_VALUE,descriptor.defaultValue[1]]]):descriptor.doubleValues&&1==descriptor.defaultValue.length?wrapSingle([Token.PROPERTY,[Token.PROPERTY_NAME,name],[Token.PROPERTY_VALUE,descriptor.defaultValue[0]]]):wrapSingle([Token.PROPERTY,[Token.PROPERTY_NAME,name],[Token.PROPERTY_VALUE,descriptor.defaultValue]])}function fourValues(property,configuration){var componentNames=configuration[property.name].components,components=[],value=property.value;if(value.length<1)return[];value.length<2&&(value[1]=value[0].slice(0)),value.length<3&&(value[2]=value[0].slice(0)),value.length<4&&(value[3]=value[1].slice(0));for(var i=componentNames.length-1;i>=0;i--){var component=wrapSingle([Token.PROPERTY,[Token.PROPERTY_NAME,componentNames[i]]]);component.value=[value[i]],components.unshift(component)}return components}function widthStyleColor(property,configuration,validator){for(var color,style,width,descriptor=configuration[property.name],components=[_wrapDefault(descriptor.components[0],0,configuration),_wrapDefault(descriptor.components[1],0,configuration),_wrapDefault(descriptor.components[2],0,configuration)],i=0;i<3;i++){var component=components[i];component.name.indexOf("color")>0?color=component:component.name.indexOf("style")>0?style=component:width=component}if(1==property.value.length&&"inherit"==property.value[0][1]||3==property.value.length&&"inherit"==property.value[0][1]&&"inherit"==property.value[1][1]&&"inherit"==property.value[2][1])return color.value=style.value=width.value=[property.value[0]],components;var match,matches,values=property.value.slice(0);return values.length>0&&(matches=values.filter(function(validator){return function(value){return"inherit"!=value[1]&&(validator.isWidth(value[1])||validator.isUnit(value[1])||validator.isDynamicUnit(value[1]))&&!validator.isStyleKeyword(value[1])&&!validator.isColorFunction(value[1])}}(validator)),(match=matches.length>1&&("none"==matches[0][1]||"auto"==matches[0][1])?matches[1]:matches[0])&&(width.value=[match],values.splice(values.indexOf(match),1))),values.length>0&&(match=values.filter(function(validator){return function(value){return"inherit"!=value[1]&&validator.isStyleKeyword(value[1])&&!validator.isColorFunction(value[1])}}(validator))[0],match&&(style.value=[match],values.splice(values.indexOf(match),1))),values.length>0&&(match=values.filter(function(validator){return function(value){return"invert"==value[1]||validator.isColor(value[1])||validator.isPrefixed(value[1])}}(validator))[0],match&&(color.value=[match],values.splice(values.indexOf(match),1))),components}return breakUp={animation:function(property,configuration,validator){var value,i,l,duration=_wrapDefault(property.name+"-duration",0,configuration),timing=_wrapDefault(property.name+"-timing-function",0,configuration),delay=_wrapDefault(property.name+"-delay",0,configuration),iteration=_wrapDefault(property.name+"-iteration-count",0,configuration),direction=_wrapDefault(property.name+"-direction",0,configuration),fill=_wrapDefault(property.name+"-fill-mode",0,configuration),play=_wrapDefault(property.name+"-play-state",0,configuration),name=_wrapDefault(property.name+"-name",0,configuration),components=[duration,timing,delay,iteration,direction,fill,play,name],values=property.value,durationSet=!1,timingSet=!1,delaySet=!1,iterationSet=!1,directionSet=!1,fillSet=!1,playSet=!1,nameSet=!1;if(1==property.value.length&&"inherit"==property.value[0][1])return duration.value=timing.value=delay.value=iteration.value=direction.value=fill.value=play.value=name.value=property.value,components;if(values.length>1&&_anyIsInherit(values))throw new InvalidPropertyError("Invalid animation values at "+formatPosition(values[0][2][0])+". Ignoring.");for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isTime(value[1])&&!durationSet)duration.value=[value],durationSet=!0;else if(validator.isTime(value[1])&&!delaySet)delay.value=[value],delaySet=!0;else if(!validator.isGlobal(value[1])&&!validator.isTimingFunction(value[1])||timingSet)if(!validator.isAnimationIterationCountKeyword(value[1])&&!validator.isPositiveNumber(value[1])||iterationSet)if(validator.isAnimationDirectionKeyword(value[1])&&!directionSet)direction.value=[value],directionSet=!0;else if(validator.isAnimationFillModeKeyword(value[1])&&!fillSet)fill.value=[value],fillSet=!0;else if(validator.isAnimationPlayStateKeyword(value[1])&&!playSet)play.value=[value],playSet=!0;else{if(!validator.isAnimationNameKeyword(value[1])&&!validator.isIdentifier(value[1])||nameSet)throw new InvalidPropertyError("Invalid animation value at "+formatPosition(value[2][0])+". Ignoring.");name.value=[value],nameSet=!0}else iteration.value=[value],iterationSet=!0;else timing.value=[value],timingSet=!0;return components},background:function(property,configuration,validator){var image=_wrapDefault("background-image",0,configuration),position=_wrapDefault("background-position",0,configuration),size=_wrapDefault("background-size",0,configuration),repeat=_wrapDefault("background-repeat",0,configuration),attachment=_wrapDefault("background-attachment",0,configuration),origin=_wrapDefault("background-origin",0,configuration),clip=_wrapDefault("background-clip",0,configuration),color=_wrapDefault("background-color",0,configuration),components=[image,position,size,repeat,attachment,origin,clip,color],values=property.value,positionSet=!1,clipSet=!1,originSet=!1,repeatSet=!1,anyValueSet=!1;if(1==property.value.length&&"inherit"==property.value[0][1])return color.value=image.value=repeat.value=position.value=size.value=origin.value=clip.value=property.value,components;if(1==property.value.length&&"0 0"==property.value[0][1])return components;for(var i=values.length-1;i>=0;i--){var value=values[i];if(validator.isBackgroundAttachmentKeyword(value[1]))attachment.value=[value],anyValueSet=!0;else if(validator.isBackgroundClipKeyword(value[1])||validator.isBackgroundOriginKeyword(value[1]))clipSet?(origin.value=[value],originSet=!0):(clip.value=[value],clipSet=!0),anyValueSet=!0;else if(validator.isBackgroundRepeatKeyword(value[1]))repeatSet?repeat.value.unshift(value):(repeat.value=[value],repeatSet=!0),anyValueSet=!0;else if(validator.isBackgroundPositionKeyword(value[1])||validator.isBackgroundSizeKeyword(value[1])||validator.isUnit(value[1])||validator.isDynamicUnit(value[1])){if(i>0){var previousValue=values[i-1];previousValue[1]==Marker.FORWARD_SLASH?size.value=[value]:i>1&&values[i-2][1]==Marker.FORWARD_SLASH?(size.value=[previousValue,value],i-=2):(positionSet||(position.value=[]),position.value.unshift(value),positionSet=!0)}else positionSet||(position.value=[]),position.value.unshift(value),positionSet=!0;anyValueSet=!0}else color.value[0][1]!=configuration[color.name].defaultValue&&"none"!=color.value[0][1]||!validator.isColor(value[1])&&!validator.isPrefixed(value[1])?(validator.isUrl(value[1])||validator.isFunction(value[1]))&&(image.value=[value],anyValueSet=!0):(color.value=[value],anyValueSet=!0)}if(clipSet&&!originSet&&(origin.value=clip.value.slice(0)),!anyValueSet)throw new InvalidPropertyError("Invalid background value at "+formatPosition(values[0][2][0])+". Ignoring.");return components},border:widthStyleColor,borderRadius:function(property,configuration){for(var values=property.value,splitAt=-1,i=0,l=values.length;i<l;i++)if(values[i][1]==Marker.FORWARD_SLASH){splitAt=i;break}if(0===splitAt||splitAt===values.length-1)throw new InvalidPropertyError("Invalid border-radius value at "+formatPosition(values[0][2][0])+". Ignoring.");var target=_wrapDefault(property.name,0,configuration);target.value=splitAt>-1?values.slice(0,splitAt):values.slice(0),target.components=fourValues(target,configuration);var remainder=_wrapDefault(property.name,0,configuration);remainder.value=splitAt>-1?values.slice(splitAt+1):values.slice(0),remainder.components=fourValues(remainder,configuration);for(var j=0;j<4;j++)target.components[j].multiplex=!0,target.components[j].value=target.components[j].value.concat(remainder.components[j].value);return target.components},font:function(property,configuration,validator){var isStretchValid,isStyleValid,isVariantValid,isWeightValid,style=_wrapDefault("font-style",0,configuration),variant=_wrapDefault("font-variant",0,configuration),weight=_wrapDefault("font-weight",0,configuration),stretch=_wrapDefault("font-stretch",0,configuration),size=_wrapDefault("font-size",0,configuration),height=_wrapDefault("line-height",0,configuration),family=_wrapDefault("font-family",0,configuration),components=[style,variant,weight,stretch,size,height,family],values=property.value,index=0,isStretchSet=!1,isStyleSet=!1,isVariantSet=!1,isWeightSet=!1,appendableFamilyName=!1;if(!values[index])throw new InvalidPropertyError("Missing font values at "+formatPosition(property.all[property.position][1][2][0])+". Ignoring.");if(1==values.length&&"inherit"==values[0][1])return style.value=variant.value=weight.value=stretch.value=size.value=height.value=family.value=values,components;if(1==values.length&&(validator.isFontKeyword(values[0][1])||validator.isGlobal(values[0][1])||validator.isPrefixed(values[0][1])))return values[0][1]=Marker.INTERNAL+values[0][1],style.value=variant.value=weight.value=stretch.value=size.value=height.value=family.value=values,components;if(values.length<2||!function(values,validator){var value,i,l;for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isFontSizeKeyword(value[1])||validator.isUnit(value[1])&&!validator.isDynamicUnit(value[1])||validator.isFunction(value[1]))return!0;return!1}(values,validator)||!function(values,validator){var value,i,l;for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isIdentifier(value[1])||validator.isQuotedText(value[1]))return!0;return!1}(values,validator))throw new InvalidPropertyError("Invalid font values at "+formatPosition(property.all[property.position][1][2][0])+". Ignoring.");if(values.length>1&&_anyIsInherit(values))throw new InvalidPropertyError("Invalid font values at "+formatPosition(values[0][2][0])+". Ignoring.");for(;index<4;){if(isStretchValid=validator.isFontStretchKeyword(values[index][1])||validator.isGlobal(values[index][1]),isStyleValid=validator.isFontStyleKeyword(values[index][1])||validator.isGlobal(values[index][1]),isVariantValid=validator.isFontVariantKeyword(values[index][1])||validator.isGlobal(values[index][1]),isWeightValid=validator.isFontWeightKeyword(values[index][1])||validator.isGlobal(values[index][1]),isStyleValid&&!isStyleSet)style.value=[values[index]],isStyleSet=!0;else if(isVariantValid&&!isVariantSet)variant.value=[values[index]],isVariantSet=!0;else if(isWeightValid&&!isWeightSet)weight.value=[values[index]],isWeightSet=!0;else{if(!isStretchValid||isStretchSet){if(isStyleValid&&isStyleSet||isVariantValid&&isVariantSet||isWeightValid&&isWeightSet||isStretchValid&&isStretchSet)throw new InvalidPropertyError("Invalid font style / variant / weight / stretch value at "+formatPosition(values[0][2][0])+". Ignoring.");break}stretch.value=[values[index]],isStretchSet=!0}index++}if(!(validator.isFontSizeKeyword(values[index][1])||validator.isUnit(values[index][1])&&!validator.isDynamicUnit(values[index][1])))throw new InvalidPropertyError("Missing font size at "+formatPosition(values[0][2][0])+". Ignoring.");if(size.value=[values[index]],!values[++index])throw new InvalidPropertyError("Missing font family at "+formatPosition(values[0][2][0])+". Ignoring.");for(values[index]&&values[index][1]==Marker.FORWARD_SLASH&&values[index+1]&&(validator.isLineHeightKeyword(values[index+1][1])||validator.isUnit(values[index+1][1])||validator.isNumber(values[index+1][1]))&&(height.value=[values[index+1]],index++,index++),family.value=[];values[index];)values[index][1]==Marker.COMMA?appendableFamilyName=!1:(appendableFamilyName?family.value[family.value.length-1][1]+=Marker.SPACE+values[index][1]:family.value.push(values[index]),appendableFamilyName=!0),index++;if(0===family.value.length)throw new InvalidPropertyError("Missing font family at "+formatPosition(values[0][2][0])+". Ignoring.");return components},fourValues:fourValues,listStyle:function(property,configuration,validator){var type=_wrapDefault("list-style-type",0,configuration),position=_wrapDefault("list-style-position",0,configuration),image=_wrapDefault("list-style-image",0,configuration),components=[type,position,image];if(1==property.value.length&&"inherit"==property.value[0][1])return type.value=position.value=image.value=[property.value[0]],components;var values=property.value.slice(0),total=values.length,index=0;for(index=0,total=values.length;index<total;index++)if(validator.isUrl(values[index][1])||"0"==values[index][1]){image.value=[values[index]],values.splice(index,1);break}for(index=0,total=values.length;index<total;index++)if(validator.isListStylePositionKeyword(values[index][1])){position.value=[values[index]],values.splice(index,1);break}return values.length>0&&(validator.isListStyleTypeKeyword(values[0][1])||validator.isIdentifier(values[0][1]))&&(type.value=[values[0]]),components},multiplex:function(splitWith){return function(property,configuration,validator){var i,j,l,m,splitsAt=[],values=property.value;for(i=0,l=values.length;i<l;i++)","==values[i][1]&&splitsAt.push(i);if(0===splitsAt.length)return splitWith(property,configuration,validator);var splitComponents=[];for(i=0,l=splitsAt.length;i<=l;i++){var from=0===i?0:splitsAt[i-1]+1,to=i<l?splitsAt[i]:values.length,_property=_wrapDefault(property.name,0,configuration);_property.value=values.slice(from,to),_property.value.length>0&&splitComponents.push(splitWith(_property,configuration,validator))}var components=splitComponents[0];for(i=0,l=components.length;i<l;i++)for(components[i].multiplex=!0,j=1,m=splitComponents.length;j<m;j++)components[i].value.push([Token.PROPERTY_VALUE,Marker.COMMA]),Array.prototype.push.apply(components[i].value,splitComponents[j][i].value);return components}},outline:widthStyleColor,transition:function(property,configuration,validator){var value,i,l,prop=_wrapDefault(property.name+"-property",0,configuration),duration=_wrapDefault(property.name+"-duration",0,configuration),timing=_wrapDefault(property.name+"-timing-function",0,configuration),delay=_wrapDefault(property.name+"-delay",0,configuration),components=[prop,duration,timing,delay],values=property.value,durationSet=!1,delaySet=!1,propSet=!1,timingSet=!1;if(1==property.value.length&&"inherit"==property.value[0][1])return prop.value=duration.value=timing.value=delay.value=property.value,components;if(values.length>1&&_anyIsInherit(values))throw new InvalidPropertyError("Invalid animation values at "+formatPosition(values[0][2][0])+". Ignoring.");for(i=0,l=values.length;i<l;i++)if(value=values[i],validator.isTime(value[1])&&!durationSet)duration.value=[value],durationSet=!0;else if(validator.isTime(value[1])&&!delaySet)delay.value=[value],delaySet=!0;else if(!validator.isGlobal(value[1])&&!validator.isTimingFunction(value[1])||timingSet){if(!validator.isIdentifier(value[1])||propSet)throw new InvalidPropertyError("Invalid animation value at "+formatPosition(value[2][0])+". Ignoring.");prop.value=[value],propSet=!0}else timing.value=[value],timingSet=!0;return components}},breakUp}function requireVendorPrefixes(){if(hasRequiredVendorPrefixes)return vendorPrefixes;hasRequiredVendorPrefixes=1;var VENDOR_PREFIX_PATTERN=/(?:^|\W)(-\w+-)/g;function unique(value){for(var match,prefixes=[];null!==(match=VENDOR_PREFIX_PATTERN.exec(value));)-1==prefixes.indexOf(match[0])&&prefixes.push(match[0]);return prefixes}return vendorPrefixes={unique:unique,same:function(value1,value2){return unique(value1).sort().join(",")==unique(value2).sort().join(",")}}}function requireCanOverride(){if(hasRequiredCanOverride)return canOverride;hasRequiredCanOverride=1;var understandable=function(){if(hasRequiredUnderstandable)return understandable_1;hasRequiredUnderstandable=1;var sameVendorPrefixes=requireVendorPrefixes().same;return understandable_1=function(validator,value1,value2,_position,isPaired){return!(!sameVendorPrefixes(value1,value2)||isPaired&&validator.isVariable(value1)!==validator.isVariable(value2))},understandable_1}();function areSameFunction(validator,value1,value2){if(!validator.isFunction(value1)||!validator.isFunction(value2))return!1;var function1Name=value1.substring(0,value1.indexOf("(")),function2Name=value2.substring(0,value2.indexOf("(")),function1Value=value1.substring(function1Name.length+1,value1.length-1),function2Value=value2.substring(function2Name.length+1,value2.length-1);return validator.isFunction(function1Value)||validator.isFunction(function2Value)?function1Name===function2Name&&areSameFunction(validator,function1Value,function2Value):function1Name===function2Name}function keyword(propertyName){return function(validator,value1,value2){return!(!understandable(validator,value1,value2,0,!0)&&!validator.isKeyword(propertyName)(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||validator.isKeyword(propertyName)(value2))}}function keywordWithGlobal(propertyName){return function(validator,value1,value2){return!!(understandable(validator,value1,value2,0,!0)||validator.isKeyword(propertyName)(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isKeyword(propertyName)(value2)||validator.isGlobal(value2)))}}function sameFunctionOrValue(validator,value1,value2){return!!areSameFunction(validator,value1,value2)||value1===value2}function unit(validator,value1,value2){return!(!understandable(validator,value1,value2,0,!0)&&!validator.isUnit(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!(validator.isUnit(value1)&&!validator.isUnit(value2))&&(!!validator.isUnit(value2)||!validator.isUnit(value1)&&(!(!validator.isFunction(value1)||validator.isPrefixed(value1)||!validator.isFunction(value2)||validator.isPrefixed(value2))||sameFunctionOrValue(validator,value1,value2))))}function unitOrKeywordWithGlobal(propertyName){var byKeyword=keywordWithGlobal(propertyName);return function(validator,value1,value2){return unit(validator,value1,value2)||byKeyword(validator,value1,value2)}}return canOverride={generic:{color:function(validator,value1,value2){return!(!understandable(validator,value1,value2,0,!0)&&!validator.isColor(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!(!validator.colorOpacity&&(validator.isRgbColor(value1)||validator.isHslColor(value1)))&&(!(!validator.colorOpacity&&(validator.isRgbColor(value2)||validator.isHslColor(value2)))&&(!(!validator.colorHexAlpha&&(validator.isHexAlphaColor(value1)||validator.isHexAlphaColor(value2)))&&(!(!validator.isColor(value1)||!validator.isColor(value2))||sameFunctionOrValue(validator,value1,value2)))))},components:function(overrideCheckers){return function(validator,value1,value2,position){return overrideCheckers[position](validator,value1,value2)}},image:function(validator,value1,value2){return!(!understandable(validator,value1,value2,0,!0)&&!validator.isImage(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(!!validator.isImage(value2)||!validator.isImage(value1)&&sameFunctionOrValue(validator,value1,value2)))},propertyName:function(validator,value1,value2){return!(!understandable(validator,value1,value2,0,!0)&&!validator.isIdentifier(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||validator.isIdentifier(value2))},time:function(validator,value1,value2){return!(!understandable(validator,value1,value2,0,!0)&&!validator.isTime(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!(validator.isTime(value1)&&!validator.isTime(value2))&&(!!validator.isTime(value2)||!validator.isTime(value1)&&(!(!validator.isFunction(value1)||validator.isPrefixed(value1)||!validator.isFunction(value2)||validator.isPrefixed(value2))||sameFunctionOrValue(validator,value1,value2))))},timingFunction:function(validator,value1,value2){return!!(understandable(validator,value1,value2,0,!0)||validator.isTimingFunction(value2)||validator.isGlobal(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||(validator.isTimingFunction(value2)||validator.isGlobal(value2)))},unit:unit,unitOrNumber:function(validator,value1,value2){return!!(understandable(validator,value1,value2,0,!0)||validator.isUnit(value2)||validator.isNumber(value2))&&(!(!validator.isVariable(value1)||!validator.isVariable(value2))||!((validator.isUnit(value1)||vali