@humain/humain-code 0.5.3 → 0.6.1
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/CHANGELOG.md +180 -0
- package/README.md +2 -2
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-FGFIMZUF.js +66 -0
- package/dist/bundle/chunks/azure-openai-responses-6JNTC7KO.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +261 -237
- package/dist/bundle/chunks/chunk-2H3LUS62.js +1966 -0
- package/dist/bundle/chunks/{chunk-GEISZXXH.js → chunk-4ZBGTJJM.js} +1 -1
- package/dist/bundle/chunks/{chunk-QWXPGBAG.js → chunk-5JSLXC2A.js} +1 -1
- package/dist/bundle/chunks/{chunk-L2VKM23Q.js → chunk-6DE7LJKV.js} +21 -21
- package/dist/bundle/chunks/{chunk-V62QBESW.js → chunk-6E6RHNOU.js} +11 -10
- package/dist/bundle/chunks/chunk-7RZ5BS7U.js +2 -0
- package/dist/bundle/chunks/chunk-AHSNQWZU.js +24 -0
- package/dist/bundle/chunks/{chunk-UJLCKIMZ.js → chunk-AOH2O5CP.js} +3469 -3133
- package/dist/bundle/chunks/{chunk-ODJUBJK2.js → chunk-B7NJMF7B.js} +11 -11
- package/dist/bundle/chunks/chunk-BQ3TMEWD.js +7 -0
- package/dist/bundle/chunks/{chunk-KKCMWB63.js → chunk-C6VERWRZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-CN3Q5UNB.js → chunk-CFHOPLW5.js} +658 -574
- package/dist/bundle/chunks/chunk-CVC2GV26.js +1986 -0
- package/dist/bundle/chunks/{chunk-DU6POZ7E.js → chunk-DHW3REC5.js} +1 -1
- package/dist/bundle/chunks/{chunk-UTNHGOFS.js → chunk-EDONIPUJ.js} +38 -38
- package/dist/bundle/chunks/{chunk-FO2NYB6O.js → chunk-FDGW5ZTG.js} +1147 -1110
- package/dist/bundle/chunks/{chunk-XQX7S3GM.js → chunk-GICL5V54.js} +1 -1
- package/dist/bundle/chunks/chunk-H7Y4QY7K.js +11 -0
- package/dist/bundle/chunks/chunk-HW6HMUXS.js +188 -0
- package/dist/bundle/chunks/chunk-I6AQOITY.js +53 -0
- package/dist/bundle/chunks/{chunk-ZI7TK7HM.js → chunk-IADQJFNH.js} +21 -17
- package/dist/bundle/chunks/chunk-J7AP2BUJ.js +3 -0
- package/dist/bundle/chunks/chunk-JFE52VSN.js +120 -0
- package/dist/bundle/chunks/{chunk-MIJHJNNQ.js → chunk-LDGCU6PD.js} +127 -3
- package/dist/bundle/chunks/{chunk-PS7DGA7B.js → chunk-M4CHQBAI.js} +1 -1
- package/dist/bundle/chunks/{chunk-YDBNMIA3.js → chunk-NN53K2QQ.js} +19 -1
- package/dist/bundle/chunks/{chunk-RTXDU3AA.js → chunk-ONR6Q3II.js} +255 -195
- package/dist/bundle/chunks/{chunk-Y3OPKKDR.js → chunk-P4P7OZ7R.js} +34 -32
- package/dist/bundle/chunks/{chunk-OZNC2W4B.js → chunk-PCTLFSQG.js} +444 -411
- package/dist/bundle/chunks/{chunk-YFBDR4IW.js → chunk-PNGNZXOI.js} +3 -3
- package/dist/bundle/chunks/{chunk-UDB6NI4G.js → chunk-RGUZULEE.js} +593 -481
- package/dist/bundle/chunks/chunk-RO5YPAJH.js +23 -0
- package/dist/bundle/chunks/{chunk-A6B2QMA7.js → chunk-RU7ADKA7.js} +176 -162
- package/dist/bundle/chunks/{chunk-JCXXRCP6.js → chunk-T3KDZFM4.js} +16 -16
- package/dist/bundle/chunks/{chunk-HT5YN3LX.js → chunk-TEOMXMW6.js} +3 -3
- package/dist/bundle/chunks/{chunk-HIZWUSPN.js → chunk-VEGJT52D.js} +77 -77
- package/dist/bundle/chunks/{chunk-IDU5BNNI.js → chunk-XMZGB3H4.js} +12 -3
- package/dist/bundle/chunks/chunk-YEPHPMQC.js +647 -0
- package/dist/bundle/chunks/{chunk-XA7CJAYH.js → chunk-YRUIJ5AH.js} +48 -42
- package/dist/bundle/chunks/{cli-ENEFJH2B.js → cli-BNCWK54K.js} +21 -17
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T7TPP7SQ.js → cloudflare-workers-ai-system-one-KI6W3USX.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +81 -75
- package/dist/bundle/chunks/compat-I5VPOXFT.js +13 -0
- package/dist/bundle/chunks/dist-J5IUPLMH.js +37 -0
- package/dist/bundle/chunks/{dist-RKNCFFGM.js → dist-SKBR3C7C.js} +720 -696
- package/dist/bundle/chunks/dist-TVRQXUY6.js +8 -0
- package/dist/bundle/chunks/{dist-cjs-HTASUQXQ.js → dist-cjs-2SKN226B.js} +77 -77
- package/dist/bundle/chunks/{easter-egg-3d-YOPLCOVW.js → easter-egg-3d-673VRP6Y.js} +1 -1
- package/dist/bundle/chunks/{esm-R6HJ4QEG.js → esm-WPALMLUO.js} +3 -3
- package/dist/bundle/chunks/{event-streams-BR2IL6C5.js → event-streams-7YGFEPBZ.js} +1 -1
- package/dist/bundle/chunks/{execute-2JXEKQ2X.js → execute-PIUR5MUV.js} +23 -23
- package/dist/bundle/chunks/{extract-OTCGZGTL.js → extract-4O5Z5725.js} +74 -71
- package/dist/bundle/chunks/github-copilot.js +50 -51
- package/dist/bundle/chunks/google-generative-ai-635YZEHN.js +22 -0
- package/dist/bundle/chunks/google-vertex-I3ZJ3SB2.js +26 -0
- package/dist/bundle/chunks/host-OQOEIWHK.js +2 -0
- package/dist/bundle/chunks/image-resize-worker.js +3 -2
- package/dist/bundle/chunks/kimi-coding.js +13 -14
- package/dist/bundle/chunks/{llama-cpp-classify-B3G57LVR.js → llama-cpp-classify-PP63BYDF.js} +1 -1
- package/dist/bundle/chunks/meta.js +10 -10
- package/dist/bundle/chunks/mistral-conversations-OKG5GKXR.js +42 -0
- package/dist/bundle/chunks/{node-VSA4ZN7D.js → node-UGQUSQE6.js} +1 -1
- package/dist/bundle/chunks/{node-SJPZTR4K.js → node-UNHECG4X.js} +168 -157
- package/dist/bundle/chunks/openai-codex-responses-6JYZIFT4.js +100 -0
- package/dist/bundle/chunks/openai-completions-YBNI6CAP.js +82 -0
- package/dist/bundle/chunks/{openai-decisions-WOWUC65P.js → openai-decisions-5G5YBFRQ.js} +1 -1
- package/dist/bundle/chunks/openai-responses-C3APJ6MK.js +27 -0
- package/dist/bundle/chunks/{openrouter-images-5K47HDAT.js → openrouter-images-FCJT7C7I.js} +2 -2
- package/dist/bundle/chunks/{pdfjs-EK6K7CXX.js → pdfjs-AKD6EBKN.js} +196 -175
- package/dist/bundle/chunks/pdfjs-decoders-OFXX4HDZ.js +2 -0
- package/dist/bundle/chunks/pdfjs-jbig2-TXR26KRI.js +278 -0
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +326 -0
- package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +671 -0
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +974 -0
- package/dist/bundle/chunks/pi-messages-UHYZYEOC.js +25 -0
- package/dist/bundle/chunks/radius.js +8 -8
- package/dist/bundle/chunks/{runtime-K3F2QDQP.js → runtime-KE3HDSRT.js} +1 -1
- package/dist/bundle/chunks/{turndown.cjs-U7XOXH4O.js → turndown.cjs-WKGZX7NZ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-43OCHGKP.js → typesafe-system-one-VYVAMWQV.js} +1 -1
- package/dist/bundle/chunks/{undici-EK3EUI2E.js → undici-C6S56CGI.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-KDUZIB3W.js +23 -0
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/flow/package.json +5 -5
- package/dist/bundle/index.js +10 -10
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +29 -5
- package/dist/config.js.map +1 -1
- package/dist/coordination/adapter/tool.d.ts +8 -5
- package/dist/coordination/adapter/tool.d.ts.map +1 -1
- package/dist/coordination/adapter/tool.js +32 -6
- package/dist/coordination/adapter/tool.js.map +1 -1
- package/dist/coordination/client/client.d.ts.map +1 -1
- package/dist/coordination/client/client.js +19 -1
- package/dist/coordination/client/client.js.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +23 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +142 -39
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +4 -0
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
- package/dist/core/anthropic-subscription-usage.js +71 -1
- package/dist/core/anthropic-subscription-usage.js.map +1 -1
- package/dist/core/bug-report.d.ts +4 -4
- package/dist/core/codex-reset.d.ts +45 -0
- package/dist/core/codex-reset.d.ts.map +1 -0
- package/dist/core/codex-reset.js +190 -0
- package/dist/core/codex-reset.js.map +1 -0
- package/dist/core/codex-usage.d.ts +4 -2
- package/dist/core/codex-usage.d.ts.map +1 -1
- package/dist/core/codex-usage.js +9 -4
- package/dist/core/codex-usage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +3 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +25 -10
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +37 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +274 -65
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +19 -6
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +49 -11
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/exec.d.ts +9 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +105 -61
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.html +2 -0
- package/dist/core/export-html/template.js +200 -62
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +3 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/pi-ai-extension-view.js +22 -0
- package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
- package/dist/core/extensions/types.d.ts +27 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +7 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +107 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +56 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +14 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +9 -4
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +15 -5
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1691 -2042
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -3
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +35 -4
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +70 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +16 -10
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +21 -17
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +29 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +311 -60
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +164 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -0
- package/dist/core/pi-ai-schemas.js +21 -0
- package/dist/core/pi-ai-schemas.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +1 -0
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +4 -0
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +38 -23
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +4 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +7 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +66 -26
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +2 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +2 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +19 -8
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +70 -16
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +15 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +37 -3
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -14
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +9 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +13 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/subscription-credits.d.ts +14 -0
- package/dist/core/subscription-credits.d.ts.map +1 -0
- package/dist/core/subscription-credits.js +10 -0
- package/dist/core/subscription-credits.js.map +1 -0
- package/dist/core/subscription-reset-status.d.ts +10 -0
- package/dist/core/subscription-reset-status.d.ts.map +1 -0
- package/dist/core/subscription-reset-status.js +2 -0
- package/dist/core/subscription-reset-status.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +7 -3
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +4 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +42 -12
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js +3 -3
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +37 -29
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +9 -8
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +8 -5
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +14 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +17 -9
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +33 -8
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +16 -4
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +34 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/index.js +4 -3
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +1 -1
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +7 -3
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +1 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +56 -28
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +21 -6
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +104 -36
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/extensions/usage/confirmation.d.ts +40 -0
- package/dist/extensions/usage/confirmation.d.ts.map +1 -0
- package/dist/extensions/usage/confirmation.js +198 -0
- package/dist/extensions/usage/confirmation.js.map +1 -0
- package/dist/extensions/usage/index.d.ts +4 -4
- package/dist/extensions/usage/index.d.ts.map +1 -1
- package/dist/extensions/usage/index.js +352 -33
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/extensions/usage/overview.d.ts +8 -1
- package/dist/extensions/usage/overview.d.ts.map +1 -1
- package/dist/extensions/usage/overview.js +54 -11
- package/dist/extensions/usage/overview.js.map +1 -1
- package/dist/extensions/usage/popup.d.ts +37 -6
- package/dist/extensions/usage/popup.d.ts.map +1 -1
- package/dist/extensions/usage/popup.js +396 -45
- package/dist/extensions/usage/popup.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +564 -130
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +1 -0
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/humain/web-access/host.d.ts +2 -1
- package/dist/humain/web-access/host.d.ts.map +1 -1
- package/dist/humain/web-access/host.js +1 -1
- package/dist/humain/web-access/host.js.map +1 -1
- package/dist/humain/web-access/vendor/brave-rate-limit.d.ts +2 -0
- package/dist/humain/web-access/vendor/brave-rate-limit.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/brave-rate-limit.js +2 -2
- package/dist/humain/web-access/vendor/brave-rate-limit.js.map +1 -1
- package/dist/humain/web-access/vendor/cloudflare-search.d.ts +5 -0
- package/dist/humain/web-access/vendor/cloudflare-search.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/cloudflare-search.js +230 -0
- package/dist/humain/web-access/vendor/cloudflare-search.js.map +1 -0
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +18 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +12 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +33 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +84 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -0
- package/dist/humain/web-access/vendor/duckduckgo.d.ts +3 -0
- package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.js +54 -49
- package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
- package/dist/humain/web-access/vendor/exa.d.ts +8 -3
- package/dist/humain/web-access/vendor/exa.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/exa.js +129 -14
- package/dist/humain/web-access/vendor/exa.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +68 -10
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.js +2 -2
- package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
- package/dist/humain/web-access/vendor/field-extract.d.ts +38 -0
- package/dist/humain/web-access/vendor/field-extract.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/field-extract.js +350 -0
- package/dist/humain/web-access/vendor/field-extract.js.map +1 -0
- package/dist/humain/web-access/vendor/gemini-search.d.ts +15 -4
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +198 -16
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/github-api.js +1 -1
- package/dist/humain/web-access/vendor/github-api.js.map +1 -1
- package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/github-extract.js +3 -2
- package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +137 -118
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js.map +1 -1
- package/dist/humain/web-access/vendor/ninerouter.d.ts +4 -0
- package/dist/humain/web-access/vendor/ninerouter.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/ninerouter.js +110 -0
- package/dist/humain/web-access/vendor/ninerouter.js.map +1 -0
- package/dist/humain/web-access/vendor/offtopic-judge.d.ts +27 -0
- package/dist/humain/web-access/vendor/offtopic-judge.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/offtopic-judge.js +61 -0
- package/dist/humain/web-access/vendor/offtopic-judge.js.map +1 -0
- package/dist/humain/web-access/vendor/openai-search.d.ts +1 -1
- package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/openai-search.js +39 -13
- package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
- package/dist/humain/web-access/vendor/outcrawl.d.ts +4 -0
- package/dist/humain/web-access/vendor/outcrawl.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/outcrawl.js +196 -0
- package/dist/humain/web-access/vendor/outcrawl.js.map +1 -0
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +13 -3
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/pdf-extract.d.ts +1 -3
- package/dist/humain/web-access/vendor/pdf-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/pdf-extract.js +0 -2
- package/dist/humain/web-access/vendor/pdf-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.d.ts +3 -0
- package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.d.ts +2 -2
- package/dist/humain/web-access/vendor/query-rewrite.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.js +39 -13
- package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
- package/dist/humain/web-access/vendor/searchapi.d.ts +4 -0
- package/dist/humain/web-access/vendor/searchapi.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/searchapi.js +195 -0
- package/dist/humain/web-access/vendor/searchapi.js.map +1 -0
- package/dist/humain/web-access/vendor/sofya.d.ts +4 -0
- package/dist/humain/web-access/vendor/sofya.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/sofya.js +193 -0
- package/dist/humain/web-access/vendor/sofya.js.map +1 -0
- package/dist/humain/web-access/vendor/source-check.d.ts +5 -1
- package/dist/humain/web-access/vendor/source-check.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/source-check.js +34 -16
- package/dist/humain/web-access/vendor/source-check.js.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts +7 -0
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js +24 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-model-scope.d.ts +8 -3
- package/dist/humain/web-access/vendor/summary-model-scope.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-model-scope.js +15 -1
- package/dist/humain/web-access/vendor/summary-model-scope.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.d.ts +7 -2
- package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.js +32 -28
- package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
- package/dist/humain/web-access/vendor/tabstack.d.ts +6 -0
- package/dist/humain/web-access/vendor/tabstack.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/tabstack.js +236 -0
- package/dist/humain/web-access/vendor/tabstack.js.map +1 -0
- package/dist/humain/web-access/vendor/tool-arguments.js +1 -1
- package/dist/humain/web-access/vendor/tool-arguments.js.map +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts +8 -0
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/upgrade-notice.js +46 -0
- package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -0
- package/dist/humain/web-access/vendor/utils.d.ts +9 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +113 -27
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-contract.d.ts +4 -0
- package/dist/humain/web-access/vendor/web-tool-contract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-contract.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +17 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.js +99 -22
- package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.js +6 -5
- package/dist/humain/web-access/vendor/xai-search.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +20 -9
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-code-block.d.ts +34 -0
- package/dist/modes/interactive/components/assistant-code-block.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-code-block.js +160 -0
- package/dist/modes/interactive/components/assistant-code-block.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +31 -10
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +276 -73
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +2 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +4 -17
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +7 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +2 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +2 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +3 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +4 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +6 -5
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +107 -11
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js +3 -2
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +18 -6
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +17 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +13 -4
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +86 -22
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -24
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +2 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +15 -5
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +5 -6
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +9 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +4 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +20 -18
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +1 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +16 -4
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +259 -83
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts +10 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.js +21 -0
- package/dist/modes/interactive/model-search.js.map +1 -1
- package/dist/modes/interactive/oauth-account-format.d.ts +10 -1
- package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
- package/dist/modes/interactive/oauth-account-format.js +42 -0
- package/dist/modes/interactive/oauth-account-format.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +10 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +28 -24
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +3 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +55 -4
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +5 -2
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +4 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts +8 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +31 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -3
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +96 -6
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +42 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts +2 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +12 -2
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +5 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +156 -11
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +30 -35
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/assets/humain-code-logo.svg +8 -0
- package/docs/cli.md +22 -12
- package/docs/compaction.md +32 -8
- package/docs/coordination.md +2 -0
- package/docs/custom-provider.md +4 -2
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +3169 -229
- package/docs/flow.md +2 -0
- package/docs/keybindings.md +24 -2
- package/docs/llama-cpp.md +30 -19
- package/docs/mcp.md +4 -2
- package/docs/message-types.md +7 -7
- package/docs/packages.md +27 -1
- package/docs/sessions.md +11 -3
- package/docs/settings.md +21 -9
- package/docs/slash-commands.md +51 -11
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/tui.md +3 -1
- package/docs/windows.md +27 -0
- package/examples/extensions/README.md +2 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- package/examples/extensions/custom-provider-anthropic/package-lock.json +7 -7
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +14 -24
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/todo.ts +7 -0
- package/examples/extensions/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +252 -0
- package/npm-shrinkwrap.json +289 -277
- package/package.json +29 -29
- package/schemas/keybindings.schema.json +28 -0
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +49 -0
- package/src/humain/ponytail/UPSTREAM.md +16 -2
- package/src/humain/ponytail/upstream.json +4 -4
- package/src/humain/web-access/UPSTREAM.md +48 -1
- package/src/humain/web-access/upstream.json +9 -6
- package/src/humain/web-access/vendor/CHANGELOG.md +1223 -0
- package/dist/bundle/chunks/anthropic-messages-ZP5KUK52.js +0 -67
- package/dist/bundle/chunks/azure-openai-responses-QJFYQ3DF.js +0 -15
- package/dist/bundle/chunks/chunk-2GCMACT4.js +0 -1956
- package/dist/bundle/chunks/chunk-AO6FF5JL.js +0 -21
- package/dist/bundle/chunks/chunk-EY3LZOUP.js +0 -1963
- package/dist/bundle/chunks/chunk-M74U5X4S.js +0 -119
- package/dist/bundle/chunks/chunk-N7CQ3UV3.js +0 -80
- package/dist/bundle/chunks/chunk-OR25QDSS.js +0 -365
- package/dist/bundle/chunks/chunk-PH7UP57J.js +0 -6
- package/dist/bundle/chunks/chunk-QW6PTCAB.js +0 -10
- package/dist/bundle/chunks/chunk-ROZV2IYD.js +0 -125
- package/dist/bundle/chunks/chunk-YFOLLX5D.js +0 -23
- package/dist/bundle/chunks/chunk-ZR4GF4WU.js +0 -54
- package/dist/bundle/chunks/compat-CJBWWYHE.js +0 -13
- package/dist/bundle/chunks/dist-IBUWEKEE.js +0 -24
- package/dist/bundle/chunks/dist-YFMJEHPH.js +0 -8
- package/dist/bundle/chunks/google-generative-ai-HVPCGIZ6.js +0 -21
- package/dist/bundle/chunks/google-vertex-UM5MAALA.js +0 -25
- package/dist/bundle/chunks/host-ZHEL5XQW.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-AH72RLXK.js +0 -44
- package/dist/bundle/chunks/openai-codex-responses-L366637C.js +0 -98
- package/dist/bundle/chunks/openai-completions-ZP62QXJX.js +0 -83
- package/dist/bundle/chunks/openai-responses-DXUGSUTN.js +0 -26
- package/dist/bundle/chunks/pi-messages-MOQQDZBK.js +0 -23
- package/dist/bundle/chunks/virtual-modules-5D6QIJPN.js +0 -5
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -66
- package/examples/extensions/sandbox/package.json +0 -19
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{__commonJS,__esm,__export,__require}from"./chunk-JXWJOIH4.js";var require_CSSOM=__commonJS({"node_modules/@acemir/cssom/lib/CSSOM.js"(exports2,module2){var CSSOM2={setup:function(opts){var instance=Object.create(this);if(opts.globalObject&&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.
|
|
3
|
-
apply(this,arguments)};Object.setPrototypeOf(newFn,Object.getPrototypeOf(fn));for(var key in fn)Object.prototype.hasOwnProperty.call(fn,key)&&(newFn[key]=fn[key]);return fn.prototype&&(newFn.prototype=Object.create(fn.prototype)),newFn}}module2.exports=CSSOM2}});var require_errorUtils=__commonJS({"node_modules/@acemir/cssom/lib/errorUtils.js"(exports,module){function getErrorConstructor(context,errorType){return context.parentStyleSheet&&context.parentStyleSheet.__globalObject&&context.parentStyleSheet.__globalObject[errorType]?context.parentStyleSheet.__globalObject[errorType]:context.__parentStyleSheet&&context.__parentStyleSheet.__globalObject&&context.__parentStyleSheet.__globalObject[errorType]?context.__parentStyleSheet.__globalObject[errorType]:context.
|
|
4
|
-
__globalObject&&context.__globalObject[errorType]?context.__globalObject[errorType]: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){
|
|
5
|
-
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){
|
|
6
|
-
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({"node_modules/@acemir/cssom/lib/regexPatterns.js"(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-]*)$/,
|
|
7
|
-
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>+~,(){}\[\]]/,
|
|
8
|
-
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,
|
|
9
|
-
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,
|
|
10
|
-
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,
|
|
11
|
-
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,
|
|
12
|
-
startsWithCombinatorRegExp,atPageRuleSelectorRegExp,layerRegExp,layerRuleNameRegExp,doubleOrMoreSpacesRegExp,startsWithHexEscapeRegExp,identStartCharRegExp,identCharRegExp,specialCharsNeedEscapeRegExp,combinatorOrSeparatorRegExp,afterHexEscapeSeparatorRegExp,trailingSpaceSeparatorRegExp,endsWithHexEscapeRegExp,basicStylePropertyValueValidationRegExp,attributeSelectorContentRegExp,pseudoElementRegExp,invalidCombinatorLtGtRegExp,invalidCombinatorDoubleGtRegExp,consecutiveCombinatorsRegExp,invalidSlottedRegExp,
|
|
13
|
-
invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp,invalidNestingPattern,emptyPseudoClassRegExp,whitespaceNormalizationRegExp,newlineRemovalRegExp,whitespaceAndDotRegExp,declarationOrOpenBraceRegExp,ampersandRegExp,hexEscapeSequenceRegExp,attributeCaseFlagRegExp,prependedAmpersandRegExp,openBraceGlobalRegExp,closeBraceGlobalRegExp,scopePreludeSplitRegExp,leadingWhitespaceRegExp,doubleQuoteRegExp,backslashRegExp,invalidMediaOperatorWithoutSpaceRegExp,invalidMediaNotAfterOperatorRegExp,invalidMediaNotIdentifierRegExp,
|
|
14
|
-
invalidMediaNotAfterFeatureRegExp,invalidMediaOperatorBetweenParensRegExp,invalidMediaNotWithMediaTypeRegExp,mediaFeatureColonRegExp,identifierBeforeParenRegExp,mediaAndOperatorRegExp,mediaOrOperatorRegExp,mediaNotOperatorStartRegExp,mediaNotOperatorRegExp};exports2.regexPatterns=regexPatterns}});var require_MediaList=__commonJS({"node_modules/@acemir/cssom/lib/MediaList.js"(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")for(var values=value.split(",").filter(function(text){return!!text}),length=this.length=values.length,i=0;i<length;i++)this[i]=values[i].trim();else if(value===null){for(var length=this.length,
|
|
15
|
-
i=0;i<length;i++)delete this[i];this.length=0}},appendMedium:function(medium){Array.prototype.indexOf.call(this,medium)===-1&&(this[this.length]=medium,this.length++)},deleteMedium:function(medium){var index=Array.prototype.indexOf.call(this,medium);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({"node_modules/@acemir/cssom/lib/StyleSheet.js"(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:{
|
|
16
|
-
get:function(){return this.__title}},media:{get:function(){return this.__media},set:function(value){typeof value=="string"?this.__media.mediaText=value:this.__media=value}},parentStyleSheet:{get:function(){return this.__parentStyleSheet}}});exports2.StyleSheet=CSSOM2.StyleSheet}});var require_CSSRuleList=__commonJS({"node_modules/@acemir/cssom/lib/CSSRuleList.js"(exports2){var CSSOM2={};CSSOM2.CSSRuleList=function(){var arr=new Array;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({"node_modules/@acemir/cssom/lib/CSSRule.js"(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=
|
|
17
|
-
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){
|
|
18
|
-
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},
|
|
19
|
-
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({"node_modules/@acemir/cssom/lib/CSSGroupingRule.js"(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;
|
|
20
|
-
Object.setPrototypeOf(CSSOM2.CSSGroupingRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSGroupingRule.prototype,"cssRules",{get:function(){return this.__cssRules}});CSSOM2.CSSGroupingRule.prototype.insertRule=function(rule,index){rule===void 0&&index===void 0&&errorUtils2.throwMissingArguments(this,"insertRule",this.constructor.name),index===void 0&&(index=0),index=Number(index),index<0&&(index=4294967296+index),index>this.cssRules.length&&errorUtils2.throwIndexError(this,"insertRule",this.constructor.
|
|
21
|
-
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){for(var currentRule=this;currentRule.parentRule;)if(currentRule=currentRule.parentRule,currentRule.constructor.name==="CSSStyleRule"){isNestedSelector=!0;break}}isNestedSelector&&(processedRuleToParse="s { n { } "+ruleToParse+"}");var isScopeRule=this.constructor.name===
|
|
22
|
-
"CSSScopeRule";isScopeRule&&(isNestedSelector?processedRuleToParse="s { @scope {"+ruleToParse+"}}":processedRuleToParse="@scope {"+ruleToParse+"}");var parsedRules=new CSSOM2.CSSRuleList;CSSOM2.parse(processedRuleToParse,{styleSheet:this.parentStyleSheet,cssRules:parsedRules}),isScopeRule&&(isNestedSelector?parsedRules=parsedRules[0].cssRules[0].cssRules:parsedRules=parsedRules[0].cssRules),isNestedSelector&&(parsedRules=parsedRules[0].cssRules.slice(1)),parsedRules.length!==1&&(isNestedSelector&&
|
|
23
|
-
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"):errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError"));var cssRule=parsedRules[0];if(cssRule.constructor.name==="CSSNestedDeclarations"&&cssRule.
|
|
24
|
-
style.length===0&&errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError"),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")}return cssRule.constructor.
|
|
25
|
-
name==="CSSLayerStatementRule"&&errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError"),cssRule.__parentRule=this,this.cssRules.splice(index,0,cssRule),index};CSSOM2.CSSGroupingRule.prototype.deleteRule=function(index){index===void 0&&errorUtils2.throwMissingArguments(this,"deleteRule",this.constructor.name),index=Number(index),index<0&&(index=4294967296+index),index>=this.cssRules.length&&errorUtils2.throwIndexError(this,"deleteRule",this.constructor.name,
|
|
26
|
-
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({"node_modules/@acemir/cssom/lib/CSSStyleRule.js"(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=__require("cssstyle").CSSStyleDeclaration}catch{}CSSOM2.CSSStyleRule=function(){CSSOM2.CSSGroupingRule.
|
|
27
|
-
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},
|
|
28
|
-
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){typeof value=="string"?this.__style.cssText=value:this.__style=
|
|
29
|
-
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){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
30
|
-
`)),values=valuesArr.join(`
|
|
31
|
-
`)+`
|
|
32
|
-
}`}else values=" {"+(this.style.cssText?" "+this.style.cssText:"")+" }";text=this.selectorText+values}else text="";return text}});exports2.CSSStyleRule=CSSOM2.CSSStyleRule}});var require_CSSStyleSheet=__commonJS({"node_modules/@acemir/cssom/lib/CSSStyleSheet.js"(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){CSSOM2.StyleSheet.call(this),this.__constructed=!0,this.__cssRules=new CSSOM2.CSSRuleList,this.__ownerRule=null,opts&&typeof opts==
|
|
33
|
-
"object"&&(opts.baseURL&&typeof opts.baseURL=="string"&&(this.__baseURL=opts.baseURL),opts.media&&typeof opts.media=="string"&&(this.media.mediaText=opts.media),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(){
|
|
34
|
-
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){rule===void 0&&index===void 0&&errorUtils2.throwMissingArguments(this,"insertRule",this.constructor.name),index===void 0&&(index=0),index=Number(index),index<0&&(index=4294967296+index),index>this.cssRules.
|
|
35
|
-
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)});parsedSheet.cssRules.length!==1&&errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");var cssRule=parsedSheet.cssRules[0];function findLastIndexOfConstructor(rules,constructorName){for(var i2=rules.length-1;i2>=0;i2--)if(rules[i2].
|
|
36
|
-
constructor.name===constructorName)return i2;return-1}function findFirstNonConstructorIndex(rules,constructorNames){for(var i2=0;i2<rules.length;i2++)if(constructorNames.indexOf(rules[i2].constructor.name)===-1)return i2;return rules.length}if(cssRule.constructor.name==="CSSImportRule"){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(
|
|
37
|
-
this.cssRules,["CSSImportRule"]);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"]);index>firstNonImportIndex&&firstNonImportIndex<this.cssRules.length&&this.cssRules[firstNonImportIndex].
|
|
38
|
-
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"){for(var firstImportIndex=-1,i=0;i<this.cssRules.length;i++)if(this.cssRules[i].constructor.name==="CSSImportRule"){firstImportIndex=i;break}var firstNonImportNamespaceIndex=findFirstNonConstructorIndex(this.cssRules,["CSSLayerStatementRule",
|
|
39
|
-
"CSSImportRule","CSSNamespaceRule"]);firstImportIndex!==-1&&index<=firstImportIndex&&errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError"),firstNonImportNamespaceIndex<this.cssRules.length&&errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","InvalidStateError"),index>firstNonImportNamespaceIndex&&errorUtils2.
|
|
40
|
-
throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError")}else if(cssRule.constructor.name!=="CSSLayerStatementRule"){var firstNonSpecialRuleIndex=findFirstNonConstructorIndex(this.cssRules,["CSSLayerStatementRule","CSSImportRule","CSSNamespaceRule"]);index<firstNonSpecialRuleIndex&&errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert th\
|
|
41
|
-
e rule.","HierarchyRequestError"),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){return index===void 0&&(index=this.cssRules.length),this.insertRule(selector+"{"+styleBlock+"}",index),-1};CSSOM2.CSSStyleSheet.prototype.deleteRule=
|
|
42
|
-
function(index){if(index===void 0&&errorUtils2.throwMissingArguments(this,"deleteRule",this.constructor.name),index=Number(index),index<0&&(index=4294967296+index),index>=this.cssRules.length&&errorUtils2.throwIndexError(this,"deleteRule",this.constructor.name,index,this.cssRules.length),this.cssRules[index]){if(this.cssRules[index].constructor.name=="CSSNamespaceRule"){var shouldContinue=this.cssRules.every(function(rule){return["CSSImportRule","CSSLayerStatementRule","CSSNamespaceRule"].indexOf(
|
|
43
|
-
rule.constructor.name)!==-1});shouldContinue||errorUtils2.throwError(this,"DOMException","Failed to execute 'deleteRule' on '"+this.constructor.name+"': Failed to delete rule.","InvalidStateError")}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){index===void 0&&(index=0),this.deleteRule(index)};CSSOM2.
|
|
44
|
-
CSSStyleSheet.prototype.replace=function(text){var _Promise;this.__globalObject&&this.__globalObject.Promise?_Promise=this.__globalObject.Promise:_Promise=Promise;var _setTimeout;this.__globalObject&&this.__globalObject.setTimeout?_setTimeout=this.__globalObject.setTimeout:_setTimeout=setTimeout;var sheet=this;return new _Promise(function(resolve,reject){(!sheet.__constructed||sheet.__disallowModification)&&reject(errorUtils2.createError(sheet,"DOMException","Failed to execute 'replaceSync' on '"+
|
|
45
|
-
sheet.constructor.name+"': Not allowed.","NotAllowedError")),sheet.__disallowModification=!0,_setTimeout(function(){var rules=new CSSOM2.CSSRuleList;CSSOM2.parse(text,{styleSheet:sheet,cssRules:rules});for(var i=0;i<rules.length;)rules[i].constructor.name==="CSSImportRule"?rules.splice(i,1):i++;sheet.__cssRules.splice.apply(sheet.__cssRules,[0,sheet.__cssRules.length].concat(rules)),delete sheet.__disallowModification,resolve(sheet)})})};CSSOM2.CSSStyleSheet.prototype.replaceSync=function(text){
|
|
46
|
-
var sheet=this;(!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});for(var i=0;i<rules.length;)rules[i].constructor.name==="CSSImportRule"?rules.splice(i,1):i++;sheet.__cssRules.splice.apply(sheet.__cssRules,[0,sheet.__cssRules.length].concat(rules))};CSSOM2.CSSStyleSheet.
|
|
47
|
-
prototype.toString=function(){for(var result="",rules=this.cssRules,i=0;i<rules.length;i++)result+=rules[i].cssText+`
|
|
48
|
-
`;return result};exports2.CSSStyleSheet=CSSOM2.CSSStyleSheet;CSSOM2.parse=require_parse().parse}});var require_CSSNestedDeclarations=__commonJS({"node_modules/@acemir/cssom/lib/CSSNestedDeclarations.js"(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration};try{CSSOM2.CSSStyleDeclaration=__require("cssstyle").CSSStyleDeclaration}catch{}CSSOM2.CSSNestedDeclarations=function(){CSSOM2.CSSRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSNestedDeclarations.prototype=Object.create(
|
|
49
|
-
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){typeof value=="string"?this.__style.cssText=value:this.__style=value}});Object.defineProperty(CSSOM2.CSSNestedDeclarations.
|
|
50
|
-
prototype,"cssText",{get:function(){return this.style.cssText}});exports2.CSSNestedDeclarations=CSSOM2.CSSNestedDeclarations}});var require_CSSImportRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSImportRule.js"(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.
|
|
51
|
-
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&&"("+
|
|
52
|
-
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){typeof value=="string"?this.__media.mediaText=value:this.__media=value}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"layerName",{get:function(){return this.
|
|
53
|
-
__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=regexPatterns.layerRegExp,layerRuleNameRegExp=regexPatterns.layerRuleNameRegExp,doubleOrMoreSpacesRegExp=regexPatterns.doubleOrMoreSpacesRegExp;
|
|
54
|
-
function extractSupportsContent(text){var supportsIndex=text.indexOf("supports(");if(supportsIndex!==0)return null;for(var depth=0,start=supportsIndex+9,i2=start;i2<text.length;i2++)if(text[i2]==="(")depth++;else if(text[i2]===")"){if(depth===0)return{content:text.slice(start,i2),endIndex:i2};depth--}return null}for(var character;character=cssText.charAt(i);i++)switch(character){case" ":case" ":case"\r":case`
|
|
55
|
-
`:case"\f":state==="after-import"?state="url":buffer+=character;break;case"@":!state&&cssText.indexOf("@import",i)===i&&(state="after-import",i+=6,buffer="");break;case"u":if(state==="media"&&(buffer+=character),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);url[0]===url[url.length-1]&&(url[0]==='"'||url[0]==="'")&&(url=url.slice(1,-1)),this.__href=url,i=index,state="media"}break;case'"':if(state===
|
|
56
|
-
"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"&&buffer){var bufferTrimmed=buffer.trim();if(bufferTrimmed.indexOf("layer")===0){var layerMatch=bufferTrimmed.match(layerRegExp);
|
|
57
|
-
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);supportsResult&&(this.__supportsText=supportsResult.content.trim(),bufferTrimmed=
|
|
58
|
-
bufferTrimmed.slice(0,0)+bufferTrimmed.slice(supportsResult.endIndex+1),bufferTrimmed=bufferTrimmed.replace(doubleOrMoreSpacesRegExp," ").trim()),bufferTrimmed&&(this.media.mediaText=bufferTrimmed)}break;default:state==="media"&&(buffer+=character);break}}});exports2.CSSImportRule=CSSOM2.CSSImportRule}});var require_CSSNamespaceRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSNamespaceRule.js"(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.
|
|
59
|
-
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(
|
|
60
|
-
CSSOM2.CSSNamespaceRule.prototype,"parse",{value:function(cssText){var newPrefix="",newNamespaceURI="",text=cssText.trim();text.indexOf("@namespace")===0&&(text=text.slice(10).trim()),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)match[1]&&(newPrefix=match[1]),typeof match[3]<"u"?newNamespaceURI=match[3]:typeof match[4]<"u"?newNamespaceURI=match[4].
|
|
61
|
-
trim():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({"node_modules/@acemir/cssom/lib/CSSConditionRule.js"(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;
|
|
62
|
-
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({"node_modules/@acemir/cssom/lib/CSSMediaRule.js"(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.
|
|
63
|
-
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){typeof value=="string"?this.__media.mediaText=value:this.__media=value},configurable:!0,enumerable:!0},conditionText:{get:function(){return this.
|
|
64
|
-
media.mediaText}},cssText:{get:function(){var values="",valuesArr=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
65
|
-
`)),values=valuesArr.join(`
|
|
66
|
-
`)+`
|
|
67
|
-
}`,"@media "+this.media.mediaText+values}}});exports2.CSSMediaRule=CSSOM2.CSSMediaRule}});var require_CSSCounterStyleRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSCounterStyleRule.js"(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.
|
|
68
|
-
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(match2,quote){
|
|
69
|
-
return quote?match2:" "})}}});exports2.CSSCounterStyleRule=CSSOM2.CSSCounterStyleRule}});var require_CSSPropertyRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSPropertyRule.js"(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(
|
|
70
|
-
CSSOM2.CSSPropertyRule.prototype,"type",{value:0,writable:!1});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"cssText",{get:function(){var text="@property "+this.name+" {";return this.syntax!==""&&(text+=' syntax: "'+this.syntax.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'";'),text+=" inherits: "+(this.inherits?"true":"false")+";",this.initialValue!==null&&(text+=" initial-value: "+this.initialValue+";"),text+=" }",text}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"name",{get:function(){
|
|
71
|
-
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*\{([^]*)\}/);
|
|
72
|
-
if(!match)return!1;this.__name=match[1];var bodyText=match[2],syntaxMatch=bodyText.match(/syntax\s*:\s*(['"])([^]*?)\1\s*;/);if(!syntaxMatch||(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!==
|
|
73
|
-
"*")return!1;return!0}});exports2.CSSPropertyRule=CSSOM2.CSSPropertyRule}});var require_CSSContainerRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSContainerRule.js"(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.
|
|
74
|
-
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=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
75
|
-
`)),values=valuesArr.join(`
|
|
76
|
-
`)+`
|
|
77
|
-
}`,"@container "+this.conditionText+values}},containerName:{get:function(){var parts=this.conditionText.trim().split(/\s+/);return parts.length>1&&parts[0]!=="("&&!parts[0].startsWith("(")?parts[0]:""}},containerQuery:{get:function(){var parts=this.conditionText.trim().split(/\s+/);return parts.length>1&&parts[0]!=="("&&!parts[0].startsWith("(")?parts.slice(1).join(" "):this.conditionText}}});exports2.CSSContainerRule=CSSOM2.CSSContainerRule}});var require_CSSSupportsRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSSupportsRule.js"(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=
|
|
78
|
-
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=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
79
|
-
`)),values=valuesArr.join(`
|
|
80
|
-
`)+`
|
|
81
|
-
}`,"@supports "+this.conditionText+values}});exports2.CSSSupportsRule=CSSOM2.CSSSupportsRule}});var require_CSSFontFaceRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSFontFaceRule.js"(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule};try{CSSOM2.CSSStyleDeclaration=__require("cssstyle").CSSStyleDeclaration}catch{}CSSOM2.CSSFontFaceRule=function(){CSSOM2.CSSRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSFontFaceRule.prototype=Object.create(CSSOM2.CSSRule.prototype);
|
|
82
|
-
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){typeof value=="string"?this.__style.cssText=value:this.__style=value}});Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"cssText",{get:function(){return"@font-\
|
|
83
|
-
face {"+(this.style.cssText?" "+this.style.cssText:"")+" }"}});exports2.CSSFontFaceRule=CSSOM2.CSSFontFaceRule}});var require_CSSHostRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSHostRule.js"(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.
|
|
84
|
-
prototype,"type",{value:1001,writable:!1});Object.defineProperty(CSSOM2.CSSHostRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
85
|
-
`)),values=valuesArr.join(`
|
|
86
|
-
`)+`
|
|
87
|
-
}`,"@host"+values}});exports2.CSSHostRule=CSSOM2.CSSHostRule}});var require_CSSStartingStyleRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSStartingStyleRule.js"(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;
|
|
88
|
-
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=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
89
|
-
`)),values=valuesArr.join(`
|
|
90
|
-
`)+`
|
|
91
|
-
}`,"@starting-style"+values}});exports2.CSSStartingStyleRule=CSSOM2.CSSStartingStyleRule}});var require_CSSKeyframeRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSKeyframeRule.js"(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration};try{CSSOM2.CSSStyleDeclaration=__require("cssstyle").CSSStyleDeclaration}catch{}CSSOM2.CSSKeyframeRule=function(){CSSOM2.CSSRule.call(this),this.keyText="",this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSKeyframeRule.prototype=Object.create(CSSOM2.
|
|
92
|
-
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){typeof value=="string"?this.__style.cssText=value:this.__style=value}});Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"cssText",{get:function(){
|
|
93
|
-
return this.keyText+" {"+(this.style.cssText?" "+this.style.cssText:"")+" }"}});exports2.CSSKeyframeRule=CSSOM2.CSSKeyframeRule}});var require_CSSKeyframesRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSKeyframesRule.js"(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(
|
|
94
|
-
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;
|
|
95
|
-
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=[" {"];this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
96
|
-
`)),values=valuesArr.join(`
|
|
97
|
-
`)+`
|
|
98
|
-
}`;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){arguments.length===0&&errorUtils2.throwMissingArguments(this,"appendRule","CSSKeyframesRule");var parsedRule;try{var tempStyleSheet=CSSOM2.parse("@keyframes temp { "+rule+" }");if(tempStyleSheet.cssRules.length>
|
|
99
|
-
0&&tempStyleSheet.cssRules[0].cssRules.length>0)parsedRule=tempStyleSheet.cssRules[0].cssRules[0];else throw new Error("Failed to parse keyframe rule")}catch{errorUtils2.throwParseError(this,"appendRule","CSSKeyframesRule",rule)}parsedRule.__parentRule=this,this.cssRules.push(parsedRule)};CSSOM2.CSSKeyframesRule.prototype.deleteRule=function(select){arguments.length===0&&errorUtils2.throwMissingArguments(this,"deleteRule","CSSKeyframesRule");for(var normalizedSelect=this._normalizeKeyText(select),
|
|
100
|
-
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){arguments.length===0&&errorUtils2.throwMissingArguments(this,"findRule","CSSKeyframesRule");for(var normalizedSelect=this._normalizeKeyText(select),i=this.cssRules.length-1;i>=0;i--){var rule=this.cssRules[i];if(this._normalizeKeyText(rule.keyText)===normalizedSelect)
|
|
101
|
-
return rule}return null};CSSOM2.CSSKeyframesRule.prototype._normalizeKeyText=function(keyText){if(!keyText)return"";var normalized2=keyText.toString().trim().toLowerCase();return normalized2==="from"?"0%":normalized2==="to"?"100%":normalized2};typeof Symbol<"u"&&Symbol.iterator&&(CSSOM2.CSSKeyframesRule.prototype[Symbol.iterator]=function(){var index=0,cssRules=this.cssRules;return{next:function(){return index<cssRules.length?{value:cssRules[index++],done:!1}:{done:!0}}}});CSSOM2.CSSKeyframesRule.
|
|
102
|
-
prototype._setupIndexedAccess=function(){for(var i=0;i<1e3&&this.hasOwnProperty(i);i++)delete this[i];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({"node_modules/@acemir/cssom/lib/CSSValue.js"(exports2){var CSSOM2={};CSSOM2.CSSValue=function(){};CSSOM2.CSSValue.prototype={constructor:CSSOM2.CSSValue,set cssText(text){var name=this._getConstructorName();throw new Error('DOMException: property "cssText" of "'+name+'" is readonly and can not be replaced with "'+text+'"!')},get cssText(){var name=this._getConstructorName();throw new Error('getter "cssText" of "'+name+'" is not implemented!')},_getConstructorName:function(){
|
|
103
|
-
var s=this.constructor.toString(),c=s.match(/function\s([^\(]+)/),name=c[1];return name}};exports2.CSSValue=CSSOM2.CSSValue}});var require_CSSValueExpression=__commonJS({"node_modules/@acemir/cssom/lib/CSSValueExpression.js"(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(){
|
|
104
|
-
for(var token=this._token,idx=this._idx,character="",expression="",error="",info,paren=[];;++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"/":(info=this._parseJSComment(token,idx))?info.error?error="css expression error: unfinished comment in expression!":idx=info.idx:(info=this._parseJSRexExp(token,
|
|
105
|
-
idx))?(idx=info.idx,expression+=info.text):expression+=character;break;case"'":case'"':info=this._parseJSString(token,idx,character),info?(idx=info.idx,expression+=info.text):expression+=character;break;default:expression+=character;break}if(error||paren.length===0)break}var ret;return error?ret={error}:ret={idx,expression},ret};CSSOM2.CSSValueExpression.prototype._parseJSComment=function(token,idx){var nextChar=token.charAt(idx+1),text;if(nextChar==="/"||nextChar==="*"){var startIdx=idx,endIdx,
|
|
106
|
-
commentEndChar;if(nextChar==="/"?commentEndChar=`
|
|
107
|
-
`:nextChar==="*"&&(commentEndChar="*/"),endIdx=token.indexOf(commentEndChar,startIdx+1+1),endIdx!==-1)return endIdx=endIdx+commentEndChar.length-1,text=token.substring(idx,endIdx+1),{idx:endIdx,text};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;return endIdx===-1?!1:(text=token.substring(idx,endIdx+sep.length),{idx:endIdx,
|
|
108
|
-
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){var sep="/";return this._parseJSString(token,idx,sep)}else return!1};CSSOM2.CSSValueExpression.prototype._findMatchedIdx=
|
|
109
|
-
function(token,idx,sep){for(var startIdx=idx,endIdx,NOT_FOUND=-1;;)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;startIdx=endIdx}var nextNewLineIdx=token.indexOf(`
|
|
110
|
-
`,idx+1);return nextNewLineIdx<endIdx&&(endIdx=NOT_FOUND),endIdx};exports2.CSSValueExpression=CSSOM2.CSSValueExpression}});var require_MatcherList=__commonJS({"node_modules/@acemir/cssom/lib/MatcherList.js"(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){for(var values=value.split(","),length=this.length=values.length,i=0;i<length;i++)this[i]=values[i].trim()},appendMatcher:function(matcher){Array.prototype.indexOf.call(this,matcher)===-1&&(this[this.
|
|
111
|
-
length]=matcher,this.length++)},deleteMatcher:function(matcher){var index=Array.prototype.indexOf.call(this,matcher);index!==-1&&Array.prototype.splice.call(this,index,1)}};exports2.MatcherList=CSSOM2.MatcherList}});var require_CSSDocumentRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSDocumentRule.js"(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.
|
|
112
|
-
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(){for(var cssTexts=[],i=0,length=this.cssRules.length;i<length;i++)cssTexts.push(this.cssRules[i].cssText);return"@-moz-document "+this.matcher.matcherText+" {"+(cssTexts.length?`
|
|
113
|
-
`+cssTexts.join(`
|
|
114
|
-
`):"")+`
|
|
115
|
-
}`}});exports2.CSSDocumentRule=CSSOM2.CSSDocumentRule}});var require_CSSScopeRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSScopeRule.js"(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(
|
|
116
|
-
CSSOM2.CSSScopeRule,CSSOM2.CSSGroupingRule);Object.defineProperties(CSSOM2.CSSScopeRule.prototype,{type:{value:0,writable:!1},cssText:{get:function(){var values="",valuesArr=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
117
|
-
`)),values=valuesArr.join(`
|
|
118
|
-
`)+`
|
|
119
|
-
}`,"@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({"node_modules/@acemir/cssom/lib/CSSLayerBlockRule.js"(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.
|
|
120
|
-
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=[" {"];return this.cssRules.length&&valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
121
|
-
`)),values=valuesArr.join(`
|
|
122
|
-
`)+`
|
|
123
|
-
}`,"@layer"+(this.name?" "+this.name:"")+values}}});exports2.CSSLayerBlockRule=CSSOM2.CSSLayerBlockRule}});var require_CSSLayerStatementRule=__commonJS({"node_modules/@acemir/cssom/lib/CSSLayerStatementRule.js"(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.
|
|
124
|
-
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({"node_modules/@acemir/cssom/lib/CSSPageRule.js"(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=__require("cssstyle").CSSStyleDeclaration}catch{}CSSOM2.CSSPageRule=function(){CSSOM2.CSSGroupingRule.
|
|
125
|
-
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==
|
|
126
|
-
"string"){var trimmedValue=value.trim();if(trimmedValue===""){this.__selectorText="";return}var atPageRuleSelectorRegExp=regexPatterns.atPageRuleSelectorRegExp,cssCustomIdentifierRegExp=regexPatterns.cssCustomIdentifierRegExp,match=trimmedValue.match(atPageRuleSelectorRegExp);if(match){var pageName=match[1]||"",pseudoPages=match[2]||"";if(pageName&&!cssCustomIdentifierRegExp.test(pageName))return;if(pseudoPages){for(var pseudos2=pseudoPages.split(":").filter(function(p){return p}),validPseudos=[
|
|
127
|
-
"left","right","first","blank"],allValid=!0,j=0;j<pseudos2.length;j++)if(validPseudos.indexOf(pseudos2[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){typeof value=="string"?this.__style.cssText=value:this.__style=value}});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"cssText",{get:function(){var values="";
|
|
128
|
-
if(this.cssRules.length){var valuesArr=[" {"];this.style.cssText&&valuesArr.push(this.style.cssText),valuesArr.push(this.cssRules.reduce(function(acc,rule){return rule.cssText!==""&&acc.push(rule.cssText),acc},[]).join(`
|
|
129
|
-
`)),values=valuesArr.join(`
|
|
130
|
-
`)+`
|
|
131
|
-
}`}else values=" {"+(this.style.cssText?" "+this.style.cssText:"")+" }";return"@page"+(this.selectorText?" "+this.selectorText:"")+values}});exports2.CSSPageRule=CSSOM2.CSSPageRule}});var require_cssstyleTryCatchBlock=__commonJS({"node_modules/@acemir/cssom/lib/cssstyleTryCatchBlock.js"(){try{CSSOM.CSSStyleDeclaration=__require("cssstyle").CSSStyleDeclaration}catch{}}});var require_parse=__commonJS({"node_modules/@acemir/cssom/lib/parse.js"(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,
|
|
132
|
-
"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;opts&&opts.styleSheet?styleSheet=opts.styleSheet:(opts&&opts.globalObject&&opts.globalObject.CSSStyleSheet?styleSheet=new opts.globalObject.CSSStyleSheet:styleSheet=new CSSOM2.CSSStyleSheet,styleSheet.__constructed=!1);var topScope;if(opts&&opts.cssRules?topScope={cssRules:opts.cssRules}:topScope=
|
|
133
|
-
styleSheet,opts&&opts.ownerNode){styleSheet.__ownerNode=opts.ownerNode;var ownerNodeMedia=opts.ownerNode.media||opts.ownerNode.getAttribute&&opts.ownerNode.getAttribute("media");ownerNodeMedia&&(styleSheet.media.mediaText=ownerNodeMedia);var ownerNodeTitle=opts.ownerNode.title||opts.ownerNode.getAttribute&&opts.ownerNode.getAttribute("title");ownerNodeTitle&&(styleSheet.__title=ownerNodeTitle)}opts&&opts.ownerRule&&(styleSheet.__ownerRule=opts.ownerRule);var currentScope=topScope,parentRule,ancestorRules=[],
|
|
134
|
-
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){return rule.__parseId||(rule.__parseId=++ruleIdCounter),rule.__parseId}var lastValidationBoundary=0,validationRegexCache={};
|
|
135
|
-
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=regexPatterns.atKeyframesRegExp,beforeRulePortionRegExp=regexPatterns.beforeRulePortionRegExp,beforeRuleValidationRegExp=regexPatterns.beforeRuleValidationRegExp,
|
|
136
|
-
forwardRuleValidationRegExp=regexPatterns.forwardRuleValidationRegExp,forwardImportRuleValidationRegExp=regexPatterns.forwardImportRuleValidationRegExp,regexBefore=new RegExp(beforeRulePortionRegExp.source,beforeRulePortionRegExp.flags),forwardRuleClosingBraceRegExp=regexPatterns.forwardRuleClosingBraceRegExp,forwardRuleSemicolonAndOpeningBraceRegExp=regexPatterns.forwardRuleSemicolonAndOpeningBraceRegExp,cssCustomIdentifierRegExp=regexPatterns.cssCustomIdentifierRegExp,startsWithCombinatorRegExp=regexPatterns.
|
|
137
|
-
startsWithCombinatorRegExp,atPageRuleSelectorRegExp=regexPatterns.atPageRuleSelectorRegExp,startsWithHexEscapeRegExp=regexPatterns.startsWithHexEscapeRegExp,identStartCharRegExp=regexPatterns.identStartCharRegExp,identCharRegExp=regexPatterns.identCharRegExp,specialCharsNeedEscapeRegExp=regexPatterns.specialCharsNeedEscapeRegExp,combinatorOrSeparatorRegExp=regexPatterns.combinatorOrSeparatorRegExp,afterHexEscapeSeparatorRegExp=regexPatterns.afterHexEscapeSeparatorRegExp,trailingSpaceSeparatorRegExp=regexPatterns.
|
|
138
|
-
trailingSpaceSeparatorRegExp,endsWithHexEscapeRegExp=regexPatterns.endsWithHexEscapeRegExp,attributeSelectorContentRegExp=regexPatterns.attributeSelectorContentRegExp,pseudoElementRegExp=regexPatterns.pseudoElementRegExp,invalidCombinatorLtGtRegExp=regexPatterns.invalidCombinatorLtGtRegExp,invalidCombinatorDoubleGtRegExp=regexPatterns.invalidCombinatorDoubleGtRegExp,consecutiveCombinatorsRegExp=regexPatterns.consecutiveCombinatorsRegExp,invalidSlottedRegExp=regexPatterns.invalidSlottedRegExp,invalidPartRegExp=regexPatterns.
|
|
139
|
-
invalidPartRegExp,invalidCueRegExp=regexPatterns.invalidCueRegExp,invalidCueRegionRegExp=regexPatterns.invalidCueRegionRegExp,invalidNestingPattern=regexPatterns.invalidNestingPattern,emptyPseudoClassRegExp=regexPatterns.emptyPseudoClassRegExp,whitespaceNormalizationRegExp=regexPatterns.whitespaceNormalizationRegExp,newlineRemovalRegExp=regexPatterns.newlineRemovalRegExp,whitespaceAndDotRegExp=regexPatterns.whitespaceAndDotRegExp,declarationOrOpenBraceRegExp=regexPatterns.declarationOrOpenBraceRegExp,
|
|
140
|
-
ampersandRegExp=regexPatterns.ampersandRegExp,hexEscapeSequenceRegExp=regexPatterns.hexEscapeSequenceRegExp,attributeCaseFlagRegExp=regexPatterns.attributeCaseFlagRegExp,prependedAmpersandRegExp=regexPatterns.prependedAmpersandRegExp,openBraceGlobalRegExp=regexPatterns.openBraceGlobalRegExp,closeBraceGlobalRegExp=regexPatterns.closeBraceGlobalRegExp,scopePreludeSplitRegExp=regexPatterns.scopePreludeSplitRegExp,leadingWhitespaceRegExp=regexPatterns.leadingWhitespaceRegExp,doubleQuoteRegExp=regexPatterns.
|
|
141
|
-
doubleQuoteRegExp,backslashRegExp=regexPatterns.backslashRegExp,invalidMediaOperatorWithoutSpaceRegExp=regexPatterns.invalidMediaOperatorWithoutSpaceRegExp,invalidMediaNotAfterOperatorRegExp=regexPatterns.invalidMediaNotAfterOperatorRegExp,invalidMediaNotIdentifierRegExp=regexPatterns.invalidMediaNotIdentifierRegExp,invalidMediaNotAfterFeatureRegExp=regexPatterns.invalidMediaNotAfterFeatureRegExp,invalidMediaOperatorBetweenParensRegExp=regexPatterns.invalidMediaOperatorBetweenParensRegExp,invalidMediaNotWithMediaTypeRegExp=regexPatterns.
|
|
142
|
-
invalidMediaNotWithMediaTypeRegExp,mediaFeatureColonRegExp=regexPatterns.mediaFeatureColonRegExp,identifierBeforeParenRegExp=regexPatterns.identifierBeforeParenRegExp,mediaAndOperatorRegExp=regexPatterns.mediaAndOperatorRegExp,mediaOrOperatorRegExp=regexPatterns.mediaOrOperatorRegExp,mediaNotOperatorStartRegExp=regexPatterns.mediaNotOperatorStartRegExp,mediaNotOperatorRegExp=regexPatterns.mediaNotOperatorRegExp;function atRulesStatemenRegExpES5Alternative(ruleSlice){for(var i2=0;i2<ruleSlice.length;i2++){
|
|
143
|
-
var char=ruleSlice[i2];if(char===";"||char==="}"){var sliceBefore=ruleSlice.substring(0,i2),openBraceIndex=sliceBefore.indexOf("{");if(openBraceIndex===-1){for(var match=char,j=i2+1;j<ruleSlice.length&&/\s/.test(ruleSlice[j]);)match+=ruleSlice[j],j++;var matchObj=[match];return matchObj.index=i2,matchObj.input=ruleSlice,matchObj}}}return null}function matchBalancedBlock(str,fromIndex){fromIndex=fromIndex||0;var openIndex=str.indexOf("{",fromIndex);if(openIndex===-1)return null;for(var depth=0,i2=openIndex;i2<
|
|
144
|
-
str.length;i2++)if(str[i2]==="{")depth++;else if(str[i2]==="}"&&(depth--,depth===0)){var matchedString=str.slice(openIndex,i2+1);return{0:matchedString,index:openIndex,input:str}}return null}function ignoreBalancedBlock(i2,str,fromIndex){var ruleClosingMatch2=matchBalancedBlock(str,fromIndex);if(ruleClosingMatch2){var ignoreRange=ruleClosingMatch2.index+ruleClosingMatch2[0].length;i2+=ignoreRange,token.charAt(i2)==="}"&&(i2-=1)}else i2+=str.length;return i2}function parseScopePrelude(preludeContent){
|
|
145
|
-
var parts=preludeContent.split(scopePreludeSplitRegExp);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="";return hasStart&&(startSelector=parts[0].slice(1,-1).trim()),hasEnd&&(endSelector=
|
|
146
|
-
parts[1].slice(1,-1).trim()),hasOnlyEnd&&(endSelector=parts[0].slice(4,-1).trim()),{startSelector,endSelector,hasStart,hasEnd,hasOnlyEnd}}function hasPseudoElement(selector2){return pseudoElementRegExp.test(selector2)}function validateBalancedSyntax(selector2,trackAttributes,useStack){for(var parenDepth=0,bracketDepth=0,inSingleQuote=!1,inDoubleQuote=!1,inAttr=!1,stack=useStack?[]:null,i2=0;i2<selector2.length;i2++){var char=selector2[i2];if(char==="\\"){var escapeLen2=getEscapeSequenceLength(selector2,
|
|
147
|
-
i2);if(escapeLen2>0){i2+=escapeLen2-1;continue}}if(inSingleQuote)char==="'"&&(inSingleQuote=!1);else if(inDoubleQuote)char==='"'&&(inDoubleQuote=!1);else if(trackAttributes&&inAttr)char==="]"?inAttr=!1:char==="'"?inSingleQuote=!0:char==='"'&&(inDoubleQuote=!0);else if(trackAttributes&&char==="[")inAttr=!0;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0;else if(char==="(")useStack?stack.push("("):parenDepth++;else if(char===")"){if(useStack){if(!stack.length||stack.pop()!==
|
|
148
|
-
"(")return!1}else if(parenDepth--,parenDepth<0)return!1}else if(char==="[")bracketDepth++;else if(char==="]"&&(bracketDepth--,bracketDepth<0))return!1}return useStack?stack.length===0&&bracketDepth===0&&!inSingleQuote&&!inDoubleQuote&&!inAttr:parenDepth===0&&bracketDepth===0&&!inSingleQuote&&!inDoubleQuote}function hasBasicSyntaxError(selector2){return!validateBalancedSyntax(selector2,!1,!1)}function hasInvalidCombinators(selector2){return!!(invalidCombinatorLtGtRegExp.test(selector2)||invalidCombinatorDoubleGtRegExp.
|
|
149
|
-
test(selector2)||consecutiveCombinatorsRegExp.test(selector2))}function hasInvalidPseudoSyntax(selector2){for(var invalidPatterns=[invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp],i2=0;i2<invalidPatterns.length;i2++)if(invalidPatterns[i2].test(selector2))return!0;return!1}function hasInvalidNestingSelector(selector2){return invalidNestingPattern.test(selector2)}function canAtRuleBeNested(){if(currentScope===topScope)return!0;var hasStyleRuleInChain=!1,hasValidParent=!1;
|
|
150
|
-
if(currentScope.constructor.name==="CSSStyleRule"?hasStyleRuleInChain=!0:(currentScope instanceof CSSOM2.CSSScopeRule||currentScope instanceof CSSOM2.CSSConditionRule)&&(hasValidParent=!0),!hasStyleRuleInChain)for(var j=0;j<ancestorRules.length;j++){if(ancestorRules[j].constructor.name==="CSSStyleRule"){hasStyleRuleInChain=!0;break}(ancestorRules[j]instanceof CSSOM2.CSSScopeRule||ancestorRules[j]instanceof CSSOM2.CSSConditionRule)&&(hasValidParent=!0)}return hasValidParent&&!hasStyleRuleInChain}
|
|
151
|
-
function validateAtRule(atRuleKey,validCallback,cannotBeNested2){var isValid2=!1,ruleRegExp=getValidationRegex(atRuleKey),lookAheadLength=Math.min(100,token.length-i),ruleSlice=token.slice(i,i+lookAheadLength),shouldPerformCheck=!(cannotBeNested2&¤tScope!==topScope);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(
|
|
152
|
-
matches[matches.length-1]):searchStart,toCheckSlice=token.slice(lastI,i),checkedSlice=toCheckSlice.search(beforeRuleValidationRegExp);checkedSlice===0&&(isValid2=!0,lastValidationBoundary=lastI)}if(isValid2&&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 parsedScopePrelude2=parseScopePrelude(preludeContent),startSelector=parsedScopePrelude2.
|
|
153
|
-
startSelector,endSelector=parsedScopePrelude2.endSelector,hasStart=parsedScopePrelude2.hasStart,hasEnd=parsedScopePrelude2.hasEnd,hasOnlyEnd=parsedScopePrelude2.hasOnlyEnd;(hasStart&&startSelector===""||hasEnd&&endSelector===""||hasOnlyEnd&&endSelector===""||startSelector&&hasPseudoElement(startSelector)||endSelector&&hasPseudoElement(endSelector)||startSelector&&hasBasicSyntaxError(startSelector)||endSelector&&hasBasicSyntaxError(endSelector)||startSelector&&hasInvalidCombinators(startSelector)||
|
|
154
|
-
endSelector&&hasInvalidCombinators(endSelector)||startSelector&&hasInvalidPseudoSyntax(startSelector)||endSelector&&hasInvalidPseudoSyntax(endSelector)||!hasStart&&!hasOnlyEnd)&&(isValid2=!1)}}}if(isValid2&&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.
|
|
155
|
-
match(atPageRuleSelectorRegExp);if(match){var pageName=match[1]||"",pseudoPages=match[2]||"";if(pageName&&(cssCustomIdentifierRegExp.test(pageName)||(isValid2=!1)),pseudoPages){for(var pseudos2=pseudoPages.split(":").filter(function(p){return p}),validPseudos=["left","right","first","blank"],allValid=!0,j=0;j<pseudos2.length;j++)if(validPseudos.indexOf(pseudos2[j].toLowerCase())===-1){allValid=!1;break}allValid||(isValid2=!1)}}else isValid2=!1}}}}if(isValid2)validCallback.call(this);else{var ruleStatementMatch=atRulesStatemenRegExpES5Alternative(
|
|
156
|
-
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,
|
|
157
|
-
ruleSlice),state="before-selector"}}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(selector2){if(!selector2||selector2.length===0)return!1;var i2=0,len=selector2.length,hasMatchedComponent=!1;function skipEscape(){if(i2<len&&selector2[i2]==="\\"){var escapeLen2=getEscapeSequenceLength(selector2,i2);if(escapeLen2>0)return i2+=escapeLen2,!0}return!1}function parseIdentifier(){for(var start2=i2;i2<
|
|
158
|
-
len;)if(!skipEscape())if(isIdentChar(selector2[i2]))i2++;else break;return i2>start2}function parseNamespace(){var start2=i2;return i2<len&&selector2[i2]==="*"?i2++:i2<len&&(isIdentStart(selector2[i2])||selector2[i2]==="\\")&&parseIdentifier(),i2<len&&selector2[i2]==="|"?(i2++,!0):(i2=start2,!1)}function parsePseudoArgs(){if(i2>=len||selector2[i2]!=="(")return!1;i2++;for(var depth2=1,inString=!1,stringChar="";i2<len&&depth2>0;){var c=selector2[i2];c==="\\"&&i2+1<len?i2+=2:!inString&&(c==='"'||c===
|
|
159
|
-
"'")?(inString=!0,stringChar=c,i2++):inString&&c===stringChar?(inString=!1,i2++):!inString&&c==="("?(depth2++,i2++):(!inString&&c===")"&&depth2--,i2++)}return depth2===0}for(;i2<len;){for(var matched=!1,start=i2;i2<len&&/\s/.test(selector2[i2]);)i2++;if(i2>start){hasMatchedComponent=!0;continue}if(i2<len&&/[>+~]/.test(selector2[i2])){for(i2++,hasMatchedComponent=!0;i2<len&&/\s/.test(selector2[i2]);)i2++;continue}if(i2<len&&selector2[i2]==="&")i2++,hasMatchedComponent=!0,matched=!0;else if(i2<len&&
|
|
160
|
-
selector2[i2]===".")i2++,parseIdentifier()&&(hasMatchedComponent=!0,matched=!0);else if(i2<len&&selector2[i2]==="#")i2++,parseIdentifier()&&(hasMatchedComponent=!0,matched=!0);else if(i2<len&&selector2[i2]===":")i2++,i2<len&&selector2[i2]===":"&&i2++,parseIdentifier()&&(parsePseudoArgs(),hasMatchedComponent=!0,matched=!0);else if(i2<len&&selector2[i2]==="["){i2++;for(var depth=1;i2<len&&depth>0;)if(selector2[i2]==="\\")i2+=2;else if(selector2[i2]==="'"){for(i2++;i2<len&&selector2[i2]!=="'";)selector2[i2]===
|
|
161
|
-
"\\"?i2+=2:i2++;i2<len&&i2++}else if(selector2[i2]==='"'){for(i2++;i2<len&&selector2[i2]!=='"';)selector2[i2]==="\\"?i2+=2:i2++;i2<len&&i2++}else selector2[i2]==="["?(depth++,i2++):(selector2[i2]==="]"&&depth--,i2++);depth===0&&(hasMatchedComponent=!0,matched=!0)}else i2<len&&(isIdentStart(selector2[i2])||selector2[i2]==="\\"||selector2[i2]==="*"||selector2[i2]==="|"||selector2[i2]==="-")&&(parseNamespace(),i2<len&&selector2[i2]==="*"?(i2++,hasMatchedComponent=!0,matched=!0):i2<len&&(isIdentStart(
|
|
162
|
-
selector2[i2])||selector2[i2]==="\\"||selector2[i2]==="-")&&parseIdentifier()&&(hasMatchedComponent=!0,matched=!0));if(!matched&&i2===start)return!1}return hasMatchedComponent}function basicSelectorValidator(selector2){if(selector2.length>1e4||!validateBalancedSyntax(selector2,!0,!0)||hasInvalidCombinators(selector2)||hasInvalidPseudoSyntax(selector2)||hasInvalidNestingSelector(selector2))return!1;for(var noQuotesPseudos=["lang","dir","nth-child","nth-last-child","nth-of-type","nth-last-of-type"],
|
|
163
|
-
idx=0;idx<selector2.length;idx++)if(selector2[idx]===":"){var pseudoStart=idx;idx++,idx<selector2.length&&selector2[idx]===":"&&idx++;for(var nameStart=idx;idx<selector2.length&&/[a-zA-Z0-9\-]/.test(selector2[idx]);)idx++;if(idx===nameStart)continue;var pseudoName=selector2.substring(nameStart,idx).toLowerCase();if(idx<selector2.length&&selector2[idx]==="("){idx++;for(var contentStart=idx,depth=1;idx<selector2.length&&depth>0;)selector2[idx]==="\\"?idx+=2:selector2[idx]==="("?(depth++,idx++):(selector2[idx]===
|
|
164
|
-
")"&&depth--,idx++);if(depth===0){for(var pseudoContent=selector2.substring(contentStart,idx-1),j=0;j<noQuotesPseudos.length;j++)if(pseudoName===noQuotesPseudos[j]&&/['"]/.test(pseudoContent))return!1}}}return looseSelectorValidator(selector2)}function extractPseudoClasses(selector2){for(var matches=[],i2=0;i2<selector2.length;i2++)if(selector2[i2]===":"){var pseudoStart=i2;i2++,i2<selector2.length&&selector2[i2]===":"&&i2++;for(var nameStart=i2;i2<selector2.length&&/[a-zA-Z\-]/.test(selector2[i2]);)
|
|
165
|
-
i2++;if(i2===nameStart)continue;var pseudoName=selector2.substring(nameStart,i2);if(i2<selector2.length&&selector2[i2]==="("){i2++;for(var argsStart=i2,depth=1,inSingleQuote=!1,inDoubleQuote=!1;i2<selector2.length&&depth>0;){var ch=selector2[i2];ch==="\\"?i2+=2:ch==="'"&&!inDoubleQuote?(inSingleQuote=!inSingleQuote,i2++):ch==='"'&&!inSingleQuote?(inDoubleQuote=!inDoubleQuote,i2++):ch==="("&&!inSingleQuote&&!inDoubleQuote?(depth++,i2++):(ch===")"&&!inSingleQuote&&!inDoubleQuote&&depth--,i2++)}if(depth===
|
|
166
|
-
0){var pseudoArgs=selector2.substring(argsStart,i2-1),fullMatch=selector2.substring(pseudoStart,i2);matches.push([fullMatch,pseudoName,pseudoArgs,pseudoStart])}i2--}}return matches}function parseAndSplitNestedSelectors(selector2){var depth=0,buffer2="",parts=[],inSingleQuote=!1,inDoubleQuote=!1,i2,char;for(i2=0;i2<selector2.length;i2++){if(char=selector2.charAt(i2),char==="\\"&&i2+1<selector2.length){buffer2+=char,i2++,buffer2+=selector2.charAt(i2);continue}char==="'"&&!inDoubleQuote?(inSingleQuote=
|
|
167
|
-
!inSingleQuote,buffer2+=char):char==='"'&&!inSingleQuote?(inDoubleQuote=!inDoubleQuote,buffer2+=char):!inSingleQuote&&!inDoubleQuote?char==="("?(depth++,buffer2+=char):char===")"?(depth--,buffer2+=char):char===","&&depth===0?(buffer2.trim()&&parts.push(buffer2.trim()),buffer2=""):buffer2+=char:buffer2+=char}var trimmed=buffer2.trim();if(trimmed){var endsWithHexEscape=endsWithHexEscapeRegExp.test(buffer2);parts.push(endsWithHexEscape?buffer2.replace(leadingWhitespaceRegExp,""):trimmed)}return parts}
|
|
168
|
-
var validatedSelectorsCache={},selectorListPseudoClasses={not:!0,is:!0,has:!0,where:!0};function validateSelector(selector2){if(validatedSelectorsCache.hasOwnProperty(selector2))return validatedSelectorsCache[selector2];for(var pseudoClassMatches=extractPseudoClasses(selector2),j=0;j<pseudoClassMatches.length;j++){var pseudoClass=pseudoClassMatches[j][1];if(selectorListPseudoClasses.hasOwnProperty(pseudoClass)){for(var nestedSelectors=parseAndSplitNestedSelectors(pseudoClassMatches[j][2]),hasAmpersand=!1,
|
|
169
|
-
k=0;k<nestedSelectors.length;k++)if(ampersandRegExp.test(nestedSelectors[k])){hasAmpersand=!0;break}if(hasAmpersand)continue;for(var i2=0;i2<nestedSelectors.length;i2++){var nestedSelector=nestedSelectors[i2];if(validatedSelectorsCache.hasOwnProperty(nestedSelector)){if(!validatedSelectorsCache[nestedSelector])return validatedSelectorsCache[selector2]=!1,!1}else{var nestedSelectorValidation=validateSelector(nestedSelector);if(validatedSelectorsCache[nestedSelector]=nestedSelectorValidation,!nestedSelectorValidation)
|
|
170
|
-
return validatedSelectorsCache[selector2]=!1,!1}}}}var basicSelectorValidation=basicSelectorValidator(selector2);return validatedSelectorsCache[selector2]=basicSelectorValidation,basicSelectorValidation}function validateNamespaceSelector(selector2){for(var pipeIndex=-1,inAttr=!1,inSingleQuote=!1,inDoubleQuote=!1,i2=0;i2<selector2.length;i2++){var char=selector2[i2];if(char==="\\"){var escapeLen2=getEscapeSequenceLength(selector2,i2);if(escapeLen2>0){i2+=escapeLen2-1;continue}}if(inSingleQuote)char===
|
|
171
|
-
"'"&&(inSingleQuote=!1);else if(inDoubleQuote)char==='"'&&(inDoubleQuote=!1);else if(inAttr)char==="]"?inAttr=!1:char==="'"?inSingleQuote=!0:char==='"'&&(inDoubleQuote=!0);else if(char==="[")inAttr=!0;else if(char==="|"&&!inAttr){pipeIndex=i2;break}}if(pipeIndex===-1)return!0;var namespacePrefix=selector2.substring(0,pipeIndex);return namespacePrefix==="*"||namespacePrefix===""?!0:definedNamespacePrefixes.hasOwnProperty(namespacePrefix)}function normalizeSelectorEscapes(selector2){for(var result="",
|
|
172
|
-
i2=0,nextChar="",inIdentifier=!1,inAttribute=!1,attributeDepth=0,needsEscapeForIdent=!1,lastWasHexEscape=!1;i2<selector2.length;){var char=selector2[i2];if(char==="["&&!inAttribute){inAttribute=!0,attributeDepth=1,result+=char,i2++,needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1;continue}if(inAttribute){if(char==="["&&attributeDepth++,char==="]"&&(attributeDepth--,attributeDepth===0&&(inAttribute=!1)),char==="\\"&&i2+1<selector2.length){var escapeLen2=getEscapeSequenceLength(selector2,
|
|
173
|
-
i2);result+=selector2.substr(i2,escapeLen2),i2+=escapeLen2}else result+=char,i2++;lastWasHexEscape=!1;continue}if(char==="\\"){var escapeLen2=getEscapeSequenceLength(selector2,i2);if(escapeLen2>0){var escapeSeq=selector2.substr(i2,escapeLen2),decoded=decodeEscapeSequence(escapeSeq),wasHexEscape=startsWithHexEscapeRegExp.test(escapeSeq),hadTerminatingSpace=wasHexEscape&&escapeSeq[escapeLen2-1]===" ";nextChar=selector2[i2+escapeLen2]||"";var needsEscape=!1,useHexEscape=!1;if(needsEscapeForIdent)if(isDigit(
|
|
174
|
-
decoded))needsEscape=!0,useHexEscape=!0;else if(decoded==="-"){var remainingSelector=selector2.substring(i2+escapeLen2),hasMoreIdentChars=remainingSelector&&identCharRegExp.test(remainingSelector[0]);needsEscape=!hasMoreIdentChars}else identStartCharRegExp.test(decoded)||(needsEscape=!0);else specialCharsNeedEscapeRegExp.test(decoded)&&(needsEscape=!0);if(needsEscape)if(useHexEscape){var codePoint=decoded.charCodeAt(0),hex=codePoint.toString(16);result+="\\"+hex,isHexDigit(nextChar)||!nextChar||
|
|
175
|
-
afterHexEscapeSeparatorRegExp.test(nextChar)?(result+=" ",lastWasHexEscape=!1):lastWasHexEscape=!0}else result+="\\"+decoded,lastWasHexEscape=!1;else lastWasHexEscape&&!hadTerminatingSpace&&isAlphanumeric(decoded)&&(result+=" "),result+=decoded,hadTerminatingSpace&&(!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar))&&(result+=" "),lastWasHexEscape=!1;i2+=escapeLen2,needsEscapeForIdent=needsEscapeForIdent&&decoded==="-",inIdentifier=!0;continue}}if(char==="."||char==="#")result+=char,needsEscapeForIdent=
|
|
176
|
-
!0,inIdentifier=!1,lastWasHexEscape=!1,i2++;else if(char==="-"&&needsEscapeForIdent)result+=char,needsEscapeForIdent=!0,lastWasHexEscape=!1,i2++;else if(isDigit(char)&&needsEscapeForIdent){var codePoint=char.charCodeAt(0),hex=codePoint.toString(16);result+="\\"+hex,nextChar=selector2[i2+1]||"",isHexDigit(nextChar)||!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar)?(result+=" ",lastWasHexEscape=!1):lastWasHexEscape=!0,needsEscapeForIdent=!1,inIdentifier=!0,i2++}else char===":"||combinatorOrSeparatorRegExp.
|
|
177
|
-
test(char)?(char===" "&&lastWasHexEscape&&result[result.length-1]===" "||(result+=char),needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1,i2++):isLetter(char)&&lastWasHexEscape?(result+=" "+char,needsEscapeForIdent=!1,inIdentifier=!0,lastWasHexEscape=!1,i2++):char===" "&&lastWasHexEscape?(nextChar=selector2[i2+1]||"",(!nextChar||trailingSpaceSeparatorRegExp.test(nextChar))&&(result+=char),needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1,i2++):(result+=char,needsEscapeForIdent=
|
|
178
|
-
!1,inIdentifier=!0,lastWasHexEscape=!1,i2++)}return result}function decodeEscapeSequencesInString(str){for(var result="",i2=0;i2<str.length;i2++){if(str[i2]==="\\"&&i2+1<str.length){var escapeLen2=getEscapeSequenceLength(str,i2);if(escapeLen2>0){var escapeSeq=str.substr(i2,escapeLen2),decoded=decodeEscapeSequence(escapeSeq);result+=decoded,i2+=escapeLen2-1;continue}}result+=str[i2]}return result}function decodeEscapeSequence(escapeSeq){if(escapeSeq.length<2||escapeSeq[0]!=="\\")return escapeSeq;
|
|
179
|
-
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(selector2){for(var result="",i2=0;i2<selector2.length;)if(selector2[i2]==="["){result+="[",i2++;for(var attrContent="",depth=1;i2<selector2.
|
|
180
|
-
length&&depth>0;){if(selector2[i2]==="\\"&&i2+1<selector2.length){attrContent+=selector2.substring(i2,i2+2),i2+=2;continue}if(selector2[i2]==="["&&depth++,selector2[i2]==="]"&&(depth--,depth===0))break;attrContent+=selector2[i2],i2++}var normalized2=normalizeAttributeContent(attrContent);if(normalized2===null)return null;result+=normalized2,i2<selector2.length&&selector2[i2]==="]"&&(result+="]",i2++)}else result+=selector2[i2],i2++;return result}function processQuotedAttributeValue(trimmedValue,quoteChar,attrName,operator,flag){
|
|
181
|
-
if(trimmedValue.length<2)return null;for(var i2=1,foundClose=!1;i2<trimmedValue.length;){if(trimmedValue[i2]==="\\"&&i2+1<trimmedValue.length){var escapeLen2=getEscapeSequenceLength(trimmedValue,i2);i2+=escapeLen2;continue}if(trimmedValue[i2]===quoteChar){foundClose=i2===trimmedValue.length-1;break}i2++}if(!foundClose)return null;var innerValue=trimmedValue.slice(1,-1),decodedValue=decodeEscapeSequencesInString(innerValue),escapedValue=decodedValue.replace(doubleQuoteRegExp,'\\"');return attrName+
|
|
182
|
-
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,
|
|
183
|
-
operator,flag);if(firstChar==="'")return processQuotedAttributeValue(trimmedValue,"'",attrName,operator,flag);for(var hasUnescapedSpecialChar=!1,i2=0;i2<trimmedValue.length;i2++){var char=trimmedValue[i2];if(char==="\\"&&i2+1<trimmedValue.length){var escapeLen2=getEscapeSequenceLength(trimmedValue,i2);if(escapeLen2>0){i2+=escapeLen2-1;continue}}if(specialCharsNeedEscapeRegExp.test(char)){hasUnescapedSpecialChar=!0;break}}if(hasUnescapedSpecialChar)return null;var decodedValue=decodeEscapeSequencesInString(
|
|
184
|
-
trimmedValue),escapedValue=decodedValue.replace(backslashRegExp,"\\\\").replace(doubleQuoteRegExp,'\\"');return attrName+operator+'"'+escapedValue+'"'+(flag?" "+flag:"")}function processSelectorText(selectorText){var normalized2=selectorText.replace(whitespaceNormalizationRegExp,function(match,_,newline){return newline?" ":match});return normalized2=normalizeSelectorEscapes(normalized2),normalized2=normalizeAttributeSelectors(normalized2),normalized2===null?"":processNestedPseudoClasses(normalized2)}
|
|
185
|
-
function processNestedPseudoClasses(selectorText,depth){if(typeof depth>"u"&&(depth=0),depth>10)return selectorText;var pseudoClassMatches=extractPseudoClasses(selectorText);if(pseudoClassMatches.length===0)return selectorText;for(var result=selectorText,j=pseudoClassMatches.length-1;j>=0;j--){var pseudoClass=pseudoClassMatches[j][1];if(selectorListPseudoClasses.hasOwnProperty(pseudoClass)){for(var fullMatch=pseudoClassMatches[j][0],pseudoArgs=pseudoClassMatches[j][2],matchStart=pseudoClassMatches[j][3],
|
|
186
|
-
nestedSelectorsRaw=parseAndSplitNestedSelectors(pseudoArgs),hasAmpersand=!1,k=0;k<nestedSelectorsRaw.length;k++)if(ampersandRegExp.test(nestedSelectorsRaw[k])){hasAmpersand=!0;break}if(hasAmpersand)continue;for(var processedArgs=processNestedPseudoClasses(pseudoArgs,depth+1),nestedSelectors=parseAndSplitNestedSelectors(processedArgs),validSelectors=[],i2=0;i2<nestedSelectors.length;i2++){var nestedSelector=nestedSelectors[i2];basicSelectorValidator(nestedSelector)&&validSelectors.push(nestedSelector)}
|
|
187
|
-
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 i2=0;i2<selectorText.length;i2++){var char=selectorText[i2];if(char==="'")for(i2++;i2<selectorText.length;){if(selectorText[i2]==="\\"&&i2+1<selectorText.length){i2+=2;continue}if(selectorText[i2]==="'")break;if(selectorText[i2]==="\r"||selectorText[i2]===
|
|
188
|
-
`
|
|
189
|
-
`)return!0;i2++}else if(char==='"')for(i2++;i2<selectorText.length;){if(selectorText[i2]==="\\"&&i2+1<selectorText.length){i2+=2;continue}if(selectorText[i2]==='"')break;if(selectorText[i2]==="\r"||selectorText[i2]===`
|
|
190
|
-
`)return!0;i2++}}return!1}function isValidSelectorText(selectorText){if(!selectorText||selectorText.trim()===""||emptyPseudoClassRegExp.test(selectorText)||hasNewlineInQuotedString(selectorText))return!1;for(var selectors=parseAndSplitNestedSelectors(selectorText),i2=0;i2<selectors.length;i2++){var selector2=selectors[i2].trim();if(!validateSelector(selector2)||!validateNamespaceSelector(selector2))return!1}return!0}function pushToAncestorRules(rule){ancestorRules.push(rule)}function parseError(message,isNested){
|
|
191
|
-
var lines=token.substring(0,i).split(`
|
|
192
|
-
`),lineCount=lines.length,charCount=lines.pop().length+1,error=new 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 ruleClosingMatch2=token.slice(i).match(forwardRuleClosingBraceRegExp);ruleClosingMatch2&&(i+=ruleClosingMatch2.index+ruleClosingMatch2[0].length-1),styleRule=null,buffer=
|
|
193
|
-
"",hasUnmatchedQuoteInSelector=!1,state=nextState}function isSelectorStartChar(char){return".:#&*[\\".indexOf(char)!==-1}function isWhitespaceChar(char){return`
|
|
194
|
-
\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){
|
|
195
|
-
if(str[pos]!=="\\"||pos+1>=str.length)return 0;var nextChar=str[pos+1];if(isHexDigit(nextChar)){for(var hexLength=1;hexLength<6&&pos+1+hexLength<str.length&&isHexDigit(str[pos+1+hexLength]);)hexLength++;return pos+1+hexLength<str.length&&isWhitespaceChar(str[pos+1+hexLength])?1+hexLength+1:1+hexLength}return 2}function containsUnescaped(str,char){for(var i2=0;i2<str.length;i2++){if(str[i2]==="\\"){var escapeLen2=getEscapeSequenceLength(str,i2);if(escapeLen2>0){i2+=escapeLen2-1;continue}}if(str[i2]===
|
|
196
|
-
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,
|
|
197
|
-
function(match,openParen,name2,spaces,rest){var beforeMatch=result.lastIndexOf(match),beforeParen=beforeMatch>0?result.charAt(beforeMatch-1):"";return identifierBeforeParenRegExp.test(beforeParen)?match:openParen+name2+": "+rest}),result=result.replace(mediaAndOperatorRegExp," and "),result=result.replace(mediaOrOperatorRegExp," or "),result=result.replace(mediaNotOperatorStartRegExp,"not "),result=result.replace(mediaNotOperatorRegExp," not "),result.trim()}for(var endingIndex=token.length-1,initialEndingIndex=endingIndex,
|
|
198
|
-
character;character=token.charAt(i);i++){if(i===endingIndex)switch(state){case"importRule":case"namespaceRule":case"layerBlock":character!==";"&&(token+=";",endingIndex+=1);break;case"value":if(character!=="}"){character===";"?token+="}":token+=";",endingIndex+=1;break}case"name":case"before-name":character==="}"?token+=" ":token+="}",endingIndex+=1;break;case"before-selector":if(character!=="}"&¤tScope!==styleSheet){token+="}",endingIndex+=1;break}}if(character==="\\"&&i+1<token.length){var escapeLen=getEscapeSequenceLength(
|
|
199
|
-
token,i);if(escapeLen>0){buffer+=token.substr(i,escapeLen),i+=escapeLen-1;continue}}switch(character){case" ":case" ":case"\r":case`
|
|
200
|
-
`:case"\f":SIGNIFICANT_WHITESPACE[state]&&(buffer+=character);break;case'"':index=i+1;do index=token.indexOf('"',index)+1,index||(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",i===endingIndex&&(token+=";");break;case"namespaceRule-begin":state="namespaceRule",i===
|
|
201
|
-
endingIndex&&(token+=";");break}break;case"'":index=i+1;do index=token.indexOf("'",index)+1,index||(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"/":token.charAt(i+1)==="*"?(i+=2,index=token.indexOf(
|
|
202
|
-
"*/",i),index===-1?(i=token.length-1,buffer=""):i=index+1):buffer+=character,state==="importRule-begin"&&(buffer+=" ",state="importRule"),state==="namespaceRule-begin"&&(buffer+=" ",state="namespaceRule");break;case"@":if(nestedSelectorRule&&(styleRule&&styleRule.constructor.name==="CSSNestedDeclarations"&¤tScope.cssRules.push(styleRule),styleRule!==nestedSelectorRule&&nestedSelectorRule.parentRule&&nestedSelectorRule.parentRule.constructor.name==="CSSStyleRule"&&(styleRule=nestedSelectorRule.
|
|
203
|
-
parentRule)),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.
|
|
204
|
-
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=
|
|
205
|
-
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(){
|
|
206
|
-
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){
|
|
207
|
-
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(
|
|
208
|
-
"@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+=
|
|
209
|
-
matchKeyframes[0].length-1,buffer="";break}else state==="selector"&&(state="atRule")}buffer+=character;break;case"{":if(currentScope===topScope&&(nestedSelectorRule=null),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-\
|
|
210
|
-
selector",i+=ruleClosingMatch.index+ruleClosingMatch[0].length;break}}if(styleRule||(styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i),hasUnmatchedQuoteInSelector){handleUnmatchedQuoteInSelector("before-selector");break}var originalParentRule=parentRule;parentRule&&(styleRule.__parentRule=parentRule,pushToAncestorRules(parentRule)),currentScope=parentRule=styleRule;var processedSelectorText=processSelectorText(buffer.trim());originalParentRule&&originalParentRule.constructor.name==="CSSSty\
|
|
211
|
-
leRule"?styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).map(function(sel){return sel.indexOf("&")===-1||startsWithCombinatorRegExp.test(sel)?"& "+sel:sel}).join(", "):styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).join(", "),styleRule.style.__starts=i,styleRule.__parentStyleSheet=styleSheet,buffer="",state="before-name"}else if(state==="atBlock")mediaRule.media.mediaText=normalizeConditionText(buffer.trim()),parentRule&&(mediaRule.__parentRule=
|
|
212
|
-
parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule&&(nestedSelectorRule=parentRule)),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")containerRule.__conditionText=normalizeConditionText(buffer.trim()),parentRule&&(containerRule.
|
|
213
|
-
__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.
|
|
214
|
-
test(counterStyleName);isValidCounterStyleName&&(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;isValidPropertyName&&(propertyRule.__name=propertyName,parentRule&&(propertyRule.__parentRule=parentRule),propertyRule.__parentStyleSheet=
|
|
215
|
-
styleSheet,styleRule=propertyRule),buffer=""}else if(state==="conditionBlock")supportsRule.__conditionText=normalizeConditionText(buffer.trim()),parentRule&&(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===
|
|
216
|
-
"scopeBlock"){var parsedScopePrelude=parseScopePrelude(buffer.trim());parsedScopePrelude.hasStart&&(scopeRule.__start=parsedScopePrelude.startSelector),parsedScopePrelude.hasEnd&&(scopeRule.__end=parsedScopePrelude.endSelector),parsedScopePrelude.hasOnlyEnd&&(scopeRule.__end=parsedScopePrelude.endSelector),parentRule&&(scopeRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule&&(nestedSelectorRule=parentRule)),currentScope=
|
|
217
|
-
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;isValidName&&(parentRule&&(layerBlockRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule&&(nestedSelectorRule=parentRule)),
|
|
218
|
-
currentScope=parentRule=layerBlockRule,pushToAncestorRules(layerBlockRule),layerBlockRule.__parentStyleSheet=styleSheet),styleRule=null,buffer="",state="before-selector"}else if(state==="pageBlock")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")parentRule&&pushToAncestorRules(parentRule),
|
|
219
|
-
currentScope=parentRule=hostRule,pushToAncestorRules(hostRule),hostRule.__parentStyleSheet=styleSheet,buffer="",state="before-selector";else if(state==="startingStyleRule-begin")parentRule&&(startingStyleRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule&&(nestedSelectorRule=parentRule)),currentScope=parentRule=startingStyleRule,pushToAncestorRules(startingStyleRule),startingStyleRule.__parentStyleSheet=styleSheet,styleRule=
|
|
220
|
-
null,buffer="",state="before-selector";else if(state==="fontFaceRule-begin")parentRule&&(fontFaceRule.__parentRule=parentRule),fontFaceRule.__parentStyleSheet=styleSheet,styleRule=fontFaceRule,buffer="",state="before-name";else if(state==="keyframesRule-begin")keyframesRule.name=buffer.trim(),parentRule&&(pushToAncestorRules(parentRule),keyframesRule.__parentRule=parentRule),keyframesRule.__parentStyleSheet=styleSheet,currentScope=parentRule=keyframesRule,buffer="",state="keyframeRule-begin";else if(state===
|
|
221
|
-
"keyframeRule-begin")styleRule=new CSSOM2.CSSKeyframeRule,styleRule.keyText=buffer.trim(),styleRule.__starts=i,buffer="",state="before-name";else if(state==="documentRule-begin")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"){
|
|
222
|
-
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"?(styleRule.style.length&&(parentRule.cssRules.push(styleRule),styleRule.__parentRule=parentRule,
|
|
223
|
-
styleRule.__parentStyleSheet=styleSheet),pushToAncestorRules(parentRule)):(currentScope=parentRule=styleRule,pushToAncestorRules(parentRule),styleRule.__parentStyleSheet=styleSheet),styleRule=new CSSOM2.CSSStyleRule,hasUnmatchedQuoteInSelector){handleUnmatchedQuoteInSelector("before-name");break}var processedSelectorText=processSelectorText(buffer.trim());parentRule.constructor.name==="CSSScopeRule"||parentRule.constructor.name!=="CSSStyleRule"&&parentRule.parentRule===null?styleRule.selectorText=
|
|
224
|
-
parseAndSplitNestedSelectors(processedSelectorText).join(", "):styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).map(function(sel){return sel.indexOf("&")===-1||startsWithCombinatorRegExp.test(sel)?"& "+sel:sel}).join(", "),styleRule.style.__starts=i-buffer.length,styleRule.__parentRule=parentRule,(parentRule.constructor.name==="CSSStyleRule"||parentRule.constructor.name==="CSSScopeRule")&&(nestedSelectorRule=styleRule),styleRule.__parentStyleSheet=styleSheet,currentScope=
|
|
225
|
-
parentRule=styleRule,buffer="",state="before-name"}break;case":":if(state==="name"){var openBraceBeforeMatch=token.slice(i).match(declarationOrOpenBraceRegExp),hasOpenBraceBefore=openBraceBeforeMatch&&openBraceBeforeMatch[0]==="{";hasOpenBraceBefore?buffer+=character:(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();info.error?parseError(info.error):(buffer+=
|
|
226
|
-
info.expression,i=info.idx)}else state="value-parenthesis",valueParenthesisDepth=1,buffer+=character;else state==="value-parenthesis"&&valueParenthesisDepth++,buffer+=character;break;case")":state==="value-parenthesis"&&(valueParenthesisDepth--,valueParenthesisDepth===0&&(state="value")),buffer+=character;break;case"!":state==="value"&&token.indexOf("!important",i)===i?(priority="important",i+=9):buffer+=character;break;case";":switch(state){case"before-value":case"before-name":parseError("Unexp\
|
|
227
|
-
ected ;"),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});isValid&&(importRule=new CSSOM2.CSSImportRule,opts&&opts.globalObject&&opts.globalObject.CSSStyleSheet&&
|
|
228
|
-
(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});
|
|
229
|
-
if(isValid)try{var testNamespaceRule=new CSSOM2.CSSNamespaceRule;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(name2){return name2.trim()}),isInvalid=nameListStr.
|
|
230
|
-
some(function(name2){return name2.trim().match(cssCustomIdentifierRegExp)===null}),hasStyleRuleParent=!1;if(parentRule)for(var checkParent=parentRule;checkParent;){if(checkParent.constructor.name==="CSSStyleRule"){hasStyleRuleParent=!0;break}checkParent=checkParent.__parentRule}!isInvalid&&!hasStyleRuleParent&&(layerStatementRule=new CSSOM2.CSSLayerStatementRule,layerStatementRule.__parentStyleSheet=styleSheet,layerStatementRule.__starts=layerBlockRule.__starts,layerStatementRule.__ends=i,layerStatementRule.
|
|
231
|
-
nameList=nameListStr,parentRule?(layerStatementRule.__parentRule=parentRule,parentRule.cssRules.push(layerStatementRule)):topScope.cssRules.push(layerStatementRule)),buffer="",state="before-selector";break;default:buffer+=character;break}break;case"}":if(state==="counterStyleBlock"){counterStyleRule.name&&(counterStyleRule.parse("@counter-style "+counterStyleRule.name+" { "+buffer+" }"),counterStyleRule.__ends=i+1,counterStyleRule.__parentRule?counterStyleRule.__parentRule.cssRules.push(counterStyleRule):
|
|
232
|
-
topScope.cssRules.push(counterStyleRule)),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+" }");parseSuccess&&(propertyRule.__ends=i+1,propertyRule.__parentRule?propertyRule.__parentRule.cssRules.push(propertyRule):topScope.cssRules.push(propertyRule))}propertyRule.__parentRule&&(currentScope=
|
|
233
|
-
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()),parentRule&&(styleRule.__parentRule=parentRule),styleRule.__parentStyleSheet=styleSheet,currentScope===styleRule&&(currentScope=parentRule||topScope),styleRule.constructor.name==="CSS\
|
|
234
|
-
StyleRule"&&!isValidSelectorText(styleRule.selectorText)?(styleRule===nestedSelectorRule&&(nestedSelectorRule=null),parseError('Invalid CSSStyleRule (selectorText = "'+styleRule.selectorText+'")',styleRule.parentRule!==null)):styleRule.parentRule?styleRule.parentRule.cssRules.push(styleRule):currentScope.cssRules.push(styleRule),buffer="",currentScope.constructor===CSSOM2.CSSKeyframesRule?state="keyframeRule-begin":state="before-selector",styleRule.constructor.name==="CSSNestedDeclarations")currentScope!==
|
|
235
|
-
topScope&&(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;!isPrependedAmpersand&&isGroupingRule?(currentScope.constructor.name==="CSSStyleRule"||currentScope.
|
|
236
|
-
constructor.name==="CSSScopeRule")&&(nestedSelectorRule=currentScope):nestedSelectorRule=null}else 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";hasPreviousStyleRule&&(i=ignoreBalancedBlock(i,token.slice(i),1));
|
|
237
|
-
break}for(;ancestorRules.length>0;)if(parentRule=ancestorRules.pop(),parentRule!==currentScope&&parentRule instanceof CSSOM2.CSSGroupingRule&&(parentRule.constructor.name!=="CSSStyleRule"||parentRule.__parentRule)){var isClosingNestedSelectorContext=nestedSelectorRule&&(currentScope===nestedSelectorRule||nestedSelectorRule.__parentRule===currentScope);if(isClosingNestedSelectorContext)if(nestedSelectorRule.parentRule){prevScope=nestedSelectorRule,currentScope=nestedSelectorRule.parentRule;var scopeId=getRuleId(
|
|
238
|
-
prevScope);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;actualParent!==prevScope&&actualParent.cssRules.push(prevScope),currentScope=actualParent,parentRule=actualParent;break}else{prevScope=currentScope,parentRule!==prevScope&&parentRule.cssRules.push(prevScope);break}}if(ancestorRules.
|
|
239
|
-
length===0&¤tScope.__parentRule&¤tScope.__parentRule.cssRules){var parentId=getRuleId(currentScope);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),currentScope=topScope,nestedSelectorRule===parentRule){
|
|
240
|
-
var nestedSelectorTokenToCurrentSelectorToken=token.slice(nestedSelectorRule.__starts,i+1),openingBraceMatch=nestedSelectorTokenToCurrentSelectorToken.match(openBraceGlobalRegExp),closingBraceMatch=nestedSelectorTokenToCurrentSelectorToken.match(closeBraceGlobalRegExp),openingBraceLen=openingBraceMatch&&openingBraceMatch.length,closingBraceLen=closingBraceMatch&&closingBraceMatch.length;openingBraceLen===closingBraceLen&&(nestedSelectorRule.__ends=i+1,nestedSelectorRule=null,parentRule=null)}else
|
|
241
|
-
parentRule=null}else currentScope=parentRule;buffer="",state="before-selector";break}break;default:switch(state){case"before-selector":state="selector",(styleRule||scopeRule)&&parentRule?!isSelectorStartChar(character)&&!isWhitespaceChar(character)&&parentRule instanceof CSSOM2.CSSGroupingRule&&(state="before-name",styleRule!==parentRule&&(styleRule=new CSSOM2.CSSNestedDeclarations,styleRule.__starts=i)):nestedSelectorRule&&parentRule&&parentRule instanceof CSSOM2.CSSGroupingRule&&(isSelectorStartChar(
|
|
242
|
-
character)?(styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i):isWhitespaceChar(character)||(state="before-name",parentRule.cssRules.length||nestedSelectorRule?(currentScope=parentRule,(parentRule.constructor.name==="CSSStyleRule"||parentRule.constructor.name==="CSSScopeRule")&&(nestedSelectorRule=parentRule),styleRule=new CSSOM2.CSSNestedDeclarations,styleRule.__starts=i):parentRule.constructor.name==="CSSStyleRule"?styleRule=parentRule:(styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=
|
|
243
|
-
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;currentScope!==topScope&&ancestorRules.indexOf(currentScope)===-1&&(needsClosing+=1);for(var closeIdx=0;closeIdx<needsClosing;closeIdx++)token+="}",endingIndex+=1}}return buffer.
|
|
244
|
-
trim()!==""&&parseError("Unexpected end of input"),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=
|
|
245
|
-
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.
|
|
246
|
-
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=
|
|
247
|
-
require_CSSLayerBlockRule().CSSLayerBlockRule;CSSOM2.CSSLayerStatementRule=require_CSSLayerStatementRule().CSSLayerStatementRule;CSSOM2.CSSPageRule=require_CSSPageRule().CSSPageRule;require_cssstyleTryCatchBlock()}});var require_CSSStyleDeclaration=__commonJS({"node_modules/@acemir/cssom/lib/CSSStyleDeclaration.js"(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){
|
|
248
|
-
if(!(name==="length"||name==="parentRule"||name==="_importants"||name==="__starts"||name in CSSOM2.CSSStyleDeclaration.prototype||indexedPropertyNameRegExp.test(name))){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,
|
|
249
|
-
name);index<0&&(this[this.length]=name,this.length++),(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.
|
|
250
|
-
call(this,index,1),prevValue},getPropertyCSSValue:function(){},getPropertyPriority:function(name){return this._importants[name]||""},getPropertyShorthand:function(){},isPropertyImplicit:function(){},get cssText(){for(var properties=[],i=0,length=this.length;i<length;++i){var name=this[i],value=this.getPropertyValue(name),priority=this.getPropertyPriority(name);priority&&(priority=" !"+priority),properties[i]=name+": "+value+priority+";"}return properties.join(" ")},set cssText(text){var i,name;for(i=
|
|
251
|
-
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({"node_modules/@acemir/cssom/lib/clone.js"(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().
|
|
252
|
-
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=__require("cssstyle").
|
|
253
|
-
CSSStyleDeclaration}catch{}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)for(var styleClone=ruleClone.style=new CSSOM2.CSSStyleDeclaration,j=0,styleLength=style.length;j<styleLength;j++){var name=style[j];styleClone.setProperty(name,style.getPropertyValue(name),style.getPropertyPriority(
|
|
254
|
-
name))}rule.hasOwnProperty("keyText")&&(ruleClone.keyText=rule.keyText),rule.hasOwnProperty("selectorText")&&(ruleClone.selectorText=rule.selectorText),rule.hasOwnProperty("mediaText")&&(ruleClone.mediaText=rule.mediaText),rule.hasOwnProperty("supportsText")&&(ruleClone.supports=rule.supports),rule.hasOwnProperty("conditionText")&&(ruleClone.conditionText=rule.conditionText),rule.hasOwnProperty("layerName")&&(ruleClone.layerName=rule.layerName),rule.hasOwnProperty("href")&&(ruleClone.href=rule.href),
|
|
255
|
-
rule.hasOwnProperty("name")&&(ruleClone.name=rule.name),rule.hasOwnProperty("nameList")&&(ruleClone.nameList=rule.nameList),rule.hasOwnProperty("cssRules")&&(ruleClone.cssRules=clone(rule).cssRules)}return cloned};exports2.clone=CSSOM2.clone}});var require_lib=__commonJS({"node_modules/@acemir/cssom/lib/index.js"(exports2){"use strict";exports2.setup=require_CSSOM().setup;require_errorUtils();require_regexPatterns();exports2.CSSStyleDeclaration=require_CSSStyleDeclaration().CSSStyleDeclaration;require_cssstyleTryCatchBlock();exports2.CSSRule=require_CSSRule().CSSRule;exports2.CSSRuleList=require_CSSRuleList().CSSRuleList;exports2.CSSNestedDeclarations=require_CSSNestedDeclarations().CSSNestedDeclarations;exports2.CSSGroupingRule=require_CSSGroupingRule().
|
|
256
|
-
CSSGroupingRule;exports2.CSSCounterStyleRule=require_CSSCounterStyleRule().CSSCounterStyleRule;exports2.CSSPropertyRule=require_CSSPropertyRule().CSSPropertyRule;exports2.CSSConditionRule=require_CSSConditionRule().CSSConditionRule;exports2.CSSStyleRule=require_CSSStyleRule().CSSStyleRule;exports2.MediaList=require_MediaList().MediaList;exports2.CSSMediaRule=require_CSSMediaRule().CSSMediaRule;exports2.CSSContainerRule=require_CSSContainerRule().CSSContainerRule;exports2.CSSSupportsRule=require_CSSSupportsRule().
|
|
257
|
-
CSSSupportsRule;exports2.CSSImportRule=require_CSSImportRule().CSSImportRule;exports2.CSSNamespaceRule=require_CSSNamespaceRule().CSSNamespaceRule;exports2.CSSFontFaceRule=require_CSSFontFaceRule().CSSFontFaceRule;exports2.CSSHostRule=require_CSSHostRule().CSSHostRule;exports2.CSSStartingStyleRule=require_CSSStartingStyleRule().CSSStartingStyleRule;exports2.StyleSheet=require_StyleSheet().StyleSheet;exports2.CSSStyleSheet=require_CSSStyleSheet().CSSStyleSheet;exports2.CSSKeyframesRule=require_CSSKeyframesRule().
|
|
258
|
-
CSSKeyframesRule;exports2.CSSKeyframeRule=require_CSSKeyframeRule().CSSKeyframeRule;exports2.MatcherList=require_MatcherList().MatcherList;exports2.CSSDocumentRule=require_CSSDocumentRule().CSSDocumentRule;exports2.CSSValue=require_CSSValue().CSSValue;exports2.CSSValueExpression=require_CSSValueExpression().CSSValueExpression;exports2.CSSScopeRule=require_CSSScopeRule().CSSScopeRule;exports2.CSSLayerBlockRule=require_CSSLayerBlockRule().CSSLayerBlockRule;exports2.CSSLayerStatementRule=require_CSSLayerStatementRule().
|
|
259
|
-
CSSLayerStatementRule;exports2.CSSPageRule=require_CSSPageRule().CSSPageRule;exports2.parse=require_parse().parse;exports2.clone=require_clone().clone}});var require_canvas_shim=__commonJS({"node_modules/linkedom/commonjs/canvas-shim.cjs"(exports2,module2){var Canvas=class{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({"node_modules/linkedom/commonjs/canvas.cjs"(exports2,module2){try{module2.exports=__require("canvas")}catch{module2.exports=require_canvas_shim()}}});function trueFunc(){return!0}function falseFunc(){return!1}var init_dist=__esm({"node_modules/boolbase/dist/index.js"(){}});var SelectorType,AttributeAction,init_types=__esm({"node_modules/css-what/dist/types.js"(){(function(SelectorType2){SelectorType2.Attribute="attribute",SelectorType2.Pseudo="pseudo",SelectorType2.PseudoElement="pseudo-element",SelectorType2.Tag="tag",SelectorType2.Universal="universal",SelectorType2.Adjacent="adjacent",SelectorType2.Child="child",SelectorType2.Descendant="descendant",SelectorType2.Parent="parent",SelectorType2.Sibling="sibling",SelectorType2.ColumnCombinator="column-combinator"})(
|
|
260
|
-
SelectorType||(SelectorType={}));(function(AttributeAction2){AttributeAction2.Any="any",AttributeAction2.Element="element",AttributeAction2.End="end",AttributeAction2.Equals="equals",AttributeAction2.Exists="exists",AttributeAction2.Hyphen="hyphen",AttributeAction2.Not="not",AttributeAction2.Start="start"})(AttributeAction||(AttributeAction={}))}});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}}function funescape(_,escaped,escapedWhitespace){let high=Number.parseInt(escaped,16)-65536;return Number.isNaN(high)||escapedWhitespace?
|
|
261
|
-
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 isWhitespace(c){return c===CharCode.Space||c===CharCode.Tab||c===CharCode.NewLine||c===CharCode.FormFeed||c===CharCode.CarriageReturn}function parse(selector){let subselects2=[],endIndex=parseSelector(subselects2,`${selector}`,0);if(endIndex<
|
|
262
|
-
selector.length)throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);return subselects2}function parseSelector(subselects2,selector,selectorIndex){let tokens=[];function getName2(offset){let match=selector.slice(selectorIndex+offset).match(reName);if(!match)throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);let[name]=match;return selectorIndex+=offset+name.length,unescapeCSS(name)}function stripWhitespace(offset){for(selectorIndex+=offset;selectorIndex<selector.
|
|
263
|
-
length&&isWhitespace(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 new Error("Parent\
|
|
264
|
-
hesis not matched")}function ensureNotTraversal(){if(tokens.length>0&&isTraversal(tokens[tokens.length-1]))throw new 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:getName2(1),namespace:null,ignoreCase:"quirks"})}
|
|
265
|
-
function finalizeSubselector(){if(tokens.length>0&&tokens[tokens.length-1].type===SelectorType.Descendant&&tokens.pop(),tokens.length===0)throw new Error("Empty sub-selector");subselects2.push(tokens)}if(stripWhitespace(0),selector.length===selectorIndex)return selectorIndex;loop:for(;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:{(tokens.
|
|
266
|
-
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(
|
|
267
|
-
"class",AttributeAction.Element);break}case CharCode.Hash:{addSpecialAttribute("id",AttributeAction.Equals);break}case CharCode.LeftSquareBracket:{stripWhitespace(1);let name,namespace=null;selector.charCodeAt(selectorIndex)===CharCode.Pipe?name=getName2(1):selector.startsWith("*|",selectorIndex)?(namespace="*",name=getName2(2)):(name=getName2(0),selector.charCodeAt(selectorIndex)===CharCode.Pipe&&selector.charCodeAt(selectorIndex+1)!==CharCode.Equal&&(namespace=name,name=getName2(1))),stripWhitespace(
|
|
268
|
-
0);let action=AttributeAction.Exists,possibleAction=actionTypes.get(selector.charCodeAt(selectorIndex));if(possibleAction){if(action=possibleAction,selector.charCodeAt(selectorIndex+1)!==CharCode.Equal)throw new Error("Expected `=`");stripWhitespace(2)}else 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);
|
|
269
|
-
selectorIndex+=1;let sectionStart=selectorIndex;for(;selectorIndex<selector.length&&selector.charCodeAt(selectorIndex)!==quote;)selectorIndex+=selector.charCodeAt(selectorIndex)===CharCode.BackSlash?2:1;if(selector.charCodeAt(selectorIndex)!==quote)throw new Error("Attribute value didn't end");value=unescapeCSS(selector.slice(sectionStart,selectorIndex)),selectorIndex+=1}else{let valueStart=selectorIndex;for(;selectorIndex<selector.length&&!isWhitespace(selector.charCodeAt(selectorIndex))&&selector.
|
|
270
|
-
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 new Error("Attribute selector didn't terminat\
|
|
271
|
-
e");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:getName2(2).toLowerCase(),data:selector.charCodeAt(selectorIndex)===CharCode.LeftParenthesis?readValueWithParenthesis():null});break}let name=getName2(1).toLowerCase();if(pseudosToPseudoElements.has(name)){tokens.push({type:SelectorType.
|
|
272
|
-
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 new Error(`Pseudo-selector ${name} cannot be quoted`);if(data=[],selectorIndex=parseSelector(data,selector,selectorIndex+1),selector.charCodeAt(selectorIndex)!==CharCode.RightParenthesis)throw new Error(`Missing closing parenthesis in :${name} (${selector})`);selectorIndex+=1}else{if(data=readValueWithParenthesis(),
|
|
273
|
-
stripQuotesFromPseudos.has(name)){let quot=data.charCodeAt(0);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 new Error("Comment was not terminated");selectorIndex=endIndex+2,tokens.length===
|
|
274
|
-
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=getName2(0);else break loop;selector.charCodeAt(selectorIndex)===CharCode.Pipe&&selector.charCodeAt(selectorIndex+1)!==CharCode.Pipe&&(namespace=name,selector.charCodeAt(
|
|
275
|
-
selectorIndex+1)===CharCode.Asterisk?(name="*",selectorIndex+=2):name=getName2(1)),tokens.push(name==="*"?{type:SelectorType.Universal,namespace}:{type:SelectorType.Tag,name,namespace})}}}return finalizeSubselector(),selectorIndex}var reName,reEscape,CharCode,actionTypes,unpackPseudos,pseudosToPseudoElements,stripQuotesFromPseudos,init_parse=__esm({"node_modules/css-what/dist/parse.js"(){init_types();reName=/^[^#\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\u00B0-\uFFFF-])+/,reEscape=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;
|
|
276
|
-
(function(CharCode2){CharCode2[CharCode2.LeftParenthesis=40]="LeftParenthesis",CharCode2[CharCode2.RightParenthesis=41]="RightParenthesis",CharCode2[CharCode2.LeftSquareBracket=91]="LeftSquareBracket",CharCode2[CharCode2.RightSquareBracket=93]="RightSquareBracket",CharCode2[CharCode2.Comma=44]="Comma",CharCode2[CharCode2.Period=46]="Period",CharCode2[CharCode2.Colon=58]="Colon",CharCode2[CharCode2.SingleQuote=39]="SingleQuote",CharCode2[CharCode2.DoubleQuote=34]="DoubleQuote",CharCode2[CharCode2.
|
|
277
|
-
Plus=43]="Plus",CharCode2[CharCode2.Tilde=126]="Tilde",CharCode2[CharCode2.QuestionMark=63]="QuestionMark",CharCode2[CharCode2.ExclamationMark=33]="ExclamationMark",CharCode2[CharCode2.Slash=47]="Slash",CharCode2[CharCode2.Equal=61]="Equal",CharCode2[CharCode2.Dollar=36]="Dollar",CharCode2[CharCode2.Pipe=124]="Pipe",CharCode2[CharCode2.Circumflex=94]="Circumflex",CharCode2[CharCode2.Asterisk=42]="Asterisk",CharCode2[CharCode2.GreaterThan=62]="GreaterThan",CharCode2[CharCode2.LessThan=60]="LessTh\
|
|
278
|
-
an",CharCode2[CharCode2.Hash=35]="Hash",CharCode2[CharCode2.LowerI=105]="LowerI",CharCode2[CharCode2.LowerS=115]="LowerS",CharCode2[CharCode2.BackSlash=92]="BackSlash",CharCode2[CharCode2.Space=32]="Space",CharCode2[CharCode2.Tab=9]="Tab",CharCode2[CharCode2.NewLine=10]="NewLine",CharCode2[CharCode2.FormFeed=12]="FormFeed",CharCode2[CharCode2.CarriageReturn=13]="CarriageReturn"})(CharCode||(CharCode={}));actionTypes=new Map([[CharCode.Tilde,AttributeAction.Element],[CharCode.Circumflex,AttributeAction.
|
|
279
|
-
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"]);stripQuotesFromPseudos=new Set(["contains","icontains"])}});var init_dist2=__esm({"node_modules/css-what/dist/index.js"(){init_parse();init_types()}});function isTag(element){return element.type===ElementType.Tag||element.type===ElementType.Script||element.type===ElementType.Style}var ElementType,Root,Text,Directive,Comment,Script,Style,Tag,CDATA,Doctype,init_dist3=__esm({"node_modules/domelementtype/dist/index.js"(){(function(ElementType2){ElementType2.Root="root",ElementType2.Text="text",ElementType2.Directive="directive",ElementType2.Comment="comment",ElementType2.Script="script",ElementType2.Style="style",ElementType2.Tag="tag",ElementType2.
|
|
280
|
-
CDATA="cdata",ElementType2.Doctype="doctype"})(ElementType||(ElementType={}));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}});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 hasChildren(node){return Object.hasOwn(node,"children")}var init_node=__esm({"node_modules/domhandler/dist/node.js"(){init_dist3()}});var init_dist4=__esm({"node_modules/domhandler/dist/index.js"(){init_node()}});function filter(test,node,recurse=!0,limit=Number.POSITIVE_INFINITY){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 element=nodeStack[0][indexStack[0]++];if(test(element)&&(result.push(element),--limit<=0))return result;recurse&&hasChildren(
|
|
281
|
-
element)&&element.children.length>0&&(indexStack.unshift(0),nodeStack.unshift(element.children))}}function findOne(test,nodes,recurse=!0){let searchedNodes=Array.isArray(nodes)?nodes:[nodes];for(let node of searchedNodes){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)||
|
|
282
|
-
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 element=nodeStack[0][indexStack[0]++];isTag2(element)&&test(element)&&result.push(element),hasChildren(element)&&element.children.length>0&&(indexStack.unshift(0),nodeStack.unshift(element.children))}}var init_querying=__esm(
|
|
283
|
-
{"node_modules/domutils/dist/querying.js"(){init_dist4()}});function getAttribCheck(attrib,value){return typeof value=="function"?element=>isTag2(element)&&value(element.attribs[attrib]):element=>isTag2(element)&&element.attribs[attrib]===value}function combineFuncs(a,b){return element=>a(element)||b(element)}function compileTest(options){let funcs=Object.keys(options).map(key=>{let value=options[key];return Object.hasOwn(Checks,key)?Checks[key](value):getAttribCheck(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){
|
|
284
|
-
let test=compileTest(options);return test?test(node):!0}function getElements(options,nodes,recurse,limit=Number.POSITIVE_INFINITY){let test=compileTest(options);return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=!0){return Array.isArray(nodes)||(nodes=[nodes]),findOne(getAttribCheck("id",id),nodes,recurse)}function getElementsByTagName(tagName,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter(Checks.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName(className,nodes,recurse=!0,limit=Number.
|
|
285
|
-
POSITIVE_INFINITY){return filter(getAttribCheck("class",className),nodes,recurse,limit)}function getElementsByTagType(type,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter(Checks.tag_type(type),nodes,recurse,limit)}var Checks,init_legacy=__esm({"node_modules/domutils/dist/legacy.js"(){init_dist4();init_querying();Checks={tag_name(name){return typeof name=="function"?element=>isTag2(element)&&name(element.name):name==="*"?isTag2:element=>isTag2(element)&&element.name===name},tag_type(type){
|
|
286
|
-
return typeof type=="function"?element=>type(element.type):element=>element.type===type},tag_contains(data){return typeof data=="function"?element=>isText(element)&&data(element.data):element=>isText(element)&&element.data===data}}}});function getEscape(char){return char===34?""":char===38?"&":char===39?"'":char===60?"<":char===62?">":" "}function isXmlEscapable(code){return code>=128||code>=32&&code<64&&(XML_BITSET_VALUE>>>code&1)===1}function encodeXML(input){let{length}=input,out,last=0,index=0;for(;index<length;){let char=input.charCodeAt(index);if(!isXmlEscapable(char)){let bound=Math.min(index+32,length),next=index+1;for(;next<bound&&!isXmlEscapable(input.charCodeAt(next));)next++;if(next<bound){
|
|
287
|
-
index=next;continue}if(next>=length||(xmlEncodeRegex.lastIndex=next,!xmlEncodeRegex.test(input)))break;index=xmlEncodeRegex.lastIndex-1;continue}if(out===void 0?out=input.substring(0,index):last!==index&&(out+=input.substring(last,index)),char<64){out+=getEscape(char),last=index+=1;continue}let cp=input.codePointAt(index);out+=`&#x${cp.toString(16)};`,cp!==char&&index++,last=index+=1}return out===void 0?input:(last<length&&(out+=input.substr(last)),out)}function escapeWithRegex(re,data){if(re.lastIndex=
|
|
288
|
-
0,!re.test(data))return data;let out="",last=0;do{let index=re.lastIndex-1;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)}function escapeAttribute(data){return escapeWithRegex(attributeEscapeRegex,data)}function escapeText(data){return escapeWithRegex(textEscapeRegex,data)}var XML_BITSET_VALUE,xmlEncodeRegex,attributeEscapeRegex,textEscapeRegex,init_escape=__esm({"node_modules/\
|
|
289
|
-
entities/dist/escape.js"(){XML_BITSET_VALUE=1342177476,xmlEncodeRegex=/["&'<>\u0080-\uFFFF]/g;attributeEscapeRegex=/["&\u{A0}]/gu;textEscapeRegex=/[&<>\u{A0}]/gu}});var EntityLevel,EncodingMode,init_dist5=__esm({"node_modules/entities/dist/index.js"(){init_escape();(function(EntityLevel2){EntityLevel2[EntityLevel2.XML=0]="XML",EntityLevel2[EntityLevel2.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));(function(EncodingMode2){EncodingMode2[EncodingMode2.UTF8=0]="UTF8",EncodingMode2[EncodingMode2.ASCII=1]="ASCII",EncodingMode2[EncodingMode2.Extensive=2]="Extensive",EncodingMode2[EncodingMode2.Attribute=3]="Attribute",EncodingMode2[EncodingMode2.Text=4]="Text"})(
|
|
290
|
-
EncodingMode||(EncodingMode={}))}});var elementNames,attributeNames,init_foreign_names=__esm({"node_modules/dom-serializer/dist/foreign-names.js"(){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 feSpotL\
|
|
291
|
-
ight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map(name=>[name.toLowerCase(),name])),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 path\
|
|
292
|
-
Length 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]))}});function render(node,options={}){let nodes="length"in node?node:[node],xmlMode=options.xmlMode??!1,output="";for(let index=0;index<nodes.length;index++)output+=renderNode(nodes[index],options,xmlMode);return output}function renderChildren(children,options,xmlMode){let output="";for(let index=0;index<children.length;index++)output+=renderNode(children[index],options,xmlMode);return output}function renderNode(node,options,xmlMode){switch(node.type){case Root:return renderChildren(node.children,options,
|
|
293
|
-
xmlMode);case Directive:return`<${node.data}>`;case Comment:return`<!--${node.data}-->`;case CDATA:return`<![CDATA[${node.children[0].data}]]>`;case Script:case Style:case Tag:return renderTag(node,options,xmlMode);case Text:{let element=node,data=element.data||"";return(options.encodeEntities??options.decodeEntities)!==!1&&!(!xmlMode&&element.parent&&unencodedElements.has(element.parent.name))?xmlMode||options.encodeEntities!=="utf8"?encodeXML(data):escapeText(data):data}}}function renderTag(element,options,xmlMode){
|
|
294
|
-
xmlMode==="foreign"&&(element.name=elementNames.get(element.name)??element.name,element.parent&&foreignModeIntegrationPoints.has(element.parent.name)&&(xmlMode=!1)),!xmlMode&&foreignElements.has(element.name)&&(xmlMode="foreign");let{name,children}=element,isVoid=!xmlMode&&voidElements.has(name),tag=`<${name}${formatAttributes(element.attribs,options,xmlMode)}`;return children.length===0&&(xmlMode?options.selfClosingTags!==!1:options.selfClosingTags&&isVoid)?tag+=xmlMode?"/>":" />":(tag+=">",children.
|
|
295
|
-
length>0&&(tag+=renderChildren(children,options,xmlMode)),isVoid||(tag+=`</${name}>`)),tag}function replaceQuotes(value){return value.replaceAll('"',""")}function formatAttributes(attributes,options,xmlMode){if(!attributes)return"";let encode=(options.encodeEntities??options.decodeEntities)===!1?replaceQuotes:xmlMode||options.encodeEntities!=="utf8"?encodeXML:escapeAttribute,isForeign=xmlMode==="foreign",showEmpty=!!(options.emptyAttrs??xmlMode),result="";for(let key in attributes){if(!Object.
|
|
296
|
-
hasOwn(attributes,key))continue;let value=attributes[key],k=isForeign?attributeNames.get(key)??key:key;result+=!showEmpty&&(value==null||value==="")?` ${k}`:` ${k}="${encode(value==null?"":String(value))}"`}return result}var unencodedElements,voidElements,foreignElements,foreignModeIntegrationPoints,dist_default,init_dist6=__esm({"node_modules/dom-serializer/dist/index.js"(){init_dist3();init_dist5();init_foreign_names();unencodedElements=new Set("style script xmp iframe noembed noframes plainte\
|
|
297
|
-
xt noscript".split(" ")),voidElements=new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" ")),foreignElements=new Set(["svg","math"]),foreignModeIntegrationPoints=new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" "));dist_default=render}});function getOuterHTML(node,options){return dist_default(node,options)}function getInnerHTML(node,options){return hasChildren(node)?node.children.map(node2=>getOuterHTML(node2,options)).join(""):""}function getText(node){return Array.isArray(node)?node.map(getText).join(""):isTag2(node)?node.name==="br"?`
|
|
298
|
-
`:getText(node.children):isCDATA(node)?getText(node.children):isText(node)?node.data:""}function textContent(node){return Array.isArray(node)?node.map(textContent).join(""):hasChildren(node)&&!isComment(node)?textContent(node.children):isText(node)?node.data:""}function innerText(node){return Array.isArray(node)?node.map(innerText).join(""):hasChildren(node)&&(node.type===ElementType.Tag||isCDATA(node))?innerText(node.children):isText(node)?node.data:""}var init_stringify=__esm({"node_modules/do\
|
|
299
|
-
mutils/dist/stringify.js"(){init_dist6();init_dist3();init_dist4()}});function getFeed(document){let feedRoot=getOneElement(isValidFeed,document);return feedRoot?feedRoot.name==="feed"?getAtomFeed(feedRoot):getRssFeed(feedRoot):null}function getAtomFeed(feedRoot){let childs=feedRoot.children,feed={type:"atom",items:getElementsByTagName("entry",childs).map(item=>{let{children}=item,entry={media:getMediaElements(children)};addConditionally(entry,"id","id",children),addConditionally(entry,"title","title",children);let href2=getOneElement("link",children)?.attribs.href;
|
|
300
|
-
href2&&(entry.link=href2);let description=fetch("summary",children)||fetch("content",children);description&&(entry.description=description);let pubDate=fetch("updated",children);return pubDate&&(entry.pubDate=new Date(pubDate)),entry})};addConditionally(feed,"id","id",childs),addConditionally(feed,"title","title",childs);let href=getOneElement("link",childs)?.attribs.href;href&&(feed.link=href),addConditionally(feed,"description","subtitle",childs);let updated=fetch("updated",childs);return updated&&
|
|
301
|
-
(feed.updated=new Date(updated)),addConditionally(feed,"author","email",childs,!0),feed}function getRssFeed(feedRoot){let childs=getOneElement("channel",feedRoot.children)?.children??[],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(
|
|
302
|
-
entry,"description","description",children);let pubDate=fetch("pubDate",children)||fetch("dc:date",children);return pubDate&&(entry.pubDate=new Date(pubDate)),entry})};addConditionally(feed,"title","title",childs),addConditionally(feed,"link","link",childs),addConditionally(feed,"description","description",childs);let updated=fetch("lastBuildDate",childs);return updated&&(feed.updated=new Date(updated)),addConditionally(feed,"author","managingEditor",childs,!0),feed}function getMediaElements(where){
|
|
303
|
-
return getElementsByTagName("media:content",where).map(element=>{let{attribs}=element,media={medium:attribs.medium,isDefault:!!attribs.isDefault};for(let attrib of MEDIA_KEYS_STRING)attribs[attrib]&&(media[attrib]=attribs[attrib]);for(let attrib of MEDIA_KEYS_INT)attribs[attrib]&&(media[attrib]=Number.parseInt(attribs[attrib],10));return attribs.expression&&(media.expression=attribs.expression),media})}function getOneElement(tagName,node){return getElementsByTagName(tagName,node,!0,1)[0]}function fetch(tagName,where,recurse=!1){
|
|
304
|
-
return textContent(getElementsByTagName(tagName,where,recurse,1)).trim()}function addConditionally(object,property,tagName,where,recurse=!1){let value=fetch(tagName,where,recurse);value&&(object[property]=value)}function isValidFeed(value){return value==="rss"||value==="feed"||value==="rdf:RDF"}var MEDIA_KEYS_STRING,MEDIA_KEYS_INT,init_feeds=__esm({"node_modules/domutils/dist/feeds.js"(){init_legacy();init_stringify();MEDIA_KEYS_STRING=["url","type","lang"],MEDIA_KEYS_INT=["fileSize","bitrate","\
|
|
305
|
-
framerate","samplingrate","channels","duration","height","width"]}});function removeSubsets(nodes){let index=nodes.length;for(;--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}function compareDocumentPosition(nodeA,nodeB){let aParents=[],bParents=[];if(nodeA===nodeB)return 0;let current=hasChildren(nodeA)?nodeA:nodeA.parent;for(;current;)aParents.unshift(current),current=
|
|
306
|
-
current.parent;for(current=hasChildren(nodeB)?nodeB:nodeB.parent;current;)bParents.unshift(current),current=current.parent;let maxIndex=Math.min(aParents.length,bParents.length),index=0;for(;index<maxIndex&&aParents[index]===bParents[index];)index++;if(index===0)return DocumentPosition.DISCONNECTED;let sharedParent=aParents[index-1],siblings=sharedParent.children,aSibling=aParents[index],bSibling=bParents[index];return siblings.indexOf(aSibling)>siblings.indexOf(bSibling)?sharedParent===nodeB?DocumentPosition.
|
|
307
|
-
FOLLOWING|DocumentPosition.CONTAINED_BY:DocumentPosition.FOLLOWING:sharedParent===nodeA?DocumentPosition.PRECEDING|DocumentPosition.CONTAINS:DocumentPosition.PRECEDING}function uniqueSort(nodes){return nodes=nodes.filter((node,index,array)=>!array.includes(node,index+1)),nodes.sort((a,b)=>{let relative=compareDocumentPosition(a,b);return relative&DocumentPosition.PRECEDING?-1:relative&DocumentPosition.FOLLOWING?1:0}),nodes}var DocumentPosition,init_helpers=__esm({"node_modules/domutils/dist/help\
|
|
308
|
-
ers.js"(){init_dist4();(function(DocumentPosition2){DocumentPosition2[DocumentPosition2.DISCONNECTED=1]="DISCONNECTED",DocumentPosition2[DocumentPosition2.PRECEDING=2]="PRECEDING",DocumentPosition2[DocumentPosition2.FOLLOWING=4]="FOLLOWING",DocumentPosition2[DocumentPosition2.CONTAINS=8]="CONTAINS",DocumentPosition2[DocumentPosition2.CONTAINED_BY=16]="CONTAINED_BY"})(DocumentPosition||(DocumentPosition={}))}});function removeElement(element){if(element.prev&&(element.prev.next=element.next),element.next&&(element.next.prev=element.prev),element.parent){let childs=element.parent.children,childsIndex=childs.lastIndexOf(element);childsIndex!==-1&&childs.splice(childsIndex,1)}element.next=null,element.prev=null,element.parent=null}function replaceElement(element,replacement){if(replacement.prev=element.prev,replacement.prev&&(replacement.prev.next=replacement),replacement.next=element.next,replacement.next&&
|
|
309
|
-
(replacement.next.prev=replacement),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 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(element,next){
|
|
310
|
-
removeElement(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 parent&&parent.children.push(next)}function prependChild(parent,child){if(removeElement(child),child.parent=parent,child.prev=null,parent.children.unshift(child)===1)child.next=null;else{let sibling=parent.children[1];sibling.
|
|
311
|
-
prev=child,child.next=sibling}}function prepend(element,previous){removeElement(previous);let{parent}=element;if(parent){let childs=parent.children;childs.splice(childs.indexOf(element),0,previous)}element.prev&&(element.prev.next=previous),previous.parent=parent,previous.prev=element.prev,previous.next=element,element.prev=previous}var init_manipulation=__esm({"node_modules/domutils/dist/manipulation.js"(){}});function getChildren(element){return hasChildren(element)?element.children:[]}function getParent(element){return element.parent||null}function getSiblings(element){let parent=getParent(element);if(parent!=null)return getChildren(parent);let siblings=[element],{prev,next}=element;for(;prev!=null;)siblings.unshift(prev),{prev}=prev;for(;next!=null;)siblings.push(next),{next}=next;return siblings}function getAttributeValue(element,name){let{attribs}=element;return attribs?.[name]}function hasAttrib(element,name){
|
|
312
|
-
let{attribs}=element;return attribs!=null&&Object.hasOwn(attribs,name)&&attribs[name]!=null}function getName(element){return element.name}function nextElementSibling(element){let{next}=element;for(;next!==null&&!isTag2(next);)({next}=next);return next}function prevElementSibling(element){let{prev}=element;for(;prev!==null&&!isTag2(prev);)({prev}=prev);return prev}var init_traversal=__esm({"node_modules/domutils/dist/traversal.js"(){init_dist4()}});var dist_exports2={};__export(dist_exports2,{DocumentPosition:()=>DocumentPosition,append:()=>append,appendChild:()=>appendChild,compareDocumentPosition:()=>compareDocumentPosition,existsOne:()=>existsOne,filter:()=>filter,find:()=>find,findAll:()=>findAll,findOne:()=>findOne,getAttributeValue:()=>getAttributeValue,getChildren:()=>getChildren,getElementById:()=>getElementById,getElements:()=>getElements,getElementsByClassName:()=>getElementsByClassName,getElementsByTagName:()=>getElementsByTagName,
|
|
313
|
-
getElementsByTagType:()=>getElementsByTagType,getFeed:()=>getFeed,getInnerHTML:()=>getInnerHTML,getName:()=>getName,getOuterHTML:()=>getOuterHTML,getParent:()=>getParent,getSiblings:()=>getSiblings,getText:()=>getText,hasAttrib:()=>hasAttrib,innerText:()=>innerText,nextElementSibling:()=>nextElementSibling,prepend:()=>prepend,prependChild:()=>prependChild,prevElementSibling:()=>prevElementSibling,removeElement:()=>removeElement,removeSubsets:()=>removeSubsets,replaceElement:()=>replaceElement,testElement:()=>testElement,
|
|
314
|
-
textContent:()=>textContent,uniqueSort:()=>uniqueSort});var init_dist7=__esm({"node_modules/domutils/dist/index.js"(){init_feeds();init_helpers();init_legacy();init_manipulation();init_querying();init_stringify();init_traversal()}});function escapeRegex(value){return value.replace(reChars,"\\$&")}function shouldIgnoreCase(selector,options){return typeof selector.ignoreCase=="boolean"?selector.ignoreCase:selector.ignoreCase==="quirks"?!!options.quirksMode:!options.xmlMode&&caseInsensitiveAttributes.has(selector.name)}var reChars,whitespaceRe,caseInsensitiveAttributes,attributeRules,init_attributes=__esm({"node_modules/css-select/dist/attributes.js"(){init_dist();reChars=/[-[\]{}()*+?.,\\^$|#\s]/g,whitespaceRe=/\s/;caseInsensitiveAttributes=
|
|
315
|
-
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"]);attributeRules={equals(next,data,options){let{adapter}=options,
|
|
316
|
-
{name}=data,{value}=data;return shouldIgnoreCase(data,options)?(value=value.toLowerCase(),element=>{let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length===value.length&&attribute.toLowerCase()===value&&next(element)}):element=>adapter.getAttributeValue(element,name)===value&&next(element)},hyphen(next,data,options){let{adapter}=options,{name}=data,{value}=data,{length}=value;return shouldIgnoreCase(data,options)?(value=value.toLowerCase(),function(element){
|
|
317
|
-
let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&(attribute.length===length||attribute.charAt(length)==="-")&&attribute.substr(0,length).toLowerCase()===value&&next(element)}):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(
|
|
318
|
-
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;return length===0?falseFunc:shouldIgnoreCase(
|
|
319
|
-
data,options)?(value=value.toLowerCase(),element=>{let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length>=length&&attribute.substr(0,length).toLowerCase()===value&&next(element)}):element=>!!adapter.getAttributeValue(element,name)?.startsWith(value)&&next(element)},end(next,data,options){let{adapter}=options,{name}=data,{value}=data,length=-value.length;return length===0?falseFunc:shouldIgnoreCase(data,options)?(value=value.toLowerCase(),element=>adapter.
|
|
320
|
-
getAttributeValue(element,name)?.substr(length).toLowerCase()===value&&next(element)):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)&&
|
|
321
|
-
next(element)}}return element=>!!adapter.getAttributeValue(element,name)?.includes(value)&&next(element)},not(next,data,options){let{adapter}=options,{name}=data,{value}=data;return value===""?element=>!!adapter.getAttributeValue(element,name)&&next(element):shouldIgnoreCase(data,options)?(value=value.toLowerCase(),element=>{let attribute=adapter.getAttributeValue(element,name);return(attribute==null||attribute.length!==value.length||attribute.toLowerCase()!==value)&&next(element)}):element=>adapter.
|
|
322
|
-
getAttributeValue(element,name)!==value&&next(element)}}}});function findAll2(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)&&(query(element)&&result.push(element),xmlMode||adapter.getName(element)!=="template")){let children=adapter.getChildren(element);children.length>0&&(nodeStack.unshift(children),indexStack.
|
|
323
|
-
unshift(0))}}}function findOne2(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)){if(query(element))return element;if(xmlMode||adapter.getName(element)!=="template"){let children=adapter.getChildren(element);children.length>0&&(nodeStack.unshift(children),indexStack.
|
|
324
|
-
unshift(0))}}}}function getNextSiblings(element,adapter){let siblings=adapter.getSiblings(element);if(siblings.length<=1)return[];let elementIndex=siblings.indexOf(element);return elementIndex===-1||elementIndex===siblings.length-1?[]: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 init_querying2=__esm({"node_modules/css-select/dist/helpers/querying.js"(){}});var textControl,aliases,init_aliases=__esm({"node_modules/css-select/dist/pseudo-selectors/aliases.js"(){textControl="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])",aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
|
|
325
|
-
:is(button, input, select, textarea, optgroup, option)[disabled],
|
|
326
|
-
optgroup[disabled] > option,
|
|
327
|
-
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
328
|
-
)`,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, ${textControl})`,"read-write":`:not([readonly]):is(textarea, ${textControl})`,selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
|
|
329
|
-
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 init_compile=__esm({"node_modules/nth-check/dist/compile.js"(){init_dist()}});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"&&(index++,a=sign*(number??1),skipWhitespace(),index<formula.length?(sign=readSign(),skipWhitespace(),number=readNumber()):sign=number=0),number===null||index<formula.length)throw new Error(`n-th rule couldn't be parsed ('${formula}')`);return[a,sign*number];function readSign(){
|
|
330
|
-
switch(formula.charAt(index)){case"-":return index++,-1;case"+":{index++;break}}return 1}function readNumber(){let start=index,value=0;for(;index<formula.length&&formula.charCodeAt(index)>=ZERO&&formula.charCodeAt(index)<=NINE;)value=value*10+(formula.charCodeAt(index)-ZERO),index++;return index===start?null:value}function skipWhitespace(){for(;index<formula.length&&whitespace.has(formula.charCodeAt(index));)index++}}var whitespace,ZERO,NINE,init_parse2=__esm({"node_modules/nth-check/dist/parse.\
|
|
331
|
-
js"(){whitespace=new Set([9,10,12,13,32]),ZERO=48,NINE=57}});function nthCheck(formula){return compile(parse2(formula))}var init_dist8=__esm({"node_modules/nth-check/dist/index.js"(){init_compile();init_parse2()}});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(
|
|
332
|
-
element);node=parent}while(!resultCache.has(node));return resultCache.get(node)?addResultToCache(element):!1}}var init_cache=__esm({"node_modules/css-select/dist/helpers/cache.js"(){init_querying2()}});function copyOptions(options){let{context:_,rootFunc:__,...copied}=options;return copied}var init_options=__esm({"node_modules/css-select/dist/helpers/options.js"(){}});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]!=="*"){for(;tagIndex<tag.length&&tag[tagIndex]!==range[rangeIndex];)if(tag[tagIndex++].length<=1)return!1;if(tagIndex>=tag.length)return!1;tagIndex++}return!0}function compileNth(reverse,ofType){return function(next,rule,options,context2,compileToken2){let{adapter,equals}=options,ofMatch=ofType?null:rule.match(nthOfRegex),nthCheck2=nthCheck(
|
|
333
|
-
ofMatch?ofMatch[1].trim():rule);if(nthCheck2===falseFunc)return falseFunc;let ofSelector=ofMatch&&compileToken2?compileToken2(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;return reverse?
|
|
334
|
-
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;adapter.isTag(sibling)&&shouldCount(element,sibling)&&pos++}return nthCheck2(pos)&&next(element)}: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;adapter.
|
|
335
|
-
isTag(sibling)&&shouldCount(element,sibling)&&pos++}return nthCheck2(pos)&&next(element)}}}function dynamicStatePseudo(name){return function(next,_rule,{adapter}){let filterFunction=adapter[name];return typeof filterFunction!="function"?falseFunc:function(element){return filterFunction(element)&&next(element)}}}var nthOfRegex,filters,init_filters=__esm({"node_modules/css-select/dist/pseudo-selectors/filters.js"(){init_dist();init_dist2();init_dist8();init_cache();init_options();init_querying2();
|
|
336
|
-
nthOfRegex=/^(.+?)\s+of\s+(.+)$/is;filters={contains(next,text,options){let{getText:getText2}=options.adapter;return cacheParentResults(next,options,element=>getText2(element).includes(text))},icontains(next,text,options){let itext=text.toLowerCase(),{getText:getText2}=options.adapter;return cacheParentResults(next,options,element=>getText2(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(
|
|
337
|
-
!0,!0),root(next,_rule,{adapter}){return element=>getElementParent(element,adapter)===null&&next(element)},scope(next,rule,options,context2){let{equals}=options;return!context2||context2.length===0?filters.root(next,rule,options):context2.length===1?element=>equals(context2[0],element)&&next(element):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(
|
|
338
|
-
"-"));return function(element){let node=element;for(;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("isHo\
|
|
339
|
-
vered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")}}});function verifyPseudoArguments(pseudoClassCondition,name,subselect,argumentIndex){if(subselect===null){if(pseudoClassCondition.length>argumentIndex)throw new Error(`Pseudo-class :${name} requires an argument`)}else if(pseudoClassCondition.length===argumentIndex)throw new Error(`Pseudo-class :${name} doesn't have any arguments`)}var isDocumentWhiteSpace,pseudos,init_pseudos=__esm({"node_modules/css-select/dist/pseudo-selectors/pseudos.js"(){isDocumentWhiteSpace=/^[ \t\r\n]*$/,pseudos={empty(element,{
|
|
340
|
-
adapter}){let children=adapter.getChildren(element);return children.every(element2=>!adapter.isTag(element2))&&children.every(element2=>isDocumentWhiteSpace.test(adapter.getText(element2)))},"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.
|
|
341
|
-
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}){
|
|
342
|
-
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(
|
|
343
|
-
sibling)!==elementName)},"only-child"(element,{adapter,equals}){return adapter.getSiblings(element).every(sibling=>equals(element,sibling)||!adapter.isTag(sibling))}}}});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))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}}}
|
|
344
|
-
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.
|
|
345
|
-
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 init_selectors=__esm(
|
|
346
|
-
{"node_modules/css-select/dist/helpers/selectors.js"(){init_dist2()}});function hasDependsOnCurrentElement(selector){return selector.some(sel=>sel.length>0&&(isTraversal2(sel[0])||sel.some(includesScopePseudo)))}var PLACEHOLDER_ELEMENT,is,subselects,init_subselects=__esm({"node_modules/css-select/dist/pseudo-selectors/subselects.js"(){init_dist();init_cache();init_options();init_querying2();init_selectors();PLACEHOLDER_ELEMENT={};is=(next,token,options,context2,compileToken2)=>{let compiledToken=compileToken2(token,copyOptions(options),context2);return compiledToken===
|
|
347
|
-
trueFunc?next:compiledToken===falseFunc?falseFunc:element=>compiledToken(element)&&next(element)},subselects={is,matches:is,where:is,not(next,token,options,context2,compileToken2){let compiledToken=compileToken2(token,copyOptions(options),context2);return compiledToken===falseFunc?next:compiledToken===trueFunc?falseFunc:element=>!compiledToken(element)&&next(element)},has(next,subselect,options,_context,compileToken2){let{adapter}=options,copiedOptions=copyOptions(options);copiedOptions.relativeSelector=
|
|
348
|
-
!0;let context2=subselect.some(s=>s.some(isTraversal2))?[PLACEHOLDER_ELEMENT]:void 0,skipCache=hasDependsOnCurrentElement(subselect),compiled=compileToken2(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 findOne2(compiled,compiled.shouldTestNextSiblings?[...childs,...getNextSiblings(element,adapter)]:childs,options)!==
|
|
349
|
-
null}:cacheParentResults(next,options,element=>(context2[0]=element,findOne2(compiled,adapter.getChildren(element),options)!==null));let hasOne=element=>findOne2(compiled,adapter.getChildren(element),options)!==null;return skipCache?element=>next(element)&&hasOne(element):cacheParentResults(next,options,hasOne)}}}});function compilePseudoSelector(next,selector,options,context2,compileToken2){let{name,data}=selector;if(Array.isArray(data)){if(!(name in subselects))throw new Error(`Unknown pseudo-class :${name}(${data})`);return subselects[name](next,data,options,context2,compileToken2)}let userPseudo=options.pseudos?.[name],stringPseudo=typeof userPseudo=="string"?userPseudo:aliases[name];if(typeof stringPseudo=="string"){if(data!=null)throw new Error(`Pseudo ${name} doesn't have any arguments`);let alias=parse(
|
|
350
|
-
stringPseudo);return subselects.is(next,alias,options,context2,compileToken2)}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,compileToken2);if(name in pseudos){let pseudo=pseudos[name];return verifyPseudoArguments(pseudo,name,data,2),element=>pseudo(element,options,data)&&next(element)}throw new Error(`Unknown pseudo-class :${name}`)}var init_pseudo_selectors=__esm(
|
|
351
|
-
{"node_modules/css-select/dist/pseudo-selectors/index.js"(){init_dist2();init_aliases();init_filters();init_pseudos();init_subselects()}});function compileGeneralSelector(next,selector,options,context2,compileToken2,hasExpensiveSubselector){let{adapter,equals,cacheResults}=options;switch(selector.type){case SelectorType.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case SelectorType.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case SelectorType.Attribute:{if(selector.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-se\
|
|
352
|
-
lect");return(!options.xmlMode||options.lowerCaseAttributeNames)&&(selector.name=selector.name.toLowerCase()),attributeRules[selector.action](next,selector,options)}case SelectorType.Pseudo:return compilePseudoSelector(next,selector,options,context2,compileToken2);case SelectorType.Tag:{if(selector.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name}=selector;return(!options.xmlMode||options.lowerCaseTags)&&(name=name.toLowerCase()),function(element){
|
|
353
|
-
return adapter.getName(element)===name&&next(element)}}case SelectorType.Descendant:{if(!hasExpensiveSubselector||cacheResults===!1||typeof WeakMap>"u")return function(element){let current=element;for(;current=getElementParent(current,adapter);)if(next(current))return!0;return!1};let resultCache=new WeakMap;return function(element){let current=element,result;for(;current=getElementParent(current,adapter);){let cached=resultCache.get(current);if(cached===void 0){if(result??={matches:!1},result.matches=
|
|
354
|
-
next(current),resultCache.set(current,result),result.matches)return!0}else return result&&(result.matches=cached.matches),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(element2=>adapter.isTag(element2)&&next(element2))};case SelectorType.Child:return function(element){
|
|
355
|
-
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:return adapter.prevElementSibling?function(element){let previous=adapter.prevElementSibling(element);return previous!=null&&next(previous)}:function(element){
|
|
356
|
-
let siblings=adapter.getSiblings(element),lastElement;for(let currentSibling of siblings){if(equals(element,currentSibling))break;adapter.isTag(currentSibling)&&(lastElement=currentSibling)}return!!lastElement&&next(lastElement)};case SelectorType.Universal:{if(selector.namespace!=null&&selector.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return next}}}var init_general=__esm({"node_modules/css-select/dist/general.js"(){init_dist2();init_attributes();
|
|
357
|
-
init_querying2();init_pseudo_selectors()}});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))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,
|
|
358
|
-
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 new 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;
|
|
359
|
-
first.type!==SelectorType.Pseudo||first.name!=="scope"||(isArrayContext&&second.type===SelectorType.Descendant?rules[1]=FLEXIBLE_DESCENDANT_TOKEN:(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),next===falseFunc)continue combineLoop;
|
|
360
|
-
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 DESCENDANT_TOKEN,FLEXIBLE_DESCENDANT_TOKEN,SCOPE_TOKEN,init_compile2=__esm({"node_modules/css-select/dist/compile.js"(){init_dist();init_dist2();init_general();init_querying2();init_selectors();init_subselects();DESCENDANT_TOKEN={type:SelectorType.Descendant},FLEXIBLE_DESCENDANT_TOKEN={type:"\
|
|
361
|
-
_flexibleDescendant"},SCOPE_TOKEN={type:SelectorType.Pseudo,name:"scope",data:null}}});var dist_exports4={};__export(dist_exports4,{_compileUnsafe:()=>_compileUnsafe,compile:()=>compile2,default:()=>dist_default2,is:()=>is2,prepareContext:()=>prepareContext,selectAll:()=>selectAll,selectOne:()=>selectOne});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(
|
|
362
|
-
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);typeof query!="function"&&(query=_compileUnsafe(
|
|
363
|
-
query,convertedOptions,elements));let filteredElements=prepareContext(elements,convertedOptions.adapter,query.shouldTestNextSiblings);return searchFunction(query,filteredElements,convertedOptions)}}function prepareContext(elements,adapter,shouldTestNextSiblings=!1){return shouldTestNextSiblings&&(elements=appendNextSiblings(elements,adapter)),Array.isArray(elements)?adapter.removeSubsets(elements):adapter.getChildren(elements)}function appendNextSiblings(element,adapter){let elements=Array.isArray(
|
|
364
|
-
element)?[...element]:[element],elementsLength=elements.length;for(let index=0;index<elementsLength;index++){let nextSiblings=getNextSiblings(elements[index],adapter);elements.push(...nextSiblings)}return elements}function is2(element,query,options){return(typeof query=="function"?query:compile2(query,options))(element)}var defaultEquals,defaultOptions,selectAll,selectOne,dist_default2,init_dist9=__esm({"node_modules/css-select/dist/index.js"(){init_dist();init_dist2();init_dist4();init_dist7();
|
|
365
|
-
init_compile2();init_querying2();defaultEquals=(a,b)=>a===b,defaultOptions={adapter:{...dist_exports2,isTag:isTag2},equals:defaultEquals};selectAll=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?[]:findAll2(query,elements,options)),selectOne=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?null:findOne2(query,elements,options));dist_default2=selectAll}});export{compile2 as compile,is2 as is,dist_exports4 as dist_exports,init_dist9 as init_dist,require_lib,require_canvas};
|