@jxsuite/studio 10.2.0 → 10.4.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 (272) hide show
  1. package/dist/chunks/{2020-bx702wqa.js → 2020-906vx2dq.js} +3 -3
  2. package/dist/chunks/adapter-hnvad61x.js +4 -0
  3. package/dist/chunks/add-new-flow-v0pm96mr.js +4 -0
  4. package/dist/chunks/cf-account-picker-xb8vvt2h.js +4 -0
  5. package/dist/chunks/cf-settings-mkbcz4z2.js +4 -0
  6. package/dist/chunks/components-w5zqwva1.js +4 -0
  7. package/dist/chunks/content-source-g38w0d3f.js +4 -0
  8. package/dist/chunks/convert-to-repeater-r8sfxjjm.js +4 -0
  9. package/dist/chunks/editor-wvf5e6j9.js +4 -0
  10. package/dist/chunks/entry-commands-t13dyw3c.js +4 -0
  11. package/dist/chunks/extension-sections-vjzw46xb.js +4 -0
  12. package/dist/chunks/file-ops-1sghzgcr.js +4 -0
  13. package/dist/chunks/files-zrqtgt41.js +4 -0
  14. package/dist/chunks/format-host-9gy76erh.js +4 -0
  15. package/dist/chunks/fs-events-45rhg3me.js +4 -0
  16. package/dist/chunks/grid-open-t4fq6bbm.js +4 -0
  17. package/dist/chunks/{grid-view-tghcwrrt.js → grid-view-2f03wcgw.js} +16 -16
  18. package/dist/chunks/icons-gb967qc8.js +4 -0
  19. package/dist/chunks/iframe-host-9aq8ze3q.js +4 -0
  20. package/dist/chunks/image-bake-4afr4y6a.js +4 -0
  21. package/dist/chunks/image-editor-x7t8jbjn.js +4 -0
  22. package/dist/chunks/index-f9qr7kzh.js +4 -0
  23. package/dist/chunks/{index-vr006kbt.js → index-yjrfeks8.js} +3 -3
  24. package/dist/chunks/{javascript-z1g3s9fd.js → javascript-hy2mws8v.js} +3 -3
  25. package/dist/chunks/{jsonMode-7szwg8c4.js → jsonMode-vj30te2h.js} +6 -6
  26. package/dist/chunks/jx-validate-r4ax11e3.js +4 -0
  27. package/dist/chunks/layers-m49nmwvx.js +4 -0
  28. package/dist/chunks/layers-panel-zr92pwdp.js +4 -0
  29. package/dist/chunks/lit-html-k2mb9k0r.js +4 -0
  30. package/dist/chunks/media-library-j74rt0w4.js +4 -0
  31. package/dist/chunks/media-open-mypr0k6b.js +4 -0
  32. package/dist/chunks/media-picker-pemtbsjv.js +4 -0
  33. package/dist/chunks/{monaco-binding-v42w9c1v.js → monaco-binding-a51py33c.js} +3 -3
  34. package/dist/chunks/monaco-buffer-pa0g6ax7.js +4 -0
  35. package/dist/chunks/{monaco-setup-7bffxd6v.js → monaco-setup-0hw9f835.js} +3 -3
  36. package/dist/chunks/notify-bwehrp7q.js +4 -0
  37. package/dist/chunks/parse-hee7ne9b.js +4 -0
  38. package/dist/chunks/platform-kv0k65cy.js +4 -0
  39. package/dist/chunks/publish-panel-vg1n880b.js +4 -0
  40. package/dist/chunks/publish-quick-4fwngwrw.js +4 -0
  41. package/dist/chunks/publish-workspace-jv4w2bx2.js +4 -0
  42. package/dist/chunks/quick-search-nh29rt8a.js +4 -0
  43. package/dist/chunks/references-vqyr5s9x.js +4 -0
  44. package/dist/chunks/right-panel-3ws9f2w0.js +4 -0
  45. package/dist/chunks/source-control-h3hcs5gy.js +4 -0
  46. package/dist/chunks/{studio-j3d2fjqz.js → studio-0939t1q1.js} +4 -4
  47. package/dist/chunks/studio-0gvvqj3h.js +5 -0
  48. package/dist/chunks/studio-0khd8xtx.js +4 -0
  49. package/dist/chunks/{studio-9b7177jq.js → studio-0x6f3nk9.js} +4 -4
  50. package/dist/chunks/studio-1410q5dw.js +5 -0
  51. package/dist/chunks/studio-1ctnw3xv.js +5 -0
  52. package/dist/chunks/studio-1ks5d9y4.js +5 -0
  53. package/dist/chunks/{studio-awxwjawq.js → studio-1y9mab9m.js} +4 -4
  54. package/dist/chunks/studio-2e4hry72.js +6 -0
  55. package/dist/chunks/studio-2kpxm0eh.js +7 -0
  56. package/dist/chunks/studio-2pk7kc7z.js +5 -0
  57. package/dist/chunks/studio-2x972v58.js +5 -0
  58. package/dist/chunks/studio-2zz4qbv9.js +5 -0
  59. package/dist/chunks/{studio-bvs9kpst.js → studio-3na1r48j.js} +8 -8
  60. package/dist/chunks/studio-3pz4t5a2.js +5 -0
  61. package/dist/chunks/studio-3qr08sxq.js +4 -0
  62. package/dist/chunks/{studio-75kcdbsk.js → studio-45mj4jqe.js} +4 -4
  63. package/dist/chunks/studio-4bgvvzhv.js +5 -0
  64. package/dist/chunks/studio-4f7thq0p.js +5 -0
  65. package/dist/chunks/studio-4fnb5648.js +5 -0
  66. package/dist/chunks/studio-4zd6an2b.js +5 -0
  67. package/dist/chunks/{studio-9rbe2xpw.js → studio-5tet77de.js} +3 -3
  68. package/dist/chunks/studio-61rg2cz5.js +5 -0
  69. package/dist/chunks/{studio-ybnwymxw.js → studio-7rrdbvex.js} +4 -4
  70. package/dist/chunks/{studio-sxdb9h3q.js → studio-90zkgne5.js} +7 -7
  71. package/dist/chunks/studio-9c6cbq2c.js +4 -0
  72. package/dist/chunks/studio-9dq7rwc7.js +5 -0
  73. package/dist/chunks/studio-9gr7xs9r.js +6 -0
  74. package/dist/chunks/studio-a88ej93p.js +7 -0
  75. package/dist/chunks/{studio-er5f383a.js → studio-abh9kfdh.js} +4 -4
  76. package/dist/chunks/studio-acer0g8w.js +5 -0
  77. package/dist/chunks/{studio-qh8berdz.js → studio-amaz545p.js} +4 -4
  78. package/dist/chunks/studio-az3wvyh2.js +5 -0
  79. package/dist/chunks/studio-bg8pzprg.js +5 -0
  80. package/dist/chunks/{studio-399a25za.js → studio-bnc50f9h.js} +4 -4
  81. package/dist/chunks/studio-brh8d2pr.js +5 -0
  82. package/dist/chunks/{studio-646nn2ys.js → studio-c2fa783p.js} +5 -5
  83. package/dist/chunks/studio-cfnn70h1.js +5 -0
  84. package/dist/chunks/{studio-rzqaz21g.js → studio-cqxj4fcy.js} +4 -4
  85. package/dist/chunks/studio-cw11h078.js +5 -0
  86. package/dist/chunks/studio-daksw8kh.js +5 -0
  87. package/dist/chunks/studio-dn56z7sn.js +5 -0
  88. package/dist/chunks/studio-egnjpyde.js +9 -0
  89. package/dist/chunks/studio-ejrypvmq.js +5 -0
  90. package/dist/chunks/studio-eqcddvc2.js +928 -0
  91. package/dist/chunks/studio-evq47j2z.js +5 -0
  92. package/dist/chunks/{studio-r7pf0rkv.js → studio-frc16j8v.js} +7 -7
  93. package/dist/chunks/studio-g0hxtcga.js +5 -0
  94. package/dist/chunks/{studio-th7z3fg7.js → studio-g9brbewz.js} +4 -4
  95. package/dist/chunks/studio-gnazwtv3.js +5 -0
  96. package/dist/chunks/studio-hfqpfmpk.js +5 -0
  97. package/dist/chunks/studio-hh394phe.js +5 -0
  98. package/dist/chunks/{studio-pjtntksy.js → studio-j0zf5x2x.js} +4 -4
  99. package/dist/chunks/studio-j5fcp6gj.js +5 -0
  100. package/dist/chunks/studio-jd1qb1st.js +7 -0
  101. package/dist/chunks/studio-jma2q8r9.js +5 -0
  102. package/dist/chunks/studio-k0xzrse2.js +64 -0
  103. package/dist/chunks/studio-k1xqrgm5.js +5 -0
  104. package/dist/chunks/studio-k2evngrj.js +7 -0
  105. package/dist/chunks/studio-k3we3kqb.js +5 -0
  106. package/dist/chunks/studio-knsjyx7n.js +5 -0
  107. package/dist/chunks/studio-mrjtnm62.js +5 -0
  108. package/dist/chunks/{studio-sevbc3xv.js → studio-n9qba0gx.js} +4 -4
  109. package/dist/chunks/{studio-ea74s8c1.js → studio-nvcn2ykc.js} +4 -4
  110. package/dist/chunks/studio-nwf0c32p.js +5 -0
  111. package/dist/chunks/studio-nzemfbkk.js +14 -0
  112. package/dist/chunks/{studio-43y04qck.js → studio-pj216fmn.js} +4 -4
  113. package/dist/chunks/{studio-4g8yb6jn.js → studio-pm17wdc4.js} +4 -4
  114. package/dist/chunks/studio-pwctzka3.js +16 -0
  115. package/dist/chunks/{studio-71m92v9s.js → studio-q80fg1d6.js} +7 -7
  116. package/dist/chunks/studio-q9hx2qp0.js +5 -0
  117. package/dist/chunks/studio-qrzmfaf6.js +5 -0
  118. package/dist/chunks/{studio-86r8hp7r.js → studio-r6mx7vm5.js} +5 -5
  119. package/dist/chunks/studio-rr00ex23.js +7 -0
  120. package/dist/chunks/{studio-4jhw38b2.js → studio-s24mhq0z.js} +4 -4
  121. package/dist/chunks/studio-sce30r7b.js +4 -0
  122. package/dist/chunks/studio-swedpd82.js +5 -0
  123. package/dist/chunks/studio-tmfcn347.js +6 -0
  124. package/dist/chunks/studio-tpxcryf2.js +5 -0
  125. package/dist/chunks/{studio-wc6za3zs.js → studio-v5wktj6f.js} +4 -4
  126. package/dist/chunks/studio-v7a7yb5w.js +9 -0
  127. package/dist/chunks/{studio-kg1abnz0.js → studio-vpevkfxw.js} +4 -4
  128. package/dist/chunks/{studio-881z1xrx.js → studio-wmjmsw0p.js} +4 -4
  129. package/dist/chunks/studio-wqfaqw4m.js +5 -0
  130. package/dist/chunks/{studio-hhp4x8xf.js → studio-xpx91fby.js} +5 -5
  131. package/dist/chunks/studio-xva3hzkv.js +5 -0
  132. package/dist/chunks/{studio-6hzdjfv0.js → studio-xx3r3sb0.js} +4 -4
  133. package/dist/chunks/{studio-cg1bfyhf.js → studio-z3fztxrp.js} +8 -8
  134. package/dist/chunks/studio-z9453ypn.js +6 -0
  135. package/dist/chunks/{tsMode-f54j66ym.js → tsMode-jg1dtphj.js} +7 -7
  136. package/dist/chunks/workspace-6ztqcrsh.js +4 -0
  137. package/dist/chunks/workspace-home-rse9h8a0.js +4 -0
  138. package/dist/chunks/{ws-client-e8kj684q.js → ws-client-arz2qsy9.js} +3 -3
  139. package/dist/iframe-entry.js +13 -13
  140. package/dist/manifest.json +83 -78
  141. package/dist/studio.js +84 -84
  142. package/package.json +11 -11
  143. package/src/browse/library-pane.ts +44 -29
  144. package/src/browse/library-preview.ts +6 -2
  145. package/src/canvas/asset-refs.ts +13 -4
  146. package/src/canvas/asset-resolve.ts +54 -11
  147. package/src/canvas/canvas-render.ts +25 -0
  148. package/src/canvas/iframe-entry.ts +5 -1
  149. package/src/canvas/iframe-host.ts +16 -6
  150. package/src/canvas/iframe-protocol.ts +9 -1
  151. package/src/commands/context.ts +5 -0
  152. package/src/commands/live-context.ts +5 -2
  153. package/src/editor/shortcuts.ts +3 -0
  154. package/src/files/asset-versions.ts +108 -2
  155. package/src/files/file-ops.ts +11 -1
  156. package/src/files/files.ts +111 -48
  157. package/src/files/media-paths.ts +12 -4
  158. package/src/files/media-upload.ts +195 -21
  159. package/src/files/new-file-name.ts +39 -1
  160. package/src/media/image-bake.ts +164 -0
  161. package/src/media/image-editor.ts +846 -0
  162. package/src/media/image-format.ts +262 -0
  163. package/src/media/image-recipe.ts +651 -0
  164. package/src/media/media-commands.ts +65 -1
  165. package/src/media/media-library-model.ts +1 -1
  166. package/src/media/media-library.ts +175 -15
  167. package/src/media/media-open.ts +156 -3
  168. package/src/media/media-pane.ts +8 -4
  169. package/src/panels/pane-context.ts +6 -1
  170. package/src/panels/tab-strip.ts +12 -3
  171. package/src/studio.ts +13 -2
  172. package/src/surfaces/image-editor.json +1390 -0
  173. package/src/surfaces/image-editor.ts +272 -0
  174. package/src/surfaces/inspector-dock.json +3 -3
  175. package/src/surfaces/media-library.json +129 -1
  176. package/src/surfaces/media-library.ts +17 -2
  177. package/src/types.ts +2 -1
  178. package/src/workspace/tab-workspace.ts +2 -1
  179. package/src/workspace/workspace-switch.ts +3 -1
  180. package/src/workspace/workspace.ts +22 -1
  181. package/dist/chunks/adapter-pp011m5x.js +0 -4
  182. package/dist/chunks/add-new-flow-ecqmzz76.js +0 -4
  183. package/dist/chunks/cf-account-picker-c07znkqt.js +0 -4
  184. package/dist/chunks/cf-settings-0v2bmqy0.js +0 -4
  185. package/dist/chunks/components-yn0dn2pq.js +0 -4
  186. package/dist/chunks/content-source-g0j41yy6.js +0 -4
  187. package/dist/chunks/convert-to-repeater-sbjk7tgn.js +0 -4
  188. package/dist/chunks/editor-xz02jeh1.js +0 -4
  189. package/dist/chunks/entry-commands-kmt02crp.js +0 -4
  190. package/dist/chunks/extension-sections-0rprf12d.js +0 -4
  191. package/dist/chunks/file-ops-mexj5qed.js +0 -4
  192. package/dist/chunks/files-b2tcppdd.js +0 -4
  193. package/dist/chunks/format-host-btsevv0c.js +0 -4
  194. package/dist/chunks/fs-events-r0apejva.js +0 -4
  195. package/dist/chunks/grid-open-n2a8xkht.js +0 -4
  196. package/dist/chunks/icons-853n6qt3.js +0 -4
  197. package/dist/chunks/iframe-host-gx0ypyh3.js +0 -4
  198. package/dist/chunks/index-bs4k9tr6.js +0 -4
  199. package/dist/chunks/jx-validate-ymf10teh.js +0 -4
  200. package/dist/chunks/layers-p9nfya38.js +0 -4
  201. package/dist/chunks/layers-panel-tt1hzhhf.js +0 -4
  202. package/dist/chunks/lit-html-x18n2sfz.js +0 -4
  203. package/dist/chunks/media-library-0n45gv8r.js +0 -4
  204. package/dist/chunks/media-picker-s09at95z.js +0 -4
  205. package/dist/chunks/monaco-buffer-een2ea0v.js +0 -4
  206. package/dist/chunks/notify-qwb8radt.js +0 -4
  207. package/dist/chunks/parse-v77xtwv7.js +0 -4
  208. package/dist/chunks/platform-8jnez0wr.js +0 -4
  209. package/dist/chunks/publish-panel-aysnj611.js +0 -4
  210. package/dist/chunks/publish-quick-kpbqs9mz.js +0 -4
  211. package/dist/chunks/publish-workspace-nd0a8q99.js +0 -4
  212. package/dist/chunks/quick-search-vg0jkhk2.js +0 -4
  213. package/dist/chunks/references-a7v6a0e2.js +0 -4
  214. package/dist/chunks/right-panel-cvk1vxx5.js +0 -4
  215. package/dist/chunks/source-control-fsqzc6he.js +0 -4
  216. package/dist/chunks/studio-05jfwbmf.js +0 -5
  217. package/dist/chunks/studio-0q5jwddh.js +0 -9
  218. package/dist/chunks/studio-0w2dr0q8.js +0 -5
  219. package/dist/chunks/studio-1tzpds97.js +0 -9
  220. package/dist/chunks/studio-216b27sv.js +0 -4
  221. package/dist/chunks/studio-2ejhqns4.js +0 -5
  222. package/dist/chunks/studio-2r90cts3.js +0 -16
  223. package/dist/chunks/studio-399xknkb.js +0 -6
  224. package/dist/chunks/studio-4ncmwqw5.js +0 -5
  225. package/dist/chunks/studio-5atwjgkj.js +0 -7
  226. package/dist/chunks/studio-5frqk7c0.js +0 -5
  227. package/dist/chunks/studio-6cwj6xrx.js +0 -5
  228. package/dist/chunks/studio-78pywnp2.js +0 -6
  229. package/dist/chunks/studio-886t6ztg.js +0 -5
  230. package/dist/chunks/studio-8wnvtr4z.js +0 -5
  231. package/dist/chunks/studio-8z66jk4z.js +0 -5
  232. package/dist/chunks/studio-b2qpt0xy.js +0 -14
  233. package/dist/chunks/studio-c71806xz.js +0 -7
  234. package/dist/chunks/studio-cbwks69x.js +0 -928
  235. package/dist/chunks/studio-cg710sk9.js +0 -5
  236. package/dist/chunks/studio-cw0wb9qk.js +0 -7
  237. package/dist/chunks/studio-cyheys7k.js +0 -5
  238. package/dist/chunks/studio-ea5m9kg5.js +0 -5
  239. package/dist/chunks/studio-efdxjwyp.js +0 -64
  240. package/dist/chunks/studio-egmw2837.js +0 -5
  241. package/dist/chunks/studio-f746039f.js +0 -5
  242. package/dist/chunks/studio-fmdymd9v.js +0 -5
  243. package/dist/chunks/studio-gcm12z00.js +0 -6
  244. package/dist/chunks/studio-gj98m8gy.js +0 -7
  245. package/dist/chunks/studio-hasbgjah.js +0 -5
  246. package/dist/chunks/studio-hz5n7x27.js +0 -5
  247. package/dist/chunks/studio-jeraxdgv.js +0 -7
  248. package/dist/chunks/studio-jvgek9xt.js +0 -5
  249. package/dist/chunks/studio-jws1a87n.js +0 -5
  250. package/dist/chunks/studio-k2sz13zg.js +0 -5
  251. package/dist/chunks/studio-k3m4jkdk.js +0 -5
  252. package/dist/chunks/studio-kg5ya5r2.js +0 -5
  253. package/dist/chunks/studio-khwbgrtg.js +0 -5
  254. package/dist/chunks/studio-mx6wzh25.js +0 -5
  255. package/dist/chunks/studio-mxs3ar9t.js +0 -5
  256. package/dist/chunks/studio-nm4szey4.js +0 -5
  257. package/dist/chunks/studio-nqxqf8p2.js +0 -4
  258. package/dist/chunks/studio-qn7z4krm.js +0 -5
  259. package/dist/chunks/studio-qyed0ah6.js +0 -5
  260. package/dist/chunks/studio-r4bcdwhq.js +0 -5
  261. package/dist/chunks/studio-rtfnhrdg.js +0 -5
  262. package/dist/chunks/studio-s5tzw84t.js +0 -5
  263. package/dist/chunks/studio-t51y8v1d.js +0 -5
  264. package/dist/chunks/studio-t98vq4r6.js +0 -5
  265. package/dist/chunks/studio-tsxpqvh0.js +0 -6
  266. package/dist/chunks/studio-v1yascv2.js +0 -5
  267. package/dist/chunks/studio-wxq6v5sv.js +0 -5
  268. package/dist/chunks/studio-y60sts62.js +0 -4
  269. package/dist/chunks/studio-zndrqawb.js +0 -5
  270. package/dist/chunks/studio-zwaxn5s2.js +0 -5
  271. package/dist/chunks/workspace-home-x1787wpv.js +0 -4
  272. package/dist/chunks/workspace-zpe1np43.js +0 -4
@@ -1,16 +0,0 @@
1
- import{Q}from"./studio-nqxqf8p2.js";import{p}from"./studio-jws1a87n.js";import{ge,ne,Kr,Jr,g,de,pM,C}from"./studio-y60sts62.js";import{Pn,yx,ln,go,vC,Wp,xx,A$,an,lv,Hm,Hi,Vn,Ce,pi,Lo,Y,fi,Vm,m,kr,ec,Pt}from"./studio-k2sz13zg.js";import{rf}from"./studio-hz5n7x27.js";import{rt,Eo,xr}from"./studio-th7z3fg7.js";import{S,ed,wn}from"./studio-cg710sk9.js";import{n,Z,Ze,Iv,ee,_,v}from"./studio-8z66jk4z.js";import{le}from"./studio-j3d2fjqz.js";function F(e){return e.replaceAll("~","~0").replaceAll("/","~1")}var Ve=100;function H(e){let t={blankAfter:new Set,escaped:new Map,inline:new Map},o=0,r=()=>{let l=0;while(o<e.length&&(e[o]===" "||e[o]==="\t"||e[o]==="\r"||e[o]===`
2
- `)){if(e[o]===`
3
- `)l+=1;o+=1}return l},s=()=>{let l=o,f=new Set;o+=1;while(o<e.length&&e[o]!=='"')if(e[o]==="\\")if(e[o+1]==="u"){let b=Number.parseInt(e.slice(o+2,o+6),16);if(b>=128)f.add(b);o+=6}else o+=2;else o+=1;return o+=1,{escaped:f,raw:e.slice(l,o)}},i=(l,f)=>{let b=r();if(e[o]===f)return o+=1,!0;if(o+=1,b+=r(),b>=2)t.blankAfter.add(l);return!1},a=(l)=>{r();let f=e[o];if(f==="{"){o+=1;let b=r()>0;if(e[o]==="}"){o+=1;return}t.inline.set(l,!b);while(o<e.length){let c=JSON.parse(s().raw);r(),o+=1;let d=`${l}/${F(c)}`;if(a(d),i(d,"}"))return}}else if(f==="["){if(o+=1,r(),e[o]==="]"){o+=1;return}for(let b=0;o<e.length;b+=1){let c=`${l}/${b}`;if(a(c),i(c,"]"))return}}else if(f==='"'){let{escaped:b}=s();if(b.size>0)t.escaped.set(l,b)}else while(o<e.length&&!`,]} \r
4
- `.includes(e[o]))o+=1};return a(""),t}function Es(e){return{document:JSON.parse(e),layout:H(e)}}var He=/[^\u0020-\u007E]/,Ge=/^[\p{Mn}\p{Me}\p{Cf}]$/u,Ke=/^\p{Emoji_Presentation}$/u;function qe(e){return e>=4352&&(e<=4447||e===9001||e===9002||e>=11904&&e<=12871&&e!==12351||e>=12880&&e<=19903||e>=19968&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510||e>=110592&&e<=110593||e>=127488&&e<=127569||e>=131072&&e<=262141)}function be(e){if(!He.test(e))return e.length;let t=0;for(let o of e){if(Ge.test(o))continue;t+=qe(o.codePointAt(0))||Ke.test(o)?2:1}return t}function he(e){return e===void 0||ee(e)||Iv(e)}function U(e){return Object.entries(e).filter(([,t])=>!he(t))}function M(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ye(e){if(e.length<2)return!1;let t=Array.isArray(e[0])?"array":M(e[0])?"object":null;if(t===null)return!1;return e.every((o)=>t==="array"?Array.isArray(o)&&o.length>1:M(o)&&U(o).length>1)}function Xe(e){return e.length>1&&e.every((t)=>Z(t))}function V(e,t){let o=he(e)?"null":JSON.stringify(e);return t===void 0?o:o.replaceAll(/[\u0080-\uFFFF]/g,(r)=>{let s=r.codePointAt(0);return t.has(s)?`\\u${s.toString(16).padStart(4,"0")}`:r})}function Co(e,t,o=Ve){let r=t?.inline??new Map,s=t?.blankAfter??new Set,i=t?.escaped??new Map,a=(c,d)=>r.get(c)??d,l=(c,d,h)=>{if(Array.isArray(c)){if(c.length===0)return"[]";if(Ye(c))return null;let y=[];for(let[x,P]of c.entries()){let T=`${d}/${x}`,w=s.has(T)?null:l(P,T,h);if(w===null)return null;y.push(w)}return`[${y.join(", ")}]`}if(M(c)){let y=U(c);if(y.length===0)return"{}";if(!a(d,h))return null;let x=[];for(let[P,T]of y){let w=`${d}/${F(P)}`,E=s.has(w)?null:l(T,w,!0);if(E===null)return null;x.push(`${JSON.stringify(P)}: ${E}`)}return`{ ${x.join(", ")} }`}return V(c,i.get(d))},f=(c)=>c.map(({path:d,text:h},y)=>y===c.length-1?h:`${h},
5
- ${s.has(d)?`
6
- `:""}`).join(""),b=(c,d,h,y,x,P)=>{if(!Array.isArray(c)&&!M(c))return V(c,i.get(d));let T=l(c,d,x);if(T!==null&&y+be(T)+P<=o)return T;let w=" ".repeat(h+2),E=`
7
- ${" ".repeat(h)}`;if(Array.isArray(c)){if(Xe(c))return`[
8
- ${Qe(c,w,o,(A)=>s.has(`${d}/${A}`))}${E}]`;let L=c.map((R,A)=>{let O=`${d}/${A}`,J=A===c.length-1,z=b(R,O,h+2,w.length,x,J?0:1);return{path:O,text:`${w}${z}`}});return`[
9
- ${f(L)}${E}]`}let me=U(c),Be=a(d,x),ze=me.map(([L,R],A)=>{let O=`${d}/${F(L)}`,J=`${JSON.stringify(L)}: `,z=A===me.length-1,Fe=w.length+be(J),Ue=b(R,O,h+2,Fe,Be,z?0:1);return{path:O,text:`${w}${J}${Ue}`}});return`{
10
- ${f(ze)}${E}}`};return`${b(e,"",0,0,!1,0)}
11
- `}function Qe(e,t,o,r){let s=[],i="";for(let[a,l]of e.entries()){let f=`${V(l)}${a===e.length-1?"":","}`;if(i==="")i=`${t}${f}`;else if(i.length+1+f.length<=o)i=`${i} ${f}`;else s.push(i),i=`${t}${f}`;if(r(a)&&a<e.length-1)s.push(i,""),i=""}return s.push(i),s.join(`
12
- `)}function Tm(e){return Co(e,we())}var k=null,j=null,N=null,I=null;function we(){return ve()?.doc.layout??I}var G=null;function ve(){let e=m.tabs.get(an);return e?de(e):null}function et(){if(j)Hm(j),j=null;k=null,N=null,I=null,G=null}function xe(){return G??=(async()=>{try{let e=await p().readFile(an),{document:t,layout:o}=Es(e);I=o,N=Co(t,we())}catch{N=null}})(),G}async function zL(e){if(await xe(),e.doc.layout===null&&I!==null)e.doc.layout=I}function tt(e){let t=wn();if(t.projectConfig===e)return;ed({...t,projectConfig:e}),ec(m.projectRoot,e)}function ot(){let e=S?.projectConfig;return e?de(e):null}function K(e){return de(e)}function Pe(e,t){for(let o of Object.keys(e))delete e[o];Object.assign(e,t)}function Se(e){return k=e,e.scope.run(()=>{ne(()=>{let t=e.doc.document;if(k!==e||!S)return;tt(K(t))})}),e}function XS(){let e=wn(),t=ve();if(k&&(k!==(t??j)||de(k.doc.document)!==e.projectConfig))et();if(k)return k;if(t)return Se(t);return j=lv({document:e.projectConfig??{},documentPath:an,id:an}),Se(j)}function ye(e){return JSON.stringify(e.extensions??null)}async function nt(){let{loadFormats:e,refreshExtensionUi:t,refreshFormats:o}=await (le("btsevv0c"),import("./format-host-btsevv0c.js"));o(),e(),t(p())}async function Yl(e){let t=ot(),o=XS();await zL(o);let r=K(o.doc.document),s=Tm(r),i=t&&t!==r&&Tm(t)!==s?t:null;if(i&&o.doc.dirty){let h=Error(`${an} has unsaved changes in its editor tab`);return C.error(`Could not save ${an} — the file is open with unsaved changes. Save or `+"revert that tab, then make the settings change again.",{key:`save:${an}`,path:an,source:"Settings"}),{error:h,ok:!1}}let a=i??r,l=e?{...a,...e}:a,f=Tm(l);if(!i&&!o.doc.dirty&&f===N)return{ok:!0};let b=ye(r);Y(o,(h)=>{let y=h.doc.document;if(i)Pe(y,i);for(let[x,P]of Object.entries(e??{}))y[x]=P});let c=K(o.doc.document),d=Tm(c);try{await p().writeFile(an,d)}catch(h){return C.error(`Could not save ${an} — ${Q(h)}`,{key:`save:${an}`,path:an,source:"Settings"}),{error:h,ok:!1}}if(N=d,o.doc.dirty=!1,ye(c)!==b)await nt();return{ok:!0}}async function nA(e,t){if(!S){ec(m.projectRoot,e);return}let o=XS();Y(o,(r)=>Pe(r.doc.document,e),{skipHistory:!0}),o.doc.dirty=!1,await xe(),I=H(t),o.doc.layout=I,N=Tm(e)}function to(e){let t=S?.projectConfig?.$media;if(!t)return e||{};if(!e)return{...t};return{...t,...e}}function wr(e){let t=S?.projectConfig?.style;if(!t)return e||{};if(!e)return{...t};let o={...t};for(let[r,s]of Object.entries(e)){let i=o[r];o[r]=_(s)&&_(i)?{...i,...s}:s}return o}function iA(e,t=[]){return{...WL(t),...S?.projectConfig?.imports,...e}}function WL(e){let t=e.flatMap((o)=>(o.classes??[]).filter((r)=>r.path.endsWith(".class.json")).map((r)=>[r.name,r.path]));return Object.fromEntries(t.toReversed())}function Xw(e){let t=S?.projectConfig?.$elements;if(!t?.length)return e||[];if(!e?.length)return[...t];let o=new Set,r=[];for(let s of[...t,...e]){let i=n(s)?s:_(s)?s.$ref:void 0;if(i&&!o.has(i))o.add(i),r.push(s)}return r}function Qw(e){let t=S?.projectConfig?.$head;if(!t?.length)return e||[];if(!e?.length)return[...t];let o=new Set,r=[];for(let s of[...t,...e]){let i=_(s)?s.attributes:void 0,a=String(i?.href||i?.src||"")||JSON.stringify(s);if(!o.has(a))o.add(a),r.push(s)}return r}function Ts(){let e=S?.projectConfig;return e?ln(e).i18n:null}function Rp(e,t){let o=Ts();if(o===null)return null;let r=Pn(e);if(r!==null&&o.locales.includes(r))return r;return go(t??"",o)??o.defaultLocale}var q=new Map;function oA(){q.clear()}function sl(e){if(e===!1)return null;let t=S?.projectConfig?.defaults?.layout;return e||t||null}async function ex(e){let t=e.replace(/^\.\//,""),o=q.get(t);if(o!==void 0)return structuredClone(o);try{let s=await p().readFile(t),i=JSON.parse(s);return q.set(t,i),structuredClone(i)}catch{return null}}function VL(e,t){let o=t.children??[],r=Array.isArray(o)?o:[],s=new Map,i=[];for(let a of r){let l=n(a)?void 0:a.attributes?.slot;if(!n(a)&&n(l)&&l){if(!s.has(l))s.set(l,[]);s.get(l).push(a)}else i.push(a)}if(Te(e,s,i),t.state)e.state={...e.state,...t.state};if(t.$media)e.$media={...e.$media,...t.$media};if(t.style)e.style={...e.style,...t.style};if(t.attributes)e.attributes={...e.attributes,...t.attributes};return e}function Te(e,t,o){if(!Array.isArray(e.children))return;let r=[];for(let s of e.children)if(_(s)&&s.tagName==="slot"){let i=s.attributes?.name;if(n(i)&&i&&t.has(i))r.push(...t.get(i)),t.delete(i);else if(!i&&o.length>0)r.push(...o);else if(Array.isArray(s.children))r.push(...s.children)}else{if(_(s))Te(s,t,o);r.push(s)}e.children=r}async function no(e){let t=await Yl(e);if(!t.ok)throw t.error}var ke=new Set([fi,Vm]),it=new Set(["auto","light","dark"]);function st(e){return n(e)&&it.has(e)}function at(e){let{ui:t}=e.session;return{activeMedia:t.activeMedia,canvasMode:t.canvasMode,editZoom:t.editZoom,preview:t.preview,previewColorScheme:t.previewColorScheme,previewLocale:t.previewLocale,showLayout:t.showLayout,zoom:t.zoom}}function Ie(){let e={},t=[];for(let o of m.panes){if(o.derived)continue;let r=[];for(let i of o.tabOrder){let a=m.tabs.get(i);if(!a?.documentPath)continue;r.push(a.documentPath),e[a.documentPath]=at(a)}if(r.length===0)continue;let s=o.activeTabId?m.tabs.get(o.activeTabId):null;t.push({activeFile:s?.documentPath??null,files:r,id:o.id})}return{focusedPane:m.activePaneId,panes:t,ui:e}}function lt(e){if(!v(e))return{};let t={};if(n(e.canvasMode))t.canvasMode=e.canvasMode;if(Ze(e.preview))t.preview=e.preview;if(Z(e.zoom)&&Number.isFinite(e.zoom))t.zoom=e.zoom;if(Z(e.editZoom)&&Number.isFinite(e.editZoom))t.editZoom=e.editZoom;if(e.activeMedia===null||n(e.activeMedia))t.activeMedia=e.activeMedia;if(st(e.previewColorScheme))t.previewColorScheme=e.previewColorScheme;if(e.previewLocale===null||n(e.previewLocale)&&yx(e.previewLocale))t.previewLocale=e.previewLocale;if(Ze(e.showLayout))t.showLayout=e.showLayout;return t}function _e(e){if(!v(e)||!Array.isArray(e.panes))return null;let t=[];for(let r of e.panes){if(!v(r)||!n(r.id)||!ke.has(r.id))continue;let s=Array.isArray(r.files)?r.files.filter((i)=>n(i)&&i!==""):[];if(s.length===0)continue;t.push({activeFile:n(r.activeFile)&&s.includes(r.activeFile)?r.activeFile:null,files:s,id:r.id})}if(t.length===0)return null;let o={};if(_(e.ui))for(let[r,s]of Object.entries(e.ui))o[r]=lt(s);return{focusedPane:n(e.focusedPane)&&ke.has(e.focusedPane)?e.focusedPane:fi,panes:t,ui:o}}async function rA(e,t){let o=0;if(e.panes.some((i)=>i.id===Vm))t.ensureSecondPane();for(let i of e.panes)for(let a of i.files){try{await t.openFile(a,i.id)}catch{}if([...m.tabs.values()].some((l)=>l.documentPath===a))o+=1}if(o===0)return 0;for(let i of m.tabs.values()){let a=i.documentPath?e.ui[i.documentPath]:void 0;if(!a)continue;let{ui:l}=i.session;if(a.canvasMode&&i.capabilities.modes.includes(a.canvasMode))l.canvasMode=a.canvasMode;if(a.preview!==void 0)l.preview=a.preview;if(a.zoom!==void 0)l.zoom=a.zoom;if(a.editZoom!==void 0)l.editZoom=a.editZoom;if(a.activeMedia!==void 0)l.activeMedia=a.activeMedia;if(a.previewColorScheme!==void 0)l.previewColorScheme=a.previewColorScheme;if(a.previewLocale!==void 0)l.previewLocale=a.previewLocale;if(a.showLayout!==void 0)l.showLayout=a.showLayout}let r=m.panes.some((i)=>i.id===e.focusedPane)?e.focusedPane:null,s=null;for(let i of e.panes){let a=m.panes.find((f)=>f.id===i.id);if(!a||!i.activeFile)continue;let l=a.tabOrder.find((f)=>m.tabs.get(f)?.documentPath===i.activeFile);if(!l)continue;if(a.id===r)s=l;else Pt(l,{focus:!1})}if(s)Pt(s);else if(r)kr(r);return o}var Lm=["review","deploys","branches","hosting"],QS={branches:"Branches",deploys:"Deploys",hosting:"Hosting",review:"Review changes"},ct=["live","review"],Ee="review",Ae="live",ut=new Set(Lm),pt=new Set(ct);function sA(e){return typeof e==="string"&&ut.has(e)}function tx(e){return typeof e==="string"&&pt.has(e)}var ft={default:{description:"Resume whatever was persisted — layout, recents, settings, chat history.",id:"default",reset:"none"},fresh:{description:"A first-run app: no layout, no recents, no settings, no history.",id:"fresh",reset:"app-state"}},je=new Map(Object.entries(ft)),dt="default",mt=/^jx[-._:]/;function gt(e){return mt.test(e)}function bt(){let e=typeof localStorage>"u"?void 0:localStorage;if(!e)return[];let t=[];try{for(let o=0;o<e.length;o++){let r=e.key(o);if(r&&gt(r))t.push(r)}for(let o of t)e.removeItem(o)}catch{}return t}function ht(e){let t=je.get(e);if(!t)throw RangeError(`unknown startup profile "${e}"; declared: ${[...je.keys()].join(", ")}`);if(t.reset==="app-state")bt();return t}var W=null;function Ne(e){if(W)return W;let t=new URLSearchParams(e??(typeof location>"u"?"":location.search)),o=ht(t.get("profile")??dt),r=t.get("clock");return W={clock:r===null?null:pM(r),profile:o},W}var B=["site","collections","styles","files","search","i18n","layers","data","packages","insert"],St=new Set(["collections","styles"]);function De(e){return e&&!St.has(e)?e:wt}var yt=new Map([["blocks","insert"],["head","site"],["page","site"],["imports","packages"],["git","site"],["state","data"]]),wt="site";function eC(e,t){let o=B.find((r)=>r===e);if(o===void 0)throw Error(`${t}: "${e}" is not a declared Navigator panel id.`);return o}function se(e){if(!n(e))return null;let t=yt.get(e);if(t)return t;return B.find((o)=>o===e)??null}var oe=["page","properties","style","events","assistant"],nx="page",vt=["properties","style","events"],tC="properties";function ix(e){return typeof e==="string"&&vt.some((t)=>t===e)}function UL(e){return typeof e==="string"&&oe.some((t)=>t===e)}var ox=["problems","logic","activity"],qL="problems";function GL(e){return typeof e==="string"&&ox.some((t)=>t===e)}var rx=["light","dark"],zc={content:{id:"content",inspector:{open:!1,whileWriting:!0},navigator:{open:!0,panel:"collections"},rail:!1,tabStrip:!0},design:{id:"design",inspector:{open:!0},navigator:{initial:"site",open:!0},rail:!0,tabStrip:!0},media:{id:"media",inspector:{open:!1},navigator:{open:!1},rail:!1,tabStrip:!1},publish:{id:"publish",inspector:{open:!1},navigator:{open:!1},rail:!1,tabStrip:!1},settings:{id:"settings",inspector:{open:!1},navigator:{open:!1},rail:!1,tabStrip:!1},styles:{id:"styles",inspector:{open:!1,tab:"style",whileWriting:!0},navigator:{open:!0,panel:"styles"},rail:!1,tabStrip:!1}},Le="jx-studio-panel-widths",Re="jx-studio-project::",xt="dark";function KL(e){return typeof e==="string"&&rx.some((t)=>t===e)}function Tt(){let e=Eo(rt.theme);return KL(e)?e:xt}var sx=["left","right","bottom"],D={bottom:{collapsed:!0,size:220},left:{collapsed:!1,size:240},right:{collapsed:!1,size:280}},aA={bottom:D.bottom.size,left:D.left.size,right:D.right.size},kt={bottom:"--dock-h-bottom",left:"--panel-w-left",right:"--panel-w-right"},It={bottom:"bottom-collapsed",left:"left-collapsed",right:"right-collapsed"},JL=0.5,nC=0.2,iC=0.8;function _t(e){return Z(e)&&e>=nC&&e<=iC?e:JL}function lA(e){u.paneSplit=Math.min(iC,Math.max(nC,e))}function Et(){try{let e=JSON.parse(localStorage.getItem(Le)||"{}");return v(e)?e:{}}catch{return{}}}function Ct(e){return{left:e("left"),right:e("right"),bottom:e("bottom")}}function $e(){return{branches:null,commitMessage:"",diffState:null,error:null,lastUpdated:null,loading:!1,logEntries:null,rev:0,status:null}}function Je(){return{build:{for:"",state:"idle",text:""},deploys:{error:"",project:"",rows:[],state:"idle"},destination:Ae,review:{number:0,url:""},tab:Ee}}var At="tokens";function Me(){return{customizedOnly:!1,filter:"",selection:null,variable:null,view:At}}function jt(){let e=Et(),t=Ct((o)=>{let r=e[o],s=e[`${o}Collapsed`];return{collapsed:Ze(s)?s:D[o].collapsed,size:Z(r)&&r>0?r:D[o].size}});return{bottomTab:GL(e.bottomTab)?e.bottomTab:qL,docks:t,focusRegion:"pane",paneSplit:_t(e.paneSplit),git:$e(),publish:Je(),layoutSelection:null,leftTab:De(se(e.leftTab)),stylebook:Me(),theme:Tt(),workspace:Wp}}Ne();var Nt=["jx-studio-doc-header-expanded"];function Ot(){try{for(let e of Nt)localStorage.removeItem(e)}catch{}}Ot();var u=g(jt());function Md(){try{localStorage.setItem(Le,JSON.stringify({bottom:u.docks.bottom.size,bottomCollapsed:u.docks.bottom.collapsed,bottomTab:u.bottomTab,left:u.docks.left.size,leftCollapsed:u.docks.left.collapsed,leftTab:u.leftTab,paneSplit:u.paneSplit,right:u.docks.right.size,rightCollapsed:u.docks.right.collapsed}))}catch{}}var re,ae={},ce=null;function cA(){return ce}function ue(e){if(!e)return{};try{let t=JSON.parse(localStorage.getItem(`${Re}${e}`)||"{}");return v(t)?t:{}}catch{return{}}}function YL(e){let t=ue(e).workspace;return A$(t)?t:Wp}function dA(e){return _e(ue(e).session)}var pe=null;function ax(e){pe=e}function uA(){fe()}function fe(){let e=m.projectRoot;if(!e)return;try{localStorage.setItem(`${Re}${e}`,JSON.stringify({session:e===pe?Ie():ue(e).session,workspace:u.workspace}))}catch{}}function Dt(e){if(e===re)return;if(re=e,ae={},ce=null,u.workspace=YL(e),e===null){u.leftTab=De(se(u.leftTab));return}Kr();try{We(u.workspace),Md()}finally{Jr()}}function ZL(e,t){let{inspector:o}=zc[e];return o.open||o.whileWriting===!0&&t}function We(e,t){let o=zc[e],r=se(o.navigator.panel??ae[e]??o.navigator.initial??u.leftTab);if(r)u.leftTab=r;if(u.docks.left.collapsed=!o.navigator.open,u.docks.right.collapsed=!ZL(e,t?.writingOnCanvas?.()===!0),o.inspector.tab&&t)t.setInspectorTab(o.inspector.tab)}function oC(e,t){if(u.workspace===e)return!1;if(!zc[u.workspace].navigator.panel)ae[u.workspace]=u.leftTab;return ce=u.workspace,u.workspace=e,We(e,t),Md(),fe(),!0}function $m(e=u.theme){return e==="light"?"vs":"vs-dark"}function Lt(){document.documentElement.dataset.theme=u.theme,rf()?.editor.setTheme($m())}var Rt="rail-hidden",$t="tabs-hidden";function jb(e=u.workspace){return zc[e].tabStrip}function Jt(){let e=document.documentElement;for(let o of sx)e.style.setProperty(kt[o],`${u.docks[o].size}px`);let t=document.querySelector("#app");if(!t)return;for(let o of sx)t.classList.toggle(It[o],u.docks[o].collapsed);t.classList.toggle(Rt,!zc[u.workspace].rail),t.classList.toggle($t,!zc[u.workspace].tabStrip)}var X=null,ie=[];function Hb(e){if(!ie.includes(e))ie.push(e)}function hA(){if(X)return;for(let e of ie)e.mount();X=ge(),X.run(()=>{ne(()=>{Jt()}),ne(()=>{Lt()}),ne(()=>{Dt(m.projectRoot)}),ne(()=>{let e=m.projectRoot;m.activePaneId;for(let t of m.panes)t.id,t.activeTabId,t.tabOrder.join("\x00");if(e)fe()})})}function ko(e,t){if(u.docks[e].collapsed===t){Md();return}u.docks[e].collapsed=t,Md()}function Mt(e){ko(e,!u.docks[e].collapsed)}function pA(e,t){u.docks[e].size=t}function Wc(e){u.leftTab=e,ko("left",!1),Md()}function ih(e){u.bottomTab=e,ko("bottom",!1),Md()}function XL(e){if(u.theme===e)return;u.theme=e,xr(rt.theme,e)}function fA(e){if(e===u.leftTab&&!u.docks.left.collapsed){ko("left",!0);return}Wc(e)}function QL(e){u.layoutSelection=e}function lx(){Object.assign(u.git,$e()),Object.assign(u.publish,Je()),Object.assign(u.stylebook,Me()),u.layoutSelection=null,pe=null,re=void 0}function Oe(e,t){if(t.showWorkspace){t.showWorkspace(e);return}oC(e,t)}var te=(e)=>e.project.open;function Wt(e){return[{args:Ce({tab:pi(B,"Which Navigator panel to show.")}),category:"View",id:"view.setActivity",level:"application",menus:["commandbar/overflow","palette"],group:"4_docks",requires:"an open project",when:te,run:(t,o)=>{let r=Vn("view.setActivity",o,"tab",B);if(e.panelAvailable&&!e.panelAvailable(r))throw RangeError(`command "view.setActivity" argument "tab": "${r}" names a panel that is registered but not available right now, so showing it would persist a Navigator tab nothing can draw`);Wc(r)},title:"Show Navigator Panel"},{args:Ce({tab:pi(oe,"Which Inspector tab to show.")}),category:"View",id:"view.setRightTab",level:"document",menus:["palette"],group:"4_docks",requires:"an open document",when:(t)=>t.document.open,run:(t,o)=>{e.setInspectorTab(Vn("view.setRightTab",o,"tab",oe))},title:"Show Inspector Tab"},{args:Ce({open:Lo("True to show the Navigator dock, false to collapse it.")}),category:"View",id:"view.setNavigator",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{ko("left",!Hi("view.setNavigator",o,"open"))},title:"Show Navigator Dock"},{args:Ce({open:Lo("True to show the Inspector dock, false to collapse it.")}),category:"View",id:"view.setRightPanel",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{ko("right",!Hi("view.setRightPanel",o,"open"))},title:"Show Inspector Dock"},{args:Ce({open:Lo("True to show the Bottom dock, false to collapse it.")}),category:"View",id:"view.setBottomDock",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{ko("bottom",!Hi("view.setBottomDock",o,"open"))},title:"Show Bottom Dock"},{category:"View",id:"view.toggleBottomDock",keybinding:"mod+j",level:"application",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>{Mt("bottom")},title:"Toggle Bottom Dock"},{args:Ce({tab:pi(ox,"Which Bottom dock tab to show.")}),category:"View",id:"view.setBottomTab",level:"application",menus:["palette"],group:"4_docks",run:(t,o)=>{let r=Vn("view.setBottomTab",o,"tab",ox);if(e.panelAvailable&&!e.panelAvailable(r))throw RangeError(`command "view.setBottomTab" argument "tab": "${r}" names a panel that is registered but not available right now, so showing it would persist a Bottom dock tab nothing can draw`);ih(r)},title:"Show Bottom Dock Tab"},{args:Ce({open:Lo("True to show the Assistant tab, false to step off it.")}),category:"View",id:"view.setAssistant",level:"application",menus:["never"],group:"4_docks",run:(t,o)=>{if(Hi("view.setAssistant",o,"open")){ko("right",!1),e.setInspectorTab("assistant");return}if(e.inspectorTab()==="assistant")e.setInspectorTab(e.restingInspectorTab?.()??nx)},title:"Show Assistant"},{args:Ce({workspace:pi(vC,"Which workspace to show.")}),category:"View",id:"view.setWorkspace",level:"application",menus:["never"],group:"4_workspaces",requires:"an open project",when:te,run:(t,o)=>{Oe(Vn("view.setWorkspace",o,"workspace",vC),e)},title:"Switch Workspace"},...xx.map((t,o)=>({category:"View",id:`workspace.focus.${t.id}`,keybinding:`mod+${o+1}`,level:"application",menus:["palette"],group:"4_workspaces",requires:"an open project",when:te,run:()=>{Oe(t.id,e)},title:`Go to ${t.title}`})),{args:Ce({color:pi(rx,"The Studio chrome's theme.")}),category:"View",id:"view.setTheme",level:"application",menus:["palette"],group:"6_appearance",run:(t,o)=>{XL(Vn("view.setTheme",o,"color",rx))},title:"Set Theme"}]}function mA(e,t){e.registerAll(Wt(t))}
13
- export{Es,Co,Tm,zL,XS,Yl,nA,to,wr,iA,WL,Xw,Qw,Ts,Rp,oA,sl,ex,VL,no,rA,Lm,QS,sA,tx,eC,nx,tC,ix,UL,ox,qL,GL,rx,zc,KL,sx,aA,JL,nC,iC,lA,u,Md,cA,YL,dA,ax,uA,ZL,oC,$m,jb,Hb,hA,ko,pA,Wc,ih,XL,fA,QL,lx,mA};
14
-
15
- //# debugId=0F95C5ECA929462B64756E2164756E21
16
- //# sourceMappingURL=studio-2r90cts3.js.map
@@ -1,6 +0,0 @@
1
- import{gx,Pp,Fp,jp,bx,Nm,Hd,Zb,Hp,C$,lh,Om,eO,Ea}from"./studio-b2qpt0xy.js";import{p}from"./studio-jws1a87n.js";import{ph}from"./studio-t98vq4r6.js";import{uv}from"./studio-k2sz13zg.js";import{Ft,fn}from"./studio-hz5n7x27.js";import{Ne}from"./studio-sevbc3xv.js";import{oh,Wb,Fd,Vb,Ub,rh}from"./studio-8wnvtr4z.js";import{qw}from"./studio-rtfnhrdg.js";import{jr}from"./studio-qyed0ah6.js";import{S}from"./studio-cg710sk9.js";import{n,ee,_,v,id}from"./studio-8z66jk4z.js";function C(e,t){return new URL(`/node_modules/${e}`,t).href}function x(e){if(e===void 0)return!1;if(n(e))return!e.includes("${");if(Array.isArray(e))return e.every((t)=>x(t));if(v(e))return!("$ref"in e)&&!("$prototype"in e)&&!("$expression"in e)&&Object.values(e).every((t)=>x(t));return!0}function gS(e){let t=new Map;for(let[s,r]of Object.entries(e.state??{})){if(id(s)||!v(r)||!Array.isArray(r.examples))continue;let[o]=r.examples;if(x(o))t.set(s,o)}return t}var k={body:"body",root:":root"};function R(e,t,s,r,o=k){let l=[],a=(i,c)=>{let d={mediaQueries:t,scope:c,transposeValue:s};if(r)d.resolveValue=(m,g)=>r(m,g,c);for(let m of Nm(i,d))l.push(m.text)},y={},h={},b=[],w=[];for(let[i,c]of Object.entries(e)){if(_(c)&&!Array.isArray(c)){if(i.startsWith("@"))b.push([i,c]);else if(!i.startsWith("--"))w.push([i,c]);continue}if(bx(i)||i.startsWith("@"))continue;if(i.startsWith("--")||i==="colorScheme"||i==="color-scheme")y[i]=c;else h[i]=c}a(y,o.root),a(h,o.body);for(let[i,c]of w)if(i.startsWith("&"))a({[i]:c},o.root);else a(c,i);for(let[i,c]of b){if(gx(i)||Pp(i)){a({[i]:c},null);continue}let d={},m={},g=[];for(let[u,f]of Object.entries(c)){if(_(f)&&!Array.isArray(f)){if(!u.startsWith("@"))g.push([u,f]);continue}if(u.startsWith("--"))d[u]=f;else m[u]=f}a({[i]:d},o.root),a({[i]:m},o.body);for(let[u,f]of g)a({[i]:f},u)}if(Object.values(t).some((i)=>jp(i)!==null)&&!("colorScheme"in e))l.push(`${o.root} { color-scheme: light dark }`,`${o.root}:where([${Fp}="light"]) { color-scheme: light }`,`${o.root}:where([${Fp}="dark"]) { color-scheme: dark }`);return l.join(`
2
- `)}var T={body:":host",root:":host"},P=new WeakMap,J=new WeakMap;function A(e){let t=e.replaceAll(/:root\b/g,":host").replaceAll(/(^|[\s,>+~(])(?:html|body)(?![\w-])/g,"$1:host").replaceAll(/:host(?:\s*>?\s*:host)+/g,":host");return t===e?null:t}function j(e){for(let t=0;t<e.cssRules.length;t+=1){let s=e.cssRules[t],r=s instanceof CSSStyleRule?A(s.selectorText):null;if(s instanceof CSSStyleRule&&r!==null){let l=`${r}${s.cssText.slice(s.cssText.indexOf("{"))}`;try{e.insertRule(l,t),e.deleteRule(t+1)}catch{}}let o=e.cssRules[t];if(o instanceof CSSGroupingRule)j(o)}}function D(e){let t=[];for(let s of e??[]){if(!_(s)||String(s.tagName).toLowerCase()!=="link")continue;let{href:r,rel:o}=s.attributes??{};if(n(r)&&r!==""&&n(o)&&o.split(/\s+/).includes("stylesheet"))t.push(r)}return t}async function M(e){let t=Ub(e,"project.json");try{let s=await fetch(t);if(!s.ok)return null;let r=new URL(t,location.href).href,o=new CSSStyleSheet({baseURL:r});return o.replaceSync(await s.text()),j(o),o}catch{return null}}async function L(e){let s=(await Promise.all(D(e.$head).map((o)=>M(o)))).filter((o)=>o!==null),{style:r}=e;if(_(r)){let o=new CSSStyleSheet;o.replaceSync(R(r,e.$media??{},(l)=>l,void 0,T)),s.push(o)}return s}function E(){let e=S?.projectConfig;if(!e||!ee(globalThis.CSSStyleSheet))return Promise.resolve([]);let t=P.get(e);if(!t)t=L(e).then((s)=>(J.set(e,s),s)),P.set(e,t);return t}function eN(){let e=S?.projectConfig;return(e&&J.get(e))??[]}var H=150;function Sw(e=H){let t=new Map;function s(){for(let[r,o]of t){if(t.size<=e)break;t.delete(r),o.remove()}}return{clear(){for(let r of t.values())r.remove();t.clear()},get(r){let o=t.get(r);if(o!==void 0)t.delete(r),t.set(r,o);return o},has:(r)=>t.has(r),keys:()=>[...t.keys()],set(r,o){t.delete(r),t.set(r,o),s()},size:()=>t.size}}function O(e){let t=Fd(S?.projectRoot);return URL.canParse(t)?new URL(e,t).href:location.href}async function N(e){try{let t=await p().readFile(e);Hd(!0);let s=Vb(e,rh());await Ft();let r;if(fn(e))r=(await jr(e,t)).document;else r=JSON.parse(t);return await F(r,e,s)}catch{return null}}async function F(e,t,s){Hd(!0),Zb(Wb());let r=await lh(e,{},O(t)),o=s&&{...s,versions:ph()};C$((l)=>uv(l,o));try{let l=Ea(e,r);return l instanceof HTMLElement?l:null}finally{C$(null)}}async function W(e,t){let s=await AT(t);if(!s)return null;let r=gS(s);return await bS(s,t,r)?qw(e,r):null}async function AT(e){try{let t=JSON.parse(await p().readFile(e));return _(t)&&!Array.isArray(t)?t:null}catch{return null}}async function bS(e,t,s){let r=null;try{Hd(!0),Zb(Wb());let o=await lh(e,{},O(t));for(let[y,h]of s)o[y]=h;let l=!1;Om(()=>{l=!0});let{stop:a}=Hp(()=>Ea({...e,tagName:"div"},o));return r=a,!l}catch{return!1}finally{Om(null),r?.()}}function V(e){return e.source!=="npm"&&(e.path?.endsWith(".json")??!1)}async function Cw(e,t){let s=t.get(e);if(s)return s;let r;try{eO((l)=>C(l,`${oh()}/`)),await E();let o=Ne.find((l)=>l.path===e);if(o&&V(o))r=await W(o,e);else r=o?await qw(o):await N(e)}catch{return}if(!r)return;return t.set(e,r),r}function vp(e){if(!ee(globalThis.IntersectionObserver))return{destroy(){},observe:(r)=>e(r),releaseDetached:()=>0};let t=new Set,s=new IntersectionObserver((r)=>{for(let o of r)if(o.isIntersecting)t.delete(o.target),s.unobserve(o.target),e(o.target)},{rootMargin:"200px"});return{destroy(){s.disconnect(),t.clear()},observe(r){if(t.has(r))return;t.add(r),s.observe(r)},releaseDetached(){let r=0;for(let o of t)if(!o.isConnected)t.delete(o),s.unobserve(o),r+=1;return r}}}
3
- export{gS,eN,Sw,AT,bS,Cw,vp};
4
-
5
- //# debugId=5C9D62702C40A66E64756E2164756E21
6
- //# sourceMappingURL=studio-399xknkb.js.map
@@ -1,5 +0,0 @@
1
- import{p}from"./studio-jws1a87n.js";import{Ft,Ma,fl}from"./studio-hz5n7x27.js";import{ae}from"./studio-b2qpt0xy.js";import{L,R,En,nt,Xs}from"./studio-0w2dr0q8.js";import{g}from"./studio-y60sts62.js";import{h}from"./studio-k2sz13zg.js";import{hw,jD,fb,xi}from"./studio-c71806xz.js";import{_h,Tr,S}from"./studio-cg710sk9.js";import{n,df}from"./studio-8z66jk4z.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPalette",$description:'The command palette: a `role="combobox"` field over the kit\'s `jx-listbox`, whose rows are `jx-option`s the host projects. `rows` is the ranked set for the current mode and query; `activeId` is the highlight, and it is ONE string — the id the field points `aria-activedescendant` at and the id the listbox is handed as `active`, so a key moves the caret without the rows reconciling and no row re-decides its own flag. The FIELD is not a `jx-combobox`: this one carries a mode chip inside its box, its Enter runs a command rather than committing a value, and its panel is a centred scrim rather than a popover under a control. Every gesture calls back into panels/quick-search.ts, which owns the modes, the ranking, the recents and what a row does.',tagName:"div",attributes:{part:"palette"},style:{display:"contents",'& [part="overlay"]':{position:"fixed",inset:"0",zIndex:"1000",display:"flex",justifyContent:"center",paddingTop:"60px",background:"rgba(0, 0, 0, 0.4)"},'& [part="overlay"][hidden]':{display:"none"},'& [part="panel"]':{width:"560px",maxWidth:"calc(100vw - 32px)",maxHeight:"420px",display:"flex",flexDirection:"column",alignSelf:"flex-start",background:"var(--jx-bg-overlay)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-md)",boxShadow:"var(--jx-shadow-dialog)",color:"var(--jx-fg)",fontFamily:"var(--jx-font-sans)",overflow:"hidden"},'& [part="input-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",paddingLeft:"var(--jx-space-4)",background:"var(--jx-bg-input)",borderBottom:"1px solid var(--jx-border)"},'& [part="chip-slot"], & [part="empty-slot"], & [part="section-slot"], & [part="trailing-slot"]':{display:"contents"},'& [part="chip"]':{display:"inline-flex",alignItems:"center",gap:"var(--jx-space-1)",flexShrink:"0",padding:"2px var(--jx-space-1) 2px var(--jx-space-3)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-accent-solid)",color:"var(--jx-accent-fg)",fontSize:"var(--jx-text-sm)"},'& [part="chip-remove"] > [part="control"]':{color:"inherit",opacity:"0.8",":hover":{opacity:"1",background:"transparent"}},'& [part="input"]':{flex:"1",minWidth:"0",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-4) var(--jx-space-1)",font:"inherit",fontSize:"var(--jx-text-lg)",border:"none",outline:"none",background:"none",color:"var(--jx-fg)","::placeholder":{color:"var(--jx-fg-muted)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="results"]':{$description:"The list is the kit's: a `jx-listbox` of `jx-option`, so the highlight is ONE id — `active`, the same string the field points `aria-activedescendant` at — and the listbox's sidecar is the single writer of every row's `selected`. What this surface still decides is density. The kit's row pads itself by `--jx-space-3`; the other half of the 16px optical margin the panel has always had sits here, on the list, so the heading, the rows and the empty sentence line up on one edge instead of each naming it.",flex:"1",paddingInline:"var(--jx-space-3)"},'& [part="option"] [part="label"]':{fontWeight:"500"},'& [part="option"] [part="description"]':{$description:"A `jx-select` row's note is a category at the END of the row, so the kit pushes it there with an auto margin. A palette row's note is a CONTINUATION of its name — the file's directory, the command's category — and the far edge belongs to the chord, which is how this surface teaches the keyboard it replaced. So the auto margin moves to the end slot.",marginInlineStart:"0"},'& [part="option"] [part="end"]':{marginInlineStart:"auto"},'& [part="option"][aria-disabled="true"]':{$description:"An unavailable command is greyed with its `requires` sentence as the subtitle, and that sentence is the reason the row is on screen at all. The kit fades the whole row to 0.45, which would take a muted grey below any readable contrast — so the row keeps its ink and only the name and the glyph dim.",opacity:"1"},'& [part="option"][aria-disabled="true"] [part="label"], & [part="option"][aria-disabled="true"] [part="icon"]':{opacity:"0.45"},'& [part="chord"]':{flexShrink:"0",fontFamily:"inherit",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-muted)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-sm)",padding:"0 5px"},'& [part="option"][aria-selected="true"] [part="chord"]':{color:"inherit",borderColor:"currentColor"},'& [part="badge"]':{fontSize:"var(--jx-text-xs)",padding:"1px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-border)",color:"var(--jx-fg-dim)"},'& [part="hint"]':{padding:"var(--jx-space-2) var(--jx-space-5)",borderTop:"1px solid var(--jx-border)",color:"var(--jx-fg-muted)",fontSize:"var(--jx-text-xs)"},'& [part="hint"] kbd':{fontFamily:"inherit",color:"var(--jx-fg-dim)"}},children:[{tagName:"div",attributes:{part:"overlay",hidden:"${state.open ? null : ''}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/close"},value:[]}]},children:[{tagName:"div",attributes:{part:"panel"},onclick:{$prototype:"Function",body:[{stopPropagation:!0}]},children:[{tagName:"div",attributes:{part:"input-row"},children:[{tagName:"span",attributes:{part:"chip-slot",role:"none"},$switch:{$ref:"#/state/hasChip"},cases:{true:{tagName:"span",attributes:{part:"chip"},children:[{tagName:"span",attributes:{part:"chip-label"},textContent:"${state.chipLabel}"},{tagName:"jx-action-button",$props:{label:"Clear mode",hint:"Clear mode (Backspace)",icon:"x",size:"sm"},attributes:{part:"chip-remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}},{tagName:"input",attributes:{part:"input",type:"text",role:"combobox","aria-controls":"quick-search-listbox","aria-expanded":"${state.expanded ? 'true' : 'false'}","aria-activedescendant":"${state.activeId || null}","aria-autocomplete":"list","aria-label":"${state.placeholder}",placeholder:"${state.placeholder}"},value:{$ref:"#/state/query"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{ArrowDown:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[1]}],ArrowUp:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[-1]}],Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/activate"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/close"},value:[]}],Backspace:[{$switch:{$ref:"#/state/canClearMode"},cases:{true:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}]}}]},{tagName:"jx-listbox",attributes:{part:"results",id:"quick-search-listbox"},$props:{label:"Results",active:"${state.activeId}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activateRow"},value:[{$ref:"event#/detail"}]}],description:"One handler for every row, because a row's `select` bubbles. The detail is the row's `value`, which is the index it occupies in `rows` — the same number a hover names, and the number the id is built from."},children:[{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/isEmpty"},cases:{true:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyHint}"}}},{tagName:"div",attributes:{part:"section-slot",role:"none"},$switch:{$ref:"#/state/showSection"},cases:{true:{tagName:"div",attributes:{part:"group-heading"},textContent:"${state.sectionLabel}"}}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"jx-option",attributes:{part:"option",id:"quick-search-option-${$map.index}","data-kind":"${$map.item.kind}"},$props:{value:"${$map.index}",label:{$ref:"$map/item/name"},description:{$ref:"$map/item/detail"},disabled:{$ref:"$map/item/disabled"}},onmouseenter:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/hover"},value:[{$ref:"$map/index"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"span",attributes:{slot:"end",part:"trailing-slot"},$switch:{$ref:"$map/item/trailing"},cases:{chord:{tagName:"kbd",attributes:{part:"chord"},textContent:"${$map.item.chord}"},recent:{tagName:"span",attributes:{part:"badge"},textContent:"recent"}}}]}}]},{tagName:"div",attributes:{part:"hint"},children:[{tagName:"kbd",textContent:"↑↓"}," move · ",{tagName:"kbd",textContent:"↵"}," run · ",{tagName:"kbd",textContent:"?"}," modes · ",{tagName:"kbd",textContent:">"}," commands · ",{tagName:"kbd",textContent:"@"}," elements"]}]}]}]};var C=[{mode:"files",prefix:"",chip:"Files",placeholder:"Go to a file…",description:"Open a file by any part of its path — pgblog finds pages/blog/index.md."},{mode:"commands",prefix:">",chip:"Commands",placeholder:"Run a command…",description:"Run anything Studio can do, with its keyboard shortcut printed beside it."},{mode:"nodes",prefix:"@",chip:"Symbols",placeholder:"Go to an element in this document…",description:"Select an element in the open document by its Outline name."},{mode:"projects",prefix:"",chip:"Recent Projects",placeholder:"Open a recent project…",description:"Reopen a project you have had open before."},{mode:"picker",prefix:"?",chip:"Modes",placeholder:"Type ? for modes, > for commands, @ for elements…",description:"List these modes."}],X=new Map(C.map((e)=>[e.mode,e])),F=C.filter((e)=>e.prefix!=="");function O(e){return X.get(e)??C[0]}function _(e,t,o){let a=F.find((s)=>t.startsWith(s.prefix));if(a)return _(a.mode,t.slice(1),o);let i=e;if(i==="picker"&&t.trim()!=="")i="files";if(i==="files"&&!o)i="projects";return{mode:i,query:t}}var Y=new Set(["/","-","_","."," "]);function Z(e,t){if(t==="")return 0;let o=e.toLowerCase(),a=t.toLowerCase(),i=o.lastIndexOf("/")+1,s=0,r=0,v=-2;for(let K of a){let u=o.indexOf(K,r);if(u===-1)return null;if(u===v+1)s+=8;if(u===0||Y.has(o[u-1]??""))s+=6;if(u>=i)s+=4;v=u,r=u+1}return s-v*0.01-o.length*0.001}function w(e,t,o){let a=[];for(let[i,s]of e.entries()){let r=Z(o(s),t);if(r!==null)a.push({index:i,item:s,score:r})}return a.toSorted((i,s)=>s.score-i.score||i.index-s.index).map((i)=>i.item)}function q(e){let t=e.args,o=t?.properties;if(!t||!o)return{kind:"none"};let a=Object.keys(o);if(a.length!==1)return{kind:"unsupported"};let i=a[0],s=o[i];if(s.enum)return{kind:"choice",name:i,choices:s.enum.map((r)=>({label:String(r),value:r}))};if(s.type==="boolean")return{kind:"choice",name:i,choices:[{label:"on",value:!0},{label:"off",value:!1}]};return{kind:"unsupported"}}function N(e){return`quick-search-option-${e}`}var D="jx-studio-recent-commands",ee=6;function H(){try{let e=JSON.parse(localStorage.getItem(D)||"[]");return Array.isArray(e)?e.filter((t)=>n(t)):[]}catch{return[]}}function te(e){let t=[e,...H().filter((o)=>o!==e)].slice(0,ee);try{localStorage.setItem(D,JSON.stringify(t))}catch{}}var z=null,x=!1,b="picker",l="",d=0,y=null,j=!1,c=null;function B(){return Xs("popover","quick-search")}function Sk(e){z=e??null}function Vg(e="files"){x=!0,b=e,l="",d=0,c=null,y=null,m(),ye(),M()}function k(){x=!1,c=null,m()}function Q(){return S?S.projectRoot:null}function W(){return S!=null}function J(){return _(b,l,W())}function U(e){let t=e.split("/");return t.pop(),t.length>0?t.join("/"):""}function ne(e){if(e.startsWith("/home/"))return`~/${e.split("/").slice(3).join("/")}`;return e}async function M(){if(!x||y!==null||j||!W())return;j=!0,m();try{await Ft(),y=(await p().searchFiles("",fl())).map((t)=>({kind:"file",path:t.path,name:t.name??t.path.split("/").pop()??"",detail:U(t.path),recent:!1}))}catch{y=[]}j=!1,m()}function oe(e){if(e.trim()==="")return jD(Q()??void 0).map((t)=>({kind:"file",path:t.path,name:t.name,detail:U(t.path),recent:!0}));return w(y??[],e.trim(),(t)=>t.path)}function re(e){let t=hw().map((o)=>({kind:"project",root:o.root,name:o.name,detail:ne(o.root)}));return w(t,e.trim(),(o)=>`${o.name}/${o.root}`)}function ie(e,t){let o=H(),a=[];for(let r of e.visible()){if(q(r).kind==="unsupported")continue;if(!(r.menus??["palette"]).includes("palette"))continue;a.push({kind:"command",id:r.id,name:`${r.category}: ${r.title}`,detail:e.disabledReason(r.id)??"",chord:e.keymap.formatBinding(r.id)??"",enabled:e.isEnabled(r.id),recent:o.includes(r.id)})}let i=w(a,t.trim(),(r)=>r.name);if(t.trim()!=="")return i;let s=o.map((r)=>i.find((v)=>v.id===r)).filter((r)=>r!==void 0);return[...s,...i.filter((r)=>!s.includes(r))]}function se(e){let t=h.value;if(!t)return[];let o=_h(t.doc.document).map((a)=>({kind:"node",path:a.path,name:df(a.node)?String(a.node).slice(0,60):Tr(a.node),detail:a.nodeType}));return w(o,e.trim(),(a)=>a.name)}function ce(){return C.flatMap((e)=>e.mode==="picker"?[]:[{kind:"mode",mode:e.mode,name:e.chip,detail:e.description,chord:e.prefix}])}function de(e){let t=c,o=t.choices.map((a)=>({kind:"arg",commandId:t.command.id,argName:t.name,value:a.value,name:a.label,detail:`${t.command.title} → ${t.name}`}));return w(o,e.trim(),(a)=>a.name)}function le(){let{mode:e,query:t}=J();if(c)return{rows:de(t),showingRecent:!1};switch(e){case"commands":{let o=ae();return{rows:o?ie(o,t):[],showingRecent:t.trim()===""}}case"nodes":return{rows:se(t),showingRecent:!1};case"projects":return{rows:re(t),showingRecent:t.trim()===""};case"picker":return{rows:ce(),showingRecent:!1};default:return{rows:oe(t),showingRecent:t.trim()===""}}}function pe(e){let t=F.find((o)=>e.startsWith(o.prefix));if(t)b=t.mode,l=e.slice(1);else l=e;if(d=0,e!==l)P().query=e;m(),M()}function me(){b="picker",c=null,d=0,m()}function ue(e){b=e,l="",d=0,m(),M()}function G(e,t){let o=ae();if(!o)return;te(e.id),k(),En(o,e.id,t,"Palette")}function A(e){switch(e.kind){case"project":{k(),z?.openRecentProject(e.root);return}case"file":{k(),fb({name:e.name,path:e.path,root:Q()??""}),xi(e.path);return}case"mode":{ue(e.mode);return}case"node":{k(),nt("selection.set",{path:e.path},"Palette");return}case"arg":{G(c.command,{[e.argName]:e.value});return}default:he(e)}}function he(e){let t=ae(),o=t?.get(e.id);if(!t||!o||!e.enabled)return;let a=q(o);if(a.kind==="choice"){c={choices:a.choices,command:o,name:a.name},l="",d=0,m();return}G(o)}function fe(e){let t=e.split(".").pop()?.toLowerCase();if(t==="json")return"file-code";if(t&&Ma(t))return"file-text";return"file"}function ge(e){switch(e.kind){case"project":return"folder-open";case"file":return fe(e.name);case"command":return"play";case"node":return"stack";default:return"caret-right"}}function xe(e,t){if((e.kind==="command"||e.kind==="mode")&&e.chord)return"chord";if(e.kind==="command"&&e.recent)return"recent";return t?"recent":"none"}function be(e){switch(e.kind){case"project":return`project:${e.root}`;case"file":return`file:${e.path}`;case"command":return`command:${e.id}`;case"node":return`node:${e.path.join("/")}`;case"mode":return`mode:${e.mode}`;default:return`arg:${e.value}`}}function ve(e,t){if(j)return"Reading the project's files…";if(t.trim()!=="")return"No results";switch(e){case"projects":return"No recent projects — open one to get started";case"nodes":return"Open a document to jump to its elements";case"commands":return"Type to find any command in Studio";default:return O(e).placeholder}}L("palette",I);var E=null,T=null,f=[];function P(){return E??=g({activate:()=>{let e=f[d];if(e)A(e)},activateRow:(e)=>{let t=f[Number(e)];if(t)A(t)},activeId:"",canClearMode:!1,chipLabel:"",clearMode:me,close:k,emptyHint:"",expanded:!1,hasChip:!1,hover:(e)=>{d=e,P().activeId=N(e)},input:pe,isEmpty:!0,move:(e)=>{if(f.length===0)return;d=Math.max(0,Math.min(d+e,f.length-1)),P().activeId=N(d)},open:!1,placeholder:"",query:"",rows:[],sectionLabel:"",showSection:!1}),E}function ye(){setTimeout(()=>{if(x)B().querySelector('[part="input"]')?.focus()},0)}function m(){let e=P();if(!T)T=R("palette",e,B());if(e.open=x,!x){f=[];return}let{mode:t,query:o}=J(),{rows:a,showingRecent:i}=le(),s=O(t);f=a,e.placeholder=c?`Choose a ${c.name}…`:s.placeholder,e.hasChip=c!==null||t!=="picker",e.chipLabel=c?c.command.title:s.chip,e.query=l,e.canClearMode=l===""&&(c!==null||b!=="picker"),e.rows=a.map((r)=>({chord:(r.kind==="command"||r.kind==="mode")&&r.chord?r.chord:"",detail:r.detail,disabled:r.kind==="command"&&!r.enabled,icon:ge(r),key:be(r),kind:r.kind,name:r.name,trailing:xe(r,i)})),e.expanded=a.length>0,e.activeId=a.length>0?N(d):"",e.isEmpty=a.length===0,e.emptyHint=ve(t,o),e.showSection=i&&a.length>0,e.sectionLabel=c?`${c.command.title} — ${c.name}`:t==="projects"?"Recent projects":t==="commands"?"Recently used":"Recently opened"}
2
- export{Sk,Vg};
3
-
4
- //# debugId=37FD90620A84DC6464756E2164756E21
5
- //# sourceMappingURL=studio-4ncmwqw5.js.map
@@ -1,7 +0,0 @@
1
- import{Q}from"./studio-nqxqf8p2.js";import{g,C}from"./studio-y60sts62.js";import{Kt,zt}from"./studio-b2qpt0xy.js";import{Ve,wt,L,R,sn,dt}from"./studio-0w2dr0q8.js";var G={$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…"}]}]};L("github-auth",G);function _(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ve,wt("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 Kt(o),o});return{close(){let i=n?.root;if(i instanceof HTMLElement)zt(i);n?.dispose(),n=null,t.remove(),l()},host:t,ready:r}}var A="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,S=!1;function H(e){f=e}function LT(){return f!==null||S||localStorage.getItem("jx_github_token")!==null}function $T(){return p()?"desktop":"browser"}function y(){return f??localStorage.getItem("jx_github_token")}function IT(){f=null,S=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var E="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){C.error("Could not reach GitHub to sign in.",{action:j,detail:`${z}
2
-
3
- ${Q(e)}`,key:E,source:O})}function w(e,t){C.warn(e,{action:j,detail:t,key:E,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 w("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function hS(){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 w("GitHub sign-in was not completed.",Q(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,T=!1,I=(c)=>{if(T)return;if(T=!0,i=!0,o)clearTimeout(o),o=null;r(c)},k=!1,x=()=>{if(k)return;k=!0,D.close()},d=(c)=>{I(c),x()},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(A,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}w("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=_({layer:dt("dialog"),onCancel:()=>{x()},onClosed:()=>{d(null)},userCode:u,verificationUri:b});o=setTimeout(h,n*1000)})}
4
- export{LT,$T,IT,hS};
5
-
6
- //# debugId=5250A3B017A221F564756E2164756E21
7
- //# sourceMappingURL=studio-5atwjgkj.js.map
@@ -1,5 +0,0 @@
1
- import{p}from"./studio-jws1a87n.js";import{Si}from"./studio-ea74s8c1.js";import{us}from"./studio-t98vq4r6.js";import{tn}from"./studio-8wnvtr4z.js";import{Uc,xA,Bb}from"./studio-f746039f.js";import{Z}from"./studio-8z66jk4z.js";var u=new Map,h=new Map,d=new Map,g=new Set;function m(e){return tn(e)===".svg"}function c(e){let t=e===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(e),n=t?Number(t[1]):Number.NaN;return n>0?n:null}function M(e){let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(t.localName!=="svg")return null;let n=c(t.getAttribute("width")),i=c(t.getAttribute("height")),r=(t.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=r[2]??Number.NaN,l=r[3]??Number.NaN,a=r.length===4&&o>0&&l>0,s=null;if(n!==null&&i!==null)s={height:i,width:n};else if(a&&n!==null)s={height:n*l/o,width:n};else if(a&&i!==null)s={height:i,width:i*o/l};else if(a)s={height:l,width:o};return s&&{height:Math.round(s.height),width:Math.round(s.width)}}async function b(e){g.add(e);try{let t=M(await p().readFile(e));if(t&&t.width>0&&t.height>0)d.set(e,t)}catch{}}function Nd(e){let t=Si(e);return u.has(t)&&(!m(t)||g.has(t))}function f(e,t){let n=xA(e),i=d.get(e);return{bytes:Z(t?.size)?t.size:null,ext:tn(n),height:i?.height??null,kind:Uc({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function Ad(e){return u.get(Si(e))??null}function cN(e){for(let t of e){if(t.type!=="file")continue;let n=Si(t.path);if(!u.has(n))u.set(n,f(n,t))}}async function Uu(e){let t=Si(e),n=u.get(t);if(n&&Nd(t))return n;let i=h.get(t);if(i)return i;let r=(async()=>{if(m(t)&&!g.has(t))await b(t);if(n){let a=d.get(t);return{...n,height:a?.height??null,width:a?.width??null}}let l;try{l=(await us(()=>p().listDirectory(Bb(t)))).find((s)=>Si(s.path)===t)}catch{l=void 0}return f(t,l)})();h.set(t,r);let o=await r;return h.delete(t),u.set(t,o),o}function Sp(e,t,n){if(!(t>0&&n>0))return!1;let i=Si(e);if(m(i))return!1;let r=d.get(i);if(r&&r.width===t&&r.height===n)return!1;d.set(i,{height:n,width:t});let o=u.get(i);if(o)u.set(i,{...o,height:n,width:t});return!0}function dN(){u.clear(),d.clear(),g.clear()}function qT(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Aw(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(qT(e.bytes));return t.join(" · ")}
2
- export{Nd,Ad,cN,Uu,Sp,dN,qT,Aw};
3
-
4
- //# debugId=726BA5BCA81A334B64756E2164756E21
5
- //# sourceMappingURL=studio-5frqk7c0.js.map
@@ -1,5 +0,0 @@
1
- import{Q}from"./studio-nqxqf8p2.js";import{ae}from"./studio-b2qpt0xy.js";import{ge,ne,g}from"./studio-y60sts62.js";import{p,_e}from"./studio-jws1a87n.js";import{Qn,L,R,nt}from"./studio-0w2dr0q8.js";import{Tm,no,Lm,QS,sA,tx,u}from"./studio-2r90cts3.js";import{Ul,KT,Ri,Od,YT,ZT}from"./studio-cw0wb9qk.js";import{cs,Ac,GT}from"./studio-0q5jwddh.js";import{ks,cS,wb,Vs,pT,fT,mT,gT,bT,vT,yT,wT,xT,_T,ST,CT,xw,kT,ET}from"./studio-zwaxn5s2.js";import{Lb}from"./studio-rtfnhrdg.js";import{zg,Ty,Kf,lR,Jf,s_,cR,Wg,uR,Ly}from"./studio-6hzdjfv0.js";import{S}from"./studio-cg710sk9.js";import{n,v}from"./studio-8z66jk4z.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDeploy",$description:"Publish › Hosting's build adapter (studio.md §22.8), which was Project Settings › Deploy: one row over `build.adapter`, and the sentence a failed write leaves behind. It draws no heading of its own: Hosting's \"How it is built\" section heads it, and a second title inside that card would name the same thing twice. The adapter (`surfaces/settings-deploy.ts`) hands in the chosen adapter, the enumeration it is chosen from and whatever the last write had to say; the document draws them and hands the change straight back. Nothing here reads `project.json`: a section that re-read the config while drawing would be a second opinion about a file one module already owns.",tagName:"section",attributes:{part:"deploy"},style:{$description:"What is NOT in this block is most of the conversion. Four borrowed rules had nothing to transcribe: `.settings-field-label` and `.settings-field-desc` drew a row's label and the sentence under it, and `jx-field` draws both — with the label actually NAMING the control, which the bare `<label class=…>` beside the picker never did; `.settings-field` added a 20px bottom margin to separate one row from the next, and this section has one row, so the margin separated it from the end of the section; and `.settings-section` was never defined by any stylesheet at all, which is why it sits in `check-styles.ts`'s allow-list rather than in a rule.",display:"block",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="section-error"]':{$description:'A write that failed, said under the section title rather than pinned to the picker: settings save on change, so a silent rejection would read as "my edit just vanished", and what failed was the whole file rather than the value. Its size read `--spectrum-font-size-75` with a 12px fallback, which resolved only inside `<sp-theme>` — a document is mounted in the settings pane, where that name is not in scope and the fallback is all it would ever have taken — so the size is the kit\'s scale and the colour is the studio layer\'s. It is `section-error` rather than `error` because the adapter picker is a `jx-select`, which draws a permanent `[part="error"]` of its own in this same light-DOM tree: a rule on that name would give the picker\'s own refusal sentence this 16px margin too.',margin:"0 0 16px",fontSize:"var(--jx-text-md)",color:"var(--danger)"},'& [part="adapter"]':{$description:"How wide the picker may grow. A control offering five short words does not want the width of a 900px pane, and 320px is the one thing `.settings-build-adapter` said that the kit does not — the same measure the two pickers in Locales take.",maxWidth:"320px"}},children:[{tagName:"div",attributes:{part:"section-error-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"section-error",role:"alert"},textContent:"${state.error}"}}},{tagName:"jx-field",attributes:{part:"row","data-field":"adapter"},$props:{span:!0,label:"Build adapter",description:"What the site is built for. Static writes plain files; the others emit a server entry for that runtime."},children:[{tagName:"jx-select",attributes:{part:"adapter"},$props:{size:"sm",options:{$ref:"#/state/adapters"},value:{$ref:"#/state/adapter"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAdapter"},value:[{$ref:"event#/target/value"}]}]}}]}]};L("settings-deploy",Y);function X(t,e){if(e.adapter!==void 0)t.adapter=e.adapter;if(e.adapters!==void 0)t.adapters=e.adapters;if(e.error!==void 0)t.error=e.error,t.hasError=e.error!==""}function Z(t,e,a){let r=g({adapter:"",adapters:[],error:"",hasError:!1,setAdapter:a.setAdapter});X(r,e),t.replaceChildren();let i=null,l=!1;return R("settings-deploy",r,t).then((o)=>{if(l){o.dispose();return}i=o}),{connected:()=>!l&&(i===null?t.childNodes.length===0:i.root.parentNode===t),dispose(){l=!0,i?.dispose(),i=null},update:(o)=>X(r,o)}}var tt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsRawJson",$description:"Project Settings › Raw JSON: `project.json` as it is written, and the way through to editing it as text. The adapter (`surfaces/settings-rawjson.ts`) hands in the serialisation the save chokepoint itself produced, so what is drawn is what a save writes rather than a second pretty-printer that would disagree with the file by an indent. The button opens the SAME tab in the Code editor — one document, three editors (`studio.md` §9.3) — so switching to the text and back keeps one undo stack instead of forking two.",tagName:"section",attributes:{part:"rawjson"},style:{$description:"Two of the rules this section borrowed are gone rather than moved. `.settings-field-desc` styled the sentence under the title, and it is kept here because there is no `jx-field` in this section to draw it — a `<pre>` is not a control and wrapping one in a row would give the file a label it does not need. `.settings-edit-as-code` set `align-self: flex-start` on the button, which did nothing: its parent carried `.settings-section`, a class no stylesheet defines, so there was no flex container for the declaration to be about — and `jx-button` is `inline-flex`, so it already sits at the left of a block.",display:"block",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="intro"]':{$description:"The sentence under the title. Its size read `--spectrum-font-size-75` with a 12px fallback, a name that resolves only inside `<sp-theme>`; a document is mounted in the settings pane, so the fallback is all it could ever have taken and the size is the kit's scale now.",margin:"0 0 6px",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="file"]':{$description:"The file's name, said in the prose as the file it is. It borrowed a bare `<code>` element and whatever the page happened to give one; a document's styling is its own, so the face is stated here.",fontFamily:"var(--font-mono)"},'& [part="json"]':{$description:'`project.json` as it is saved. It scrolls in its own box: a 250-line file must not push the "Edit as code" action off the bottom of the section. Its background read `var(--bg-dim, var(--bg))` and `--bg-dim` is declared nowhere in the token layer, so the fallback is what has always painted it — written as what it resolves to rather than as a name that never resolved.',margin:"0 0 12px",padding:"12px",maxHeight:"420px",overflow:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-md)",color:"var(--fg)",whiteSpace:"pre"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"Raw JSON"},{tagName:"p",attributes:{part:"intro"},children:["The whole of ",{tagName:"code",attributes:{part:"file"},textContent:"project.json"},", as it is saved. Editing it as code opens the same document in the Code editor — one undo stack, one dirty flag."]},{tagName:"pre",attributes:{part:"json"},textContent:"${state.json}"},{tagName:"jx-button",attributes:{part:"edit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAsCode"}}]},children:[{tagName:"span",textContent:"Edit as code"}]}]};L("settings-rawjson",tt);function et(t,e){if(e.json!==void 0)t.json=e.json}function at(t,e,a){let r=g({editAsCode:a.editAsCode,json:""});et(r,e),t.replaceChildren();let i=null,l=!1;return R("settings-rawjson",r,t).then((o)=>{if(l){o.dispose();return}i=o}),{connected:()=>!l&&(i===null?t.childNodes.length===0:i.root.parentNode===t),dispose(){l=!0,i?.dispose(),i=null},update:(o)=>et(r,o)}}var W=new WeakMap;function B(){return S?.projectConfig??{}}var kt=[{label:"Static",value:"static"},{label:"Bun",value:"bun"},{label:"Node",value:"node"},{label:"Cloudflare Workers",value:"cloudflare-workers"},{label:"Cloudflare Pages",value:"cloudflare-pages"}],N=new WeakMap;function rt(t){return{adapter:B().build?.adapter||"static",adapters:kt.map((e)=>({label:e.label,value:e.value})),error:W.get(t)??""}}async function St(t,e){try{await no(e),W.delete(t)}catch(a){W.set(t,`Could not save project.json — ${Q(a)}`)}D(t)}var it=new WeakMap;function Ct(t){let e=it.get(t);if(!e)e={setAdapter:(a)=>{N.get(t)?.update({adapter:a}),St(t,{build:{...B().build,adapter:a}})}},it.set(t,e);return e}function D(t){let e=N.get(t);if(e?.connected()){e.update(rt(t));return}e?.dispose(),N.set(t,Z(t,rt(t),Ct(t)))}function z(t){N.get(t)?.dispose(),N.delete(t)}var st=new WeakMap;function ot(){return{json:Tm(B())}}function rR(t,e){let a=st.get(t);if(a?.connected()){a.update(ot());return}a?.dispose(),st.set(t,at(t,ot(),{editAsCode:e.editAsCode}))}var lt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublishWorkspace",$description:"The Publish workspace's home (studio.md §22.8): four sub-tabs over one body. Review changes is the change list grouped the way the site is organised (Pages, each content collection, Components, Layouts, Styles, Media, Other), each file's checkbox including it in the next publish (staging it), its Before and after opening the comparison (§21), then the checks, the destination, the summary and the one primary button. Deploys is the live site, any deploy running now with its steps, the history the host returns and the branch previews. Branches is the branch list with switch and create. Hosting is where the project is saved, where the site is hosted, the build adapter (an island: the Deploy section that moved here from Project Settings) and the address, with the deploy checklist under them. `publish/publish-workspace.ts` keeps every decision and hands this document strings and booleans; nothing here knows what a status letter means, which destination a host allows or what a deployment's stage is called.",tagName:"div",attributes:{part:"publish","data-jx-region":"${state.region}","data-tab":"${state.tab}","aria-labelledby":"${state.titleId}",role:"region"},style:{$description:"Fills the pane's stage by its own geometry, as the Media home does: the stage is `position: relative`, so the workspace takes the whole of it and scrolls its own body. The status colours are the theme's semantic tokens, so a check, a badge and a deployment's state follow light and dark without a hex anywhere.",position:"absolute",inset:"0",display:"flex",flexDirection:"column",boxSizing:"border-box",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",background:"var(--bg)",'& [part="head"]':{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:"var(--jx-space-3)",padding:"var(--jx-space-4) var(--jx-space-5) 0"},'& [part="heading"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600"},'& [part="headline"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="tabs"]':{padding:"0 var(--jx-space-5)",flexShrink:"0"},'& [part="body"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-6)",containerType:"inline-size",containerName:"publish-body"},'& [part="review"]':{$description:"Two columns as the board draws them, the changes on the left and the publish card on the right; below 760px of pane the card drops under the list rather than squeezing it.",display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(260px, 340px)",gap:"var(--jx-space-5)",alignItems:"start"},"@container publish-body (max-width: 760px)":{'& [part="review"]':{gridTemplateColumns:"minmax(0, 1fr)"}},'& [part="changes-column"], & [part="publish-column"], & [part="deploys"], & [part="branches"], & [part="hosting"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-5)",minWidth:"0"},'& [part="deploys"], & [part="branches"], & [part="hosting"]':{maxWidth:"760px"},"& section":{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)"},'& [part="section-heading"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.04em"},'& [part="publish-column"] > section':{padding:"var(--jx-space-4)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)"},'& [part="sync-bar"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3)",paddingBottom:"var(--jx-space-3)",borderBottom:"1px solid var(--border)"},'& [part="sync-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",minWidth:"0"},'& [part="sync-label"]':{fontWeight:"600"},'& [part="sync-time"], & [part="included"], & [part="file-dir"], & [part="history-meta"], & [part="choice-note"], & [part="live-summary"], & [part="hosting-summary"], & [part="branch-sync"], & [part="branch-summary"], & [part="deployment-when"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="changes-bar"]':{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--jx-space-3)"},'& [part="groups"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="group-name"]':{fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"2px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)"},'& [part="file-row"]:hover, & [part="file-row"]:focus-within':{background:"var(--hover-bg)"},'& [part="file-text"]':{display:"flex",flex:"1",alignItems:"baseline",gap:"var(--jx-space-2)",minWidth:"0",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& [part="file-dir"]':{overflow:"hidden",textOverflow:"ellipsis"},'& [part="badge"]':{$description:"One letter and a colour, which is why the checkbox and the row's buttons carry the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"]':{color:"var(--tag)"},'& [part="empty-message"], & [part="status"], & [part="live-none"]':{margin:"0",color:"var(--fg-dim)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center"},'& [part="empty"] > [part="empty-message"]':{maxWidth:"48ch"},'& [part="empty-actions"], & [part="command-row"], & [part="publish-actions"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="history-list"], & [part="check-list"], & [part="deployment-list"], & [part="branch-list"], & [part="checklist-steps"], & [part="activity-steps"]':{margin:"0",padding:"0",listStyle:"none",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="history-entry"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)",alignItems:"baseline"},'& [part="history-hash"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="history-message"]':{flex:"1",minWidth:"0"},'& [part="checklist-step"], & [part="activity-step"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)"},'& [part="check"]':{$description:"Centred, not baseline-aligned: the row can hold a small kit button, and a small kit control is layout-contained, so it has no baseline to align on.",display:"flex",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="check-text"]':{flex:"1",minWidth:"0",lineHeight:"1.4"},'& [part="check-icon"], & [part="step-icon"]':{$description:"A kit icon for a check or a checklist link, sized by the kit's own property so it stays square; the activity feed's steps still draw a one-character glyph, which `minWidth` keeps on the same column.",flex:"none",minWidth:"1em",textAlign:"center","--jx-icon-size":"1em",color:"var(--fg-dim)"},'& [part="checklist-step"] > [part="step-icon"]':{$description:"A baseline-aligned row places a kit icon's bottom edge on the text baseline, which draws it high; the negative end margin lowers it onto the line's middle.",marginBlockEnd:"-0.15em"},'& [data-state="done"] > [part="check-icon"], & [data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [data-state="failed"] > [part="check-icon"], & [data-state="failed"] > [part="step-icon"]':{color:"var(--danger)"},'& [data-state="todo"] > [part="check-icon"]':{color:"var(--warning)"},'& [part="destinations"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="destination-card"] > [part="control"]':{$description:"A destination is a card with a name and a sentence saying what it does, inside one radio, as Add new's choice cards are: the reader hears one name and sees both lines.",width:"100%",height:"auto",flexDirection:"column",alignItems:"flex-start",textAlign:"start",padding:"var(--jx-space-2) var(--jx-space-3)",gap:"2px",whiteSpace:"normal"},'& [part="choice-name"]':{display:"block",fontWeight:"600"},'& [part="choice-note"]':{display:"block"},'& [part="refusal"], & [part="blocker"]':{margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="review-line"], & [part="live-site"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)",margin:"0"},'& [part="live-url"]':{fontWeight:"600",wordBreak:"break-all"},'& [part="live-summary"], & [part="hosting-summary"], & [part="host-name"], & [part="branch-note"]':{margin:"0",lineHeight:"1.5"},'& [part="host-name"]':{fontWeight:"600"},'& [part="activity"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)"},'& [part="activity-head"]':{display:"flex",justifyContent:"space-between",gap:"var(--jx-space-3)"},'& [part="activity-title"]':{fontWeight:"600"},'& [part="activity-status"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="deployment"]':{display:"grid",gridTemplateColumns:"minmax(64px, auto) minmax(0, 1fr) auto auto",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-1) 0",borderBottom:"1px solid var(--border)"},'& [part="deployment-label"]':{minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="deployment-status"]':{fontSize:"var(--jx-text-sm)"},'& [part="deployment-status"][data-status="success"]':{color:"var(--success)"},'& [part="deployment-status"][data-status="failure"]':{color:"var(--danger)"},'& [part="branch"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)","--jx-icon-size":"16px"},'& [part="branch"]:hover':{background:"var(--hover-bg)"},'& [part="branch-icon"]':{color:"var(--fg-dim)"},'& [part="branch-name"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",fontFamily:"var(--font-mono)"},'& [part="current"]':{display:"inline-flex",gap:"var(--jx-space-2)",alignItems:"baseline"},'& [part="current-tag"]':{padding:"0 6px",borderRadius:"var(--jx-radius-sm)",background:"var(--hover-bg)",fontSize:"var(--jx-text-xs)"},'& [part="hosting"] > section':{padding:"var(--jx-space-4)",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)"},'& [part="busy"]':{margin:"0",padding:"var(--jx-space-2) var(--jx-space-5)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:"`failure`, not `error`: a kit text field keeps a permanent live region named `error`, and a rule on that name would reach the summary field's (surface-part-names.test.ts).",margin:"0",padding:"var(--jx-space-2) var(--jx-space-5)",color:"var(--danger)",borderTop:"1px solid var(--border)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"header",attributes:{part:"head"},children:[{tagName:"h2",attributes:{part:"heading",id:"${state.titleId}"},textContent:"Publish"},{tagName:"span",attributes:{part:"headline"},textContent:"${state.headline}"}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.tab}"},$props:{label:"Publish views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/value"},map:{tagName:"jx-tab",attributes:{part:"tab",value:"${$map.item.value}",label:"${$map.item.label}",panel:"${state.panelId}","data-tab":"${$map.item.value}"}}}]},{tagName:"div",attributes:{part:"body",id:"${state.panelId}",role:"tabpanel","data-tab":"${state.tab}","aria-label":"${state.tabTitle}"},children:[{tagName:"div",attributes:{part:"tab-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/tab"},cases:{review:{tagName:"div",attributes:{part:"review-slot-mood",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mood"},cases:{"no-project":{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Open a project to publish it. Publishing reviews your saved changes and sends them to your site."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"jx-button",attributes:{part:"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}}}]},loading:{tagName:"p",attributes:{part:"status"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Publishing starts with a repository, which keeps every version you publish."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]}]}]},repo:{tagName:"div",attributes:{part:"review"},children:[{tagName:"div",attributes:{part:"changes-column"},children:[{tagName:"div",attributes:{part:"sync-bar"},children:[{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh source control",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]},{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Sync with the remote",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch from the remote",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]},local:{tagName:"jx-button",attributes:{part:"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}}}]},{tagName:"section",attributes:{part:"changes"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Changes"},{tagName:"div",attributes:{part:"changes-bar"},children:[{tagName:"span",attributes:{part:"included"},textContent:"${state.includedLabel}"},{tagName:"div",attributes:{part:"include-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"jx-checkbox",attributes:{part:"include-all"},$props:{checked:{$ref:"#/state/allIncluded"},indeterminate:{$ref:"#/state/someIncluded"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/includeAll"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Include all"}]}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group"},children:[{tagName:"div",attributes:{part:"group-name"},textContent:"${$map.item.name}"},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-included":"${$map.item.included}"},children:[{tagName:"jx-checkbox",attributes:{part:"include","data-path":"${$map.item.path}"},$props:{checked:{$ref:"$map/item/included"},label:{$ref:"$map/item/includeLabel"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/include"},value:[{$ref:"$map/item/path"},{$ref:"event#/target/checked"}]}]}},{tagName:"span",attributes:{part:"file-text"},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}",title:"${$map.item.statusWord}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"compare","data-path":"${$map.item.path}"},$props:{icon:"columns",size:"sm",quiet:!0,label:{$ref:"$map/item/compareLabel"},hint:"Before and after"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/compare"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"discard","data-path":"${$map.item.path}"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:{$ref:"$map/item/discardLabel"},hint:{$ref:"$map/item/discardHint"},disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"Nothing to publish. Files you edit and save show up here, ready to review."}}}]},{tagName:"section",attributes:{part:"history"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Recent commits"},{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/commitsState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"No commits yet. Each change set you publish becomes a version you can come back to."}}}]}]},{tagName:"div",attributes:{part:"publish-column"},children:[{tagName:"section",attributes:{part:"checks"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Checks"},{tagName:"ul",attributes:{part:"check-list"},children:[{$prototype:"Array",items:{$ref:"#/state/checks"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"check","data-check":"${$map.item.key}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"check-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"check-text"},textContent:"${$map.item.text}"},{tagName:"span",attributes:{part:"check-action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",attributes:{part:"check-action",title:"${$map.item.actionTitle}","data-check":"${$map.item.key}"},$props:{size:"sm",disabled:{$ref:"$map/item/actionDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runCheck"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}}]}}]}]},{tagName:"section",attributes:{part:"destination","data-jx-region":"${state.commitRegion}","aria-labelledby":"${state.destinationId}"},children:[{tagName:"h3",attributes:{part:"section-heading",id:"${state.destinationId}"},textContent:"Where should these changes go?"},{tagName:"jx-action-group",attributes:{part:"destinations"},$props:{selects:"single",label:"Destination",compact:!1,orientation:"vertical"},children:[{$prototype:"Array",items:{$ref:"#/state/destinations"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"destination-card","data-destination":"${$map.item.value}"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},disabled:{$ref:"$map/item/disabled"},hint:{$ref:"$map/item/reason"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickDestination"},value:[{$ref:"$map/item/value"}]}]},children:[{tagName:"span",attributes:{part:"choice-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"choice-note"},textContent:"${$map.item.note}"}]}}]},{tagName:"div",attributes:{part:"refusal-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRefusal"},cases:{true:{tagName:"p",attributes:{part:"refusal"},textContent:"${state.refusal}"}}},{tagName:"jx-field",attributes:{part:"summary-field"},$props:{label:"Summary",span:!0,description:"Saved with the change as its commit message."},children:[{tagName:"jx-textfield",attributes:{part:"summary"},$props:{multiline:!0,size:"sm",placeholder:"Describe what changed, e.g. Add a pricing page",value:{$ref:"#/state/summary"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editSummary"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"publish-actions"},children:[{tagName:"jx-button",attributes:{part:"publish-button","data-destination":"${state.destination}"},$props:{variant:"accent",size:"md",disabled:{$ref:"#/state/primaryDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/publish"},value:[]}]},children:[{tagName:"span",textContent:"${state.primaryLabel}"}]},{tagName:"div",attributes:{part:"blocker-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBlocker"},cases:{true:{tagName:"p",attributes:{part:"blocker"},textContent:"${state.blocker}"}}}]},{tagName:"div",attributes:{part:"review-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/reviewState"},cases:{opened:{tagName:"p",attributes:{part:"review-line"},children:[{tagName:"span",attributes:{part:"review-text"},textContent:"${state.reviewLine}"},{tagName:"jx-button",attributes:{part:"open-review"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/reviewUrl"}]}]},children:[{tagName:"span",textContent:"Open pull request"}]}]}}}]}]}]}}},deploys:{tagName:"div",attributes:{part:"deploys"},children:[{tagName:"section",attributes:{part:"live"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Live"},{tagName:"div",attributes:{part:"live-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLiveUrl"},cases:{true:{tagName:"div",attributes:{part:"live-site"},children:[{tagName:"span",attributes:{part:"live-url"},textContent:"${state.liveUrl}"},{tagName:"jx-button",attributes:{part:"visit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/liveUrl"}]}]},children:[{tagName:"jx-icon",$props:{name:"globe"}},{tagName:"span",textContent:"Visit site"}]}]},false:{tagName:"p",attributes:{part:"live-none"},textContent:"${state.liveNone}"}}},{tagName:"p",attributes:{part:"live-summary"},textContent:"${state.liveSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/deployCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"div",attributes:{part:"running-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/runningState"},cases:{running:{tagName:"section",attributes:{part:"running"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Publishing now"},{$prototype:"Array",items:{$ref:"#/state/running"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"activity"},children:[{tagName:"div",attributes:{part:"activity-head"},children:[{tagName:"span",attributes:{part:"activity-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"activity-status"},textContent:"${$map.item.status}"}]},{tagName:"ol",attributes:{part:"activity-steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"activity-step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}]}}]}}},{tagName:"section",attributes:{part:"deploy-history"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"History"},{tagName:"jx-action-button",attributes:{part:"reload-deploys"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh deployments",hint:"Ask the host again",disabled:{$ref:"#/state/deploysBusy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/reloadDeployments"},value:[]}]}}]},{tagName:"div",attributes:{part:"deploys-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/deploysState"},cases:{listed:{tagName:"div",attributes:{part:"history-rows",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ol",attributes:{part:"deployment-list"},children:[{$prototype:"Array",items:{$ref:"#/state/history"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"deployment","data-environment":"${$map.item.environment}"},children:[{tagName:"span",attributes:{part:"deployment-when"},textContent:"${$map.item.when}"},{tagName:"span",attributes:{part:"deployment-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"deployment-status","data-status":"${$map.item.statusKey}",title:"${$map.item.statusDetail}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"open-deployment"},$props:{icon:"arrow-square-out",size:"sm",quiet:!0,label:{$ref:"$map/item/openLabel"},hint:{$ref:"$map/item/url"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"$map/item/url"}]}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"The host reports no deployments of this project yet."}}},loading:{tagName:"p",attributes:{part:"status"},textContent:"Asking the host for its deployments…"},note:{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.deploysNote}"}}}]},{tagName:"section",attributes:{part:"previews"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Branch previews"},{tagName:"div",attributes:{part:"previews-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/previewsState"},cases:{listed:{tagName:"ol",attributes:{part:"deployment-list"},children:[{$prototype:"Array",items:{$ref:"#/state/previews"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"deployment","data-environment":"${$map.item.environment}"},children:[{tagName:"span",attributes:{part:"deployment-when"},textContent:"${$map.item.when}"},{tagName:"span",attributes:{part:"deployment-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"deployment-status","data-status":"${$map.item.statusKey}",title:"${$map.item.statusDetail}"},textContent:"${$map.item.status}"},{tagName:"jx-action-button",attributes:{part:"open-deployment"},$props:{icon:"arrow-square-out",size:"sm",quiet:!0,label:{$ref:"$map/item/openLabel"},hint:{$ref:"$map/item/url"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"$map/item/url"}]}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"No previews. A branch pushed to the remote is deployed as a preview of its own, with its own address."}}}]}]},branches:{tagName:"div",attributes:{part:"branches"},children:[{tagName:"section",attributes:{part:"branch-list-section"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Branches"},{tagName:"jx-button",attributes:{part:"new-branch"},$props:{size:"sm",disabled:{$ref:"#/state/newBranchDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newBranch"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"New branch"}]}]},{tagName:"p",attributes:{part:"branch-summary"},textContent:"${state.branchSummary}"},{tagName:"div",attributes:{part:"branch-note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBranchNote"},cases:{true:{tagName:"p",attributes:{part:"branch-note"},textContent:"${state.branchNote}"}}},{tagName:"div",attributes:{part:"branches-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/branchesState"},cases:{listed:{tagName:"ul",attributes:{part:"branch-list"},children:[{$prototype:"Array",items:{$ref:"#/state/branches"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"branch","data-branch":"${$map.item.name}","data-current":"${$map.item.current}"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"span",attributes:{part:"branch-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"branch-state",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/current"},cases:{true:{tagName:"span",attributes:{part:"current"},children:[{tagName:"span",attributes:{part:"current-tag"},textContent:"Current"},{tagName:"span",attributes:{part:"branch-sync"},textContent:"${$map.item.note}"}]},false:{tagName:"jx-button",attributes:{part:"switch","data-branch":"${$map.item.name}"},$props:{size:"sm",label:{$ref:"$map/item/switchName"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/checkout"},value:[{$ref:"$map/item/name"}]}]},children:[{tagName:"span",textContent:"${$map.item.switchLabel}"}]}}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.branchesEmpty}"}}}]}]},hosting:{tagName:"div",attributes:{part:"hosting"},children:[{tagName:"section",attributes:{part:"source"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Where your project is saved"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.sourceSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/sourceCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"section",attributes:{part:"host"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Where your site is hosted"},{tagName:"p",attributes:{part:"host-name"},textContent:"${state.hostTitle}"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.hostSummary}"},{tagName:"div",attributes:{part:"command-row"},children:[{$prototype:"Array",items:{$ref:"#/state/hostCommands"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"command","data-command":"${$map.item.id}",title:"${$map.item.title}"},$props:{size:"sm",disabled:{$ref:"$map/item/disabled"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}]},{tagName:"section",attributes:{part:"build"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"How it is built"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"The build adapter decides what the build produces: static files, or a server for sign-in and data routes."},{tagName:"div",$description:"The mount box for the Deploy section (`settings/project-sections.ts` `renderDeploySection`, `surfaces/settings-deploy.json`), which moved here from Project Settings (studio.md §17.1). The flow is handed this node by `onNodeCreated` and mounts the section into it; nothing in this document styles what lands here.",attributes:{part:"adapter-island",role:"none"}}]},{tagName:"section",attributes:{part:"address"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Your address"},{tagName:"div",attributes:{part:"domain-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/domainState"},cases:{set:{tagName:"div",attributes:{part:"live-site"},children:[{tagName:"span",attributes:{part:"live-url"},textContent:"${state.domain}"},{tagName:"jx-button",attributes:{part:"visit"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openUrl"},value:[{$ref:"#/state/domain"}]}]},children:[{tagName:"jx-icon",$props:{name:"globe"}},{tagName:"span",textContent:"Visit site"}]}]}}},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.domainNote}"}]},{tagName:"section",attributes:{part:"checklist"},children:[{tagName:"h3",attributes:{part:"section-heading"},textContent:"Deploy checklist"},{tagName:"p",attributes:{part:"hosting-summary"},textContent:"${state.checklistSummary}"},{tagName:"ol",attributes:{part:"checklist-steps"},children:[{$prototype:"Array",items:{$ref:"#/state/checklistSteps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"checklist-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-label"},textContent:"${$map.item.text}"}]}}]}]}]}}}]},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"busy",role:"status"},textContent:"Working…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]};L("publish-workspace",lt);function Pt(){return{allIncluded:!1,blocker:"",branchNote:"",branchSummary:"",branches:[],branchesEmpty:"",branchesState:"empty",busy:!1,canClone:!1,checklistSteps:[],checklistSummary:"",checks:[],commitRegion:"",commits:[],commitsState:"empty",deployCommands:[],deploysBusy:!1,deploysNote:"",deploysState:"note",destination:"live",destinationId:"",destinations:[],domain:"",domainNote:"",domainState:"none",error:"",filesState:"empty",groups:[],hasBlocker:!1,hasBranchNote:!1,hasError:!1,hasLastUpdated:!1,hasLiveUrl:!1,hasRefusal:!1,headline:"",history:[],historyState:"empty",hostCommands:[],hostSummary:"",hostTitle:"",includedLabel:"",lastUpdated:"",liveNone:"",liveSummary:"",liveUrl:"",mood:"loading",newBranchDisabled:!1,panelId:"",previews:[],previewsState:"empty",primaryDisabled:!0,primaryLabel:"",pullLabel:"Pull",pushLabel:"Push",refusal:"",region:"",remoteState:"local",reviewLine:"",reviewState:"none",reviewUrl:"",running:[],runningState:"none",someIncluded:!1,sourceCommands:[],sourceSummary:"",summary:"",syncLabel:"",tab:"review",tabTitle:"",tabs:[],titleId:""}}function Rt(t){let e=t?.$map,a=v(e)?e.item:void 0,r=v(a)?a.path:void 0;return n(r)?r:""}function Dt(t){let e=n(t)?void 0:t.attributes?.part;return n(e)?e:""}function pt(t,e,a){t.replaceChildren();let{adapterHost:r,compareHost:i,...l}=a,o=g({...Pt(),...l});Object.assign(o,e);let c=null,m=!1,f=R("publish-workspace",o,t,{onNodeCreated:(d,y,j,w)=>{if(m||!(d instanceof HTMLElement))return;let h=Dt(j);if(h==="adapter-island")r(d);else if(h==="compare")i(d,Rt(w))}}).then((d)=>{if(m)d.dispose();else c=d;return d.root});return{attached:()=>{if(m)return!1;let d=c?.root;return d===void 0?!0:d instanceof HTMLElement&&t.contains(d)},dispose(){m=!0,c?.dispose(),c=null},ready:f,update:(d)=>{Object.assign(o,d)}}}async function V(){let t=Ri();if(!t||!Ul()||u.publish.deploys.state==="loading")return;let e=u.publish.deploys,a=t.projectName,r=()=>u.publish.deploys!==e||Ri()?.projectName!==a;e.state="loading",e.project=a;try{let i=await KT(t);if(r()){dt(e);return}e.rows=i,e.error="",e.state="loaded",Od(i[0]??null)}catch(i){if(r()){dt(e);return}e.rows=[],e.error=Q(i),e.state="failed"}}function dt(t){if(u.publish.deploys===t)t.state="idle"}function bt(){let t=YT(),{deploys:e}=u.publish;return e.state==="loaded"&&t!==null&&!e.rows.some((a)=>a.id===t.id)}function Lt(){return u.publish.deploys.state==="idle"||bt()}function sR(t){if(u.publish.tab=t,t==="review"&&u.git.logEntries===null&&u.git.status?.isRepo)cS();if(t==="deploys"&&(u.publish.deploys.state!=="loaded"||bt()))V()}var Tt=new Map([["done",{icon:"check",label:"Passed"}],["failed",{icon:"x",label:"Failed"}],["running",{icon:"spinner",label:"Running"}],["todo",{icon:"warning-circle",label:"To do"}],["unknown",{icon:"question",label:"Not checked yet"}]]);function ct(t){return Tt.get(t)??{icon:"question",label:"Not checked yet"}}function At(t){return`${t} ${t===1?"change":"changes"}`}function gt(){return u.git.status?.files??[]}function O(){let t=u.git.status?.remotes;return Array.isArray(t)&&t.length>0?t[0]??"":""}function E(){if(!S)return"no-project";let{error:t,loading:e,status:a}=u.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function F(){return u.git.branches?.current||u.git.status?.branch||""}function mt(){let{status:t}=u.git,e=t?.ahead?`${t.ahead} ahead`:"",a=t?.behind?`${t.behind} behind`:"";return e||a?[e,a].filter(Boolean).join(", "):"Up to date"}function Ht(t){if(t==="no-repo")return"Not tracked by git yet";if(t!=="repo")return"";let e=gt().length;return`${F()?`On ${F()}`:"On a branch with no name yet"} · ${e>0?`${At(e)} to publish`:"nothing to publish"}`}function It(t){return{files:t.files.map((e)=>({...e,compareLabel:`Before and after: ${e.label}`,discardHint:e.cannotDiscard?"A new file has no saved version to go back to":"Discard changes",discardLabel:`Discard changes to ${e.path}`,includeLabel:`Include ${e.path}`})),key:t.key,name:t.name}}function T(t){let e=ae();if(!e)return[];return t.flatMap((a)=>{let r=e.get(a);if(!r||!e.isVisible(a))return[];let i=e.disabledReason(a);return[{disabled:i!==void 0,id:a,label:r.title,title:i?`${r.title}: requires ${i}`:r.title}]})}function Wt(t){let e={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,icon:ct(t.state).icon,iconLabel:ct(t.state).label,key:t.key,state:t.state,text:t.text};if(t.key==="build"){if(t.state==="running"||!s_())return e;let r=t.state==="unknown"?"Check build":"Check again";return{...e,actionLabel:r,actionTitle:r,hasAction:!0}}let[a]=t.command?T([t.command]):[];return a?{...e,actionDisabled:a.disabled,actionLabel:a.label,actionTitle:a.title,hasAction:!0}:e}function Bt(t){let[e]=t.filter((a)=>a.environment==="production"&&ft(a)).toSorted((a,r)=>Date.parse(r.createdOn)-Date.parse(a.createdOn));return e?.id??""}function ft(t){return t.status==="success"&&t.stage==="deploy"}function zt(t,e){if(t.status==="failure")return"Failed";if(t.status==="canceled")return"Canceled";if(!ft(t))return"Building…";if(t.environment!=="production")return"Ready";return t.id===e?"Live":"Replaced"}function ut(t,e){let r=t.environment==="production"?`Production${t.branch?` · ${t.branch}`:""}`:t.branch||"Preview";return{environment:t.environment,key:t.id,label:r,openLabel:`Open ${r}`,status:zt(t,e),statusDetail:`${t.stage}: ${t.status}`,statusKey:t.status,url:t.url,when:xw(t.createdOn)}}function Et(){if(!Ul())return{deploysNote:"This host cannot reach the Cloudflare API, so deployments are not listed here. Your host runs bunx jx build and serves dist/.",deploysState:"note"};if(!Ri())return{deploysNote:"Connect a host under Hosting, and every deployment it makes is listed here.",deploysState:"note"};if(u.publish.deploys.state==="failed")return{deploysNote:`The host did not answer: ${u.publish.deploys.error}`,deploysState:"note"};return{deploysNote:"",deploysState:u.publish.deploys.state==="loaded"?"listed":"loading"}}function Ft(){return u.publish.deploys.project===Ri()?.projectName?u.publish.deploys.rows:[]}function yt(){return Ri()?.productionUrl||S?.projectConfig?.url||""}function Mt(t){let e=Ri();if(e?.productionUrl)return"Cloudflare Pages serves it. A custom domain is added on the Cloudflare dashboard.";if(e)return"Cloudflare has not reported an address yet. A custom domain is added on the Cloudflare dashboard.";return t?"The Production URL in Project Settings › Overview. No host is connected yet; once one is, point this domain at it on the host's dashboard.":"Your site gets an address when a host is connected, or set its Production URL in Project Settings › Overview."}function Ut(t){if(!Ri())return yt()?"No host is connected, so Studio cannot say what is deployed there. Connect one under Hosting.":"";let e=t.find((o)=>o.environment==="production"),a=YT(),r=a&&(a.environment==="production"||!e)?a:void 0,[i]=[e,r].filter((o)=>o!==void 0).toSorted((o,c)=>Date.parse(c.createdOn)-Date.parse(o.createdOn));if(!i)return"No deployment has been observed yet.";let l=i.branch?` from ${i.branch}`:"";return`Last deployed ${xw(i.createdOn)}${l} · ${i.stage}: ${i.status}`}function Vt(){let{status:t}=u.git;if(!S)return"";if(!t)return"Source control has not reported on this project yet.";if(!t.isRepo)return"Not tracked by git yet. A repository keeps every version you publish.";let e=F()||"an unnamed branch",a=O();if(Vs())return`Saved on GitHub${a?` (${a})`:""}, on ${e}. Every commit lands there as it is made.`;return a?`Saved in git and pushed to ${a}, on ${e}.`:`Saved in git on this machine only, on ${e}. A host builds from a remote, so create the GitHub repository next.`}function Ot(){let{status:t}=u.git;if(!t)return["git.signInToGithub"];if(!t.isRepo)return["git.init","git.signInToGithub"];if(O()==="")return["git.createGithubRepository","git.signInToGithub"];return Vs()?["git.signInToGithub"]:["git.push","git.signInToGithub"]}function Jt(){let t=Ri();if(t)return{hostSummary:`Every publish is pushed to the remote and built by Cloudflare Pages${t.productionUrl?` at ${t.productionUrl}`:""}.`,hostTitle:`Cloudflare Pages: ${t.projectName}`};if(_e()&&p().cfConnect)return{hostSummary:"Runs on Cloudflare with nothing to configure: connect it, and every publish builds and deploys.",hostTitle:"Jx Cloud, on Cloudflare"};if(Ul())return{hostSummary:"Connect a Cloudflare API token, and every publish builds and deploys on your own account.",hostTitle:"Your Cloudflare account"};return{hostSummary:"This host cannot reach Cloudflare. Choose a build adapter below; your host runs bunx jx build and serves dist/.",hostTitle:"Another host"}}function ht(t){let e=t.replaceAll(/[^\w-]/g,"-"),a=E(),{git:r}=u,i=gt(),l=i.filter((s)=>s.staged).length,{destination:o,tab:c}=u.publish,m=Kf(o),f=a==="repo"?Jf(m):"",d=o==="review"?zg():"",y=uR(),j=r.logEntries??[],w=Ri(),h=yt(),x=Ft(),J=x.filter((s)=>s.environment==="preview"),q=Bt(x),G=cs.filter((s)=>s.source==="Publish"&&!Ac(s)),_=r.branches?.branches??[],H=r.branches?.current??"",P=Vs(),I=O(),K=ZT(),b=i.length;return{...Et(),...Jt(),allIncluded:b>0&&l===b,blocker:f,branchNote:P?"Each branch opens in its own session, so switching reloads Studio on that branch.":"",branchSummary:H?`On ${H}`:"",branches:_.map((s)=>({current:s===H,key:s,name:s,note:I?mt():"Local only",switchLabel:P?"Switch and reload":"Switch",switchName:P?`Switch to ${s} and reload`:`Switch to ${s}`})),branchesEmpty:a==="no-repo"?"This project is not tracked by git yet.":"No branches yet. The first commit makes one.",branchesState:_.length>0?"listed":"empty",busy:r.loading,canClone:wb(),checklistSteps:K.steps,checklistSummary:K.summary,checks:a==="repo"?Wg().map((s)=>Wt(s)):[],commitRegion:`${t}/commit`,commits:j.map((s)=>CT(s)),commitsState:j.length>0?"listed":"empty",deployCommands:T(w?["publish.deploy","publish.openDashboard"]:["publish.setUp"]),deploysBusy:u.publish.deploys.state==="loading",destination:m,destinationId:`${e}-destination`,destinations:Ty(o),domain:h,domainNote:Mt(h),domainState:h?"set":"none",error:r.error??"",filesState:b>0?"listed":"empty",groups:ST(i).map((s)=>It(s)),hasBlocker:f!=="",hasBranchNote:P,hasError:Boolean(r.error),hasLastUpdated:Boolean(r.lastUpdated),hasLiveUrl:h!=="",hasRefusal:d!=="",headline:Ht(a),history:x.map((s)=>ut(s,q)),historyState:x.length>0?"listed":"empty",hostCommands:T(w?["publish.setUp","publish.openDashboard"]:["publish.setUp"]),includedLabel:b>0?`${l} of ${b} included`:"",lastUpdated:kT(r.lastUpdated),liveNone:w?"The host has not reported an address for this site yet.":"No host is connected. Connect one under Hosting, and every publish ships to it.",liveSummary:Ut(x),liveUrl:h,mood:a,newBranchDisabled:r.loading||a!=="repo",panelId:`${e}-body`,previews:J.map((s)=>ut(s,q)),previewsState:J.length>0?"listed":"empty",primaryDisabled:a!=="repo"||f!=="",primaryLabel:lR(m),pullLabel:r.status?.behind?`Pull (${r.status.behind} behind)`:"Pull",pushLabel:r.status?.ahead?`Push (${r.status.ahead} ahead)`:"Push",refusal:d,region:t,remoteState:I?"remote":"local",reviewLine:y?`Pull request #${y.number} is open for review.`:"",reviewState:y?"opened":"none",reviewUrl:y?.url??"",running:G.map((s)=>GT(s)),runningState:G.length>0?"running":"none",someIncluded:l>0&&l<b,sourceCommands:T(Ot()),sourceSummary:Vt(),summary:r.commitMessage,syncLabel:I?mt():"Local only (no remote)",tab:c,tabTitle:QS[c],tabs:Lm.map((s)=>({label:s==="review"&&b>0?`${QS[s]} (${b})`:QS[s],value:s})),titleId:`${e}-title`}}var k=new Map,M=new WeakMap;function $t(){return S?.projectConfig?.build?.adapter||"static"}function qt(t){let e=$t(),a=k.get(t);if(!a?.isConnected||M.get(a)===e)return;M.set(a,e),D(a)}function Gt(t){if(t==="build"){cR();return}let e=Wg().find((a)=>a.key===t);if(e?.command)nt(e.command,void 0,"Publish")}function _t(t){return{adapterHost:(e)=>{let a=k.get(t);if(a&&a!==e)z(a);k.set(t,e),M.set(e,$t()),D(e)},checkout:(e)=>{_T(e)},clone:()=>{pT()},compare:(e)=>{U=e,fT(e)},compareHost:(e,a)=>{let r=A.get(t);if(!r)r=new Map,A.set(t,r);r.set(a,e)},createRepository:()=>{nt("git.createGithubRepository",void 0,"Publish")},discard:(e)=>{wT(e)},editSummary:(e)=>{u.git.commitMessage=e},fetch:()=>{mT()},include:(e,a)=>{bT(e,a)},includeAll:(e)=>{vT(e)},initRepository:()=>{nt("git.init",void 0,"Publish")},newBranch:()=>{xT()},openUrl:(e)=>{if(e)Lb(e)},pickDestination:(e)=>{if(tx(e))u.publish.destination=e},publish:()=>{Ly(Kf(u.publish.destination))},pull:()=>{gT()},push:()=>{nt("git.push",void 0,"Publish")},refresh:()=>{ks()},reloadDeployments:()=>{V()},run:(e)=>{nt(e,void 0,"Publish")},runCheck:Gt,selectTab:(e)=>{if(sA(e))sR(e)}}}var C=new Map,A=new Map,U=null,vt=new Set;async function wt(t,e){await e.handle.ready;let a=U===null?void 0:A.get(t)?.get(U);if(a?.isConnected)(a.querySelector('[part="control"]')??a).focus()}function xk(t){let e=C.get(t);if(e?.wrap.isConnected&&e.handle.attached()){wt(t,e);return}vt.add(t)}function o_(t,e){let a=C.get(t);return a!==void 0&&a.tabId===e.id&&a.wrap.isConnected&&a.handle.attached()}function r_(t){let e=C.get(t);if(!e)return;e.scope.stop();let a=k.get(t);if(a)z(a);e.handle.dispose(),C.delete(t),k.delete(t),A.delete(t)}function _k(t,e){let{paneId:a,wrap:r}=t;if(o_(a,e))return;if(r_(a),_e()&&E()==="loading")ks();sR(u.publish.tab);let i=Qn(a,"publish"),l=pt(r,ht(i),_t(a)),o=ge();o.run(()=>{ne(()=>{let m=ht(i);if(m.mood==="repo")ET();if(l.update(m),qt(a),m.tab==="deploys"&&Lt())V()}),ne(()=>{if(u.publish.tab==="review"&&E()==="repo")yT()})});let c={handle:l,scope:o,tabId:e.id,wrap:r};if(C.set(a,c),vt.delete(a))wt(a,c)}
2
- export{rR,sR,xk,o_,r_,_k};
3
-
4
- //# debugId=3F346571C9BE0C7D64756E2164756E21
5
- //# sourceMappingURL=studio-6cwj6xrx.js.map
@@ -1,6 +0,0 @@
1
- import{p}from"./studio-jws1a87n.js";import{S}from"./studio-cg710sk9.js";import{rf}from"./studio-hz5n7x27.js";import{oe}from"./studio-wc6za3zs.js";import{v,Qx}from"./studio-8z66jk4z.js";async function Iw(e,o){return p().codeService(e,o)}async function sN(e){return p().locateFile(e)}var Vu=new Map;async function Rw(e,o){let s=e.$prototype?S?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||s;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(Vu.has(r))return Vu.get(r);try{let n=p(),i=!s&&o.documentPath?`${location.origin}/${o.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return Vu.set(r,a),a}catch{return Vu.set(r,null),null}}function HT(e,o){let s=e.getModel();if(!s)return;let t=rf();if(!t)return;let r=o.flatMap((n)=>{let i=n.labels?.[0];if(!i)return[];let{line:a,column:c,length:u}=i.span;return[{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:c+(u||1),endLineNumber:a,message:n.message+(n.help?`
2
- ${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:c,startLineNumber:a}]});t.editor.setModelMarkers(s,"oxlint",r)}function aN(e,o){let s=(t)=>{if(!v(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return Qx(r)};if(e.type==="def"){let t=e.defName?s(o?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!o||!e.path)return["state","event"];let t=oe(o,e.path),r=t&&e.eventKey?s(t[e.eventKey]):null;if(r)return r}return["state","event"]}
3
- export{Iw,sN,Vu,Rw,HT,aN};
4
-
5
- //# debugId=C85715B84DAAF0D064756E2164756E21
6
- //# sourceMappingURL=studio-78pywnp2.js.map
@@ -1,5 +0,0 @@
1
- import{Q}from"./studio-nqxqf8p2.js";import{Oe,ir,Ud,h}from"./studio-k2sz13zg.js";import{C}from"./studio-y60sts62.js";import{p}from"./studio-jws1a87n.js";import{Ne,xa,Bc}from"./studio-sevbc3xv.js";import{ei}from"./studio-0w2dr0q8.js";import{lw,db}from"./studio-4jhw38b2.js";import{xS}from"./studio-qyed0ah6.js";import{Co}from"./studio-2r90cts3.js";import{Vt,zi}from"./studio-cg710sk9.js";import{oe}from"./studio-wc6za3zs.js";import{_,it}from"./studio-8z66jk4z.js";function ew(){let t=h.value,e=Oe(t?.session.selection);if(!t||!e||e.length<2)return null;let o=oe(t.doc.document,e);if(!o||!o.tagName)return null;return{node:o,path:e}}async function am(){let t=ew();if(!t)return;let e=await b(g(t.node));if(!e)return;await hE(e.toLowerCase())}async function hE(t){let e=h.value,o=ew();if(!e||!o)return null;let{node:m,path:f}=o,l=v(m);l.tagName=t;let r=`components/${t}.json`,c=Bc(e.documentPath,r),u=f;if(!Ud(e,(n)=>{let s=Vt(u)??[],d=zi(u),a=n;for(let i of s)a=a[i];if(!Array.isArray(a.children))a.children=[];if(a.children[d]={tagName:t},!n.$elements)n.$elements=[];if(!n.$elements.some((i)=>_(i)&&("$ref"in i)&&i.$ref===c))n.$elements.push({$ref:c})}))return null;try{await p().writeFile(r,Co(l,null)),await xa();let s=xS(l);if(C.success(`Converted to <${t}>`),s)C.warn(`<${t}> has a slot problem: ${s}`,{path:r,source:"Components",tier:"problem"});return r}catch(n){return C.error(`Could not save the <${t}> component.`,{detail:Q(n),path:r,source:"Components"}),null}}function g(t){if(t.$id){let o=db(t.$id);if(o!=="")return o}let e=(it(t.tagName)||"div").toLowerCase();return e.includes("-")?e:db(e)}function v(t){let e=ir(t);return delete e.$id,delete e.$layout,delete e.$paths,e}function N(t){let e=t.trim().toLowerCase(),o=lw(e);if(o!=="")return o;return Ne.some((m)=>m.tagName===e)?`Component <${e}> already exists`:""}function b(t){return ei("Convert to Component",{confirmLabel:"Convert",message:"Enter a hyphenated tag name for the new component.",placeholder:"my-component",validate:N,value:t})}
2
- export{ew,am,hE};
3
-
4
- //# debugId=A4A0F22B2A5791EC64756E2164756E21
5
- //# sourceMappingURL=studio-886t6ztg.js.map
@@ -1,5 +0,0 @@
1
- import{p,_e}from"./studio-jws1a87n.js";import{lM,cM}from"./studio-ea74s8c1.js";import{ph}from"./studio-t98vq4r6.js";import{ln,dv,uv,h}from"./studio-k2sz13zg.js";import{S}from"./studio-cg710sk9.js";function i(t){return t.ownerDocument.defaultView?.getComputedStyle(t).display==="contents"}function He(t){let e=t.getBoundingClientRect();if(e.width>0||e.height>0||!t.hasChildNodes()||!i(t))return e;let n=null;for(let r of t.childNodes){let o=null;if(r instanceof Element)o=He(r);else if(r.nodeType===Node.TEXT_NODE){let s=t.ownerDocument.createRange();s.selectNodeContents(r),o=s.getBoundingClientRect()}if(!o||o.width===0&&o.height===0)continue;n=n?{bottom:Math.max(n.bottom,o.bottom),left:Math.min(n.left,o.left),right:Math.max(n.right,o.right),top:Math.min(n.top,o.top)}:{bottom:o.bottom,left:o.left,right:o.right,top:o.top}}return n?new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top):e}function cx(t,e,n=document){return n.elementFromPoint(t,e)}var Js=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),i$=new Set([".mp4",".webm",".mov",".m4v"]),o$=new Set([".mp3",".wav",".ogg",".m4a",".flac"]),Ys=new Set([...Js,...i$,...o$,".pdf",".woff",".woff2",".ttf",".otf"]);function tn(t){let e=t.lastIndexOf(".");return e>0?t.slice(e).toLowerCase():""}function Dp(t){return Js.has(t.startsWith(".")?t.toLowerCase():`.${t.toLowerCase()}`)}function oh(){let t=_e()?p().canvasUrl:void 0;if(t)return new URL(t,location.href).origin;return location.origin}function Wb(){let t=_e()?p().canvasUrl:void 0;if(!t)return null;let e=new URL(t,location.href);return e.origin===location.origin?e.searchParams.get("rpcToken"):null}function Fd(t){let e=oh(),n=_e()?p().documentBaseUrl:void 0;if(n){let o=n.endsWith("/")?n:`${n}/`;return new URL(o,`${e}/`).href}let r=t||"";return`${e}/${r?`${r}/`:""}`}function rC(t){if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http")||t.startsWith("views://"))return t;let e=oh();if((e.startsWith("http:")||e.startsWith("https:"))&&e!==location.origin)return`${e}/${t.replace(/^\.?\//,"")}`;return t}function r$(){return ln(S?.projectConfig??{}).i18n?.locales??[]}function Vb(t,e){let n=e?.space??"site",r=dv(t,S?.projectConfig?.content,r$());if(n==="site"&&!r)return null;let o={documentDir:cM(t??""),lanes:lM,mounts:r?[r]:[],space:n};if(e?.fileBaseUrl!==void 0)o.fileBaseUrl=e.fileBaseUrl;return o}function qc(t){return Ub(t,h.value?.documentPath)}function Ub(t,e){if(!t)return t;let n=Vb(e,rh()),r=n&&{...n,versions:ph()};return rC(uv(t,r)??t)}function rh(){let t={fileBaseUrl:Fd(S?.projectRoot)};if(_e())t.space=p().assetSpace;return t}
2
- export{He,cx,Js,i$,o$,Ys,tn,Dp,oh,Wb,Fd,rC,r$,Vb,qc,Ub,rh};
3
-
4
- //# debugId=2A54804C6068BD7B64756E2164756E21
5
- //# sourceMappingURL=studio-8wnvtr4z.js.map
@@ -1,5 +0,0 @@
1
- function n(e){return typeof e==="string"}function Z(e){return typeof e==="number"}function Ze(e){return typeof e==="boolean"}function bM(e){return typeof e==="bigint"}function Iv(e){return typeof e==="symbol"}function ee(e){return typeof e==="function"}function _(e){return typeof e==="object"&&e!==null}function df(e){return e===null||n(e)||Z(e)||Ze(e)}function v(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Me(e){return v(e)&&typeof e.$ref==="string"}function Fa(e){return v(e)&&e.$prototype==="Function"}function nc(e){return v(e)&&v(e.$expression)}function Xx(e){return nc(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function pI(e){return Fa(e)&&Array.isArray(e.body)}function Rv(e){return v(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function fI(e){return v(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Go(e){return v(e)&&e.$prototype==="Array"}function Gn(e){return v(e)}function ja(e){return typeof e==="string"&&e.includes("${")}function mI(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function ml(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Di(e,t){let r=e?.[t];return ml(r)?r:void 0}function nd(e,t){let r=e[t];if(ml(r))return r;let o={};return e[t]=o,o}function uf(e){return Me(e)||Fa(e)||nc(e)}function Qm(e,t){let r=e[t];return uf(r)?r:void 0}function Qx(e){if(!e)return[];return e.map((t)=>n(t)?t:t.name)}function i(e){return typeof e==="string"}function Ih(e){if(typeof e!=="object"||e===null||Array.isArray(e)||!v(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return v(t.cases)&&Object.values(t.cases).every((r)=>n(r))&&typeof t.default==="string";return!1}function gI(e){if(i(e))return[e];if(!Ih(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}function it(e){return i(e)?e:gI(e).join("|")}function id(e){return e.startsWith("#")}
2
- export{n,Z,Ze,bM,Iv,ee,_,df,v,Me,Fa,nc,Xx,pI,Rv,fI,Go,Gn,ja,mI,ml,Di,nd,uf,Qm,Qx,Ih,gI,it,id};
3
-
4
- //# debugId=CE54EED024751AF464756E2164756E21
5
- //# sourceMappingURL=studio-8z66jk4z.js.map