@jxsuite/studio 10.3.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 (275) 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-3tkn72ey.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-gwzh9gar.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-338ee35t.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-w9nfy203.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-w3nxd7q4.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-nskxe9q1.js → studio-4jy967rj.js} +5 -5
  67. package/dist/chunks/{studio-waekn290.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-2ggfzrrd.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-5n193zqd.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-nn4f9m9c.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-321ym1tt.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-3c10v2q1.js → studio-d5f7sskn.js} +4 -4
  91. package/dist/chunks/studio-dmgh2rrj.js +5 -0
  92. package/dist/chunks/{studio-b68k0z00.js → studio-dst8y8vh.js} +4 -4
  93. package/dist/chunks/studio-ehj3csbm.js +6 -0
  94. package/dist/chunks/{studio-thz5t120.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-p2a03pgm.js → studio-g65t6svn.js} +4 -4
  102. package/dist/chunks/{studio-3q7mhbgx.js → studio-gw83z798.js} +5 -5
  103. package/dist/chunks/{studio-nwynxqtb.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-bct64zmj.js → studio-k05g7efh.js} +4 -4
  108. package/dist/chunks/studio-kefs4sz4.js +5 -0
  109. package/dist/chunks/{studio-s7t4vp1d.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-wfct4h6n.js → studio-ncwx602y.js} +4 -4
  115. package/dist/chunks/{studio-423tfdte.js → studio-nngc45ct.js} +4 -4
  116. package/dist/chunks/{studio-eqcddvc2.js → studio-nv5eq0f7.js} +173 -173
  117. package/dist/chunks/{studio-ea6r1zyr.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-stahswgb.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-y1b86ast.js → studio-td3h1644.js} +4 -4
  129. package/dist/chunks/{studio-a65kbs2e.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-wse1rs8t.js → studio-ze1sm147.js} +6 -6
  141. package/dist/chunks/{studio-hfxttkyr.js → studio-zkkt13qd.js} +4 -4
  142. package/dist/chunks/studio-zn7ysyzb.js +5 -0
  143. package/dist/chunks/{studio-nf8esxxc.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/inspector-dock.json +3 -3
  192. package/src/surfaces/tab-strip.json +5 -5
  193. package/src/surfaces/tab-strip.ts +2 -2
  194. package/src/types.ts +2 -0
  195. package/src/ui/expression-editor.ts +10 -5
  196. package/src/ui/schema-form.ts +18 -1
  197. package/src/utils/edit-display.ts +27 -1
  198. package/dist/chunks/2020-906vx2dq.js +0 -4
  199. package/dist/chunks/adapter-hnvad61x.js +0 -4
  200. package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
  201. package/dist/chunks/color-04361ttk.js +0 -4
  202. package/dist/chunks/components-w5zqwva1.js +0 -4
  203. package/dist/chunks/content-source-1vzxq1ba.js +0 -4
  204. package/dist/chunks/editor-wvf5e6j9.js +0 -4
  205. package/dist/chunks/entry-commands-mx2whrjx.js +0 -4
  206. package/dist/chunks/file-ops-9bxvk59j.js +0 -4
  207. package/dist/chunks/files-t07yqqej.js +0 -4
  208. package/dist/chunks/format-host-5ja5gxyk.js +0 -4
  209. package/dist/chunks/fs-events-3424ezp3.js +0 -4
  210. package/dist/chunks/grid-open-1mpq9mzb.js +0 -4
  211. package/dist/chunks/iframe-host-wsg0bn73.js +0 -4
  212. package/dist/chunks/index-f9qr7kzh.js +0 -4
  213. package/dist/chunks/jsonMode-vj30te2h.js +0 -13
  214. package/dist/chunks/jx-validate-ttr5ewf0.js +0 -4
  215. package/dist/chunks/layers-m49nmwvx.js +0 -4
  216. package/dist/chunks/layers-panel-hvy2e549.js +0 -4
  217. package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
  218. package/dist/chunks/media-library-ae67q4at.js +0 -4
  219. package/dist/chunks/media-open-yp9jm834.js +0 -4
  220. package/dist/chunks/media-picker-s41ngdfr.js +0 -4
  221. package/dist/chunks/menu-d2jxpgma.js +0 -4
  222. package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
  223. package/dist/chunks/monaco-setup-g9kterhx.js +0 -4
  224. package/dist/chunks/notify-bwehrp7q.js +0 -4
  225. package/dist/chunks/platform-kv0k65cy.js +0 -4
  226. package/dist/chunks/popover-9tf4cjrk.js +0 -4
  227. package/dist/chunks/publish-panel-gzfxcm0t.js +0 -4
  228. package/dist/chunks/publish-workspace-dppd82tc.js +0 -4
  229. package/dist/chunks/quick-search-tdxaam55.js +0 -4
  230. package/dist/chunks/references-vqyr5s9x.js +0 -4
  231. package/dist/chunks/right-panel-0yrw4cgz.js +0 -4
  232. package/dist/chunks/source-control-6fk72me2.js +0 -4
  233. package/dist/chunks/studio-0khd8xtx.js +0 -4
  234. package/dist/chunks/studio-0w3541dg.js +0 -7
  235. package/dist/chunks/studio-15hwqgd8.js +0 -5
  236. package/dist/chunks/studio-1ks5d9y4.js +0 -5
  237. package/dist/chunks/studio-3xk9zdgb.js +0 -5
  238. package/dist/chunks/studio-4f7thq0p.js +0 -5
  239. package/dist/chunks/studio-53wy9ek3.js +0 -5
  240. package/dist/chunks/studio-7rrdbvex.js +0 -5
  241. package/dist/chunks/studio-8kx6m0rg.js +0 -5
  242. package/dist/chunks/studio-9dq7rwc7.js +0 -5
  243. package/dist/chunks/studio-9qx1ywbv.js +0 -9
  244. package/dist/chunks/studio-aam8zt8z.js +0 -5
  245. package/dist/chunks/studio-b4e0ftkt.js +0 -5
  246. package/dist/chunks/studio-bz0b5brj.js +0 -6
  247. package/dist/chunks/studio-cfnn70h1.js +0 -5
  248. package/dist/chunks/studio-e7vjyp04.js +0 -10
  249. package/dist/chunks/studio-egnjpyde.js +0 -9
  250. package/dist/chunks/studio-ejrypvmq.js +0 -5
  251. package/dist/chunks/studio-f8tyeyzt.js +0 -5
  252. package/dist/chunks/studio-fj6c905s.js +0 -5
  253. package/dist/chunks/studio-fkrr7kgg.js +0 -9
  254. package/dist/chunks/studio-fspe7m9t.js +0 -5
  255. package/dist/chunks/studio-ggx3j7nd.js +0 -5
  256. package/dist/chunks/studio-j0zf5x2x.js +0 -5
  257. package/dist/chunks/studio-jeb7hth3.js +0 -5
  258. package/dist/chunks/studio-k1xqrgm5.js +0 -5
  259. package/dist/chunks/studio-k3we3kqb.js +0 -5
  260. package/dist/chunks/studio-n9qba0gx.js +0 -5
  261. package/dist/chunks/studio-nzemfbkk.js +0 -14
  262. package/dist/chunks/studio-q80fg1d6.js +0 -12
  263. package/dist/chunks/studio-r050sez0.js +0 -6
  264. package/dist/chunks/studio-s9fng7m8.js +0 -7
  265. package/dist/chunks/studio-wgc54sxf.js +0 -5
  266. package/dist/chunks/studio-wqfaqw4m.js +0 -5
  267. package/dist/chunks/studio-x0gsfr1d.js +0 -16
  268. package/dist/chunks/studio-xpx91fby.js +0 -6
  269. package/dist/chunks/studio-yrcrncev.js +0 -5
  270. package/dist/chunks/studio-yzpskb0j.js +0 -5
  271. package/dist/chunks/studio-zfdbmhp3.js +0 -5
  272. package/dist/chunks/tsMode-jg1dtphj.js +0 -14
  273. package/dist/chunks/workspace-9btkc8tk.js +0 -4
  274. package/dist/chunks/workspace-home-qcc4z5ag.js +0 -4
  275. package/src/content/draft-state.ts +0 -108
@@ -1,5 +1,5 @@
1
- import{p,ye}from"./studio-4fnb5648.js";import{Ne,wx,Ea,Uc}from"./studio-n9qba0gx.js";import{ln,Ra,Z,_r,Jp,h}from"./studio-yrcrncev.js";import{Nv}from"./studio-aam8zt8z.js";import{Wd,Ys,nr}from"./studio-y1b86ast.js";import{zr}from"./studio-90zkgne5.js";import{qL,ul,Jb}from"./studio-53wy9ek3.js";import{ft}from"./studio-5tet77de.js";import{nt}from"./studio-tpxcryf2.js";import{ei}from"./studio-3q7mhbgx.js";import{Db}from"./studio-e7vjyp04.js";import{Gu}from"./studio-waekn290.js";import{lw,ED,db,Id,TD,LD,EE,cw,dw}from"./studio-0w3541dg.js";import{yw,ww,_p}from"./studio-r050sez0.js";import{xm}from"./studio-9qx1ywbv.js";import{C,wn}from"./studio-4f7thq0p.js";import{E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";import{n,Y,v}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ra(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function F(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Y(r))return a;return a[a.length-1]=r+t,a}async function mD(e,t,a,r){if(!e||t.length===0)return;let o=await Ys(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Z(e,(m)=>_r(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Z(e,(m)=>Jp(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let u={fragment:F(i),type:"block"};if(r)Jb(e,{type:r.instruction},u,te(r,m));else Jb(e,{type:"make-child"},u,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};E("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,u,P,f)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(f,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(f,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(f,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var S=null,D=!1,x=null,b=0;function ie(){return Object.keys(C?.projectConfig?.content??{})}async function oe(e){return(await qL(e)).contentType}async function se(e){let[t,a]=await Promise.all([xm(["pages","layouts"],p()),Nv()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=S?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));D=!1,S={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},N();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let u=await Db(i).catch(()=>null);if(e===b&&u)l.set(i,u.length)})),e===b)N()}function le(){if((!S||D)&&!x&&ye()&&C){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return S}function rb(e){if(b+=1,D=!0,x=null,e===void 0||e.some((t)=>me(t)))T=!0;if(c)N()}var pe=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!pe.some((t)=>e.startsWith(t))}var T=!1,M=!1;function de(){if(M||wx&&!T||!ye())return;M=!0,T=!1,Ea().finally(()=>{M=!1,N()})}function _(e,t){return Ne.flatMap((a)=>{let r=Id(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!db(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:lw(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>db(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:lw(r.file===a),src:r.isImage?nr(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=C?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!C)return{...A(),filter:w};let e=ED(w),t=h.value?.documentPath??null,a=le();de();let r=Gu(),o=a?TD(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(C.projectConfig??{}).i18n}):[],s=LD(o,e),l=ge(),m=a?EE(a.layouts,t,"",l):[],i=a?EE(a.layouts,t,e,l):[],u=!wx,P=_("",t),f=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:f,componentsCount:k(P.length,f.length,u),componentsState:j(u,P.length,f.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(ce("t07yqqej"),import("./files-t07yqqej.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{nt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}nt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{nt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,N()}},c=null;async function he(e,t,a){let r=await ww(a,e.cache);if(r&&c===e&&t.isConnected&&!dw(t))cw(t,r)}function q(e,t,a){let r=zr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{ul({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ve(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:Uc(t),type:"block"}:null}function xe(e){let t=Gu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:F({kind:Wd({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function we(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:yw(),handle:null,host:e,observer:_p((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ve(o))},mediaSource:(r,o)=>{q(a,r,()=>xe(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function N(){wn("leftPanel")}function Se(e){return e.querySelector(".panel-content")??e}function gD(){ei({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>ft,afterRender:(e,t)=>{we(Se(t))}})}function bD(){if(c)G(c);c=null,w="",b+=1,S=null,D=!1,x=null,T=!0,M=!1}
2
- export{mD,rb,gD,bD};
1
+ import{ft}from"./studio-4z0cdh16.js";import{Uo}from"./studio-czpmzs9r.js";import{nL,pl,ey}from"./studio-aaw7wxv8.js";import{p,ve}from"./studio-xh6rf05g.js";import{ln,Da,Z,So,Jp,h}from"./studio-s49y6m5b.js";import{Fy}from"./studio-ex1644g2.js";import{Wd,Qs,no}from"./studio-td3h1644.js";import{De,Tx,$a,Uc}from"./studio-43pynnhz.js";import{nt}from"./studio-cv6gnjqd.js";import{ei}from"./studio-gw83z798.js";import{Ab}from"./studio-15mfah02.js";import{Ku}from"./studio-4ncxzw5m.js";import{fw,AN,pb,Rd,PN,MN,ME,mw,gw}from"./studio-s4k1v7dt.js";import{kw,Ew,xp}from"./studio-vswmz40d.js";import{_m}from"./studio-pte5w7rf.js";import{x,wn}from"./studio-zn7ysyzb.js";import{E,I}from"./studio-1a7zshnv.js";import{b}from"./studio-9f5vcb4w.js";import{n,J,m}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=De){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Da(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function F(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!J(r))return a;return a[a.length-1]=r+t,a}async function CN(e,t,a,r){if(!e||t.length===0)return;let o=await Qs(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Z(e,(d)=>So(d,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Z(e,(d)=>Jp(d,l.path,l.prop,s.ref));return}for(let[d,i]of o.entries()){let g={fragment:F(i),type:"block"};if(r)ey(e,{type:r.instruction},g,te(r,d));else ey(e,{type:"make-child"},g,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};E("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=m(t)?t.item:void 0;return m(a)?a:null}function R(e,t){let a=re(e)?.[t];return n(a)?a:""}function _(e,t,a,r){let o=b({...A(),...a});z(o,t);let s=null,l=!1,d=I("site-panel",o,e,{onNodeCreated:(i,g,P,f)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let u=R(f,"tagName");if(u!=="")r.preview(i,u);break}case"component-card":{let u=R(f,"tagName");if(u!=="")r.componentSource(i,u);break}case"media-thumb":{let u=R(f,"path");if(u!=="")r.mediaSource(i,u);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:d,update:(i)=>{z(o,i)}}}var N=null,D=!1,w=null,y=0;function ie(){return Object.keys(x?.projectConfig?.content??{})}async function oe(e){return(await nL(e)).contentType}async function se(e){let[t,a]=await Promise.all([_m(["pages","layouts"],p()),Fy()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==y)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));D=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let d=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...d].map(async(i)=>{let g=await Ab(i).catch(()=>null);if(e===y&&g)l.set(i,g.length)})),e===y)C()}function le(){if((!N||D)&&!w&&ve()&&x){let e=y;w=se(e).finally(()=>{if(e===y)w=null})}return N}function lb(e){if(y+=1,D=!0,w=null,e===void 0||e.some((t)=>me(t)))T=!0;if(c)C()}var pe=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!pe.some((t)=>e.startsWith(t))}var T=!1,M=!1;function de(){if(M||Tx&&!T||!ve())return;M=!0,T=!1,$a().finally(()=>{M=!1,C()})}function V(e,t){return De.flatMap((a)=>{let r=Rd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!pb(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:fw(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var W=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function B(e,t,a){return e.flatMap((r)=>pb(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:fw(r.file===a),src:r.isImage?no(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=x?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var S="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function U(){if(!x)return{...A(),filter:S};let e=AN(S),t=h.value?.documentPath??null,a=le();de();let r=Ku(),o=a?PN(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(x.projectConfig??{}).i18n}):[],s=MN(o,e),l=ge(),d=a?ME(a.layouts,t,"",l):[],i=a?ME(a.layouts,t,e,l):[],g=!Tx,P=V("",t),f=V(e,t),u=r?B(r,"",t):[],v=r?B(r,e,t):[],H=(Y)=>Y.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:f,componentsCount:k(P.length,f.length,g),componentsState:j(g,P.length,f.length),filter:S,media:v.slice(0,W),mediaCount:k(u.length,v.length,r===null),mediaMore:ue(v.length,Math.min(v.length,W)),mediaState:j(r===null,u.length,v.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(d.length,i.length,a===null),templatesState:j(a===null,d.length,i.length)}}function q(e){(ce("b2p9y0yz"),import("./files-b2p9y0yz.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{nt("file.new",{},"Site panel")},open:q,openComponent:(e)=>{let t=De.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){q(a);return}nt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{nt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{S=e,C()}},c=null;async function he(e,t,a){let r=await Ew(a,e.cache);if(r&&c===e&&t.isConnected&&!gw(t))mw(t,r)}function G(e,t,a){let r=Uo({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{pl({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function K(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=De.find((a)=>a.tagName===e);return t?{fragment:Uc(t),type:"block"}:null}function xe(e){let t=Ku()?.find((r)=>r.file===e);if(!t)return null;return{fragment:F({kind:Wd({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function we(e){if(c&&(c.host!==e||c.handle?.connected()===!1))K(c),c=null;if(c){c.handle?.update(U()),be(c);return}let t=new Map,a={cache:kw(),handle:null,host:e,observer:xp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=_(e,U(),fe,{componentSource:(r,o)=>{G(a,r,()=>ye(o))},mediaSource:(r,o)=>{G(a,r,()=>xe(o))},preview:(r,o)=>{let s=L(De.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){wn("leftPanel")}function Se(e){return e.querySelector(".panel-content")??e}function kN(){ei({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>ft,afterRender:(e,t)=>{we(Se(t))}})}function EN(){if(c)K(c);c=null,S="",y+=1,N=null,D=!1,w=null,T=!0,M=!1}
2
+ export{CN,lb,kN,EN};
3
3
 
4
- //# debugId=F517146B3610EBEF64756E2164756E21
5
- //# sourceMappingURL=studio-ea6r1zyr.js.map
4
+ //# debugId=258B948FFF44175364756E2164756E21
5
+ //# sourceMappingURL=studio-nzp0sqjg.js.map
@@ -1,7 +1,7 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{w}from"./studio-sce30r7b.js";import{Jt,Ut}from"./studio-nzemfbkk.js";import{sn,dt}from"./studio-tpxcryf2.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubAuth",$description:"The RFC 8628 device flow's waiting room: the code GitHub minted, the page to type it into, and a Cancel. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — and it is the reason the dialog has no confirm button at all: the answer arrives from GitHub over a poll rather than from anything the reader can press here, so a primary button would be a control with nothing to do. Nothing in this document talks to GitHub: `github/github-auth.ts` keeps the client id, the poll loop, its failure budget and every report the three outcomes raise.",tagName:"jx-dialog",$props:{headline:"Sign in to GitHub",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-auth"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"Four `.github-auth-*` rules in `styles/overlays.css` become the parts below, and two things in them do not travel. `.github-auth-dialog`'s `padding: 16px 0` was the card's own body padding drawn by hand, and `jx-dialog` already pads its body; `.github-auth-dialog p { font-size: 13px }` was a body size this surface picked for itself, and what the paragraphs now inherit is the dialog's own `--jx-text-md`. The `8px 0` margins go with them — the column is a flex column with a gap, so a margin between two rows would be a second opinion about the same space. The code keeps its 24px, which is above the token scale on purpose: it is a string the reader has to copy onto another screen, and reading it out loud is the whole job of this dialog.",'& [part="device"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",textAlign:"center"},'& [part="lede"], & [part="waiting"]':{margin:"0"},'& [part="code"]':{$description:"`<code>`, not a styled `<div>`: this is a literal string to be transcribed, and the element that says so is also the one a reader's own stylesheet and a screen reader's character-by-character mode already know about. It is this dialog's message, and the one string in it the reader must carry to another screen, so it opts back in to selection against the root's `user-select: none`. `all` rather than `text`: one click selects the whole code, so a copy never leaves a character behind.",userSelect:"all",fontFamily:"var(--font-mono)",fontSize:"24px",fontWeight:"700",letterSpacing:"2px",padding:"var(--jx-space-3) var(--jx-space-4)",background:"var(--hover-bg)",borderRadius:"var(--radius)"},'& [part="link"]':{$description:"The blue this carried as a `var(--accent, …)` fallback is gone: `--accent` is declared on `:root` in `styles/tokens.css`, so the fallback could only ever have painted when the token was missing — which is a theme fault to fix rather than a colour to hard-code.",color:"var(--accent)",textDecoration:"underline"},'& [part="waiting"]':{color:"var(--fg-dim)",fontStyle:"italic"}},children:[{tagName:"div",attributes:{part:"device"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Enter this code on GitHub to authorize Jx Studio:"},{tagName:"code",attributes:{part:"code"},textContent:"${state.userCode}"},{tagName:"a",attributes:{part:"link",href:"${state.verificationUri}",target:"_blank",rel:"noreferrer"},textContent:"Open ${state.verificationUri}"},{tagName:"p",attributes:{part:"waiting"},textContent:"Waiting for authorization…"}]}]};E("github-auth",_);function A(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ve,vt("dialog","github-auth")),e.layer.append(t);let s=!1,l=()=>{if(s)return;s=!0,e.onClosed()},u=()=>s,b=g({cancel:()=>{e.onCancel()},closed:l,userCode:e.userCode,verificationUri:e.verificationUri}),n=null,r=R("github-auth",b,t).then(async(i)=>{n=i;let o=i.root;if(u())return i.dispose(),o;if(await sn(o),u())return o;return Jt(o),o});return{close(){let i=n?.root;if(i instanceof HTMLElement)Ut(i);n?.dispose(),n=null,t.remove(),l()},host:t,ready:r}}var S="jx_github_token",v="Ov23liYVlMFpgjOEPXJH";function P(e){return typeof e==="object"&&e!==null&&"githubAuth"in e&&e.githubAuth!=null}function p(){let e=globalThis,t="__jxPlatform"in e?e.__jxPlatform:void 0;return P(t)?t.githubAuth:null}var f=null,C=!1;function H(e){f=e}function vL(){return f!==null||C||localStorage.getItem("jx_github_token")!==null}function yL(){return p()?"desktop":"browser"}function y(){return f??localStorage.getItem("jx_github_token")}function wL(){f=null,C=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var O="github.auth",j="Source Control",N="git.signInToGithub",Y=3,z="The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a "+"browser cannot call them directly — the desktop app can. A machine that is offline fails "+"identically, and the browser does not say which happened.";function I(e){w.error("Could not reach GitHub to sign in.",{action:N,detail:`${z}
1
+ import{X}from"./studio-9c6cbq2c.js";import{w}from"./studio-bk0anq3b.js";import{Jt,Ut}from"./studio-m3jrjfhy.js";import{sn,dt}from"./studio-cv6gnjqd.js";import{ze,yt,E,I}from"./studio-1a7zshnv.js";import{b}from"./studio-9f5vcb4w.js";var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubAuth",$description:"The RFC 8628 device flow's waiting room: the code GitHub minted, the page to type it into, and a Cancel. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — and it is the reason the dialog has no confirm button at all: the answer arrives from GitHub over a poll rather than from anything the reader can press here, so a primary button would be a control with nothing to do. Nothing in this document talks to GitHub: `github/github-auth.ts` keeps the client id, the poll loop, its failure budget and every report the three outcomes raise.",tagName:"jx-dialog",$props:{headline:"Sign in to GitHub",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-auth"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"Four `.github-auth-*` rules in `styles/overlays.css` become the parts below, and two things in them do not travel. `.github-auth-dialog`'s `padding: 16px 0` was the card's own body padding drawn by hand, and `jx-dialog` already pads its body; `.github-auth-dialog p { font-size: 13px }` was a body size this surface picked for itself, and what the paragraphs now inherit is the dialog's own `--jx-text-md`. The `8px 0` margins go with them — the column is a flex column with a gap, so a margin between two rows would be a second opinion about the same space. The code keeps its 24px, which is above the token scale on purpose: it is a string the reader has to copy onto another screen, and reading it out loud is the whole job of this dialog.",'& [part="device"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",textAlign:"center"},'& [part="lede"], & [part="waiting"]':{margin:"0"},'& [part="code"]':{$description:"`<code>`, not a styled `<div>`: this is a literal string to be transcribed, and the element that says so is also the one a reader's own stylesheet and a screen reader's character-by-character mode already know about. It is this dialog's message, and the one string in it the reader must carry to another screen, so it opts back in to selection against the root's `user-select: none`. `all` rather than `text`: one click selects the whole code, so a copy never leaves a character behind.",userSelect:"all",fontFamily:"var(--font-mono)",fontSize:"24px",fontWeight:"700",letterSpacing:"2px",padding:"var(--jx-space-3) var(--jx-space-4)",background:"var(--hover-bg)",borderRadius:"var(--radius)"},'& [part="link"]':{$description:"The blue this carried as a `var(--accent, …)` fallback is gone: `--accent` is declared on `:root` in `styles/tokens.css`, so the fallback could only ever have painted when the token was missing — which is a theme fault to fix rather than a colour to hard-code.",color:"var(--accent)",textDecoration:"underline"},'& [part="waiting"]':{color:"var(--fg-dim)",fontStyle:"italic"}},children:[{tagName:"div",attributes:{part:"device"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Enter this code on GitHub to authorize Jx Studio:"},{tagName:"code",attributes:{part:"code"},textContent:"${state.userCode}"},{tagName:"a",attributes:{part:"link",href:"${state.verificationUri}",target:"_blank",rel:"noreferrer"},textContent:"Open ${state.verificationUri}"},{tagName:"p",attributes:{part:"waiting"},textContent:"Waiting for authorization…"}]}]};E("github-auth",_);function A(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(ze,yt("dialog","github-auth")),e.layer.append(t);let s=!1,l=()=>{if(s)return;s=!0,e.onClosed()},u=()=>s,f=b({cancel:()=>{e.onCancel()},closed:l,userCode:e.userCode,verificationUri:e.verificationUri}),n=null,r=I("github-auth",f,t).then(async(i)=>{n=i;let o=i.root;if(u())return i.dispose(),o;if(await sn(o),u())return o;return Jt(o),o});return{close(){let i=n?.root;if(i instanceof HTMLElement)Ut(i);n?.dispose(),n=null,t.remove(),l()},host:t,ready:r}}var S="jx_github_token",v="Ov23liYVlMFpgjOEPXJH";function P(e){return typeof e==="object"&&e!==null&&"githubAuth"in e&&e.githubAuth!=null}function p(){let e=globalThis,t="__jxPlatform"in e?e.__jxPlatform:void 0;return P(t)?t.githubAuth:null}var g=null,C=!1;function H(e){g=e}function $$(){return g!==null||C||localStorage.getItem("jx_github_token")!==null}function L$(){return p()?"desktop":"browser"}function y(){return g??localStorage.getItem("jx_github_token")}function R$(){g=null,C=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var R="github.auth",O="Source Control",j="git.signInToGithub",Y=3,z="The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a "+"browser cannot call them directly — the desktop app can. A machine that is offline fails "+"identically, and the browser does not say which happened.";function N(e){w.error("Could not reach GitHub to sign in.",{action:j,detail:`${z}
2
2
 
3
- ${X(e)}`,key:O,source:j})}function T(e,t){w.warn(e,{action:N,detail:t,key:O,source:j})}async function F(){let e;try{e=await fetch("https://github.com/login/device/code",{body:JSON.stringify({client_id:v,scope:"repo"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})}catch(t){return I(t),null}if(!e.ok)return T("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function ZS(){let e=y();if(e)return e;let t=p();if(t)try{let{token:r}=await t.signIn();return H(r),r}catch(r){return T("GitHub sign-in was not completed.",X(r)),null}let s=await F();if(!s)return null;let{device_code:l,user_code:u,verification_uri:b,interval:n=5}=s;return new Promise((r)=>{let i=!1,o=null,m=0,k=!1,L=(c)=>{if(k)return;if(k=!0,i=!0,o)clearTimeout(o),o=null;r(c)},x=!1,G=()=>{if(x)return;x=!0,D.close()},d=(c)=>{L(c),G()},h=async()=>{if(i)return;try{let a=await(await fetch("https://github.com/login/oauth/access_token",{body:JSON.stringify({client_id:v,device_code:l,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})).json();if(m=0,a.access_token){localStorage.setItem(S,a.access_token),d(a.access_token);return}if(a.error==="authorization_pending"){o=setTimeout(h,n*1000);return}if(a.error==="slow_down"){o=setTimeout(h,(n+5)*1000);return}T("GitHub sign-in was not completed.",a.error==="access_denied"?"The authorization was declined on GitHub.":a.error==="expired_token"?"The device code expired before it was entered.":`GitHub answered "${a.error??"an unrecognised response"}".`),d(null)}catch(c){if(m+=1,m>=Y){I(c),d(null);return}o=setTimeout(h,n*1000)}},D=A({layer:dt("dialog"),onCancel:()=>{G()},onClosed:()=>{d(null)},userCode:u,verificationUri:b});o=setTimeout(h,n*1000)})}
4
- export{vL,yL,wL,ZS};
3
+ ${X(e)}`,key:R,source:O})}function T(e,t){w.warn(e,{action:j,detail:t,key:R,source:O})}async function F(){let e;try{e=await fetch("https://github.com/login/device/code",{body:JSON.stringify({client_id:v,scope:"repo"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})}catch(t){return N(t),null}if(!e.ok)return T("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function rC(){let e=y();if(e)return e;let t=p();if(t)try{let{token:r}=await t.signIn();return H(r),r}catch(r){return T("GitHub sign-in was not completed.",X(r)),null}let s=await F();if(!s)return null;let{device_code:l,user_code:u,verification_uri:f,interval:n=5}=s;return new Promise((r)=>{let i=!1,o=null,m=0,k=!1,L=(c)=>{if(k)return;if(k=!0,i=!0,o)clearTimeout(o),o=null;r(c)},x=!1,G=()=>{if(x)return;x=!0,D.close()},d=(c)=>{L(c),G()},h=async()=>{if(i)return;try{let a=await(await fetch("https://github.com/login/oauth/access_token",{body:JSON.stringify({client_id:v,device_code:l,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})).json();if(m=0,a.access_token){localStorage.setItem(S,a.access_token),d(a.access_token);return}if(a.error==="authorization_pending"){o=setTimeout(h,n*1000);return}if(a.error==="slow_down"){o=setTimeout(h,(n+5)*1000);return}T("GitHub sign-in was not completed.",a.error==="access_denied"?"The authorization was declined on GitHub.":a.error==="expired_token"?"The device code expired before it was entered.":`GitHub answered "${a.error??"an unrecognised response"}".`),d(null)}catch(c){if(m+=1,m>=Y){N(c),d(null);return}o=setTimeout(h,n*1000)}},D=A({layer:dt("dialog"),onCancel:()=>{G()},onClosed:()=>{d(null)},userCode:u,verificationUri:f});o=setTimeout(h,n*1000)})}
4
+ export{$$,L$,R$,rC};
5
5
 
6
- //# debugId=A116AF93B212CC5864756E2164756E21
7
- //# sourceMappingURL=studio-k2evngrj.js.map
6
+ //# debugId=02C7AA7895FF5C0264756E2164756E21
7
+ //# sourceMappingURL=studio-pgze9p34.js.map
@@ -0,0 +1,5 @@
1
+ import{Kn,g,Ft}from"./studio-s49y6m5b.js";import{ID}from"./studio-pte5w7rf.js";import{rh}from"./studio-aaw7wxv8.js";import{ce}from"./studio-7qqb7hb8.js";var e="edit",a=new Set(["edit","design"]);function r(t){for(let i of g.tabs.values())if(i.documentPath===t)return i;return null}async function ql(t){if(!rh(t)){let o=Kn(t);if(o&&!o.fileBacked)return ID(t);let{openFileInTab:s}=await (ce("b2p9y0yz"),import("./files-b2p9y0yz.js"));return await s(t),r(t)}let{openFileInTab:i}=await (ce("b2p9y0yz"),import("./files-b2p9y0yz.js"));await i(t);let n=r(t);if(!n)return null;if(!a.has(n.session.ui.canvasMode)&&n.capabilities.modes.includes(e))n.session.ui.canvasMode=e,n.session.ui.preview=!1;return Ft(n.id),n}
2
+ export{ql};
3
+
4
+ //# debugId=348E70D4BF4EDB5E64756E2164756E21
5
+ //# sourceMappingURL=studio-ph17an19.js.map
@@ -0,0 +1,9 @@
1
+ import{ae}from"./studio-q509sqt8.js";import{p,ve}from"./studio-xh6rf05g.js";import{Fy}from"./studio-ex1644g2.js";import{Lr}from"./studio-zav9hgb3.js";import{Jl,kp}from"./studio-ep1384t9.js";import{X}from"./studio-9c6cbq2c.js";import{ln,qx,Ia,Bi,Kn,Z,Xd,g,Ft}from"./studio-s49y6m5b.js";import{Rs}from"./studio-48yzqzqr.js";import{la,Ot,wf}from"./studio-z6s56dzz.js";import{no}from"./studio-td3h1644.js";import{Fd,Gw,Ep,Rm,ks,Tp}from"./studio-15mfah02.js";import{wo,nh,CC,Yb,hi,tc}from"./studio-aaw7wxv8.js";import{eo,nO}from"./studio-ek4fb4eb.js";import{qs,sl,GD,JD}from"./studio-6mf31e16.js";import{Ip}from"./studio-t46rt6gx.js";import{x}from"./studio-zn7ysyzb.js";import{Ce}from"./studio-151kgn69.js";import{$n,E,I}from"./studio-1a7zshnv.js";import{me,Ds,te,b}from"./studio-9f5vcb4w.js";import{n,J,qe,S,m}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";var j=b(new Map);function Y(e,t){j.set(e,t)}function wD(e){return e?j.get(e):void 0}function xD(e){j.delete(e)}var B={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a hold switch commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-hold-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="hold"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"hold-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/holdSwitch"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"hold"},$props:{checked:{$ref:"#/state/holdOn"},hint:"${state.holdHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setHold"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"${state.holdLabel}"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};E("entry-editor",B);function W(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.holdSwitch=t.holdSwitch,e.holdOn=t.holdOn,e.holdLabel=t.holdLabel,e.holdHint=t.holdHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function be(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function q(e,t,r,o){e.replaceChildren();let s=b({collection:"",holdHint:"",holdLabel:"",holdOn:!1,holdSwitch:"hidden",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setHold:r.setHold,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});W(s,t);let i=null,a=!1,l=I("entry-editor",s,e,{onNodeCreated:(d,c,O)=>{if(d instanceof HTMLElement&&be(O)==="fields")o.fieldsSlot(d)}}).then((d)=>{let c=d.root;if(a)return d.dispose(),c;return i=d,c});return{attached:()=>{if(a)return!1;let d=i?.root;return d===void 0?!0:d instanceof HTMLElement&&e.contains(d)},dispose(){a=!0,i?.dispose(),i=null},ready:l,update:(d)=>W(s,d)}}var xe=["title","name","label","heading"];function _p(e,t={}){let r=(o)=>{for(let s of xe){let i=o.find((a)=>a.toLowerCase()===s);if(i!==void 0)return i}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((o)=>n(t[o])))}function k(e){if(e instanceof Date)return Lb(e);if(n(e))return e;if(J(e)||qe(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||J(t)).map(String).join(", ");return""}function we(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,k(t[r])]))}var Ee=["date","published","publishedAt","pubDate","publishDate"];function E0(e,t){for(let[r,o]of Object.entries(e?.properties??{}))if(o.format==="date"||o.format==="date-time")return r;return Ee.find((r)=>(r in t))??null}function gT(e){let t=e?.properties??{};return E0(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function Lb(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let o=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${o}-${s}`}return r.toISOString().slice(0,10)}function D(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function Q(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",o=[...r===""?[]:r.split("/"),...t.split("/")],s=[];for(let i of o){if(i===""||i===".")continue;if(i==="..")s.pop();else s.push(i)}return s.join("/")}var ee=/^[a-z][\d+.a-z-]*:/i;function Se(e,t){let r=t.trim();if(r==="")return"";return ee.test(r)?r:no(Q(e,r))}function ne(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":ne(t)}if(m(e)){let{src:t}=e;return n(t)?t:""}return""}function re(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&re(e.items)}function bT(e,t,r){for(let[o,s]of Object.entries(r?.properties??{}))if(re(s)){let i=Se(e,ne(t[o]));if(i!=="")return i}for(let o of Object.values(t)){if(!n(o)||ee.test(o))continue;let s=o.lastIndexOf(".");if(s>0&&wf(o.slice(s)))return no(Q(e,o))}return""}function oe(e,t,r){let o=qs(t),s=o?.schema??null,i=_p(s,r),a=i===null?void 0:r[i],l=E0(s,r);return{date:l===null?"":Lb(r[l]),fields:we(s,r),path:e,status:Rm(o?.def,r),thumb:bT(e,r,s),title:n(a)&&a.trim()!==""?a:D(e)}}async function Fe(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let s=JSON.parse(t);return S(s)&&!Array.isArray(s)?s:{}}let{parseSourceForPath:r}=await (ce("6a49er4c"),import("./file-ops-6a49er4c.js"));return(await r(e,t)).frontmatter}catch{return{}}}var L=new Map,F=new Map,P=0,T=new Set,U=200;async function Le(e,t){let r=t.slice(0,U),o=await Promise.all(r.map(async(i)=>oe(i,e,await Fe(i)))),s=t.slice(U).map((i)=>({date:"",path:i,status:"",thumb:"",title:D(i)}));return[...o,...s]}function Rw(e,t){let r=t.join(`
2
+ `),o=L.get(e);if(o?.key===r)return o.entries;if(!ve())return t.map((i)=>({date:"",path:i,status:"",thumb:"",title:D(i)}));let s=`${e}
3
+ ${r}`;if(!F.has(s)){let i=P,a=Le(e,t).then((l)=>{if(F.get(s)===a)F.delete(s);if(i===P){L.set(e,{entries:l,key:r});for(let d of T)d()}return l});F.set(s,a)}return null}function Te(e,t,r){let o=L.get(t),s=o?.entries.findIndex((a)=>a.path===e)??-1;if(!o||s===-1)return!1;let i=o.entries.with(s,oe(e,t,r));L.set(t,{entries:i,key:o.key});for(let a of T)a();return!0}function yD(e,t){let r=tc(e);if(e===null||r===null||r===hi)return!1;return Te(e,r,t)}function yT(){P+=1,L.clear(),F.clear()}function Iw(e){return T.add(e),()=>{T.delete(e)}}var Re=/^\d{4}-\d{2}-\d{2}/,f="entry",h=b(new Map);function A(e){let t=h.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return eo(e)?.state.rows[t.row]?.key??null}function Oe(e){return h.has(e.id)}function H(e,t){h.set(e.id,{key:t})}function Ne(e){h.delete(e.id)}function y(e){return Oe(e)&&eo(e)!==null}function ie(e){let t=eo(e),r=A(e);if(!t||r===null)return{};let o={};for(let s of t.state.columns){let i=t.buffer.effectiveValue(r,s.field);if(i===null||i==="")continue;if(s.kind==="date"&&n(i)&&!Re.test(i)){o[s.field]=Lb(i)||i;continue}o[s.field]=S(i)&&!Array.isArray(i)?i.$ref:i}return o}function je(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||J(e)||qe(e))return e;return JSON.stringify(e)}function _(e,t){let r=eo(e),o=A(e);if(!r||o===null)return;let s=new Set(r.state.columns.map((i)=>i.field));r.buffer.group(()=>{for(let[i,a]of Object.entries(t))if(s.has(i))r.buffer.setCell(o,i,je(a))})}function v(e){let t=eo(e),r=A(e),o=t?.state.rows??[],s=r===null?-1:o.findIndex((i)=>i.key===r);return{index:s,next:s===-1?null:o[s+1]?.key??null,previous:s<=0?null:o[s-1]?.key??null,total:o.length}}async function vD(e,t){let{openFileInTab:r}=await (ce("b2p9y0yz"),import("./files-b2p9y0yz.js"));await r(e);let o=g.tabs.get(e)??null;if(!o||!eo(o))return o;if(!h.has(o.id))o.scope.run(()=>{Ds(()=>Ne(o))});if(h.set(o.id,{row:t}),!o.capabilities.modes.includes(f))o.capabilities.modes.unshift(f);return o.session.ui.canvasMode=f,o.session.ui.preview=!1,Ft(o.id),o}function se(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Kl(e){if(y(e))return ie(e);return se(e)?e.doc.document:e.doc.content.frontmatter}function Pe(e,t,r){let o=e.doc.document,s=Object.hasOwn(o,t)?Ce(o[t]):void 0,i=r===void 0||r===null||r==="";if(i)delete o[t];else o[t]=r;let a=i?void 0:Ce(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:s}}),e.doc.dirty=!0,nO()}function M(e,t,r){if(y(e))_(e,{[t]:r});else if(se(e))Pe(e,t,r);else Xd(e,t,r)}function T0(e,t){if(y(e)){_(e,t);return}Z(e,(r)=>{for(let[o,s]of Object.entries(t))M(r,o,s)})}function w(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function ke(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function le(e,t){let r=[];for(let i of e)r.push(w(i));let o=[],s=t?.content??{};for(let i of Object.values(s)){if(!n(i.source)||i.source===""||ke(i.source))continue;let a=w(i.source),l=a.indexOf(Lr);if(l!==-1)a=w(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...o].some((c)=>a===c||a.startsWith(`${c}/`)))o.push(a)}return o.length===0?e:[...e,...o]}function De(e,t){let r=tc(e);if(r===null)return null;if(r===hi)return t===void 0||nh(e,t)?r:null;let o=Kn(e);if(!o||o.name!==r||!o.def.format||o.ext===null)return r;return e.toLowerCase().endsWith(o.ext.toLowerCase())?r:null}var $e=new Set(["node_modules",".git",".jx",".cache"]);function Ae(e){let t=w(e);return t===""||t==="."}async function de(e,t,r=!1){let o;try{o=await Rs(()=>t.platform.listDirectory(e))}catch(i){if(!r)t.failures.push({dir:e,error:X(i)});return}let s=[];for(let i of o){if(i.type==="directory"){let l=w(i.path);if(!$e.has(i.name)&&!Ae(l)&&!t.claimed.has(l))t.claimed.add(l),s.push(i.path);continue}let a=Ot(i.name);t.out.push({collection:De(i.path,t.pageExtensions),ext:a,locale:qx(i.path,t.i18n)??void 0,media:la.has(a),modified:i.modified,name:i.name,path:i.path,size:i.size,type:a||"file"})}await Promise.all(s.map((i)=>de(i,t)))}async function _m(e,t,r=new Set,o){let{i18n:s}=ln(x?.projectConfig??{}),i={claimed:new Set,failures:[],i18n:s,out:[],pageExtensions:o,platform:t};await Promise.all(e.map((d)=>{let c=w(d);if(i.claimed.has(c))return Promise.resolve();return i.claimed.add(c),de(d,i,r.has(d))}));let{failures:a,out:l}=i;return l.sort((d,c)=>d.path.localeCompare(c.path)),{failures:a,files:l}}function vT(e,t){let r=e.filter((i)=>i.collection===t.collection),o=t.query.trim().toLowerCase();if(o)r=r.filter((i)=>i.name.toLowerCase().includes(o)||i.path.toLowerCase().includes(o));let s=t.locale?.trim();if(s)r=r.filter((i)=>i.locale===s);return r}var Sm=["table","cards","calendar","board"],Nw={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var _D=new Set(["cards"]),Ie=/^(\d{4}-\d{2}-\d{2})/;function wT(e){let t=Ie.exec(e.name);if(t)return t[1];if(e.modified){let r=Ip(new Date(e.modified));if(r)return r}return null}function Rb(){return ln(x?.projectConfig??{}).i18n?.locales??[]}function SD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return Rb().filter((r)=>t.has(r))}function CD(e,t=wT){let r=new Map,o=[];for(let i of e){let a=t(i);if(a===null){o.push(i);continue}let l=r.get(a);if(l)l.push(i);else r.set(a,[i])}return{days:[...r.entries()].map(([i,a])=>({date:i,files:a})).toSorted((i,a)=>a.date.localeCompare(i.date)),undated:o}}function He(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function kD(e){let t=new Map;for(let r of e){let o=He(r.path),s=t.get(o);if(s)s.push(r);else t.set(o,[r])}return[...t.entries()].map(([r,o])=>({files:o,group:r})).toSorted((r,o)=>r.group.localeCompare(o.group))}function _e(e,t,r,o){let s=_p(e,t),i=s===null?"":t[s]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(i||a||o||`Row ${r+1}`).trim()}function Me(e){let{headers:t,rows:r}=Fd(e);return r.flatMap((o,s)=>o.some((i)=>i.trim()!=="")?[{fields:Object.fromEntries(t.map((i,a)=>[i,o[a]??""])),row:s}]:[])}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(o)=>S(o)&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([s,i])=>[s,k(i)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((o,s)=>({fields:r(o),row:s}))}function ue(e,t,r){let o=e.toLowerCase(),s=o.endsWith(".csv")?Me(t):o.endsWith(".json")?Ge(t):null;if(s===null)return null;let i=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return s.map(({fields:a,row:l,single:d},c)=>({fields:a,index:c,row:l,title:_e(r,a,c,d?i:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ve(e){return`field:${e}`}function ED(e){return e.startsWith("field:")?e.slice(6):null}var Je=6,pe=new Set(["image","markdown","html","richtext"]);function V(e){return Yb(CC(e))}function TD(e,t){return Object.entries(e?.properties??{}).filter(([r,o])=>{if(t.has(r))return!1;if(o.type==="object"||n(o.format)&&pe.has(o.format))return!1;let s=o.items?.format;return o.type!=="array"||o.items?.type==="string"&&!(n(s)&&pe.has(s))}).slice(0,Je).map(([r,o])=>{let s={name:r,title:V(r)};if(o.type==="array")s.list=!0;if(o.type==="number"||o.type==="integer"||o.format==="date"||o.format==="date-time")s.measure=!0;return s})}function ze(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function xT(e=hi,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===hi)return ze(t);let o=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)o.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)o.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let s of t?.fields??[])o.push({editable:!1,field:Ve(s.name),kind:"string",title:s.title,widthHint:140});return[...o,...r]}function Ke(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===hi?wo(e.path).urlPattern:null},key:e.path}}async function Ye(e,t){return(await Promise.all(e.map(async(o)=>{let s=o.collection===null?null:Kn(o.path);if(!s?.fileBacked)return[o];let i;try{i=await t(o.path)}catch{return[o]}let a=ue(o.path,i,s.def.schema);if(a===null)return[o];return a.map((l)=>Be(o,l))}))).flat()}function Be(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function We(e){let t=p(),r=await Ye(e.files,(o)=>t.readFile(o));return{...e,files:r}}function $D(e){let t=null,r=null,o=null,s=e??(()=>le(x?.projectDirs??[],x?.projectConfig??null));async function i(){if(t)return t;let a=s(),l=new Set(e?a:x?.projectDirs??[]),d=new Set(a.filter((c)=>!l.has(c)));return r??=Fy().then((c)=>_m(a,p(),d,c)).then(We).then((c)=>(t=c,o=a.join(`
4
+ `),r=null,c)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(xT()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:Ia("content"),label:"Content",async refresh(){t=null,r=null,await i()},async rows(){let a=await i();return{rows:a.files.map((l)=>Ke(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&o!==s().join(`
5
+ `)}}var Ue=[f],R=new Map;function z(e){return R.get(e)??null}function _T(e,t){let r=z(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function Dw(e){let t=R.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),R.delete(e)}function Ib(e,t){let r=ks(C(e)?.def);if(r)Z(e,(o)=>M(o,r.field,t))}function LD(e){let t=C(e)?.def;if(!Gw(t))return null;let r=Kl(e),o=Ep(t,r);return{held:o!==null,text:Rm(t,r),title:Tp(o)}}function ST(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function CT(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>kp(t,{projectConfig:x?.projectConfig??{},scope:r})}}function kT(e,t){return Object.fromEntries(JD(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function C(e){return y(e)?GD(e.documentPath):sl(e.documentPath)}function ET(e,t,r){let o=_p(t,r),s=e.properties??{},i=o===null?void 0:s[o];if(o===null||i===void 0)return e;return{...e,properties:{[o]:i,...s}}}function Xe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ye(e,t,r){let o=$n(e,"entry"),s=$n(e,"entry/fields");if(!r)return{collection:"",emptyLine:Xe(t),fieldsRegion:s,holdHint:Tp(null),holdLabel:"",holdOn:!1,holdSwitch:"hidden",name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:o,stage:"empty"};let i=Kl(t),a=Ep(r.def,i),l=ks(r.def),d=y(t),c=v(t);return{collection:r.name,emptyLine:"",fieldsRegion:s,holdHint:Tp(a),holdLabel:l?.label??"",holdOn:l!==null&&i[l.field]===!0,holdSwitch:l?"shown":"hidden",name:d?Qe(r,i,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:Tp(a),noteState:a===null?"hidden":"shown",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:d?"shown":"hidden",region:o,stage:"entry"}}function Qe(e,t,r){let o=_p(e.schema,t),s=o===null?void 0:t[o];if(n(s)&&s.trim()!=="")return s.trim();return r===-1?"Record":`Row ${r+1}`}function RD(e,t){let{paneId:r,wrap:o}=e;if(_T(r,t))return;Dw(r);let s=null,i=null,a=()=>{if(s!==null&&z(r)===s)d()},l=(u)=>{if(!i||!u)return;let N=Kl(t),K=Jl(`entry:${r}`,ET(u.schema,u.schema,N),N,{context:CT(t),errors:kT(u,N),onChange:(he)=>T0(t,he),rerender:a,ui:ST(u.schema)});if(K.parentNode!==i)i.replaceChildren(K)},d=()=>{let u=C(t);if(!u)i=null;s?.surface.update(ye(r,t,u)),l(u)},c=me(),O=q(o,ye(r,t,C(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=v(t);if(u!==-1&&t.documentPath)Y(t.documentPath,u);t.session.ui.canvasMode="grid"},setHold:(u)=>Ib(t,u),showNext:()=>{let{next:u}=v(t);if(u!==null)H(t,u)},showPrevious:()=>{let{previous:u}=v(t);if(u!==null)H(t,u)}},{fieldsSlot:(u)=>{i=u,l(C(t))}});s={paneId:r,scope:c,surface:O,tabId:t.id,wrap:o},R.set(r,s),c.run(()=>{te(()=>{if(z(r)!==s)return;t.doc.document,t.doc.content.frontmatter,x?.projectConfig?.content,d()})})}async function ID(e){let{openFileInTab:t}=await (ce("b2p9y0yz"),import("./files-b2p9y0yz.js"));await t(e);for(let[r,o]of g.tabs.entries()){if(o.documentPath!==e)continue;for(let s of Ue)if(!o.capabilities.modes.includes(s))o.capabilities.modes.unshift(s);return o.session.ui.canvasMode=f,o.session.ui.preview=!1,Ft(r),o}return null}
6
+ export{_p,E0,gT,Lb,bT,Rw,yD,yT,Iw,vD,Kl,T0,wD,xD,_m,vT,Sm,Nw,_D,wT,Rb,SD,CD,kD,ED,TD,xT,$D,_T,Dw,Ib,LD,ST,CT,kT,ET,RD,ID};
7
+
8
+ //# debugId=78942AB30D634FD564756E2164756E21
9
+ //# sourceMappingURL=studio-pte5w7rf.js.map
@@ -0,0 +1,6 @@
1
+ import{p,ve}from"./studio-xh6rf05g.js";import{w}from"./studio-bk0anq3b.js";import{ot,Er,PA,Bp,jx,_o,FA,Vp}from"./studio-c72v1kwc.js";import{ea,dt}from"./studio-cv6gnjqd.js";import{n,J,qe,Q,m}from"./studio-erjccagy.js";var u=null;async function Hd(){if(!ve()||!Q(p().getAccountStatus)){u=null;return}try{u=await p().getAccountStatus?.()??null}catch{u=null}}function dC(){return u}function uC(){return u!==null&&u.installations.length===0&&Boolean(u.appInstallUrl)}function _O(){if(u===null)return null;let e=u.installations.flatMap((o)=>o.manageUrl?[{account:o.account??`Installation ${o.id}`,url:o.manageUrl}]:[]);if(e.length===0&&!u.appInstallUrl)return null;let t={manage:e};if(u.appInstallUrl)t.installUrl=u.appInstallUrl;return t}function SO(){return u?.entries??[]}function z$(){return(u?.notices??[]).filter((e)=>e.display!=="toast")}var Y=new Set;function Z(){let e=(u?.notices??[]).filter((t)=>t.display==="toast"&&!Y.has(t.id));for(let t of e)Y.add(t.id);return e}var ee="https://jxsuite.com/problems/";function N(e){return typeof e==="string"}function fe(e){return typeof e==="object"&&e!==null}function zb(e){if(!N(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function to(e){if(N(e))return e.trim()===""?null:e;if(!fe(e))return null;for(let t of[e.detail,e.error,e.title])if(N(t)&&t.trim()!=="")return t;return null}function cl(e,t){return to(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var g=(e,t,o,i)=>{let s={status:t,title:o,type:`${ee}${e}`};if(i!==void 0)s.extensions=i;return s},Be={invalidRequest:g("invalid-request",400,"The request was malformed or incomplete"),notFound:g("not-found",404,"The requested resource does not exist"),methodNotAllowed:g("method-not-allowed",405,"That method is not allowed on this route"),conflict:g("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:g("payload-too-large",413,"The request body is too large"),unauthorized:g("unauthorized",401,"Credentials are missing or not accepted"),forbidden:g("forbidden",403,"The request was refused"),needsInstallationAccess:g("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:g("path-outside-project",403,"The path resolves outside the active project"),actionRequired:g("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:g("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:g("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:g("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:g("internal-error",500,"The backend failed to complete the request")};var r=(e,t,o,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:o};if(i!==void 0)s.degradation=i;return s},Ge={activate:r("POST","/__studio/activate","Bind the backend to a project root"),project:r("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:r("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:r("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:r("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),createProject:r("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:r("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:r("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:r("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:r("GET","/__studio/file","Read a file's text content"),filesRead:r("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:r("PUT","/__studio/file","Write a file's text content"),fileDelete:r("DELETE","/__studio/file","Delete a file"),fileUpload:r("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:r("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:r("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:r("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:r("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:r("POST","/__studio/locate","Find a file by name → {path | null}"),collab:r("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:r("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:r("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:r("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:r("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:r("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:r("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:r("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:r("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:r("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:r("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:r("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:r("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:r("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:r("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:r("POST","/__studio/packages/add","Add a registry dependency, writing package.json and package-lock.json together"),packagesRemove:r("POST","/__studio/packages/remove","Remove a dependency, writing package.json and package-lock.json together"),packagesInstall:r("POST","/__studio/packages/install","Install the declared dependencies (npm's installer, writing package-lock.json)","Install/reinstall affordances are hidden; add, remove and version updates still work where the backend serves them (a cloud session updates the lockfile without installing)."),packagesNeedsInstall:r("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:r("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:r("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install (lockfile-only where nothing installs)","Bulk version updates are hidden."),gitStatus:r("GET","/__studio/git/status","The project's working-tree status (GitStatusResult), project-relative"),gitBranches:r("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:r("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:r("POST","/__studio/git/stage","Stage files"),gitUnstage:r("POST","/__studio/git/unstage","Unstage files"),gitCommit:r("POST","/__studio/git/commit","Commit the project's staged (else all its dirty) files"),gitPush:r("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:r("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:r("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:r("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:r("POST","/__studio/git/create-branch","Create a branch"),gitCommitBranch:r("POST","/__studio/git/commit-branch","Commit the change set as a NEW branch off the session's base, then take it out of this one "+"→ GitCommitBranchResult; 409 branch_exists","A publish the remote conflicts with reports the conflict alone, and Send for review stays refused on a branch whose every commit is live."),gitDiff:r("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:r("GET","/__studio/git/show","File content at a ref"),gitDiscard:r("POST","/__studio/git/discard","Discard working changes"),gitInit:r("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:r("POST","/__studio/git/add-remote","Add a remote"),gitClone:r("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:r("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:r("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:r("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:r("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:r("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:r("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:r("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:r("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:r("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:r("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:r("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:r("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:r("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var U$=200,q$=100,K$=12;var me=new Set(["reload","repeat","none"]);function Np(e){if(!Array.isArray(e))return[];return e.flatMap((o)=>{if(!m(o))return[];let{href:i,id:s,label:d,primary:l}=o;if(!n(s)||!s||!n(d)||!d)return[];let h={id:s,label:d};if(n(i)&&i)h.href=i;if(l===!0)h.primary=!0;return[h]})}function te(e){return n(e)&&me.has(e)}function G$(e){return te(e)?e:void 0}function ge(e){return e.replaceAll("_","-")}function R(e){if(!m(e))return{};let{actions:t,code:o,conflicts:i,heading:s,installUrl:d,retry:l,type:h}=e,a={},c=zb(h)??(n(o)?ge(o):null);if(c!==null)a.code=c;if(n(d))a.installUrl=d;if(t!==void 0)a.actions=Np(t);if(n(s)&&s)a.heading=s;if(te(l))a.retry=l;if(Array.isArray(i))a.conflicts=i.filter((x)=>n(x));return a}function CO(e){let t=R(e);return(t.code==="pull-conflict"||t.code==="conflict")&&t.conflicts?t.conflicts:null}function kO(e){let t=R(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function EO(e){return R(e).code==="action-required"}var B="X-Jx-Ai-Session";var F="X-Api-Provider";function re(e){return typeof e==="string"}function ye(e){return re(e)&&e!==""}function O(e){return typeof e==="object"&&e!==null}function be(e){return Array.isArray(e)}function xe(e,t){if(!e)return t;let o;try{o=JSON.parse(e)}catch{return e}if(O(o)){if("error"in o){let{error:i}=o;if(re(i))return i;if(O(i)&&"message"in i&&Boolean(i.message))return String(i.message)}if("errors"in o&&be(o.errors)){let[i]=o.errors;if(O(i)&&"message"in i&&Boolean(i.message))return String(i.message)}}return e}function Se(e){let t;try{t=JSON.parse(e)}catch{return""}return O(t)&&"code"in t&&ye(t.code)?t.code:""}function ne(e,t){let o=t;if(o.name==="AbortError")return{type:"done",stopReason:"cancelled"};return{type:"error",message:`${e}: ${o.message}`}}function _e(e){return typeof e==="function"}function J$({chatUrl:e,model:t="gpt-4o",apiKey:o,baseUrl:i,provider:s,sessionId:d}){let l=null;async function*h(a,c,x,P){let _={"Content-Type":"application/json"};if(o)_["X-Api-Key"]=o;if(i)_["X-Api-Base-URL"]=i;if(s&&s!=="openai-compat")_[F]=s;if(d)_[B]=d;l??=Promise.resolve(_e(e)?e():e);let S;try{S=await l}catch(y){if(P.aborted){yield{type:"done",stopReason:"cancelled"};return}throw y}if(P.aborted){yield{type:"done",stopReason:"cancelled"};return}let f;try{f=await fetch(S,{method:"POST",headers:_,body:JSON.stringify({messages:a,tools:c,systemPrompt:x,model:t}),signal:P})}catch(y){yield ne("Network error",y);return}if(!f.ok){let y="";try{y=await f.text()}catch{}let T=xe(y,f.statusText),M=Se(y);yield{type:"error",message:T,code:M||String(f.status)};return}let b=f.body?.getReader();if(!b){yield{type:"error",message:"No response body"};return}let ue=new TextDecoder,U="";try{for(let y=await b.read();!y.done;y=await b.read()){U+=ue.decode(y.value,{stream:!0});let T=U.split(`
2
+ `);U=T.pop()||"";for(let M of T){let L=M.trim();if(!L||!L.startsWith("data: "))continue;let pe=L.slice(6),E;try{E=JSON.parse(pe)}catch{continue}if(yield E,E.type==="done"||E.type==="error")return}}}catch(y){b.cancel(),yield ne("Stream error",y)}}return{streamChat:h}}function Qu(){return Er(ot.aiOpenAiKey)}function TO(e){_o(ot.aiOpenAiKey,e||"")}function lx(){return PA(ot.aiOpenAiKey)}function dl(){return Er(ot.aiBaseUrl)}function Ea(){return Er(ot.aiProvider)==="anthropic"?"anthropic":"openai-compat"}function $O(){return Ea()==="openai-compat"?Qu():""}function cx(){return Er(ot.aiModel)}function LO(e){_o(ot.aiModel,e||"")}function G(e){return e==="anthropic"?"anthropic":""}function RO(e){FA([[ot.aiOpenAiKey,e.apiKey],[ot.aiBaseUrl,e.baseUrl],[ot.aiModel,e.model],[ot.aiProvider,G(e.provider)]])}function IO(e){return!Am(ot.aiOpenAiKey,e.apiKey,Qu())||!Am(ot.aiBaseUrl,e.baseUrl,dl())||!Am(ot.aiModel,e.model,cx())||G(e.provider)!==G(Ea())}function Am(e,t,o){return jx(e,t)===jx(e,o)}function NO(){Vp([ot.aiOpenAiKey,ot.aiBaseUrl,ot.aiModel,ot.aiProvider])}var Ae="claude-opus-5-5";function hC(){return{apiKey:Qu(),baseUrl:dl(),provider:Ea()}}function se(e){let t=e.provider??"openai-compat";return`${e.apiKey}\x00${e.baseUrl}\x00${t}`}var A=null,k="",q=!1,j=!1,H="",V,K="",C=null,W=["openai-compat"],z=null,oe=new Set,Pe=600000,v=0,ie=!1;function ds(){A=null,k="",q=!1,j=!1,H="",V=void 0,K="",C=null,W=["openai-compat"],z=null,v=0}var Re=new Set([ot.aiOpenAiKey.key,ot.aiBaseUrl.key,ot.aiProvider.key,ot.cfToken.key,ot.cfAccountId.key]);Bp((e)=>{if(e.some((t)=>Re.has(t)))ds()});function Y$(e){return A&&k===se(e)?A:null}function ae(e){return A?.find((t)=>t.id===e)}function Z$(e){return ae(e)?.toolSupport}function DO(e){return ae(e)?.contextWindow}function dx(e){if(e)oe.add(e);z??=eh({force:!0}).catch(()=>{}).then(()=>{v=Date.now();for(let t of oe)t()})}function Te(){if(!j||v===0||Date.now()-v<Pe)return!1;return z=null,v=0,dx(),!0}function Ee(){if(typeof window>"u"||ie)return;ie=!0,window.addEventListener("focus",()=>{Te()})}Ee();function Ub(){return lx()||pC()}function pC(){return q}function OO(){return j}function Pm(){return V}function AO(){return K}function fC(){return C}function PO(){return W}function we(){return H}function Ql(){let e=Ea()==="anthropic"?Ae:ot.aiModel.default;return cx()||we()||e}function Oe(e,t){let o;try{o=new URL(e,"http://jx.invalid")}catch{return e}return o.pathname=o.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?o.href:`${o.pathname}${o.search}`}function ke(e){if(e===void 0)return["openai-compat"];return e.filter((t)=>["anthropic","openai-compat"].includes(t))}async function eh(e={}){let t=e.credentials??hC(),o=se(t);if(A&&k===o&&!e.force)return A;let i=p(),s=await Promise.resolve(i.aiChatUrl()),d=Oe(s,"models"),l={};if(t.apiKey)l["X-Api-Key"]=t.apiKey;if(t.baseUrl)l["X-Api-Base-URL"]=t.baseUrl;if(t.provider==="anthropic")l[F]=t.provider;let h=await fetch(d,{headers:l});if(!h.ok)throw Error(`HTTP ${h.status}`);let a=await h.json();if(q=a.configured===!0,j=a.managed===!0,H=a.defaultModel??"",V=a.code,K=a.upstreamError!==void 0?a.upstreamMessage??"":"",C=null,W=ke(a.providers),a.code==="action_required"){let c={actions:Np(a.actions)};if(n(a.detail)&&a.detail)c.detail=a.detail;C=c}return A=(a.models||[]).map((c)=>{let x={id:c.id,name:c.name||c.id};if(J(c.contextWindow))x.contextWindow=c.contextWindow;if(qe(c.toolSupport))x.toolSupport=c.toolSupport;return x}),k=o,A}var I=new Set,X=null;function MO(e){if(I.size===0){X=e;return}for(let t of I)t(e)}function ce(e){I.add(e);let t=X;if(X=null,t)e(t);return()=>{I.delete(e)}}function mC(){return ve()&&Q(p().performAction)}function X$(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let o=e.find((i)=>i!==t);return o?{lead:t,other:o}:{lead:t}}var D=null,le=!1;function gC(e){let t=X$(e.actions);if(!mC()||!t)return Promise.resolve(!1);return D??=Ce(e,t).finally(()=>{D=null}),D}async function Mm(e){let t=R(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return gC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function de(){ds(),await Hd(),Q$()}function Ce(e,t){let o=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",d=(S)=>{if(s==="done")return;s="done",_.close(),i(S)},l=(S)=>{s="offer",_.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:S,secondaryLabel:t.other?.label??""})},h=async(S)=>{let f;try{f=await S}catch(b){if(s==="waiting")l(b instanceof Error?b.message:String(b));return}if(f?.status==="done"){await de(),d(!0);return}if(s!=="waiting"||!f||f.status==="redirect")return;Hd(),l(o)},a=(S)=>{if(s!=="offer")return;s="waiting";let f;try{f=p().performAction(S)}catch(b){l(b instanceof Error?b.message:String(b));return}_.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),h(f)},{lead:c,other:x}=t,P={cancelLabel:"Not now",confirmLabel:c.label,headline:e.heading??"One more step",layer:dt("dialog"),message:o,onCancel:()=>{le=!0,d(!1)},onClosed:()=>{d(!1)},onConfirm:()=>{a(c)},region:"account/action"};if(x)P.onSecondary=()=>{a(x)},P.secondaryLabel=x.label;let _=ea(P)})}function je(e){if(e==="reload")location.reload();else if(e==="repeat")w.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function FO(){return ce((e)=>{if(le||D)return;gC(e).then((t)=>{if(t)je(e.retry)})})}async function ux(e){if(!mC())return!1;let t=p().performAction(e),o;try{o=await t}catch(i){return w.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(o?.status==="done")return await de(),!0;if(o?.status!=="redirect")await Hd();return!1}function Q$(){for(let e of Z()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")w.warn(e.message,t);else w.info(e.message,t)}}
3
+ export{Hd,dC,uC,_O,SO,z$,zb,to,cl,U$,q$,K$,Np,G$,CO,kO,EO,J$,Qu,TO,lx,dl,Ea,$O,cx,LO,RO,IO,Am,NO,hC,ds,Y$,Z$,DO,dx,Ub,pC,OO,Pm,AO,fC,PO,Ql,eh,MO,mC,X$,gC,Mm,FO,ux,Q$};
4
+
5
+ //# debugId=C58A1FF341D464C264756E2164756E21
6
+ //# sourceMappingURL=studio-pv1ts08p.js.map
@@ -0,0 +1,5 @@
1
+ import{Ha}from"./studio-9f5vcb4w.js";var t=Ha(null);function YA(e){t.value=e}function ae(){return t.value}
2
+ export{YA,ae};
3
+
4
+ //# debugId=AF6962FDD210561A64756E2164756E21
5
+ //# sourceMappingURL=studio-q509sqt8.js.map
@@ -1,7 +1,7 @@
1
- import{p}from"./studio-4fnb5648.js";import{Am}from"./studio-xpx91fby.js";import{ae}from"./studio-wqfaqw4m.js";import{no,u}from"./studio-x0gsfr1d.js";import{C}from"./studio-4f7thq0p.js";import{E,R}from"./studio-9dq7rwc7.js";import{me,te,g,Wv}from"./studio-3qr08sxq.js";import{Q}from"./studio-k3we3kqb.js";function S(e){return JSON.parse(e)}function j(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function k(e){try{let t=S(e);return j(t)?t:void 0}catch{return}}function P({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
2
- `}function f(e,{slug:t,adapter:o}){if(!e)return{content:P({adapter:o,slug:t}),patched:!0};let n=k(e);if(n===void 0)return{content:e,patched:!1};if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
3
- `,patched:!0}}function Zl(){try{return Q(p().cfApi)}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw Am(n),n}}async function sA(){return l("/accounts")}async function A(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function I(e){let t={build_command:"bunx jx build",destination_dir:"dist"};if(e.rootDir)t.root_dir=e.rootDir;return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:t,source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}function _(e){let t={id:e.id,url:e.url,environment:e.environment,stage:e.latest_stage?.name??"unknown",status:e.latest_stage?.status??"unknown",createdOn:e.created_on},o=e.deployment_trigger?.metadata?.branch;if(o)t.branch=o;return t}async function IL(e){return(await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`)).map((o)=>_(o))}async function Hb(e){let[t]=await IL(e);return t??null}async function RL(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await no({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let x=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:v,patched:D}=f(i,{adapter:x,slug:t.projectName});if(D)await n.writeFile("wrangler.jsonc",v)}}async function aA(e,t){let n=await A(t.accountId,t.projectName)??await I(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName};if(n.subdomain)i.productionUrl=`https://${n.subdomain}`;return await RL(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",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 without reading the row. 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:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",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="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary 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="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none","--jx-icon-size":"1em",marginBlockEnd:"-0.15em"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"step-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};E("panel-deploy-checklist",h);var d=null,c=null,s=null,r=null;function T(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function O(e){if(d!==e)return!1;return r===null?s!==null:r.root.parentNode===e}function y(e,t){if(O(e))return;m(),d=e;let o=g({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=me(),c.run(()=>{te(()=>{T(o,t.project())})});let n=R("panel-deploy-checklist",o,e);s=n,n.then((i)=>{if(s===n)r=i;else i.dispose()})}function m(){c?.stop(),c=null;let e=s;if(s=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function J(){return C?.projectConfig??null}function Ri(){return J()?.build?.deploy}var a=Wv({asked:!1,observed:null});function jd(e){a.observed=e,a.asked=!0}function DL(){return a.observed}function L(){let{status:e}=u.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function V(){let{status:e}=u.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function W(){let e=Ri();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return Zl()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function B(){if(!Ri())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!a.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(a.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=a;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function w(){return[L(),V(),W(),B()]}function nC(){return w().find((e)=>e.state!=="done")??null}function lA(){if(!C)return null;let e=nC();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:Ri()?.productionUrl??"Everything this project needs to ship is in place."}}var b={done:{icon:"check",label:"Done"},todo:{icon:"warning-circle",label:"To do"},unknown:{icon:"question",label:"Not checked yet"}};function H(e){return{icon:b[e.state].icon,iconLabel:b[e.state].label,id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function F(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ae(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function NL(){if(!C)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=w(),t=e.find((o)=>o.state!=="done")??null;return{...F(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>H(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function z(){let e=nC();if(!e)return;ae()?.run(e.command)}var M={project:NL,runAction:z};function cA(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){m();return}y(t,M)}
4
- export{Zl,sA,IL,Hb,RL,aA,Ri,jd,DL,nC,lA,NL,cA};
1
+ import{ae}from"./studio-q509sqt8.js";import{p}from"./studio-xh6rf05g.js";import{Mm}from"./studio-pv1ts08p.js";import{nr,u}from"./studio-1d8m5s38.js";import{x}from"./studio-zn7ysyzb.js";import{E,I}from"./studio-1a7zshnv.js";import{me,te,b,Gy}from"./studio-9f5vcb4w.js";import{Q}from"./studio-erjccagy.js";function j(e){return JSON.parse(e)}function k(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function C(e){try{let t=j(e);return k(t)?t:void 0}catch{return}}function P({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
2
+ `}function f(e,{slug:t,adapter:o}){if(!e)return{content:P({adapter:o,slug:t}),patched:!0};let n=C(e);if(n===void 0)return{content:e,patched:!1};if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
3
+ `,patched:!0}}function Xl(){try{return Q(p().cfApi)}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw Mm(n),n}}async function yO(){return l("/accounts")}async function A(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function _(e){let t={build_command:"bunx jx build",destination_dir:"dist"};if(e.rootDir)t.root_dir=e.rootDir;return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:t,source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}function N(e){let t={id:e.id,url:e.url,environment:e.environment,stage:e.latest_stage?.name??"unknown",status:e.latest_stage?.status??"unknown",createdOn:e.created_on},o=e.deployment_trigger?.metadata?.branch;if(o)t.branch=o;return t}async function H$(e){return(await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`)).map((o)=>N(o))}async function Wb(e){let[t]=await H$(e);return t??null}async function B$(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await nr({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let v=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:D,patched:S}=f(i,{adapter:v,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",D)}}async function vO(e,t){let n=await A(t.accountId,t.projectName)??await _(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName};if(n.subdomain)i.productionUrl=`https://${n.subdomain}`;return await B$(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",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 without reading the row. 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:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",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="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary 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="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none","--jx-icon-size":"1em",marginBlockEnd:"-0.15em"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"step-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};E("panel-deploy-checklist",h);var d=null,c=null,s=null,r=null;function O(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function J(e){if(d!==e)return!1;return r===null?s!==null:r.root.parentNode===e}function y(e,t){if(J(e))return;m(),d=e;let o=b({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=me(),c.run(()=>{te(()=>{O(o,t.project())})});let n=I("panel-deploy-checklist",o,e);s=n,n.then((i)=>{if(s===n)r=i;else i.dispose()})}function m(){c?.stop(),c=null;let e=s;if(s=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function L(){return x?.projectConfig??null}function Ii(){return L()?.build?.deploy}var a=Gy({asked:!1,observed:null});function jd(e){a.observed=e,a.asked=!0}function V$(){return a.observed}function V(){let{status:e}=u.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function W(){let{status:e}=u.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function R(){let e=Ii();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return Xl()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function B(){if(!Ii())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!a.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(a.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=a;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function w(){return[V(),W(),R(),B()]}function cC(){return w().find((e)=>e.state!=="done")??null}function wO(){if(!x)return null;let e=cC();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:Ii()?.productionUrl??"Everything this project needs to ship is in place."}}var g={done:{icon:"check",label:"Done"},todo:{icon:"warning-circle",label:"To do"},unknown:{icon:"question",label:"Not checked yet"}};function H(e){return{icon:g[e.state].icon,iconLabel:g[e.state].label,id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function F(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ae(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function W$(){if(!x)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=w(),t=e.find((o)=>o.state!=="done")??null;return{...F(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>H(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function z(){let e=cC();if(!e)return;ae()?.run(e.command)}var M={project:W$,runAction:z};function xO(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){m();return}y(t,M)}
4
+ export{Xl,yO,H$,Wb,B$,vO,Ii,jd,V$,cC,wO,W$,xO};
5
5
 
6
- //# debugId=AF8336C5EDFC6E0364756E2164756E21
7
- //# sourceMappingURL=studio-stahswgb.js.map
6
+ //# debugId=AFA30B143CC1799864756E2164756E21
7
+ //# sourceMappingURL=studio-qarg1xf9.js.map