@jxsuite/studio 5.5.0 → 5.7.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 (244) hide show
  1. package/LICENSE +1 -1
  2. package/dist/chunks/{2020-g8mwpbkq.js → 2020-cs2sb9t1.js} +3 -3
  3. package/dist/chunks/adapter-y5gdq19c.js +4 -0
  4. package/dist/chunks/cf-account-picker-882a7ecm.js +4 -0
  5. package/dist/chunks/cf-settings-20dznc3j.js +4 -0
  6. package/dist/chunks/components-q037dya7.js +4 -0
  7. package/dist/chunks/content-source-37x3vsap.js +4 -0
  8. package/dist/chunks/convert-to-repeater-grfep2w8.js +4 -0
  9. package/dist/chunks/editor-j5sq149q.js +4 -0
  10. package/dist/chunks/entry-commands-c5h3nqck.js +4 -0
  11. package/dist/chunks/extension-sections-dp8endhx.js +4 -0
  12. package/dist/chunks/file-ops-937cvqk6.js +4 -0
  13. package/dist/chunks/files-tznwe1p1.js +4 -0
  14. package/dist/chunks/format-host-e2pjvd25.js +4 -0
  15. package/dist/chunks/fs-events-fv64ak3s.js +4 -0
  16. package/dist/chunks/git-panel-gb713ttc.js +4 -0
  17. package/dist/chunks/grid-view-5amhg604.js +51 -0
  18. package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
  19. package/dist/chunks/iframe-host-t819mcg5.js +4 -0
  20. package/dist/chunks/{index-arg188jq.js → index-9ydfe04y.js} +3 -3
  21. package/dist/chunks/index-m0x5ztax.js +4 -0
  22. package/dist/chunks/{javascript-zcdmye2k.js → javascript-d9pqgc2p.js} +2 -2
  23. package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-800yvbem.js} +5 -5
  24. package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
  25. package/dist/chunks/layers-4bsr82wz.js +4 -0
  26. package/dist/chunks/layers-panel-b6shnaax.js +4 -0
  27. package/dist/chunks/lit-html-cfn61dn7.js +4 -0
  28. package/dist/chunks/media-picker-ej0kdh1j.js +4 -0
  29. package/dist/chunks/menu-rtxf9chb.js +4 -0
  30. package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-62dtmgbf.js} +3 -3
  31. package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
  32. package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-tj13ndtm.js} +3 -3
  33. package/dist/chunks/notify-ahs57a2z.js +4 -0
  34. package/dist/chunks/platform-v9xyfkbx.js +4 -0
  35. package/dist/chunks/publish-panel-bq36xcmj.js +4 -0
  36. package/dist/chunks/quick-search-zm00h9dh.js +4 -0
  37. package/dist/chunks/references-99ws0b0m.js +4 -0
  38. package/dist/chunks/right-panel-pq2f71q3.js +4 -0
  39. package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
  40. package/dist/chunks/studio-01kbbqg3.js +928 -0
  41. package/dist/chunks/{studio-hf4qdjc8.js → studio-01qza1n3.js} +4 -4
  42. package/dist/chunks/{studio-pkkw32j0.js → studio-03wwfvyt.js} +4 -4
  43. package/dist/chunks/{studio-7gqyhjns.js → studio-0bbxhhce.js} +4 -4
  44. package/dist/chunks/studio-0k9mvpgj.js +14 -0
  45. package/dist/chunks/studio-0scebvb9.js +6 -0
  46. package/dist/chunks/studio-1a99w39s.js +5 -0
  47. package/dist/chunks/studio-1wvfxkyy.js +5 -0
  48. package/dist/chunks/studio-1x8x26k3.js +5 -0
  49. package/dist/chunks/studio-222rqyyc.js +5 -0
  50. package/dist/chunks/studio-4xppwncr.js +4 -0
  51. package/dist/chunks/{studio-xcng8nx7.js → studio-54g077x3.js} +5 -5
  52. package/dist/chunks/studio-56z7evx4.js +10 -0
  53. package/dist/chunks/studio-5e9zsamh.js +9 -0
  54. package/dist/chunks/studio-65fhspdd.js +5 -0
  55. package/dist/chunks/studio-693nhyky.js +5 -0
  56. package/dist/chunks/{studio-7jazdy6y.js → studio-7pgy3xaf.js} +4 -4
  57. package/dist/chunks/studio-888knnkc.js +5 -0
  58. package/dist/chunks/studio-9mqfamps.js +5 -0
  59. package/dist/chunks/studio-a7xqhc3n.js +5 -0
  60. package/dist/chunks/studio-aje966s9.js +5 -0
  61. package/dist/chunks/studio-aqmph6k4.js +5 -0
  62. package/dist/chunks/studio-c6w3tq7t.js +5 -0
  63. package/dist/chunks/{studio-6j2jn55a.js → studio-c6zdm25z.js} +8 -8
  64. package/dist/chunks/{studio-f8jyp45j.js → studio-c9d3pxf7.js} +4 -4
  65. package/dist/chunks/studio-ceb34dxj.js +5 -0
  66. package/dist/chunks/studio-cvbkkfqb.js +5 -0
  67. package/dist/chunks/studio-cxt150pj.js +7 -0
  68. package/dist/chunks/studio-dkn3x3hz.js +5 -0
  69. package/dist/chunks/studio-e6re3rk1.js +5 -0
  70. package/dist/chunks/{studio-5n1km79v.js → studio-edbtvcd1.js} +4 -4
  71. package/dist/chunks/{studio-xc8ebsts.js → studio-eh0rac07.js} +4 -4
  72. package/dist/chunks/{studio-625ezz59.js → studio-evwgp1ym.js} +4 -4
  73. package/dist/chunks/{studio-he2fhrgp.js → studio-f195h2hq.js} +4 -4
  74. package/dist/chunks/studio-fqq890ap.js +4 -0
  75. package/dist/chunks/studio-frb0qbf7.js +6 -0
  76. package/dist/chunks/studio-gfn1kpxj.js +6 -0
  77. package/dist/chunks/studio-gh97gngt.js +5 -0
  78. package/dist/chunks/{studio-awqghqxv.js → studio-gp02nqnw.js} +4 -4
  79. package/dist/chunks/{studio-x9sagq2d.js → studio-hjbg8d5y.js} +7 -7
  80. package/dist/chunks/studio-j6gnhvaa.js +5 -0
  81. package/dist/chunks/studio-mwxgyn9h.js +7 -0
  82. package/dist/chunks/{studio-x5esgzct.js → studio-n78gjfy8.js} +4 -4
  83. package/dist/chunks/studio-nbxqcgvf.js +5 -0
  84. package/dist/chunks/{studio-p1eggxcf.js → studio-nt06yybj.js} +4 -4
  85. package/dist/chunks/{studio-hc9q4j24.js → studio-p7c1agz0.js} +5 -5
  86. package/dist/chunks/{studio-8r4y2x0z.js → studio-pwqfmt4p.js} +4 -4
  87. package/dist/chunks/{studio-5wfrgee9.js → studio-r3kaka4d.js} +4 -4
  88. package/dist/chunks/studio-semd1s8s.js +5 -0
  89. package/dist/chunks/studio-skzanb0k.js +5 -0
  90. package/dist/chunks/studio-spf2skgc.js +5 -0
  91. package/dist/chunks/{studio-b4epb26c.js → studio-st75kn99.js} +7 -7
  92. package/dist/chunks/{studio-eq27rrr0.js → studio-sxc0zvpt.js} +3 -3
  93. package/dist/chunks/studio-t1eedsyx.js +4 -0
  94. package/dist/chunks/{studio-73czgk6a.js → studio-tp642n5g.js} +4 -4
  95. package/dist/chunks/studio-tw7rre6s.js +5 -0
  96. package/dist/chunks/{studio-7by9a93k.js → studio-tzegmy4w.js} +4 -4
  97. package/dist/chunks/studio-vavmwshr.js +5 -0
  98. package/dist/chunks/studio-wma2c6g8.js +5 -0
  99. package/dist/chunks/studio-x92tgnee.js +64 -0
  100. package/dist/chunks/studio-xk0z6msk.js +5 -0
  101. package/dist/chunks/{studio-c4pnt1c6.js → studio-xry7tk3z.js} +5 -5
  102. package/dist/chunks/studio-xta2vxp6.js +9 -0
  103. package/dist/chunks/{studio-21enxdr8.js → studio-xy3tv3az.js} +4 -4
  104. package/dist/chunks/studio-y7jehjrp.js +5 -0
  105. package/dist/chunks/{studio-k1eaqyzm.js → studio-yr04mv2j.js} +4 -4
  106. package/dist/chunks/{studio-mhhc9btt.js → studio-zd4kayn2.js} +4 -4
  107. package/dist/chunks/studio-zpnk016a.js +16 -0
  108. package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-k9s9fcag.js} +5 -5
  109. package/dist/chunks/workspace-b69mgm0e.js +4 -0
  110. package/dist/chunks/ws-client-0ja08haa.js +4 -0
  111. package/dist/iframe-entry.js +14 -14
  112. package/dist/manifest.json +62 -59
  113. package/dist/studio.css +1 -1
  114. package/dist/studio.js +121 -123
  115. package/package.json +5 -5
  116. package/src/account/action-flow.ts +294 -0
  117. package/src/account/action-required.ts +68 -0
  118. package/src/account-status.ts +29 -1
  119. package/src/browse/library-model.ts +3 -1
  120. package/src/browse/library-preview.ts +6 -2
  121. package/src/canvas/asset-refs.ts +3 -1
  122. package/src/canvas/asset-resolve.ts +79 -1
  123. package/src/canvas/iframe-entry.ts +38 -1
  124. package/src/canvas/iframe-host.ts +85 -0
  125. package/src/canvas/iframe-protocol.ts +13 -0
  126. package/src/canvas/stage-scrollbar.ts +7 -7
  127. package/src/files/asset-versions.ts +294 -0
  128. package/src/files/file-ops.ts +5 -8
  129. package/src/files/files.ts +61 -9
  130. package/src/files/fs-events.ts +279 -28
  131. package/src/files/media-meta.ts +2 -1
  132. package/src/files/media-paths.ts +5 -2
  133. package/src/files/media-upload.ts +5 -1
  134. package/src/new-project/add-repo-modal.ts +12 -1
  135. package/src/new-project/new-project-modal.ts +12 -1
  136. package/src/panels/git-panel.ts +25 -2
  137. package/src/panels/jump-bar.ts +132 -158
  138. package/src/panels/pane-context.ts +8 -8
  139. package/src/panels/pane-grid.ts +18 -26
  140. package/src/panels/style-panel.ts +2 -2
  141. package/src/platform-errors.ts +61 -1
  142. package/src/platforms/cloud.ts +389 -50
  143. package/src/platforms/devserver.ts +17 -1
  144. package/src/publish/pages-service.ts +17 -7
  145. package/src/services/ai-models.ts +30 -6
  146. package/src/services/ai-system-prompt.ts +81 -51
  147. package/src/services/context-manager.ts +41 -70
  148. package/src/services/document-assistant.ts +12 -3
  149. package/src/services/harness/chat-reducer.ts +115 -0
  150. package/src/services/harness/turn-hooks.ts +50 -0
  151. package/src/services/tool-executor.ts +69 -288
  152. package/src/services/tool-outcomes.ts +12 -10
  153. package/src/settings/preferences-accounts.ts +42 -3
  154. package/src/settings/preferences-dialog.ts +8 -1
  155. package/src/studio.ts +20 -6
  156. package/src/surfaces/block-action-bar.json +6 -1
  157. package/src/surfaces/dialog.ts +5 -0
  158. package/src/surfaces/jump-bar.json +9 -12
  159. package/src/surfaces/jump-bar.ts +15 -16
  160. package/src/surfaces/pane-context.json +2 -2
  161. package/src/surfaces/pane-grid.json +8 -25
  162. package/src/surfaces/pane-grid.ts +7 -8
  163. package/src/surfaces/statusbar.json +71 -3
  164. package/src/surfaces/statusbar.ts +66 -139
  165. package/src/surfaces/style-panel.json +3 -3
  166. package/src/surfaces/style-panel.ts +11 -1
  167. package/src/surfaces/welcome.json +86 -1
  168. package/src/surfaces/welcome.ts +61 -2
  169. package/src/types.ts +84 -2
  170. package/src/ui/ai-managed-connect.ts +41 -4
  171. package/src/ui/media-picker.ts +2 -1
  172. package/dist/chunks/adapter-bsbs78x9.js +0 -4
  173. package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
  174. package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
  175. package/dist/chunks/components-s51h3b7c.js +0 -4
  176. package/dist/chunks/content-source-ty3be0qg.js +0 -4
  177. package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
  178. package/dist/chunks/editor-t002b41m.js +0 -4
  179. package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
  180. package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
  181. package/dist/chunks/file-ops-78zeytkm.js +0 -4
  182. package/dist/chunks/files-gatzrz8v.js +0 -4
  183. package/dist/chunks/format-host-r59b1651.js +0 -4
  184. package/dist/chunks/fs-events-f8h91ndt.js +0 -4
  185. package/dist/chunks/git-panel-y12zf7nj.js +0 -4
  186. package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
  187. package/dist/chunks/grid-view-tafenfm2.css +0 -1
  188. package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
  189. package/dist/chunks/index-5aghyrfh.js +0 -4
  190. package/dist/chunks/jx-validate-653krkrf.js +0 -4
  191. package/dist/chunks/layers-32p8gtae.js +0 -4
  192. package/dist/chunks/layers-panel-rs58m105.js +0 -4
  193. package/dist/chunks/lit-html-54bmkwz3.js +0 -4
  194. package/dist/chunks/media-picker-5bb04wct.js +0 -4
  195. package/dist/chunks/menu-cbha7w2e.js +0 -4
  196. package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
  197. package/dist/chunks/notify-dc1nz5ar.js +0 -4
  198. package/dist/chunks/platform-2m49s1zf.js +0 -4
  199. package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
  200. package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
  201. package/dist/chunks/references-vx7mbj9f.js +0 -4
  202. package/dist/chunks/right-panel-7jzpbxja.js +0 -4
  203. package/dist/chunks/section-registry-gjryse41.js +0 -4
  204. package/dist/chunks/studio-3znfhcxg.js +0 -5
  205. package/dist/chunks/studio-58qam27v.js +0 -4
  206. package/dist/chunks/studio-6j59fwaw.js +0 -5
  207. package/dist/chunks/studio-7z69g1gx.js +0 -5
  208. package/dist/chunks/studio-93j3v6zx.js +0 -5
  209. package/dist/chunks/studio-9gf6v8zy.js +0 -5
  210. package/dist/chunks/studio-9rhmettf.js +0 -4
  211. package/dist/chunks/studio-ac5aq677.js +0 -10
  212. package/dist/chunks/studio-as65vbns.js +0 -5
  213. package/dist/chunks/studio-bkv0sga4.js +0 -6
  214. package/dist/chunks/studio-bttmqef4.js +0 -5
  215. package/dist/chunks/studio-c3y9d41k.js +0 -5
  216. package/dist/chunks/studio-ccegp7gz.js +0 -9
  217. package/dist/chunks/studio-chxabn98.js +0 -6
  218. package/dist/chunks/studio-cktcdsxz.js +0 -16
  219. package/dist/chunks/studio-cnspfke5.js +0 -5
  220. package/dist/chunks/studio-de3p1ktm.js +0 -5
  221. package/dist/chunks/studio-fsbcn530.js +0 -928
  222. package/dist/chunks/studio-gftga7a3.js +0 -64
  223. package/dist/chunks/studio-hf1rpcq0.js +0 -4
  224. package/dist/chunks/studio-hz02hq70.js +0 -5
  225. package/dist/chunks/studio-jnb285we.js +0 -5
  226. package/dist/chunks/studio-jsv3s3s1.js +0 -5
  227. package/dist/chunks/studio-ks7cksh0.js +0 -5
  228. package/dist/chunks/studio-nptx0dbs.js +0 -5
  229. package/dist/chunks/studio-pg0z7k98.js +0 -5
  230. package/dist/chunks/studio-pve0b2f2.js +0 -5
  231. package/dist/chunks/studio-q7zmjv3b.js +0 -6
  232. package/dist/chunks/studio-rpmvw7kj.js +0 -5
  233. package/dist/chunks/studio-rwhss52s.js +0 -5
  234. package/dist/chunks/studio-sbg3g3h0.js +0 -5
  235. package/dist/chunks/studio-sq1bn60g.js +0 -14
  236. package/dist/chunks/studio-vwz7rma2.js +0 -5
  237. package/dist/chunks/studio-wa55e8gf.js +0 -5
  238. package/dist/chunks/studio-x0mzdha2.js +0 -5
  239. package/dist/chunks/studio-xrgpakvc.js +0 -9
  240. package/dist/chunks/studio-xt3djk1w.js +0 -7
  241. package/dist/chunks/studio-yh3nggx1.js +0 -7
  242. package/dist/chunks/studio-zmecp6hq.js +0 -5
  243. package/dist/chunks/workspace-g6dvaete.js +0 -4
  244. package/dist/chunks/ws-client-shf41j5p.js +0 -4
@@ -1,4 +0,0 @@
1
- import{i_,OR}from"./studio-f8jyp45j.js";import"./studio-pve0b2f2.js";import"./studio-7z69g1gx.js";import"./studio-yh3nggx1.js";import"./studio-cktcdsxz.js";import"./studio-jnb285we.js";import"./studio-ks7cksh0.js";import"./studio-7jazdy6y.js";import"./studio-de3p1ktm.js";import"./studio-jsv3s3s1.js";import"./studio-zmecp6hq.js";import"./studio-eq27rrr0.js";import"./studio-sq1bn60g.js";import"./studio-ery42sqr.js";import"./studio-9rhmettf.js";export{OR as openPublishPanel,i_ as seedPublishConnected};
2
-
3
- //# debugId=7BD0BB4E6703275664756E2164756E21
4
- //# sourceMappingURL=publish-panel-nx3ycmma.js.map
@@ -1,4 +0,0 @@
1
- import{x_,kf}from"./studio-xc8ebsts.js";import"./studio-xt3djk1w.js";import"./studio-sbg3g3h0.js";import"./studio-xcng8nx7.js";import"./studio-9gf6v8zy.js";import"./studio-93j3v6zx.js";import"./studio-ac5aq677.js";import"./studio-hz02hq70.js";import"./studio-6j59fwaw.js";import"./studio-rwhss52s.js";import"./studio-chxabn98.js";import"./studio-xrgpakvc.js";import"./studio-yh3nggx1.js";import"./studio-c4pnt1c6.js";import"./studio-k1eaqyzm.js";import"./studio-vwz7rma2.js";import"./studio-cktcdsxz.js";import"./studio-8r4y2x0z.js";import"./studio-jnb285we.js";import"./studio-x0mzdha2.js";import"./studio-nptx0dbs.js";import"./studio-ks7cksh0.js";import"./studio-7jazdy6y.js";import"./studio-b4epb26c.js";import"./studio-de3p1ktm.js";import"./studio-jsv3s3s1.js";import"./studio-p1eggxcf.js";import"./studio-zmecp6hq.js";import"./studio-eq27rrr0.js";import"./studio-sq1bn60g.js";import"./studio-ery42sqr.js";import"./studio-9rhmettf.js";export{x_ as initQuickSearch,kf as openQuickSearch};
2
-
3
- //# debugId=7F12CDE5FA5A107464756E2164756E21
4
- //# sourceMappingURL=quick-search-yzrzh9x3.js.map
@@ -1,4 +0,0 @@
1
- import{yb,fc,As,_1,Ma,Jf,C1,Yf}from"./studio-k1eaqyzm.js";import"./studio-jsv3s3s1.js";import"./studio-ery42sqr.js";export{Ma as invalidateUsages,As as loadUsages,fc as peekUsages,_1 as retryUsages,Yf as usageFiles,Jf as usageHeadline,C1 as usageWarning,yb as usagesSupported};
2
-
3
- //# debugId=C074AC436A2F844064756E2164756E21
4
- //# sourceMappingURL=references-vx7mbj9f.js.map
@@ -1,4 +0,0 @@
1
- import{__,FR,Ef,td,Tf}from"./studio-wa55e8gf.js";import"./studio-hc9q4j24.js";import"./studio-bkv0sga4.js";import"./studio-rpmvw7kj.js";import"./studio-9gf6v8zy.js";import"./studio-21enxdr8.js";import"./studio-chxabn98.js";import"./studio-c4pnt1c6.js";import"./studio-k1eaqyzm.js";import"./studio-vwz7rma2.js";import"./studio-cktcdsxz.js";import"./studio-8r4y2x0z.js";import"./studio-jnb285we.js";import"./studio-x0mzdha2.js";import"./studio-nptx0dbs.js";import"./studio-ks7cksh0.js";import"./studio-7jazdy6y.js";import"./studio-b4epb26c.js";import"./studio-de3p1ktm.js";import"./studio-jsv3s3s1.js";import"./studio-p1eggxcf.js";import"./studio-zmecp6hq.js";import"./studio-eq27rrr0.js";import"./studio-sq1bn60g.js";import"./studio-ery42sqr.js";import"./studio-9rhmettf.js";import"./studio-k1wvtp03.js";export{td as inspectorTab,__ as mount,Ef as render,Tf as setInspectorTab,FR as unmount};
2
-
3
- //# debugId=877814838271359A64756E2164756E21
4
- //# sourceMappingURL=right-panel-7jzpbxja.js.map
@@ -1,4 +0,0 @@
1
- import{Na,ib,rs,i1,jf,gw,bw,ob,rb}from"./studio-hf1rpcq0.js";export{Na as notifySettingsDocument,ib as onSettingsDocumentChanged,rs as registerSettingsSection,rb as setSettingsSection,ob as settingsDocumentSection,bw as settingsSection,gw as settingsSectionKeys,jf as sortedSettingsSections,i1 as unregisterSettingsSection};
2
-
3
- //# debugId=D5AD945020ABAAD164756E2164756E21
4
- //# sourceMappingURL=section-registry-gjryse41.js.map
@@ -1,5 +0,0 @@
1
- import{qt,yi,Zt,Lr,Hs}from"./studio-de3p1ktm.js";import{ge,ee,v,S}from"./studio-9rhmettf.js";import{bi,q,Rl,ot,vi,li,ke,la,oo,je,hx,lp,$l,lv,g,u,ci}from"./studio-ks7cksh0.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-sq1bn60g.js";import{kw,wu,cd,xu}from"./studio-21enxdr8.js";import{wi,T,R}from"./studio-zmecp6hq.js";import{uc,lb,_u,zf,xE,u1}from"./studio-hz02hq70.js";import{hr}from"./studio-cktcdsxz.js";import{LE}from"./studio-6j59fwaw.js";import{mw,nb,na,t1,sE}from"./studio-93j3v6zx.js";import{D}from"./studio-73czgk6a.js";import{Ae}from"./studio-625ezz59.js";import{me}from"./studio-7gqyhjns.js";var hw=["string","number","boolean","array","object","reference"],pw=["","image","date","color"];function Pf(e){if(e.$ref)return"reference";return e.type||"string"}function lc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function $s(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,l=()=>R("schema-builder",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=v({...ve(),...r}),a=null,n=!0,s=!1,l=()=>R("reference-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Q(e,r){e.textContent="";let t=v({...xe(),...r,shown:""}),a=null,n=!0,s=!1,l=()=>R("secret-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var Se=hw.map((e)=>({label:e,value:e})),Fe=pw.map((e)=>({label:e||"(none)",value:e})),j={format:"",name:"",required:!1,type:"string"},Z=[],re=" ";function Ne(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],a=t.join(" ");if(a!==re)re=a,Z=t.map((n)=>({label:n,value:n}));return Z}function E(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Te(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function A(e){return`name:${e}`}function H(e){return`required:${e}`}function V(e,r){return`${e} ${r}`}function O(e,r,t){return e.echo?.id===r?e.echo.value:t}function Ee(e,r,t,a,n){let s=V(r,t),l=Pf(a);return{format:lc(a),hasFormat:E(l),key:t,name:O(e,A(s),t),parent:r,required:O(e,H(s),n),type:l}}function Ce(e,r,t,a,n){let s=Pf(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,h])=>Ee(e,r,w,h,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&n?"reference":l?"nested":"none",format:lc(t),hasFormat:E(s),key:r,label:$l(r),name:O(e,A(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,H(r),a),type:s}}function ae(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function M(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...j},addOpen:!1,drafts:new Map,echo:null},s=()=>a??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Ne(t.ctx);return{addFormat:n.add.format,addHasFormat:E(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(i.properties??{}).map(([m,f])=>Ce(n,m,f,d.includes(m),c.length>0)),formatOptions:Fe,targets:c,typeOptions:Se}},p=()=>N.update(l()),o=(i,d)=>{n.echo={id:i,value:d},p()},w=()=>{n.echo=null,p()},h=(i)=>{let d=Te(s());if(!i(d)){w();return}a=d,n.echo=null,t.onChange(d),p()},y=(i,d)=>i.properties[d],x=(i)=>{let d=n.drafts.get(i);if(!d)d={name:"",type:"string"},n.drafts.set(i,d);return d},N=Y(e,{addNested(i){let d=x(i),c=lv(d.name.trim());if(!c)return;h((m)=>{let f=y(m,i);if(!f)return!1;return f.properties??={},f.properties[c]=$s(d.type||"string"),d.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...j},p()},confirmAdd(){let i=lv(n.add.name.trim());if(!i)return;let{format:d,required:c,type:m}=n.add;n.addOpen=!1,n.add={...j},h((f)=>{if(f.properties[i]=$s(m,d||void 0),c)M(f,i,!0);return!0})},editAddFormat(i){n.add.format=i,p()},editAddName(i){n.add.name=i,p()},editAddRequired(i){n.add.required=i,p()},editAddType(i){n.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){n.addOpen=!0,n.add={...j},p()},removeField(i){h((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){h((c)=>{let m=y(c,i);if(!m?.properties?.[d])return!1;if(delete m.properties[d],m.required)m.required=m.required.filter((f)=>f!==d);return!0})},renameField(i,d){o(A(i),d);let c=lv(d.trim());h((m)=>{if(!m.properties[i]||!c||c===i||m.properties[c])return!1;return ae(m.properties,i,c),m.required=m.required.map((f)=>f===i?c:f),!0})},renameNested(i,d,c){o(A(V(i,d)),c);let m=lv(c.trim());h((f)=>{let b=y(f,i);if(!b?.properties?.[d]||!m||m===d||b.properties[m])return!1;if(ae(b.properties,d,m),b.required)b.required=b.required.map((C)=>C===d?m:C);return!0})},setFormat(i,d){h((c)=>{let m=c.properties[i];if(!m)return!1;return c.properties[i]=$s(m.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){h((m)=>{let f=y(m,i),b=f?.properties?.[d];if(!f?.properties||!b)return!1;return f.properties[d]=$s(b.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(H(V(i,d)),c),h((m)=>{let f=y(m,i);if(!f)return!1;return M(f,d,c),!0})},setNestedType(i,d,c){h((m)=>{let f=y(m,i),b=f?.properties?.[d];if(!f?.properties||!b)return!1;let C=E(c)?lc(b):void 0;return f.properties[d]=$s(c,C||void 0),!0})},setRequired(i,d){o(H(i),d),h((c)=>{if(!c.properties[i])return!1;return M(c,i,d),!0})},setTarget(i,d){h((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){h((c)=>{let m=c.properties[i];if(!m)return!1;let f=E(d)?lc(m):void 0;return c.properties[i]=$s(d,f||void 0),!0})}});return p(),{dispose:()=>N.dispose(),update(i){t=i,a=null,n.echo=null,p()}}}var De={mount:Re};kw("schema-builder",De);function oe(e){return typeof e==="string"&&e?e:null}function qe(e,r){let t=r,a=()=>{let s=oe(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Q(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;n.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((h)=>{if(typeof h==="string"&&h&&h!==w)o(h)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var He={mount:qe};kw("secret",He);var k=new Map,P=new Map,F=new Map;function B(e){if(e===void 0)k.clear(),P.clear(),F.clear();else k.delete(e),P.delete(e),F.delete(e)}function Oe(e){let r=k.get(e);if(r)return r;let t=(me("ty3be0qg"),import("./content-source-ty3be0qg.js")).then((a)=>a.listCollectionEntryIds(e));return k.set(e,t),t}function X_(e,r){let t=P.get(e);if(t)return t;let a=Oe(e),n=F.get(e);if(n){if(r)n.add(r);return null}F.set(e,new Set(r?[r]:[]));let s=(l)=>{if(k.get(e)!==a)return;let p=F.get(e);F.delete(e),P.set(e,l);for(let o of p??[])o()};return a.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=wu(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=X_(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Pe(t,n))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=wu(t.schema);if(l!==null)B(l);n()}});return n(),{dispose(){a=!0,s.dispose()},update(l){t=l,n()}}}var Me={mount:Le};kw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,l=!1,p=R("entry-editor",n,e,{onNodeCreated:(o,w,h)=>{if(o instanceof HTMLElement&&Be(h)==="fields")a.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(n,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Ff(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Ae(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let l=s?void 0:Ae(t);bi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,LE()}function z(e,r,t){if(ce(e))ze(e,r,t);else Rl(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[a,n]of Object.entries(r))z(t,a,n)})}var fe="entry",Ie=[fe],L=new Map;function I(e){return L.get(e)??null}function Q_(e,r){let t=I(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function tb(e){let r=L.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),L.delete(e)}function _(e,r){q(e,(t)=>z(t,uc,r))}function oE(e){let r=na(e.documentPath),t=Ff(e);if(!r||!zf(r.schema,t))return null;let a=_u(t);return{draft:a,text:a?"Draft":"Published",title:a?lb:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>xu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let a of sE(e.schema,r))t[a]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let a=wi(e,"entry"),n=wi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:lb,emptyLine:Je(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=Ff(r),l=_u(s);return{collection:t.name,draft:l,draftAxis:zf(t.schema,s)?"shown":"hidden",draftHint:lb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:lb,noteState:l?"shown":"hidden",region:a,stage:"entry"}}function rE(e,r){let{paneId:t,wrap:a}=e;if(Q_(t,r))return;tb(t);let n=null,s=null,l=()=>{if(n!==null&&I(t)===n)o()},p=(y)=>{if(!s||!y)return;let x=Ff(r),N=cd(`entry:${t}`,y.schema,x,{context:_e(r),errors:We(y,x),onChange:(i)=>pe(r,i),rerender:l});if(N.parentNode!==s)s.replaceChildren(N)},o=()=>{let y=na(r.documentPath);if(!y)s=null;n?.surface.update(ue(t,r,y)),p(y)},w=ge(),h=le(a,ue(t,r,na(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(y)=>_(r,y)},{fieldsSlot:(y)=>{s=y,p(na(r.documentPath))}});n={paneId:t,scope:w,surface:h,tabId:r.id,wrap:a},L.set(t,n),w.run(()=>{ee(()=>{if(I(t)!==n)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("gatzrz8v"),import("./files-gatzrz8v.js"));await r(e);for(let[t,a]of g.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Ie)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,ci(t),a}return null}function J(){return nb().map((e)=>e.name)}async function Ue(e){let r=t1(e.schema),t=(e.def.format?yi(e.def.format)?.name:void 0)??Zt(`untitled${e.ext}`)?.name??Lr()?.name;if(e.ext===".json"||t===void 0)return hr(r,null);return Hs(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function fw(e,r={}){let t=mw(e);if(!t)return S.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await qt().catch(()=>{});let a;try{a=await Ue(t)}catch(o){return S.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&lp(n)?.name===t.name?n:t.dir;if(s.includes(hx))return S.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("gatzrz8v"),import("./files-gatzrz8v.js")),p=await l({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return B(t.name),await W(p),p}function he(){let e=u.value;return e&&na(e.documentPath)?e:null}function Ye(){return[{args:ke({collection:la(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await fw(li("content.newEntry",r,"collection",t))},title:"New Entry"},{args:ke({path:je("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(ot("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:ke({draft:oo("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,vi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:ke({include:oo("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{xE(vi("content.setIncludeDrafts",r,"include")),await u1()},title:"Include Drafts"}]}function e1(e){e.registerAll(Ye())}
2
- export{hw,pw,Pf,lc,$s,X_,Ff,Q_,tb,oE,rE,fw,e1};
3
-
4
- //# debugId=E10A6E2EB69511E264756E2164756E21
5
- //# sourceMappingURL=studio-3znfhcxg.js.map
@@ -1,4 +0,0 @@
1
- import{Tg,Is,Iy,Br,Ry,os}from"./studio-6j2jn55a.js";var OS="meta",MS="frontmatter",PS="structure",FS="source",jS=2;function Gc(t){return t.getMap(OS)}function HS(t){return t.getMap(MS)}function ff(t){return t.getMap(PS)}function BS(t){return t.getText(FS)}function f(t){return JSON.parse(JSON.stringify(t))}function h(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var y=new Set(["textContent"]),m=new Set(["style","attributes","$props"]);function g(t,e){let n=t.toString();if(n===e)return!1;let r=0,o=Math.min(n.length,e.length);while(r<o&&n[r]===e[r])r+=1;let i=n.length,a=e.length;while(i>r&&a>r&&n[i-1]===e[a-1])i-=1,a-=1;if(i>r)t.delete(r,i-r);if(a>r)t.insert(r,e.slice(r,a));return!0}function l(t){let e=new Br;for(let[n,r]of Object.entries(t)){if(r===void 0)continue;e.set(n,h(r)?l(r):f(r))}return e}function Y(t,e){for(let n of[...t.keys()])if(!(n in e)||e[n]===void 0)t.delete(n);for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o=t.get(n);if(h(r))if(o instanceof Br)Y(o,r);else t.set(n,l(r));else if(!b(o,r))t.set(n,f(r))}}function b(t,e){if(t===e)return!0;if(t instanceof Br||t instanceof Is||t instanceof os)return!1;return JSON.stringify(t??null)===JSON.stringify(e??null)}function p(t){return typeof t==="string"?new os(t):zS(t)}function Ph(t){let e=new Is;return e.insert(0,t.map((n)=>p(n))),e}function zS(t){if(!h(t))throw TypeError("collab-schema: a document node must be a plain object");let e=new Br;for(let[n,r]of Object.entries(t)){if(r===void 0)continue;if(n==="children"&&Array.isArray(r))e.set(n,Ph(r));else if(y.has(n)&&typeof r==="string")e.set(n,new os(r));else if(m.has(n)&&h(r))e.set(n,l(r));else e.set(n,f(r))}return e}function Kc(t){if(t instanceof Br){let e={};for(let[n,r]of t.entries())e[n]=Kc(r);return e}if(t instanceof Is)return t.toArray().map((e)=>Kc(e));if(t instanceof os)return t.toString();return t}function aR(t){return Kc(ff(t))}function Ty(t,e){let n=ff(t);for(let r of e)if(n instanceof Br)n=n.get(String(r));else if(n instanceof Is){let o=typeof r==="number"?r:Number(r);if(!Number.isInteger(o)||o<0||o>=n.length)return;n=n.get(o)}else return;return n}function Y0(t,e,n){let r=BS(t);if(r.toString()===e)return!1;return t.transact(()=>{g(r,e)},n),!0}function lR(t,e,n={}){let r=Gc(t);if(r.get("structureSeeded")===!0)return!1;return t.transact(()=>{let o=ff(t);for(let[a,s]of Object.entries(e)){if(s===void 0)continue;if(a==="children"&&Array.isArray(s))o.set(a,Ph(s));else o.set(a,f(s))}let i=HS(t);for(let[a,s]of Object.entries(n.frontmatter??{}))if(s!==void 0)i.set(a,f(s));r.set("schemaVersion",jS),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",n.sourceFormat??null),r.set("structureSeeded",!0)},n.origin),!0}var cR="jx-local",dR="jx-mirror",uR="jx-seed";class Jc extends Error{constructor(t){super(`collab-path-unresolved:${t.join("/")}`);this.name="CollabPathError"}}function w(t,e){let n=Ty(t,e);if(!(n instanceof Br))throw new Jc(e);return n}function d(t,e,n){let r=w(t,e),o=r.get("children");if(o instanceof Is)return o;if(n&&o===void 0){let i=new Is;return r.set("children",i),i}throw new Jc([...e,"children"])}function R(t){return JSON.parse(JSON.stringify(t))}function P(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function M(t,e,n){let r=t.get(e);if(e==="children"&&Array.isArray(n)){t.set(e,Ph(n));return}if(y.has(e)&&typeof n==="string"){if(r instanceof os)g(r,n);else t.set(e,new os(n));return}if(m.has(e)&&P(n)){if(r instanceof Br)Y(r,n);else t.set(e,l(n));return}t.set(e,R(n))}function D(t,e){switch(e.op){case"set-key":{let n=w(t,e.path);if(e.value===void 0)n.delete(e.key);else M(n,e.key,e.value);return}case"insert-child":{let n=d(t,e.parentPath,!0);if(e.index<0||e.index>n.length)throw new Jc([...e.parentPath,"children",e.index]);n.insert(e.index,[p(e.node)]);return}case"remove-child":{let n=d(t,e.parentPath,!1);if(e.index<0||e.index>=n.length)throw new Jc([...e.parentPath,"children",e.index]);n.delete(e.index,1);return}case"set-child":{let n=d(t,e.parentPath,!1);if(e.index<0||e.index>=n.length)throw new Jc([...e.parentPath,"children",e.index]);let r=n.get(e.index);if(r instanceof os&&typeof e.node==="string"){g(r,e.node);return}n.delete(e.index,1),n.insert(e.index,[p(e.node)]);return}case"move-child":{let n=d(t,e.fromParentPath,!1),r=d(t,e.toParentPath,!0);if(e.fromIndex<0||e.fromIndex>=n.length)throw new Jc([...e.fromParentPath,"children",e.fromIndex]);let o=Kc(n.get(e.fromIndex));if(n.delete(e.fromIndex,1),e.toIndex<0||e.toIndex>r.length)throw new Jc([...e.toParentPath,"children",e.toIndex]);r.insert(e.toIndex,[p(o)]);return}default:throw Error(`unknown-doc-op:${e.op}`)}}function hR(t,e,n){t.transact(()=>{for(let r of e)D(t,r)},n)}function C(t){for(let e=0;e<t.length;e++){let n=t[e];if(typeof n!=="string")continue;if(m.has(n))return{key:n,nodePath:t.slice(0,e)};if(y.has(n))return{key:n,nodePath:t.slice(0,e)}}return null}function J(t){return t.every((e)=>typeof e==="string"||typeof e==="number")}function pR(t){if(t.length===0)return[];let e=t.map((o)=>o.path);if(!e.every((o)=>J(o)))return null;for(let o=0;o<e.length;o++)for(let i=0;i<e.length;i++){if(o===i)continue;let a=e[o],s=e[i];if(a.length<=s.length&&a.every((c,u)=>c===s[u]))return null}if(t.filter((o)=>o instanceof Tg).length>1)return null;let r=[];for(let o of t){let i=o.path,a=C(i);if(a){let{doc:s}=o.target;if(!s)return null;let c=Ty(s,[...a.nodePath,a.key]);if(c===void 0)return null;r.push({key:a.key,op:"set-key",path:a.nodePath,value:Kc(c)});continue}if(o instanceof Ry){let s=i.at(-1);if(i.at(-2)==="children"&&typeof s==="number"){r.push({index:s,node:o.target.toString(),op:"set-child",parentPath:i.slice(0,-2)});continue}return null}if(o instanceof Iy){let s=o.target;for(let[c,u]of o.changes.keys)if(u.action==="delete")r.push({key:c,op:"set-key",path:i});else r.push({key:c,op:"set-key",path:i,value:Kc(s.get(c))})}else if(o instanceof Tg){if(i.at(-1)!=="children")return null;let s=i.slice(0,-1),c=0;for(let u of o.changes.delta)if(u.retain!==void 0)c+=u.retain;else if(u.delete!==void 0)for(let x=0;x<u.delete;x++)r.push({index:c,op:"remove-child",parentPath:s});else if(u.insert!==void 0){let x=Array.isArray(u.insert)?u.insert:[u.insert];for(let O of x)r.push({index:c,node:Kc(O),op:"insert-child",parentPath:s}),c+=1}}else return null}return r}function fR(t,e,n){t.transact(()=>{let r=ff(t),o=e,i=[...r.keys()];for(let s of i)if(!(s in o)||o[s]===void 0)r.delete(s);for(let[s,c]of Object.entries(o)){if(c===void 0)continue;if(s==="children"&&Array.isArray(c))r.set(s,Ph(c));else r.set(s,JSON.parse(JSON.stringify(c)))}let a=Gc(t);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},n)}function Z0(t){return Gc(t).get("canonical")==="source"?"source":"structure"}function X0(t){return Number(Gc(t).get("canonicalRev")??0)}function mR(t,e,n){if(Z0(t)==="source")return!1;return t.transact(()=>{Y0(t,e,n);let r=Gc(t);r.set("canonical","source"),r.set("canonicalRev",X0(t)+1)},n),!0}function gR(t,e){if(Z0(t)!=="source")return!1;return t.transact(()=>{let n=Gc(t);n.set("canonical","structure"),n.set("canonicalRev",X0(t)+1)},e),!0}function bR(t,e,n){let r=[];for(let[o,i]of t.getStates()){let a=i;if(o!==n&&a.mode==="source"&&a.focusedPath===e)r.push(o)}return r}function vR(t,e){let n=t.clientID,r=t.getStates().get(n);if(r?.mode!=="source"||r.focusedPath!==e)return!1;let o=n;for(let[i,a]of t.getStates()){let s=a;if(s.mode==="source"&&s.focusedPath===e&&s.canWrite!==!1&&i<o)o=i}return o===n}var Q0=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function yR(t){let e=5381;for(let r=0;r<t.length;r++)e=Math.imul(e,33)+(t.codePointAt(r)??0);let n=Math.abs(e)%Q0.length;return Q0[n]}export{OS,MS,PS,FS,jS,Gc,HS,ff,BS,Ph,zS,Kc,aR,Ty,Y0,lR,cR,dR,uR,Jc,hR,pR,fR,Z0,X0,mR,gR,bR,vR,Q0,yR};
2
-
3
- //# debugId=89D872651CC4A11064756E2164756E21
4
- //# sourceMappingURL=studio-58qam27v.js.map
@@ -1,5 +0,0 @@
1
- import{f,et}from"./studio-jsv3s3s1.js";import{te}from"./studio-ery42sqr.js";import{As,C1}from"./studio-k1eaqyzm.js";import{ge,Ka,ee,v,re,Yi,qr,S,Ya,nh,Lp}from"./studio-9rhmettf.js";import{Pu,Te,q,hm,yc,Jo,iv,ov,on,ca,fm,_C,An,g,u}from"./studio-ks7cksh0.js";import{qt,yi,yp,Zt,Lr,FC,Hs,jC}from"./studio-de3p1ktm.js";import{sm}from"./studio-x0mzdha2.js";import{tS,ZL,XL,$d,$m,ne}from"./studio-sq1bn60g.js";import{wi,T,R,rn,Xo}from"./studio-zmecp6hq.js";import{$t}from"./studio-p1eggxcf.js";import{ls,hr,y}from"./studio-cktcdsxz.js";import{HE}from"./studio-yh3nggx1.js";import{hc}from"./studio-rwhss52s.js";import{oa,gb}from"./studio-xrgpakvc.js";import{st,qo,qE,M1}from"./studio-vwz7rma2.js";import{pb}from"./studio-x5esgzct.js";import{K,ro,Zo,Oo,D,wx}from"./studio-73czgk6a.js";import{We}from"./studio-as65vbns.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 qe="pane",Ye="pane-stage",Vf=`[part="${qe}"]`,_E=`[part="${Ye}"]`,Qe=new Map([["pane","pane"],["strip","strip"],["jump","jump"],["chrome","chrome"],["pane-stage","stage"],["drop-zone","dropZone"]]);function Xe(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function Ze(e){let t=e?.$map?.item;return typeof t?.id==="string"?t.id:""}function CE(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=Qe.get(Xe(x));if(G)n.cellPart(Ze(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":We(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 ro(i).entries()){if(typeof x==="string")continue;let E=[...l,"children",w];c.push($e(e,E,Oo(x),h))}return c}function $e(e,t,r,n){let l=K(e,t),i=l?Oo(l):r,d={args:{path:t},command:"selection.set",label:i};return Zo(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?Oo(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(Vf)??document.documentElement).style.setProperty(tt,`${e}px`)}function pt(e){let t=it(st(e),qo(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 Iw(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,wi(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 SE(e){mt(),Iw(An,e),H=ge(),H.run(()=>{ee(()=>{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=Yi()){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 kE(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 X=null,Ee=new Map;function je(e){if(e)Ee.set(e,Yi())}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 Z(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=Lp(),l=HE(),i=u.value?on(u.value).peers.length:0;return Z(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 Pu[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 Z(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?Z(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?Z(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,Q=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||!wx)return;J=R("statusbar",Ge(),wx),J.then((e)=>{Q=e})}function f1(){Ge().fields=kt(),Pt()}function EE(){Ct(),X=ge(),X.run(()=>{ee(()=>{ne(),y.stylebook.selection,y.git.status,qr.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;f1()})})}function Ct(){X?.stop(),X=null;let e=J;if(J=null,Q)Q.dispose(),Q=null;else if(e)e.then((t)=>t.dispose());Y=null}var Me={invokerTags:$m,popoverTags:$d},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){Ya((i)=>i.source===B);let r=new Map,n=ZL(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=qE(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=nh(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=XL(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)yc(h,l,c,"");for(let c of d.breakpoints)ov(h,l,[c],"display","");if(d.openDisplay!==null)iv(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)=>{Jo(i,l,"popovertarget"),Jo(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)=>{Jo(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 TE(e){e.registerAll(Et())}function db(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 ss(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 Wf(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 Tw(e){let t=Wf(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 p=n.errors.get(o);if(p)p.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 p=n.inserts.get(o);if(p){if(s===null)delete p[a];else p[a]=s;return}if(db(s,e.resolveBaseline(o,a))){let m=n.pending.get(o);if(m?.delete(a),m?.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 p=n.pending.get(o)?.get(a);return p?p.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 p of s)E(p,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 p=s.ops.map((b)=>a(b)).filter((b)=>b!==null);return p.length>0?{kind:"group",ops:p}: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 p=n.pending.get(s.rowKey);if(p?.delete(s.field),p?.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[p,b]of s)o.push({baseline:e.resolveBaseline(a,p),field:p,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 p=w(o,a);if(db(p,s))return;c(o,a,s),h({after:s,at:r(),before:p,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(ca(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 ub(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 hb(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 Cu(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 Lw="__key",he=new WeakMap;function Oa(e){return e?he.get(re(e))??null:null}function Su(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((m)=>m.field===b.field)).map((b)=>({error:"Required",field:b.field,ok:!1,rowKey:b.rowKey})),p=o.inserts.filter((b)=>a.some((m)=>b.cells[m.field]===null||b.cells[m.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&&p.length===0)return null;return{cells:s,deletes:[],inserts:p}},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((p)=>p.key),{dir:a,orderBy:s}=r.query;if(s&&!t.capabilities.remoteSort){let p=r.columns.find((m)=>m.field===s)?.kind,b=a==="desc"?-1:1;o=o.toSorted((m,C)=>{let j=i.effectiveValue(m,s),ae=i.effectiveValue(C,s);if(c(j)!==c(ae))return c(j)?1:-1;return b*w(j,ae,p)})}return r.grouping?[...E(o).values()].flat():o},E=(o)=>{let a=new Map;for(let s of o){let p=Ro(i.effectiveValue(s,r.grouping)),b=a.get(p);if(b)b.push(s);else a.set(p,[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((m)=>m.editable&&(m.kind==="string"||m.kind==="text")),p=[...r.rows.map((m)=>m.key),...i.state.inserts.keys()],b=0;if(i.group(()=>{for(let m of p){if(i.rowState(m)==="pending-delete")continue;for(let C of s){let j=i.effectiveValue(m,C.field);if(typeof j==="string"&&j.includes(o))i.setCell(m,C.field,j.replaceAll(o,a)),b+=1}}}),b>0)P();return b},effectiveRows(){let o=(p)=>Array.isArray(p)?[...p]:p!==null&&typeof p==="object"?{$ref:p.$ref}:p,a=(p)=>{let b={[Lw]:p};for(let m of r.columns)b[m.field]=o(i.effectiveValue(p,m.field));return b},s=x().map((p)=>a(p));for(let[p]of i.state.inserts)s.push(a(p));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 Xo("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 Xo("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((m)=>m.rowKey)).size+o.inserts.length+o.deletes.length>5?oa({title:"Saving grid"}):null;r.saving=!0;try{let m=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 m.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(m),m.inserts.some((k)=>k.ok)||m.deletes.some((k)=>k.ok))await d();let se=m.cells.filter((k)=>k.ok).length+m.inserts.filter((k)=>k.ok).length+m.deletes.filter((k)=>k.ok).length,be=a-se,we=m.cells.filter((k)=>k.stale).length+m.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(m){S.error("Could not save the grid.",{action:"file.save",detail:te(m),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(()=>{ee(()=>{e.doc.dirty=i.isDirty()}),hm(e,{canRedo:()=>i.canRedo(),canUndo:()=>i.canUndo(),redo:()=>{i.redo(),P()},undo:()=>{i.undo(),P()}});let o=f();if(o.subscribeFileEvents&&t.backingPaths){let a=o.subscribeFileEvents((s)=>{let p=t.backingPaths(),b=new Set;for(let m of s){if(m.isDir)continue;let C=m.path.replaceAll("\\","/"),j=p.get(C);if(j!==void 0&&!hc(C))b.add(j)}if(b.size===0)return;if(i.isDirty()){let m=b.has("*")?r.rows.map((C)=>C.key):[...b];i.markStale(m),S.warn("Grid rows changed on disk — marked stale; refresh to reload.",{key:"grid.stale",source:"Data"}),P()}else M.refresh()});Ka(a)}Ka(()=>{hm(e,null),he.delete(re(e)),t.dispose?.()})}),he.set(re(e),M),M}async function dd(e){let r=Oa(e)?.serializeForSource();if(r)return r;await qt();let n=yi(e.doc.sourceFormat);if(n?.capabilities.serialize){let l=e.doc.content?.frontmatter||{},i=e.doc.document,d={...l,...i,children:i.children??[]};return Hs(n.name,d,{mode:"roundtrip"})}if(e.doc.mode==="content"){let l=Lr();if(l){let i=e.doc.content?.frontmatter??{},d=Object.keys(i).length>0,h={...i,...e.doc.document};return Hs(l.name,h,{frontmatter:d,mode:"roundtrip"})}}return hr(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(!et())return;let e=f();if(!e.setPreviewOverlay||!e.clearPreviewOverlay)return;let t=new Set;for(let r of Ft()){let n=r.documentPath.replace(/^\.\//,""),l;try{l=await dd(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 LE(){Ke()}function IE(){if(V)return;V=!0,ie=ge(),ie.run(()=>{ee(()=>{for(let e of g.tabs.values())e.doc.dirty,e.doc.document;Ke()})})}function RE(){if(V=!1,A)clearTimeout(A),A=null;L=null,ie?.stop(),ie=null,_.clear()}async function Rw(){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 $w(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",Ve="application/yaml",bn={".markdown":`${Le}; charset=utf-8`,".md":`${Le}; charset=utf-8`,".yaml":`${Ve}; charset=utf-8`,".yml":`${Ve}; charset=utf-8`};async function Nt(e,t){let r=await FC(e.name,t);return jC(e,r)}async function kr(e,t){await qt();let r=Zt(e);if(!r||!r.capabilities.parse)throw yp(e);return{...await Nt(r,t),format:r}}var m1=async(e,t)=>{if(e.documentPath&&Zt(e.documentPath)){let n=await kr(e.documentPath,t);return{document:n.document,frontmatter:n.frontmatter}}let r=ls(t);return e.doc.layout=r.layout,{document:r.document}};var Ie=()=>{};function g1(e){Ie=e}function I(e){je(e.documentPath);let t=e.doc.document;Ie(e.documentPath,t);let r=typeof t.tagName==="string"&&t.tagName.includes("-")?pb(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!sm(e.documentPath??"")}async function Xh(e=u.value){if(!e)return!1;if(await M1(e.id),fm(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=Oa(e);if(t)return await t.save(),!e.doc.dirty;try{if(await _C(e))return I(e),!0;let r=await dd(e);if(e.documentPath)return await f().writeFile(e.documentPath,r),e.doc.dirty=!1,Rw(),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 yi(e.doc.sourceFormat)??(e.doc.mode==="content"?Lr():void 0)}async function b1(){let e=u.value;if(!e)return;try{await qt();let t=Kt(e),r=await dd(e),n=t?$w(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 ze(e,t){let r=sm(e)?await gb(e):await As({path:e});return C1(r,t)??""}async function Uf(e){let t=await ze(e.path,"delete"),r=`Delete ${e.name}? This cannot be undone.`;return Boolean(await Xo("Delete File",t===""?r:`${r} ${t}`,{confirmLabel:"Delete",destructive:!0}))}async function qf(e,t="rename"){let r=await ze(e,t);return r===""?void 0:r}
2
- export{db,ss,Wf,Tw,ub,hb,Cu,Ro,Lw,Oa,Su,Vf,_E,CE,Iw,SE,kE,f1,EE,TE,dd,LE,IE,RE,Rw,$w,kr,m1,g1,Xh,b1,Uf,qf};
3
-
4
- //# debugId=DF8E1639477BAC2264756E2164756E21
5
- //# sourceMappingURL=studio-6j59fwaw.js.map
@@ -1,5 +0,0 @@
1
- import{_t,Er,zr,Au}from"./studio-jnb285we.js";function Sf(){return Er(_t.cfToken)}function f_(t){zr(_t.cfToken,t||"")}function m_(){return Er(_t.cfAccountId)}function MR(t){zr(_t.cfAccountId,t||"")}function g_(){Au([_t.cfToken,_t.cfAccountId])}
2
- export{Sf,f_,m_,MR,g_};
3
-
4
- //# debugId=95211876B1C5C10C64756E2164756E21
5
- //# sourceMappingURL=studio-7z69g1gx.js.map
@@ -1,5 +0,0 @@
1
- import{Hu}from"./studio-ks7cksh0.js";import{cb}from"./studio-hz02hq70.js";import{D}from"./studio-73czgk6a.js";function c(){return Object.keys(D?.projectConfig?.content??{})}function mw(e){let n=cb(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 nb(){return c().map((e)=>mw(e)).filter((e)=>e!==null)}function na(e){let n=Hu(e??null,D?.projectConfig);return n?mw(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 t1(e);default:return""}}function t1(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 sE(e,n){return(Array.isArray(e?.required)?e.required:[]).filter((t)=>n[t]===void 0)}
2
- export{mw,nb,na,t1,sE};
3
-
4
- //# debugId=F91B334C68C4D74264756E2164756E21
5
- //# sourceMappingURL=studio-93j3v6zx.js.map
@@ -1,5 +0,0 @@
1
- import{f}from"./studio-jsv3s3s1.js";import{Co}from"./studio-sq1bn60g.js";import{qi,np,BT,zT}from"./studio-x0mzdha2.js";var r=new Map,d=new Map,a=new Map;function l(e,t){let n=BT(e),i=a.get(e);return{bytes:typeof t?.size==="number"?t.size:null,ext:qi(n),height:i?.height??null,kind:np({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function Qg(e){return r.get(Co(e))??null}function eE(e){for(let t of e){if(t.type!=="file")continue;let n=Co(t.path);if(!r.has(n))r.set(n,l(n,t))}}async function tE(e){let t=Co(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 f().listDirectory(zT(t))).find((m)=>Co(m.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 eb(e,t,n){if(!(t>0&&n>0))return!1;let i=Co(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 nE(){r.clear(),a.clear()}function Z_(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function iE(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(Z_(e.bytes));return t.join(" · ")}
2
- export{Qg,eE,tE,eb,nE,Z_,iE};
3
-
4
- //# debugId=A93E3563C7F8A3E764756E2164756E21
5
- //# sourceMappingURL=studio-9gf6v8zy.js.map
@@ -1,4 +0,0 @@
1
- function q(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var F=Object.assign;var je=Object.prototype.hasOwnProperty,j=(e,t)=>je.call(e,t),R=Array.isArray,C=(e)=>he(e)==="[object Map]";var de=(e)=>typeof e==="function",He=(e)=>typeof e==="string",O=(e)=>typeof e==="symbol",D=(e)=>e!==null&&typeof e==="object";var Ue=Object.prototype.toString,he=(e)=>Ue.call(e),me=(e)=>he(e).slice(8,-1);var H=(e)=>He(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var U=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ke=/-\w/g,ht=U((e)=>e.replace(Ke,(t)=>t.slice(1).toUpperCase())),ze=/\B([A-Z])/g,gt=U((e)=>e.replace(ze,"-$1").toLowerCase()),_e=U((e)=>e.charAt(0).toUpperCase()+e.slice(1)),mt=U((e)=>e?`on${_e(e)}`:""),E=(e,t)=>!Object.is(e,t);var We="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var _t=q(We+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var d;class Ee{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&d)if(d.active)this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=d;try{return d=this,e()}finally{d=t}}}on(){if(++this._on===1)this.prevScope=d,d=this}off(){if(this._on>0&&--this._on===0){if(d===this)d=this.prevScope;else{let e=d;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function ge(e){return new Ee(e)}function Ka(e,t=!1){if(d)d.cleanups.push(e)}var f;var X=new WeakSet;class W{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d)if(d.active)d.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,X.has(this))X.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Se(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ye(this),we(this);let e=f,t=m;f=this,m=!0;try{return this.fn()}finally{Te(this),f=e,m=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ae(e);this.deps=this.depsTail=void 0,ye(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)X.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Q(this))this.run()}get dirty(){return Q(this)}}var be=0,M,L;function Se(e,t=!1){if(e.flags|=8,t){e.next=L,L=e;return}e.next=M,M=e}function se(){be++}function oe(){if(--be>0)return;if(L){let t=L;L=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(M){let t=M;M=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function we(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Te(e){let t,n=e.depsTail,r=n;while(r){let i=r.prevDep;if(r.version===-1){if(r===n)n=i;ae(r),Ge(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function Q(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ne(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Ne(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===P)return;if(e.globalVersion=P,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Q(e)))return;e.flags|=2;let t=e.dep,n=f,r=m;f=e,m=!0;try{we(e);let i=e.fn(e._value);if(t.version===0||E(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{f=n,m=r,Te(e),e.flags&=-3}}function ae(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r)r.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ae(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Ge(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function ee(e,t){if(e.effect instanceof W)e=e.effect.fn;let n=new W(e);if(t)F(n,t);try{n.run()}catch(i){throw n.stop(),i}let r=n.run.bind(n);return r.effect=n,r}var m=!0,xe=[];function eh(){xe.push(m),m=!1}function th(){let e=xe.pop();m=e===void 0?!0:e}function Ex(e,t=!1){if(f instanceof W)f.cleanup=e}function ye(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=f;f=void 0;try{t()}finally{f=n}}}var P=0;class Ae{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!f||!m||f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==f){if(t=this.activeLink=new Ae(f,this),!f.deps)f.deps=f.depsTail=t;else t.prevDep=f.depsTail,f.depsTail.nextDep=t,f.depsTail=t;Re(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=f.depsTail,t.nextDep=void 0,f.depsTail.nextDep=t,f.depsTail=t,f.deps===t)f.deps=n}}return t}trigger(e){this.version++,P++,this.notify(e)}notify(e){se();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{oe()}}}function Re(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Re(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var te=new WeakMap,x=Symbol(""),ne=Symbol(""),V=Symbol("");function h(e,t,n){if(m&&f){let r=te.get(e);if(!r)te.set(e,r=new Map);let i=r.get(n);if(!i)r.set(n,i=new Y),i.map=r,i.key=n;i.track()}}function T(e,t,n,r,i,s){let o=te.get(e);if(!o){P++;return}let a=(c)=>{if(c)c.trigger()};if(se(),t==="clear")o.forEach(a);else{let c=R(e),l=c&&H(n);if(c&&n==="length"){let u=Number(r);o.forEach((p,g)=>{if(g==="length"||g===V||!O(g)&&g>=u)a(p)})}else{if(n!==void 0||o.has(void 0))a(o.get(n));if(l)a(o.get(V));switch(t){case"add":if(!c){if(a(o.get(x)),C(e))a(o.get(ne))}else if(l)a(o.get("length"));break;case"delete":if(!c){if(a(o.get(x)),C(e))a(o.get(ne))}break;case"set":if(C(e))a(o.get(x));break}}}oe()}function k(e){let t=re(e);if(t===e)return t;if(h(t,"iterate",V),N(e))return t;if(!w(e))return t.map(y);return Am(e)?t.map((n)=>A(y(n))):t.map(A)}function ce(e){return h(e=re(e),"iterate",V),e}function _(e,t){if(w(e))return Am(e)?A(y(t)):A(t);return y(t)}var $e={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,(e)=>_(this,e))},concat(...e){return k(this).concat(...e.map((t)=>R(t)?k(t):t))},entries(){return J(this,"entries",(e)=>(e[1]=_(this,e[1]),e))},every(e,t){return b(this,"every",e,t,void 0,arguments)},filter(e,t){return b(this,"filter",e,t,(n)=>n.map((r)=>_(this,r)),arguments)},find(e,t){return b(this,"find",e,t,(n)=>_(this,n),arguments)},findIndex(e,t){return b(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return b(this,"findLast",e,t,(n)=>_(this,n),arguments)},findLastIndex(e,t){return b(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return b(this,"forEach",e,t,void 0,arguments)},includes(...e){return Z(this,"includes",e)},indexOf(...e){return Z(this,"indexOf",e)},join(e){return k(this).join(e)},lastIndexOf(...e){return Z(this,"lastIndexOf",e)},map(e,t){return b(this,"map",e,t,void 0,arguments)},pop(){return I(this,"pop")},push(...e){return I(this,"push",e)},reduce(e,...t){return ve(this,"reduce",e,t)},reduceRight(e,...t){return ve(this,"reduceRight",e,t)},shift(){return I(this,"shift")},some(e,t){return b(this,"some",e,t,void 0,arguments)},splice(...e){return I(this,"splice",e)},toReversed(){return k(this).toReversed()},toSorted(e){return k(this).toSorted(e)},toSpliced(...e){return k(this).toSpliced(...e)},unshift(...e){return I(this,"unshift",e)},values(){return J(this,"values",(e)=>_(this,e))}};function J(e,t,n){let r=ce(e),i=r[t]();if(r!==e&&!N(e))i._next=i.next,i.next=()=>{let s=i._next();if(!s.done)s.value=n(s.value);return s};return i}var Ye=Array.prototype;function b(e,t,n,r,i,s){let o=ce(e),a=o!==e&&!N(e),c=o[t];if(c!==Ye[t]){let p=c.apply(e,s);return a?y(p):p}let l=n;if(o!==e){if(a)l=function(p,g){return n.call(this,_(e,p),g,e)};else if(n.length>2)l=function(p,g){return n.call(this,p,g,e)}}let u=c.call(o,l,r);return a&&i?i(u):u}function ve(e,t,n,r){let i=ce(e),s=i!==e&&!N(e),o=n,a=!1;if(i!==e){if(s)a=r.length===0,o=function(l,u,p){if(a)a=!1,l=_(e,l);return n.call(this,l,_(e,u),p,e)};else if(n.length>3)o=function(l,u,p){return n.call(this,l,u,p,e)}}let c=i[t](o,...r);return a?_(e,c):c}function Z(e,t,n){let r=re(e);h(r,"iterate",V);let i=r[t](...n);if((i===-1||i===!1)&&ot(n[0]))return n[0]=re(n[0]),r[t](...n);return i}function I(e,t,n=[]){eh(),se();let r=re(e)[t].apply(e,n);return oe(),th(),r}var Be=q("__proto__,__v_isRef,__isVue"),Oe=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(O));function qe(e){if(!O(e))e=String(e);let t=re(this);return h(t,"has",e),t.hasOwnProperty(e)}class le{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(n===(r?i?rt:Ie:i?Ce:ke).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=R(e);if(!r){let a;if(s&&(a=$e[t]))return a;if(t==="hasOwnProperty")return qe}let o=Reflect.get(e,t,Ad(e)?e:n);if(O(t)?Oe.has(t):Be(t))return o;if(!r)h(e,"get",t);if(i)return o;if(Ad(o)){let a=s&&H(t)?o:o.value;return r&&D(a)?G(a):a}if(D(o))return r?G(o):v(o);return o}}class fe extends le{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],s=R(e)&&H(t);if(!this._isShallow){let c=w(i);if(!N(n)&&!w(n))i=re(i),n=re(n);if(!s&&Ad(i)&&!Ad(n))if(c)return!0;else return i.value=n,!0}let o=s?Number(t)<e.length:j(e,t),a=Reflect.set(e,t,n,Ad(e)?e:r);if(e===re(r)&&a){if(!o)T(e,"add",t,n);else if(E(n,i))T(e,"set",t,n,i)}return a}deleteProperty(e,t){let n=j(e,t),r=e[t],i=Reflect.deleteProperty(e,t);if(i&&n)T(e,"delete",t,void 0,r);return i}has(e,t){let n=Reflect.has(e,t);if(!O(t)||!Oe.has(t))h(e,"has",t);return n}ownKeys(e){return h(e,"iterate",R(e)?"length":x),Reflect.ownKeys(e)}}class De extends le{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Xe=new fe,Je=new De,Ze=new fe(!0);var ie=(e)=>e,K=(e)=>Reflect.getPrototypeOf(e);function Qe(e,t,n){return function(...r){let i=this.__v_raw,s=re(i),o=C(s),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...r),u=n?ie:t?A:y;return!t&&h(s,"iterate",c?ne:x),F(Object.create(l),{next(){let{value:p,done:g}=l.next();return g?{value:p,done:g}:{value:a?[u(p[0]),u(p[1])]:u(p),done:g}}})}}function z(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function et(e,t){let n={get(i){let s=this.__v_raw,o=re(s),a=re(i);if(!e){if(E(i,a))h(o,"get",i);h(o,"get",a)}let{has:c}=K(o),l=t?ie:e?A:y;if(c.call(o,i))return l(s.get(i));else if(c.call(o,a))return l(s.get(a));else if(s!==o)s.get(i)},get size(){let i=this.__v_raw;return!e&&h(re(i),"iterate",x),i.size},has(i){let s=this.__v_raw,o=re(s),a=re(i);if(!e){if(E(i,a))h(o,"has",i);h(o,"has",a)}return i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){let o=this,a=o.__v_raw,c=re(a),l=t?ie:e?A:y;return!e&&h(c,"iterate",x),a.forEach((u,p)=>i.call(s,l(u),l(p),o))}};return F(n,e?{add:z("add"),set:z("set"),delete:z("delete"),clear:z("clear")}:{add(i){let s=re(this),o=K(s),a=re(i),c=!t&&!N(i)&&!w(i)?a:i;if(!(o.has.call(s,c)||E(i,c)&&o.has.call(s,i)||E(a,c)&&o.has.call(s,a)))s.add(c),T(s,"add",c,c);return this},set(i,s){if(!t&&!N(s)&&!w(s))s=re(s);let o=re(this),{has:a,get:c}=K(o),l=a.call(o,i);if(!l)i=re(i),l=a.call(o,i);let u=c.call(o,i);if(o.set(i,s),!l)T(o,"add",i,s);else if(E(s,u))T(o,"set",i,s,u);return this},delete(i){let s=re(this),{has:o,get:a}=K(s),c=o.call(s,i);if(!c)i=re(i),c=o.call(s,i);let l=a?a.call(s,i):void 0,u=s.delete(i);if(c)T(s,"delete",i,void 0,l);return u},clear(){let i=re(this),s=i.size!==0,o=void 0,a=i.clear();if(s)T(i,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{n[i]=Qe(i,e,t)}),n}function ue(e,t){let n=et(e,t);return(r,i,s)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_raw")return r;return Reflect.get(j(n,i)&&i in r?n:r,i,s)}}var tt={get:ue(!1,!1)},nt={get:ue(!1,!0)},it={get:ue(!0,!1)};var ke=new WeakMap,Ce=new WeakMap,Ie=new WeakMap,rt=new WeakMap;function st(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function v(e){if(w(e))return e;return pe(e,!1,Xe,tt,ke)}function Dm(e){return pe(e,!1,Ze,nt,Ce)}function G(e){return pe(e,!0,Je,it,Ie)}function pe(e,t,n,r,i){if(!D(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=i.get(e);if(s)return s;let o=st(me(e));if(o===0)return e;let a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function Am(e){if(w(e))return Am(e.__v_raw);return!!(e&&e.__v_isReactive)}function w(e){return!!(e&&e.__v_isReadonly)}function N(e){return!!(e&&e.__v_isShallow)}function ot(e){return e?!!e.__v_raw:!1}function re(e){let t=e&&e.__v_raw;return t?re(t):e}var y=(e)=>D(e)?v(e):e,A=(e)=>D(e)?G(e):e;function Ad(e){return e?e.__v_isRef===!0:!1}function Ja(e){return Me(e,!1)}function Nd(e){return Me(e,!0)}function Me(e,t){if(Ad(e))return e;return new Le(e,t)}class Le{constructor(e,t){this.dep=new Y,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:re(e),this._value=t?e:y(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||N(e)||w(e);if(e=n?e:re(e),E(e,t))this._rawValue=e,this._value=n?e:y(e),this.dep.trigger()}}class Pe{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Y(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=P-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&f!==this)return Se(this,!0),!0}get value(){let e=this.dep.track();if(Ne(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function Od(e,t,n=!1){let r,i;if(de(e))r=e;else r=e.get,i=e.set;return new Pe(r,i,n)}var at={assertive:"jx-live-assertive",polite:"jx-live-polite"};function ct(e){if(typeof document>"u")return null;let t=at[e],n=document.querySelector(`#${t}`);if(n)return n;let r=document.createElement("div");return r.id=t,r.setAttribute("aria-live",e),r.setAttribute("role",e==="assertive"?"alert":"status"),r.setAttribute("aria-atomic","true"),r.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(r),r}function Sv(e,t="polite"){if(e==="")return;let n=ct(t);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=e},0)}var Ve=null;function Yi(){return Ve??Date.now()}function tI(e){let t=e instanceof Date?e.getTime():typeof e==="number"?e:Date.parse(e);if(!Number.isFinite(t))throw TypeError(`clock: cannot pin to ${JSON.stringify(e)}`);return Ve=t,t}var lt={error:"problem",info:"toast",success:"toast",warn:"toast"},ft={error:8000,info:4000,success:4000,warn:8000},Fe=0;function ut(){return Fe+=1,`n${Fe}`}var Ec=v([]),qr=v([]),pt=4;function dt(e){return e==="problem"?qr:Ec}function S(e,t,n={}){let r=n.tier??lt[e],i={at:Yi(),id:ut(),message:t,severity:e,tier:r,...n.action===void 0?{}:{action:n.action},...n.actionArgs===void 0?{}:{actionArgs:n.actionArgs},...n.detail===void 0?{}:{detail:n.detail},...n.source===void 0?{}:{source:n.source},...n.path===void 0?{}:{path:n.path},...n.key===void 0?{}:{key:n.key},...r==="toast"?{timeoutMs:n.timeoutMs??ft[e]}:{}},s=dt(r);if(i.key!==void 0){let o=s.findIndex((a)=>a.key===i.key);if(o!==-1)s.splice(o,1)}if(s.push(i),r==="toast")while(Ec.length>pt)Ec.shift();return Sv(i.source===void 0?i.message:`${i.source}: ${i.message}`,e==="error"?"assertive":"polite"),i}function B(e){return(t,n={})=>S(e,t,n)}S.success=B("success");S.info=B("info");S.warn=B("warn");S.error=B("error");function Md(e){for(let t of[Ec,qr]){let n=t.findIndex((r)=>r.id===e);if(n!==-1)return t.splice(n,1),!0}return!1}function Ya(e){let t=e?qr.filter((r)=>!e(r)):[],n=qr.length-t.length;return qr.splice(0,qr.length,...t),n}function nh(e){let t=[];for(let n of qr){if(n.source!==e)continue;let r={message:n.message,severity:n.severity};if(n.detail!==void 0)r.detail=n.detail;if(n.path!==void 0)r.path=n.path;if(n.key!==void 0)r.key=n.key;if(n.action!==void 0)r.action=n.action;if(n.actionArgs!==void 0)r.actionArgs=n.actionArgs;t.push(r)}return t}function Lp(e){return e===void 0?qr.length:qr.filter((t)=>t.severity===e).length}export{ge,Ka,ee,eh,th,Ex,v,Dm,Am,re,Ad,Ja,Nd,Od,Sv,Yi,tI,Ec,qr,S,Md,Ya,nh,Lp};
2
-
3
- //# debugId=BB91B0814101144C64756E2164756E21
4
- //# sourceMappingURL=studio-9rhmettf.js.map
@@ -1,10 +0,0 @@
1
- import{v}from"./studio-9rhmettf.js";import{$o,VT,ot,Yo,ke,je,Hu,g,No,ci}from"./studio-ks7cksh0.js";import{f}from"./studio-jsv3s3s1.js";import{qt,Zt}from"./studio-de3p1ktm.js";import{T,R,Va,Lt}from"./studio-zmecp6hq.js";import{te}from"./studio-ery42sqr.js";import{Ds,hc}from"./studio-rwhss52s.js";import{Ew,h1,p1}from"./studio-hz02hq70.js";import{_d,qi}from"./studio-x0mzdha2.js";import{ss,Wf,ub,hb,Cu,Ro,Su}from"./studio-6j59fwaw.js";import{D}from"./studio-73czgk6a.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};T("grid-open",I);function j(e,r,t){let n=v({groups:r,open:t}),o=null,i=!1,s=R("grid-open",n,e).then((l)=>{if(i)return l.dispose(),l.root;return o=l,l.root});return{dispose(){i=!0,o?.dispose(),o=null},ready:s}}function S(){try{return f()}catch{return null}}function vw(){return typeof S()?.dataRows==="function"}async function E(){let e=S();if(typeof e?.dataConnections!=="function")return null;return e.dataConnections()}async function lE(e){let r=S();if(typeof r?.dataConnectionTest!=="function")return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function o1(e){let r=S();if(typeof r?.dataPush!=="function")return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function C(e){let t=S()?.[e];if(t===void 0||t===null)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function x(e){return C("dataRows")(e)}function M(e){return C("dataInsertRow")(e)}function A(e){return C("dataUpdateRow")(e)}function K(e){return C("dataDeleteRow")(e)}function cE(e,r,t){let n=(s)=>s.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),i=[r??e,t.replace(/Env$/,"")].map((s)=>n(s)).filter(Boolean).join("_")||"SECRET";return/^\d/.test(i)?`JX_${i}`:i}function W(e){let r=[],t=[],n="",o=!1,i=!1,s=()=>{t.push(n),n="",i=!1},l=()=>{if(s(),t.length===1&&t[0]===""){t=[];return}r.push(t),t=[]};for(let a=0;a<e.length;a++){let c=e[a];if(o){if(c==='"')if(e[a+1]==='"')n+='"',a+=1;else o=!1;else n+=c;continue}if(c==='"'&&!i)o=!0,i=!0;else if(c==='"')n+=c;else if(c===",")s();else if(c===`
2
- `)l();else if(c==="\r"){if(e[a+1]===`
3
- `)a+=1;l()}else n+=c,i=!0}if(n!==""||t.length>0)l();return r}function yw(e){let r=(e.match(/\r\n/g)??[]).length,t=(e.match(/(?<!\r)\n/g)??[]).length,n=r>t?`\r
4
- `:`
5
- `,o=e.endsWith(`
6
- `),i=W(e),s=i[0]??[],l=i.slice(1),a=Math.max(s.length,...l.map((c)=>c.length),0);while(s.length<a)s.push("");for(let c of l)while(c.length<a)c.push("");return{eol:n,headers:s,rows:l,trailingNewline:o}}function U(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function k(e){return[e.headers,...e.rows].map((t)=>t.map((n)=>U(n)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}var Q=["id","sku","slug","Slug"];function q(e){let r=new Set;return e.map((t,n)=>{let o=t.trim()===""?`column${n+1}`:t;if(r.has(o))o=`${o}__${n+1}`;return r.add(o),o})}function J(e,r){for(let t of Q){let n=e.indexOf(t);if(n===-1)continue;let o=r.rows.map((i)=>i[n]??"");if(o.every((i)=>i!=="")&&new Set(o).size===o.length)return t}return null}function O(e,r){let t=yw(e),n=q(t.headers),o=J(n,t),i=o?n.indexOf(o):-1,s=t.rows.map((d,u)=>i===-1?String(u):d[i]),l=new Map(s.map((d,u)=>[d,u])),a=Hu(r,D?.projectConfig),c=a?.schema?.properties??{},y=t.rows.slice(0,50).map((d)=>{let u={};for(let[h,w]of n.entries())u[w]=d[h]??"";return u}),p=new Map(hb(y).map((d)=>[d.field,d])),m=new Map(ub(a?.schema,{idField:o??void 0}).map((d)=>[d.field,d]));return{columns:n.map((d,u)=>{let w=(d in c?m.get(d):void 0)??p.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...w,pk:d===o,title:t.headers[u]?.trim()||w.title}}),doc:t,fields:n,keys:s,keyToIndex:l,loadText:e}}function X(e,r){let t={},n=e.doc.rows[r]??[];for(let[o,i]of e.fields.entries()){let s=e.columns[o],l=n[o]??"";t[i]=s.kind==="string"||s.kind==="text"||s.kind==="readonly"?l:Cu(l,s)}return t}function _(e,r){let t=e.doc.rows.map((i)=>[...i]),n=(i)=>e.fields.indexOf(i);for(let i of r.cells){let s=e.keyToIndex.get(i.rowKey),l=n(i.field);if(s===void 0||l===-1)continue;t[s][l]=Ro(i.value)}for(let i of r.inserts){let s=e.fields.map((l)=>Ro(i.cells[l]??null));t.push(s)}let o=r.deletes.map((i)=>e.keyToIndex.get(i.rowKey)).filter((i)=>i!==void 0).toSorted((i,s)=>s-i);for(let i of o)t.splice(i,1);return{...e.doc,rows:t}}function N(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function ww(e){let r=null,t=(n=!1)=>{if(!n&&r)return r;return r=f().readFile(e).then((o)=>O(o,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(n){let o=await t(),i=f(),s=null;try{s=await i.readFile(e)}catch{s=null}if(s!==o.loadText&&!hc(e))return N(n,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let l=_(o,n),a=k(l);return Ds(e),await i.writeFile(e,a),r=Promise.resolve(O(a,e)),N(n,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let n=await t(),o=n.doc.rows.map((i,s)=>({cells:X(n,s),key:n.keys[s]}));return{rows:o,total:o.length}},async serializeForSource(n){let o=await t();return k(_(o,n))}}}var Z=50;function ee(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function re(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function ne(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;return JSON.stringify(e)}function B(e,r){let t=[],n="id",o=new Map,i=(a)=>{if(a.length>0)t=a,n=a.find((c)=>c.pk)?.name??"id"},s=(a)=>({table:r,...e?{connection:e}:{},limit:a?.limit??Z,offset:a?.offset??0,...a?.orderBy?{dir:a.dir??"asc",orderBy:a.orderBy}:{}}),l=(a,c)=>{let y=a[n];if(typeof y==="string"||typeof y==="number")return o.set(String(y),y),String(y);return`row-${c}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await x(s({limit:1,offset:0}));i(a.columns)}return t.map((a)=>{let c=re(a)?ee(a.type):"readonly";return{editable:c!=="readonly",field:a.name,kind:c,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let c={cells:[],deletes:[],inserts:[]},y=new Map;for(let p of a.cells){let m=y.get(p.rowKey)??[];m.push({field:p.field,value:p.value}),y.set(p.rowKey,m)}for(let[p,m]of y){let b=o.get(p),d=(u,h)=>{for(let w of m)c.cells.push({error:h,field:w.field,ok:u,rowKey:p})};if(b===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let h of m)u[h.field]=h.value;await A({pk:b,set:u,table:r,...e?{connection:e}:{}}),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let p of a.inserts)try{let m={};for(let[h,w]of Object.entries(p.cells))if(w!==null)m[h]=w;let{row:b}=await M({table:r,values:m,...e?{connection:e}:{}}),d=b[n],u=typeof d==="string"||typeof d==="number"?String(d):void 0;if(u!==void 0&&(typeof d==="string"||typeof d==="number"))o.set(u,d);c.inserts.push({newKey:u,ok:!0,tempKey:p.tempKey})}catch(m){c.inserts.push({error:m instanceof Error?m.message:String(m),ok:!1,tempKey:p.tempKey})}for(let p of a.deletes){let m=o.get(p.rowKey);if(m===void 0){c.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:p.rowKey});continue}try{await K({pk:m,table:r,...e?{connection:e}:{}}),c.deletes.push({ok:!0,rowKey:p.rowKey})}catch(b){c.deletes.push({error:b instanceof Error?b.message:String(b),ok:!1,rowKey:p.rowKey})}}return c},id:ss({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],o.clear()},async rows(a){let c=await x(s(a));return i(c.columns),{rows:c.rows.map((p,m)=>{let b=l(p,m),d={};for(let u of t)d[u.name]=ne(p[u.name]);return{cells:d,key:b}}),total:c.total}}}}var sb=[{key:"all",label:"All"},{dir:"pages",key:"pages",label:"Pages"},{dir:"layouts",key:"layouts",label:"Layouts"},{dir:"components",key:"components",label:"Components"},{dir:"content",key:"content",label:"Content"},{dir:"public",key:"media",label:"Media"}],r1=sb.map((e)=>e.key);function xw(e){return sb.find((r)=>r.key===e)}function s1(e){return xw(e)?.dir}function oe(e,r){if(r&&_d.has(r))return"Media";if(e.startsWith("pages"))return"Pages";if(e.startsWith("layouts"))return"Layouts";if(e.startsWith("components"))return"Components";if(e.startsWith("content"))return"Content";if(e.startsWith("public"))return"Media";if(e.startsWith("data"))return"Content";if(e.startsWith("styles"))return"Components";return"Other"}function ie(e){let r=D?.projectConfig?.content??{};for(let[t,n]of Object.entries(r)){if(!n.source)continue;let o=n.source.replace(/^\.\//,"").replace(/\/$/,"");if(e.startsWith(`${o}/`)||e===o)return t.charAt(0).toUpperCase()+t.slice(1)}return null}var se=new Set(["node_modules",".git",".jx","dist","build",".cache"]);async function H(e,r,t,n,o){let i;try{i=await r.listDirectory(e)}catch(l){n.push({dir:e,error:te(l)});return}let s=[];for(let l of i){if(l.type==="directory"){if(!se.has(l.name))s.push(l.path);continue}let a=qi(l.name),c=oe(l.path,a);t.push({category:c,ext:a,locale:VT(l.path,o)??void 0,modified:l.modified,name:l.name,path:l.path,size:l.size,type:c==="Content"?ie(l.path)??a??"file":a||"file"})}await Promise.all(s.map((l)=>H(l,r,t,n,o)))}async function Hf(e,r){let t=[],n=[],{i18n:o}=$o(D?.projectConfig??{});return await Promise.all(e.map((i)=>H(i,r,t,n,o))),t.sort((i,s)=>i.path.localeCompare(s.path)),{failures:n,files:t}}function dE(e,r){let t=e,n=xw(r.category);if(n&&n.key!=="all")t=t.filter((s)=>s.category===n.label);let o=r.query.trim().toLowerCase();if(o)t=t.filter((s)=>s.name.toLowerCase().includes(o)||s.path.toLowerCase().includes(o));let i=r.locale?.trim();if(i)t=t.filter((s)=>s.locale===i);return t}var Bf=["table","cards","media","calendar","board"],_w={board:"Board",calendar:"Calendar",cards:"Cards",media:"Media",table:"Table"};var uE=new Set(["cards","media"]),ae=/^(\d{4}-\d{2}-\d{2})/;function le(e){let r=ae.exec(e.name);if(r)return r[1];if(e.modified){let t=new Date(e.modified);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return null}function a1(){return $o(D?.projectConfig??{}).i18n?.locales??[]}function hE(e){let r=new Set;for(let t of e)if(t.locale)r.add(t.locale);return a1().filter((t)=>r.has(t))}function pE(e){let r=new Map,t=[];for(let o of e){let i=le(o);if(i===null){t.push(o);continue}let s=r.get(i);if(s)s.push(o);else r.set(i,[o])}return{days:[...r.entries()].map(([o,i])=>({date:o,files:i})).toSorted((o,i)=>i.date.localeCompare(o.date)),undated:t}}function fE(e){let r=new Map;for(let n of e){let o=r.get(n.category);if(o)o.push(n);else r.set(n.category,[n])}let t=sb.map((n)=>n.label);return[...r.entries()].map(([n,o])=>({files:o,group:n})).toSorted((n,o)=>{let i=t.indexOf(n.group),s=t.indexOf(o.group);if(i===s)return n.group.localeCompare(o.group);return(i===-1?t.length:i)-(s===-1?t.length:s)})}var G="The Library lists files; it does not edit them. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Cw(){return[{editable:!1,field:"name",kind:"string",pk:!0,title:"Name",widthHint:260},{editable:!1,field:"category",kind:"string",title:"Category",widthHint:120},{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90},{editable:!1,field:"type",kind:"string",title:"Type",widthHint:120},{editable:!1,field:"size",kind:"number",title:"Size",widthHint:90},{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}]}function ce(e){return{cells:{category:e.category,locale:e.locale??null,modified:e.modified??null,name:e.name,path:e.path,size:e.size??null,type:e.type},key:e.path}}function L(){return ss({kind:"library"})}function mE(e){let r=null,t=null,n=e??(()=>D?.projectDirs??[]);async function o(){if(r)return r;return t??=Hf(n(),f()).then((i)=>(r=i,t=null,i)),t}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(Cw()),commit(i){return Promise.resolve({cells:i.cells.map((s)=>({error:G,field:s.field,ok:!1,rowKey:s.rowKey})),deletes:i.deletes.map((s)=>({error:G,ok:!1,rowKey:s.rowKey})),inserts:i.inserts.map((s)=>({error:G,ok:!1,tempKey:s.tempKey}))})},failures:()=>r?.failures??[],files:()=>r?.files??[],id:L(),label:"Library",async refresh(){r=null,t=null,await o()},async rows(){let i=await o();return{rows:i.files.map((s)=>ce(s)),total:i.files.length}},scanned:()=>r!==null}}var P={children:[],tagName:"div"};async function gE(e,r={}){let t=g.tabs.get(e);if(t)return ci(e,{focus:r.focus!==!1}),t;try{await qt()}catch{}let n=ww(e),o=No({capabilities:{modes:["grid","source"]},document:structuredClone(P),documentPath:e,id:e,sourceFormat:Zt(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return Su(o,n).load(),o}function F(e){let r=No({capabilities:{modes:["grid"]},document:structuredClone(P),documentPath:null,id:e.id});return Su(r,e).load(),r}function z(e){let r=ss({kind:"collection",name:e}),t=g.tabs.get(r);if(t)return ci(r),t;return F(h1(e))}function bE(){let e=L(),r=g.tabs.get(e);if(r)return ci(e),r;return No({capabilities:{modes:["manage"]},document:structuredClone(P),documentPath:null,id:e})}function l1(){let e=ss({kind:"pages"}),r=g.tabs.get(e);if(r)return ci(e),r;return F(p1())}function Y(e,r){let t=ss({connection:e??"default",kind:"data",table:r}),n=g.tabs.get(t);if(n)return ci(t),n;return F(B(e,r))}function de(e){let r=Wf(e);if(r?.kind==="pages")l1();else if(r?.kind==="collection")z(r.name);else if(r?.kind==="data")Y(r.connection,r.table)}function ue(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ss({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ss({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((n)=>({id:ss({connection:t.name,kind:"data",table:n}),label:n})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function vE(){let e=Ew(),r=[];if(vw())r=(await E().catch(()=>null))?.connections??[];let t=null,n=Va({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(o)=>{t=j(o,ue(e,r),(i)=>{n.close(),de(i)})},layer:Lt("dialog"),onCancel:()=>n.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});n.ready}function pe(){return[{args:ke({name:je("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=ot("collection.editInGrid",r,"name"),n=Ew().map((o)=>o.name);if(!n.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${n.length>0?n.join(", "):"none"}`);z(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:je('The connection name from project.json. Defaults to "default".'),table:je("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=ot("data.openGrid",r,"table");Y(Yo("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function yE(e){e.registerAll(pe())}
7
- export{vw,lE,o1,cE,yw,ww,sb,r1,xw,s1,Hf,dE,Bf,_w,uE,a1,hE,pE,fE,Cw,mE,gE,bE,l1,vE,yE};
8
-
9
- //# debugId=9EA694009FF255F864756E2164756E21
10
- //# sourceMappingURL=studio-ac5aq677.js.map
@@ -1,5 +0,0 @@
1
- function nt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ot(e){return nt(e)&&typeof e.$ref==="string"}function Ga(e){return nt(e)&&e.$prototype==="Function"}function ua(e){return nt(e)&&nt(e.$expression)}function _v(e){return ua(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function nS(e){return Ga(e)&&Array.isArray(e.body)}function iS(e){return nt(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function oS(e){return nt(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function kx(e){return nt(e)&&e.$prototype==="Array"}function Ws(e){return typeof e==="string"&&e.includes("${")}function rS(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Zu(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function ha(e,n){let t=e?.[n];return Zu(t)?t:void 0}function Xu(e,n){let t=e[n];if(Zu(t))return t;let r={};return e[n]=r,r}function Qu(e){return Ot(e)||Ga(e)||ua(e)}function Ep(e,n){let t=e[n];return Qu(t)?t:void 0}function Cv(e){if(!e)return[];return e.map((n)=>typeof n==="string"?n:n.name)}function Dd(e){if(!nt(e)||!nt(e.$expression))return!1;let n=e.$expression;if(n.operator==="?:")return typeof n.value==="string"&&typeof n.initial==="string";if(n.operator==="switch")return nt(n.cases)&&Object.values(n.cases).every((t)=>typeof t==="string")&&typeof n.default==="string";return!1}function sS(e){if(typeof e==="string")return[e];if(!Dd(e))return[];let n=e.$expression;if(n.operator==="?:")return[...new Set([n.value,n.initial])];return[...new Set([...Object.values(n.cases),n.default])]}function We(e){return typeof e==="string"?e:sS(e).join("|")}function Tp(e){return e.startsWith("#")}
2
- export{nt,Ot,Ga,ua,_v,nS,iS,oS,kx,Ws,rS,Zu,ha,Xu,Qu,Ep,Cv,Dd,sS,We,Tp};
3
-
4
- //# debugId=B001A79D2B8435DB64756E2164756E21
5
- //# sourceMappingURL=studio-as65vbns.js.map