@jxsuite/studio 10.4.0 → 10.5.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 (274) hide show
  1. package/dist/chunks/2020-7sx2vexa.js +4 -0
  2. package/dist/chunks/adapter-12dxr3z7.js +4 -0
  3. package/dist/chunks/{add-new-flow-v0pm96mr.js → add-new-flow-any4pw2q.js} +3 -3
  4. package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-ajh60k54.js} +3 -3
  5. package/dist/chunks/cf-settings-hbj16kh3.js +4 -0
  6. package/dist/chunks/{color-area-h8dbasp1.js → color-area-gbcftzh3.js} +2 -2
  7. package/dist/chunks/{color-field-qv5r2b16.js → color-field-85136598.js} +3 -3
  8. package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-w1s3ndd8.js} +2 -2
  9. package/dist/chunks/color-thzpppyc.js +4 -0
  10. package/dist/chunks/{combobox-6hs00996.js → combobox-dk98wc5x.js} +3 -3
  11. package/dist/chunks/components-a98hzqw9.js +4 -0
  12. package/dist/chunks/content-source-jq3fjs3w.js +4 -0
  13. package/dist/chunks/{convert-to-repeater-r8sfxjjm.js → convert-to-repeater-g66r6qp1.js} +3 -3
  14. package/dist/chunks/editor-rth1rzj8.js +4 -0
  15. package/dist/chunks/entry-commands-02j0s19w.js +4 -0
  16. package/dist/chunks/{extension-sections-vjzw46xb.js → extension-sections-rqrs7dr0.js} +3 -3
  17. package/dist/chunks/file-ops-6a49er4c.js +4 -0
  18. package/dist/chunks/files-b2p9y0yz.js +4 -0
  19. package/dist/chunks/format-host-7xe57k1s.js +4 -0
  20. package/dist/chunks/fs-events-0xsy168g.js +4 -0
  21. package/dist/chunks/grid-open-h3q4fjy5.js +4 -0
  22. package/dist/chunks/{grid-view-2f03wcgw.js → grid-view-0v4hjspb.js} +17 -17
  23. package/dist/chunks/{icons-gb967qc8.js → icons-j9eksgew.js} +2 -2
  24. package/dist/chunks/{iframe-entry-btck0e9s.js → iframe-entry-4zqtn3ry.js} +4 -4
  25. package/dist/chunks/{iframe-entry-b5qgggyp.js → iframe-entry-54kwwhmg.js} +4 -4
  26. package/dist/chunks/{iframe-entry-42hpmwz5.js → iframe-entry-m24fza30.js} +4 -4
  27. package/dist/chunks/iframe-host-8jcmaktg.js +4 -0
  28. package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-m8gzaan9.js} +3 -3
  29. package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-0afyws7c.js} +3 -3
  30. package/dist/chunks/{index-yjrfeks8.js → index-2q88g57p.js} +3 -3
  31. package/dist/chunks/index-7nj2375a.js +4 -0
  32. package/dist/chunks/{javascript-hy2mws8v.js → javascript-5sxtr1g7.js} +3 -3
  33. package/dist/chunks/jsonMode-m6sf47hq.js +13 -0
  34. package/dist/chunks/jx-validate-808zgbgy.js +4 -0
  35. package/dist/chunks/layers-0ffdtqjn.js +4 -0
  36. package/dist/chunks/layers-panel-rw62wtvf.js +4 -0
  37. package/dist/chunks/{listbox-7gka1h86.js → listbox-k5p41049.js} +2 -2
  38. package/dist/chunks/lit-html-9bz9rcfv.js +4 -0
  39. package/dist/chunks/media-library-2a5hdbek.js +4 -0
  40. package/dist/chunks/media-open-069kzhj4.js +4 -0
  41. package/dist/chunks/media-picker-4p4pd28y.js +4 -0
  42. package/dist/chunks/menu-26nez152.js +4 -0
  43. package/dist/chunks/{monaco-binding-a51py33c.js → monaco-binding-1s2b8snq.js} +3 -3
  44. package/dist/chunks/monaco-buffer-m9fd2dka.js +4 -0
  45. package/dist/chunks/monaco-setup-e0crh3v6.js +4 -0
  46. package/dist/chunks/notify-re3js157.js +4 -0
  47. package/dist/chunks/platform-rywy3tkg.js +4 -0
  48. package/dist/chunks/popover-fhdnt4be.js +4 -0
  49. package/dist/chunks/publish-panel-czkpg8m4.js +4 -0
  50. package/dist/chunks/{publish-quick-4fwngwrw.js → publish-quick-b9wbhqj6.js} +3 -3
  51. package/dist/chunks/publish-workspace-yy6d23b7.js +4 -0
  52. package/dist/chunks/quick-search-tp7pjnmv.js +4 -0
  53. package/dist/chunks/references-wd2yj8s1.js +4 -0
  54. package/dist/chunks/right-panel-x971k0zc.js +4 -0
  55. package/dist/chunks/source-control-k4p00hpe.js +4 -0
  56. package/dist/chunks/{split-m5rwn31z.js → split-qh21j2b0.js} +2 -2
  57. package/dist/chunks/{studio-v5wktj6f.js → studio-151kgn69.js} +4 -4
  58. package/dist/chunks/studio-15mfah02.js +10 -0
  59. package/dist/chunks/studio-1a7zshnv.js +5 -0
  60. package/dist/chunks/studio-1d8m5s38.js +16 -0
  61. package/dist/chunks/studio-35pmfjtx.js +5 -0
  62. package/dist/chunks/{studio-3na1r48j.js → studio-3yr1zdp9.js} +8 -8
  63. package/dist/chunks/studio-43pynnhz.js +5 -0
  64. package/dist/chunks/studio-44xqe0b7.js +4 -0
  65. package/dist/chunks/{studio-hh394phe.js → studio-48yzqzqr.js} +4 -4
  66. package/dist/chunks/{studio-9gr7xs9r.js → studio-4jy967rj.js} +5 -5
  67. package/dist/chunks/{studio-4bgvvzhv.js → studio-4ncxzw5m.js} +4 -4
  68. package/dist/chunks/{studio-pm17wdc4.js → studio-4s5bka8t.js} +4 -4
  69. package/dist/chunks/{studio-5tet77de.js → studio-4z0cdh16.js} +3 -3
  70. package/dist/chunks/studio-5rq3e4q5.js +5 -0
  71. package/dist/chunks/{studio-wmjmsw0p.js → studio-69g6a0jn.js} +4 -4
  72. package/dist/chunks/studio-6hcfm9q3.js +5 -0
  73. package/dist/chunks/studio-6mf31e16.js +5 -0
  74. package/dist/chunks/studio-6sxnqqw8.js +5 -0
  75. package/dist/chunks/{studio-0939t1q1.js → studio-7qqb7hb8.js} +4 -4
  76. package/dist/chunks/{studio-bg8pzprg.js → studio-7qr8k0v2.js} +4 -4
  77. package/dist/chunks/{studio-0x6f3nk9.js → studio-8ncm9zwx.js} +4 -4
  78. package/dist/chunks/studio-8w5pa88p.js +7 -0
  79. package/dist/chunks/{studio-3qr08sxq.js → studio-9f5vcb4w.js} +3 -3
  80. package/dist/chunks/studio-aaw7wxv8.js +5 -0
  81. package/dist/chunks/studio-afx9brsc.js +5 -0
  82. package/dist/chunks/studio-ajfq4fmr.js +5 -0
  83. package/dist/chunks/{studio-evq47j2z.js → studio-ber1dgte.js} +4 -4
  84. package/dist/chunks/{studio-sce30r7b.js → studio-bk0anq3b.js} +3 -3
  85. package/dist/chunks/{studio-0gvvqj3h.js → studio-bmwgj8ez.js} +4 -4
  86. package/dist/chunks/{studio-s24mhq0z.js → studio-bpzwhn88.js} +4 -4
  87. package/dist/chunks/{studio-g9brbewz.js → studio-c72v1kwc.js} +4 -4
  88. package/dist/chunks/{studio-tpxcryf2.js → studio-cv6gnjqd.js} +4 -4
  89. package/dist/chunks/{studio-90zkgne5.js → studio-czpmzs9r.js} +7 -7
  90. package/dist/chunks/{studio-2pk7kc7z.js → studio-d5f7sskn.js} +4 -4
  91. package/dist/chunks/studio-dmgh2rrj.js +5 -0
  92. package/dist/chunks/{studio-nwf0c32p.js → studio-dst8y8vh.js} +4 -4
  93. package/dist/chunks/studio-ehj3csbm.js +6 -0
  94. package/dist/chunks/{studio-hfqpfmpk.js → studio-ek4fb4eb.js} +4 -4
  95. package/dist/chunks/studio-ep1384t9.js +5 -0
  96. package/dist/chunks/{studio-abh9kfdh.js → studio-eq5vqn1q.js} +4 -4
  97. package/dist/chunks/studio-erjccagy.js +5 -0
  98. package/dist/chunks/studio-ex1644g2.js +5 -0
  99. package/dist/chunks/studio-f3awr5nc.js +12 -0
  100. package/dist/chunks/studio-f69wcajk.js +9 -0
  101. package/dist/chunks/{studio-jma2q8r9.js → studio-g65t6svn.js} +4 -4
  102. package/dist/chunks/{studio-r6mx7vm5.js → studio-gw83z798.js} +5 -5
  103. package/dist/chunks/{studio-2x972v58.js → studio-hy936516.js} +4 -4
  104. package/dist/chunks/studio-j3bq30yz.js +5 -0
  105. package/dist/chunks/studio-j52ks8q7.js +5 -0
  106. package/dist/chunks/{studio-g0hxtcga.js → studio-jqvke4ac.js} +4 -4
  107. package/dist/chunks/{studio-bnc50f9h.js → studio-k05g7efh.js} +4 -4
  108. package/dist/chunks/studio-kefs4sz4.js +5 -0
  109. package/dist/chunks/{studio-2e4hry72.js → studio-ketrgtph.js} +5 -5
  110. package/dist/chunks/studio-m3jrjfhy.js +14 -0
  111. package/dist/chunks/{studio-45mj4jqe.js → studio-m8hesdrw.js} +4 -4
  112. package/dist/chunks/{studio-k0xzrse2.js → studio-n271vdsg.js} +36 -36
  113. package/dist/chunks/studio-n4pnf0sw.js +5 -0
  114. package/dist/chunks/{studio-gnazwtv3.js → studio-ncwx602y.js} +4 -4
  115. package/dist/chunks/{studio-amaz545p.js → studio-nngc45ct.js} +4 -4
  116. package/dist/chunks/{studio-eqcddvc2.js → studio-nv5eq0f7.js} +173 -173
  117. package/dist/chunks/{studio-az3wvyh2.js → studio-nzp0sqjg.js} +4 -4
  118. package/dist/chunks/{studio-k2evngrj.js → studio-pgze9p34.js} +5 -5
  119. package/dist/chunks/studio-ph17an19.js +5 -0
  120. package/dist/chunks/studio-pte5w7rf.js +9 -0
  121. package/dist/chunks/studio-pv1ts08p.js +6 -0
  122. package/dist/chunks/studio-q509sqt8.js +5 -0
  123. package/dist/chunks/{studio-rr00ex23.js → studio-qarg1xf9.js} +6 -6
  124. package/dist/chunks/studio-r5g7fx7q.js +9 -0
  125. package/dist/chunks/studio-s49y6m5b.js +5 -0
  126. package/dist/chunks/studio-s4k1v7dt.js +7 -0
  127. package/dist/chunks/studio-t46rt6gx.js +5 -0
  128. package/dist/chunks/{studio-61rg2cz5.js → studio-td3h1644.js} +4 -4
  129. package/dist/chunks/{studio-v7a7yb5w.js → studio-thgexj3w.js} +7 -7
  130. package/dist/chunks/{studio-vpevkfxw.js → studio-veh91hjv.js} +4 -4
  131. package/dist/chunks/studio-vswmz40d.js +6 -0
  132. package/dist/chunks/{studio-daksw8kh.js → studio-w3aafbpk.js} +4 -4
  133. package/dist/chunks/studio-w4mfaaam.js +5 -0
  134. package/dist/chunks/{studio-4zd6an2b.js → studio-wn2cmf9q.js} +4 -4
  135. package/dist/chunks/studio-x5ffyssw.js +5 -0
  136. package/dist/chunks/{studio-swedpd82.js → studio-x5py815g.js} +4 -4
  137. package/dist/chunks/{studio-4fnb5648.js → studio-xh6rf05g.js} +4 -4
  138. package/dist/chunks/studio-z6s56dzz.js +5 -0
  139. package/dist/chunks/{studio-nvcn2ykc.js → studio-zav9hgb3.js} +4 -4
  140. package/dist/chunks/{studio-a88ej93p.js → studio-ze1sm147.js} +6 -6
  141. package/dist/chunks/{studio-pj216fmn.js → studio-zkkt13qd.js} +4 -4
  142. package/dist/chunks/studio-zn7ysyzb.js +5 -0
  143. package/dist/chunks/{studio-xx3r3sb0.js → studio-ztzf8mce.js} +4 -4
  144. package/dist/chunks/{studio-1410q5dw.js → studio-zzgp5yka.js} +4 -4
  145. package/dist/chunks/{tooltip-dj1pvgz7.js → tooltip-gtx40bjg.js} +3 -3
  146. package/dist/chunks/{tree-j0ebwr5s.js → tree-a19s1c05.js} +2 -2
  147. package/dist/chunks/tsMode-3f116hth.js +14 -0
  148. package/dist/chunks/workspace-home-61n1jz3q.js +4 -0
  149. package/dist/chunks/workspace-sheek6zw.js +4 -0
  150. package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-cb49m87s.js} +3 -3
  151. package/dist/iframe-entry.js +14 -14
  152. package/dist/manifest.json +82 -82
  153. package/dist/studio.js +97 -96
  154. package/dist/workers/ts.worker.js +3 -3
  155. package/package.json +11 -11
  156. package/src/browse/library-layouts.ts +9 -12
  157. package/src/browse/library-pane.ts +22 -16
  158. package/src/browse/library-source.ts +3 -4
  159. package/src/canvas/canvas-live-render.ts +2 -5
  160. package/src/canvas/canvas-page-context.ts +5 -0
  161. package/src/content/entry-commands.ts +32 -27
  162. package/src/content/entry-editor.ts +46 -44
  163. package/src/content/entry-inspector.ts +15 -12
  164. package/src/content/entry-model.ts +3 -3
  165. package/src/content/entry-summaries.ts +5 -5
  166. package/src/content/hold-state.ts +172 -0
  167. package/src/content/page-summaries.ts +10 -14
  168. package/src/editor/inline-edit.ts +6 -1
  169. package/src/editor/repeater-scope.ts +333 -74
  170. package/src/grid/sources/content-source.ts +42 -66
  171. package/src/panels/block-action-bar.ts +3 -4
  172. package/src/panels/events-panel.ts +6 -2
  173. package/src/panels/formula-workspace.ts +9 -0
  174. package/src/panels/properties-panel.ts +127 -35
  175. package/src/panels/statement-editor.ts +4 -0
  176. package/src/panels/tab-strip.ts +29 -26
  177. package/src/services/ai-project-tools.ts +3 -3
  178. package/src/services/ai-tools.ts +5 -5
  179. package/src/services/ai-write-report.ts +22 -4
  180. package/src/services/context-manager.ts +110 -2
  181. package/src/services/document-assistant.ts +2 -2
  182. package/src/services/harness/chat-reducer.ts +9 -4
  183. package/src/services/render-critic.ts +234 -12
  184. package/src/services/tool-executor.ts +16 -8
  185. package/src/surfaces/collections-panel.json +1 -1
  186. package/src/surfaces/collections-panel.ts +1 -1
  187. package/src/surfaces/entry-editor.json +10 -10
  188. package/src/surfaces/entry-editor.ts +22 -19
  189. package/src/surfaces/entry-inspector.json +11 -11
  190. package/src/surfaces/entry-inspector.ts +17 -10
  191. package/src/surfaces/tab-strip.json +5 -5
  192. package/src/surfaces/tab-strip.ts +2 -2
  193. package/src/types.ts +2 -0
  194. package/src/ui/expression-editor.ts +10 -5
  195. package/src/ui/schema-form.ts +18 -1
  196. package/src/utils/edit-display.ts +27 -1
  197. package/dist/chunks/2020-906vx2dq.js +0 -4
  198. package/dist/chunks/adapter-hnvad61x.js +0 -4
  199. package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
  200. package/dist/chunks/color-04361ttk.js +0 -4
  201. package/dist/chunks/components-w5zqwva1.js +0 -4
  202. package/dist/chunks/content-source-g38w0d3f.js +0 -4
  203. package/dist/chunks/editor-wvf5e6j9.js +0 -4
  204. package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
  205. package/dist/chunks/file-ops-1sghzgcr.js +0 -4
  206. package/dist/chunks/files-zrqtgt41.js +0 -4
  207. package/dist/chunks/format-host-9gy76erh.js +0 -4
  208. package/dist/chunks/fs-events-45rhg3me.js +0 -4
  209. package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
  210. package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
  211. package/dist/chunks/index-f9qr7kzh.js +0 -4
  212. package/dist/chunks/jsonMode-vj30te2h.js +0 -13
  213. package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
  214. package/dist/chunks/layers-m49nmwvx.js +0 -4
  215. package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
  216. package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
  217. package/dist/chunks/media-library-j74rt0w4.js +0 -4
  218. package/dist/chunks/media-open-mypr0k6b.js +0 -4
  219. package/dist/chunks/media-picker-pemtbsjv.js +0 -4
  220. package/dist/chunks/menu-d2jxpgma.js +0 -4
  221. package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
  222. package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
  223. package/dist/chunks/notify-bwehrp7q.js +0 -4
  224. package/dist/chunks/platform-kv0k65cy.js +0 -4
  225. package/dist/chunks/popover-9tf4cjrk.js +0 -4
  226. package/dist/chunks/publish-panel-vg1n880b.js +0 -4
  227. package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
  228. package/dist/chunks/quick-search-nh29rt8a.js +0 -4
  229. package/dist/chunks/references-vqyr5s9x.js +0 -4
  230. package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
  231. package/dist/chunks/source-control-h3hcs5gy.js +0 -4
  232. package/dist/chunks/studio-0khd8xtx.js +0 -4
  233. package/dist/chunks/studio-1ctnw3xv.js +0 -5
  234. package/dist/chunks/studio-1ks5d9y4.js +0 -5
  235. package/dist/chunks/studio-1y9mab9m.js +0 -5
  236. package/dist/chunks/studio-2kpxm0eh.js +0 -7
  237. package/dist/chunks/studio-2zz4qbv9.js +0 -5
  238. package/dist/chunks/studio-3pz4t5a2.js +0 -5
  239. package/dist/chunks/studio-4f7thq0p.js +0 -5
  240. package/dist/chunks/studio-7rrdbvex.js +0 -5
  241. package/dist/chunks/studio-9dq7rwc7.js +0 -5
  242. package/dist/chunks/studio-acer0g8w.js +0 -5
  243. package/dist/chunks/studio-brh8d2pr.js +0 -5
  244. package/dist/chunks/studio-c2fa783p.js +0 -9
  245. package/dist/chunks/studio-cfnn70h1.js +0 -5
  246. package/dist/chunks/studio-cqxj4fcy.js +0 -5
  247. package/dist/chunks/studio-cw11h078.js +0 -5
  248. package/dist/chunks/studio-dn56z7sn.js +0 -5
  249. package/dist/chunks/studio-egnjpyde.js +0 -9
  250. package/dist/chunks/studio-ejrypvmq.js +0 -5
  251. package/dist/chunks/studio-frc16j8v.js +0 -10
  252. package/dist/chunks/studio-j0zf5x2x.js +0 -5
  253. package/dist/chunks/studio-j5fcp6gj.js +0 -5
  254. package/dist/chunks/studio-jd1qb1st.js +0 -7
  255. package/dist/chunks/studio-k1xqrgm5.js +0 -5
  256. package/dist/chunks/studio-k3we3kqb.js +0 -5
  257. package/dist/chunks/studio-knsjyx7n.js +0 -5
  258. package/dist/chunks/studio-mrjtnm62.js +0 -5
  259. package/dist/chunks/studio-n9qba0gx.js +0 -5
  260. package/dist/chunks/studio-nzemfbkk.js +0 -14
  261. package/dist/chunks/studio-pwctzka3.js +0 -16
  262. package/dist/chunks/studio-q80fg1d6.js +0 -12
  263. package/dist/chunks/studio-q9hx2qp0.js +0 -5
  264. package/dist/chunks/studio-qrzmfaf6.js +0 -5
  265. package/dist/chunks/studio-tmfcn347.js +0 -6
  266. package/dist/chunks/studio-wqfaqw4m.js +0 -5
  267. package/dist/chunks/studio-xpx91fby.js +0 -6
  268. package/dist/chunks/studio-xva3hzkv.js +0 -5
  269. package/dist/chunks/studio-z3fztxrp.js +0 -9
  270. package/dist/chunks/studio-z9453ypn.js +0 -6
  271. package/dist/chunks/tsMode-jg1dtphj.js +0 -14
  272. package/dist/chunks/workspace-6ztqcrsh.js +0 -4
  273. package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
  274. package/src/content/draft-state.ts +0 -108
@@ -0,0 +1,7 @@
1
+ import{X}from"./studio-9c6cbq2c.js";import{w}from"./studio-bk0anq3b.js";import{p,ve}from"./studio-xh6rf05g.js";import{nt,Fn}from"./studio-cv6gnjqd.js";import{Wt,ln,gr,wy}from"./studio-s49y6m5b.js";import{Js}from"./studio-thgexj3w.js";import{Vt}from"./studio-w3aafbpk.js";import{hs}from"./studio-wn2cmf9q.js";import{wf}from"./studio-z6s56dzz.js";import{qm,Bx,no}from"./studio-td3h1644.js";import{wo,nh,vC,UO,Zb,hi,fx,GO,ec,kC,oh,YO,Op}from"./studio-aaw7wxv8.js";import{Mb,Fb}from"./studio-ek4fb4eb.js";import{K0,ks}from"./studio-15mfah02.js";import{H0,Vw,$m,Ww,B0,_i}from"./studio-ze1sm147.js";import{_p,E0,gT,Lb,bT,Rw,Iw,vD,vT,Sm,Nw,_D,wT,Rb,SD,CD,kD,ED,TD,xT,$D}from"./studio-pte5w7rf.js";import{fD,kw,Ew,xp}from"./studio-vswmz40d.js";import{ql}from"./studio-ph17an19.js";import{W0}from"./studio-jqvke4ac.js";import{qs}from"./studio-6mf31e16.js";import{Ip}from"./studio-t46rt6gx.js";import{x,wn}from"./studio-zn7ysyzb.js";import{$n,E,I}from"./studio-1a7zshnv.js";import{me,te,b}from"./studio-9f5vcb4w.js";import{n,Q,S,m}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";function re(e){return{contentType:null,layout:void 0,path:e}}function fe(e,t,a){let{contentType:r,layout:o}=kC(t,a);return{contentType:r,layout:o,path:e}}async function Ie(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return S(o)&&!Array.isArray(o)?fe(e,o,null):re(e)}let{parseSourceForPath:a}=await (ce("6a49er4c"),import("./file-ops-6a49er4c.js")),r=await a(e,t);return fe(e,r.document,r.frontmatter)}catch{return re(e)}}var Ve=300,Y=null,B=null,ne=0,oe=new Set;function ge(e){let t=e.join(`
2
+ `);if(Y?.key===t)return Y.pages;if(!ve())return new Map(e.map((a)=>[a,re(a)]));if(B?.key!==t){let a=ne,r=Promise.all(e.slice(0,Ve).map((o)=>Ie(o))).then((o)=>{if(a!==ne||B?.read!==r)return;B=null,Y={key:t,pages:new Map(o.map((i)=>[i.path,i]))};for(let i of oe)i()});B={key:t,read:r}}return null}function hb(){ne+=1,Y=null,B=null}function he(e){return oe.add(e),()=>{oe.delete(e)}}function fw(e){return e?"true":"false"}function AN(e){return e.trim().toLowerCase()}function pb(e,...t){return e===""||t.some((a)=>a.toLowerCase().includes(e))}function Rd(e){let t=e.replaceAll(/[-_]+/g," ").trim();return t===""?e:t.charAt(0).toUpperCase()+t.slice(1)}function le(e){let t=Rd(e);if(/ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[^s]s$/i.test(t))return t.slice(0,-1);return t}function ie(e){let t=e.slice(e.lastIndexOf("/")+1),a=t.lastIndexOf(".");return a>0?t.slice(0,a):t}function U(e,t,a){let r=gr(t,a);return r===null?e:`${e} (${r})`}function J(e,t,a=null){if(gr(t,a)!==null){let s=wy(t,a);return U(J(wo(s),s),t,a)}if(e.urlPattern==="/")return"Home";let r=e.urlPattern.split("/").filter((s)=>s!==""),o=(s)=>s==="*"||s.startsWith(":"),i=r.at(-1)??ie(t);if(!o(i))return Rd(i);let l=r.findLast((s)=>!o(s));return Rd(l??ie(t).replaceAll(/[[\].]/g,""))}function PN(e,t,a,r={}){let o=r.i18n??null,i=e.flatMap((u)=>nh(u.path,r.extensions)?[{fact:u,route:wo(u.path)}]:[]).toSorted((u,f)=>vC(u.route,f.route)||u.fact.path.localeCompare(f.fact.path)),l=[],s=(u,f,h,y)=>({detail:f.urlPattern,key:u.path,kind:h,label:y,path:u.path,selected:fw(u.path===a)}),d=new Map;for(let u of i){let f=u.fact.contentType;if(f!==null&&t.has(f))d.set(f,[...d.get(f)??[],u])}let c=new Set;for(let{fact:u,route:f}of i){let h=u.contentType,y=h===null?void 0:d.get(h);if(h===null||y===void 0){l.push(s(u,f,"page",J(f,u.path,o)));continue}if(c.has(h))continue;c.add(h),l.push({detail:ze(t.get(h)??null),key:`collection:${h}`,kind:"collection",label:Rd(h),path:"",selected:"false"});let A=`${le(h)} page`;for(let O of y){let G=U(A,O.fact.path,o);l.push(s(O.fact,O.route,"entry-page",G))}}return l}function ze(e){if(e===null)return"";return`${e} ${e===1?"entry":"entries"}`}function MN(e,t){if(t==="")return[...e];let a=[],r=null,o=!1;for(let i of e){if(i.kind==="collection"){if(r=i,o=pb(t,i.label),o)a.push(i);continue}if(i.kind==="page")r=null;if(i.kind==="entry-page"&&o||pb(t,i.label,i.detail,i.path)){if(r&&!o)a.push(r),o=!0;a.push(i)}}return a}function ME(e,t,a,r=null){return e.filter((o)=>o.endsWith(".json")).toSorted((o,i)=>o.localeCompare(i)).flatMap((o)=>{let i=Rd(ie(o));if(!pb(a,i,o))return[];return[{detail:o===r?"default layout":"",key:o,label:i,path:o,selected:fw(o===t)}]})}var Be='img:not([src]), img[src=""] { visibility: hidden; }',ye=new WeakMap;function _e(e){let t=ye.get(e);if(t)return t;let a=e.defaultView?.CSSStyleSheet;if(!Q(a))return null;let r=new a;return r.replaceSync(Be),ye.set(e,r),r}function mw(e,t){let a=e.shadowRoot??e.attachShadow({mode:"open"}),r=_e(e.ownerDocument);a.adoptedStyleSheets=[...fD(),...e.ownerDocument.adoptedStyleSheets,...r?[r]:[]],a.replaceChildren(t)}function gw(e){return e.shadowRoot?.firstElementChild??null}function _(e,t){if(e===void 0||e.trim()==="")return[];if(!t)return[e];return e.split(",").map((a)=>a.trim()).filter((a)=>a!=="")}var He=12;function be(e,t,a){let r=e.find((o)=>t.has(o.name));if(r)return{...r,order:t.get(r.name)};for(let o of e){if(o.measure)continue;let i=a.flatMap((s)=>_(s?.fields?.[o.name],o.list)),l=new Set(i).size;if(l>=2&&l<i.length&&l<=He)return{...o,order:[]}}return null}function N(e){return(t)=>e.get(t.path)}var we=N(new Map),pe={board:{itemWidth:0,rowHeight:0,windowed:!1},calendar:{itemWidth:0,rowHeight:0,windowed:!1},cards:{itemWidth:200,rowHeight:194,windowed:!0},table:{itemWidth:0,rowHeight:32,windowed:!0}},We=60,se=25;function xe(e,t){let a=pe[e];if(a.itemWidth<=0||t<=0)return 1;return Math.max(1,Math.floor(t/a.itemWidth))}function Ge(e){if(e===void 0||!Number.isFinite(e))return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB"],a=e/1024,r=0;while(a>=1024&&r<t.length-1)a/=1024,r+=1;return`${a<10?a.toFixed(1):Math.round(a)} ${t[r]}`}function qe(e){return e?Ip(new Date(e)):""}function Ye(e,t,a){switch(t){case"date":return a?.date??"";case"status":return a?.status??"";case"template":return a?.template??"";case"title":return a?.title??e.name;case"locale":return e.locale?Wt(e.locale):"";case"modified":return qe(e.modified);case"name":return e.name;case"path":return e.record?.source??e.path;case"size":return Ge(e.size);case"type":return e.type;case"url":return e.collection===hi?wo(e.path).urlPattern:"";default:{let r=ED(t);return r===null?"":a?.fields?.[r]??""}}}function $e(e,t,a,r){let o=wf(e.ext),i=r?.thumb??"";return{art:o||i!==""?"image":a&&e.collection!==null&&!e.record?"doc":"glyph",cells:t.map((l)=>({field:l.field,text:Ye(e,l.field,r)})),meta:e.type,name:r?.title??e.name,path:e.path,src:o?no(e.path):i}}function de(e,t){return{art:"glyph",cells:[],meta:e.type,name:t?.title??e.name,path:e.path,src:""}}function Se(e,t=we){let{days:a,undated:r}=CD(e,(s)=>t(s)?.date||wT(s)),o=a.slice(0,We),i=a.length-o.length,l=o.map((s)=>({count:"",files:s.files.map((d)=>de(d,t(d))),id:s.date,note:"",noteState:"hidden",title:s.date,undated:"false"}));if(r.length>0)l.push({count:"",files:r.slice(0,se).map((s)=>de(s,t(s))),id:"__undated",note:`${r.length} file${r.length===1?"":"s"} with no dated name and no modification time.`,noteState:"shown",title:"No date",undated:"true"});return{groups:l,truncated:i>0?`${i} older ${i===1?"day is":"days are"} not shown — filter, or switch to Table.`:""}}var Ue="Published";function Je(e,t){let a=new Map;for(let o of e){let i=t(o)?.status||"No status",l=a.get(i);if(l)l.push(o);else a.set(i,[o])}let r=(o)=>o===Ue?1:0;return[...a.entries()].map(([o,i])=>({files:i,group:o})).toSorted((o,i)=>r(o.group)-r(i.group)||o.group.localeCompare(i.group))}function Ke(e,t,a){let r=`No ${a.title.toLowerCase()}`,o=new Map;for(let l of e){let s=_(t(l)?.fields?.[a.name],a.list);for(let d of s.length===0?[r]:new Set(s)){let c=o.get(d);if(c)c.push(l);else o.set(d,[l])}}let i=(l)=>{if(l===r)return Number.MAX_SAFE_INTEGER;let s=a.order.indexOf(l);return s===-1?a.order.length:s};return[...o.entries()].map(([l,s])=>({files:s,group:l})).toSorted((l,s)=>i(l.group)-i(s.group)||l.group.localeCompare(s.group))}function Le(e,t=we,a=null){return(e.some((i)=>(t(i)?.status??"")!=="")?Je(e,t):a?Ke(e,t,a):kD(e)).map((i)=>{let l=i.files.length-se;return{count:String(i.files.length),files:i.files.slice(0,se).map((s)=>de(s,t(s))),id:i.group,note:l>0?`${l} more — switch to Table to see them.`:"",noteState:l>0?"shown":"hidden",title:i.group,undated:"false"}})}var Fe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioLibraryPane",$description:"The Content home (studio.md §22.5): one collection, browsed, as a Jx document over the kit. The adapter (`browse/library-pane.ts`) keeps every decision — which collection is shown, which of its files the filter kept, which of them the window renders, where the collection is published, and what a row's context menu offers — and hands this document one projection: a discriminant naming which of eight things to draw, the view switch already marked, a header line that is one of four states, and rows that are already strings. Nothing here asks what a file is, how big the viewport is, or whether the scan finished. The eight cases of `view` are the four honest empty states the Manage view collapsed into “No files found” — a scan still running, a scan that could not finish, a collection with nothing in it, and a filter that matched nothing — followed by the four views, so “what is on screen” has exactly one source. A card's live preview is an ISLAND: the document renders `doc-preview` and nothing inside it, and the adapter fills it through `onNodeCreated` when the card comes into view.",tagName:"div",attributes:{part:"library","data-jx-region":"${state.region}"},style:{$description:"What the fifty-two `.library*` rules in `styles/overlays.css` said, keyed on `part` and re-pointed at the studio token layer. Every one of them was this surface's alone, so the block goes with the conversion rather than being copied. Three sets of names could not come with the declarations. Ten `var(--spectrum-font-size-50 | -75, …)` reads are the kit's `--jx-text-sm` and `--jx-text-md`, which are the same 11px and 12px: a `--spectrum-*` name is declared by `<sp-theme>` and by nothing else in this package, and `styles/spectrum.css` is deleted whole with the last Spectrum component, so a document that reads one is a document whose colours change when a component it does not use is removed. `--spectrum-gray-100` and `--spectrum-gray-200` are the studio's own `--bg-input` and `--hover-bg`; `--spectrum-blue-600` — the card's hover border and the drop outline — is `--accent`, which is what a Spectrum blue was standing in for; and `--spectrum-orange-100`, the incomplete-scan banner's ground, is mixed from `--warning` so the banner follows the chrome theme instead of being a dark-only hex. Nine names that were handles rather than styling stop being names at all: `.library-grid-cards`, `.library-grid-media`, `.library-day-undated`, `.library-drop-active`, `.library-upload-input` and the four `data-field` widths are `data-` attributes on a part here, because a part is the handle now.",display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"hidden",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="banner-slot"], & [part="locale-slot"], & [part="filter-slot"], & [part="fields-slot"], & [part="new-slot"], & [part="page-slot"], & [part="view-slot"], & [part="art-slot"], & [part="note-slot"], & [part="truncated-slot"]':{$description:"A `$switch` renders its own container, and none of these six is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="head"]':{$description:"The collection's title over its toolbar: the Content-Collection and Content-Pages boards' heading row. It does not scroll with the list.",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="heading"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="subtitle"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="subtitle"]:empty':{$description:"Only Pages carries a line under its title; a collection's own line is the header bar below the toolbar.",display:"none"},'& [part="toolbar"]':{$description:"It wraps rather than scrolls: the view switch, the search, the language facet, Fields and New are all equally reachable, and a toolbar that hid half of them behind an overflow would put the collection's own state somewhere the reader has to go looking for it.",display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"0",flexShrink:"0",flexWrap:"wrap"},'& [part="search"]':{width:"220px"},'& [part="locale"]':{$description:"Narrow on purpose: it holds one language name, and the toolbar wraps before it grows.",width:"160px"},'& [part="filter"]':{$description:"Narrow like the language facet: it holds one value of one field.",width:"160px"},'& [part="spacer"]':{flex:"1"},'& [part="layouts"]':{flexShrink:"0"},'& [part="banner"]':{$description:"The banner an INCOMPLETE listing carries. The Problem in the dock is the durable record; this is the same fact on the surface it is about, because a reader looking at a short list needs to know it is short for a reason without going anywhere to find out.",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--jx-space-4)",padding:"var(--jx-space-3) var(--jx-space-5)",background:"color-mix(in srgb, var(--warning) 18%, var(--bg-panel))",borderBottom:"1px solid var(--border)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="body"]':{flex:"1",minHeight:"0",overflow:"auto",position:"relative"},'& [part="empty"]':{padding:"48px var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)"},'& [part="empty"] p':{margin:"0"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="truncated"]':{$description:"What a capped layout did not draw, stated. A grouped list cannot window — a window over one either breaks the groups or needs variable-height measurement — so Calendar and Board cap instead, and a layout that truncated in silence would be the same class of lie as “No files found”.",margin:"var(--jx-space-3) 0 0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="grid"]':{$description:"Cards and Media, the two windowed grids. The item sizes here are the ones `library-layouts.ts`'s LAYOUT_METRICS counts rows in; change one and change both.",display:"grid",gap:"var(--jx-space-4)",padding:"var(--jx-space-4) var(--jx-space-5)",alignItems:"start"},'& [part="grid"][data-layout="cards"]':{gridTemplateColumns:"repeat(auto-fill, minmax(188px, 1fr))"},'& [part="card"], & [part="tile"]':{cursor:"pointer",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-panel)"},'& [part="card"]:hover, & [part="tile"]:hover':{borderColor:"var(--accent)"},'& [part="card-art"], & [part="tile-art"]':{aspectRatio:"4 / 3",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"var(--bg-input)",pointerEvents:"none"},'& [part="file-glyph"]':{"--jx-icon-size":"32px",color:"var(--fg-dim)"},'& [part="doc-preview"]':{$description:"The island. The document renders this box and nothing inside it; the adapter mounts a real runtime render of the file into a shadow root of the island's own when the card comes into view (`mountPreview` in `browse/library-preview.ts`, which keeps the document's ids out of Studio's), and the zoom is what makes a page-sized document readable as a thumbnail without rendering it at thumbnail size: the render is laid out in a box two and a half times as wide and drawn at 0.4. It is `inert`, so a page's own links and buttons are neither focusable nor named inside the card.",width:"100%",height:"100%",zoom:"0.4",overflow:"hidden"},'& [part="thumb"]':{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},'& [part="card-label"], & [part="tile-label"]':{padding:"6px var(--jx-space-3) 0",fontSize:"var(--jx-text-md)",color:"var(--fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},'& [part="card-meta"]':{padding:"0 var(--jx-space-3) 6px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="table"]':{$description:"A windowed list rather than a table component: the rows have to be sliceable, and every table widget wants the whole set.",display:"flex",flexDirection:"column",minWidth:"min-content",padding:"0 var(--jx-space-5) var(--jx-space-5)"},'& [part="table-head"], & [part="table-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",height:"32px",borderBottom:"1px solid var(--border)"},'& [part="table-head"]':{position:"sticky",top:"0",zIndex:"1",background:"var(--bg-panel)",fontWeight:"600",fontSize:"var(--jx-text-md)"},'& [part="table-row"]':{cursor:"pointer"},'& [part="table-row"]:hover':{background:"var(--hover-bg)"},'& [part="cell"]':{$description:"Every column keeps a floor: with a collection's six field columns beside the file facts, a cell that may shrink to nothing is a column of ellipses. When the floors outgrow the pane, the table scrolls sideways instead. Each cell's text is kept out of its intrinsic width (`contain: inline-size`), so the table's `min-content` is the sum of those floors rather than of every full title.",flex:"1",minWidth:"80px",contain:"inline-size",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-md)"},'& [part="cell"][data-field="name"], & [part="cell"][data-field="title"]':{$description:"What a row is called keeps a readable width however many field columns stand beside it.",flex:"3",minWidth:"220px",fontWeight:"500"},'& [part="cell"][data-field="path"]':{flex:"2",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"},'& [part="cell"][data-field="size"], & [part="cell"][data-field="modified"]':{flex:"0 0 96px"},'& [part="cell"][data-field="locale"]':{$description:"Fixed, like size and modified: a language name is short and never earns width from Name. Without this it inherits the `flex: 1` above and the Name column loses a quarter of itself in every multilingual project.",flex:"0 0 90px",color:"var(--fg-dim)"},'& [part="calendar"]':{padding:"var(--jx-space-4) var(--jx-space-5)"},'& [part="day"]':{marginBottom:"var(--jx-space-5)"},'& [part="day-date"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"600",color:"var(--fg)"},'& [part="day"][data-undated="true"] [part="day-date"]':{$description:"A file with no dated name and no modification time is set apart rather than parked on today. A calendar that invents dates is worse than one that says which files it could not place.",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="board"]':{display:"flex",gap:"var(--jx-space-4)",padding:"var(--jx-space-4) var(--jx-space-5)",alignItems:"flex-start",overflowX:"auto"},'& [part="column"]':{flex:"0 0 220px",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"var(--jx-space-3)",background:"var(--bg-panel)"},'& [part="column-title"]':{margin:"0 0 6px",fontSize:"var(--jx-text-md)",fontWeight:"600",display:"flex",justifyContent:"space-between"},'& [part="count"]':{color:"var(--fg-dim)",fontWeight:"400"},'& [part="list"]':{listStyle:"none",margin:"0",padding:"0"},'& [part="list-item"]':{padding:"3px var(--jx-space-2)",borderRadius:"var(--radius)",cursor:"pointer",fontSize:"var(--jx-text-md)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},'& [part="list-item"]:hover':{background:"var(--hover-bg)"},'& [part="page-line"]':{$description:"One line saying where the collection's entries are published, the Content-Collection board's bar under the toolbar. Its action is quiet: it opens another workspace, and it must not compete with New.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-2)",padding:"var(--jx-space-2) var(--jx-space-5)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)",flexShrink:"0"},'& [part="page-pattern"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg)"},'& [part="design-page"], & [part="add-page"]':{marginLeft:"auto"},'& [part="card"]:focus-visible, & [part="table-row"]:focus-visible, & [part="list-item"]:focus-visible':{$description:"Rows and cards open on Enter or Space as well as a click, so the keyboard reaches an entry; the ring says which one it is on.",outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"div",attributes:{part:"heading"},children:[{tagName:"h2",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"p",attributes:{part:"subtitle"},textContent:"${state.subtitle}"}]},{tagName:"div",attributes:{part:"toolbar"},children:[{tagName:"jx-action-group",attributes:{part:"layouts"},$props:{selects:"single",compact:!0,label:"View"},children:[{$prototype:"Array",items:{$ref:"#/state/layouts"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"layout","data-layout":"${$map.item.key}"},$props:{size:"sm",hint:"${$map.item.label}",checked:{$ref:"$map/item/checked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setLayout"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]},{tagName:"jx-textfield",attributes:{part:"search"},$props:{label:"${state.searchLabel}",placeholder:"${state.searchLabel}…",size:"sm",value:{$ref:"#/state/query"},type:"search"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/search"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"locale-slot",role:"none"},$switch:{$ref:"#/state/localeState"},cases:{shown:{tagName:"jx-select",attributes:{part:"locale"},$props:{label:"Language",size:"sm",options:{$ref:"#/state/localeOptions"},value:{$ref:"#/state/localeValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setLocale"},value:[{$ref:"event#/target/value"}]}],description:"The facet's options come from ALL scanned files, never from the filtered ones: a picker whose choices collapse to the choice just made cannot be used to make another."}}}},{tagName:"div",attributes:{part:"filter-slot",role:"none"},$switch:{$ref:"#/state/filterState"},cases:{shown:{$description:"The Filter: one value of what groups the entries, their status or the field the Board groups by, so it offers exactly the Board's columns.",tagName:"jx-select",attributes:{part:"filter"},$props:{label:"Filter",size:"sm",options:{$ref:"#/state/filterOptions"},value:{$ref:"#/state/filterValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"span",attributes:{part:"spacer"}},{tagName:"div",attributes:{part:"grid-slot",role:"none"},$switch:{$ref:"#/state/fieldsState"},cases:{shown:{tagName:"jx-action-button",attributes:{part:"edit-grid"},$props:{size:"sm",icon:"rows",hint:"Edit every entry of this collection in a grid"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}],description:"The collection's grid (`collection.editInGrid { name }`): the one visible door to it, since the palette cannot prompt for a free-text name."},children:[{tagName:"span",textContent:"Edit in grid"}]}}},{tagName:"div",attributes:{part:"fields-slot",role:"none"},$switch:{$ref:"#/state/fieldsState"},cases:{shown:{tagName:"jx-action-button",attributes:{part:"fields"},$props:{size:"sm",icon:"sliders-horizontal",hint:"Edit this collection's fields in Project Settings",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFields"},value:[]}],description:'Project Settings › Content types, on this collection (`settings.open { section: "content", entry }`).'},children:[{tagName:"span",textContent:"Fields"}]}}},{tagName:"div",attributes:{part:"new-slot",role:"none"},$switch:{$ref:"#/state/newState"},cases:{shown:{tagName:"jx-button",attributes:{part:"new"},$props:{size:"sm",variant:"accent"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}],description:"Creation is somebody else's flow: `file.new` opens Add new on this collection's kind, a page for Pages and an entry for a collection."},children:[{tagName:"span",textContent:"${state.newLabel}"}]}}}]}]},{$description:"The header line: where this collection's entries are published, derived from the page whose `$paths.contentType` names it. Pages draw nothing here.",tagName:"div",attributes:{part:"page-slot",role:"none"},$switch:{$ref:"#/state/page/state"},cases:{loading:{tagName:"div",attributes:{part:"page-line"},children:[{tagName:"span",attributes:{part:"page-text"},textContent:"${state.page.text}"}]},page:{tagName:"div",attributes:{part:"page-line","data-state":"page"},children:[{tagName:"span",attributes:{part:"page-text"},textContent:"${state.page.text}"},{tagName:"code",attributes:{part:"page-pattern"},textContent:"${state.page.pattern}"},{tagName:"span",attributes:{part:"page-template"},textContent:"${state.page.template}"},{tagName:"jx-action-button",attributes:{part:"design-page"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/designPage"},value:[]}],description:"Opening the page is activating it, which enters Design (studio.md §22.1)."},children:[{tagName:"span",textContent:"${state.page.designLabel}"}]}]},none:{tagName:"div",attributes:{part:"page-line","data-state":"none"},children:[{tagName:"span",attributes:{part:"page-text"},textContent:"${state.page.text}"},{tagName:"jx-action-button",attributes:{part:"add-page"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addPage"},value:[]}],description:"Writes the collection's page exactly as Add new's own-page option does."},children:[{tagName:"span",textContent:"Add one"}]}]}}},{tagName:"div",attributes:{part:"banner-slot",role:"none"},$switch:{$ref:"#/state/bannerState"},cases:{shown:{tagName:"div",attributes:{part:"banner",role:"status"},children:[{tagName:"span",textContent:"${state.bannerText}"},{tagName:"jx-button",attributes:{part:"retry"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"}}]},children:[{tagName:"span",textContent:"Retry"}]}]}}},{tagName:"div",attributes:{part:"body"},onscroll:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/scrolled"}}],description:"The rendered item count is proportional to the VIEWPORT, not to the project: a scroll recomputes the window from the box the adapter measures here, and never re-reads the scan."},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},$switch:{$ref:"#/state/view"},cases:{loading:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Scanning the project…"}]},incomplete:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Nothing to show, and the scan did not finish."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.emptyDetail}"},{tagName:"jx-button",attributes:{part:"retry"},$props:{size:"sm",variant:"primary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"}}]},children:[{tagName:"span",textContent:"Retry"}]}]},empty:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"${state.emptyMessage}"},{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.emptyDetail}"}]},nomatch:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",children:[{tagName:"span",textContent:"${state.emptyMessage}"},{tagName:"span",attributes:{part:"empty-detail"},textContent:" ${state.emptyDetail}"}]},{tagName:"jx-button",attributes:{part:"reset"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/reset"}}],description:"Both facets in one clause and one button, so a reader who filtered twice is told about both rather than sent to clear one and find the list still empty."},children:[{tagName:"span",textContent:"Clear filters"}]}]},cards:{tagName:"div",attributes:{part:"grid","data-layout":"cards",style:"${state.pad}"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/path"},map:{tagName:"div",attributes:{part:"card","data-path":"${$map.item.path}",tabindex:"0",role:"button"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{tagName:"div",attributes:{part:"card-art"},children:[{tagName:"div",attributes:{part:"art-slot",role:"none"},$switch:{$ref:"$map/item/art"},cases:{image:{tagName:"img",attributes:{part:"thumb",loading:"lazy",src:"${$map.item.src}",alt:""}},doc:{tagName:"div",attributes:{part:"doc-preview","data-path":"${$map.item.path}",inert:""}},glyph:{tagName:"jx-icon",attributes:{part:"file-glyph"},$props:{name:"file-text"}}}}]},{tagName:"div",attributes:{part:"card-label",title:"${$map.item.path}"},textContent:"${$map.item.name}"},{tagName:"div",attributes:{part:"card-meta"},textContent:"${$map.item.meta}"}]}}]},table:{tagName:"div",attributes:{part:"table",role:"table","aria-label":"${state.title}"},children:[{tagName:"div",attributes:{part:"table-head",role:"row"},children:[{$prototype:"Array",items:{$ref:"#/state/columns"},key:{$ref:"$map/item/field"},map:{tagName:"div",attributes:{part:"cell",role:"columnheader","data-field":"${$map.item.field}"},textContent:"${$map.item.title}"}}]},{tagName:"div",attributes:{part:"pad",style:"${state.padTop}"}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/path"},map:{tagName:"div",attributes:{part:"table-row",role:"row","data-path":"${$map.item.path}",tabindex:"0"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/cells"},key:{$ref:"$map/item/field"},map:{tagName:"div",attributes:{part:"cell",role:"cell","data-field":"${$map.item.field}"},textContent:"${$map.item.text}"}}]}},{tagName:"div",attributes:{part:"pad",style:"${state.padBottom}"}}]},calendar:{tagName:"div",attributes:{part:"calendar"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"section",attributes:{part:"day","data-undated":"${$map.item.undated}"},children:[{tagName:"h3",attributes:{part:"day-date"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"note-slot",role:"none"},$switch:{$ref:"$map/item/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${$map.item.note}"}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"list-item","data-path":"${$map.item.path}",title:"${$map.item.path}",tabindex:"0"},textContent:"${$map.item.name}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]}}}]}]}},{tagName:"div",attributes:{part:"truncated-slot",role:"none"},$switch:{$ref:"#/state/truncatedState"},cases:{shown:{tagName:"p",attributes:{part:"truncated"},textContent:"${state.truncated}"}}}]},board:{tagName:"div",attributes:{part:"board"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"section",attributes:{part:"column"},children:[{tagName:"h3",attributes:{part:"column-title"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"list-item","data-path":"${$map.item.path}",title:"${$map.item.path}",tabindex:"0"},textContent:"${$map.item.name}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]," ":[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]}}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},$switch:{$ref:"$map/item/noteState"},cases:{shown:{tagName:"p",attributes:{part:"truncated"},textContent:"${$map.item.note}"}}}]}}]}}}]}]};E("library-pane",Fe);function Ce(e,t){e.region=t.region,e.view=t.view,e.title=t.title,e.subtitle=t.subtitle,e.searchLabel=t.searchLabel,e.newLabel=t.newLabel,e.newState=t.newState,e.fieldsState=t.fieldsState,e.page=t.page,e.layouts=t.layouts,e.filterState=t.filterState,e.filterOptions=t.filterOptions,e.filterValue=t.filterValue,e.localeState=t.localeState,e.localeOptions=t.localeOptions,e.localeValue=t.localeValue,e.query=t.query,e.bannerState=t.bannerState,e.bannerText=t.bannerText,e.emptyMessage=t.emptyMessage,e.emptyDetail=t.emptyDetail,e.pad=t.pad,e.padTop=t.padTop,e.padBottom=t.padBottom,e.rows=t.rows,e.columns=t.columns,e.groups=t.groups,e.truncated=t.truncated,e.truncatedState=t.truncatedState}function Qe(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Ze(e){let t=e?.$map,a=m(t)?t.item:void 0,r=m(a)?a.path:void 0;return n(r)?r:""}function ke(e,t,a){e.replaceChildren();let r=new AbortController;UO(e,r.signal);let o=b({addPage:a.addPage,bannerState:"hidden",bannerText:"",columns:[],contextMenu:a.contextMenu,designPage:a.designPage,emptyDetail:"",emptyMessage:"",fieldsState:"hidden",groups:[],layouts:[],filterOptions:[],filterState:"hidden",filterValue:"",localeOptions:[],localeState:"hidden",localeValue:"",newLabel:"",newState:"hidden",openFields:a.openFields,openGrid:a.openGrid,openFile:a.openFile,openNew:a.openNew,pad:"",padBottom:"",padTop:"",previewSlot:a.previewSlot,query:"",region:"",reset:a.reset,retry:a.retry,page:{designLabel:"",pattern:"",state:"hidden",template:"",text:""},rows:[],scrolled:a.scrolled,scroller:a.scroller,search:a.search,searchLabel:"",setLayout:a.setLayout,setFilter:a.setFilter,setLocale:a.setLocale,subtitle:"",title:"",truncated:"",truncatedState:"hidden",view:"loading"});Ce(o,t);let i=null,l=!1,s=I("library-pane",o,e,{onNodeCreated:(d,c,u,f)=>{let h=Qe(u);if(h===""||!(d instanceof HTMLElement))return;if(h==="body"){a.scroller(d);return}if(h==="doc-preview"){let y=Ze(f);if(y)a.previewSlot(d,y)}}}).then((d)=>{let c=d.root;if(l)return d.dispose(),c;return i=d,c});return{attached:()=>{if(l)return!1;let d=i?.root;return d===void 0?!0:d instanceof HTMLElement&&e.contains(d)},dispose(){l=!0,r.abort(),i?.dispose(),i=null},ready:s,update:(d)=>Ce(o,d)}}var et="table",v=b({collection:hi,loading:!1,revision:0,views:{}});function il(e=Fu()){let t=v.views[e];if(t)return t;let a={filter:"",layout:et,locale:"",query:""};return v.views[e]=a,v.views[e]??a}function T(){return ec(v.collection)??{fileBacked:!1,item:"page",key:hi,kind:"pages",title:"Pages"}}function Fu(){return T().key}var j=null,M=!1;function P(){if(j?.stale()===!0){j=null,M=!1;for(let e of R.values())e.cache.clear()}return j??=$D(),j}function F(){v.revision+=1}function FN(e){v.collection=e,il(e),F(),wn("leftPanel")}function FE(e,t=Fu()){il(t).layout=e,F()}function QS(e,t=Fu()){il(t).query=e,F()}function tt(e,t=Fu()){il(t).filter=e,F()}function e0(e,t=Fu()){il(t).locale=e,F()}function Id(){j=null,M=!1;for(let e of R.values())e.cache.clear();F()}function jE(){let e=P();if(!M&&!v.loading)V();if(!e.scanned())return null;let t=new Map;for(let a of e.files())if(a.collection!==null)t.set(a.collection,(t.get(a.collection)??0)+1);return t}var at=600,Pe="content.scan",C="Content";async function V(){let e=P();M=!0,v.loading=!0,F();let t={handle:null},a=setTimeout(()=>{t.handle=Js({source:C,status:"Reading the project's directories…",title:"Scan project files"})},at);try{await e.rows();let r=e.failures();if(r.length>0){let o=r.map((l)=>`${l.dir} — ${l.error}`).join(`
3
+ `),i=`Could not read ${r.length} project ${r.length===1?"directory":"directories"} — this list is incomplete.`;w.error(i,{action:"content.refresh",detail:o,key:Pe,path:r[0].dir,source:C,tier:"problem"}),t.handle?.setStatus(i)}t.handle?.done(`${e.files().length} file(s)`)}catch(r){if(t.handle)t.handle.fail("Could not scan the project's files.");else w.error("Could not scan the project's files.",{action:"content.refresh",detail:X(r),key:Pe,source:C,tier:"problem"})}finally{clearTimeout(a),v.loading=!1,F(),wn("leftPanel")}}async function HE(){j=null,M=!1;for(let e of R.values())e.cache.clear();await V()}var R=new Map;function W(e){return R.get(e)??null}function BE(e,t){let a=W(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function VE(e){let t=R.get(e);if(!t)return;if(t.settleTimer!==null)clearTimeout(t.settleTimer),t.settleTimer=null;t.unlisten(),t.observer.destroy(),t.cache.clear(),t.slots.clear(),t.pendingPaths.clear(),t.scope.stop(),t.surface.dispose(),R.delete(e)}function rt(e,t,a){let r=pe[t],o=e?.scroller??null;if(!r.windowed||!o)return{end:a,padBottom:0,padTop:0,start:0,totalRows:a};return W0({columns:xe(t,o.clientWidth),count:a,rowHeight:r.rowHeight,scrollTop:o.scrollTop,viewportHeight:o.clientHeight})}async function ot(e,t){e.pendingPaths.add(t);try{let a=await Ew(t,e.cache);if(!a||W(e.paneId)!==e)return;let r=e.slots.get(t);if(r?.isConnected&&!gw(r))mw(r,a)}finally{e.pendingPaths.delete(t)}}function je(e,t,a){let r=e.cache.get(a);if(gw(t))return;if(r){mw(t,r);return}if(e.pendingPaths.has(a))return;e.pending.set(t,a),e.observer.observe(t)}function it(e,t,a){e.slots.set(a,t),je(e,t,a)}function lt(e){if(e.settleTimer!==null)return;e.settleTimer=setTimeout(()=>{if(e.settleTimer=null,W(e.paneId)!==e)return;e.observer.releaseDetached();let t=_D.has(il().layout);for(let[a,r]of e.slots){if(!r.isConnected){e.slots.delete(a);continue}if(t)je(e,r,a)}},0)}function Re(e){if(e.record)vD(e.record.source,e.record.row);else if(e.collection===null||e.collection===hi)_i(e.path);else ql(e.path)}var H=null;function st(){H?.close(),H=null}function Me(e){return P().files().find((t)=>t.path===e)??null}function ct(e,t,a){let r=Me(e);if(!r||r.record)return;st();let o=(i,l,s,d={})=>({destructive:!1,disabled:!1,dividerAbove:!1,id:i,run:s,title:l,...d});H=Vt({label:"File actions",onClosed:(i)=>{if(H===i)H=null},origin:{x:t,y:a},region:"content",rows:[o("open","Open",()=>{Re(r)}),o("rename","Rename…",()=>{dt(r)},{dividerAbove:!0}),...p().readFileBytes!==void 0?[o("duplicate","Duplicate",()=>{pt(r)})]:[],o("delete","Delete",()=>{ut(r)},{destructive:!0,dividerAbove:!0})]})}async function dt(e){let t=e.path.replaceAll("\\","/"),a=await B0(t,C);if(a===null)return;let r=await Fb(e.path),o={confirmLabel:"Rename",select:"stem",validate:(d)=>qm(t,d,a),value:e.name};if(r!==void 0)o.message=r;let i=await Fn("Rename",o);if(!i||i===e.name)return;let l=$m(t),s=l==="."?i:`${l}/${i}`;try{let d=await Ww(t,s);Id(),await V(),Vw(H0(i,d),d,s)}catch(d){w.error(`Could not rename ${e.name}.`,{detail:X(d),path:e.path,source:C})}}async function pt(e){if(await Bx(e.path.replaceAll("\\","/"),{document:!0,source:C})!==null)Id(),await V()}async function ut(e){if(!await Mb(e))return;try{await p().deleteFile(e.path),hs(),Id(),await V(),w.success(`Deleted ${e.name}`)}catch(a){w.error(`Could not delete ${e.name}.`,{detail:X(a),path:e.path,source:C})}}function Ne(e,t){if(e.layout===!1)return"with no template";let a=e.layout??t;return a?`using ${Zb(a)}`:"with no template"}function mt(e,t,a,r=[]){let o={designLabel:"",pattern:"",state:"hidden",template:"",text:""};if(e.kind==="pages")return o;if(t===void 0)return{...o,state:"loading",text:"Finding where these entries are published…"};if(t===null)return{...o,state:"none",text:"Entries have no page of their own"};let i=Rb(),l=(d)=>{let c=d===null?-1:i.indexOf(d);return c===-1?i.length:c},s=r.filter((d)=>d.locale!==null).toSorted((d,c)=>l(d.locale)-l(c.locale));if(s.length>1){let d=new Set(s.map((c)=>Ne(c,a)));return{designLabel:`Design the ${e.item} page`,pattern:s.map((c)=>`${c.pattern} (${c.locale})`).join(", "),state:"page",template:d.size===1?[...d][0]:"using a template per language",text:`Each ${e.item} has a page in each language at`}}return{designLabel:`Design the ${e.item} page`,pattern:t.pattern,state:"page",template:Ne(t,a),text:`Each ${e.item} has a page at`}}function ft(e){let t=oh(e,il(e).locale);if(t)_i(t.path)}async function gt(e){let{addCollectionPage:t}=await (ce("any4pw2q"),import("./add-new-flow-any4pw2q.js"));await t(e)}function ht(e,t,a){return{checked:a?"true":"false",key:e,label:t}}function yt(e,t){let a=`${t.locale===""?"":` in ${Wt(t.locale)}`}${t.filter===""?"":` filtered to ${t.filter}`}`,r=t.query.trim();return`No ${e.kind==="pages"?"pages":e.title.toLowerCase()} match${r?` “${r}”`:""}${a}.`}function bt(e,t,a,r){if(a>0)return t;if(v.loading||!e.scanned())return"loading";if(e.failures().length>0)return"incomplete";return r===0?"empty":"nomatch"}function t0(e){return P().files().filter((t)=>t.collection===e).map((t)=>t.path)}function wt(e,t){if(e.kind==="pages")return P().scanned()?vt(t==="table"):N(new Map);if(e.fileBacked){let o=Ee(e.key),i=P().files().filter((l)=>l.collection===e.key&&l.record);return N(new Map(i.map((l)=>{let{fields:s}=l.record,d=E0(o,s),c=d===null?"":Lb(s[d]??""),u=bT(l.record.source,s,o);return[l.path,{date:c,fields:s,status:"",thumb:u,title:l.name}]})))}if(!P().scanned())return N(new Map);let a=Rw(e.key,t0(e.key)),r=new Map((a??[]).map((o)=>[o.path,{date:o.date,fields:o.fields,status:o.status,thumb:o.thumb,title:o.title}]));return N(r)}function vt(e){let t=t0(hi),a=e?ge(t):null,r=new Set(Object.keys(x?.projectConfig?.content??{})),o=Ae(),{i18n:i}=ln(x?.projectConfig??{}),l=new Map(t.map((s)=>{let d=a?.get(s),c=d?.contentType??null,u=d===void 0?void 0:d.layout??o??!1;return[s,{date:"",status:"",template:u===void 0?"":u===!1?"None":Zb(u),title:c!==null&&r.has(c)?U(`${le(c)} page`,s,i):J(wo(s),s,i)}]}));return N(l)}function xt(e){return e.map((t)=>({file:t,route:wo(t.path)})).toSorted((t,a)=>vC(t.route,a.route)||t.file.path.localeCompare(a.file.path)).map(({file:t})=>t)}function Ee(e){return qs(e)?.schema??GO(e)}function $t(e,t){let a=new Set,r=_p(e),o=gT(e);for(let i of[r,o,ks(t)?.field??null])if(i!==null)a.add(i);return a}function St(e){let t=new Map;for(let[a,r]of Object.entries(e?.properties??{}))if(Array.isArray(r.enum))t.set(a,r.enum.filter((o)=>n(o)));return t}function Lt(e,t){let a=[...new Set(e.flatMap((i)=>i?.status?[i.status]:[]))];if(a.length>0)return{matches:(i,l)=>(i?.status??"")===l,title:"Status",values:a.toSorted((i,l)=>i===K0?1:l===K0?-1:i.localeCompare(l))};if(!t)return null;let r=new Set(e.flatMap((i)=>_(i?.fields?.[t.name],t.list))),o=t.order.length>0?[...t.order,...[...r].filter((i)=>!t.order.includes(i)).toSorted()]:[...r].toSorted((i,l)=>i.localeCompare(l));return{matches:(i,l)=>_(i?.fields?.[t.name],t.list).includes(l),title:t.title,values:o}}function Te(e,t){let a=P(),r=T(),o=il(r.key),{layout:i}=o,l=vT(a.files(),{collection:r.key,query:""}),s=wt(r,i),d=l.map((g)=>s(g)),c=r.kind==="collection"?Ee(r.key):null,u=r.kind==="collection"?qs(r.key)?.def:null,f=TD(c,$t(c,u)),h=be(f,St(c),d),y=r.kind==="collection"?Lt(d,h):null,A=y!==null&&y.values.includes(o.filter)?o.filter:"",O=vT(a.files(),{collection:r.key,locale:o.locale,query:o.query}),G=y===null||A===""?O:O.filter((g)=>y.matches(s(g),A)),z=r.kind==="pages"?xt(G):G,K=l.length,L=bt(a,i,z.length,K),D=rt(e,i,z.length),Oe=z.slice(D.start,D.end),k=a.failures(),Z=SD(l),ue=xT(r.key,{date:gT(c)!==null||d.some((g)=>(g?.date??"")!==""),fields:f,locale:Z.length>1,status:d.some((g)=>(g?.status??"")!=="")}),De=L==="cards",ee=L==="calendar"?Se(z,s):{groups:[],truncated:""},q=r.kind==="pages",ae=q?"pages":r.title.toLowerCase();return{bannerState:k.length>0?"shown":"hidden",bannerText:k.length===0?"":`This list is incomplete — ${k.length} ${k.length===1?"directory":"directories"} could not be read (${k[0].dir}${k.length>1?", …":""}).`,columns:L==="table"?ue.map((g)=>({field:g.field,title:g.title})):[],emptyDetail:L==="incomplete"?`${k.length} ${k.length===1?"directory":"directories"} could not be read, so this is not the same as an empty collection.`:L==="nomatch"?`${K} ${K===1?r.item:ae} in all.`:L==="empty"?`New ${r.item} adds the first one.`:"",emptyMessage:L==="nomatch"?yt(r,o):L==="empty"?`No ${ae} yet.`:"",fieldsState:r.kind==="collection"?"shown":"hidden",groups:L==="board"?Le(z,s,h):ee.groups,layouts:Sm.map((g)=>ht(g,Nw[g],i===g)),localeOptions:[{label:"All languages",value:"all"},...Z.map((g)=>({label:Wt(g),value:g}))],filterOptions:y===null?[]:[{label:`Any ${y.title.toLowerCase()}`,value:"all"},...y.values.map((g)=>({label:g,value:g}))],filterState:y!==null&&y.values.length>1?"shown":"hidden",filterValue:A===""?"all":A,localeState:Z.length<2?"hidden":"shown",localeValue:o.locale===""?"all":o.locale,newLabel:`New ${r.item}`,newState:r.fileBacked?"hidden":"shown",pad:`padding-top:calc(var(--jx-space-4) + ${D.padTop}px);padding-bottom:calc(var(--jx-space-4) + ${D.padBottom}px)`,padBottom:`height:${D.padBottom}px`,padTop:`height:${D.padTop}px`,page:mt(r,q?null:oh(r.key,o.locale),Ae(),q||o.locale!==""?[]:YO(r.key)??[]),query:o.query,region:$n(t,"content"),rows:L==="cards"||L==="table"?Oe.map((g)=>$e(g,L==="table"?ue:[],De,s(g))):[],searchLabel:`Search ${ae}`,subtitle:q?"Every URL on your site.":"",title:r.title,truncated:ee.truncated,truncatedState:ee.truncated===""?"hidden":"shown",view:L}}function Ae(){return x?.projectConfig?.defaults?.layout??null}function jN(e,t){let{paneId:a,wrap:r}=e;if(BE(a,t))return;VE(a);let o=null,i=xp((c)=>{let u=o;if(!u)return;let f=u.pending.get(c);if(f!==void 0)u.pending.delete(c),ot(u,f)}),l=()=>{if(o!==null&&W(a)===o)o.surface.update(Te(o,a)),lt(o)},s=ke(r,Te(null,a),{addPage:()=>{gt(T().key)},contextMenu:(c,u,f)=>ct(c,u,f),designPage:()=>{ft(T().key)},openFields:()=>{nt("settings.open",{entry:T().key,section:"content"},C)},openGrid:()=>{let c=T(),u=c.fileBacked?fx(c.key):null;if(u){_i(u);return}nt("collection.editInGrid",{name:c.key},C)},openFile:(c)=>{Re(Me(c)??{collection:Fu(),path:c})},openNew:()=>{let c=T(),{locale:u}=il(c.key),f=c.kind==="pages"?{kind:"page"}:{collection:c.key,kind:"entry"};if(u!=="")f.locale=u;nt("file.new",f,C)},previewSlot:(c,u)=>{if(o)it(o,c,u)},reset:()=>{QS(""),e0("")},retry:()=>{HE()},scrolled:()=>F(),scroller:(c)=>{if(o)o.scroller=c},search:(c)=>QS(c),setLayout:(c)=>FE(c),setFilter:(c)=>tt(c==="all"?"":c),setLocale:(c)=>e0(c==="all"?"":c)}),d=me();o={cache:kw(),observer:i,paneId:a,pending:new WeakMap,pendingPaths:new Set,scope:d,scroller:null,settleTimer:null,slots:new Map,surface:s,tabId:t.id,unlisten:(()=>{let c=Op(()=>F()),u=Iw(()=>F()),f=he(()=>F());return()=>{c(),u(),f()}})(),wrap:r},R.set(a,o),d.run(()=>{te(()=>{if(W(a)!==o)return;v.revision,v.collection,v.loading;let c=il(Fu());if(c.layout,c.query,c.locale,l(),!M&&!v.loading)V()})})}function HN(){v.collection=hi,v.views={},v.loading=!1,j=null,M=!1,F()}
4
+ export{hb,fw,AN,pb,Rd,PN,MN,ME,mw,gw,il,Fu,FN,FE,QS,e0,Id,jE,HE,BE,VE,t0,jN,HN};
5
+
6
+ //# debugId=13C72017FE5CF08B64756E2164756E21
7
+ //# sourceMappingURL=studio-s4k1v7dt.js.map
@@ -0,0 +1,5 @@
1
+ function Ip(t){if(Number.isNaN(t.getTime()))return"";let r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${String(t.getFullYear()).padStart(4,"0")}-${r}-${n}`}
2
+ export{Ip};
3
+
4
+ //# debugId=6082A299D0C404CC64756E2164756E21
5
+ //# sourceMappingURL=studio-t46rt6gx.js.map
@@ -1,5 +1,5 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{p,ye}from"./studio-4fnb5648.js";import{w}from"./studio-sce30r7b.js";import{us}from"./studio-4zd6an2b.js";import{fI,Yx,xv,h}from"./studio-knsjyx7n.js";import{v1,mi,zv}from"./studio-nvcn2ykc.js";import{$s,Kd,HO,BO,zO}from"./studio-hh394phe.js";import{Ls}from"./studio-bnc50f9h.js";import{oa,tR,nR,ra,At}from"./studio-1ks5d9y4.js";import{GC,rI,mh}from"./studio-acer0g8w.js";import{C}from"./studio-4f7thq0p.js";import{Y}from"./studio-k3we3kqb.js";var UC="__other__";function ds(t){return t.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function q$(t){let e=t.lastIndexOf(".");return e>0?t.slice(e):""}function G$(t,e,n){let r=t.trim();if(n===void 0||e==="__other__")return r;if(n.kind==="fixed"){let i=ds(r);return i===""?"":`${i}${n.ext}`}return r.toLowerCase().endsWith(e.toLowerCase())?r:`${r}${e}`}function iv(t,e,n){let{choice:r,dir:i,known:o=new Set,rows:s=null,taken:a}=n,l=t.trim();if(!l)return r?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(r?.kind==="fixed"&&ds(l)==="")return"Enter at least one letter or number.";let d=l.replaceAll("\\","/");if(d.startsWith("/")||d.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(d.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(d.includes("/")&&r!==void 0&&e!=="__other__")return`Pick Other… to create a file in a subfolder of ${i==="."?"the project root":i}.`;let u=q$(d);if(e!==""&&e!=="__other__"&&u!==""&&u.toLowerCase()!==e.toLowerCase()&&o.has(u.toLowerCase()))return`You picked ${s?.find((v)=>v.value===e)?.label??e}; this name ends in ${u}.`;if(r?.kind==="locked"&&e==="__other__"){if(u!==""&&u.toLowerCase()!==r.ext.toLowerCase()&&o.has(u.toLowerCase()))return r.because}let m=G$(t,e,r);return a.has(m.toLowerCase())?`${m} already exists in ${i}/.`:""}function Wm(t,e,n){let r=e.trim();if(r==="")return"Enter a file name.";if(/[/\\]/.test(r))return"Enter a name, not a path. A rename keeps the file in its folder.";let i=(t.split("/").pop()??t).toLowerCase();if(r.startsWith(".")&&!i.startsWith("."))return"A name cannot start with a dot: hidden files are not listed, so the file could disappear.";let o=r.toLowerCase();if(o!==i&&[...n].some((s)=>s.toLowerCase()===o))return`${r} already exists in this folder.`;return""}function x(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var R=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Jc(){return(ye()?p().assetCapabilities?.accept:void 0)??R}function zd(t){return ra.has(At(t))}function Wd(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=At(t.name);if(oa.has(n))return"image";if(tR.has(n))return"video";if(nR.has(n))return"audio";return"file"}var K$=new Set([".woff",".woff2",".ttf",".otf"]);function IO(t){if(K$.has(At(t)))return"font";let e=Wd({name:t});return e==="file"?"document":e}var k=/^content\/([^/]+)\//,Ta="public/media";function J$(t){let e=t?k.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:Ta}function RO(t){let e=t.replaceAll("\\","/");return e===Ta||/^content\/[^/]+\/images$/.test(e)}function T(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function P(t,e){let n=new Set([...e].map((o)=>o.toLowerCase()));if(!n.has(t.toLowerCase()))return t;let r=At(t),i=r?t.slice(0,-r.length):t;for(let o=1;;o++){let s=`${i}-${o}${r}`;if(!n.has(s.toLowerCase()))return s}}function Y$(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var y=null;function DO(t){y=t}async function Nx(t,e){await(e===void 0?y?.(t):y?.(t,e))}function M(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function I(t,e){let n=(o)=>e==="image"?oa.has(At(o.name)):zd(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)w.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function Ys(t,e={}){let n=e.only===void 0?[...t]:I([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??J$(h.value?.documentPath??null),o=e.source??"Media",s;try{let d=await $s(()=>r.listDirectory(i));s=new Set(d.map((u)=>u.name))}catch(d){if(e.dirExists===!0)return w.error(`Could not write to ${i}/.`,{detail:`The folder could not be read to choose a name that overwrites nothing: ${X(d)}`,path:i,source:o}),[];s=new Set}let a=ye()?p().assetCapabilities?.maxUploadBytes:void 0,l=[];for(let d of n){if(a!==void 0&&d.size>a){w.error(`${d.name} is too large.`,{detail:`This backend accepts at most ${x(a)}; that file is ${x(d.size)}.`,source:"Media"});continue}let u=P(d.name,s);s.add(u);let m=Y$(i,u);try{let{path:f}=await(e.write?e.write(m):r.uploadFile(m,d));Kd([f]),l.push({kind:Wd(d),name:u,path:f,ref:T(f)})}catch(f){w.error(`Could not upload ${d.name}.`,{detail:X(f),path:m,source:o})}}if(l.length>0){if(e.quiet!==!0)w.success(l.length===1?`Uploaded ${l[0].name} to ${i}/`:`Uploaded ${l.length} files to ${i}/`);await y?.(i)}return l}function L(t){try{let e=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);return e.startsWith("\uFEFF")?null:e}catch{return null}}function D(t){let e=t.slice(0,t.length-At(t).length);return`${e.replace(/-copy(?:-\d+)?$/,"")}-copy${t.slice(e.length)}`}async function Ax(t,e={}){let n=t.split("/").pop()??t,r=e.source??"Media",i;try{let a=p();if(a.readFileBytes===void 0)throw Error("This backend cannot read a file's raw bytes.");i=await a.readFileBytes(t)}catch(a){return w.error(`Could not duplicate ${n}.`,{detail:X(a),path:t,source:r}),null}let o=e.document===!0?L(i):null,[s]=await Ys([new File([i],D(n))],{dir:M(t),dirExists:!0,quiet:!0,source:r,...o!==null&&{write:async(a)=>(await p().writeFile(a,o),{path:a})}});if(!s)return null;if(s.path===t)return w.warn(`${n} was not duplicated.`,{detail:"The backend keeps identical files once, so it made no second file.",path:t,source:r}),null;return w.success(`Duplicated ${n} as ${s.name}`),s}var z=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function A(t){return z.find((e)=>e.has(t))??new Set([t])}function NO(t){return[...A(At(t))].join(",")}function N(t,e){return A(At(t)).has(At(e.name))}function AO(t,e,n){let r=Wm(t,e,n);if(r!=="")return r;if(!N(t,{name:e.trim()}))return`Keep the ${At(t)} extension. A rename does not convert the file, so another extension would break it on every page.`;return""}async function Ox(t,e,n={}){let r=t.split("/").pop()??t;if(!N(t,e))return w.error(`${e.name} cannot replace ${r}.`,{detail:`${r} is ${At(t)||"a file with no extension"} and ${e.name} is ${At(e.name)||"a file with no extension"}. Every page that uses ${r} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let i=ye()?p().assetCapabilities?.maxUploadBytes:void 0;if(i!==void 0&&e.size>i)return w.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${x(i)}; that file is ${x(e.size)}.`,source:"Media"}),!1;Ls(t);let o;try{({path:o}=await p().uploadFile(t,e))}catch(s){return w.error(`Could not replace ${r}.`,{detail:X(s),path:t,source:"Media"}),!1}if(Kd([t,o]),o===t)BO(t);if(us(),await(o===t?Nx(M(t),t):Nx(M(t))),o!==t)return w.warn(`${r} was not replaced.`,{detail:`The backend stored the new file as ${o}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return w.success(n.note===void 0?`Replaced ${r}`:`Replaced ${r}: ${n.note}`),!0}function Mx(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function ov(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function B(){return C?.projectConfig?.content??null}function _(t){return xv(t,B(),rI())}function U(t,e){return`${mi(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function rv(t){let e=mi(t);if(e.startsWith(`${v1}/`))return`/${e.slice(v1.length+1)}`;let n=_(e);return n?`/${U(e,n)}`:`/${e}`}function nr(t){let e=mi(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=mh(),i=zO(e);if(n==="repo")return Yx(fI(`${r}${zv(e)}`,HO(e)),i);let o=zv(rv(e).slice(1));return Yx(GC(`/${o}`),i)}var c=new Map,E=new Map,g=new Map,b=new Set;function S(t){return At(t)===".svg"}function F(t){let e=t===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(t),n=e?Number(e[1]):Number.NaN;return n>0?n:null}function j(t){let e=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;if(e.localName!=="svg")return null;let n=F(e.getAttribute("width")),r=F(e.getAttribute("height")),i=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=i[2]??Number.NaN,s=i[3]??Number.NaN,a=i.length===4&&o>0&&s>0,l=null;if(n!==null&&r!==null)l={height:r,width:n};else if(a&&n!==null)l={height:n*s/o,width:n};else if(a&&r!==null)l={height:r,width:r*o/s};else if(a)l={height:s,width:o};return l&&{height:Math.round(l.height),width:Math.round(l.width)}}async function K(t){b.add(t);try{let e=j(await p().readFile(t));if(e&&e.width>0&&e.height>0)g.set(t,e)}catch{}}function Vd(t){let e=mi(t);return c.has(e)&&(!S(e)||b.has(e))}function O(t,e){let n=Mx(t),r=g.get(t);return{bytes:Y(e?.size)?e.size:null,ext:At(n),height:r?.height??null,kind:Wd({name:n}),modified:e?.modified??null,name:n,path:t,width:r?.width??null}}function Yc(t){return c.get(mi(t))??null}function OO(t){for(let e of t){if(e.type!=="file")continue;let n=mi(e.path);if(!c.has(n))c.set(n,O(n,e))}}async function hh(t){let e=mi(t),n=c.get(e);if(n&&Vd(e))return n;let r=E.get(e);if(r)return r;let i=(async()=>{if(S(e)&&!b.has(e))await K(e);if(n){let a=g.get(e);return{...n,height:a?.height??null,width:a?.width??null}}let s;try{s=(await $s(()=>p().listDirectory(ov(e)))).find((l)=>mi(l.path)===e)}catch{s=void 0}return O(e,s)})();E.set(e,i);let o=await i;return E.delete(e),c.set(e,o),o}function fl(t,e,n){if(!(e>0&&n>0))return!1;let r=mi(t);if(S(r))return!1;let i=g.get(r);if(i&&i.width===e&&i.height===n)return!1;g.set(r,{height:n,width:e});let o=c.get(r);if(o)c.set(r,{...o,height:n,width:e});return!0}function MO(){c.clear(),g.clear(),b.clear()}function Vm(t){if(t<1024)return`${t} B`;if(t<1048576)return`${Math.round(t/1024)} KB`;return`${(t/1048576).toFixed(1)} MB`}function Px(t){if(!t)return"";let e=[];if(t.width!==null&&t.height!==null)e.push(`${t.width} × ${t.height}`);if(t.bytes!==null)e.push(Vm(t.bytes));return e.join(" · ")}
2
- export{UC,ds,q$,G$,iv,Wm,Jc,zd,Wd,K$,IO,Ta,J$,RO,Y$,DO,Nx,Ys,Ax,NO,AO,Ox,Mx,ov,rv,nr,Vd,Yc,OO,hh,fl,MO,Vm,Px};
1
+ import{X}from"./studio-9c6cbq2c.js";import{p,ve}from"./studio-xh6rf05g.js";import{w}from"./studio-bk0anq3b.js";import{hs}from"./studio-wn2cmf9q.js";import{CR,i_,Ey,h}from"./studio-s49y6m5b.js";import{L1,mi,Ky}from"./studio-zav9hgb3.js";import{Rs,Kd,ZA,XA,QA}from"./studio-48yzqzqr.js";import{Ls}from"./studio-k05g7efh.js";import{aa,uI,hI,la,Ot}from"./studio-z6s56dzz.js";import{r1,mR,fh}from"./studio-w4mfaaam.js";import{x}from"./studio-zn7ysyzb.js";import{J}from"./studio-erjccagy.js";var n1="__other__";function us(t){return t.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function nR(t){let e=t.lastIndexOf(".");return e>0?t.slice(e):""}function iR(t,e,n){let r=t.trim();if(n===void 0||e==="__other__")return r;if(n.kind==="fixed"){let i=us(r);return i===""?"":`${i}${n.ext}`}return r.toLowerCase().endsWith(e.toLowerCase())?r:`${r}${e}`}function ly(t,e,n){let{choice:r,dir:i,known:o=new Set,rows:s=null,taken:a}=n,l=t.trim();if(!l)return r?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(r?.kind==="fixed"&&us(l)==="")return"Enter at least one letter or number.";let d=l.replaceAll("\\","/");if(d.startsWith("/")||d.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(d.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(d.includes("/")&&r!==void 0&&e!=="__other__")return`Pick Other… to create a file in a subfolder of ${i==="."?"the project root":i}.`;let u=nR(d);if(e!==""&&e!=="__other__"&&u!==""&&u.toLowerCase()!==e.toLowerCase()&&o.has(u.toLowerCase()))return`You picked ${s?.find((v)=>v.value===e)?.label??e}; this name ends in ${u}.`;if(r?.kind==="locked"&&e==="__other__"){if(u!==""&&u.toLowerCase()!==r.ext.toLowerCase()&&o.has(u.toLowerCase()))return r.because}let m=iR(t,e,r);return a.has(m.toLowerCase())?`${m} already exists in ${i}/.`:""}function qm(t,e,n){let r=e.trim();if(r==="")return"Enter a file name.";if(/[/\\]/.test(r))return"Enter a name, not a path. A rename keeps the file in its folder.";let i=(t.split("/").pop()??t).toLowerCase();if(r.startsWith(".")&&!i.startsWith("."))return"A name cannot start with a dot: hidden files are not listed, so the file could disappear.";let o=r.toLowerCase();if(o!==i&&[...n].some((s)=>s.toLowerCase()===o))return`${r} already exists in this folder.`;return""}function y(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var R=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Jc(){return(ve()?p().assetCapabilities?.accept:void 0)??R}function Vd(t){return la.has(Ot(t))}function Wd(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=Ot(t.name);if(aa.has(n))return"image";if(uI.has(n))return"video";if(hI.has(n))return"audio";return"file"}var rR=new Set([".woff",".woff2",".ttf",".otf"]);function BA(t){if(rR.has(Ot(t)))return"font";let e=Wd({name:t});return e==="file"?"document":e}var k=/^content\/([^/]+)\//,La="public/media";function oR(t){let e=t?k.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:La}function VA(t){let e=t.replaceAll("\\","/");return e===La||/^content\/[^/]+\/images$/.test(e)}function T(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function P(t,e){let n=new Set([...e].map((o)=>o.toLowerCase()));if(!n.has(t.toLowerCase()))return t;let r=Ot(t),i=r?t.slice(0,-r.length):t;for(let o=1;;o++){let s=`${i}-${o}${r}`;if(!n.has(s.toLowerCase()))return s}}function sR(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var b=null;function WA(t){b=t}async function Hx(t,e){await(e===void 0?b?.(t):b?.(t,e))}function E(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function I(t,e){let n=(o)=>e==="image"?aa.has(Ot(o.name)):Vd(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)w.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function Qs(t,e={}){let n=e.only===void 0?[...t]:I([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??oR(h.value?.documentPath??null),o=e.source??"Media",s;try{let d=await Rs(()=>r.listDirectory(i));s=new Set(d.map((u)=>u.name))}catch(d){if(e.dirExists===!0)return w.error(`Could not write to ${i}/.`,{detail:`The folder could not be read to choose a name that overwrites nothing: ${X(d)}`,path:i,source:o}),[];s=new Set}let a=ve()?p().assetCapabilities?.maxUploadBytes:void 0,l=[];for(let d of n){if(a!==void 0&&d.size>a){w.error(`${d.name} is too large.`,{detail:`This backend accepts at most ${y(a)}; that file is ${y(d.size)}.`,source:"Media"});continue}let u=P(d.name,s);s.add(u);let m=sR(i,u);try{let{path:f}=await(e.write?e.write(m):r.uploadFile(m,d));Kd([f]),l.push({kind:Wd(d),name:u,path:f,ref:T(f)})}catch(f){w.error(`Could not upload ${d.name}.`,{detail:X(f),path:m,source:o})}}if(l.length>0){if(e.quiet!==!0)w.success(l.length===1?`Uploaded ${l[0].name} to ${i}/`:`Uploaded ${l.length} files to ${i}/`);await b?.(i)}return l}function L(t){try{let e=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);return e.startsWith("\uFEFF")?null:e}catch{return null}}function D(t){let e=t.slice(0,t.length-Ot(t).length);return`${e.replace(/-copy(?:-\d+)?$/,"")}-copy${t.slice(e.length)}`}async function Bx(t,e={}){let n=t.split("/").pop()??t,r=e.source??"Media",i;try{let a=p();if(a.readFileBytes===void 0)throw Error("This backend cannot read a file's raw bytes.");i=await a.readFileBytes(t)}catch(a){return w.error(`Could not duplicate ${n}.`,{detail:X(a),path:t,source:r}),null}let o=e.document===!0?L(i):null,[s]=await Qs([new File([i],D(n))],{dir:E(t),dirExists:!0,quiet:!0,source:r,...o!==null&&{write:async(a)=>(await p().writeFile(a,o),{path:a})}});if(!s)return null;if(s.path===t)return w.warn(`${n} was not duplicated.`,{detail:"The backend keeps identical files once, so it made no second file.",path:t,source:r}),null;return w.success(`Duplicated ${n} as ${s.name}`),s}var z=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function N(t){return z.find((e)=>e.has(t))??new Set([t])}function zA(t){return[...N(Ot(t))].join(",")}function F(t,e){return N(Ot(t)).has(Ot(e.name))}function UA(t,e,n){let r=qm(t,e,n);if(r!=="")return r;if(!F(t,{name:e.trim()}))return`Keep the ${Ot(t)} extension. A rename does not convert the file, so another extension would break it on every page.`;return""}async function Vx(t,e,n={}){let r=t.split("/").pop()??t;if(!F(t,e))return w.error(`${e.name} cannot replace ${r}.`,{detail:`${r} is ${Ot(t)||"a file with no extension"} and ${e.name} is ${Ot(e.name)||"a file with no extension"}. Every page that uses ${r} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let i=ve()?p().assetCapabilities?.maxUploadBytes:void 0;if(i!==void 0&&e.size>i)return w.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${y(i)}; that file is ${y(e.size)}.`,source:"Media"}),!1;Ls(t);let o;try{({path:o}=await p().uploadFile(t,e))}catch(s){return w.error(`Could not replace ${r}.`,{detail:X(s),path:t,source:"Media"}),!1}if(Kd([t,o]),o===t)XA(t);if(hs(),await(o===t?Hx(E(t),t):Hx(E(t))),o!==t)return w.warn(`${r} was not replaced.`,{detail:`The backend stored the new file as ${o}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return w.success(n.note===void 0?`Replaced ${r}`:`Replaced ${r}: ${n.note}`),!0}function Wx(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function cy(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function B(){return x?.projectConfig?.content??null}function _(t){return Ey(t,B(),mR())}function U(t,e){return`${mi(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function dy(t){let e=mi(t);if(e.startsWith(`${L1}/`))return`/${e.slice(L1.length+1)}`;let n=_(e);return n?`/${U(e,n)}`:`/${e}`}function no(t){let e=mi(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=fh(),i=QA(e);if(n==="repo")return i_(CR(`${r}${Ky(e)}`,ZA(e)),i);let o=Ky(dy(e).slice(1));return i_(r1(`/${o}`),i)}var c=new Map,S=new Map,g=new Map,M=new Set;function A(t){return Ot(t)===".svg"}function C(t){let e=t===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(t),n=e?Number(e[1]):Number.NaN;return n>0?n:null}function j(t){let e=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;if(e.localName!=="svg")return null;let n=C(e.getAttribute("width")),r=C(e.getAttribute("height")),i=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=i[2]??Number.NaN,s=i[3]??Number.NaN,a=i.length===4&&o>0&&s>0,l=null;if(n!==null&&r!==null)l={height:r,width:n};else if(a&&n!==null)l={height:n*s/o,width:n};else if(a&&r!==null)l={height:r,width:r*o/s};else if(a)l={height:s,width:o};return l&&{height:Math.round(l.height),width:Math.round(l.width)}}async function K(t){M.add(t);try{let e=j(await p().readFile(t));if(e&&e.width>0&&e.height>0)g.set(t,e)}catch{}}function zd(t){let e=mi(t);return c.has(e)&&(!A(e)||M.has(e))}function O(t,e){let n=Wx(t),r=g.get(t);return{bytes:J(e?.size)?e.size:null,ext:Ot(n),height:r?.height??null,kind:Wd({name:n}),modified:e?.modified??null,name:n,path:t,width:r?.width??null}}function Yc(t){return c.get(mi(t))??null}function qA(t){for(let e of t){if(e.type!=="file")continue;let n=mi(e.path);if(!c.has(n))c.set(n,O(n,e))}}async function uh(t){let e=mi(t),n=c.get(e);if(n&&zd(e))return n;let r=S.get(e);if(r)return r;let i=(async()=>{if(A(e)&&!M.has(e))await K(e);if(n){let a=g.get(e);return{...n,height:a?.height??null,width:a?.width??null}}let s;try{s=(await Rs(()=>p().listDirectory(cy(e)))).find((l)=>mi(l.path)===e)}catch{s=void 0}return O(e,s)})();S.set(e,i);let o=await i;return S.delete(e),c.set(e,o),o}function gl(t,e,n){if(!(e>0&&n>0))return!1;let r=mi(t);if(A(r))return!1;let i=g.get(r);if(i&&i.width===e&&i.height===n)return!1;g.set(r,{height:n,width:e});let o=c.get(r);if(o)c.set(r,{...o,height:n,width:e});return!0}function KA(){c.clear(),g.clear(),M.clear()}function Km(t){if(t<1024)return`${t} B`;if(t<1048576)return`${Math.round(t/1024)} KB`;return`${(t/1048576).toFixed(1)} MB`}function zx(t){if(!t)return"";let e=[];if(t.width!==null&&t.height!==null)e.push(`${t.width} × ${t.height}`);if(t.bytes!==null)e.push(Km(t.bytes));return e.join(" · ")}
2
+ export{n1,us,nR,iR,ly,qm,Jc,Vd,Wd,rR,BA,La,oR,VA,sR,WA,Hx,Qs,Bx,zA,UA,Vx,Wx,cy,dy,no,zd,Yc,qA,uh,gl,KA,Km,zx};
3
3
 
4
- //# debugId=44F9FA380FD26FC664756E2164756E21
5
- //# sourceMappingURL=studio-61rg2cz5.js.map
4
+ //# debugId=94D9AEDDD856D8B064756E2164756E21
5
+ //# sourceMappingURL=studio-td3h1644.js.map
@@ -1,9 +1,9 @@
1
- import{Wr}from"./studio-5tet77de.js";import{ar,w}from"./studio-sce30r7b.js";import{Jt,Ut}from"./studio-nzemfbkk.js";import{sn,dt}from"./studio-tpxcryf2.js";import{uh}from"./studio-pwctzka3.js";import{cA}from"./studio-rr00ex23.js";import{ei}from"./studio-r6mx7vm5.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{me,te,g}from"./studio-3qr08sxq.js";var y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelActivity",$description:'The Activity feed: one row per operation this session, newest last, drawn from the projection `panels/activity-panel.ts` hands in. A row is a glyph, a head line (what the operation is, who is running it, how long it has taken), the line it is doing now, the plan it declared, the log it captured and — only when the operation handed a callback over — its Cancel. Every conditional the row has is a boolean field on the projected item, because `$switch` over a value is the only conditional a document has and "is this entry cancellable" is a question the panel has already answered. Nothing here reads the activity store: the panel owns what an operation IS, and the surface owns what it looks like.',tagName:"div",attributes:{part:"panel"},style:{$description:"What `.activity-panel`, `.activity-actions`, `.activity-list`, `.activity-row`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-duration`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step-icon`, `.activity-log-toggle` and `.activity-log` said in `styles/panels.css`, keyed on `part`. Two rules were DELETED rather than moved: `.activity-clear` and `.activity-cancel` drew a small bordered button by hand, and `jx-button` is that button — so the sizes, the border, the hover fill and the disabled state are the kit's now. Three token names changed meaning on the way: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and this document is mounted into the Bottom dock's body where that element is not an ancestor — every one of them would silently have taken its px fallback. They are the kit's own scale here (`--jx-text-sm`, `--jx-text-md`, `--jx-radius-xs`), which is the step each of them was. The `.activity-*` rules stay in the stylesheet regardless: `publish/deploy-checklist.ts` still draws the checklist above this feed in that same vocabulary, and it is a lit template until it converts.",display:"flex",flexDirection:"column",gap:"8px",padding:"8px",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="feed"]':{display:"flex",flexDirection:"column",gap:"8px",minWidth:"0"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible in a column of twenty rows without reading any of them. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="row"][data-state="failed"]':{borderLeftColor:"var(--danger)"},'& [part="row"][data-state="cancelled"]':{borderLeftColor:"var(--fg-dim)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] [part="icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] [part="icon"]':{color:"var(--success)"},'& [part="row"][data-state="failed"] [part="icon"]':{color:"var(--danger)"},'& [part="body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"8px",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"], & [part="duration"]':{flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="duration"]':{$description:"Pushed to the far edge so a column of rows reads as a column of times.",marginLeft:"auto"},'& [part="status"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The plan, declared up front, so "which of the three steps is this on" is answered by looking rather than by reading the status line and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="running"]':{color:"var(--fg)"},'& [part="step"][data-state="done"] [part="step-icon"]':{color:"var(--success)"},'& [part="step"][data-state="failed"] [part="step-icon"]':{color:"var(--danger)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="log-toggle"]':{$description:"A plain button rather than a kit one, and the one element here that is not the kit's. The control has to carry `aria-expanded` on the node the reader actually focuses, and a `jx-button` forwards a fixed set of ARIA properties to the control inside its shadow root — an attribute written on the host would name the wrapper and not the button. Its wording is the disclosure's whole state (`docs/studio/interface/problems-and-progress.md` calls it the Show log disclosure), so nothing else has to draw one.",alignSelf:"flex-start",padding:"0",border:"none",background:"none",color:"var(--accent)",font:"inherit",fontSize:"var(--jx-text-sm)",cursor:"pointer",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="log"]':{$description:"The captured output the progress modal used to show once and then lose. It scrolls inside the row rather than growing it, so one 400-line `bun install` failure does not become the whole panel. It is selectable against the root's `user-select: none`, the one part of an activity row that is: the output is what a reader pastes into a bug report, and the row offers no copy action.",userSelect:"text",maxHeight:"180px",margin:"2px 0 0",padding:"6px",overflow:"auto",borderRadius:"var(--jx-radius-xs)",background:"var(--bg)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",whiteSpace:"pre-wrap"},'& [part="cancel"]':{flex:"none"},'& [part="empty"]':{$description:"The teaching empty state, drawn here rather than borrowed from `panels/empty-state.ts`: that helper is a lit template and a document cannot call one. What it says is what is kept — one sentence saying what the region is FOR, then where its content comes from — and this region's fill is an operation somebody else starts, so it offers no button.",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"24px",textAlign:"center",fontSize:"13px",color:"var(--fg-dim)"},'& [part="empty-message"], & [part="empty-detail"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-sm)",opacity:"0.8"}},children:[{tagName:"div",attributes:{part:"feed-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRows"},cases:{true:{tagName:"div",attributes:{part:"feed"},children:[{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFinished"},cases:{true:{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{size:"sm",quiet:!0},attributes:{part:"clear"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearFinished"}}]},children:[{tagName:"span",textContent:"${state.clearLabel}"}]}]}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"row","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSource"},cases:{true:{tagName:"span",attributes:{part:"source"},textContent:"${$map.item.source}"}}},{tagName:"span",attributes:{part:"duration"},textContent:"${$map.item.duration}"}]},{tagName:"div",attributes:{part:"status-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasStatus"},cases:{true:{tagName:"div",attributes:{part:"status"},textContent:"${$map.item.status}"}}},{tagName:"div",attributes:{part:"steps-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSteps"},cases:{true:{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}}},{tagName:"div",attributes:{part:"log-toggle-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasLog"},cases:{true:{tagName:"button",attributes:{part:"log-toggle",type:"button","aria-expanded":"${$map.item.expanded ? 'true' : 'false'}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleLog"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.logLabel}"}}},{tagName:"div",attributes:{part:"log-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/showLog"},cases:{true:{tagName:"pre",attributes:{part:"log"},textContent:"${$map.item.logText}"}}}]},{tagName:"div",attributes:{part:"cancel-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/cancellable"},cases:{true:{tagName:"jx-button",$props:{size:"sm"},attributes:{part:"cancel",title:"Stop this operation"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"Cancel"}]}}}]}}]}]},false:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Long operations show their progress, their log and their Cancel button here."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"Installs, clones, publishes and imports report here while they run."}]}}}]};E("panel-activity",y);var h=null,u=null,d=null,c=null;function N(t,e){t.rows=e.rows,t.hasRows=e.hasRows,t.hasFinished=e.hasFinished,t.clearLabel=e.clearLabel}function C(t){if(h!==t)return!1;return c===null?d!==null:c.root.parentNode===t}function v(t,e){if(C(t))return;f(),h=t;let i=g({cancel:e.cancel,clearFinished:e.clearFinished,clearLabel:"",hasFinished:!1,hasRows:!1,rows:[],toggleLog:e.toggleLog});u=me(),u.run(()=>{te(()=>{N(i,e.project())})});let a=R("panel-activity",i,t);d=a,a.then((l)=>{if(d===a)c=l;else l.dispose()})}function f(){u?.stop(),u=null;let t=d;if(d=null,c)c.dispose(),c=null;else if(t)t.then((e)=>e.dispose());h=null}var as=g([]),T=20,p=new Map,b=0;function j(){return b+=1,`a${b}`}function Hc(t){return t.state!=="running"}function x(){let t=as.filter((e)=>Hc(e)).length-T;while(t>0){let e=as.findIndex((i)=>Hc(i));if(e===-1)return;p.delete(as[e].id),as.splice(e,1),t-=1}}function qs(t){let e={cancellable:t.cancel!==void 0,endedAt:null,expanded:!1,id:j(),log:[],startedAt:ar(),state:"running",status:t.status??"",steps:(t.steps??[]).map((o)=>({label:o,state:"pending"})),title:t.title},i=t.source===void 0?e:{...e,source:t.source};if(t.cancel)p.set(i.id,t.cancel);as.push(i);let a=as.at(-1);x();let l=(o,r)=>{if(Hc(a))return;if(a.state=o,a.endedAt=ar(),r!==void 0)a.status=r;for(let n of a.steps)n.state=n.state==="done"?"done":o==="done"?"done":"failed";a.cancellable=!1,p.delete(a.id),x()};return{done(o){l("done",o)},entry:a,fail(o,r={}){if(Hc(a))return;let n=a.log.join(`
2
- `);l("failed",o);let s={source:a.source??a.title};if(n!=="")s.detail=n;if(r.action!==void 0)s.action=r.action;if(r.actionArgs!==void 0)s.actionArgs=r.actionArgs;if(r.path!==void 0)s.path=r.path;w.error(o,s)},id:a.id,log(o){let r=o.replace(/\s+$/,"");if(r!=="")a.log.push(r)},setStatus(o){if(!Hc(a))a.status=o},step(o){let r=a.steps.findIndex((n)=>n.label===o);if(r===-1)a.steps.push({label:o,state:"pending"}),r=a.steps.length-1;for(let[n,s]of a.steps.entries())s.state=n<r?"done":n===r?"running":s.state;a.status=o}}}function A(t){return as.find((e)=>e.id===t)}function m(){return as.filter((t)=>!Hc(t))}function I(t){let e=A(t),i=p.get(t);if(!e||!i||Hc(e))return!1;return i(),p.delete(t),e.state="cancelled",e.endedAt=ar(),e.cancellable=!1,e.status="Cancelled",!0}function H(){let t=as.filter((i)=>!Hc(i)),e=as.length-t.length;return as.splice(0,as.length,...t),e}function tA(){return m().map((t)=>`activity: ${t.title} — ${t.status||"running"}`)}var F={cancelled:"⊘",done:"✓",failed:"✕",running:"⋯"},P={done:"✓",failed:"✕",pending:"·",running:"⋯"};function V(t,e=ar()){let i=Math.max(0,(t.endedAt??e)-t.startedAt);if(i<1000)return`${i}ms`;let a=Math.round(i/1000);return a<60?`${a}s`:`${Math.floor(a/60)}m ${a%60}s`}function M(t,e){return{icon:P[t.state],key:`${e}:${t.label}`,label:t.label,state:t.state}}function TL(t){let e=t.log.length;return{cancellable:t.cancellable,duration:V(t),expanded:t.expanded,hasLog:e>0,hasSource:(t.source??"")!=="",hasStatus:t.status!=="",hasSteps:t.steps.length>0,icon:F[t.state],id:t.id,logLabel:t.expanded?"Hide log":`Show log (${e} line(s))`,logText:t.log.join(`
3
- `),showLog:t.expanded&&e>0,source:t.source??"",state:t.state,status:t.status,steps:t.steps.map((i,a)=>M(i,a)),title:t.title}}function O(){let t=as.filter((e)=>Hc(e)).length;return{clearLabel:`Clear ${t} finished`,hasFinished:t>0,hasRows:as.length>0,rows:as.map((e)=>TL(e))}}var D={cancel:(t)=>{I(t)},clearFinished:()=>{H()},project:O,toggleLog:(t)=>{let e=A(t);if(e)e.expanded=!e.expanded}};function z(){return Wr`<div data-deploy-checklist></div>
4
- <div data-activity-surface></div>`}function _(t){let e=t.querySelector("[data-activity-surface]");if(!e){f();return}v(e,D)}function nA(){ei({id:"activity",title:"Activity",level:"project",dock:"bottom",icon:"clock-counter-clockwise",rail:!1,badge:()=>m().length>0?m().length:null,render:()=>z(),afterRender:(t,e)=>{cA(e),_(e)}})}var S={$schema:"https://jxsuite.com/schema/v1",$id:"StudioProgressModal",$description:"The one surface in Studio that blocks while it works: the operation's name, a spinner, the line under it, and the two ways out. A `jx-dialog`, so the platform owns modality, the backdrop, focus restoration and Escape — which is what retired the `sp-underlay` this surface used to paint beside itself, and with it the fixed box, the panel, the shadow and the `z-index: 1000` that box needed to climb back out from under its own scrim. The two answers are the dialog's own: confirm is `Run in the background`, which stops the BLOCKING and leaves the work running in Activity, and the secondary answer is Cancel, drawn only when the operation handed one over. It is the secondary rather than the cancel answer for a reason that is behavioural, not cosmetic: the platform raises one `cancel` for Escape, for a light dismissal and for the cancel button alike, and a surface that cannot tell them apart would stop a dependency install on a keystroke. Escape therefore means what confirm means — stop blocking, not stop working — and the answer that stops the work is a button and only a button.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/title"},confirmLabel:"Run in the background",secondaryLabel:{$ref:"#/state/cancelLabel"},cancelLabel:"",size:"sm"},attributes:{part:"progress"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What is left once `jx-dialog` has drawn the dialog. `.progress-modal` is gone rather than moved — it positioned a fixed box, painted its panel, border, radius and shadow, capped its height and then lifted itself above the scrim it rendered beside — and a modal `<dialog>` in the top layer is every one of those. `.progress-title` went the same way: the operation's name is the dialog's headline, which is also its accessible name, so nothing here draws a title.",'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="status"]':{$description:"`anywhere`, because a status line is usually a path or a package spec with no space in it, and one of those would otherwise be the thing that decides how wide the dialog is. `min-width: 0` is what lets it wrap at all: a flex item's automatic minimum is its content, so without this the row refuses to shrink and the text overflows instead.",minWidth:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"row"},children:[{tagName:"jx-spinner",attributes:{part:"busy"},$props:{size:"lg"}},{tagName:"span",attributes:{part:"status","aria-live":"polite"},textContent:"${state.status}"}]}]};E("progress-modal",S);function k(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(Ve,vt("modal","progress")),t.layer.append(e);let i=!1,a=()=>i,l=g({background:()=>{t.onBackground()},cancel:()=>{t.onCancel()},cancelLabel:t.cancellable?"Cancel":"",closed:()=>{t.onClosed()},status:t.status,title:t.title}),o=null,r=R("progress-modal",l,e).then(async(n)=>{let s=n.root;if(a())return n.dispose(),s;if(o=n,await sn(s),a())return s;return Jt(s),s});return{close(){if(i)return;i=!0;let n=o?.root;if(n instanceof HTMLElement)Ut(n);o?.dispose(),o=null,e.remove()},host:e,ready:r,setStatus(n){l.status=n}}}function sl(t){let e=!1,i={title:t.title};if(t.status!==void 0)i.status=t.status;if(t.source!==void 0)i.source=t.source;if(t.cancel!==void 0)i.cancel=t.cancel;let a=qs(i),l=()=>{if(e)return;e=!0,r.close()},o=()=>{l(),uh("activity")},r=k({cancellable:t.cancel!==void 0,layer:dt("modal"),onBackground:o,onCancel:()=>{l(),t.cancel?.()},onClosed:l,status:t.status??"",title:t.title});return{activity:a,done(){a.done(),l()},fail(n){let s=n.trim();if(s===""||s.includes(`
1
+ import{qo}from"./studio-4z0cdh16.js";import{ao,w}from"./studio-bk0anq3b.js";import{Jt,Ut}from"./studio-m3jrjfhy.js";import{sn,dt}from"./studio-cv6gnjqd.js";import{dh}from"./studio-1d8m5s38.js";import{xO}from"./studio-qarg1xf9.js";import{ei}from"./studio-gw83z798.js";import{ze,yt,E,I}from"./studio-1a7zshnv.js";import{me,te,b}from"./studio-9f5vcb4w.js";var m={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelActivity",$description:'The Activity feed: one row per operation this session, newest last, drawn from the projection `panels/activity-panel.ts` hands in. A row is a glyph, a head line (what the operation is, who is running it, how long it has taken), the line it is doing now, the plan it declared, the log it captured and — only when the operation handed a callback over — its Cancel. Every conditional the row has is a boolean field on the projected item, because `$switch` over a value is the only conditional a document has and "is this entry cancellable" is a question the panel has already answered. Nothing here reads the activity store: the panel owns what an operation IS, and the surface owns what it looks like.',tagName:"div",attributes:{part:"panel"},style:{$description:"What `.activity-panel`, `.activity-actions`, `.activity-list`, `.activity-row`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-duration`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step-icon`, `.activity-log-toggle` and `.activity-log` said in `styles/panels.css`, keyed on `part`. Two rules were DELETED rather than moved: `.activity-clear` and `.activity-cancel` drew a small bordered button by hand, and `jx-button` is that button — so the sizes, the border, the hover fill and the disabled state are the kit's now. Three token names changed meaning on the way: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and this document is mounted into the Bottom dock's body where that element is not an ancestor — every one of them would silently have taken its px fallback. They are the kit's own scale here (`--jx-text-sm`, `--jx-text-md`, `--jx-radius-xs`), which is the step each of them was. The `.activity-*` rules stay in the stylesheet regardless: `publish/deploy-checklist.ts` still draws the checklist above this feed in that same vocabulary, and it is a lit template until it converts.",display:"flex",flexDirection:"column",gap:"8px",padding:"8px",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="feed"]':{display:"flex",flexDirection:"column",gap:"8px",minWidth:"0"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible in a column of twenty rows without reading any of them. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="row"][data-state="failed"]':{borderLeftColor:"var(--danger)"},'& [part="row"][data-state="cancelled"]':{borderLeftColor:"var(--fg-dim)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] [part="icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] [part="icon"]':{color:"var(--success)"},'& [part="row"][data-state="failed"] [part="icon"]':{color:"var(--danger)"},'& [part="body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"8px",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"], & [part="duration"]':{flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="duration"]':{$description:"Pushed to the far edge so a column of rows reads as a column of times.",marginLeft:"auto"},'& [part="status"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The plan, declared up front, so "which of the three steps is this on" is answered by looking rather than by reading the status line and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="running"]':{color:"var(--fg)"},'& [part="step"][data-state="done"] [part="step-icon"]':{color:"var(--success)"},'& [part="step"][data-state="failed"] [part="step-icon"]':{color:"var(--danger)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="log-toggle"]':{$description:"A plain button rather than a kit one, and the one element here that is not the kit's. The control has to carry `aria-expanded` on the node the reader actually focuses, and a `jx-button` forwards a fixed set of ARIA properties to the control inside its shadow root — an attribute written on the host would name the wrapper and not the button. Its wording is the disclosure's whole state (`docs/studio/interface/problems-and-progress.md` calls it the Show log disclosure), so nothing else has to draw one.",alignSelf:"flex-start",padding:"0",border:"none",background:"none",color:"var(--accent)",font:"inherit",fontSize:"var(--jx-text-sm)",cursor:"pointer",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="log"]':{$description:"The captured output the progress modal used to show once and then lose. It scrolls inside the row rather than growing it, so one 400-line `bun install` failure does not become the whole panel. It is selectable against the root's `user-select: none`, the one part of an activity row that is: the output is what a reader pastes into a bug report, and the row offers no copy action.",userSelect:"text",maxHeight:"180px",margin:"2px 0 0",padding:"6px",overflow:"auto",borderRadius:"var(--jx-radius-xs)",background:"var(--bg)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",whiteSpace:"pre-wrap"},'& [part="cancel"]':{flex:"none"},'& [part="empty"]':{$description:"The teaching empty state, drawn here rather than borrowed from `panels/empty-state.ts`: that helper is a lit template and a document cannot call one. What it says is what is kept — one sentence saying what the region is FOR, then where its content comes from — and this region's fill is an operation somebody else starts, so it offers no button.",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"24px",textAlign:"center",fontSize:"13px",color:"var(--fg-dim)"},'& [part="empty-message"], & [part="empty-detail"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-sm)",opacity:"0.8"}},children:[{tagName:"div",attributes:{part:"feed-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRows"},cases:{true:{tagName:"div",attributes:{part:"feed"},children:[{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFinished"},cases:{true:{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{size:"sm",quiet:!0},attributes:{part:"clear"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearFinished"}}]},children:[{tagName:"span",textContent:"${state.clearLabel}"}]}]}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"row","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSource"},cases:{true:{tagName:"span",attributes:{part:"source"},textContent:"${$map.item.source}"}}},{tagName:"span",attributes:{part:"duration"},textContent:"${$map.item.duration}"}]},{tagName:"div",attributes:{part:"status-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasStatus"},cases:{true:{tagName:"div",attributes:{part:"status"},textContent:"${$map.item.status}"}}},{tagName:"div",attributes:{part:"steps-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSteps"},cases:{true:{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}}},{tagName:"div",attributes:{part:"log-toggle-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasLog"},cases:{true:{tagName:"button",attributes:{part:"log-toggle",type:"button","aria-expanded":"${$map.item.expanded ? 'true' : 'false'}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleLog"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.logLabel}"}}},{tagName:"div",attributes:{part:"log-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/showLog"},cases:{true:{tagName:"pre",attributes:{part:"log"},textContent:"${$map.item.logText}"}}}]},{tagName:"div",attributes:{part:"cancel-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/cancellable"},cases:{true:{tagName:"jx-button",$props:{size:"sm"},attributes:{part:"cancel",title:"Stop this operation"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"Cancel"}]}}}]}}]}]},false:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Long operations show their progress, their log and their Cancel button here."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"Installs, clones, publishes and imports report here while they run."}]}}}]};E("panel-activity",m);var h=null,u=null,d=null,c=null;function N(t,e){t.rows=e.rows,t.hasRows=e.hasRows,t.hasFinished=e.hasFinished,t.clearLabel=e.clearLabel}function C(t){if(h!==t)return!1;return c===null?d!==null:c.root.parentNode===t}function y(t,e){if(C(t))return;g(),h=t;let i=b({cancel:e.cancel,clearFinished:e.clearFinished,clearLabel:"",hasFinished:!1,hasRows:!1,rows:[],toggleLog:e.toggleLog});u=me(),u.run(()=>{te(()=>{N(i,e.project())})});let a=I("panel-activity",i,t);d=a,a.then((l)=>{if(d===a)c=l;else l.dispose()})}function g(){u?.stop(),u=null;let t=d;if(d=null,c)c.dispose(),c=null;else if(t)t.then((e)=>e.dispose());h=null}var ls=b([]),T=20,p=new Map,v=0;function j(){return v+=1,`a${v}`}function Hc(t){return t.state!=="running"}function x(){let t=ls.filter((e)=>Hc(e)).length-T;while(t>0){let e=ls.findIndex((i)=>Hc(i));if(e===-1)return;p.delete(ls[e].id),ls.splice(e,1),t-=1}}function Js(t){let e={cancellable:t.cancel!==void 0,endedAt:null,expanded:!1,id:j(),log:[],startedAt:ao(),state:"running",status:t.status??"",steps:(t.steps??[]).map((o)=>({label:o,state:"pending"})),title:t.title},i=t.source===void 0?e:{...e,source:t.source};if(t.cancel)p.set(i.id,t.cancel);ls.push(i);let a=ls.at(-1);x();let l=(o,r)=>{if(Hc(a))return;if(a.state=o,a.endedAt=ao(),r!==void 0)a.status=r;for(let n of a.steps)n.state=n.state==="done"?"done":o==="done"?"done":"failed";a.cancellable=!1,p.delete(a.id),x()};return{done(o){l("done",o)},entry:a,fail(o,r={}){if(Hc(a))return;let n=a.log.join(`
2
+ `);l("failed",o);let s={source:a.source??a.title};if(n!=="")s.detail=n;if(r.action!==void 0)s.action=r.action;if(r.actionArgs!==void 0)s.actionArgs=r.actionArgs;if(r.path!==void 0)s.path=r.path;w.error(o,s)},id:a.id,log(o){let r=o.replace(/\s+$/,"");if(r!=="")a.log.push(r)},setStatus(o){if(!Hc(a))a.status=o},step(o){let r=a.steps.findIndex((n)=>n.label===o);if(r===-1)a.steps.push({label:o,state:"pending"}),r=a.steps.length-1;for(let[n,s]of a.steps.entries())s.state=n<r?"done":n===r?"running":s.state;a.status=o}}}function A(t){return ls.find((e)=>e.id===t)}function f(){return ls.filter((t)=>!Hc(t))}function H(t){let e=A(t),i=p.get(t);if(!e||!i||Hc(e))return!1;return i(),p.delete(t),e.state="cancelled",e.endedAt=ao(),e.cancellable=!1,e.status="Cancelled",!0}function R(){let t=ls.filter((i)=>!Hc(i)),e=ls.length-t.length;return ls.splice(0,ls.length,...t),e}function pO(){return f().map((t)=>`activity: ${t.title} — ${t.status||"running"}`)}var F={cancelled:"⊘",done:"✓",failed:"✕",running:"⋯"},P={done:"✓",failed:"✕",pending:"·",running:"⋯"};function V(t,e=ao()){let i=Math.max(0,(t.endedAt??e)-t.startedAt);if(i<1000)return`${i}ms`;let a=Math.round(i/1000);return a<60?`${a}s`:`${Math.floor(a/60)}m ${a%60}s`}function M(t,e){return{icon:P[t.state],key:`${e}:${t.label}`,label:t.label,state:t.state}}function M$(t){let e=t.log.length;return{cancellable:t.cancellable,duration:V(t),expanded:t.expanded,hasLog:e>0,hasSource:(t.source??"")!=="",hasStatus:t.status!=="",hasSteps:t.steps.length>0,icon:F[t.state],id:t.id,logLabel:t.expanded?"Hide log":`Show log (${e} line(s))`,logText:t.log.join(`
3
+ `),showLog:t.expanded&&e>0,source:t.source??"",state:t.state,status:t.status,steps:t.steps.map((i,a)=>M(i,a)),title:t.title}}function O(){let t=ls.filter((e)=>Hc(e)).length;return{clearLabel:`Clear ${t} finished`,hasFinished:t>0,hasRows:ls.length>0,rows:ls.map((e)=>M$(e))}}var D={cancel:(t)=>{H(t)},clearFinished:()=>{R()},project:O,toggleLog:(t)=>{let e=A(t);if(e)e.expanded=!e.expanded}};function z(){return qo`<div data-deploy-checklist></div>
4
+ <div data-activity-surface></div>`}function _(t){let e=t.querySelector("[data-activity-surface]");if(!e){g();return}y(e,D)}function fO(){ei({id:"activity",title:"Activity",level:"project",dock:"bottom",icon:"clock-counter-clockwise",rail:!1,badge:()=>f().length>0?f().length:null,render:()=>z(),afterRender:(t,e)=>{xO(e),_(e)}})}var S={$schema:"https://jxsuite.com/schema/v1",$id:"StudioProgressModal",$description:"The one surface in Studio that blocks while it works: the operation's name, a spinner, the line under it, and the two ways out. A `jx-dialog`, so the platform owns modality, the backdrop, focus restoration and Escape — which is what retired the `sp-underlay` this surface used to paint beside itself, and with it the fixed box, the panel, the shadow and the `z-index: 1000` that box needed to climb back out from under its own scrim. The two answers are the dialog's own: confirm is `Run in the background`, which stops the BLOCKING and leaves the work running in Activity, and the secondary answer is Cancel, drawn only when the operation handed one over. It is the secondary rather than the cancel answer for a reason that is behavioural, not cosmetic: the platform raises one `cancel` for Escape, for a light dismissal and for the cancel button alike, and a surface that cannot tell them apart would stop a dependency install on a keystroke. Escape therefore means what confirm means — stop blocking, not stop working — and the answer that stops the work is a button and only a button.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/title"},confirmLabel:"Run in the background",secondaryLabel:{$ref:"#/state/cancelLabel"},cancelLabel:"",size:"sm"},attributes:{part:"progress"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What is left once `jx-dialog` has drawn the dialog. `.progress-modal` is gone rather than moved — it positioned a fixed box, painted its panel, border, radius and shadow, capped its height and then lifted itself above the scrim it rendered beside — and a modal `<dialog>` in the top layer is every one of those. `.progress-title` went the same way: the operation's name is the dialog's headline, which is also its accessible name, so nothing here draws a title.",'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="status"]':{$description:"`anywhere`, because a status line is usually a path or a package spec with no space in it, and one of those would otherwise be the thing that decides how wide the dialog is. `min-width: 0` is what lets it wrap at all: a flex item's automatic minimum is its content, so without this the row refuses to shrink and the text overflows instead.",minWidth:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"row"},children:[{tagName:"jx-spinner",attributes:{part:"busy"},$props:{size:"lg"}},{tagName:"span",attributes:{part:"status","aria-live":"polite"},textContent:"${state.status}"}]}]};E("progress-modal",S);function k(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(ze,yt("modal","progress")),t.layer.append(e);let i=!1,a=()=>i,l=b({background:()=>{t.onBackground()},cancel:()=>{t.onCancel()},cancelLabel:t.cancellable?"Cancel":"",closed:()=>{t.onClosed()},status:t.status,title:t.title}),o=null,r=I("progress-modal",l,e).then(async(n)=>{let s=n.root;if(a())return n.dispose(),s;if(o=n,await sn(s),a())return s;return Jt(s),s});return{close(){if(i)return;i=!0;let n=o?.root;if(n instanceof HTMLElement)Ut(n);o?.dispose(),o=null,e.remove()},host:e,ready:r,setStatus(n){l.status=n}}}function al(t){let e=!1,i={title:t.title};if(t.status!==void 0)i.status=t.status;if(t.source!==void 0)i.source=t.source;if(t.cancel!==void 0)i.cancel=t.cancel;let a=Js(i),l=()=>{if(e)return;e=!0,r.close()},o=()=>{l(),dh("activity")},r=k({cancellable:t.cancel!==void 0,layer:dt("modal"),onBackground:o,onCancel:()=>{l(),t.cancel?.()},onClosed:l,status:t.status??"",title:t.title});return{activity:a,done(){a.done(),l()},fail(n){let s=n.trim();if(s===""||s.includes(`
5
5
  `))a.log(s),a.fail(`${t.title} failed`);else a.fail(s);l()},log(n){a.log(n)},setStatus(n){if(a.setStatus(n),!e)r.setStatus(n)}}}
6
- export{as,Hc,qs,tA,TL,nA,sl};
6
+ export{ls,Hc,Js,pO,M$,fO,al};
7
7
 
8
- //# debugId=41564AC7C963952B64756E2164756E21
9
- //# sourceMappingURL=studio-v7a7yb5w.js.map
8
+ //# debugId=E1D6A454E7555F2A64756E2164756E21
9
+ //# sourceMappingURL=studio-thgexj3w.js.map
@@ -1,5 +1,5 @@
1
- var s=new Set(["project.schema.json","document.schema.json"]);function iR(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function v2(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function y2(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
2
- export{iR,v2,y2};
1
+ var s=new Set(["project.schema.json","document.schema.json"]);function pI(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function IM(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function NM(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
2
+ export{pI,IM,NM};
3
3
 
4
- //# debugId=9404E8EB25D80EE864756E2164756E21
5
- //# sourceMappingURL=studio-vpevkfxw.js.map
4
+ //# debugId=4130EE0D8A36BEA364756E2164756E21
5
+ //# sourceMappingURL=studio-veh91hjv.js.map
@@ -0,0 +1,6 @@
1
+ import{w_,pf,ff,mf,x_,dg,su,Wy,bf,XR,Lh,hg,uM,sa}from"./studio-m3jrjfhy.js";import{p}from"./studio-xh6rf05g.js";import{mh,zp}from"./studio-48yzqzqr.js";import{Ty}from"./studio-s49y6m5b.js";import{jt,fn}from"./studio-ex1644g2.js";import{De}from"./studio-43pynnhz.js";import{_x}from"./studio-aaw7wxv8.js";import{Bo}from"./studio-ek4fb4eb.js";import{ph,my,oc,gy,by,fh}from"./studio-w4mfaaam.js";import{x}from"./studio-zn7ysyzb.js";import{n,Q,S,m,cd}from"./studio-erjccagy.js";function R(e,t){return new URL(`/node_modules/${e}`,t).href}function b(e){if(e===void 0)return!1;if(n(e))return!e.includes("${");if(Array.isArray(e))return e.every((t)=>b(t));if(m(e))return!("$ref"in e)&&!("$prototype"in e)&&!("$expression"in e)&&Object.values(e).every((t)=>b(t));return!0}function b0(e){let t=new Map;for(let[s,r]of Object.entries(e.state??{})){if(cd(s)||!m(r)||!Array.isArray(r.examples))continue;let[o]=r.examples;if(b(o))t.set(s,o)}return t}var T={body:"body",root:":root"};function P(e,t,s,r,o=T){let l=[],a=(i,c)=>{let y={mediaQueries:t,scope:c,transposeValue:s};if(r)y.resolveValue=(d,v)=>r(d,v,c);for(let d of dg(i,y))l.push(d.text)},h={},g={},w=[],C=[];for(let[i,c]of Object.entries(e)){if(S(c)&&!Array.isArray(c)){if(i.startsWith("@"))w.push([i,c]);else if(!i.startsWith("--"))C.push([i,c]);continue}if(x_(i)||i.startsWith("@"))continue;if(i.startsWith("--")||i==="colorScheme"||i==="color-scheme")h[i]=c;else g[i]=c}a(h,o.root),a(g,o.body);for(let[i,c]of C)if(i.startsWith("&"))a({[i]:c},o.root);else a(c,i);for(let[i,c]of w){if(w_(i)||pf(i)){a({[i]:c},null);continue}let y={},d={},v=[];for(let[u,f]of Object.entries(c)){if(S(f)&&!Array.isArray(f)){if(!u.startsWith("@"))v.push([u,f]);continue}if(u.startsWith("--"))y[u]=f;else d[u]=f}a({[i]:y},o.root),a({[i]:d},o.body);for(let[u,f]of v)a({[i]:f},u)}if(Object.values(t).some((i)=>mf(i)!==null)&&!("colorScheme"in e))l.push(`${o.root} { color-scheme: light dark }`,`${o.root}:where([${ff}="light"]) { color-scheme: light }`,`${o.root}:where([${ff}="dark"]) { color-scheme: dark }`);return l.join(`
2
+ `)}var A={body:":host",root:":host"},J=new WeakMap,j=new WeakMap;function D(e){let t=e.replaceAll(/:root\b/g,":host").replaceAll(/(^|[\s,>+~(])(?:html|body)(?![\w-])/g,"$1:host").replaceAll(/:host(?:\s*>?\s*:host)+/g,":host");return t===e?null:t}function E(e){for(let t=0;t<e.cssRules.length;t+=1){let s=e.cssRules[t],r=s instanceof CSSStyleRule?D(s.selectorText):null;if(s instanceof CSSStyleRule&&r!==null){let l=`${r}${s.cssText.slice(s.cssText.indexOf("{"))}`;try{e.insertRule(l,t),e.deleteRule(t+1)}catch{}}let o=e.cssRules[t];if(o instanceof CSSGroupingRule)E(o)}}function M(e){let t=[];for(let s of e??[]){if(!S(s)||String(s.tagName).toLowerCase()!=="link")continue;let{href:r,rel:o}=s.attributes??{};if(n(r)&&r!==""&&n(o)&&o.split(/\s+/).includes("stylesheet"))t.push(r)}return t}async function L(e){let t=by(e,"project.json");try{let s=await fetch(t);if(!s.ok)return null;let r=new URL(t,location.href).href,o=new CSSStyleSheet({baseURL:r});return o.replaceSync(await s.text()),E(o),o}catch{return null}}async function H(e){let s=(await Promise.all(M(e.$head).map((o)=>L(o)))).filter((o)=>o!==null),{style:r}=e;if(S(r)){let o=new CSSStyleSheet;o.replaceSync(P(r,e.$media??{},(l)=>l,void 0,A)),s.push(o)}return s}function O(){let e=x?.projectConfig;if(!e||!Q(globalThis.CSSStyleSheet))return Promise.resolve([]);let t=J.get(e);if(!t)t=H(e).then((s)=>(j.set(e,s),s)),J.set(e,t);return t}function fD(){let e=x?.projectConfig;return(e&&j.get(e))??[]}var N=150;function kw(e=N){let t=new Map;function s(){for(let[r,o]of t){if(t.size<=e)break;t.delete(r),o.remove()}}return{clear(){for(let r of t.values())r.remove();t.clear()},get(r){let o=t.get(r);if(o!==void 0)t.delete(r),t.set(r,o);return o},has:(r)=>t.has(r),keys:()=>[...t.keys()],set(r,o){t.delete(r),t.set(r,o),s()},size:()=>t.size}}function k(e){let t=oc(x?.projectRoot);return URL.canParse(t)?new URL(e,t).href:location.href}async function F(e){try{let t=await p().readFile(e);su(!0);let s=gy(e,fh());await jt();let r;if(fn(e))r=(await Bo(e,t)).document;else r=JSON.parse(t);return await W(r,e,s)}catch{return null}}async function W(e,t,s){su(!0),Wy(my());let r=await Lh(e,{},k(t)),o=s&&{...s,revisions:zp(),versions:mh()};XR((l)=>Ty(l,o));try{let l=sa(e,r);return l instanceof HTMLElement?l:null}finally{XR(null)}}async function V(e,t){let s=await lT(t);if(!s)return null;let r=b0(s);return await y0(s,t,r)?_x(e,r):null}async function lT(e){try{let t=JSON.parse(await p().readFile(e));return S(t)&&!Array.isArray(t)?t:null}catch{return null}}async function y0(e,t,s){let r=null;try{su(!0),Wy(my());let o=await Lh(e,{},k(t));for(let[h,g]of s)o[h]=g;let l=!1;hg(()=>{l=!0});let{stop:a}=bf(()=>sa({...e,tagName:"div"},o));return r=a,!l}catch{return!1}finally{hg(null),r?.()}}function _(e){return e.source!=="npm"&&(e.path?.endsWith(".json")??!1)}async function Ew(e,t){let s=t.get(e);if(s)return s;let r;try{uM((l)=>R(l,`${ph()}/`)),await O();let o=De.find((l)=>l.path===e);if(o&&_(o))r=await V(o,e);else r=o?await _x(o):await F(e)}catch{return}if(!r)return;return t.set(e,r),r}function xp(e){if(!Q(globalThis.IntersectionObserver))return{destroy(){},observe:(r)=>e(r),releaseDetached:()=>0};let t=new Set,s=new IntersectionObserver((r)=>{for(let o of r)if(o.isIntersecting)t.delete(o.target),s.unobserve(o.target),e(o.target)},{rootMargin:"200px"});return{destroy(){s.disconnect(),t.clear()},observe(r){if(t.has(r))return;t.add(r),s.observe(r)},releaseDetached(){let r=0;for(let o of t)if(!o.isConnected)t.delete(o),s.unobserve(o),r+=1;return r}}}
3
+ export{b0,fD,kw,lT,y0,Ew,xp};
4
+
5
+ //# debugId=D9CD7D01FDC77CBF64756E2164756E21
6
+ //# sourceMappingURL=studio-vswmz40d.js.map
@@ -1,5 +1,5 @@
1
- import{WI}from"./studio-nzemfbkk.js";import{Xs,av}from"./studio-tpxcryf2.js";import{E,R}from"./studio-9dq7rwc7.js";import{Me}from"./studio-0gvvqj3h.js";import{g}from"./studio-3qr08sxq.js";var x={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};E("menu",x);var j="block-end span-inline-end";function P(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?j:""}function N(e){if(!e)return{x:0,y:0};let n=Me(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function b(e,n=0){let r=n===0?(e.children??[]).map((t)=>b(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function S(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((a)=>a.id===n);if(t)return t}return}function zt(e){let n=Xs("popover",e.region),r=new AbortController,t=null,a=null,s=!1,h=()=>{if(s)return;s=!0,r.abort(),a?.(),a=null,av("popover",e.region),q(e.opener??null),e.onClosed?.(f)},v=e.place?e.place(new DOMRect):e.origin??N(e.opener),c=g({floor:e.floor?.()??0,label:e.label,placement:P(e),rows:e.rows.map((o)=>b(o)),select:(o,u)=>{let i=String(u.detail),d=S(c.rows,i);if(!d)return;if(k(t,e.opener??null),d.run)d.run();else e.run?.(i);f.close()},x:v.x,y:v.y}),w=()=>{if(s||!t||!e.place)return;let o=e.place(Me(t));c.x=o.x,c.y=o.y},p=()=>r.signal.aborted,M=(async()=>{let o=await R("menu",c,n,{signal:r.signal});if(p())return;if({dispose:a}=o,t=o.root,t.addEventListener("toggle",(i)=>{if(i.newState==="closed")h()}),!t.hasAttribute("popover"))await new Promise((i)=>{t.addEventListener("jx-ready",()=>i(),{once:!0})});if(p())return;if(await C(r.signal),p())return;let u=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(u?{source:u}:void 0),w(),requestAnimationFrame(w)})(),f={close:()=>{if(s)return;if(t?.open)t.hidePopover();h()},host:n,ready:M,setRows:(o)=>{if(s)return;let i=document.activeElement?.closest("jx-menu"),d=i&&i!==t?i.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;c.rows=o.map((m)=>b(m)),setTimeout(()=>{if(s||!t||t.contains(document.activeElement))return;let m=d?t.querySelector(`jx-menu-item[data-command-id="${d}"]`):null,y=m?.querySelector("jx-menu")??null;if(m&&!(y?.open&&y.querySelector("jx-menu-item")))m.focus();else WI(t)},0)}};return f}var l=new Set;if(typeof window<"u")window.addEventListener("pointerdown",(e)=>l.add(e.pointerId),!0),window.addEventListener("pointerup",(e)=>l.delete(e.pointerId),!0),window.addEventListener("pointercancel",(e)=>l.delete(e.pointerId),!0),window.addEventListener("blur",()=>l.clear());function C(e){if(l.size===0||e.aborted)return Promise.resolve();return new Promise((n)=>{let r=new AbortController,t=()=>{if(l.size===0||e.aborted)r.abort(),n()},a={capture:!0,signal:r.signal};window.addEventListener("pointerup",t,a),window.addEventListener("pointercancel",t,a),window.addEventListener("blur",t,{signal:r.signal}),e.addEventListener("abort",t,{signal:r.signal})})}function k(e,n){if(e?.contains(document.activeElement)&&n?.isConnected&&n!==document.body)n.focus({preventScroll:!0})}function q(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
- export{zt};
1
+ import{QR}from"./studio-m3jrjfhy.js";import{ta,hy}from"./studio-cv6gnjqd.js";import{E,I}from"./studio-1a7zshnv.js";import{Me}from"./studio-bmwgj8ez.js";import{b}from"./studio-9f5vcb4w.js";var x={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};E("menu",x);var j="block-end span-inline-end";function P(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?j:""}function N(e){if(!e)return{x:0,y:0};let n=Me(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function h(e,n=0){let r=n===0?(e.children??[]).map((t)=>h(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function S(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((a)=>a.id===n);if(t)return t}return}function Vt(e){let n=ta("popover",e.region),r=new AbortController,t=null,a=null,s=!1,v=()=>{if(s)return;s=!0,r.abort(),a?.(),a=null,hy("popover",e.region),k(e.opener??null),e.onClosed?.(f)},w=e.place?e.place(new DOMRect):e.origin??N(e.opener),c=b({floor:e.floor?.()??0,label:e.label,placement:P(e),rows:e.rows.map((o)=>h(o)),select:(o,u)=>{let i=String(u.detail),d=S(c.rows,i);if(!d)return;if(R(t,e.opener??null),d.run)d.run();else e.run?.(i);f.close()},x:w.x,y:w.y}),g=()=>{if(s||!t||!e.place)return;let o=e.place(Me(t));c.x=o.x,c.y=o.y},p=()=>r.signal.aborted,M=(async()=>{let o=await I("menu",c,n,{signal:r.signal});if(p())return;if({dispose:a}=o,t=o.root,t.addEventListener("toggle",(i)=>{if(i.newState==="closed")v()}),!t.hasAttribute("popover"))await new Promise((i)=>{t.addEventListener("jx-ready",()=>i(),{once:!0})});if(p())return;if(await C(r.signal),p())return;let u=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(u?{source:u}:void 0),g(),requestAnimationFrame(g)})(),f={close:()=>{if(s)return;if(t?.open)t.hidePopover();v()},host:n,ready:M,setRows:(o)=>{if(s)return;let i=document.activeElement?.closest("jx-menu"),d=i&&i!==t?i.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;c.rows=o.map((m)=>h(m)),setTimeout(()=>{if(s||!t||t.contains(document.activeElement))return;let m=d?t.querySelector(`jx-menu-item[data-command-id="${d}"]`):null,y=m?.querySelector("jx-menu")??null;if(m&&!(y?.open&&y.querySelector("jx-menu-item")))m.focus();else QR(t)},0)}};return f}var l=new Set;if(typeof window<"u")window.addEventListener("pointerdown",(e)=>l.add(e.pointerId),!0),window.addEventListener("pointerup",(e)=>l.delete(e.pointerId),!0),window.addEventListener("pointercancel",(e)=>l.delete(e.pointerId),!0),window.addEventListener("blur",()=>l.clear());function C(e){if(l.size===0||e.aborted)return Promise.resolve();return new Promise((n)=>{let r=new AbortController,t=()=>{if(l.size===0||e.aborted)r.abort(),n()},a={capture:!0,signal:r.signal};window.addEventListener("pointerup",t,a),window.addEventListener("pointercancel",t,a),window.addEventListener("blur",t,{signal:r.signal}),e.addEventListener("abort",t,{signal:r.signal})})}function R(e,n){if(e?.contains(document.activeElement)&&n?.isConnected&&n!==document.body)n.focus({preventScroll:!0})}function k(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
2
+ export{Vt};
3
3
 
4
- //# debugId=B72746DFA893FF8864756E2164756E21
5
- //# sourceMappingURL=studio-daksw8kh.js.map
4
+ //# debugId=B829A782189EE9D864756E2164756E21
5
+ //# sourceMappingURL=studio-w3aafbpk.js.map
@@ -0,0 +1,5 @@
1
+ import{yM,vM}from"./studio-zav9hgb3.js";import{p,ve}from"./studio-xh6rf05g.js";import{mh,eP,zp}from"./studio-48yzqzqr.js";import{ln,Ey,Ty,h}from"./studio-s49y6m5b.js";import{x}from"./studio-zn7ysyzb.js";function ph(){let t=ve()?p().canvasUrl:void 0;if(t)return new URL(t,location.href).origin;return location.origin}function my(){let t=ve()?p().canvasUrl:void 0;if(!t)return null;let e=new URL(t,location.href);return e.origin===location.origin?e.searchParams.get("rpcToken"):null}function oc(t){let e=ph(),n=ve()?p().documentBaseUrl:void 0;if(n){let o=n.endsWith("/")?n:`${n}/`;return new URL(o,`${e}/`).href}let r=t||"";return`${e}/${r?`${r}/`:""}`}function r1(t){if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http")||t.startsWith("views://"))return t;let e=ph();if((e.startsWith("http:")||e.startsWith("https:"))&&e!==location.origin)return`${e}/${t.replace(/^\.?\//,"")}`;return t}function mR(){return ln(x?.projectConfig??{}).i18n?.locales??[]}function gy(t,e){let n=e?.space??"site",r=Ey(t,x?.projectConfig?.content,mR());if(n==="site"&&!r&&!eP())return null;let o={documentDir:vM(t??""),lanes:yM,mounts:r?[r]:[],space:n};if(e?.fileBaseUrl!==void 0)o.fileBaseUrl=e.fileBaseUrl;return o}function Xc(t){return by(t,h.value?.documentPath)}function by(t,e){if(!t)return t;let n=gy(e,fh()),r=n&&{...n,revisions:zp(),versions:mh()};return r1(Ty(t,r)??t)}function fh(){let t={fileBaseUrl:oc(x?.projectRoot)};if(ve())t.space=p().assetSpace;return t}
2
+ export{ph,my,oc,r1,mR,gy,Xc,by,fh};
3
+
4
+ //# debugId=DC850CCD352EB61864756E2164756E21
5
+ //# sourceMappingURL=studio-w4mfaaam.js.map
@@ -1,5 +1,5 @@
1
- import{p,ye}from"./studio-4fnb5648.js";import{X}from"./studio-9c6cbq2c.js";import{Q}from"./studio-k3we3kqb.js";function ph(){return ye()&&Q(p().findReferences)}function u(e){return`${e.path??""}\x00${e.tagName??""}`}var i=new Map,o=new Map;function qd(e){if(!ph())return{status:"unsupported"};return i.get(u(e))??(o.has(u(e))?{status:"pending"}:null)}async function La(e){if(!ph())return{status:"unsupported"};if(!e.path&&!e.tagName)return{status:"failed",message:"no target to look for"};let t=u(e),s=i.get(t);if(s)return s;let r=o.get(t);if(r)return r;let n={};if(e.path!==void 0)n.path=e.path;if(e.tagName!==void 0)n.tagName=e.tagName;let a=(async()=>{try{return{result:await p().findReferences(n),status:"ready"}}catch(c){return{message:X(c),status:"failed"}}})();o.set(t,a);let d=f,l=await a;if(o.get(t)===a)o.delete(t);if(d!==f)return l;return i.set(t,l),l}function nI(e){return i.delete(u(e)),La(e)}var f=0,g=new Set;function us(){f+=1,i.clear(),o.clear();for(let e of g)e()}function iI(e){return g.add(e),()=>{g.delete(e)}}function h(e){let t=0;for(let s of e.files)if(s.path.startsWith("pages/"))t+=1;return{others:e.files.length-t,pages:t}}function lv(e){let{others:t,pages:s}=h(e);if(s===0&&t===0)return"Not used yet";let r=t===1?"file":"files";if(s===0)return`Used in ${t} ${r}`;let n=`Used on ${s} page${s===1?"":"s"}`;return t===0?n:`${n} and ${t} other ${r}`}function oI(e,t){if(e.status==="unsupported")return null;if(e.status==="pending")return"Counting references…";if(e.status==="failed")return`References could not be counted (${e.message}) — this may break more than it appears to.`;let{files:s,refsTotal:r}=e.result;if(s.length===0)return t==="delete"?"Nothing else in this project refers to it.":"Nothing else in this project refers to it, so nothing needs updating.";let n=`${r} reference${r===1?"":"s"} in ${s.length} file${s.length===1?"":"s"}`,a=e.result.errors.length>0?" (at least — some documents could not be read)":"";if(t==="delete")return`${n}${a} will break. Those files stay on disk; the references in them stop resolving.`;if(t==="convert")return`${n}${a} will be updated automatically to point at the new file.`;return`${n}${a} will be updated automatically. Nothing else changes.`}function cv(e){return e.files.toSorted((t,s)=>s.count-t.count||t.path.localeCompare(s.path))}
2
- export{ph,qd,La,nI,us,iI,lv,oI,cv};
1
+ import{p,ve}from"./studio-xh6rf05g.js";import{X}from"./studio-9c6cbq2c.js";import{Q}from"./studio-erjccagy.js";function hh(){return ve()&&Q(p().findReferences)}function u(e){return`${e.path??""}\x00${e.tagName??""}`}var i=new Map,o=new Map;function qd(e){if(!hh())return{status:"unsupported"};return i.get(u(e))??(o.has(u(e))?{status:"pending"}:null)}async function Ra(e){if(!hh())return{status:"unsupported"};if(!e.path&&!e.tagName)return{status:"failed",message:"no target to look for"};let t=u(e),s=i.get(t);if(s)return s;let r=o.get(t);if(r)return r;let n={};if(e.path!==void 0)n.path=e.path;if(e.tagName!==void 0)n.tagName=e.tagName;let a=(async()=>{try{return{result:await p().findReferences(n),status:"ready"}}catch(c){return{message:X(c),status:"failed"}}})();o.set(t,a);let d=f,l=await a;if(o.get(t)===a)o.delete(t);if(d!==f)return l;return i.set(t,l),l}function hR(e){return i.delete(u(e)),Ra(e)}var f=0,g=new Set;function hs(){f+=1,i.clear(),o.clear();for(let e of g)e()}function pR(e){return g.add(e),()=>{g.delete(e)}}function h(e){let t=0;for(let s of e.files)if(s.path.startsWith("pages/"))t+=1;return{others:e.files.length-t,pages:t}}function py(e){let{others:t,pages:s}=h(e);if(s===0&&t===0)return"Not used yet";let r=t===1?"file":"files";if(s===0)return`Used in ${t} ${r}`;let n=`Used on ${s} page${s===1?"":"s"}`;return t===0?n:`${n} and ${t} other ${r}`}function fR(e,t){if(e.status==="unsupported")return null;if(e.status==="pending")return"Counting references…";if(e.status==="failed")return`References could not be counted (${e.message}) — this may break more than it appears to.`;let{files:s,refsTotal:r}=e.result;if(s.length===0)return t==="delete"?"Nothing else in this project refers to it.":"Nothing else in this project refers to it, so nothing needs updating.";let n=`${r} reference${r===1?"":"s"} in ${s.length} file${s.length===1?"":"s"}`,a=e.result.errors.length>0?" (at least — some documents could not be read)":"";if(t==="delete")return`${n}${a} will break. Those files stay on disk; the references in them stop resolving.`;if(t==="convert")return`${n}${a} will be updated automatically to point at the new file.`;return`${n}${a} will be updated automatically. Nothing else changes.`}function fy(e){return e.files.toSorted((t,s)=>s.count-t.count||t.path.localeCompare(s.path))}
2
+ export{hh,qd,Ra,hR,hs,pR,py,fR,fy};
3
3
 
4
- //# debugId=CFBB8E3997E1C26E64756E2164756E21
5
- //# sourceMappingURL=studio-4zd6an2b.js.map
4
+ //# debugId=3520BDE144DF39FE64756E2164756E21
5
+ //# sourceMappingURL=studio-wn2cmf9q.js.map
@@ -0,0 +1,5 @@
1
+ import{jt,Wi,fn,lo,Ma}from"./studio-ex1644g2.js";import{w}from"./studio-bk0anq3b.js";import{jn,Qc,St,Hi,Se,Tr,Fe,Gd,h}from"./studio-s49y6m5b.js";import{Lr}from"./studio-zav9hgb3.js";import{X}from"./studio-9c6cbq2c.js";import{xm}from"./studio-nngc45ct.js";import{us,ly,La}from"./studio-td3h1644.js";import{ks,eO,e$}from"./studio-15mfah02.js";import{Cr}from"./studio-1d8m5s38.js";import{wo,ih}from"./studio-aaw7wxv8.js";import{Lw,$b}from"./studio-bpzwhn88.js";import{Ib}from"./studio-pte5w7rf.js";import{ql}from"./studio-ph17an19.js";import{qs,sl,GT}from"./studio-6mf31e16.js";import{m}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";var kb=["page","collection","template","component","media","entry"],Tw={collection:{cta:"Create collection",hint:"Posts, products, team… with a page each",icon:"stack",id:"collection",label:"Collection",nameLabel:"Collection name",placeholder:"Recipes"},component:{cta:"Create component",hint:"A reusable block for any page",icon:"cube",id:"component",label:"Component",nameLabel:"Component name",placeholder:"Pricing table"},entry:{cta:"Create entry",hint:"A new item in a collection",icon:"file-text",id:"entry",label:"Entry",nameLabel:"Entry name",placeholder:"My first post"},media:{cta:"Upload",hint:"Images, video, documents",icon:"image",id:"media",label:"Media",nameLabel:"",placeholder:""},page:{cta:"Create page",hint:"A new URL on your site",icon:"file",id:"page",label:"Page",nameLabel:"Page name",placeholder:"Pricing"},template:{cta:"Create template",hint:"Shared frame that pages sit inside",icon:"frame-corners",id:"template",label:"Template",nameLabel:"Template name",placeholder:"Landing"}},Us="blank",jc="article",v0="selection",vm="copy",$w=["title","image","richText","date","tags","number","link"],w0={date:{key:"date",label:"Date",schema:{format:"date",type:"string"}},image:{key:"cover",label:"Image",schema:{format:"image",type:"string"}},link:{key:"link",label:"Link",schema:{format:"uri",type:"string"}},number:{key:"number",label:"Number",schema:{type:"number"}},richText:{key:null,label:"Rich text",schema:null},tags:{key:"tags",label:"Tags",schema:{items:{type:"string"},type:"array"}},title:{key:"title",label:"Title",schema:{type:"string"}}},cT=["title","image","richText"];function p(e,n){return e==="."||e===""?n:`${e}/${n}`}function rl(e){return e.replace(/^\.\//,"")}function x0(e,n){let t=n.defaultLayout;if(e===Us||e==="")return t?!1:void 0;if(t&&rl(t)===rl(e))return;return e}function Hu(e){let n=e.defaultLayout;if(n)return e.layouts.find((r)=>rl(r.ref)===rl(n))?.ref??n;return e.layouts[0]?.ref??Us}function _0(e,n){let t=jn(n??"");if(t!==null){let r=e.layouts.find((o)=>rl(o.ref).replace(/\.json$/i,"").split("/").some((l)=>jn(l)===t));if(r)return r.ref}return Hu(e)}function I(e){return e.trim().replaceAll("\\","/").split("/").map((n)=>us(n)).filter((n)=>n!=="")}function D(e){let n={};for(let r of $w){let o=w0[r];if(e.includes(r)&&o.key!==null&&o.schema!==null)n[o.key]={...o.schema}}let t={properties:n,type:"object"};if(e.includes("title"))t.required=["title"];return t}function mD(e,n){let t=e?.properties??{};return $w.filter((r)=>{let{key:o}=w0[r];return o===null?n:Object.hasOwn(t,o)})}function L(e,n){let t=GT(e.schema);if(n!==void 0&&n!==""&&e.schema?.properties?.title!==void 0)t.title=n;if(e.ext===".json"||e.formatName===null)return{doc:t,format:null};return{doc:{...t,children:[]},format:e.formatName,frontmatter:Object.keys(t).length>0}}function dT(e,n,t,r){let o=[];if(n.includes("title"))o.push({tagName:"h1",textContent:"${state.entry.data.title}"});if(n.includes("image"))o.push({attributes:{alt:n.includes("title")?"${state.entry.data.title}":"",loading:"lazy",src:"${state.entry.data.cover}"},tagName:"img"});if(n.includes("richText")&&r.contentFormat!==null)o.push({children:"${state.entry.$children}",tagName:"div"});let i={};if(t!==void 0)i.$layout=t;return i.$paths={contentType:e,field:"id",param:"slug"},i.title=n.includes("title")?"${state.entry.data.title}":ih(e),i.state={entry:{$prototype:"ContentEntry",$src:"@jxsuite/parser/ContentEntry.class.json",contentType:e,field:"id",id:{$ref:"#/$params/slug"}}},i.tagName="article",i.children=o,i}function wm(e,n){let t=n.i18n??null,r=jn(e);return t!==null&&r!==null&&t.locales.includes(r)?r:null}function Eb(e){return e.dir.includes(Lr)}function _(e,n){return e.localeDirs?.[n]??e.dir.replace(Lr,n.toLowerCase())}function S(e,n,t){let r=t.i18n??null;if(n===null||r===null)return e;return Qc(e,n,{...r,locales:[...r.locales]})??e}function J(e){let n=e.lastIndexOf("/");return n===-1?[".",e]:[e.slice(0,n),e.slice(n+1)]}function W(e,n,t){if(n.startFrom===vm&&n.copyOf!==void 0){let r=t.componentDocs?.get(n.copyOf);if(r){let o=JSON.parse(JSON.stringify(r));return delete o.$id,o.tagName=e,o}}return{children:[],tagName:e}}function H(e,n,t){let r=n.startFrom??Hu(t),o=r===jc&&t.article!==null?t.article:null,i=o?.ext??".json",l=n.url===void 0?[us(e)].filter((u)=>u!==""):I(n.url),a=l.length===0?n.url===void 0?"":"index":l.at(-1),s=["pages",...l.slice(0,-1)].join("/"),c=a===""?"":`${a}${i}`,f=wm(n.locale,t),d=c===""?p(s,c):S(p(s,c),f,t),b=c===""?s:J(d)[0],g=e.trim(),y;if(o)y={doc:{children:[{tagName:"h1",textContent:g}],title:g},format:o.name,frontmatter:!0};else{let u={},C=x0(r===jc?Us:r,t);if(C!==void 0)u.$layout=C;u.title=g,u.tagName="main",u.children=[{tagName:"h1",textContent:g}],y={doc:u,format:null}}let N=c===""?"":wo(d).urlPattern;return{content:y,dir:b,ext:i,extraWrites:[],fileName:c,kind:"page",path:d,route:N,saved:c===""?"":`Saved as ${d} · opens at ${N}`}}function B(e,n,t){let r=us(e),o=n.fields??cT,i=t.i18n??null,l=i!==null&&n.localized!==!1,a=`content/${r}`,s=l?`${a}/${i.defaultLocale.toLowerCase()}`:a,c=t.contentFormat,f=c?.ext??".json",d=ih(r),b=r===""?"":`first-${d.replaceAll(" ","-")}${f}`,g=D(o),y=structuredClone(g),N={format:c?.name??"json",schema:m(y)?y:{},source:l?`./${a}/${Lr}`:`./${a}`},u=L({ext:f,formatName:c?.name??null,schema:g},`First ${d}`),C=[],T,O="";if(n.ownPage!==!1&&r!==""){let j=n.pageTemplate??Hu(t),A=l?[i.defaultLocale,...i.locales.filter((x)=>x!==i.defaultLocale)]:[null],k=[];for(let x of A){let P=S(`pages/${r}/[slug].json`,x,t),R=x===null||j!==Hu(t)?j:_0(t,x);T??=wo(P).urlPattern,C.push({body:{doc:dT(r,o,x0(R,t),t),format:null},path:P}),k.push(P)}O=k.length===1?`, and ${k[0]} at ${T}`:`, and a page in each language (${k.join(", ")})`}let E={config:{entry:N,name:r},content:u,dir:s,ext:f,extraWrites:C,fileName:b,kind:"collection",path:p(s,b),saved:r===""?"":l?`Adds a “${r}” collection to project.json with one folder per language under ${a}/, a first entry in ${s}/${O}.`:`Adds a “${r}” collection to project.json, a ${s}/ folder with a first entry${O}.`};if(T!==void 0)E.route=T;return E}function K(e,n){let t=us(e),r=t===""?"":`${t}.json`,o=p("layouts",r),i={},l=n.startFrom??"";if(l!==""&&l!==Us)i.$layout=l;return i.tagName="div",i.children=[{children:[{tagName:"slot"}],tagName:"main"}],{content:{doc:i,format:null},dir:"layouts",ext:".json",extraWrites:[],fileName:r,kind:"template",path:o,saved:r===""?"":`Saved as ${o} with one slot.`}}function M(e,n,t){let r=$b(e),o=r===""?"":`${r}.json`,i=p("components",o);return{content:{doc:W(r,n,t),format:null},dir:"components",ext:".json",extraWrites:[],fileName:o,kind:"component",path:i,saved:o===""?"":`Saved as ${i} with tag <${r}>.`,tag:r}}function z(e,n,t){let r=t.collections.find((d)=>d.name===n.collection)??null,o=us(e),i=r?.ext??".json",l=wm(n.locale,t),a=r!==null&&Eb(r)&&l===null,s=r===null?"content":Eb(r)&&l!==null?_(r,l):r.dir,c=o===""||r===null||a?"":`${o}${i}`,f=p(s,c);return{content:r?L(r,e.trim()):{doc:{},format:null},dir:s,ext:i,extraWrites:[],fileName:c,kind:"entry",path:f,saved:c===""?"":`Saved as ${f} in ${r.name}.`}}function uT(e,n,t,r){switch(e){case"page":return H(n,t,r);case"collection":return B(n,t,r);case"template":return K(n,t);case"component":return M(n,t,r);case"entry":return z(n,t,r);default:{let o=t.files??0;return{content:{doc:{},format:null},dir:La,ext:"",extraWrites:[],fileName:"",kind:e,path:La,saved:o===0?`Saved under ${La}/. No folder to choose.`:`${o===1?"1 file":`${o} files`} will be saved under ${La}/.`}}}}function U(e,n){let t=e.lastIndexOf("/"),r=t===-1?".":e.slice(0,t),o=n(r);return ly(e.slice(t+1),"",{dir:r,taken:o??new Set})}function F(e){if(e.kind!=="page"||e.fileName==="")return[];let n=e.fileName.slice(0,e.fileName.length-e.ext.length);if(n!=="index")return[{dir:e.dir,stem:n},{dir:p(e.dir,n),stem:"index"}];let t=e.dir.lastIndexOf("/");if(t===-1)return[{dir:e.dir,stem:n}];return[{dir:e.dir,stem:n},{dir:e.dir.slice(0,t),stem:e.dir.slice(t+1)}]}function q(e,n){let t=e.fileName.toLowerCase();for(let{dir:r,stem:o}of F(e)){let i=`${o.toLowerCase()}.`;for(let l of n(r)??[])if(l.startsWith(i)&&!(r===e.dir&&l===t))return p(r,l)}return null}function V(e){return ly(e,"",{choice:{ext:"",kind:"fixed"},dir:".",taken:new Set})}function hT(e,n,t,r,o){if(e.kind==="media")return(t.files??0)===0?"Drop files here, or browse for them.":"";let i=V(n);if(i!=="")return i;switch(e.kind){case"page":{if(t.url!==void 0){if(t.url.replaceAll("\\","/").split("/").includes(".."))return"A URL cannot step outside the site.";if(!t.url.trim().startsWith("/"))return"A URL starts with a slash, such as /pricing."}let a=q(e,o);if(a!==null)return`${a} already opens at ${e.route??"/"}.`;break}case"component":{let a=e.tag??"",s=Lw(a);if(s!=="")return s;if(r.componentTags.includes(a))return`A component named <${a}> already exists.`;if(t.startFrom===v0&&r.hasSelection!==!0)return"Select an element on the canvas to make a component from it.";if(t.startFrom===vm&&(t.copyOf===void 0||r.componentDocs?.get(t.copyOf)===void 0))return"Choose the component to copy.";break}case"collection":{let a=e.config?.name??"";if(r.declaredContent.includes(a))return`A collection named “${a}” already exists.`;if(o("content")?.has(a)===!0)return`content/${a}/ already exists.`;break}case"entry":{let a=r.collections.find((s)=>s.name===t.collection);if(!a)return"Choose the collection this entry belongs to.";if(Eb(a)&&wm(t.locale,r)===null)return`Choose the language this ${ih(a.name)} is written in.`;break}default:break}let l=[...e.kind==="collection"?[]:[e.path],...e.extraWrites.map((a)=>a.path)];for(let a of l){let s=U(a,o);if(s!=="")return s}return""}function pT(e){let n=new Set,t=(r)=>{let o=r.lastIndexOf("/");n.add(o===-1?".":r.slice(0,o))};if(e.kind==="media")return[];if(e.kind==="collection")n.add("content");else if(e.fileName!=="")t(e.path);for(let r of e.extraWrites)t(r.path);for(let{dir:r}of F(e))n.add(r);return[...n]}function gD(e){let n=(r)=>r==="."?0:r.split("/").length,t=new Map;for(let r of e){let o=n(r);t.set(o,[...t.get(o)??[],r])}return[...t.entries()].toSorted(([r],[o])=>r-o).map(([,r])=>r)}function bD(e,n){if(e===".")return!1;let t=e.lastIndexOf("/"),r=n.get(t===-1?".":e.slice(0,t));return r!==void 0&&!r.has(e.slice(t+1).toLowerCase())}function S0(e){if(e.ext===".json")return null;return(e.def.format?Wi(e.def.format)?.name:void 0)??fn(`untitled${e.ext}`)?.name??lo()?.name??null}async function G(e){let n=L({ext:e.ext,formatName:S0(e),schema:e.schema});if(n.format===null)return Cr(n.doc,null);return Ma(n.format,n.doc,{frontmatter:n.frontmatter??!1,mode:"roundtrip"})}async function $F(e,n={}){let t=qs(e);if(!t)return w.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 jt().catch(()=>{});let r;try{r=await G(t)}catch(s){return w.error(`Could not prepare a new ${t.name} entry.`,{detail:X(s),path:t.dir,source:"Content"}),null}let o=n.dir,i=o!==void 0&&Gd(o)?.name===t.name?o:t.dir;if(i.includes(Lr))return w.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 (ce("b2p9y0yz"),import("./files-b2p9y0yz.js")),a=await l({content:r,dir:i,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(a===null)return null;return xm(t.name),await ql(a),a}function v(){let e=h.value;return e&&sl(e.documentPath)?e:null}function Y(){return sl(v()?.documentPath??null)}function Q(){return[{args:Se({path:Fe("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,n)=>{await ql(St("content.openEntry",n,"path"))},title:"Open Entry"},{args:Se({hold:Tr("True holds the open entry back from production; false releases it. Written to the one-field `hold` rule its collection declares.")}),category:"Document",id:"content.setHold",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry whose collection has a one-field hold rule",when:(e)=>e.document.open,enablement:()=>ks(Y()?.def)!==null,undo:"document",run:(e,n)=>{let t=v();if(!t)throw Error("content.setHold: the active document is not a content entry");Ib(t,Hi("content.setHold",n,"hold"))},title:"Set Hold"},{args:Se({include:Tr("True lists entries a `hold` rule matches alongside the rest.")}),category:"View",id:"content.setIncludeHeld",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{eO(Hi("content.setIncludeHeld",n,"include")),await e$()},title:"Include Held Entries"}]}function fT(e){e.registerAll(Q())}
2
+ export{kb,Tw,Us,jc,v0,vm,$w,w0,cT,rl,x0,Hu,_0,mD,dT,wm,Eb,uT,hT,pT,gD,bD,S0,$F,fT};
3
+
4
+ //# debugId=B0E7DB85DDDB69F464756E2164756E21
5
+ //# sourceMappingURL=studio-x5ffyssw.js.map
@@ -1,5 +1,5 @@
1
- import{w}from"./studio-sce30r7b.js";import{le}from"./studio-3qr08sxq.js";import{Q,_}from"./studio-k3we3kqb.js";var st={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function DM(){return m+=1,m}var l=new Map;function bo(e){let r=l.get(e);if(!r)r=v(e),l.set(e,r);return r}function v(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function Ch(e){return e.wrap}function Zp(){return[...l.values()]}function nd(e){if(!e)return null;for(let r of l.values())if(Ch(r)?.contains(e))return r;return null}function g(e){for(let r of e.panels)r.renderScope?.stop(),r.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function NM(e,r){let t=bo(e);return t.wrap=r,g(t),t}function AM(e){if(l.get(e))EI(e);let t=v(e);return l.set(e,t),t}var S=null;function OM(e){S=e}function EI(e){let r=l.get(e);if(!r)return;S?.(r),g(r),y(e)}function y(e){l.delete(e)}var Xp="commit";function b(e){return _(e)&&Q(e.then)}function Ev(e){let r=new Map,t=new Map,o=new Map,a=!1,u=!1,c=!1;function f(n,i){if(!b(i))return i;let s=i.finally(()=>{if(o.get(n)===s)o.delete(n)});return o.set(n,s),s}let d={arm(n,i,s){clearTimeout(r.get(n)),t.set(n,s),r.set(n,setTimeout(()=>{r.delete(n),t.delete(n),f(n,s())},i))},cancel(){for(let n of r.values())clearTimeout(n);r.clear(),t.clear()},flush(n){let i=t.get(n);if(!i)return o.get(n);return clearTimeout(r.get(n)),r.delete(n),t.delete(n),f(n,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var T={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,r,t){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=T[r],n=t?{detail:h(t.error)}:{};if(n.key=`buffer-discarded:${r}:${a?.id??"none"}`,n.source=d,a?.documentPath)n.path=a.documentPath;return w.warn(`${c} was discarded — it was never ${f} "${u}".`,n),!1}function h(e){return e instanceof Error?e.stack??e.message:String(e)}function Tv(e,r){let t=e?._writes;if(!e||!t)return!0;let o;try{o=t.flush(Xp)}catch(a){return t.cancel(),p(e,r,{error:a})}if(t.cancel(),b(o))return o.then(()=>p(e,r,null),(a)=>p(e,r,{error:a})),!0;return p(e,r,null)}function TI(e){e?._writes?.cancel()}function tu(e){return Boolean(e?.getModel())}function Qp(e,r){if(!tu(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return r!==void 0&&e.getValue()!==r}function C(e){let r=le(e);return[...Zp().map((o)=>o.monacoEditor),st.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&le(o._editingTab)===r&&tu(o))}async function nu(e){for(let r of C(e)){if(!tu(r))continue;try{await r._writes?.flush(Xp)}catch(t){let o={detail:h(t),key:`buffer-commit:${e.id}`,source:"Editor"};if(e.documentPath)o.path=e.documentPath;w.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,o)}}}function ef(e){return C(e).some((r)=>r._writes?.typed()===!0)}
2
- export{st,DM,bo,Ch,Zp,nd,NM,AM,OM,EI,Xp,Ev,Tv,TI,tu,Qp,nu,ef};
1
+ import{w}from"./studio-bk0anq3b.js";import{le}from"./studio-9f5vcb4w.js";import{Q,S}from"./studio-erjccagy.js";var st={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function WP(){return m+=1,m}var l=new Map;function br(e){let r=l.get(e);if(!r)r=v(e),l.set(e,r);return r}function v(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function Sh(e){return e.wrap}function Zp(){return[...l.values()]}function nd(e){if(!e)return null;for(let r of l.values())if(Sh(r)?.contains(e))return r;return null}function g(e){for(let r of e.panels)r.renderScope?.stop(),r.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function zP(e,r){let t=br(e);return t.wrap=r,g(t),t}function UP(e){if(l.get(e))PR(e);let t=v(e);return l.set(e,t),t}var b=null;function qP(e){b=e}function PR(e){let r=l.get(e);if(!r)return;b?.(r),g(r),T(e)}function T(e){l.delete(e)}var Xp="commit";function h(e){return S(e)&&Q(e.then)}function Iy(e){let r=new Map,t=new Map,o=new Map,a=!1,u=!1,c=!1;function f(n,i){if(!h(i))return i;let s=i.finally(()=>{if(o.get(n)===s)o.delete(n)});return o.set(n,s),s}let d={arm(n,i,s){clearTimeout(r.get(n)),t.set(n,s),r.set(n,setTimeout(()=>{r.delete(n),t.delete(n),f(n,s())},i))},cancel(){for(let n of r.values())clearTimeout(n);r.clear(),t.clear()},flush(n){let i=t.get(n);if(!i)return o.get(n);return clearTimeout(r.get(n)),r.delete(n),t.delete(n),f(n,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var M={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,r,t){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=M[r],n=t?{detail:C(t.error)}:{};if(n.key=`buffer-discarded:${r}:${a?.id??"none"}`,n.source=d,a?.documentPath)n.path=a.documentPath;return w.warn(`${c} was discarded — it was never ${f} "${u}".`,n),!1}function C(e){return e instanceof Error?e.stack??e.message:String(e)}function Ny(e,r){let t=e?._writes;if(!e||!t)return!0;let o;try{o=t.flush(Xp)}catch(a){return t.cancel(),p(e,r,{error:a})}if(t.cancel(),h(o))return o.then(()=>p(e,r,null),(a)=>p(e,r,{error:a})),!0;return p(e,r,null)}function MR(e){e?._writes?.cancel()}function eu(e){return Boolean(e?.getModel())}function Qp(e,r){if(!eu(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return r!==void 0&&e.getValue()!==r}function y(e){let r=le(e);return[...Zp().map((o)=>o.monacoEditor),st.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&le(o._editingTab)===r&&eu(o))}async function tu(e){for(let r of y(e)){if(!eu(r))continue;try{await r._writes?.flush(Xp)}catch(t){let o={detail:C(t),key:`buffer-commit:${e.id}`,source:"Editor"};if(e.documentPath)o.path=e.documentPath;w.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,o)}}}function ef(e){return y(e).some((r)=>r._writes?.typed()===!0)}
2
+ export{st,WP,br,Sh,Zp,nd,zP,UP,qP,PR,Xp,Iy,Ny,MR,eu,Qp,tu,ef};
3
3
 
4
- //# debugId=9B21F4536E53C8D664756E2164756E21
5
- //# sourceMappingURL=studio-swedpd82.js.map
4
+ //# debugId=C870C8E1FA9AC47B64756E2164756E21
5
+ //# sourceMappingURL=studio-x5py815g.js.map
@@ -1,5 +1,5 @@
1
- import{n,Q,_}from"./studio-k3we3kqb.js";function cf(r){if(!r)return!1;if(Q(r.openProject))return!0;return r.openProjectPicker==="repo-list"&&Q(r.listRepos)&&Q(r.importProject)}function MI(r){globalThis.__jxPlatform=r}function Av(){return globalThis.__jxLauncher}var a=new Map;function PI(){let r=[];for(let[o,i]of a)for(let t=0;t<i;t++)r.push(o);return r}function s(r){a.set(r,(a.get(r)??0)+1)}function c(r){let o=(a.get(r)??1)-1;if(o>0)a.set(r,o);else a.delete(r)}function g(r){return(_(r)||Q(r))&&"then"in r&&Q(r.then)}function d(r,o,i){return(...t)=>{let e=o.apply(i,t);if(!g(e))return e;s(r);let u=()=>{c(r)};return e.then(u,u),e}}function P(r){let o=new Map;return new Proxy(r,{get(i,t){let e=i[t];if(!Q(e)||!n(t))return e;let u=o.get(t);if(u&&u.raw===e)return u.wrapper;let f=d(t,e,i);return o.set(t,{raw:e,wrapper:f}),f}})}var l=null;function p(){let r=globalThis.__jxPlatform;if(!r)throw Error("No platform registered. Call registerPlatform() before starting Studio.");if(l?.raw!==r)l={raw:r,wrapped:P(r)};return l.wrapped}function ye(){return globalThis.__jxPlatform!=null}
2
- export{cf,MI,Av,PI,p,ye};
1
+ import{n,Q,S}from"./studio-erjccagy.js";function cf(r){if(!r)return!1;if(Q(r.openProject))return!0;return r.openProjectPicker==="repo-list"&&Q(r.listRepos)&&Q(r.importProject)}function qR(r){globalThis.__jxPlatform=r}function jy(){return globalThis.__jxLauncher}var a=new Map;function KR(){let r=[];for(let[o,i]of a)for(let t=0;t<i;t++)r.push(o);return r}function s(r){a.set(r,(a.get(r)??0)+1)}function c(r){let o=(a.get(r)??1)-1;if(o>0)a.set(r,o);else a.delete(r)}function g(r){return(S(r)||Q(r))&&"then"in r&&Q(r.then)}function d(r,o,i){return(...t)=>{let e=o.apply(i,t);if(!g(e))return e;s(r);let u=()=>{c(r)};return e.then(u,u),e}}function P(r){let o=new Map;return new Proxy(r,{get(i,t){let e=i[t];if(!Q(e)||!n(t))return e;let u=o.get(t);if(u&&u.raw===e)return u.wrapper;let f=d(t,e,i);return o.set(t,{raw:e,wrapper:f}),f}})}var l=null;function p(){let r=globalThis.__jxPlatform;if(!r)throw Error("No platform registered. Call registerPlatform() before starting Studio.");if(l?.raw!==r)l={raw:r,wrapped:P(r)};return l.wrapped}function ve(){return globalThis.__jxPlatform!=null}
2
+ export{cf,qR,jy,KR,p,ve};
3
3
 
4
- //# debugId=0FF027347A2E50BA64756E2164756E21
5
- //# sourceMappingURL=studio-4fnb5648.js.map
4
+ //# debugId=6691C22E6D5D9AFA64756E2164756E21
5
+ //# sourceMappingURL=studio-xh6rf05g.js.map
@@ -0,0 +1,5 @@
1
+ var aa=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),uI=new Set([".mp4",".webm",".mov",".m4v"]),hI=new Set([".mp3",".wav",".ogg",".m4a",".flac"]),la=new Set([...aa,...uI,...hI,".pdf",".woff",".woff2",".ttf",".otf"]);function Ot(t){let o=t.lastIndexOf(".");return o>0?t.slice(o).toLowerCase():""}function wf(t){return aa.has(t.startsWith(".")?t.toLowerCase():`.${t.toLowerCase()}`)}
2
+ export{aa,uI,hI,la,Ot,wf};
3
+
4
+ //# debugId=1381C0AD25E51E5764756E2164756E21
5
+ //# sourceMappingURL=studio-z6s56dzz.js.map