@jxsuite/studio 10.4.0 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/locales/en/elements.json +434 -0
- package/data/webdata.json +116 -139
- package/dist/chunks/2020-rqm7qrje.js +4 -0
- package/dist/chunks/adapter-cyy8vbcx.js +4 -0
- package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
- package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-v3qd2dhw.js} +3 -3
- package/dist/chunks/cf-settings-1fnw874z.js +4 -0
- package/dist/chunks/{color-area-h8dbasp1.js → color-area-frd9y9q6.js} +2 -2
- package/dist/chunks/color-field-rebpbe33.js +4 -0
- package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-6bzmk3s7.js} +2 -2
- package/dist/chunks/color-t2bnnj8y.js +4 -0
- package/dist/chunks/{combobox-6hs00996.js → combobox-c49x7gf1.js} +3 -3
- package/dist/chunks/components-y8yhdd7d.js +4 -0
- package/dist/chunks/content-source-9e7qvmsf.js +4 -0
- package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
- package/dist/chunks/editor-mb9jzdrw.js +4 -0
- package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
- package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
- package/dist/chunks/file-ops-dtdvjmza.js +4 -0
- package/dist/chunks/files-8pf70854.js +4 -0
- package/dist/chunks/format-host-fd3m2y2a.js +4 -0
- package/dist/chunks/fs-events-hrk29vcv.js +4 -0
- package/dist/chunks/grid-open-bh74v82z.js +4 -0
- package/dist/chunks/{grid-view-2f03wcgw.js → grid-view-a51mgzmq.js} +17 -17
- package/dist/chunks/{icons-gb967qc8.js → icons-qp8fn1k8.js} +2 -2
- package/dist/chunks/{iframe-entry-btck0e9s.js → iframe-entry-mpwe5pwk.js} +4 -4
- package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
- package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
- package/dist/chunks/{iframe-entry-b5qgggyp.js → iframe-entry-v40cr813.js} +4 -4
- package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
- package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-q9ajdjsj.js} +3 -3
- package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-ke9std9b.js} +3 -3
- package/dist/chunks/index-57ang7ma.js +4 -0
- package/dist/chunks/index-eytr7av4.js +17 -0
- package/dist/chunks/{index-yjrfeks8.js → index-x495reff.js} +3 -3
- package/dist/chunks/{javascript-hy2mws8v.js → javascript-qe34bvaz.js} +3 -3
- package/dist/chunks/jsonMode-m8rseh31.js +13 -0
- package/dist/chunks/jx-validate-bbd1mary.js +4 -0
- package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
- package/dist/chunks/layers-yscpys6q.js +4 -0
- package/dist/chunks/{listbox-7gka1h86.js → listbox-tktzq5xj.js} +2 -2
- package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
- package/dist/chunks/media-library-2hfff88g.js +4 -0
- package/dist/chunks/media-open-4pb05cne.js +4 -0
- package/dist/chunks/media-picker-bzktmmwr.js +4 -0
- package/dist/chunks/menu-xc3cbgsd.js +4 -0
- package/dist/chunks/{monaco-binding-a51py33c.js → monaco-binding-7t38arh9.js} +3 -3
- package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
- package/dist/chunks/monaco-setup-fstdew02.js +4 -0
- package/dist/chunks/notify-gbdcckrh.js +4 -0
- package/dist/chunks/parse-fpdzgk4c.js +4 -0
- package/dist/chunks/platform-9g72gdqr.js +4 -0
- package/dist/chunks/popover-cnmsav6b.js +4 -0
- package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
- package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
- package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
- package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
- package/dist/chunks/references-yg1g9rwx.js +4 -0
- package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
- package/dist/chunks/source-control-rrc4jgp5.js +4 -0
- package/dist/chunks/{split-m5rwn31z.js → split-d15yencd.js} +2 -2
- package/dist/chunks/studio-0jhhznxy.js +9 -0
- package/dist/chunks/studio-0nb57pjg.js +7 -0
- package/dist/chunks/{studio-s24mhq0z.js → studio-0wa4wv4s.js} +4 -4
- package/dist/chunks/studio-0z8kp4xk.js +5 -0
- package/dist/chunks/{studio-g0hxtcga.js → studio-18gc5t3v.js} +4 -4
- package/dist/chunks/{studio-4fnb5648.js → studio-1b79rpcb.js} +4 -4
- package/dist/chunks/studio-211q5j7m.js +4 -0
- package/dist/chunks/studio-213pyfxh.js +16 -0
- package/dist/chunks/studio-2b1smjvp.js +5 -0
- package/dist/chunks/{studio-nwf0c32p.js → studio-2v6tc9jp.js} +4 -4
- package/dist/chunks/studio-30j0wz99.js +5 -0
- package/dist/chunks/studio-3kmqhwtt.js +5 -0
- package/dist/chunks/studio-44drsmhw.js +5 -0
- package/dist/chunks/{studio-2pk7kc7z.js → studio-495b6f2r.js} +4 -4
- package/dist/chunks/{studio-jma2q8r9.js → studio-4gthb2fd.js} +4 -4
- package/dist/chunks/{studio-0gvvqj3h.js → studio-4xadhxj1.js} +4 -4
- package/dist/chunks/{studio-nvcn2ykc.js → studio-52mzbxqm.js} +4 -4
- package/dist/chunks/{studio-v7a7yb5w.js → studio-56mmnsw8.js} +7 -7
- package/dist/chunks/studio-59hz8f4r.js +5 -0
- package/dist/chunks/{studio-sce30r7b.js → studio-5k9mfafh.js} +3 -3
- package/dist/chunks/{studio-rr00ex23.js → studio-5qez462c.js} +6 -6
- package/dist/chunks/studio-6tnpg0vx.js +5 -0
- package/dist/chunks/studio-6w8mt734.js +6 -0
- package/dist/chunks/studio-7hm04x5z.js +5 -0
- package/dist/chunks/studio-8atmfjjm.js +7 -0
- package/dist/chunks/{studio-wmjmsw0p.js → studio-8n99z71s.js} +4 -4
- package/dist/chunks/studio-8vmad6x2.js +5 -0
- package/dist/chunks/studio-93p5k4r4.js +5 -0
- package/dist/chunks/{studio-2x972v58.js → studio-9gb0m81w.js} +4 -4
- package/dist/chunks/studio-a4ymg4vd.js +5 -0
- package/dist/chunks/studio-anc8067x.js +5 -0
- package/dist/chunks/{studio-2e4hry72.js → studio-dbdt67kr.js} +5 -5
- package/dist/chunks/studio-dbex091t.js +5 -0
- package/dist/chunks/{studio-amaz545p.js → studio-dj8ctxey.js} +4 -4
- package/dist/chunks/{studio-k2evngrj.js → studio-ed9bz68j.js} +5 -5
- package/dist/chunks/{studio-4bgvvzhv.js → studio-fe2d1fp5.js} +4 -4
- package/dist/chunks/{studio-45mj4jqe.js → studio-fgp4cyy3.js} +4 -4
- package/dist/chunks/studio-ft706q02.js +5 -0
- package/dist/chunks/studio-g79s1dyg.js +6 -0
- package/dist/chunks/{studio-pj216fmn.js → studio-gahswxp4.js} +4 -4
- package/dist/chunks/studio-gbqc12bk.js +5 -0
- package/dist/chunks/studio-gxphbetb.js +6 -0
- package/dist/chunks/studio-hdf01j7q.js +7 -0
- package/dist/chunks/studio-hf259xzd.js +48 -0
- package/dist/chunks/studio-jbva4wxw.js +5 -0
- package/dist/chunks/studio-jj9gf1qc.js +5 -0
- package/dist/chunks/studio-jsjg3mjv.js +5 -0
- package/dist/chunks/studio-jtvb8hd7.js +5 -0
- package/dist/chunks/{studio-g9brbewz.js → studio-kp4vzrct.js} +4 -4
- package/dist/chunks/studio-kpx02gaa.js +7 -0
- package/dist/chunks/{studio-3na1r48j.js → studio-kv1728ex.js} +8 -8
- package/dist/chunks/studio-m25ry0mf.js +5 -0
- package/dist/chunks/studio-mcbwmkyh.js +5 -0
- package/dist/chunks/studio-meajkr51.js +5 -0
- package/dist/chunks/studio-mkjrjpr2.js +6 -0
- package/dist/chunks/{studio-eqcddvc2.js → studio-mr084886.js} +201 -201
- package/dist/chunks/studio-mrb10hv3.js +5 -0
- package/dist/chunks/{studio-0939t1q1.js → studio-nhpg405j.js} +4 -4
- package/dist/chunks/studio-nsec0hxm.js +64 -0
- package/dist/chunks/{studio-xx3r3sb0.js → studio-nv0mh0p5.js} +4 -4
- package/dist/chunks/studio-pafmb06w.js +5 -0
- package/dist/chunks/{studio-pm17wdc4.js → studio-pgftd79b.js} +4 -4
- package/dist/chunks/{studio-4zd6an2b.js → studio-pk961xgz.js} +4 -4
- package/dist/chunks/studio-pzbr7g05.js +5 -0
- package/dist/chunks/studio-qcc5hsw2.js +10 -0
- package/dist/chunks/studio-qfq58c8n.js +5 -0
- package/dist/chunks/studio-qvb2jr83.js +5 -0
- package/dist/chunks/studio-r85zw6ay.js +5 -0
- package/dist/chunks/studio-s0kwce5w.js +9 -0
- package/dist/chunks/studio-s6ymkf3q.js +14 -0
- package/dist/chunks/{studio-0x6f3nk9.js → studio-s7p5ccxa.js} +4 -4
- package/dist/chunks/{studio-1410q5dw.js → studio-s9jjap3x.js} +4 -4
- package/dist/chunks/{studio-evq47j2z.js → studio-t5hde1ws.js} +4 -4
- package/dist/chunks/studio-vj9yv897.js +5 -0
- package/dist/chunks/studio-wmak8xjw.js +5 -0
- package/dist/chunks/{studio-bnc50f9h.js → studio-wqsmvtqj.js} +4 -4
- package/dist/chunks/studio-x3z3rhej.js +5 -0
- package/dist/chunks/{studio-bg8pzprg.js → studio-xb55kpmy.js} +4 -4
- package/dist/chunks/studio-xxtdajmv.js +12 -0
- package/dist/chunks/studio-xxttcym1.js +5 -0
- package/dist/chunks/{studio-90zkgne5.js → studio-y2zsnzye.js} +7 -7
- package/dist/chunks/{studio-3qr08sxq.js → studio-y3tjh2xb.js} +3 -3
- package/dist/chunks/studio-y4f1rdsj.js +5 -0
- package/dist/chunks/studio-ybkd5w8k.js +5 -0
- package/dist/chunks/{studio-tpxcryf2.js → studio-yetr4gg1.js} +4 -4
- package/dist/chunks/studio-z295anhs.js +6 -0
- package/dist/chunks/studio-z89e6wpg.js +9 -0
- package/dist/chunks/{studio-5tet77de.js → studio-zbwr6prc.js} +3 -3
- package/dist/chunks/{studio-daksw8kh.js → studio-zdbsv5q2.js} +4 -4
- package/dist/chunks/{studio-abh9kfdh.js → studio-zvthj8hg.js} +4 -4
- package/dist/chunks/toast-2kn2vrn4.js +4 -0
- package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
- package/dist/chunks/{tooltip-dj1pvgz7.js → tooltip-ghkxkasp.js} +3 -3
- package/dist/chunks/{tree-j0ebwr5s.js → tree-vw4nc63s.js} +2 -2
- package/dist/chunks/tsMode-7gngmamr.js +14 -0
- package/dist/chunks/workspace-gv0hxgsm.js +4 -0
- package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
- package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-vs11sxc5.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +84 -83
- package/dist/studio.js +99 -98
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +12 -12
- package/src/browse/library-layouts.ts +9 -12
- package/src/browse/library-pane.ts +22 -16
- package/src/browse/library-source.ts +3 -4
- package/src/browse/preview-style.ts +2 -1
- package/src/canvas/canvas-live-render.ts +2 -5
- package/src/canvas/canvas-page-context.ts +5 -0
- package/src/canvas/canvas-render.ts +6 -1
- package/src/canvas/iframe-drop.ts +84 -1
- package/src/canvas/iframe-entry.ts +9 -6
- package/src/canvas/iframe-render.ts +13 -0
- package/src/collab/collab-session.ts +2 -2
- package/src/commands/levels.ts +1 -1
- package/src/content/entry-commands.ts +32 -27
- package/src/content/entry-editor.ts +46 -44
- package/src/content/entry-inspector.ts +15 -12
- package/src/content/entry-model.ts +3 -3
- package/src/content/entry-summaries.ts +5 -5
- package/src/content/hold-state.ts +172 -0
- package/src/content/page-summaries.ts +10 -14
- package/src/create/add-new-flow.ts +2 -1
- package/src/editor/convert-targets.ts +2 -23
- package/src/editor/inline-edit.ts +6 -1
- package/src/editor/repeater-scope.ts +333 -74
- package/src/editor/slash-menu.ts +35 -17
- package/src/files/files.ts +18 -0
- package/src/format/format-choices.ts +5 -5
- package/src/format/format-host.ts +35 -3
- package/src/grid/redirects-grid.ts +4 -4
- package/src/grid/sources/content-source.ts +42 -66
- package/src/locale/element-names.ts +131 -0
- package/src/panels/block-action-bar.ts +3 -4
- package/src/panels/dnd.ts +3 -1
- package/src/panels/elements-panel.ts +93 -36
- package/src/panels/events-panel.ts +6 -2
- package/src/panels/formula-workspace.ts +9 -0
- package/src/panels/imports-panel.ts +3 -2
- package/src/panels/navigator-panels.ts +10 -10
- package/src/panels/panel-registry.ts +3 -3
- package/src/panels/properties-panel.ts +127 -35
- package/src/panels/site-panel.ts +2 -1
- package/src/panels/statement-editor.ts +4 -0
- package/src/panels/style-panel.ts +2 -1
- package/src/panels/styles-panel.ts +2 -2
- package/src/panels/tab-strip.ts +29 -26
- package/src/platforms/cloud.ts +5 -2
- package/src/services/ai-command-tools.ts +2 -1
- package/src/services/ai-project-tools.ts +21 -8
- package/src/services/ai-tools.ts +5 -5
- package/src/services/ai-write-report.ts +22 -4
- package/src/services/context-manager.ts +110 -2
- package/src/services/document-assistant.ts +2 -2
- package/src/services/harness/chat-reducer.ts +9 -4
- package/src/services/jxn-language.ts +110 -0
- package/src/services/model-uri.ts +3 -0
- package/src/services/monaco-setup.ts +6 -2
- package/src/services/render-critic.ts +234 -12
- package/src/services/tool-executor.ts +16 -8
- package/src/settings/contributed-section.ts +2 -1
- package/src/settings/extension-commands.ts +2 -1
- package/src/settings/general-settings.ts +2 -2
- package/src/settings/settings-document.ts +5 -5
- package/src/shell.ts +1 -1
- package/src/studio.ts +28 -11
- package/src/style/variables-view.ts +2 -2
- package/src/surfaces/collections-panel.json +1 -1
- package/src/surfaces/collections-panel.ts +1 -1
- package/src/surfaces/entry-editor.json +10 -10
- package/src/surfaces/entry-editor.ts +22 -19
- package/src/surfaces/entry-inspector.json +11 -11
- package/src/surfaces/entry-inspector.ts +17 -10
- package/src/surfaces/panel-elements.json +466 -206
- package/src/surfaces/panel-elements.ts +61 -25
- package/src/surfaces/tab-strip.json +5 -5
- package/src/surfaces/tab-strip.ts +2 -2
- package/src/tabs/project-config.ts +13 -13
- package/src/tabs/tab.ts +7 -2
- package/src/types.ts +13 -2
- package/src/ui/expression-editor.ts +10 -5
- package/src/ui/schema-form.ts +18 -1
- package/src/utils/edit-display.ts +27 -1
- package/src/view.ts +9 -2
- package/src/workspace/tab-workspace.ts +2 -2
- package/src/workspace/workspace-back.ts +2 -2
- package/dist/chunks/2020-906vx2dq.js +0 -4
- package/dist/chunks/adapter-hnvad61x.js +0 -4
- package/dist/chunks/add-new-flow-v0pm96mr.js +0 -4
- package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
- package/dist/chunks/color-04361ttk.js +0 -4
- package/dist/chunks/color-field-qv5r2b16.js +0 -4
- package/dist/chunks/components-w5zqwva1.js +0 -4
- package/dist/chunks/content-source-g38w0d3f.js +0 -4
- package/dist/chunks/convert-to-repeater-r8sfxjjm.js +0 -4
- package/dist/chunks/editor-wvf5e6j9.js +0 -4
- package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
- package/dist/chunks/extension-sections-vjzw46xb.js +0 -4
- package/dist/chunks/file-ops-1sghzgcr.js +0 -4
- package/dist/chunks/files-zrqtgt41.js +0 -4
- package/dist/chunks/format-host-9gy76erh.js +0 -4
- package/dist/chunks/fs-events-45rhg3me.js +0 -4
- package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
- package/dist/chunks/iframe-entry-42hpmwz5.js +0 -5
- package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
- package/dist/chunks/index-f9qr7kzh.js +0 -4
- package/dist/chunks/jsonMode-vj30te2h.js +0 -13
- package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
- package/dist/chunks/layers-m49nmwvx.js +0 -4
- package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
- package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
- package/dist/chunks/media-library-j74rt0w4.js +0 -4
- package/dist/chunks/media-open-mypr0k6b.js +0 -4
- package/dist/chunks/media-picker-pemtbsjv.js +0 -4
- package/dist/chunks/menu-d2jxpgma.js +0 -4
- package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
- package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
- package/dist/chunks/notify-bwehrp7q.js +0 -4
- package/dist/chunks/parse-hee7ne9b.js +0 -4
- package/dist/chunks/platform-kv0k65cy.js +0 -4
- package/dist/chunks/popover-9tf4cjrk.js +0 -4
- package/dist/chunks/publish-panel-vg1n880b.js +0 -4
- package/dist/chunks/publish-quick-4fwngwrw.js +0 -4
- package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
- package/dist/chunks/quick-search-nh29rt8a.js +0 -4
- package/dist/chunks/references-vqyr5s9x.js +0 -4
- package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
- package/dist/chunks/source-control-h3hcs5gy.js +0 -4
- package/dist/chunks/studio-0khd8xtx.js +0 -4
- package/dist/chunks/studio-1ctnw3xv.js +0 -5
- package/dist/chunks/studio-1ks5d9y4.js +0 -5
- package/dist/chunks/studio-1y9mab9m.js +0 -5
- package/dist/chunks/studio-2kpxm0eh.js +0 -7
- package/dist/chunks/studio-2zz4qbv9.js +0 -5
- package/dist/chunks/studio-3pz4t5a2.js +0 -5
- package/dist/chunks/studio-4f7thq0p.js +0 -5
- package/dist/chunks/studio-61rg2cz5.js +0 -5
- package/dist/chunks/studio-7rrdbvex.js +0 -5
- package/dist/chunks/studio-9c6cbq2c.js +0 -4
- package/dist/chunks/studio-9dq7rwc7.js +0 -5
- package/dist/chunks/studio-9gr7xs9r.js +0 -6
- package/dist/chunks/studio-a88ej93p.js +0 -7
- package/dist/chunks/studio-acer0g8w.js +0 -5
- package/dist/chunks/studio-az3wvyh2.js +0 -5
- package/dist/chunks/studio-brh8d2pr.js +0 -5
- package/dist/chunks/studio-c2fa783p.js +0 -9
- package/dist/chunks/studio-cfnn70h1.js +0 -5
- package/dist/chunks/studio-cqxj4fcy.js +0 -5
- package/dist/chunks/studio-cw11h078.js +0 -5
- package/dist/chunks/studio-dn56z7sn.js +0 -5
- package/dist/chunks/studio-egnjpyde.js +0 -9
- package/dist/chunks/studio-ejrypvmq.js +0 -5
- package/dist/chunks/studio-frc16j8v.js +0 -10
- package/dist/chunks/studio-gnazwtv3.js +0 -5
- package/dist/chunks/studio-hfqpfmpk.js +0 -5
- package/dist/chunks/studio-hh394phe.js +0 -5
- package/dist/chunks/studio-j0zf5x2x.js +0 -5
- package/dist/chunks/studio-j5fcp6gj.js +0 -5
- package/dist/chunks/studio-jd1qb1st.js +0 -7
- package/dist/chunks/studio-k0xzrse2.js +0 -64
- package/dist/chunks/studio-k1xqrgm5.js +0 -5
- package/dist/chunks/studio-k3we3kqb.js +0 -5
- package/dist/chunks/studio-knsjyx7n.js +0 -5
- package/dist/chunks/studio-mrjtnm62.js +0 -5
- package/dist/chunks/studio-n9qba0gx.js +0 -5
- package/dist/chunks/studio-nzemfbkk.js +0 -14
- package/dist/chunks/studio-pwctzka3.js +0 -16
- package/dist/chunks/studio-q80fg1d6.js +0 -12
- package/dist/chunks/studio-q9hx2qp0.js +0 -5
- package/dist/chunks/studio-qrzmfaf6.js +0 -5
- package/dist/chunks/studio-r6mx7vm5.js +0 -7
- package/dist/chunks/studio-swedpd82.js +0 -5
- package/dist/chunks/studio-tmfcn347.js +0 -6
- package/dist/chunks/studio-v5wktj6f.js +0 -5
- package/dist/chunks/studio-vpevkfxw.js +0 -5
- package/dist/chunks/studio-wqfaqw4m.js +0 -5
- package/dist/chunks/studio-xpx91fby.js +0 -6
- package/dist/chunks/studio-xva3hzkv.js +0 -5
- package/dist/chunks/studio-z3fztxrp.js +0 -9
- package/dist/chunks/studio-z9453ypn.js +0 -6
- package/dist/chunks/toast-w11qpkyz.js +0 -4
- package/dist/chunks/tsMode-jg1dtphj.js +0 -14
- package/dist/chunks/workspace-6ztqcrsh.js +0 -4
- package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
- package/src/content/draft-state.ts +0 -108
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jn,Sy,Wt,ln,br,Zx,fP,xn,Pe,Oa,a_,St,c_,Bi,qn,Se,fi,AR,$r,Fe,Jn,X,oo,Ch,Zp,Xe,Xp,mi,g,h,pn,ko,Qp}from"./studio-ybkd5w8k.js";import{w}from"./studio-5k9mfafh.js";import{tt,yr,ef,rd}from"./studio-r85zw6ay.js";import{p,we}from"./studio-1b79rpcb.js";import{sd,zi}from"./studio-hf259xzd.js";import{vf,lu,Gy,ld,Ns,Lr,Ds,Ba,_f,uc,Yy,EM,$o,or,Ah,Zy}from"./studio-s6ymkf3q.js";import{t1,De,Jc,Kc}from"./studio-mrb10hv3.js";import{_y,yh,Jp}from"./studio-44drsmhw.js";import{ca,Ot}from"./studio-6tnpg0vx.js";import{bl,Uo,Xs,Qs,qo}from"./studio-y2zsnzye.js";import{ae}from"./studio-dbex091t.js";import{nr,PA,eR,Dx,Ox,Ls,Wp,gl,Ax,tR,u,dR}from"./studio-3kmqhwtt.js";import{gh,ac,wy,bh}from"./studio-meajkr51.js";import{so,zt,Wi,Eo,x,ru,sf,$h,wn}from"./studio-anc8067x.js";import{re,sa}from"./studio-ft706q02.js";import{Me,E_}from"./studio-4xadhxj1.js";import{me,te,le}from"./studio-y3tjh2xb.js";import{j_}from"./studio-zvthj8hg.js";import{n,J,Q,S,f,Oe,Ir,Gn,hr,rt,ud}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var _r=128,hL="fullRender",cA="mountCanvas",dA="patchBatch",rn="prepareRender",Jr={derivedResolves:0,derivedRetargets:0,escalations:0,fullRenders:0,hostRenderPosts:0,lastEscalationReason:"",lastFullRenderMs:0,p95FullRenderMs:0,panelRenders:0,patchedOps:0,renderPreparations:0,skippedFullRenders:0,timings:{}};globalThis.__jxCanvasPerf=Jr;var nn=new Map;function an(){try{return typeof localStorage<"u"&&Boolean(localStorage.getItem("jx-canvas-debug"))}catch{return!1}}function on(){return typeof performance<"u"&&Q(performance.now)?performance.now():0}function sn(e,t){if(an())console.debug(`[jx-canvas] ${e}`,t??"")}function wx(e){Jr.escalations+=1,Jr.lastEscalationReason=e,sn("escalation",e)}function jr(e){if(e.length===0)return 0;let t=e.toSorted((r,i)=>r-i),o=Math.min(t.length-1,Math.ceil(t.length*0.95)-1);return t[Math.max(0,o)]??0}function Fr(e,t){let o=Number.isFinite(t)&&t>0?t:0,r=nn.get(e);if(!r)r=[],nn.set(e,r);if(r.push(o),r.length>_r)r.shift();let i=Jr.timings[e],a={count:(i?.count??0)+1,lastMs:o,maxMs:Math.max(i?.maxMs??0,o),p95Ms:jr(r),totalMs:(i?.totalMs??0)+o};if(Jr.timings[e]=a,e===hL)Jr.lastFullRenderMs=a.lastMs,Jr.p95FullRenderMs=a.p95Ms;sn(`span:${e}`,`${o.toFixed(2)}ms`)}function cn(e){let t=on(),o=an(),r=`jx-${e}-start`;if(o)try{performance.mark(r)}catch{}let i=!1;return()=>{if(i)return Jr.timings[e]?.lastMs??0;i=!0;let a=on()-t;if(o)try{performance.measure(`jx-${e}`,r),performance.clearMarks(r)}catch{}return Fr(e,a),a}}function jC(e,t){let o=cn(e);try{return t()}finally{o()}}async function HC(e,t){let o=cn(e);try{return await t()}finally{o()}}function wo(){return yr(g.activePaneId)}function bt(e){let t=pn(e),o=t?.derived,r=o?.kind==="lens"?pn(o.sourcePaneId)?.activeTabId:t?.activeTabId;return r?g.tabs.get(r)??null:null}function Wo(e){return pn(e)?.derived??null}function EC(e){if(!e)return[];let t=[];for(let o of g.panes)if(bt(o.id)?.id===e.id)t.push(yr(o.id));return t}function z(e){for(let t of ef()){let o=t.panels.find((r)=>r.canvas===e);if(o)return{panel:o,surface:t}}return null}function un(e){let t=e.canvas,o=t?z(t):null;return o?bt(o.surface.paneId):null}function La(e){let t=e?.session.ui,o=t?.canvasMode??"design";return t?.preview&&(o==="edit"||o==="design")?"preview":o}function qr(e){let t=Wo(e);if(t?.kind==="lens"){let o=t.mode;return bt(e)?.session.ui?.preview&&(o==="edit"||o==="design")?"preview":o}return La(bt(e))}function pl(e){let t=Wo(e);if(t?.kind==="lens"&&t.preset==="breakpoint")return t.media;return bt(e)?.session.ui.activeMedia??null}function lt(e){return rd(e)?.paneId??mi}function pe(e){return bt(lt(e))}function Sx(e){return vf(e)!==null}function jp(e){return vf(e)}function zo(e){if(!e)return{baseWidth:320,featureQueries:[],sizeBreakpoints:[]};let t=[],o=[],r=320;for(let[i,a]of Object.entries(e)){if(i==="--"){let c=String(a).match(/^(\d+)\s*px$/);r=c?Number(c[1]):320;continue}let l=a.match(/min-width:\s*([\d.]+)px/),s=a.match(/max-width:\s*([\d.]+)px/);if(l)o.push({name:i,query:a,type:"min",width:Number(l[1])});else if(s)o.push({name:i,query:a,type:"max",width:Number(s[1])});else t.push({name:i,query:a})}return o.sort((i,a)=>i.type==="min"?i.width-a.width:a.width-i.width),{baseWidth:r,featureQueries:t,sizeBreakpoints:o}}function Vr(e,t){let o=new Set;for(let r of e)if(r.type==="min"&&t>=r.width)o.add(r.name);else if(r.type==="max"&&t<=r.width)o.add(r.name);return o}function dn(e,t){let o=Vr(e,t),r=null;for(let i of e){if(!o.has(i.name))continue;let a=Math.abs(i.width-t);if(r===null){r=i;continue}let l=Math.abs(r.width-t);if(a<l||a===l&&i.width<r.width)r=i}return r?.name??null}function yA(e,t,o=8){let r=null;for(let i of t){let a=Math.abs(i-e);if(a>o)continue;if(r===null||a<Math.abs(r-e))r=i}return r??e}var VC={$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 Wm=VC.$defs,zr=new Set(["pre"]),Rs=new Set(Object.entries(Wm).filter(([e,t])=>!zr.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));var fn=new Set(["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"]);function ct(e,t){if(!t)return fn.has(e);let o=Wm[t];if(!o||!o.$inlineChildren)return!1;return o.$inlineChildren.includes(e)}function mA(e){let t=Wm[e];if(!t)return null;let o=t.$inlineActions;if(n(o))o=Wm[o]?.$inlineActions??void 0;if(!Array.isArray(o))return null;return o}var Kr=null;function xx(e,t){if(!S(e))return!1;let o=(rt(e.tagName)||"div").toLowerCase();if(t){let r=(rt(t.tagName)||"div").toLowerCase();return ct(o,r)}return fn.has(o)}function gA(){return Kr!==null}function Ae(e){return!e||e==="base"?null:e}function _x(e){let t=e.panels;if(t.length===0)return null;if(t.length===1)return t[0];let o=pl(e.paneId);for(let r of t){if(o===null&&r.mediaName==="base")return r;if(r.mediaName===o)return r}return t[0]}function mn(){return _x(wo())}function bA(e,t){if(!e)return t;let o=t;for(let r=zt(o);r;r=zt(o)){let i=re(e,o),a=re(e,r);if(!i||!a)break;let l=(rt(i.tagName)||"div").toLowerCase(),s=(rt(a.tagName)||"div").toLowerCase();if(!ct(l,s))break;o=r}return o}var zm=240,vA=8,wA=16,Ne=new Map;function ut(e){return zo(nr(e.doc.document.$media))}function WC(e){let{baseWidth:t,sizeBreakpoints:o}=ut(e),r=e.session.ui.activeMedia;return o.find((i)=>i.name===r)?.width??t}function Ur(e,t){let o=Ne.get(e);if(!o)return null;if(!t||o.tabId!==t.id||o.media!==t.session.ui.activeMedia)return Ne.delete(e),null;return o.width}function xA(e,t){let o=t?WC(t):0;return Ur(e.paneId,t)??o}function zC(e){Ne.delete(e)}function _A(e){let{baseWidth:t,sizeBreakpoints:o}=ut(e);return[t,...o.map((r)=>r.width)]}function UC(e,t,o){let{sizeBreakpoints:r}=ut(t),i=dn(r,o);return t.session.ui.activeMedia=i,Ne.set(e,{media:i,tabId:t.id,width:o}),i}var dt={invokerTags:Zy,popoverTags:Ah};function mL(e,t){if(!e||!t)return null;for(let o=t.length;o>=0;o-=1){let r=t.slice(0,o),i=re(e,r);if(S(i)&&Ba(i,dt))return r}return null}function gn(e,t){let o=e.doc.document;if(!o)return null;if(t){let r=re(o,t);return S(r)&&Ba(r,dt)?t:null}return mL(o,Pe(e.session.selection))}function hn(){let e=h.value?.doc.document;return e?EM(e,dt):!1}var yn=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],pt=new Set(["show-modal","close","request-close"]),ft=new Set(["toggle-popover","show-popover","hide-popover"]),Gr=["any","closerequest","none"],Zr=new Set(yn),Yr=new Set(Gr),Xr=new Set(["button"]);function _(e){return Lr(e)==="dialog"}function vn(e){return e.startsWith("--")}function Qr(e){let t=[];for(let{node:o}of uc(e)){let r=_f(o);if(_(o)&&r!==null&&!t.includes(r))t.push(r)}return t}function bn(e){for(let{node:t}of uc(e))if(_(t))return!0;return!1}function ei(e){let t=e.oncommand;return t!==void 0&&t!==null}function ti(e,t){for(let{node:o}of uc(e)){if(o===e)continue;let r=Lr(o);if(r==="button"){let i=Ns(o,"command"),a=Ns(o,"commandfor");if(i!==null&&(i==="close"||i==="request-close")&&(a===null||a===t))return!0}if(r==="form"&&Ns(o,"method")?.toLowerCase()==="dialog")return!0}return!1}function tA(e,t){let o=[...uc(e,[],null,t)],r=Qr(e),i=Yy(e,t),a=r.length>0||i.length>0,l=new Map,s=new Map;for(let{node:d}of o){let m=_f(d);if(m!==null&&!l.has(m))l.set(m,d);if(Lr(d)==="button"){let v=Ns(d,"commandfor"),y=Ns(d,"command");if(v!==null){let b=s.get(v)??new Set;b.add(y??""),s.set(v,b)}}}let c=[];for(let{node:d,path:m}of o)if(c.push(...ni(d,m,l,r,i,a,t)),_(d))c.push(...oi(d,m,s));return c}function ni(e,t,o,r,i,a,l){let s=[],c=Lr(e),d=l?.invokerTags?.has(c)??!1,m=Ns(e,"command"),v=Ns(e,"commandfor");if(!(m!==null||v!==null||("command"in ld(e))||("commandfor"in ld(e))))return s;let b=Ds(e,"the element");if(!Xr.has(c)&&!d)return s.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${or}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),s;if(m!==null&&!Zr.has(m)&&!vn(m))return s.push({detail:`\`command\` is an enumerated attribute taking ${yn.map((E)=>`\`${E}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${or}`,message:`${b} declares command="${m}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),s;if(v!==null){let E=o.get(v),D=r.includes(v),O=i.includes(v);if(!E&&a){let H=[...r,...i].map((V)=>`"${V}"`).join(", ");return s.push({detail:`No element in this document has the id "${v}". The dialogs and popovers here are: ${H}. A commandfor that names nothing does nothing, silently. ${or}`,message:`commandfor="${v}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),s}if(m!==null&&E){if(pt.has(m)&&!_(E))s.push({detail:`\`${m}\` acts on a <dialog>, and "${v}" is ${O?"a popover":`a <${Lr(E)||"element"}>`}. The click is ignored. ${O?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${or}`,message:`${b} sends ${m} to "${v}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(ft.has(m)&&!Ba(E,l))s.push({detail:`\`${m}\` acts on a popover, and "${v}" is ${D?"a dialog":`a <${Lr(E)||"element"}>`} that declares no \`popover\`. The click is ignored. ${D?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${or}`,message:`${b} sends ${m} to "${v}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(vn(m)&&!ei(E))s.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${v}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${or}`,message:`${b} sends ${m} to "${v}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return s}function oi(e,t,o){let r=[],i=Ds(e,"the dialog"),a=_f(e),{style:l}=e,s=Ns(e,"closedby");if(s!==null&&!Yr.has(s))r.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${or}`,message:`${i} declares closedby="${s}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if($o(l,"display")!==null)r.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${or}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=a===null?void 0:o.get(a),d=Ns(e,"open")!==null||ld(e).open===!0||e.open===!0;if(a!==null&&!c?.has("show-modal")&&!d)r.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${or}`,message:`${i} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&s==="none"&&!ti(e,a))r.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${or}`,message:`${i} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return r}function gL(e,t){if(!e||!t)return null;for(let o=t.length;o>=0;o-=1){let r=t.slice(0,o),i=re(e,r);if(S(i)&&_(i))return r}return null}function qC(e,t){let o=e.doc.document;if(!o)return null;if(t){let r=re(o,t);return S(r)&&_(r)?t:null}return gL(o,Pe(e.session.selection))}function Cn(){let e=h.value?.doc.document;return e?bn(e):!1}var ri=/\[\.\.\.(\w+)\]|\[(\w+)\]/g;function Pn(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function xo(e){let t=Pn(e),o=t.slice(t.lastIndexOf("/")+1),r=o.lastIndexOf(".");if(r>0)t=t.slice(0,t.length-(o.length-r));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let i=[],a=!1,l=!1,s=t.replaceAll(ri,(c,d,m)=>{if(a=!0,d)return l=!0,i.push(d),"*";return i.push(m),`:${m}`});return{isCatchAll:l,isDynamic:a,params:i,urlPattern:s}}function Wc(e){if(!e)return"/";return xo(e).urlPattern}function fl(e){if(!e)return[];return xo(e).params}function rh(e,t){let o=Pn(e).split("/");if(!o.every((l)=>l!==""&&l[0]!=="_"))return!1;if(t===void 0)return!0;let r=o.at(-1)??"",i=r.lastIndexOf("."),a=i>0?r.slice(i).toLowerCase():"";return a!==""&&new Set(t).has(a)}function TC(e,t){if(e.isDynamic!==t.isDynamic)return e.isDynamic?1:-1;if(e.isCatchAll!==t.isCatchAll)return e.isCatchAll?1:-1;return e.urlPattern.localeCompare(t.urlPattern)}function Qb(e){let t=e.document?.$paths,o=e.frontmatter?.$paths;return t??o??null}var $e=new Map;function iA(){$e.clear()}function $C(e,t){if(!t)return Promise.resolve({});let o=`${e??""}::${JSON.stringify(t)}`,r=$e.get(o);if(!r)r=ii(t).catch((i)=>($e.delete(o),console.warn("page-params: failed to enumerate $paths values:",i),{})),$e.set(o,r);return r}async function ii(e){if(Array.isArray(e)){let t={};for(let o of e)for(let[r,i]of Object.entries(o))Re(t,r,i);return t}if("contentType"in e&&n(e.contentType)&&e.contentType){let t=e.param??"slug",o=e.field??"id",r=await si(e.contentType),i={[t]:[]};if(!Array.isArray(r))return i;let a=r;for(let l of a)Re(i,t,o==="id"?l.id:l.data?.[o]??l.id);return i}if("values"in e&&Array.isArray(e.values)){let t=e.param??"value",o={[t]:[]};for(let r of e.values)Re(o,t,r);return o}if("$ref"in e&&n(e.$ref)&&e.$ref){let t=e.param??"id",o=e.field??"id",r=await p().readFile(e.$ref.replace(/^\.\//,"")),i=JSON.parse(r),a={[t]:[]};if(!Array.isArray(i))return a;for(let l of i)Re(a,t,f(l)?l[o]??l.id??l:l);return a}return{}}async function ai(){let e=await sd();for(let t of e){let o=t.classes?.find((r)=>r.name==="ContentCollection");if(o)return o.path}return"@jxsuite/parser/ContentCollection.class.json"}async function si(e){let t={$prototype:"ContentCollection",$src:await ai(),contentType:e},o=p();if(o.resolveClass)return o.resolveClass(t);return fetch("/__jx_resolve__",{body:JSON.stringify(t),headers:{"content-type":"application/json"},method:"POST"}).then((r)=>{if(!r.ok)throw Error(`Class resolution failed: ${r.status}`);return r.json()})}function Re(e,t,o){if(o===null||o===void 0||o==="")return;let r=String(o);e[t]??=[];let i=e[t];if(!i.includes(r))i.push(r)}function LC(e,t,o){if(Object.keys(t).length===0)return e;let r=Tn(e,t);return r.state??={},r.state.$page={params:{...t},title:n(r.title)?r.title:"",url:Wc(o)},r}function RC(e){if(!e)return[];return Object.keys(e).filter((t)=>{let o=e[t];return f(o)&&n(o.$prototype)&&n(o.$src)&&JSON.stringify(o).includes('"#/$params/')})}async function Sn(e,t,o){if(t.length===0)return;let r=p(),{resolveClass:i}=r;if(!i)return;let{state:a}=e;if(!a)return;await Promise.all(t.map(async(l)=>{let s=a[l];if(!f(s))return;let c={...s};if(o)c.$base=o;try{a[l]=await i.call(r,c)}catch(d){console.warn(`page-params: failed to resolve state.${l} for preview:`,d)}}))}function En(e,t){let o=li(e,t);if(o!==null)return o;if(Array.isArray(e))return e.map((r)=>En(r,t));return f(e)?Tn(e,t):e}function Tn(e,t){let o={};for(let[r,i]of Object.entries(e))o[r]=En(i,t);return o}function li(e,t){if(!Oe(e)||!e.$ref.startsWith("#/$params/"))return null;return t[e.$ref.slice(10)]??null}function G(e){return bt(e.paneId)}function fe(e){let t=Wo(e.paneId);if(t?.kind==="lens")return t.zoom;return G(e)?.session.ui.zoom??1}function Um(e=wo()){return fe(e)}function Ie(e,t){let o=Wo(e.paneId);if(o?.kind==="lens"){o.zoom=t;return}let r=G(e);if(r)r.session.ui.zoom=t}function ci(e){return Boolean(e.canvas&&e.viewport)}function Hp(e,t,o,r=null){let a={_width:r||null,canvas:null,element:null,mediaName:e||"",ready:!1,renderScope:null,scrollContainer:null,viewport:null},l=[];if(r&&!o)l.push(`--panel-viewport-w:${r}px`);if(r)l.push(`--panel-canvas-w:${r}px`);return{item:{fullWidth:o,header:t?"shown":"hidden",key:e??"",label:t??"",mediaAttr:e,widthVars:l.join(";")},panel:a}}function SA(e,t){for(let{item:o,panel:r}of e){let i=(a)=>t.panelNode(o.key,a);r.element=i("panel"),r.viewport=i("panel-viewport"),r.canvas=i("panel-canvas")}}function CA(e,t){let o=e.find((i)=>i.item.key===t);if(!o)return;let r=un(o.panel);if(r)r.session.ui.activeMedia=Ae(o.item.mediaAttr)}function vt(e){if(!e.panzoomWrap)return;let t=e.wrap.clientWidth,o=e.panzoomWrap.scrollWidth,r=fe(e),i=t-o*r;e.panX=i>=0?i/2:16,e.panY=0}function Cx(e){if(e.centerObserver)e.centerObserver.disconnect(),e.centerObserver=null;if(!e.panzoomWrap)return;e.needsCenter=!0,e.centerObserver=new ResizeObserver(()=>{if(!e.needsCenter){e.centerObserver?.disconnect(),e.centerObserver=null;return}vt(e),Zs(e)}),e.centerObserver.observe(e.panzoomWrap),vt(e)}function Zs(e){if(!e.panzoomWrap)return;let t=fe(e);e.panzoomWrap.style.transform=`translate(${e.panX}px, ${e.panY}px) scale(${t})`,wn("overlays")}var yt=0.25,xt=3;function Nn(e){return Math.min(xt,Math.max(yt,e))}function ui(e,t,o){let r=e.wrap.querySelector('[part="edit-canvas"]'),i=e.panels[0]?.canvas;if(!r||!i)return null;let a=e.wrap.querySelector('[part="edit-column"]'),l=a?Me(a).width:0,s=t&&l>0?l/t:1,c=o;if(c===null){let d=Me(r);c=d.top+d.height/2}return{layoutY:Math.max(0,(c-Me(i).top)/s),scroller:r,zoom:s}}function ch(e=wo(),t=null){if(qr(e.paneId)!=="edit")return;let[o]=e.panels;if(!o||!ci(o))return;let r=o.canvas,i=r.querySelector("iframe"),a=G(e)?.session.ui.editZoom??1,l=ui(e,o._width??null,t);if(a===1){if(o._width=null,r.style.width="",r.style.transform="",r.style.transformOrigin="",i)i.style.width="100%";o.viewport.style.height=""}else{let s=e.wrap.querySelector('[part="edit-column"]');if(!s)return;let c=Me(s).width;if(c<=0)return;let d=c/a;if(o._width=d,r.style.width=`${d}px`,r.style.transform=`scale(${a})`,r.style.transformOrigin="top left",i)i.style.width=`${d}px`,o.viewport.style.height=`${i.offsetHeight*a}px`}if(l)l.scroller.scrollTop+=l.layoutY*(a-l.zoom);wn("overlays")}function Bp(e,t=wo()){let o=G(t);if(!o)return;o.session.ui.editZoom=Nn(e),ch(t)}var mt=new Map,gt=new Map;function kA(e,t=wo(),o=null){let r=G(t);if(!r)return;if(r.session.ui.editZoom=Nn(e),gt.set(t.paneId,o),mt.has(t.paneId))return;mt.set(t.paneId,requestAnimationFrame(()=>{mt.delete(t.paneId);let i=gt.get(t.paneId)??null;gt.delete(t.paneId),ch(t,i)}))}function di(e){let t=getComputedStyle(e).getPropertyValue("--boards-inset").trim(),o=Number(t.replace(/px$/,""));return Number.isFinite(o)?o:0}function On(e,t,o){if(!e.panzoomWrap)return;let r=e.wrap.clientWidth,i=e.wrap.clientHeight-di(e.panzoomWrap),a=24,l=32,s=0,{panels:c}=e;for(let de of c)s+=de._width||800;s+=a*Math.max(0,c.length-1)+l;let d=fe(e),y=Me(e.panzoomWrap).height/d+l,b=r/s,E=i/y,D=t==="width"?b:Math.min(b,E),O=Math.min(o,Math.max(K,D));Ie(e,O);let H=s*O,V=y*O;e.panX=Math.max(0,(r-H)/2),e.panY=Math.max(0,(i-V)/2),Zs(e)}function EA({maxZoom:e=U,surface:t=wo()}={}){ke("page",t),On(t,"page",e)}var K=0.05,U=5;function Rn(e){return Math.min(U,Math.max(K,e))}var gi="page",Ct=["width","page","none"];function hi(e,t,o){let r=t[o];if(vi(r))return r;if(J(r)&&r>=K&&r<=U)return r;throw RangeError(`command "${e}" argument "${o}": expected ${Ct.map((i)=>`"${i}"`).join(" | ")} or a number in [${K}, ${U}], got ${JSON.stringify(r)}`)}function vi(e){return n(e)&&Ct.includes(e)}var $n=new Map;function In(e){let t=G(e);if(!t)return null;let o=Wo(e.paneId)?.kind==="lens"?`::${e.paneId}`:"";return`${t.id}::${t.documentPath??""}${o}`}function ke(e,t){let o=In(t);if(o)$n.set(o,e)}function JC(e=wo()){let t=In(e);return(t===null?void 0:$n.get(t))??gi}function kn(e,t=wo()){let o=e??JC(t);if(o==="none"){Zs(t);return}if(J(o)){Ie(t,Rn(o)),Zs(t);return}On(t,o,1)}function bL(e,t=wo()){ke(e,t),kn(e,t)}function qm(e,t=wo(),o=null){if(!G(t))return;let i=Rn(e),a=i/fe(t);if(ke(i,t),t.panzoomWrap&&a!==1){let l=Me(t.panzoomWrap),s=Me(t.wrap),c=o?.clientX??s.left+s.width/2,d=o?.clientY??s.top+s.height/2;t.panX+=(c-l.left)*(1-a),t.panY+=(d-l.top)*(1-a),t.needsCenter=!1}Ie(t,i),Zs(t)}function KC(e){if(e.wrap.clientWidth<=0){Zs(e);return}kn(JC(e),e)}function TA(e=wo()){if(ke(1,e),!e.panzoomWrap)return;Ie(e,1),vt(e),Zs(e)}function Dn(e,t){let o=Me(Hn(e)??e.wrap),r=t.top+t.height/2-o.top;return o.height/2-r}function Hn(e){return _x(e)?.scrollContainer??null}function yi(e,t,o){let r=Hn(e);if(!r){_n(e,t);return}let i=r.scrollTop-t;if(o){r.scrollTo({behavior:"smooth",top:i});return}r.scrollTop=i}function GC(e,t=wo()){yi(t,Dn(t,e),!1)}function Ln(e,t=wo()){let o=Me(t.wrap);if(e.top>=o.top&&e.top+e.height<=o.top+o.height)return;let r=Dn(t,e),i=Math.max(t.panY,0)-t.panY,a=Math.min(r,i);if(a!==0)t.needsCenter=!1,_n(t,a)}function _n(e,t){let o=e.panY,r=o+t,i=performance.now(),a=250,l=(s)=>{let c=Math.min((s-i)/250,1),d=c*(2-c);if(e.panY=o+(r-o)*d,Zs(e),c<1)requestAnimationFrame(l)};requestAnimationFrame(l)}var xi=["edit","design","preview","source","stylebook","tokens","grid","git-diff"],ht=xi.filter((e)=>e!=="git-diff"),Je=new Set(["edit","design"]);function bi(e){return Je.has(e)}var yL=["edit","design","preview"];function Ci(e){return yL.filter((t)=>e.capabilities.modes.includes(t))}function $A(e){return Ci(e).filter((t)=>t!=="preview")}function vL(e){let t=e.session.ui.canvasMode;return bi(t)?t:null}function wL(e){return{available:e.capabilities.modes.includes("preview")&&Je.has(e.session.ui.canvasMode),on:e.session.ui.preview===!0}}function xL(e,t,o){if(t==="preview"){if(Je.has(e.session.ui.canvasMode))e.session.ui.preview=!0;return}if(e.session.ui.preview=!1,e.session.ui.canvasMode!==t)o(e,t)}var Mn=new Set(["design","stylebook","git-diff"]),k=(e)=>e.document.open,An=["auto","light","dark"];function Pi(e){function t(l){let s=h.value;if(!s)throw RangeError(`command "${l}" needs an open document; no tab is active`);return s}function o(l,s){let{pane:c}=s;if(c===void 0)return t(l);let d=St(l,s,"pane"),m=bt(d);if(!m)throw RangeError(`command "${l}" argument "pane": "${d}" has no open document`);return m}let r={pane:Fe("Which pane to render this way. Defaults to the focused one.")};function i(l){e.renderPane(a(l))}function a(l){let{pane:s}=l;return n(s)?s:g.activePaneId}return[{args:Se({mode:fi(ht,"The canvas mode to switch the active pane to.")}),category:"View",id:"canvas.setMode",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:k,aiTool:{description:"Switch the active document's editor mode. edit and design put its element tree on the canvas, where the document tools work; preview renders it as a visitor sees it; source shows the JSON; stylebook, tokens and grid open other editors. Use it to return a document to edit or design when the tree tools are refused.",name:"set_canvas_mode",report:({after:l,args:s})=>{let c=qn("canvas.setMode",s,"mode",ht),d=l.editor.kind==="canvas"?"the document tools address its element tree":"the tree-editing tools are unavailable until it returns to edit or design";return`The active document is in ${c} mode; ${d}.`}},run:(l,s)=>{let c=qn("canvas.setMode",s,"mode",ht),d=t("canvas.setMode"),{modes:m}=d.capabilities;if(!m.includes(c))throw RangeError(`command "canvas.setMode" argument "mode": "${c}" is not a mode this document `+`supports — it declares: ${m.join(", ")}`);if(c==="preview"){let v=d.session.ui.canvasMode;if(!Je.has(v))throw RangeError(`command "canvas.setMode" argument "mode": "preview" composes with the edit and design base modes; this pane is in "${v}"`);d.session.ui.preview=!0;return}d.session.ui.preview=!1,e.setCanvasMode(d,c)},title:"Set Canvas Mode"},{args:Se({zoom:AR("Pan-zoom scale, 1 = 100%.",{maximum:U,minimum:K})}),category:"View",id:"canvas.setZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:k,enablement:()=>Mn.has(e.getCanvasMode()),run:(l,s)=>{t("canvas.setZoom"),qm(c_("canvas.setZoom",s,"zoom",K,U))},title:"Set Zoom"},{args:Se({fit:{description:'How the document is framed: "width" | "page" | "none", or a numeric pan-zoom scale.',oneOf:[{enum:[...Ct],type:"string"},{maximum:U,minimum:K,type:"number"}]}}),category:"View",id:"canvas.setFit",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:k,enablement:()=>Mn.has(e.getCanvasMode()),run:(l,s)=>{t("canvas.setFit"),bL(hi("canvas.setFit",s,"fit"))},title:"Set Fit"},{args:Se({zoom:AR("Edit-mode content zoom, 1 = 100%.",{maximum:xt,minimum:yt})}),category:"View",id:"canvas.setEditZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:k,enablement:()=>e.getCanvasMode()==="edit",run:(l,s)=>{t("canvas.setEditZoom"),Bp(c_("canvas.setEditZoom",s,"zoom",yt,xt))},title:"Set Edit Zoom"},{args:{additionalProperties:!1,properties:{...r,width:{description:"How wide the Edit column should render, in CSS pixels, or null to go back to the chosen breakpoint's own width.",type:["number","null"]}},required:["width"],type:"object"},category:"View",id:"canvas.setEditWidth",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:k,enablement:()=>e.getCanvasMode()==="edit",run:(l,s)=>{let c=o("canvas.setEditWidth",s),{width:d}=s;if(d===null){zC(a(s)),i(s);return}UC(a(s),c,c_("canvas.setEditWidth",s,"width",zm,1e4)),i(s)},title:"Set Edit Width"},{args:{additionalProperties:!1,properties:{...r,media:{description:"A breakpoint key the document renders under, or null for the base rendering.",type:["string","null"]}},required:["media"],type:"object"},category:"View",id:"canvas.setBreakpoint",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:k,run:(l,s)=>{let c=o("canvas.setBreakpoint",s),{media:d}=s;if(d!==null&&!n(d))throw RangeError('command "canvas.setBreakpoint" argument "media": expected a breakpoint key or null');let m=Object.keys(nr(c.doc.document.$media));if(d!==null&&!m.includes(d))throw RangeError(`command "canvas.setBreakpoint" argument "media": "${d}" is not a breakpoint this `+`document defines — it defines: ${m.length>0?m.join(", "):"nothing"}`);c.session.ui.activeMedia=d,i(s)},title:"Set Breakpoint"},{args:Se({...r,scheme:fi(An,"Which color scheme the canvas renders in.")},["scheme"]),category:"View",id:"canvas.setColorScheme",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:k,run:(l,s)=>{let c=o("canvas.setColorScheme",s);c.session.ui.previewColorScheme=qn("canvas.setColorScheme",s,"scheme",An),i(s)},title:"Set Color Scheme"},{args:Se({...r,locale:Fe("BCP 47 tag this pane renders as.")},["locale"]),category:"View",id:"i18n.switchLocale",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document in a project that declares more than one locale",when:(l)=>l.document.open&&l.project.isMultilingual,run:(l,s)=>{let c=o("i18n.switchLocale",s),d=St("i18n.switchLocale",s,"locale"),m=Ls();if(m===null||!m.locales.includes(d))throw RangeError(`command "i18n.switchLocale" argument "locale": "${d}" is not a locale this `+`project declares — it declares: ${m===null?"nothing":m.locales.join(", ")}`);c.session.ui.previewLocale=d,i(s)},title:"Set Rendering Language"},{args:Se({...r,visible:$r("True to draw the page's layout elements, false to hide them.")},["visible"]),category:"View",id:"canvas.setLayoutVisible",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:k,run:(l,s)=>{let c=o("canvas.setLayoutVisible",s);c.session.ui.showLayout=Bi("canvas.setLayoutVisible",s,"visible"),i(s)},title:"Show Layout Elements"},{args:Se({...r,open:$r("True to draw the popover open, false to close it."),path:{description:"Document path of the popover. Defaults to the popover the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>hn(),group:"3_canvas",id:"canvas.setPopoverOpen",level:"document",menus:["palette"],requires:"a popover in the open document",run:(l,s)=>{let c=o("canvas.setPopoverOpen",s),d=s.path,m=s.open===void 0?!0:Bi("canvas.setPopoverOpen",s,"open");if(!m&&d===void 0){e.setOpenPopover(c,null);return}let v=gn(c,d);if(v===null)throw RangeError('command "canvas.setPopoverOpen" argument "path": names no popover in this document — '+"a popover is an element with a `popover` attribute, and <dialog> is not one");e.setOpenPopover(c,m?v:null)},title:"Show Popover",when:k},{args:Se({...r,open:$r("True to draw the dialog open, false to close it."),path:{description:"Document path of the dialog. Defaults to the dialog the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>Cn(),group:"3_canvas",id:"canvas.setDialogOpen",level:"document",menus:["palette"],requires:"a dialog in the open document",run:(l,s)=>{let c=o("canvas.setDialogOpen",s),d=s.path,m=s.open===void 0?!0:Bi("canvas.setDialogOpen",s,"open");if(!m&&d===void 0){e.setOpenDialog(c,null);return}let v=qC(c,d);if(v===null)throw RangeError('command "canvas.setDialogOpen" argument "path": names no dialog in this document — '+"a dialog is a <dialog> element, and a popover is not one");e.setOpenDialog(c,m?v:null)},title:"Show Dialog",when:k},{args:{additionalProperties:!1,properties:{...r,open:{default:!0,description:"True to open the resolving-with popover, false to close it.",type:"boolean"}},required:[],type:"object"},category:"View",id:"canvas.setResolvingOpen",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:k,run:(l,s)=>{o("canvas.setResolvingOpen",s);let{open:c,pane:d}=s;e.setResolvingOpen(n(d)?d:g.activePaneId,c===void 0||Bi("canvas.setResolvingOpen",s,"open"))},title:"Show Resolving Values"},{args:{additionalProperties:!1,properties:{...r,name:Fe("The prop's name, as the component's state declares it."),value:{description:"The test value — any JSON. Null clears it and the prop returns to its default.",type:["string","number","boolean","array","object","null"]}},required:["name"],type:"object"},category:"View",id:"canvas.setTestProp",level:"document",menus:["palette"],group:"3_canvas",requires:"an open component document",when:k,run:(l,s)=>{let c=o("canvas.setTestProp",s),d=St("canvas.setTestProp",s,"name"),m=Object.keys(c.doc.document.state??{});if(!m.includes(d))throw RangeError(`command "canvas.setTestProp" argument "name": "${d}" is not a prop this component `+`declares — it declares: ${m.length>0?m.join(", "):"nothing"}`);let{value:v}=s,y={...c.session.ui.previewProps};if(v===null||v===void 0)delete y[d];else y[d]=v;c.session.ui.previewProps=Object.keys(y).length>0?y:null,i(s)},title:"Set Test Value"},{args:{additionalProperties:!1,properties:{...r,name:Fe("The route parameter's name, without brackets."),value:Fe("The value to preview the route with. Empty clears it.")},required:["name","value"],type:"object"},category:"View",id:"canvas.setRouteParam",level:"document",menus:["palette"],group:"3_canvas",requires:"an open page with a dynamic route",when:k,run:(l,s)=>{let c=o("canvas.setRouteParam",s),d=St("canvas.setRouteParam",s,"name"),m=fl(c.documentPath);if(!m.includes(d))throw RangeError(`command "canvas.setRouteParam" argument "name": "${d}" is not a parameter of this `+`route — it has: ${m.length>0?m.join(", "):"none"}`);c.session.ui.previewParams={...c.session.ui.previewParams,[d]:St("canvas.setRouteParam",s,"value")},i(s)},title:"Set Route Parameter"}]}function LA(e,t){e.registerAll(Pi(t))}function kx(e=wo()){let t=pl(e.paneId),o=e.panels;for(let r of o){let i=r.element?.querySelector('[part="panel-header"]');if(i){let a=t===null&&r.mediaName==="base"||t===r.mediaName;i.toggleAttribute("data-active",a)}}}var Pt="jx:canvas";function Fn(e){let{target:t,source:o,targetOrigin:r,acceptOrigin:i,token:a}=e,l=new Set,s=(c)=>{if(i!=="*"&&c.origin!==i)return;let d=c.data;if(!S(d)||!(Pt in d)||d[Pt]!==a)return;let m="payload"in d?d.payload:void 0;for(let v of l)v(m)};return o.addEventListener("message",s),{dispose(){l.clear(),o.removeEventListener("message",s)},onMessage(c){return l.add(c),()=>l.delete(c)},post(c){t.postMessage({[Pt]:a,payload:c},r)}}}var wt=null;function Vn(){return wt}function Zb(e){if(wt){wt(e);return}window.open(e,"_blank","noopener,noreferrer")}function Xb(e,t,o,r=null,i=null,a=[]){if(!e.state)e.state={};let l={};if(i!==null)l.defaultLocale=i.defaultLocale,l.locales=i.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...l,...t.state};let s=(n(e.$lang)?e.$lang:void 0)??fP(o.urlPattern,i)??t.defaults?.lang,c=a.map((m)=>({code:m.locale,current:m.urlPattern===o.urlPattern,dir:Sy(m.locale),label:Wt(m.locale),url:m.urlPattern})),d={params:o._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:o.urlPattern};if(c.length>0)d.alternates=c;if(o.pagination){let{first:m,itemCount:v,last:y,next:b,number:E,pageCount:D,pageSize:O,pages:H,prev:V}=o.pagination;d.pagination={first:m,itemCount:v,last:y,next:b,number:E,pageCount:D,pageSize:O,pages:H.map(({current:de,number:oe,url:P})=>({current:de,number:oe,url:P})),prev:V}}if(s!==void 0)d.dir=Sy(s),d.locale=s;if(e.state.$page=d,t.state){for(let[m,v]of Object.entries(t.state))if(m!=="$site"&&m!=="$page"&&!(m in e.state))e.state[m]=v}if(t.$media)e.$media={...t.$media,...e.$media};if(t.imports&&Object.keys(t.imports).length>0){if(!e.imports)e.imports={};for(let[m,v]of Object.entries(t.imports))if(!(m in e.imports))e.imports[m]=r&&(v.startsWith("./")||v.startsWith("../"))?r(v,o):v}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let m=new Set,v=[];for(let y of[...t.$elements,...e.$elements]){let b=n(y)?y:S(y)?y.$ref:void 0;if(b&&!m.has(b))m.add(b),v.push(y)}e.$elements=v}return e}var wi=new Set(["img","video","source","iframe","audio"]),Wn="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Et="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";function nA(e,t){e.addEventListener("error",(o)=>{let{target:r}=o;if(r instanceof HTMLImageElement&&r.getAttribute("src")!==Et)r.setAttribute("src",Et),r.removeAttribute("srcset"),r.dataset.placeholder=""},{capture:!0,signal:t})}var Si=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function Bn(e){return Si.test(e)}var Ei=/(?<![\w$.])(?:item|index|\$map)\b/u;function Z(e){if(n(e))return e.includes("${")&&Ei.test(e);return Gn(e)&&n(e.$ref)&&/^(?:#\/)?\$map\//u.test(e.$ref)}function He(e,t){if(e==="href"||e==="action")return"";if(Bn(e))return Et;if(n(t))return Le(t);return Gn(t)&&n(t.$ref)?Yn(t.$ref):""}var Ti=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"]),Mi=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]);var Ai=["width","height","inlineSize","blockSize"];function Ni(e){let{style:t}=e;if(!S(t))return!1;return Ai.some((o)=>{let r=t[o],i=J(r)?String(r):n(r)?r.trim():"";return i!==""&&i!=="auto"})}function Oi(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(hr(e.children))return null;if(Ni(e))return null;if(Ti.has(rt(e.tagName)))return"empty-text-placeholder";if(Mi.has(rt(e.tagName)))return"empty-container-placeholder";return null}function Le(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function Ri(e){return Le(e.replaceAll(/\s*\?\?\s*\[\s*\]\s*(?=\})/gu,""))}function $i(e,t){let o=e.map;return{children:S(o)?[q(o,Ii(e.items,t))]:[],className:"repeater-perimeter",tagName:"div"}}function zn(e){return JSON.stringify(e)}function Kn(e){let t=e.startsWith("#/")?e.slice(2):e,[o,...r]=t.split("/"),i=o==="state"||o==="$map"?o:null;if(i===null)return null;let a=r.map((l)=>l.replaceAll("~1","/").replaceAll("~0","~"));return i+a.map((l)=>`?.[${zn(l)}]`).join("")}function Tt(e,t){if(t===null)return`(${e})`;return`((r) => ((item, index, $map) => (${e}))(r, 0, { index: 0, item: r }))(${t})`}function Ii(e,t){if(Array.isArray(e))return`${zn(e)}[0]`;if(Oe(e)){let r=Kn(e.$ref);return r===null?null:`${Tt(r,t)}?.[0]`}let o=n(e)?Un(e):[];if(n(e)&&o.length===1&&ki(e,o[0]))return`${Tt(o[0].expr,t)}?.[0]`;return null}function ki(e,t){return t.start===0&&t.end===e.length-1}function Un(e){let t=[],o=e.indexOf("${");while(o!==-1){let r=0,i=-1;for(let a=o+1;a<e.length;a+=1)if(e[a]==="{")r+=1;else if(e[a]==="}"){if(r-=1,r===0){i=a;break}}if(i===-1)break;t.push({end:i,expr:e.slice(o+2,i),start:o}),o=e.indexOf("${",i+1)}return t}function Zn(e,t=null){let o=Un(e);if(o.length===0)return e;let r="",i=0;for(let{start:a,end:l,expr:s}of o)r+=e.slice(i,a),r+=`\${(() => { try { return ${Tt(s,t)}; } catch { return ""; } })()}`,i=l+1;return r+e.slice(i)}function Di(e,t){let o=e.startsWith("#/")?e.slice(2):e;if(o!=="$map"&&!o.startsWith("$map/"))return{$ref:e};let r=Kn(e);return t===null||r===null?void 0:Zn(`\${${r}}`,t)}function Yn(e){return`{${e.startsWith("#/state/")?e.slice(8):e}}`}function Mt(e,t=null){return q(e,t)}function q(e,t){if(Array.isArray(e))return e.map((s)=>q(s,t));if(!Gn(e))return e;if(e.$prototype==="Array")return $i(e,t);let o=e,r={},i=!1,a=n(o.tagName)&&wi.has(o.tagName);if(a){let{attributes:s,src:c}=o,d=s?.src,m=o.poster,v=s?.poster;if(!(c&&c!==""||d&&d!=="")&&!(m&&m!==""||v&&v!==""))i=!0}for(let[s,c]of Object.entries(o))if(s==="state"||s==="$media"||s==="$elements")r[s]=c;else if(s==="$props"&&ru(c)){let d={};for(let[m,v]of Object.entries(c))if(!Z(v))d[m]=v;else if(n(v))d[m]=Bn(m)||m==="href"||m==="action"?He(m,v):Zn(v,t);else if(Oe(v)){let y=Di(v.$ref,t);if(y!==void 0)d[m]=y}else d[m]=v;r[s]=d}else if(s==="children"){if(Array.isArray(c))r.children=c.map((d)=>q(d,t));else if(Gn(c)&&c.$prototype==="Array")r.children=[q(c,t)];else if(!hr(c))r.children=q(c,t)}else if(s==="cases"&&o.$switch&&ru(c)){let[d]=Object.entries(c);if(d){let[,m]=d;r.children=ru(m)&&!(Gn(m)&&m.$ref)?[q(m,t)]:[{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(c).join(" | ")}]`}]}}else if(s==="attributes"&&a&&ru(c)){let d={};for(let[m,v]of Object.entries(c))if((m==="src"||m==="poster")&&(v===""||v==null||Z(v)))i=!0,d[m]=Wn;else d[m]=Z(v)?He(m,v):v;r.attributes=d}else if(s==="attributes"&&ru(c)){let d={};for(let[m,v]of Object.entries(c))d[m]=Z(v)?He(m,v):v;r.attributes=d}else if(s==="style")if(ru(c)){let d={};for(let[m,v]of Object.entries(c))if(!Z(v))d[m]=v;r.style=d}else r.style=c;else if(s==="$switch"&&n(c)&&c.includes("${"))r[s]=Le(c);else if(s==="textContent"&&n(c)&&c.includes("${"))r[s]=Le(c);else if(s==="textContent"&&Gn(c)&&c.$ref)r[s]=Yn(c.$ref);else if(a&&(s==="src"||s==="poster"))if(c===""||c==null||Z(c))i=!0,r[s]=Wn;else r[s]=c;else if(Z(c))r[s]=He(s,c);else if(n(c)||Gn(c)&&c.$ref)r[s]=c;else r[s]=q(c,t);if(hr(o.children)){r.textContent=Ri(o.children);let{attributes:s}=r;r.attributes=ru(s)?{...s,contenteditable:"false"}:{contenteditable:"false"}}let l=Oi(r);if(l)r.className=r.className?`${r.className} ${l}`:l;if(i){let s=n(r.className)?r.className:"";if(!s.includes("empty-media-placeholder"))r.className=s?`${s} empty-media-placeholder`:"empty-media-placeholder"}return r}function IC(e){let t=e?.tagName;return n(t)&&t.includes("-")}function Ji(e){return S(e)&&!Array.isArray(e)}function Xn(e){if(e===void 0)return null;if(Ji(e)){if(e.$expression||e.$compute||e.$prototype||e.$handler)return null;return"default"in e||"type"in e?"signal":"literal"}return n(e)&&e.includes("${")?null:"literal"}function rA(e){let t=e?.state??{},o=[];for(let[r,i]of Object.entries(t)){if(ud(r))continue;let a=Xn(i);if(!a)continue;let l=a==="signal"?i.default:i;o.push({name:r,value:l})}return o}function Qn(e,t){let o={...e.state},r=!1;for(let[i,a]of Object.entries(t)){let l=o[i],s=Xn(l);if(!s)continue;o[i]=s==="signal"?{...l,default:a}:a,r=!0}if(!r)return e;return{...e,state:o}}var Li=new Set(["data","media","metadata","news","series","species"]),_i=new Set(["archive","catalog","catalogue","collection","directory","faq","gallery","inventory","library","menu","portfolio","showcase"]);function NC(e){return e.replaceAll(/[_-]+/g," ").replaceAll(/([a-z\d])([A-Z])/g,"$1 $2").trim().replaceAll(/\s+/g," ").toLowerCase()}function oh(e){let t=/[_-]|[a-z\d][A-Z]/.test(e)?NC(e):e,o=t.lastIndexOf(" "),r=t.slice(o+1);if(_i.has(r.toLowerCase()))return`${t} item`;return`${t.slice(0,o+1)}${ji(r)}`}function ji(e){if(Li.has(e.toLowerCase()))return e;if(/[^aeiou]ies$/.test(e))return`${e.slice(0,-3)}y`;if(/(?:ss|x|ch|sh|z)es$/.test(e))return e.slice(0,-2);if(/(?:us|is|ss)$/.test(e))return e;if(e.endsWith("s"))return e.slice(0,-1);return e}function ey(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ty(e){return(e.replaceAll("\\","/").split("/").pop()??e).replace(/\.[^.]+$/,"").replaceAll(/[-_]+/g," ").replaceAll(/\b\w/g,(o)=>o.toUpperCase())}var pi="pages";function At(){return x?.projectConfig?.content??{}}function eo(e){return e!==void 0&&/\.[\da-z]+$/i.test(e.replace(/\/+$/,""))}var Fi={fileBacked:!1,item:"page",key:pi,kind:"pages",title:"Pages"};function Vm(){let e=Object.entries(At()).map(([t,o])=>({fileBacked:eo(o.source),item:oh(t),key:t,kind:"collection",title:ey(NC(t))}));return[Fi,...e]}function dL(){return Vm().map((e)=>e.key)}function vx(e){let t=At()[e]?.source;return t!==void 0&&eo(t)?t.replace(/^\.\//,""):null}function oA(e){return At()[e]?.schema??null}function nc(e){return Vm().find((t)=>t.key===e)??null}function ic(e){if(!e)return null;let t=e.replaceAll("\\","/").replace(/^\.\//,"");if(ca.has(Ot(t)))return null;if(t.startsWith("pages/"))return rh(t)?pi:null;return Jn(t)?.name??null}function sh(e){if(!e)return!1;let t=Jn(e);if(!t||t.fileBacked)return!1;let o=Ot(e);return o!==".json"&&o!==".csv"}function sA(e,t){if(e===void 0||t)return{entries:!0,pages:!0,scan:!0};let o=e.map((r)=>r.replaceAll("\\","/").replace(/^\.\//,""));return{entries:o.some((r)=>{let i=ic(r);return i!==null&&i!==pi}),pages:o.some((r)=>r.startsWith("pages/")),scan:!1}}function Vi(e,t,o){let r=e?.state??t?.state,i=`#/$params/${o}`;for(let a of Object.values(f(r)?r:{})){if(!f(a)||a.$prototype!=="ContentEntry")continue;let{contentType:l,id:s}=a;if(f(s)&&s.$ref===i&&n(l)&&l!=="")return l}return null}function DC(e,t){let o=Qb({document:e,frontmatter:t}),r=null,i=null,a=null,l=null;if(o&&!Array.isArray(o)&&"contentType"in o){let d=o.contentType;r=n(d)&&d!==""?d:null;let m="param"in o?o.param:void 0;i=n(m)&&m!==""?m:null;let v="field"in o?o.field:void 0;a=n(v)&&v!==""&&v!=="id"?v:null}else if(o&&!Array.isArray(o)&&"values"in o){let d="param"in o?o.param:void 0,m=n(d)&&d!==""?d:null;r=m===null?null:Vi(e,t,m),i=r===null?null:m;let v=o.values;l=r!==null&&Array.isArray(v)?v.flatMap((y)=>{let b=Rt(y);return b===null?[]:[b]}):null}let s=e?.$layout??t?.$layout,c=n(s)||s===!1?s:void 0;return{contentType:r,field:a,layout:c,param:i,...l!==null&&{values:l}}}async function uL(e){let t={contentType:null,field:null,layout:void 0,param:null};try{let o=await p().readFile(e);if(e.endsWith(".json"))return DC(JSON.parse(o),null);let{parseSourceForPath:r}=await (ce("dtdvjmza"),import("./file-ops-dtdvjmza.js")),i=await r(e,o);return DC(i.document,i.frontmatter)}catch{return t}}var W=null,ge=null,Nt=0,_e=new Set;async function to(e,t){let o;try{o=await p().listDirectory(e)}catch{return}await Promise.all(o.map(async(r)=>{if(r.type==="directory")await to(r.path,t);else t.push(r.path)}))}async function qi(){let e=[];await to("pages",e);let t=e.filter((a)=>a.includes("[")&&rh(a)).toSorted(),o=await Promise.all(t.map(async(a)=>[a,await uL(a)])),{i18n:r}=ln(x?.projectConfig??{}),i=new Map;for(let[a,l]of o)if(l.contentType){let s={field:l.field,layout:l.layout,locale:Zx(a,r),param:l.param,path:a,pattern:xo(a).urlPattern,...l.values&&{values:l.values}};i.set(l.contentType,[...i.get(l.contentType)??[],s])}return i}function $t(){if(W)return Promise.resolve(W);if(!we()||!x)return Promise.resolve(new Map);if(!ge){let e=Nt;ge=qi().then((t)=>{if(e===Nt){W=t,ge=null;for(let o of _e)o()}return t})}return ge}function no(e,t){if(!e||e.length===0)return null;let o=jn(t),r=ln(x?.projectConfig??{}).i18n?.defaultLocale??null;return(o===null?void 0:e.find((i)=>i.locale===o))??(r===null?void 0:e.find((i)=>i.locale===r))??e.find((i)=>i.locale===null)??e[0]}function zc(e){if(!e)return null;return br(e,ln(x?.projectConfig??{}).i18n)}function ah(e,t){if(!W){$t();return}return no(W.get(e),t)}function aA(e){if(!W){$t();return}return W.get(e)??[]}async function je(e,t){let o=await $t();return no(o.get(e),t)}function ny(){Nt+=1,W=null,ge=null}function Mp(e){return _e.add(e),()=>{_e.delete(e)}}function Rt(e){if(n(e)&&e!=="")return e;return J(e)&&Number.isFinite(e)?String(e):null}function OC(e,t,o){if(!e)return null;let r=t.split("/").pop()??t,i=r.lastIndexOf("."),a=i>0?r.slice(0,i):r,l=e.field===null?null:Rt(o?.[e.field]),s=t.endsWith(".json")?Rt(o?.id):null,c=l??s??a;if(e.values&&!e.values.includes(c))return null;if(e.param)return e.pattern.replace(`:${e.param}`,c);return e.pattern.replace(/:[A-Za-z_]\w*/,c)}function AC(e,t){if(e===!1)return null;if(n(e)&&e!=="")return e;if(t?.layout===!1)return null;if(n(t?.layout)&&t.layout!=="")return t.layout;return x?.projectConfig?.defaults?.layout??null}function lA(){ny(),_e.clear()}function PC(e){return e.startsWith("pages/")||e.startsWith("./pages/")}function Ki(e,t){let o=t.split("/"),r={};for(let[i,a]of e.split("/").entries()){let l=o[i];if(a.startsWith(":")&&l!==void 0)r[a.slice(1)]=l}return r}async function Ui(e){let{documentPath:t,fields:o,isEntry:r,params:i}=e;if(!r)return{_pathParams:{...i},sourcePath:t,urlPattern:Wc(t)};let a=Jn(t),l=a?await je(a.name,zc(t)):null,s=OC(l,t,o);if(!l||s===null)return{_pathParams:{},sourcePath:t,urlPattern:l?.pattern??"/"};return{_pathParams:Ki(l.pattern,s),sourcePath:l.path,urlPattern:s}}async function MC(e,t){if(!t)return null;let o=await Ui(e),r=e.fields?.title,i=n(e.title)?e.title:n(r)?r:null,a={state:{}};if(i!==null)a.title=i;if(n(e.lang))a.$lang=e.lang;let l=Xb(a,t,o,null,ln(t).i18n),{$page:s,$site:c}=l.state??{};return s===void 0||c===void 0?null:{$page:s,$site:c}}var Ve=new Map;function FC(){Ve=new Map}function Gi(e){if(!e.startsWith("#/state/"))return null;let[t]=e.slice(8).split("/");return t?t.replaceAll("~1","/").replaceAll("~0","~"):null}function It(e){if(n(e))return e.includes("${");if(Array.isArray(e))return e.some((t)=>It(t));return f(e)&&Object.values(e).some((t)=>It(t))}function ro(e,t){if(n(e.$src))return e.$src;return n(e.$prototype)&&Object.hasOwn(t,e.$prototype)?t[e.$prototype]??null:null}function kt(e,t={}){return f(e)&&n(e.$prototype)&&ro(e,t)!==null&&!It(e)}function io(e,t){return Object.entries(e.state??{}).filter(([,o])=>f(o)&&!n(o.$src)&&kt(o,t)).map(([o])=>o)}function ao(e){let t=new Set,o=(i)=>{if(Array.isArray(i)){for(let a of i)o(a);return}if(!Gn(i))return;if(i.$prototype==="Array"&&Oe(i.items)){let a=Gi(i.items.$ref);if(a)t.add(a)}o(i.map),o(i.children);for(let a of Object.values(i.cases??{}))o(a)};o(e.children);let r=e.state??{};return[...t].filter((i)=>kt(r[i]))}function Zi(e,t){return console.warn(`canvas: could not resolve state.${e} before the render:`,t),null}async function lo(e,t,o,r={}){let i=p(),{resolveClass:a}=i,l=e.state;if(t.length===0||!a||!l)return e;let s={...l};return await Promise.all(t.map(async(c)=>{let d=s[c];if(!kt(d,r))return;let m={...d,$src:ro(d,r)};if(o)m.$base=o;let v=JSON.stringify(m),y=Ve.get(v);if(!y)y=a.call(i,m).then((E)=>E??null,(E)=>(Ve.delete(v),Zi(c,E))),Ve.set(v,y);let b=await y;if(b!==null)s[c]=b})),{...e,state:s}}function co(e,t=[]){if(!S(e))return null;if(Array.isArray(e.children)){let o=e.children.findIndex((r)=>S(r)&&!r.$__layout);if(o!==-1)return{offset:o,prefix:[...t,"children"]};for(let r=0;r<e.children.length;r++){let i=e.children[r];if(S(i)&&i.$__layout){let a=co(i,[...t,"children",r]);if(a)return a}}}return null}function Dt(e,t,o=[]){if(!S(e))return;if(e.$__layout={file:t,path:o},Array.isArray(e.children))for(let[r,i]of e.children.entries()){if(n(i))continue;Dt(i,t,[...o,"children",r])}if(Array.isArray(e.$elements)){for(let[r,i]of e.$elements.entries())if(!n(i))Dt(i,t,[...o,"$elements",r])}}async function uo(e,t=new Set){let o=e.replace(/^\.\//,"");if(t.has(o))return null;t.add(o);let r=await Ax(e);if(!r)return null;Dt(r,o);let i=r.$layout;if(!n(i)||!i)return r;let a=await uo(i,t);if(!a)return r;let l=tR(a,r);return delete l.$layout,l}function Yi(e,t){for(let o of e??[]){if(!S(o)||!n(o.$ref)||!/^\.\.?\//.test(o.$ref))continue;let r=o.$__layout;if(!f(r)||!n(r.file))continue;let i=new URL(o.$ref,`jx-project:/${r.file}`).pathname.replace(/^\//,"");o.$ref=Kc(t,i)}}function po(e,t){if(e.$layout!==void 0)return e.$layout;let o=t?.doc.content.frontmatter.$layout;return n(o)||o===!1?o:void 0}async function Xi(e,t,o){let r=po(e,t),i=o?Jn(o):null,a=i?await je(i.name,zc(o)):null;return AC(r,a)}async function fo(e,t,o=null){let r={documentPath:t?.documentPath,mode:t?.doc.mode},i=o??La(t),a=i==="preview"?structuredClone(le(e)):Mt(sf(e)),l=!1,s=r.documentPath&&x?.isSiteProject&&PC(r.documentPath),c=!s&&Boolean(x?.isSiteProject)&&sh(r.documentPath),d=null,m=0;if((s||c)&&t?.session.ui.showLayout!==!1){let P=c?await Xi(e,t,r.documentPath):gl(po(e,t));if(P){let A=await uo(P);if(A){let L=i==="preview"?structuredClone(le(e)):a,T=tR(A,L);if(a=i==="preview"?T:Mt(sf(T)),l=!0,r.documentPath)Yi(a.$elements,r.documentPath);let R=co(T);d=R?.prefix??null,m=R?.offset??0}}}let v=x?.projectConfig;if(s&&v){if(a={...a,state:{...a.state}},a.imports)a.imports={...a.imports};Xb(a,v,{urlPattern:Wc(r.documentPath)})}let y=ac(x?.projectRoot),b=r.documentPath?new URL(r.documentPath,y).href:void 0,E=wy(r.documentPath,bh());if(s&&t){let{previewParams:P}=t.session.ui;if(Object.keys(P).length>0){let A=RC(e.state??null);a=LC(a,P,r.documentPath),await Sn(a,A,b)}}if((s||c)&&r.documentPath){let P=await MC({documentPath:r.documentPath,fields:c?t?.doc.content.frontmatter??null:null,isEntry:c,lang:e.$lang,params:t?.session.ui.previewParams??{},title:e.title},x?.projectConfig);if(P)a={...a,state:{...a.state,...P}}}let D=await sd(),O=eR(D),H=io(a,O);if(i!=="preview")H.push(...ao(e));if(a=await lo(a,[...new Set(H)],b,O),!s&&t&&IC(a)){let{previewProps:P}=t.session.ui;if(P&&Object.keys(P).length>0)a=Qn(a,P)}let V=new Set;if(i!=="preview")(function P(A,L){if(!S(A))return;if(A.$prototype==="Array"){V.add(L.join("/"));let T=A.map;if(S(T))P(T,[...L,"map"]);return}if(Array.isArray(A.children))for(let[T,R]of A.children.entries()){if(n(R))continue;P(R,[...L,"children",T])}else if(Ir(A.children))P(A.children,[...L,"children"]);if(A.$switch&&A.cases)for(let[T,R]of Object.entries(A.cases))P(R,[...L,"cases",T])})(e,[]);let de=r.documentPath!=null&&(r.documentPath.startsWith("layouts/")||r.documentPath.startsWith("./layouts/")),oe=Dx(a.$elements);if((r.mode==="content"||l||de)&&De.length>0){let P=new Set(oe.map((T)=>S(T)?T.$ref:T)),A=new Map(De.map((T)=>[T.tagName,T])),L=t1(a);if(a.tagName)L.add(rt(a.tagName));for(let T of L)for(let R of A.get(T)?.uses??[])L.add(R);for(let T of L){let R=A.get(T);if(R&&R.source!=="npm"&&R.path){let st=Kc(r.documentPath??null,R.path);if(!P.has(st))oe.push({$ref:st}),P.add(st)}}}if(oe.length>0)a.$elements=oe;return a.imports=PA(a.imports,D),a.$media=nr(a.$media),a.$head=Ox(a.$head),{assets:E,docBase:b,mapperCtx:{arrayPaths:[...V],canvasMode:i,layoutWrapped:l,pageContentOffset:m,pageContentPrefix:d},renderDoc:a,siteStyle:x?.projectConfig?.style??null}}function Hi(e){if(e==="--")return"Base";return e.replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}var mo=new Set(["script","style","link","iframe","object","embed"]);function lh(e){let t={tagName:e};if(/^h[1-6]$/.test(e))t.textContent="Heading";else if(e==="p")t.textContent="Paragraph text";else if(e==="span"||e==="strong"||e==="em"||e==="small"||e==="mark"||e==="code"||e==="abbr"||e==="q"||e==="sub"||e==="sup"||e==="time")t.textContent="Text";else if(e==="a")t.textContent="Link",t.attributes={href:"#"};else if(e==="button")t.textContent="Button";else if(e==="label")t.textContent="Label";else if(e==="legend")t.textContent="Legend";else if(e==="caption")t.textContent="Caption";else if(e==="summary")t.textContent="Summary";else if(e==="li"||e==="dt"||e==="dd"||e==="th"||e==="td"||e==="option")t.textContent="Item";else if(e==="blockquote")t.textContent="Quote";else if(e==="pre")t.textContent="Preformatted text";else if(e==="input")t.attributes={placeholder:"Enter text...",type:"text"};else if(e==="img")t.attributes={alt:"Image"};else if(e==="iframe")t.attributes={src:""};else if(e==="slot")t.children=[{tagName:"p",textContent:"Slot content"}];else if(e==="select")t.children=[{tagName:"option",textContent:"Option 1"}];else if(e==="ul"||e==="ol")t.children=[{tagName:"li",textContent:"Item"}];else if(e==="dl")t.children=[{tagName:"dt",textContent:"Term"},{tagName:"dd",textContent:"Definition"}];else if(e==="table")t.children=[{children:[{children:[{tagName:"th",textContent:"Header"}],tagName:"tr"}],tagName:"thead"},{children:[{children:[{tagName:"td",textContent:"Cell"}],tagName:"tr"}],tagName:"tbody"}];else if(e==="details")t.children=[{tagName:"summary",textContent:"Summary"},{tagName:"p",textContent:"Detail content"}];return t}function Jt(e){return S(e)&&n(e.$ref)?e.$ref:null}function qe(e){if(e.source!=="npm"||!e.package)return null;return e.modulePath?`${e.package}/${e.modulePath}`:e.package}function Qi(e,t){let o=qe(e);if(o)return o;return e.path?{$ref:Kc(t,e.path)}:null}function pL(e,t,o){let r=qe(t);if(r)return e.some((a)=>n(a)&&(a===r||a===t.package));if(!t.path)return!1;let i=ie(Kc(o,t.path));return e.some((a)=>{let l=Jt(a);return l!==null&&ie(l)===i})}function ie(e){return e.replace(/^(?:\.\/)+/,"")}function iy(e,t,o){let r=Qi(t,o);if(!r)return[...e];let a=qe(t)&&t.modulePath?e.filter((l)=>l!==t.package):[...e];return pL(a,t,o)?a:[...a,r]}function fL(e,t,o){let r=qe(t);if(r)return e.filter((a)=>!(n(a)&&(a===r||a===t.package)));if(!t.path)return[...e];let i=ie(Kc(o,t.path));return e.filter((a)=>{let l=Jt(a);return l===null||ie(l)!==i})}function uA(e,t){return e.filter((o)=>!n(o)||!(o===t||o.startsWith(`${t}/`)))}function hA(e,t){let o=ie(t);return e.filter((r)=>{let i=Jt(r);return i===null||ie(i)!==o})}var ea="Components";function Fp(e,t){let o=ta(e,t);if(o)Xe(e,[],"$elements",o)}function ta(e,t){if(!n(t)||!t.includes("-"))return null;let o=De.find((a)=>a.tagName===t);if(!o)return null;let r=e.doc.document.$elements??[],i=iy(r,o,e.documentPath??null);return i.length===r.length?null:i}function BC(e){let t=De.find((o)=>o.tagName===e);return t?Jc(t):null}function pA(){return De.map((e)=>({component:!0,description:(e.source==="npm"?e.package:e.path)??"",group:ea,label:`<${e.tagName}>`,tag:e.tagName}))}function Y(e){if(!e)return[];if(Array.isArray(e.children))return e.children;return n(e.textContent)&&e.textContent.length>0?[e.textContent]:[]}function he(e){let t=0;for(let o of e)t+=n(o)?o.length:he(Y(o));return t}function Ht(e,t,o){let r=[],i=0;for(let a of e){if(i>=o)break;if(n(a)){let d=i+a.length;if(d>t){let m=a.slice(Math.max(0,t-i),Math.max(0,Math.min(o,d)-i));if(m)r.push(m)}i=d;continue}let l=Y(a),s=he(l),c=i+s;if(s===0){if(i>=t&&i<o)r.push({...a})}else if(c>t){let d=Ht(l,Math.max(0,t-i),Math.min(o,c)-i);if(d.length>0)r.push(na(a,d))}i=c}return r}function na(e,t){let{children:o,textContent:r,...i}=e;if(t.length===0)return{...i,textContent:""};if(t.length===1&&n(t[0]))return{...i,textContent:t[0]};return{...i,children:t}}function go(e){let t=[];for(let o of e){if(n(o)){if(o.length===0)continue;let r=t.at(-1);if(n(r)){t[t.length-1]=r+o;continue}}t.push(o)}return t}function ho(e,t,o,r,i=""){return go([...Ht(e,0,t),...i?[i]:[],...Ht(o,r,he(o))])}function Lt(e){let t=go(e);if(t.length===0)return{textContent:""};if(t.length===1&&n(t[0]))return{textContent:t[0]};return{children:t}}function vo(e){if(!e)return!0;if(e.textContent!=null&&e.textContent.trim()==="")return!0;let t=e.children;if(!t)return!1;if(t.length===0)return!0;let[o]=t;if(t.length===1&&n(o)&&o.trim()==="")return!0;return t.length===1&&S(o)&&o.tagName==="br"}function _t(e){return{index:Wi(e),parentPath:zt(e)}}function yo(e,t,o,r,i={}){if(!e)return;let a=re(e.doc.document,t);if(o){if(a&&JSON.stringify(a.children)===JSON.stringify(o))return;X(e,(l)=>{if(a?.textContent!=null)Xe(l,t,"textContent");Xe(l,t,"children",o)},{coalesceKey:i.coalesceKey??null})}else if(r!=null){if(a&&a.textContent===r&&!a.children)return;X(e,(l)=>{if(a?.children)Xe(l,t,"children");Xe(l,t,"textContent",r)},{coalesceKey:i.coalesceKey??null})}}function bo(e,t,o,r){if(!e)return!1;let i=re(e.doc.document,t);if(!i)return!1;if(`${i.$props?.[o]??""}`===r)return!1;return X(e,(l)=>{Xp(l,t,o,r)}),!0}function Co(e,t,o){if(!e)return null;let r=re(e.doc.document,t),i=re(e.doc.document,o);if(!r||!i)return null;if(sa(t,o)||sa(o,t))return null;let a=Y(i),l=Y(r),s=he(a),c=Lt([...a,...l]);return X(e,(d)=>{if(c.children){if(i.textContent!=null)Xe(d,o,"textContent");Xe(d,o,"children",c.children)}else{if(i.children)Xe(d,o,"children");Xe(d,o,"textContent",c.textContent??"")}if(Ch(d,t),Po(d,zt(t)),Qp(e))d.session.selection=[o]}),{offset:s,path:o}}function Po(e,t){let o=t;while(o.length>0){let r=re(e.doc.document,o),i=r?.children;if(!r||!Array.isArray(i)||i.length>0)return;let a=zt(o);if(Ch(e,o),!a)return;o=a}}function So(e,t,o,r){let{parentPath:i,index:a}=_t(t),l=[...i,"children",a+1];if(!e)return l;let s={tagName:"p"};if(r.textContent!=null)s.textContent=r.textContent;else if(r.children)s.children=r.children;else s.textContent="";return X(e,(c)=>{if(o.textContent!=null)Xe(c,t,"children"),Xe(c,t,"textContent",o.textContent);else if(o.children)Xe(c,t,"textContent"),Xe(c,t,"children",o.children);if(oo(c,i,a+1,s),Qp(e))c.session.selection=[l]}),l}function oa(e,t,o,r){let{parentPath:i,index:a}=_t(t),l=vo(r),s=l?a:a+1,c=[...i,"children",s];if(!e)return c;return X(e,(d)=>{if(l)Ch(d,t);else if(r?.children)Xe(d,t,"textContent"),Xe(d,t,"children",r.children);else if(r?.textContent!=null)Xe(d,t,"children"),Xe(d,t,"textContent",r.textContent);if(oo(d,i,s,o),Fp(d,o.tagName),Qp(e))d.session.selection=[c]}),c}function To(e,t,o,r){let i=o.component===!0?BC(o.tag):null;if(i)return oa(e,t,i,r);if(vo(r)){if(!e)return t;return X(e,(d)=>{Xe(d,t,"tagName",o.tag),Xe(d,t,"children");let m=lh(o.tag);if(m.textContent&&m.textContent!=="Paragraph text")Xe(d,t,"textContent",m.textContent);else Xe(d,t,"textContent");if(Qp(e))d.session.selection=[t]}),t}let{parentPath:a,index:l}=_t(t),s=[...a,"children",l+1];if(!e)return s;let c=lh(o.tag);return X(e,(d)=>{if(r?.children)Xe(d,t,"textContent"),Xe(d,t,"children",r.children);else if(r?.textContent!=null)Xe(d,t,"children"),Xe(d,t,"textContent",r.textContent);if(oo(d,a,l+1,structuredClone(c)),Qp(e))d.session.selection=[s]}),s}function Mo(e,t,o,r,i){if(!e)return null;let a=re(e.doc.document,t.path),l=re(e.doc.document,o.path);if(!a||!l)return null;if(sa(t.path,o.path)||sa(o.path,t.path))return null;let s=Lt(ho(Y(a),t.offset,Y(l),o.offset,i)),c=[...r,o.path].toSorted(ra);return X(e,(d)=>{if(s.children){if(a.textContent!=null)Xe(d,t.path,"textContent");Xe(d,t.path,"children",s.children)}else{if(a.children)Xe(d,t.path,"children");Xe(d,t.path,"textContent",s.textContent??"")}for(let m of c)if(re(d.doc.document,m))Ch(d,m),Po(d,zt(m));if(Qp(e))d.session.selection=[t.path]}),{offset:t.offset+i.length,path:t.path}}function ra(e,t){let o=Math.min(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],a=t[r];if(i===a)continue;if(J(i)&&J(a))return a-i;return String(a).localeCompare(String(i))}return t.length-e.length}function I(e,t=1){return{height:e.height*t,left:e.x*t,top:e.y*t,width:e.width*t}}function fA(e,t,o=1){return{x:(e.x-t.left)/o,y:(e.y-t.top)/o}}function We(e,t){if(!t){e.style.display="none";return}e.style.display="block",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function Ao(e=document){let t=e.createElement("div");t.className="jx-canvas-iframe-overlay",t.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2";let o=e.createElement("div");o.className="overlay-box overlay-selection",o.style.display="none";let r=e.createElement("div");r.className="overlay-label",r.style.display="none",o.append(r);let i=e.createElement("div");i.className="overlay-box overlay-hover",i.style.display="none";let a=e.createElement("div");a.className="canvas-drop-indicator",a.style.display="none";let l=e.createElement("button");l.className="insertion-helper",l.textContent="+",l.style.pointerEvents="auto",l.style.display="none";let s=e.createElement("div");s.className="canvas-replace-target",s.style.display="none";let c=e.createElement("div");c.className="overlay-presence-group";let d=e.createElement("div");return d.className="overlay-coselection-group",t.append(i,o,d,a,s,l,c),{dispose:()=>t.remove(),insertButton:l,root:t,setDropIndicator:(m,v="inside")=>aa(a,m,v),setHover:(m)=>We(i,m),setInsertZone:(m,v="center")=>ia(l,m,v),setReplaceTarget:(m)=>We(s,m),setSuppressed:(m)=>{t.style.display=m?"none":""},setCoSelection:(m)=>{d.replaceChildren();for(let v of m){let y=e.createElement("div");y.className="overlay-box overlay-selection overlay-coselection",We(y,v),d.append(y)}},setPresence:(m)=>{c.replaceChildren();for(let v of m){let y=e.createElement("div");y.className="overlay-box overlay-presence",y.style.cssText=`position:absolute;display:block;pointer-events:none;outline:1.5px solid ${v.color};outline-offset:1px;left:${v.placement.left}px;top:${v.placement.top}px;width:${v.placement.width}px;height:${v.placement.height}px`;let b=e.createElement("div");b.className="overlay-presence-tag",b.textContent=v.label,b.style.cssText=`position:absolute;top:-18px;left:-2px;padding:1px 5px;border-radius:3px;font:10px/1.4 sans-serif;color:#fff;white-space:nowrap;background:${v.color}`,y.append(b),c.append(y)}},setSelection:(m,v=null)=>{if(We(o,m),m&&v)r.textContent=v,r.style.display="block";else r.style.display="none"}}}function ia(e,t,o){if(!t){e.style.display="none",e.classList.remove("visible");return}e.dataset.edge=o,e.classList.add("visible"),e.style.display="grid",e.style.left=`${t.left+t.width/2}px`,e.style.top=`${t.top+t.height/2}px`,e.style.translate="-50% -50%"}function aa(e,t,o){if(!t){e.style.display="none";return}if(e.style.display="block",e.style.left=`${t.left}px`,e.style.width=`${t.width}px`,o==="inside"){e.className="canvas-drop-indicator inside",e.style.top=`${t.top}px`,e.style.height=`${t.height}px`;return}e.className="canvas-drop-indicator line",e.style.height="",e.style.top=`${o==="top"?t.top:t.top+t.height}px`}function Uc(e){return JSON.stringify(e)}var j=null;function la(e){if(j?.isConnected)return j;let t=e.createElement("div");return t.className="jx-drag-ghost",t.style.cssText="position:fixed;left:0;top:0;z-index:9999;pointer-events:none;display:none;padding:2px 8px;border-radius:4px;font-size:12px;line-height:1.4;white-space:nowrap;background:var(--accent,#3b82f6);color:var(--accent-fg,#fff);box-shadow:0 2px 8px rgba(0,0,0,0.25);transform:translate(8px,8px)",e.body.append(t),j=t,t}function _L(e,t,o,r=document){let i=la(r);i.textContent=e,i.style.left=`${t}px`,i.style.top=`${o}px`,i.style.display="block"}function YC(e,t){if(!j||j.style.display==="none")return;j.style.left=`${e}px`,j.style.top=`${t}px`}function dh(){if(j)j.style.display="none"}var No=function(){if(typeof window>"u")return null;var e=new Image;return e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e}();function ml(e){var t=e.nativeSetDragImage;if(t&&No)t(No,0,0)}function Oo(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}return o}function Ro(e,t){if(e==null)return{};var o,r,i=Oo(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],t.indexOf(o)===-1&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function Be(e,t){var o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;return o.every(function(i){return Object.is(e[i],t[i])})}function Io(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Be,t=null;return function(o){if(t&&e(t.value,o))return t.value;return t={value:o},t.value}}var ua=["block"];function Do(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function Jo(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?Do(Object(o),!0).forEach(function(r){bl(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Do(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function da(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function jt(e){var{client:t,borderBox:o}=e,r=o.height/4;if(t.y<=o.top+r)return"reorder-above";if(t.y>=o.bottom-r)return"reorder-below";return"make-child"}function pa(e){var{element:t,input:o,currentLevel:r,indentPerLevel:i,mode:a}=e,l={x:o.clientX,y:o.clientY},s=t.getBoundingClientRect();if(a==="standard"){var c=jt({borderBox:s,client:l});return{type:c,indentPerLevel:i,currentLevel:r}}var d=da(s);if(a==="expanded"){var m=jt({borderBox:s,client:l});return{type:m==="reorder-above"?m:"make-child",indentPerLevel:i,currentLevel:r}}var v=i*r;if(l.x<s.left+v){if(l.y<d.y)return{type:"reorder-above",indentPerLevel:i,currentLevel:r};var y=(l.x-s.left)/i,b=Math.max(Math.floor(y),0);return{type:"reparent",desiredLevel:b,indentPerLevel:i,currentLevel:r}}return{type:jt({borderBox:s,client:l}),indentPerLevel:i,currentLevel:r}}function Ho(e,t){if(e.type!==t.type)return!1;if(e.type==="instruction-blocked"&&t.type==="instruction-blocked")return Ho(e.desired,t.desired);return Be(e,t)}var fa=Io(Ho);function ma(e){var{desired:t,block:o}=e;if(o!==null&&o!==void 0&&o.includes(t.type)&&t.type!=="instruction-blocked"){var r={type:"instruction-blocked",desired:t};return r}return t}function Ex(e,t){var o=t.block,r=Ro(t,ua),i=pa(r),a=ma({desired:i,block:o}),l=fa(a);return Jo(Jo({},e),{},bl({},ze,l))}function Vp(e){var t;return(t=e[ze])!==null&&t!==void 0?t:null}var ze=Symbol("tree-item-instruction");var Lo=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180" viewBox="0 0 320 180"><rect width="320" height="180" fill="#808080" fill-opacity="0.16"/><g fill="#808080" fill-opacity="0.38"><circle cx="118" cy="64" r="14"/><path d="M60 140l52-50 34 30 38-46 76 66z"/></g></svg>')}`;function ga(e){let t=e.getAttribute("src")?.trim()??"",o=e.getAttribute("srcset")?.trim()??"";if(t!==""||o!=="")return!1;return!(e.parentElement?.localName==="picture"?e.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function Ft(e){if(ga(e))e.setAttribute("data-jx-image-placeholder",""),e.setAttribute("src",Lo);else if(e.hasAttribute("data-jx-image-placeholder")&&e.getAttribute("src")!==Lo)e.removeAttribute("data-jx-image-placeholder")}function jo(e){return e.localName==="img"}function _o(e){if(e.nodeType!==e.ELEMENT_NODE||!("querySelectorAll"in e))return[];let t=e,o=[...t.querySelectorAll("img")];return jo(t)?[t,...o]:o}function Fo(e){for(let r of _o(e))Ft(r);let o=new(e.ownerDocument.defaultView?.MutationObserver??MutationObserver)((r)=>{for(let i of r){if(i.type==="attributes"){let{target:a}=i;if(a.nodeType===a.ELEMENT_NODE&&"localName"in a){let l=a;if(jo(l))Ft(l)}continue}for(let a of i.addedNodes)for(let l of _o(a))Ft(l)}});return o.observe(e,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>o.disconnect()}async function Tx(e,t=new Map){lu(!0);try{if(!await ha(e))return Vo(e.tagName);let o=document.createElement(e.tagName);for(let i of e.props||[])if(i.default!==void 0&&i.default!=="false"&&i.default!=="''"){let a=String(i.default).replaceAll(/^'|'$/g,"");o.setAttribute(i.name,a)}let r=o;for(let[i,a]of t)r[i]=a;return Fo(o),o}catch(o){return console.warn("Component preview failed:",e.tagName,o),Vo(e.tagName)}}async function ha(e){if(e.source==="npm")return Boolean(customElements.get(e.tagName));if(e.path&&!e.path.endsWith(".json"))return!1;let t=x?.projectRoot;return await Gy(`${location.origin}/${t?`${t}/`:""}${e.path}`),!0}function Vo(e){let t=document.createElement("div");return t.style.cssText="padding:12px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--fg-dim)",t.textContent=`<${e}>`,t}var Bo={$id:"locale/en/elements",title:"Element names (English)",description:"The names and one-line descriptions Studio shows for HTML elements, and the names of the Insert palette's categories (studio.md §5.3). English is the source catalog: every tag the palette offers has an entry here, and a translation is a copy of this file under data/locales/<language>/ with the values translated and the keys left alone.",categories:{text:"Text",lists:"Lists",media:"Media",layout:"Layout",interactive:"Interactive",forms:"Forms",tables:"Tables",inline:"Inline text",advanced:"Advanced"},elements:{h1:{name:"Heading 1",description:"The page's main title. A page usually has one."},h2:{name:"Heading 2",description:"The heading of a section."},h3:{name:"Heading 3",description:"The heading of a subsection."},h4:{name:"Heading 4",description:"A heading one level below Heading 3."},h5:{name:"Heading 5",description:"A heading one level below Heading 4."},h6:{name:"Heading 6",description:"The smallest heading."},p:{name:"Paragraph",description:"A block of body text."},blockquote:{name:"Quote",description:"A passage quoted from another source."},pre:{name:"Code block",description:"Text shown exactly as typed, spaces and line breaks included, in a fixed-width font."},hr:{name:"Divider",description:"A line that separates two parts of the page."},address:{name:"Contact details",description:"Contact information for the page or for the article it is in."},ul:{name:"Bulleted list",description:"A list whose order does not matter."},ol:{name:"Numbered list",description:"A list whose order matters, such as steps."},li:{name:"List item",description:"One item of a bulleted or numbered list."},dl:{name:"Description list",description:"Terms paired with their descriptions, such as a glossary or an FAQ."},dt:{name:"Term",description:"A term in a description list."},dd:{name:"Description",description:"The description of a term in a description list."},menu:{name:"Menu list",description:"A list of commands, such as the buttons of a toolbar."},img:{name:"Image",description:"A picture."},figure:{name:"Figure",description:"An image, chart or code sample, with an optional caption."},figcaption:{name:"Figure caption",description:"The caption of a figure."},video:{name:"Video",description:"A video with playback controls."},audio:{name:"Audio",description:"A sound clip or a piece of music, with playback controls."},picture:{name:"Responsive image",description:"An image with alternative files for different screens and formats."},source:{name:"Media source",description:"One alternative file for a video, an audio clip or a responsive image."},track:{name:"Text track",description:"Captions or subtitles for a video or an audio clip."},iframe:{name:"Embedded page",description:"Another web page shown inside this one, such as a map or a video player."},section:{name:"Section",description:"A part of the page about one topic, usually with its own heading."},div:{name:"Container",description:"A box that groups other elements and has no meaning of its own."},header:{name:"Header",description:"Introductory content, such as a logo, a title or the navigation."},footer:{name:"Footer",description:"Closing content, such as copyright, contact links or related pages."},main:{name:"Main content",description:"The page's central content. A page has one."},nav:{name:"Navigation",description:"A group of links to other pages or to parts of this one."},article:{name:"Article",description:"Content that stands on its own, such as a blog post or a product card."},aside:{name:"Aside",description:"Content set apart from the main flow, such as a sidebar or a call-out."},search:{name:"Search area",description:"The part of the page that holds a search form."},hgroup:{name:"Heading group",description:"A heading together with its subtitle or tagline."},a:{name:"Link",description:"Text that takes the reader to another page, or to another place on this one."},button:{name:"Button",description:"A button the reader clicks."},details:{name:"Expandable section",description:"Content the reader shows or hides by clicking its summary."},summary:{name:"Summary",description:"The always-visible label of an expandable section."},dialog:{name:"Dialog",description:"A box shown over the page, such as a pop-up message."},form:{name:"Form",description:"A group of fields the reader fills in and sends."},label:{name:"Field label",description:"The text that names a form field."},input:{name:"Input field",description:"A one-line field for text, numbers, dates, checkboxes and more."},textarea:{name:"Text area",description:"A field for several lines of text."},select:{name:"Dropdown",description:"A list of choices the reader picks from."},option:{name:"Option",description:"One choice in a dropdown or a suggestion list."},optgroup:{name:"Option group",description:"A labelled group of choices in a dropdown."},datalist:{name:"Suggestion list",description:"Values suggested while the reader types in a field."},fieldset:{name:"Field group",description:"A box around related fields, titled by its legend."},legend:{name:"Field group title",description:"The title of a field group."},output:{name:"Result",description:"The result of a calculation or an action in a form."},progress:{name:"Progress bar",description:"How far a task has got."},meter:{name:"Meter",description:"A value within a known range, such as storage used."},table:{name:"Table",description:"Data in rows and columns."},caption:{name:"Table caption",description:"The title of a table."},thead:{name:"Table header",description:"The rows that head a table's columns."},tbody:{name:"Table body",description:"The main rows of a table."},tfoot:{name:"Table footer",description:"The rows that sum up a table, such as totals."},tr:{name:"Table row",description:"One row of cells."},th:{name:"Header cell",description:"A cell that heads a row or a column."},td:{name:"Data cell",description:"One cell of data."},colgroup:{name:"Column group",description:"A group of table columns styled together."},col:{name:"Column",description:"One column of a column group."},span:{name:"Text span",description:"A piece of text to style, with no meaning of its own."},strong:{name:"Important text",description:"Text that matters more than what surrounds it, shown in bold."},em:{name:"Emphasis",description:"Text spoken with stress, shown in italics."},b:{name:"Bold",description:"Text drawn in bold without extra importance, such as a keyword."},i:{name:"Italic",description:"Text in an alternate voice, such as a foreign word or a thought."},u:{name:"Underline",description:"Text marked with an underline, such as a misspelling."},s:{name:"Strikethrough",description:"Text that is no longer accurate."},small:{name:"Small print",description:"Side comments and fine print, such as a disclaimer."},mark:{name:"Highlight",description:"Text highlighted for reference, such as a search match."},code:{name:"Inline code",description:"A short piece of code inside a sentence."},kbd:{name:"Keyboard input",description:"Keys the reader presses, such as Ctrl+C."},samp:{name:"Program output",description:"Text a program printed."},var:{name:"Variable",description:"A variable in a formula or in code."},sub:{name:"Subscript",description:"Text set below the line, as in H₂O."},sup:{name:"Superscript",description:"Text set above the line, as in 10²."},q:{name:"Inline quote",description:"A short quotation inside a sentence."},cite:{name:"Citation",description:"The title of a creative work, such as a book or a film."},abbr:{name:"Abbreviation",description:"An abbreviation or an acronym, with its full form."},dfn:{name:"Definition",description:"The term a sentence defines."},time:{name:"Date or time",description:"A date or a time that software can read."},data:{name:"Data value",description:"A value with a machine-readable form, such as a product code."},del:{name:"Deleted text",description:"Text removed from a document, shown struck through."},ins:{name:"Inserted text",description:"Text added to a document, shown underlined."},br:{name:"Line break",description:"Starts a new line inside the same paragraph."},wbr:{name:"Line break opportunity",description:"A place a long word may wrap."},bdi:{name:"Isolated text direction",description:"Text whose direction may differ from what surrounds it, such as a user name."},bdo:{name:"Text direction override",description:"Text drawn in a direction you set."},ruby:{name:"Ruby annotation",description:"Text with a small pronunciation guide above it, as in East Asian typography."},rt:{name:"Ruby text",description:"The pronunciation guide of a ruby annotation."},rp:{name:"Ruby fallback",description:"Parentheses shown around ruby text where ruby is not supported."},area:{name:"Image map area",description:"A clickable region of an image map."},canvas:{name:"Drawing canvas",description:"A surface a script draws graphics on."},embed:{name:"Embedded content",description:"Content from an external file, such as a plugin."},map:{name:"Image map",description:"An image with clickable regions."},noscript:{name:"No-script fallback",description:"Content shown when scripts are turned off."},object:{name:"External object",description:"An external resource, such as a PDF."},selectedcontent:{name:"Selected option content",description:"Shows the chosen option inside a customised dropdown."},slot:{name:"Slot",description:"Where a component shows the content placed inside it."},template:{name:"Template",description:"Content kept for a script to copy, not shown on the page."}}};var Ko="en",ve=Bo,Go=new Map([[Ko,ve]]);function ya(e,t=[...Go.keys()]){let o=new Map(t.map((r)=>[r.toLowerCase(),r]));for(let r of e){let i=r.toLowerCase(),a=o.get(i)??o.get(i.split("-")[0]??"");if(a)return a}return Ko}function xa(){if(typeof navigator>"u")return[];let{language:e,languages:t}=navigator;return(t&&t.length>0?t:[e]).filter((r)=>typeof r==="string"&&r!=="")}function Vt(){return ya(xa())}function qt(e){return Go.get(e)??ve}function uh(e,t=Vt()){return qt(t).elements[e]?.name??ve.elements[e]?.name??e}function RA(e,t=Vt()){return qt(t).elements[e]?.description??ve.elements[e]?.description??""}function IA(e,t=Vt()){return qt(t).categories[e]??ve.categories[e]??e}var ba='[part="outline"]',Bt='[part="row"]',Ca='[part="verbs"]',Ke=null;function NA(){if(Ke!==null)cancelAnimationFrame(Ke);for(let e of tt.dndCleanups)e();tt.dndCleanups=[],Ke=requestAnimationFrame(()=>{Ke=null;let e=$h?.querySelector(ba);if(!e)return;for(let o of e.querySelectorAll("[data-dnd-row]")){let r=o.dataset.value.split("/").map((c)=>/^\d+$/.test(c)?Math.trunc(Number(c)):c),i=Math.trunc(Number(o.dataset.dndDepth))||0,a=Object.hasOwn(o.dataset,"dndVoid"),l=Object.hasOwn(o.dataset,"dndExpanded"),s=Uo(qo({canDrag({element:c,input:d}){if(E_(d.clientX,d.clientY)?.closest(Ca))return!1;return!0},element:o,getInitialData(){return{path:r,type:"tree-node"}},onGenerateDragPreview({nativeSetDragImage:c}){ml({nativeSetDragImage:c})},onDragStart(){if(o.dataset.dragging="",tt.layerDragSourceHeight=o.offsetHeight,l)Pa(o,e)},onDrop(){if(delete o.dataset.dragging,l)wn("leftPanel")}}),Xs({element:o,canDrop({source:c}){let d=c.data.path;if(Array.isArray(d)&&sa(d,r))return!1;return!0},getData({input:c,element:d}){return Ex({path:r},{block:a?["make-child"]:[],currentLevel:i,element:d,indentPerLevel:16,input:c,mode:l?"expanded":"standard"})},onDragEnter({self:c}){Zo(o,c.data,e)},onDrag({self:c}){Zo(o,c.data,e)},onDrop(){ye(e)}}));tt.dndCleanups.push(s)}let t=Qs({onDrop({source:o,location:r}){ye(e);let[i]=r.current.dropTargets;if(!i)return;let a=Vp(i.data);if(!a||a.type==="instruction-blocked")return;let l=o.data,s=i.data.path;if(!Array.isArray(s))return;let c=l.type==="tree-node"&&o.element,d=c&&Object.hasOwn(c.dataset,"dndExpanded");if(ry(h.value,a,l,s),d){let m=h.value,v=Pe(m?.session.selection);if(v)tt._layersCollapsed||=new Set,tt._layersCollapsed.add(v.join("/"))}},onDropTargetChange({location:o}){let[r]=o.current.dropTargets;if(r&&!Vp(r.data))ye(e)}});tt.dndCleanups.push(t)})}function DA(){requestAnimationFrame(()=>{let e=$h?.querySelector(".components-section");if(!e)return;for(let t of e.querySelectorAll("[data-component-tag]")){let o=t.dataset.componentTag;if(!o)continue;let r=De.find((s)=>s.tagName===o);if(!r)continue;let i=t.querySelector(".element-card-preview");if(i&&!i.querySelector(o))Tx(r).then((s)=>{i.textContent="",i.append(s)});let a=Jc(r),l=qo({element:t,getInitialData(){return{fragment:structuredClone(a),type:"block"}},onGenerateDragPreview({nativeSetDragImage:s}){ml({nativeSetDragImage:s})}});tt.dndCleanups.push(l)}})}function OA(){requestAnimationFrame(()=>{let e=$h?.querySelector('[part="content"]');if(!e)return;for(let t of e.querySelectorAll("[data-block-tag]")){let o=t.dataset.blockTag,r=t.querySelector(".element-card-preview");if(r&&!r.firstChild){let l=document.createElement(mo.has(o)?"span":o);l.textContent=uh(o),r.append(l)}let i=lh(o),a=qo({element:t,getInitialData(){return{fragment:structuredClone(i),type:"block"}},onGenerateDragPreview({nativeSetDragImage:l}){ml({nativeSetDragImage:l})}});tt.dndCleanups.push(a)}})}function Pa(e,t){let o=`${e.dataset.value}/`,r=t.querySelectorAll(Bt);for(let i of r)if(i.dataset.value?.startsWith(o))i.style.display="none"}function Zo(e,t,o){let r=Vp(t);if(tt._currentDropTargetRow&&tt._currentDropTargetRow!==e)delete tt._currentDropTargetRow.dataset.drop;if(!r||r.type==="instruction-blocked"){ye(o);return}if(r.type==="make-child"){ye(o),e.dataset.drop="",tt._currentDropTargetRow=e;return}delete e.dataset.drop,tt._currentDropTargetRow=e;let i=[...o.querySelectorAll(Bt)],a=i.indexOf(e),l=tt.layerDragSourceHeight;for(let[s,c]of i.entries()){if(c.dataset.dragging!==void 0)continue;if(r.type==="reorder-above")c.style.transform=s>=a?`translateY(${l}px)`:"";else c.style.transform=s>a?`translateY(${l}px)`:""}}function ye(e){if(tt._currentDropTargetRow)delete tt._currentDropTargetRow.dataset.drop,tt._currentDropTargetRow=null;let t=e.querySelectorAll(Bt);for(let o of t)o.style.transform="",o.style.display=""}function Yo(e,t,o){if(t==="make-child")return{index:so(re(e,o)).length,parent:o};let r=zt(o),i=Wi(o);if(!r||!J(i))return;if(t==="reorder-above")return{index:i,parent:r};if(t==="reorder-below")return{index:i+1,parent:r};return null}function ry(e,t,o,r){if(!e)return;if(o.type==="tree-node"){let i=o.path,a=Yo(e.doc.document,t.type,r);if(a)X(e,(l)=>Zp(l,i,a.parent,a.index))}else if(o.type==="block"){let i=Yo(e.doc.document,t.type,r);if(i===void 0)return;let a=o.fragment;if(i)X(e,(l)=>{oo(l,i.parent,i.index,structuredClone(a)),Fp(l,a.tagName),l.session.selection=[[...i.parent,"children",i.index]]})}}function Xo(e){let t={};for(let[o,r]of Object.entries(e?.nesting??{}))if(o!=="_root")t[o]=r?.inline===!0;for(let o of e?.inline??[])t[o]=!1;return t}function F(e){return JSON.parse(JSON.stringify(e))}var nt=new WeakMap,C=new Set,ne=0,be=new Map,pr=-1,fr=0,wa=600;function SL(e){return pr===e&&Date.now()-fr<=wa}var Qo=0,mr=new Set;function Sa(e,t){let o;try{o=new URL(e,t.iframe.src||gh())}catch{return}if(!["http:","https:","mailto:","tel:"].includes(o.protocol))return;let r=o.href,i=Vn();if(i){i(r);return}window.open(r,"_blank","noopener,noreferrer")}function CL(e){mr.add(e)}function Ea(e){return mr.delete(e)}var B=new Map,se=new Map,Ce=new Map,Ta=300;function kL(e,t,o,r=Ta){let i=null;for(let s of C){if(!s.iframe.isConnected){C.delete(s);continue}if(s.ready&&!s.stylebook&&e!==null&&s.tabId===e){i=s;break}}if(!i)return Promise.resolve(null);Qo+=1;let a=Qo,l=F(t);return i.channel.post({contextPath:o?[...o]:null,exprs:l,gen:i.lastRenderedGen,kind:"evalExpr",reqId:a}),new Promise((s)=>{let c=setTimeout(()=>{B.delete(a),se.delete(a),s(null)},r);se.set(a,i),B.set(a,(d)=>{clearTimeout(c),se.delete(a),s(d)})})}var er=0,ue=new Map,Ma=250;function EL(e,t=Ma){let o=[];for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&!r.stylebook&&e!==null&&r.tabId===e)o.push(r)}if(o.length===0)return Promise.resolve();return new Promise((r)=>{let i=o.length,a=setTimeout(()=>{for(let c of s)ue.delete(c),Ce.delete(c);r()},t),l=()=>{if(i-=1,i===0)clearTimeout(a),r()},s=[];for(let c of o){er+=1;let d=er;s.push(d),ue.set(d,l),Ce.set(d,c),c.channel.post({kind:"flushEdits",reqId:d})}})}function ZC(e){return nt.get(e)??null}function oy(e){for(let t of C){if(!t.iframe.isConnected)continue;let o=Me(t.iframe);if(e.x>=o.left&&e.x<=o.right&&e.y>=o.top&&e.y<=o.bottom)return t}return null}function sy(e,t,o){ne+=1,be.set(ne,o);let r=t.type==="tree-node"?{path:[...t.path],type:"tree-node"}:{type:t.type};return e.channel.post({dragSeq:ne,gen:e.lastRenderedGen,kind:"dragStart",src:r}),ne}function XC(){return ne}function rc(e){let t=Me(e.iframe),o=e.iframe.clientWidth>0?t.width/e.iframe.clientWidth:1;return{rect:t,scale:o}}function gr(e){if(e.stylebook)return"stylebook";return e.tabId??"unbound"}function TL(){let e=[];for(let t of C){if(!t.iframe.isConnected){C.delete(t);continue}let o=`canvas[${gr(t)}]`;if(!t.ready){e.push(`${o}: frame has not handshaked`);continue}let r=[...t.pendingTabIds.keys()];if(r.length>0)e.push(`${o}: gen ${r.join(", ")} unacked`);if(t.pendingPatches>0)e.push(`${o}: ${t.pendingPatches} unacked patch(es)`);if(t.pendingMeasures.size>0)e.push(`${o}: ${t.pendingMeasures.size} measure(s) in flight`);let{idle:i}=t;if(!i){e.push(`${o}: no quiescence report yet`);continue}if(i.gen!==t.lastRenderedGen)e.push(`${o}: quiescence is for gen ${i.gen}, DOM is gen ${t.lastRenderedGen}`);if(!i.fonts)e.push(`${o}: fonts still loading`);if(i.animations>0)e.push(`${o}: ${i.animations} running animation(s)`);if(i.images>0)e.push(`${o}: ${i.images} pending image retry(ies)`)}if(B.size>0)e.push(`canvas: ${B.size} expression eval(s) in flight`);return e}var Aa=500,Na=2,Ra=40;function vr(){let e=h.value?.id??null,t=null;for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(!o.ready||o.stylebook)continue;if(o.tabId===e)return o;t??=o}return t}function xr(e,t){let{rect:o,scale:r}=rc(e),i=o.left+t.x*r,a=o.top+t.y*r,l=t.width*r,s=t.height*r;return{height:s,left:i,top:a,width:l,x:i+l/2,y:a+s/2}}function Ee(e,t){return new Promise((o)=>{e.measureSeq+=1;let r=e.measureSeq,i=setTimeout(()=>{e.pendingMeasures.delete(r),o(null)},Aa);e.pendingMeasures.set(r,(a)=>{clearTimeout(i);let[l]=a;o(l?xr(e,l.rect):null)}),e.channel.post({kind:"measure",paths:[[...t]],reqId:r})})}function $L(e){let t=ZC(e),o=t?.lastHover;if(!t||!o)return null;return{settle:async()=>(await Ee(t,o.path))?.top??null,top:xr(t,o.rect).top}}function LL(e){let t=vr();return t?Ee(t,e):Promise.resolve(null)}function $a(e){return new Promise((t)=>{let o=Number.NaN,r=0,i=0,a=()=>{let{top:l}=Me(e.iframe);if(r=l===o?r+1:0,o=l,i+=1,r>=Na||i>=Ra){t();return}requestAnimationFrame(a)};requestAnimationFrame(a)})}async function ay(e){let t=vr();return t?kF(t,e):null}async function kF(e,t){let o=await Ee(e,t);if(!o)return null;let r=z(e.canvasEl)?.surface;return GC({height:o.height,top:o.top},r),await $a(e),Ee(e,t)}function UF(e,t){let o=ZC(e);return o?Ee(o,t):Promise.resolve(null)}function Ia(e){let t=e.canvasEl.parentElement;if(!t)return;let o=/scale\(([\d.]+)\)/.exec(e.canvasEl.style.transform),r=o?Number(o[1]):1;t.style.height=r===1?"":`${e.iframe.offsetHeight*r}px`}function Cr(e){if(e.preview){e.iframe.style.height="100%",e.iframe.style.minHeight="0px";return}if(e.contentHeight===null)return;e.iframe.style.height=`${e.contentHeight}px`,e.iframe.style.minHeight=e.contentFragment?"0px":"480px",Ia(e)}function Yt(e,t){if(e.preview=t,e.overlay.setSuppressed(t),t)e.pendingEnterEdit=null;Cr(e)}function RL(e,t){Yt(Qt(e),t)}function qc(e,t){if(!e.iframe.isConnected)return;e.channel.post(t)}function $x(e){be.delete(e)}function Lx(e){e.overlay.setDropIndicator(null)}var Pr=null;function IL(e){Pr=e}var ka=300,wr=null;function NL(e){wr=e}var Xt=null;function DL(e){Xt=e}function Da(e,t,o){if((t?Ja(t.tagName):!1)&&t){e.overlay.setDropIndicator(null),e.overlay.setReplaceTarget(I(t.rect));return}e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(o?I(o.referenceRect):null,o?.edge)}function tr(e){e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(null)}function Ja(e){return e==="img"||e==="video"||e==="source"}function Ha(e,t){if(e.dataset.jxGutterDrop==="1")return;e.dataset.jxGutterDrop="1",e.addEventListener("dragover",(o)=>{if(![...o.dataTransfer?.types??[]].includes("Files"))return;if(o.preventDefault(),o.dataTransfer)o.dataTransfer.dropEffect="copy"}),e.addEventListener("drop",(o)=>{let r=o.dataTransfer?.files,i=t();if(!r?.length||!i||i.stylebook)return;o.preventDefault(),Xt?.(M(i),[...r],null,null)})}var Ze=null;function OL(e){Ze=e}var Ye=null;function AL(e){Ye=e}var Sr=null;function PL(e){Sr=e}function rr(e,t){let o=[...t];for(;;){let r=e.get(Uc(o));if(r)return r;if(o.length<2)return null;o=o.slice(0,-2)}}var N=null;function ML(){let e=N;return Boolean(e?.editing&&e.iframe.isConnected)}var Qe=null;function FL(e){Qe=e}var Zt=null;function jL(e){Zt=e}var ir=null,Er=null;function HL(e){Er=e}function BL(e,t){for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(o.ready&&o.tabId===e.id&&!o.preview)o.popoverOpen=t,o.channel.post({kind:"setPopoverOpen",path:t})}}function VL(e,t){for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(o.ready&&o.tabId===e.id&&!o.preview)o.dialogOpen=t,o.channel.post({kind:"setDialogOpen",path:t})}}function QC(e,t){let o=0;for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&r.tabId===t){let i=z(r.canvasEl)?.surface;if(!i){wx("host-stage-unresolved");continue}let a=i.renderGeneration,l=ot?.host===r?ot.paths:void 0;it(r),r.channel.post(l?{echoPaths:l,forwardOps:e,gen:a,kind:"patch"}:{forwardOps:e,gen:a,kind:"patch"}),r.pendingPatches+=1,o+=1}}return o}var ot=null,_a=0;function ar(e,t,o){ot={host:e,paths:t};try{o()}finally{ot=null}}var Kt=null,Ut=null;function ja(e,t,o){return!e&&t===o}function Fa(e,t){let o=M(e);if(!o)return;let r=re(o.doc.document,t);if(!r)return;QC([{key:"$props",op:"set-key",path:t,value:r.$props}],o.id)}function M(e){return e.tabId?g.tabs.get(e.tabId)??null:null}function WL(e){return M(e)}function Ue(e){let t=z(e.canvasEl)?.surface.paneId;if(t)ko(t)}var Va=Object.freeze([]);function qa(){let e=new Map;for(let t of g.panes){let o=t.activeTabId?g.tabs.get(t.activeTabId):null;if(!o)continue;let r=o.session.selection;r.map((i)=>i.join("/")).join("|"),e.set(o.id,r)}return e}function Wa(){if(ir)return;let e=me(!0);e.run(()=>{te(()=>{let t=qa();u.stylebook.selection;for(let o of C)at(o,(o.tabId?t.get(o.tabId):null)??Va)})}),ir={stop:()=>e.stop()}}function it(e){if(!e.ready)return;let t=yh(),o=Jp();if(t===e.postedVersions&&o===e.postedRevisions)return;let r=e.postedVersions===null;if(e.postedVersions=t,e.postedRevisions=o,r&&Object.keys(t).length===0&&Object.keys(o).length===0)return;e.channel.post({kind:"assetVersions",revisions:o,versions:t})}var sr=!1,Gt=!1;function za(){if(sr)return;sr=!0,me(!0).run(()=>{te(()=>{if(_y.value,Gt)return;Gt=!0,queueMicrotask(()=>{Gt=!1,Ka()})})})}function Ka(){for(let e of C){if(!e.iframe.isConnected){C.delete(e);continue}it(e)}}var lr=!1,Ge=null;function Ua(){if(lr)return;lr=!0,me(!0).run(()=>{te(()=>{for(let t of g.panes){let o=t.activeTabId?g.tabs.get(t.activeTabId):null;if(!o)continue;let{peers:r}=xn(o);r.map((i)=>JSON.stringify(i.state.structuralSelection??null)).join("|")}if(Ge)clearTimeout(Ge);Ge=setTimeout(()=>{Ge=null;for(let t of C)Tr(t)},100)})})}function Tr(e){if(e.stylebook||!e.ready||!e.iframe.isConnected)return;let t=M(e),o=t?xn(t).peers:[];e.presenceMeta.clear();let r=[];for(let i of o){let{structuralSelection:a}=i.state;if(!a||i.state.focusedPath!==t?.documentPath)continue;for(let l of a){let s=[...l];r.push(s),e.presenceMeta.set(JSON.stringify(s),{color:i.state.user.color,label:i.state.user.name??i.state.user.login})}}if(r.length===0){e.presenceReqId=-1,e.overlay.setPresence([]);return}e.measureSeq+=1,e.presenceReqId=e.measureSeq,e.channel.post({kind:"measure",paths:r,reqId:e.presenceReqId})}function at(e,t){if(e.stylebook){Ga(e);return}let o=Pe(t);if(e.selectionPath=o,e.selectionPaths=t,!e.iframe.isConnected){C.delete(e);return}if(!o){e.selReqId=-1,e.coSelectionKeys.clear(),e.overlay.setSelection(null),e.overlay.setCoSelection([]);return}if(!e.ready)return;let r=Oa(t.slice(0,-1));e.coSelectionKeys=new Set(r.map((i)=>JSON.stringify(i))),e.measureSeq+=1,e.selReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o],...r],reqId:e.selReqId})}function Ga(e){if(!e.iframe.isConnected){C.delete(e);return}let t=u.stylebook.selection,o=t?e.stylebook?.tagToCardPath.get(t):void 0;if(!t||!o){e.selReqId=-1,e.overlay.setSelection(null);return}if(!e.ready)return;e.measureSeq+=1,e.selReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o]],reqId:e.selReqId})}function cr(){return j_("../canvas.html")}function Mr(e){e.channel.dispose();for(let[t,o]of B)if(se.get(t)===e)B.delete(t),se.delete(t),o(null);for(let[t,o]of ue)if(Ce.get(t)===e)ue.delete(t),Ce.delete(t),o();for(let[,t]of e.pendingMeasures)t([]);if(e.pendingMeasures.clear(),e.pendingTabIds.clear(),Te(e),N===e)N=null;e.overlay.root.remove(),e.iframe.remove(),nt.delete(e.canvasEl),C.delete(e)}function Za(){if(!we())return cr();return p().canvasUrl||cr()}function ly(e){let t=0;for(let o of new Set(C))if(e.contains(o.canvasEl))Mr(o),t+=1;return t}function Qt(e){let t=Za(),o=nt.get(e);if(o){if(o.canvasUrl===t)return o;Mr(o)}let r=location.origin,i=crypto.randomUUID(),a=new URL(t,location.href).origin,l=document.createElement("iframe");l.className="jx-canvas-iframe",l.title="Canvas — live page render",l.style.cssText="width:100%;min-height:480px;height:100%;border:0;display:block;background:#fff";let s=new URL(t,location.href);if(s.searchParams.set("token",i),location.protocol==="http:"||location.protocol==="https:")s.searchParams.set("parentOrigin",r);if(l.src=a===r?`${s.pathname}${s.search}`:s.href,!e.style.position)e.style.position="relative";let c=Ao(document);e.replaceChildren(l,c.root),Ha(e,()=>ZC(e));let d=Fn({acceptOrigin:a,source:window,target:{postMessage:(v,y)=>l.contentWindow?.postMessage(v,y)},targetOrigin:a,token:i}),m={canvasEl:e,canvasUrl:t,channel:d,contentFragment:!1,contentHeight:null,hiddenPaths:new Set,popoverOpen:null,dialogOpen:null,editing:!1,editingProp:null,iframe:l,insertHideTimer:null,insertHover:!1,coSelectionKeys:new Set,insertZone:null,lastRenderedGen:-1,lastHover:null,lastSelectionRect:null,lastSnapshotSeq:0,measureSeq:0,overlay:c,panReqId:-1,pending:null,postedVersions:null,postedRevisions:null,idle:null,pendingEnterEdit:null,pendingMeasures:new Map,pendingPatches:0,pendingTabIds:new Map,presenceMeta:new Map,presenceReqId:-1,preview:!1,ready:!1,selectionPath:null,selectionPaths:[],selReqId:-1,snapshot:null,stylebook:null,tabId:null};return c.insertButton.addEventListener("click",(v)=>Qa(m,v)),c.insertButton.addEventListener("mouseenter",()=>{m.insertHover=!0,Te(m)}),c.insertButton.addEventListener("mouseleave",()=>{m.insertHover=!1,Nr(m)}),d.onMessage((v)=>ts(m,v)),nt.set(e,m),C.add(m),Wa(),Ua(),za(),m}function Ya(e,t){Te(e),e.insertZone=t,e.overlay.setInsertZone(I(t.rect),t.edge)}function Ar(e){Te(e),e.insertZone=null,e.insertHover=!1,e.overlay.setInsertZone(null)}function Xa(e){let t=e.overlay.insertButton;return e.insertHover||t.matches(":hover")}function Nr(e){Te(e),e.insertHideTimer=setTimeout(()=>{if(e.insertHideTimer=null,Xa(e))return;Ar(e)},ka)}function Te(e){if(e.insertHideTimer!==null)clearTimeout(e.insertHideTimer),e.insertHideTimer=null}function Qa(e,t){t.stopPropagation(),t.preventDefault();let o=e.insertZone;if(!o)return;wr?.(e.overlay.insertButton,o)}var es=new Set(["contextMenu","dragOver","dropResult","editCommit","editCommitProp","editInput","editInsert","editMerge","editRangeReplace","editSplit","editStart","fileDragOver","fileDrop","hit","hover","insertZones","layoutHit","nativeDragEnter"]);function ts(e,t){if(e.preview&&es.has(t.kind))return;switch(t.kind){case"ready":{e.ready=!0;let o=en?.();if(o)e.channel.post({chords:o.chords,kind:"keymap",mac:o.mac});if(e.postedVersions=null,e.postedRevisions=null,it(e),e.pending)e.channel.post(e.pending),e.pending=null;at(e,e.selectionPaths);return}case"paneFocus":{Ue(e),Zt?.();return}case"popoverTargetClick":{let o=M(e);if(!o||e.preview)return;let r=JSON.stringify(o.session.ui.openPopover)===JSON.stringify(t.targetPath),i=t.action==="show"||t.action==="toggle"&&!r;if(i||r)ae()?.run("canvas.setPopoverOpen",{open:i,path:t.targetPath});return}case"commandTargetClick":{let o=M(e);if(!o||e.preview)return;let r=(a)=>JSON.stringify(a)===JSON.stringify(t.targetPath),i=re(o.doc.document,t.targetPath);if(!Gn(i))return;if(ft.has(t.command)){if(!Ba(i))return;let a=t.command==="show-popover"||t.command==="toggle-popover"&&!r(o.session.ui.openPopover);if(a||r(o.session.ui.openPopover))ae()?.run("canvas.setPopoverOpen",{open:a,path:t.targetPath})}else if(pt.has(t.command)){if(!_(i))return;let a=t.command==="show-modal";if(a||r(o.session.ui.openDialog))ae()?.run("canvas.setDialogOpen",{open:a,path:t.targetPath})}return}case"hit":{Ue(e),Zt?.(),dR(null);let o=null,r=z(e.canvasEl)?.panel;if(r?.mediaName&&!r.mediaName.startsWith("git-diff")){o=Ae(r.mediaName);let a=M(e);if(a)a.session.ui.activeMedia=o}if(Ye?.dismiss(),e.stylebook){let a=rr(e.stylebook.pathToTag,t.hit.path);if(Sr?.(a,o),a){let l=I(t.hit.rect);e.overlay.setSelection(l,`<${a}>`),e.lastSelectionRect=l}else e.overlay.setSelection(null);return}e.selectionPath=t.hit.path,e.selectionPaths=[t.hit.path];let i=M(e);if(i)i.session.selection=t.additive?a_(i.session.selection,t.hit.path):[t.hit.path];{let a=I(t.hit.rect);e.overlay.setSelection(a),e.lastSelectionRect=a}return}case"layoutHit":{if(e.stylebook)return;Ue(e),Ye?.dismiss(),dR(t.hit),e.selectionPath=null,e.selectionPaths=[];let o=M(e);if(o)o.session.selection=[];let r=I(t.hit.rect);e.overlay.setSelection(r,`LAYOUT · ${t.hit.layoutFile}`),e.lastSelectionRect=r,wn("rightPanel");return}case"hover":{if(e.stylebook){let o=t.hit?rr(e.stylebook.pathToTag,t.hit.path):null,r=u.stylebook.selection;if(t.hit&&o&&o!==r)e.overlay.setHover(I(t.hit.rect));else e.overlay.setHover(null);return}e.lastHover=t.hit,is(e,t.hit);return}case"insertZones":{if(e.stylebook)return;let o=t.zones?.[0]??null;if(o)Ya(e,o);else Nr(e);return}case"geometry":{let o=e.pendingMeasures.get(t.reqId);if(o){e.pendingMeasures.delete(t.reqId),o(t.hits);return}if(t.reqId===e.presenceReqId){e.presenceReqId=-1;let r=[];for(let i of t.hits){let a=e.presenceMeta.get(JSON.stringify(i.path));if(a)r.push({...a,placement:I(i.rect)})}e.overlay.setPresence(r);return}if(t.reqId===e.panReqId){e.panReqId=-1;let[r]=t.hits;if(r){let{rect:i,scale:a}=rc(e);Ln({height:r.rect.height*a,top:r.rect.y*a+i.top})}return}if(t.reqId===e.selReqId){let r=JSON.stringify(e.selectionPath),i=[],a=null;if(e.stylebook){let[s]=t.hits;a=s?I(s.rect):null}else for(let s of t.hits){let c=JSON.stringify(s.path);if(c===r)a=I(s.rect);else if(e.coSelectionKeys.has(c))i.push(I(s.rect))}let l=e.stylebook?u.stylebook.selection:null;e.overlay.setSelection(a,l?`<${l}>`:null),e.overlay.setCoSelection(i),e.lastSelectionRect=a,e.hiddenPaths=new Set((t.hidden??[]).map((s)=>JSON.stringify(s)))}return}case"evalResult":{let o=B.get(t.reqId);if(!o)return;B.delete(t.reqId),se.delete(t.reqId),o(t.gen===e.lastRenderedGen?t.results:null);return}case"renderComplete":{if(e.pendingTabIds.has(t.gen))e.tabId=e.pendingTabIds.get(t.gen)??null;for(let o of e.pendingTabIds.keys())if(o<=t.gen)e.pendingTabIds.delete(o);ur(e,t.gen);return}case"patchComplete":{e.pendingPatches=Math.max(0,e.pendingPatches-1),ur(e,t.gen);return}case"idle":{e.idle={animations:t.animations,fonts:t.fonts,gen:t.gen,images:t.images};return}case"renderError":{e.pendingTabIds.delete(t.gen);let o=M(e);if(o)o.session.canvas.refreshing=!1,wn("leftPanel");w.error("The page could not be rendered.",{detail:t.message,key:`canvas.render:${gr(e)}`,source:"Canvas"});return}case"dataScope":{if(t.gen!==e.lastRenderedGen)return;let o=M(e);if(o)o.session.canvas.scope=t.scope,o.session.canvas.refreshing=!1;wn("leftPanel");return}case"contentHeight":{e.contentHeight=t.height,e.contentFragment=t.fragment,Cr(e);return}case"dragOver":{if(t.dragSeq!==ne)return;if(t.cursor)pr=t.dragSeq,fr=Date.now();if(t.gen!==e.lastRenderedGen)return;if(t.preview)e.overlay.setDropIndicator(I(t.preview.referenceRect),t.preview.edge);else e.overlay.setDropIndicator(null);if(t.cursor){let o=rc(e);YC(t.cursor.x*o.scale+o.rect.left,t.cursor.y*o.scale+o.rect.top)}return}case"nativeDragEnter":{if(e.stylebook)return;Pr?.(e);return}case"dragEnd":{e.overlay.setDropIndicator(null),dh(),be.delete(t.dragSeq);return}case"dropResult":{if(t.dragSeq!==ne||t.gen!==e.lastRenderedGen)return;if(t.instruction&&t.targetPath){let o=be.get(t.dragSeq);if(o)ry(M(e),{type:t.instruction},o,t.targetPath)}be.delete(t.dragSeq),e.overlay.setDropIndicator(null),dh();return}case"fileDragOver":{if(e.stylebook)return;Da(e,t.hit,t.preview);return}case"fileDragLeave":{tr(e);return}case"fileDrop":{if(tr(e),e.stylebook)return;Xt?.(M(e),t.files,t.hit,t.preview);return}case"patchError":{e.pendingPatches=Math.max(0,e.pendingPatches-1);let o=z(e.canvasEl)?.surface;if(o)Er?.(o.paneId);return}case"forwardKey":{rs(t.event);return}case"forwardWheel":{os(e,t);return}case"editStart":{if(N&&N!==e)N.editing=!1,N.editingProp=null,N.snapshot=null;if(N=e,t.prop!==void 0&&Ut===Uc(t.path))xe(e,t.path,void 0,t.prop);Ut=null,_a+=1,e.editing=!0,e.editingProp=t.prop??null,e.snapshot=null,e.lastSnapshotSeq=0,Qe?.();return}case"selectionChanged":{if(t.seq<=e.lastSnapshotSeq)return;if(e.lastSnapshotSeq=t.seq,e.snapshot=t,!e.editing)e.editing=!0,N=e;Qe?.();return}case"flushComplete":{let o=ue.get(t.reqId);if(o)ue.delete(t.reqId),Ce.delete(t.reqId),o();return}case"editInput":{let o=M(e);if(o)o.doc.dirty=!0;return}case"editCommit":{let o=()=>yo(M(e),t.path,t.children,t.textContent);if(t.inPlace)ar(e,[t.path],o);else o();return}case"editCommitProp":{let o=()=>bo(M(e),t.path,t.prop,t.value);if(t.inPlace){ar(e,[t.path],o),Kt=Uc(t.path);return}let r=o();if(ja(r,Kt,Uc(t.path)))Fa(e,t.path);Kt=null,Ut=r?Uc(t.path):null;return}case"editMerge":{let o=Co(M(e),t.fromPath,t.intoPath);if(o)xe(e,o.path,o.offset);return}case"editRangeReplace":{let o=Mo(M(e),t.from,t.to,t.between,t.text);if(o)xe(e,o.path,o.offset);return}case"editSplit":{xe(e,So(M(e),t.path,t.before,t.after));return}case"editInsert":{xe(e,To(M(e),t.path,t.cmd,t.commitData));return}case"slashShow":{let{rect:o,scale:r}=rc(e),i=t.rect.x*r+o.left,a=t.rect.y*r+o.top,l={filter:t.filter,onDismiss:()=>e.channel.post({kind:"slashDismissed"}),onSelect:(s)=>e.channel.post({cmd:{...s},kind:"slashSelect"}),rect:{bottom:a+t.rect.height*r,height:t.rect.height*r,left:i,top:a,width:t.rect.width*r}};if(t.showFilter===!0)l.showFilter=!0;Ze?.show(l);return}case"slashNav":{Ze?.nav(t.key);return}case"slashDismiss":{Ze?.dismiss();return}case"previewNavigate":{Sa(t.href,e);return}case"contextMenu":{if(e.stylebook)return;Ue(e);let{rect:o,scale:r}=rc(e);Ye?.show({clientX:t.x*r+o.left,clientY:t.y*r+o.top,path:t.path?[...t.path]:null});return}case"editEnd":{if(!e.editing)return;if(e.editing=!1,e.editingProp=null,e.snapshot=null,N===e)N=null;Qe?.();break}default:break}}function ur(e,t){if(e.lastRenderedGen=t,at(e,e.selectionPaths),Tr(e),Ar(e),cs(e),e.pendingEnterEdit&&t>=e.pendingEnterEdit.minGen){let{offset:o,path:r,prop:i}=e.pendingEnterEdit;if(e.pendingEnterEdit=null,e.tabId!==null&&e.tabId===pe(e.canvasEl)?.id)ns(e,r,o,i)}}function xe(e,t,o,r){let i={minGen:e.lastRenderedGen,path:[...t]};if(o!==void 0)i.offset=o;if(r!==void 0)i.prop=r;e.pendingEnterEdit=i}function ns(e,t,o,r){let i={kind:"enterEdit",path:[...t]};if(o!==void 0)i.offset=o;if(r!==void 0)i.prop=r;e.channel.post(i)}function os(e,t){let{rect:o,scale:r}=rc(e),i=rd(e.canvasEl)?.wrap;if(!i)return;i.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:o.left+t.x*r,clientY:o.top+t.y*r,ctrlKey:t.ctrlKey,deltaX:t.deltaX,deltaY:t.deltaY,metaKey:t.metaKey,shiftKey:t.shiftKey}))}function rs(e){document.dispatchEvent(new KeyboardEvent("keydown",{altKey:e.altKey,bubbles:!0,cancelable:!0,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}))}function is(e,t){if(!t||Eo(t.path,e.selectionPath)){e.overlay.setHover(null);return}e.overlay.setHover(I(t.rect))}var as=4,ee=new Map;function ss(e){let t=ee.get(e);if(t)return ee.delete(e),ee.set(e,t),t;let o=new Map;ee.set(e,o);for(let r of ee.keys()){if(ee.size<=as)break;ee.delete(r)}return o}function ls(e,t,o,r,i,a=null){let l=ss(e),s=r?.id??null,c=l.get(t);if(c&&c.tabId===o&&c.viewTabId===s&&c.mode===a)return c.payload;let d=Ea(i),m=HC(rn,async()=>{Jr.renderPreparations+=1;let v=await fo(t,r,a),y=F(v.renderDoc),b=F(t),E=o?g.tabs.get(o)??null:null,D=zi(E?.doc.sourceFormat)?.studio?.elements,O=D?Xo(D):void 0,H={assets:v.assets,doc:y,docBase:v.docBase??`${gh()}/`,mapperCtx:v.mapperCtx,mode:v.mapperCtx.canvasMode,shadowDoc:b,siteStyle:v.siteStyle};if(O)H.editableTags=O;if(d)H.allowAutoRequests=!0;return H});return l.set(t,{mode:a,payload:m,tabId:o,viewTabId:s}),m}async function zL(e,t,o,r,i=null,a=pe(o),l=null,s=null){let c=Qt(o);c.pendingTabIds.set(e,i),c.stylebook=null,c.iframe.style.width=r?`${r}px`:"100%";let m={...await ls(e,t,i,a,lt(o),l),colorScheme:Rr(a),gen:e,kind:"render",locale:Dr(a),popoverOpen:a?.session.ui.openPopover??null,dialogOpen:a?.session.ui.openDialog??null};if(s)m.diffMarks=s;c.popoverOpen=m.popoverOpen??null,c.dialogOpen=m.dialogOpen??null,Yt(c,m.mode==="preview"),Or(c,m)}function Or(e,t){if(Jr.hostRenderPosts+=1,e.ready){it(e),e.channel.post(t);return}let o=e.pending;if(o?.kind==="render"&&o.gen>t.gen){e.pendingTabIds.delete(t.gen);return}e.pending=t}function UL(e,t,o,r){let i=Qt(o);i.pendingTabIds.set(e,null),i.stylebook={pathToTag:t.pathToTag,tagToCardPath:t.tagToCardPath},Yt(i,!1),i.pendingEnterEdit=null,i.iframe.style.width=r?`${r}px`:"100%";let a=F(t.doc),l=F(t.doc),s={assets:null,colorScheme:Rr(pe(o)),locale:Dr(pe(o)),doc:a,docBase:`${gh()}/`,gen:e,kind:"render",mapperCtx:{arrayPaths:[],canvasMode:"stylebook",layoutWrapped:!1,pageContentOffset:null,pageContentPrefix:null},mode:"stylebook",shadowDoc:l,siteStyle:null};Or(i,s)}function Rr(e){let t=e?.session.ui.previewColorScheme;return t==="light"||t==="dark"?t:null}function qL(e,t){for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(t&&!t.contains(o.iframe))continue;if(o.ready)o.channel.post({kind:"setColorScheme",scheme:e})}}function kr(e){return e===null?null:{dir:Sy(e),locale:e}}function Dr(e){return kr(e?Wp(e.session.ui.previewLocale,e.documentPath):null)}function JL(e,t){let o=Sy(e);for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(t&&!t.contains(r.iframe))continue;if(r.ready)r.channel.post({dir:o,kind:"setLocale",locale:e});else if(r.pending?.kind==="render")r.pending={...r.pending,locale:kr(e)}}}function KL(e,t){let o=F(e),r=0;for(let i of C){if(!i.iframe.isConnected){C.delete(i);continue}if(i.ready)i.channel.post({base:t,doc:o,kind:"redefineElement"}),r+=1}return r}function GL(){let e=x?.projectConfig;if(!e)return;let t=F(e.style??null),o=F(e.$media??{});for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&!r.stylebook)r.channel.post({kind:"siteStyleUpdate",media:o,siteStyle:t})}}function Rx(e){let t=0,o=F(e);for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&r.stylebook)r.channel.post({gen:r.lastRenderedGen,kind:"styleUpdate",style:o}),t+=1,at(r,r.selectionPaths)}return t}var et=null;function Hr(e,t){if(!e?.stylebook||!e.ready)return!1;let o=e.stylebook.tagToCardPath.get(t);if(!o)return!1;return e.measureSeq+=1,e.panReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o]],reqId:e.panReqId}),!0}function YL(e){et=Hr(tn(),e)?null:e}function cs(e){let t=et;if(t===null||!e.stylebook)return;if(u.stylebook.selection!==t){et=null;return}if(e===tn()&&Hr(e,t))et=null}function oc(){let e=N;if(!e||!e.iframe.isConnected)return{editing:!1,editingProp:null,snapshot:null};return{editing:e.editing,editingProp:e.editingProp,snapshot:e.snapshot}}var en=null;function ZL(e,t){en=e,t?.(()=>dr()),dr()}function dr(){let e=en?.();if(!e)return;for(let t of C){if(!t.iframe.isConnected){C.delete(t);continue}if(t.ready)t.channel.post({chords:e.chords,kind:"keymap",mac:e.mac})}}function hh(e){let t=N;if(!t||!t.ready)return;t.channel.post({intent:e,kind:"applyFormat"})}function XL(){let e=N;if(!e||!e.ready)return;e.channel.post({kind:"openSlash"})}function Ix(){let e=N;if(e?.editing&&e.ready&&e.iframe.isConnected)e.channel.post({kind:"endEdit"})}function tn(){let e=mn();return e?ZC(e.canvas):null}function e1(){let e=N,t=e??tn();if(!t)return null;let{rect:o,scale:r}=rc(t);if(t.lastSelectionRect)return{height:t.lastSelectionRect.height*r,left:t.lastSelectionRect.left*r+o.left,top:t.lastSelectionRect.top*r+o.top,width:t.lastSelectionRect.width*r};let i=t===e?t.snapshot?.rect:null;if(i)return{height:i.height*r,left:i.x*r+o.left,top:i.y*r+o.top,width:i.width*r};return null}
|
|
2
|
+
export{wo,bt,Wo,EC,La,qr,pl,tA,Zb,Xb,xo,Wc,fl,rh,TC,nA,Qb,iA,$C,LC,RC,IC,rA,NC,oh,ey,ty,pi,Vm,dL,vx,oA,nc,ic,sh,sA,DC,uL,zc,ah,aA,ny,Mp,OC,AC,lA,PC,MC,FC,hL,cA,dA,Jr,wx,jC,HC,Hi,lh,pL,iy,fL,uA,hA,Fp,BC,pA,fA,Uc,VC,Wm,mA,xx,gA,_x,bA,Sx,jp,zo,yA,zm,vA,wA,WC,xA,zC,_A,UC,mL,gL,qC,Um,Hp,SA,CA,Cx,Zs,ch,Bp,kA,EA,JC,bL,qm,KC,TA,GC,yL,$A,vL,wL,xL,LA,kx,_L,YC,dh,ml,Ex,Vp,Tx,uh,RA,IA,NA,DA,OA,ry,SL,CL,kL,EL,ZC,oy,sy,XC,rc,TL,$L,LL,ay,kF,UF,RL,qc,$x,Lx,IL,NL,DL,OL,AL,PL,ML,FL,jL,HL,BL,VL,QC,WL,ly,zL,UL,qL,JL,KL,GL,Rx,YL,oc,ZL,hh,XL,Ix,e1};
|
|
3
|
+
|
|
4
|
+
//# debugId=904C4476AA8B26ED64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-m25ry0mf.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var s=new Set(["project.schema.json","document.schema.json"]);function _I(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function zM(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function SI(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"jxn":return"jxn";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
|
|
2
|
+
export{_I,zM,SI};
|
|
3
|
+
|
|
4
|
+
//# debugId=6038961639F6DDAB64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-mcbwmkyh.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{IM,NM}from"./studio-52mzbxqm.js";import{p,we}from"./studio-1b79rpcb.js";import{yh,pP,Jp}from"./studio-44drsmhw.js";import{ln,Ry,Iy,h}from"./studio-ybkd5w8k.js";import{x}from"./studio-anc8067x.js";function gh(){let t=we()?p().canvasUrl:void 0;if(t)return new URL(t,location.href).origin;return location.origin}function vy(){let t=we()?p().canvasUrl:void 0;if(!t)return null;let e=new URL(t,location.href);return e.origin===location.origin?e.searchParams.get("rpcToken"):null}function ac(t){let e=gh(),n=we()?p().documentBaseUrl:void 0;if(n){let o=n.endsWith("/")?n:`${n}/`;return new URL(o,`${e}/`).href}let r=t||"";return`${e}/${r?`${r}/`:""}`}function h1(t){if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http")||t.startsWith("views://"))return t;let e=gh();if((e.startsWith("http:")||e.startsWith("https:"))&&e!==location.origin)return`${e}/${t.replace(/^\.?\//,"")}`;return t}function CR(){return ln(x?.projectConfig??{}).i18n?.locales??[]}function wy(t,e){let n=e?.space??"site",r=Ry(t,x?.projectConfig?.content,CR());if(n==="site"&&!r&&!pP())return null;let o={documentDir:NM(t??""),lanes:IM,mounts:r?[r]:[],space:n};if(e?.fileBaseUrl!==void 0)o.fileBaseUrl=e.fileBaseUrl;return o}function ed(t){return xy(t,h.value?.documentPath)}function xy(t,e){if(!t)return t;let n=wy(e,bh()),r=n&&{...n,revisions:Jp(),versions:yh()};return h1(Iy(t,r)??t)}function bh(){let t={fileBaseUrl:ac(x?.projectRoot)};if(we())t.space=p().assetSpace;return t}
|
|
2
|
+
export{gh,vy,ac,h1,CR,wy,ed,xy,bh};
|
|
3
|
+
|
|
4
|
+
//# debugId=EFC3D83106DCAD2464756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-meajkr51.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{n,f}from"./studio-0z8kp4xk.js";var d=new Set([" ","\t",`
|
|
2
|
+
`,"\r"]);function g(e){let r=[],o=[],s=null,t=0,a=()=>o.at(-1)?.path??"",l=()=>s===null?a():y(a(),s),k=()=>{t+=1;let i="";while(t<e.length){let p=e[t];if(p==="\\"){let c=e[t+1]??"";if(c==="u")i+=String.fromCodePoint(Number.parseInt(e.slice(t+2,t+6),16)),t+=6;else i+=j.get(c)??c,t+=2;continue}if(p==='"')return t+=1,i;i+=p,t+=1}return i};while(t<e.length){let i=e[t];if(d.has(i)||i===","||i===":"){t+=1;continue}if(i==="{"||i==="["){o.push(i==="{"?{keys:new Set,kind:"object",path:l()}:{kind:"array",path:l()}),s=null,t+=1;continue}if(i==="}"||i==="]"){o.pop(),s=null,t+=1;continue}if(i==='"'){let c=k(),u=o.at(-1);if(u?.kind==="object"&&w(e,t)===":"){if(u.keys.has(c))r.push({detail:c,kind:"duplicate-key",path:u.path});u.keys.add(c),s=c}else s=null;continue}if(i==="-"||i>="0"&&i<="9"){let c=t;while(t<e.length&&/[\d+.eE-]/.test(e[t]))t+=1;let u=e.slice(c,t);if(!S(u))r.push({detail:u,kind:"unsafe-number",path:l()});s=null;continue}let p=t;while(t<e.length&&/[A-Za-z]/.test(e[t]))t+=1;if(t===p)t+=1;s=null}return r}var j=new Map([["b","\b"],["f","\f"],["n",`
|
|
3
|
+
`],["r","\r"],["t","\t"]]);function w(e,r){let o=r;while(o<e.length&&d.has(e[o]))o+=1;return e[o]??""}function y(e,r){return e===""?r:`${e}.${r}`}function S(e){if(/[.eE]/.test(e))return!0;let r=Number(e);if(!Number.isFinite(r))return!1;return String(r)===e.replace(/^\+/,"")}function h(e){let r=e.path===""?"the document root":`"${e.path}"`;return e.kind==="duplicate-key"?`duplicate key "${e.detail}" in ${r} — JSON.parse keeps the last one and `+"silently discards the first (RFC 7493 §2.3)":`number ${e.detail} in ${r} cannot be represented exactly and will change when `+"the document is written back (RFC 7493 §2.2)"}function Z(e){return e instanceof Error?e.message:String(e)}var b=/[^\p{ASCII}]/u;function m(e){if(n(e))return b.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((r)=>m(r));if(f(e))return H_(e);return e}function H_(e){let r={};for(let[o,s]of Object.entries(e))r[b.test(o)?o.normalize("NFC"):o]=m(s);return r}function J(e,r,o){let s;try{s=JSON.parse(e)}catch(a){throw Error(`Failed to parse ${o} at ${r}: ${Z(a)}`,{cause:a})}if(!f(s))throw Error(`Invalid ${o} at ${r}: expected a JSON object`);let t=g(e);if(t.length>0){let a=t.map((l)=>h(l)).join("; ");throw Error(`Invalid ${o} at ${r}: ${a}`)}return H_(s)}function qF(e,r){return J(e,r,"Jx document")}function JF(e,r){return J(e,r,"project config")}export{Z,H_,qF,JF};
|
|
4
|
+
|
|
5
|
+
//# debugId=15B07C041C934EAE64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=studio-mkjrjpr2.js.map
|