@jxsuite/studio 5.6.0 → 6.0.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.
Files changed (176) hide show
  1. package/dist/chunks/{2020-zvax9fmb.js → 2020-cs2sb9t1.js} +3 -3
  2. package/dist/chunks/adapter-y5gdq19c.js +4 -0
  3. package/dist/chunks/{cf-account-picker-zfycs4k2.js → cf-account-picker-bb2yq946.js} +3 -3
  4. package/dist/chunks/cf-settings-20dznc3j.js +4 -0
  5. package/dist/chunks/components-q037dya7.js +4 -0
  6. package/dist/chunks/content-source-t0q184js.js +4 -0
  7. package/dist/chunks/{convert-to-repeater-x19jr6c7.js → convert-to-repeater-vqkt7s3s.js} +3 -3
  8. package/dist/chunks/editor-j5sq149q.js +4 -0
  9. package/dist/chunks/entry-commands-fxzgcc4k.js +4 -0
  10. package/dist/chunks/{extension-sections-y90sa0n4.js → extension-sections-8beq9ac3.js} +3 -3
  11. package/dist/chunks/file-ops-2n77759h.js +4 -0
  12. package/dist/chunks/files-fjy7zpxt.js +4 -0
  13. package/dist/chunks/format-host-wj3mf3n8.js +4 -0
  14. package/dist/chunks/fs-events-7kcgn4e9.js +4 -0
  15. package/dist/chunks/git-panel-7z2mpt2d.js +4 -0
  16. package/dist/chunks/{grid-view-d9mybhn0.js → grid-view-ca10def6.js} +10 -10
  17. package/dist/chunks/iframe-host-a0zjd6xp.js +4 -0
  18. package/dist/chunks/{index-vnwy9d44.js → index-9ydfe04y.js} +3 -3
  19. package/dist/chunks/index-m0x5ztax.js +4 -0
  20. package/dist/chunks/{javascript-f0nrbdjb.js → javascript-d9pqgc2p.js} +2 -2
  21. package/dist/chunks/{jsonMode-nfa90dtf.js → jsonMode-800yvbem.js} +4 -4
  22. package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
  23. package/dist/chunks/layers-p677nrh5.js +4 -0
  24. package/dist/chunks/layers-panel-y4w1dq90.js +4 -0
  25. package/dist/chunks/lit-html-cfn61dn7.js +4 -0
  26. package/dist/chunks/media-picker-xg7yjpz9.js +4 -0
  27. package/dist/chunks/menu-fpekzj6w.js +4 -0
  28. package/dist/chunks/{monaco-binding-antn79jf.js → monaco-binding-62dtmgbf.js} +3 -3
  29. package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
  30. package/dist/chunks/{monaco-setup-k8s40vwg.js → monaco-setup-tj13ndtm.js} +3 -3
  31. package/dist/chunks/notify-ahs57a2z.js +4 -0
  32. package/dist/chunks/platform-v9xyfkbx.js +4 -0
  33. package/dist/chunks/publish-panel-xtbfgg2r.js +4 -0
  34. package/dist/chunks/quick-search-d3a6m7j3.js +4 -0
  35. package/dist/chunks/references-99ws0b0m.js +4 -0
  36. package/dist/chunks/right-panel-31vbk5xp.js +4 -0
  37. package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
  38. package/dist/chunks/{studio-y17505ge.js → studio-01kbbqg3.js} +207 -207
  39. package/dist/chunks/{studio-gxna6yta.js → studio-01qza1n3.js} +4 -4
  40. package/dist/chunks/{studio-n2e133d6.js → studio-03wwfvyt.js} +4 -4
  41. package/dist/chunks/{studio-09n3fyy0.js → studio-0bbxhhce.js} +4 -4
  42. package/dist/chunks/studio-1a99w39s.js +5 -0
  43. package/dist/chunks/studio-1q6amtph.js +5 -0
  44. package/dist/chunks/{studio-eegyf5vg.js → studio-1wvfxkyy.js} +4 -4
  45. package/dist/chunks/{studio-z47mm077.js → studio-3ck2a5c4.js} +6 -6
  46. package/dist/chunks/{studio-ymsjnvp9.js → studio-4fde4a0x.js} +4 -4
  47. package/dist/chunks/{studio-je15p5v8.js → studio-4jj9gme2.js} +5 -5
  48. package/dist/chunks/{studio-w8w9frjy.js → studio-4m50vh74.js} +12 -12
  49. package/dist/chunks/{studio-891t1tv9.js → studio-4r0sjtx8.js} +4 -4
  50. package/dist/chunks/{studio-6exg5z4x.js → studio-4xppwncr.js} +3 -3
  51. package/dist/chunks/{studio-011em5cf.js → studio-5d7wfmnp.js} +4 -4
  52. package/dist/chunks/{studio-zkkdbbvd.js → studio-5e9zsamh.js} +6 -6
  53. package/dist/chunks/{studio-pvj970st.js → studio-5gs9th4b.js} +4 -4
  54. package/dist/chunks/{studio-dtmdjmqb.js → studio-5vy2wfm5.js} +4 -4
  55. package/dist/chunks/{studio-654fxcr0.js → studio-7pgy3xaf.js} +4 -4
  56. package/dist/chunks/{studio-z1vdxq0e.js → studio-7qvs7v0m.js} +4 -4
  57. package/dist/chunks/studio-84rtc120.js +5 -0
  58. package/dist/chunks/{studio-ks0ecgjx.js → studio-8xcwewjq.js} +4 -4
  59. package/dist/chunks/{studio-sadckcpp.js → studio-aekhcdzw.js} +5 -5
  60. package/dist/chunks/{studio-mf41717j.js → studio-aje966s9.js} +4 -4
  61. package/dist/chunks/studio-aqmph6k4.js +5 -0
  62. package/dist/chunks/{studio-28pz4s1k.js → studio-bftp4n4b.js} +4 -4
  63. package/dist/chunks/{studio-tzs6njnb.js → studio-c6zdm25z.js} +7 -7
  64. package/dist/chunks/{studio-sgzss898.js → studio-capk0583.js} +7 -7
  65. package/dist/chunks/{studio-805fwp9k.js → studio-cbr9czkn.js} +4 -4
  66. package/dist/chunks/{studio-1pxvgx1t.js → studio-chdmwwzw.js} +4 -4
  67. package/dist/chunks/{studio-dknr8m7b.js → studio-cp1gbff9.js} +7 -7
  68. package/dist/chunks/{studio-ft8pfpp0.js → studio-cqmtbg2p.js} +4 -4
  69. package/dist/chunks/studio-e47215hh.js +5 -0
  70. package/dist/chunks/{studio-9n2j9nqk.js → studio-edbtvcd1.js} +4 -4
  71. package/dist/chunks/{studio-mm8x32gg.js → studio-evwgp1ym.js} +4 -4
  72. package/dist/chunks/{studio-02y9cb4h.js → studio-fbx6twps.js} +5 -5
  73. package/dist/chunks/{studio-0nm2skex.js → studio-fqq890ap.js} +3 -3
  74. package/dist/chunks/studio-fthwn4kf.js +5 -0
  75. package/dist/chunks/{studio-s85vah66.js → studio-g8dsj3d2.js} +5 -5
  76. package/dist/chunks/{studio-0c3fpdqj.js → studio-ge5fqjth.js} +5 -5
  77. package/dist/chunks/{studio-ebt49j3c.js → studio-gjknvzam.js} +5 -5
  78. package/dist/chunks/{studio-zkvyd3ev.js → studio-gp02nqnw.js} +4 -4
  79. package/dist/chunks/{studio-5fc0728f.js → studio-hjbg8d5y.js} +7 -7
  80. package/dist/chunks/{studio-d007j0z3.js → studio-hnvnfbdv.js} +6 -6
  81. package/dist/chunks/{studio-b5rxwkj2.js → studio-mk00zd5d.js} +4 -4
  82. package/dist/chunks/{studio-36s6qjgq.js → studio-n78gjfy8.js} +4 -4
  83. package/dist/chunks/studio-nbxqcgvf.js +5 -0
  84. package/dist/chunks/{studio-y164brht.js → studio-pwqfmt4p.js} +4 -4
  85. package/dist/chunks/studio-qa73881a.js +5 -0
  86. package/dist/chunks/{studio-6zyt56ek.js → studio-r3kaka4d.js} +4 -4
  87. package/dist/chunks/{studio-njmg0e73.js → studio-rmn2dz59.js} +5 -5
  88. package/dist/chunks/{studio-wr0pq67n.js → studio-rr4xkv81.js} +4 -4
  89. package/dist/chunks/{studio-tj28pxa1.js → studio-semd1s8s.js} +4 -4
  90. package/dist/chunks/{studio-7w04zw8h.js → studio-st75kn99.js} +5 -5
  91. package/dist/chunks/{studio-dmymvk2j.js → studio-sxc0zvpt.js} +3 -3
  92. package/dist/chunks/studio-t1eedsyx.js +4 -0
  93. package/dist/chunks/{studio-9tkaykt5.js → studio-tmeq6mjb.js} +4 -4
  94. package/dist/chunks/{studio-153mwkyq.js → studio-tp642n5g.js} +4 -4
  95. package/dist/chunks/{studio-t0v47dpc.js → studio-tzegmy4w.js} +4 -4
  96. package/dist/chunks/studio-vavmwshr.js +5 -0
  97. package/dist/chunks/studio-x5g1xk77.js +5 -0
  98. package/dist/chunks/studio-x92tgnee.js +64 -0
  99. package/dist/chunks/{studio-4yztve2t.js → studio-xg1942as.js} +4 -4
  100. package/dist/chunks/{studio-k9pwvmz8.js → studio-xkfs0dp2.js} +4 -4
  101. package/dist/chunks/{studio-6k1eswp9.js → studio-y7jehjrp.js} +4 -4
  102. package/dist/chunks/{studio-81twpmzj.js → studio-yr04mv2j.js} +4 -4
  103. package/dist/chunks/{studio-gj4j9e7k.js → studio-zd4kayn2.js} +4 -4
  104. package/dist/chunks/{studio-jsr14n1s.js → studio-zev8ssp1.js} +4 -4
  105. package/dist/chunks/{studio-r7yeeqc4.js → studio-ztvcxm3w.js} +4 -4
  106. package/dist/chunks/{tsMode-eq26t9gs.js → tsMode-k9s9fcag.js} +4 -4
  107. package/dist/chunks/workspace-5vmgsagj.js +4 -0
  108. package/dist/chunks/{ws-client-3gxqp06s.js → ws-client-0ja08haa.js} +3 -3
  109. package/dist/iframe-entry.js +3 -3
  110. package/dist/manifest.json +62 -62
  111. package/dist/studio.js +95 -95
  112. package/package.json +12 -12
  113. package/src/canvas/stage-scrollbar.ts +7 -7
  114. package/src/files/file-ops.ts +5 -8
  115. package/src/panels/jump-bar.ts +132 -158
  116. package/src/panels/pane-context.ts +8 -8
  117. package/src/panels/pane-grid.ts +18 -26
  118. package/src/panels/style-panel.ts +2 -2
  119. package/src/services/context-manager.ts +41 -70
  120. package/src/services/document-assistant.ts +12 -3
  121. package/src/services/harness/chat-reducer.ts +115 -0
  122. package/src/services/harness/turn-hooks.ts +50 -0
  123. package/src/services/tool-executor.ts +69 -288
  124. package/src/services/tool-outcomes.ts +12 -10
  125. package/src/studio.ts +2 -5
  126. package/src/surfaces/block-action-bar.json +6 -1
  127. package/src/surfaces/jump-bar.json +9 -12
  128. package/src/surfaces/jump-bar.ts +15 -16
  129. package/src/surfaces/pane-context.json +2 -2
  130. package/src/surfaces/pane-grid.json +8 -25
  131. package/src/surfaces/pane-grid.ts +7 -8
  132. package/src/surfaces/statusbar.json +71 -3
  133. package/src/surfaces/statusbar.ts +66 -139
  134. package/src/surfaces/style-panel.json +3 -3
  135. package/src/surfaces/style-panel.ts +11 -1
  136. package/src/ui/schema-form.ts +6 -2
  137. package/dist/chunks/adapter-6zhjbpmd.js +0 -4
  138. package/dist/chunks/cf-settings-fpa485q3.js +0 -4
  139. package/dist/chunks/components-b0vh4sq8.js +0 -4
  140. package/dist/chunks/content-source-z5t0d0h9.js +0 -4
  141. package/dist/chunks/editor-7e23n4a8.js +0 -4
  142. package/dist/chunks/entry-commands-5cm6aba2.js +0 -4
  143. package/dist/chunks/file-ops-hv7gf757.js +0 -4
  144. package/dist/chunks/files-kb0epdxf.js +0 -4
  145. package/dist/chunks/format-host-eg1wy2bp.js +0 -4
  146. package/dist/chunks/fs-events-ky3vxfmh.js +0 -4
  147. package/dist/chunks/git-panel-yyg3bzp2.js +0 -4
  148. package/dist/chunks/iframe-host-9wdf0hes.js +0 -4
  149. package/dist/chunks/index-2tf0m2ne.js +0 -4
  150. package/dist/chunks/jx-validate-7w11db9v.js +0 -4
  151. package/dist/chunks/layers-7zasrpse.js +0 -4
  152. package/dist/chunks/layers-panel-9nzc4fdq.js +0 -4
  153. package/dist/chunks/lit-html-5qr7nbng.js +0 -4
  154. package/dist/chunks/media-picker-maevn9d4.js +0 -4
  155. package/dist/chunks/menu-wq6q0v3y.js +0 -4
  156. package/dist/chunks/monaco-buffer-9ry2rn5x.js +0 -4
  157. package/dist/chunks/notify-g91gjd6w.js +0 -4
  158. package/dist/chunks/platform-jdwjp2vt.js +0 -4
  159. package/dist/chunks/publish-panel-8yym447p.js +0 -4
  160. package/dist/chunks/quick-search-9bzm9kh3.js +0 -4
  161. package/dist/chunks/references-znssfqvq.js +0 -4
  162. package/dist/chunks/right-panel-czbzktm8.js +0 -4
  163. package/dist/chunks/section-registry-0rtq73qs.js +0 -4
  164. package/dist/chunks/studio-0mm38y62.js +0 -5
  165. package/dist/chunks/studio-27tc8q0h.js +0 -5
  166. package/dist/chunks/studio-7djymzt2.js +0 -5
  167. package/dist/chunks/studio-ant1zbp3.js +0 -5
  168. package/dist/chunks/studio-b29h7g7s.js +0 -5
  169. package/dist/chunks/studio-eb5sty2k.js +0 -5
  170. package/dist/chunks/studio-frv7vjhw.js +0 -5
  171. package/dist/chunks/studio-mb8jhtr4.js +0 -64
  172. package/dist/chunks/studio-nvykrgbj.js +0 -4
  173. package/dist/chunks/studio-nw4q9sdn.js +0 -5
  174. package/dist/chunks/studio-p6avneaq.js +0 -5
  175. package/dist/chunks/studio-vz7b43ng.js +0 -5
  176. package/dist/chunks/workspace-emt8454d.js +0 -4
@@ -1,4 +0,0 @@
1
- import{Df,D_,A_,v$,N_}from"./studio-vz7b43ng.js";import"./studio-tj28pxa1.js";import"./studio-6k1eswp9.js";import"./studio-0nm2skex.js";export{N_ as clearCfConnection,A_ as getCfAccountId,Df as getCfToken,v$ as setCfAccountId,D_ as setCfToken};
2
-
3
- //# debugId=88A9B73C42F1EA0C64756E2164756E21
4
- //# sourceMappingURL=cf-settings-fpa485q3.js.map
@@ -1,4 +0,0 @@
1
- import{at,Dl,FC,fm,xc}from"./studio-y164brht.js";import"./studio-6k1eswp9.js";export{fm as buildComponentInstance,at as componentRegistry,xc as computeRelativePath,Dl as loadComponentRegistry,FC as noteComponentSaved};
2
-
3
- //# debugId=1441451654480D2F64756E2164756E21
4
- //# sourceMappingURL=components-b0vh4sq8.js.map
@@ -1,4 +0,0 @@
1
- import{vb,Pw,I1,R1,$1,D1}from"./studio-4yztve2t.js";import"./studio-eb5sty2k.js";import"./studio-b5rxwkj2.js";import"./studio-02y9cb4h.js";import"./studio-sgzss898.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{Pw as collectionDirs,vb as collectionInfo,$1 as createCollectionSource,D1 as createPagesSource,I1 as listCollectionEntryIds,R1 as reloadDraftAwareGrids};
2
-
3
- //# debugId=43775DBD531D604D64756E2164756E21
4
- //# sourceMappingURL=content-source-z5t0d0h9.js.map
@@ -1,4 +0,0 @@
1
- import{c$,zh,d$,u$,h$,mu,p$,f$,As,Fy,sc,m$,Tn,pe}from"./studio-y17505ge.js";export{c$ as CancellationTokenSource,zh as Emitter,d$ as KeyCode,u$ as KeyMod,As as MarkerSeverity,Fy as MarkerTag,h$ as Position,mu as Range,p$ as Selection,f$ as SelectionDirection,m$ as Token,sc as Uri,Tn as editor,pe as languages};
2
-
3
- //# debugId=002FF24FBA668ACE64756E2164756E21
4
- //# sourceMappingURL=editor-7e23n4a8.js.map
@@ -1,4 +0,0 @@
1
- import{kw,y1}from"./studio-805fwp9k.js";import"./studio-frv7vjhw.js";import"./studio-jsr14n1s.js";import"./studio-4yztve2t.js";import"./studio-eb5sty2k.js";import"./studio-b5rxwkj2.js";import"./studio-02y9cb4h.js";import"./studio-sgzss898.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";import"./studio-k1wvtp03.js";export{kw as createEntry,y1 as registerContentCommands};
2
-
3
- //# debugId=4BCFCCF2C23FAD5564756E2164756E21
4
- //# sourceMappingURL=entry-commands-5cm6aba2.js.map
@@ -1,4 +0,0 @@
1
- import{Er,N1,O1,op,M1,Xf,Qf}from"./studio-eb5sty2k.js";import"./studio-b5rxwkj2.js";import"./studio-02y9cb4h.js";import"./studio-sgzss898.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{Xf as confirmFileDelete,M1 as exportFile,N1 as parseCollabSource,Er as parseSourceForPath,Qf as renamePromptMessage,op as saveFile,O1 as setDocumentSavedListener};
2
-
3
- //# debugId=E9E206B0F6429B7964756E2164756E21
4
- //# sourceMappingURL=file-ops-hv7gf757.js.map
@@ -1,4 +0,0 @@
1
- import{Lo,X_,Q_,e1,pw,Bf,t1,n1,fw,hE,a$,Io,mw,i1,o1,ep,r1}from"./studio-d007j0z3.js";import"./studio-dtmdjmqb.js";import"./studio-0c3fpdqj.js";import"./studio-0mm38y62.js";import"./studio-frv7vjhw.js";import"./studio-z47mm077.js";import"./studio-4yztve2t.js";import"./studio-eb5sty2k.js";import"./studio-b5rxwkj2.js";import"./studio-02y9cb4h.js";import"./studio-sgzss898.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{fw as createFileIn,pw as findHomePage,e1 as initProjectRepo,Lo as loadDirectory,X_ as loadProject,hE as notifyMoveOutcome,mw as openFileInPane,Io as openFileInTab,Bf as openLastSessionOrHome,Q_ as openProject,n1 as registerFileTreeDnD,r1 as registerFilesPanel,i1 as reloadCleanTab,ep as reloadFileInTab,o1 as reloadTabsIfChanged,t1 as renderFilesTemplate,a$ as settleRename};
2
-
3
- //# debugId=E31991B732E0B99E64756E2164756E21
4
- //# sourceMappingURL=files-kb0epdxf.js.map
@@ -1,4 +0,0 @@
1
- import{qt,Od,Md,Nm,Tv,Ga,Lp,Vs,wi,Ip,Zt,Ka,$r,hS,Us,pS}from"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";export{$r as defaultContentFormat,Ka as documentExtensions,Vs as formatByExtension,wi as formatByName,Zt as formatForPath,hS as formatParse,Us as formatSerialize,Tv as getExtensionCatalog,Nm as getExtensions,Lp as getFormats,Md as loadExtensions,qt as loadFormats,Ip as noFormatError,Ga as refreshExtensionUi,Od as refreshFormats,pS as splitFormatDocument};
2
-
3
- //# debugId=4B160BB49CD43B9164756E2164756E21
4
- //# sourceMappingURL=format-host-eg1wy2bp.js.map
@@ -1,4 +0,0 @@
1
- import{Ms,mc,P1}from"./studio-b5rxwkj2.js";import"./studio-81twpmzj.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{mc as isRecentLocal,Ms as markLocalMutation,P1 as startFsSync};
2
-
3
- //# debugId=E7EA0AE10FF9165F64756E2164756E21
4
- //# sourceMappingURL=fs-events-ky3vxfmh.js.map
@@ -1,4 +0,0 @@
1
- import{dc,l1,ww,xw,c1,d1,u1,Wf,h1}from"./studio-dtmdjmqb.js";import"./studio-0c3fpdqj.js";import"./studio-0mm38y62.js";import"./studio-sgzss898.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{Wf as cleanupGitPanel,ww as cloneRepository,c1 as loadDiffForLens,l1 as noteFileSaved,xw as platformSupportsClone,dc as refreshGitStatus,h1 as registerGitPanel,u1 as registerSourceControlCommands,d1 as renderGitPanel};
2
-
3
- //# debugId=54EAFCB3E8EA873164756E2164756E21
4
- //# sourceMappingURL=git-panel-yyg3bzp2.js.map
@@ -1,4 +0,0 @@
1
- import{oC,rC,sC,aC,lC,cm,dm,fx,za,cC,dC,um,l$,C$,uC,Rl,zb,Wb,hC,pC,fC,mC,gC,bC,vC,yC,wC,xC,_C,CC,mx,SC,hm,kC,EC,TC,LC,IC,RC,Vb,$C,Wa,DC,Cd,AC,Ub,gx}from"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{uC as adoptCanvasPreviewMode,rC as allowAutoRequestsOnNextRender,dm as beginDragSession,cC as canvasIdleBlockers,dC as canvasPointAt,Wb as clearDropIndicator,Ub as commitActiveEditSession,fx as currentDragSession,SC as dragHostTab,zb as endDragSession,aC as flushCanvasEdits,gx as getEditBarAnchorRect,Wa as getEditSnapshot,za as hostDragGeometry,lC as hostForCanvas,vC as isCaretActive,cm as liveDragHostAt,C$ as measureInCanvas,kC as mountIframeCanvas,EC as mountStylebookCanvas,$C as panToStylebookTag,Cd as postApplyFormat,TC as postColorSchemeToLiveHosts,CC as postDialogOpen,Rl as postDragMessage,LC as postLocaleToLiveHosts,AC as postOpenSlash,mx as postPatchToHosts,_C as postPopoverOpen,IC as postRedefineElementToLiveHosts,RC as postSiteStyleToLiveHosts,Vb as postStyleUpdateToStylebookHosts,hm as releaseCanvasHosts,sC as requestCanvasEval,um as revealCanvasPath,l$ as revealCanvasPathIn,oC as sawIframeDragOver,gC as setCanvasContextMenuHandler,wC as setCanvasPointerDownHandler,mC as setCanvasSlashHandler,fC as setFileDropHandler,xC as setIframePatchEscalation,pC as setInsertZoneClickHandler,DC as setKeymapSource,hC as setNativeDragEnterHandler,bC as setStylebookHitHandler,yC as setToolbarRefresh};
2
-
3
- //# debugId=791CF41BBBD9938464756E2164756E21
4
- //# sourceMappingURL=iframe-host-9wdf0hes.js.map
@@ -1,4 +0,0 @@
1
- import{ck,dk,uk,hk,pk,Xc,fk,Sf,mk,Wh,gk,Qc,WR,Hy,g_,VR,UR,qR,GR,ed,KR,JR,YR,b_,v_,ZR,XR,QR,e$,y_,t$}from"./studio-6exg5z4x.js";import{ac,By,kf,n$,wk,xk,_k,Ck,Lf,x_,__}from"./studio-tzs6njnb.js";import{ls,w$}from"./studio-t0v47dpc.js";import{Ae,Nd,Ic,Dm}from"./studio-mm8x32gg.js";export{pk as COLLAB_SCHEMA_VERSION,ed as CollabPathError,Lf as EnvelopeError,xk as FRAME_AWARENESS,Ck as FRAME_CONTROL,_k as FRAME_DOC_CLOSE,wk as FRAME_DOC_SYNC,dk as FRONTMATTER_KEY,UR as LOCAL_ORIGIN,ck as META_KEY,qR as MIRROR_ORIGIN,y_ as PRESENCE_PALETTE,GR as SEED_ORIGIN,hk as SOURCE_KEY,uk as STRUCTURE_KEY,n$ as UndoManager,ac as YDoc,ZR as acquireSourceCanonical,Dm as applyDocOpToDoc,KR as applyDocOpsToY,b_ as canonicalOf,v_ as canonicalRevOf,Ic as childArray,Ae as cloneValue,t$ as colorForKey,kf as createAbsolutePositionFromRelativePosition,By as createRelativePositionFromTypeIndex,__ as decodeFrame,ls as deepEqual,w$ as diffDocs,x_ as encodeFrame,fk as frontmatterMap,Nd as getNodeAtPath,e$ as isSourceReconciler,Xc as metaMap,QR as otherSourceEditors,XR as releaseSourceCanonical,YR as replaceYStructure,Hy as resolveYPath,VR as seedStructure,mk as sourceText,Sf as structureMap,Wh as toYChildren,gk as toYNode,g_ as updateSourceText,WR as yDocToJson,JR as yEventsToDocOps,Qc as yValueToJson};
2
-
3
- //# debugId=5251AD721D89D12464756E2164756E21
4
- //# sourceMappingURL=index-2tf0m2ne.js.map
@@ -1,4 +0,0 @@
1
- import{x$,ip,_$,dd}from"./studio-gxna6yta.js";export{x$ as applyProjectSchemas,ip as validateDoc,_$ as validateDocOrNull,dd as validateProjectConfig};
2
-
3
- //# debugId=B3444A8A866248AC64756E2164756E21
4
- //# sourceMappingURL=jx-validate-7w11db9v.js.map
@@ -1,4 +0,0 @@
1
- import{Ct,vS,Mm,Qo,zx,On,vs,Pm,yS}from"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{Pm as clearLayerSlot,vs as getLayerSlot,vS as initLayers,Mm as isModalOpen,Ct as layerHost,yS as overlayIdleBlockers,Qo as showConfirmDialog,On as showPromptDialog,zx as showSaveDiscardDialog};
2
-
3
- //# debugId=7398F3C437B9A1B164756E2164756E21
4
- //# sourceMappingURL=layers-7zasrpse.js.map
@@ -1,4 +0,0 @@
1
- import{i$,I_}from"./studio-je15p5v8.js";import"./studio-ebt49j3c.js";import"./studio-s85vah66.js";import"./studio-891t1tv9.js";import"./studio-0mm38y62.js";import"./studio-jsr14n1s.js";import"./studio-02y9cb4h.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";import"./studio-k1wvtp03.js";export{I_ as registerLayersPanel,i$ as startLayerTitleEdit};
2
-
3
- //# debugId=DB18AA2E7FB78D9664756E2164756E21
4
- //# sourceMappingURL=layers-panel-9nzc4fdq.js.map
@@ -1,4 +0,0 @@
1
- import{br,Bl,tt,wS,Oi}from"./studio-dmymvk2j.js";export{wS as _$LH,br as html,Bl as noChange,tt as nothing,Oi as render};
2
-
3
- //# debugId=3BBAF83696649A5064756E2164756E21
4
- //# sourceMappingURL=lit-html-5qr7nbng.js.map
@@ -1,4 +0,0 @@
1
- import{Z_,o$,r$,s$,cd,dw}from"./studio-891t1tv9.js";import"./studio-0mm38y62.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{Z_ as invalidateMediaCache,cd as mountMediaPicker,s$ as pickAndUpload,o$ as showMediaPickerPopover,dw as unmountMediaPicker,r$ as uploadAndAssign};
2
-
3
- //# debugId=BAE46B7A748B34F764756E2164756E21
4
- //# sourceMappingURL=media-picker-maevn9d4.js.map
@@ -1,4 +0,0 @@
1
- import{$t}from"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{$t as openMenu};
2
-
3
- //# debugId=89846401E3455E7E64756E2164756E21
4
- //# sourceMappingURL=menu-wq6q0v3y.js.map
@@ -1,4 +0,0 @@
1
- import{Yu,Tm,Lm,sS,Ec,Zu,kp,Im}from"./studio-654fxcr0.js";import"./studio-0nm2skex.js";export{Yu as BUFFER_COMMIT,Ec as bufferIsLive,Zu as bufferMovedOn,Tm as bufferWrites,sS as cancelBufferWrites,Lm as commitBufferWrites,kp as commitTabBuffers,Im as tabBufferUnsaved};
2
-
3
- //# debugId=69310CA36F1BEB4964756E2164756E21
4
- //# sourceMappingURL=monaco-buffer-9ry2rn5x.js.map
@@ -1,4 +0,0 @@
1
- import{$c,Jr,S,zd,tl,lh,Fp}from"./studio-0nm2skex.js";export{tl as clearProblems,zd as dismiss,S as notify,Fp as problemCount,lh as problemFindings,Jr as problems,$c as toasts};
2
-
3
- //# debugId=604415EBE6E44E5264756E2164756E21
4
- //# sourceMappingURL=notify-g91gjd6w.js.map
@@ -1,4 +0,0 @@
1
- import{fS,Om,mS,p,We}from"./studio-6k1eswp9.js";export{p as getPlatform,We as hasPlatform,Om as launcherSignal,mS as platformInFlight,fS as registerPlatform};
2
-
3
- //# debugId=733D0235451D62B964756E2164756E21
4
- //# sourceMappingURL=platform-jdwjp2vt.js.map
@@ -1,4 +0,0 @@
1
- import{C_,b$}from"./studio-1pxvgx1t.js";import"./studio-vz7b43ng.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-w8w9frjy.js";import"./studio-tj28pxa1.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{b$ as openPublishPanel,C_ as seedPublishConnected};
2
-
3
- //# debugId=AD68E2D5A104860D64756E2164756E21
4
- //# sourceMappingURL=publish-panel-8yym447p.js.map
@@ -1,4 +0,0 @@
1
- import{F_,Af}from"./studio-wr0pq67n.js";import"./studio-d007j0z3.js";import"./studio-dtmdjmqb.js";import"./studio-0c3fpdqj.js";import"./studio-0mm38y62.js";import"./studio-frv7vjhw.js";import"./studio-z47mm077.js";import"./studio-4yztve2t.js";import"./studio-eb5sty2k.js";import"./studio-b5rxwkj2.js";import"./studio-02y9cb4h.js";import"./studio-sgzss898.js";import"./studio-sadckcpp.js";import"./studio-28pz4s1k.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";export{F_ as initQuickSearch,Af as openQuickSearch};
2
-
3
- //# debugId=36ECB1296EE177CD64756E2164756E21
4
- //# sourceMappingURL=quick-search-9bzm9kh3.js.map
@@ -1,4 +0,0 @@
1
- import{Db,yc,Fs,G1,ua,om,K1,rm}from"./studio-81twpmzj.js";import"./studio-6k1eswp9.js";import"./studio-ery42sqr.js";export{ua as invalidateUsages,Fs as loadUsages,yc as peekUsages,G1 as retryUsages,rm as usageFiles,om as usageHeadline,K1 as usageWarning,Db as usagesSupported};
2
-
3
- //# debugId=BC261A7614C0EE0864756E2164756E21
4
- //# sourceMappingURL=references-znssfqvq.js.map
@@ -1,4 +0,0 @@
1
- import{j_,y$,Nf,sd,Of}from"./studio-r7yeeqc4.js";import"./studio-ebt49j3c.js";import"./studio-s85vah66.js";import"./studio-891t1tv9.js";import"./studio-0mm38y62.js";import"./studio-jsr14n1s.js";import"./studio-02y9cb4h.js";import"./studio-njmg0e73.js";import"./studio-81twpmzj.js";import"./studio-pvj970st.js";import"./studio-w8w9frjy.js";import"./studio-y164brht.js";import"./studio-tj28pxa1.js";import"./studio-ant1zbp3.js";import"./studio-011em5cf.js";import"./studio-k9pwvmz8.js";import"./studio-27tc8q0h.js";import"./studio-654fxcr0.js";import"./studio-7w04zw8h.js";import"./studio-ft8pfpp0.js";import"./studio-6k1eswp9.js";import"./studio-ks0ecgjx.js";import"./studio-z1vdxq0e.js";import"./studio-dmymvk2j.js";import"./studio-dknr8m7b.js";import"./studio-b29h7g7s.js";import"./studio-ery42sqr.js";import"./studio-0nm2skex.js";import"./studio-k1wvtp03.js";export{sd as inspectorTab,j_ as mount,Nf as render,Of as setInspectorTab,y$ as unmount};
2
-
3
- //# debugId=8E7C98EADE33405064756E2164756E21
4
- //# sourceMappingURL=right-panel-czbzktm8.js.map
@@ -1,4 +0,0 @@
1
- import{ja,hb,cs,_1,qf,Tw,Lw,pb,fb}from"./studio-nvykrgbj.js";export{ja as notifySettingsDocument,hb as onSettingsDocumentChanged,cs as registerSettingsSection,fb as setSettingsSection,pb as settingsDocumentSection,Lw as settingsSection,Tw as settingsSectionKeys,qf as sortedSettingsSections,_1 as unregisterSettingsSection};
2
-
3
- //# debugId=D26DA46A7A439CD964756E2164756E21
4
- //# sourceMappingURL=section-registry-0rtq73qs.js.map
@@ -1,5 +0,0 @@
1
- import{p}from"./studio-6k1eswp9.js";import{di}from"./studio-b29h7g7s.js";import{Ir}from"./studio-k9pwvmz8.js";import{Gi,up,xL,_L}from"./studio-ant1zbp3.js";var r=new Map,d=new Map,a=new Map;function l(e,t){let n=xL(e),i=a.get(e);return{bytes:typeof t?.size==="number"?t.size:null,ext:Gi(n),height:i?.height??null,kind:up({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function lb(e){return r.get(di(e))??null}function wE(e){for(let t of e){if(t.type!=="file")continue;let n=di(t.path);if(!r.has(n))r.set(n,l(n,t))}}async function xE(e){let t=di(e),n=r.get(t);if(n)return n;let i=d.get(t);if(i)return i;let o=(async()=>{let u;try{u=(await Ir(()=>p().listDirectory(_L(t)))).find((f)=>di(f.path)===t)}catch{u=void 0}return l(t,u)})();d.set(t,o);let s=await o;return d.delete(t),r.set(t,s),s}function cb(e,t,n){if(!(t>0&&n>0))return!1;let i=di(e),o=a.get(i);if(o&&o.width===t&&o.height===n)return!1;a.set(i,{height:n,width:t});let s=r.get(i);if(s)r.set(i,{...s,height:n,width:t});return!0}function _E(){r.clear(),a.clear()}function g1(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function CE(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(g1(e.bytes));return t.join(" · ")}
2
- export{lb,wE,xE,cb,_E,g1,CE};
3
-
4
- //# debugId=9BDE3C4B721D9D5464756E2164756E21
5
- //# sourceMappingURL=studio-0mm38y62.js.map
@@ -1,5 +0,0 @@
1
- import{ge,Xa,Q,v,re,Bd,S}from"./studio-0nm2skex.js";import{kp}from"./studio-654fxcr0.js";import{p}from"./studio-6k1eswp9.js";import{wi,Zt,$r}from"./studio-ft8pfpp0.js";import{K,$m,ht,_n,Xo,qa,D}from"./studio-153mwkyq.js";import{Ae,Ic,Dm,uS}from"./studio-mm8x32gg.js";import{va,oh,rh}from"./studio-p6avneaq.js";import{me}from"./studio-09n3fyy0.js";function xm(e,t){return{success:!0,data:e,summary:t}}function oo(e){return{success:!1,error:e}}function Ki({name:e,description:t,parameters:n,strict:o=!0,llmStrict:r=!1,interactive:i,execute:s}){return{name:e,description:t,parameters:n,strict:o,llmStrict:r,...i===void 0?{}:{interactive:i},execute:s}}function se(e){let t=[];return{record(n){t.push(n),e?.(n)},writes:t}}function fp(e=null,t={}){let n=new Map(Object.entries(t));return{sessionId:e,get:(o)=>n.get(o),set:(o,r)=>{n.set(o,r)},toJSON:()=>Object.fromEntries(n)}}var wt=new AbortController().signal;function lv(e={}){let t=e.session??fp();return{actor:e.actor??{id:`assistant:${t.sessionId??"local"}:`,kind:"assistant",sessionId:t.sessionId,turnId:""},callId:e.callId??"",ledger:e.ledger??se(),progress:e.progress??(()=>{}),session:t,signal:e.signal??wt}}function LL(e){let t=new AbortController;if(e.aborted)return t.abort(e.reason),{release:()=>{},signal:t.signal};let n=()=>{t.abort(e.reason)};return e.addEventListener("abort",n,{once:!0}),{release:()=>{e.removeEventListener("abort",n)},signal:t.signal}}function VC(){let e=new Map;return{register(t){if(e.has(t.name))console.warn(`Tool "${t.name}" is being re-registered.`);e.set(t.name,t)},list(){return[...e.values()]},listForLLM(){return[...e.values()].map((t)=>({type:"function",function:{name:t.name,description:t.description,parameters:t.parameters,...t.llmStrict===!0?{strict:!0}:{}}}))},getDefinition(t){return e.get(t)},validate(t,n){let o=e.get(t);if(!o)return{valid:!1,errors:[`Unknown tool: "${t}"`]};if(!o.strict)return{valid:!0};let r=o.parameters;if(!r||!r.properties)return{valid:!0};let i=[],s=r.properties,a=r.required||[],l=n;for(let c of a)if(!(c in n)||l[c]===void 0||l[c]===null)i.push(`Missing required argument: "${c}"`);for(let[c,d]of Object.entries(l)){let m=s[c];if(!m)continue;let y=m.type;if(!y)continue;let b=Array.isArray(d)?"array":typeof d;if(y==="number"||y==="integer"){if(b==="number")continue;if(b==="string"){if(!Number.isNaN(Number(d)))continue;i.push(`Argument "${c}" should be a number, got non-numeric string "${d}"`);continue}i.push(`Argument "${c}" should be a number, got ${b}`);continue}if(y==="string"&&b!=="string")i.push(`Argument "${c}" should be a string, got ${b}`);else if(y==="boolean"&&b!=="boolean")i.push(`Argument "${c}" should be a boolean, got ${b}`);else if(y==="array"&&b!=="array")i.push(`Argument "${c}" should be an array, got ${b}`);else if(y==="object"&&b!=="object")i.push(`Argument "${c}" should be an object, got ${b}`)}return i.length>0?{valid:!1,errors:i}:{valid:!0}},async execute(t,n,o=lv()){let r=e.get(t);if(!r)return oo(`Unknown tool: "${t}"`);let i=this.validate(t,n);if(!i.valid)return oo(`Validation failed: ${(i.errors||[]).join("; ")}`);try{return await r.execute(n,o)}catch(s){return oo(`Tool "${t}" execution error: ${s.message}`)}}}}var F=[],St=50;function IL(e){return Object.assign(se(),{turnId:e})}function RL(e,t){if(t.length===0)return[];let n={id:e,writes:[...t]};F.push(n);while(F.length>St)F.shift();return n.writes}function Tx(e){return F.find((t)=>t.id===e)?.writes??[]}function $L(e){let t=e.filter((a)=>a.ok),n=new Set(t.map((a)=>a.path)),o=e.length-t.length;if(n.size===0)return o>0?`${o} change${o===1?"":"s"} failed`:"";let r=`Changed ${n.size} file${n.size===1?"":"s"}`,i=new Set(t.filter((a)=>a.disk).map((a)=>a.path)),s=[r];if(i.size>0)s.push(`${i.size} written to disk — undo cannot reach ${i.size===1?"it":"them"}`);if(o>0)s.push(`${o} failed`);return s.join(" · ")}function Lx(){F.splice(0)}function UC(e,t){let n=null;for(let o=e.length-1;o>=0;o--){let r=e[o];if(r.id===t)return n;let i=r.role==="assistant"&&(r.content||(r.toolCalls?.length??0)>0);if(n===null&&i)n=r.id}return t===void 0?n:null}var Ct=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"]),kx="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$";function Jo(e){if(typeof e!=="string"||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function rv(e){return Jo(e)!==null}function SL(e){let t=Jo(e);if(t===null)return"ltr";let n=new Intl.Locale(t),o=n.script??n.maximize().script;return o!==void 0&&Ct.has(o)?"rtl":"ltr"}function un(e){let t=Jo(e);if(t===null)return typeof e==="string"?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}var Rt="prefix-except-default";function Do(e){let t=e.i18n,n=[];if(!t||typeof t!=="object")return{errors:n,i18n:null};let o=Array.isArray(t.locales)?t.locales:[],r=[];for(let a of o){let l=Jo(a);if(l===null){n.push(`i18n.locales: "${String(a)}" is not a well-formed BCP 47 language tag.`);continue}if(!r.includes(l))r.push(l)}let i=Jo(t.defaultLocale)??r[0]??null;if(t.defaultLocale!==void 0&&Jo(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(i===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};if(!r.includes(i))r.unshift(i);let s=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:Rt;return{errors:n,i18n:{defaultLocale:i,locales:r,routing:s}}}function Bu(e,t){let n=ae(W(e),t);if(n===-1||t===null)return null;return Jo(W(e)[n])}function kL(e,t){let n=Bu(e,t);if(n!==null||t===null||t.routing!=="prefix-except-default")return n;return W(e)[0]==="pages"?t.defaultLocale:null}function WC(e,t){let n=W(e),o=ae(n,t);return o===-1?n.join("/"):n.filter((r,i)=>i!==o).join("/")}function zu(e,t,n){if(n===null)return null;let o=Jo(t);if(o===null||!n.locales.includes(o))return null;let r=W(e),i=ae(r,n),s=i===-1?At(r):i;if(s===-1)return null;let a=i===-1?r:r.filter((l,c)=>c!==i);if(o===n.defaultLocale&&n.routing==="prefix-except-default")return a.join("/");return a.toSpliced(s,0,o.toLowerCase()).join("/")}function W(e){return e.replace(/^\.\//,"").split("/").filter(Boolean)}function ae(e,t){if(t===null)return-1;return e.findIndex((n)=>{let o=Jo(n);return o!==null&&t.locales.includes(o)})}function At(e){if(e[0]==="pages"&&e.length>1)return 1;if(e[0]==="content"&&e.length>2)return 2;return-1}var Dx="{locale}";function Je(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function B(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/\/+$/,"")}function Ie(e){return e??D?.projectConfig??null}function De(e){return e?.content??{}}function kt(e){let t=Do(e??{}).i18n?.locales??[];return t.length>0?[...t]:null}function Le(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function Me(e){if(e.format==="json")return{ext:".json",unresolvedFormat:null};if(e.format===void 0||e.format==="")return{ext:$r()?.extensions[0]??".json",unresolvedFormat:null};let t=wi(e.format);return t?.extensions[0]===void 0?{ext:null,unresolvedFormat:e.format}:{ext:t.extensions[0],unresolvedFormat:null}}function Jt(e,t){let n=t===null?"[^/]+":`(?:${t.map((r)=>Je(r)).join("|")})`,o=B(e).split(Dx).map((r)=>Je(r)).join(n);return new RegExp(`^${o}(?:/|$)`,"i")}function jt(e,t,n){let o=Jt(e,n).exec(t);if(!o)return null;return o[0].replace(/\/$/,"")}function It(e){return B(e).replaceAll(Dx,"").length}function vp(e,t){if(e===null||e===void 0||e==="")return null;let n=Ie(t),o=kt(n),r=B(e),i=null,s=-1;for(let[a,l]of Object.entries(De(n))){let{source:c}=l;if(c===void 0||c===""||Le(c))continue;let d=It(c);if(d<=s)continue;let m=jt(c,r,o);if(m===null)continue;i={def:l,dir:r,fileBacked:!1,isSourceRoot:r.length===m.length,name:a,...Me(l)},s=d}return i}function Ax(e,t){if(e===null||e===void 0||e==="")return null;let n=Ie(t),o=B(e),r=o.toLowerCase();for(let[i,s]of Object.entries(De(n))){let{source:a}=s;if(a===void 0||a===""||!Le(a))continue;let l=B(a).toLowerCase();if(r===l||r.endsWith(`/${l}`))return{def:s,dir:o.includes("/")?o.slice(0,o.lastIndexOf("/")):".",fileBacked:!0,isSourceRoot:!1,name:i,...Me(s)}}return vp(o.includes("/")?o.slice(0,o.lastIndexOf("/")):".",n)}function Ml(e){return e.replaceAll(/([A-Z])/g," $1").replace(/^./,(t)=>t.toUpperCase())}function xv(e){return e.replaceAll(/[^a-zA-Z0-9]+(.)?/g,(t,n)=>n?n.toUpperCase():"").replace(/^[A-Z]/,(t)=>t.toLowerCase())}function _v(e){return e.replaceAll(/(^|-)(\w)/g,(t,n,o)=>(n?" ":"")+o.toUpperCase())}function Nx(e,t){return e?.$label||Ml(t)}function eI(e,t){if(e?.$label)return e.$label;if(t.includes("-"))return t.replaceAll(/(^|-)(\w)/g,(n,o,r)=>(o?" ":"")+r.toUpperCase());return Ml(t)}function ma(e){return e==="image"||e==="uri-reference"}function Dd(e){if(e.$shorthand===!0)return"shorthand";if(e.$input==="button-group")return"button-group";if(e.$input==="media")return"media";if(e.format==="color")return"color";if(ma(e.format))return"media";if(e.$units!==void 0)return"number-unit";if(e.type==="number")return"number";if(Array.isArray(e.enum))return"select";if(Array.isArray(e.examples)||Array.isArray(e.presets))return"combobox";return"text"}function qu(e,t){if(!e||!t?.content)return null;let n=Ax(e,t);if(!n||!n.def.schema)return null;if(!n.fileBacked){let o=n.ext??$r()?.extensions[0]??".json";if(!e.toLowerCase().endsWith(o.toLowerCase()))return null}return{name:n.name,schema:n.def.schema}}function Sm(e,t){let n=e.trim().toLowerCase().replaceAll(/[^a-z0-9\s-]/g,"").replaceAll(/\s+/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(!n)return"";return`${t}${n}`}function Cv(e,t){return e.replace(new RegExp(`^${t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}`),"").replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(n)=>n.toUpperCase())||e}function tI(e){if(!e)return{kind:"text"};let t=e.trim().replaceAll(/\s*\|\s*undefined\b/g,"").trim();if(t==="boolean")return{kind:"boolean"};if(t==="number")return{kind:"number"};if(t.match(/^'[^']*'(\s*\|\s*'[^']*')+$/))return{kind:"combobox",options:[...t.matchAll(/'([^']*)'/g)].map((r)=>r[1])};return{kind:"text"}}function No(e){return JSON.parse(JSON.stringify(e))}function Te(e){return e&&e.length>0?e.at(-1):null}function NL(e){return e&&e.length>0?e[0]:null}function dv(e,t){if(!t||!e)return!1;return e.some((n)=>Xo(n,t))}function ms(e){return L(e)}function L(e){let t=[];for(let n of e)t.push([...n]);return t}function uv(e,t){if(dv(e,t))return L(e.filter((n)=>!Xo(n,t)));return[...L(e),[...t]]}function OL(e,t,n){let o=e.findIndex((s)=>Xo(s,n)),r=t?e.findIndex((s)=>Xo(s,t)):-1;if(o===-1||r===-1)return[[...n]];let i=r<=o?e.slice(r,o+1):e.slice(o,r+1).toReversed();return L(i)}function Ee(e,t){return L(e.filter((n)=>!qa(t,n)))}function Dt(e,t){let n=Math.min(e.length,t.length);for(let o=0;o<n;o++){let r=e[o],i=t[o];if(r===i)continue;if(typeof r==="number"&&typeof i==="number")return r-i;return String(r)<String(i)?-1:1}return e.length-t.length}function Lt(e){return L(e.filter((t)=>!e.some((n)=>!Xo(n,t)&&qa(n,t))))}function Nl(e){return e.at(-2)==="children"&&typeof e.at(-1)==="number"}function hv(e){return Lt(e).filter((t)=>Nl(t)).toSorted((t,n)=>Dt(n,t))}function ML(e){let t=[];for(let n of e)if(!t.some((o)=>Xo(o,n)))t.push([...n]);return t}function gp(e){if(e.length===0)return{mixed:!1,value:void 0};let t=e[0],n=JSON.stringify(t??null);for(let o=1;o<e.length;o++)if(JSON.stringify(e[o]??null)!==n)return{mixed:!0,value:void 0};return{mixed:!1,value:t}}var $e=null;function PL(e){$e=e}function Ne(){return $e}var V=null,U=null,G=null,le=!0;function _e(){V=[],U=[],G=[],le=!0}function f(e){if(V)V.push(e)}function vi(e){if(U)U.push(e)}function Fe(e){if(G)G.push(e)}function We(){let e={docOps:U??[],fmOps:G??[],invertible:le,ops:V??[]};return V=null,U=null,G=null,le=!0,e}var Be=100,Mt=20;function H(){try{return typeof localStorage>"u"||!localStorage.getItem("jx-legacy-history")}catch{return!0}}function P(e,t,n,o){return{forward:{key:t,op:"set-key",path:e,value:o},inverse:{key:t,op:"set-key",path:e,value:n}}}function Et(e,t,n,o,r){let i=e.length;if(!(i<t.length&&e.every((c,d)=>c===t[d]))||t[i]!=="children"||typeof t[i+1]!=="number")return t;let a=t[i+1];if(r?a<n:a<=n)return t;let l=[...t];return l[i+1]=a+o,l}var Ve=null;function Ke(e){Ve=e}var Ue=null;function Ge(e){Ue=e}function $t(e,t,n,o){for(let r=t.docOps.length-1;r>=0;r--)Dm(e.doc.document,re(t.docOps[r].inverse));for(let r=t.fmOps.length-1;r>=0;r--){let i=t.fmOps[r];fe(e,i.field,i.before)}e.doc.document={...re(e.doc.document)},e.session.selection=n,e.doc.dirty=o}function q(e,t,{skipHistory:n=!1,origin:o="user",coalesceKey:r=null}={}){if(!e)return!1;if(o!=="remote"&&Ue?.(e,o))return!1;let i=ms(e.session.selection),s=e.doc.dirty;_e();let a,l=null;try{t(e)}catch(b){l={error:b}}finally{a=We()}if(l)throw $t(e,a,i,s),l.error;let c=re(e.doc.document),d={...c},m=Ne(),y=m===null?{patchable:!1,reason:"no-patch-consumer"}:a.ops.length===0?{patchable:!1,reason:"unrecorded-mutation"}:m.classify(e,a.ops);if(y.patchable)m.markConsumed(d,e);if(e.doc.document=d,y.patchable)try{m.apply(e,a.ops,a)}catch(b){m.escalate(`patch-apply-failed: ${b instanceof Error?b.message:String(b)}`,e)}if(!n&&!M)Nt(e,c,a,i,r);return e.doc.dirty=!0,Ve?.(e,a,o),!0}function Nt(e,t,n,o,r=null){let i=e.history.snapshots.slice(0,e.history.index+1),s=H()&&n.invertible&&(n.docOps.length>0||n.fmOps.length>0),a=i.at(-1);if(r&&s&&a&&a.coalesceKey===r&&a.inverseOps){if(a.forwardOps=[...a.forwardOps??[],...n.docOps.map((c)=>c.forward)],a.inverseOps=[...a.inverseOps,...n.docOps.map((c)=>c.inverse)],a.selection=ms(e.session.selection),a.document)a.document=No(t);e.history.snapshots=i,e.history.index=i.length-1;return}let l=!s||i.length%Mt===0;if(i.push({document:l?No(t):null,fmOps:s&&n.fmOps.length>0?n.fmOps:null,forwardOps:s?n.docOps.map((c)=>c.forward):null,inverseOps:s?n.docOps.map((c)=>c.inverse):null,coalesceKey:r,selection:ms(e.session.selection),selectionBefore:o}),i.length>Be){if(!i[1].document)i[1].document=ce(i,1);i.shift()}e.history.snapshots=i,e.history.index=i.length-1}function ce(e,t){let n=t;while(n>=0&&!e[n].document)n-=1;if(n<0)throw Error("history-missing-checkpoint");let o=No(e[n].document);for(let r=n+1;r<=t;r++)for(let i of e[r].forwardOps??[])Dm(o,i);return o}function js(e,t,n){return q(e,(o)=>t(o.doc.document),n)}function ue(e,t){q(e,(n)=>{for(let o of t)de(n,o)},{origin:"remote",skipHistory:!0})}var _t=new Set(["state","$media","$head","$elements","imports","$layout"]);function de(e,t){let n=t.op==="set-key"?K(e.doc.document,t.path)?.[t.key]:null;switch(Dm(e.doc.document,t),vi({forward:t,inverse:t}),t.op){case"set-key":{if(_t.has(t.key))f({key:t.key,op:"doc-meta"});else if(t.key==="style")f({op:"set-style",path:t.path});else if(t.key==="textContent")f({op:"set-text",path:t.path});else if(t.key==="attributes"||t.key==="cases"||t.key==="$props")f({op:"replace",path:t.path});else{let o=t.key.startsWith("on")&&(rh(t.value)||rh(n));f({isEvent:o,key:t.key,op:"set-prop",path:t.path})}return}case"insert-child":{f({index:t.index,op:"insert",parentPath:t.parentPath});return}case"remove-child":{f({op:"remove",path:[...t.parentPath,"children",t.index]});return}case"set-child":{f({op:"replace",path:[...t.parentPath,"children",t.index]});return}case"move-child":{f({fromPath:[...t.fromParentPath,"children",t.fromIndex],op:"move",toIndex:t.toIndex,toParentPath:t.toParentPath});break}default:break}}var M=null,He=null;function ze(e){He=e}function pv(e){M=e}function fv(){let e=M;if(e&&!j.has(e)){let t=re(e.doc.document),n={document:No(t),selection:ms(e.session.selection)},o=e.history.snapshots.slice(0,e.history.index+1);if(o.push(n),o.length>Be)o.shift();e.history.snapshots=o,e.history.index=o.length-1}if(M=null,e)He?.(e)}function Ix(){return M!==null}function FL(){return M}var j=new WeakMap;function _m(e,t){if(t)j.set(e,t);else j.delete(e)}function jL(e){let t=j.get(e);return t?t.canUndo(e):e.history.index>0}function HL(e){let t=j.get(e);return t?t.canRedo(e):e.history.index<e.history.snapshots.length-1}function Ye(e,t){let{snapshots:n}=e.history;e.doc.document=ce(n,t);let o=n[t];e.session.selection=ms(re(o.selection))}function Ze(e,t){try{if(typeof localStorage>"u"||!localStorage.getItem("jx-canvas-debug"))return}catch{return}let n=JSON.stringify(ce(e.history.snapshots,t)),o=JSON.stringify(No(re(e.doc.document)));if(n!==o)console.error("jx history: ops-based undo/redo diverged from checkpoint replay",{index:t})}function Rx(e){let t=j.get(e);if(t){t.undo(e);return}if(e.history.index<=0)return;let n=e.history.snapshots[e.history.index],o=H()?n.inverseOps:null,r=H()?n.fmOps:null;if(o&&o.length>0||r&&r.length>0){if(!q(e,(s)=>{if(o)for(let a=o.length-1;a>=0;a--)de(s,re(o[a]));if(r)for(let a=r.length-1;a>=0;a--){let l=re(r[a]);fe(s,l.field,l.before)}},{origin:"history",skipHistory:!0}))return;e.session.selection=ms(re(n.selectionBefore??[])),e.history.index-=1,Ze(e,e.history.index)}else e.history.index-=1,Ye(e,e.history.index);e.doc.dirty=!0}function BL(e){let t=j.get(e);if(t){t.redo(e);return}if(e.history.index>=e.history.snapshots.length-1)return;let n=e.history.snapshots[e.history.index+1],o=H()?n.forwardOps:null,r=H()?n.fmOps:null;if(o&&o.length>0||r&&r.length>0){if(!q(e,(s)=>{if(o)for(let a of o)de(s,re(a));if(r)for(let a of r){let l=re(a);fe(s,l.field,l.after)}},{origin:"history",skipHistory:!0}))return;e.session.selection=ms(re(n.selection)),e.history.index+=1,Ze(e,e.history.index)}else e.history.index+=1,Ye(e,e.history.index);e.doc.dirty=!0}function Ji(e,t,n,o){let r=K(e.doc.document,t);if(!r)return;Ic(r).splice(n,0,structuredClone(o)),f({index:n,op:"insert",parentPath:t}),vi({forward:{index:n,node:Ae(o),op:"insert-child",parentPath:t},inverse:{index:n,op:"remove-child",parentPath:t}})}function Vu(e,t){if(!t||!Nl(t))return;let n=ht(t),o=_n(t),[r]=K(e.doc.document,n).children.splice(o,1);f({op:"remove",path:t}),vi({forward:{index:o,op:"remove-child",parentPath:n},inverse:{index:o,node:Ae(r),op:"insert-child",parentPath:n}}),e.session.selection=Ee(e.session.selection,t)}function GC(e,t){if(!t||!Nl(t))return;let n=K(e.doc.document,t);if(!n)return;let o=ht(t),r=_n(t),i=structuredClone(re(n));K(e.doc.document,o).children.splice(r+1,0,i),f({index:r+1,op:"insert",parentPath:o}),vi({forward:{index:r+1,node:Ae(i),op:"insert-child",parentPath:o},inverse:{index:r+1,op:"remove-child",parentPath:o}}),e.session.selection=[[...o,"children",r+1]]}function bp(e,t){for(let n of hv(t))Vu(e,n)}function mv(e,t){let n=[];for(let o of hv(t)){let r=e.session.selection;GC(e,o);let i=Te(e.session.selection);if(!i||e.session.selection===r)continue;let s=ht(i),a=_n(i);n=n.map((l)=>Et(s,l,a,1,!0)),n.unshift(i)}if(n.length>0)e.session.selection=n}function zL(e,t,n="div"){if(!t||!Nl(t))return;let o=K(e.doc.document,t);if(!o)return;let r=ht(t),i=_n(t),s={children:[structuredClone(re(o))],tagName:n},a=Ae(o);K(e.doc.document,r).children.splice(i,1,s),f({op:"replace",path:t}),vi({forward:{index:i,node:Ae(s),op:"set-child",parentPath:r},inverse:{index:i,node:a,op:"set-child",parentPath:r}}),e.session.selection=[[...r,"children",i]]}function pa(e,t,n,o){let r=e.doc.document,i=ht(t),s=_n(t);if(!i||typeof s!=="number")return;let a=K(r,i),l=K(r,n);if(!a||!Array.isArray(a.children)||!l)return;if(a.children[s]===void 0)return;let c=o;if(a===l&&s<o)c-=1;let d={fromIndex:s,fromParentPath:i,op:"move-child",toIndex:c,toParentPath:n},m=uS(r,d),[y]=a.children.splice(s,1);if(Ic(l).splice(c,0,y),f({fromPath:t,op:"move",toIndex:c,toParentPath:n}),vi({forward:d,inverse:m}),Xo(Te(e.session.selection),t)){let b=o;if(i.length===n.length&&i.every((_,I)=>_===n[I])&&s<o)b=o-1;e.session.selection=[[...n,"children",b]]}}function qe(e,t,n,o){let r=K(e.doc.document,t);if(!r)return;let i=r[n],s=Ae(i);if(o===void 0||o===null||o==="")delete r[n];else r[n]=o;if(vi(P(t,n,s,Ae(r[n]))),n==="textContent")f({op:"set-text",path:t});else if(n==="style")f({op:"set-style",path:t});else{let a=o===void 0||o===null||o===""?i:o,l=n.startsWith("on")&&rh(a);f({isEvent:l,key:n,op:"set-prop",path:t})}}function Sc(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.style);if(!r.style)r.style={};if(o===void 0||o==="")delete r.style[n];else r.style[n]=o;if(Object.keys(r.style).length===0)delete r.style;vi(P(t,"style",i,Ae(r.style))),f({op:"set-style",path:t})}function Yo(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.attributes);if(!r.attributes)r.attributes={};if(o===void 0||o==="")delete r.attributes[n];else r.attributes[n]=o;if(Object.keys(r.attributes).length===0)delete r.attributes;vi(P(t,"attributes",i,Ae(r.attributes))),f({attr:n,op:"set-attr",path:t})}function WL(e,t,n,o,r){if(!n)return Sc(e,t,o,r);let i=K(e.doc.document,t),s=Ae(i.style);if(!i.style)i.style={};let a=`@${n}`,l=oh(i.style,a);if(r===void 0||r===""){if(delete l[o],Object.keys(l).length===0)delete i.style[a]}else l[o]=r;if(Object.keys(i.style).length===0)delete i.style;vi(P(t,"style",s,Ae(i.style))),f({op:"set-style",path:t})}function gv(e,t,n,o,r){let i=K(e.doc.document,t),s=Ae(i.style);if(!i.style)i.style={};let a=oh(i.style,n);if(r===void 0||r===""){if(delete a[o],Object.keys(a).length===0)delete i.style[n]}else a[o]=r;if(Object.keys(i.style).length===0)delete i.style;vi(P(t,"style",s,Ae(i.style))),f({op:"set-style",path:t})}function VL(e,t,n,o,r,i){let s=K(e.doc.document,t),a=Ae(s.style);if(!s.style)s.style={};let l=`@${n}`,c=oh(s.style,l),d=oh(c,o);if(i===void 0||i===""){if(delete d[r],Object.keys(d).length===0)delete c[o];if(Object.keys(c).length===0)delete s.style[l]}else d[r]=i;if(Object.keys(s.style).length===0)delete s.style;vi(P(t,"style",a,Ae(s.style))),f({op:"set-style",path:t})}function Xe(e,t){let n=[e];for(let o of t){let r=va(n.at(-1),o);if(!r)break;n.push(r)}for(let o=n.length-2;o>=0;o--){let r=n[o],i=t[o],s=va(r,i);if(s&&Object.keys(s).length===0)delete r[i]}}function bv(e,t,n,o,r){let i=K(e.doc.document,t),s=Ae(i.style);if(!i.style)i.style={};let a=i.style;for(let l of n)a=oh(a,l);if(r===void 0||r==="")delete a[o],Xe(i.style,n);else a[o]=r;if(Object.keys(i.style).length===0)delete i.style;vi(P(t,"style",s,Ae(i.style))),f({op:"set-style",path:t})}function UL(e,t,n,o,r,i){let s=K(e.doc.document,t),a=Ae(s.style);if(!s.style)s.style={};let l=`@${n}`,c=oh(s.style,l),d=c;for(let m of o)d=oh(d,m);if(i===void 0||i===""){if(delete d[r],Xe(c,o),Object.keys(c).length===0)delete s.style[l]}else d[r]=i;if(Object.keys(s.style).length===0)delete s.style;vi(P(t,"style",a,Ae(s.style))),f({op:"set-style",path:t})}function qL(e,t,n){let o=K(e.doc.document,t),r=Ae(o.style);if(n&&Object.keys(n).length>0)o.style=n;else delete o.style;vi(P(t,"style",r,Ae(o.style))),f({op:"set-style",path:t})}function Hs(e,t,n){let o=e.doc.document,r=Ae(o.state);if(!o.state)o.state={};o.state[t]=n,vi(P([],"state",r,Ae(o.state))),f({key:"state",op:"doc-meta"})}function vv(e,t){let n=e.doc.document;if(n.state){let o=Ae(n.state);if(delete n.state[t],Object.keys(n.state).length===0)delete n.state;vi(P([],"state",o,Ae(n.state))),f({key:"state",op:"doc-meta"})}}function mr(e,t,n){let o=e.doc.document,r=Ae(o.state);if(!o.state)o.state={};let i=o.state[t],s=i==null?{}:typeof i!=="object"||Array.isArray(i)?{default:i}:i;o.state[t]=s,Object.assign(s,n);for(let a of Object.keys(s))if(s[a]===void 0||s[a]===null)delete s[a];vi(P([],"state",r,Ae(o.state))),f({key:"state",op:"doc-meta"})}function GL(e,t,n){let o=e.doc.document;if(!o.state||!o.state[t])return;let r=Ae(o.state);o.state[n]=o.state[t],delete o.state[t],vi(P([],"state",r,Ae(o.state))),f({key:"state",op:"doc-meta"})}function Uu(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.$props);if(!r.$props)r.$props={};if(o===void 0||o===null||o==="")delete r.$props[n];else r.$props[n]=o;if(Object.keys(r.$props).length===0)delete r.$props;vi(P(t,"$props",i,Ae(r.$props))),f({op:"replace",path:t})}function KL(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.cases);if(!r.cases)r.cases={};r.cases[n]=o||{tagName:"div",textContent:n},vi(P(t,"cases",i,Ae(r.cases))),f({op:"replace",path:t})}function JL(e,t,n){let o=K(e.doc.document,t);if(o.cases){let r=Ae(o.cases);delete o.cases[n],vi(P(t,"cases",r,Ae(o.cases))),f({op:"replace",path:t})}}function YL(e,t,n,o){let r=K(e.doc.document,t);if(!r.cases||!r.cases[n])return;let i=Ae(r.cases);r.cases[o]=r.cases[n],delete r.cases[n],vi(P(t,"cases",i,Ae(r.cases))),f({op:"replace",path:t})}function Ol(e,t,n){let o=e.doc.content.frontmatter,r=Object.hasOwn(o,t)?Ae(o[t]):void 0,i=n===void 0||n===null||n==="";if(i)delete o[t];else o[t]=n;let s=i?void 0:Ae(n);Fe({after:s,before:r,field:t}),e.doc.dirty=!0}function fe(e,t,n){if(n===void 0)delete e.doc.content.frontmatter[t];else e.doc.content.frontmatter[t]=n}var Ft={design:"canvas",edit:"canvas",entry:"entry","git-diff":"diff",grid:"grid",manage:"library",media:"media",preview:"canvas",settings:"config",source:"code",stylebook:"config"},Wu={canvas:"Canvas",code:"Code",config:"Project Styles",diff:"Diff",entry:"Entry",grid:"Grid",media:"Media",library:"Library",none:"None"};function ha(e){return Ft[e]??"canvas"}var Wt={design:"design",edit:"edit",preview:"preview"};function EL(e){return Wt[e]??"design"}var sv=(e)=>e.editor.kind==="canvas",$d=(e)=>sv(e)&&e.selection.count>0,av=(e)=>$d(e)&&!e.selection.isRoot;function wm(){return{project:{open:!1,isSite:!1,isRepo:!1,isMultilingual:!1},git:{ahead:0,behind:0,dirtyCount:0},document:{open:!1,dirty:!1,mode:"",canUndo:!1,canRedo:!1},editor:{kind:"none"},canvas:{view:"design"},pane:{count:1,derived:!1},selection:{count:0,paths:[],kind:"",isRoot:!1,isComponentInstance:!1,isLayoutNode:!1,isRepeater:!1},caret:{active:!1,inCanvas:!1},focus:{region:"pane"},modal:{open:!1},collab:{attached:!1,readOnly:!1,sourceCanonical:!1},ai:{configured:!1,streaming:!1,waiting:!1},capability:{gitClone:!1,importSite:!1,openProjectInNewWindow:!1,dataRows:!1,windowControls:!1,findReferences:!1,readFileBytes:!1}}}function Ex(e={}){let t=wm();for(let n of Object.keys(e)){let o=e[n];if(o)Object.assign(t[n],o)}return t}var Bt=["palette"],Vt=["caret","global"],Kt=["dock","global"],Ut=["canvas","global"],Gt=["grid","global"],Ht=["code","global"],Qe=["global"];function TL(e){if(e.modal.open)return Bt;if(e.caret.active)return Vt;if(e.focus.region!=="pane")return Kt;switch(e.editor.kind){case"grid":return Gt;case"code":return Ht;case"canvas":return e.canvas.view==="preview"?Qe:Ut;default:return Qe}}var ai="project.json";function qt(e,t=!1){return{activeMedia:null,activeSelector:null,openPopover:null,openDialog:null,canvasMode:e,editZoom:1,editingFormula:null,editingFunction:null,featureToggles:{},inspectorSections:{},pendingInlineEdit:null,preview:t,previewColorScheme:"auto",previewLocale:null,previewParams:{},previewProps:null,rightTab:"properties",showLayout:!0,styleFilter:"",styleSections:{},dataRows:{},dataLimits:{},styleShorthands:{},zoom:1}}var zt=["edit","design","preview","source","stylebook","git-diff"];function cv({id:e,documentPath:t=null,fileHandle:n=null,document:o,frontmatter:r,sourceFormat:i=null,capabilities:s,openedFrom:a=null,preview:l=!1,layout:c=null}){let d=ge();$m(o);let m=s?.modes??Yt(t,i),y=m.find((I)=>I!=="preview")??"edit",b=m[0]==="preview";return d.run(()=>({capabilities:{modes:m},doc:v({content:{frontmatter:r||{}},dirty:!1,document:o,handlersSource:null,layout:c,mode:Xt(t,i),sourceFormat:i}),documentPath:t,fileHandle:n,history:v({index:0,snapshots:[{document:structuredClone(o),selection:[]}]}),id:e,pinned:!1,preview:l,scope:d,session:v({canvas:{refreshing:!1,error:null,livePreviews:null,pendingInlineEdit:null,scope:null,status:"idle"},clipboard:null,hover:null,openedFrom:a,selection:[],ui:qt(y,b)})}))}function Yt(e,t){if(e===ai)return["stylebook","source"];let n=wi(t)??Zt(e);if(n)return n.studio?.modes??["edit","design","preview","source"];return zt}function Xt(e,t){let n=wi(t)??Zt(e);if(n)return n.studio?.documentMode?.default??"content";return"component"}function qC(e){return ha(e.session.ui.canvasMode)}function DL(e){let t=[];for(let n of e.capabilities.modes){if(n==="preview")continue;let o=ha(n);if(!t.includes(o))t.push(o)}return t}function AL(e,t){return e.capabilities.modes.find((n)=>n!=="preview"&&ha(n)===t)}function mp(e){e.scope.stop()}var et=new WeakMap,E=new Map;function on(e){let t=re(e),n=et.get(t);if(!n)n=v({active:!1,attachError:"",peers:[],readOnly:!1,sourceCanonical:!1,status:"unavailable"}),et.set(t,n);return n}function tt(e){E.set(e,(E.get(e)??0)+1)}function nt(e){let t=E.get(e)??0;if(t<=1)E.delete(e);else E.set(e,t-1)}function Cm(e){return E.has(e.replaceAll("\\","/"))}var Qt=8000,en=800,tn=2500,rt=null;function nn(){return rt??=(me("2tf0m2ne"),import("./index-2tf0m2ne.js")),rt}function st(){try{return p()}catch{return null}}var N=null;function nI(e){N=e}var be=null;function iI(e){be=e}var at=()=>{};function oI(e){at=e??(()=>{})}var ye=new WeakMap;function lt(e){return re(e)}function R(e){return ye.get(lt(e))}function ve(e){let t=lt(e),n=ye.get(t);if(!n)n={attaching:null,generation:0,optedOut:v({value:!1}),session:null,watcherInstalled:!1},ye.set(t,n);return n}var it=!1;function rn(){if(it)return;it=!0,Ke(sn),ze(an),Ge((e)=>{if(R(e)?.session?.synced&&on(e).sourceCanonical)return at("Source editing in progress — structural edits are paused"),"source-canonical";return null})}function sn(e,t,n){let o=R(e)?.session;if(!o||!o.synced)return;if(o.lastSeenRef=re(e.doc.document),n==="remote"){ee(o);return}if(o.canWrite)ln(o,t),ee(o)}function an(e){let t=R(e)?.session;if(!t?.synced||t.batchOps===null)return;let{batchOps:n,batchNeedsDiff:o}=t;if(t.batchOps=null,t.batchNeedsDiff=!1,!t.canWrite)return;if(t.undoManager?.stopCapturing(),o)z(t);else if(n.length>0)try{t.collab.applyDocOpsToY(t.handle.doc,n,t.collab.LOCAL_ORIGIN)}catch{z(t)}t.undoManager?.stopCapturing()}function ln(e,t){let n=t.docOps.map((o)=>o.forward);if(Ix()){if(e.batchOps??=[],n.length===0)e.batchNeedsDiff=!0;else e.batchOps.push(...n);return}if(n.length===0){z(e);return}try{e.collab.applyDocOpsToY(e.handle.doc,n,e.collab.LOCAL_ORIGIN)}catch{z(e)}}function z(e){let{collab:t,handle:n,tab:o}=e,r=t.yDocToJson(n.doc),i=No(re(o.doc.document)),s=t.diffDocs(r,i);if(s===null)t.replaceYStructure(n.doc,i,t.LOCAL_ORIGIN);else if(s.length>0)try{t.applyDocOpsToY(n.doc,s,t.LOCAL_ORIGIN)}catch{t.replaceYStructure(n.doc,i,t.LOCAL_ORIGIN)}}function pe(e){let t=e.collab.yDocToJson(e.handle.doc);q(e.tab,(n)=>{let o=n.doc.document;for(let r of Object.keys(o))if(!(r in t))delete o[r];Object.assign(o,t)},{origin:"remote",skipHistory:!0})}function cn(e){if(!e.canWrite)return!1;let{awareness:t}=e.handle,n=t.clientID;for(let[o,r]of t.getStates())if(r.canWrite!==!1&&o<n)n=o;return n===e.handle.awareness.clientID}function ee(e){if(!N||!cn(e))return;if(e.collab.canonicalOf(e.handle.doc)==="source")return;let t=Date.now();if(e.lastMirrorAt??=t,t-e.lastMirrorAt>=tn){if(e.mirrorTimer)clearTimeout(e.mirrorTimer),e.mirrorTimer=null;e.lastMirrorAt=t,he(e);return}if(e.mirrorTimer)clearTimeout(e.mirrorTimer);e.mirrorTimer=setTimeout(()=>{e.mirrorTimer=null,e.lastMirrorAt=Date.now(),he(e)},en)}async function he(e){if(!N||!e.synced)return;try{let t=await N(e.tab);e.collab.updateSourceText(e.handle.doc,t,e.collab.MIRROR_ORIGIN)}catch{}}async function ct(e){if(!be||!e.synced||!e.canWrite)return;let{collab:t,handle:n,tab:o}=e,r=t.canonicalRevOf(n.doc),i=t.sourceText(n.doc).toString(),s;try{s=await be(o,i)}catch{return}if(!e.synced||t.canonicalRevOf(n.doc)!==r)return;let a=t.diffDocs(t.yDocToJson(n.doc),s.document);if(a===null)t.replaceYStructure(n.doc,s.document,t.MIRROR_ORIGIN);else if(a.length>0)try{t.applyDocOpsToY(n.doc,a,t.MIRROR_ORIGIN)}catch{t.replaceYStructure(n.doc,s.document,t.MIRROR_ORIGIN)}let l=t.frontmatterMap(n.doc),c=s.frontmatter??{};n.doc.transact(()=>{let d=[...l.keys()];for(let m of d)if(!(m in c))l.delete(m);for(let[m,y]of Object.entries(c))if(!t.deepEqual(l.get(m),y))l.set(m,y)},t.MIRROR_ORIGIN)}function rI(e){let t=R(e)?.session;if(!t?.synced)return null;let{collab:n,handle:o}=t,r=null,i=()=>r!==null&&t.sourceLockOwner===r;return{awareness:o.awareness,enter:async()=>{r={},t.sourceLockOwner=r;let s=o.awareness.getLocalState();if(s)o.awareness.setLocalState({...s,mode:"source"});if(!t.canWrite)return;let a=null;if(N)try{a=await N(e)}catch{a=null}if(!i())return;n.acquireSourceCanonical(o.doc,a??n.sourceText(o.doc).toString(),n.LOCAL_ORIGIN)},leave:()=>{if(!i()){r=null;return}r=null,t.sourceLockOwner=null;let s=o.awareness.getLocalState();if(s)o.awareness.setLocalState({...s,mode:"structure"});if(!t.canWrite)return;if(n.otherSourceEditors(o.awareness,t.path,o.awareness.clientID).filter((l)=>o.awareness.getStates().get(l)?.canWrite!==!1).length===0)ct(t).then(()=>{n.releaseSourceCanonical(o.doc,n.LOCAL_ORIGIN)})},localOrigin:n.LOCAL_ORIGIN,readOnly:!t.canWrite,text:n.sourceText(o.doc)}}function km(e){let t=on(e);return t.active&&t.readOnly}async function YC(e){let t=R(e)?.session;if(!t?.synced||!t.canWrite)return!1;if(t.mirrorTimer)clearTimeout(t.mirrorTimer),t.mirrorTimer=null;return await he(t),await t.handle.flush(),!0}async function ZC(){for(let e of xe)if(R(e)?.session?.synced)await YC(e)}var xe=new Set;function Y(e){if(!st()?.collab||!e.documentPath||e.documentPath===ai)return;let n=ve(e);if(n.watcherInstalled)return;n.watcherInstalled=!0,rn(),xe.add(e),e.scope.run(()=>{Q(()=>{if(n.optedOut.value)te(e);else Pe(e)}),Xa(()=>{xe.delete(e),te(e)})})}function XC(e,t){let n=ve(e);if(n.optedOut.value===!t)return;if(n.optedOut.value=!t,!n.watcherInstalled&&t)Y(e)}function QC(e){return R(e)?.optedOut.value!==!0}function ut(e){if(!R(e)?.watcherInstalled){Y(e);return}te(e),Pe(e)}async function Pe(e){let t=ve(e);if(t.session||t.attaching)return;let{documentPath:n}=e,o=st();if(!n||!o?.collab){on(e).status="unavailable";return}let{generation:r}=t,i=on(e);i.status="connecting",i.attachError="";let s=(async()=>{try{let[a,l]=await Promise.all([nn(),o.collab(n)]);if(!l){i.status="detached";return}if(t.generation!==r){l.destroy();return}let c=null,d=new Promise((m,y)=>{c=setTimeout(()=>y(Error("collab-sync-timeout")),Qt)});try{await Promise.race([l.whenSynced,d])}finally{if(c)clearTimeout(c)}if(t.generation!==r){l.destroy();return}t.session=dn(e,n,a,l),i.active=!0,i.status="synced",i.readOnly=!t.session.canWrite,i.attachError="",tt(n)}catch(a){i.status="failed",i.active=!1,i.attachError=a instanceof Error?a.message:String(a),S.warn(`Live collaboration is not available for "${n}" — ${i.attachError}`,{key:`collab:${n}`,path:n,source:"Collaboration"})}finally{t.attaching=null}})();t.attaching=s,await s}function te(e){let t=R(e);if(!t)return;t.generation+=1;let{session:n}=t;t.session=null;let o=on(e);if(o.active=!1,o.status="detached",o.attachError="",o.peers=[],!n)return;if(nt(n.path),n.mirrorTimer)clearTimeout(n.mirrorTimer);if(n.sourceParseTimer)clearTimeout(n.sourceParseTimer);for(let r of n.disposers)try{r()}catch{}_m(e,null),e.history.snapshots=[{document:No(re(e.doc.document)),selection:ms(e.session.selection)}],e.history.index=0,n.undoManager?.destroy(),n.handle.destroy()}function dn(e,t,n,o){let r=o.identity(),i={applyingRemoteFrontmatter:!1,batchNeedsDiff:!1,batchOps:null,canWrite:r?r.permission!=="read":!0,collab:n,disposers:[],handle:o,lastSeenRef:re(e.doc.document),mirrorTimer:null,path:t,sourceLockOwner:null,sourceParseTimer:null,synced:!1,tab:e,undoManager:null};if(n.metaMap(o.doc).get("structureSeeded")===!0){let h=n.yDocToJson(o.doc),x=No(re(e.doc.document));if(!n.deepEqual(h,x)){let w=n.diffDocs(x,h);if(w===null)i.synced=!0,pe(i),i.synced=!1;else if(w.length>0)ue(e,w)}i.applyingRemoteFrontmatter=!0;let T=n.frontmatterMap(o.doc);for(let[w,J]of T.entries())e.doc.content.frontmatter[w]=J;i.applyingRemoteFrontmatter=!1}else if(i.canWrite)n.seedStructure(o.doc,No(re(e.doc.document)),{frontmatter:No(re(e.doc.content.frontmatter)),origin:n.SEED_ORIGIN,sourceFormat:e.doc.sourceFormat});i.lastSeenRef=re(e.doc.document),i.disposers.push(o.onDirty((h)=>{e.doc.dirty=h})),o.awareness.setLocalState({canWrite:i.canWrite,focusedPath:t,structuralSelection:null,user:r?{avatarUrl:r.avatarUrl,color:r.color,login:r.login,name:r.name}:{color:n.colorForKey(String(o.awareness.clientID)),login:`guest-${o.awareness.clientID%1000}`}});let a=new n.UndoManager([n.structureMap(o.doc),n.frontmatterMap(o.doc)],{trackedOrigins:new Set([n.LOCAL_ORIGIN])});i.undoManager=a;let l=({stackItem:h})=>{h.meta.set("selection",ms(e.session.selection))},c=({stackItem:h})=>{let x=h.meta.get("selection");e.session.selection=ms(x??[])};a.on("stack-item-added",l),a.on("stack-item-popped",c),i.disposers.push(()=>{a.off("stack-item-added",l),a.off("stack-item-popped",c)}),_m(e,{canRedo:()=>a.canRedo(),canUndo:()=>a.canUndo(),redo:()=>{a.redo()},undo:()=>{a.undo()}});let d=n.structureMap(o.doc),m=(h,x)=>{if(x.origin===n.LOCAL_ORIGIN||!i.synced)return;let T=n.yEventsToDocOps(h);if(T===null){pe(i);return}if(T.length===0)return;try{ue(e,T)}catch{pe(i)}};d.observeDeep(m),i.disposers.push(()=>d.unobserveDeep(m));let y=on(e);y.sourceCanonical=n.canonicalOf(o.doc)==="source";let b=n.metaMap(o.doc),_=()=>{y.sourceCanonical=n.canonicalOf(o.doc)==="source"};b.observe(_),i.disposers.push(()=>b.unobserve(_));let I=n.sourceText(o.doc),Se=(h,x)=>{if(x.origin===n.MIRROR_ORIGIN||!i.synced)return;if(n.canonicalOf(o.doc)!=="source")return;if(!n.isSourceReconciler(o.awareness,i.path))return;if(i.sourceParseTimer)clearTimeout(i.sourceParseTimer);i.sourceParseTimer=setTimeout(()=>{i.sourceParseTimer=null,ct(i)},600)};I.observe(Se),i.disposers.push(()=>I.unobserve(Se));let k=n.frontmatterMap(o.doc),Ce=(h,x)=>{if(x.origin===n.LOCAL_ORIGIN||!i.synced)return;i.applyingRemoteFrontmatter=!0;try{for(let[T,w]of h.changes.keys)if(w.action==="delete")delete e.doc.content.frontmatter[T];else e.doc.content.frontmatter[T]=k.get(T)}finally{i.applyingRemoteFrontmatter=!1}};k.observe(Ce),i.disposers.push(()=>k.unobserve(Ce)),e.scope.run(()=>{let h=JSON.stringify(e.doc.content.frontmatter);Q(()=>{let x=JSON.stringify(e.doc.content.frontmatter);if(x===h)return;if(h=x,i.applyingRemoteFrontmatter||!i.synced||!i.canWrite)return;let T=JSON.parse(x);o.doc.transact(()=>{let w=[...k.keys()];for(let J of w)if(!(J in T))k.delete(J);for(let[J,Re]of Object.entries(T))if(!n.deepEqual(k.get(J),Re))k.set(J,Re)},n.LOCAL_ORIGIN),ee(i)}),Q(()=>{let x=e.session.selection.length>0?ms(e.session.selection):null,T=o.awareness.getLocalState();if(T)o.awareness.setLocalState({...T,structuralSelection:x})}),Q(()=>{let x=re(e.doc.document);queueMicrotask(()=>{if(R(e)?.session!==i||!i.synced||!i.canWrite)return;let w=re(e.doc.document);if(w!==x||w===i.lastSeenRef)return;i.lastSeenRef=w,z(i),ee(i)})})});let oe=on(e),ie=()=>{let h=[];for(let[x,T]of o.awareness.getStates())if(x!==o.awareness.clientID&&T.user)h.push({clientId:x,state:T});oe.peers=h};return ie(),o.awareness.on("change",ie),i.disposers.push(()=>o.awareness.off("change",ie),o.onStatus((h)=>{if(h==="offline"||h==="connecting")oe.status="offline";else if(i.synced)oe.status="synced"}),o.onReset(()=>{te(e),Pe(e)})),i.synced=!0,i}function C(e,t,n){return RangeError(`command "${e}" argument "${t}": ${n}`)}function O(e){if(e===void 0)return"missing";return typeof e==="string"?`"${e}"`:`${typeof e} ${JSON.stringify(e)}`}function ot(e,t,n){let o=t[n];if(typeof o!=="string"||o==="")throw C(e,n,`expected a non-empty string, got ${O(o)}`);return o}function Zo(e,t,n){if(t[n]===void 0)return;return ot(e,t,n)}function ft(e,t,n){let o=t[n];if(typeof o!=="number"||!Number.isFinite(o))throw C(e,n,`expected a finite number, got ${O(o)}`);return o}function dt(e,t,n){let o=t[n];if(typeof o!=="number"||!Number.isInteger(o))throw C(e,n,`expected an integer, got ${O(o)}`);return o}function yv(e,t,n,o,r){let i=ft(e,t,n);if(i<o||i>r)throw C(e,n,`${i} is outside the supported range ${o}–${r}`);return i}function yi(e,t,n){let o=t[n];if(typeof o!=="boolean")throw C(e,n,`expected a boolean, got ${O(o)}`);return o}function li(e,t,n,o){let r=t[n];if(typeof r!=="string"||!o.includes(r))throw C(e,n,`${O(r)} is not declared — declared: ${o.join(", ")||"none"}`);return r}function $x(e,t,n){let o=t[n];if(!Array.isArray(o)||!o.every((r)=>typeof r==="string"||typeof r==="number"))throw C(e,n,`expected an array of path segments (strings or numbers), got ${O(o)}`);return o}function ZL(e,t,n){if(t[n]===null)return null;return $x(e,t,n)}function KC(e,t,n){let o=t[n];if(!Array.isArray(o))throw C(e,n,`expected an array of document paths, got ${O(o)}`);return o.map((r,i)=>{if(!Array.isArray(r)||!r.every((s)=>typeof s==="string"||typeof s==="number"))throw C(e,n,`entry ${i} is not a document path — expected an array of segments, got ${O(r)}`);return r})}function ke(e,t=Object.keys(e)){return{additionalProperties:!1,properties:e,required:[...t],type:"object"}}function Ao(e,t){return{description:t,enum:[...e],type:"string"}}function fa(e,t){return{description:t,get enum(){return[...e()]},type:"string"}}function JC(e,t={}){return{description:e,type:"number",...t}}function ro(e){return{description:e,type:"boolean"}}function wv(e,t=!1){let n={items:{type:["string","number"]},type:"array"};return t?{description:e,oneOf:[n,{type:"null"}]}:{description:e,...n}}function XL(e){return{description:e,items:{items:{type:["string","number"]},type:"array"},type:"array"}}function je(e){return{description:e,type:"string"}}function fn(e){return e.length===2&&e.includes("string")&&e.includes("number")}function Oe(e){return Array.isArray(e)?e:[e]}function pt(e){let t=e;if("enum"in t)return"enum";if("const"in t)return"const";if(Array.isArray(t.oneOf))return"one-of";if(Array.isArray(t.type))return"typed";switch(t.type){case"boolean":return"boolean";case"number":case"integer":{if(t.minimum!==void 0&&t.maximum!==void 0)return"bounded-number";return t.type==="integer"?"integer":"number"}case"string":return"string";case"array":{let n=t.items?.type;if(Array.isArray(n))return fn(n)?"path":"pass-through";return n==="array"?"path-list":"pass-through"}case"null":case"object":return"typed";default:break}return"pass-through"}function mt(e,t){switch(e){case"null":return t===null;case"boolean":return typeof t==="boolean";case"string":return typeof t==="string";case"number":return typeof t==="number"&&Number.isFinite(t);case"integer":return typeof t==="number"&&Number.isInteger(t);case"array":return Array.isArray(t);case"object":return typeof t==="object"&&t!==null&&!Array.isArray(t);default:break}return!1}function gt(e){if(e.length<=1)return e.join("");return`${e.slice(0,-1).join(", ")} or ${e.at(-1)}`}function pn(e,t,n,o){let r=t[n];if(!o.some((i)=>mt(i,r)))throw C(e,n,`expected ${gt(o)}, got ${O(r)}`);return r}function bt(e){switch(pt(e)){case"enum":return`one of ${(e.enum??[]).map((t)=>O(t)).join(" | ")}`;case"const":return`the constant ${O(e.const)}`;case"one-of":return(e.oneOf??[]).map((t)=>bt(t)).join(" or ");case"typed":return gt(Oe(e.type??[]));case"boolean":return"a boolean";case"bounded-number":return`a number from ${e.minimum} to ${e.maximum}`;case"number":return"a finite number";case"integer":return"an integer";case"string":return"a non-empty string";case"path":return"a document path";case"path-list":return"a list of document paths";default:return"anything"}}function mn(e,t,n,o){let r=t[n],i=[];for(let s of o){if(s.type!==void 0&&!Oe(s.type).some((a)=>mt(a,r)))continue;try{return yt(e,t,n,s)}catch(a){i.push(a)}}if(i.length===1)throw i[0];throw C(e,n,`expected ${o.map((s)=>bt(s)).join(" or ")}, got ${O(r)}`)}function yt(e,t,n,o){switch(pt(o)){case"enum":return li(e,t,n,o.enum??[]);case"const":{let r=t[n];if(r!==o.const)throw C(e,n,`expected the constant ${O(o.const)}, got ${O(r)}`);return r}case"one-of":return mn(e,t,n,o.oneOf??[]);case"typed":return pn(e,t,n,Oe(o.type??[]));case"boolean":return yi(e,t,n);case"bounded-number":{if(o.type==="integer")dt(e,t,n);return yv(e,t,n,o.minimum,o.maximum)}case"number":return ft(e,t,n);case"integer":return dt(e,t,n);case"string":return ot(e,t,n);case"path":return $x(e,t,n);case"path-list":return KC(e,t,n);default:return t[n]}}function QL(e,t,n){let o=t,r=o.properties??{},i=Object.keys(r),s=o.required??[],a={};for(let[l,c]of Object.entries(n)){if(c===void 0||Object.hasOwn(r,l))continue;if(o.additionalProperties===!1)throw C(e,l,`not declared — declared: ${i.join(", ")||"none"}`);a[l]=c}for(let l of i){if(n[l]===void 0&&!s.includes(l))continue;a[l]=yt(e,n,l,r[l])}return a}var gn=20,An="primary",yp="secondary",eS=2,g=v({activePaneId:An,clipboard:null,closedTabs:[],componentRegistry:[],mruOrder:[],fileTree:{dirs:new Map,expanded:new Set,searchQuery:"",selectedPath:null},panes:[{activeTabId:null,derived:null,id:An,tabOrder:[]}],projectConfig:null,projectRoot:null,styleClipboard:null,tabs:new Map,ui:{activityBar:"files"},get activeTabId(){let e=Bs();return e.derived?.kind==="lens"?Bn(e.derived.sourcePaneId)?.activeTabId??null:e.activeTabId},get tabOrder(){return Bs().tabOrder}}),u=Bd(()=>g.activeTabId?g.tabs.get(g.activeTabId)??null:null);function Bs(){let{panes:e}=g;return e.find((t)=>t.id===g.activePaneId)??e[0]}function Bn(e){return g.panes.find((t)=>t.id===e)}function Gu(e){return g.panes.find((t)=>t.tabOrder.includes(e))}function Rr(e){let t=Bn(e);if(!t||t.id===g.activePaneId)return;g.activePaneId=t.id,A();let{activeTabId:n}=t;if(n){we(n);let o=g.tabs.get(n);if(o)Tt(o)}}function wp(e){return g.activePaneId===e}function Ox(e){let t=e??Bs().activeTabId,n=t?g.tabs.get(t):null;if(!t||!n)return null;let o=Gu(t);if(!o)return null;let r=Pl(o.id);return Cp(t),Ku(r,t),r.activeTabId=t,g.activePaneId=r.id,A(),we(t),r}function Mx(e){return g.panes.find((t)=>t.id!==e)??bn(yp)}function Pl(e){let t=Mx(e);if(t.derived)t.derived=null;return t}function bn(e){let t=Bn(e);if(t)return t;return g.panes=[...g.panes,{activeTabId:null,derived:null,id:e,tabOrder:[]}],Bn(e)}function xp(e){if(g.panes.length<2)return;let t=e===An?g.panes.find((r)=>r.id!==An)?.id:e,n=t===void 0?void 0:Bn(t),o=g.panes.find((r)=>r.id!==t);if(!n||!o)return;for(let r of n.tabOrder)Ku(o,r);if(o.activeTabId=g.activePaneId===n.id?n.activeTabId??o.activeTabId:o.activeTabId??n.activeTabId,g.activePaneId=o.id,o.derived?.sourcePaneId===n.id)o.derived=null;g.panes=g.panes.filter((r)=>r.id!==n.id),A()}function _p(e){return e.tabOrder.length===0&&e.derived===null}function Cp(e){let t=[];for(let n of g.panes){if(!n.tabOrder.includes(e))continue;if(n.tabOrder=n.tabOrder.filter((o)=>o!==e),n.activeTabId===e)n.activeTabId=n.tabOrder.at(-1)??null;if(n.id!==An&&_p(n))t.push(n.id)}for(let n of t)xp(n)}function Ku(e,t,n){if(e.tabOrder.includes(t))return;let o=n??hn(e,t);e.tabOrder=[...e.tabOrder.slice(0,o),t,...e.tabOrder.slice(o)]}function yn(e){let t=0;for(let n of e.tabOrder){if(g.tabs.get(n)?.pinned!==!0)break;t+=1}return t}function hn(e,t){return g.tabs.get(t)?.pinned===!0?yn(e):e.tabOrder.length}function Ua(e,t=null){if(g.projectRoot&&e!==g.projectRoot)Lx();g.projectRoot=e,g.projectConfig=t}function Sp(e){let t=u.value;return e!==null&&t!==null&&re(t)===re(e)}function kc(e){if(!e)return!1;let t=g.tabs.get(e.id);return t!==void 0&&re(t)===re(e)}function we(e){g.mruOrder=[e,...g.mruOrder.filter((t)=>t!==e)]}var ne=null,Z=0;function A(){ne=null,Z=0}function Tt(e){if(D&&e.documentPath)D.selectedPath=e.documentPath}function X(e,t={}){let n=g.tabs.get(e),o=Gu(e);if(!n||!o)return;if(o.activeTabId=e,t.focus===!1)return;if(g.activePaneId=o.id,!t.cycling)A(),we(e);Tt(n)}function Oo(e){let t=g.tabs.get(e.id),n=e.preview===!0&&t?.pinned!==!0,o=cv({...e,preview:n}),r=(e.paneId===void 0?void 0:Bn(e.paneId))??Bs(),i;if(t)o.pinned=t.pinned,mp(t);else{if(n){let a=xt(r),l=a?g.tabs.get(a):null;if(l)kp(l);Px()}let s=n?xt(r):null;if(s)i=r.tabOrder.indexOf(s),Fx(s);Ku(r,o.id,i)}return g.tabs.set(o.id,o),X(o.id,{focus:e.focus!==!1}),Y(o),o}function xt(e){return e.tabOrder.find((t)=>g.tabs.get(t)?.preview===!0)??null}function Fl(e){let t=g.tabs.get(e);if(t?.preview===!0)t.preview=!1}function Px(){for(let[e,t]of g.tabs)if(t.preview&&t.doc.dirty)Fl(e)}function Sv(e,t){let n=g.tabs.get(e),o=Gu(e);if(!n||!o)return;if(n.pinned=t,t)n.preview=!1;let r=o.tabOrder.filter((s)=>s!==e),i=r.filter((s)=>g.tabs.get(s)?.pinned===!0).length;o.tabOrder=[...r.slice(0,i),e,...r.slice(i)]}function tS(e,t){let n=g.tabs.get(e),o=Gu(e);if(!n||!o)return;o.tabOrder=Pt(o,e,t)}function Pt(e,t,n){let o=g.tabs.get(t);if(!o)return e.tabOrder;let r=e.tabOrder.filter((c)=>c!==t),i=r.filter((c)=>g.tabs.get(c)?.pinned===!0).length,s=o.pinned?0:i,a=o.pinned?i:r.length,l=Math.min(Math.max(n,s),a);return[...r.slice(0,l),t,...r.slice(l)]}function Fx(e){let t=g.tabs.get(e);if(!t)return;let n=Gu(e),o=n?.activeTabId===e;if(xn(t),mp(t),g.tabs.delete(e),Cp(e),g.mruOrder=g.mruOrder.filter((s)=>s!==e),A(),n&&_p(n))xp(n.id);if(!o)return;let r=Bs(),i=g.mruOrder.find((s)=>r.tabOrder.includes(s))??r.tabOrder.at(-1)??null;if(i)X(i)}function nS(){let e=[...g.tabs.values()];g.tabs.clear(),Ot(),g.mruOrder=[],A();for(let t of e)mp(t)}function Ot(){g.panes=[{activeTabId:null,derived:null,id:An,tabOrder:[]}],g.activePaneId=An}function xn(e){if(!e.documentPath)return;let t=e.documentPath;g.closedTabs=[{documentPath:t},...g.closedTabs.filter((n)=>n.documentPath!==t)].slice(0,gn)}function vn(){let[e]=g.closedTabs;if(!e)return;return g.closedTabs=g.closedTabs.slice(1),e.documentPath}function vt(e){if(!ne)ne=g.mruOrder.filter((o)=>g.tabs.has(o)),Z=0;let t=ne;if(t.length<2)return;Z=((Z+e)%t.length+t.length)%t.length;let n=t[Z];return X(n,{cycling:!0}),n}function iS(e){let t=[...g.tabs.keys()],n=[...g.tabs.values()],o=cv(e);g.tabs.set(o.id,o),Ot(),g.panes[0].tabOrder=[o.id],g.mruOrder=[],A(),X(o.id),Y(o);for(let r of t){if(r===o.id)continue;g.tabs.delete(r)}for(let r of n)mp(r);return o}function ci(e,t={}){X(e,t)}function Em(e,t,n){let o=Bn(t);if(!o||!g.tabs.has(e))return null;if(o.tabOrder.includes(e)){if(n!==void 0)o.tabOrder=Pt(o,e,n);return o}return Cp(e),Ku(o,e,n),o}function kv(e,t,n){let o=g.tabs.get(e);if(!o)return;o.id=t,o.documentPath=n,g.tabs.delete(e),g.tabs.set(t,o);for(let r of g.panes)if(r.tabOrder=r.tabOrder.map((i)=>i===e?t:i),r.activeTabId===e)r.activeTabId=t;g.mruOrder=g.mruOrder.map((r)=>r===e?t:r),A(),ut(o)}function oS(e,t){e.registerAll([...Tn(t),...Pn(t)])}function Tn(e){let t=()=>g.tabs.size>1;return[{id:"document.nextTab",title:"Next Tab",category:"Document",level:"document",keybinding:["ctrl+tab","mod+tab"],menus:["palette"],group:"2_navigate",when:(n)=>n.document.open,enablement:t,requires:"a second open document",run:()=>{vt(1)}},{id:"document.previousTab",title:"Previous Tab",category:"Document",level:"document",keybinding:["ctrl+shift+tab","mod+shift+tab"],menus:["palette"],group:"2_navigate",when:(n)=>n.document.open,enablement:t,requires:"a second open document",run:()=>{vt(-1)}},{args:ke({path:je('Project-relative path of the file to open, e.g. "pages/about.json" or "components/nav-bar.json". It must exist.')}),id:"document.open",title:"Open Document",category:"Document",level:"project",menus:["palette"],group:"1_file",when:(n)=>n.project.open,requires:"an open project",aiTool:{description:"Open a project file as the active document; the document tools then operate on it. Use it when the user should SEE the page, or for iterative visual refinement after creating a page or component.",name:"open_document",report:({after:n,args:o})=>{let r=ot("document.open",o,"path"),i=u.value?.documentPath??null;if(i!==r)return`Opened "${r}", but the active document is ${i===null?"none":`"${i}"`}.`;let s=n.editor.kind==="canvas"?"on the canvas; the document tools now operate on it":`in the ${Wu[n.editor.kind]} editor, which is not an element tree the document tools can edit`;return`"${r}" is the active document, ${s}.`}},run:async(n,o)=>{let r=ot("document.open",o,"path");if(await e.openFile(r),![...g.tabs.values()].some((i)=>i.documentPath===r))throw RangeError(`command "document.open" argument "path": "${r}" could not be opened — it does `+"not exist, or no editor claims its format. Problems has the reason.")}},{args:ke({file:je('Project-relative path of the file to open in the other pane, e.g. "pages/about.json". It must exist.')}),id:"document.openToSide",title:"Open to the Side",category:"Document",level:"project",menus:["context/file","palette"],group:"1_file",when:(n)=>n.project.open,requires:"an open project",undo:"none",run:async(n,o)=>{let r=ot("document.openToSide",o,"file"),i=Pl(Bs().id);if(await e.openFile(r,{paneId:i.id}),![...g.tabs.values()].some((s)=>s.documentPath===r)){if(_p(i)&&i.id!==An)xp(i.id);throw RangeError(`command "document.openToSide" argument "file": "${r}" could not be opened — it `+"does not exist, or no editor claims its format. Problems has the reason.")}}},{id:"document.reopenClosed",title:"Reopen Closed Document",category:"Document",level:"document",keybinding:"mod+shift+t",menus:["context/tab","palette"],group:"1_file",enablement:()=>g.closedTabs.length>0,requires:"a document closed in this session",run:async()=>{let n=vn();if(n)await e.openFile(n)}},{id:"document.togglePinned",title:"Pin / Unpin Document",category:"Document",level:"document",menus:["context/tab","palette"],group:"1_file",when:(n)=>n.document.open,requires:"an open document",run:()=>{let n=g.activeTabId,o=n?g.tabs.get(n):null;if(n&&o)Sv(n,!o.pinned)}},{args:ke({pinned:ro("True to pin the active document's tab, false to unpin it.")}),id:"document.setPinned",title:"Set Document Pinned",category:"Document",level:"document",menus:["palette"],group:"1_file",when:(n)=>n.document.open,requires:"an open document",run:(n,o)=>{let r=g.activeTabId;if(r&&g.tabs.get(r))Sv(r,yi("document.setPinned",o,"pinned"))}},{id:"document.keepOpen",title:"Keep Document Open",category:"Document",level:"document",menus:["context/tab","palette"],group:"1_file",when:(n)=>n.document.open,enablement:()=>{let n=g.activeTabId;return n!==null&&g.tabs.get(n)?.preview===!0},requires:"a preview document — one opened by a single click",run:()=>{let n=g.activeTabId;if(n)Fl(n)}}]}function Pn(e){let t=()=>g.panes.length>1;return[{id:"pane.splitRight",title:"Split Right",category:"View",level:"document",keybinding:"mod+\\",menus:["context/pane","context/tab","palette"],group:"5_pane",when:(n)=>n.document.open,enablement:()=>g.activeTabId!==null,requires:"an open document",undo:"none",run:()=>{Ox()}},{args:ke({path:je("Project-relative path of the document to open beside this one.")}),id:"pane.compareWith",title:"Compare With…",category:"View",level:"document",menus:["context/pane","context/tab","palette"],group:"5_pane",when:(n)=>n.document.open,enablement:()=>g.activeTabId!==null,requires:"an open document",undo:"none",run:async(n,o)=>{let r=ot("pane.compareWith",o,"path"),i=Bs();if((i.activeTabId?g.tabs.get(i.activeTabId):null)?.documentPath===r)throw RangeError(`command "pane.compareWith" argument "path": "${r}" is the document this pane is `+"already showing — name a different one");await e.openFileInPane(Pl(i.id).id,r)}},{id:"pane.focusPrimary",title:"Focus Primary Pane",category:"View",level:"document",keybinding:"mod+0",menus:["palette"],group:"5_pane",enablement:t,requires:"a split pane grid",undo:"none",run:()=>{Rr(An)}},{id:"pane.focusSecondary",title:"Focus Side Pane",category:"View",level:"document",keybinding:"mod+alt+0",menus:["palette"],group:"5_pane",enablement:t,requires:"a split pane grid",undo:"none",run:()=>{Rr(yp)}},{id:"pane.unsplit",title:"Close Side Pane",category:"View",level:"document",menus:["context/pane","palette"],group:"5_pane",enablement:t,requires:"a second pane",undo:"none",run:On}]}function On(){let e=g.panes.find((t)=>t.derived!==null);if(e?.id===An){if(e.derived=null,!_p(e))return}xp(e?.id??yp)}
2
- export{kx,Jo,rv,SL,un,Do,Bu,kL,WC,zu,Wu,ha,EL,sv,$d,av,wm,Ex,TL,xm,oo,Ki,fp,lv,LL,VC,IL,RL,Tx,$L,Lx,UC,ai,cv,qC,DL,AL,mp,Te,NL,dv,ms,uv,OL,Nl,hv,ML,gp,PL,vi,q,js,pv,fv,Ix,FL,_m,jL,HL,Rx,BL,Ji,Vu,GC,bp,mv,zL,pa,qe,Sc,Yo,WL,gv,VL,bv,UL,qL,Hs,vv,mr,GL,Uu,KL,JL,YL,Ol,on,Cm,ot,Zo,yv,yi,li,$x,ZL,KC,ke,Ao,fa,JC,ro,wv,XL,je,QL,Dx,vp,Ax,Ml,xv,_v,Nx,eI,ma,Dd,qu,Sm,Cv,tI,No,nI,iI,oI,rI,km,YC,ZC,XC,QC,An,yp,eS,g,u,Bs,Bn,Gu,Rr,wp,Ox,Mx,Pl,xp,_p,Cp,Ku,Ua,Sp,kc,Oo,Fl,Px,Sv,tS,Fx,nS,iS,ci,Em,kv,oS};
3
-
4
- //# debugId=6297725DE333B94D64756E2164756E21
5
- //# sourceMappingURL=studio-27tc8q0h.js.map
@@ -1,5 +0,0 @@
1
- var e=new Set;function vE(r){return e.add(r),()=>e.delete(r)}function yE(){let r=[];for(let t of e)try{let o=t();if(o)r.push(o)}catch{}return r}
2
- export{vE,yE};
3
-
4
- //# debugId=2EE4A360C9BE419164756E2164756E21
5
- //# sourceMappingURL=studio-7djymzt2.js.map
@@ -1,5 +0,0 @@
1
- import{te}from"./studio-ery42sqr.js";import{p,We}from"./studio-6k1eswp9.js";import{S}from"./studio-0nm2skex.js";import{u}from"./studio-27tc8q0h.js";import{Op,di,Nv}from"./studio-b29h7g7s.js";import{Ir,ym,CL}from"./studio-k9pwvmz8.js";import{jC,iv,Sx,HC,vm}from"./studio-011em5cf.js";import{D}from"./studio-153mwkyq.js";var Al=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),Ld=new Set([...Al,".mp4",".webm",".mp3",".wav",".ogg",".pdf",".woff",".woff2",".ttf",".otf"]);function m(e){let t=["B","KB","MB","GB"],n=e,r=0;while(n>=1024&&r<t.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${t[r]}`}var h=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function _c(){return(We()?p().assetCapabilities?.accept:void 0)??h}function Gi(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function nv(e){return Al.has(e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`)}function mm(e){return Ld.has(Gi(e))}var x=new Set([".mp4",".webm",".mov",".m4v"]),w=new Set([".mp3",".wav",".ogg",".m4a",".flac"]);function up(e){let t=e.type??"";if(t.startsWith("image/"))return"image";if(t.startsWith("video/"))return"video";if(t.startsWith("audio/"))return"audio";let n=Gi(e.name);if(Al.has(n))return"image";if(x.has(n))return"video";if(w.has(n))return"audio";return"file"}var v=/^content\/([^/]+)\//;function A(e){let t=e?v.exec(e.replaceAll("\\","/")):null;return t?`content/${t[1]}/images`:"public"}function b(e){let t=e.replaceAll("\\","/");if(t.startsWith("public/"))return t.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(t);if(n)return`./${n[1]}`;return`./${t}`}function y(e,t){if(!t.has(e))return e;let n=Gi(e),r=n?e.slice(0,-n.length):e;for(let i=1;;i++){let s=`${r}-${i}${n}`;if(!t.has(s))return s}}function E(e,t){let n=e.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?t:`${n}/${t}`}var g=null;function wL(e){g=e}async function Va(e,t={}){let n=[...e];if(n.length===0)return[];let r=p(),i=t.dir??A(u.value?.documentPath??null),s;try{let o=await Ir(()=>r.listDirectory(i));s=new Set(o.map((c)=>c.name))}catch{s=new Set}let f=We()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let o of n){if(f!==void 0&&o.size>f){S.error(`${o.name} is too large.`,{detail:`This backend accepts at most ${m(f)}; that file is ${m(o.size)}.`,source:"Media"});continue}let c=y(o.name,s);s.add(c);let d=E(i,c);try{let{path:l}=await r.uploadFile(d,o);ym([l]),a.push({kind:up(o),name:c,path:l,ref:b(l)})}catch(l){S.error(`Could not upload ${o.name}.`,{detail:te(l),path:d,source:"Media"})}}if(a.length>0)S.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await g?.(i);return a}function xL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)}function _L(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}function C(){return D?.projectConfig?.content??null}function I(e){return iv(e,C(),HC())}function N(e,t){return`${di(t.urlPrefix)}/${e.slice(t.dir.length+1)}`}function Id(e){let t=di(e);if(t.startsWith(`${Op}/`))return`/${t.slice(Op.length+1)}`;let n=I(t);return n?`/${N(t,n)}`:`/${t}`}function Hu(e){let t=di(e);if(t==="")return e;let{space:n,fileBaseUrl:r}=vm();if(n==="repo")return jC(`${r}${Nv(t)}`,CL(t));return Sx(Id(t))}
2
- export{Al,Ld,_c,Gi,nv,mm,up,wL,Va,xL,_L,Id,Hu};
3
-
4
- //# debugId=F69348F1729C052E64756E2164756E21
5
- //# sourceMappingURL=studio-ant1zbp3.js.map
@@ -1,5 +0,0 @@
1
- function u(t){let n=t.replaceAll("\\","/");return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function a(t){let n=u(t);return n.startsWith("/")?n:`/${n}`}function p(t,n){return[...t].toSorted((e,s)=>s[n].length-e[n].length)}function f(t,n){return t===n||t.startsWith(`${n}/`)}function $I(t,n){let e=u(n);for(let s of p(t,"dir")){let r=u(s.dir);if(!f(e,r)||e===r)continue;let o=e.slice(r.length+1).split("/").map((l)=>encodeURIComponent(l)).join("/");return`${a(s.urlPrefix)}/${o}`}return null}function g(t,n){let e=n.split("#")[0].split("?")[0];if(!e.startsWith("/"))return null;let s;try{s=decodeURIComponent(e)}catch{return null}if(/%2e|%2f/i.test(s))return null;for(let r of p(t,"urlPrefix")){let i=a(r.urlPrefix);if(!s.startsWith(`${i}/`))continue;let l=s.slice(i.length+1).split("/");if(l.some((c)=>c===""||c==="."||c===".."))return null;return`${u(r.dir)}/${l.join("/")}`}return null}var d=String.raw`"'\s<>()\\`;var Op="public";var DI=["mounts","public"];function Av(t){let n=t.search(/[#?]/);return n===-1?{path:t,suffix:""}:{path:t.slice(0,n),suffix:t.slice(n)}}function LS(t){return t===""||t.startsWith("/")||t.startsWith("#")||t.includes("${")||/^[a-z][\w+.-]*:/i.test(t)}function di(t){return t.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function AI(t){let n=di(t),e=n.lastIndexOf("/");return e===-1?"":n.slice(0,e)}function IS(t,n){let s=(t===""||t==="."?[]:di(t).split("/")).filter((r)=>r!==""&&r!==".");for(let r of n.replaceAll("\\","/").split("/")){if(r===""||r===".")continue;if(r===".."){if(s.length===0)return null;s.pop();continue}s.push(r)}return s.join("/")}function h(t,n,e){let{path:s}=Av(t);if(!s.startsWith("/"))return[];let r;try{r=decodeURIComponent(s)}catch{return[]}if(/%2e|%2f/i.test(r))return[];let i=r.replace(/^\/+/,"");if(i===""||i.split("/").some((l)=>l==="."||l===".."))return[];let o=[];for(let l of e){if(l==="mounts"){let c=g(n,s);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))o.push(di(c));continue}o.push(l==="root"?i:`${Op}/${i}`)}return[...new Set(o)]}function NI(t,n,e,s){let{path:r}=Av(t);if(r==="")return null;if(LS(t))return r.startsWith("/")?h(r,e,s)[0]??null:null;if(r.endsWith("/"))return null;let i;try{i=decodeURIComponent(r)}catch{return null}let o=IS(n,i);if(o===null||o===""||o===di(n))return null;return o}function Nv(t){return t.split("/").map((n)=>encodeURIComponent(n)).join("/")}function OI(t){let n=[],e=0;while(e<t.length){while(e<t.length&&(/\s/.test(t[e])||t[e]===","))e+=1;if(e>=t.length)break;let s=e;while(e<t.length&&!/\s/.test(t[e]))e+=1;let r=t.slice(s,e);if(r.endsWith(",")){n.push({descriptor:"",url:r.replace(/,+$/,"")});continue}while(e<t.length&&/\s/.test(t[e]))e+=1;let i=e;while(e<t.length&&t[e]!==",")e+=1;let o=t.slice(i,e).trim();if(e+=1,r=r.replace(/,+$/,""),r!=="")n.push({descriptor:o,url:r})}return n}function MI(t){return t.map(({url:n,descriptor:e})=>e?`${n} ${e}`:n).join(", ")}
2
- export{$I,Op,DI,Av,LS,di,AI,IS,NI,Nv,OI,MI};
3
-
4
- //# debugId=872AA5FECDAE894964756E2164756E21
5
- //# sourceMappingURL=studio-b29h7g7s.js.map
@@ -1,5 +0,0 @@
1
- import{p,We}from"./studio-6k1eswp9.js";import{te}from"./studio-ery42sqr.js";import{Fs,K1}from"./studio-81twpmzj.js";import{ge,Xa,Q,v,re,Zi,Jr,S,tl,lh,Fp}from"./studio-0nm2skex.js";import{Wu,Te,q,_m,Sc,Yo,gv,bv,on,ma,km,YC,An,g,u}from"./studio-27tc8q0h.js";import{qt,wi,Ip,Zt,$r,hS,Us,pS}from"./studio-ft8pfpp0.js";import{mm}from"./studio-ant1zbp3.js";import{TS,TI,LI,Fd,zm,ne}from"./studio-dknr8m7b.js";import{xi,T,R,rn,Qo}from"./studio-z1vdxq0e.js";import{$t}from"./studio-ks0ecgjx.js";import{hs,pr,y}from"./studio-w8w9frjy.js";import{sT}from"./studio-sadckcpp.js";import{mc}from"./studio-b5rxwkj2.js";import{la,kb}from"./studio-sgzss898.js";import{st,Go,ET,aC}from"./studio-pvj970st.js";import{_b}from"./studio-36s6qjgq.js";import{K,so,Xo,Mo,D,Hx}from"./studio-153mwkyq.js";import{Ve}from"./studio-p6avneaq.js";var xe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJumpBar",$description:"The jump bar: one pane's address, outermost step first, every step a command the adapter has already resolved against the registry. A step is a button when its command can run and a readout when it cannot — an address with a hole in it is a lie about containment, so a step never disappears. A step with more than one place to go carries the chevron that opens its siblings; one alternative is not a choice and draws no control. Nothing here decides what the bar says, which step is where you are, or what a chevron opens.",tagName:"nav",attributes:{part:"bar","aria-label":"Location","data-jx-region":"${state.region}",hidden:"${state.empty ? '' : null}"},style:{$description:"The `.jump-bar` rules the bar used to take from `styles/shell.css`, brought here and re-valued onto the kit's own layer. It scrolls rather than wraps — a deep selection must not push the stage down by a second line — and the overflow is taken at the START, because the leaf is the part being read. The height is the one number this file shares with its adapter: the stage's `--jump-bar-h` offset must be the box this rule draws.",display:"flex",alignItems:"center",gap:"1px",height:"24px",padding:"0 var(--jx-space-3)",minWidth:"0",overflowX:"auto",scrollbarWidth:"none",whiteSpace:"nowrap",boxSizing:"border-box",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-dim)",background:"var(--jx-bg-panel)",borderBottom:"1px solid var(--jx-border)","&[hidden]":{display:"none"},"&::-webkit-scrollbar":{display:"none"},'& [part="step"]':{display:"flex",alignItems:"center",flexShrink:"0"},'& [part="separator"]':{flexShrink:"0",padding:"0 1px",color:"var(--jx-fg-dim)",opacity:"0.6"},'& [part="crumb"]':{maxWidth:"28ch",overflow:"hidden",margin:"0",padding:"0 var(--jx-space-2)",border:"none",borderRadius:"var(--jx-radius-xs)",background:"transparent",color:"inherit",font:"inherit",lineHeight:"1",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& button[part="crumb"]':{cursor:"pointer",":hover:not(:disabled)":{color:"var(--jx-fg)",background:"var(--jx-hover-bg)"},":disabled":{cursor:"default",opacity:"0.6"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="crumb"][aria-current]':{$description:"Where you ARE is stated by weight, not by taking the control away: the leaf still selects, which is how a stray click in the canvas is undone without leaving the bar.",color:"var(--jx-fg)"},'& span[part="crumb"]':{$description:"A step with no runnable command is a readout, not a dead button. No hover, no pointer, no promise.",cursor:"default"},'& [part="alternatives"]':{padding:"0 1px",border:"none",borderRadius:"var(--jx-radius-xs)",background:"transparent",color:"inherit",font:"inherit",lineHeight:"1",cursor:"pointer",":hover":{color:"var(--jx-fg)",background:"var(--jx-hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}}},children:[{$prototype:"Array",items:{$ref:"#/state/segments"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"step","data-jump-kind":"${$map.item.kind}"},children:[{tagName:"span",attributes:{part:"separator-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/leading"},cases:{false:{tagName:"span",attributes:{part:"separator","aria-hidden":"true"},textContent:"›"}}},{tagName:"span",attributes:{part:"crumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/control"},cases:{button:{tagName:"button",attributes:{part:"crumb",type:"button",title:"${$map.item.title}","aria-current":"${$map.item.current ? 'true' : null}",disabled:{$ref:"$map/item/disabled"}},textContent:"${$map.item.label}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/key"}]}]}},readout:{tagName:"span",attributes:{part:"crumb",title:"${$map.item.title}","aria-current":"${$map.item.current ? 'true' : null}"},textContent:"${$map.item.label}"}}},{tagName:"span",attributes:{part:"alternatives-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChoices"},cases:{true:{tagName:"button",attributes:{part:"alternatives",type:"button","aria-haspopup":"menu","aria-label":"${$map.item.altsLabel}",title:"${$map.item.altsLabel}"},textContent:"⌄",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]}}}}]}}]};T("jump-bar",xe);function Se(e,t,r){let n=v({...r,empty:!0,region:t,segments:[]});e.replaceChildren();let l=null,i=!1;return R("jump-bar",n,e).then((d)=>{if(i){d.dispose();return}l=d}),{dispose(){i=!0,l?.dispose(),l=null,e.replaceChildren()},update(d){n.segments=[...d],n.empty=d.length===0}}}var ke={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPaneGrid",$description:"The pane grid (studio.md §18.1): one cell per pane, with a splitter before every cell but the first. Every box here is EMPTY by design — the FIVE inside a cell are hosts other modules fill (`panels/tab-strip.ts` the strip, `panels/jump-bar.ts` the jump bar, `panels/pane-context.ts` the chrome layer, `canvas/canvas-render.ts` the stage, `panels/pane-grid.ts` itself the right-edge drop zone), and the stage is an ISLAND in the studio-ui-guidelines.md §9.4 sense: the canvas host mounts a cross-origin `<iframe>` into it, so nothing this document draws may ever go inside it. What the document owns is the STRUCTURE and the STYLE — the cell's own two-row grid, the three row-2 children that share its lower cell, and the splitter — which is `styles/shell.css`'s `.pane*` block and `styles/canvas.css`'s `.pane-stage` rule, carried here and keyed on `part`. Two things are load-bearing and easy to undo. (1) **A row that moves reloads an iframe**, so the keyed `$map` is not an optimisation: `workspace.panes[0]` is always the primary and `MAX_PANES` is 2, the key is the pane id, and the runtime's forward-cursor pass therefore never moves a kept row — gaining or losing the side pane leaves the primary's node, and the frame inside it, untouched. (2) **The splitter must sit BETWEEN two cells and inside neither**, so each row is a `display: contents` wrapper holding its own leading splitter and its cell: the wrapper generates no box, so the splitter and the two cells are the grid items of `#pane-grid` in DOM order, and a pointer landing on the splitter is in no cell at all. Every selector below is a `>` chain from the root, because a pane's stage hosts other surface documents and a bare `[part=\"row\"]` descendant rule would reach into them.",tagName:"div",attributes:{part:"grid",role:"none"},style:{$description:"The pane's own layout, and the splitter's. The tracks of `#pane-grid` ITSELF are not here and must not be: the track count depends on `workspace.panes.length` and the split on `shell.paneSplit`, which is written on every `pointermove` of a drag — `panels/pane-grid.ts` writes them as one inline `grid-template-columns` on the host, so a drag moves a track edge and never a node. The splitter's own paint is not here either: `jx-split` owns the hairline, the cursors and the drag state it mirrors as `data-dragging`, so this block says only where the element is placed.",display:"contents",'& > [part="row"]':{$description:"One pane's row: its leading splitter and its cell, generating no box of their own so both are grid items of `#pane-grid`.",display:"contents"},'& > [part="row"] > [part="splitter-slot"]':{display:"contents"},'& > [part="row"] > [part="splitter-slot"] > jx-split':{$description:"WHERE the splitter sits, and nothing about what it looks like: the hairline, the two cursors, the hover and drag colours and the focus ring are `jx-split`'s own, and the `.dragging` class this block used to name is gone with the module that wrote it — the element mirrors its own gesture as `data-dragging` and paints itself. BOTH grid axes are `auto`: a definite row position — the `2 / 4` a column handle inherits on the APP grid, or the `1 / -1` this rule used to carry — moves the item into an earlier step of CSS Grid's auto-placement, so the splitter claimed column 1 and the two cells flowed around it into the 5px track and the second half. DOM order was already right; the placement algorithm was not reading it. `width: auto` with `justify-self: stretch` is what hands the thickness back to the TRACK `panels/pane-grid.ts` writes, so the element's own 5px default cannot disagree with the column it is placed in.",gridRow:"auto",gridColumn:"auto",justifySelf:"stretch",margin:"0",width:"auto",zIndex:"10"},'& > [part="row"] > [part="pane"]':{$description:'ONE PANE, and one COLUMN, declared. Four children name `grid-row: 2` in order to share the lower cell, and auto-placement answers that by inventing an implicit column each: the jump bar, the chrome layer, the stage and the drop zone lined up side by side, the stage taking a third of the pane and pinning the document to the right edge. `grid-template-columns` is what makes "share the cell" mean it, and every row-2 child restates `grid-column: 1` so a future fifth one cannot re-open the same hole. No unit test can see this — happy-dom does no layout, so every rect is zero — which is why the screenshot lane is what caught it.',display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"auto minmax(0, 1fr)",minWidth:"0",minHeight:"0"},'& > [part="row"] > [part="pane"] > [part="strip"]':{gridRow:"1",gridColumn:"1",minHeight:"0",minWidth:"0"},'& > [part="row"] > [part="pane"] > [part="strip"]:empty':{$description:"A pane with nothing to say costs no band. The strip host is empty until `panels/tab-strip.ts` mounts a document into it, and empty again the moment it disposes.",display:"none"},'& > [part="row"] > [part="pane"] > [part="jump"]':{$description:"The jump bar. Like the chrome layer below it this shares the pane's lower cell rather than owning a row, so the two bars stack OVER the stage instead of pushing it down. `align-self: start` is what keeps it the height of its own content instead of the height of the cell, so the bar never covers the stage it sits above.",gridRow:"2",gridColumn:"1",alignSelf:"start",position:"relative",zIndex:"3",minWidth:"0",maxWidth:"100%"},'& > [part="row"] > [part="pane"] > [part="chrome"]':{$description:'The pane context bar and the floating zoom pod. The layer itself is inert and only its children take the pointer; `surfaces/pane-context.json` owns what they look like. Offset by `--jump-bar-h` for the same reason the stage is: the jump bar is stacked over this same cell, and one projection per bar is what keeps "no tab open" costing no dead band.',gridRow:"2",gridColumn:"1",marginTop:"var(--jump-bar-h, 0px)",position:"relative",zIndex:"2",minWidth:"0",display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none"},'& > [part="row"] > [part="pane"] > [part="chrome"] > *':{pointerEvents:"auto"},'& > [part="row"] > [part="pane"] > [part="pane-stage"]':{$description:"The stage: the pane's own axis (`styles/canvas.css`) over its placement in the cell (`styles/shell.css`). Offset by the SUM of the two bars stacked over this cell — `--jump-bar-h` (written by `panels/jump-bar.ts`) and `--pane-context-h` (by `panels/pane-context.ts`), both onto the CELL, which is why this reads them by cascade — so neither ever covers the document, and by zero when no tab is open, so the welcome screen does not sit under a band nothing explains. Two variables rather than one total: each bar owns its own answer, and a bar that renders nothing writes 0 without knowing the other exists.",gridRow:"2",gridColumn:"1",marginTop:"calc(var(--jump-bar-h, 0px) + var(--pane-context-h, 0px))",position:"relative",overflow:"auto",background:"var(--bg-panel)",minWidth:"0",display:"flex",gap:"var(--jx-space-6)",alignItems:"flex-start"},'& > [part="row"] > [part="pane"] > [part="drop-zone"]':{$description:"The right-edge target that creates a second pane (§18.1). Sits ABOVE the stage (`z-index: 4` against the stage's own stacking, jump's 3, chrome's 2) so a drag reaches it before it reaches the cross-origin iframe underneath, which would otherwise swallow every drag event with no affordance to say so. `pointer-events: none` when unarmed — a mouse doing anything other than dragging a tab or a file must pass straight through to the stage — and `auto` only while `data-armed` is set, which `panels/pane-grid.ts`'s own arming monitor writes for the DURATION of a drag it recognises, never for a click.",gridRow:"2",gridColumn:"1",position:"relative",zIndex:"4",minWidth:"0",pointerEvents:"none"},'& > [part="row"] > [part="pane"] > [part="drop-zone"][data-armed]':{pointerEvents:"auto"},'& > [part="row"] > [part="pane"] > [part="drop-zone"][data-over]::after':{$description:"The right BAND, not the whole cell: the zone only ever ACCEPTS a drop in that band (`panels/pane-grid.ts`'s `edgeData`), so lighting the whole cell would promise a drop this element refuses everywhere else in it.",content:'""',position:"absolute",insetBlock:"0",insetInlineEnd:"0",insetInlineStart:"50%",background:"color-mix(in srgb, var(--accent) 14%, transparent)",borderInlineStart:"2px solid var(--accent)"}},children:[{$description:"Keyed on the PANE ID, and that is the whole of §18.1 rule 1's structural half: the key is what makes the runtime MOVE a kept row rather than rebuild it, and re-parenting is not a move for an `<iframe>` — it reloads, dropping its `iframe-channel` connection, its shadow document and every `ready` panel with it. A row renders complete (its cell, its five hosts and its splitter) inside the row's own effect scope before it is inserted, so there is no frame in which a cell exists with no stage inside it.",$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"row",role:"none"},children:[{$description:"Present on every cell but the first. It is a child of the ROW rather than of either cell, so a splitter drag never reaches the cell's pane-focus listener — and it is created and destroyed with the second pane, so nothing re-inserts it while a pointer capture is live.",tagName:"div",attributes:{part:"splitter-slot",role:"none"},$switch:{$ref:"$map/item/split"},cases:{shown:{$description:'`jx-split` (ui.md §5.5), which is where `role="separator"`, the tab stop, `aria-valuenow` and the whole keyboard now live. This document used to write the role on a bare div and hand the div to `ui/panel-resize.ts`, which made the pane split the one dock-sized thing in Studio a reader could not move without a mouse — an SC 2.1.1 failure with a drag handle drawn on it, and an SC 2.5.7 one besides. Every prop below is a CONSTANT except `value`: `min` and `max` are the shell\'s own supported range, and `gap` is the pixel floor the element converts against the track it measures itself, which is why nothing here has to be recomputed when the window resizes. `collapse` is the even split rather than the floor, because both sides of this splitter are real panes: the first Enter or double click is the 50/50 reset this gesture has always been, and the second one is the return trip it never had.',tagName:"jx-split",attributes:{part:"splitter"},$props:{label:"Pane split",value:{$ref:"#/state/paneSplit"},min:{$ref:"#/state/splitMin"},max:{$ref:"#/state/splitMax"},gap:{$ref:"#/state/splitGap"},collapse:{$ref:"#/state/splitDefault"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/move"},value:[{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/settle"},value:[]}]}}}},{$description:'One pane\'s cell. `pane.<id>` goes on the STAGE and `pane.<id>/tabs` on the strip, never on this element: nine shots crop `pane.primary` meaning "the canvas", and moving the id up one level would silently widen all nine to include the strip and the two bars, which no gate can tell from an intended crop.',tagName:"div",attributes:{part:"pane","data-pane-id":"${$map.item.id}"},children:[{tagName:"div",attributes:{part:"strip","data-jx-region":"${$map.item.stripRegion}"}},{$description:"The jump bar and the context bar are HANDED this box rather than resolving a region into it. They cannot resolve one the way the strip does: nothing inside the strip re-stamps `pane.<id>/tabs`, while both bars stamp `pane.<id>/jump` and `pane.<id>/context` on markup they render INSIDE these two divs — so a region on the wrapper as well would put the same id on two nested elements, and `resolveRegion` takes the LAST match. Sixty shots crop `pane.primary/context`; a second, larger element carrying it is a silently widened crop.",tagName:"div",attributes:{part:"jump"}},{tagName:"div",attributes:{part:"chrome"}},{$description:"Drawn EMPTY and left empty. `canvas/canvas-render.ts` is this element's render root and `canvas/iframe-host.ts` mounts the artboards' iframes into it; a node cannot have two owners of its child list.",tagName:"div",attributes:{part:"pane-stage","data-jx-region":"${$map.item.region}"}},{$description:"The right-edge drop target (§18.1). No `data-jx-region`: `pane.<id>` uniqueness names the stage, and a second element answering to it would be a silently widened crop the moment a shot cropped this pane.",tagName:"div",attributes:{part:"drop-zone",role:"none","data-armed":"${state.armed ? '' : null}","data-over":"${state.edgePane === $map.item.id ? '' : null}"}}]}]}}]};T("pane-grid",ke);var Ye="pane",Qe="pane-stage",Zf=`[part="${Ye}"]`,zE=`[part="${Qe}"]`,Xe=new Map([["pane","pane"],["strip","strip"],["jump","jump"],["chrome","chrome"],["pane-stage","stage"],["drop-zone","dropZone"]]);function Ze(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function et(e){let t=e?.$map?.item;return typeof t?.id==="string"?t.id:""}function WE(e,t,r,n){e.replaceChildren();let l=v({armed:!1,edgePane:"",move:n.move,paneSplit:r.value,rows:t,settle:n.settle,splitDefault:r.collapse,splitGap:r.gap,splitMax:r.max,splitMin:r.min}),i=null,d=!1,h=R("pane-grid",l,e,{onNodeCreated:(c,w,x,E)=>{let G=Xe.get(Ze(x));if(G)n.cellPart(et(E),G,c)}}).then((c)=>{if(d){c.dispose();return}i=c});return{dispose(){d=!0,i?.dispose(),i=null,e.replaceChildren()},drag(c){l.armed=c.armed,l.edgePane=c.edgePane},ready:h,update(c,w){l.rows=c,l.paneSplit=w}}}var tt="--jump-bar-h",rt=24;function le(e){if(!e)return"Untitled";let t=D?.projectRoot;return t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e}function nt(e,t){let r=[];for(let n=0;n<t.length;){let l=t[n],i=l==="map"?1:2,d=t.slice(0,n+i),h=K(e,d),c=h?.tag,w=h?.$prototype==="Array"?"Repeater":Ve(h?.tagName)||(typeof c==="string"?c:"")||(l==="cases"?String(t[n+1]):`[${t[n+1]}]`);r.push({label:w,path:d}),n+=i}return r}function ot(e,t,r){let n=t[r];if(!n)return[];let l=r===0?[]:t[r-1].path,i=K(e,l),d=n.path.at(-2),h=n.path;if(d==="cases"){let w=i?.cases;if(!w||typeof w!=="object")return[];return Object.keys(w).map((x)=>{let E=[...l,"cases",x];return $e(e,E,x,h)})}if(d!=="children")return[];let c=[];for(let[w,x]of so(i).entries()){if(typeof x==="string")continue;let E=[...l,"children",w];c.push($e(e,E,Mo(x),h))}return c}function $e(e,t,r,n){let l=K(e,t),i=l?Mo(l):r,d={args:{path:t},command:"selection.set",label:i};return Xo(t,n)?{...d,current:!0}:d}function it(e,t=null){if(!e)return[];let r=[],n=D;if(n)r.push({choices:[],command:"project.openRecent",kind:"project",label:n.name,title:n.projectRoot});r.push({choices:[],command:t?"pane.pin":"palette.openFiles",kind:"file",label:le(e.documentPath),title:e.documentPath??"Not saved to disk yet"});let l=e.session.ui.editingFunction,i=e.session.ui.editingFormula;if(l)return r.push(Pe("ƒ",l)),r;if(i)return r.push(Pe("fx",i)),r;let d=Te(e.session.selection);if(d&&d.length>0){let h=nt(e.doc.document,d);for(let[c,w]of h.entries()){let x=K(e.doc.document,w.path);r.push({args:{path:w.path},choices:ot(e.doc.document,h,c),command:"selection.set",kind:"node",label:c===h.length-1&&x?Mo(x):w.label,title:w.path.join(" / ")})}}return r}function Pe(e,t){return{choices:[],command:null,kind:"editor",label:`${e} ${t.defName??t.eventKey??"editor"}`}}function at(e){let t=e.args?.path;return e.kind==="node"&&Array.isArray(t)?`node:${t.join("/")}`:e.kind}function lt(e,t){return t!==null&&Boolean(e?.get(t))&&e.isVisible(t)}function dt(e,t,r){let n=e.get(r),l=e.disabledReason(r),i=e.keymap.formatBinding(r),d=l?`${n.title} — requires ${l}`:i?`${n.title} (${i})`:n.title;return t.title?`${t.title} · ${d}`:d}function ct(e,t,r,n){let l=t.command,i=lt(e,l);return{altsLabel:`Siblings of ${t.label}`,control:i?"button":"readout",current:n,disabled:i&&e.disabledReason(l)!==void 0,hasChoices:e!==null&&t.choices.length>1,key:at(t),kind:t.kind,label:t.label,leading:r,title:i?dt(e,t,l):t.title??t.label}}var F=new Map,H=null,N=null;function de(){let e=N;N=null,e?.close()}function ut(e,t){let r=ne();if(!r)return;de();let n=e.choices.map((i,d)=>({checked:i.current===!0?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:String(d),run:()=>{rn(r,i.command,i.args,"Jump Bar")},title:i.label}));N=$t({label:`Go to a sibling of ${e.label}`,onClosed:(i)=>{if(N===i)N=null},opener:t,region:"jump-bar",rows:n})}function U(e,t){(t?.closest(Zf)??document.documentElement).style.setProperty(tt,`${e}px`)}function pt(e){let t=it(st(e),Go(e)),r=ne();return{segments:t,steps:t.map((n,l)=>ct(r,n,l===0,l===t.length-1))}}function Ce(e){if(F.size===0)return;de();for(let[t,r]of F){if(e!==void 0&&t!==e)continue;let{segments:n,steps:l}=pt(t);r.segments=new Map(l.map((i,d)=>[i.key,n[d]])),r.surface.update(l),U(l.length===0?0:rt,r.host)}}function Hw(e,t){let r=F.get(e);if(r?.host===t)return;if(r)r.surface.dispose(),U(0,r.host),F.delete(e);if(!t)return;let n={host:t,segments:new Map,surface:Se(t,xi(e,"jump"),{choose:(l,i)=>{let d=F.get(e)?.segments.get(l);if(d)ut(d,i)},run:(l)=>{let i=F.get(e)?.segments.get(l),d=ne();if(i?.command&&d)rn(d,i.command,i.args,"Jump Bar")}})};F.set(e,n),Ce(e)}function VE(e){mt(),Hw(An,e),H=ge(),H.run(()=>{Q(()=>{ne(),D?.name;for(let t of g.panes){let r=st(t.id);if(!r)continue;r.doc.document,r.documentPath,r.session.selection.map((n)=>n.join("/")).join("|"),r.session.ui.editingFormula,r.session.ui.editingFunction}Ce()})})}function mt(){de(),H?.stop(),H=null;for(let e of F.values())e.surface.dispose(),U(0,e.host);F.clear(),U(0)}var ce=60000,ue=60*ce,W=24*ue;function pe(e,t=Zi()){let r=Math.max(0,t-e);if(r<ce)return"just now";if(r<ue)return`${Math.floor(r/ce)}m ago`;if(r<W)return`${Math.floor(r/ue)}h ago`;if(r<2*W)return"yesterday";if(r<7*W)return`${Math.floor(r/W)}d ago`;return new Date(e).toLocaleDateString()}function ft(e){let t=e.messageCount;return{key:e.id,meta:`${pe(e.updatedAt)} · ${t} ${t===1?"message":"messages"}`,title:e.title}}function UE(e){return e.map((t)=>ft(t))}var Re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStatusbar",$description:"The status bar: ambient state in the shell's level order, PROJECT then DOCUMENT then SELECTION. The adapter hands in `fields`, each with its region and its items; an item with a command is a button that runs it through `run`, and an item without one is a readout. Nothing here decides what the bar says.",tagName:"div",attributes:{part:"bar"},style:{display:"flex",alignItems:"stretch",flex:"1",minWidth:"0",'& > [part="field"]':{display:"flex",alignItems:"center",gap:"2px",minWidth:"0",padding:"0 var(--jx-space-3)"},'& > [part="field"]:last-child':{overflow:"hidden"},'& > [part="field"] + [part="field"]':{borderLeft:"1px solid var(--jx-border)"},'& [part="item"], & [part="state"]':{maxWidth:"32ch",overflow:"hidden",margin:"0",padding:"0 var(--jx-space-2)",border:"none",borderRadius:"var(--jx-radius-xs)",background:"transparent",color:"inherit",font:"inherit",lineHeight:"1",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& [part="item"]':{cursor:"pointer",":hover:not(:disabled)":{color:"var(--jx-fg)",background:"var(--jx-hover-bg)"},":disabled":{cursor:"default",opacity:"0.6"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="state"]':{cursor:"default"}},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"field","data-jx-region":"${$map.item.region}"},children:[{$prototype:"Array",items:{$ref:"$map/item/items"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"slot"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{button:{tagName:"button",attributes:{part:"item",type:"button",title:"${$map.item.title}",disabled:{$ref:"$map/item/disabled"}},textContent:"${$map.item.label}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/key"}]}]}},state:{tagName:"span",attributes:{part:"state",title:"${$map.item.title}"},textContent:"${$map.item.label}"}}}}]}}]};T("statusbar",Re);var Z=null,Ee=new Map;function je(e){if(e)Ee.set(e,Zi())}function gt(e,t,r){if(r.command===null)return{args:void 0,command:null,disabled:!1,key:`${t}:${r.label}`,kind:"state",label:r.label,title:r.title??r.label};let n=r.command;if(!e?.get(n)||!e.isVisible(n))return null;let l=e.get(n),i=e.disabledReason(n),d=e.keymap.formatBinding(n),h=i?`${l.title} — requires ${i}`:d?`${l.title} (${d})`:l.title;return{args:r.args,command:n,disabled:i!==void 0,key:`${t}:${n}`,kind:"button",label:r.label,title:r.title?`${r.title} · ${h}`:h}}function ee(e,t,r){let n=`statusbar/${t}`,l=r.map((i)=>i===null?null:gt(e,n,i)).filter((i)=>i!==null);if(l.length===0)return null;return{id:t,items:l,region:n}}function yt(e,t){return`${e>0?` ↑${e}`:""}${t>0?` ↓${t}`:""}`}function bt(e){let t=D,{status:r}=y.git,n=Fp(),l=sT(),i=u.value?on(u.value).peers.length:0;return ee(e,"project",[t?{command:"project.openRecent",label:t.name}:{command:"project.open",label:"No project"},r?.isRepo===!0&&r.branch?{command:"panel.focus.git",label:`⑂ ${r.branch}${yt(r.ahead,r.behind)}`,title:`${r.files.length} changed file(s)`}:null,l?{command:l.command,label:l.label,title:l.title}:null,n>0?{args:{tab:"problems"},command:"view.setBottomTab",label:`⚠ ${n}`,title:`${n} problem(s)`}:null,i>0?{command:"collab.showStatus",label:`${i} peer${i===1?"":"s"}`,title:`${i} peer${i===1?"":"s"} in this document`}:null])}function wt(e,t){if(e==="none")return"";if(e!=="canvas")return Wu[e];return t.charAt(0).toUpperCase()+t.slice(1)}function vt(e,t,r){if(t)return{command:null,label:"Read-only",title:"A collaborator owns this session's file"};if(e)return{command:"file.save",label:"Unsaved changes"};return r===void 0?{command:null,label:"Saved"}:{command:null,label:`Saved ${pe(r)}`}}function xt(e){let t=u.value;if(!t)return null;let r=e?.context()??null,n=r?wt(r.editor.kind,r.canvas.view):"",l=on(t),i=t.documentPath===null?void 0:Ee.get(t.documentPath);return ee(e,"document",[{command:"palette.openFiles",label:le(t.documentPath),title:t.documentPath??"Not saved to disk yet"},n?{command:null,label:n,title:"The pane's view — change it on the pane context bar"}:null,vt(t.doc.dirty,l.readOnly,i)])}function St(e){let t=u.value?.session.selection??[];if(t.length>0)return t.length>1?ee(e,"selection",[{command:null,label:`${t.length} selected`,title:`${t.length} elements are selected; the jump bar names the primary`}]):null;return y.stylebook.selection?ee(e,"selection",[{command:null,label:y.stylebook.selection.replaceAll(" "," › "),title:"The style rule being edited"}]):null}function kt(){let e=ne();return[bt(e),xt(e),St(e)].filter((t)=>t!==null)}var Y=null,J=null,X=null;function Ge(){return Y??=v({fields:[],run:(e)=>{let t=Y?.fields.flatMap((n)=>n.items).find((n)=>n.key===e),r=ne();if(t?.command&&r)rn(r,t.command,t.args,"Status Bar")}}),Y}function Pt(){if(J||!Hx)return;J=R("statusbar",Ge(),Hx),J.then((e)=>{X=e})}function A1(){Ge().fields=kt(),Pt()}function qE(){Ct(),Z=ge(),Z.run(()=>{Q(()=>{ne(),y.stylebook.selection,y.git.status,Jr.length;let e=u.value;if(e)e.doc.document,e.doc.dirty,e.doc.mode,e.documentPath,e.session.selection.map((t)=>t.join("/")).join("|"),e.session.ui.canvasMode,e.session.ui.preview,on(e).peers.length,on(e).readOnly;A1()})})}function Ct(){Z?.stop(),Z=null;let e=J;if(J=null,X)X.dispose(),X=null;else if(e)e.then((t)=>t.dispose());Y=null}var Me={invokerTags:zm,popoverTags:Fd},B="Popover",Rt={display:"document.repairPopoverDisplay","open-display":"document.repairPopoverDisplay",invoker:"document.repairPopoverInvoker",mode:"document.repairPopoverMode"};function Ae(e,t,r,n){let l=`${t}.${r}.${n.join("/")}`,i=e.get(l)??0;return e.set(l,i+1),i===0?l:`${l}#${i}`}function fe(e,t){tl((i)=>i.source===B);let r=new Map,n=TI(e,Me);for(let i of n){let d=i.fix===void 0?void 0:Rt[i.fix];S(i.severity,i.message,{detail:i.detail,key:Ae(r,"popover",i.rule,i.path),source:B,tier:"problem",...d===void 0?{}:{action:d,actionArgs:{path:i.path}},...t===void 0?{}:{path:t}})}let l=ET(e,Me);for(let i of l)S(i.severity,i.message,{detail:i.detail,key:Ae(r,"dialog",i.rule,i.path),source:B,tier:"problem",...t===void 0?{}:{path:t}});return n.length+l.length}function me(e,t){let r=t?.path;if(!Array.isArray(r))throw RangeError(`command "${e}" needs a "path" argument naming the popover`);return r}function oe(e){let t=u.value;if(!t)throw RangeError(`command "${e}" needs an open document`);return t}function Et(){return[{category:"Document",group:"2_document",id:"document.checkPopovers",level:"document",menus:["palette"],requires:"an open document",run:()=>{let e=oe("document.checkPopovers"),t=fe(e.doc.document,e.documentPath??void 0);S.success(t===0?"No popover problems found in this document.":`${t} popover problem(s) filed.`,{key:"popover.run",source:B})},title:"Check Popovers",when:(e)=>e.document.open,aiTool:{description:"Check the open document for popover defects an author can fix — a base-rule `display` "+"that defeats the browser's own hiding of a closed popover, `popovertarget` on an "+"element that cannot invoke, a target naming no popover, a cut exit animation — and "+"file each as a Problem. The findings come back as data.",name:"check_popovers",report:()=>{let e=lh(B),t=e.length;return{data:e,summary:t===0?"No popover problems found in this document.":`Filed ${t} popover problem${t===1?"":"s"} in Problems.`}}}},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverDisplay",level:"document",menus:[],requires:"a popover whose base rule sets display",run:(e,t)=>{let n=oe("document.repairPopoverDisplay"),l=me("document.repairPopoverDisplay",t),i=K(n.doc.document,l),d=LI(i?.style);if(!d)throw RangeError(`command "${"document.repairPopoverDisplay"}": nothing to move — this popover sets no display`);q(n,(h)=>{for(let c of d.base)Sc(h,l,c,"");for(let c of d.breakpoints)bv(h,l,[c],"display","");if(d.openDisplay!==null)gv(h,l,":popover-open","display",d.openDisplay)}),S.success("Moved `display` into `:popover-open`.",{key:"popover.repaired.display",source:B})},title:"Move display into :popover-open",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverInvoker",level:"document",menus:[],requires:"an element carrying popovertarget that cannot invoke",run:(e,t)=>{let n=oe("document.repairPopoverInvoker"),l=me("document.repairPopoverInvoker",t);q(n,(i)=>{Yo(i,l,"popovertarget"),Yo(i,l,"popovertargetaction")}),S.success("Removed the attributes, which did nothing on this element.",{key:"popover.repaired.invoker",source:B})},title:"Remove the inert popover attributes",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverMode",level:"document",menus:[],requires:"a popover whose mode is not one of the three keywords",run:(e,t)=>{let n=oe("document.repairPopoverMode"),l=me("document.repairPopoverMode",t);q(n,(i)=>{Yo(i,l,"popover",TS)}),S.success(`Set \`popover\` to "${TS}".`,{key:"popover.repaired.mode",source:B})},title:"Set popover to auto",when:(e)=>e.document.open}]}function GE(e){e.registerAll(Et())}function yb(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,n)=>r===t[n]);if(e!==null&&t!==null&&typeof e==="object"&&typeof t==="object"&&!Array.isArray(e)&&!Array.isArray(t))return e.$ref===t.$ref;return!1}var O="grid://";function ds(e){switch(e.kind){case"pages":return`${O}pages`;case"library":return`${O}library`;case"collection":return`${O}collection/${encodeURIComponent(e.name)}`;default:return`${O}data/${encodeURIComponent(e.connection)}/${encodeURIComponent(e.table)}`}}function jt(e){return e.startsWith(O)}function Yf(e){if(!jt(e))return null;let t=e.slice(O.length).split("/");if(t[0]==="pages"&&t.length===1)return{kind:"pages"};if(t[0]==="library"&&t.length===1)return{kind:"library"};if(t[0]==="collection"&&t.length===2&&t[1])return{kind:"collection",name:decodeURIComponent(t[1])};if(t[0]==="data"&&t.length===3&&t[1]&&t[2])return{connection:decodeURIComponent(t[1]),kind:"data",table:decodeURIComponent(t[2])};return null}function Fw(e){let t=Yf(e);if(!t)return null;switch(t.kind){case"pages":return"Pages · grid";case"library":return"Library";case"collection":return`${t.name} · grid`;default:return`${t.table} @ ${t.connection} · grid`}}var De=0;function Fe(e){let t=e.coalesceMs??800,r=e.now??(()=>Date.now()),n=v({deletes:new Set,errors:new Map,inserts:new Map,pending:new Map,redoStack:[],stale:new Set,undoStack:[]}),l=null,i=(o,a,s)=>{let m=n.errors.get(o);if(m)m.set(a,s);else n.errors.set(o,new Map([[a,s]]))},d=(o,a)=>{let s=n.errors.get(o);if(s?.delete(a),s?.size===0)n.errors.delete(o)},h=(o)=>{if(n.redoStack.length=0,l){l.push(o);return}let a=n.undoStack.at(-1);if(o.kind==="cell"&&a?.kind==="cell"&&a.rowKey===o.rowKey&&a.field===o.field&&o.at-a.at<=t){a.after=o.after,a.at=o.at;return}n.undoStack.push(o)},c=(o,a,s)=>{let m=n.inserts.get(o);if(m){if(s===null)delete m[a];else m[a]=s;return}if(yb(s,e.resolveBaseline(o,a))){let f=n.pending.get(o);if(f?.delete(a),f?.size===0)n.pending.delete(o);return}let b=n.pending.get(o);if(b)b.set(a,{value:s});else n.pending.set(o,new Map([[a,{value:s}]]))},w=(o,a)=>{let s=n.inserts.get(o);if(s)return s[a]??null;let m=n.pending.get(o)?.get(a);return m?m.value:e.resolveBaseline(o,a)},x=(o,a)=>{let s=n.errors.get(o);return s?.get(a)??s?.get("*")??null},E=(o,a)=>{switch(o.kind){case"cell":{c(o.rowKey,o.field,a==="undo"?o.before:o.after);break}case"insert":{if(a==="undo")n.inserts.delete(o.tempKey);else n.inserts.set(o.tempKey,{...o.cells});break}case"drop-insert":{if(a==="undo")n.inserts.set(o.tempKey,{...o.cells});else n.inserts.delete(o.tempKey);break}case"delete":{if(a==="undo")n.deletes.delete(o.rowKey);else n.deletes.add(o.rowKey);break}default:{let s=a==="undo"?o.ops.toReversed():o.ops;for(let m of s)E(m,a);break}}},G=()=>{if(l)throw Error("edit-buffer: groups may not nest");l=[]},P=()=>{let o=l;if(l=null,!o)return;if(o.length===1)n.undoStack.push(o[0]);else if(o.length>1)n.undoStack.push({kind:"group",ops:o})},M=(o)=>{let a=(s)=>{switch(s.kind){case"cell":return o(s.rowKey)?null:s;case"insert":case"drop-insert":return o(s.tempKey)?null:s;case"delete":return o(s.rowKey)?null:s;default:{let m=s.ops.map((b)=>a(b)).filter((b)=>b!==null);return m.length>0?{kind:"group",ops:m}:null}}};n.undoStack=n.undoStack.map(a).filter((s)=>s!==null),n.redoStack=n.redoStack.map(a).filter((s)=>s!==null)};return{applyCommitResult(o){let a=new Set;for(let s of o.cells)if(s.ok){let m=n.pending.get(s.rowKey);if(m?.delete(s.field),m?.size===0)n.pending.delete(s.rowKey);d(s.rowKey,s.field)}else if(i(s.rowKey,s.field,s.error??"Save failed"),s.stale)n.stale.add(s.rowKey);for(let s of o.inserts)if(s.ok)n.inserts.delete(s.tempKey),n.errors.delete(s.tempKey),a.add(s.tempKey);else i(s.tempKey,"*",s.error??"Insert failed");for(let s of o.deletes)if(s.ok)n.deletes.delete(s.rowKey),n.pending.delete(s.rowKey),n.errors.delete(s.rowKey),a.add(s.rowKey);else if(i(s.rowKey,"*",s.error??"Delete failed"),s.stale)n.stale.add(s.rowKey);for(let s of a)n.stale.delete(s);if(a.size>0)M((s)=>a.has(s))},buildBatch(){let o=[];for(let[a,s]of n.pending){if(n.deletes.has(a))continue;for(let[m,b]of s)o.push({baseline:e.resolveBaseline(a,m),field:m,rowKey:a,value:b.value})}return{cells:o,deletes:[...n.deletes].map((a)=>({rowKey:a})),inserts:[...n.inserts].map(([a,s])=>({cells:{...s},tempKey:a}))}},canRedo:()=>n.redoStack.length>0,canUndo:()=>n.undoStack.length>0,cellError:x,cellState(o,a){if(x(o,a)!==null)return"error";if(n.stale.has(o))return"stale";if(n.inserts.has(o)||n.pending.get(o)?.has(a))return"dirty";return"clean"},deleteRow(o){if(n.deletes.has(o))return;let a=n.inserts.get(o);if(a){let s={...a};n.inserts.delete(o),n.errors.delete(o),n.stale.delete(o),h({cells:s,kind:"drop-insert",tempKey:o});return}n.deletes.add(o),h({kind:"delete",rowKey:o})},dirtyCount(){let o=n.inserts.size+n.deletes.size;for(let[a,s]of n.pending)if(!n.deletes.has(a))o+=s.size;return o},discardRow(o){n.pending.delete(o),n.deletes.delete(o),n.inserts.delete(o),n.errors.delete(o),n.stale.delete(o),M((a)=>a===o)},effectiveValue:w,beginGroup:G,endGroup:P,group(o){G();try{o()}finally{P()}},insertRow(o={}){De+=1;let a=`__new-${De}`;return n.inserts.set(a,{...o}),h({cells:{...o},kind:"insert",tempKey:a}),a},isDirty:()=>n.pending.size>0||n.inserts.size>0||n.deletes.size>0,isInsertKey:(o)=>n.inserts.has(o),markStale(o){for(let a of o)n.stale.add(a)},redo(){let o=n.redoStack.pop();if(!o)return!1;return E(o,"redo"),n.undoStack.push(o),!0},reset(){n.pending.clear(),n.inserts.clear(),n.deletes.clear(),n.errors.clear(),n.stale.clear(),n.undoStack.length=0,n.redoStack.length=0},rowState(o){if(n.deletes.has(o))return"pending-delete";if(n.inserts.has(o))return"pending-insert";if(n.stale.has(o))return"stale";if(n.pending.has(o)||n.errors.has(o))return"dirty";return"clean"},setCell(o,a,s){let m=w(o,a);if(yb(m,s))return;c(o,a,s),h({after:s,at:r(),before:m,field:a,kind:"cell",rowKey:o})},state:n,undo(){let o=n.undoStack.pop();if(!o)return!1;return E(o,"undo"),n.redoStack.push(o),!0}}}var Be={array:220,boolean:70,date:130,enum:140,image:180,number:110,readonly:200,reference:200,string:180,text:340};function Oe(e){return Math.min(340,Math.max(90,Math.round(e*7.5)))}function Gt(e){if(e.$ref)return"reference";if(e.enum!==void 0&&Array.isArray(e.enum))return"enum";let t=e.type==="array"?void 0:e.format;if(ma(t))return"image";if(t==="date"||t==="date-time")return"date";switch(e.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"readonly";default:return(e.maxLength??0)>200||e.format==="markdown"?"text":"string"}}function Ne(e){let t=e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function wb(e,t={}){let r=Object.entries(e?.properties??{}),n=new Set(e?.required),l=new Set(t.readonlyFields),i=r.map(([d,h])=>{let c=l.has(d)?"readonly":Gt(h),w=Array.isArray(h.enum)?Math.max(...h.enum.map((x)=>String(x).length),4):0;return{editable:c!=="readonly",field:d,kind:c,pk:d===t.idField,required:n.has(d),schema:h,title:Ne(d),widthHint:c==="enum"?Oe(w+3):Be[c]}});return i.sort((d,h)=>{let c=(x)=>x.pk?0:x.required?1:2,w=c(d)-c(h);return w===0?0:w}),i}function xb(e,t=50){let r=e.slice(0,t),n=[];for(let l of r)for(let i of Object.keys(l))if(!n.includes(i))n.push(i);return n.map((l)=>{let i=r.map((c)=>c[l]).filter((c)=>c!==null&&c!==void 0&&c!==""),d=Tt(i),h=Math.max(...i.map((c)=>Ro(c).length),l.length,4);return{editable:!0,field:l,kind:d,title:Ne(l),widthHint:d==="string"||d==="text"?Oe(h):Be[d]}})}function Tt(e){if(e.length===0)return"string";if(e.some((r)=>Array.isArray(r)))return"array";let t=e.map(String);if(e.every((r)=>typeof r==="boolean")||t.every((r)=>/^(true|false)$/i.test(r)))return"boolean";if(e.every((r)=>typeof r==="number")||t.every((r)=>r.trim()!==""&&!Number.isNaN(Number(r.replaceAll(/[$€£¥,\s]/g,"")))))return"number";if(t.every((r)=>/^\d{4}-\d{2}-\d{2}([T ].*)?$/.test(r)))return"date";if(t.some((r)=>r.length>200))return"text";return"string"}function Lu(e,t){if(e===null||e===void 0)return null;switch(t.kind){case"number":{if(typeof e==="number")return Number.isNaN(e)?null:e;let r=String(e).trim().replaceAll(/[$€£¥,\s]/g,"");if(r==="")return null;let n=Number(r);return Number.isNaN(n)?null:n}case"boolean":{if(typeof e==="boolean")return e;return String(e).trim().toLowerCase()==="true"}case"array":{if(Array.isArray(e))return e.map(String);let r=String(e).trim();return r===""?[]:r.split(",").map((n)=>n.trim()).filter(Boolean)}case"reference":{if(typeof e==="object"&&e!==null&&"$ref"in e){let n=e.$ref;return typeof n==="string"&&n!==""?n:null}let r=String(e).trim();return r===""?null:r}default:{let r=String(e);return r===""?null:r}}}function Ro(e){if(e===null||e===void 0)return"";if(Array.isArray(e))return e.join(", ");if(typeof e==="object")return e.$ref;return String(e)}var jw="__key",he=new WeakMap;function Ha(e){return e?he.get(re(e))??null:null}function Iu(e,t){let r=v({columns:[],error:null,grouping:null,loading:!1,query:{},rows:[],saving:!1,total:0}),n=new Map,l=(o)=>{n=new Map(o.map((a)=>[a.key,a]))},i=Fe({resolveBaseline:(o,a)=>n.get(o)?.cells[a]??null}),d=async()=>{let o=await t.rows(r.query);r.rows=o.rows,r.total=o.total,l(o.rows)},h=(o)=>{let a=r.columns.filter((b)=>b.required&&b.editable);if(a.length===0)return null;let s=o.cells.filter((b)=>b.value===null&&a.some((f)=>f.field===b.field)).map((b)=>({error:"Required",field:b.field,ok:!1,rowKey:b.rowKey})),m=o.inserts.filter((b)=>a.some((f)=>b.cells[f.field]===null||b.cells[f.field]===void 0)).map((b)=>({error:`Missing required: ${a.filter((C)=>b.cells[C.field]===null||b.cells[C.field]===void 0).map((C)=>C.field).join(", ")}`,ok:!1,tempKey:b.tempKey}));if(s.length===0&&m.length===0)return null;return{cells:s,deletes:[],inserts:m}},c=(o)=>o===null||o===""||Array.isArray(o)&&o.length===0,w=(o,a,s)=>{if(s==="number")return(typeof o==="number"?o:0)-(typeof a==="number"?a:0);if(s==="boolean")return(o===!0?1:0)-(a===!0?1:0);return Ro(o).localeCompare(Ro(a))},x=()=>{let o=r.rows.map((m)=>m.key),{dir:a,orderBy:s}=r.query;if(s&&!t.capabilities.remoteSort){let m=r.columns.find((f)=>f.field===s)?.kind,b=a==="desc"?-1:1;o=o.toSorted((f,C)=>{let j=i.effectiveValue(f,s),ae=i.effectiveValue(C,s);if(c(j)!==c(ae))return c(j)?1:-1;return b*w(j,ae,m)})}return r.grouping?[...E(o).values()].flat():o},E=(o)=>{let a=new Map;for(let s of o){let m=Ro(i.effectiveValue(s,r.grouping)),b=a.get(m);if(b)b.push(s);else a.set(m,[s])}return a},G=null,P=()=>G?.refreshData(),M={addRow(o={}){let a=i.insertRow(o);return P(),a},bindView(o){G=o},buffer:i,deleteRows(o){if(o.length===0)return;i.group(()=>{for(let a of o)i.deleteRow(a)}),P()},discardRow(o){i.discardRow(o),P()},replaceAll(o,a){if(o==="")return 0;let s=r.columns.filter((f)=>f.editable&&(f.kind==="string"||f.kind==="text")),m=[...r.rows.map((f)=>f.key),...i.state.inserts.keys()],b=0;if(i.group(()=>{for(let f of m){if(i.rowState(f)==="pending-delete")continue;for(let C of s){let j=i.effectiveValue(f,C.field);if(typeof j==="string"&&j.includes(o))i.setCell(f,C.field,j.replaceAll(o,a)),b+=1}}}),b>0)P();return b},effectiveRows(){let o=(m)=>Array.isArray(m)?[...m]:m!==null&&typeof m==="object"?{$ref:m.$ref}:m,a=(m)=>{let b={[jw]:m};for(let f of r.columns)b[f.field]=o(i.effectiveValue(m,f.field));return b},s=x().map((m)=>a(m));for(let[m]of i.state.inserts)s.push(a(m));return s},groups(){if(!r.grouping)return[];return[...E(x())].map(([o,a])=>({count:a.length,value:o}))},async load(){r.loading=!0,r.error=null;try{r.columns=await t.columns(),await d()}catch(o){r.error=te(o)}finally{r.loading=!1}P()},async refresh(){if(i.isDirty()){if(!await Qo("Refresh Grid",`Discard ${i.dirtyCount()} pending change(s) and reload?`,{confirmLabel:"Discard & Reload",destructive:!0}))return}i.reset(),await t.refresh?.(),await this.load()},async save(){if(r.saving)return;let o=i.buildBatch(),a=o.cells.length+o.inserts.length+o.deletes.length;if(a===0){S.info("No grid changes to save.",{key:"grid.save"});return}let s=h(o);if(s){i.applyCommitResult(s),S.warn("Required cells are empty — fix the marked rows, then save again.",{key:"grid.save",source:"Data",tier:"problem"});return}if(o.deletes.length>0){if(!await Qo("Delete Rows",`Save will permanently delete ${o.deletes.length} row(s). Continue?`,{confirmLabel:"Delete & Save",destructive:!0}))return}let b=new Set(o.cells.map((f)=>f.rowKey)).size+o.inserts.length+o.deletes.length>5?la({title:"Saving grid"}):null;r.saving=!0;try{let f=await t.commit(o),C=(k,z)=>`${k}\x00${z}`,j=new Map(o.cells.map((k)=>[C(k.rowKey,k.field),k]));for(let k of f.cells){let z=j.get(C(k.rowKey,k.field));if(k.ok&&z){let ve=n.get(k.rowKey);if(ve)ve.cells[k.field]=z.value}}if(i.applyCommitResult(f),f.inserts.some((k)=>k.ok)||f.deletes.some((k)=>k.ok))await d();let se=f.cells.filter((k)=>k.ok).length+f.inserts.filter((k)=>k.ok).length+f.deletes.filter((k)=>k.ok).length,be=a-se,we=f.cells.filter((k)=>k.stale).length+f.deletes.filter((k)=>k.stale).length;if(be===0)S.success(`Saved ${se} change(s).`,{key:"grid.save"});else S.error(`Saved ${se} · ${be} failed${we?` (${we} stale)`:""} — kept pending.`,{action:"file.save",key:"grid.save",source:"Data"})}catch(f){S.error("Could not save the grid.",{action:"file.save",detail:te(f),key:"grid.save",source:"Data"})}finally{r.saving=!1,b?.done(),P()}},serializeForSource(){if(!t.serializeForSource)return null;return t.serializeForSource(i.buildBatch())},async setQuery(o){r.query=o,r.loading=!0;try{await d()}catch(a){r.error=te(a)}finally{r.loading=!1}P()},setGrouping(o){r.grouping=o,P()},async setSort(o){let a={...r.query};if(o)a.orderBy=o.field,a.dir=o.dir;else delete a.orderBy,delete a.dir;if(!t.capabilities.remoteSort){r.query=a,P();return}await this.setQuery(a)},source:t,state:r,tab:e};return e.scope.run(()=>{Q(()=>{e.doc.dirty=i.isDirty()}),_m(e,{canRedo:()=>i.canRedo(),canUndo:()=>i.canUndo(),redo:()=>{i.redo(),P()},undo:()=>{i.undo(),P()}});let o=p();if(o.subscribeFileEvents&&t.backingPaths){let a=o.subscribeFileEvents((s)=>{let m=t.backingPaths(),b=new Set;for(let f of s){if(f.isDir)continue;let C=f.path.replaceAll("\\","/"),j=m.get(C);if(j!==void 0&&!mc(C))b.add(j)}if(b.size===0)return;if(i.isDirty()){let f=b.has("*")?r.rows.map((C)=>C.key):[...b];i.markStale(f),S.warn("Grid rows changed on disk — marked stale; refresh to reload.",{key:"grid.stale",source:"Data"}),P()}else M.refresh()});Xa(a)}Xa(()=>{_m(e,null),he.delete(re(e)),t.dispose?.()})}),he.set(re(e),M),M}async function md(e){let r=Ha(e)?.serializeForSource();if(r)return r;await qt();let n=wi(e.doc.sourceFormat);if(n?.capabilities.serialize){let l=e.doc.content?.frontmatter||{},i=e.doc.document,d={...l,...i,children:i.children??[]};return Us(n.name,d,{mode:"roundtrip"})}if(e.doc.mode==="content"){let l=$r();if(l){let i=e.doc.content?.frontmatter??{},d=Object.keys(i).length>0,h={...i,...e.doc.document};return Us(l.name,h,{frontmatter:d,mode:"roundtrip"})}}return pr(e.doc.document,e.doc.layout??null)}var Mt=200,At=500,Dt=2097152,_=new Map,V=!1,ie=null,A=null,L=null,ye=null;function Ft(){let e=[];for(let t of g.tabs.values())if(t.doc.dirty&&t.documentPath)e.push(t);return e}async function Je(){if(!We())return;let e=p();if(!e.setPreviewOverlay||!e.clearPreviewOverlay)return;let t=new Set;for(let r of Ft()){let n=r.documentPath.replace(/^\.\//,""),l;try{l=await md(r)}catch{continue}if(l.length>Dt)continue;if(t.add(n),_.get(n)===l)continue;_.set(n,l),await e.setPreviewOverlay(n,l)}for(let r of _.keys())if(!t.has(r))_.delete(r),await e.clearPreviewOverlay(r)}function Ke(){if(!V)return;let e=Date.now();if(L??=e,A)clearTimeout(A);let t=e-L,r=Math.max(0,Math.min(Mt,At-t));A=setTimeout(()=>{A=null,L=null,ye=Je().finally(()=>{ye=null})},r)}function KE(){Ke()}function JE(){if(V)return;V=!0,ie=ge(),ie.run(()=>{Q(()=>{for(let e of g.tabs.values())e.doc.dirty,e.doc.document;Ke()})})}function YE(){if(V=!1,A)clearTimeout(A),A=null;L=null,ie?.stop(),ie=null,_.clear()}async function Bw(){if(!V)return;if(A)clearTimeout(A),A=null,L=null;await ye,await Je()}var _e=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,Bt=new Set(["vnd","prs","x"]);function Ot(e){if(typeof e!=="string")return null;let[t,...r]=e.split(";"),n=(t??"").indexOf("/");if(n===-1)return null;let l=(t??"").slice(0,n).trim().toLowerCase(),i=(t??"").slice(n+1).trim().toLowerCase();if(!_e.test(l)||!_e.test(i))return null;let d=i.lastIndexOf("+"),h=d===-1?null:i.slice(d+1),c=d===-1?i:i.slice(0,d);if(h==="")return null;let w=c.indexOf("."),x=w===-1?null:c.slice(0,w),E=x!==null&&Bt.has(x)?x:null,G=E===null?c:c.slice(E.length+1);if(G==="")return null;let P={};for(let M of r){let o=M.indexOf("=");if(o===-1)return null;let a=M.slice(0,o).trim().toLowerCase(),s=M.slice(o+1).trim();if(a==="")return null;if(s.startsWith('"')&&s.endsWith('"')&&s.length>=2)s=s.slice(1,-1);P[a]=s}return{parameters:P,subtype:G,suffix:h,tree:E,type:l}}function zw(e){let t=Ot(e);if(t===null)return null;let r=t.tree===null?"":`${t.tree}.`,n=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${r}${t.subtype}${n}`}var Le="text/markdown; variant=GFM",Ie="application/yaml",bn={".markdown":`${Le}; charset=utf-8`,".md":`${Le}; charset=utf-8`,".yaml":`${Ie}; charset=utf-8`,".yml":`${Ie}; charset=utf-8`};async function Nt(e,t){let r=await hS(e.name,t);return pS(e,r)}async function Er(e,t){await qt();let r=Zt(e);if(!r||!r.capabilities.parse)throw Ip(e);return{...await Nt(r,t),format:r}}var N1=async(e,t)=>{if(e.documentPath&&Zt(e.documentPath)){let n=await Er(e.documentPath,t);return{document:n.document,frontmatter:n.frontmatter}}let r=hs(t);return e.doc.layout=r.layout,{document:r.document}};var ze=()=>{};function O1(e){ze=e}function I(e){je(e.documentPath);let t=e.doc.document;ze(e.documentPath,t);let r=typeof t.tagName==="string"&&t.tagName.includes("-")?_b(t):null;if(r)S.warn(r,{key:`slots:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Components",tier:"problem"});fe(t,e.documentPath??void 0)}function Jt(e){return!mm(e.documentPath??"")}async function op(e=u.value){if(!e)return!1;if(await aC(e.id),km(e))return S.warn(`You have read access to this session — changes to ${e.documentPath??"this document"} stay in your browser and cannot be saved.`,{action:"file.save",key:`save.readOnly:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Collaboration"}),!1;if(!Jt(e))return S.warn(`${e.documentPath??"This file"} is a media file, so there is no document for Save to write.`,{key:`save.notADocument:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Save"}),!1;let t=Ha(e);if(t)return await t.save(),!e.doc.dirty;try{if(await YC(e))return I(e),!0;let r=await md(e);if(e.documentPath)return await p().writeFile(e.documentPath,r),e.doc.dirty=!1,Bw(),I(e),!0;if(e.fileHandle&&"createWritable"in e.fileHandle){let n=await e.fileHandle.createWritable();return await n.write(r),await n.close(),e.doc.dirty=!1,I(e),!0}S.warn("This document has no save target — use Export.",{key:"save.noTarget"})}catch(r){if(!(r instanceof Error&&r.name==="AbortError"))S.error(`Could not save ${e.documentPath??e.id}.`,{action:"file.save",detail:te(r),key:`save:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Save"})}return!1}function Kt(e){return wi(e.doc.sourceFormat)??(e.doc.mode==="content"?$r():void 0)}async function M1(){let e=u.value;if(!e)return;try{await qt();let t=Kt(e),r=await md(e),n=t?zw(t.mediaType)??"text/plain":"application/json",l=t?t.extensions[0]:".json",i=t?t.name:"Jx Component",d=t?`content${l}`:"component.json";if("showSaveFilePicker"in window){let h=e.documentPath?e.documentPath.split("/").pop():d,c=await window.showSaveFilePicker({suggestedName:h,types:[{accept:{[n]:[l]},description:i}]}),w=await c.createWritable();await w.write(r),await w.close(),e.doc.dirty=!1,I(e),S.success(`Exported as ${c.name}.`)}else{let h=new Blob([r],{type:n}),c=URL.createObjectURL(h),w=document.createElement("a");w.href=c,w.download=d,w.click(),URL.revokeObjectURL(c),e.doc.dirty=!1,I(e),S.success(`Downloaded ${d}.`)}}catch(t){if(!(t instanceof Error&&t.name==="AbortError"))S.error("Could not export the document.",{detail:te(t),source:"Export"})}}async function He(e,t){let r=mm(e)?await kb(e):await Fs({path:e});return K1(r,t)??""}async function Xf(e){let t=await He(e.path,"delete"),r=`Delete ${e.name}? This cannot be undone.`;return Boolean(await Qo("Delete File",t===""?r:`${r} ${t}`,{confirmLabel:"Delete",destructive:!0}))}async function Qf(e,t="rename"){let r=await He(e,t);return r===""?void 0:r}
2
- export{yb,ds,Yf,Fw,wb,xb,Lu,Ro,jw,Ha,Iu,Zf,zE,WE,Hw,VE,UE,A1,qE,GE,md,KE,JE,YE,Bw,zw,Er,N1,O1,op,M1,Xf,Qf};
3
-
4
- //# debugId=BCC22A9ED494514964756E2164756E21
5
- //# sourceMappingURL=studio-eb5sty2k.js.map
@@ -1,5 +0,0 @@
1
- import{qu}from"./studio-27tc8q0h.js";import{vb}from"./studio-4yztve2t.js";import{D}from"./studio-153mwkyq.js";function c(){return Object.keys(D?.projectConfig?.content??{})}function Ew(e){let n=vb(e);if(!n)return null;if(/\.[a-z\d]+$/i.test(n.dir))return null;return{def:n.def,dir:n.dir,ext:n.ext,name:n.name,schema:n.def.schema??null}}function ub(){return c().map((e)=>Ew(e)).filter((e)=>e!==null)}function sa(e){let n=qu(e??null,D?.projectConfig);return n?Ew(n.name):null}function u(e){if(e===null||typeof e!=="object")return e;return JSON.parse(JSON.stringify(e))}function l(e){if(typeof e.$ref==="string")return"";switch(e.type){case"boolean":return!1;case"integer":case"number":return 0;case"array":return[];case"object":return w1(e);default:return""}}function w1(e){let n=e?.properties;if(!n)return{};let i=new Set(Array.isArray(e?.required)?e.required:[]),t={};for(let[r,o]of Object.entries(n))if(o.default!==void 0)t[r]=u(o.default);else if(i.has(r))t[r]=l(o);return t}function EE(e,n){return(Array.isArray(e?.required)?e.required:[]).filter((t)=>n[t]===void 0)}
2
- export{Ew,ub,sa,w1,EE};
3
-
4
- //# debugId=E13905523BB695CF64756E2164756E21
5
- //# sourceMappingURL=studio-frv7vjhw.js.map