@jxsuite/studio 5.5.0 → 5.6.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 (221) hide show
  1. package/LICENSE +1 -1
  2. package/dist/chunks/{2020-g8mwpbkq.js → 2020-zvax9fmb.js} +3 -3
  3. package/dist/chunks/adapter-6zhjbpmd.js +4 -0
  4. package/dist/chunks/cf-account-picker-zfycs4k2.js +4 -0
  5. package/dist/chunks/cf-settings-fpa485q3.js +4 -0
  6. package/dist/chunks/components-b0vh4sq8.js +4 -0
  7. package/dist/chunks/content-source-z5t0d0h9.js +4 -0
  8. package/dist/chunks/convert-to-repeater-x19jr6c7.js +4 -0
  9. package/dist/chunks/editor-7e23n4a8.js +4 -0
  10. package/dist/chunks/entry-commands-5cm6aba2.js +4 -0
  11. package/dist/chunks/extension-sections-y90sa0n4.js +4 -0
  12. package/dist/chunks/file-ops-hv7gf757.js +4 -0
  13. package/dist/chunks/files-kb0epdxf.js +4 -0
  14. package/dist/chunks/format-host-eg1wy2bp.js +4 -0
  15. package/dist/chunks/fs-events-ky3vxfmh.js +4 -0
  16. package/dist/chunks/git-panel-yyg3bzp2.js +4 -0
  17. package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
  18. package/dist/chunks/grid-view-d9mybhn0.js +51 -0
  19. package/dist/chunks/iframe-host-9wdf0hes.js +4 -0
  20. package/dist/chunks/index-2tf0m2ne.js +4 -0
  21. package/dist/chunks/{index-arg188jq.js → index-vnwy9d44.js} +3 -3
  22. package/dist/chunks/{javascript-zcdmye2k.js → javascript-f0nrbdjb.js} +2 -2
  23. package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-nfa90dtf.js} +5 -5
  24. package/dist/chunks/jx-validate-7w11db9v.js +4 -0
  25. package/dist/chunks/layers-7zasrpse.js +4 -0
  26. package/dist/chunks/layers-panel-9nzc4fdq.js +4 -0
  27. package/dist/chunks/lit-html-5qr7nbng.js +4 -0
  28. package/dist/chunks/media-picker-maevn9d4.js +4 -0
  29. package/dist/chunks/menu-wq6q0v3y.js +4 -0
  30. package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-antn79jf.js} +3 -3
  31. package/dist/chunks/monaco-buffer-9ry2rn5x.js +4 -0
  32. package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-k8s40vwg.js} +3 -3
  33. package/dist/chunks/notify-g91gjd6w.js +4 -0
  34. package/dist/chunks/platform-jdwjp2vt.js +4 -0
  35. package/dist/chunks/publish-panel-8yym447p.js +4 -0
  36. package/dist/chunks/quick-search-9bzm9kh3.js +4 -0
  37. package/dist/chunks/references-znssfqvq.js +4 -0
  38. package/dist/chunks/right-panel-czbzktm8.js +4 -0
  39. package/dist/chunks/section-registry-0rtq73qs.js +4 -0
  40. package/dist/chunks/studio-011em5cf.js +5 -0
  41. package/dist/chunks/studio-02y9cb4h.js +6 -0
  42. package/dist/chunks/{studio-7gqyhjns.js → studio-09n3fyy0.js} +4 -4
  43. package/dist/chunks/{studio-xcng8nx7.js → studio-0c3fpdqj.js} +5 -5
  44. package/dist/chunks/studio-0mm38y62.js +5 -0
  45. package/dist/chunks/studio-0nm2skex.js +4 -0
  46. package/dist/chunks/{studio-73czgk6a.js → studio-153mwkyq.js} +4 -4
  47. package/dist/chunks/{studio-f8jyp45j.js → studio-1pxvgx1t.js} +4 -4
  48. package/dist/chunks/studio-27tc8q0h.js +5 -0
  49. package/dist/chunks/studio-28pz4s1k.js +5 -0
  50. package/dist/chunks/{studio-x5esgzct.js → studio-36s6qjgq.js} +4 -4
  51. package/dist/chunks/studio-4yztve2t.js +5 -0
  52. package/dist/chunks/{studio-x9sagq2d.js → studio-5fc0728f.js} +7 -7
  53. package/dist/chunks/{studio-7jazdy6y.js → studio-654fxcr0.js} +4 -4
  54. package/dist/chunks/studio-6exg5z4x.js +4 -0
  55. package/dist/chunks/studio-6k1eswp9.js +5 -0
  56. package/dist/chunks/{studio-5wfrgee9.js → studio-6zyt56ek.js} +4 -4
  57. package/dist/chunks/studio-7djymzt2.js +5 -0
  58. package/dist/chunks/{studio-b4epb26c.js → studio-7w04zw8h.js} +7 -7
  59. package/dist/chunks/studio-805fwp9k.js +5 -0
  60. package/dist/chunks/{studio-k1eaqyzm.js → studio-81twpmzj.js} +4 -4
  61. package/dist/chunks/studio-891t1tv9.js +5 -0
  62. package/dist/chunks/{studio-5n1km79v.js → studio-9n2j9nqk.js} +4 -4
  63. package/dist/chunks/{studio-he2fhrgp.js → studio-9tkaykt5.js} +4 -4
  64. package/dist/chunks/studio-ant1zbp3.js +5 -0
  65. package/dist/chunks/studio-b29h7g7s.js +5 -0
  66. package/dist/chunks/studio-b5rxwkj2.js +5 -0
  67. package/dist/chunks/studio-d007j0z3.js +7 -0
  68. package/dist/chunks/studio-dknr8m7b.js +14 -0
  69. package/dist/chunks/{studio-eq27rrr0.js → studio-dmymvk2j.js} +3 -3
  70. package/dist/chunks/studio-dtmdjmqb.js +5 -0
  71. package/dist/chunks/studio-eb5sty2k.js +5 -0
  72. package/dist/chunks/{studio-hc9q4j24.js → studio-ebt49j3c.js} +5 -5
  73. package/dist/chunks/studio-eegyf5vg.js +5 -0
  74. package/dist/chunks/studio-frv7vjhw.js +5 -0
  75. package/dist/chunks/studio-ft8pfpp0.js +5 -0
  76. package/dist/chunks/{studio-mhhc9btt.js → studio-gj4j9e7k.js} +4 -4
  77. package/dist/chunks/{studio-hf4qdjc8.js → studio-gxna6yta.js} +4 -4
  78. package/dist/chunks/studio-je15p5v8.js +6 -0
  79. package/dist/chunks/{studio-21enxdr8.js → studio-jsr14n1s.js} +4 -4
  80. package/dist/chunks/studio-k9pwvmz8.js +5 -0
  81. package/dist/chunks/{studio-p1eggxcf.js → studio-ks0ecgjx.js} +3 -3
  82. package/dist/chunks/studio-mb8jhtr4.js +64 -0
  83. package/dist/chunks/studio-mf41717j.js +5 -0
  84. package/dist/chunks/{studio-625ezz59.js → studio-mm8x32gg.js} +4 -4
  85. package/dist/chunks/{studio-pkkw32j0.js → studio-n2e133d6.js} +4 -4
  86. package/dist/chunks/{studio-c4pnt1c6.js → studio-njmg0e73.js} +5 -5
  87. package/dist/chunks/studio-nvykrgbj.js +4 -0
  88. package/dist/chunks/studio-nw4q9sdn.js +5 -0
  89. package/dist/chunks/studio-p6avneaq.js +5 -0
  90. package/dist/chunks/studio-pvj970st.js +5 -0
  91. package/dist/chunks/studio-r7yeeqc4.js +5 -0
  92. package/dist/chunks/studio-s85vah66.js +6 -0
  93. package/dist/chunks/studio-sadckcpp.js +7 -0
  94. package/dist/chunks/studio-sgzss898.js +9 -0
  95. package/dist/chunks/{studio-7by9a93k.js → studio-t0v47dpc.js} +4 -4
  96. package/dist/chunks/{studio-jnb285we.js → studio-tj28pxa1.js} +4 -4
  97. package/dist/chunks/{studio-6j2jn55a.js → studio-tzs6njnb.js} +8 -8
  98. package/dist/chunks/studio-vz7b43ng.js +5 -0
  99. package/dist/chunks/studio-w8w9frjy.js +16 -0
  100. package/dist/chunks/{studio-xc8ebsts.js → studio-wr0pq67n.js} +4 -4
  101. package/dist/chunks/{studio-8r4y2x0z.js → studio-y164brht.js} +4 -4
  102. package/dist/chunks/studio-y17505ge.js +928 -0
  103. package/dist/chunks/studio-ymsjnvp9.js +5 -0
  104. package/dist/chunks/studio-z1vdxq0e.js +5 -0
  105. package/dist/chunks/studio-z47mm077.js +10 -0
  106. package/dist/chunks/studio-zkkdbbvd.js +9 -0
  107. package/dist/chunks/{studio-awqghqxv.js → studio-zkvyd3ev.js} +4 -4
  108. package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-eq26t9gs.js} +5 -5
  109. package/dist/chunks/workspace-emt8454d.js +4 -0
  110. package/dist/chunks/ws-client-3gxqp06s.js +4 -0
  111. package/dist/iframe-entry.js +14 -14
  112. package/dist/manifest.json +62 -59
  113. package/dist/studio.css +1 -1
  114. package/dist/studio.js +115 -117
  115. package/package.json +5 -5
  116. package/src/account/action-flow.ts +294 -0
  117. package/src/account/action-required.ts +68 -0
  118. package/src/account-status.ts +29 -1
  119. package/src/browse/library-model.ts +3 -1
  120. package/src/browse/library-preview.ts +6 -2
  121. package/src/canvas/asset-refs.ts +3 -1
  122. package/src/canvas/asset-resolve.ts +79 -1
  123. package/src/canvas/iframe-entry.ts +38 -1
  124. package/src/canvas/iframe-host.ts +85 -0
  125. package/src/canvas/iframe-protocol.ts +13 -0
  126. package/src/files/asset-versions.ts +294 -0
  127. package/src/files/files.ts +61 -9
  128. package/src/files/fs-events.ts +279 -28
  129. package/src/files/media-meta.ts +2 -1
  130. package/src/files/media-paths.ts +5 -2
  131. package/src/files/media-upload.ts +5 -1
  132. package/src/new-project/add-repo-modal.ts +12 -1
  133. package/src/new-project/new-project-modal.ts +12 -1
  134. package/src/panels/git-panel.ts +25 -2
  135. package/src/platform-errors.ts +61 -1
  136. package/src/platforms/cloud.ts +389 -50
  137. package/src/platforms/devserver.ts +17 -1
  138. package/src/publish/pages-service.ts +17 -7
  139. package/src/services/ai-models.ts +30 -6
  140. package/src/services/ai-system-prompt.ts +81 -51
  141. package/src/settings/preferences-accounts.ts +42 -3
  142. package/src/settings/preferences-dialog.ts +8 -1
  143. package/src/studio.ts +18 -1
  144. package/src/surfaces/dialog.ts +5 -0
  145. package/src/surfaces/welcome.json +86 -1
  146. package/src/surfaces/welcome.ts +61 -2
  147. package/src/types.ts +84 -2
  148. package/src/ui/ai-managed-connect.ts +41 -4
  149. package/src/ui/media-picker.ts +2 -1
  150. package/dist/chunks/adapter-bsbs78x9.js +0 -4
  151. package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
  152. package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
  153. package/dist/chunks/components-s51h3b7c.js +0 -4
  154. package/dist/chunks/content-source-ty3be0qg.js +0 -4
  155. package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
  156. package/dist/chunks/editor-t002b41m.js +0 -4
  157. package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
  158. package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
  159. package/dist/chunks/file-ops-78zeytkm.js +0 -4
  160. package/dist/chunks/files-gatzrz8v.js +0 -4
  161. package/dist/chunks/format-host-r59b1651.js +0 -4
  162. package/dist/chunks/fs-events-f8h91ndt.js +0 -4
  163. package/dist/chunks/git-panel-y12zf7nj.js +0 -4
  164. package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
  165. package/dist/chunks/grid-view-tafenfm2.css +0 -1
  166. package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
  167. package/dist/chunks/index-5aghyrfh.js +0 -4
  168. package/dist/chunks/jx-validate-653krkrf.js +0 -4
  169. package/dist/chunks/layers-32p8gtae.js +0 -4
  170. package/dist/chunks/layers-panel-rs58m105.js +0 -4
  171. package/dist/chunks/lit-html-54bmkwz3.js +0 -4
  172. package/dist/chunks/media-picker-5bb04wct.js +0 -4
  173. package/dist/chunks/menu-cbha7w2e.js +0 -4
  174. package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
  175. package/dist/chunks/notify-dc1nz5ar.js +0 -4
  176. package/dist/chunks/platform-2m49s1zf.js +0 -4
  177. package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
  178. package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
  179. package/dist/chunks/references-vx7mbj9f.js +0 -4
  180. package/dist/chunks/right-panel-7jzpbxja.js +0 -4
  181. package/dist/chunks/section-registry-gjryse41.js +0 -4
  182. package/dist/chunks/studio-3znfhcxg.js +0 -5
  183. package/dist/chunks/studio-58qam27v.js +0 -4
  184. package/dist/chunks/studio-6j59fwaw.js +0 -5
  185. package/dist/chunks/studio-7z69g1gx.js +0 -5
  186. package/dist/chunks/studio-93j3v6zx.js +0 -5
  187. package/dist/chunks/studio-9gf6v8zy.js +0 -5
  188. package/dist/chunks/studio-9rhmettf.js +0 -4
  189. package/dist/chunks/studio-ac5aq677.js +0 -10
  190. package/dist/chunks/studio-as65vbns.js +0 -5
  191. package/dist/chunks/studio-bkv0sga4.js +0 -6
  192. package/dist/chunks/studio-bttmqef4.js +0 -5
  193. package/dist/chunks/studio-c3y9d41k.js +0 -5
  194. package/dist/chunks/studio-ccegp7gz.js +0 -9
  195. package/dist/chunks/studio-chxabn98.js +0 -6
  196. package/dist/chunks/studio-cktcdsxz.js +0 -16
  197. package/dist/chunks/studio-cnspfke5.js +0 -5
  198. package/dist/chunks/studio-de3p1ktm.js +0 -5
  199. package/dist/chunks/studio-fsbcn530.js +0 -928
  200. package/dist/chunks/studio-gftga7a3.js +0 -64
  201. package/dist/chunks/studio-hf1rpcq0.js +0 -4
  202. package/dist/chunks/studio-hz02hq70.js +0 -5
  203. package/dist/chunks/studio-jsv3s3s1.js +0 -5
  204. package/dist/chunks/studio-ks7cksh0.js +0 -5
  205. package/dist/chunks/studio-nptx0dbs.js +0 -5
  206. package/dist/chunks/studio-pg0z7k98.js +0 -5
  207. package/dist/chunks/studio-pve0b2f2.js +0 -5
  208. package/dist/chunks/studio-q7zmjv3b.js +0 -6
  209. package/dist/chunks/studio-rpmvw7kj.js +0 -5
  210. package/dist/chunks/studio-rwhss52s.js +0 -5
  211. package/dist/chunks/studio-sbg3g3h0.js +0 -5
  212. package/dist/chunks/studio-sq1bn60g.js +0 -14
  213. package/dist/chunks/studio-vwz7rma2.js +0 -5
  214. package/dist/chunks/studio-wa55e8gf.js +0 -5
  215. package/dist/chunks/studio-x0mzdha2.js +0 -5
  216. package/dist/chunks/studio-xrgpakvc.js +0 -9
  217. package/dist/chunks/studio-xt3djk1w.js +0 -7
  218. package/dist/chunks/studio-yh3nggx1.js +0 -7
  219. package/dist/chunks/studio-zmecp6hq.js +0 -5
  220. package/dist/chunks/workspace-g6dvaete.js +0 -4
  221. package/dist/chunks/ws-client-shf41j5p.js +0 -4
@@ -1,5 +1,5 @@
1
- import{re,S}from"./studio-9rhmettf.js";var Ke={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function EL(){return m+=1,m}var l=new Map;function Ji(e){let n=l.get(e);if(!n)n=g(e),l.set(e,n);return n}function g(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function Wu(){return[...l.values()]}function Nl(e){if(!e)return null;for(let n of l.values())if(n.wrap?.contains(e))return n;return null}function v(e){for(let n of e.panels)n.renderScope?.stop(),n.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function TL(e,n){let r=Ji(e);return r.wrap=n,v(r),r}function LL(e){if(l.get(e))$C(e);let r=g(e);return l.set(e,r),r}var b=null;function IL(e){b=e}function $C(e){let n=l.get(e);if(!n)return;b?.(n),v(n),w(e)}function w(e){l.delete(e)}var Vu="commit";function gm(e){let n=new Map,r=new Map,o=new Map,a=!1,u=!1,c=!1;function f(t,i){if(typeof i?.then!=="function")return i;let s=i.finally(()=>{if(o.get(t)===s)o.delete(t)});return o.set(t,s),s}let d={arm(t,i,s){clearTimeout(n.get(t)),r.set(t,s),n.set(t,setTimeout(()=>{n.delete(t),r.delete(t),f(t,s())},i))},cancel(){for(let t of n.values())clearTimeout(t);n.clear(),r.clear()},flush(t){let i=r.get(t);if(!i)return o.get(t);return clearTimeout(n.get(t)),n.delete(t),r.delete(t),f(t,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var C={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,n,r){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=C[n];return S.warn(`${c} was discarded — it was never ${f} "${u}".`,{...r?{detail:y(r.error)}:{},key:`buffer-discarded:${n}:${a?.id??"none"}`,source:d,...a?.documentPath?{path:a.documentPath}:{}}),!1}function y(e){return e instanceof Error?e.stack??e.message:String(e)}function bm(e,n){let r=e?._writes;if(!e||!r)return!0;let o;try{o=r.flush(Vu)}catch(a){return r.cancel(),p(e,n,{error:a})}if(r.cancel(),typeof o?.then==="function")return o.then(()=>p(e,n,null),(a)=>p(e,n,{error:a})),!0;return p(e,n,null)}function DC(e){e?._writes?.cancel()}function xc(e){return Boolean(e?.getModel())}function Uu(e,n){if(!xc(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return n!==void 0&&e.getValue()!==n}function h(e){let n=re(e);return[...Wu().map((o)=>o.monacoEditor),Ke.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&re(o._editingTab)===n&&xc(o))}async function mp(e){for(let n of h(e)){if(!xc(n))continue;try{await n._writes?.flush(Vu)}catch(r){S.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,{detail:r instanceof Error?r.stack??r.message:String(r),key:`buffer-commit:${e.id}`,source:"Editor",...e.documentPath?{path:e.documentPath}:{}})}}}function vm(e){return h(e).some((n)=>n._writes?.typed()===!0)}
2
- export{Ke,EL,Ji,Wu,Nl,TL,LL,IL,$C,Vu,gm,bm,DC,xc,Uu,mp,vm};
1
+ import{re,S}from"./studio-0nm2skex.js";var Je={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function sI(){return m+=1,m}var l=new Map;function Yi(e){let n=l.get(e);if(!n)n=g(e),l.set(e,n);return n}function g(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function Ju(){return[...l.values()]}function jl(e){if(!e)return null;for(let n of l.values())if(n.wrap?.contains(e))return n;return null}function v(e){for(let n of e.panels)n.renderScope?.stop(),n.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function aI(e,n){let r=Yi(e);return r.wrap=n,v(r),r}function lI(e){if(l.get(e))rS(e);let r=g(e);return l.set(e,r),r}var b=null;function cI(e){b=e}function rS(e){let n=l.get(e);if(!n)return;b?.(n),v(n),w(e)}function w(e){l.delete(e)}var Yu="commit";function Tm(e){let n=new Map,r=new Map,o=new Map,a=!1,u=!1,c=!1;function f(t,i){if(typeof i?.then!=="function")return i;let s=i.finally(()=>{if(o.get(t)===s)o.delete(t)});return o.set(t,s),s}let d={arm(t,i,s){clearTimeout(n.get(t)),r.set(t,s),n.set(t,setTimeout(()=>{n.delete(t),r.delete(t),f(t,s())},i))},cancel(){for(let t of n.values())clearTimeout(t);n.clear(),r.clear()},flush(t){let i=r.get(t);if(!i)return o.get(t);return clearTimeout(n.get(t)),n.delete(t),r.delete(t),f(t,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var C={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,n,r){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=C[n];return S.warn(`${c} was discarded — it was never ${f} "${u}".`,{...r?{detail:y(r.error)}:{},key:`buffer-discarded:${n}:${a?.id??"none"}`,source:d,...a?.documentPath?{path:a.documentPath}:{}}),!1}function y(e){return e instanceof Error?e.stack??e.message:String(e)}function Lm(e,n){let r=e?._writes;if(!e||!r)return!0;let o;try{o=r.flush(Yu)}catch(a){return r.cancel(),p(e,n,{error:a})}if(r.cancel(),typeof o?.then==="function")return o.then(()=>p(e,n,null),(a)=>p(e,n,{error:a})),!0;return p(e,n,null)}function sS(e){e?._writes?.cancel()}function Ec(e){return Boolean(e?.getModel())}function Zu(e,n){if(!Ec(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return n!==void 0&&e.getValue()!==n}function h(e){let n=re(e);return[...Ju().map((o)=>o.monacoEditor),Je.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&re(o._editingTab)===n&&Ec(o))}async function kp(e){for(let n of h(e)){if(!Ec(n))continue;try{await n._writes?.flush(Yu)}catch(r){S.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,{detail:r instanceof Error?r.stack??r.message:String(r),key:`buffer-commit:${e.id}`,source:"Editor",...e.documentPath?{path:e.documentPath}:{}})}}}function Im(e){return h(e).some((n)=>n._writes?.typed()===!0)}
2
+ export{Je,sI,Yi,Ju,jl,aI,lI,cI,rS,Yu,Tm,Lm,sS,Ec,Zu,kp,Im};
3
3
 
4
- //# debugId=6B2C7F1BD65E0C5A64756E2164756E21
5
- //# sourceMappingURL=studio-7jazdy6y.js.map
4
+ //# debugId=E7FC4BC9BEA2AFB164756E2164756E21
5
+ //# sourceMappingURL=studio-654fxcr0.js.map
@@ -0,0 +1,4 @@
1
+ import{Fg,Ns,zy,Vr,Wy,as}from"./studio-tzs6njnb.js";var ck="meta",dk="frontmatter",uk="structure",hk="source",pk=2;function Xc(t){return t.getMap(ck)}function fk(t){return t.getMap(dk)}function Sf(t){return t.getMap(uk)}function mk(t){return t.getText(hk)}function f(t){return JSON.parse(JSON.stringify(t))}function h(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var y=new Set(["textContent"]),m=new Set(["style","attributes","$props"]);function g(t,e){let n=t.toString();if(n===e)return!1;let r=0,o=Math.min(n.length,e.length);while(r<o&&n[r]===e[r])r+=1;let i=n.length,a=e.length;while(i>r&&a>r&&n[i-1]===e[a-1])i-=1,a-=1;if(i>r)t.delete(r,i-r);if(a>r)t.insert(r,e.slice(r,a));return!0}function l(t){let e=new Vr;for(let[n,r]of Object.entries(t)){if(r===void 0)continue;e.set(n,h(r)?l(r):f(r))}return e}function Y(t,e){for(let n of[...t.keys()])if(!(n in e)||e[n]===void 0)t.delete(n);for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o=t.get(n);if(h(r))if(o instanceof Vr)Y(o,r);else t.set(n,l(r));else if(!b(o,r))t.set(n,f(r))}}function b(t,e){if(t===e)return!0;if(t instanceof Vr||t instanceof Ns||t instanceof as)return!1;return JSON.stringify(t??null)===JSON.stringify(e??null)}function p(t){return typeof t==="string"?new as(t):gk(t)}function Wh(t){let e=new Ns;return e.insert(0,t.map((n)=>p(n))),e}function gk(t){if(!h(t))throw TypeError("collab-schema: a document node must be a plain object");let e=new Vr;for(let[n,r]of Object.entries(t)){if(r===void 0)continue;if(n==="children"&&Array.isArray(r))e.set(n,Wh(r));else if(y.has(n)&&typeof r==="string")e.set(n,new as(r));else if(m.has(n)&&h(r))e.set(n,l(r));else e.set(n,f(r))}return e}function Qc(t){if(t instanceof Vr){let e={};for(let[n,r]of t.entries())e[n]=Qc(r);return e}if(t instanceof Ns)return t.toArray().map((e)=>Qc(e));if(t instanceof as)return t.toString();return t}function WR(t){return Qc(Sf(t))}function Hy(t,e){let n=Sf(t);for(let r of e)if(n instanceof Vr)n=n.get(String(r));else if(n instanceof Ns){let o=typeof r==="number"?r:Number(r);if(!Number.isInteger(o)||o<0||o>=n.length)return;n=n.get(o)}else return;return n}function g_(t,e,n){let r=mk(t);if(r.toString()===e)return!1;return t.transact(()=>{g(r,e)},n),!0}function VR(t,e,n={}){let r=Xc(t);if(r.get("structureSeeded")===!0)return!1;return t.transact(()=>{let o=Sf(t);for(let[a,s]of Object.entries(e)){if(s===void 0)continue;if(a==="children"&&Array.isArray(s))o.set(a,Wh(s));else o.set(a,f(s))}let i=fk(t);for(let[a,s]of Object.entries(n.frontmatter??{}))if(s!==void 0)i.set(a,f(s));r.set("schemaVersion",pk),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",n.sourceFormat??null),r.set("structureSeeded",!0)},n.origin),!0}var UR="jx-local",qR="jx-mirror",GR="jx-seed";class ed extends Error{constructor(t){super(`collab-path-unresolved:${t.join("/")}`);this.name="CollabPathError"}}function w(t,e){let n=Hy(t,e);if(!(n instanceof Vr))throw new ed(e);return n}function d(t,e,n){let r=w(t,e),o=r.get("children");if(o instanceof Ns)return o;if(n&&o===void 0){let i=new Ns;return r.set("children",i),i}throw new ed([...e,"children"])}function R(t){return JSON.parse(JSON.stringify(t))}function P(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function M(t,e,n){let r=t.get(e);if(e==="children"&&Array.isArray(n)){t.set(e,Wh(n));return}if(y.has(e)&&typeof n==="string"){if(r instanceof as)g(r,n);else t.set(e,new as(n));return}if(m.has(e)&&P(n)){if(r instanceof Vr)Y(r,n);else t.set(e,l(n));return}t.set(e,R(n))}function D(t,e){switch(e.op){case"set-key":{let n=w(t,e.path);if(e.value===void 0)n.delete(e.key);else M(n,e.key,e.value);return}case"insert-child":{let n=d(t,e.parentPath,!0);if(e.index<0||e.index>n.length)throw new ed([...e.parentPath,"children",e.index]);n.insert(e.index,[p(e.node)]);return}case"remove-child":{let n=d(t,e.parentPath,!1);if(e.index<0||e.index>=n.length)throw new ed([...e.parentPath,"children",e.index]);n.delete(e.index,1);return}case"set-child":{let n=d(t,e.parentPath,!1);if(e.index<0||e.index>=n.length)throw new ed([...e.parentPath,"children",e.index]);let r=n.get(e.index);if(r instanceof as&&typeof e.node==="string"){g(r,e.node);return}n.delete(e.index,1),n.insert(e.index,[p(e.node)]);return}case"move-child":{let n=d(t,e.fromParentPath,!1),r=d(t,e.toParentPath,!0);if(e.fromIndex<0||e.fromIndex>=n.length)throw new ed([...e.fromParentPath,"children",e.fromIndex]);let o=Qc(n.get(e.fromIndex));if(n.delete(e.fromIndex,1),e.toIndex<0||e.toIndex>r.length)throw new ed([...e.toParentPath,"children",e.toIndex]);r.insert(e.toIndex,[p(o)]);return}default:throw Error(`unknown-doc-op:${e.op}`)}}function KR(t,e,n){t.transact(()=>{for(let r of e)D(t,r)},n)}function C(t){for(let e=0;e<t.length;e++){let n=t[e];if(typeof n!=="string")continue;if(m.has(n))return{key:n,nodePath:t.slice(0,e)};if(y.has(n))return{key:n,nodePath:t.slice(0,e)}}return null}function J(t){return t.every((e)=>typeof e==="string"||typeof e==="number")}function JR(t){if(t.length===0)return[];let e=t.map((o)=>o.path);if(!e.every((o)=>J(o)))return null;for(let o=0;o<e.length;o++)for(let i=0;i<e.length;i++){if(o===i)continue;let a=e[o],s=e[i];if(a.length<=s.length&&a.every((c,u)=>c===s[u]))return null}if(t.filter((o)=>o instanceof Fg).length>1)return null;let r=[];for(let o of t){let i=o.path,a=C(i);if(a){let{doc:s}=o.target;if(!s)return null;let c=Hy(s,[...a.nodePath,a.key]);if(c===void 0)return null;r.push({key:a.key,op:"set-key",path:a.nodePath,value:Qc(c)});continue}if(o instanceof Wy){let s=i.at(-1);if(i.at(-2)==="children"&&typeof s==="number"){r.push({index:s,node:o.target.toString(),op:"set-child",parentPath:i.slice(0,-2)});continue}return null}if(o instanceof zy){let s=o.target;for(let[c,u]of o.changes.keys)if(u.action==="delete")r.push({key:c,op:"set-key",path:i});else r.push({key:c,op:"set-key",path:i,value:Qc(s.get(c))})}else if(o instanceof Fg){if(i.at(-1)!=="children")return null;let s=i.slice(0,-1),c=0;for(let u of o.changes.delta)if(u.retain!==void 0)c+=u.retain;else if(u.delete!==void 0)for(let x=0;x<u.delete;x++)r.push({index:c,op:"remove-child",parentPath:s});else if(u.insert!==void 0){let x=Array.isArray(u.insert)?u.insert:[u.insert];for(let O of x)r.push({index:c,node:Qc(O),op:"insert-child",parentPath:s}),c+=1}}else return null}return r}function YR(t,e,n){t.transact(()=>{let r=Sf(t),o=e,i=[...r.keys()];for(let s of i)if(!(s in o)||o[s]===void 0)r.delete(s);for(let[s,c]of Object.entries(o)){if(c===void 0)continue;if(s==="children"&&Array.isArray(c))r.set(s,Wh(c));else r.set(s,JSON.parse(JSON.stringify(c)))}let a=Xc(t);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},n)}function b_(t){return Xc(t).get("canonical")==="source"?"source":"structure"}function v_(t){return Number(Xc(t).get("canonicalRev")??0)}function ZR(t,e,n){if(b_(t)==="source")return!1;return t.transact(()=>{g_(t,e,n);let r=Xc(t);r.set("canonical","source"),r.set("canonicalRev",v_(t)+1)},n),!0}function XR(t,e){if(b_(t)!=="source")return!1;return t.transact(()=>{let n=Xc(t);n.set("canonical","structure"),n.set("canonicalRev",v_(t)+1)},e),!0}function QR(t,e,n){let r=[];for(let[o,i]of t.getStates()){let a=i;if(o!==n&&a.mode==="source"&&a.focusedPath===e)r.push(o)}return r}function e$(t,e){let n=t.clientID,r=t.getStates().get(n);if(r?.mode!=="source"||r.focusedPath!==e)return!1;let o=n;for(let[i,a]of t.getStates()){let s=a;if(s.mode==="source"&&s.focusedPath===e&&s.canWrite!==!1&&i<o)o=i}return o===n}var y_=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function t$(t){let e=5381;for(let r=0;r<t.length;r++)e=Math.imul(e,33)+(t.codePointAt(r)??0);let n=Math.abs(e)%y_.length;return y_[n]}export{ck,dk,uk,hk,pk,Xc,fk,Sf,mk,Wh,gk,Qc,WR,Hy,g_,VR,UR,qR,GR,ed,KR,JR,YR,b_,v_,ZR,XR,QR,e$,y_,t$};
2
+
3
+ //# debugId=A73E7CFFC32FEE4B64756E2164756E21
4
+ //# sourceMappingURL=studio-6exg5z4x.js.map
@@ -0,0 +1,5 @@
1
+ var i=globalThis;function fS(n){i.__jxPlatform=n}function Om(){return i.__jxLauncher}var e=new Map;function mS(){let n=[];for(let[r,a]of e)for(let t=0;t<a;t++)n.push(r);return n}function d(n){e.set(n,(e.get(n)??0)+1)}function m(n){let r=(e.get(n)??1)-1;if(r>0)e.set(n,r);else e.delete(n)}function h(n){let r=new Map;return new Proxy(n,{get(a,t){let o=Reflect.get(a,t);if(typeof o!=="function"||typeof t!=="string")return o;let f=r.get(t);if(f&&f.raw===o)return f.wrapper;let s=t,c=(...w)=>{let u=o.apply(a,w);if(typeof u?.then!=="function")return u;d(s);let g=()=>{m(s)};return u.then(g,g),u};return r.set(t,{raw:o,wrapper:c}),c}})}var l=null;function p(){let n=i.__jxPlatform;if(!n)throw Error("No platform registered. Call registerPlatform() before starting Studio.");if(l?.raw!==n)l={raw:n,wrapped:h(n)};return l.wrapped}function We(){return i.__jxPlatform!=null}
2
+ export{fS,Om,mS,p,We};
3
+
4
+ //# debugId=5316EB0E8CC8DFEF64756E2164756E21
5
+ //# sourceMappingURL=studio-6k1eswp9.js.map
@@ -1,5 +1,5 @@
1
- var f=["order","widths","hidden","sort","groupBy","filter"];function c(){try{return globalThis.localStorage??null}catch{return null}}function d(t){let e=c()?.getItem("jx-grid-layout:"+t);if(!e)return null;try{let n=JSON.parse(e);return typeof n==="object"&&n!==null?n:null}catch{return null}}function a(t,e){c()?.setItem("jx-grid-layout:"+t,JSON.stringify(e))}function u(t){let e={};for(let n of f)if(t[n]!==void 0)Object.assign(e,{[n]:t[n]});return e}function v(t){return JSON.stringify(f.map((e)=>t[e]??null))}function rc(t){let e=d(t);return e?u(e):null}function zh(t,e){if(!c())return;let i=d(t)??{},o={...i,widths:{...i.widths,...e.widths}};for(let r of f)if(r!=="widths"&&e[r]!==void 0)Object.assign(o,{[r]:e[r]});a(t,o)}function v_(t){let e=d(t);if(!e)return;a(t,{active:null,...e.views?{views:e.views}:{}})}function Wh(t){let e=d(t)?.views;return Array.isArray(e)?e.filter((n)=>typeof n?.name==="string"):[]}function Hy(t){return d(t)?.active??null}function xk(t){let e=d(t),n=e?.active;if(!e||!n)return!1;let i=Wh(t).find((o)=>o.name===n);return i?v(u(i))!==v(u(e)):!1}function _k(t,e){let n=e.trim(),i=c();if(n===""||!i)return null;let o=d(t)??{},r={name:n,...u(o)},s=Wh(t).filter((l)=>l.name!==n);return s.push(r),a(t,{...o,active:n,views:s}),r}function y_(t,e){let n=Wh(t).find((r)=>r.name===e);if(!n||!c())return null;let i=d(t)??{},o=u(n);return a(t,{active:n.name,views:i.views??[],...o}),o}function w_(t,e){let n=d(t);if(!n||!c())return!1;let i=Wh(t),o=i.filter((r)=>r.name!==e);if(o.length===i.length)return!1;return a(t,{...n,active:n.active===e?null:n.active??null,views:o}),!0}function Ck(t,e){if(!e)return t;let n=new Set(e.hidden),i=[];for(let r of t){if(r.field!==void 0&&n.has(r.field))continue;let s=r.field?e.widths?.[r.field]:void 0;i.push(s?{...r,width:s}:r)}if(!e.order?.length)return i;let o=new Map(e.order.map((r,s)=>[r,s]));return i.map((r,s)=>({def:r,index:s})).toSorted((r,s)=>{let l=o.get(r.def.field??"")??e.order.length+r.index,w=o.get(s.def.field??"")??e.order.length+s.index;return l-w}).map(({def:r})=>r)}
2
- export{rc,zh,v_,Wh,Hy,xk,_k,y_,w_,Ck};
1
+ var f=["order","widths","hidden","sort","groupBy","filter"];function c(){try{return globalThis.localStorage??null}catch{return null}}function d(t){let e=c()?.getItem("jx-grid-layout:"+t);if(!e)return null;try{let n=JSON.parse(e);return typeof n==="object"&&n!==null?n:null}catch{return null}}function a(t,e){c()?.setItem("jx-grid-layout:"+t,JSON.stringify(e))}function u(t){let e={};for(let n of f)if(t[n]!==void 0)Object.assign(e,{[n]:t[n]});return e}function v(t){return JSON.stringify(f.map((e)=>t[e]??null))}function lc(t){let e=d(t);return e?u(e):null}function Gh(t,e){if(!c())return;let i=d(t)??{},o={...i,widths:{...i.widths,...e.widths}};for(let r of f)if(r!=="widths"&&e[r]!==void 0)Object.assign(o,{[r]:e[r]});a(t,o)}function O_(t){let e=d(t);if(!e)return;a(t,{active:null,...e.views?{views:e.views}:{}})}function Kh(t){let e=d(t)?.views;return Array.isArray(e)?e.filter((n)=>typeof n?.name==="string"):[]}function Zy(t){return d(t)?.active??null}function Bk(t){let e=d(t),n=e?.active;if(!e||!n)return!1;let i=Kh(t).find((o)=>o.name===n);return i?v(u(i))!==v(u(e)):!1}function zk(t,e){let n=e.trim(),i=c();if(n===""||!i)return null;let o=d(t)??{},r={name:n,...u(o)},s=Kh(t).filter((l)=>l.name!==n);return s.push(r),a(t,{...o,active:n,views:s}),r}function M_(t,e){let n=Kh(t).find((r)=>r.name===e);if(!n||!c())return null;let i=d(t)??{},o=u(n);return a(t,{active:n.name,views:i.views??[],...o}),o}function P_(t,e){let n=d(t);if(!n||!c())return!1;let i=Kh(t),o=i.filter((r)=>r.name!==e);if(o.length===i.length)return!1;return a(t,{...n,active:n.active===e?null:n.active??null,views:o}),!0}function Wk(t,e){if(!e)return t;let n=new Set(e.hidden),i=[];for(let r of t){if(r.field!==void 0&&n.has(r.field))continue;let s=r.field?e.widths?.[r.field]:void 0;i.push(s?{...r,width:s}:r)}if(!e.order?.length)return i;let o=new Map(e.order.map((r,s)=>[r,s]));return i.map((r,s)=>({def:r,index:s})).toSorted((r,s)=>{let l=o.get(r.def.field??"")??e.order.length+r.index,w=o.get(s.def.field??"")??e.order.length+s.index;return l-w}).map(({def:r})=>r)}
2
+ export{lc,Gh,O_,Kh,Zy,Bk,zk,M_,P_,Wk};
3
3
 
4
- //# debugId=F335A6E7E2BAE71B64756E2164756E21
5
- //# sourceMappingURL=studio-5wfrgee9.js.map
4
+ //# debugId=A87170B3208EB28664756E2164756E21
5
+ //# sourceMappingURL=studio-6zyt56ek.js.map
@@ -0,0 +1,5 @@
1
+ var e=new Set;function vE(r){return e.add(r),()=>e.delete(r)}function yE(){let r=[];for(let t of e)try{let o=t();if(o)r.push(o)}catch{}return r}
2
+ export{vE,yE};
3
+
4
+ //# debugId=2EE4A360C9BE419164756E2164756E21
5
+ //# sourceMappingURL=studio-7djymzt2.js.map
@@ -1,8 +1,8 @@
1
- import{du,ae}from"./studio-7gqyhjns.js";var ne=ae(function(be){Object.defineProperty(be,"__esModule",{value:!0});be.bind=void 0;function at(e,r){var{type:t,listener:n,options:o}=r;return e.addEventListener(t,n,o),function i(){e.removeEventListener(t,n,o)}}be.bind=at});var Te=ae(function(k){var N=k&&k.__assign||function(){return N=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))e[o]=r[o]}return e},N.apply(this,arguments)};Object.defineProperty(k,"__esModule",{value:!0});k.bindAll=void 0;var it=ne();function xe(e){if(typeof e>"u")return;if(typeof e==="boolean")return{capture:e};return e}function ut(e,r){if(r==null)return e;var t=N(N({},e),{options:N(N({},xe(r)),xe(e.options))});return t}function lt(e,r,t){var n=r.map(function(o){var i=ut(o,t);return(0,it.bind)(e,i)});return function o(){n.forEach(function(i){return i()})}}k.bindAll=lt});var R=ae(function(V){Object.defineProperty(V,"__esModule",{value:!0});V.bindAll=V.bind=void 0;var ct=ne();Object.defineProperty(V,"bind",{enumerable:!0,get:function(){return ct.bind}});var st=Te();Object.defineProperty(V,"bindAll",{enumerable:!0,get:function(){return st.bindAll}})});function me(e){if(Array.isArray(e))return e}function ge(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,u,l=[],a=!0,c=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(n=i.call(t)).done)&&(l.push(n.value),l.length!==r);a=!0);}catch(d){c=!0,o=d}finally{try{if(!a&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(c)throw o}}return l}}function L(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function X(e,r){if(e){if(typeof e=="string")return L(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?L(e,r):void 0}}function ye(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,r){return me(e)||ge(e,r)||X(e,r)||ye()}var ot=du(R());var q="data-pdnd-honey-pot";function z(e){return e instanceof Element&&e.hasAttribute(q)}function G(e){var r=document.elementsFromPoint(e.x,e.y),t=B(r,2),n=t[0],o=t[1];if(!n)return null;if(z(n))return o!==null&&o!==void 0?o:null;return n}function H(e){return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},H(e)}function we(e,r){if(H(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(H(n)!="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function De(e){var r=we(e,"string");return H(r)=="symbol"?r:r+""}function da(e,r,t){return(r=De(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Y=du(R());var Ae=2147483647;var Oe={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent",width:"auto",height:"auto"};function A(e){var r=null;return function t(){if(!r){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var u=e.apply(this,o);r={result:u}}return r.result}}var Z=A(function e(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover==="function"});function Ee(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Se(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ee(Object(t),!0).forEach(function(n){da(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var U=2,Pe=U/2;function ft(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function dt(e){return{x:e.x-Pe,y:e.y-Pe}}function vt(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function mt(e){return{x:Math.min(e.x,window.innerWidth-U),y:Math.min(e.y,window.innerHeight-U)}}function je(e){var r=e.client,t=mt(vt(dt(ft(r))));return DOMRect.fromRect({x:t.x,y:t.y,width:U,height:U})}function Ie(e){var r=e.clientRect;return{left:"".concat(r.left,"px"),top:"".concat(r.top,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px")}}function gt(e){var{client:r,clientRect:t}=e;return r.x>=t.x&&r.x<=t.x+t.width&&r.y>=t.y&&r.y<=t.y+t.height}function yt(e){var r=e.initial,t=document.createElement("div");if(t.setAttribute(q,"true"),Z())t.setAttribute("popover","manual");var n=je({client:r});if(Object.assign(t.style,Se(Se({position:"fixed"},Z()?Oe:{zIndex:Ae}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},Ie({clientRect:n}))),document.body.appendChild(t),Z())t.showPopover();var o=Y.bind(window,{type:"pointermove",listener:function i(u){var l={x:u.clientX,y:u.clientY};n=je({client:l}),Object.assign(t.style,Ie({clientRect:n}))},options:{capture:!0}});return function i(u){var l=u.current;if(o(),gt({client:l,clientRect:n})){t.remove();return}function a(){c(),t.remove()}var c=Y.bindAll(window,[{type:"pointerdown",listener:a},{type:"pointermove",listener:a},{type:"focusin",listener:a},{type:"focusout",listener:a},{type:"dragstart",listener:a},{type:"dragenter",listener:a},{type:"dragover",listener:a}],{capture:!0})}}function Fe(){var e=null;function r(){return e=null,Y.bind(window,{type:"pointermove",listener:function n(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function t(){var n=null;return function o(i){var{eventName:u,payload:l}=i;if(u==="onDragStart"){var a=l.location.initial.input,c=e!==null&&e!==void 0?e:{x:a.clientX,y:a.clientY};n=yt({initial:c})}if(u==="onDrop"){var d,f=l.location.current.input;(d=n)===null||d===void 0||d({current:{x:f.clientX,y:f.clientY}}),n=null,e=null}}}return{bindEvents:r,getOnPostDispatch:t}}function He(e){if(Array.isArray(e))return L(e)}function Ce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return He(e)||Ce(e)||X(e)||Me()}var Xe=du(R());var Ne=A(function e(){return navigator.userAgent.includes("Firefox")});var W=A(function e(){var r=navigator,t=r.userAgent;return t.includes("AppleWebKit")&&!t.includes("Chrome")});function bt(e){return"nodeName"in e}function ke(e){return bt(e)&&e.ownerDocument!==document}var We=du(R());var Q={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};(function e(){if(typeof window>"u")return;if(!W())return;function r(){return{enterCount:0,isOverWindow:!1}}var t=r();function n(){t=r()}We.bindAll(window,[{type:"dragstart",listener:function o(){t.enterCount=0,t.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function o(i){if(!t.isOverWindow&&t.enterCount===0)i[Q.isEnteringWindow]=!0;t.isOverWindow=!0,t.enterCount++}},{type:"dragleave",listener:function o(i){if(t.enterCount--,t.isOverWindow&&t.enterCount===0)i[Q.isLeavingWindow]=!0,t.isOverWindow=!1}}],{capture:!0})})();function Ke(e){var r=e.dragLeave;if(!W())return!1;return r.hasOwnProperty(Q.isLeavingWindow)}function Le(e){var r=e.dragLeave,{type:t,relatedTarget:n}=r;if(t!=="dragleave")return!1;if(W())return Ke({dragLeave:r});if(n==null)return!0;if(Ne())return ke(n);return n instanceof HTMLIFrameElement}function Re(e){var r=e.onDragEnd;return[{type:"pointermove",listener:function(){var t=0;return function n(){if(t<20){t++;return}r()}}()},{type:"pointerdown",listener:r}]}function C(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var ht=function e(r){var t=[],n=null,o=function i(){for(var u=arguments.length,l=Array(u),a=0;a<u;a++)l[a]=arguments[a];if(t=l,n)return;n=requestAnimationFrame(function(){n=null,r.apply(void 0,t)})};return o.cancel=function(){if(!n)return;cancelAnimationFrame(n),n=null},o},Ue=ht;var oe=Ue(function(e){return e()}),_=function(){var e=null;function r(n){var o=requestAnimationFrame(function(){e=null,n()});e={frameId:o,fn:n}}function t(){if(e)cancelAnimationFrame(e.frameId),e.fn(),e=null}return{schedule:r,flush:t}}();function Ye(e){var{source:r,initial:t,dispatchEvent:n}=e,o={dropTargets:[]};function i(l){n(l),o={dropTargets:l.payload.location.current.dropTargets}}var u={start:function l(a){var c=a.nativeSetDragImage,d={current:t,previous:o,initial:t};i({eventName:"onGenerateDragPreview",payload:{source:r,location:d,nativeSetDragImage:c}}),_.schedule(function(){i({eventName:"onDragStart",payload:{source:r,location:d}})})},dragUpdate:function l(a){var c=a.current;_.flush(),oe.cancel(),i({eventName:"onDropTargetChange",payload:{source:r,location:{initial:t,previous:o,current:c}}})},drag:function l(a){var c=a.current;oe(function(){_.flush();var d={initial:t,previous:o,current:c};i({eventName:"onDrag",payload:{source:r,location:d}})})},drop:function l(a){var{current:c,updatedSourcePayload:d}=a;_.flush(),oe.cancel(),i({eventName:"onDrop",payload:{source:d!==null&&d!==void 0?d:r,location:{current:c,previous:o,initial:t}}})}};return u}var ue={isActive:!1};function Be(){return!ue.isActive}function xt(e){if(e.dataTransfer)return e.dataTransfer.setDragImage.bind(e.dataTransfer);return null}function Tt(e){var{current:r,next:t}=e;if(r.length!==t.length)return!0;for(var n=0;n<r.length;n++)if(r[n].element!==t[n].element)return!0;return!1}function wt(e){var{event:r,dragType:t,getDropTargetsOver:n,dispatchEvent:o}=e;if(!Be())return;var i=Dt({event:r,dragType:t,getDropTargetsOver:n});ue.isActive=!0;var u={current:i};ie({event:r,current:i.dropTargets});var l=Ye({source:t.payload,dispatchEvent:o,initial:i});function a(s){var p=Tt({current:u.current.dropTargets,next:s.dropTargets});if(u.current=s,p)l.dragUpdate({current:u.current})}function c(s){var p=C(s),m=z(s.target)?G({x:p.clientX,y:p.clientY}):s.target,g=n({target:m,input:p,source:t.payload,current:u.current.dropTargets});if(g.length)s.preventDefault(),ie({event:s,current:g});a({dropTargets:g,input:p})}function d(){if(u.current.dropTargets.length)a({dropTargets:[],input:u.current.input});l.drop({current:u.current,updatedSourcePayload:null}),f()}function f(){ue.isActive=!1,w()}var w=Xe.bindAll(window,[{type:"dragover",listener:function s(p){c(p),l.drag({current:u.current})}},{type:"dragenter",listener:c},{type:"dragleave",listener:function s(p){if(!Le({dragLeave:p}))return;if(a({input:u.current.input,dropTargets:[]}),t.startedFrom==="external")d()}},{type:"drop",listener:function s(p){if(u.current={dropTargets:u.current.dropTargets,input:C(p)},!u.current.dropTargets.length){d();return}p.preventDefault(),ie({event:p,current:u.current.dropTargets}),l.drop({current:u.current,updatedSourcePayload:t.type==="external"?t.getDropPayload(p):null}),f()}},{type:"dragend",listener:function s(p){u.current={dropTargets:u.current.dropTargets,input:C(p)},d()}}].concat(J(Re({onDragEnd:d}))),{capture:!0});l.start({nativeSetDragImage:xt(r)})}function ie(e){var r,{event:t,current:n}=e,o=(r=n[0])===null||r===void 0?void 0:r.dropEffect;if(o!=null&&t.dataTransfer)t.dataTransfer.dropEffect=o}function Dt(e){var{event:r,dragType:t,getDropTargetsOver:n}=e,o=C(r);if(t.startedFrom==="external")return{input:o,dropTargets:[]};var i=n({input:o,source:t.payload,target:r.target,current:[]});return{input:o,dropTargets:i}}var le={canStart:Be,start:wt};var ce=new Map;function At(e){var{typeKey:r,mount:t}=e,n=ce.get(r);if(n)return n.usageCount++,n;var o={typeKey:r,unmount:t(),usageCount:1};return ce.set(r,o),o}function Ve(e){var r=At(e);return function t(){if(r.usageCount--,r.usageCount>0)return;r.unmount(),ce.delete(e.typeKey)}}function mr(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return function n(){r.forEach(function(o){return o()})}}function ee(e,r){var{attribute:t,value:n}=r;return e.setAttribute(t,n),function(){return e.removeAttribute(t)}}function qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function F(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(t),!0).forEach(function(n){da(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function se(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ot(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function Ot(e,r){if(e){if(typeof e=="string")return ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ze(e,r):void 0}}function ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function pe(e){return e.slice(0).reverse()}function Ge(e){var{typeKey:r,defaultDropEffect:t}=e,n=new WeakMap,o="data-drop-target-for-".concat(r),i="[".concat(o,"]");function u(s){return n.set(s.element,s),function(){return n.delete(s.element)}}function l(s){if(!1)var p;var m=mr(ee(s.element,{attribute:o,value:"true"}),u(s));return A(m)}function a(s){var p,m,g,D,{source:y,target:h,input:b,result:T}=s,v=T===void 0?[]:T;if(h==null)return v;if(!(h instanceof Element)){if(h instanceof Node)return a({source:y,target:h.parentElement,input:b,result:v});return v}var P=h.closest(i);if(P==null)return v;var x=n.get(P);if(x==null)return v;var E={input:b,source:y,element:x.element};if(x.canDrop&&!x.canDrop(E))return a({source:y,target:x.element.parentElement,input:b,result:v});var S=(p=(m=x.getData)===null||m===void 0?void 0:m.call(x,E))!==null&&p!==void 0?p:{},j=(g=(D=x.getDropEffect)===null||D===void 0?void 0:D.call(x,E))!==null&&g!==void 0?g:t,O={data:S,element:x.element,dropEffect:j,isActiveDueToStickiness:!1};return a({source:y,target:x.element.parentElement,input:b,result:[].concat(J(v),[O])})}function c(s){var{eventName:p,payload:m}=s,g=se(m.location.current.dropTargets),D;try{for(g.s();!(D=g.n()).done;){var y,h=D.value,b=n.get(h.element),T=F(F({},m),{},{self:h});b===null||b===void 0||(y=b[p])===null||y===void 0||y.call(b,T)}}catch(v){g.e(v)}finally{g.f()}}var d={onGenerateDragPreview:c,onDrag:c,onDragStart:c,onDrop:c,onDropTargetChange:function s(p){var m=p.payload,g=new Set(m.location.current.dropTargets.map(function(K){return K.element})),D=new Set,y=se(m.location.previous.dropTargets),h;try{for(y.s();!(h=y.n()).done;){var b,T=h.value;D.add(T.element);var v=n.get(T.element),P=g.has(T.element),x=F(F({},m),{},{self:T});if(v===null||v===void 0||(b=v.onDropTargetChange)===null||b===void 0||b.call(v,x),!P){var E;v===null||v===void 0||(E=v.onDragLeave)===null||E===void 0||E.call(v,x)}}}catch(K){y.e(K)}finally{y.f()}var S=se(m.location.current.dropTargets),j;try{for(S.s();!(j=S.n()).done;){var O,M,re=j.value;if(D.has(re.element))continue;var ve=F(F({},m),{},{self:re}),I=n.get(re.element);I===null||I===void 0||(O=I.onDropTargetChange)===null||O===void 0||O.call(I,ve),I===null||I===void 0||(M=I.onDragEnter)===null||M===void 0||M.call(I,ve)}}catch(K){S.e(K)}finally{S.f()}}};function f(s){d[s.eventName](s)}function w(s){var{source:p,target:m,input:g,current:D}=s,y=a({source:p,target:m,input:g});if(y.length>=D.length)return y;var h=pe(D),b=pe(y),T=[];for(var v=0;v<h.length;v++){var P,x=h[v],E=b[v];if(E!=null){T.push(E);continue}var S=T[v-1],j=h[v-1];if((S===null||S===void 0?void 0:S.element)!==(j===null||j===void 0?void 0:j.element))break;var O=n.get(x.element);if(!O)break;var M={input:g,source:p,element:O.element};if(O.canDrop&&!O.canDrop(M))break;if(!((P=O.getIsSticky)!==null&&P!==void 0&&P.call(O,M)))break;T.push(F(F({},x),{},{isActiveDueToStickiness:!0}))}return pe(T)}return{dropTargetForConsumers:l,getIsOver:w,dispatchEvent:f}}function Et(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=St(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
5
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function St(e,r){if(e){if(typeof e=="string")return Ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,r):void 0}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Pt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$e(Object(t),!0).forEach(function(n){da(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Je(){var e=new Set,r=null;function t(i){if(!r)return;if(!i.canMonitor||i.canMonitor(r.canMonitorArgs))r.active.add(i)}function n(i){var u=Pt({},i);e.add(u),t(u);function l(){if(e.delete(u),r)r.active.delete(u)}return A(l)}function o(i){var{eventName:u,payload:l}=i;if(u==="onGenerateDragPreview"){r={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var a=Et(e),c;try{for(a.s();!(c=a.n()).done;){var d=c.value;t(d)}}catch(g){a.e(g)}finally{a.f()}}if(!r)return;var f=Array.from(r.active);for(var w=0,s=f;w<s.length;w++){var p=s[w];if(r.active.has(p)){var m;(m=p[u])===null||m===void 0||m.call(p,l)}}if(u==="onDrop")r.active.clear(),r=null}return{dispatchEvent:o,monitorForConsumers:n}}function Qe(e){var{typeKey:r,mount:t,dispatchEventToSource:n,onPostDispatch:o,defaultDropEffect:i}=e,u=Je(),l=Ge({typeKey:r,defaultDropEffect:i});function a(f){n===null||n===void 0||n(f),l.dispatchEvent(f),u.dispatchEvent(f),o===null||o===void 0||o(f)}function c(f){var{event:w,dragType:s}=f;le.start({event:w,dragType:s,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}function d(){function f(){var w={canStart:le.canStart,start:c};return t(w)}return Ve({typeKey:r,mount:f})}return{registerUsage:d,dropTarget:l.dropTargetForConsumers,monitor:u.monitorForConsumers}}var _e=A(function e(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),et="pdnd:android-fallback";var fe="text/plain";var tt="text/uri-list";var rt="application/vnd.pdnd";var te=new WeakMap;function jt(e){return te.set(e.element,e),function r(){te.delete(e.element)}}var nt=Fe(),de=Qe({typeKey:"element",defaultDropEffect:"move",mount:function e(r){return mr(nt.bindEvents(),ot.bind(document,{type:"dragstart",listener:function t(n){var o,i,u,l,a,c;if(!r.canStart(n))return;if(n.defaultPrevented)return;if(!n.dataTransfer)return;var d=n.target;if(!(d instanceof HTMLElement))return;var f=te.get(d);if(!f)return;var w=C(n),s={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:w};if(f.canDrag&&!f.canDrag(s)){n.preventDefault();return}if(f.dragHandle){var p=G({x:w.clientX,y:w.clientY});if(!f.dragHandle.contains(p)){n.preventDefault();return}}var m=(i=(u=f.getInitialDataForExternal)===null||u===void 0?void 0:u.call(f,s))!==null&&i!==void 0?i:null;if(m)for(var g=0,D=Object.entries(m);g<D.length;g++){var y=B(D[g],2),h=y[0],b=y[1];n.dataTransfer.setData(h,b!==null&&b!==void 0?b:"")}if(_e()&&!n.dataTransfer.types.includes(fe)&&!n.dataTransfer.types.includes(tt))n.dataTransfer.setData(fe,et);n.dataTransfer.setData(rt,"");var T={element:f.element,dragHandle:(l=f.dragHandle)!==null&&l!==void 0?l:null,data:(a=(c=f.getInitialData)===null||c===void 0?void 0:c.call(f,s))!==null&&a!==void 0?a:{}},v={type:"element",payload:T,startedFrom:"internal"};r.start({event:n,dragType:v})}}))},dispatchEventToSource:function e(r){var t,n,{eventName:o,payload:i}=r;(t=te.get(i.source.element))===null||t===void 0||(n=t[o])===null||n===void 0||n.call(t,i)},onPostDispatch:nt.getOnPostDispatch()}),{dropTarget:Ps,monitor:Fs}=de;function hs(e){if(!1)var r;var t=mr(de.registerUsage(),jt(e),ee(e.element,{attribute:"draggable",value:"true"}));return A(t)}export{da,mr,Ps,Fs,hs};
1
+ import{gu,ae}from"./studio-09n3fyy0.js";var ne=ae(function(be){Object.defineProperty(be,"__esModule",{value:!0});be.bind=void 0;function at(e,r){var{type:t,listener:n,options:o}=r;return e.addEventListener(t,n,o),function i(){e.removeEventListener(t,n,o)}}be.bind=at});var Te=ae(function(k){var N=k&&k.__assign||function(){return N=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))e[o]=r[o]}return e},N.apply(this,arguments)};Object.defineProperty(k,"__esModule",{value:!0});k.bindAll=void 0;var it=ne();function xe(e){if(typeof e>"u")return;if(typeof e==="boolean")return{capture:e};return e}function ut(e,r){if(r==null)return e;var t=N(N({},e),{options:N(N({},xe(r)),xe(e.options))});return t}function lt(e,r,t){var n=r.map(function(o){var i=ut(o,t);return(0,it.bind)(e,i)});return function o(){n.forEach(function(i){return i()})}}k.bindAll=lt});var R=ae(function(V){Object.defineProperty(V,"__esModule",{value:!0});V.bindAll=V.bind=void 0;var ct=ne();Object.defineProperty(V,"bind",{enumerable:!0,get:function(){return ct.bind}});var st=Te();Object.defineProperty(V,"bindAll",{enumerable:!0,get:function(){return st.bindAll}})});function me(e){if(Array.isArray(e))return e}function ge(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,u,l=[],a=!0,c=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(n=i.call(t)).done)&&(l.push(n.value),l.length!==r);a=!0);}catch(d){c=!0,o=d}finally{try{if(!a&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(c)throw o}}return l}}function L(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function X(e,r){if(e){if(typeof e=="string")return L(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?L(e,r):void 0}}function ye(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,r){return me(e)||ge(e,r)||X(e,r)||ye()}var ot=gu(R());var q="data-pdnd-honey-pot";function z(e){return e instanceof Element&&e.hasAttribute(q)}function G(e){var r=document.elementsFromPoint(e.x,e.y),t=B(r,2),n=t[0],o=t[1];if(!n)return null;if(z(n))return o!==null&&o!==void 0?o:null;return n}function H(e){return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},H(e)}function we(e,r){if(H(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(H(n)!="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function De(e){var r=we(e,"string");return H(r)=="symbol"?r:r+""}function ga(e,r,t){return(r=De(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Y=gu(R());var Ae=2147483647;var Oe={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent",width:"auto",height:"auto"};function A(e){var r=null;return function t(){if(!r){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var u=e.apply(this,o);r={result:u}}return r.result}}var Z=A(function e(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover==="function"});function Ee(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Se(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ee(Object(t),!0).forEach(function(n){ga(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var U=2,Pe=U/2;function ft(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function dt(e){return{x:e.x-Pe,y:e.y-Pe}}function vt(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function mt(e){return{x:Math.min(e.x,window.innerWidth-U),y:Math.min(e.y,window.innerHeight-U)}}function je(e){var r=e.client,t=mt(vt(dt(ft(r))));return DOMRect.fromRect({x:t.x,y:t.y,width:U,height:U})}function Ie(e){var r=e.clientRect;return{left:"".concat(r.left,"px"),top:"".concat(r.top,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px")}}function gt(e){var{client:r,clientRect:t}=e;return r.x>=t.x&&r.x<=t.x+t.width&&r.y>=t.y&&r.y<=t.y+t.height}function yt(e){var r=e.initial,t=document.createElement("div");if(t.setAttribute(q,"true"),Z())t.setAttribute("popover","manual");var n=je({client:r});if(Object.assign(t.style,Se(Se({position:"fixed"},Z()?Oe:{zIndex:Ae}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},Ie({clientRect:n}))),document.body.appendChild(t),Z())t.showPopover();var o=Y.bind(window,{type:"pointermove",listener:function i(u){var l={x:u.clientX,y:u.clientY};n=je({client:l}),Object.assign(t.style,Ie({clientRect:n}))},options:{capture:!0}});return function i(u){var l=u.current;if(o(),gt({client:l,clientRect:n})){t.remove();return}function a(){c(),t.remove()}var c=Y.bindAll(window,[{type:"pointerdown",listener:a},{type:"pointermove",listener:a},{type:"focusin",listener:a},{type:"focusout",listener:a},{type:"dragstart",listener:a},{type:"dragenter",listener:a},{type:"dragover",listener:a}],{capture:!0})}}function Fe(){var e=null;function r(){return e=null,Y.bind(window,{type:"pointermove",listener:function n(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function t(){var n=null;return function o(i){var{eventName:u,payload:l}=i;if(u==="onDragStart"){var a=l.location.initial.input,c=e!==null&&e!==void 0?e:{x:a.clientX,y:a.clientY};n=yt({initial:c})}if(u==="onDrop"){var d,f=l.location.current.input;(d=n)===null||d===void 0||d({current:{x:f.clientX,y:f.clientY}}),n=null,e=null}}}return{bindEvents:r,getOnPostDispatch:t}}function He(e){if(Array.isArray(e))return L(e)}function Ce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return He(e)||Ce(e)||X(e)||Me()}var Xe=gu(R());var Ne=A(function e(){return navigator.userAgent.includes("Firefox")});var W=A(function e(){var r=navigator,t=r.userAgent;return t.includes("AppleWebKit")&&!t.includes("Chrome")});function bt(e){return"nodeName"in e}function ke(e){return bt(e)&&e.ownerDocument!==document}var We=gu(R());var Q={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};(function e(){if(typeof window>"u")return;if(!W())return;function r(){return{enterCount:0,isOverWindow:!1}}var t=r();function n(){t=r()}We.bindAll(window,[{type:"dragstart",listener:function o(){t.enterCount=0,t.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function o(i){if(!t.isOverWindow&&t.enterCount===0)i[Q.isEnteringWindow]=!0;t.isOverWindow=!0,t.enterCount++}},{type:"dragleave",listener:function o(i){if(t.enterCount--,t.isOverWindow&&t.enterCount===0)i[Q.isLeavingWindow]=!0,t.isOverWindow=!1}}],{capture:!0})})();function Ke(e){var r=e.dragLeave;if(!W())return!1;return r.hasOwnProperty(Q.isLeavingWindow)}function Le(e){var r=e.dragLeave,{type:t,relatedTarget:n}=r;if(t!=="dragleave")return!1;if(W())return Ke({dragLeave:r});if(n==null)return!0;if(Ne())return ke(n);return n instanceof HTMLIFrameElement}function Re(e){var r=e.onDragEnd;return[{type:"pointermove",listener:function(){var t=0;return function n(){if(t<20){t++;return}r()}}()},{type:"pointerdown",listener:r}]}function C(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var ht=function e(r){var t=[],n=null,o=function i(){for(var u=arguments.length,l=Array(u),a=0;a<u;a++)l[a]=arguments[a];if(t=l,n)return;n=requestAnimationFrame(function(){n=null,r.apply(void 0,t)})};return o.cancel=function(){if(!n)return;cancelAnimationFrame(n),n=null},o},Ue=ht;var oe=Ue(function(e){return e()}),_=function(){var e=null;function r(n){var o=requestAnimationFrame(function(){e=null,n()});e={frameId:o,fn:n}}function t(){if(e)cancelAnimationFrame(e.frameId),e.fn(),e=null}return{schedule:r,flush:t}}();function Ye(e){var{source:r,initial:t,dispatchEvent:n}=e,o={dropTargets:[]};function i(l){n(l),o={dropTargets:l.payload.location.current.dropTargets}}var u={start:function l(a){var c=a.nativeSetDragImage,d={current:t,previous:o,initial:t};i({eventName:"onGenerateDragPreview",payload:{source:r,location:d,nativeSetDragImage:c}}),_.schedule(function(){i({eventName:"onDragStart",payload:{source:r,location:d}})})},dragUpdate:function l(a){var c=a.current;_.flush(),oe.cancel(),i({eventName:"onDropTargetChange",payload:{source:r,location:{initial:t,previous:o,current:c}}})},drag:function l(a){var c=a.current;oe(function(){_.flush();var d={initial:t,previous:o,current:c};i({eventName:"onDrag",payload:{source:r,location:d}})})},drop:function l(a){var{current:c,updatedSourcePayload:d}=a;_.flush(),oe.cancel(),i({eventName:"onDrop",payload:{source:d!==null&&d!==void 0?d:r,location:{current:c,previous:o,initial:t}}})}};return u}var ue={isActive:!1};function Be(){return!ue.isActive}function xt(e){if(e.dataTransfer)return e.dataTransfer.setDragImage.bind(e.dataTransfer);return null}function Tt(e){var{current:r,next:t}=e;if(r.length!==t.length)return!0;for(var n=0;n<r.length;n++)if(r[n].element!==t[n].element)return!0;return!1}function wt(e){var{event:r,dragType:t,getDropTargetsOver:n,dispatchEvent:o}=e;if(!Be())return;var i=Dt({event:r,dragType:t,getDropTargetsOver:n});ue.isActive=!0;var u={current:i};ie({event:r,current:i.dropTargets});var l=Ye({source:t.payload,dispatchEvent:o,initial:i});function a(s){var p=Tt({current:u.current.dropTargets,next:s.dropTargets});if(u.current=s,p)l.dragUpdate({current:u.current})}function c(s){var p=C(s),m=z(s.target)?G({x:p.clientX,y:p.clientY}):s.target,g=n({target:m,input:p,source:t.payload,current:u.current.dropTargets});if(g.length)s.preventDefault(),ie({event:s,current:g});a({dropTargets:g,input:p})}function d(){if(u.current.dropTargets.length)a({dropTargets:[],input:u.current.input});l.drop({current:u.current,updatedSourcePayload:null}),f()}function f(){ue.isActive=!1,w()}var w=Xe.bindAll(window,[{type:"dragover",listener:function s(p){c(p),l.drag({current:u.current})}},{type:"dragenter",listener:c},{type:"dragleave",listener:function s(p){if(!Le({dragLeave:p}))return;if(a({input:u.current.input,dropTargets:[]}),t.startedFrom==="external")d()}},{type:"drop",listener:function s(p){if(u.current={dropTargets:u.current.dropTargets,input:C(p)},!u.current.dropTargets.length){d();return}p.preventDefault(),ie({event:p,current:u.current.dropTargets}),l.drop({current:u.current,updatedSourcePayload:t.type==="external"?t.getDropPayload(p):null}),f()}},{type:"dragend",listener:function s(p){u.current={dropTargets:u.current.dropTargets,input:C(p)},d()}}].concat(J(Re({onDragEnd:d}))),{capture:!0});l.start({nativeSetDragImage:xt(r)})}function ie(e){var r,{event:t,current:n}=e,o=(r=n[0])===null||r===void 0?void 0:r.dropEffect;if(o!=null&&t.dataTransfer)t.dataTransfer.dropEffect=o}function Dt(e){var{event:r,dragType:t,getDropTargetsOver:n}=e,o=C(r);if(t.startedFrom==="external")return{input:o,dropTargets:[]};var i=n({input:o,source:t.payload,target:r.target,current:[]});return{input:o,dropTargets:i}}var le={canStart:Be,start:wt};var ce=new Map;function At(e){var{typeKey:r,mount:t}=e,n=ce.get(r);if(n)return n.usageCount++,n;var o={typeKey:r,unmount:t(),usageCount:1};return ce.set(r,o),o}function Ve(e){var r=At(e);return function t(){if(r.usageCount--,r.usageCount>0)return;r.unmount(),ce.delete(e.typeKey)}}function gr(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return function n(){r.forEach(function(o){return o()})}}function ee(e,r){var{attribute:t,value:n}=r;return e.setAttribute(t,n),function(){return e.removeAttribute(t)}}function qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function F(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(t),!0).forEach(function(n){ga(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function se(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ot(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function Ot(e,r){if(e){if(typeof e=="string")return ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ze(e,r):void 0}}function ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function pe(e){return e.slice(0).reverse()}function Ge(e){var{typeKey:r,defaultDropEffect:t}=e,n=new WeakMap,o="data-drop-target-for-".concat(r),i="[".concat(o,"]");function u(s){return n.set(s.element,s),function(){return n.delete(s.element)}}function l(s){if(!1)var p;var m=gr(ee(s.element,{attribute:o,value:"true"}),u(s));return A(m)}function a(s){var p,m,g,D,{source:y,target:h,input:b,result:T}=s,v=T===void 0?[]:T;if(h==null)return v;if(!(h instanceof Element)){if(h instanceof Node)return a({source:y,target:h.parentElement,input:b,result:v});return v}var P=h.closest(i);if(P==null)return v;var x=n.get(P);if(x==null)return v;var E={input:b,source:y,element:x.element};if(x.canDrop&&!x.canDrop(E))return a({source:y,target:x.element.parentElement,input:b,result:v});var S=(p=(m=x.getData)===null||m===void 0?void 0:m.call(x,E))!==null&&p!==void 0?p:{},j=(g=(D=x.getDropEffect)===null||D===void 0?void 0:D.call(x,E))!==null&&g!==void 0?g:t,O={data:S,element:x.element,dropEffect:j,isActiveDueToStickiness:!1};return a({source:y,target:x.element.parentElement,input:b,result:[].concat(J(v),[O])})}function c(s){var{eventName:p,payload:m}=s,g=se(m.location.current.dropTargets),D;try{for(g.s();!(D=g.n()).done;){var y,h=D.value,b=n.get(h.element),T=F(F({},m),{},{self:h});b===null||b===void 0||(y=b[p])===null||y===void 0||y.call(b,T)}}catch(v){g.e(v)}finally{g.f()}}var d={onGenerateDragPreview:c,onDrag:c,onDragStart:c,onDrop:c,onDropTargetChange:function s(p){var m=p.payload,g=new Set(m.location.current.dropTargets.map(function(K){return K.element})),D=new Set,y=se(m.location.previous.dropTargets),h;try{for(y.s();!(h=y.n()).done;){var b,T=h.value;D.add(T.element);var v=n.get(T.element),P=g.has(T.element),x=F(F({},m),{},{self:T});if(v===null||v===void 0||(b=v.onDropTargetChange)===null||b===void 0||b.call(v,x),!P){var E;v===null||v===void 0||(E=v.onDragLeave)===null||E===void 0||E.call(v,x)}}}catch(K){y.e(K)}finally{y.f()}var S=se(m.location.current.dropTargets),j;try{for(S.s();!(j=S.n()).done;){var O,M,re=j.value;if(D.has(re.element))continue;var ve=F(F({},m),{},{self:re}),I=n.get(re.element);I===null||I===void 0||(O=I.onDropTargetChange)===null||O===void 0||O.call(I,ve),I===null||I===void 0||(M=I.onDragEnter)===null||M===void 0||M.call(I,ve)}}catch(K){S.e(K)}finally{S.f()}}};function f(s){d[s.eventName](s)}function w(s){var{source:p,target:m,input:g,current:D}=s,y=a({source:p,target:m,input:g});if(y.length>=D.length)return y;var h=pe(D),b=pe(y),T=[];for(var v=0;v<h.length;v++){var P,x=h[v],E=b[v];if(E!=null){T.push(E);continue}var S=T[v-1],j=h[v-1];if((S===null||S===void 0?void 0:S.element)!==(j===null||j===void 0?void 0:j.element))break;var O=n.get(x.element);if(!O)break;var M={input:g,source:p,element:O.element};if(O.canDrop&&!O.canDrop(M))break;if(!((P=O.getIsSticky)!==null&&P!==void 0&&P.call(O,M)))break;T.push(F(F({},x),{},{isActiveDueToStickiness:!0}))}return pe(T)}return{dropTargetForConsumers:l,getIsOver:w,dispatchEvent:f}}function Et(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=St(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
5
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function St(e,r){if(e){if(typeof e=="string")return Ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,r):void 0}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Pt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$e(Object(t),!0).forEach(function(n){ga(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Je(){var e=new Set,r=null;function t(i){if(!r)return;if(!i.canMonitor||i.canMonitor(r.canMonitorArgs))r.active.add(i)}function n(i){var u=Pt({},i);e.add(u),t(u);function l(){if(e.delete(u),r)r.active.delete(u)}return A(l)}function o(i){var{eventName:u,payload:l}=i;if(u==="onGenerateDragPreview"){r={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var a=Et(e),c;try{for(a.s();!(c=a.n()).done;){var d=c.value;t(d)}}catch(g){a.e(g)}finally{a.f()}}if(!r)return;var f=Array.from(r.active);for(var w=0,s=f;w<s.length;w++){var p=s[w];if(r.active.has(p)){var m;(m=p[u])===null||m===void 0||m.call(p,l)}}if(u==="onDrop")r.active.clear(),r=null}return{dispatchEvent:o,monitorForConsumers:n}}function Qe(e){var{typeKey:r,mount:t,dispatchEventToSource:n,onPostDispatch:o,defaultDropEffect:i}=e,u=Je(),l=Ge({typeKey:r,defaultDropEffect:i});function a(f){n===null||n===void 0||n(f),l.dispatchEvent(f),u.dispatchEvent(f),o===null||o===void 0||o(f)}function c(f){var{event:w,dragType:s}=f;le.start({event:w,dragType:s,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}function d(){function f(){var w={canStart:le.canStart,start:c};return t(w)}return Ve({typeKey:r,mount:f})}return{registerUsage:d,dropTarget:l.dropTargetForConsumers,monitor:u.monitorForConsumers}}var _e=A(function e(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),et="pdnd:android-fallback";var fe="text/plain";var tt="text/uri-list";var rt="application/vnd.pdnd";var te=new WeakMap;function jt(e){return te.set(e.element,e),function r(){te.delete(e.element)}}var nt=Fe(),de=Qe({typeKey:"element",defaultDropEffect:"move",mount:function e(r){return gr(nt.bindEvents(),ot.bind(document,{type:"dragstart",listener:function t(n){var o,i,u,l,a,c;if(!r.canStart(n))return;if(n.defaultPrevented)return;if(!n.dataTransfer)return;var d=n.target;if(!(d instanceof HTMLElement))return;var f=te.get(d);if(!f)return;var w=C(n),s={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:w};if(f.canDrag&&!f.canDrag(s)){n.preventDefault();return}if(f.dragHandle){var p=G({x:w.clientX,y:w.clientY});if(!f.dragHandle.contains(p)){n.preventDefault();return}}var m=(i=(u=f.getInitialDataForExternal)===null||u===void 0?void 0:u.call(f,s))!==null&&i!==void 0?i:null;if(m)for(var g=0,D=Object.entries(m);g<D.length;g++){var y=B(D[g],2),h=y[0],b=y[1];n.dataTransfer.setData(h,b!==null&&b!==void 0?b:"")}if(_e()&&!n.dataTransfer.types.includes(fe)&&!n.dataTransfer.types.includes(tt))n.dataTransfer.setData(fe,et);n.dataTransfer.setData(rt,"");var T={element:f.element,dragHandle:(l=f.dragHandle)!==null&&l!==void 0?l:null,data:(a=(c=f.getInitialData)===null||c===void 0?void 0:c.call(f,s))!==null&&a!==void 0?a:{}},v={type:"element",payload:T,startedFrom:"internal"};r.start({event:n,dragType:v})}}))},dispatchEventToSource:function e(r){var t,n,{eventName:o,payload:i}=r;(t=te.get(i.source.element))===null||t===void 0||(n=t[o])===null||n===void 0||n.call(t,i)},onPostDispatch:nt.getOnPostDispatch()}),{dropTarget:zs,monitor:Ws}=de;function gs(e){if(!1)var r;var t=gr(de.registerUsage(),jt(e),ee(e.element,{attribute:"draggable",value:"true"}));return A(t)}export{ga,gr,zs,Ws,gs};
6
6
 
7
- //# debugId=033DC1D3ADCC90BE64756E2164756E21
8
- //# sourceMappingURL=studio-b4epb26c.js.map
7
+ //# debugId=9FBD3FE97C65835064756E2164756E21
8
+ //# sourceMappingURL=studio-7w04zw8h.js.map
@@ -0,0 +1,5 @@
1
+ import{qt,wi,Zt,$r,Us}from"./studio-ft8pfpp0.js";import{ge,Q,v,S}from"./studio-0nm2skex.js";import{vi,q,Ol,ot,yi,li,ke,fa,ro,je,Dx,vp,Ml,xv,g,u,ci}from"./studio-27tc8q0h.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-dknr8m7b.js";import{Mw,ku,fd,Eu}from"./studio-jsr14n1s.js";import{xi,T,R}from"./studio-z1vdxq0e.js";import{fc,bb,Tu,Jf,BE,R1}from"./studio-4yztve2t.js";import{pr}from"./studio-w8w9frjy.js";import{KE}from"./studio-eb5sty2k.js";import{Ew,ub,sa,w1,EE}from"./studio-frv7vjhw.js";import{D}from"./studio-153mwkyq.js";import{Ae}from"./studio-mm8x32gg.js";import{me}from"./studio-09n3fyy0.js";var Cw=["string","number","boolean","array","object","reference"],Sw=["","image","date","color"];function Vf(e){if(e.$ref)return"reference";return e.type||"string"}function uc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Os(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,l=()=>R("schema-builder",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=v({...ve(),...r}),a=null,n=!0,s=!1,l=()=>R("reference-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=v({...xe(),...r,shown:""}),a=null,n=!0,s=!1,l=()=>R("secret-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var Se=Cw.map((e)=>({label:e,value:e})),Fe=Sw.map((e)=>({label:e||"(none)",value:e})),j={format:"",name:"",required:!1,type:"string"},ee=[],re=" ";function Ne(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],a=t.join(" ");if(a!==re)re=a,ee=t.map((n)=>({label:n,value:n}));return ee}function E(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Te(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function A(e){return`name:${e}`}function H(e){return`required:${e}`}function V(e,r){return`${e} ${r}`}function O(e,r,t){return e.echo?.id===r?e.echo.value:t}function Ee(e,r,t,a,n){let s=V(r,t),l=Vf(a);return{format:uc(a),hasFormat:E(l),key:t,name:O(e,A(s),t),parent:r,required:O(e,H(s),n),type:l}}function Ce(e,r,t,a,n){let s=Vf(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,h])=>Ee(e,r,w,h,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&n?"reference":l?"nested":"none",format:uc(t),hasFormat:E(s),key:r,label:Ml(r),name:O(e,A(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,H(r),a),type:s}}function ae(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function M(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...j},addOpen:!1,drafts:new Map,echo:null},s=()=>a??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Ne(t.ctx);return{addFormat:n.add.format,addHasFormat:E(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(i.properties??{}).map(([m,f])=>Ce(n,m,f,d.includes(m),c.length>0)),formatOptions:Fe,targets:c,typeOptions:Se}},p=()=>N.update(l()),o=(i,d)=>{n.echo={id:i,value:d},p()},w=()=>{n.echo=null,p()},h=(i)=>{let d=Te(s());if(!i(d)){w();return}a=d,n.echo=null,t.onChange(d),p()},y=(i,d)=>i.properties[d],x=(i)=>{let d=n.drafts.get(i);if(!d)d={name:"",type:"string"},n.drafts.set(i,d);return d},N=Y(e,{addNested(i){let d=x(i),c=xv(d.name.trim());if(!c)return;h((m)=>{let f=y(m,i);if(!f)return!1;return f.properties??={},f.properties[c]=Os(d.type||"string"),d.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...j},p()},confirmAdd(){let i=xv(n.add.name.trim());if(!i)return;let{format:d,required:c,type:m}=n.add;n.addOpen=!1,n.add={...j},h((f)=>{if(f.properties[i]=Os(m,d||void 0),c)M(f,i,!0);return!0})},editAddFormat(i){n.add.format=i,p()},editAddName(i){n.add.name=i,p()},editAddRequired(i){n.add.required=i,p()},editAddType(i){n.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){n.addOpen=!0,n.add={...j},p()},removeField(i){h((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){h((c)=>{let m=y(c,i);if(!m?.properties?.[d])return!1;if(delete m.properties[d],m.required)m.required=m.required.filter((f)=>f!==d);return!0})},renameField(i,d){o(A(i),d);let c=xv(d.trim());h((m)=>{if(!m.properties[i]||!c||c===i||m.properties[c])return!1;return ae(m.properties,i,c),m.required=m.required.map((f)=>f===i?c:f),!0})},renameNested(i,d,c){o(A(V(i,d)),c);let m=xv(c.trim());h((f)=>{let b=y(f,i);if(!b?.properties?.[d]||!m||m===d||b.properties[m])return!1;if(ae(b.properties,d,m),b.required)b.required=b.required.map((C)=>C===d?m:C);return!0})},setFormat(i,d){h((c)=>{let m=c.properties[i];if(!m)return!1;return c.properties[i]=Os(m.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){h((m)=>{let f=y(m,i),b=f?.properties?.[d];if(!f?.properties||!b)return!1;return f.properties[d]=Os(b.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(H(V(i,d)),c),h((m)=>{let f=y(m,i);if(!f)return!1;return M(f,d,c),!0})},setNestedType(i,d,c){h((m)=>{let f=y(m,i),b=f?.properties?.[d];if(!f?.properties||!b)return!1;let C=E(c)?uc(b):void 0;return f.properties[d]=Os(c,C||void 0),!0})},setRequired(i,d){o(H(i),d),h((c)=>{if(!c.properties[i])return!1;return M(c,i,d),!0})},setTarget(i,d){h((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){h((c)=>{let m=c.properties[i];if(!m)return!1;let f=E(d)?uc(m):void 0;return c.properties[i]=Os(d,f||void 0),!0})}});return p(),{dispose:()=>N.dispose(),update(i){t=i,a=null,n.echo=null,p()}}}var De={mount:Re};Mw("schema-builder",De);function oe(e){return typeof e==="string"&&e?e:null}function qe(e,r){let t=r,a=()=>{let s=oe(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Z(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;n.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((h)=>{if(typeof h==="string"&&h&&h!==w)o(h)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var He={mount:qe};Mw("secret",He);var k=new Map,P=new Map,F=new Map;function B(e){if(e===void 0)k.clear(),P.clear(),F.clear();else k.delete(e),P.delete(e),F.delete(e)}function Oe(e){let r=k.get(e);if(r)return r;let t=(me("z5t0d0h9"),import("./content-source-z5t0d0h9.js")).then((a)=>a.listCollectionEntryIds(e));return k.set(e,t),t}function b1(e,r){let t=P.get(e);if(t)return t;let a=Oe(e),n=F.get(e);if(n){if(r)n.add(r);return null}F.set(e,new Set(r?[r]:[]));let s=(l)=>{if(k.get(e)!==a)return;let p=F.get(e);F.delete(e),P.set(e,l);for(let o of p??[])o()};return a.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=ku(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=b1(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Pe(t,n))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=ku(t.schema);if(l!==null)B(l);n()}});return n(),{dispose(){a=!0,s.dispose()},update(l){t=l,n()}}}var Me={mount:Le};Mw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,l=!1,p=R("entry-editor",n,e,{onNodeCreated:(o,w,h)=>{if(o instanceof HTMLElement&&Be(h)==="fields")a.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(n,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Uf(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Ae(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let l=s?void 0:Ae(t);vi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,KE()}function z(e,r,t){if(ce(e))ze(e,r,t);else Ol(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[a,n]of Object.entries(r))z(t,a,n)})}var fe="entry",Ie=[fe],L=new Map;function I(e){return L.get(e)??null}function v1(e,r){let t=I(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function db(e){let r=L.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),L.delete(e)}function _(e,r){q(e,(t)=>z(t,fc,r))}function SE(e){let r=sa(e.documentPath),t=Uf(e);if(!r||!Jf(r.schema,t))return null;let a=Tu(t);return{draft:a,text:a?"Draft":"Published",title:a?bb:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Eu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let a of EE(e.schema,r))t[a]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let a=xi(e,"entry"),n=xi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:bb,emptyLine:Je(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=Uf(r),l=Tu(s);return{collection:t.name,draft:l,draftAxis:Jf(t.schema,s)?"shown":"hidden",draftHint:bb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:bb,noteState:l?"shown":"hidden",region:a,stage:"entry"}}function kE(e,r){let{paneId:t,wrap:a}=e;if(v1(t,r))return;db(t);let n=null,s=null,l=()=>{if(n!==null&&I(t)===n)o()},p=(y)=>{if(!s||!y)return;let x=Uf(r),N=fd(`entry:${t}`,y.schema,x,{context:_e(r),errors:We(y,x),onChange:(i)=>pe(r,i),rerender:l});if(N.parentNode!==s)s.replaceChildren(N)},o=()=>{let y=sa(r.documentPath);if(!y)s=null;n?.surface.update(ue(t,r,y)),p(y)},w=ge(),h=le(a,ue(t,r,sa(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(y)=>_(r,y)},{fieldsSlot:(y)=>{s=y,p(sa(r.documentPath))}});n={paneId:t,scope:w,surface:h,tabId:r.id,wrap:a},L.set(t,n),w.run(()=>{Q(()=>{if(I(t)!==n)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("kb0epdxf"),import("./files-kb0epdxf.js"));await r(e);for(let[t,a]of g.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Ie)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,ci(t),a}return null}function J(){return ub().map((e)=>e.name)}async function Ue(e){let r=w1(e.schema),t=(e.def.format?wi(e.def.format)?.name:void 0)??Zt(`untitled${e.ext}`)?.name??$r()?.name;if(e.ext===".json"||t===void 0)return pr(r,null);return Us(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function kw(e,r={}){let t=Ew(e);if(!t)return S.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await qt().catch(()=>{});let a;try{a=await Ue(t)}catch(o){return S.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&vp(n)?.name===t.name?n:t.dir;if(s.includes(Dx))return S.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("kb0epdxf"),import("./files-kb0epdxf.js")),p=await l({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return B(t.name),await W(p),p}function he(){let e=u.value;return e&&sa(e.documentPath)?e:null}function Ye(){return[{args:ke({collection:fa(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await kw(li("content.newEntry",r,"collection",t))},title:"New Entry"},{args:ke({path:je("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(ot("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:ke({draft:ro("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,yi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:ke({include:ro("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{BE(yi("content.setIncludeDrafts",r,"include")),await R1()},title:"Include Drafts"}]}function y1(e){e.registerAll(Ye())}
2
+ export{Cw,Sw,Vf,uc,Os,b1,Uf,v1,db,SE,kE,kw,y1};
3
+
4
+ //# debugId=C3FC9BDE7ACC485864756E2164756E21
5
+ //# sourceMappingURL=studio-805fwp9k.js.map
@@ -1,5 +1,5 @@
1
- import{f,et}from"./studio-jsv3s3s1.js";import{te}from"./studio-ery42sqr.js";function yb(){return et()&&typeof f().findReferences==="function"}function u(e){return`${e.path??""}\x00${e.tagName??""}`}var o=new Map,i=new Map;function fc(e){if(!yb())return{status:"unsupported"};return o.get(u(e))??(i.has(u(e))?{status:"pending"}:null)}async function As(e){if(!yb())return{status:"unsupported"};if(!e.path&&!e.tagName)return{status:"failed",message:"no target to look for"};let t=u(e),s=o.get(t);if(s)return s;let n=i.get(t);if(n)return n;let r=(async()=>{try{return{result:await f().findReferences({...e.path===void 0?{}:{path:e.path},...e.tagName===void 0?{}:{tagName:e.tagName}}),status:"ready"}}catch(l){return{message:te(l),status:"failed"}}finally{i.delete(t)}})();i.set(t,r);let a=await r;return o.set(t,a),a}function _1(e){return o.delete(u(e)),As(e)}function Ma(){o.clear()}function g(e){let t=0;for(let s of e.files)if(s.path.startsWith("pages/"))t+=1;return{others:e.files.length-t,pages:t}}function Jf(e){let{others:t,pages:s}=g(e);if(s===0&&t===0)return"Not used yet";let n=[];if(s>0)n.push(`${s} page${s===1?"":"s"}`);if(t>0)n.push(`${t} other file${t===1?"":"s"}`);return`Used on ${n.join(" and ")}`}function C1(e,t){if(e.status==="unsupported")return null;if(e.status==="pending")return"Counting references…";if(e.status==="failed")return`References could not be counted (${e.message}) — this may break more than it appears to.`;let{files:s,refsTotal:n}=e.result;if(s.length===0)return t==="delete"?"Nothing else in this project refers to it.":"Nothing else in this project refers to it, so nothing needs updating.";let r=`${n} reference${n===1?"":"s"} in ${s.length} file${s.length===1?"":"s"}`,a=e.result.errors.length>0?" (at least — some documents could not be read)":"";if(t==="delete")return`${r}${a} will break. Those files stay on disk; the references in them stop resolving.`;if(t==="convert")return`${r}${a} will be updated automatically to point at the new file.`;return`${r}${a} will be updated automatically. Nothing else changes.`}function Yf(e){return e.files.toSorted((t,s)=>s.count-t.count||t.path.localeCompare(s.path))}
2
- export{yb,fc,As,_1,Ma,Jf,C1,Yf};
1
+ import{p,We}from"./studio-6k1eswp9.js";import{te}from"./studio-ery42sqr.js";function Db(){return We()&&typeof p().findReferences==="function"}function u(e){return`${e.path??""}\x00${e.tagName??""}`}var o=new Map,i=new Map;function yc(e){if(!Db())return{status:"unsupported"};return o.get(u(e))??(i.has(u(e))?{status:"pending"}:null)}async function Fs(e){if(!Db())return{status:"unsupported"};if(!e.path&&!e.tagName)return{status:"failed",message:"no target to look for"};let t=u(e),s=o.get(t);if(s)return s;let n=i.get(t);if(n)return n;let r=(async()=>{try{return{result:await p().findReferences({...e.path===void 0?{}:{path:e.path},...e.tagName===void 0?{}:{tagName:e.tagName}}),status:"ready"}}catch(l){return{message:te(l),status:"failed"}}finally{i.delete(t)}})();i.set(t,r);let a=await r;return o.set(t,a),a}function G1(e){return o.delete(u(e)),Fs(e)}function ua(){o.clear()}function f(e){let t=0;for(let s of e.files)if(s.path.startsWith("pages/"))t+=1;return{others:e.files.length-t,pages:t}}function om(e){let{others:t,pages:s}=f(e);if(s===0&&t===0)return"Not used yet";let n=[];if(s>0)n.push(`${s} page${s===1?"":"s"}`);if(t>0)n.push(`${t} other file${t===1?"":"s"}`);return`Used on ${n.join(" and ")}`}function K1(e,t){if(e.status==="unsupported")return null;if(e.status==="pending")return"Counting references…";if(e.status==="failed")return`References could not be counted (${e.message}) — this may break more than it appears to.`;let{files:s,refsTotal:n}=e.result;if(s.length===0)return t==="delete"?"Nothing else in this project refers to it.":"Nothing else in this project refers to it, so nothing needs updating.";let r=`${n} reference${n===1?"":"s"} in ${s.length} file${s.length===1?"":"s"}`,a=e.result.errors.length>0?" (at least — some documents could not be read)":"";if(t==="delete")return`${r}${a} will break. Those files stay on disk; the references in them stop resolving.`;if(t==="convert")return`${r}${a} will be updated automatically to point at the new file.`;return`${r}${a} will be updated automatically. Nothing else changes.`}function rm(e){return e.files.toSorted((t,s)=>s.count-t.count||t.path.localeCompare(s.path))}
2
+ export{Db,yc,Fs,G1,ua,om,K1,rm};
3
3
 
4
- //# debugId=05F05E8773392A4164756E2164756E21
5
- //# sourceMappingURL=studio-k1eaqyzm.js.map
4
+ //# debugId=7B79CA2B096D862B64756E2164756E21
5
+ //# sourceMappingURL=studio-81twpmzj.js.map
@@ -0,0 +1,5 @@
1
+ import{p}from"./studio-6k1eswp9.js";import{rt,zt,T,R,Ct}from"./studio-z1vdxq0e.js";import{v}from"./studio-0nm2skex.js";import{Ir}from"./studio-k9pwvmz8.js";import{Al,Ld,_c,Gi,Va,Id,Hu}from"./studio-ant1zbp3.js";import{lb,wE,cb,_E,CE}from"./studio-0mm38y62.js";import{Cc}from"./studio-011em5cf.js";import{Ev,Ni}from"./studio-153mwkyq.js";import{He}from"./studio-nw4q9sdn.js";var E={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaField",$description:"The media field: a thumbnail of what the value names, the value itself, and the two doors to a different one. It is a LEAF a caller interpolates — the Inspector's Content tab, the Signals panel and the grid's image-cell panel each draw an empty host and `ui/media-picker.ts` mounts this into it — so it has no chrome of its own and takes its width from whatever row it lands in. **Browse is addressed through its `part`, not through a class.** `ui/regions.ts` derives `inspector/field:<prop>/browse` by finding the Browse control inside the Inspector's own `[data-prop]` row; the handle used to be `.media-picker-browse`, and a document emits no class, so `[part=\"browse\"]` is the handle now. The four `.media-picker*` rules from `styles/overlays.css` are TRANSCRIBED here rather than shared, for the reason `doc-header.json` gives: a class a document does not emit cannot style it. `--radius` becomes `--jx-radius-sm` on the way, because a document mounted in a pane's stage is outside `<sp-theme>` and would otherwise take a fallback rather than follow the theme.",tagName:"div",attributes:{part:"media-field"},style:{$description:"The row's own layout and the four transcribed `.media-picker*` rules. Upload and Browse never shrink, so the FIELD is what yields width when the row is narrow — the buttons would otherwise collapse into unreadable stubs before the text did.",display:"flex",alignItems:"center",gap:"var(--jx-space-1)",flex:"1",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="value"]':{flex:"1",minWidth:"0"},'& [part="upload"]':{flexShrink:"0"},'& [part="browse"]':{flexShrink:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",border:"1px solid var(--border)",flexShrink:"0"}},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/thumbState"},cases:{shown:{$description:"Decorative on purpose: the field beside it already states the path in text, so a caption here would be the same fact twice to a screen reader and nothing to anyone else.",tagName:"img",attributes:{part:"thumb",src:"${state.thumbSrc}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"value"},$props:{size:"sm",label:"${state.label}",placeholder:"/image.jpg",value:{$ref:"#/state/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}],description:"Every keystroke, because the host debounces it: the canvas follows the typing without a document write per character."},onfocus:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/warm"},value:[]}],description:"Entering the field is the earliest honest signal that a pick is coming, so the project's media are listed then rather than when Browse is pressed."}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"event#/currentTarget"}]}],description:"The button hands over ITSELF: the browser is a popover and the platform wants its invoker, both so a second press on this control toggles rather than reopens and so focus comes back here when it closes."}}]};T("media-field",E);function O(t,e){t.label=e.label,t.value=e.value,t.thumbState=e.thumbState,t.thumbSrc=e.thumbSrc}function j(t,e,r){let i=v({browse:r.browse,edit:r.edit,label:e.label,thumbSrc:e.thumbSrc,thumbState:e.thumbState,upload:r.upload,value:e.value,warm:r.warm}),a=null,o=!1;return R("media-field",i,t).then((n)=>{if(o){n.dispose();return}a=n}),{dispose(){o=!0,a?.dispose(),a=null},update:(n)=>O(i,n)}}function ld(t){let{anchor:e,name:r,scope:i,slot:a}=t,o=document.createElement("div");o.style.pointerEvents="auto",o.setAttribute(rt,zt("popover",a)),Ct("popover").append(o);let n=new AbortController,s=null,w=null,c=!1,F=(m)=>{if(c)return;if(c=!0,n.abort(),w?.dispose(),w=null,o.remove(),m)t.onDismissed?.()},A=(async()=>{let m=await R(r,i,o,{signal:n.signal,...t.onNodeCreated?{onNodeCreated:t.onNodeCreated}:{}});if(n.signal.aborted)return;if(w=m,s=m.root,s.setAttribute(rt,zt("popover",a)),s.addEventListener("toggle",(b)=>{if(b.newState==="closed")F(!0)}),!s.hasAttribute("popover"))await new Promise((b)=>{s?.addEventListener("jx-ready",()=>b(),{once:!0})});if(n.signal.aborted)return;s.showPopover(e?{source:e}:void 0)})();return{close:()=>{if(c)return;if(s?.open)s.hidePopover();F(!1)},host:o,isOpen:()=>!c,ready:A}}var L={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaBrowser",$description:'The project\'s media, offered under whatever control asked for them. **Not the kit menu, and the difference is the thumbnails.** `surfaces/menu.json` is the settled answer to "a list of actions" and a `MenuRowProjection` carries a title, a chord and a gate — there is nowhere in it for a picture, nowhere for the size caption beside it, and a `jx-menu` is itself `popover=auto`, so a filter field cannot stand above one inside a panel. This is a browser: you pick an image by looking at it. **It is a `jx-popover`, so the PLATFORM owns dismissal** — light dismiss, Escape, the top layer and focus back to the invoker are the popover\'s contract, which is why nothing here binds a document listener and why the panel can paint over a modal `<dialog>` that the layer-div popover it replaces could not. The rows are plain buttons in a group, exactly as `grid-views.json`\'s saved views are: a list of buttons is reachable by Tab, and a `role="listbox"` would be a keyboard contract nothing here implements.',tagName:"jx-popover",attributes:{part:"media-browser"},$props:{label:"Project media",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{$description:"A search box that stays put and a list that scrolls under it. The panel itself never scrolls — `jx-popover` says why — so the box is here rather than on the host.",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",minWidth:"260px",maxHeight:"360px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"2px",overflowY:"auto",minHeight:"0"},'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer",minWidth:"0"},'& [part="row"]:hover':{background:"var(--bg-hover)"},'& [part="row"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="row-thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",flexShrink:"0"},'& [part="row-text"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="row-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-caption"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="empty"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="more"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{type:"search",size:"sm",label:"Search media",placeholder:"Search media…",autocomplete:"off",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"rows-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/rowsState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"${state.emptyLabel}"},listed:{tagName:"div",attributes:{part:"rows"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{$description:"One file. The row hands back the value a pick writes — the site URL — rather than an index, so the list may be filtered under it without changing what any row means.",tagName:"button",attributes:{part:"row",type:"button","data-path":"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumbState"},cases:{shown:{$description:"Decorative: the row's own text names the file. The load handler is the whole of the dimensions caption — measuring an image is a decode the `<img>` has finished by the time `load` fires, so the numbers are a read of work already done rather than a second fetch per row.",tagName:"img",attributes:{part:"row-thumb",src:"${$map.item.thumbSrc}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/measure"},value:[{$ref:"$map/item/file"},{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}]}}}},{tagName:"span",attributes:{part:"row-text"},children:[{tagName:"span",attributes:{part:"row-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"row-caption-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/captionState"},cases:{shown:{tagName:"span",attributes:{part:"row-caption"},textContent:"${$map.item.caption}"}}}]}]}}]}}},{tagName:"div",attributes:{part:"more-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/moreState"},cases:{shown:{$description:'A truncated list says so. Fifty rows is the cap the list has always had; the sentence is what keeps the cap from reading as "that is all there is".',tagName:"p",attributes:{part:"more"},textContent:"${state.moreLabel}"}}}]}]};T("media-browser",L);var D="media-picker";function V(t,e){t.x=e.x,t.y=e.y,t.filter=e.filter,t.rowsState=e.rowsState,t.rows=e.rows,t.emptyLabel=e.emptyLabel,t.moreState=e.moreState,t.moreLabel=e.moreLabel}function N(t,e,r){let i=v({emptyLabel:t.emptyLabel,filter:t.filter,measure:e.measure,moreLabel:t.moreLabel,moreState:t.moreState,pick:e.pick,rows:t.rows,rowsState:t.rowsState,setFilter:e.setFilter,x:t.x,y:t.y}),a=ld({anchor:r,name:"media-browser",scope:i,slot:D,...e.dismissed?{onDismissed:e.dismissed}:{}});return a.ready.then(()=>{if(a.isOpen())a.host.querySelector('[part="filter"] [part="input"]')?.focus()}),{close:a.close,host:a.host,isOpen:a.isOpen,ready:a.ready,update:(o)=>V(i,o)}}var h=[],S=!1;async function P(t,e){let r=[];try{let i=await Ir(()=>e.listDirectory(t));wE(i);for(let a of i)if(a.type==="directory"){let o=await P(a.path,e);r.push(...o)}else{let o=Gi(a.name);if(Ld.has(o))r.push({file:a.path,isImage:Al.has(o),name:a.name,path:Id(a.path)})}}catch{}return r}async function g(){if(S)return;let t=p();h=await P("public",t),S=!0,Ni("leftPanel","rightPanel","frontmatterPanel")}function Z_(){h=[],S=!1,_E()}var y=50,d=null,u=null,l="",M={x:0,y:0};function k(){let t=l.toLowerCase(),e=t?h.filter((a)=>a.path.toLowerCase().includes(t)||a.name.toLowerCase().includes(t)):h,i=e.slice(0,y).map((a)=>{let o=CE(lb(a.file));return{caption:o,captionState:o?"shown":"hidden",file:a.file,key:a.file,name:a.name,path:a.path,thumbSrc:a.isImage?Hu(a.file):"",thumbState:a.isImage?"shown":"hidden"}});return{emptyLabel:"No matches",filter:l,moreLabel:`…${e.length-y} more`,moreState:e.length>y?"shown":"hidden",rows:i,rowsState:i.length>0?"listed":"empty",x:M.x,y:M.y}}function B(){let t=d;d=null,u=null,l="",t?.close()}var x=0;function z(t,e,r){if(!cb(t,e,r)||x!==0)return;x=requestAnimationFrame(()=>{x=0,d?.update(k())})}function o$(t,e){B(),u=e;let r=He(t);M={x:r.left,y:r.bottom+4},d=N(k(),{dismissed:()=>{d=null,u=null,l=""},measure:z,pick:(i)=>{let a=u;B(),a?.(i)},setFilter:(i)=>{l=i,d?.update(k())}},t)}async function r$(t,e){let r=await Va([...t]),[i]=r;if(i)e(i.ref)}function s$(t){let e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=_c(),e.addEventListener("change",()=>{if(e.files?.length)r$(e.files,t)}),e.click()}var _=400,f=new WeakMap;function H(t,e){let r=Al.has(Gi(e));return{label:t,thumbSrc:r&&e?Cc(e):"",thumbState:r&&e?"shown":"hidden",value:e}}function cd(t,e,r,i){g();let a=f.get(t);if(a){a.prop=e,a.commit=i,a.handle.update(H(e,r));return}let o={commit:i,handle:null,prop:e};o.handle=j(t,H(e,r),{browse:(n)=>{g(),o$(n,(s)=>o.commit(s))},edit:(n)=>Ev(`media:${o.prop}`,_,(s)=>o.commit(s))(n),upload:()=>s$((n)=>o.commit(n)),warm:()=>{g()}}),f.set(t,o)}function dw(t){let e=f.get(t);if(e)f.delete(t),e.handle.dispose()}
2
+ export{ld,Z_,o$,r$,s$,cd,dw};
3
+
4
+ //# debugId=397225503335C77564756E2164756E21
5
+ //# sourceMappingURL=studio-891t1tv9.js.map
@@ -1,5 +1,5 @@
1
- var n;function oI(e){n=new URL("./",e).href}function Lv(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
2
- export{oI,Lv};
1
+ var n;function HI(e){n=new URL("./",e).href}function Bv(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
2
+ export{HI,Bv};
3
3
 
4
- //# debugId=3588BA3400E85CC964756E2164756E21
5
- //# sourceMappingURL=studio-5n1km79v.js.map
4
+ //# debugId=AA521E910537839A64756E2164756E21
5
+ //# sourceMappingURL=studio-9n2j9nqk.js.map
@@ -1,5 +1,5 @@
1
- import{te}from"./studio-ery42sqr.js";import{f}from"./studio-jsv3s3s1.js";import{v,S}from"./studio-9rhmettf.js";import{cd,xu}from"./studio-21enxdr8.js";import{wi,T,R}from"./studio-zmecp6hq.js";import{rd}from"./studio-hf4qdjc8.js";import{cE}from"./studio-ac5aq677.js";import{wb}from"./studio-vwz7rma2.js";import{vd}from"./studio-cktcdsxz.js";import{D}from"./studio-73czgk6a.js";var N={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"New Entry",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"New Entry"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"New entry name",placeholder:"entry-name",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"Select or create an entry"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",N);function V(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:""}}function W(e){let o=e?.attributes?.part;return typeof o==="string"?o:""}function j(e,i,o){e.textContent="";let n=v({...V(),...i}),t=null,r=!1,a=R("settings-contributed",n,e,{onNodeCreated:(s,l,d)=>{if(!(s instanceof HTMLElement))return;let c=W(d);if(c==="form-host")o.formSlot(s);else if(c==="actions")o.actionsSlot(s)}}).then((s)=>{if(r)return s.dispose(),s.root;return t=s,s.root});return{attached:()=>{if(r)return!1;let s=t?.root;return s===void 0?!0:s instanceof HTMLElement&&e.contains(s)},dispose(){r=!0,t?.dispose(),t=null},host:e,ready:a,update(s){n.actionsState=s.actionsState,n.editorRegion=s.editorRegion,n.editorState=s.editorState,n.entries=s.entries,n.entryName=s.entryName,n.layout=s.layout,n.newName=s.newName,n.newState=s.newState,n.title=s.title}}}var m=new Map,b=new Set,w=new Map;function aE(e,i){let o=D?.projectConfig?.[e],n=o&&typeof o==="object"&&!Array.isArray(o)?o:{};if(!Object.hasOwn(n,i))return Object.keys(n);return m.set(e,i),null}var x=new Map;function I(e,i){let o={},n=[];for(let t of i){let r=t.indexOf(": "),a=r===-1?"":t.slice(0,r),s=r===-1?t:t.slice(r+2);if(a===e){n.push(s);continue}if(!a.startsWith(`${e}/`))continue;let[l]=a.slice(e.length+1).split("/");if(l&&o[l]===void 0)o[l]=s}return{fields:o,section:n}}async function k(e,i){let o=D.projectConfig;if(!(await vd()).ok)return;let t=[];try{t=await rd(o)}catch(r){S.warn(`Could not validate project.json — ${te(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}x.set(e,I(e,t).fields),i()}function E(e,i){for(let[o,n]of Object.entries(i))if(n===void 0)delete e[o];else e[o]=n}function H(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function J(e,i){if(!e)return{};let o=(n)=>{if(typeof n==="string")return n.replaceAll("${key}",i);if(Array.isArray(n))return n.map((t)=>o(t));if(n&&typeof n==="object"){let t={};for(let[r,a]of Object.entries(n))t[r]=o(a);return t}return n};return o(e)}function M(e,i,o=null){let n=f();return{fieldKeyPrefix:`$settings.${e}`,resolvePointer:(t,r)=>xu(t,{projectConfig:D?.projectConfig??{},...r!==void 0&&{scope:r},...i.formats!==void 0&&{formats:i.formats}}),...typeof n.setSecrets==="function"?{commitSecret:async(t,r)=>{let a=cE(e,o,t);return await n.setSecrets({set:{[a]:r}}),a}}:{}}}function h(e){let i=D?.projectConfig;if(!i)return null;let o=i[e];if(o&&typeof o==="object"&&!Array.isArray(o))return o;let n={};return i[e]=n,n}var A=new WeakMap;function p(e){n1(e.container,e.contribution,e.opts)}function O(e,i){e.echo=i,p(e)}function K(e){let{container:i,contribution:o,opts:n}=e,t=o.key,r=o.title??t,a=n.actions?"slot":"none",s=wb(i),l=wi(s,"editor");if((o.settings.layout??"form")!=="map")return{actionsState:a,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:r};let d=h(t)??{},c=m.get(t)??null,g=c===null?void 0:d[c],y=c!==null&&g!==void 0&&g!==null&&typeof g==="object";return{actionsState:a,editorRegion:l,editorState:y?"editing":"empty",entries:Object.keys(d).map((u)=>({key:u,region:wi(s,`entry:${u}`),selected:u===c})),entryName:e.echo??(y?c:""),layout:"map",newName:w.get(t)??"",newState:b.has(t)?"open":"closed",title:r}}function L(e){let i=e.formHost;if(!i)return;let{contribution:o,opts:n}=e,t=o.key,r=o.settings.entry?.ui,a=()=>p(e),s=(u)=>{if(u.parentNode!==i)i.replaceChildren(u)};if((o.settings.layout??"form")!=="map"){let u=`/${t}`;s(cd(`section:${t}`,o.entrySchema,h(t)??{},{context:M(t,n,null),errors:x.get(u)??{},onChange:(P)=>{let C=h(t);if(!C)return;E(C,P),a(),k(u,a)},rerender:a,...r!==void 0&&{ui:r}}));return}let l=h(t)??{},d=m.get(t)??null,c=d===null?void 0:l[d];if(d===null||!c||typeof c!=="object"){i.replaceChildren();return}let g=c,y=`/${t}/${d}`;s(cd(`section:${t}:${d}`,o.entrySchema,g,{context:M(t,n,d),errors:x.get(y)??{},onChange:(u)=>{E(g,u),a(),k(y,a)},rerender:a,...r!==void 0&&{ui:r}}))}function F(e){let i=e.actionsHost,{actions:o}=e.opts;if(!i)return;if(!o){i.replaceChildren();return}let n=e.contribution.key,t=(e.contribution.settings.layout??"form")==="map"?m.get(n)??null:null;o(i,{rerender:()=>p(e),sectionKey:n,selected:t})}function q(e){let i=(t)=>{e.echo=null,p(e),k(t,()=>p(e))},o=()=>{e.echo=null,p(e)},n=()=>e.contribution.key;return{cancelNew(){b.delete(n()),w.delete(n()),p(e)},cancelRename(t){O(e,t),o()},createNew(){let t=n(),r=H(w.get(t)??""),a=h(t);if(!r||!a||a[r])return;a[r]=J(e.contribution.settings.entry?.newEntry,r),m.set(t,r),b.delete(t),w.delete(t),i(`/${t}`)},editNew(t){w.set(n(),t),p(e)},openNew(){b.add(n()),p(e)},removeEntry(){let t=n(),r=m.get(t)??null,a=h(t);if(!r||!a?.[r])return;delete a[r],m.set(t,null),i(`/${t}`)},renameEntry(t){O(e,t);let r=n(),a=m.get(r)??null,s=h(r),l=H(t.trim());if(!a||!s||!l||l===a||s[l]){o();return}let d={};for(let[c,g]of Object.entries(s))d[c===a?l:c]=g,delete s[c];Object.assign(s,d),m.set(r,l),i(`/${r}`)},select(t){m.set(n(),t),e.echo=null,p(e)}}}function n1(e,i,o={}){let n=A.get(e);if(n)n.contribution=i,n.opts=o;if(!n?.handle.attached()){n?.handle.dispose();let t={actionsHost:null,container:e,contribution:i,echo:null,formHost:null,handle:void 0,opts:o};A.set(e,t),t.handle=j(e,q(t),{actionsSlot:(r)=>{t.actionsHost=r,F(t)},formSlot:(r)=>{t.formHost=r,L(t)}}),n=t}n.handle.update(K(n)),F(n),L(n)}
2
- export{aE,n1};
1
+ import{te}from"./studio-ery42sqr.js";import{p}from"./studio-6k1eswp9.js";import{v,S}from"./studio-0nm2skex.js";import{fd,Eu}from"./studio-jsr14n1s.js";import{xi,T,R}from"./studio-z1vdxq0e.js";import{dd}from"./studio-gxna6yta.js";import{IE}from"./studio-z47mm077.js";import{Ab}from"./studio-pvj970st.js";import{Sd}from"./studio-w8w9frjy.js";import{D}from"./studio-153mwkyq.js";var N={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"New Entry",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"New Entry"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"New entry name",placeholder:"entry-name",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"Select or create an entry"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",N);function V(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:""}}function W(e){let o=e?.attributes?.part;return typeof o==="string"?o:""}function j(e,i,o){e.textContent="";let n=v({...V(),...i}),t=null,r=!1,a=R("settings-contributed",n,e,{onNodeCreated:(s,l,d)=>{if(!(s instanceof HTMLElement))return;let c=W(d);if(c==="form-host")o.formSlot(s);else if(c==="actions")o.actionsSlot(s)}}).then((s)=>{if(r)return s.dispose(),s.root;return t=s,s.root});return{attached:()=>{if(r)return!1;let s=t?.root;return s===void 0?!0:s instanceof HTMLElement&&e.contains(s)},dispose(){r=!0,t?.dispose(),t=null},host:e,ready:a,update(s){n.actionsState=s.actionsState,n.editorRegion=s.editorRegion,n.editorState=s.editorState,n.entries=s.entries,n.entryName=s.entryName,n.layout=s.layout,n.newName=s.newName,n.newState=s.newState,n.title=s.title}}}var f=new Map,b=new Set,w=new Map;function TE(e,i){let o=D?.projectConfig?.[e],n=o&&typeof o==="object"&&!Array.isArray(o)?o:{};if(!Object.hasOwn(n,i))return Object.keys(n);return f.set(e,i),null}var x=new Map;function I(e,i){let o={},n=[];for(let t of i){let r=t.indexOf(": "),a=r===-1?"":t.slice(0,r),s=r===-1?t:t.slice(r+2);if(a===e){n.push(s);continue}if(!a.startsWith(`${e}/`))continue;let[l]=a.slice(e.length+1).split("/");if(l&&o[l]===void 0)o[l]=s}return{fields:o,section:n}}async function k(e,i){let o=D.projectConfig;if(!(await Sd()).ok)return;let t=[];try{t=await dd(o)}catch(r){S.warn(`Could not validate project.json — ${te(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}x.set(e,I(e,t).fields),i()}function E(e,i){for(let[o,n]of Object.entries(i))if(n===void 0)delete e[o];else e[o]=n}function H(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function J(e,i){if(!e)return{};let o=(n)=>{if(typeof n==="string")return n.replaceAll("${key}",i);if(Array.isArray(n))return n.map((t)=>o(t));if(n&&typeof n==="object"){let t={};for(let[r,a]of Object.entries(n))t[r]=o(a);return t}return n};return o(e)}function M(e,i,o=null){let n=p();return{fieldKeyPrefix:`$settings.${e}`,resolvePointer:(t,r)=>Eu(t,{projectConfig:D?.projectConfig??{},...r!==void 0&&{scope:r},...i.formats!==void 0&&{formats:i.formats}}),...typeof n.setSecrets==="function"?{commitSecret:async(t,r)=>{let a=IE(e,o,t);return await n.setSecrets({set:{[a]:r}}),a}}:{}}}function h(e){let i=D?.projectConfig;if(!i)return null;let o=i[e];if(o&&typeof o==="object"&&!Array.isArray(o))return o;let n={};return i[e]=n,n}var A=new WeakMap;function m(e){x1(e.container,e.contribution,e.opts)}function O(e,i){e.echo=i,m(e)}function K(e){let{container:i,contribution:o,opts:n}=e,t=o.key,r=o.title??t,a=n.actions?"slot":"none",s=Ab(i),l=xi(s,"editor");if((o.settings.layout??"form")!=="map")return{actionsState:a,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:r};let d=h(t)??{},c=f.get(t)??null,g=c===null?void 0:d[c],y=c!==null&&g!==void 0&&g!==null&&typeof g==="object";return{actionsState:a,editorRegion:l,editorState:y?"editing":"empty",entries:Object.keys(d).map((u)=>({key:u,region:xi(s,`entry:${u}`),selected:u===c})),entryName:e.echo??(y?c:""),layout:"map",newName:w.get(t)??"",newState:b.has(t)?"open":"closed",title:r}}function L(e){let i=e.formHost;if(!i)return;let{contribution:o,opts:n}=e,t=o.key,r=o.settings.entry?.ui,a=()=>m(e),s=(u)=>{if(u.parentNode!==i)i.replaceChildren(u)};if((o.settings.layout??"form")!=="map"){let u=`/${t}`;s(fd(`section:${t}`,o.entrySchema,h(t)??{},{context:M(t,n,null),errors:x.get(u)??{},onChange:(P)=>{let C=h(t);if(!C)return;E(C,P),a(),k(u,a)},rerender:a,...r!==void 0&&{ui:r}}));return}let l=h(t)??{},d=f.get(t)??null,c=d===null?void 0:l[d];if(d===null||!c||typeof c!=="object"){i.replaceChildren();return}let g=c,y=`/${t}/${d}`;s(fd(`section:${t}:${d}`,o.entrySchema,g,{context:M(t,n,d),errors:x.get(y)??{},onChange:(u)=>{E(g,u),a(),k(y,a)},rerender:a,...r!==void 0&&{ui:r}}))}function F(e){let i=e.actionsHost,{actions:o}=e.opts;if(!i)return;if(!o){i.replaceChildren();return}let n=e.contribution.key,t=(e.contribution.settings.layout??"form")==="map"?f.get(n)??null:null;o(i,{rerender:()=>m(e),sectionKey:n,selected:t})}function q(e){let i=(t)=>{e.echo=null,m(e),k(t,()=>m(e))},o=()=>{e.echo=null,m(e)},n=()=>e.contribution.key;return{cancelNew(){b.delete(n()),w.delete(n()),m(e)},cancelRename(t){O(e,t),o()},createNew(){let t=n(),r=H(w.get(t)??""),a=h(t);if(!r||!a||a[r])return;a[r]=J(e.contribution.settings.entry?.newEntry,r),f.set(t,r),b.delete(t),w.delete(t),i(`/${t}`)},editNew(t){w.set(n(),t),m(e)},openNew(){b.add(n()),m(e)},removeEntry(){let t=n(),r=f.get(t)??null,a=h(t);if(!r||!a?.[r])return;delete a[r],f.set(t,null),i(`/${t}`)},renameEntry(t){O(e,t);let r=n(),a=f.get(r)??null,s=h(r),l=H(t.trim());if(!a||!s||!l||l===a||s[l]){o();return}let d={};for(let[c,g]of Object.entries(s))d[c===a?l:c]=g,delete s[c];Object.assign(s,d),f.set(r,l),i(`/${r}`)},select(t){f.set(n(),t),e.echo=null,m(e)}}}function x1(e,i,o={}){let n=A.get(e);if(n)n.contribution=i,n.opts=o;if(!n?.handle.attached()){n?.handle.dispose();let t={actionsHost:null,container:e,contribution:i,echo:null,formHost:null,handle:void 0,opts:o};A.set(e,t),t.handle=j(e,q(t),{actionsSlot:(r)=>{t.actionsHost=r,F(t)},formSlot:(r)=>{t.formHost=r,L(t)}}),n=t}n.handle.update(K(n)),F(n),L(n)}
2
+ export{TE,x1};
3
3
 
4
- //# debugId=1EA02D02975FEE0F64756E2164756E21
5
- //# sourceMappingURL=studio-he2fhrgp.js.map
4
+ //# debugId=BAD8268BD2F4EC9364756E2164756E21
5
+ //# sourceMappingURL=studio-9tkaykt5.js.map
@@ -0,0 +1,5 @@
1
+ import{te}from"./studio-ery42sqr.js";import{p,We}from"./studio-6k1eswp9.js";import{S}from"./studio-0nm2skex.js";import{u}from"./studio-27tc8q0h.js";import{Op,di,Nv}from"./studio-b29h7g7s.js";import{Ir,ym,CL}from"./studio-k9pwvmz8.js";import{jC,iv,Sx,HC,vm}from"./studio-011em5cf.js";import{D}from"./studio-153mwkyq.js";var Al=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),Ld=new Set([...Al,".mp4",".webm",".mp3",".wav",".ogg",".pdf",".woff",".woff2",".ttf",".otf"]);function m(e){let t=["B","KB","MB","GB"],n=e,r=0;while(n>=1024&&r<t.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${t[r]}`}var h=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function _c(){return(We()?p().assetCapabilities?.accept:void 0)??h}function Gi(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function nv(e){return Al.has(e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`)}function mm(e){return Ld.has(Gi(e))}var x=new Set([".mp4",".webm",".mov",".m4v"]),w=new Set([".mp3",".wav",".ogg",".m4a",".flac"]);function up(e){let t=e.type??"";if(t.startsWith("image/"))return"image";if(t.startsWith("video/"))return"video";if(t.startsWith("audio/"))return"audio";let n=Gi(e.name);if(Al.has(n))return"image";if(x.has(n))return"video";if(w.has(n))return"audio";return"file"}var v=/^content\/([^/]+)\//;function A(e){let t=e?v.exec(e.replaceAll("\\","/")):null;return t?`content/${t[1]}/images`:"public"}function b(e){let t=e.replaceAll("\\","/");if(t.startsWith("public/"))return t.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(t);if(n)return`./${n[1]}`;return`./${t}`}function y(e,t){if(!t.has(e))return e;let n=Gi(e),r=n?e.slice(0,-n.length):e;for(let i=1;;i++){let s=`${r}-${i}${n}`;if(!t.has(s))return s}}function E(e,t){let n=e.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?t:`${n}/${t}`}var g=null;function wL(e){g=e}async function Va(e,t={}){let n=[...e];if(n.length===0)return[];let r=p(),i=t.dir??A(u.value?.documentPath??null),s;try{let o=await Ir(()=>r.listDirectory(i));s=new Set(o.map((c)=>c.name))}catch{s=new Set}let f=We()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let o of n){if(f!==void 0&&o.size>f){S.error(`${o.name} is too large.`,{detail:`This backend accepts at most ${m(f)}; that file is ${m(o.size)}.`,source:"Media"});continue}let c=y(o.name,s);s.add(c);let d=E(i,c);try{let{path:l}=await r.uploadFile(d,o);ym([l]),a.push({kind:up(o),name:c,path:l,ref:b(l)})}catch(l){S.error(`Could not upload ${o.name}.`,{detail:te(l),path:d,source:"Media"})}}if(a.length>0)S.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await g?.(i);return a}function xL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)}function _L(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}function C(){return D?.projectConfig?.content??null}function I(e){return iv(e,C(),HC())}function N(e,t){return`${di(t.urlPrefix)}/${e.slice(t.dir.length+1)}`}function Id(e){let t=di(e);if(t.startsWith(`${Op}/`))return`/${t.slice(Op.length+1)}`;let n=I(t);return n?`/${N(t,n)}`:`/${t}`}function Hu(e){let t=di(e);if(t==="")return e;let{space:n,fileBaseUrl:r}=vm();if(n==="repo")return jC(`${r}${Nv(t)}`,CL(t));return Sx(Id(t))}
2
+ export{Al,Ld,_c,Gi,nv,mm,up,wL,Va,xL,_L,Id,Hu};
3
+
4
+ //# debugId=F69348F1729C052E64756E2164756E21
5
+ //# sourceMappingURL=studio-ant1zbp3.js.map
@@ -0,0 +1,5 @@
1
+ function u(t){let n=t.replaceAll("\\","/");return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function a(t){let n=u(t);return n.startsWith("/")?n:`/${n}`}function p(t,n){return[...t].toSorted((e,s)=>s[n].length-e[n].length)}function f(t,n){return t===n||t.startsWith(`${n}/`)}function $I(t,n){let e=u(n);for(let s of p(t,"dir")){let r=u(s.dir);if(!f(e,r)||e===r)continue;let o=e.slice(r.length+1).split("/").map((l)=>encodeURIComponent(l)).join("/");return`${a(s.urlPrefix)}/${o}`}return null}function g(t,n){let e=n.split("#")[0].split("?")[0];if(!e.startsWith("/"))return null;let s;try{s=decodeURIComponent(e)}catch{return null}if(/%2e|%2f/i.test(s))return null;for(let r of p(t,"urlPrefix")){let i=a(r.urlPrefix);if(!s.startsWith(`${i}/`))continue;let l=s.slice(i.length+1).split("/");if(l.some((c)=>c===""||c==="."||c===".."))return null;return`${u(r.dir)}/${l.join("/")}`}return null}var d=String.raw`"'\s<>()\\`;var Op="public";var DI=["mounts","public"];function Av(t){let n=t.search(/[#?]/);return n===-1?{path:t,suffix:""}:{path:t.slice(0,n),suffix:t.slice(n)}}function LS(t){return t===""||t.startsWith("/")||t.startsWith("#")||t.includes("${")||/^[a-z][\w+.-]*:/i.test(t)}function di(t){return t.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function AI(t){let n=di(t),e=n.lastIndexOf("/");return e===-1?"":n.slice(0,e)}function IS(t,n){let s=(t===""||t==="."?[]:di(t).split("/")).filter((r)=>r!==""&&r!==".");for(let r of n.replaceAll("\\","/").split("/")){if(r===""||r===".")continue;if(r===".."){if(s.length===0)return null;s.pop();continue}s.push(r)}return s.join("/")}function h(t,n,e){let{path:s}=Av(t);if(!s.startsWith("/"))return[];let r;try{r=decodeURIComponent(s)}catch{return[]}if(/%2e|%2f/i.test(r))return[];let i=r.replace(/^\/+/,"");if(i===""||i.split("/").some((l)=>l==="."||l===".."))return[];let o=[];for(let l of e){if(l==="mounts"){let c=g(n,s);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))o.push(di(c));continue}o.push(l==="root"?i:`${Op}/${i}`)}return[...new Set(o)]}function NI(t,n,e,s){let{path:r}=Av(t);if(r==="")return null;if(LS(t))return r.startsWith("/")?h(r,e,s)[0]??null:null;if(r.endsWith("/"))return null;let i;try{i=decodeURIComponent(r)}catch{return null}let o=IS(n,i);if(o===null||o===""||o===di(n))return null;return o}function Nv(t){return t.split("/").map((n)=>encodeURIComponent(n)).join("/")}function OI(t){let n=[],e=0;while(e<t.length){while(e<t.length&&(/\s/.test(t[e])||t[e]===","))e+=1;if(e>=t.length)break;let s=e;while(e<t.length&&!/\s/.test(t[e]))e+=1;let r=t.slice(s,e);if(r.endsWith(",")){n.push({descriptor:"",url:r.replace(/,+$/,"")});continue}while(e<t.length&&/\s/.test(t[e]))e+=1;let i=e;while(e<t.length&&t[e]!==",")e+=1;let o=t.slice(i,e).trim();if(e+=1,r=r.replace(/,+$/,""),r!=="")n.push({descriptor:o,url:r})}return n}function MI(t){return t.map(({url:n,descriptor:e})=>e?`${n} ${e}`:n).join(", ")}
2
+ export{$I,Op,DI,Av,LS,di,AI,IS,NI,Nv,OI,MI};
3
+
4
+ //# debugId=872AA5FECDAE894964756E2164756E21
5
+ //# sourceMappingURL=studio-b29h7g7s.js.map
@@ -0,0 +1,5 @@
1
+ import{p}from"./studio-6k1eswp9.js";import{ua}from"./studio-81twpmzj.js";import{Ir,ym,zC}from"./studio-k9pwvmz8.js";import{Cm,g}from"./studio-27tc8q0h.js";import{D}from"./studio-153mwkyq.js";var P=/[.*+?^${}()|[\]\\]/;function R(e){return P.test(e)?`\\${e}`:e}function L(e){let t=e.length;while(t>0&&e[t-1]===" "){let n=0,r=t-2;while(r>=0&&e[r]==="\\")n+=1,r-=1;if(n%2===1)break;t-=1}return e.slice(0,t)}function T(e,t){let n=t+1;if(e[n]==="!")n+=1;if(e[n]==="]")n+=1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]==="]")return n;n+=1}return-1}function k(e){let t="",n=0;while(n<e.length){let r=e[n];if(r==="\\"){let o=e[n+1];if(o===void 0)t+=String.raw`\\`,n+=1;else t+=R(o),n+=2;continue}if(r==="*"){let o=0;while(e[n]==="*")o+=1,n+=1;let i=t===""||t.endsWith("/");if(o>=2&&i&&e[n]==="/")t+="(?:[^/]+/)*",n+=1;else if(o>=2&&i&&n>=e.length)t+=".*";else t+="[^/]*";continue}if(r==="?"){t+="[^/]",n+=1;continue}if(r==="["){let o=T(e,n);if(o===-1){t+=String.raw`\[`,n+=1;continue}let i=e.slice(n+1,o),s=i.startsWith("!"),a=s?i.slice(1):i;t+=`[${s?"^":""}${a.startsWith("]")?String.raw`\]${a.slice(1)}`:a}]`,n=o+1;continue}t+=R(r),n+=1}return t}function F(e){let t=L(e);if(t===""||t.startsWith("#"))return null;let n=!1;if(t.startsWith("!"))n=!0,t=t.slice(1);let r=!1;if(t.endsWith("/"))r=!0,t=t.slice(0,-1);let o=t.includes("/");if(t.startsWith("/"))t=t.slice(1),o=!0;if(t==="")return null;let i=k(t);return{dirOnly:r,negated:n,re:new RegExp(`^${o?"":"(?:.*/)?"}${i}$`),source:e}}function M(e){let t=[];for(let n of e.split(/\r?\n/)){let r=F(n);if(r)t.push(r)}return t}function b(e){let t=e.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"");return t==="."?"":t}function O(e,t){if(e==="")return t;return t.startsWith(`${e}/`)?t.slice(e.length+1):null}function x(e){let t=b(e),n=[""];if(t==="")return n;let r="";for(let o of t.split("/"))r=r===""?o:`${r}/${o}`,n.push(r);return n}function W(e,t,n){let r=!1;for(let o of e){let i=O(o.base,t);if(i===null||i==="")continue;for(let s of o.rules){if(s.dirOnly&&!n)continue;if(s.re.test(i))r=!s.negated}}return r}function N(e,t,n){let r=b(t);if(r==="")return!1;let o=r.split("/"),i="";for(let[s,a]of o.entries()){i=i===""?a:`${i}/${a}`;let f=s===o.length-1;if(W(e,i,f?n:!0))return!0}return!1}var d=new Map,y=new Map;function Ru(){d.clear(),y.clear()}async function w(e){try{let t=await p().readFile(e===""?".gitignore":`${e}/.gitignore`);return{base:e,rules:M(t)}}catch{return null}}function _(e){let t=d.get(e);if(t!==void 0)return Promise.resolve(t);let n=y.get(e);if(n)return n;let r=w(e).then((o)=>(d.set(e,o),y.delete(e),o));return y.set(e,r),r}async function v(){let e=[...d.keys()];y.clear();let t=await Promise.all(e.map((n)=>w(n)));d.clear();for(let[n,r]of e.entries())d.set(r,t[n]??null)}async function ZE(e){await Promise.all(x(e).map((t)=>_(t)))}function A(e){let t=[];for(let n of x(e)){let r=d.get(n);if(r)t.push(r)}return t}function XE(e,t,n){return N(A(e),t,n)}function C(e){return e.some((t)=>b(t).split("/").pop()===".gitignore")}var U=1500,S={commit:0,open:1,reconnect:2},G=250,V=8,E=new Map,I=(e)=>e.replaceAll("\\","/");function Ms(...e){ym(e,e);let t=Date.now()+U;for(let n of e)if(n)E.set(I(n),t)}function mc(e){let t=I(e),n=E.get(t);if(n===void 0)return!1;if(Date.now()>n)return E.delete(t),!1;return!0}function Y(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function z(e){let t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function B(e,t,n){let r=new Set;for(let o of n){let i=Y(o.path);if(o.type==="add"||o.type==="addDir"){let s=e.get(i);if(s&&!s.some((a)=>a.path===o.path))s.push({name:z(o.path),path:o.path,type:o.isDir?"directory":"file"}),r.add(i);if(o.type==="addDir"&&!e.has(o.path))e.set(o.path,[])}else if(o.type==="unlink"||o.type==="unlinkDir"){let s=e.get(i);if(s){let a=s.findIndex((f)=>f.path===o.path);if(a!==-1)s.splice(a,1),r.add(i)}if(o.type==="unlinkDir"){e.delete(o.path);let a=[];for(let c of e.keys())if(c.startsWith(`${o.path}/`))a.push(c);for(let c of a)e.delete(c);let f=[];for(let c of t)if(c===o.path||c.startsWith(`${o.path}/`))f.push(c);for(let c of f)t.delete(c)}}}return r}function j(e){let t=[],n=[];for(let r of e)if(r.type==="unlinkDir")n.push(r.path);else if(r.type!=="addDir")t.push(r.path);if(t.length>0||n.length>0)ym(t,n)}function q(e,t){return e!==void 0&&e.length===t.length&&e.every((n,r)=>n===t[r])}var K=2;async function H(e,t){let n=[...e.keys()],r=0,o=async(s)=>{for(let a=0;a<K;a+=1){let f=e.get(s);if(!f)return;let c=[...f],l;try{l=await t(s)}catch{l=null}if(!e.has(s))return;if(!q(e.get(s),c))continue;if(l)e.set(s,l);else e.delete(s);return}},i=async()=>{while(r<n.length){let s=n[r];r+=1,await o(s)}};await Promise.all(Array.from({length:Math.min(V,n.length)},i))}var J=new Set(["media","grid","manage"]);function Q(e){return e.some((t)=>J.has(t))||e.length>0&&e.every((t)=>t==="git-diff")}function X(){let e=new Set;for(let t of g.tabs.values()){let n=t.documentPath;if(n&&!t.doc.dirty&&!Cm(n)&&!Q(t.capabilities.modes))e.add(n)}return[...e]}function P1(e){let t=p();if(!t.subscribeFileEvents)return()=>{};let n=[],r=null,o=null,i=null,s=()=>{r=null;let l=D,u=n.filter((h)=>!mc(h.path));if(n=[],!l||u.length===0)return;let m=B(l.dirs,l.expanded,u);if(e.onContentChange){for(let h of u)if(h.type==="change")e.onContentChange(h.path)}if(m.size>0)e.renderLeftPanel()},a=async()=>{i=null;let l=o;o=null;let u=D;if(!u||!l)return;let m=H(u.dirs,(h)=>Ir(()=>t.listDirectory(h)));if(l==="reconnect")ua(),e.invalidateDerivedCaches?.(),await Promise.all([m,v()]);else await m;if(D!==u)return;if(l==="reconnect")e.onResyncContent?.(X());e.renderLeftPanel()},f=(l)=>{if(l!=="commit")zC();if(!o||S[l]>S[o])o=l;if(i)clearTimeout(i);i=setTimeout(()=>{a()},G)},c=t.subscribeFileEvents((l)=>{if(ua(),e.invalidateDerivedCaches?.(),j(l),C(l.map((u)=>u.path)))v().then(()=>e.renderLeftPanel());if(n.push(...l),r)clearTimeout(r);r=setTimeout(s,50)},{onResync:f});return()=>{if(i)clearTimeout(i),i=null;c()}}
2
+ export{Ru,ZE,XE,Ms,mc,P1};
3
+
4
+ //# debugId=F1582A290C6B656C64756E2164756E21
5
+ //# sourceMappingURL=studio-b5rxwkj2.js.map