@dsebastien/music-notation 0.19.0 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/THIRD_PARTY_LICENSES.md +208 -27
- package/dist/cli.js +25 -45
- package/dist/index.js +7 -7
- package/dist/index.js.map +6 -6
- package/dist/music-notation.publish.min.js +4 -4
- package/dist/music-notation.tab.min.js +6 -6
- package/dist/publish/index.js +7 -7
- package/dist/publish/index.js.map +6 -6
- package/dist/tab/index.d.ts +1 -1
- package/dist/tab/index.js +7 -4
- package/dist/tab/index.js.map +3 -3
- package/package.json +11 -11
package/dist/cli.js
CHANGED
|
@@ -1,54 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire}from"node:module";var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames}=Object;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,"default")?__defProp(target,"default",{value:mod,enumerable:!0}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0,configurable:!0,set:__exportSetter.bind(all,name)})};var __require=createRequire(import.meta.url);var require_CSSOM=__commonJS(function(exports2,module2){var CSSOM2={setup:function(opts){var instance=Object.create(this);if(opts.globalObject){if(instance.CSSStyleSheet){var factoryCSSStyleSheet=createFunctionFactory(instance.CSSStyleSheet),CSSStyleSheet=factoryCSSStyleSheet();CSSStyleSheet.prototype.__globalObject=opts.globalObject,instance.CSSStyleSheet=CSSStyleSheet}}return instance}};function createFunctionFactory(fn){return function(){var newFn=function(){return fn.apply(this,arguments)};Object.setPrototypeOf(newFn,Object.getPrototypeOf(fn));for(var key in fn)if(Object.prototype.hasOwnProperty.call(fn,key))newFn[key]=fn[key];if(fn.prototype)newFn.prototype=Object.create(fn.prototype);return newFn}}module2.exports=CSSOM2});var require_errorUtils=__commonJS(function(exports,module){function getErrorConstructor(context,errorType){if(context.parentStyleSheet&&context.parentStyleSheet.__globalObject&&context.parentStyleSheet.__globalObject[errorType])return context.parentStyleSheet.__globalObject[errorType];if(context.__parentStyleSheet&&context.__parentStyleSheet.__globalObject&&context.__parentStyleSheet.__globalObject[errorType])return context.__parentStyleSheet.__globalObject[errorType];if(context.__globalObject&&context.__globalObject[errorType])return context.__globalObject[errorType];return typeof global<"u"&&global[errorType]||typeof window<"u"&&window[errorType]||eval(errorType)}function createError(context2,errorType2,message,name){var ErrorConstructor=getErrorConstructor(context2,errorType2);return new ErrorConstructor(message,name)}function throwError(context2,errorType2,message,name){throw createError(context2,errorType2,message,name)}function throwMissingArguments(context2,methodName,objectName,required,provided){required=required||1,provided=provided||0;var message="Failed to execute '"+methodName+"' on '"+objectName+"': "+required+" argument"+(required>1?"s":"")+" required, but only "+provided+" present.";throwError(context2,"TypeError",message)}function throwParseError(context2,methodName,objectName,rule,name){var message="Failed to execute '"+methodName+"' on '"+objectName+"': Failed to parse the rule '"+rule+"'.";throwError(context2,"DOMException",message,name||"SyntaxError")}function throwIndexError(context2,methodName,objectName,index,maxIndex,name){var message="Failed to execute '"+methodName+"' on '"+objectName+"': The index provided ("+index+") is larger than the maximum index ("+maxIndex+").";throwError(context2,"DOMException",message,name||"IndexSizeError")}var errorUtils={createError,getErrorConstructor,throwError,throwMissingArguments,throwParseError,throwIndexError};exports.errorUtils=errorUtils});var require_regexPatterns=__commonJS(function(exports2){var atKeyframesRegExp=/@(-(?:\w+-)+)?keyframes/g,beforeRulePortionRegExp=/{(?!.*{)|}(?!.*})|;(?!.*;)|\*\/(?!.*\*\/)/g,beforeRuleValidationRegExp=/^[\s{};]*(\*\/\s*)?$/,forwardRuleValidationRegExp=/(?:\s|\/\*|\{|\()/,forwardImportRuleValidationRegExp=/(?:\s|\/\*|'|")/,forwardRuleClosingBraceRegExp=/{[^{}]*}|}/,forwardRuleSemicolonAndOpeningBraceRegExp=/^.*?({|;)/,cssCustomIdentifierRegExp=/^(-?[_a-zA-Z]+(\.[_a-zA-Z]+)*[_a-zA-Z0-9-]*)$/,startsWithCombinatorRegExp=/^\s*[>+~]/,atPageRuleSelectorRegExp=/^([^\s:]+)?((?::\w+)*)$/,layerRegExp=/layer\(([^)]*)\)/,layerRuleNameRegExp=/^(-?[_a-zA-Z]+(\.[_a-zA-Z]+)*[_a-zA-Z0-9-]*)$/,doubleOrMoreSpacesRegExp=/\s{2,}/g,startsWithHexEscapeRegExp=/^\\[0-9a-fA-F]/,identStartCharRegExp=/[a-zA-Z_\u00A0-\uFFFF]/,identCharRegExp=/^[a-zA-Z0-9_\-\u00A0-\uFFFF\\]/,specialCharsNeedEscapeRegExp=/[!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~\s]/,combinatorOrSeparatorRegExp=/[\s>+~,()]/,afterHexEscapeSeparatorRegExp=/[\s>+~,(){}\[\]]/,trailingSpaceSeparatorRegExp=/[\s>+~,(){}]/,endsWithHexEscapeRegExp=/\\[0-9a-fA-F]{1,6}\s+$/,basicStylePropertyValueValidationRegExp=/:(?![^(]*\))(?=(?:[^'"]|'[^']*'|"[^"]*")*$)/,attributeSelectorContentRegExp=/^([^\s=~|^$*]+)\s*(~=|\|=|\^=|\$=|\*=|=)\s*(.+)$/,pseudoElementRegExp=/::[a-zA-Z][\w-]*|:(before|after|first-line|first-letter)(?![a-zA-Z0-9_-])/,invalidCombinatorLtGtRegExp=/<>/,invalidCombinatorDoubleGtRegExp=/>>/,consecutiveCombinatorsRegExp=/[>+~]\s*[>+~]/,invalidSlottedRegExp=/(?:^|[\s>+~,\[])slotted\s*\(/i,invalidPartRegExp=/(?:^|[\s>+~,\[])part\s*\(/i,invalidCueRegExp=/(?:^|[\s>+~,\[])cue\s*\(/i,invalidCueRegionRegExp=/(?:^|[\s>+~,\[])cue-region\s*\(/i,invalidNestingPattern=/&(?![.\#\[:>\+~\s])[a-zA-Z]/,emptyPseudoClassRegExp=/:(?:is|not|where|has)\(\s*\)/,whitespaceNormalizationRegExp=/(['"])(?:\\.|[^\\])*?\1|(\r\n|\r|\n)/g,newlineRemovalRegExp=/\n/g,whitespaceAndDotRegExp=/[\s.]/,declarationOrOpenBraceRegExp=/[{;}]/,ampersandRegExp=/&/,hexEscapeSequenceRegExp=/^([0-9a-fA-F]{1,6})[ \t\r\n\f]?/,attributeCaseFlagRegExp=/^(.+?)\s+([is])$/i,prependedAmpersandRegExp=/^&\s+[:\\.]/,openBraceGlobalRegExp=/{/g,closeBraceGlobalRegExp=/}/g,scopePreludeSplitRegExp=/\s*\)\s*to\s+\(/,leadingWhitespaceRegExp=/^\s+/,doubleQuoteRegExp=/"/g,backslashRegExp=/\\/g,invalidMediaOperatorWithoutSpaceRegExp=/\)(and|or)\(/i,invalidMediaNotAfterOperatorRegExp=/\b(and|or)\s+not\b/i,invalidMediaNotIdentifierRegExp=/\)\s+not\(/i,invalidMediaNotAfterFeatureRegExp=/\)\s+not\s+/i,invalidMediaOperatorBetweenParensRegExp=/\)\s+(?!and\b|or\b)[a-z]+\s+\(/i,invalidMediaNotWithMediaTypeRegExp=/\bnot\s+[a-z][a-z0-9_-]*\s+\(/i,mediaFeatureColonRegExp=/(\(\s*)([^():]+):(\s*)([^()]*\))/g,identifierBeforeParenRegExp=/[a-z0-9_-]/i,mediaAndOperatorRegExp=/\s*\band\b\s*/gi,mediaOrOperatorRegExp=/\s*\bor\b\s*/gi,mediaNotOperatorStartRegExp=/^\s*not\s+(?=\S)/i,mediaNotOperatorRegExp=/\s+\bnot\s+(?=\S)/gi,regexPatterns={atKeyframesRegExp,beforeRulePortionRegExp,beforeRuleValidationRegExp,forwardRuleValidationRegExp,forwardImportRuleValidationRegExp,forwardRuleClosingBraceRegExp,forwardRuleSemicolonAndOpeningBraceRegExp,cssCustomIdentifierRegExp,startsWithCombinatorRegExp,atPageRuleSelectorRegExp,layerRegExp,layerRuleNameRegExp,doubleOrMoreSpacesRegExp,startsWithHexEscapeRegExp,identStartCharRegExp,identCharRegExp,specialCharsNeedEscapeRegExp,combinatorOrSeparatorRegExp,afterHexEscapeSeparatorRegExp,trailingSpaceSeparatorRegExp,endsWithHexEscapeRegExp,basicStylePropertyValueValidationRegExp,attributeSelectorContentRegExp,pseudoElementRegExp,invalidCombinatorLtGtRegExp,invalidCombinatorDoubleGtRegExp,consecutiveCombinatorsRegExp,invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp,invalidNestingPattern,emptyPseudoClassRegExp,whitespaceNormalizationRegExp,newlineRemovalRegExp,whitespaceAndDotRegExp,declarationOrOpenBraceRegExp,ampersandRegExp,hexEscapeSequenceRegExp,attributeCaseFlagRegExp,prependedAmpersandRegExp,openBraceGlobalRegExp,closeBraceGlobalRegExp,scopePreludeSplitRegExp,leadingWhitespaceRegExp,doubleQuoteRegExp,backslashRegExp,invalidMediaOperatorWithoutSpaceRegExp,invalidMediaNotAfterOperatorRegExp,invalidMediaNotIdentifierRegExp,invalidMediaNotAfterFeatureRegExp,invalidMediaOperatorBetweenParensRegExp,invalidMediaNotWithMediaTypeRegExp,mediaFeatureColonRegExp,identifierBeforeParenRegExp,mediaAndOperatorRegExp,mediaOrOperatorRegExp,mediaNotOperatorStartRegExp,mediaNotOperatorRegExp};exports2.regexPatterns=regexPatterns});var require_MediaList=__commonJS(function(exports2){var CSSOM2={};CSSOM2.MediaList=function(){this.length=0};CSSOM2.MediaList.prototype={constructor:CSSOM2.MediaList,get mediaText(){return Array.prototype.join.call(this,", ")},set mediaText(value){if(typeof value==="string"){var values=value.split(",").filter(function(text){return!!text}),length=this.length=values.length;for(var i=0;i<length;i++)this[i]=values[i].trim()}else if(value===null){var length=this.length;for(var i=0;i<length;i++)delete this[i];this.length=0}},appendMedium:function(medium){if(Array.prototype.indexOf.call(this,medium)===-1)this[this.length]=medium,this.length++},deleteMedium:function(medium){var index=Array.prototype.indexOf.call(this,medium);if(index!==-1)Array.prototype.splice.call(this,index,1)},item:function(index){return this[index]||null},toString:function(){return this.mediaText}};exports2.MediaList=CSSOM2.MediaList});var require_StyleSheet=__commonJS(function(exports2){var CSSOM2={MediaList:require_MediaList().MediaList};CSSOM2.StyleSheet=function(){this.__href=null,this.__ownerNode=null,this.__title=null,this.__media=new CSSOM2.MediaList,this.__parentStyleSheet=null,this.disabled=!1};Object.defineProperties(CSSOM2.StyleSheet.prototype,{type:{get:function(){return"text/css"}},href:{get:function(){return this.__href}},ownerNode:{get:function(){return this.__ownerNode}},title:{get:function(){return this.__title}},media:{get:function(){return this.__media},set:function(value){if(typeof value==="string")this.__media.mediaText=value;else this.__media=value}},parentStyleSheet:{get:function(){return this.__parentStyleSheet}}});exports2.StyleSheet=CSSOM2.StyleSheet});var require_CSSRuleList=__commonJS(function(exports2){var CSSOM2={};CSSOM2.CSSRuleList=function(){var arr=[];return Object.setPrototypeOf(arr,CSSOM2.CSSRuleList.prototype),arr};CSSOM2.CSSRuleList.prototype=Object.create(Array.prototype);CSSOM2.CSSRuleList.prototype.constructor=CSSOM2.CSSRuleList;CSSOM2.CSSRuleList.prototype.item=function(index){return this[index]||null};exports2.CSSRuleList=CSSOM2.CSSRuleList});var require_CSSRule=__commonJS(function(exports2){var CSSOM2={};CSSOM2.CSSRule=function(){this.__parentRule=null,this.__parentStyleSheet=null};CSSOM2.CSSRule.UNKNOWN_RULE=0;CSSOM2.CSSRule.STYLE_RULE=1;CSSOM2.CSSRule.CHARSET_RULE=2;CSSOM2.CSSRule.IMPORT_RULE=3;CSSOM2.CSSRule.MEDIA_RULE=4;CSSOM2.CSSRule.FONT_FACE_RULE=5;CSSOM2.CSSRule.PAGE_RULE=6;CSSOM2.CSSRule.KEYFRAMES_RULE=7;CSSOM2.CSSRule.KEYFRAME_RULE=8;CSSOM2.CSSRule.MARGIN_RULE=9;CSSOM2.CSSRule.NAMESPACE_RULE=10;CSSOM2.CSSRule.COUNTER_STYLE_RULE=11;CSSOM2.CSSRule.SUPPORTS_RULE=12;CSSOM2.CSSRule.DOCUMENT_RULE=13;CSSOM2.CSSRule.FONT_FEATURE_VALUES_RULE=14;CSSOM2.CSSRule.VIEWPORT_RULE=15;CSSOM2.CSSRule.REGION_STYLE_RULE=16;CSSOM2.CSSRule.CONTAINER_RULE=17;CSSOM2.CSSRule.LAYER_BLOCK_RULE=18;CSSOM2.CSSRule.STARTING_STYLE_RULE=1002;Object.defineProperties(CSSOM2.CSSRule.prototype,{constructor:{value:CSSOM2.CSSRule},cssRule:{value:"",configurable:!0,enumerable:!0},cssText:{get:function(){return""},set:function(cssText){return cssText}},parentRule:{get:function(){return this.__parentRule}},parentStyleSheet:{get:function(){return this.__parentStyleSheet}},UNKNOWN_RULE:{value:0,enumerable:!0},STYLE_RULE:{value:1,enumerable:!0},CHARSET_RULE:{value:2,enumerable:!0},IMPORT_RULE:{value:3,enumerable:!0},MEDIA_RULE:{value:4,enumerable:!0},FONT_FACE_RULE:{value:5,enumerable:!0},PAGE_RULE:{value:6,enumerable:!0},KEYFRAMES_RULE:{value:7,enumerable:!0},KEYFRAME_RULE:{value:8,enumerable:!0},MARGIN_RULE:{value:9,enumerable:!0},NAMESPACE_RULE:{value:10,enumerable:!0},COUNTER_STYLE_RULE:{value:11,enumerable:!0},SUPPORTS_RULE:{value:12,enumerable:!0},DOCUMENT_RULE:{value:13,enumerable:!0},FONT_FEATURE_VALUES_RULE:{value:14,enumerable:!0},VIEWPORT_RULE:{value:15,enumerable:!0},REGION_STYLE_RULE:{value:16,enumerable:!0},CONTAINER_RULE:{value:17,enumerable:!0},LAYER_BLOCK_RULE:{value:18,enumerable:!0},STARTING_STYLE_RULE:{value:1002,enumerable:!0}});exports2.CSSRule=CSSOM2.CSSRule});var require_CSSGroupingRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,parse:require_parse().parse},errorUtils2=require_errorUtils().errorUtils;CSSOM2.CSSGroupingRule=function(){CSSOM2.CSSRule.call(this),this.__cssRules=new CSSOM2.CSSRuleList};CSSOM2.CSSGroupingRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSGroupingRule.prototype.constructor=CSSOM2.CSSGroupingRule;Object.setPrototypeOf(CSSOM2.CSSGroupingRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSGroupingRule.prototype,"cssRules",{get:function(){return this.__cssRules}});CSSOM2.CSSGroupingRule.prototype.insertRule=function(rule,index){if(rule===void 0&&index===void 0)errorUtils2.throwMissingArguments(this,"insertRule",this.constructor.name);if(index===void 0)index=0;if(index=Number(index),index<0)index=4294967296+index;if(index>this.cssRules.length)errorUtils2.throwIndexError(this,"insertRule",this.constructor.name,index,this.cssRules.length);var ruleToParse=processedRuleToParse=String(rule);ruleToParse=ruleToParse.trim().replace(/^\/\*[\s\S]*?\*\/\s*/,"");var isNestedSelector=this.constructor.name==="CSSStyleRule";if(isNestedSelector===!1){var currentRule=this;while(currentRule.parentRule)if(currentRule=currentRule.parentRule,currentRule.constructor.name==="CSSStyleRule"){isNestedSelector=!0;break}}if(isNestedSelector)processedRuleToParse="s { n { } "+ruleToParse+"}";var isScopeRule=this.constructor.name==="CSSScopeRule";if(isScopeRule)if(isNestedSelector)processedRuleToParse="s { @scope {"+ruleToParse+"}}";else processedRuleToParse="@scope {"+ruleToParse+"}";var parsedRules=new CSSOM2.CSSRuleList;if(CSSOM2.parse(processedRuleToParse,{styleSheet:this.parentStyleSheet,cssRules:parsedRules}),isScopeRule)if(isNestedSelector)parsedRules=parsedRules[0].cssRules[0].cssRules;else parsedRules=parsedRules[0].cssRules;if(isNestedSelector)parsedRules=parsedRules[0].cssRules.slice(1);if(parsedRules.length!==1)if(isNestedSelector&&parsedRules.length===0&&ruleToParse.indexOf("@font-face")===0)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Only conditional nested group rules, style rules, @scope rules, @apply rules, and nested declaration rules may be nested.","HierarchyRequestError");else errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");var cssRule=parsedRules[0];if(cssRule.constructor.name==="CSSNestedDeclarations"&&cssRule.style.length===0)errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");if(cssRule.constructor.name==="CSSImportRule"||cssRule.constructor.name==="CSSNamespaceRule"){var ruleKeyword=cssRule.constructor.name==="CSSImportRule"?"@import":"@namespace";errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': '"+ruleKeyword+"' rules cannot be inserted inside a group rule.","HierarchyRequestError")}if(cssRule.constructor.name==="CSSLayerStatementRule")errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");return cssRule.__parentRule=this,this.cssRules.splice(index,0,cssRule),index};CSSOM2.CSSGroupingRule.prototype.deleteRule=function(index){if(index===void 0)errorUtils2.throwMissingArguments(this,"deleteRule",this.constructor.name);if(index=Number(index),index<0)index=4294967296+index;if(index>=this.cssRules.length)errorUtils2.throwIndexError(this,"deleteRule",this.constructor.name,index,this.cssRules.length);this.cssRules[index].__parentRule=null,this.cssRules[index].__parentStyleSheet=null,this.cssRules.splice(index,1)};exports2.CSSGroupingRule=CSSOM2.CSSGroupingRule});var require_CSSStyleRule=__commonJS(function(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule},regexPatterns=require_regexPatterns().regexPatterns;try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSStyleRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__selectorText="",this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSStyleRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSStyleRule.prototype.constructor=CSSOM2.CSSStyleRule;Object.setPrototypeOf(CSSOM2.CSSStyleRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"type",{value:1,writable:!1});Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"selectorText",{get:function(){return this.__selectorText},set:function(value){if(typeof value==="string"){var endsWithHexEscapeRegExp=regexPatterns.endsWithHexEscapeRegExp,endsWithEscape=endsWithHexEscapeRegExp.test(value),trimmedValue=endsWithEscape?value.replace(/\s+$/," ").trimStart():value.trim();if(trimmedValue==="")return;this.__selectorText=trimmedValue}},configurable:!0});Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value},configurable:!0});Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"cssText",{get:function(){var text;if(this.selectorText){var values="";if(this.cssRules.length){var valuesArr=[" {"];this.style.cssText&&valuesArr.push(this.style.cssText),valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
3
|
-
`)),values=valuesArr.join(`
|
|
4
|
-
`)+`
|
|
5
|
-
}`}else values=" {"+(this.style.cssText?" "+this.style.cssText:"")+" }";text=this.selectorText+values}else text="";return text}});exports2.CSSStyleRule=CSSOM2.CSSStyleRule});var require_CSSStyleSheet=__commonJS(function(exports2){var CSSOM2={MediaList:require_MediaList().MediaList,StyleSheet:require_StyleSheet().StyleSheet,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSStyleRule:require_CSSStyleRule().CSSStyleRule},errorUtils2=require_errorUtils().errorUtils;CSSOM2.CSSStyleSheet=function(opts){if(CSSOM2.StyleSheet.call(this),this.__constructed=!0,this.__cssRules=new CSSOM2.CSSRuleList,this.__ownerRule=null,opts&&typeof opts==="object"){if(opts.baseURL&&typeof opts.baseURL==="string")this.__baseURL=opts.baseURL;if(opts.media&&typeof opts.media==="string")this.media.mediaText=opts.media;if(typeof opts.disabled==="boolean")this.disabled=opts.disabled}};CSSOM2.CSSStyleSheet.prototype=Object.create(CSSOM2.StyleSheet.prototype);CSSOM2.CSSStyleSheet.prototype.constructor=CSSOM2.CSSStyleSheet;Object.setPrototypeOf(CSSOM2.CSSStyleSheet,CSSOM2.StyleSheet);Object.defineProperty(CSSOM2.CSSStyleSheet.prototype,"cssRules",{get:function(){return this.__cssRules}});Object.defineProperty(CSSOM2.CSSStyleSheet.prototype,"rules",{get:function(){return this.__cssRules}});Object.defineProperty(CSSOM2.CSSStyleSheet.prototype,"ownerRule",{get:function(){return this.__ownerRule}});CSSOM2.CSSStyleSheet.prototype.insertRule=function(rule,index){if(rule===void 0&&index===void 0)errorUtils2.throwMissingArguments(this,"insertRule",this.constructor.name);if(index===void 0)index=0;if(index=Number(index),index<0)index=4294967296+index;if(index>this.cssRules.length)errorUtils2.throwIndexError(this,"insertRule",this.constructor.name,index,this.cssRules.length);var ruleToParse=String(rule),parseErrors=[],parsedSheet=CSSOM2.parse(ruleToParse,void 0,function(err){parseErrors.push(err)});if(parsedSheet.cssRules.length!==1)errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");var cssRule=parsedSheet.cssRules[0];function findLastIndexOfConstructor(rules,constructorName){for(var i=rules.length-1;i>=0;i--)if(rules[i].constructor.name===constructorName)return i;return-1}function findFirstNonConstructorIndex(rules,constructorNames){for(var i=0;i<rules.length;i++)if(constructorNames.indexOf(rules[i].constructor.name)===-1)return i;return rules.length}if(cssRule.constructor.name==="CSSImportRule"){if(this.__constructed===!0)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Can't insert @import rules into a constructed stylesheet.","SyntaxError");var firstLayerIndex=findFirstNonConstructorIndex(this.cssRules,["CSSImportRule"]);if(firstLayerIndex<this.cssRules.length&&this.cssRules[firstLayerIndex].constructor.name==="CSSLayerStatementRule"&&index>firstLayerIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError");var firstNonImportIndex=findFirstNonConstructorIndex(this.cssRules,["CSSImportRule"]);if(index>firstNonImportIndex&&firstNonImportIndex<this.cssRules.length&&this.cssRules[firstNonImportIndex].constructor.name!=="CSSLayerStatementRule")errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError")}else if(cssRule.constructor.name==="CSSNamespaceRule"){var firstImportIndex=-1;for(var i=0;i<this.cssRules.length;i++)if(this.cssRules[i].constructor.name==="CSSImportRule"){firstImportIndex=i;break}var firstNonImportNamespaceIndex=findFirstNonConstructorIndex(this.cssRules,["CSSLayerStatementRule","CSSImportRule","CSSNamespaceRule"]);if(firstImportIndex!==-1&&index<=firstImportIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError");if(firstNonImportNamespaceIndex<this.cssRules.length)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","InvalidStateError");if(index>firstNonImportNamespaceIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError")}else if(cssRule.constructor.name==="CSSLayerStatementRule");else{var firstNonSpecialRuleIndex=findFirstNonConstructorIndex(this.cssRules,["CSSLayerStatementRule","CSSImportRule","CSSNamespaceRule"]);if(index<firstNonSpecialRuleIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError");if(parseErrors.filter(function(error){return!error.isNested}).length!==0)errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError")}return cssRule.__parentStyleSheet=this,this.cssRules.splice(index,0,cssRule),index};CSSOM2.CSSStyleSheet.prototype.addRule=function(selector,styleBlock,index){if(index===void 0)index=this.cssRules.length;return this.insertRule(selector+"{"+styleBlock+"}",index),-1};CSSOM2.CSSStyleSheet.prototype.deleteRule=function(index){if(index===void 0)errorUtils2.throwMissingArguments(this,"deleteRule",this.constructor.name);if(index=Number(index),index<0)index=4294967296+index;if(index>=this.cssRules.length)errorUtils2.throwIndexError(this,"deleteRule",this.constructor.name,index,this.cssRules.length);if(this.cssRules[index]){if(this.cssRules[index].constructor.name=="CSSNamespaceRule"){var shouldContinue=this.cssRules.every(function(rule){return["CSSImportRule","CSSLayerStatementRule","CSSNamespaceRule"].indexOf(rule.constructor.name)!==-1});if(!shouldContinue)errorUtils2.throwError(this,"DOMException","Failed to execute 'deleteRule' on '"+this.constructor.name+"': Failed to delete rule.","InvalidStateError")}if(this.cssRules[index].constructor.name=="CSSImportRule")this.cssRules[index].styleSheet.__parentStyleSheet=null;this.cssRules[index].__parentStyleSheet=null}this.cssRules.splice(index,1)};CSSOM2.CSSStyleSheet.prototype.removeRule=function(index){if(index===void 0)index=0;this.deleteRule(index)};CSSOM2.CSSStyleSheet.prototype.replace=function(text){var _Promise;if(this.__globalObject&&this.__globalObject.Promise)_Promise=this.__globalObject.Promise;else _Promise=Promise;var _setTimeout;if(this.__globalObject&&this.__globalObject.setTimeout)_setTimeout=this.__globalObject.setTimeout;else _setTimeout=setTimeout;var sheet=this;return new _Promise(function(resolve,reject){if(!sheet.__constructed||sheet.__disallowModification)reject(errorUtils2.createError(sheet,"DOMException","Failed to execute 'replaceSync' on '"+sheet.constructor.name+"': Not allowed.","NotAllowedError"));sheet.__disallowModification=!0,_setTimeout(function(){var rules=new CSSOM2.CSSRuleList;CSSOM2.parse(text,{styleSheet:sheet,cssRules:rules});var i=0;while(i<rules.length)if(rules[i].constructor.name==="CSSImportRule")rules.splice(i,1);else i++;sheet.__cssRules.splice.apply(sheet.__cssRules,[0,sheet.__cssRules.length].concat(rules)),delete sheet.__disallowModification,resolve(sheet)})})};CSSOM2.CSSStyleSheet.prototype.replaceSync=function(text){var sheet=this;if(!sheet.__constructed||sheet.__disallowModification)errorUtils2.throwError(sheet,"DOMException","Failed to execute 'replaceSync' on '"+sheet.constructor.name+"': Not allowed.","NotAllowedError");var rules=new CSSOM2.CSSRuleList;CSSOM2.parse(text,{styleSheet:sheet,cssRules:rules});var i=0;while(i<rules.length)if(rules[i].constructor.name==="CSSImportRule")rules.splice(i,1);else i++;sheet.__cssRules.splice.apply(sheet.__cssRules,[0,sheet.__cssRules.length].concat(rules))};CSSOM2.CSSStyleSheet.prototype.toString=function(){var result="",rules=this.cssRules;for(var i=0;i<rules.length;i++)result+=rules[i].cssText+`
|
|
6
|
-
`;return result};exports2.CSSStyleSheet=CSSOM2.CSSStyleSheet;CSSOM2.parse=require_parse().parse});var require_CSSNestedDeclarations=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSNestedDeclarations=function(){CSSOM2.CSSRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSNestedDeclarations.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSNestedDeclarations.prototype.constructor=CSSOM2.CSSNestedDeclarations;Object.setPrototypeOf(CSSOM2.CSSNestedDeclarations,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSNestedDeclarations.prototype,"type",{value:0,writable:!1});Object.defineProperty(CSSOM2.CSSNestedDeclarations.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSNestedDeclarations.prototype,"cssText",{get:function(){return this.style.cssText}});exports2.CSSNestedDeclarations=CSSOM2.CSSNestedDeclarations});var require_CSSImportRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleSheet:require_CSSStyleSheet().CSSStyleSheet,MediaList:require_MediaList().MediaList},regexPatterns=require_regexPatterns().regexPatterns;CSSOM2.CSSImportRule=function(){CSSOM2.CSSRule.call(this),this.__href="",this.__media=new CSSOM2.MediaList,this.__layerName=null,this.__supportsText=null,this.__styleSheet=new CSSOM2.CSSStyleSheet};CSSOM2.CSSImportRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSImportRule.prototype.constructor=CSSOM2.CSSImportRule;Object.setPrototypeOf(CSSOM2.CSSImportRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSImportRule.prototype,"type",{value:3,writable:!1});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"cssText",{get:function(){var mediaText=this.media.mediaText;return'@import url("'+this.href.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'")'+(this.layerName!==null?" layer"+(this.layerName&&"("+this.layerName+")"):"")+(this.supportsText?" supports("+this.supportsText+")":"")+(mediaText?" "+mediaText:"")+";"}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"href",{get:function(){return this.__href}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"media",{get:function(){return this.__media},set:function(value){if(typeof value==="string")this.__media.mediaText=value;else this.__media=value}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"layerName",{get:function(){return this.__layerName}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"supportsText",{get:function(){return this.__supportsText}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"styleSheet",{get:function(){return this.__styleSheet}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"parse",{value:function(cssText){var i=0,state="",buffer="",index,{layerRegExp,layerRuleNameRegExp,doubleOrMoreSpacesRegExp}=regexPatterns;function extractSupportsContent(text){var supportsIndex=text.indexOf("supports(");if(supportsIndex!==0)return null;var depth=0,start=supportsIndex+9,i=start;for(;i<text.length;i++)if(text[i]==="(")depth++;else if(text[i]===")"){if(depth===0)return{content:text.slice(start,i),endIndex:i};depth--}return null}for(var character;character=cssText.charAt(i);i++)switch(character){case" ":case"\t":case"\r":case`
|
|
7
|
-
`:case"\f":if(state==="after-import")state="url";else buffer+=character;break;case"@":if(!state&&cssText.indexOf("@import",i)===i)state="after-import",i+=6,buffer="";break;case"u":if(state==="media")buffer+=character;if(state==="url"&&cssText.indexOf("url(",i)===i){if(index=cssText.indexOf(")",i+1),index===-1)throw i+': ")" not found';i+=4;var url=cssText.slice(i,index);if(url[0]===url[url.length-1]){if(url[0]==='"'||url[0]==="'")url=url.slice(1,-1)}this.__href=url,i=index,state="media"}break;case'"':if(state==="after-import"||state==="url"){if(index=cssText.indexOf('"',i+1),!index)throw i+`: '"' not found`;this.__href=cssText.slice(i+1,index),i=index,state="media"}break;case"'":if(state==="after-import"||state==="url"){if(index=cssText.indexOf("'",i+1),!index)throw i+`: "'" not found`;this.__href=cssText.slice(i+1,index),i=index,state="media"}break;case";":if(state==="media"){if(buffer){var bufferTrimmed=buffer.trim();if(bufferTrimmed.indexOf("layer")===0){var layerMatch=bufferTrimmed.match(layerRegExp);if(layerMatch){var layerName=layerMatch[1].trim();if(layerName.match(layerRuleNameRegExp)!==null)this.__layerName=layerMatch[1].trim(),bufferTrimmed=bufferTrimmed.replace(layerRegExp,"").replace(doubleOrMoreSpacesRegExp," ").trim();else if(bufferTrimmed){this.media.mediaText=bufferTrimmed;return}}else this.__layerName="",bufferTrimmed=bufferTrimmed.substring(5).trim()}var supportsResult=extractSupportsContent(bufferTrimmed);if(supportsResult)this.__supportsText=supportsResult.content.trim(),bufferTrimmed=bufferTrimmed.slice(0,0)+bufferTrimmed.slice(supportsResult.endIndex+1),bufferTrimmed=bufferTrimmed.replace(doubleOrMoreSpacesRegExp," ").trim();if(bufferTrimmed)this.media.mediaText=bufferTrimmed}}break;default:if(state==="media")buffer+=character;break}}});exports2.CSSImportRule=CSSOM2.CSSImportRule});var require_CSSNamespaceRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleSheet:require_CSSStyleSheet().CSSStyleSheet};CSSOM2.CSSNamespaceRule=function(){CSSOM2.CSSRule.call(this),this.__prefix="",this.__namespaceURI=""};CSSOM2.CSSNamespaceRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSNamespaceRule.prototype.constructor=CSSOM2.CSSNamespaceRule;Object.setPrototypeOf(CSSOM2.CSSNamespaceRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"type",{value:10,writable:!1});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"cssText",{get:function(){return"@namespace"+(this.prefix&&" "+this.prefix)+' url("'+this.namespaceURI+'");'}});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"prefix",{get:function(){return this.__prefix}});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"namespaceURI",{get:function(){return this.__namespaceURI}});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"parse",{value:function(cssText){var newPrefix="",newNamespaceURI="",text=cssText.trim();if(text.indexOf("@namespace")===0)text=text.slice(10).trim();if(text.charAt(text.length-1)===";")text=text.slice(0,-1).trim();var re=/^(?:([a-zA-Z_][a-zA-Z0-9_-]*)\s+)?(?:url\(\s*(?:(['"])(.*?)\2\s*|([^)]*?))\s*\)|(['"])(.*?)\5)$/,match=text.match(re);if(match){if(match[1])newPrefix=match[1];if(typeof match[3]<"u")newNamespaceURI=match[3];else if(typeof match[4]<"u")newNamespaceURI=match[4].trim();else if(typeof match[6]<"u")newNamespaceURI=match[6];this.__prefix=newPrefix,this.__namespaceURI=newNamespaceURI}else throw new DOMException("Invalid @namespace rule","InvalidStateError")}});exports2.CSSNamespaceRule=CSSOM2.CSSNamespaceRule});var require_CSSConditionRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSConditionRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__conditionText=""};CSSOM2.CSSConditionRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSConditionRule.prototype.constructor=CSSOM2.CSSConditionRule;Object.setPrototypeOf(CSSOM2.CSSConditionRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSConditionRule.prototype,"conditionText",{get:function(){return this.__conditionText}});exports2.CSSConditionRule=CSSOM2.CSSConditionRule});var require_CSSMediaRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule,MediaList:require_MediaList().MediaList};CSSOM2.CSSMediaRule=function(){CSSOM2.CSSConditionRule.call(this),this.__media=new CSSOM2.MediaList};CSSOM2.CSSMediaRule.prototype=Object.create(CSSOM2.CSSConditionRule.prototype);CSSOM2.CSSMediaRule.prototype.constructor=CSSOM2.CSSMediaRule;Object.setPrototypeOf(CSSOM2.CSSMediaRule,CSSOM2.CSSConditionRule);Object.defineProperty(CSSOM2.CSSMediaRule.prototype,"type",{value:4,writable:!1});Object.defineProperties(CSSOM2.CSSMediaRule.prototype,{media:{get:function(){return this.__media},set:function(value){if(typeof value==="string")this.__media.mediaText=value;else this.__media=value},configurable:!0,enumerable:!0},conditionText:{get:function(){return this.media.mediaText}},cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
8
|
-
`));return values=valuesArr.join(`
|
|
9
|
-
`)+`
|
|
10
|
-
}`,"@media "+this.media.mediaText+values}}});exports2.CSSMediaRule=CSSOM2.CSSMediaRule});var require_CSSCounterStyleRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule};CSSOM2.CSSCounterStyleRule=function(){CSSOM2.CSSRule.call(this),this.name="",this.__props=""};CSSOM2.CSSCounterStyleRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSCounterStyleRule.prototype.constructor=CSSOM2.CSSCounterStyleRule;Object.setPrototypeOf(CSSOM2.CSSCounterStyleRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSCounterStyleRule.prototype,"type",{value:11,writable:!1});Object.defineProperty(CSSOM2.CSSCounterStyleRule.prototype,"cssText",{get:function(){return"@counter-style "+this.name+" { "+this.__props+" }"}});Object.defineProperty(CSSOM2.CSSCounterStyleRule.prototype,"parse",{value:function(cssText){var match=cssText.match(/@counter-style\s+([^\s{]+)\s*\{([^]*)\}/);if(match){this.name=match[1];var propsText=match[2];this.__props=propsText.trim().replace(/\n/g," ").replace(/(['"])(?:\\.|[^\\])*?\1|(\s{2,})/g,function(match,quote){return quote?match:" "})}}});exports2.CSSCounterStyleRule=CSSOM2.CSSCounterStyleRule});var require_CSSPropertyRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule};CSSOM2.CSSPropertyRule=function(){CSSOM2.CSSRule.call(this),this.__name="",this.__syntax="",this.__inherits=!1,this.__initialValue=null};CSSOM2.CSSPropertyRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSPropertyRule.prototype.constructor=CSSOM2.CSSPropertyRule;Object.setPrototypeOf(CSSOM2.CSSPropertyRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"type",{value:0,writable:!1});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"cssText",{get:function(){var text="@property "+this.name+" {";if(this.syntax!=="")text+=' syntax: "'+this.syntax.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'";';if(text+=" inherits: "+(this.inherits?"true":"false")+";",this.initialValue!==null)text+=" initial-value: "+this.initialValue+";";return text+=" }",text}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"name",{get:function(){return this.__name}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"syntax",{get:function(){return this.__syntax}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"inherits",{get:function(){return this.__inherits}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"initialValue",{get:function(){return this.__initialValue}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"parse",{value:function(cssText){var match=cssText.match(/@property\s+(--[^\s{]+)\s*\{([^]*)\}/);if(!match)return!1;this.__name=match[1];var bodyText=match[2],syntaxMatch=bodyText.match(/syntax\s*:\s*(['"])([^]*?)\1\s*;/);if(!syntaxMatch)return!1;if(this.__syntax=syntaxMatch[2],this.__syntax==="")return!1;var inheritsMatch=bodyText.match(/inherits\s*:\s*(true|false)\s*;/);if(!inheritsMatch)return!1;this.__inherits=inheritsMatch[1]==="true";var initialValueMatch=bodyText.match(/initial-value\s*:\s*([^;]+);/);if(initialValueMatch)this.__initialValue=initialValueMatch[1].trim();else if(this.__syntax!=="*")return!1;return!0}});exports2.CSSPropertyRule=CSSOM2.CSSPropertyRule});var require_CSSContainerRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule};CSSOM2.CSSContainerRule=function(){CSSOM2.CSSConditionRule.call(this)};CSSOM2.CSSContainerRule.prototype=Object.create(CSSOM2.CSSConditionRule.prototype);CSSOM2.CSSContainerRule.prototype.constructor=CSSOM2.CSSContainerRule;Object.setPrototypeOf(CSSOM2.CSSContainerRule,CSSOM2.CSSConditionRule);Object.defineProperty(CSSOM2.CSSContainerRule.prototype,"type",{value:17,writable:!1});Object.defineProperties(CSSOM2.CSSContainerRule.prototype,{cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
11
|
-
`));return values=valuesArr.join(`
|
|
12
|
-
`)+`
|
|
13
|
-
}`,"@container "+this.conditionText+values}},containerName:{get:function(){var parts=this.conditionText.trim().split(/\s+/);if(parts.length>1&&parts[0]!=="("&&!parts[0].startsWith("("))return parts[0];return""}},containerQuery:{get:function(){var parts=this.conditionText.trim().split(/\s+/);if(parts.length>1&&parts[0]!=="("&&!parts[0].startsWith("("))return parts.slice(1).join(" ");return this.conditionText}}});exports2.CSSContainerRule=CSSOM2.CSSContainerRule});var require_CSSSupportsRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule};CSSOM2.CSSSupportsRule=function(){CSSOM2.CSSConditionRule.call(this)};CSSOM2.CSSSupportsRule.prototype=Object.create(CSSOM2.CSSConditionRule.prototype);CSSOM2.CSSSupportsRule.prototype.constructor=CSSOM2.CSSSupportsRule;Object.setPrototypeOf(CSSOM2.CSSSupportsRule,CSSOM2.CSSConditionRule);Object.defineProperty(CSSOM2.CSSSupportsRule.prototype,"type",{value:12,writable:!1});Object.defineProperty(CSSOM2.CSSSupportsRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
14
|
-
`));return values=valuesArr.join(`
|
|
15
|
-
`)+`
|
|
16
|
-
}`,"@supports "+this.conditionText+values}});exports2.CSSSupportsRule=CSSOM2.CSSSupportsRule});var require_CSSFontFaceRule=__commonJS(function(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSFontFaceRule=function(){CSSOM2.CSSRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSFontFaceRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSFontFaceRule.prototype.constructor=CSSOM2.CSSFontFaceRule;Object.setPrototypeOf(CSSOM2.CSSFontFaceRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"type",{value:5,writable:!1});Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"cssText",{get:function(){return"@font-face {"+(this.style.cssText?" "+this.style.cssText:"")+" }"}});exports2.CSSFontFaceRule=CSSOM2.CSSFontFaceRule});var require_CSSHostRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList};CSSOM2.CSSHostRule=function(){CSSOM2.CSSRule.call(this),this.cssRules=new CSSOM2.CSSRuleList};CSSOM2.CSSHostRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSHostRule.prototype.constructor=CSSOM2.CSSHostRule;Object.setPrototypeOf(CSSOM2.CSSHostRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSHostRule.prototype,"type",{value:1001,writable:!1});Object.defineProperty(CSSOM2.CSSHostRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
17
|
-
`));return values=valuesArr.join(`
|
|
18
|
-
`)+`
|
|
19
|
-
}`,"@host"+values}});exports2.CSSHostRule=CSSOM2.CSSHostRule});var require_CSSStartingStyleRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSStartingStyleRule=function(){CSSOM2.CSSGroupingRule.call(this)};CSSOM2.CSSStartingStyleRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSStartingStyleRule.prototype.constructor=CSSOM2.CSSStartingStyleRule;Object.setPrototypeOf(CSSOM2.CSSStartingStyleRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSStartingStyleRule.prototype,"type",{value:1002,writable:!1});Object.defineProperty(CSSOM2.CSSStartingStyleRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
20
|
-
`));return values=valuesArr.join(`
|
|
21
|
-
`)+`
|
|
22
|
-
}`,"@starting-style"+values}});exports2.CSSStartingStyleRule=CSSOM2.CSSStartingStyleRule});var require_CSSKeyframeRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSKeyframeRule=function(){CSSOM2.CSSRule.call(this),this.keyText="",this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSKeyframeRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSKeyframeRule.prototype.constructor=CSSOM2.CSSKeyframeRule;Object.setPrototypeOf(CSSOM2.CSSKeyframeRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"type",{value:8,writable:!1});Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"cssText",{get:function(){return this.keyText+" {"+(this.style.cssText?" "+this.style.cssText:"")+" }"}});exports2.CSSKeyframeRule=CSSOM2.CSSKeyframeRule});var require_CSSKeyframesRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,parse:require_parse().parse},errorUtils2=require_errorUtils().errorUtils;CSSOM2.CSSKeyframesRule=function(){CSSOM2.CSSRule.call(this),this.name="",this.cssRules=new CSSOM2.CSSRuleList,this._setupIndexedAccess();var self=this,originalPush=this.cssRules.push,originalSplice=this.cssRules.splice;Object.defineProperty(this.cssRules,"push",{value:function(){var result=originalPush.apply(this,arguments);return self._setupIndexedAccess(),result},writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(this.cssRules,"splice",{value:function(){var result=originalSplice.apply(this,arguments);return self._setupIndexedAccess(),result},writable:!0,enumerable:!1,configurable:!0})};CSSOM2.CSSKeyframesRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSKeyframesRule.prototype.constructor=CSSOM2.CSSKeyframesRule;Object.setPrototypeOf(CSSOM2.CSSKeyframesRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSKeyframesRule.prototype,"type",{value:7,writable:!1});Object.defineProperty(CSSOM2.CSSKeyframesRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
23
|
-
`));values=valuesArr.join(`
|
|
24
|
-
`)+`
|
|
25
|
-
}`;var cssWideKeywords=["initial","inherit","revert","revert-layer","unset","none"],processedName=cssWideKeywords.includes(this.name)?'"'+this.name+'"':this.name;return"@"+(this._vendorPrefix||"")+"keyframes "+processedName+values}});CSSOM2.CSSKeyframesRule.prototype.appendRule=function(rule){if(arguments.length===0)errorUtils2.throwMissingArguments(this,"appendRule","CSSKeyframesRule");var parsedRule;try{var tempStyleSheet=CSSOM2.parse("@keyframes temp { "+rule+" }");if(tempStyleSheet.cssRules.length>0&&tempStyleSheet.cssRules[0].cssRules.length>0)parsedRule=tempStyleSheet.cssRules[0].cssRules[0];else throw Error("Failed to parse keyframe rule")}catch(e){errorUtils2.throwParseError(this,"appendRule","CSSKeyframesRule",rule)}parsedRule.__parentRule=this,this.cssRules.push(parsedRule)};CSSOM2.CSSKeyframesRule.prototype.deleteRule=function(select){if(arguments.length===0)errorUtils2.throwMissingArguments(this,"deleteRule","CSSKeyframesRule");var normalizedSelect=this._normalizeKeyText(select);for(var i=0;i<this.cssRules.length;i++){var rule=this.cssRules[i];if(this._normalizeKeyText(rule.keyText)===normalizedSelect){rule.__parentRule=null,this.cssRules.splice(i,1);return}}};CSSOM2.CSSKeyframesRule.prototype.findRule=function(select){if(arguments.length===0)errorUtils2.throwMissingArguments(this,"findRule","CSSKeyframesRule");var normalizedSelect=this._normalizeKeyText(select);for(var i=this.cssRules.length-1;i>=0;i--){var rule=this.cssRules[i];if(this._normalizeKeyText(rule.keyText)===normalizedSelect)return rule}return null};CSSOM2.CSSKeyframesRule.prototype._normalizeKeyText=function(keyText){if(!keyText)return"";var normalized2=keyText.toString().trim().toLowerCase();if(normalized2==="from")return"0%";else if(normalized2==="to")return"100%";return normalized2};if(typeof Symbol<"u"&&Symbol.iterator)CSSOM2.CSSKeyframesRule.prototype[Symbol.iterator]=function(){var index=0,cssRules=this.cssRules;return{next:function(){if(index<cssRules.length)return{value:cssRules[index++],done:!1};else return{done:!0}}}};CSSOM2.CSSKeyframesRule.prototype._setupIndexedAccess=function(){for(var i=0;i<1000;i++)if(this.hasOwnProperty(i))delete this[i];else break;for(var i=0;i<this.cssRules.length;i++)(function(index){Object.defineProperty(this,index,{get:function(){return this.cssRules[index]},enumerable:!1,configurable:!0})}).call(this,i);Object.defineProperty(this,"length",{get:function(){return this.cssRules.length},enumerable:!1,configurable:!0})};exports2.CSSKeyframesRule=CSSOM2.CSSKeyframesRule});var require_CSSValue=__commonJS(function(exports2){var CSSOM2={};CSSOM2.CSSValue=function(){};CSSOM2.CSSValue.prototype={constructor:CSSOM2.CSSValue,set cssText(text){var name=this._getConstructorName();throw Error('DOMException: property "cssText" of "'+name+'" is readonly and can not be replaced with "'+text+'"!')},get cssText(){var name=this._getConstructorName();throw Error('getter "cssText" of "'+name+'" is not implemented!')},_getConstructorName:function(){var s=this.constructor.toString(),c=s.match(/function\s([^\(]+)/),name=c[1];return name}};exports2.CSSValue=CSSOM2.CSSValue});var require_CSSValueExpression=__commonJS(function(exports2){var CSSOM2={CSSValue:require_CSSValue().CSSValue};CSSOM2.CSSValueExpression=function(token,idx){this._token=token,this._idx=idx};CSSOM2.CSSValueExpression.prototype=Object.create(CSSOM2.CSSValue.prototype);CSSOM2.CSSValueExpression.prototype.constructor=CSSOM2.CSSValueExpression;Object.setPrototypeOf(CSSOM2.CSSValueExpression,CSSOM2.CSSValue);CSSOM2.CSSValueExpression.prototype.parse=function(){var token=this._token,idx=this._idx,character="",expression="",error="",info,paren=[];for(;;++idx){if(character=token.charAt(idx),character===""){error="css expression error: unfinished expression!";break}switch(character){case"(":paren.push(character),expression+=character;break;case")":paren.pop(character),expression+=character;break;case"/":if(info=this._parseJSComment(token,idx))if(info.error)error="css expression error: unfinished comment in expression!";else idx=info.idx;else if(info=this._parseJSRexExp(token,idx))idx=info.idx,expression+=info.text;else expression+=character;break;case"'":case'"':if(info=this._parseJSString(token,idx,character),info)idx=info.idx,expression+=info.text;else expression+=character;break;default:expression+=character;break}if(error)break;if(paren.length===0)break}var ret;if(error)ret={error};else ret={idx,expression};return ret};CSSOM2.CSSValueExpression.prototype._parseJSComment=function(token,idx){var nextChar=token.charAt(idx+1),text;if(nextChar==="/"||nextChar==="*"){var startIdx=idx,endIdx,commentEndChar;if(nextChar==="/")commentEndChar=`
|
|
26
|
-
`;else if(nextChar==="*")commentEndChar="*/";if(endIdx=token.indexOf(commentEndChar,startIdx+1+1),endIdx!==-1)return endIdx=endIdx+commentEndChar.length-1,text=token.substring(idx,endIdx+1),{idx:endIdx,text};else{var error="css expression error: unfinished comment in expression!";return{error}}}else return!1};CSSOM2.CSSValueExpression.prototype._parseJSString=function(token,idx,sep){var endIdx=this._findMatchedIdx(token,idx,sep),text;if(endIdx===-1)return!1;else return text=token.substring(idx,endIdx+sep.length),{idx:endIdx,text}};CSSOM2.CSSValueExpression.prototype._parseJSRexExp=function(token,idx){var before=token.substring(0,idx).replace(/\s+$/,""),legalRegx=[/^$/,/\($/,/\[$/,/\!$/,/\+$/,/\-$/,/\*$/,/\/\s+/,/\%$/,/\=$/,/\>$/,/<$/,/\&$/,/\|$/,/\^$/,/\~$/,/\?$/,/\,$/,/delete$/,/in$/,/instanceof$/,/new$/,/typeof$/,/void$/],isLegal=legalRegx.some(function(reg){return reg.test(before)});if(!isLegal)return!1;else{var sep="/";return this._parseJSString(token,idx,sep)}};CSSOM2.CSSValueExpression.prototype._findMatchedIdx=function(token,idx,sep){var startIdx=idx,endIdx,NOT_FOUND=-1;while(!0)if(endIdx=token.indexOf(sep,startIdx+1),endIdx===-1){endIdx=NOT_FOUND;break}else{var text=token.substring(idx+1,endIdx),matched=text.match(/\\+$/);if(!matched||matched[0]%2===0)break;else startIdx=endIdx}var nextNewLineIdx=token.indexOf(`
|
|
27
|
-
`,idx+1);if(nextNewLineIdx<endIdx)endIdx=NOT_FOUND;return endIdx};exports2.CSSValueExpression=CSSOM2.CSSValueExpression});var require_MatcherList=__commonJS(function(exports2){var CSSOM2={};CSSOM2.MatcherList=function(){this.length=0};CSSOM2.MatcherList.prototype={constructor:CSSOM2.MatcherList,get matcherText(){return Array.prototype.join.call(this,", ")},set matcherText(value){var values=value.split(","),length=this.length=values.length;for(var i=0;i<length;i++)this[i]=values[i].trim()},appendMatcher:function(matcher){if(Array.prototype.indexOf.call(this,matcher)===-1)this[this.length]=matcher,this.length++},deleteMatcher:function(matcher){var index=Array.prototype.indexOf.call(this,matcher);if(index!==-1)Array.prototype.splice.call(this,index,1)}};exports2.MatcherList=CSSOM2.MatcherList});var require_CSSDocumentRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,MatcherList:require_MatcherList().MatcherList};CSSOM2.CSSDocumentRule=function(){CSSOM2.CSSRule.call(this),this.matcher=new CSSOM2.MatcherList,this.cssRules=new CSSOM2.CSSRuleList};CSSOM2.CSSDocumentRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSDocumentRule.prototype.constructor=CSSOM2.CSSDocumentRule;Object.setPrototypeOf(CSSOM2.CSSDocumentRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSDocumentRule.prototype,"type",{value:10,writable:!1});Object.defineProperty(CSSOM2.CSSDocumentRule.prototype,"cssText",{get:function(){var cssTexts=[];for(var i=0,length=this.cssRules.length;i<length;i++)cssTexts.push(this.cssRules[i].cssText);return"@-moz-document "+this.matcher.matcherText+" {"+(cssTexts.length?`
|
|
28
|
-
`+cssTexts.join(`
|
|
29
|
-
`):"")+`
|
|
30
|
-
}`}});exports2.CSSDocumentRule=CSSOM2.CSSDocumentRule});var require_CSSScopeRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSScopeRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__start=null,this.__end=null};CSSOM2.CSSScopeRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSScopeRule.prototype.constructor=CSSOM2.CSSScopeRule;Object.setPrototypeOf(CSSOM2.CSSScopeRule,CSSOM2.CSSGroupingRule);Object.defineProperties(CSSOM2.CSSScopeRule.prototype,{type:{value:0,writable:!1},cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
31
|
-
`));return values=valuesArr.join(`
|
|
32
|
-
`)+`
|
|
33
|
-
}`,"@scope"+(this.start?" ("+this.start+")":"")+(this.end?" to ("+this.end+")":"")+values},configurable:!0,enumerable:!0},start:{get:function(){return this.__start}},end:{get:function(){return this.__end}}});exports2.CSSScopeRule=CSSOM2.CSSScopeRule});var require_CSSLayerBlockRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSLayerBlockRule=function(){CSSOM2.CSSGroupingRule.call(this),this.name=""};CSSOM2.CSSLayerBlockRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSLayerBlockRule.prototype.constructor=CSSOM2.CSSLayerBlockRule;Object.setPrototypeOf(CSSOM2.CSSLayerBlockRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSLayerBlockRule.prototype,"type",{value:18,writable:!1});Object.defineProperties(CSSOM2.CSSLayerBlockRule.prototype,{cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
34
|
-
`));return values=valuesArr.join(`
|
|
35
|
-
`)+`
|
|
36
|
-
}`,"@layer"+(this.name?" "+this.name:"")+values}}});exports2.CSSLayerBlockRule=CSSOM2.CSSLayerBlockRule});var require_CSSLayerStatementRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule};CSSOM2.CSSLayerStatementRule=function(){CSSOM2.CSSRule.call(this),this.nameList=[]};CSSOM2.CSSLayerStatementRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSLayerStatementRule.prototype.constructor=CSSOM2.CSSLayerStatementRule;Object.setPrototypeOf(CSSOM2.CSSLayerStatementRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSLayerStatementRule.prototype,"type",{value:0,writable:!1});Object.defineProperties(CSSOM2.CSSLayerStatementRule.prototype,{cssText:{get:function(){return"@layer "+this.nameList.join(", ")+";"}}});exports2.CSSLayerStatementRule=CSSOM2.CSSLayerStatementRule});var require_CSSPageRule=__commonJS(function(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule},regexPatterns=require_regexPatterns().regexPatterns;try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSPageRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSPageRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSPageRule.prototype.constructor=CSSOM2.CSSPageRule;Object.setPrototypeOf(CSSOM2.CSSPageRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSPageRule.prototype,"type",{value:6,writable:!1});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"selectorText",{get:function(){return this.__selectorText},set:function(value){if(typeof value==="string"){var trimmedValue=value.trim();if(trimmedValue===""){this.__selectorText="";return}var{atPageRuleSelectorRegExp,cssCustomIdentifierRegExp}=regexPatterns,match=trimmedValue.match(atPageRuleSelectorRegExp);if(match){var pageName=match[1]||"",pseudoPages=match[2]||"";if(pageName){if(!cssCustomIdentifierRegExp.test(pageName))return}if(pseudoPages){var pseudos=pseudoPages.split(":").filter(function(p){return p}),validPseudos=["left","right","first","blank"],allValid=!0;for(var j=0;j<pseudos.length;j++)if(validPseudos.indexOf(pseudos[j].toLowerCase())===-1){allValid=!1;break}if(!allValid)return}this.__selectorText=pageName+pseudoPages.toLowerCase()}}}});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"cssText",{get:function(){var values="";if(this.cssRules.length){var valuesArr=[" {"];this.style.cssText&&valuesArr.push(this.style.cssText),valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
37
|
-
`)),values=valuesArr.join(`
|
|
38
|
-
`)+`
|
|
39
|
-
}`}else values=" {"+(this.style.cssText?" "+this.style.cssText:"")+" }";return"@page"+(this.selectorText?" "+this.selectorText:"")+values}});exports2.CSSPageRule=CSSOM2.CSSPageRule});var require_cssstyleTryCatchBlock=__commonJS(function(){try{CSSOM.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}});var require_parse=__commonJS(function(exports2){var CSSOM2={},regexPatterns=require_regexPatterns().regexPatterns;CSSOM2.parse=function(token,opts,errorHandler){errorHandler=errorHandler===!0?console&&console.error:errorHandler;var i=0,state="before-selector",index,buffer="",valueParenthesisDepth=0,hasUnmatchedQuoteInSelector=!1,SIGNIFICANT_WHITESPACE={name:!0,"before-name":!0,selector:!0,value:!0,"value-parenthesis":!0,atRule:!0,"importRule-begin":!0,importRule:!0,"namespaceRule-begin":!0,namespaceRule:!0,atBlock:!0,containerBlock:!0,conditionBlock:!0,counterStyleBlock:!0,propertyBlock:!0,"documentRule-begin":!0,scopeBlock:!0,layerBlock:!0,pageBlock:!0},styleSheet;if(opts&&opts.styleSheet)styleSheet=opts.styleSheet;else{if(opts&&opts.globalObject&&opts.globalObject.CSSStyleSheet)styleSheet=new opts.globalObject.CSSStyleSheet;else styleSheet=new CSSOM2.CSSStyleSheet;styleSheet.__constructed=!1}var topScope;if(opts&&opts.cssRules)topScope={cssRules:opts.cssRules};else topScope=styleSheet;if(opts&&opts.ownerNode){styleSheet.__ownerNode=opts.ownerNode;var ownerNodeMedia=opts.ownerNode.media||opts.ownerNode.getAttribute&&opts.ownerNode.getAttribute("media");if(ownerNodeMedia)styleSheet.media.mediaText=ownerNodeMedia;var ownerNodeTitle=opts.ownerNode.title||opts.ownerNode.getAttribute&&opts.ownerNode.getAttribute("title");if(ownerNodeTitle)styleSheet.__title=ownerNodeTitle}if(opts&&opts.ownerRule)styleSheet.__ownerRule=opts.ownerRule;var currentScope=topScope,parentRule,ancestorRules=[],prevScope,name,priority="",styleRule,mediaRule,containerRule,counterStyleRule,propertyRule,supportsRule,importRule,fontFaceRule,keyframesRule,documentRule,hostRule,startingStyleRule,scopeRule,pageRule,layerBlockRule,layerStatementRule,nestedSelectorRule,namespaceRule,definedNamespacePrefixes={},ruleIdCounter=0,addedToParent={},addedToTopScope={},addedToCurrentScope={};function getRuleId(rule){if(!rule.__parseId)rule.__parseId=++ruleIdCounter;return rule.__parseId}var lastValidationBoundary=0,validationRegexCache={};function getValidationRegex(atRuleKey){if(!validationRegexCache[atRuleKey]){var sourceRuleRegExp=atRuleKey==="@import"?forwardImportRuleValidationRegExp:forwardRuleValidationRegExp;validationRegexCache[atRuleKey]=new RegExp(atRuleKey+sourceRuleRegExp.source,sourceRuleRegExp.flags)}return validationRegexCache[atRuleKey]}var{atKeyframesRegExp,beforeRulePortionRegExp,beforeRuleValidationRegExp,forwardRuleValidationRegExp,forwardImportRuleValidationRegExp}=regexPatterns,regexBefore=new RegExp(beforeRulePortionRegExp.source,beforeRulePortionRegExp.flags),{forwardRuleClosingBraceRegExp,forwardRuleSemicolonAndOpeningBraceRegExp,cssCustomIdentifierRegExp,startsWithCombinatorRegExp,atPageRuleSelectorRegExp,startsWithHexEscapeRegExp,identStartCharRegExp,identCharRegExp,specialCharsNeedEscapeRegExp,combinatorOrSeparatorRegExp,afterHexEscapeSeparatorRegExp,trailingSpaceSeparatorRegExp,endsWithHexEscapeRegExp,attributeSelectorContentRegExp,pseudoElementRegExp,invalidCombinatorLtGtRegExp,invalidCombinatorDoubleGtRegExp,consecutiveCombinatorsRegExp,invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp,invalidNestingPattern,emptyPseudoClassRegExp,whitespaceNormalizationRegExp,newlineRemovalRegExp,whitespaceAndDotRegExp,declarationOrOpenBraceRegExp,ampersandRegExp,hexEscapeSequenceRegExp,attributeCaseFlagRegExp,prependedAmpersandRegExp,openBraceGlobalRegExp,closeBraceGlobalRegExp,scopePreludeSplitRegExp,leadingWhitespaceRegExp,doubleQuoteRegExp,backslashRegExp,invalidMediaOperatorWithoutSpaceRegExp,invalidMediaNotAfterOperatorRegExp,invalidMediaNotIdentifierRegExp,invalidMediaNotAfterFeatureRegExp,invalidMediaOperatorBetweenParensRegExp,invalidMediaNotWithMediaTypeRegExp,mediaFeatureColonRegExp,identifierBeforeParenRegExp,mediaAndOperatorRegExp,mediaOrOperatorRegExp,mediaNotOperatorStartRegExp,mediaNotOperatorRegExp}=regexPatterns;function atRulesStatemenRegExpES5Alternative(ruleSlice){for(var i=0;i<ruleSlice.length;i++){var char=ruleSlice[i];if(char===";"||char==="}"){var sliceBefore=ruleSlice.substring(0,i),openBraceIndex=sliceBefore.indexOf("{");if(openBraceIndex===-1){var match=char,j=i+1;while(j<ruleSlice.length&&/\s/.test(ruleSlice[j]))match+=ruleSlice[j],j++;var matchObj=[match];return matchObj.index=i,matchObj.input=ruleSlice,matchObj}}}return null}function matchBalancedBlock(str,fromIndex){fromIndex=fromIndex||0;var openIndex=str.indexOf("{",fromIndex);if(openIndex===-1)return null;var depth=0;for(var i=openIndex;i<str.length;i++)if(str[i]==="{")depth++;else if(str[i]==="}"){if(depth--,depth===0){var matchedString=str.slice(openIndex,i+1);return{0:matchedString,index:openIndex,input:str}}}return null}function ignoreBalancedBlock(i,str,fromIndex){var ruleClosingMatch=matchBalancedBlock(str,fromIndex);if(ruleClosingMatch){var ignoreRange=ruleClosingMatch.index+ruleClosingMatch[0].length;if(i+=ignoreRange,token.charAt(i)==="}")i-=1}else i+=str.length;return i}function parseScopePrelude(preludeContent){var parts=preludeContent.split(scopePreludeSplitRegExp);if(parts.length===2)parts[0]=parts[0]+")",parts[1]="("+parts[1];var hasStart=parts[0]&&parts[0].charAt(0)==="("&&parts[0].charAt(parts[0].length-1)===")",hasEnd=parts[1]&&parts[1].charAt(0)==="("&&parts[1].charAt(parts[1].length-1)===")",hasOnlyEnd=!hasStart&&!hasEnd&&parts[0].indexOf("to (")===0&&parts[0].charAt(parts[0].length-1)===")",startSelector="",endSelector="";if(hasStart)startSelector=parts[0].slice(1,-1).trim();if(hasEnd)endSelector=parts[1].slice(1,-1).trim();if(hasOnlyEnd)endSelector=parts[0].slice(4,-1).trim();return{startSelector,endSelector,hasStart,hasEnd,hasOnlyEnd}}function hasPseudoElement(selector){return pseudoElementRegExp.test(selector)}function validateBalancedSyntax(selector,trackAttributes,useStack){var parenDepth=0,bracketDepth=0,inSingleQuote=!1,inDoubleQuote=!1,inAttr=!1,stack=useStack?[]:null;for(var i=0;i<selector.length;i++){var char=selector[i];if(char==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(inSingleQuote){if(char==="'")inSingleQuote=!1}else if(inDoubleQuote){if(char==='"')inDoubleQuote=!1}else if(trackAttributes&&inAttr){if(char==="]")inAttr=!1;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0}else if(trackAttributes&&char==="[")inAttr=!0;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0;else if(char==="(")if(useStack)stack.push("(");else parenDepth++;else if(char===")"){if(useStack){if(!stack.length||stack.pop()!=="(")return!1}else if(parenDepth--,parenDepth<0)return!1}else if(char==="[")bracketDepth++;else if(char==="]"){if(bracketDepth--,bracketDepth<0)return!1}}if(useStack)return stack.length===0&&bracketDepth===0&&!inSingleQuote&&!inDoubleQuote&&!inAttr;else return parenDepth===0&&bracketDepth===0&&!inSingleQuote&&!inDoubleQuote}function hasBasicSyntaxError(selector){return!validateBalancedSyntax(selector,!1,!1)}function hasInvalidCombinators(selector){if(invalidCombinatorLtGtRegExp.test(selector))return!0;if(invalidCombinatorDoubleGtRegExp.test(selector))return!0;if(consecutiveCombinatorsRegExp.test(selector))return!0;return!1}function hasInvalidPseudoSyntax(selector){var invalidPatterns=[invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp];for(var i=0;i<invalidPatterns.length;i++)if(invalidPatterns[i].test(selector))return!0;return!1}function hasInvalidNestingSelector(selector){return invalidNestingPattern.test(selector)}function canAtRuleBeNested(){if(currentScope===topScope)return!0;var hasStyleRuleInChain=!1,hasValidParent=!1;if(currentScope.constructor.name==="CSSStyleRule")hasStyleRuleInChain=!0;else if(currentScope instanceof CSSOM2.CSSScopeRule||currentScope instanceof CSSOM2.CSSConditionRule)hasValidParent=!0;if(!hasStyleRuleInChain)for(var j=0;j<ancestorRules.length;j++){if(ancestorRules[j].constructor.name==="CSSStyleRule"){hasStyleRuleInChain=!0;break}if(ancestorRules[j]instanceof CSSOM2.CSSScopeRule||ancestorRules[j]instanceof CSSOM2.CSSConditionRule)hasValidParent=!0}return hasValidParent&&!hasStyleRuleInChain}function validateAtRule(atRuleKey,validCallback,cannotBeNested){var isValid=!1,ruleRegExp=getValidationRegex(atRuleKey),lookAheadLength=Math.min(100,token.length-i),ruleSlice=token.slice(i,i+lookAheadLength),shouldPerformCheck=cannotBeNested&¤tScope!==topScope?!1:!0;if(shouldPerformCheck&&ruleSlice.search(ruleRegExp)===0){var searchStart=Math.max(0,lastValidationBoundary),beforeSlice=token.slice(searchStart,i),matches=beforeSlice.match(regexBefore),lastI=matches?searchStart+beforeSlice.lastIndexOf(matches[matches.length-1]):searchStart,toCheckSlice=token.slice(lastI,i),checkedSlice=toCheckSlice.search(beforeRuleValidationRegExp);if(checkedSlice===0)isValid=!0,lastValidationBoundary=lastI}if(isValid&&atRuleKey==="@scope"){var openBraceIndex=ruleSlice.indexOf("{");if(openBraceIndex!==-1){var rulePrelude=ruleSlice.slice(0,openBraceIndex).trim(),preludeContent=rulePrelude.slice(6).trim();if(preludeContent.length>0){var parsedScopePrelude=parseScopePrelude(preludeContent),{startSelector,endSelector,hasStart,hasEnd,hasOnlyEnd}=parsedScopePrelude;if(hasStart&&startSelector===""||hasEnd&&endSelector===""||hasOnlyEnd&&endSelector==="")isValid=!1;else if(startSelector&&hasPseudoElement(startSelector)||endSelector&&hasPseudoElement(endSelector))isValid=!1;else if(startSelector&&hasBasicSyntaxError(startSelector)||endSelector&&hasBasicSyntaxError(endSelector))isValid=!1;else if(startSelector&&hasInvalidCombinators(startSelector)||endSelector&&hasInvalidCombinators(endSelector))isValid=!1;else if(startSelector&&hasInvalidPseudoSyntax(startSelector)||endSelector&&hasInvalidPseudoSyntax(endSelector))isValid=!1;else if(!hasStart&&!hasOnlyEnd)isValid=!1}}}if(isValid&&atRuleKey==="@page"){var openBraceIndex=ruleSlice.indexOf("{");if(openBraceIndex!==-1){var rulePrelude=ruleSlice.slice(0,openBraceIndex).trim(),preludeContent=rulePrelude.slice(5).trim();if(preludeContent.length>0){var trimmedValue=preludeContent.trim();if(trimmedValue!==""){var match=trimmedValue.match(atPageRuleSelectorRegExp);if(match){var pageName=match[1]||"",pseudoPages=match[2]||"";if(pageName){if(!cssCustomIdentifierRegExp.test(pageName))isValid=!1}if(pseudoPages){var pseudos=pseudoPages.split(":").filter(function(p){return p}),validPseudos=["left","right","first","blank"],allValid=!0;for(var j=0;j<pseudos.length;j++)if(validPseudos.indexOf(pseudos[j].toLowerCase())===-1){allValid=!1;break}if(!allValid)isValid=!1}}else isValid=!1}}}}if(!isValid){var ruleStatementMatch=atRulesStatemenRegExpES5Alternative(ruleSlice);if(ruleStatementMatch&¤tScope!==topScope){var ignoreEnd=ruleStatementMatch[0].indexOf(";");i+=ruleStatementMatch.index+ignoreEnd;return}if(atRuleKey==="@layer"){var ruleSemicolonAndOpeningBraceMatch=ruleSlice.match(forwardRuleSemicolonAndOpeningBraceRegExp);if(ruleSemicolonAndOpeningBraceMatch&&ruleSemicolonAndOpeningBraceMatch[1]===";"){i+=ruleSemicolonAndOpeningBraceMatch.index+ruleSemicolonAndOpeningBraceMatch[0].length,state="before-selector";return}}i=ignoreBalancedBlock(i,ruleSlice),state="before-selector"}else validCallback.call(this)}function isIdentStart(c){return/[a-zA-Z_\u00A0-\uFFFF]/.test(c)}function isIdentChar(c){return/[a-zA-Z0-9_\u00A0-\uFFFF\-]/.test(c)}function looseSelectorValidator(selector){if(!selector||selector.length===0)return!1;var i=0,len=selector.length,hasMatchedComponent=!1;function skipEscape(){if(i<len&&selector[i]==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0)return i+=escapeLen,!0}return!1}function parseIdentifier(){var start=i;while(i<len)if(skipEscape())continue;else if(isIdentChar(selector[i]))i++;else break;return i>start}function parseNamespace(){var start=i;if(i<len&&selector[i]==="*")i++;else if(i<len&&(isIdentStart(selector[i])||selector[i]==="\\"))parseIdentifier();if(i<len&&selector[i]==="|")return i++,!0;return i=start,!1}function parsePseudoArgs(){if(i>=len||selector[i]!=="(")return!1;i++;var depth=1,inString=!1,stringChar="";while(i<len&&depth>0){var c=selector[i];if(c==="\\"&&i+1<len)i+=2;else if(!inString&&(c==='"'||c==="'"))inString=!0,stringChar=c,i++;else if(inString&&c===stringChar)inString=!1,i++;else if(!inString&&c==="(")depth++,i++;else if(!inString&&c===")")depth--,i++;else i++}return depth===0}while(i<len){var matched=!1,start=i;while(i<len&&/\s/.test(selector[i]))i++;if(i>start){hasMatchedComponent=!0;continue}if(i<len&&/[>+~]/.test(selector[i])){i++,hasMatchedComponent=!0;while(i<len&&/\s/.test(selector[i]))i++;continue}if(i<len&&selector[i]==="&")i++,hasMatchedComponent=!0,matched=!0;else if(i<len&&selector[i]==="."){if(i++,parseIdentifier())hasMatchedComponent=!0,matched=!0}else if(i<len&&selector[i]==="#"){if(i++,parseIdentifier())hasMatchedComponent=!0,matched=!0}else if(i<len&&selector[i]===":"){if(i++,i<len&&selector[i]===":")i++;if(parseIdentifier())parsePseudoArgs(),hasMatchedComponent=!0,matched=!0}else if(i<len&&selector[i]==="["){i++;var depth=1;while(i<len&&depth>0)if(selector[i]==="\\")i+=2;else if(selector[i]==="'"){i++;while(i<len&&selector[i]!=="'")if(selector[i]==="\\")i+=2;else i++;if(i<len)i++}else if(selector[i]==='"'){i++;while(i<len&&selector[i]!=='"')if(selector[i]==="\\")i+=2;else i++;if(i<len)i++}else if(selector[i]==="[")depth++,i++;else if(selector[i]==="]")depth--,i++;else i++;if(depth===0)hasMatchedComponent=!0,matched=!0}else if(i<len&&(isIdentStart(selector[i])||selector[i]==="\\"||selector[i]==="*"||selector[i]==="|"||selector[i]==="-")){if(parseNamespace(),i<len&&selector[i]==="*")i++,hasMatchedComponent=!0,matched=!0;else if(i<len&&(isIdentStart(selector[i])||selector[i]==="\\"||selector[i]==="-")){if(parseIdentifier())hasMatchedComponent=!0,matched=!0}}if(!matched&&i===start)return!1}return hasMatchedComponent}function basicSelectorValidator(selector){if(selector.length>1e4)return!1;if(!validateBalancedSyntax(selector,!0,!0))return!1;if(hasInvalidCombinators(selector))return!1;if(hasInvalidPseudoSyntax(selector))return!1;if(hasInvalidNestingSelector(selector))return!1;var noQuotesPseudos=["lang","dir","nth-child","nth-last-child","nth-of-type","nth-last-of-type"];for(var idx=0;idx<selector.length;idx++)if(selector[idx]===":"){var pseudoStart=idx;if(idx++,idx<selector.length&&selector[idx]===":")idx++;var nameStart=idx;while(idx<selector.length&&/[a-zA-Z0-9\-]/.test(selector[idx]))idx++;if(idx===nameStart)continue;var pseudoName=selector.substring(nameStart,idx).toLowerCase();if(idx<selector.length&&selector[idx]==="("){idx++;var contentStart=idx,depth=1;while(idx<selector.length&&depth>0)if(selector[idx]==="\\")idx+=2;else if(selector[idx]==="(")depth++,idx++;else if(selector[idx]===")")depth--,idx++;else idx++;if(depth===0){var pseudoContent=selector.substring(contentStart,idx-1);for(var j=0;j<noQuotesPseudos.length;j++)if(pseudoName===noQuotesPseudos[j]&&/['"]/.test(pseudoContent))return!1}}}return looseSelectorValidator(selector)}function extractPseudoClasses(selector){var matches=[];for(var i=0;i<selector.length;i++)if(selector[i]===":"){var pseudoStart=i;if(i++,i<selector.length&&selector[i]===":")i++;var nameStart=i;while(i<selector.length&&/[a-zA-Z\-]/.test(selector[i]))i++;if(i===nameStart)continue;var pseudoName=selector.substring(nameStart,i);if(i<selector.length&&selector[i]==="("){i++;var argsStart=i,depth=1,inSingleQuote=!1,inDoubleQuote=!1;while(i<selector.length&&depth>0){var ch=selector[i];if(ch==="\\")i+=2;else if(ch==="'"&&!inDoubleQuote)inSingleQuote=!inSingleQuote,i++;else if(ch==='"'&&!inSingleQuote)inDoubleQuote=!inDoubleQuote,i++;else if(ch==="("&&!inSingleQuote&&!inDoubleQuote)depth++,i++;else if(ch===")"&&!inSingleQuote&&!inDoubleQuote)depth--,i++;else i++}if(depth===0){var pseudoArgs=selector.substring(argsStart,i-1),fullMatch=selector.substring(pseudoStart,i);matches.push([fullMatch,pseudoName,pseudoArgs,pseudoStart])}i--}}return matches}function parseAndSplitNestedSelectors(selector){var depth=0,buffer="",parts=[],inSingleQuote=!1,inDoubleQuote=!1,i,char;for(i=0;i<selector.length;i++){if(char=selector.charAt(i),char==="\\"&&i+1<selector.length){buffer+=char,i++,buffer+=selector.charAt(i);continue}if(char==="'"&&!inDoubleQuote)inSingleQuote=!inSingleQuote,buffer+=char;else if(char==='"'&&!inSingleQuote)inDoubleQuote=!inDoubleQuote,buffer+=char;else if(!inSingleQuote&&!inDoubleQuote)if(char==="(")depth++,buffer+=char;else if(char===")")depth--,buffer+=char;else if(char===","&&depth===0){if(buffer.trim())parts.push(buffer.trim());buffer=""}else buffer+=char;else buffer+=char}var trimmed=buffer.trim();if(trimmed){var endsWithHexEscape=endsWithHexEscapeRegExp.test(buffer);parts.push(endsWithHexEscape?buffer.replace(leadingWhitespaceRegExp,""):trimmed)}return parts}var validatedSelectorsCache={},selectorListPseudoClasses={not:!0,is:!0,has:!0,where:!0};function validateSelector(selector){if(validatedSelectorsCache.hasOwnProperty(selector))return validatedSelectorsCache[selector];var pseudoClassMatches=extractPseudoClasses(selector);for(var j=0;j<pseudoClassMatches.length;j++){var pseudoClass=pseudoClassMatches[j][1];if(selectorListPseudoClasses.hasOwnProperty(pseudoClass)){var nestedSelectors=parseAndSplitNestedSelectors(pseudoClassMatches[j][2]),hasAmpersand=!1;for(var k=0;k<nestedSelectors.length;k++)if(ampersandRegExp.test(nestedSelectors[k])){hasAmpersand=!0;break}if(hasAmpersand)continue;for(var i=0;i<nestedSelectors.length;i++){var nestedSelector=nestedSelectors[i];if(!validatedSelectorsCache.hasOwnProperty(nestedSelector)){var nestedSelectorValidation=validateSelector(nestedSelector);if(validatedSelectorsCache[nestedSelector]=nestedSelectorValidation,!nestedSelectorValidation)return validatedSelectorsCache[selector]=!1,!1}else if(!validatedSelectorsCache[nestedSelector])return validatedSelectorsCache[selector]=!1,!1}}}var basicSelectorValidation=basicSelectorValidator(selector);return validatedSelectorsCache[selector]=basicSelectorValidation,basicSelectorValidation}function validateNamespaceSelector(selector){var pipeIndex=-1,inAttr=!1,inSingleQuote=!1,inDoubleQuote=!1;for(var i=0;i<selector.length;i++){var char=selector[i];if(char==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(inSingleQuote){if(char==="'")inSingleQuote=!1}else if(inDoubleQuote){if(char==='"')inDoubleQuote=!1}else if(inAttr){if(char==="]")inAttr=!1;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0}else if(char==="[")inAttr=!0;else if(char==="|"&&!inAttr){pipeIndex=i;break}}if(pipeIndex===-1)return!0;var namespacePrefix=selector.substring(0,pipeIndex);if(namespacePrefix==="*"||namespacePrefix==="")return!0;return definedNamespacePrefixes.hasOwnProperty(namespacePrefix)}function normalizeSelectorEscapes(selector){var result="",i=0,nextChar="",inIdentifier=!1,inAttribute=!1,attributeDepth=0,needsEscapeForIdent=!1,lastWasHexEscape=!1;while(i<selector.length){var char=selector[i];if(char==="["&&!inAttribute){inAttribute=!0,attributeDepth=1,result+=char,i++,needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1;continue}if(inAttribute){if(char==="[")attributeDepth++;if(char==="]"){if(attributeDepth--,attributeDepth===0)inAttribute=!1}if(char==="\\"&&i+1<selector.length){var escapeLen=getEscapeSequenceLength(selector,i);result+=selector.substr(i,escapeLen),i+=escapeLen}else result+=char,i++;lastWasHexEscape=!1;continue}if(char==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0){var escapeSeq=selector.substr(i,escapeLen),decoded=decodeEscapeSequence(escapeSeq),wasHexEscape=startsWithHexEscapeRegExp.test(escapeSeq),hadTerminatingSpace=wasHexEscape&&escapeSeq[escapeLen-1]===" ";nextChar=selector[i+escapeLen]||"";var needsEscape=!1,useHexEscape=!1;if(needsEscapeForIdent){if(isDigit(decoded))needsEscape=!0,useHexEscape=!0;else if(decoded==="-"){var remainingSelector=selector.substring(i+escapeLen),hasMoreIdentChars=remainingSelector&&identCharRegExp.test(remainingSelector[0]);needsEscape=!hasMoreIdentChars}else if(!identStartCharRegExp.test(decoded))needsEscape=!0}else if(specialCharsNeedEscapeRegExp.test(decoded))needsEscape=!0;if(needsEscape)if(useHexEscape){var codePoint=decoded.charCodeAt(0),hex=codePoint.toString(16);if(result+="\\"+hex,isHexDigit(nextChar)||!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar))result+=" ",lastWasHexEscape=!1;else lastWasHexEscape=!0}else result+="\\"+decoded,lastWasHexEscape=!1;else{if(lastWasHexEscape&&!hadTerminatingSpace&&isAlphanumeric(decoded))result+=" ";if(result+=decoded,hadTerminatingSpace&&(!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar)))result+=" ";lastWasHexEscape=!1}i+=escapeLen,needsEscapeForIdent=needsEscapeForIdent&&decoded==="-",inIdentifier=!0;continue}}if(char==="."||char==="#")result+=char,needsEscapeForIdent=!0,inIdentifier=!1,lastWasHexEscape=!1,i++;else if(char==="-"&&needsEscapeForIdent)result+=char,needsEscapeForIdent=!0,lastWasHexEscape=!1,i++;else if(isDigit(char)&&needsEscapeForIdent){var codePoint=char.charCodeAt(0),hex=codePoint.toString(16);if(result+="\\"+hex,nextChar=selector[i+1]||"",isHexDigit(nextChar)||!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar))result+=" ",lastWasHexEscape=!1;else lastWasHexEscape=!0;needsEscapeForIdent=!1,inIdentifier=!0,i++}else if(char===":"||combinatorOrSeparatorRegExp.test(char)){if(!(char===" "&&lastWasHexEscape&&result[result.length-1]===" "))result+=char;needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1,i++}else if(isLetter(char)&&lastWasHexEscape)result+=" "+char,needsEscapeForIdent=!1,inIdentifier=!0,lastWasHexEscape=!1,i++;else if(char===" "&&lastWasHexEscape){if(nextChar=selector[i+1]||"",!nextChar||trailingSpaceSeparatorRegExp.test(nextChar))result+=char;needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1,i++}else result+=char,needsEscapeForIdent=!1,inIdentifier=!0,lastWasHexEscape=!1,i++}return result}function decodeEscapeSequencesInString(str){var result="";for(var i=0;i<str.length;i++){if(str[i]==="\\"&&i+1<str.length){var escapeLen=getEscapeSequenceLength(str,i);if(escapeLen>0){var escapeSeq=str.substr(i,escapeLen),decoded=decodeEscapeSequence(escapeSeq);result+=decoded,i+=escapeLen-1;continue}}result+=str[i]}return result}function decodeEscapeSequence(escapeSeq){if(escapeSeq.length<2||escapeSeq[0]!=="\\")return escapeSeq;var content=escapeSeq.substring(1),hexMatch=content.match(hexEscapeSequenceRegExp);if(hexMatch){var codePoint=parseInt(hexMatch[1],16);if(codePoint>65535){codePoint-=65536;var high=55296+(codePoint>>10),low=56320+(codePoint&1023);return String.fromCharCode(high,low)}return String.fromCharCode(codePoint)}return content[0]||""}function normalizeAttributeSelectors(selector){var result="",i=0;while(i<selector.length)if(selector[i]==="["){result+="[",i++;var attrContent="",depth=1;while(i<selector.length&&depth>0){if(selector[i]==="\\"&&i+1<selector.length){attrContent+=selector.substring(i,i+2),i+=2;continue}if(selector[i]==="[")depth++;if(selector[i]==="]"){if(depth--,depth===0)break}attrContent+=selector[i],i++}var normalized2=normalizeAttributeContent(attrContent);if(normalized2===null)return null;if(result+=normalized2,i<selector.length&&selector[i]==="]")result+="]",i++}else result+=selector[i],i++;return result}function processQuotedAttributeValue(trimmedValue,quoteChar,attrName,operator,flag){if(trimmedValue.length<2)return null;var i=1,foundClose=!1;while(i<trimmedValue.length){if(trimmedValue[i]==="\\"&&i+1<trimmedValue.length){var escapeLen=getEscapeSequenceLength(trimmedValue,i);i+=escapeLen;continue}if(trimmedValue[i]===quoteChar){foundClose=i===trimmedValue.length-1;break}i++}if(!foundClose)return null;var innerValue=trimmedValue.slice(1,-1),decodedValue=decodeEscapeSequencesInString(innerValue),escapedValue=decodedValue.replace(doubleQuoteRegExp,"\\\"");return attrName+operator+'"'+escapedValue+'"'+(flag?" "+flag:"")}function normalizeAttributeContent(content){var match=content.match(attributeSelectorContentRegExp);if(!match)return content;var attrName=match[1],operator=match[2],valueAndFlag=match[3].trim(),flagMatch=valueAndFlag.match(attributeCaseFlagRegExp),value=flagMatch?flagMatch[1]:valueAndFlag,flag=flagMatch?flagMatch[2]:"",trimmedValue=value.trim(),firstChar=trimmedValue[0];if(firstChar==='"')return processQuotedAttributeValue(trimmedValue,'"',attrName,operator,flag);if(firstChar==="'")return processQuotedAttributeValue(trimmedValue,"'",attrName,operator,flag);var hasUnescapedSpecialChar=!1;for(var i=0;i<trimmedValue.length;i++){var char=trimmedValue[i];if(char==="\\"&&i+1<trimmedValue.length){var escapeLen=getEscapeSequenceLength(trimmedValue,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(specialCharsNeedEscapeRegExp.test(char)){hasUnescapedSpecialChar=!0;break}}if(hasUnescapedSpecialChar)return null;var decodedValue=decodeEscapeSequencesInString(trimmedValue),escapedValue=decodedValue.replace(backslashRegExp,"\\\\").replace(doubleQuoteRegExp,"\\\"");return attrName+operator+'"'+escapedValue+'"'+(flag?" "+flag:"")}function processSelectorText(selectorText){var normalized2=selectorText.replace(whitespaceNormalizationRegExp,function(match,_,newline){if(newline)return" ";return match});if(normalized2=normalizeSelectorEscapes(normalized2),normalized2=normalizeAttributeSelectors(normalized2),normalized2===null)return"";return processNestedPseudoClasses(normalized2)}function processNestedPseudoClasses(selectorText,depth){if(typeof depth>"u")depth=0;if(depth>10)return selectorText;var pseudoClassMatches=extractPseudoClasses(selectorText);if(pseudoClassMatches.length===0)return selectorText;var result=selectorText;for(var j=pseudoClassMatches.length-1;j>=0;j--){var pseudoClass=pseudoClassMatches[j][1];if(selectorListPseudoClasses.hasOwnProperty(pseudoClass)){var fullMatch=pseudoClassMatches[j][0],pseudoArgs=pseudoClassMatches[j][2],matchStart=pseudoClassMatches[j][3],nestedSelectorsRaw=parseAndSplitNestedSelectors(pseudoArgs),hasAmpersand=!1;for(var k=0;k<nestedSelectorsRaw.length;k++)if(ampersandRegExp.test(nestedSelectorsRaw[k])){hasAmpersand=!0;break}if(hasAmpersand)continue;var processedArgs=processNestedPseudoClasses(pseudoArgs,depth+1),nestedSelectors=parseAndSplitNestedSelectors(processedArgs),validSelectors=[];for(var i=0;i<nestedSelectors.length;i++){var nestedSelector=nestedSelectors[i];if(basicSelectorValidator(nestedSelector))validSelectors.push(nestedSelector)}var newArgs=validSelectors.join(", "),newPseudoClass=":"+pseudoClass+"("+newArgs+")";result=result.substring(0,matchStart)+newPseudoClass+result.substring(matchStart+fullMatch.length)}}return result}function hasNewlineInQuotedString(selectorText){for(var i=0;i<selectorText.length;i++){var char=selectorText[i];if(char==="'"){i++;while(i<selectorText.length){if(selectorText[i]==="\\"&&i+1<selectorText.length){i+=2;continue}if(selectorText[i]==="'")break;if(selectorText[i]==="\r"||selectorText[i]===`
|
|
40
|
-
`)return!0;i++}}else if(char==='"'){i++;while(i<selectorText.length){if(selectorText[i]==="\\"&&i+1<selectorText.length){i+=2;continue}if(selectorText[i]==='"')break;if(selectorText[i]==="\r"||selectorText[i]===`
|
|
41
|
-
`)return!0;i++}}}return!1}function isValidSelectorText(selectorText){if(!selectorText||selectorText.trim()==="")return!1;if(emptyPseudoClassRegExp.test(selectorText))return!1;if(hasNewlineInQuotedString(selectorText))return!1;var selectors=parseAndSplitNestedSelectors(selectorText);for(var i=0;i<selectors.length;i++){var selector=selectors[i].trim();if(!validateSelector(selector)||!validateNamespaceSelector(selector))return!1}return!0}function pushToAncestorRules(rule){ancestorRules.push(rule)}function parseError(message,isNested){var lines=token.substring(0,i).split(`
|
|
42
|
-
`),lineCount=lines.length,charCount=lines.pop().length+1,error=Error(message+" (line "+lineCount+", char "+charCount+")");error.line=lineCount,error.char=charCount,error.styleSheet=styleSheet,error.isNested=!!isNested;try{throw error}catch(e){errorHandler&&errorHandler(e)}}function handleUnmatchedQuoteInSelector(nextState){var ruleClosingMatch=token.slice(i).match(forwardRuleClosingBraceRegExp);if(ruleClosingMatch)i+=ruleClosingMatch.index+ruleClosingMatch[0].length-1;styleRule=null,buffer="",hasUnmatchedQuoteInSelector=!1,state=nextState}function isSelectorStartChar(char){return".:#&*[\\".indexOf(char)!==-1}function isWhitespaceChar(char){return`
|
|
43
|
-
\r`.indexOf(char)!==-1}function isDigit(char){var code=char.charCodeAt(0);return code>=48&&code<=57}function isHexDigit(char){if(!char)return!1;var code=char.charCodeAt(0);return code>=48&&code<=57||code>=65&&code<=70||code>=97&&code<=102}function isLetter(char){if(!char)return!1;var code=char.charCodeAt(0);return code>=65&&code<=90||code>=97&&code<=122}function isAlphanumeric(char){var code=char.charCodeAt(0);return code>=48&&code<=57||code>=65&&code<=90||code>=97&&code<=122}function getEscapeSequenceLength(str,pos){if(str[pos]!=="\\"||pos+1>=str.length)return 0;var nextChar=str[pos+1];if(isHexDigit(nextChar)){var hexLength=1;while(hexLength<6&&pos+1+hexLength<str.length&&isHexDigit(str[pos+1+hexLength]))hexLength++;if(pos+1+hexLength<str.length&&isWhitespaceChar(str[pos+1+hexLength]))return 1+hexLength+1;return 1+hexLength}return 2}function containsUnescaped(str,char){for(var i=0;i<str.length;i++){if(str[i]==="\\"){var escapeLen=getEscapeSequenceLength(str,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(str[i]===char)return!0}return!1}function isInvalidConditionText(text){return invalidMediaOperatorWithoutSpaceRegExp.test(text)||invalidMediaNotAfterOperatorRegExp.test(text)||invalidMediaNotIdentifierRegExp.test(text)||invalidMediaNotAfterFeatureRegExp.test(text)||invalidMediaOperatorBetweenParensRegExp.test(text)||invalidMediaNotWithMediaTypeRegExp.test(text)}function normalizeConditionText(text){if(isInvalidConditionText(text))return"not all";var result=text;return result=result.replace(mediaFeatureColonRegExp,function(match,openParen,name,spaces,rest){var beforeMatch=result.lastIndexOf(match),beforeParen=beforeMatch>0?result.charAt(beforeMatch-1):"";if(identifierBeforeParenRegExp.test(beforeParen))return match;return openParen+name+": "+rest}),result=result.replace(mediaAndOperatorRegExp," and "),result=result.replace(mediaOrOperatorRegExp," or "),result=result.replace(mediaNotOperatorStartRegExp,"not "),result=result.replace(mediaNotOperatorRegExp," not "),result.trim()}var endingIndex=token.length-1,initialEndingIndex=endingIndex;for(var character;character=token.charAt(i);i++){if(i===endingIndex)switch(state){case"importRule":case"namespaceRule":case"layerBlock":if(character!==";")token+=";",endingIndex+=1;break;case"value":if(character!=="}"){if(character===";")token+="}";else token+=";";endingIndex+=1;break}case"name":case"before-name":if(character==="}")token+=" ";else token+="}";endingIndex+=1;break;case"before-selector":if(character!=="}"&¤tScope!==styleSheet){token+="}",endingIndex+=1;break}}if(character==="\\"&&i+1<token.length){var escapeLen=getEscapeSequenceLength(token,i);if(escapeLen>0){buffer+=token.substr(i,escapeLen),i+=escapeLen-1;continue}}switch(character){case" ":case"\t":case"\r":case`
|
|
44
|
-
`:case"\f":if(SIGNIFICANT_WHITESPACE[state])buffer+=character;break;case'"':index=i+1;do if(index=token.indexOf('"',index)+1,!index){if(parseError('Unmatched "'),state==="selector"||state==="atRule")hasUnmatchedQuoteInSelector=!0}while(token[index-2]==="\\");if(index===0)break;switch(buffer+=token.slice(i,index),i=index-1,state){case"before-value":state="value";break;case"importRule-begin":if(state="importRule",i===endingIndex)token+=";";break;case"namespaceRule-begin":if(state="namespaceRule",i===endingIndex)token+=";";break}break;case"'":index=i+1;do if(index=token.indexOf("'",index)+1,!index){if(parseError("Unmatched '"),state==="selector"||state==="atRule")hasUnmatchedQuoteInSelector=!0}while(token[index-2]==="\\");if(index===0)break;switch(buffer+=token.slice(i,index),i=index-1,state){case"before-value":state="value";break;case"importRule-begin":state="importRule";break;case"namespaceRule-begin":state="namespaceRule";break}break;case"/":if(token.charAt(i+1)==="*")if(i+=2,index=token.indexOf("*/",i),index===-1)i=token.length-1,buffer="";else i=index+1;else buffer+=character;if(state==="importRule-begin")buffer+=" ",state="importRule";if(state==="namespaceRule-begin")buffer+=" ",state="namespaceRule";break;case"@":if(nestedSelectorRule){if(styleRule&&styleRule.constructor.name==="CSSNestedDeclarations")currentScope.cssRules.push(styleRule);if(styleRule!==nestedSelectorRule&&nestedSelectorRule.parentRule&&nestedSelectorRule.parentRule.constructor.name==="CSSStyleRule")styleRule=nestedSelectorRule.parentRule}if(token.indexOf("@-moz-document",i)===i){validateAtRule("@-moz-document",function(){state="documentRule-begin",documentRule=new CSSOM2.CSSDocumentRule,documentRule.__starts=i,i+=13}),buffer="";break}else if(token.indexOf("@media",i)===i){validateAtRule("@media",function(){state="atBlock",mediaRule=new CSSOM2.CSSMediaRule,mediaRule.__starts=i,i+=5}),buffer="";break}else if(token.indexOf("@container",i)===i){validateAtRule("@container",function(){state="containerBlock",containerRule=new CSSOM2.CSSContainerRule,containerRule.__starts=i,i+=9}),buffer="";break}else if(token.indexOf("@counter-style",i)===i){buffer="";var cannotBeNested=!canAtRuleBeNested();validateAtRule("@counter-style",function(){state="counterStyleBlock",counterStyleRule=new CSSOM2.CSSCounterStyleRule,counterStyleRule.__starts=i,i+=13},cannotBeNested);break}else if(token.indexOf("@property",i)===i){buffer="";var cannotBeNested=!canAtRuleBeNested();validateAtRule("@property",function(){state="propertyBlock",propertyRule=new CSSOM2.CSSPropertyRule,propertyRule.__starts=i,i+=8},cannotBeNested);break}else if(token.indexOf("@scope",i)===i){validateAtRule("@scope",function(){state="scopeBlock",scopeRule=new CSSOM2.CSSScopeRule,scopeRule.__starts=i,i+=5}),buffer="";break}else if(token.indexOf("@layer",i)===i){validateAtRule("@layer",function(){state="layerBlock",layerBlockRule=new CSSOM2.CSSLayerBlockRule,layerBlockRule.__starts=i,i+=5}),buffer="";break}else if(token.indexOf("@page",i)===i){validateAtRule("@page",function(){state="pageBlock",pageRule=new CSSOM2.CSSPageRule,pageRule.__starts=i,i+=4}),buffer="";break}else if(token.indexOf("@supports",i)===i){validateAtRule("@supports",function(){state="conditionBlock",supportsRule=new CSSOM2.CSSSupportsRule,supportsRule.__starts=i,i+=8}),buffer="";break}else if(token.indexOf("@host",i)===i){validateAtRule("@host",function(){state="hostRule-begin",i+=4,hostRule=new CSSOM2.CSSHostRule,hostRule.__starts=i}),buffer="";break}else if(token.indexOf("@starting-style",i)===i){validateAtRule("@starting-style",function(){state="startingStyleRule-begin",i+=14,startingStyleRule=new CSSOM2.CSSStartingStyleRule,startingStyleRule.__starts=i}),buffer="";break}else if(token.indexOf("@import",i)===i){buffer="",validateAtRule("@import",function(){state="importRule-begin",i+=6,buffer+="@import"},!0);break}else if(token.indexOf("@namespace",i)===i){buffer="",validateAtRule("@namespace",function(){state="namespaceRule-begin",i+=9,buffer+="@namespace"},!0);break}else if(token.indexOf("@font-face",i)===i){buffer="";var cannotBeNested=!canAtRuleBeNested();validateAtRule("@font-face",function(){state="fontFaceRule-begin",i+=9,fontFaceRule=new CSSOM2.CSSFontFaceRule,fontFaceRule.__starts=i},cannotBeNested);break}else{atKeyframesRegExp.lastIndex=i;var matchKeyframes=atKeyframesRegExp.exec(token);if(matchKeyframes&&matchKeyframes.index===i){state="keyframesRule-begin",keyframesRule=new CSSOM2.CSSKeyframesRule,keyframesRule.__starts=i,keyframesRule._vendorPrefix=matchKeyframes[1],i+=matchKeyframes[0].length-1,buffer="";break}else if(state==="selector")state="atRule"}buffer+=character;break;case"{":if(currentScope===topScope)nestedSelectorRule=null;if(state==="before-selector"){parseError("Unexpected {"),i=ignoreBalancedBlock(i,token.slice(i));break}if(state==="selector"||state==="atRule"){if(!nestedSelectorRule&&containsUnescaped(buffer,";")){var ruleClosingMatch=token.slice(i).match(forwardRuleClosingBraceRegExp);if(ruleClosingMatch){styleRule=null,buffer="",state="before-selector",i+=ruleClosingMatch.index+ruleClosingMatch[0].length;break}}if(!styleRule)styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i;if(hasUnmatchedQuoteInSelector){handleUnmatchedQuoteInSelector("before-selector");break}var originalParentRule=parentRule;if(parentRule)styleRule.__parentRule=parentRule,pushToAncestorRules(parentRule);currentScope=parentRule=styleRule;var processedSelectorText=processSelectorText(buffer.trim());if(originalParentRule&&originalParentRule.constructor.name==="CSSStyleRule")styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).map(function(sel){return sel.indexOf("&")===-1||startsWithCombinatorRegExp.test(sel)?"& "+sel:sel}).join(", ");else styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).join(", ");styleRule.style.__starts=i,styleRule.__parentStyleSheet=styleSheet,buffer="",state="before-name"}else if(state==="atBlock"){if(mediaRule.media.mediaText=normalizeConditionText(buffer.trim()),parentRule){if(mediaRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}if(currentScope=parentRule=mediaRule,pushToAncestorRules(mediaRule),mediaRule.__parentStyleSheet=styleSheet,!styleRule||styleRule.constructor.name!=="CSSStyleRule"||!styleRule.__parentRule)styleRule=null;buffer="",state="before-selector"}else if(state==="containerBlock"){if(containerRule.__conditionText=normalizeConditionText(buffer.trim()),parentRule){if(containerRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=containerRule,pushToAncestorRules(containerRule),containerRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="counterStyleBlock"){var counterStyleName=buffer.trim().replace(newlineRemovalRegExp,""),isValidCounterStyleName=counterStyleName.length>0&&!whitespaceAndDotRegExp.test(counterStyleName);if(isValidCounterStyleName){if(counterStyleRule.name=counterStyleName,parentRule)counterStyleRule.__parentRule=parentRule;counterStyleRule.__parentStyleSheet=styleSheet,styleRule=counterStyleRule}buffer=""}else if(state==="propertyBlock"){var propertyName=buffer.trim().replace(newlineRemovalRegExp,""),isValidPropertyName=propertyName.indexOf("--")===0;if(isValidPropertyName){if(propertyRule.__name=propertyName,parentRule)propertyRule.__parentRule=parentRule;propertyRule.__parentStyleSheet=styleSheet,styleRule=propertyRule}buffer=""}else if(state==="conditionBlock"){if(supportsRule.__conditionText=normalizeConditionText(buffer.trim()),parentRule){if(supportsRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=supportsRule,pushToAncestorRules(supportsRule),supportsRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="scopeBlock"){var parsedScopePrelude=parseScopePrelude(buffer.trim());if(parsedScopePrelude.hasStart)scopeRule.__start=parsedScopePrelude.startSelector;if(parsedScopePrelude.hasEnd)scopeRule.__end=parsedScopePrelude.endSelector;if(parsedScopePrelude.hasOnlyEnd)scopeRule.__end=parsedScopePrelude.endSelector;if(parentRule){if(scopeRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=scopeRule,pushToAncestorRules(scopeRule),scopeRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="layerBlock"){layerBlockRule.name=buffer.trim();var isValidName=layerBlockRule.name.length===0||layerBlockRule.name.match(cssCustomIdentifierRegExp)!==null;if(isValidName){if(parentRule){if(layerBlockRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=layerBlockRule,pushToAncestorRules(layerBlockRule),layerBlockRule.__parentStyleSheet=styleSheet}styleRule=null,buffer="",state="before-selector"}else if(state==="pageBlock"){if(pageRule.selectorText=buffer.trim(),parentRule)pageRule.__parentRule=parentRule,pushToAncestorRules(parentRule);currentScope=parentRule=pageRule,pageRule.__parentStyleSheet=styleSheet,styleRule=pageRule,buffer="",state="before-name"}else if(state==="hostRule-begin"){if(parentRule)pushToAncestorRules(parentRule);currentScope=parentRule=hostRule,pushToAncestorRules(hostRule),hostRule.__parentStyleSheet=styleSheet,buffer="",state="before-selector"}else if(state==="startingStyleRule-begin"){if(parentRule){if(startingStyleRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=startingStyleRule,pushToAncestorRules(startingStyleRule),startingStyleRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="fontFaceRule-begin"){if(parentRule)fontFaceRule.__parentRule=parentRule;fontFaceRule.__parentStyleSheet=styleSheet,styleRule=fontFaceRule,buffer="",state="before-name"}else if(state==="keyframesRule-begin"){if(keyframesRule.name=buffer.trim(),parentRule)pushToAncestorRules(parentRule),keyframesRule.__parentRule=parentRule;keyframesRule.__parentStyleSheet=styleSheet,currentScope=parentRule=keyframesRule,buffer="",state="keyframeRule-begin"}else if(state==="keyframeRule-begin")styleRule=new CSSOM2.CSSKeyframeRule,styleRule.keyText=buffer.trim(),styleRule.__starts=i,buffer="",state="before-name";else if(state==="documentRule-begin"){if(documentRule.matcher.matcherText=buffer.trim(),parentRule)pushToAncestorRules(parentRule),documentRule.__parentRule=parentRule;currentScope=parentRule=documentRule,pushToAncestorRules(documentRule),documentRule.__parentStyleSheet=styleSheet,buffer="",state="before-selector"}else if(state==="before-name"||state==="name"){if(styleRule.constructor.name==="CSSFontFaceRule"||styleRule.constructor.name==="CSSKeyframeRule"||styleRule.constructor.name==="CSSPageRule"&&parentRule===styleRule){var ruleClosingMatch=token.slice(i).match(forwardRuleClosingBraceRegExp);if(ruleClosingMatch){i+=ruleClosingMatch.index+ruleClosingMatch[0].length-1,buffer="",state="before-name";break}}if(styleRule.constructor.name==="CSSNestedDeclarations")if(styleRule.style.length)parentRule.cssRules.push(styleRule),styleRule.__parentRule=parentRule,styleRule.__parentStyleSheet=styleSheet,pushToAncestorRules(parentRule);else pushToAncestorRules(parentRule);else currentScope=parentRule=styleRule,pushToAncestorRules(parentRule),styleRule.__parentStyleSheet=styleSheet;if(styleRule=new CSSOM2.CSSStyleRule,hasUnmatchedQuoteInSelector){handleUnmatchedQuoteInSelector("before-name");break}var processedSelectorText=processSelectorText(buffer.trim());if(parentRule.constructor.name==="CSSScopeRule"||parentRule.constructor.name!=="CSSStyleRule"&&parentRule.parentRule===null)styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).join(", ");else styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).map(function(sel){return sel.indexOf("&")===-1||startsWithCombinatorRegExp.test(sel)?"& "+sel:sel}).join(", ");if(styleRule.style.__starts=i-buffer.length,styleRule.__parentRule=parentRule,parentRule.constructor.name==="CSSStyleRule"||parentRule.constructor.name==="CSSScopeRule")nestedSelectorRule=styleRule;styleRule.__parentStyleSheet=styleSheet,currentScope=parentRule=styleRule,buffer="",state="before-name"}break;case":":if(state==="name"){var openBraceBeforeMatch=token.slice(i).match(declarationOrOpenBraceRegExp),hasOpenBraceBefore=openBraceBeforeMatch&&openBraceBeforeMatch[0]==="{";if(hasOpenBraceBefore)buffer+=character;else name=buffer.trim(),buffer="",state="before-value"}else buffer+=character;break;case"(":if(state==="value")if(buffer.trim()==="expression"){var info=new CSSOM2.CSSValueExpression(token,i).parse();if(info.error)parseError(info.error);else buffer+=info.expression,i=info.idx}else state="value-parenthesis",valueParenthesisDepth=1,buffer+=character;else if(state==="value-parenthesis")valueParenthesisDepth++,buffer+=character;else buffer+=character;break;case")":if(state==="value-parenthesis"){if(valueParenthesisDepth--,valueParenthesisDepth===0)state="value"}buffer+=character;break;case"!":if(state==="value"&&token.indexOf("!important",i)===i)priority="important",i+=9;else buffer+=character;break;case";":switch(state){case"before-value":case"before-name":parseError("Unexpected ;"),buffer="",state="before-name";break;case"value":styleRule.style.setProperty(name,buffer.trim(),priority,parseError),priority="",buffer="",state="before-name";break;case"atRule":buffer="",state="before-selector";break;case"importRule":var isValid=topScope.cssRules.length===0||topScope.cssRules.some(function(rule){return["CSSImportRule","CSSLayerStatementRule"].indexOf(rule.constructor.name)!==-1});if(isValid){if(importRule=new CSSOM2.CSSImportRule,opts&&opts.globalObject&&opts.globalObject.CSSStyleSheet)importRule.__styleSheet=new opts.globalObject.CSSStyleSheet;importRule.styleSheet.__constructed=!1,importRule.__parentStyleSheet=importRule.styleSheet.__parentStyleSheet=styleSheet,importRule.parse(buffer+character),topScope.cssRules.push(importRule)}buffer="",state="before-selector";break;case"namespaceRule":var isValid=topScope.cssRules.length===0||topScope.cssRules.every(function(rule){return["CSSImportRule","CSSLayerStatementRule","CSSNamespaceRule"].indexOf(rule.constructor.name)!==-1});if(isValid)try{var testNamespaceRule=new CSSOM2.CSSNamespaceRule;if(testNamespaceRule.parse(buffer+character),namespaceRule=testNamespaceRule,namespaceRule.__parentStyleSheet=styleSheet,topScope.cssRules.push(namespaceRule),namespaceRule.prefix)definedNamespacePrefixes[namespaceRule.prefix]=namespaceRule.namespaceURI}catch(e){parseError(e.message)}buffer="",state="before-selector";break;case"layerBlock":var nameListStr=buffer.trim().split(",").map(function(name){return name.trim()}),isInvalid=nameListStr.some(function(name){return name.trim().match(cssCustomIdentifierRegExp)===null}),hasStyleRuleParent=!1;if(parentRule){var checkParent=parentRule;while(checkParent){if(checkParent.constructor.name==="CSSStyleRule"){hasStyleRuleParent=!0;break}checkParent=checkParent.__parentRule}}if(!isInvalid&&!hasStyleRuleParent)if(layerStatementRule=new CSSOM2.CSSLayerStatementRule,layerStatementRule.__parentStyleSheet=styleSheet,layerStatementRule.__starts=layerBlockRule.__starts,layerStatementRule.__ends=i,layerStatementRule.nameList=nameListStr,parentRule)layerStatementRule.__parentRule=parentRule,parentRule.cssRules.push(layerStatementRule);else topScope.cssRules.push(layerStatementRule);buffer="",state="before-selector";break;default:buffer+=character;break}break;case"}":if(state==="counterStyleBlock"){if(counterStyleRule.name)if(counterStyleRule.parse("@counter-style "+counterStyleRule.name+" { "+buffer+" }"),counterStyleRule.__ends=i+1,counterStyleRule.__parentRule)counterStyleRule.__parentRule.cssRules.push(counterStyleRule);else topScope.cssRules.push(counterStyleRule);if(counterStyleRule.__parentRule)currentScope=counterStyleRule.__parentRule;styleRule=null,buffer="",state="before-selector";break}if(state==="propertyBlock"){if(propertyRule.__name){var parseSuccess=propertyRule.parse("@property "+propertyRule.__name+" { "+buffer+" }");if(parseSuccess)if(propertyRule.__ends=i+1,propertyRule.__parentRule)propertyRule.__parentRule.cssRules.push(propertyRule);else topScope.cssRules.push(propertyRule)}if(propertyRule.__parentRule)currentScope=propertyRule.__parentRule;styleRule=null,buffer="",state="before-selector";break}switch(state){case"value":styleRule.style.setProperty(name,buffer.trim(),priority,parseError),priority="";case"before-value":case"before-name":case"name":if(styleRule.__ends=i+1,parentRule===styleRule)parentRule=ancestorRules.pop();if(parentRule)styleRule.__parentRule=parentRule;if(styleRule.__parentStyleSheet=styleSheet,currentScope===styleRule)currentScope=parentRule||topScope;if(styleRule.constructor.name==="CSSStyleRule"&&!isValidSelectorText(styleRule.selectorText)){if(styleRule===nestedSelectorRule)nestedSelectorRule=null;parseError('Invalid CSSStyleRule (selectorText = "'+styleRule.selectorText+'")',styleRule.parentRule!==null)}else if(styleRule.parentRule)styleRule.parentRule.cssRules.push(styleRule);else currentScope.cssRules.push(styleRule);if(buffer="",currentScope.constructor===CSSOM2.CSSKeyframesRule)state="keyframeRule-begin";else state="before-selector";if(styleRule.constructor.name==="CSSNestedDeclarations"){if(currentScope!==topScope){if(currentScope.constructor.name==="CSSStyleRule"||currentScope.constructor.name==="CSSScopeRule")nestedSelectorRule=currentScope}styleRule=null}else{if(styleRule===nestedSelectorRule){var selector=styleRule.selectorText&&styleRule.selectorText.trim(),isPrependedAmpersand=selector&&selector.match(prependedAmpersandRegExp),isGroupingRule=currentScope&¤tScope instanceof CSSOM2.CSSGroupingRule;if(!isPrependedAmpersand&&isGroupingRule){if(currentScope.constructor.name==="CSSStyleRule"||currentScope.constructor.name==="CSSScopeRule")nestedSelectorRule=currentScope}else nestedSelectorRule=null}else if(nestedSelectorRule&¤tScope instanceof CSSOM2.CSSGroupingRule);styleRule=null;break}case"keyframeRule-begin":case"before-selector":case"selector":if(!parentRule){parseError("Unexpected }");var hasPreviousStyleRule=currentScope.cssRules.length&¤tScope.cssRules[currentScope.cssRules.length-1].constructor.name==="CSSStyleRule";if(hasPreviousStyleRule)i=ignoreBalancedBlock(i,token.slice(i),1);break}while(ancestorRules.length>0){if(parentRule=ancestorRules.pop(),parentRule===currentScope)continue;if(!(parentRule instanceof CSSOM2.CSSGroupingRule&&(parentRule.constructor.name!=="CSSStyleRule"||parentRule.__parentRule)))continue;var isClosingNestedSelectorContext=nestedSelectorRule&&(currentScope===nestedSelectorRule||nestedSelectorRule.__parentRule===currentScope);if(isClosingNestedSelectorContext)if(nestedSelectorRule.parentRule){prevScope=nestedSelectorRule,currentScope=nestedSelectorRule.parentRule;var scopeId=getRuleId(prevScope);if(!addedToCurrentScope[scopeId])currentScope.cssRules.push(prevScope),addedToCurrentScope[scopeId]=!0;nestedSelectorRule=currentScope;break}else{prevScope=currentScope;var actualParent=ancestorRules.length>0?ancestorRules[ancestorRules.length-1]:nestedSelectorRule;if(actualParent!==prevScope)actualParent.cssRules.push(prevScope);currentScope=actualParent,parentRule=actualParent;break}else{if(prevScope=currentScope,parentRule!==prevScope)parentRule.cssRules.push(prevScope);break}}if(ancestorRules.length===0&¤tScope.__parentRule&¤tScope.__parentRule.cssRules){var parentId=getRuleId(currentScope);if(!addedToParent[parentId])currentScope.__parentRule.cssRules.push(currentScope),addedToParent[parentId]=!0}if(ancestorRules.length===0&¤tScope.parentRule==null){currentScope.__ends=i+1;var topId=getRuleId(currentScope);if(currentScope!==topScope&&!addedToTopScope[topId])topScope.cssRules.push(currentScope),addedToTopScope[topId]=!0;if(currentScope=topScope,nestedSelectorRule===parentRule){var nestedSelectorTokenToCurrentSelectorToken=token.slice(nestedSelectorRule.__starts,i+1),openingBraceMatch=nestedSelectorTokenToCurrentSelectorToken.match(openBraceGlobalRegExp),closingBraceMatch=nestedSelectorTokenToCurrentSelectorToken.match(closeBraceGlobalRegExp),openingBraceLen=openingBraceMatch&&openingBraceMatch.length,closingBraceLen=closingBraceMatch&&closingBraceMatch.length;if(openingBraceLen===closingBraceLen)nestedSelectorRule.__ends=i+1,nestedSelectorRule=null,parentRule=null}else parentRule=null}else currentScope=parentRule;buffer="",state="before-selector";break}break;default:switch(state){case"before-selector":if(state="selector",(styleRule||scopeRule)&&parentRule){if(!isSelectorStartChar(character)&&!isWhitespaceChar(character)&&parentRule instanceof CSSOM2.CSSGroupingRule){if(state="before-name",styleRule!==parentRule)styleRule=new CSSOM2.CSSNestedDeclarations,styleRule.__starts=i}}else if(nestedSelectorRule&&parentRule&&parentRule instanceof CSSOM2.CSSGroupingRule){if(isSelectorStartChar(character))styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i;else if(!isWhitespaceChar(character))if(state="before-name",parentRule.cssRules.length||nestedSelectorRule){if(currentScope=parentRule,parentRule.constructor.name==="CSSStyleRule"||parentRule.constructor.name==="CSSScopeRule")nestedSelectorRule=parentRule;styleRule=new CSSOM2.CSSNestedDeclarations,styleRule.__starts=i}else if(parentRule.constructor.name==="CSSStyleRule")styleRule=parentRule;else styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i}break;case"before-name":state="name";break;case"before-value":state="value";break;case"importRule-begin":state="importRule";break;case"namespaceRule-begin":state="namespaceRule";break}buffer+=character;break}if(i===initialEndingIndex&&(currentScope!==topScope||ancestorRules.length>0)){var needsClosing=ancestorRules.length;if(currentScope!==topScope&&ancestorRules.indexOf(currentScope)===-1)needsClosing+=1;for(var closeIdx=0;closeIdx<needsClosing;closeIdx++)token+="}",endingIndex+=1}}if(buffer.trim()!=="")parseError("Unexpected end of input");return styleSheet};exports2.parse=CSSOM2.parse;CSSOM2.CSSStyleSheet=require_CSSStyleSheet().CSSStyleSheet;CSSOM2.CSSStyleRule=require_CSSStyleRule().CSSStyleRule;CSSOM2.CSSNestedDeclarations=require_CSSNestedDeclarations().CSSNestedDeclarations;CSSOM2.CSSImportRule=require_CSSImportRule().CSSImportRule;CSSOM2.CSSNamespaceRule=require_CSSNamespaceRule().CSSNamespaceRule;CSSOM2.CSSGroupingRule=require_CSSGroupingRule().CSSGroupingRule;CSSOM2.CSSMediaRule=require_CSSMediaRule().CSSMediaRule;CSSOM2.CSSCounterStyleRule=require_CSSCounterStyleRule().CSSCounterStyleRule;CSSOM2.CSSPropertyRule=require_CSSPropertyRule().CSSPropertyRule;CSSOM2.CSSContainerRule=require_CSSContainerRule().CSSContainerRule;CSSOM2.CSSConditionRule=require_CSSConditionRule().CSSConditionRule;CSSOM2.CSSSupportsRule=require_CSSSupportsRule().CSSSupportsRule;CSSOM2.CSSFontFaceRule=require_CSSFontFaceRule().CSSFontFaceRule;CSSOM2.CSSHostRule=require_CSSHostRule().CSSHostRule;CSSOM2.CSSStartingStyleRule=require_CSSStartingStyleRule().CSSStartingStyleRule;CSSOM2.CSSStyleDeclaration=require_CSSStyleDeclaration().CSSStyleDeclaration;CSSOM2.CSSKeyframeRule=require_CSSKeyframeRule().CSSKeyframeRule;CSSOM2.CSSKeyframesRule=require_CSSKeyframesRule().CSSKeyframesRule;CSSOM2.CSSValueExpression=require_CSSValueExpression().CSSValueExpression;CSSOM2.CSSDocumentRule=require_CSSDocumentRule().CSSDocumentRule;CSSOM2.CSSScopeRule=require_CSSScopeRule().CSSScopeRule;CSSOM2.CSSLayerBlockRule=require_CSSLayerBlockRule().CSSLayerBlockRule;CSSOM2.CSSLayerStatementRule=require_CSSLayerStatementRule().CSSLayerStatementRule;CSSOM2.CSSPageRule=require_CSSPageRule().CSSPageRule;require_cssstyleTryCatchBlock()});var require_CSSStyleDeclaration=__commonJS(function(exports2){var CSSOM2={},regexPatterns=require_regexPatterns().regexPatterns,indexedPropertyNameRegExp=/^(0|[1-9][0-9]*)$/;CSSOM2.CSSStyleDeclaration=function(){this.length=0,this.parentRule=null,this._importants={}};CSSOM2.CSSStyleDeclaration.prototype={constructor:CSSOM2.CSSStyleDeclaration,getPropertyValue:function(name){return this[name]||""},setProperty:function(name,value,priority,parseErrorHandler){if(name==="length"||name==="parentRule"||name==="_importants"||name==="__starts"||name in CSSOM2.CSSStyleDeclaration.prototype||indexedPropertyNameRegExp.test(name))return;var basicStylePropertyValueValidationRegExp=regexPatterns.basicStylePropertyValueValidationRegExp;if(basicStylePropertyValueValidationRegExp.test(value))parseErrorHandler&&parseErrorHandler('Invalid CSSStyleDeclaration property (name = "'+name+'", value = "'+value+'")');else if(this[name]){var index=Array.prototype.indexOf.call(this,name);if(index<0)this[this.length]=name,this.length++;if(priority||!this._importants[name])this.removeProperty(name),this[this.length]=name,this.length++,this[name]=value+"",this._importants[name]=priority}else this[this.length]=name,this.length++,this[name]=value+"",this._importants[name]=priority},removeProperty:function(name){if(!(name in this))return"";var index=Array.prototype.indexOf.call(this,name);if(index<0)return"";var prevValue=this[name];return this[name]="",Array.prototype.splice.call(this,index,1),prevValue},getPropertyCSSValue:function(){},getPropertyPriority:function(name){return this._importants[name]||""},getPropertyShorthand:function(){},isPropertyImplicit:function(){},get cssText(){var properties=[];for(var i=0,length=this.length;i<length;++i){var name=this[i],value=this.getPropertyValue(name),priority=this.getPropertyPriority(name);if(priority)priority=" !"+priority;properties[i]=name+": "+value+priority+";"}return properties.join(" ")},set cssText(text){var i,name;for(i=this.length;i--;)name=this[i],this[name]="";Array.prototype.splice.call(this,0,this.length),this._importants={};var dummyRule=CSSOM2.parse("#bogus{"+text+"}").cssRules[0].style,length=dummyRule.length;for(i=0;i<length;++i)name=dummyRule[i],this.setProperty(dummyRule[i],dummyRule.getPropertyValue(name),dummyRule.getPropertyPriority(name))}};exports2.CSSStyleDeclaration=CSSOM2.CSSStyleDeclaration;CSSOM2.parse=require_parse().parse});var require_clone=__commonJS(function(exports2){var CSSOM2={CSSStyleSheet:require_CSSStyleSheet().CSSStyleSheet,CSSRule:require_CSSRule().CSSRule,CSSNestedDeclarations:require_CSSNestedDeclarations().CSSNestedDeclarations,CSSStyleRule:require_CSSStyleRule().CSSStyleRule,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule,CSSMediaRule:require_CSSMediaRule().CSSMediaRule,CSSContainerRule:require_CSSContainerRule().CSSContainerRule,CSSSupportsRule:require_CSSSupportsRule().CSSSupportsRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSKeyframeRule:require_CSSKeyframeRule().CSSKeyframeRule,CSSKeyframesRule:require_CSSKeyframesRule().CSSKeyframesRule,CSSScopeRule:require_CSSScopeRule().CSSScopeRule,CSSLayerBlockRule:require_CSSLayerBlockRule().CSSLayerBlockRule,CSSLayerStatementRule:require_CSSLayerStatementRule().CSSLayerStatementRule};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.clone=function clone(stylesheet){var cloned=new CSSOM2.CSSStyleSheet,rules=stylesheet.cssRules;if(!rules)return cloned;for(var i=0,rulesLength=rules.length;i<rulesLength;i++){var rule=rules[i],ruleClone=cloned.cssRules[i]=new rule.constructor,style=rule.style;if(style){var styleClone=ruleClone.style=new CSSOM2.CSSStyleDeclaration;for(var j=0,styleLength=style.length;j<styleLength;j++){var name=style[j];styleClone.setProperty(name,style.getPropertyValue(name),style.getPropertyPriority(name))}}if(rule.hasOwnProperty("keyText"))ruleClone.keyText=rule.keyText;if(rule.hasOwnProperty("selectorText"))ruleClone.selectorText=rule.selectorText;if(rule.hasOwnProperty("mediaText"))ruleClone.mediaText=rule.mediaText;if(rule.hasOwnProperty("supportsText"))ruleClone.supports=rule.supports;if(rule.hasOwnProperty("conditionText"))ruleClone.conditionText=rule.conditionText;if(rule.hasOwnProperty("layerName"))ruleClone.layerName=rule.layerName;if(rule.hasOwnProperty("href"))ruleClone.href=rule.href;if(rule.hasOwnProperty("name"))ruleClone.name=rule.name;if(rule.hasOwnProperty("nameList"))ruleClone.nameList=rule.nameList;if(rule.hasOwnProperty("cssRules"))ruleClone.cssRules=clone(rule).cssRules}return cloned};exports2.clone=CSSOM2.clone});var require_canvas_shim=__commonJS(function(exports2,module2){class Canvas{constructor(width,height){this.width=width,this.height=height}getContext(){return null}toDataURL(){return""}}module2.exports={createCanvas:(width,height)=>new Canvas(width,height)}});var require_canvas=__commonJS(function(exports2,module2){try{module2.exports=(()=>{throw new Error("Cannot require module "+"canvas");})()}catch(fallback){module2.exports=require_canvas_shim()}});import{readFileSync}from"node:fs";var CHANGED=Symbol("changed"),CLASS_LIST=Symbol("classList"),CUSTOM_ELEMENTS=Symbol("CustomElements"),CONTENT=Symbol("content"),DATASET=Symbol("dataset"),DOCTYPE=Symbol("doctype"),DOM_PARSER=Symbol("DOMParser"),END=Symbol("end"),EVENT_TARGET=Symbol("EventTarget"),GLOBALS=Symbol("globals"),IMAGE=Symbol("image"),MIME=Symbol("mime"),MUTATION_OBSERVER=Symbol("MutationObserver"),NEXT=Symbol("next"),OWNER_ELEMENT=Symbol("ownerElement"),PREV=Symbol("prev"),PRIVATE=Symbol("private"),SHEET=Symbol("sheet"),START=Symbol("start"),STYLE=Symbol("style"),UPGRADE=Symbol("upgrade"),VALUE=Symbol("value");var exports_esm3={};__export(exports_esm3,{DefaultHandler:()=>DomHandler,DomHandler:()=>DomHandler,DomUtils:()=>exports_esm2,ElementType:()=>exports_esm,Parser:()=>Parser,QuoteType:()=>QuoteType,Tokenizer:()=>Tokenizer,createDocumentStream:()=>createDocumentStream,createDomStream:()=>createDomStream,getFeed:()=>getFeed,parseDOM:()=>parseDOM,parseDocument:()=>parseDocument,parseFeed:()=>parseFeed});var _a,decodeMap=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),fromCodePoint=(_a=String.fromCodePoint)!==null&&_a!==void 0?_a:(codePoint)=>{let output="";if(codePoint>65535)codePoint-=65536,output+=String.fromCharCode(codePoint>>>10&1023|55296),codePoint=56320|codePoint&1023;return output+=String.fromCharCode(codePoint),output};function replaceCodePoint(codePoint){var _a;if(codePoint>=55296&&codePoint<=57343||codePoint>1114111)return 65533;return(_a=decodeMap.get(codePoint))!==null&&_a!==void 0?_a:codePoint}function decodeBase64(input){let binary=typeof atob==="function"?atob(input):typeof Buffer.from==="function"?Buffer.from(input,"base64").toString("binary"):new Buffer(input,"base64").toString("binary"),evenLength=binary.length&-2,out=new Uint16Array(evenLength/2);for(let index=0,outIndex=0;index<evenLength;index+=2){let lo=binary.charCodeAt(index),hi=binary.charCodeAt(index+1);out[outIndex++]=lo|hi<<8}return out}var htmlDecodeTree=decodeBase64("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAt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tAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var BinTrieFlags;(function(BinTrieFlags){BinTrieFlags[BinTrieFlags.VALUE_LENGTH=49152]="VALUE_LENGTH",BinTrieFlags[BinTrieFlags.FLAG13=8192]="FLAG13",BinTrieFlags[BinTrieFlags.BRANCH_LENGTH=8064]="BRANCH_LENGTH",BinTrieFlags[BinTrieFlags.JUMP_TABLE=127]="JUMP_TABLE"})(BinTrieFlags||(BinTrieFlags={}));var CharCodes;(function(CharCodes){CharCodes[CharCodes.NUM=35]="NUM",CharCodes[CharCodes.SEMI=59]="SEMI",CharCodes[CharCodes.EQUALS=61]="EQUALS",CharCodes[CharCodes.ZERO=48]="ZERO",CharCodes[CharCodes.NINE=57]="NINE",CharCodes[CharCodes.LOWER_A=97]="LOWER_A",CharCodes[CharCodes.LOWER_F=102]="LOWER_F",CharCodes[CharCodes.LOWER_X=120]="LOWER_X",CharCodes[CharCodes.LOWER_Z=122]="LOWER_Z",CharCodes[CharCodes.UPPER_A=65]="UPPER_A",CharCodes[CharCodes.UPPER_F=70]="UPPER_F",CharCodes[CharCodes.UPPER_Z=90]="UPPER_Z"})(CharCodes||(CharCodes={}));var TO_LOWER_BIT=32;function isNumber(code){return code>=CharCodes.ZERO&&code<=CharCodes.NINE}function isHexadecimalCharacter(code){return code>=CharCodes.UPPER_A&&code<=CharCodes.UPPER_F||code>=CharCodes.LOWER_A&&code<=CharCodes.LOWER_F}function isAsciiAlphaNumeric(code){return code>=CharCodes.UPPER_A&&code<=CharCodes.UPPER_Z||code>=CharCodes.LOWER_A&&code<=CharCodes.LOWER_Z||isNumber(code)}function isEntityInAttributeInvalidEnd(code){return code===CharCodes.EQUALS||isAsciiAlphaNumeric(code)}var EntityDecoderState;(function(EntityDecoderState){EntityDecoderState[EntityDecoderState.EntityStart=0]="EntityStart",EntityDecoderState[EntityDecoderState.NumericStart=1]="NumericStart",EntityDecoderState[EntityDecoderState.NumericDecimal=2]="NumericDecimal",EntityDecoderState[EntityDecoderState.NumericHex=3]="NumericHex",EntityDecoderState[EntityDecoderState.NamedEntity=4]="NamedEntity"})(EntityDecoderState||(EntityDecoderState={}));var DecodingMode;(function(DecodingMode){DecodingMode[DecodingMode.Legacy=0]="Legacy",DecodingMode[DecodingMode.Strict=1]="Strict",DecodingMode[DecodingMode.Attribute=2]="Attribute"})(DecodingMode||(DecodingMode={}));class EntityDecoder{constructor(decodeTree,emitCodePoint,errors){this.decodeTree=decodeTree,this.emitCodePoint=emitCodePoint,this.errors=errors,this.state=EntityDecoderState.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=DecodingMode.Strict,this.runConsumed=0}startEntity(decodeMode){this.decodeMode=decodeMode,this.state=EntityDecoderState.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(input,offset){switch(this.state){case EntityDecoderState.EntityStart:{if(input.charCodeAt(offset)===CharCodes.NUM)return this.state=EntityDecoderState.NumericStart,this.consumed+=1,this.stateNumericStart(input,offset+1);return this.state=EntityDecoderState.NamedEntity,this.stateNamedEntity(input,offset)}case EntityDecoderState.NumericStart:return this.stateNumericStart(input,offset);case EntityDecoderState.NumericDecimal:return this.stateNumericDecimal(input,offset);case EntityDecoderState.NumericHex:return this.stateNumericHex(input,offset);case EntityDecoderState.NamedEntity:return this.stateNamedEntity(input,offset)}}stateNumericStart(input,offset){if(offset>=input.length)return-1;if((input.charCodeAt(offset)|TO_LOWER_BIT)===CharCodes.LOWER_X)return this.state=EntityDecoderState.NumericHex,this.consumed+=1,this.stateNumericHex(input,offset+1);return this.state=EntityDecoderState.NumericDecimal,this.stateNumericDecimal(input,offset)}stateNumericHex(input,offset){while(offset<input.length){let char=input.charCodeAt(offset);if(isNumber(char)||isHexadecimalCharacter(char)){let digit=char<=CharCodes.NINE?char-CharCodes.ZERO:(char|TO_LOWER_BIT)-CharCodes.LOWER_A+10;this.result=this.result*16+digit,this.consumed++,offset++}else return this.emitNumericEntity(char,3)}return-1}stateNumericDecimal(input,offset){while(offset<input.length){let char=input.charCodeAt(offset);if(isNumber(char))this.result=this.result*10+(char-CharCodes.ZERO),this.consumed++,offset++;else return this.emitNumericEntity(char,2)}return-1}emitNumericEntity(lastCp,expectedLength){var _a;if(this.consumed<=expectedLength)return(_a=this.errors)===null||_a===void 0||_a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(lastCp===CharCodes.SEMI)this.consumed+=1;else if(this.decodeMode===DecodingMode.Strict)return 0;if(this.emitCodePoint(replaceCodePoint(this.result),this.consumed),this.errors){if(lastCp!==CharCodes.SEMI)this.errors.missingSemicolonAfterCharacterReference();this.errors.validateNumericCharacterReference(this.result)}return this.consumed}stateNamedEntity(input,offset){let{decodeTree}=this,current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14;while(offset<input.length){if(valueLength===0&&(current&BinTrieFlags.FLAG13)!==0){let runLength=(current&BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let firstChar=current&BinTrieFlags.JUMP_TABLE;if(input.charCodeAt(offset)!==firstChar)return this.result===0?0:this.emitNotTerminatedNamedEntity();offset++,this.excess++,this.runConsumed++}while(this.runConsumed<runLength){if(offset>=input.length)return-1;let charIndexInPacked=this.runConsumed-1,packedWord=decodeTree[this.treeIndex+1+(charIndexInPacked>>1)],expectedChar=charIndexInPacked%2===0?packedWord&255:packedWord>>8&255;if(input.charCodeAt(offset)!==expectedChar)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();offset++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(runLength>>1),current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14}if(offset>=input.length)break;let char=input.charCodeAt(offset);if(char===CharCodes.SEMI&&valueLength!==0&&(current&BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,valueLength,this.consumed+this.excess);if(this.treeIndex=determineBranch(decodeTree,current,this.treeIndex+Math.max(1,valueLength),char),this.treeIndex<0)return this.result===0||this.decodeMode===DecodingMode.Attribute&&(valueLength===0||isEntityInAttributeInvalidEnd(char))?0:this.emitNotTerminatedNamedEntity();if(current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14,valueLength!==0){if(char===CharCodes.SEMI)return this.emitNamedEntityData(this.treeIndex,valueLength,this.consumed+this.excess);if(this.decodeMode!==DecodingMode.Strict&&(current&BinTrieFlags.FLAG13)===0)this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0}offset++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var _a;let{result,decodeTree}=this,valueLength=(decodeTree[result]&BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData(result,valueLength,this.consumed),(_a=this.errors)===null||_a===void 0||_a.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(result,valueLength,consumed){let{decodeTree}=this;if(this.emitCodePoint(valueLength===1?decodeTree[result]&~(BinTrieFlags.VALUE_LENGTH|BinTrieFlags.FLAG13):decodeTree[result+1],consumed),valueLength===3)this.emitCodePoint(decodeTree[result+2],consumed);return consumed}end(){var _a;switch(this.state){case EntityDecoderState.NamedEntity:return this.result!==0&&(this.decodeMode!==DecodingMode.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case EntityDecoderState.NumericDecimal:return this.emitNumericEntity(0,2);case EntityDecoderState.NumericHex:return this.emitNumericEntity(0,3);case EntityDecoderState.NumericStart:return(_a=this.errors)===null||_a===void 0||_a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case EntityDecoderState.EntityStart:return 0}}}function determineBranch(decodeTree,current,nodeIndex,char){let branchCount=(current&BinTrieFlags.BRANCH_LENGTH)>>7,jumpOffset=current&BinTrieFlags.JUMP_TABLE;if(branchCount===0)return jumpOffset!==0&&char===jumpOffset?nodeIndex:-1;if(jumpOffset){let value=char-jumpOffset;return value<0||value>=branchCount?-1:decodeTree[nodeIndex+value]-1}let packedKeySlots=branchCount+1>>1,lo=0,hi=branchCount-1;while(lo<=hi){let mid=lo+hi>>>1,slot=mid>>1,midKey=decodeTree[nodeIndex+slot]>>(mid&1)*8&255;if(midKey<char)lo=mid+1;else if(midKey>char)hi=mid-1;else return decodeTree[nodeIndex+packedKeySlots+mid]}return-1}var CharCodes2;(function(CharCodes){CharCodes[CharCodes.Tab=9]="Tab",CharCodes[CharCodes.NewLine=10]="NewLine",CharCodes[CharCodes.FormFeed=12]="FormFeed",CharCodes[CharCodes.CarriageReturn=13]="CarriageReturn",CharCodes[CharCodes.Space=32]="Space",CharCodes[CharCodes.ExclamationMark=33]="ExclamationMark",CharCodes[CharCodes.Number=35]="Number",CharCodes[CharCodes.Amp=38]="Amp",CharCodes[CharCodes.SingleQuote=39]="SingleQuote",CharCodes[CharCodes.DoubleQuote=34]="DoubleQuote",CharCodes[CharCodes.Dash=45]="Dash",CharCodes[CharCodes.Slash=47]="Slash",CharCodes[CharCodes.Zero=48]="Zero",CharCodes[CharCodes.Nine=57]="Nine",CharCodes[CharCodes.Semi=59]="Semi",CharCodes[CharCodes.Lt=60]="Lt",CharCodes[CharCodes.Eq=61]="Eq",CharCodes[CharCodes.Gt=62]="Gt",CharCodes[CharCodes.Questionmark=63]="Questionmark",CharCodes[CharCodes.UpperA=65]="UpperA",CharCodes[CharCodes.LowerA=97]="LowerA",CharCodes[CharCodes.UpperF=70]="UpperF",CharCodes[CharCodes.LowerF=102]="LowerF",CharCodes[CharCodes.UpperZ=90]="UpperZ",CharCodes[CharCodes.LowerZ=122]="LowerZ",CharCodes[CharCodes.LowerX=120]="LowerX",CharCodes[CharCodes.OpeningSquareBracket=91]="OpeningSquareBracket"})(CharCodes2||(CharCodes2={}));var State;(function(State){State[State.Text=1]="Text",State[State.BeforeTagName=2]="BeforeTagName",State[State.InTagName=3]="InTagName",State[State.InSelfClosingTag=4]="InSelfClosingTag",State[State.BeforeClosingTagName=5]="BeforeClosingTagName",State[State.InClosingTagName=6]="InClosingTagName",State[State.AfterClosingTagName=7]="AfterClosingTagName",State[State.BeforeAttributeName=8]="BeforeAttributeName",State[State.InAttributeName=9]="InAttributeName",State[State.AfterAttributeName=10]="AfterAttributeName",State[State.BeforeAttributeValue=11]="BeforeAttributeValue",State[State.InAttributeValueDq=12]="InAttributeValueDq",State[State.InAttributeValueSq=13]="InAttributeValueSq",State[State.InAttributeValueNq=14]="InAttributeValueNq",State[State.BeforeDeclaration=15]="BeforeDeclaration",State[State.InDeclaration=16]="InDeclaration",State[State.InProcessingInstruction=17]="InProcessingInstruction",State[State.BeforeComment=18]="BeforeComment",State[State.CDATASequence=19]="CDATASequence",State[State.InSpecialComment=20]="InSpecialComment",State[State.InCommentLike=21]="InCommentLike",State[State.BeforeSpecialS=22]="BeforeSpecialS",State[State.BeforeSpecialT=23]="BeforeSpecialT",State[State.SpecialStartSequence=24]="SpecialStartSequence",State[State.InSpecialTag=25]="InSpecialTag",State[State.InEntity=26]="InEntity"})(State||(State={}));function isWhitespace(c){return c===CharCodes2.Space||c===CharCodes2.NewLine||c===CharCodes2.Tab||c===CharCodes2.FormFeed||c===CharCodes2.CarriageReturn}function isEndOfTagSection(c){return c===CharCodes2.Slash||c===CharCodes2.Gt||isWhitespace(c)}function isASCIIAlpha(c){return c>=CharCodes2.LowerA&&c<=CharCodes2.LowerZ||c>=CharCodes2.UpperA&&c<=CharCodes2.UpperZ}var QuoteType;(function(QuoteType){QuoteType[QuoteType.NoValue=0]="NoValue",QuoteType[QuoteType.Unquoted=1]="Unquoted",QuoteType[QuoteType.Single=2]="Single",QuoteType[QuoteType.Double=3]="Double"})(QuoteType||(QuoteType={}));var Sequences={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};class Tokenizer{constructor({xmlMode=!1,decodeEntities=!0},cbs){this.cbs=cbs,this.state=State.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=State.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=xmlMode,this.decodeEntities=decodeEntities,this.entityDecoder=new EntityDecoder(xmlMode?xmlDecodeTree:htmlDecodeTree,(cp,consumed)=>this.emitCodePoint(cp,consumed))}reset(){this.state=State.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=State.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(chunk){this.offset+=this.buffer.length,this.buffer=chunk,this.parse()}end(){if(this.running)this.finish()}pause(){this.running=!1}resume(){if(this.running=!0,this.index<this.buffer.length+this.offset)this.parse()}stateText(c){if(c===CharCodes2.Lt||!this.decodeEntities&&this.fastForwardTo(CharCodes2.Lt)){if(this.index>this.sectionStart)this.cbs.ontext(this.sectionStart,this.index);this.state=State.BeforeTagName,this.sectionStart=this.index}else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateSpecialStartSequence(c){let isEnd=this.sequenceIndex===this.currentSequence.length;if(!(isEnd?isEndOfTagSection(c):(c|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!isEnd){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=State.InTagName,this.stateInTagName(c)}stateInSpecialTag(c){if(this.sequenceIndex===this.currentSequence.length){if(c===CharCodes2.Gt||isWhitespace(c)){let endOfText=this.index-this.currentSequence.length;if(this.sectionStart<endOfText){let actualIndex=this.index;this.index=endOfText,this.cbs.ontext(this.sectionStart,endOfText),this.index=actualIndex}this.isSpecial=!1,this.sectionStart=endOfText+2,this.stateInClosingTagName(c);return}this.sequenceIndex=0}if((c|32)===this.currentSequence[this.sequenceIndex])this.sequenceIndex+=1;else if(this.sequenceIndex===0){if(this.currentSequence===Sequences.TitleEnd){if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}else if(this.fastForwardTo(CharCodes2.Lt))this.sequenceIndex=1}else this.sequenceIndex=Number(c===CharCodes2.Lt)}stateCDATASequence(c){if(c===Sequences.Cdata[this.sequenceIndex]){if(++this.sequenceIndex===Sequences.Cdata.length)this.state=State.InCommentLike,this.currentSequence=Sequences.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1}else this.sequenceIndex=0,this.state=State.InDeclaration,this.stateInDeclaration(c)}fastForwardTo(c){while(++this.index<this.buffer.length+this.offset)if(this.buffer.charCodeAt(this.index-this.offset)===c)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(c){if(c===this.currentSequence[this.sequenceIndex]){if(++this.sequenceIndex===this.currentSequence.length){if(this.currentSequence===Sequences.CdataEnd)this.cbs.oncdata(this.sectionStart,this.index,2);else this.cbs.oncomment(this.sectionStart,this.index,2);this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=State.Text}}else if(this.sequenceIndex===0){if(this.fastForwardTo(this.currentSequence[0]))this.sequenceIndex=1}else if(c!==this.currentSequence[this.sequenceIndex-1])this.sequenceIndex=0}isTagStartChar(c){return this.xmlMode?!isEndOfTagSection(c):isASCIIAlpha(c)}startSpecial(sequence,offset){this.isSpecial=!0,this.currentSequence=sequence,this.sequenceIndex=offset,this.state=State.SpecialStartSequence}stateBeforeTagName(c){if(c===CharCodes2.ExclamationMark)this.state=State.BeforeDeclaration,this.sectionStart=this.index+1;else if(c===CharCodes2.Questionmark)this.state=State.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(c)){let lower=c|32;if(this.sectionStart=this.index,this.xmlMode)this.state=State.InTagName;else if(lower===Sequences.ScriptEnd[2])this.state=State.BeforeSpecialS;else if(lower===Sequences.TitleEnd[2]||lower===Sequences.XmpEnd[2])this.state=State.BeforeSpecialT;else this.state=State.InTagName}else if(c===CharCodes2.Slash)this.state=State.BeforeClosingTagName;else this.state=State.Text,this.stateText(c)}stateInTagName(c){if(isEndOfTagSection(c))this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c)}stateBeforeClosingTagName(c){if(isWhitespace(c));else if(c===CharCodes2.Gt)this.state=State.Text;else this.state=this.isTagStartChar(c)?State.InClosingTagName:State.InSpecialComment,this.sectionStart=this.index}stateInClosingTagName(c){if(c===CharCodes2.Gt||isWhitespace(c))this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=State.AfterClosingTagName,this.stateAfterClosingTagName(c)}stateAfterClosingTagName(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.state=State.Text,this.sectionStart=this.index+1}stateBeforeAttributeName(c){if(c===CharCodes2.Gt){if(this.cbs.onopentagend(this.index),this.isSpecial)this.state=State.InSpecialTag,this.sequenceIndex=0;else this.state=State.Text;this.sectionStart=this.index+1}else if(c===CharCodes2.Slash)this.state=State.InSelfClosingTag;else if(!isWhitespace(c))this.state=State.InAttributeName,this.sectionStart=this.index}stateInSelfClosingTag(c){if(c===CharCodes2.Gt)this.cbs.onselfclosingtag(this.index),this.state=State.Text,this.sectionStart=this.index+1,this.isSpecial=!1;else if(!isWhitespace(c))this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c)}stateInAttributeName(c){if(c===CharCodes2.Eq||isEndOfTagSection(c))this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=State.AfterAttributeName,this.stateAfterAttributeName(c)}stateAfterAttributeName(c){if(c===CharCodes2.Eq)this.state=State.BeforeAttributeValue;else if(c===CharCodes2.Slash||c===CharCodes2.Gt)this.cbs.onattribend(QuoteType.NoValue,this.sectionStart),this.sectionStart=-1,this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c);else if(!isWhitespace(c))this.cbs.onattribend(QuoteType.NoValue,this.sectionStart),this.state=State.InAttributeName,this.sectionStart=this.index}stateBeforeAttributeValue(c){if(c===CharCodes2.DoubleQuote)this.state=State.InAttributeValueDq,this.sectionStart=this.index+1;else if(c===CharCodes2.SingleQuote)this.state=State.InAttributeValueSq,this.sectionStart=this.index+1;else if(!isWhitespace(c))this.sectionStart=this.index,this.state=State.InAttributeValueNq,this.stateInAttributeValueNoQuotes(c)}handleInAttributeValue(c,quote){if(c===quote||!this.decodeEntities&&this.fastForwardTo(quote))this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(quote===CharCodes2.DoubleQuote?QuoteType.Double:QuoteType.Single,this.index+1),this.state=State.BeforeAttributeName;else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateInAttributeValueDoubleQuotes(c){this.handleInAttributeValue(c,CharCodes2.DoubleQuote)}stateInAttributeValueSingleQuotes(c){this.handleInAttributeValue(c,CharCodes2.SingleQuote)}stateInAttributeValueNoQuotes(c){if(isWhitespace(c)||c===CharCodes2.Gt)this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(QuoteType.Unquoted,this.index),this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c);else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateBeforeDeclaration(c){if(c===CharCodes2.OpeningSquareBracket)this.state=State.CDATASequence,this.sequenceIndex=0;else this.state=c===CharCodes2.Dash?State.BeforeComment:State.InDeclaration}stateInDeclaration(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.ondeclaration(this.sectionStart,this.index),this.state=State.Text,this.sectionStart=this.index+1}stateInProcessingInstruction(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=State.Text,this.sectionStart=this.index+1}stateBeforeComment(c){if(c===CharCodes2.Dash)this.state=State.InCommentLike,this.currentSequence=Sequences.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1;else this.state=State.InDeclaration}stateInSpecialComment(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.oncomment(this.sectionStart,this.index,0),this.state=State.Text,this.sectionStart=this.index+1}stateBeforeSpecialS(c){let lower=c|32;if(lower===Sequences.ScriptEnd[3])this.startSpecial(Sequences.ScriptEnd,4);else if(lower===Sequences.StyleEnd[3])this.startSpecial(Sequences.StyleEnd,4);else this.state=State.InTagName,this.stateInTagName(c)}stateBeforeSpecialT(c){switch(c|32){case Sequences.TitleEnd[3]:{this.startSpecial(Sequences.TitleEnd,4);break}case Sequences.TextareaEnd[3]:{this.startSpecial(Sequences.TextareaEnd,4);break}case Sequences.XmpEnd[3]:{this.startSpecial(Sequences.XmpEnd,4);break}default:this.state=State.InTagName,this.stateInTagName(c)}}startEntity(){this.baseState=this.state,this.state=State.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?DecodingMode.Strict:this.baseState===State.Text||this.baseState===State.InSpecialTag?DecodingMode.Legacy:DecodingMode.Attribute)}stateInEntity(){let indexInBuffer=this.index-this.offset,length=this.entityDecoder.write(this.buffer,indexInBuffer);if(length>=0){if(this.state=this.baseState,length===0)this.index-=1}else{if(indexInBuffer<this.buffer.length&&this.buffer.charCodeAt(indexInBuffer)===CharCodes2.Amp){this.state=this.baseState,this.index-=1;return}this.index=this.offset+this.buffer.length-1}}cleanup(){if(this.running&&this.sectionStart!==this.index){if(this.state===State.Text||this.state===State.InSpecialTag&&this.sequenceIndex===0)this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index;else if(this.state===State.InAttributeValueDq||this.state===State.InAttributeValueSq||this.state===State.InAttributeValueNq)this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index}}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){while(this.shouldContinue()){let c=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case State.Text:{this.stateText(c);break}case State.SpecialStartSequence:{this.stateSpecialStartSequence(c);break}case State.InSpecialTag:{this.stateInSpecialTag(c);break}case State.CDATASequence:{this.stateCDATASequence(c);break}case State.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(c);break}case State.InAttributeName:{this.stateInAttributeName(c);break}case State.InCommentLike:{this.stateInCommentLike(c);break}case State.InSpecialComment:{this.stateInSpecialComment(c);break}case State.BeforeAttributeName:{this.stateBeforeAttributeName(c);break}case State.InTagName:{this.stateInTagName(c);break}case State.InClosingTagName:{this.stateInClosingTagName(c);break}case State.BeforeTagName:{this.stateBeforeTagName(c);break}case State.AfterAttributeName:{this.stateAfterAttributeName(c);break}case State.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(c);break}case State.BeforeAttributeValue:{this.stateBeforeAttributeValue(c);break}case State.BeforeClosingTagName:{this.stateBeforeClosingTagName(c);break}case State.AfterClosingTagName:{this.stateAfterClosingTagName(c);break}case State.BeforeSpecialS:{this.stateBeforeSpecialS(c);break}case State.BeforeSpecialT:{this.stateBeforeSpecialT(c);break}case State.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(c);break}case State.InSelfClosingTag:{this.stateInSelfClosingTag(c);break}case State.InDeclaration:{this.stateInDeclaration(c);break}case State.BeforeDeclaration:{this.stateBeforeDeclaration(c);break}case State.BeforeComment:{this.stateBeforeComment(c);break}case State.InProcessingInstruction:{this.stateInProcessingInstruction(c);break}case State.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){if(this.state===State.InEntity)this.entityDecoder.end(),this.state=this.baseState;this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let endIndex=this.buffer.length+this.offset;if(this.sectionStart>=endIndex)return;if(this.state===State.InCommentLike)if(this.currentSequence===Sequences.CdataEnd)this.cbs.oncdata(this.sectionStart,endIndex,0);else this.cbs.oncomment(this.sectionStart,endIndex,0);else if(this.state===State.InTagName||this.state===State.BeforeAttributeName||this.state===State.BeforeAttributeValue||this.state===State.AfterAttributeName||this.state===State.InAttributeName||this.state===State.InAttributeValueSq||this.state===State.InAttributeValueDq||this.state===State.InAttributeValueNq||this.state===State.InClosingTagName);else this.cbs.ontext(this.sectionStart,endIndex)}emitCodePoint(cp,consumed){if(this.baseState!==State.Text&&this.baseState!==State.InSpecialTag){if(this.sectionStart<this.entityStart)this.cbs.onattribdata(this.sectionStart,this.entityStart);this.sectionStart=this.entityStart+consumed,this.index=this.sectionStart-1,this.cbs.onattribentity(cp)}else{if(this.sectionStart<this.entityStart)this.cbs.ontext(this.sectionStart,this.entityStart);this.sectionStart=this.entityStart+consumed,this.index=this.sectionStart-1,this.cbs.ontextentity(cp,this.sectionStart)}}}var formTags=new Set(["input","option","optgroup","select","button","datalist","textarea"]),pTag=new Set(["p"]),tableSectionTags=new Set(["thead","tbody"]),ddtTags=new Set(["dd","dt"]),rtpTags=new Set(["rt","rp"]),openImpliesClose=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",pTag],["h1",pTag],["h2",pTag],["h3",pTag],["h4",pTag],["h5",pTag],["h6",pTag],["select",formTags],["input",formTags],["output",formTags],["button",formTags],["datalist",formTags],["textarea",formTags],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",ddtTags],["dt",ddtTags],["address",pTag],["article",pTag],["aside",pTag],["blockquote",pTag],["details",pTag],["div",pTag],["dl",pTag],["fieldset",pTag],["figcaption",pTag],["figure",pTag],["footer",pTag],["form",pTag],["header",pTag],["hr",pTag],["main",pTag],["nav",pTag],["ol",pTag],["pre",pTag],["section",pTag],["table",pTag],["ul",pTag],["rt",rtpTags],["rp",rtpTags],["tbody",tableSectionTags],["tfoot",tableSectionTags]]),voidElements=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),foreignContextElements=new Set(["math","svg"]),htmlIntegrationElements=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),reNameEnd=/\s|\//;class Parser{constructor(cbs,options={}){var _a,_b,_c,_d,_e,_f;this.options=options,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=cbs!==null&&cbs!==void 0?cbs:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(_a=options.lowerCaseTags)!==null&&_a!==void 0?_a:this.htmlMode,this.lowerCaseAttributeNames=(_b=options.lowerCaseAttributeNames)!==null&&_b!==void 0?_b:this.htmlMode,this.recognizeSelfClosing=(_c=options.recognizeSelfClosing)!==null&&_c!==void 0?_c:!this.htmlMode,this.tokenizer=new((_d=options.Tokenizer)!==null&&_d!==void 0?_d:Tokenizer)(this.options,this),this.foreignContext=[!this.htmlMode],(_f=(_e=this.cbs).onparserinit)===null||_f===void 0||_f.call(_e,this)}ontext(start,endIndex){var _a,_b;let data=this.getSlice(start,endIndex);this.endIndex=endIndex-1,(_b=(_a=this.cbs).ontext)===null||_b===void 0||_b.call(_a,data),this.startIndex=endIndex}ontextentity(cp,endIndex){var _a,_b;this.endIndex=endIndex-1,(_b=(_a=this.cbs).ontext)===null||_b===void 0||_b.call(_a,fromCodePoint(cp)),this.startIndex=endIndex}isVoidElement(name){return this.htmlMode&&voidElements.has(name)}onopentagname(start,endIndex){this.endIndex=endIndex;let name=this.getSlice(start,endIndex);if(this.lowerCaseTagNames)name=name.toLowerCase();this.emitOpenTag(name)}emitOpenTag(name){var _a,_b,_c,_d;this.openTagStart=this.startIndex,this.tagname=name;let impliesClose=this.htmlMode&&openImpliesClose.get(name);if(impliesClose)while(this.stack.length>0&&impliesClose.has(this.stack[0])){let element=this.stack.shift();(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,element,!0)}if(!this.isVoidElement(name)){if(this.stack.unshift(name),this.htmlMode){if(foreignContextElements.has(name))this.foreignContext.unshift(!0);else if(htmlIntegrationElements.has(name))this.foreignContext.unshift(!1)}}if((_d=(_c=this.cbs).onopentagname)===null||_d===void 0||_d.call(_c,name),this.cbs.onopentag)this.attribs={}}endOpenTag(isImplied){var _a,_b;if(this.startIndex=this.openTagStart,this.attribs)(_b=(_a=this.cbs).onopentag)===null||_b===void 0||_b.call(_a,this.tagname,this.attribs,isImplied),this.attribs=null;if(this.cbs.onclosetag&&this.isVoidElement(this.tagname))this.cbs.onclosetag(this.tagname,!0);this.tagname=""}onopentagend(endIndex){this.endIndex=endIndex,this.endOpenTag(!1),this.startIndex=endIndex+1}onclosetag(start,endIndex){var _a,_b,_c,_d,_e,_f,_g,_h;this.endIndex=endIndex;let name=this.getSlice(start,endIndex);if(this.lowerCaseTagNames)name=name.toLowerCase();if(this.htmlMode&&(foreignContextElements.has(name)||htmlIntegrationElements.has(name)))this.foreignContext.shift();if(!this.isVoidElement(name)){let pos=this.stack.indexOf(name);if(pos!==-1)for(let index=0;index<=pos;index++){let element=this.stack.shift();(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,element,index!==pos)}else if(this.htmlMode&&name==="p")this.emitOpenTag("p"),this.closeCurrentTag(!0)}else if(this.htmlMode&&name==="br")(_d=(_c=this.cbs).onopentagname)===null||_d===void 0||_d.call(_c,"br"),(_f=(_e=this.cbs).onopentag)===null||_f===void 0||_f.call(_e,"br",{},!0),(_h=(_g=this.cbs).onclosetag)===null||_h===void 0||_h.call(_g,"br",!1);this.startIndex=endIndex+1}onselfclosingtag(endIndex){if(this.endIndex=endIndex,this.recognizeSelfClosing||this.foreignContext[0])this.closeCurrentTag(!1),this.startIndex=endIndex+1;else this.onopentagend(endIndex)}closeCurrentTag(isOpenImplied){var _a,_b;let name=this.tagname;if(this.endOpenTag(isOpenImplied),this.stack[0]===name)(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,name,!isOpenImplied),this.stack.shift()}onattribname(start,endIndex){this.startIndex=start;let name=this.getSlice(start,endIndex);this.attribname=this.lowerCaseAttributeNames?name.toLowerCase():name}onattribdata(start,endIndex){this.attribvalue+=this.getSlice(start,endIndex)}onattribentity(cp){this.attribvalue+=fromCodePoint(cp)}onattribend(quote,endIndex){var _a,_b;if(this.endIndex=endIndex,(_b=(_a=this.cbs).onattribute)===null||_b===void 0||_b.call(_a,this.attribname,this.attribvalue,quote===QuoteType.Double?'"':quote===QuoteType.Single?"'":quote===QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname))this.attribs[this.attribname]=this.attribvalue;this.attribvalue=""}getInstructionName(value){let index=value.search(reNameEnd),name=index<0?value:value.substr(0,index);if(this.lowerCaseTagNames)name=name.toLowerCase();return name}ondeclaration(start,endIndex){this.endIndex=endIndex;let value=this.getSlice(start,endIndex);if(this.cbs.onprocessinginstruction){let name=this.getInstructionName(value);this.cbs.onprocessinginstruction(`!${name}`,`!${value}`)}this.startIndex=endIndex+1}onprocessinginstruction(start,endIndex){this.endIndex=endIndex;let value=this.getSlice(start,endIndex);if(this.cbs.onprocessinginstruction){let name=this.getInstructionName(value);this.cbs.onprocessinginstruction(`?${name}`,`?${value}`)}this.startIndex=endIndex+1}oncomment(start,endIndex,offset){var _a,_b,_c,_d;this.endIndex=endIndex,(_b=(_a=this.cbs).oncomment)===null||_b===void 0||_b.call(_a,this.getSlice(start,endIndex-offset)),(_d=(_c=this.cbs).oncommentend)===null||_d===void 0||_d.call(_c),this.startIndex=endIndex+1}oncdata(start,endIndex,offset){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;this.endIndex=endIndex;let value=this.getSlice(start,endIndex-offset);if(!this.htmlMode||this.options.recognizeCDATA)(_b=(_a=this.cbs).oncdatastart)===null||_b===void 0||_b.call(_a),(_d=(_c=this.cbs).ontext)===null||_d===void 0||_d.call(_c,value),(_f=(_e=this.cbs).oncdataend)===null||_f===void 0||_f.call(_e);else(_h=(_g=this.cbs).oncomment)===null||_h===void 0||_h.call(_g,`[CDATA[${value}]]`),(_k=(_j=this.cbs).oncommentend)===null||_k===void 0||_k.call(_j);this.startIndex=endIndex+1}onend(){var _a,_b;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let index=0;index<this.stack.length;index++)this.cbs.onclosetag(this.stack[index],!0)}(_b=(_a=this.cbs).onend)===null||_b===void 0||_b.call(_a)}reset(){var _a,_b,_c,_d;(_b=(_a=this.cbs).onreset)===null||_b===void 0||_b.call(_a),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(_d=(_c=this.cbs).onparserinit)===null||_d===void 0||_d.call(_c,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(data){this.reset(),this.end(data)}getSlice(start,end){while(start-this.bufferOffset>=this.buffers[0].length)this.shiftBuffer();let slice=this.buffers[0].slice(start-this.bufferOffset,end-this.bufferOffset);while(end-this.bufferOffset>this.buffers[0].length)this.shiftBuffer(),slice+=this.buffers[0].slice(0,end-this.bufferOffset);return slice}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(chunk){var _a,_b;if(this.ended){(_b=(_a=this.cbs).onerror)===null||_b===void 0||_b.call(_a,Error(".write() after done!"));return}if(this.buffers.push(chunk),this.tokenizer.running)this.tokenizer.write(chunk),this.writeIndex++}end(chunk){var _a,_b;if(this.ended){(_b=(_a=this.cbs).onerror)===null||_b===void 0||_b.call(_a,Error(".end() after done!"));return}if(chunk)this.write(chunk);this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){this.tokenizer.resume();while(this.tokenizer.running&&this.writeIndex<this.buffers.length)this.tokenizer.write(this.buffers[this.writeIndex++]);if(this.ended)this.tokenizer.end()}parseChunk(chunk){this.write(chunk)}done(chunk){this.end(chunk)}}var exports_esm={};__export(exports_esm,{CDATA:()=>CDATA,Comment:()=>Comment,Directive:()=>Directive,Doctype:()=>Doctype,ElementType:()=>ElementType,Root:()=>Root,Script:()=>Script,Style:()=>Style,Tag:()=>Tag,Text:()=>Text,isTag:()=>isTag});var ElementType;(function(ElementType2){ElementType2.Root="root",ElementType2.Text="text",ElementType2.Directive="directive",ElementType2.Comment="comment",ElementType2.Script="script",ElementType2.Style="style",ElementType2.Tag="tag",ElementType2.CDATA="cdata",ElementType2.Doctype="doctype"})(ElementType||(ElementType={}));function isTag(elem){return elem.type===ElementType.Tag||elem.type===ElementType.Script||elem.type===ElementType.Style}var Root=ElementType.Root,Text=ElementType.Text,Directive=ElementType.Directive,Comment=ElementType.Comment,Script=ElementType.Script,Style=ElementType.Style,Tag=ElementType.Tag,CDATA=ElementType.CDATA,Doctype=ElementType.Doctype;class Node{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(parent){this.parent=parent}get previousSibling(){return this.prev}set previousSibling(prev){this.prev=prev}get nextSibling(){return this.next}set nextSibling(next){this.next=next}cloneNode(recursive=!1){return cloneNode(this,recursive)}}class DataNode extends Node{constructor(data){super();this.data=data}get nodeValue(){return this.data}set nodeValue(data){this.data=data}}class Text2 extends DataNode{constructor(){super(...arguments);this.type=ElementType.Text}get nodeType(){return 3}}class Comment2 extends DataNode{constructor(){super(...arguments);this.type=ElementType.Comment}get nodeType(){return 8}}class ProcessingInstruction extends DataNode{constructor(name,data){super(data);this.name=name,this.type=ElementType.Directive}get nodeType(){return 1}}class NodeWithChildren extends Node{constructor(children){super();this.children=children}get firstChild(){var _a;return(_a=this.children[0])!==null&&_a!==void 0?_a:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(children){this.children=children}}class CDATA2 extends NodeWithChildren{constructor(){super(...arguments);this.type=ElementType.CDATA}get nodeType(){return 4}}class Document extends NodeWithChildren{constructor(){super(...arguments);this.type=ElementType.Root}get nodeType(){return 9}}class Element extends NodeWithChildren{constructor(name,attribs,children=[],type=name==="script"?ElementType.Script:name==="style"?ElementType.Style:ElementType.Tag){super(children);this.name=name,this.attribs=attribs,this.type=type}get nodeType(){return 1}get tagName(){return this.name}set tagName(name){this.name=name}get attributes(){return Object.keys(this.attribs).map((name)=>{var _a,_b;return{name,value:this.attribs[name],namespace:(_a=this["x-attribsNamespace"])===null||_a===void 0?void 0:_a[name],prefix:(_b=this["x-attribsPrefix"])===null||_b===void 0?void 0:_b[name]}})}}function isTag2(node){return isTag(node)}function isCDATA(node){return node.type===ElementType.CDATA}function isText(node){return node.type===ElementType.Text}function isComment(node){return node.type===ElementType.Comment}function isDirective(node){return node.type===ElementType.Directive}function isDocument(node){return node.type===ElementType.Root}function hasChildren(node){return Object.prototype.hasOwnProperty.call(node,"children")}function cloneNode(node,recursive=!1){let result;if(isText(node))result=new Text2(node.data);else if(isComment(node))result=new Comment2(node.data);else if(isTag2(node)){let children=recursive?cloneChildren(node.children):[],clone=new Element(node.name,{...node.attribs},children);if(children.forEach((child)=>child.parent=clone),node.namespace!=null)clone.namespace=node.namespace;if(node["x-attribsNamespace"])clone["x-attribsNamespace"]={...node["x-attribsNamespace"]};if(node["x-attribsPrefix"])clone["x-attribsPrefix"]={...node["x-attribsPrefix"]};result=clone}else if(isCDATA(node)){let children=recursive?cloneChildren(node.children):[],clone=new CDATA2(children);children.forEach((child)=>child.parent=clone),result=clone}else if(isDocument(node)){let children=recursive?cloneChildren(node.children):[],clone=new Document(children);if(children.forEach((child)=>child.parent=clone),node["x-mode"])clone["x-mode"]=node["x-mode"];result=clone}else if(isDirective(node)){let instruction=new ProcessingInstruction(node.name,node.data);if(node["x-name"]!=null)instruction["x-name"]=node["x-name"],instruction["x-publicId"]=node["x-publicId"],instruction["x-systemId"]=node["x-systemId"];result=instruction}else throw Error(`Not implemented yet: ${node.type}`);if(result.startIndex=node.startIndex,result.endIndex=node.endIndex,node.sourceCodeLocation!=null)result.sourceCodeLocation=node.sourceCodeLocation;return result}function cloneChildren(childs){let children=childs.map((child)=>cloneNode(child,!0));for(let i=1;i<children.length;i++)children[i].prev=children[i-1],children[i-1].next=children[i];return children}var defaultOpts={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class DomHandler{constructor(callback,options,elementCB){if(this.dom=[],this.root=new Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof options==="function")elementCB=options,options=defaultOpts;if(typeof callback==="object")options=callback,callback=void 0;this.callback=callback!==null&&callback!==void 0?callback:null,this.options=options!==null&&options!==void 0?options:defaultOpts,this.elementCB=elementCB!==null&&elementCB!==void 0?elementCB:null}onparserinit(parser){this.parser=parser}onreset(){this.dom=[],this.root=new Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){if(this.done)return;this.done=!0,this.parser=null,this.handleCallback(null)}onerror(error){this.handleCallback(error)}onclosetag(){this.lastNode=null;let elem=this.tagStack.pop();if(this.options.withEndIndices)elem.endIndex=this.parser.endIndex;if(this.elementCB)this.elementCB(elem)}onopentag(name,attribs){let type=this.options.xmlMode?ElementType.Tag:void 0,element=new Element(name,attribs,void 0,type);this.addNode(element),this.tagStack.push(element)}ontext(data){let{lastNode}=this;if(lastNode&&lastNode.type===ElementType.Text){if(lastNode.data+=data,this.options.withEndIndices)lastNode.endIndex=this.parser.endIndex}else{let node2=new Text2(data);this.addNode(node2),this.lastNode=node2}}oncomment(data){if(this.lastNode&&this.lastNode.type===ElementType.Comment){this.lastNode.data+=data;return}let node2=new Comment2(data);this.addNode(node2),this.lastNode=node2}oncommentend(){this.lastNode=null}oncdatastart(){let text=new Text2(""),node2=new CDATA2([text]);this.addNode(node2),text.parent=node2,this.lastNode=text}oncdataend(){this.lastNode=null}onprocessinginstruction(name,data){let node2=new ProcessingInstruction(name,data);this.addNode(node2)}handleCallback(error){if(typeof this.callback==="function")this.callback(error,this.dom);else if(error)throw error}addNode(node2){let parent=this.tagStack[this.tagStack.length-1],previousSibling=parent.children[parent.children.length-1];if(this.options.withStartIndices)node2.startIndex=this.parser.startIndex;if(this.options.withEndIndices)node2.endIndex=this.parser.endIndex;if(parent.children.push(node2),previousSibling)node2.prev=previousSibling,previousSibling.next=node2;node2.parent=parent,this.lastNode=null}}var exports_esm2={};__export(exports_esm2,{DocumentPosition:()=>DocumentPosition,append:()=>append,appendChild:()=>appendChild,compareDocumentPosition:()=>compareDocumentPosition,existsOne:()=>existsOne,filter:()=>filter,find:()=>find,findAll:()=>findAll,findOne:()=>findOne,findOneChild:()=>findOneChild,getAttributeValue:()=>getAttributeValue,getChildren:()=>getChildren,getElementById:()=>getElementById,getElements:()=>getElements,getElementsByClassName:()=>getElementsByClassName,getElementsByTagName:()=>getElementsByTagName,getElementsByTagType:()=>getElementsByTagType,getFeed:()=>getFeed,getInnerHTML:()=>getInnerHTML,getName:()=>getName,getOuterHTML:()=>getOuterHTML,getParent:()=>getParent,getSiblings:()=>getSiblings,getText:()=>getText,hasAttrib:()=>hasAttrib,hasChildren:()=>hasChildren,innerText:()=>innerText,isCDATA:()=>isCDATA,isComment:()=>isComment,isDocument:()=>isDocument,isTag:()=>isTag2,isText:()=>isText,nextElementSibling:()=>nextElementSibling,prepend:()=>prepend,prependChild:()=>prependChild,prevElementSibling:()=>prevElementSibling,removeElement:()=>removeElement,removeSubsets:()=>removeSubsets,replaceElement:()=>replaceElement,testElement:()=>testElement,textContent:()=>textContent,uniqueSort:()=>uniqueSort});var xmlReplacer=/["&'<>$\x80-\uFFFF]/g,xmlCodeMap=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),getCodePoint=String.prototype.codePointAt!=null?(str,index)=>str.codePointAt(index):(c,index)=>(c.charCodeAt(index)&64512)===55296?(c.charCodeAt(index)-55296)*1024+c.charCodeAt(index+1)-56320+65536:c.charCodeAt(index);function encodeXML(str){let ret="",lastIdx=0,match;while((match=xmlReplacer.exec(str))!==null){let i=match.index,char=str.charCodeAt(i),next=xmlCodeMap.get(char);if(next!==void 0)ret+=str.substring(lastIdx,i)+next,lastIdx=i+1;else ret+=`${str.substring(lastIdx,i)}&#x${getCodePoint(str,i).toString(16)};`,lastIdx=xmlReplacer.lastIndex+=Number((char&64512)===55296)}return ret+str.substr(lastIdx)}function getEscaper(regex,map){return function(data){let match,lastIdx=0,result="";while(match=regex.exec(data)){if(lastIdx!==match.index)result+=data.substring(lastIdx,match.index);result+=map.get(match[0].charCodeAt(0)),lastIdx=match.index+1}return result+data.substring(lastIdx)}}var escapeUTF8=getEscaper(/[&<>'"]/g,xmlCodeMap),escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var EntityLevel;(function(EntityLevel){EntityLevel[EntityLevel.XML=0]="XML",EntityLevel[EntityLevel.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));var EncodingMode;(function(EncodingMode){EncodingMode[EncodingMode.UTF8=0]="UTF8",EncodingMode[EncodingMode.ASCII=1]="ASCII",EncodingMode[EncodingMode.Extensive=2]="Extensive",EncodingMode[EncodingMode.Attribute=3]="Attribute",EncodingMode[EncodingMode.Text=4]="Text"})(EncodingMode||(EncodingMode={}));var elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((val)=>[val.toLowerCase(),val])),attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((val)=>[val.toLowerCase(),val]));var unencodedElements=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function replaceQuotes(value){return value.replace(/"/g,""")}function formatAttributes(attributes,opts){var _a;if(!attributes)return;let encode=((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)===!1?replaceQuotes:opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML:escapeAttribute;return Object.keys(attributes).map((key)=>{var _a,_b;let value=(_a=attributes[key])!==null&&_a!==void 0?_a:"";if(opts.xmlMode==="foreign")key=(_b=attributeNames.get(key))!==null&&_b!==void 0?_b:key;if(!opts.emptyAttrs&&!opts.xmlMode&&value==="")return key;return`${key}="${encode(value)}"`}).join(" ")}var singleTag=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function render(node,options={}){let nodes="length"in node?node:[node],output="";for(let i=0;i<nodes.length;i++)output+=renderNode(nodes[i],options);return output}var esm_default=render;function renderNode(node,options){switch(node.type){case Root:return render(node.children,options);case Doctype:case Directive:return renderDirective(node);case Comment:return renderComment(node);case CDATA:return renderCdata(node);case Script:case Style:case Tag:return renderTag(node,options);case Text:return renderText(node,options)}}var foreignModeIntegrationPoints=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),foreignElements=new Set(["svg","math"]);function renderTag(elem,opts){var _a;if(opts.xmlMode==="foreign"){if(elem.name=(_a=elementNames.get(elem.name))!==null&&_a!==void 0?_a:elem.name,elem.parent&&foreignModeIntegrationPoints.has(elem.parent.name))opts={...opts,xmlMode:!1}}if(!opts.xmlMode&&foreignElements.has(elem.name))opts={...opts,xmlMode:"foreign"};let tag=`<${elem.name}`,attribs=formatAttributes(elem.attribs,opts);if(attribs)tag+=` ${attribs}`;if(elem.children.length===0&&(opts.xmlMode?opts.selfClosingTags!==!1:opts.selfClosingTags&&singleTag.has(elem.name))){if(!opts.xmlMode)tag+=" ";tag+="/>"}else{if(tag+=">",elem.children.length>0)tag+=render(elem.children,opts);if(opts.xmlMode||!singleTag.has(elem.name))tag+=`</${elem.name}>`}return tag}function renderDirective(elem){return`<${elem.data}>`}function renderText(elem,opts){var _a;let data=elem.data||"";if(((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)!==!1&&!(!opts.xmlMode&&elem.parent&&unencodedElements.has(elem.parent.name)))data=opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML(data):escapeText(data);return data}function renderCdata(elem){return`<![CDATA[${elem.children[0].data}]]>`}function renderComment(elem){return`<!--${elem.data}-->`}function getOuterHTML(node,options){return esm_default(node,options)}function getInnerHTML(node,options){return hasChildren(node)?node.children.map((node)=>getOuterHTML(node,options)).join(""):""}function getText(node){if(Array.isArray(node))return node.map(getText).join("");if(isTag2(node))return node.name==="br"?`
|
|
2
|
+
import{createRequire}from"node:module";var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames}=Object;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,"default")?__defProp(target,"default",{value:mod,enumerable:!0}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0,configurable:!0,set:__exportSetter.bind(all,name)})};var __require=createRequire(import.meta.url);var require_canvas_shim=__commonJS(function(exports,module){class Canvas{constructor(width,height){this.width=width,this.height=height}getContext(){return null}toDataURL(){return""}}module.exports={createCanvas:(width,height)=>new Canvas(width,height)}});var require_canvas=__commonJS(function(exports,module){try{module.exports=(()=>{throw new Error("Cannot require module "+"canvas");})()}catch(fallback){module.exports=require_canvas_shim()}});import{readFileSync}from"node:fs";var CHANGED=Symbol("changed"),CLASS_LIST=Symbol("classList"),CUSTOM_ELEMENTS=Symbol("CustomElements"),CONTENT=Symbol("content"),DATASET=Symbol("dataset"),DOCTYPE=Symbol("doctype"),DOM_PARSER=Symbol("DOMParser"),END=Symbol("end"),EVENT_TARGET=Symbol("EventTarget"),GLOBALS=Symbol("globals"),IMAGE=Symbol("image"),MIME=Symbol("mime"),MUTATION_OBSERVER=Symbol("MutationObserver"),NEXT=Symbol("next"),OWNER_ELEMENT=Symbol("ownerElement"),PREV=Symbol("prev"),PRIVATE=Symbol("private"),SHEET=Symbol("sheet"),START=Symbol("start"),STYLE=Symbol("style"),UPGRADE=Symbol("upgrade"),VALUE=Symbol("value");var exports_esm3={};__export(exports_esm3,{DefaultHandler:()=>DomHandler,DomHandler:()=>DomHandler,DomUtils:()=>exports_esm2,ElementType:()=>exports_esm,Parser:()=>Parser,QuoteType:()=>QuoteType,Tokenizer:()=>Tokenizer,createDocumentStream:()=>createDocumentStream,createDomStream:()=>createDomStream,getFeed:()=>getFeed,parseDOM:()=>parseDOM,parseDocument:()=>parseDocument,parseFeed:()=>parseFeed});var _a,decodeMap=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),fromCodePoint=(_a=String.fromCodePoint)!==null&&_a!==void 0?_a:(codePoint)=>{let output="";if(codePoint>65535)codePoint-=65536,output+=String.fromCharCode(codePoint>>>10&1023|55296),codePoint=56320|codePoint&1023;return output+=String.fromCharCode(codePoint),output};function replaceCodePoint(codePoint){var _a;if(codePoint>=55296&&codePoint<=57343||codePoint>1114111)return 65533;return(_a=decodeMap.get(codePoint))!==null&&_a!==void 0?_a:codePoint}function decodeBase64(input){let binary=typeof atob==="function"?atob(input):typeof Buffer.from==="function"?Buffer.from(input,"base64").toString("binary"):new Buffer(input,"base64").toString("binary"),evenLength=binary.length&-2,out=new Uint16Array(evenLength/2);for(let index=0,outIndex=0;index<evenLength;index+=2){let lo=binary.charCodeAt(index),hi=binary.charCodeAt(index+1);out[outIndex++]=lo|hi<<8}return out}var htmlDecodeTree=decodeBase64("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW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ScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var xmlDecodeTree=decodeBase64("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var BinTrieFlags;(function(BinTrieFlags){BinTrieFlags[BinTrieFlags.VALUE_LENGTH=49152]="VALUE_LENGTH",BinTrieFlags[BinTrieFlags.FLAG13=8192]="FLAG13",BinTrieFlags[BinTrieFlags.BRANCH_LENGTH=8064]="BRANCH_LENGTH",BinTrieFlags[BinTrieFlags.JUMP_TABLE=127]="JUMP_TABLE"})(BinTrieFlags||(BinTrieFlags={}));var CharCodes;(function(CharCodes){CharCodes[CharCodes.NUM=35]="NUM",CharCodes[CharCodes.SEMI=59]="SEMI",CharCodes[CharCodes.EQUALS=61]="EQUALS",CharCodes[CharCodes.ZERO=48]="ZERO",CharCodes[CharCodes.NINE=57]="NINE",CharCodes[CharCodes.LOWER_A=97]="LOWER_A",CharCodes[CharCodes.LOWER_F=102]="LOWER_F",CharCodes[CharCodes.LOWER_X=120]="LOWER_X",CharCodes[CharCodes.LOWER_Z=122]="LOWER_Z",CharCodes[CharCodes.UPPER_A=65]="UPPER_A",CharCodes[CharCodes.UPPER_F=70]="UPPER_F",CharCodes[CharCodes.UPPER_Z=90]="UPPER_Z"})(CharCodes||(CharCodes={}));var TO_LOWER_BIT=32;function isNumber(code){return code>=CharCodes.ZERO&&code<=CharCodes.NINE}function isHexadecimalCharacter(code){return code>=CharCodes.UPPER_A&&code<=CharCodes.UPPER_F||code>=CharCodes.LOWER_A&&code<=CharCodes.LOWER_F}function isAsciiAlphaNumeric(code){return code>=CharCodes.UPPER_A&&code<=CharCodes.UPPER_Z||code>=CharCodes.LOWER_A&&code<=CharCodes.LOWER_Z||isNumber(code)}function isEntityInAttributeInvalidEnd(code){return code===CharCodes.EQUALS||isAsciiAlphaNumeric(code)}var EntityDecoderState;(function(EntityDecoderState){EntityDecoderState[EntityDecoderState.EntityStart=0]="EntityStart",EntityDecoderState[EntityDecoderState.NumericStart=1]="NumericStart",EntityDecoderState[EntityDecoderState.NumericDecimal=2]="NumericDecimal",EntityDecoderState[EntityDecoderState.NumericHex=3]="NumericHex",EntityDecoderState[EntityDecoderState.NamedEntity=4]="NamedEntity"})(EntityDecoderState||(EntityDecoderState={}));var DecodingMode;(function(DecodingMode){DecodingMode[DecodingMode.Legacy=0]="Legacy",DecodingMode[DecodingMode.Strict=1]="Strict",DecodingMode[DecodingMode.Attribute=2]="Attribute"})(DecodingMode||(DecodingMode={}));class EntityDecoder{constructor(decodeTree,emitCodePoint,errors){this.decodeTree=decodeTree,this.emitCodePoint=emitCodePoint,this.errors=errors,this.state=EntityDecoderState.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=DecodingMode.Strict,this.runConsumed=0}startEntity(decodeMode){this.decodeMode=decodeMode,this.state=EntityDecoderState.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(input,offset){switch(this.state){case EntityDecoderState.EntityStart:{if(input.charCodeAt(offset)===CharCodes.NUM)return this.state=EntityDecoderState.NumericStart,this.consumed+=1,this.stateNumericStart(input,offset+1);return this.state=EntityDecoderState.NamedEntity,this.stateNamedEntity(input,offset)}case EntityDecoderState.NumericStart:return this.stateNumericStart(input,offset);case EntityDecoderState.NumericDecimal:return this.stateNumericDecimal(input,offset);case EntityDecoderState.NumericHex:return this.stateNumericHex(input,offset);case EntityDecoderState.NamedEntity:return this.stateNamedEntity(input,offset)}}stateNumericStart(input,offset){if(offset>=input.length)return-1;if((input.charCodeAt(offset)|TO_LOWER_BIT)===CharCodes.LOWER_X)return this.state=EntityDecoderState.NumericHex,this.consumed+=1,this.stateNumericHex(input,offset+1);return this.state=EntityDecoderState.NumericDecimal,this.stateNumericDecimal(input,offset)}stateNumericHex(input,offset){while(offset<input.length){let char=input.charCodeAt(offset);if(isNumber(char)||isHexadecimalCharacter(char)){let digit=char<=CharCodes.NINE?char-CharCodes.ZERO:(char|TO_LOWER_BIT)-CharCodes.LOWER_A+10;this.result=this.result*16+digit,this.consumed++,offset++}else return this.emitNumericEntity(char,3)}return-1}stateNumericDecimal(input,offset){while(offset<input.length){let char=input.charCodeAt(offset);if(isNumber(char))this.result=this.result*10+(char-CharCodes.ZERO),this.consumed++,offset++;else return this.emitNumericEntity(char,2)}return-1}emitNumericEntity(lastCp,expectedLength){var _a;if(this.consumed<=expectedLength)return(_a=this.errors)===null||_a===void 0||_a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(lastCp===CharCodes.SEMI)this.consumed+=1;else if(this.decodeMode===DecodingMode.Strict)return 0;if(this.emitCodePoint(replaceCodePoint(this.result),this.consumed),this.errors){if(lastCp!==CharCodes.SEMI)this.errors.missingSemicolonAfterCharacterReference();this.errors.validateNumericCharacterReference(this.result)}return this.consumed}stateNamedEntity(input,offset){let{decodeTree}=this,current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14;while(offset<input.length){if(valueLength===0&&(current&BinTrieFlags.FLAG13)!==0){let runLength=(current&BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let firstChar=current&BinTrieFlags.JUMP_TABLE;if(input.charCodeAt(offset)!==firstChar)return this.result===0?0:this.emitNotTerminatedNamedEntity();offset++,this.excess++,this.runConsumed++}while(this.runConsumed<runLength){if(offset>=input.length)return-1;let charIndexInPacked=this.runConsumed-1,packedWord=decodeTree[this.treeIndex+1+(charIndexInPacked>>1)],expectedChar=charIndexInPacked%2===0?packedWord&255:packedWord>>8&255;if(input.charCodeAt(offset)!==expectedChar)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();offset++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(runLength>>1),current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14}if(offset>=input.length)break;let char=input.charCodeAt(offset);if(char===CharCodes.SEMI&&valueLength!==0&&(current&BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,valueLength,this.consumed+this.excess);if(this.treeIndex=determineBranch(decodeTree,current,this.treeIndex+Math.max(1,valueLength),char),this.treeIndex<0)return this.result===0||this.decodeMode===DecodingMode.Attribute&&(valueLength===0||isEntityInAttributeInvalidEnd(char))?0:this.emitNotTerminatedNamedEntity();if(current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14,valueLength!==0){if(char===CharCodes.SEMI)return this.emitNamedEntityData(this.treeIndex,valueLength,this.consumed+this.excess);if(this.decodeMode!==DecodingMode.Strict&&(current&BinTrieFlags.FLAG13)===0)this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0}offset++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var _a;let{result,decodeTree}=this,valueLength=(decodeTree[result]&BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData(result,valueLength,this.consumed),(_a=this.errors)===null||_a===void 0||_a.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(result,valueLength,consumed){let{decodeTree}=this;if(this.emitCodePoint(valueLength===1?decodeTree[result]&~(BinTrieFlags.VALUE_LENGTH|BinTrieFlags.FLAG13):decodeTree[result+1],consumed),valueLength===3)this.emitCodePoint(decodeTree[result+2],consumed);return consumed}end(){var _a;switch(this.state){case EntityDecoderState.NamedEntity:return this.result!==0&&(this.decodeMode!==DecodingMode.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case EntityDecoderState.NumericDecimal:return this.emitNumericEntity(0,2);case EntityDecoderState.NumericHex:return this.emitNumericEntity(0,3);case EntityDecoderState.NumericStart:return(_a=this.errors)===null||_a===void 0||_a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case EntityDecoderState.EntityStart:return 0}}}function determineBranch(decodeTree,current,nodeIndex,char){let branchCount=(current&BinTrieFlags.BRANCH_LENGTH)>>7,jumpOffset=current&BinTrieFlags.JUMP_TABLE;if(branchCount===0)return jumpOffset!==0&&char===jumpOffset?nodeIndex:-1;if(jumpOffset){let value=char-jumpOffset;return value<0||value>=branchCount?-1:decodeTree[nodeIndex+value]-1}let packedKeySlots=branchCount+1>>1,lo=0,hi=branchCount-1;while(lo<=hi){let mid=lo+hi>>>1,slot=mid>>1,midKey=decodeTree[nodeIndex+slot]>>(mid&1)*8&255;if(midKey<char)lo=mid+1;else if(midKey>char)hi=mid-1;else return decodeTree[nodeIndex+packedKeySlots+mid]}return-1}var CharCodes2;(function(CharCodes){CharCodes[CharCodes.Tab=9]="Tab",CharCodes[CharCodes.NewLine=10]="NewLine",CharCodes[CharCodes.FormFeed=12]="FormFeed",CharCodes[CharCodes.CarriageReturn=13]="CarriageReturn",CharCodes[CharCodes.Space=32]="Space",CharCodes[CharCodes.ExclamationMark=33]="ExclamationMark",CharCodes[CharCodes.Number=35]="Number",CharCodes[CharCodes.Amp=38]="Amp",CharCodes[CharCodes.SingleQuote=39]="SingleQuote",CharCodes[CharCodes.DoubleQuote=34]="DoubleQuote",CharCodes[CharCodes.Dash=45]="Dash",CharCodes[CharCodes.Slash=47]="Slash",CharCodes[CharCodes.Zero=48]="Zero",CharCodes[CharCodes.Nine=57]="Nine",CharCodes[CharCodes.Semi=59]="Semi",CharCodes[CharCodes.Lt=60]="Lt",CharCodes[CharCodes.Eq=61]="Eq",CharCodes[CharCodes.Gt=62]="Gt",CharCodes[CharCodes.Questionmark=63]="Questionmark",CharCodes[CharCodes.UpperA=65]="UpperA",CharCodes[CharCodes.LowerA=97]="LowerA",CharCodes[CharCodes.UpperF=70]="UpperF",CharCodes[CharCodes.LowerF=102]="LowerF",CharCodes[CharCodes.UpperZ=90]="UpperZ",CharCodes[CharCodes.LowerZ=122]="LowerZ",CharCodes[CharCodes.LowerX=120]="LowerX",CharCodes[CharCodes.OpeningSquareBracket=91]="OpeningSquareBracket"})(CharCodes2||(CharCodes2={}));var State;(function(State){State[State.Text=1]="Text",State[State.BeforeTagName=2]="BeforeTagName",State[State.InTagName=3]="InTagName",State[State.InSelfClosingTag=4]="InSelfClosingTag",State[State.BeforeClosingTagName=5]="BeforeClosingTagName",State[State.InClosingTagName=6]="InClosingTagName",State[State.AfterClosingTagName=7]="AfterClosingTagName",State[State.BeforeAttributeName=8]="BeforeAttributeName",State[State.InAttributeName=9]="InAttributeName",State[State.AfterAttributeName=10]="AfterAttributeName",State[State.BeforeAttributeValue=11]="BeforeAttributeValue",State[State.InAttributeValueDq=12]="InAttributeValueDq",State[State.InAttributeValueSq=13]="InAttributeValueSq",State[State.InAttributeValueNq=14]="InAttributeValueNq",State[State.BeforeDeclaration=15]="BeforeDeclaration",State[State.InDeclaration=16]="InDeclaration",State[State.InProcessingInstruction=17]="InProcessingInstruction",State[State.BeforeComment=18]="BeforeComment",State[State.CDATASequence=19]="CDATASequence",State[State.InSpecialComment=20]="InSpecialComment",State[State.InCommentLike=21]="InCommentLike",State[State.BeforeSpecialS=22]="BeforeSpecialS",State[State.BeforeSpecialT=23]="BeforeSpecialT",State[State.SpecialStartSequence=24]="SpecialStartSequence",State[State.InSpecialTag=25]="InSpecialTag",State[State.InEntity=26]="InEntity"})(State||(State={}));function isWhitespace(c){return c===CharCodes2.Space||c===CharCodes2.NewLine||c===CharCodes2.Tab||c===CharCodes2.FormFeed||c===CharCodes2.CarriageReturn}function isEndOfTagSection(c){return c===CharCodes2.Slash||c===CharCodes2.Gt||isWhitespace(c)}function isASCIIAlpha(c){return c>=CharCodes2.LowerA&&c<=CharCodes2.LowerZ||c>=CharCodes2.UpperA&&c<=CharCodes2.UpperZ}var QuoteType;(function(QuoteType){QuoteType[QuoteType.NoValue=0]="NoValue",QuoteType[QuoteType.Unquoted=1]="Unquoted",QuoteType[QuoteType.Single=2]="Single",QuoteType[QuoteType.Double=3]="Double"})(QuoteType||(QuoteType={}));var Sequences={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};class Tokenizer{constructor({xmlMode=!1,decodeEntities=!0},cbs){this.cbs=cbs,this.state=State.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=State.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=xmlMode,this.decodeEntities=decodeEntities,this.entityDecoder=new EntityDecoder(xmlMode?xmlDecodeTree:htmlDecodeTree,(cp,consumed)=>this.emitCodePoint(cp,consumed))}reset(){this.state=State.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=State.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(chunk){this.offset+=this.buffer.length,this.buffer=chunk,this.parse()}end(){if(this.running)this.finish()}pause(){this.running=!1}resume(){if(this.running=!0,this.index<this.buffer.length+this.offset)this.parse()}stateText(c){if(c===CharCodes2.Lt||!this.decodeEntities&&this.fastForwardTo(CharCodes2.Lt)){if(this.index>this.sectionStart)this.cbs.ontext(this.sectionStart,this.index);this.state=State.BeforeTagName,this.sectionStart=this.index}else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateSpecialStartSequence(c){let isEnd=this.sequenceIndex===this.currentSequence.length;if(!(isEnd?isEndOfTagSection(c):(c|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!isEnd){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=State.InTagName,this.stateInTagName(c)}stateInSpecialTag(c){if(this.sequenceIndex===this.currentSequence.length){if(c===CharCodes2.Gt||isWhitespace(c)){let endOfText=this.index-this.currentSequence.length;if(this.sectionStart<endOfText){let actualIndex=this.index;this.index=endOfText,this.cbs.ontext(this.sectionStart,endOfText),this.index=actualIndex}this.isSpecial=!1,this.sectionStart=endOfText+2,this.stateInClosingTagName(c);return}this.sequenceIndex=0}if((c|32)===this.currentSequence[this.sequenceIndex])this.sequenceIndex+=1;else if(this.sequenceIndex===0){if(this.currentSequence===Sequences.TitleEnd){if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}else if(this.fastForwardTo(CharCodes2.Lt))this.sequenceIndex=1}else this.sequenceIndex=Number(c===CharCodes2.Lt)}stateCDATASequence(c){if(c===Sequences.Cdata[this.sequenceIndex]){if(++this.sequenceIndex===Sequences.Cdata.length)this.state=State.InCommentLike,this.currentSequence=Sequences.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1}else this.sequenceIndex=0,this.state=State.InDeclaration,this.stateInDeclaration(c)}fastForwardTo(c){while(++this.index<this.buffer.length+this.offset)if(this.buffer.charCodeAt(this.index-this.offset)===c)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(c){if(c===this.currentSequence[this.sequenceIndex]){if(++this.sequenceIndex===this.currentSequence.length){if(this.currentSequence===Sequences.CdataEnd)this.cbs.oncdata(this.sectionStart,this.index,2);else this.cbs.oncomment(this.sectionStart,this.index,2);this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=State.Text}}else if(this.sequenceIndex===0){if(this.fastForwardTo(this.currentSequence[0]))this.sequenceIndex=1}else if(c!==this.currentSequence[this.sequenceIndex-1])this.sequenceIndex=0}isTagStartChar(c){return this.xmlMode?!isEndOfTagSection(c):isASCIIAlpha(c)}startSpecial(sequence,offset){this.isSpecial=!0,this.currentSequence=sequence,this.sequenceIndex=offset,this.state=State.SpecialStartSequence}stateBeforeTagName(c){if(c===CharCodes2.ExclamationMark)this.state=State.BeforeDeclaration,this.sectionStart=this.index+1;else if(c===CharCodes2.Questionmark)this.state=State.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(c)){let lower=c|32;if(this.sectionStart=this.index,this.xmlMode)this.state=State.InTagName;else if(lower===Sequences.ScriptEnd[2])this.state=State.BeforeSpecialS;else if(lower===Sequences.TitleEnd[2]||lower===Sequences.XmpEnd[2])this.state=State.BeforeSpecialT;else this.state=State.InTagName}else if(c===CharCodes2.Slash)this.state=State.BeforeClosingTagName;else this.state=State.Text,this.stateText(c)}stateInTagName(c){if(isEndOfTagSection(c))this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c)}stateBeforeClosingTagName(c){if(isWhitespace(c));else if(c===CharCodes2.Gt)this.state=State.Text;else this.state=this.isTagStartChar(c)?State.InClosingTagName:State.InSpecialComment,this.sectionStart=this.index}stateInClosingTagName(c){if(c===CharCodes2.Gt||isWhitespace(c))this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=State.AfterClosingTagName,this.stateAfterClosingTagName(c)}stateAfterClosingTagName(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.state=State.Text,this.sectionStart=this.index+1}stateBeforeAttributeName(c){if(c===CharCodes2.Gt){if(this.cbs.onopentagend(this.index),this.isSpecial)this.state=State.InSpecialTag,this.sequenceIndex=0;else this.state=State.Text;this.sectionStart=this.index+1}else if(c===CharCodes2.Slash)this.state=State.InSelfClosingTag;else if(!isWhitespace(c))this.state=State.InAttributeName,this.sectionStart=this.index}stateInSelfClosingTag(c){if(c===CharCodes2.Gt)this.cbs.onselfclosingtag(this.index),this.state=State.Text,this.sectionStart=this.index+1,this.isSpecial=!1;else if(!isWhitespace(c))this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c)}stateInAttributeName(c){if(c===CharCodes2.Eq||isEndOfTagSection(c))this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=State.AfterAttributeName,this.stateAfterAttributeName(c)}stateAfterAttributeName(c){if(c===CharCodes2.Eq)this.state=State.BeforeAttributeValue;else if(c===CharCodes2.Slash||c===CharCodes2.Gt)this.cbs.onattribend(QuoteType.NoValue,this.sectionStart),this.sectionStart=-1,this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c);else if(!isWhitespace(c))this.cbs.onattribend(QuoteType.NoValue,this.sectionStart),this.state=State.InAttributeName,this.sectionStart=this.index}stateBeforeAttributeValue(c){if(c===CharCodes2.DoubleQuote)this.state=State.InAttributeValueDq,this.sectionStart=this.index+1;else if(c===CharCodes2.SingleQuote)this.state=State.InAttributeValueSq,this.sectionStart=this.index+1;else if(!isWhitespace(c))this.sectionStart=this.index,this.state=State.InAttributeValueNq,this.stateInAttributeValueNoQuotes(c)}handleInAttributeValue(c,quote){if(c===quote||!this.decodeEntities&&this.fastForwardTo(quote))this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(quote===CharCodes2.DoubleQuote?QuoteType.Double:QuoteType.Single,this.index+1),this.state=State.BeforeAttributeName;else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateInAttributeValueDoubleQuotes(c){this.handleInAttributeValue(c,CharCodes2.DoubleQuote)}stateInAttributeValueSingleQuotes(c){this.handleInAttributeValue(c,CharCodes2.SingleQuote)}stateInAttributeValueNoQuotes(c){if(isWhitespace(c)||c===CharCodes2.Gt)this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(QuoteType.Unquoted,this.index),this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c);else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateBeforeDeclaration(c){if(c===CharCodes2.OpeningSquareBracket)this.state=State.CDATASequence,this.sequenceIndex=0;else this.state=c===CharCodes2.Dash?State.BeforeComment:State.InDeclaration}stateInDeclaration(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.ondeclaration(this.sectionStart,this.index),this.state=State.Text,this.sectionStart=this.index+1}stateInProcessingInstruction(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=State.Text,this.sectionStart=this.index+1}stateBeforeComment(c){if(c===CharCodes2.Dash)this.state=State.InCommentLike,this.currentSequence=Sequences.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1;else this.state=State.InDeclaration}stateInSpecialComment(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.oncomment(this.sectionStart,this.index,0),this.state=State.Text,this.sectionStart=this.index+1}stateBeforeSpecialS(c){let lower=c|32;if(lower===Sequences.ScriptEnd[3])this.startSpecial(Sequences.ScriptEnd,4);else if(lower===Sequences.StyleEnd[3])this.startSpecial(Sequences.StyleEnd,4);else this.state=State.InTagName,this.stateInTagName(c)}stateBeforeSpecialT(c){switch(c|32){case Sequences.TitleEnd[3]:{this.startSpecial(Sequences.TitleEnd,4);break}case Sequences.TextareaEnd[3]:{this.startSpecial(Sequences.TextareaEnd,4);break}case Sequences.XmpEnd[3]:{this.startSpecial(Sequences.XmpEnd,4);break}default:this.state=State.InTagName,this.stateInTagName(c)}}startEntity(){this.baseState=this.state,this.state=State.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?DecodingMode.Strict:this.baseState===State.Text||this.baseState===State.InSpecialTag?DecodingMode.Legacy:DecodingMode.Attribute)}stateInEntity(){let indexInBuffer=this.index-this.offset,length=this.entityDecoder.write(this.buffer,indexInBuffer);if(length>=0){if(this.state=this.baseState,length===0)this.index-=1}else{if(indexInBuffer<this.buffer.length&&this.buffer.charCodeAt(indexInBuffer)===CharCodes2.Amp){this.state=this.baseState,this.index-=1;return}this.index=this.offset+this.buffer.length-1}}cleanup(){if(this.running&&this.sectionStart!==this.index){if(this.state===State.Text||this.state===State.InSpecialTag&&this.sequenceIndex===0)this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index;else if(this.state===State.InAttributeValueDq||this.state===State.InAttributeValueSq||this.state===State.InAttributeValueNq)this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index}}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){while(this.shouldContinue()){let c=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case State.Text:{this.stateText(c);break}case State.SpecialStartSequence:{this.stateSpecialStartSequence(c);break}case State.InSpecialTag:{this.stateInSpecialTag(c);break}case State.CDATASequence:{this.stateCDATASequence(c);break}case State.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(c);break}case State.InAttributeName:{this.stateInAttributeName(c);break}case State.InCommentLike:{this.stateInCommentLike(c);break}case State.InSpecialComment:{this.stateInSpecialComment(c);break}case State.BeforeAttributeName:{this.stateBeforeAttributeName(c);break}case State.InTagName:{this.stateInTagName(c);break}case State.InClosingTagName:{this.stateInClosingTagName(c);break}case State.BeforeTagName:{this.stateBeforeTagName(c);break}case State.AfterAttributeName:{this.stateAfterAttributeName(c);break}case State.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(c);break}case State.BeforeAttributeValue:{this.stateBeforeAttributeValue(c);break}case State.BeforeClosingTagName:{this.stateBeforeClosingTagName(c);break}case State.AfterClosingTagName:{this.stateAfterClosingTagName(c);break}case State.BeforeSpecialS:{this.stateBeforeSpecialS(c);break}case State.BeforeSpecialT:{this.stateBeforeSpecialT(c);break}case State.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(c);break}case State.InSelfClosingTag:{this.stateInSelfClosingTag(c);break}case State.InDeclaration:{this.stateInDeclaration(c);break}case State.BeforeDeclaration:{this.stateBeforeDeclaration(c);break}case State.BeforeComment:{this.stateBeforeComment(c);break}case State.InProcessingInstruction:{this.stateInProcessingInstruction(c);break}case State.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){if(this.state===State.InEntity)this.entityDecoder.end(),this.state=this.baseState;this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let endIndex=this.buffer.length+this.offset;if(this.sectionStart>=endIndex)return;if(this.state===State.InCommentLike)if(this.currentSequence===Sequences.CdataEnd)this.cbs.oncdata(this.sectionStart,endIndex,0);else this.cbs.oncomment(this.sectionStart,endIndex,0);else if(this.state===State.InTagName||this.state===State.BeforeAttributeName||this.state===State.BeforeAttributeValue||this.state===State.AfterAttributeName||this.state===State.InAttributeName||this.state===State.InAttributeValueSq||this.state===State.InAttributeValueDq||this.state===State.InAttributeValueNq||this.state===State.InClosingTagName);else this.cbs.ontext(this.sectionStart,endIndex)}emitCodePoint(cp,consumed){if(this.baseState!==State.Text&&this.baseState!==State.InSpecialTag){if(this.sectionStart<this.entityStart)this.cbs.onattribdata(this.sectionStart,this.entityStart);this.sectionStart=this.entityStart+consumed,this.index=this.sectionStart-1,this.cbs.onattribentity(cp)}else{if(this.sectionStart<this.entityStart)this.cbs.ontext(this.sectionStart,this.entityStart);this.sectionStart=this.entityStart+consumed,this.index=this.sectionStart-1,this.cbs.ontextentity(cp,this.sectionStart)}}}var formTags=new Set(["input","option","optgroup","select","button","datalist","textarea"]),pTag=new Set(["p"]),tableSectionTags=new Set(["thead","tbody"]),ddtTags=new Set(["dd","dt"]),rtpTags=new Set(["rt","rp"]),openImpliesClose=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",pTag],["h1",pTag],["h2",pTag],["h3",pTag],["h4",pTag],["h5",pTag],["h6",pTag],["select",formTags],["input",formTags],["output",formTags],["button",formTags],["datalist",formTags],["textarea",formTags],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",ddtTags],["dt",ddtTags],["address",pTag],["article",pTag],["aside",pTag],["blockquote",pTag],["details",pTag],["div",pTag],["dl",pTag],["fieldset",pTag],["figcaption",pTag],["figure",pTag],["footer",pTag],["form",pTag],["header",pTag],["hr",pTag],["main",pTag],["nav",pTag],["ol",pTag],["pre",pTag],["section",pTag],["table",pTag],["ul",pTag],["rt",rtpTags],["rp",rtpTags],["tbody",tableSectionTags],["tfoot",tableSectionTags]]),voidElements=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),foreignContextElements=new Set(["math","svg"]),htmlIntegrationElements=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),reNameEnd=/\s|\//;class Parser{constructor(cbs,options={}){var _a,_b,_c,_d,_e,_f;this.options=options,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=cbs!==null&&cbs!==void 0?cbs:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(_a=options.lowerCaseTags)!==null&&_a!==void 0?_a:this.htmlMode,this.lowerCaseAttributeNames=(_b=options.lowerCaseAttributeNames)!==null&&_b!==void 0?_b:this.htmlMode,this.recognizeSelfClosing=(_c=options.recognizeSelfClosing)!==null&&_c!==void 0?_c:!this.htmlMode,this.tokenizer=new((_d=options.Tokenizer)!==null&&_d!==void 0?_d:Tokenizer)(this.options,this),this.foreignContext=[!this.htmlMode],(_f=(_e=this.cbs).onparserinit)===null||_f===void 0||_f.call(_e,this)}ontext(start,endIndex){var _a,_b;let data=this.getSlice(start,endIndex);this.endIndex=endIndex-1,(_b=(_a=this.cbs).ontext)===null||_b===void 0||_b.call(_a,data),this.startIndex=endIndex}ontextentity(cp,endIndex){var _a,_b;this.endIndex=endIndex-1,(_b=(_a=this.cbs).ontext)===null||_b===void 0||_b.call(_a,fromCodePoint(cp)),this.startIndex=endIndex}isVoidElement(name){return this.htmlMode&&voidElements.has(name)}onopentagname(start,endIndex){this.endIndex=endIndex;let name=this.getSlice(start,endIndex);if(this.lowerCaseTagNames)name=name.toLowerCase();this.emitOpenTag(name)}emitOpenTag(name){var _a,_b,_c,_d;this.openTagStart=this.startIndex,this.tagname=name;let impliesClose=this.htmlMode&&openImpliesClose.get(name);if(impliesClose)while(this.stack.length>0&&impliesClose.has(this.stack[0])){let element=this.stack.shift();(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,element,!0)}if(!this.isVoidElement(name)){if(this.stack.unshift(name),this.htmlMode){if(foreignContextElements.has(name))this.foreignContext.unshift(!0);else if(htmlIntegrationElements.has(name))this.foreignContext.unshift(!1)}}if((_d=(_c=this.cbs).onopentagname)===null||_d===void 0||_d.call(_c,name),this.cbs.onopentag)this.attribs={}}endOpenTag(isImplied){var _a,_b;if(this.startIndex=this.openTagStart,this.attribs)(_b=(_a=this.cbs).onopentag)===null||_b===void 0||_b.call(_a,this.tagname,this.attribs,isImplied),this.attribs=null;if(this.cbs.onclosetag&&this.isVoidElement(this.tagname))this.cbs.onclosetag(this.tagname,!0);this.tagname=""}onopentagend(endIndex){this.endIndex=endIndex,this.endOpenTag(!1),this.startIndex=endIndex+1}onclosetag(start,endIndex){var _a,_b,_c,_d,_e,_f,_g,_h;this.endIndex=endIndex;let name=this.getSlice(start,endIndex);if(this.lowerCaseTagNames)name=name.toLowerCase();if(this.htmlMode&&(foreignContextElements.has(name)||htmlIntegrationElements.has(name)))this.foreignContext.shift();if(!this.isVoidElement(name)){let pos=this.stack.indexOf(name);if(pos!==-1)for(let index=0;index<=pos;index++){let element=this.stack.shift();(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,element,index!==pos)}else if(this.htmlMode&&name==="p")this.emitOpenTag("p"),this.closeCurrentTag(!0)}else if(this.htmlMode&&name==="br")(_d=(_c=this.cbs).onopentagname)===null||_d===void 0||_d.call(_c,"br"),(_f=(_e=this.cbs).onopentag)===null||_f===void 0||_f.call(_e,"br",{},!0),(_h=(_g=this.cbs).onclosetag)===null||_h===void 0||_h.call(_g,"br",!1);this.startIndex=endIndex+1}onselfclosingtag(endIndex){if(this.endIndex=endIndex,this.recognizeSelfClosing||this.foreignContext[0])this.closeCurrentTag(!1),this.startIndex=endIndex+1;else this.onopentagend(endIndex)}closeCurrentTag(isOpenImplied){var _a,_b;let name=this.tagname;if(this.endOpenTag(isOpenImplied),this.stack[0]===name)(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,name,!isOpenImplied),this.stack.shift()}onattribname(start,endIndex){this.startIndex=start;let name=this.getSlice(start,endIndex);this.attribname=this.lowerCaseAttributeNames?name.toLowerCase():name}onattribdata(start,endIndex){this.attribvalue+=this.getSlice(start,endIndex)}onattribentity(cp){this.attribvalue+=fromCodePoint(cp)}onattribend(quote,endIndex){var _a,_b;if(this.endIndex=endIndex,(_b=(_a=this.cbs).onattribute)===null||_b===void 0||_b.call(_a,this.attribname,this.attribvalue,quote===QuoteType.Double?'"':quote===QuoteType.Single?"'":quote===QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname))this.attribs[this.attribname]=this.attribvalue;this.attribvalue=""}getInstructionName(value){let index=value.search(reNameEnd),name=index<0?value:value.substr(0,index);if(this.lowerCaseTagNames)name=name.toLowerCase();return name}ondeclaration(start,endIndex){this.endIndex=endIndex;let value=this.getSlice(start,endIndex);if(this.cbs.onprocessinginstruction){let name=this.getInstructionName(value);this.cbs.onprocessinginstruction(`!${name}`,`!${value}`)}this.startIndex=endIndex+1}onprocessinginstruction(start,endIndex){this.endIndex=endIndex;let value=this.getSlice(start,endIndex);if(this.cbs.onprocessinginstruction){let name=this.getInstructionName(value);this.cbs.onprocessinginstruction(`?${name}`,`?${value}`)}this.startIndex=endIndex+1}oncomment(start,endIndex,offset){var _a,_b,_c,_d;this.endIndex=endIndex,(_b=(_a=this.cbs).oncomment)===null||_b===void 0||_b.call(_a,this.getSlice(start,endIndex-offset)),(_d=(_c=this.cbs).oncommentend)===null||_d===void 0||_d.call(_c),this.startIndex=endIndex+1}oncdata(start,endIndex,offset){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;this.endIndex=endIndex;let value=this.getSlice(start,endIndex-offset);if(!this.htmlMode||this.options.recognizeCDATA)(_b=(_a=this.cbs).oncdatastart)===null||_b===void 0||_b.call(_a),(_d=(_c=this.cbs).ontext)===null||_d===void 0||_d.call(_c,value),(_f=(_e=this.cbs).oncdataend)===null||_f===void 0||_f.call(_e);else(_h=(_g=this.cbs).oncomment)===null||_h===void 0||_h.call(_g,`[CDATA[${value}]]`),(_k=(_j=this.cbs).oncommentend)===null||_k===void 0||_k.call(_j);this.startIndex=endIndex+1}onend(){var _a,_b;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let index=0;index<this.stack.length;index++)this.cbs.onclosetag(this.stack[index],!0)}(_b=(_a=this.cbs).onend)===null||_b===void 0||_b.call(_a)}reset(){var _a,_b,_c,_d;(_b=(_a=this.cbs).onreset)===null||_b===void 0||_b.call(_a),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(_d=(_c=this.cbs).onparserinit)===null||_d===void 0||_d.call(_c,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(data){this.reset(),this.end(data)}getSlice(start,end){while(start-this.bufferOffset>=this.buffers[0].length)this.shiftBuffer();let slice=this.buffers[0].slice(start-this.bufferOffset,end-this.bufferOffset);while(end-this.bufferOffset>this.buffers[0].length)this.shiftBuffer(),slice+=this.buffers[0].slice(0,end-this.bufferOffset);return slice}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(chunk){var _a,_b;if(this.ended){(_b=(_a=this.cbs).onerror)===null||_b===void 0||_b.call(_a,Error(".write() after done!"));return}if(this.buffers.push(chunk),this.tokenizer.running)this.tokenizer.write(chunk),this.writeIndex++}end(chunk){var _a,_b;if(this.ended){(_b=(_a=this.cbs).onerror)===null||_b===void 0||_b.call(_a,Error(".end() after done!"));return}if(chunk)this.write(chunk);this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){this.tokenizer.resume();while(this.tokenizer.running&&this.writeIndex<this.buffers.length)this.tokenizer.write(this.buffers[this.writeIndex++]);if(this.ended)this.tokenizer.end()}parseChunk(chunk){this.write(chunk)}done(chunk){this.end(chunk)}}var exports_esm={};__export(exports_esm,{CDATA:()=>CDATA,Comment:()=>Comment,Directive:()=>Directive,Doctype:()=>Doctype,ElementType:()=>ElementType,Root:()=>Root,Script:()=>Script,Style:()=>Style,Tag:()=>Tag,Text:()=>Text,isTag:()=>isTag});var ElementType;(function(ElementType2){ElementType2.Root="root",ElementType2.Text="text",ElementType2.Directive="directive",ElementType2.Comment="comment",ElementType2.Script="script",ElementType2.Style="style",ElementType2.Tag="tag",ElementType2.CDATA="cdata",ElementType2.Doctype="doctype"})(ElementType||(ElementType={}));function isTag(elem){return elem.type===ElementType.Tag||elem.type===ElementType.Script||elem.type===ElementType.Style}var Root=ElementType.Root,Text=ElementType.Text,Directive=ElementType.Directive,Comment=ElementType.Comment,Script=ElementType.Script,Style=ElementType.Style,Tag=ElementType.Tag,CDATA=ElementType.CDATA,Doctype=ElementType.Doctype;class Node{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(parent){this.parent=parent}get previousSibling(){return this.prev}set previousSibling(prev){this.prev=prev}get nextSibling(){return this.next}set nextSibling(next){this.next=next}cloneNode(recursive=!1){return cloneNode(this,recursive)}}class DataNode extends Node{constructor(data){super();this.data=data}get nodeValue(){return this.data}set nodeValue(data){this.data=data}}class Text2 extends DataNode{constructor(){super(...arguments);this.type=ElementType.Text}get nodeType(){return 3}}class Comment2 extends DataNode{constructor(){super(...arguments);this.type=ElementType.Comment}get nodeType(){return 8}}class ProcessingInstruction extends DataNode{constructor(name,data){super(data);this.name=name,this.type=ElementType.Directive}get nodeType(){return 1}}class NodeWithChildren extends Node{constructor(children){super();this.children=children}get firstChild(){var _a;return(_a=this.children[0])!==null&&_a!==void 0?_a:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(children){this.children=children}}class CDATA2 extends NodeWithChildren{constructor(){super(...arguments);this.type=ElementType.CDATA}get nodeType(){return 4}}class Document extends NodeWithChildren{constructor(){super(...arguments);this.type=ElementType.Root}get nodeType(){return 9}}class Element extends NodeWithChildren{constructor(name,attribs,children=[],type=name==="script"?ElementType.Script:name==="style"?ElementType.Style:ElementType.Tag){super(children);this.name=name,this.attribs=attribs,this.type=type}get nodeType(){return 1}get tagName(){return this.name}set tagName(name){this.name=name}get attributes(){return Object.keys(this.attribs).map((name)=>{var _a,_b;return{name,value:this.attribs[name],namespace:(_a=this["x-attribsNamespace"])===null||_a===void 0?void 0:_a[name],prefix:(_b=this["x-attribsPrefix"])===null||_b===void 0?void 0:_b[name]}})}}function isTag2(node){return isTag(node)}function isCDATA(node){return node.type===ElementType.CDATA}function isText(node){return node.type===ElementType.Text}function isComment(node){return node.type===ElementType.Comment}function isDirective(node){return node.type===ElementType.Directive}function isDocument(node){return node.type===ElementType.Root}function hasChildren(node){return Object.prototype.hasOwnProperty.call(node,"children")}function cloneNode(node,recursive=!1){let result;if(isText(node))result=new Text2(node.data);else if(isComment(node))result=new Comment2(node.data);else if(isTag2(node)){let children=recursive?cloneChildren(node.children):[],clone=new Element(node.name,{...node.attribs},children);if(children.forEach((child)=>child.parent=clone),node.namespace!=null)clone.namespace=node.namespace;if(node["x-attribsNamespace"])clone["x-attribsNamespace"]={...node["x-attribsNamespace"]};if(node["x-attribsPrefix"])clone["x-attribsPrefix"]={...node["x-attribsPrefix"]};result=clone}else if(isCDATA(node)){let children=recursive?cloneChildren(node.children):[],clone=new CDATA2(children);children.forEach((child)=>child.parent=clone),result=clone}else if(isDocument(node)){let children=recursive?cloneChildren(node.children):[],clone=new Document(children);if(children.forEach((child)=>child.parent=clone),node["x-mode"])clone["x-mode"]=node["x-mode"];result=clone}else if(isDirective(node)){let instruction=new ProcessingInstruction(node.name,node.data);if(node["x-name"]!=null)instruction["x-name"]=node["x-name"],instruction["x-publicId"]=node["x-publicId"],instruction["x-systemId"]=node["x-systemId"];result=instruction}else throw Error(`Not implemented yet: ${node.type}`);if(result.startIndex=node.startIndex,result.endIndex=node.endIndex,node.sourceCodeLocation!=null)result.sourceCodeLocation=node.sourceCodeLocation;return result}function cloneChildren(childs){let children=childs.map((child)=>cloneNode(child,!0));for(let i=1;i<children.length;i++)children[i].prev=children[i-1],children[i-1].next=children[i];return children}var defaultOpts={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class DomHandler{constructor(callback,options,elementCB){if(this.dom=[],this.root=new Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof options==="function")elementCB=options,options=defaultOpts;if(typeof callback==="object")options=callback,callback=void 0;this.callback=callback!==null&&callback!==void 0?callback:null,this.options=options!==null&&options!==void 0?options:defaultOpts,this.elementCB=elementCB!==null&&elementCB!==void 0?elementCB:null}onparserinit(parser){this.parser=parser}onreset(){this.dom=[],this.root=new Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){if(this.done)return;this.done=!0,this.parser=null,this.handleCallback(null)}onerror(error){this.handleCallback(error)}onclosetag(){this.lastNode=null;let elem=this.tagStack.pop();if(this.options.withEndIndices)elem.endIndex=this.parser.endIndex;if(this.elementCB)this.elementCB(elem)}onopentag(name,attribs){let type=this.options.xmlMode?ElementType.Tag:void 0,element=new Element(name,attribs,void 0,type);this.addNode(element),this.tagStack.push(element)}ontext(data){let{lastNode}=this;if(lastNode&&lastNode.type===ElementType.Text){if(lastNode.data+=data,this.options.withEndIndices)lastNode.endIndex=this.parser.endIndex}else{let node2=new Text2(data);this.addNode(node2),this.lastNode=node2}}oncomment(data){if(this.lastNode&&this.lastNode.type===ElementType.Comment){this.lastNode.data+=data;return}let node2=new Comment2(data);this.addNode(node2),this.lastNode=node2}oncommentend(){this.lastNode=null}oncdatastart(){let text=new Text2(""),node2=new CDATA2([text]);this.addNode(node2),text.parent=node2,this.lastNode=text}oncdataend(){this.lastNode=null}onprocessinginstruction(name,data){let node2=new ProcessingInstruction(name,data);this.addNode(node2)}handleCallback(error){if(typeof this.callback==="function")this.callback(error,this.dom);else if(error)throw error}addNode(node2){let parent=this.tagStack[this.tagStack.length-1],previousSibling=parent.children[parent.children.length-1];if(this.options.withStartIndices)node2.startIndex=this.parser.startIndex;if(this.options.withEndIndices)node2.endIndex=this.parser.endIndex;if(parent.children.push(node2),previousSibling)node2.prev=previousSibling,previousSibling.next=node2;node2.parent=parent,this.lastNode=null}}var exports_esm2={};__export(exports_esm2,{DocumentPosition:()=>DocumentPosition,append:()=>append,appendChild:()=>appendChild,compareDocumentPosition:()=>compareDocumentPosition,existsOne:()=>existsOne,filter:()=>filter,find:()=>find,findAll:()=>findAll,findOne:()=>findOne,findOneChild:()=>findOneChild,getAttributeValue:()=>getAttributeValue,getChildren:()=>getChildren,getElementById:()=>getElementById,getElements:()=>getElements,getElementsByClassName:()=>getElementsByClassName,getElementsByTagName:()=>getElementsByTagName,getElementsByTagType:()=>getElementsByTagType,getFeed:()=>getFeed,getInnerHTML:()=>getInnerHTML,getName:()=>getName,getOuterHTML:()=>getOuterHTML,getParent:()=>getParent,getSiblings:()=>getSiblings,getText:()=>getText,hasAttrib:()=>hasAttrib,hasChildren:()=>hasChildren,innerText:()=>innerText,isCDATA:()=>isCDATA,isComment:()=>isComment,isDocument:()=>isDocument,isTag:()=>isTag2,isText:()=>isText,nextElementSibling:()=>nextElementSibling,prepend:()=>prepend,prependChild:()=>prependChild,prevElementSibling:()=>prevElementSibling,removeElement:()=>removeElement,removeSubsets:()=>removeSubsets,replaceElement:()=>replaceElement,testElement:()=>testElement,textContent:()=>textContent,uniqueSort:()=>uniqueSort});var xmlReplacer=/["&'<>$\x80-\uFFFF]/g,xmlCodeMap=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),getCodePoint=String.prototype.codePointAt!=null?(str,index)=>str.codePointAt(index):(c,index)=>(c.charCodeAt(index)&64512)===55296?(c.charCodeAt(index)-55296)*1024+c.charCodeAt(index+1)-56320+65536:c.charCodeAt(index);function encodeXML(str){let ret="",lastIdx=0,match;while((match=xmlReplacer.exec(str))!==null){let i=match.index,char=str.charCodeAt(i),next=xmlCodeMap.get(char);if(next!==void 0)ret+=str.substring(lastIdx,i)+next,lastIdx=i+1;else ret+=`${str.substring(lastIdx,i)}&#x${getCodePoint(str,i).toString(16)};`,lastIdx=xmlReplacer.lastIndex+=Number((char&64512)===55296)}return ret+str.substr(lastIdx)}function getEscaper(regex,map){return function(data){let match,lastIdx=0,result="";while(match=regex.exec(data)){if(lastIdx!==match.index)result+=data.substring(lastIdx,match.index);result+=map.get(match[0].charCodeAt(0)),lastIdx=match.index+1}return result+data.substring(lastIdx)}}var escapeUTF8=getEscaper(/[&<>'"]/g,xmlCodeMap),escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var EntityLevel;(function(EntityLevel){EntityLevel[EntityLevel.XML=0]="XML",EntityLevel[EntityLevel.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));var EncodingMode;(function(EncodingMode){EncodingMode[EncodingMode.UTF8=0]="UTF8",EncodingMode[EncodingMode.ASCII=1]="ASCII",EncodingMode[EncodingMode.Extensive=2]="Extensive",EncodingMode[EncodingMode.Attribute=3]="Attribute",EncodingMode[EncodingMode.Text=4]="Text"})(EncodingMode||(EncodingMode={}));var elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((val)=>[val.toLowerCase(),val])),attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((val)=>[val.toLowerCase(),val]));var unencodedElements=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function replaceQuotes(value){return value.replace(/"/g,""")}function formatAttributes(attributes,opts){var _a;if(!attributes)return;let encode=((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)===!1?replaceQuotes:opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML:escapeAttribute;return Object.keys(attributes).map((key)=>{var _a,_b;let value=(_a=attributes[key])!==null&&_a!==void 0?_a:"";if(opts.xmlMode==="foreign")key=(_b=attributeNames.get(key))!==null&&_b!==void 0?_b:key;if(!opts.emptyAttrs&&!opts.xmlMode&&value==="")return key;return`${key}="${encode(value)}"`}).join(" ")}var singleTag=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function render(node,options={}){let nodes="length"in node?node:[node],output="";for(let i=0;i<nodes.length;i++)output+=renderNode(nodes[i],options);return output}var esm_default=render;function renderNode(node,options){switch(node.type){case Root:return render(node.children,options);case Doctype:case Directive:return renderDirective(node);case Comment:return renderComment(node);case CDATA:return renderCdata(node);case Script:case Style:case Tag:return renderTag(node,options);case Text:return renderText(node,options)}}var foreignModeIntegrationPoints=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),foreignElements=new Set(["svg","math"]);function renderTag(elem,opts){var _a;if(opts.xmlMode==="foreign"){if(elem.name=(_a=elementNames.get(elem.name))!==null&&_a!==void 0?_a:elem.name,elem.parent&&foreignModeIntegrationPoints.has(elem.parent.name))opts={...opts,xmlMode:!1}}if(!opts.xmlMode&&foreignElements.has(elem.name))opts={...opts,xmlMode:"foreign"};let tag=`<${elem.name}`,attribs=formatAttributes(elem.attribs,opts);if(attribs)tag+=` ${attribs}`;if(elem.children.length===0&&(opts.xmlMode?opts.selfClosingTags!==!1:opts.selfClosingTags&&singleTag.has(elem.name))){if(!opts.xmlMode)tag+=" ";tag+="/>"}else{if(tag+=">",elem.children.length>0)tag+=render(elem.children,opts);if(opts.xmlMode||!singleTag.has(elem.name))tag+=`</${elem.name}>`}return tag}function renderDirective(elem){return`<${elem.data}>`}function renderText(elem,opts){var _a;let data=elem.data||"";if(((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)!==!1&&!(!opts.xmlMode&&elem.parent&&unencodedElements.has(elem.parent.name)))data=opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML(data):escapeText(data);return data}function renderCdata(elem){return`<![CDATA[${elem.children[0].data}]]>`}function renderComment(elem){return`<!--${elem.data}-->`}function getOuterHTML(node,options){return esm_default(node,options)}function getInnerHTML(node,options){return hasChildren(node)?node.children.map((node)=>getOuterHTML(node,options)).join(""):""}function getText(node){if(Array.isArray(node))return node.map(getText).join("");if(isTag2(node))return node.name==="br"?`
|
|
45
3
|
`:getText(node.children);if(isCDATA(node))return getText(node.children);if(isText(node))return node.data;return""}function textContent(node){if(Array.isArray(node))return node.map(textContent).join("");if(hasChildren(node)&&!isComment(node))return textContent(node.children);if(isText(node))return node.data;return""}function innerText(node){if(Array.isArray(node))return node.map(innerText).join("");if(hasChildren(node)&&(node.type===ElementType.Tag||isCDATA(node)))return innerText(node.children);if(isText(node))return node.data;return""}function getChildren(elem){return hasChildren(elem)?elem.children:[]}function getParent(elem){return elem.parent||null}function getSiblings(elem){let parent=getParent(elem);if(parent!=null)return getChildren(parent);let siblings=[elem],{prev,next}=elem;while(prev!=null)siblings.unshift(prev),{prev}=prev;while(next!=null)siblings.push(next),{next}=next;return siblings}function getAttributeValue(elem,name){var _a;return(_a=elem.attribs)===null||_a===void 0?void 0:_a[name]}function hasAttrib(elem,name){return elem.attribs!=null&&Object.prototype.hasOwnProperty.call(elem.attribs,name)&&elem.attribs[name]!=null}function getName(elem){return elem.name}function nextElementSibling(elem){let{next}=elem;while(next!==null&&!isTag2(next))({next}=next);return next}function prevElementSibling(elem){let{prev}=elem;while(prev!==null&&!isTag2(prev))({prev}=prev);return prev}function removeElement(elem){if(elem.prev)elem.prev.next=elem.next;if(elem.next)elem.next.prev=elem.prev;if(elem.parent){let childs=elem.parent.children,childsIndex=childs.lastIndexOf(elem);if(childsIndex>=0)childs.splice(childsIndex,1)}elem.next=null,elem.prev=null,elem.parent=null}function replaceElement(elem,replacement){let prev=replacement.prev=elem.prev;if(prev)prev.next=replacement;let next=replacement.next=elem.next;if(next)next.prev=replacement;let parent=replacement.parent=elem.parent;if(parent){let childs=parent.children;childs[childs.lastIndexOf(elem)]=replacement,elem.parent=null}}function appendChild(parent,child){if(removeElement(child),child.next=null,child.parent=parent,parent.children.push(child)>1){let sibling=parent.children[parent.children.length-2];sibling.next=child,child.prev=sibling}else child.prev=null}function append(elem,next){removeElement(next);let{parent}=elem,currNext=elem.next;if(next.next=currNext,next.prev=elem,elem.next=next,next.parent=parent,currNext){if(currNext.prev=next,parent){let childs=parent.children;childs.splice(childs.lastIndexOf(currNext),0,next)}}else if(parent)parent.children.push(next)}function prependChild(parent,child){if(removeElement(child),child.parent=parent,child.prev=null,parent.children.unshift(child)!==1){let sibling=parent.children[1];sibling.prev=child,child.next=sibling}else child.next=null}function prepend(elem,prev){removeElement(prev);let{parent}=elem;if(parent){let childs=parent.children;childs.splice(childs.indexOf(elem),0,prev)}if(elem.prev)elem.prev.next=prev;prev.parent=parent,prev.prev=elem.prev,prev.next=elem,elem.prev=prev}function filter(test,node,recurse=!0,limit=1/0){return find(test,Array.isArray(node)?node:[node],recurse,limit)}function find(test,nodes,recurse,limit){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(indexStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let elem=nodeStack[0][indexStack[0]++];if(test(elem)){if(result.push(elem),--limit<=0)return result}if(recurse&&hasChildren(elem)&&elem.children.length>0)indexStack.unshift(0),nodeStack.unshift(elem.children)}}function findOneChild(test,nodes){return nodes.find(test)}function findOne(test,nodes,recurse=!0){let searchedNodes=Array.isArray(nodes)?nodes:[nodes];for(let i=0;i<searchedNodes.length;i++){let node=searchedNodes[i];if(isTag2(node)&&test(node))return node;if(recurse&&hasChildren(node)&&node.children.length>0){let found=findOne(test,node.children,!0);if(found)return found}}return null}function existsOne(test,nodes){return(Array.isArray(nodes)?nodes:[nodes]).some((node)=>isTag2(node)&&test(node)||hasChildren(node)&&existsOne(test,node.children))}function findAll(test,nodes){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let elem=nodeStack[0][indexStack[0]++];if(isTag2(elem)&&test(elem))result.push(elem);if(hasChildren(elem)&&elem.children.length>0)indexStack.unshift(0),nodeStack.unshift(elem.children)}}var Checks={tag_name(name){if(typeof name==="function")return(elem)=>isTag2(elem)&&name(elem.name);else if(name==="*")return isTag2;return(elem)=>isTag2(elem)&&elem.name===name},tag_type(type){if(typeof type==="function")return(elem)=>type(elem.type);return(elem)=>elem.type===type},tag_contains(data){if(typeof data==="function")return(elem)=>isText(elem)&&data(elem.data);return(elem)=>isText(elem)&&elem.data===data}};function getAttribCheck(attrib,value){if(typeof value==="function")return(elem)=>isTag2(elem)&&value(elem.attribs[attrib]);return(elem)=>isTag2(elem)&&elem.attribs[attrib]===value}function combineFuncs(a,b){return(elem)=>a(elem)||b(elem)}function compileTest(options){let funcs=Object.keys(options).map((key)=>{let value=options[key];return Object.prototype.hasOwnProperty.call(Checks,key)?Checks[key](value):getAttribCheck(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){let test=compileTest(options);return test?test(node):!0}function getElements(options,nodes,recurse,limit=1/0){let test=compileTest(options);return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=!0){if(!Array.isArray(nodes))nodes=[nodes];return findOne(getAttribCheck("id",id),nodes,recurse)}function getElementsByTagName(tagName,nodes,recurse=!0,limit=1/0){return filter(Checks.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName(className,nodes,recurse=!0,limit=1/0){return filter(getAttribCheck("class",className),nodes,recurse,limit)}function getElementsByTagType(type,nodes,recurse=!0,limit=1/0){return filter(Checks.tag_type(type),nodes,recurse,limit)}function removeSubsets(nodes){let idx=nodes.length;while(--idx>=0){let node=nodes[idx];if(idx>0&&nodes.lastIndexOf(node,idx-1)>=0){nodes.splice(idx,1);continue}for(let ancestor=node.parent;ancestor;ancestor=ancestor.parent)if(nodes.includes(ancestor)){nodes.splice(idx,1);break}}return nodes}var DocumentPosition;(function(DocumentPosition){DocumentPosition[DocumentPosition.DISCONNECTED=1]="DISCONNECTED",DocumentPosition[DocumentPosition.PRECEDING=2]="PRECEDING",DocumentPosition[DocumentPosition.FOLLOWING=4]="FOLLOWING",DocumentPosition[DocumentPosition.CONTAINS=8]="CONTAINS",DocumentPosition[DocumentPosition.CONTAINED_BY=16]="CONTAINED_BY"})(DocumentPosition||(DocumentPosition={}));function compareDocumentPosition(nodeA,nodeB){let aParents=[],bParents=[];if(nodeA===nodeB)return 0;let current=hasChildren(nodeA)?nodeA:nodeA.parent;while(current)aParents.unshift(current),current=current.parent;current=hasChildren(nodeB)?nodeB:nodeB.parent;while(current)bParents.unshift(current),current=current.parent;let maxIdx=Math.min(aParents.length,bParents.length),idx=0;while(idx<maxIdx&&aParents[idx]===bParents[idx])idx++;if(idx===0)return DocumentPosition.DISCONNECTED;let sharedParent=aParents[idx-1],siblings=sharedParent.children,aSibling=aParents[idx],bSibling=bParents[idx];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB)return DocumentPosition.FOLLOWING|DocumentPosition.CONTAINED_BY;return DocumentPosition.FOLLOWING}if(sharedParent===nodeA)return DocumentPosition.PRECEDING|DocumentPosition.CONTAINS;return DocumentPosition.PRECEDING}function uniqueSort(nodes){return nodes=nodes.filter((node,i,arr)=>!arr.includes(node,i+1)),nodes.sort((a,b)=>{let relative=compareDocumentPosition(a,b);if(relative&DocumentPosition.PRECEDING)return-1;else if(relative&DocumentPosition.FOLLOWING)return 1;return 0}),nodes}function getFeed(doc){let feedRoot=getOneElement(isValidFeed,doc);return!feedRoot?null:feedRoot.name==="feed"?getAtomFeed(feedRoot):getRssFeed(feedRoot)}function getAtomFeed(feedRoot){var _a;let childs=feedRoot.children,feed={type:"atom",items:getElementsByTagName("entry",childs).map((item)=>{var _a;let{children}=item,entry={media:getMediaElements(children)};addConditionally(entry,"id","id",children),addConditionally(entry,"title","title",children);let href=(_a=getOneElement("link",children))===null||_a===void 0?void 0:_a.attribs.href;if(href)entry.link=href;let description=fetch("summary",children)||fetch("content",children);if(description)entry.description=description;let pubDate=fetch("updated",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally(feed,"id","id",childs),addConditionally(feed,"title","title",childs);let href=(_a=getOneElement("link",childs))===null||_a===void 0?void 0:_a.attribs.href;if(href)feed.link=href;addConditionally(feed,"description","subtitle",childs);let updated=fetch("updated",childs);if(updated)feed.updated=new Date(updated);return addConditionally(feed,"author","email",childs,!0),feed}function getRssFeed(feedRoot){var _a,_b;let childs=(_b=(_a=getOneElement("channel",feedRoot.children))===null||_a===void 0?void 0:_a.children)!==null&&_b!==void 0?_b:[],feed={type:feedRoot.name.substr(0,3),id:"",items:getElementsByTagName("item",feedRoot.children).map((item)=>{let{children}=item,entry={media:getMediaElements(children)};addConditionally(entry,"id","guid",children),addConditionally(entry,"title","title",children),addConditionally(entry,"link","link",children),addConditionally(entry,"description","description",children);let pubDate=fetch("pubDate",children)||fetch("dc:date",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally(feed,"title","title",childs),addConditionally(feed,"link","link",childs),addConditionally(feed,"description","description",childs);let updated=fetch("lastBuildDate",childs);if(updated)feed.updated=new Date(updated);return addConditionally(feed,"author","managingEditor",childs,!0),feed}var MEDIA_KEYS_STRING=["url","type","lang"],MEDIA_KEYS_INT=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements(where){return getElementsByTagName("media:content",where).map((elem)=>{let{attribs}=elem,media={medium:attribs.medium,isDefault:!!attribs.isDefault};for(let attrib of MEDIA_KEYS_STRING)if(attribs[attrib])media[attrib]=attribs[attrib];for(let attrib of MEDIA_KEYS_INT)if(attribs[attrib])media[attrib]=parseInt(attribs[attrib],10);if(attribs.expression)media.expression=attribs.expression;return media})}function getOneElement(tagName,node){return getElementsByTagName(tagName,node,!0,1)[0]}function fetch(tagName,where,recurse=!1){return textContent(getElementsByTagName(tagName,where,recurse,1)).trim()}function addConditionally(obj,prop,tagName,where,recurse=!1){let val=fetch(tagName,where,recurse);if(val)obj[prop]=val}function isValidFeed(value){return value==="rss"||value==="feed"||value==="rdf:RDF"}function parseDocument(data,options){let handler=new DomHandler(void 0,options);return new Parser(handler,options).end(data),handler.root}function parseDOM(data,options){return parseDocument(data,options).children}function createDocumentStream(callback,options,elementCallback){let handler=new DomHandler((error)=>callback(error,handler.root),options,elementCallback);return new Parser(handler,options)}function createDomStream(callback,options,elementCallback){let handler=new DomHandler(callback,options,elementCallback);return new Parser(handler,options)}var parseFeedDefaultOptions={xmlMode:!0};function parseFeed(feed,options=parseFeedDefaultOptions){return getFeed(parseDOM(feed,options))}var NODE_END=-1,ELEMENT_NODE=1,ATTRIBUTE_NODE=2,TEXT_NODE=3,CDATA_SECTION_NODE=4,COMMENT_NODE=8,DOCUMENT_NODE=9,DOCUMENT_TYPE_NODE=10,DOCUMENT_FRAGMENT_NODE=11,BLOCK_ELEMENTS=new Set(["ARTICLE","ASIDE","BLOCKQUOTE","BODY","BR","BUTTON","CANVAS","CAPTION","COL","COLGROUP","DD","DIV","DL","DT","EMBED","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","LI","UL","OL","P"]),SHOW_ALL=-1,SHOW_ELEMENT=1,SHOW_TEXT=4,SHOW_CDATA_SECTION=8,SHOW_COMMENT=128,DOCUMENT_POSITION_DISCONNECTED=1,DOCUMENT_POSITION_PRECEDING=2,DOCUMENT_POSITION_FOLLOWING=4,DOCUMENT_POSITION_CONTAINS=8,DOCUMENT_POSITION_CONTAINED_BY=16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,SVG_NAMESPACE="http://www.w3.org/2000/svg";var{assign,create,defineProperties,entries,getOwnPropertyDescriptors,keys,setPrototypeOf}=Object;var $String=String;var getEnd=(node)=>node.nodeType===ELEMENT_NODE?node[END]:node,ignoreCase=({ownerDocument})=>ownerDocument[MIME].ignoreCase,knownAdjacent=(prev,next)=>{prev[NEXT]=next,next[PREV]=prev},knownBoundaries=(prev,current,next)=>{knownAdjacent(prev,current),knownAdjacent(getEnd(current),next)},knownSegment=(prev,start,end,next)=>{knownAdjacent(prev,start),knownAdjacent(getEnd(end),next)},knownSiblings=(prev,current,next)=>{knownAdjacent(prev,current),knownAdjacent(current,next)},localCase=({localName,ownerDocument})=>ownerDocument[MIME].ignoreCase?localName.toUpperCase():localName,setAdjacent=(prev,next)=>{if(prev)prev[NEXT]=next;if(next)next[PREV]=prev},htmlToFragment=(ownerDocument,html)=>{let fragment=ownerDocument.createDocumentFragment(),elem=ownerDocument.createElement("");elem.innerHTML=html;let{firstChild,lastChild}=elem;if(firstChild){knownSegment(fragment,firstChild,lastChild,fragment[END]);let child=firstChild;do child.parentNode=fragment;while(child!==lastChild&&(child=getEnd(child)[NEXT]))}return fragment};var shadowRoots=new WeakMap;var reactive=!1,Classes=new WeakMap,customElements=new WeakMap,attributeChangedCallback=(element,attributeName,oldValue,newValue)=>{if(reactive&&customElements.has(element)&&element.attributeChangedCallback&&element.constructor.observedAttributes.includes(attributeName))element.attributeChangedCallback(attributeName,oldValue,newValue)},createTrigger=(method,isConnected)=>(element)=>{if(customElements.has(element)){let info=customElements.get(element);if(info.connected!==isConnected&&element.isConnected===isConnected){if(info.connected=isConnected,method in element)element[method]()}}},triggerConnected=createTrigger("connectedCallback",!0),connectedCallback=(element)=>{if(reactive){if(triggerConnected(element),shadowRoots.has(element))element=shadowRoots.get(element).shadowRoot;let{[NEXT]:next,[END]:end}=element;while(next!==end){if(next.nodeType===ELEMENT_NODE)triggerConnected(next);next=next[NEXT]}}},triggerDisconnected=createTrigger("disconnectedCallback",!1),disconnectedCallback=(element)=>{if(reactive){if(triggerDisconnected(element),shadowRoots.has(element))element=shadowRoots.get(element).shadowRoot;let{[NEXT]:next,[END]:end}=element;while(next!==end){if(next.nodeType===ELEMENT_NODE)triggerDisconnected(next);next=next[NEXT]}}};class CustomElementRegistry{constructor(ownerDocument){this.ownerDocument=ownerDocument,this.registry=new Map,this.waiting=new Map,this.active=!1}define(localName,Class,options={}){let{ownerDocument,registry,waiting}=this;if(registry.has(localName))throw Error("unable to redefine "+localName);if(Classes.has(Class))throw Error("unable to redefine the same class: "+Class);this.active=reactive=!0;let{extends:extend}=options;Classes.set(Class,{ownerDocument,options:{is:extend?localName:""},localName:extend||localName});let check=extend?(element)=>element.localName===extend&&element.getAttribute("is")===localName:(element)=>element.localName===localName;if(registry.set(localName,{Class,check}),waiting.has(localName)){for(let resolve of waiting.get(localName))resolve(Class);waiting.delete(localName)}ownerDocument.querySelectorAll(extend?`${extend}[is="${localName}"]`:localName).forEach(this.upgrade,this)}upgrade(element){if(customElements.has(element))return;let{ownerDocument,registry}=this,ce=element.getAttribute("is")||element.localName;if(registry.has(ce)){let{Class,check}=registry.get(ce);if(check(element)){let{attributes,isConnected}=element;for(let attr of attributes)element.removeAttributeNode(attr);let values=entries(element);for(let[key]of values)delete element[key];setPrototypeOf(element,Class.prototype),ownerDocument[UPGRADE]={element,values},new Class(ownerDocument,ce),customElements.set(element,{connected:isConnected});for(let attr of attributes)element.setAttributeNode(attr);if(isConnected&&element.connectedCallback)element.connectedCallback()}}}whenDefined(localName){let{registry,waiting}=this;return new Promise((resolve)=>{if(registry.has(localName))resolve(registry.get(localName).Class);else{if(!waiting.has(localName))waiting.set(localName,[]);waiting.get(localName).push(resolve)}})}get(localName){let info=this.registry.get(localName);return info&&info.Class}getName(Class){if(Classes.has(Class)){let{localName}=Classes.get(Class);return localName}return null}}var{Parser:Parser2}=exports_esm3,notParsing=!0,append2=(self,node,active)=>{let end=self[END];if(node.parentNode=self,knownBoundaries(end[PREV],node,end),active&&node.nodeType===ELEMENT_NODE)connectedCallback(node);return node},attribute=(element,end,attribute,value,active)=>{if(attribute[VALUE]=value,attribute.ownerElement=element,knownSiblings(end[PREV],attribute,end),attribute.name==="class")element.className=value;if(active)attributeChangedCallback(element,attribute.name,null,value)};var parseFromString=(document,isHTML,markupLanguage)=>{let{active,registry}=document[CUSTOM_ELEMENTS],node=document,ownerSVGElement=null,parsingCData=!1;notParsing=!1;let content=new Parser2({onprocessinginstruction(name,data){if(name.toLowerCase()==="!doctype")document.doctype=data.slice(name.length).trim()},onopentag(name,attributes){let create=!0;if(isHTML){if(ownerSVGElement)node=append2(node,document.createElementNS(SVG_NAMESPACE,name),active),node.ownerSVGElement=ownerSVGElement,create=!1;else if(name==="svg"||name==="SVG")ownerSVGElement=document.createElementNS(SVG_NAMESPACE,name),node=append2(node,ownerSVGElement,active),create=!1;else if(active){let ce=name.includes("-")?name:attributes.is||"";if(ce&®istry.has(ce)){let{Class}=registry.get(ce);node=append2(node,new Class,active),delete attributes.is,create=!1}}}if(create)node=append2(node,document.createElement(name),!1);let end=node[END];for(let name of keys(attributes))attribute(node,end,document.createAttribute(name),attributes[name],active)},oncomment(data){append2(node,document.createComment(data),active)},ontext(text){if(parsingCData)append2(node,document.createCDATASection(text),active);else append2(node,document.createTextNode(text),active)},oncdatastart(){parsingCData=!0},oncdataend(){parsingCData=!1},onclosetag(){if(isHTML&&node===ownerSVGElement)ownerSVGElement=null;node=node.parentNode}},{lowerCaseAttributeNames:!1,decodeEntities:!0,xmlMode:!isHTML});return content.write(markupLanguage),content.end(),notParsing=!0,document};var htmlClasses=new Map,registerHTMLClass=(names,Class)=>{for(let name of[].concat(names))htmlClasses.set(name,Class),htmlClasses.set(name.toUpperCase(),Class)};var loopSegment=({[NEXT]:next,[END]:end},json)=>{while(next!==end){switch(next.nodeType){case ATTRIBUTE_NODE:attrAsJSON(next,json);break;case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:characterDataAsJSON(next,json);break;case ELEMENT_NODE:elementAsJSON(next,json),next=getEnd(next);break;case DOCUMENT_TYPE_NODE:documentTypeAsJSON(next,json);break}next=next[NEXT]}let last=json.length-1,value=json[last];if(typeof value==="number"&&value<0)json[last]+=NODE_END;else json.push(NODE_END)},attrAsJSON=(attr,json)=>{json.push(ATTRIBUTE_NODE,attr.name);let value=attr[VALUE].trim();if(value)json.push(value)},characterDataAsJSON=(node,json)=>{let value=node[VALUE];if(value.trim())json.push(node.nodeType,value)},nonElementAsJSON=(node,json)=>{json.push(node.nodeType),loopSegment(node,json)},documentTypeAsJSON=({name,publicId,systemId},json)=>{if(json.push(DOCUMENT_TYPE_NODE,name),publicId)json.push(publicId);if(systemId)json.push(systemId)},elementAsJSON=(element,json)=>{json.push(ELEMENT_NODE,element.localName),loopSegment(element,json)};var createRecord=(type,target,element,addedNodes,removedNodes,attributeName,oldValue)=>({type,target,addedNodes,removedNodes,attributeName,oldValue,previousSibling:element?.previousSibling||null,nextSibling:element?.nextSibling||null}),queueAttribute=(observer,target,attributeName,attributeFilter,attributeOldValue,oldValue)=>{if(!attributeFilter||attributeFilter.includes(attributeName)){let{callback,records,scheduled}=observer;if(records.push(createRecord("attributes",target,null,[],[],attributeName,attributeOldValue?oldValue:void 0)),!scheduled)observer.scheduled=!0,Promise.resolve().then(()=>{observer.scheduled=!1,callback(records.splice(0),observer)})}},attributeChangedCallback2=(element,attributeName,oldValue)=>{let{ownerDocument}=element,{active,observers}=ownerDocument[MUTATION_OBSERVER];if(active){for(let observer of observers)for(let[target,{childList,subtree,attributes,attributeFilter,attributeOldValue}]of observer.nodes)if(childList){if(subtree&&(target===ownerDocument||target.contains(element))||!subtree&&target.children.includes(element)){queueAttribute(observer,element,attributeName,attributeFilter,attributeOldValue,oldValue);break}}else if(attributes&&target===element){queueAttribute(observer,element,attributeName,attributeFilter,attributeOldValue,oldValue);break}}},moCallback=(element,parentNode)=>{let{ownerDocument}=element,{active,observers}=ownerDocument[MUTATION_OBSERVER];if(active){for(let observer of observers)for(let[target,{subtree,childList,characterData}]of observer.nodes)if(childList){if(parentNode&&(target===parentNode||subtree&&target.contains(parentNode))||!parentNode&&(subtree&&(target===ownerDocument||target.contains(element))||!subtree&&target[characterData?"childNodes":"children"].includes(element))){let{callback,records,scheduled}=observer;if(records.push(createRecord("childList",target,element,parentNode?[]:[element],parentNode?[element]:[])),!scheduled)observer.scheduled=!0,Promise.resolve().then(()=>{observer.scheduled=!1,callback(records.splice(0),observer)});break}}}};class MutationObserverClass{constructor(ownerDocument){let observers=new Set;this.observers=observers,this.active=!1,this.class=class{constructor(callback){this.callback=callback,this.nodes=new Map,this.records=[],this.scheduled=!1}disconnect(){this.records.splice(0),this.nodes.clear(),observers.delete(this),ownerDocument[MUTATION_OBSERVER].active=!!observers.size}observe(target,options={subtree:!1,childList:!1,attributes:!1,attributeFilter:null,attributeOldValue:!1,characterData:!1}){if("attributeOldValue"in options||"attributeFilter"in options)options.attributes=!0;options.childList=!!options.childList,options.subtree=!!options.subtree,this.nodes.set(target,options),observers.add(this),ownerDocument[MUTATION_OBSERVER].active=!0}takeRecords(){return this.records.splice(0)}}}}var emptyAttributes=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","class","contenteditable","controls","default","defer","disabled","draggable","formnovalidate","hidden","id","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","style","truespeed"]),setAttribute=(element,attribute)=>{let{[VALUE]:value,name}=attribute;if(attribute.ownerElement=element,knownSiblings(element,attribute,element[NEXT]),name==="class")element.className=value;attributeChangedCallback2(element,name,null),attributeChangedCallback(element,name,null,value)},removeAttribute=(element,attribute)=>{let{[VALUE]:value,name}=attribute;if(knownAdjacent(attribute[PREV],attribute[NEXT]),attribute.ownerElement=attribute[PREV]=attribute[NEXT]=null,name==="class")element[CLASS_LIST]=null;attributeChangedCallback2(element,name,value),attributeChangedCallback(element,name,value,null)},booleanAttribute={get(element,name){return element.hasAttribute(name)},set(element,name,value){if(value)element.setAttribute(name,"");else element.removeAttribute(name)}},numericAttribute={get(element,name){return parseFloat(element.getAttribute(name)||0)},set(element,name,value){element.setAttribute(name,value)}},stringAttribute={get(element,name){return element.getAttribute(name)||""},set(element,name,value){element.setAttribute(name,value)}};var wm=new WeakMap;function dispatch(event,listener){if(typeof listener==="function")listener.call(event.target,event);else listener.handleEvent(event);return event._stopImmediatePropagationFlag}function invokeListeners({currentTarget,target}){let map=wm.get(currentTarget);if(map&&map.has(this.type)){let listeners=map.get(this.type);if(currentTarget===target)this.eventPhase=this.AT_TARGET;else this.eventPhase=this.BUBBLING_PHASE;this.currentTarget=currentTarget,this.target=target;for(let[listener,options]of listeners){if(options&&options.once)listeners.delete(listener);if(dispatch(this,listener))break}return delete this.currentTarget,delete this.target,this.cancelBubble}}class DOMEventTarget{constructor(){wm.set(this,new Map)}_getParent(){return null}addEventListener(type,listener,options){let map=wm.get(this);if(!map.has(type))map.set(type,new Map);map.get(type).set(listener,options)}removeEventListener(type,listener){let map=wm.get(this);if(map.has(type)){let listeners=map.get(type);if(listeners.delete(listener)&&!listeners.size)map.delete(type)}}dispatchEvent(event){let node=this;event.eventPhase=event.CAPTURING_PHASE;while(node){if(node.dispatchEvent)event._path.push({currentTarget:node,target:this});node=event.bubbles&&node._getParent&&node._getParent()}return event._path.some(invokeListeners,event),event._path=[],event.eventPhase=event.NONE,!event.defaultPrevented}}class NodeList extends Array{item(i){return i<this.length?this[i]:null}}var getParentNodeCount=({parentNode})=>{let count=0;while(parentNode)count++,parentNode=parentNode.parentNode;return count};class Node2 extends DOMEventTarget{static get ELEMENT_NODE(){return ELEMENT_NODE}static get ATTRIBUTE_NODE(){return ATTRIBUTE_NODE}static get TEXT_NODE(){return TEXT_NODE}static get CDATA_SECTION_NODE(){return CDATA_SECTION_NODE}static get COMMENT_NODE(){return COMMENT_NODE}static get DOCUMENT_NODE(){return DOCUMENT_NODE}static get DOCUMENT_FRAGMENT_NODE(){return DOCUMENT_FRAGMENT_NODE}static get DOCUMENT_TYPE_NODE(){return DOCUMENT_TYPE_NODE}constructor(ownerDocument,localName,nodeType){super();this.ownerDocument=ownerDocument,this.localName=localName,this.nodeType=nodeType,this.parentNode=null,this[NEXT]=null,this[PREV]=null}get ELEMENT_NODE(){return ELEMENT_NODE}get ATTRIBUTE_NODE(){return ATTRIBUTE_NODE}get TEXT_NODE(){return TEXT_NODE}get CDATA_SECTION_NODE(){return CDATA_SECTION_NODE}get COMMENT_NODE(){return COMMENT_NODE}get DOCUMENT_NODE(){return DOCUMENT_NODE}get DOCUMENT_FRAGMENT_NODE(){return DOCUMENT_FRAGMENT_NODE}get DOCUMENT_TYPE_NODE(){return DOCUMENT_TYPE_NODE}get baseURI(){let ownerDocument=this.nodeType===DOCUMENT_NODE?this:this.ownerDocument;if(ownerDocument){let base=ownerDocument.querySelector("base");if(base)return base.getAttribute("href");let{location}=ownerDocument.defaultView;if(location)return location.href}return null}get isConnected(){return!1}get nodeName(){return this.localName}get parentElement(){return null}get previousSibling(){return null}get previousElementSibling(){return null}get nextSibling(){return null}get nextElementSibling(){return null}get childNodes(){return new NodeList}get firstChild(){return null}get lastChild(){return null}get nodeValue(){return null}set nodeValue(value){}get textContent(){return null}set textContent(value){}normalize(){}cloneNode(){return null}contains(){return!1}insertBefore(newNode,referenceNode){return newNode}appendChild(child){return child}replaceChild(newChild,oldChild){return oldChild}removeChild(child){return child}toString(){return""}hasChildNodes(){return!!this.lastChild}isSameNode(node){return this===node}compareDocumentPosition(target){let result=0;if(this!==target){let self=getParentNodeCount(this),other=getParentNodeCount(target);if(self<other){if(result+=DOCUMENT_POSITION_FOLLOWING,this.contains(target))result+=DOCUMENT_POSITION_CONTAINED_BY}else if(other<self){if(result+=DOCUMENT_POSITION_PRECEDING,target.contains(this))result+=DOCUMENT_POSITION_CONTAINS}else if(self&&other){let{childNodes}=this.parentNode;if(childNodes.indexOf(this)<childNodes.indexOf(target))result+=DOCUMENT_POSITION_FOLLOWING;else result+=DOCUMENT_POSITION_PRECEDING}if(!self||!other)result+=DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,result+=DOCUMENT_POSITION_DISCONNECTED}return result}isEqualNode(node){if(this===node)return!0;if(this.nodeType===node.nodeType){switch(this.nodeType){case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:{let aNodes=this.childNodes,bNodes=node.childNodes;return aNodes.length===bNodes.length&&aNodes.every((node,i)=>node.isEqualNode(bNodes[i]))}}return this.toString()===node.toString()}return!1}_getParent(){return this.parentNode}getRootNode(){let root=this;while(root.parentNode)root=root.parentNode;return root}}var{replace}="",ca=/[<>&\xA0]/g,esca={" ":" ","&":"&","<":"<",">":">"},pe=(m)=>esca[m],escape2=(es)=>replace.call(es,ca,pe);var QUOTE=/"/g;class Attr extends Node2{constructor(ownerDocument,name,value=""){super(ownerDocument,name,ATTRIBUTE_NODE);this.ownerElement=null,this.name=$String(name),this[VALUE]=$String(value),this[CHANGED]=!1}get value(){return this[VALUE]}set value(newValue){let{[VALUE]:oldValue,name,ownerElement}=this;if(this[VALUE]=$String(newValue),this[CHANGED]=!0,ownerElement)attributeChangedCallback2(ownerElement,name,oldValue),attributeChangedCallback(ownerElement,name,oldValue,this[VALUE])}cloneNode(){let{ownerDocument,name,[VALUE]:value}=this;return new Attr(ownerDocument,name,value)}toString(){let{name,[VALUE]:value}=this;if(emptyAttributes.has(name)&&!value)return ignoreCase(this)?name:`${name}=""`;let escapedValue=(ignoreCase(this)?value:escape2(value)).replace(QUOTE,""");return`${name}="${escapedValue}"`}toJSON(){let json=[];return attrAsJSON(this,json),json}}var isConnected=({ownerDocument,parentNode})=>{while(parentNode){if(parentNode===ownerDocument)return!0;parentNode=parentNode.parentNode||parentNode.host}return!1},parentElement=({parentNode})=>{if(parentNode)switch(parentNode.nodeType){case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:return null}return parentNode},previousSibling=({[PREV]:prev})=>{switch(prev?prev.nodeType:0){case NODE_END:return prev[START];case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:return prev}return null},nextSibling=(node)=>{let next=getEnd(node)[NEXT];return next&&(next.nodeType===NODE_END?null:next)};var nextElementSibling2=(node)=>{let next=nextSibling(node);while(next&&next.nodeType!==ELEMENT_NODE)next=nextSibling(next);return next},previousElementSibling=(node)=>{let prev=previousSibling(node);while(prev&&prev.nodeType!==ELEMENT_NODE)prev=previousSibling(prev);return prev};var asFragment=(ownerDocument,nodes)=>{let fragment=ownerDocument.createDocumentFragment();return fragment.append(...nodes),fragment},before=(node,nodes)=>{let{ownerDocument,parentNode}=node;if(parentNode)parentNode.insertBefore(asFragment(ownerDocument,nodes),node)},after=(node,nodes)=>{let{ownerDocument,parentNode}=node;if(parentNode)parentNode.insertBefore(asFragment(ownerDocument,nodes),getEnd(node)[NEXT])},replaceWith=(node,nodes)=>{let{ownerDocument,parentNode}=node;if(parentNode){if(nodes.includes(node))replaceWith(node,[node=node.cloneNode()]);parentNode.insertBefore(asFragment(ownerDocument,nodes),node),node.remove()}},remove=(prev,current,next)=>{let{parentNode,nodeType}=current;if(prev||next)setAdjacent(prev,next),current[PREV]=null,getEnd(current)[NEXT]=null;if(parentNode){if(current.parentNode=null,moCallback(current,parentNode),nodeType===ELEMENT_NODE)disconnectedCallback(current)}};class CharacterData extends Node2{constructor(ownerDocument,localName,nodeType,data){super(ownerDocument,localName,nodeType);this[VALUE]=$String(data)}get isConnected(){return isConnected(this)}get parentElement(){return parentElement(this)}get previousSibling(){return previousSibling(this)}get nextSibling(){return nextSibling(this)}get previousElementSibling(){return previousElementSibling(this)}get nextElementSibling(){return nextElementSibling2(this)}before(...nodes){before(this,nodes)}after(...nodes){after(this,nodes)}replaceWith(...nodes){replaceWith(this,nodes)}remove(){remove(this[PREV],this,this[NEXT])}get data(){return this[VALUE]}set data(value){this[VALUE]=$String(value),moCallback(this,this.parentNode)}get nodeValue(){return this.data}set nodeValue(value){this.data=value}get textContent(){return this.data}set textContent(value){this.data=value}get length(){return this.data.length}substringData(offset,count){return this.data.substr(offset,count)}appendData(data){this.data+=data}insertData(offset,data){let{data:t}=this;this.data=t.slice(0,offset)+data+t.slice(offset)}deleteData(offset,count){let{data:t}=this;this.data=t.slice(0,offset)+t.slice(offset+count)}replaceData(offset,count,data){let{data:t}=this;this.data=t.slice(0,offset)+data+t.slice(offset+count)}toJSON(){let json=[];return characterDataAsJSON(this,json),json}}class CDATASection extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#cdatasection",CDATA_SECTION_NODE,data)}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new CDATASection(ownerDocument,data)}toString(){return`<![CDATA[${this[VALUE]}]]>`}}class Comment3 extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#comment",COMMENT_NODE,data)}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new Comment3(ownerDocument,data)}toString(){return`<!--${this[VALUE]}-->`}}function trueFunc(){return!0}function falseFunc(){return!1}var SelectorType;(function(SelectorType){SelectorType.Attribute="attribute",SelectorType.Pseudo="pseudo",SelectorType.PseudoElement="pseudo-element",SelectorType.Tag="tag",SelectorType.Universal="universal",SelectorType.Adjacent="adjacent",SelectorType.Child="child",SelectorType.Descendant="descendant",SelectorType.Parent="parent",SelectorType.Sibling="sibling",SelectorType.ColumnCombinator="column-combinator"})(SelectorType||(SelectorType={}));var AttributeAction;(function(AttributeAction){AttributeAction.Any="any",AttributeAction.Element="element",AttributeAction.End="end",AttributeAction.Equals="equals",AttributeAction.Exists="exists",AttributeAction.Hyphen="hyphen",AttributeAction.Not="not",AttributeAction.Start="start"})(AttributeAction||(AttributeAction={}));var reName=/^[^#\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\u00B0-\uFFFF-])+/,reEscape=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,CharCode;(function(CharCode){CharCode[CharCode.LeftParenthesis=40]="LeftParenthesis",CharCode[CharCode.RightParenthesis=41]="RightParenthesis",CharCode[CharCode.LeftSquareBracket=91]="LeftSquareBracket",CharCode[CharCode.RightSquareBracket=93]="RightSquareBracket",CharCode[CharCode.Comma=44]="Comma",CharCode[CharCode.Period=46]="Period",CharCode[CharCode.Colon=58]="Colon",CharCode[CharCode.SingleQuote=39]="SingleQuote",CharCode[CharCode.DoubleQuote=34]="DoubleQuote",CharCode[CharCode.Plus=43]="Plus",CharCode[CharCode.Tilde=126]="Tilde",CharCode[CharCode.QuestionMark=63]="QuestionMark",CharCode[CharCode.ExclamationMark=33]="ExclamationMark",CharCode[CharCode.Slash=47]="Slash",CharCode[CharCode.Equal=61]="Equal",CharCode[CharCode.Dollar=36]="Dollar",CharCode[CharCode.Pipe=124]="Pipe",CharCode[CharCode.Circumflex=94]="Circumflex",CharCode[CharCode.Asterisk=42]="Asterisk",CharCode[CharCode.GreaterThan=62]="GreaterThan",CharCode[CharCode.LessThan=60]="LessThan",CharCode[CharCode.Hash=35]="Hash",CharCode[CharCode.LowerI=105]="LowerI",CharCode[CharCode.LowerS=115]="LowerS",CharCode[CharCode.BackSlash=92]="BackSlash",CharCode[CharCode.Space=32]="Space",CharCode[CharCode.Tab=9]="Tab",CharCode[CharCode.NewLine=10]="NewLine",CharCode[CharCode.FormFeed=12]="FormFeed",CharCode[CharCode.CarriageReturn=13]="CarriageReturn"})(CharCode||(CharCode={}));var actionTypes=new Map([[CharCode.Tilde,AttributeAction.Element],[CharCode.Circumflex,AttributeAction.Start],[CharCode.Dollar,AttributeAction.End],[CharCode.Asterisk,AttributeAction.Any],[CharCode.ExclamationMark,AttributeAction.Not],[CharCode.Pipe,AttributeAction.Hyphen]]),unpackPseudos=new Set(["has","not","matches","is","where","host","host-context"]),pseudosToPseudoElements=new Set(["before","after","first-line","first-letter"]);function isTraversal(selector){switch(selector.type){case SelectorType.Adjacent:case SelectorType.Child:case SelectorType.Descendant:case SelectorType.Parent:case SelectorType.Sibling:case SelectorType.ColumnCombinator:return!0;case SelectorType.Attribute:case SelectorType.Pseudo:case SelectorType.PseudoElement:case SelectorType.Tag:case SelectorType.Universal:return!1}}var stripQuotesFromPseudos=new Set(["contains","icontains"]);function funescape(_,escaped,escapedWhitespace){let high=Number.parseInt(escaped,16)-65536;return Number.isNaN(high)||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,high&1023|56320)}function unescapeCSS(cssString){return cssString.replace(reEscape,funescape)}function isQuote(c){return c===CharCode.SingleQuote||c===CharCode.DoubleQuote}function isWhitespace2(c){return c===CharCode.Space||c===CharCode.Tab||c===CharCode.NewLine||c===CharCode.FormFeed||c===CharCode.CarriageReturn}function parse(selector){let subselects=[],endIndex=parseSelector(subselects,`${selector}`,0);if(endIndex<selector.length)throw Error(`Unmatched selector: ${selector.slice(endIndex)}`);return subselects}function parseSelector(subselects,selector,selectorIndex){let tokens=[];function getName(offset){let match=selector.slice(selectorIndex+offset).match(reName);if(!match)throw Error(`Expected name, found ${selector.slice(selectorIndex)}`);let[name]=match;return selectorIndex+=offset+name.length,unescapeCSS(name)}function stripWhitespace(offset){selectorIndex+=offset;while(selectorIndex<selector.length&&isWhitespace2(selector.charCodeAt(selectorIndex)))selectorIndex++}function readValueWithParenthesis(){selectorIndex+=1;let start=selectorIndex;for(let counter=1;selectorIndex<selector.length;selectorIndex++)switch(selector.charCodeAt(selectorIndex)){case CharCode.BackSlash:{selectorIndex+=1;break}case CharCode.LeftParenthesis:{counter+=1;break}case CharCode.RightParenthesis:{if(counter-=1,counter===0)return unescapeCSS(selector.slice(start,selectorIndex++));break}}throw Error("Parenthesis not matched")}function ensureNotTraversal(){if(tokens.length>0&&isTraversal(tokens[tokens.length-1]))throw Error("Did not expect successive traversals.")}function addTraversal(type){if(tokens.length>0&&tokens[tokens.length-1].type===SelectorType.Descendant){tokens[tokens.length-1].type=type;return}ensureNotTraversal(),tokens.push({type})}function addSpecialAttribute(name,action){tokens.push({type:SelectorType.Attribute,name,action,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(tokens.length>0&&tokens[tokens.length-1].type===SelectorType.Descendant)tokens.pop();if(tokens.length===0)throw Error("Empty sub-selector");subselects.push(tokens)}if(stripWhitespace(0),selector.length===selectorIndex)return selectorIndex;loop:while(selectorIndex<selector.length){let firstChar=selector.charCodeAt(selectorIndex);switch(firstChar){case CharCode.Space:case CharCode.Tab:case CharCode.NewLine:case CharCode.FormFeed:case CharCode.CarriageReturn:{if(tokens.length===0||tokens[0].type!==SelectorType.Descendant)ensureNotTraversal(),tokens.push({type:SelectorType.Descendant});stripWhitespace(1);break}case CharCode.GreaterThan:{addTraversal(SelectorType.Child),stripWhitespace(1);break}case CharCode.LessThan:{addTraversal(SelectorType.Parent),stripWhitespace(1);break}case CharCode.Tilde:{addTraversal(SelectorType.Sibling),stripWhitespace(1);break}case CharCode.Plus:{addTraversal(SelectorType.Adjacent),stripWhitespace(1);break}case CharCode.Period:{addSpecialAttribute("class",AttributeAction.Element);break}case CharCode.Hash:{addSpecialAttribute("id",AttributeAction.Equals);break}case CharCode.LeftSquareBracket:{stripWhitespace(1);let name,namespace=null;if(selector.charCodeAt(selectorIndex)===CharCode.Pipe)name=getName(1);else if(selector.startsWith("*|",selectorIndex))namespace="*",name=getName(2);else if(name=getName(0),selector.charCodeAt(selectorIndex)===CharCode.Pipe&&selector.charCodeAt(selectorIndex+1)!==CharCode.Equal)namespace=name,name=getName(1);stripWhitespace(0);let action=AttributeAction.Exists,possibleAction=actionTypes.get(selector.charCodeAt(selectorIndex));if(possibleAction){if(action=possibleAction,selector.charCodeAt(selectorIndex+1)!==CharCode.Equal)throw Error("Expected `=`");stripWhitespace(2)}else if(selector.charCodeAt(selectorIndex)===CharCode.Equal)action=AttributeAction.Equals,stripWhitespace(1);let value="",ignoreCase=null;if(action!=="exists"){if(isQuote(selector.charCodeAt(selectorIndex))){let quote=selector.charCodeAt(selectorIndex);selectorIndex+=1;let sectionStart=selectorIndex;while(selectorIndex<selector.length&&selector.charCodeAt(selectorIndex)!==quote)selectorIndex+=selector.charCodeAt(selectorIndex)===CharCode.BackSlash?2:1;if(selector.charCodeAt(selectorIndex)!==quote)throw Error("Attribute value didn't end");value=unescapeCSS(selector.slice(sectionStart,selectorIndex)),selectorIndex+=1}else{let valueStart=selectorIndex;while(selectorIndex<selector.length&&!isWhitespace2(selector.charCodeAt(selectorIndex))&&selector.charCodeAt(selectorIndex)!==CharCode.RightSquareBracket)selectorIndex+=selector.charCodeAt(selectorIndex)===CharCode.BackSlash?2:1;value=unescapeCSS(selector.slice(valueStart,selectorIndex))}switch(stripWhitespace(0),selector.charCodeAt(selectorIndex)|32){case CharCode.LowerI:{ignoreCase=!0,stripWhitespace(1);break}case CharCode.LowerS:{ignoreCase=!1,stripWhitespace(1);break}}}if(selector.charCodeAt(selectorIndex)!==CharCode.RightSquareBracket)throw Error("Attribute selector didn't terminate");selectorIndex+=1;let attributeSelector={type:SelectorType.Attribute,name,action,value,namespace,ignoreCase};tokens.push(attributeSelector);break}case CharCode.Colon:{if(selector.charCodeAt(selectorIndex+1)===CharCode.Colon){tokens.push({type:SelectorType.PseudoElement,name:getName(2).toLowerCase(),data:selector.charCodeAt(selectorIndex)===CharCode.LeftParenthesis?readValueWithParenthesis():null});break}let name=getName(1).toLowerCase();if(pseudosToPseudoElements.has(name)){tokens.push({type:SelectorType.PseudoElement,name,data:null});break}let data=null;if(selector.charCodeAt(selectorIndex)===CharCode.LeftParenthesis)if(unpackPseudos.has(name)){if(isQuote(selector.charCodeAt(selectorIndex+1)))throw Error(`Pseudo-selector ${name} cannot be quoted`);if(data=[],selectorIndex=parseSelector(data,selector,selectorIndex+1),selector.charCodeAt(selectorIndex)!==CharCode.RightParenthesis)throw Error(`Missing closing parenthesis in :${name} (${selector})`);selectorIndex+=1}else{if(data=readValueWithParenthesis(),stripQuotesFromPseudos.has(name)){let quot=data.charCodeAt(0);if(quot===data.charCodeAt(data.length-1)&&isQuote(quot))data=data.slice(1,-1)}data=unescapeCSS(data)}tokens.push({type:SelectorType.Pseudo,name,data});break}case CharCode.Comma:{finalizeSubselector(),tokens=[],stripWhitespace(1);break}default:{if(selector.startsWith("/*",selectorIndex)){let endIndex=selector.indexOf("*/",selectorIndex+2);if(endIndex===-1)throw Error("Comment was not terminated");if(selectorIndex=endIndex+2,tokens.length===0)stripWhitespace(0);break}let namespace=null,name;if(firstChar===CharCode.Asterisk)selectorIndex+=1,name="*";else if(firstChar===CharCode.Pipe){if(name="",selector.charCodeAt(selectorIndex+1)===CharCode.Pipe){addTraversal(SelectorType.ColumnCombinator),stripWhitespace(2);break}}else if(reName.test(selector.slice(selectorIndex)))name=getName(0);else break loop;if(selector.charCodeAt(selectorIndex)===CharCode.Pipe&&selector.charCodeAt(selectorIndex+1)!==CharCode.Pipe)if(namespace=name,selector.charCodeAt(selectorIndex+1)===CharCode.Asterisk)name="*",selectorIndex+=2;else name=getName(1);tokens.push(name==="*"?{type:SelectorType.Universal,namespace}:{type:SelectorType.Tag,name,namespace})}}}return finalizeSubselector(),selectorIndex}var ElementType2;(function(ElementType){ElementType.Root="root",ElementType.Text="text",ElementType.Directive="directive",ElementType.Comment="comment",ElementType.Script="script",ElementType.Style="style",ElementType.Tag="tag",ElementType.CDATA="cdata",ElementType.Doctype="doctype"})(ElementType2||(ElementType2={}));function isTag3(element){return element.type===ElementType2.Tag||element.type===ElementType2.Script||element.type===ElementType2.Style}var Root2=ElementType2.Root,Text3=ElementType2.Text,Directive2=ElementType2.Directive,Comment4=ElementType2.Comment,Script2=ElementType2.Script,Style2=ElementType2.Style,Tag2=ElementType2.Tag,CDATA3=ElementType2.CDATA,Doctype2=ElementType2.Doctype;function isTag4(node){return isTag3(node)}function isCDATA2(node){return node.type===ElementType2.CDATA}function isText2(node){return node.type===ElementType2.Text}function isComment2(node){return node.type===ElementType2.Comment}function hasChildren2(node){return Object.hasOwn(node,"children")}var exports_dist2={};__export(exports_dist2,{DocumentPosition:()=>DocumentPosition2,append:()=>append3,appendChild:()=>appendChild2,compareDocumentPosition:()=>compareDocumentPosition2,existsOne:()=>existsOne2,filter:()=>filter2,find:()=>find2,findAll:()=>findAll2,findOne:()=>findOne2,getAttributeValue:()=>getAttributeValue2,getChildren:()=>getChildren2,getElementById:()=>getElementById2,getElements:()=>getElements2,getElementsByClassName:()=>getElementsByClassName2,getElementsByTagName:()=>getElementsByTagName2,getElementsByTagType:()=>getElementsByTagType2,getFeed:()=>getFeed2,getInnerHTML:()=>getInnerHTML2,getName:()=>getName2,getOuterHTML:()=>getOuterHTML2,getParent:()=>getParent2,getSiblings:()=>getSiblings2,getText:()=>getText2,hasAttrib:()=>hasAttrib2,innerText:()=>innerText2,nextElementSibling:()=>nextElementSibling3,prepend:()=>prepend2,prependChild:()=>prependChild2,prevElementSibling:()=>prevElementSibling2,removeElement:()=>removeElement2,removeSubsets:()=>removeSubsets2,replaceElement:()=>replaceElement2,testElement:()=>testElement2,textContent:()=>textContent2,uniqueSort:()=>uniqueSort2});function filter2(test,node,recurse=!0,limit=Number.POSITIVE_INFINITY){return find2(test,Array.isArray(node)?node:[node],recurse,limit)}function find2(test,nodes,recurse,limit){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(indexStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(test(element)){if(result.push(element),--limit<=0)return result}if(recurse&&hasChildren2(element)&&element.children.length>0)indexStack.unshift(0),nodeStack.unshift(element.children)}}function findOne2(test,nodes,recurse=!0){let searchedNodes=Array.isArray(nodes)?nodes:[nodes];for(let node of searchedNodes){if(isTag4(node)&&test(node))return node;if(recurse&&hasChildren2(node)&&node.children.length>0){let found=findOne2(test,node.children,!0);if(found)return found}}return null}function existsOne2(test,nodes){return(Array.isArray(nodes)?nodes:[nodes]).some((node)=>isTag4(node)&&test(node)||hasChildren2(node)&&existsOne2(test,node.children))}function findAll2(test,nodes){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(isTag4(element)&&test(element))result.push(element);if(hasChildren2(element)&&element.children.length>0)indexStack.unshift(0),nodeStack.unshift(element.children)}}var Checks2={tag_name(name){if(typeof name==="function")return(element)=>isTag4(element)&&name(element.name);if(name==="*")return isTag4;return(element)=>isTag4(element)&&element.name===name},tag_type(type){if(typeof type==="function")return(element)=>type(element.type);return(element)=>element.type===type},tag_contains(data){if(typeof data==="function")return(element)=>isText2(element)&&data(element.data);return(element)=>isText2(element)&&element.data===data}};function getAttribCheck2(attrib,value){if(typeof value==="function")return(element)=>isTag4(element)&&value(element.attribs[attrib]);return(element)=>isTag4(element)&&element.attribs[attrib]===value}function combineFuncs2(a,b){return(element)=>a(element)||b(element)}function compileTest2(options){let funcs=Object.keys(options).map((key)=>{let value=options[key];return Object.hasOwn(Checks2,key)?Checks2[key](value):getAttribCheck2(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs2)}function testElement2(options,node){let test=compileTest2(options);return test?test(node):!0}function getElements2(options,nodes,recurse,limit=Number.POSITIVE_INFINITY){let test=compileTest2(options);return test?filter2(test,nodes,recurse,limit):[]}function getElementById2(id,nodes,recurse=!0){if(!Array.isArray(nodes))nodes=[nodes];return findOne2(getAttribCheck2("id",id),nodes,recurse)}function getElementsByTagName2(tagName,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter2(Checks2.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName2(className,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter2(getAttribCheck2("class",className),nodes,recurse,limit)}function getElementsByTagType2(type,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter2(Checks2.tag_type(type),nodes,recurse,limit)}var ElementType3;(function(ElementType){ElementType.Root="root",ElementType.Text="text",ElementType.Directive="directive",ElementType.Comment="comment",ElementType.Script="script",ElementType.Style="style",ElementType.Tag="tag",ElementType.CDATA="cdata",ElementType.Doctype="doctype"})(ElementType3||(ElementType3={}));var Root3=ElementType3.Root,Text4=ElementType3.Text,Directive3=ElementType3.Directive,Comment5=ElementType3.Comment,Script3=ElementType3.Script,Style3=ElementType3.Style,Tag3=ElementType3.Tag,CDATA4=ElementType3.CDATA,Doctype3=ElementType3.Doctype;function getEscape(char){return char===34?""":char===38?"&":char===39?"'":char===60?"<":char===62?">":" "}var XML_BITSET_VALUE=1342177476,xmlEncodeRegex=/["&'<>\u0080-\uFFFF]/g;function isXmlEscapable(code){return code>=128||code>=32&&code<64&&(XML_BITSET_VALUE>>>code&1)===1}function encodeXML2(input){let{length}=input,out,last=0,index=0;while(index<length){let char=input.charCodeAt(index);if(!isXmlEscapable(char)){let bound=Math.min(index+32,length),next=index+1;while(next<bound&&!isXmlEscapable(input.charCodeAt(next)))next++;if(next<bound){index=next;continue}if(next>=length)break;if(xmlEncodeRegex.lastIndex=next,!xmlEncodeRegex.test(input))break;index=xmlEncodeRegex.lastIndex-1;continue}if(out===void 0)out=input.substring(0,index);else if(last!==index)out+=input.substring(last,index);if(char<64){out+=getEscape(char),last=index+=1;continue}let cp=input.codePointAt(index);if(out+=`&#x${cp.toString(16)};`,cp!==char)index++;last=index+=1}if(out===void 0)return input;if(last<length)out+=input.substr(last);return out}function escapeWithRegex(re,data){if(re.lastIndex=0,!re.test(data))return data;let out="",last=0;do{let index=re.lastIndex-1;if(last!==index)out+=data.substring(last,index);let char=data.charCodeAt(index);out+=getEscape(char),last=index+1}while(re.test(data));return out+data.substring(last)}var attributeEscapeRegex=/["&\u{A0}]/gu;function escapeAttribute2(data){return escapeWithRegex(attributeEscapeRegex,data)}var textEscapeRegex=/[&<>\u{A0}]/gu;function escapeText2(data){return escapeWithRegex(textEscapeRegex,data)}var EntityLevel2;(function(EntityLevel){EntityLevel[EntityLevel.XML=0]="XML",EntityLevel[EntityLevel.HTML=1]="HTML"})(EntityLevel2||(EntityLevel2={}));var EncodingMode2;(function(EncodingMode){EncodingMode[EncodingMode.UTF8=0]="UTF8",EncodingMode[EncodingMode.ASCII=1]="ASCII",EncodingMode[EncodingMode.Extensive=2]="Extensive",EncodingMode[EncodingMode.Attribute=3]="Attribute",EncodingMode[EncodingMode.Text=4]="Text"})(EncodingMode2||(EncodingMode2={}));var elementNames2=new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map((name)=>[name.toLowerCase(),name])),attributeNames2=new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map((name)=>[name.toLowerCase(),name]));var unencodedElements2=new Set("style script xmp iframe noembed noframes plaintext noscript".split(" ")),voidElements2=new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" ")),foreignElements2=new Set(["svg","math"]),foreignModeIntegrationPoints2=new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" "));function render2(node,options={}){let nodes="length"in node?node:[node],xmlMode=options.xmlMode??!1,output="";for(let index=0;index<nodes.length;index++)output+=renderNode2(nodes[index],options,xmlMode);return output}var dist_default=render2;function renderChildren(children,options,xmlMode){let output="";for(let index=0;index<children.length;index++)output+=renderNode2(children[index],options,xmlMode);return output}function renderNode2(node,options,xmlMode){switch(node.type){case Root3:return renderChildren(node.children,options,xmlMode);case Directive3:return`<${node.data}>`;case Comment5:return`<!--${node.data}-->`;case CDATA4:return`<![CDATA[${node.children[0].data}]]>`;case Script3:case Style3:case Tag3:return renderTag2(node,options,xmlMode);case Text4:{let element=node,data=element.data||"";if((options.encodeEntities??options.decodeEntities)!==!1&&!(!xmlMode&&element.parent&&unencodedElements2.has(element.parent.name)))return xmlMode||options.encodeEntities!=="utf8"?encodeXML2(data):escapeText2(data);return data}}}function renderTag2(element,options,xmlMode){if(xmlMode==="foreign"){if(element.name=elementNames2.get(element.name)??element.name,element.parent&&foreignModeIntegrationPoints2.has(element.parent.name))xmlMode=!1}if(!xmlMode&&foreignElements2.has(element.name))xmlMode="foreign";let{name,children}=element,isVoid=!xmlMode&&voidElements2.has(name),tag=`<${name}${formatAttributes2(element.attribs,options,xmlMode)}`;if(children.length===0&&(xmlMode?options.selfClosingTags!==!1:options.selfClosingTags&&isVoid))tag+=xmlMode?"/>":" />";else{if(tag+=">",children.length>0)tag+=renderChildren(children,options,xmlMode);if(!isVoid)tag+=`</${name}>`}return tag}function replaceQuotes2(value){return value.replaceAll('"',""")}function formatAttributes2(attributes,options,xmlMode){if(!attributes)return"";let encode=(options.encodeEntities??options.decodeEntities)===!1?replaceQuotes2:xmlMode||options.encodeEntities!=="utf8"?encodeXML2:escapeAttribute2,isForeign=xmlMode==="foreign",showEmpty=!!(options.emptyAttrs??xmlMode),result="";for(let key in attributes){if(!Object.hasOwn(attributes,key))continue;let value=attributes[key],k=isForeign?attributeNames2.get(key)??key:key;result+=!showEmpty&&(value==null||value==="")?` ${k}`:` ${k}="${encode(value==null?"":String(value))}"`}return result}var ElementType4;(function(ElementType){ElementType.Root="root",ElementType.Text="text",ElementType.Directive="directive",ElementType.Comment="comment",ElementType.Script="script",ElementType.Style="style",ElementType.Tag="tag",ElementType.CDATA="cdata",ElementType.Doctype="doctype"})(ElementType4||(ElementType4={}));var Root4=ElementType4.Root,Text5=ElementType4.Text,Directive4=ElementType4.Directive,Comment6=ElementType4.Comment,Script4=ElementType4.Script,Style4=ElementType4.Style,Tag4=ElementType4.Tag,CDATA5=ElementType4.CDATA,Doctype4=ElementType4.Doctype;function getOuterHTML2(node,options){return dist_default(node,options)}function getInnerHTML2(node,options){return hasChildren2(node)?node.children.map((node)=>getOuterHTML2(node,options)).join(""):""}function getText2(node){if(Array.isArray(node))return node.map(getText2).join("");if(isTag4(node))return node.name==="br"?`
|
|
46
4
|
`:getText2(node.children);if(isCDATA2(node))return getText2(node.children);if(isText2(node))return node.data;return""}function textContent2(node){if(Array.isArray(node))return node.map(textContent2).join("");if(hasChildren2(node)&&!isComment2(node))return textContent2(node.children);if(isText2(node))return node.data;return""}function innerText2(node){if(Array.isArray(node))return node.map(innerText2).join("");if(hasChildren2(node)&&(node.type===ElementType4.Tag||isCDATA2(node)))return innerText2(node.children);if(isText2(node))return node.data;return""}function getFeed2(document){let feedRoot=getOneElement2(isValidFeed2,document);return feedRoot?feedRoot.name==="feed"?getAtomFeed2(feedRoot):getRssFeed2(feedRoot):null}function getAtomFeed2(feedRoot){let childs=feedRoot.children,feed={type:"atom",items:getElementsByTagName2("entry",childs).map((item)=>{let{children}=item,entry={media:getMediaElements2(children)};addConditionally2(entry,"id","id",children),addConditionally2(entry,"title","title",children);let href=getOneElement2("link",children)?.attribs.href;if(href)entry.link=href;let description=fetch2("summary",children)||fetch2("content",children);if(description)entry.description=description;let pubDate=fetch2("updated",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally2(feed,"id","id",childs),addConditionally2(feed,"title","title",childs);let href=getOneElement2("link",childs)?.attribs.href;if(href)feed.link=href;addConditionally2(feed,"description","subtitle",childs);let updated=fetch2("updated",childs);if(updated)feed.updated=new Date(updated);return addConditionally2(feed,"author","email",childs,!0),feed}function getRssFeed2(feedRoot){let childs=getOneElement2("channel",feedRoot.children)?.children??[],feed={type:feedRoot.name.substr(0,3),id:"",items:getElementsByTagName2("item",feedRoot.children).map((item)=>{let{children}=item,entry={media:getMediaElements2(children)};addConditionally2(entry,"id","guid",children),addConditionally2(entry,"title","title",children),addConditionally2(entry,"link","link",children),addConditionally2(entry,"description","description",children);let pubDate=fetch2("pubDate",children)||fetch2("dc:date",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally2(feed,"title","title",childs),addConditionally2(feed,"link","link",childs),addConditionally2(feed,"description","description",childs);let updated=fetch2("lastBuildDate",childs);if(updated)feed.updated=new Date(updated);return addConditionally2(feed,"author","managingEditor",childs,!0),feed}var MEDIA_KEYS_STRING2=["url","type","lang"],MEDIA_KEYS_INT2=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements2(where){return getElementsByTagName2("media:content",where).map((element)=>{let{attribs}=element,media={medium:attribs.medium,isDefault:!!attribs.isDefault};for(let attrib of MEDIA_KEYS_STRING2)if(attribs[attrib])media[attrib]=attribs[attrib];for(let attrib of MEDIA_KEYS_INT2)if(attribs[attrib])media[attrib]=Number.parseInt(attribs[attrib],10);if(attribs.expression)media.expression=attribs.expression;return media})}function getOneElement2(tagName,node){return getElementsByTagName2(tagName,node,!0,1)[0]}function fetch2(tagName,where,recurse=!1){return textContent2(getElementsByTagName2(tagName,where,recurse,1)).trim()}function addConditionally2(object,property,tagName,where,recurse=!1){let value=fetch2(tagName,where,recurse);if(value)object[property]=value}function isValidFeed2(value){return value==="rss"||value==="feed"||value==="rdf:RDF"}function removeSubsets2(nodes){let index=nodes.length;while(--index>=0){let node=nodes[index];if(index>0&&nodes.lastIndexOf(node,index-1)>=0){nodes.splice(index,1);continue}for(let ancestor=node.parent;ancestor;ancestor=ancestor.parent)if(nodes.includes(ancestor)){nodes.splice(index,1);break}}return nodes}var DocumentPosition2;(function(DocumentPosition){DocumentPosition[DocumentPosition.DISCONNECTED=1]="DISCONNECTED",DocumentPosition[DocumentPosition.PRECEDING=2]="PRECEDING",DocumentPosition[DocumentPosition.FOLLOWING=4]="FOLLOWING",DocumentPosition[DocumentPosition.CONTAINS=8]="CONTAINS",DocumentPosition[DocumentPosition.CONTAINED_BY=16]="CONTAINED_BY"})(DocumentPosition2||(DocumentPosition2={}));function compareDocumentPosition2(nodeA,nodeB){let aParents=[],bParents=[];if(nodeA===nodeB)return 0;let current=hasChildren2(nodeA)?nodeA:nodeA.parent;while(current)aParents.unshift(current),current=current.parent;current=hasChildren2(nodeB)?nodeB:nodeB.parent;while(current)bParents.unshift(current),current=current.parent;let maxIndex=Math.min(aParents.length,bParents.length),index=0;while(index<maxIndex&&aParents[index]===bParents[index])index++;if(index===0)return DocumentPosition2.DISCONNECTED;let sharedParent=aParents[index-1],siblings=sharedParent.children,aSibling=aParents[index],bSibling=bParents[index];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB)return DocumentPosition2.FOLLOWING|DocumentPosition2.CONTAINED_BY;return DocumentPosition2.FOLLOWING}if(sharedParent===nodeA)return DocumentPosition2.PRECEDING|DocumentPosition2.CONTAINS;return DocumentPosition2.PRECEDING}function uniqueSort2(nodes){return nodes=nodes.filter((node,index,array)=>!array.includes(node,index+1)),nodes.sort((a,b)=>{let relative=compareDocumentPosition2(a,b);if(relative&DocumentPosition2.PRECEDING)return-1;if(relative&DocumentPosition2.FOLLOWING)return 1;return 0}),nodes}function removeElement2(element){if(element.prev)element.prev.next=element.next;if(element.next)element.next.prev=element.prev;if(element.parent){let childs=element.parent.children,childsIndex=childs.lastIndexOf(element);if(childsIndex!==-1)childs.splice(childsIndex,1)}element.next=null,element.prev=null,element.parent=null}function replaceElement2(element,replacement){if(replacement.prev=element.prev,replacement.prev)replacement.prev.next=replacement;if(replacement.next=element.next,replacement.next)replacement.next.prev=replacement;if(replacement.parent=element.parent,replacement.parent){let{children}=replacement.parent,elementIndex=children.lastIndexOf(element);if(elementIndex===-1)return;children[elementIndex]=replacement,element.parent=null}}function appendChild2(parent,child){if(removeElement2(child),child.next=null,child.parent=parent,parent.children.push(child)>1){let sibling=parent.children[parent.children.length-2];sibling.next=child,child.prev=sibling}else child.prev=null}function append3(element,next){removeElement2(next);let{parent}=element,currentNext=element.next;if(next.next=currentNext,next.prev=element,element.next=next,next.parent=parent,currentNext){if(currentNext.prev=next,parent){let childs=parent.children;childs.splice(childs.lastIndexOf(currentNext),0,next)}}else if(parent)parent.children.push(next)}function prependChild2(parent,child){if(removeElement2(child),child.parent=parent,child.prev=null,parent.children.unshift(child)===1)child.next=null;else{let sibling=parent.children[1];sibling.prev=child,child.next=sibling}}function prepend2(element,previous){removeElement2(previous);let{parent}=element;if(parent){let childs=parent.children;childs.splice(childs.indexOf(element),0,previous)}if(element.prev)element.prev.next=previous;previous.parent=parent,previous.prev=element.prev,previous.next=element,element.prev=previous}function getChildren2(element){return hasChildren2(element)?element.children:[]}function getParent2(element){return element.parent||null}function getSiblings2(element){let parent=getParent2(element);if(parent!=null)return getChildren2(parent);let siblings=[element],{prev,next}=element;while(prev!=null)siblings.unshift(prev),{prev}=prev;while(next!=null)siblings.push(next),{next}=next;return siblings}function getAttributeValue2(element,name){let{attribs}=element;return attribs?.[name]}function hasAttrib2(element,name){let{attribs}=element;return attribs!=null&&Object.hasOwn(attribs,name)&&attribs[name]!=null}function getName2(element){return element.name}function nextElementSibling3(element){let{next}=element;while(next!==null&&!isTag4(next))({next}=next);return next}function prevElementSibling2(element){let{prev}=element;while(prev!==null&&!isTag4(prev))({prev}=prev);return prev}var reChars=/[-[\]{}()*+?.,\\^$|#\s]/g,whitespaceRe=/\s/;function escapeRegex(value){return value.replace(reChars,"\\$&")}var caseInsensitiveAttributes=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function shouldIgnoreCase(selector,options){return typeof selector.ignoreCase==="boolean"?selector.ignoreCase:selector.ignoreCase==="quirks"?!!options.quirksMode:!options.xmlMode&&caseInsensitiveAttributes.has(selector.name)}var attributeRules={equals(next,data,options){let{adapter}=options,{name}=data,{value}=data;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>{let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length===value.length&&attribute.toLowerCase()===value&&next(element)};return(element)=>adapter.getAttributeValue(element,name)===value&&next(element)},hyphen(next,data,options){let{adapter}=options,{name}=data,{value}=data,{length}=value;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),function(element){let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&(attribute.length===length||attribute.charAt(length)==="-")&&attribute.substr(0,length).toLowerCase()===value&&next(element)};return function(element){let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&(attribute.length===length||attribute.charAt(length)==="-")&&attribute.substr(0,length)===value&&next(element)}},element(next,data,options){let{adapter}=options,{name,value}=data;if(whitespaceRe.test(value))return falseFunc;let regex=new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`,shouldIgnoreCase(data,options)?"i":"");return function(node){let attribute=adapter.getAttributeValue(node,name);return attribute!=null&&attribute.length>=value.length&®ex.test(attribute)&&next(node)}},exists(next,{name},{adapter}){return(element)=>adapter.hasAttrib(element,name)&&next(element)},start(next,data,options){let{adapter}=options,{name}=data,{value}=data,{length}=value;if(length===0)return falseFunc;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>{let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length>=length&&attribute.substr(0,length).toLowerCase()===value&&next(element)};return(element)=>!!adapter.getAttributeValue(element,name)?.startsWith(value)&&next(element)},end(next,data,options){let{adapter}=options,{name}=data,{value}=data,length=-value.length;if(length===0)return falseFunc;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>adapter.getAttributeValue(element,name)?.substr(length).toLowerCase()===value&&next(element);return(element)=>!!adapter.getAttributeValue(element,name)?.endsWith(value)&&next(element)},any(next,data,options){let{adapter}=options,{name,value}=data;if(value==="")return falseFunc;if(shouldIgnoreCase(data,options)){let regex=new RegExp(escapeRegex(value),"i");return function(element){let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length>=value.length&®ex.test(attribute)&&next(element)}}return(element)=>!!adapter.getAttributeValue(element,name)?.includes(value)&&next(element)},not(next,data,options){let{adapter}=options,{name}=data,{value}=data;if(value==="")return(element)=>!!adapter.getAttributeValue(element,name)&&next(element);if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>{let attribute=adapter.getAttributeValue(element,name);return(attribute==null||attribute.length!==value.length||attribute.toLowerCase()!==value)&&next(element)};return(element)=>adapter.getAttributeValue(element,name)!==value&&next(element)}};function findAll3(query,nodes,options){let{adapter,xmlMode=!1}=options,result=[],nodeStack=[nodes],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(!adapter.isTag(element))continue;if(query(element))result.push(element);if(xmlMode||adapter.getName(element)!=="template"){let children=adapter.getChildren(element);if(children.length>0)nodeStack.unshift(children),indexStack.unshift(0)}}}function findOne3(query,nodes,options){let{adapter,xmlMode=!1}=options,nodeStack=[nodes],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return null;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(!adapter.isTag(element))continue;if(query(element))return element;if(xmlMode||adapter.getName(element)!=="template"){let children=adapter.getChildren(element);if(children.length>0)nodeStack.unshift(children),indexStack.unshift(0)}}}function getNextSiblings(element,adapter){let siblings=adapter.getSiblings(element);if(siblings.length<=1)return[];let elementIndex=siblings.indexOf(element);if(elementIndex===-1||elementIndex===siblings.length-1)return[];return siblings.slice(elementIndex+1).filter(adapter.isTag)}function getElementParent(node,adapter){let parent=adapter.getParent(node);return parent!=null&&adapter.isTag(parent)?parent:null}var aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
|
|
47
5
|
:is(button, input, select, textarea, optgroup, option)[disabled],
|
|
48
6
|
optgroup[disabled] > option,
|
|
49
7
|
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
50
|
-
)`,enabled:":is(button, input, select, textarea, optgroup, option, fieldset):not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], :selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])","read-only":"[readonly]:is(textarea, input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i]))","read-write":":not([readonly]):is(textarea, input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i]))",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"};function compile(parsed){let a=parsed[0],b=parsed[1]-1;if(b<0&&a<=0)return falseFunc;if(a===-1)return(index)=>index<=b;if(a===0)return(index)=>index===b;if(a===1)return b<0?trueFunc:(index)=>index>=b;let absA=Math.abs(a),bModulo=(b%absA+absA)%absA;return a>1?(index)=>index>=b&&index%absA===bModulo:(index)=>index<=b&&index%absA===bModulo}var whitespace=new Set([9,10,12,13,32]);function parse2(formula){switch(formula=formula.trim().toLowerCase(),formula){case"even":return[2,0];case"odd":return[2,1]}let index=0,a=0,sign=readSign(),number=readNumber();if(index<formula.length&&formula.charAt(index)==="n")if(index++,a=sign*(number??1),skipWhitespace(),index<formula.length)sign=readSign(),skipWhitespace(),number=readNumber();else sign=number=0;if(number===null||index<formula.length)throw Error(`n-th rule couldn't be parsed ('${formula}')`);return[a,sign*number];function readSign(){switch(formula.charAt(index)){case"-":return index++,-1;case"+":{index++;break}}return 1}function readNumber(){let start=index,value=0;while(index<formula.length&&formula.charCodeAt(index)>=48&&formula.charCodeAt(index)<=57)value=value*10+(formula.charCodeAt(index)-48),index++;return index===start?null:value}function skipWhitespace(){while(index<formula.length&&whitespace.has(formula.charCodeAt(index)))index++}}function nthCheck(formula){return compile(parse2(formula))}function cacheParentResults(next,{adapter,cacheResults},matches){if(cacheResults===!1||typeof WeakMap>"u")return(element)=>next(element)&&matches(element);let resultCache=new WeakMap;function addResultToCache(element){let result=matches(element);return resultCache.set(element,result),result}return function(element){if(!next(element))return!1;if(resultCache.has(element))return resultCache.get(element)??!1;let node=element;do{let parent=getElementParent(node,adapter);if(parent===null)return addResultToCache(element);node=parent}while(!resultCache.has(node));return resultCache.get(node)?addResultToCache(element):!1}}function copyOptions(options){let{context:_,rootFunc:__,...copied}=options;return copied}function extendedFilter(tag,range){if(range[0]!=="*"&&range[0]!==tag[0])return!1;let tagIndex=1;for(let rangeIndex=1;rangeIndex<range.length;rangeIndex++){if(range[rangeIndex]==="*")continue;while(tagIndex<tag.length&&tag[tagIndex]!==range[rangeIndex])if(tag[tagIndex++].length<=1)return!1;if(tagIndex>=tag.length)return!1;tagIndex++}return!0}var nthOfRegex=/^(.+?)\s+of\s+(.+)$/is;function compileNth(reverse,ofType){return function(next,rule,options,context2,compileToken){let{adapter,equals}=options,ofMatch=ofType?null:rule.match(nthOfRegex),nthCheck2=nthCheck(ofMatch?ofMatch[1].trim():rule);if(nthCheck2===falseFunc)return falseFunc;let ofSelector=ofMatch&&compileToken?compileToken(parse(ofMatch[2].trim()),copyOptions(options),context2):void 0;if(ofSelector===falseFunc)return falseFunc;if(nthCheck2===trueFunc&&!ofSelector)return(element)=>getElementParent(element,adapter)!==null&&next(element);let shouldCount=ofSelector?(_element,sibling)=>ofSelector(sibling):ofType?(element,sibling)=>adapter.getName(sibling)===adapter.getName(element):trueFunc;if(reverse)return function(element){if(ofSelector&&!ofSelector(element))return!1;let siblings=adapter.getSiblings(element),pos=0;for(let index=siblings.length-1;index>=0;index--){let sibling=siblings[index];if(equals(element,sibling))break;if(adapter.isTag(sibling)&&shouldCount(element,sibling))pos++}return nthCheck2(pos)&&next(element)};return function(element){if(ofSelector&&!ofSelector(element))return!1;let siblings=adapter.getSiblings(element),pos=0;for(let sibling of siblings){if(equals(element,sibling))break;if(adapter.isTag(sibling)&&shouldCount(element,sibling))pos++}return nthCheck2(pos)&&next(element)}}}var filters={contains(next,text,options){let{getText}=options.adapter;return cacheParentResults(next,options,(element)=>getText(element).includes(text))},icontains(next,text,options){let itext=text.toLowerCase(),{getText}=options.adapter;return cacheParentResults(next,options,(element)=>getText(element).toLowerCase().includes(itext))},"nth-child":compileNth(!1,!1),"nth-last-child":compileNth(!0,!1),"nth-of-type":compileNth(!1,!0),"nth-last-of-type":compileNth(!0,!0),root(next,_rule,{adapter}){return(element)=>getElementParent(element,adapter)===null&&next(element)},scope(next,rule,options,context2){let{equals}=options;if(!context2||context2.length===0)return filters.root(next,rule,options);if(context2.length===1)return(element)=>equals(context2[0],element)&&next(element);return(element)=>context2.includes(element)&&next(element)},lang(next,code,{adapter}){let ranges=code.split(",").map((r)=>r.trim()).filter((r)=>r.length>0).map((r)=>r.replace(/^['"]|['"]$/g,"").toLowerCase().split("-"));return function(element){let node=element;while(node!=null){let value=adapter.getAttributeValue(node,"xml:lang")??adapter.getAttributeValue(node,"lang");if(value!=null){if(!value)return ranges.some((r)=>r[0]==="")&&next(element);let tag=value.toLowerCase().split("-");return ranges.some((r)=>extendedFilter(tag,r))&&next(element)}let parent=adapter.getParent(node);node=parent!=null&&adapter.isTag(parent)?parent:null}return ranges.some((r)=>r[0]==="")&&next(element)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(name){return function(next,_rule,{adapter}){let filterFunction=adapter[name];if(typeof filterFunction!=="function")return falseFunc;return function(element){return filterFunction(element)&&next(element)}}}var isDocumentWhiteSpace=/^[ \t\r\n]*$/,pseudos={empty(element,{adapter}){let children=adapter.getChildren(element);return children.every((element)=>!adapter.isTag(element))&&children.every((element)=>isDocumentWhiteSpace.test(adapter.getText(element)))},"first-child"(element,{adapter,equals}){if(adapter.prevElementSibling)return adapter.prevElementSibling(element)==null;let firstChild=adapter.getSiblings(element).find((sibling)=>adapter.isTag(sibling));return firstChild!=null&&equals(element,firstChild)},"last-child"(element,{adapter,equals}){let siblings=adapter.getSiblings(element);for(let index=siblings.length-1;index>=0;index--){if(equals(element,siblings[index]))return!0;if(adapter.isTag(siblings[index]))break}return!1},"first-of-type"(element,{adapter,equals}){let siblings=adapter.getSiblings(element),elementName=adapter.getName(element);for(let currentSibling of siblings){if(equals(element,currentSibling))return!0;if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elementName)break}return!1},"last-of-type"(element,{adapter,equals}){let siblings=adapter.getSiblings(element),elementName=adapter.getName(element);for(let index=siblings.length-1;index>=0;index--){let currentSibling=siblings[index];if(equals(element,currentSibling))return!0;if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elementName)break}return!1},"only-of-type"(element,{adapter,equals}){let elementName=adapter.getName(element);return adapter.getSiblings(element).every((sibling)=>equals(element,sibling)||!adapter.isTag(sibling)||adapter.getName(sibling)!==elementName)},"only-child"(element,{adapter,equals}){return adapter.getSiblings(element).every((sibling)=>equals(element,sibling)||!adapter.isTag(sibling))}};function verifyPseudoArguments(pseudoClassCondition,name,subselect,argumentIndex){if(subselect===null){if(pseudoClassCondition.length>argumentIndex)throw Error(`Pseudo-class :${name} requires an argument`)}else if(pseudoClassCondition.length===argumentIndex)throw Error(`Pseudo-class :${name} doesn't have any arguments`)}function isTraversal2(token){return token.type==="_flexibleDescendant"||isTraversal(token)}function sortRules(array){let ratings=array.map(getQuality);for(let index=1;index<array.length;index++){let procNew=ratings[index];if(procNew<0)continue;for(let currentIndex=index;currentIndex>0&&procNew<ratings[currentIndex-1];currentIndex--){let token=array[currentIndex];array[currentIndex]=array[currentIndex-1],array[currentIndex-1]=token,ratings[currentIndex]=ratings[currentIndex-1],ratings[currentIndex-1]=procNew}}}function getAttributeQuality(token){switch(token.action){case AttributeAction.Exists:return 10;case AttributeAction.Equals:return token.name==="id"?9:8;case AttributeAction.Not:return 7;case AttributeAction.Start:return 6;case AttributeAction.End:return 6;case AttributeAction.Any:return 5;case AttributeAction.Hyphen:return 4;case AttributeAction.Element:return 3}}function getQuality(token){switch(token.type){case SelectorType.Universal:return 50;case SelectorType.Tag:return 30;case SelectorType.Attribute:return Math.floor(getAttributeQuality(token)/(token.ignoreCase?2:1));case SelectorType.Pseudo:return token.data?token.name==="has"||token.name==="contains"||token.name==="icontains"?0:Array.isArray(token.data)?Math.max(0,Math.min(...token.data.map((d)=>Math.min(...d.map(getQuality))))):2:3;default:return-1}}function includesScopePseudo(t){return t.type===SelectorType.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some((data)=>data.some(includesScopePseudo)))}var PLACEHOLDER_ELEMENT={};function hasDependsOnCurrentElement(selector){return selector.some((sel)=>sel.length>0&&(isTraversal2(sel[0])||sel.some(includesScopePseudo)))}var is=(next,token,options,context2,compileToken)=>{let compiledToken=compileToken(token,copyOptions(options),context2);return compiledToken===trueFunc?next:compiledToken===falseFunc?falseFunc:(element)=>compiledToken(element)&&next(element)},subselects={is,matches:is,where:is,not(next,token,options,context2,compileToken){let compiledToken=compileToken(token,copyOptions(options),context2);return compiledToken===falseFunc?next:compiledToken===trueFunc?falseFunc:(element)=>!compiledToken(element)&&next(element)},has(next,subselect,options,_context,compileToken){let{adapter}=options,copiedOptions=copyOptions(options);copiedOptions.relativeSelector=!0;let context2=subselect.some((s)=>s.some(isTraversal2))?[PLACEHOLDER_ELEMENT]:void 0,skipCache=hasDependsOnCurrentElement(subselect),compiled=compileToken(subselect,copiedOptions,context2);if(compiled===falseFunc)return falseFunc;if(context2&&compiled!==trueFunc)return skipCache?(element)=>{if(!next(element))return!1;context2[0]=element;let childs=adapter.getChildren(element);return findOne3(compiled,compiled.shouldTestNextSiblings?[...childs,...getNextSiblings(element,adapter)]:childs,options)!==null}:cacheParentResults(next,options,(element)=>(context2[0]=element,findOne3(compiled,adapter.getChildren(element),options)!==null));let hasOne=(element)=>findOne3(compiled,adapter.getChildren(element),options)!==null;return skipCache?(element)=>next(element)&&hasOne(element):cacheParentResults(next,options,hasOne)}};function compilePseudoSelector(next,selector,options,context2,compileToken){let{name,data}=selector;if(Array.isArray(data)){if(!(name in subselects))throw Error(`Unknown pseudo-class :${name}(${data})`);return subselects[name](next,data,options,context2,compileToken)}let userPseudo=options.pseudos?.[name],stringPseudo=typeof userPseudo==="string"?userPseudo:aliases[name];if(typeof stringPseudo==="string"){if(data!=null)throw Error(`Pseudo ${name} doesn't have any arguments`);let alias=parse(stringPseudo);return subselects.is(next,alias,options,context2,compileToken)}if(typeof userPseudo==="function")return verifyPseudoArguments(userPseudo,name,data,1),(element)=>userPseudo(element,data)&&next(element);if(name in filters)return filters[name](next,data,options,context2,compileToken);if(name in pseudos){let pseudo=pseudos[name];return verifyPseudoArguments(pseudo,name,data,2),(element)=>pseudo(element,options,data)&&next(element)}throw Error(`Unknown pseudo-class :${name}`)}function compileGeneralSelector(next,selector,options,context2,compileToken,hasExpensiveSubselector){let{adapter,equals,cacheResults}=options;switch(selector.type){case SelectorType.PseudoElement:throw Error("Pseudo-elements are not supported by css-select");case SelectorType.ColumnCombinator:throw Error("Column combinators are not yet supported by css-select");case SelectorType.Attribute:{if(selector.namespace!=null)throw Error("Namespaced attributes are not yet supported by css-select");if(!options.xmlMode||options.lowerCaseAttributeNames)selector.name=selector.name.toLowerCase();return attributeRules[selector.action](next,selector,options)}case SelectorType.Pseudo:return compilePseudoSelector(next,selector,options,context2,compileToken);case SelectorType.Tag:{if(selector.namespace!=null)throw Error("Namespaced tag names are not yet supported by css-select");let{name}=selector;if(!options.xmlMode||options.lowerCaseTags)name=name.toLowerCase();return function(element){return adapter.getName(element)===name&&next(element)}}case SelectorType.Descendant:{if(!hasExpensiveSubselector||cacheResults===!1||typeof WeakMap>"u")return function(element){let current=element;while(current=getElementParent(current,adapter))if(next(current))return!0;return!1};let resultCache=new WeakMap;return function(element){let current=element,result;while(current=getElementParent(current,adapter)){let cached=resultCache.get(current);if(cached===void 0){if(result??={matches:!1},result.matches=next(current),resultCache.set(current,result),result.matches)return!0}else{if(result)result.matches=cached.matches;return cached.matches}}return!1}}case"_flexibleDescendant":return function(element){let current=element;do{if(next(current))return!0;current=getElementParent(current,adapter)}while(current);return!1};case SelectorType.Parent:return function(element){return adapter.getChildren(element).some((element)=>adapter.isTag(element)&&next(element))};case SelectorType.Child:return function(element){let parent=getElementParent(element,adapter);return parent!==null&&next(parent)};case SelectorType.Sibling:return function(element){let siblings=adapter.getSiblings(element);for(let currentSibling of siblings){if(equals(element,currentSibling))break;if(adapter.isTag(currentSibling)&&next(currentSibling))return!0}return!1};case SelectorType.Adjacent:{if(adapter.prevElementSibling)return function(element){let previous=adapter.prevElementSibling(element);return previous!=null&&next(previous)};return function(element){let siblings=adapter.getSiblings(element),lastElement;for(let currentSibling of siblings){if(equals(element,currentSibling))break;if(adapter.isTag(currentSibling))lastElement=currentSibling}return!!lastElement&&next(lastElement)}}case SelectorType.Universal:{if(selector.namespace!=null&&selector.namespace!=="*")throw Error("Namespaced universal selectors are not yet supported by css-select");return next}}}var DESCENDANT_TOKEN={type:SelectorType.Descendant},FLEXIBLE_DESCENDANT_TOKEN={type:"_flexibleDescendant"},SCOPE_TOKEN={type:SelectorType.Pseudo,name:"scope",data:null};function absolutize(token,{adapter},context2){let hasContext=!!context2?.every((element)=>element===PLACEHOLDER_ELEMENT||adapter.isTag(element)&&getElementParent(element,adapter)!==null);for(let t of token){if(t.length>0&&isTraversal2(t[0])&&t[0].type!==SelectorType.Descendant);else if(hasContext&&!t.some(includesScopePseudo))t.unshift(DESCENDANT_TOKEN);else continue;t.unshift(SCOPE_TOKEN)}}function compileToken(token,options,compilationContext){for(let rules of token)sortRules(rules);let{context:context2=compilationContext,rootFunc:rootFunction=trueFunc}=options,isArrayContext=Array.isArray(context2),finalContext=context2&&(Array.isArray(context2)?context2:[context2]);if(options.relativeSelector!==!1)absolutize(token,options,finalContext);else if(token.some((t)=>t.length>0&&isTraversal2(t[0])))throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let shouldTestNextSiblings=!1,query=falseFunc;combineLoop:for(let rules of token){if(rules.length>=2){let[first,second]=rules;if(first.type!==SelectorType.Pseudo||first.name!=="scope");else if(isArrayContext&&second.type===SelectorType.Descendant)rules[1]=FLEXIBLE_DESCENDANT_TOKEN;else if(second.type===SelectorType.Adjacent||second.type===SelectorType.Sibling)shouldTestNextSiblings=!0}let next=rootFunction,hasExpensiveSubselector=!1;for(let rule of rules){if(next=compileGeneralSelector(next,rule,options,finalContext,compileToken,hasExpensiveSubselector),getQuality(rule)===0)hasExpensiveSubselector=!0;if(next===falseFunc)continue combineLoop}if(next===rootFunction)return rootFunction;query=query===falseFunc?next:or(query,next)}return query.shouldTestNextSiblings=shouldTestNextSiblings,query}function or(a,b){return(element)=>a(element)||b(element)}var defaultEquals=(a,b)=>a===b,defaultOptions={adapter:{...exports_dist2,isTag:isTag4},equals:defaultEquals};function convertOptionFormats(options){let finalOptions=options??defaultOptions;return finalOptions.adapter??=defaultOptions.adapter,finalOptions.equals??=finalOptions.adapter?.equals??defaultEquals,finalOptions}function compile2(selector,options,context2){let convertedOptions=convertOptionFormats(options),next=_compileUnsafe(selector,convertedOptions,context2);return next===falseFunc?falseFunc:(element)=>convertedOptions.adapter.isTag(element)&&next(element)}function _compileUnsafe(selector,options,context2){return compileToken(typeof selector==="string"?parse(selector):selector,convertOptionFormats(options),context2)}function getSelectorFunction(searchFunction){return function(query,elements,options){let convertedOptions=convertOptionFormats(options);if(typeof query!=="function")query=_compileUnsafe(query,convertedOptions,elements);let filteredElements=prepareContext(elements,convertedOptions.adapter,query.shouldTestNextSiblings);return searchFunction(query,filteredElements,convertedOptions)}}function prepareContext(elements,adapter,shouldTestNextSiblings=!1){if(shouldTestNextSiblings)elements=appendNextSiblings(elements,adapter);return Array.isArray(elements)?adapter.removeSubsets(elements):adapter.getChildren(elements)}function appendNextSiblings(element,adapter){let elements=Array.isArray(element)?[...element]:[element],elementsLength=elements.length;for(let index=0;index<elementsLength;index++){let nextSiblings=getNextSiblings(elements[index],adapter);elements.push(...nextSiblings)}return elements}var selectAll=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?[]:findAll3(query,elements,options)),selectOne=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?null:findOne3(query,elements,options));function is2(element,query,options){return(typeof query==="function"?query:compile2(query,options))(element)}var{isArray}=Array,isTag5=({nodeType})=>nodeType===ELEMENT_NODE,existsOne3=(test,elements)=>elements.some((element)=>isTag5(element)&&(test(element)||existsOne3(test,getChildren3(element)))),getAttributeValue3=(element,name)=>name==="class"?element.getAttributeNode("class")?.value??null:element.getAttribute(name),getChildren3=({childNodes})=>childNodes,getName3=(element)=>{let{localName}=element;return ignoreCase(element)?localName.toLowerCase():localName},getParent3=({parentNode})=>parentNode,getSiblings3=(element)=>{let{parentNode}=element;return parentNode?getChildren3(parentNode):element},getText3=(node)=>{if(isArray(node))return node.map(getText3).join("");if(isTag5(node))return getText3(getChildren3(node));if(node.nodeType===TEXT_NODE)return node.data;return""},hasAttrib3=(element,name)=>element.hasAttribute(name),removeSubsets3=(nodes)=>{let{length}=nodes;while(length--){let node=nodes[length];if(length&&-1<nodes.lastIndexOf(node,length-1)){nodes.splice(length,1);continue}for(let{parentNode}=node;parentNode;parentNode=parentNode.parentNode)if(nodes.includes(parentNode)){nodes.splice(length,1);break}}return nodes},findAll4=(test,nodes)=>{let matches=[];for(let node of nodes)if(isTag5(node)){if(test(node))matches.push(node);matches.push(...findAll4(test,getChildren3(node)))}return matches},findOne4=(test,nodes)=>{for(let node of nodes)if(test(node)||(node=findOne4(test,getChildren3(node))))return node;return null},adapter={isTag:isTag5,existsOne:existsOne3,getAttributeValue:getAttributeValue3,getChildren:getChildren3,getName:getName3,getParent:getParent3,getSiblings:getSiblings3,getText:getText3,hasAttrib:hasAttrib3,removeSubsets:removeSubsets3,findAll:findAll4,findOne:findOne4},prepareMatch=(element,selectors)=>compile2(selectors,{context:selectors.includes(":scope")?element:void 0,xmlMode:!ignoreCase(element),adapter}),matches=(element,selectors)=>is2(element,selectors,{strict:!0,context:selectors.includes(":scope")?element:void 0,xmlMode:!ignoreCase(element),adapter});class Text6 extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#text",TEXT_NODE,data)}get wholeText(){let text=[],{previousSibling,nextSibling}=this;while(previousSibling){if(previousSibling.nodeType===TEXT_NODE)text.unshift(previousSibling[VALUE]);else break;previousSibling=previousSibling.previousSibling}text.push(this[VALUE]);while(nextSibling){if(nextSibling.nodeType===TEXT_NODE)text.push(nextSibling[VALUE]);else break;nextSibling=nextSibling.nextSibling}return text.join("")}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new Text6(ownerDocument,data)}toString(){return escape2(this[VALUE])}}var isNode=(node)=>node instanceof Node2,insert=(parentNode,child,nodes)=>{let{ownerDocument}=parentNode;for(let node of nodes)parentNode.insertBefore(isNode(node)?node:new Text6(ownerDocument,node),child)};class ParentNode extends Node2{constructor(ownerDocument,localName,nodeType){super(ownerDocument,localName,nodeType);this[PRIVATE]=null,this[NEXT]=this[END]={[NEXT]:null,[PREV]:this,[START]:this,nodeType:NODE_END,ownerDocument:this.ownerDocument,parentNode:null}}get childNodes(){let childNodes=new NodeList,{firstChild}=this;while(firstChild)childNodes.push(firstChild),firstChild=nextSibling(firstChild);return childNodes}get children(){let children=new NodeList,{firstElementChild}=this;while(firstElementChild)children.push(firstElementChild),firstElementChild=nextElementSibling2(firstElementChild);return children}get firstChild(){let{[NEXT]:next,[END]:end}=this;while(next.nodeType===ATTRIBUTE_NODE)next=next[NEXT];return next===end?null:next}get firstElementChild(){let{firstChild}=this;while(firstChild){if(firstChild.nodeType===ELEMENT_NODE)return firstChild;firstChild=nextSibling(firstChild)}return null}get lastChild(){let prev=this[END][PREV];switch(prev.nodeType){case NODE_END:return prev[START];case ATTRIBUTE_NODE:return null}return prev===this?null:prev}get lastElementChild(){let{lastChild}=this;while(lastChild){if(lastChild.nodeType===ELEMENT_NODE)return lastChild;lastChild=previousSibling(lastChild)}return null}get childElementCount(){return this.children.length}prepend(...nodes){insert(this,this.firstChild,nodes)}append(...nodes){insert(this,this[END],nodes)}replaceChildren(...nodes){let{[NEXT]:next,[END]:end}=this;while(next!==end&&next.nodeType===ATTRIBUTE_NODE)next=next[NEXT];while(next!==end){let after=getEnd(next)[NEXT];next.remove(),next=after}if(nodes.length)insert(this,end,nodes)}getElementsByClassName(className){let elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&next.hasAttribute("class")&&next.classList.has(className))elements.push(next);next=next[NEXT]}return elements}getElementsByTagName(tagName){let elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&(next.localName===tagName||localCase(next)===tagName))elements.push(next);next=next[NEXT]}return elements}querySelector(selectors){let matches=prepareMatch(this,selectors),{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&matches(next))return next;next=next.nodeType===ELEMENT_NODE&&next.localName==="template"?next[END]:next[NEXT]}return null}querySelectorAll(selectors){let matches=prepareMatch(this,selectors),elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&matches(next))elements.push(next);next=next.nodeType===ELEMENT_NODE&&next.localName==="template"?next[END]:next[NEXT]}return elements}appendChild(node){return this.insertBefore(node,this[END])}contains(node){let parentNode=node;while(parentNode&&parentNode!==this)parentNode=parentNode.parentNode;return parentNode===this}insertBefore(node,before=null){if(node===before)return node;if(node===this)throw Error("unable to append a node to itself");let next=before||this[END];switch(node.nodeType){case ELEMENT_NODE:node.remove(),node.parentNode=this,knownBoundaries(next[PREV],node,next),moCallback(node,null),connectedCallback(node);break;case DOCUMENT_FRAGMENT_NODE:{let{[PRIVATE]:parentNode,firstChild,lastChild}=node;if(firstChild){if(knownSegment(next[PREV],firstChild,lastChild,next),knownAdjacent(node,node[END]),parentNode)parentNode.replaceChildren();do if(firstChild.parentNode=this,moCallback(firstChild,null),firstChild.nodeType===ELEMENT_NODE)connectedCallback(firstChild);while(firstChild!==lastChild&&(firstChild=nextSibling(firstChild)))}break}case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:node.remove();default:node.parentNode=this,knownSiblings(next[PREV],node,next),moCallback(node,null);break}return node}normalize(){let{[NEXT]:next,[END]:end}=this;while(next!==end){let{[NEXT]:$next,[PREV]:$prev,nodeType}=next;if(nodeType===TEXT_NODE){if(!next[VALUE])next.remove();else if($prev&&$prev.nodeType===TEXT_NODE)$prev.textContent+=next.textContent,next.remove()}next=$next}}removeChild(node){if(node.parentNode!==this)throw Error("node is not a child");return node.remove(),node}replaceChild(node,replaced){let next=getEnd(replaced)[NEXT];return replaced.remove(),this.insertBefore(node,next),replaced}}class NonElementParentNode extends ParentNode{getElementById(id){let{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&next.id===id)return next;next=next[NEXT]}return null}cloneNode(deep){let{ownerDocument,constructor}=this,nonEPN=new constructor(ownerDocument);if(deep){let{[END]:end}=nonEPN;for(let node of this.childNodes)nonEPN.insertBefore(node.cloneNode(deep),end)}return nonEPN}toString(){let{childNodes,localName}=this;return`<${localName}>${childNodes.join("")}</${localName}>`}toJSON(){let json=[];return nonElementAsJSON(this,json),json}}class DocumentFragment extends NonElementParentNode{constructor(ownerDocument){super(ownerDocument,"#document-fragment",DOCUMENT_FRAGMENT_NODE)}}class DocumentType extends Node2{constructor(ownerDocument,name,publicId="",systemId=""){super(ownerDocument,"#document-type",DOCUMENT_TYPE_NODE);this.name=name,this.publicId=publicId,this.systemId=systemId}cloneNode(){let{ownerDocument,name,publicId,systemId}=this;return new DocumentType(ownerDocument,name,publicId,systemId)}toString(){let{name,publicId,systemId}=this,hasPublic=0<publicId.length,str=[name];if(hasPublic)str.push("PUBLIC",`"${publicId}"`);if(systemId.length){if(!hasPublic)str.push("SYSTEM");str.push(`"${systemId}"`)}return`<!DOCTYPE ${str.join(" ")}>`}toJSON(){let json=[];return documentTypeAsJSON(this,json),json}}var getInnerHtml=(node)=>node.childNodes.join(""),setInnerHtml=(node,html)=>{let{ownerDocument}=node,{constructor}=ownerDocument,document=new constructor;document[CUSTOM_ELEMENTS]=ownerDocument[CUSTOM_ELEMENTS];let{childNodes}=parseFromString(document,ignoreCase(node),html);node.replaceChildren(...childNodes.map(setOwnerDocument,ownerDocument))};function setOwnerDocument(node){switch(node.ownerDocument=this,node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:node.childNodes.forEach(setOwnerDocument,this);break}return node}var esm_default2=(camel)=>camel.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z0-9]+)([A-Z]))/g,"$2$5-$3$6").toLowerCase();var refs=new WeakMap,key=(name)=>`data-${esm_default2(name)}`,prop=(name)=>name.slice(5).replace(/-([a-z])/g,(_,$1)=>$1.toUpperCase()),handler={get(dataset,name){if(name in dataset)return refs.get(dataset).getAttribute(key(name))},set(dataset,name,value){return dataset[name]=value,refs.get(dataset).setAttribute(key(name),value),!0},deleteProperty(dataset,name){if(name in dataset)refs.get(dataset).removeAttribute(key(name));return delete dataset[name]}};class DOMStringMap{constructor(ref){for(let{name,value}of ref.attributes)if(/^data-/.test(name))this[prop(name)]=value;return refs.set(this,ref),new Proxy(this,handler)}}setPrototypeOf(DOMStringMap.prototype,null);var{add}=Set.prototype,addTokens=(self,tokens)=>{for(let token of tokens)if(token)add.call(self,token)},update=({[OWNER_ELEMENT]:ownerElement,value})=>{let attribute=ownerElement.getAttributeNode("class");if(attribute)attribute.value=value;else setAttribute(ownerElement,new Attr(ownerElement.ownerDocument,"class",value))};class DOMTokenList extends Set{constructor(ownerElement){super();this[OWNER_ELEMENT]=ownerElement;let attribute=ownerElement.getAttributeNode("class");if(attribute)addTokens(this,attribute.value.split(/\s+/))}get length(){return this.size}get value(){return[...this].join(" ")}add(...tokens){addTokens(this,tokens),update(this)}contains(token){return this.has(token)}remove(...tokens){for(let token of tokens)this.delete(token);update(this)}toggle(token,force){if(this.has(token)){if(force)return!0;this.delete(token),update(this)}else if(force||arguments.length===1)return super.add(token),update(this),!0;return!1}replace(token,newToken){if(this.has(token))return this.delete(token),super.add(newToken),update(this),!0;return!1}supports(){return!0}}var refs2=new WeakMap,getKeys=(style)=>[...style.keys()].filter((key)=>key!==PRIVATE),updateKeys=(style)=>{let attr=refs2.get(style).getAttributeNode("style");if(!attr||attr[CHANGED]||style.get(PRIVATE)!==attr){if(style.clear(),attr){style.set(PRIVATE,attr);for(let rule of attr[VALUE].split(/\s*;\s*/)){let[key,...rest]=rule.split(":");if(rest.length>0){key=key.trim();let value=rest.join(":").trim();if(key&&value)style.set(key,value)}}}}return attr},handler2={get(style,name){if(name in prototype)return style[name];if(updateKeys(style),name==="length")return getKeys(style).length;if(/^\d+$/.test(name))return getKeys(style)[name];return style.get(esm_default2(name))??""},set(style,name,value){if(name==="cssText")style[name]=value;else{let attr=updateKeys(style);if(value==null)style.delete(esm_default2(name));else style.set(esm_default2(name),value);if(!attr){let element=refs2.get(style);attr=element.ownerDocument.createAttribute("style"),element.setAttributeNode(attr),style.set(PRIVATE,attr)}attr[CHANGED]=!1,attr[VALUE]=style.toString()}return!0}};class CSSStyleDeclaration extends Map{constructor(element){super();return refs2.set(this,element),new Proxy(this,handler2)}get cssText(){return this.toString()}set cssText(value){refs2.get(this).setAttribute("style",value)}getPropertyValue(name){let self=this[PRIVATE];return handler2.get(self,name)}setProperty(name,value){let self=this[PRIVATE];handler2.set(self,name,value)}removeProperty(name){let self=this[PRIVATE];handler2.set(self,name,null)}[Symbol.iterator](){let self=this[PRIVATE];updateKeys(self);let keys=getKeys(self),{length}=keys,i=0;return{next(){let done=i===length;return{done,value:done?null:keys[i++]}}}}get[PRIVATE](){return this}toString(){let self=this[PRIVATE];updateKeys(self);let cssText=[];return self.forEach(push,cssText),cssText.join(";")}}var{prototype}=CSSStyleDeclaration;function push(value,key){if(key!==PRIVATE)this.push(`${key}:${value}`)}function getCurrentTarget(ev){return ev.currentTarget}class GlobalEvent{static get BUBBLING_PHASE(){return 3}static get AT_TARGET(){return 2}static get CAPTURING_PHASE(){return 1}static get NONE(){return 0}constructor(type,eventInitDict={}){this.type=type,this.bubbles=!!eventInitDict.bubbles,this.cancelBubble=!1,this._stopImmediatePropagationFlag=!1,this.cancelable=!!eventInitDict.cancelable,this.eventPhase=this.NONE,this.timeStamp=Date.now(),this.defaultPrevented=!1,this.originalTarget=null,this.returnValue=null,this.srcElement=null,this.target=null,this._path=[]}get BUBBLING_PHASE(){return 3}get AT_TARGET(){return 2}get CAPTURING_PHASE(){return 1}get NONE(){return 0}preventDefault(){this.defaultPrevented=!0}composedPath(){return this._path.map(getCurrentTarget)}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this.stopPropagation(),this._stopImmediatePropagationFlag=!0}}class NamedNodeMap extends Array{constructor(ownerElement){super();this.ownerElement=ownerElement}getNamedItem(name){return this.ownerElement.getAttributeNode(name)}setNamedItem(attr){this.ownerElement.setAttributeNode(attr),this.unshift(attr)}removeNamedItem(name){let item=this.getNamedItem(name);this.ownerElement.removeAttribute(name),this.splice(this.indexOf(item),1)}item(index){return index<this.length?this[index]:null}getNamedItemNS(_,name){return this.getNamedItem(name)}setNamedItemNS(_,attr){return this.setNamedItem(attr)}removeNamedItemNS(_,name){return this.removeNamedItem(name)}}class ShadowRoot extends NonElementParentNode{constructor(host){super(host.ownerDocument,"#shadow-root",DOCUMENT_FRAGMENT_NODE);this.host=host}get innerHTML(){return getInnerHtml(this)}set innerHTML(html){setInnerHtml(this,html)}}var attributesHandler={get(target,key){return key in target?target[key]:target.find(({name})=>name===key)}},create2=(ownerDocument,element,localName)=>{if("ownerSVGElement"in element){let svg=ownerDocument.createElementNS(SVG_NAMESPACE,localName);return svg.ownerSVGElement=element.ownerSVGElement,svg}return ownerDocument.createElement(localName)},isVoid=({localName,ownerDocument})=>ownerDocument[MIME].voidElements.test(localName);class Element2 extends ParentNode{constructor(ownerDocument,localName){super(ownerDocument,localName,ELEMENT_NODE);this[CLASS_LIST]=null,this[DATASET]=null,this[STYLE]=null}get isConnected(){return isConnected(this)}get parentElement(){return parentElement(this)}get previousSibling(){return previousSibling(this)}get nextSibling(){return nextSibling(this)}get namespaceURI(){return"http://www.w3.org/1999/xhtml"}get previousElementSibling(){return previousElementSibling(this)}get nextElementSibling(){return nextElementSibling2(this)}before(...nodes){before(this,nodes)}after(...nodes){after(this,nodes)}replaceWith(...nodes){replaceWith(this,nodes)}remove(){remove(this[PREV],this,this[END][NEXT])}get id(){return stringAttribute.get(this,"id")}set id(value){stringAttribute.set(this,"id",value)}get className(){return this.classList.value}set className(value){let{classList}=this;classList.clear(),classList.add(...$String(value).split(/\s+/))}get nodeName(){return localCase(this)}get tagName(){return localCase(this)}get classList(){return this[CLASS_LIST]||(this[CLASS_LIST]=new DOMTokenList(this))}get dataset(){return this[DATASET]||(this[DATASET]=new DOMStringMap(this))}getBoundingClientRect(){return{x:0,y:0,bottom:0,height:0,left:0,right:0,top:0,width:0}}get nonce(){return stringAttribute.get(this,"nonce")}set nonce(value){stringAttribute.set(this,"nonce",value)}get style(){return this[STYLE]||(this[STYLE]=new CSSStyleDeclaration(this))}get tabIndex(){return numericAttribute.get(this,"tabindex")||-1}set tabIndex(value){numericAttribute.set(this,"tabindex",value)}get slot(){return stringAttribute.get(this,"slot")}set slot(value){stringAttribute.set(this,"slot",value)}get innerText(){let text=[],{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===TEXT_NODE)text.push(next.textContent.replace(/\s+/g," "));else if(text.length&&next[NEXT]!=end&&BLOCK_ELEMENTS.has(next.tagName))text.push(`
|
|
51
|
-
`);next=next[NEXT]}return text.join("")}get textContent(){let text=[],{[NEXT]:next,[END]:end}=this;while(next!==end){let nodeType=next.nodeType;if(nodeType===TEXT_NODE||nodeType===CDATA_SECTION_NODE)text.push(next.textContent);next=next[NEXT]}return text.join("")}set textContent(text){if(this.replaceChildren(),text!=null&&text!=="")this.appendChild(new Text6(this.ownerDocument,text))}get innerHTML(){return getInnerHtml(this)}set innerHTML(html){setInnerHtml(this,html)}get outerHTML(){return this.toString()}set outerHTML(html){let template=this.ownerDocument.createElement("");template.innerHTML=html,this.replaceWith(...template.childNodes)}get attributes(){let attributes=new NamedNodeMap(this),next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE)attributes.push(next),next=next[NEXT];return new Proxy(attributes,attributesHandler)}focus(){this.dispatchEvent(new GlobalEvent("focus"))}getAttribute(name){if(name==="class")return this.className;let attribute=this.getAttributeNode(name);return attribute&&(ignoreCase(this)?attribute.value:escape2(attribute.value))}getAttributeNode(name){let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next.name===name)return next;next=next[NEXT]}return null}getAttributeNames(){let attributes=new NodeList,next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE)attributes.push(next.name),next=next[NEXT];return attributes}hasAttribute(name){return!!this.getAttributeNode(name)}hasAttributes(){return this[NEXT].nodeType===ATTRIBUTE_NODE}removeAttribute(name){if(name==="class"&&this[CLASS_LIST])this[CLASS_LIST].clear();let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next.name===name){removeAttribute(this,next);return}next=next[NEXT]}}removeAttributeNode(attribute){let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next===attribute){removeAttribute(this,next);return}next=next[NEXT]}}setAttribute(name,value){if(name==="class")this.className=value;else{let attribute=this.getAttributeNode(name);if(attribute)attribute.value=value;else setAttribute(this,new Attr(this.ownerDocument,name,value))}}setAttributeNode(attribute){let{name}=attribute,previously=this.getAttributeNode(name);if(previously!==attribute){if(previously)this.removeAttributeNode(previously);let{ownerElement}=attribute;if(ownerElement)ownerElement.removeAttributeNode(attribute);setAttribute(this,attribute)}return previously}toggleAttribute(name,force){if(this.hasAttribute(name)){if(!force)return this.removeAttribute(name),!1;return!0}else if(force||arguments.length===1)return this.setAttribute(name,""),!0;return!1}get shadowRoot(){if(shadowRoots.has(this)){let{mode,shadowRoot}=shadowRoots.get(this);if(mode==="open")return shadowRoot}return null}attachShadow(init){if(shadowRoots.has(this))throw Error("operation not supported");let shadowRoot=new ShadowRoot(this);return shadowRoots.set(this,{mode:init.mode,shadowRoot}),shadowRoot}matches(selectors){return matches(this,selectors)}closest(selectors){let parentElement=this,matches=prepareMatch(parentElement,selectors);while(parentElement&&!matches(parentElement))parentElement=parentElement.parentElement;return parentElement}insertAdjacentElement(position,element){let{parentElement}=this;switch(position){case"beforebegin":if(parentElement){parentElement.insertBefore(element,this);break}return null;case"afterbegin":this.insertBefore(element,this.firstChild);break;case"beforeend":this.insertBefore(element,null);break;case"afterend":if(parentElement){parentElement.insertBefore(element,this.nextSibling);break}return null}return element}insertAdjacentHTML(position,html){this.insertAdjacentElement(position,htmlToFragment(this.ownerDocument,html))}insertAdjacentText(position,text){let node=this.ownerDocument.createTextNode(text);this.insertAdjacentElement(position,node)}cloneNode(deep=!1){let{ownerDocument,localName}=this,addNext=(next)=>{next.parentNode=parentNode,knownAdjacent($next,next),$next=next},clone=create2(ownerDocument,this,localName),parentNode=clone,$next=clone,{[NEXT]:next,[END]:prev}=this;while(next!==prev&&(deep||next.nodeType===ATTRIBUTE_NODE)){switch(next.nodeType){case NODE_END:knownAdjacent($next,parentNode[END]),$next=parentNode[END],parentNode=parentNode.parentNode;break;case ELEMENT_NODE:{let node=create2(ownerDocument,next,next.localName);addNext(node),parentNode=node;break}case ATTRIBUTE_NODE:{let attr=next.cloneNode(deep);attr.ownerElement=parentNode,addNext(attr);break}case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:addNext(next.cloneNode(deep));break}next=next[NEXT]}return knownAdjacent($next,clone[END]),clone}toString(){let out=[],{[END]:end}=this,next={[NEXT]:this},isOpened=!1;do switch(next=next[NEXT],next.nodeType){case ATTRIBUTE_NODE:{let attr=" "+next;switch(attr){case" id":case" class":case" style":break;default:out.push(attr)}break}case NODE_END:{let start=next[START];if(isOpened){if("ownerSVGElement"in start)out.push(" />");else if(isVoid(start))out.push(ignoreCase(start)?">":" />");else out.push(`></${start.localName}>`);isOpened=!1}else out.push(`</${start.localName}>`);break}case ELEMENT_NODE:if(isOpened)out.push(">");if(next.toString!==this.toString)out.push(next.toString()),next=next[END],isOpened=!1;else out.push(`<${next.localName}`),isOpened=!0;break;case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:out.push((isOpened?">":"")+next),isOpened=!1;break}while(next!==end);return out.join("")}toJSON(){let json=[];return elementAsJSON(this,json),json}getAttributeNS(_,name){return this.getAttribute(name)}getElementsByTagNameNS(_,name){return this.getElementsByTagName(name)}hasAttributeNS(_,name){return this.hasAttribute(name)}removeAttributeNS(_,name){this.removeAttribute(name)}setAttributeNS(_,name,value){this.setAttribute(name,value)}setAttributeNodeNS(attr){return this.setAttributeNode(attr)}}var classNames=new WeakMap,handler3={get(target,name){return target[name]},set(target,name,value){return target[name]=value,!0}};class SVGElement extends Element2{constructor(ownerDocument,localName,ownerSVGElement=null){super(ownerDocument,localName);this.ownerSVGElement=ownerSVGElement}get className(){if(!classNames.has(this))classNames.set(this,new Proxy({baseVal:"",animVal:""},handler3));return classNames.get(this)}set className(value){let{classList}=this;classList.clear(),classList.add(...$String(value).split(/\s+/))}get namespaceURI(){return"http://www.w3.org/2000/svg"}getAttribute(name){return name==="class"?[...this.classList].join(" "):super.getAttribute(name)}setAttribute(name,value){if(name==="class")this.className=value;else if(name==="style"){let{className}=this;className.baseVal=className.animVal=value}super.setAttribute(name,value)}}var illegalConstructor=()=>{throw TypeError("Illegal constructor")};function Attr2(){illegalConstructor()}setPrototypeOf(Attr2,Attr);Attr2.prototype=Attr.prototype;function CDATASection2(){illegalConstructor()}setPrototypeOf(CDATASection2,CDATASection);CDATASection2.prototype=CDATASection.prototype;function CharacterData2(){illegalConstructor()}setPrototypeOf(CharacterData2,CharacterData);CharacterData2.prototype=CharacterData.prototype;function Comment7(){illegalConstructor()}setPrototypeOf(Comment7,Comment3);Comment7.prototype=Comment3.prototype;function DocumentFragment2(){illegalConstructor()}setPrototypeOf(DocumentFragment2,DocumentFragment);DocumentFragment2.prototype=DocumentFragment.prototype;function DocumentType2(){illegalConstructor()}setPrototypeOf(DocumentType2,DocumentType);DocumentType2.prototype=DocumentType.prototype;function Element3(){illegalConstructor()}setPrototypeOf(Element3,Element2);Element3.prototype=Element2.prototype;function Node3(){illegalConstructor()}setPrototypeOf(Node3,Node2);Node3.prototype=Node2.prototype;function ShadowRoot2(){illegalConstructor()}setPrototypeOf(ShadowRoot2,ShadowRoot);ShadowRoot2.prototype=ShadowRoot.prototype;function Text7(){illegalConstructor()}setPrototypeOf(Text7,Text6);Text7.prototype=Text6.prototype;function SVGElement2(){illegalConstructor()}setPrototypeOf(SVGElement2,SVGElement);SVGElement2.prototype=SVGElement.prototype;var Facades={Attr:Attr2,CDATASection:CDATASection2,CharacterData:CharacterData2,Comment:Comment7,DocumentFragment:DocumentFragment2,DocumentType:DocumentType2,Element:Element3,Node:Node3,ShadowRoot:ShadowRoot2,Text:Text7,SVGElement:SVGElement2};var Level0=new WeakMap,level0={get(element,name){return Level0.has(element)&&Level0.get(element)[name]||null},set(element,name,value){if(!Level0.has(element))Level0.set(element,{});let handlers=Level0.get(element),type=name.slice(2);if(handlers[name])element.removeEventListener(type,handlers[name],!1);if(handlers[name]=value)element.addEventListener(type,value,!1)}};class HTMLElement extends Element2{static get observedAttributes(){return[]}constructor(ownerDocument=null,localName=""){super(ownerDocument,localName);let ownerLess=!ownerDocument,options;if(ownerLess){let{constructor:Class}=this;if(!Classes.has(Class))throw Error("unable to initialize this Custom Element");({ownerDocument,localName,options}=Classes.get(Class))}if(ownerDocument[UPGRADE]){let{element,values}=ownerDocument[UPGRADE];ownerDocument[UPGRADE]=null;for(let[key,value]of values)element[key]=value;return element}if(ownerLess){if(this.ownerDocument=this[END].ownerDocument=ownerDocument,this.localName=localName,customElements.set(this,{connected:!1}),options.is)this.setAttribute("is",options.is)}}blur(){this.dispatchEvent(new GlobalEvent("blur"))}click(){let clickEvent=new GlobalEvent("click",{bubbles:!0,cancelable:!0});clickEvent.button=0,this.dispatchEvent(clickEvent)}get accessKeyLabel(){let{accessKey}=this;return accessKey&&`Alt+Shift+${accessKey}`}get isContentEditable(){return this.hasAttribute("contenteditable")}get contentEditable(){return booleanAttribute.get(this,"contenteditable")}set contentEditable(value){booleanAttribute.set(this,"contenteditable",value)}get draggable(){return booleanAttribute.get(this,"draggable")}set draggable(value){booleanAttribute.set(this,"draggable",value)}get hidden(){return booleanAttribute.get(this,"hidden")}set hidden(value){booleanAttribute.set(this,"hidden",value)}get spellcheck(){return booleanAttribute.get(this,"spellcheck")}set spellcheck(value){booleanAttribute.set(this,"spellcheck",value)}get accessKey(){return stringAttribute.get(this,"accesskey")}set accessKey(value){stringAttribute.set(this,"accesskey",value)}get dir(){return stringAttribute.get(this,"dir")}set dir(value){stringAttribute.set(this,"dir",value)}get lang(){return stringAttribute.get(this,"lang")}set lang(value){stringAttribute.set(this,"lang",value)}get title(){return stringAttribute.get(this,"title")}set title(value){stringAttribute.set(this,"title",value)}get onabort(){return level0.get(this,"onabort")}set onabort(value){level0.set(this,"onabort",value)}get onblur(){return level0.get(this,"onblur")}set onblur(value){level0.set(this,"onblur",value)}get oncancel(){return level0.get(this,"oncancel")}set oncancel(value){level0.set(this,"oncancel",value)}get oncanplay(){return level0.get(this,"oncanplay")}set oncanplay(value){level0.set(this,"oncanplay",value)}get oncanplaythrough(){return level0.get(this,"oncanplaythrough")}set oncanplaythrough(value){level0.set(this,"oncanplaythrough",value)}get onchange(){return level0.get(this,"onchange")}set onchange(value){level0.set(this,"onchange",value)}get onclick(){return level0.get(this,"onclick")}set onclick(value){level0.set(this,"onclick",value)}get onclose(){return level0.get(this,"onclose")}set onclose(value){level0.set(this,"onclose",value)}get oncontextmenu(){return level0.get(this,"oncontextmenu")}set oncontextmenu(value){level0.set(this,"oncontextmenu",value)}get oncuechange(){return level0.get(this,"oncuechange")}set oncuechange(value){level0.set(this,"oncuechange",value)}get ondblclick(){return level0.get(this,"ondblclick")}set ondblclick(value){level0.set(this,"ondblclick",value)}get ondrag(){return level0.get(this,"ondrag")}set ondrag(value){level0.set(this,"ondrag",value)}get ondragend(){return level0.get(this,"ondragend")}set ondragend(value){level0.set(this,"ondragend",value)}get ondragenter(){return level0.get(this,"ondragenter")}set ondragenter(value){level0.set(this,"ondragenter",value)}get ondragleave(){return level0.get(this,"ondragleave")}set ondragleave(value){level0.set(this,"ondragleave",value)}get ondragover(){return level0.get(this,"ondragover")}set ondragover(value){level0.set(this,"ondragover",value)}get ondragstart(){return level0.get(this,"ondragstart")}set ondragstart(value){level0.set(this,"ondragstart",value)}get ondrop(){return level0.get(this,"ondrop")}set ondrop(value){level0.set(this,"ondrop",value)}get ondurationchange(){return level0.get(this,"ondurationchange")}set ondurationchange(value){level0.set(this,"ondurationchange",value)}get onemptied(){return level0.get(this,"onemptied")}set onemptied(value){level0.set(this,"onemptied",value)}get onended(){return level0.get(this,"onended")}set onended(value){level0.set(this,"onended",value)}get onerror(){return level0.get(this,"onerror")}set onerror(value){level0.set(this,"onerror",value)}get onfocus(){return level0.get(this,"onfocus")}set onfocus(value){level0.set(this,"onfocus",value)}get oninput(){return level0.get(this,"oninput")}set oninput(value){level0.set(this,"oninput",value)}get oninvalid(){return level0.get(this,"oninvalid")}set oninvalid(value){level0.set(this,"oninvalid",value)}get onkeydown(){return level0.get(this,"onkeydown")}set onkeydown(value){level0.set(this,"onkeydown",value)}get onkeypress(){return level0.get(this,"onkeypress")}set onkeypress(value){level0.set(this,"onkeypress",value)}get onkeyup(){return level0.get(this,"onkeyup")}set onkeyup(value){level0.set(this,"onkeyup",value)}get onload(){return level0.get(this,"onload")}set onload(value){level0.set(this,"onload",value)}get onloadeddata(){return level0.get(this,"onloadeddata")}set onloadeddata(value){level0.set(this,"onloadeddata",value)}get onloadedmetadata(){return level0.get(this,"onloadedmetadata")}set onloadedmetadata(value){level0.set(this,"onloadedmetadata",value)}get onloadstart(){return level0.get(this,"onloadstart")}set onloadstart(value){level0.set(this,"onloadstart",value)}get onmousedown(){return level0.get(this,"onmousedown")}set onmousedown(value){level0.set(this,"onmousedown",value)}get onmouseenter(){return level0.get(this,"onmouseenter")}set onmouseenter(value){level0.set(this,"onmouseenter",value)}get onmouseleave(){return level0.get(this,"onmouseleave")}set onmouseleave(value){level0.set(this,"onmouseleave",value)}get onmousemove(){return level0.get(this,"onmousemove")}set onmousemove(value){level0.set(this,"onmousemove",value)}get onmouseout(){return level0.get(this,"onmouseout")}set onmouseout(value){level0.set(this,"onmouseout",value)}get onmouseover(){return level0.get(this,"onmouseover")}set onmouseover(value){level0.set(this,"onmouseover",value)}get onmouseup(){return level0.get(this,"onmouseup")}set onmouseup(value){level0.set(this,"onmouseup",value)}get onmousewheel(){return level0.get(this,"onmousewheel")}set onmousewheel(value){level0.set(this,"onmousewheel",value)}get onpause(){return level0.get(this,"onpause")}set onpause(value){level0.set(this,"onpause",value)}get onplay(){return level0.get(this,"onplay")}set onplay(value){level0.set(this,"onplay",value)}get onplaying(){return level0.get(this,"onplaying")}set onplaying(value){level0.set(this,"onplaying",value)}get onprogress(){return level0.get(this,"onprogress")}set onprogress(value){level0.set(this,"onprogress",value)}get onratechange(){return level0.get(this,"onratechange")}set onratechange(value){level0.set(this,"onratechange",value)}get onreset(){return level0.get(this,"onreset")}set onreset(value){level0.set(this,"onreset",value)}get onresize(){return level0.get(this,"onresize")}set onresize(value){level0.set(this,"onresize",value)}get onscroll(){return level0.get(this,"onscroll")}set onscroll(value){level0.set(this,"onscroll",value)}get onseeked(){return level0.get(this,"onseeked")}set onseeked(value){level0.set(this,"onseeked",value)}get onseeking(){return level0.get(this,"onseeking")}set onseeking(value){level0.set(this,"onseeking",value)}get onselect(){return level0.get(this,"onselect")}set onselect(value){level0.set(this,"onselect",value)}get onshow(){return level0.get(this,"onshow")}set onshow(value){level0.set(this,"onshow",value)}get onstalled(){return level0.get(this,"onstalled")}set onstalled(value){level0.set(this,"onstalled",value)}get onsubmit(){return level0.get(this,"onsubmit")}set onsubmit(value){level0.set(this,"onsubmit",value)}get onsuspend(){return level0.get(this,"onsuspend")}set onsuspend(value){level0.set(this,"onsuspend",value)}get ontimeupdate(){return level0.get(this,"ontimeupdate")}set ontimeupdate(value){level0.set(this,"ontimeupdate",value)}get ontoggle(){return level0.get(this,"ontoggle")}set ontoggle(value){level0.set(this,"ontoggle",value)}get onvolumechange(){return level0.get(this,"onvolumechange")}set onvolumechange(value){level0.set(this,"onvolumechange",value)}get onwaiting(){return level0.get(this,"onwaiting")}set onwaiting(value){level0.set(this,"onwaiting",value)}get onauxclick(){return level0.get(this,"onauxclick")}set onauxclick(value){level0.set(this,"onauxclick",value)}get ongotpointercapture(){return level0.get(this,"ongotpointercapture")}set ongotpointercapture(value){level0.set(this,"ongotpointercapture",value)}get onlostpointercapture(){return level0.get(this,"onlostpointercapture")}set onlostpointercapture(value){level0.set(this,"onlostpointercapture",value)}get onpointercancel(){return level0.get(this,"onpointercancel")}set onpointercancel(value){level0.set(this,"onpointercancel",value)}get onpointerdown(){return level0.get(this,"onpointerdown")}set onpointerdown(value){level0.set(this,"onpointerdown",value)}get onpointerenter(){return level0.get(this,"onpointerenter")}set onpointerenter(value){level0.set(this,"onpointerenter",value)}get onpointerleave(){return level0.get(this,"onpointerleave")}set onpointerleave(value){level0.set(this,"onpointerleave",value)}get onpointermove(){return level0.get(this,"onpointermove")}set onpointermove(value){level0.set(this,"onpointermove",value)}get onpointerout(){return level0.get(this,"onpointerout")}set onpointerout(value){level0.set(this,"onpointerout",value)}get onpointerover(){return level0.get(this,"onpointerover")}set onpointerover(value){level0.set(this,"onpointerover",value)}get onpointerup(){return level0.get(this,"onpointerup")}set onpointerup(value){level0.set(this,"onpointerup",value)}}var tagName="template";class HTMLTemplateElement extends HTMLElement{constructor(ownerDocument){super(ownerDocument,tagName);let content=this.ownerDocument.createDocumentFragment();(this[CONTENT]=content)[PRIVATE]=this}get content(){if(this.hasChildNodes()&&!this[CONTENT].hasChildNodes())for(let node of this.childNodes)this[CONTENT].appendChild(node.cloneNode(!0));return this[CONTENT]}}registerHTMLClass(tagName,HTMLTemplateElement);class HTMLHtmlElement extends HTMLElement{constructor(ownerDocument,localName="html"){super(ownerDocument,localName)}}var{toString}=HTMLElement.prototype;class TextElement extends HTMLElement{get innerHTML(){return this.textContent}set innerHTML(html){this.textContent=html}toString(){return toString.call(this.cloneNode()).replace("><",()=>`>${this.textContent}<`)}}var tagName2="script";class HTMLScriptElement extends TextElement{constructor(ownerDocument,localName=tagName2){super(ownerDocument,localName)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get defer(){return booleanAttribute.get(this,"defer")}set defer(value){booleanAttribute.set(this,"defer",value)}get crossOrigin(){return stringAttribute.get(this,"crossorigin")}set crossOrigin(value){stringAttribute.set(this,"crossorigin",value)}get nomodule(){return booleanAttribute.get(this,"nomodule")}set nomodule(value){booleanAttribute.set(this,"nomodule",value)}get referrerPolicy(){return stringAttribute.get(this,"referrerpolicy")}set referrerPolicy(value){stringAttribute.set(this,"referrerpolicy",value)}get nonce(){return stringAttribute.get(this,"nonce")}set nonce(value){stringAttribute.set(this,"nonce",value)}get async(){return booleanAttribute.get(this,"async")}set async(value){booleanAttribute.set(this,"async",value)}get text(){return this.textContent}set text(content){this.textContent=content}}registerHTMLClass(tagName2,HTMLScriptElement);class HTMLFrameElement extends HTMLElement{constructor(ownerDocument,localName="frame"){super(ownerDocument,localName)}}var tagName3="iframe";class HTMLIFrameElement extends HTMLElement{constructor(ownerDocument,localName=tagName3){super(ownerDocument,localName)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcdoc(){return stringAttribute.get(this,"srcdoc")}set srcdoc(value){stringAttribute.set(this,"srcdoc",value)}get name(){return stringAttribute.get(this,"name")}set name(value){stringAttribute.set(this,"name",value)}get allow(){return stringAttribute.get(this,"allow")}set allow(value){stringAttribute.set(this,"allow",value)}get allowFullscreen(){return booleanAttribute.get(this,"allowfullscreen")}set allowFullscreen(value){booleanAttribute.set(this,"allowfullscreen",value)}get referrerPolicy(){return stringAttribute.get(this,"referrerpolicy")}set referrerPolicy(value){stringAttribute.set(this,"referrerpolicy",value)}get loading(){return stringAttribute.get(this,"loading")}set loading(value){stringAttribute.set(this,"loading",value)}}registerHTMLClass(tagName3,HTMLIFrameElement);class HTMLObjectElement extends HTMLElement{constructor(ownerDocument,localName="object"){super(ownerDocument,localName)}}class HTMLHeadElement extends HTMLElement{constructor(ownerDocument,localName="head"){super(ownerDocument,localName)}}class HTMLBodyElement extends HTMLElement{constructor(ownerDocument,localName="body"){super(ownerDocument,localName)}}var $setup=require_CSSOM().setup;require_errorUtils();require_regexPatterns();var $CSSStyleDeclaration=require_CSSStyleDeclaration().CSSStyleDeclaration;require_cssstyleTryCatchBlock();var $CSSRule=require_CSSRule().CSSRule,$CSSRuleList=require_CSSRuleList().CSSRuleList,$CSSNestedDeclarations=require_CSSNestedDeclarations().CSSNestedDeclarations,$CSSGroupingRule=require_CSSGroupingRule().CSSGroupingRule,$CSSCounterStyleRule=require_CSSCounterStyleRule().CSSCounterStyleRule,$CSSPropertyRule=require_CSSPropertyRule().CSSPropertyRule,$CSSConditionRule=require_CSSConditionRule().CSSConditionRule,$CSSStyleRule=require_CSSStyleRule().CSSStyleRule,$MediaList=require_MediaList().MediaList,$CSSMediaRule=require_CSSMediaRule().CSSMediaRule,$CSSContainerRule=require_CSSContainerRule().CSSContainerRule,$CSSSupportsRule=require_CSSSupportsRule().CSSSupportsRule,$CSSImportRule=require_CSSImportRule().CSSImportRule,$CSSNamespaceRule=require_CSSNamespaceRule().CSSNamespaceRule,$CSSFontFaceRule=require_CSSFontFaceRule().CSSFontFaceRule,$CSSHostRule=require_CSSHostRule().CSSHostRule,$CSSStartingStyleRule=require_CSSStartingStyleRule().CSSStartingStyleRule,$StyleSheet=require_StyleSheet().StyleSheet,$CSSStyleSheet=require_CSSStyleSheet().CSSStyleSheet,$CSSKeyframesRule=require_CSSKeyframesRule().CSSKeyframesRule,$CSSKeyframeRule=require_CSSKeyframeRule().CSSKeyframeRule,$MatcherList=require_MatcherList().MatcherList,$CSSDocumentRule=require_CSSDocumentRule().CSSDocumentRule,$CSSValue=require_CSSValue().CSSValue,$CSSValueExpression=require_CSSValueExpression().CSSValueExpression,$CSSScopeRule=require_CSSScopeRule().CSSScopeRule,$CSSLayerBlockRule=require_CSSLayerBlockRule().CSSLayerBlockRule,$CSSLayerStatementRule=require_CSSLayerStatementRule().CSSLayerStatementRule,$CSSPageRule=require_CSSPageRule().CSSPageRule,$parse=require_parse().parse,$clone=require_clone().clone;var tagName4="style";class HTMLStyleElement extends TextElement{constructor(ownerDocument,localName=tagName4){super(ownerDocument,localName);this[SHEET]=null}get sheet(){let sheet=this[SHEET];if(sheet!==null)return sheet;return this[SHEET]=$parse(this.textContent)}get innerHTML(){return super.innerHTML||""}set innerHTML(value){super.textContent=value,this[SHEET]=null}get innerText(){return super.innerText||""}set innerText(value){super.textContent=value,this[SHEET]=null}get textContent(){return super.textContent||""}set textContent(value){super.textContent=value,this[SHEET]=null}}registerHTMLClass(tagName4,HTMLStyleElement);class HTMLTimeElement extends HTMLElement{constructor(ownerDocument,localName="time"){super(ownerDocument,localName)}get dateTime(){return stringAttribute.get(this,"datetime")}set dateTime(value){stringAttribute.set(this,"datetime",value)}}registerHTMLClass("time",HTMLTimeElement);class HTMLFieldSetElement extends HTMLElement{constructor(ownerDocument,localName="fieldset"){super(ownerDocument,localName)}}class HTMLEmbedElement extends HTMLElement{constructor(ownerDocument,localName="embed"){super(ownerDocument,localName)}}class HTMLHRElement extends HTMLElement{constructor(ownerDocument,localName="hr"){super(ownerDocument,localName)}}class HTMLProgressElement extends HTMLElement{constructor(ownerDocument,localName="progress"){super(ownerDocument,localName)}}class HTMLParagraphElement extends HTMLElement{constructor(ownerDocument,localName="p"){super(ownerDocument,localName)}}class HTMLTableElement extends HTMLElement{constructor(ownerDocument,localName="table"){super(ownerDocument,localName)}}class HTMLFrameSetElement extends HTMLElement{constructor(ownerDocument,localName="frameset"){super(ownerDocument,localName)}}class HTMLLIElement extends HTMLElement{constructor(ownerDocument,localName="li"){super(ownerDocument,localName)}}class HTMLBaseElement extends HTMLElement{constructor(ownerDocument,localName="base"){super(ownerDocument,localName)}}class HTMLDataListElement extends HTMLElement{constructor(ownerDocument,localName="datalist"){super(ownerDocument,localName)}}var tagName5="input";class HTMLInputElement extends HTMLElement{constructor(ownerDocument,localName=tagName5){super(ownerDocument,localName)}get autofocus(){return booleanAttribute.get(this,"autofocus")||-1}set autofocus(value){booleanAttribute.set(this,"autofocus",value)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(value){this.setAttribute("placeholder",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}get value(){return stringAttribute.get(this,"value")}set value(value){stringAttribute.set(this,"value",value)}}registerHTMLClass(tagName5,HTMLInputElement);class HTMLParamElement extends HTMLElement{constructor(ownerDocument,localName="param"){super(ownerDocument,localName)}}class HTMLMediaElement extends HTMLElement{constructor(ownerDocument,localName="media"){super(ownerDocument,localName)}}class HTMLAudioElement extends HTMLElement{constructor(ownerDocument,localName="audio"){super(ownerDocument,localName)}}var tagName6="h1";class HTMLHeadingElement extends HTMLElement{constructor(ownerDocument,localName=tagName6){super(ownerDocument,localName)}}registerHTMLClass([tagName6,"h2","h3","h4","h5","h6"],HTMLHeadingElement);class HTMLDirectoryElement extends HTMLElement{constructor(ownerDocument,localName="dir"){super(ownerDocument,localName)}}class HTMLQuoteElement extends HTMLElement{constructor(ownerDocument,localName="quote"){super(ownerDocument,localName)}}var import_canvas=__toESM(require_canvas(),1);var{createCanvas}=import_canvas.default,tagName7="canvas";class HTMLCanvasElement extends HTMLElement{constructor(ownerDocument,localName=tagName7){super(ownerDocument,localName);this[IMAGE]=createCanvas(300,150)}get width(){return this[IMAGE].width}set width(value){numericAttribute.set(this,"width",value),this[IMAGE].width=value}get height(){return this[IMAGE].height}set height(value){numericAttribute.set(this,"height",value),this[IMAGE].height=value}getContext(type){return this[IMAGE].getContext(type)}toDataURL(...args){return this[IMAGE].toDataURL(...args)}}registerHTMLClass(tagName7,HTMLCanvasElement);class HTMLLegendElement extends HTMLElement{constructor(ownerDocument,localName="legend"){super(ownerDocument,localName)}}var tagName8="option";class HTMLOptionElement extends HTMLElement{constructor(ownerDocument,localName=tagName8){super(ownerDocument,localName)}get value(){return stringAttribute.get(this,"value")}set value(value){stringAttribute.set(this,"value",value)}get selected(){return booleanAttribute.get(this,"selected")}set selected(value){let option=this.parentElement?.querySelector("option[selected]");if(option&&option!==this)option.selected=!1;booleanAttribute.set(this,"selected",value)}}registerHTMLClass(tagName8,HTMLOptionElement);class HTMLSpanElement extends HTMLElement{constructor(ownerDocument,localName="span"){super(ownerDocument,localName)}}class HTMLMeterElement extends HTMLElement{constructor(ownerDocument,localName="meter"){super(ownerDocument,localName)}}class HTMLVideoElement extends HTMLElement{constructor(ownerDocument,localName="video"){super(ownerDocument,localName)}}class HTMLTableCellElement extends HTMLElement{constructor(ownerDocument,localName="td"){super(ownerDocument,localName)}}var tagName9="title";class HTMLTitleElement extends TextElement{constructor(ownerDocument,localName=tagName9){super(ownerDocument,localName)}}registerHTMLClass(tagName9,HTMLTitleElement);class HTMLOutputElement extends HTMLElement{constructor(ownerDocument,localName="output"){super(ownerDocument,localName)}}class HTMLTableRowElement extends HTMLElement{constructor(ownerDocument,localName="tr"){super(ownerDocument,localName)}}class HTMLDataElement extends HTMLElement{constructor(ownerDocument,localName="data"){super(ownerDocument,localName)}}class HTMLMenuElement extends HTMLElement{constructor(ownerDocument,localName="menu"){super(ownerDocument,localName)}}var tagName10="select";class HTMLSelectElement extends HTMLElement{constructor(ownerDocument,localName=tagName10){super(ownerDocument,localName)}get options(){let children=new NodeList,{firstElementChild}=this;while(firstElementChild){if(firstElementChild.tagName==="OPTGROUP")children.push(...firstElementChild.children);else children.push(firstElementChild);firstElementChild=firstElementChild.nextElementSibling}return children}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get value(){return this.querySelector("option[selected]")?.value}}registerHTMLClass(tagName10,HTMLSelectElement);class HTMLBRElement extends HTMLElement{constructor(ownerDocument,localName="br"){super(ownerDocument,localName)}}var tagName11="button";class HTMLButtonElement extends HTMLElement{constructor(ownerDocument,localName=tagName11){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}}registerHTMLClass(tagName11,HTMLButtonElement);class HTMLMapElement extends HTMLElement{constructor(ownerDocument,localName="map"){super(ownerDocument,localName)}}class HTMLOptGroupElement extends HTMLElement{constructor(ownerDocument,localName="optgroup"){super(ownerDocument,localName)}}class HTMLDListElement extends HTMLElement{constructor(ownerDocument,localName="dl"){super(ownerDocument,localName)}}var tagName12="textarea";class HTMLTextAreaElement extends TextElement{constructor(ownerDocument,localName=tagName12){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(value){this.setAttribute("placeholder",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}get value(){return this.textContent}set value(content){this.textContent=content}}registerHTMLClass(tagName12,HTMLTextAreaElement);class HTMLFontElement extends HTMLElement{constructor(ownerDocument,localName="font"){super(ownerDocument,localName)}}class HTMLDivElement extends HTMLElement{constructor(ownerDocument,localName="div"){super(ownerDocument,localName)}}var tagName13="link";class HTMLLinkElement extends HTMLElement{constructor(ownerDocument,localName=tagName13){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get href(){return stringAttribute.get(this,"href").trim()}set href(value){stringAttribute.set(this,"href",value)}get hreflang(){return stringAttribute.get(this,"hreflang")}set hreflang(value){stringAttribute.set(this,"hreflang",value)}get media(){return stringAttribute.get(this,"media")}set media(value){stringAttribute.set(this,"media",value)}get rel(){return stringAttribute.get(this,"rel")}set rel(value){stringAttribute.set(this,"rel",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}}registerHTMLClass(tagName13,HTMLLinkElement);var tagName14="slot";class HTMLSlotElement extends HTMLElement{constructor(ownerDocument,localName=tagName14){super(ownerDocument,localName)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}assign(){}assignedNodes(options){let isNamedSlot=!!this.name,hostChildNodes=this.getRootNode().host?.childNodes??[],slottables;if(isNamedSlot)slottables=[...hostChildNodes].filter((node)=>node.slot===this.name);else slottables=[...hostChildNodes].filter((node)=>!node.slot);if(options?.flatten){let result=[];for(let slottable of slottables)if(slottable.localName==="slot")result.push(...slottable.assignedNodes({flatten:!0}));else result.push(slottable);slottables=result}return slottables.length?slottables:[...this.childNodes]}assignedElements(options){let slottables=this.assignedNodes(options).filter((n)=>n.nodeType===1);return slottables.length?slottables:[...this.children]}}registerHTMLClass(tagName14,HTMLSlotElement);class HTMLFormElement extends HTMLElement{constructor(ownerDocument,localName="form"){super(ownerDocument,localName)}}var tagName15="img";class HTMLImageElement extends HTMLElement{constructor(ownerDocument,localName=tagName15){super(ownerDocument,localName)}get alt(){return stringAttribute.get(this,"alt")}set alt(value){stringAttribute.set(this,"alt",value)}get sizes(){return stringAttribute.get(this,"sizes")}set sizes(value){stringAttribute.set(this,"sizes",value)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcset(){return stringAttribute.get(this,"srcset")}set srcset(value){stringAttribute.set(this,"srcset",value)}get title(){return stringAttribute.get(this,"title")}set title(value){stringAttribute.set(this,"title",value)}get width(){return numericAttribute.get(this,"width")}set width(value){numericAttribute.set(this,"width",value)}get height(){return numericAttribute.get(this,"height")}set height(value){numericAttribute.set(this,"height",value)}}registerHTMLClass(tagName15,HTMLImageElement);class HTMLPreElement extends HTMLElement{constructor(ownerDocument,localName="pre"){super(ownerDocument,localName)}}class HTMLUListElement extends HTMLElement{constructor(ownerDocument,localName="ul"){super(ownerDocument,localName)}}var tagName16="meta";class HTMLMetaElement extends HTMLElement{constructor(ownerDocument,localName=tagName16){super(ownerDocument,localName)}get name(){return stringAttribute.get(this,"name")}set name(value){stringAttribute.set(this,"name",value)}get httpEquiv(){return stringAttribute.get(this,"http-equiv")}set httpEquiv(value){stringAttribute.set(this,"http-equiv",value)}get content(){return stringAttribute.get(this,"content")}set content(value){stringAttribute.set(this,"content",value)}get charset(){return stringAttribute.get(this,"charset")}set charset(value){stringAttribute.set(this,"charset",value)}get media(){return stringAttribute.get(this,"media")}set media(value){stringAttribute.set(this,"media",value)}}registerHTMLClass(tagName16,HTMLMetaElement);class HTMLPictureElement extends HTMLElement{constructor(ownerDocument,localName="picture"){super(ownerDocument,localName)}}class HTMLAreaElement extends HTMLElement{constructor(ownerDocument,localName="area"){super(ownerDocument,localName)}}class HTMLOListElement extends HTMLElement{constructor(ownerDocument,localName="ol"){super(ownerDocument,localName)}}class HTMLTableCaptionElement extends HTMLElement{constructor(ownerDocument,localName="caption"){super(ownerDocument,localName)}}var tagName17="a";class HTMLAnchorElement extends HTMLElement{constructor(ownerDocument,localName=tagName17){super(ownerDocument,localName)}get href(){return encodeURI(decodeURI(stringAttribute.get(this,"href"))).trim()}set href(value){stringAttribute.set(this,"href",decodeURI(value))}get download(){return encodeURI(decodeURI(stringAttribute.get(this,"download")))}set download(value){stringAttribute.set(this,"download",decodeURI(value))}get target(){return stringAttribute.get(this,"target")}set target(value){stringAttribute.set(this,"target",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}get rel(){return stringAttribute.get(this,"rel")}set rel(value){stringAttribute.set(this,"rel",value)}}registerHTMLClass(tagName17,HTMLAnchorElement);class HTMLLabelElement extends HTMLElement{constructor(ownerDocument,localName="label"){super(ownerDocument,localName)}}class HTMLUnknownElement extends HTMLElement{constructor(ownerDocument,localName="unknown"){super(ownerDocument,localName)}}class HTMLModElement extends HTMLElement{constructor(ownerDocument,localName="mod"){super(ownerDocument,localName)}}class HTMLDetailsElement extends HTMLElement{constructor(ownerDocument,localName="details"){super(ownerDocument,localName)}}var tagName18="source";class HTMLSourceElement extends HTMLElement{constructor(ownerDocument,localName=tagName18){super(ownerDocument,localName)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcset(){return stringAttribute.get(this,"srcset")}set srcset(value){stringAttribute.set(this,"srcset",value)}get sizes(){return stringAttribute.get(this,"sizes")}set sizes(value){stringAttribute.set(this,"sizes",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}}registerHTMLClass(tagName18,HTMLSourceElement);class HTMLTrackElement extends HTMLElement{constructor(ownerDocument,localName="track"){super(ownerDocument,localName)}}class HTMLMarqueeElement extends HTMLElement{constructor(ownerDocument,localName="marquee"){super(ownerDocument,localName)}}var HTMLClasses={HTMLElement,HTMLTemplateElement,HTMLHtmlElement,HTMLScriptElement,HTMLFrameElement,HTMLIFrameElement,HTMLObjectElement,HTMLHeadElement,HTMLBodyElement,HTMLStyleElement,HTMLTimeElement,HTMLFieldSetElement,HTMLEmbedElement,HTMLHRElement,HTMLProgressElement,HTMLParagraphElement,HTMLTableElement,HTMLFrameSetElement,HTMLLIElement,HTMLBaseElement,HTMLDataListElement,HTMLInputElement,HTMLParamElement,HTMLMediaElement,HTMLAudioElement,HTMLHeadingElement,HTMLDirectoryElement,HTMLQuoteElement,HTMLCanvasElement,HTMLLegendElement,HTMLOptionElement,HTMLSpanElement,HTMLMeterElement,HTMLVideoElement,HTMLTableCellElement,HTMLTitleElement,HTMLOutputElement,HTMLTableRowElement,HTMLDataElement,HTMLMenuElement,HTMLSelectElement,HTMLBRElement,HTMLButtonElement,HTMLMapElement,HTMLOptGroupElement,HTMLDListElement,HTMLTextAreaElement,HTMLFontElement,HTMLDivElement,HTMLLinkElement,HTMLSlotElement,HTMLFormElement,HTMLImageElement,HTMLPreElement,HTMLUListElement,HTMLMetaElement,HTMLPictureElement,HTMLAreaElement,HTMLOListElement,HTMLTableCaptionElement,HTMLAnchorElement,HTMLLabelElement,HTMLUnknownElement,HTMLModElement,HTMLDetailsElement,HTMLSourceElement,HTMLTrackElement,HTMLMarqueeElement};var voidElements3={test:()=>!0},Mime={"text/html":{docType:"<!DOCTYPE html>",ignoreCase:!0,voidElements:/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i},"image/svg+xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"text/xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"application/xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"application/xhtml+xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3}};class CustomEvent extends GlobalEvent{constructor(type,eventInitDict={}){super(type,eventInitDict);this.detail=eventInitDict.detail}}class InputEvent extends GlobalEvent{constructor(type,inputEventInit={}){super(type,inputEventInit);this.inputType=inputEventInit.inputType,this.data=inputEventInit.data,this.dataTransfer=inputEventInit.dataTransfer,this.isComposing=inputEventInit.isComposing||!1,this.ranges=inputEventInit.ranges}}var ImageClass=(ownerDocument)=>class extends HTMLImageElement{constructor(width,height){super(ownerDocument);switch(arguments.length){case 1:this.height=width,this.width=width;break;case 2:this.height=height,this.width=width;break}}};var deleteContents=({[START]:start,[END]:end},fragment=null)=>{setAdjacent(start[PREV],end[NEXT]);do{let after=getEnd(start),next=after===end?after:after[NEXT];if(fragment)fragment.insertBefore(start,fragment[END]);else start.remove();start=next}while(start!==end)};class Range{constructor(){this[START]=null,this[END]=null,this.commonAncestorContainer=null}insertNode(newNode){this[END].parentNode.insertBefore(newNode,this[START])}selectNode(node){this[START]=node,this[END]=getEnd(node)}selectNodeContents(node){this.selectNode(node),this.commonAncestorContainer=node}surroundContents(parentNode){parentNode.replaceChildren(this.extractContents())}setStartBefore(node){this[START]=node}setStartAfter(node){this[START]=node.nextSibling}setEndBefore(node){this[END]=getEnd(node.previousSibling)}setEndAfter(node){this[END]=getEnd(node)}cloneContents(){let{[START]:start,[END]:end}=this,fragment=start.ownerDocument.createDocumentFragment();while(start!==end)if(fragment.insertBefore(start.cloneNode(!0),fragment[END]),start=getEnd(start),start!==end)start=start[NEXT];return fragment}deleteContents(){deleteContents(this)}extractContents(){let fragment=this[START].ownerDocument.createDocumentFragment();return deleteContents(this,fragment),fragment}createContextualFragment(html){let{commonAncestorContainer:doc}=this,isSVG="ownerSVGElement"in doc,document=isSVG?doc.ownerDocument:doc,content=htmlToFragment(document,html);if(isSVG){let childNodes=[...content.childNodes];content=document.createDocumentFragment(),Object.setPrototypeOf(content,SVGElement.prototype),content.ownerSVGElement=document;for(let child of childNodes)Object.setPrototypeOf(child,SVGElement.prototype),child.ownerSVGElement=document,content.appendChild(child)}else this.selectNode(content);return content}cloneRange(){let range=new Range;return range[START]=this[START],range[END]=this[END],range}}var isOK=({nodeType},mask)=>{switch(nodeType){case ELEMENT_NODE:return mask&SHOW_ELEMENT;case TEXT_NODE:return mask&SHOW_TEXT;case COMMENT_NODE:return mask&SHOW_COMMENT;case CDATA_SECTION_NODE:return mask&SHOW_CDATA_SECTION}return 0};class TreeWalker{constructor(root,whatToShow=SHOW_ALL){this.root=root,this.currentNode=root,this.whatToShow=whatToShow;let{[NEXT]:next,[END]:end}=root;if(root.nodeType===DOCUMENT_NODE){let{documentElement}=root;next=documentElement,end=documentElement[END]}let nodes=[];while(next&&next!==end){if(isOK(next,whatToShow))nodes.push(next);next=next[NEXT]}this[PRIVATE]={i:0,nodes}}nextNode(){let $=this[PRIVATE];return this.currentNode=$.i<$.nodes.length?$.nodes[$.i++]:null,this.currentNode}}var query=(method,ownerDocument,selectors)=>{let{[NEXT]:next,[END]:end}=ownerDocument;return method.call({ownerDocument,[NEXT]:next,[END]:end},selectors)},globalExports=assign({},Facades,HTMLClasses,{CustomEvent,Event:GlobalEvent,EventTarget:DOMEventTarget,InputEvent,NamedNodeMap,NodeList}),window2=new WeakMap;class Document2 extends NonElementParentNode{constructor(type){super(null,"#document",DOCUMENT_NODE);this[CUSTOM_ELEMENTS]={active:!1,registry:null},this[MUTATION_OBSERVER]={active:!1,class:null},this[MIME]=Mime[type],this[DOCTYPE]=null,this[DOM_PARSER]=null,this[GLOBALS]=null,this[IMAGE]=null,this[UPGRADE]=null}get defaultView(){if(!window2.has(this))window2.set(this,new Proxy(globalThis,{set:(target,name,value)=>{switch(name){case"addEventListener":case"removeEventListener":case"dispatchEvent":this[EVENT_TARGET][name]=value;break;default:target[name]=value;break}return!0},get:(globalThis2,name)=>{switch(name){case"addEventListener":case"removeEventListener":case"dispatchEvent":if(!this[EVENT_TARGET]){let et=this[EVENT_TARGET]=new DOMEventTarget;et.dispatchEvent=et.dispatchEvent.bind(et),et.addEventListener=et.addEventListener.bind(et),et.removeEventListener=et.removeEventListener.bind(et)}return this[EVENT_TARGET][name];case"document":return this;case"navigator":return{userAgent:"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"};case"window":return window2.get(this);case"customElements":if(!this[CUSTOM_ELEMENTS].registry)this[CUSTOM_ELEMENTS]=new CustomElementRegistry(this);return this[CUSTOM_ELEMENTS];case"performance":return globalThis2.performance;case"DOMParser":return this[DOM_PARSER];case"Image":if(!this[IMAGE])this[IMAGE]=ImageClass(this);return this[IMAGE];case"MutationObserver":if(!this[MUTATION_OBSERVER].class)this[MUTATION_OBSERVER]=new MutationObserverClass(this);return this[MUTATION_OBSERVER].class}return this[GLOBALS]&&this[GLOBALS][name]||globalExports[name]||globalThis2[name]}}));return window2.get(this)}get doctype(){let docType=this[DOCTYPE];if(docType)return docType;let{firstChild}=this;if(firstChild&&firstChild.nodeType===DOCUMENT_TYPE_NODE)return this[DOCTYPE]=firstChild;return null}set doctype(value){if(/^([a-z:]+)(\s+system|\s+public(\s+"([^"]+)")?)?(\s+"([^"]+)")?/i.test(value)){let{$1:name,$4:publicId,$6:systemId}=RegExp;this[DOCTYPE]=new DocumentType(this,name,publicId,systemId),knownSiblings(this,this[DOCTYPE],this[NEXT])}}get documentElement(){return this.firstElementChild}get isConnected(){return!0}_getParent(){return this[EVENT_TARGET]}createAttribute(name){return new Attr(this,name)}createCDATASection(data){return new CDATASection(this,data)}createComment(textContent){return new Comment3(this,textContent)}createDocumentFragment(){return new DocumentFragment(this)}createDocumentType(name,publicId,systemId){return new DocumentType(this,name,publicId,systemId)}createElement(localName){return new Element2(this,localName)}createRange(){let range=new Range;return range.commonAncestorContainer=this,range}createTextNode(textContent){return new Text6(this,textContent)}createTreeWalker(root,whatToShow=-1){return new TreeWalker(root,whatToShow)}createNodeIterator(root,whatToShow=-1){return this.createTreeWalker(root,whatToShow)}createEvent(name){let event=create(name==="Event"?new GlobalEvent(""):new CustomEvent(""));return event.initEvent=event.initCustomEvent=(type,canBubble=!1,cancelable=!1,detail)=>{event.bubbles=!!canBubble,defineProperties(event,{type:{value:type},canBubble:{value:canBubble},cancelable:{value:cancelable},detail:{value:detail}})},event}cloneNode(deep=!1){let{constructor,[CUSTOM_ELEMENTS]:customElements,[DOCTYPE]:doctype}=this,document=new constructor;if(document[CUSTOM_ELEMENTS]=customElements,deep){let end=document[END],{childNodes}=this;for(let{length}=childNodes,i=0;i<length;i++)document.insertBefore(childNodes[i].cloneNode(!0),end);if(doctype)document[DOCTYPE]=childNodes[0]}return document}importNode(externalNode){let deep=1<arguments.length&&!!arguments[1],node=externalNode.cloneNode(deep),{[CUSTOM_ELEMENTS]:customElements}=this,{active}=customElements,upgrade=(element)=>{let{ownerDocument,nodeType}=element;if(element.ownerDocument=this,active&&ownerDocument!==this&&nodeType===ELEMENT_NODE)customElements.upgrade(element)};if(upgrade(node),deep)switch(node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:{let{[NEXT]:next,[END]:end}=node;while(next!==end){if(next.nodeType===ELEMENT_NODE)upgrade(next);next=next[NEXT]}break}}return node}toString(){return this.childNodes.join("")}querySelector(selectors){return query(super.querySelector,this,selectors)}querySelectorAll(selectors){return query(super.querySelectorAll,this,selectors)}getElementsByTagNameNS(_,name){return this.getElementsByTagName(name)}createAttributeNS(_,name){return this.createAttribute(name)}createElementNS(nsp,localName,options){return nsp===SVG_NAMESPACE?new SVGElement(this,localName,null):this.createElement(localName,options)}}setPrototypeOf(globalExports.Document=function(){illegalConstructor()},Document2).prototype=Document2.prototype;var createHTMLElement=(ownerDocument,builtin,localName,options)=>{if(!builtin&&htmlClasses.has(localName))return new(htmlClasses.get(localName))(ownerDocument,localName);let{[CUSTOM_ELEMENTS]:{active,registry}}=ownerDocument;if(active){let ce=builtin?options.is:localName;if(registry.has(ce)){let{Class}=registry.get(ce),element=new Class(ownerDocument,localName);return customElements.set(element,{connected:!1}),element}}return new HTMLElement(ownerDocument,localName)};class HTMLDocument extends Document2{constructor(){super("text/html")}get all(){let nodeList=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){switch(next.nodeType){case ELEMENT_NODE:nodeList.push(next);break}next=next[NEXT]}return nodeList}get head(){let{documentElement}=this,{firstElementChild}=documentElement;if(!firstElementChild||firstElementChild.tagName!=="HEAD")firstElementChild=this.createElement("head"),documentElement.prepend(firstElementChild);return firstElementChild}get body(){let{head}=this,{nextElementSibling}=head;if(!nextElementSibling||nextElementSibling.tagName!=="BODY")nextElementSibling=this.createElement("body"),head.after(nextElementSibling);return nextElementSibling}get title(){let{head}=this;return head.getElementsByTagName("title").at(0)?.textContent||""}set title(textContent){let{head}=this,title=head.getElementsByTagName("title").at(0);if(title)title.textContent=textContent;else head.insertBefore(this.createElement("title"),head.firstChild).textContent=textContent}createElement(localName,options){let builtin=!!(options&&options.is),element=createHTMLElement(this,builtin,localName,options);if(builtin)element.setAttribute("is",options.is);return element}}class SVGDocument extends Document2{constructor(){super("image/svg+xml")}toString(){return this[MIME].docType+super.toString()}}class XMLDocument extends Document2{constructor(){super("text/xml")}toString(){return this[MIME].docType+super.toString()}}class DOMParser{parseFromString(markupLanguage,mimeType,globals=null){let isHTML=!1,document;if(mimeType==="text/html")isHTML=!0,document=new HTMLDocument;else if(mimeType==="image/svg+xml")document=new SVGDocument;else document=new XMLDocument;if(document[DOM_PARSER]=DOMParser,globals)document[GLOBALS]=globals;if(isHTML&&markupLanguage==="...")markupLanguage="<!doctype html><html><head></head><body></body></html>";return markupLanguage?parseFromString(document,isHTML,markupLanguage):document}}var{parse:parse3}=JSON;var parseHTML=(html,globals=null)=>new DOMParser().parseFromString(html,"text/html",globals).defaultView;function Document3(){illegalConstructor()}setPrototypeOf(Document3,Document2).prototype=Document2.prototype;import{readdir,readFile,stat}from"node:fs/promises";import{join,relative,resolve}from"node:path";import{isNotationLanguage,renderBlock}from"./index.js";import{parseTabSource}from"./tab/index.js";import{lookupGuitarVoicing}from"./voicings/index.js";var QUOTE2=/^[ \t]{0,3}>[ \t]?/,OPENING=/^(`{3,}|~{3,})(.*)$/,LIST_MARKER=/^(?:[-*+]|\d{1,9}[.)])[ \t]+/;function unquote(line,depth){let rest=line;for(let i=0;i<depth;i++){let m=QUOTE2.exec(rest);if(!m)return null;rest=rest.slice(m[0].length)}return rest}var dedent=(line,indent)=>{let i=0;while(i<indent&&(line[i]===" "||line[i]==="\t"))i++;return line.slice(i)},columns=(lead)=>[...lead].reduce((n,c)=>n+(c==="\t"?4-n%4:1),0);function opensComment(line){if((line.split("%%").length-1)%2===1)return!0;let html=line.lastIndexOf("<!--");return html>=0&&!line.includes("-->",html+4)}var commentEnd=(line)=>(line.split("%%").length-1)%2===1?"%%":"-->";function parseMarkdown(text){let lines=text.replace(/^\uFEFF/,"").split(/\r\n|\r|\n/),i=0,frontMatter=null;if(lines[0]?.trimEnd()==="---"){let end=lines.findIndex((l,n)=>n>0&&/^(?:---|\.\.\.)\s*$/.test(l));if(end>0)frontMatter=lines.slice(1,end).join(`
|
|
8
|
+
)`,enabled:":is(button, input, select, textarea, optgroup, option, fieldset):not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], :selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])","read-only":"[readonly]:is(textarea, input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i]))","read-write":":not([readonly]):is(textarea, input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i]))",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"};function compile(parsed){let a=parsed[0],b=parsed[1]-1;if(b<0&&a<=0)return falseFunc;if(a===-1)return(index)=>index<=b;if(a===0)return(index)=>index===b;if(a===1)return b<0?trueFunc:(index)=>index>=b;let absA=Math.abs(a),bModulo=(b%absA+absA)%absA;return a>1?(index)=>index>=b&&index%absA===bModulo:(index)=>index<=b&&index%absA===bModulo}var whitespace=new Set([9,10,12,13,32]);function parse2(formula){switch(formula=formula.trim().toLowerCase(),formula){case"even":return[2,0];case"odd":return[2,1]}let index=0,a=0,sign=readSign(),number=readNumber();if(index<formula.length&&formula.charAt(index)==="n")if(index++,a=sign*(number??1),skipWhitespace(),index<formula.length)sign=readSign(),skipWhitespace(),number=readNumber();else sign=number=0;if(number===null||index<formula.length)throw Error(`n-th rule couldn't be parsed ('${formula}')`);return[a,sign*number];function readSign(){switch(formula.charAt(index)){case"-":return index++,-1;case"+":{index++;break}}return 1}function readNumber(){let start=index,value=0;while(index<formula.length&&formula.charCodeAt(index)>=48&&formula.charCodeAt(index)<=57)value=value*10+(formula.charCodeAt(index)-48),index++;return index===start?null:value}function skipWhitespace(){while(index<formula.length&&whitespace.has(formula.charCodeAt(index)))index++}}function nthCheck(formula){return compile(parse2(formula))}function cacheParentResults(next,{adapter,cacheResults},matches){if(cacheResults===!1||typeof WeakMap>"u")return(element)=>next(element)&&matches(element);let resultCache=new WeakMap;function addResultToCache(element){let result=matches(element);return resultCache.set(element,result),result}return function(element){if(!next(element))return!1;if(resultCache.has(element))return resultCache.get(element)??!1;let node=element;do{let parent=getElementParent(node,adapter);if(parent===null)return addResultToCache(element);node=parent}while(!resultCache.has(node));return resultCache.get(node)?addResultToCache(element):!1}}function copyOptions(options){let{context:_,rootFunc:__,...copied}=options;return copied}function extendedFilter(tag,range){if(range[0]!=="*"&&range[0]!==tag[0])return!1;let tagIndex=1;for(let rangeIndex=1;rangeIndex<range.length;rangeIndex++){if(range[rangeIndex]==="*")continue;while(tagIndex<tag.length&&tag[tagIndex]!==range[rangeIndex])if(tag[tagIndex++].length<=1)return!1;if(tagIndex>=tag.length)return!1;tagIndex++}return!0}var nthOfRegex=/^(.+?)\s+of\s+(.+)$/is;function compileNth(reverse,ofType){return function(next,rule,options,context,compileToken){let{adapter,equals}=options,ofMatch=ofType?null:rule.match(nthOfRegex),nthCheck2=nthCheck(ofMatch?ofMatch[1].trim():rule);if(nthCheck2===falseFunc)return falseFunc;let ofSelector=ofMatch&&compileToken?compileToken(parse(ofMatch[2].trim()),copyOptions(options),context):void 0;if(ofSelector===falseFunc)return falseFunc;if(nthCheck2===trueFunc&&!ofSelector)return(element)=>getElementParent(element,adapter)!==null&&next(element);let shouldCount=ofSelector?(_element,sibling)=>ofSelector(sibling):ofType?(element,sibling)=>adapter.getName(sibling)===adapter.getName(element):trueFunc;if(reverse)return function(element){if(ofSelector&&!ofSelector(element))return!1;let siblings=adapter.getSiblings(element),pos=0;for(let index=siblings.length-1;index>=0;index--){let sibling=siblings[index];if(equals(element,sibling))break;if(adapter.isTag(sibling)&&shouldCount(element,sibling))pos++}return nthCheck2(pos)&&next(element)};return function(element){if(ofSelector&&!ofSelector(element))return!1;let siblings=adapter.getSiblings(element),pos=0;for(let sibling of siblings){if(equals(element,sibling))break;if(adapter.isTag(sibling)&&shouldCount(element,sibling))pos++}return nthCheck2(pos)&&next(element)}}}var filters={contains(next,text,options){let{getText}=options.adapter;return cacheParentResults(next,options,(element)=>getText(element).includes(text))},icontains(next,text,options){let itext=text.toLowerCase(),{getText}=options.adapter;return cacheParentResults(next,options,(element)=>getText(element).toLowerCase().includes(itext))},"nth-child":compileNth(!1,!1),"nth-last-child":compileNth(!0,!1),"nth-of-type":compileNth(!1,!0),"nth-last-of-type":compileNth(!0,!0),root(next,_rule,{adapter}){return(element)=>getElementParent(element,adapter)===null&&next(element)},scope(next,rule,options,context){let{equals}=options;if(!context||context.length===0)return filters.root(next,rule,options);if(context.length===1)return(element)=>equals(context[0],element)&&next(element);return(element)=>context.includes(element)&&next(element)},lang(next,code,{adapter}){let ranges=code.split(",").map((r)=>r.trim()).filter((r)=>r.length>0).map((r)=>r.replace(/^['"]|['"]$/g,"").toLowerCase().split("-"));return function(element){let node=element;while(node!=null){let value=adapter.getAttributeValue(node,"xml:lang")??adapter.getAttributeValue(node,"lang");if(value!=null){if(!value)return ranges.some((r)=>r[0]==="")&&next(element);let tag=value.toLowerCase().split("-");return ranges.some((r)=>extendedFilter(tag,r))&&next(element)}let parent=adapter.getParent(node);node=parent!=null&&adapter.isTag(parent)?parent:null}return ranges.some((r)=>r[0]==="")&&next(element)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(name){return function(next,_rule,{adapter}){let filterFunction=adapter[name];if(typeof filterFunction!=="function")return falseFunc;return function(element){return filterFunction(element)&&next(element)}}}var isDocumentWhiteSpace=/^[ \t\r\n]*$/,pseudos={empty(element,{adapter}){let children=adapter.getChildren(element);return children.every((element)=>!adapter.isTag(element))&&children.every((element)=>isDocumentWhiteSpace.test(adapter.getText(element)))},"first-child"(element,{adapter,equals}){if(adapter.prevElementSibling)return adapter.prevElementSibling(element)==null;let firstChild=adapter.getSiblings(element).find((sibling)=>adapter.isTag(sibling));return firstChild!=null&&equals(element,firstChild)},"last-child"(element,{adapter,equals}){let siblings=adapter.getSiblings(element);for(let index=siblings.length-1;index>=0;index--){if(equals(element,siblings[index]))return!0;if(adapter.isTag(siblings[index]))break}return!1},"first-of-type"(element,{adapter,equals}){let siblings=adapter.getSiblings(element),elementName=adapter.getName(element);for(let currentSibling of siblings){if(equals(element,currentSibling))return!0;if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elementName)break}return!1},"last-of-type"(element,{adapter,equals}){let siblings=adapter.getSiblings(element),elementName=adapter.getName(element);for(let index=siblings.length-1;index>=0;index--){let currentSibling=siblings[index];if(equals(element,currentSibling))return!0;if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elementName)break}return!1},"only-of-type"(element,{adapter,equals}){let elementName=adapter.getName(element);return adapter.getSiblings(element).every((sibling)=>equals(element,sibling)||!adapter.isTag(sibling)||adapter.getName(sibling)!==elementName)},"only-child"(element,{adapter,equals}){return adapter.getSiblings(element).every((sibling)=>equals(element,sibling)||!adapter.isTag(sibling))}};function verifyPseudoArguments(pseudoClassCondition,name,subselect,argumentIndex){if(subselect===null){if(pseudoClassCondition.length>argumentIndex)throw Error(`Pseudo-class :${name} requires an argument`)}else if(pseudoClassCondition.length===argumentIndex)throw Error(`Pseudo-class :${name} doesn't have any arguments`)}function isTraversal2(token){return token.type==="_flexibleDescendant"||isTraversal(token)}function sortRules(array){let ratings=array.map(getQuality);for(let index=1;index<array.length;index++){let procNew=ratings[index];if(procNew<0)continue;for(let currentIndex=index;currentIndex>0&&procNew<ratings[currentIndex-1];currentIndex--){let token=array[currentIndex];array[currentIndex]=array[currentIndex-1],array[currentIndex-1]=token,ratings[currentIndex]=ratings[currentIndex-1],ratings[currentIndex-1]=procNew}}}function getAttributeQuality(token){switch(token.action){case AttributeAction.Exists:return 10;case AttributeAction.Equals:return token.name==="id"?9:8;case AttributeAction.Not:return 7;case AttributeAction.Start:return 6;case AttributeAction.End:return 6;case AttributeAction.Any:return 5;case AttributeAction.Hyphen:return 4;case AttributeAction.Element:return 3}}function getQuality(token){switch(token.type){case SelectorType.Universal:return 50;case SelectorType.Tag:return 30;case SelectorType.Attribute:return Math.floor(getAttributeQuality(token)/(token.ignoreCase?2:1));case SelectorType.Pseudo:return token.data?token.name==="has"||token.name==="contains"||token.name==="icontains"?0:Array.isArray(token.data)?Math.max(0,Math.min(...token.data.map((d)=>Math.min(...d.map(getQuality))))):2:3;default:return-1}}function includesScopePseudo(t){return t.type===SelectorType.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some((data)=>data.some(includesScopePseudo)))}var PLACEHOLDER_ELEMENT={};function hasDependsOnCurrentElement(selector){return selector.some((sel)=>sel.length>0&&(isTraversal2(sel[0])||sel.some(includesScopePseudo)))}var is=(next,token,options,context,compileToken)=>{let compiledToken=compileToken(token,copyOptions(options),context);return compiledToken===trueFunc?next:compiledToken===falseFunc?falseFunc:(element)=>compiledToken(element)&&next(element)},subselects={is,matches:is,where:is,not(next,token,options,context,compileToken){let compiledToken=compileToken(token,copyOptions(options),context);return compiledToken===falseFunc?next:compiledToken===trueFunc?falseFunc:(element)=>!compiledToken(element)&&next(element)},has(next,subselect,options,_context,compileToken){let{adapter}=options,copiedOptions=copyOptions(options);copiedOptions.relativeSelector=!0;let context=subselect.some((s)=>s.some(isTraversal2))?[PLACEHOLDER_ELEMENT]:void 0,skipCache=hasDependsOnCurrentElement(subselect),compiled=compileToken(subselect,copiedOptions,context);if(compiled===falseFunc)return falseFunc;if(context&&compiled!==trueFunc)return skipCache?(element)=>{if(!next(element))return!1;context[0]=element;let childs=adapter.getChildren(element);return findOne3(compiled,compiled.shouldTestNextSiblings?[...childs,...getNextSiblings(element,adapter)]:childs,options)!==null}:cacheParentResults(next,options,(element)=>(context[0]=element,findOne3(compiled,adapter.getChildren(element),options)!==null));let hasOne=(element)=>findOne3(compiled,adapter.getChildren(element),options)!==null;return skipCache?(element)=>next(element)&&hasOne(element):cacheParentResults(next,options,hasOne)}};function compilePseudoSelector(next,selector,options,context,compileToken){let{name,data}=selector;if(Array.isArray(data)){if(!(name in subselects))throw Error(`Unknown pseudo-class :${name}(${data})`);return subselects[name](next,data,options,context,compileToken)}let userPseudo=options.pseudos?.[name],stringPseudo=typeof userPseudo==="string"?userPseudo:aliases[name];if(typeof stringPseudo==="string"){if(data!=null)throw Error(`Pseudo ${name} doesn't have any arguments`);let alias=parse(stringPseudo);return subselects.is(next,alias,options,context,compileToken)}if(typeof userPseudo==="function")return verifyPseudoArguments(userPseudo,name,data,1),(element)=>userPseudo(element,data)&&next(element);if(name in filters)return filters[name](next,data,options,context,compileToken);if(name in pseudos){let pseudo=pseudos[name];return verifyPseudoArguments(pseudo,name,data,2),(element)=>pseudo(element,options,data)&&next(element)}throw Error(`Unknown pseudo-class :${name}`)}function compileGeneralSelector(next,selector,options,context,compileToken,hasExpensiveSubselector){let{adapter,equals,cacheResults}=options;switch(selector.type){case SelectorType.PseudoElement:throw Error("Pseudo-elements are not supported by css-select");case SelectorType.ColumnCombinator:throw Error("Column combinators are not yet supported by css-select");case SelectorType.Attribute:{if(selector.namespace!=null)throw Error("Namespaced attributes are not yet supported by css-select");if(!options.xmlMode||options.lowerCaseAttributeNames)selector.name=selector.name.toLowerCase();return attributeRules[selector.action](next,selector,options)}case SelectorType.Pseudo:return compilePseudoSelector(next,selector,options,context,compileToken);case SelectorType.Tag:{if(selector.namespace!=null)throw Error("Namespaced tag names are not yet supported by css-select");let{name}=selector;if(!options.xmlMode||options.lowerCaseTags)name=name.toLowerCase();return function(element){return adapter.getName(element)===name&&next(element)}}case SelectorType.Descendant:{if(!hasExpensiveSubselector||cacheResults===!1||typeof WeakMap>"u")return function(element){let current=element;while(current=getElementParent(current,adapter))if(next(current))return!0;return!1};let resultCache=new WeakMap;return function(element){let current=element,result;while(current=getElementParent(current,adapter)){let cached=resultCache.get(current);if(cached===void 0){if(result??={matches:!1},result.matches=next(current),resultCache.set(current,result),result.matches)return!0}else{if(result)result.matches=cached.matches;return cached.matches}}return!1}}case"_flexibleDescendant":return function(element){let current=element;do{if(next(current))return!0;current=getElementParent(current,adapter)}while(current);return!1};case SelectorType.Parent:return function(element){return adapter.getChildren(element).some((element)=>adapter.isTag(element)&&next(element))};case SelectorType.Child:return function(element){let parent=getElementParent(element,adapter);return parent!==null&&next(parent)};case SelectorType.Sibling:return function(element){let siblings=adapter.getSiblings(element);for(let currentSibling of siblings){if(equals(element,currentSibling))break;if(adapter.isTag(currentSibling)&&next(currentSibling))return!0}return!1};case SelectorType.Adjacent:{if(adapter.prevElementSibling)return function(element){let previous=adapter.prevElementSibling(element);return previous!=null&&next(previous)};return function(element){let siblings=adapter.getSiblings(element),lastElement;for(let currentSibling of siblings){if(equals(element,currentSibling))break;if(adapter.isTag(currentSibling))lastElement=currentSibling}return!!lastElement&&next(lastElement)}}case SelectorType.Universal:{if(selector.namespace!=null&&selector.namespace!=="*")throw Error("Namespaced universal selectors are not yet supported by css-select");return next}}}var DESCENDANT_TOKEN={type:SelectorType.Descendant},FLEXIBLE_DESCENDANT_TOKEN={type:"_flexibleDescendant"},SCOPE_TOKEN={type:SelectorType.Pseudo,name:"scope",data:null};function absolutize(token,{adapter},context){let hasContext=!!context?.every((element)=>element===PLACEHOLDER_ELEMENT||adapter.isTag(element)&&getElementParent(element,adapter)!==null);for(let t of token){if(t.length>0&&isTraversal2(t[0])&&t[0].type!==SelectorType.Descendant);else if(hasContext&&!t.some(includesScopePseudo))t.unshift(DESCENDANT_TOKEN);else continue;t.unshift(SCOPE_TOKEN)}}function compileToken(token,options,compilationContext){for(let rules of token)sortRules(rules);let{context=compilationContext,rootFunc:rootFunction=trueFunc}=options,isArrayContext=Array.isArray(context),finalContext=context&&(Array.isArray(context)?context:[context]);if(options.relativeSelector!==!1)absolutize(token,options,finalContext);else if(token.some((t)=>t.length>0&&isTraversal2(t[0])))throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let shouldTestNextSiblings=!1,query=falseFunc;combineLoop:for(let rules of token){if(rules.length>=2){let[first,second]=rules;if(first.type!==SelectorType.Pseudo||first.name!=="scope");else if(isArrayContext&&second.type===SelectorType.Descendant)rules[1]=FLEXIBLE_DESCENDANT_TOKEN;else if(second.type===SelectorType.Adjacent||second.type===SelectorType.Sibling)shouldTestNextSiblings=!0}let next=rootFunction,hasExpensiveSubselector=!1;for(let rule of rules){if(next=compileGeneralSelector(next,rule,options,finalContext,compileToken,hasExpensiveSubselector),getQuality(rule)===0)hasExpensiveSubselector=!0;if(next===falseFunc)continue combineLoop}if(next===rootFunction)return rootFunction;query=query===falseFunc?next:or(query,next)}return query.shouldTestNextSiblings=shouldTestNextSiblings,query}function or(a,b){return(element)=>a(element)||b(element)}var defaultEquals=(a,b)=>a===b,defaultOptions={adapter:{...exports_dist2,isTag:isTag4},equals:defaultEquals};function convertOptionFormats(options){let finalOptions=options??defaultOptions;return finalOptions.adapter??=defaultOptions.adapter,finalOptions.equals??=finalOptions.adapter?.equals??defaultEquals,finalOptions}function compile2(selector,options,context){let convertedOptions=convertOptionFormats(options),next=_compileUnsafe(selector,convertedOptions,context);return next===falseFunc?falseFunc:(element)=>convertedOptions.adapter.isTag(element)&&next(element)}function _compileUnsafe(selector,options,context){return compileToken(typeof selector==="string"?parse(selector):selector,convertOptionFormats(options),context)}function getSelectorFunction(searchFunction){return function(query,elements,options){let convertedOptions=convertOptionFormats(options);if(typeof query!=="function")query=_compileUnsafe(query,convertedOptions,elements);let filteredElements=prepareContext(elements,convertedOptions.adapter,query.shouldTestNextSiblings);return searchFunction(query,filteredElements,convertedOptions)}}function prepareContext(elements,adapter,shouldTestNextSiblings=!1){if(shouldTestNextSiblings)elements=appendNextSiblings(elements,adapter);return Array.isArray(elements)?adapter.removeSubsets(elements):adapter.getChildren(elements)}function appendNextSiblings(element,adapter){let elements=Array.isArray(element)?[...element]:[element],elementsLength=elements.length;for(let index=0;index<elementsLength;index++){let nextSiblings=getNextSiblings(elements[index],adapter);elements.push(...nextSiblings)}return elements}var selectAll=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?[]:findAll3(query,elements,options)),selectOne=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?null:findOne3(query,elements,options));function is2(element,query,options){return(typeof query==="function"?query:compile2(query,options))(element)}var{isArray}=Array,isTag5=({nodeType})=>nodeType===ELEMENT_NODE,existsOne3=(test,elements)=>elements.some((element)=>isTag5(element)&&(test(element)||existsOne3(test,getChildren3(element)))),getAttributeValue3=(element,name)=>name==="class"?element.getAttributeNode("class")?.value??null:element.getAttribute(name),getChildren3=({childNodes})=>childNodes,getName3=(element)=>{let{localName}=element;return ignoreCase(element)?localName.toLowerCase():localName},getParent3=({parentNode})=>parentNode,getSiblings3=(element)=>{let{parentNode}=element;return parentNode?getChildren3(parentNode):element},getText3=(node)=>{if(isArray(node))return node.map(getText3).join("");if(isTag5(node))return getText3(getChildren3(node));if(node.nodeType===TEXT_NODE)return node.data;return""},hasAttrib3=(element,name)=>element.hasAttribute(name),removeSubsets3=(nodes)=>{let{length}=nodes;while(length--){let node=nodes[length];if(length&&-1<nodes.lastIndexOf(node,length-1)){nodes.splice(length,1);continue}for(let{parentNode}=node;parentNode;parentNode=parentNode.parentNode)if(nodes.includes(parentNode)){nodes.splice(length,1);break}}return nodes},findAll4=(test,nodes)=>{let matches=[];for(let node of nodes)if(isTag5(node)){if(test(node))matches.push(node);matches.push(...findAll4(test,getChildren3(node)))}return matches},findOne4=(test,nodes)=>{for(let node of nodes)if(test(node)||(node=findOne4(test,getChildren3(node))))return node;return null},adapter={isTag:isTag5,existsOne:existsOne3,getAttributeValue:getAttributeValue3,getChildren:getChildren3,getName:getName3,getParent:getParent3,getSiblings:getSiblings3,getText:getText3,hasAttrib:hasAttrib3,removeSubsets:removeSubsets3,findAll:findAll4,findOne:findOne4},prepareMatch=(element,selectors)=>compile2(selectors,{context:selectors.includes(":scope")?element:void 0,xmlMode:!ignoreCase(element),adapter}),matches=(element,selectors)=>is2(element,selectors,{strict:!0,context:selectors.includes(":scope")?element:void 0,xmlMode:!ignoreCase(element),adapter});class Text6 extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#text",TEXT_NODE,data)}get wholeText(){let text=[],{previousSibling,nextSibling}=this;while(previousSibling){if(previousSibling.nodeType===TEXT_NODE)text.unshift(previousSibling[VALUE]);else break;previousSibling=previousSibling.previousSibling}text.push(this[VALUE]);while(nextSibling){if(nextSibling.nodeType===TEXT_NODE)text.push(nextSibling[VALUE]);else break;nextSibling=nextSibling.nextSibling}return text.join("")}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new Text6(ownerDocument,data)}toString(){return escape2(this[VALUE])}}var isNode=(node)=>node instanceof Node2,insert=(parentNode,child,nodes)=>{let{ownerDocument}=parentNode;for(let node of nodes)parentNode.insertBefore(isNode(node)?node:new Text6(ownerDocument,node),child)};class ParentNode extends Node2{constructor(ownerDocument,localName,nodeType){super(ownerDocument,localName,nodeType);this[PRIVATE]=null,this[NEXT]=this[END]={[NEXT]:null,[PREV]:this,[START]:this,nodeType:NODE_END,ownerDocument:this.ownerDocument,parentNode:null}}get childNodes(){let childNodes=new NodeList,{firstChild}=this;while(firstChild)childNodes.push(firstChild),firstChild=nextSibling(firstChild);return childNodes}get children(){let children=new NodeList,{firstElementChild}=this;while(firstElementChild)children.push(firstElementChild),firstElementChild=nextElementSibling2(firstElementChild);return children}get firstChild(){let{[NEXT]:next,[END]:end}=this;while(next.nodeType===ATTRIBUTE_NODE)next=next[NEXT];return next===end?null:next}get firstElementChild(){let{firstChild}=this;while(firstChild){if(firstChild.nodeType===ELEMENT_NODE)return firstChild;firstChild=nextSibling(firstChild)}return null}get lastChild(){let prev=this[END][PREV];switch(prev.nodeType){case NODE_END:return prev[START];case ATTRIBUTE_NODE:return null}return prev===this?null:prev}get lastElementChild(){let{lastChild}=this;while(lastChild){if(lastChild.nodeType===ELEMENT_NODE)return lastChild;lastChild=previousSibling(lastChild)}return null}get childElementCount(){return this.children.length}prepend(...nodes){insert(this,this.firstChild,nodes)}append(...nodes){insert(this,this[END],nodes)}replaceChildren(...nodes){let{[NEXT]:next,[END]:end}=this;while(next!==end&&next.nodeType===ATTRIBUTE_NODE)next=next[NEXT];while(next!==end){let after=getEnd(next)[NEXT];next.remove(),next=after}if(nodes.length)insert(this,end,nodes)}getElementsByClassName(className){let elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&next.hasAttribute("class")&&next.classList.has(className))elements.push(next);next=next[NEXT]}return elements}getElementsByTagName(tagName){let elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&(next.localName===tagName||localCase(next)===tagName))elements.push(next);next=next[NEXT]}return elements}querySelector(selectors){let matches=prepareMatch(this,selectors),{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&matches(next))return next;next=next.nodeType===ELEMENT_NODE&&next.localName==="template"?next[END]:next[NEXT]}return null}querySelectorAll(selectors){let matches=prepareMatch(this,selectors),elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&matches(next))elements.push(next);next=next.nodeType===ELEMENT_NODE&&next.localName==="template"?next[END]:next[NEXT]}return elements}appendChild(node){return this.insertBefore(node,this[END])}contains(node){let parentNode=node;while(parentNode&&parentNode!==this)parentNode=parentNode.parentNode;return parentNode===this}insertBefore(node,before=null){if(node===before)return node;if(node===this)throw Error("unable to append a node to itself");let next=before||this[END];switch(node.nodeType){case ELEMENT_NODE:node.remove(),node.parentNode=this,knownBoundaries(next[PREV],node,next),moCallback(node,null),connectedCallback(node);break;case DOCUMENT_FRAGMENT_NODE:{let{[PRIVATE]:parentNode,firstChild,lastChild}=node;if(firstChild){if(knownSegment(next[PREV],firstChild,lastChild,next),knownAdjacent(node,node[END]),parentNode)parentNode.replaceChildren();do if(firstChild.parentNode=this,moCallback(firstChild,null),firstChild.nodeType===ELEMENT_NODE)connectedCallback(firstChild);while(firstChild!==lastChild&&(firstChild=nextSibling(firstChild)))}break}case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:node.remove();default:node.parentNode=this,knownSiblings(next[PREV],node,next),moCallback(node,null);break}return node}normalize(){let{[NEXT]:next,[END]:end}=this;while(next!==end){let{[NEXT]:$next,[PREV]:$prev,nodeType}=next;if(nodeType===TEXT_NODE){if(!next[VALUE])next.remove();else if($prev&&$prev.nodeType===TEXT_NODE)$prev.textContent+=next.textContent,next.remove()}next=$next}}removeChild(node){if(node.parentNode!==this)throw Error("node is not a child");return node.remove(),node}replaceChild(node,replaced){let next=getEnd(replaced)[NEXT];return replaced.remove(),this.insertBefore(node,next),replaced}}class NonElementParentNode extends ParentNode{getElementById(id){let{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&next.id===id)return next;next=next[NEXT]}return null}cloneNode(deep){let{ownerDocument,constructor}=this,nonEPN=new constructor(ownerDocument);if(deep){let{[END]:end}=nonEPN;for(let node of this.childNodes)nonEPN.insertBefore(node.cloneNode(deep),end)}return nonEPN}toString(){let{childNodes,localName}=this;return`<${localName}>${childNodes.join("")}</${localName}>`}toJSON(){let json=[];return nonElementAsJSON(this,json),json}}class DocumentFragment extends NonElementParentNode{constructor(ownerDocument){super(ownerDocument,"#document-fragment",DOCUMENT_FRAGMENT_NODE)}}class DocumentType extends Node2{constructor(ownerDocument,name,publicId="",systemId=""){super(ownerDocument,"#document-type",DOCUMENT_TYPE_NODE);this.name=name,this.publicId=publicId,this.systemId=systemId}cloneNode(){let{ownerDocument,name,publicId,systemId}=this;return new DocumentType(ownerDocument,name,publicId,systemId)}toString(){let{name,publicId,systemId}=this,hasPublic=0<publicId.length,str=[name];if(hasPublic)str.push("PUBLIC",`"${publicId}"`);if(systemId.length){if(!hasPublic)str.push("SYSTEM");str.push(`"${systemId}"`)}return`<!DOCTYPE ${str.join(" ")}>`}toJSON(){let json=[];return documentTypeAsJSON(this,json),json}}var getInnerHtml=(node)=>node.childNodes.join(""),setInnerHtml=(node,html)=>{let{ownerDocument}=node,{constructor}=ownerDocument,document=new constructor;document[CUSTOM_ELEMENTS]=ownerDocument[CUSTOM_ELEMENTS];let{childNodes}=parseFromString(document,ignoreCase(node),html);node.replaceChildren(...childNodes.map(setOwnerDocument,ownerDocument))};function setOwnerDocument(node){switch(node.ownerDocument=this,node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:node.childNodes.forEach(setOwnerDocument,this);break}return node}var esm_default2=(camel)=>camel.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z0-9]+)([A-Z]))/g,"$2$5-$3$6").toLowerCase();var refs=new WeakMap,key=(name)=>`data-${esm_default2(name)}`,prop=(name)=>name.slice(5).replace(/-([a-z])/g,(_,$1)=>$1.toUpperCase()),handler={get(dataset,name){if(name in dataset)return refs.get(dataset).getAttribute(key(name))},set(dataset,name,value){return dataset[name]=value,refs.get(dataset).setAttribute(key(name),value),!0},deleteProperty(dataset,name){if(name in dataset)refs.get(dataset).removeAttribute(key(name));return delete dataset[name]}};class DOMStringMap{constructor(ref){for(let{name,value}of ref.attributes)if(/^data-/.test(name))this[prop(name)]=value;return refs.set(this,ref),new Proxy(this,handler)}}setPrototypeOf(DOMStringMap.prototype,null);var{add}=Set.prototype,addTokens=(self,tokens)=>{for(let token of tokens)if(token)add.call(self,token)},update=({[OWNER_ELEMENT]:ownerElement,value})=>{let attribute=ownerElement.getAttributeNode("class");if(attribute)attribute.value=value;else setAttribute(ownerElement,new Attr(ownerElement.ownerDocument,"class",value))};class DOMTokenList extends Set{constructor(ownerElement){super();this[OWNER_ELEMENT]=ownerElement;let attribute=ownerElement.getAttributeNode("class");if(attribute)addTokens(this,attribute.value.split(/\s+/))}get length(){return this.size}get value(){return[...this].join(" ")}add(...tokens){addTokens(this,tokens),update(this)}contains(token){return this.has(token)}remove(...tokens){for(let token of tokens)this.delete(token);update(this)}toggle(token,force){if(this.has(token)){if(force)return!0;this.delete(token),update(this)}else if(force||arguments.length===1)return super.add(token),update(this),!0;return!1}replace(token,newToken){if(this.has(token))return this.delete(token),super.add(newToken),update(this),!0;return!1}supports(){return!0}}var refs2=new WeakMap,getKeys=(style)=>[...style.keys()].filter((key)=>key!==PRIVATE),updateKeys=(style)=>{let attr=refs2.get(style).getAttributeNode("style");if(!attr||attr[CHANGED]||style.get(PRIVATE)!==attr){if(style.clear(),attr){style.set(PRIVATE,attr);for(let rule of attr[VALUE].split(/\s*;\s*/)){let[key,...rest]=rule.split(":");if(rest.length>0){key=key.trim();let value=rest.join(":").trim();if(key&&value)style.set(key,value)}}}}return attr},handler2={get(style,name){if(name in prototype)return style[name];if(updateKeys(style),name==="length")return getKeys(style).length;if(/^\d+$/.test(name))return getKeys(style)[name];return style.get(esm_default2(name))??""},set(style,name,value){if(name==="cssText")style[name]=value;else{let attr=updateKeys(style);if(value==null)style.delete(esm_default2(name));else style.set(esm_default2(name),value);if(!attr){let element=refs2.get(style);attr=element.ownerDocument.createAttribute("style"),element.setAttributeNode(attr),style.set(PRIVATE,attr)}attr[CHANGED]=!1,attr[VALUE]=style.toString()}return!0}};class CSSStyleDeclaration extends Map{constructor(element){super();return refs2.set(this,element),new Proxy(this,handler2)}get cssText(){return this.toString()}set cssText(value){refs2.get(this).setAttribute("style",value)}getPropertyValue(name){let self=this[PRIVATE];return handler2.get(self,name)}setProperty(name,value){let self=this[PRIVATE];handler2.set(self,name,value)}removeProperty(name){let self=this[PRIVATE];handler2.set(self,name,null)}[Symbol.iterator](){let self=this[PRIVATE];updateKeys(self);let keys=getKeys(self),{length}=keys,i=0;return{next(){let done=i===length;return{done,value:done?null:keys[i++]}}}}get[PRIVATE](){return this}toString(){let self=this[PRIVATE];updateKeys(self);let cssText=[];return self.forEach(push,cssText),cssText.join(";")}}var{prototype}=CSSStyleDeclaration;function push(value,key){if(key!==PRIVATE)this.push(`${key}:${value}`)}function getCurrentTarget(ev){return ev.currentTarget}class GlobalEvent{static get BUBBLING_PHASE(){return 3}static get AT_TARGET(){return 2}static get CAPTURING_PHASE(){return 1}static get NONE(){return 0}constructor(type,eventInitDict={}){this.type=type,this.bubbles=!!eventInitDict.bubbles,this.cancelBubble=!1,this._stopImmediatePropagationFlag=!1,this.cancelable=!!eventInitDict.cancelable,this.eventPhase=this.NONE,this.timeStamp=Date.now(),this.defaultPrevented=!1,this.originalTarget=null,this.returnValue=null,this.srcElement=null,this.target=null,this._path=[]}get BUBBLING_PHASE(){return 3}get AT_TARGET(){return 2}get CAPTURING_PHASE(){return 1}get NONE(){return 0}preventDefault(){this.defaultPrevented=!0}composedPath(){return this._path.map(getCurrentTarget)}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this.stopPropagation(),this._stopImmediatePropagationFlag=!0}}class NamedNodeMap extends Array{constructor(ownerElement){super();this.ownerElement=ownerElement}getNamedItem(name){return this.ownerElement.getAttributeNode(name)}setNamedItem(attr){this.ownerElement.setAttributeNode(attr),this.unshift(attr)}removeNamedItem(name){let item=this.getNamedItem(name);this.ownerElement.removeAttribute(name),this.splice(this.indexOf(item),1)}item(index){return index<this.length?this[index]:null}getNamedItemNS(_,name){return this.getNamedItem(name)}setNamedItemNS(_,attr){return this.setNamedItem(attr)}removeNamedItemNS(_,name){return this.removeNamedItem(name)}}class ShadowRoot extends NonElementParentNode{constructor(host){super(host.ownerDocument,"#shadow-root",DOCUMENT_FRAGMENT_NODE);this.host=host}get innerHTML(){return getInnerHtml(this)}set innerHTML(html){setInnerHtml(this,html)}}var attributesHandler={get(target,key){return key in target?target[key]:target.find(({name})=>name===key)}},create2=(ownerDocument,element,localName)=>{if("ownerSVGElement"in element){let svg=ownerDocument.createElementNS(SVG_NAMESPACE,localName);return svg.ownerSVGElement=element.ownerSVGElement,svg}return ownerDocument.createElement(localName)},isVoid=({localName,ownerDocument})=>ownerDocument[MIME].voidElements.test(localName);class Element2 extends ParentNode{constructor(ownerDocument,localName){super(ownerDocument,localName,ELEMENT_NODE);this[CLASS_LIST]=null,this[DATASET]=null,this[STYLE]=null}get isConnected(){return isConnected(this)}get parentElement(){return parentElement(this)}get previousSibling(){return previousSibling(this)}get nextSibling(){return nextSibling(this)}get namespaceURI(){return"http://www.w3.org/1999/xhtml"}get previousElementSibling(){return previousElementSibling(this)}get nextElementSibling(){return nextElementSibling2(this)}before(...nodes){before(this,nodes)}after(...nodes){after(this,nodes)}replaceWith(...nodes){replaceWith(this,nodes)}remove(){remove(this[PREV],this,this[END][NEXT])}get id(){return stringAttribute.get(this,"id")}set id(value){stringAttribute.set(this,"id",value)}get className(){return this.classList.value}set className(value){let{classList}=this;classList.clear(),classList.add(...$String(value).split(/\s+/))}get nodeName(){return localCase(this)}get tagName(){return localCase(this)}get classList(){return this[CLASS_LIST]||(this[CLASS_LIST]=new DOMTokenList(this))}get dataset(){return this[DATASET]||(this[DATASET]=new DOMStringMap(this))}getBoundingClientRect(){return{x:0,y:0,bottom:0,height:0,left:0,right:0,top:0,width:0}}get nonce(){return stringAttribute.get(this,"nonce")}set nonce(value){stringAttribute.set(this,"nonce",value)}get style(){return this[STYLE]||(this[STYLE]=new CSSStyleDeclaration(this))}get tabIndex(){return numericAttribute.get(this,"tabindex")||-1}set tabIndex(value){numericAttribute.set(this,"tabindex",value)}get slot(){return stringAttribute.get(this,"slot")}set slot(value){stringAttribute.set(this,"slot",value)}get innerText(){let text=[],{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===TEXT_NODE)text.push(next.textContent.replace(/\s+/g," "));else if(text.length&&next[NEXT]!=end&&BLOCK_ELEMENTS.has(next.tagName))text.push(`
|
|
9
|
+
`);next=next[NEXT]}return text.join("")}get textContent(){let text=[],{[NEXT]:next,[END]:end}=this;while(next!==end){let nodeType=next.nodeType;if(nodeType===TEXT_NODE||nodeType===CDATA_SECTION_NODE)text.push(next.textContent);next=next[NEXT]}return text.join("")}set textContent(text){if(this.replaceChildren(),text!=null&&text!=="")this.appendChild(new Text6(this.ownerDocument,text))}get innerHTML(){return getInnerHtml(this)}set innerHTML(html){setInnerHtml(this,html)}get outerHTML(){return this.toString()}set outerHTML(html){let template=this.ownerDocument.createElement("");template.innerHTML=html,this.replaceWith(...template.childNodes)}get attributes(){let attributes=new NamedNodeMap(this),next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE)attributes.push(next),next=next[NEXT];return new Proxy(attributes,attributesHandler)}focus(){this.dispatchEvent(new GlobalEvent("focus"))}getAttribute(name){if(name==="class")return this.className;let attribute=this.getAttributeNode(name);return attribute&&(ignoreCase(this)?attribute.value:escape2(attribute.value))}getAttributeNode(name){let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next.name===name)return next;next=next[NEXT]}return null}getAttributeNames(){let attributes=new NodeList,next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE)attributes.push(next.name),next=next[NEXT];return attributes}hasAttribute(name){return!!this.getAttributeNode(name)}hasAttributes(){return this[NEXT].nodeType===ATTRIBUTE_NODE}removeAttribute(name){if(name==="class"&&this[CLASS_LIST])this[CLASS_LIST].clear();let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next.name===name){removeAttribute(this,next);return}next=next[NEXT]}}removeAttributeNode(attribute){let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next===attribute){removeAttribute(this,next);return}next=next[NEXT]}}setAttribute(name,value){if(name==="class")this.className=value;else{let attribute=this.getAttributeNode(name);if(attribute)attribute.value=value;else setAttribute(this,new Attr(this.ownerDocument,name,value))}}setAttributeNode(attribute){let{name}=attribute,previously=this.getAttributeNode(name);if(previously!==attribute){if(previously)this.removeAttributeNode(previously);let{ownerElement}=attribute;if(ownerElement)ownerElement.removeAttributeNode(attribute);setAttribute(this,attribute)}return previously}toggleAttribute(name,force){if(this.hasAttribute(name)){if(!force)return this.removeAttribute(name),!1;return!0}else if(force||arguments.length===1)return this.setAttribute(name,""),!0;return!1}get shadowRoot(){if(shadowRoots.has(this)){let{mode,shadowRoot}=shadowRoots.get(this);if(mode==="open")return shadowRoot}return null}attachShadow(init){if(shadowRoots.has(this))throw Error("operation not supported");let shadowRoot=new ShadowRoot(this);return shadowRoots.set(this,{mode:init.mode,shadowRoot}),shadowRoot}matches(selectors){return matches(this,selectors)}closest(selectors){let parentElement=this,matches=prepareMatch(parentElement,selectors);while(parentElement&&!matches(parentElement))parentElement=parentElement.parentElement;return parentElement}insertAdjacentElement(position,element){let{parentElement}=this;switch(position){case"beforebegin":if(parentElement){parentElement.insertBefore(element,this);break}return null;case"afterbegin":this.insertBefore(element,this.firstChild);break;case"beforeend":this.insertBefore(element,null);break;case"afterend":if(parentElement){parentElement.insertBefore(element,this.nextSibling);break}return null}return element}insertAdjacentHTML(position,html){this.insertAdjacentElement(position,htmlToFragment(this.ownerDocument,html))}insertAdjacentText(position,text){let node=this.ownerDocument.createTextNode(text);this.insertAdjacentElement(position,node)}cloneNode(deep=!1){let{ownerDocument,localName}=this,addNext=(next)=>{next.parentNode=parentNode,knownAdjacent($next,next),$next=next},clone=create2(ownerDocument,this,localName),parentNode=clone,$next=clone,{[NEXT]:next,[END]:prev}=this;while(next!==prev&&(deep||next.nodeType===ATTRIBUTE_NODE)){switch(next.nodeType){case NODE_END:knownAdjacent($next,parentNode[END]),$next=parentNode[END],parentNode=parentNode.parentNode;break;case ELEMENT_NODE:{let node=create2(ownerDocument,next,next.localName);addNext(node),parentNode=node;break}case ATTRIBUTE_NODE:{let attr=next.cloneNode(deep);attr.ownerElement=parentNode,addNext(attr);break}case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:addNext(next.cloneNode(deep));break}next=next[NEXT]}return knownAdjacent($next,clone[END]),clone}toString(){let out=[],{[END]:end}=this,next={[NEXT]:this},isOpened=!1;do switch(next=next[NEXT],next.nodeType){case ATTRIBUTE_NODE:{let attr=" "+next;switch(attr){case" id":case" class":case" style":break;default:out.push(attr)}break}case NODE_END:{let start=next[START];if(isOpened){if("ownerSVGElement"in start)out.push(" />");else if(isVoid(start))out.push(ignoreCase(start)?">":" />");else out.push(`></${start.localName}>`);isOpened=!1}else out.push(`</${start.localName}>`);break}case ELEMENT_NODE:if(isOpened)out.push(">");if(next.toString!==this.toString)out.push(next.toString()),next=next[END],isOpened=!1;else out.push(`<${next.localName}`),isOpened=!0;break;case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:out.push((isOpened?">":"")+next),isOpened=!1;break}while(next!==end);return out.join("")}toJSON(){let json=[];return elementAsJSON(this,json),json}getAttributeNS(_,name){return this.getAttribute(name)}getElementsByTagNameNS(_,name){return this.getElementsByTagName(name)}hasAttributeNS(_,name){return this.hasAttribute(name)}removeAttributeNS(_,name){this.removeAttribute(name)}setAttributeNS(_,name,value){this.setAttribute(name,value)}setAttributeNodeNS(attr){return this.setAttributeNode(attr)}}var classNames=new WeakMap,handler3={get(target,name){return target[name]},set(target,name,value){return target[name]=value,!0}};class SVGElement extends Element2{constructor(ownerDocument,localName,ownerSVGElement=null){super(ownerDocument,localName);this.ownerSVGElement=ownerSVGElement}get className(){if(!classNames.has(this))classNames.set(this,new Proxy({baseVal:"",animVal:""},handler3));return classNames.get(this)}set className(value){let{classList}=this;classList.clear(),classList.add(...$String(value).split(/\s+/))}get namespaceURI(){return"http://www.w3.org/2000/svg"}getAttribute(name){return name==="class"?[...this.classList].join(" "):super.getAttribute(name)}setAttribute(name,value){if(name==="class")this.className=value;else if(name==="style"){let{className}=this;className.baseVal=className.animVal=value}super.setAttribute(name,value)}}var illegalConstructor=()=>{throw TypeError("Illegal constructor")};function Attr2(){illegalConstructor()}setPrototypeOf(Attr2,Attr);Attr2.prototype=Attr.prototype;function CDATASection2(){illegalConstructor()}setPrototypeOf(CDATASection2,CDATASection);CDATASection2.prototype=CDATASection.prototype;function CharacterData2(){illegalConstructor()}setPrototypeOf(CharacterData2,CharacterData);CharacterData2.prototype=CharacterData.prototype;function Comment7(){illegalConstructor()}setPrototypeOf(Comment7,Comment3);Comment7.prototype=Comment3.prototype;function DocumentFragment2(){illegalConstructor()}setPrototypeOf(DocumentFragment2,DocumentFragment);DocumentFragment2.prototype=DocumentFragment.prototype;function DocumentType2(){illegalConstructor()}setPrototypeOf(DocumentType2,DocumentType);DocumentType2.prototype=DocumentType.prototype;function Element3(){illegalConstructor()}setPrototypeOf(Element3,Element2);Element3.prototype=Element2.prototype;function Node3(){illegalConstructor()}setPrototypeOf(Node3,Node2);Node3.prototype=Node2.prototype;function ShadowRoot2(){illegalConstructor()}setPrototypeOf(ShadowRoot2,ShadowRoot);ShadowRoot2.prototype=ShadowRoot.prototype;function Text7(){illegalConstructor()}setPrototypeOf(Text7,Text6);Text7.prototype=Text6.prototype;function SVGElement2(){illegalConstructor()}setPrototypeOf(SVGElement2,SVGElement);SVGElement2.prototype=SVGElement.prototype;var Facades={Attr:Attr2,CDATASection:CDATASection2,CharacterData:CharacterData2,Comment:Comment7,DocumentFragment:DocumentFragment2,DocumentType:DocumentType2,Element:Element3,Node:Node3,ShadowRoot:ShadowRoot2,Text:Text7,SVGElement:SVGElement2};var Level0=new WeakMap,level0={get(element,name){return Level0.has(element)&&Level0.get(element)[name]||null},set(element,name,value){if(!Level0.has(element))Level0.set(element,{});let handlers=Level0.get(element),type=name.slice(2);if(handlers[name])element.removeEventListener(type,handlers[name],!1);if(handlers[name]=value)element.addEventListener(type,value,!1)}};class HTMLElement extends Element2{static get observedAttributes(){return[]}constructor(ownerDocument=null,localName=""){super(ownerDocument,localName);let ownerLess=!ownerDocument,options;if(ownerLess){let{constructor:Class}=this;if(!Classes.has(Class))throw Error("unable to initialize this Custom Element");({ownerDocument,localName,options}=Classes.get(Class))}if(ownerDocument[UPGRADE]){let{element,values}=ownerDocument[UPGRADE];ownerDocument[UPGRADE]=null;for(let[key,value]of values)element[key]=value;return element}if(ownerLess){if(this.ownerDocument=this[END].ownerDocument=ownerDocument,this.localName=localName,customElements.set(this,{connected:!1}),options.is)this.setAttribute("is",options.is)}}blur(){this.dispatchEvent(new GlobalEvent("blur"))}click(){let clickEvent=new GlobalEvent("click",{bubbles:!0,cancelable:!0});clickEvent.button=0,this.dispatchEvent(clickEvent)}get accessKeyLabel(){let{accessKey}=this;return accessKey&&`Alt+Shift+${accessKey}`}get isContentEditable(){return this.hasAttribute("contenteditable")}get contentEditable(){return booleanAttribute.get(this,"contenteditable")}set contentEditable(value){booleanAttribute.set(this,"contenteditable",value)}get draggable(){return booleanAttribute.get(this,"draggable")}set draggable(value){booleanAttribute.set(this,"draggable",value)}get hidden(){return booleanAttribute.get(this,"hidden")}set hidden(value){booleanAttribute.set(this,"hidden",value)}get spellcheck(){return booleanAttribute.get(this,"spellcheck")}set spellcheck(value){booleanAttribute.set(this,"spellcheck",value)}get accessKey(){return stringAttribute.get(this,"accesskey")}set accessKey(value){stringAttribute.set(this,"accesskey",value)}get dir(){return stringAttribute.get(this,"dir")}set dir(value){stringAttribute.set(this,"dir",value)}get lang(){return stringAttribute.get(this,"lang")}set lang(value){stringAttribute.set(this,"lang",value)}get title(){return stringAttribute.get(this,"title")}set title(value){stringAttribute.set(this,"title",value)}get onabort(){return level0.get(this,"onabort")}set onabort(value){level0.set(this,"onabort",value)}get onblur(){return level0.get(this,"onblur")}set onblur(value){level0.set(this,"onblur",value)}get oncancel(){return level0.get(this,"oncancel")}set oncancel(value){level0.set(this,"oncancel",value)}get oncanplay(){return level0.get(this,"oncanplay")}set oncanplay(value){level0.set(this,"oncanplay",value)}get oncanplaythrough(){return level0.get(this,"oncanplaythrough")}set oncanplaythrough(value){level0.set(this,"oncanplaythrough",value)}get onchange(){return level0.get(this,"onchange")}set onchange(value){level0.set(this,"onchange",value)}get onclick(){return level0.get(this,"onclick")}set onclick(value){level0.set(this,"onclick",value)}get onclose(){return level0.get(this,"onclose")}set onclose(value){level0.set(this,"onclose",value)}get oncontextmenu(){return level0.get(this,"oncontextmenu")}set oncontextmenu(value){level0.set(this,"oncontextmenu",value)}get oncuechange(){return level0.get(this,"oncuechange")}set oncuechange(value){level0.set(this,"oncuechange",value)}get ondblclick(){return level0.get(this,"ondblclick")}set ondblclick(value){level0.set(this,"ondblclick",value)}get ondrag(){return level0.get(this,"ondrag")}set ondrag(value){level0.set(this,"ondrag",value)}get ondragend(){return level0.get(this,"ondragend")}set ondragend(value){level0.set(this,"ondragend",value)}get ondragenter(){return level0.get(this,"ondragenter")}set ondragenter(value){level0.set(this,"ondragenter",value)}get ondragleave(){return level0.get(this,"ondragleave")}set ondragleave(value){level0.set(this,"ondragleave",value)}get ondragover(){return level0.get(this,"ondragover")}set ondragover(value){level0.set(this,"ondragover",value)}get ondragstart(){return level0.get(this,"ondragstart")}set ondragstart(value){level0.set(this,"ondragstart",value)}get ondrop(){return level0.get(this,"ondrop")}set ondrop(value){level0.set(this,"ondrop",value)}get ondurationchange(){return level0.get(this,"ondurationchange")}set ondurationchange(value){level0.set(this,"ondurationchange",value)}get onemptied(){return level0.get(this,"onemptied")}set onemptied(value){level0.set(this,"onemptied",value)}get onended(){return level0.get(this,"onended")}set onended(value){level0.set(this,"onended",value)}get onerror(){return level0.get(this,"onerror")}set onerror(value){level0.set(this,"onerror",value)}get onfocus(){return level0.get(this,"onfocus")}set onfocus(value){level0.set(this,"onfocus",value)}get oninput(){return level0.get(this,"oninput")}set oninput(value){level0.set(this,"oninput",value)}get oninvalid(){return level0.get(this,"oninvalid")}set oninvalid(value){level0.set(this,"oninvalid",value)}get onkeydown(){return level0.get(this,"onkeydown")}set onkeydown(value){level0.set(this,"onkeydown",value)}get onkeypress(){return level0.get(this,"onkeypress")}set onkeypress(value){level0.set(this,"onkeypress",value)}get onkeyup(){return level0.get(this,"onkeyup")}set onkeyup(value){level0.set(this,"onkeyup",value)}get onload(){return level0.get(this,"onload")}set onload(value){level0.set(this,"onload",value)}get onloadeddata(){return level0.get(this,"onloadeddata")}set onloadeddata(value){level0.set(this,"onloadeddata",value)}get onloadedmetadata(){return level0.get(this,"onloadedmetadata")}set onloadedmetadata(value){level0.set(this,"onloadedmetadata",value)}get onloadstart(){return level0.get(this,"onloadstart")}set onloadstart(value){level0.set(this,"onloadstart",value)}get onmousedown(){return level0.get(this,"onmousedown")}set onmousedown(value){level0.set(this,"onmousedown",value)}get onmouseenter(){return level0.get(this,"onmouseenter")}set onmouseenter(value){level0.set(this,"onmouseenter",value)}get onmouseleave(){return level0.get(this,"onmouseleave")}set onmouseleave(value){level0.set(this,"onmouseleave",value)}get onmousemove(){return level0.get(this,"onmousemove")}set onmousemove(value){level0.set(this,"onmousemove",value)}get onmouseout(){return level0.get(this,"onmouseout")}set onmouseout(value){level0.set(this,"onmouseout",value)}get onmouseover(){return level0.get(this,"onmouseover")}set onmouseover(value){level0.set(this,"onmouseover",value)}get onmouseup(){return level0.get(this,"onmouseup")}set onmouseup(value){level0.set(this,"onmouseup",value)}get onmousewheel(){return level0.get(this,"onmousewheel")}set onmousewheel(value){level0.set(this,"onmousewheel",value)}get onpause(){return level0.get(this,"onpause")}set onpause(value){level0.set(this,"onpause",value)}get onplay(){return level0.get(this,"onplay")}set onplay(value){level0.set(this,"onplay",value)}get onplaying(){return level0.get(this,"onplaying")}set onplaying(value){level0.set(this,"onplaying",value)}get onprogress(){return level0.get(this,"onprogress")}set onprogress(value){level0.set(this,"onprogress",value)}get onratechange(){return level0.get(this,"onratechange")}set onratechange(value){level0.set(this,"onratechange",value)}get onreset(){return level0.get(this,"onreset")}set onreset(value){level0.set(this,"onreset",value)}get onresize(){return level0.get(this,"onresize")}set onresize(value){level0.set(this,"onresize",value)}get onscroll(){return level0.get(this,"onscroll")}set onscroll(value){level0.set(this,"onscroll",value)}get onseeked(){return level0.get(this,"onseeked")}set onseeked(value){level0.set(this,"onseeked",value)}get onseeking(){return level0.get(this,"onseeking")}set onseeking(value){level0.set(this,"onseeking",value)}get onselect(){return level0.get(this,"onselect")}set onselect(value){level0.set(this,"onselect",value)}get onshow(){return level0.get(this,"onshow")}set onshow(value){level0.set(this,"onshow",value)}get onstalled(){return level0.get(this,"onstalled")}set onstalled(value){level0.set(this,"onstalled",value)}get onsubmit(){return level0.get(this,"onsubmit")}set onsubmit(value){level0.set(this,"onsubmit",value)}get onsuspend(){return level0.get(this,"onsuspend")}set onsuspend(value){level0.set(this,"onsuspend",value)}get ontimeupdate(){return level0.get(this,"ontimeupdate")}set ontimeupdate(value){level0.set(this,"ontimeupdate",value)}get ontoggle(){return level0.get(this,"ontoggle")}set ontoggle(value){level0.set(this,"ontoggle",value)}get onvolumechange(){return level0.get(this,"onvolumechange")}set onvolumechange(value){level0.set(this,"onvolumechange",value)}get onwaiting(){return level0.get(this,"onwaiting")}set onwaiting(value){level0.set(this,"onwaiting",value)}get onauxclick(){return level0.get(this,"onauxclick")}set onauxclick(value){level0.set(this,"onauxclick",value)}get ongotpointercapture(){return level0.get(this,"ongotpointercapture")}set ongotpointercapture(value){level0.set(this,"ongotpointercapture",value)}get onlostpointercapture(){return level0.get(this,"onlostpointercapture")}set onlostpointercapture(value){level0.set(this,"onlostpointercapture",value)}get onpointercancel(){return level0.get(this,"onpointercancel")}set onpointercancel(value){level0.set(this,"onpointercancel",value)}get onpointerdown(){return level0.get(this,"onpointerdown")}set onpointerdown(value){level0.set(this,"onpointerdown",value)}get onpointerenter(){return level0.get(this,"onpointerenter")}set onpointerenter(value){level0.set(this,"onpointerenter",value)}get onpointerleave(){return level0.get(this,"onpointerleave")}set onpointerleave(value){level0.set(this,"onpointerleave",value)}get onpointermove(){return level0.get(this,"onpointermove")}set onpointermove(value){level0.set(this,"onpointermove",value)}get onpointerout(){return level0.get(this,"onpointerout")}set onpointerout(value){level0.set(this,"onpointerout",value)}get onpointerover(){return level0.get(this,"onpointerover")}set onpointerover(value){level0.set(this,"onpointerover",value)}get onpointerup(){return level0.get(this,"onpointerup")}set onpointerup(value){level0.set(this,"onpointerup",value)}}var tagName="template";class HTMLTemplateElement extends HTMLElement{constructor(ownerDocument){super(ownerDocument,tagName);let content=this.ownerDocument.createDocumentFragment();(this[CONTENT]=content)[PRIVATE]=this}get content(){if(this.hasChildNodes()&&!this[CONTENT].hasChildNodes())for(let node of this.childNodes)this[CONTENT].appendChild(node.cloneNode(!0));return this[CONTENT]}}registerHTMLClass(tagName,HTMLTemplateElement);class HTMLHtmlElement extends HTMLElement{constructor(ownerDocument,localName="html"){super(ownerDocument,localName)}}var{toString}=HTMLElement.prototype;class TextElement extends HTMLElement{get innerHTML(){return this.textContent}set innerHTML(html){this.textContent=html}toString(){return toString.call(this.cloneNode()).replace("><",()=>`>${this.textContent}<`)}}var tagName2="script";class HTMLScriptElement extends TextElement{constructor(ownerDocument,localName=tagName2){super(ownerDocument,localName)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get defer(){return booleanAttribute.get(this,"defer")}set defer(value){booleanAttribute.set(this,"defer",value)}get crossOrigin(){return stringAttribute.get(this,"crossorigin")}set crossOrigin(value){stringAttribute.set(this,"crossorigin",value)}get nomodule(){return booleanAttribute.get(this,"nomodule")}set nomodule(value){booleanAttribute.set(this,"nomodule",value)}get referrerPolicy(){return stringAttribute.get(this,"referrerpolicy")}set referrerPolicy(value){stringAttribute.set(this,"referrerpolicy",value)}get nonce(){return stringAttribute.get(this,"nonce")}set nonce(value){stringAttribute.set(this,"nonce",value)}get async(){return booleanAttribute.get(this,"async")}set async(value){booleanAttribute.set(this,"async",value)}get text(){return this.textContent}set text(content){this.textContent=content}}registerHTMLClass(tagName2,HTMLScriptElement);class HTMLFrameElement extends HTMLElement{constructor(ownerDocument,localName="frame"){super(ownerDocument,localName)}}var tagName3="iframe";class HTMLIFrameElement extends HTMLElement{constructor(ownerDocument,localName=tagName3){super(ownerDocument,localName)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcdoc(){return stringAttribute.get(this,"srcdoc")}set srcdoc(value){stringAttribute.set(this,"srcdoc",value)}get name(){return stringAttribute.get(this,"name")}set name(value){stringAttribute.set(this,"name",value)}get allow(){return stringAttribute.get(this,"allow")}set allow(value){stringAttribute.set(this,"allow",value)}get allowFullscreen(){return booleanAttribute.get(this,"allowfullscreen")}set allowFullscreen(value){booleanAttribute.set(this,"allowfullscreen",value)}get referrerPolicy(){return stringAttribute.get(this,"referrerpolicy")}set referrerPolicy(value){stringAttribute.set(this,"referrerpolicy",value)}get loading(){return stringAttribute.get(this,"loading")}set loading(value){stringAttribute.set(this,"loading",value)}}registerHTMLClass(tagName3,HTMLIFrameElement);class HTMLObjectElement extends HTMLElement{constructor(ownerDocument,localName="object"){super(ownerDocument,localName)}}class HTMLHeadElement extends HTMLElement{constructor(ownerDocument,localName="head"){super(ownerDocument,localName)}}class HTMLBodyElement extends HTMLElement{constructor(ownerDocument,localName="body"){super(ownerDocument,localName)}}var SUPPORTED_PROPERTIES=new Set("-webkit-align-content,-webkit-align-items,-webkit-align-self,-webkit-animation,-webkit-animation-delay,-webkit-animation-direction,-webkit-animation-duration,-webkit-animation-fill-mode,-webkit-animation-iteration-count,-webkit-animation-name,-webkit-animation-play-state,-webkit-animation-timing-function,-webkit-appearance,-webkit-backface-visibility,-webkit-background-clip,-webkit-background-origin,-webkit-background-size,-webkit-border-bottom-left-radius,-webkit-border-bottom-right-radius,-webkit-border-radius,-webkit-border-top-left-radius,-webkit-border-top-right-radius,-webkit-box-align,-webkit-box-flex,-webkit-box-ordinal-group,-webkit-box-orient,-webkit-box-pack,-webkit-box-shadow,-webkit-box-sizing,-webkit-filter,-webkit-flex,-webkit-flex-basis,-webkit-flex-direction,-webkit-flex-flow,-webkit-flex-grow,-webkit-flex-shrink,-webkit-flex-wrap,-webkit-justify-content,-webkit-line-clamp,-webkit-mask,-webkit-mask-box-image,-webkit-mask-box-image-outset,-webkit-mask-box-image-repeat,-webkit-mask-box-image-slice,-webkit-mask-box-image-source,-webkit-mask-box-image-width,-webkit-mask-clip,-webkit-mask-composite,-webkit-mask-image,-webkit-mask-origin,-webkit-mask-position,-webkit-mask-repeat,-webkit-mask-size,-webkit-order,-webkit-perspective,-webkit-perspective-origin,-webkit-text-fill-color,-webkit-text-size-adjust,-webkit-text-stroke,-webkit-text-stroke-color,-webkit-text-stroke-width,-webkit-transform,-webkit-transform-origin,-webkit-transform-style,-webkit-transition,-webkit-transition-delay,-webkit-transition-duration,-webkit-transition-property,-webkit-transition-timing-function,-webkit-user-select,accent-color,align-content,align-items,align-self,alignment-baseline,all,anchor-name,anchor-scope,animation,animation-composition,animation-delay,animation-delay-end,animation-delay-start,animation-direction,animation-duration,animation-fill-mode,animation-iteration-count,animation-name,animation-play-state,animation-range,animation-range-center,animation-range-end,animation-range-start,animation-timeline,animation-timing-function,animation-trigger,appearance,aspect-ratio,backdrop-filter,backface-visibility,background,background-attachment,background-blend-mode,background-clip,background-color,background-image,background-origin,background-position,background-position-block,background-position-inline,background-position-x,background-position-y,background-repeat,background-repeat-block,background-repeat-inline,background-repeat-x,background-repeat-y,background-size,background-tbd,baseline-shift,baseline-source,block-ellipsis,block-size,block-step,block-step-align,block-step-insert,block-step-round,block-step-size,bookmark-label,bookmark-level,bookmark-state,border,border-block,border-block-clip,border-block-color,border-block-end,border-block-end-clip,border-block-end-color,border-block-end-radius,border-block-end-style,border-block-end-width,border-block-start,border-block-start-clip,border-block-start-color,border-block-start-radius,border-block-start-style,border-block-start-width,border-block-style,border-block-width,border-bottom,border-bottom-clip,border-bottom-color,border-bottom-left-radius,border-bottom-radius,border-bottom-right-radius,border-bottom-style,border-bottom-width,border-boundary,border-clip,border-collapse,border-color,border-end-end-radius,border-end-start-radius,border-image,border-image-outset,border-image-repeat,border-image-slice,border-image-source,border-image-width,border-inline,border-inline-clip,border-inline-color,border-inline-end,border-inline-end-clip,border-inline-end-color,border-inline-end-radius,border-inline-end-style,border-inline-end-width,border-inline-start,border-inline-start-clip,border-inline-start-color,border-inline-start-radius,border-inline-start-style,border-inline-start-width,border-inline-style,border-inline-width,border-left,border-left-clip,border-left-color,border-left-radius,border-left-style,border-left-width,border-limit,border-radius,border-right,border-right-clip,border-right-color,border-right-radius,border-right-style,border-right-width,border-shape,border-spacing,border-start-end-radius,border-start-start-radius,border-style,border-top,border-top-clip,border-top-color,border-top-left-radius,border-top-radius,border-top-right-radius,border-top-style,border-top-width,border-width,bottom,box-decoration-break,box-shadow,box-shadow-blur,box-shadow-color,box-shadow-offset,box-shadow-position,box-shadow-spread,box-sizing,box-snap,break-after,break-before,break-inside,caption-side,caret,caret-animation,caret-color,caret-shape,clear,clip,clip-path,clip-rule,color,color-adjust,color-interpolation,color-interpolation-filters,color-scheme,column-count,column-fill,column-gap,column-height,column-rule,column-rule-break,column-rule-color,column-rule-inset,column-rule-inset-cap,column-rule-inset-cap-end,column-rule-inset-cap-start,column-rule-inset-end,column-rule-inset-junction,column-rule-inset-junction-end,column-rule-inset-junction-start,column-rule-inset-start,column-rule-style,column-rule-visibility-items,column-rule-width,column-span,column-width,column-wrap,columns,contain,contain-intrinsic-block-size,contain-intrinsic-height,contain-intrinsic-inline-size,contain-intrinsic-size,contain-intrinsic-width,container,container-name,container-type,content,content-visibility,continue,copy-into,corner,corner-block-end,corner-block-end-shape,corner-block-start,corner-block-start-shape,corner-bottom,corner-bottom-left,corner-bottom-left-shape,corner-bottom-right,corner-bottom-right-shape,corner-bottom-shape,corner-end-end,corner-end-end-shape,corner-end-start,corner-end-start-shape,corner-inline-end,corner-inline-end-shape,corner-inline-start,corner-inline-start-shape,corner-left,corner-left-shape,corner-right,corner-right-shape,corner-shape,corner-start-end,corner-start-end-shape,corner-start-start,corner-start-start-shape,corner-top,corner-top-left,corner-top-left-shape,corner-top-right,corner-top-right-shape,corner-top-shape,counter-increment,counter-reset,counter-set,cue,cue-after,cue-before,cursor,cx,cy,d,direction,display,dominant-baseline,dynamic-range-limit,empty-cells,event-trigger,event-trigger-name,event-trigger-source,field-sizing,fill,fill-break,fill-color,fill-image,fill-opacity,fill-origin,fill-position,fill-repeat,fill-rule,fill-size,filter,fit-tolerance,flex,flex-basis,flex-direction,flex-flow,flex-grow,flex-line-count,flex-shrink,flex-wrap,float,float-defer,float-offset,float-reference,flood-color,flood-opacity,flow-from,flow-into,font,font-family,font-feature-settings,font-kerning,font-language-override,font-optical-sizing,font-palette,font-presentation,font-size,font-size-adjust,font-stretch,font-style,font-synthesis,font-synthesis-position,font-synthesis-small-caps,font-synthesis-style,font-synthesis-weight,font-variant,font-variant-alternates,font-variant-caps,font-variant-east-asian,font-variant-emoji,font-variant-ligatures,font-variant-numeric,font-variant-position,font-variation-settings,font-weight,font-width,footnote-display,footnote-policy,forced-color-adjust,frame-sizing,gap,glyph-orientation-vertical,grid,grid-area,grid-auto-columns,grid-auto-flow,grid-auto-rows,grid-column,grid-column-end,grid-column-gap,grid-column-start,grid-gap,grid-row,grid-row-end,grid-row-gap,grid-row-start,grid-template,grid-template-areas,grid-template-columns,grid-template-rows,hanging-punctuation,height,hyphenate-character,hyphenate-limit-chars,hyphenate-limit-last,hyphenate-limit-lines,hyphenate-limit-zone,hyphens,image-animation,image-orientation,image-rendering,image-resolution,initial-letter,initial-letter-align,initial-letter-wrap,inline-size,inline-sizing,input-security,inset,inset-block,inset-block-end,inset-block-start,inset-inline,inset-inline-end,inset-inline-start,interactivity,interest-delay,interest-delay-end,interest-delay-start,interpolate-size,isolation,justify-content,justify-items,justify-self,left,letter-spacing,lighting-color,line-break,line-clamp,line-fit-edge,line-grid,line-height,line-height-step,line-padding,line-snap,link-parameters,list-style,list-style-image,list-style-position,list-style-type,margin,margin-block,margin-block-end,margin-block-start,margin-bottom,margin-break,margin-inline,margin-inline-end,margin-inline-start,margin-left,margin-right,margin-top,margin-trim,marker,marker-end,marker-mid,marker-side,marker-start,mask,mask-border,mask-border-mode,mask-border-outset,mask-border-repeat,mask-border-slice,mask-border-source,mask-border-width,mask-clip,mask-composite,mask-image,mask-mode,mask-origin,mask-position,mask-repeat,mask-size,mask-type,math-depth,math-shift,math-style,max-block-size,max-height,max-inline-size,max-lines,max-size,max-width,min-block-size,min-height,min-inline-size,min-intrinsic-sizing,min-size,min-width,mix-blend-mode,nav-down,nav-left,nav-right,nav-up,object-fit,object-position,object-view-box,offset,offset-anchor,offset-distance,offset-path,offset-position,offset-rotate,opacity,order,orphans,outline,outline-color,outline-offset,outline-style,outline-width,overflow,overflow-anchor,overflow-block,overflow-clip-margin,overflow-clip-margin-block,overflow-clip-margin-block-end,overflow-clip-margin-block-start,overflow-clip-margin-bottom,overflow-clip-margin-inline,overflow-clip-margin-inline-end,overflow-clip-margin-inline-start,overflow-clip-margin-left,overflow-clip-margin-right,overflow-clip-margin-top,overflow-inline,overflow-wrap,overflow-x,overflow-y,overlay,overscroll-behavior,overscroll-behavior-block,overscroll-behavior-inline,overscroll-behavior-x,overscroll-behavior-y,padding,padding-block,padding-block-end,padding-block-start,padding-bottom,padding-inline,padding-inline-end,padding-inline-start,padding-left,padding-right,padding-top,page,page-break-after,page-break-before,page-break-inside,paint-order,path-length,pause,pause-after,pause-before,perspective,perspective-origin,place-content,place-items,place-self,pointer-events,pointer-timeline,pointer-timeline-axis,pointer-timeline-name,position,position-anchor,position-area,position-try,position-try-fallbacks,position-try-order,position-visibility,print-color-adjust,quotes,r,reading-flow,reading-order,region-fragment,resize,rest,rest-after,rest-before,right,rotate,row-gap,row-rule,row-rule-break,row-rule-color,row-rule-inset,row-rule-inset-cap,row-rule-inset-cap-end,row-rule-inset-cap-start,row-rule-inset-end,row-rule-inset-junction,row-rule-inset-junction-end,row-rule-inset-junction-start,row-rule-inset-start,row-rule-style,row-rule-visibility-items,row-rule-width,ruby-align,ruby-merge,ruby-overhang,ruby-position,rule,rule-break,rule-color,rule-inset,rule-inset-cap,rule-inset-end,rule-inset-junction,rule-inset-start,rule-overlap,rule-style,rule-visibility-items,rule-width,rx,ry,scale,scroll-axis-lock,scroll-behavior,scroll-initial-target,scroll-margin,scroll-margin-block,scroll-margin-block-end,scroll-margin-block-start,scroll-margin-bottom,scroll-margin-inline,scroll-margin-inline-end,scroll-margin-inline-start,scroll-margin-left,scroll-margin-right,scroll-margin-top,scroll-marker-group,scroll-padding,scroll-padding-block,scroll-padding-block-end,scroll-padding-block-start,scroll-padding-bottom,scroll-padding-inline,scroll-padding-inline-end,scroll-padding-inline-start,scroll-padding-left,scroll-padding-right,scroll-padding-top,scroll-snap-align,scroll-snap-stop,scroll-snap-type,scroll-target-group,scroll-timeline,scroll-timeline-axis,scroll-timeline-name,scrollbar-color,scrollbar-gutter,scrollbar-width,shape-image-threshold,shape-inside,shape-margin,shape-outside,shape-padding,shape-rendering,size,slider-orientation,spatial-navigation-action,spatial-navigation-contain,spatial-navigation-function,speak,speak-as,stop-color,stop-opacity,string-set,stroke,stroke-align,stroke-alignment,stroke-break,stroke-color,stroke-dash-corner,stroke-dash-justify,stroke-dashadjust,stroke-dasharray,stroke-dashcorner,stroke-dashoffset,stroke-image,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-origin,stroke-position,stroke-repeat,stroke-size,stroke-width,tab-size,table-layout,text-align,text-align-all,text-align-last,text-anchor,text-autospace,text-box,text-box-edge,text-box-trim,text-combine-upright,text-decoration,text-decoration-color,text-decoration-inset,text-decoration-line,text-decoration-skip,text-decoration-skip-box,text-decoration-skip-ink,text-decoration-skip-self,text-decoration-skip-spaces,text-decoration-style,text-decoration-thickness,text-emphasis,text-emphasis-color,text-emphasis-position,text-emphasis-skip,text-emphasis-style,text-fit,text-group-align,text-indent,text-justify,text-orientation,text-overflow,text-rendering,text-shadow,text-size-adjust,text-spacing,text-spacing-trim,text-transform,text-underline-offset,text-underline-position,text-wrap,text-wrap-mode,text-wrap-style,timeline-scope,timeline-trigger,timeline-trigger-activation-range,timeline-trigger-activation-range-end,timeline-trigger-activation-range-start,timeline-trigger-active-range,timeline-trigger-active-range-end,timeline-trigger-active-range-start,timeline-trigger-name,timeline-trigger-range,timeline-trigger-source,top,touch-action,transform,transform-box,transform-origin,transform-style,transition,transition-behavior,transition-delay,transition-duration,transition-property,transition-timing-function,translate,trigger-scope,unicode-bidi,user-select,vector-effect,vertical-align,view-timeline,view-timeline-axis,view-timeline-inset,view-timeline-name,view-transition-class,view-transition-group,view-transition-name,view-transition-scope,visibility,voice-balance,voice-duration,voice-family,voice-pitch,voice-range,voice-rate,voice-stress,voice-volume,white-space,white-space-collapse,white-space-trim,widows,width,will-change,window-drag,word-break,word-space-transform,word-spacing,word-wrap,wrap-after,wrap-before,wrap-flow,wrap-inside,wrap-through,writing-mode,x,y,z-index,zoom".split(",")),CUSTOM_IDENT_PROPERTIES=new Set("-webkit-animation,-webkit-animation-name,-webkit-transition,-webkit-transition-property,animation,animation-name,color-scheme,container,container-name,copy-into,counter-increment,counter-reset,counter-set,flow-from,flow-into,font,font-family,grid,grid-area,grid-column,grid-column-end,grid-column-start,grid-row,grid-row-end,grid-row-start,grid-template,grid-template-columns,grid-template-rows,list-style,list-style-type,page,string-set,transition,transition-property,view-transition-class,view-transition-group,view-transition-name,will-change".split(",")),FONT_FACE_DESCRIPTORS=new Set("ascent-override,descent-override,font-display,font-family,font-feature-settings,font-language-override,font-named-instance,font-size,font-stretch,font-style,font-variant,font-variation-settings,font-weight,font-width,line-gap-override,size-adjust,src,subscript-position-override,subscript-size-override,superscript-position-override,superscript-size-override,unicode-range".split(",")),PAGE_ALLOWED_PROPERTIES=new Set("bleed,break-after,break-before,break-inside,counter-increment,counter-reset,counter-set,margin,margin-block,margin-block-end,margin-block-start,margin-bottom,margin-inline,margin-inline-end,margin-inline-start,margin-left,margin-right,margin-top,marks,orphans,page,page-break-after,page-break-before,page-break-inside,page-margin-safety,page-orientation,quotes,size,widows".split(",")),PAGE_DESCRIPTOR_PROPERTIES=["margin","margin-top","margin-right","margin-bottom","margin-left","size","page-orientation","marks","bleed"],POSITION_TRY_ALLOWED_PROPERTIES=new Set("align-self,block-size,bottom,height,inline-size,inset,inset-area,inset-block,inset-block-end,inset-block-start,inset-inline,inset-inline-end,inset-inline-start,justify-self,left,margin,margin-block,margin-block-end,margin-block-start,margin-bottom,margin-inline,margin-inline-end,margin-inline-start,margin-left,margin-right,margin-top,max-block-size,max-height,max-inline-size,max-width,min-block-size,min-height,min-inline-size,min-width,place-self,position-anchor,position-area,right,top,width".split(",")),COUNTER_STYLE_PROP_BY_DESCRIPTOR=new Map([["additive-symbols","additiveSymbols"],["fallback","fallback"],["negative","negative"],["pad","pad"],["prefix","prefix"],["range","range"],["speak-as","speakAs"],["suffix","suffix"],["symbols","symbols"],["system","system"]]),FONT_FEATURE_VALUE_MAP_DEFS=[["annotation","annotation"],["ornaments","ornaments"],["stylistic","stylistic"],["swash","swash"],["character-variant","characterVariant"],["styleset","styleset"],["historical-forms","historicalForms"]],FONT_FEATURE_VALUE_BLOCKS={annotation:"annotation",ornaments:"ornaments",stylistic:"stylistic",swash:"swash","character-variant":"characterVariant",charactervariant:"characterVariant",styleset:"styleset","historical-forms":"historicalForms",historicalforms:"historicalForms"},MARGIN_RULE_NAMES=new Set("bottom-center,bottom-left,bottom-left-corner,bottom-right,bottom-right-corner,left-bottom,left-middle,left-top,right-bottom,right-middle,right-top,top-center,top-left,top-left-corner,top-right,top-right-corner".split(",")),GENERIC_FONT_FAMILIES=new Set("cursive,emoji,fangsong,fantasy,math,monospace,sans-serif,serif,system-ui,ui-monospace,ui-rounded,ui-sans-serif,ui-serif".split(",")),FONT_VARIANT_LIGATURES_KEYWORDS=new Set("common-ligatures,no-common-ligatures,discretionary-ligatures,no-discretionary-ligatures,historical-ligatures,no-historical-ligatures,contextual,no-contextual".split(",")),FONT_VARIANT_CAPS_KEYWORDS=new Set("small-caps,all-small-caps,petite-caps,all-petite-caps,unicase,titling-caps".split(",")),FONT_VARIANT_NUMERIC_KEYWORDS=new Set("lining-nums,oldstyle-nums,proportional-nums,tabular-nums,diagonal-fractions,stacked-fractions,ordinal,slashed-zero".split(",")),FONT_VARIANT_EAST_ASIAN_KEYWORDS=new Set("jis78,jis83,jis90,jis04,simplified,traditional,full-width,proportional-width,ruby".split(",")),FONT_VARIANT_POSITION_KEYWORDS=new Set("sub,super".split(",")),FONT_VARIANT_EMOJI_KEYWORDS=new Set("text,emoji,unicode".split(",")),FONT_VARIANT_ALTERNATES_FUNCTIONS=new Set("stylistic,styleset,character-variant,swash,ornaments,annotation".split(",")),SYSTEM_FONT_KEYWORDS=new Set("initial,inherit,unset,revert,revert-layer,default,caption,icon,menu,message-box,small-caption,status-bar".split(",")),FONT_STRETCH_KEYWORDS=new Set("ultra-condensed,extra-condensed,condensed,semi-condensed,semi-expanded,expanded,extra-expanded,ultra-expanded".split(",")),FONT_SIZE_KEYWORDS=new Set("xx-small,x-small,small,medium,large,x-large,xx-large,xxx-large,smaller,larger".split(",")),FLEX_BASIS_KEYWORDS=new Set("auto,content,max-content,min-content,fit-content".split(","));function hideInternalFields(instance){for(let key of Object.getOwnPropertyNames(instance))if(key.startsWith("_"))Object.defineProperty(instance,key,{enumerable:!1})}var appliedCtors=new WeakSet;function applyWebIDLInterface(ctor,options={}){let proto=ctor.prototype;if(!proto)return;if(appliedCtors.has(ctor))return;appliedCtors.add(ctor);let brandCheck=options.brandCheck??!0,arityCheck=options.arityCheck??!0,interfaceName=options.interfaceName||ctor.name,excludeSet=new Set(options.exclude||[]),rejectSet=new Set(options.rejectOperations||[]);Object.defineProperty(ctor,"length",{value:0,writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(proto,Symbol.toStringTag,{value:interfaceName,writable:!1,enumerable:!1,configurable:!0});let names=Object.getOwnPropertyNames(proto);for(let name of names){if(name==="constructor"||name.startsWith("_")||excludeSet.has(name))continue;let desc=Object.getOwnPropertyDescriptor(proto,name);if(!desc)continue;if(desc.get||desc.set){let{get:origGet,set:origSet}=desc,get=origGet;if(origGet&&brandCheck)get=function(){if(!this||this===proto||!(this instanceof ctor))throw TypeError(`Failed to read the '${name}' property from '${interfaceName}': The provided value is not of type '${interfaceName}'.`);return origGet.call(this)},Object.defineProperty(get,"name",{value:`get ${name}`,configurable:!0});let set=origSet;if(origSet&&brandCheck)set=function(val){if(!this||this===proto||!(this instanceof ctor))throw TypeError(`Failed to set the '${name}' property on '${interfaceName}': The provided value is not of type '${interfaceName}'.`);return origSet.call(this,val)},Object.defineProperty(set,"name",{value:`set ${name}`,configurable:!0});Object.defineProperty(proto,name,{get,set:origSet?set:void 0,enumerable:!0,configurable:!0});continue}if(typeof desc.value==="function"){let origFn=desc.value,minArgs=origFn.length,fn=origFn;if(brandCheck||arityCheck&&minArgs>0)fn=function(...args){if(brandCheck&&(!this||this===proto||!(this instanceof ctor))){let err=TypeError(`Failed to execute '${name}' on '${interfaceName}': The provided value is not of type '${interfaceName}'.`);if(rejectSet.has(name))return Promise.reject(err);throw err}if(arityCheck&&arguments.length<minArgs){let err=TypeError(`Failed to execute '${name}' on '${interfaceName}': ${minArgs} argument${minArgs===1?"":"s"} required, but only ${arguments.length} present.`);if(rejectSet.has(name))return Promise.reject(err);throw err}return origFn.apply(this,args)},Object.defineProperty(fn,"name",{value:origFn.name,configurable:!0}),Object.defineProperty(fn,"length",{value:minArgs,configurable:!0});Object.defineProperty(proto,name,{value:fn,writable:!0,enumerable:!0,configurable:!0})}}}function applyWebIDLConstants(ctor,constants){for(let[name,val]of Object.entries(constants))if(Object.defineProperty(ctor,name,{value:val,writable:!1,enumerable:!0,configurable:!1}),ctor.prototype)Object.defineProperty(ctor.prototype,name,{value:val,writable:!1,enumerable:!0,configurable:!1})}function camelToDashed(str){return str.replace(/[A-Z]/g,(m)=>"-"+m.toLowerCase()).replace(/^ms-/,"-ms-")}function createIndexedProxy(target,getArray,mapValue){return hideInternalFields(target),new Proxy(target,{get(t,prop,receiver){if(typeof prop==="string"){let index=Number(prop);if(Number.isInteger(index)&&index>=0){let val=getArray(t)[index];return val!==void 0?mapValue?mapValue(val):val:void 0}}return Reflect.get(t,prop,receiver)},set(t,prop,value){return Reflect.set(t,prop,value,t)}})}function deleteRuleFromArray(rules,index){if(index<0||index>=rules.length)throw new DOMException("Index size error","IndexSizeError");let oldRule=rules[index];if(rules.splice(index,1),oldRule&&typeof oldRule==="object"){if("_parentRule"in oldRule)oldRule._parentRule=null;if("_parentStyleSheet"in oldRule)oldRule._parentStyleSheet=null}return oldRule}var DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI;var ParseHooks={parseMediaQueryList:(text)=>text.split(",").map((s)=>s.trim()).filter(Boolean).map((m)=>({type:"media-query",mediaType:m,tokens:[],raw:m})),serializeMediaQuery:(query)=>query.raw??query.mediaType??"",validatePropertyValue:(_property,_value,_rawValue)=>!0,supports:(_conditionText)=>!1,createStylePropertyMap:(_style)=>{throw Error("createStylePropertyMap not injected (import cssomnom/typed-om)")},validatePropertyRuleDescriptor:(_def)=>!0,registerPropertyRule:(_def)=>!1,unregisterPropertyRule:(_name)=>{}},StyleSheetList=class{_sheets;constructor(sheets){return this._sheets=sheets,createIndexedProxy(this,(t)=>t._sheets)}get length(){return this._sheets.length}item(index){return this._sheets[index]||null}*[Symbol.iterator](){for(let i=0;i<this.length;i++)yield this._sheets[i]}},MediaList=class{_mediaQueries=[];constructor(mediaText=""){return this.mediaText=mediaText,createIndexedProxy(this,(t)=>t._mediaQueries.map((q)=>ParseHooks.serializeMediaQuery(q)))}get mediaText(){return this._mediaQueries.map((q)=>ParseHooks.serializeMediaQuery(q)).join(", ")}set mediaText(value){if(!value){this._mediaQueries=[];return}this._mediaQueries=ParseHooks.parseMediaQueryList(value)}get length(){return this._mediaQueries.length}item(index){let q=this._mediaQueries[index];return q?ParseHooks.serializeMediaQuery(q):null}toString(){return this.mediaText}appendMedium(medium){let parsed=ParseHooks.parseMediaQueryList(medium);if(parsed.length!==1)return;let m=parsed[0],mText=ParseHooks.serializeMediaQuery(m);if(this._mediaQueries.some((q)=>ParseHooks.serializeMediaQuery(q)===mText))return;this._mediaQueries.push(m)}deleteMedium(medium){let parsed=ParseHooks.parseMediaQueryList(medium);if(parsed.length!==1)return;let mText=ParseHooks.serializeMediaQuery(parsed[0]),i=this._mediaQueries.length,found=!1;while(i--)if(ParseHooks.serializeMediaQuery(this._mediaQueries[i])===mText)this._mediaQueries.splice(i,1),found=!0;if(!found)throw new DOMException(`The medium '${medium}' does not exist in the MediaList.`,"NotFoundError")}*[Symbol.iterator](){for(let i=0;i<this.length;i++)yield ParseHooks.serializeMediaQuery(this._mediaQueries[i])}},CSSRuleList=class{_getRules;constructor(rulesOrGetter){return this._getRules=typeof rulesOrGetter==="function"?rulesOrGetter:()=>rulesOrGetter,createIndexedProxy(this,(t)=>t._getRules(),(v)=>v)}get length(){return this._getRules().length}item(index){return this._getRules()[index]||null}*[Symbol.iterator](){let rules=this._getRules();for(let i=0;i<rules.length;i++)yield rules[i]}};function isImportRule(r){return r.type===3}function isNamespaceRule(r){return r.type===10}function isRegularRule(r){return!isImportRule(r)&&!isNamespaceRule(r)}function serializeGroupingRule(atKeyword,condition,rules){let cond=condition?" "+condition:"",ruleTexts=rules.map((r)=>r.cssText).filter((p)=>p!=="");if(ruleTexts.length===0)return atKeyword==="keyframes"?`@${atKeyword}${cond} { }`:`@${atKeyword}${cond} {
|
|
10
|
+
}`;return`@${atKeyword}${cond} {
|
|
11
|
+
${ruleTexts.map((t)=>" "+t).join(`
|
|
12
|
+
`)}
|
|
13
|
+
}`}function findParentStyleSheet(rule){let{parentStyleSheet:sheet,parentRule:curr}=rule;while(!sheet&&curr)sheet=curr.parentStyleSheet,curr=curr.parentRule;return sheet}function isGrammaticallyValidSupportsCondition(values){let items=values.filter((v)=>v.type!=="whitespace"&&v.type!=="comment");if(items.length===0)return!1;let isSupportsInParens=(item)=>{if(item.type==="function")return!0;if(item.type==="simple-block"&&item.associatedToken.value==="("){let blockValues=item.value.filter((v)=>v.type!=="whitespace"&&v.type!=="comment");if(blockValues.length===0)return!0;let hasTopOp=blockValues.some((v)=>v.type==="ident"&&["and","or","not"].includes(String(v.value).toLowerCase())),isNestedParenBlock=blockValues.length===1&&blockValues[0].type==="simple-block"&&blockValues[0].associatedToken.value==="(";if(hasTopOp||isNestedParenBlock)return isGrammaticallyValidSupportsCondition(item.value);return!0}return!1},operands=[],operators=[],i=0;while(i<items.length){if(items[i].type==="ident"&&String(items[i].value).toLowerCase()==="not"){if(i+1>=items.length)return!1;if(!isSupportsInParens(items[i+1]))return!1;operands.push(!0),i+=2}else if(isSupportsInParens(items[i]))operands.push(!0),i+=1;else return!1;if(i<items.length){if(items[i].type!=="ident")return!1;let op=String(items[i].value).toLowerCase();if(op!=="and"&&op!=="or")return!1;operators.push(op),i+=1}}if(operands.length===0)return!1;if(operands.length!==operators.length+1)return!1;if(operators.length>0){let firstOp=operators[0];if(!operators.every((op)=>op===firstOp))return!1}return!0}var RULE_CONSTANTS={STYLE_RULE:1,CHARSET_RULE:2,IMPORT_RULE:3,MEDIA_RULE:4,FONT_FACE_RULE:5,PAGE_RULE:6,KEYFRAMES_RULE:7,KEYFRAME_RULE:8,MARGIN_RULE:9,NAMESPACE_RULE:10,COUNTER_STYLE_RULE:11,SUPPORTS_RULE:12,FONT_FEATURE_VALUES_RULE:14},CSSRule=class{_parentRule=null;_parentStyleSheet=null;_location;_assignedLayerName=null;constructor(){hideInternalFields(this)}get location(){return this._location}get parentRule(){return this._parentRule}get parentStyleSheet(){if(this._parentStyleSheet)return this._parentStyleSheet;if(this._parentRule)return this._parentRule.parentStyleSheet;return null}get type(){return 0}get cssText(){throw Error("Not implemented")}set cssText(_value){}};applyWebIDLConstants(CSSRule,RULE_CONSTANTS);var CSSGroupingRule=class CSSGroupingRule extends CSSRule{static _parser=null;_cssRules;_rules;get cssRules(){if(!this._cssRules)this._cssRules=new CSSRuleList(()=>this._rules);return this._cssRules}constructor(rules,_parseRuleInBlock){super();this._rules=rules,this._cssRules=new CSSRuleList(()=>this._rules);for(let rule of rules)if(rule instanceof CSSRule)rule._parentRule=this;hideInternalFields(this)}insertRule(rule,index=0){if(index<0||index>this._rules.length)throw new DOMException("Index size error","IndexSizeError");let isScopeRule=(r)=>r[Symbol.toStringTag]==="CSSScopeRule",isStyleRule=(r)=>r[Symbol.toStringTag]==="CSSStyleRule",isNested=isStyleRule(this)||isScopeRule(this)||this.parentRule!==null,isInsideStyleRule=isStyleRule(this),isDirectlyInScope=isScopeRule(this);for(let p=this.parentRule,seenStyle=isInsideStyleRule;p;p=p.parentRule)if(isStyleRule(p))isInsideStyleRule=!0,seenStyle=!0;else if(!seenStyle&&isScopeRule(p))isDirectlyInScope=!0;if(!CSSGroupingRule._parser)throw new DOMException("Parser not initialized","SyntaxError");let{parseRule,parseRuleInBlock,parseRuleInScopeBlock}=CSSGroupingRule._parser,topRule=null;try{topRule=parseRule(rule)}catch{}if(topRule){if(isImportRule(topRule)||isNamespaceRule(topRule))throw new DOMException("HierarchyRequestError: @import and @namespace rules are not allowed inside grouping rules","HierarchyRequestError");if(isInsideStyleRule&&!(topRule instanceof CSSGroupingRule))throw new DOMException("HierarchyRequestError: This rule cannot be inserted inside a nested rule","HierarchyRequestError")}let parsedRule=isDirectlyInScope?parseRuleInScopeBlock(rule):parseRuleInBlock(rule,isNested);if(!parsedRule)throw new DOMException("Syntax error","SyntaxError");if(isImportRule(parsedRule)||isNamespaceRule(parsedRule))throw new DOMException("HierarchyRequestError: @import and @namespace rules are not allowed inside grouping rules","HierarchyRequestError");if(parsedRule[Symbol.toStringTag]==="CSSNestedDeclarations"){if(!isNested)throw new DOMException("Syntax error: CSSNestedDeclarations cannot be inserted into top-level grouping rule","SyntaxError");if(parsedRule.style._declarations.filter((d)=>{let name=d.name.toLowerCase();return name.startsWith("--")||SUPPORTED_PROPERTIES.has(name)}).length===0)throw new DOMException("Syntax error: CSSNestedDeclarations contains no valid declarations","SyntaxError")}if(parsedRule instanceof CSSRule)parsedRule._parentRule=this,parsedRule._parentStyleSheet=null;return this._rules.splice(index,0,parsedRule),index}deleteRule(index){deleteRuleFromArray(this._rules,index)}},SHORTHANDS_DATA={"-webkit-animation":["animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-timeline"],"-webkit-border-radius":["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],"-webkit-box-shadow":["box-shadow-color","box-shadow-offset","box-shadow-blur","box-shadow-spread","box-shadow-position"],"-webkit-flex":["flex-grow","flex-shrink","flex-basis"],"-webkit-flex-flow":["flex-direction","flex-wrap"],"-webkit-line-clamp":["max-lines","block-ellipsis","continue"],"-webkit-mask":["mask-image","mask-position","mask-size","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode"],"-webkit-mask-box-image":["mask-border-source","mask-border-slice","mask-border-width","mask-border-outset","mask-border-repeat","mask-border-mode"],"-webkit-text-stroke":["-webkit-text-stroke-width","-webkit-text-stroke-color"],"-webkit-transition":["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"],animation:["animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-timeline"],"animation-delay":["animation-delay-start","animation-delay-end"],"animation-range":["animation-range-start","animation-range-end"],background:["background-image","background-position","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"],"background-position":["background-position-x","background-position-y"],"block-step":["block-step-size","block-step-insert","block-step-align","block-step-round"],border:["border-width","border-style","border-color"],"border-block":["border-block-start","border-block-end"],"border-block-clip":["border-block-start-clip","border-block-end-clip"],"border-block-color":["border-block-start-color","border-block-end-color"],"border-block-end":["border-block-end-width","border-block-end-style","border-block-end-color"],"border-block-end-radius":["border-end-start-radius","border-end-end-radius"],"border-block-start":["border-block-start-width","border-block-start-style","border-block-start-color"],"border-block-start-radius":["border-start-start-radius","border-start-end-radius"],"border-block-style":["border-block-start-style","border-block-end-style"],"border-block-width":["border-block-start-width","border-block-end-width"],"border-bottom":["border-bottom-width","border-bottom-style","border-bottom-color"],"border-bottom-radius":["border-bottom-left-radius","border-bottom-right-radius"],"border-clip":["border-top-clip","border-right-clip","border-bottom-clip","border-left-clip"],"border-color":["border-top-color","border-right-color","border-bottom-color","border-left-color"],"border-image":["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"border-inline":["border-inline-start","border-inline-end"],"border-inline-clip":["border-inline-start-clip","border-inline-end-clip"],"border-inline-color":["border-inline-start-color","border-inline-end-color"],"border-inline-end":["border-inline-end-width","border-inline-end-style","border-inline-end-color"],"border-inline-end-radius":["border-start-end-radius","border-end-end-radius"],"border-inline-start":["border-inline-start-width","border-inline-start-style","border-inline-start-color"],"border-inline-start-radius":["border-start-start-radius","border-end-start-radius"],"border-inline-style":["border-inline-start-style","border-inline-end-style"],"border-inline-width":["border-inline-start-width","border-inline-end-width"],"border-left":["border-left-width","border-left-style","border-left-color"],"border-left-radius":["border-top-left-radius","border-bottom-left-radius"],"border-radius":["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],"border-right":["border-right-width","border-right-style","border-right-color"],"border-right-radius":["border-top-right-radius","border-bottom-right-radius"],"border-style":["border-top-style","border-right-style","border-bottom-style","border-left-style"],"border-top":["border-top-width","border-top-style","border-top-color"],"border-top-radius":["border-top-left-radius","border-top-right-radius"],"border-width":["border-top-width","border-right-width","border-bottom-width","border-left-width"],"box-shadow":["box-shadow-color","box-shadow-offset","box-shadow-blur","box-shadow-spread","box-shadow-position"],caret:["caret-color","caret-animation","caret-shape"],"color-adjust":["print-color-adjust"],"column-rule":["column-rule-width","column-rule-style","column-rule-color"],"column-rule-inset":["column-rule-inset-cap-start","column-rule-inset-cap-end","column-rule-inset-junction-start","column-rule-inset-junction-end"],"column-rule-inset-cap":["column-rule-inset-cap-start","column-rule-inset-cap-end"],"column-rule-inset-end":["column-rule-inset-cap-end","column-rule-inset-junction-end"],"column-rule-inset-junction":["column-rule-inset-junction-start","column-rule-inset-junction-end"],"column-rule-inset-start":["column-rule-inset-cap-start","column-rule-inset-junction-start"],columns:["column-width","column-count","column-height"],"contain-intrinsic-size":["contain-intrinsic-width","contain-intrinsic-height"],container:["container-name","container-type"],corner:["corner-shape","border-radius"],"corner-block-end":["border-block-end-radius","corner-block-end-shape"],"corner-block-end-shape":["corner-end-start-shape","corner-end-end-shape"],"corner-block-start":["border-block-start-radius","corner-block-start-shape"],"corner-block-start-shape":["corner-start-start-shape","corner-start-end-shape"],"corner-bottom":["border-bottom-radius","corner-bottom-shape"],"corner-bottom-left":["border-bottom-left-radius","corner-bottom-left-shape"],"corner-bottom-right":["border-bottom-right-radius","corner-bottom-right-shape"],"corner-bottom-shape":["corner-bottom-left-shape","corner-bottom-right-shape"],"corner-end-end":["border-end-end-radius","corner-end-end-shape"],"corner-end-start":["border-end-start-radius","corner-end-start-shape"],"corner-inline-end":["border-inline-end-radius","corner-inline-end-shape"],"corner-inline-end-shape":["corner-start-end-shape","corner-end-end-shape"],"corner-inline-start":["border-inline-start-radius","corner-inline-start-shape"],"corner-inline-start-shape":["corner-start-start-shape","corner-end-start-shape"],"corner-left":["border-left-radius","corner-left-shape"],"corner-left-shape":["corner-top-left-shape","corner-bottom-left-shape"],"corner-right":["border-right-radius","corner-right-shape"],"corner-right-shape":["corner-top-right-shape","corner-bottom-right-shape"],"corner-shape":["corner-top-left-shape","corner-top-right-shape","corner-bottom-right-shape","corner-bottom-left-shape"],"corner-start-end":["border-start-end-radius","corner-start-end-shape"],"corner-start-start":["border-start-start-radius","corner-start-start-shape"],"corner-top":["border-top-radius","corner-top-shape"],"corner-top-left":["border-top-left-radius","corner-top-left-shape"],"corner-top-right":["border-top-right-radius","corner-top-right-shape"],"corner-top-shape":["corner-top-left-shape","corner-top-right-shape"],cue:["cue-before","cue-after"],flex:["flex-grow","flex-shrink","flex-basis"],"flex-flow":["flex-direction","flex-wrap"],font:["font-style","font-variant","font-weight","font-stretch","font-size","line-height","font-family"],"font-synthesis":["font-synthesis-weight","font-synthesis-style","font-synthesis-small-caps"],"font-variant":["font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji"],gap:["row-gap","column-gap"],grid:["grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-rows","grid-auto-columns","grid-auto-flow"],"grid-area":["grid-row-start","grid-column-start","grid-row-end","grid-column-end"],"grid-column":["grid-column-start","grid-column-end"],"grid-gap":["row-gap","column-gap"],"grid-row":["grid-row-start","grid-row-end"],"grid-template":["grid-template-rows","grid-template-columns","grid-template-areas"],inset:["top","right","bottom","left"],"inset-block":["inset-block-start","inset-block-end"],"inset-inline":["inset-inline-start","inset-inline-end"],"interest-delay":["interest-delay-start","interest-delay-end"],"line-clamp":["max-lines","block-ellipsis","continue"],"list-style":["list-style-type","list-style-position","list-style-image"],margin:["margin-top","margin-right","margin-bottom","margin-left"],"margin-block":["margin-block-start","margin-block-end"],"margin-inline":["margin-inline-start","margin-inline-end"],marker:["marker-start","marker-mid","marker-end"],mask:["mask-image","mask-position","mask-size","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode"],"mask-border":["mask-border-source","mask-border-slice","mask-border-width","mask-border-outset","mask-border-repeat","mask-border-mode"],"max-size":["max-width","max-height"],"min-size":["min-width","min-height"],offset:["offset-path","offset-distance","offset-rotate","offset-anchor","offset-position"],outline:["outline-width","outline-style","outline-color"],overflow:["overflow-x","overflow-y"],"overflow-clip-margin":["overflow-clip-margin-top","overflow-clip-margin-right","overflow-clip-margin-bottom","overflow-clip-margin-left"],"overflow-clip-margin-block":["overflow-clip-margin-block-start","overflow-clip-margin-block-end"],"overflow-clip-margin-inline":["overflow-clip-margin-inline-start","overflow-clip-margin-inline-end"],"overscroll-behavior":["overscroll-behavior-x","overscroll-behavior-y"],padding:["padding-top","padding-right","padding-bottom","padding-left"],"padding-block":["padding-block-start","padding-block-end"],"padding-inline":["padding-inline-start","padding-inline-end"],pause:["pause-before","pause-after"],"place-content":["align-content","justify-content"],"place-items":["align-items","justify-items"],"place-self":["align-self","justify-self"],"pointer-timeline":["pointer-timeline-name","pointer-timeline-axis"],"position-try":["position-try-order","position-try-fallbacks"],rest:["rest-before","rest-after"],"row-rule":["row-rule-width","row-rule-style","row-rule-color"],"row-rule-inset":["row-rule-inset-cap-start","row-rule-inset-cap-end","row-rule-inset-junction-start","row-rule-inset-junction-end"],"row-rule-inset-cap":["row-rule-inset-cap-start","row-rule-inset-cap-end"],"row-rule-inset-end":["row-rule-inset-cap-end","row-rule-inset-junction-end"],"row-rule-inset-junction":["row-rule-inset-junction-start","row-rule-inset-junction-end"],"row-rule-inset-start":["row-rule-inset-cap-start","row-rule-inset-junction-start"],rule:["column-rule","row-rule"],"rule-break":["column-rule-break","row-rule-break"],"rule-color":["column-rule-color","row-rule-color"],"rule-inset":["column-rule-inset","row-rule-inset"],"rule-inset-cap":["column-rule-inset-cap"],"rule-inset-end":["column-rule-inset-end","row-rule-inset-end"],"rule-inset-junction":["column-rule-inset-junction"],"rule-inset-start":["column-rule-inset-start","row-rule-inset-start"],"rule-style":["column-rule-style","row-rule-style"],"rule-visibility-items":["column-rule-visibility-items"],"rule-width":["column-rule-width","row-rule-width"],"scroll-margin":["scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left"],"scroll-margin-block":["scroll-margin-block-start","scroll-margin-block-end"],"scroll-margin-inline":["scroll-margin-inline-start","scroll-margin-inline-end"],"scroll-padding":["scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left"],"scroll-padding-block":["scroll-padding-block-start","scroll-padding-block-end"],"scroll-padding-inline":["scroll-padding-inline-start","scroll-padding-inline-end"],"scroll-timeline":["scroll-timeline-name","scroll-timeline-axis"],size:["width","height"],"text-align":["text-align-all","text-align-last"],"text-decoration":["text-decoration-line","text-decoration-thickness","text-decoration-style","text-decoration-color"],"text-decoration-skip":["text-decoration-skip-self","text-decoration-skip-box","text-decoration-skip-spaces","text-decoration-skip-ink"],"text-emphasis":["text-emphasis-style","text-emphasis-color"],"text-spacing":["text-spacing-trim","text-autospace"],"text-wrap":["text-wrap-mode","text-wrap-style"],"timeline-trigger":["timeline-trigger-name","timeline-trigger-source","timeline-trigger-range"],"timeline-trigger-activation-range":["timeline-trigger-activation-range-start","timeline-trigger-activation-range-end"],"timeline-trigger-active-range":["timeline-trigger-active-range-start","timeline-trigger-active-range-end"],"timeline-trigger-range":["timeline-trigger-activation-range","timeline-trigger-active-range"],transition:["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"],"vertical-align":["alignment-baseline","baseline-shift","baseline-source"],"view-timeline":["view-timeline-name","view-timeline-axis"],"white-space":["white-space-collapse","text-wrap-mode"]},LOGICAL_MAPPING={"background-position-block":"background-position-y","background-position-inline":"background-position-x","background-repeat-block":"background-repeat-y","background-repeat-inline":"background-repeat-x","block-size":"height","border-block-end-clip":"border-bottom-clip","border-block-end-color":"border-bottom-color","border-block-end-style":"border-bottom-style","border-block-end-width":"border-bottom-width","border-block-start-clip":"border-top-clip","border-block-start-color":"border-top-color","border-block-start-style":"border-top-style","border-block-start-width":"border-top-width","border-end-end-radius":"border-bottom-right-radius","border-end-start-radius":"border-bottom-left-radius","border-inline-end-clip":"border-right-clip","border-inline-end-color":"border-right-color","border-inline-end-style":"border-right-style","border-inline-end-width":"border-right-width","border-inline-start-clip":"border-left-clip","border-inline-start-color":"border-left-color","border-inline-start-style":"border-left-style","border-inline-start-width":"border-left-width","border-start-end-radius":"border-top-right-radius","border-start-start-radius":"border-top-left-radius","contain-intrinsic-block-size":"contain-intrinsic-height","contain-intrinsic-inline-size":"contain-intrinsic-width","corner-end-end-shape":"corner-bottom-right-shape","corner-end-start-shape":"corner-bottom-left-shape","corner-start-end-shape":"corner-top-right-shape","corner-start-start-shape":"corner-top-left-shape","inline-size":"width","inset-block-end":"bottom","inset-block-start":"top","inset-inline-end":"right","inset-inline-start":"left","margin-block-end":"margin-bottom","margin-block-start":"margin-top","margin-inline-end":"margin-right","margin-inline-start":"margin-left","max-block-size":"max-height","max-inline-size":"max-width","min-block-size":"min-height","min-inline-size":"min-width","overflow-block":"overflow-y","overflow-clip-margin-block-end":"overflow-clip-margin-bottom","overflow-clip-margin-block-start":"overflow-clip-margin-top","overflow-clip-margin-inline-end":"overflow-clip-margin-right","overflow-clip-margin-inline-start":"overflow-clip-margin-left","overflow-inline":"overflow-x","overscroll-behavior-block":"overscroll-behavior-y","overscroll-behavior-inline":"overscroll-behavior-x","padding-block-end":"padding-bottom","padding-block-start":"padding-top","padding-inline-end":"padding-right","padding-inline-start":"padding-left","scroll-margin-block-end":"scroll-margin-bottom","scroll-margin-block-start":"scroll-margin-top","scroll-margin-inline-end":"scroll-margin-right","scroll-margin-inline-start":"scroll-margin-left","scroll-padding-block-end":"scroll-padding-bottom","scroll-padding-block-start":"scroll-padding-top","scroll-padding-inline-end":"scroll-padding-right","scroll-padding-inline-start":"scroll-padding-left"},PHYSICAL_TO_LOGICAL={};for(let[logical,physical]of Object.entries(LOGICAL_MAPPING)){if(!PHYSICAL_TO_LOGICAL[physical])PHYSICAL_TO_LOGICAL[physical]=[];PHYSICAL_TO_LOGICAL[physical].push(logical)}var LOGICAL_PROPERTY_INFO={"background-position-block":{group:"background-position",logic:"logical"},"background-position-inline":{group:"background-position",logic:"logical"},"background-position-x":{group:"background-position",logic:"physical"},"background-position-y":{group:"background-position",logic:"physical"},"background-repeat-block":{group:"background-repeat",logic:"logical"},"background-repeat-inline":{group:"background-repeat",logic:"logical"},"background-repeat-x":{group:"background-repeat",logic:"physical"},"background-repeat-y":{group:"background-repeat",logic:"physical"},"block-size":{group:"size",logic:"logical"},"border-block-end-clip":{group:"border-clip",logic:"logical"},"border-block-end-color":{group:"border-color",logic:"logical"},"border-block-end-style":{group:"border-style",logic:"logical"},"border-block-end-width":{group:"border-width",logic:"logical"},"border-block-start-clip":{group:"border-clip",logic:"logical"},"border-block-start-color":{group:"border-color",logic:"logical"},"border-block-start-style":{group:"border-style",logic:"logical"},"border-block-start-width":{group:"border-width",logic:"logical"},"border-bottom-clip":{group:"border-clip",logic:"physical"},"border-bottom-color":{group:"border-color",logic:"physical"},"border-bottom-left-radius":{group:"border-radius",logic:"physical"},"border-bottom-right-radius":{group:"border-radius",logic:"physical"},"border-bottom-style":{group:"border-style",logic:"physical"},"border-bottom-width":{group:"border-width",logic:"physical"},"border-end-end-radius":{group:"border-radius",logic:"logical"},"border-end-start-radius":{group:"border-radius",logic:"logical"},"border-inline-end-clip":{group:"border-clip",logic:"logical"},"border-inline-end-color":{group:"border-color",logic:"logical"},"border-inline-end-style":{group:"border-style",logic:"logical"},"border-inline-end-width":{group:"border-width",logic:"logical"},"border-inline-start-clip":{group:"border-clip",logic:"logical"},"border-inline-start-color":{group:"border-color",logic:"logical"},"border-inline-start-style":{group:"border-style",logic:"logical"},"border-inline-start-width":{group:"border-width",logic:"logical"},"border-left-clip":{group:"border-clip",logic:"physical"},"border-left-color":{group:"border-color",logic:"physical"},"border-left-style":{group:"border-style",logic:"physical"},"border-left-width":{group:"border-width",logic:"physical"},"border-right-clip":{group:"border-clip",logic:"physical"},"border-right-color":{group:"border-color",logic:"physical"},"border-right-style":{group:"border-style",logic:"physical"},"border-right-width":{group:"border-width",logic:"physical"},"border-start-end-radius":{group:"border-radius",logic:"logical"},"border-start-start-radius":{group:"border-radius",logic:"logical"},"border-top-clip":{group:"border-clip",logic:"physical"},"border-top-color":{group:"border-color",logic:"physical"},"border-top-left-radius":{group:"border-radius",logic:"physical"},"border-top-right-radius":{group:"border-radius",logic:"physical"},"border-top-style":{group:"border-style",logic:"physical"},"border-top-width":{group:"border-width",logic:"physical"},bottom:{group:"inset",logic:"physical"},"contain-intrinsic-block-size":{group:"contain-intrinsic-size",logic:"logical"},"contain-intrinsic-height":{group:"contain-intrinsic-size",logic:"physical"},"contain-intrinsic-inline-size":{group:"contain-intrinsic-size",logic:"logical"},"contain-intrinsic-width":{group:"contain-intrinsic-size",logic:"physical"},"corner-bottom-left-shape":{group:"corner-shape",logic:"physical"},"corner-bottom-right-shape":{group:"corner-shape",logic:"physical"},"corner-end-end-shape":{group:"corner-shape",logic:"logical"},"corner-end-start-shape":{group:"corner-shape",logic:"logical"},"corner-start-end-shape":{group:"corner-shape",logic:"logical"},"corner-start-start-shape":{group:"corner-shape",logic:"logical"},"corner-top-left-shape":{group:"corner-shape",logic:"physical"},"corner-top-right-shape":{group:"corner-shape",logic:"physical"},height:{group:"size",logic:"physical"},"inline-size":{group:"size",logic:"logical"},"inset-block-end":{group:"inset",logic:"logical"},"inset-block-start":{group:"inset",logic:"logical"},"inset-inline-end":{group:"inset",logic:"logical"},"inset-inline-start":{group:"inset",logic:"logical"},left:{group:"inset",logic:"physical"},"margin-block-end":{group:"margin",logic:"logical"},"margin-block-start":{group:"margin",logic:"logical"},"margin-bottom":{group:"margin",logic:"physical"},"margin-inline-end":{group:"margin",logic:"logical"},"margin-inline-start":{group:"margin",logic:"logical"},"margin-left":{group:"margin",logic:"physical"},"margin-right":{group:"margin",logic:"physical"},"margin-top":{group:"margin",logic:"physical"},"max-block-size":{group:"max-size",logic:"logical"},"max-height":{group:"max-size",logic:"physical"},"max-inline-size":{group:"max-size",logic:"logical"},"max-width":{group:"max-size",logic:"physical"},"min-block-size":{group:"min-size",logic:"logical"},"min-height":{group:"min-size",logic:"physical"},"min-inline-size":{group:"min-size",logic:"logical"},"min-width":{group:"min-size",logic:"physical"},"overflow-block":{group:"overflow",logic:"logical"},"overflow-clip-margin-block-end":{group:"overflow-clip-margin",logic:"logical"},"overflow-clip-margin-block-start":{group:"overflow-clip-margin",logic:"logical"},"overflow-clip-margin-bottom":{group:"overflow-clip-margin",logic:"physical"},"overflow-clip-margin-inline-end":{group:"overflow-clip-margin",logic:"logical"},"overflow-clip-margin-inline-start":{group:"overflow-clip-margin",logic:"logical"},"overflow-clip-margin-left":{group:"overflow-clip-margin",logic:"physical"},"overflow-clip-margin-right":{group:"overflow-clip-margin",logic:"physical"},"overflow-clip-margin-top":{group:"overflow-clip-margin",logic:"physical"},"overflow-inline":{group:"overflow",logic:"logical"},"overflow-x":{group:"overflow",logic:"physical"},"overflow-y":{group:"overflow",logic:"physical"},"overscroll-behavior-block":{group:"overscroll-behavior",logic:"logical"},"overscroll-behavior-inline":{group:"overscroll-behavior",logic:"logical"},"overscroll-behavior-x":{group:"overscroll-behavior",logic:"physical"},"overscroll-behavior-y":{group:"overscroll-behavior",logic:"physical"},"padding-block-end":{group:"padding",logic:"logical"},"padding-block-start":{group:"padding",logic:"logical"},"padding-bottom":{group:"padding",logic:"physical"},"padding-inline-end":{group:"padding",logic:"logical"},"padding-inline-start":{group:"padding",logic:"logical"},"padding-left":{group:"padding",logic:"physical"},"padding-right":{group:"padding",logic:"physical"},"padding-top":{group:"padding",logic:"physical"},right:{group:"inset",logic:"physical"},"scroll-margin-block-end":{group:"scroll-margin",logic:"logical"},"scroll-margin-block-start":{group:"scroll-margin",logic:"logical"},"scroll-margin-bottom":{group:"scroll-margin",logic:"physical"},"scroll-margin-inline-end":{group:"scroll-margin",logic:"logical"},"scroll-margin-inline-start":{group:"scroll-margin",logic:"logical"},"scroll-margin-left":{group:"scroll-margin",logic:"physical"},"scroll-margin-right":{group:"scroll-margin",logic:"physical"},"scroll-margin-top":{group:"scroll-margin",logic:"physical"},"scroll-padding-block-end":{group:"scroll-padding",logic:"logical"},"scroll-padding-block-start":{group:"scroll-padding",logic:"logical"},"scroll-padding-bottom":{group:"scroll-padding",logic:"physical"},"scroll-padding-inline-end":{group:"scroll-padding",logic:"logical"},"scroll-padding-inline-start":{group:"scroll-padding",logic:"logical"},"scroll-padding-left":{group:"scroll-padding",logic:"physical"},"scroll-padding-right":{group:"scroll-padding",logic:"physical"},"scroll-padding-top":{group:"scroll-padding",logic:"physical"},top:{group:"inset",logic:"physical"},width:{group:"size",logic:"physical"}};function resolveLogicalProperty(name,writingMode="horizontal-tb",direction="ltr"){if(!(name in LOGICAL_MAPPING))return name;let blockStart="top",blockEnd="bottom",inlineStart="left",inlineEnd="right",blockAxis="y",inlineAxis="x";if(writingMode==="vertical-rl"||writingMode==="sideways-rl")blockStart="right",blockEnd="left",inlineStart="top",inlineEnd="bottom",blockAxis="x",inlineAxis="y";else if(writingMode==="vertical-lr")blockStart="left",blockEnd="right",inlineStart="top",inlineEnd="bottom",blockAxis="x",inlineAxis="y";else if(writingMode==="sideways-lr")blockStart="left",blockEnd="right",inlineStart="bottom",inlineEnd="top",blockAxis="x",inlineAxis="y";if(direction==="rtl"){let tmp=inlineStart;inlineStart=inlineEnd,inlineEnd=tmp}if(name.startsWith("inset-block-start"))return blockStart;if(name.startsWith("inset-block-end"))return blockEnd;if(name.startsWith("inset-inline-start"))return inlineStart;if(name.startsWith("inset-inline-end"))return inlineEnd;let radius=(s1,s2)=>`-${s1==="top"||s1==="bottom"?s1:s2}-${s1==="left"||s1==="right"?s1:s2}-radius`,shape=(s1,s2)=>`-${s1==="top"||s1==="bottom"?s1:s2}-${s1==="left"||s1==="right"?s1:s2}-shape`,replacements=[{logical:"-block-start",physical:`-${blockStart}`},{logical:"-block-end",physical:`-${blockEnd}`},{logical:"-inline-start",physical:`-${inlineStart}`},{logical:"-inline-end",physical:`-${inlineEnd}`},{logical:"-start-start-radius",physical:radius(blockStart,inlineStart)},{logical:"-start-end-radius",physical:radius(blockStart,inlineEnd)},{logical:"-end-start-radius",physical:radius(blockEnd,inlineStart)},{logical:"-end-end-radius",physical:radius(blockEnd,inlineEnd)},{logical:"-start-start-shape",physical:shape(blockStart,inlineStart)},{logical:"-start-end-shape",physical:shape(blockStart,inlineEnd)},{logical:"-end-start-shape",physical:shape(blockEnd,inlineStart)},{logical:"-end-end-shape",physical:shape(blockEnd,inlineEnd)},{logical:"-block",physical:`-${blockAxis}`},{logical:"-inline",physical:`-${inlineAxis}`}],resolved=name;for(let{logical,physical}of replacements)if(resolved.includes(logical)){resolved=resolved.replace(logical,physical);break}let isVertical=writingMode.startsWith("vertical")||writingMode.startsWith("sideways");if(resolved==="block-size")return isVertical?"width":"height";if(resolved==="inline-size")return isVertical?"height":"width";if(resolved==="min-block-size")return isVertical?"min-width":"min-height";if(resolved==="min-inline-size")return isVertical?"min-height":"min-width";if(resolved==="max-block-size")return isVertical?"max-width":"max-height";if(resolved==="max-inline-size")return isVertical?"max-height":"max-width";if(resolved==="contain-intrinsic-block-size")return isVertical?"contain-intrinsic-width":"contain-intrinsic-height";if(resolved==="contain-intrinsic-inline-size")return isVertical?"contain-intrinsic-height":"contain-intrinsic-width";return resolved}var NAMED_COLORS=new Set("accentcolor,accentcolortext,activeborder,activecaption,activetext,aliceblue,antiquewhite,appworkspace,aqua,aquamarine,azure,background,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,buttonborder,buttonface,buttonhighlight,buttonshadow,buttontext,cadetblue,canvas,canvastext,captiontext,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,currentcolor,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,field,fieldtext,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,graytext,green,greenyellow,grey,highlight,highlighttext,honeydew,hotpink,inactiveborder,inactivecaption,inactivecaptiontext,indianred,indigo,infobackground,infotext,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,linktext,magenta,mark,marktext,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,menu,menutext,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,scrollbar,seagreen,seashell,selecteditem,selecteditemtext,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,threeddarkshadow,threedface,threedhighlight,threedlightshadow,threedshadow,tomato,transparent,turquoise,violet,visitedtext,wheat,white,whitesmoke,window,windowframe,windowtext,yellow,yellowgreen".split(","));var LENGTH_UNITS=new Set("cap,ch,cm,cqb,cqh,cqi,cqmax,cqmin,cqw,dvb,dvh,dvi,dvmax,dvmin,dvw,em,ex,ic,in,lh,lvb,lvh,lvi,lvmax,lvmin,lvw,mm,pc,pt,px,q,rcap,rch,rem,rex,ric,rlh,svb,svh,svi,svmax,svmin,svw,vb,vh,vi,vmax,vmin,vw,%".split(","));var CSS_WIDE_KEYWORDS$2=new Set("initial,inherit,unset,revert,revert-layer".split(",")),REPEAT_KEYWORDS=new Set("repeat,no-repeat,space,round,repeat-x,repeat-y".split(",")),ATTACHMENT_KEYWORDS=new Set("scroll,fixed,local".split(",")),BOX_KEYWORDS=new Set("border-box,padding-box,content-box,text,border-area".split(",")),CLIP_ONLY_BOX_KEYWORDS=new Set("text,border-area".split(",")),COLOR_FUNCTIONS=new Set("rgb,rgba,hsl,hsla,hwb,lab,lch,oklab,oklch,color".split(",")),IMAGE_FUNCTIONS=new Set("url,src,image,image-set,linear-gradient,radial-gradient,conic-gradient,repeating-linear-gradient,repeating-radial-gradient,repeating-conic-gradient".split(",")),MATH_FUNCTIONS=new Set("calc,min,max,clamp".split(",")),POSITION_OR_SIZE_KEYWORDS=new Set("left,right,top,bottom,center,auto,cover,contain".split(",")),BORDER_WIDTH_KEYWORDS=new Set("thin,medium,thick".split(",")),BORDER_STYLE_KEYWORDS=new Set("none,hidden,dotted,dashed,solid,double,groove,ridge,inset,outset".split(","));function filterSignificantTokens(values){return values.filter((v)=>v.type!=="whitespace"&&v.type!=="comment"&&v.type!=="EOF")}function splitTokensByComma(tokens){let res=[[]];for(let t of tokens)if(t.type==="comma")res.push([]);else res[res.length-1].push(t);return res}function expandUniformLonghands(longhands,val){let res={};for(let lh of longhands)res[lh]=val;return res}function tryExpandCssWide(filtered,longhands,extraKeywords){if(filtered.length===1&&filtered[0].type==="ident"){let v=filtered[0].value.toLowerCase();if(CSS_WIDE_KEYWORDS$2.has(v)||extraKeywords?.has(v))return expandUniformLonghands(longhands,[filtered[0]])}return null}function checkUniformCssWide(serializedVals,checkVar=!1){if(serializedVals.some((v)=>CSS_WIDE_KEYWORDS$2.has(v.toLowerCase())||checkVar&&v.toLowerCase().startsWith("var(")))return serializedVals.every((v)=>v.toLowerCase()===serializedVals[0].toLowerCase())?serializedVals[0]:null}function expandFourSides(data){let s0=[data[0]],s1=data.length>1?[data[1]]:s0;return[s0,s1,data.length>2?[data[2]]:s0,data.length>3?[data[3]]:s1]}function formatFourSides(a,b,c,d){if(a===b&&a===c&&a===d)return a;if(a===c&&b===d)return`${a} ${b}`;if(b===d)return`${a} ${b} ${c}`;return`${a} ${b} ${c} ${d}`}function getFunctionName(token){if(token.type==="function"){if("name"in token&&typeof token.name==="string")return token.name.toLowerCase();if("value"in token&&typeof token.value==="string")return token.value.toLowerCase()}return""}function isRepeatKeyword(token){return token.type==="ident"&&REPEAT_KEYWORDS.has(token.value.toLowerCase())}function isAttachmentKeyword(token){return token.type==="ident"&&ATTACHMENT_KEYWORDS.has(token.value.toLowerCase())}function isBoxKeyword(token){return token.type==="ident"&&BOX_KEYWORDS.has(token.value.toLowerCase())}function isClipOnlyBoxKeyword(keyword){return CLIP_ONLY_BOX_KEYWORDS.has(keyword.toLowerCase())}function isColorToken(token){if(token.type==="hash")return!0;if(token.type==="ident")return NAMED_COLORS.has(token.value.toLowerCase());if(token.type==="function")return COLOR_FUNCTIONS.has(getFunctionName(token));return!1}function isImageToken(token){if(token.type==="ident"&&token.value.toLowerCase()==="none")return!0;if(token.type==="url")return!0;if(token.type==="function")return IMAGE_FUNCTIONS.has(getFunctionName(token));return!1}function isPositionOrSizeValue(token){if(token.type==="ident")return POSITION_OR_SIZE_KEYWORDS.has(token.value.toLowerCase());if(token.type==="percentage"||token.type==="dimension")return!0;if(token.type==="number"&&token.value===0)return!0;if(token.type==="function")return MATH_FUNCTIONS.has(getFunctionName(token));return!1}function extractSizeTokens(tokens,slashIdx){if(slashIdx+1>=tokens.length)return null;let first=tokens[slashIdx+1];if(first.type==="ident"&&["cover","contain"].includes(first.value.toLowerCase()))return{size:[first],consumed:1};let isSizeVal=(t)=>t.type==="ident"&&t.value.toLowerCase()==="auto"||t.type==="percentage"||t.type==="dimension"||t.type==="number"&&t.value===0||t.type==="function"&&MATH_FUNCTIONS.has(getFunctionName(t));if(!isSizeVal(first))return null;if(slashIdx+2<tokens.length&&isSizeVal(tokens[slashIdx+2]))return{size:[first,tokens[slashIdx+2]],consumed:2};return{size:[first],consumed:1}}function mapBoxKeywords(keywords){if(keywords.length===0)return{origin:"padding-box",clip:"border-box"};if(keywords.length===1){let a=keywords[0].toLowerCase();return isClipOnlyBoxKeyword(a)?{origin:"border-box",clip:a}:{origin:a,clip:a}}if(keywords.length===2){let a=keywords[0].toLowerCase(),b=keywords[1].toLowerCase(),aClip=isClipOnlyBoxKeyword(a),bClip=isClipOnlyBoxKeyword(b);if(aClip&&bClip)return{origin:"border-box",clip:`${a} ${b}`};if(aClip)return{origin:b,clip:a};if(bClip)return{origin:a,clip:b};return{origin:a,clip:b}}if(keywords.length===3){let clips=keywords.filter(isClipOnlyBoxKeyword),origins=keywords.filter((k)=>!isClipOnlyBoxKeyword(k));return clips.length===2&&origins.length===1?{origin:origins[0],clip:clips.join(" ")}:null}return null}function parseRepeatTokens(tokens){if(tokens.length===1){let val=tokens[0].value?.toString().toLowerCase();if(val==="repeat-x")return[{type:"ident",value:"repeat"},{type:"ident",value:"no-repeat"}];if(val==="repeat-y")return[{type:"ident",value:"no-repeat"},{type:"ident",value:"repeat"}];return[tokens[0]]}return tokens.length===2?tokens:null}function normalizePositionTokens(tokens){if(tokens.length===1){let t0=tokens[0];if(t0.type==="ident"){let v=t0.value.toLowerCase();if(v==="left"||v==="right")return[t0,{type:"ident",value:"center"}];if(v==="top"||v==="bottom")return[{type:"ident",value:"center"},t0];if(v==="center")return[t0,t0]}else return[t0,{type:"percentage",value:50,sign:null}]}if(tokens.length===2&&tokens[0].type==="ident"&&tokens[1].type==="ident"){let[t0,t1]=tokens,v0=t0.value.toLowerCase(),v1=t1.value.toLowerCase(),isHoriz=(v)=>v==="left"||v==="right",isVert=(v)=>v==="top"||v==="bottom";if(isVert(v0)&&isHoriz(v1)||isVert(v0)&&v1==="center")return[t1,t0]}return tokens}function normalizeSizeTokens(tokens){if(tokens.length===1){let t0=tokens[0];if(t0.type==="ident"&&["cover","contain"].includes(t0.value.toLowerCase()))return[t0];return[t0,{type:"ident",value:"auto"}]}return tokens}function joinWithWhitespace(tokens){let res=[];for(let i=0;i<tokens.length;i++){if(i>0)res.push({type:"whitespace",value:" "});res.push(tokens[i])}return res}function expandBackground(values){let cssWide=tryExpandCssWide(filterSignificantTokens(values),SHORTHANDS_DATA.background);if(cssWide)return cssWide;let layers=splitTokensByComma(values),numLayers=layers.length;if(numLayers===0)return null;let imageLayers=[],positionLayers=[],sizeLayers=[],repeatLayers=[],attachmentLayers=[],originLayers=[],clipLayers=[],parsedColor=null;for(let i=0;i<numLayers;i++){let layerClean=filterSignificantTokens(layers[i]);if(layerClean.length===0)return null;let slashIdx=layerClean.findIndex((t)=>t.type==="delim"&&t.value==="/"),sizeTokens=null;if(slashIdx!==-1){let sizeResult=extractSizeTokens(layerClean,slashIdx);if(!sizeResult)return null;sizeTokens=sizeResult.size,layerClean.splice(slashIdx,1+sizeResult.consumed)}let repeatTokens=[],attachmentTokens=[],boxKeywords=[],colorTokens=null,imageTokens=null,positionTokens=[];for(let token of layerClean)if(isRepeatKeyword(token))repeatTokens.push(token);else if(isAttachmentKeyword(token))attachmentTokens.push(token);else if(isBoxKeyword(token))boxKeywords.push(token.value);else if(isColorToken(token)){if(i!==numLayers-1||colorTokens!==null)return null;colorTokens=[token]}else if(isImageToken(token)){if(imageTokens!==null)return null;imageTokens=[token]}else if(isPositionOrSizeValue(token))positionTokens.push(token);else return null;if(sizeTokens!==null&&positionTokens.length===0||positionTokens.length>4)return null;let boxMapped=mapBoxKeywords(boxKeywords);if(!boxMapped)return null;let repeatMapped=parseRepeatTokens(repeatTokens);if(imageLayers.push(imageTokens||[{type:"ident",value:"none"}]),positionLayers.push(positionTokens.length>0?joinWithWhitespace(normalizePositionTokens(positionTokens)):joinWithWhitespace([{type:"percentage",value:0,sign:null},{type:"percentage",value:0,sign:null}])),sizeLayers.push(sizeTokens!==null?joinWithWhitespace(normalizeSizeTokens(sizeTokens)):[{type:"ident",value:"auto"}]),repeatLayers.push(repeatMapped?joinWithWhitespace(repeatMapped):[{type:"ident",value:"repeat"}]),attachmentLayers.push(attachmentTokens.length>0?joinWithWhitespace(attachmentTokens):[{type:"ident",value:"scroll"}]),originLayers.push([{type:"ident",value:boxMapped.origin}]),clipLayers.push(joinWithWhitespace(boxMapped.clip.split(" ").map((c)=>({type:"ident",value:c})))),colorTokens!==null)parsedColor=colorTokens}let joinLayers=(layerList)=>{let res=[];for(let i=0;i<layerList.length;i++){if(i>0)res.push({type:"comma",value:","},{type:"whitespace",value:" "});res.push(...layerList[i])}return res};return{"background-image":joinLayers(imageLayers),"background-position":joinLayers(positionLayers),"background-size":joinLayers(sizeLayers),"background-repeat":joinLayers(repeatLayers),"background-attachment":joinLayers(attachmentLayers),"background-origin":joinLayers(originLayers),"background-clip":joinLayers(clipLayers),"background-color":parsedColor||[{type:"ident",value:"transparent"}]}}function contractBackground(longhands){let image=longhands["background-image"],position=longhands["background-position"],size=longhands["background-size"],repeat=longhands["background-repeat"],attachment=longhands["background-attachment"],origin=longhands["background-origin"],clip=longhands["background-clip"],color=longhands["background-color"];if(!image||!position||!size||!repeat||!attachment||!origin||!clip||!color)return null;let imageLayers=splitTokensByComma(image),positionLayers=splitTokensByComma(position),sizeLayers=splitTokensByComma(size),repeatLayers=splitTokensByComma(repeat),attachmentLayers=splitTokensByComma(attachment),originLayers=splitTokensByComma(origin),clipLayers=splitTokensByComma(clip),numLayers=imageLayers.length;if(positionLayers.length!==numLayers||sizeLayers.length!==numLayers||repeatLayers.length!==numLayers||attachmentLayers.length!==numLayers||originLayers.length!==numLayers||clipLayers.length!==numLayers)return null;let layerStrings=[];for(let i=0;i<numLayers;i++){let imgVal=serialize(imageLayers[i]).trim(),posVal=serialize(positionLayers[i]).trim(),sizeVal=serialize(sizeLayers[i]).trim(),repVal=serialize(repeatLayers[i]).trim(),attVal=serialize(attachmentLayers[i]).trim(),origVal=serialize(originLayers[i]).trim(),clipVal=serialize(clipLayers[i]).trim(),parts=[];if(imgVal!=="none"&&imgVal!=="")parts.push(imgVal);let isInitialPosition=posVal!==""&&["0% 0%","left top","0% center","center left","left center"].includes(posVal.toLowerCase()),isInitialSize=sizeVal!==""&&["auto","auto auto"].includes(sizeVal.toLowerCase());if(posVal!==""&&sizeVal!==""){if(!isInitialSize)parts.push(`${posVal} / ${sizeVal}`);else if(!isInitialPosition)parts.push(posVal)}let isInitialRepeat=repVal!==""&&["repeat","repeat repeat"].includes(repVal.toLowerCase());if(repVal!==""&&!isInitialRepeat){let tokens=repeatLayers[i].filter((t)=>t.type!=="whitespace"&&t.type!=="EOF");if(tokens.length===2){let v0=tokens[0].value?.toString().toLowerCase(),v1=tokens[1].value?.toString().toLowerCase();if(v0==="repeat"&&v1==="no-repeat")parts.push("repeat-x");else if(v0==="no-repeat"&&v1==="repeat")parts.push("repeat-y");else if(v0===v1&&v0)parts.push(v0);else parts.push(`${v0} ${v1}`)}else parts.push(repVal)}if(attVal!==""&&attVal.toLowerCase()!=="scroll")parts.push(attVal);if(origVal!==""&&clipVal!==""){let isClipOnly=["text","border-area"].includes(clipVal.toLowerCase())||clipVal.toLowerCase().includes("text")||clipVal.toLowerCase().includes("border-area"),defaultOrigin=isClipOnly?"border-box":"padding-box";if(origVal.toLowerCase()!=="padding-box"||clipVal.toLowerCase()!=="border-box")if(isClipOnly)parts.push(origVal.toLowerCase()===defaultOrigin?clipVal:`${origVal} ${clipVal}`);else parts.push(origVal.toLowerCase()===clipVal.toLowerCase()?origVal:`${origVal} ${clipVal}`)}if(i===numLayers-1){let colVal=serialize(color).trim();if(colVal!==""&&colVal.toLowerCase()!=="transparent")parts.push(colVal)}if(parts.length===0)parts.push("none");layerStrings.push(parts.join(" "))}return layerStrings.join(", ")}function isValidLengthOrPercentage(val,allowNegative=!0){if(val.type==="ident"){let kw=(val.value??"").toString().toLowerCase();return kw==="auto"||CSS_WIDE_KEYWORDS$2.has(kw)}if(val.type==="dimension"){if(!allowNegative&&typeof val.value==="number"&&val.value<0)return!1;return LENGTH_UNITS.has((val.unit??"").toLowerCase())}if(val.type==="percentage")return allowNegative||typeof val.value!=="number"||val.value>=0;if(val.type==="number"&&val.value===0)return!0;if(val.type==="function"){let fnName=getFunctionName(val);return MATH_FUNCTIONS.has(fnName)||fnName==="env"}return!1}var expandBox=(physical,logical)=>(values)=>{let filtered=filterSignificantTokens(values);if(filtered.length===0)return null;let isLogical=filtered[0].type==="ident"&&filtered[0].value.toLowerCase()==="logical",data=isLogical?filtered.slice(1):filtered;if(data.length<1||data.length>4)return null;let isLengthBox=physical[0].startsWith("margin")||physical[0].startsWith("padding")||physical[0]==="top"||physical[0].startsWith("scroll-")||physical[0].startsWith("border-")&&physical[0].endsWith("-width"),allowNegative=!physical[0].startsWith("padding")&&!physical[0].startsWith("scroll-padding")&&!(physical[0].startsWith("border-")&&physical[0].endsWith("-width"));if(isLengthBox&&!data.every((v)=>isValidLengthOrPercentage(v,allowNegative)))return null;let target=isLogical?logical:physical,[s0,s1,s2,s3]=expandFourSides(data);return{[target[0]]:s0,[target[1]]:s1,[target[2]]:s2,[target[3]]:s3}},contractBox=(physical,logical)=>(values)=>{let t=values[physical[0]],r=values[physical[1]],b=values[physical[2]],l=values[physical[3]];if(t&&r&&b&&l){let serialized=[t,r,b,l].map((v)=>serialize(v).trim()),cssWide=checkUniformCssWide(serialized);if(cssWide!==void 0)return cssWide;return formatFourSides(serialized[0],serialized[1],serialized[2],serialized[3])}let lbs=values[logical[0]],lbe=values[logical[2]],lis=values[logical[1]],lie=values[logical[3]];if(lbs&&lbe&&lis&&lie){let[sbs,sis,sbe,sie]=[lbs,lis,lbe,lie].map((v)=>serialize(v).trim()),cssWide=checkUniformCssWide([sbs,sis,sbe,sie]);if(cssWide!==void 0)return cssWide;return`logical ${formatFourSides(sbs,sis,sbe,sie)}`}return null},expandTwoValue=(longhands)=>(values)=>{let filtered=filterSignificantTokens(values);if(filtered.length<1||filtered.length>2)return null;if(longhands[0].startsWith("padding")||longhands[0].endsWith("-width")){for(let v of filtered)if((v.type==="dimension"||v.type==="percentage"||v.type==="number")&&typeof v.value==="number"&&v.value<0)return null}return{[longhands[0]]:[filtered[0]],[longhands[1]]:filtered.length>1?[filtered[1]]:[filtered[0]]}},contractTwoValue=(longhands)=>(values)=>{let v1=values[longhands[0]],v2=values[longhands[1]];if(!v1||!v2)return null;let s1=serialize(v1).trim(),s2=serialize(v2).trim(),cssWide=checkUniformCssWide([s1,s2]);if(cssWide!==void 0)return cssWide;return s1===s2?s1:`${s1} ${s2}`};function formatBorderSideValue(widthVal,styleVal,colorVal){let w=widthVal.trim(),s=styleVal.trim(),c=colorVal.trim(),cssWide=checkUniformCssWide([w,s,c]);if(cssWide!==void 0)return cssWide;let isInitialWidth=w.toLowerCase()==="medium",isInitialStyle=s.toLowerCase()==="none",isInitialColor=c.toLowerCase()==="currentcolor";if(isInitialWidth&&isInitialStyle&&isInitialColor)return"none";let parts=[];if(!isInitialWidth)parts.push(w);if(!isInitialStyle)parts.push(s);if(!isInitialColor)parts.push(c);return parts.length===0?"none":parts.join(" ")}function parseBorderTriplet(filtered,allowAutoStyle=!1){let widthVal=[{type:"ident",value:"medium"}],styleVal=[{type:"ident",value:"none"}],colorVal=[{type:"ident",value:"currentcolor"}];for(let val of filtered)if(val.type==="ident"){let v=val.value.toLowerCase();if(BORDER_WIDTH_KEYWORDS.has(v))widthVal=[val];else if(BORDER_STYLE_KEYWORDS.has(v)||allowAutoStyle&&v==="auto")styleVal=[val];else colorVal=[val]}else if(val.type==="dimension"||val.type==="percentage"||val.type==="number")widthVal=[val];else colorVal=[val];return{widthVal,styleVal,colorVal}}var BORDER_IMAGE_LONGHANDS=["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],BORDER_ALL_LONGHANDS=["border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color",...BORDER_IMAGE_LONGHANDS];function createInitialBorderImageValues(source=[{type:"ident",value:"none"}]){return{"border-image-source":source,"border-image-slice":[{type:"percentage",value:100,sign:null}],"border-image-width":[{type:"number",value:1,sign:null,numberType:"integer"}],"border-image-outset":[{type:"number",value:0,sign:null,numberType:"integer"}],"border-image-repeat":[{type:"ident",value:"stretch"}]}}function isInitialBorderImage(values){let src=values["border-image-source"],slice=values["border-image-slice"],width=values["border-image-width"],outset=values["border-image-outset"],repeat=values["border-image-repeat"];if(!src||!slice||!width||!outset||!repeat)return!1;let sSrc=serialize(src).trim().toLowerCase(),sSlice=serialize(slice).trim().toLowerCase(),sWidth=serialize(width).trim().toLowerCase(),sOutset=serialize(outset).trim().toLowerCase(),sRepeat=serialize(repeat).trim().toLowerCase();return(sSrc==="none"||sSrc==="")&&(sSlice==="100%"||sSlice==="100% 100% 100% 100%"||sSlice==="")&&(sWidth==="1"||sWidth==="1 1 1 1"||sWidth==="")&&(sOutset==="0"||sOutset==="0px"||sOutset==="0s"||sOutset==="0 0 0 0"||sOutset==="")&&(sRepeat==="stretch"||sRepeat==="stretch stretch"||sRepeat==="")}var expandBorderSide=(prefix)=>(values)=>{let filtered=filterSignificantTokens(values);if(filtered.length===0||filtered.length>3)return null;let longhands=[`${prefix}-width`,`${prefix}-style`,`${prefix}-color`],cssWide=tryExpandCssWide(filtered,longhands);if(cssWide)return cssWide;let{widthVal,styleVal,colorVal}=parseBorderTriplet(filtered);return{[longhands[0]]:widthVal,[longhands[1]]:styleVal,[longhands[2]]:colorVal}},contractBorderSide=(prefix)=>(values)=>{let w=values[`${prefix}-width`],s=values[`${prefix}-style`],c=values[`${prefix}-color`];if(!w||!s||!c)return null;return formatBorderSideValue(serialize(w),serialize(s),serialize(c))};function expandBorder(values){let filtered=filterSignificantTokens(values);if(filtered.length===0||filtered.length>3)return null;let cssWide=tryExpandCssWide(filtered,BORDER_ALL_LONGHANDS);if(cssWide)return cssWide;let{widthVal,styleVal,colorVal}=parseBorderTriplet(filtered);return{"border-top-width":widthVal,"border-right-width":widthVal,"border-bottom-width":widthVal,"border-left-width":widthVal,"border-top-style":styleVal,"border-right-style":styleVal,"border-bottom-style":styleVal,"border-left-style":styleVal,"border-top-color":colorVal,"border-right-color":colorVal,"border-bottom-color":colorVal,"border-left-color":colorVal,...createInitialBorderImageValues()}}function contractBorder(values){for(let lh of BORDER_ALL_LONGHANDS)if(!values[lh])return null;let allSerialized=BORDER_ALL_LONGHANDS.map((lh)=>serialize(values[lh]).trim()),cssWide=checkUniformCssWide(allSerialized);if(cssWide!==void 0)return cssWide;if(!isInitialBorderImage(values))return null;let[w0,w1,w2,w3,s0,s1,s2,s3,c0,c1,c2,c3]=allSerialized;if(w0!==w1||w0!==w2||w0!==w3)return null;if(s0!==s1||s0!==s2||s0!==s3)return null;if(c0!==c1||c0!==c2||c0!==c3)return null;return formatBorderSideValue(w0,s0,c0)}function expandBorderImage(values){let filtered=filterSignificantTokens(values);if(filtered.length===0)return null;let cssWide=tryExpandCssWide(filtered,BORDER_IMAGE_LONGHANDS);if(cssWide)return cssWide;if(filtered.length===1&&filtered[0].type==="ident"&&filtered[0].value.toLowerCase()==="none")return createInitialBorderImageValues();if(filtered.some((t)=>t.type==="function"&&getFunctionName(t)==="var"))return expandUniformLonghands(BORDER_IMAGE_LONGHANDS,values);let source=[{type:"ident",value:"none"}];for(let token of filtered)if(token.type==="url"||token.type==="function"&&["linear-gradient","radial-gradient","conic-gradient","image","image-set"].includes(getFunctionName(token)))source=[token];return createInitialBorderImageValues(source)}function contractBorderImage(values){for(let lh of BORDER_IMAGE_LONGHANDS)if(!values[lh])return null;let allVals=BORDER_IMAGE_LONGHANDS.map((lh)=>serialize(values[lh]).trim()),cssWide=checkUniformCssWide(allVals,!0);if(cssWide!==void 0)return cssWide;if(isInitialBorderImage(values))return"none";let[sSrc,sSlice,sWidth,sOutset,sRepeat]=allVals;return(sSlice==="100%"||sSlice==="100% 100% 100% 100%")&&(sWidth==="1"||sWidth==="1 1 1 1")&&(sOutset==="0"||sOutset==="0px"||sOutset==="0s"||sOutset==="0 0 0 0")&&(sRepeat==="stretch"||sRepeat==="stretch stretch")?sSrc:null}function expandOutline(values){let filtered=filterSignificantTokens(values);if(filtered.length===0||filtered.length>3)return null;let cssWide=tryExpandCssWide(filtered,["outline-color","outline-style","outline-width"]);if(cssWide)return cssWide;let{widthVal,styleVal,colorVal}=parseBorderTriplet(filtered,!0);return{"outline-color":colorVal,"outline-style":styleVal,"outline-width":widthVal}}function contractOutline(values){let c=values["outline-color"],s=values["outline-style"],w=values["outline-width"];if(!c||!s||!w)return null;let sc=serialize(c).trim(),ss=serialize(s).trim(),sw=serialize(w).trim(),cssWide=checkUniformCssWide([sc,ss,sw]);if(cssWide!==void 0)return cssWide;let isInitialColor=sc.toLowerCase()==="currentcolor",isInitialStyle=ss.toLowerCase()==="none",isInitialWidth=sw.toLowerCase()==="medium";if(isInitialColor&&isInitialStyle&&isInitialWidth)return"none";let parts=[];if(!isInitialColor)parts.push(sc);if(!isInitialStyle)parts.push(ss);if(!isInitialWidth)parts.push(sw);return parts.length===0?"none":parts.join(" ")}var FONT_VARIANT_LONGHANDS=["font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji"];function expandFontVariant(values){let filtered=filterSignificantTokens(values);if(filtered.length===0)return null;let wide=tryExpandCssWide(filtered,FONT_VARIANT_LONGHANDS);if(wide)return wide;if(filtered.length===1&&filtered[0].type==="ident"){let v=filtered[0].value.toLowerCase();if(v==="normal")return expandUniformLonghands(FONT_VARIANT_LONGHANDS,[{type:"ident",value:"normal"}]);if(v==="none"){let res=expandUniformLonghands(FONT_VARIANT_LONGHANDS,[{type:"ident",value:"normal"}]);return res["font-variant-ligatures"]=[{type:"ident",value:"none"}],res}}let buckets={"font-variant-ligatures":[],"font-variant-caps":[],"font-variant-alternates":[],"font-variant-numeric":[],"font-variant-east-asian":[],"font-variant-position":[],"font-variant-emoji":[]};for(let token of filtered)if(token.type==="ident"){let val=token.value.toLowerCase();if(val==="normal")continue;if(val==="none"||FONT_VARIANT_LIGATURES_KEYWORDS.has(val))buckets["font-variant-ligatures"].push(token);else if(FONT_VARIANT_CAPS_KEYWORDS.has(val))buckets["font-variant-caps"].push(token);else if(val==="historical-forms")buckets["font-variant-alternates"].push(token);else if(FONT_VARIANT_NUMERIC_KEYWORDS.has(val))buckets["font-variant-numeric"].push(token);else if(FONT_VARIANT_EAST_ASIAN_KEYWORDS.has(val))buckets["font-variant-east-asian"].push(token);else if(FONT_VARIANT_POSITION_KEYWORDS.has(val))buckets["font-variant-position"].push(token);else if(FONT_VARIANT_EMOJI_KEYWORDS.has(val))buckets["font-variant-emoji"].push(token);else return null}else if(token.type==="function"&&FONT_VARIANT_ALTERNATES_FUNCTIONS.has(getFunctionName(token)))buckets["font-variant-alternates"].push(token);else return null;let norm=[{type:"ident",value:"normal"}],res={};for(let lh of FONT_VARIANT_LONGHANDS)res[lh]=buckets[lh].length>0?joinWithWhitespace(buckets[lh]):norm;return res}function contractFontVariant(values){for(let lh of FONT_VARIANT_LONGHANDS)if(!values[lh])return null;let allVals=FONT_VARIANT_LONGHANDS.map((lh)=>serialize(values[lh]).trim()),wide=checkUniformCssWide(allVals);if(wide!==void 0)return wide;if(allVals.every((v)=>v.toLowerCase()==="normal"))return"normal";if(allVals[0].toLowerCase()==="none")return allVals.slice(1).every((v)=>v.toLowerCase()==="normal")?"none":null;let nonNormal=allVals.filter((v)=>v.toLowerCase()!=="normal");return nonNormal.length===0?"normal":nonNormal.join(" ")}var FONT_LONGHANDS=["font-style","font-variant-caps","font-variant-ligatures","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji","font-weight","font-stretch","font-size","line-height","font-family"];function expandFont(values){let filtered=filterSignificantTokens(values);if(filtered.length===0)return null;if(filtered.length===1&&filtered[0].type==="ident"&&SYSTEM_FONT_KEYWORDS.has(filtered[0].value.toLowerCase()))return expandUniformLonghands(FONT_LONGHANDS,[filtered[0]]);let norm=[{type:"ident",value:"normal"}],styleVal=norm,capsVal=norm,weightVal=norm,stretchVal=norm,lineHeightVal=norm,i=0;while(i<filtered.length){let token=filtered[i];if(token.type==="ident"){let v=token.value.toLowerCase();if(v==="italic"||v==="oblique"){styleVal=[token],i++;continue}if(v==="small-caps"){capsVal=[token],i++;continue}if(v==="bold"||v==="bolder"||v==="lighter"){weightVal=[token],i++;continue}if(FONT_STRETCH_KEYWORDS.has(v)){stretchVal=[token],i++;continue}if(v==="normal"){i++;continue}}else if(token.type==="number"&&typeof token.value==="number"&&token.value>=1&&token.value<=1000){weightVal=[token],i++;continue}break}if(i>=filtered.length)return null;let sizeToken=filtered[i];if(!(sizeToken.type==="dimension"||sizeToken.type==="percentage"||sizeToken.type==="number"&&sizeToken.value===0||sizeToken.type==="ident"&&FONT_SIZE_KEYWORDS.has(sizeToken.value.toLowerCase())||sizeToken.type==="function"&&MATH_FUNCTIONS.has(getFunctionName(sizeToken))))return null;let sizeVal=[sizeToken];if(i++,i<filtered.length&&filtered[i].type==="delim"&&filtered[i].value==="/"){if(i++,i>=filtered.length)return null;let lhToken=filtered[i];if(!(lhToken.type==="number"||lhToken.type==="dimension"||lhToken.type==="percentage"||lhToken.type==="ident"&&lhToken.value.toLowerCase()==="normal"||lhToken.type==="function"&&MATH_FUNCTIONS.has(getFunctionName(lhToken))))return null;lineHeightVal=[lhToken],i++}if(i>=filtered.length)return null;let lastConsumed=lineHeightVal!==norm?lineHeightVal[0]:sizeToken,lastIdx=values.indexOf(lastConsumed),familyVal;if(lastIdx!==-1){familyVal=values.slice(lastIdx+1).filter((t)=>t.type!=="EOF");while(familyVal.length>0&&(familyVal[0].type==="whitespace"||familyVal[0].type==="comment"))familyVal.shift()}else familyVal=filtered.slice(i);let res=expandUniformLonghands(FONT_LONGHANDS,norm);return res["font-style"]=styleVal,res["font-variant-caps"]=capsVal,res["font-weight"]=weightVal,res["font-stretch"]=stretchVal,res["font-size"]=sizeVal,res["line-height"]=lineHeightVal,res["font-family"]=familyVal,res}var FONT_PRIMARY_LONGHANDS=["font-style","font-variant-caps","font-weight","font-stretch","font-size","line-height","font-family"],FONT_OTHER_VARIANTS=["font-variant-ligatures","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji"];function contractFont(values){for(let lh of FONT_PRIMARY_LONGHANDS)if(!values[lh])return null;for(let lh of FONT_OTHER_VARIANTS)if(values[lh]&&serialize(values[lh]).trim().toLowerCase()!=="normal")return null;let sStyle=serialize(values["font-style"]).trim(),sCaps=serialize(values["font-variant-caps"]).trim(),sWeight=serialize(values["font-weight"]).trim(),sStretch=serialize(values["font-stretch"]).trim(),sSize=serialize(values["font-size"]).trim(),sLineHeight=serialize(values["line-height"]).trim(),sFamily=serialize(values["font-family"],!1,"font-family").trim(),wide=checkUniformCssWide([sStyle,sCaps,sWeight,sStretch,sSize,sLineHeight,sFamily]);if(wide!==void 0)return wide;if(!sSize||!sFamily)return null;let parts=[];if(sStyle.toLowerCase()!=="normal")parts.push(sStyle);if(sCaps.toLowerCase()!=="normal")parts.push(sCaps);if(sWeight.toLowerCase()!=="normal"&&sWeight!=="400")parts.push(sWeight);if(sStretch.toLowerCase()!=="normal")parts.push(sStretch);return parts.push(sLineHeight.toLowerCase()!=="normal"?`${sSize} / ${sLineHeight}`:sSize),parts.push(sFamily),parts.join(" ")}var LIST_STYLE_LONGHANDS=["list-style-type","list-style-position","list-style-image"];function expandListStyle(values){let filtered=filterSignificantTokens(values);if(filtered.length===0||filtered.length>3)return null;let wide=tryExpandCssWide(filtered,LIST_STYLE_LONGHANDS);if(wide)return wide;let typeVal=[{type:"ident",value:"disc"}],posVal=[{type:"ident",value:"outside"}],imgVal=[{type:"ident",value:"none"}],hasType=!1,hasPos=!1,hasImg=!1;for(let token of filtered)if(token.type==="ident"){let v=token.value.toLowerCase();if((v==="inside"||v==="outside")&&!hasPos)posVal=[token],hasPos=!0;else if(v==="none"){if(!hasImg&&!hasType)imgVal=[token],typeVal=[token],hasImg=!0,hasType=!0;else if(!hasImg)imgVal=[token],hasImg=!0;else if(!hasType)typeVal=[token],hasType=!0}else if(!hasType)typeVal=[token],hasType=!0;else return null}else if((token.type==="url"||token.type==="function"&&IMAGE_FUNCTIONS.has(getFunctionName(token)))&&!hasImg)imgVal=[token],hasImg=!0;else return null;return{"list-style-type":typeVal,"list-style-position":posVal,"list-style-image":imgVal}}function contractListStyle(values){let t=values["list-style-type"],p=values["list-style-position"],i=values["list-style-image"];if(!t||!p||!i)return null;let st=serialize(t).trim(),sp=serialize(p).trim(),si=serialize(i).trim(),wide=checkUniformCssWide([st,sp,si]);if(wide!==void 0)return wide;let parts=[];if(sp.toLowerCase()!=="outside")parts.push(sp);if(si.toLowerCase()!=="none")parts.push(si);if(st.toLowerCase()!=="disc")parts.push(st);return parts.length===0?"disc":parts.join(" ")}var FLEX_LONGHANDS=["flex-grow","flex-shrink","flex-basis"];function expandFlex(values){let filtered=filterSignificantTokens(values);if(filtered.length===0||filtered.length>3)return null;let wide=tryExpandCssWide(filtered,FLEX_LONGHANDS);if(wide)return wide;if(filtered.length===1&&filtered[0].type==="ident"){let v=filtered[0].value.toLowerCase();if(v==="none")return{"flex-grow":[{type:"number",value:0,sign:null,numberType:"integer"}],"flex-shrink":[{type:"number",value:0,sign:null,numberType:"integer"}],"flex-basis":[{type:"ident",value:"auto"}]};if(v==="auto")return{"flex-grow":[{type:"number",value:1,sign:null,numberType:"integer"}],"flex-shrink":[{type:"number",value:1,sign:null,numberType:"integer"}],"flex-basis":[{type:"ident",value:"auto"}]}}let grow=null,shrink=null,basis=null;for(let token of filtered)if(token.type==="number")if(grow===null)grow=[token];else if(shrink===null)shrink=[token];else return null;else if(isValidLengthOrPercentage(token)||token.type==="ident"&&FLEX_BASIS_KEYWORDS.has(token.value.toLowerCase()))if(basis===null)basis=[token];else return null;else return null;if(grow===null&&basis===null)return null;let one=[{type:"number",value:1,sign:null,numberType:"integer"}];return{"flex-grow":grow??one,"flex-shrink":shrink??one,"flex-basis":basis??(grow!==null?[{type:"dimension",value:0,unit:"px",sign:null,numberType:"integer"}]:[{type:"ident",value:"auto"}])}}function contractFlex(values){let g=values["flex-grow"],s=values["flex-shrink"],b=values["flex-basis"];if(!g||!s||!b)return null;let sg=serialize(g).trim(),ss=serialize(s).trim(),sb=serialize(b).trim(),wide=checkUniformCssWide([sg,ss,sb]);if(wide!==void 0)return wide;if(sg.includes("var(")||ss.includes("var(")||sb.includes("var("))return sg===ss&&sg===sb?sg:null;if(sb.toLowerCase()==="auto"){if(sg==="0"&&ss==="1")return"initial";if(sg==="1"&&ss==="1")return"auto";if(sg==="0"&&ss==="0")return"none"}if((sb==="0px"||sb==="0%"||sb==="0")&&ss==="1")return`${sg} 1 0px`;return`${sg} ${ss} ${sb}`}function contractOverflow(values){let x=values["overflow-x"],y=values["overflow-y"];if(!x||!y)return null;let sx=serialize(x).trim(),sy=serialize(y).trim(),wide=checkUniformCssWide([sx,sy]);if(wide!==void 0)return wide;if(sx.includes("var(")||sy.includes("var("))return sx===sy?sx:null;return sx===sy?sx:`${sx} ${sy}`}var LINE_CLAMP_LONGHANDS=["max-lines","block-ellipsis","continue"];function expandLineClamp(values){let filtered=filterSignificantTokens(values);if(filtered.length===0)return null;let wide=tryExpandCssWide(filtered,LINE_CLAMP_LONGHANDS);if(wide)return wide;let autoToken=[{type:"ident",value:"auto"}];if(filtered.length===1&&filtered[0].type==="ident"&&filtered[0].value.toLowerCase()==="none")return{"max-lines":[{type:"ident",value:"none"}],"block-ellipsis":autoToken,continue:autoToken};return{"max-lines":filtered,"block-ellipsis":autoToken,continue:autoToken}}function contractLineClamp(values){let lines=values["max-lines"];if(!lines)return null;let sLines=serialize(lines).trim();return sLines.toLowerCase()==="none"?"none":sLines}var BORDER_RADIUS_PHYSICAL=["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"];function expandBorderRadius(values){let filtered=filterSignificantTokens(values);if(filtered.length===0)return null;if(filtered[0].type==="ident"&&filtered[0].value.toLowerCase()==="logical")return null;let slashIndex=filtered.findIndex((v)=>v.type==="delim"&&v.value==="/"),hValues,vValues;if(slashIndex!==-1){if(hValues=filtered.slice(0,slashIndex),vValues=filtered.slice(slashIndex+1),hValues.length===0||hValues.length>4||vValues.length===0||vValues.length>4)return null;if(vValues.some((v)=>v.type==="delim"&&v.value==="/"))return null}else{if(filtered.length>4)return null;hValues=filtered,vValues=filtered}let hExpanded=expandFourSides(hValues),vExpanded=expandFourSides(vValues),result={};for(let i=0;i<4;i++){let h=hExpanded[i],v=vExpanded[i];result[BORDER_RADIUS_PHYSICAL[i]]=serialize(h)===serialize(v)?h:[...h,{type:"whitespace",value:" "},...v]}return result}function contractBorderRadius(values){if(!BORDER_RADIUS_PHYSICAL.every((prop)=>values[prop]!==void 0))return null;let longhands=BORDER_RADIUS_PHYSICAL.map((prop)=>values[prop]),wide=checkUniformCssWide(longhands.map((lh)=>serialize(lh).trim()));if(wide!==void 0)return wide;let parsed=longhands.map((lh)=>{let filtered=filterSignificantTokens(lh);return{h:serialize([filtered[0]]).trim(),v:serialize([filtered.length>1?filtered[1]:filtered[0]]).trim()}}),hStr=formatFourSides(parsed[0].h,parsed[1].h,parsed[2].h,parsed[3].h),vStr=formatFourSides(parsed[0].v,parsed[1].v,parsed[2].v,parsed[3].v);return hStr===vStr?hStr:`${hStr} / ${vStr}`}var logicalLonghands=[],physicalLonghands=[];for(let prop of SUPPORTED_PROPERTIES)if(prop!=="all"&&prop!=="direction"&&prop!=="unicode-bidi"&&!prop.startsWith("--")&&!(prop in SHORTHANDS_DATA))if(prop in LOGICAL_MAPPING)logicalLonghands.push(prop);else physicalLonghands.push(prop);var ALL_SHORTHAND_LONGHANDS=Object.freeze([...logicalLonghands,...physicalLonghands]);function isCSSWideKeywordOrVar(tokens){let nonWs=filterSignificantTokens(tokens);if(nonWs.length===1&&nonWs[0].type==="ident"&&CSS_WIDE_KEYWORDS$2.has(nonWs[0].value.toLowerCase()))return!0;return nonWs.some((t)=>t.type==="function"&&getFunctionName(t)==="var")}function expandAll(value){if(!value||value.length===0||!isCSSWideKeywordOrVar(value))return null;return expandUniformLonghands(ALL_SHORTHAND_LONGHANDS,value)}function contractAll(longhands){let firstVal=null;for(let lh of ALL_SHORTHAND_LONGHANDS){let valTokens=longhands[lh];if(!valTokens||valTokens.length===0)return null;let serialized=serialize(valTokens).trim();if(firstVal===null)firstVal=serialized;else if(serialized!==firstVal)return null}if(!firstVal)return null;let lower=firstVal.toLowerCase();return CSS_WIDE_KEYWORDS$2.has(lower)||lower.startsWith("var(")?firstVal:null}function createBoxShorthand(name,physical,logical){return{longhands:SHORTHANDS_DATA[name],logicalLonghands:logical,expand:expandBox(physical,logical),contract:contractBox(physical,logical)}}function createTwoValueShorthand(name,physicalLonghands){let longhands=SHORTHANDS_DATA[name];return{longhands,...physicalLonghands?{physicalLonghands}:{},expand:expandTwoValue(longhands),contract:contractTwoValue(longhands)}}function createBorderSideShorthand(prefix,longhands,physicalLonghands){return{longhands,...physicalLonghands?{physicalLonghands}:{},expand:expandBorderSide(prefix),contract:contractBorderSide(prefix)}}function createBorderAxisShorthand(name,startProp,endProp,physicalLonghands,logicalLonghands){return{longhands:SHORTHANDS_DATA[name],physicalLonghands,logicalLonghands,expand:(values)=>{if(filterSignificantTokens(values).length===0)return null;return{[startProp]:values,[endProp]:values}},contract:(values)=>{let sVal=values[startProp],eVal=values[endProp],start=sVal?serialize(sVal).trim():contractBorderSide(startProp)(values),end=eVal?serialize(eVal).trim():contractBorderSide(endProp)(values);return start&&end&&start===end?start:null}}}var SHORTHANDS={"border-block":createBorderAxisShorthand("border-block","border-block-start","border-block-end",["border-top-width","border-top-style","border-top-color","border-bottom-width","border-bottom-style","border-bottom-color"],["border-block-start-width","border-block-start-style","border-block-start-color","border-block-end-width","border-block-end-style","border-block-end-color"]),"border-block-color":createTwoValueShorthand("border-block-color",["border-top-color","border-bottom-color"]),"border-block-end":createBorderSideShorthand("border-block-end",SHORTHANDS_DATA["border-block-end"],["border-bottom-width","border-bottom-style","border-bottom-color"]),"border-block-start":createBorderSideShorthand("border-block-start",SHORTHANDS_DATA["border-block-start"],["border-top-width","border-top-style","border-top-color"]),"border-block-style":createTwoValueShorthand("border-block-style",["border-top-style","border-bottom-style"]),"border-block-width":createTwoValueShorthand("border-block-width",["border-top-width","border-bottom-width"]),border:{longhands:BORDER_ALL_LONGHANDS,expand:expandBorder,contract:contractBorder},"border-top":createBorderSideShorthand("border-top",["border-top-width","border-top-style","border-top-color"]),"border-right":createBorderSideShorthand("border-right",["border-right-width","border-right-style","border-right-color"]),"border-bottom":createBorderSideShorthand("border-bottom",["border-bottom-width","border-bottom-style","border-bottom-color"]),"border-left":createBorderSideShorthand("border-left",["border-left-width","border-left-style","border-left-color"]),"border-image":{longhands:BORDER_IMAGE_LONGHANDS,expand:expandBorderImage,contract:contractBorderImage},outline:{longhands:["outline-color","outline-style","outline-width"],expand:expandOutline,contract:contractOutline},"font-variant":{longhands:FONT_VARIANT_LONGHANDS,expand:expandFontVariant,contract:contractFontVariant},font:{longhands:FONT_LONGHANDS,expand:expandFont,contract:contractFont},"list-style":{longhands:LIST_STYLE_LONGHANDS,expand:expandListStyle,contract:contractListStyle},overflow:{longhands:SHORTHANDS_DATA.overflow,expand:expandTwoValue(SHORTHANDS_DATA.overflow),contract:contractOverflow},flex:{longhands:FLEX_LONGHANDS,expand:expandFlex,contract:contractFlex},"-webkit-flex":{longhands:FLEX_LONGHANDS,expand:expandFlex,contract:contractFlex},"line-clamp":{longhands:LINE_CLAMP_LONGHANDS,expand:expandLineClamp,contract:contractLineClamp},"-webkit-line-clamp":{longhands:LINE_CLAMP_LONGHANDS,expand:expandLineClamp,contract:contractLineClamp},"border-color":createBoxShorthand("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"],["border-block-start-color","border-inline-start-color","border-block-end-color","border-inline-end-color"]),"border-inline":createBorderAxisShorthand("border-inline","border-inline-start","border-inline-end",["border-left-width","border-left-style","border-left-color","border-right-width","border-right-style","border-right-color"],["border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end-width","border-inline-end-style","border-inline-end-color"]),"border-inline-color":createTwoValueShorthand("border-inline-color",["border-left-color","border-right-color"]),"border-inline-end":createBorderSideShorthand("border-inline-end",SHORTHANDS_DATA["border-inline-end"],["border-right-width","border-right-style","border-right-color"]),"border-inline-start":createBorderSideShorthand("border-inline-start",SHORTHANDS_DATA["border-inline-start"],["border-left-width","border-left-style","border-left-color"]),"border-inline-style":createTwoValueShorthand("border-inline-style",["border-left-style","border-right-style"]),"border-inline-width":createTwoValueShorthand("border-inline-width",["border-left-width","border-right-width"]),"border-radius":{longhands:SHORTHANDS_DATA["border-radius"],logicalLonghands:["border-start-start-radius","border-start-end-radius","border-end-end-radius","border-end-start-radius"],expand:expandBorderRadius,contract:contractBorderRadius},"border-style":createBoxShorthand("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"],["border-block-start-style","border-inline-start-style","border-block-end-style","border-inline-end-style"]),"border-width":createBoxShorthand("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"],["border-block-start-width","border-inline-start-width","border-block-end-width","border-inline-end-width"]),inset:createBoxShorthand("inset",["top","right","bottom","left"],["inset-block-start","inset-inline-start","inset-block-end","inset-inline-end"]),"inset-block":createTwoValueShorthand("inset-block",["top","bottom"]),"inset-inline":createTwoValueShorthand("inset-inline",["left","right"]),margin:createBoxShorthand("margin",["margin-top","margin-right","margin-bottom","margin-left"],["margin-block-start","margin-inline-start","margin-block-end","margin-inline-end"]),"margin-block":createTwoValueShorthand("margin-block",["margin-top","margin-bottom"]),"margin-inline":createTwoValueShorthand("margin-inline",["margin-left","margin-right"]),padding:createBoxShorthand("padding",["padding-top","padding-right","padding-bottom","padding-left"],["padding-block-start","padding-inline-start","padding-block-end","padding-inline-end"]),"padding-block":createTwoValueShorthand("padding-block",["padding-top","padding-bottom"]),"padding-inline":createTwoValueShorthand("padding-inline",["padding-left","padding-right"]),"scroll-margin":createBoxShorthand("scroll-margin",["scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left"],["scroll-margin-block-start","scroll-margin-inline-start","scroll-margin-block-end","scroll-margin-inline-end"]),"scroll-padding":createBoxShorthand("scroll-padding",["scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left"],["scroll-padding-block-start","scroll-padding-inline-start","scroll-padding-block-end","scroll-padding-inline-end"]),background:{longhands:SHORTHANDS_DATA.background,expand:expandBackground,contract:contractBackground},all:{longhands:ALL_SHORTHAND_LONGHANDS,expand:expandAll,contract:contractAll}};function getShorthandAllLonghands(shorthand){if(shorthand.allLonghands)return shorthand.allLonghands;if(!shorthand.logicalLonghands&&!shorthand.physicalLonghands)return shorthand.longhands;let combined=Object.freeze([...shorthand.longhands,...shorthand.logicalLonghands||[],...shorthand.physicalLonghands||[]]);return shorthand.allLonghands=combined,combined}var LONGHAND_TO_SHORTHAND={};for(let[shorthand,def]of Object.entries(SHORTHANDS)){if(def.allLonghands=Object.freeze([...def.longhands,...def.logicalLonghands||[],...def.physicalLonghands||[]]),shorthand==="all")continue;for(let longhand of def.longhands){if(!LONGHAND_TO_SHORTHAND[longhand])LONGHAND_TO_SHORTHAND[longhand]=[];LONGHAND_TO_SHORTHAND[longhand].push(shorthand)}if(def.logicalLonghands)for(let longhand of def.logicalLonghands){if(!LONGHAND_TO_SHORTHAND[longhand])LONGHAND_TO_SHORTHAND[longhand]=[];LONGHAND_TO_SHORTHAND[longhand].push(shorthand)}if(def.physicalLonghands)for(let longhand of def.physicalLonghands){if(!LONGHAND_TO_SHORTHAND[longhand])LONGHAND_TO_SHORTHAND[longhand]=[];if(!LONGHAND_TO_SHORTHAND[longhand].includes(shorthand))LONGHAND_TO_SHORTHAND[longhand].push(shorthand)}}var formatter=new Intl.NumberFormat("en-US",{useGrouping:!1,minimumFractionDigits:0,maximumFractionDigits:6});function formatNumber(val){if(val===0)return"0";if(!Number.isFinite(val)){if(val===1/0)return"infinity";if(val===-1/0)return"-infinity";return"nan"}let formatted=formatter.format(val);return formatted==="-0"?"0":formatted}var PSEUDO_CLASSES=new Set("active,active-view-transition,active-view-transition-type,after,animated-image,any-link,autofill,before,blank,buffering,checked,current,default,defined,dir,disabled,empty,enabled,first,first-child,first-letter,first-line,first-of-page,first-of-type,focus,focus-visible,focus-within,fullscreen,future,has,has-slotted,heading,high-value,host,host-context,hover,in-range,indeterminate,interest-source,interest-target,invalid,is,lang,last-child,last-of-page,last-of-type,left,link,link-to,local-link,low-value,matches,modal,muted,navigation-source,not,nth,nth-child,nth-col,nth-last-child,nth-last-col,nth-last-of-type,nth-of-page,nth-of-type,only-child,only-of-type,open,optimal-value,optional,out-of-range,past,paused,picture-in-picture,placeholder-shown,playing,popover-open,read-only,read-write,required,right,root,scope,seeking,snapped,snapped-block,snapped-inline,snapped-x,snapped-y,stalled,start-of-page,state,target,target-after,target-before,target-current,target-within,unchecked,user-invalid,user-valid,valid,visited,volume-locked,where,xr-overlay".split(",")),PSEUDO_ELEMENTS=new Set("-moz-progress-bar,-moz-range-progress,-moz-range-thumb,-moz-range-track,-ms-browse,-ms-check,-ms-clear,-ms-expand,-ms-fill,-ms-fill-lower,-ms-fill-upper,-ms-reveal,-ms-thumb,-ms-ticks-after,-ms-ticks-before,-ms-tooltip,-ms-track,-ms-value,-webkit-progress-bar,-webkit-progress-inner-value,-webkit-progress-value,-webkit-slider-runnable-track,-webkit-slider-thumb,after,backdrop,before,checkmark,clear-icon,color-swatch,column,cue,cue-region,details-content,field-component,field-content,field-separator,file-selector-button,first-letter,first-line,grammar-error,highlight,interest-button,marker,nth-fragment,part,picker,picker-icon,placeholder,reveal-icon,scroll-button,scroll-marker,scroll-marker-group,search-text,selection,slider-fill,slider-thumb,slider-track,slotted,spelling-error,step-control,step-down,step-up,target-text,view-transition,view-transition-group,view-transition-group-children,view-transition-image-pair,view-transition-new,view-transition-old".split(",")),KNOWN_PSEUDO_ELEMENTS=new Set("after,backdrop,before,checkmark,clear-icon,color-swatch,column,cue,cue-region,details-content,field-component,field-content,field-separator,file-selector-button,first-letter,first-line,grammar-error,interest-button,marker,picker-icon,placeholder,reveal-icon,scroll-marker,scroll-marker-group,search-text,selection,slider-fill,slider-thumb,slider-track,spelling-error,step-control,step-down,step-up,target-text,view-transition".split(",")),KNOWN_FUNCTIONAL_PSEUDO_ELEMENTS=new Set("cue,cue-region,highlight,nth-fragment,part,picker,scroll-button,slotted,view-transition-group,view-transition-group-children,view-transition-image-pair,view-transition-new,view-transition-old".split(","));function isIdentToken(val){return val!==void 0&&val.type==="ident"}function isDelimToken(val,char){return val!==void 0&&val.type==="delim"&&(char===void 0||val.value===char)}function isHashToken(val){return val!==void 0&&val.type==="hash"}function isStringToken(val){return val!==void 0&&(val.type==="string"||val.type==="bad-string")}function isNumberToken(val){return val!==void 0&&val.type==="number"}function isDimensionToken(val){return val!==void 0&&val.type==="dimension"}function isSimpleBlock(val,associatedType){return val!==void 0&&val.type==="simple-block"&&(associatedType===void 0||val.associatedToken.type===associatedType)}function isCSSFunction(val,name){return val!==void 0&&val.type==="function"&&(name===void 0||val.name.toLowerCase()===name.toLowerCase())}var ComponentValueCursor=class{values;_i=0;constructor(values){this.values=values}get hasNext(){return this._i<this.values.length}get i(){return this._i}set i(pos){this._i=pos}get length(){return this.values.length}get next(){return this.values[this._i]}peek(offset=1){return this.values[this._i+offset]}consume(){return this.values[this._i++]||{type:"EOF"}}skipWhitespace(){while(this._i<this.values.length&&this.values[this._i].type==="whitespace")this._i++}skipToNextComma(){let commaOffset=this.values.slice(this._i).findIndex((v)=>v.type==="comma");this._i=commaOffset===-1?this.values.length:this._i+commaOffset}slice(start,end){return this.values.slice(start,end??this._i)}},LEGACY_PSEUDO_CLASS_ALIASES={"-webkit-autofill":"autofill"},SelectorParser=class SelectorParser{static PSEUDO_CLASSES=PSEUDO_CLASSES;static PSEUDO_ELEMENTS=PSEUDO_ELEMENTS;cursor;allowRelative;forgiving;insideHas;forbidPseudo;declaredNamespaces;strictSupports;allowVendorPseudos;allowUnknownPseudos;constructor(values,options={}){this.cursor=new ComponentValueCursor(values),this.allowRelative=options.allowRelative??!1,this.forgiving=options.forgiving??!1,this.insideHas=options.insideHas??!1,this.forbidPseudo=options.forbidPseudo??!1,this.declaredNamespaces=options.declaredNamespaces,this.strictSupports=options.strictSupports??!1,this.allowVendorPseudos=options.allowVendorPseudos??!1,this.allowUnknownPseudos=options.allowUnknownPseudos??!1}hasAmpersand(values){return values.some((val)=>{if(isDelimToken(val,"&"))return!0;if(isSimpleBlock(val))return this.hasAmpersand(val.value);if(isCSSFunction(val))return this.hasAmpersand(val.value);return!1})}parse(){let selectors=[];while(this.cursor.hasNext){if(this.cursor.skipWhitespace(),!this.cursor.hasNext||this.cursor.next?.type==="EOF")break;let start=this.cursor.i;try{let selector=this.consumeComplexSelector();this.cursor.skipWhitespace();let next=this.cursor.next;if(!next||next.type==="comma")selectors.push(selector);else throw new DOMException("Unexpected token in selector","SyntaxError")}catch(e){if(this.forgiving){this.cursor.skipToNextComma();let rawSlice=this.cursor.slice(start,this.cursor.i),trimmedStart=0;while(trimmedStart<rawSlice.length&&rawSlice[trimmedStart].type==="whitespace")trimmedStart++;let trimmedEnd=rawSlice.length-1;while(trimmedEnd>=trimmedStart&&rawSlice[trimmedEnd].type==="whitespace")trimmedEnd--;let failedTokens=rawSlice.slice(trimmedStart,trimmedEnd+1);if(failedTokens.length>0)selectors.push({type:"invalid-selector",tokens:failedTokens})}else throw e}if(this.cursor.next?.type==="comma")this.cursor.consume()}if(!this.forgiving&&selectors.length===0)throw new DOMException("Selector list cannot be empty","SyntaxError");return{type:"selector-list",selectors}}validateNamespace(namespace){if(this.declaredNamespaces!==void 0&&namespace!==void 0&&namespace!=="*"&&namespace!==""){if(!this.declaredNamespaces.has(namespace))throw new DOMException(`Undeclared namespace prefix: "${namespace}"`,"SyntaxError")}}consumeComplexSelector(){let items=[],start=this.cursor.i,seenPseudoElement=!1;while(this.cursor.hasNext){if(this.cursor.skipWhitespace(),!this.cursor.hasNext||this.cursor.next?.type==="comma")break;let combinator=this.tryConsumeCombinator();if(combinator){if(items.length===0&&!this.allowRelative)throw new DOMException("Relative selector not allowed in this context","SyntaxError");if(seenPseudoElement)throw new DOMException("Pseudo-element must be at the end of the selector","SyntaxError");if(items.length>0&&items[items.length-1].type==="combinator")throw new DOMException("Consecutive combinators are not allowed","SyntaxError");items.push(combinator);continue}let compound=this.consumeCompoundSelector();if(compound.selectors.length>0){if(seenPseudoElement)throw new DOMException("Pseudo-element must be at the end of the selector","SyntaxError");let hasPseudo=compound.selectors.some((s)=>s.type==="pseudo-element-selector");if(items.length>0&&items[items.length-1].type==="compound-selector")items.push({type:"combinator",value:" "});if(items.push(compound),hasPseudo)seenPseudoElement=!0}else break}if(items.length>0&&items[items.length-1].type==="combinator")throw new DOMException("Trailing combinator is not allowed","SyntaxError");if(items.length===0)throw new DOMException("Complex selector cannot be empty","SyntaxError");let end=this.cursor.i;return{type:"complex-selector",items,tokens:this.cursor.slice(start,end)}}tryConsumeCombinator(){let token=this.cursor.next;if(!token)return null;if(isDelimToken(token)){let val=token.value;if(val===">"||val==="+"||val==="~")return this.cursor.consume(),{type:"combinator",value:val};if(val==="|"&&isDelimToken(this.cursor.peek(1),"|"))return this.cursor.consume(),this.cursor.consume(),{type:"combinator",value:"||"}}return null}isUserActionPseudoClass(name){let lower=name.toLowerCase();return["hover","active","focus","focus-visible","focus-within"].includes(lower)}validateSimpleSelectorAfterPseudo(selector){if(selector.type==="pseudo-class-selector"){let lowerName=selector.name.toLowerCase();if(["not","is","where","has"].includes(lowerName))return;else if(!this.isUserActionPseudoClass(selector.name))throw new DOMException("Only user-action pseudo-classes are allowed after a pseudo-element","SyntaxError")}else throw new DOMException("Only user-action pseudo-classes are allowed after a pseudo-element","SyntaxError")}consumeCompoundSelector(){let selectors=[],lastPseudoElement=null;while(this.cursor.hasNext){let token=this.cursor.next;if(!token||token.type==="whitespace"||token.type==="comma")break;if(isDelimToken(token)){let val=token.value;if(val===">"||val==="+"||val==="~")break;if(val==="|"){if(lastPseudoElement)break;if(isDelimToken(this.cursor.peek(1),"|"))break;if(selectors.length>0)throw new DOMException("Type selector must be first in compound selector","SyntaxError");selectors.push(this.consumeTypeOrUniversalSelector());continue}if(val==="*"){if(lastPseudoElement)break;if(selectors.length>0)throw new DOMException("Universal selector must be first in compound selector","SyntaxError");selectors.push(this.consumeTypeOrUniversalSelector());continue}if(val==="."){if(lastPseudoElement)break;selectors.push(this.consumeClassSelector());continue}if(val==="&"){if(lastPseudoElement)break;this.cursor.consume(),selectors.push({type:"nesting-selector"});continue}}if(isHashToken(token)){if(token.hashType!=="id")throw new DOMException("ID selector must be an identifier","SyntaxError");if(lastPseudoElement)break;selectors.push({type:"id-selector",name:token.value}),this.cursor.consume();continue}if(isIdentToken(token)){if(lastPseudoElement)break;if(selectors.length>0)throw new DOMException("Type selector must be first in compound selector","SyntaxError");selectors.push(this.consumeTypeOrUniversalSelector());continue}if(isSimpleBlock(token,"[")){if(lastPseudoElement)break;selectors.push(this.consumeAttributeSelector());continue}if(token.type==="colon"){let selector=this.consumePseudoSelector();if(lastPseudoElement){let isSlottedOrPart=["slotted","part"].includes(lastPseudoElement.toLowerCase());if(selector.type==="pseudo-element-selector"){if(!isSlottedOrPart)throw new DOMException("Pseudo-elements cannot be nested","SyntaxError")}else if(selector.type==="pseudo-class-selector"){if(!isSlottedOrPart)this.validateSimpleSelectorAfterPseudo(selector)}else throw new DOMException("Unexpected selector after pseudo-element","SyntaxError")}if(selector.type==="pseudo-element-selector")lastPseudoElement=selector.name;selectors.push(selector);continue}break}return{type:"compound-selector",selectors}}consumeTypeOrUniversalSelector(){let namespace=void 0,token=this.cursor.next;if(!token)throw new DOMException("Unexpected EOF in type selector","SyntaxError");let isNextPipe=isDelimToken(this.cursor.peek(1),"|"),isNextNextPipe=isDelimToken(this.cursor.peek(2),"|"),isColumnCombinator=isNextPipe&&isNextNextPipe;if(isIdentToken(token)&&isNextPipe&&!isColumnCombinator)namespace=token.value,this.cursor.i+=2;else if(isDelimToken(token,"*")&&isNextPipe&&!isColumnCombinator)namespace="*",this.cursor.i+=2;else if(isDelimToken(token,"|")&&!isNextPipe)namespace="",this.cursor.i+=1;let next=this.cursor.consume();if(isDelimToken(next,"*"))return this.validateNamespace(namespace),{type:"universal-selector",namespace};if(!isIdentToken(next))throw new DOMException("Expected identifier or * after namespace pipe","SyntaxError");return this.validateNamespace(namespace),{type:"type-selector",name:next.value,namespace}}consumeClassSelector(){this.cursor.consume();let ident=this.cursor.consume();if(!isIdentToken(ident))return{type:"class-selector",name:""};return{type:"class-selector",name:ident.value}}consumeAttributeSelector(){let block=this.cursor.consume();if(!isSimpleBlock(block,"["))throw new DOMException("Expected attribute selector block","SyntaxError");let subCursor=new ComponentValueCursor(block.value),name="",namespace=void 0,operator="",value="",flags="";if(subCursor.skipWhitespace(),subCursor.hasNext){let v1=subCursor.next,v2=subCursor.peek(1),v3=subCursor.peek(2),isPipeFollowedByEquals=isDelimToken(v2,"|")&&isDelimToken(v3,"=");if(isIdentToken(v1)&&isDelimToken(v2,"|")&&!isPipeFollowedByEquals)namespace=v1.value,subCursor.i+=2;else if(isDelimToken(v1,"*")&&isDelimToken(v2,"|")&&!isPipeFollowedByEquals)namespace="*",subCursor.i+=2;else if(isDelimToken(v1,"|")&&!isDelimToken(v2,"="))namespace="",subCursor.i+=1}let valName=subCursor.next;if(isIdentToken(valName))name=valName.value,subCursor.consume();subCursor.skipWhitespace();let valOp=subCursor.next;if(isDelimToken(valOp)){operator=valOp.value,subCursor.consume();let valEq=subCursor.next;if(isDelimToken(valEq,"="))operator+=valEq.value,subCursor.consume()}subCursor.skipWhitespace();let valVal=subCursor.next;if(isStringToken(valVal)||isIdentToken(valVal))value=valVal.value,subCursor.consume();subCursor.skipWhitespace();let valFlag=subCursor.next;if(isIdentToken(valFlag)){let flagValue=valFlag.value,lowerFlag=flagValue.toLowerCase();if(lowerFlag!=="i"&&lowerFlag!=="s")throw new DOMException(`Invalid attribute selector flag: ${flagValue}`,"SyntaxError");flags=flagValue,subCursor.consume()}if(subCursor.skipWhitespace(),subCursor.hasNext)throw new DOMException("Unexpected content in attribute selector","SyntaxError");if(!name)throw new DOMException("Expected attribute name in attribute selector","SyntaxError");return this.validateNamespace(namespace),{type:"attribute-selector",name,namespace,operator,value,flags}}consumePseudoSelector(){this.cursor.consume();let isPseudoElement=!1;if(this.cursor.next?.type==="colon")this.cursor.consume(),isPseudoElement=!0;let token=this.cursor.consume();if(!token)return{type:"pseudo-class-selector",name:""};if(isIdentToken(token)){let originalName=token.value,lowerName=originalName.toLowerCase(),name=LEGACY_PSEUDO_CLASS_ALIASES[lowerName]||originalName,effectiveLowerName=name.toLowerCase(),isVendorPrefixed=/^-[a-zA-Z0-9]+-/.test(effectiveLowerName);if(isPseudoElement){if(this.forbidPseudo||this.insideHas)throw new DOMException("Pseudo-elements are not allowed in this context","SyntaxError");let isAllowedVendor=this.allowVendorPseudos&&isVendorPrefixed||!this.strictSupports&&effectiveLowerName.startsWith("-webkit-");if(!PSEUDO_ELEMENTS.has(effectiveLowerName)&&!isAllowedVendor&&!this.allowUnknownPseudos)throw new DOMException(`Unknown pseudo-element ::${name}`,"SyntaxError");return{type:"pseudo-element-selector",name}}if(["before","after","first-line","first-letter"].includes(effectiveLowerName)){if(this.forbidPseudo||this.insideHas)throw new DOMException("Pseudo-elements are not allowed in this context","SyntaxError");return{type:"pseudo-element-selector",name}}let isAllowedVendor=this.allowVendorPseudos&&isVendorPrefixed||!this.strictSupports&&effectiveLowerName.startsWith("-webkit-");if(!PSEUDO_CLASSES.has(effectiveLowerName)&&!isAllowedVendor&&!this.allowUnknownPseudos)throw new DOMException(`Unknown pseudo-class :${name}`,"SyntaxError");return{type:"pseudo-class-selector",name}}else if(isCSSFunction(token)){let func=token,name=func.name,lowerName=name.toLowerCase(),isVendorPrefixed=/^-[a-zA-Z0-9]+-/.test(lowerName);if(isPseudoElement){if(this.forbidPseudo||this.insideHas)throw new DOMException("Pseudo-elements are not allowed in this context","SyntaxError");if(!PSEUDO_ELEMENTS.has(lowerName)&&!(this.allowVendorPseudos&&isVendorPrefixed)&&!this.allowUnknownPseudos)throw new DOMException(`Unknown pseudo-element ::${name}()`,"SyntaxError");if(lowerName==="slotted"){let subParser=new SelectorParser(func.value,{insideHas:this.insideHas,forbidPseudo:!0,declaredNamespaces:this.declaredNamespaces,strictSupports:this.strictSupports,allowVendorPseudos:this.allowVendorPseudos,allowUnknownPseudos:this.allowUnknownPseudos});subParser.cursor.skipWhitespace();let compound=subParser.consumeCompoundSelector();if(subParser.cursor.skipWhitespace(),subParser.cursor.i!==func.value.length||compound.selectors.length===0)throw new DOMException("Argument to ::slotted() must be a compound selector","SyntaxError");return{type:"pseudo-element-selector",name,argument:{type:"selector-list",selectors:[{type:"complex-selector",items:[compound],tokens:func.value}]}}}return{type:"pseudo-element-selector",name,argument:func.value}}if(!PSEUDO_CLASSES.has(lowerName)&&lowerName!=="matches"&&!(this.allowVendorPseudos&&isVendorPrefixed)&&!this.allowUnknownPseudos)throw new DOMException(`Unknown pseudo-class :${name}()`,"SyntaxError");if(["is","not","has","where","matches"].includes(lowerName)){let isHas=lowerName==="has";if(isHas&&this.insideHas)throw new DOMException(":has() cannot be nested","SyntaxError");let isForgiving=!this.strictSupports&&["is","where","matches"].includes(lowerName),isLogicalPseudo=["is","where","not","matches"].includes(lowerName);return{type:"pseudo-class-selector",name,argument:new SelectorParser(func.value,{allowRelative:isHas,forgiving:isForgiving,insideHas:isHas||this.insideHas,forbidPseudo:isLogicalPseudo||isHas||this.forbidPseudo,declaredNamespaces:this.declaredNamespaces,strictSupports:this.strictSupports,allowVendorPseudos:this.allowVendorPseudos,allowUnknownPseudos:this.allowUnknownPseudos}).parse()}}if(["host","host-context"].includes(lowerName)){let subParser=new SelectorParser(func.value,{insideHas:this.insideHas,forbidPseudo:!0,declaredNamespaces:this.declaredNamespaces,strictSupports:this.strictSupports,allowVendorPseudos:this.allowVendorPseudos,allowUnknownPseudos:this.allowUnknownPseudos});subParser.cursor.skipWhitespace();let compound=subParser.consumeCompoundSelector();if(subParser.cursor.skipWhitespace(),subParser.cursor.i!==func.value.length||compound.selectors.length===0)throw new DOMException(`Argument to :${name}() must be a compound selector`,"SyntaxError");return{type:"pseudo-class-selector",name,argument:{type:"selector-list",selectors:[{type:"complex-selector",items:[compound],tokens:func.value}]}}}if(["nth-child","nth-last-child","nth-of-type","nth-last-of-type"].includes(lowerName)){let ofIdx=-1;for(let k=0;k<func.value.length;k++){let v=func.value[k];if(isIdentToken(v)&&v.value.toLowerCase()==="of"){ofIdx=k;break}}if(ofIdx!==-1){if(["nth-of-type","nth-last-of-type"].includes(lowerName))throw new DOMException(`'of' is not allowed in :${name}()`,"SyntaxError");let nth=func.value.slice(0,ofIdx);return this.validateAnPlusB(nth),{type:"pseudo-class-selector",name,argument:new SelectorParser(func.value.slice(ofIdx+1),{insideHas:this.insideHas,forbidPseudo:!0,allowRelative:!1,declaredNamespaces:this.declaredNamespaces,strictSupports:this.strictSupports,allowVendorPseudos:this.allowVendorPseudos,allowUnknownPseudos:this.allowUnknownPseudos}).parse(),nth}}else return this.validateAnPlusB(func.value),{type:"pseudo-class-selector",name,argument:func.value,nth:func.value}}if(lowerName==="dir")this.validateDir(func.value);if(lowerName==="heading")this.validateHeading(func.value);if(lowerName==="lang")this.validateLang(func.value);return{type:"pseudo-class-selector",name,argument:func.value}}throw new DOMException("Expected identifier or function after colon in pseudo-selector","SyntaxError")}validateAnPlusB(values){let res=parseAnPlusB(values);if(!res){let text=getOriginalText(values).trim();throw new DOMException(`Invalid An+B expression: ${text}`,"SyntaxError")}return res}validateHeading(values){let nonComment=values.filter((v)=>v.type!=="comment"),start=0;while(start<nonComment.length&&nonComment[start].type==="whitespace")start++;let end=nonComment.length-1;while(end>=start&&nonComment[end].type==="whitespace")end--;if(start>end)throw new DOMException("Argument to :heading() cannot be empty","SyntaxError");let tokens=nonComment.slice(start,end+1),expectInteger=!0;for(let i=0;i<tokens.length;i++){let t=tokens[i];if(t.type==="whitespace")continue;if(expectInteger)if(t.type==="number"&&t.numberType==="integer")expectInteger=!1;else throw new DOMException("Argument to :heading() must be comma-separated integers","SyntaxError");else if(t.type==="comma"||t.type==="delim"&&t.value===",")expectInteger=!0;else throw new DOMException("Expected comma in :heading() arguments","SyntaxError")}if(expectInteger)throw new DOMException("Trailing comma in :heading() arguments","SyntaxError")}validateDir(values){let nonWs=values.filter((v)=>v.type!=="whitespace"&&v.type!=="comment"),firstToken=nonWs[0];if(nonWs.length!==1||!isIdentToken(firstToken))throw new DOMException("Argument to :dir() must be a single identifier","SyntaxError");let val=firstToken.value.toLowerCase();if(val!=="ltr"&&val!=="rtl"&&val!=="auto")throw new DOMException("Argument to :dir() must be ltr, rtl, or auto","SyntaxError")}validateLang(values){let nonWs=values.filter((v)=>v.type!=="whitespace"&&v.type!=="comment");if(nonWs.length===0)throw new DOMException("Argument to :lang() cannot be empty","SyntaxError");let expectItem=!0;for(let v of nonWs)if(expectItem){if(!isIdentToken(v)&&!isStringToken(v))throw new DOMException("Argument to :lang() must be identifiers or strings","SyntaxError");expectItem=!1}else{if(v.type!=="comma")throw new DOMException("Expected comma in :lang() argument","SyntaxError");expectItem=!0}if(expectItem)throw new DOMException("Trailing comma in :lang() argument","SyntaxError")}};function parseAnPlusB(values){let nonComment=values.filter((v)=>v.type!=="comment"),start=0;while(start<nonComment.length&&nonComment[start].type==="whitespace")start++;let end=nonComment.length-1;while(end>=start&&nonComment[end].type==="whitespace")end--;if(start>end)return null;let tokens=nonComment.slice(start,end+1),isIntegerNumber=(t)=>isNumberToken(t)&&t.numberType==="integer";if(tokens.length===1){let t=tokens[0];if(isIdentToken(t)){let lower=t.value.toLowerCase();if(lower==="odd")return{a:2,b:1};if(lower==="even")return{a:2,b:0};if(lower==="n")return{a:1,b:0};if(lower==="-n")return{a:-1,b:0};let matchNdashDigit=lower.match(/^n-(\d+)$/);if(matchNdashDigit)return{a:1,b:-parseInt(matchNdashDigit[1],10)};let matchDashNdashDigit=lower.match(/^-n-(\d+)$/);if(matchDashNdashDigit)return{a:-1,b:-parseInt(matchDashNdashDigit[1],10)};return null}if(isIntegerNumber(t))return{a:0,b:Number(t.value)};if(isDimensionToken(t)&&t.numberType==="integer"){let unit=(t.unit||"").toLowerCase();if(unit==="n")return{a:Number(t.value),b:0};let matchDim=unit.match(/^n-(\d+)$/);if(matchDim)return{a:Number(t.value),b:-parseInt(matchDim[1],10)};return null}return null}let idx=0,plusPrefix=!1;if(isDelimToken(tokens[0],"+")){if(plusPrefix=!0,idx=1,tokens[1]?.type==="whitespace")return null}let nextNonWs=(from)=>{let p=from;while(p<tokens.length&&tokens[p].type==="whitespace")p++;return p},t1=tokens[idx];if(!t1)return null;let a=null,hasDashAfterN=!1;if(isIdentToken(t1)){let lower=t1.value.toLowerCase();if(lower==="n")a=1;else if(lower==="-n"&&!plusPrefix)a=-1;else if(lower==="n-")a=1,hasDashAfterN=!0;else if(lower==="-n-"&&!plusPrefix)a=-1,hasDashAfterN=!0;else if(lower.startsWith("n-")){let match=lower.match(/^n-(\d+)$/);if(match&&idx===tokens.length-1)return{a:1,b:-parseInt(match[1],10)}}}else if(isDimensionToken(t1)&&t1.numberType==="integer"&&!plusPrefix){let unit=(t1.unit||"").toLowerCase();if(unit==="n")a=Number(t1.value);else if(unit==="n-")a=Number(t1.value),hasDashAfterN=!0}if(a===null)return null;let afterT1=nextNonWs(idx+1);if(afterT1>=tokens.length){if(!hasDashAfterN)return{a,b:0};return null}let t2=tokens[afterT1];if(hasDashAfterN){if(isIntegerNumber(t2)&&!t2.sign){if(nextNonWs(afterT1+1)<tokens.length)return null;return{a,b:-Number(t2.value)}}return null}if(isIntegerNumber(t2)&&t2.sign){if(nextNonWs(afterT1+1)<tokens.length)return null;return{a,b:Number(t2.value)}}if(isDelimToken(t2,"+")||isDelimToken(t2,"-")){let sign=t2.value==="+"?1:-1,afterT2=nextNonWs(afterT1+1);if(afterT2>=tokens.length)return null;let t3=tokens[afterT2];if(isIntegerNumber(t3)&&!t3.sign){if(nextNonWs(afterT2+1)<tokens.length)return null;return{a,b:sign*Number(t3.value)}}return null}return null}function requiresTokenSeparator(t1,t2){let isIdent1=t1.type==="ident",isAtKeyword1=t1.type==="at-keyword",isHash1=t1.type==="hash",isDimension1=t1.type==="dimension",isDelimHash1=t1.type==="delim"&&t1.value==="#",isDelimDash1=t1.type==="delim"&&t1.value==="-",isNumber1=t1.type==="number",isDelimAt1=t1.type==="delim"&&t1.value==="@",isDelimDot1=t1.type==="delim"&&t1.value===".",isDelimPlus1=t1.type==="delim"&&t1.value==="+",isDelimSlash1=t1.type==="delim"&&t1.value==="/";if(!isIdent1&&!isAtKeyword1&&!isHash1&&!isDimension1&&!isDelimHash1&&!isDelimDash1&&!isNumber1&&!isDelimAt1&&!isDelimDot1&&!isDelimPlus1&&!isDelimSlash1)return!1;let isIdent2=t2.type==="ident",isFunction2=t2.type==="function",isUrl2=t2.type==="url",isBadUrl2=t2.type==="bad-url",isDelimDash2=t2.type==="delim"&&t2.value==="-",isNumber2=t2.type==="number",isPercentage2=t2.type==="percentage",isDimension2=t2.type==="dimension",isCDC2=t2.type==="CDC",isOpenParen2=t2.type==="("||t2.type==="delim"&&t2.value==="(",isDelimStar2=t2.type==="delim"&&t2.value==="*",isDelimPercent2=t2.type==="delim"&&t2.value==="%",inGroupA=isIdent2||isFunction2||isUrl2||isBadUrl2||isDelimDash2||isNumber2||isPercentage2||isDimension2||isCDC2;if(isIdent1)return inGroupA||isOpenParen2;if(isAtKeyword1||isHash1||isDimension1||isDelimHash1||isDelimDash1)return inGroupA;if(isNumber1)return isIdent2||isFunction2||isUrl2||isBadUrl2||isNumber2||isPercentage2||isDimension2||isCDC2||isDelimPercent2;if(isDelimAt1)return isIdent2||isFunction2||isUrl2||isBadUrl2||isDelimDash2||isCDC2;if(isDelimDot1||isDelimPlus1)return isNumber2||isPercentage2||isDimension2;if(isDelimSlash1)return isDelimStar2;return!1}function getFirstToken(node){if(typeof node!=="object"||node===null)return null;if(node.type==="simple-block")return node.associatedToken;if(node.type==="function"&&"name"in node)return{type:"function",value:node.name};let t=node;if(t.type==="EOF")return null;return t}function getLastToken(node){if(typeof node!=="object"||node===null)return null;if(node.type==="simple-block"){let start=node.associatedToken?.value,end=getMirrorToken(start);return{type:end||")",value:end}}if(node.type==="function"&&"name"in node)return{type:")",value:")"};let t=node;if(t.type==="EOF")return null;return t}function serialize(nodes,preserveCase=!1,propertyName){if(propertyName==="font-family")return serializeFontFamily(nodes);let result="",prevLastToken=null;for(let node of nodes){if(node.type==="EOF")continue;let firstToken=getFirstToken(node);if(prevLastToken&&firstToken&&requiresTokenSeparator(prevLastToken,firstToken))result+="/**/";result+=serializeNode(node,preserveCase);let last=getLastToken(node);if(last)prevLastToken=last}return result}function trimWhitespaceTokens(tokens){let start=0;while(start<tokens.length&&tokens[start].type==="whitespace")start++;let end=tokens.length-1;while(end>=start&&tokens[end].type==="whitespace")end--;return start<=end?tokens.slice(start,end+1):[]}function serializeNode(node,preserveCase){if(typeof node!=="object"||node===null||!("type"in node))return"";if(node.type==="simple-block"){let start=node.associatedToken.value;return start+serialize(node.value,preserveCase)+getMirrorToken(start)}if(node.type==="function"&&"name"in node){let args=node.value,funcName=preserveCase?node.name:node.name.toLowerCase();if(funcName==="counter"){let i=args.length-1;while(i>=0&&args[i].type==="whitespace")i--;if(i>=0&&args[i].type==="ident"&&args[i].value==="decimal"){let j=i-1;while(j>=0&&args[j].type==="whitespace")j--;if(j>=0&&args[j].type==="comma")args=args.slice(0,j)}}else if(funcName==="url")args=trimWhitespaceTokens(args);else if(funcName==="attr"){let i=0;while(i<args.length&&args[i].type==="whitespace")i++;if(i<args.length&&args[i].type==="delim"&&args[i].value==="|"){args=args.slice(i+1);let k=args.length-1;while(k>=0&&args[k].type==="whitespace")k--;if(k>=0&&args[k].type==="string"&&args[k].value===""){let l=k-1;while(l>=0&&args[l].type==="whitespace")l--;if(l>=0&&args[l].type==="comma")args=args.slice(0,l)}}args=trimWhitespaceTokens(args)}return`${funcName}(${serialize(args,preserveCase)})`}return serializeToken(node,preserveCase)}function serializeToken(token,preserveCase=!1){switch(token.type){case"ident":return serializeIdentifier(token.value);case"at-keyword":return"@"+serializeIdentifier(token.value);case"hash":return"#"+token.value;case"string":return preserveCase&&token.originalText&&!token.originalText.endsWith("\\")?token.originalText:serializeString(token.value);case"url":return preserveCase?serializeUrlToken(token.value,token.originalText):serializeUrl(token.value);case"delim":return token.value==="\\"?"\\\n":token.value;case"number":return formatNumber(token.value);case"percentage":return formatNumber(token.value)+"%";case"dimension":return formatNumber(token.value)+(token.unit?serializeIdentifier(token.unit):"");case"whitespace":return preserveCase&&token.originalText?token.originalText:token.value;case"comment":return token.value||"/**/";case"CDO":return"<!--";case"CDC":return"-->";case"colon":return":";case"semicolon":return";";case"comma":return",";case"[":case"]":case"{":case"}":case"(":case")":return token.value;case"function":return serializeIdentifier(preserveCase?token.value:token.value.toLowerCase())+"(";case"unicode-range":return token.value;case"EOF":return"";default:return token.value||""}}function getMirrorToken(start){if(start==="{")return"}";if(start==="[")return"]";if(start==="(")return")";return""}function getOriginalText(values){let text="";for(let val of values)if(val.type==="simple-block")text+=(val.associatedToken.originalText||"")+getOriginalText(val.value)+getMirrorToken(val.associatedToken.value);else if(val.type==="function"){let func=val;text+=`${func.name}(${getOriginalText(func.value)})`}else text+=val.originalText||val.value;return text}function serializeIdentifier(id){let result="";for(let i=0;i<id.length;i++){let charCode=id.charCodeAt(i),char=id[i];if(charCode===0){result+="�";continue}if(charCode>=1&&charCode<=31||charCode===127){result+=escapeAsCodePoint(charCode);continue}if(i===0&&charCode>=48&&charCode<=57){result+=escapeAsCodePoint(charCode);continue}if(i===1&&charCode>=48&&charCode<=57&&id.charCodeAt(0)===45){result+=escapeAsCodePoint(charCode);continue}if(i===0&&charCode===45&&id.length===1){result+="\\-";continue}if(charCode>=128||charCode===45||charCode===95||charCode>=48&&charCode<=57||charCode>=65&&charCode<=90||charCode>=97&&charCode<=122){result+=char;continue}result+="\\"+char}return result}function serializeString(s){let result='"';for(let i=0;i<s.length;i++){let charCode=s.charCodeAt(i),char=s[i];if(charCode===0){result+="�";continue}if(charCode>=1&&charCode<=31||charCode===127){result+=escapeAsCodePoint(charCode);continue}if(charCode===34||charCode===92){result+="\\"+char;continue}result+=char}return result+='"',result}function serializeUrl(val){return`url(${serializeString(val)})`}function serializeUrlToken(val,originalText){if(originalText&&!val.includes("�")&&originalText.endsWith(")"))return originalText;let result="";for(let i=0;i<val.length;i++){let charCode=val.charCodeAt(i),char=val[i];if(charCode===34||charCode===39||charCode===40||charCode===41||charCode===92||charCode<=32||charCode===127)result+="\\"+char;else result+=char}return`url(${result})`}function escapeAsCodePoint(charCode){return"\\"+charCode.toString(16)+" "}var logicalShorthandsEntries=Object.entries({"margin-inline":{start:"margin-inline-start",end:"margin-inline-end",allowDifferent:!0},"padding-inline":{start:"padding-inline-start",end:"padding-inline-end",allowDifferent:!0},"margin-block":{start:"margin-block-start",end:"margin-block-end",allowDifferent:!0},"padding-block":{start:"padding-block-start",end:"padding-block-end",allowDifferent:!0},"inset-inline":{start:"inset-inline-start",end:"inset-inline-end",allowDifferent:!0},"inset-block":{start:"inset-block-start",end:"inset-block-end",allowDifferent:!0},"border-inline-width":{start:"border-inline-start-width",end:"border-inline-end-width",allowDifferent:!0},"border-block-width":{start:"border-block-start-width",end:"border-block-end-width",allowDifferent:!0},"border-inline-style":{start:"border-inline-start-style",end:"border-inline-end-style",allowDifferent:!0},"border-block-style":{start:"border-block-start-style",end:"border-block-end-style",allowDifferent:!0},"border-inline-color":{start:"border-inline-start-color",end:"border-inline-end-color",allowDifferent:!0},"border-block-color":{start:"border-block-start-color",end:"border-block-end-color",allowDifferent:!0},"border-inline":{start:"border-inline-start",end:"border-inline-end",allowDifferent:!1},"border-block":{start:"border-block-start",end:"border-block-end",allowDifferent:!1},overflow:{start:"overflow-x",end:"overflow-y",allowDifferent:!0},"overscroll-behavior":{start:"overscroll-behavior-x",end:"overscroll-behavior-y",allowDifferent:!0}}),propertyToGroup={"margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin","margin-inline-start":"margin","margin-inline-end":"margin","margin-block-start":"margin","margin-block-end":"margin","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","padding-inline-start":"padding","padding-inline-end":"padding","padding-block-start":"padding","padding-block-end":"padding",top:"inset",right:"inset",bottom:"inset",left:"inset","inset-inline-start":"inset","inset-inline-end":"inset","inset-block-start":"inset","inset-block-end":"inset","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-inline-start-width":"border-width","border-inline-end-width":"border-width","border-block-start-width":"border-width","border-block-end-width":"border-width","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style","border-inline-start-style":"border-style","border-inline-end-style":"border-style","border-block-start-style":"border-style","border-block-end-style":"border-style","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-inline-start-color":"border-color","border-inline-end-color":"border-color","border-block-start-color":"border-color","border-block-end-color":"border-color",width:"size",height:"size","inline-size":"size","block-size":"size","min-width":"min-size","min-height":"min-size","min-inline-size":"min-size","min-block-size":"min-size","max-width":"max-size","max-height":"max-size","max-inline-size":"max-size","max-block-size":"max-size","border-top-left-radius":"border-radius","border-top-right-radius":"border-radius","border-bottom-right-radius":"border-radius","border-bottom-left-radius":"border-radius","border-start-start-radius":"border-radius","border-start-end-radius":"border-radius","border-end-start-radius":"border-radius","border-end-end-radius":"border-radius","border-top":"border","border-right":"border","border-bottom":"border","border-left":"border","border-block-start":"border","border-block-end":"border","border-inline-start":"border","border-inline-end":"border","overflow-x":"overflow","overflow-y":"overflow","overflow-inline":"overflow","overflow-block":"overflow","overscroll-behavior-x":"overscroll-behavior","overscroll-behavior-y":"overscroll-behavior","overscroll-behavior-inline":"overscroll-behavior","overscroll-behavior-block":"overscroll-behavior","outline-color":"outline","outline-style":"outline","outline-width":"outline","list-style-type":"list-style","list-style-position":"list-style","list-style-image":"list-style","flex-grow":"flex","flex-shrink":"flex","flex-basis":"flex","font-style":"font","font-variant-caps":"font","font-weight":"font","font-stretch":"font","font-size":"font","line-height":"font","font-family":"font","font-variant-ligatures":"font-variant","font-variant-alternates":"font-variant","font-variant-numeric":"font-variant","font-variant-east-asian":"font-variant","font-variant-position":"font-variant","font-variant-emoji":"font-variant"},genericShorthands={"border-top":["border-top-width","border-top-style","border-top-color"],"border-right":["border-right-width","border-right-style","border-right-color"],"border-bottom":["border-bottom-width","border-bottom-style","border-bottom-color"],"border-left":["border-left-width","border-left-style","border-left-color"],"border-block-start":["border-block-start-width","border-block-start-style","border-block-start-color"],"border-block-end":["border-block-end-width","border-block-end-style","border-block-end-color"],"border-inline-start":["border-inline-start-width","border-inline-start-style","border-inline-start-color"],"border-inline-end":["border-inline-end-width","border-inline-end-style","border-inline-end-color"],outline:["outline-color","outline-style","outline-width"],"list-style":["list-style-type","list-style-position","list-style-image"],flex:["flex-grow","flex-shrink","flex-basis"],"border-image":["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"line-clamp":["max-lines","block-ellipsis","continue"]},genericShorthandsEntries=Object.entries(genericShorthands);function checkIntervening(decls,allDecls,declIndices){let indices=decls.map((d)=>declIndices.get(d)),startIdx=Math.min(...indices),endIdx=Math.max(...indices),names=new Set(decls.map((d)=>d.name)),groups=new Set(decls.map((d)=>propertyToGroup[d.name]).filter(Boolean)),isSideShorthand=groups.size>1;for(let i=startIdx+1;i<endIdx;i++){let intervening=allDecls[i];if(names.has(intervening.name))continue;let interveningGroup=propertyToGroup[intervening.name];if(!interveningGroup)continue;if(isSideShorthand){let sidePrefix=decls[0].name.replace(/-(width|style|color)$/,"");if(intervening.name.startsWith(sidePrefix+"-")||["all","border"].includes(intervening.name))return!0}else{if(groups.has(interveningGroup))return!0;if(["all","border"].includes(intervening.name))return!0}}return!1}var BOX_SHORTHAND_NAMES=new Set("margin,padding,border-width,border-style,border-color,scroll-margin,scroll-padding,inset,overflow-clip-margin,border-radius".split(",")),BOX_SHORTHAND_ENTRIES=Object.entries(SHORTHANDS).filter(([shorthand,def])=>BOX_SHORTHAND_NAMES.has(shorthand)&&def.logicalLonghands?.length===4);function tryCombineBoxShorthand(d,declMap,processed,declarations,declIndices){for(let[shorthand,def]of BOX_SHORTHAND_ENTRIES){let{longhands:physical,logicalLonghands:logical}=def,isPhysical=physical.includes(d.name),isLogical=logical.includes(d.name);if(!isPhysical&&!isLogical)continue;let allDecls=(isPhysical?physical:logical).map((name)=>declMap.get(name));if(!allDecls.every((other)=>other&&!processed.has(other)&&other.important===d.important))continue;if(checkIntervening(allDecls,declarations,declIndices))continue;let valuesForContract={};for(let other of allDecls)valuesForContract[other.name]=other.value;let value=def.contract(valuesForContract);if(value!==null){for(let other of allDecls)processed.add(other);return`${shorthand}: ${value}${d.important?" !important":""}`}}return null}function tryCombineLogicalShorthand(d,declMap,processed,declarations,declIndices){for(let[shorthand,longhands]of logicalShorthandsEntries){if(d.name!==longhands.start&&d.name!==longhands.end)continue;let otherName=d.name===longhands.start?longhands.end:longhands.start,otherDecl=declMap.get(otherName);if(!otherDecl||processed.has(otherDecl)||d.important!==otherDecl.important)continue;if(checkIntervening([d,otherDecl],declarations,declIndices))continue;let startDecl=d.name===longhands.start?d:otherDecl,endDecl=d.name===longhands.end?d:otherDecl,valS=serialize(startDecl.value).trim(),valE=serialize(endDecl.value).trim();if(valS===valE)return processed.add(startDecl),processed.add(endDecl),`${shorthand}: ${valS}${d.important?" !important":""}`;if(longhands.allowDifferent&&!valS.includes("var(")&&!valE.includes("var("))return processed.add(startDecl),processed.add(endDecl),`${shorthand}: ${valS} ${valE}${d.important?" !important":""}`}return null}function tryCombineGenericShorthand(d,declMap,processed,declarations,declIndices){for(let[shorthand,longhands]of genericShorthandsEntries){if(!longhands.includes(d.name))continue;let allDecls=longhands.map((name)=>declMap.get(name));if(!allDecls.every((other)=>other&&!processed.has(other)&&other.important===d.important))continue;if(checkIntervening(allDecls,declarations,declIndices))continue;let record={};for(let other of allDecls)record[other.name]=other.value;let contracted=SHORTHANDS[shorthand]?.contract(record);if(contracted!==null&&contracted!==void 0){for(let other of allDecls)processed.add(other);return{name:shorthand,value:contracted,important:d.important}}}return null}var BORDER_PHYSICAL_SIDE_LONGHANDS=["border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color"],BORDER_IMAGE_LONGHAND_NAMES=["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"];function tryCombineBorderFull(d,declMap,processed,declarations,declIndices){if(!BORDER_PHYSICAL_SIDE_LONGHANDS.includes(d.name))return null;let allDecls=BORDER_PHYSICAL_SIDE_LONGHANDS.map((name)=>declMap.get(name));if(!allDecls.every((other)=>other&&!processed.has(other)&&other.important===d.important))return null;if(checkIntervening(allDecls,declarations,declIndices))return null;let imageDecls=BORDER_IMAGE_LONGHAND_NAMES.map((name)=>declMap.get(name)).filter((img)=>Boolean(img&&!processed.has(img)));if(imageDecls.length===0)return null;let imageRecord={"border-image-source":[{type:"ident",value:"none"}],"border-image-slice":[{type:"percentage",value:100,sign:null}],"border-image-width":[{type:"number",value:1,sign:null,numberType:"integer"}],"border-image-outset":[{type:"number",value:0,sign:null,numberType:"integer"}],"border-image-repeat":[{type:"ident",value:"stretch"}]};for(let img of imageDecls)imageRecord[img.name]=img.value;if(!isInitialBorderImage(imageRecord))return null;let record={...imageRecord};for(let other of allDecls)record[other.name]=other.value;let contracted=SHORTHANDS.border?.contract(record);if(contracted!==null&&contracted!==void 0){for(let other of allDecls)processed.add(other);for(let img of imageDecls)processed.add(img);return`border: ${contracted}${d.important?" !important":""}`}return null}var ORDERED_SHORTHAND_COMBINERS=[{name:"font",longhands:SHORTHANDS.font.longhands},{name:"font-variant",longhands:SHORTHANDS["font-variant"].longhands},{name:"background",longhands:["background-image","background-position","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"]},{name:"border-block",longhands:["border-block-start-width","border-block-start-style","border-block-start-color","border-block-end-width","border-block-end-style","border-block-end-color"]},{name:"border-inline",longhands:["border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end-width","border-inline-end-style","border-inline-end-color"]}];function tryCombineNamedShorthand(shorthandName,longhands,d,declMap,processed,declarations,declIndices){if(!longhands.includes(d.name))return null;let allDecls=longhands.map((name)=>declMap.get(name));if(!allDecls.every((other)=>other&&!processed.has(other)&&other.important===d.important))return null;if(checkIntervening(allDecls,declarations,declIndices))return null;let record={};for(let other of allDecls)record[other.name]=other.value;let contracted=SHORTHANDS[shorthandName]?.contract(record);if(contracted!==null&&contracted!==void 0){for(let other of allDecls)processed.add(other);return`${shorthandName}: ${contracted}${d.important?" !important":""}`}return null}var CSS_WIDE_AND_DEFAULT=new Set("initial,inherit,unset,revert,revert-layer,default".split(","));function serializeFontFamilyItem(tokens){let nonWs=tokens.filter((t)=>t.type!=="whitespace"&&t.type!=="comment"&&t.type!=="EOF");if(nonWs.length===1&&nonWs[0].type==="string"){let strVal=nonWs[0].value;if(strVal.startsWith("'")&&strVal.endsWith("'")||strVal.startsWith('"')&&strVal.endsWith('"'))strVal=strVal.slice(1,-1);let lower=strVal.toLowerCase();if(GENERIC_FONT_FAMILIES.has(lower)||CSS_WIDE_AND_DEFAULT.has(lower))return`"${strVal}"`;if(strVal!==strVal.trim()||/\s{2,}|\t|\n|\r/.test(strVal))return`"${strVal}"`;let words=strVal.split(" ");return words.length>0&&words.every((word)=>word.length>0&&!/^[0-9]|^--|^-[0-9]/.test(word)&&/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(word))?strVal:`"${strVal}"`}if(nonWs.every((t)=>t.type==="ident"))return nonWs.map((t)=>serializeNode(t,!1)).join(" ");return tokens.map((t)=>serializeNode(t,!1)).join("")}function serializeFontFamily(values){let groups=[],current=[];for(let token of values)if(token.type==="comma")groups.push(current),current=[];else current.push(token);if(current.length>0)groups.push(current);return groups.map((g)=>serializeFontFamilyItem(g).trim()).filter((s)=>s.length>0).join(", ")}function serializeDeclarations(declarations){if(declarations.length===0)return"";let declMap=new Map,declIndices=new Map;for(let i=0;i<declarations.length;i++){let d=declarations[i];declMap.set(d.name,d),declIndices.set(d,i)}if(declarations.length>=ALL_SHORTHAND_LONGHANDS.length){let firstDecl=declMap.get(ALL_SHORTHAND_LONGHANDS[0]);if(firstDecl){let firstValLower=serialize(firstDecl.value).trim().toLowerCase(),firstImportant=firstDecl.important;if(CSS_WIDE_AND_DEFAULT.has(firstValLower)||firstValLower.startsWith("var(")){if(ALL_SHORTHAND_LONGHANDS.every((lh)=>{let d=declMap.get(lh);return d&&serialize(d.value).trim().toLowerCase()===firstValLower&&d.important===firstImportant})){let allLonghandsSet=new Set(ALL_SHORTHAND_LONGHANDS),allDecl={type:"declaration",name:"all",value:firstDecl.value,important:firstImportant},newDecls=[],inserted=!1;for(let d of declarations)if(allLonghandsSet.has(d.name)){if(!inserted)newDecls.push(allDecl),inserted=!0}else newDecls.push(d);return serializeDeclarations(newDecls)}}}}let processed=new Set,result=[];for(let d of declarations){if(processed.has(d))continue;let combined=tryCombineBorderFull(d,declMap,processed,declarations,declIndices);if(!combined){for(let spec of ORDERED_SHORTHAND_COMBINERS)if(combined=tryCombineNamedShorthand(spec.name,spec.longhands,d,declMap,processed,declarations,declIndices),combined)break}if(!combined)combined=tryCombineBoxShorthand(d,declMap,processed,declarations,declIndices);if(!combined){let generic=tryCombineGenericShorthand(d,declMap,processed,declarations,declIndices);if(generic){let sides=["border-top","border-right","border-bottom","border-left"];if(sides.includes(generic.name)){let sideResults=sides.map((side)=>{if(side===generic.name)return generic;let existing=declMap.get(side);if(existing&&!processed.has(existing))return{name:side,value:serialize(existing.value).trim(),important:existing.important,decl:existing};let longhands=genericShorthands[side];if(!longhands)return null;let sideLonghands=longhands.map((lh)=>declMap.get(lh));if(sideLonghands.every((lh)=>lh&&!processed.has(lh)&&lh.important===generic.important)){if(checkIntervening(sideLonghands,declarations,declIndices))return null;return{name:side,value:sideLonghands.map((lh)=>serialize(lh.value).trim()).filter((v)=>v!=="").join(" "),important:generic.important,longhands:sideLonghands}}return null});if(sideResults.every((r)=>r!==null&&r.value===generic.value&&r.important===generic.important)){for(let r of sideResults)if(r&&"longhands"in r)r.longhands.forEach((lh)=>processed.add(lh));else if(r&&"decl"in r)processed.add(r.decl);combined=`border: ${generic.value}${generic.important?" !important":""}`}else combined=`${generic.name}: ${generic.value}${generic.important?" !important":""}`}else combined=`${generic.name}: ${generic.value}${generic.important?" !important":""}`}}if(!combined)combined=tryCombineLogicalShorthand(d,declMap,processed,declarations,declIndices);if(combined)result.push(combined);else{let isCustom=d.name.startsWith("--"),val;if(d.name==="font-family")val=serializeFontFamily(d.value);else if(d.name==="flex-basis"&&serialize(d.value).trim()==="0")val="0px";else val=d.raw&&!d.raw.includes("var(")?d.raw:serialize(d.value,isCustom,d.name).trim();result.push(`${serializeIdentifier(d.name)}: ${val}${d.important?" !important":""}`),processed.add(d)}}return result.join("; ")+";"}function serializeSelectorList(list,nsContext){let context={hasDefaultNamespace:typeof nsContext==="boolean"?nsContext:Boolean(nsContext?.hasDefaultNamespace),defaultNamespacePrefixes:typeof nsContext==="object"&&nsContext!==null?nsContext.defaultNamespacePrefixes:void 0};return list.selectors.map((s)=>s.type==="invalid-selector"?serialize(s.tokens):serializeComplexSelector(s,context)).join(", ")}function serializeComplexSelector(complex,nsContext){let{hasDefaultNamespace,defaultNamespacePrefixes}=nsContext;return complex.items.map((item,idx)=>{if(item.type==="combinator"){if(item.value===" ")return" ";return idx===0?`${item.value} `:` ${item.value} `}return item.selectors.filter((s,sIdx)=>{if(s.type==="universal-selector"&&item.selectors.length>1&&sIdx===0){let isDefaultNs=s.namespace!==void 0&&s.namespace!==""&&defaultNamespacePrefixes?.has(s.namespace);if(s.namespace===void 0||isDefaultNs||s.namespace==="*"&&!hasDefaultNamespace)return!1}return!0}).map((s)=>serializeSimpleSelector(s,nsContext)).join("")}).join("")}function formatAnPlusB(tokens){let parsed=parseAnPlusB(tokens);if(parsed===null)return serialize(tokens).trim();let{a,b}=parsed;if(a===0)return b.toString();let partA=a===1?"n":a===-1?"-n":`${a}n`;if(b===0)return partA;return b>0?`${partA}+${b}`:`${partA}${b}`}function formatSelectorNamespacePrefix(namespace,nsContext,isElementSelector){if(namespace===void 0)return"";if(isElementSelector&&namespace!==""&&nsContext.defaultNamespacePrefixes?.has(namespace))return"";if(namespace==="*")return!isElementSelector||nsContext.hasDefaultNamespace?"*|":"";if(namespace==="")return isElementSelector?"|":"";return`${serializeIdentifier(namespace)}|`}var NTH_PSEUDO_CLASSES=new Set("nth-child,nth-last-child,nth-of-type,nth-last-of-type".split(","));function serializeSimpleSelector(simple,nsContext){switch(simple.type){case"type-selector":return formatSelectorNamespacePrefix(simple.namespace,nsContext,!0)+serializeIdentifier(simple.name);case"universal-selector":return formatSelectorNamespacePrefix(simple.namespace,nsContext,!0)+"*";case"id-selector":return"#"+serializeIdentifier(simple.name);case"class-selector":return"."+serializeIdentifier(simple.name);case"attribute-selector":{let attr="["+formatSelectorNamespacePrefix(simple.namespace,nsContext,!1)+serializeIdentifier(simple.name);if(simple.operator)attr+=simple.operator+serializeString(simple.value||"");if(simple.flags)attr+=" "+simple.flags;return attr+"]"}case"pseudo-class-selector":{let pc=`:${simple.name}`,isNth=NTH_PSEUDO_CLASSES.has(simple.name.toLowerCase());if(simple.argument)if("type"in simple.argument&&simple.argument.type==="selector-list"){let selStr=serializeSelectorList(simple.argument,nsContext);pc+=isNth&&simple.nth?`(${formatAnPlusB(simple.nth)} of ${selStr})`:`(${selStr})`}else{let tokens=simple.argument;pc+=`(${isNth?formatAnPlusB(tokens):serialize(tokens).trim()})`}return pc}case"pseudo-element-selector":{let pe=`::${simple.name}`;if(simple.argument)pe+="type"in simple.argument&&simple.argument.type==="selector-list"?`(${serializeSelectorList(simple.argument,nsContext)})`:`(${serialize(simple.argument).trim()})`;return pe}case"nesting-selector":return"&";default:return""}}var AbstractTokenizer=class{unicodeRangesAllowed=!1;errors=[];parseError(message){this.errors.push({message}),console.warn(`CSS Parse Error: ${message}`)}consumeToken(){while(!0){this.consumeComments();let cp=this.consume();if(cp===-1)return{type:"EOF",value:""};if(this.isWhitespace(cp)){while(this.isWhitespace(this.cp))this.consume();return{type:"whitespace",value:" "}}switch(cp){case 34:return this.consumeStringToken(34);case 35:if(this.isIdentCodePoint(this.cp)||this.isValidEscape(this.cp,this.peek(1))){let token={type:"hash",value:"",hashType:"unrestricted"};if(this.wouldStartIdentSequence(this.cp,this.peek(1),this.peek(2)))token.hashType="id";return token.value=this.consumeIdentSequence(),token}return{type:"delim",value:String.fromCodePoint(cp)};case 39:return this.consumeStringToken(39);case 40:return{type:"(",value:"("};case 41:return{type:")",value:")"};case 43:if(this.wouldStartNumber(cp,this.cp,this.peek(1)))return this.reconsume(),this.consumeNumericToken();return{type:"delim",value:"+"};case 44:return{type:"comma",value:","};case 45:if(this.wouldStartNumber(cp,this.cp,this.peek(1)))return this.reconsume(),this.consumeNumericToken();if(this.cp===45&&this.peek(1)===62)return this.consume(),this.consume(),{type:"CDC",value:"-->"};if(this.wouldStartIdentSequence(cp,this.cp,this.peek(1)))return this.reconsume(),this.consumeIdentLikeToken();return{type:"delim",value:"-"};case 46:if(this.wouldStartNumber(cp,this.cp,this.peek(1)))return this.reconsume(),this.consumeNumericToken();return{type:"delim",value:"."};case 47:return{type:"delim",value:"/"};case 58:return{type:"colon",value:":"};case 59:return{type:"semicolon",value:";"};case 60:if(this.cp===33&&this.peek(1)===45&&this.peek(2)===45)return this.consume(),this.consume(),this.consume(),{type:"CDO",value:"<!--"};return{type:"delim",value:"<"};case 64:if(this.wouldStartIdentSequence(this.cp,this.peek(1),this.peek(2)))return{type:"at-keyword",value:this.consumeIdentSequence()};return{type:"delim",value:"@"};case 91:return{type:"[",value:"["};case 92:if(this.isValidEscape(cp,this.cp))return this.reconsume(),this.consumeIdentLikeToken();return this.parseError("Invalid escape sequence"),{type:"delim",value:"\\"};case 93:return{type:"]",value:"]"};case 123:return{type:"{",value:"{"};case 125:return{type:"}",value:"}"}}if(this.isDigit(cp))return this.reconsume(),this.consumeNumericToken();if(this.isIdentStartCodePoint(cp)){if(this.reconsume(),this.unicodeRangesAllowed&&this.wouldStartUnicodeRange(this.cp,this.peek(1),this.peek(2)))return this.consume(),this.consume(),this.consumeUnicodeRangeToken();return this.consumeIdentLikeToken()}return{type:"delim",value:String.fromCodePoint(cp)}}}consumeComments(){while(this.cp===47&&this.peek(1)===42){this.consume(),this.consume();while(!0){let cp=this.consume();if(cp===-1){this.parseError("EOF reached before comment was closed");return}if(cp===42&&this.cp===47){this.consume();break}}}}consumeNumericToken(){let number=this.consumeNumber();if(this.wouldStartIdentSequence(this.cp,this.peek(1),this.peek(2))){let unit=this.consumeIdentSequence();return{type:"dimension",value:number.value,unit,numberType:number.type,sign:number.sign}}if(this.cp===37)return this.consume(),{type:"percentage",value:number.value,sign:number.sign};return{type:"number",value:number.value,numberType:number.type,sign:number.sign}}consumeIdentLikeToken(){let string=this.consumeIdentSequence();if(string.toLowerCase()==="url"&&this.cp===40){this.consume();while(this.isWhitespace(this.cp)&&this.isWhitespace(this.peek(1)))this.consume();let currentCp=this.cp;if(currentCp===34||currentCp===39||this.isWhitespace(currentCp)&&(this.peek(1)===34||this.peek(1)===39))return{type:"function",value:string};return this.consumeUrlToken()}if(this.cp===40)return this.consume(),{type:"function",value:string};return{type:"ident",value:string}}consumeStringToken(endingCodePoint){let startPos=this.getPosition(),hasEscapes=!1,result="";while(!0){let cp=this.consume();if(cp===endingCodePoint||cp===-1){if(cp===-1)this.parseError("EOF reached before string was closed");if(!hasEscapes){let lengthOffset=cp===-1?0:1;return{type:"string",value:this.slice(startPos,this.getPosition()-lengthOffset)}}return{type:"string",value:result}}if(this.isNewline(cp)){if(this.parseError("Newline reached before string was closed"),this.reconsume(),!hasEscapes)return{type:"bad-string",value:this.slice(startPos,this.getPosition())};return{type:"bad-string",value:result}}if(cp===92){if(!hasEscapes)hasEscapes=!0,this.reconsume(),result=this.slice(startPos,this.getPosition()),this.consume();if(this.cp===-1);else if(this.isNewline(this.cp))this.consume();else result+=String.fromCodePoint(this.consumeEscapedCodePoint())}else if(hasEscapes)result+=String.fromCodePoint(cp)}}consumeUrlToken(){let value="";while(this.isWhitespace(this.cp))this.consume();while(!0){let cp=this.consume();if(cp===41||cp===-1){if(cp===-1)this.parseError("EOF reached before URL was closed");return{type:"url",value}}if(this.isWhitespace(cp)){while(this.isWhitespace(this.cp))this.consume();if(this.cp===41||this.cp===-1){if(this.cp===-1)this.parseError("EOF reached before URL was closed");return this.consume(),{type:"url",value}}return this.consumeRemnantsOfBadUrl(),{type:"bad-url",value}}if(cp===34||cp===39||cp===40||this.isNonPrintable(cp))return this.parseError("Invalid character in URL"),this.consumeRemnantsOfBadUrl(),{type:"bad-url",value};if(cp===92)if(this.isValidEscape(cp,this.cp))value+=String.fromCodePoint(this.consumeEscapedCodePoint());else return this.parseError("Invalid escape sequence in URL"),this.consumeRemnantsOfBadUrl(),{type:"bad-url",value};else value+=String.fromCodePoint(cp)}}consumeEscapedCodePoint(){let cp=this.consume();if(this.isHexDigit(cp)){let hex=String.fromCodePoint(cp),count=1;while(count<6&&this.isHexDigit(this.cp))hex+=String.fromCodePoint(this.consume()),count++;if(this.isWhitespace(this.cp))this.consume();let value=parseInt(hex,16);if(value===0||value>=55296&&value<=57343||value>1114111)return 65533;return value}if(cp===-1)return this.parseError("EOF reached in escape sequence"),65533;return cp}isValidEscape(cp1,cp2){if(cp1!==92)return!1;if(this.isNewline(cp2))return!1;return!0}wouldStartIdentSequence(cp1,cp2,cp3){if(cp1===45){if(this.isIdentStartCodePoint(cp2)||cp2===45)return!0;if(this.isValidEscape(cp2,cp3))return!0;return!1}if(this.isIdentStartCodePoint(cp1))return!0;if(cp1===92){if(this.isValidEscape(cp1,cp2))return!0;return!1}return!1}wouldStartNumber(cp1,cp2,cp3){if(cp1===43||cp1===45){if(this.isDigit(cp2))return!0;if(cp2===46&&this.isDigit(cp3))return!0;return!1}if(cp1===46){if(this.isDigit(cp2))return!0;return!1}if(this.isDigit(cp1))return!0;return!1}consumeIdentSequence(){let startPos=this.getPosition(),hasEscapes=!1,result="";while(!0){let cp=this.consume();if(this.isIdentCodePoint(cp)){if(hasEscapes)result+=String.fromCodePoint(cp)}else if(this.isValidEscape(cp,this.cp)){if(!hasEscapes)hasEscapes=!0,this.reconsume(),result=this.slice(startPos,this.getPosition()),this.consume();result+=String.fromCodePoint(this.consumeEscapedCodePoint())}else{if(cp!==-1)this.reconsume();break}}if(!hasEscapes)return this.slice(startPos,this.getPosition());return result}consumeNumber(){let type="integer",sign=null;if(this.cp===43)sign="+",this.consume();else if(this.cp===45)sign="-",this.consume();let value=0,power=0;while(this.isDigit(this.cp))value=value*10+(this.cp-48),this.consume();if(this.cp===46&&this.isDigit(this.peek(1))){this.consume(),type="number";while(this.isDigit(this.cp))value=value*10+(this.cp-48),power--,this.consume()}let exp=0,expSign=1,currentCp=this.cp;if((currentCp===69||currentCp===101)&&(this.isDigit(this.peek(1))||(this.peek(1)===43||this.peek(1)===45)&&this.isDigit(this.peek(2)))){this.consume();let nextCp=this.cp;if(nextCp===43)this.consume();else if(nextCp===45)expSign=-1,this.consume();while(this.isDigit(this.cp))exp=exp*10+(this.cp-48),this.consume();type="number"}if(value=value*Math.pow(10,power+expSign*exp),sign==="-")value=-value;return{value,type,sign}}consumeRemnantsOfBadUrl(){while(!0){let cp=this.consume();if(cp===41||cp===-1)break;if(this.isValidEscape(cp,this.cp))this.consumeEscapedCodePoint()}}wouldStartUnicodeRange(cp1,cp2,cp3){if(cp1!==85&&cp1!==117)return!1;if(cp2!==43)return!1;if(cp3===63||this.isHexDigit(cp3))return!0;return!1}consumeUnicodeRangeToken(){let hex="",hasQuestionMarks=!1;while(hex.length<6&&this.isHexDigit(this.cp))hex+=String.fromCodePoint(this.consume());let questionMarks="";while(hex.length+questionMarks.length<6&&this.cp===63)questionMarks+=String.fromCodePoint(this.consume()),hasQuestionMarks=!0;if(hasQuestionMarks){let startStr=hex+questionMarks.replace(/\?/g,"0"),endStr=hex+questionMarks.replace(/\?/g,"F"),start=parseInt(startStr,16),end=parseInt(endStr,16);return{type:"unicode-range",value:`U+${start.toString(16).toUpperCase()}-${end.toString(16).toUpperCase()}`,unicodeRangeStart:start,unicodeRangeEnd:end}}let start=parseInt(hex,16);if(this.cp===45&&this.isHexDigit(this.peek(1))){this.consume();let endHex="";while(endHex.length<6&&this.isHexDigit(this.cp))endHex+=String.fromCodePoint(this.consume());let end=parseInt(endHex,16);return{type:"unicode-range",value:`U+${start.toString(16).toUpperCase()}-${end.toString(16).toUpperCase()}`,unicodeRangeStart:start,unicodeRangeEnd:end}}return{type:"unicode-range",value:`U+${start.toString(16).toUpperCase()}`,unicodeRangeStart:start,unicodeRangeEnd:start}}startsComment(){return this.cp===47&&this.peek(1)===42}isWhitespace(cp){return cp===10||cp===9||cp===32}isNewline(cp){return cp===10}isDigit(cp){return cp>=48&&cp<=57}isHexDigit(cp){return this.isDigit(cp)||cp>=65&&cp<=70||cp>=97&&cp<=102}isIdentStartCodePoint(cp){return cp>=65&&cp<=90||cp>=97&&cp<=122||cp===95||this.isNonAsciiIdentCodePoint(cp)}isIdentCodePoint(cp){return this.isIdentStartCodePoint(cp)||this.isDigit(cp)||cp===45}isNonAsciiIdentCodePoint(cp){return cp===183||cp>=192&&cp<=214||cp>=216&&cp<=246||cp>=248&&cp<=893||cp>=895&&cp<=8191||cp===8204||cp===8205||cp===8255||cp===8256||cp>=8304&&cp<=8591||cp>=11264&&cp<=12271||cp>=12289&&cp<=55295||cp>=63744&&cp<=64975||cp>=65008&&cp<=65533||cp>=65536}isNonPrintable(cp){return cp>=0&&cp<=8||cp===11||cp>=14&&cp<=31||cp===127}};function tokenize(input,unicodeRangesAllowed=!1,errors){let tokenizer=new Tokenizer2(input);tokenizer.unicodeRangesAllowed=unicodeRangesAllowed;let tokens=tokenizer.tokenize();if(errors)errors.push(...tokenizer.errors);return tokens}var Tokenizer2=class extends AbstractTokenizer{input;pos=0;constructor(input){super();this.input=this.preprocess(input)}preprocess(input){return input.replace(/\r\n/g,`
|
|
14
|
+
`).replace(/\r/g,`
|
|
15
|
+
`).replace(/\f/g,`
|
|
16
|
+
`).replace(/\0/g,"�").replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�")}tokenize(){let tokens=[];while(!0){let start=this.getPosition(),token=this.consumeToken();if(token.startIndex=start,token.endIndex=this.getPosition(),token.originalText=this.input.slice(start,token.endIndex),tokens.push(token),token.type==="EOF")break}return tokens}get cp(){return this.pos<this.input.length?this.input.codePointAt(this.pos):-1}peek(offset){let index=this.pos;for(let i=0;i<offset;i++){if(index>=this.input.length)return-1;let cp=this.input.codePointAt(index);index+=cp>65535?2:1}return index<this.input.length?this.input.codePointAt(index):-1}consume(){let cp=this.cp;if(cp!==-1)this.pos+=cp>65535?2:1;return cp}reconsume(){if(this.pos>0){this.pos--;let codeUnit=this.input.charCodeAt(this.pos);if(codeUnit>=56320&&codeUnit<=57343&&this.pos>0){let prevCodeUnit=this.input.charCodeAt(this.pos-1);if(prevCodeUnit>=55296&&prevCodeUnit<=56319)this.pos--}}}slice(start,end){return this.input.slice(start,end)}getPosition(){return this.pos}},CSSStyleProperties=class{};Object.defineProperty(CSSStyleProperties.prototype,"cssFloat",{get(){let target=this;return typeof target.getPropertyValue==="function"?target.getPropertyValue("float"):target._float??""},set(val){let target=this,strVal=val===null||val===void 0?"":String(val);if(typeof target.setProperty==="function")target.setProperty("float",strVal);else target._float=strVal},enumerable:!0,configurable:!0});var StyleSheet=class{_type="text/css";_href=null;_ownerNode=null;_parentStyleSheet=null;_titleVal=null;_media;_disabledFlag=!1;get type(){return this._type}get href(){return this._href}get ownerNode(){return this._ownerNode}get parentStyleSheet(){return this._parentStyleSheet}get title(){if(this.ownerNode&&"getAttribute"in this.ownerNode&&typeof this.ownerNode.getAttribute==="function"){let t=this.ownerNode.getAttribute("title");return t===null||t===""?null:t}return this._titleVal??null}constructor(mediaText=""){this._media=new MediaList(mediaText),hideInternalFields(this)}get media(){return this._media}set media(value){if(value===null)this._media.mediaText="";else if(typeof value==="string")this._media.mediaText=value;else this._media.mediaText=value.mediaText}get disabled(){return this._disabledFlag}set disabled(value){this._disabledFlag=value}},CSSStyleSheet=class CSSStyleSheet extends StyleSheet{_ownerRule=null;_cssRules;_rules=[];_registeredProperties=[];_originCleanFlag=!0;_constructed=!1;get _constructedFlag(){return this._constructed}set _constructedFlag(val){this._constructed=val}_disallowModificationFlag=!1;_baseURL=null;get ownerRule(){return this._ownerRule}_initImportedSheet(ownerRule,parentStyleSheet,href){this._ownerRule=ownerRule,this._parentStyleSheet=parentStyleSheet,this._href=href}get parentStyleSheet(){if(this._ownerRule)return this._ownerRule.parentStyleSheet;return super.parentStyleSheet}get cssRules(){if(!this._originCleanFlag)throw new DOMException("The stylesheet is not origin-clean","SecurityError");return this._cssRules}_registerRuleProperties(rule){if(rule instanceof CSSPropertyRule){if(ParseHooks.registerPropertyRule({name:rule.name,syntax:rule.syntax,inherits:rule.inherits,initialValue:rule.initialValue??void 0}))this._registeredProperties.push(rule.name)}else if(rule instanceof CSSGroupingRule||rule&&typeof rule==="object"&&"cssRules"in rule){let childRules=rule.cssRules;if(childRules)for(let i=0;i<childRules.length;i++)this._registerRuleProperties(childRules[i])}}_unregisterProperties(){for(let name of this._registeredProperties)ParseHooks.unregisterPropertyRule(name);this._registeredProperties=[]}constructor(options={}){let mediaText=options.media instanceof MediaList?options.media.mediaText:options.media||"";super(mediaText);if(this._rules=[],this._constructed=!0,this._originCleanFlag=!0,this.disabled=!!options.disabled,options.baseURL!==void 0&&options.baseURL!==null){let baseURI=typeof globalThis.document<"u"&&globalThis.document.baseURI||typeof globalThis.location<"u"&&globalThis.location.href||"about:blank";try{let url=new URL(options.baseURL,baseURI);this._baseURL=url.href}catch{throw new DOMException("Invalid baseURL","NotAllowedError")}}else this._baseURL=null;this._cssRules=new CSSRuleList(()=>this._rules),hideInternalFields(this)}static createInternal(rules,_parseRule,originClean=!0){let sheet=new CSSStyleSheet;sheet._rules.push(...rules),sheet._constructed=!1,sheet._originCleanFlag=originClean;for(let rule of rules){if(rule instanceof CSSRule)rule._parentStyleSheet=sheet;sheet._registerRuleProperties(rule)}return sheet}_replaceRulesFromText(text){let filteredRules=consumeListOfRules(tokenize(text),!0,{source:text}).filter((rule)=>{if(isImportRule(rule))return console.warn("CSS Parse Error: @import rules are not allowed in constructed stylesheets and were removed."),!1;return!0});for(let rule of this._rules)if(rule instanceof CSSRule)rule._parentRule=null,rule._parentStyleSheet=null;this._unregisterProperties(),this._rules=filteredRules;for(let rule of this._rules){if(rule instanceof CSSRule)rule._parentStyleSheet=this,rule._parentRule=null;this._registerRuleProperties(rule)}}replace(text){if(!this._constructed||this._disallowModificationFlag)return Promise.reject(new DOMException("Can't call replace or replaceSync on non-constructed stylesheets.","NotAllowedError"));return this._disallowModificationFlag=!0,new Promise((resolve,reject)=>{queueMicrotask(()=>{try{this._replaceRulesFromText(text),this._disallowModificationFlag=!1,resolve(this)}catch(e){this._disallowModificationFlag=!1,reject(e)}})})}replaceSync(text){if(!this._constructed)throw new DOMException("Can't call replace or replaceSync on non-constructed stylesheets.","NotAllowedError");if(this._disallowModificationFlag)throw new DOMException("Modification is disallowed","NotAllowedError");this._replaceRulesFromText(text)}insertRule(rule,index=0){if(this._disallowModificationFlag)throw new DOMException("Modification is disallowed","NotAllowedError");if(!this._originCleanFlag)throw new DOMException("The style sheet is not origin-clean.","SecurityError");if(index<0||index>this._rules.length)throw new DOMException("Index size error","IndexSizeError");let parsedRule=parseRule(rule);if(!parsedRule)throw new DOMException("Syntax error","SyntaxError");let isImport=isImportRule(parsedRule),isNamespace=isNamespaceRule(parsedRule);if(isImport&&this._constructed)throw new DOMException("HierarchyRequestError: @import rules are not allowed in constructed stylesheets","SyntaxError");if(isImport){for(let i=0;i<index;i++)if(!isImportRule(this._rules[i]))throw new DOMException("HierarchyRequestError: @import rules must precede all other rules","HierarchyRequestError")}else if(isNamespace){if(this._rules.some((r)=>isRegularRule(r)))throw new DOMException("InvalidStateError: @namespace rules must precede all regular rules","InvalidStateError");for(let i=index;i<this._rules.length;i++)if(isImportRule(this._rules[i]))throw new DOMException("HierarchyRequestError: @namespace rules must follow all @import rules","HierarchyRequestError")}else for(let i=index;i<this._rules.length;i++)if(isImportRule(this._rules[i])||isNamespaceRule(this._rules[i]))throw new DOMException("HierarchyRequestError: Regular rules must follow all @import and @namespace rules","HierarchyRequestError");if(parsedRule instanceof CSSRule)parsedRule._parentStyleSheet=this,parsedRule._parentRule=null;return this._rules.splice(index,0,parsedRule),this._registerRuleProperties(parsedRule),index}deleteRule(index){if(this._disallowModificationFlag)throw new DOMException("Modification is disallowed","NotAllowedError");if(!this._originCleanFlag)throw new DOMException("The style sheet is not origin-clean.","SecurityError");if(index<0||index>=this._rules.length)throw new DOMException("Index size error","IndexSizeError");let rule=this._rules[index];if(isNamespaceRule(rule)&&this._rules.some((r)=>isRegularRule(r)))throw new DOMException("InvalidStateError: Cannot remove @namespace rule when regular rules exist","InvalidStateError");if(deleteRuleFromArray(this._rules,index),rule instanceof CSSPropertyRule){ParseHooks.unregisterPropertyRule(rule.name);let idx=this._registeredProperties.indexOf(rule.name);if(idx!==-1)this._registeredProperties.splice(idx,1)}}get rules(){return this.cssRules}addRule(selector="undefined",style="undefined",optionalIndex){let rule="";if(rule+=selector,rule+=" { ",style!=="")rule+=style+" ";rule+="}";let index=optionalIndex!==void 0?optionalIndex:this._rules.length;return this.insertRule(rule,index),-1}removeRule(index=0){this.deleteRule(index)}},CSSStyleRule=class CSSStyleRule extends CSSGroupingRule{_selectorText;_selectorAST=null;_style;_styleMap=null;constructor(selectorText,styleDeclarations,rules,parseRuleInBlock,selectorAST=null){super(rules,parseRuleInBlock);this._selectorText=selectorText,this._selectorAST=selectorAST,this._style=new CSSStyleDeclaration2(styleDeclarations),this._style._parentRule=this,hideInternalFields(this)}get styleMap(){if(!this||!(this instanceof CSSStyleRule))throw TypeError("Value of 'this' is not a CSSStyleRule");if(!this._styleMap)this._styleMap=ParseHooks.createStylePropertyMap(this._style);return this._styleMap}get style(){return this._style}set style(value){this._style.cssText=value}_getNamespaceContext(){let hasDefaultNamespace=!1,defaultNamespacePrefixes=new Set,sheet=this.parentStyleSheet||(this.parentRule?findParentStyleSheet(this.parentRule):null);if(sheet){let nsRules=Array.from(sheet.cssRules).filter((r)=>r.type===10),defaultNs=nsRules.find((ns)=>ns.prefix==="");if(defaultNs){hasDefaultNamespace=!0;for(let ns of nsRules)if(ns.namespaceURI===defaultNs.namespaceURI&&ns.prefix!=="")defaultNamespacePrefixes.add(ns.prefix)}}return{hasDefaultNamespace,defaultNamespacePrefixes}}get selectorText(){if(this._selectorAST){let nsContext=this._getNamespaceContext();return serializeSelectorList(this._selectorAST,nsContext)}return this._selectorText}set selectorText(value){let sheet=this.parentStyleSheet||(this.parentRule?findParentStyleSheet(this.parentRule):null),declaredNamespaces=new Set(sheet?Array.from(sheet.cssRules).filter((r)=>r.type===10).map((r)=>r.prefix):[]),nsContext=this._getNamespaceContext(),isNested=!1,allowRelative=!1,currParent=this.parentRule;while(currParent!==null){if(currParent.type===1||currParent[Symbol.toStringTag]==="CSSStyleRule")isNested=!0,allowRelative=!0;if(currParent[Symbol.toStringTag]==="CSSScopeRule"){allowRelative=!0;break}currParent=currParent.parentRule}let selectorAST=null;try{selectorAST=parseSelectorAST(value,declaredNamespaces,allowRelative)}catch{return}if(selectorAST!==null){if(isNested){for(let selector of selectorAST.selectors)if(selector.type==="complex-selector"){if(selector.items.length>0&&selector.items[0].type==="combinator")selector.items.unshift({type:"compound-selector",selectors:[{type:"nesting-selector"}]});else if(!selector.items.some((item)=>{if(item.type==="compound-selector")return item.selectors.some((s)=>s.type==="nesting-selector");return!1}))selector.items.unshift({type:"compound-selector",selectors:[{type:"nesting-selector"}]},{type:"combinator",value:" "})}}this._selectorAST=selectorAST,this._selectorText=serializeSelectorList(selectorAST,nsContext)}}get type(){return 1}get cssText(){let declsStr=serializeDeclarations(this.style._declarations);if(this._rules.length>0){let bodyParts=[];if(declsStr)bodyParts.push(" "+declsStr);for(let r of this._rules){let text=r.cssText;if(text!=="")bodyParts.push(" "+text)}if(bodyParts.length===0)return`${this.selectorText} { }`;return`${this.selectorText} {
|
|
17
|
+
${bodyParts.join(`
|
|
18
|
+
`)}
|
|
19
|
+
}`}else{let bodyText=declsStr.trim();return`${this.selectorText} {${bodyText?" "+bodyText+" ":" "}}`}}set cssText(_value){}};Object.defineProperty(CSSStyleRule.prototype,"styleMap",{enumerable:!0});var cssomClasses=[StyleSheet,CSSStyleSheet,CSSRule,CSSGroupingRule,MediaList,StyleSheetList,CSSRuleList,CSSStyleRule,CSSStyleProperties];for(let ctor of cssomClasses)if(ctor===CSSStyleSheet)applyWebIDLInterface(ctor,{rejectOperations:["replace"]});else if(ctor===CSSRule)applyWebIDLInterface(ctor,{exclude:["location"]});else applyWebIDLInterface(ctor);var INTERNAL_RULE_TOKEN=Symbol("CSSRule.internal"),CSSConditionRule=class extends CSSGroupingRule{get conditionText(){return""}},CSSMediaRule=class extends CSSConditionRule{_media;constructor(mediaText,rules,parseRuleInBlock){super(rules,parseRuleInBlock);this._media=new MediaList(mediaText),hideInternalFields(this)}get media(){return this._media}set media(val){this._media.mediaText=val===null?"":String(val)}get conditionText(){return this._media.mediaText}get type(){return 4}get cssText(){return serializeGroupingRule("media",this._media.mediaText,this._rules)}set cssText(_value){}},CSSCustomMediaRule=class extends CSSRule{_name;_query;constructor(name,query){super();this._name=name,this._query=query,hideInternalFields(this)}get name(){return this._name}get query(){return this._query}get cssText(){let queryStr=typeof this._query==="boolean"?String(this._query):this._query.mediaText;return`@custom-media ${this._name}${queryStr?" "+queryStr:""};`}set cssText(_value){}},CSSSupportsRule=class extends CSSConditionRule{_conditionText;constructor(conditionText,rules,parseRuleInBlock){super(rules,parseRuleInBlock);this._conditionText=conditionText,hideInternalFields(this)}get conditionText(){return this._conditionText}get matches(){return ParseHooks.supports(this._conditionText)}get type(){return 12}get cssText(){return serializeGroupingRule("supports",this._conditionText,this._rules)}set cssText(_value){}},CONTAINER_KEYWORDS=new Set("not,and,or,none".split(","));function parseContainerPrelude(containerQuery,containerName){if(containerName||!containerQuery)return{name:containerName,query:containerQuery};let trimmed=containerQuery.trim(),firstSpace=trimmed.indexOf(" ");if(firstSpace>0){let potentialName=trimmed.slice(0,firstSpace);if(!CONTAINER_KEYWORDS.has(potentialName.toLowerCase())&&!potentialName.startsWith("("))return{name:potentialName,query:trimmed.slice(firstSpace+1).trim()}}else if(!CONTAINER_KEYWORDS.has(trimmed.toLowerCase())&&!trimmed.startsWith("("))return{name:trimmed,query:""};return{name:"",query:trimmed}}var CSSContainerRule=class extends CSSConditionRule{_containerName;_containerQuery;constructor(containerQuery,rules,parseRuleInBlock,containerName=""){super(rules,parseRuleInBlock);let parsed=parseContainerPrelude(containerQuery,containerName);this._containerName=parsed.name,this._containerQuery=parsed.query,hideInternalFields(this)}get containerName(){return this._containerName}get containerQuery(){return this._containerQuery}get conditionText(){if(this._containerName)return this._containerQuery?`${this._containerName} ${this._containerQuery}`:this._containerName;return this._containerQuery}get cssText(){return serializeGroupingRule("container",this.conditionText,this._rules)}set cssText(_value){}};function serializeLayerName(name){return name?name.split(".").map((p)=>serializeIdentifier(p)).join("."):""}function formatInlineStyleBlock(prefix,style){let body=style.cssText.trim();return`${prefix} {${body?" "+body+" ":""}}`}var CSSLayerBlockRule=class extends CSSGroupingRule{_name;constructor(name,rules,parseRuleInBlock){super(rules,parseRuleInBlock);this._name=name,hideInternalFields(this)}get name(){return this._name}get cssText(){return serializeGroupingRule("layer",serializeLayerName(this._name),this._rules)}set cssText(_value){}},CSSLayerStatementRule=class extends CSSRule{_nameList;constructor(nameList){if(!nameList||arguments.length===0)throw TypeError("Illegal constructor");super();this._nameList=Object.freeze([...nameList]),hideInternalFields(this)}get nameList(){return this._nameList}get cssText(){return`@layer ${this._nameList.map(serializeLayerName).join(", ")};`}set cssText(_value){}},CSSStartingStyleRule=class extends CSSGroupingRule{constructor(_prelude,rules,parseRuleInBlock){super(rules,parseRuleInBlock)}get cssText(){return serializeGroupingRule("starting-style","",this._rules)}set cssText(_value){}},CSSScopeRule=class extends CSSGroupingRule{_startSelector;_endSelector;constructor(startSelector,endSelector,rules,parseRuleInBlock){super(rules,parseRuleInBlock);this._startSelector=startSelector,this._endSelector=endSelector,hideInternalFields(this)}get start(){return this._startSelector?this._startSelector.replace(/^\(/,"").replace(/\)$/,"").trim()||null:null}get end(){return this._endSelector?this._endSelector.replace(/^\(/,"").replace(/\)$/,"").trim()||null:null}get cssText(){let prelude=this._startSelector||"";if(this._endSelector)prelude+=`${prelude?" ":""}to ${this._endSelector}`;return serializeGroupingRule("scope",prelude,this._rules)}set cssText(_value){}},CSSViewTransitionRule=class extends CSSRule{_navigation;constructor(declarations){super();let navDecl=declarations.findLast((d)=>d.name==="navigation");this._navigation=navDecl?serialize(navDecl.value).trim():"none",hideInternalFields(this)}get navigation(){return this._navigation}get cssText(){return`@view-transition { navigation: ${this._navigation}; }`}set cssText(_value){}};function normalizeKeyframeSelector(selector){let normalized=[];for(let part of selector.split(",")){let trimmed=part.trim().toLowerCase();if(trimmed==="from")normalized.push("0%");else if(trimmed==="to")normalized.push("100%");else{if(!trimmed.endsWith("%"))throw new DOMException("Invalid keyframe selector","SyntaxError");let valStr=trimmed.slice(0,-1).trim(),val=Number(valStr);if(Number.isNaN(val)||valStr===""||val<0||val>100)throw new DOMException("Invalid keyframe selector","SyntaxError");normalized.push(`${val}%`)}}if(normalized.length===0)throw new DOMException("Invalid keyframe selector","SyntaxError");return normalized.join(", ")}var DISALLOWED_KEYFRAME_NAMES=new Set("none,initial,inherit,unset,revert,default".split(",")),CSSKeyframesRule=class extends CSSRule{_name;_rules;_cssRules;constructor(name,rules){super();this._name=name,this._rules=rules,this._cssRules=new CSSRuleList(()=>this._rules);let proxy=createIndexedProxy(this,(t)=>t._rules);for(let rule of rules)if(rule instanceof CSSRule)rule._parentRule=proxy;return proxy}get name(){return this._name}set name(val){this._name=val}get cssRules(){return this._cssRules}get type(){return 7}get length(){return this._rules.length}get cssText(){return serializeGroupingRule("keyframes",DISALLOWED_KEYFRAME_NAMES.has(this._name.toLowerCase())?JSON.stringify(this._name):serializeIdentifier(this._name),this._rules)}set cssText(_value){}_findRuleIndex(select){let normalized;try{normalized=normalizeKeyframeSelector(select)}catch{return-1}for(let i=this._rules.length-1;i>=0;i--)if(this._rules[i].keyText===normalized)return i;return-1}findRule(select){let idx=this._findRuleIndex(select);return idx!==-1?this._rules[idx]:null}appendRule(ruleText){let tokens=tokenize(ruleText),openIdx=-1,closeIdx=-1,depth=0;for(let i=0;i<tokens.length;i++){let tok=tokens[i];if(tok.type==="{"){if(openIdx===-1)openIdx=i;depth++}else if(tok.type==="}"){if(depth--,depth===0&&openIdx!==-1){closeIdx=i;break}}}if(openIdx===-1||closeIdx===-1)return;let preludeText=serialize(tokens.slice(0,openIdx)).trim(),keyText;try{keyText=normalizeKeyframeSelector(preludeText)}catch{return}let styleDecl=parseStyleAttribute(tokens.slice(openIdx+1,closeIdx)),keyframe=new CSSKeyframeRule(keyText,styleDecl._declarations);keyframe._parentRule=this,this._rules.push(keyframe)}deleteRule(select){let idx=this._findRuleIndex(select);if(idx!==-1)deleteRuleFromArray(this._rules,idx)}},CSSKeyframeRule=class extends CSSRule{_keyText;_style;constructor(keyText,styleDeclarations){super();this.keyText=keyText,this._style=new CSSKeyframeStyleDeclaration(styleDeclarations),this._style._parentRule=this,hideInternalFields(this)}get keyText(){return this._keyText}set keyText(value){this._keyText=normalizeKeyframeSelector(value)}get style(){return this._style}set style(value){this._style.cssText=value}get type(){return 8}get cssText(){return formatInlineStyleBlock(this.keyText,this._style)}set cssText(_value){}},CSSNestedDeclarations=class extends CSSRule{_style;constructor(styleDeclarations){super();this._style=new CSSStyleDeclaration2(styleDeclarations),this._style._parentRule=this,hideInternalFields(this)}get style(){return this._style}set style(value){this._style.cssText=value}get cssText(){return this._style.cssText}set cssText(_value){}},CSSFontFaceRule=class extends CSSRule{_style;constructor(styleDeclarations){super();this._style=new CSSFontFaceDescriptors(styleDeclarations),this._style._parentRule=this,hideInternalFields(this)}get style(){return this._style}set style(value){this._style.cssText=value}get type(){return 5}get cssText(){return formatInlineStyleBlock("@font-face",this._style)}set cssText(_value){}},CSSMarginRule=class extends CSSRule{_name;_style;constructor(name,declarations,internalToken){if(internalToken!==INTERNAL_RULE_TOKEN)throw TypeError("Illegal constructor");super();this._name=name,this._style=new CSSMarginDescriptors(declarations),this._style._parentRule=this,hideInternalFields(this)}get name(){return this._name}get style(){return this._style}set style(value){this._style.cssText=value}get type(){return 9}get cssText(){return formatInlineStyleBlock(`@${this.name}`,this.style)}set cssText(_value){}};function parseDataUrlRules(href){if(!href||!href.startsWith("data:"))return[];let commaIdx=href.indexOf(",");if(commaIdx===-1)return[];let meta=href.slice(5,commaIdx).toLowerCase(),content=href.slice(commaIdx+1);try{return consumeListOfRules(tokenize(meta.includes(";base64")?typeof atob==="function"?atob(content):Buffer.from(content,"base64").toString("utf-8"):decodeURIComponent(content)),!0)}catch{return[]}}var CSSImportRule=class extends CSSRule{_href;_media;_styleSheet=null;_layerName;_supportsText;_scopeStart;_scopeEnd;_isScoped;constructor(href,mediaText="",layerName=null,supportsText=null,scopeStart=null,scopeEnd=null,isScoped=!1,internalToken){if(internalToken!==INTERNAL_RULE_TOKEN)throw TypeError("Illegal constructor");super();this._href=href,this._media=new MediaList(mediaText),this._layerName=layerName,this._supportsText=supportsText,this._scopeStart=scopeStart,this._scopeEnd=scopeEnd,this._isScoped=isScoped||Boolean(scopeStart||scopeEnd),hideInternalFields(this)}get href(){return this._href}get media(){return this._media}set media(val){this._media.mediaText=val===null?"":String(val)}get styleSheet(){if(!this._styleSheet)this._styleSheet=CSSStyleSheet.createInternal(parseDataUrlRules(this._href),(text)=>consumeRule(tokenize(text))),this._styleSheet._initImportedSheet(this,this.parentStyleSheet,this._href);return this._styleSheet}get layerName(){return this._layerName}get supportsText(){return this._supportsText}get type(){return 3}get cssText(){let text=`@import url(${serializeString(this.href)})`;if(this.layerName!==null)text+=this.layerName?` layer(${this.layerName})`:" layer";if(this.supportsText!==null)text+=` supports(${this.supportsText})`;if(this._isScoped)if(this._scopeStart||this._scopeEnd){let startPart=this._scopeStart?`(${this._scopeStart})`:"",endPart=this._scopeEnd?` to (${this._scopeEnd})`:"";text+=` scope(${(startPart+endPart).trim()})`}else text+=" scope";let mediaStr=this.media.mediaText;if(mediaStr)text+=` ${mediaStr}`;return text+";"}set cssText(_value){}},CSSNamespaceRule=class extends CSSRule{_namespaceURI;_prefix;constructor(prefix,namespaceURI,internalToken){if(internalToken!==INTERNAL_RULE_TOKEN)throw TypeError("Illegal constructor");super();this._prefix=prefix,this._namespaceURI=namespaceURI,hideInternalFields(this)}get namespaceURI(){return this._namespaceURI}get prefix(){return this._prefix}get type(){return 10}get cssText(){return`@namespace ${this._prefix?`${serializeIdentifier(this._prefix)} `:""}url("${this._namespaceURI}");`}set cssText(_value){}},VALID_PAGE_PSEUDOS=new Set("left,right,first,blank".split(","));function parsePageSelectorList(text){if(text.trim()==="")return[""];let values=parseComponentValues(tokenize(text)),selectorTokensList=[[]];for(let v of values)if(v.type==="comma")selectorTokensList.push([]);else selectorTokensList[selectorTokensList.length-1].push(v);let results=[];for(let selTokens of selectorTokensList){let start=0,end=selTokens.length;while(start<end&&(selTokens[start].type==="whitespace"||selTokens[start].type==="comment"))start++;while(end>start&&(selTokens[end-1].type==="whitespace"||selTokens[end-1].type==="comment"))end--;let trimmed=selTokens.slice(start,end);if(trimmed.length===0||trimmed.some((t)=>t.type==="whitespace"||t.type==="comment"))return null;let pos=0,serialized="";if(trimmed[0].type==="ident")serialized+=serializeIdentifier(trimmed[0].value),pos=1;while(pos<trimmed.length){let colon=trimmed[pos],ident=trimmed[pos+1];if(colon?.type!=="colon"||ident?.type!=="ident")return null;let pseudoName=ident.value.toLowerCase();if(!VALID_PAGE_PSEUDOS.has(pseudoName))return null;serialized+=":"+serializeIdentifier(pseudoName),pos+=2}results.push(serialized)}return results}function formatPageSelectorText(text){let parsed=parsePageSelectorList(text);if(parsed===null)return null;return parsed.length===1&&parsed[0]===""?"":parsed.join(", ")}var CSSPageRule=class extends CSSGroupingRule{_selectorText;_style;constructor(selectorText,declarations,rules,parseRuleInBlock){super(rules,parseRuleInBlock);this._selectorText=formatPageSelectorText(selectorText)??selectorText,this._style=new CSSPageDescriptors(declarations,PAGE_DESCRIPTORS_INTERNAL),this._style._parentRule=this,hideInternalFields(this)}get selectorText(){return this._selectorText}set selectorText(value){let formatted=formatPageSelectorText(value);if(formatted!==null)this._selectorText=formatted}get style(){return this._style}set style(value){this._style.cssText=value}get type(){return 6}get cssText(){let sel=this.selectorText?this.selectorText+" ":"",declsStr=this.style.cssText.trim(),rulesStr=this._rules.map((r)=>r.cssText).join(`
|
|
20
|
+
`).trim(),bodyText=declsStr&&rulesStr?`${declsStr}
|
|
21
|
+
${rulesStr}`:declsStr||rulesStr;if(!bodyText)return`@page ${sel}{ }`;return`@page ${sel}{
|
|
22
|
+
${bodyText.split(`
|
|
23
|
+
`).map((line)=>" "+line).join(`
|
|
24
|
+
`)}
|
|
25
|
+
}`}set cssText(_value){}},CSSPropertyRule=class extends CSSRule{_name;_syntax;_inherits;_initialValue;constructor(name,syntax,inherits,initialValue){super();this._name=name,this._syntax=syntax,this._inherits=inherits,this._initialValue=initialValue,hideInternalFields(this)}get name(){return this._name}get syntax(){return this._syntax}get inherits(){return this._inherits}get initialValue(){return this._initialValue}get cssText(){let body=`syntax: ${serializeString(this._syntax)}; inherits: ${this._inherits};`;if(this._initialValue!==null)body+=`initial-value: ${this._initialValue};`;return`@property ${serializeIdentifier(this._name)} {${body}}`}set cssText(_value){}},AT_RULE_TYPE_MAP={import:CSSRule.IMPORT_RULE,charset:CSSRule.CHARSET_RULE,namespace:CSSRule.NAMESPACE_RULE,page:CSSRule.PAGE_RULE,"font-face":CSSRule.FONT_FACE_RULE,supports:12},CSSAtRule=class extends CSSRule{_name;_prelude;_block;_childRules;_declarations;constructor(name,prelude,block,childRules,declarations){super();if(this._name=name,this._prelude=prelude,this._block=block,this._childRules=childRules,this._declarations=declarations,childRules){for(let rule of childRules)if(rule instanceof CSSRule)rule._parentRule=this}hideInternalFields(this)}get name(){return this._name}set name(val){this._name=val}get prelude(){return this._prelude}set prelude(val){this._prelude=val}get block(){return this._block}set block(val){this._block=val}get childRules(){return this._childRules}set childRules(val){this._childRules=val}get declarations(){return this._declarations}set declarations(val){this._declarations=val}get type(){return AT_RULE_TYPE_MAP[this._name]??0}get cssText(){let serializedPrelude=serialize(this._prelude).trim(),cond=serializedPrelude.length>0?" "+serializedPrelude:"";if(!this._block)return`@${this._name}${cond};`;let childRules=this._childRules||[];if(childRules.length>0)return serializeGroupingRule(this._name,cond.trim(),childRules);let blockContentText=serialize(this._block.value).trim();if(!blockContentText)return`@${this._name}${cond} { }`;let indentedBody=blockContentText.split(`
|
|
26
|
+
`).map((line)=>" "+line).join(`
|
|
27
|
+
`);return`@${this._name}${cond} {
|
|
28
|
+
${indentedBody}
|
|
29
|
+
}`}},CSSCounterStyleRule=class extends CSSRule{_name;_declarations=[];_descriptors={system:"",symbols:"",additiveSymbols:"",negative:"",prefix:"",suffix:"",range:"",pad:"",speakAs:"",fallback:""};constructor(name,declarations=[]){super();this._name=name,this._declarations=declarations;for(let d of declarations){let prop=COUNTER_STYLE_PROP_BY_DESCRIPTOR.get(d.name);if(prop)this._descriptors[prop]=Array.isArray(d.value)?serialize(d.value).trim():typeof d.value==="string"?d.value:""}hideInternalFields(this)}get name(){return this._name}set name(value){this._name=value}get type(){return 11}get cssText(){let decls=this._declarations.map((d)=>{let valStr=Array.isArray(d.value)?serialize(d.value).trim():typeof d.value==="string"?d.value:"";return`${d.name}: ${valStr};`}).join(" ");return decls.length>0?`@counter-style ${this._name} { ${decls} }`:`@counter-style ${this._name} {}`}set cssText(_value){}};for(let prop of COUNTER_STYLE_PROP_BY_DESCRIPTOR.values())Object.defineProperty(CSSCounterStyleRule.prototype,prop,{get(){return this._descriptors[prop]},set(value){this._descriptors[prop]=value},enumerable:!0,configurable:!0});var CSSFontFeatureValuesMap=class{_map=new Map;constructor(){hideInternalFields(this)}get size(){return this._map.size}get(featureValueName){return this._map.get(featureValueName)}set(featureValueName,values){this._map.set(featureValueName,Array.isArray(values)?values.map(Number):[Number(values)])}has(featureValueName){return this._map.has(featureValueName)}delete(featureValueName){return this._map.delete(featureValueName)}clear(){this._map.clear()}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.values()}forEach(callbackfn,thisArg){this._map.forEach((value,key)=>callbackfn.call(thisArg,value,key,this))}[Symbol.iterator](){return this._map[Symbol.iterator]()}},CSSFontFeatureValuesRule=class extends CSSRule{_fontFamily;constructor(fontFamily){super();this._fontFamily=fontFamily;for(let[,prop]of FONT_FEATURE_VALUE_MAP_DEFS)this[`_${prop}`]=new CSSFontFeatureValuesMap;hideInternalFields(this)}get fontFamily(){return this._fontFamily}set fontFamily(value){this._fontFamily=value}get type(){return 14}get cssText(){let blocks=[];for(let[atName,prop]of FONT_FEATURE_VALUE_MAP_DEFS){let map=this[prop];if(map&&map.size>0){let entries=Array.from(map.entries(),([k,v])=>`${k}: ${v.join(" ")};`).join(" ");blocks.push(`@${atName} { ${entries} }`)}}let body=blocks.length>0?` { ${blocks.join(" ")} }`:" {}";return`@font-feature-values ${this._fontFamily}${body}`}set cssText(_value){}};for(let[,prop]of FONT_FEATURE_VALUE_MAP_DEFS)Object.defineProperty(CSSFontFeatureValuesRule.prototype,prop,{get(){return this[`_${prop}`]},enumerable:!0,configurable:!0});var CSSPositionTryRule=class extends CSSRule{_name;_style;constructor(name,declarations,internalToken){if(internalToken!==INTERNAL_RULE_TOKEN)throw TypeError("Illegal constructor");super();this._name=name,this._style=new CSSPositionTryDescriptors(declarations,PAGE_DESCRIPTORS_INTERNAL),this._style._parentRule=this,hideInternalFields(this)}get name(){return serializeIdentifier(this._name)}get style(){return this._style}set style(value){this._style.cssText=value}get cssText(){let body=this._style.cssText.trim();return`@position-try ${this.name} { ${body?body+" ":""}}`}set cssText(_value){}};for(let ctor of[CSSAtRule,CSSConditionRule,CSSFontFeatureValuesMap,CSSMediaRule,CSSSupportsRule,CSSContainerRule,CSSLayerBlockRule,CSSLayerStatementRule,CSSStartingStyleRule,CSSViewTransitionRule,CSSKeyframesRule,CSSKeyframeRule,CSSNestedDeclarations,CSSMarginRule,CSSImportRule,CSSNamespaceRule,CSSPropertyRule,CSSScopeRule,CSSCounterStyleRule,CSSFontFeatureValuesRule,CSSCustomMediaRule,CSSFontFaceRule,CSSPageRule,CSSPositionTryRule])applyWebIDLInterface(ctor);var ArrayTokenStream=class{tokens;index=0;constructor(tokens){this.tokens=tokens}next(){let token=this.peek();if(token.type!=="EOF")this.index++;return token}peek(){return this.tokens[this.index]||{type:"EOF",value:""}}},ArrayComponentValueStream=class{values;index=0;constructor(values){this.values=values}next(){let val=this.peek();if(val.type!=="EOF")this.index++;return val}peek(){return this.values[this.index]||{type:"EOF",value:""}}get position(){return this.index}set position(pos){this.index=pos}slice(start,end){return this.values.slice(start,end)}},LazyComponentValueStream=class{fetchNext;mirrorToken;buffer=[];index=0;done=!1;terminator=null;constructor(fetchNext,mirrorToken){this.fetchNext=fetchNext,this.mirrorToken=mirrorToken}next(){let val=this.peek();if(val.type!=="EOF")this.index++;return val}peek(){if(this.index<this.buffer.length)return this.buffer[this.index];if(this.done)return{type:"EOF",value:""};let val=this.fetchNext();if(val.type===this.mirrorToken)return this.terminator=val,this.done=!0,{type:"EOF",value:""};if(val.type==="EOF")return this.done=!0,val;return this.buffer.push(val),val}get position(){return this.index}set position(pos){if(pos>this.buffer.length)throw Error("Cannot seek past buffered content in LazyComponentValueStream");this.index=pos}slice(start,end){return this.buffer.slice(start,end)}};function getComponentValueStartIndex(item){if(!item)return;return item.type==="simple-block"?item.associatedToken?.startIndex:("startIndex"in item)&&typeof item.startIndex==="number"?item.startIndex:void 0}function getComponentValueEndIndex(item){if(!item)return;return item.type==="simple-block"?item.endIndex??item.associatedToken?.endIndex:("endIndex"in item)&&typeof item.endIndex==="number"?item.endIndex:void 0}function trimComponentValues(values,trimEof=!1){let start=0;while(start<values.length&&(values[start].type==="whitespace"||values[start].type==="comment"))start++;let end=values.length-1;while(end>=start&&(values[end].type==="whitespace"||values[end].type==="comment"||trimEof&&values[end].type==="EOF"))end--;return start>end?[]:values.slice(start,end+1)}function splitComponentValuesByComma(values,allowDelimComma=!1){let result=[[]];for(let v of values)if(v.type==="comma"||allowDelimComma&&v.type==="delim"&&v.value===",")result.push([]);else result[result.length-1].push(v);return result}function extractUriFromComponentValue(token){if(token.type==="string")return token.value;if(token.type==="url")return token.value;if(token.type==="function"&&token.name==="url"){let fn=token,urlArg=fn.value.find((v)=>v.type==="string");if(urlArg)return urlArg.value;return fn.value.map((v)=>serialize([v])).join("").trim()}return null}function splitLeadingDeclarations(blockContents){let declarations=[],nestedRules=[];for(let i=0;i<blockContents.length;i++){let item=blockContents[i];if(i===0&&item instanceof CSSNestedDeclarations)declarations.push(...item.style._rawDeclarations);else nestedRules.push(item)}return{declarations,nestedRules}}var CSS_WIDE_KEYWORDS$1=new Set("initial,inherit,unset,revert,revert-layer,default".split(",")),KEYFRAMES_DISALLOWED_NAMES=new Set("none,initial,inherit,unset,revert,default".split(","));function isValidDashedIdent(name){return typeof name==="string"&&name.startsWith("--")&&name!=="--"&&!/\s/.test(name)}function isCustomPropertyDeclaration(prelude){let idx=0;while(idx<prelude.length&&prelude[idx].type==="whitespace")idx++;if(idx>=prelude.length)return!1;let firstNonWs=prelude[idx++];while(idx<prelude.length&&prelude[idx].type==="whitespace")idx++;if(idx>=prelude.length)return!1;let secondNonWs=prelude[idx++];return firstNonWs.type==="ident"&&firstNonWs.value.startsWith("--")&&secondNonWs.type==="colon"}var Parser3=class Parser{tokens;errors=[];declaredNamespaces=new Set;static AT_RULE_HANDLERS={media:(parser,rule,block,nested)=>parser.handleGroupingAtRule(rule,block,nested||!1,CSSMediaRule),"font-face":(parser,rule,block)=>block?parser.handleFontFaceRule(rule,block):null,page:(parser,rule,block)=>block?parser.handlePageRule(rule,block):null,property:(parser,rule,block)=>block?parser.handlePropertyRule(rule,block):null,supports:(parser,rule,block,nested)=>{if(!isGrammaticallyValidSupportsCondition(rule.prelude))return null;return parser.handleGroupingAtRule(rule,block,nested||!1,CSSSupportsRule)},container:(parser,rule,block,nested)=>parser.handleGroupingAtRule(rule,block,nested||!1,CSSContainerRule),layer:(parser,rule,block,nested)=>parser.handleLayerRule(rule,block,nested||!1),"starting-style":(parser,rule,block,nested)=>parser.handleGroupingAtRule(rule,block,nested||!1,CSSStartingStyleRule),scope:(parser,rule,block,nested)=>parser.handleScopeRule(rule,block,nested||!1),"view-transition":(parser,rule,block)=>block?parser.handleViewTransitionRule(rule,block):null,import:(parser,rule)=>parser.handleImportRule(rule),namespace:(parser,rule)=>parser.handleNamespaceRule(rule),"counter-style":(parser,rule,block)=>block?parser.handleCounterStyleRule(rule,block):null,"font-feature-values":(parser,rule,block)=>block?parser.handleFontFeatureValuesRule(rule,block):null,"custom-media":(parser,rule)=>parser.handleCustomMediaRule(rule),"position-try":(parser,rule,block)=>block?parser.handlePositionTryRule(rule,block):null};getAtRuleHandler(name){if(MARGIN_RULE_NAMES.has(name))return(parser,rule,block)=>block?parser.handleMarginRule(rule,block):null;if(name==="keyframes"||name.endsWith("-keyframes"))return(parser,rule,block)=>block?parser.handleKeyframesRule(rule,block):null;return Parser.AT_RULE_HANDLERS[name]}static NESTED_GROUP_AT_RULES=new Set("media,supports,container,layer,scope,starting-style,keyframes,property,counter-style,font-feature-values,view-transition,position-try".split(","));isSupportedAtRule(name,nested=!1){let lower=name.toLowerCase();if(lower==="charset")return!1;if(lower==="mediaall")return!1;if(lower.startsWith("--"))return!1;if(MARGIN_RULE_NAMES.has(lower))return!0;if(nested){if(lower.endsWith("-keyframes"))return!0;return Parser.NESTED_GROUP_AT_RULES.has(lower)}return!0}options;lineStarts;constructor(tokens,options={}){this.options=options,this.tokens=Array.isArray(tokens)?new ArrayTokenStream(tokens):tokens}getLineStarts(){if(this.lineStarts)return this.lineStarts;let starts=[0];if(this.options.source){let s=this.options.source.replace(/\r\n|\r|\f/g,`
|
|
30
|
+
`),pos=0;while((pos=s.indexOf(`
|
|
31
|
+
`,pos))!==-1)starts.push(++pos)}return this.lineStarts=starts}getLineColumn(start){if(start<=0)return{line:1,column:1};let starts=this.getLineStarts(),low=0,high=starts.length-1;while(low<=high){let mid=low+high>>1;if(starts[mid]<=start)low=mid+1;else high=mid-1}let lineIdx=high>=0?high:0;return{line:lineIdx+1,column:start-starts[lineIdx]+1}}makeLocation(start,end,bodyStart,bodyEnd){let getLineCol=(offset)=>this.getLineColumn(offset);return{start,end,bodyStart,bodyEnd,get line(){return getLineCol(start).line},get column(){return getLineCol(start).column}}}createBlockLocation(start,block){let end=block.endIndex??block.associatedToken.startIndex??start,bodyStart=block.associatedToken.endIndex,bodyEnd=block.endIndex!==void 0?block.isClosed?block.endIndex-1:block.endIndex:void 0;return this.makeLocation(start,end,bodyStart,bodyEnd)}reportError(message,token){this.errors.push({message,token})}get nextToken(){return this.tokens.peek()}consumeToken(){return this.tokens.next()}discardToken(){this.tokens.next()}skipWhitespace(){while(this.nextToken.type==="whitespace")this.discardToken()}parseComponentValues(){let values=[];while(this.nextToken.type!=="EOF")values.push(this.consumeComponentValue());return values}parseCommaSeparatedListOfComponentValues(){return splitComponentValuesByComma(this.parseComponentValues())}parseStyleSheet(){let rules=this.consumeListOfRules(!0);return CSSStyleSheet.createInternal(rules,(text)=>this.parseRule(text))}parseRule(ruleString){let errors=[],tokens=tokenize(ruleString,!1,errors),parser=new Parser(tokens,this.options);parser.errors.push(...errors);let rule=parser.consumeRule();return parser.ensureEOF(),rule}parseStyleAttribute(){return new CSSStyleDeclaration2(this.consumeDeclarationsFromBlockContents(this.parseComponentValues()))}parseStyleSheetContents(){return this.consumeListOfRules(!0)}parseBlockContents(){return this.consumeBlockContents(new ArrayComponentValueStream(this.parseComponentValues()),!0,!1)}parseDeclaration(){if(this.skipWhitespace(),this.nextToken.type!=="ident")return null;let stream=new LazyComponentValueStream(()=>this.consumeComponentValue(),"EOF"),decl=this.consumeDeclarationFromStream(stream);if(!decl)return null;return this.skipWhitespace(),this.nextToken.type==="EOF"?decl:null}parseComponentValue(){if(this.skipWhitespace(),this.nextToken.type==="EOF")return null;let value=this.consumeComponentValue();return this.skipWhitespace(),this.nextToken.type==="EOF"?value:null}consumeListOfRules(topLevel){let rules=[];while(!0){let token=this.nextToken;if(token.type==="whitespace")this.discardToken();else if(token.type==="EOF")return rules;else if((token.type==="CDO"||token.type==="CDC")&&topLevel)this.discardToken();else{let rule=this.consumeRule();if(rule)rules.push(rule)}}}consumeRule(nested=!1){if(this.skipWhitespace(),this.nextToken.type==="EOF")return null;return this.nextToken.type==="at-keyword"?this.consumeAtRule(nested):this.consumeQualifiedRule(nested)}finalizeAtRule(rule,block,nested,location,isTopLevelTokenStream){if(!this.isSupportedAtRule(rule.name,nested))return null;let handler=this.getAtRuleHandler(rule.name);if(handler){let res=handler(this,rule,block,nested);if(res instanceof CSSRule&&!res.location)res._location=location;return res}if(nested)return null;if(block&&isTopLevelTokenStream&&this.options?.atRules?.[rule.name]){let type=this.options.atRules[rule.name];if(type==="declaration"){let decls=this.consumeDeclarationsFromBlockContents(block.value),atRule=new CSSAtRule(rule.name,rule.prelude,block,void 0,decls);return atRule._location=location,atRule}if(type==="rule"){let childRules=this.consumeNestedRules(block,!1),atRule=new CSSAtRule(rule.name,rule.prelude,block,childRules);return atRule._location=location,atRule}}let cssRules;if(block&&!isTopLevelTokenStream)rule.childRules=this.consumeBlockContents(new ArrayComponentValueStream(block.value),nested),cssRules=rule.childRules;let atRule=new CSSAtRule(rule.name,rule.prelude,block,cssRules);return atRule._location=location,atRule}consumeAtRule(nested=!1){let token=this.consumeToken();if(token.type!=="at-keyword")return null;let rule={type:"at-rule",name:token.value,prelude:[],childRules:[]},start=token.startIndex??0;while(!0){let next=this.nextToken;if(next.type==="semicolon"||next.type==="EOF"){let end=next.endIndex??next.startIndex??start;return this.discardToken(),this.finalizeAtRule(rule,void 0,nested,this.makeLocation(start,end),!0)}else if(next.type==="}"){if(nested)return null;this.consumeToken(),rule.prelude.push(next)}else if(next.type==="{"){let block=this.consumeBlock(this.consumeToken());return this.finalizeAtRule(rule,block,nested,this.createBlockLocation(start,block),!0)}else rule.prelude.push(this.consumeComponentValue())}}scopeContextDepth=0;consumeNestedRules(block,isNestedStyleRule){let allowRelative=!isNestedStyleRule&&this.scopeContextDepth>0;return this.consumeBlockContents(new ArrayComponentValueStream(block.value),isNestedStyleRule||allowRelative,isNestedStyleRule,allowRelative)}handleGroupingAtRule(rule,block,nested,ctor){if(!block)return null;let childRules=this.consumeNestedRules(block,nested);return new ctor(serialize(rule.prelude).trim(),childRules,parseRuleInBlock)}parseLayerNameFromTokens(tokens,forbidCssWide=!1){let trimmed=trimComponentValues(tokens,!0);if(trimmed.length===0||trimmed.length%2===0)return null;let parts=[];for(let i=0;i<trimmed.length;i++){let t=trimmed[i];if(i%2===0){if(t.type!=="ident"||forbidCssWide&&CSS_WIDE_KEYWORDS$1.has(t.value.toLowerCase()))return null;parts.push(t.value)}else{if(t.type!=="delim"||t.value!==".")return null;parts.push(".")}}return parts.join("")}handleLayerRule(rule,block,nested=!1){if(block){let trimmed=trimComponentValues(rule.prelude,!0),layerName="";if(trimmed.length>0){let parsed=this.parseLayerNameFromTokens(trimmed);if(parsed===null)return null;layerName=parsed}return new CSSLayerBlockRule(layerName,this.consumeNestedRules(block,nested),parseRuleInBlock)}let segments=splitComponentValuesByComma(rule.prelude),nameList=[];for(let seg of segments){let name=this.parseLayerNameFromTokens(seg);if(name===null)return null;nameList.push(name)}return nameList.length>0?new CSSLayerStatementRule(nameList):null}parseScopeSelectorBlock(block){try{new SelectorParser(block.value,{allowRelative:!0,forbidPseudo:!0,declaredNamespaces:this.declaredNamespaces}).parse();let text=serialize(block.value).trim();return text?`(${text})`:""}catch{return null}}handleScopeRule(rule,block,_nested=!1){if(!block)return null;this.scopeContextDepth++;let childRules;try{childRules=this.consumeBlockContents(new ArrayComponentValueStream(block.value),!0,!1,!0)}finally{this.scopeContextDepth--}let startSelector=null,endSelector=null,prelude=rule.prelude,i=0;while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i<prelude.length&&prelude[i].type==="simple-block"&&prelude[i].associatedToken.type==="("){if(startSelector=this.parseScopeSelectorBlock(prelude[i]),startSelector===null)return null;i++}while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i<prelude.length&&prelude[i].type==="ident"&&String(prelude[i].value).toLowerCase()==="to"){i++;while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i<prelude.length&&prelude[i].type==="simple-block"&&prelude[i].associatedToken.type==="("){if(endSelector=this.parseScopeSelectorBlock(prelude[i]),endSelector===null)return null;i++}else return null}while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i<prelude.length)return null;return new CSSScopeRule(startSelector,endSelector,childRules,parseRuleInScopeBlock)}handleViewTransitionRule(_rule,block){return new CSSViewTransitionRule(this.consumeDeclarationsFromBlockContents(block.value))}parseKeyframeSelector(prelude){let lists=splitComponentValuesByComma(prelude),normalizedParts=[];for(let list of lists){let trimmed=trimComponentValues(list);if(trimmed.length!==1)return null;let v=trimmed[0];if(v.type==="ident"){let valStr=v.value.toLowerCase();if(valStr==="from")normalizedParts.push("0%");else if(valStr==="to")normalizedParts.push("100%");else return null}else if(v.type==="percentage"){let val=v.value;if(val<0||val>100)return null;normalizedParts.push(`${val}%`)}else return null}return normalizedParts.length>0?normalizedParts.join(", "):null}handleKeyframesRule(rule,block){let preludeClean=rule.prelude.filter((v)=>v.type!=="whitespace"&&v.type!=="comment");if(preludeClean.length!==1)return null;let first=preludeClean[0],keyframesName="";if(first.type==="ident"){if(KEYFRAMES_DISALLOWED_NAMES.has(first.value.toLowerCase()))return null;keyframesName=first.value}else if(first.type==="string"&&first.value!=="")keyframesName=first.value;else return null;let keyframeRules=[],stream=new ArrayComponentValueStream(block.value);while(!0){let val=stream.peek();if(val.type==="whitespace"||val.type==="semicolon"){stream.next();continue}if(val.type==="EOF")break;let prelude=[],blockVal=null;while(!0){let next=stream.peek();if(next.type==="EOF")break;if(next.type==="simple-block"&&next.associatedToken.type==="{"){blockVal=stream.next();break}prelude.push(stream.next())}if(!blockVal)break;let selectorText=this.parseKeyframeSelector(prelude);if(selectorText){let keyframeRule=new CSSKeyframeRule(selectorText,this.consumeDeclarationsFromBlockContents(blockVal.value)),kfStart=getComponentValueStartIndex(prelude[0])??blockVal.associatedToken.startIndex??0;keyframeRule._location=this.createBlockLocation(kfStart,blockVal),keyframeRules.push(keyframeRule)}}return new CSSKeyframesRule(keyframesName,keyframeRules)}handleFontFaceRule(_rule,block){return new CSSFontFaceRule(this.consumeDeclarationsFromBlockContents(block.value))}handlePageRule(rule,block){let{declarations,nestedRules}=splitLeadingDeclarations(this.consumeBlockContents(new ArrayComponentValueStream(block.value),!0));return new CSSPageRule(serialize(rule.prelude).trim(),declarations,nestedRules,parseRule)}handleMarginRule(rule,block){return new CSSMarginRule(rule.name,this.consumeDeclarationsFromBlockContents(block.value),INTERNAL_RULE_TOKEN)}handleCounterStyleRule(rule,block){return new CSSCounterStyleRule(serialize(rule.prelude).trim(),this.consumeDeclarationsFromBlockContents(block.value))}handleFontFeatureValuesRule(rule,block){let fontFeatureRule=new CSSFontFeatureValuesRule(serialize(rule.prelude).trim()),stream=new ArrayComponentValueStream(block.value);while(stream.peek().type!=="EOF"){let token=stream.peek();if(token.type==="whitespace"||token.type==="comment"){stream.next();continue}if(token.type==="at-keyword"){let atToken=stream.next(),target=FONT_FEATURE_VALUE_BLOCKS[atToken.value.toLowerCase()];while(stream.peek().type==="whitespace"||stream.peek().type==="comment")stream.next();let next=stream.peek();if(next.type==="simple-block"&&next.associatedToken.type==="{"){let childBlock=stream.next();if(target)for(let d of this.consumeDeclarationsFromBlockContents(childBlock.value)){let values=d.value.filter((v)=>v.type==="number").map((v)=>v.value);fontFeatureRule[target].set(d.name,values)}}}else stream.next()}return fontFeatureRule}handlePropertyRule(rule,block){let nonWsPrelude=trimComponentValues(rule.prelude,!0);if(nonWsPrelude.length!==1||nonWsPrelude[0].type!=="ident")return null;let name=nonWsPrelude[0].value;if(!name.startsWith("--")||name==="--")return null;let declarations=this.consumeDeclarationsFromBlockContents(block.value),syntax=null,inherits=null,initialValue=null;for(let d of declarations){let val=serialize(d.value).trim(),descName=d.name.toLowerCase();if(descName==="syntax"){let nonWsTokens=trimComponentValues(d.value,!0);if(nonWsTokens.length===1&&nonWsTokens[0].type==="string")syntax=nonWsTokens[0].value}else if(descName==="inherits"){if(val==="true")inherits=!0;else if(val==="false")inherits=!1}else if(descName==="initial-value")initialValue=val}if(syntax===null||inherits===null)return null;if(ParseHooks.validatePropertyRuleDescriptor){if(!ParseHooks.validatePropertyRuleDescriptor({name,syntax,inherits,initialValue:initialValue??void 0}))return null}else if(!isValidDashedIdent(name)||typeof syntax!=="string"||syntax.length===0||typeof inherits!=="boolean")return null;return new CSSPropertyRule(name,syntax,inherits,initialValue)}handlePositionTryRule(rule,block){let nonWsPrelude=trimComponentValues(rule.prelude,!0);if(nonWsPrelude.length!==1||nonWsPrelude[0].type!=="ident")return null;let name=nonWsPrelude[0].value;if(!isValidDashedIdent(name))return null;return new CSSPositionTryRule(name,this.consumeDeclarationsFromBlockContents(block.value),INTERNAL_RULE_TOKEN)}parseImportScopeArgs(scopeArgs){let scopeStart=null,scopeEnd=null,k=0;while(k<scopeArgs.length&&scopeArgs[k].type==="whitespace")k++;if(k<scopeArgs.length&&scopeArgs[k].type==="simple-block"&&scopeArgs[k].associatedToken.type==="(")scopeStart=serialize(scopeArgs[k].value).trim(),k++;else{let startTokens=[];while(k<scopeArgs.length){let tok=scopeArgs[k];if(tok.type==="ident"&&String(tok.value).toLowerCase()==="to")break;startTokens.push(tok),k++}let s=serialize(startTokens).trim();if(s)scopeStart=s}while(k<scopeArgs.length&&scopeArgs[k].type==="whitespace")k++;if(k<scopeArgs.length&&scopeArgs[k].type==="ident"&&String(scopeArgs[k].value).toLowerCase()==="to"){k++;while(k<scopeArgs.length&&scopeArgs[k].type==="whitespace")k++;if(k<scopeArgs.length&&scopeArgs[k].type==="simple-block"&&scopeArgs[k].associatedToken.type==="(")scopeEnd=serialize(scopeArgs[k].value).trim();else{let e=serialize(scopeArgs.slice(k)).trim();if(e)scopeEnd=e}}if(scopeStart)scopeStart=scopeStart.replace(/^\(/,"").replace(/\)$/,"").trim();if(scopeEnd)scopeEnd=scopeEnd.replace(/^\(/,"").replace(/\)$/,"").trim();return{scopeStart,scopeEnd}}handleImportRule(rule){let href="",layerName=null,supportsText=null,isScoped=!1,scopeStart=null,scopeEnd=null,prelude=rule.prelude,i=0;while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i<prelude.length){let extracted=extractUriFromComponentValue(prelude[i]);if(extracted!==null)href=extracted,i++}while(i<prelude.length){while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i>=prelude.length)break;let val=prelude[i];if(layerName===null&&val.type==="ident"&&val.value.toLowerCase()==="layer")layerName="",i++;else if(layerName===null&&val.type==="function"&&val.name.toLowerCase()==="layer"){let fnTokens=val.value;if(fnTokens.some((t)=>t.type==="whitespace"))break;let parsed=this.parseLayerNameFromTokens(fnTokens,!0);if(parsed===null)break;layerName=parsed,i++}else if(supportsText===null&&val.type==="function"&&val.name.toLowerCase()==="supports")supportsText=serialize(val.value).trim(),i++;else if(!isScoped&&val.type==="ident"&&val.value.toLowerCase()==="scope")isScoped=!0,i++;else if(!isScoped&&val.type==="function"&&val.name.toLowerCase()==="scope")isScoped=!0,{scopeStart,scopeEnd}=this.parseImportScopeArgs(val.value),i++;else break}let mediaText=serialize(prelude.slice(i)).trim();return new CSSImportRule(href,mediaText,layerName,supportsText,scopeStart,scopeEnd,isScoped,INTERNAL_RULE_TOKEN)}handleNamespaceRule(rule){let tokens=rule.prelude.filter((t)=>t.type!=="whitespace"&&t.type!=="comment"&&t.type!=="EOF"),prefix="",namespaceURI="";if(tokens.length===1)namespaceURI=extractUriFromComponentValue(tokens[0])??"";else if(tokens.length>=2)if(tokens[0].type==="ident")prefix=tokens[0].value,namespaceURI=extractUriFromComponentValue(tokens[1])??"";else namespaceURI=extractUriFromComponentValue(tokens[0])??"";let nsRule=new CSSNamespaceRule(prefix,namespaceURI,INTERNAL_RULE_TOKEN);return this.declaredNamespaces.add(nsRule.prefix),nsRule}handleCustomMediaRule(rule){let prelude=rule.prelude,i=0;while(i<prelude.length&&prelude[i].type==="whitespace")i++;if(i>=prelude.length)return null;let nameToken=prelude[i];if(nameToken.type!=="ident"||!nameToken.value.startsWith("--"))return null;let name=nameToken.value;i++;let remainingTokens=prelude.slice(i).filter((v)=>v.type!=="whitespace"&&v.type!=="comment"),query;if(remainingTokens.length===0)query=new MediaList("");else if(remainingTokens.length===1&&remainingTokens[0].type==="ident"&&remainingTokens[0].value.toLowerCase()==="true")query=!0;else if(remainingTokens.length===1&&remainingTokens[0].type==="ident"&&remainingTokens[0].value.toLowerCase()==="false")query=!1;else{let mediaText=serialize(prelude.slice(i)).trim(),parsed=ParseHooks.parseMediaQueryList(mediaText);if(parsed.length===0||parsed.some((q)=>q.invalid))return null;query=new MediaList(mediaText)}return new CSSCustomMediaRule(name,query)}consumeQualifiedRule(nested=!1){let prelude=[];while(!0){let next=this.nextToken;if(next.type==="EOF")return this.reportError("Unexpected EOF in qualified rule",next),null;else if(next.type==="}"){if(this.reportError("Unexpected } in qualified rule",next),nested)return null;this.consumeToken(),prelude.push(next)}else if(next.type==="{"){if(isCustomPropertyDeclaration(prelude)){this.reportError("Qualified rule prelude looks like a custom property",next);let blockToken=this.consumeToken();return this.consumeBlock(blockToken),null}let blockToken=this.consumeToken(),start=getComponentValueStartIndex(prelude[0])??blockToken.startIndex??0,stream=new LazyComponentValueStream(()=>this.consumeComponentValue(),"}"),blockContents=this.consumeBlockContents(stream,!0),term=stream.terminator,end;if(term)end=term.endIndex??(term.startIndex!==void 0?term.startIndex+1:start);else{let eofPos=this.nextToken.startIndex??this.nextToken.endIndex;if(eofPos!==void 0)end=eofPos;else{let buffered=stream.slice(0,stream.position);end=(buffered.length>0?getComponentValueEndIndex(buffered[buffered.length-1]):void 0)??blockToken.endIndex??blockToken.startIndex??start}}let bodyStart=blockToken.endIndex,bodyEnd=term?term.startIndex??end:end,location=this.makeLocation(start,end,bodyStart,bodyEnd);return this.createStyleRule(prelude,blockContents,nested,nested,location)}else prelude.push(this.consumeComponentValue())}}consumeDeclarationsFromBlockContents(values){let stream=new ArrayComponentValueStream(values),decls=[];while(!0){let val=stream.peek();if(val.type==="whitespace"||val.type==="semicolon")stream.next();else if(val.type==="EOF"||val.type==="}")break;else if(val.type==="at-keyword")this.consumeAtRuleFromStream(stream);else{let decl=this.consumeDeclarationFromStream(stream);if(decl)decls.push(decl);else while(!0){let next=stream.peek();if(next.type==="EOF"||next.type==="semicolon"||next.type==="}")break;stream.next()}}}return decls}consumeBlockContents(stream,nested=!1,isNestedStyleRule=nested,allowRelative=!1){let rules=[],decls=[],flushDecls=()=>{if(decls.length>0){let nestedDecl=new CSSNestedDeclarations(decls),start=decls[0].startIndex??0,end=decls[decls.length-1].endIndex??start;nestedDecl._location=this.makeLocation(start,end,start,end),rules.push(nestedDecl),decls=[]}};while(!0){let val=stream.peek();if(val.type==="whitespace"||val.type==="semicolon")stream.next();else if(val.type==="EOF"||val.type==="}")break;else if(val.type==="at-keyword"){let atRule=this.consumeAtRuleFromStream(stream,isNestedStyleRule);if(atRule)flushDecls(),rules.push(atRule)}else{let pos=stream.position;if(nested&&this.isNestedDeclarationAhead(stream)){let decl=this.consumeDeclarationFromStream(stream);if(decl){if(stream.peek().type==="semicolon"){let semi=stream.next();if(semi.endIndex!==void 0)decl.endIndex=semi.endIndex}decls.push(decl)}}else{stream.position=pos;let rule=this.consumeNestedQualifiedRuleFromStream(stream,isNestedStyleRule,"semicolon",allowRelative);if(flushDecls(),rule)rules.push(rule)}}}return flushDecls(),rules}isNestedDeclarationAhead(stream){let first=stream.peek();if(first.type!=="ident"||first.value==="--")return!1;if(first.value.startsWith("--"))return!0;let lookaheadPos=stream.position;try{stream.next();while(stream.peek().type==="whitespace")stream.next();if(stream.peek().type!=="colon")return!1;stream.next();let lookaheadTokens=[first,{type:"colon",value:":"}];while(!0){let next=stream.peek();if(next.type==="EOF"||next.type==="}"||next.type==="semicolon")return!0;if(next.type==="simple-block"&&next.associatedToken?.type==="{"){let selectorCandidate=serialize(lookaheadTokens).trim();return Parser.parseSelectorAST(selectorCandidate,{allowVendorPseudos:Boolean(this.options.allowVendorPseudos),allowUnknownPseudos:Boolean(this.options.allowUnknownPseudos)})===null}lookaheadTokens.push(stream.next())}}finally{stream.position=lookaheadPos}}consumeDeclarationFromStream(stream){let firstValue=stream.peek();if(firstValue.type!=="ident")return null;let startIndex=getComponentValueStartIndex(firstValue)??firstValue.startIndex;stream.next();let name=firstValue.value;if(name==="--")return null;while(stream.peek().type==="whitespace")stream.next();if(stream.peek().type!=="colon")return null;stream.next();while(stream.peek().type==="whitespace")stream.next();let declValue=[];while(!0){let val=stream.peek();if(val.type==="EOF"||val.type==="semicolon")break;if(!name.startsWith("--")&&val.type==="simple-block"&&val.associatedToken?.type==="{"&&declValue.some((v)=>v.type!=="whitespace")){declValue.push(stream.next());break}declValue.push(stream.next())}let important=!1,lastNonWsIndex=(end)=>{let j=end;while(j>=0&&declValue[j].type==="whitespace")j--;return j},lastNonWs=declValue[lastNonWsIndex(declValue.length-1)],endIndex=(lastNonWs&&(getComponentValueEndIndex(lastNonWs)??lastNonWs.endIndex))??firstValue.endIndex,i1=lastNonWsIndex(declValue.length-1),t1=declValue[i1];if(i1>=0&&t1?.type==="ident"&&t1.value.toLowerCase()==="important"){let i2=lastNonWsIndex(i1-1),t2=declValue[i2];if(i2>=0&&t2?.type==="delim"&&t2.value==="!")important=!0,declValue.splice(i2)}while(declValue.length>0&&declValue[declValue.length-1].type==="whitespace")declValue.pop();if(name.startsWith("--")){if(!validateDeclarationValue(declValue,!0,!0))return null}else{if(declValue.some((v)=>v.type==="simple-block"&&v.associatedToken.type==="{")&&declValue.reduce((count,v)=>v.type!=="whitespace"?count+1:count,0)>1)return null;if(!validateDeclarationValue(declValue,!0,!1))return null}if(name.toLowerCase()==="unicode-range"){let text=getOriginalText(declValue),errors=[],reParser=new Parser(tokenize(text,!0,errors));reParser.errors.push(...errors);let reParsed=reParser.parseComponentValues();if(!isValidUnicodeRangeValue(reParsed))return null;this.errors.push(...reParser.errors),declValue.splice(0,declValue.length,...reParsed)}return{type:"declaration",name,value:declValue,important,raw:name.startsWith("--")?getOriginalText(declValue):void 0,startIndex,endIndex}}consumeNestedQualifiedRuleFromStream(stream,nested=!0,stopToken,allowRelative=nested){let prelude=[];while(!0){let val=stream.peek();if(val.type==="EOF"||val.type==="}"||stopToken&&val.type===stopToken)return null;if(val.type==="simple-block"&&val.associatedToken.type==="{"){if(stream.next(),isCustomPropertyDeclaration(prelude))return this.consumeRemnantsOfABadDeclaration(stream,nested),null;let block=val,blockContents=this.consumeBlockContents(new ArrayComponentValueStream(block.value),!0),start=getComponentValueStartIndex(prelude[0])??block.associatedToken.startIndex??0;return this.createStyleRule(prelude,blockContents,nested,allowRelative,this.createBlockLocation(start,block))}prelude.push(stream.next())}}consumeAtRuleFromStream(stream,nested=!1){let token=stream.next();if(token.type!=="at-keyword")return null;let rule={type:"at-rule",name:token.value,prelude:[],childRules:[]},start=token.startIndex??0;while(!0){let val=stream.peek();if(val.type==="semicolon"){let semiToken=stream.next(),end=semiToken.endIndex??semiToken.startIndex??start;return this.finalizeAtRule(rule,void 0,nested,this.makeLocation(start,end),!1)}else if(val.type==="EOF"||val.type==="}"){let end=val.startIndex??start;return this.finalizeAtRule(rule,void 0,nested,this.makeLocation(start,end),!1)}else if(val.type==="simple-block"&&val.associatedToken.type==="{"){let block=stream.next();return this.finalizeAtRule(rule,block,nested,this.createBlockLocation(start,block),!1)}else rule.prelude.push(stream.next())}}consumeRemnantsOfABadDeclaration(stream,nested=!1){while(!0){let val=stream.peek();if(val.type==="EOF"||val.type==="semicolon"){stream.next();break}else if(val.type==="}"&&nested)break;else stream.next()}}isValidSelector(prelude){let trimmed=trimComponentValues(prelude);if(trimmed.length===0)return!1;let lastToken=trimmed[trimmed.length-1];if(lastToken.type==="delim"&&(lastToken.value==="."||lastToken.value==="#")||lastToken.type==="colon")return!1;for(let i=0;i<trimmed.length;i++){let val=trimmed[i];if(val.type==="number"||val.type==="dimension")return!1;if(val.type==="delim"){if(val.value==="#")return!1;if(val.value==="."&&(i+1>=trimmed.length||trimmed[i+1].type!=="ident"))return!1}if(val.type==="colon"&&i+1<trimmed.length){let nextVal=trimmed[i+1];if(nextVal.type!=="ident"&&nextVal.type!=="function"&&nextVal.type!=="colon")return!1}}return!0}createStyleRule(prelude,blockContents,isNested=!1,allowRelative=isNested,location){let{declarations,nestedRules}=splitLeadingDeclarations(blockContents),selectorText="",selectorAST=null;if(isNested){if(selectorText=this.normalizeNestedSelector(prelude),selectorText==="")return null;if(selectorAST=Parser.parseSelectorAST(selectorText,{declaredNamespaces:this.declaredNamespaces,allowRelative:!0,allowVendorPseudos:Boolean(this.options.allowVendorPseudos),allowUnknownPseudos:Boolean(this.options.allowUnknownPseudos)}),selectorAST===null)return null}else{if(!this.isValidSelector(prelude))return null;try{selectorAST=new SelectorParser(prelude,{declaredNamespaces:this.declaredNamespaces,allowRelative,allowVendorPseudos:Boolean(this.options.allowVendorPseudos),allowUnknownPseudos:Boolean(this.options.allowUnknownPseudos)}).parse()}catch{return null}selectorText=serialize(prelude).trim()}let rule=new CSSStyleRule(selectorText,declarations,nestedRules,parseRuleInBlock,selectorAST);if(location)rule._location=location;return rule}static#consumeSelectorTokens(parser){let prelude=[];while(!0){let next=parser.nextToken;if(next.type==="EOF")break;if(next.type==="{"||next.type==="}"||next.type==="at-keyword")return null;prelude.push(parser.consumeComponentValue())}return prelude}static parseSelectorAST(text,declaredNamespacesOrOptions,allowRelative=!1,allowVendorPseudos=!1){let isOptionsObj=declaredNamespacesOrOptions&&!(declaredNamespacesOrOptions instanceof Set),declaredNamespaces=isOptionsObj?declaredNamespacesOrOptions.declaredNamespaces:declaredNamespacesOrOptions,isRelative=isOptionsObj?declaredNamespacesOrOptions.allowRelative??!1:allowRelative,vendorPseudos=isOptionsObj?declaredNamespacesOrOptions.allowVendorPseudos??!1:allowVendorPseudos,unknownPseudos=isOptionsObj?declaredNamespacesOrOptions.allowUnknownPseudos??!1:!1,parser=new Parser(tokenize(text),{allowVendorPseudos:vendorPseudos,allowUnknownPseudos:unknownPseudos}),prelude=Parser.#consumeSelectorTokens(parser);if(prelude===null)return null;try{return new SelectorParser(prelude,{allowRelative:isRelative,declaredNamespaces,allowVendorPseudos:vendorPseudos,allowUnknownPseudos:unknownPseudos}).parse()}catch{return null}}normalizeNestedSelector(prelude){let segments=splitComponentValuesByComma(prelude,!0);if(segments.length===1&&segments[0].length===0)return"";let hasAmpersand=(values)=>values.some((val)=>val.type==="delim"&&val.value==="&"||val.type==="simple-block"&&hasAmpersand(val.value)||val.type==="function"&&hasAmpersand(val.value)),normalizedSegments=[];for(let segment of segments){let trimmed=trimComponentValues(segment);if(trimmed.length===0)return"";let firstNode=trimmed[0],secondNode=trimmed[1],startsWithCombinator=firstNode.type==="delim"&&[">","+","~"].includes(firstNode.value)||firstNode.type==="delim"&&firstNode.value==="|"&&secondNode?.type==="delim"&&secondNode.value==="|",serialized=serialize(trimmed);normalizedSegments.push(startsWithCombinator||!hasAmpersand(trimmed)?`& ${serialized}`:serialized)}return normalizedSegments.join(", ")}consumeBlock(startToken){let block={type:"simple-block",associatedToken:startToken,value:[]},mirror=getMirrorToken(startToken.type);while(!0){let next=this.nextToken;if(next.type===mirror)return block.endIndex=next.endIndex??next.startIndex,block.isClosed=!0,this.discardToken(),block;else if(next.type==="EOF")return block.endIndex=next.startIndex,block.isClosed=!1,this.reportError("Unexpected EOF in block",next),block;else block.value.push(this.consumeComponentValue())}}consumeFunction(nameToken){let func={type:"function",name:nameToken.value,value:[]};while(!0){let next=this.nextToken;if(next.type===")")return this.discardToken(),func;else if(next.type==="EOF")return this.reportError("Unexpected EOF in function",next),func;else func.value.push(this.consumeComponentValue())}}consumeComponentValue(){let token=this.consumeToken();if(token.type==="{"||token.type==="["||token.type==="(")return this.consumeBlock(token);if(token.type==="function")return this.consumeFunction(token);return token}ensureEOF(){if(this.skipWhitespace(),this.nextToken.type!=="EOF")throw new DOMException("Syntax error","SyntaxError")}static parseSelector(text){let prelude=Parser.#consumeSelectorTokens(new Parser(tokenize(text)));if(prelude===null)return null;return serialize(prelude).trim()||null}static parseRuleText(text){let parser=new Parser(tokenize(text),{source:text}),rule=parser.consumeRule();if(!rule)throw new DOMException("Syntax error","SyntaxError");return parser.ensureEOF(),rule}static parseStyleSheetText(text){return new Parser(tokenize(text),{source:text}).consumeListOfRules(!0)}};function parseRuleInBlockText(text,nested=!0,inScope=!1){let parser=new Parser3(tokenize(`{ ${text} }`));if(inScope)parser.scopeContextDepth=1;let block=parser.consumeBlock(parser.consumeToken()),contents=parser.consumeBlockContents(new ArrayComponentValueStream(block.value),inScope?!0:nested,inScope?!1:nested,inScope);if(contents.length!==1)throw new DOMException("Syntax error","SyntaxError");return contents[0]}function parseRuleInScopeBlockText(text){return parseRuleInBlockText(text,!0,!0)}function isValidVarArg(func){if((func.name||("value"in func&&typeof func.value==="string"?func.value:"")).toLowerCase()!=="var"||!Array.isArray(func.value))return!0;let args=func.value,commaIndex=args.findIndex((t)=>t.type==="comma"),nameTokens=(commaIndex!==-1?args.slice(0,commaIndex):args).filter((t)=>t.type!=="whitespace"&&t.type!=="comment");if(nameTokens.length===0)return!1;if(nameTokens.length===1&&nameTokens[0].type==="simple-block"&&nameTokens[0].associatedToken?.type==="{")return nameTokens[0].value.some((t)=>t.type!=="whitespace"&&t.type!=="comment");return!nameTokens.some((t)=>t.type==="simple-block"&&t.associatedToken?.type==="{")}function validateDeclarationValue(values,isTopLevel=!0,isCustomProperty=!1){for(let v of values){if(v.type==="bad-string"||v.type==="bad-url"||v.type===")"||v.type==="]"||v.type==="}")return!1;if(isTopLevel&&(v.type==="semicolon"||v.type==="delim"&&v.value==="!"))return!1;if(v.type==="simple-block"){if(!validateDeclarationValue(v.value,!1,isCustomProperty))return!1}else if(v.type==="function"){let func=v;if(!isCustomProperty&&!isValidVarArg(func))return!1;if(Array.isArray(func.value)&&!validateDeclarationValue(func.value,!1,isCustomProperty))return!1}}return!0}function parseRule(text){return Parser3.parseRuleText(text)}function parseRuleInBlock(text,nested=!0){return parseRuleInBlockText(text,nested)}function parseRuleInScopeBlock(text){return parseRuleInScopeBlockText(text)}function assembleUnicodeRanges(values){let result=[],i=0;while(i<values.length&&(values[i].type==="whitespace"||values[i].type==="comment"))i++;if(i>=values.length)return null;while(i<values.length){let v=values[i];if(v.type==="unicode-range"){let tok=v,start=tok.unicodeRangeStart??parseInt(tok.value.slice(2).split("-")[0],16),end=tok.unicodeRangeEnd??(tok.value.includes("-")?parseInt(tok.value.split("-")[1],16):start);if(start>1114111||end>1114111||start>end)return null;result.push(v),i++}else if(v.type==="ident"&&(v.value.toLowerCase()==="u"||v.value.toLowerCase().startsWith("u+"))){let text="";if(v.value.toLowerCase()==="u"){i++;while(i<values.length&&values[i].type==="comment")i++;let hasPlus=!1;if(i<values.length&&values[i].type==="delim"&&values[i].value==="+"){hasPlus=!0,i++;while(i<values.length&&values[i].type==="comment")i++}else if(i<values.length&&(values[i].type==="number"||values[i].type==="dimension")&&values[i].sign==="+")hasPlus=!0;if(hasPlus){let hexPart="";while(i<values.length){let t=values[i];if(t.type==="dimension"){let signStr=t.sign==="-"?"-":"";hexPart+=signStr+Math.abs(t.value).toString(16)+(t.unit||""),i++}else if(t.type==="number"){let signStr=t.sign==="-"?"-":"";hexPart+=signStr+Math.abs(t.value).toString(16),i++}else if(t.type==="ident"||t.type==="delim"&&["?","-"].includes(String(t.value)))hexPart+=String(t.value),i++;else if(t.type==="comment")i++;else break}text=`u+${hexPart}`}else return null}else{text=v.value,i++;while(i<values.length&&values[i].type==="delim"&&values[i].value==="?")text+="?",i++}let match1=/^u\+([0-9a-f]{1,6})(-([0-9a-f]{1,6}))?$/i.exec(text);if(match1){let startHex=match1[1],endHex=match1[3],startNum=parseInt(startHex,16);if(startNum>1114111)return null;if(endHex!==void 0){let endNum=parseInt(endHex,16);if(endNum>1114111||endNum<startNum)return null;result.push({type:"unicode-range",value:`U+${startNum.toString(16).toUpperCase()}-${endNum.toString(16).toUpperCase()}`})}else result.push({type:"unicode-range",value:`U+${startNum.toString(16).toUpperCase()}`})}else{let match2=/^u\+([0-9a-f]{0,5})(\?{1,6})$/i.exec(text);if(match2&&match2[1].length+match2[2].length<=6){let prefix=match2[1],q=match2[2],startHex=prefix+"0".repeat(q.length),endHex=prefix+"F".repeat(q.length),startNum=parseInt(startHex,16),endNum=parseInt(endHex,16);if(startNum>1114111||endNum>1114111)return null;result.push({type:"unicode-range",value:`U+${startNum.toString(16).toUpperCase()}-${endNum.toString(16).toUpperCase()}`})}else return null}}else return null;while(i<values.length&&(values[i].type==="whitespace"||values[i].type==="comment"))i++;if(i>=values.length||values[i].type==="EOF")break;if(values[i].type==="comma"||values[i].type==="delim"&&values[i].value===","){result.push({type:"comma",value:","}),i++;while(i<values.length&&(values[i].type==="whitespace"||values[i].type==="comment"))i++;if(i>=values.length)return null}else return null}return result}function isValidUnicodeRangeValue(values){return assembleUnicodeRanges(values)!==null}function parseStyleAttribute(tokens){return new Parser3(tokens).parseStyleAttribute()}function consumeRule(tokens){return new Parser3(tokens).consumeRule()}function consumeListOfRules(tokens,topLevel,options){return new Parser3(tokens,options).consumeListOfRules(topLevel)}function parseComponentValues(tokens,errors){let p=new Parser3(tokens),res=p.parseComponentValues();if(errors)errors.push(...p.errors);return res}Parser3.parseSelector;var parseSelectorAST=Parser3.parseSelectorAST;function validateCustomPropertyValue(values){return validateDeclarationValue(values,!0,!0)}function parse3(css,options){return new Parser3(tokenize(css),{source:css,...options}).parseStyleSheet()}CSSGroupingRule._parser={parseRule,parseRuleInBlock,parseRuleInScopeBlock};var CSS_WIDE_KEYWORDS=new Set("inherit,initial,unset,revert,revert-layer".split(",")),LOGICAL_SHORTHANDS=new Set("margin,padding,inset,scroll-margin,scroll-padding,border-width,border-style,border-color".split(","));function createStyleProxy(target){return new Proxy(target,{get(t,prop){if(typeof prop==="string"){if(!isNaN(Number(prop))){let index=Number(prop),decl=t._declarations[index];return decl?decl.name:void 0}if(prop in t&&(typeof t[prop]<"u"||prop.startsWith("_")))return t[prop];if(prop.startsWith("--"))return t._allowCustomProperties?t.getPropertyValue(prop):void 0;let isCustomProp=prop.startsWith("--"),cssProp=prop;if(!isCustomProp)if(prop==="cssFloat")cssProp="float";else cssProp=camelToDashed(prop);if(t._isPropertySupported(cssProp))return t.getPropertyValue(cssProp)}return t[prop]},set(t,prop,value){if(typeof prop==="string"){if(!isNaN(Number(prop)))return!1;if(prop in t&&(typeof t[prop]<"u"||prop.startsWith("_")))return t[prop]=value,!0;if(prop.startsWith("--")){if(t._allowCustomProperties)t.setProperty(prop,value);return!0}let cssProp=prop;if(prop==="cssFloat")cssProp="float";else cssProp=camelToDashed(prop);if(t._isPropertySupported(cssProp))return t.setProperty(cssProp,value),!0}return t[prop]=value,!0},has(t,prop){if(typeof prop==="string"){if(!isNaN(Number(prop))){let index=Number(prop);return index>=0&&index<t._declarations.length}if(prop in t)return!0;if(prop.startsWith("--"))return!0;let dashed=camelToDashed(prop);if(t._isPropertySupported(dashed))return!0;if(prop in SHORTHANDS)return!0;for(let s of Object.values(SHORTHANDS))if(s.longhands.includes(prop))return!0}return Reflect.has(t,prop)},ownKeys(t){return Array.from({length:t.length},(_,i)=>String(i))},getOwnPropertyDescriptor(t,prop){let i=typeof prop==="string"?Number(prop):NaN;if(Number.isInteger(i)&&i>=0&&i<t.length&&String(i)===prop)return{value:t.item(i),writable:!1,enumerable:!0,configurable:!0};let desc=Reflect.getOwnPropertyDescriptor(t,prop);return desc?{...desc,enumerable:!1}:void 0}})}var CSSStyleDeclaration2=class extends CSSStyleProperties{_declarations;_rawDeclarations;_declMap;_readonly=!1;_parentRule=null;_onChange=null;get parentRule(){return this._parentRule}get onChange(){return this._onChange}set onChange(fn){this._onChange=fn??null}get _filterDeclarationsInConstructor(){return!1}get _allowCustomProperties(){return!0}get _allowImportant(){return!0}constructor(parentRuleOrDeclarations,onChangeOrReadonly){super();this._declarations=[],this._rawDeclarations=[],this._declMap=new Map;let declarations=[];if(Array.isArray(parentRuleOrDeclarations)){if(declarations=parentRuleOrDeclarations,this._readonly=typeof onChangeOrReadonly==="boolean"?onChangeOrReadonly:!1,typeof onChangeOrReadonly==="function")this._onChange=onChangeOrReadonly}else if(this._parentRule=parentRuleOrDeclarations??null,this._readonly=typeof onChangeOrReadonly==="boolean"?onChangeOrReadonly:!1,typeof onChangeOrReadonly==="function")this._onChange=onChangeOrReadonly;let addDeclarationRecursive=(decl,isTopLevel=!1)=>{if(decl.name==="--")return;if(decl.important&&!this._allowImportant)return;let normalizedName=decl.name.startsWith("--")?decl.name:decl.name.toLowerCase();if(normalizedName.startsWith("--")&&!this._allowCustomProperties)return;if(this._filterDeclarationsInConstructor&&!normalizedName.startsWith("--")&&!this._isPropertySupported(normalizedName))return;if(decl.name=normalizedName,isTopLevel)this._rawDeclarations.push(decl);let shorthand=SHORTHANDS[decl.name];if(shorthand){if(!(serialize(decl.value).includes("var(")||serialize(decl.value).includes("env("))){let expanded=shorthand.expand(decl.value);if(expanded){for(let[lh,val]of Object.entries(expanded))addDeclarationRecursive({type:"declaration",name:lh,value:val,important:decl.important,fromAll:decl.name==="all"||decl.fromAll});return}}}this._addDeclaration(decl)};for(let d of declarations)addDeclarationRecursive(d,!0);return createStyleProxy(this)}_addDeclaration(d){let shorthand=SHORTHANDS[d.name];if(shorthand){for(let lh of shorthand.longhands)if(this._declMap.has(lh)){let existing=this._declMap.get(lh);if(existing.important&&!d.important)continue;let index=this._declarations.indexOf(existing);if(index!==-1)this._declarations.splice(index,1);this._declMap.delete(lh)}}if(this._declMap.has(d.name)){let existing=this._declMap.get(d.name);if(existing.important&&!d.important)return;let index=this._declarations.indexOf(existing);if(index!==-1)this._declarations.splice(index,1);this._declarations.push(d),this._declMap.set(d.name,d)}else this._declarations.push(d),this._declMap.set(d.name,d)}get length(){return this._declarations.length}item(index){return this._declarations[index]?.name||""}_getLonghandForContraction(lh){let decl=this._getWinningDeclaration(lh);if(decl&&decl.value.length>0)return{value:decl.value,important:decl.important};return null}getPropertyValue(property){if(!property.startsWith("--"))property=property.toLowerCase();else if(!isValidDashedIdent(property))return"";let shorthandLonghands=SHORTHANDS[property]?.longhands||SHORTHANDS_DATA[property];if(shorthandLonghands&&shorthandLonghands.length>0){let allCssWide=null,allMatch=!0,firstPrio=null,allSamePriority=!0;for(let lh of shorthandLonghands){let val=this.getPropertyValue(lh);if(!val){allMatch=!1;break}let prio=this.getPropertyPriority(lh);if(firstPrio===null)firstPrio=prio;else if(firstPrio!==prio)allSamePriority=!1;let trimmed=val.trim().toLowerCase();if(["initial","inherit","unset","revert","revert-layer"].includes(trimmed)){if(allCssWide===null)allCssWide=trimmed;else if(allCssWide!==trimmed){allMatch=!1;break}}else{allMatch=!1;break}}if(allMatch&&allCssWide&&allSamePriority)return allCssWide}let shorthand=SHORTHANDS[property];if(shorthand){let longhandValues={},anySet=!1,important=null,consistentImportant=!0,allLonghandsToCheck=getShorthandAllLonghands(shorthand);for(let lh of allLonghandsToCheck){let item=this._getLonghandForContraction(lh);if(item&&item.value.length>0){anySet=!0,longhandValues[lh]=item.value;let isImp=item.important;if(important===null)important=isImp;else if(important!==isImp)consistentImportant=!1}}if(anySet&&consistentImportant){let wm=this.getPropertyValue("writing-mode")||"horizontal-tb",dir=this.getPropertyValue("direction")||"ltr",physicalToLogicalSet=new Map;for(let lh of Object.keys(longhandValues)){let physicalProp=resolveLogicalProperty(lh,wm,dir),decl=this._getWinningDeclaration(lh);if(physicalToLogicalSet.has(physicalProp)){let other=physicalToLogicalSet.get(physicalProp);if(!(decl?.name==="all"||decl?.fromAll||other.decl?.name==="all"||other.decl?.fromAll)){if(serialize(longhandValues[lh]).trim()!==serialize(longhandValues[other.lh]).trim())return""}}if(decl&&decl.name!=="all"&&!decl.fromAll)physicalToLogicalSet.set(physicalProp,{lh,decl});else if(!physicalToLogicalSet.has(physicalProp))physicalToLogicalSet.set(physicalProp,{lh,decl})}let valuesForContractor={},anyLogical=!1,allLonghands=shorthand.logicalLonghands?[...shorthand.longhands,...shorthand.logicalLonghands]:shorthand.longhands;for(let lh of allLonghands){let val=longhandValues[lh];if(val){if(valuesForContractor[lh]=val,resolveLogicalProperty(lh,wm,dir)!==lh)anyLogical=!0;if(shorthand.logicalLonghands?.includes(lh))anyLogical=!0}}let hasAllLonghands=shorthand.longhands.every((lh)=>valuesForContractor[lh]),hasAllLogicals=shorthand.logicalLonghands?.every((lh)=>valuesForContractor[lh]);if(hasAllLonghands){let res=shorthand.contract(valuesForContractor);if(res)return res}if(hasAllLogicals&&anyLogical){let res=shorthand.contract(valuesForContractor);if(res&&!res.startsWith("logical")&&LOGICAL_SHORTHANDS.has(property)&&!CSS_WIDE_KEYWORDS.has(res.trim().toLowerCase()))res="logical "+res;return res||""}}let directDecl=this._getWinningDeclaration(property);if(directDecl){let directIdx=this._declarations.indexOf(directDecl),allLonghands=getShorthandAllLonghands(shorthand);if(this._declarations.some((d,idx)=>{if(!allLonghands.includes(d.name))return!1;if(d.important&&!directDecl.important)return!0;if(d.important===directDecl.important&&idx>directIdx)return!0;return!1}))return"";return serialize(directDecl.value).trim()}return""}let winner=this._getWinningDeclaration(property);if(winner){if(winner.name==="all")return serialize(winner.value);let isCustom=winner.name.startsWith("--");if(isCustom){if(winner.raw!==void 0&&winner.raw.includes("/*"))return winner.raw.trim();let serialized=serialize(winner.value,isCustom).trim();if(serialized==="")return" ";return serialized}if(winner.name==="font-family")return serializeFontFamily(winner.value);if(winner.name==="flex-basis"&&serialize(winner.value).trim()==="0")return"0px";return serialize(winner.value,isCustom)}return""}_getExactWinningDeclaration(property){if(!property.startsWith("--"))property=property.toLowerCase();let isCoveredByAll=!property.startsWith("--")&&property!=="direction"&&property!=="unicode-bidi"&&property!=="all",winner=null;for(let i=this._declarations.length-1;i>=0;i--){let d=this._declarations[i],isMatch=d.name===property,isAll=d.name==="all"&&isCoveredByAll;if(isMatch||isAll){if(!winner||d.important&&!winner.important){if(winner=d,winner.important)break}}}return winner}_getWinningDeclaration(property){let exact=this._getExactWinningDeclaration(property),shorthands=LONGHAND_TO_SHORTHAND[property];if(shorthands)for(let sh of shorthands){let shDecl=this._getExactWinningDeclaration(sh);if(shDecl){if(shDecl.important&&(!exact||!exact.important))return null;if(exact&&!exact.important&&!shDecl.important){if(this._declarations.indexOf(shDecl)>this._declarations.indexOf(exact))return null}}}return exact}getPropertyPriority(property){if(!property.startsWith("--"))property=property.toLowerCase();let shorthand=SHORTHANDS[property];if(shorthand){if(this.getPropertyValue(property)==="")return"";let checkSet=(longhands)=>{let importantCount=0,values={};for(let lh of longhands){let item=this._getLonghandForContraction(lh);if(item&&item.value.length>0){if(values[lh]=item.value,item.important)importantCount++}}return{importantCount,values}},primaryResult=checkSet(shorthand.longhands);if(primaryResult.importantCount===shorthand.longhands.length&&shorthand.longhands.length>0){if(shorthand.contract(primaryResult.values))return"important"}if(shorthand.logicalLonghands){let logicalResult=checkSet(shorthand.logicalLonghands);if(logicalResult.importantCount===shorthand.logicalLonghands.length&&shorthand.logicalLonghands.length>0){if(shorthand.contract(logicalResult.values))return"important"}}if(shorthand.physicalLonghands){let physicalResult=checkSet(shorthand.physicalLonghands);if(physicalResult.importantCount===shorthand.physicalLonghands.length&&shorthand.physicalLonghands.length>0){if(shorthand.contract(physicalResult.values))return"important"}}let directDecl=this._getWinningDeclaration(property);if(directDecl&&directDecl.important)return"important";return""}let winner=this._getWinningDeclaration(property);return winner&&winner.important?"important":""}setProperty(property,value,priority=""){this._setPropertyInternal(property,value,priority,!0,!1)}_setPropertyInternal(property,value,priority="",notify=!0,fromAll=!1){if(this._readonly)throw new DOMException("Modification is disallowed","NoModificationAllowedError");if(property==="--")return;if(property.startsWith("--")&&!this._allowCustomProperties)return;if(!property.startsWith("--"))property=property.toLowerCase();if(!property.startsWith("--")&&!this._isPropertySupported(property))return;let normalizedPriority=(priority??"").trim().toLowerCase();if(normalizedPriority!==""&&normalizedPriority!=="important")return;let isImportant=normalizedPriority==="important";if(isImportant&&!this._allowImportant)return;if(value===null||value===""){this.removeProperty(property);return}if(value===void 0&&!property.startsWith("--")&&!CUSTOM_IDENT_PROPERTIES.has(property))return;let valueStr=typeof value==="string"?value:String(value);if(property.startsWith("--")){if(!isValidDashedIdent(property))return;let tokens=tokenize(valueStr);if(tokens.some((t)=>t.type==="bad-string"||t.type==="bad-url"))return;if(!validateCustomPropertyValue(parseComponentValues(tokens)))return}let tokens=tokenize(valueStr,property==="unicode-range");if(tokens.some((t)=>t.type==="bad-string"||t.type==="bad-url"))return;if(property==="all")this._declarations=this._declarations.filter((d)=>d.name!=="all"),this._declMap.delete("all");let compVals=parseComponentValues(tokens);if(!property.startsWith("--")){if(!validateDeclarationValue(compVals))return;if(ParseHooks.validatePropertyValue&&!ParseHooks.validatePropertyValue(property,valueStr,value))return}let shorthand=SHORTHANDS[property];if(shorthand){let hasVar=valueStr.includes("var(")||valueStr.includes("env(");if(!hasVar){let expanded=shorthand.expand(compVals);if(expanded){if(ParseHooks.validatePropertyValue){for(let[lh,val]of Object.entries(expanded))if(!ParseHooks.validatePropertyValue(lh,serialize(val),val))return}for(let[lh,val]of Object.entries(expanded))this._setPropertyInternal(lh,serialize(val),normalizedPriority,!1,property==="all"||fromAll);if(notify){let allLh=getShorthandAllLonghands(shorthand);this._rawDeclarations=this._rawDeclarations.filter((d)=>d.name!==property&&!allLh.includes(d.name)),this._rawDeclarations.push({type:"declaration",name:property,value:compVals,important:isImportant}),this._onChange?.()}return}}if(hasVar&&validateDeclarationValue(compVals))for(let lh of shorthand.longhands)this.removeProperty(lh);else if(!shorthand.stub)return}let existing=this._declMap.get(property),componentValues=parseComponentValues(tokens);if(property==="unicode-range"){let assembled=assembleUnicodeRanges(componentValues);if(!assembled)return;componentValues.splice(0,componentValues.length,...assembled)}if(existing){if(existing.value=componentValues,existing.important=isImportant,existing.fromAll=fromAll,property.startsWith("--"))existing.raw=valueStr??void 0;let idx=this._declarations.indexOf(existing);if(idx!==-1){let info=LOGICAL_PROPERTY_INFO[property];if(this._declarations.slice(idx+1).some((d)=>{if(d.name==="all")return!0;if(!info)return!1;let otherInfo=LOGICAL_PROPERTY_INFO[d.name];return otherInfo&&otherInfo.group===info.group&&otherInfo.logic!==info.logic}))this._declarations.splice(idx,1),this._declarations.push(existing)}}else{let decl={type:"declaration",name:property,value:componentValues,important:isImportant,fromAll:fromAll||void 0,raw:property.startsWith("--")?valueStr??void 0:void 0};this._declarations.push(decl),this._declMap.set(property,decl)}if(notify)this._rawDeclarations=this._rawDeclarations.filter((d)=>d.name!==property),this._rawDeclarations.push({type:"declaration",name:property,value:componentValues,important:isImportant,raw:property.startsWith("--")?valueStr??void 0:void 0}),this._onChange?.()}removeProperty(property){if(this._readonly)throw new DOMException("Modification is disallowed","NoModificationAllowedError");if(!property.startsWith("--"))property=property.toLowerCase();if(property==="all"){let value=this.getPropertyValue("all"),changed=!1;this._rawDeclarations=this._rawDeclarations.filter((d)=>d.name==="direction"||d.name==="unicode-bidi"||d.name.startsWith("--"));for(let i=this._declarations.length-1;i>=0;i--){let d=this._declarations[i];if(d.name!=="direction"&&d.name!=="unicode-bidi"&&!d.name.startsWith("--"))this._declarations.splice(i,1),this._declMap.delete(d.name),changed=!0}if(changed)this._onChange?.();return value}let shorthand=SHORTHANDS[property];if(shorthand){let value=this.getPropertyValue(property),allLh=shorthand.logicalLonghands?[...shorthand.longhands,...shorthand.logicalLonghands]:shorthand.longhands;this._rawDeclarations=this._rawDeclarations.filter((d)=>d.name!==property&&!allLh.includes(d.name));let changed=!1;for(let lh of allLh)if(this._declMap.has(lh)){let index=this._declarations.findIndex((d)=>d.name===lh);if(index!==-1)this._declarations.splice(index,1),this._declMap.delete(lh),changed=!0}let index=this._declarations.findIndex((d)=>d.name===property);if(index!==-1)this._declarations.splice(index,1),this._declMap.delete(property),changed=!0;if(changed)this._onChange?.();return value}let value=this.getPropertyValue(property);this._rawDeclarations=this._rawDeclarations.filter((d)=>d.name!==property);let index=this._declarations.findIndex((d)=>d.name===property);if(index!==-1)return this._declarations.splice(index,1),this._declMap.delete(property),this._onChange?.(),value;return""}get cssText(){if(this._declarations.length===0)return"";return serializeDeclarations(this._declarations)}_applyCssText(value){let tokens=tokenize(value),newStyle;try{newStyle=parseStyleAttribute(tokens)}catch{return!1}if(!newStyle)return!1;this._declarations.length=0,this._rawDeclarations=newStyle._rawDeclarations.filter((d)=>{if(d.important&&!this._allowImportant)return!1;if(d.name.startsWith("--"))return this._allowCustomProperties;return this._isPropertySupported(d.name.toLowerCase())}),this._declMap.clear();for(let d of newStyle._declarations){if(d.name==="--")continue;if(d.important&&!this._allowImportant)continue;let normalizedName=d.name.startsWith("--")?d.name:d.name.toLowerCase();if(normalizedName.startsWith("--")&&!this._allowCustomProperties)continue;if(!normalizedName.startsWith("--")&&!this._isPropertySupported(normalizedName))continue;d.name=normalizedName;let shorthand=SHORTHANDS[d.name];if(shorthand){if(!(serialize(d.value).includes("var(")||serialize(d.value).includes("env("))){let expanded=shorthand.expand(d.value);if(expanded){for(let[lh,val]of Object.entries(expanded))this._addDeclaration({type:"declaration",name:lh,value:val,important:d.important,fromAll:d.name==="all"||d.fromAll});continue}}}this._addDeclaration(d)}return!0}set cssText(value){if(this._readonly)throw new DOMException("Modification is disallowed","NoModificationAllowedError");if(this._applyCssText(value))this._onChange?.(!0)}_isPropertySupported(property){return SUPPORTED_PROPERTIES.has(property)}*[Symbol.iterator](){for(let i=0;i<this.length;i++)yield this.item(i)}};applyWebIDLInterface(CSSStyleDeclaration2);var CSSKeyframeStyleDeclaration=class extends CSSStyleDeclaration2{get _filterDeclarationsInConstructor(){return!0}_isPropertySupported(property){return property!=="animation-name"&&super._isPropertySupported(property)}},CSSFontFaceDescriptors=class extends CSSStyleDeclaration2{_isPropertySupported(property){return super._isPropertySupported(property)||FONT_FACE_DESCRIPTORS.has(property)}},PAGE_DESCRIPTORS_INTERNAL=Symbol("CSSPageDescriptors.internal"),CSSPageDescriptors=class extends CSSStyleDeclaration2{get _filterDeclarationsInConstructor(){return!0}constructor(declarations,internalToken){if(internalToken!==PAGE_DESCRIPTORS_INTERNAL)throw TypeError("Illegal constructor");super(declarations)}_isPropertySupported(property){return PAGE_ALLOWED_PROPERTIES.has(property)}};function defineDescriptorProperties(proto,dashedProps,skip){for(let cssProp of dashedProps){if(cssProp===skip)continue;let desc={get(){return this.getPropertyValue(cssProp)},set(val){this.setProperty(cssProp,val===null||val===void 0?"":String(val))},enumerable:!0,configurable:!0};if(Object.defineProperty(proto,cssProp,desc),cssProp.includes("-")){let camelProp=cssProp.replace(/-([a-z])/g,(_,c)=>c.toUpperCase());Object.defineProperty(proto,camelProp,desc)}}}defineDescriptorProperties(CSSPageDescriptors.prototype,PAGE_DESCRIPTOR_PROPERTIES);var CSSPositionTryDescriptors=class extends CSSStyleDeclaration2{get _filterDeclarationsInConstructor(){return!0}get _allowCustomProperties(){return!1}get _allowImportant(){return!1}constructor(declarations,internalToken){if(internalToken!==PAGE_DESCRIPTORS_INTERNAL)throw TypeError("Illegal constructor");super(declarations)}_isPropertySupported(property){return POSITION_TRY_ALLOWED_PROPERTIES.has(property)}};defineDescriptorProperties(CSSPositionTryDescriptors.prototype,POSITION_TRY_ALLOWED_PROPERTIES,"inset-area");var CSSMarginDescriptors=class extends CSSStyleDeclaration2{};applyWebIDLInterface(CSSFontFaceDescriptors);applyWebIDLInterface(CSSPageDescriptors);applyWebIDLInterface(CSSPositionTryDescriptors);applyWebIDLInterface(CSSMarginDescriptors);var tagName4="style";class HTMLStyleElement extends TextElement{constructor(ownerDocument,localName=tagName4){super(ownerDocument,localName);this[SHEET]=null}get sheet(){let sheet=this[SHEET];if(sheet!==null)return sheet;return this[SHEET]=parse3(this.textContent)}get innerHTML(){return super.innerHTML||""}set innerHTML(value){super.textContent=value,this[SHEET]=null}get innerText(){return super.innerText||""}set innerText(value){super.textContent=value,this[SHEET]=null}get textContent(){return super.textContent||""}set textContent(value){super.textContent=value,this[SHEET]=null}}registerHTMLClass(tagName4,HTMLStyleElement);class HTMLTimeElement extends HTMLElement{constructor(ownerDocument,localName="time"){super(ownerDocument,localName)}get dateTime(){return stringAttribute.get(this,"datetime")}set dateTime(value){stringAttribute.set(this,"datetime",value)}}registerHTMLClass("time",HTMLTimeElement);class HTMLFieldSetElement extends HTMLElement{constructor(ownerDocument,localName="fieldset"){super(ownerDocument,localName)}}class HTMLEmbedElement extends HTMLElement{constructor(ownerDocument,localName="embed"){super(ownerDocument,localName)}}class HTMLHRElement extends HTMLElement{constructor(ownerDocument,localName="hr"){super(ownerDocument,localName)}}class HTMLProgressElement extends HTMLElement{constructor(ownerDocument,localName="progress"){super(ownerDocument,localName)}}class HTMLParagraphElement extends HTMLElement{constructor(ownerDocument,localName="p"){super(ownerDocument,localName)}}class HTMLTableElement extends HTMLElement{constructor(ownerDocument,localName="table"){super(ownerDocument,localName)}}class HTMLFrameSetElement extends HTMLElement{constructor(ownerDocument,localName="frameset"){super(ownerDocument,localName)}}class HTMLLIElement extends HTMLElement{constructor(ownerDocument,localName="li"){super(ownerDocument,localName)}}class HTMLBaseElement extends HTMLElement{constructor(ownerDocument,localName="base"){super(ownerDocument,localName)}}class HTMLDataListElement extends HTMLElement{constructor(ownerDocument,localName="datalist"){super(ownerDocument,localName)}}var tagName5="input";class HTMLInputElement extends HTMLElement{constructor(ownerDocument,localName=tagName5){super(ownerDocument,localName)}get autofocus(){return booleanAttribute.get(this,"autofocus")||-1}set autofocus(value){booleanAttribute.set(this,"autofocus",value)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(value){this.setAttribute("placeholder",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}get value(){return stringAttribute.get(this,"value")}set value(value){stringAttribute.set(this,"value",value)}}registerHTMLClass(tagName5,HTMLInputElement);class HTMLParamElement extends HTMLElement{constructor(ownerDocument,localName="param"){super(ownerDocument,localName)}}class HTMLMediaElement extends HTMLElement{constructor(ownerDocument,localName="media"){super(ownerDocument,localName)}}class HTMLAudioElement extends HTMLElement{constructor(ownerDocument,localName="audio"){super(ownerDocument,localName)}}var tagName6="h1";class HTMLHeadingElement extends HTMLElement{constructor(ownerDocument,localName=tagName6){super(ownerDocument,localName)}}registerHTMLClass([tagName6,"h2","h3","h4","h5","h6"],HTMLHeadingElement);class HTMLDirectoryElement extends HTMLElement{constructor(ownerDocument,localName="dir"){super(ownerDocument,localName)}}class HTMLQuoteElement extends HTMLElement{constructor(ownerDocument,localName="quote"){super(ownerDocument,localName)}}var import_canvas=__toESM(require_canvas(),1);var{createCanvas}=import_canvas.default,tagName7="canvas";class HTMLCanvasElement extends HTMLElement{constructor(ownerDocument,localName=tagName7){super(ownerDocument,localName);this[IMAGE]=createCanvas(300,150)}get width(){return this[IMAGE].width}set width(value){numericAttribute.set(this,"width",value),this[IMAGE].width=value}get height(){return this[IMAGE].height}set height(value){numericAttribute.set(this,"height",value),this[IMAGE].height=value}getContext(type){return this[IMAGE].getContext(type)}toDataURL(...args){return this[IMAGE].toDataURL(...args)}}registerHTMLClass(tagName7,HTMLCanvasElement);class HTMLLegendElement extends HTMLElement{constructor(ownerDocument,localName="legend"){super(ownerDocument,localName)}}var tagName8="option";class HTMLOptionElement extends HTMLElement{constructor(ownerDocument,localName=tagName8){super(ownerDocument,localName)}get value(){return stringAttribute.get(this,"value")}set value(value){stringAttribute.set(this,"value",value)}get selected(){return booleanAttribute.get(this,"selected")}set selected(value){let option=this.parentElement?.querySelector("option[selected]");if(option&&option!==this)option.selected=!1;booleanAttribute.set(this,"selected",value)}}registerHTMLClass(tagName8,HTMLOptionElement);class HTMLSpanElement extends HTMLElement{constructor(ownerDocument,localName="span"){super(ownerDocument,localName)}}class HTMLMeterElement extends HTMLElement{constructor(ownerDocument,localName="meter"){super(ownerDocument,localName)}}class HTMLVideoElement extends HTMLElement{constructor(ownerDocument,localName="video"){super(ownerDocument,localName)}}class HTMLTableCellElement extends HTMLElement{constructor(ownerDocument,localName="td"){super(ownerDocument,localName)}}var tagName9="title";class HTMLTitleElement extends TextElement{constructor(ownerDocument,localName=tagName9){super(ownerDocument,localName)}}registerHTMLClass(tagName9,HTMLTitleElement);class HTMLOutputElement extends HTMLElement{constructor(ownerDocument,localName="output"){super(ownerDocument,localName)}}class HTMLTableRowElement extends HTMLElement{constructor(ownerDocument,localName="tr"){super(ownerDocument,localName)}}class HTMLDataElement extends HTMLElement{constructor(ownerDocument,localName="data"){super(ownerDocument,localName)}}class HTMLMenuElement extends HTMLElement{constructor(ownerDocument,localName="menu"){super(ownerDocument,localName)}}var tagName10="select";class HTMLSelectElement extends HTMLElement{constructor(ownerDocument,localName=tagName10){super(ownerDocument,localName)}get options(){let children=new NodeList,{firstElementChild}=this;while(firstElementChild){if(firstElementChild.tagName==="OPTGROUP")children.push(...firstElementChild.children);else children.push(firstElementChild);firstElementChild=firstElementChild.nextElementSibling}return children}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get value(){return this.querySelector("option[selected]")?.value}}registerHTMLClass(tagName10,HTMLSelectElement);class HTMLBRElement extends HTMLElement{constructor(ownerDocument,localName="br"){super(ownerDocument,localName)}}var tagName11="button";class HTMLButtonElement extends HTMLElement{constructor(ownerDocument,localName=tagName11){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}}registerHTMLClass(tagName11,HTMLButtonElement);class HTMLMapElement extends HTMLElement{constructor(ownerDocument,localName="map"){super(ownerDocument,localName)}}class HTMLOptGroupElement extends HTMLElement{constructor(ownerDocument,localName="optgroup"){super(ownerDocument,localName)}}class HTMLDListElement extends HTMLElement{constructor(ownerDocument,localName="dl"){super(ownerDocument,localName)}}var tagName12="textarea";class HTMLTextAreaElement extends TextElement{constructor(ownerDocument,localName=tagName12){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(value){this.setAttribute("placeholder",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}get value(){return this.textContent}set value(content){this.textContent=content}}registerHTMLClass(tagName12,HTMLTextAreaElement);class HTMLFontElement extends HTMLElement{constructor(ownerDocument,localName="font"){super(ownerDocument,localName)}}class HTMLDivElement extends HTMLElement{constructor(ownerDocument,localName="div"){super(ownerDocument,localName)}}var tagName13="link";class HTMLLinkElement extends HTMLElement{constructor(ownerDocument,localName=tagName13){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get href(){return stringAttribute.get(this,"href").trim()}set href(value){stringAttribute.set(this,"href",value)}get hreflang(){return stringAttribute.get(this,"hreflang")}set hreflang(value){stringAttribute.set(this,"hreflang",value)}get media(){return stringAttribute.get(this,"media")}set media(value){stringAttribute.set(this,"media",value)}get rel(){return stringAttribute.get(this,"rel")}set rel(value){stringAttribute.set(this,"rel",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}}registerHTMLClass(tagName13,HTMLLinkElement);var tagName14="slot";class HTMLSlotElement extends HTMLElement{constructor(ownerDocument,localName=tagName14){super(ownerDocument,localName)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}assign(){}assignedNodes(options){let isNamedSlot=!!this.name,hostChildNodes=this.getRootNode().host?.childNodes??[],slottables;if(isNamedSlot)slottables=[...hostChildNodes].filter((node)=>node.slot===this.name);else slottables=[...hostChildNodes].filter((node)=>!node.slot);if(options?.flatten){let result=[];for(let slottable of slottables)if(slottable.localName==="slot")result.push(...slottable.assignedNodes({flatten:!0}));else result.push(slottable);slottables=result}return slottables.length?slottables:[...this.childNodes]}assignedElements(options){let slottables=this.assignedNodes(options).filter((n)=>n.nodeType===1);return slottables.length?slottables:[...this.children]}}registerHTMLClass(tagName14,HTMLSlotElement);class HTMLFormElement extends HTMLElement{constructor(ownerDocument,localName="form"){super(ownerDocument,localName)}}var tagName15="img";class HTMLImageElement extends HTMLElement{constructor(ownerDocument,localName=tagName15){super(ownerDocument,localName)}get alt(){return stringAttribute.get(this,"alt")}set alt(value){stringAttribute.set(this,"alt",value)}get sizes(){return stringAttribute.get(this,"sizes")}set sizes(value){stringAttribute.set(this,"sizes",value)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcset(){return stringAttribute.get(this,"srcset")}set srcset(value){stringAttribute.set(this,"srcset",value)}get title(){return stringAttribute.get(this,"title")}set title(value){stringAttribute.set(this,"title",value)}get width(){return numericAttribute.get(this,"width")}set width(value){numericAttribute.set(this,"width",value)}get height(){return numericAttribute.get(this,"height")}set height(value){numericAttribute.set(this,"height",value)}}registerHTMLClass(tagName15,HTMLImageElement);class HTMLPreElement extends HTMLElement{constructor(ownerDocument,localName="pre"){super(ownerDocument,localName)}}class HTMLUListElement extends HTMLElement{constructor(ownerDocument,localName="ul"){super(ownerDocument,localName)}}var tagName16="meta";class HTMLMetaElement extends HTMLElement{constructor(ownerDocument,localName=tagName16){super(ownerDocument,localName)}get name(){return stringAttribute.get(this,"name")}set name(value){stringAttribute.set(this,"name",value)}get httpEquiv(){return stringAttribute.get(this,"http-equiv")}set httpEquiv(value){stringAttribute.set(this,"http-equiv",value)}get content(){return stringAttribute.get(this,"content")}set content(value){stringAttribute.set(this,"content",value)}get charset(){return stringAttribute.get(this,"charset")}set charset(value){stringAttribute.set(this,"charset",value)}get media(){return stringAttribute.get(this,"media")}set media(value){stringAttribute.set(this,"media",value)}}registerHTMLClass(tagName16,HTMLMetaElement);class HTMLPictureElement extends HTMLElement{constructor(ownerDocument,localName="picture"){super(ownerDocument,localName)}}class HTMLAreaElement extends HTMLElement{constructor(ownerDocument,localName="area"){super(ownerDocument,localName)}}class HTMLOListElement extends HTMLElement{constructor(ownerDocument,localName="ol"){super(ownerDocument,localName)}}class HTMLTableCaptionElement extends HTMLElement{constructor(ownerDocument,localName="caption"){super(ownerDocument,localName)}}var tagName17="a";class HTMLAnchorElement extends HTMLElement{constructor(ownerDocument,localName=tagName17){super(ownerDocument,localName)}get href(){return encodeURI(decodeURI(stringAttribute.get(this,"href"))).trim()}set href(value){stringAttribute.set(this,"href",decodeURI(value))}get download(){return encodeURI(decodeURI(stringAttribute.get(this,"download")))}set download(value){stringAttribute.set(this,"download",decodeURI(value))}get target(){return stringAttribute.get(this,"target")}set target(value){stringAttribute.set(this,"target",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}get rel(){return stringAttribute.get(this,"rel")}set rel(value){stringAttribute.set(this,"rel",value)}}registerHTMLClass(tagName17,HTMLAnchorElement);class HTMLLabelElement extends HTMLElement{constructor(ownerDocument,localName="label"){super(ownerDocument,localName)}}class HTMLUnknownElement extends HTMLElement{constructor(ownerDocument,localName="unknown"){super(ownerDocument,localName)}}class HTMLModElement extends HTMLElement{constructor(ownerDocument,localName="mod"){super(ownerDocument,localName)}}class HTMLDetailsElement extends HTMLElement{constructor(ownerDocument,localName="details"){super(ownerDocument,localName)}}var tagName18="source";class HTMLSourceElement extends HTMLElement{constructor(ownerDocument,localName=tagName18){super(ownerDocument,localName)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcset(){return stringAttribute.get(this,"srcset")}set srcset(value){stringAttribute.set(this,"srcset",value)}get sizes(){return stringAttribute.get(this,"sizes")}set sizes(value){stringAttribute.set(this,"sizes",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}}registerHTMLClass(tagName18,HTMLSourceElement);class HTMLTrackElement extends HTMLElement{constructor(ownerDocument,localName="track"){super(ownerDocument,localName)}}class HTMLMarqueeElement extends HTMLElement{constructor(ownerDocument,localName="marquee"){super(ownerDocument,localName)}}var HTMLClasses={HTMLElement,HTMLTemplateElement,HTMLHtmlElement,HTMLScriptElement,HTMLFrameElement,HTMLIFrameElement,HTMLObjectElement,HTMLHeadElement,HTMLBodyElement,HTMLStyleElement,HTMLTimeElement,HTMLFieldSetElement,HTMLEmbedElement,HTMLHRElement,HTMLProgressElement,HTMLParagraphElement,HTMLTableElement,HTMLFrameSetElement,HTMLLIElement,HTMLBaseElement,HTMLDataListElement,HTMLInputElement,HTMLParamElement,HTMLMediaElement,HTMLAudioElement,HTMLHeadingElement,HTMLDirectoryElement,HTMLQuoteElement,HTMLCanvasElement,HTMLLegendElement,HTMLOptionElement,HTMLSpanElement,HTMLMeterElement,HTMLVideoElement,HTMLTableCellElement,HTMLTitleElement,HTMLOutputElement,HTMLTableRowElement,HTMLDataElement,HTMLMenuElement,HTMLSelectElement,HTMLBRElement,HTMLButtonElement,HTMLMapElement,HTMLOptGroupElement,HTMLDListElement,HTMLTextAreaElement,HTMLFontElement,HTMLDivElement,HTMLLinkElement,HTMLSlotElement,HTMLFormElement,HTMLImageElement,HTMLPreElement,HTMLUListElement,HTMLMetaElement,HTMLPictureElement,HTMLAreaElement,HTMLOListElement,HTMLTableCaptionElement,HTMLAnchorElement,HTMLLabelElement,HTMLUnknownElement,HTMLModElement,HTMLDetailsElement,HTMLSourceElement,HTMLTrackElement,HTMLMarqueeElement};var voidElements3={test:()=>!0},Mime={"text/html":{docType:"<!DOCTYPE html>",ignoreCase:!0,voidElements:/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i},"image/svg+xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"text/xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"application/xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"application/xhtml+xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3}};class CustomEvent extends GlobalEvent{constructor(type,eventInitDict={}){super(type,eventInitDict);this.detail=eventInitDict.detail}}class InputEvent extends GlobalEvent{constructor(type,inputEventInit={}){super(type,inputEventInit);this.inputType=inputEventInit.inputType,this.data=inputEventInit.data,this.dataTransfer=inputEventInit.dataTransfer,this.isComposing=inputEventInit.isComposing||!1,this.ranges=inputEventInit.ranges}}var ImageClass=(ownerDocument)=>class extends HTMLImageElement{constructor(width,height){super(ownerDocument);switch(arguments.length){case 1:this.height=width,this.width=width;break;case 2:this.height=height,this.width=width;break}}};var deleteContents=({[START]:start,[END]:end},fragment=null)=>{setAdjacent(start[PREV],end[NEXT]);do{let after=getEnd(start),next=after===end?after:after[NEXT];if(fragment)fragment.insertBefore(start,fragment[END]);else start.remove();start=next}while(start!==end)};class Range{constructor(){this[START]=null,this[END]=null,this.commonAncestorContainer=null}insertNode(newNode){this[END].parentNode.insertBefore(newNode,this[START])}selectNode(node){this[START]=node,this[END]=getEnd(node)}selectNodeContents(node){this.selectNode(node),this.commonAncestorContainer=node}surroundContents(parentNode){parentNode.replaceChildren(this.extractContents())}setStartBefore(node){this[START]=node}setStartAfter(node){this[START]=node.nextSibling}setEndBefore(node){this[END]=getEnd(node.previousSibling)}setEndAfter(node){this[END]=getEnd(node)}cloneContents(){let{[START]:start,[END]:end}=this,fragment=start.ownerDocument.createDocumentFragment();while(start!==end)if(fragment.insertBefore(start.cloneNode(!0),fragment[END]),start=getEnd(start),start!==end)start=start[NEXT];return fragment}deleteContents(){deleteContents(this)}extractContents(){let fragment=this[START].ownerDocument.createDocumentFragment();return deleteContents(this,fragment),fragment}createContextualFragment(html){let{commonAncestorContainer:doc}=this,isSVG="ownerSVGElement"in doc,document=isSVG?doc.ownerDocument:doc,content=htmlToFragment(document,html);if(isSVG){let childNodes=[...content.childNodes];content=document.createDocumentFragment(),Object.setPrototypeOf(content,SVGElement.prototype),content.ownerSVGElement=document;for(let child of childNodes)Object.setPrototypeOf(child,SVGElement.prototype),child.ownerSVGElement=document,content.appendChild(child)}else this.selectNode(content);return content}cloneRange(){let range=new Range;return range[START]=this[START],range[END]=this[END],range}}var isOK=({nodeType},mask)=>{switch(nodeType){case ELEMENT_NODE:return mask&SHOW_ELEMENT;case TEXT_NODE:return mask&SHOW_TEXT;case COMMENT_NODE:return mask&SHOW_COMMENT;case CDATA_SECTION_NODE:return mask&SHOW_CDATA_SECTION}return 0};class TreeWalker{constructor(root,whatToShow=SHOW_ALL){this.root=root,this.currentNode=root,this.whatToShow=whatToShow;let{[NEXT]:next,[END]:end}=root;if(root.nodeType===DOCUMENT_NODE){let{documentElement}=root;next=documentElement,end=documentElement[END]}let nodes=[];while(next&&next!==end){if(isOK(next,whatToShow))nodes.push(next);next=next[NEXT]}this[PRIVATE]={i:0,nodes}}nextNode(){let $=this[PRIVATE];return this.currentNode=$.i<$.nodes.length?$.nodes[$.i++]:null,this.currentNode}}var query=(method,ownerDocument,selectors)=>{let{[NEXT]:next,[END]:end}=ownerDocument;return method.call({ownerDocument,[NEXT]:next,[END]:end},selectors)},globalExports=assign({},Facades,HTMLClasses,{CustomEvent,Event:GlobalEvent,EventTarget:DOMEventTarget,InputEvent,NamedNodeMap,NodeList}),window=new WeakMap;class Document2 extends NonElementParentNode{constructor(type){super(null,"#document",DOCUMENT_NODE);this[CUSTOM_ELEMENTS]={active:!1,registry:null},this[MUTATION_OBSERVER]={active:!1,class:null},this[MIME]=Mime[type],this[DOCTYPE]=null,this[DOM_PARSER]=null,this[GLOBALS]=null,this[IMAGE]=null,this[UPGRADE]=null}get defaultView(){if(!window.has(this))window.set(this,new Proxy(globalThis,{set:(target,name,value)=>{switch(name){case"addEventListener":case"removeEventListener":case"dispatchEvent":this[EVENT_TARGET][name]=value;break;default:target[name]=value;break}return!0},get:(globalThis2,name)=>{switch(name){case"addEventListener":case"removeEventListener":case"dispatchEvent":if(!this[EVENT_TARGET]){let et=this[EVENT_TARGET]=new DOMEventTarget;et.dispatchEvent=et.dispatchEvent.bind(et),et.addEventListener=et.addEventListener.bind(et),et.removeEventListener=et.removeEventListener.bind(et)}return this[EVENT_TARGET][name];case"document":return this;case"navigator":return{userAgent:"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"};case"window":return window.get(this);case"customElements":if(!this[CUSTOM_ELEMENTS].registry)this[CUSTOM_ELEMENTS]=new CustomElementRegistry(this);return this[CUSTOM_ELEMENTS];case"performance":return globalThis2.performance;case"DOMParser":return this[DOM_PARSER];case"Image":if(!this[IMAGE])this[IMAGE]=ImageClass(this);return this[IMAGE];case"MutationObserver":if(!this[MUTATION_OBSERVER].class)this[MUTATION_OBSERVER]=new MutationObserverClass(this);return this[MUTATION_OBSERVER].class}return this[GLOBALS]&&this[GLOBALS][name]||globalExports[name]||globalThis2[name]}}));return window.get(this)}get doctype(){let docType=this[DOCTYPE];if(docType)return docType;let{firstChild}=this;if(firstChild&&firstChild.nodeType===DOCUMENT_TYPE_NODE)return this[DOCTYPE]=firstChild;return null}set doctype(value){if(/^([a-z:]+)(\s+system|\s+public(\s+"([^"]+)")?)?(\s+"([^"]+)")?/i.test(value)){let{$1:name,$4:publicId,$6:systemId}=RegExp;this[DOCTYPE]=new DocumentType(this,name,publicId,systemId),knownSiblings(this,this[DOCTYPE],this[NEXT])}}get documentElement(){return this.firstElementChild}get isConnected(){return!0}_getParent(){return this[EVENT_TARGET]}createAttribute(name){return new Attr(this,name)}createCDATASection(data){return new CDATASection(this,data)}createComment(textContent){return new Comment3(this,textContent)}createDocumentFragment(){return new DocumentFragment(this)}createDocumentType(name,publicId,systemId){return new DocumentType(this,name,publicId,systemId)}createElement(localName){return new Element2(this,localName)}createRange(){let range=new Range;return range.commonAncestorContainer=this,range}createTextNode(textContent){return new Text6(this,textContent)}createTreeWalker(root,whatToShow=-1){return new TreeWalker(root,whatToShow)}createNodeIterator(root,whatToShow=-1){return this.createTreeWalker(root,whatToShow)}createEvent(name){let event=create(name==="Event"?new GlobalEvent(""):new CustomEvent(""));return event.initEvent=event.initCustomEvent=(type,canBubble=!1,cancelable=!1,detail)=>{event.bubbles=!!canBubble,defineProperties(event,{type:{value:type},canBubble:{value:canBubble},cancelable:{value:cancelable},detail:{value:detail}})},event}cloneNode(deep=!1){let{constructor,[CUSTOM_ELEMENTS]:customElements,[DOCTYPE]:doctype}=this,document=new constructor;if(document[CUSTOM_ELEMENTS]=customElements,deep){let end=document[END],{childNodes}=this;for(let{length}=childNodes,i=0;i<length;i++)document.insertBefore(childNodes[i].cloneNode(!0),end);if(doctype)document[DOCTYPE]=childNodes[0]}return document}importNode(externalNode){let deep=1<arguments.length&&!!arguments[1],node=externalNode.cloneNode(deep),{[CUSTOM_ELEMENTS]:customElements}=this,{active}=customElements,upgrade=(element)=>{let{ownerDocument,nodeType}=element;if(element.ownerDocument=this,active&&ownerDocument!==this&&nodeType===ELEMENT_NODE)customElements.upgrade(element)};if(upgrade(node),deep)switch(node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:{let{[NEXT]:next,[END]:end}=node;while(next!==end){if(next.nodeType===ELEMENT_NODE)upgrade(next);next=next[NEXT]}break}}return node}toString(){return this.childNodes.join("")}querySelector(selectors){return query(super.querySelector,this,selectors)}querySelectorAll(selectors){return query(super.querySelectorAll,this,selectors)}getElementsByTagNameNS(_,name){return this.getElementsByTagName(name)}createAttributeNS(_,name){return this.createAttribute(name)}createElementNS(nsp,localName,options){return nsp===SVG_NAMESPACE?new SVGElement(this,localName,null):this.createElement(localName,options)}}setPrototypeOf(globalExports.Document=function(){illegalConstructor()},Document2).prototype=Document2.prototype;var createHTMLElement=(ownerDocument,builtin,localName,options)=>{if(!builtin&&htmlClasses.has(localName))return new(htmlClasses.get(localName))(ownerDocument,localName);let{[CUSTOM_ELEMENTS]:{active,registry}}=ownerDocument;if(active){let ce=builtin?options.is:localName;if(registry.has(ce)){let{Class}=registry.get(ce),element=new Class(ownerDocument,localName);return customElements.set(element,{connected:!1}),element}}return new HTMLElement(ownerDocument,localName)};class HTMLDocument extends Document2{constructor(){super("text/html")}get all(){let nodeList=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){switch(next.nodeType){case ELEMENT_NODE:nodeList.push(next);break}next=next[NEXT]}return nodeList}get head(){let{documentElement}=this,{firstElementChild}=documentElement;if(!firstElementChild||firstElementChild.tagName!=="HEAD")firstElementChild=this.createElement("head"),documentElement.prepend(firstElementChild);return firstElementChild}get body(){let{head}=this,{nextElementSibling}=head;if(!nextElementSibling||nextElementSibling.tagName!=="BODY")nextElementSibling=this.createElement("body"),head.after(nextElementSibling);return nextElementSibling}get title(){let{head}=this;return head.getElementsByTagName("title").at(0)?.textContent||""}set title(textContent){let{head}=this,title=head.getElementsByTagName("title").at(0);if(title)title.textContent=textContent;else head.insertBefore(this.createElement("title"),head.firstChild).textContent=textContent}createElement(localName,options){let builtin=!!(options&&options.is),element=createHTMLElement(this,builtin,localName,options);if(builtin)element.setAttribute("is",options.is);return element}}class SVGDocument extends Document2{constructor(){super("image/svg+xml")}toString(){return this[MIME].docType+super.toString()}}class XMLDocument extends Document2{constructor(){super("text/xml")}toString(){return this[MIME].docType+super.toString()}}class DOMParser{parseFromString(markupLanguage,mimeType,globals=null){let isHTML=!1,document;if(mimeType==="text/html")isHTML=!0,document=new HTMLDocument;else if(mimeType==="image/svg+xml")document=new SVGDocument;else document=new XMLDocument;if(document[DOM_PARSER]=DOMParser,globals)document[GLOBALS]=globals;if(isHTML&&markupLanguage==="...")markupLanguage="<!doctype html><html><head></head><body></body></html>";return markupLanguage?parseFromString(document,isHTML,markupLanguage):document}}var{parse:parse4}=JSON;var parseHTML=(html,globals=null)=>new DOMParser().parseFromString(html,"text/html",globals).defaultView;function Document3(){illegalConstructor()}setPrototypeOf(Document3,Document2).prototype=Document2.prototype;import{readdir,readFile,stat}from"node:fs/promises";import{join,relative,resolve}from"node:path";import{isNotationLanguage,renderBlock}from"./index.js";import{parseTabSource}from"./tab/index.js";import{lookupGuitarVoicing}from"./voicings/index.js";var QUOTE2=/^[ \t]{0,3}>[ \t]?/,OPENING=/^(`{3,}|~{3,})(.*)$/,LIST_MARKER=/^(?:[-*+]|\d{1,9}[.)])[ \t]+/;function unquote(line,depth){let rest=line;for(let i=0;i<depth;i++){let m=QUOTE2.exec(rest);if(!m)return null;rest=rest.slice(m[0].length)}return rest}var dedent=(line,indent)=>{let i=0;while(i<indent&&(line[i]===" "||line[i]==="\t"))i++;return line.slice(i)},columns=(lead)=>[...lead].reduce((n,c)=>n+(c==="\t"?4-n%4:1),0);function opensComment(line){if((line.split("%%").length-1)%2===1)return!0;let html=line.lastIndexOf("<!--");return html>=0&&!line.includes("-->",html+4)}var commentEnd=(line)=>(line.split("%%").length-1)%2===1?"%%":"-->";function parseMarkdown(text){let lines=text.replace(/^\uFEFF/,"").split(/\r\n|\r|\n/),i=0,frontMatter=null;if(lines[0]?.trimEnd()==="---"){let end=lines.findIndex((l,n)=>n>0&&/^(?:---|\.\.\.)\s*$/.test(l));if(end>0)frontMatter=lines.slice(1,end).join(`
|
|
52
32
|
`),i=end+1}let blocks=[],comment=null,inList=!1;for(;i<lines.length;i++){let line=lines[i];if(comment){let end=line.indexOf(comment);if(end<0)continue;if(comment=null,opensComment(line.slice(end+2)))comment=commentEnd(line.slice(end+2));continue}let rest=line,depth=0;for(let m=QUOTE2.exec(rest);m;m=QUOTE2.exec(rest))rest=rest.slice(m[0].length),depth++;let spaces=/^[ \t]*/.exec(rest)[0].length,marker=LIST_MARKER.exec(rest.slice(spaces))?.[0].length??0,indent=spaces+marker;if(marker)inList=!0;else if(rest.trim()&&columns(rest.slice(0,spaces))===0)inList=!1;let open=OPENING.exec(rest.slice(indent));if(!open){if(opensComment(rest))comment=commentEnd(rest);continue}if(!marker&&!inList&&columns(rest.slice(0,spaces))>3)continue;let fence=open[1],info=open[2];if(fence[0]==="`"&&info.includes("`"))continue;let body=[],start=i;for(i++;i<lines.length;i++){let inner=unquote(lines[i],depth);if(inner===null){i--;break}let close=/^[ \t]*(`{3,}|~{3,})[ \t]*$/.exec(inner);if(close&&close[1][0]===fence[0]&&close[1].length>=fence.length)break;body.push(dedent(inner,indent))}blocks.push({language:info.trim().split(/\s+/)[0]??"",line:start+1,source:body.join(`
|
|
53
33
|
`)})}return{frontMatter,blocks}}import{chordNoteSet,midiOf,nameOf,noteOf}from"./index.js";var classes=(el)=>(el.getAttribute("class")??"").split(/\s+/),has=(el,cls)=>classes(el).includes(cls),text=(el)=>el?.textContent?.trim()||null,int=(value)=>value===null?null:Number(value),marksOf=(el)=>classes(el).flatMap((c)=>c==="mn-char"?["characteristic"]:c==="mn-diff"?["different"]:c==="mn-tone"?["chord tone"]:c==="mn-passing"?["passing"]:[]);function spelled(name,midi){let octave=Math.floor(midi/12)-1;for(let o of[octave,octave-1,octave+1])if(midiOf(`${name}${o}`)===midi)return`${name}${o}`;return noteOf(midi)}var labelAfter=(el,cls)=>{let next=el.nextElementSibling;return next&&has(next,cls)?text(next):null};function capoOf(svg){let capo=int(svg.getAttribute("data-mn-capo"));if(!capo)return{};return{capo,fretsFrom:svg.getAttribute("data-mn-frets-from")==="nut"?"nut":"capo"}}function guitarChord(svg){let chord=svg.getAttribute("data-mn-chord"),sounds=svg.getAttribute("data-mn-sounds"),set=sounds?chordNoteSet(sounds):chord?chordNoteSet(chord):null,strings=[...svg.querySelectorAll("[data-mn-string]")].map((el)=>{let fret=int(el.getAttribute("data-mn-fret")),midi=int(el.getAttribute("data-midi")),name=midi===null?null:set?.members.find((m)=>m.chroma===midi%12)?.name??nameOf(midi,set?.preferFlats);return{string:Number(el.getAttribute("data-mn-string")),fret,note:name!==null&&midi!==null?spelled(name,midi):null,label:fret?labelAfter(el,"mn-dot-text"):null,root:has(el,"mn-root"),mark:has(el,"mn-anchor")?"anchor":has(el,"mn-guide")?"guide":null}}),base=parseInt(text(svg.querySelector(".mn-base-fret"))??"1",10),rows=svg.querySelectorAll("line.mn-fret, line.mn-nut").length-1,frets=strings.map((s)=>s.fret===null?"x":String(s.fret)),barres=[...svg.querySelectorAll(".mn-barre")].map((el)=>({finger:el.getAttribute("data-mn-finger")??"",fret:Number(el.getAttribute("data-mn-fret")),from:Number(el.getAttribute("data-mn-from")),to:Number(el.getAttribute("data-mn-to"))}));return{type:"guitar-chord",title:text(svg.querySelector(".mn-title")),chord,frets:frets.join(frets.some((f)=>f.length>1)?"-":""),fretRange:[base,base+rows-1],strings,...capoOf(svg),...sounds?{sounds}:{},...barres.length?{barres}:{}}}function fretboard(svg){let range=(svg.getAttribute("data-mn-frets")??"0-0").split("-").map(Number),tuning=[...svg.querySelectorAll(".mn-string-name")].map((el)=>text(el)??"?"),dots=[...svg.querySelectorAll(".mn-dot[data-mn-string]")].map((el)=>({string:Number(el.getAttribute("data-mn-string")),fret:Number(el.getAttribute("data-mn-fret")),note:spelled(el.getAttribute("data-mn-note")??"",Number(el.getAttribute("data-midi"))),label:labelAfter(el,"mn-dot-text"),root:has(el,"mn-root"),marks:marksOf(el)})).sort((a,b)=>b.string-a.string||a.fret-b.fret),ghosts=[...svg.querySelectorAll("circle[data-mn-ghost-string]")].map((el)=>({string:Number(el.getAttribute("data-mn-ghost-string")),fret:Number(el.getAttribute("data-mn-fret")),note:spelled(el.getAttribute("data-mn-note")??"",Number(el.getAttribute("data-mn-pitch")))})).sort((a,b)=>b.string-a.string||a.fret-b.fret);return{type:"fretboard",title:text(svg.querySelector(".mn-title")),notes:svg.getAttribute("data-mn-set"),fretRange:[range[0]??0,range[1]??0],tuning:tuning.reverse(),dots,ghosts,...capoOf(svg)}}function keyboard(svg){let all=[...svg.querySelectorAll("rect[data-midi]")],midis=all.map((el)=>Number(el.getAttribute("data-midi"))),fingers=new Map([...svg.querySelectorAll(".mn-key-finger")].map((el)=>[Number(el.getAttribute("data-mn-key")),text(el)])),keys=all.filter((el)=>has(el,"mn-on")).map((el)=>{let midi=Number(el.getAttribute("data-midi"));return{midi,note:spelled(el.getAttribute("data-mn-note")??"",midi),label:labelAfter(el,"mn-key-label"),finger:fingers.get(midi)??null,root:has(el,"mn-root"),marks:marksOf(el),...has(el,"mn-hand-left")?{hand:"left"}:has(el,"mn-hand-right")?{hand:"right"}:{}}}).sort((a,b)=>a.midi-b.midi).map(({midi:_,...key})=>key);return{type:"keyboard",title:text(svg.querySelector(".mn-title")),chord:svg.getAttribute("data-mn-chord"),notes:svg.getAttribute("data-mn-set"),keyRange:[noteOf(Math.min(...midis)),noteOf(Math.max(...midis))],keys,ghosts:all.filter((el)=>has(el,"mn-ghost")).map((el)=>{let midi=Number(el.getAttribute("data-midi"));return spelled(el.getAttribute("data-mn-note")??"",midi)})}}function chart(el){let chords=[];for(let c of el.querySelectorAll(".mn-chord")){let name=text(c);if(name&&!chords.includes(name))chords.push(name)}return{type:"chart",title:text(el.querySelector(".mn-chart-title")),chords,sections:[...el.querySelectorAll(".mn-section-label")].map((s)=>text(s)??"")}}function strum(svg){let tempo=svg.getAttribute("data-mn-tempo"),swing=svg.getAttribute("data-mn-swing");return{type:"strum",title:text(svg.querySelector(".mn-title")),pattern:svg.getAttribute("data-mn-strum")??"",time:svg.getAttribute("data-mn-time")??"",subdivision:svg.getAttribute("data-mn-subdivision")??"",tempo:tempo===null?null:Number(tempo),...swing===null?{}:{swing:Number(swing)},chords:[...svg.querySelectorAll("[data-mn-beat][data-mn-chord]")].map((el)=>({beat:Number(el.getAttribute("data-mn-beat")),chord:el.getAttribute("data-mn-chord")??""}))}}function picking(svg){let tempo=svg.getAttribute("data-mn-tempo"),swing=svg.getAttribute("data-mn-swing"),slots=[...svg.querySelectorAll("[data-mn-beat]")],count=Number(svg.getAttribute("data-mn-strings"))||6;return{type:"picking",title:text(svg.querySelector(".mn-title")),pattern:svg.getAttribute("data-mn-picking")??"",time:svg.getAttribute("data-mn-time")??"",subdivision:svg.getAttribute("data-mn-subdivision")??"",tempo:tempo===null?null:Number(tempo),...swing===null?{}:{swing:Number(swing)},chords:slots.filter((el)=>el.hasAttribute("data-mn-chord")).map((el)=>({bar:Number(el.getAttribute("data-mn-bar")),chord:el.getAttribute("data-mn-chord")??""})),notes:slots.map((el)=>{let notes=(el.getAttribute("data-mn-notes")??"").split(" ").filter(Boolean);return notes.length?notes.map((n)=>{let[string,fret]=n.split(":");return`${count-Number(string)}:${fret}`}).join("+"):"-"})}}function describeBlock(el){return[...el.querySelectorAll("svg.mn-svg, .mn-chart, .mn-cell.mn-error, .mn-exercise, .mn-exercise-tab")].map((d)=>{if(has(d,"mn-exercise")||has(d,"mn-exercise-tab"))return{type:"exercise",direction:d.getAttribute("data-mn-exercise")??"",rhythm:d.getAttribute("data-mn-rhythm")??"",tempo:Number(d.getAttribute("data-mn-tempo")),...d.hasAttribute("data-mn-capo")?{capo:Number(d.getAttribute("data-mn-capo"))}:{},notes:(d.getAttribute("data-mn-notes")??"").split(" ").filter(Boolean)};if(has(d,"mn-error"))return{type:"error",message:(text(d.querySelector(".mn-error-message"))??"").replace(/^[a-z]+, /,"")};if(has(d,"mn-chart"))return chart(d);if(has(d,"mn-circle"))return{type:"circle",key:d.getAttribute("data-mn-set"),chords:[...d.querySelectorAll(".mn-circle-chip")].map((c)=>`${text(c.querySelector("title"))?.replace(": "," ")??""}`)};if(has(d,"mn-fretboard"))return fretboard(d);if(has(d,"mn-keyboard"))return withWords(d,keyboard(d));if(has(d,"mn-strum"))return strum(d);if(has(d,"mn-picking"))return picking(d);return withWords(d,guitarChord(d))})}function withWords(svg,diagram){let words=text(svg.closest("figure.mn-captioned")?.querySelector(".mn-fingering")??null);return words?{...diagram,words}:diagram}var quoted=(s)=>s?`"${s}"`:null,listed=(parts)=>parts.filter(Boolean).join(", "),extra=(label,root,more=[])=>[label!==null?`"${label}"`:null,root?"root":null,...more].filter(Boolean).join(" "),capoText=(capo,from)=>`capo ${capo}${from==="nut"?", frets from the nut":""}`;function formatDiagram(d,n){let lines=formatLines(d,n);if((d.type==="guitar-chord"||d.type==="keyboard")&&d.words)lines.push(`${" ".repeat(`${n}. `.length)}words: ${d.words}`);return lines}function formatLines(d,n){let head=`${n}. `,pad=" ".repeat(head.length);switch(d.type){case"error":return[`${head}error: ${d.message}`];case"exercise":return[`${head}${listed(["exercise",d.direction,d.rhythm,`tempo ${d.tempo}`,...d.capo?[`capo ${d.capo}`]:[],`${d.notes.length} notes`])}`,`${pad}${d.notes.join(" ")}`];case"circle":return[`${head}${listed(["circle of fifths",d.key,`chords ${d.chords.join(", ")}`])}`];case"strum":return[`${head}${listed(["strumming pattern",quoted(d.title),d.time,d.subdivision,d.swing!==void 0&&(Math.abs(d.swing-0.6666666666666666)<0.001?"swing":`swing ${Math.round(d.swing*100)}%`),d.tempo!==null&&`tempo ${d.tempo}`])}`,`${pad}${d.pattern}`];case"picking":return[`${head}${listed(["picking pattern",quoted(d.title),d.time,d.subdivision,d.swing!==void 0&&`swing ${Math.round(d.swing*100)}%`,d.tempo!==null&&`tempo ${d.tempo}`,d.chords.length>0&&`chords ${d.chords.map((c)=>`${c.chord} (bar ${c.bar+1})`).join(" ")}`])}`,`${pad}${d.pattern}`,`${pad}notes (string:fret) ${d.notes.join(" ")}`];case"chart":return[`${head}${listed(["chart",quoted(d.title),d.sections.length>0&&`sections ${d.sections.join(", ")}`,`chords ${d.chords.join(" ")||"none"}`])}`];case"guitar-chord":{let strings=d.strings.map((s)=>`${s.string} ${s.fret===null?"x":[s.fret,s.note,extra(s.label,s.root,s.mark?[s.mark]:[])].filter((p)=>p!==null&&p!=="").join(" ")}`);return[`${head}${listed(["chord diagram",quoted(d.title),d.chord&&`chord ${d.chord}`,d.capo!==void 0&&capoText(d.capo,d.fretsFrom),d.sounds!==void 0&&`sounds ${d.sounds}`,`frets ${d.fretRange[0]}-${d.fretRange[1]}`,d.frets,...(d.barres??[]).map((b)=>`barre ${b.finger} at fret ${b.fret}, strings ${b.from} to ${b.to}`)])}`,`${pad}strings: ${strings.join(" | ")}`]}case"fretboard":{let lines=[`${head}${listed(["fretboard",quoted(d.title),d.notes,d.capo!==void 0&&capoText(d.capo,d.fretsFrom),`frets ${d.fretRange[0]}-${d.fretRange[1]}`,`tuning ${d.tuning.join(" ")}`])}`],count=d.tuning.length;for(let string=count;string>=1;string--){let dots=d.dots.filter((dot)=>dot.string===string);if(!dots.length)continue;let name=d.tuning[count-string]??"?";lines.push(`${pad}string ${string} (${name}): ${dots.map((dot)=>[dot.fret,dot.note,extra(dot.label,dot.root,dot.marks)].filter((p)=>p!=="").join(" ")).join(", ")}`)}if(d.ghosts.length)lines.push(`${pad}ghosts (compared scale): ${d.ghosts.map((g)=>`string ${g.string} fret ${g.fret} ${g.note}`).join(", ")}`);return lines}case"keyboard":return[`${head}${listed(["keyboard",quoted(d.title),d.chord&&`chord ${d.chord}`,d.notes,`keys ${d.keyRange[0]}-${d.keyRange[1]}`])}`,`${pad}keys: ${d.keys.map((k)=>[k.note,extra(k.label,k.root,[...k.finger?[`finger ${k.finger}`]:[],...k.hand?[`${k.hand} hand`]:[],...k.marks])].filter(Boolean).join(" ")).join(", ")||"none"}`,...d.ghosts.length?[`${pad}ghosts (compared scale): ${d.ghosts.join(", ")}`]:[]]}}var DIAGRAM_LANGUAGES=["chord","keyboard","fretboard"],oneLine=(s)=>s.split(/[\r\n]+/).map((line)=>line.trim()).filter(Boolean).join(" ");function checkNote(file,text,doc){let note=parseMarkdown(text),reports=[];for(let block of note.blocks){let{language,line,source}=block,report=(status,message,diagrams=[])=>reports.push({file,line,language,status,message,diagrams}),isTab=language==="tab"||language==="score";if((isTab||isNotationLanguage(language))&&!source.trim()){if(note.frontMatter!==null&&DIAGRAM_LANGUAGES.includes(language))report("skipped","empty block: draws from the note's properties, not checked");else report("empty","empty block: draws nothing");continue}if(isTab){try{parseTabSource(language,source),report("skipped","alphaTex is not checked (it needs alphaTab)")}catch(e){report("error",oneLine(e instanceof Error?e.message:String(e)))}continue}if(!isNotationLanguage(language))continue;let host=doc.createElement("div"),result=renderBlock(language,source,host,{voicings:lookupGuitarVoicing}),diagrams=describeBlock(result.el);if(result.ok)report("ok",null,diagrams);else report("error",oneLine(result.error??"error"),diagrams);result.destroy()}return reports}function summarize(files,reports){let count=(status)=>reports.filter((r)=>r.status===status).length;return{files,blocks:reports.length,ok:count("ok"),errors:count("error"),skipped:count("skipped"),empty:count("empty")}}var formatError=(r)=>`${r.file}:${r.line}: ${r.language}: ${r.message}`;function formatReport(r){let where=`${r.file}:${r.line}: ${r.language}`;return r.status==="ok"?`${where}: ok`:`${where}: ${r.status}: ${r.message??""}`}function formatDescription(r){return[formatReport(r),...r.diagrams.flatMap((d,i)=>formatDiagram(d,i+1)).map((l)=>` ${l}`)]}var GLOB=/[*?[{]/;function globToRegExp(pattern){let out="";for(let i=0;i<pattern.length;i++){let c=pattern[i];if(c==="*"&&pattern[i+1]==="*"){let slash=pattern[i+2]==="/";out+=slash?"(?:.*/)?":".*",i+=slash?2:1}else if(c==="*")out+="[^/]*";else if(c==="?")out+="[^/]";else if(c==="{"){let end=pattern.indexOf("}",i);if(end<0)out+="\\{";else out+=`(?:${pattern.slice(i+1,end).split(",").map((p)=>p.replace(/[.+^$()|\\]/g,"\\$&").replace(/\*/g,"[^/]*")).join("|")})`,i=end}else if(c==="["){let end=pattern.indexOf("]",i+1);if(end<0)out+="\\[";else out+=`[${pattern.slice(i+1,end).replace(/^!/,"^").replace(/\\/g,"\\\\")}]`,i=end}else out+=c.replace(/[.+^$()|\\\]}]/g,"\\$&")}return new RegExp(`^${out}$`)}async function walk(dir){let entries=await readdir(dir,{withFileTypes:!0}),files=[];for(let entry of entries.sort((a,b)=>a.name.localeCompare(b.name))){let path=join(dir,entry.name);if(entry.isDirectory()){if(!entry.name.startsWith(".")&&entry.name!=="node_modules")files.push(...await walk(path))}else if(entry.isFile())files.push(path)}return files}var isMarkdown=(path)=>/\.(md|markdown)$/i.test(path);async function expand(arg,cwd){let pattern=arg.replace(/\\/g,"/"),path=resolve(cwd,arg),info=await stat(path).catch(()=>null);if(info)return info.isDirectory()?(await walk(path)).filter(isMarkdown):[path];if(!GLOB.test(pattern))throw Error(`${arg}: no such file or folder`);let segments=pattern.split("/"),first=segments.findIndex((s)=>GLOB.test(s)),base=resolve(cwd,segments.slice(0,first).join("/")||"."),matcher=globToRegExp(segments.slice(first).join("/"));if(!(await stat(base).catch(()=>null))?.isDirectory())return[];return(await walk(base)).filter((f)=>matcher.test(relative(base,f).replace(/\\/g,"/")))}var USAGE=`Usage: music-notation check [options] <files, folders or globs...>
|
|
54
34
|
|