@birdapi/velinstyle 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +87 -162
- package/README.md +188 -119
- package/cli/blueprint.js +98 -5
- package/cli/blueprints/app-chrome.html +18 -0
- package/cli/blueprints/benefits-grid.html +9 -0
- package/cli/blueprints/bottom-nav-mobile.html +2 -1
- package/cli/blueprints/cookie-consent.html +1 -1
- package/cli/blueprints/cta-band.html +6 -0
- package/cli/blueprints/faq-section.html +18 -0
- package/cli/blueprints/filter-bar.html +4 -4
- package/cli/blueprints/form-contact.html +6 -5
- package/cli/blueprints/hero-section.html +3 -3
- package/cli/blueprints/notification-center.html +1 -1
- package/cli/blueprints/onboarding.html +2 -1
- package/cli/blueprints/ops-console.html +29 -0
- package/cli/blueprints/pricing-band.html +37 -0
- package/cli/blueprints/process-steps.html +10 -0
- package/cli/blueprints/services-grid.html +9 -0
- package/cli/blueprints/settings-panel.html +8 -6
- package/cli/blueprints/split-hero.html +25 -0
- package/cli/blueprints/testimonials.html +8 -0
- package/cli/blueprints/trust-bar.html +10 -0
- package/cli/cli-manifest.json +81 -17
- package/cli/contrast-utils.js +97 -0
- package/cli/create.js +370 -0
- package/cli/docgen/extract-attributes.js +126 -10
- package/cli/docgen/extract-cli.js +3 -2
- package/cli/docgen/extract-components.js +61 -2
- package/cli/docgen/extract-utilities.js +10 -10
- package/cli/doctor.js +119 -0
- package/cli/index.js +531 -44
- package/cli/meta.js +84 -1
- package/cli/perf-audit.js +15 -2
- package/cli/prompt-engine.js +243 -0
- package/cli/review.js +268 -0
- package/cli/scaffold.js +119 -4
- package/cli/scanner-rules-data.js +7 -0
- package/cli/scanner.js +357 -4
- package/cli/serve.js +81 -0
- package/cli/skills.js +223 -0
- package/cli/wc-api.js +89 -0
- package/cli/workflow.js +42 -0
- package/components/index.js +2 -0
- package/components/runtime/component-loaders.js +2 -0
- package/components/velin-accordion.js +62 -13
- package/components/velin-bottom-nav.js +10 -0
- package/components/velin-calendar.js +212 -0
- package/components/velin-command.js +18 -2
- package/components/velin-data-table.js +78 -1
- package/components/velin-dialog.js +4 -1
- package/components/velin-drawer.js +2 -4
- package/components/velin-file-dropzone.js +162 -0
- package/components/velin-icon.js +22 -1
- package/components/velin-lightbox.js +5 -3
- package/components/velin-modal.js +2 -4
- package/components/velin-search.js +1 -1
- package/components/velin-sheet.js +2 -4
- package/core/a11y/component-contracts.json +20 -3
- package/core/meta/build.js +125 -5
- package/core/meta/design-constraints/contact.json +9 -0
- package/core/meta/design-constraints/faq.json +9 -0
- package/core/meta/design-constraints/hero.json +13 -0
- package/core/meta/knowledge/components.json +622 -0
- package/core/meta/knowledge/tokens.json +282 -0
- package/core/meta/pages/registry.json +294 -0
- package/core/meta/schema.js +3 -1
- package/core/meta/sections/registry.json +185 -0
- package/dist/chunks/{attributes-STYCS3O5.js → attributes-A423NX5J.js} +3 -3
- package/dist/chunks/{attributes-353XDOAX.js → attributes-F6UPIEVP.js} +1 -1
- package/dist/chunks/{attributes-ADOKLKA7.js → attributes-GLYXGGAL.js} +3 -3
- package/dist/chunks/{attributes-TPANLMLF.js → attributes-UFTYOSAU.js} +3 -3
- package/dist/chunks/attributes-XGLXLR2T.js +391 -0
- package/dist/chunks/attributes-YF4NI2QS.js +391 -0
- package/dist/chunks/browser-AUABBYUK.js +1544 -0
- package/dist/chunks/{chunk-RSMRR27R.js → chunk-2LSKX57P.js} +12 -10
- package/dist/chunks/{chunk-IEHKRARD.js → chunk-2TGCVDUL.js} +11 -9
- package/dist/chunks/{chunk-SRL6EWHP.js → chunk-5JWGUAPC.js} +17 -13
- package/dist/chunks/chunk-7YSO2OQ2.js +113 -0
- package/dist/chunks/{chunk-QVHYL3R4.js → chunk-BHR3ZG6U.js} +6 -6
- package/dist/chunks/{chunk-J472ERN2.js → chunk-JMSIHEYX.js} +15 -4
- package/dist/chunks/{chunk-MKZP2TBH.js → chunk-L7ZGUU4D.js} +2 -2
- package/dist/chunks/chunk-TUGIPKW5.js +113 -0
- package/dist/chunks/{highlight-GJHHV4KM.js → highlight-M2ELQNYK.js} +1 -1
- package/dist/chunks/runtime-entry.js +1 -1
- package/dist/chunks/{velin-accordion-FBIPAEXG.js → velin-accordion-WSY6BMLA.js} +64 -10
- package/dist/chunks/{velin-bottom-nav-7GEMPIM6.js → velin-bottom-nav-5RVRNGIP.js} +25 -0
- package/dist/chunks/{velin-bottom-nav-N3DFQR66.js → velin-bottom-nav-N5F4UO2I.js} +26 -1
- package/dist/chunks/velin-calendar-OFE6THUD.js +210 -0
- package/dist/chunks/velin-calendar-PGVNJTXK.js +217 -0
- package/dist/chunks/velin-calendar-XC7JRDSH.js +217 -0
- package/dist/chunks/{velin-code-block-CIAURDRJ.js → velin-code-block-ZGWG7JI5.js} +1 -1
- package/dist/chunks/{velin-combobox-NXS4QB4R.js → velin-combobox-56V2ZWT5.js} +1 -1
- package/dist/chunks/{velin-command-ONKO2A3J.js → velin-command-2HO2EKR6.js} +29 -2
- package/dist/chunks/{velin-command-TMLSRGIU.js → velin-command-ZJSLPK7B.js} +30 -3
- package/dist/chunks/{velin-copy-NYDBOKXT.js → velin-copy-XDQSV2XU.js} +1 -1
- package/dist/chunks/{velin-countdown-4ZVDGK4R.js → velin-countdown-V4Z5MA63.js} +1 -1
- package/dist/chunks/velin-data-table-UVR42UUM.js +372 -0
- package/dist/chunks/{velin-dialog-GTTZI564.js → velin-dialog-3YK2RPRV.js} +9 -2
- package/dist/chunks/{velin-dialog-ELFOZIXZ.js → velin-dialog-S24KAP4S.js} +3 -1
- package/dist/chunks/{velin-drawer-BE6TYN3H.js → velin-drawer-5PNU624J.js} +2 -4
- package/dist/chunks/{velin-drawer-DLL2GLT6.js → velin-drawer-CCM6S25D.js} +3 -5
- package/dist/chunks/{velin-email-RBX6ZR4S.js → velin-email-TNFONXPW.js} +1 -1
- package/dist/chunks/velin-file-dropzone-QRGF2JNA.js +154 -0
- package/dist/chunks/velin-file-dropzone-XIZMJ3NB.js +154 -0
- package/dist/chunks/{velin-icon-7M76DOPB.js → velin-icon-A6NCXGUK.js} +59 -17
- package/dist/chunks/{velin-icon-ZTSKUOVN.js → velin-icon-EC4B5XCM.js} +18 -5
- package/dist/chunks/{velin-lightbox-6E7CAATP.js → velin-lightbox-FFK4TUUP.js} +7 -6
- package/dist/chunks/{velin-lightbox-NXA3U2FM.js → velin-lightbox-P725FLTY.js} +5 -4
- package/dist/chunks/{velin-menubar-J66JXRWW.js → velin-menubar-6I2LM5HL.js} +1 -1
- package/dist/chunks/{velin-modal-5HYNNNUI.js → velin-modal-ICTMGRSU.js} +7 -8
- package/dist/chunks/{velin-modal-AEOTZ67O.js → velin-modal-JBNODH7D.js} +2 -4
- package/dist/chunks/{velin-popover-T72HK3DF.js → velin-popover-WZG2GHBL.js} +25 -4
- package/dist/chunks/{velin-rating-N4DI2XNL.js → velin-rating-QBBYRRBU.js} +1 -1
- package/dist/chunks/{velin-search-7B4KJ6TX.js → velin-search-B3L6J2RP.js} +2 -2
- package/dist/chunks/{velin-search-2XRQFBCS.js → velin-search-L3UG6NDQ.js} +5 -4
- package/dist/chunks/{velin-secure-field-6PV7RZDJ.js → velin-secure-field-DGYMP7OK.js} +1 -1
- package/dist/chunks/{velin-segmented-control-GYD5BIXQ.js → velin-segmented-control-P74GJPAR.js} +1 -1
- package/dist/chunks/{velin-sheet-R2Y67X6H.js → velin-sheet-M5GZZD7G.js} +2 -4
- package/dist/chunks/{velin-sheet-OUK6572T.js → velin-sheet-X7RXIWKV.js} +3 -5
- package/dist/chunks/{velin-stepper-X54WGHDG.js → velin-stepper-4YQJUHPC.js} +12 -5
- package/dist/chunks/{velin-toast-OMMOA2DK.js → velin-toast-UG5LWTG2.js} +5 -1
- package/dist/chunks/{velin-tooltip-BDHGRTQB.js → velin-tooltip-ZDH5SDLU.js} +1 -1
- package/dist/llms.txt +29 -7
- package/dist/search-index.json +156 -10
- package/dist/velin-agent.json +3973 -28
- package/dist/velinstyle-components.iife.js +1211 -284
- package/dist/velinstyle-components.js +1213 -284
- package/dist/velinstyle-components.min.js +266 -118
- package/dist/velinstyle.css +252 -67
- package/dist/velinstyle.d.ts +2 -0
- package/dist/velinstyle.min.css +1 -1
- package/package.json +20 -6
- package/packages/skill-engine/README.md +24 -0
- package/packages/skill-engine/package.json +7 -0
- package/packages/skill-engine/src/catalog.js +29 -0
- package/packages/skill-engine/src/index.js +5 -0
- package/packages/skill-engine/src/install.js +69 -0
- package/packages/skill-engine/src/registry.js +27 -0
- package/packages/skill-engine/src/resolve.js +68 -0
- package/packages/skill-engine/src/validate.js +40 -0
- package/packages/velinstyle-skills/README.md +6 -0
- package/packages/velinstyle-skills/adapter.json +8 -0
- package/packages/velinstyle-skills/bundles/landing-starter.bundle.yaml +12 -0
- package/packages/velinstyle-skills/bundles/review-suite.bundle.yaml +11 -0
- package/packages/velinstyle-skills/catalog.json +1004 -0
- package/packages/velinstyle-skills/graphs/component-ship.graph.yaml +14 -0
- package/packages/velinstyle-skills/graphs/landingpage.graph.yaml +21 -0
- package/packages/velinstyle-skills/graphs/release-gate.graph.yaml +15 -0
- package/packages/velinstyle-skills/index.js +22 -0
- package/packages/velinstyle-skills/package.json +7 -0
- package/packages/velinstyle-skills/packs/accessibility.pack.yaml +9 -0
- package/packages/velinstyle-skills/packs/design.pack.yaml +10 -0
- package/packages/velinstyle-skills/packs/documentation.pack.yaml +8 -0
- package/packages/velinstyle-skills/packs/enterprise.pack.yaml +10 -0
- package/packages/velinstyle-skills/packs/frontend.pack.yaml +10 -0
- package/packages/velinstyle-skills/packs/review.pack.yaml +9 -0
- package/packages/velinstyle-skills/projects/admin-panel.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/blog.project.yaml +11 -0
- package/packages/velinstyle-skills/projects/documentation-portal.project.yaml +13 -0
- package/packages/velinstyle-skills/projects/ecommerce-shop.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/landing-page.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/laravel-dashboard.project.yaml +12 -0
- package/packages/velinstyle-skills/projects/marketing-website.project.yaml +14 -0
- package/packages/velinstyle-skills/projects/portfolio.project.yaml +12 -0
- package/packages/velinstyle-skills/registry.json +142 -0
- package/packages/velinstyle-skills/scripts/generate-assets.mjs +163 -0
- package/packages/velinstyle-skills/skills/velin-a11y-focus-keyboard/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-a11y-page-checklist/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-a11y-scan-fix/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-ai-agent-briefing/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-ai-plan-scaffold-review/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-ai-skill-authoring/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-accessibility-map/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-api-contract/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-recipe/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-components-select-compose/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-design-hero-compose/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-design-section-rhythm/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-design-surface-roles/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dev-component-wire/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dev-page-scaffold/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dev-plan-first/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-docs-component-guide/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-docs-generate-api/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dx-doctor-setup/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-dx-project-init/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-migration-legacy-wc/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-migration-prefix-classes/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-perf-audit-fix/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-perf-runtime-tree-shake/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-release-changelog-sync/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-release-meta-rebuild/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-review-conversion-hero/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-review-page-gate/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-review-seo-meta/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-security-sanitize-html/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-security-scan-pii/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-testing-a11y-suite/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-testing-visual-smoke/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-themes-apply-token/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-themes-contrast-check/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-utilities-layout-apply/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-utilities-prefix-fix/SKILL.md +57 -0
- package/packages/velinstyle-skills/skills/velin-utilities-token-map/SKILL.md +57 -0
- package/packages/velinstyle-skills/templates/admin-panel.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/blog.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/documentation-portal.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/ecommerce-shop.template.yaml +13 -0
- package/packages/velinstyle-skills/templates/landing-page.template.yaml +12 -0
- package/packages/velinstyle-skills/templates/laravel-dashboard.template.yaml +11 -0
- package/packages/velinstyle-skills/templates/marketing-website.template.yaml +13 -0
- package/packages/velinstyle-skills/templates/portfolio.template.yaml +12 -0
- package/schemas/component-knowledge.schema.json +33 -0
- package/schemas/design-constraint.schema.json +15 -0
- package/schemas/design-intelligence.schema.json +19 -0
- package/schemas/design-rule.schema.json +19 -0
- package/schemas/page-template.schema.json +24 -0
- package/schemas/review-report.schema.json +36 -0
- package/schemas/section.schema.json +22 -0
- package/schemas/skill-bundle.schema.json +15 -0
- package/schemas/skill-graph.schema.json +25 -0
- package/schemas/skill-pack.schema.json +14 -0
- package/schemas/skill-project.schema.json +16 -0
- package/schemas/skill-record.schema.json +27 -0
- package/schemas/skill-registry.schema.json +17 -0
- package/schemas/skill-template.schema.json +17 -0
- package/schemas/token-graph.schema.json +27 -0
- package/schemas/utility.schema.json +166 -0
- package/src/components/alert.css +22 -1
- package/src/components/calendar-dropzone.css +5 -0
- package/src/layout/app-shell.css +33 -0
- package/src/tokens/shadow.css +13 -0
- package/src/utilities/border.css +2 -0
- package/src/utilities/display.css +1 -24
- package/src/utilities/responsive.css +16 -1
- package/src/utilities/spacing.css +32 -0
- package/src/velinstyle.css +2 -0
- package/dist/chunks/attributes-3BZLI7XF.js +0 -364
- package/dist/chunks/attributes-4N5JP4CG.js +0 -364
- package/dist/chunks/attributes-5Q2WXGRC.js +0 -374
- package/dist/chunks/attributes-AIR7SVLK.js +0 -364
- package/dist/chunks/attributes-BGRN5XZO.js +0 -364
- package/dist/chunks/attributes-BVSQAYLR.js +0 -364
- package/dist/chunks/attributes-CDYFUY7Y.js +0 -364
- package/dist/chunks/attributes-JMYJZBPE.js +0 -364
- package/dist/chunks/attributes-R5JY3X4O.js +0 -374
- package/dist/chunks/attributes-TNSPQTHX.js +0 -374
- package/dist/chunks/chunk-2354NEBP.js +0 -109
- package/dist/chunks/chunk-2VNA7G7S.js +0 -109
- package/dist/chunks/chunk-AQLRJSGG.js +0 -109
- package/dist/chunks/chunk-EWPSDMQT.js +0 -109
- package/dist/chunks/chunk-LA7264K4.js +0 -85
- package/dist/chunks/chunk-QTJJ3DPO.js +0 -109
- package/dist/chunks/chunk-RZQVWFHW.js +0 -109
- package/dist/chunks/chunk-U4XHMZ7D.js +0 -109
- package/dist/chunks/chunk-V5YIUA6G.js +0 -109
- package/dist/chunks/chunk-XIET2VSZ.js +0 -109
- package/dist/chunks/chunk-XYLJ2GCB.js +0 -205
- package/dist/chunks/chunk-ZPSPKUYD.js +0 -109
- package/dist/chunks/highlight-XTHRKBA3.js +0 -37
- package/dist/chunks/velin-bottom-nav-2N2TYWOF.js +0 -86
- package/dist/chunks/velin-carousel-Y5VCOABZ.js +0 -213
- package/dist/chunks/velin-code-block-ASUBTAQV.js +0 -119
- package/dist/chunks/velin-code-block-TSUKPY4C.js +0 -123
- package/dist/chunks/velin-code-block-Y6CM726Q.js +0 -119
- package/dist/chunks/velin-combobox-2KDTCQ7N.js +0 -155
- package/dist/chunks/velin-command-M7RNHUPR.js +0 -136
- package/dist/chunks/velin-copy-T5KDTDXP.js +0 -81
- package/dist/chunks/velin-countdown-5XSTN3BH.js +0 -101
- package/dist/chunks/velin-counter-ISCTEAHI.js +0 -118
- package/dist/chunks/velin-dialog-D2GUHSCD.js +0 -144
- package/dist/chunks/velin-dialog-IJLFDXAJ.js +0 -144
- package/dist/chunks/velin-dialog-TNS3WXMB.js +0 -144
- package/dist/chunks/velin-drawer-MJS6WCF7.js +0 -130
- package/dist/chunks/velin-email-N5B5ZYTE.js +0 -90
- package/dist/chunks/velin-icon-KZO3IEHG.js +0 -164
- package/dist/chunks/velin-lightbox-I75U6JF4.js +0 -140
- package/dist/chunks/velin-lightbox-QOTB4PRL.js +0 -140
- package/dist/chunks/velin-lightbox-UCD6N7HF.js +0 -140
- package/dist/chunks/velin-live-dot-XHUZCIDZ.js +0 -67
- package/dist/chunks/velin-menubar-SFEXJE56.js +0 -86
- package/dist/chunks/velin-modal-2HOBXE6F.js +0 -176
- package/dist/chunks/velin-modal-GLI2XZZB.js +0 -176
- package/dist/chunks/velin-popover-EXINRIGJ.js +0 -145
- package/dist/chunks/velin-popover-OXX7MRZ6.js +0 -145
- package/dist/chunks/velin-popover-YKCCROJG.js +0 -145
- package/dist/chunks/velin-rating-XRQJV4LO.js +0 -91
- package/dist/chunks/velin-scroll-top-F2FCZNYD.js +0 -58
- package/dist/chunks/velin-search-4YHJWYSS.js +0 -556
- package/dist/chunks/velin-search-LWHY23Q5.js +0 -474
- package/dist/chunks/velin-secure-field-H7FSBUJW.js +0 -95
- package/dist/chunks/velin-segmented-control-PQX6LKOJ.js +0 -109
- package/dist/chunks/velin-sheet-3OGI4HD7.js +0 -119
- package/dist/chunks/velin-sparkline-GVEANJVW.js +0 -184
- package/dist/chunks/velin-sparkline-KDA3GQAN.js +0 -162
- package/dist/chunks/velin-stepper-2ZIHLKGM.js +0 -141
- package/dist/chunks/velin-stepper-FYEUEWE6.js +0 -141
- package/dist/chunks/velin-stepper-wc-QU3KRVQR.js +0 -133
- package/dist/chunks/velin-theme-toggle-BNNS7WLV.js +0 -285
- package/dist/chunks/velin-theme-toggle-NO7V4TWI.js +0 -285
- package/dist/chunks/velin-theme-toggle-QELCJM2Q.js +0 -291
- package/dist/chunks/velin-toast-RCZ4CSUC.js +0 -109
- package/dist/chunks/velin-toast-WEUBTJG6.js +0 -109
- package/dist/chunks/velin-tooltip-664IOHZA.js +0 -112
- package/dist/chunks/velin-tooltip-wc-LXDVT6DE.js +0 -103
- package/dist/chunks/worker-client-R6DBYPFT.js +0 -46
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wl(i,e){return Ul(i)||jl(i,e)||Gl(i,e)||Kl()}function Gl(i,e){if(i){if(typeof i=="string")return bo(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bo(i,e):void 0}}function M(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return hr(i,e,r)}}function ic(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return pr(i,t)}}function _(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ot;if(vo&&vo(i,null),!B(e))return i;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let o=t(n);o!==n&&(Vl(e)||(e[r]=o),n=o)}i[n]=!0}return i}function rc(i){for(let e=0;e<i.length;e++)T(i,e)||(i[e]=null);return i}function W(i){let e=Be(null);for(let r of Co(i)){var t=Wl(r,2);let n=t[0],o=t[1];T(i,n)&&(B(o)?e[n]=rc(o):o&&typeof o=="object"&&o.constructor===Object?e[n]=W(o):e[n]=o)}return e}function nc(i){switch(typeof i){case"string":return i;case"number":return ec(i);case"boolean":return tc(i);case"bigint":return xo?xo(i):"0";case"symbol":return Ao?Ao(i):"Symbol()";case"undefined":return nt(i);case"function":case"object":{if(i===null)return nt(i);let e=i,t=Le(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:nt(r)}return nt(i)}default:return nt(i)}}function Le(i,e){for(;i!==null;){let r=Xl(i,e);if(r){if(r.get)return M(r.get);if(typeof r.value=="function")return M(r.value)}i=Yl(i)}function t(){return null}return t}function oc(i){try{return P(i,""),!0}catch{return!1}}function Io(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vc(),e=b=>Io(b);if(e.version="3.4.5",e.removed=[],!i||!i.document||i.document.nodeType!==qe.document||!i.Element)return e.isSupported=!1,e;let t=i.document,r=t,n=r.currentScript,o=i.DocumentFragment,a=i.HTMLTemplateElement,l=i.Node,u=i.Element,m=i.NodeFilter,v=i.NamedNodeMap,y=v===void 0?i.NamedNodeMap||i.MozNamedAttrMap:v,g=i.HTMLFormElement,N=i.DOMParser,w=i.trustedTypes,A=u.prototype,E=Le(A,"cloneNode"),oe=Le(A,"remove"),ue=Le(A,"nextSibling"),Bn=Le(A,"childNodes"),se=Le(A,"parentNode"),Et=l&&l.prototype?Le(l.prototype,"nodeType"):null;if(typeof a=="function"){let b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let z,ke="",he=t,Ki=he.implementation,Un=he.createNodeIterator,kl=he.createDocumentFragment,Sl=he.getElementsByTagName,Tl=r.importNode,q=Lo();e.isSupported=typeof Co=="function"&&typeof se=="function"&&Ki&&Ki.createHTMLDocument!==void 0;let kt=lc,St=cc,Tt=dc,Ll=uc,Cl=hc,Rl=pc,jn=mc,Il=bc,Kn=To,F=null,Wn=_({},[...wo,...lr,...cr,...dr,...Eo]),H=null,Gn=_({},[...ko,...ur,...So,...Ft]),L=Object.seal(Be(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Qe=null,Lt=null,ve=Object.seal(Be(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Vn=!0,Wi=!0,Yn=!1,Xn=!0,ge=!1,et=!0,Se=!1,Gi=!1,Vi=!1,De=!1,Ct=!1,Rt=!1,Zn=!0,Jn=!1,Qn="user-content-",Yi=!0,tt=!1,Oe={},ae=null,Xi=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),eo=null,to=_({},["audio","video","img","source","image","track"]),Zi=null,io=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),It="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",le="http://www.w3.org/1999/xhtml",Ne=le,Ji=!1,Qi=null,Ml=_({},[It,Mt,le],ar),er=_({},["mi","mo","mn","ms","mtext"]),tr=_({},["annotation-xml"]),Dl=_({},["title","style","font","a","script"]),it=null,Ol=["application/xhtml+xml","text/html"],Nl="text/html",D=null,Fe=null,Fl=t.createElement("form"),ro=function(s){return s instanceof RegExp||s instanceof Function},ir=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fe&&Fe===s)return;(!s||typeof s!="object")&&(s={}),s=W(s),it=Ol.indexOf(s.PARSER_MEDIA_TYPE)===-1?Nl:s.PARSER_MEDIA_TYPE,D=it==="application/xhtml+xml"?ar:ot,F=T(s,"ALLOWED_TAGS")&&B(s.ALLOWED_TAGS)?_({},s.ALLOWED_TAGS,D):Wn,H=T(s,"ALLOWED_ATTR")&&B(s.ALLOWED_ATTR)?_({},s.ALLOWED_ATTR,D):Gn,Qi=T(s,"ALLOWED_NAMESPACES")&&B(s.ALLOWED_NAMESPACES)?_({},s.ALLOWED_NAMESPACES,ar):Ml,Zi=T(s,"ADD_URI_SAFE_ATTR")&&B(s.ADD_URI_SAFE_ATTR)?_(W(io),s.ADD_URI_SAFE_ATTR,D):io,eo=T(s,"ADD_DATA_URI_TAGS")&&B(s.ADD_DATA_URI_TAGS)?_(W(to),s.ADD_DATA_URI_TAGS,D):to,ae=T(s,"FORBID_CONTENTS")&&B(s.FORBID_CONTENTS)?_({},s.FORBID_CONTENTS,D):Xi,Qe=T(s,"FORBID_TAGS")&&B(s.FORBID_TAGS)?_({},s.FORBID_TAGS,D):W({}),Lt=T(s,"FORBID_ATTR")&&B(s.FORBID_ATTR)?_({},s.FORBID_ATTR,D):W({}),Oe=T(s,"USE_PROFILES")?s.USE_PROFILES&&typeof s.USE_PROFILES=="object"?W(s.USE_PROFILES):s.USE_PROFILES:!1,Vn=s.ALLOW_ARIA_ATTR!==!1,Wi=s.ALLOW_DATA_ATTR!==!1,Yn=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Xn=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=s.SAFE_FOR_TEMPLATES||!1,et=s.SAFE_FOR_XML!==!1,Se=s.WHOLE_DOCUMENT||!1,De=s.RETURN_DOM||!1,Ct=s.RETURN_DOM_FRAGMENT||!1,Rt=s.RETURN_TRUSTED_TYPE||!1,Vi=s.FORCE_BODY||!1,Zn=s.SANITIZE_DOM!==!1,Jn=s.SANITIZE_NAMED_PROPS||!1,Yi=s.KEEP_CONTENT!==!1,tt=s.IN_PLACE||!1,Kn=oc(s.ALLOWED_URI_REGEXP)?s.ALLOWED_URI_REGEXP:To,Ne=typeof s.NAMESPACE=="string"?s.NAMESPACE:le,er=T(s,"MATHML_TEXT_INTEGRATION_POINTS")&&s.MATHML_TEXT_INTEGRATION_POINTS&&typeof s.MATHML_TEXT_INTEGRATION_POINTS=="object"?W(s.MATHML_TEXT_INTEGRATION_POINTS):_({},["mi","mo","mn","ms","mtext"]),tr=T(s,"HTML_INTEGRATION_POINTS")&&s.HTML_INTEGRATION_POINTS&&typeof s.HTML_INTEGRATION_POINTS=="object"?W(s.HTML_INTEGRATION_POINTS):_({},["annotation-xml"]);let c=T(s,"CUSTOM_ELEMENT_HANDLING")&&s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING=="object"?W(s.CUSTOM_ELEMENT_HANDLING):Be(null);if(L=Be(null),T(c,"tagNameCheck")&&ro(c.tagNameCheck)&&(L.tagNameCheck=c.tagNameCheck),T(c,"attributeNameCheck")&&ro(c.attributeNameCheck)&&(L.attributeNameCheck=c.attributeNameCheck),T(c,"allowCustomizedBuiltInElements")&&typeof c.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=c.allowCustomizedBuiltInElements),ge&&(Wi=!1),Ct&&(De=!0),Oe&&(F=_({},Eo),H=Be(null),Oe.html===!0&&(_(F,wo),_(H,ko)),Oe.svg===!0&&(_(F,lr),_(H,ur),_(H,Ft)),Oe.svgFilters===!0&&(_(F,cr),_(H,ur),_(H,Ft)),Oe.mathMl===!0&&(_(F,dr),_(H,So),_(H,Ft))),ve.tagCheck=null,ve.attributeCheck=null,T(s,"ADD_TAGS")&&(typeof s.ADD_TAGS=="function"?ve.tagCheck=s.ADD_TAGS:B(s.ADD_TAGS)&&(F===Wn&&(F=W(F)),_(F,s.ADD_TAGS,D))),T(s,"ADD_ATTR")&&(typeof s.ADD_ATTR=="function"?ve.attributeCheck=s.ADD_ATTR:B(s.ADD_ATTR)&&(H===Gn&&(H=W(H)),_(H,s.ADD_ATTR,D))),T(s,"ADD_URI_SAFE_ATTR")&&B(s.ADD_URI_SAFE_ATTR)&&_(Zi,s.ADD_URI_SAFE_ATTR,D),T(s,"FORBID_CONTENTS")&&B(s.FORBID_CONTENTS)&&(ae===Xi&&(ae=W(ae)),_(ae,s.FORBID_CONTENTS,D)),T(s,"ADD_FORBID_CONTENTS")&&B(s.ADD_FORBID_CONTENTS)&&(ae===Xi&&(ae=W(ae)),_(ae,s.ADD_FORBID_CONTENTS,D)),Yi&&(F["#text"]=!0),Se&&_(F,["html","head","body"]),F.table&&(_(F,["tbody"]),delete Qe.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');z=s.TRUSTED_TYPES_POLICY,ke=z.createHTML("")}else z===void 0&&(z=gc(w,n)),z!==null&&typeof ke=="string"&&(ke=z.createHTML(""));U&&U(s),Fe=s},no=_({},[...lr,...cr,...sc]),oo=_({},[...dr,...ac]),$l=function(s){let c=se(s);(!c||!c.tagName)&&(c={namespaceURI:Ne,tagName:"template"});let h=ot(s.tagName),x=ot(c.tagName);return Qi[s.namespaceURI]?s.namespaceURI===Mt?c.namespaceURI===le?h==="svg":c.namespaceURI===It?h==="svg"&&(x==="annotation-xml"||er[x]):!!no[h]:s.namespaceURI===It?c.namespaceURI===le?h==="math":c.namespaceURI===Mt?h==="math"&&tr[x]:!!oo[h]:s.namespaceURI===le?c.namespaceURI===Mt&&!tr[x]||c.namespaceURI===It&&!er[x]?!1:!oo[h]&&(Dl[h]||!no[h]):!!(it==="application/xhtml+xml"&&Qi[s.namespaceURI]):!1},J=function(s){He(e.removed,{element:s});try{se(s).removeChild(s)}catch{oe(s)}},Te=function(s,c){try{He(e.removed,{attribute:c.getAttributeNode(s),from:c})}catch{He(e.removed,{attribute:null,from:c})}if(c.removeAttribute(s),s==="is")if(De||Ct)try{J(c)}catch{}else try{c.setAttribute(s,"")}catch{}},so=function(s){let c=null,h=null;if(Vi)s="<remove></remove>"+s;else{let I=yo(s,/^[\r\n\t ]+/);h=I&&I[0]}it==="application/xhtml+xml"&&Ne===le&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");let x=z?z.createHTML(s):s;if(Ne===le)try{c=new N().parseFromString(x,it)}catch{}if(!c||!c.documentElement){c=Ki.createDocument(Ne,"template",null);try{c.documentElement.innerHTML=Ji?ke:x}catch{}}let R=c.body||c.documentElement;return s&&h&&R.insertBefore(t.createTextNode(h),R.childNodes[0]||null),Ne===le?Sl.call(c,Se?"html":"body")[0]:Se?c.documentElement:R},ao=function(s){return Un.call(s.ownerDocument||s,s,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},lo=function(s){s.normalize();let c=Un.call(s.ownerDocument||s,s,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null),h=c.nextNode();for(;h;){let x=h.data;ze([kt,St,Tt],R=>{x=Pe(x,R," ")}),h.data=x,h=c.nextNode()}},rr=function(s){return s instanceof g&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof y)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},Dt=function(s){if(!Et||typeof s!="object"||s===null)return!1;try{return typeof Et(s)=="number"}catch{return!1}};function pe(b,s,c){ze(b,h=>{h.call(e,s,c,Fe)})}let co=function(s){let c=null;if(pe(q.beforeSanitizeElements,s,null),rr(s))return J(s),!0;let h=D(s.nodeName);if(pe(q.uponSanitizeElement,s,{tagName:h,allowedTags:F}),et&&s.hasChildNodes()&&!Dt(s.firstElementChild)&&P(/<[/\w!]/g,s.innerHTML)&&P(/<[/\w!]/g,s.textContent)||et&&s.namespaceURI===le&&h==="style"&&Dt(s.firstElementChild)||s.nodeType===qe.progressingInstruction||et&&s.nodeType===qe.comment&&P(/<[/\w]/g,s.data))return J(s),!0;if(Qe[h]||!(ve.tagCheck instanceof Function&&ve.tagCheck(h))&&!F[h]){if(!Qe[h]&&ho(h)&&(L.tagNameCheck instanceof RegExp&&P(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h)))return!1;if(Yi&&!ae[h]){let x=se(s)||s.parentNode,R=Bn(s)||s.childNodes;if(R&&x){let I=R.length;for(let j=I-1;j>=0;--j){let ye=E(R[j],!0);x.insertBefore(ye,ue(s))}}}return J(s),!0}return s instanceof u&&!$l(s)||(h==="noscript"||h==="noembed"||h==="noframes")&&P(/<\/no(script|embed|frames)/i,s.innerHTML)?(J(s),!0):(ge&&s.nodeType===qe.text&&(c=s.textContent,ze([kt,St,Tt],x=>{c=Pe(c,x," ")}),s.textContent!==c&&(He(e.removed,{element:s.cloneNode()}),s.textContent=c)),pe(q.afterSanitizeElements,s,null),!1)},uo=function(s,c,h){if(Lt[c]||Zn&&(c==="id"||c==="name")&&(h in t||h in Fl))return!1;let x=H[c]||ve.attributeCheck instanceof Function&&ve.attributeCheck(c,s);if(!(Wi&&!Lt[c]&&P(Ll,c))){if(!(Vn&&P(Cl,c))){if(!x||Lt[c]){if(!(ho(s)&&(L.tagNameCheck instanceof RegExp&&P(L.tagNameCheck,s)||L.tagNameCheck instanceof Function&&L.tagNameCheck(s))&&(L.attributeNameCheck instanceof RegExp&&P(L.attributeNameCheck,c)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(c,s))||c==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&P(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h))))return!1}else if(!Zi[c]){if(!P(Kn,Pe(h,jn,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&s!=="script"&&_o(h,"data:")===0&&eo[s])){if(!(Yn&&!P(Rl,Pe(h,jn,"")))){if(h)return!1}}}}}}return!0},zl=_({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ho=function(s){return!zl[ot(s)]&&P(Il,s)},po=function(s){pe(q.beforeSanitizeAttributes,s,null);let c=s.attributes;if(!c||rr(s))return;let h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},x=c.length;for(;x--;){let R=c[x],I=R.name,j=R.namespaceURI,ye=R.value,me=D(I),or=ye,$=I==="value"?or:Ql(or);if(h.attrName=me,h.attrValue=$,h.keepAttr=!0,h.forceKeepAttr=void 0,pe(q.uponSanitizeAttribute,s,h),$=h.attrValue,Jn&&(me==="id"||me==="name")&&_o($,Qn)!==0&&(Te(I,s),$=Qn+$),et&&P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,$)){Te(I,s);continue}if(me==="attributename"&&yo($,"href")){Te(I,s);continue}if(h.forceKeepAttr)continue;if(!h.keepAttr){Te(I,s);continue}if(!Xn&&P(/\/>/i,$)){Te(I,s);continue}ge&&ze([kt,St,Tt],fo=>{$=Pe($,fo," ")});let mo=D(s.nodeName);if(!uo(mo,me,$)){Te(I,s);continue}if(z&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!j)switch(w.getAttributeType(mo,me)){case"TrustedHTML":{$=z.createHTML($);break}case"TrustedScriptURL":{$=z.createScriptURL($);break}}if($!==or)try{j?s.setAttributeNS(j,I,$):s.setAttribute(I,$),rr(s)?J(s):go(e.removed)}catch{Te(I,s)}}pe(q.afterSanitizeAttributes,s,null)},nr=function(s){let c=null,h=ao(s);for(pe(q.beforeSanitizeShadowDOM,s,null);c=h.nextNode();)pe(q.uponSanitizeShadowNode,c,null),co(c),po(c),c.content instanceof o&&nr(c.content);pe(q.afterSanitizeShadowDOM,s,null)},Ot=function(s){if(s.nodeType===qe.element&&s.shadowRoot instanceof o){let x=s.shadowRoot;Ot(x),nr(x)}let c=s.childNodes;if(!c)return;let h=[];ze(c,x=>{He(h,x)});for(let x of h)Ot(x)};return e.sanitize=function(b){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,h=null,x=null,R=null;if(Ji=!b,Ji&&(b="<!-->"),typeof b!="string"&&!Dt(b)&&(b=nc(b),typeof b!="string"))throw Nt("dirty is not a string, aborting");if(!e.isSupported)return b;if(Gi||ir(s),e.removed=[],typeof b=="string"&&(tt=!1),tt){let ye=b.nodeName;if(typeof ye=="string"){let me=D(ye);if(!F[me]||Qe[me])throw Nt("root node is forbidden and cannot be sanitized in-place")}Ot(b)}else if(Dt(b))c=so("<!---->"),h=c.ownerDocument.importNode(b,!0),h.nodeType===qe.element&&h.nodeName==="BODY"||h.nodeName==="HTML"?c=h:c.appendChild(h),Ot(h);else{if(!De&&!ge&&!Se&&b.indexOf("<")===-1)return z&&Rt?z.createHTML(b):b;if(c=so(b),!c)return De?null:Rt?ke:""}c&&Vi&&J(c.firstChild);let I=ao(tt?b:c);for(;x=I.nextNode();)co(x),po(x),x.content instanceof o&&nr(x.content);if(tt)return ge&&lo(b),b;if(De){if(ge&&lo(c),Ct)for(R=kl.call(c.ownerDocument);c.firstChild;)R.appendChild(c.firstChild);else R=c;return(H.shadowroot||H.shadowrootmode)&&(R=Tl.call(r,R,!0)),R}let j=Se?c.outerHTML:c.innerHTML;return Se&&F["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&P(fc,c.ownerDocument.doctype.name)&&(j="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
|
|
3
|
-
`+j),ge&&ze([kt,St,Tt],ye=>{j=Pe(j,ye," ")}),z&&Rt?z.createHTML(j):j},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ir(b),Gi=!0},e.clearConfig=function(){Fe=null,Gi=!1},e.isValidAttribute=function(b,s,c){Fe||ir({});let h=D(b),x=D(s);return uo(h,x,c)},e.addHook=function(b,s){typeof s=="function"&&He(q[b],s)},e.removeHook=function(b,s){if(s!==void 0){let c=Zl(q[b],s);return c===-1?void 0:Jl(q[b],c,1)[0]}return go(q[b])},e.removeHooks=function(b){q[b]=[]},e.removeAllHooks=function(){q=Lo()},e}var Co,vo,Vl,Yl,Xl,U,Z,Be,Ro,hr,pr,ze,Zl,go,He,Jl,B,ot,ar,yo,Pe,_o,Ql,ec,tc,xo,Ao,T,nt,P,Nt,wo,lr,cr,sc,dr,ac,Eo,ko,ur,So,Ft,lc,cc,dc,uc,hc,To,pc,mc,fc,bc,qe,vc,gc,Lo,C,Mo=d(()=>{Co=Object.entries,vo=Object.setPrototypeOf,Vl=Object.isFrozen,Yl=Object.getPrototypeOf,Xl=Object.getOwnPropertyDescriptor,U=Object.freeze,Z=Object.seal,Be=Object.create,Ro=typeof Reflect<"u"&&Reflect,hr=Ro.apply,pr=Ro.construct;U||(U=function(e){return e});Z||(Z=function(e){return e});hr||(hr=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return e.apply(t,n)});pr||(pr=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});ze=M(Array.prototype.forEach),Zl=M(Array.prototype.lastIndexOf),go=M(Array.prototype.pop),He=M(Array.prototype.push),Jl=M(Array.prototype.splice),B=Array.isArray,ot=M(String.prototype.toLowerCase),ar=M(String.prototype.toString),yo=M(String.prototype.match),Pe=M(String.prototype.replace),_o=M(String.prototype.indexOf),Ql=M(String.prototype.trim),ec=M(Number.prototype.toString),tc=M(Boolean.prototype.toString),xo=typeof BigInt>"u"?null:M(BigInt.prototype.toString),Ao=typeof Symbol>"u"?null:M(Symbol.prototype.toString),T=M(Object.prototype.hasOwnProperty),nt=M(Object.prototype.toString),P=M(RegExp.prototype.test),Nt=ic(TypeError);wo=U(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),lr=U(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),cr=U(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sc=U(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dr=U(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ac=U(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Eo=U(["#text"]),ko=U(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ur=U(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=U(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ft=U(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lc=Z(/{{[\w\W]*|^[\w\W]*}}/g),cc=Z(/<%[\w\W]*|^[\w\W]*%>/g),dc=Z(/\${[\w\W]*/g),uc=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),hc=Z(/^aria-[\-\w]+$/),To=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pc=Z(/^(?:\w+script|data):/i),mc=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fc=Z(/^html$/i),bc=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),qe={element:1,text:3,progressingInstruction:7,comment:8,document:9},vc=function(){return typeof window>"u"?null:window},gc=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Lo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};C=Io()});var Do={};f(Do,{addHook:()=>Ac,clearConfig:()=>Tc,clearWindow:()=>Ic,default:()=>yc,isSupported:()=>xc,isValidAttribute:()=>Lc,removeAllHooks:()=>kc,removeHook:()=>wc,removeHooks:()=>Ec,removed:()=>Rc,sanitize:()=>_c,setConfig:()=>Sc,version:()=>Cc});function Ic(){}var yc,_c,xc,Ac,wc,Ec,kc,Sc,Tc,Lc,Cc,Rc,Oo=d(()=>{Mo();yc=C,_c=C.sanitize.bind(C),xc=C.isSupported,Ac=C.addHook.bind(C),wc=C.removeHook.bind(C),Ec=C.removeHooks.bind(C),kc=C.removeAllHooks.bind(C),Sc=C.setConfig.bind(C),Tc=C.clearConfig.bind(C),Lc=C.isValidAttribute.bind(C),Cc=C.version,Rc=C.removed});function p(i){return typeof i!="string"?"":i.replace(Dc,e=>Mc[e])}function mr(i){return typeof i!="string"?"":i.replace(Oc,"")}function fe(i){return p(mr(i))}function Ce(i,e){if(typeof i!="string")return"";let t=i.trim();if(!t||/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)||Fc.test(t)||/^data:/i.test(t)&&!No.test(t))return"";try{let r=new URL(t,e||(typeof location<"u"?location.href:"https://example.invalid/"));return!Nc.has(r.protocol)||r.protocol==="data:"&&!No.test(r.href)?"":r.href}catch{return t.startsWith("#")||t.startsWith("/")?t:""}}function Fo(i,e){if(typeof i!="string")return"#";let t=i.trim();return t?t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")?t:/^https?:\/\//i.test(t)?Ce(t,e)||"#":/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)?"#":t:"#"}function $o(i){let e=String(i||"text").toLowerCase();return $c.has(e)?e:"text"}async function zc(){if(st)return st;try{let i=await Promise.resolve().then(()=>(Oo(),Do));st=i.default||i}catch{st=null}return st}async function zo(i){if(typeof i!="string")return"";let e=await zc();return e?.sanitize?e.sanitize(i,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:Hc,ADD_ATTR:Pc,FORBID_TAGS:["script","foreignObject","iframe","object","embed"],FORBID_ATTR:["onload","onerror","onclick","onmouseover"]}):i.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/\s+on\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/<foreignObject[\s\S]*?<\/foreignObject>/gi,"")}function Ho(){return $t||(typeof window<"u"&&window.trustedTypes?.createPolicy&&($t=window.trustedTypes.createPolicy("velinstyle",{createHTML:i=>p(i)})),$t)}function qc(i){let e=Ho(),t=p(mr(i));return e?.createHTML?e.createHTML(t):t}var Mc,Dc,Oc,Nc,Fc,No,$c,st,Hc,Pc,$t,k=d(()=>{Mc={"&":"&","<":"<",">":">",'"':""","'":"'"},Dc=/[&<>"']/g,Oc=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,Nc=new Set(["http:","https:","data:","mailto:","tel:"]),Fc=/^data:(?:text\/html|image\/svg\+xml|application\/xml)/i,No=/^data:image\/(png|jpeg|jpg|gif|webp|avif);base64,/i,$c=new Set(["text","password","email","search","tel","url","number"]);st=null;Hc=["svg","g","path","circle","rect","line","polyline","polygon","ellipse","defs","use","symbol","title","desc","clipPath","mask","linearGradient","radialGradient","stop","pattern","text","tspan"],Pc=["viewBox","xmlns","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","d","cx","cy","r","rx","ry","x","y","width","height","x1","y1","x2","y2","points","transform","opacity","class","id","href","xlink:href","aria-hidden","aria-label","aria-labelledby","role","focusable","clip-path","mask","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","patternUnits","patternContentUnits","preserveAspectRatio"];$t=null});var qo={};f(qo,{default:()=>Po});var Bc,zt,Po,fr=d(()=>{K();k();Bc=`
|
|
1
|
+
var Ac=Object.defineProperty;var p=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>{for(var t in e)Ac(r,t,{get:e[t],enumerable:!0})};function kc(r){if(r.hasAttribute("disabled")||r.getAttribute("aria-hidden")==="true"||r.closest("[inert]"))return!1;let e=r.ownerDocument.defaultView?.getComputedStyle(r);return e&&(e.visibility==="hidden"||e.display==="none")?!1:r.getClientRects().length>0}function fe(r){return[...r.querySelectorAll(Ec)].filter(kc)}function ee(r,e){if(e.key!=="Tab")return;let t=fe(r);if(t.length===0)return;let i=t[0],n=t[t.length-1],o=r.getRootNode().activeElement;e.shiftKey&&o===i?(e.preventDefault(),n.focus()):!e.shiftKey&&o===n&&(e.preventDefault(),i.focus())}function te(r,e,t){let i=e.indexOf(t.target);if(i===-1)return;let n;switch(t.key){case"ArrowDown":case"ArrowRight":t.preventDefault(),n=(i+1)%e.length;break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),n=(i-1+e.length)%e.length;break;case"Home":t.preventDefault(),n=0;break;case"End":t.preventDefault(),n=e.length-1;break;default:return}e.forEach((o,a)=>{o.setAttribute("tabindex",a===n?"0":"-1")}),e[n].focus()}function ae(){return document.activeElement}function le(r){r&&typeof r.focus=="function"&&r.focus()}function Sc(){let r=new Set;for(let e of Ye)for(let t of e.siblings)r.add(t);return r}function ce(r){let e=r instanceof HTMLElement?r:null;if(!e)return;let t=new Set;for(let i of document.body.children)i===e||i.contains(e)||i.hasAttribute("inert")||(i.setAttribute("inert",""),t.add(i));Ye.push({host:e,siblings:t}),pt===0&&(yr=document.body.style.overflow,document.body.style.overflow="hidden"),pt+=1}function G(r){let e=-1;if(r instanceof HTMLElement?e=Ye.findLastIndex(n=>n.host===r):Ye.length&&(e=Ye.length-1),e===-1)return;let{siblings:t}=Ye.splice(e,1)[0],i=Sc();for(let n of t)i.has(n)||n.removeAttribute("inert");pt=Math.max(0,pt-1),pt===0&&(document.body.style.overflow=yr,yr="")}var Ec,Ye,pt,yr,Z=p(()=>{Ec=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"summary","details"].join(", ");Ye=[],pt=0,yr=""});function Do(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=Array(e);t<e;t++)i[t]=r[t];return i}function Tc(r){if(Array.isArray(r))return r}function Lc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,n,o,a,c=[],u=!0,f=!1;try{if(o=(t=t.call(r)).next,e!==0)for(;!(u=(i=o.call(t)).done)&&(c.push(i.value),c.length!==e);u=!0);}catch(_){f=!0,n=_}finally{try{if(!u&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(f)throw n}}return c}}function Cc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rc(r,e){return Tc(r)||Lc(r,e)||Mc(r,e)||Cc()}function Mc(r,e){if(r){if(typeof r=="string")return Do(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Do(r,e):void 0}}function F(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return kr(r,e,i)}}function Pc(r){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Sr(r,t)}}function E(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bt;if(Oo&&Oo(r,null),!Te(e))return r;let i=e.length;for(;i--;){let n=e[i];if(typeof n=="string"){let o=t(n);o!==n&&(Ic(e)||(e[i]=o),n=o)}r[n]=!0}return r}function qc(r){for(let e=0;e<r.length;e++)q(r,e)||(r[e]=null);return r}function V(r){let e=Ze(null);for(let i of Yo(r)){var t=Rc(i,2);let n=t[0],o=t[1];q(r,n)&&(Te(o)?e[n]=qc(o):o&&typeof o=="object"&&o.constructor===Object?e[n]=V(o):e[n]=o)}return e}function Bc(r){switch(typeof r){case"string":return r;case"number":return Fc(r);case"boolean":return Hc(r);case"bigint":return Fo?Fo(r):"0";case"symbol":return Ho?Ho(r):"Symbol()";case"undefined":return ft(r);case"function":case"object":{if(r===null)return ft(r);let e=r,t=be(e,"toString");if(typeof t=="function"){let i=t(e);return typeof i=="string"?i:ft(i)}return ft(r)}default:return ft(r)}}function be(r,e){for(;r!==null;){let i=Oc(r,e);if(i){if(i.get)return F(i.get);if(typeof i.value=="function")return F(i.value)}r=Dc(r)}function t(){return null}return t}function Uc(r){try{return P(r,""),!0}catch{return!1}}function Xo(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rd(),e=h=>Xo(h);if(e.version="3.4.12",e.removed=[],!r||!r.document||r.document.nodeType!==ie.document||!r.Element)return e.isSupported=!1,e;let t=r.document,i=t,n=i.currentScript;r.DocumentFragment;let o=r.HTMLTemplateElement,a=r.Node,c=r.Element,u=r.NodeFilter,f=r.NamedNodeMap;f===void 0&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;let _=r.DOMParser,b=r.trustedTypes,g=c.prototype,R=be(g,"cloneNode"),k=be(g,"remove"),A=be(g,"nextSibling"),S=be(g,"childNodes"),j=be(g,"parentNode"),ue=be(g,"shadowRoot"),Nt=be(g,"attributes"),z=a&&a.prototype?be(a.prototype,"nodeType"):null,re=a&&a.prototype?be(a.prototype,"nodeName"):null;if(typeof o=="function"){let h=t.createElement("template");h.content&&h.content.ownerDocument&&(t=h.content.ownerDocument)}let K,ge="",xe,no=!1,ct=0,oo=function(){if(ct>0)throw ze('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Be=function(s){oo(),ct++;try{return K.createHTML(s)}finally{ct--}},Vl=function(s){oo(),ct++;try{return K.createScriptURL(s)}finally{ct--}},Xl=function(){return no||(xe=nd(b,n),no=!0),xe},zt=t,tr=zt.implementation,so=zt.createNodeIterator,Zl=zt.createDocumentFragment,Jl=zt.getElementsByTagName,Ql=i.importNode,M=Go();e.isSupported=typeof Yo=="function"&&typeof j=="function"&&tr&&tr.createHTMLDocument!==void 0;let ec=Wc,tc=Gc,ic=Yc,rc=Vc,nc=Xc,oc=Zc,ao=Jc,sc=ed,lo=jo,I=null,co=E({},[...Po,...xr,...wr,...Ar,...qo]),D=null,uo=E({},[...Bo,...Er,...Uo,...Kt]),O=Object.seal(Ze(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),dt=null,ho=null,we=Object.seal(Ze(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),po=!0,ir=!0,mo=!1,fo=!0,Ae=!1,Ee=!0,Oe=!1,rr=!1,nr=null,or=null,sr=!1,Ue=!1,$t=!1,Ft=!1,bo=!0,vo=!1,go="user-content-",ar=!0,lr=!1,je={},he=null,cr=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),yo=null,_o=E({},["audio","video","img","source","image","track"]),dr=null,xo=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ht="http://www.w3.org/1998/Math/MathML",Pt="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",Ke=pe,ur=!1,hr=null,ac=E({},[Ht,Pt,pe],_r),wo=B(["mi","mo","mn","ms","mtext"]),pr=E({},wo),Ao=B(["annotation-xml"]),mr=E({},Ao),lc=E({},["title","style","font","a","script"]),ut=null,cc=["application/xhtml+xml","text/html"],dc="text/html",L=null,We=null,uc=t.createElement("form"),Eo=function(s){return s instanceof RegExp||s instanceof Function},fr=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(We&&We===s)return;(!s||typeof s!="object")&&(s={}),s=V(s),ut=cc.indexOf(s.PARSER_MEDIA_TYPE)===-1?dc:s.PARSER_MEDIA_TYPE,L=ut==="application/xhtml+xml"?_r:bt,I=Se(s,"ALLOWED_TAGS",co,{transform:L}),D=Se(s,"ALLOWED_ATTR",uo,{transform:L}),hr=Se(s,"ALLOWED_NAMESPACES",ac,{transform:_r}),dr=Se(s,"ADD_URI_SAFE_ATTR",xo,{transform:L,base:xo}),yo=Se(s,"ADD_DATA_URI_TAGS",_o,{transform:L,base:_o}),he=Se(s,"FORBID_CONTENTS",cr,{transform:L}),dt=Se(s,"FORBID_TAGS",V({}),{transform:L}),ho=Se(s,"FORBID_ATTR",V({}),{transform:L}),je=q(s,"USE_PROFILES")?s.USE_PROFILES&&typeof s.USE_PROFILES=="object"?V(s.USE_PROFILES):s.USE_PROFILES:!1,po=s.ALLOW_ARIA_ATTR!==!1,ir=s.ALLOW_DATA_ATTR!==!1,mo=s.ALLOW_UNKNOWN_PROTOCOLS||!1,fo=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=s.SAFE_FOR_TEMPLATES||!1,Ee=s.SAFE_FOR_XML!==!1,Oe=s.WHOLE_DOCUMENT||!1,Ue=s.RETURN_DOM||!1,$t=s.RETURN_DOM_FRAGMENT||!1,Ft=s.RETURN_TRUSTED_TYPE||!1,sr=s.FORCE_BODY||!1,bo=s.SANITIZE_DOM!==!1,vo=s.SANITIZE_NAMED_PROPS||!1,ar=s.KEEP_CONTENT!==!1,lr=s.IN_PLACE||!1,lo=Uc(s.ALLOWED_URI_REGEXP)?s.ALLOWED_URI_REGEXP:jo,Ke=typeof s.NAMESPACE=="string"?s.NAMESPACE:pe,pr=q(s,"MATHML_TEXT_INTEGRATION_POINTS")&&s.MATHML_TEXT_INTEGRATION_POINTS&&typeof s.MATHML_TEXT_INTEGRATION_POINTS=="object"?V(s.MATHML_TEXT_INTEGRATION_POINTS):E({},wo),mr=q(s,"HTML_INTEGRATION_POINTS")&&s.HTML_INTEGRATION_POINTS&&typeof s.HTML_INTEGRATION_POINTS=="object"?V(s.HTML_INTEGRATION_POINTS):E({},Ao);let l=q(s,"CUSTOM_ELEMENT_HANDLING")&&s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING=="object"?V(s.CUSTOM_ELEMENT_HANDLING):Ze(null);if(O=Ze(null),q(l,"tagNameCheck")&&Eo(l.tagNameCheck)&&(O.tagNameCheck=l.tagNameCheck),q(l,"attributeNameCheck")&&Eo(l.attributeNameCheck)&&(O.attributeNameCheck=l.attributeNameCheck),q(l,"allowCustomizedBuiltInElements")&&typeof l.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=l.allowCustomizedBuiltInElements),U(O),Ae&&(ir=!1),$t&&(Ue=!0),je&&(I=E({},qo),D=Ze(null),je.html===!0&&(E(I,Po),E(D,Bo)),je.svg===!0&&(E(I,xr),E(D,Er),E(D,Kt)),je.svgFilters===!0&&(E(I,wr),E(D,Er),E(D,Kt)),je.mathMl===!0&&(E(I,Ar),E(D,Uo),E(D,Kt))),we.tagCheck=null,we.attributeCheck=null,q(s,"ADD_TAGS")&&(typeof s.ADD_TAGS=="function"?we.tagCheck=s.ADD_TAGS:Te(s.ADD_TAGS)&&(I===co&&(I=V(I)),E(I,s.ADD_TAGS,L))),q(s,"ADD_ATTR")&&(typeof s.ADD_ATTR=="function"?we.attributeCheck=s.ADD_ATTR:Te(s.ADD_ATTR)&&(D===uo&&(D=V(D)),E(D,s.ADD_ATTR,L))),q(s,"ADD_URI_SAFE_ATTR")&&Te(s.ADD_URI_SAFE_ATTR)&&E(dr,s.ADD_URI_SAFE_ATTR,L),q(s,"FORBID_CONTENTS")&&Te(s.FORBID_CONTENTS)&&(he===cr&&(he=V(he)),E(he,s.FORBID_CONTENTS,L)),q(s,"ADD_FORBID_CONTENTS")&&Te(s.ADD_FORBID_CONTENTS)&&(he===cr&&(he=V(he)),E(he,s.ADD_FORBID_CONTENTS,L)),ar&&(I["#text"]=!0),Oe&&E(I,["html","head","body"]),I.table&&(E(I,["tbody"]),delete dt.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let d=K;K=s.TRUSTED_TYPES_POLICY;try{ge=Be("")}catch(v){throw K=d,v}}else s.TRUSTED_TYPES_POLICY===null?(K=void 0,ge=""):(K===void 0&&(K=Xl()),K&&typeof ge=="string"&&(ge=Be("")));B&&B(s),We=s},ko=E({},[...xr,...wr,...jc]),So=E({},[...Ar,...Kc]),hc=function(s,l,d){return l.namespaceURI===pe?s==="svg":l.namespaceURI===Ht?s==="svg"&&(d==="annotation-xml"||pr[d]):!!ko[s]},pc=function(s,l,d){return l.namespaceURI===pe?s==="math":l.namespaceURI===Pt?s==="math"&&mr[d]:!!So[s]},mc=function(s,l,d){return l.namespaceURI===Pt&&!mr[d]||l.namespaceURI===Ht&&!pr[d]?!1:!So[s]&&(lc[s]||!ko[s])},fc=function(s){let l=j(s);(!l||!l.tagName)&&(l={namespaceURI:Ke,tagName:"template"});let d=bt(s.tagName),v=bt(l.tagName);return hr[s.namespaceURI]?s.namespaceURI===Pt?hc(d,l,v):s.namespaceURI===Ht?pc(d,l,v):s.namespaceURI===pe?mc(d,l,v):!!(ut==="application/xhtml+xml"&&hr[s.namespaceURI]):!1},ke=function(s){Xe(e.removed,{element:s});try{j(s).removeChild(s)}catch{if(k(s),!j(s))throw ze("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},qt=function(s){br(s);let l=S(s);if(l){let v=[];Ve(l,x=>{Xe(v,x)}),Ve(v,x=>{try{k(x)}catch{}})}let d=Nt(s);if(d)for(let v=d.length-1;v>=0;--v){let x=d[v],w=x&&x.name;if(typeof w=="string")try{s.removeAttribute(w)}catch{}}},Ne=function(s,l){try{Xe(e.removed,{attribute:l.getAttributeNode(s),from:l})}catch{Xe(e.removed,{attribute:null,from:l})}if(l.removeAttribute(s),s==="is")if(Ue||$t)try{ke(l)}catch{}else try{l.setAttribute(s,"")}catch{}},bc=function(s){let l=Nt(s);if(l)for(let d=l.length-1;d>=0;--d){let v=l[d],x=v&&v.name;if(!(typeof x!="string"||D[L(x)]))try{s.removeAttribute(x)}catch{}}},br=function(s){let l=[s];for(;l.length>0;){let d=l.pop();(z?z(d):d.nodeType)===ie.element&&bc(d);let x=S(d);if(x)for(let w=x.length-1;w>=0;--w)l.push(x[w])}},vc=function(s){if(!Ee)return;let l=[s];for(;l.length>0;){let d=l.pop(),v=z?z(d):d.nodeType;if(v===ie.processingInstruction||v===ie.comment&&P(Wo,d.data)){try{k(d)}catch{}continue}if(v===ie.element){let w=d,N=L(re?re(d):d.nodeName);try{w.hasAttribute&&w.hasAttribute("patchsrc")&&w.removeAttribute("patchsrc"),w.hasAttribute&&w.hasAttribute("for")&&N!=="label"&&N!=="output"&&w.removeAttribute("for")}catch{}}let x=S(d);if(x)for(let w=x.length-1;w>=0;--w)l.push(x[w])}},To=function(s){let l=null,d=null;if(sr)s="<remove></remove>"+s;else{let w=zo(s,/^[\r\n\t ]+/);d=w&&w[0]}ut==="application/xhtml+xml"&&Ke===pe&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");let v=K?Be(s):s;if(Ke===pe)try{l=new _().parseFromString(v,ut)}catch{}if(!l||!l.documentElement){l=tr.createDocument(Ke,"template",null);try{l.documentElement.innerHTML=ur?ge:v}catch{}}let x=l.body||l.documentElement;return s&&d&&x.insertBefore(t.createTextNode(d),x.childNodes[0]||null),Ke===pe?Jl.call(l,Oe?"html":"body")[0]:Oe?l.documentElement:x},Lo=function(s){return so.call(s.ownerDocument||s,s,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Bt=function(s){return s=mt(s,ec," "),s=mt(s,tc," "),s=mt(s,ic," "),s},vr=function(s){var l;s.normalize();let d=so.call(s.ownerDocument||s,s,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null),v=d.nextNode();for(;v;)v.data=Bt(v.data),v=d.nextNode();let x=(l=s.querySelectorAll)===null||l===void 0?void 0:l.call(s,"template");x&&Ve(x,w=>{Ge(w.content)&&vr(w.content)})},Ut=function(s){let l=re?re(s):null;return typeof l!="string"||L(l)!=="form"?!1:typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||s.attributes!==Nt(s)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function"||s.nodeType!==z(s)||s.childNodes!==S(s)},Ge=function(s){if(!z||typeof s!="object"||s===null)return!1;try{return z(s)===ie.documentFragment}catch{return!1}},ht=function(s){if(!z||typeof s!="object"||s===null)return!1;try{return typeof z(s)=="number"}catch{return!1}};function me(h,s,l){h.length!==0&&Ve(h,d=>{d.call(e,s,l,We)})}let gc=function(s,l){return!!(Ee&&s.hasChildNodes()&&!ht(s.firstElementChild)&&P(Ko,s.textContent)&&P(Ko,s.innerHTML)||Ee&&s.namespaceURI===pe&&l==="style"&&ht(s.firstElementChild)||s.nodeType===ie.processingInstruction||Ee&&s.nodeType===ie.comment&&P(Wo,s.data))},yc=function(s,l){if(!dt[l]&&Mo(l)&&(O.tagNameCheck instanceof RegExp&&P(O.tagNameCheck,l)||O.tagNameCheck instanceof Function&&O.tagNameCheck(l)))return!1;if(ar&&!he[l]){let d=j(s),v=S(s);if(v&&d){let x=v.length;for(let w=x-1;w>=0;--w){let N=lr?v[w]:R(v[w],!0);d.insertBefore(N,A(s))}}}return ke(s),!0},Co=function(s,l){if(me(M.beforeSanitizeElements,s,null),s!==l&&j(s)===null)return!0;if(Ut(s))return ke(s),!0;let d=L(re?re(s):s.nodeName);if(me(M.uponSanitizeElement,s,{tagName:d,allowedTags:I}),s!==l&&j(s)===null)return!0;if(gc(s,d))return ke(s),!0;if(dt[d]||!(we.tagCheck instanceof Function&&we.tagCheck(d))&&!I[d]){let x=yc(s,d);return x===!1&&me(M.afterSanitizeElements,s,null),x}if((z?z(s):s.nodeType)===ie.element&&!fc(s)||(d==="noscript"||d==="noembed"||d==="noframes")&&P(td,s.innerHTML))return ke(s),!0;if(Ae&&s.nodeType===ie.text){let x=Bt(s.textContent);s.textContent!==x&&(Xe(e.removed,{element:s.cloneNode()}),s.textContent=x)}return me(M.afterSanitizeElements,s,null),!1},Ro=function(s,l,d){if(ho[l]||Ee&&l==="patchsrc"||Ee&&l==="for"&&s!=="label"&&s!=="output"||bo&&(l==="id"||l==="name")&&(d in t||d in uc))return!1;let v=D[l]||we.attributeCheck instanceof Function&&we.attributeCheck(l,s);if(!(ir&&P(rc,l))){if(!(po&&P(nc,l))){if(v){if(!dr[l]){if(!P(lo,mt(d,ao,""))){if(!((l==="src"||l==="xlink:href"||l==="href")&&s!=="script"&&$o(d,"data:")===0&&yo[s])){if(!(mo&&!P(oc,mt(d,ao,"")))){if(d)return!1}}}}}else if(!(Mo(s)&&(O.tagNameCheck instanceof RegExp&&P(O.tagNameCheck,s)||O.tagNameCheck instanceof Function&&O.tagNameCheck(s))&&(O.attributeNameCheck instanceof RegExp&&P(O.attributeNameCheck,l)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(l,s))||l==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&P(O.tagNameCheck,d)||O.tagNameCheck instanceof Function&&O.tagNameCheck(d))))return!1}}return!0},_c=E({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Mo=function(s){return!_c[bt(s)]&&P(sc,s)},xc=function(s,l,d,v){if(K&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!d)switch(b.getAttributeType(s,l)){case"TrustedHTML":return Be(v);case"TrustedScriptURL":return Vl(v)}return v},wc=function(s,l,d,v){try{d?s.setAttributeNS(d,l,v):s.setAttribute(l,v),Ut(s)?ke(s):No(e.removed)}catch{Ne(l,s)}},Io=function(s){me(M.beforeSanitizeAttributes,s,null);let l=s.attributes;if(!l||Ut(s))return;let d={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0},v=l.length,x=L(s.nodeName);for(;v--;){let w=l[v],N=w.name,W=w.namespaceURI,oe=w.value,X=L(N),se=oe,Y=N==="value"?se:$c(se);if(d.attrName=X,d.attrValue=Y,d.keepAttr=!0,d.forceKeepAttr=void 0,me(M.uponSanitizeAttribute,s,d),Y=d.attrValue,vo&&(X==="id"||X==="name")&&$o(Y,go)!==0&&(Ne(N,s),Y=go+Y),Ee&&P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Y)){Ne(N,s);continue}if(X==="attributename"&&zo(Y,"href")){Ne(N,s);continue}if(!d.forceKeepAttr){if(!d.keepAttr){Ne(N,s);continue}if(!fo&&P(id,Y)){Ne(N,s);continue}if(Ae&&(Y=Bt(Y)),!Ro(x,X,Y)){Ne(N,s);continue}Y=xc(x,X,W,Y),Y!==se&&wc(s,N,W,Y)}}me(M.afterSanitizeAttributes,s,null)},jt=function(s){let l=null,d=Lo(s);for(me(M.beforeSanitizeShadowDOM,s,null);l=d.nextNode();)if(me(M.uponSanitizeShadowNode,l,null),Co(l,s),Io(l),Ge(l.content)&&jt(l.content),(z?z(l):l.nodeType)===ie.element){let x=ue(l);Ge(x)&&(gr(x),jt(x))}me(M.afterSanitizeShadowDOM,s,null)},gr=function(s){let l=[{node:s,shadow:null}];for(;l.length>0;){let d=l.pop();if(d.shadow){jt(d.shadow);continue}let v=d.node,w=(z?z(v):v.nodeType)===ie.element,N=S(v);if(N)for(let W=N.length-1;W>=0;--W)l.push({node:N[W],shadow:null});if(w){let W=re?re(v):null;if(typeof W=="string"&&L(W)==="template"){let oe=v.content;Ge(oe)&&l.push({node:oe,shadow:null})}}if(w){let W=ue(v);Ge(W)&&l.push({node:null,shadow:W},{node:W,shadow:null})}}};return e.sanitize=function(h){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=null,d=null,v=null,x=null;if(ur=!h,ur&&(h="<!-->"),typeof h!="string"&&!ht(h)&&(h=Bc(h),typeof h!="string"))throw ze("dirty is not a string, aborting");if(!e.isSupported)return h;rr?(I=nr,D=or):fr(s),(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&(I=V(I)),M.uponSanitizeAttribute.length>0&&(D=V(D)),e.removed=[];let w=lr&&typeof h!="string"&&ht(h);if(w){vc(h);let X=re?re(h):h.nodeName;if(typeof X=="string"){let se=L(X);if(!I[se]||dt[se])throw qt(h),ze("root node is forbidden and cannot be sanitized in-place")}if(Ut(h))throw qt(h),ze("root node is clobbered and cannot be sanitized in-place");try{gr(h)}catch(se){throw qt(h),se}}else if(ht(h))l=To("<!---->"),d=l.ownerDocument.importNode(h,!0),d.nodeType===ie.element&&d.nodeName==="BODY"||d.nodeName==="HTML"?l=d:l.appendChild(d),gr(d);else{if(!Ue&&!Ae&&!Oe&&h.indexOf("<")===-1)return K&&Ft?Be(h):h;if(l=To(h),!l)return Ue?null:Ft?ge:""}l&&sr&&ke(l.firstChild);let N=w?h:l,W=Lo(N);try{for(;v=W.nextNode();)Co(v,N),Io(v),Ge(v.content)&&jt(v.content)}catch(X){throw w&&(qt(h),Ve(e.removed,se=>{se.element&&br(se.element)})),X}if(w)return Ve(e.removed,X=>{X.element&&br(X.element)}),Ae&&vr(h),h;if(Ue){if(Ae&&vr(l),$t)for(x=Zl.call(l.ownerDocument);l.firstChild;)x.appendChild(l.firstChild);else x=l;return(D.shadowroot||D.shadowrootmode)&&(x=Ql.call(i,x,!0)),x}let oe=Oe?l.outerHTML:l.innerHTML;return Oe&&I["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&P(Qc,l.ownerDocument.doctype.name)&&(oe="<!DOCTYPE "+l.ownerDocument.doctype.name+`>
|
|
3
|
+
`+oe),Ae&&(oe=Bt(oe)),K&&Ft?Be(oe):oe},e.setConfig=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};fr(h),rr=!0,nr=I,or=D},e.clearConfig=function(){We=null,rr=!1,nr=null,or=null,K=xe,ge=""},e.isValidAttribute=function(h,s,l){We||fr({});let d=L(h),v=L(s);return Ro(d,v,l)},e.addHook=function(h,s){typeof s=="function"&&q(M,h)&&Xe(M[h],s)},e.removeHook=function(h,s){if(q(M,h)){if(s!==void 0){let l=Nc(M[h],s);return l===-1?void 0:zc(M[h],l,1)[0]}return No(M[h])}},e.removeHooks=function(h){q(M,h)&&(M[h]=[])},e.removeAllHooks=function(){M=Go()},e}var Yo,Oo,Ic,Dc,Oc,B,U,Ze,Vo,kr,Sr,Ve,Nc,No,Xe,zc,Te,bt,_r,zo,mt,$o,$c,Fc,Hc,Fo,Ho,q,ft,P,ze,Po,xr,wr,jc,Ar,Kc,qo,Bo,Er,Uo,Kt,Wc,Gc,Yc,Vc,Xc,jo,Zc,Jc,Qc,ed,Ko,Wo,td,id,ie,rd,nd,Go,Se,$,Zo=p(()=>{Yo=Object.entries,Oo=Object.setPrototypeOf,Ic=Object.isFrozen,Dc=Object.getPrototypeOf,Oc=Object.getOwnPropertyDescriptor,B=Object.freeze,U=Object.seal,Ze=Object.create,Vo=typeof Reflect<"u"&&Reflect,kr=Vo.apply,Sr=Vo.construct;B||(B=function(e){return e});U||(U=function(e){return e});kr||(kr=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];return e.apply(t,n)});Sr||(Sr=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new e(...i)});Ve=F(Array.prototype.forEach),Nc=F(Array.prototype.lastIndexOf),No=F(Array.prototype.pop),Xe=F(Array.prototype.push),zc=F(Array.prototype.splice),Te=Array.isArray,bt=F(String.prototype.toLowerCase),_r=F(String.prototype.toString),zo=F(String.prototype.match),mt=F(String.prototype.replace),$o=F(String.prototype.indexOf),$c=F(String.prototype.trim),Fc=F(Number.prototype.toString),Hc=F(Boolean.prototype.toString),Fo=typeof BigInt>"u"?null:F(BigInt.prototype.toString),Ho=typeof Symbol>"u"?null:F(Symbol.prototype.toString),q=F(Object.prototype.hasOwnProperty),ft=F(Object.prototype.toString),P=F(RegExp.prototype.test),ze=Pc(TypeError);Po=B(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),xr=B(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wr=B(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),jc=B(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ar=B(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Kc=B(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qo=B(["#text"]),Bo=B(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Er=B(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Uo=B(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Kt=B(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wc=U(/{{[\w\W]*|^[\w\W]*}}/g),Gc=U(/<%[\w\W]*|^[\w\W]*%>/g),Yc=U(/\${[\w\W]*/g),Vc=U(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xc=U(/^aria-[\-\w]+$/),jo=U(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zc=U(/^(?:\w+script|data):/i),Jc=U(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qc=U(/^html$/i),ed=U(/^[a-z][.\w]*(-[.\w]+)+$/i),Ko=U(/<[/\w!]/g),Wo=U(/<[/\w]/g),td=U(/<\/no(script|embed|frames)/i),id=U(/\/>/i),ie={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rd=function(){return typeof window>"u"?null:window},nd=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Go=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Se=function(e,t,i,n){return q(e,t)&&Te(e[t])?E(n.base?V(n.base):{},e[t],n.transform):i};$=Xo()});var Jo={};y(Jo,{addHook:()=>ld,clearConfig:()=>pd,clearWindow:()=>vd,default:()=>od,isSupported:()=>ad,isValidAttribute:()=>md,removeAllHooks:()=>ud,removeHook:()=>cd,removeHooks:()=>dd,removed:()=>bd,sanitize:()=>sd,setConfig:()=>hd,version:()=>fd});function vd(){}var od,sd,ad,ld,cd,dd,ud,hd,pd,md,fd,bd,Qo=p(()=>{Zo();od=$,sd=$.sanitize.bind($),ad=$.isSupported,ld=$.addHook.bind($),cd=$.removeHook.bind($),dd=$.removeHooks.bind($),ud=$.removeAllHooks.bind($),hd=$.setConfig.bind($),pd=$.clearConfig.bind($),md=$.isValidAttribute.bind($),fd=$.version,bd=$.removed});function m(r){return typeof r!="string"?"":r.replace(yd,e=>gd[e])}function Tr(r){return typeof r!="string"?"":r.replace(_d,"")}function ye(r){return m(Tr(r))}function $e(r,e){if(typeof r!="string")return"";let t=r.trim();if(!t||/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)||wd.test(t)||/^data:/i.test(t)&&!es.test(t))return"";try{let i=new URL(t,e||(typeof location<"u"?location.href:"https://example.invalid/"));return!xd.has(i.protocol)||i.protocol==="data:"&&!es.test(i.href)?"":i.href}catch{return t.startsWith("#")||t.startsWith("/")?t:""}}function ts(r,e){if(typeof r!="string")return"#";let t=r.trim();return t?t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")?t:/^https?:\/\//i.test(t)?$e(t,e)||"#":/^\s*javascript:/i.test(t)||/^\s*vbscript:/i.test(t)?"#":t:"#"}function is(r){let e=String(r||"text").toLowerCase();return Ad.has(e)?e:"text"}async function Ed(){if(vt)return vt;try{let r=await Promise.resolve().then(()=>(Qo(),Jo));vt=r.default||r}catch{vt=null}return vt}async function rs(r){if(typeof r!="string")return"";let e=await Ed();return e?.sanitize?e.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:kd,ADD_ATTR:Sd,FORBID_TAGS:["script","foreignObject","iframe","object","embed"],FORBID_ATTR:["onload","onerror","onclick","onmouseover"]}):r.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/\s+on\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/<foreignObject[\s\S]*?<\/foreignObject>/gi,"")}function ns(){return Wt||(typeof window<"u"&&window.trustedTypes?.createPolicy&&(Wt=window.trustedTypes.createPolicy("velinstyle",{createHTML:r=>m(r)})),Wt)}function Td(r){let e=ns(),t=m(Tr(r));return e?.createHTML?e.createHTML(t):t}var gd,yd,_d,xd,wd,es,Ad,vt,kd,Sd,Wt,T=p(()=>{gd={"&":"&","<":"<",">":">",'"':""","'":"'"},yd=/[&<>"']/g,_d=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,xd=new Set(["http:","https:","data:","mailto:","tel:"]),wd=/^data:(?:text\/html|image\/svg\+xml|application\/xml)/i,es=/^data:image\/(png|jpeg|jpg|gif|webp|avif);base64,/i,Ad=new Set(["text","password","email","search","tel","url","number"]);vt=null;kd=["svg","g","path","circle","rect","line","polyline","polygon","ellipse","defs","use","symbol","title","desc","clipPath","mask","linearGradient","radialGradient","stop","pattern","text","tspan"],Sd=["viewBox","xmlns","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","d","cx","cy","r","rx","ry","x","y","width","height","x1","y1","x2","y2","points","transform","opacity","class","id","href","xlink:href","aria-hidden","aria-label","aria-labelledby","role","focusable","clip-path","mask","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","patternUnits","patternContentUnits","preserveAspectRatio"];Wt=null});var ss={};y(ss,{default:()=>os});var Ld,Gt,os,Lr=p(()=>{Z();T();Ld=`
|
|
4
4
|
:host {
|
|
5
5
|
display: contents;
|
|
6
6
|
}
|
|
@@ -82,10 +82,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
82
82
|
@media (prefers-reduced-motion: reduce) {
|
|
83
83
|
.overlay, .dialog { transition: none; }
|
|
84
84
|
}
|
|
85
|
-
`,
|
|
86
|
-
<style>${
|
|
85
|
+
`,Gt=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._previouslyFocused=null,this._onKeydown=this._onKeydown.bind(this)}connectedCallback(){let e=(this.getAttribute("title")||"").trim(),t=m(e),i=e?'aria-labelledby="velin-modal-title"':`aria-label="${m(this.getAttribute("aria-label")||"Dialog")}"`;this.shadowRoot.innerHTML=`
|
|
86
|
+
<style>${Ld}</style>
|
|
87
87
|
<div class="overlay" part="overlay">
|
|
88
|
-
<div class="dialog" role="dialog" aria-modal="true" ${
|
|
88
|
+
<div class="dialog" role="dialog" aria-modal="true" ${i} part="dialog">
|
|
89
89
|
<div class="header" part="header">
|
|
90
90
|
<h2 class="title" id="velin-modal-title"${e?"":' class="velin-sr-only"'}>${t||"Dialog"}</h2>
|
|
91
91
|
<button class="close-btn" aria-label="Close" part="close">×</button>
|
|
@@ -94,7 +94,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
94
94
|
<div class="footer" part="footer"><slot name="footer"></slot></div>
|
|
95
95
|
</div>
|
|
96
96
|
</div>
|
|
97
|
-
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",n=>{n.target===n.currentTarget&&this.close()})}attributeChangedCallback(e,t,
|
|
97
|
+
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",n=>{n.target===n.currentTarget&&this.close()})}attributeChangedCallback(e,t,i){e==="open"&&(i!==null?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._previouslyFocused=ae(),ce(this),document.addEventListener("keydown",this._onKeydown),requestAnimationFrame(()=>{let e=fe(this.shadowRoot);e.length>0&&e[0].focus()})}_close(){document.removeEventListener("keydown",this._onKeydown),G(this),le(this._previouslyFocused)}_onKeydown(e){if(e.key==="Escape"){this.close();return}ee(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKeydown),G(this)}};customElements.define("velin-modal",Gt);os=Gt});var ls={};y(ls,{default:()=>as});var Cd,Yt,as,Cr=p(()=>{Z();Cd=`
|
|
98
98
|
:host {
|
|
99
99
|
display: inline-block;
|
|
100
100
|
position: relative;
|
|
@@ -144,29 +144,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
144
144
|
@media (prefers-reduced-motion: reduce) {
|
|
145
145
|
.menu { transition: none; }
|
|
146
146
|
}
|
|
147
|
-
`,
|
|
148
|
-
<style>${
|
|
147
|
+
`,Yt=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onDocClick=this._onDocClick.bind(this),this._onKeydown=this._onKeydown.bind(this),this._typeahead="",this._typeaheadTimer=null}connectedCallback(){let e=this.getAttribute("align")||"start";this.shadowRoot.innerHTML=`
|
|
148
|
+
<style>${Cd}</style>
|
|
149
149
|
<slot name="trigger"></slot>
|
|
150
150
|
<div class="menu ${e==="end"?"menu-end":""}" role="menu" part="menu">
|
|
151
151
|
<slot></slot>
|
|
152
152
|
</div>
|
|
153
|
-
`;let t=this.shadowRoot.querySelector('slot[name="trigger"]'),
|
|
154
|
-
|
|
153
|
+
`;let t=this.shadowRoot.querySelector('slot[name="trigger"]'),i=this.shadowRoot.querySelector("slot:not([name])");t.addEventListener("click",()=>this.toggle()),t.addEventListener("slotchange",()=>{let n=t.assignedElements()[0];if(n){n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false");let o=this._menuId||(this._menuId=`velin-dropdown-menu-${Math.random().toString(36).slice(2,9)}`);n.setAttribute("aria-controls",o),this.shadowRoot.querySelector(".menu")?.setAttribute("id",o)}}),i?.addEventListener("slotchange",()=>this._normalizeMenuItems()),this._normalizeMenuItems(),this.addEventListener("keydown",this._onKeydown)}_normalizeMenuItems(){this._getMenuItems().forEach((t,i)=>{t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.setAttribute("tabindex",i===0?"0":"-1")})}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open","");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onDocClick,!0),requestAnimationFrame(()=>{let t=this._getMenuItems();t.length>0&&t[0].focus()})}close(){this.removeAttribute("open");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._onDocClick,!0),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_getMenuItems(){let e=this.shadowRoot.querySelector("slot:not([name])");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_onDocClick(e){this.contains(e.target)||this.close()}_onKeydown(e){if(e.key==="Escape"){this.close();let i=this.querySelector('[slot="trigger"]');i&&i.focus();return}let t=this._getMenuItems();if(t.length!==0){if(e.key.length===1&&/[a-z0-9]/i.test(e.key)){clearTimeout(this._typeaheadTimer),this._typeahead+=e.key.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeahead=""},500);let i=t.find(n=>(n.textContent?.trim().toLowerCase()||"").startsWith(this._typeahead));i&&(e.preventDefault(),t.forEach(n=>n.setAttribute("tabindex",n===i?"0":"-1")),i.focus());return}te(this,t,e)}}disconnectedCallback(){document.removeEventListener("click",this._onDocClick,!0)}};customElements.define("velin-dropdown",Yt);as=Yt});var us={};y(us,{default:()=>ds});function Id(){if(typeof document>"u"||document.getElementById(cs))return;let r=document.createElement("style");r.id=cs,r.textContent=Rd,document.head.appendChild(r)}var cs,Rd,Md,Vt,ds,Rr=p(()=>{cs="velin-accordion-light-css",Rd=`
|
|
154
|
+
velin-accordion {
|
|
155
155
|
display: block;
|
|
156
156
|
border: 1px solid var(--velin-color-border, #ddd);
|
|
157
157
|
border-radius: var(--velin-radius-md, 0.5rem);
|
|
158
158
|
overflow: hidden;
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
velin-accordion details {
|
|
161
161
|
border-bottom: 1px solid var(--velin-color-border, #ddd);
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
velin-accordion details:last-child {
|
|
164
164
|
border-bottom: none;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
velin-accordion details > summary {
|
|
167
167
|
display: flex;
|
|
168
168
|
align-items: center;
|
|
169
169
|
justify-content: space-between;
|
|
170
|
+
gap: var(--velin-space-3, 0.75rem);
|
|
170
171
|
padding: var(--velin-space-4, 1rem);
|
|
171
172
|
min-block-size: 2.75rem;
|
|
172
173
|
font-size: var(--velin-text-base, 1rem);
|
|
@@ -175,25 +176,42 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
175
176
|
user-select: none;
|
|
176
177
|
list-style: none;
|
|
177
178
|
}
|
|
178
|
-
|
|
179
|
+
velin-accordion details > summary::-webkit-details-marker {
|
|
179
180
|
display: none;
|
|
180
181
|
}
|
|
181
|
-
|
|
182
|
+
velin-accordion details > summary::after {
|
|
183
|
+
content: "";
|
|
184
|
+
flex-shrink: 0;
|
|
185
|
+
inline-size: 0.5rem;
|
|
186
|
+
block-size: 0.5rem;
|
|
187
|
+
border-inline-end: 2px solid currentColor;
|
|
188
|
+
border-block-end: 2px solid currentColor;
|
|
189
|
+
transform: rotate(45deg);
|
|
190
|
+
transition: transform 150ms ease;
|
|
191
|
+
}
|
|
192
|
+
velin-accordion details[open] > summary {
|
|
182
193
|
background: var(--velin-color-primary-subtle, #eff6ff);
|
|
183
194
|
color: var(--velin-color-primary, #2563eb);
|
|
184
195
|
}
|
|
185
|
-
|
|
196
|
+
velin-accordion details[open] > summary::after {
|
|
197
|
+
transform: rotate(225deg);
|
|
198
|
+
}
|
|
199
|
+
velin-accordion details > :not(summary) {
|
|
186
200
|
padding: var(--velin-space-4, 1rem) var(--velin-space-5, 1.25rem);
|
|
187
|
-
background: var(--velin-color-bg-subtle, #f8fafc);
|
|
201
|
+
background: var(--velin-color-surface-dim, var(--velin-color-bg-subtle, #f8fafc));
|
|
188
202
|
color: var(--velin-color-text-muted, #64748b);
|
|
189
203
|
font-size: var(--velin-text-sm, 0.875rem);
|
|
190
204
|
line-height: 1.6;
|
|
191
205
|
border-block-start: 1px solid var(--velin-color-border, #e2e8f0);
|
|
192
206
|
}
|
|
193
|
-
`,
|
|
194
|
-
|
|
207
|
+
`,Md=`
|
|
208
|
+
:host {
|
|
209
|
+
display: block;
|
|
210
|
+
}
|
|
211
|
+
`;Vt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onToggle=this._onToggle.bind(this),this._onKeydown=this._onKeydown.bind(this)}connectedCallback(){Id(),this.shadowRoot.innerHTML=`
|
|
212
|
+
<style>${Md}</style>
|
|
195
213
|
<slot></slot>
|
|
196
|
-
`,this._exclusive=this.hasAttribute("exclusive"),this._wireDetails(),this.addEventListener("toggle",this._onToggle,!0),this.addEventListener("keydown",this._onKeydown
|
|
214
|
+
`,this._exclusive=this.hasAttribute("exclusive"),this._wireDetails(),this.addEventListener("toggle",this._onToggle,!0),this.addEventListener("keydown",this._onKeydown)}_wireDetails(){let e=0;for(let t of this.querySelectorAll("details")){let i=t.querySelector("summary"),n=t.querySelector(":scope > :not(summary)"),o=n?.id||`velin-accordion-panel-${++e}`;n&&!n.id&&(n.id=o),i&&n&&(i.setAttribute("aria-controls",o),i.setAttribute("aria-expanded",t.open?"true":"false")),i&&!i.hasAttribute("tabindex")&&i.setAttribute("tabindex","0")}}_onToggle(e){let t=e.target;if(!(t instanceof HTMLDetailsElement))return;let i=t.querySelector("summary");if(i&&i.setAttribute("aria-expanded",t.open?"true":"false"),!this._exclusive||!t.open)return;[...this.querySelectorAll("details")].forEach(o=>{o!==t&&o.open&&(o.open=!1)})}_onKeydown(e){let t=[...this.querySelectorAll("summary")],i=t.indexOf(e.target);if(i===-1)return;let n;switch(e.key){case"ArrowDown":e.preventDefault(),n=(i+1)%t.length;break;case"ArrowUp":e.preventDefault(),n=(i-1+t.length)%t.length;break;case"Home":e.preventDefault(),n=0;break;case"End":e.preventDefault(),n=t.length-1;break;case"Enter":case" ":return;default:return}t[n].focus()}disconnectedCallback(){this.removeEventListener("toggle",this._onToggle,!0),this.removeEventListener("keydown",this._onKeydown)}};customElements.define("velin-accordion",Vt);ds=Vt});var ps={};y(ps,{default:()=>hs});var Dd,Xt,hs,Mr=p(()=>{Z();Dd=`
|
|
197
215
|
:host {
|
|
198
216
|
display: block;
|
|
199
217
|
}
|
|
@@ -235,15 +253,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
235
253
|
::slotted([role="tabpanel"][hidden]) {
|
|
236
254
|
display: none;
|
|
237
255
|
}
|
|
238
|
-
`,
|
|
239
|
-
<style>${
|
|
256
|
+
`,Xt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onTabClick=this._onTabClick.bind(this),this._onKeydown=this._onKeydown.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
257
|
+
<style>${Dd}</style>
|
|
240
258
|
<div class="tablist" role="tablist" part="tablist">
|
|
241
259
|
<slot name="tab"></slot>
|
|
242
260
|
</div>
|
|
243
261
|
<div class="panels" part="panels">
|
|
244
262
|
<slot name="panel"></slot>
|
|
245
263
|
</div>
|
|
246
|
-
`,this.addEventListener("click",this._onTabClick),this.addEventListener("keydown",this._onKeydown),requestAnimationFrame(()=>this._initTabs())}_initTabs(){let e=this._getTabs(),t=this._getPanels();e.forEach((n,o)=>{n.setAttribute("role","tab"),n.setAttribute("slot","tab"),n.id||(n.id=`velin-tab-${o}`);let a=t[o];a&&(a.setAttribute("role","tabpanel"),a.setAttribute("slot","panel"),a.id||(a.id=`velin-panel-${o}`),n.setAttribute("aria-controls",a.id),a.setAttribute("aria-labelledby",n.id))});let
|
|
264
|
+
`,this.addEventListener("click",this._onTabClick),this.addEventListener("keydown",this._onKeydown),requestAnimationFrame(()=>this._initTabs())}_initTabs(){let e=this._getTabs(),t=this._getPanels();e.forEach((n,o)=>{n.setAttribute("role","tab"),n.setAttribute("slot","tab"),n.id||(n.id=`velin-tab-${o}`);let a=t[o];a&&(a.setAttribute("role","tabpanel"),a.setAttribute("slot","panel"),a.id||(a.id=`velin-panel-${o}`),n.setAttribute("aria-controls",a.id),a.setAttribute("aria-labelledby",n.id))});let i=e.find(n=>n.getAttribute("aria-selected")==="true")||e[0];i&&this._selectTab(i)}_getTabs(){return[...this.querySelectorAll('[role="tab"], [slot="tab"]')]}_getPanels(){return[...this.querySelectorAll('[role="tabpanel"], [slot="panel"]')]}_onTabClick(e){let t=e.target.closest('[role="tab"]');t&&this.contains(t)&&this._selectTab(t)}_selectTab(e){let t=this._getTabs(),i=this._getPanels();t.forEach((n,o)=>{let a=n===e;n.setAttribute("aria-selected",String(a)),n.setAttribute("tabindex",a?"0":"-1"),i[o]&&(i[o].hidden=!a)}),this.dispatchEvent(new CustomEvent("velin-tab-change",{bubbles:!0,detail:{tab:e}}))}_onKeydown(e){let t=this._getTabs();if(t.includes(e.target)&&(te(this,t,e),e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Home"||e.key==="End")){let i=t.find(n=>n.getAttribute("tabindex")==="0");i&&this._selectTab(i)}}disconnectedCallback(){this.removeEventListener("click",this._onTabClick),this.removeEventListener("keydown",this._onKeydown)}};customElements.define("velin-tabs",Xt);hs=Xt});var fs={};y(fs,{default:()=>ms});var Od,Zt,ms,Ir=p(()=>{T();Od=`
|
|
247
265
|
:host {
|
|
248
266
|
position: fixed;
|
|
249
267
|
z-index: var(--velin-z-toast, 600);
|
|
@@ -305,10 +323,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
305
323
|
@media (prefers-reduced-motion: reduce) {
|
|
306
324
|
.toast, .toast--out { animation: none; }
|
|
307
325
|
}
|
|
308
|
-
`,
|
|
309
|
-
<div class="toast-content">${
|
|
326
|
+
`,Zt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._container=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${Od}</style>`,this._container=this.shadowRoot,this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true")}show({message:e,type:t="info",duration:i=5e3}={}){let n=t==="error"||t==="danger";this.setAttribute("role",n?"alert":"status"),this.setAttribute("aria-live",n?"assertive":"polite");let o=document.createElement("div");return o.className=`toast toast--${t}`,o.setAttribute("role",n?"alert":"status"),o.innerHTML=`
|
|
327
|
+
<div class="toast-content">${m(e)}</div>
|
|
310
328
|
<button class="toast-close" aria-label="Close">×</button>
|
|
311
|
-
`,o.querySelector(".toast-close").addEventListener("click",()=>{this._dismiss(o)}),this._container.appendChild(o),
|
|
329
|
+
`,o.querySelector(".toast-close").addEventListener("click",()=>{this._dismiss(o)}),this._container.appendChild(o),i>0&&setTimeout(()=>this._dismiss(o),i),o}_dismiss(e){!e||!e.parentNode||(e.classList.add("toast--out"),e.addEventListener("animationend",()=>e.remove(),{once:!0}),setTimeout(()=>e.remove(),300))}};customElements.define("velin-toast",Zt);ms=Zt});var vs={};y(vs,{default:()=>bs});function Nd(r,e){let t=Qt[r];return e&&t?.[e]?t[e]:Jt[r]}function zd(){if(typeof document<"u"){let t=document.querySelector('meta[name="velin-icon-sprite"]')?.getAttribute("content")?.trim();if(t)return t;let i=document.documentElement?.getAttribute("data-velin-icon-sprite")?.trim();if(i)return i}return(typeof Je.defaultSprite=="string"?Je.defaultSprite.trim():"")||Or}var Jt,Qt,Dr,Or,Je,bs,Nr=p(()=>{T();Jt={lucide:"https://unpkg.com/lucide-static@latest/icons/{name}.svg",heroicons:"https://unpkg.com/heroicons@2/24/outline/{name}.svg",bootstrap:"https://unpkg.com/bootstrap-icons@latest/icons/{name}.svg",material:"https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/{name}/default/24px.svg",fontawesome:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/solid/{name}.svg"},Qt={fontawesome:{regular:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/regular/{name}.svg",solid:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/solid/{name}.svg",brands:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/brands/{name}.svg"},heroicons:{outline:"https://unpkg.com/heroicons@2/24/outline/{name}.svg",solid:"https://unpkg.com/heroicons@2/24/solid/{name}.svg",mini:"https://unpkg.com/heroicons@2/20/solid/{name}.svg"}};Dr=new Map,Or="velin-icons.svg";Je=class extends HTMLElement{static defaultSprite=Or;static get observedAttributes(){return["name","size","label","provider","variant","sprite"]}constructor(){super(),this._rendered=!1}connectedCallback(){this._render()}attributeChangedCallback(){this._rendered&&this._render()}_render(){let e=this.getAttribute("name"),t=this.getAttribute("size")||"24",i=this._resolveA11y(),n=this.getAttribute("provider"),o=this.getAttribute("variant");if(!e){this.innerHTML="";return}if(n&&(Jt[n]||Qt[n])){this._renderFromCDN(e,t,i,n,o);return}this._renderFromSprite(e,t,i)}_resolveA11y(){let e=(this.getAttribute("label")||this.getAttribute("aria-label")||"").trim();return e?{label:e,hidden:!1}:{label:"",hidden:this.getAttribute("aria-hidden")!=="false"}}_renderFromSprite(e,t,i){let n="http://www.w3.org/2000/svg",o=document.createElementNS(n,"svg");o.setAttribute("width",t),o.setAttribute("height",t),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),this._applyStyle(o);let a=document.createElementNS(n,"use"),c=this.getAttribute("sprite"),u=document.getElementById(e),f=u&&u.tagName&&u.tagName.toLowerCase()==="symbol",_;if(c===""||c==null&&f)_=`#${e}`;else{let b=zd();_=`${$e(c||b)||b||Or}#${e}`}a.setAttribute("href",_),o.appendChild(a),this._applyA11y(o,i),this.innerHTML="",this.appendChild(o),this._rendered=!0}async _renderFromCDN(e,t,i,n,o){let a=`${n}:${o||"default"}:${e}`;if(Dr.has(a)){this._injectSVG(Dr.get(a),t,i);return}let c=Nd(n,o);if(!c){this._renderFromSprite(e,t,i);return}let u=$e(c.replace("{name}",e));if(!u){this._renderFromSprite(e,t,i);return}try{let f=await fetch(u);if(!f.ok)throw new Error(`${f.status}`);let _=await f.text();if(!_.includes("<svg"))throw new Error("Not SVG");let b=await rs(_);Dr.set(a,b),this._injectSVG(b,t,i)}catch{this._renderFromSprite(e,t,i)}}_stripForeignA11y(e){e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-hidden"),e.querySelector("title")?.remove(),e.querySelector("desc")?.remove()}_injectSVG(e,t,i){let a=new DOMParser().parseFromString(e,"image/svg+xml").querySelector("svg");if(!a){this.innerHTML="";return}this._stripForeignA11y(a),a.setAttribute("width",t),a.setAttribute("height",t),a.getAttribute("viewBox")||a.setAttribute("viewBox","0 0 24 24"),this._applyStyle(a),this._applyA11y(a,i),this.innerHTML="",this.appendChild(document.importNode(a,!0)),this._rendered=!0}_applyStyle(e){e.style.display="inline-block",e.style.verticalAlign="middle",e.style.flexShrink="0"}_applyA11y(e,t){let{label:i,hidden:n}=t,o=e.querySelector("use");i?(e.setAttribute("role","img"),e.setAttribute("aria-label",i),e.removeAttribute("aria-hidden"),e.removeAttribute("focusable"),o&&o.removeAttribute("aria-hidden")):n&&(e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.removeAttribute("aria-label"),o&&(o.setAttribute("aria-hidden","true"),o.setAttribute("focusable","false")))}static get providers(){return Object.keys(Jt)}static registerProvider(e,t,i){Jt[e]=t,i&&Qt[e]&&Object.assign(Qt[e],i)}};customElements.define("velin-icon",Je);bs=Je});var ys={};y(ys,{default:()=>gs});var $d,ei,gs,zr=p(()=>{Z();T();$d=`
|
|
312
330
|
:host { display: contents; }
|
|
313
331
|
.overlay {
|
|
314
332
|
position: fixed;
|
|
@@ -353,17 +371,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
353
371
|
.close-btn:hover { background: var(--velin-color-surface-dim, #eee); color: var(--velin-color-text, #111); }
|
|
354
372
|
.body { flex: 1; padding: var(--velin-space-5, 1.25rem); overflow-y: auto; }
|
|
355
373
|
@media (prefers-reduced-motion: reduce) { .overlay, .drawer { transition: none; } }
|
|
356
|
-
`,
|
|
357
|
-
<style>${
|
|
374
|
+
`,ei=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._prev=null,this._onKey=this._onKey.bind(this)}connectedCallback(){let e=this.getAttribute("title")||"",t=m(e),i="velin-drawer-title";this.shadowRoot.innerHTML=`
|
|
375
|
+
<style>${$d}</style>
|
|
358
376
|
<div class="overlay" part="overlay"></div>
|
|
359
|
-
<div class="drawer" role="dialog" aria-modal="true" aria-labelledby="${
|
|
377
|
+
<div class="drawer" role="dialog" aria-modal="true" aria-labelledby="${i}" part="drawer">
|
|
360
378
|
<div class="header" part="header">
|
|
361
|
-
<h2 class="title" id="${
|
|
379
|
+
<h2 class="title" id="${i}">${t}</h2>
|
|
362
380
|
<button class="close-btn" aria-label="Close" part="close">×</button>
|
|
363
381
|
</div>
|
|
364
382
|
<div class="body" part="body"><slot></slot></div>
|
|
365
383
|
</div>
|
|
366
|
-
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close())}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=
|
|
384
|
+
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close())}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=ae(),ce(this),document.addEventListener("keydown",this._onKey),requestAnimationFrame(()=>{let e=fe(this.shadowRoot);e.length&&e[0].focus()})}_close(){document.removeEventListener("keydown",this._onKey),G(this),le(this._prev)}_onKey(e){if(e.key==="Escape"){this.close();return}ee(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKey),G(this)}};customElements.define("velin-drawer",ei);gs=ei});var xs={};y(xs,{default:()=>_s});function Pd(r,e){if(!r||Hd.has(r)||$r.has(r))return;if(document.querySelector(`link[data-velin-theme-css="${r}"]`)){$r.add(r);return}let i=document.createElement("link");i.rel="stylesheet",i.href=`${e.replace(/\/$/,"")}/${r}.min.css`,i.setAttribute("data-velin-theme-css",r),document.head.appendChild(i),$r.add(r)}var Fd,Hd,$r,qd,ti,_s,Fr=p(()=>{Fd=[{slug:"",label:"Default (Light)"},{slug:"dark",label:"Dark"},{slug:"brutalist",label:"Brutalist"},{slug:"corporate",label:"Corporate"},{slug:"earth",label:"Earth"},{slug:"forest",label:"Forest"},{slug:"midnight",label:"Midnight"},{slug:"neon",label:"Neon"},{slug:"nordic",label:"Nordic"},{slug:"ocean",label:"Ocean"},{slug:"pastel",label:"Pastel"},{slug:"retro",label:"Retro"},{slug:"sharp",label:"Sharp"},{slug:"soft",label:"Soft"},{slug:"sunset",label:"Sunset"}],Hd=new Set(["","dark"]),$r=new Set;qd=`
|
|
367
385
|
:host { display: inline-flex; position: relative; }
|
|
368
386
|
.group {
|
|
369
387
|
display: inline-flex; align-items: stretch;
|
|
@@ -442,8 +460,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
442
460
|
background: currentColor;
|
|
443
461
|
border: 1px solid var(--velin-color-border, #ddd);
|
|
444
462
|
}
|
|
445
|
-
`,
|
|
446
|
-
<style>${
|
|
463
|
+
`,ti=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onDocClick=this._onDocClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
464
|
+
<style>${qd}</style>
|
|
447
465
|
<div class="group" part="group">
|
|
448
466
|
<button class="toggle" part="button" aria-label="Toggle dark mode" aria-pressed="false">
|
|
449
467
|
<svg class="sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false">
|
|
@@ -463,14 +481,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
463
481
|
</button>
|
|
464
482
|
</div>
|
|
465
483
|
<ul class="menu" role="menu" aria-label="Theme selection" hidden></ul>
|
|
466
|
-
`,this._target=document.querySelector(this.getAttribute("target")||"html"),this._themesBase=this.getAttribute("themes-base")||"dist/themes",this._menu=this.shadowRoot.querySelector(".menu"),this._toggleBtn=this.shadowRoot.querySelector(".toggle"),this._pickerBtn=this.shadowRoot.querySelector(".picker"),this._renderMenu(),this._initPreference(),this._syncTogglePressed(),this._toggleBtn.addEventListener("click",()=>this._toggleDarkMode()),this._pickerBtn.addEventListener("click",t=>{t.stopPropagation(),this._toggleMenu()}),document.addEventListener("click",this._onDocClick),this.shadowRoot.addEventListener("keydown",this._onKeyDown),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>this._applyFromPreference()),window.addEventListener("storage",t=>{t.key==="velin-theme"&&this._readStorage()})}disconnectedCallback(){document.removeEventListener("click",this._onDocClick)}_renderMenu(){this._menu.innerHTML=
|
|
484
|
+
`,this._target=document.querySelector(this.getAttribute("target")||"html"),this._themesBase=this.getAttribute("themes-base")||"dist/themes",this._menu=this.shadowRoot.querySelector(".menu"),this._toggleBtn=this.shadowRoot.querySelector(".toggle"),this._pickerBtn=this.shadowRoot.querySelector(".picker"),this._renderMenu(),this._initPreference(),this._syncTogglePressed(),this._toggleBtn.addEventListener("click",()=>this._toggleDarkMode()),this._pickerBtn.addEventListener("click",t=>{t.stopPropagation(),this._toggleMenu()}),document.addEventListener("click",this._onDocClick),this.shadowRoot.addEventListener("keydown",this._onKeyDown),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>this._applyFromPreference()),window.addEventListener("storage",t=>{t.key==="velin-theme"&&this._readStorage()})}disconnectedCallback(){document.removeEventListener("click",this._onDocClick)}_renderMenu(){this._menu.innerHTML=Fd.map(e=>`
|
|
467
485
|
<li role="none">
|
|
468
486
|
<button type="button" role="menuitem" data-theme="${e.slug}">
|
|
469
487
|
<span class="swatch" aria-hidden="true" data-theme-swatch="${e.slug}"></span>
|
|
470
488
|
${e.label}
|
|
471
489
|
</button>
|
|
472
490
|
</li>
|
|
473
|
-
`).join(""),this._menu.removeAttribute("hidden"),this._menu.querySelectorAll("button[data-theme]").forEach(e=>{e.addEventListener("click",()=>{let t=e.getAttribute("data-theme");this._applyTheme(t,{persist:!0}),this._closeMenu()})})}_toggleMenu(){this.hasAttribute("menu-open")?this._closeMenu():this._openMenu()}_openMenu(){this.setAttribute("menu-open",""),this._pickerBtn.setAttribute("aria-expanded","true"),this._highlightActive();let e=this._menu.querySelector("button[data-theme]");e&&e.focus()}_closeMenu(){this.removeAttribute("menu-open"),this._pickerBtn.setAttribute("aria-expanded","false")}_onDocClick(e){this.hasAttribute("menu-open")&&(e.composedPath().includes(this)||this._closeMenu())}_onKeyDown(e){if(this.hasAttribute("menu-open")){if(e.key==="Escape"){e.preventDefault(),this._closeMenu(),this._pickerBtn.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();let t=Array.from(this._menu.querySelectorAll("button[data-theme]")),
|
|
491
|
+
`).join(""),this._menu.removeAttribute("hidden"),this._menu.querySelectorAll("button[data-theme]").forEach(e=>{e.addEventListener("click",()=>{let t=e.getAttribute("data-theme");this._applyTheme(t,{persist:!0}),this._closeMenu()})})}_toggleMenu(){this.hasAttribute("menu-open")?this._closeMenu():this._openMenu()}_openMenu(){this.setAttribute("menu-open",""),this._pickerBtn.setAttribute("aria-expanded","true"),this._highlightActive();let e=this._menu.querySelector("button[data-theme]");e&&e.focus()}_closeMenu(){this.removeAttribute("menu-open"),this._pickerBtn.setAttribute("aria-expanded","false")}_onDocClick(e){this.hasAttribute("menu-open")&&(e.composedPath().includes(this)||this._closeMenu())}_onKeyDown(e){if(this.hasAttribute("menu-open")){if(e.key==="Escape"){e.preventDefault(),this._closeMenu(),this._pickerBtn.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();let t=Array.from(this._menu.querySelectorAll("button[data-theme]")),i=t.indexOf(this.shadowRoot.activeElement);(e.key==="ArrowDown"?t[(i+1)%t.length]:t[(i-1+t.length)%t.length])?.focus()}}}_highlightActive(){let e=this._currentSlug();this._menu.querySelectorAll("button[data-theme]").forEach(t=>{t.getAttribute("data-theme")===e?t.setAttribute("aria-current","true"):t.removeAttribute("aria-current")})}_currentSlug(){if(!this._target)return"";let e=this._target.getAttribute("data-velin-theme");return!e||e==="light"?"":e}_initPreference(){let e=localStorage.getItem("velin-theme");if(e){this._applyTheme(e,{persist:!1});return}this._applyFromPreference()}_readStorage(){let e=localStorage.getItem("velin-theme");this._applyTheme(e||"",{persist:!1})}_applyFromPreference(){if(localStorage.getItem("velin-theme"))return;let e=window.matchMedia("(prefers-color-scheme: dark)").matches;this._applyTheme(e?"dark":"",{persist:!1})}_applyTheme(e,{persist:t}){let i=!e||e==="light"?"":e;this._target&&(i?(this._target.setAttribute("data-velin-theme",i),this.setAttribute("theme",i==="dark"?"dark":i),Pd(i,this._themesBase)):(this._target.removeAttribute("data-velin-theme"),this.removeAttribute("theme")),t&&(i?localStorage.setItem("velin-theme",i):localStorage.removeItem("velin-theme")),this._highlightActive(),this.dispatchEvent(new CustomEvent("velin-theme-change",{bubbles:!0,detail:{theme:i||"light",dark:i==="dark",slug:i}})))}_syncTogglePressed(){let e=this._currentSlug()==="dark";this._toggleBtn?.setAttribute("aria-pressed",e?"true":"false")}_toggleDarkMode(){let t=this._currentSlug()==="dark"?"":"dark";this._applyTheme(t,{persist:!0}),this._syncTogglePressed()}};customElements.define("velin-theme-toggle",ti);_s=ti});var As={};y(As,{default:()=>ws});var Bd,Ud,ii,ws,Hr=p(()=>{T();Z();Bd=`
|
|
474
492
|
:host { position: relative; display: inline-block; }
|
|
475
493
|
.popover {
|
|
476
494
|
position: absolute; z-index: var(--velin-z-dropdown, 200);
|
|
@@ -495,14 +513,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
495
513
|
border-bottom: 1px solid var(--velin-color-border, #ddd);
|
|
496
514
|
}
|
|
497
515
|
@media (prefers-reduced-motion: reduce) { .popover { transition: none; } }
|
|
498
|
-
`,
|
|
499
|
-
<style>${
|
|
516
|
+
`,Ud=0,ii=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open"}),this._popoverId=`velin-popover-${++Ud}`,this._onOutside=this._onOutside.bind(this),this._onKey=this._onKey.bind(this),this._prevFocus=null,this._isDialog=!1}connectedCallback(){let e=this.getAttribute("placement")||"bottom",t=this.getAttribute("trigger")||"click",i=this.getAttribute("title")||"",n=t==="hover"?"tooltip":"dialog";this._isDialog=n==="dialog";let o=i?`${this._popoverId}-title`:"";this.shadowRoot.innerHTML=`
|
|
517
|
+
<style>${Bd}</style>
|
|
500
518
|
<slot name="trigger"></slot>
|
|
501
519
|
<div class="popover popover--${e}" id="${this._popoverId}" role="${n}" part="popover"${o?` aria-labelledby="${o}"`:""}>
|
|
502
|
-
${
|
|
520
|
+
${i?`<div class="popover__title" id="${o}" part="title">${m(i)}</div>`:""}
|
|
503
521
|
<slot></slot>
|
|
504
522
|
</div>
|
|
505
|
-
`;let a=this.shadowRoot.querySelector(".popover");if(!
|
|
523
|
+
`;let a=this.shadowRoot.querySelector(".popover");if(!i&&a){let u=this.getAttribute("aria-label")||(n==="tooltip"?"Tooltip":"Popover");a.setAttribute("aria-label",u)}this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger(t)),this._wireTrigger(t)}_ensureTriggerInteractive(e){let t=e.tagName;t!=="BUTTON"&&t!=="A"&&e.getAttribute("role")!=="button"&&(e.setAttribute("role","button"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"))}_onTriggerKey(e){if(e.key==="Escape"){this.close();return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.toggle())}_wireTrigger(e){let t=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];if(!t)return;this._ensureTriggerInteractive(t);let i=e==="hover";t.setAttribute("aria-haspopup",i?"true":"dialog"),t.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),this._isDialog&&t.setAttribute("aria-controls",this._popoverId),t.removeEventListener("keydown",this._onTriggerKeyBound),this._onTriggerKeyBound=this._onTriggerKeyBound||this._onTriggerKey.bind(this),t.addEventListener("keydown",this._onTriggerKeyBound),e==="click"?t.onclick=()=>this.toggle():e==="hover"?(this.onmouseenter=()=>this.open(),this.onmouseleave=()=>this.close(),this.onfocusin=()=>this.open(),this.onfocusout=n=>{this.contains(n.relatedTarget)||this.close()}):e==="focus"&&(t.onfocusin=()=>this.open(),t.onfocusout=()=>this.close())}open(){this.setAttribute("open","");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onOutside,!0),document.addEventListener("keydown",this._onKey),this._isDialog&&(this._prevFocus=ae(),requestAnimationFrame(()=>{let t=fe(this.shadowRoot.querySelector(".popover"));t.length?t[0].focus():this.shadowRoot.querySelector(".popover")?.focus()}))}close(){this.removeAttribute("open");let e=this.querySelector('[slot="trigger"]');e&&e.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._onOutside,!0),document.removeEventListener("keydown",this._onKey),this._isDialog&&this._prevFocus&&(le(this._prevFocus),this._prevFocus=null)}toggle(){this.hasAttribute("open")?this.close():this.open()}_onOutside(e){this.contains(e.target)||this.close()}_onKey(e){if(e.key==="Escape"){this.close();let t=this.querySelector('[slot="trigger"]');t&&t.focus();return}this._isDialog&&this.hasAttribute("open")&&ee(this.shadowRoot.querySelector(".popover"),e)}disconnectedCallback(){document.removeEventListener("click",this._onOutside,!0),document.removeEventListener("keydown",this._onKey)}};customElements.define("velin-popover",ii);ws=ii});var ks={};y(ks,{default:()=>Es});var jd,ri,Es,Pr=p(()=>{T();jd=`
|
|
506
524
|
:host { display: inline-flex; }
|
|
507
525
|
button {
|
|
508
526
|
display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
|
|
@@ -522,8 +540,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
522
540
|
button[data-copied] .copy-icon { display: none; }
|
|
523
541
|
button[data-copied] .check { display: block; }
|
|
524
542
|
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
|
|
525
|
-
`,
|
|
526
|
-
<style>${
|
|
543
|
+
`,ri=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let e=m(this.getAttribute("label")||"");this.shadowRoot.innerHTML=`
|
|
544
|
+
<style>${jd}</style>
|
|
527
545
|
<button part="button" aria-label="Copy">
|
|
528
546
|
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
529
547
|
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
@@ -533,7 +551,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
533
551
|
</svg>
|
|
534
552
|
${e?`<span>${e}</span>`:""}
|
|
535
553
|
</button>
|
|
536
|
-
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>this._copy())}_getCopyText(){return this.getAttribute("value")||this.getAttribute("text")||this.dataset.source||""}async _copy(){let e=this._getCopyText();if(!e)return;try{await navigator.clipboard.writeText(e)}catch{let
|
|
554
|
+
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>this._copy())}_getCopyText(){return this.getAttribute("value")||this.getAttribute("text")||this.dataset.source||""}async _copy(){let e=this._getCopyText();if(!e)return;try{await navigator.clipboard.writeText(e)}catch{let i=document.createElement("textarea");i.value=e,i.style.cssText="position:fixed;opacity:0",document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove()}let t=this.shadowRoot.querySelector("button");t.setAttribute("data-copied",""),t.setAttribute("aria-label","Copied"),this.dispatchEvent(new CustomEvent("velin-copied",{bubbles:!0,detail:{value:e}})),setTimeout(()=>{t.removeAttribute("data-copied"),t.setAttribute("aria-label","Copy")},2e3)}};customElements.get("velin-copy")||customElements.define("velin-copy",ri);Es=ri});var Ts={};y(Ts,{default:()=>Ss});var Kd,ni,Ss,qr=p(()=>{Kd=`
|
|
537
555
|
:host { position: fixed; inset-block-end: var(--velin-scroll-top-bottom, var(--velin-space-4, 1rem)); inset-inline-end: var(--velin-scroll-top-end, var(--velin-space-4, 1rem)); z-index: var(--velin-z-fixed, 300); }
|
|
538
556
|
button {
|
|
539
557
|
display: inline-flex; align-items: center; justify-content: center;
|
|
@@ -549,14 +567,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
549
567
|
:host([visible]) button { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
550
568
|
svg { width: 1.25rem; height: 1.25rem; }
|
|
551
569
|
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
|
|
552
|
-
`,
|
|
553
|
-
<style>${
|
|
570
|
+
`,ni=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onScroll=this._onScroll.bind(this)}connectedCallback(){let e=parseInt(this.getAttribute("threshold")||"300",10);this._threshold=e,this.shadowRoot.innerHTML=`
|
|
571
|
+
<style>${Kd}</style>
|
|
554
572
|
<button part="button" aria-label="Scroll to top">
|
|
555
573
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
|
|
556
574
|
<line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/>
|
|
557
575
|
</svg>
|
|
558
576
|
</button>
|
|
559
|
-
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:t?"auto":"smooth"})}),window.addEventListener("scroll",this._onScroll,{passive:!0}),this._onScroll()}_onScroll(){window.scrollY>this._threshold?this.setAttribute("visible",""):this.removeAttribute("visible")}disconnectedCallback(){window.removeEventListener("scroll",this._onScroll)}};customElements.define("velin-scroll-top",
|
|
577
|
+
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:t?"auto":"smooth"})}),window.addEventListener("scroll",this._onScroll,{passive:!0}),this._onScroll()}_onScroll(){window.scrollY>this._threshold?this.setAttribute("visible",""):this.removeAttribute("visible")}disconnectedCallback(){window.removeEventListener("scroll",this._onScroll)}};customElements.define("velin-scroll-top",ni);Ss=ni});var Cs={};y(Cs,{default:()=>Ls});var Wd,oi,Ls,Br=p(()=>{Wd=`
|
|
560
578
|
:host { display: block; position: relative; overflow: hidden; }
|
|
561
579
|
.track {
|
|
562
580
|
display: flex; transition: transform 400ms ease;
|
|
@@ -607,8 +625,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
607
625
|
.dot[aria-current="true"]::before { background: var(--velin-color-primary, #2563eb); transform: scale(1.3); }
|
|
608
626
|
.dot:focus-visible { outline: 2px solid var(--velin-color-focus, #2563eb); outline-offset: 2px; }
|
|
609
627
|
@media (prefers-reduced-motion: reduce) { .track { transition: none; } }
|
|
610
|
-
`,
|
|
611
|
-
<style>${
|
|
628
|
+
`,oi=class extends HTMLElement{static get observedAttributes(){return["autoplay","interval"]}constructor(){super(),this.attachShadow({mode:"open"}),this._index=0,this._timer=null,this._startX=0,this._autoplayPaused=!1}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
629
|
+
<style>${Wd}</style>
|
|
612
630
|
<div class="track" role="group" aria-roledescription="carousel" part="track"><slot></slot></div>
|
|
613
631
|
<div class="controls" part="controls">
|
|
614
632
|
<button class="prev" aria-label="Previous slide" part="prev">
|
|
@@ -619,7 +637,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
619
637
|
</button>
|
|
620
638
|
</div>
|
|
621
639
|
<div class="indicators" role="group" aria-label="Slide indicators" part="indicators"></div>
|
|
622
|
-
`,this.shadowRoot.querySelector(".prev").addEventListener("click",()=>this.prev()),this.shadowRoot.querySelector(".next").addEventListener("click",()=>this.next());let e=this.shadowRoot.querySelector(".track");e.addEventListener("touchstart",
|
|
640
|
+
`,this.shadowRoot.querySelector(".prev").addEventListener("click",()=>this.prev()),this.shadowRoot.querySelector(".next").addEventListener("click",()=>this.next());let e=this.shadowRoot.querySelector(".track");e.addEventListener("touchstart",i=>{this._startX=i.touches[0].clientX},{passive:!0}),e.addEventListener("touchend",i=>{let n=this._startX-i.changedTouches[0].clientX;Math.abs(n)>50&&(n>0?this.next():this.prev())}),this.addEventListener("mouseenter",()=>this._pause()),this.addEventListener("mouseleave",()=>this._resume()),this.addEventListener("focusin",()=>this._pause()),this.addEventListener("focusout",()=>this._resume()),this.addEventListener("keydown",i=>{i.key==="ArrowLeft"?(this.prev(),i.preventDefault()):i.key==="ArrowRight"?(this.next(),i.preventDefault()):i.key==="Home"?(this.goTo(0),i.preventDefault()):i.key==="End"&&(this.goTo(this._count-1),i.preventDefault())}),this.hasAttribute("role")||this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>{this._buildDots(),this._update()}),this.hasAttribute("autoplay")&&this._startAutoplay()}get _slides(){return this.shadowRoot.querySelector("slot").assignedElements()}get _count(){return this._slides.length}prev(){this._index=(this._index-1+this._count)%this._count,this._update(),this._emit()}next(){this._index=(this._index+1)%this._count,this._update(),this._emit()}goTo(e){this._index=Math.max(0,Math.min(e,this._count-1)),this._update(),this._emit()}_update(){let e=this.shadowRoot.querySelector(".track");e.style.transform=`translateX(-${this._index*100}%)`,this._slides.forEach((t,i)=>{t.setAttribute("aria-hidden",i!==this._index?"true":"false"),t.inert=i!==this._index,t.setAttribute("aria-roledescription","slide"),t.setAttribute("aria-label",`Slide ${i+1} of ${this._count}`)}),this.shadowRoot.querySelectorAll(".dot").forEach((t,i)=>{t.setAttribute("aria-current",i===this._index?"true":"false")})}_buildDots(){let e=this.shadowRoot.querySelector(".indicators");if(e.innerHTML="",this._slides.forEach((t,i)=>{let n=document.createElement("button");n.type="button",n.className="dot",n.setAttribute("aria-label",`Go to slide ${i+1}`),n.addEventListener("click",()=>this.goTo(i)),e.appendChild(n)}),this.hasAttribute("autoplay")){let t=document.createElement("button");t.type="button",t.className="pause-btn",t.setAttribute("aria-pressed","false"),t.setAttribute("aria-label","Pause automatic slide show"),t.textContent="Pause",t.addEventListener("click",()=>this._toggleAutoplayPause(t)),e.appendChild(t)}this._update()}_toggleAutoplayPause(e){this._autoplayPaused=!this._autoplayPaused,this._autoplayPaused?(this._pause(),e.setAttribute("aria-pressed","true"),e.setAttribute("aria-label","Resume automatic slide show"),e.textContent="Play"):(this._resume(),e.setAttribute("aria-pressed","false"),e.setAttribute("aria-label","Pause automatic slide show"),e.textContent="Pause")}_emit(){this.dispatchEvent(new CustomEvent("velin-slide-change",{bubbles:!0,detail:{index:this._index}}))}_startAutoplay(){let e=parseInt(this.getAttribute("interval")||"5000",10);this._timer=setInterval(()=>this.next(),e)}_pause(){this._timer&&(clearInterval(this._timer),this._timer=null)}_resume(){this.hasAttribute("autoplay")&&!this._timer&&!this._autoplayPaused&&this._startAutoplay()}disconnectedCallback(){this._pause()}};customElements.define("velin-carousel",oi);Ls=oi});var Ms={};y(Ms,{default:()=>Rs});function Vd(r){let e=r.tagName;return e==="BUTTON"||e==="A"&&r.hasAttribute("href")||r.getAttribute("role")==="button"}var Gd,Yd,si,Rs,Ur=p(()=>{Gd=`
|
|
623
641
|
:host { display: block; }
|
|
624
642
|
.content {
|
|
625
643
|
overflow: hidden;
|
|
@@ -630,7 +648,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
630
648
|
:host([open]) .content { grid-template-rows: 1fr; }
|
|
631
649
|
.inner { min-height: 0; }
|
|
632
650
|
@media (prefers-reduced-motion: reduce) { .content { transition: none; } }
|
|
633
|
-
`,
|
|
651
|
+
`,Yd=0;si=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open"}),this._contentId=`velin-collapse-panel-${++Yd}`,this._onTriggerKey=this._onTriggerKey.bind(this)}connectedCallback(){let e=this._contentId;this.shadowRoot.innerHTML="<style>"+Gd+'</style><slot name="trigger"></slot><div class="content" id="'+e+'" part="content"><div class="inner"><slot></slot></div></div>',this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger()),this._wireTrigger()}_wireTrigger(){let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&(Vd(e)||(e.setAttribute("role","button"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0")),e.setAttribute("aria-controls",this._contentId),e.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),e.removeEventListener("click",this._onClick),e.removeEventListener("keydown",this._onTriggerKey),this._onClick=()=>this.toggle(),e.addEventListener("click",this._onClick),e.addEventListener("keydown",this._onTriggerKey))}_onTriggerKey(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.toggle())}attributeChangedCallback(e){if(e==="open"){let t=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];t&&t.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false")}}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("velin-open",{bubbles:!0}))}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}};customElements.define("velin-collapse",si);Rs=si});var Ds={};y(Ds,{default:()=>Is});var ai,Is,jr=p(()=>{ai=class extends HTMLElement{constructor(){super(),this._observer=null,this._activeId=null}connectedCallback(){let e=this.getAttribute("target")||"section[id]",t=this.getAttribute("nav")||"a",i=this.getAttribute("root-margin")||"-20% 0px -60% 0px",n=document.querySelectorAll(e);n.length&&(this._observer=new IntersectionObserver(o=>{for(let a of o)a.isIntersecting&&this._activate(a.target.id,t)},{rootMargin:i,threshold:0}),n.forEach(o=>this._observer.observe(o)))}_activate(e,t){if(this._activeId===e)return;this._activeId=e,this.querySelectorAll(t).forEach(n=>{n.getAttribute("href")===`#${e}`?(n.classList.add("velin-doc-sidebar__link--active"),n.setAttribute("aria-current","true")):(n.classList.remove("velin-doc-sidebar__link--active"),n.removeAttribute("aria-current"))}),this.dispatchEvent(new CustomEvent("velin-spy-change",{bubbles:!0,detail:{id:e}}))}disconnectedCallback(){this._observer&&this._observer.disconnect()}};customElements.define("velin-scrollspy",ai);Is=ai});var Kr={};y(Kr,{VelinTooltip:()=>Qe,VelinTooltipWC:()=>gt,default:()=>Os});var Xd,Zd,Qe,gt,Os,li=p(()=>{T();Xd=`
|
|
634
652
|
:host { position: relative; display: inline-block; }
|
|
635
653
|
.tip {
|
|
636
654
|
position: absolute; z-index: var(--velin-z-tooltip, 700);
|
|
@@ -649,11 +667,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
649
667
|
.tip[data-placement="start"] { right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
|
|
650
668
|
.tip[data-placement="end"] { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
|
|
651
669
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
652
|
-
`,
|
|
653
|
-
<style>${
|
|
670
|
+
`,Zd=0,Qe=class extends HTMLElement{static get observedAttributes(){return["content","placement"]}constructor(){super(),this.attachShadow({mode:"open"}),this._tipId=`velin-tooltip-${++Zd}`}connectedCallback(){let e=this.getAttribute("placement")||"top",t="div";this.shadowRoot.innerHTML=`
|
|
671
|
+
<style>${Xd}</style>
|
|
654
672
|
<slot></slot>
|
|
655
|
-
<${t} class="tip" id="${this._tipId}" role="tooltip" data-placement="${
|
|
656
|
-
`,this.addEventListener("mouseenter",()=>this._show()),this.addEventListener("mouseleave",()=>this._hide()),this.addEventListener("focusin",()=>this._show()),this.addEventListener("focusout",()=>this._hide()),this.addEventListener("keydown",n=>{n.key==="Escape"&&this._hide()}),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>this._linkTrigger()),this._linkTrigger()}_linkTrigger(){let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&(this.hasAttribute("visible")?e.setAttribute("aria-describedby",this._tipId):e.removeAttribute("aria-describedby"))}_show(){this.setAttribute("visible","");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.setAttribute("aria-describedby",this._tipId),this._flip()}_hide(){this.removeAttribute("visible");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.removeAttribute("aria-describedby")}_flip(){let e=this.shadowRoot.querySelector(".tip");if(!e)return;let t=e.getBoundingClientRect(),
|
|
673
|
+
<${t} class="tip" id="${this._tipId}" role="tooltip" data-placement="${m(e)}" part="tip">${m(this.getAttribute("content")||"")}</${t}>
|
|
674
|
+
`,this.addEventListener("mouseenter",()=>this._show()),this.addEventListener("mouseleave",()=>this._hide()),this.addEventListener("focusin",()=>this._show()),this.addEventListener("focusout",()=>this._hide()),this.addEventListener("keydown",n=>{n.key==="Escape"&&this._hide()}),this.shadowRoot.querySelector("slot").addEventListener("slotchange",()=>this._linkTrigger()),this._linkTrigger()}_linkTrigger(){let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&(this.hasAttribute("visible")?e.setAttribute("aria-describedby",this._tipId):e.removeAttribute("aria-describedby"))}_show(){this.setAttribute("visible","");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.setAttribute("aria-describedby",this._tipId),this._flip()}_hide(){this.removeAttribute("visible");let e=this.shadowRoot.querySelector("slot")?.assignedElements()[0];e&&e.removeAttribute("aria-describedby")}_flip(){let e=this.shadowRoot.querySelector(".tip");if(!e)return;let t=e.getBoundingClientRect(),i=this.getAttribute("placement")||"top";i==="top"&&t.top<0?e.setAttribute("data-placement","bottom"):i==="bottom"&&t.bottom>window.innerHeight?e.setAttribute("data-placement","top"):e.setAttribute("data-placement",i)}attributeChangedCallback(e,t,i){let n=this.shadowRoot?.querySelector(".tip");n&&(e==="content"&&(n.textContent=i),e==="placement"&&n.setAttribute("data-placement",i))}},gt=class r extends Qe{static _warned=!1;connectedCallback(){!r._warned&&typeof console<"u"&&console.warn&&(r._warned=!0,console.warn("[velinstyle] <velin-tooltip-wc> is deprecated; use <velin-tooltip> instead.")),super.connectedCallback()}};customElements.get("velin-tooltip")||customElements.define("velin-tooltip",Qe);customElements.get("velin-tooltip-wc")||customElements.define("velin-tooltip-wc",gt);Os=Qe});var Ns={};y(Ns,{announce:()=>ne,ensureAriaLabel:()=>Qd,getAnnouncer:()=>et,liveDotLabel:()=>Wr,respectReducedMotion:()=>eu,syncExpanded:()=>Jd});function et(){return typeof document>"u"?null:(Fe?.isConnected||(Fe=document.querySelector("velin-announcer"),Fe||(Fe=document.createElement("velin-announcer"),document.body.appendChild(Fe))),Fe)}function ne(r,e="polite"){let t=et();!t||typeof t.announce!="function"||t.announce(r,{assertive:e==="assertive"})}function Jd(r,e){if(!r||!e)return;let t=r.getAttribute("aria-expanded")==="true";e.hidden=!t,e.id&&r.setAttribute("aria-controls",e.id)}function Qd(r,e){!r||!e||r.getAttribute("aria-label")?.trim()||r.setAttribute("aria-label",e)}function eu(r,e){typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches&&e?e():r()}function Wr(r){return{live:"Live",idle:"Idle",error:"Error",offline:"Offline",connecting:"Connecting"}[String(r||"live").toLowerCase()]||r||"Live"}var Fe,Le=p(()=>{});var $s={};y($s,{default:()=>zs});var tu,ci,zs,Gr=p(()=>{Z();Le();T();tu=`
|
|
657
675
|
:host { display: contents; }
|
|
658
676
|
.overlay {
|
|
659
677
|
position: fixed; inset: 0; z-index: var(--velin-z-modal, 500);
|
|
@@ -692,8 +710,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
692
710
|
.nav--prev { left: 0.5rem; }
|
|
693
711
|
.nav--next { right: 0.5rem; }
|
|
694
712
|
}
|
|
695
|
-
`,
|
|
696
|
-
<style>${
|
|
713
|
+
`,ci=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._index=0,this._items=[],this._previousFocus=null,this._onTrapKey=e=>{e.key==="Tab"&&ee(this.shadowRoot,e)}}connectedCallback(){this.shadowRoot.innerHTML=`
|
|
714
|
+
<style>${tu}</style>
|
|
697
715
|
<slot></slot>
|
|
698
716
|
<div class="overlay" role="dialog" aria-modal="true" aria-label="Image lightbox" aria-roledescription="lightbox" part="overlay">
|
|
699
717
|
<button class="nav nav--prev" aria-label="Previous">‹</button>
|
|
@@ -702,7 +720,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
702
720
|
<button class="close" aria-label="Close">×</button>
|
|
703
721
|
<div class="counter" part="counter" aria-live="polite" aria-atomic="true"></div>
|
|
704
722
|
</div>
|
|
705
|
-
`;let e=this.shadowRoot.querySelector("slot");e.addEventListener("slotchange",()=>{this._items=e.assignedElements().filter(t=>t.tagName==="IMG"||t.tagName==="VIDEO"||t.dataset.velinLightbox),this._items.forEach((t,
|
|
723
|
+
`;let e=this.shadowRoot.querySelector("slot");e.addEventListener("slotchange",()=>{this._items=e.assignedElements().filter(t=>t.tagName==="IMG"||t.tagName==="VIDEO"||t.dataset.velinLightbox),this._items.forEach((t,i)=>{t.style.cursor="pointer",t.addEventListener("click",()=>this.open(i))})}),this.shadowRoot.querySelector(".close").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".nav--prev").addEventListener("click",()=>this._prev()),this.shadowRoot.querySelector(".nav--next").addEventListener("click",()=>this._next()),this.shadowRoot.querySelector(".overlay").addEventListener("click",t=>{t.target.classList.contains("overlay")&&this.close()}),this.shadowRoot.querySelector(".overlay").addEventListener("keydown",t=>{t.key==="Escape"&&this.close(),t.key==="ArrowLeft"&&this._prev(),t.key==="ArrowRight"&&this._next()})}open(e=0){this._previousFocus=document.activeElement,this._index=e,this.setAttribute("open",""),ce(this),this._render();let t=this.shadowRoot.querySelector(".overlay");t.removeEventListener("keydown",this._onTrapKey),t.addEventListener("keydown",this._onTrapKey),this.shadowRoot.querySelector(".close").focus()}close(){this.removeAttribute("open"),G(this),this._previousFocus&&(this._previousFocus.focus(),this._previousFocus=null),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}disconnectedCallback(){G(this)}_prev(){this._index=(this._index-1+this._items.length)%this._items.length,this._render()}_next(){this._index=(this._index+1)%this._items.length,this._render()}_render(){let e=this.shadowRoot.querySelector(".content"),t=this._items[this._index];if(!t)return;let i=$e(t.dataset.velinLightbox||t.src),n=m(t.alt||"");t.tagName==="VIDEO"?e.innerHTML=`<video src="${m(i)}" controls autoplay></video>`:e.innerHTML=`<img src="${m(i)}" alt="${n}">`;let o=this.shadowRoot.querySelector(".counter"),a=`${this._index+1} / ${this._items.length}`;o.textContent=a,ne(`Slide ${a}`,"polite")}};customElements.define("velin-lightbox",ci);zs=ci});var Yr={};y(Yr,{VelinStepper:()=>tt,VelinStepperWC:()=>yt,default:()=>Fs});var iu,tt,yt,Fs,di=p(()=>{T();iu=`
|
|
706
724
|
:host { display: block; }
|
|
707
725
|
.steps {
|
|
708
726
|
display: flex; gap: var(--velin-space-2, 0.5rem);
|
|
@@ -755,11 +773,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
755
773
|
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
|
756
774
|
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
|
757
775
|
}
|
|
758
|
-
`,
|
|
759
|
-
<style>${
|
|
760
|
-
<div class="steps" role="list" aria-label="${
|
|
776
|
+
`,tt=class extends HTMLElement{static get observedAttributes(){return["active","aria-label","labels"]}constructor(){super(),this.attachShadow({mode:"open"}),this._current=0}connectedCallback(){this._current=parseInt(this.getAttribute("active")||"0",10),this._buildSteps()}_buildSteps(){let e=(this.getAttribute("labels")||"").split(",").map(n=>n.trim()),t=this.getAttribute("aria-label")||"Progress",i=e.map((n,o)=>{let a=o<this._current?"completed":o===this._current?"active":"",c=o<this._current?"completed":o===this._current?"current step":"upcoming",u=o<this._current?'<span class="velin-sr-only">Completed</span><span aria-hidden="true">✓</span>':`<span aria-hidden="true">${o+1}</span>`,f=o===this._current?' aria-current="step"':"",_=n?`${n}, ${c}`:`Step ${o+1}, ${c}`;return`<div class="step ${a}" role="listitem" aria-label="${m(_)}"${f}><span class="step__marker">${u}</span><span class="step__label">${m(n)}</span></div>`}).join("");this.shadowRoot.innerHTML=`
|
|
777
|
+
<style>${iu}</style>
|
|
778
|
+
<div class="steps" role="list" aria-label="${m(t)}" part="steps">${i}</div>
|
|
761
779
|
<div class="panels" part="panels"><slot></slot></div>
|
|
762
|
-
`}_updatePanels(){(this.shadowRoot.querySelector("slot")?.assignedElements()||[]).forEach((t,
|
|
780
|
+
`}_updatePanels(){(this.shadowRoot.querySelector("slot")?.assignedElements()||[]).forEach((t,i)=>{i===this._current?t.setAttribute("data-active",""):t.removeAttribute("data-active")})}next(){let e=(this.getAttribute("labels")||"").split(",");this._current<e.length-1&&(this._current++,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}})))}prev(){this._current>0&&(this._current--,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}})))}goTo(e){this._current=e,this.setAttribute("active",this._current),this._buildSteps(),this.dispatchEvent(new CustomEvent("velin-step-change",{bubbles:!0,detail:{step:this._current}}))}attributeChangedCallback(e,t,i){e==="active"&&t!==null&&t!==i&&(this._current=parseInt(i,10),this._buildSteps())}},yt=class r extends tt{static _warned=!1;connectedCallback(){!r._warned&&typeof console<"u"&&console.warn&&(r._warned=!0,console.warn("[velinstyle] <velin-stepper-wc> is deprecated; use <velin-stepper> instead.")),super.connectedCallback()}};customElements.get("velin-stepper")||customElements.define("velin-stepper",tt);customElements.get("velin-stepper-wc")||customElements.define("velin-stepper-wc",yt);Fs=tt});var Ps={};y(Ps,{default:()=>Hs});var ru,ui,Hs,Vr=p(()=>{T();ru=`
|
|
763
781
|
:host { display: contents; }
|
|
764
782
|
dialog {
|
|
765
783
|
border: none; border-radius: var(--velin-radius-lg, 0.75rem);
|
|
@@ -816,12 +834,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
816
834
|
color: var(--velin-color-text, #1a1a2e);
|
|
817
835
|
}
|
|
818
836
|
.input:focus { outline: 3px solid var(--velin-color-focus, #2563eb); outline-offset: 0; border-color: var(--velin-color-primary, #2563eb); }
|
|
819
|
-
`,
|
|
820
|
-
<button class="btn ${
|
|
821
|
-
<div class="header"><h3 class="title" id="${
|
|
837
|
+
`,ui=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._resolve=null,this._previousFocus=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${ru}</style><dialog part="dialog"></dialog>`;let e=this.shadowRoot.querySelector("dialog");e&&e.setAttribute("aria-label",this.getAttribute("aria-label")||"Dialog")}alert(e,{title:t="Alert",confirmText:i="OK"}={}){return this._show("alert",e,{title:t,confirmText:i})}confirm(e,{title:t="Confirm",confirmText:i="Confirm",cancelText:n="Cancel",danger:o=!1}={}){return this._show("confirm",e,{title:t,confirmText:i,cancelText:n,danger:o})}prompt(e,{title:t="Input",confirmText:i="Submit",cancelText:n="Cancel",placeholder:o="",defaultValue:a=""}={}){return this._show("prompt",e,{title:t,confirmText:i,cancelText:n,placeholder:o,defaultValue:a})}_show(e,t,i){let n=this.shadowRoot.querySelector("dialog");this._previousFocus=document.activeElement;let o=m(i.title),a=m(t),c=m(i.confirmText),u=m(i.cancelText||""),f=m(i.placeholder||""),_=m(i.defaultValue||""),b=e==="alert"?`<button class="btn btn--primary" data-action="confirm">${c}</button>`:`<button class="btn" data-action="cancel">${u}</button>
|
|
838
|
+
<button class="btn ${i.danger?"btn--danger":"btn--primary"}" data-action="confirm">${c}</button>`,g=e==="prompt"?`<input class="input" placeholder="${f}" value="${_}" part="input">`:"",R=`velin-dialog-title-${Math.random().toString(36).slice(2,9)}`;if(n.innerHTML=`
|
|
839
|
+
<div class="header"><h3 class="title" id="${R}">${o}</h3><button class="close" aria-label="Close">×</button></div>
|
|
822
840
|
<div class="body"><p>${a}</p>${g}</div>
|
|
823
|
-
<div class="footer">${
|
|
824
|
-
`,n.setAttribute("aria-modal","true"),n.removeAttribute("aria-label"),n.setAttribute("aria-labelledby",
|
|
841
|
+
<div class="footer">${b}</div>
|
|
842
|
+
`,n.setAttribute("aria-modal","true"),n.removeAttribute("aria-label"),n.setAttribute("aria-labelledby",R),n.showModal(),e!=="prompt"){let k=n.querySelector("[data-action]");k&&k.focus()}return new Promise(k=>{if(this._resolve=k,n.querySelector(".close").addEventListener("click",()=>this._dismiss(e,!1,n)),n.querySelectorAll("[data-action]").forEach(A=>{A.addEventListener("click",()=>this._dismiss(e,A.dataset.action==="confirm",n))}),n.addEventListener("cancel",A=>{A.preventDefault(),this._dismiss(e,!1,n)}),e==="prompt"){let A=n.querySelector(".input");A.focus(),A.addEventListener("keydown",S=>{S.key==="Enter"&&this._dismiss(e,!0,n)})}})}_dismiss(e,t,i){if(!this._resolve)return;let n;e==="alert"?n=!0:e==="confirm"?n=t:n=t?i.querySelector(".input")?.value??"":null,i.close(),this._previousFocus&&(this._previousFocus.focus(),this._previousFocus=null),this._resolve(n),this._resolve=null;let o={value:n};this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0,detail:o})),this.dispatchEvent(new CustomEvent("velin-dialog-close",{bubbles:!0,detail:o}))}};customElements.define("velin-dialog",ui);Hs=ui});var Bs={};y(Bs,{default:()=>qs});var nu,hi,qs,Xr=p(()=>{T();nu=`
|
|
825
843
|
:host { display: inline-flex; font-variant-numeric: tabular-nums; }
|
|
826
844
|
.wrap { display: inline-flex; gap: var(--velin-space-3, 0.75rem); align-items: flex-start; }
|
|
827
845
|
.segment {
|
|
@@ -851,7 +869,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
851
869
|
:host([size="sm"]) .value { font-size: var(--velin-text-xl, 1.25rem); }
|
|
852
870
|
:host([size="sm"]) .segment { min-width: 2.5rem; }
|
|
853
871
|
:host([size="lg"]) .value { font-size: var(--velin-text-5xl, 3.052rem); }
|
|
854
|
-
`,
|
|
872
|
+
`,hi=class extends HTMLElement{static get observedAttributes(){return["datetime"]}constructor(){super(),this.attachShadow({mode:"open"}),this._timer=null}connectedCallback(){this.shadowRoot.innerHTML=`<style>${nu}</style><div class="wrap"></div>`,this._wrap=this.shadowRoot.querySelector(".wrap"),this.setAttribute("role","timer"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true"),this._start()}_start(){this._update(),this._timer=setInterval(()=>this._update(),1e3)}_update(){let e=new Date(this.getAttribute("datetime")).getTime(),t=Date.now(),i=Math.max(0,e-t),n=Math.floor(i/864e5),o=Math.floor(i%864e5/36e5),a=Math.floor(i%36e5/6e4),c=Math.floor(i%6e4/1e3),u=S=>String(S).padStart(2,"0"),f=this.getAttribute("show-days")!=="false",_=m(this.getAttribute("label-days")||"Days"),b=m(this.getAttribute("label-hours")||"Hours"),g=m(this.getAttribute("label-minutes")||"Min"),R=m(this.getAttribute("label-seconds")||"Sec"),k="";f&&(k+=`<div class="segment" part="days"><span class="value">${u(n)}</span><span class="label">${_}</span></div><span class="separator">:</span>`),k+=`<div class="segment" part="hours"><span class="value">${u(o)}</span><span class="label">${b}</span></div><span class="separator">:</span>`,k+=`<div class="segment" part="minutes"><span class="value">${u(a)}</span><span class="label">${g}</span></div><span class="separator">:</span>`,k+=`<div class="segment" part="seconds"><span class="value">${u(c)}</span><span class="label">${R}</span></div>`,this._wrap&&(this._wrap.innerHTML=k);let A=`${n} days, ${o} hours, ${a} minutes, ${c} seconds remaining`;this.setAttribute("aria-label",A),i<=0&&(clearInterval(this._timer),this.dispatchEvent(new CustomEvent("velin-countdown-end",{bubbles:!0})))}disconnectedCallback(){this._timer&&clearInterval(this._timer)}attributeChangedCallback(){this._timer&&(clearInterval(this._timer),this._start())}};customElements.define("velin-countdown",hi);qs=hi});var js={};y(js,{default:()=>Us});var ou,pi,Us,Zr=p(()=>{ou=`
|
|
855
873
|
:host { display: inline-flex; align-items: center; justify-content: center; }
|
|
856
874
|
svg { transform: rotate(-90deg); }
|
|
857
875
|
.track { fill: none; stroke: var(--velin-color-border, #e5e5e5); }
|
|
@@ -869,16 +887,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
869
887
|
}
|
|
870
888
|
:host { position: relative; }
|
|
871
889
|
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
|
|
872
|
-
`,
|
|
873
|
-
<style>${
|
|
890
|
+
`,pi=class extends HTMLElement{static get observedAttributes(){return["value","size","stroke","color"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this._render()}_render(){let e=Math.min(100,Math.max(0,parseInt(this.getAttribute("value")||"0",10))),t=parseInt(this.getAttribute("size")||"120",10),i=parseInt(this.getAttribute("stroke")||"8",10),n=(t-i)/2,o=2*Math.PI*n,a=o-e/100*o,c=this.getAttribute("color"),u=c?`stroke: var(--velin-color-${c}, ${c});`:"",f=this.getAttribute("label")!=="false";this.shadowRoot.innerHTML=`
|
|
891
|
+
<style>${ou}</style>
|
|
874
892
|
<svg width="${t}" height="${t}" viewBox="0 0 ${t} ${t}" part="svg" role="progressbar" aria-valuenow="${e}" aria-valuemin="0" aria-valuemax="100">
|
|
875
|
-
<circle class="track" cx="${t/2}" cy="${t/2}" r="${n}" stroke-width="${
|
|
876
|
-
<circle class="fill" cx="${t/2}" cy="${t/2}" r="${n}" stroke-width="${
|
|
893
|
+
<circle class="track" cx="${t/2}" cy="${t/2}" r="${n}" stroke-width="${i}" />
|
|
894
|
+
<circle class="fill" cx="${t/2}" cy="${t/2}" r="${n}" stroke-width="${i}"
|
|
877
895
|
stroke-dasharray="${o}" stroke-dashoffset="${a}"
|
|
878
896
|
style="${u}" part="fill" />
|
|
879
897
|
</svg>
|
|
880
|
-
${
|
|
881
|
-
`,this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",e),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.setAttribute("aria-label",this.getAttribute("aria-label")||`${e}%`)}attributeChangedCallback(){this._render()}};customElements.define("velin-progress-ring",
|
|
898
|
+
${f?`<span class="label" part="label">${e}%</span>`:""}
|
|
899
|
+
`,this.setAttribute("role","progressbar"),this.setAttribute("aria-valuenow",e),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.setAttribute("aria-label",this.getAttribute("aria-label")||`${e}%`)}attributeChangedCallback(){this._render()}};customElements.define("velin-progress-ring",pi);Us=pi});var Ws={};y(Ws,{default:()=>Ks});var su,mi,Ks,Jr=p(()=>{su=/^[a-zA-Z0-9_-]{1,64}$/,mi=class extends HTMLElement{static get observedAttributes(){return["key","storage"]}constructor(){super(),this._debounceTimer=null,this._onInput=this._onInput.bind(this),this._onSubmit=this._onSubmit.bind(this),this._onReset=this._onReset.bind(this)}get storageKey(){let e=this.getAttribute("key")||"default";return`velin-persist-${su.test(e)?e:"default"}`}get _storage(){return this.getAttribute("storage")==="session"?sessionStorage:localStorage}connectedCallback(){this.style.display="contents",this.addEventListener("input",this._onInput),this.addEventListener("change",this._onInput),this.addEventListener("submit",this._onSubmit),this.addEventListener("reset",this._onReset),requestAnimationFrame(()=>this._restore())}disconnectedCallback(){this.removeEventListener("input",this._onInput),this.removeEventListener("change",this._onInput),this.removeEventListener("submit",this._onSubmit),this.removeEventListener("reset",this._onReset),this._debounceTimer&&clearTimeout(this._debounceTimer)}_onInput(){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._save(),300)}_onSubmit(e){this.clear()}_onReset(){requestAnimationFrame(()=>this.clear())}_getFields(){return this.querySelectorAll("input[name], textarea[name], select[name]")}_save(){let e={};this._getFields().forEach(t=>{let i=t.name;i&&(t.type==="password"||t.type==="file"||(t.type==="checkbox"?e[i]=t.checked:t.type==="radio"?t.checked&&(e[i]=t.value):e[i]=t.value))});try{let t=JSON.stringify(e);if(t.length>65536)return;this._storage.setItem(this.storageKey,t)}catch(t){(t.name==="QuotaExceededError"||t.code===22)&&this.dispatchEvent(new CustomEvent("velin-persist-error",{bubbles:!0,detail:{error:"quota"}}))}}_restore(){let e;try{let t=this._storage.getItem(this.storageKey);if(!t||t.length>65536||(e=JSON.parse(t),typeof e!="object"||e===null))return}catch{return}this._getFields().forEach(t=>{let i=t.name;i in e&&(t.type==="checkbox"?t.checked=!!e[i]:t.type==="radio"?t.checked=t.value===e[i]:t.value=e[i])}),this.dispatchEvent(new CustomEvent("velin-persist-restore",{bubbles:!0,detail:{data:e}}))}clear(){try{this._storage.removeItem(this.storageKey)}catch{}this.dispatchEvent(new CustomEvent("velin-persist-clear",{bubbles:!0}))}};customElements.define("velin-persist",mi);Ks=mi});var Ys={};y(Ys,{default:()=>Gs});var au,fi,Gs,Qr=p(()=>{Z();T();au=`
|
|
882
900
|
:host { display: inline-block; position: relative; }
|
|
883
901
|
.listbox {
|
|
884
902
|
position: absolute; z-index: var(--velin-z-dropdown, 100);
|
|
@@ -903,11 +921,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
903
921
|
::slotted([role="option"][aria-selected="true"]) {
|
|
904
922
|
background: var(--velin-color-surface-dim, #eee);
|
|
905
923
|
}
|
|
906
|
-
`,
|
|
907
|
-
<style>${
|
|
924
|
+
`,fi=class extends HTMLElement{static get observedAttributes(){return["open","aria-label"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onDocClick=this._onDocClick.bind(this),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=`velin-combobox-list-${Math.random().toString(36).slice(2,9)}`;this._listId=e;let t=m(this.getAttribute("aria-label")||"Options");this.shadowRoot.innerHTML=`
|
|
925
|
+
<style>${au}</style>
|
|
908
926
|
<slot name="trigger"></slot>
|
|
909
927
|
<div class="listbox" id="${e}" role="listbox" aria-label="${t}" part="listbox"><slot></slot></div>
|
|
910
|
-
`,this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger()),this.shadowRoot.querySelector("slot:not([name])")?.addEventListener("slotchange",()=>this._wireOptions()),this._wireTrigger(),this._wireOptions(),this.addEventListener("keydown",this._onKey)}_wireTrigger(){let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];if(!e)return;e.setAttribute("role","combobox"),e.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),e.setAttribute("aria-controls",this._listId),e.setAttribute("aria-autocomplete","list"),e.id||(e.id=`velin-combobox-trigger-${Math.random().toString(36).slice(2,9)}`);let t=this.shadowRoot.querySelector(".listbox");t&&t.setAttribute("aria-labelledby",e.id),e.dataset.velinComboWired||(e.dataset.velinComboWired="1",e.addEventListener("click",()=>this.toggle()),e.addEventListener("keydown",
|
|
928
|
+
`,this.shadowRoot.querySelector('slot[name="trigger"]').addEventListener("slotchange",()=>this._wireTrigger()),this.shadowRoot.querySelector("slot:not([name])")?.addEventListener("slotchange",()=>this._wireOptions()),this._wireTrigger(),this._wireOptions(),this.addEventListener("keydown",this._onKey)}_wireTrigger(){let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];if(!e)return;e.setAttribute("role","combobox"),e.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false"),e.setAttribute("aria-controls",this._listId),e.setAttribute("aria-autocomplete","list"),e.id||(e.id=`velin-combobox-trigger-${Math.random().toString(36).slice(2,9)}`);let t=this.shadowRoot.querySelector(".listbox");t&&t.setAttribute("aria-labelledby",e.id),e.dataset.velinComboWired||(e.dataset.velinComboWired="1",e.addEventListener("click",()=>this.toggle()),e.addEventListener("keydown",i=>{(i.key==="ArrowDown"||i.key==="Enter")&&(i.preventDefault(),this.open())}))}_wireOptions(){this._getOptions().forEach((t,i)=>{t.setAttribute("role","option"),t.setAttribute("aria-selected",t.hasAttribute("selected")?"true":"false"),t.setAttribute("tabindex",i===0?"0":"-1")})}_getOptions(){let e=this.shadowRoot.querySelector("slot:not([name])");return e?e.assignedElements().filter(t=>!t.hidden):[]}toggle(){this.hasAttribute("open")?this.close():this.open()}open(){this.setAttribute("open","");let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&e.setAttribute("aria-expanded","true"),document.addEventListener("click",this._onDocClick,!0),requestAnimationFrame(()=>{let t=this._getOptions();t.length&&t[0].focus()})}close(){this.removeAttribute("open");let e=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];e&&(e.setAttribute("aria-expanded","false"),e.focus()),document.removeEventListener("click",this._onDocClick,!0),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_onDocClick(e){this.contains(e.target)||this.close()}_onKey(e){if(!this.hasAttribute("open"))return;if(e.key==="Escape"){this.close();return}let t=this._getOptions();t.length&&(te(this,t,e),e.key==="Enter"&&t.includes(e.target)&&(this._selectOption(e.target),this.close()))}_selectOption(e){this._getOptions().forEach(i=>i.setAttribute("aria-selected",i===e?"true":"false"));let t=this.shadowRoot.querySelector('slot[name="trigger"]')?.assignedElements()[0];t&&"value"in t&&(t.value=e.textContent?.trim()||""),this.dispatchEvent(new CustomEvent("velin-select",{bubbles:!0,detail:{option:e}}))}attributeChangedCallback(e){if(e==="open"&&this._wireTrigger(),e==="aria-label"){let t=this.shadowRoot?.querySelector(".listbox");t&&t.setAttribute("aria-label",m(this.getAttribute("aria-label")||"Options"))}}disconnectedCallback(){document.removeEventListener("click",this._onDocClick,!0)}};customElements.define("velin-combobox",fi);Gs=fi});var Xs={};y(Xs,{default:()=>Vs});var lu,bi,Vs,en=p(()=>{T();lu=`
|
|
911
929
|
:host { display: block; }
|
|
912
930
|
nav {
|
|
913
931
|
display: flex;
|
|
@@ -937,10 +955,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
937
955
|
color: var(--velin-color-primary, #2563eb);
|
|
938
956
|
font-weight: var(--velin-weight-semibold, 600);
|
|
939
957
|
}
|
|
940
|
-
`,
|
|
941
|
-
<style>${
|
|
958
|
+
`,bi=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._onSlot=this._onSlot.bind(this)}connectedCallback(){let e=m(this.getAttribute("aria-label")||"Bottom navigation");this.shadowRoot.innerHTML=`
|
|
959
|
+
<style>${lu}</style>
|
|
942
960
|
<nav role="navigation" aria-label="${e}"><slot></slot></nav>
|
|
943
|
-
`,this.shadowRoot.querySelector("slot").addEventListener("slotchange",this._onSlot),this._onSlot()}_onSlot(){this._syncCurrent(),this._syncSlotLabels()}_syncSlotLabels(){let e=this.shadowRoot?.querySelector("slot");e&&e.assignedElements().forEach(t=>{if(!t.textContent?.replace(/\s+/g," ").trim()&&!t.getAttribute("aria-label")){let n=t.getAttribute("data-nav")||t.getAttribute("title")||t.getAttribute("aria-labelledby");n&&t.setAttribute("aria-label",n)}t.tagName==="A"&&!t.getAttribute("href")&&t.setAttribute("role","button")})}_syncCurrent(){let e=this.shadowRoot?.querySelector("slot");if(!e)return;let t=this.getAttribute("current");e.assignedElements().forEach(
|
|
961
|
+
`,this.shadowRoot.querySelector("slot").addEventListener("slotchange",this._onSlot),this._onSlot()}_onSlot(){this._syncCurrent(),this._syncSlotLabels()}_syncSlotLabels(){let e=this.shadowRoot?.querySelector("slot");e&&e.assignedElements().forEach(t=>{if(!t.textContent?.replace(/\s+/g," ").trim()&&!t.getAttribute("aria-label")){let n=t.getAttribute("data-nav")||t.getAttribute("title")||t.getAttribute("aria-labelledby");n&&t.setAttribute("aria-label",n)}t.tagName==="A"&&!t.getAttribute("href")&&(t.setAttribute("role","button"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t._velinBottomNavKey||(t._velinBottomNavKey=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.click())},t.addEventListener("keydown",t._velinBottomNavKey)))})}_syncCurrent(){let e=this.shadowRoot?.querySelector("slot");if(!e)return;let t=this.getAttribute("current");e.assignedElements().forEach(i=>{i.hasAttribute("current")||t&&(i.dataset.nav===t||i.getAttribute("data-nav")===t)?(i.setAttribute("current",""),i.setAttribute("aria-current","page")):(i.removeAttribute("current"),i.removeAttribute("aria-current"))})}static get observedAttributes(){return["aria-label","current"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector("nav");t&&t.setAttribute("aria-label",m(this.getAttribute("aria-label")||"Bottom navigation"))}e==="current"&&this._syncCurrent()}};customElements.define("velin-bottom-nav",bi);Vs=bi});var ve,it=p(()=>{ve=`
|
|
944
962
|
:host { display: block; }
|
|
945
963
|
button, [role="button"] {
|
|
946
964
|
min-inline-size: 2.75rem;
|
|
@@ -956,8 +974,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
956
974
|
border: 1px solid ButtonText;
|
|
957
975
|
}
|
|
958
976
|
}
|
|
959
|
-
`});var
|
|
960
|
-
${
|
|
977
|
+
`});var Js={};y(Js,{default:()=>Zs});var cu,vi,Zs,tn=p(()=>{Z();T();it();cu=`
|
|
978
|
+
${ve}
|
|
961
979
|
:host { display: contents; }
|
|
962
980
|
.overlay {
|
|
963
981
|
position: fixed; inset: 0; z-index: var(--velin-z-overlay, 400);
|
|
@@ -987,8 +1005,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
987
1005
|
.title { font-size: var(--velin-text-lg, 1.25rem); font-weight: 600; margin: 0; }
|
|
988
1006
|
.body { flex: 1; overflow-y: auto; padding: var(--velin-space-5, 1.25rem); }
|
|
989
1007
|
@media (prefers-reduced-motion: reduce) { .overlay, .sheet { transition: none; } }
|
|
990
|
-
`,
|
|
991
|
-
<style>${
|
|
1008
|
+
`,vi=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._prev=null,this._onKey=this._onKey.bind(this)}connectedCallback(){let e=m(this.getAttribute("title")||this.getAttribute("label")||""),t="velin-sheet-title";this.shadowRoot.innerHTML=`
|
|
1009
|
+
<style>${cu}</style>
|
|
992
1010
|
<div class="overlay" part="overlay"></div>
|
|
993
1011
|
<div class="sheet" role="dialog" aria-modal="true" aria-labelledby="${t}" part="sheet">
|
|
994
1012
|
<div class="header" part="header">
|
|
@@ -997,8 +1015,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
997
1015
|
</div>
|
|
998
1016
|
<div class="body" part="body"><slot></slot></div>
|
|
999
1017
|
</div>
|
|
1000
|
-
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close()),this.hasAttribute("open")&&this._open()}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=
|
|
1001
|
-
${
|
|
1018
|
+
`,this.shadowRoot.querySelector(".close-btn").addEventListener("click",()=>this.close()),this.shadowRoot.querySelector(".overlay").addEventListener("click",()=>this.close()),this.hasAttribute("open")&&this._open()}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=ae(),ce(this),document.addEventListener("keydown",this._onKey),requestAnimationFrame(()=>{let e=fe(this.shadowRoot);e.length&&e[0].focus()})}_close(){document.removeEventListener("keydown",this._onKey),G(this),le(this._prev)}_onKey(e){if(e.key==="Escape"){this.close();return}ee(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKey),G(this)}};customElements.define("velin-sheet",vi);Zs=vi});var ea={};y(ea,{default:()=>Qs});var du,gi,Qs,rn=p(()=>{Z();T();it();du=`
|
|
1019
|
+
${ve}
|
|
1002
1020
|
:host { display: block; }
|
|
1003
1021
|
.group {
|
|
1004
1022
|
display: inline-flex;
|
|
@@ -1024,11 +1042,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1024
1042
|
font-weight: var(--velin-weight-semibold, 600);
|
|
1025
1043
|
box-shadow: var(--velin-shadow-sm, 0 1px 2px rgba(0,0,0,0.06));
|
|
1026
1044
|
}
|
|
1027
|
-
`,
|
|
1028
|
-
<style>${
|
|
1045
|
+
`,gi=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onClick=this._onClick.bind(this),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=m(this.getAttribute("aria-label")||"Segmented control");this.shadowRoot.innerHTML=`
|
|
1046
|
+
<style>${du}</style>
|
|
1029
1047
|
<div class="group" role="group" aria-label="${e}"><slot></slot></div>
|
|
1030
|
-
`,this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getButtons(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>t.tagName==="BUTTON"):[]}_init(){let e=this._getButtons(),t=e.find(
|
|
1031
|
-
${
|
|
1048
|
+
`,this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getButtons(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>t.tagName==="BUTTON"):[]}_init(){let e=this._getButtons(),t=e.find(i=>i.hasAttribute("selected"))||e[0];e.forEach((i,n)=>{i.setAttribute("aria-pressed",i===t?"true":"false"),i.setAttribute("tabindex",i===t?"0":"-1")})}_onClick(e){let t=e.target.closest("button");!t||!this.contains(t)||this._select(t)}_select(e){this._getButtons().forEach(t=>{t.setAttribute("aria-pressed",t===e?"true":"false"),t.setAttribute("tabindex",t===e?"0":"-1")}),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:e.value||e.textContent?.trim()}}))}_onKey(e){let t=this._getButtons();if(t.includes(e.target)&&(te(this,t,e),["ArrowLeft","ArrowRight","Home","End"].includes(e.key))){let i=t.find(n=>n.getAttribute("tabindex")==="0");i&&this._select(i)}}static get observedAttributes(){return["aria-label"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector(".group");t&&t.setAttribute("aria-label",m(this.getAttribute("aria-label")||"Segmented control"))}}disconnectedCallback(){this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKey)}};customElements.define("velin-segmented-control",gi);Qs=gi});var ra={};y(ra,{default:()=>ia});var uu,ta,yi,ia,nn=p(()=>{Z();T();it();uu=`
|
|
1049
|
+
${ve}
|
|
1032
1050
|
:host { display: inline-block; }
|
|
1033
1051
|
.stars { display: inline-flex; gap: var(--velin-space-1, 0.25rem); }
|
|
1034
1052
|
button {
|
|
@@ -1037,8 +1055,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1037
1055
|
color: var(--velin-color-border, #ccc);
|
|
1038
1056
|
}
|
|
1039
1057
|
button[aria-checked="true"] { color: var(--velin-color-warning, #f59e0b); }
|
|
1040
|
-
`,
|
|
1041
|
-
${
|
|
1058
|
+
`,ta=5,yi=class extends HTMLElement{static get observedAttributes(){return["value"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onClick=this._onClick.bind(this),this._onKey=this._onKey.bind(this)}connectedCallback(){this.shadowRoot.innerHTML=`<style>${uu}</style><div class="stars" role="radiogroup"></div>`,this._render(),this.shadowRoot.querySelector(".stars").addEventListener("click",this._onClick),this.shadowRoot.querySelector(".stars").addEventListener("keydown",this._onKey)}_value(){let e=parseInt(this.getAttribute("value")||"0",10);return Math.min(ta,Math.max(0,Number.isNaN(e)?0:e))}_render(){let e=this.shadowRoot.querySelector(".stars"),t=this._value(),i=m(this.getAttribute("aria-label")||"Rating");e.setAttribute("aria-label",i),e.innerHTML="";for(let n=1;n<=ta;n++){let o=document.createElement("button");o.type="button",o.setAttribute("role","radio"),o.setAttribute("aria-checked",n<=t?"true":"false"),o.setAttribute("aria-label",m(`${n} star${n>1?"s":""}`)),o.setAttribute("tabindex",n===(t||1)?"0":"-1"),o.dataset.value=String(n),o.textContent=n<=t?"\u2605":"\u2606",e.appendChild(o)}}_getButtons(){return[...this.shadowRoot.querySelectorAll('button[role="radio"]')]}_onClick(e){let t=e.target.closest("button");t&&this._setValue(parseInt(t.dataset.value,10))}_onKey(e){let t=this._getButtons();if(t.includes(e.target)&&(te(this,t,e),["ArrowLeft","ArrowRight","Home","End"].includes(e.key))){let i=t.find(n=>n.getAttribute("tabindex")==="0");i&&this._setValue(parseInt(i.dataset.value,10))}}_setValue(e){this.setAttribute("value",String(e)),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:e}}))}attributeChangedCallback(e){e==="value"&&this.shadowRoot?.querySelector(".stars")&&this._render()}};customElements.define("velin-rating",yi);ia=yi});var oa={};y(oa,{default:()=>na});var hu,_i,na,on=p(()=>{Z();T();it();hu=`
|
|
1059
|
+
${ve}
|
|
1042
1060
|
:host { display: block; }
|
|
1043
1061
|
.menubar {
|
|
1044
1062
|
display: flex;
|
|
@@ -1062,11 +1080,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1062
1080
|
::slotted([role="menuitem"]:hover) {
|
|
1063
1081
|
background: var(--velin-color-surface-dim, #eee);
|
|
1064
1082
|
}
|
|
1065
|
-
`,
|
|
1066
|
-
<style>${
|
|
1083
|
+
`,_i=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=m(this.getAttribute("aria-label")||"Menu bar");this.shadowRoot.innerHTML=`
|
|
1084
|
+
<style>${hu}</style>
|
|
1067
1085
|
<div class="menubar" role="menubar" aria-label="${e}"><slot></slot></div>
|
|
1068
|
-
`,this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getItems(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_init(){this._getItems().forEach((t,
|
|
1069
|
-
${
|
|
1086
|
+
`,this.addEventListener("keydown",this._onKey),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._init()),this._init()}_getItems(){let e=this.shadowRoot.querySelector("slot");return e?e.assignedElements().filter(t=>!t.hasAttribute("disabled")):[]}_init(){this._getItems().forEach((t,i)=>{t.hasAttribute("role")||t.setAttribute("role","menuitem"),t.setAttribute("tabindex",i===0?"0":"-1")})}_onKey(e){let t=this._getItems();t.includes(e.target)&&te(this,t,e)}static get observedAttributes(){return["aria-label"]}attributeChangedCallback(e){if(e==="aria-label"){let t=this.shadowRoot?.querySelector(".menubar");t&&t.setAttribute("aria-label",m(this.getAttribute("aria-label")||"Menu bar"))}}disconnectedCallback(){this.removeEventListener("keydown",this._onKey)}};customElements.define("velin-menubar",_i);na=_i});var aa={};y(aa,{default:()=>sa});var pu,xi,sa,sn=p(()=>{Z();T();it();pu=`
|
|
1087
|
+
${ve}
|
|
1070
1088
|
:host { display: contents; }
|
|
1071
1089
|
.overlay {
|
|
1072
1090
|
position: fixed; inset: 0; z-index: var(--velin-z-modal, 500);
|
|
@@ -1074,9 +1092,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1074
1092
|
padding: 10vh var(--velin-space-4, 1rem) var(--velin-space-4, 1rem);
|
|
1075
1093
|
background: var(--velin-color-overlay, rgba(0,0,0,0.4));
|
|
1076
1094
|
opacity: 0; visibility: hidden;
|
|
1095
|
+
pointer-events: none;
|
|
1077
1096
|
transition: opacity 150ms ease, visibility 150ms ease;
|
|
1078
1097
|
}
|
|
1079
|
-
:host([open]) .overlay {
|
|
1098
|
+
:host([open]) .overlay {
|
|
1099
|
+
opacity: 1;
|
|
1100
|
+
visibility: visible;
|
|
1101
|
+
pointer-events: auto;
|
|
1102
|
+
}
|
|
1080
1103
|
.panel {
|
|
1081
1104
|
inline-size: min(32rem, 100%);
|
|
1082
1105
|
background: var(--velin-color-surface-bright, #fff);
|
|
@@ -1104,17 +1127,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1104
1127
|
::slotted(button:focus-visible) {
|
|
1105
1128
|
background: var(--velin-color-surface-dim, #eee);
|
|
1106
1129
|
}
|
|
1107
|
-
`,
|
|
1108
|
-
<style>${
|
|
1130
|
+
`,xi=class extends HTMLElement{static get observedAttributes(){return["open"]}constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0}),this._prev=null,this._onKey=this._onKey.bind(this),this._onInput=this._onInput.bind(this)}connectedCallback(){let e=m(this.getAttribute("placeholder")||"Search commands\u2026");this.shadowRoot.innerHTML=`
|
|
1131
|
+
<style>${pu}</style>
|
|
1109
1132
|
<div class="overlay" part="overlay">
|
|
1110
1133
|
<div class="panel" role="dialog" aria-modal="true" aria-label="Command palette" part="panel">
|
|
1111
1134
|
<input class="search" type="search" autocomplete="off" placeholder="${e}" aria-label="Search" part="search" />
|
|
1112
1135
|
<div class="results" part="results"><slot></slot></div>
|
|
1113
1136
|
</div>
|
|
1114
1137
|
</div>
|
|
1115
|
-
`,this.shadowRoot.querySelector(".search").addEventListener("input",this._onInput),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._filter("")),this._filter("")}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}_open(){this._prev=
|
|
1138
|
+
`,this.shadowRoot.querySelector(".search").addEventListener("input",this._onInput),this.shadowRoot.querySelector(".overlay")?.addEventListener("click",this._onOverlayClick),this.shadowRoot.querySelector("slot")?.addEventListener("slotchange",()=>this._filter("")),this._filter("")}attributeChangedCallback(e){e==="open"&&(this.hasAttribute("open")?this._open():this._close())}open(){this.setAttribute("open","")}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("velin-close",{bubbles:!0}))}toggle(){this.hasAttribute("open")?this.close():this.open()}_onOverlayClick=e=>{e.target===e.currentTarget&&this.close()};_open(){this._prev=ae(),ce(this),document.addEventListener("keydown",this._onKey),requestAnimationFrame(()=>{this.shadowRoot.querySelector(".search")?.focus(),this._filter("")})}_close(){document.removeEventListener("keydown",this._onKey),G(this),le(this._prev);let e=this.shadowRoot.querySelector(".search");e&&(e.value=""),this._filter("")}_onInput(e){this._filter(e.target.value)}_filter(e){let t=e.trim().toLowerCase();this.shadowRoot.querySelector("slot")?.assignedElements().forEach(n=>{let o=n.textContent?.trim().toLowerCase()||"",a=!t||o.includes(t);n.hidden=!a})}_visibleItems(){return this.shadowRoot.querySelector("slot")?.assignedElements().filter(t=>t.tagName==="BUTTON"&&!t.hidden)||[]}_onKey(e){if(e.key==="Escape"){this.close();return}let t=this._visibleItems();if(t.length&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault();let i=t.indexOf(document.activeElement);(e.key==="ArrowDown"?t[(i+1)%t.length]:t[(i<=0?t.length:i)-1])?.focus();return}ee(this.shadowRoot,e)}disconnectedCallback(){document.removeEventListener("keydown",this._onKey),this.shadowRoot?.querySelector(".overlay")?.removeEventListener("click",this._onOverlayClick),this.hasAttribute("open")&&G(this)}};customElements.define("velin-command",xi);sa=xi});var ca={};y(ca,{default:()=>la});var mu,wi,la,an=p(()=>{mu=`
|
|
1116
1139
|
:host { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
|
|
1117
|
-
`,
|
|
1140
|
+
`,wi=class extends HTMLElement{connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"});let e=this.getAttribute("polite")==="false"?"assertive":"polite";this.shadowRoot.innerHTML="<style>"+mu+'</style><div role="status" aria-live="'+e+'" aria-atomic="true" part="region"></div>',this._region=this.shadowRoot.querySelector('[role="status"]')}announce(e,{assertive:t=!1}={}){this._region||this.connectedCallback(),this._region.setAttribute("aria-live",t?"assertive":"polite"),this._region.textContent="",requestAnimationFrame(()=>{this._region.textContent=typeof e=="string"?e:""})}static announceGlobal(e,t){let i=document.querySelector("velin-announcer");i||(i=document.createElement("velin-announcer"),document.body.appendChild(i)),i.announce(e,t)}};customElements.define("velin-announcer",wi);la=wi});var ha={};y(ha,{default:()=>ua});function fu(r,e){if(!r)return"";if(e==="rot13")return r.replace(/[a-zA-Z]/g,t=>{let i=t<="Z"?65:97;return String.fromCharCode((t.charCodeAt(0)-i+13)%26+i)});try{return atob(r)}catch{return r}}var da,Ai,ua,Ei=p(()=>{T();da=`
|
|
1118
1141
|
:host { display: inline; }
|
|
1119
1142
|
button {
|
|
1120
1143
|
font: inherit;
|
|
@@ -1134,15 +1157,140 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1134
1157
|
border-radius: 2px;
|
|
1135
1158
|
}
|
|
1136
1159
|
.revealed { text-decoration: none; user-select: text; }
|
|
1137
|
-
`;
|
|
1138
|
-
<style>${
|
|
1139
|
-
<span class="revealed" part="email"><a href="mailto:${
|
|
1160
|
+
`;Ai=class extends HTMLElement{static get observedAttributes(){return["value","obfuscate","label"]}constructor(){super(),this.attachShadow({mode:"open"}),this._revealed=!1}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}get email(){let e=this.getAttribute("obfuscate")||"",t=this.getAttribute("value")||"";return e?fu(t,e):t}render(){let e=this.getAttribute("label")||"Show email address",t=this.email,i=m(t);if(this._revealed){this.shadowRoot.innerHTML=`
|
|
1161
|
+
<style>${da}</style>
|
|
1162
|
+
<span class="revealed" part="email"><a href="mailto:${ye(t)}">${i}</a></span>
|
|
1140
1163
|
`;return}this.shadowRoot.innerHTML=`
|
|
1141
|
-
<style>${
|
|
1142
|
-
<button type="button" part="reveal" aria-label="${
|
|
1143
|
-
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{this._revealed=!0,this.render(),this.dispatchEvent(new CustomEvent("velin-email-reveal",{bubbles:!0,detail:{email:t}}))})}};customElements.get("velin-email")||customElements.define("velin-email",fi);Ks=fi});function O(i,e){let t=[],r=0;for(;r<i.length;){let n=!1;for(let{type:o,re:a}of e){a.lastIndex=r;let l=a.exec(i);if(l&&l.index===r){t.push({type:o,value:l[0]}),r+=l[0].length,n=!0;break}}if(!n){let o=t[t.length-1];o?.type==="plain"?o.value+=i[r]:t.push({type:"plain",value:i[r]}),r+=1}}return t}function xe(i,e,t){let r=[...t,{type:"keyword",re:new RegExp(`\\b(${Object.keys(e).join("|")})\\b`,"y")},{type:"identifier",re:/\b[A-Za-z_$][\w$]*\b/y}];return O(i,r)}var G=d(()=>{});var Gr={};f(Gr,{default:()=>Ge});function Ge(i){return xe(i,Td,Ld)}var Td,Ld,ct=d(()=>{G();Td={const:1,let:1,var:1,function:1,return:1,if:1,else:1,for:1,while:1,do:1,switch:1,case:1,break:1,continue:1,new:1,class:1,extends:1,import:1,export:1,from:1,default:1,async:1,await:1,try:1,catch:1,finally:1,throw:1,typeof:1,instanceof:1,in:1,of:1,true:1,false:1,null:1,undefined:1,void:1,this:1},Ld=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"string",re:/`(?:\\.|[^`\\])*`/y},{type:"number",re:/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"operator",re:/[+\-*/%=<>!&|^~?:]+/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var Vr={};f(Vr,{default:()=>Gs});function Gs(i){return Ge(i).map(e=>e.type==="identifier"&&Cd.has(e.value)?{type:"keyword",value:e.value}:e)}var Cd,Yr=d(()=>{ct();Cd=new Set(["type","interface","enum","implements","declare","namespace","readonly","public","private","protected","abstract","as","satisfies","keyof"])});var vi={};f(vi,{default:()=>Vs});function Vs(i){return O(i,Rd)}var Rd,gi=d(()=>{G();Rd=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"tag",re:/<\/?[\w-]+/y},{type:"punctuation",re:/[<>/=]/y},{type:"attr-name",re:/\s[\w-]+(?==)/y},{type:"attr-value",re:/=(?:"[^"]*"|'[^']*'|[^\s>]+)/y}]});var Xs={};f(Xs,{default:()=>Ys});function Ys(i){return xe(i,Id,Md)}var Id,Md,Zs=d(()=>{G();Id={important:1,inherit:1,initial:1,unset:1,revert:1},Md=[{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/#[\da-fA-F]{3,8}\b|\b\d+(?:\.\d+)?(?:%|[a-z]+)?\b/y},{type:"tag",re:/\.[\w-]+|#[\w-]+/y},{type:"attr-name",re:/[\w-]+(?=\s*:)/y},{type:"punctuation",re:/[{}:;,()]/y},{type:"operator",re:/[+\-*/>~]/y}]});var Qs={};f(Qs,{default:()=>Js});function Js(i){return O(i,Dd)}var Dd,ea=d(()=>{G();Dd=[{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"number",re:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"keyword",re:/\b(true|false|null)\b/y},{type:"punctuation",re:/[{}[\]:,]/y}]});var Xr={};f(Xr,{default:()=>ta});function ta(i){return O(i,Od)}var Od,Zr=d(()=>{G();Od=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/```[\s\S]*?```/y},{type:"string",re:/`[^`\n]+`/y},{type:"keyword",re:/#{1,6}\s[^\n]+/y},{type:"tag",re:/\[[^\]]+\]\([^)]+\)/y},{type:"operator",re:/[*_~]/y}]});var yi={};f(yi,{default:()=>ia});function ia(i){return xe(i,Nd,Fd)}var Nd,Fd,_i=d(()=>{G();Nd={if:1,then:1,else:1,fi:1,for:1,do:1,done:1,while:1,case:1,esac:1,function:1,return:1,export:1,local:1},Fd=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'[^']*'/y},{type:"number",re:/\b\d+\b/y},{type:"operator",re:/[|&<>]/y},{type:"punctuation",re:/[();]/y}]});var na={};f(na,{default:()=>ra});function ra(i){return O(i,$d)}var $d,oa=d(()=>{G();$d=[{type:"comment",re:/--[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"keyword",re:/\b(?:SELECT|FROM|WHERE|INSERT|INTO|VALUES|UPDATE|SET|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AND|OR|NOT|NULL|AS|ORDER|BY|GROUP|HAVING|LIMIT|CREATE|TABLE|INDEX)\b/yi},{type:"operator",re:/[=<>!]+|,/y},{type:"punctuation",re:/[();]/y}]});var dt={};f(dt,{default:()=>sa});function sa(i){return i?[{type:"plain",value:i}]:[]}var ut=d(()=>{});var la={};f(la,{default:()=>aa});function aa(i){return xe(i,zd,Hd)}var zd,Hd,ca=d(()=>{G();zd={function:1,return:1,if:1,else:1,elseif:1,foreach:1,while:1,class:1,new:1,public:1,private:1,protected:1,static:1,namespace:1,use:1,true:1,false:1,null:1},Hd=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/#[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"operator",re:/=>|\+\+|--|===|!==|==|!=|<=|>=|->|\?\?|[=+\-*/%.<>!&|^~?:]/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var ua={};f(ua,{default:()=>da});function da(i){return O(i,Pd)}var Pd,ha=d(()=>{G();Pd=[{type:"comment",re:/{{--[\s\S]*?--}}/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"keyword",re:/@(?:vite|csrf|auth|guest|section|endsection|yield|extends|include|push|endpush|stack|once|endonce|forelse|empty|endempty|can|endcan|cannot|endcannot)\b/y},{type:"operator",re:/{{|}}|{!!|!!}|@[{}]/y},{type:"punctuation",re:/[()[\],]/y}]});var Jr={};f(Jr,{default:()=>pa});function pa(i){return O(i,qd)}var qd,Qr=d(()=>{G();qd=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/[rbfu]{0,2}"""[\s\S]*?"""/y},{type:"string",re:/[rbfu]{0,2}'''[\s\S]*?'''/y},{type:"string",re:/[rbfu]{0,2}"(?:\\.|[^"\\\n])*"/y},{type:"string",re:/[rbfu]{0,2}'(?:\\.|[^'\\\n])*'/y},{type:"number",re:/\b0[xX][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?j?\b/y},{type:"keyword",re:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/y},{type:"builtin",re:/\b(?:None|True|False|self|cls|abs|all|any|bool|bytes|dict|dir|enumerate|filter|float|format|frozenset|getattr|hasattr|int|isinstance|issubclass|iter|len|list|map|max|min|next|object|open|print|range|repr|reversed|round|set|setattr|sorted|str|sum|super|tuple|type|zip)\b/y},{type:"operator",re:/->|:=|\*\*=?|\/\/=?|<<=?|>>=?|[-+*/%&|^~<>!=]=?/y},{type:"punctuation",re:/[[\]{}(),:;.@]/y},{type:"identifier",re:/\b[A-Za-z_]\w*\b/y}]});var en={};f(en,{default:()=>ma});function ma(i){return O(i,Bd)}var Bd,tn=d(()=>{G();Bd=[{type:"comment",re:/#[^\n]*/y},{type:"punctuation",re:/^(?:---|\.\.\.)$/my},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"attr-name",re:/^[ \t]*-?[ \t]*[\w.$-]+(?=[ \t]*:(?:[ \t]|$))/my},{type:"punctuation",re:/^[ \t]*-(?=[ \t]|$)/my},{type:"keyword",re:/\b(?:true|false|null|yes|no|on|off|~)\b/yi},{type:"number",re:/\b-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/y},{type:"operator",re:/[&*]\w+|![\w/!-]*|[|>][+-]?\d*(?=\s*$)/my},{type:"punctuation",re:/[:,[\]{}]/y}]});var rn={};f(rn,{default:()=>fa});function fa(i){return O(i,Ud)}var Ud,nn=d(()=>{G();Ud=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/`[^`]*`/y},{type:"string",re:/"(?:\\.|[^"\\\n])*"/y},{type:"string",re:/'(?:\\.|[^'\\\n])*'/y},{type:"number",re:/\b0[xX][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?i?\b/y},{type:"keyword",re:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/y},{type:"builtin",re:/\b(?:append|bool|byte|cap|clear|close|complex|complex64|complex128|copy|delete|error|float32|float64|imag|int|int8|int16|int32|int64|len|make|max|min|new|nil|panic|print|println|real|recover|rune|string|true|false|iota|uint|uint8|uint16|uint32|uint64|uintptr|any)\b/y},{type:"operator",re:/:=|\.\.\.|&&|\|\||<-|\+\+|--|<<=?|>>=?|&\^=?|[-+*/%&|^<>!=]=?|~/y},{type:"punctuation",re:/[[\]{}(),;:.]/y},{type:"identifier",re:/\b[A-Za-z_]\w*\b/y}]});var on={};f(on,{default:()=>ba});function ba(i){return O(i,jd)}var jd,sn=d(()=>{G();jd=[{type:"comment",re:/\/\/\/?[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/b?r(#*)"[\s\S]*?"\1/y},{type:"string",re:/b?"(?:\\.|[^"\\])*"/y},{type:"string",re:/b?'(?:\\.|[^'\\])'/y},{type:"builtin",re:/#!?\[[^\]]*\]/y},{type:"number",re:/\b0[xXbo][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?(?:[iuf](?:8|16|32|64|128|size))?\b/y},{type:"keyword",re:/\b(?:as|async|await|break|const|continue|crate|dyn|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|unsafe|use|where|while)\b/y},{type:"builtin",re:/\b(?:bool|char|f32|f64|i8|i16|i32|i64|i128|isize|str|u8|u16|u32|u64|u128|usize|String|Vec|Option|Result|Some|None|Ok|Err|Box|Rc|Arc|true|false)\b/y},{type:"operator",re:/'[a-z_]\w*\b/y},{type:"operator",re:/=>|->|::|\.\.=?|&&|\|\||<<=?|>>=?|[-+*/%&|^<>!=]=?|[?@]/y},{type:"punctuation",re:/[[\]{}(),;:.#]/y},{type:"identifier",re:/\b[A-Za-z_]\w*!?\b/y}]});function be(i){let e=(i||"").trim().toLowerCase();return e?e.startsWith("language-")?be(e.slice(9)):{javascript:"js",jsx:"js",typescript:"ts",tsx:"ts",markup:"html",xml:"html",svg:"html",bash:"shell",sh:"shell",zsh:"shell",md:"markdown",plaintext:"text","plain-text":"text",yml:"yaml",toml:"text",ini:"text",php8:"php",py:"python",python3:"python",golang:"go",rs:"rust"}[e]||e:""}function Ye(i,e){Ve.set(be(i),e)}function ht(i){return Ve.get(be(i))}async function Ae(i){let e=be(i);if(!e)return;if(Ve.has(e))return Ve.get(e);if(xi.has(e))return xi.get(e);let t=va[e];if(!t)return;let r=t().then(n=>{let o=n.default;return Ve.set(e,o),xi.delete(e),o});return xi.set(e,r),r}function Ai(){return[...new Set([...Ve.keys(),...Object.keys(va)])]}var Ve,xi,va,wi=d(()=>{ct();Ve=new Map,xi=new Map,va={js:()=>Promise.resolve().then(()=>(ct(),Gr)),javascript:()=>Promise.resolve().then(()=>(ct(),Gr)),ts:()=>Promise.resolve().then(()=>(Yr(),Vr)),typescript:()=>Promise.resolve().then(()=>(Yr(),Vr)),html:()=>Promise.resolve().then(()=>(gi(),vi)),xml:()=>Promise.resolve().then(()=>(gi(),vi)),css:()=>Promise.resolve().then(()=>(Zs(),Xs)),json:()=>Promise.resolve().then(()=>(ea(),Qs)),md:()=>Promise.resolve().then(()=>(Zr(),Xr)),markdown:()=>Promise.resolve().then(()=>(Zr(),Xr)),shell:()=>Promise.resolve().then(()=>(_i(),yi)),bash:()=>Promise.resolve().then(()=>(_i(),yi)),sh:()=>Promise.resolve().then(()=>(_i(),yi)),sql:()=>Promise.resolve().then(()=>(oa(),na)),text:()=>Promise.resolve().then(()=>(ut(),dt)),plain:()=>Promise.resolve().then(()=>(ut(),dt)),txt:()=>Promise.resolve().then(()=>(ut(),dt)),markup:()=>Promise.resolve().then(()=>(gi(),vi)),console:()=>Promise.resolve().then(()=>(ut(),dt)),php:()=>Promise.resolve().then(()=>(ca(),la)),blade:()=>Promise.resolve().then(()=>(ha(),ua)),python:()=>Promise.resolve().then(()=>(Qr(),Jr)),py:()=>Promise.resolve().then(()=>(Qr(),Jr)),yaml:()=>Promise.resolve().then(()=>(tn(),en)),yml:()=>Promise.resolve().then(()=>(tn(),en)),go:()=>Promise.resolve().then(()=>(nn(),rn)),golang:()=>Promise.resolve().then(()=>(nn(),rn)),rust:()=>Promise.resolve().then(()=>(sn(),on)),rs:()=>Promise.resolve().then(()=>(sn(),on))};Ye("js",Ge)});function an(i){return i.replace(/[&<>"]/g,e=>Kd[e]||e)}function Ei(i){return i.map(e=>{let t=e.type==="plain"?"":e.type;return`<span class="${t?`velin-token velin-token--${t}`:"velin-token"}">${an(e.value)}</span>`}).join("")}function ki(i,e){i.innerHTML=Ei(e),i.classList.add("velin-syntax-ready"),i.closest("pre")?.classList.add("velin-syntax-ready"),i.closest(".velin-code-block")?.classList.add("velin-syntax-ready")}var Kd,ln=d(()=>{Kd={"&":"&","<":"<",">":">",'"':"""}});function cn(i){let e=i.tagName==="PRE"?i:i.closest("pre"),t=i.tagName==="CODE"?i:e?.querySelector("code")||i,r=e||t,n=r.getAttribute("language")||r.getAttribute("data-language")||r.getAttribute("velin-code")||"";if(n&&n!=="true")return be(n);let a=(t?.className||"").match(/\blanguage-([\w-]+)\b/i);return a?be(a[1]):""}function Si(i){let t=(i.tagName==="CODE"?i:i.querySelector("code"))||i;if(t.dataset.velinSource!=null)return t.dataset.velinSource;let r=t.innerHTML;if(r&&/<|>|&/.test(r)){let n=document.createElement("textarea");if(n.innerHTML=r.replace(/<br\s*\/?>/gi,`
|
|
1144
|
-
|
|
1145
|
-
`).length;g.textContent="";for(let A=0;A<w;A+=1){let E=A+1,oe=document.createElement("span");n.has(E)&&(oe.className="velin-code-block__line--highlight"),oe.textContent=String(E),g.appendChild(oe)}m.appendChild(g)}let v=document.createElement("pre");e&&(v.setAttribute("language",e),v.dataset.language=e);let y=document.createElement("code");e&&(y.className=`language-${e}`),y.textContent=o,v.appendChild(y),m.appendChild(v),this.appendChild(a),this.appendChild(m),this._pre=v}async _setupHighlight(){if(!this._pre)return;delete this._pre.dataset.velinHighlighted,delete this._pre.dataset.velinObserve,typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await ne(this._pre):we(this,{root:this})}};customElements.define("velin-code-block",Li);_a=Li});var wa={};f(wa,{default:()=>Aa});function Yd(i){let e=(i.getAttribute("format")||"number").toLowerCase(),t=i.getAttribute("locale")||void 0,r=i.getAttribute("decimals"),n=r!=null?Math.max(0,Number.parseInt(r,10)||0):null,o={};n!=null&&(o.minimumFractionDigits=n,o.maximumFractionDigits=n),e==="currency"?(o.style="currency",o.currency=i.getAttribute("currency")||"EUR"):e==="percent"&&(o.style="percent");try{return new Intl.NumberFormat(t,o)}catch{return new Intl.NumberFormat(void 0,o)}}var Vd,Ci,Aa,Ri=d(()=>{Vd=i=>i===1?1:1-Math.pow(2,-10*i);Ci=class extends HTMLElement{static get observedAttributes(){return["from","to","duration","decimals","prefix","suffix","format","currency","locale"]}constructor(){super(),this._rafId=0,this._started=!1,this._observer=null}connectedCallback(){this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true"),this._render(this._fromValue()),this.getAttribute("autostart")!=="false"&&this._scheduleStart()}disconnectedCallback(){cancelAnimationFrame(this._rafId),this._observer?.disconnect()}attributeChangedCallback(e){this.isConnected&&(e==="to"||e==="from"?this.start():this._render(this._lastValue??this._toValue()))}_fromValue(){return Number.parseFloat(this.getAttribute("from"))||0}_toValue(){return Number.parseFloat(this.getAttribute("to"))||0}_duration(){return Math.max(0,Number.parseFloat(this.getAttribute("duration"))||900)}_scheduleStart(){if(!this._started){if(typeof IntersectionObserver>"u"){this.start();return}this._observer=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){this.start(),this._observer.disconnect(),this._observer=null;break}},{threshold:.2}),this._observer.observe(this)}}start(){cancelAnimationFrame(this._rafId),this._started=!0;let e=this._fromValue(),t=this._toValue(),r=this._duration();if(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||r===0){this._render(t);return}let o=performance.now(),a=l=>{let u=Math.min(1,(l-o)/r),m=e+(t-e)*Vd(u);this._render(m),u<1&&(this._rafId=requestAnimationFrame(a))};this._rafId=requestAnimationFrame(a)}reset(){cancelAnimationFrame(this._rafId),this._started=!1,this._render(this._fromValue())}_render(e){this._lastValue=e;let t=Yd(this),r=this.getAttribute("prefix")||"",n=this.getAttribute("suffix")||"";this.textContent=`${r}${t.format(e)}${n}`}};typeof customElements<"u"&&!customElements.get("velin-counter")&&customElements.define("velin-counter",Ci);Aa=Ci});var Ta={};f(Ta,{default:()=>Sa});function ka(i,e){let r=(i?.dataset?.sortValue??i?.textContent??"").trim();if(e==="number"){let n=Number.parseFloat(r.replace(/[^\d.,-]/g,"").replace(",","."));return Number.isNaN(n)?Number.NEGATIVE_INFINITY:n}if(e==="date"){let n=Date.parse(r);return Number.isNaN(n)?Number.NEGATIVE_INFINITY:n}return r.toLowerCase()}var Xd,Ea,Ii,Sa,gn=d(()=>{_e();Xd=new Set(["text","number","date"]),Ea=!1;Ii=class extends HTMLElement{static get observedAttributes(){return["page-size","filter-input","empty-text","label"]}constructor(){super(),this._table=null,this._page=1,this._query="",this._sortIndex=-1,this._sortDirection="ascending",this._filterEl=null,this._pagination=null,this._emptyRow=null,this._filterTimer=null,this._onFilterInput=this._onFilterInput.bind(this)}connectedCallback(){this.classList.add("velin-data-table"),requestAnimationFrame(()=>this._init())}disconnectedCallback(){this._filterEl&&this._filterEl.removeEventListener("input",this._onFilterInput),this._filterTimer&&clearTimeout(this._filterTimer)}attributeChangedCallback(e,t,r){t===r||!this._table||(e==="page-size"?(this._page=1,this._render()):e==="filter-input"?this._bindFilterInput():e==="label"&&this._ensureAccessibleName())}get rows(){let e=this._table?.tBodies?.[0];return e?[...e.rows].filter(t=>t!==this._emptyRow):[]}get matchingRows(){return this.rows.filter(e=>!e.dataset.velinFiltered)}get visibleRows(){return this.matchingRows.filter(e=>!e.hidden)}get page(){return this._page}get pageSize(){let e=Number.parseInt(this.getAttribute("page-size")||"",10);return Number.isFinite(e)&&e>0?e:0}get pageCount(){let e=this.pageSize;return e?Math.max(1,Math.ceil(this.matchingRows.length/e)):1}sort(e,t){let n=this._headers()[e];if(!n)return;let o=this._sortType(n);if(o==="none")return;this._sortDirection=t||(this._sortIndex===e&&this._sortDirection==="ascending"?"descending":"ascending"),this._sortIndex=e;let a=this._sortDirection==="ascending"?1:-1,l=this._table.tBodies[0],u=this.rows.slice().sort((v,y)=>{let g=ka(v.cells[e],o),N=ka(y.cells[e],o);return g<N?-1*a:g>N?1*a:0});for(let v of u)l.appendChild(v);this._syncSortState(),this._page=1,this._render();let m=n.dataset.sortLabel||n.textContent.trim();re(`${m} sorted ${this._sortDirection}`),this.dispatchEvent(new CustomEvent("velin-data-table-sort",{bubbles:!0,detail:{index:e,direction:this._sortDirection,column:m}}))}filter(e){this._query=String(e||"").trim().toLowerCase();for(let r of this.rows)!this._query||this._rowText(r).includes(this._query)?delete r.dataset.velinFiltered:r.dataset.velinFiltered="true";this._page=1,this._render();let t=this.matchingRows.length;re(t===1?"1 row matches":`${t} rows match`),this.dispatchEvent(new CustomEvent("velin-data-table-filter",{bubbles:!0,detail:{query:this._query,count:t}}))}goToPage(e){let t=Math.min(Math.max(1,Math.trunc(e)||1),this.pageCount);t!==this._page&&(this._page=t,this._render(),re(`Page ${this._page} of ${this.pageCount}`),this.dispatchEvent(new CustomEvent("velin-data-table-page",{bubbles:!0,detail:{page:this._page,pageCount:this.pageCount}})))}_init(){this._table=this.querySelector("table"),!(!this._table||!this._table.tBodies.length)&&(this._ensureAccessibleName(),this._setupSorting(),this._bindFilterInput(),this._render())}_headers(){let e=this._table.tHead?.rows?.[0];return e?[...e.cells]:[]}_sortType(e){let t=(e.dataset.sort||"").toLowerCase();return t==="none"?"none":Xd.has(t)?t:this.hasAttribute("sortable")?"text":"none"}_ensureAccessibleName(){let e=this._table;if(!e)return;let t=this.getAttribute("label"),r=e.caption?.textContent.trim()||e.getAttribute("aria-label")?.trim()||e.getAttribute("aria-labelledby")?.trim();if(!r&&t){e.setAttribute("aria-label",t);return}!r&&!Ea&&(Ea=!0,console.warn("[velinstyle] <velin-data-table> needs a <caption>, aria-label, or a label attribute."))}_setupSorting(){this._headers().forEach((e,t)=>{if(this._sortType(e)==="none"||e.querySelector(".velin-data-table__sort"))return;let r=e.textContent.trim();e.dataset.sortLabel=r,e.setAttribute("aria-sort","none"),e.classList.add("velin-data-table__th");let n=document.createElement("button");n.type="button",n.className="velin-data-table__sort",n.textContent=r;let o=document.createElement("span");o.className="velin-data-table__sort-icon",o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.sort(t)),e.textContent="",e.appendChild(n)})}_syncSortState(){this._headers().forEach((e,t)=>{if(this._sortType(e)==="none")return;let r=t===this._sortIndex;e.setAttribute("aria-sort",r?this._sortDirection:"none"),e.querySelector(".velin-data-table__sort")?.classList.toggle("velin-data-table__sort--active",r)})}_bindFilterInput(){this._filterEl&&this._filterEl.removeEventListener("input",this._onFilterInput);let e=this.getAttribute("filter-input");this._filterEl=e?document.querySelector(e):null,this._filterEl&&this._filterEl.addEventListener("input",this._onFilterInput)}_onFilterInput(e){this._filterTimer&&clearTimeout(this._filterTimer);let t=e.target.value;this._filterTimer=setTimeout(()=>this.filter(t),150)}_rowText(e){let t=[...e.cells].filter(n=>n.hasAttribute("data-filter"));return(t.length?t:[...e.cells]).map(n=>n.textContent||"").join(" ").toLowerCase()}_render(){let e=this.pageSize;this._page=Math.min(this._page,this.pageCount);let t=this.matchingRows,r=e?(this._page-1)*e:0,n=e?r+e:t.length;for(let o of this.rows){let a=t.indexOf(o);o.hidden=a===-1||a<r||a>=n}this._renderEmptyState(t.length===0),this._renderPagination()}_renderEmptyState(e){if(!e){this._emptyRow?.remove(),this._emptyRow=null;return}if(this._emptyRow?.isConnected)return;let t=this._headers().length||1,r=document.createElement("tr");r.className="velin-data-table__empty";let n=document.createElement("td");n.colSpan=t,n.textContent=this.getAttribute("empty-text")||"No matching rows",r.appendChild(n),this._table.tBodies[0].appendChild(r),this._emptyRow=r}_renderPagination(){if(!this.pageSize||this.pageCount<=1){this._pagination?.remove(),this._pagination=null;return}if(!this._pagination?.isConnected){let n=document.createElement("nav");n.className="velin-data-table__pagination",n.setAttribute("aria-label",this.getAttribute("pagination-label")||"Table pagination");let o=document.createElement("button");o.type="button",o.className="velin-btn velin-btn--outline velin-btn--sm",o.dataset.velinPage="previous",o.textContent=this.getAttribute("previous-text")||"Previous",o.addEventListener("click",()=>this.goToPage(this._page-1));let a=document.createElement("p");a.className="velin-data-table__page-status",a.dataset.velinPage="status";let l=document.createElement("button");l.type="button",l.className="velin-btn velin-btn--outline velin-btn--sm",l.dataset.velinPage="next",l.textContent=this.getAttribute("next-text")||"Next",l.addEventListener("click",()=>this.goToPage(this._page+1)),n.append(o,a,l),this.appendChild(n),this._pagination=n}let e=this._pagination.querySelector('[data-velin-page="status"]');e&&(e.textContent=`Page ${this._page} of ${this.pageCount}`);let t=this._pagination.querySelector('[data-velin-page="previous"]'),r=this._pagination.querySelector('[data-velin-page="next"]');t&&(t.disabled=this._page<=1),r&&(r.disabled=this._page>=this.pageCount)}};customElements.define("velin-data-table",Ii);Sa=Ii});var Ca={};f(Ca,{default:()=>La});function yn(i){let e=String(i??"");return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[^\w-]/g,t=>`\\${t}`)}function eu(i){let e=i.getAttribute("data-error-label");if(e)return e;let t=i.getAttribute("aria-label");if(t?.trim())return t.trim();let r=i.getAttribute("aria-labelledby");if(r){let o=r.split(/\s+/).map(a=>i.ownerDocument.getElementById(a)?.textContent?.trim()||"").filter(Boolean).join(" ");if(o)return o}if(i.id){let o=i.ownerDocument.querySelector(`label[for="${yn(i.id)}"]`);if(o?.textContent.trim())return o.textContent.trim()}let n=i.closest("label");return n?.textContent.trim()?n.textContent.trim():i.name||"This field"}function tu(i){return i.getAttribute("data-error-message")?.trim()||i.validationMessage||"Invalid value"}function iu(i,e){let t=(i.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);t.includes(e)||(t.push(e),i.setAttribute("aria-describedby",t.join(" ")))}function ru(i,e){let r=(i.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean).filter(n=>n!==e);r.length?i.setAttribute("aria-describedby",r.join(" ")):i.removeAttribute("aria-describedby")}var Zd,Jd,Qd,Mi,La,_n=d(()=>{_e();Zd="input, select, textarea",Jd=new Set(["submit","reset","button","image","hidden"]),Qd=0;Mi=class extends HTMLElement{static get observedAttributes(){return["for","heading"]}constructor(){super(),this._form=null,this._panel=null,this._errors=[],this._onSubmit=this._onSubmit.bind(this),this._onFieldChange=this._onFieldChange.bind(this),this._onReset=this._onReset.bind(this)}connectedCallback(){this.classList.add("velin-form-summary"),requestAnimationFrame(()=>this._bindForm())}disconnectedCallback(){this._unbindForm()}attributeChangedCallback(e,t,r){if(t!==r){if(e==="for"&&this.isConnected)this._unbindForm(),this._bindForm();else if(e==="heading"&&this._panel){let n=this._panel.querySelector(".velin-form-summary__heading");n&&(n.textContent=this.headingText)}}}get form(){return this._form}get errors(){return this._errors.slice()}get headingText(){return this.getAttribute("heading")||"There is a problem"}validate(){if(!this._form)return!0;let e=[];for(let t of this._fields()){if(t.checkValidity()){this._clearFieldError(t);continue}let r={field:t,label:eu(t),message:tu(t)};this._markFieldError(t,r.message),e.push(r)}return this._errors=e,this._render(),e.length===0}clear(){for(let e of this._fields())this._clearFieldError(e);this._errors=[],this._render()}focusFirstError(){let e=this._errors[0];e&&this._focusField(e.field)}_bindForm(){let e=this.getAttribute("for");this._form=e?this.ownerDocument.getElementById(e):this.closest("form"),this._form&&(this.hasAttribute("native-validation")||(this._form.noValidate=!0),this._form.addEventListener("submit",this._onSubmit),this._form.addEventListener("reset",this._onReset),this._form.addEventListener("input",this._onFieldChange),this._form.addEventListener("change",this._onFieldChange))}_unbindForm(){this._form&&(this._form.removeEventListener("submit",this._onSubmit),this._form.removeEventListener("reset",this._onReset),this._form.removeEventListener("input",this._onFieldChange),this._form.removeEventListener("change",this._onFieldChange),this._form=null)}_fields(){if(!this._form)return[];let e=new Set;return[...this._form.querySelectorAll(Zd)].filter(t=>{if(Jd.has(t.type)||t.disabled||t.hasAttribute("data-error-ignore")||typeof t.checkValidity!="function")return!1;if(t.type==="radio"&&t.name){if(e.has(t.name))return!1;e.add(t.name)}return!0})}_onSubmit(e){this.validate()||(e.preventDefault(),this._announceErrors(),this._focusPanel(),this.dispatchEvent(new CustomEvent("velin-form-invalid",{bubbles:!0,detail:{errors:this.errors.map(({label:t,message:r})=>({label:t,message:r}))}})))}_onReset(){requestAnimationFrame(()=>this.clear())}_onFieldChange(e){let t=e.target;!t||!this._errors.some(r=>r.field===t)||t.checkValidity()&&(this._clearFieldError(t),this._errors=this._errors.filter(r=>r.field!==t),this._render(),this._errors.length===0&&this.dispatchEvent(new CustomEvent("velin-form-valid",{bubbles:!0})))}_errorId(e){return e.id||(e.id=`velin-field-${++Qd}`),`${e.id}-error`}_markFieldError(e,t){let r=this._errorId(e);e.setAttribute("aria-invalid","true");let n=this.ownerDocument.getElementById(r);n||(n=this._form.querySelector(`[data-velin-error-for="${yn(e.name||e.id)}"]`)),n||(n=this.ownerDocument.createElement("p"),n.dataset.velinErrorGenerated="true",e.insertAdjacentElement("afterend",n)),n.id=r,n.classList.add("velin-field-error"),n.textContent=t,iu(e,r)}_clearFieldError(e){if(!e.id)return;let t=`${e.id}-error`;e.removeAttribute("aria-invalid"),ru(e,t);let r=this.ownerDocument.getElementById(t);r&&(r.dataset.velinErrorGenerated?r.remove():r.textContent="")}_focusField(e){let t=e.type==="radio"&&e.name&&this._form.querySelector(`input[type="radio"][name="${yn(e.name)}"]`)||e;t.focus(),this.dispatchEvent(new CustomEvent("velin-form-error-focus",{bubbles:!0,detail:{name:t.name||t.id}}))}_render(){if(!this._errors.length){this._panel?.remove(),this._panel=null,this.hidden=!0;return}if(this.hidden=!1,!this._panel?.isConnected){let t=this.ownerDocument.createElement("div");t.className="velin-form-summary__panel velin-alert velin-alert--danger",t.setAttribute("role","alert"),t.tabIndex=-1;let r=this.ownerDocument.createElement("p");r.className="velin-form-summary__heading",r.textContent=this.headingText;let n=this.ownerDocument.createElement("ul");n.className="velin-form-summary__list",t.append(r,n),this.appendChild(t),this._panel=t}let e=this._panel.querySelector(".velin-form-summary__list");e.textContent="";for(let t of this._errors){let r=this.ownerDocument.createElement("li"),n=this.ownerDocument.createElement("a");n.href=`#${this._errorId(t.field).replace(/-error$/,"")}`,n.textContent=`${t.label}: ${t.message}`,n.addEventListener("click",o=>{o.preventDefault(),this._focusField(t.field)}),r.appendChild(n),e.appendChild(r)}}_focusPanel(){this._panel?.focus()}_announceErrors(){let e=this._errors.length;re(e===1?"1 field needs attention":`${e} fields need attention`,"assertive")}};customElements.define("velin-form-summary",Mi);La=Mi});var Ma={};f(Ma,{default:()=>Ia});var Ra,nu,ou,Di,Ia,Oi=d(()=>{_e();Ra={live:"var(--velin-color-success, oklch(60% 0.16 145))",paused:"var(--velin-color-text-muted, oklch(60% 0.02 240))",warning:"var(--velin-color-warning, oklch(75% 0.16 80))",error:"var(--velin-color-danger, oklch(60% 0.2 25))",muted:"var(--velin-color-border, oklch(85% 0.01 240))"},nu=`
|
|
1164
|
+
<style>${da}</style>
|
|
1165
|
+
<button type="button" part="reveal" aria-label="${ye(e)}">${m(e)}</button>
|
|
1166
|
+
`,this.shadowRoot.querySelector("button").addEventListener("click",()=>{this._revealed=!0,this.render(),this.dispatchEvent(new CustomEvent("velin-email-reveal",{bubbles:!0,detail:{email:t}}))})}};customElements.get("velin-email")||customElements.define("velin-email",Ai);ua=Ai});var ma={};y(ma,{default:()=>pa});function Ce(r){let e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),i=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${i}`}function He(r){if(!r)return null;let e=String(r).match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!e)return null;let t=new Date(Number(e[1]),Number(e[2])-1,Number(e[3]));return Number.isNaN(t.getTime())?null:t}var bu,ki,pa,ln=p(()=>{T();bu=`
|
|
1167
|
+
:host { display: block; max-inline-size: 100%; }
|
|
1168
|
+
.cal {
|
|
1169
|
+
box-sizing: border-box;
|
|
1170
|
+
border: 1px solid var(--velin-color-border, #ddd);
|
|
1171
|
+
border-radius: var(--velin-radius-md, 0.5rem);
|
|
1172
|
+
background: var(--velin-color-surface, #fff);
|
|
1173
|
+
color: var(--velin-color-text, #111);
|
|
1174
|
+
padding: var(--velin-space-3, 0.75rem);
|
|
1175
|
+
max-inline-size: min(20rem, 100%);
|
|
1176
|
+
inline-size: 100%;
|
|
1177
|
+
}
|
|
1178
|
+
.head {
|
|
1179
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
1180
|
+
gap: var(--velin-space-2, 0.5rem); margin-block-end: var(--velin-space-3, 0.75rem);
|
|
1181
|
+
}
|
|
1182
|
+
.title { font-weight: var(--velin-weight-semibold, 600); margin: 0; font-size: var(--velin-text-base, 1rem); }
|
|
1183
|
+
.nav {
|
|
1184
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
1185
|
+
flex-shrink: 0;
|
|
1186
|
+
min-inline-size: 2.5rem; min-block-size: 2.5rem;
|
|
1187
|
+
border: 1px solid var(--velin-color-border, #ddd);
|
|
1188
|
+
border-radius: var(--velin-radius-sm, 0.25rem);
|
|
1189
|
+
background: var(--velin-color-surface-bright, #fff);
|
|
1190
|
+
color: inherit; cursor: pointer;
|
|
1191
|
+
}
|
|
1192
|
+
.nav:focus-visible { outline: 2px solid var(--velin-color-focus, #2563eb); outline-offset: 2px; }
|
|
1193
|
+
.grid {
|
|
1194
|
+
display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem;
|
|
1195
|
+
}
|
|
1196
|
+
.dow {
|
|
1197
|
+
text-align: center; font-size: var(--velin-text-xs, 0.75rem);
|
|
1198
|
+
color: var(--velin-color-text-muted, #64748b); padding-block: 0.25rem;
|
|
1199
|
+
}
|
|
1200
|
+
.day {
|
|
1201
|
+
inline-size: 100%;
|
|
1202
|
+
min-inline-size: 0;
|
|
1203
|
+
min-block-size: 2.25rem;
|
|
1204
|
+
aspect-ratio: 1;
|
|
1205
|
+
border: none; border-radius: var(--velin-radius-sm, 0.25rem);
|
|
1206
|
+
background: transparent; color: inherit; cursor: pointer;
|
|
1207
|
+
font: inherit;
|
|
1208
|
+
padding: 0;
|
|
1209
|
+
}
|
|
1210
|
+
.day[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }
|
|
1211
|
+
.day[aria-selected="true"] {
|
|
1212
|
+
background: var(--velin-color-primary, #2563eb);
|
|
1213
|
+
color: var(--velin-color-on-primary, #fff);
|
|
1214
|
+
}
|
|
1215
|
+
.day:not([aria-disabled="true"]):hover {
|
|
1216
|
+
background: var(--velin-color-primary-subtle, #eff6ff);
|
|
1217
|
+
}
|
|
1218
|
+
.day:focus-visible { outline: 2px solid var(--velin-color-focus, #2563eb); outline-offset: 1px; }
|
|
1219
|
+
.out { color: var(--velin-color-text-muted, #94a3b8); }
|
|
1220
|
+
`;ki=class extends HTMLElement{static get observedAttributes(){return["value","min","max","label"]}constructor(){super(),this.attachShadow({mode:"open"}),this._view=new Date,this._view.setDate(1),this._onKey=this._onKey.bind(this)}connectedCallback(){let e=He(this.getAttribute("value"))||new Date;this._view=new Date(e.getFullYear(),e.getMonth(),1),this._render()}attributeChangedCallback(e,t,i){if(!(t===i||!this.shadowRoot?.querySelector(".cal"))){if(e==="value"&&i){let n=He(i);n&&(this._view=new Date(n.getFullYear(),n.getMonth(),1))}this._render()}}get value(){return this.getAttribute("value")||""}set value(e){e?this.setAttribute("value",e):this.removeAttribute("value")}_inRange(e){let t=He(this.getAttribute("min")),i=He(this.getAttribute("max"));return!(t&&e<t||i&&e>i)}_select(e){if(!this._inRange(e))return;let t=Ce(e);this.setAttribute("value",t),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:t,date:e}})),this._render()}_shiftMonth(e){this._view=new Date(this._view.getFullYear(),this._view.getMonth()+e,1),this._render()}_onKey(e){let t=He(this.getAttribute("value"))||new Date,i=new Date(t);switch(e.key){case"ArrowLeft":i.setDate(i.getDate()-1);break;case"ArrowRight":i.setDate(i.getDate()+1);break;case"ArrowUp":i.setDate(i.getDate()-7);break;case"ArrowDown":i.setDate(i.getDate()+7);break;case"Home":i=new Date(i.getFullYear(),i.getMonth(),1);break;case"End":i=new Date(i.getFullYear(),i.getMonth()+1,0);break;case"PageUp":i=new Date(i.getFullYear(),i.getMonth()-1,i.getDate());break;case"PageDown":i=new Date(i.getFullYear(),i.getMonth()+1,i.getDate());break;case"Enter":case" ":e.preventDefault(),this._select(t);return;default:return}e.preventDefault(),this._inRange(i)&&(this._view=new Date(i.getFullYear(),i.getMonth(),1),this.setAttribute("value",Ce(i)),this.dispatchEvent(new CustomEvent("velin-change",{bubbles:!0,detail:{value:Ce(i),date:i}})),this._render(),this.shadowRoot.querySelector(`[data-iso="${Ce(i)}"]`)?.focus())}_render(){let e=m(this.getAttribute("label")||"Choose date"),t=He(this.getAttribute("value")),i=this._view.getFullYear(),n=this._view.getMonth(),o=this._view.toLocaleString(void 0,{month:"long",year:"numeric"}),c=(new Date(i,n,1).getDay()+6)%7,u=new Date(i,n+1,0).getDate(),_=["Mo","Tu","We","Th","Fr","Sa","Su"].map(b=>`<div class="dow" aria-hidden="true">${b}</div>`).join("");for(let b=0;b<c;b+=1){let g=new Date(i,n,-c+b+1);_+=`<button type="button" class="day out" tabindex="-1" data-iso="${Ce(g)}" aria-label="${Ce(g)}">${g.getDate()}</button>`}for(let b=1;b<=u;b+=1){let g=new Date(i,n,b),R=Ce(g),k=t&&Ce(t)===R,A=!this._inRange(g);_+=`<button type="button" class="day" data-iso="${R}" aria-label="${R}" aria-selected="${k?"true":"false"}" aria-disabled="${A?"true":"false"}" tabindex="${k?"0":"-1"}">${b}</button>`}this.shadowRoot.innerHTML=`
|
|
1221
|
+
<style>${bu}</style>
|
|
1222
|
+
<div class="cal" role="group" aria-label="${e}">
|
|
1223
|
+
<div class="head">
|
|
1224
|
+
<button type="button" class="nav" data-nav="-1" aria-label="Previous month">\u2039</button>
|
|
1225
|
+
<p class="title" id="cal-title">${m(o)}</p>
|
|
1226
|
+
<button type="button" class="nav" data-nav="1" aria-label="Next month">\u203A</button>
|
|
1227
|
+
</div>
|
|
1228
|
+
<div class="grid" role="grid" aria-labelledby="cal-title">${_}</div>
|
|
1229
|
+
</div>
|
|
1230
|
+
`,this.shadowRoot.querySelectorAll("[data-nav]").forEach(b=>{b.addEventListener("click",()=>this._shiftMonth(Number(b.getAttribute("data-nav"))))}),this.shadowRoot.querySelectorAll(".day").forEach(b=>{b.addEventListener("click",()=>{if(b.getAttribute("aria-disabled")==="true")return;let g=He(b.getAttribute("data-iso"));g&&this._select(g)}),b.addEventListener("keydown",this._onKey)})}};customElements.define("velin-calendar",ki);pa=ki});function H(r,e){let t=[],i=0;for(;i<r.length;){let n=!1;for(let{type:o,re:a}of e){a.lastIndex=i;let c=a.exec(r);if(c&&c.index===i){t.push({type:o,value:c[0]}),i+=c[0].length,n=!0;break}}if(!n){let o=t[t.length-1];o?.type==="plain"?o.value+=r[i]:t.push({type:"plain",value:r[i]}),i+=1}}return t}function Re(r,e,t){let i=[...t,{type:"keyword",re:new RegExp(`\\b(${Object.keys(e).join("|")})\\b`,"y")},{type:"identifier",re:/\b[A-Za-z_$][\w$]*\b/y}];return H(r,i)}var J=p(()=>{});var cn={};y(cn,{default:()=>rt});function rt(r){return Re(r,vu,gu)}var vu,gu,_t=p(()=>{J();vu={const:1,let:1,var:1,function:1,return:1,if:1,else:1,for:1,while:1,do:1,switch:1,case:1,break:1,continue:1,new:1,class:1,extends:1,import:1,export:1,from:1,default:1,async:1,await:1,try:1,catch:1,finally:1,throw:1,typeof:1,instanceof:1,in:1,of:1,true:1,false:1,null:1,undefined:1,void:1,this:1},gu=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"string",re:/`(?:\\.|[^`\\])*`/y},{type:"number",re:/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"operator",re:/[+\-*/%=<>!&|^~?:]+/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var dn={};y(dn,{default:()=>fa});function fa(r){return rt(r).map(e=>e.type==="identifier"&&yu.has(e.value)?{type:"keyword",value:e.value}:e)}var yu,un=p(()=>{_t();yu=new Set(["type","interface","enum","implements","declare","namespace","readonly","public","private","protected","abstract","as","satisfies","keyof"])});var Si={};y(Si,{default:()=>ba});function ba(r){return H(r,_u)}var _u,Ti=p(()=>{J();_u=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"tag",re:/<\/?[\w-]+/y},{type:"punctuation",re:/[<>/=]/y},{type:"attr-name",re:/\s[\w-]+(?==)/y},{type:"attr-value",re:/=(?:"[^"]*"|'[^']*'|[^\s>]+)/y}]});var ga={};y(ga,{default:()=>va});function va(r){return Re(r,xu,wu)}var xu,wu,ya=p(()=>{J();xu={important:1,inherit:1,initial:1,unset:1,revert:1},wu=[{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/#[\da-fA-F]{3,8}\b|\b\d+(?:\.\d+)?(?:%|[a-z]+)?\b/y},{type:"tag",re:/\.[\w-]+|#[\w-]+/y},{type:"attr-name",re:/[\w-]+(?=\s*:)/y},{type:"punctuation",re:/[{}:;,()]/y},{type:"operator",re:/[+\-*/>~]/y}]});var xa={};y(xa,{default:()=>_a});function _a(r){return H(r,Au)}var Au,wa=p(()=>{J();Au=[{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"number",re:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/y},{type:"keyword",re:/\b(true|false|null)\b/y},{type:"punctuation",re:/[{}[\]:,]/y}]});var hn={};y(hn,{default:()=>Aa});function Aa(r){return H(r,Eu)}var Eu,pn=p(()=>{J();Eu=[{type:"comment",re:/<!--[\s\S]*?-->/y},{type:"string",re:/```[\s\S]*?```/y},{type:"string",re:/`[^`\n]+`/y},{type:"keyword",re:/#{1,6}\s[^\n]+/y},{type:"tag",re:/\[[^\]]+\]\([^)]+\)/y},{type:"operator",re:/[*_~]/y}]});var Li={};y(Li,{default:()=>Ea});function Ea(r){return Re(r,ku,Su)}var ku,Su,Ci=p(()=>{J();ku={if:1,then:1,else:1,fi:1,for:1,do:1,done:1,while:1,case:1,esac:1,function:1,return:1,export:1,local:1},Su=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'[^']*'/y},{type:"number",re:/\b\d+\b/y},{type:"operator",re:/[|&<>]/y},{type:"punctuation",re:/[();]/y}]});var Sa={};y(Sa,{default:()=>ka});function ka(r){return H(r,Tu)}var Tu,Ta=p(()=>{J();Tu=[{type:"comment",re:/--[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"keyword",re:/\b(?:SELECT|FROM|WHERE|INSERT|INTO|VALUES|UPDATE|SET|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AND|OR|NOT|NULL|AS|ORDER|BY|GROUP|HAVING|LIMIT|CREATE|TABLE|INDEX)\b/yi},{type:"operator",re:/[=<>!]+|,/y},{type:"punctuation",re:/[();]/y}]});var xt={};y(xt,{default:()=>La});function La(r){return r?[{type:"plain",value:r}]:[]}var wt=p(()=>{});var Ra={};y(Ra,{default:()=>Ca});function Ca(r){return Re(r,Lu,Cu)}var Lu,Cu,Ma=p(()=>{J();Lu={function:1,return:1,if:1,else:1,elseif:1,foreach:1,while:1,class:1,new:1,public:1,private:1,protected:1,static:1,namespace:1,use:1,true:1,false:1,null:1},Cu=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/#[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"number",re:/\b\d+(?:\.\d+)?\b/y},{type:"operator",re:/=>|\+\+|--|===|!==|==|!=|<=|>=|->|\?\?|[=+\-*/%.<>!&|^~?:]/y},{type:"punctuation",re:/[{}[\]();,.]/y}]});var Da={};y(Da,{default:()=>Ia});function Ia(r){return H(r,Ru)}var Ru,Oa=p(()=>{J();Ru=[{type:"comment",re:/{{--[\s\S]*?--}}/y},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:\\.|[^'\\])*'/y},{type:"keyword",re:/@(?:vite|csrf|auth|guest|section|endsection|yield|extends|include|push|endpush|stack|once|endonce|forelse|empty|endempty|can|endcan|cannot|endcannot)\b/y},{type:"operator",re:/{{|}}|{!!|!!}|@[{}]/y},{type:"punctuation",re:/[()[\],]/y}]});var mn={};y(mn,{default:()=>Na});function Na(r){return H(r,Mu)}var Mu,fn=p(()=>{J();Mu=[{type:"comment",re:/#[^\n]*/y},{type:"string",re:/[rbfu]{0,2}"""[\s\S]*?"""/y},{type:"string",re:/[rbfu]{0,2}'''[\s\S]*?'''/y},{type:"string",re:/[rbfu]{0,2}"(?:\\.|[^"\\\n])*"/y},{type:"string",re:/[rbfu]{0,2}'(?:\\.|[^'\\\n])*'/y},{type:"number",re:/\b0[xX][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?j?\b/y},{type:"keyword",re:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/y},{type:"builtin",re:/\b(?:None|True|False|self|cls|abs|all|any|bool|bytes|dict|dir|enumerate|filter|float|format|frozenset|getattr|hasattr|int|isinstance|issubclass|iter|len|list|map|max|min|next|object|open|print|range|repr|reversed|round|set|setattr|sorted|str|sum|super|tuple|type|zip)\b/y},{type:"operator",re:/->|:=|\*\*=?|\/\/=?|<<=?|>>=?|[-+*/%&|^~<>!=]=?/y},{type:"punctuation",re:/[[\]{}(),:;.@]/y},{type:"identifier",re:/\b[A-Za-z_]\w*\b/y}]});var bn={};y(bn,{default:()=>za});function za(r){return H(r,Iu)}var Iu,vn=p(()=>{J();Iu=[{type:"comment",re:/#[^\n]*/y},{type:"punctuation",re:/^(?:---|\.\.\.)$/my},{type:"string",re:/"(?:\\.|[^"\\])*"/y},{type:"string",re:/'(?:''|[^'])*'/y},{type:"attr-name",re:/^[ \t]*-?[ \t]*[\w.$-]+(?=[ \t]*:(?:[ \t]|$))/my},{type:"punctuation",re:/^[ \t]*-(?=[ \t]|$)/my},{type:"keyword",re:/\b(?:true|false|null|yes|no|on|off|~)\b/yi},{type:"number",re:/\b-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/y},{type:"operator",re:/[&*]\w+|![\w/!-]*|[|>][+-]?\d*(?=\s*$)/my},{type:"punctuation",re:/[:,[\]{}]/y}]});var gn={};y(gn,{default:()=>$a});function $a(r){return H(r,Du)}var Du,yn=p(()=>{J();Du=[{type:"comment",re:/\/\/[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/`[^`]*`/y},{type:"string",re:/"(?:\\.|[^"\\\n])*"/y},{type:"string",re:/'(?:\\.|[^'\\\n])*'/y},{type:"number",re:/\b0[xX][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?i?\b/y},{type:"keyword",re:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/y},{type:"builtin",re:/\b(?:append|bool|byte|cap|clear|close|complex|complex64|complex128|copy|delete|error|float32|float64|imag|int|int8|int16|int32|int64|len|make|max|min|new|nil|panic|print|println|real|recover|rune|string|true|false|iota|uint|uint8|uint16|uint32|uint64|uintptr|any)\b/y},{type:"operator",re:/:=|\.\.\.|&&|\|\||<-|\+\+|--|<<=?|>>=?|&\^=?|[-+*/%&|^<>!=]=?|~/y},{type:"punctuation",re:/[[\]{}(),;:.]/y},{type:"identifier",re:/\b[A-Za-z_]\w*\b/y}]});var _n={};y(_n,{default:()=>Fa});function Fa(r){return H(r,Ou)}var Ou,xn=p(()=>{J();Ou=[{type:"comment",re:/\/\/\/?[^\n]*/y},{type:"comment",re:/\/\*[\s\S]*?\*\//y},{type:"string",re:/b?r(#*)"[\s\S]*?"\1/y},{type:"string",re:/b?"(?:\\.|[^"\\])*"/y},{type:"string",re:/b?'(?:\\.|[^'\\])'/y},{type:"builtin",re:/#!?\[[^\]]*\]/y},{type:"number",re:/\b0[xXbo][\da-fA-F_]+\b|\b\d[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?(?:[iuf](?:8|16|32|64|128|size))?\b/y},{type:"keyword",re:/\b(?:as|async|await|break|const|continue|crate|dyn|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|unsafe|use|where|while)\b/y},{type:"builtin",re:/\b(?:bool|char|f32|f64|i8|i16|i32|i64|i128|isize|str|u8|u16|u32|u64|u128|usize|String|Vec|Option|Result|Some|None|Ok|Err|Box|Rc|Arc|true|false)\b/y},{type:"operator",re:/'[a-z_]\w*\b/y},{type:"operator",re:/=>|->|::|\.\.=?|&&|\|\||<<=?|>>=?|[-+*/%&|^<>!=]=?|[?@]/y},{type:"punctuation",re:/[[\]{}(),;:.#]/y},{type:"identifier",re:/\b[A-Za-z_]\w*!?\b/y}]});function _e(r){let e=(r||"").trim().toLowerCase();return e?e.startsWith("language-")?_e(e.slice(9)):{javascript:"js",jsx:"js",typescript:"ts",tsx:"ts",markup:"html",xml:"html",svg:"html",bash:"shell",sh:"shell",zsh:"shell",md:"markdown",plaintext:"text","plain-text":"text",yml:"yaml",toml:"text",ini:"text",php8:"php",py:"python",python3:"python",golang:"go",rs:"rust"}[e]||e:""}function ot(r,e){nt.set(_e(r),e)}function At(r){return nt.get(_e(r))}async function Me(r){let e=_e(r);if(!e)return;if(nt.has(e))return nt.get(e);if(Ri.has(e))return Ri.get(e);let t=Ha[e];if(!t)return;let i=t().then(n=>{let o=n.default;return nt.set(e,o),Ri.delete(e),o});return Ri.set(e,i),i}function Mi(){return[...new Set([...nt.keys(),...Object.keys(Ha)])]}var nt,Ri,Ha,Ii=p(()=>{_t();nt=new Map,Ri=new Map,Ha={js:()=>Promise.resolve().then(()=>(_t(),cn)),javascript:()=>Promise.resolve().then(()=>(_t(),cn)),ts:()=>Promise.resolve().then(()=>(un(),dn)),typescript:()=>Promise.resolve().then(()=>(un(),dn)),html:()=>Promise.resolve().then(()=>(Ti(),Si)),xml:()=>Promise.resolve().then(()=>(Ti(),Si)),css:()=>Promise.resolve().then(()=>(ya(),ga)),json:()=>Promise.resolve().then(()=>(wa(),xa)),md:()=>Promise.resolve().then(()=>(pn(),hn)),markdown:()=>Promise.resolve().then(()=>(pn(),hn)),shell:()=>Promise.resolve().then(()=>(Ci(),Li)),bash:()=>Promise.resolve().then(()=>(Ci(),Li)),sh:()=>Promise.resolve().then(()=>(Ci(),Li)),sql:()=>Promise.resolve().then(()=>(Ta(),Sa)),text:()=>Promise.resolve().then(()=>(wt(),xt)),plain:()=>Promise.resolve().then(()=>(wt(),xt)),txt:()=>Promise.resolve().then(()=>(wt(),xt)),markup:()=>Promise.resolve().then(()=>(Ti(),Si)),console:()=>Promise.resolve().then(()=>(wt(),xt)),php:()=>Promise.resolve().then(()=>(Ma(),Ra)),blade:()=>Promise.resolve().then(()=>(Oa(),Da)),python:()=>Promise.resolve().then(()=>(fn(),mn)),py:()=>Promise.resolve().then(()=>(fn(),mn)),yaml:()=>Promise.resolve().then(()=>(vn(),bn)),yml:()=>Promise.resolve().then(()=>(vn(),bn)),go:()=>Promise.resolve().then(()=>(yn(),gn)),golang:()=>Promise.resolve().then(()=>(yn(),gn)),rust:()=>Promise.resolve().then(()=>(xn(),_n)),rs:()=>Promise.resolve().then(()=>(xn(),_n))};ot("js",rt)});function wn(r){return r.replace(/[&<>"]/g,e=>Nu[e]||e)}function Di(r){return r.map(e=>{let t=e.type==="plain"?"":e.type;return`<span class="${t?`velin-token velin-token--${t}`:"velin-token"}">${wn(e.value)}</span>`}).join("")}function Oi(r,e){r.innerHTML=Di(e),r.classList.add("velin-syntax-ready"),r.closest("pre")?.classList.add("velin-syntax-ready"),r.closest(".velin-code-block")?.classList.add("velin-syntax-ready")}var Nu,An=p(()=>{Nu={"&":"&","<":"<",">":">",'"':"""}});function En(r){let e=r.tagName==="PRE"?r:r.closest("pre"),t=r.tagName==="CODE"?r:e?.querySelector("code")||r,i=e||t,n=i.getAttribute("language")||i.getAttribute("data-language")||i.getAttribute("velin-code")||"";if(n&&n!=="true")return _e(n);let a=(t?.className||"").match(/\blanguage-([\w-]+)\b/i);return a?_e(a[1]):""}function Ni(r){let t=(r.tagName==="CODE"?r:r.querySelector("code"))||r;if(t.dataset.velinSource!=null)return t.dataset.velinSource;let i=t.innerHTML;if(i&&/<|>|&/.test(i)){let n=document.createElement("textarea");if(n.innerHTML=i.replace(/<br\s*\/?>/gi,`
|
|
1231
|
+
`),n.value)return n.value}return t.textContent||""}async function de(r,e={}){if(r.dataset.velinHighlighted==="1")return;let t=r.tagName==="PRE"?r:r.closest("pre")||r,i=r.tagName==="CODE"?r:t.querySelector("code")||document.createElement("code");if(!t.querySelector("code")&&i!==r){let c=Ni(t);i.textContent=c,t.textContent="",t.appendChild(i)}i.dataset.velinSource||(i.dataset.velinSource=i.textContent||"");let n=e.language||En(t);if(!n)return;t.classList.add("velin-syntax-pending"),i.classList.add("velin-syntax-pending");let o=e.lexer||At(n);o||(o=await Me(n)),o||(o=At("text")||await Me("text"));let a=i.dataset.velinSource||Ni(i)||"";if(!o){i.textContent=a,t.classList.remove("velin-syntax-pending"),i.classList.remove("velin-syntax-pending"),t.classList.add("velin-syntax-ready"),i.classList.add("velin-syntax-ready");return}try{let c=o(a);Oi(i,c),i.dataset.velinHighlighted="1",t.dataset.velinHighlighted="1"}catch(c){console.warn("[velin-highlight]",n,c),i.textContent=a}t.classList.remove("velin-syntax-pending"),i.classList.remove("velin-syntax-pending"),t.classList.add("velin-syntax-ready"),i.classList.add("velin-syntax-ready")}async function Et(r=document){let e=r.querySelectorAll('pre[velin-code], pre[data-language], pre code[class*="language-"], [velin-code-block] pre, .velin-doc-example__code pre');await Promise.all([...e].map(t=>de(t)))}var zi=p(()=>{Ii();An()});function Tn(r){kn.add(r),Sn||(Sn=requestAnimationFrame(()=>{Sn=0;let e=[...kn];kn.clear(),e.forEach(t=>t())}))}function zu(r={}){return typeof IntersectionObserver>"u"?null:(Pe||(Pe=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let i=Ln.get(t.target);i&&Tn(()=>i(t.target)),t.target.dataset.velinOnce!=="false"&&Pe.unobserve(t.target)}},{threshold:r.threshold??.1,rootMargin:r.rootMargin??"0px 0px -40px 0px"})),Pe)}function kt(r,e,t={}){let i=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=r.closest('[data-velin-motion="off"]')||r.dataset.velinMotion==="off";if(i||n)return Tn(()=>e(r,!0)),()=>{};let o=zu(t);return o?(Ln.set(r,e),o.observe(r),()=>{Ln.delete(r),o.unobserve(r)}):(Tn(()=>e(r,!0)),()=>{})}function Pa(){Pe&&(Pe.disconnect(),Pe=null)}var kn,Sn,Pe,Ln,Cn=p(()=>{kn=new Set,Sn=0;Pe=null,Ln=new WeakMap});function Ie(r=document,e={}){if(typeof document>"u")return()=>{};let t=e.selector||["pre[velin-code]","pre[language]","pre[data-language]",'pre code[class*="language-"]',"velin-code-block pre",".velin-doc-example__code pre"].join(","),i=r.querySelectorAll(t),n=[],o=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;for(let a of i){let c=a.tagName==="PRE"?a:a.closest("pre");if(!c||c.dataset.velinObserve==="1")continue;if(c.dataset.velinObserve="1",o||e.immediate){de(c);continue}c.classList.add("velin-syntax-pending");let u=kt(c,async f=>{await de(f)});n.push(u)}return()=>n.forEach(a=>a())}var St,Rn=p(()=>{zi();Cn();St=Ie});var Mn={};y(Mn,{applyHighlight:()=>Oi,escapeHtml:()=>wn,getLanguage:()=>At,getSourceText:()=>Ni,highlightAll:()=>Et,highlightElement:()=>de,initHighlight:()=>Ie,lazyLoadLanguage:()=>Me,listLanguages:()=>Mi,normalizeLanguage:()=>_e,observeCodeBlocks:()=>St,registerLanguage:()=>ot,renderTokens:()=>Di,resolveLanguage:()=>En,velinSyntax:()=>qa});var qa,Tt=p(()=>{Ii();An();zi();Rn();zi();Rn();Ii();qa={highlightElement:de,highlightAll:Et,initHighlight:Ie,observeCodeBlocks:St,registerLanguage:ot,lazyLoadLanguage:Me,listLanguages:Mi}});var Ua={};y(Ua,{default:()=>Ba});function $u(r){let e=new Set;if(!r)return e;for(let t of r.split(",")){let i=t.trim();if(i)if(i.includes("-")){let[n,o]=i.split("-").map(a=>parseInt(a,10));if(!Number.isNaN(n)&&!Number.isNaN(o))for(let a=Math.min(n,o);a<=Math.max(n,o);a+=1)e.add(a)}else{let n=parseInt(i,10);Number.isNaN(n)||e.add(n)}}return e}var $i,Ba,In=p(()=>{Tt();$i=class extends HTMLElement{static get observedAttributes(){return["language","highlight","line-numbers","collapsed"]}connectedCallback(){this._built||(this._built=!0,this.classList.add("velin-code-block"),this._render(),this._setupHighlight())}attributeChangedCallback(){this._built&&(this._render(),this._setupHighlight())}_render(){let e=this.getAttribute("language")||"",t=this.hasAttribute("line-numbers"),i=this.hasAttribute("collapsed"),n=$u(this.getAttribute("highlight")||""),o=this.textContent.trim();this.textContent="";let a=document.createElement("div");a.className="velin-code-block__toolbar",a.innerHTML="";let c=document.createElement("velin-copy");c.setAttribute("value",o),c.setAttribute("label","Copy"),a.appendChild(c);let u=`velin-code-panel-${Math.random().toString(36).slice(2,9)}`,f=document.createElement("div");if(f.id=u,f.className=t?"velin-code-block__gutter":"",i){let g=document.createElement("button");g.type="button",g.className="velin-btn velin-btn--sm velin-btn--ghost",g.textContent="Expand",g.setAttribute("aria-expanded","false"),g.setAttribute("aria-controls",u),g.setAttribute("aria-label","Expand code block"),g.addEventListener("click",()=>{this.hasAttribute("data-collapsed")?(this.removeAttribute("data-collapsed"),g.textContent="Collapse",g.setAttribute("aria-expanded","true"),g.setAttribute("aria-label","Collapse code block")):(this.setAttribute("data-collapsed",""),g.textContent="Expand",g.setAttribute("aria-expanded","false"),g.setAttribute("aria-label","Expand code block"))}),this.setAttribute("data-collapsed",""),a.appendChild(g)}if(t){let g=document.createElement("div");g.className="velin-code-block__line-numbers";let k=o.split(`
|
|
1232
|
+
`).length;g.textContent="";for(let A=0;A<k;A+=1){let S=A+1,j=document.createElement("span");n.has(S)&&(j.className="velin-code-block__line--highlight"),j.textContent=String(S),g.appendChild(j)}f.appendChild(g)}let _=document.createElement("pre");e&&(_.setAttribute("language",e),_.dataset.language=e);let b=document.createElement("code");e&&(b.className=`language-${e}`),b.textContent=o,_.appendChild(b),f.appendChild(_),this.appendChild(a),this.appendChild(f),this._pre=_}async _setupHighlight(){if(!this._pre)return;delete this._pre.dataset.velinHighlighted,delete this._pre.dataset.velinObserve,typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await de(this._pre):Ie(this,{root:this})}};customElements.define("velin-code-block",$i);Ba=$i});var Ka={};y(Ka,{default:()=>ja});function Hu(r){let e=(r.getAttribute("format")||"number").toLowerCase(),t=r.getAttribute("locale")||void 0,i=r.getAttribute("decimals"),n=i!=null?Math.max(0,Number.parseInt(i,10)||0):null,o={};n!=null&&(o.minimumFractionDigits=n,o.maximumFractionDigits=n),e==="currency"?(o.style="currency",o.currency=r.getAttribute("currency")||"EUR"):e==="percent"&&(o.style="percent");try{return new Intl.NumberFormat(t,o)}catch{return new Intl.NumberFormat(void 0,o)}}var Fu,Fi,ja,Hi=p(()=>{Fu=r=>r===1?1:1-Math.pow(2,-10*r);Fi=class extends HTMLElement{static get observedAttributes(){return["from","to","duration","decimals","prefix","suffix","format","currency","locale"]}constructor(){super(),this._rafId=0,this._started=!1,this._observer=null}connectedCallback(){this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true"),this._render(this._fromValue()),this.getAttribute("autostart")!=="false"&&this._scheduleStart()}disconnectedCallback(){cancelAnimationFrame(this._rafId),this._observer?.disconnect()}attributeChangedCallback(e){this.isConnected&&(e==="to"||e==="from"?this.start():this._render(this._lastValue??this._toValue()))}_fromValue(){return Number.parseFloat(this.getAttribute("from"))||0}_toValue(){return Number.parseFloat(this.getAttribute("to"))||0}_duration(){return Math.max(0,Number.parseFloat(this.getAttribute("duration"))||900)}_scheduleStart(){if(!this._started){if(typeof IntersectionObserver>"u"){this.start();return}this._observer=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){this.start(),this._observer.disconnect(),this._observer=null;break}},{threshold:.2}),this._observer.observe(this)}}start(){cancelAnimationFrame(this._rafId),this._started=!0;let e=this._fromValue(),t=this._toValue(),i=this._duration();if(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||i===0){this._render(t);return}let o=performance.now(),a=c=>{let u=Math.min(1,(c-o)/i),f=e+(t-e)*Fu(u);this._render(f),u<1&&(this._rafId=requestAnimationFrame(a))};this._rafId=requestAnimationFrame(a)}reset(){cancelAnimationFrame(this._rafId),this._started=!1,this._render(this._fromValue())}_render(e){this._lastValue=e;let t=Hu(this),i=this.getAttribute("prefix")||"",n=this.getAttribute("suffix")||"";this.textContent=`${i}${t.format(e)}${n}`}};typeof customElements<"u"&&!customElements.get("velin-counter")&&customElements.define("velin-counter",Fi);ja=Fi});var Va={};y(Va,{default:()=>Ya});function Ga(r,e){let i=(r?.dataset?.sortValue??r?.textContent??"").trim();if(e==="number"){let n=Number.parseFloat(i.replace(/[^\d.,-]/g,"").replace(",","."));return Number.isNaN(n)?Number.NEGATIVE_INFINITY:n}if(e==="date"){let n=Date.parse(i);return Number.isNaN(n)?Number.NEGATIVE_INFINITY:n}return i.toLowerCase()}var Pu,Wa,Pi,Ya,Dn=p(()=>{Le();Pu=new Set(["text","number","date"]),Wa=!1;Pi=class extends HTMLElement{static get observedAttributes(){return["page-size","filter-input","empty-text","label","editable"]}constructor(){super(),this._table=null,this._page=1,this._query="",this._sortIndex=-1,this._sortDirection="ascending",this._filterEl=null,this._pagination=null,this._emptyRow=null,this._filterTimer=null,this._onFilterInput=this._onFilterInput.bind(this)}connectedCallback(){this.classList.add("velin-data-table"),requestAnimationFrame(()=>this._init())}disconnectedCallback(){this._filterEl&&this._filterEl.removeEventListener("input",this._onFilterInput),this._filterTimer&&clearTimeout(this._filterTimer)}attributeChangedCallback(e,t,i){t===i||!this._table||(e==="page-size"?(this._page=1,this._render()):e==="filter-input"?this._bindFilterInput():e==="label"&&this._ensureAccessibleName())}get rows(){let e=this._table?.tBodies?.[0];return e?[...e.rows].filter(t=>t!==this._emptyRow):[]}get matchingRows(){return this.rows.filter(e=>!e.dataset.velinFiltered)}get visibleRows(){return this.matchingRows.filter(e=>!e.hidden)}get page(){return this._page}get pageSize(){let e=Number.parseInt(this.getAttribute("page-size")||"",10);return Number.isFinite(e)&&e>0?e:0}get pageCount(){let e=this.pageSize;return e?Math.max(1,Math.ceil(this.matchingRows.length/e)):1}sort(e,t){let n=this._headers()[e];if(!n)return;let o=this._sortType(n);if(o==="none")return;this._sortDirection=t||(this._sortIndex===e&&this._sortDirection==="ascending"?"descending":"ascending"),this._sortIndex=e;let a=this._sortDirection==="ascending"?1:-1,c=this._table.tBodies[0],u=this.rows.slice().sort((_,b)=>{let g=Ga(_.cells[e],o),R=Ga(b.cells[e],o);return g<R?-1*a:g>R?1*a:0});for(let _ of u)c.appendChild(_);this._syncSortState(),this._page=1,this._render();let f=n.dataset.sortLabel||n.textContent.trim();ne(`${f} sorted ${this._sortDirection}`),this.dispatchEvent(new CustomEvent("velin-data-table-sort",{bubbles:!0,detail:{index:e,direction:this._sortDirection,column:f}}))}filter(e){this._query=String(e||"").trim().toLowerCase();for(let i of this.rows)!this._query||this._rowText(i).includes(this._query)?delete i.dataset.velinFiltered:i.dataset.velinFiltered="true";this._page=1,this._render();let t=this.matchingRows.length;ne(t===1?"1 row matches":`${t} rows match`),this.dispatchEvent(new CustomEvent("velin-data-table-filter",{bubbles:!0,detail:{query:this._query,count:t}}))}goToPage(e){let t=Math.min(Math.max(1,Math.trunc(e)||1),this.pageCount);t!==this._page&&(this._page=t,this._render(),ne(`Page ${this._page} of ${this.pageCount}`),this.dispatchEvent(new CustomEvent("velin-data-table-page",{bubbles:!0,detail:{page:this._page,pageCount:this.pageCount}})))}_init(){this._table=this.querySelector("table"),!(!this._table||!this._table.tBodies.length)&&(this._ensureAccessibleName(),this._setupSorting(),this._setupEditable(),this._bindFilterInput(),this._render())}_headers(){let e=this._table.tHead?.rows?.[0];return e?[...e.cells]:[]}_sortType(e){let t=(e.dataset.sort||"").toLowerCase();return t==="none"?"none":Pu.has(t)?t:this.hasAttribute("sortable")?"text":"none"}_ensureAccessibleName(){let e=this._table;if(!e)return;let t=this.getAttribute("label"),i=e.caption?.textContent.trim()||e.getAttribute("aria-label")?.trim()||e.getAttribute("aria-labelledby")?.trim();if(!i&&t){e.setAttribute("aria-label",t);return}!i&&!Wa&&(Wa=!0,console.warn("[velinstyle] <velin-data-table> needs a <caption>, aria-label, or a label attribute."))}_setupSorting(){this._headers().forEach((e,t)=>{if(this._sortType(e)==="none"||e.querySelector(".velin-data-table__sort"))return;let i=e.textContent.trim();e.dataset.sortLabel=i,e.setAttribute("aria-sort","none"),e.classList.add("velin-data-table__th");let n=document.createElement("button");n.type="button",n.className="velin-data-table__sort",n.textContent=i;let o=document.createElement("span");o.className="velin-data-table__sort-icon",o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.sort(t)),e.textContent="",e.appendChild(n)})}_setupEditable(){if(!this.hasAttribute("editable")&&!this.querySelector("[data-editable]"))return;let e=this._table.tBodies[0];if(!(!e||e.dataset.velinEditBound)){e.dataset.velinEditBound="true",e.addEventListener("dblclick",t=>{let i=t.target.closest("td");!i||!e.contains(i)||!this.hasAttribute("editable")&&!i.hasAttribute("data-editable")||this._beginEdit(i)}),e.addEventListener("keydown",t=>{let i=t.target.closest("td");if(!(!i||t.target!==i)&&(t.key==="Enter"||t.key==="F2")){if(!this.hasAttribute("editable")&&!i.hasAttribute("data-editable"))return;t.preventDefault(),this._beginEdit(i)}});for(let t of e.querySelectorAll("td[data-editable], td"))!this.hasAttribute("editable")&&!t.hasAttribute("data-editable")||t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}}_beginEdit(e){if(e.querySelector("input"))return;let t=e.textContent.trim(),i=document.createElement("input");i.className="velin-input velin-data-table__edit",i.value=t,i.setAttribute("aria-label","Edit cell"),e.textContent="",e.appendChild(i),i.focus(),i.select();let n=o=>{let a=o?i.value.trim():t;e.textContent=a,o&&a!==t&&(this.dispatchEvent(new CustomEvent("velin-data-table-edit",{bubbles:!0,detail:{cell:e,row:e.parentElement,previous:t,value:a,columnIndex:e.cellIndex}})),ne("Cell updated"))};i.addEventListener("keydown",o=>{o.key==="Enter"?(o.preventDefault(),n(!0)):o.key==="Escape"&&(o.preventDefault(),n(!1))}),i.addEventListener("blur",()=>n(!0))}_syncSortState(){this._headers().forEach((e,t)=>{if(this._sortType(e)==="none")return;let i=t===this._sortIndex;e.setAttribute("aria-sort",i?this._sortDirection:"none"),e.querySelector(".velin-data-table__sort")?.classList.toggle("velin-data-table__sort--active",i)})}_bindFilterInput(){this._filterEl&&this._filterEl.removeEventListener("input",this._onFilterInput);let e=this.getAttribute("filter-input");this._filterEl=e?document.querySelector(e):null,this._filterEl&&this._filterEl.addEventListener("input",this._onFilterInput)}_onFilterInput(e){this._filterTimer&&clearTimeout(this._filterTimer);let t=e.target.value;this._filterTimer=setTimeout(()=>this.filter(t),150)}_rowText(e){let t=[...e.cells].filter(n=>n.hasAttribute("data-filter"));return(t.length?t:[...e.cells]).map(n=>n.textContent||"").join(" ").toLowerCase()}_render(){let e=this.pageSize;this._page=Math.min(this._page,this.pageCount);let t=this.matchingRows,i=e?(this._page-1)*e:0,n=e?i+e:t.length;for(let o of this.rows){let a=t.indexOf(o);o.hidden=a===-1||a<i||a>=n}this._renderEmptyState(t.length===0),this._renderPagination()}_renderEmptyState(e){if(!e){this._emptyRow?.remove(),this._emptyRow=null;return}if(this._emptyRow?.isConnected)return;let t=this._headers().length||1,i=document.createElement("tr");i.className="velin-data-table__empty";let n=document.createElement("td");n.colSpan=t,n.textContent=this.getAttribute("empty-text")||"No matching rows",i.appendChild(n),this._table.tBodies[0].appendChild(i),this._emptyRow=i}_renderPagination(){if(!this.pageSize||this.pageCount<=1){this._pagination?.remove(),this._pagination=null;return}if(!this._pagination?.isConnected){let n=document.createElement("nav");n.className="velin-data-table__pagination",n.setAttribute("aria-label",this.getAttribute("pagination-label")||"Table pagination");let o=document.createElement("button");o.type="button",o.className="velin-btn velin-btn--outline velin-btn--sm",o.dataset.velinPage="previous",o.textContent=this.getAttribute("previous-text")||"Previous",o.addEventListener("click",()=>this.goToPage(this._page-1));let a=document.createElement("p");a.className="velin-data-table__page-status",a.dataset.velinPage="status";let c=document.createElement("button");c.type="button",c.className="velin-btn velin-btn--outline velin-btn--sm",c.dataset.velinPage="next",c.textContent=this.getAttribute("next-text")||"Next",c.addEventListener("click",()=>this.goToPage(this._page+1)),n.append(o,a,c),this.appendChild(n),this._pagination=n}let e=this._pagination.querySelector('[data-velin-page="status"]');e&&(e.textContent=`Page ${this._page} of ${this.pageCount}`);let t=this._pagination.querySelector('[data-velin-page="previous"]'),i=this._pagination.querySelector('[data-velin-page="next"]');t&&(t.disabled=this._page<=1),i&&(i.disabled=this._page>=this.pageCount)}};customElements.define("velin-data-table",Pi);Ya=Pi});var Za={};y(Za,{default:()=>Xa});var qu,qi,Xa,On=p(()=>{T();qu=`
|
|
1233
|
+
:host { display: block; }
|
|
1234
|
+
.zone {
|
|
1235
|
+
border: 2px dashed var(--velin-color-border, #cbd5e1);
|
|
1236
|
+
border-radius: var(--velin-radius-md, 0.5rem);
|
|
1237
|
+
padding: var(--velin-space-6, 1.5rem);
|
|
1238
|
+
background: var(--velin-color-surface-dim, var(--velin-color-bg-subtle, #f8fafc));
|
|
1239
|
+
color: var(--velin-color-text, #111);
|
|
1240
|
+
text-align: center;
|
|
1241
|
+
transition: border-color 150ms ease, background 150ms ease;
|
|
1242
|
+
}
|
|
1243
|
+
:host([dragging]) .zone {
|
|
1244
|
+
border-color: var(--velin-color-primary, #2563eb);
|
|
1245
|
+
background: var(--velin-color-primary-subtle, #eff6ff);
|
|
1246
|
+
}
|
|
1247
|
+
.hint { margin: 0 0 var(--velin-space-3, 0.75rem); color: var(--velin-color-text-muted, #64748b); }
|
|
1248
|
+
.browse {
|
|
1249
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
1250
|
+
min-block-size: 2.75rem; padding-inline: var(--velin-space-4, 1rem);
|
|
1251
|
+
border-radius: var(--velin-radius-md, 0.5rem);
|
|
1252
|
+
border: none; cursor: pointer;
|
|
1253
|
+
background: var(--velin-color-primary, #2563eb);
|
|
1254
|
+
color: var(--velin-color-on-primary, #fff);
|
|
1255
|
+
font: inherit;
|
|
1256
|
+
}
|
|
1257
|
+
.browse:focus-visible { outline: 2px solid var(--velin-color-focus, #2563eb); outline-offset: 2px; }
|
|
1258
|
+
input[type="file"] {
|
|
1259
|
+
position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px;
|
|
1260
|
+
overflow: hidden; clip: rect(0,0,0,0); border: 0;
|
|
1261
|
+
}
|
|
1262
|
+
.list { list-style: none; padding: 0; margin: var(--velin-space-4, 1rem) 0 0; text-align: start; }
|
|
1263
|
+
.list li {
|
|
1264
|
+
display: flex; justify-content: space-between; gap: var(--velin-space-3, 0.75rem);
|
|
1265
|
+
padding: var(--velin-space-2, 0.5rem) 0;
|
|
1266
|
+
border-block-end: 1px solid var(--velin-color-border, #e2e8f0);
|
|
1267
|
+
font-size: var(--velin-text-sm, 0.875rem);
|
|
1268
|
+
}
|
|
1269
|
+
.progress {
|
|
1270
|
+
margin-block-start: var(--velin-space-3, 0.75rem);
|
|
1271
|
+
block-size: 0.5rem; border-radius: 999px;
|
|
1272
|
+
background: var(--velin-color-border, #e2e8f0); overflow: hidden;
|
|
1273
|
+
}
|
|
1274
|
+
.bar {
|
|
1275
|
+
block-size: 100%; inline-size: 0%;
|
|
1276
|
+
background: var(--velin-color-primary, #2563eb);
|
|
1277
|
+
transition: inline-size 150ms ease;
|
|
1278
|
+
}
|
|
1279
|
+
.status { margin: var(--velin-space-2, 0.5rem) 0 0; font-size: var(--velin-text-sm, 0.875rem); }
|
|
1280
|
+
.status[data-tone="error"] { color: var(--velin-color-danger, #b91c1c); }
|
|
1281
|
+
`,qi=class extends HTMLElement{static get observedAttributes(){return["accept","multiple","label","progress"]}constructor(){super(),this.attachShadow({mode:"open"}),this._files=[]}connectedCallback(){this._render()}attributeChangedCallback(){this.shadowRoot?.querySelector(".zone")&&this._render()}get files(){return this._files.slice()}_emitFiles(e){let t=this.getAttribute("accept"),i=[...e];if(t){let n=t.split(",").map(a=>a.trim().toLowerCase()),o=i.find(a=>{let c=a.name.toLowerCase(),u=(a.type||"").toLowerCase();return!n.some(f=>f.startsWith(".")?c.endsWith(f):u===f||u.startsWith(f.replace("/*","/")))});if(o){this._setStatus(`File type not allowed: ${o.name}`,"error"),this.dispatchEvent(new CustomEvent("velin-error",{bubbles:!0,detail:{message:"accept",file:o}}));return}}this._files=i,this._setStatus(i.length?`${i.length} file(s) ready`:"","ok"),this.dispatchEvent(new CustomEvent("velin-files",{bubbles:!0,detail:{files:i}})),this._renderList()}_setStatus(e,t="ok"){let i=this.shadowRoot?.querySelector(".status");i&&(i.textContent=e,i.dataset.tone=t)}_renderList(){let e=this.shadowRoot?.querySelector(".list");e&&(e.innerHTML=this._files.map(t=>`<li><span>${m(t.name)}</span><span>${Math.round(t.size/1024)} KB</span></li>`).join(""))}_render(){let e=m(this.getAttribute("label")||"Upload files"),t=this.getAttribute("accept")||"",i=this.hasAttribute("multiple"),n=Math.max(0,Math.min(100,Number(this.getAttribute("progress")||0)));this.shadowRoot.innerHTML=`
|
|
1282
|
+
<style>${qu}</style>
|
|
1283
|
+
<div class="zone" role="group" aria-label="${e}">
|
|
1284
|
+
<p class="hint">Drag and drop files here, or browse. Client-side only \u2014 wire <code>velin-files</code> to your upload API.</p>
|
|
1285
|
+
<button type="button" class="browse">Browse files</button>
|
|
1286
|
+
<input type="file" ${t?`accept="${m(t)}"`:""} ${i?"multiple":""} />
|
|
1287
|
+
<div class="progress" hidden="${n<=0?"true":"false"}" aria-hidden="${n<=0?"true":"false"}">
|
|
1288
|
+
<div class="bar" style="inline-size:${n}%"></div>
|
|
1289
|
+
</div>
|
|
1290
|
+
<p class="status" role="status" aria-live="polite"></p>
|
|
1291
|
+
<ul class="list"></ul>
|
|
1292
|
+
</div>
|
|
1293
|
+
`;let o=this.shadowRoot.querySelector("input"),a=this.shadowRoot.querySelector(".browse"),c=this.shadowRoot.querySelector(".zone");a.addEventListener("click",()=>o.click()),o.addEventListener("change",()=>{o.files?.length&&this._emitFiles(o.files)}),["dragenter","dragover"].forEach(u=>{c.addEventListener(u,f=>{f.preventDefault(),this.setAttribute("dragging","")})}),["dragleave","drop"].forEach(u=>{c.addEventListener(u,f=>{f.preventDefault(),this.removeAttribute("dragging")})}),c.addEventListener("drop",u=>{let f=u.dataTransfer?.files;f?.length&&this._emitFiles(f)}),this._renderList()}};customElements.define("velin-file-dropzone",qi);Xa=qi});var Qa={};y(Qa,{default:()=>Ja});function Nn(r){let e=String(r??"");return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/[^\w-]/g,t=>`\\${t}`)}function Ku(r){let e=r.getAttribute("data-error-label");if(e)return e;let t=r.getAttribute("aria-label");if(t?.trim())return t.trim();let i=r.getAttribute("aria-labelledby");if(i){let o=i.split(/\s+/).map(a=>r.ownerDocument.getElementById(a)?.textContent?.trim()||"").filter(Boolean).join(" ");if(o)return o}if(r.id){let o=r.ownerDocument.querySelector(`label[for="${Nn(r.id)}"]`);if(o?.textContent.trim())return o.textContent.trim()}let n=r.closest("label");return n?.textContent.trim()?n.textContent.trim():r.name||"This field"}function Wu(r){return r.getAttribute("data-error-message")?.trim()||r.validationMessage||"Invalid value"}function Gu(r,e){let t=(r.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);t.includes(e)||(t.push(e),r.setAttribute("aria-describedby",t.join(" ")))}function Yu(r,e){let i=(r.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean).filter(n=>n!==e);i.length?r.setAttribute("aria-describedby",i.join(" ")):r.removeAttribute("aria-describedby")}var Bu,Uu,ju,Bi,Ja,zn=p(()=>{Le();Bu="input, select, textarea",Uu=new Set(["submit","reset","button","image","hidden"]),ju=0;Bi=class extends HTMLElement{static get observedAttributes(){return["for","heading"]}constructor(){super(),this._form=null,this._panel=null,this._errors=[],this._onSubmit=this._onSubmit.bind(this),this._onFieldChange=this._onFieldChange.bind(this),this._onReset=this._onReset.bind(this)}connectedCallback(){this.classList.add("velin-form-summary"),requestAnimationFrame(()=>this._bindForm())}disconnectedCallback(){this._unbindForm()}attributeChangedCallback(e,t,i){if(t!==i){if(e==="for"&&this.isConnected)this._unbindForm(),this._bindForm();else if(e==="heading"&&this._panel){let n=this._panel.querySelector(".velin-form-summary__heading");n&&(n.textContent=this.headingText)}}}get form(){return this._form}get errors(){return this._errors.slice()}get headingText(){return this.getAttribute("heading")||"There is a problem"}validate(){if(!this._form)return!0;let e=[];for(let t of this._fields()){if(t.checkValidity()){this._clearFieldError(t);continue}let i={field:t,label:Ku(t),message:Wu(t)};this._markFieldError(t,i.message),e.push(i)}return this._errors=e,this._render(),e.length===0}clear(){for(let e of this._fields())this._clearFieldError(e);this._errors=[],this._render()}focusFirstError(){let e=this._errors[0];e&&this._focusField(e.field)}_bindForm(){let e=this.getAttribute("for");this._form=e?this.ownerDocument.getElementById(e):this.closest("form"),this._form&&(this.hasAttribute("native-validation")||(this._form.noValidate=!0),this._form.addEventListener("submit",this._onSubmit),this._form.addEventListener("reset",this._onReset),this._form.addEventListener("input",this._onFieldChange),this._form.addEventListener("change",this._onFieldChange))}_unbindForm(){this._form&&(this._form.removeEventListener("submit",this._onSubmit),this._form.removeEventListener("reset",this._onReset),this._form.removeEventListener("input",this._onFieldChange),this._form.removeEventListener("change",this._onFieldChange),this._form=null)}_fields(){if(!this._form)return[];let e=new Set;return[...this._form.querySelectorAll(Bu)].filter(t=>{if(Uu.has(t.type)||t.disabled||t.hasAttribute("data-error-ignore")||typeof t.checkValidity!="function")return!1;if(t.type==="radio"&&t.name){if(e.has(t.name))return!1;e.add(t.name)}return!0})}_onSubmit(e){this.validate()||(e.preventDefault(),this._announceErrors(),this._focusPanel(),this.dispatchEvent(new CustomEvent("velin-form-invalid",{bubbles:!0,detail:{errors:this.errors.map(({label:t,message:i})=>({label:t,message:i}))}})))}_onReset(){requestAnimationFrame(()=>this.clear())}_onFieldChange(e){let t=e.target;!t||!this._errors.some(i=>i.field===t)||t.checkValidity()&&(this._clearFieldError(t),this._errors=this._errors.filter(i=>i.field!==t),this._render(),this._errors.length===0&&this.dispatchEvent(new CustomEvent("velin-form-valid",{bubbles:!0})))}_errorId(e){return e.id||(e.id=`velin-field-${++ju}`),`${e.id}-error`}_markFieldError(e,t){let i=this._errorId(e);e.setAttribute("aria-invalid","true");let n=this.ownerDocument.getElementById(i);n||(n=this._form.querySelector(`[data-velin-error-for="${Nn(e.name||e.id)}"]`)),n||(n=this.ownerDocument.createElement("p"),n.dataset.velinErrorGenerated="true",e.insertAdjacentElement("afterend",n)),n.id=i,n.classList.add("velin-field-error"),n.textContent=t,Gu(e,i)}_clearFieldError(e){if(!e.id)return;let t=`${e.id}-error`;e.removeAttribute("aria-invalid"),Yu(e,t);let i=this.ownerDocument.getElementById(t);i&&(i.dataset.velinErrorGenerated?i.remove():i.textContent="")}_focusField(e){let t=e.type==="radio"&&e.name&&this._form.querySelector(`input[type="radio"][name="${Nn(e.name)}"]`)||e;t.focus(),this.dispatchEvent(new CustomEvent("velin-form-error-focus",{bubbles:!0,detail:{name:t.name||t.id}}))}_render(){if(!this._errors.length){this._panel?.remove(),this._panel=null,this.hidden=!0;return}if(this.hidden=!1,!this._panel?.isConnected){let t=this.ownerDocument.createElement("div");t.className="velin-form-summary__panel velin-alert velin-alert--danger",t.setAttribute("role","alert"),t.tabIndex=-1;let i=this.ownerDocument.createElement("p");i.className="velin-form-summary__heading",i.textContent=this.headingText;let n=this.ownerDocument.createElement("ul");n.className="velin-form-summary__list",t.append(i,n),this.appendChild(t),this._panel=t}let e=this._panel.querySelector(".velin-form-summary__list");e.textContent="";for(let t of this._errors){let i=this.ownerDocument.createElement("li"),n=this.ownerDocument.createElement("a");n.href=`#${this._errorId(t.field).replace(/-error$/,"")}`,n.textContent=`${t.label}: ${t.message}`,n.addEventListener("click",o=>{o.preventDefault(),this._focusField(t.field)}),i.appendChild(n),e.appendChild(i)}}_focusPanel(){this._panel?.focus()}_announceErrors(){let e=this._errors.length;ne(e===1?"1 field needs attention":`${e} fields need attention`,"assertive")}};customElements.define("velin-form-summary",Bi);Ja=Bi});var il={};y(il,{default:()=>tl});var el,Vu,Xu,Ui,tl,ji=p(()=>{Le();el={live:"var(--velin-color-success, oklch(60% 0.16 145))",paused:"var(--velin-color-text-muted, oklch(60% 0.02 240))",warning:"var(--velin-color-warning, oklch(75% 0.16 80))",error:"var(--velin-color-danger, oklch(60% 0.2 25))",muted:"var(--velin-color-border, oklch(85% 0.01 240))"},Vu=`
|
|
1146
1294
|
:host {
|
|
1147
1295
|
display: inline-flex;
|
|
1148
1296
|
align-items: center;
|
|
@@ -1163,15 +1311,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1163
1311
|
@media (prefers-reduced-motion: reduce) {
|
|
1164
1312
|
.dot { animation: none !important; }
|
|
1165
1313
|
}
|
|
1166
|
-
`,
|
|
1314
|
+
`,Xu=`
|
|
1167
1315
|
@keyframes velin-live-pulse {
|
|
1168
1316
|
0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--velin-live-color) 65%, transparent); }
|
|
1169
1317
|
70% { box-shadow: 0 0 0 0.6rem color-mix(in oklch, var(--velin-live-color) 0%, transparent); }
|
|
1170
1318
|
100% { box-shadow: 0 0 0 0 transparent; }
|
|
1171
|
-
}`,
|
|
1172
|
-
<style>${
|
|
1319
|
+
}`,Ui=class extends HTMLElement{static get observedAttributes(){return["status","pulse"]}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this._render()}attributeChangedCallback(){this.shadowRoot&&this._render()}_render(){let e=this.getAttribute("status")||"live",t=el[e]||el.live,i=this.getAttribute("aria-label")||Wr(e);this.setAttribute("role","status"),this.setAttribute("aria-label",i),this.style.setProperty("--velin-live-color",t),this.shadowRoot.innerHTML=`
|
|
1320
|
+
<style>${Vu}${Xu}</style>
|
|
1173
1321
|
<span class="dot" aria-hidden="true"></span><slot></slot>
|
|
1174
|
-
`}};typeof customElements<"u"&&!customElements.get("velin-live-dot")&&customElements.define("velin-live-dot",
|
|
1322
|
+
`}};typeof customElements<"u"&&!customElements.get("velin-live-dot")&&customElements.define("velin-live-dot",Ui);tl=Ui});function Ki(r){if(!r||typeof r!="object")return null;let e=r,t=String(e.id||e.url||e.title||"").trim(),i=String(e.title||"").trim(),n=String(e.url||"").trim();if(!t||!i)return null;let o=Array.isArray(e.keywords)?e.keywords.map(u=>String(u)):typeof e.keywords=="string"?e.keywords.split(/\s+/).filter(Boolean):[],a=Lt.includes(e.category)?e.category:"docs";!e.category&&typeof e.url=="string"&&(e.url.includes("/components/")?a="components":e.url.includes("/cli/")||e.url.includes("/api/")?a="api":(e.url.includes("samples/")||e.url.includes("examples/"))&&(a="examples"));let c=n?ts(n):`#${t}`;return{id:t,title:i,excerpt:String(e.excerpt||e.section||"").slice(0,200),url:c,category:a,keywords:o,weight:typeof e.weight=="number"?e.weight:1}}var Lt,$n,Fn=p(()=>{T();Lt=["docs","components","api","examples"],$n={components:1.25,api:1.15,docs:1,examples:.9}});function Zu(r,e,t){let i=r.title.toLowerCase(),n=(r.excerpt||"").toLowerCase(),o=(r.keywords||[]).join(" ").toLowerCase(),a=($n[r.category]||1)*(r.weight||1),c=0;if(i===e)c=100;else if(i.startsWith(e))c=70;else if(i.includes(e))c=50;else if(o.includes(e))c=35;else if(n.includes(e))c=25;else if(t>0&&Wi(i,e,t))c=40;else if(t>0&&Wi(o,e,t))c=28;else if(t>0&&Wi(n,e,t))c=18;else if(rl(i,e))c=22;else if(t>0){for(let u of i.split(/[^a-z0-9]+/))if(u.length>=3&&Wi(u,e,t)){c=32;break}}return c>0?c*a:0}function rl(r,e){let t=0;for(let i=0;i<r.length&&t<e.length;i++)r[i]===e[t]&&t++;return t===e.length}function Wi(r,e,t){if(!r||!e)return!1;if(r.includes(e)||rl(r,e))return!0;let i=Math.max(1,Math.floor(e.length*t*2));return Ju(r.slice(0,Math.min(r.length,e.length+8)),e)<=i}function Ju(r,e){let t=r.length,i=e.length;if(t===0)return i;if(i===0)return t;let n=new Uint16Array((i+1)*(t+1));for(let o=0;o<=i;o++)n[o]=o;for(let o=1;o<=t;o++){n[o*(i+1)]=o;for(let a=1;a<=i;a++){let c=r[o-1]===e[a-1]?0:1;n[o*(i+1)+a]=Math.min(n[(o-1)*(i+1)+a]+1,n[o*(i+1)+(a-1)]+1,n[(o-1)*(i+1)+(a-1)]+c)}}return n[t*(i+1)+i]}var Ct,nl=p(()=>{Fn();Ct=class{constructor(){this._entries=[]}setEntries(e){this._entries=e.map(t=>Ki(t)).filter(Boolean)}addEntries(e){let t=e.map(n=>Ki(n)).filter(Boolean),i=new Set(this._entries.map(n=>n.id));for(let n of t)i.has(n.id)||(this._entries.push(n),i.add(n.id))}query(e,t={}){let i=String(e||"").trim().toLowerCase(),n=t.minChars??2,o=t.limit??12,a=t.fuzzy??.2,c=t.categories;if(i.length<n)return{results:[],groups:{}};let u=[];for(let b of this._entries){if(c&&c.length&&!c.includes(b.category))continue;let g=Zu(b,i,a);g>0&&u.push({entry:b,score:g})}u.sort((b,g)=>g.score-b.score);let f=u.slice(0,o).map(b=>({...b.entry,_score:b.score})),_={};for(let b of f)_[b.category]||(_[b.category]=[]),_[b.category].push(b);return{results:f,groups:_}}}});function sl(r,e){if(!r||typeof e!="function")throw new Error("registerSearchProvider(id, fn) requires a non-empty id and function");ol.set(r,e)}async function Hn(){let r=[];for(let e of ol.values()){let t=await e();Array.isArray(t)&&r.push(...t)}return r}var ol,Pn=p(()=>{ol=new Map});function Gi(r,e){let t=String(r||""),i=String(e||"").trim();if(!i||i.length<2)return Rt(t);let n=t.toLowerCase(),o=i.toLowerCase(),a=n.indexOf(o),c=i.length;if(a===-1){if(a=Qu(n,o),a===-1)return Rt(t);c=Math.min(i.length,t.length-a)}return Rt(t.slice(0,a))+'<mark class="velin-search-hit">'+Rt(t.slice(a,a+c))+"</mark>"+Rt(t.slice(a+c))}function Rt(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Qu(r,e){let t=0,i=-1;for(let n=0;n<r.length&&t<e.length;n++)r[n]===e[t]&&(t===0&&(i=n),t++);return t===e.length?i:-1}var al=p(()=>{});function cl(){if(typeof document>"u")return"https://example.invalid/docs/";let r=document.querySelector('script[src*="doc-search"]');if(r?.src){let i=new URL(r.src),n=i.pathname.indexOf(st);if(n!==-1)return i.origin+i.pathname.slice(0,n+st.length)}let e=window.location.pathname.replace(/\\/g,"/"),t=e.indexOf(st);return t>=0?new URL(e.slice(0,t+st.length),window.location.origin).href:new URL("./",window.location.href).href}function eh(r){let e=r.indexOf("#");return e===-1?{path:r,hash:""}:{path:r.slice(0,e),hash:r.slice(e)}}function dl(r){let e=r.indexOf(st);if(e<0)return null;let t=r.slice(e+st.length),i=t.split("/").filter(Boolean);return i.length>=2&&ll.has(i[0])&&ll.has(i[1])&&i[0]!==i[1]?i.slice(1).join("/"):t}function Yi(r){if(!r||r==="#")return"";if(typeof window>"u")return r;let{path:e,hash:t}=eh(r);if(!e)return t||"";let i=e;if(/^https?:\/\//i.test(e))try{i=dl(new URL(e).pathname)??e}catch{return""}try{let n=new URL(i||"",cl());return n.href+(t&&!n.href.includes("#")?t:"")}catch{return""}}var st,ll,ul=p(()=>{st="/docs/",ll=new Set(["getting-started","extend","guides","utilities","components","forms","layout","content","customize","animations","about","helpers","generated","migration"])});var hl={};y(hl,{createSearchWorker:()=>ih});function ih(r){if(typeof Worker>"u"||!r)return null;let e=r,t;try{t=new Worker(e,{type:"module"})}catch{return null}let i=new Map;t.onmessage=o=>{let{id:a,ok:c,result:u,error:f}=o.data||{},_=i.get(a);_&&(i.delete(a),c?_.resolve(u):_.reject(new Error(f||"Worker error")))},t.onerror=()=>{for(let o of i.values())o.reject(new Error("Worker failed"));i.clear()};function n(o,a){let c=++th;return new Promise((u,f)=>{i.set(c,{resolve:u,reject:f}),t.postMessage({id:c,type:o,payload:a})})}return{setEntries(o){return n("setEntries",{entries:o})},query(o,a){return n("query",{query:o,options:a})},terminate(){t.terminate()}}}var th,pl=p(()=>{th=0});function ml(r){return Array.isArray(r)?r:r&&Array.isArray(r.entries)?r.entries:[]}function Bn(r={}){let e=new Ct,t=r.worker===!0,i=null;async function n(){if(!t||i)return i;if(typeof Worker>"u")return null;let{createSearchWorker:o}=await Promise.resolve().then(()=>(pl(),hl));return i=o(r.workerUrl),i}return{engine:e,async loadIndex(o){let a=[];if(typeof o=="string"){let u=await fetch(o);a=ml(await u.json())}else Array.isArray(o)&&(a=o);e.setEntries(a);let c=await n();return c&&await c.setEntries(e._entries),a.length},async query(o,a){let c=await n();return c?c.query(o,a):e.query(o,a)},addEntries(o){e.addEntries(o),n().then(a=>a?.setEntries(e._entries))}}}var De,qn,rh,Un=p(()=>{nl();Pn();al();Pn();Fn();ul();De=new Ct,qn=!1;rh={engine:De,async loadIndex(r){let e=[];if(typeof r=="string"){let i=await fetch(r);if(!i.ok)throw new Error(`Failed to load search index: ${i.status}`);e=ml(await i.json())}else Array.isArray(r)&&(e=r);De.setEntries(e);let t=await Hn();return t.length&&De.addEntries(t),qn=!0,e.length},addEntries(r){De.addEntries(r)},async refreshProviders(){let r=await Hn();return r.length&&De.addEntries(r),r.length},async query(r,e={}){return!qn&&De._entries.length===0&&await this.refreshProviders(),De.query(r,e)},isReady(){return qn||De._entries.length>0}}});var jn={};y(jn,{bindDeclarativeSearch:()=>bl,default:()=>fl});function bl(r=document){r.querySelectorAll("[velin-search-input]").forEach(e=>{if(e.dataset.velinSearchBound)return;e.dataset.velinSearchBound="1";let t=e.closest("velin-search");if(!t){t=document.createElement("velin-search"),t.setAttribute("index",e.getAttribute("data-search-index")||"/search-index.json");let i=e.parentElement?.querySelector("[velin-search-results]");e.before(t),t.appendChild(e),i&&t.appendChild(i)}})}var nh,Vi,fl,Mt=p(()=>{Un();T();nh={docs:"Documentation",components:"Components",api:"API",examples:"Examples"},Vi=class extends HTMLElement{static get observedAttributes(){return["index","categories","min-chars","fuzzy","placeholder","debounce"]}constructor(){super(),this._search=Bn(),this._debounceTimer=null,this._activeIndex=-1,this._flatResults=[],this._indexLoaded=!1,this._listId=`velin-search-listbox-${Math.random().toString(36).slice(2,9)}`,this._mounted=!1}connectedCallback(){this._mounted||(this._mounted=!0,this._ensureMarkup(),this._loadIndex(),this._bindEvents())}disconnectedCallback(){this._teardown?.(),this._mounted=!1}get indexUrl(){return this.getAttribute("index")||"/search-index.json"}get minChars(){return parseInt(this.getAttribute("min-chars")||"2",10)}get fuzzy(){let e=this.getAttribute("fuzzy");return e===null?.2:parseFloat(e)||0}get categories(){let e=this.getAttribute("categories");return e?e.split(",").map(t=>t.trim()).filter(t=>Lt.includes(t)):null}get debounceMs(){return parseInt(this.getAttribute("debounce")||"120",10)}_ensureMarkup(){if(this.querySelector("[data-velin-search-input]"))return;let e=ye(this.getAttribute("placeholder")||"Search\u2026"),t=ye(this.getAttribute("aria-label")||"Search");this.innerHTML=`
|
|
1175
1323
|
<div class="velin-search">
|
|
1176
1324
|
<div class="velin-search__field">
|
|
1177
1325
|
<input type="search" class="velin-search__input" data-velin-search-input
|
|
@@ -1182,7 +1330,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1182
1330
|
<div class="velin-search__results" data-velin-search-results role="listbox"
|
|
1183
1331
|
id="${this._listId}" hidden></div>
|
|
1184
1332
|
</div>
|
|
1185
|
-
`}_inputEl(){return this.querySelector("[data-velin-search-input]")}_resultsEl(){return this.querySelector("[data-velin-search-results]")}async _loadIndex(){try{await this._search.loadIndex(this.indexUrl),this._indexLoaded=!0}catch{this._indexLoaded=!1}}_bindEvents(){let e=this._inputEl(),t=this._resultsEl();if(!e||!t)return;e.addEventListener("input",()=>{clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._runQuery(e.value),this.debounceMs)}),e.addEventListener("focus",()=>{e.value.trim().length>=this.minChars&&this._runQuery(e.value)}),e.addEventListener("keydown",n=>this._onKeydown(n,e,t));let
|
|
1333
|
+
`}_inputEl(){return this.querySelector("[data-velin-search-input]")}_resultsEl(){return this.querySelector("[data-velin-search-results]")}async _loadIndex(){try{await this._search.loadIndex(this.indexUrl),this._indexLoaded=!0}catch{this._indexLoaded=!1}}_bindEvents(){let e=this._inputEl(),t=this._resultsEl();if(!e||!t)return;e.addEventListener("input",()=>{clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._runQuery(e.value),this.debounceMs)}),e.addEventListener("focus",()=>{e.value.trim().length>=this.minChars&&this._runQuery(e.value)}),e.addEventListener("keydown",n=>this._onKeydown(n,e,t));let i=n=>{this.contains(n.target)||this._hide(t,e)};document.addEventListener("click",i),this._teardown=()=>{document.removeEventListener("click",i),clearTimeout(this._debounceTimer)}}async _runQuery(e){let t=this._inputEl(),i=this._resultsEl();if(!t||!i)return;let n=e.trim();if(n.length<this.minChars){this._hide(i,t);return}this._indexLoaded||await this._loadIndex();let{groups:o}=await this._search.query(n,{minChars:this.minChars,fuzzy:this.fuzzy,categories:this.categories||void 0,limit:12});this._activeIndex=-1,this._renderResults(i,t,n,o),this._flatResults.length?(i.hidden=!1,i.classList.add("velin-search__results--open"),t.setAttribute("aria-expanded","true")):this._hide(i,t)}_renderResults(e,t,i,n){e.innerHTML="";let o=this.categories||[...Lt];this._flatResults=[];let a=0;for(let u of o){let f=n[u];if(!f?.length)continue;let _=`${this._listId}-group-${u}`,b=document.createElement("div");b.setAttribute("role","group"),b.setAttribute("aria-labelledby",_);let g=document.createElement("div");g.className="velin-search__group-label",g.id=_,g.textContent=nh[u]||u,b.appendChild(g);for(let R of f){let k=document.createElement("a"),A=Yi(R.url);A&&(k.href=A),k.className="velin-search__item",k.setAttribute("role","option"),k.id=`velin-search-opt-${a}`,k.innerHTML=`<span class="velin-search__title">${Gi(R.title,i)}</span><span class="velin-search__excerpt">${Gi(R.excerpt||"",i)}</span>`,k.addEventListener("click",S=>{S.preventDefault(),A&&window.location.assign(A)},!0),k.addEventListener("mouseenter",()=>this._setActive(a,e,t)),b.appendChild(k),this._flatResults.push(R),a++}e.appendChild(b)}let c=this._statusEl();c&&(c.textContent=this._flatResults.length?`${this._flatResults.length} results`:"No results")}_statusEl(){return this.querySelector("[data-velin-search-status]")}_setActive(e,t,i){this._activeIndex=e,t.querySelectorAll(".velin-search__item").forEach((n,o)=>{n.classList.toggle("velin-search__item--active",o===e),o===e&&(i.setAttribute("aria-activedescendant",n.id),n.scrollIntoView({block:"nearest"}))})}_onKeydown(e,t,i){if(e.key==="Escape"){this._hide(i,t);return}if(this._flatResults.length){if(e.key==="ArrowDown"){e.preventDefault();let n=this._activeIndex<this._flatResults.length-1?this._activeIndex+1:0;this._setActive(n,i,t)}else if(e.key==="ArrowUp"){e.preventDefault();let n=this._activeIndex>0?this._activeIndex-1:this._flatResults.length-1;this._setActive(n,i,t)}else if(e.key==="Enter"){let n=this._activeIndex>=0?this._flatResults[this._activeIndex]:this._flatResults[0],o=n?.url?Yi(n.url):"";o&&(e.preventDefault(),window.location.assign(o))}}}_hide(e,t){e.hidden=!0,e.classList.remove("velin-search__results--open"),t.setAttribute("aria-expanded","false"),t.removeAttribute("aria-activedescendant"),this._activeIndex=-1}},fl=Vi;typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("velin-search")&&customElements.define("velin-search",Vi)});var vl={};y(vl,{default:()=>ah});async function sh(r,e){if(e!=="aes-gcm"||!globalThis.crypto?.subtle)return JSON.stringify({encoding:"base64",payload:btoa(unescape(encodeURIComponent(r)))});let t=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt"]),n=new TextEncoder().encode(r),o=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},i,n);return JSON.stringify({encoding:"aes-gcm",iv:Array.from(t),cipher:Array.from(new Uint8Array(o))})}var oh,Xi,ah,gl=p(()=>{T();oh=`
|
|
1186
1334
|
:host { display: block; }
|
|
1187
1335
|
label { display: block; font-size: var(--velin-text-sm); margin-block-end: var(--velin-space-1); }
|
|
1188
1336
|
input {
|
|
@@ -1202,14 +1350,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1202
1350
|
color: var(--velin-color-text-muted);
|
|
1203
1351
|
margin-block-start: var(--velin-space-1);
|
|
1204
1352
|
}
|
|
1205
|
-
`;
|
|
1206
|
-
<style>${
|
|
1207
|
-
<label for="${o}">${
|
|
1353
|
+
`;Xi=class extends HTMLElement{static get observedAttributes(){return["type","name","label","mode","autocomplete"]}constructor(){super(),this.attachShadow({mode:"open"}),this._onChange=null}connectedCallback(){this._onChange||this.render()}disconnectedCallback(){let e=this.shadowRoot?.querySelector("input");e&&this._onChange&&e.removeEventListener("change",this._onChange),this._onChange=null}attributeChangedCallback(){this.isConnected&&this.render()}render(){let e=is(this.getAttribute("type")),t=this.getAttribute("name")||"secure",i=this.getAttribute("label")||"Secure field",n=ye(this.getAttribute("autocomplete")||"off"),o=`velin-secure-${Math.random().toString(36).slice(2,9)}`,a=this.shadowRoot?.querySelector("input");a&&this._onChange&&a.removeEventListener("change",this._onChange),this.shadowRoot.innerHTML=`
|
|
1354
|
+
<style>${oh}</style>
|
|
1355
|
+
<label for="${o}">${m(i)}</label>
|
|
1208
1356
|
<input id="${o}" type="${e}" autocomplete="${n}" part="input" />
|
|
1209
1357
|
<p class="velin-field-help">Demo-only client encoding \u2014 use HTTPS and server-side crypto for real secrets.</p>
|
|
1210
|
-
`;let l=this.shadowRoot.querySelector("input");this._onChange=async()=>{let u=this.getAttribute("mode")||"aes-gcm",m=await fu(l.value,u);this.dispatchEvent(new CustomEvent("velin-secure-submit",{bubbles:!0,detail:{name:t,payload:m}}))},l.addEventListener("change",this._onChange)}};customElements.get("velin-secure-field")||customElements.define("velin-secure-field",Pi);bu=Pi});var Za={};f(Za,{default:()=>Xa});function vu(i){if(!i)return[];let e=String(i).trim();if(e.startsWith("["))try{let t=JSON.parse(e);return Array.isArray(t)?t.map(Number).filter(r=>Number.isFinite(r)):[]}catch{return[]}return e.split(/[\s,]+/).map(t=>Number.parseFloat(t)).filter(t=>Number.isFinite(t))}function gu(i,e,t,r,n){let o=i.length;if(o===0)return[];if(o===1)return[[0,t/2],[e,t/2]];let a=Math.max(n-r,1e-6),l=e/(o-1);return i.map((u,m)=>{let v=m*l,y=t-(u-r)/a*t;return[v,y]})}function Ya(i){return i.length?i.map(([e,t],r)=>`${r===0?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "):""}function yu(i,e){if(!i.length)return"";let t=Ya(i),r=i[i.length-1][0],n=i[0][0];return`${t} L${r.toFixed(2)},${e} L${n.toFixed(2)},${e} Z`}var Ze,qi,Xa,Bi=d(()=>{Ze="http://www.w3.org/2000/svg";qi=class extends HTMLElement{static get observedAttributes(){return["values","width","height","min","max","area","glow","animate","label"]}constructor(){super(),this._values=[],this._gradientId=`velin-spark-grad-${Math.random().toString(36).slice(2,8)}`}connectedCallback(){this._render()}attributeChangedCallback(){this.isConnected&&this._render()}get values(){return this._values.slice()}set values(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this.setAttribute("values",this._values.join(",")))}update(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this._render({tick:!0}))}_render({tick:e=!1}={}){let t=Number.parseFloat(this.getAttribute("width"))||320,r=Number.parseFloat(this.getAttribute("height"))||96,n=this._values.length?this._values:vu(this.getAttribute("values"));if(this._values=n,!n.length){this.innerHTML="";return}let o=Number.parseFloat(this.getAttribute("min")),a=Number.parseFloat(this.getAttribute("max")),l=Number.isFinite(o)?o:Math.min(...n),u=Number.isFinite(a)?a:Math.max(...n),m=this.hasAttribute("area")&&this.getAttribute("area")!=="false",v=this.hasAttribute("glow")&&this.getAttribute("glow")!=="false",y=(this.getAttribute("animate")||"draw").toLowerCase(),g=gu(n,t,r,l,u),N=Ya(g),w=m?yu(g,r):"";this.innerHTML="";let A=document.createElementNS(Ze,"svg");if(A.setAttribute("viewBox",`0 0 ${t} ${r}`),A.setAttribute("preserveAspectRatio","none"),A.style.display="block",A.style.width="100%",A.style.height="100%",this._applyA11y(A),m){let oe=document.createElementNS(Ze,"defs"),ue=document.createElementNS(Ze,"linearGradient");ue.setAttribute("id",this._gradientId),ue.setAttribute("x1","0"),ue.setAttribute("x2","0"),ue.setAttribute("y1","0"),ue.setAttribute("y2","1"),[["0%","currentColor","0.35"],["100%","currentColor","0"]].forEach(([Et,z,ke])=>{let he=document.createElementNS(Ze,"stop");he.setAttribute("offset",Et),he.setAttribute("stop-color",z),he.setAttribute("stop-opacity",ke),ue.appendChild(he)}),oe.appendChild(ue),A.appendChild(oe);let se=document.createElementNS(Ze,"path");se.setAttribute("d",w),se.setAttribute("fill",`url(#${this._gradientId})`),se.setAttribute("stroke","none"),se.classList.add("velin-chart-area"),A.appendChild(se)}let E=document.createElementNS(Ze,"path");if(E.setAttribute("d",N),E.setAttribute("fill","none"),E.setAttribute("stroke","currentColor"),E.setAttribute("stroke-width","2"),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),E.setAttribute("vector-effect","non-scaling-stroke"),A.appendChild(E),v&&A.classList.add("velin-chart-glow"),this.appendChild(A),y!=="none"){let oe=typeof E.getTotalLength=="function"&&E.getTotalLength()||t;E.style.setProperty("--velin-chart-len",oe.toFixed(2)),E.classList.add("velin-chart-line")}else E.style.strokeDasharray="",E.style.strokeDashoffset="";e&&(this.classList.remove("velin-spark-tick"),this.offsetWidth,this.classList.add("velin-spark-tick"))}_applyA11y(e){let t=(this.getAttribute("label")||this.getAttribute("aria-label")||"").trim();if(t){e.setAttribute("role","img"),e.setAttribute("aria-label",t),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-labelledby");return}let r=this.closest("figure")?.querySelector("figcaption");if(r?.textContent?.trim()){r.id||(r.id=`velin-sparkline-cap-${Math.random().toString(36).slice(2,9)}`),e.setAttribute("role","img"),e.setAttribute("aria-labelledby",r.id),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-label");return}e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby")}};typeof customElements<"u"&&!customElements.get("velin-sparkline")&&customElements.define("velin-sparkline",qi);Xa=qi});var Cn,Ja=d(()=>{Cn={"velin-accordion":()=>Promise.resolve().then(()=>(vr(),Ko)),"velin-announcer":()=>Promise.resolve().then(()=>(Wr(),Us)),"velin-bottom-nav":()=>Promise.resolve().then(()=>(Pr(),Rs)),"velin-carousel":()=>Promise.resolve().then(()=>(Lr(),cs)),"velin-code-block":()=>Promise.resolve().then(()=>(vn(),xa)),"velin-collapse":()=>Promise.resolve().then(()=>(Cr(),us)),"velin-combobox":()=>Promise.resolve().then(()=>(Hr(),Ls)),"velin-command":()=>Promise.resolve().then(()=>(Kr(),qs)),"velin-copy":()=>Promise.resolve().then(()=>(Sr(),os)),"velin-countdown":()=>Promise.resolve().then(()=>(Fr(),As)),"velin-counter":()=>Promise.resolve().then(()=>(Ri(),wa)),"velin-data-table":()=>Promise.resolve().then(()=>(gn(),Ta)),"velin-dialog":()=>Promise.resolve().then(()=>(Nr(),_s)),"velin-drawer":()=>Promise.resolve().then(()=>(Ar(),Qo)),"velin-dropdown":()=>Promise.resolve().then(()=>(br(),Uo)),"velin-email":()=>Promise.resolve().then(()=>(bi(),Ws)),"velin-form-summary":()=>Promise.resolve().then(()=>(_n(),Ca)),"velin-icon":()=>Promise.resolve().then(()=>(xr(),Zo)),"velin-lightbox":()=>Promise.resolve().then(()=>(Dr(),vs)),"velin-live-dot":()=>Promise.resolve().then(()=>(Oi(),Ma)),"velin-menubar":()=>Promise.resolve().then(()=>(jr(),Hs)),"velin-modal":()=>Promise.resolve().then(()=>(fr(),qo)),"velin-persist":()=>Promise.resolve().then(()=>(zr(),Ss)),"velin-popover":()=>Promise.resolve().then(()=>(kr(),rs)),"velin-progress-ring":()=>Promise.resolve().then(()=>($r(),Es)),"velin-rating":()=>Promise.resolve().then(()=>(Ur(),$s)),"velin-scroll-top":()=>Promise.resolve().then(()=>(Tr(),as)),"velin-scrollspy":()=>Promise.resolve().then(()=>(Rr(),ps)),"velin-search":()=>Promise.resolve().then(()=>(_t(),Ln)),"velin-secure-field":()=>Promise.resolve().then(()=>(Va(),Ga)),"velin-segmented-control":()=>Promise.resolve().then(()=>(Br(),Os)),"velin-sheet":()=>Promise.resolve().then(()=>(qr(),Ms)),"velin-sparkline":()=>Promise.resolve().then(()=>(Bi(),Za)),"velin-stepper":()=>Promise.resolve().then(()=>(ii(),Or)),"velin-stepper-wc":()=>Promise.resolve().then(()=>(ii(),Or)),"velin-tabs":()=>Promise.resolve().then(()=>(gr(),Go)),"velin-theme-toggle":()=>Promise.resolve().then(()=>(Er(),ts)),"velin-toast":()=>Promise.resolve().then(()=>(yr(),Yo)),"velin-tooltip":()=>Promise.resolve().then(()=>(ei(),Ir)),"velin-tooltip-wc":()=>Promise.resolve().then(()=>(ei(),Ir))}});function el(i,e={}){let t=new Set;for(let[r,n]of Object.entries(e)){if(n==="false"||n==="off")continue;let o=Qa[r];if(o&&o.forEach(a=>t.add(a)),r==="slide"&&n&&n!=="true"&&n!==""){let a=`slide-${n}`;Qa[a]?.forEach(l=>t.add(l))}}return t.forEach(r=>i.classList.add(r)),!i.classList.contains("velin-animate-on-scroll")&&e.reveal!==void 0&&i.classList.add("velin-animate-on-scroll"),[...t]}function Ui(i){i.classList.add(Rn),i.dataset.velinVisible="true"}function tl(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}var Rn,Qa,il=d(()=>{Rn="velin-in-view",Qa={reveal:["velin-animate-on-scroll"],fade:["velin-animate-on-scroll","velin-animate-on-scroll--fade"],slide:["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-up":["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-down":["velin-animate-on-scroll","velin-animate-on-scroll--slide-down"],"slide-left":["velin-animate-on-scroll","velin-animate-on-scroll--slide-left"],"slide-right":["velin-animate-on-scroll","velin-animate-on-scroll--slide-right"],scale:["velin-animate-on-scroll","velin-animate-on-scroll--scale"],parallax:["velin-parallax"],"parallax-slow":["velin-parallax","velin-parallax--slow"],hover:["velin-animate-hover"],"hover-lift":["velin-animate-hover"],flip:["velin-animate-scale-in"],blur:["velin-animate-fade-in"]}});function _u(i,e="true"){let t=e==="true"||e===""?60:parseInt(e,10)||60;[...i.children].forEach((n,o)=>{n.style.setProperty("--velin-stagger-delay",`${o*t}ms`),n.classList.add("velin-stagger-item")}),i.classList.add("velin-stagger")}function nl(i=document){i.querySelectorAll(`[${rl}]`).forEach(e=>{e.dataset.velinStaggerDone||(e.dataset.velinStaggerDone="1",_u(e,e.getAttribute(rl)||"true"))})}var rl,ol=d(()=>{rl="velin-stagger"});function xu(i,e={}){let t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof i=="string"?document.querySelector(i):i;r&&(r.scrollIntoView({behavior:t||e.instant?"auto":"smooth",block:e.block||"start",inline:e.inline||"nearest"}),r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))}function sl(i=document){i.querySelectorAll("[velin-scroll]").forEach(e=>{e.dataset.velinScrollBound||(e.dataset.velinScrollBound="1",e.addEventListener("click",t=>{let r=e.getAttribute("href");if(!r||!r.startsWith("#"))return;let n=document.querySelector(r);n&&(t.preventDefault(),xu(n))}))})}var al=d(()=>{});function Me(i={}){let e=i.root||(typeof document<"u"?document:null);if(!e)return()=>{};let t=i.selector||["[velin-reveal]","[velin-fade]","[velin-slide]","[velin-scale]","[velin-parallax]","[velin-hover]",".velin-animate-on-scroll"].join(","),r=e.querySelectorAll(t),n=tl();for(let o of r){if(o.dataset.velinMotionInit)continue;o.dataset.velinMotionInit="1";let a={};for(let u of Au)o.hasAttribute(u)&&(a[u.replace("velin-","")]=o.getAttribute(u)||"true");if(el(o,a),n){Ui(o);continue}let l=mt(o,u=>Ui(u));In.push(l)}return nl(e),sl(e),()=>{In.forEach(o=>o()),In=[],ga()}}function ll(i={}){return Me({root:typeof document<"u"?document:null,selector:i.selector||".velin-animate-on-scroll"})}var Au,In,cl,Mn=d(()=>{mn();il();ol();al();Au=["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover"],In=[];cl={init:Me,observe:mt,markVisible:Ui,VISIBLE_CLASS:Rn}});function S(i,e){Je.set(i,e)}function ul(i){return Je.get(i)}function xt(i,e,t={}){i.setAttribute("data-velin-component",e);for(let[r,n]of Object.entries(t))n!=null&&i.setAttribute(r,n);return V(e)}function wu(){S("velin-modal",{enhance(i){xt(i,"velin-modal",{open:i.getAttribute("velin-modal")||""})}}),S("velin-tabs",{enhance:i=>xt(i,"velin-tabs")}),S("velin-accordion",{enhance:i=>xt(i,"velin-accordion")}),S("velin-tooltip",{enhance(i){let e=i.getAttribute("velin-tooltip")||i.getAttribute("title")||"";if(e&&i.hasAttribute("title")&&i.removeAttribute("title"),i.tagName==="VELIN-TOOLTIP"||i.tagName==="VELIN-TOOLTIP-WC")return i.setAttribute("content",e),V("velin-tooltip");let t=document.createElement("velin-tooltip");t.setAttribute("content",e);let r=i.parentElement;return r&&(r.insertBefore(t,i),t.appendChild(i)),V("velin-tooltip")}}),S("velin-copy",{enhance(i){let e=i.getAttribute("velin-copy")||i.textContent?.trim()||"";if(!i.querySelector("velin-copy")){let t=document.createElement("velin-copy");if(t.setAttribute("value",e),i.tagName==="BUTTON")return t.append(...i.childNodes),i.replaceWith(t),V("velin-copy");i.appendChild(t)}return V("velin-copy")}}),S("velin-counter",{enhance(i){xt(i,"velin-counter",{value:i.getAttribute("velin-counter")||"0"})}}),S("velin-notify",{async enhance(i){await V("velin-toast"),i.addEventListener("click",()=>{let e=i.getAttribute("velin-notify")||i.textContent||"";document.dispatchEvent(new CustomEvent("velin-toast-show",{detail:{message:e,variant:i.dataset.variant||"info"}}))})}}),S("velin-theme",{enhance(i){let e=i.getAttribute("velin-theme")||"toggle";if(e==="toggle")return i.querySelector("velin-theme-toggle")||i.appendChild(document.createElement("velin-theme-toggle")),V("velin-theme-toggle");document.documentElement.setAttribute("data-velin-theme",e)}}),S("velin-scroll-top",{enhance(i){let e=i.getAttribute("velin-scroll-top"),t=e&&e!=="true"?e:"300";if(i.tagName==="VELIN-SCROLL-TOP")return e&&e!=="true"&&i.setAttribute("threshold",t),V("velin-scroll-top");let r=document.querySelector("velin-scroll-top");return r||(r=document.createElement("velin-scroll-top"),r.setAttribute("threshold",t),(i===document.body||i===document.documentElement?document.body:i).appendChild(r)),V("velin-scroll-top")}}),S("velin-progress",{enhance(i){if(i.hasAttribute("ring"))return xt(i,"velin-progress-ring");i.classList.add("velin-progress");let t=parseInt(i.getAttribute("velin-progress")||"0",10);i.setAttribute("role","progressbar"),i.setAttribute("aria-valuenow",String(t)),i.style.setProperty("--velin-progress",`${Math.min(100,t)}%`)}}),S("velin-search",{async enhance(i){if(i.tagName!=="VELIN-SEARCH"){let e=document.createElement("velin-search");e.setAttribute("index",i.getAttribute("data-search-index")||"/search-index.json"),i.replaceWith(e),e.appendChild(i)}return V("velin-search")}}),S("velin-lazy",{enhance(i){i.tagName==="IMG"&&(i.loading="lazy",i.decoding="async",(i.hasAttribute("velin-skeleton")||i.dataset.velinSkeleton)&&(i.classList.add("velin-skeleton","velin-skeleton--image"),i.addEventListener("load",()=>i.classList.remove("velin-skeleton","velin-skeleton--image"),{once:!0})))}}),S("velin-skeleton",{enhance(i){let e=i.getAttribute("velin-skeleton")||"text";i.classList.add("velin-skeleton",`velin-skeleton--${e}`),!(!!i.textContent?.trim()&&i.children.length>0)&&!i.textContent?.trim()&&i.setAttribute("aria-hidden","true")}}),S("velin-loading",{enhance(i){i.classList.add("velin-spinner"),i.setAttribute("aria-busy","true"),i.setAttribute("role","status"),i.getAttribute("aria-label")?.trim()||i.setAttribute("aria-label","Loading")}}),S("velin-grid",{enhance(i){let e=i.getAttribute("velin-grid")||"auto";i.classList.add("velin-grid"),e!=="auto"&&i.style.setProperty("--velin-grid-cols",e)}}),S("velin-anchor",{enhance(i){!i.id&&i.getAttribute("velin-anchor")&&(i.id=i.getAttribute("velin-anchor")),i.setAttribute("tabindex","-1")}}),S("velin-code",{async enhance(i){let e=i.getAttribute("velin-code")||i.getAttribute("language")||i.getAttribute("data-language")||"";if(i.classList.add("velin-code-block"),e&&e!=="true"&&(i.dataset.language=e,i.getAttribute("language")||i.setAttribute("language",e)),!i.querySelector("[data-velin-copy]")){let o=document.createElement("button");o.type="button",o.className="velin-code-block__copy velin-btn velin-btn--sm",o.textContent="Copy",o.setAttribute("data-velin-copy",""),o.setAttribute("velin-copy",i.querySelector("code")?.textContent||i.textContent||""),i.style.position="relative",i.appendChild(o)}await V("velin-copy");let{initHighlight:t,highlightElement:r}=await Promise.resolve().then(()=>(bt(),bn));i.getAttribute("data-velin-highlight")==="immediate"||typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await r(i):t(i,{root:i})}}),S("velin-quote",{enhance(i){(i.tagName==="BLOCKQUOTE"||i.tagName==="Q")&&i.classList.add("velin-quote")}}),S("velin-highlight",{enhance(i){i.classList.add("velin-highlight")}});for(let i of["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover","velin-stagger","velin-scroll"])S(i,{enhance(){}})}async function Dn(i=document){let e=[...Je.keys()].map(r=>`[${r}]`).join(","),t=i.querySelectorAll(e);for(let r of t)if(!dl.has(r)){for(let n of Je.keys()){if(!r.hasAttribute(n))continue;let o=Je.get(n);o?.enhance&&await o.enhance(r)}dl.add(r)}if(Me({root:i}),typeof HTMLElement<"u"){let{bindDeclarativeSearch:r}=await Promise.resolve().then(()=>(_t(),Ln));if(r(i),!document.querySelector("velin-announcer")){let{getAnnouncer:n}=await Promise.resolve().then(()=>(_e(),fs));n()}}}function On(){return[...Je.keys()]}var Je,dl,hl=d(()=>{Nn();Mn();Je=new Map;wu();dl=new WeakSet});var pl={};f(pl,{bootAttributes:()=>Dn,getAttributeHandler:()=>ul,listRegisteredAttributes:()=>On,registerAttribute:()=>S});var Fn=d(()=>{hl()});var ml={};f(ml,{PATTERNS:()=>ji,VelinHapticObserver:()=>wt,applyHaptic:()=>At,default:()=>Eu,vibrate:()=>$n});function $n(i){if(typeof navigator>"u"||!navigator.vibrate||window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches)return;let t=typeof i=="string"?ji[i]||ji.tap:i;navigator.vibrate(t)}function At(i){let e=i.getAttribute("haptic")||"tap";i.addEventListener("click",()=>$n(e))}var ji,wt,Eu,zn=d(()=>{ji={tap:[10],"double-tap":[10,50,10],success:[50],error:[100,30,100],warning:[30,20,30],long:[200]};wt=class{constructor(){this._observer=null}start(e=document.body){e.querySelectorAll("[haptic]").forEach(At),this._observer=new MutationObserver(r=>{for(let n of r)for(let o of n.addedNodes)o.nodeType===1&&(o.hasAttribute?.("haptic")&&At(o),o.querySelectorAll?.("[haptic]").forEach(At))}),this._observer.observe(e,{childList:!0,subtree:!0})}stop(){this._observer?.disconnect()}},Eu=wt});function Su(i){return typeof customElements>"u"?Promise.reject(new Error("customElements not available")):customElements.whenDefined(i)}async function V(i){let e=Cn[i];if(!e)throw new Error(`Unknown Velin component: ${i}`);if(Hn.has(i))return Hn.get(i);let t=e().then(r=>{let n=r.default;return n&&!customElements.get(i)&&customElements.define(i,n),n});return Hn.set(i,t),t}async function fl(i){return Promise.all(i.map(e=>V(e)))}function Tu(i){let e=new Set;i.querySelectorAll("[data-velin-component]").forEach(t=>{let r=t.getAttribute("data-velin-component");r&&e.add(r.startsWith("velin-")?r:`velin-${r}`)});for(let t of i.querySelectorAll("*")){let r=t.tagName?.toLowerCase();r&&ku.test(r)&&Cn[r]&&e.add(r)}return e}async function Lu(i=document,e={}){let t=e.tags?.length?new Set(e.tags):Tu(i),r=fl([...t]);if(e.attributes){let{bootAttributes:n}=await Promise.resolve().then(()=>(Fn(),pl));await n(i)}if(e.highlight){let{initHighlight:n}=await Promise.resolve().then(()=>(bt(),bn));n(i)}if(e.haptic){let{VelinHapticObserver:n}=await Promise.resolve().then(()=>(zn(),ml));new n().start(i instanceof Document?i.body:i)}return r}var Hn,ku,Nn=d(()=>{Ja();Hn=new Map,ku=/^velin-[a-z0-9-]+$/});fr();br();vr();gr();yr();xr();Ar();Er();kr();Sr();Tr();Lr();Cr();Rr();ei();Dr();ii();Nr();Fr();$r();zr();Hr();Pr();qr();Br();Ur();jr();Kr();Wr();bi();Nn();Bi();Ri();Oi();vn();gn();_n();_t();_t();Mn();var Cu=ll;if(typeof document<"u"){let i=()=>{document.documentElement?.hasAttribute("data-velin-reveal-auto")&&Me()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i()}_e();_e();function Ru(i={}){if(typeof document>"u")return;let{announcer:e=!0,scrollPadding:t=!0,skipLink:r=!1}=i;if(e&&je(),t){let n=document.querySelector(".velin-nav, .velin-doc-header, .site-nav, [data-velin-fixed-nav]");if(n){let o=n.getBoundingClientRect().height;document.documentElement.style.setProperty("--velin-nav-height",`${Math.ceil(o)}px`),document.documentElement.classList.add("velin-scroll-pt-nav")}}if(r&&!document.querySelector(".velin-skip-link")&&document.getElementById("main")){let n=document.createElement("a");n.href="#main",n.className="velin-skip-link",n.textContent="Skip to main content",document.body.prepend(n)}}Tn();Fn();bt();var bl=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null,Al={duration:250,easing:"var(--velin-ease-expo-out, cubic-bezier(0.16, 1, 0.3, 1))",itemSelector:":scope > *"};function Pn(i,e){return Array.from(i.querySelectorAll(e))}function wl(i,e,t={}){if(!i||typeof e!="function")return;let r={...Al,...t},n=bl&&bl.matches,o=Pn(i,r.itemSelector),a=new Map;if(o.forEach(u=>{u.hidden||a.set(u,u.getBoundingClientRect())}),e(),n)return;Pn(i,r.itemSelector).forEach(u=>{if(u.hidden)return;let m=a.get(u),v=u.getBoundingClientRect();if(!m){if(typeof u.animate!="function")return;u.animate([{opacity:0,transform:"scale(0.96)"},{opacity:1,transform:"scale(1)"}],{duration:r.duration,easing:r.easing,fill:"both"});return}let y=m.left-v.left,g=m.top-v.top;y===0&&g===0||typeof u.animate=="function"&&u.animate([{transform:`translate(${y}px, ${g}px)`},{transform:"translate(0, 0)"}],{duration:r.duration,easing:r.easing,fill:"both"})})}function El(i,e,t={}){if(!i||typeof e!="function")return;let r={...Al,...t};wl(i,()=>{Pn(i,r.itemSelector).forEach(n=>{n.hidden=!e(n)})},r)}function vl(i){return i?String(i).toLowerCase().split(/[\s,|]+/).map(e=>e.trim()).filter(Boolean):[]}function Iu(i,e,t){return e.length?t==="all"?e.every(r=>i.includes(r)):e.some(r=>i.includes(r)):!0}function Mu(i,e){return e?((i.getAttribute("data-tags")||"")+" "+(i.getAttribute("data-search")||"")+" "+(i.textContent||"")).toLowerCase().includes(e.toLowerCase()):!0}var qn=class{constructor(e){this.container=e,this.tag="",this.search="",this.matchMode=e.getAttribute("data-velin-filter-mode")==="all"?"all":"any",this.itemSelector=e.getAttribute("data-velin-filter-item")||":scope > *"}apply(){let e=vl(this.tag),t=this.search;El(this.container,r=>{let n=vl(r.getAttribute("data-tags"));return Iu(n,e,this.matchMode)&&Mu(r,t)},{itemSelector:this.itemSelector})}},gl=new WeakMap;function yl(i){let e=gl.get(i);return e||(e=new qn(i),gl.set(i,e)),e}function _l(i){let e=i.getAttribute("data-velin-filter-target");if(!e)return null;try{return document.querySelector(e)}catch{return null}}function Du(i,e){i&&i.querySelectorAll("[data-velin-filter-value]").forEach(t=>{t===e?t.setAttribute("data-velin-filter-active",""):t.removeAttribute("data-velin-filter-active")})}function xl(){if(typeof document>"u")return;document.addEventListener("click",e=>{let t=e.target.closest("[data-velin-filter-value]");if(!t)return;let r=_l(t);if(!r)return;let n=t.closest("[data-velin-filter-group]")||t.parentElement;Du(n,t);let o=yl(r);o.tag=t.getAttribute("data-velin-filter-value")||"",(o.tag.toLowerCase()==="all"||o.tag==="*")&&(o.tag=""),o.apply()});let i=e=>{let t=e.target.closest("[data-velin-filter-input]");if(!t)return;let r=_l(t);if(!r)return;let n=yl(r),o=t.value||(typeof t.getAttribute=="function"?t.getAttribute("value"):"");n.search=(o||"").trim(),n.apply()};document.addEventListener("input",i),document.addEventListener("change",i)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",xl,{once:!0}):xl());k();zn();K();Bi();Ri();Oi();bi();export{ji as HapticPatterns,jo as VelinAccordion,Bs as VelinAnnouncer,Cs as VelinBottomNav,ls as VelinCarousel,_a as VelinCodeBlock,ds as VelinCollapse,Ts as VelinCombobox,Ps as VelinCommand,ns as VelinCopy,xs as VelinCountdown,Aa as VelinCounter,Sa as VelinDataTable,ys as VelinDialog,Jo as VelinDrawer,Bo as VelinDropdown,Ks as VelinEmail,La as VelinFormSummary,wt as VelinHapticObserver,Xo as VelinIcon,bs as VelinLightbox,Ia as VelinLiveDot,zs as VelinMenubar,Po as VelinModal,ks as VelinPersist,is as VelinPopover,ws as VelinProgressRing,Fs as VelinRating,ss as VelinScrollTop,hs as VelinScrollspy,Ka as VelinSearch,Ds as VelinSegmentedControl,Is as VelinSheet,Xa as VelinSparkline,gs as VelinStepper,lt as VelinStepperWC,Wo as VelinTabs,es as VelinThemeToggle,Vo as VelinToast,ms as VelinTooltip,at as VelinTooltipWC,re as announce,At as applyHaptic,Wa as bindDeclarativeSearch,Dn as bootAttributes,Lu as bootFromDOM,ie as clearBackgroundInert,qc as createSafeHTML,Sn as createSearch,p as escapeHTML,fe as escapeHTMLAttribute,El as filterList,wl as flipReorder,je as getAnnouncer,ce as getFocusableElements,Ho as getTrustedPolicy,pt as highlightAll,ne as highlightElement,Ru as initA11y,we as initHighlight,Me as initMotion,Cu as initReveal,V as lazyDefine,Ae as lazyLoadLanguage,On as listRegisteredAttributes,ft as observeCodeBlocks,fl as register,S as registerAttribute,Ye as registerLanguage,Fa as registerSearchProvider,Ei as renderTokens,ee as restoreFocus,X as rovingTabindex,Ce as sanitizeURL,Q as saveFocus,te as setBackgroundInert,mr as stripControlChars,Y as trapFocus,cl as velinMotion,hu as velinSearch,ya as velinSyntax,$n as vibrate,Su as whenDefined};
|
|
1358
|
+
`;let c=this.shadowRoot.querySelector("input");this._onChange=async()=>{let u=this.getAttribute("mode")||"aes-gcm",f=await sh(c.value,u);this.dispatchEvent(new CustomEvent("velin-secure-submit",{bubbles:!0,detail:{name:t,payload:f}}))},c.addEventListener("change",this._onChange)}};customElements.get("velin-secure-field")||customElements.define("velin-secure-field",Xi);ah=Xi});var xl={};y(xl,{default:()=>_l});function lh(r){if(!r)return[];let e=String(r).trim();if(e.startsWith("["))try{let t=JSON.parse(e);return Array.isArray(t)?t.map(Number).filter(i=>Number.isFinite(i)):[]}catch{return[]}return e.split(/[\s,]+/).map(t=>Number.parseFloat(t)).filter(t=>Number.isFinite(t))}function ch(r,e,t,i,n){let o=r.length;if(o===0)return[];if(o===1)return[[0,t/2],[e,t/2]];let a=Math.max(n-i,1e-6),c=e/(o-1);return r.map((u,f)=>{let _=f*c,b=t-(u-i)/a*t;return[_,b]})}function yl(r){return r.length?r.map(([e,t],i)=>`${i===0?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "):""}function dh(r,e){if(!r.length)return"";let t=yl(r),i=r[r.length-1][0],n=r[0][0];return`${t} L${i.toFixed(2)},${e} L${n.toFixed(2)},${e} Z`}var at,Zi,_l,Ji=p(()=>{at="http://www.w3.org/2000/svg";Zi=class extends HTMLElement{static get observedAttributes(){return["values","width","height","min","max","area","glow","animate","label"]}constructor(){super(),this._values=[],this._gradientId=`velin-spark-grad-${Math.random().toString(36).slice(2,8)}`}connectedCallback(){this._render()}attributeChangedCallback(){this.isConnected&&this._render()}get values(){return this._values.slice()}set values(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this.setAttribute("values",this._values.join(",")))}update(e){Array.isArray(e)&&(this._values=e.filter(t=>Number.isFinite(Number(t))).map(Number),this._render({tick:!0}))}_render({tick:e=!1}={}){let t=Number.parseFloat(this.getAttribute("width"))||320,i=Number.parseFloat(this.getAttribute("height"))||96,n=this._values.length?this._values:lh(this.getAttribute("values"));if(this._values=n,!n.length){this.innerHTML="";return}let o=Number.parseFloat(this.getAttribute("min")),a=Number.parseFloat(this.getAttribute("max")),c=Number.isFinite(o)?o:Math.min(...n),u=Number.isFinite(a)?a:Math.max(...n),f=this.hasAttribute("area")&&this.getAttribute("area")!=="false",_=this.hasAttribute("glow")&&this.getAttribute("glow")!=="false",b=(this.getAttribute("animate")||"draw").toLowerCase(),g=ch(n,t,i,c,u),R=yl(g),k=f?dh(g,i):"";this.innerHTML="";let A=document.createElementNS(at,"svg");if(A.setAttribute("viewBox",`0 0 ${t} ${i}`),A.setAttribute("preserveAspectRatio","none"),A.style.display="block",A.style.width="100%",A.style.height="100%",this._applyA11y(A),f){let j=document.createElementNS(at,"defs"),ue=document.createElementNS(at,"linearGradient");ue.setAttribute("id",this._gradientId),ue.setAttribute("x1","0"),ue.setAttribute("x2","0"),ue.setAttribute("y1","0"),ue.setAttribute("y2","1"),[["0%","currentColor","0.35"],["100%","currentColor","0"]].forEach(([re,K,ge])=>{let xe=document.createElementNS(at,"stop");xe.setAttribute("offset",re),xe.setAttribute("stop-color",K),xe.setAttribute("stop-opacity",ge),ue.appendChild(xe)}),j.appendChild(ue),A.appendChild(j);let z=document.createElementNS(at,"path");z.setAttribute("d",k),z.setAttribute("fill",`url(#${this._gradientId})`),z.setAttribute("stroke","none"),z.classList.add("velin-chart-area"),A.appendChild(z)}let S=document.createElementNS(at,"path");if(S.setAttribute("d",R),S.setAttribute("fill","none"),S.setAttribute("stroke","currentColor"),S.setAttribute("stroke-width","2"),S.setAttribute("stroke-linecap","round"),S.setAttribute("stroke-linejoin","round"),S.setAttribute("vector-effect","non-scaling-stroke"),A.appendChild(S),_&&A.classList.add("velin-chart-glow"),this.appendChild(A),b!=="none"){let j=typeof S.getTotalLength=="function"&&S.getTotalLength()||t;S.style.setProperty("--velin-chart-len",j.toFixed(2)),S.classList.add("velin-chart-line")}else S.style.strokeDasharray="",S.style.strokeDashoffset="";e&&(this.classList.remove("velin-spark-tick"),this.offsetWidth,this.classList.add("velin-spark-tick"))}_applyA11y(e){let t=(this.getAttribute("label")||this.getAttribute("aria-label")||"").trim();if(t){e.setAttribute("role","img"),e.setAttribute("aria-label",t),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-labelledby");return}let i=this.closest("figure")?.querySelector("figcaption");if(i?.textContent?.trim()){i.id||(i.id=`velin-sparkline-cap-${Math.random().toString(36).slice(2,9)}`),e.setAttribute("role","img"),e.setAttribute("aria-labelledby",i.id),e.removeAttribute("aria-hidden"),e.removeAttribute("aria-label");return}e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.removeAttribute("aria-label"),e.removeAttribute("aria-labelledby")}};typeof customElements<"u"&&!customElements.get("velin-sparkline")&&customElements.define("velin-sparkline",Zi);_l=Zi});var Kn,wl=p(()=>{Kn={"velin-accordion":()=>Promise.resolve().then(()=>(Rr(),us)),"velin-announcer":()=>Promise.resolve().then(()=>(an(),ca)),"velin-bottom-nav":()=>Promise.resolve().then(()=>(en(),Xs)),"velin-calendar":()=>Promise.resolve().then(()=>(ln(),ma)),"velin-carousel":()=>Promise.resolve().then(()=>(Br(),Cs)),"velin-code-block":()=>Promise.resolve().then(()=>(In(),Ua)),"velin-collapse":()=>Promise.resolve().then(()=>(Ur(),Ms)),"velin-combobox":()=>Promise.resolve().then(()=>(Qr(),Ys)),"velin-command":()=>Promise.resolve().then(()=>(sn(),aa)),"velin-copy":()=>Promise.resolve().then(()=>(Pr(),ks)),"velin-countdown":()=>Promise.resolve().then(()=>(Xr(),Bs)),"velin-counter":()=>Promise.resolve().then(()=>(Hi(),Ka)),"velin-data-table":()=>Promise.resolve().then(()=>(Dn(),Va)),"velin-dialog":()=>Promise.resolve().then(()=>(Vr(),Ps)),"velin-drawer":()=>Promise.resolve().then(()=>(zr(),ys)),"velin-dropdown":()=>Promise.resolve().then(()=>(Cr(),ls)),"velin-email":()=>Promise.resolve().then(()=>(Ei(),ha)),"velin-file-dropzone":()=>Promise.resolve().then(()=>(On(),Za)),"velin-form-summary":()=>Promise.resolve().then(()=>(zn(),Qa)),"velin-icon":()=>Promise.resolve().then(()=>(Nr(),vs)),"velin-lightbox":()=>Promise.resolve().then(()=>(Gr(),$s)),"velin-live-dot":()=>Promise.resolve().then(()=>(ji(),il)),"velin-menubar":()=>Promise.resolve().then(()=>(on(),oa)),"velin-modal":()=>Promise.resolve().then(()=>(Lr(),ss)),"velin-persist":()=>Promise.resolve().then(()=>(Jr(),Ws)),"velin-popover":()=>Promise.resolve().then(()=>(Hr(),As)),"velin-progress-ring":()=>Promise.resolve().then(()=>(Zr(),js)),"velin-rating":()=>Promise.resolve().then(()=>(nn(),ra)),"velin-scroll-top":()=>Promise.resolve().then(()=>(qr(),Ts)),"velin-scrollspy":()=>Promise.resolve().then(()=>(jr(),Ds)),"velin-search":()=>Promise.resolve().then(()=>(Mt(),jn)),"velin-secure-field":()=>Promise.resolve().then(()=>(gl(),vl)),"velin-segmented-control":()=>Promise.resolve().then(()=>(rn(),ea)),"velin-sheet":()=>Promise.resolve().then(()=>(tn(),Js)),"velin-sparkline":()=>Promise.resolve().then(()=>(Ji(),xl)),"velin-stepper":()=>Promise.resolve().then(()=>(di(),Yr)),"velin-stepper-wc":()=>Promise.resolve().then(()=>(di(),Yr)),"velin-tabs":()=>Promise.resolve().then(()=>(Mr(),ps)),"velin-theme-toggle":()=>Promise.resolve().then(()=>(Fr(),xs)),"velin-toast":()=>Promise.resolve().then(()=>(Ir(),fs)),"velin-tooltip":()=>Promise.resolve().then(()=>(li(),Kr)),"velin-tooltip-wc":()=>Promise.resolve().then(()=>(li(),Kr))}});function El(r,e={}){let t=new Set;for(let[i,n]of Object.entries(e)){if(n==="false"||n==="off")continue;let o=Al[i];if(o&&o.forEach(a=>t.add(a)),i==="slide"&&n&&n!=="true"&&n!==""){let a=`slide-${n}`;Al[a]?.forEach(c=>t.add(c))}}return t.forEach(i=>r.classList.add(i)),!r.classList.contains("velin-animate-on-scroll")&&e.reveal!==void 0&&r.classList.add("velin-animate-on-scroll"),[...t]}function Qi(r){r.classList.add(Wn),r.dataset.velinVisible="true"}function kl(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}var Wn,Al,Sl=p(()=>{Wn="velin-in-view",Al={reveal:["velin-animate-on-scroll"],fade:["velin-animate-on-scroll","velin-animate-on-scroll--fade"],slide:["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-up":["velin-animate-on-scroll","velin-animate-on-scroll--slide-up"],"slide-down":["velin-animate-on-scroll","velin-animate-on-scroll--slide-down"],"slide-left":["velin-animate-on-scroll","velin-animate-on-scroll--slide-left"],"slide-right":["velin-animate-on-scroll","velin-animate-on-scroll--slide-right"],scale:["velin-animate-on-scroll","velin-animate-on-scroll--scale"],parallax:["velin-parallax"],"parallax-slow":["velin-parallax","velin-parallax--slow"],hover:["velin-animate-hover"],"hover-lift":["velin-animate-hover"],flip:["velin-animate-scale-in"],blur:["velin-animate-fade-in"]}});function uh(r,e="true"){let t=e==="true"||e===""?60:parseInt(e,10)||60;[...r.children].forEach((n,o)=>{n.style.setProperty("--velin-stagger-delay",`${o*t}ms`),n.classList.add("velin-stagger-item")}),r.classList.add("velin-stagger")}function Ll(r=document){r.querySelectorAll(`[${Tl}]`).forEach(e=>{e.dataset.velinStaggerDone||(e.dataset.velinStaggerDone="1",uh(e,e.getAttribute(Tl)||"true"))})}var Tl,Cl=p(()=>{Tl="velin-stagger"});function hh(r,e={}){let t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,i=typeof r=="string"?document.querySelector(r):r;i&&(i.scrollIntoView({behavior:t||e.instant?"auto":"smooth",block:e.block||"start",inline:e.inline||"nearest"}),i.tabIndex<0&&!i.hasAttribute("tabindex")&&i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0}))}function Rl(r=document){r.querySelectorAll("[velin-scroll]").forEach(e=>{e.dataset.velinScrollBound||(e.dataset.velinScrollBound="1",e.addEventListener("click",t=>{let i=e.getAttribute("href");if(!i||!i.startsWith("#"))return;let n=document.querySelector(i);n&&(t.preventDefault(),hh(n))}))})}var Ml=p(()=>{});function qe(r={}){let e=r.root||(typeof document<"u"?document:null);if(!e)return()=>{};let t=r.selector||["[velin-reveal]","[velin-fade]","[velin-slide]","[velin-scale]","[velin-parallax]","[velin-hover]",".velin-animate-on-scroll"].join(","),i=e.querySelectorAll(t),n=kl();for(let o of i){if(o.dataset.velinMotionInit)continue;o.dataset.velinMotionInit="1";let a={};for(let u of ph)o.hasAttribute(u)&&(a[u.replace("velin-","")]=o.getAttribute(u)||"true");if(El(o,a),n){Qi(o);continue}let c=kt(o,u=>Qi(u));Gn.push(c)}return Ll(e),Rl(e),()=>{Gn.forEach(o=>o()),Gn=[],Pa()}}function Il(r={}){return qe({root:typeof document<"u"?document:null,selector:r.selector||".velin-animate-on-scroll"})}var ph,Gn,Dl,Yn=p(()=>{Cn();Sl();Cl();Ml();ph=["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover"],Gn=[];Dl={init:qe,observe:kt,markVisible:Qi,VISIBLE_CLASS:Wn}});function C(r,e){lt.set(r,e)}function Nl(r){return lt.get(r)}function It(r,e,t={}){r.setAttribute("data-velin-component",e);for(let[i,n]of Object.entries(t))n!=null&&r.setAttribute(i,n);return Q(e)}function mh(){C("velin-modal",{enhance(r){It(r,"velin-modal",{open:r.getAttribute("velin-modal")||""})}}),C("velin-tabs",{enhance:r=>It(r,"velin-tabs")}),C("velin-accordion",{enhance:r=>It(r,"velin-accordion")}),C("velin-tooltip",{enhance(r){let e=r.getAttribute("velin-tooltip")||r.getAttribute("title")||"";if(e&&r.hasAttribute("title")&&r.removeAttribute("title"),r.tagName==="VELIN-TOOLTIP"||r.tagName==="VELIN-TOOLTIP-WC")return r.setAttribute("content",e),Q("velin-tooltip");let t=document.createElement("velin-tooltip");t.setAttribute("content",e);let i=r.parentElement;return i&&(i.insertBefore(t,r),t.appendChild(r)),Q("velin-tooltip")}}),C("velin-copy",{enhance(r){let e=r.getAttribute("velin-copy")||r.textContent?.trim()||"";if(!r.querySelector("velin-copy")){let t=document.createElement("velin-copy");if(t.setAttribute("value",e),r.tagName==="BUTTON")return t.append(...r.childNodes),r.replaceWith(t),Q("velin-copy");r.appendChild(t)}return Q("velin-copy")}}),C("velin-counter",{enhance(r){It(r,"velin-counter",{value:r.getAttribute("velin-counter")||"0"})}}),C("velin-notify",{async enhance(r){await Q("velin-toast"),r.addEventListener("click",()=>{let e=r.getAttribute("velin-notify")||r.textContent||"";document.dispatchEvent(new CustomEvent("velin-toast-show",{detail:{message:e,variant:r.dataset.variant||"info"}}))})}}),C("velin-theme",{enhance(r){let e=r.getAttribute("velin-theme")||"toggle";if(e==="toggle")return r.querySelector("velin-theme-toggle")||r.appendChild(document.createElement("velin-theme-toggle")),Q("velin-theme-toggle");document.documentElement.setAttribute("data-velin-theme",e)}}),C("velin-scroll-top",{enhance(r){let e=r.getAttribute("velin-scroll-top"),t=e&&e!=="true"?e:"300";if(r.tagName==="VELIN-SCROLL-TOP")return e&&e!=="true"&&r.setAttribute("threshold",t),Q("velin-scroll-top");let i=document.querySelector("velin-scroll-top");return i||(i=document.createElement("velin-scroll-top"),i.setAttribute("threshold",t),(r===document.body||r===document.documentElement?document.body:r).appendChild(i)),Q("velin-scroll-top")}}),C("velin-progress",{enhance(r){if(r.hasAttribute("ring"))return It(r,"velin-progress-ring");r.classList.add("velin-progress");let t=parseInt(r.getAttribute("velin-progress")||"0",10);r.setAttribute("role","progressbar"),r.setAttribute("aria-valuenow",String(t)),r.style.setProperty("--velin-progress",`${Math.min(100,t)}%`)}}),C("velin-search",{async enhance(r){if(r.tagName!=="VELIN-SEARCH"){let e=document.createElement("velin-search");e.setAttribute("index",r.getAttribute("data-search-index")||"/search-index.json"),r.replaceWith(e),e.appendChild(r)}return Q("velin-search")}}),C("velin-lazy",{enhance(r){r.tagName==="IMG"&&(r.loading="lazy",r.decoding="async",(r.hasAttribute("velin-skeleton")||r.dataset.velinSkeleton)&&(r.classList.add("velin-skeleton","velin-skeleton--image"),r.addEventListener("load",()=>r.classList.remove("velin-skeleton","velin-skeleton--image"),{once:!0})))}}),C("velin-skeleton",{enhance(r){let e=r.getAttribute("velin-skeleton")||"text";r.classList.add("velin-skeleton",`velin-skeleton--${e}`),!(!!r.textContent?.trim()&&r.children.length>0)&&!r.textContent?.trim()&&r.setAttribute("aria-hidden","true")}}),C("velin-loading",{enhance(r){r.classList.add("velin-spinner"),r.setAttribute("aria-busy","true"),r.setAttribute("role","status"),r.getAttribute("aria-label")?.trim()||r.setAttribute("aria-label","Loading")}}),C("velin-grid",{enhance(r){let e=r.getAttribute("velin-grid")||"auto";r.classList.add("velin-grid"),e!=="auto"&&r.style.setProperty("--velin-grid-cols",e)}}),C("velin-anchor",{enhance(r){!r.id&&r.getAttribute("velin-anchor")&&(r.id=r.getAttribute("velin-anchor")),r.setAttribute("tabindex","-1")}}),C("velin-code",{async enhance(r){let e=r.getAttribute("velin-code")||r.getAttribute("language")||r.getAttribute("data-language")||"";if(r.classList.add("velin-code-block"),e&&e!=="true"&&(r.dataset.language=e,r.getAttribute("language")||r.setAttribute("language",e)),!r.querySelector("[data-velin-copy]")){let o=document.createElement("button");o.type="button",o.className="velin-code-block__copy velin-btn velin-btn--sm",o.textContent="Copy",o.setAttribute("data-velin-copy",""),o.setAttribute("velin-copy",r.querySelector("code")?.textContent||r.textContent||""),r.style.position="relative",r.appendChild(o)}await Q("velin-copy");let{initHighlight:t,highlightElement:i}=await Promise.resolve().then(()=>(Tt(),Mn));r.getAttribute("data-velin-highlight")==="immediate"||typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches?await i(r):t(r,{root:r})}}),C("velin-quote",{enhance(r){(r.tagName==="BLOCKQUOTE"||r.tagName==="Q")&&r.classList.add("velin-quote")}}),C("velin-highlight",{enhance(r){r.classList.add("velin-highlight")}});for(let r of["velin-reveal","velin-fade","velin-slide","velin-scale","velin-parallax","velin-hover","velin-stagger","velin-scroll"])C(r,{enhance(){}})}async function Vn(r=document){let e=[...lt.keys()].map(i=>`[${i}]`).join(","),t=r.querySelectorAll(e);for(let i of t)if(!Ol.has(i)){for(let n of lt.keys()){if(!i.hasAttribute(n))continue;let o=lt.get(n);o?.enhance&&await o.enhance(i)}Ol.add(i)}if(qe({root:r}),typeof HTMLElement<"u"){let{bindDeclarativeSearch:i}=await Promise.resolve().then(()=>(Mt(),jn));if(i(r),!document.querySelector("velin-announcer")){let{getAnnouncer:n}=await Promise.resolve().then(()=>(Le(),Ns));n()}}}function Xn(){return[...lt.keys()]}var lt,Ol,zl=p(()=>{Zn();Yn();lt=new Map;mh();Ol=new WeakSet});var $l={};y($l,{bootAttributes:()=>Vn,getAttributeHandler:()=>Nl,listRegisteredAttributes:()=>Xn,registerAttribute:()=>C});var Jn=p(()=>{zl()});var Fl={};y(Fl,{PATTERNS:()=>er,VelinHapticObserver:()=>Ot,applyHaptic:()=>Dt,default:()=>fh,vibrate:()=>Qn});function Qn(r){if(typeof navigator>"u"||!navigator.vibrate||window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches)return;let t=typeof r=="string"?er[r]||er.tap:r;navigator.vibrate(t)}function Dt(r){let e=r.getAttribute("haptic")||"tap";r.addEventListener("click",()=>Qn(e))}var er,Ot,fh,eo=p(()=>{er={tap:[10],"double-tap":[10,50,10],success:[50],error:[100,30,100],warning:[30,20,30],long:[200]};Ot=class{constructor(){this._observer=null}start(e=document.body){e.querySelectorAll("[haptic]").forEach(Dt),this._observer=new MutationObserver(i=>{for(let n of i)for(let o of n.addedNodes)o.nodeType===1&&(o.hasAttribute?.("haptic")&&Dt(o),o.querySelectorAll?.("[haptic]").forEach(Dt))}),this._observer.observe(e,{childList:!0,subtree:!0})}stop(){this._observer?.disconnect()}},fh=Ot});function vh(r){return typeof customElements>"u"?Promise.reject(new Error("customElements not available")):customElements.whenDefined(r)}async function Q(r){let e=Kn[r];if(!e)throw new Error(`Unknown Velin component: ${r}`);if(to.has(r))return to.get(r);let t=e().then(i=>{let n=i.default;return n&&!customElements.get(r)&&customElements.define(r,n),n});return to.set(r,t),t}async function Hl(r){return Promise.all(r.map(e=>Q(e)))}function gh(r){let e=new Set;r.querySelectorAll("[data-velin-component]").forEach(t=>{let i=t.getAttribute("data-velin-component");i&&e.add(i.startsWith("velin-")?i:`velin-${i}`)});for(let t of r.querySelectorAll("*")){let i=t.tagName?.toLowerCase();i&&bh.test(i)&&Kn[i]&&e.add(i)}return e}async function yh(r=document,e={}){let t=e.tags?.length?new Set(e.tags):gh(r),i=Hl([...t]);if(e.attributes){let{bootAttributes:n}=await Promise.resolve().then(()=>(Jn(),$l));await n(r)}if(e.highlight){let{initHighlight:n}=await Promise.resolve().then(()=>(Tt(),Mn));n(r)}if(e.haptic){let{VelinHapticObserver:n}=await Promise.resolve().then(()=>(eo(),Fl));new n().start(r instanceof Document?r.body:r)}return i}var to,bh,Zn=p(()=>{wl();to=new Map,bh=/^velin-[a-z0-9-]+$/});Lr();Cr();Rr();Mr();Ir();Nr();zr();Fr();Hr();Pr();qr();Br();Ur();jr();li();Gr();di();Vr();Xr();Zr();Jr();Qr();en();tn();rn();nn();on();sn();an();Ei();Zn();Ji();Hi();ji();In();Dn();zn();ln();On();Mt();Mt();Yn();var _h=Il;if(typeof document<"u"){let r=()=>{document.documentElement?.hasAttribute("data-velin-reveal-auto")&&qe()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r,{once:!0}):r()}Le();Le();function xh(r={}){if(typeof document>"u")return;let{announcer:e=!0,scrollPadding:t=!0,skipLink:i=!1}=r;if(e&&et(),t){let n=document.querySelector(".velin-nav, .velin-doc-header, .site-nav, [data-velin-fixed-nav]");if(n){let o=n.getBoundingClientRect().height;document.documentElement.style.setProperty("--velin-nav-height",`${Math.ceil(o)}px`),document.documentElement.classList.add("velin-scroll-pt-nav")}}if(i&&!document.querySelector(".velin-skip-link")&&document.getElementById("main")){let n=document.createElement("a");n.href="#main",n.className="velin-skip-link",n.textContent="Skip to main content",document.body.prepend(n)}}Un();Jn();Tt();var Pl=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null,Wl={duration:250,easing:"var(--velin-ease-expo-out, cubic-bezier(0.16, 1, 0.3, 1))",itemSelector:":scope > *"};function io(r,e){return Array.from(r.querySelectorAll(e))}function Gl(r,e,t={}){if(!r||typeof e!="function")return;let i={...Wl,...t},n=Pl&&Pl.matches,o=io(r,i.itemSelector),a=new Map;if(o.forEach(u=>{u.hidden||a.set(u,u.getBoundingClientRect())}),e(),n)return;io(r,i.itemSelector).forEach(u=>{if(u.hidden)return;let f=a.get(u),_=u.getBoundingClientRect();if(!f){if(typeof u.animate!="function")return;u.animate([{opacity:0,transform:"scale(0.96)"},{opacity:1,transform:"scale(1)"}],{duration:i.duration,easing:i.easing,fill:"both"});return}let b=f.left-_.left,g=f.top-_.top;b===0&&g===0||typeof u.animate=="function"&&u.animate([{transform:`translate(${b}px, ${g}px)`},{transform:"translate(0, 0)"}],{duration:i.duration,easing:i.easing,fill:"both"})})}function Yl(r,e,t={}){if(!r||typeof e!="function")return;let i={...Wl,...t};Gl(r,()=>{io(r,i.itemSelector).forEach(n=>{n.hidden=!e(n)})},i)}function ql(r){return r?String(r).toLowerCase().split(/[\s,|]+/).map(e=>e.trim()).filter(Boolean):[]}function wh(r,e,t){return e.length?t==="all"?e.every(i=>r.includes(i)):e.some(i=>r.includes(i)):!0}function Ah(r,e){return e?((r.getAttribute("data-tags")||"")+" "+(r.getAttribute("data-search")||"")+" "+(r.textContent||"")).toLowerCase().includes(e.toLowerCase()):!0}var ro=class{constructor(e){this.container=e,this.tag="",this.search="",this.matchMode=e.getAttribute("data-velin-filter-mode")==="all"?"all":"any",this.itemSelector=e.getAttribute("data-velin-filter-item")||":scope > *"}apply(){let e=ql(this.tag),t=this.search;Yl(this.container,i=>{let n=ql(i.getAttribute("data-tags"));return wh(n,e,this.matchMode)&&Ah(i,t)},{itemSelector:this.itemSelector})}},Bl=new WeakMap;function Ul(r){let e=Bl.get(r);return e||(e=new ro(r),Bl.set(r,e)),e}function jl(r){let e=r.getAttribute("data-velin-filter-target");if(!e)return null;try{return document.querySelector(e)}catch{return null}}function Eh(r,e){r&&r.querySelectorAll("[data-velin-filter-value]").forEach(t=>{t===e?t.setAttribute("data-velin-filter-active",""):t.removeAttribute("data-velin-filter-active")})}function Kl(){if(typeof document>"u")return;document.addEventListener("click",e=>{let t=e.target.closest("[data-velin-filter-value]");if(!t)return;let i=jl(t);if(!i)return;let n=t.closest("[data-velin-filter-group]")||t.parentElement;Eh(n,t);let o=Ul(i);o.tag=t.getAttribute("data-velin-filter-value")||"",(o.tag.toLowerCase()==="all"||o.tag==="*")&&(o.tag=""),o.apply()});let r=e=>{let t=e.target.closest("[data-velin-filter-input]");if(!t)return;let i=jl(t);if(!i)return;let n=Ul(i),o=t.value||(typeof t.getAttribute=="function"?t.getAttribute("value"):"");n.search=(o||"").trim(),n.apply()};document.addEventListener("input",r),document.addEventListener("change",r)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Kl,{once:!0}):Kl());T();eo();Z();Ji();Hi();ji();Ei();export{er as HapticPatterns,ds as VelinAccordion,la as VelinAnnouncer,Vs as VelinBottomNav,pa as VelinCalendar,Ls as VelinCarousel,Ba as VelinCodeBlock,Rs as VelinCollapse,Gs as VelinCombobox,sa as VelinCommand,Es as VelinCopy,qs as VelinCountdown,ja as VelinCounter,Ya as VelinDataTable,Hs as VelinDialog,gs as VelinDrawer,as as VelinDropdown,ua as VelinEmail,Xa as VelinFileDropzone,Ja as VelinFormSummary,Ot as VelinHapticObserver,bs as VelinIcon,zs as VelinLightbox,tl as VelinLiveDot,na as VelinMenubar,os as VelinModal,Ks as VelinPersist,ws as VelinPopover,Us as VelinProgressRing,ia as VelinRating,Ss as VelinScrollTop,Is as VelinScrollspy,fl as VelinSearch,Qs as VelinSegmentedControl,Zs as VelinSheet,_l as VelinSparkline,Fs as VelinStepper,yt as VelinStepperWC,hs as VelinTabs,_s as VelinThemeToggle,ms as VelinToast,Os as VelinTooltip,gt as VelinTooltipWC,ne as announce,Dt as applyHaptic,bl as bindDeclarativeSearch,Vn as bootAttributes,yh as bootFromDOM,G as clearBackgroundInert,Td as createSafeHTML,Bn as createSearch,m as escapeHTML,ye as escapeHTMLAttribute,Yl as filterList,Gl as flipReorder,et as getAnnouncer,fe as getFocusableElements,ns as getTrustedPolicy,Et as highlightAll,de as highlightElement,xh as initA11y,Ie as initHighlight,qe as initMotion,_h as initReveal,Q as lazyDefine,Me as lazyLoadLanguage,Xn as listRegisteredAttributes,St as observeCodeBlocks,Hl as register,C as registerAttribute,ot as registerLanguage,sl as registerSearchProvider,Di as renderTokens,le as restoreFocus,te as rovingTabindex,$e as sanitizeURL,ae as saveFocus,ce as setBackgroundInert,Tr as stripControlChars,ee as trapFocus,Dl as velinMotion,rh as velinSearch,qa as velinSyntax,Qn as vibrate,vh as whenDefined};
|
|
1211
1359
|
/*! Bundled license information:
|
|
1212
1360
|
|
|
1213
1361
|
dompurify/dist/purify.es.mjs:
|
|
1214
|
-
(*! @license DOMPurify 3.4.
|
|
1362
|
+
(*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE *)
|
|
1215
1363
|
*/
|