@jxsuite/studio 6.1.2 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/chunks/2020-5wtzce5g.js +4 -0
- package/dist/chunks/adapter-5tphg7xe.js +4 -0
- package/dist/chunks/add-new-flow-psym14sn.js +4 -0
- package/dist/chunks/cf-account-picker-haqazq5r.js +4 -0
- package/dist/chunks/cf-settings-h2wrh6hq.js +4 -0
- package/dist/chunks/{color-area-0fj8a4ga.js → color-area-6rbra5dy.js} +2 -2
- package/dist/chunks/{color-field-xch8kx2g.js → color-field-gy56c94g.js} +3 -3
- package/dist/chunks/color-m7r1vk54.js +4 -0
- package/dist/chunks/{color-slider-jxd8v350.js → color-slider-sqqdyf6c.js} +2 -2
- package/dist/chunks/{combobox-p0efwjke.js → combobox-72h32ejk.js} +3 -3
- package/dist/chunks/components-r22xca09.js +4 -0
- package/dist/chunks/content-source-mmppmcyg.js +4 -0
- package/dist/chunks/convert-to-repeater-he70fc2b.js +4 -0
- package/dist/chunks/editor-ccd9jwsa.js +4 -0
- package/dist/chunks/entry-commands-6qxz9e8p.js +4 -0
- package/dist/chunks/extension-sections-0egb88dm.js +4 -0
- package/dist/chunks/file-ops-qnab36ek.js +4 -0
- package/dist/chunks/files-rcn56qvm.js +4 -0
- package/dist/chunks/format-host-yxz0kjjs.js +4 -0
- package/dist/chunks/fs-events-d1qxq4z4.js +4 -0
- package/dist/chunks/grid-open-4z1g062t.js +4 -0
- package/dist/chunks/{grid-view-d2wq9ezg.js → grid-view-qg1b5eqx.js} +25 -25
- package/dist/chunks/{icons-pnfz478q.js → icons-63bjtbs7.js} +2 -2
- package/dist/chunks/{iframe-entry-jdcktez8.js → iframe-entry-2zggzajv.js} +4 -4
- package/dist/chunks/{iframe-entry-zap785cw.js → iframe-entry-76j8vwwx.js} +4 -4
- package/dist/chunks/iframe-entry-99nr5zfb.js +5 -0
- package/dist/chunks/{iframe-entry-x0ygf2yr.js → iframe-entry-pkgmcgp0.js} +4 -4
- package/dist/chunks/iframe-host-ssv7kyj0.js +4 -0
- package/dist/chunks/{index-zpjmzqfk.js → index-32eqzv1k.js} +3 -3
- package/dist/chunks/index-f0jn7nnp.js +4 -0
- package/dist/chunks/{javascript-m54mnwp6.js → javascript-pjp734q4.js} +3 -3
- package/dist/chunks/jsonMode-njkvsa02.js +13 -0
- package/dist/chunks/jx-validate-ttasrbh7.js +4 -0
- package/dist/chunks/layers-bgyr11tr.js +4 -0
- package/dist/chunks/layers-panel-7ez66zeq.js +4 -0
- package/dist/chunks/{listbox-e74qjyq6.js → listbox-c421cf8c.js} +2 -2
- package/dist/chunks/lit-html-v9gh687x.js +4 -0
- package/dist/chunks/media-library-sq468wts.js +4 -0
- package/dist/chunks/media-picker-shfe59pt.js +4 -0
- package/dist/chunks/{menu-n6yzswmy.js → menu-bdpzbfvs.js} +2 -2
- package/dist/chunks/{monaco-binding-7gx83x3r.js → monaco-binding-vq1hgnn0.js} +3 -3
- package/dist/chunks/monaco-buffer-3afgwvbp.js +4 -0
- package/dist/chunks/monaco-setup-xrd2cbkp.js +4 -0
- package/dist/chunks/notify-kzrjr3fv.js +4 -0
- package/dist/chunks/parse-v77xtwv7.js +4 -0
- package/dist/chunks/platform-7v4rtd7m.js +4 -0
- package/dist/chunks/popover-b89sfej7.js +4 -0
- package/dist/chunks/publish-panel-2z9gw8ee.js +4 -0
- package/dist/chunks/publish-quick-qx2455cj.js +4 -0
- package/dist/chunks/publish-workspace-wrc1dgwx.js +4 -0
- package/dist/chunks/quick-search-n0t0eqxb.js +4 -0
- package/dist/chunks/references-9547rg5s.js +4 -0
- package/dist/chunks/right-panel-wsgnr9pn.js +4 -0
- package/dist/chunks/source-control-kwktr9y6.js +4 -0
- package/dist/chunks/{split-n2gfpm5m.js → split-c9zfdgxf.js} +2 -2
- package/dist/chunks/studio-03ct6yfv.js +9 -0
- package/dist/chunks/studio-07rcfje3.js +5 -0
- package/dist/chunks/studio-3e54qh39.js +7 -0
- package/dist/chunks/studio-3exxhz5g.js +5 -0
- package/dist/chunks/studio-3q40e3rj.js +5 -0
- package/dist/chunks/studio-3qeh9t0h.js +6 -0
- package/dist/chunks/studio-3qqjeep5.js +6 -0
- package/dist/chunks/studio-43sd2mam.js +4 -0
- package/dist/chunks/studio-4hp8pkyt.js +5 -0
- package/dist/chunks/studio-58xg6j2q.js +9 -0
- package/dist/chunks/studio-5g0rprdt.js +7 -0
- package/dist/chunks/{studio-2j1cb95x.js → studio-6m380wp7.js} +4 -4
- package/dist/chunks/studio-80jyh1xh.js +4 -0
- package/dist/chunks/studio-83mk4bgg.js +9 -0
- package/dist/chunks/{studio-v0jzqdjm.js → studio-881z1xrx.js} +4 -4
- package/dist/chunks/studio-8m0y2qe7.js +5 -0
- package/dist/chunks/{studio-d81xfh1g.js → studio-8tr6cfrc.js} +4 -4
- package/dist/chunks/studio-8vcvfs7r.js +6 -0
- package/dist/chunks/studio-9tmebf0s.js +5 -0
- package/dist/chunks/studio-a2bvaptz.js +5 -0
- package/dist/chunks/studio-b7y5mr30.js +5 -0
- package/dist/chunks/studio-bavb31r0.js +5 -0
- package/dist/chunks/{studio-dgz8d0c1.js → studio-bbe4c90a.js} +4 -4
- package/dist/chunks/studio-c05wdnt3.js +5 -0
- package/dist/chunks/studio-ccv2svc6.js +5 -0
- package/dist/chunks/studio-d5grtb9e.js +16 -0
- package/dist/chunks/studio-df0baea9.js +5 -0
- package/dist/chunks/studio-dgk4dqtx.js +7 -0
- package/dist/chunks/studio-e1g64q43.js +5 -0
- package/dist/chunks/studio-ed1hp6zf.js +6 -0
- package/dist/chunks/studio-ed3xx40h.js +7 -0
- package/dist/chunks/studio-f14e1zdj.js +5 -0
- package/dist/chunks/studio-fbhxxc5f.js +5 -0
- package/dist/chunks/studio-fyh0jc96.js +5 -0
- package/dist/chunks/studio-gcxk20n7.js +5 -0
- package/dist/chunks/studio-jaaz8ce9.js +5 -0
- package/dist/chunks/{studio-90pq9km1.js → studio-jcnsdaep.js} +4 -4
- package/dist/chunks/studio-jsgf2q5k.js +7 -0
- package/dist/chunks/{studio-0q988f9w.js → studio-k3xxbagr.js} +3 -3
- package/dist/chunks/{studio-5ve6bbep.js → studio-k7evxqh4.js} +4 -4
- package/dist/chunks/studio-kt3pjkwd.js +5 -0
- package/dist/chunks/studio-m8g16bgz.js +5 -0
- package/dist/chunks/studio-mn0476ag.js +5 -0
- package/dist/chunks/studio-mx1smyq0.js +5 -0
- package/dist/chunks/studio-n0c5h6mf.js +5 -0
- package/dist/chunks/{studio-485046te.js → studio-nh6d342n.js} +7 -7
- package/dist/chunks/studio-nqxqf8p2.js +4 -0
- package/dist/chunks/studio-p4nrkvqr.js +5 -0
- package/dist/chunks/{studio-1fxkaaea.js → studio-pbxa5fpc.js} +4 -4
- package/dist/chunks/studio-pgmvdv7z.js +7 -0
- package/dist/chunks/studio-ph84avkf.js +5 -0
- package/dist/chunks/{studio-tq0rtfwj.js → studio-q0mvbaq6.js} +4 -4
- package/dist/chunks/studio-q0tccd43.js +5 -0
- package/dist/chunks/studio-q7rtx6zq.js +14 -0
- package/dist/chunks/{studio-a3g98wjr.js → studio-qgh13jtz.js} +4 -4
- package/dist/chunks/studio-qmn1xc24.js +5 -0
- package/dist/chunks/studio-qwdqwkj0.js +5 -0
- package/dist/chunks/studio-r5qy30vx.js +5 -0
- package/dist/chunks/studio-rj9eamf8.js +5 -0
- package/dist/chunks/studio-rptgsk96.js +5 -0
- package/dist/chunks/studio-rthyg42z.js +928 -0
- package/dist/chunks/studio-s19tp1xr.js +5 -0
- package/dist/chunks/studio-s32578pn.js +5 -0
- package/dist/chunks/studio-svb7yyve.js +5 -0
- package/dist/chunks/studio-syreb644.js +5 -0
- package/dist/chunks/studio-tf9jryb1.js +10 -0
- package/dist/chunks/studio-tfkznv39.js +5 -0
- package/dist/chunks/studio-tft6r105.js +5 -0
- package/dist/chunks/studio-txf2kysx.js +5 -0
- package/dist/chunks/studio-v8867ddv.js +12 -0
- package/dist/chunks/studio-vxq7fcvv.js +5 -0
- package/dist/chunks/studio-w4rz9hdk.js +5 -0
- package/dist/chunks/studio-wbcjbhy1.js +9 -0
- package/dist/chunks/studio-wc649wss.js +5 -0
- package/dist/chunks/studio-wys23mxz.js +5 -0
- package/dist/chunks/studio-x1x167jh.js +5 -0
- package/dist/chunks/studio-x9hsze61.js +5 -0
- package/dist/chunks/studio-y0n7yxea.js +9 -0
- package/dist/chunks/studio-y3ahhdpx.js +5 -0
- package/dist/chunks/studio-z97c48fk.js +5 -0
- package/dist/chunks/studio-zat62m0c.js +5 -0
- package/dist/chunks/studio-zcd2e7yz.js +5 -0
- package/dist/chunks/studio-zz9qe3rw.js +64 -0
- package/dist/chunks/toast-1gv0h53h.js +4 -0
- package/dist/chunks/{toast-host-ke5z4ng7.js → toast-host-1yg5ar8d.js} +3 -3
- package/dist/chunks/{tooltip-5v8ngwj2.js → tooltip-yypz28gq.js} +3 -3
- package/dist/chunks/{tree-mdq3v5cw.js → tree-9xa4hm7n.js} +2 -2
- package/dist/chunks/tsMode-epyfz1hv.js +14 -0
- package/dist/chunks/workspace-dz7nxfhv.js +4 -0
- package/dist/chunks/workspace-home-xsd7hkjw.js +4 -0
- package/dist/chunks/{ws-client-nze0k6mv.js → ws-client-bv552sfx.js} +3 -3
- package/dist/iframe-entry.js +20 -16
- package/dist/manifest.json +77 -63
- package/dist/studio.js +103 -104
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +12 -11
- package/src/browse/component-examples.ts +272 -0
- package/src/browse/library-commands.ts +64 -104
- package/src/browse/library-layouts.ts +263 -49
- package/src/browse/library-model.ts +181 -133
- package/src/browse/library-pane.ts +738 -446
- package/src/browse/library-preview.ts +149 -19
- package/src/browse/library-source.ts +308 -41
- package/src/browse/preview-root.ts +78 -0
- package/src/browse/preview-style.ts +155 -0
- package/src/canvas/asset-refs.ts +16 -1
- package/src/canvas/canvas-live-render.ts +222 -30
- package/src/canvas/canvas-origin.ts +37 -12
- package/src/canvas/canvas-page-context.ts +112 -0
- package/src/canvas/canvas-render.ts +113 -107
- package/src/canvas/canvas-utils.ts +57 -12
- package/src/canvas/iframe-drop.ts +107 -0
- package/src/canvas/iframe-entry.ts +24 -12
- package/src/canvas/iframe-host.ts +134 -62
- package/src/canvas/iframe-keys.ts +11 -0
- package/src/canvas/iframe-patch.ts +8 -7
- package/src/canvas/iframe-protocol.ts +24 -5
- package/src/canvas/iframe-render.ts +48 -1
- package/src/canvas/iframe-subtree.ts +5 -2
- package/src/canvas/npm-modules.ts +22 -0
- package/src/canvas/preview-navigate.ts +16 -0
- package/src/canvas/repeater-sources.ts +200 -0
- package/src/canvas/stage-scrollbar.ts +5 -1
- package/src/canvas/surface-registry.ts +6 -0
- package/src/commands/app-commands.ts +16 -6
- package/src/commands/budget.ts +10 -8
- package/src/commands/context.ts +35 -10
- package/src/commands/defaults.ts +69 -45
- package/src/commands/keymap.ts +9 -0
- package/src/commands/levels.ts +11 -5
- package/src/commands/live-context.ts +2 -0
- package/src/commands/registry.ts +10 -1
- package/src/content/collection-match.ts +6 -5
- package/src/content/collection-pages.ts +412 -0
- package/src/content/content-collections.ts +270 -0
- package/src/content/entry-commands.ts +51 -60
- package/src/content/entry-editor.ts +111 -18
- package/src/content/entry-fields.ts +13 -1
- package/src/content/entry-inspector.ts +225 -0
- package/src/content/entry-model.ts +17 -3
- package/src/content/entry-open.ts +80 -0
- package/src/content/entry-summaries.ts +440 -0
- package/src/content/file-record-ids.ts +80 -0
- package/src/content/file-records.ts +125 -0
- package/src/content/page-summaries.ts +129 -0
- package/src/content/record-entry.ts +201 -0
- package/src/content/writing-banner.ts +177 -0
- package/src/create/add-new-commands.ts +185 -0
- package/src/create/add-new-flow.ts +1116 -0
- package/src/create/add-new.ts +1014 -0
- package/src/create/element-name.ts +121 -0
- package/src/editor/convert-to-component.ts +67 -43
- package/src/editor/file-drop-action.ts +9 -1
- package/src/editor/inline-edit-apply.ts +44 -0
- package/src/editor/inline-edit.ts +10 -0
- package/src/editor/insert-component.ts +91 -0
- package/src/editor/insert-zone-action.ts +13 -4
- package/src/editor/shortcuts.ts +44 -22
- package/src/editor/slash-menu.ts +51 -8
- package/src/files/components.ts +74 -10
- package/src/files/file-ops.ts +15 -5
- package/src/files/files.ts +164 -150
- package/src/files/fs-events.ts +18 -7
- package/src/files/media-meta.ts +95 -1
- package/src/files/media-types.ts +55 -0
- package/src/files/media-upload.ts +209 -52
- package/src/files/new-file-name.ts +156 -0
- package/src/files/serialize-document.ts +13 -3
- package/src/format/format-host.ts +15 -0
- package/src/github/github-auth.ts +2 -2
- package/src/github/github-publish.ts +4 -3
- package/src/grid/grid-controller.ts +5 -1
- package/src/grid/grid-open.ts +0 -27
- package/src/grid/grid-panel.ts +54 -2
- package/src/grid/grid-reveal.ts +34 -0
- package/src/grid/grid-source.ts +3 -25
- package/src/grid/grid-view.ts +31 -6
- package/src/grid/sources/content-source.ts +75 -7
- package/src/grid/tabulator-tables.d.ts +6 -0
- package/src/hosting/document.ts +2 -2
- package/src/i18n/i18n-commands.ts +2 -1
- package/src/media/media-commands.ts +181 -0
- package/src/media/media-library-model.ts +232 -0
- package/src/media/media-library.ts +1283 -0
- package/src/media/media-pane.ts +47 -19
- package/src/packages/pull-package-sync.ts +1 -1
- package/src/panels/activity-panel.ts +21 -5
- package/src/panels/ai-chat/chat-markdown.ts +8 -8
- package/src/panels/block-action-bar.ts +11 -11
- package/src/panels/canvas-dnd-bridge.ts +5 -2
- package/src/panels/chat-panel.ts +6 -6
- package/src/panels/collections-panel.ts +306 -0
- package/src/panels/component-preview.ts +35 -13
- package/src/panels/data-explorer.ts +1 -1
- package/src/panels/data-grid.ts +4 -0
- package/src/panels/dnd.ts +17 -30
- package/src/panels/elements-panel.ts +9 -2
- package/src/panels/empty-state.ts +2 -2
- package/src/panels/formula-workspace.ts +2 -3
- package/src/panels/frontmatter-fields.ts +9 -9
- package/src/panels/git-diff-open.ts +9 -5
- package/src/panels/head-panel.ts +369 -103
- package/src/panels/i18n-panel.ts +11 -10
- package/src/panels/imports-panel.ts +2 -0
- package/src/panels/jump-bar.ts +27 -2
- package/src/panels/layers-panel.ts +36 -30
- package/src/panels/left-panel.ts +22 -8
- package/src/panels/navigator-panels.ts +23 -11
- package/src/panels/pane-context.ts +111 -29
- package/src/panels/pane-grid.ts +6 -6
- package/src/panels/panel-registry.ts +14 -9
- package/src/panels/properties-panel.ts +7 -3
- package/src/panels/right-panel.ts +199 -43
- package/src/panels/seo-modal.ts +41 -108
- package/src/panels/settings-menu.ts +52 -50
- package/src/panels/settings-pane.ts +268 -162
- package/src/panels/signals-panel.ts +3 -4
- package/src/panels/site-model.ts +367 -0
- package/src/panels/site-panel.ts +638 -0
- package/src/panels/style-panel.ts +37 -3
- package/src/panels/stylebook-doc.ts +142 -10
- package/src/panels/stylebook-layers-panel.ts +39 -80
- package/src/panels/stylebook-panel.ts +47 -10
- package/src/panels/styles-panel.ts +327 -0
- package/src/panels/tab-strip.ts +109 -25
- package/src/platform.ts +1 -1
- package/src/platforms/cloud.ts +28 -1
- package/src/platforms/default-platform.ts +4 -4
- package/src/platforms/devserver.ts +51 -25
- package/src/publish/deploy-checklist.ts +12 -7
- package/src/publish/pages-service.ts +38 -14
- package/src/publish/publish-changes.ts +491 -0
- package/src/publish/publish-commands.ts +83 -18
- package/src/publish/publish-ids.ts +49 -0
- package/src/publish/publish-quick.ts +148 -0
- package/src/publish/publish-workspace.ts +926 -0
- package/src/publish/source-control.ts +907 -0
- package/src/services/automation.ts +16 -20
- package/src/services/cf-settings.ts +4 -4
- package/src/services/connection.ts +2 -2
- package/src/services/directory-picker.ts +2 -2
- package/src/services/references.ts +0 -0
- package/src/services/render-critic.ts +21 -2
- package/src/services/settings/definitions.ts +25 -14
- package/src/settings/contributed-section.ts +49 -10
- package/src/settings/css-vars-editor.ts +93 -27
- package/src/settings/developer-panels.ts +43 -0
- package/src/settings/extension-sections.ts +20 -2
- package/src/settings/general-settings.ts +91 -21
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/settings/project-sections.ts +27 -10
- package/src/settings/schema-field-ui.ts +3 -1
- package/src/settings/section-registry.ts +116 -11
- package/src/settings/settings-dialog.ts +192 -0
- package/src/settings/settings-document.ts +182 -162
- package/src/shell.ts +467 -431
- package/src/site-context.ts +64 -10
- package/src/state.ts +28 -9
- package/src/studio.ts +194 -41
- package/src/style/project-styles.ts +34 -0
- package/src/style/stylebook-specimens.ts +89 -0
- package/src/style/stylebook-target.ts +26 -0
- package/src/style/tag-inheritance.ts +105 -0
- package/src/style/variables-focus.ts +61 -0
- package/src/style/variables-view.ts +235 -0
- package/src/surfaces/add-new.json +1482 -0
- package/src/surfaces/add-new.ts +325 -0
- package/src/surfaces/ai-chat.ts +2 -2
- package/src/surfaces/boot-failure.json +4 -3
- package/src/surfaces/bottom-dock.json +1 -1
- package/src/surfaces/canvas-stage.json +30 -19
- package/src/surfaces/canvas-stage.ts +5 -5
- package/src/surfaces/collections-panel.json +615 -0
- package/src/surfaces/collections-panel.ts +168 -0
- package/src/surfaces/commandbar.json +241 -96
- package/src/surfaces/commandbar.ts +134 -99
- package/src/surfaces/empty-state.json +1 -1
- package/src/surfaces/entry-editor.json +136 -0
- package/src/surfaces/entry-editor.ts +21 -0
- package/src/surfaces/entry-inspector.json +371 -0
- package/src/surfaces/entry-inspector.ts +143 -0
- package/src/surfaces/inspector-dock.json +162 -14
- package/src/surfaces/inspector-dock.ts +46 -19
- package/src/surfaces/library-pane.json +670 -437
- package/src/surfaces/library-pane.ts +94 -59
- package/src/surfaces/media-browser.json +62 -6
- package/src/surfaces/media-browser.ts +15 -1
- package/src/surfaces/media-field.json +1 -1
- package/src/surfaces/media-library.json +1586 -0
- package/src/surfaces/media-library.ts +282 -0
- package/src/surfaces/media-pick-dialog.json +71 -0
- package/src/surfaces/media-pick-dialog.ts +132 -0
- package/src/surfaces/menu.ts +18 -0
- package/src/surfaces/pane-context.json +144 -77
- package/src/surfaces/pane-context.ts +24 -0
- package/src/surfaces/panel-deploy-checklist.json +12 -6
- package/src/surfaces/panel-deploy-checklist.ts +3 -1
- package/src/surfaces/panel-page.json +72 -2
- package/src/surfaces/panel-page.ts +38 -7
- package/src/surfaces/panel-signals.json +1 -1
- package/src/surfaces/panel-signals.ts +5 -5
- package/src/surfaces/panel-stylebook-layers.json +71 -204
- package/src/surfaces/panel-stylebook-layers.ts +0 -21
- package/src/surfaces/preferences.json +120 -48
- package/src/surfaces/preferences.ts +8 -0
- package/src/surfaces/publish-quick.json +428 -0
- package/src/surfaces/publish-quick.ts +165 -0
- package/src/surfaces/publish-workspace.json +2892 -0
- package/src/surfaces/publish-workspace.ts +391 -0
- package/src/surfaces/rail.json +1 -159
- package/src/surfaces/rail.ts +18 -75
- package/src/surfaces/schema-form.json +10 -2
- package/src/surfaces/schema-form.ts +2 -0
- package/src/surfaces/seo.json +1 -1
- package/src/surfaces/settings-contributed.json +5 -5
- package/src/surfaces/settings-contributed.ts +18 -2
- package/src/surfaces/settings-css-vars.json +44 -36
- package/src/surfaces/settings-css-vars.ts +77 -4
- package/src/surfaces/settings-deploy.json +2 -15
- package/src/surfaces/settings-deploy.ts +1 -1
- package/src/surfaces/settings-dialog.json +51 -0
- package/src/surfaces/settings-dialog.ts +169 -0
- package/src/surfaces/settings-overview.json +3 -3
- package/src/surfaces/settings-overview.ts +9 -2
- package/src/surfaces/settings-pane.json +269 -46
- package/src/surfaces/settings-pane.ts +85 -24
- package/src/surfaces/shell.json +2 -1
- package/src/surfaces/site-panel.json +1029 -0
- package/src/surfaces/site-panel.ts +233 -0
- package/src/surfaces/slash-menu.json +63 -21
- package/src/surfaces/slash-menu.ts +23 -0
- package/src/surfaces/statusbar.ts +39 -15
- package/src/surfaces/styles-panel.json +735 -0
- package/src/surfaces/styles-panel.ts +195 -0
- package/src/surfaces/styles-variables.json +149 -0
- package/src/surfaces/styles-variables.ts +145 -0
- package/src/surfaces/tab-strip.json +4 -4
- package/src/surfaces/welcome.ts +1 -1
- package/src/surfaces/writing-banner.json +94 -0
- package/src/surfaces/writing-banner.ts +80 -0
- package/src/tabs/bare-repeaters.ts +101 -0
- package/src/tabs/tab.ts +47 -7
- package/src/types.ts +21 -26
- package/src/ui/form-controls.ts +47 -8
- package/src/ui/layers.ts +13 -0
- package/src/ui/media-picker.ts +284 -40
- package/src/ui/regions.ts +7 -6
- package/src/ui/schema-form.ts +259 -27
- package/src/ui/virtual-window.ts +26 -1
- package/src/utils/base64.ts +3 -3
- package/src/utils/edit-display.ts +322 -67
- package/src/utils/local-day.ts +18 -0
- package/src/workspace/pane-derive.ts +4 -4
- package/src/workspace/session.ts +28 -7
- package/src/workspace/tab-workspace.ts +137 -0
- package/src/workspace/workspace-back.ts +189 -0
- package/src/workspace/workspace-home.ts +133 -0
- package/src/workspace/workspace-ids.ts +129 -0
- package/src/workspace/workspace-switch.ts +372 -0
- package/src/workspace/workspace.ts +125 -11
- package/styles/shell-frame.css +30 -7
- package/styles/shell-frame.json +15 -3
- package/dist/chunks/2020-f2gkpy8d.js +0 -4
- package/dist/chunks/adapter-4912g339.js +0 -4
- package/dist/chunks/cf-account-picker-wccaenh6.js +0 -4
- package/dist/chunks/cf-settings-br6105tr.js +0 -4
- package/dist/chunks/color-28ksk2qm.js +0 -4
- package/dist/chunks/components-db68vsn7.js +0 -4
- package/dist/chunks/content-source-1449qesq.js +0 -4
- package/dist/chunks/convert-to-repeater-5h457egj.js +0 -4
- package/dist/chunks/editor-x9jn86a7.js +0 -4
- package/dist/chunks/entry-commands-may24cpt.js +0 -4
- package/dist/chunks/extension-sections-pvr14vxr.js +0 -4
- package/dist/chunks/file-ops-x9v54pcj.js +0 -4
- package/dist/chunks/files-j3knqf0s.js +0 -4
- package/dist/chunks/format-host-tyre2trb.js +0 -4
- package/dist/chunks/fs-events-64ma9htc.js +0 -4
- package/dist/chunks/git-panel-84ps5dex.js +0 -4
- package/dist/chunks/iframe-entry-fvbk89gm.js +0 -5
- package/dist/chunks/iframe-host-ck6vejt5.js +0 -4
- package/dist/chunks/index-b8xw3vy9.js +0 -4
- package/dist/chunks/jsonMode-w15cmrcm.js +0 -13
- package/dist/chunks/jx-validate-at3zn8wa.js +0 -4
- package/dist/chunks/layers-h4xp1pss.js +0 -4
- package/dist/chunks/layers-panel-m5hw1d7g.js +0 -4
- package/dist/chunks/lit-html-8t8t3dnr.js +0 -4
- package/dist/chunks/media-picker-2cweexc5.js +0 -4
- package/dist/chunks/menu-ynw13y0s.js +0 -4
- package/dist/chunks/monaco-buffer-qzxn567r.js +0 -4
- package/dist/chunks/monaco-setup-gxf6656g.js +0 -4
- package/dist/chunks/notify-cj5zbrs2.js +0 -4
- package/dist/chunks/parse-b7ddhr8m.js +0 -4
- package/dist/chunks/platform-3dfws9js.js +0 -4
- package/dist/chunks/popover-jt2gxmzs.js +0 -4
- package/dist/chunks/publish-panel-1gvxbj21.js +0 -4
- package/dist/chunks/quick-search-0dajrwqg.js +0 -4
- package/dist/chunks/references-49qgt404.js +0 -4
- package/dist/chunks/right-panel-jm1bwe53.js +0 -4
- package/dist/chunks/section-registry-6kwc4fky.js +0 -4
- package/dist/chunks/studio-0rt52vpq.js +0 -5
- package/dist/chunks/studio-18vgbhs5.js +0 -5
- package/dist/chunks/studio-24mccdrj.js +0 -5
- package/dist/chunks/studio-2eh507zk.js +0 -9
- package/dist/chunks/studio-2hcbccfv.js +0 -5
- package/dist/chunks/studio-2jbs3rxv.js +0 -5
- package/dist/chunks/studio-4h8k4dw9.js +0 -5
- package/dist/chunks/studio-5f6n18kx.js +0 -5
- package/dist/chunks/studio-5gthpky6.js +0 -5
- package/dist/chunks/studio-6ep3js6b.js +0 -9
- package/dist/chunks/studio-6wkmf3wz.js +0 -9
- package/dist/chunks/studio-841rf3cg.js +0 -5
- package/dist/chunks/studio-8gmwgheg.js +0 -5
- package/dist/chunks/studio-8qm0ep50.js +0 -5
- package/dist/chunks/studio-924p1tm1.js +0 -6
- package/dist/chunks/studio-a3shpz9y.js +0 -5
- package/dist/chunks/studio-amsbaaar.js +0 -6
- package/dist/chunks/studio-at5spjbc.js +0 -7
- package/dist/chunks/studio-b2xv945e.js +0 -5
- package/dist/chunks/studio-bn5nkafw.js +0 -5
- package/dist/chunks/studio-bw6q5xjf.js +0 -9
- package/dist/chunks/studio-c7q0t9x1.js +0 -5
- package/dist/chunks/studio-camnhc96.js +0 -6
- package/dist/chunks/studio-cffqvnzd.js +0 -5
- package/dist/chunks/studio-efvfrsf8.js +0 -5
- package/dist/chunks/studio-er30bpcx.js +0 -5
- package/dist/chunks/studio-ezscgr64.js +0 -5
- package/dist/chunks/studio-ffrrncvz.js +0 -5
- package/dist/chunks/studio-fpphgn8y.js +0 -10
- package/dist/chunks/studio-j1kvhdjk.js +0 -4
- package/dist/chunks/studio-j430n16g.js +0 -7
- package/dist/chunks/studio-jjkg84nj.js +0 -5
- package/dist/chunks/studio-m0q32ars.js +0 -4
- package/dist/chunks/studio-m6bdst11.js +0 -5
- package/dist/chunks/studio-nv2cptd4.js +0 -64
- package/dist/chunks/studio-nwfrc98n.js +0 -5
- package/dist/chunks/studio-p1wgvp7r.js +0 -5
- package/dist/chunks/studio-pag2wncm.js +0 -5
- package/dist/chunks/studio-qvanvzfd.js +0 -5
- package/dist/chunks/studio-qwa64kt7.js +0 -5
- package/dist/chunks/studio-rk1zc4x3.js +0 -928
- package/dist/chunks/studio-se2r3ptc.js +0 -5
- package/dist/chunks/studio-sg2a0dh0.js +0 -5
- package/dist/chunks/studio-tjzjhe68.js +0 -5
- package/dist/chunks/studio-v2w7q8r1.js +0 -7
- package/dist/chunks/studio-v5vjq1h0.js +0 -4
- package/dist/chunks/studio-v8aga3vp.js +0 -14
- package/dist/chunks/studio-vfcdrfmv.js +0 -5
- package/dist/chunks/studio-vmfkgdjf.js +0 -5
- package/dist/chunks/studio-wt1816jj.js +0 -5
- package/dist/chunks/studio-wz73q5kq.js +0 -4
- package/dist/chunks/studio-y04qtxvp.js +0 -7
- package/dist/chunks/studio-y21g8zzg.js +0 -5
- package/dist/chunks/studio-y64hrt8p.js +0 -12
- package/dist/chunks/studio-ynn90f58.js +0 -16
- package/dist/chunks/studio-yxz682sx.js +0 -5
- package/dist/chunks/studio-zp7snvkq.js +0 -5
- package/dist/chunks/studio-zq4z6tm6.js +0 -5
- package/dist/chunks/toast-c9fn075p.js +0 -4
- package/dist/chunks/tsMode-sf49ee9x.js +0 -14
- package/dist/chunks/workspace-jtfahpee.js +0 -4
- package/src/panels/frontmatter-panel.ts +0 -711
- package/src/panels/git-panel.ts +0 -1108
- package/src/surfaces/doc-header.json +0 -776
- package/src/surfaces/doc-header.ts +0 -222
- package/src/surfaces/git-panel.json +0 -1880
- package/src/surfaces/git-panel.ts +0 -264
package/dist/iframe-entry.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{e,
|
|
2
|
-
var rr="jx:canvas";function Ho(o){let{target:a,source:c,targetOrigin:d,acceptOrigin:p,token:m}=o,h=new Set,g=(E)=>{if(p!=="*"&&E.origin!==p)return;let y=E.data;if(!n(y)||!(rr in y)||y[rr]!==m)return;let w="payload"in y?y.payload:void 0;for(let T of h)T(w)};return c.addEventListener("message",g),{dispose(){h.clear(),c.removeEventListener("message",g)},onMessage(E){return h.add(E),()=>h.delete(E)},post(E){a.postMessage({[rr]:m,payload:E},d)}}}function Pe(o){return o.getBoundingClientRect()}function Fo(o){return o.getBoundingClientRect()}function Vo(o,a,c=document){return c.elementFromPoint(o,a)}function or(o){let a=Object.create(null);for(let c of o.split(","))a[c]=1;return(c)=>(c in a)}var an=Object.assign;var il=Object.prototype.hasOwnProperty,ln=(o,a)=>il.call(o,a),lt=Array.isArray,At=(o)=>Bo(o)==="[object Map]";var Wo=(o)=>typeof o==="function",sl=(o)=>typeof o==="string",ct=(o)=>typeof o==="symbol",ut=(o)=>o!==null&&typeof o==="object";var al=Object.prototype.toString,Bo=(o)=>al.call(o),Ko=(o)=>Bo(o).slice(8,-1);var cn=(o)=>sl(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var un=(o)=>{let a=Object.create(null);return(c)=>a[c]||(a[c]=o(c))},ll=/-\w/g,af=un((o)=>o.replace(ll,(a)=>a.slice(1).toUpperCase())),cl=/\B([A-Z])/g,lf=un((o)=>o.replace(cl,"-$1").toLowerCase()),Uo=un((o)=>o.charAt(0).toUpperCase()+o.slice(1)),cf=un((o)=>o?`on${Uo(o)}`:""),je=(o,a)=>!Object.is(o,a);var ul="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var uf=or(ul+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var ye;class Yo{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&ye)if(ye.active)this.parent=ye,this.index=(ye.scopes||(ye.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,a;if(this.scopes){let c=this.scopes.slice();for(o=0,a=c.length;o<a;o++)c[o].pause()}for(o=0,a=this.effects.length;o<a;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,a;if(this.scopes){let d=this.scopes.slice();for(o=0,a=d.length;o<a;o++)d[o].resume()}let c=this.effects.slice();for(o=0,a=c.length;o<a;o++)c[o].resume()}}}run(o){if(this._active){let a=ye;try{return ye=this,o()}finally{ye=a}}}on(){if(++this._on===1)this.prevScope=ye,ye=this}off(){if(this._on>0&&--this._on===0){if(ye===this)ye=this.prevScope;else{let o=ye;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let a,c;for(a=0,c=this.effects.length;a<c;a++)this.effects[a].stop();this.effects.length=0;for(a=0,c=this.cleanups.length;a<c;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){let d=this.scopes.slice();for(a=0,c=d.length;a<c;a++)d[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let d=this.parent.scopes.pop();if(d&&d!==this)this.parent.scopes[this.index]=d,d.index=this.index}this.parent=void 0}}}function ft(o){return new Yo(o)}function mn(o,a=!1){if(ye)ye.cleanups.push(o)}var ce;var ir=new WeakSet;class pn{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ye)if(ye.active)ye.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,ir.has(this))ir.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Zo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qo(this),Qo(this);let o=ce,a=ke;ce=this,ke=!0;try{return this.fn()}finally{ei(this),ce=o,ke=a,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)hr(o);this.deps=this.depsTail=void 0,qo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)ir.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(lr(this))this.run()}get dirty(){return lr(this)}}var Xo=0,Nt,Rt;function Zo(o,a=!1){if(o.flags|=8,a){o.next=Rt,Rt=o;return}o.next=Nt,Nt=o}function pr(){Xo++}function mr(){if(--Xo>0)return;if(Rt){let a=Rt;Rt=void 0;while(a){let c=a.next;a.next=void 0,a.flags&=-9,a=c}}let o;while(Nt){let a=Nt;Nt=void 0;while(a){let c=a.next;if(a.next=void 0,a.flags&=-9,a.flags&1)try{a.trigger()}catch(d){if(!o)o=d}a=c}}if(o)throw o}function Qo(o){for(let a=o.deps;a;a=a.nextDep)a.version=-1,a.prevActiveLink=a.dep.activeLink,a.dep.activeLink=a}function ei(o){let a,c=o.depsTail,d=c;while(d){let p=d.prevDep;if(d.version===-1){if(d===c)c=p;hr(d),dl(d)}else a=d;d.dep.activeLink=d.prevActiveLink,d.prevActiveLink=void 0,d=p}o.deps=a,o.depsTail=c}function lr(o){for(let a=o.deps;a;a=a.nextDep)if(a.dep.version!==a.version||a.dep.computed&&(ti(a.dep.computed)||a.dep.version!==a.version))return!0;if(o._dirty)return!0;return!1}function ti(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===$t)return;if(o.globalVersion=$t,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!lr(o)))return;o.flags|=2;let a=o.dep,c=ce,d=ke;ce=o,ke=!0;try{Qo(o);let p=o.fn(o._value);if(a.version===0||je(p,o._value))o.flags|=128,o._value=p,a.version++}catch(p){throw a.version++,p}finally{ce=c,ke=d,ei(o),o.flags&=-3}}function hr(o,a=!1){let{dep:c,prevSub:d,nextSub:p}=o;if(d)d.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=d,o.nextSub=void 0;if(c.subs===o){if(c.subs=d,!d&&c.computed){c.computed.flags&=-5;for(let m=c.computed.deps;m;m=m.nextDep)hr(m,!0)}}if(!a&&!--c.sc&&c.map)c.map.delete(c.key)}function dl(o){let{prevDep:a,nextDep:c}=o;if(a)a.nextDep=c,o.prevDep=void 0;if(c)c.prevDep=a,o.nextDep=void 0}function be(o,a){if(o.effect instanceof pn)o=o.effect.fn;let c=new pn(o);if(a)an(c,a);try{c.run()}catch(p){throw c.stop(),p}let d=c.run.bind(c);return d.effect=c,d}var ke=!0,ni=[];function hn(){ni.push(ke),ke=!1}function gn(){let o=ni.pop();ke=o===void 0?!0:o}function xn(o,a=!1){if(ce instanceof pn)ce.cleanup=o}function qo(o){let{cleanup:a}=o;if(o.cleanup=void 0,a){let c=ce;ce=void 0;try{a()}finally{ce=c}}}var $t=0;class ri{constructor(o,a){this.sub=o,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class yn{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(o){if(!ce||!ke||ce===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==ce){if(a=this.activeLink=new ri(ce,this),!ce.deps)ce.deps=ce.depsTail=a;else a.prevDep=ce.depsTail,ce.depsTail.nextDep=a,ce.depsTail=a;oi(a)}else if(a.version===-1){if(a.version=this.version,a.nextDep){let c=a.nextDep;if(c.prevDep=a.prevDep,a.prevDep)a.prevDep.nextDep=c;if(a.prevDep=ce.depsTail,a.nextDep=void 0,ce.depsTail.nextDep=a,ce.depsTail=a,ce.deps===a)ce.deps=c}}return a}trigger(o){this.version++,$t++,this.notify(o)}notify(o){pr();try{for(let a=this.subs;a;a=a.prevSub)if(a.sub.notify())a.sub.dep.notify()}finally{mr()}}}function oi(o){if(o.dep.sc++,o.sub.flags&4){let a=o.dep.computed;if(a&&!o.dep.subs){a.flags|=20;for(let d=a.deps;d;d=d.nextDep)oi(d)}let c=o.dep.subs;if(c!==o){if(o.prevSub=c,c)c.nextSub=o}o.dep.subs=o}}var cr=new WeakMap,Qe=Symbol(""),ur=Symbol(""),Ot=Symbol("");function Ce(o,a,c){if(ke&&ce){let d=cr.get(o);if(!d)cr.set(o,d=new Map);let p=d.get(c);if(!p)d.set(c,p=new yn),p.map=d,p.key=c;p.track()}}function Ke(o,a,c,d,p,m){let h=cr.get(o);if(!h){$t++;return}let g=(E)=>{if(E)E.trigger()};if(pr(),a==="clear")h.forEach(g);else{let E=lt(o),y=E&&cn(c);if(E&&c==="length"){let w=Number(d);h.forEach((T,C)=>{if(C==="length"||C===Ot||!ct(C)&&C>=w)g(T)})}else{if(c!==void 0||h.has(void 0))g(h.get(c));if(y)g(h.get(Ot));switch(a){case"add":if(!E){if(g(h.get(Qe)),At(o))g(h.get(ur))}else if(y)g(h.get("length"));break;case"delete":if(!E){if(g(h.get(Qe)),At(o))g(h.get(ur))}break;case"set":if(At(o))g(h.get(Qe));break}}}mr()}function dt(o){let a=le(o);if(a===o)return a;if(Ce(a,"iterate",Ot),qe(o))return a;if(!Fe(o))return a.map(Le);return kt(o)?a.map((c)=>et(Le(c))):a.map(et)}function gr(o){return Ce(o=le(o),"iterate",Ot),o}function De(o,a){if(Fe(o))return kt(o)?et(Le(a)):et(a);return Le(a)}var fl={__proto__:null,[Symbol.iterator](){return sr(this,Symbol.iterator,(o)=>De(this,o))},concat(...o){return dt(this).concat(...o.map((a)=>lt(a)?dt(a):a))},entries(){return sr(this,"entries",(o)=>(o[1]=De(this,o[1]),o))},every(o,a){return He(this,"every",o,a,void 0,arguments)},filter(o,a){return He(this,"filter",o,a,(c)=>c.map((d)=>De(this,d)),arguments)},find(o,a){return He(this,"find",o,a,(c)=>De(this,c),arguments)},findIndex(o,a){return He(this,"findIndex",o,a,void 0,arguments)},findLast(o,a){return He(this,"findLast",o,a,(c)=>De(this,c),arguments)},findLastIndex(o,a){return He(this,"findLastIndex",o,a,void 0,arguments)},forEach(o,a){return He(this,"forEach",o,a,void 0,arguments)},includes(...o){return ar(this,"includes",o)},indexOf(...o){return ar(this,"indexOf",o)},join(o){return dt(this).join(o)},lastIndexOf(...o){return ar(this,"lastIndexOf",o)},map(o,a){return He(this,"map",o,a,void 0,arguments)},pop(){return Pt(this,"pop")},push(...o){return Pt(this,"push",o)},reduce(o,...a){return Go(this,"reduce",o,a)},reduceRight(o,...a){return Go(this,"reduceRight",o,a)},shift(){return Pt(this,"shift")},some(o,a){return He(this,"some",o,a,void 0,arguments)},splice(...o){return Pt(this,"splice",o)},toReversed(){return dt(this).toReversed()},toSorted(o){return dt(this).toSorted(o)},toSpliced(...o){return dt(this).toSpliced(...o)},unshift(...o){return Pt(this,"unshift",o)},values(){return sr(this,"values",(o)=>De(this,o))}};function sr(o,a,c){let d=gr(o),p=d[a],m=p.call(d);if(d!==o&&!qe(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let h=Object.create(Object.getPrototypeOf(m));if(h.next=()=>zo(m.next(),c),p!==ii[a])Object.defineProperties(h,{return:{get(){let g=m.return;return typeof g==="function"?g.bind(m):g}},throw:{get(){let g=m.throw;return typeof g==="function"?g.bind(m):g}}});return h}m._next=m.next,m.next=()=>zo(m._next(),c)}return m}function zo(o,a){if(!o.done)o.value=a(o.value);return o}var ii=Array.prototype;function He(o,a,c,d,p,m){let h=gr(o),g=h!==o&&!qe(o),E=h[a];if(E!==ii[a]){let T=E.apply(o,m);return g?Le(T):T}let y=c;if(h!==o){if(g)y=function(T,C){return c.call(this,De(o,T),C,o)};else if(c.length>2)y=function(T,C){return c.call(this,T,C,o)}}let w=E.call(h,y,d);return g&&p?p(w):w}function Go(o,a,c,d){let p=gr(o),m=p!==o&&!qe(o),h=c,g=!1;if(p!==o){if(m)g=d.length===0,h=function(y,w,T){if(g)g=!1,y=De(o,y);return c.call(this,y,De(o,w),T,o)};else if(c.length>3)h=function(y,w,T){return c.call(this,y,w,T,o)}}let E=p[a](h,...d);return g?De(o,E):E}function ar(o,a,c){let d=le(o);Ce(d,"iterate",Ot);let p=d[a](...c);if((p===-1||p===!1)&&Cl(c[0]))return c[0]=le(c[0]),d[a](...c);return p}function Pt(o,a,c=[]){hn(),pr();let d=le(o)[a].apply(o,c);return mr(),gn(),d}var pl=or("__proto__,__v_isRef,__isVue"),si=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(ct));function ml(o){if(!ct(o))o=String(o);let a=le(this);return Ce(a,"has",o),a.hasOwnProperty(o)}class xr{constructor(o=!1,a=!1){this._isReadonly=o,this._isShallow=a}get(o,a,c){if(a==="__v_skip")return o.__v_skip;let d=this._isReadonly,p=this._isShallow;if(a==="__v_isReactive")return!d;else if(a==="__v_isReadonly")return d;else if(a==="__v_isShallow")return p;else if(a==="__v_raw"){if(c===(d?p?wl:ui:p?ci:li).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(c))return o;return}let m=lt(o);if(!d){let g;if(m&&(g=fl[a]))return g;if(a==="hasOwnProperty")return ml}let h=Reflect.get(o,a,Ue(o)?o:c);if(ct(a)?si.has(a):pl(a))return h;if(!d)Ce(o,"get",a);if(p)return h;if(Ue(h)){let g=m&&cn(a)?h:h.value;return d&&ut(g)?fr(g):g}if(ut(h))return d?fr(h):bn(h);return h}}class yr extends xr{constructor(o=!1){super(!1,o)}set(o,a,c,d){let p=o[a],m=lt(o)&&cn(a);if(!this._isShallow){let E=Fe(p);if(!qe(c)&&!Fe(c))p=le(p),c=le(c);if(!m&&Ue(p)&&!Ue(c))if(E)return!0;else return p.value=c,!0}let h=m?Number(a)<o.length:ln(o,a),g=Reflect.set(o,a,c,Ue(o)?o:d);if(o===le(d)&&g){if(!h)Ke(o,"add",a,c);else if(je(c,p))Ke(o,"set",a,c,p)}return g}deleteProperty(o,a){let c=ln(o,a),d=o[a],p=Reflect.deleteProperty(o,a);if(p&&c)Ke(o,"delete",a,void 0,d);return p}has(o,a){let c=Reflect.has(o,a);if(!ct(a)||!si.has(a))Ce(o,"has",a);return c}ownKeys(o){return Ce(o,"iterate",lt(o)?"length":Qe),Reflect.ownKeys(o)}}class ai extends xr{constructor(o=!1){super(!0,o)}set(o,a){return!0}deleteProperty(o,a){return!0}}var hl=new yr,gl=new ai,xl=new yr(!0);var dr=(o)=>o,dn=(o)=>Reflect.getPrototypeOf(o);function yl(o,a,c){return function(...d){let p=this.__v_raw,m=le(p),h=At(m),g=o==="entries"||o===Symbol.iterator&&h,E=o==="keys"&&h,y=p[o](...d),w=c?dr:a?et:Le;return!a&&Ce(m,"iterate",E?ur:Qe),an(Object.create(y),{next(){let{value:T,done:C}=y.next();return C?{value:T,done:C}:{value:g?[w(T[0]),w(T[1])]:w(T),done:C}}})}}function fn(o){return function(...a){return o==="delete"?!1:o==="clear"?void 0:this}}function bl(o,a){let c={get(p){let m=this.__v_raw,h=le(m),g=le(p);if(!o){if(je(p,g))Ce(h,"get",p);Ce(h,"get",g)}let{has:E}=dn(h),y=a?dr:o?et:Le;if(E.call(h,p))return y(m.get(p));else if(E.call(h,g))return y(m.get(g));else if(m!==h)m.get(p)},get size(){let p=this.__v_raw;return!o&&Ce(le(p),"iterate",Qe),p.size},has(p){let m=this.__v_raw,h=le(m),g=le(p);if(!o){if(je(p,g))Ce(h,"has",p);Ce(h,"has",g)}return p===g?m.has(p):m.has(p)||m.has(g)},forEach(p,m){let h=this,g=h.__v_raw,E=le(g),y=a?dr:o?et:Le;return!o&&Ce(E,"iterate",Qe),g.forEach((w,T)=>p.call(m,y(w),y(T),h))}};return an(c,o?{add:fn("add"),set:fn("set"),delete:fn("delete"),clear:fn("clear")}:{add(p){let m=le(this),h=dn(m),g=le(p),E=!a&&!qe(p)&&!Fe(p)?g:p;if(!(h.has.call(m,E)||je(p,E)&&h.has.call(m,p)||je(g,E)&&h.has.call(m,g)))m.add(E),Ke(m,"add",E,E);return this},set(p,m){if(!a&&!qe(m)&&!Fe(m))m=le(m);let h=le(this),{has:g,get:E}=dn(h),y=g.call(h,p);if(!y)p=le(p),y=g.call(h,p);let w=E.call(h,p);if(h.set(p,m),!y)Ke(h,"add",p,m);else if(je(m,w))Ke(h,"set",p,m,w);return this},delete(p){let m=le(this),{has:h,get:g}=dn(m),E=h.call(m,p);if(!E)p=le(p),E=h.call(m,p);let y=g?g.call(m,p):void 0,w=m.delete(p);if(E)Ke(m,"delete",p,void 0,y);return w},clear(){let p=le(this),m=p.size!==0,h=void 0,g=p.clear();if(m)Ke(p,"clear",void 0,void 0,void 0);return g}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{c[p]=yl(p,o,a)}),c}function br(o,a){let c=bl(o,a);return(d,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return a;else if(p==="__v_raw")return d;return Reflect.get(ln(c,p)&&p in d?c:d,p,m)}}var Sl={get:br(!1,!1)},vl={get:br(!1,!0)},El={get:br(!0,!1)};var li=new WeakMap,ci=new WeakMap,ui=new WeakMap,wl=new WeakMap;function Tl(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bn(o){if(Fe(o))return o;return Sr(o,!1,hl,Sl,li)}function di(o){return Sr(o,!1,xl,vl,ci)}function fr(o){return Sr(o,!0,gl,El,ui)}function Sr(o,a,c,d,p){if(!ut(o))return o;if(o.__v_raw&&!(a&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let h=Tl(Ko(o));if(h===0)return o;let g=new Proxy(o,h===2?d:c);return p.set(o,g),g}function kt(o){if(Fe(o))return kt(o.__v_raw);return!!(o&&o.__v_isReactive)}function Fe(o){return!!(o&&o.__v_isReadonly)}function qe(o){return!!(o&&o.__v_isShallow)}function Cl(o){return o?!!o.__v_raw:!1}function le(o){let a=o&&o.__v_raw;return a?le(a):o}var Le=(o)=>ut(o)?bn(o):o,et=(o)=>ut(o)?fr(o):o;function Ue(o){return o?o.__v_isRef===!0:!1}function ze(o){return Al(o,!1)}function Al(o,a){if(Ue(o))return o;return new fi(o,a)}class fi{constructor(o,a){this.dep=new yn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?o:le(o),this._value=a?o:Le(o),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(o){let a=this._rawValue,c=this.__v_isShallow||qe(o)||Fe(o);if(o=c?o:le(o),je(o,a))this._rawValue=o,this._value=c?o:Le(o),this.dep.trigger()}}class pi{constructor(o,a,c){this.fn=o,this.setter=a,this._value=void 0,this.dep=new yn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$t-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=c}notify(){if(this.flags|=16,!(this.flags&8)&&ce!==this)return Zo(this,!0),!0}get value(){let o=this.dep.track();if(ti(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function Mt(o,a,c=!1){let d,p;if(Wo(o))d=o;else d=o.get,p=o.set;return new pi(d,p,c)}function Sn(o){return o.replaceAll(/[A-Z]/g,(a)=>`-${a.toLowerCase()}`)}var Pl=new Set(["all","print","screen","speech"]);function mi(o,a){if(o.startsWith("@--"))return a[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let c=o.slice(2,-1).trim();return Pl.has(c.toLowerCase())?c:o.slice(1)}return null}function _t(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Dt(o){return o.startsWith("@keyframes")}function hi(o,a){let c=[];for(let d of vr(o))for(let p of vr(a))c.push(Nl(d,p));return c.join(", ")}function Nl(o,a){if(a.startsWith("&"))return a.replaceAll("&",o);if(a.startsWith("[")||a.startsWith(":")||a.startsWith("."))return`${o}${a}`;return`${o} ${a}`}function vr(o){let a=[],c=0,d=null,p=0;for(let h=0;h<o.length;h+=1){let g=o[h];if(d){if(g==="\\")h+=1;else if(g===d)d=null;continue}if(g==='"'||g==="'")d=g;else if(g==="("||g==="[")c+=1;else if(g===")"||g==="]")c=Math.max(0,c-1);else if(g===","&&c===0)a.push(o.slice(p,h)),p=h+1}a.push(o.slice(p));let m=a.flatMap((h)=>{let g=h.trim();return g===""?[]:[g]});return m.length>0?m:[o]}var Rl=/[\s>+~,()]/,$l=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function Ol(o,a){let c="",d=0;for(;;){let p=o.indexOf("[open]",d);if(p===-1)return c+o.slice(d);let m=p;while(m>0&&!Rl.test(o.charAt(m-1)))m-=1;let h=$l.exec(o.slice(m,p))?.[0]?.toLowerCase(),g=h===void 0?a.dialog===!0:h==="dialog";c+=o.slice(d,p)+(g?"[data-jx-dialog-open]":"[open]"),d=p+6}}function Er(o,a={}){if(o.includes("::backdrop"))return null;let c=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return Ol(c,a)}var Ge="data-color-scheme";function vn(o){let a=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return a==="light"||a==="dark"?a:null}function gi(o,a){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ge}]))`,forced:`${o}:where([${Ge}="${a}"])`};return{auto:`:where(:root:not([${Ge}])) ${o}`,forced:`:where(:root[${Ge}="${a}"]) ${o}`}}function Lt(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function wr(o){return o.startsWith("--")?o:Sn(o)}function Jt(o){let a=2166136261;for(let c=0;c<o.length;c+=1)a^=o.charCodeAt(c),a=Math.imul(a,16777619);return(a>>>0).toString(36)}function xi(o,a,c){let d=c.map(([m,h])=>`${m}: ${h}`).join("; "),p=a===null?d:`${a} { ${d} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function kl(o,a,c){let d=c.map(({selector:m,declarations:h})=>`${m} { ${h.map(([g,E])=>`${g}: ${E}`).join("; ")} }`).join(" "),p=`@keyframes ${a} { ${d} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Ml(o){let a=Object.keys(o).filter((d)=>Dt(d));if(a.length===0)return o;let c={...o};for(let d of a)delete c[d];return c}function _l(o){let a=o.startsWith("&")?o.slice(1):o;return a===""||a.startsWith(":")||a.startsWith(".")||a.startsWith("[")}function It(o,a={}){let{scope:c=null,mediaQueries:d={},transposeValue:p=(k)=>k,transposeSelector:m=(k)=>k,resolveValue:h}=a,g=[],E=(k)=>k!==null&&typeof k==="object"&&!Array.isArray(k)&&!r(k),y=(k,L)=>{if(E(L))return[L];if(!_t(k)||!Array.isArray(L)||L.length===0)return[];return L.every((z)=>E(z))?L:[]},w=(k,L,z,G)=>{if(L===void 0||L===null)return null;if(r(L))return z?h?.(k,L,G)??null:null;if(n(L))return null;let Y=String(L);if(l(Y))return z?h?.(k,Y,G)??null:null;return p(Y)},T=(k,L,z=!0,G="self")=>{let Y=[];for(let[U,P]of Object.entries(k)){if(y(U,P).length>0)continue;if(L&&(U.startsWith("@")||Lt(U)))continue;if(U.startsWith("$"))continue;let B=w(U,P,z,G);if(B!==null)Y.push([wr(U),B])}return Y},C=(k,L,z,G,Y)=>{if(z.length===0)return;let U=L;if(U!==null){let ie=m(U);if(ie===null)return;U=ie}let P=xi(k,U,z),B={text:P,conditions:[...k],selector:U,declarations:z,target:G,key:Jt(P)};if(e(Y)&&Y!=="")B.description=Y;g.push(B)},_=(k,L,z)=>{let G=k.slice(10).trim();if(G==="")return;let Y=[];for(let[P,B]of Object.entries(L)){if(!E(B))continue;let ie=T(B,!0,!1,"unscoped");if(ie.length>0)Y.push({declarations:ie,selector:P.trim()})}if(Y.length===0)return;let U=kl(z,G,Y);g.push({blocks:Y,conditions:[...z],declarations:[],key:Jt(U),selector:null,target:"unscoped",text:U})},O=(k,L,z,G,Y)=>{if(k==="@--")return;if(_t(k)){C([...G,k],null,T(L,!1,!0,"unscoped"),"unscoped",L.$description);return}if(Dt(k)){_(k,L,G);return}let U=mi(k,d),P=U===null?k:`@media ${U}`,B=U===null?null:vn(U);if(B!==null&&z!==null){let{auto:ie,forced:V}=gi(z,B);K(L,ie,[...G,P],Y),K(Ml(L),V,G,Y);return}K(L,z,[...G,P],Y)};function K(k,L,z,G){C(z,L,T(k,!0,!0,G),G,k.$description);for(let[Y,U]of Object.entries(k))for(let P of y(Y,U))if(Y.startsWith("@"))O(Y,P,L,z,G);else if(L!==null)K(P,hi(L,Y),z,_l(Y)?G:"descendant")}return K(o,c,[],"self"),g}var Ve="en-US",yi="UTC",bi=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Si=bi.map((o)=>o.path),vi=Object.fromEntries(bi.map((o)=>[o.path,o.params.indexOf("locale")]));function Jl(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function Tr(o){if(o==="")return[];return o.split("/").map((a)=>Jl(a))}function me(o,a){let c=o;for(let d of Tr(a))c=c?.[d];return c}function Cr(o){let a=o.$map;return n(a)?a:void 0}function Dl(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function Ti(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var Ci=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Ai=new Set(["!","-"]),Pi=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Ll=new Set(["=","+=","-=","*=","/="]),Il=new Set(["push","pop","shift","unshift","splice"]),Ni=new Set(["reduce","map","filter"]),Ri=new Set(["?:","switch"]),$i=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),jl=new Set([...Ci,...Ai,...Pi,...Ni,...Ri,...$i,"call"]),Hl=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Si]),Fl=new Map([["Intl/compare",(o,a,c,d)=>new Intl.Collator(c??Ve,d).compare(o,a)],["Intl/displayName",(o,a,c,d)=>new Intl.DisplayNames(c??Ve,{...d,type:a??"language"}).of(o)],["Intl/formatDate",(o,a,c)=>new Intl.DateTimeFormat(a??Ve,{timeZone:yi,...c}).format(new Date(o))],["Intl/formatList",(o,a,c)=>new Intl.ListFormat(a??Ve,c).format(o)],["Intl/formatNumber",(o,a,c)=>new Intl.NumberFormat(a??Ve,c).format(o)],["Intl/formatRelativeTime",(o,a,c,d)=>new Intl.RelativeTimeFormat(c??Ve,d).format(o,a)],["Intl/plural",(o,a,c)=>new Intl.PluralRules(a??Ve,c).select(o)],["Intl/segment",(o,a,c)=>[...new Intl.Segmenter(c??Ve,{granularity:a??"grapheme"}).segment(o)].map((d)=>d.segment)]]);function Vl(o,a,c){let d=vi[o];if(d===void 0||d<0||a[d]!=null)return a;let p=me(c.$page,"locale");if(!e(p)||p==="")return a;let m=[...a];return m[d]=p,m}function Wl(o){return o.startsWith("window#/")&&Hl.has(o.slice(8))}function Oi(o){return Ci.has(o)}var Ei=64,Bl=64;function fe(o,a){if(!o)return;let c=(o.depth??0)+1;if(c>Bl)return;return{depth:c,path:[...o.path??[],...Array.isArray(a)?a:[a]],report:o.report}}function de(o,a,c,d,p){if(o===null||o===void 0)return o;if(Dl(o))return Ae(o,a,c,d,p);if(Ti(o)){let m=En(o.$ref,a,c,d);return p?.report(p.path??[],m),m}if(Array.isArray(o))return ki(o,a,c,d,p);return p?.report(p.path??[],o),o}function ki(o,a,c,d,p){return o.map((m,h)=>de(m,a,c,d,fe(p,h)))}function Kl(o,a,c,d){let p=(m)=>{if(!o.slice(m.length).includes("/"))return a;return En(o.slice(0,o.lastIndexOf("/")),a,c,d)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?En(o.slice(0,o.lastIndexOf("/")),a,c,d):void 0;return}function En(o,a,c,d){if(o==="$reduce/acc")return d?.acc;if(o.startsWith("$reduce/"))return d?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=d?.args?.[p[0]];return p.length>1?me(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return me(c,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,h,g=Cr(a);if(m==="item")h=d?.item??g?.item??a["$map/item"];else if(m==="index")h=d?.index??g?.index??a["$map/index"];else h=g?.[m]??a[`$map/${m}`];return p.length>2?me(h,p.slice(2).join("/")):h}if(o.startsWith("#/state/"))return me(a,o.slice(8));if(o.startsWith("parent#/"))return me(a,o.slice(8));if(o.startsWith("window#/"))return me(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return me(globalThis.document,o.slice(10));return me(a,o)??null}function Ul(o,a,c,d){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,h,g=Cr(a);if(m==="item")h=d?.item??g?.item??a["$map/item"];else if(m==="index")h=d?.index??g?.index??a["$map/index"];else h=g?.[m]??a[`$map/${m}`];if(p.length>2){let E=p.slice(2),y=E.pop(),w=E.length>0?me(h,E.join("/")):h;return{key:y,obj:w}}return{key:m==="item"?"$map/item":"$map/index",obj:Cr(a)??a}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:a};let h=Tr(p),g=h.pop(),E=a;for(let y of h)E=E[y];return{key:g,obj:E}}return{key:o,obj:a}}function Ae(o,a,c,d,p){let m=ql(o,a,c,d,p);return p?.report(p.path??[],m),m}function wi(o,a,c){switch(o){case"+":return a+c;case"-":return a-c;case"*":return a*c;case"/":return a/c;case"%":return a%c;case"<":return a<c;case"<=":return a<=c;case">":return a>c;default:return a>=c}}function ql(o,a,c,d,p){let{operator:m,target:h,value:g,initial:E}=o;if(!jl.has(m))throw Error(`$expression: unknown operator "${m}"`);if(Ai.has(m)&&!("value"in o)){let y=de(h,a,c,d,fe(p,"target"));if(m==="!")return!y;if(m==="-")return-y}if(m==="call"){let y=Ti(h)?h.$ref:void 0;if(!e(y))throw TypeError("$expression: call target must be a $ref pointer");let w=(d?.callDepth??0)+1;if(w>Ei)throw Error(`$expression: call depth exceeded (${Ei})`);let T=Array.isArray(g)?g.map((_,O)=>de(_,a,c,d,fe(p,["value",O]))):[];if(y.startsWith("window#/")){if(!Wl(y))throw Error(`$expression: "${y}" is not a blessed pure global`);let _=y.slice(8),O=Fl.get(_);if(O)return O(...Vl(_,T,a));let K=me(globalThis.window,_),k=_.lastIndexOf("/"),L=k===-1?globalThis.window:me(globalThis.window,_.slice(0,k));return K.apply(L,T)}let C=En(y,a,c,d);if(t(C))return C.apply(Kl(y,a,c,d),T);if(n(C)&&"$expression"in C){let _=C,O={};for(let[K,k]of(_.parameters??[]).entries()){let L=e(k)?k:k?.name??"";if(!L)continue;O[L]=T[K]===void 0&&n(k)&&"default"in k?k.default:T[K]}return Ae(_.$expression,a,c,{args:O,callDepth:w})}throw TypeError(`$expression: call target "${y}" is not callable`)}if(Ri.has(m)){if(m==="?:"){let _=de(h,a,c,d,fe(p,"target"));if(p){let O=de(g,a,c,d,fe(p,"value")),K=de(E,a,c,d,fe(p,"initial"));return _?O:K}return _?de(g,a,c,d):de(E,a,c,d)}let y=de(h,a,c,d,fe(p,"target")),w=String(y),T=o.cases??{},C=Object.hasOwn(T,w);if(p){let _;for(let[K,k]of Object.entries(T)){let L=de(k,a,c,d,fe(p,["cases",K]));if(K===w)_=L}let O=de(o.default,a,c,d,fe(p,"default"));return C?_:O}return C?de(T[w],a,c,d):de(o.default,a,c,d)}if(Pi.has(m)){let y=de(h,a,c,d,fe(p,"target")),w=de(g,a,c,d,fe(p,"value"));switch(m){case"===":return y===w;case"!==":return y!==w;case"&&":return y&&w;case"||":return y||w;case"??":return y??w;default:return wi(m,y,w)}}if(Ll.has(m)){let y=de(g,a,c,d,fe(p,"value")),{obj:w,key:T}=Ul(h.$ref,a,c,d);w[T]=m==="="?y:wi(m.slice(0,-1),w[T],y);return}if(Il.has(m)){let y=de(h,a,c,d,fe(p,"target"));switch(m){case"push":return y.push(de(g,a,c,d,fe(p,"value")));case"unshift":return y.unshift(de(g,a,c,d,fe(p,"value")));case"pop":return y.pop();case"shift":return y.shift();case"splice":{let w=de(g,a,c,d,fe(p,"value"));return y.splice(...w)}default:break}}if($i.has(m)){let y=de(h,a,c,d,fe(p,"target")),w=g===void 0?[]:Array.isArray(g)?ki(g,a,c,d,fe(p,"value")):[de(g,a,c,d,fe(p,"value"))],T=me(y,m);if(!t(T))return;return T.apply(y,w)}if(Ni.has(m)){let y=de(h,a,c,d,fe(p,"target")),w=g;if(m==="reduce"){let T=de(E,a,c,d,fe(p,"initial"));for(let[C,_]of y.entries())T=Ae(w,a,c,{acc:T,index:C,item:_},C===0?fe(p,"value"):void 0);return T}if(m==="map")return y.map((T,C)=>Ae(w,a,c,{...d,index:C,item:T},C===0?fe(p,"value"):void 0));if(m==="filter")return y.filter((T,C)=>Ae(w,a,c,{...d,index:C,item:T},C===0?fe(p,"value"):void 0))}return}function tt(o,a,c,d){return de(o,a,c,d)}function wn(o){let a=o.replaceAll("\\","/");return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function Mi(o){let a=wn(o);return a.startsWith("/")?a:`/${a}`}function _i(o,a){return[...o].toSorted((c,d)=>d[a].length-c[a].length)}function zl(o,a){return o===a||o.startsWith(`${a}/`)}function Ji(o,a){let c=wn(a);for(let d of _i(o,"dir")){let p=wn(d.dir);if(!zl(c,p)||c===p)continue;let m=c.slice(p.length+1),{filter:h}=d;if(h&&!h(m))return null;let g=m.split("/").map((E)=>encodeURIComponent(E)).join("/");return`${Mi(d.urlPrefix)}/${g}`}return null}function Gl(o,a){let c=a.split("#")[0].split("?")[0];if(!c.startsWith("/"))return null;let d;try{d=decodeURIComponent(c)}catch{return null}if(/%2e|%2f/i.test(d))return null;for(let p of _i(o,"urlPrefix")){let m=Mi(p.urlPrefix);if(!d.startsWith(`${m}/`))continue;let g=d.slice(m.length+1).split("/");if(g.some((y)=>y===""||y==="."||y===".."))return null;let{filter:E}=p;if(E&&!E(g.join("/")))return null;return`${wn(p.dir)}/${g.join("/")}`}return null}var $f=String.raw`"'\s<>()\\`;var Yl="public";function jt(o){let a=o.search(/[#?]/);return a===-1?{path:o,suffix:""}:{path:o.slice(0,a),suffix:o.slice(a)}}function Ar(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function Pr(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function Nr(o,a){let d=(o===""||o==="."?[]:Pr(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of a.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.join("/")}function Xl(o,a,c){let{path:d}=jt(o);if(!d.startsWith("/"))return[];let p;try{p=decodeURIComponent(d)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((g)=>g==="."||g===".."))return[];let h=[];for(let g of c){if(g==="mounts"){let E=Gl(a,d);if(E!==null&&!E.startsWith("/")&&!/^[A-Za-z]:/.test(E))h.push(Pr(E));continue}h.push(g==="root"?m:`${Yl}/${m}`)}return[...new Set(h)]}function Di(o,a,c,d){let{path:p}=jt(o);if(p==="")return null;if(Ar(o))return p.startsWith("/")?Xl(p,c,d)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let h=Nr(a,m);if(h===null||h===""||h===Pr(a))return null;return h}function Li(o){return o.split("/").map((a)=>encodeURIComponent(a)).join("/")}function Ii(o){let a=[],c=0;while(c<o.length){while(c<o.length&&(/\s/.test(o[c])||o[c]===","))c+=1;if(c>=o.length)break;let d=c;while(c<o.length&&!/\s/.test(o[c]))c+=1;let p=o.slice(d,c);if(p.endsWith(",")){a.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(c<o.length&&/\s/.test(o[c]))c+=1;let m=c;while(c<o.length&&o[c]!==",")c+=1;let h=o.slice(m,c).trim();if(c+=1,p=p.replace(/,+$/,""),p!=="")a.push({descriptor:h,url:p})}return a}function ji(o){return o.map(({url:a,descriptor:c})=>c?`${a} ${c}`:a).join(", ")}function Zl(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function Ql(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function pt(o,a,c,d={}){let p=d.args?{args:d.args}:void 0;for(let m of o){let h=Zl(m);switch(h.kind){case"expression":{let g=Ae(h.node,a,c,p);if(Ql(g))await g;break}case"if":{let g=h.node,E=tt(g.if,a,c,p)?g.then:g.else;if(Array.isArray(E))await pt(E,a,c,d);break}case"switch":{let g=h.node,E=String(tt(g.$switch,a,c,p)),y=g.cases??{},w=Object.hasOwn(y,E)?y[E]:g.default;if(Array.isArray(w))await pt(w,a,c,d);break}case"dispatch":{let g=h.node,E=t(d.target)?d.target():d.target,y=c?.currentTarget??E;if(!y)break;let w={};if("detail"in g)w.detail=tt(g.detail,a,c,p);if(g.bubbles!==void 0)w.bubbles=g.bubbles;if(g.composed!==void 0)w.composed=g.composed;y.dispatchEvent(new CustomEvent(g.dispatchEvent,w));break}case"stopPropagation":{c?.stopPropagation();break}case"preventDefault":{c?.preventDefault();break}default:break}}}function Hi(o,a){for(let c of o.split(";")){let d=c.indexOf("=");if(d===-1)continue;if(c.slice(0,d).trim()===a)return c.slice(d+1)}return null}function Fi(o,a,c){let d=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(a))}`];if(c.maxAge!==void 0)p.push(`Max-Age=${c.maxAge}`);let m=d?"/":c.path;if(m)p.push(`Path=${m}`);if(c.domain&&!d)p.push(`Domain=${c.domain}`);let{sameSite:h}=c;if(c.secure===!0||d||o.startsWith("__Secure-")||h?.toLowerCase()==="none")p.push("Secure");if(h)p.push(`SameSite=${h}`);return p.join("; ")}function Rr(o){return t(o)}var $r=new Map;function ec(o){return o.headers?.get("Content-Type")??""}async function Dr(o,a){if(!e(o))return o;let c=a?.resolver?.(o);if(c)return c;if($r.has(o))return $r.get(o);let d=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);if(ec(p).includes("text/html"))throw Error(`Jx: ${o} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await p.json()});return $r.set(o,d),d}var tc=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),es={skip:!1};function ts(o){es.skip=o}var ns={skip:!1};function rs(o){ns.skip=o}var Or=null;function os(o){Or=o||null}function is(o){return Or?`${o}?token=${encodeURIComponent(Or)}`:o}function ss(o){let a=ft(!0);return a.run(()=>{be(o)}),()=>a.stop()}function kn(o){let a=ft(!0);try{return{result:a.run(o),stop:()=>a.stop()}}catch(c){throw a.stop(),c}}var as=!1;function ls(o){as=o}var nc=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,rc=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function oc(o){if(!as||!o.includes("v"))return o;return o.replace(nc,(a,c,d)=>`${c}${rc.get(d.toLowerCase())??`cq${d}`}`)}var cs=!1;function us(o){cs=o}var Lr=!1;function ds(o){Lr=o}var Ir=!1;function fs(o){Ir=o}var Cn=!1;function kr(o){return Cn||o.dataset.jxPath!==void 0}function ic(o,a){if(cs&&a==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(Lr&&a==="popover"&&kr(o))return"data-jx-popover";if(Ir&&kr(o)){if(a==="commandfor")return"data-jx-commandfor";if(a==="inert")return"data-jx-inert";if(a==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return a}var ht=null;function Mn(o){ht=o}var sc=new Set(["src","poster","data"]),ac=new Set(["srcset","imagesrcset"]),lc=new Set(["LINK"]);function cc(o,a){return sc.has(a)||a==="href"&&lc.has(o)}function jr(o,a,c){if(!ht||c==="")return c;let d=a.toLowerCase();if(ac.has(d)){let p=Ii(c),m=p.map((g)=>{let E=ht?.(g.url,d)??null;if(E===null||E===g.url)return g;return{descriptor:g.descriptor,url:E}});return m.some((g,E)=>g!==p[E])?ji(m):c}if(!cc(o,d))return c;return ht(c,d)??c}var uc=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function dc(o){if(!ht||!o.includes("url("))return o;return o.replaceAll(uc,(a,c,d)=>{let p=d===""?null:ht?.(d,"url()")??null;return p===null?a:`url(${c}${p}${c})`})}function An(o){return oc(dc(o))}var ps=!1;function ms(o){ps=o}var fc=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function pc(o,a,c){if(!ps||o!=="textContent")return null;let d=null;if(r(a)){if(!a.$ref.startsWith("#/state/"))return null;let m=a.$ref.slice(8);d=m&&!m.includes("/")?m:null}else if(e(a))d=fc.exec(a)?.[1]??null;if(!d)return null;let p=le(c)[d];if(Ue(p)||t(p))return null;if(n(p))return null;return d}async function _n(o,a={},c=location.href,d){let p=()=>d?.root??null,m={},h=o.state??{},g=kt(a);for(let T of Object.keys(a))if(g&&!(T in h))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>a[T],set:(C)=>{a[T]=C}});else m[T]=a[T];let E=o.imports??{};for(let[,T]of Object.entries(h))if(R(T)&&!T.$src){let C=E[T.$prototype];if(C){if(!C.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${C}"`);continue}T.$src=C}}for(let[T,C]of Object.entries(h)){if(e(C)){if(!C.includes("${"))m[T]=C;continue}if(s(C)||x(C)||C===null){m[T]=C;continue}if(Array.isArray(C)){m[T]=C;continue}if(n(C)){if(C.$prototype)continue;if(b(C))continue;if(D(C))continue;if("default"in C){m[T]=C.default;continue}if(mc(C))continue;m[T]=C}}let y=bn(m);for(let[T,C]of Object.entries(h))if(e(C)&&C.includes("${"))y[T]=Mt(()=>We(C,y));for(let[T,C]of Object.entries(h))if(b(C)){let _=C.$expression;if(j(C)){let O=C.parameters;y[T]=(...K)=>Ae(_,y,null,{args:Vi(O,K)})}else if(Oi(_.operator)){let O=(K,k)=>Ae(_,K,k);y[T]=O}else y[T]=Mt(()=>Ae(_,y,null))}for(let[T,C]of Object.entries(h))if(N(C)){let{body:_}=C;if(Array.isArray(C.parameters)&&C.parameters.length>0){let O=C.parameters;y[T]=(...K)=>pt(_,y,null,{args:Vi(O,K),target:p})}else{let O=(K,k)=>{pt(_,K,k??null,{target:p})};y[T]=O}}else if(v(C))y[T]=await xc(C,y,T,c);for(let[T,C]of Object.entries(h))if(R(C))y[T]=await Oc(C,y,T,c,d);if(!(d?.skipServerFunctions??es.skip)){for(let[T,C]of Object.entries(h))if(D(C))y[T]=await Ic(C,y,T,c)}let w=d?.media??As;if(o.$media)y.$media=o.$media;else if(!y.$media&&Object.keys(w).length>0)y.$media=w;return y}function Vi(o,a){let c={};for(let[d,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;c[m]=a[d]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:a[d]}return c}function mc(o){for(let a of Object.keys(o))if(tc.has(a))return!0;return!1}function We(o,a){let c=hs(a);return Function("state","$map","item","index",`return \`${o}\``)(a,c,c?.item,c?.index)}function hs(o){return o.$map}function hc(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let a=0;for(let c=1;c<o.length;c+=1){let d=o[c];if(d==="{")a+=1;else if(d==="}"){if(a-=1,a===0)return c===o.length-1}}return!1}function gc(o,a){if(!hc(o))return We(o,a);let c=hs(a);return Function("state","$map","item","index",`return (${o.slice(2,-1)})`)(a,c,c?.item,c?.index)}function Ht(o){return import(o)}var xt=new Map,mt=new Map,gs=new Set;function xs(o,a){if(gs.add(o),t(a)){xt.delete(o),mt.set(o,a);return}mt.delete(o),xt.set(o,a)}function Hr(o){let a=xt.get(o);if(a)return a;let c=mt.get(o);if(!c)return;if(!t(c))return c;let d=c(),p=(async()=>{try{let m=await d;return xt.set(o,m),mt.delete(o),m}catch(m){throw mt.set(o,c),m}})();return mt.set(o,p),p}async function xc(o,a,c,d){if(o.body&&o.$src)throw Error(`Jx: '${c}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let g=Mr(o),E=Function(...g,"");return Object.defineProperty(E,"name",{configurable:!0,value:o.name??c}),E}let p;if(e(o.body)){let g=Mr(o);p=Function(...g,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??c})}else{let g=o.$src;if(!g)throw Error(`Jx: '${c}' has neither body nor $src`);let E=o.$export??c,y,w=Hr(g);if(w instanceof Promise)y=await w;else if(w)y=w;else{if(d){let C=new URL(g,d).href;try{y=await Ht(C)}catch{y=await Ht(g)}}else y=await Ht(g);xt.set(g,y)}let T=y[E]??y.default?.[E];if(!t(T))throw TypeError(`Jx: export "${E}" not found or not a function in "${g}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,h=!1;if(!m)h=e(o.body)?I(o.body):p.length<=1&&I(p.toString());if(h)return Mt(()=>p(a));return p}function Mr(o){let a=o.parameters?W(o.parameters):o.arguments??[];return a.length>0&&a[0]==="state"?a:["state",...a]}var Wt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]);function Fr(o){return Object.create(o)}function Jn(o){return o.$media??{}}function Vr(o){return o}function yc(o){return t(o)}var Wi=new Set,bc="http://www.w3.org/2000/svg",Sc="http://www.w3.org/1998/Math/MathML";function vc(o,a){if(o==="svg")return bc;if(o==="math")return Sc;return a??null}function Me(o,a,c){let d=c?._path??[];if(e(o)||s(o)||x(o)){let T=document.createTextNode(String(o));if(l(o))be(()=>{T.textContent=We(o,a)});return T}let p=a;for(let[T,C]of Object.entries(o))if(T.startsWith("$")&&!Wt.has(T)){if(p===a)p=Fr(a);p[T]=r(C)?Se(C.$ref,a):C}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!Wi.has(T))Wi.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=Kr(o.tagName,p),h=m.includes("-")&&customElements.get(m);if(o.$props&&h)return Qi(o,p,c,d);if(o.$props){if(m.includes("-"))return Qi(o,p,c,d);let{$props:T,...C}=o;return Me(C,Wc(o,p),c)}if(o.$switch)return $c(o,p,c);let g=vc(m,c?._ns),E=m==="foreignObject"?null:g,y=g?document.createElementNS(g,m):document.createElement(m);if(c?.onNodeCreated)c.onNodeCreated(y,d,o,p);if(Wr(y,o,p),o.style&&m.includes("-"))Br.set(y,o.style);Dn(y,o.style??{},Jn(p),p),In(y,o.attributes??{},p);let w=o.children;if(S(w)){let T=c||E?{...c,_ns:E,_path:[...d,"children"]}:void 0;_r(y,w,p,T)}else if(Array.isArray(w))for(let T=0;T<w.length;T++){let C=w[T],_=c||E?{...c,_ns:E,_path:[...d,"children",T]}:void 0;if(S(C))_r(y,C,p,_);else y.append(Me(C,p,_))}return y}function Wr(o,a,c){for(let[d,p]of Object.entries(a)){if(Wt.has(d))continue;if(d.startsWith("$"))continue;if(d.startsWith("on")&&ys(o,d,p,c))continue;bs(o,d,p,c)}}function ys(o,a,c,d){let p=a.slice(2),m=d;if(r(c)){let h=Se(c.$ref,d);if(yc(h))o.addEventListener(p,(g)=>h(m,g));return!0}if(N(c)){let{body:h}=c;return o.addEventListener(p,(g)=>{pt(h,m,g)}),!0}if(v(c)&&e(c.body)){let h=Mr(c),g=Function(...h,c.body);return o.addEventListener(p,(E)=>g(m,E)),!0}if(b(c)){let h=c.$expression;return o.addEventListener(p,(g)=>Ae(h,m,g)),!0}return!1}function Ec(o,a,c){for(let[d,p]of Object.entries(a))if(d.startsWith("on")&&!Wt.has(d))ys(o,d,p,c)}function bs(o,a,c,d){let p=Vr(o),m=pc(a,c,d);if(m)o.dataset.jxBoundProp=m;let h=(E)=>e(E)?jr(o.tagName,a,E):E,g=(E)=>{let y=o;if(a==="className"&&!(y instanceof HTMLElement)){y.setAttribute("class",E==null?"":String(E));return}if(p[a]===E)return;p[a]=E};if(r(c)){let E=c;if(a==="id"){p[a]=Se(E.$ref,d);return}be(()=>{g(h(Se(E.$ref,d)))});return}if(l(c)){let E=c;be(()=>{g(h(We(E,d)))});return}g(h(c))}function Bi(o,a){let c=[];return{detach:a,insert(d){let p=[];for(let h of d){let g=o.cssRules.length;try{o.insertRule(h,g)}catch{continue}let E=o.cssRules[g];if(E)p.push(E)}let m={rules:p,texts:d};return c.push(m),m},remove(d){let p=c.indexOf(d);if(p!==-1)c.splice(p,1);if(d.rules.length===0)return;let m=[...o.cssRules],h=d.rules.map((g)=>m.indexOf(g)).filter((g)=>g>=0).toSorted((g,E)=>E-g);for(let g of h)o.deleteRule(g);d.rules.length=0},replaceAll(d){c.length=0,c.push({rules:[],texts:d}),o.replaceSync(d.join(`
|
|
3
|
-
`))},text(){return
|
|
1
|
+
import{e,i,x,t,n,s,r,v,b,j,O,R,D,S,l,c,I,F,Z,W,J,u,w}from"./chunks/iframe-entry-99nr5zfb.js";var Ko,cr,fn,me=(o,a)=>{for(var[d,f,p]of Ko||[])for(var m=[o],g=globalThis,h=g.document,y,E,C,T,A;E=m.pop();)if(!cr[E]&&(C=f[E])){cr[E]=1;for(T=1;T<C.length;T++)m.push(p[C[T]]);if(!a&&E!==o&&(y=h&&h.head)){if(fn===void 0)fn=(T=h.querySelector("meta[property=csp-nonce]"))&&(T.nonce||T.getAttribute("nonce"))||"";if(A=h.createElement("link"),A.rel="modulepreload",A.crossOrigin="",fn)A.nonce=fn;A.href=new g.URL(C[0],d),y.appendChild(A)}}},Vl=(o,a,d,f)=>{for(var p={},m=0;m<a.length;m++)p[a[m]]=d[m];(Ko||=[]).push([o,p,a]),cr||={},me(a[f],1)};Vl(import.meta.url,["djjkmvtm","9xa4hm7n","yypz28gq","wewc8rq2","1gv0h53h","1yg5ar8d","m7r1vk54","63bjtbs7","y62xq0ty","4aan7g6g","b89sfej7","rzds841e","c9zfdgxf","ewh24n1f","f5cw3tgp","44cm5cta","6rbra5dy","gy56c94g","sqqdyf6c","72h32ejk","c4x05vyx","c421cf8c","bdpzbfvs","99nr5zfb","76j8vwwx","pkgmcgp0","2zggzajv"],[["./iframe-entry.js",23],["./chunks/tree-9xa4hm7n.js",23],["./chunks/tooltip-yypz28gq.js",24,23],["./chunks/textfield-wewc8rq2.js"],["./chunks/toast-1gv0h53h.js",25],["./chunks/toast-host-1yg5ar8d.js",25],["./chunks/color-m7r1vk54.js",26],["./chunks/icons-63bjtbs7.js",23],["./chunks/number-field-y62xq0ty.js"],["./chunks/action-group-4aan7g6g.js"],["./chunks/popover-b89sfej7.js",24],["./chunks/select-rzds841e.js"],["./chunks/split-c9zfdgxf.js",23],["./chunks/swatch-group-ewh24n1f.js"],["./chunks/tabs-f5cw3tgp.js"],["./chunks/toolbar-44cm5cta.js"],["./chunks/color-area-6rbra5dy.js",26,23],["./chunks/color-field-gy56c94g.js",26,24,23],["./chunks/color-slider-sqqdyf6c.js",26],["./chunks/combobox-72h32ejk.js",24],["./chunks/dialog-c4x05vyx.js"],["./chunks/listbox-c421cf8c.js",23],["./chunks/menu-bdpzbfvs.js",24,23],["./chunks/iframe-entry-99nr5zfb.js"],["./chunks/iframe-entry-76j8vwwx.js",23],["./chunks/iframe-entry-pkgmcgp0.js"],["./chunks/iframe-entry-2zggzajv.js",23]],0);
|
|
2
|
+
var ur="jx:canvas";function Uo(o){let{target:a,source:d,targetOrigin:f,acceptOrigin:p,token:m}=o,g=new Set,h=(y)=>{if(p!=="*"&&y.origin!==p)return;let E=y.data;if(!n(E)||!(ur in E)||E[ur]!==m)return;let C="payload"in E?E.payload:void 0;for(let T of g)T(C)};return d.addEventListener("message",h),{dispose(){g.clear(),d.removeEventListener("message",h)},onMessage(y){return g.add(y),()=>g.delete(y)},post(y){a.postMessage({[ur]:m,payload:y},f)}}}function Pe(o){return o.getBoundingClientRect()}function qo(o){return o.getBoundingClientRect()}function zo(o,a,d=document){return d.elementFromPoint(o,a)}function dr(o){let a=Object.create(null);for(let d of o.split(","))a[d]=1;return(d)=>(d in a)}var pn=Object.assign;var Wl=Object.prototype.hasOwnProperty,mn=(o,a)=>Wl.call(o,a),ct=Array.isArray,$t=(o)=>Yo(o)==="[object Map]";var Go=(o)=>typeof o==="function",Bl=(o)=>typeof o==="string",ut=(o)=>typeof o==="symbol",dt=(o)=>o!==null&&typeof o==="object";var Kl=Object.prototype.toString,Yo=(o)=>Kl.call(o),Xo=(o)=>Yo(o).slice(8,-1);var hn=(o)=>Bl(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var gn=(o)=>{let a=Object.create(null);return(d)=>a[d]||(a[d]=o(d))},Ul=/-\w/g,op=gn((o)=>o.replace(Ul,(a)=>a.slice(1).toUpperCase())),ql=/\B([A-Z])/g,ip=gn((o)=>o.replace(ql,"-$1").toLowerCase()),Zo=gn((o)=>o.charAt(0).toUpperCase()+o.slice(1)),sp=gn((o)=>o?`on${Zo(o)}`:""),Ie=(o,a)=>!Object.is(o,a);var zl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var ap=dr(zl+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var be;class ni{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&be)if(be.active)this.parent=be,this.index=(be.scopes||(be.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,a;if(this.scopes){let d=this.scopes.slice();for(o=0,a=d.length;o<a;o++)d[o].pause()}for(o=0,a=this.effects.length;o<a;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,a;if(this.scopes){let f=this.scopes.slice();for(o=0,a=f.length;o<a;o++)f[o].resume()}let d=this.effects.slice();for(o=0,a=d.length;o<a;o++)d[o].resume()}}}run(o){if(this._active){let a=be;try{return be=this,o()}finally{be=a}}}on(){if(++this._on===1)this.prevScope=be,be=this}off(){if(this._on>0&&--this._on===0){if(be===this)be=this.prevScope;else{let o=be;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let a,d;for(a=0,d=this.effects.length;a<d;a++)this.effects[a].stop();this.effects.length=0;for(a=0,d=this.cleanups.length;a<d;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){let f=this.scopes.slice();for(a=0,d=f.length;a<d;a++)f[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let f=this.parent.scopes.pop();if(f&&f!==this)this.parent.scopes[this.index]=f,f.index=this.index}this.parent=void 0}}}function pt(o){return new ni(o)}function Sn(o,a=!1){if(be)be.cleanups.push(o)}var ue;var fr=new WeakSet;class bn{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,be)if(be.active)be.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,fr.has(this))fr.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))oi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Qo(this),ii(this);let o=ue,a=$e;ue=this,$e=!0;try{return this.fn()}finally{si(this),ue=o,$e=a,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)Er(o);this.deps=this.depsTail=void 0,Qo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)fr.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(hr(this))this.run()}get dirty(){return hr(this)}}var ri=0,kt,Mt;function oi(o,a=!1){if(o.flags|=8,a){o.next=Mt,Mt=o;return}o.next=kt,kt=o}function Sr(){ri++}function vr(){if(--ri>0)return;if(Mt){let a=Mt;Mt=void 0;while(a){let d=a.next;a.next=void 0,a.flags&=-9,a=d}}let o;while(kt){let a=kt;kt=void 0;while(a){let d=a.next;if(a.next=void 0,a.flags&=-9,a.flags&1)try{a.trigger()}catch(f){if(!o)o=f}a=d}}if(o)throw o}function ii(o){for(let a=o.deps;a;a=a.nextDep)a.version=-1,a.prevActiveLink=a.dep.activeLink,a.dep.activeLink=a}function si(o){let a,d=o.depsTail,f=d;while(f){let p=f.prevDep;if(f.version===-1){if(f===d)d=p;Er(f),Gl(f)}else a=f;f.dep.activeLink=f.prevActiveLink,f.prevActiveLink=void 0,f=p}o.deps=a,o.depsTail=d}function hr(o){for(let a=o.deps;a;a=a.nextDep)if(a.dep.version!==a.version||a.dep.computed&&(ai(a.dep.computed)||a.dep.version!==a.version))return!0;if(o._dirty)return!0;return!1}function ai(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===_t)return;if(o.globalVersion=_t,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!hr(o)))return;o.flags|=2;let a=o.dep,d=ue,f=$e;ue=o,$e=!0;try{ii(o);let p=o.fn(o._value);if(a.version===0||Ie(p,o._value))o.flags|=128,o._value=p,a.version++}catch(p){throw a.version++,p}finally{ue=d,$e=f,si(o),o.flags&=-3}}function Er(o,a=!1){let{dep:d,prevSub:f,nextSub:p}=o;if(f)f.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=f,o.nextSub=void 0;if(d.subs===o){if(d.subs=f,!f&&d.computed){d.computed.flags&=-5;for(let m=d.computed.deps;m;m=m.nextDep)Er(m,!0)}}if(!a&&!--d.sc&&d.map)d.map.delete(d.key)}function Gl(o){let{prevDep:a,nextDep:d}=o;if(a)a.nextDep=d,o.prevDep=void 0;if(d)d.prevDep=a,o.nextDep=void 0}function we(o,a){if(o.effect instanceof bn)o=o.effect.fn;let d=new bn(o);if(a)pn(d,a);try{d.run()}catch(p){throw d.stop(),p}let f=d.run.bind(d);return f.effect=d,f}var $e=!0,li=[];function Dt(){li.push($e),$e=!1}function Lt(){let o=li.pop();$e=o===void 0?!0:o}function vn(o,a=!1){if(ue instanceof bn)ue.cleanup=o}function Qo(o){let{cleanup:a}=o;if(o.cleanup=void 0,a){let d=ue;ue=void 0;try{a()}finally{ue=d}}}var _t=0;class ci{constructor(o,a){this.sub=o,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class En{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(o){if(!ue||!$e||ue===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==ue){if(a=this.activeLink=new ci(ue,this),!ue.deps)ue.deps=ue.depsTail=a;else a.prevDep=ue.depsTail,ue.depsTail.nextDep=a,ue.depsTail=a;ui(a)}else if(a.version===-1){if(a.version=this.version,a.nextDep){let d=a.nextDep;if(d.prevDep=a.prevDep,a.prevDep)a.prevDep.nextDep=d;if(a.prevDep=ue.depsTail,a.nextDep=void 0,ue.depsTail.nextDep=a,ue.depsTail=a,ue.deps===a)ue.deps=d}}return a}trigger(o){this.version++,_t++,this.notify(o)}notify(o){Sr();try{for(let a=this.subs;a;a=a.prevSub)if(a.sub.notify())a.sub.dep.notify()}finally{vr()}}}function ui(o){if(o.dep.sc++,o.sub.flags&4){let a=o.dep.computed;if(a&&!o.dep.subs){a.flags|=20;for(let f=a.deps;f;f=f.nextDep)ui(f)}let d=o.dep.subs;if(d!==o){if(o.prevSub=d,d)d.nextSub=o}o.dep.subs=o}}var gr=new WeakMap,tt=Symbol(""),xr=Symbol(""),Jt=Symbol("");function Te(o,a,d){if($e&&ue){let f=gr.get(o);if(!f)gr.set(o,f=new Map);let p=f.get(d);if(!p)f.set(d,p=new En),p.map=f,p.key=d;p.track()}}function Ke(o,a,d,f,p,m){let g=gr.get(o);if(!g){_t++;return}let h=(y)=>{if(y)y.trigger()};if(Sr(),a==="clear")g.forEach(h);else{let y=ct(o),E=y&&hn(d);if(y&&d==="length"){let C=Number(f);g.forEach((T,A)=>{if(A==="length"||A===Jt||!ut(A)&&A>=C)h(T)})}else{if(d!==void 0||g.has(void 0))h(g.get(d));if(E)h(g.get(Jt));switch(a){case"add":if(!y){if(h(g.get(tt)),$t(o))h(g.get(xr))}else if(E)h(g.get("length"));break;case"delete":if(!y){if(h(g.get(tt)),$t(o))h(g.get(xr))}break;case"set":if($t(o))h(g.get(tt));break}}}vr()}function ft(o){let a=le(o);if(a===o)return a;if(Te(a,"iterate",Jt),qe(o))return a;if(!He(o))return a.map(De);return It(o)?a.map((d)=>nt(De(d))):a.map(nt)}function wr(o){return Te(o=le(o),"iterate",Jt),o}function Je(o,a){if(He(o))return It(o)?nt(De(a)):nt(a);return De(a)}var Yl={__proto__:null,[Symbol.iterator](){return pr(this,Symbol.iterator,(o)=>Je(this,o))},concat(...o){return ft(this).concat(...o.map((a)=>ct(a)?ft(a):a))},entries(){return pr(this,"entries",(o)=>(o[1]=Je(this,o[1]),o))},every(o,a){return je(this,"every",o,a,void 0,arguments)},filter(o,a){return je(this,"filter",o,a,(d)=>d.map((f)=>Je(this,f)),arguments)},find(o,a){return je(this,"find",o,a,(d)=>Je(this,d),arguments)},findIndex(o,a){return je(this,"findIndex",o,a,void 0,arguments)},findLast(o,a){return je(this,"findLast",o,a,(d)=>Je(this,d),arguments)},findLastIndex(o,a){return je(this,"findLastIndex",o,a,void 0,arguments)},forEach(o,a){return je(this,"forEach",o,a,void 0,arguments)},includes(...o){return mr(this,"includes",o)},indexOf(...o){return mr(this,"indexOf",o)},join(o){return ft(this).join(o)},lastIndexOf(...o){return mr(this,"lastIndexOf",o)},map(o,a){return je(this,"map",o,a,void 0,arguments)},pop(){return Ot(this,"pop")},push(...o){return Ot(this,"push",o)},reduce(o,...a){return ti(this,"reduce",o,a)},reduceRight(o,...a){return ti(this,"reduceRight",o,a)},shift(){return Ot(this,"shift")},some(o,a){return je(this,"some",o,a,void 0,arguments)},splice(...o){return Ot(this,"splice",o)},toReversed(){return ft(this).toReversed()},toSorted(o){return ft(this).toSorted(o)},toSpliced(...o){return ft(this).toSpliced(...o)},unshift(...o){return Ot(this,"unshift",o)},values(){return pr(this,"values",(o)=>Je(this,o))}};function pr(o,a,d){let f=wr(o),p=f[a],m=p.call(f);if(f!==o&&!qe(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let g=Object.create(Object.getPrototypeOf(m));if(g.next=()=>ei(m.next(),d),p!==di[a])Object.defineProperties(g,{return:{get(){let h=m.return;return typeof h==="function"?h.bind(m):h}},throw:{get(){let h=m.throw;return typeof h==="function"?h.bind(m):h}}});return g}m._next=m.next,m.next=()=>ei(m._next(),d)}return m}function ei(o,a){if(!o.done)o.value=a(o.value);return o}var di=Array.prototype;function je(o,a,d,f,p,m){let g=wr(o),h=g!==o&&!qe(o),y=g[a];if(y!==di[a]){let T=y.apply(o,m);return h?De(T):T}let E=d;if(g!==o){if(h)E=function(T,A){return d.call(this,Je(o,T),A,o)};else if(d.length>2)E=function(T,A){return d.call(this,T,A,o)}}let C=y.call(g,E,f);return h&&p?p(C):C}function ti(o,a,d,f){let p=wr(o),m=p!==o&&!qe(o),g=d,h=!1;if(p!==o){if(m)h=f.length===0,g=function(E,C,T){if(h)h=!1,E=Je(o,E);return d.call(this,E,Je(o,C),T,o)};else if(d.length>3)g=function(E,C,T){return d.call(this,E,C,T,o)}}let y=p[a](g,...f);return h?Je(o,y):y}function mr(o,a,d){let f=le(o);Te(f,"iterate",Jt);let p=f[a](...d);if((p===-1||p===!1)&&cc(d[0]))return d[0]=le(d[0]),f[a](...d);return p}function Ot(o,a,d=[]){Dt(),Sr();let f=le(o)[a].apply(o,d);return vr(),Lt(),f}var Xl=dr("__proto__,__v_isRef,__isVue"),fi=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(ut));function Zl(o){if(!ut(o))o=String(o);let a=le(this);return Te(a,"has",o),a.hasOwnProperty(o)}class Tr{constructor(o=!1,a=!1){this._isReadonly=o,this._isShallow=a}get(o,a,d){if(a==="__v_skip")return o.__v_skip;let f=this._isReadonly,p=this._isShallow;if(a==="__v_isReactive")return!f;else if(a==="__v_isReadonly")return f;else if(a==="__v_isShallow")return p;else if(a==="__v_raw"){if(d===(f?p?ac:gi:p?hi:mi).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(d))return o;return}let m=ct(o);if(!f){let h;if(m&&(h=Yl[a]))return h;if(a==="hasOwnProperty")return Zl}let g=Reflect.get(o,a,Ue(o)?o:d);if(ut(a)?fi.has(a):Xl(a))return g;if(!f)Te(o,"get",a);if(p)return g;if(Ue(g)){let h=m&&hn(a)?g:g.value;return f&&dt(h)?br(h):h}if(dt(g))return f?br(g):wn(g);return g}}class Cr extends Tr{constructor(o=!1){super(!1,o)}set(o,a,d,f){let p=o[a],m=ct(o)&&hn(a);if(!this._isShallow){let y=He(p);if(!qe(d)&&!He(d))p=le(p),d=le(d);if(!m&&Ue(p)&&!Ue(d))if(y)return!0;else return p.value=d,!0}let g=m?Number(a)<o.length:mn(o,a),h=Reflect.set(o,a,d,Ue(o)?o:f);if(o===le(f)&&h){if(!g)Ke(o,"add",a,d);else if(Ie(d,p))Ke(o,"set",a,d,p)}return h}deleteProperty(o,a){let d=mn(o,a),f=o[a],p=Reflect.deleteProperty(o,a);if(p&&d)Ke(o,"delete",a,void 0,f);return p}has(o,a){let d=Reflect.has(o,a);if(!ut(a)||!fi.has(a))Te(o,"has",a);return d}ownKeys(o){return Te(o,"iterate",ct(o)?"length":tt),Reflect.ownKeys(o)}}class pi extends Tr{constructor(o=!1){super(!0,o)}set(o,a){return!0}deleteProperty(o,a){return!0}}var Ql=new Cr,ec=new pi,tc=new Cr(!0);var yr=(o)=>o,xn=(o)=>Reflect.getPrototypeOf(o);function nc(o,a,d){return function(...f){let p=this.__v_raw,m=le(p),g=$t(m),h=o==="entries"||o===Symbol.iterator&&g,y=o==="keys"&&g,E=p[o](...f),C=d?yr:a?nt:De;return!a&&Te(m,"iterate",y?xr:tt),pn(Object.create(E),{next(){let{value:T,done:A}=E.next();return A?{value:T,done:A}:{value:h?[C(T[0]),C(T[1])]:C(T),done:A}}})}}function yn(o){return function(...a){return o==="delete"?!1:o==="clear"?void 0:this}}function rc(o,a){let d={get(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"get",p);Te(g,"get",h)}let{has:y}=xn(g),E=a?yr:o?nt:De;if(y.call(g,p))return E(m.get(p));else if(y.call(g,h))return E(m.get(h));else if(m!==g)m.get(p)},get size(){let p=this.__v_raw;return!o&&Te(le(p),"iterate",tt),p.size},has(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"has",p);Te(g,"has",h)}return p===h?m.has(p):m.has(p)||m.has(h)},forEach(p,m){let g=this,h=g.__v_raw,y=le(h),E=a?yr:o?nt:De;return!o&&Te(y,"iterate",tt),h.forEach((C,T)=>p.call(m,E(C),E(T),g))}};return pn(d,o?{add:yn("add"),set:yn("set"),delete:yn("delete"),clear:yn("clear")}:{add(p){let m=le(this),g=xn(m),h=le(p),y=!a&&!qe(p)&&!He(p)?h:p;if(!(g.has.call(m,y)||Ie(p,y)&&g.has.call(m,p)||Ie(h,y)&&g.has.call(m,h)))m.add(y),Ke(m,"add",y,y);return this},set(p,m){if(!a&&!qe(m)&&!He(m))m=le(m);let g=le(this),{has:h,get:y}=xn(g),E=h.call(g,p);if(!E)p=le(p),E=h.call(g,p);let C=y.call(g,p);if(g.set(p,m),!E)Ke(g,"add",p,m);else if(Ie(m,C))Ke(g,"set",p,m,C);return this},delete(p){let m=le(this),{has:g,get:h}=xn(m),y=g.call(m,p);if(!y)p=le(p),y=g.call(m,p);let E=h?h.call(m,p):void 0,C=m.delete(p);if(y)Ke(m,"delete",p,void 0,E);return C},clear(){let p=le(this),m=p.size!==0,g=void 0,h=p.clear();if(m)Ke(p,"clear",void 0,void 0,void 0);return h}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{d[p]=nc(p,o,a)}),d}function Ar(o,a){let d=rc(o,a);return(f,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return a;else if(p==="__v_raw")return f;return Reflect.get(mn(d,p)&&p in f?d:f,p,m)}}var oc={get:Ar(!1,!1)},ic={get:Ar(!1,!0)},sc={get:Ar(!0,!1)};var mi=new WeakMap,hi=new WeakMap,gi=new WeakMap,ac=new WeakMap;function lc(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wn(o){if(He(o))return o;return Pr(o,!1,Ql,oc,mi)}function xi(o){return Pr(o,!1,tc,ic,hi)}function br(o){return Pr(o,!0,ec,sc,gi)}function Pr(o,a,d,f,p){if(!dt(o))return o;if(o.__v_raw&&!(a&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let g=lc(Xo(o));if(g===0)return o;let h=new Proxy(o,g===2?f:d);return p.set(o,h),h}function It(o){if(He(o))return It(o.__v_raw);return!!(o&&o.__v_isReactive)}function He(o){return!!(o&&o.__v_isReadonly)}function qe(o){return!!(o&&o.__v_isShallow)}function cc(o){return o?!!o.__v_raw:!1}function le(o){let a=o&&o.__v_raw;return a?le(a):o}var De=(o)=>dt(o)?wn(o):o,nt=(o)=>dt(o)?br(o):o;function Ue(o){return o?o.__v_isRef===!0:!1}function ze(o){return uc(o,!1)}function uc(o,a){if(Ue(o))return o;return new yi(o,a)}class yi{constructor(o,a){this.dep=new En,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?o:le(o),this._value=a?o:De(o),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(o){let a=this._rawValue,d=this.__v_isShallow||qe(o)||He(o);if(o=d?o:le(o),Ie(o,a))this._rawValue=o,this._value=d?o:De(o),this.dep.trigger()}}class bi{constructor(o,a,d){this.fn=o,this.setter=a,this._value=void 0,this.dep=new En(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_t-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=d}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return oi(this,!0),!0}get value(){let o=this.dep.track();if(ai(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function jt(o,a,d=!1){let f,p;if(Go(o))f=o;else f=o.get,p=o.set;return new bi(f,p,d)}function Tn(o){return o.replaceAll(/[A-Z]/g,(a)=>`-${a.toLowerCase()}`)}var dc=new Set(["all","print","screen","speech"]);function Si(o,a){if(o.startsWith("@--"))return a[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let d=o.slice(2,-1).trim();return dc.has(d.toLowerCase())?d:o.slice(1)}return null}function Ht(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Vt(o){return o.startsWith("@keyframes")}function vi(o,a){let d=[];for(let f of Nr(o))for(let p of Nr(a))d.push(fc(f,p));return d.join(", ")}function fc(o,a){if(a.startsWith("&"))return a.replaceAll("&",o);if(a.startsWith("[")||a.startsWith(":")||a.startsWith("."))return`${o}${a}`;return`${o} ${a}`}function Nr(o){let a=[],d=0,f=null,p=0;for(let g=0;g<o.length;g+=1){let h=o[g];if(f){if(h==="\\")g+=1;else if(h===f)f=null;continue}if(h==='"'||h==="'")f=h;else if(h==="("||h==="[")d+=1;else if(h===")"||h==="]")d=Math.max(0,d-1);else if(h===","&&d===0)a.push(o.slice(p,g)),p=g+1}a.push(o.slice(p));let m=a.flatMap((g)=>{let h=g.trim();return h===""?[]:[h]});return m.length>0?m:[o]}var pc=/[\s>+~,()]/,mc=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function hc(o,a){let d="",f=0;for(;;){let p=o.indexOf("[open]",f);if(p===-1)return d+o.slice(f);let m=p;while(m>0&&!pc.test(o.charAt(m-1)))m-=1;let g=mc.exec(o.slice(m,p))?.[0]?.toLowerCase(),h=g===void 0?a.dialog===!0:g==="dialog";d+=o.slice(f,p)+(h?"[data-jx-dialog-open]":"[open]"),f=p+6}}function Rr(o,a={}){if(o.includes("::backdrop"))return null;let d=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return hc(d,a)}var Ge="data-color-scheme";function Cn(o){let a=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return a==="light"||a==="dark"?a:null}function Ei(o,a){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ge}]))`,forced:`${o}:where([${Ge}="${a}"])`};return{auto:`:where(:root:not([${Ge}])) ${o}`,forced:`:where(:root[${Ge}="${a}"]) ${o}`}}function Wt(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function $r(o){return o.startsWith("--")?o:Tn(o)}function Ft(o){let a=2166136261;for(let d=0;d<o.length;d+=1)a^=o.charCodeAt(d),a=Math.imul(a,16777619);return(a>>>0).toString(36)}function wi(o,a,d){let f=d.map(([m,g])=>`${m}: ${g}`).join("; "),p=a===null?f:`${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function gc(o,a,d){let f=d.map(({selector:m,declarations:g})=>`${m} { ${g.map(([h,y])=>`${h}: ${y}`).join("; ")} }`).join(" "),p=`@keyframes ${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function xc(o){let a=Object.keys(o).filter((f)=>Vt(f));if(a.length===0)return o;let d={...o};for(let f of a)delete d[f];return d}function yc(o){let a=o.startsWith("&")?o.slice(1):o;return a===""||a.startsWith(":")||a.startsWith(".")||a.startsWith("[")}function Bt(o,a={}){let{scope:d=null,mediaQueries:f={},transposeValue:p=(L)=>L,transposeSelector:m=(L)=>L,resolveValue:g}=a,h=[],y=(L)=>L!==null&&typeof L==="object"&&!Array.isArray(L)&&!r(L),E=(L,_)=>{if(y(_))return[_];if(!Ht(L)||!Array.isArray(_)||_.length===0)return[];return _.every((Y)=>y(Y))?_:[]},C=(L,_,Y,q)=>{if(_===void 0||_===null)return null;if(r(_))return Y?g?.(L,_,q)??null:null;if(n(_))return null;let G=String(_);if(c(G))return Y?g?.(L,G,q)??null:null;return p(G)},T=(L,_,Y=!0,q="self")=>{let G=[];for(let[U,M]of Object.entries(L)){if(E(U,M).length>0)continue;if(_&&(U.startsWith("@")||Wt(U)))continue;if(U.startsWith("$"))continue;let B=C(U,M,Y,q);if(B!==null)G.push([$r(U),B])}return G},A=(L,_,Y,q,G)=>{if(Y.length===0)return;let U=_;if(U!==null){let re=m(U);if(re===null)return;U=re}let M=wi(L,U,Y),B={text:M,conditions:[...L],selector:U,declarations:Y,target:q,key:Ft(M)};if(e(G)&&G!=="")B.description=G;h.push(B)},H=(L,_,Y)=>{let q=L.slice(10).trim();if(q==="")return;let G=[];for(let[M,B]of Object.entries(_)){if(!y(B))continue;let re=T(B,!0,!1,"unscoped");if(re.length>0)G.push({declarations:re,selector:M.trim()})}if(G.length===0)return;let U=gc(Y,q,G);h.push({blocks:G,conditions:[...Y],declarations:[],key:Ft(U),selector:null,target:"unscoped",text:U})},k=(L,_,Y,q,G)=>{if(L==="@--")return;if(Ht(L)){A([...q,L],null,T(_,!1,!0,"unscoped"),"unscoped",_.$description);return}if(Vt(L)){H(L,_,q);return}let U=Si(L,f),M=U===null?L:`@media ${U}`,B=U===null?null:Cn(U);if(B!==null&&Y!==null){let{auto:re,forced:X}=Ei(Y,B);K(_,re,[...q,M],G),K(xc(_),X,q,G);return}K(_,Y,[...q,M],G)};function K(L,_,Y,q){A(Y,_,T(L,!0,!0,q),q,L.$description);for(let[G,U]of Object.entries(L))for(let M of E(G,U))if(G.startsWith("@"))k(G,M,_,Y,q);else if(_!==null)K(M,vi(_,G),Y,yc(G)?q:"descendant")}return K(o,d,[],"self"),h}var Fe="en-US",Ti="UTC",Ci=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Ai=Ci.map((o)=>o.path),Pi=Object.fromEntries(Ci.map((o)=>[o.path,o.params.indexOf("locale")]));function bc(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function Or(o){if(o==="")return[];return o.split("/").map((a)=>bc(a))}function he(o,a){let d=o;for(let f of Or(a))d=d?.[f];return d}function kr(o){let a=o.$map;return n(a)?a:void 0}function Sc(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function $i(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var Oi=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),ki=new Set(["!","-"]),Mi=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),vc=new Set(["=","+=","-=","*=","/="]),Ec=new Set(["push","pop","shift","unshift","splice"]),_i=new Set(["reduce","map","filter"]),Ji=new Set(["?:","switch"]),Di=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),wc=new Set([...Oi,...ki,...Mi,..._i,...Ji,...Di,"call"]),Tc=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Ai]),Cc=new Map([["Intl/compare",(o,a,d,f)=>new Intl.Collator(d??Fe,f).compare(o,a)],["Intl/displayName",(o,a,d,f)=>new Intl.DisplayNames(d??Fe,{...f,type:a??"language"}).of(o)],["Intl/formatDate",(o,a,d)=>new Intl.DateTimeFormat(a??Fe,{timeZone:Ti,...d}).format(new Date(o))],["Intl/formatList",(o,a,d)=>new Intl.ListFormat(a??Fe,d).format(o)],["Intl/formatNumber",(o,a,d)=>new Intl.NumberFormat(a??Fe,d).format(o)],["Intl/formatRelativeTime",(o,a,d,f)=>new Intl.RelativeTimeFormat(d??Fe,f).format(o,a)],["Intl/plural",(o,a,d)=>new Intl.PluralRules(a??Fe,d).select(o)],["Intl/segment",(o,a,d)=>[...new Intl.Segmenter(d??Fe,{granularity:a??"grapheme"}).segment(o)].map((f)=>f.segment)]]);function Ac(o,a,d){let f=Pi[o];if(f===void 0||f<0||a[f]!=null)return a;let p=he(d.$page,"locale");if(!e(p)||p==="")return a;let m=[...a];return m[f]=p,m}function Pc(o){return o.startsWith("window#/")&&Tc.has(o.slice(8))}function Li(o){return Oi.has(o)}var Ni=64,Nc=64;function pe(o,a){if(!o)return;let d=(o.depth??0)+1;if(d>Nc)return;return{depth:d,path:[...o.path??[],...Array.isArray(a)?a:[a]],report:o.report}}function fe(o,a,d,f,p){if(o===null||o===void 0)return o;if(Sc(o))return Ce(o,a,d,f,p);if($i(o)){let m=An(o.$ref,a,d,f);return p?.report(p.path??[],m),m}if(Array.isArray(o))return Ii(o,a,d,f,p);return p?.report(p.path??[],o),o}function Ii(o,a,d,f,p){return o.map((m,g)=>fe(m,a,d,f,pe(p,g)))}function Rc(o,a,d,f){let p=(m)=>{if(!o.slice(m.length).includes("/"))return a;return An(o.slice(0,o.lastIndexOf("/")),a,d,f)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?An(o.slice(0,o.lastIndexOf("/")),a,d,f):void 0;return}function An(o,a,d,f){if(o==="$reduce/acc")return f?.acc;if(o.startsWith("$reduce/"))return f?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=f?.args?.[p[0]];return p.length>1?he(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return he(d,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=kr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];return p.length>2?he(g,p.slice(2).join("/")):g}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function $c(o,a,d,f){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=kr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];if(p.length>2){let y=p.slice(2),E=y.pop(),C=y.length>0?he(g,y.join("/")):g;return{key:E,obj:C}}return{key:m==="item"?"$map/item":"$map/index",obj:kr(a)??a}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:a};let g=Or(p),h=g.pop(),y=a;for(let E of g)y=y[E];return{key:h,obj:y}}return{key:o,obj:a}}function Ce(o,a,d,f,p){let m=Oc(o,a,d,f,p);return p?.report(p.path??[],m),m}function Ri(o,a,d){switch(o){case"+":return a+d;case"-":return a-d;case"*":return a*d;case"/":return a/d;case"%":return a%d;case"<":return a<d;case"<=":return a<=d;case">":return a>d;default:return a>=d}}function Oc(o,a,d,f,p){let{operator:m,target:g,value:h,initial:y}=o;if(!wc.has(m))throw Error(`$expression: unknown operator "${m}"`);if(ki.has(m)&&!("value"in o)){let E=fe(g,a,d,f,pe(p,"target"));if(m==="!")return!E;if(m==="-")return-E}if(m==="call"){let E=$i(g)?g.$ref:void 0;if(!e(E))throw TypeError("$expression: call target must be a $ref pointer");let C=(f?.callDepth??0)+1;if(C>Ni)throw Error(`$expression: call depth exceeded (${Ni})`);let T=Array.isArray(h)?h.map((H,k)=>fe(H,a,d,f,pe(p,["value",k]))):[];if(E.startsWith("window#/")){if(!Pc(E))throw Error(`$expression: "${E}" is not a blessed pure global`);let H=E.slice(8),k=Cc.get(H);if(k)return k(...Ac(H,T,a));let K=he(globalThis.window,H),L=H.lastIndexOf("/"),_=L===-1?globalThis.window:he(globalThis.window,H.slice(0,L));return K.apply(_,T)}let A=An(E,a,d,f);if(t(A))return A.apply(Rc(E,a,d,f),T);if(n(A)&&"$expression"in A){let H=A,k={};for(let[K,L]of(H.parameters??[]).entries()){let _=e(L)?L:L?.name??"";if(!_)continue;k[_]=T[K]===void 0&&n(L)&&"default"in L?L.default:T[K]}return Ce(H.$expression,a,d,{args:k,callDepth:C})}throw TypeError(`$expression: call target "${E}" is not callable`)}if(Ji.has(m)){if(m==="?:"){let H=fe(g,a,d,f,pe(p,"target"));if(p){let k=fe(h,a,d,f,pe(p,"value")),K=fe(y,a,d,f,pe(p,"initial"));return H?k:K}return H?fe(h,a,d,f):fe(y,a,d,f)}let E=fe(g,a,d,f,pe(p,"target")),C=String(E),T=o.cases??{},A=Object.hasOwn(T,C);if(p){let H;for(let[K,L]of Object.entries(T)){let _=fe(L,a,d,f,pe(p,["cases",K]));if(K===C)H=_}let k=fe(o.default,a,d,f,pe(p,"default"));return A?H:k}return A?fe(T[C],a,d,f):fe(o.default,a,d,f)}if(Mi.has(m)){let E=fe(g,a,d,f,pe(p,"target")),C=fe(h,a,d,f,pe(p,"value"));switch(m){case"===":return E===C;case"!==":return E!==C;case"&&":return E&&C;case"||":return E||C;case"??":return E??C;default:return Ri(m,E,C)}}if(vc.has(m)){let E=fe(h,a,d,f,pe(p,"value")),{obj:C,key:T}=$c(g.$ref,a,d,f);C[T]=m==="="?E:Ri(m.slice(0,-1),C[T],E);return}if(Ec.has(m)){let E=fe(g,a,d,f,pe(p,"target"));switch(m){case"push":return E.push(fe(h,a,d,f,pe(p,"value")));case"unshift":return E.unshift(fe(h,a,d,f,pe(p,"value")));case"pop":return E.pop();case"shift":return E.shift();case"splice":{let C=fe(h,a,d,f,pe(p,"value"));return E.splice(...C)}default:break}}if(Di.has(m)){let E=fe(g,a,d,f,pe(p,"target")),C=h===void 0?[]:Array.isArray(h)?Ii(h,a,d,f,pe(p,"value")):[fe(h,a,d,f,pe(p,"value"))],T=he(E,m);if(!t(T))return;return T.apply(E,C)}if(_i.has(m)){let E=fe(g,a,d,f,pe(p,"target")),C=h;if(m==="reduce"){let T=fe(y,a,d,f,pe(p,"initial"));for(let[A,H]of E.entries())T=Ce(C,a,d,{acc:T,index:A,item:H},A===0?pe(p,"value"):void 0);return T}if(m==="map")return E.map((T,A)=>Ce(C,a,d,{...f,index:A,item:T},A===0?pe(p,"value"):void 0));if(m==="filter")return E.filter((T,A)=>Ce(C,a,d,{...f,index:A,item:T},A===0?pe(p,"value"):void 0))}return}function rt(o,a,d,f){return fe(o,a,d,f)}function Pn(o){let a=o.replaceAll("\\","/");return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function ji(o){let a=Pn(o);return a.startsWith("/")?a:`/${a}`}function Hi(o,a){return[...o].toSorted((d,f)=>f[a].length-d[a].length)}function kc(o,a){return o===a||o.startsWith(`${a}/`)}function Fi(o,a){let d=Pn(a);for(let f of Hi(o,"dir")){let p=Pn(f.dir);if(!kc(d,p)||d===p)continue;let m=d.slice(p.length+1),{filter:g}=f;if(g&&!g(m))return null;let h=m.split("/").map((y)=>encodeURIComponent(y)).join("/");return`${ji(f.urlPrefix)}/${h}`}return null}function Mc(o,a){let d=a.split("#")[0].split("?")[0];if(!d.startsWith("/"))return null;let f;try{f=decodeURIComponent(d)}catch{return null}if(/%2e|%2f/i.test(f))return null;for(let p of Hi(o,"urlPrefix")){let m=ji(p.urlPrefix);if(!f.startsWith(`${m}/`))continue;let h=f.slice(m.length+1).split("/");if(h.some((E)=>E===""||E==="."||E===".."))return null;let{filter:y}=p;if(y&&!y(h.join("/")))return null;return`${Pn(p.dir)}/${h.join("/")}`}return null}var Pp=String.raw`"'\s<>()\\`;var _c="public";function Kt(o){let a=o.search(/[#?]/);return a===-1?{path:o,suffix:""}:{path:o.slice(0,a),suffix:o.slice(a)}}function Mr(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function _r(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function Jr(o,a){let f=(o===""||o==="."?[]:_r(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of a.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.join("/")}function Jc(o,a,d){let{path:f}=Kt(o);if(!f.startsWith("/"))return[];let p;try{p=decodeURIComponent(f)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((h)=>h==="."||h===".."))return[];let g=[];for(let h of d){if(h==="mounts"){let y=Mc(a,f);if(y!==null&&!y.startsWith("/")&&!/^[A-Za-z]:/.test(y))g.push(_r(y));continue}g.push(h==="root"?m:`${_c}/${m}`)}return[...new Set(g)]}function Vi(o,a,d,f){let{path:p}=Kt(o);if(p==="")return null;if(Mr(o))return p.startsWith("/")?Jc(p,d,f)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let g=Jr(a,m);if(g===null||g===""||g===_r(a))return null;return g}function Wi(o){return o.split("/").map((a)=>encodeURIComponent(a)).join("/")}function Bi(o){let a=[],d=0;while(d<o.length){while(d<o.length&&(/\s/.test(o[d])||o[d]===","))d+=1;if(d>=o.length)break;let f=d;while(d<o.length&&!/\s/.test(o[d]))d+=1;let p=o.slice(f,d);if(p.endsWith(",")){a.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(d<o.length&&/\s/.test(o[d]))d+=1;let m=d;while(d<o.length&&o[d]!==",")d+=1;let g=o.slice(m,d).trim();if(d+=1,p=p.replace(/,+$/,""),p!=="")a.push({descriptor:g,url:p})}return a}function Ki(o){return o.map(({url:a,descriptor:d})=>d?`${a} ${d}`:a).join(", ")}function Dc(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function Lc(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function mt(o,a,d,f={}){let p=f.args?{args:f.args}:void 0;for(let m of o){let g=Dc(m);switch(g.kind){case"expression":{let h=Ce(g.node,a,d,p);if(Lc(h))await h;break}case"if":{let h=g.node,y=rt(h.if,a,d,p)?h.then:h.else;if(Array.isArray(y))await mt(y,a,d,f);break}case"switch":{let h=g.node,y=String(rt(h.$switch,a,d,p)),E=h.cases??{},C=Object.hasOwn(E,y)?E[y]:h.default;if(Array.isArray(C))await mt(C,a,d,f);break}case"dispatch":{let h=g.node,y=t(f.target)?f.target():f.target,E=d?.currentTarget??y;if(!E)break;let C={};if("detail"in h)C.detail=rt(h.detail,a,d,p);if(h.bubbles!==void 0)C.bubbles=h.bubbles;if(h.composed!==void 0)C.composed=h.composed;E.dispatchEvent(new CustomEvent(h.dispatchEvent,C));break}case"stopPropagation":{d?.stopPropagation();break}case"preventDefault":{d?.preventDefault();break}default:break}}}function Ui(o,a){for(let d of o.split(";")){let f=d.indexOf("=");if(f===-1)continue;if(d.slice(0,f).trim()===a)return d.slice(f+1)}return null}function qi(o,a,d){let f=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(a))}`];if(d.maxAge!==void 0)p.push(`Max-Age=${d.maxAge}`);let m=f?"/":d.path;if(m)p.push(`Path=${m}`);if(d.domain&&!f)p.push(`Domain=${d.domain}`);let{sameSite:g}=d;if(d.secure===!0||f||o.startsWith("__Secure-")||g?.toLowerCase()==="none")p.push("Secure");if(g)p.push(`SameSite=${g}`);return p.join("; ")}function Dr(o){return t(o)}var Lr=new Map;function Ic(o){return o.headers?.get("Content-Type")??""}async function Br(o,a){if(!e(o))return o;let d=a?.resolver?.(o);if(d)return d;if(Lr.has(o))return Lr.get(o);let f=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);if(Ic(p).includes("text/html"))throw Error(`Jx: ${o} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await p.json()});return Lr.set(o,f),f}var jc=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),hs={skip:!1};function gs(o){hs.skip=o}var xs={skip:!1};function ys(o){xs.skip=o}var jr=null;function bs(o){jr=o||null}function Ss(o){return jr?`${o}?token=${encodeURIComponent(jr)}`:o}function vs(o){let a=pt(!0);return a.run(()=>{we(o)}),()=>a.stop()}function bt(o){let a=pt(!0);try{return{result:a.run(o),stop:()=>a.stop()}}catch(d){throw a.stop(),d}}var Es=!1;function ws(o){Es=o}var Hc=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Fc=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function Vc(o){if(!Es||!o.includes("v"))return o;return o.replace(Hc,(a,d,f)=>`${d}${Fc.get(f.toLowerCase())??`cq${f}`}`)}var Ts=!1;function Cs(o){Ts=o}var Kr=!1;function As(o){Kr=o}var Ur=!1;function Ps(o){Ur=o}var Rn=!1;function Hr(o){return Rn||o.dataset.jxPath!==void 0}function Wc(o,a){if(Ts&&a==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(Kr&&a==="popover"&&Hr(o))return"data-jx-popover";if(Ur&&Hr(o)){if(a==="commandfor")return"data-jx-commandfor";if(a==="inert")return"data-jx-inert";if(a==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return a}var xt=null;function Dn(o){xt=o}var Bc=new Set(["src","poster","data"]),Kc=new Set(["srcset","imagesrcset"]),Uc=new Set(["LINK"]);function qc(o,a){return Bc.has(a)||a==="href"&&Uc.has(o)}function qr(o,a,d){if(!xt||d==="")return d;let f=a.toLowerCase();if(Kc.has(f)){let p=Bi(d),m=p.map((h)=>{let y=xt?.(h.url,f)??null;if(y===null||y===h.url)return h;return{descriptor:h.descriptor,url:y}});return m.some((h,y)=>h!==p[y])?Ki(m):d}if(!qc(o,f))return d;return xt(d,f)??d}var zc=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function Gc(o){if(!xt||!o.includes("url("))return o;return o.replaceAll(zc,(a,d,f)=>{let p=f===""?null:xt?.(f,"url()")??null;return p===null?a:`url(${d}${p}${d})`})}function $n(o){return Vc(Gc(o))}var Ns=!1;function Rs(o){Ns=o}var Yc=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function Xc(o,a,d){if(!Ns||o!=="textContent")return null;let f=null;if(r(a)){if(!a.$ref.startsWith("#/state/"))return null;let m=a.$ref.slice(8);f=m&&!m.includes("/")?m:null}else if(e(a))f=Yc.exec(a)?.[1]??null;if(!f)return null;let p=le(d)[f];if(Ue(p)||t(p))return null;if(n(p))return null;return f}async function Ln(o,a={},d=location.href,f){let p=()=>f?.root??null,m={},g=o.state??{},h=It(a);for(let T of Object.keys(a))if(h&&!(T in g))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>a[T],set:(A)=>{a[T]=A}});else m[T]=a[T];let y=o.imports??{};for(let[,T]of Object.entries(g))if(R(T)&&!T.$src){let A=y[T.$prototype];if(A){if(!A.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${A}"`);continue}T.$src=A}}for(let[T,A]of Object.entries(g)){if(e(A)){if(!A.includes("${"))m[T]=A;continue}if(i(A)||x(A)||A===null){m[T]=A;continue}if(Array.isArray(A)){m[T]=A;continue}if(n(A)){if(A.$prototype)continue;if(b(A))continue;if(D(A))continue;if("default"in A){m[T]=A.default;continue}if(Zc(A))continue;m[T]=A}}let E=wn(m);for(let[T,A]of Object.entries(g))if(e(A)&&A.includes("${"))E[T]=jt(()=>Ms(A,E));for(let[T,A]of Object.entries(g))if(b(A)){let H=A.$expression;if(j(A)){let k=A.parameters;E[T]=(...K)=>Ce(H,E,null,{args:zi(k,K)})}else if(Li(H.operator)){let k=(K,L)=>Ce(H,K,L);E[T]=k}else E[T]=jt(()=>Ce(H,E,null))}for(let[T,A]of Object.entries(g))if(O(A)){let{body:H}=A;if(Array.isArray(A.parameters)&&A.parameters.length>0){let k=A.parameters;E[T]=(...K)=>mt(H,E,null,{args:zi(k,K),target:p})}else{let k=(K,L)=>{mt(H,K,L??null,{target:p})};E[T]=k}}else if(v(A))E[T]=await ru(A,E,T,d);for(let[T,A]of Object.entries(g))if(R(A))E[T]=await yu(A,E,T,d,f);if(!(f?.skipServerFunctions??hs.skip)){for(let[T,A]of Object.entries(g))if(D(A))E[T]=await Cu(A,E,T,d)}let C=f?.media??Us;if(o.$media)E.$media=o.$media;else if(!E.$media&&Object.keys(C).length>0)E.$media=C;return E}function zi(o,a){let d={};for(let[f,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;d[m]=a[f]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:a[f]}return d}function Zc(o){for(let a of Object.keys(o))if(jc.has(a))return!0;return!1}var $s=["state","$map","item","index","$site","$page"];function Os(o){let a=eu(o);return[o,a,a?.item,a?.index,o.$site,o.$page]}function Ye(o,a){let d=Gi.get(o);if(!d)d=Function(...$s,`return \`${o}\``),ks(Gi,o,d);return d(...Os(a))}var Gi=new Map,Yi=new Map,Qc=4096;function ks(o,a,d){if(o.size>=Qc)o.clear();o.set(a,d)}var Xi=new Set,Zi=null;function In(o,a,d){we(()=>{try{a()}catch(f){if(Zi)Zi(f instanceof Error?f:Error(String(f)),o);else if(!Xi.has(o))Xi.add(o),console.warn(`jx: template ${JSON.stringify(o)} threw:`,f);d?.()}})}function eu(o){return o.$map}function tu(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let a=0;for(let d=1;d<o.length;d+=1){let f=o[d];if(f==="{")a+=1;else if(f==="}"){if(a-=1,a===0)return d===o.length-1}}return!1}function Ms(o,a){if(!tu(o))return Ye(o,a);let d=Yi.get(o);if(!d)d=Function(...$s,`return (${o.slice(2,-1)})`),ks(Yi,o,d);return d(...Os(a))}var _s=null;function Js(o){_s=o}var Qi="npm:";async function nu(o,a){if(o.startsWith(Qi)){let d=o.slice(Qi.length);return ht(_s?.(d)??d)}if(a)try{return await ht(new URL(o,a).href)}catch{return ht(o)}return ht(o)}function ht(o){return import(o)}var St=new Map,gt=new Map,Ds=new Set;function Ls(o,a){if(Ds.add(o),t(a)){St.delete(o),gt.set(o,a);return}gt.delete(o),St.set(o,a)}function zr(o){let a=St.get(o);if(a)return a;let d=gt.get(o);if(!d)return;if(!t(d))return d;let f=d(),p=(async()=>{try{let m=await f;return St.set(o,m),gt.delete(o),m}catch(m){throw gt.set(o,d),m}})();return gt.set(o,p),p}async function ru(o,a,d,f){if(o.body&&o.$src)throw Error(`Jx: '${d}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let h=Fr(o),y=Function(...h,"");return Object.defineProperty(y,"name",{configurable:!0,value:o.name??d}),y}let p;if(e(o.body)){let h=Fr(o);p=Function(...h,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??d})}else{let h=o.$src;if(!h)throw Error(`Jx: '${d}' has neither body nor $src`);let y=o.$export??d,E,C=zr(h);if(C instanceof Promise)E=await C;else if(C)E=C;else E=await nu(h,f),St.set(h,E);let T=E[y]??E.default?.[y];if(!t(T))throw TypeError(`Jx: export "${y}" not found or not a function in "${h}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,g=!1;if(!m)g=e(o.body)?I(o.body):p.length<=1&&I(p.toString());if(g)return jt(()=>p(a));return p}function Fr(o){let a=o.parameters?W(o.parameters):o.arguments??[];return a.length>0&&a[0]==="state"?a:["state",...a]}var Gt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]);function Gr(o){return Object.create(o)}function jn(o){return o.$media??{}}function Hn(o){return o}function ou(o){let a=Hn(o)._state;return n(a)?a:null}function iu(o){return t(o)}var es=new Set,su="http://www.w3.org/2000/svg",au="http://www.w3.org/1998/Math/MathML";function lu(o,a){if(o==="svg")return su;if(o==="math")return au;return a??null}function Oe(o,a,d){let f=d?._path??[];if(e(o)||i(o)||x(o)){let T=document.createTextNode(String(o));if(c(o))In(o,()=>{T.textContent=Ye(o,a)},()=>{T.textContent=""});return T}let p=a;for(let[T,A]of Object.entries(o))if(T.startsWith("$")&&!Gt.has(T)){if(p===a)p=Gr(a);p[T]=r(A)?Se(A.$ref,a):A}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!es.has(T))es.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=Zr(o.tagName,p),g=m.includes("-")&&customElements.get(m);if(o.$props&&g)return ds(o,p,d,f);if(o.$props){if(m.includes("-"))return ds(o,p,d,f);let{$props:T,...A}=o;return Oe(A,$u(o,p),d)}if(o.$switch)return xu(o,p,d);let h=lu(m,d?._ns),y=m==="foreignObject"?null:h,E=h?document.createElementNS(h,m):document.createElement(m);if(d?.onNodeCreated)d.onNodeCreated(E,f,o,p);if(Yr(E,o,p),o.style&&m.includes("-"))Xr.set(E,o.style);Fn(E,o.style??{},jn(p),p),Wn(E,o.attributes??{},p);let C=o.children;if(S(C)){let T=d||y?{...d,_ns:y,_path:[...f,"children"]}:void 0;Vr(E,C,p,T)}else if(Array.isArray(C))for(let T=0;T<C.length;T++){let A=C[T],H=d||y?{...d,_ns:y,_path:[...f,"children",T]}:void 0;if(S(A))Vr(E,A,p,H);else E.append(Oe(A,p,H))}return E}function Yr(o,a,d){for(let[f,p]of Object.entries(a)){if(Gt.has(f))continue;if(f.startsWith("$"))continue;if(f.startsWith("on")&&Is(o,f,p,d))continue;js(o,f,p,d)}}function Is(o,a,d,f){let p=a.slice(2),m=f;if(r(d)){let g=Se(d.$ref,f);if(iu(g))o.addEventListener(p,(h)=>g(m,h));return!0}if(O(d)){let{body:g}=d;return o.addEventListener(p,(h)=>{mt(g,m,h)}),!0}if(v(d)&&e(d.body)){let g=Fr(d),h=Function(...g,d.body);return o.addEventListener(p,(y)=>h(m,y)),!0}if(b(d)){let g=d.$expression;return o.addEventListener(p,(h)=>Ce(g,m,h)),!0}return!1}function cu(o,a,d){for(let[f,p]of Object.entries(a))if(f.startsWith("on")&&!Gt.has(f))Is(o,f,p,d)}function js(o,a,d,f){let p=Hn(o),m=Xc(a,d,f);if(m)o.dataset.jxBoundProp=m;let g=(y)=>e(y)?qr(o.tagName,a,y):y,h=(y)=>{let E=o;if(a==="className"&&!(E instanceof HTMLElement)){E.setAttribute("class",y==null?"":String(y));return}if(p[a]===y)return;p[a]=y};if(r(d)){let y=d;if(a==="id"){p[a]=Se(y.$ref,f);return}we(()=>{h(g(Se(y.$ref,f)))});return}if(c(d)){let y=d;In(y,()=>{h(g(Ye(y,f)))});return}h(g(d))}function ts(o,a){let d=[];return{detach:a,insert(f){let p=[];for(let g of f){let h=o.cssRules.length;try{o.insertRule(g,h)}catch{continue}let y=o.cssRules[h];if(y)p.push(y)}let m={rules:p,texts:f};return d.push(m),m},remove(f){let p=d.indexOf(f);if(p!==-1)d.splice(p,1);if(f.rules.length===0)return;let m=[...o.cssRules],g=f.rules.map((h)=>m.indexOf(h)).filter((h)=>h>=0).toSorted((h,y)=>y-h);for(let h of g)o.deleteRule(h);f.rules.length=0},replaceAll(f){d.length=0,d.push({rules:[],texts:f}),o.replaceSync(f.join(`
|
|
3
|
+
`))},text(){return d.flatMap((f)=>f.texts.join(`
|
|
4
4
|
`)).join(`
|
|
5
|
-
`)}}}function
|
|
5
|
+
`)}}}function uu(o){let a=[],d=()=>{o.textContent=a.map((f)=>f.texts.join(`
|
|
6
6
|
`)).join(`
|
|
7
|
-
`)};return{detach(){o.remove()},insert(d){let p={rules:[],texts:d};return a.push(p),c(),p},remove(d){let p=a.indexOf(d);if(p!==-1)a.splice(p,1),c()},replaceAll(d){a.length=0,a.push({rules:[],texts:d}),c()},text(){return o.textContent}}}function Ss(o){let c=o.defaultView?.CSSStyleSheet;if(t(c)&&Array.isArray(o.adoptedStyleSheets))try{let p=new c;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],Bi(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let d=o.createElement("style");return d.dataset.jxSheet="",(Tc(o)??o.documentElement).append(d),d.sheet?Bi(d.sheet,()=>d.remove()):wc(d)}function Tc(o){return o.head}var Vt=new WeakMap;function Cc(o){let a=Vt.get(o);if(a)return a;let c={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:Ss(o)};return Vt.set(o,c),c}var Pn=new WeakMap,Ki="\x01jx-scope\x01";function vs(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function Ui(o,a,c){let d=a.get(c);if(d.refs-=1,d.refs<=0)a.delete(c),o.shared.remove(d.inserted)}function qi(o,a,c,d){let p=a.get(c);if(p){p.refs+=1;return}a.set(c,{inserted:o.shared.insert(d),refs:1})}function Nn(o,a){let c=Pn.get(o);if(!c||a!==void 0&&c!==a)return;Pn.delete(o),c.stop?.();for(let p of c.vars)o.style.removeProperty(p);if(delete o.dataset.jx,Vt.get(c.doc)!==c.state)return;let{state:d}=c;if(c.interned===null){if(d.scratchOwners.delete(o))vs(d)}else Ui(d,d.interned,c.interned);for(let p of c.hoisted)Ui(d,d.hoisted,p)}function Es(o=document){let a=Vt.get(o);if(!a)return;Vt.delete(o);for(let c of a.scratchOwners.keys())Pn.delete(c),delete c.dataset.jx;a.scratchOwners.clear(),a.interned.clear(),a.hoisted.clear(),a.shared.detach(),a.scratch?.detach()}function Ac(o){return n(o)&&"display"in o}var Br=new WeakMap;function ws(o,a){if(!a)return o;let c={...o};for(let[d,p]of Object.entries(a)){let m=c[d];c[d]=F(p)&&n(m)?ws(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return c}function Dn(o,a,c={},d={}){Ts(o,a,c,d,!1)}function Ln(o,a,c={},d={}){Ts(o,a??{},c,d,!0)}function Ts(o,a,c,d,p){Nn(o);let m=o.ownerDocument,h=Cc(m),g=(Lr||Ir)&&kr(o)?(L)=>Er(L,{dialog:o.tagName==="DIALOG"}):(L)=>L,E=-1,y=0,w=[],T=It(a,{mediaQueries:c,resolveValue:(L,z,G)=>{if(G==="self"&&L.startsWith("--"))return w.push({name:L,value:z}),null;if(E<0)({serial:E}=h),h.serial+=1;let Y=`--jx-r${E}-${y}`;return y+=1,w.push({name:Y,value:z}),`var(${Y})`},scope:Ki,transposeSelector:g,transposeValue:An});if(T.length===0&&w.length===0)return;let C=T.filter((L)=>L.target!=="unscoped"),_=T.filter((L)=>L.target==="unscoped");for(let L of _)qi(h,h.hoisted,L.text,[L.text]);let O=`jx-${Jt(C.map((L)=>L.key).join("|"))}`,K=C.map((L)=>L.text.replaceAll(Ki,`[data-jx="${O}"]`));if(K.length>0)if(o.dataset.jx=O,p)h.scratch??=Ss(m),h.scratchOwners.set(o,K),vs(h);else qi(h,h.interned,O,K);let k={doc:m,hoisted:_.map((L)=>L.text),interned:K.length>0&&!p?O:null,state:h,stop:null,uid:O,vars:w.map((L)=>L.name)};if(w.length>0){let L=ft();L.run(()=>{for(let{name:z,value:G}of w)be(()=>{let Y=r(G)?Se(G.$ref,d):We(G,d);o.style.setProperty(z,An(String(Y??"")))})}),k.stop=()=>L.stop()}Pn.set(o,k),mn(()=>Nn(o,k),!0)}var Pc=new Set(["contenteditable","draggable","spellcheck"]);function Nc(o,a){let c=o.toLowerCase();if(c.startsWith("aria-")||Pc.has(c))return String(a);return a?"":null}function In(o,a,c){for(let[d,p]of Object.entries(a)){let m=ic(o,d),h=(g)=>{if(g===null||g===void 0){o.removeAttribute(m);return}if(x(g)){let E=Nc(m,g);if(E===null)o.removeAttribute(m);else o.setAttribute(m,E);return}o.setAttribute(m,jr(o.tagName,d,String(g)))};if(r(p))be(()=>h(Se(p.$ref,c)));else if(l(p))be(()=>h(gc(p,c)));else h(p)}}function _r(o,a,c,d){let p=d?._path??[],m=document.createComment("jx-array");o.append(m);let{items:h,map:g,filter:E,sort:y,key:w}=a,T=r(w)?w.$ref:null,C=gt,_=!1,O=(B)=>{if(!_)_=!0,console.warn(`Jx $map: ${B}`)},K=[],k=(B)=>{B.scope.stop(),B.node.remove()},L=(B,ie,V)=>{let ne=di({index:V,item:ie}),X=Fr(c);X.$map=ne,Object.defineProperty(X,"$map/item",{enumerable:!0,get:()=>ne.item}),Object.defineProperty(X,"$map/index",{enumerable:!0,get:()=>ne.index});let re=ft(!0),Te=d?{...d,_path:[...p,"map",V]}:void 0,H=re.run(()=>Me(g,X,Te));return{key:B,map:ne,node:H,scope:re}},z=(B,ie)=>{let V=new Map;for(let re of K)V.set(re.key,re);let ne=[];for(let re=0;re<B.length;re++){let Te=ie[re],H=B[re],q=V.get(Te);if(q){if(V.delete(Te),q.map.item!==H)q.map.item=H;if(q.map.index!==re)q.map.index=re,d?.onNodeMoved?.(q.node,[...p,"map",re]);ne.push(q)}else ne.push(L(Te,H,re))}for(let re of V.values())k(re);let X=K.find((re)=>!V.has(re.key))?.node??m;for(let re of ne){if(re.node===X){X=X.nextSibling??m;continue}X.before(re.node)}K=ne},G=()=>{let B=r(h)?Se(h.$ref,c):h;if(Array.isArray(B)&&r(E)){let X=Se(E.$ref,c);if(t(X))B=B.filter(X)}if(Array.isArray(B)&&r(y)){let X=Se(y.$ref,c);if(t(X)){let re=X;B=[...B].toSorted(re)}}let ie=Array.isArray(B)&&g?B:[],V=ie.map((X,re)=>Rc(T,X,re,O)),ne=new Set;for(let X=0;X<V.length;X++)if(ne.has(V[X]))O(`duplicate key ${String(V[X])} — every occurrence after the first is rebuilt on each change`),V[X]={duplicate:X};else ne.add(V[X]);hn();try{On(Jr(C),()=>z(ie,V))}finally{gn()}},Y=!1,U=!1,P=be(G,{scheduler:()=>{if(Y)return;Y=!0,queueMicrotask(()=>{if(Y=!1,!U)P()})}});mn(()=>{U=!0;for(let B of K)k(B);K=[]},!0)}function Rc(o,a,c,d){if(o===null)return c;if(o==="$map/item")return a;if(o.startsWith("$map/item/")){let p=me(a,o.slice(10));if(p===void 0||p===null)return d(`key "${o}" is empty for some items — those rows fall back to their index`),c;return p}return d(`key "${o}" is not a $map/item pointer — rows fall back to their index`),c}function Kr(o,a){if(e(o))return o;if(!J(o))return"div";let c=o.$expression;if(c.operator==="?:")return tt(c.target,a,null)?c.value:c.initial;let d=tt(c.target,a,null);return c.cases[String(d)]??c.default}function $c(o,a,c){let d=c?._path??[],p=document.createElement(Kr(o.tagName,a)),m=gt;if(c?.onNodeCreated)c.onNodeCreated(p,d,o,a);Wr(p,o,a),Dn(p,o.style??{},Jn(a),a),In(p,o.attributes??{},a);let h=0,g=null,E=null,y=()=>{g?.stop(),g=null};return be(()=>{if(!r(o.$switch)){y(),p.replaceChildren(),h+=1;return}let w=String(Se(o.$switch.$ref,a));if(w===E)return;E=w,y(),p.replaceChildren(),h+=1;let T=o.cases?.[w];if(!T)return;let C=h,_=ft(!0);g=_;let O=c?{...c,_path:[...d,"cases",w]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,c?._ctx?.base??location.href);Dr(K,c?._ctx).then(async(k)=>{if(C!==h)return;let L=await _n(k,{},K,c?._ctx);if(C!==h)return;p.replaceChildren(),On(Jr(m),()=>_.run(()=>p.append(Me(k,L,O))))}).catch((k)=>console.error("Jx $switch: failed to load external case",T.$ref,k));return}hn();try{On(Jr(m),()=>_.run(()=>p.append(Me(T,a,O))))}finally{gn()}}),mn(y,!0),p}var Rn=ze;async function Oc(o,a,c,d,p){if(o.$src)return Mc(o,a,c,d);switch(o.$prototype){case"Request":{let m=ze(null),h=o.debounce??0,g=null;if(!o.manual&&!(p?.skipAutoRequests??ns.skip))be(()=>{let E;if(l(o.url))E=We(o.url,a);else({url:E}=o);if(!E||E==="undefined"||E.includes("undefined"))return;let y=new AbortController;xn(()=>{if(y.abort(),g!==null)clearTimeout(g)});let w=()=>fetch(E,{method:o.method??"GET",signal:y.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}});if(h>0)g=setTimeout(w,h);else w()});return m}case"URLSearchParams":return Mt(()=>{let m={};for(let[h,g]of Object.entries(o))if(h!=="$prototype")m[h]=r(g)?Se(g.$ref,a):l(g)?We(g,a):g;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,h=o.key??c,g;try{let y=m.getItem(h);g=y!==null?JSON.parse(y):o.default??null}catch{g=o.default??null}let E=Rn(g);return be(()=>{let y=E.value;if(y===null)try{m.removeItem(h)}catch{}else try{m.setItem(h,JSON.stringify(y))}catch{}}),E}case"Cookie":{let m=o.name??c,g=Rn((()=>{let E=Hi(document.cookie,m);if(E===null)return null;try{return JSON.parse(decodeURIComponent(E))}catch{return E}})()??o.default??null);return be(()=>{document.cookie=Fi(m,g.value,o)}),g}case"IndexedDB":{let m=ze(null),{database:h,store:g,version:E=1,keyPath:y="id",autoIncrement:w=!0,indexes:T=[]}=o;if(!h||!g)throw Error(`Jx: IndexedDB entry '${c}' requires database and store`);let C=indexedDB.open(h,E);return C.addEventListener("upgradeneeded",(_)=>{let O=_.target.result;if(!O.objectStoreNames.contains(g)){let K=O.createObjectStore(g,{autoIncrement:w,keyPath:y});for(let k of T)K.createIndex(k.name,k.keyPath,{unique:k.unique??!1})}}),C.addEventListener("success",(_)=>{let O=_.target.result;m.value={database:h,getStore:(K="readwrite")=>Promise.resolve(O.transaction(g,K).objectStore(g)),isReady:!0,store:g,version:E}}),C.addEventListener("error",()=>{m.value={error:C.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(i(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[h,g]of Object.entries(o.fields??{}))m.append(h,g);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${c}". Did you mean to add '$src'?`),ze(null)}}var kc=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function Ur(o){let a={};for(let[c,d]of Object.entries(o))if(!kc.has(c))a[c]=d;return a}async function Mc(o,a,c,d){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return Jc(o,a,c,d)}async function _c(o,a,c,d){let p,m=Hr(a);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await Ht(a)}catch{if(d){let w=new URL(a,d).href;p=await Ht(w)}else throw Error(`Failed to import "${a}"`)}xt.set(a,p)}let h=p[c]??p.default?.[c];if(!h)throw Error(`Jx: export "${c}" not found in "${a}"`);if(!t(h))throw TypeError(`Jx: "${c}" from "${a}" is not a class`);let g=new h(Ur(o)),E=t(g.resolve)?await g.resolve():("value"in g)?g.value:g,y=Rn(E);if(t(g.subscribe))g.subscribe((w)=>{y.value=w});return y}async function Jc(o,a,c,d){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return Tn(o,a,c,d);try{let T=d?new URL(p,d).href:p,C=await fetch(T);if(!C.ok)throw Error(`HTTP ${C.status}`);m=await C.json()}catch{return Tn(o,a,c,d)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return Tn(o,a,c,d);let C=d?new URL(p,d).href:new URL(p,location.href).href,_=new URL(m.$implementation,C).href,O=o.$export??m.title??o.$prototype;try{return await _c(o,_,O,d)}catch{return Tn(o,a,c,d)}}let E=new(Lc(m))(Ur(o)),y=t(E.resolve)?await E.resolve():("value"in E)?E.value:E,w=Rn(y);if(t(E.subscribe))E.subscribe((T)=>{w.value=T});return w}function Dc(o){return n(o)}function Lc(o){let a=o.$defs?.fields??{},c=o.$defs?.constructor,d=Dc(c)?c:void 0,p=o.$defs?.methods??{};class m{constructor(h={}){for(let[g,E]of Object.entries(a)){let y=E.identifier??g,w=E.access==="private"?`_${y}`:y;if(h[y]!==void 0)this[w]=h[y];else if(E.initializer!==void 0)this[w]=E.initializer;else if(E.default!==void 0)this[w]=structuredClone(E.default);else this[w]=null}if(d?.body){let g=Array.isArray(d.body)?d.body.join(`
|
|
8
|
-
`):
|
|
9
|
-
`):g.body??"";if(g.role==="accessor"){let T={};if(g.getter)T.get=Function(g.getter.body??"");if(g.setter){let C=(g.setter.parameters??[]).map((_)=>_.$ref?.split("/").pop()??"v");T.set=Function(...C,g.setter.body??"")}Object.defineProperty(m.prototype,E,{...T,configurable:!0})}else if(g.scope==="static")m[E]=Function(...y,w);else m.prototype[E]=Function(...y,w)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function Tn(o,a,c,d){let p=Ur(o),m=Object.values(p).some((E)=>l(E)),h=(E)=>fetch(is("/__jx_resolve__"),{body:JSON.stringify({$base:d,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...E}),headers:{"Content-Type":"application/json"},method:"POST"}).then((y)=>{if(!y.ok)throw Error(`Jx dev proxy ${y.status} for "${c}"`);return y.json()}),g=ze(null);if(m)be(()=>{let E={};for(let[y,w]of Object.entries(p))E[y]=l(w)?We(w,a):w;h(E).then((y)=>{g.value=y}).catch((y)=>console.error("Jx dev proxy:",y))});else h(p).then((E)=>{g.value=E}).catch((E)=>console.error("Jx dev proxy:",E));return g}function Cs(o,a,c){let d=0;return(p)=>{d+=1;let m=d;new Promise((h)=>{h(a(p))}).then((h)=>{if(m===d)o.value=h}).catch((h)=>{if(m===d)console.error(c,h)})}}async function Ic(o,a,c,d){let{$src:p,$export:m}=o,h=gs.has(p)?Hr(p):void 0;if(!h)return jc(o,a,c,d);let g=h instanceof Promise?await h:h,E=g[m]??g.default?.[m];if(!E)throw Error(`Jx: export "${m}" not found in "${p}" for "${c}"`);if(!t(E))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let y=E,w=o.arguments??{},T=Object.values(w).some((O)=>r(O)),C=()=>{let O={};for(let[K,k]of Object.entries(w))O[K]=r(k)?Se(k.$ref,a):k;return O},_=ze(null);if(T){let O=Cs(_,y,"Jx server function:");be(()=>{let K=C();xn(()=>{}),O(K)})}else _.value=await y(C());return _}async function jc(o,a,c,d){let p=o.arguments??{},m=Object.values(p).some((w)=>r(w)),h=()=>{let w={};for(let[T,C]of Object.entries(p))w[T]=r(C)?Se(C.$ref,a):C;return w},g=(w)=>fetch(is("/__jx_server__"),{body:JSON.stringify({$base:d,$export:o.$export,$src:o.$src,arguments:w}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${c}"`);return T.json()}),E=ze(null),y=Cs(E,g,"Jx server proxy:");if(m)be(()=>{let w=h();xn(()=>{}),y(w)});else y(h());return E}function Se(o,a){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let c=(o.startsWith("#/")?o.slice(2):o).split("/"),[,d]=c,m=a.$map?.[d]??a[`$map/${d}`];return c.length>2?me(m,c.slice(2).join("/")):m}if(o.startsWith("#/state/"))return me(a,o.slice(8));if(o.startsWith("parent#/"))return me(a,o.slice(8));if(o.startsWith("window#/"))return me(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return me(globalThis.document,o.slice(10));return me(a,o)??null}function zi(o,a,c,d){let p=a.replaceAll(/-([a-z])/g,(h,g)=>g.toUpperCase()),m=o[p];if(x(m)){o[p]=c!==null&&c!=="false";return}if(c===null){let h=d?.get(p);o[p]=h===void 0?s(m)?0:"":h;return}o[p]=s(m)?Number(c):c}function Hc(o){let a=new Map;for(let[c,d]of Object.entries(o.state??{})){if(n(d)){if("default"in d){a.set(c,d.default);continue}if(Fc.some((p)=>(p in d)))continue}a.set(c,d)}return a}var Fc=["$expression","$prototype","$ref","$src"],Gi=new Set;function Vc(o,a){if(Object.hasOwn(o,a))return!0;if(o.hasAttribute(a))return!0;let c=a.replaceAll(/[A-Z]/gu,(d)=>`-${d.toLowerCase()}`);return c!==a&&o.hasAttribute(c)}function $n(o,a){if(!M(o))return!1;let c=a===void 0?o:`${a}:${o}`;if(!Gi.has(c))Gi.add(c),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${a===void 0?"":` (${a})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function Wc(o,a){let c=Fr(a);for(let[d,p]of Object.entries(o.$props??{})){if($n(d,"$props"))continue;c[d]=r(p)?Se(p.$ref,a):p}return c}var As={},Ft=new Map;async function Ps(o,a){let c=a??location.href,{tagName:d}=o;if(!d||!d.includes("-"))throw Error(`Jx redefineElement: tagName "${d}" must contain a hyphen`);if(!customElements.get(d)){await Bt(o,c);return}if(o.$elements)await qr(o.$elements,c);let p=Ft.get(d)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${d}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);Ft.set(d,{base:c,doc:o})}function Ns(o){As=o??{}}async function qr(o,a,c){for(let d of o){if(e(d)){try{await import(d.startsWith("/")||d.startsWith(".")?d:`/node_modules/${d}`)}catch(h){console.warn(`Jx: failed to import package "${d}"`,h)}continue}if(!r(d))continue;let{href:p}=new URL(d.$ref,a),m=await Dr(p,c);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await qr(m.$elements,p,c);await Bt(m,p)}}var Yi=32,Bc={expansion:0,frames:[]},gt=Bc;function On(o,a){let c=gt;gt=o;try{return a()}finally{gt=c}}function Jr(o){return{expansion:o.frames.length,frames:o.frames}}function Kc(o,a){if(Object.is(o,a))return!0;if(!Xi(o)||!Xi(a))return!1;try{return JSON.stringify(o)===JSON.stringify(a)}catch{return!1}}function Xi(o){if(!n(o))return!1;let a=le(o);if(Array.isArray(a))return!0;let c=Object.getPrototypeOf(a);return c===Object.prototype||c===null}function Uc(o,a){if(o.tag!==a.tag)return!1;let c=Object.keys(o.props);if(c.length!==Object.keys(a.props).length)return!1;return c.every((d)=>Object.hasOwn(a.props,d)&&Kc(o.props[d],a.props[d]))}function qc(o,a){let c=[...o.frames.map((d)=>d.tag),a.tag].join(" → ");if(o.frames.slice(o.expansion).some((d)=>Uc(d,a)))throw Error(`Component <${a.tag}> renders itself: ${c}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=Yi)throw Error(`Component nesting exceeds ${Yi} levels: ${c}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,a]}}var Zi=new Set;async function Bt(o,a){let c=a,d;if(e(o)){if(c=new URL(o,c??location.href).href,Zi.has(c))return;Zi.add(c),d=await Dr(o)}else d=o;c??=location.href;let{tagName:p}=d;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(d.$elements)await qr(d.$elements,c);Ft.set(p,{base:c,doc:d});let m=d,h=c,g=m.observedAttributes??[],E=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return g}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let y=gt,w={},T=Ft.get(p)??{base:h,doc:m},{doc:C,base:_}=T,O=await _n(C,{},_,{base:_,media:null,root:this});for(let V of g)if(this.hasAttribute(V))zi(O,V,this.getAttribute(V)),w[V]=this.getAttribute(V);let K=this.dataset.jxProps;if(K){try{let V=JSON.parse(K),ne=n(V)||e(V)?Object.entries(V):[];for(let[X,re]of ne){if($n(X,"data-jx-props"))continue;if(X in(C.state??{}))O[X]=re,w[X]=re}}catch{}delete this.dataset.jxProps}let k=this.getAttributeNames().filter((V)=>V.startsWith("props.")&&V.length>6);for(let V of k){let ne=V.slice(6);if($n(ne,"props.* attribute")){this.removeAttribute(V);continue}if(ne in(C.state??{}))O[ne]=this.getAttribute(V),w[ne]=this.getAttribute(V),this.removeAttribute(V)}for(let V of Object.keys(C.state??{})){if(M(V))continue;let ne=Vr(this);if(V in this&&ne[V]!==void 0&&Vc(this,V))O[V]=ne[V],w[V]=ne[V]}let L;try{L=qc(y,{props:w,tag:p})}catch(V){if(this.replaceChildren(),!this.isConnected)return;console.error(`Jx: <${p}> was not rendered:`,V),this.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:V,message:V instanceof Error?V.message:String(V)}));return}for(let V of Object.keys(C.state??{})){if(M(V))continue;if(!(V in HTMLElement.prototype))Object.defineProperty(this,V,{configurable:!0,get:()=>O[V],set:(ne)=>{O[V]=ne}})}this._state=O;let z=[...this.childNodes];this.replaceChildren();let G=C.style,Y=G&&Ac(G)?G:{display:"block",...G},U=ws(Y,Br.get(this));if(Dn(this,U,Jn(O),O),In(this,C.attributes??{},O),Ec(this,C,O),!Array.isArray(C.children)&&C.textContent!==void 0)bs(this,"textContent",C.textContent,O);let P=Array.isArray(C.children)?C.children:[],B=Cn;Cn||=this.dataset.jxPath!==void 0;try{On(L,()=>{for(let V of P)this.append(Me(V,O))})}finally{Cn=B}Gc(this,z);let{onMount:ie}=O;if(Rr(ie))queueMicrotask(()=>ie(O,this))}disconnectedCallback(){let y=this._state;if(y&&Rr(y.onUnmount))y.onUnmount(y)}adoptedCallback(){let y=this._state;if(y&&Rr(y.onAdopted))y.onAdopted(y)}attributeChangedCallback(y,w,T){if(!this._state||w===T)return;zi(this._state,y,T,Hc(Ft.get(p)?.doc??m))}};customElements.define(p,E)}function Qi(o,a,c,d){let p=document.createElement(Kr(o.tagName,a));if(c?.onNodeCreated)c.onNodeCreated(p,d??[],o,a);for(let[h,g]of Object.entries(o.$props??{})){if($n(h,"$props"))continue;let E=(y)=>{Vr(p)[h]=e(y)?jr(p.tagName,h,y):y};if(r(g)){let y=g;E(Se(y.$ref,a)),be(()=>{E(Se(y.$ref,a))})}else if(l(g))be(()=>{E(We(g,a))});else E(g)}if(o.style)Br.set(p,o.style);Dn(p,o.style??{},Jn(a),a),In(p,o.attributes??{},a),Wr(p,o,a);let m=Array.isArray(o.children)?o.children:[];for(let h=0;h<m.length;h++){let g=m[h],E=c&&d?{...c,_path:[...d,"children",h]}:void 0;if(S(g))_r(p,g,a,E);else p.append(Me(g,a,E))}return p}function zc(o){return o.nodeType===Node.ELEMENT_NODE}function Gc(o,a){let c=o.querySelectorAll("slot");if(c.length===0)return;let d=new Map,p=[];for(let m of a)if(zc(m)&&m.getAttribute("slot")){let h=m.getAttribute("slot"),g=d.get(h);if(!g)g=[],d.set(h,g);g.push(m)}else p.push(m);for(let m of c){let h=m.getAttribute("name"),g=h?d.get(h)??[]:p;m.replaceWith(...g.length>0?g:[...m.childNodes])}}function Xc(o,a){if(!e(a)||a==="")return o;let c=o.indexOf("#"),d=c===-1?"":o.slice(c),p=c===-1?o:o.slice(0,c),m=p.indexOf("?"),h=m===-1?p:p.slice(0,m),E=(m===-1?[]:p.slice(m+1).split("&")).filter((y)=>y!==""&&!Zc(y));return E.push(`v=${encodeURIComponent(a)}`),`${h}?${E.join("&")}${d}`}function Zc(o){let a=o.indexOf("="),c=a===-1?o:o.slice(0,a);if(c==="v")return!0;if(!c.includes("%"))return!1;try{return decodeURIComponent(c)==="v"}catch{return!1}}function Qc(o,a){if(!o||!Object.hasOwn(o,a))return;let c=o[a];return e(c)?c:void 0}function Kt(o,a){if(!a||o==="")return null;if(a.space==="repo"){if(!a.fileBaseUrl)return null;let d=Di(o,a.documentDir,a.mounts,a.lanes);if(d===null)return null;let{suffix:p}=jt(o);return Xc(`${a.fileBaseUrl}${Li(d)}${p}`,Qc(a.versions,d))}let[c]=a.mounts;return c?eu(o,a.documentDir,c):null}function eu(o,a,c){if(Ar(o))return null;let{path:d,suffix:p}=jt(o),m;try{m=decodeURIComponent(d)}catch{return null}let h=Nr(a,m);if(h===null)return null;let g=Ji([c],h);if(!g)return null;return`${g}${p}`}function nt(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function tu(o,a){if(!a)return!1;return o.length<=a.length&&o.every((c,d)=>a[d]===c)}function Rs(o,a,c){let d=c.layoutWrapped&&n(a)?a.$__layout:void 0;if(d){let m=i(d)?d:{},{file:h,path:g}=m;return{chrome:o.length>0&&!tu(o,c.pageContentPrefix),kind:"layout",layoutFile:e(h)?h:"",layoutPath:Array.isArray(g)?g:[]}}let p=o;if(c.layoutWrapped&&c.pageContentPrefix){let m=c.pageContentPrefix;if(o.length>=m.length&&m.every((h,g)=>o[g]===h)){let h=o.slice(m.length),[g]=h;p=s(g)?["children",g-(c.pageContentOffset??0),...h.slice(1)]:["children",...h]}}if(c.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let h=1;h<p.length-1;h++)if(p[h]==="children"&&p[h+1]===0&&c.arrayPaths.has(p.slice(0,h).join("/"))){p=[...p.slice(0,h),"map",...p.slice(h+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function ge(o){return JSON.parse(o)}function $s(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function jn(o,a){let c=o instanceof Element?o:o?.parentElement??null;while(c){if(c instanceof HTMLElement){if(c.dataset.jxPath&&a(c))return{el:c,path:ge(c.dataset.jxPath)};if($s(c))return null}c=c.parentElement}return null}function Hn(o,a){let c=o.querySelector(nt(ae(a)));return c instanceof HTMLElement?c:null}function zr(o){return o.textContent.length}function nu(o,a,c){if(!o.contains(a))return null;let d=o.ownerDocument.createRange();d.setStart(o,0);try{d.setEnd(a,c)}catch{return null}return d.toString().length}function ru(o,a){let c=Math.max(0,Math.min(a,zr(o))),d=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,h=d.nextNode();while(h){let g=h.length;if(p+g>=c)return{node:h,offset:c-p};p+=g,m=h,h=d.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function Ut(o,a,c){let d=jn(o,c);if(!d||!o)return null;let p=nu(d.el,o,a);return p===null?null:{offset:p,path:d.path}}function Gr(o,a){let c=Hn(o,a.path);return c?ru(c,a.offset):null}function Os(o){return o.offset<=0}function qt(o,a){return ae(o.path)===ae(a.path)}function Yr(o,a){let c=[];for(let d of o.querySelectorAll("[data-jx-path]"))if(a(d)&&!ou(d,o))c.push(d);return c}function ou(o,a){let c=o.parentElement;while(c&&c!==a){if($s(c))return!0;c=c.parentElement}return!1}function ks(o,a,c,d){let p=Yr(o,d),m=ae(a),h=p.findIndex((E)=>E.dataset.jxPath===m),g=h===-1?void 0:p[h+c];return g?{el:g,path:ge(g.dataset.jxPath)}:null}var Xr="jx-site-style";function Ms(o,a,c,d){let p=[],m=(w,T)=>{let C={mediaQueries:a,scope:T,transposeValue:c};if(d)C.resolveValue=(_,O)=>d(_,O,T);for(let _ of It(w,C))p.push(_.text)},h={},g={},E=[],y=[];for(let[w,T]of Object.entries(o)){if(n(T)&&!Array.isArray(T)){if(w.startsWith("@"))E.push([w,T]);else if(!w.startsWith("--"))y.push([w,T]);continue}if(Lt(w)||w.startsWith("@"))continue;if(w.startsWith("--")||w==="colorScheme"||w==="color-scheme")h[w]=T;else g[w]=T}m(h,":root"),m(g,"body");for(let[w,T]of y)if(w.startsWith("&"))m({[w]:T},":root");else m(T,w);for(let[w,T]of E){if(_t(w)||Dt(w)){m({[w]:T},null);continue}let C={},_={},O=[];for(let[K,k]of Object.entries(T)){if(n(k)&&!Array.isArray(k)){if(!K.startsWith("@"))O.push([K,k]);continue}if(K.startsWith("--"))C[K]=k;else _[K]=k}m({[w]:C},":root"),m({[w]:_},"body");for(let[K,k]of O)m({[w]:k},K)}if(Object.values(a).some((w)=>vn(w)!==null)&&!("colorScheme"in o))p.push(":root { color-scheme: light dark }",`:root:where([${Ge}="light"]) { color-scheme: light }`,`:root:where([${Ge}="dark"]) { color-scheme: dark }`);return p.join(`
|
|
10
|
-
`)}async function
|
|
7
|
+
`)};return{detach(){o.remove()},insert(f){let p={rules:[],texts:f};return a.push(p),d(),p},remove(f){let p=a.indexOf(f);if(p!==-1)a.splice(p,1),d()},replaceAll(f){a.length=0,a.push({rules:[],texts:f}),d()},text(){return o.textContent}}}function Hs(o){let d=o.defaultView?.CSSStyleSheet;if(t(d)&&Array.isArray(o.adoptedStyleSheets))try{let p=new d;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],ts(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let f=o.createElement("style");return f.dataset.jxSheet="",(du(o)??o.documentElement).append(f),f.sheet?ts(f.sheet,()=>f.remove()):uu(f)}function du(o){return o.head}var zt=new WeakMap;function fu(o){let a=zt.get(o);if(a)return a;let d={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:Hs(o)};return zt.set(o,d),d}var On=new WeakMap,ns="\x01jx-scope\x01";function Fs(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function rs(o,a,d){let f=a.get(d);if(f.refs-=1,f.refs<=0)a.delete(d),o.shared.remove(f.inserted)}function os(o,a,d,f){let p=a.get(d);if(p){p.refs+=1;return}a.set(d,{inserted:o.shared.insert(f),refs:1})}function kn(o,a){let d=On.get(o);if(!d||a!==void 0&&d!==a)return;On.delete(o),d.stop?.();for(let p of d.vars)o.style.removeProperty(p);if(delete o.dataset.jx,zt.get(d.doc)!==d.state)return;let{state:f}=d;if(d.interned===null){if(f.scratchOwners.delete(o))Fs(f)}else rs(f,f.interned,d.interned);for(let p of d.hoisted)rs(f,f.hoisted,p)}function Vs(o=document){let a=zt.get(o);if(!a)return;zt.delete(o);for(let d of a.scratchOwners.keys())On.delete(d),delete d.dataset.jx;a.scratchOwners.clear(),a.interned.clear(),a.hoisted.clear(),a.shared.detach(),a.scratch?.detach()}function pu(o){return n(o)&&"display"in o}var Xr=new WeakMap;function Ws(o,a){if(!a)return o;let d={...o};for(let[f,p]of Object.entries(a)){let m=d[f];d[f]=F(p)&&n(m)?Ws(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return d}function Fn(o,a,d={},f={}){Bs(o,a,d,f,!1)}function Vn(o,a,d={},f={}){Bs(o,a??{},d,f,!0)}function Bs(o,a,d,f,p){kn(o);let m=o.ownerDocument,g=fu(m),h=(Kr||Ur)&&Hr(o)?(_)=>Rr(_,{dialog:o.tagName==="DIALOG"}):(_)=>_,y=-1,E=0,C=[],T=Bt(a,{mediaQueries:d,resolveValue:(_,Y,q)=>{if(q==="self"&&_.startsWith("--"))return C.push({name:_,value:Y}),null;let G;if(q==="self")G=`--jx-s${E}`;else{if(y<0)({serial:y}=g),g.serial+=1;G=`--jx-r${y}-${E}`}return E+=1,C.push({name:G,value:Y}),`var(${G})`},scope:ns,transposeSelector:h,transposeValue:$n});if(T.length===0&&C.length===0)return;let A=T.filter((_)=>_.target!=="unscoped"),H=T.filter((_)=>_.target==="unscoped");for(let _ of H)os(g,g.hoisted,_.text,[_.text]);let k=`jx-${Ft(A.map((_)=>_.key).join("|"))}`,K=A.map((_)=>_.text.replaceAll(ns,`[data-jx="${k}"]`));if(K.length>0)if(o.dataset.jx=k,p)g.scratch??=Hs(m),g.scratchOwners.set(o,K),Fs(g);else os(g,g.interned,k,K);let L={doc:m,hoisted:H.map((_)=>_.text),interned:K.length>0&&!p?k:null,state:g,stop:null,uid:k,vars:C.map((_)=>_.name)};if(C.length>0){let _=pt();_.run(()=>{for(let{name:Y,value:q}of C)we(()=>{let G=r(q)?Se(q.$ref,f):Ye(q,f);o.style.setProperty(Y,$n(String(G??"")))})}),L.stop=()=>_.stop()}On.set(o,L),Sn(()=>kn(o,L),!0)}var mu=new Set(["contenteditable","draggable","spellcheck"]);function hu(o,a){let d=o.toLowerCase();if(d.startsWith("aria-")||mu.has(d))return String(a);return a?"":null}function Wn(o,a,d){for(let[f,p]of Object.entries(a)){let m=Wc(o,f),g=(h)=>{if(h===null||h===void 0){o.removeAttribute(m);return}if(x(h)){let y=hu(m,h);if(y===null)o.removeAttribute(m);else o.setAttribute(m,y);return}o.setAttribute(m,qr(o.tagName,f,String(h)))};if(r(p))we(()=>g(Se(p.$ref,d)));else if(c(p))In(p,()=>g(Ms(p,d)));else g(p)}}function Vr(o,a,d,f){let p=f?._path??[],m=document.createComment("jx-array");o.append(m);let{items:g,map:h,filter:y,sort:E,key:C}=a,T=r(C)?C.$ref:null,A=yt,H=!1,k=(B)=>{if(!H)H=!0,console.warn(`Jx $map: ${B}`)},K=[],L=(B)=>{B.node.remove(),B.scope.stop()},_=(B,re,X)=>{let ce=xi({index:X,item:re}),ee=Gr(d);ee.$map=ce,Object.defineProperty(ee,"$map/item",{enumerable:!0,get:()=>ce.item}),Object.defineProperty(ee,"$map/index",{enumerable:!0,get:()=>ce.index});let ne=pt(!0),ve=f?{...f,_path:[...p,"map",X]}:void 0,V=ne.run(()=>Oe(h,ee,ve));return{key:B,map:ce,node:V,scope:ne}},Y=(B,re)=>{let X=new Map;for(let ne of K)X.set(ne.key,ne);let ce=[];for(let ne=0;ne<B.length;ne++){let ve=re[ne],V=B[ne],N=X.get(ve);if(N){if(X.delete(ve),N.map.item!==V)N.map.item=V;if(N.map.index!==ne)N.map.index=ne,f?.onNodeMoved?.(N.node,[...p,"map",ne]);ce.push(N)}else ce.push(_(ve,V,ne))}for(let ne of X.values())L(ne);let ee=K.find((ne)=>!X.has(ne.key))?.node??m;for(let ne of ce){if(ne.node===ee){ee=ee.nextSibling??m;continue}ee.before(ne.node)}K=ce},q=()=>{let B=r(g)?Se(g.$ref,d):g;if(Array.isArray(B)&&r(y)){let ee=Se(y.$ref,d);if(t(ee))B=B.filter(ee)}if(Array.isArray(B)&&r(E)){let ee=Se(E.$ref,d);if(t(ee)){let ne=ee;B=[...B].toSorted(ne)}}let re=Array.isArray(B)&&h?B:[],X=re.map((ee,ne)=>gu(T,ee,ne,k)),ce=new Set;for(let ee=0;ee<X.length;ee++)if(ce.has(X[ee]))k(`duplicate key ${String(X[ee])} — every occurrence after the first is rebuilt on each change`),X[ee]={duplicate:ee};else ce.add(X[ee]);Dt();try{Jn(Wr(A),()=>Y(re,X))}finally{Lt()}},G=!1,U=!1,M=we(q,{scheduler:()=>{if(G)return;G=!0,queueMicrotask(()=>{if(G=!1,!U)M()})}});Sn(()=>{U=!0;for(let B of K)L(B);K=[]},!0)}function gu(o,a,d,f){if(o===null)return d;if(o==="$map/item")return a;if(o.startsWith("$map/item/")){let p=he(a,o.slice(10));if(p===void 0||p===null)return f(`key "${o}" is empty for some items — those rows fall back to their index`),d;return p}return f(`key "${o}" is not a $map/item pointer — rows fall back to their index`),d}function Zr(o,a){if(e(o))return o;if(!J(o))return"div";let d=o.$expression;if(d.operator==="?:")return rt(d.target,a,null)?d.value:d.initial;let f=rt(d.target,a,null);return d.cases[String(f)]??d.default}function xu(o,a,d){let f=d?._path??[],p=document.createElement(Zr(o.tagName,a)),m=yt;if(d?.onNodeCreated)d.onNodeCreated(p,f,o,a);Yr(p,o,a),Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a);let g=0,h=null,y=null,E=()=>{h?.stop(),h=null};return we(()=>{if(!r(o.$switch)){p.replaceChildren(),E(),g+=1;return}let C=String(Se(o.$switch.$ref,a));if(C===y)return;y=C,p.replaceChildren(),E(),g+=1;let T=o.cases?.[C];if(!T)return;let A=g,H=pt(!0);h=H;let k=d?{...d,_path:[...f,"cases",C]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,d?._ctx?.base??location.href);Br(K,d?._ctx).then(async(L)=>{if(A!==g)return;let _=await Ln(L,{},K,d?._ctx);if(A!==g)return;p.replaceChildren(),Jn(Wr(m),()=>H.run(()=>p.append(Oe(L,_,k))))}).catch((L)=>console.error("Jx $switch: failed to load external case",T.$ref,L));return}Dt();try{Jn(Wr(m),()=>H.run(()=>p.append(Oe(T,a,k))))}finally{Lt()}}),Sn(E,!0),p}var Mn=ze;async function yu(o,a,d,f,p){if(o.$src)return Su(o,a,d,f);switch(o.$prototype){case"Request":{let m=ze(null),g=o.debounce??0,h=null;if(!o.manual&&!(p?.skipAutoRequests??xs.skip))we(()=>{let y;if(c(o.url))y=Ye(o.url,a);else({url:y}=o);if(!y||y==="undefined"||y.includes("undefined"))return;let E=new AbortController;vn(()=>{if(E.abort(),h!==null)clearTimeout(h)});let C=()=>fetch(y,{method:o.method??"GET",signal:E.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}});if(g>0)h=setTimeout(C,g);else C()});return m}case"URLSearchParams":return jt(()=>{let m={};for(let[g,h]of Object.entries(o))if(g!=="$prototype")m[g]=r(h)?Se(h.$ref,a):c(h)?Ye(h,a):h;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,g=o.key??d,h;try{let E=m.getItem(g);h=E!==null?JSON.parse(E):o.default??null}catch{h=o.default??null}let y=Mn(h);return we(()=>{let E=y.value;if(E===null)try{m.removeItem(g)}catch{}else try{m.setItem(g,JSON.stringify(E))}catch{}}),y}case"Cookie":{let m=o.name??d,h=Mn((()=>{let y=Ui(document.cookie,m);if(y===null)return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}})()??o.default??null);return we(()=>{document.cookie=qi(m,h.value,o)}),h}case"IndexedDB":{let m=ze(null),{database:g,store:h,version:y=1,keyPath:E="id",autoIncrement:C=!0,indexes:T=[]}=o;if(!g||!h)throw Error(`Jx: IndexedDB entry '${d}' requires database and store`);let A=indexedDB.open(g,y);return A.addEventListener("upgradeneeded",(H)=>{let k=H.target.result;if(!k.objectStoreNames.contains(h)){let K=k.createObjectStore(h,{autoIncrement:C,keyPath:E});for(let L of T)K.createIndex(L.name,L.keyPath,{unique:L.unique??!1})}}),A.addEventListener("success",(H)=>{let k=H.target.result;m.value={database:g,getStore:(K="readwrite")=>Promise.resolve(k.transaction(h,K).objectStore(h)),isReady:!0,store:h,version:y}}),A.addEventListener("error",()=>{m.value={error:A.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(s(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[g,h]of Object.entries(o.fields??{}))m.append(g,h);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${d}". Did you mean to add '$src'?`),ze(null)}}var bu=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function Qr(o){let a={};for(let[d,f]of Object.entries(o))if(!bu.has(d))a[d]=f;return a}async function Su(o,a,d,f){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return Eu(o,a,d,f)}async function vu(o,a,d,f){let p,m=zr(a);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await ht(a)}catch{if(f){let C=new URL(a,f).href;p=await ht(C)}else throw Error(`Failed to import "${a}"`)}St.set(a,p)}let g=p[d]??p.default?.[d];if(!g)throw Error(`Jx: export "${d}" not found in "${a}"`);if(!t(g))throw TypeError(`Jx: "${d}" from "${a}" is not a class`);let h=new g(Qr(o)),y=t(h.resolve)?await h.resolve():("value"in h)?h.value:h,E=Mn(y);if(t(h.subscribe))h.subscribe((C)=>{E.value=C});return E}async function Eu(o,a,d,f){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return Nn(o,a,d,f);try{let T=f?new URL(p,f).href:p,A=await fetch(T);if(!A.ok)throw Error(`HTTP ${A.status}`);m=await A.json()}catch{return Nn(o,a,d,f)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return Nn(o,a,d,f);let A=f?new URL(p,f).href:new URL(p,location.href).href,H=new URL(m.$implementation,A).href,k=o.$export??m.title??o.$prototype;try{return await vu(o,H,k,f)}catch{return Nn(o,a,d,f)}}let y=new(Tu(m))(Qr(o)),E=t(y.resolve)?await y.resolve():("value"in y)?y.value:y,C=Mn(E);if(t(y.subscribe))y.subscribe((T)=>{C.value=T});return C}function wu(o){return n(o)}function Tu(o){let a=o.$defs?.fields??{},d=o.$defs?.constructor,f=wu(d)?d:void 0,p=o.$defs?.methods??{};class m{constructor(g={}){for(let[h,y]of Object.entries(a)){let E=y.identifier??h,C=y.access==="private"?`_${E}`:E;if(g[E]!==void 0)this[C]=g[E];else if(y.initializer!==void 0)this[C]=y.initializer;else if(y.default!==void 0)this[C]=structuredClone(y.default);else this[C]=null}if(f?.body){let h=Array.isArray(f.body)?f.body.join(`
|
|
8
|
+
`):f.body;Function("config",h).call(this,g)}}}for(let[g,h]of Object.entries(p)){let y=h.identifier??g,E=(h.parameters??[]).map((T)=>{if(T.$ref)return T.$ref.split("/").pop()??"";let A=T.identifier??T.name;return e(A)?A:"arg"}),C=Array.isArray(h.body)?h.body.join(`
|
|
9
|
+
`):h.body??"";if(h.role==="accessor"){let T={};if(h.getter)T.get=Function(h.getter.body??"");if(h.setter){let A=(h.setter.parameters??[]).map((H)=>H.$ref?.split("/").pop()??"v");T.set=Function(...A,h.setter.body??"")}Object.defineProperty(m.prototype,y,{...T,configurable:!0})}else if(h.scope==="static")m[y]=Function(...E,C);else m.prototype[y]=Function(...E,C)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function Nn(o,a,d,f){let p=Qr(o),m=Object.values(p).some((y)=>c(y)),g=(y)=>fetch(Ss("/__jx_resolve__"),{body:JSON.stringify({$base:f,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...y}),headers:{"Content-Type":"application/json"},method:"POST"}).then((E)=>{if(!E.ok)throw Error(`Jx dev proxy ${E.status} for "${d}"`);return E.json()}),h=ze(null);if(m)we(()=>{let y={};for(let[E,C]of Object.entries(p))y[E]=c(C)?Ye(C,a):C;g(y).then((E)=>{h.value=E}).catch((E)=>console.error("Jx dev proxy:",E))});else g(p).then((y)=>{h.value=y}).catch((y)=>console.error("Jx dev proxy:",y));return h}function Ks(o,a,d){let f=0;return(p)=>{f+=1;let m=f;new Promise((g)=>{g(a(p))}).then((g)=>{if(m===f)o.value=g}).catch((g)=>{if(m===f)console.error(d,g)})}}async function Cu(o,a,d,f){let{$src:p,$export:m}=o,g=Ds.has(p)?zr(p):void 0;if(!g)return Au(o,a,d,f);let h=g instanceof Promise?await g:g,y=h[m]??h.default?.[m];if(!y)throw Error(`Jx: export "${m}" not found in "${p}" for "${d}"`);if(!t(y))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let E=y,C=o.arguments??{},T=Object.values(C).some((k)=>r(k)),A=()=>{let k={};for(let[K,L]of Object.entries(C))k[K]=r(L)?Se(L.$ref,a):L;return k},H=ze(null);if(T){let k=Ks(H,E,"Jx server function:");we(()=>{let K=A();vn(()=>{}),k(K)})}else H.value=await E(A());return H}async function Au(o,a,d,f){let p=o.arguments??{},m=Object.values(p).some((C)=>r(C)),g=()=>{let C={};for(let[T,A]of Object.entries(p))C[T]=r(A)?Se(A.$ref,a):A;return C},h=(C)=>fetch(Ss("/__jx_server__"),{body:JSON.stringify({$base:f,$export:o.$export,$src:o.$src,arguments:C}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${d}"`);return T.json()}),y=ze(null),E=Ks(y,h,"Jx server proxy:");if(m)we(()=>{let C=g();vn(()=>{}),E(C)});else E(g());return y}function Se(o,a){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let d=(o.startsWith("#/")?o.slice(2):o).split("/"),[,f]=d,m=a.$map?.[f]??a[`$map/${f}`];return d.length>2?he(m,d.slice(2).join("/")):m}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function is(o,a,d,f){let p=a.replaceAll(/-([a-z])/g,(g,h)=>h.toUpperCase()),m=o[p];if(x(m)){o[p]=d!==null&&d!=="false";return}if(d===null){let g=f?.get(p);o[p]=g===void 0?i(m)?0:"":g;return}o[p]=i(m)?Number(d):d}function ss(o){let a=new Map;for(let[d,f]of Object.entries(o.state??{})){if(n(f)){if("default"in f){a.set(d,f.default);continue}if(Pu.some((p)=>(p in f)))continue}a.set(d,f)}return a}var Pu=["$expression","$prototype","$ref","$src"],as=new Set;function Nu(o,a){if(Object.hasOwn(o,a))return!0;if(o.hasAttribute(a))return!0;let d=a.replaceAll(/[A-Z]/gu,(f)=>`-${f.toLowerCase()}`);return d!==a&&o.hasAttribute(d)}function Ru(o,a){for(let d=Reflect.getPrototypeOf(o);d;d=Reflect.getPrototypeOf(d)){let f=Object.getOwnPropertyDescriptor(d,a);if(f)return f.set}return}function _n(o,a){if(!w(o))return!1;let d=a===void 0?o:`${a}:${o}`;if(!as.has(d))as.add(d),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${a===void 0?"":` (${a})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function $u(o,a){let d=Gr(a);for(let[f,p]of Object.entries(o.$props??{})){if(_n(f,"$props"))continue;d[f]=r(p)?Se(p.$ref,a):p}return d}var Us={},qt=new Map;async function qs(o,a){let d=a??location.href,{tagName:f}=o;if(!f||!f.includes("-"))throw Error(`Jx redefineElement: tagName "${f}" must contain a hyphen`);if(!customElements.get(f)){await Yt(o,d);return}if(o.$elements)await eo(o.$elements,d);let p=qt.get(f)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${f}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);qt.set(f,{base:d,doc:o})}function zs(o){Us=o??{}}async function eo(o,a,d){for(let f of o){if(e(f)){try{await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`)}catch(g){console.warn(`Jx: failed to import package "${f}"`,g)}continue}if(!r(f))continue;let{href:p}=new URL(f.$ref,a),m=await Br(p,d);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await eo(m.$elements,p,d);await Yt(m,p)}}var ls=32,Ou={expansion:0,frames:[]},yt=Ou;function Ir(o,a,d){if(!o.isConnected)return;console.error(`Jx: <${a}> was not rendered:`,d),o.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:d,message:d.message}))}function Jn(o,a){let d=yt;yt=o;try{return a()}finally{yt=d}}function Wr(o){return{expansion:o.frames.length,frames:o.frames}}function ku(o,a){if(Object.is(o,a))return!0;if(!cs(o)||!cs(a))return!1;try{return JSON.stringify(o)===JSON.stringify(a)}catch{return!1}}function cs(o){if(!n(o))return!1;let a=le(o);if(Array.isArray(a))return!0;let d=Object.getPrototypeOf(a);return d===Object.prototype||d===null}function Mu(o,a){if(o.tag!==a.tag)return!1;let d=Object.keys(o.props);if(d.length!==Object.keys(a.props).length)return!1;return d.every((f)=>Object.hasOwn(a.props,f)&&ku(o.props[f],a.props[f]))}function _u(o,a){let d=[...o.frames.map((f)=>f.tag),a.tag].join(" → ");if(o.frames.slice(o.expansion).some((f)=>Mu(f,a)))throw Error(`Component <${a.tag}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=ls)throw Error(`Component nesting exceeds ${ls} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,a]}}var us=new Set;async function Yt(o,a){let d=a,f;if(e(o)){if(d=new URL(o,d??location.href).href,us.has(d))return;us.add(d),f=await Br(o)}else f=o;d??=location.href;let{tagName:p}=f;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(f.$elements)await eo(f.$elements,d);qt.set(p,{base:d,doc:f});let m=f,g=d,h=m.observedAttributes??[],y=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return h}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let E=yt,C={},T=qt.get(p)??{base:g,doc:m},{doc:A,base:H}=T,k=await Ln(A,{},H,{base:H,media:null,root:this});for(let N of h)if(this.hasAttribute(N))is(k,N,this.getAttribute(N)),C[N]=this.getAttribute(N);let K=this.dataset.jxProps;if(K){try{let N=JSON.parse(K),z=n(N)||e(N)?Object.entries(N):[];for(let[Q,de]of z){if(_n(Q,"data-jx-props"))continue;if(Q in(A.state??{}))k[Q]=de,C[Q]=de}}catch{}delete this.dataset.jxProps}let L=this.getAttributeNames().filter((N)=>N.startsWith("props.")&&N.length>6);for(let N of L){let z=N.slice(6);if(_n(z,"props.* attribute")){this.removeAttribute(N);continue}if(z in(A.state??{}))k[z]=this.getAttribute(N),C[z]=this.getAttribute(N),this.removeAttribute(N)}for(let N of Object.keys(A.state??{})){if(w(N))continue;let z=Hn(this);if(N in this&&z[N]!==void 0&&Nu(this,N))k[N]=z[N],C[N]=z[N]}let _;try{_=_u(E,{props:C,tag:p})}catch(N){this.replaceChildren(),Ir(this,p,N instanceof Error?N:Error(String(N)));return}for(let N of Object.keys(A.state??{})){if(w(N))continue;let z=Ru(this,N);Object.defineProperty(this,N,{configurable:!0,get:()=>k[N],set:(Q)=>{z?.call(this,Q),k[N]=Q}})}this._state=k;let Y=Lu(this);this.replaceChildren();let q=A.style,G=q&&pu(q)?q:{display:"block",...q},U=Ws(G,Xr.get(this));if(Fn(this,U,jn(k),k),Wn(this,A.attributes??{},k),cu(this,A,k),!Array.isArray(A.children)&&A.textContent!==void 0)js(this,"textContent",A.textContent,k);let M=Array.isArray(A.children)?A.children:[],B=()=>{let N=Rn;Rn||=this.dataset.jxPath!==void 0;let z=null;try{Jn(_,()=>{for(let Q of M)this.append(Oe(Q,k))})}catch(Q){z=Q instanceof Error?Q:Error(String(Q))}finally{Rn=N}return ju(this,Y),z},re=()=>{let{onMount:N}=k;if(Dr(N))queueMicrotask(()=>N.call(this,k,this))},X=bt(B),ce=X.result;if(!ce){re();return}Ir(this,p,ce);let ee=[...ss(A).keys()].filter((N)=>!w(N)),ne=ce.message,ve=!1,V=we(()=>{for(let N of ee)k[N]},{scheduler:()=>{if(ve)return;ve=!0,queueMicrotask(()=>{if(ve=!1,!this.isConnected){V.effect.stop();return}V(),X.stop(),this.replaceChildren(),Dt();try{X=bt(B)}finally{Lt()}let N=X.result;if(!N)V.effect.stop(),re();else if(N.message!==ne)ne=N.message,Ir(this,p,N)})}})}disconnectedCallback(){let E=this._state;if(E&&Dr(E.onUnmount))E.onUnmount(E)}adoptedCallback(){let E=this._state;if(E&&Dr(E.onAdopted))E.onAdopted(E)}attributeChangedCallback(E,C,T){if(!this._state||C===T)return;is(this._state,E,T,ss(qt.get(p)?.doc??m))}};customElements.define(p,y)}function ds(o,a,d,f){let p=document.createElement(Zr(o.tagName,a));if(d?.onNodeCreated)d.onNodeCreated(p,f??[],o,a);for(let[g,h]of Object.entries(o.$props??{})){if(_n(g,"$props"))continue;let y=(E)=>{let C=e(E)?qr(p.tagName,g,E):E;Hn(p)[g]=C;let T=ou(p);if(T&&g in HTMLElement.prototype&&Object.hasOwn(le(T),g))T[g]=C};if(r(h)){let E=h;y(Se(E.$ref,a)),we(()=>{y(Se(E.$ref,a))})}else if(c(h))In(h,()=>{y(Ye(h,a))});else y(h)}if(o.style)Xr.set(p,o.style);Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a),Yr(p,o,a);let m=Array.isArray(o.children)?o.children:[];for(let g=0;g<m.length;g++){let h=m[g],y=d&&f?{...d,_path:[...f,"children",g]}:void 0;if(S(h))Vr(p,h,a,y);else p.append(Oe(h,a,y))}return p}function Gs(o){return o.nodeType===Node.ELEMENT_NODE}function Ys(o){return o.nodeType===Node.TEXT_NODE}function fs(o){return o.nodeType===Node.COMMENT_NODE}var Ju=/^[\t\n\f\r ]+$/u,ps="jx-slot",ms="data-jx-slots",Du="jx.slot.group",Ut=(()=>{let o=Symbol.for(Du),a=globalThis;return a[o]??=new WeakMap,a[o]})();function Lu(o){let a=o.getAttribute(ms);if(a===null)return[...o.childNodes];o.removeAttribute(ms);let d=`${ps} ${a} `,f=`/${ps} ${a}`,p=[],m=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_COMMENT);for(let h=m.nextNode();h;h=m.nextNode())if(fs(h)&&h.data.startsWith(d))p.push(h);let g=[];for(let h of p){let y=decodeURIComponent(h.data.slice(d.length));for(let E=h.nextSibling;E;E=E.nextSibling){if(fs(E)&&E.data===f)break;Ut.set(E,y),g.push(E)}}return g}function Iu(o){return o.some((a)=>Gs(a)||Ys(a)&&a.data!=="")}function ju(o,a){let d=[...o.querySelectorAll("slot")];if(d.length===0)return;let f=new Map;for(let m of a){if(Ys(m)&&Ju.test(m.data))continue;let g=Ut.get(m);Ut.delete(m);let h=g??(Gs(m)?m.getAttribute("slot")??"":""),y=f.get(h);if(!y)y=[],f.set(h,y);y.push(m)}let p=new Set;for(let m of d){let g=m.getAttribute("name")??"",h=[];if(!p.has(g))p.add(g),h=f.get(g)??[];let y=Iu(h)?h:[...h,...m.childNodes],E=m.parentElement;if(E&&E!==o&&E.localName.includes("-")){let C=Ut.get(m)??m.getAttribute("slot")??"";for(let T of y)Ut.set(T,C)}m.replaceWith(...y)}}function Fu(o,a){if(!e(a)||a==="")return o;let d=o.indexOf("#"),f=d===-1?"":o.slice(d),p=d===-1?o:o.slice(0,d),m=p.indexOf("?"),g=m===-1?p:p.slice(0,m),y=(m===-1?[]:p.slice(m+1).split("&")).filter((E)=>E!==""&&!Vu(E));return y.push(`v=${encodeURIComponent(a)}`),`${g}?${y.join("&")}${f}`}function Vu(o){let a=o.indexOf("="),d=a===-1?o:o.slice(0,a);if(d==="v")return!0;if(!d.includes("%"))return!1;try{return decodeURIComponent(d)==="v"}catch{return!1}}function Wu(o,a){if(!o||!Object.hasOwn(o,a))return;let d=o[a];return e(d)?d:void 0}function Xt(o,a){if(!a||o==="")return null;if(a.space==="repo"){if(!a.fileBaseUrl)return null;let f=Vi(o,a.documentDir,a.mounts,a.lanes);if(f===null)return null;let{suffix:p}=Kt(o);return Fu(`${a.fileBaseUrl}${Wi(f)}${p}`,Wu(a.versions,f))}let[d]=a.mounts;return d?Bu(o,a.documentDir,d):null}function Bu(o,a,d){if(Mr(o))return null;let{path:f,suffix:p}=Kt(o),m;try{m=decodeURIComponent(f)}catch{return null}let g=Jr(a,m);if(g===null)return null;let h=Fi([d],g);if(!h)return null;return`${h}${p}`}function ot(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function Ku(o,a){if(!a)return!1;return o.length<=a.length&&o.every((d,f)=>a[f]===d)}function Xs(o,a,d){let f=d.layoutWrapped&&n(a)?a.$__layout:void 0;if(f){let m=s(f)?f:{},{file:g,path:h}=m;return{chrome:o.length>0&&!Ku(o,d.pageContentPrefix),kind:"layout",layoutFile:e(g)?g:"",layoutPath:Array.isArray(h)?h:[]}}let p=o;if(d.layoutWrapped&&d.pageContentPrefix){let m=d.pageContentPrefix;if(o.length>=m.length&&m.every((g,h)=>o[h]===g)){let g=o.slice(m.length),[h]=g;p=i(h)?["children",h-(d.pageContentOffset??0),...g.slice(1)]:["children",...g]}}if(d.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let g=1;g<p.length-1;g++)if(p[g]==="children"&&p[g+1]===0&&d.arrayPaths.has(p.slice(0,g).join("/"))){p=[...p.slice(0,g),"map",...p.slice(g+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function ge(o){return JSON.parse(o)}function Zs(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function Bn(o,a){let d=o instanceof Element?o:o?.parentElement??null;while(d){if(d instanceof HTMLElement){if(d.dataset.jxPath&&a(d))return{el:d,path:ge(d.dataset.jxPath)};if(Zs(d))return null}d=d.parentElement}return null}function Kn(o,a){let d=o.querySelector(ot(ae(a)));return d instanceof HTMLElement?d:null}function to(o){return o.textContent.length}function Uu(o,a,d){if(!o.contains(a))return null;let f=o.ownerDocument.createRange();f.setStart(o,0);try{f.setEnd(a,d)}catch{return null}return f.toString().length}function qu(o,a){let d=Math.max(0,Math.min(a,to(o))),f=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,g=f.nextNode();while(g){let h=g.length;if(p+h>=d)return{node:g,offset:d-p};p+=h,m=g,g=f.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function Zt(o,a,d){let f=Bn(o,d);if(!f||!o)return null;let p=Uu(f.el,o,a);return p===null?null:{offset:p,path:f.path}}function no(o,a){let d=Kn(o,a.path);return d?qu(d,a.offset):null}function Qs(o){return o.offset<=0}function Qt(o,a){return ae(o.path)===ae(a.path)}function ro(o,a){let d=[];for(let f of o.querySelectorAll("[data-jx-path]"))if(a(f)&&!zu(f,o))d.push(f);return d}function zu(o,a){let d=o.parentElement;while(d&&d!==a){if(Zs(d))return!0;d=d.parentElement}return!1}function ea(o,a,d,f){let p=ro(o,f),m=ae(a),g=p.findIndex((y)=>y.dataset.jxPath===m),h=g===-1?void 0:p[g+d];return h?{el:h,path:ge(h.dataset.jxPath)}:null}var oo="jx-site-style",Gu={body:"body",root:":root"};function ta(o,a,d,f,p=Gu){let m=[],g=(T,A)=>{let H={mediaQueries:a,scope:A,transposeValue:d};if(f)H.resolveValue=(k,K)=>f(k,K,A);for(let k of Bt(T,H))m.push(k.text)},h={},y={},E=[],C=[];for(let[T,A]of Object.entries(o)){if(n(A)&&!Array.isArray(A)){if(T.startsWith("@"))E.push([T,A]);else if(!T.startsWith("--"))C.push([T,A]);continue}if(Wt(T)||T.startsWith("@"))continue;if(T.startsWith("--")||T==="colorScheme"||T==="color-scheme")h[T]=A;else y[T]=A}g(h,p.root),g(y,p.body);for(let[T,A]of C)if(T.startsWith("&"))g({[T]:A},p.root);else g(A,T);for(let[T,A]of E){if(Ht(T)||Vt(T)){g({[T]:A},null);continue}let H={},k={},K=[];for(let[L,_]of Object.entries(A)){if(n(_)&&!Array.isArray(_)){if(!L.startsWith("@"))K.push([L,_]);continue}if(L.startsWith("--"))H[L]=_;else k[L]=_}g({[T]:H},p.root),g({[T]:k},p.body);for(let[L,_]of K)g({[T]:_},L)}if(Object.values(a).some((T)=>Cn(T)!==null)&&!("colorScheme"in o))m.push(`${p.root} { color-scheme: light dark }`,`${p.root}:where([${Ge}="light"]) { color-scheme: light }`,`${p.root}:where([${Ge}="dark"]) { color-scheme: dark }`);return m.join(`
|
|
10
|
+
`)}async function Yu(o,a){let d=o.$elements;if(!Array.isArray(d))return;await Promise.all(d.map(async(f)=>{let p=(async()=>{if(e(f))await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`);else if(n(f)&&"$ref"in f)await Yt(new URL(String(f.$ref),a).href);else if(n(f))await Yt(f,a)})();try{await Promise.race([p,new Promise((m,g)=>{setTimeout(()=>g(Error("register timeout")),5000)})])}catch(m){console.warn("iframe canvas: failed to register element",JSON.stringify(f),m)}}))}var na="jx-canvas-edit-css",Xu=`
|
|
11
11
|
.empty-media-placeholder {
|
|
12
12
|
display: inline-block;
|
|
13
13
|
min-width: 120px;
|
|
@@ -96,7 +96,7 @@ var rr="jx:canvas";function Ho(o){let{target:a,source:c,targetOrigin:d,acceptOri
|
|
|
96
96
|
[data-jx-layout-region] [data-jx-layout-region]::before {
|
|
97
97
|
content: none;
|
|
98
98
|
}
|
|
99
|
-
`;function
|
|
99
|
+
`;function Zu(o,a){let d=o.head.querySelector(`#${na}`);if(a!=="design"&&a!=="edit"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=na,f.textContent=Xu,o.head.append(f)}var ra="jx-canvas-overlay-css",Qu=`
|
|
100
100
|
/* The UA rule a de-popovered element lost, re-supplied at UA-EQUIVALENT PRECEDENCE.
|
|
101
101
|
|
|
102
102
|
The cascade layer is the mechanism and it is the whole point. An unlayered author declaration
|
|
@@ -184,7 +184,7 @@ dialog[data-jx-dialog-open]::before {
|
|
|
184
184
|
letter-spacing: 0.08em;
|
|
185
185
|
pointer-events: none;
|
|
186
186
|
}
|
|
187
|
-
`;function
|
|
187
|
+
`;function ed(o,a){let d=o.head.querySelector(`#${ra}`);if(a==="preview"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=ra,f.textContent=Qu,o.head.append(f)}var oa="jx-canvas-diff-css",td=`
|
|
188
188
|
[data-jx-diff] {
|
|
189
189
|
position: relative;
|
|
190
190
|
border-left-width: 3px;
|
|
@@ -227,7 +227,7 @@ dialog[data-jx-dialog-open]::before {
|
|
|
227
227
|
border-left-color: CanvasText;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
`;function
|
|
230
|
+
`;function nd(o,a){let d=o.head.querySelector(`#${oa}`);if(!a){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=oa,f.textContent=td,o.head.append(f)}function rd(o,a){for(let d of o.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(d instanceof HTMLElement)delete d.dataset.jxDiff,delete d.dataset.jxDiffWithin;if(!a?.length)return;for(let d of a){let f=Kn(o,d.path);if(f){f.dataset.jxDiff=d.kind;continue}let{path:p}=d;while(p.length>=2){p=p.slice(0,-2);let m=Kn(o,p);if(m){m.dataset.jxDiffWithin="";break}}}}function od(o,a){o.documentElement.toggleAttribute("data-jx-preview",a==="preview")}function Un(o){return o==="design"||o==="edit"}function id(o,a){if(!Un(a)){o.removeAttribute("contenteditable"),o.removeAttribute("spellcheck"),o.removeAttribute("role"),o.removeAttribute("aria-multiline"),o.removeAttribute("aria-label");return}o.contentEditable="true",o.spellcheck=!0,o.setAttribute("autocorrect","off"),o.setAttribute("writingsuggestions","false"),o.setAttribute("draggable","false"),o.setAttribute("role","textbox"),o.setAttribute("aria-multiline","true"),o.setAttribute("aria-label","Document content")}var ia="jx-canvas-stylebook-css",sd=`
|
|
231
231
|
.sb-root {
|
|
232
232
|
padding: 16px;
|
|
233
233
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
|
@@ -271,6 +271,10 @@ dialog[data-jx-dialog-open]::before {
|
|
|
271
271
|
.element-card-preview > * {
|
|
272
272
|
max-width: 100%;
|
|
273
273
|
margin: 0;
|
|
274
|
+
}
|
|
275
|
+
/* A list keeps its inline-start padding: its markers are drawn in it, and with none they are
|
|
276
|
+
clipped by the card ("1." shows as "."). Every other specimen sits flush in its card. */
|
|
277
|
+
.element-card-preview > :not(ol, ul, menu) {
|
|
274
278
|
padding: 0;
|
|
275
279
|
}
|
|
276
280
|
.element-card-preview > hr {
|
|
@@ -306,10 +310,10 @@ dialog[data-jx-dialog-open]::before {
|
|
|
306
310
|
color: color-mix(in srgb, #808080 70%, transparent);
|
|
307
311
|
font-size: 13px;
|
|
308
312
|
}
|
|
309
|
-
`;function gu(o,a){let c=o.head.querySelector(`#${Ls}`);if(a!=="stylebook"){c?.remove();return}if(c)return;let d=o.createElement("style");d.id=Ls,d.textContent=hu,o.head.append(d)}function Zr(o,a={}){let c=document.head.querySelector(`#${Xr}`);if(!o||!n(o)){c?.remove();return}let d=Ms(o,a,An);if(c){c.textContent=d;return}let p=document.createElement("style");p.id=Xr,p.textContent=d,document.head.append(p)}function Qr(o,a){if(a)o.documentElement.dataset.colorScheme=a;else delete o.documentElement.dataset.colorScheme}function zt(o,a){for(let d of o.querySelectorAll("[data-jx-popover-open]"))delete d.dataset.jxPopoverOpen;if(a===null)return;let c=o.querySelector(`[data-jx-popover]${nt(a)}`);if(c)c.dataset.jxPopoverOpen=""}function yt(o,a){for(let d of o.querySelectorAll("[data-jx-dialog-open]"))delete d.dataset.jxDialogOpen;if(a===null)return;let c=o.querySelector(`dialog${nt(a)}`);if(c)c.dataset.jxDialogOpen=""}function xu(o,a=null){let c=o.$head;if(!Array.isArray(c))return;for(let d of c){if(!n(d)||!d.tagName)continue;let p=String(d.tagName).toLowerCase();if(p==="script"&&!d.attributes?.src)continue;let m={...d.attributes};for(let E of["href","src"]){let y=m[E];if(!e(y)||y==="")continue;if(!y.startsWith("/")&&!y.startsWith(".")&&!y.startsWith("http")){m[E]=`/node_modules/${y}`;continue}m[E]=Kt(y,a)??y}let h=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(h!==p&&document.head.querySelector(h))continue;let g=document.createElement(p);for(let[E,y]of Object.entries(m))g.setAttribute(E,String(y));if(d.textContent)g.textContent=String(d.textContent);document.head.append(g)}}function eo(o){let a=[],c=(d)=>a.some((p)=>d.length>p.length&&p.every((m,h)=>d[h]===m));return(d,p,m)=>{if(!(d instanceof HTMLElement))return;let h=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(h)d.dataset.jxDefinitionRoot="";let g=!h&&d.tagName.includes("-")&&Fn(o.canvasMode);if(g)d.contentEditable="false",a.push(p);let E=Rs(p,m,o);if(E.kind==="layout"){if(d.dataset.jxLayoutPath=ae(E.layoutPath),E.layoutFile)d.dataset.jxLayoutFile=E.layoutFile;if(E.chrome){if(d.dataset.jxLayoutRegion="",Fn(o.canvasMode))d.contentEditable="false"}return}if(d.dataset.jxPath=ae(E.path),!g&&Fn(o.canvasMode)&&c(p))d.contentEditable="true"}}function Is(o,a=3){let c=new WeakMap,d=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!m.src||m.src.startsWith("data:"))return;let h=(c.get(m)??0)+1;if(h>a)return;c.set(m,h),setTimeout(()=>{let g=m.src;m.src="",m.src=g},150*h)};return o.addEventListener("error",d,!0),()=>o.removeEventListener("error",d,!0)}async function js(o){let a=o.assets??null;Mn(a?(h)=>Kt(h,a):null),ts(o.mode!=="preview"),rs(o.mode!=="preview"&&!o.allowAutoRequests),ls(!0),us(o.mode!=="preview"&&o.mode!=="stylebook"),ds(o.mode!=="preview"),fs(o.mode!=="preview"),ms(o.mode==="design"||o.mode==="edit"),Zr(o.siteStyle,o.doc.$media??{}),xu(o.doc,a),au(o.container.ownerDocument,o.mode),cu(o.container.ownerDocument,o.mode),pu(o.container.ownerDocument,o.mode),gu(o.container.ownerDocument,o.mode),du(o.container.ownerDocument,Boolean(o.diffMarks?.length)),Ns(o.doc.$media??{}),await iu(o.doc,o.docBase);let c=await _n(o.doc,{},o.docBase),d=eo(o.mapperCtx),{result:p,stop:m}=kn(()=>Me(o.doc,c,{_path:[],onNodeCreated:d}));return o.container.replaceChildren(p),zt(o.container,o.popoverOpen??null),yt(o.container,o.dialogOpen??null),mu(o.container,o.mode),fu(o.container,o.diffMarks??null),{ctx:{defs:c,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:m}}function yu(o){return JSON.parse(JSON.stringify(o))}function Vn(o){return o===void 0||o===null?o:yu(o)}function xe(o,a){let c=o;for(let d of a){if(c==null)return;c=c[d]}return c}function Hs(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function to(o,a){let{op:c}=a;switch(a.op){case"set-key":{let d=xe(o,a.path);if(!d)throw Error(`doc-op-node-not-found:${a.path.join("/")}`);if(a.value===void 0)delete d[a.key];else d[a.key]=Vn(a.value);return}case"insert-child":{Gt(o,a.parentPath).splice(a.index,0,Vn(a.node));return}case"remove-child":{Gt(o,a.parentPath).splice(a.index,1);return}case"set-child":{Gt(o,a.parentPath).splice(a.index,1,Vn(a.node));return}case"move-child":{bu(a);let d=Gt(o,a.fromParentPath),p=Gt(o,a.toParentPath),[m]=d.splice(a.fromIndex,1);p.splice(a.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${c}`)}function Gt(o,a){let c=xe(o,a);if(c==null)throw TypeError(`doc-op-node-not-found:${a.join("/")}`);return Hs(c)}function bu(o){let a=[...o.fromParentPath,"children",o.fromIndex],c=o.toParentPath;if(c.length>=a.length&&a.every((d,p)=>d===c[p]))throw Error(`doc-op-move-into-self:${c.join("/")}`)}function Fs(o){return o.length>=2?o.slice(0,-2):null}function Vs(o){return o.at(-1)}function Ws(o,a){if(o===a)return!0;if(!o||!a||o.length!==a.length)return!1;return o.every((c,d)=>c===a[d])}function bt(o,a){if(o.length>a.length)return!1;return o.every((c,d)=>c===a[d])}var Wn=14,Su="empty-container-placeholder";function Bs(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}function vu(o){let a=getComputedStyle(o),{display:c}=a,d=c==="flex"||c==="inline-flex",p=c==="grid"||c==="inline-grid";return d&&a.flexDirection.startsWith("row")||p&&a.gridAutoFlow.startsWith("column")}function qs(o,a,c){let d=o.dataset.jxPath;if(d==null)return null;let p=ge(d);if(o.classList.contains(Su))return[{edge:"center",index:0,insertParentPath:p,rect:Bs(o)}];let m=Fs(p);if(!m)return null;let h=o.parentElement;if(!h)return null;let g=Vs(p);if(!s(g))return null;let E=Bs(o);if(vu(h)){let w=a.x-E.x;if(w<Wn)return[Bn("left",m,g,Ks(E,!0))];if(E.width-w<Wn)return[Bn("right",m,g+1,Us(E,!0))];return null}let y=a.y-E.y;if(y<Wn)return[Bn("top",m,g,Ks(E,!1))];if(E.height-y<Wn)return[Bn("bottom",m,g+1,Us(E,!1))];return null}function Bn(o,a,c,d){return{edge:o,index:c,insertParentPath:a,rect:d}}function Ks(o,a){return a?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function Us(o,a){return a?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function zs(o){if(!o||o.length===0)return"none";return o.map((a)=>`${a.edge}:${a.insertParentPath.join("/")}:${a.index}`).join("|")}var Kn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function no(o){return o.nodeType===Node.ELEMENT_NODE}function Gs(o){return o.nodeType===Node.TEXT_NODE}function Xs(o,a){if(!a)return!1;if(a.contentEditable==="plaintext-only")return!1;let c=window.getSelection();if(!c||!c.rangeCount)return!1;let{anchorNode:d,focusNode:p}=c;if(!d||!p)return!1;if(!a.contains(d)||!a.contains(p))return!1;let m=(h)=>{let g=h;while(g&&g!==a){if(no(g)&&g.tagName.toLowerCase()===o)return!0;g=g.parentNode}return!1};return m(d)&&m(p)}function Zs(o,a){if(!a)return;let c=window.getSelection();if(!c||!c.rangeCount)return;let d=c.getRangeAt(0);if(d.collapsed)return;if(!a.contains(d.commonAncestorContainer))return;Mu(d);let p=Eu(o,d,a);if(p.length>0)wu(o,d,a,p);else Tu(o,d,a);St(a)}function Eu(o,a,c){let d=[];for(let p of c.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&a.intersectsNode(p))d.push(p);return d}function wu(o,a,c,d){for(let p=d.length-1;p>=0;p--){let m=d[p];Qs(m)}}function Qs(o){if(!o.parentNode)return;let c=document.createDocumentFragment();while(o.firstChild)c.append(o.firstChild);o.replaceWith(c)}function Tu(o,a,c){let d=a.extractContents(),p=Cu(d),m=Au(d);if(!d.hasChildNodes()){if(p)a.insertNode(document.createTextNode(p));if(m){let y=document.createTextNode(m);a.collapse(!1),a.insertNode(y)}return}let h=document.createElement(o);h.append(d);let g=document.createDocumentFragment();if(p)g.append(document.createTextNode(p));if(g.append(h),m)g.append(document.createTextNode(m));a.insertNode(g);let E=window.getSelection();if(E){E.removeAllRanges();let y=document.createRange();y.selectNodeContents(h),E.addRange(y)}}function Cu(o){let a=o.firstChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let c=a.textContent??"",d=c.match(/^(\s+)/);if(!d)return null;let p=d[1];if(c.length===p.length)a.remove();else a.textContent=c.slice(p.length);return p}function Au(o){let a=o.lastChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let c=a.textContent??"",d=c.match(/(\s+)$/);if(!d)return null;let p=d[1];if(c.length===p.length)a.remove();else a.textContent=c.slice(0,-p.length);return p}function St(o){if(!o)return;let a=!0,c=0;while(a&&c<10){if(a=!1,c+=1,o.normalize(),Pu(o))a=!0;if(Nu(o))a=!0;if(Ru(o))a=!0;if($u(o))a=!0;if(Ou(o))a=!0}}function Pu(o){let a=!1,c=[];for(let d of o.querySelectorAll("*")){let p=d.nextSibling;if(p&&no(p)&&p.tagName===d.tagName&&Kn.has(d.tagName.toLowerCase())&&ku(d,p))c.push([d,p])}for(let d=c.length-1;d>=0;d--){let[p,m]=c[d];while(m.firstChild)p.append(m.firstChild);m.remove(),a=!0}return a}function Nu(o){let a=!1,c=[];for(let d of o.querySelectorAll("*")){if(!Kn.has(d.tagName.toLowerCase()))continue;let p=d.firstChild;if(d.childNodes.length===1&&p!==null&&no(p)&&p.tagName===d.tagName)c.push(d)}for(let d of c){let p=d.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),a=!0}return a}function Ru(o){let a=!1,c=[];for(let d of o.querySelectorAll("*")){if(!Kn.has(d.tagName.toLowerCase()))continue;if(d.childNodes.length===0&&!d.textContent)c.push(d)}for(let d of c)d.remove(),a=!0;return a}function $u(o){let a=!1,c=[];for(let d of o.querySelectorAll("*")){if(!Kn.has(d.tagName.toLowerCase()))continue;if(d===o)continue;let p=d.firstChild;if(p&&Gs(p)){let h=p.textContent,g=h.match(/^(\s+)/);if(g&&h.length>g[1].length)c.push({el:d,text:p,type:"lift-leading",ws:g[1]})}let m=d.lastChild;if(m&&Gs(m)&&m!==p){let h=m.textContent,g=h.match(/(\s+)$/);if(g&&h.length>g[1].length)c.push({el:d,text:m,type:"lift-trailing",ws:g[1]})}}for(let d of c){if(d.type==="lift-leading")d.text.textContent=d.text.textContent.slice(d.ws.length),d.el.parentNode?.insertBefore(document.createTextNode(d.ws),d.el);else d.text.textContent=d.text.textContent.slice(0,-d.ws.length),d.el.parentNode?.insertBefore(document.createTextNode(d.ws),d.el.nextSibling);a=!0}return a}function Ou(o){let a=!1,c=[];for(let d of o.querySelectorAll("*")){if(d.tagName.toLowerCase()!=="span")continue;if(d===o)continue;if(d.attributes.length>0)continue;c.push(d)}for(let d of c)Qs(d),a=!0;return a}function ku(o,a){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===a.getAttribute("href");return!0}function Mu(o){Ys(o,!0),Ys(o,!1)}function Ys(o,a){let c=a?o.startContainer:o.endContainer,d=a?o.startOffset:o.endOffset;if(c.nodeType!==Node.TEXT_NODE)return;let p=c.textContent??"",m=_u(p);for(let h of m)if(a){if(d>h.start&&d<h.end)o.setStart(c,h.start)}else if(d>h.start&&d<h.end)o.setEnd(c,h.end)}function _u(o){let a=[],c=0;while(c<o.length-1){if(o[c]==="$"&&o[c+1]==="{"){let d=c,p=1,m=c+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){a.push({end:m,start:d}),c=m;continue}}c+=1}return a}var Un=(o,a)=>document.execCommand(o,!1,a);function ea(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function ta(o){let a=window.getSelection();if(!a||!a.rangeCount)return{active:!1,href:null};let c=a.anchorNode;while(c&&c!==o){if(ea(c))return{active:!0,href:c.dataset.jxHref??c.getAttribute("href")};c=c.parentNode}return{active:!1,href:null}}function Ju(o){let a=window.getSelection();if(!a||!a.rangeCount)return null;let c=a.anchorNode;while(c&&c!==o){if(ea(c))return c;c=c.parentNode}return null}function na(o,a){let c=Ju(o);if(c)if(a)c.setAttribute("href",a);else{let d=document.createDocumentFragment();while(c.firstChild)d.append(c.firstChild);c.replaceWith(d)}else if(a)Un("createLink",a);St(o)}function ra(o,a){o.focus(),Un("insertText",`\${${a}}`)}var oa={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var ia=oa.$defs,Lu=new Set(["pre"]),Iu=new Set(Object.entries(ia).filter(([o,a])=>!Lu.has(o)&&(a.$inlineChildren?.length??0)>0).map(([o])=>o));function sa(o,a){return a?.[o.toLowerCase()]??Iu.has(o.toLowerCase())}var ju={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Xe=ju;function ro(o){Xe=o}var te=null,Ne=null,vt=null,Yt=null,Et=null,Ye=null,_e=!1,Zt="",Xt=!1,la=null;function ca(o){la=o}function rt(o){return sa(o.tagName,la)}function oo(o,a,c,d){if(te)Ie(!0);if(te=o,Ne=a,vt=c.onCommit,Yt=c.onSplit,Et=c.onInsert,Ye=c.onEnd,_e=d?.plainText===!0,Zt=_e?o.textContent:"",Xt=!1,o.dataset.jxActiveBlock="",_e){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",io),o.addEventListener("input",so),o.addEventListener("paste",ao)}function Ie(o=!1){if(!te)return;if(ga(!1),Xe.dismiss(),delete te.dataset.jxActiveBlock,_e)te.contentEditable="false";if(te.removeEventListener("keydown",io),te.removeEventListener("input",so),te.removeEventListener("paste",ao),te=null,Ne=null,vt=null,Yt=null,Et=null,_e=!1,Zt="",Xt=!1,o)Ye=null;else if(Ye){let a=Ye;Ye=null,a()}}function ua(){ga(!0)}function da(){return _e&&te!==null}function Je(){return te!==null}function wt(){return te}function fa(){return Ne}function pa(){return Xe.isOpen()}function io(o){if(_e){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),te)te.textContent=Zt;Ie();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Ie();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function so(){if(Xe.isOpen())uo()}function ao(o){o.preventDefault();let a=o.clipboardData?.getData("text/plain")??"";Un("insertText",a)}function ma(){if(!Yt||!te||!Ne)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let a=o.getRangeAt(0),c=document.createRange();c.setStart(te,0),c.setEnd(a.startContainer,a.startOffset);let d=document.createRange();d.setStart(a.endContainer,a.endOffset),d.setEnd(te,te.childNodes.length);let p=aa(c.cloneContents()),m=aa(d.cloneContents()),h=[...Ne],g=Yt;return ha(),g(h,p,m),!0}function ha(){if(!te)return;if(delete te.dataset.jxActiveBlock,_e)te.contentEditable="false";if(te.removeEventListener("keydown",io),te.removeEventListener("input",so),te.removeEventListener("paste",ao),te=null,Ne=null,vt=null,Yt=null,Et=null,_e=!1,Zt="",Xt=!1,Ye){let o=Ye;Ye=null,o()}}function ga(o){if(!vt||!te||!Ne)return;if(_e){let c=te.textContent.replaceAll(`
|
|
310
|
-
`," ");if(
|
|
311
|
-
`," ")&&!
|
|
312
|
-
`))requestAnimationFrame(()=>co())}function uo(){if(!te||!qn)return;let o=window.getSelection();if(!o||!o.rangeCount){Xe.dismiss();return}let a=o.getRangeAt(0),c=zn(a),d=c.lastIndexOf("/");if(d===-1||c.length<ya-1){Xe.dismiss();return}let p=c.slice(d+1).toLowerCase();Xe.show(te,p,{onSelect:Sa})}function Sa(o){if(!te||!Et||!Ne)return;let a=qn?window.getSelection():null;if(a&&a.rangeCount){let m=a.getRangeAt(0),g=zn(m).lastIndexOf("/");if(g!==-1){let E=document.createTreeWalker(te,NodeFilter.SHOW_TEXT),y=0,w=null,T=0;while(E.nextNode()){let C=E.currentNode;if(y+C.length>g){w=C,T=g-y;break}y+=C.length}if(w){let C=document.createRange();C.setStart(w,T),C.setEnd(m.startContainer,m.startOffset),C.deleteContents()}}}St(te);let c=xa(te),d=[...Ne],p=Et;ha(),p(d,o,c)}function Wu(o,a){let{target:c}=o;return c===a||c===a.documentElement||c===a.body}function fo(o){let a=o instanceof Element?o:null;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function Ea(o,a){let c=Pe(o);return{path:ge(a),rect:{height:c.height,width:c.width,x:c.x,y:c.y}}}function va(o){let a=fo(o instanceof Element?o:null);if(!a)return null;return Ea(a,a.dataset.jxPath)}function Bu(o){let a=o.checkVisibility;return t(a)?a.call(o,{checkVisibilityCSS:!0}):!0}function wa(o,a=document){let c=[],d=[];for(let p of o){let m=a.querySelector(nt(ae(p)));if(!m)continue;if(Bu(m)){let h=Pe(m);c.push({path:p,rect:{height:h.height,width:h.width,x:h.x,y:h.y}})}else d.push(p)}return{hidden:d,hits:c}}var Ku=new Set(["toggle","show","hide"]);function Uu(o){return Ku.has(o)}function qu(o,a){if(!(o instanceof Element))return;let c=o.closest("[popovertarget]"),d=c?.getAttribute("popovertarget");if(!c||!d)return;let h=[...c.ownerDocument.querySelectorAll("[data-jx-popover]")].find((y)=>y.id===d)?.dataset.jxPath;if(!h)return;let g=c.getAttribute("popovertargetaction")??"toggle",E=Uu(g)?g:"toggle";a.post({action:E,kind:"popoverTargetClick",targetPath:ge(h)})}function zu(o,a){if(!(o instanceof Element))return;let c=o.closest("[data-jx-commandfor]"),d=c?.dataset.jxCommandfor,p=c?.getAttribute("command")?.trim().toLowerCase()??"";if(!c||!d||!p)return;let g=[...c.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((E)=>E.id===d)?.dataset.jxPath;if(!g)return;a.post({command:p,kind:"commandTargetClick",targetPath:ge(g)})}function Ta(o,a=document,c){let d=null,p=null,m=c?.getGen?.()??0,h=()=>c?.getMode?.()==="preview",g=()=>{o.post({kind:"paneFocus"})},E=(P)=>{if(h()){if(P.target instanceof Element){let V=P.target.closest("a[href]")?.getAttribute("href");if(V&&!V.startsWith("#"))P.preventDefault(),o.post({href:V,kind:"previewNavigate"})}return}if(c?.getMode?.()==="stylebook"&&P.target instanceof Element&&P.target.closest("a"))P.preventDefault();let B=va(P.target);if(B)o.post({additive:P.ctrlKey===!0||P.metaKey===!0,hit:B,kind:"hit"});qu(P.target,o),zu(P.target,o)},y=(P)=>{if(h())return;let B=P?.dataset.jxPath??null;if(B===d)return;d=B,o.post({hit:P&&B?Ea(P,B):null,kind:"hover"})},w=()=>{let P=c?.getGen?.()??m;if(P!==m)m=P,p="none"},T=(P,B)=>{if(!c||c.getMode?.()==="stylebook"||h())return;w();let ie=c.getShadowDoc(),V=fo(P instanceof Element?P:null),ne=V&&ie?qs(V,B,ie):null,X=zs(ne);if(X===p)return;p=X,o.post({kind:"insertZones",zones:ne})},C=0,_=null,O=0,K=0,k=(P)=>a.defaultView?.requestAnimationFrame(P)??requestAnimationFrame(P),L=(P)=>a.defaultView?.cancelAnimationFrame(P)??cancelAnimationFrame(P),z=()=>{C=0;let P=_;_=null,y(fo(P instanceof Element?P:null)),T(P,{x:O,y:K})},G=(P)=>{if(_=P.target,O=P.clientX,K=P.clientY,C)return;C=k(z)},Y=(P)=>{if(!Wu(P,a))return;if(y(null),c&&!h()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},U=(P)=>{if(h())return;let B=Je()?wt():null;if(B&&P.target instanceof Node&&B.contains(P.target))return;let ie=va(P.target);if(!ie)return;P.preventDefault(),o.post({kind:"contextMenu",path:ie.path,x:P.clientX,y:P.clientY})};return a.addEventListener("pointerdown",g,!0),a.addEventListener("click",E,!0),a.addEventListener("pointermove",G,!0),a.addEventListener("pointerleave",Y,!0),a.addEventListener("contextmenu",U,!0),()=>{if(C)L(C),C=0;a.removeEventListener("pointerdown",g,!0),a.removeEventListener("click",E,!0),a.removeEventListener("pointermove",G,!0),a.removeEventListener("pointerleave",Y,!0),a.removeEventListener("contextmenu",U,!0)}}var Gu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Yu(o){let a=o;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function mo(o,a,c){let d=Vo(o,a,c);return Yu(d)}function ho(o,a,c,d){let p=o.dataset.jxPath;if(p==null)return null;let m=ge(p);if(m.length===0){let C=[...o.children];if(C.length===0)return po(d,m)?{edge:"inside",instruction:"make-child",referenceRect:ot(o),targetPath:m}:null;return Xu(C,a,m,d)}if(!po(d,m))return null;let h=xe(c,m),g=(f(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((C)=>n(C)),y=Gu.has(g)||!E,w=ot(o),T=w.height===0?0:(a-w.y)/w.height;if(y)return T<0.5?{edge:"top",instruction:"reorder-above",referenceRect:w,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:w,targetPath:m};if(T<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:w,targetPath:m};if(T>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:w,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:w,targetPath:m}}function Xu(o,a,c,d){let p=1/0,m="reorder-below",h=o.length-1;for(let E=0;E<o.length;E++){let y=ot(o[E]),w=Math.abs(a-y.y),T=Math.abs(a-(y.y+y.height));if(w<p)p=w,m="reorder-above",h=E;if(T<p)p=T,m="reorder-below",h=E}let g=[...c,"children",h];if(!po(d,g))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:ot(o[h]),targetPath:g}}function po(o,a){if(o.type!=="tree-node")return!0;let c=o.path;if(Ws(c,a))return!1;return!bt(c,a)}function ot(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}var Zu=40,Ca=12;function go(o,a,c=Zu){if(o<c)return-1;if(o>a-c)return 1;return 0}var xo=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),yo=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Aa=new Set(["deleteByCut","deleteContent"]),Pa=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),Qu="format",ed=new Set(["insertParagraph","insertLineBreak"]);function Na(o){let{inputType:a,from:c,to:d}=o;if(a==="insertCompositionText"||a==="insertFromComposition")return{kind:"native"};if(a==="historyUndo"||a==="historyRedo")return{kind:"reject"};if(a.startsWith(Qu))return{kind:"reject"};if(a==="insertFromDrop"||a==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return ed.has(a)?{kind:"reject"}:{kind:"native"};if(!c||!d)return{kind:"reject"};let p=qt(c,d)&&c.offset===d.offset,m=!qt(c,d);if(a==="insertParagraph")return{from:c,kind:"split",to:d};if(a==="insertLineBreak"&&!m)return{kind:"native"};if(p&&xo.has(a)&&o.atBlockStart)return{at:c,kind:"mergeBackward"};if(p&&yo.has(a)&&o.atBlockEnd)return{at:c,kind:"mergeForward"};if(m){if(Pa.has(a)||a==="insertLineBreak")return{from:c,kind:"replaceRange",text:o.data,to:d};if(xo.has(a)||yo.has(a)||Aa.has(a))return{from:c,kind:"replaceRange",text:"",to:d};return{kind:"reject"}}if(Pa.has(a)||xo.has(a)||yo.has(a)||Aa.has(a))return{kind:"native"};return{kind:"native"}}var td=500;function Gn(o,a){let c=o.ownerDocument.getSelection();if(!c||c.rangeCount===0||!c.anchorNode||!c.focusNode)return null;if(!o.contains(c.anchorNode)||!o.contains(c.focusNode))return null;let d=Ut(c.anchorNode,c.anchorOffset,a),p=Ut(c.focusNode,c.focusOffset,a);return d&&p?{anchor:d,head:p}:null}function Qt(o,a){let c=Gr(o,a.anchor),d=Gr(o,a.head)??c;if(!c)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(c.node,c.offset),p.removeAllRanges(),p.addRange(m),d&&d!==c)p.extend(d.node,d.offset);return!0}function Ra(o){return"dataset"in o}function $a(o,a){let c=o.ownerDocument,d=null,p=null,m=()=>{let U=a.getMode?.();return U===void 0||U==="design"||U==="edit"},h=null,g=()=>{if(h!==null)clearTimeout(h),h=null},E=()=>{if(h=null,!d||!a.onCommitTick)return;let U=Gn(o,a.isEditableBlock);if(a.onCommitTick(),U)Qt(o,U)},y=!1,w=()=>{if(!a.onCommitTick||!d||y)return;g(),h=setTimeout(E,a.commitDelayMs??td)},T=()=>{y=!0,g()},C=()=>{y=!1,w()},_=()=>{g(),d=null,p=null},O=()=>{if(!d)return;g(),d=null,p=null,a.onDeactivate()},K=()=>{if(!m()){O();return}let P=c.getSelection()?.focusNode??null;if(!P)return;if(!o.contains(P)){O();return}let B=jn(P,a.isEditableBlock);if(!B){if(d?.contains(P)){a.onSelectionChange?.();return}O();return}let ie=ae(B.path);if(ie===p){a.onSelectionChange?.();return}O(),d=B.el,p=ie,a.onActivate(B.el,B.path)},k=(U)=>{let[P]=t(U.getTargetRanges)?U.getTargetRanges():[],B=c.getSelection(),ie=B&&B.rangeCount>0&&(B.isCollapsed||!P),V,ne,X,re;if(ie)({startContainer:V,startOffset:ne,endContainer:X,endOffset:re}=B.getRangeAt(0));else if(P)({startContainer:V,startOffset:ne,endContainer:X,endOffset:re}=P);else return null;let Te=Ut(V,ne,a.isEditableBlock),H=Ut(X,re,a.isEditableBlock),q=jn(X,a.isEditableBlock);return Te&&H&&q?{endEl:q.el,from:Te,to:H}:null},L=(U)=>{if(!m())return;let P=k(U),B=Na({atBlockEnd:P?P.to.offset>=zr(P.endEl):!1,atBlockStart:P?Os(P.from):!1,data:U.data??"",from:P?.from??null,inPropHost:d!==null&&p===null,inputType:U.inputType,to:P?.to??null});switch(B.kind){case"native":return;case"split":{if(U.preventDefault(),!qt(B.from,B.to)&&!a.onReplaceRange)return;a.onSplit?.();return}case"mergeBackward":{U.preventDefault(),a.onMergeBackward?.(B.at);return}case"mergeForward":{U.preventDefault(),a.onMergeForward?.(B.at);return}case"replaceRange":{U.preventDefault(),a.onReplaceRange?.(B.from,B.to,B.text);return}default:U.preventDefault()}},z=(U)=>{if(!m()||!a.onPropActivate)return;let P=U.target instanceof Element?U.target:null;while(P&&P!==o){if(Ra(P)&&P.dataset.jxBoundProp){let B=P;if(B!==d){if(O(),a.onPropActivate(B))d=B,p=null}return}if(Ra(P)&&P.dataset.jxPath)return;P=P.parentElement}},G=(U)=>{U.preventDefault()},Y=()=>w();return c.addEventListener("selectionchange",K),o.addEventListener("beforeinput",L),o.addEventListener("input",Y),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",C),o.addEventListener("dragstart",G),c.addEventListener("pointerdown",z,!0),{capture:()=>Gn(o,a.isEditableBlock),forget:_,isComposing:()=>y,flush:()=>{if(y)return;if(h!==null)g(),E()},placeCaret:(U)=>{let P=Qt(o,{anchor:U,head:U});if(P)K();return P},restore:(U)=>{let P=Qt(o,U);if(P)K();return P},stop:()=>{c.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",L),o.removeEventListener("input",Y),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",C),o.removeEventListener("dragstart",G),c.removeEventListener("pointerdown",z,!0),O()},sync:K}}function Ze(o){return n(o)}function Tt(o){if(Array.isArray(o))return o.map((c)=>Tt(c));if(!u(o))return o;let a={};for(let[c,d]of Object.entries(o)){if(c.startsWith("on")&&Z(d))continue;if(c==="children")a.children=Array.isArray(d)?d.map((p)=>Tt(p)):Tt(d);else if(c==="cases"&&Ze(d)){let p={};for(let[m,h]of Object.entries(d))p[m]=Tt(h);a.cases=p}else if(c==="state"&&Ze(d)){let p={};for(let[m,h]of Object.entries(d)){if(i(h)&&h.timing==="server")continue;p[m]=h}a.state=p}else a[c]=d}return a}var nd=new Set(["img","video","source","iframe","audio"]),Yn="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",rd="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var od=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function id(o){return od.test(o)}var sd=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),ad=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),Oa=["empty-text-placeholder","empty-container-placeholder"];function So(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(sd.has(f(o.tagName)))return"empty-text-placeholder";if(ad.has(f(o.tagName)))return"empty-container-placeholder";return null}function en(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function ka(o){let a=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(a.nextNode()){let c=a.currentNode;if(c.data.includes("❪"))c.data=c.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function ld(o){let a=o.map;return{children:n(a)?[Be(a)]:[],className:"repeater-perimeter",tagName:"div"}}function bo(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function Be(o){if(Array.isArray(o))return o.map((h)=>Be(h));if(!u(o))return o;if(o.$prototype==="Array")return ld(o);let a=o,c={},d=!1,p=e(a.tagName)&&nd.has(a.tagName);if(p){let{attributes:h,src:g}=a,E=h?.src,y=a.poster,w=h?.poster;if(!(g&&g!==""||E&&E!=="")&&!(y&&y!==""||w&&w!==""))d=!0}for(let[h,g]of Object.entries(a))if(h==="state"||h==="$media"||h==="$elements")c[h]=g;else if(h==="$props"&&Ze(g)){let E={};for(let[y,w]of Object.entries(g))if(e(w)&&w.includes("${"))if(id(y))E[y]=rd;else if(y==="href"||y==="action")E[y]="";else E[y]=en(w);else if(u(w)&&w.$ref)E[y]=bo(w.$ref);else E[y]=w;c[h]=E}else if(h==="children")if(Array.isArray(g))c.children=g.map((E)=>Be(E));else if(u(g)&&g.$prototype==="Array")c.children=[Be(g)];else c.children=Be(g);else if(h==="cases"&&a.$switch&&Ze(g)){let[E]=Object.entries(g);if(E){let[,y]=E;c.children=Ze(y)&&!(u(y)&&y.$ref)?[Be(y)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(g).join(" | ")}]`}]}}else if(h==="attributes"&&p&&Ze(g)){let E={};for(let[y,w]of Object.entries(g))if(y==="src"||y==="poster")if(e(w)&&w!==""&&!w.includes("${"))E[y]=w;else d=!0,E[y]=Yn;else if(e(w)&&w.includes("${")){let T=y==="href"||y==="action";E[y]=T?"":en(w)}else if(u(w)&&w.$ref)E[y]=bo(w.$ref);else E[y]=w;c.attributes=E}else if(h==="style")if(Ze(g)){let E={};for(let[y,w]of Object.entries(g))if(!e(w)||!w.includes("${"))E[y]=w;c.style=E}else c.style=g;else if(e(g)&&g.includes("${"))if((h==="src"||h==="poster")&&p)d=!0,c[h]=Yn;else{let y=h==="src"||h==="href"||h==="poster"||h==="action";c[h]=y?"":en(g)}else if(u(g)&&g.$ref){let E=bo(g.$ref);if((h==="src"||h==="poster")&&p)d=!0,c[h]=Yn;else c[h]=E}else if((h==="src"||h==="poster")&&g===""&&p)d=!0,c[h]=Yn;else c[h]=Be(g);let m=So(c);if(m)c.className=c.className?`${c.className} ${m}`:m;if(d){let h=e(c.className)?c.className:"";if(!h.includes("empty-media-placeholder"))c.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return c}var cd={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},vo=globalThis,ud=["strong","em","u","del","sub","sup","code"],Xn="jx-pending-format",Ma="jx-pending-format-style";function dd(o){let a=o.parentElement;while(a){if(a.tagName.includes("-"))return a;a=a.parentElement}return null}function fd(o,a){if(!o)return!1;let c=o.attributes;if(c){if(c[`props.${a}`]!==void 0)return!0;let d=new Set([a.toLowerCase(),Sn(a).toLowerCase()]);for(let m of Object.keys(c))if(c[m]!==void 0&&d.has(m.toLowerCase()))return!0;let p=c["data-jx-props"];if(e(p)&&pd(p,a))return!0}if(Wt.has(a)||a.startsWith("$"))return!1;return o[a]!==void 0}function pd(o,a){try{let c=JSON.parse(o);return n(c)&&a in c}catch{return!1}}function _a(o,a){let d=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${d}']`);return p instanceof HTMLElement?p:null}function md(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function Ja(o,a,c){let d=a.ownerDocument,p=()=>{let H=c?.getMode?.();return H===void 0||H==="design"||H==="edit"},m=null,h=0,g=(H)=>{let q=window.getSelection();if(!q||!q.rangeCount)return null;let Q=q.getRangeAt(0);return H.contains(Q.commonAncestorContainer)?Q:null},E=()=>{let H=wt();if(!H)return;let q=g(H);if(q&&!q.collapsed)m=q.cloneRange()},y=()=>{if(d.querySelector(`#${Ma}`))return;let H=d.createElement("style");H.id=Ma,H.textContent=`::highlight(${Xn}) { background-color: Highlight; color: HighlightText; }`,d.head.append(H)},w=()=>{let H=vo.Highlight,q=vo.CSS?.highlights;if(!H||!q)return;if(m&&m.startContainer.isConnected)y(),q.set(Xn,new H(m.cloneRange()));else q.delete(Xn)},T=()=>{vo.CSS?.highlights?.delete(Xn)},C=()=>{let H=wt();if(!H||!H.dataset.jxPath)return null;let q=g(H),Q=q??m,ue=Q?md(Fo(Q)):null,he=q?q.collapsed:!0,Ee=ud.filter((Re)=>Xs(Re,H)),we=ta(H);if(we.active)Ee.push("a");return h+=1,{activeTags:Ee,collapsed:he,kind:"selectionChanged",link:we,localScope:null,path:ge(H.dataset.jxPath),rect:ue,seq:h}},_=()=>{if(!Je())return;E(),w();let H=C();if(H)o.post(H)},O=!1,K=(H,q)=>{ka(H),o.post({kind:"editStart",path:q}),oo(H,q,{onCommit:(Q,ue,he,Ee)=>{O=!1;let we={children:ue,kind:"editCommit",path:Q,textContent:he};if(Ee)we.inPlace=!0;o.post(we)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(Q,ue,he)=>o.post({cmd:ue,commitData:he,kind:"editInsert",path:Q}),onSplit:(Q,ue,he)=>o.post({after:he,before:ue,kind:"editSplit",path:Q})}),E(),_()},k=(H,q)=>{let Q=c?.getShadowDoc?.();if(!Q)return!0;let ue=xe(Q,H);if(fd(ue,q))return!1;let he=ue?.$props?.[q];if(he==null)return!0;if(!e(he))return!1;return!he.includes("${")},L=(H,q,Q)=>{o.post({kind:"editStart",path:q,prop:Q}),oo(H,q,{onCommit:(ue,he,Ee,we)=>{O=!1;let Re={kind:"editCommitProp",path:ue,prop:Q,value:Ee??""};if(we)Re.inPlace=!0;o.post(Re)},onEnd:()=>{T(),m=null,V.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},z=(H)=>{let q=wt();if(!q)return;if(da())return;if(m&&m.startContainer.isConnected&&q.contains(m.commonAncestorContainer)){let Q=window.getSelection();q.focus(),Q?.removeAllRanges(),Q?.addRange(m)}if(H.command==="link")na(q,H.href);else if(H.command==="insertData")ra(q,H.token);else{let Q=cd[H.command];if(Q)Zs(Q,q)}E(),_()},G=(H)=>{let q=H.dataset.jxBoundProp,Q=dd(H),ue=Q?.dataset.jxPath;if(!q||!Q||!ue)return!1;let he=ge(ue);if(!k(he,q))return!1;return L(H,he,q),!0},Y=(H,q)=>{let Q=ks(a,H,q,rt);if(!Q)return!1;let[ue,he]=q===-1?[H,Q.path]:[Q.path,H];return V.flush(),o.post({fromPath:ue,intoPath:he,kind:"editMerge"}),!0},U=(H,q,Q)=>{let ue=Yr(a,rt),he=ae(H.path),Ee=ae(q.path),we=ue.findIndex(($e)=>$e.dataset.jxPath===he),Re=ue.findIndex(($e)=>$e.dataset.jxPath===Ee);if(we===-1||Re===-1||Re<=we)return!1;let nn=ue.slice(we+1,Re).map(($e)=>ge($e.dataset.jxPath));return V.flush(),o.post({between:nn,from:H,kind:"editRangeReplace",text:Q,to:q}),!0},P=()=>E(),B=()=>E(),ie=()=>E(),V=$a(a,{getMode:()=>c?.getMode?.()??"edit",isEditableBlock:rt,onActivate:(H,q)=>K(H,q),onDeactivate:()=>{if(Je())Ie()},onCommitTick:()=>ua(),onMergeBackward:(H)=>Y(H.path,-1),onMergeForward:(H)=>Y(H.path,1),onReplaceRange:(H,q,Q)=>U(H,q,Q),onPropActivate:G,onSelectionChange:()=>_(),onSplit:()=>ma()}),ne=(H)=>ba(H),X=()=>{if(pa())uo()},re=()=>{if(!O)O=!0,o.post({kind:"editInput"})};a.addEventListener("input",re),a.addEventListener("keydown",ne),a.addEventListener("input",X),d.addEventListener("mouseup",P,!0),d.addEventListener("keyup",B,!0),d.addEventListener("blur",ie,!0);let Te=o.onMessage((H)=>{if(H.kind==="applyFormat"){z(H.intent);return}if(H.kind==="openSlash"){co({anchored:!1});return}if(H.kind==="flushEdits"){V.flush(),o.post({kind:"flushComplete",reqId:H.reqId});return}if(H.kind==="endEdit"){if(Je())Ie();return}if(H.kind!=="enterEdit")return;if(!p())return;if(H.prop!==void 0){let ue=_a(a,H.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(H.prop)}"]`);if(ue)G(ue);return}let q=_a(a,H.path);if(q&&rt(q))V.placeCaret({offset:H.offset??0,path:H.path})});return()=>{if(a.removeEventListener("keydown",ne),a.removeEventListener("input",X),a.removeEventListener("input",re),d.removeEventListener("mouseup",P,!0),d.removeEventListener("keyup",B,!0),d.removeEventListener("blur",ie,!0),V.stop(),Te(),T(),m=null,Je())Ie()}}var hd=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function gd(o){return hd.has(o)}function Da(o,a){let c=!1,d=null,p=null,m={dismiss:()=>{if(!c)return;c=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>c,show:(y,w,T)=>{if({onSelect:d}=T,c&&w===p)return;c=!0,p=w;let C=Pe(y),_={filter:w,kind:"slashShow",rect:{height:C.height,width:C.width,x:C.left,y:C.top}};if(T.showFilter===!0)_.showFilter=!0;o.post(_)}};ro(m);let h=(y)=>{if(!c||!gd(y.key))return;y.preventDefault(),y.stopPropagation(),o.post({key:y.key,kind:"slashNav"})},g=()=>{if(c)m.dismiss()};a.addEventListener("keydown",h,!0),a.addEventListener("mousedown",g,!0);let E=o.onMessage((y)=>{if(y.kind==="slashSelect"){c=!1,p=null,d?.({...y.cmd});return}if(y.kind==="slashDismissed")c=!1,p=null});return()=>{a.removeEventListener("keydown",h,!0),a.removeEventListener("mousedown",g,!0),E(),ro({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var La=["global","canvas","caret","grid","code","dock","palette"];var Em={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var xd=["mod","ctrl","alt","shift"],yd=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),bd=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function Sd(o){return[...xd.filter((c)=>o[c]),o.key].join("+")}function vd(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function Ia(o,a){let c=vd(o.code)??o.key.toLowerCase();if(yd.has(c))return"";let d={mod:a?o.metaKey:o.ctrlKey,ctrl:a?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:bd.get(c)??c};return Sd(d)}var Am=["global",...La.filter((o)=>o!=="global"&&o!=="palette")];var Ed=["caret","global"],wd=["canvas","global"],Td=["global"],Zn={chords:[],mac:!1};function Cd(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function Ad(o,a){if(o)return Ed;return a==="preview"?Td:wd}function Pd(o,a=Zn,c=!1,d="design"){if(Cd(o.target))return!1;let p=Ia(o,a.mac);if(!p)return!1;let m=Ad(c,d);return a.chords.some((h)=>h.chord===p&&m.includes(h.scope))}function Nd(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function ja(o,a=document,c=()=>!1,d=()=>Zn,p=()=>"design"){let m=(h)=>{if(!Pd(h,d(),c(),p()))return;h.preventDefault(),o.post({event:Nd(h),kind:"forwardKey"})};return a.addEventListener("keydown",m,!0),()=>a.removeEventListener("keydown",m,!0)}var Eo=new WeakMap,Qn=new Set;function wo(o,a,c){let d=xe(o,a);if(d===void 0)throw Error(`iframe-patch-node-not-found:${a.join("/")}`);let p=e(d)?d:Be(Tt(d)),{result:m,stop:h}=kn(()=>Me(p,c.defs,{_path:Rd(a,c),onNodeCreated:eo(c.mapperCtx)}));if(Qn.add(h),m instanceof HTMLElement)Eo.set(m,h);return m}function To(o){let a=[o,...o.querySelectorAll("*")];for(let c of a){if(!(c instanceof HTMLElement))continue;Nn(c);let d=Eo.get(c);if(d)d(),Qn.delete(d),Eo.delete(c)}}function Ha(){for(let o of Qn)o();Qn.clear()}function Rd(o,a){let{mapperCtx:c}=a;if(c.layoutWrapped&&c.pageContentPrefix&&o[0]==="children"){let[,d]=o;return s(d)?[...c.pageContentPrefix,d+(c.pageContentOffset??0),...o.slice(2)]:[...c.pageContentPrefix,...o.slice(1)]}return o}function Wa(o,a,c,d,p){for(let h of a)to(o,h);if(!p?.length){for(let h of a)Fa(o,h,c,d);return}let m=new Set(p.map((h)=>ae(h)));for(let h of a){if(h.op==="set-key"&&m.has(ae(h.path))){$d(o,h.path,c);continue}Fa(o,h,c,d)}}function $d(o,a,c){let d=Ua(c,a);if(d)Ct(d,xe(o,a))}function Co(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function Fa(o,a,c,d){switch(a.op){case"set-key":{if(a.key==="style"){Jd(o,a.path,c,d);return}if(a.key==="textContent"){Dd(o,a.path,c);return}if(a.key.startsWith("on"))return;Va(o,a.path,c,Co(d));return}case"insert-child":{Od(o,a.parentPath,a.index,c,Co(d));return}case"set-child":{Va(o,[...a.parentPath,"children",a.index],c,Co(d));return}case"remove-child":{kd(o,a.parentPath,a.index,c);return}case"move-child":{Md(o,a.fromParentPath,a.fromIndex,a.toParentPath,a.toIndex,c);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(a)}`)}}function Od(o,a,c,d,p){let m=it(d,a),h=xe(o,a),g=wo(o,[...a,"children",c],p);er(d,a,c,1),Ba(m,g,Ka(m,h,c)),Ct(m,h)}function Va(o,a,c,d){let p=it(c,a),m=wo(o,a,d);To(p),p.replaceWith(m)}function kd(o,a,c,d){let p=it(d,[...a,"children",c]),m=p.parentElement;if(To(p),p.remove(),er(d,a,c+1,-1),m)Ct(m,xe(o,a))}function Md(o,a,c,d,p,m){let h=[...a,"children",c],g=it(m,h),E=g.parentElement,y=it(m,d);g.remove(),er(m,a,c+1,-1);let w=tr(y)??d;er(m,w,p,1),_d(g,h,[...w,"children",p]);let T=xe(o,w);if(Ba(y,g,Ka(y,T,p)),E)Ct(E,xe(o,tr(E)??a));Ct(y,T)}function Ct(o,a){for(let d of Oa)o.classList.remove(d);let c=a?So(a):null;if(c)o.classList.add(c)}function Ba(o,a,c){if(c)c.before(a);else o.append(a)}function Ka(o,a,c){let d=a?.textContent,p=d!=null&&String(d)!==""?1:0;return o.childNodes[p+c]??null}function er(o,a,c,d){let p=a.length;for(let m of o.querySelectorAll("[data-jx-path]")){let h=tr(m);if(!h||h.length<p+2||h[p]!=="children")continue;let g=h[p+1];if(!s(g)||g<c)continue;if(!a.every((y,w)=>h[w]===y))continue;let E=[...h];E[p+1]=g+d,m.dataset.jxPath=ae(E)}}function _d(o,a,c){let d=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of d){let m=tr(p);if(!m||m.length<a.length||!a.every((h,g)=>m[g]===h))continue;p.dataset.jxPath=ae([...c,...m.slice(a.length)])}}function tr(o){let a=o.dataset.jxPath;return a===void 0?null:ge(a)}function Jd(o,a,c,d){let p=it(c,a),m=xe(o,a),h=d?.defs.$media??{};Ln(p,Ld(m?.style),h)}function Dd(o,a,c){let d=it(c,a),p=xe(o,a);d.textContent=Id(p),Ct(d,p)}function it(o,a){let c=Ua(o,a);if(!c)throw Error(`iframe-patch-element-not-found:${ae(a)}`);return c}function Ua(o,a){let d=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${d}']`);return p instanceof HTMLElement?p:null}function Ld(o){if(!o||!n(o))return;let a={};for(let[c,d]of Object.entries(o)){if(e(d)&&d.includes("${"))continue;a[c]=d}return a}function Id(o){let a=o?.textContent;if(a==null)return"";if(e(a))return a.includes("${")?en(a):a;if(n(a)&&a.$ref){let c=String(a.$ref);return`{${c.startsWith("#/state/")?c.slice(8):c}}`}return String(a)}function qa(o){if(o===void 0)return"undefined";let a;try{a=JSON.stringify(o)??"undefined"}catch{a=String(o)}if(a.length>48)a=`${a.slice(0,47)}…`;return a}function jd(o){return i(o)&&"$expression"in o&&Array.isArray(o.parameters)}function Hd(o){try{return structuredClone(o)}catch{return null}}function Fd(o,a){let c={};for(let d of Object.keys(o))try{let p=o[d];if(t(p)){if(jd(a?.[d]))c[d]=p;continue}let m=JSON.stringify(p);c[d]=m===void 0?null:JSON.parse(m)}catch{c[d]=null}return c}function Vd(o,a,c){if(!c||c.length===0)return o;let d=a,p=o;for(let m of c){if(!n(d))break;let h=d;if(h.$prototype==="Array"&&m==="map"){let g=h.items,E=r(g)?Se(g.$ref,p):g;if(Array.isArray(E)&&E.length>0){let[y]=E,w=Hd(y),T=Object.create(p);T.$map={index:0,item:w},T["$map/item"]=w,T["$map/index"]=0,p=T}}d=h[m]}return p}function za(o,a,c,d){let p=c?.state??null;return o.map(({id:m,node:h})=>{let g=new Map,E;try{E=Vd(Fd(a,p),c,d)}catch(y){return{error:y instanceof Error?y.message:String(y),id:m,values:[]}}try{if(!n(h)||!("operator"in h))throw Error("not an expression node");return Ae(h,E,null,void 0,{report:(y,w)=>{g.set(y.join("/"),qa(w))}}),{id:m,values:[...g.entries()]}}catch(y){return{error:y instanceof Error?y.message:String(y),id:m,values:[...g.entries()]}}})}var Wd=256000,Bd="[large value omitted]";function Ga(o){let a={};for(let c of Object.keys(o))try{let d=o[c];if(t(d))continue;let p=JSON.stringify(d);if(p===void 0){a[c]=null;continue}if(p.length>Wd){a[c]=Bd;continue}a[c]=JSON.parse(p)}catch{a[c]=null}return a}var Ya={"jx-ui:/behaviors/color-area.ts":()=>(pe("0fj8a4ga"),import("./chunks/color-area-0fj8a4ga.js")),"jx-ui:/behaviors/color-field.ts":()=>(pe("xch8kx2g"),import("./chunks/color-field-xch8kx2g.js")),"jx-ui:/behaviors/color-slider.ts":()=>(pe("jxd8v350"),import("./chunks/color-slider-jxd8v350.js")),"jx-ui:/behaviors/combobox.ts":()=>(pe("p0efwjke"),import("./chunks/combobox-p0efwjke.js")),"jx-ui:/behaviors/dialog.ts":()=>(pe("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(pe("e74qjyq6"),import("./chunks/listbox-e74qjyq6.js")),"jx-ui:/behaviors/menu.ts":()=>(pe("n6yzswmy"),import("./chunks/menu-n6yzswmy.js")),"jx-ui:/behaviors/number-field.ts":()=>(pe("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(pe("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(pe("jt2gxmzs"),import("./chunks/popover-jt2gxmzs.js")),"jx-ui:/behaviors/select.ts":()=>(pe("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(pe("n2gfpm5m"),import("./chunks/split-n2gfpm5m.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(pe("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(pe("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(pe("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(pe("mdq3v5cw"),import("./chunks/tree-mdq3v5cw.js")),"jx-ui:/behaviors/tooltip.ts":()=>(pe("5v8ngwj2"),import("./chunks/tooltip-5v8ngwj2.js")),"jx-ui:/behaviors/textfield.ts":()=>(pe("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(pe("c9fn075p"),import("./chunks/toast-c9fn075p.js")),"jx-ui:/behaviors/toast-host.ts":()=>(pe("ke5z4ng7"),import("./chunks/toast-host-ke5z4ng7.js")),"jx-ui:/color.ts":()=>(pe("28ksk2qm"),import("./chunks/color-28ksk2qm.js")),"jx-ui:/icons.ts":()=>(pe("pnfz478q"),import("./chunks/icons-pnfz478q.js"))};var Kd;function Xa(o){Kd=new URL("./",o).href}Xa(import.meta.url);for(let[o,a]of Object.entries(Ya))xs(o,a);function tn(o,a,c,d){let p=mo(o.x,o.y,d);if(!p)return null;return ho(p,o.y,c,a)}function Ao(o){return[...o.dataTransfer?.types??[]].includes("Files")}var Ud={type:"block"},No={},Po=null;function Za(o){return o?{...o,versions:No}:null}function qd(o,a){let c=o.dataset.jxPath;if(c==null)return null;let d=ge(c),p=a?xe(a,d):void 0;return{path:d,rect:ot(o),tagName:(f(p?.tagName)||o.tagName).toLowerCase()}}function zd(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let a=o.closest("[data-jx-layout-region]");if(!(a instanceof HTMLElement))return null;return{className:a.className,layoutFile:a.dataset.jxLayoutFile??"",layoutPath:ge(a.dataset.jxLayoutPath??"[]"),rect:ot(a),tagName:a.tagName.toLowerCase()}}function Qa(o){let a=n(o)&&"message"in o?o.message:void 0;return String(a??o)}var Gd=new Set(["style","textContent"]);function Yd(o){let a=fa();if(!a)return!1;for(let c of o){let d;if(c.op==="set-key"){if(Gd.has(c.key)||c.key.startsWith("on"))continue;d=c.path}else if(c.op==="move-child"){if(d=c.fromParentPath,bt(d,a)||bt(c.toParentPath,a))return!0;continue}else d=c.parentPath;if(bt(d,a))return!0}return!1}var Xd=2,Zd=5000,Qd=500;function ef(o){let{channel:a,container:c}=o;No={},Po=null;let d=null,p=null,m=-1,h=null,g=-1,E="design",y=null,w=null,T=Zn,C=null,_=null,O=-1,K=-1,k=0,L=null,z=c.ownerDocument.defaultView;function G(){if(k&&z)z.cancelAnimationFrame(k);k=0,L=null}function Y(){k=0;let A=L?.src??_;if(!z||!L||!A||!h)return;let se=go(L.y,z.innerHeight);if(se===0)return;let oe=z.scrollY;if(z.scrollBy(0,se*Ca),z.scrollY===oe)return;let ve=tn(L,A,h,c.ownerDocument),ee={dragSeq:L.dragSeq,gen:L.gen??O,kind:"dragOver",preview:ve};if(L.withCursor)ee.cursor={x:L.x,y:L.y};a.post(ee),k=z.requestAnimationFrame(Y)}function U(A,se,oe){if(!z||go(A.y,z.innerHeight)===0){G();return}let ve={dragSeq:se,withCursor:oe!=null,x:A.x,y:A.y};if(oe)ve.gen=oe.gen,ve.src=oe.src;if(L=ve,!k)k=z.requestAnimationFrame(Y)}let P=Ta(a,c.ownerDocument,{getGen:()=>g,getMode:()=>E,getShadowDoc:()=>h}),B=(A)=>{if(E!=="design"&&E!=="edit")return;let se=zd(A.target);if(se)a.post({hit:se,kind:"layoutHit"})};c.ownerDocument.addEventListener("click",B,!0);let ie=ja(a,c.ownerDocument,Je,()=>T,()=>E),V=Ja(a,c,{getMode:()=>E,getShadowDoc:()=>h}),ne=Da(a,c.ownerDocument),X=Is(c),re=30000,Te=-1;function H(){let A=c.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),se=Pe(c),oe=0;for(let ve of A)oe=Math.max(oe,Pe(ve).bottom-se.top);return oe}function q(){let A=Math.max(c.scrollHeight,H()),se=Math.min(A,re);if(se>0&&Math.abs(se-Te)>=1){Te=se;let oe=c.firstElementChild,ve=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;a.post({fragment:ve,height:se,kind:"contentHeight"}),st()}}let Q=z?.ResizeObserver,ue=Q?new Q(()=>q()):null,he=c.ownerDocument,Ee=0,we=0,Re=0,nn="",$e=new Map;function el(){let A=Date.now();for(let[se,oe]of $e)if(oe<=A)$e.delete(se);return $e.size}function tl(){let A=he;return{animations:A.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:A.fonts?A.fonts.status==="loaded":!0,gen:g,images:el(),kind:"idle"}}function Ro(){Ee=0;let A=tl(),se=`${A.gen}|${A.fonts}|${A.animations}|${A.images}`,oe=se!==nn;if(oe)nn=se,a.post(A);if(we=A.fonts&&A.animations===0&&A.images===0?oe?1:we+1:0,we>=Xd){q();return}if(Date.now()>=Re)return;Ee=z?z.requestAnimationFrame(Ro):0}function st(){if(we=0,Re=Date.now()+Zd,!Ee&&z)Ee=z.requestAnimationFrame(Ro)}let $o=(A)=>{if(A.target instanceof HTMLImageElement)$e.set(A.target,Date.now()+Qd),st()},Oo=(A)=>{if(A.target instanceof HTMLImageElement&&$e.delete(A.target))st()};c.addEventListener("error",$o,!0),c.addEventListener("load",Oo,!0),st(),ue?.observe(c);let ko=(A)=>{if(E==="preview"){if(A.ctrlKey||A.metaKey)A.preventDefault();return}A.preventDefault(),a.post({ctrlKey:A.ctrlKey,deltaX:A.deltaX,deltaY:A.deltaY,kind:"forwardWheel",metaKey:A.metaKey,shiftKey:A.shiftKey,x:A.clientX,y:A.clientY})};c.ownerDocument.addEventListener("wheel",ko,{passive:!1});let nl=300,Mo=0,_o=(A,se)=>{A.preventDefault(),A.stopPropagation();let oe={x:A.clientX,y:A.clientY},ve=c.ownerDocument,ee=mo(oe.x,oe.y,ve),Oe=ee?qd(ee,h):null,on=h&&ee?ho(ee,oe.y,h,Ud):null;if(se==="fileDragOver"){if(A.dataTransfer)A.dataTransfer.dropEffect="copy";a.post({hit:Oe,kind:"fileDragOver",preview:on});return}a.post({files:[...A.dataTransfer?.files??[]],hit:Oe,kind:"fileDrop",preview:on})},rn=(A)=>{if(!_){if(Ao(A)){_o(A,"fileDragOver");return}let ve=Date.now();if(ve-Mo>=nl)Mo=ve,a.post({kind:"nativeDragEnter"});return}if(A.preventDefault(),A.dataTransfer)A.dataTransfer.dropEffect="move";let se={x:A.clientX,y:A.clientY},oe=h?tn(se,_,h,c.ownerDocument):null;a.post({cursor:se,dragSeq:K,gen:O,kind:"dragOver",preview:oe}),U(se,K)},Jo=(A)=>{if(!_){if(Ao(A))_o(A,"fileDrop");return}A.preventDefault();let se={x:A.clientX,y:A.clientY},oe=h?tn(se,_,h,c.ownerDocument):null;a.post({dragSeq:K,gen:O,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),_=null,O=-1,K=-1,G()},Do=(A)=>{if(!_&&Ao(A)&&!A.relatedTarget)a.post({kind:"fileDragLeave"})};c.ownerDocument.addEventListener("dragenter",rn,!0),c.ownerDocument.addEventListener("dragover",rn,!0),c.ownerDocument.addEventListener("dragleave",Do,!0),c.ownerDocument.addEventListener("drop",Jo,!0);let rl=a.onMessage((A)=>{if(A.kind==="measure"){let{hidden:ee,hits:Oe}=wa(A.paths,c.ownerDocument);a.post({hidden:ee,hits:Oe,kind:"geometry",reqId:A.reqId});return}if(A.kind==="evalExpr"){let ee=A.gen===g&&C&&h?za(A.exprs,C.defs,h,A.contextPath):[];a.post({gen:A.gen,kind:"evalResult",reqId:A.reqId,results:ee});return}if(A.kind==="patch"){let{gen:ee}=A;if(ee<g){a.post({gen:ee,kind:"patchError",message:"patch-behind-render"});return}if(ee>g||!h||!C){a.post({gen:ee,kind:"patchError",message:"patch-ahead-of-render"});return}let Oe=new Set((A.echoPaths??[]).map((at)=>ae(at))),on=Oe.size===0?A.forwardOps:A.forwardOps.filter((at)=>!(at.op==="set-key"&&Oe.has(ae(at.path)))),Lo=Je()&&Yd(on),Io=Lo?Gn(c,rt):null;if(Lo)Ie();try{if(Wa(h,A.forwardOps,c,C,A.echoPaths),zt(c,y),yt(c,w),Io)Qt(c,Io);a.post({gen:ee,kind:"patchComplete"}),st()}catch(at){a.post({gen:ee,kind:"patchError",message:Qa(at)})}return}if(A.kind==="styleUpdate"){if(A.gen!==g||!h)return;h.style=A.style;let ee=c.firstElementChild;if(ee instanceof HTMLElement)Ln(ee,A.style,h.$media??{});return}if(A.kind==="dragStart"){_=A.src,O=A.gen,K=A.dragSeq;return}if(A.kind==="dragEnd"||A.kind==="dragCancel"){_=null,O=-1,K=-1,G();return}if(A.kind==="dragMove"){let ee=_&&h?tn(A.cursor,_,h,c.ownerDocument):null;a.post({dragSeq:A.dragSeq,gen:O,kind:"dragOver",preview:ee}),U(A.cursor,A.dragSeq);return}if(A.kind==="drop"){let ee=_&&h?tn(A.cursor,_,h,c.ownerDocument):null;a.post({dragSeq:A.dragSeq,gen:O,instruction:ee?.instruction??null,kind:"dropResult",targetPath:ee?.targetPath??null}),_=null,O=-1,K=-1,G();return}if(A.kind==="assetVersions"){No=A.versions;let ee=Za(Po);if(ee)Mn((Oe)=>Kt(Oe,ee));return}if(A.kind==="keymap"){T={chords:A.chords,mac:A.mac};return}if(A.kind==="setColorScheme"){Qr(c.ownerDocument,A.scheme);return}if(A.kind==="setPopoverOpen"){if(E==="preview")return;y=A.path===null?null:ae(A.path),zt(c,y),yt(c,w),q();return}if(A.kind==="setDialogOpen"){if(E==="preview")return;w=A.path===null?null:ae(A.path),yt(c,w),q();return}if(A.kind==="redefineElement"){Ps(A.doc,A.base);return}if(A.kind==="setLocale"){let ee=c.ownerDocument.documentElement;if(A.locale===null)ee.removeAttribute("lang"),ee.removeAttribute("dir");else ee.setAttribute("lang",A.locale),ee.setAttribute("dir",A.dir);return}if(A.kind==="siteStyleUpdate"){Zr(A.siteStyle,A.media);return}if(A.kind!=="render"||A.gen<m)return;if(Qr(c.ownerDocument,A.colorScheme??null),Je())Ie();m=A.gen,Po=A.assets??null,ca(A.editableTags??null);let{gen:se,mapperCtx:oe}=A,ve=A.shadowDoc;(async()=>{try{Ha(),p?.(),p=null,d?.dispose(),Es(c.ownerDocument);let ee={assets:Za(A.assets??null),container:c,doc:A.doc,docBase:A.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:A.diffMarks??null,mode:A.mode,popoverOpen:A.popoverOpen?ae(A.popoverOpen):null,dialogOpen:A.dialogOpen?ae(A.dialogOpen):null,siteStyle:A.siteStyle};if(A.allowAutoRequests)ee.allowAutoRequests=!0;if(d=await js(ee),se===m){y=A.popoverOpen?ae(A.popoverOpen):null,w=A.dialogOpen?ae(A.dialogOpen):null,zt(c,y),yt(c,w),h=ve,C=d.ctx,g=se,E=A.mode,a.post({gen:se,kind:"renderComplete"}),st();let{defs:Oe}=d.ctx;p=ss(()=>{try{a.post({gen:se,kind:"dataScope",scope:Ga(Oe)})}catch{}}),q()}}catch(ee){a.post({gen:se,kind:"renderError",message:Qa(ee)})}})()});return a.post({kind:"ready"}),()=>{if(rl(),P(),ie(),V(),ne(),X(),Ee&&z)z.cancelAnimationFrame(Ee);Ee=0,c.removeEventListener("error",$o,!0),c.removeEventListener("load",Oo,!0),G(),ue?.disconnect(),c.ownerDocument.removeEventListener("click",B,!0),c.ownerDocument.removeEventListener("wheel",ko),c.ownerDocument.removeEventListener("dragenter",rn,!0),c.ownerDocument.removeEventListener("dragleave",Do,!0),c.ownerDocument.removeEventListener("dragover",rn,!0),c.ownerDocument.removeEventListener("drop",Jo,!0),p?.(),d?.dispose()}}function tf(o){let a=new URLSearchParams(o.location.search);os(a.get("rpcToken"));let c=a.get("parentOrigin"),d=c||"*";if(!c)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,h=Ho({acceptOrigin:d,source:o,target:o.parent,targetOrigin:d,token:a.get("token")||""});return ef({channel:h,container:m})}if(typeof window<"u"&&window.parent!==window)tf(window);export{Xd as IDLE_QUIET_FRAMES,Zd as IDLE_WATCH_MAX_MS,Qd as IMAGE_RETRY_WINDOW_MS,tf as bootCanvasIframe,qd as fileDropHitFor,Ao as isExternalFileDrag,zd as layoutHitFor,Yd as patchDisturbsActiveEdit,ef as startCanvasIframe};
|
|
313
|
+
`;function ad(o,a){let d=o.head.querySelector(`#${ia}`);if(a!=="stylebook"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=ia,f.textContent=sd,o.head.append(f)}function io(o,a={}){let d=document.head.querySelector(`#${oo}`);if(!o||!n(o)){d?.remove();return}let f=ta(o,a,$n);if(d){d.textContent=f;return}let p=document.createElement("style");p.id=oo,p.textContent=f,document.head.append(p)}function so(o,a){if(a)o.documentElement.dataset.colorScheme=a;else delete o.documentElement.dataset.colorScheme}function aa(o){let a=o.documentElement;return{dir:a.getAttribute("dir"),lang:a.getAttribute("lang")}}function sa(o,a,d){if(d===null)o.removeAttribute(a);else o.setAttribute(a,d)}function qn(o,a,d){let f=o.documentElement;sa(f,"lang",a?.locale??d.lang),sa(f,"dir",a?.dir==="rtl"?"rtl":d.dir)}function en(o,a){for(let f of o.querySelectorAll("[data-jx-popover-open]"))delete f.dataset.jxPopoverOpen;if(a===null)return;let d=o.querySelector(`[data-jx-popover]${ot(a)}`);if(d)d.dataset.jxPopoverOpen=""}function vt(o,a){for(let f of o.querySelectorAll("[data-jx-dialog-open]"))delete f.dataset.jxDialogOpen;if(a===null)return;let d=o.querySelector(`dialog${ot(a)}`);if(d)d.dataset.jxDialogOpen=""}function ld(o,a=null){let d=o.$head;if(!Array.isArray(d))return;for(let f of d){if(!n(f)||!f.tagName)continue;let p=String(f.tagName).toLowerCase();if(p==="script"&&!f.attributes?.src)continue;let m={...f.attributes};for(let y of["href","src"]){let E=m[y];if(!e(E)||E==="")continue;if(!E.startsWith("/")&&!E.startsWith(".")&&!E.startsWith("http")){m[y]=`/node_modules/${E}`;continue}m[y]=Xt(E,a)??E}let g=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(g!==p&&document.head.querySelector(g))continue;let h=document.createElement(p);for(let[y,E]of Object.entries(m))h.setAttribute(y,String(E));if(f.textContent)h.textContent=String(f.textContent);document.head.append(h)}}function ao(o){let a=[],d=(f)=>a.some((p)=>f.length>p.length&&p.every((m,g)=>f[g]===m));return(f,p,m)=>{if(!(f instanceof HTMLElement))return;let g=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(g)f.dataset.jxDefinitionRoot="";let h=!g&&f.tagName.includes("-")&&Un(o.canvasMode);if(h)f.contentEditable="false",a.push(p);let y=Xs(p,m,o);if(y.kind==="layout"){if(f.dataset.jxLayoutPath=ae(y.layoutPath),y.layoutFile)f.dataset.jxLayoutFile=y.layoutFile;if(y.chrome){if(f.dataset.jxLayoutRegion="",Un(o.canvasMode))f.contentEditable="false"}return}if(f.dataset.jxPath=ae(y.path),!h&&Un(o.canvasMode)&&d(p))f.contentEditable="true"}}function la(o,a=3){let d=new WeakMap,f=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!m.src||m.src.startsWith("data:"))return;let g=(d.get(m)??0)+1;if(g>a)return;d.set(m,g),setTimeout(()=>{let h=m.src;m.src="",m.src=h},150*g)};return o.addEventListener("error",f,!0),()=>o.removeEventListener("error",f,!0)}async function ca(o){let a=o.assets??null;Dn(a?(g)=>Xt(g,a):null),gs(o.mode!=="preview"),ys(o.mode!=="preview"&&!o.allowAutoRequests),ws(!0),Cs(o.mode!=="preview"&&o.mode!=="stylebook"),As(o.mode!=="preview"),Ps(o.mode!=="preview"),Rs(o.mode==="design"||o.mode==="edit"),io(o.siteStyle,o.doc.$media??{}),ld(o.doc,a),Zu(o.container.ownerDocument,o.mode),ed(o.container.ownerDocument,o.mode),od(o.container.ownerDocument,o.mode),ad(o.container.ownerDocument,o.mode),nd(o.container.ownerDocument,Boolean(o.diffMarks?.length)),zs(o.doc.$media??{}),await Yu(o.doc,o.docBase);let d=await Ln(o.doc,{},o.docBase),f=ao(o.mapperCtx),{result:p,stop:m}=bt(()=>Oe(o.doc,d,{_path:[],onNodeCreated:f}));return o.container.replaceChildren(p),en(o.container,o.popoverOpen??null),vt(o.container,o.dialogOpen??null),id(o.container,o.mode),rd(o.container,o.diffMarks??null),{ctx:{defs:d,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:m}}function cd(o){return JSON.parse(JSON.stringify(o))}function zn(o){return o===void 0||o===null?o:cd(o)}function xe(o,a){let d=o;for(let f of a){if(d==null)return;d=d[f]}return d}function ua(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function lo(o,a){let{op:d}=a;switch(a.op){case"set-key":{let f=xe(o,a.path);if(!f)throw Error(`doc-op-node-not-found:${a.path.join("/")}`);if(a.value===void 0)delete f[a.key];else f[a.key]=zn(a.value);return}case"insert-child":{tn(o,a.parentPath).splice(a.index,0,zn(a.node));return}case"remove-child":{tn(o,a.parentPath).splice(a.index,1);return}case"set-child":{tn(o,a.parentPath).splice(a.index,1,zn(a.node));return}case"move-child":{ud(a);let f=tn(o,a.fromParentPath),p=tn(o,a.toParentPath),[m]=f.splice(a.fromIndex,1);p.splice(a.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${d}`)}function tn(o,a){let d=xe(o,a);if(d==null)throw TypeError(`doc-op-node-not-found:${a.join("/")}`);return ua(d)}function ud(o){let a=[...o.fromParentPath,"children",o.fromIndex],d=o.toParentPath;if(d.length>=a.length&&a.every((f,p)=>f===d[p]))throw Error(`doc-op-move-into-self:${d.join("/")}`)}function da(o){return o.length>=2?o.slice(0,-2):null}function fa(o){return o.at(-1)}function pa(o,a){if(o===a)return!0;if(!o||!a||o.length!==a.length)return!1;return o.every((d,f)=>d===a[f])}function Et(o,a){if(o.length>a.length)return!1;return o.every((d,f)=>d===a[f])}var Gn=14,dd="empty-container-placeholder";function ma(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}function fd(o){let a=getComputedStyle(o),{display:d}=a,f=d==="flex"||d==="inline-flex",p=d==="grid"||d==="inline-grid";return f&&a.flexDirection.startsWith("row")||p&&a.gridAutoFlow.startsWith("column")}function xa(o,a,d){let f=o.dataset.jxPath;if(f==null)return null;let p=ge(f);if(o.classList.contains(dd))return[{edge:"center",index:0,insertParentPath:p,rect:ma(o)}];let m=da(p);if(!m)return null;let g=o.parentElement;if(!g)return null;let h=fa(p);if(!i(h))return null;let y=ma(o);if(fd(g)){let C=a.x-y.x;if(C<Gn)return[Yn("left",m,h,ha(y,!0))];if(y.width-C<Gn)return[Yn("right",m,h+1,ga(y,!0))];return null}let E=a.y-y.y;if(E<Gn)return[Yn("top",m,h,ha(y,!1))];if(y.height-E<Gn)return[Yn("bottom",m,h+1,ga(y,!1))];return null}function Yn(o,a,d,f){return{edge:o,index:d,insertParentPath:a,rect:f}}function ha(o,a){return a?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function ga(o,a){return a?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function ya(o){if(!o||o.length===0)return"none";return o.map((a)=>`${a.edge}:${a.insertParentPath.join("/")}:${a.index}`).join("|")}var Xn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function co(o){return o.nodeType===Node.ELEMENT_NODE}function ba(o){return o.nodeType===Node.TEXT_NODE}function va(o,a){if(!a)return!1;if(a.contentEditable==="plaintext-only")return!1;let d=window.getSelection();if(!d||!d.rangeCount)return!1;let{anchorNode:f,focusNode:p}=d;if(!f||!p)return!1;if(!a.contains(f)||!a.contains(p))return!1;let m=(g)=>{let h=g;while(h&&h!==a){if(co(h)&&h.tagName.toLowerCase()===o)return!0;h=h.parentNode}return!1};return m(f)&&m(p)}function Ea(o,a){if(!a)return;let d=window.getSelection();if(!d||!d.rangeCount)return;let f=d.getRangeAt(0);if(f.collapsed)return;if(!a.contains(f.commonAncestorContainer))return;Td(f);let p=pd(o,f,a);if(p.length>0)md(o,f,a,p);else hd(o,f,a);wt(a)}function pd(o,a,d){let f=[];for(let p of d.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&a.intersectsNode(p))f.push(p);return f}function md(o,a,d,f){for(let p=f.length-1;p>=0;p--){let m=f[p];wa(m)}}function wa(o){if(!o.parentNode)return;let d=document.createDocumentFragment();while(o.firstChild)d.append(o.firstChild);o.replaceWith(d)}function hd(o,a,d){let f=a.extractContents(),p=gd(f),m=xd(f);if(!f.hasChildNodes()){if(p)a.insertNode(document.createTextNode(p));if(m){let E=document.createTextNode(m);a.collapse(!1),a.insertNode(E)}return}let g=document.createElement(o);g.append(f);let h=document.createDocumentFragment();if(p)h.append(document.createTextNode(p));if(h.append(g),m)h.append(document.createTextNode(m));a.insertNode(h);let y=window.getSelection();if(y){y.removeAllRanges();let E=document.createRange();E.selectNodeContents(g),y.addRange(E)}}function gd(o){let a=o.firstChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/^(\s+)/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(p.length);return p}function xd(o){let a=o.lastChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/(\s+)$/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(0,-p.length);return p}function wt(o){if(!o)return;let a=!0,d=0;while(a&&d<10){if(a=!1,d+=1,o.normalize(),yd(o))a=!0;if(bd(o))a=!0;if(Sd(o))a=!0;if(vd(o))a=!0;if(Ed(o))a=!0}}function yd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){let p=f.nextSibling;if(p&&co(p)&&p.tagName===f.tagName&&Xn.has(f.tagName.toLowerCase())&&wd(f,p))d.push([f,p])}for(let f=d.length-1;f>=0;f--){let[p,m]=d[f];while(m.firstChild)p.append(m.firstChild);m.remove(),a=!0}return a}function bd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;let p=f.firstChild;if(f.childNodes.length===1&&p!==null&&co(p)&&p.tagName===f.tagName)d.push(f)}for(let f of d){let p=f.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),a=!0}return a}function Sd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f.childNodes.length===0&&!f.textContent)d.push(f)}for(let f of d)f.remove(),a=!0;return a}function vd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f===o)continue;let p=f.firstChild;if(p&&ba(p)){let g=p.textContent,h=g.match(/^(\s+)/);if(h&&g.length>h[1].length)d.push({el:f,text:p,type:"lift-leading",ws:h[1]})}let m=f.lastChild;if(m&&ba(m)&&m!==p){let g=m.textContent,h=g.match(/(\s+)$/);if(h&&g.length>h[1].length)d.push({el:f,text:m,type:"lift-trailing",ws:h[1]})}}for(let f of d){if(f.type==="lift-leading")f.text.textContent=f.text.textContent.slice(f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el);else f.text.textContent=f.text.textContent.slice(0,-f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el.nextSibling);a=!0}return a}function Ed(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(f.tagName.toLowerCase()!=="span")continue;if(f===o)continue;if(f.attributes.length>0)continue;d.push(f)}for(let f of d)wa(f),a=!0;return a}function wd(o,a){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===a.getAttribute("href");return!0}function Td(o){Sa(o,!0),Sa(o,!1)}function Sa(o,a){let d=a?o.startContainer:o.endContainer,f=a?o.startOffset:o.endOffset;if(d.nodeType!==Node.TEXT_NODE)return;let p=d.textContent??"",m=Cd(p);for(let g of m)if(a){if(f>g.start&&f<g.end)o.setStart(d,g.start)}else if(f>g.start&&f<g.end)o.setEnd(d,g.end)}function Cd(o){let a=[],d=0;while(d<o.length-1){if(o[d]==="$"&&o[d+1]==="{"){let f=d,p=1,m=d+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){a.push({end:m,start:f}),d=m;continue}}d+=1}return a}var Zn=(o,a)=>document.execCommand(o,!1,a);function Ta(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function Ca(o){let a=window.getSelection();if(!a||!a.rangeCount)return{active:!1,href:null};let d=a.anchorNode;while(d&&d!==o){if(Ta(d))return{active:!0,href:d.dataset.jxHref??d.getAttribute("href")};d=d.parentNode}return{active:!1,href:null}}function Ad(o){let a=window.getSelection();if(!a||!a.rangeCount)return null;let d=a.anchorNode;while(d&&d!==o){if(Ta(d))return d;d=d.parentNode}return null}function Aa(o,a){let d=Ad(o);if(d)if(a)d.setAttribute("href",a);else{let f=document.createDocumentFragment();while(d.firstChild)f.append(d.firstChild);d.replaceWith(f)}else if(a)Zn("createLink",a);wt(o)}function Pa(o,a){o.focus(),Zn("insertText",`\${${a}}`)}var Na={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Ra=Na.$defs,Nd=new Set(["pre"]),Rd=new Set(Object.entries(Ra).filter(([o,a])=>!Nd.has(o)&&(a.$inlineChildren?.length??0)>0).map(([o])=>o));function $a(o,a){return a?.[o.toLowerCase()]??Rd.has(o.toLowerCase())}var $d={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Ze=$d;function uo(o){Ze=o}var te=null,Ne=null,Tt=null,nn=null,Ct=null,Xe=null,ke=!1,on="",rn=!1,ka=null;function Ma(o){ka=o}function it(o){return $a(o.tagName,ka)}function fo(o,a,d,f){if(te)Le(!0);if(te=o,Ne=a,Tt=d.onCommit,nn=d.onSplit,Ct=d.onInsert,Xe=d.onEnd,ke=f?.plainText===!0,on=ke?o.textContent:"",rn=!1,o.dataset.jxActiveBlock="",ke){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",po),o.addEventListener("input",mo),o.addEventListener("paste",ho)}function Le(o=!1){if(!te)return;if(Ha(!1),Ze.dismiss(),delete te.dataset.jxActiveBlock,ke)te.contentEditable="false";if(te.removeEventListener("keydown",po),te.removeEventListener("input",mo),te.removeEventListener("paste",ho),te=null,Ne=null,Tt=null,nn=null,Ct=null,ke=!1,on="",rn=!1,o)Xe=null;else if(Xe){let a=Xe;Xe=null,a()}}function _a(){Ha(!0)}function Ja(){return ke&&te!==null}function Me(){return te!==null}function At(){return te}function Da(){return Ne}function La(){return Ze.isOpen()}function po(o){if(ke){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),te)te.textContent=on;Le();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Le();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function mo(){if(Ze.isOpen())yo()}function ho(o){o.preventDefault();let a=o.clipboardData?.getData("text/plain")??"";Zn("insertText",a)}function Ia(){if(!nn||!te||!Ne)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let a=o.getRangeAt(0),d=document.createRange();d.setStart(te,0),d.setEnd(a.startContainer,a.startOffset);let f=document.createRange();f.setStart(a.endContainer,a.endOffset),f.setEnd(te,te.childNodes.length);let p=Oa(d.cloneContents()),m=Oa(f.cloneContents()),g=[...Ne],h=nn;return ja(),h(g,p,m),!0}function ja(){if(!te)return;if(delete te.dataset.jxActiveBlock,ke)te.contentEditable="false";if(te.removeEventListener("keydown",po),te.removeEventListener("input",mo),te.removeEventListener("paste",ho),te=null,Ne=null,Tt=null,nn=null,Ct=null,ke=!1,on="",rn=!1,Xe){let o=Xe;Xe=null,o()}}function Ha(o){if(!Tt||!te||!Ne)return;if(ke){let d=te.textContent.replaceAll(`
|
|
314
|
+
`," ");if(d===on.replaceAll(`
|
|
315
|
+
`," ")&&!rn)return;rn=!0,Tt(Ne,null,d,o);return}wt(te);let a=Fa(te);Tt(Ne,a.children??null,a.textContent??null,o)}function Od(o){if(!Array.isArray(o.children)||o.children.length===0)return{textContent:""};let a=[];for(let d of o.children){let f=a.at(-1);if(e(d)&&e(f))a[a.length-1]=f+d;else a.push(d)}if(a.every((d)=>e(d)))return{textContent:a.join("")};return{children:a}}function Fa(o){let a=o.childNodes;if(a.length===0)return{textContent:""};if(a.length===1&&a[0].nodeType===Node.TEXT_NODE)return{textContent:a[0].textContent};let d=[];for(let f of a){let p=go(f);if(p!==null)d.push(p)}return Od({children:d})}function kd(o){return o.nodeType===Node.ELEMENT_NODE&&"dataset"in o}var Md=new Map([["b","strong"],["i","em"],["s","del"],["strike","del"]]);function go(o){if(o.nodeType===Node.TEXT_NODE){let h=o.textContent;if(!h)return null;return h}if(!kd(o))return null;let a=o,d=a.tagName.toLowerCase(),f={tagName:d},p=Md.get(d);if(p)f.tagName=p;let m=a.dataset.jxHref??a.getAttribute("href");if(d==="a"&&m!=null){if(f.attributes={href:m},"title"in a&&e(a.title)&&a.title)f.attributes.title=a.title}if(d==="code")return f.textContent=a.textContent,f;let{childNodes:g}=a;if(g.length===0)f.textContent="";else if(g.length===1&&g[0].nodeType===Node.TEXT_NODE)f.textContent=g[0].textContent;else{f.children=[];for(let h of g){let y=go(h);if(y)f.children.push(y)}}return f}function Oa(o){let a=o.childNodes;if(a.length===0)return{textContent:""};if(a.length===1&&a[0].nodeType===Node.TEXT_NODE)return{textContent:a[0].textContent};let d=[];for(let p of a){let m=go(p);if(m)d.push(m)}let[f]=d;if(d.length===1&&f!==void 0&&!e(f)&&f.tagName==="span"&&e(f.textContent))return{textContent:f.textContent};return d.length>0?{children:d}:{textContent:""}}function er(o){let a=document.createRange();return a.setStart(te,0),a.setEnd(o.startContainer,o.startOffset),a.toString()}var Va=0,Qn=!0;function xo(o){if(!te||!Ct||!Ne)return;if(ke)return;let a=window.getSelection();if(!a||!a.rangeCount)return;let d=a.getRangeAt(0);Qn=o?.anchored!==!1,Va=er(d).length;let f={onSelect:Ba};if(!Qn)f.showFilter=!0;Ze.show(te,"",f)}function Wa(o){if(o.key!=="/"||o.ctrlKey||o.metaKey||!te)return;let a=window.getSelection();if(!a||a.rangeCount===0)return;let d=er(a.getRangeAt(0));if(d===""||d.endsWith(" ")||d.endsWith(`
|
|
316
|
+
`))requestAnimationFrame(()=>xo())}function yo(){if(!te||!Qn)return;let o=window.getSelection();if(!o||!o.rangeCount){Ze.dismiss();return}let a=o.getRangeAt(0),d=er(a),f=d.lastIndexOf("/");if(f===-1||d.length<Va-1){Ze.dismiss();return}let p=d.slice(f+1).toLowerCase();Ze.show(te,p,{onSelect:Ba})}function Ba(o){if(!te||!Ct||!Ne)return;let a=Qn?window.getSelection():null;if(a&&a.rangeCount){let m=a.getRangeAt(0),h=er(m).lastIndexOf("/");if(h!==-1){let y=document.createTreeWalker(te,NodeFilter.SHOW_TEXT),E=0,C=null,T=0;while(y.nextNode()){let A=y.currentNode;if(E+A.length>h){C=A,T=h-E;break}E+=A.length}if(C){let A=document.createRange();A.setStart(C,T),A.setEnd(m.startContainer,m.startOffset),A.deleteContents()}}}wt(te);let d=Fa(te),f=[...Ne],p=Ct;ja(),p(f,o,d)}function _d(o,a){let{target:d}=o;return d===a||d===a.documentElement||d===a.body}function bo(o){let a=o instanceof Element?o:null;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function Ua(o,a){let d=Pe(o);return{path:ge(a),rect:{height:d.height,width:d.width,x:d.x,y:d.y}}}function Ka(o){let a=bo(o instanceof Element?o:null);if(!a)return null;return Ua(a,a.dataset.jxPath)}function Jd(o){let a=o.checkVisibility;return t(a)?a.call(o,{checkVisibilityCSS:!0}):!0}function qa(o,a=document){let d=[],f=[];for(let p of o){let m=a.querySelector(ot(ae(p)));if(!m)continue;if(Jd(m)){let g=Pe(m);d.push({path:p,rect:{height:g.height,width:g.width,x:g.x,y:g.y}})}else f.push(p)}return{hidden:f,hits:d}}var Dd=new Set(["toggle","show","hide"]);function Ld(o){return Dd.has(o)}function Id(o,a){if(!(o instanceof Element))return;let d=o.closest("[popovertarget]"),f=d?.getAttribute("popovertarget");if(!d||!f)return;let g=[...d.ownerDocument.querySelectorAll("[data-jx-popover]")].find((E)=>E.id===f)?.dataset.jxPath;if(!g)return;let h=d.getAttribute("popovertargetaction")??"toggle",y=Ld(h)?h:"toggle";a.post({action:y,kind:"popoverTargetClick",targetPath:ge(g)})}function jd(o,a){if(!(o instanceof Element))return;let d=o.closest("[data-jx-commandfor]"),f=d?.dataset.jxCommandfor,p=d?.getAttribute("command")?.trim().toLowerCase()??"";if(!d||!f||!p)return;let h=[...d.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((y)=>y.id===f)?.dataset.jxPath;if(!h)return;a.post({command:p,kind:"commandTargetClick",targetPath:ge(h)})}function za(o,a=document,d){let f=null,p=null,m=d?.getGen?.()??0,g=()=>d?.getMode?.()==="preview",h=()=>{o.post({kind:"paneFocus"})},y=(M)=>{if(g()){if(M.target instanceof Element){let X=M.target.closest("a[href]")?.getAttribute("href");if(X&&!X.startsWith("#"))M.preventDefault(),o.post({href:X,kind:"previewNavigate"})}return}if(d?.getMode?.()==="stylebook"&&M.target instanceof Element&&M.target.closest("a"))M.preventDefault();let B=Ka(M.target);if(B)o.post({additive:M.ctrlKey===!0||M.metaKey===!0,hit:B,kind:"hit"});Id(M.target,o),jd(M.target,o)},E=(M)=>{if(g())return;let B=M?.dataset.jxPath??null;if(B===f)return;f=B,o.post({hit:M&&B?Ua(M,B):null,kind:"hover"})},C=()=>{let M=d?.getGen?.()??m;if(M!==m)m=M,p="none"},T=(M,B)=>{if(!d||d.getMode?.()==="stylebook"||g())return;C();let re=d.getShadowDoc(),X=bo(M instanceof Element?M:null),ce=X&&re?xa(X,B,re):null,ee=ya(ce);if(ee===p)return;p=ee,o.post({kind:"insertZones",zones:ce})},A=0,H=null,k=0,K=0,L=(M)=>a.defaultView?.requestAnimationFrame(M)??requestAnimationFrame(M),_=(M)=>a.defaultView?.cancelAnimationFrame(M)??cancelAnimationFrame(M),Y=()=>{A=0;let M=H;H=null,E(bo(M instanceof Element?M:null)),T(M,{x:k,y:K})},q=(M)=>{if(H=M.target,k=M.clientX,K=M.clientY,A)return;A=L(Y)},G=(M)=>{if(!_d(M,a))return;if(E(null),d&&!g()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},U=(M)=>{if(g())return;let B=Me()?At():null;if(B&&M.target instanceof Node&&B.contains(M.target))return;let re=Ka(M.target);if(!re)return;M.preventDefault(),o.post({kind:"contextMenu",path:re.path,x:M.clientX,y:M.clientY})};return a.addEventListener("pointerdown",h,!0),a.addEventListener("click",y,!0),a.addEventListener("pointermove",q,!0),a.addEventListener("pointerleave",G,!0),a.addEventListener("contextmenu",U,!0),()=>{if(A)_(A),A=0;a.removeEventListener("pointerdown",h,!0),a.removeEventListener("click",y,!0),a.removeEventListener("pointermove",q,!0),a.removeEventListener("pointerleave",G,!0),a.removeEventListener("contextmenu",U,!0)}}var Hd=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ga=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Fd=new Set([...Ga,"button","dt","h1","h2","h3","h4","h5","h6","label","legend","p","pre","summary"]);function Ya(o){return(u(o?.tagName)||"div").toLowerCase()}function Vd(o,a){let d=o.type==="block"?o.tag??"":Ya(xe(a,o.path));return Ga.has(d.toLowerCase())}function Wd(o,a){let d=null,f=o;while(f){let p=ge(f.dataset.jxPath??"");if(p.length===0)break;if(Fd.has(Ya(xe(a,p))))d=f;f=Xa(f.parentElement)}return d}function Xa(o){let a=o;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function So(o,a,d){let f=zo(o,a,d);return Xa(f)}function vo(o,a,d,f){let p=o.dataset.jxPath;if(p==null)return null;let m=ge(p);if(m.length===0){let H=[...o.children];if(H.length===0)return tr(f,m)?{edge:"inside",instruction:"make-child",referenceRect:Qe(o),targetPath:m}:null;return Bd(H,a,m,f)}if(!tr(f,m))return null;let g=Vd(f,d)?null:Wd(o,d);if(g){let H=ge(g.dataset.jxPath??"");if(!tr(f,H))return null;let k=Qe(g);return(k.height===0?0:(a-k.y)/k.height)<0.5?{edge:"top",instruction:"reorder-above",referenceRect:k,targetPath:H}:{edge:"bottom",instruction:"reorder-below",referenceRect:k,targetPath:H}}let h=xe(d,m),y=(u(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((H)=>n(H)),C=Hd.has(y)||!E,T=Qe(o),A=T.height===0?0:(a-T.y)/T.height;if(C)return A<0.5?{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};if(A<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m};if(A>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:T,targetPath:m}}function Bd(o,a,d,f){let p=1/0,m="reorder-below",g=o.length-1;for(let y=0;y<o.length;y++){let E=Qe(o[y]),C=Math.abs(a-E.y),T=Math.abs(a-(E.y+E.height));if(C<p)p=C,m="reorder-above",g=y;if(T<p)p=T,m="reorder-below",g=y}let h=[...d,"children",g];if(!tr(f,h))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:Qe(o[g]),targetPath:h}}function tr(o,a){if(o.type!=="tree-node")return!0;let d=o.path;if(pa(d,a))return!1;return!Et(d,a)}function Qe(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}var Kd=40,Za=12;function Eo(o,a,d=Kd){if(o<d)return-1;if(o>a-d)return 1;return 0}var wo=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),To=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Qa=new Set(["deleteByCut","deleteContent"]),el=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),Ud="format",qd=new Set(["insertParagraph","insertLineBreak"]);function tl(o){let{inputType:a,from:d,to:f}=o;if(a==="insertCompositionText"||a==="insertFromComposition")return{kind:"native"};if(a==="historyUndo"||a==="historyRedo")return{kind:"reject"};if(a.startsWith(Ud))return{kind:"reject"};if(a==="insertFromDrop"||a==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return qd.has(a)?{kind:"reject"}:{kind:"native"};if(!d||!f)return{kind:"reject"};let p=Qt(d,f)&&d.offset===f.offset,m=!Qt(d,f);if(a==="insertParagraph")return{from:d,kind:"split",to:f};if(a==="insertLineBreak"&&!m)return{kind:"native"};if(p&&wo.has(a)&&o.atBlockStart)return{at:d,kind:"mergeBackward"};if(p&&To.has(a)&&o.atBlockEnd)return{at:d,kind:"mergeForward"};if(m){if(el.has(a)||a==="insertLineBreak")return{from:d,kind:"replaceRange",text:o.data,to:f};if(wo.has(a)||To.has(a)||Qa.has(a))return{from:d,kind:"replaceRange",text:"",to:f};return{kind:"reject"}}if(el.has(a)||wo.has(a)||To.has(a)||Qa.has(a))return{kind:"native"};return{kind:"native"}}var zd=500;function nr(o,a){let d=o.ownerDocument.getSelection();if(!d||d.rangeCount===0||!d.anchorNode||!d.focusNode)return null;if(!o.contains(d.anchorNode)||!o.contains(d.focusNode))return null;let f=Zt(d.anchorNode,d.anchorOffset,a),p=Zt(d.focusNode,d.focusOffset,a);return f&&p?{anchor:f,head:p}:null}function sn(o,a){let d=no(o,a.anchor),f=no(o,a.head)??d;if(!d)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(m),f&&f!==d)p.extend(f.node,f.offset);return!0}function nl(o){return"dataset"in o}function rl(o,a){let d=o.ownerDocument,f=null,p=null,m=()=>{let U=a.getMode?.();return U===void 0||U==="design"||U==="edit"},g=null,h=()=>{if(g!==null)clearTimeout(g),g=null},y=()=>{if(g=null,!f||!a.onCommitTick)return;let U=nr(o,a.isEditableBlock);if(a.onCommitTick(),U)sn(o,U)},E=!1,C=()=>{if(!a.onCommitTick||!f||E)return;h(),g=setTimeout(y,a.commitDelayMs??zd)},T=()=>{E=!0,h()},A=()=>{E=!1,C()},H=()=>{h(),f=null,p=null},k=()=>{if(!f)return;h(),f=null,p=null,a.onDeactivate()},K=()=>{if(!m()){k();return}let M=d.getSelection()?.focusNode??null;if(!M)return;if(!o.contains(M)){k();return}let B=Bn(M,a.isEditableBlock);if(!B){if(f?.contains(M)){a.onSelectionChange?.();return}k();return}let re=ae(B.path);if(re===p){a.onSelectionChange?.();return}k(),f=B.el,p=re,a.onActivate(B.el,B.path)},L=(U)=>{let[M]=t(U.getTargetRanges)?U.getTargetRanges():[],B=d.getSelection(),re=B&&B.rangeCount>0&&(B.isCollapsed||!M),X,ce,ee,ne;if(re)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:ne}=B.getRangeAt(0));else if(M)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:ne}=M);else return null;let ve=Zt(X,ce,a.isEditableBlock),V=Zt(ee,ne,a.isEditableBlock),N=Bn(ee,a.isEditableBlock);return ve&&V&&N?{endEl:N.el,from:ve,to:V}:null},_=(U)=>{if(!m())return;let M=L(U),B=tl({atBlockEnd:M?M.to.offset>=to(M.endEl):!1,atBlockStart:M?Qs(M.from):!1,data:U.data??"",from:M?.from??null,inPropHost:f!==null&&p===null,inputType:U.inputType,to:M?.to??null});switch(B.kind){case"native":return;case"split":{if(U.preventDefault(),!Qt(B.from,B.to)&&!a.onReplaceRange)return;a.onSplit?.();return}case"mergeBackward":{U.preventDefault(),a.onMergeBackward?.(B.at);return}case"mergeForward":{U.preventDefault(),a.onMergeForward?.(B.at);return}case"replaceRange":{U.preventDefault(),a.onReplaceRange?.(B.from,B.to,B.text);return}default:U.preventDefault()}},Y=(U)=>{if(!m()||!a.onPropActivate)return;let M=U.target instanceof Element?U.target:null;while(M&&M!==o){if(nl(M)&&M.dataset.jxBoundProp){let B=M;if(B!==f){if(k(),a.onPropActivate(B))f=B,p=null}return}if(nl(M)&&M.dataset.jxPath)return;M=M.parentElement}},q=(U)=>{U.preventDefault()},G=()=>C();return d.addEventListener("selectionchange",K),o.addEventListener("beforeinput",_),o.addEventListener("input",G),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",A),o.addEventListener("dragstart",q),d.addEventListener("pointerdown",Y,!0),{capture:()=>nr(o,a.isEditableBlock),forget:H,isComposing:()=>E,flush:()=>{if(E)return;if(g!==null)h(),y()},placeCaret:(U)=>{let M=sn(o,{anchor:U,head:U});if(M)K();return M},restore:(U)=>{let M=sn(o,U);if(M)K();return M},stop:()=>{d.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",_),o.removeEventListener("input",G),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",A),o.removeEventListener("dragstart",q),d.removeEventListener("pointerdown",Y,!0),k()},sync:K}}function Ve(o){return n(o)}function Pt(o){if(Array.isArray(o))return o.map((d)=>Pt(d));if(!l(o))return o;let a={};for(let[d,f]of Object.entries(o)){if(d.startsWith("on")&&Z(f))continue;if(d==="children")a.children=Array.isArray(f)?f.map((p)=>Pt(p)):Pt(f);else if(d==="cases"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f))p[m]=Pt(g);a.cases=p}else if(d==="state"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f)){if(s(g)&&g.timing==="server")continue;p[m]=g}a.state=p}else a[d]=f}return a}var Gd=new Set(["img","video","source","iframe","audio"]),ol="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Yd="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var Xd=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function il(o){return Xd.test(o)}var Zd=/(?<![\w$.])(?:item|index|\$map)\b/u;function We(o){if(e(o))return o.includes("${")&&Zd.test(o);return l(o)&&e(o.$ref)&&/^(?:#\/)?\$map\//u.test(o.$ref)}function rr(o,a){if(o==="href"||o==="action")return"";if(il(o))return Yd;if(e(a))return an(a);return l(a)&&e(a.$ref)?ml(a.$ref):""}var Qd=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),ef=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),sl=["empty-text-placeholder","empty-container-placeholder"],tf=["width","height","inlineSize","blockSize"];function nf(o){let{style:a}=o;if(!n(a))return!1;return tf.some((d)=>{let f=a[d],p=i(f)?String(f):e(f)?f.trim():"";return p!==""&&p!=="auto"})}function Ao(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(nf(o))return null;if(Qd.has(u(o.tagName)))return"empty-text-placeholder";if(ef.has(u(o.tagName)))return"empty-container-placeholder";return null}function an(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function al(o){let a=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(a.nextNode()){let d=a.currentNode;if(d.data.includes("❪"))d.data=d.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function rf(o,a){let d=o.map;return{children:n(d)?[et(d,ul(o.items,a))]:[],className:"repeater-perimeter",tagName:"div"}}function ll(o){return JSON.stringify(o)}function cl(o){let a=o.startsWith("#/")?o.slice(2):o,[d,...f]=a.split("/"),p=d==="state"||d==="$map"?d:null;if(p===null)return null;let m=f.map((g)=>g.replaceAll("~1","/").replaceAll("~0","~"));return p+m.map((g)=>`?.[${ll(g)}]`).join("")}function Co(o,a){if(a===null)return`(${o})`;return`((r) => ((item, index, $map) => (${o}))(r, 0, { index: 0, item: r }))(${a})`}function ul(o,a){if(Array.isArray(o))return`${ll(o)}[0]`;if(r(o)){let f=cl(o.$ref);return f===null?null:`${Co(f,a)}?.[0]`}let d=e(o)?dl(o):[];if(e(o)&&d.length===1&&of(o,d[0]))return`${Co(d[0].expr,a)}?.[0]`;return null}function of(o,a){return a.start===0&&a.end===o.length-1}function dl(o){let a=[],d=o.indexOf("${");while(d!==-1){let f=0,p=-1;for(let m=d+1;m<o.length;m+=1)if(o[m]==="{")f+=1;else if(o[m]==="}"){if(f-=1,f===0){p=m;break}}if(p===-1)break;a.push({end:p,expr:o.slice(d+2,p),start:d}),d=o.indexOf("${",p+1)}return a}function fl(o,a=null){let d=dl(o);if(d.length===0)return o;let f="",p=0;for(let{start:m,end:g,expr:h}of d)f+=o.slice(p,m),f+=`\${(() => { try { return ${Co(h,a)}; } catch { return ""; } })()}`,p=g+1;return f+o.slice(p)}function sf(o,a){let d=o.startsWith("#/")?o.slice(2):o;if(d!=="$map"&&!d.startsWith("$map/"))return{$ref:o};let f=cl(o);return a===null||f===null?void 0:fl(`\${${f}}`,a)}function pl(o,a){let d=o,f=null;for(let p of a){if(Array.isArray(d)){d=i(p)?d[p]:void 0;continue}if(!l(d))return f;if(p==="map"&&d.$prototype==="Array")f=ul(d.items,f);d=e(p)?d[p]:void 0}return f}function ml(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function hl(o,a=null){return et(o,a)}function et(o,a){if(Array.isArray(o))return o.map((h)=>et(h,a));if(!l(o))return o;if(o.$prototype==="Array")return rf(o,a);let d=o,f={},p=!1,m=e(d.tagName)&&Gd.has(d.tagName);if(m){let{attributes:h,src:y}=d,E=h?.src,C=d.poster,T=h?.poster;if(!(y&&y!==""||E&&E!=="")&&!(C&&C!==""||T&&T!==""))p=!0}for(let[h,y]of Object.entries(d))if(h==="state"||h==="$media"||h==="$elements")f[h]=y;else if(h==="$props"&&Ve(y)){let E={};for(let[C,T]of Object.entries(y))if(!We(T))E[C]=T;else if(e(T))E[C]=il(C)||C==="href"||C==="action"?rr(C,T):fl(T,a);else if(r(T)){let A=sf(T.$ref,a);if(A!==void 0)E[C]=A}else E[C]=T;f[h]=E}else if(h==="children")if(Array.isArray(y))f.children=y.map((E)=>et(E,a));else if(l(y)&&y.$prototype==="Array")f.children=[et(y,a)];else f.children=et(y,a);else if(h==="cases"&&d.$switch&&Ve(y)){let[E]=Object.entries(y);if(E){let[,C]=E;f.children=Ve(C)&&!(l(C)&&C.$ref)?[et(C,a)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(y).join(" | ")}]`}]}}else if(h==="attributes"&&m&&Ve(y)){let E={};for(let[C,T]of Object.entries(y))if((C==="src"||C==="poster")&&(T===""||T==null||We(T)))p=!0,E[C]=ol;else E[C]=We(T)?rr(C,T):T;f.attributes=E}else if(h==="attributes"&&Ve(y)){let E={};for(let[C,T]of Object.entries(y))E[C]=We(T)?rr(C,T):T;f.attributes=E}else if(h==="style")if(Ve(y)){let E={};for(let[C,T]of Object.entries(y))if(!We(T))E[C]=T;f.style=E}else f.style=y;else if(h==="$switch"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&l(y)&&y.$ref)f[h]=ml(y.$ref);else if(m&&(h==="src"||h==="poster"))if(y===""||y==null||We(y))p=!0,f[h]=ol;else f[h]=y;else if(We(y))f[h]=rr(h,y);else if(e(y)||l(y)&&y.$ref)f[h]=y;else f[h]=et(y,a);let g=Ao(f);if(g)f.className=f.className?`${f.className} ${g}`:g;if(p){let h=e(f.className)?f.className:"";if(!h.includes("empty-media-placeholder"))f.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return f}var af={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Po=globalThis,lf=["strong","em","u","del","sub","sup","code"],or="jx-pending-format",gl="jx-pending-format-style";function cf(o){let a=o.parentElement;while(a){if(a.tagName.includes("-"))return a;a=a.parentElement}return null}function uf(o,a){if(!o)return!1;let d=o.attributes;if(d){if(d[`props.${a}`]!==void 0)return!0;let f=new Set([a.toLowerCase(),Tn(a).toLowerCase()]);for(let m of Object.keys(d))if(d[m]!==void 0&&f.has(m.toLowerCase()))return!0;let p=d["data-jx-props"];if(e(p)&&df(p,a))return!0}if(Gt.has(a)||a.startsWith("$"))return!1;return o[a]!==void 0}function df(o,a){try{let d=JSON.parse(o);return n(d)&&a in d}catch{return!1}}function xl(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function ff(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function yl(o,a,d){let f=a.ownerDocument,p=()=>{let V=d?.getMode?.();return V===void 0||V==="design"||V==="edit"},m=null,g=0,h=(V)=>{let N=window.getSelection();if(!N||!N.rangeCount)return null;let z=N.getRangeAt(0);return V.contains(z.commonAncestorContainer)?z:null},y=()=>{let V=At();if(!V)return;let N=h(V);if(N&&!N.collapsed)m=N.cloneRange()},E=()=>{if(f.querySelector(`#${gl}`))return;let V=f.createElement("style");V.id=gl,V.textContent=`::highlight(${or}) { background-color: Highlight; color: HighlightText; }`,f.head.append(V)},C=()=>{let V=Po.Highlight,N=Po.CSS?.highlights;if(!V||!N)return;if(m&&m.startContainer.isConnected)E(),N.set(or,new V(m.cloneRange()));else N.delete(or)},T=()=>{Po.CSS?.highlights?.delete(or)},A=()=>{let V=At();if(!V||!V.dataset.jxPath)return null;let N=h(V),z=N??m,Q=z?ff(qo(z)):null,de=N?N.collapsed:!0,_e=lf.filter((Ae)=>va(Ae,V)),ye=Ca(V);if(ye.active)_e.push("a");return g+=1,{activeTags:_e,collapsed:de,kind:"selectionChanged",link:ye,localScope:null,path:ge(V.dataset.jxPath),rect:Q,seq:g}},H=()=>{if(!Me())return;y(),C();let V=A();if(V)o.post(V)},k=!1,K=(V,N)=>{al(V),o.post({kind:"editStart",path:N}),fo(V,N,{onCommit:(z,Q,de,_e)=>{k=!1;let ye={children:Q,kind:"editCommit",path:z,textContent:de};if(_e)ye.inPlace=!0;o.post(ye)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(z,Q,de)=>o.post({cmd:Q,commitData:de,kind:"editInsert",path:z}),onSplit:(z,Q,de)=>o.post({after:de,before:Q,kind:"editSplit",path:z})}),y(),H()},L=(V,N)=>{let z=d?.getShadowDoc?.();if(!z)return!0;let Q=xe(z,V);if(uf(Q,N))return!1;let de=Q?.$props?.[N];if(de==null)return!0;if(!e(de))return!1;return!de.includes("${")},_=(V,N,z)=>{o.post({kind:"editStart",path:N,prop:z}),fo(V,N,{onCommit:(Q,de,_e,ye)=>{k=!1;let Ae={kind:"editCommitProp",path:Q,prop:z,value:_e??""};if(ye)Ae.inPlace=!0;o.post(Ae)},onEnd:()=>{T(),m=null,X.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},Y=(V)=>{let N=At();if(!N)return;if(Ja())return;if(m&&m.startContainer.isConnected&&N.contains(m.commonAncestorContainer)){let z=window.getSelection();N.focus(),z?.removeAllRanges(),z?.addRange(m)}if(V.command==="link")Aa(N,V.href);else if(V.command==="insertData")Pa(N,V.token);else{let z=af[V.command];if(z)Ea(z,N)}y(),H()},q=(V)=>{let N=V.dataset.jxBoundProp,z=cf(V),Q=z?.dataset.jxPath;if(!N||!z||!Q)return!1;let de=ge(Q);if(!L(de,N))return!1;return _(V,de,N),!0},G=(V,N)=>{let z=ea(a,V,N,it);if(!z)return!1;let[Q,de]=N===-1?[V,z.path]:[z.path,V];return X.flush(),o.post({fromPath:Q,intoPath:de,kind:"editMerge"}),!0},U=(V,N,z)=>{let Q=ro(a,it),de=ae(V.path),_e=ae(N.path),ye=Q.findIndex((Be)=>Be.dataset.jxPath===de),Ae=Q.findIndex((Be)=>Be.dataset.jxPath===_e);if(ye===-1||Ae===-1||Ae<=ye)return!1;let cn=Q.slice(ye+1,Ae).map((Be)=>ge(Be.dataset.jxPath));return X.flush(),o.post({between:cn,from:V,kind:"editRangeReplace",text:z,to:N}),!0},M=()=>y(),B=()=>y(),re=()=>y(),X=rl(a,{getMode:()=>d?.getMode?.()??"edit",isEditableBlock:it,onActivate:(V,N)=>K(V,N),onDeactivate:()=>{if(Me())Le()},onCommitTick:()=>_a(),onMergeBackward:(V)=>G(V.path,-1),onMergeForward:(V)=>G(V.path,1),onReplaceRange:(V,N,z)=>U(V,N,z),onPropActivate:q,onSelectionChange:()=>H(),onSplit:()=>Ia()}),ce=(V)=>Wa(V),ee=()=>{if(La())yo()},ne=()=>{if(!k)k=!0,o.post({kind:"editInput"})};a.addEventListener("input",ne),a.addEventListener("keydown",ce),a.addEventListener("input",ee),f.addEventListener("mouseup",M,!0),f.addEventListener("keyup",B,!0),f.addEventListener("blur",re,!0);let ve=o.onMessage((V)=>{if(V.kind==="applyFormat"){Y(V.intent);return}if(V.kind==="openSlash"){xo({anchored:!1});return}if(V.kind==="flushEdits"){X.flush(),o.post({kind:"flushComplete",reqId:V.reqId});return}if(V.kind==="endEdit"){if(Me())Le();return}if(V.kind!=="enterEdit")return;if(!p())return;if(V.prop!==void 0){let Q=xl(a,V.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(V.prop)}"]`);if(Q)q(Q);return}let N=xl(a,V.path);if(N&&it(N))X.placeCaret({offset:V.offset??0,path:V.path})});return()=>{if(a.removeEventListener("keydown",ce),a.removeEventListener("input",ee),a.removeEventListener("input",ne),f.removeEventListener("mouseup",M,!0),f.removeEventListener("keyup",B,!0),f.removeEventListener("blur",re,!0),X.stop(),ve(),T(),m=null,Me())Le()}}var pf=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function mf(o){return pf.has(o)}function bl(o,a){let d=!1,f=null,p=null,m={dismiss:()=>{if(!d)return;d=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>d,show:(E,C,T)=>{if({onSelect:f}=T,d&&C===p)return;d=!0,p=C;let A=Pe(E),H={filter:C,kind:"slashShow",rect:{height:A.height,width:A.width,x:A.left,y:A.top}};if(T.showFilter===!0)H.showFilter=!0;o.post(H)}};uo(m);let g=(E)=>{if(!d||!mf(E.key))return;E.preventDefault(),E.stopPropagation(),o.post({key:E.key,kind:"slashNav"})},h=()=>{if(d)m.dismiss()};a.addEventListener("keydown",g,!0),a.addEventListener("mousedown",h,!0);let y=o.onMessage((E)=>{if(E.kind==="slashSelect"){d=!1,p=null,f?.({...E.cmd});return}if(E.kind==="slashDismissed")d=!1,p=null});return()=>{a.removeEventListener("keydown",g,!0),a.removeEventListener("mousedown",h,!0),y(),uo({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var Sl=["global","canvas","caret","grid","code","dock","palette"];var bh={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var hf=["mod","ctrl","alt","shift"],gf=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),xf=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function yf(o){return[...hf.filter((d)=>o[d]),o.key].join("+")}function bf(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function vl(o,a){let d=bf(o.code)??o.key.toLowerCase();if(gf.has(d))return"";let f={mod:a?o.metaKey:o.ctrlKey,ctrl:a?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:xf.get(d)??d};return yf(f)}var wh=["global",...Sl.filter((o)=>o!=="global"&&o!=="palette")];var Sf=["caret","global"],vf=["canvas","global"],Ef=["global"],ir={chords:[],mac:!1};function wf(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function Tf(o,a){if(o)return Sf;return a==="preview"?Ef:vf}function Cf(o,a=ir,d=!1,f="design"){if(wf(o.target))return!1;let p=vl(o,a.mac);if(!p)return!1;let m=Tf(d,f);return a.chords.some((g)=>g.chord===p&&m.includes(g.scope))}function Af(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function El(o,a=document,d=()=>!1,f=()=>ir,p=()=>"design"){let m=(g)=>{if(!Cf(g,f(),d(),p()))return;g.preventDefault(),o.post({event:Af(g),kind:"forwardKey"})};return a.addEventListener("keydown",m,!0),()=>a.removeEventListener("keydown",m,!0)}var No=new WeakMap,sr=new Set;function Ro(o,a,d){let f=xe(o,a);if(f===void 0)throw Error(`iframe-patch-node-not-found:${a.join("/")}`);let p=e(f)?f:hl(Pt(f),pl(o,a)),{result:m,stop:g}=bt(()=>Oe(p,d.defs,{_path:Pf(a,d),onNodeCreated:ao(d.mapperCtx)}));if(sr.add(g),m instanceof HTMLElement)No.set(m,g);return m}function $o(o){let a=[o,...o.querySelectorAll("*")];for(let d of a){if(!(d instanceof HTMLElement))continue;kn(d);let f=No.get(d);if(f)f(),sr.delete(f),No.delete(d)}}function wl(){for(let o of sr)o();sr.clear()}function Pf(o,a){let{mapperCtx:d}=a;if(d.layoutWrapped&&d.pageContentPrefix&&o[0]==="children"){let[,f]=o;return i(f)?[...d.pageContentPrefix,f+(d.pageContentOffset??0),...o.slice(2)]:[...d.pageContentPrefix,...o.slice(1)]}return o}function Al(o,a,d,f,p){for(let g of a)lo(o,g);if(!p?.length){for(let g of a)Tl(o,g,d,f);return}let m=new Set(p.map((g)=>ae(g)));for(let g of a){if(g.op==="set-key"&&m.has(ae(g.path))){Nf(o,g.path,d);continue}Tl(o,g,d,f)}}function Nf(o,a,d){let f=Rl(d,a);if(f)Nt(f,xe(o,a))}function Oo(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function Tl(o,a,d,f){switch(a.op){case"set-key":{if(a.key==="style"){Mf(o,a.path,d,f);return}if(a.key==="textContent"){_f(o,a.path,d);return}if(a.key.startsWith("on"))return;Cl(o,a.path,d,Oo(f));return}case"insert-child":{Rf(o,a.parentPath,a.index,d,Oo(f));return}case"set-child":{Cl(o,[...a.parentPath,"children",a.index],d,Oo(f));return}case"remove-child":{$f(o,a.parentPath,a.index,d);return}case"move-child":{Of(o,a.fromParentPath,a.fromIndex,a.toParentPath,a.toIndex,d);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(a)}`)}}function Rf(o,a,d,f,p){let m=st(f,a),g=xe(o,a),h=Ro(o,[...a,"children",d],p);ar(f,a,d,1),Pl(m,h,Nl(m,g,d)),Nt(m,g)}function Cl(o,a,d,f){let p=st(d,a),m=Ro(o,a,f);$o(p),p.replaceWith(m)}function $f(o,a,d,f){let p=st(f,[...a,"children",d]),m=p.parentElement;if($o(p),p.remove(),ar(f,a,d+1,-1),m)Nt(m,xe(o,a))}function Of(o,a,d,f,p,m){let g=[...a,"children",d],h=st(m,g),y=h.parentElement,E=st(m,f);h.remove(),ar(m,a,d+1,-1);let C=lr(E)??f;ar(m,C,p,1),kf(h,g,[...C,"children",p]);let T=xe(o,C);if(Pl(E,h,Nl(E,T,p)),y)Nt(y,xe(o,lr(y)??a));Nt(E,T)}function Nt(o,a){for(let f of sl)o.classList.remove(f);let d=a?Ao(a):null;if(d)o.classList.add(d)}function Pl(o,a,d){if(d)d.before(a);else o.append(a)}function Nl(o,a,d){let f=a?.textContent,p=f!=null&&String(f)!==""?1:0;return o.childNodes[p+d]??null}function ar(o,a,d,f){let p=a.length;for(let m of o.querySelectorAll("[data-jx-path]")){let g=lr(m);if(!g||g.length<p+2||g[p]!=="children")continue;let h=g[p+1];if(!i(h)||h<d)continue;if(!a.every((E,C)=>g[C]===E))continue;let y=[...g];y[p+1]=h+f,m.dataset.jxPath=ae(y)}}function kf(o,a,d){let f=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of f){let m=lr(p);if(!m||m.length<a.length||!a.every((g,h)=>m[h]===g))continue;p.dataset.jxPath=ae([...d,...m.slice(a.length)])}}function lr(o){let a=o.dataset.jxPath;return a===void 0?null:ge(a)}function Mf(o,a,d,f){let p=st(d,a),m=xe(o,a),g=f?.defs.$media??{};Vn(p,Jf(m?.style),g,f?.defs??{})}function _f(o,a,d){let f=st(d,a),p=xe(o,a);f.textContent=Df(p),Nt(f,p)}function st(o,a){let d=Rl(o,a);if(!d)throw Error(`iframe-patch-element-not-found:${ae(a)}`);return d}function Rl(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Jf(o){if(!o||!n(o))return;let a={};for(let[d,f]of Object.entries(o)){if(We(f))continue;a[d]=f}return a}function Df(o){let a=o?.textContent;if(a==null)return"";if(e(a))return a.includes("${")?an(a):a;if(n(a)&&a.$ref){let d=String(a.$ref);return`{${d.startsWith("#/state/")?d.slice(8):d}}`}return String(a)}function $l(o){if(o===void 0)return"undefined";let a;try{a=JSON.stringify(o)??"undefined"}catch{a=String(o)}if(a.length>48)a=`${a.slice(0,47)}…`;return a}function Lf(o){return s(o)&&"$expression"in o&&Array.isArray(o.parameters)}function If(o){try{return structuredClone(o)}catch{return null}}function jf(o,a){let d={};for(let f of Object.keys(o))try{let p=o[f];if(t(p)){if(Lf(a?.[f]))d[f]=p;continue}let m=JSON.stringify(p);d[f]=m===void 0?null:JSON.parse(m)}catch{d[f]=null}return d}function Hf(o,a,d){if(!d||d.length===0)return o;let f=a,p=o;for(let m of d){if(!n(f))break;let g=f;if(g.$prototype==="Array"&&m==="map"){let h=g.items,y=r(h)?Se(h.$ref,p):h;if(Array.isArray(y)&&y.length>0){let[E]=y,C=If(E),T=Object.create(p);T.$map={index:0,item:C},T["$map/item"]=C,T["$map/index"]=0,p=T}}f=g[m]}return p}function Ol(o,a,d,f){let p=d?.state??null;return o.map(({id:m,node:g})=>{let h=new Map,y;try{y=Hf(jf(a,p),d,f)}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[]}}try{if(!n(g)||!("operator"in g))throw Error("not an expression node");return Ce(g,y,null,void 0,{report:(E,C)=>{h.set(E.join("/"),$l(C))}}),{id:m,values:[...h.entries()]}}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[...h.entries()]}}})}var Ff=256000,Vf="[large value omitted]";function kl(o){let a={};for(let d of Object.keys(o))try{let f=o[d];if(t(f))continue;let p=JSON.stringify(f);if(p===void 0){a[d]=null;continue}if(p.length>Ff){a[d]=Vf;continue}a[d]=JSON.parse(p)}catch{a[d]=null}return a}function Ml(o,a){return new URL(`/node_modules/${o}`,a).href}var _l={"jx-ui:/behaviors/color-area.ts":()=>(me("6rbra5dy"),import("./chunks/color-area-6rbra5dy.js")),"jx-ui:/behaviors/color-field.ts":()=>(me("gy56c94g"),import("./chunks/color-field-gy56c94g.js")),"jx-ui:/behaviors/color-slider.ts":()=>(me("sqqdyf6c"),import("./chunks/color-slider-sqqdyf6c.js")),"jx-ui:/behaviors/combobox.ts":()=>(me("72h32ejk"),import("./chunks/combobox-72h32ejk.js")),"jx-ui:/behaviors/dialog.ts":()=>(me("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(me("c421cf8c"),import("./chunks/listbox-c421cf8c.js")),"jx-ui:/behaviors/menu.ts":()=>(me("bdpzbfvs"),import("./chunks/menu-bdpzbfvs.js")),"jx-ui:/behaviors/number-field.ts":()=>(me("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(me("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(me("b89sfej7"),import("./chunks/popover-b89sfej7.js")),"jx-ui:/behaviors/select.ts":()=>(me("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(me("c9zfdgxf"),import("./chunks/split-c9zfdgxf.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(me("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(me("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(me("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(me("9xa4hm7n"),import("./chunks/tree-9xa4hm7n.js")),"jx-ui:/behaviors/tooltip.ts":()=>(me("yypz28gq"),import("./chunks/tooltip-yypz28gq.js")),"jx-ui:/behaviors/textfield.ts":()=>(me("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(me("1gv0h53h"),import("./chunks/toast-1gv0h53h.js")),"jx-ui:/behaviors/toast-host.ts":()=>(me("1yg5ar8d"),import("./chunks/toast-host-1yg5ar8d.js")),"jx-ui:/color.ts":()=>(me("m7r1vk54"),import("./chunks/color-m7r1vk54.js")),"jx-ui:/icons.ts":()=>(me("63bjtbs7"),import("./chunks/icons-63bjtbs7.js"))};var Wf;function Jl(o){Wf=new URL("./",o).href}Jl(import.meta.url);for(let[o,a]of Object.entries(_l))Ls(o,a);Js((o)=>Ml(o,location.href));function ln(o,a,d,f){let p=So(o.x,o.y,f);if(!p)return null;return vo(p,o.y,d,a)}function ko(o){return[...o.dataTransfer?.types??[]].includes("Files")}var Bf={type:"block"},_o={},Mo=null;function Dl(o){return o?{...o,versions:_o}:null}function Kf(o,a){let d=o.dataset.jxPath;if(d==null)return null;let f=ge(d),p=a?xe(a,f):void 0;return{path:f,rect:Qe(o),tagName:(u(p?.tagName)||o.tagName).toLowerCase()}}function Uf(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let a=o.closest("[data-jx-layout-region]");if(!(a instanceof HTMLElement))return null;return{className:a.className,layoutFile:a.dataset.jxLayoutFile??"",layoutPath:ge(a.dataset.jxLayoutPath??"[]"),rect:Qe(a),tagName:a.tagName.toLowerCase()}}function Ll(o){let a=n(o)&&"message"in o?o.message:void 0;return String(a??o)}var qf=new Set(["style","textContent"]);function zf(o){let a=Da();if(!a)return!1;for(let d of o){let f;if(d.op==="set-key"){if(qf.has(d.key)||d.key.startsWith("on"))continue;f=d.path}else if(d.op==="move-child"){if(f=d.fromParentPath,Et(f,a)||Et(d.toParentPath,a))return!0;continue}else f=d.parentPath;if(Et(f,a))return!0}return!1}var Gf=2,Yf=5000,Xf=500;function Zf(o){let{channel:a,container:d}=o;_o={},Mo=null;let f=null,p=null,m=-1,g=aa(d.ownerDocument),h=null,y=-1,E="design",C=null,T=null,A=ir,H=null,k=null,K=-1,L=-1,_=0,Y=null,q=d.ownerDocument.defaultView;function G(){if(_&&q)q.cancelAnimationFrame(_);_=0,Y=null}function U(){_=0;let P=Y?.src??k;if(!q||!Y||!P||!h)return;let ie=Eo(Y.y,q.innerHeight);if(ie===0)return;let oe=q.scrollY;if(q.scrollBy(0,ie*Za),q.scrollY===oe)return;let Ee=ln(Y,P,h,d.ownerDocument),se={dragSeq:Y.dragSeq,gen:Y.gen??K,kind:"dragOver",preview:Ee};if(Y.withCursor)se.cursor={x:Y.x,y:Y.y};a.post(se),_=q.requestAnimationFrame(U)}function M(P,ie,oe){if(!q||Eo(P.y,q.innerHeight)===0){G();return}let Ee={dragSeq:ie,withCursor:oe!=null,x:P.x,y:P.y};if(oe)Ee.gen=oe.gen,Ee.src=oe.src;if(Y=Ee,!_)_=q.requestAnimationFrame(U)}let B=za(a,d.ownerDocument,{getGen:()=>y,getMode:()=>E,getShadowDoc:()=>h}),re=(P)=>{if(E!=="design"&&E!=="edit")return;let ie=Uf(P.target);if(ie)a.post({hit:ie,kind:"layoutHit"})};d.ownerDocument.addEventListener("click",re,!0);let X=El(a,d.ownerDocument,Me,()=>A,()=>E),ce=yl(a,d,{getMode:()=>E,getShadowDoc:()=>h}),ee=bl(a,d.ownerDocument),ne=la(d),ve=30000,V=-1;function N(){let P=d.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),ie=Pe(d),oe=0;for(let Ee of P)oe=Math.max(oe,Pe(Ee).bottom-ie.top);return oe}function z(){let P=Math.max(d.scrollHeight,N()),ie=Math.min(P,ve);if(ie>0&&Math.abs(ie-V)>=1){V=ie;let oe=d.firstElementChild,Ee=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;a.post({fragment:Ee,height:ie,kind:"contentHeight"}),at()}}let Q=q?.ResizeObserver,de=Q?new Q(()=>z()):null,_e=d.ownerDocument,ye=0,Ae=0,cn=0,Be="",Rt=new Map;function Il(){let P=Date.now();for(let[ie,oe]of Rt)if(oe<=P)Rt.delete(ie);return Rt.size}function jl(){let P=_e;return{animations:P.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:P.fonts?P.fonts.status==="loaded":!0,gen:y,images:Il(),kind:"idle"}}function Jo(){ye=0;let P=jl(),ie=`${P.gen}|${P.fonts}|${P.animations}|${P.images}`,oe=ie!==Be;if(oe)Be=ie,a.post(P);if(Ae=P.fonts&&P.animations===0&&P.images===0?oe?1:Ae+1:0,Ae>=Gf){z();return}if(Date.now()>=cn)return;ye=q?q.requestAnimationFrame(Jo):0}function at(){if(Ae=0,cn=Date.now()+Yf,!ye&&q)ye=q.requestAnimationFrame(Jo)}let Do=(P)=>{if(P.target instanceof HTMLImageElement)Rt.set(P.target,Date.now()+Xf),at()},Lo=(P)=>{if(P.target instanceof HTMLImageElement&&Rt.delete(P.target))at()};d.addEventListener("error",Do,!0),d.addEventListener("load",Lo,!0),at(),de?.observe(d);let Io=(P)=>{if(E==="preview"){if(P.ctrlKey||P.metaKey)P.preventDefault();return}P.preventDefault(),a.post({ctrlKey:P.ctrlKey,deltaX:P.deltaX,deltaY:P.deltaY,kind:"forwardWheel",metaKey:P.metaKey,shiftKey:P.shiftKey,x:P.clientX,y:P.clientY})};d.ownerDocument.addEventListener("wheel",Io,{passive:!1});let Hl=300,jo=0,Ho=(P,ie)=>{P.preventDefault(),P.stopPropagation();let oe={x:P.clientX,y:P.clientY},Ee=d.ownerDocument,se=So(oe.x,oe.y,Ee),Re=se?Kf(se,h):null,dn=h&&se?vo(se,oe.y,h,Bf):null;if(ie==="fileDragOver"){if(P.dataTransfer)P.dataTransfer.dropEffect="copy";a.post({hit:Re,kind:"fileDragOver",preview:dn});return}a.post({files:[...P.dataTransfer?.files??[]],hit:Re,kind:"fileDrop",preview:dn})},un=(P)=>{if(!k){if(ko(P)){Ho(P,"fileDragOver");return}let Ee=Date.now();if(Ee-jo>=Hl)jo=Ee,a.post({kind:"nativeDragEnter"});return}if(P.preventDefault(),P.dataTransfer)P.dataTransfer.dropEffect="move";let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,k,h,d.ownerDocument):null;a.post({cursor:ie,dragSeq:L,gen:K,kind:"dragOver",preview:oe}),M(ie,L)},Fo=(P)=>{if(!k){if(ko(P))Ho(P,"fileDrop");return}P.preventDefault();let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,k,h,d.ownerDocument):null;a.post({dragSeq:L,gen:K,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),k=null,K=-1,L=-1,G()},Vo=(P)=>{if(!k&&ko(P)&&!P.relatedTarget)a.post({kind:"fileDragLeave"})};d.ownerDocument.addEventListener("dragenter",un,!0),d.ownerDocument.addEventListener("dragover",un,!0),d.ownerDocument.addEventListener("dragleave",Vo,!0),d.ownerDocument.addEventListener("drop",Fo,!0);let Fl=a.onMessage((P)=>{if(P.kind==="measure"){let{hidden:se,hits:Re}=qa(P.paths,d.ownerDocument);a.post({hidden:se,hits:Re,kind:"geometry",reqId:P.reqId});return}if(P.kind==="evalExpr"){let se=P.gen===y&&H&&h?Ol(P.exprs,H.defs,h,P.contextPath):[];a.post({gen:P.gen,kind:"evalResult",reqId:P.reqId,results:se});return}if(P.kind==="patch"){let{gen:se}=P;if(se<y){a.post({gen:se,kind:"patchError",message:"patch-behind-render"});return}if(se>y||!h||!H){a.post({gen:se,kind:"patchError",message:"patch-ahead-of-render"});return}let Re=new Set((P.echoPaths??[]).map((lt)=>ae(lt))),dn=Re.size===0?P.forwardOps:P.forwardOps.filter((lt)=>!(lt.op==="set-key"&&Re.has(ae(lt.path)))),Wo=Me()&&zf(dn),Bo=Wo?nr(d,it):null;if(Wo)Le();try{if(Al(h,P.forwardOps,d,H,P.echoPaths),en(d,C),vt(d,T),Bo)sn(d,Bo);a.post({gen:se,kind:"patchComplete"}),at()}catch(lt){a.post({gen:se,kind:"patchError",message:Ll(lt)})}return}if(P.kind==="styleUpdate"){if(P.gen!==y||!h)return;h.style=P.style;let se=d.firstElementChild;if(se instanceof HTMLElement)Vn(se,P.style,h.$media??{});return}if(P.kind==="dragStart"){k=P.src,K=P.gen,L=P.dragSeq;return}if(P.kind==="dragEnd"||P.kind==="dragCancel"){k=null,K=-1,L=-1,G();return}if(P.kind==="dragMove"){let se=k&&h?ln(P.cursor,k,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,kind:"dragOver",preview:se}),M(P.cursor,P.dragSeq);return}if(P.kind==="drop"){let se=k&&h?ln(P.cursor,k,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,instruction:se?.instruction??null,kind:"dropResult",targetPath:se?.targetPath??null}),k=null,K=-1,L=-1,G();return}if(P.kind==="assetVersions"){_o=P.versions;let se=Dl(Mo);if(se)Dn((Re)=>Xt(Re,se));return}if(P.kind==="keymap"){A={chords:P.chords,mac:P.mac};return}if(P.kind==="setColorScheme"){so(d.ownerDocument,P.scheme);return}if(P.kind==="setPopoverOpen"){if(E==="preview")return;C=P.path===null?null:ae(P.path),en(d,C),vt(d,T),z();return}if(P.kind==="setDialogOpen"){if(E==="preview")return;T=P.path===null?null:ae(P.path),vt(d,T),z();return}if(P.kind==="redefineElement"){qs(P.doc,P.base);return}if(P.kind==="setLocale"){qn(d.ownerDocument,P.locale===null?null:{dir:P.dir,locale:P.locale},g);return}if(P.kind==="siteStyleUpdate"){io(P.siteStyle,P.media);return}if(P.kind!=="render"||P.gen<m)return;if(so(d.ownerDocument,P.colorScheme??null),qn(d.ownerDocument,P.locale??null,g),Me())Le();m=P.gen,Mo=P.assets??null,Ma(P.editableTags??null);let{gen:ie,mapperCtx:oe}=P,Ee=P.shadowDoc;(async()=>{try{wl(),p?.(),p=null,f?.dispose(),Vs(d.ownerDocument);let se={assets:Dl(P.assets??null),container:d,doc:P.doc,docBase:P.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:P.diffMarks??null,mode:P.mode,popoverOpen:P.popoverOpen?ae(P.popoverOpen):null,dialogOpen:P.dialogOpen?ae(P.dialogOpen):null,siteStyle:P.siteStyle};if(P.allowAutoRequests)se.allowAutoRequests=!0;if(f=await ca(se),ie===m){C=P.popoverOpen?ae(P.popoverOpen):null,T=P.dialogOpen?ae(P.dialogOpen):null,en(d,C),vt(d,T),h=Ee,H=f.ctx,y=ie,E=P.mode,a.post({gen:ie,kind:"renderComplete"}),at();let{defs:Re}=f.ctx;p=vs(()=>{try{a.post({gen:ie,kind:"dataScope",scope:kl(Re)})}catch{}}),z()}}catch(se){a.post({gen:ie,kind:"renderError",message:Ll(se)})}})()});return a.post({kind:"ready"}),()=>{if(Fl(),qn(d.ownerDocument,null,g),B(),X(),ce(),ee(),ne(),ye&&q)q.cancelAnimationFrame(ye);ye=0,d.removeEventListener("error",Do,!0),d.removeEventListener("load",Lo,!0),G(),de?.disconnect(),d.ownerDocument.removeEventListener("click",re,!0),d.ownerDocument.removeEventListener("wheel",Io),d.ownerDocument.removeEventListener("dragenter",un,!0),d.ownerDocument.removeEventListener("dragleave",Vo,!0),d.ownerDocument.removeEventListener("dragover",un,!0),d.ownerDocument.removeEventListener("drop",Fo,!0),p?.(),f?.dispose()}}function Qf(o){let a=new URLSearchParams(o.location.search);bs(a.get("rpcToken"));let d=a.get("parentOrigin"),f=d||"*";if(!d)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,g=Uo({acceptOrigin:f,source:o,target:o.parent,targetOrigin:f,token:a.get("token")||""});return Zf({channel:g,container:m})}if(typeof window<"u"&&window.parent!==window)Qf(window);export{Gf as IDLE_QUIET_FRAMES,Yf as IDLE_WATCH_MAX_MS,Xf as IMAGE_RETRY_WINDOW_MS,Qf as bootCanvasIframe,Kf as fileDropHitFor,ko as isExternalFileDrag,Uf as layoutHitFor,zf as patchDisturbsActiveEdit,Zf as startCanvasIframe};
|
|
313
317
|
|
|
314
|
-
//# debugId=
|
|
318
|
+
//# debugId=376A8BE22AD4734264756E2164756E21
|
|
315
319
|
//# sourceMappingURL=iframe-entry.js.map
|