@jxsuite/studio 6.0.0 → 6.1.1

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 (208) hide show
  1. package/dist/chunks/2020-va2wwra4.js +4 -0
  2. package/dist/chunks/adapter-f93pafd7.js +4 -0
  3. package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-af1h381v.js} +3 -3
  4. package/dist/chunks/cf-settings-125tdm0w.js +4 -0
  5. package/dist/chunks/components-ax2f1fnn.js +4 -0
  6. package/dist/chunks/content-source-108aqtk1.js +4 -0
  7. package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-ry5rmppr.js} +3 -3
  8. package/dist/chunks/editor-pfgdmkb0.js +4 -0
  9. package/dist/chunks/entry-commands-t0k1q0kx.js +4 -0
  10. package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-6mwh2hf8.js} +3 -3
  11. package/dist/chunks/file-ops-meej5mqf.js +4 -0
  12. package/dist/chunks/files-44vp8a2s.js +4 -0
  13. package/dist/chunks/format-host-7q1petb9.js +4 -0
  14. package/dist/chunks/fs-events-h2mwnxaz.js +4 -0
  15. package/dist/chunks/git-panel-zngbymvd.js +4 -0
  16. package/dist/chunks/{grid-view-ca10def6.js → grid-view-sx9vynsp.js} +15 -15
  17. package/dist/chunks/icons-p44xhjf0.js +4 -0
  18. package/dist/chunks/iframe-host-qk3ycq87.js +4 -0
  19. package/dist/chunks/{index-9ydfe04y.js → index-2veqmnhr.js} +3 -3
  20. package/dist/chunks/index-wkyfjeqz.js +4 -0
  21. package/dist/chunks/{javascript-d9pqgc2p.js → javascript-8nbvs12s.js} +3 -3
  22. package/dist/chunks/jsonMode-s8kt9dsj.js +13 -0
  23. package/dist/chunks/jx-validate-psgd7vsx.js +4 -0
  24. package/dist/chunks/layers-panel-1kq2jyfk.js +4 -0
  25. package/dist/chunks/layers-xd92fg8d.js +4 -0
  26. package/dist/chunks/lit-html-ac4cwwr4.js +4 -0
  27. package/dist/chunks/media-picker-0svzkdyb.js +4 -0
  28. package/dist/chunks/menu-5c55ea3d.js +4 -0
  29. package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-z6r70pdt.js} +3 -3
  30. package/dist/chunks/monaco-buffer-fz6gq5y7.js +4 -0
  31. package/dist/chunks/monaco-setup-q4axkgj7.js +4 -0
  32. package/dist/chunks/notify-0xgtn8q1.js +4 -0
  33. package/dist/chunks/platform-v1qctbe6.js +4 -0
  34. package/dist/chunks/publish-panel-ym1fmgq5.js +4 -0
  35. package/dist/chunks/quick-search-a54e6t5n.js +4 -0
  36. package/dist/chunks/references-gmqp82fs.js +4 -0
  37. package/dist/chunks/right-panel-v7t9awbk.js +4 -0
  38. package/dist/chunks/section-registry-vhyf3zsr.js +4 -0
  39. package/dist/chunks/studio-0bhx5hz6.js +5 -0
  40. package/dist/chunks/studio-0k1ddnyy.js +6 -0
  41. package/dist/chunks/studio-1b04pd0j.js +64 -0
  42. package/dist/chunks/{studio-sxc0zvpt.js → studio-1q1sh2ax.js} +3 -3
  43. package/dist/chunks/studio-4dwbj6gb.js +5 -0
  44. package/dist/chunks/studio-4tanh828.js +5 -0
  45. package/dist/chunks/{studio-fqq890ap.js → studio-55h4mstj.js} +3 -3
  46. package/dist/chunks/studio-5tnvjkz4.js +5 -0
  47. package/dist/chunks/studio-60dqgb0c.js +5 -0
  48. package/dist/chunks/studio-61dp09qg.js +9 -0
  49. package/dist/chunks/studio-63epcrj2.js +5 -0
  50. package/dist/chunks/studio-74k29dy9.js +5 -0
  51. package/dist/chunks/{studio-qa73881a.js → studio-7vg6jcd3.js} +4 -4
  52. package/dist/chunks/studio-7zx31knw.js +9 -0
  53. package/dist/chunks/studio-8bxk97km.js +5 -0
  54. package/dist/chunks/{studio-edbtvcd1.js → studio-8grwxtqk.js} +4 -4
  55. package/dist/chunks/studio-933e30n4.js +5 -0
  56. package/dist/chunks/{studio-rr4xkv81.js → studio-98wnwhbg.js} +4 -4
  57. package/dist/chunks/studio-9mccjwjh.js +14 -0
  58. package/dist/chunks/studio-a2ke1e4t.js +5 -0
  59. package/dist/chunks/studio-e3a2a6v3.js +4 -0
  60. package/dist/chunks/{studio-pwqfmt4p.js → studio-e81q1vb9.js} +4 -4
  61. package/dist/chunks/{studio-7pgy3xaf.js → studio-epgrmqqm.js} +4 -4
  62. package/dist/chunks/studio-g1shz58g.js +5 -0
  63. package/dist/chunks/studio-gf0fz03c.js +5 -0
  64. package/dist/chunks/studio-gjtpe62q.js +6 -0
  65. package/dist/chunks/{studio-tzegmy4w.js → studio-gkskhg7m.js} +4 -4
  66. package/dist/chunks/studio-gx4dnjzd.js +5 -0
  67. package/dist/chunks/{studio-8xcwewjq.js → studio-h46vtzk8.js} +4 -4
  68. package/dist/chunks/studio-j03zga3y.js +9 -0
  69. package/dist/chunks/{studio-4r0sjtx8.js → studio-jhpxeckz.js} +4 -4
  70. package/dist/chunks/{studio-zd4kayn2.js → studio-k01r7ykp.js} +4 -4
  71. package/dist/chunks/{studio-03wwfvyt.js → studio-kggey1jt.js} +4 -4
  72. package/dist/chunks/{studio-hnvnfbdv.js → studio-kk7h30ne.js} +6 -6
  73. package/dist/chunks/{studio-01qza1n3.js → studio-kt1zqney.js} +4 -4
  74. package/dist/chunks/{studio-r3kaka4d.js → studio-m3cwhvye.js} +4 -4
  75. package/dist/chunks/{studio-evwgp1ym.js → studio-mcayt6hz.js} +4 -4
  76. package/dist/chunks/{studio-5vy2wfm5.js → studio-myjcghv3.js} +4 -4
  77. package/dist/chunks/studio-n8bxwc3y.js +4 -0
  78. package/dist/chunks/{studio-ztvcxm3w.js → studio-ngm8gvpb.js} +4 -4
  79. package/dist/chunks/{studio-01kbbqg3.js → studio-nj5a01jy.js} +196 -196
  80. package/dist/chunks/{studio-xkfs0dp2.js → studio-pcgz8heb.js} +4 -4
  81. package/dist/chunks/{studio-0bbxhhce.js → studio-pre0skq6.js} +4 -4
  82. package/dist/chunks/{studio-n78gjfy8.js → studio-qcsq0t15.js} +4 -4
  83. package/dist/chunks/studio-qkstvve9.js +5 -0
  84. package/dist/chunks/studio-qv1pwd3c.js +5 -0
  85. package/dist/chunks/{studio-rmn2dz59.js → studio-rc6dvxjb.js} +5 -5
  86. package/dist/chunks/{studio-st75kn99.js → studio-rv11kfwa.js} +7 -7
  87. package/dist/chunks/studio-s8dmmz66.js +5 -0
  88. package/dist/chunks/studio-sp5xzbj4.js +6 -0
  89. package/dist/chunks/{studio-tmeq6mjb.js → studio-szsjbj0g.js} +4 -4
  90. package/dist/chunks/studio-t1xzawhr.js +16 -0
  91. package/dist/chunks/{studio-mk00zd5d.js → studio-t6b6qe31.js} +4 -4
  92. package/dist/chunks/{studio-bftp4n4b.js → studio-tdcprbqb.js} +4 -4
  93. package/dist/chunks/{studio-ge5fqjth.js → studio-vrmcjf9g.js} +5 -5
  94. package/dist/chunks/studio-vyc0b4he.js +10 -0
  95. package/dist/chunks/{studio-semd1s8s.js → studio-w0cgf6jg.js} +4 -4
  96. package/dist/chunks/{studio-gp02nqnw.js → studio-w3hskzqk.js} +4 -4
  97. package/dist/chunks/{studio-1wvfxkyy.js → studio-wszjyh0j.js} +4 -4
  98. package/dist/chunks/studio-xgrgcdyh.js +9 -0
  99. package/dist/chunks/{studio-y7jehjrp.js → studio-xz2yxfcb.js} +4 -4
  100. package/dist/chunks/{studio-aje966s9.js → studio-y6n42tgs.js} +4 -4
  101. package/dist/chunks/{studio-yr04mv2j.js → studio-yb560vxr.js} +4 -4
  102. package/dist/chunks/{studio-tp642n5g.js → studio-yn9f8vtx.js} +4 -4
  103. package/dist/chunks/studio-yw05w8f0.js +7 -0
  104. package/dist/chunks/{studio-cbr9czkn.js → studio-z16sgavc.js} +4 -4
  105. package/dist/chunks/studio-zey7zsdw.js +12 -0
  106. package/dist/chunks/{studio-1q6amtph.js → studio-zyqn40w4.js} +4 -4
  107. package/dist/chunks/tsMode-2frah6h1.js +14 -0
  108. package/dist/chunks/workspace-zt81g1ms.js +4 -0
  109. package/dist/chunks/ws-client-n2bh4hkf.js +4 -0
  110. package/dist/iframe-entry.js +13 -13
  111. package/dist/manifest.json +62 -62
  112. package/dist/studio.js +87 -87
  113. package/dist/workers/ts.worker.js +3 -3
  114. package/package.json +10 -10
  115. package/src/canvas/canvas-render.ts +4 -1
  116. package/src/canvas/canvas-utils.ts +73 -15
  117. package/src/canvas/iframe-host.ts +67 -21
  118. package/src/canvas/iframe-inline-edit.ts +22 -4
  119. package/src/canvas/iframe-interaction.ts +7 -1
  120. package/src/canvas/iframe-protocol.ts +3 -0
  121. package/src/canvas/iframe-render.ts +5 -2
  122. package/src/commands/defaults.ts +4 -1
  123. package/src/commands/live-context.ts +3 -1
  124. package/src/editor/shortcuts.ts +55 -27
  125. package/src/files/media-paths.ts +3 -1
  126. package/src/new-project/add-repo-modal.ts +459 -59
  127. package/src/panels/editors.ts +3 -1
  128. package/src/panels/style-panel.ts +36 -11
  129. package/src/platforms/cloud.ts +95 -18
  130. package/src/platforms/devserver.ts +47 -12
  131. package/src/publish/pages-service.ts +7 -0
  132. package/src/publish/publish-panel.ts +16 -2
  133. package/src/studio.ts +14 -2
  134. package/src/surfaces/add-repo.json +721 -224
  135. package/src/surfaces/add-repo.ts +196 -31
  136. package/src/surfaces/library-pane.ts +6 -0
  137. package/src/surfaces/rail.json +126 -73
  138. package/src/surfaces/rail.ts +31 -5
  139. package/src/tabs/typing.ts +31 -0
  140. package/src/types.ts +42 -3
  141. package/src/utils/edit-display.ts +30 -1
  142. package/src/utils/project-dir.ts +24 -0
  143. package/src/workspace/workspace.ts +7 -0
  144. package/dist/chunks/2020-cs2sb9t1.js +0 -4
  145. package/dist/chunks/adapter-y5gdq19c.js +0 -4
  146. package/dist/chunks/cf-settings-20dznc3j.js +0 -4
  147. package/dist/chunks/components-q037dya7.js +0 -4
  148. package/dist/chunks/content-source-t0q184js.js +0 -4
  149. package/dist/chunks/editor-j5sq149q.js +0 -4
  150. package/dist/chunks/entry-commands-fxzgcc4k.js +0 -4
  151. package/dist/chunks/file-ops-2n77759h.js +0 -4
  152. package/dist/chunks/files-fjy7zpxt.js +0 -4
  153. package/dist/chunks/format-host-wj3mf3n8.js +0 -4
  154. package/dist/chunks/fs-events-7kcgn4e9.js +0 -4
  155. package/dist/chunks/git-panel-7z2mpt2d.js +0 -4
  156. package/dist/chunks/icons-qbh8akb1.js +0 -4
  157. package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
  158. package/dist/chunks/index-m0x5ztax.js +0 -4
  159. package/dist/chunks/jsonMode-800yvbem.js +0 -13
  160. package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
  161. package/dist/chunks/layers-p677nrh5.js +0 -4
  162. package/dist/chunks/layers-panel-y4w1dq90.js +0 -4
  163. package/dist/chunks/lit-html-cfn61dn7.js +0 -4
  164. package/dist/chunks/media-picker-xg7yjpz9.js +0 -4
  165. package/dist/chunks/menu-fpekzj6w.js +0 -4
  166. package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
  167. package/dist/chunks/monaco-setup-tj13ndtm.js +0 -4
  168. package/dist/chunks/notify-ahs57a2z.js +0 -4
  169. package/dist/chunks/platform-v9xyfkbx.js +0 -4
  170. package/dist/chunks/publish-panel-xtbfgg2r.js +0 -4
  171. package/dist/chunks/quick-search-d3a6m7j3.js +0 -4
  172. package/dist/chunks/references-99ws0b0m.js +0 -4
  173. package/dist/chunks/right-panel-31vbk5xp.js +0 -4
  174. package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
  175. package/dist/chunks/studio-1a99w39s.js +0 -5
  176. package/dist/chunks/studio-3ck2a5c4.js +0 -10
  177. package/dist/chunks/studio-4fde4a0x.js +0 -5
  178. package/dist/chunks/studio-4jj9gme2.js +0 -6
  179. package/dist/chunks/studio-4m50vh74.js +0 -16
  180. package/dist/chunks/studio-4xppwncr.js +0 -4
  181. package/dist/chunks/studio-5d7wfmnp.js +0 -5
  182. package/dist/chunks/studio-5e9zsamh.js +0 -9
  183. package/dist/chunks/studio-5gs9th4b.js +0 -5
  184. package/dist/chunks/studio-7qvs7v0m.js +0 -5
  185. package/dist/chunks/studio-84rtc120.js +0 -5
  186. package/dist/chunks/studio-aekhcdzw.js +0 -7
  187. package/dist/chunks/studio-aqmph6k4.js +0 -5
  188. package/dist/chunks/studio-c6zdm25z.js +0 -9
  189. package/dist/chunks/studio-capk0583.js +0 -9
  190. package/dist/chunks/studio-chdmwwzw.js +0 -5
  191. package/dist/chunks/studio-cp1gbff9.js +0 -14
  192. package/dist/chunks/studio-cqmtbg2p.js +0 -5
  193. package/dist/chunks/studio-e47215hh.js +0 -5
  194. package/dist/chunks/studio-fbx6twps.js +0 -6
  195. package/dist/chunks/studio-fthwn4kf.js +0 -5
  196. package/dist/chunks/studio-g8dsj3d2.js +0 -6
  197. package/dist/chunks/studio-gjknvzam.js +0 -9
  198. package/dist/chunks/studio-hjbg8d5y.js +0 -12
  199. package/dist/chunks/studio-nbxqcgvf.js +0 -5
  200. package/dist/chunks/studio-t1eedsyx.js +0 -4
  201. package/dist/chunks/studio-vavmwshr.js +0 -5
  202. package/dist/chunks/studio-x5g1xk77.js +0 -5
  203. package/dist/chunks/studio-x92tgnee.js +0 -64
  204. package/dist/chunks/studio-xg1942as.js +0 -5
  205. package/dist/chunks/studio-zev8ssp1.js +0 -5
  206. package/dist/chunks/tsMode-k9s9fcag.js +0 -14
  207. package/dist/chunks/workspace-5vmgsagj.js +0 -4
  208. package/dist/chunks/ws-client-0ja08haa.js +0 -4
@@ -1,13 +1,13 @@
1
- var So,jn,Wt,K=(e,t)=>{for(var[n,r,o]of So||[])for(var s=[e],i=globalThis,a=i.document,c,l,u,f,d;l=s.pop();)if(!jn[l]&&(u=r[l])){jn[l]=1;for(f=1;f<u.length;f++)s.push(o[u[f]]);if(!t&&l!==e&&(c=a&&a.head)){if(Wt===void 0)Wt=(f=a.querySelector("meta[property=csp-nonce]"))&&(f.nonce||f.getAttribute("nonce"))||"";if(d=a.createElement("link"),d.rel="modulepreload",d.crossOrigin="",Wt)d.nonce=Wt;d.href=new i.URL(u[0],n),c.appendChild(d)}}},Na=(e,t,n,r)=>{for(var o={},s=0;s<t.length;s++)o[t[s]]=n[s];(So||=[]).push([e,o,t]),jn||={},K(t[r],1)};Na(import.meta.url,["cch5s5d6","h19v1jfz","fd6g9xy3","spy3hc77","4d35zd64","8sjmfed3","fpezvnkt","qbh8akb1","gw7sq8rn","2mqby73c","8htra4er","n3v7gwas","pff8f3ze","8qh9a3bm","jwthg40w","2nnzqhrj","jqhna8zy","embq5ctg","1qmw7wqy","773hdzyj","mtm9fq5t","s8fkmnq8","37d07z9m","f7mqjwpm","haw7jkvz","z6qrytv3"],[["./iframe-entry.js"],["./chunks/tree-h19v1jfz.js"],["./chunks/tooltip-fd6g9xy3.js",23],["./chunks/textfield-spy3hc77.js"],["./chunks/toast-4d35zd64.js",24],["./chunks/toast-host-8sjmfed3.js",24],["./chunks/color-fpezvnkt.js",25],["./chunks/icons-qbh8akb1.js"],["./chunks/number-field-gw7sq8rn.js"],["./chunks/action-group-2mqby73c.js"],["./chunks/popover-8htra4er.js",23],["./chunks/select-n3v7gwas.js"],["./chunks/split-pff8f3ze.js"],["./chunks/swatch-group-8qh9a3bm.js"],["./chunks/tabs-jwthg40w.js"],["./chunks/toolbar-2nnzqhrj.js"],["./chunks/color-area-jqhna8zy.js",25],["./chunks/color-field-embq5ctg.js",25,23],["./chunks/color-slider-1qmw7wqy.js",25],["./chunks/combobox-773hdzyj.js",23],["./chunks/dialog-mtm9fq5t.js"],["./chunks/listbox-s8fkmnq8.js"],["./chunks/menu-37d07z9m.js",23],["./chunks/iframe-entry-f7mqjwpm.js"],["./chunks/iframe-entry-haw7jkvz.js"],["./chunks/iframe-entry-z6qrytv3.js"]],0);
2
- function ko(e){let{target:t,source:n,targetOrigin:r,acceptOrigin:o,token:s}=e,i=new Set,a=(c)=>{if(o!=="*"&&c.origin!==o)return;let l=c.data;if(!l||typeof l!=="object"||l["jx:canvas"]!==s)return;for(let u of i)u(l.payload)};return n.addEventListener("message",a),{dispose(){i.clear(),n.removeEventListener("message",a)},onMessage(c){return i.add(c),()=>i.delete(c)},post(c){t.postMessage({["jx:canvas"]:s,payload:c},r)}}}function ne(e){return e.getBoundingClientRect()}function To(e){return e.getBoundingClientRect()}function Ao(e,t,n=document){return n.elementFromPoint(e,t)}function re(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function _e(e){return re(e)&&typeof e.$ref==="string"}function ft(e){return re(e)&&e.$prototype==="Function"}function Ke(e){return re(e)&&re(e.$expression)}function Co(e){return Ke(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Hn(e){return ft(e)&&Array.isArray(e.body)}function Fn(e){return re(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function Wn(e){return re(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Bt(e){return re(e)&&e.$prototype==="Array"}function ie(e){return typeof e==="string"&&e.includes("${")}function Bn(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Po(e){return _e(e)||ft(e)||Ke(e)}function Ro(e){if(!e)return[];return e.map((t)=>typeof t==="string"?t:t.name)}function Kn(e){if(!re(e)||!re(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return re(t.cases)&&Object.values(t.cases).every((n)=>typeof n==="string")&&typeof t.default==="string";return!1}function Ma(e){if(typeof e==="string")return[e];if(!Kn(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}function xe(e){return typeof e==="string"?e:Ma(e).join("|")}function Kt(e){return e.startsWith("#")}function Vn(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var Vt=Object.assign;var _a=Object.prototype.hasOwnProperty,Ut=(e,t)=>_a.call(e,t),Ve=Array.isArray,dt=(e)=>No(e)==="[object Map]";var $o=(e)=>typeof e==="function",Oa=(e)=>typeof e==="string",Ue=(e)=>typeof e==="symbol",qe=(e)=>e!==null&&typeof e==="object";var Da=Object.prototype.toString,No=(e)=>Da.call(e),Mo=(e)=>No(e).slice(8,-1);var qt=(e)=>Oa(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var zt=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},La=/-\w/g,yf=zt((e)=>e.replace(La,(t)=>t.slice(1).toUpperCase())),Ia=/\B([A-Z])/g,bf=zt((e)=>e.replace(Ia,"-$1").toLowerCase()),_o=zt((e)=>e.charAt(0).toUpperCase()+e.slice(1)),wf=zt((e)=>e?`on${_o(e)}`:""),ye=(e,t)=>!Object.is(e,t);var Ja="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Ef=Vn(Ja+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var q;class Lo{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&q)if(q.active)this.parent=q,this.index=(q.scopes||(q.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=q;try{return q=this,e()}finally{q=t}}}on(){if(++this._on===1)this.prevScope=q,q=this}off(){if(this._on>0&&--this._on===0){if(q===this)q=this.prevScope;else{let e=q;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function Ge(e){return new Lo(e)}function Zt(e,t=!1){if(q)q.cleanups.push(e)}var H;var Un=new WeakSet;class Xt{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,q)if(q.active)q.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,Un.has(this))Un.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Jo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Oo(this),jo(this);let e=H,t=ae;H=this,ae=!0;try{return this.fn()}finally{Ho(this),H=e,ae=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)nr(e);this.deps=this.depsTail=void 0,Oo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)Un.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Gn(this))this.run()}get dirty(){return Gn(this)}}var Io=0,mt,ht;function Jo(e,t=!1){if(e.flags|=8,t){e.next=ht,ht=e;return}e.next=mt,mt=e}function er(){Io++}function tr(){if(--Io>0)return;if(ht){let t=ht;ht=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(mt){let t=mt;mt=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function jo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ho(e){let t,n=e.depsTail,r=n;while(r){let o=r.prevDep;if(r.version===-1){if(r===n)n=o;nr(r),ja(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Gn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Fo(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===gt)return;if(e.globalVersion=gt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Gn(e)))return;e.flags|=2;let t=e.dep,n=H,r=ae;H=e,ae=!0;try{jo(e);let o=e.fn(e._value);if(t.version===0||ye(o,e._value))e.flags|=128,e._value=o,t.version++}catch(o){throw t.version++,o}finally{H=n,ae=r,Ho(e),e.flags&=-3}}function nr(e,t=!1){let{dep:n,prevSub:r,nextSub:o}=e;if(r)r.nextSub=o,e.prevSub=void 0;if(o)o.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)nr(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function ja(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function z(e,t){if(e.effect instanceof Xt)e=e.effect.fn;let n=new Xt(e);if(t)Vt(n,t);try{n.run()}catch(o){throw n.stop(),o}let r=n.run.bind(n);return r.effect=n,r}var ae=!0,Wo=[];function Qt(){Wo.push(ae),ae=!1}function en(){let e=Wo.pop();ae=e===void 0?!0:e}function tn(e,t=!1){if(H instanceof Xt)H.cleanup=e}function Oo(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=H;H=void 0;try{t()}finally{H=n}}}var gt=0;class Bo{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class nn{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!H||!ae||H===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==H){if(t=this.activeLink=new Bo(H,this),!H.deps)H.deps=H.depsTail=t;else t.prevDep=H.depsTail,H.depsTail.nextDep=t,H.depsTail=t;Ko(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=H.depsTail,t.nextDep=void 0,H.depsTail.nextDep=t,H.depsTail=t,H.deps===t)H.deps=n}}return t}trigger(e){this.version++,gt++,this.notify(e)}notify(e){er();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{tr()}}}function Ko(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ko(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var Yn=new WeakMap,Oe=Symbol(""),Xn=Symbol(""),xt=Symbol("");function X(e,t,n){if(ae&&H){let r=Yn.get(e);if(!r)Yn.set(e,r=new Map);let o=r.get(n);if(!o)r.set(n,o=new nn),o.map=r,o.key=n;o.track()}}function Te(e,t,n,r,o,s){let i=Yn.get(e);if(!i){gt++;return}let a=(c)=>{if(c)c.trigger()};if(er(),t==="clear")i.forEach(a);else{let c=Ve(e),l=c&&qt(n);if(c&&n==="length"){let u=Number(r);i.forEach((f,d)=>{if(d==="length"||d===xt||!Ue(d)&&d>=u)a(f)})}else{if(n!==void 0||i.has(void 0))a(i.get(n));if(l)a(i.get(xt));switch(t){case"add":if(!c){if(a(i.get(Oe)),dt(e))a(i.get(Xn))}else if(l)a(i.get("length"));break;case"delete":if(!c){if(a(i.get(Oe)),dt(e))a(i.get(Xn))}break;case"set":if(dt(e))a(i.get(Oe));break}}}tr()}function ze(e){let t=j(e);if(t===e)return t;if(X(t,"iterate",xt),Ce(e))return t;if(!we(e))return t.map(me);return yt(e)?t.map((n)=>De(me(n))):t.map(De)}function rr(e){return X(e=j(e),"iterate",xt),e}function pe(e,t){if(we(e))return yt(e)?De(me(t)):De(t);return me(t)}var Ha={__proto__:null,[Symbol.iterator](){return qn(this,Symbol.iterator,(e)=>pe(this,e))},concat(...e){return ze(this).concat(...e.map((t)=>Ve(t)?ze(t):t))},entries(){return qn(this,"entries",(e)=>(e[1]=pe(this,e[1]),e))},every(e,t){return be(this,"every",e,t,void 0,arguments)},filter(e,t){return be(this,"filter",e,t,(n)=>n.map((r)=>pe(this,r)),arguments)},find(e,t){return be(this,"find",e,t,(n)=>pe(this,n),arguments)},findIndex(e,t){return be(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return be(this,"findLast",e,t,(n)=>pe(this,n),arguments)},findLastIndex(e,t){return be(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return be(this,"forEach",e,t,void 0,arguments)},includes(...e){return zn(this,"includes",e)},indexOf(...e){return zn(this,"indexOf",e)},join(e){return ze(this).join(e)},lastIndexOf(...e){return zn(this,"lastIndexOf",e)},map(e,t){return be(this,"map",e,t,void 0,arguments)},pop(){return pt(this,"pop")},push(...e){return pt(this,"push",e)},reduce(e,...t){return Do(this,"reduce",e,t)},reduceRight(e,...t){return Do(this,"reduceRight",e,t)},shift(){return pt(this,"shift")},some(e,t){return be(this,"some",e,t,void 0,arguments)},splice(...e){return pt(this,"splice",e)},toReversed(){return ze(this).toReversed()},toSorted(e){return ze(this).toSorted(e)},toSpliced(...e){return ze(this).toSpliced(...e)},unshift(...e){return pt(this,"unshift",e)},values(){return qn(this,"values",(e)=>pe(this,e))}};function qn(e,t,n){let r=rr(e),o=r[t]();if(r!==e&&!Ce(e))o._next=o.next,o.next=()=>{let s=o._next();if(!s.done)s.value=n(s.value);return s};return o}var Fa=Array.prototype;function be(e,t,n,r,o,s){let i=rr(e),a=i!==e&&!Ce(e),c=i[t];if(c!==Fa[t]){let f=c.apply(e,s);return a?me(f):f}let l=n;if(i!==e){if(a)l=function(f,d){return n.call(this,pe(e,f),d,e)};else if(n.length>2)l=function(f,d){return n.call(this,f,d,e)}}let u=c.call(i,l,r);return a&&o?o(u):u}function Do(e,t,n,r){let o=rr(e),s=o!==e&&!Ce(e),i=n,a=!1;if(o!==e){if(s)a=r.length===0,i=function(l,u,f){if(a)a=!1,l=pe(e,l);return n.call(this,l,pe(e,u),f,e)};else if(n.length>3)i=function(l,u,f){return n.call(this,l,u,f,e)}}let c=o[t](i,...r);return a?pe(e,c):c}function zn(e,t,n){let r=j(e);X(r,"iterate",xt);let o=r[t](...n);if((o===-1||o===!1)&&el(n[0]))return n[0]=j(n[0]),r[t](...n);return o}function pt(e,t,n=[]){Qt(),er();let r=j(e)[t].apply(e,n);return tr(),en(),r}var Wa=Vn("__proto__,__v_isRef,__isVue"),Vo=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Ue));function Ba(e){if(!Ue(e))e=String(e);let t=j(this);return X(t,"has",e),t.hasOwnProperty(e)}class or{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return o;else if(t==="__v_raw"){if(n===(r?o?Za:Go:o?zo:qo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=Ve(e);if(!r){let a;if(s&&(a=Ha[t]))return a;if(t==="hasOwnProperty")return Ba}let i=Reflect.get(e,t,Ae(e)?e:n);if(Ue(t)?Vo.has(t):Wa(t))return i;if(!r)X(e,"get",t);if(o)return i;if(Ae(i)){let a=s&&qt(t)?i:i.value;return r&&qe(a)?Qn(a):a}if(qe(i))return r?Qn(i):rn(i);return i}}class sr extends or{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t],s=Ve(e)&&qt(t);if(!this._isShallow){let c=we(o);if(!Ce(n)&&!we(n))o=j(o),n=j(n);if(!s&&Ae(o)&&!Ae(n))if(c)return!0;else return o.value=n,!0}let i=s?Number(t)<e.length:Ut(e,t),a=Reflect.set(e,t,n,Ae(e)?e:r);if(e===j(r)&&a){if(!i)Te(e,"add",t,n);else if(ye(n,o))Te(e,"set",t,n,o)}return a}deleteProperty(e,t){let n=Ut(e,t),r=e[t],o=Reflect.deleteProperty(e,t);if(o&&n)Te(e,"delete",t,void 0,r);return o}has(e,t){let n=Reflect.has(e,t);if(!Ue(t)||!Vo.has(t))X(e,"has",t);return n}ownKeys(e){return X(e,"iterate",Ve(e)?"length":Oe),Reflect.ownKeys(e)}}class Uo extends or{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Ka=new sr,Va=new Uo,Ua=new sr(!0);var Zn=(e)=>e,Gt=(e)=>Reflect.getPrototypeOf(e);function qa(e,t,n){return function(...r){let o=this.__v_raw,s=j(o),i=dt(s),a=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,l=o[e](...r),u=n?Zn:t?De:me;return!t&&X(s,"iterate",c?Xn:Oe),Vt(Object.create(l),{next(){let{value:f,done:d}=l.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}}})}}function Yt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function za(e,t){let n={get(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(ye(o,a))X(i,"get",o);X(i,"get",a)}let{has:c}=Gt(i),l=t?Zn:e?De:me;if(c.call(i,o))return l(s.get(o));else if(c.call(i,a))return l(s.get(a));else if(s!==i)s.get(o)},get size(){let o=this.__v_raw;return!e&&X(j(o),"iterate",Oe),o.size},has(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(ye(o,a))X(i,"has",o);X(i,"has",a)}return o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){let i=this,a=i.__v_raw,c=j(a),l=t?Zn:e?De:me;return!e&&X(c,"iterate",Oe),a.forEach((u,f)=>o.call(s,l(u),l(f),i))}};return Vt(n,e?{add:Yt("add"),set:Yt("set"),delete:Yt("delete"),clear:Yt("clear")}:{add(o){let s=j(this),i=Gt(s),a=j(o),c=!t&&!Ce(o)&&!we(o)?a:o;if(!(i.has.call(s,c)||ye(o,c)&&i.has.call(s,o)||ye(a,c)&&i.has.call(s,a)))s.add(c),Te(s,"add",c,c);return this},set(o,s){if(!t&&!Ce(s)&&!we(s))s=j(s);let i=j(this),{has:a,get:c}=Gt(i),l=a.call(i,o);if(!l)o=j(o),l=a.call(i,o);let u=c.call(i,o);if(i.set(o,s),!l)Te(i,"add",o,s);else if(ye(s,u))Te(i,"set",o,s,u);return this},delete(o){let s=j(this),{has:i,get:a}=Gt(s),c=i.call(s,o);if(!c)o=j(o),c=i.call(s,o);let l=a?a.call(s,o):void 0,u=s.delete(o);if(c)Te(s,"delete",o,void 0,l);return u},clear(){let o=j(this),s=o.size!==0,i=void 0,a=o.clear();if(s)Te(o,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((o)=>{n[o]=qa(o,e,t)}),n}function ir(e,t){let n=za(e,t);return(r,o,s)=>{if(o==="__v_isReactive")return!e;else if(o==="__v_isReadonly")return e;else if(o==="__v_raw")return r;return Reflect.get(Ut(n,o)&&o in r?n:r,o,s)}}var Ga={get:ir(!1,!1)},Ya={get:ir(!1,!0)},Xa={get:ir(!0,!1)};var qo=new WeakMap,zo=new WeakMap,Go=new WeakMap,Za=new WeakMap;function Qa(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rn(e){if(we(e))return e;return ar(e,!1,Ka,Ga,qo)}function Yo(e){return ar(e,!1,Ua,Ya,zo)}function Qn(e){return ar(e,!0,Va,Xa,Go)}function ar(e,t,n,r,o){if(!qe(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=o.get(e);if(s)return s;let i=Qa(Mo(e));if(i===0)return e;let a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function yt(e){if(we(e))return yt(e.__v_raw);return!!(e&&e.__v_isReactive)}function we(e){return!!(e&&e.__v_isReadonly)}function Ce(e){return!!(e&&e.__v_isShallow)}function el(e){return e?!!e.__v_raw:!1}function j(e){let t=e&&e.__v_raw;return t?j(t):e}var me=(e)=>qe(e)?rn(e):e,De=(e)=>qe(e)?Qn(e):e;function Ae(e){return e?e.__v_isRef===!0:!1}function le(e){return tl(e,!1)}function tl(e,t){if(Ae(e))return e;return new Xo(e,t)}class Xo{constructor(e,t){this.dep=new nn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:j(e),this._value=t?e:me(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Ce(e)||we(e);if(e=n?e:j(e),ye(e,t))this._rawValue=e,this._value=n?e:me(e),this.dep.trigger()}}class Zo{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new nn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&H!==this)return Jo(this,!0),!0}get value(){let e=this.dep.track();if(Fo(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function bt(e,t,n=!1){let r,o;if($o(e))r=e;else r=e.get,o=e.set;return new Zo(r,o,n)}function on(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var nl=new Set(["all","print","screen","speech"]);function Qo(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return nl.has(n.toLowerCase())?n:e.slice(1)}return null}function wt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function vt(e){return e.startsWith("@keyframes")}function es(e,t){let n=[];for(let r of lr(e))for(let o of lr(t))n.push(rl(r,o));return n.join(", ")}function rl(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function lr(e){let t=[],n=0,r=null,o=0;for(let i=0;i<e.length;i+=1){let a=e[i];if(r){if(a==="\\")i+=1;else if(a===r)r=null;continue}if(a==='"'||a==="'")r=a;else if(a==="("||a==="[")n+=1;else if(a===")"||a==="]")n=Math.max(0,n-1);else if(a===","&&n===0)t.push(e.slice(o,i)),o=i+1}t.push(e.slice(o));let s=t.map((i)=>i.trim()).filter((i)=>i!=="");return s.length>0?s:[e]}var ol=/[\s>+~,()]/,sl=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function il(e,t){let n="",r=0;for(;;){let o=e.indexOf("[open]",r);if(o===-1)return n+e.slice(r);let s=o;while(s>0&&!ol.test(e[s-1]))s-=1;let i=sl.exec(e.slice(s,o))?.[0]?.toLowerCase(),a=i===void 0?t.dialog===!0:i==="dialog";n+=e.slice(r,o)+(a?"[data-jx-dialog-open]":"[open]"),r=o+6}}function cr(e,t={}){if(e.includes("::backdrop"))return null;let n=e.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return il(n,t)}var Pe="data-color-scheme";function sn(e){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1]??null}function ts(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${Pe}]))`,forced:`${e}:where([${Pe}="${t}"])`};return{auto:`:where(:root:not([${Pe}])) ${e}`,forced:`:where(:root[${Pe}="${t}"]) ${e}`}}function St(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function ur(e){return e.startsWith("--")?e:on(e)}function Et(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ns(e,t,n){let r=n.map(([s,i])=>`${s}: ${i}`).join("; "),o=t===null?r:`${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)o=`${e[s]} { ${o} }`;return o}function al(e,t,n){let r=n.map(({selector:s,declarations:i})=>`${s} { ${i.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),o=`@keyframes ${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)o=`${e[s]} { ${o} }`;return o}function ll(e){let t=Object.keys(e).filter((r)=>vt(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function cl(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function kt(e,t={}){let{scope:n=null,mediaQueries:r={},transposeValue:o=(g)=>g,transposeSelector:s=(g)=>g,resolveValue:i}=t,a=[],c=(g)=>g!==null&&typeof g==="object"&&!Array.isArray(g)&&!_e(g),l=(g,y)=>{if(c(y))return[y];if(!wt(g)||!Array.isArray(y)||y.length===0)return[];return y.every((S)=>c(S))?y:[]},u=(g,y,S,A)=>{if(y===void 0||y===null)return null;if(_e(y))return S?i?.(g,y,A)??null:null;if(typeof y==="object")return null;let C=String(y);if(ie(C))return S?i?.(g,C,A)??null:null;return o(C)},f=(g,y,S=!0,A="self")=>{let C=[];for(let[T,x]of Object.entries(g)){if(l(T,x).length>0)continue;if(y&&(T.startsWith("@")||St(T)))continue;if(T.startsWith("$"))continue;let v=u(T,x,S,A);if(v!==null)C.push([ur(T),v])}return C},d=(g,y,S,A,C)=>{if(S.length===0)return;let T=y;if(T!==null){let v=s(T);if(v===null)return;T=v}let x=ns(g,T,S);a.push({text:x,conditions:[...g],selector:T,declarations:S,target:A,key:Et(x),...typeof C==="string"&&C!==""?{description:C}:{}})},m=(g,y,S)=>{let A=g.slice(10).trim();if(A==="")return;let C=[];for(let[x,v]of Object.entries(y)){if(!c(v))continue;let P=f(v,!0,!1,"unscoped");if(P.length>0)C.push({declarations:P,selector:x.trim()})}if(C.length===0)return;let T=al(S,A,C);a.push({blocks:C,conditions:[...S],declarations:[],key:Et(T),selector:null,target:"unscoped",text:T})},w=(g,y,S,A,C)=>{if(g==="@--")return;if(wt(g)){d([...A,g],null,f(y,!1,!0,"unscoped"),"unscoped",y.$description);return}if(vt(g)){m(g,y,A);return}let T=Qo(g,r),x=T===null?g:`@media ${T}`,v=T===null?null:sn(T);if(v!==null&&S!==null){let{auto:P,forced:E}=ts(S,v);b(y,P,[...A,x],C),b(ll(y),E,A,C);return}b(y,S,[...A,x],C)};function b(g,y,S,A){d(S,y,f(g,!0,!0,A),A,g.$description);for(let[C,T]of Object.entries(g))for(let x of l(C,T))if(C.startsWith("@"))w(C,x,y,S,A);else if(y!==null)b(x,es(y,C),S,cl(C)?A:"descendant")}return b(e,n,[],"self"),a}var Ee="en-US",rs="UTC",os=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],ss=os.map((e)=>e.path),is=Object.fromEntries(os.map((e)=>[e.path,e.params.indexOf("locale")]));function ul(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function fr(e){if(e==="")return[];return e.split("/").map((t)=>ul(t))}function ce(e,t){let n=e;for(let r of fr(t))n=n?.[r];return n}function dr(e){let t=e.$map;return t&&typeof t==="object"?t:void 0}var ls=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),cs=new Set(["!","-"]),us=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),fl=new Set(["=","+=","-=","*=","/="]),dl=new Set(["push","pop","shift","unshift","splice"]),fs=new Set(["reduce","map","filter"]),ds=new Set(["?:","switch"]),ps=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),pl=new Set([...ls,...cs,...us,...fs,...ds,...ps,"call"]),ml=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...ss]),hl={"Intl/compare":(e,t,n,r)=>new Intl.Collator(n??Ee,r).compare(e,t),"Intl/displayName":(e,t,n,r)=>new Intl.DisplayNames(n??Ee,{...r,type:t??"language"}).of(e),"Intl/formatDate":(e,t,n)=>new Intl.DateTimeFormat(t??Ee,{timeZone:rs,...n}).format(new Date(e)),"Intl/formatList":(e,t,n)=>new Intl.ListFormat(t??Ee,n).format(e),"Intl/formatNumber":(e,t,n)=>new Intl.NumberFormat(t??Ee,n).format(e),"Intl/formatRelativeTime":(e,t,n,r)=>new Intl.RelativeTimeFormat(n??Ee,r).format(e,t),"Intl/plural":(e,t,n)=>new Intl.PluralRules(t??Ee,n).select(e),"Intl/segment":(e,t,n)=>[...new Intl.Segmenter(n??Ee,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)};function gl(e,t,n){let r=is[e];if(r===void 0||r<0||t[r]!=null)return t;let s=n.$page?.locale;if(typeof s!=="string"||s==="")return t;let i=[...t];return i[r]=s,i}function xl(e){return e.startsWith("window#/")&&ml.has(e.slice(8))}function ms(e){return ls.has(e)}var as=64,yl=64;function W(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>yl)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function F(e,t,n,r,o){if(e===null||e===void 0)return e;if(typeof e==="object"&&!Array.isArray(e)&&"operator"in e)return Z(e,t,n,r,o);if(typeof e==="object"&&!Array.isArray(e)&&"$ref"in e){let s=an(e.$ref,t,n,r);return o?.report(o.path??[],s),s}if(Array.isArray(e))return e.map((s,i)=>F(s,t,n,r,W(o,i)));return o?.report(o.path??[],e),e}function bl(e,t,n,r){let o=(s)=>{if(!e.slice(s.length).includes("/"))return t;return an(e.slice(0,e.lastIndexOf("/")),t,n,r)};if(e.startsWith("#/state/"))return o("#/state/");if(e.startsWith("parent#/"))return o("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?an(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function an(e,t,n,r){if(e==="$reduce/acc")return r?.acc;if(e.startsWith("$reduce/"))return r?.acc;if(e.startsWith("$args/")){let o=e.slice(6).split("/"),s=r?.args?.[o[0]];return o.length>1?Re(s,o.slice(1).join("/")):s}if(e.startsWith("event#/")){let o=e.slice(7);return Re(n,o)}if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=dr(t);if(s==="item")i=r?.item??a?.item??t["$map/item"];else if(s==="index")i=r?.index??a?.index??t["$map/index"];else i=a?.[s]??t[`$map/${s}`];return o.length>2?Re(i,o.slice(2).join("/")):i}if(e.startsWith("#/state/"))return ce(t,e.slice(8));if(e.startsWith("parent#/"))return ce(t,e.slice(8));if(e.startsWith("window#/"))return Re(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Re(globalThis.document,e.slice(10));return ce(t,e)??null}function wl(e,t,n,r){if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=dr(t);if(s==="item")i=r?.item??a?.item??t["$map/item"];else if(s==="index")i=r?.index??a?.index??t["$map/index"];else i=a?.[s]??t[`$map/${s}`];if(o.length>2){let c=o.slice(2),l=c.pop(),u=c.length>0?Re(i,c.join("/")):i;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:dr(t)??t}}if(e.startsWith("#/state/")){let o=e.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let i=fr(o),a=i.pop(),c=t;for(let l of i)c=c[l];return{key:a,obj:c}}return{key:e,obj:t}}function Z(e,t,n,r,o){let s=El(e,t,n,r,o);return o?.report(o.path??[],s),s}function El(e,t,n,r,o){let{operator:s,target:i,value:a,initial:c}=e;if(!pl.has(s))throw Error(`$expression: unknown operator "${s}"`);if(cs.has(s)&&!("value"in e)){let l=F(i,t,n,r,W(o,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=i?.$ref;if(typeof l!=="string")throw TypeError("$expression: call target must be a $ref pointer");let u=(r?.callDepth??0)+1;if(u>as)throw Error(`$expression: call depth exceeded (${as})`);let f=Array.isArray(a)?a.map((m,w)=>F(m,t,n,r,W(o,["value",w]))):[];if(l.startsWith("window#/")){if(!xl(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),w=hl[m];if(w)return w(...gl(m,f,t));let b=Re(globalThis.window,m),g=m.lastIndexOf("/"),y=g===-1?globalThis.window:Re(globalThis.window,m.slice(0,g));return b.apply(y,f)}let d=an(l,t,n,r);if(typeof d==="function")return d.apply(bl(l,t,n,r),f);if(d&&typeof d==="object"&&"$expression"in d){let m=d,w={};for(let[b,g]of(m.parameters??[]).entries()){let y=typeof g==="string"?g:g?.name??"";if(!y)continue;w[y]=f[b]===void 0&&typeof g==="object"&&g!==null&&"default"in g?g.default:f[b]}return Z(m.$expression,t,n,{args:w,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(ds.has(s)){if(s==="?:"){let m=F(i,t,n,r,W(o,"target"));if(o){let w=F(a,t,n,r,W(o,"value")),b=F(c,t,n,r,W(o,"initial"));return m?w:b}return m?F(a,t,n,r):F(c,t,n,r)}let l=F(i,t,n,r,W(o,"target")),u=String(l),f=e.cases??{},d=Object.hasOwn(f,u);if(o){let m;for(let[b,g]of Object.entries(f)){let y=F(g,t,n,r,W(o,["cases",b]));if(b===u)m=y}let w=F(e.default,t,n,r,W(o,"default"));return d?m:w}return d?F(f[u],t,n,r):F(e.default,t,n,r)}if(us.has(s)){let l=F(i,t,n,r,W(o,"target")),u=F(a,t,n,r,W(o,"value"));switch(s){case"+":return l+u;case"-":return l-u;case"*":return l*u;case"/":return l/u;case"%":return l%u;case"===":return l===u;case"!==":return l!==u;case"<":return l<u;case"<=":return l<=u;case">":return l>u;case">=":return l>=u;case"&&":return l&&u;case"||":return l||u;case"??":return l??u;default:break}}if(fl.has(s)){let l=F(a,t,n,r,W(o,"value")),{obj:u,key:f}=wl(i.$ref,t,n,r);switch(s){case"=":{u[f]=l;break}case"+=":{let d=u[f];u[f]=d+l;break}case"-=":{let d=u[f];u[f]=d-l;break}case"*=":{let d=u[f];u[f]=d*l;break}case"/=":{let d=u[f];u[f]=d/l;break}default:break}return}if(dl.has(s)){let l=F(i,t,n,r,W(o,"target"));switch(s){case"push":return l.push(F(a,t,n,r,W(o,"value")));case"unshift":return l.unshift(F(a,t,n,r,W(o,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=F(a,t,n,r,W(o,"value"));return l.splice(...u)}default:break}}if(ps.has(s)){let l=F(i,t,n,r,W(o,"target")),u=a===void 0?[]:Array.isArray(a)?F(a,t,n,r,W(o,"value")):[F(a,t,n,r,W(o,"value"))],f=l?.[s];if(typeof f!=="function")return;return f.apply(l,u)}if(fs.has(s)){let l=F(i,t,n,r,W(o,"target"));if(s==="reduce"){let u=F(c,t,n,r,W(o,"initial"));for(let[f,d]of l.entries())u=Z(a,t,n,{acc:u,index:f,item:d},f===0?W(o,"value"):void 0);return u}if(s==="map")return l.map((u,f)=>Z(a,t,n,{...r,index:f,item:u},f===0?W(o,"value"):void 0));if(s==="filter")return l.filter((u,f)=>Z(a,t,n,{...r,index:f,item:u},f===0?W(o,"value"):void 0))}return}function Re(e,t){return ce(e,t)}function Le(e,t,n,r){return F(e,t,n,r)}function ln(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function hs(e){let t=ln(e);return t.startsWith("/")?t:`/${t}`}function gs(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function vl(e,t){return e===t||e.startsWith(`${t}/`)}function xs(e,t){let n=ln(t);for(let r of gs(e,"dir")){let o=ln(r.dir);if(!vl(n,o)||n===o)continue;let s=n.slice(o.length+1),{filter:i}=r;if(i&&!i(s))return null;let a=s.split("/").map((c)=>encodeURIComponent(c)).join("/");return`${hs(r.urlPrefix)}/${a}`}return null}function Sl(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let o of gs(e,"urlPrefix")){let s=hs(o.urlPrefix);if(!r.startsWith(`${s}/`))continue;let a=r.slice(s.length+1).split("/");if(a.some((l)=>l===""||l==="."||l===".."))return null;let{filter:c}=o;if(c&&!c(a.join("/")))return null;return`${ln(o.dir)}/${a.join("/")}`}return null}var jf=String.raw`"'\s<>()\\`;var kl="public";function Tt(e){let t=e.search(/[#?]/);return t===-1?{path:e,suffix:""}:{path:e.slice(0,t),suffix:e.slice(t)}}function pr(e){return e===""||e.startsWith("/")||e.startsWith("#")||e.includes("${")||/^[a-z][\w+.-]*:/i.test(e)}function mr(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function hr(e,t){let r=(e===""||e==="."?[]:mr(e).split("/")).filter((o)=>o!==""&&o!==".");for(let o of t.replaceAll("\\","/").split("/")){if(o===""||o===".")continue;if(o===".."){if(r.length===0)return null;r.pop();continue}r.push(o)}return r.join("/")}function Tl(e,t,n){let{path:r}=Tt(e);if(!r.startsWith("/"))return[];let o;try{o=decodeURIComponent(r)}catch{return[]}if(/%2e|%2f/i.test(o))return[];let s=o.replace(/^\/+/,"");if(s===""||s.split("/").some((a)=>a==="."||a===".."))return[];let i=[];for(let a of n){if(a==="mounts"){let c=Sl(t,r);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))i.push(mr(c));continue}i.push(a==="root"?s:`${kl}/${s}`)}return[...new Set(i)]}function ys(e,t,n,r){let{path:o}=Tt(e);if(o==="")return null;if(pr(e))return o.startsWith("/")?Tl(o,n,r)[0]??null:null;if(o.endsWith("/"))return null;let s;try{s=decodeURIComponent(o)}catch{return null}let i=hr(t,s);if(i===null||i===""||i===mr(t))return null;return i}function bs(e){return e.split("/").map((t)=>encodeURIComponent(t)).join("/")}function ws(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let o=e.slice(r,n);if(o.endsWith(",")){t.push({descriptor:"",url:o.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let s=n;while(n<e.length&&e[n]!==",")n+=1;let i=e.slice(s,n).trim();if(n+=1,o=o.replace(/,+$/,""),o!=="")t.push({descriptor:i,url:o})}return t}function Es(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Al(e){if("operator"in e)return"expression";if("if"in e)return"if";if("$switch"in e)return"switch";if("stopPropagation"in e)return"stopPropagation";if("preventDefault"in e)return"preventDefault";return"dispatch"}async function Ye(e,t,n,r={}){let o=r.args?{args:r.args}:void 0;for(let s of e)switch(Al(s)){case"expression":{let i=Z(s,t,n,o);if(i&&typeof i.then==="function")await i;break}case"if":{let i=s,a=Le(i.if,t,n,o)?i.then:i.else;if(Array.isArray(a))await Ye(a,t,n,r);break}case"switch":{let i=s,a=String(Le(i.$switch,t,n,o)),c=i.cases??{},l=Object.hasOwn(c,a)?c[a]:i.default;if(Array.isArray(l))await Ye(l,t,n,r);break}case"dispatch":{let i=s,a=typeof r.target==="function"?r.target():r.target,c=n?.currentTarget??a;if(!c)break;let l={};if("detail"in i)l.detail=Le(i.detail,t,n,o);if(i.bubbles!==void 0)l.bubbles=i.bubbles;if(i.composed!==void 0)l.composed=i.composed;c.dispatchEvent(new CustomEvent(i.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}function vs(e,t){for(let n of e.split(";")){let r=n.indexOf("=");if(r===-1)continue;if(n.slice(0,r).trim()===t)return n.slice(r+1)}return null}function Ss(e,t,n){let r=e.startsWith("__Host-"),o=[`${e}=${encodeURIComponent(JSON.stringify(t))}`];if(n.maxAge!==void 0)o.push(`Max-Age=${n.maxAge}`);let s=r?"/":n.path;if(s)o.push(`Path=${s}`);if(n.domain&&!r)o.push(`Domain=${n.domain}`);let{sameSite:i}=n;if(n.secure===!0||r||e.startsWith("__Secure-")||i?.toLowerCase()==="none")o.push("Secure");if(i)o.push(`SameSite=${i}`);return o.join("; ")}var gr=new Map;async function Sr(e,t){if(typeof e!=="string")return e;let n=t?.resolver?.(e);if(n)return n;if(gr.has(e))return gr.get(e);let r=fetch(e).then(async(o)=>{if(!o.ok)throw Error(`Jx: failed to fetch ${e} (${o.status})`);if((o.headers?.get("Content-Type")??"").includes("text/html"))throw Error(`Jx: ${e} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await o.json()});return gr.set(e,r),r}var Cl=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),Ls={skip:!1};function Is(e){Ls.skip=e}var Js={skip:!1};function js(e){Js.skip=e}var yr=null;function Hs(e){yr=e||null}function Fs(e){return yr?`${e}?token=${encodeURIComponent(yr)}`:e}function Ws(e){let t=Ge(!0);return t.run(()=>{z(e)}),()=>t.stop()}function gn(e){let t=Ge(!0);try{return{result:t.run(e),stop:()=>t.stop()}}catch(n){throw t.stop(),n}}var Bs=!1;function Ks(e){Bs=e}var Pl=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Rl={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};function $l(e){if(!Bs||!e.includes("v"))return e;return e.replace(Pl,(t,n,r)=>`${n}${Rl[r.toLowerCase()]??`cq${r}`}`)}var Vs=!1;function Us(e){Vs=e}var kr=!1;function qs(e){kr=e}var Tr=!1;function zs(e){Tr=e}var un=!1;function br(e){return un||e.dataset.jxPath!==void 0}function Nl(e,t){if(Vs&&t==="href"&&(e.tagName==="A"||e.tagName==="AREA"))return"data-jx-href";if(kr&&t==="popover"&&br(e))return"data-jx-popover";if(Tr&&br(e)){if(t==="commandfor")return"data-jx-commandfor";if(t==="inert")return"data-jx-inert";if(t==="open"&&e.tagName==="DIALOG")return"data-jx-open"}return t}var Ze=null;function xn(e){Ze=e}var Ml=new Set(["src","poster","data"]),_l=new Set(["srcset","imagesrcset"]),Ol=new Set(["LINK"]);function Dl(e,t){return Ml.has(t)||t==="href"&&Ol.has(e)}function Ar(e,t,n){if(!Ze||n==="")return n;let r=t.toLowerCase();if(_l.has(r)){let o=ws(n),s=!1,i=o.map((a)=>{let c=Ze?.(a.url,r)??null;if(c===null||c===a.url)return a;return s=!0,{descriptor:a.descriptor,url:c}});return s?Es(i):n}if(!Dl(e,r))return n;return Ze(n,r)??n}var Ll=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function Il(e){if(!Ze||!e.includes("url("))return e;return e.replaceAll(Ll,(t,n,r)=>{let o=r===""?null:Ze?.(r,"url()")??null;return o===null?t:`url(${n}${o}${n})`})}function fn(e){return $l(Il(e))}var Gs=!1;function Ys(e){Gs=e}var Jl=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function jl(e,t,n){if(!Gs||e!=="textContent")return null;let r=null;if(V(t)){if(!t.$ref.startsWith("#/state/"))return null;let s=t.$ref.slice(8);r=s&&!s.includes("/")?s:null}else if(typeof t==="string")r=Jl.exec(t)?.[1]??null;if(!r)return null;let o=j(n)[r];if(Ae(o)||typeof o==="function")return null;if(typeof o==="object"&&o!==null)return null;return r}async function yn(e,t={},n=location.href,r){let o=()=>r?.root??null,s={},i=e.state??{},a=yt(t);for(let f of Object.keys(t))if(a&&!(f in i))Object.defineProperty(s,f,{configurable:!0,enumerable:!0,get:()=>t[f],set:(d)=>{t[f]=d}});else s[f]=t[f];let c=e.imports??{};for(let[,f]of Object.entries(i))if(Fn(f)&&!f.$src){let d=c[f.$prototype];if(d){if(!d.endsWith(".class.json")){console.warn(`Jx: import "${f.$prototype}" must map to a .class.json path, got "${d}"`);continue}f.$src=d}}for(let[f,d]of Object.entries(i)){if(typeof d==="string"){if(!d.includes("${"))s[f]=d;continue}if(typeof d==="number"||typeof d==="boolean"||d===null){s[f]=d;continue}if(Array.isArray(d)){s[f]=d;continue}if(typeof d==="object"){if(d.$prototype)continue;if(Ke(d))continue;if(Wn(d))continue;if("default"in d){s[f]=d.default;continue}if(Hl(d))continue;s[f]=d}}let l=rn(s);for(let[f,d]of Object.entries(i))if(typeof d==="string"&&d.includes("${"))l[f]=bt(()=>ve(d,l));for(let[f,d]of Object.entries(i))if(Ke(d)){let m=d.$expression;if(Co(d)){let w=d.parameters;l[f]=(...b)=>{let g={};for(let[y,S]of w.entries()){let A=typeof S==="string"?S:S?.name??"";if(!A)continue;g[A]=b[y]===void 0&&typeof S==="object"&&S!==null&&"default"in S?S.default:b[y]}return Z(m,l,null,{args:g})}}else if(ms(m.operator)){let w=(b,g)=>Z(m,b,g);l[f]=w}else l[f]=bt(()=>Z(m,l,null))}for(let[f,d]of Object.entries(i))if(Hn(d)){let{body:m}=d;if(Array.isArray(d.parameters)&&d.parameters.length>0){let w=d.parameters;l[f]=(...b)=>{let g={};for(let[y,S]of w.entries()){let A=typeof S==="string"?S:S?.name??"";if(!A)continue;g[A]=b[y]===void 0&&typeof S==="object"&&S!==null&&"default"in S?S.default:b[y]}return Ye(m,l,null,{args:g,target:o})}}else{let w=(b,g)=>{Ye(m,b,g??null,{target:o})};l[f]=w}}else if(ft(d))l[f]=await Bl(d,l,f,n);for(let[f,d]of Object.entries(i))if(Fn(d))l[f]=await tc(d,l,f,n,r);if(!(r?.skipServerFunctions??Ls.skip)){for(let[f,d]of Object.entries(i))if(Wn(d))l[f]=await ic(d,l,f,n)}let u=r?.media??si;if(e.$media)l.$media=e.$media;else if(!l.$media&&Object.keys(u).length>0)l.$media=u;return l}function Hl(e){for(let t of Object.keys(e))if(Cl.has(t))return!0;return!1}function ve(e,t){let n=t?.$map;return Function("state","$map","item","index",`return \`${e}\``)(t,n,n?.item,n?.index)}function Fl(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let n=1;n<e.length;n+=1){let r=e[n];if(r==="{")t+=1;else if(r==="}"){if(t-=1,t===0)return n===e.length-1}}return!1}function Wl(e,t){if(!Fl(e))return ve(e,t);let n=t?.$map;return Function("state","$map","item","index",`return (${e.slice(2,-1)})`)(t,n,n?.item,n?.index)}var Ie=new Map,Xe=new Map;function Xs(e,t){if(typeof t==="function"){Ie.delete(e),Xe.set(e,t);return}Xe.delete(e),Ie.set(e,t)}function Cr(e){let t=Ie.get(e);if(t)return t;let n=Xe.get(e);if(!n)return;if(typeof n!=="function")return n;let r=Promise.resolve(n()).then((o)=>(Ie.set(e,o),Xe.delete(e),o),(o)=>{throw Xe.set(e,n),o});return Xe.set(e,r),r}async function Bl(e,t,n,r){if(e.body&&e.$src)throw Error(`Jx: '${n}' declares both body and $src — these are mutually exclusive`);if(!e.body&&!e.$src){let a=wr(e),c=Function(...a,"");return Object.defineProperty(c,"name",{configurable:!0,value:e.name??n}),c}let o;if(typeof e.body==="string"){let a=wr(e);o=Function(...a,e.body),Object.defineProperty(o,"name",{configurable:!0,value:e.name??n})}else{let a=e.$src;if(!a)throw Error(`Jx: '${n}' has neither body nor $src`);let c=e.$export??n,l,u=Cr(a);if(u instanceof Promise)l=await u;else if(u)l=u;else{if(r){let d=new URL(a,r).href;try{l=await import(d)}catch{l=await import(a)}}else l=await import(a);Ie.set(a,l)}let f=l[c]??l.default?.[c];if(typeof f!=="function")throw TypeError(`Jx: export "${c}" not found or not a function in "${a}"`);o=f}let s=(e.parameters??e.arguments??[]).length>0,i=!1;if(!s){if(typeof e.body==="string")i=Bn(e.body);else if(o)i=o.length<=1&&Bn(o.toString())}if(i)return bt(()=>o(t));return o}function wr(e){let t=e.parameters?Ro(e.parameters):e.arguments??[];return t.length>0&&t[0]==="state"?t:["state",...t]}var Pt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),ks=new Set,Kl="http://www.w3.org/2000/svg",Vl="http://www.w3.org/1998/Math/MathML";function Ul(e,t){if(e==="svg")return Kl;if(e==="math")return Vl;return t??null}function ue(e,t,n){let r=n?._path??[];if(typeof e==="string"||typeof e==="number"||typeof e==="boolean"){let f=document.createTextNode(String(e));if(typeof e==="string"&&ie(e))z(()=>{f.textContent=ve(e,t)});return f}let o=t;for(let[f,d]of Object.entries(e))if(f.startsWith("$")&&!Pt.has(f)){if(o===t)o=Object.create(t);o[f]=V(d)?G(d.$ref,t):d}if("$ref"in e&&!e.tagName){let f=String(e.$ref??"");if(!ks.has(f))ks.add(f),console.warn(`Jx: a $ref child ("${f}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let s=$r(e.tagName,o),i=s.includes("-")&&customElements.get(s);if(e.$props&&i)return Ds(e,o,n,r);if(e.$props){if(s.includes("-"))return Ds(e,o,n,r);let{$props:f,...d}=e;return ue(d,uc(e,o),n)}if(e.$switch)return ec(e,o,n);let a=Ul(s,n?._ns),c=s==="foreignObject"?null:a,l=a?document.createElementNS(a,s):document.createElement(s);if(n?.onNodeCreated)n.onNodeCreated(l,r,e,o);if(Pr(l,e,o),e.style&&s.includes("-"))Rr.set(l,e.style);bn(l,e.style??{},o.$media??{},o),En(l,e.attributes??{},o);let u=e.children;if(Bt(u)){let f=n||c?{...n,_ns:c,_path:[...r,"children"]}:void 0;Er(l,u,o,f)}else if(Array.isArray(u))for(let f=0;f<u.length;f++){let d=u[f],m=n||c?{...n,_ns:c,_path:[...r,"children",f]}:void 0;if(Bt(d))Er(l,d,o,m);else l.append(ue(d,o,m))}return l}function Pr(e,t,n){for(let[r,o]of Object.entries(t)){if(Pt.has(r))continue;if(r.startsWith("$"))continue;if(r.startsWith("on")&&Zs(e,r,o,n))continue;Qs(e,r,o,n)}}function Zs(e,t,n,r){let o=t.slice(2),s=r;if(V(n)){let i=G(n.$ref,r);if(typeof i==="function"){let a=i;e.addEventListener(o,(c)=>a(s,c))}return!0}if(Hn(n)){let{body:i}=n;return e.addEventListener(o,(a)=>{Ye(i,s,a)}),!0}if(ft(n)&&typeof n.body==="string"){let i=wr(n),a=Function(...i,n.body);return e.addEventListener(o,(c)=>a(s,c)),!0}if(Ke(n)){let i=n.$expression;return e.addEventListener(o,(a)=>Z(i,s,a)),!0}return!1}function ql(e,t,n){for(let[r,o]of Object.entries(t))if(r.startsWith("on")&&!Pt.has(r))Zs(e,r,o,n)}function Qs(e,t,n,r){let o=e,s=jl(t,n,r);if(s)e.dataset.jxBoundProp=s;let i=(c)=>typeof c==="string"?Ar(e.tagName,t,c):c,a=(c)=>{let l=e;if(t==="className"&&!(l instanceof HTMLElement)){l.setAttribute("class",c==null?"":String(c));return}if(o[t]===c)return;o[t]=c};if(V(n)){let c=n;if(t==="id"){o[t]=G(c.$ref,r);return}z(()=>{a(i(G(c.$ref,r)))});return}if(ie(n)){z(()=>{a(i(ve(n,r)))});return}a(i(n))}function Ts(e,t){let n=[];return{detach:t,insert(r){let o=[];for(let i of r){let a=e.cssRules.length;try{e.insertRule(i,a)}catch{continue}let c=e.cssRules[a];if(c)o.push(c)}let s={rules:o,texts:r};return n.push(s),s},remove(r){let o=n.indexOf(r);if(o!==-1)n.splice(o,1);if(r.rules.length===0)return;let s=[...e.cssRules],i=r.rules.map((a)=>s.indexOf(a)).filter((a)=>a>=0).toSorted((a,c)=>c-a);for(let a of i)e.deleteRule(a);r.rules.length=0},replaceAll(r){n.length=0,n.push({rules:[],texts:r}),e.replaceSync(r.join(`
1
+ var So,Hn,Bt,V=(e,t)=>{for(var[n,r,o]of So||[])for(var s=[e],i=globalThis,a=i.document,c,l,u,f,d;l=s.pop();)if(!Hn[l]&&(u=r[l])){Hn[l]=1;for(f=1;f<u.length;f++)s.push(o[u[f]]);if(!t&&l!==e&&(c=a&&a.head)){if(Bt===void 0)Bt=(f=a.querySelector("meta[property=csp-nonce]"))&&(f.nonce||f.getAttribute("nonce"))||"";if(d=a.createElement("link"),d.rel="modulepreload",d.crossOrigin="",Bt)d.nonce=Bt;d.href=new i.URL(u[0],n),c.appendChild(d)}}},Ma=(e,t,n,r)=>{for(var o={},s=0;s<t.length;s++)o[t[s]]=n[s];(So||=[]).push([e,o,t]),Hn||={},V(t[r],1)};Ma(import.meta.url,["qfa3kc6p","h19v1jfz","fd6g9xy3","spy3hc77","4d35zd64","8sjmfed3","fpezvnkt","p44xhjf0","gw7sq8rn","2mqby73c","8htra4er","n3v7gwas","pff8f3ze","8qh9a3bm","jwthg40w","2nnzqhrj","jqhna8zy","embq5ctg","1qmw7wqy","773hdzyj","mtm9fq5t","s8fkmnq8","37d07z9m","f7mqjwpm","haw7jkvz","z6qrytv3"],[["./iframe-entry.js"],["./chunks/tree-h19v1jfz.js"],["./chunks/tooltip-fd6g9xy3.js",23],["./chunks/textfield-spy3hc77.js"],["./chunks/toast-4d35zd64.js",24],["./chunks/toast-host-8sjmfed3.js",24],["./chunks/color-fpezvnkt.js",25],["./chunks/icons-p44xhjf0.js"],["./chunks/number-field-gw7sq8rn.js"],["./chunks/action-group-2mqby73c.js"],["./chunks/popover-8htra4er.js",23],["./chunks/select-n3v7gwas.js"],["./chunks/split-pff8f3ze.js"],["./chunks/swatch-group-8qh9a3bm.js"],["./chunks/tabs-jwthg40w.js"],["./chunks/toolbar-2nnzqhrj.js"],["./chunks/color-area-jqhna8zy.js",25],["./chunks/color-field-embq5ctg.js",25,23],["./chunks/color-slider-1qmw7wqy.js",25],["./chunks/combobox-773hdzyj.js",23],["./chunks/dialog-mtm9fq5t.js"],["./chunks/listbox-s8fkmnq8.js"],["./chunks/menu-37d07z9m.js",23],["./chunks/iframe-entry-f7mqjwpm.js"],["./chunks/iframe-entry-haw7jkvz.js"],["./chunks/iframe-entry-z6qrytv3.js"]],0);
2
+ function ko(e){let{target:t,source:n,targetOrigin:r,acceptOrigin:o,token:s}=e,i=new Set,a=(c)=>{if(o!=="*"&&c.origin!==o)return;let l=c.data;if(!l||typeof l!=="object"||l["jx:canvas"]!==s)return;for(let u of i)u(l.payload)};return n.addEventListener("message",a),{dispose(){i.clear(),n.removeEventListener("message",a)},onMessage(c){return i.add(c),()=>i.delete(c)},post(c){t.postMessage({["jx:canvas"]:s,payload:c},r)}}}function oe(e){return e.getBoundingClientRect()}function To(e){return e.getBoundingClientRect()}function Ao(e,t,n=document){return n.elementFromPoint(e,t)}function se(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function De(e){return se(e)&&typeof e.$ref==="string"}function ft(e){return se(e)&&e.$prototype==="Function"}function Ke(e){return se(e)&&se(e.$expression)}function Co(e){return Ke(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Fn(e){return ft(e)&&Array.isArray(e.body)}function Wn(e){return se(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function Bn(e){return se(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Kt(e){return se(e)&&e.$prototype==="Array"}function le(e){return typeof e==="string"&&e.includes("${")}function Kn(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Po(e){return De(e)||ft(e)||Ke(e)}function Ro(e){if(!e)return[];return e.map((t)=>typeof t==="string"?t:t.name)}function Vn(e){if(!se(e)||!se(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return se(t.cases)&&Object.values(t.cases).every((n)=>typeof n==="string")&&typeof t.default==="string";return!1}function _a(e){if(typeof e==="string")return[e];if(!Vn(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}function be(e){return typeof e==="string"?e:_a(e).join("|")}function Vt(e){return e.startsWith("#")}function Un(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var Ut=Object.assign;var Oa=Object.prototype.hasOwnProperty,qt=(e,t)=>Oa.call(e,t),Ve=Array.isArray,dt=(e)=>No(e)==="[object Map]";var $o=(e)=>typeof e==="function",Da=(e)=>typeof e==="string",Ue=(e)=>typeof e==="symbol",qe=(e)=>e!==null&&typeof e==="object";var La=Object.prototype.toString,No=(e)=>La.call(e),Mo=(e)=>No(e).slice(8,-1);var zt=(e)=>Da(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Gt=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ia=/-\w/g,wf=Gt((e)=>e.replace(Ia,(t)=>t.slice(1).toUpperCase())),Ja=/\B([A-Z])/g,Ef=Gt((e)=>e.replace(Ja,"-$1").toLowerCase()),_o=Gt((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vf=Gt((e)=>e?`on${_o(e)}`:""),we=(e,t)=>!Object.is(e,t);var ja="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Sf=Un(ja+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var z;class Lo{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&z)if(z.active)this.parent=z,this.index=(z.scopes||(z.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=z;try{return z=this,e()}finally{z=t}}}on(){if(++this._on===1)this.prevScope=z,z=this}off(){if(this._on>0&&--this._on===0){if(z===this)z=this.prevScope;else{let e=z;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function Ge(e){return new Lo(e)}function Qt(e,t=!1){if(z)z.cleanups.push(e)}var H;var qn=new WeakSet;class Zt{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,z)if(z.active)z.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,qn.has(this))qn.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Jo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Oo(this),jo(this);let e=H,t=ce;H=this,ce=!0;try{return this.fn()}finally{Ho(this),H=e,ce=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)rr(e);this.deps=this.depsTail=void 0,Oo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)qn.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Yn(this))this.run()}get dirty(){return Yn(this)}}var Io=0,mt,ht;function Jo(e,t=!1){if(e.flags|=8,t){e.next=ht,ht=e;return}e.next=mt,mt=e}function tr(){Io++}function nr(){if(--Io>0)return;if(ht){let t=ht;ht=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(mt){let t=mt;mt=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function jo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ho(e){let t,n=e.depsTail,r=n;while(r){let o=r.prevDep;if(r.version===-1){if(r===n)n=o;rr(r),Ha(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Yn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Fo(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===gt)return;if(e.globalVersion=gt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Yn(e)))return;e.flags|=2;let t=e.dep,n=H,r=ce;H=e,ce=!0;try{jo(e);let o=e.fn(e._value);if(t.version===0||we(o,e._value))e.flags|=128,e._value=o,t.version++}catch(o){throw t.version++,o}finally{H=n,ce=r,Ho(e),e.flags&=-3}}function rr(e,t=!1){let{dep:n,prevSub:r,nextSub:o}=e;if(r)r.nextSub=o,e.prevSub=void 0;if(o)o.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)rr(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Ha(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function G(e,t){if(e.effect instanceof Zt)e=e.effect.fn;let n=new Zt(e);if(t)Ut(n,t);try{n.run()}catch(o){throw n.stop(),o}let r=n.run.bind(n);return r.effect=n,r}var ce=!0,Wo=[];function en(){Wo.push(ce),ce=!1}function tn(){let e=Wo.pop();ce=e===void 0?!0:e}function nn(e,t=!1){if(H instanceof Zt)H.cleanup=e}function Oo(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=H;H=void 0;try{t()}finally{H=n}}}var gt=0;class Bo{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class rn{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!H||!ce||H===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==H){if(t=this.activeLink=new Bo(H,this),!H.deps)H.deps=H.depsTail=t;else t.prevDep=H.depsTail,H.depsTail.nextDep=t,H.depsTail=t;Ko(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=H.depsTail,t.nextDep=void 0,H.depsTail.nextDep=t,H.depsTail=t,H.deps===t)H.deps=n}}return t}trigger(e){this.version++,gt++,this.notify(e)}notify(e){tr();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{nr()}}}function Ko(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ko(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var Xn=new WeakMap,Le=Symbol(""),Zn=Symbol(""),xt=Symbol("");function Q(e,t,n){if(ce&&H){let r=Xn.get(e);if(!r)Xn.set(e,r=new Map);let o=r.get(n);if(!o)r.set(n,o=new rn),o.map=r,o.key=n;o.track()}}function Ce(e,t,n,r,o,s){let i=Xn.get(e);if(!i){gt++;return}let a=(c)=>{if(c)c.trigger()};if(tr(),t==="clear")i.forEach(a);else{let c=Ve(e),l=c&&zt(n);if(c&&n==="length"){let u=Number(r);i.forEach((f,d)=>{if(d==="length"||d===xt||!Ue(d)&&d>=u)a(f)})}else{if(n!==void 0||i.has(void 0))a(i.get(n));if(l)a(i.get(xt));switch(t){case"add":if(!c){if(a(i.get(Le)),dt(e))a(i.get(Zn))}else if(l)a(i.get("length"));break;case"delete":if(!c){if(a(i.get(Le)),dt(e))a(i.get(Zn))}break;case"set":if(dt(e))a(i.get(Le));break}}}nr()}function ze(e){let t=j(e);if(t===e)return t;if(Q(t,"iterate",xt),Re(e))return t;if(!ve(e))return t.map(ge);return yt(e)?t.map((n)=>Ie(ge(n))):t.map(Ie)}function or(e){return Q(e=j(e),"iterate",xt),e}function he(e,t){if(ve(e))return yt(e)?Ie(ge(t)):Ie(t);return ge(t)}var Fa={__proto__:null,[Symbol.iterator](){return zn(this,Symbol.iterator,(e)=>he(this,e))},concat(...e){return ze(this).concat(...e.map((t)=>Ve(t)?ze(t):t))},entries(){return zn(this,"entries",(e)=>(e[1]=he(this,e[1]),e))},every(e,t){return Ee(this,"every",e,t,void 0,arguments)},filter(e,t){return Ee(this,"filter",e,t,(n)=>n.map((r)=>he(this,r)),arguments)},find(e,t){return Ee(this,"find",e,t,(n)=>he(this,n),arguments)},findIndex(e,t){return Ee(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ee(this,"findLast",e,t,(n)=>he(this,n),arguments)},findLastIndex(e,t){return Ee(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ee(this,"forEach",e,t,void 0,arguments)},includes(...e){return Gn(this,"includes",e)},indexOf(...e){return Gn(this,"indexOf",e)},join(e){return ze(this).join(e)},lastIndexOf(...e){return Gn(this,"lastIndexOf",e)},map(e,t){return Ee(this,"map",e,t,void 0,arguments)},pop(){return pt(this,"pop")},push(...e){return pt(this,"push",e)},reduce(e,...t){return Do(this,"reduce",e,t)},reduceRight(e,...t){return Do(this,"reduceRight",e,t)},shift(){return pt(this,"shift")},some(e,t){return Ee(this,"some",e,t,void 0,arguments)},splice(...e){return pt(this,"splice",e)},toReversed(){return ze(this).toReversed()},toSorted(e){return ze(this).toSorted(e)},toSpliced(...e){return ze(this).toSpliced(...e)},unshift(...e){return pt(this,"unshift",e)},values(){return zn(this,"values",(e)=>he(this,e))}};function zn(e,t,n){let r=or(e),o=r[t]();if(r!==e&&!Re(e))o._next=o.next,o.next=()=>{let s=o._next();if(!s.done)s.value=n(s.value);return s};return o}var Wa=Array.prototype;function Ee(e,t,n,r,o,s){let i=or(e),a=i!==e&&!Re(e),c=i[t];if(c!==Wa[t]){let f=c.apply(e,s);return a?ge(f):f}let l=n;if(i!==e){if(a)l=function(f,d){return n.call(this,he(e,f),d,e)};else if(n.length>2)l=function(f,d){return n.call(this,f,d,e)}}let u=c.call(i,l,r);return a&&o?o(u):u}function Do(e,t,n,r){let o=or(e),s=o!==e&&!Re(e),i=n,a=!1;if(o!==e){if(s)a=r.length===0,i=function(l,u,f){if(a)a=!1,l=he(e,l);return n.call(this,l,he(e,u),f,e)};else if(n.length>3)i=function(l,u,f){return n.call(this,l,u,f,e)}}let c=o[t](i,...r);return a?he(e,c):c}function Gn(e,t,n){let r=j(e);Q(r,"iterate",xt);let o=r[t](...n);if((o===-1||o===!1)&&tl(n[0]))return n[0]=j(n[0]),r[t](...n);return o}function pt(e,t,n=[]){en(),tr();let r=j(e)[t].apply(e,n);return nr(),tn(),r}var Ba=Un("__proto__,__v_isRef,__isVue"),Vo=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Ue));function Ka(e){if(!Ue(e))e=String(e);let t=j(this);return Q(t,"has",e),t.hasOwnProperty(e)}class sr{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return o;else if(t==="__v_raw"){if(n===(r?o?Qa:Go:o?zo:qo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=Ve(e);if(!r){let a;if(s&&(a=Fa[t]))return a;if(t==="hasOwnProperty")return Ka}let i=Reflect.get(e,t,Pe(e)?e:n);if(Ue(t)?Vo.has(t):Ba(t))return i;if(!r)Q(e,"get",t);if(o)return i;if(Pe(i)){let a=s&&zt(t)?i:i.value;return r&&qe(a)?er(a):a}if(qe(i))return r?er(i):on(i);return i}}class ir extends sr{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t],s=Ve(e)&&zt(t);if(!this._isShallow){let c=ve(o);if(!Re(n)&&!ve(n))o=j(o),n=j(n);if(!s&&Pe(o)&&!Pe(n))if(c)return!0;else return o.value=n,!0}let i=s?Number(t)<e.length:qt(e,t),a=Reflect.set(e,t,n,Pe(e)?e:r);if(e===j(r)&&a){if(!i)Ce(e,"add",t,n);else if(we(n,o))Ce(e,"set",t,n,o)}return a}deleteProperty(e,t){let n=qt(e,t),r=e[t],o=Reflect.deleteProperty(e,t);if(o&&n)Ce(e,"delete",t,void 0,r);return o}has(e,t){let n=Reflect.has(e,t);if(!Ue(t)||!Vo.has(t))Q(e,"has",t);return n}ownKeys(e){return Q(e,"iterate",Ve(e)?"length":Le),Reflect.ownKeys(e)}}class Uo extends sr{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Va=new ir,Ua=new Uo,qa=new ir(!0);var Qn=(e)=>e,Yt=(e)=>Reflect.getPrototypeOf(e);function za(e,t,n){return function(...r){let o=this.__v_raw,s=j(o),i=dt(s),a=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,l=o[e](...r),u=n?Qn:t?Ie:ge;return!t&&Q(s,"iterate",c?Zn:Le),Ut(Object.create(l),{next(){let{value:f,done:d}=l.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}}})}}function Xt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ga(e,t){let n={get(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(we(o,a))Q(i,"get",o);Q(i,"get",a)}let{has:c}=Yt(i),l=t?Qn:e?Ie:ge;if(c.call(i,o))return l(s.get(o));else if(c.call(i,a))return l(s.get(a));else if(s!==i)s.get(o)},get size(){let o=this.__v_raw;return!e&&Q(j(o),"iterate",Le),o.size},has(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(we(o,a))Q(i,"has",o);Q(i,"has",a)}return o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){let i=this,a=i.__v_raw,c=j(a),l=t?Qn:e?Ie:ge;return!e&&Q(c,"iterate",Le),a.forEach((u,f)=>o.call(s,l(u),l(f),i))}};return Ut(n,e?{add:Xt("add"),set:Xt("set"),delete:Xt("delete"),clear:Xt("clear")}:{add(o){let s=j(this),i=Yt(s),a=j(o),c=!t&&!Re(o)&&!ve(o)?a:o;if(!(i.has.call(s,c)||we(o,c)&&i.has.call(s,o)||we(a,c)&&i.has.call(s,a)))s.add(c),Ce(s,"add",c,c);return this},set(o,s){if(!t&&!Re(s)&&!ve(s))s=j(s);let i=j(this),{has:a,get:c}=Yt(i),l=a.call(i,o);if(!l)o=j(o),l=a.call(i,o);let u=c.call(i,o);if(i.set(o,s),!l)Ce(i,"add",o,s);else if(we(s,u))Ce(i,"set",o,s,u);return this},delete(o){let s=j(this),{has:i,get:a}=Yt(s),c=i.call(s,o);if(!c)o=j(o),c=i.call(s,o);let l=a?a.call(s,o):void 0,u=s.delete(o);if(c)Ce(s,"delete",o,void 0,l);return u},clear(){let o=j(this),s=o.size!==0,i=void 0,a=o.clear();if(s)Ce(o,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((o)=>{n[o]=za(o,e,t)}),n}function ar(e,t){let n=Ga(e,t);return(r,o,s)=>{if(o==="__v_isReactive")return!e;else if(o==="__v_isReadonly")return e;else if(o==="__v_raw")return r;return Reflect.get(qt(n,o)&&o in r?n:r,o,s)}}var Ya={get:ar(!1,!1)},Xa={get:ar(!1,!0)},Za={get:ar(!0,!1)};var qo=new WeakMap,zo=new WeakMap,Go=new WeakMap,Qa=new WeakMap;function el(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function on(e){if(ve(e))return e;return lr(e,!1,Va,Ya,qo)}function Yo(e){return lr(e,!1,qa,Xa,zo)}function er(e){return lr(e,!0,Ua,Za,Go)}function lr(e,t,n,r,o){if(!qe(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=o.get(e);if(s)return s;let i=el(Mo(e));if(i===0)return e;let a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function yt(e){if(ve(e))return yt(e.__v_raw);return!!(e&&e.__v_isReactive)}function ve(e){return!!(e&&e.__v_isReadonly)}function Re(e){return!!(e&&e.__v_isShallow)}function tl(e){return e?!!e.__v_raw:!1}function j(e){let t=e&&e.__v_raw;return t?j(t):e}var ge=(e)=>qe(e)?on(e):e,Ie=(e)=>qe(e)?er(e):e;function Pe(e){return e?e.__v_isRef===!0:!1}function ue(e){return nl(e,!1)}function nl(e,t){if(Pe(e))return e;return new Xo(e,t)}class Xo{constructor(e,t){this.dep=new rn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:j(e),this._value=t?e:ge(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Re(e)||ve(e);if(e=n?e:j(e),we(e,t))this._rawValue=e,this._value=n?e:ge(e),this.dep.trigger()}}class Zo{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new rn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&H!==this)return Jo(this,!0),!0}get value(){let e=this.dep.track();if(Fo(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function bt(e,t,n=!1){let r,o;if($o(e))r=e;else r=e.get,o=e.set;return new Zo(r,o,n)}function sn(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var rl=new Set(["all","print","screen","speech"]);function Qo(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return rl.has(n.toLowerCase())?n:e.slice(1)}return null}function wt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function vt(e){return e.startsWith("@keyframes")}function es(e,t){let n=[];for(let r of cr(e))for(let o of cr(t))n.push(ol(r,o));return n.join(", ")}function ol(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function cr(e){let t=[],n=0,r=null,o=0;for(let i=0;i<e.length;i+=1){let a=e[i];if(r){if(a==="\\")i+=1;else if(a===r)r=null;continue}if(a==='"'||a==="'")r=a;else if(a==="("||a==="[")n+=1;else if(a===")"||a==="]")n=Math.max(0,n-1);else if(a===","&&n===0)t.push(e.slice(o,i)),o=i+1}t.push(e.slice(o));let s=t.map((i)=>i.trim()).filter((i)=>i!=="");return s.length>0?s:[e]}var sl=/[\s>+~,()]/,il=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function al(e,t){let n="",r=0;for(;;){let o=e.indexOf("[open]",r);if(o===-1)return n+e.slice(r);let s=o;while(s>0&&!sl.test(e[s-1]))s-=1;let i=il.exec(e.slice(s,o))?.[0]?.toLowerCase(),a=i===void 0?t.dialog===!0:i==="dialog";n+=e.slice(r,o)+(a?"[data-jx-dialog-open]":"[open]"),r=o+6}}function ur(e,t={}){if(e.includes("::backdrop"))return null;let n=e.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return al(n,t)}var $e="data-color-scheme";function an(e){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1]??null}function ts(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${$e}]))`,forced:`${e}:where([${$e}="${t}"])`};return{auto:`:where(:root:not([${$e}])) ${e}`,forced:`:where(:root[${$e}="${t}"]) ${e}`}}function St(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function fr(e){return e.startsWith("--")?e:sn(e)}function Et(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ns(e,t,n){let r=n.map(([s,i])=>`${s}: ${i}`).join("; "),o=t===null?r:`${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)o=`${e[s]} { ${o} }`;return o}function ll(e,t,n){let r=n.map(({selector:s,declarations:i})=>`${s} { ${i.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),o=`@keyframes ${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)o=`${e[s]} { ${o} }`;return o}function cl(e){let t=Object.keys(e).filter((r)=>vt(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function ul(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function kt(e,t={}){let{scope:n=null,mediaQueries:r={},transposeValue:o=(h)=>h,transposeSelector:s=(h)=>h,resolveValue:i}=t,a=[],c=(h)=>h!==null&&typeof h==="object"&&!Array.isArray(h)&&!De(h),l=(h,x)=>{if(c(x))return[x];if(!wt(h)||!Array.isArray(x)||x.length===0)return[];return x.every((S)=>c(S))?x:[]},u=(h,x,S,A)=>{if(x===void 0||x===null)return null;if(De(x))return S?i?.(h,x,A)??null:null;if(typeof x==="object")return null;let C=String(x);if(le(C))return S?i?.(h,C,A)??null:null;return o(C)},f=(h,x,S=!0,A="self")=>{let C=[];for(let[T,g]of Object.entries(h)){if(l(T,g).length>0)continue;if(x&&(T.startsWith("@")||St(T)))continue;if(T.startsWith("$"))continue;let v=u(T,g,S,A);if(v!==null)C.push([fr(T),v])}return C},d=(h,x,S,A,C)=>{if(S.length===0)return;let T=x;if(T!==null){let v=s(T);if(v===null)return;T=v}let g=ns(h,T,S);a.push({text:g,conditions:[...h],selector:T,declarations:S,target:A,key:Et(g),...typeof C==="string"&&C!==""?{description:C}:{}})},m=(h,x,S)=>{let A=h.slice(10).trim();if(A==="")return;let C=[];for(let[g,v]of Object.entries(x)){if(!c(v))continue;let P=f(v,!0,!1,"unscoped");if(P.length>0)C.push({declarations:P,selector:g.trim()})}if(C.length===0)return;let T=ll(S,A,C);a.push({blocks:C,conditions:[...S],declarations:[],key:Et(T),selector:null,target:"unscoped",text:T})},w=(h,x,S,A,C)=>{if(h==="@--")return;if(wt(h)){d([...A,h],null,f(x,!1,!0,"unscoped"),"unscoped",x.$description);return}if(vt(h)){m(h,x,A);return}let T=Qo(h,r),g=T===null?h:`@media ${T}`,v=T===null?null:an(T);if(v!==null&&S!==null){let{auto:P,forced:E}=ts(S,v);y(x,P,[...A,g],C),y(cl(x),E,A,C);return}y(x,S,[...A,g],C)};function y(h,x,S,A){d(S,x,f(h,!0,!0,A),A,h.$description);for(let[C,T]of Object.entries(h))for(let g of l(C,T))if(C.startsWith("@"))w(C,g,x,S,A);else if(x!==null)y(g,es(x,C),S,ul(C)?A:"descendant")}return y(e,n,[],"self"),a}var Se="en-US",rs="UTC",os=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],ss=os.map((e)=>e.path),is=Object.fromEntries(os.map((e)=>[e.path,e.params.indexOf("locale")]));function fl(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function dr(e){if(e==="")return[];return e.split("/").map((t)=>fl(t))}function fe(e,t){let n=e;for(let r of dr(t))n=n?.[r];return n}function pr(e){let t=e.$map;return t&&typeof t==="object"?t:void 0}var ls=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),cs=new Set(["!","-"]),us=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),dl=new Set(["=","+=","-=","*=","/="]),pl=new Set(["push","pop","shift","unshift","splice"]),fs=new Set(["reduce","map","filter"]),ds=new Set(["?:","switch"]),ps=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),ml=new Set([...ls,...cs,...us,...fs,...ds,...ps,"call"]),hl=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...ss]),gl={"Intl/compare":(e,t,n,r)=>new Intl.Collator(n??Se,r).compare(e,t),"Intl/displayName":(e,t,n,r)=>new Intl.DisplayNames(n??Se,{...r,type:t??"language"}).of(e),"Intl/formatDate":(e,t,n)=>new Intl.DateTimeFormat(t??Se,{timeZone:rs,...n}).format(new Date(e)),"Intl/formatList":(e,t,n)=>new Intl.ListFormat(t??Se,n).format(e),"Intl/formatNumber":(e,t,n)=>new Intl.NumberFormat(t??Se,n).format(e),"Intl/formatRelativeTime":(e,t,n,r)=>new Intl.RelativeTimeFormat(n??Se,r).format(e,t),"Intl/plural":(e,t,n)=>new Intl.PluralRules(t??Se,n).select(e),"Intl/segment":(e,t,n)=>[...new Intl.Segmenter(n??Se,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)};function xl(e,t,n){let r=is[e];if(r===void 0||r<0||t[r]!=null)return t;let s=n.$page?.locale;if(typeof s!=="string"||s==="")return t;let i=[...t];return i[r]=s,i}function yl(e){return e.startsWith("window#/")&&hl.has(e.slice(8))}function ms(e){return ls.has(e)}var as=64,bl=64;function K(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>bl)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function W(e,t,n,r,o){if(e===null||e===void 0)return e;if(typeof e==="object"&&!Array.isArray(e)&&"operator"in e)return ee(e,t,n,r,o);if(typeof e==="object"&&!Array.isArray(e)&&"$ref"in e){let s=ln(e.$ref,t,n,r);return o?.report(o.path??[],s),s}if(Array.isArray(e))return e.map((s,i)=>W(s,t,n,r,K(o,i)));return o?.report(o.path??[],e),e}function wl(e,t,n,r){let o=(s)=>{if(!e.slice(s.length).includes("/"))return t;return ln(e.slice(0,e.lastIndexOf("/")),t,n,r)};if(e.startsWith("#/state/"))return o("#/state/");if(e.startsWith("parent#/"))return o("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?ln(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function ln(e,t,n,r){if(e==="$reduce/acc")return r?.acc;if(e.startsWith("$reduce/"))return r?.acc;if(e.startsWith("$args/")){let o=e.slice(6).split("/"),s=r?.args?.[o[0]];return o.length>1?Ne(s,o.slice(1).join("/")):s}if(e.startsWith("event#/")){let o=e.slice(7);return Ne(n,o)}if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=pr(t);if(s==="item")i=r?.item??a?.item??t["$map/item"];else if(s==="index")i=r?.index??a?.index??t["$map/index"];else i=a?.[s]??t[`$map/${s}`];return o.length>2?Ne(i,o.slice(2).join("/")):i}if(e.startsWith("#/state/"))return fe(t,e.slice(8));if(e.startsWith("parent#/"))return fe(t,e.slice(8));if(e.startsWith("window#/"))return Ne(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Ne(globalThis.document,e.slice(10));return fe(t,e)??null}function El(e,t,n,r){if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=pr(t);if(s==="item")i=r?.item??a?.item??t["$map/item"];else if(s==="index")i=r?.index??a?.index??t["$map/index"];else i=a?.[s]??t[`$map/${s}`];if(o.length>2){let c=o.slice(2),l=c.pop(),u=c.length>0?Ne(i,c.join("/")):i;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:pr(t)??t}}if(e.startsWith("#/state/")){let o=e.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let i=dr(o),a=i.pop(),c=t;for(let l of i)c=c[l];return{key:a,obj:c}}return{key:e,obj:t}}function ee(e,t,n,r,o){let s=vl(e,t,n,r,o);return o?.report(o.path??[],s),s}function vl(e,t,n,r,o){let{operator:s,target:i,value:a,initial:c}=e;if(!ml.has(s))throw Error(`$expression: unknown operator "${s}"`);if(cs.has(s)&&!("value"in e)){let l=W(i,t,n,r,K(o,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=i?.$ref;if(typeof l!=="string")throw TypeError("$expression: call target must be a $ref pointer");let u=(r?.callDepth??0)+1;if(u>as)throw Error(`$expression: call depth exceeded (${as})`);let f=Array.isArray(a)?a.map((m,w)=>W(m,t,n,r,K(o,["value",w]))):[];if(l.startsWith("window#/")){if(!yl(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),w=gl[m];if(w)return w(...xl(m,f,t));let y=Ne(globalThis.window,m),h=m.lastIndexOf("/"),x=h===-1?globalThis.window:Ne(globalThis.window,m.slice(0,h));return y.apply(x,f)}let d=ln(l,t,n,r);if(typeof d==="function")return d.apply(wl(l,t,n,r),f);if(d&&typeof d==="object"&&"$expression"in d){let m=d,w={};for(let[y,h]of(m.parameters??[]).entries()){let x=typeof h==="string"?h:h?.name??"";if(!x)continue;w[x]=f[y]===void 0&&typeof h==="object"&&h!==null&&"default"in h?h.default:f[y]}return ee(m.$expression,t,n,{args:w,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(ds.has(s)){if(s==="?:"){let m=W(i,t,n,r,K(o,"target"));if(o){let w=W(a,t,n,r,K(o,"value")),y=W(c,t,n,r,K(o,"initial"));return m?w:y}return m?W(a,t,n,r):W(c,t,n,r)}let l=W(i,t,n,r,K(o,"target")),u=String(l),f=e.cases??{},d=Object.hasOwn(f,u);if(o){let m;for(let[y,h]of Object.entries(f)){let x=W(h,t,n,r,K(o,["cases",y]));if(y===u)m=x}let w=W(e.default,t,n,r,K(o,"default"));return d?m:w}return d?W(f[u],t,n,r):W(e.default,t,n,r)}if(us.has(s)){let l=W(i,t,n,r,K(o,"target")),u=W(a,t,n,r,K(o,"value"));switch(s){case"+":return l+u;case"-":return l-u;case"*":return l*u;case"/":return l/u;case"%":return l%u;case"===":return l===u;case"!==":return l!==u;case"<":return l<u;case"<=":return l<=u;case">":return l>u;case">=":return l>=u;case"&&":return l&&u;case"||":return l||u;case"??":return l??u;default:break}}if(dl.has(s)){let l=W(a,t,n,r,K(o,"value")),{obj:u,key:f}=El(i.$ref,t,n,r);switch(s){case"=":{u[f]=l;break}case"+=":{let d=u[f];u[f]=d+l;break}case"-=":{let d=u[f];u[f]=d-l;break}case"*=":{let d=u[f];u[f]=d*l;break}case"/=":{let d=u[f];u[f]=d/l;break}default:break}return}if(pl.has(s)){let l=W(i,t,n,r,K(o,"target"));switch(s){case"push":return l.push(W(a,t,n,r,K(o,"value")));case"unshift":return l.unshift(W(a,t,n,r,K(o,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=W(a,t,n,r,K(o,"value"));return l.splice(...u)}default:break}}if(ps.has(s)){let l=W(i,t,n,r,K(o,"target")),u=a===void 0?[]:Array.isArray(a)?W(a,t,n,r,K(o,"value")):[W(a,t,n,r,K(o,"value"))],f=l?.[s];if(typeof f!=="function")return;return f.apply(l,u)}if(fs.has(s)){let l=W(i,t,n,r,K(o,"target"));if(s==="reduce"){let u=W(c,t,n,r,K(o,"initial"));for(let[f,d]of l.entries())u=ee(a,t,n,{acc:u,index:f,item:d},f===0?K(o,"value"):void 0);return u}if(s==="map")return l.map((u,f)=>ee(a,t,n,{...r,index:f,item:u},f===0?K(o,"value"):void 0));if(s==="filter")return l.filter((u,f)=>ee(a,t,n,{...r,index:f,item:u},f===0?K(o,"value"):void 0))}return}function Ne(e,t){return fe(e,t)}function Je(e,t,n,r){return W(e,t,n,r)}function cn(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function hs(e){let t=cn(e);return t.startsWith("/")?t:`/${t}`}function gs(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function Sl(e,t){return e===t||e.startsWith(`${t}/`)}function xs(e,t){let n=cn(t);for(let r of gs(e,"dir")){let o=cn(r.dir);if(!Sl(n,o)||n===o)continue;let s=n.slice(o.length+1),{filter:i}=r;if(i&&!i(s))return null;let a=s.split("/").map((c)=>encodeURIComponent(c)).join("/");return`${hs(r.urlPrefix)}/${a}`}return null}function kl(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let o of gs(e,"urlPrefix")){let s=hs(o.urlPrefix);if(!r.startsWith(`${s}/`))continue;let a=r.slice(s.length+1).split("/");if(a.some((l)=>l===""||l==="."||l===".."))return null;let{filter:c}=o;if(c&&!c(a.join("/")))return null;return`${cn(o.dir)}/${a.join("/")}`}return null}var Ff=String.raw`"'\s<>()\\`;var Tl="public";function Tt(e){let t=e.search(/[#?]/);return t===-1?{path:e,suffix:""}:{path:e.slice(0,t),suffix:e.slice(t)}}function mr(e){return e===""||e.startsWith("/")||e.startsWith("#")||e.includes("${")||/^[a-z][\w+.-]*:/i.test(e)}function hr(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function gr(e,t){let r=(e===""||e==="."?[]:hr(e).split("/")).filter((o)=>o!==""&&o!==".");for(let o of t.replaceAll("\\","/").split("/")){if(o===""||o===".")continue;if(o===".."){if(r.length===0)return null;r.pop();continue}r.push(o)}return r.join("/")}function Al(e,t,n){let{path:r}=Tt(e);if(!r.startsWith("/"))return[];let o;try{o=decodeURIComponent(r)}catch{return[]}if(/%2e|%2f/i.test(o))return[];let s=o.replace(/^\/+/,"");if(s===""||s.split("/").some((a)=>a==="."||a===".."))return[];let i=[];for(let a of n){if(a==="mounts"){let c=kl(t,r);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))i.push(hr(c));continue}i.push(a==="root"?s:`${Tl}/${s}`)}return[...new Set(i)]}function ys(e,t,n,r){let{path:o}=Tt(e);if(o==="")return null;if(mr(e))return o.startsWith("/")?Al(o,n,r)[0]??null:null;if(o.endsWith("/"))return null;let s;try{s=decodeURIComponent(o)}catch{return null}let i=gr(t,s);if(i===null||i===""||i===hr(t))return null;return i}function bs(e){return e.split("/").map((t)=>encodeURIComponent(t)).join("/")}function ws(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let o=e.slice(r,n);if(o.endsWith(",")){t.push({descriptor:"",url:o.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let s=n;while(n<e.length&&e[n]!==",")n+=1;let i=e.slice(s,n).trim();if(n+=1,o=o.replace(/,+$/,""),o!=="")t.push({descriptor:i,url:o})}return t}function Es(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Cl(e){if("operator"in e)return"expression";if("if"in e)return"if";if("$switch"in e)return"switch";if("stopPropagation"in e)return"stopPropagation";if("preventDefault"in e)return"preventDefault";return"dispatch"}async function Ye(e,t,n,r={}){let o=r.args?{args:r.args}:void 0;for(let s of e)switch(Cl(s)){case"expression":{let i=ee(s,t,n,o);if(i&&typeof i.then==="function")await i;break}case"if":{let i=s,a=Je(i.if,t,n,o)?i.then:i.else;if(Array.isArray(a))await Ye(a,t,n,r);break}case"switch":{let i=s,a=String(Je(i.$switch,t,n,o)),c=i.cases??{},l=Object.hasOwn(c,a)?c[a]:i.default;if(Array.isArray(l))await Ye(l,t,n,r);break}case"dispatch":{let i=s,a=typeof r.target==="function"?r.target():r.target,c=n?.currentTarget??a;if(!c)break;let l={};if("detail"in i)l.detail=Je(i.detail,t,n,o);if(i.bubbles!==void 0)l.bubbles=i.bubbles;if(i.composed!==void 0)l.composed=i.composed;c.dispatchEvent(new CustomEvent(i.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}function vs(e,t){for(let n of e.split(";")){let r=n.indexOf("=");if(r===-1)continue;if(n.slice(0,r).trim()===t)return n.slice(r+1)}return null}function Ss(e,t,n){let r=e.startsWith("__Host-"),o=[`${e}=${encodeURIComponent(JSON.stringify(t))}`];if(n.maxAge!==void 0)o.push(`Max-Age=${n.maxAge}`);let s=r?"/":n.path;if(s)o.push(`Path=${s}`);if(n.domain&&!r)o.push(`Domain=${n.domain}`);let{sameSite:i}=n;if(n.secure===!0||r||e.startsWith("__Secure-")||i?.toLowerCase()==="none")o.push("Secure");if(i)o.push(`SameSite=${i}`);return o.join("; ")}var xr=new Map;async function kr(e,t){if(typeof e!=="string")return e;let n=t?.resolver?.(e);if(n)return n;if(xr.has(e))return xr.get(e);let r=fetch(e).then(async(o)=>{if(!o.ok)throw Error(`Jx: failed to fetch ${e} (${o.status})`);if((o.headers?.get("Content-Type")??"").includes("text/html"))throw Error(`Jx: ${e} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await o.json()});return xr.set(e,r),r}var Pl=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),Ds={skip:!1};function Ls(e){Ds.skip=e}var Is={skip:!1};function Js(e){Is.skip=e}var br=null;function js(e){br=e||null}function Hs(e){return br?`${e}?token=${encodeURIComponent(br)}`:e}function Fs(e){let t=Ge(!0);return t.run(()=>{G(e)}),()=>t.stop()}function xn(e){let t=Ge(!0);try{return{result:t.run(e),stop:()=>t.stop()}}catch(n){throw t.stop(),n}}var Ws=!1;function Bs(e){Ws=e}var Rl=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,$l={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};function Nl(e){if(!Ws||!e.includes("v"))return e;return e.replace(Rl,(t,n,r)=>`${n}${$l[r.toLowerCase()]??`cq${r}`}`)}var Ks=!1;function Vs(e){Ks=e}var Tr=!1;function Us(e){Tr=e}var Ar=!1;function qs(e){Ar=e}var fn=!1;function wr(e){return fn||e.dataset.jxPath!==void 0}function Ml(e,t){if(Ks&&t==="href"&&(e.tagName==="A"||e.tagName==="AREA"))return"data-jx-href";if(Tr&&t==="popover"&&wr(e))return"data-jx-popover";if(Ar&&wr(e)){if(t==="commandfor")return"data-jx-commandfor";if(t==="inert")return"data-jx-inert";if(t==="open"&&e.tagName==="DIALOG")return"data-jx-open"}return t}var Ze=null;function yn(e){Ze=e}var _l=new Set(["src","poster","data"]),Ol=new Set(["srcset","imagesrcset"]),Dl=new Set(["LINK"]);function Ll(e,t){return _l.has(t)||t==="href"&&Dl.has(e)}function Cr(e,t,n){if(!Ze||n==="")return n;let r=t.toLowerCase();if(Ol.has(r)){let o=ws(n),s=!1,i=o.map((a)=>{let c=Ze?.(a.url,r)??null;if(c===null||c===a.url)return a;return s=!0,{descriptor:a.descriptor,url:c}});return s?Es(i):n}if(!Ll(e,r))return n;return Ze(n,r)??n}var Il=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function Jl(e){if(!Ze||!e.includes("url("))return e;return e.replaceAll(Il,(t,n,r)=>{let o=r===""?null:Ze?.(r,"url()")??null;return o===null?t:`url(${n}${o}${n})`})}function dn(e){return Nl(Jl(e))}var zs=!1;function Gs(e){zs=e}var jl=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function Hl(e,t,n){if(!zs||e!=="textContent")return null;let r=null;if(U(t)){if(!t.$ref.startsWith("#/state/"))return null;let s=t.$ref.slice(8);r=s&&!s.includes("/")?s:null}else if(typeof t==="string")r=jl.exec(t)?.[1]??null;if(!r)return null;let o=j(n)[r];if(Pe(o)||typeof o==="function")return null;if(typeof o==="object"&&o!==null)return null;return r}async function bn(e,t={},n=location.href,r){let o=()=>r?.root??null,s={},i=e.state??{},a=yt(t);for(let f of Object.keys(t))if(a&&!(f in i))Object.defineProperty(s,f,{configurable:!0,enumerable:!0,get:()=>t[f],set:(d)=>{t[f]=d}});else s[f]=t[f];let c=e.imports??{};for(let[,f]of Object.entries(i))if(Wn(f)&&!f.$src){let d=c[f.$prototype];if(d){if(!d.endsWith(".class.json")){console.warn(`Jx: import "${f.$prototype}" must map to a .class.json path, got "${d}"`);continue}f.$src=d}}for(let[f,d]of Object.entries(i)){if(typeof d==="string"){if(!d.includes("${"))s[f]=d;continue}if(typeof d==="number"||typeof d==="boolean"||d===null){s[f]=d;continue}if(Array.isArray(d)){s[f]=d;continue}if(typeof d==="object"){if(d.$prototype)continue;if(Ke(d))continue;if(Bn(d))continue;if("default"in d){s[f]=d.default;continue}if(Fl(d))continue;s[f]=d}}let l=on(s);for(let[f,d]of Object.entries(i))if(typeof d==="string"&&d.includes("${"))l[f]=bt(()=>ke(d,l));for(let[f,d]of Object.entries(i))if(Ke(d)){let m=d.$expression;if(Co(d)){let w=d.parameters;l[f]=(...y)=>{let h={};for(let[x,S]of w.entries()){let A=typeof S==="string"?S:S?.name??"";if(!A)continue;h[A]=y[x]===void 0&&typeof S==="object"&&S!==null&&"default"in S?S.default:y[x]}return ee(m,l,null,{args:h})}}else if(ms(m.operator)){let w=(y,h)=>ee(m,y,h);l[f]=w}else l[f]=bt(()=>ee(m,l,null))}for(let[f,d]of Object.entries(i))if(Fn(d)){let{body:m}=d;if(Array.isArray(d.parameters)&&d.parameters.length>0){let w=d.parameters;l[f]=(...y)=>{let h={};for(let[x,S]of w.entries()){let A=typeof S==="string"?S:S?.name??"";if(!A)continue;h[A]=y[x]===void 0&&typeof S==="object"&&S!==null&&"default"in S?S.default:y[x]}return Ye(m,l,null,{args:h,target:o})}}else{let w=(y,h)=>{Ye(m,y,h??null,{target:o})};l[f]=w}}else if(ft(d))l[f]=await Kl(d,l,f,n);for(let[f,d]of Object.entries(i))if(Wn(d))l[f]=await nc(d,l,f,n,r);if(!(r?.skipServerFunctions??Ds.skip)){for(let[f,d]of Object.entries(i))if(Bn(d))l[f]=await ac(d,l,f,n)}let u=r?.media??ii;if(e.$media)l.$media=e.$media;else if(!l.$media&&Object.keys(u).length>0)l.$media=u;return l}function Fl(e){for(let t of Object.keys(e))if(Pl.has(t))return!0;return!1}function ke(e,t){let n=t?.$map;return Function("state","$map","item","index",`return \`${e}\``)(t,n,n?.item,n?.index)}function Wl(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let n=1;n<e.length;n+=1){let r=e[n];if(r==="{")t+=1;else if(r==="}"){if(t-=1,t===0)return n===e.length-1}}return!1}function Bl(e,t){if(!Wl(e))return ke(e,t);let n=t?.$map;return Function("state","$map","item","index",`return (${e.slice(2,-1)})`)(t,n,n?.item,n?.index)}var et=new Map,Xe=new Map,Ys=new Set;function Xs(e,t){if(Ys.add(e),typeof t==="function"){et.delete(e),Xe.set(e,t);return}Xe.delete(e),et.set(e,t)}function Pr(e){let t=et.get(e);if(t)return t;let n=Xe.get(e);if(!n)return;if(typeof n!=="function")return n;let r=Promise.resolve(n()).then((o)=>(et.set(e,o),Xe.delete(e),o),(o)=>{throw Xe.set(e,n),o});return Xe.set(e,r),r}async function Kl(e,t,n,r){if(e.body&&e.$src)throw Error(`Jx: '${n}' declares both body and $src — these are mutually exclusive`);if(!e.body&&!e.$src){let a=Er(e),c=Function(...a,"");return Object.defineProperty(c,"name",{configurable:!0,value:e.name??n}),c}let o;if(typeof e.body==="string"){let a=Er(e);o=Function(...a,e.body),Object.defineProperty(o,"name",{configurable:!0,value:e.name??n})}else{let a=e.$src;if(!a)throw Error(`Jx: '${n}' has neither body nor $src`);let c=e.$export??n,l,u=Pr(a);if(u instanceof Promise)l=await u;else if(u)l=u;else{if(r){let d=new URL(a,r).href;try{l=await import(d)}catch{l=await import(a)}}else l=await import(a);et.set(a,l)}let f=l[c]??l.default?.[c];if(typeof f!=="function")throw TypeError(`Jx: export "${c}" not found or not a function in "${a}"`);o=f}let s=(e.parameters??e.arguments??[]).length>0,i=!1;if(!s){if(typeof e.body==="string")i=Kn(e.body);else if(o)i=o.length<=1&&Kn(o.toString())}if(i)return bt(()=>o(t));return o}function Er(e){let t=e.parameters?Ro(e.parameters):e.arguments??[];return t.length>0&&t[0]==="state"?t:["state",...t]}var Pt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),ks=new Set,Vl="http://www.w3.org/2000/svg",Ul="http://www.w3.org/1998/Math/MathML";function ql(e,t){if(e==="svg")return Vl;if(e==="math")return Ul;return t??null}function de(e,t,n){let r=n?._path??[];if(typeof e==="string"||typeof e==="number"||typeof e==="boolean"){let f=document.createTextNode(String(e));if(typeof e==="string"&&le(e))G(()=>{f.textContent=ke(e,t)});return f}let o=t;for(let[f,d]of Object.entries(e))if(f.startsWith("$")&&!Pt.has(f)){if(o===t)o=Object.create(t);o[f]=U(d)?Y(d.$ref,t):d}if("$ref"in e&&!e.tagName){let f=String(e.$ref??"");if(!ks.has(f))ks.add(f),console.warn(`Jx: a $ref child ("${f}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let s=Nr(e.tagName,o),i=s.includes("-")&&customElements.get(s);if(e.$props&&i)return Os(e,o,n,r);if(e.$props){if(s.includes("-"))return Os(e,o,n,r);let{$props:f,...d}=e;return de(d,dc(e,o),n)}if(e.$switch)return tc(e,o,n);let a=ql(s,n?._ns),c=s==="foreignObject"?null:a,l=a?document.createElementNS(a,s):document.createElement(s);if(n?.onNodeCreated)n.onNodeCreated(l,r,e,o);if(Rr(l,e,o),e.style&&s.includes("-"))$r.set(l,e.style);wn(l,e.style??{},o.$media??{},o),vn(l,e.attributes??{},o);let u=e.children;if(Kt(u)){let f=n||c?{...n,_ns:c,_path:[...r,"children"]}:void 0;vr(l,u,o,f)}else if(Array.isArray(u))for(let f=0;f<u.length;f++){let d=u[f],m=n||c?{...n,_ns:c,_path:[...r,"children",f]}:void 0;if(Kt(d))vr(l,d,o,m);else l.append(de(d,o,m))}return l}function Rr(e,t,n){for(let[r,o]of Object.entries(t)){if(Pt.has(r))continue;if(r.startsWith("$"))continue;if(r.startsWith("on")&&Zs(e,r,o,n))continue;Qs(e,r,o,n)}}function Zs(e,t,n,r){let o=t.slice(2),s=r;if(U(n)){let i=Y(n.$ref,r);if(typeof i==="function"){let a=i;e.addEventListener(o,(c)=>a(s,c))}return!0}if(Fn(n)){let{body:i}=n;return e.addEventListener(o,(a)=>{Ye(i,s,a)}),!0}if(ft(n)&&typeof n.body==="string"){let i=Er(n),a=Function(...i,n.body);return e.addEventListener(o,(c)=>a(s,c)),!0}if(Ke(n)){let i=n.$expression;return e.addEventListener(o,(a)=>ee(i,s,a)),!0}return!1}function zl(e,t,n){for(let[r,o]of Object.entries(t))if(r.startsWith("on")&&!Pt.has(r))Zs(e,r,o,n)}function Qs(e,t,n,r){let o=e,s=Hl(t,n,r);if(s)e.dataset.jxBoundProp=s;let i=(c)=>typeof c==="string"?Cr(e.tagName,t,c):c,a=(c)=>{let l=e;if(t==="className"&&!(l instanceof HTMLElement)){l.setAttribute("class",c==null?"":String(c));return}if(o[t]===c)return;o[t]=c};if(U(n)){let c=n;if(t==="id"){o[t]=Y(c.$ref,r);return}G(()=>{a(i(Y(c.$ref,r)))});return}if(le(n)){G(()=>{a(i(ke(n,r)))});return}a(i(n))}function Ts(e,t){let n=[];return{detach:t,insert(r){let o=[];for(let i of r){let a=e.cssRules.length;try{e.insertRule(i,a)}catch{continue}let c=e.cssRules[a];if(c)o.push(c)}let s={rules:o,texts:r};return n.push(s),s},remove(r){let o=n.indexOf(r);if(o!==-1)n.splice(o,1);if(r.rules.length===0)return;let s=[...e.cssRules],i=r.rules.map((a)=>s.indexOf(a)).filter((a)=>a>=0).toSorted((a,c)=>c-a);for(let a of i)e.deleteRule(a);r.rules.length=0},replaceAll(r){n.length=0,n.push({rules:[],texts:r}),e.replaceSync(r.join(`
3
3
  `))},text(){return n.flatMap((r)=>r.texts.join(`
4
4
  `)).join(`
5
- `)}}}function zl(e){let t=[],n=()=>{e.textContent=t.map((r)=>r.texts.join(`
5
+ `)}}}function Gl(e){let t=[],n=()=>{e.textContent=t.map((r)=>r.texts.join(`
6
6
  `)).join(`
7
- `)};return{detach(){e.remove()},insert(r){let o={rules:[],texts:r};return t.push(o),n(),o},remove(r){let o=t.indexOf(r);if(o!==-1)t.splice(o,1),n()},replaceAll(r){t.length=0,t.push({rules:[],texts:r}),n()},text(){return e.textContent??""}}}function ei(e){let n=e.defaultView?.CSSStyleSheet;if(typeof n==="function"&&Array.isArray(e.adoptedStyleSheets))try{let o=new n;return e.adoptedStyleSheets=[...e.adoptedStyleSheets,o],Ts(o,()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((s)=>s!==o)})}catch{}let r=e.createElement("style");return r.dataset.jxSheet="",(e.head??e.documentElement).append(r),r.sheet?Ts(r.sheet,()=>r.remove()):zl(r)}var Ct=new WeakMap;function Gl(e){let t=Ct.get(e);if(t)return t;let n={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:ei(e)};return Ct.set(e,n),n}var dn=new WeakMap,As="\x01jx-scope\x01";function ti(e){e.scratch.replaceAll([...e.scratchOwners.values()].flat())}function Cs(e,t,n){let r=t.get(n);if(r.refs-=1,r.refs<=0)t.delete(n),e.shared.remove(r.inserted)}function Ps(e,t,n,r){let o=t.get(n);if(o){o.refs+=1;return}t.set(n,{inserted:e.shared.insert(r),refs:1})}function pn(e,t){let n=dn.get(e);if(!n||t!==void 0&&n!==t)return;dn.delete(e),n.stop?.();for(let o of n.vars)e.style.removeProperty(o);if(delete e.dataset.jx,Ct.get(n.doc)!==n.state)return;let{state:r}=n;if(n.interned===null){if(r.scratchOwners.delete(e))ti(r)}else Cs(r,r.interned,n.interned);for(let o of n.hoisted)Cs(r,r.hoisted,o)}function ni(e=document){let t=Ct.get(e);if(!t)return;Ct.delete(e);for(let n of t.scratchOwners.keys())dn.delete(n),delete n.dataset.jx;t.scratchOwners.clear(),t.interned.clear(),t.hoisted.clear(),t.shared.detach(),t.scratch?.detach()}function Yl(e){return Boolean(e)&&typeof e==="object"&&"display"in e}var Rr=new WeakMap;function ri(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t)){let s=n[r];n[r]=s!==null&&typeof s==="object"&&o!==null&&typeof o==="object"&&!Array.isArray(o)?ri(s,o):o}return n}function bn(e,t,n={},r={}){oi(e,t,n,r,!1)}function wn(e,t,n={},r={}){oi(e,t??{},n,r,!0)}function oi(e,t,n,r,o){pn(e);let s=e.ownerDocument??document,i=Gl(s),a=(kr||Tr)&&br(e)?(y)=>cr(y,{dialog:e.tagName==="DIALOG"}):(y)=>y,c=-1,l=0,u=[],f=kt(t,{mediaQueries:n,resolveValue:(y,S,A)=>{if(A==="self"&&y.startsWith("--"))return u.push({name:y,value:S}),null;if(c<0)({serial:c}=i),i.serial+=1;let C=`--jx-r${c}-${l}`;return l+=1,u.push({name:C,value:S}),`var(${C})`},scope:As,transposeSelector:a,transposeValue:fn});if(f.length===0&&u.length===0)return;let d=f.filter((y)=>y.target!=="unscoped"),m=f.filter((y)=>y.target==="unscoped");for(let y of m)Ps(i,i.hoisted,y.text,[y.text]);let w=`jx-${Et(d.map((y)=>y.key).join("|"))}`,b=d.map((y)=>y.text.replaceAll(As,`[data-jx="${w}"]`));if(b.length>0)if(e.dataset.jx=w,o)i.scratch??=ei(s),i.scratchOwners.set(e,b),ti(i);else Ps(i,i.interned,w,b);let g={doc:s,hoisted:m.map((y)=>y.text),interned:b.length>0&&!o?w:null,state:i,stop:null,uid:w,vars:u.map((y)=>y.name)};if(u.length>0){let y=Ge();y.run(()=>{for(let{name:S,value:A}of u)z(()=>{let C=V(A)?G(A.$ref,r):ve(A,r);e.style.setProperty(S,fn(String(C??"")))})}),g.stop=()=>y.stop()}dn.set(e,g),Zt(()=>pn(e,g),!0)}var Xl=new Set(["contenteditable","draggable","spellcheck"]);function Zl(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Xl.has(n))return String(t);return t?"":null}function En(e,t,n){for(let[r,o]of Object.entries(t)){let s=Nl(e,r),i=(a)=>{if(a===null||a===void 0){e.removeAttribute(s);return}if(typeof a==="boolean"){let c=Zl(s,a);if(c===null)e.removeAttribute(s);else e.setAttribute(s,c);return}e.setAttribute(s,Ar(e.tagName,r,String(a)))};if(V(o))z(()=>i(G(o.$ref,n)));else if(ie(o))z(()=>i(Wl(o,n)));else i(o)}}function Er(e,t,n,r){let o=r?._path??[],s=document.createComment("jx-array");e.append(s);let{items:i,map:a,filter:c,sort:l,key:u}=t,f=V(u)?u.$ref:null,d=Qe,m=!1,w=(v)=>{if(!m)m=!0,console.warn(`Jx $map: ${v}`)},b=[],g=(v)=>{v.scope.stop(),v.node.remove()},y=(v,P,E)=>{let O=Yo({index:E,item:P}),M=Object.create(n);M.$map=O,Object.defineProperty(M,"$map/item",{enumerable:!0,get:()=>O.item}),Object.defineProperty(M,"$map/index",{enumerable:!0,get:()=>O.index});let h=Ge(!0),k=r?{...r,_path:[...o,"map",E]}:void 0,R=h.run(()=>ue(a,M,k));return{key:v,map:O,node:R,scope:h}},S=(v,P)=>{let E=new Map;for(let h of b)E.set(h.key,h);let O=[];for(let h=0;h<v.length;h++){let k=P[h],R=v[h],N=E.get(k);if(N){if(E.delete(k),N.map.item!==R)N.map.item=R;if(N.map.index!==h)N.map.index=h,r?.onNodeMoved?.(N.node,[...o,"map",h]);O.push(N)}else O.push(y(k,R,h))}for(let h of E.values())g(h);let M=b.find((h)=>!E.has(h.key))?.node??s;for(let h of O){if(h.node===M){M=M.nextSibling??s;continue}M.before(h.node)}b=O},A=()=>{let v=V(i)?G(i.$ref,n):i;if(Array.isArray(v)&&V(c)){let M=G(c.$ref,n);if(typeof M==="function")v=v.filter(M)}if(Array.isArray(v)&&V(l)){let M=G(l.$ref,n);if(typeof M==="function")v=[...v].toSorted(M)}let P=Array.isArray(v)&&a?v:[],E=P.map((M,h)=>Ql(f,M,h,w)),O=new Set;for(let M=0;M<E.length;M++)if(O.has(E[M]))w(`duplicate key ${String(E[M])} — every occurrence after the first is rebuilt on each change`),E[M]={duplicate:M};else O.add(E[M]);Qt();try{hn(vr(d),()=>S(P,E))}finally{en()}},C=!1,T=!1,x=z(A,{scheduler:()=>{if(C)return;C=!0,queueMicrotask(()=>{if(C=!1,!T)x()})}});Zt(()=>{T=!0;for(let v of b)g(v);b=[]},!0)}function Ql(e,t,n,r){if(e===null)return n;if(e==="$map/item")return t;if(e.startsWith("$map/item/")){let o=ce(t,e.slice(10));if(o===void 0||o===null)return r(`key "${e}" is empty for some items — those rows fall back to their index`),n;return o}return r(`key "${e}" is not a $map/item pointer — rows fall back to their index`),n}function $r(e,t){if(typeof e==="string")return e;if(!Kn(e))return"div";let n=e.$expression;if(n.operator==="?:")return Le(n.target,t,null)?n.value:n.initial;let r=Le(n.target,t,null);return n.cases[String(r)]??n.default}function ec(e,t,n){let r=n?._path??[],o=document.createElement($r(e.tagName,t)),s=Qe;if(n?.onNodeCreated)n.onNodeCreated(o,r,e,t);Pr(o,e,t),bn(o,e.style??{},t.$media??{},t),En(o,e.attributes??{},t);let i=0,a=null,c=null,l=()=>{a?.stop(),a=null};return z(()=>{if(!V(e.$switch)){l(),o.replaceChildren(),i+=1;return}let u=String(G(e.$switch.$ref,t));if(u===c)return;c=u,l(),o.replaceChildren(),i+=1;let f=e.cases?.[u];if(!f)return;let d=i,m=Ge(!0);a=m;let w=n?{...n,_path:[...r,"cases",u]}:void 0;if(V(f)){let{href:b}=new URL(f.$ref,n?._ctx?.base??location.href);Sr(b,n?._ctx).then(async(g)=>{if(d!==i)return;let y=await yn(g,{},b,n?._ctx);if(d!==i)return;o.replaceChildren(),hn(vr(s),()=>m.run(()=>o.append(ue(g,y,w))))}).catch((g)=>console.error("Jx $switch: failed to load external case",f.$ref,g));return}Qt();try{hn(vr(s),()=>m.run(()=>o.append(ue(f,t,w))))}finally{en()}}),Zt(l,!0),o}async function tc(e,t,n,r,o){if(e.$src)return nc(e,t,n,r);switch(e.$prototype){case"Request":{let s=le(null),i=e.debounce??0,a=null;if(!e.manual&&!(o?.skipAutoRequests??Js.skip))z(()=>{let c;if(ie(e.url))c=ve(e.url,t);else({url:c}=e);if(!c||c==="undefined"||c.includes("undefined"))return;let l=new AbortController;tn(()=>{if(l.abort(),a!==null)clearTimeout(a)});let u=()=>fetch(c,{method:e.method??"GET",signal:l.signal,...e.headers&&{headers:e.headers},...e.body&&{body:typeof e.body==="object"?JSON.stringify(e.body):e.body}}).then((f)=>f.ok?f.json():Promise.reject(f.statusText)).then((f)=>{s.value=f}).catch((f)=>{if(!(f instanceof Error&&f.name==="AbortError"))s.value={error:String(f)}});if(i>0)a=setTimeout(u,i);else u()});return s}case"URLSearchParams":return bt(()=>{let s={};for(let[i,a]of Object.entries(e))if(i!=="$prototype")s[i]=V(a)?G(a.$ref,t):ie(a)?ve(a,t):a;return new URLSearchParams(s).toString()});case"LocalStorage":case"SessionStorage":{let s=e.$prototype==="LocalStorage"?localStorage:sessionStorage,i=e.key??n,a;try{let l=s.getItem(i);a=l!==null?JSON.parse(l):e.default??null}catch{a=e.default??null}let c=le(a);return z(()=>{let l=c.value;if(l===null)try{s.removeItem(i)}catch{}else try{s.setItem(i,JSON.stringify(l))}catch{}}),c}case"Cookie":{let s=e.name??n,a=le((()=>{let c=vs(document.cookie,s);if(c===null)return null;try{return JSON.parse(decodeURIComponent(c))}catch{return c}})()??e.default??null);return z(()=>{document.cookie=Ss(s,a.value,e)}),a}case"IndexedDB":{let s=le(null),{database:i,store:a,version:c=1,keyPath:l="id",autoIncrement:u=!0,indexes:f=[]}=e;if(!i||!a)throw Error(`Jx: IndexedDB entry '${n}' requires database and store`);let d=indexedDB.open(i,c);return d.addEventListener("upgradeneeded",(m)=>{let w=m.target.result;if(!w.objectStoreNames.contains(a)){let b=w.createObjectStore(a,{autoIncrement:u,keyPath:l});for(let g of f)b.createIndex(g.name,g.keyPath,{unique:g.unique??!1})}}),d.addEventListener("success",(m)=>{let w=m.target.result;s.value={database:i,getStore:(b="readwrite")=>Promise.resolve(w.transaction(a,b).objectStore(a)),isReady:!0,store:a,version:c}}),d.addEventListener("error",()=>{s.value={error:d.error?.message}}),s}case"Set":return new Set(Array.isArray(e.default)?e.default:[]);case"Map":return new Map(Object.entries(re(e.default)?e.default:{}));case"FormData":{let s=new FormData;for(let[i,a]of Object.entries(e.fields??{}))s.append(i,a);return s}case"Blob":return new Blob(e.parts??[],{type:typeof e.type==="string"?e.type:"text/plain"});case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${e.$prototype}" for "${n}". Did you mean to add '$src'?`),le(null)}}var Nr=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);async function nc(e,t,n,r){let o=e.$src;if(!o||!o.endsWith(".class.json"))throw Error(`Jx: $prototype "${e.$prototype}" requires a .class.json $src, got "${o}". Wrap the class in a .class.json schema with $implementation.`);return oc(e,t,n,r)}async function rc(e,t,n,r){let o,s=Cr(t);if(s instanceof Promise)o=await s;else if(s)o=s;else{try{o=await import(t)}catch{if(r)o=await import(new URL(t,r).href);else throw Error(`Failed to import "${t}"`)}Ie.set(t,o)}let i=o[n]??o.default?.[n];if(!i)throw Error(`Jx: export "${n}" not found in "${t}"`);if(typeof i!=="function")throw TypeError(`Jx: "${n}" from "${t}" is not a class`);let a={};for(let[d,m]of Object.entries(e))if(!Nr.has(d))a[d]=m;let l=new i(a),u;if(typeof l.resolve==="function")u=await l.resolve();else if("value"in l)({value:u}=l);else u=l;let f=le(u);if(typeof l.subscribe==="function")l.subscribe((d)=>{f.value=d});return f}async function oc(e,t,n,r){let o=e.$src,s;if(!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("http")&&!o.startsWith("file:"))return cn(e,t,n,r);try{let d=r?new URL(o,r).href:o,m=await fetch(d);if(!m.ok)throw Error(`HTTP ${m.status}`);s=await m.json()}catch{return cn(e,t,n,r)}if(s.$implementation){if(JSON.stringify(s).includes('"#/$context/'))return cn(e,t,n,r);let m=r?new URL(o,r).href:new URL(o,location.href).href,w=new URL(s.$implementation,m).href,b=e.$export??s.title??e.$prototype;try{return await rc(e,w,b,r)}catch{return cn(e,t,n,r)}}let a=sc(s),c={};for(let[d,m]of Object.entries(e))if(!Nr.has(d))c[d]=m;let l=new a(c),u;if(typeof l.resolve==="function")u=await l.resolve();else if("value"in l)({value:u}=l);else u=l;let f=le(u);if(typeof l.subscribe==="function")l.subscribe((d)=>{f.value=d});return f}function sc(e){let t=e.$defs?.fields??{},n=e.$defs?.constructor,r=typeof n==="object"?n:void 0,o=e.$defs?.methods??{};class s{constructor(a={}){for(let[c,l]of Object.entries(t)){let u=l.identifier??c,f=l.access==="private"?`_${u}`:u;if(a[u]!==void 0)this[f]=a[u];else if(l.initializer!==void 0)this[f]=l.initializer;else if(l.default!==void 0)this[f]=structuredClone(l.default);else this[f]=null}if(r?.body){let c=Array.isArray(r.body)?r.body.join(`
7
+ `)};return{detach(){e.remove()},insert(r){let o={rules:[],texts:r};return t.push(o),n(),o},remove(r){let o=t.indexOf(r);if(o!==-1)t.splice(o,1),n()},replaceAll(r){t.length=0,t.push({rules:[],texts:r}),n()},text(){return e.textContent??""}}}function ei(e){let n=e.defaultView?.CSSStyleSheet;if(typeof n==="function"&&Array.isArray(e.adoptedStyleSheets))try{let o=new n;return e.adoptedStyleSheets=[...e.adoptedStyleSheets,o],Ts(o,()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((s)=>s!==o)})}catch{}let r=e.createElement("style");return r.dataset.jxSheet="",(e.head??e.documentElement).append(r),r.sheet?Ts(r.sheet,()=>r.remove()):Gl(r)}var Ct=new WeakMap;function Yl(e){let t=Ct.get(e);if(t)return t;let n={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:ei(e)};return Ct.set(e,n),n}var pn=new WeakMap,As="\x01jx-scope\x01";function ti(e){e.scratch.replaceAll([...e.scratchOwners.values()].flat())}function Cs(e,t,n){let r=t.get(n);if(r.refs-=1,r.refs<=0)t.delete(n),e.shared.remove(r.inserted)}function Ps(e,t,n,r){let o=t.get(n);if(o){o.refs+=1;return}t.set(n,{inserted:e.shared.insert(r),refs:1})}function mn(e,t){let n=pn.get(e);if(!n||t!==void 0&&n!==t)return;pn.delete(e),n.stop?.();for(let o of n.vars)e.style.removeProperty(o);if(delete e.dataset.jx,Ct.get(n.doc)!==n.state)return;let{state:r}=n;if(n.interned===null){if(r.scratchOwners.delete(e))ti(r)}else Cs(r,r.interned,n.interned);for(let o of n.hoisted)Cs(r,r.hoisted,o)}function ni(e=document){let t=Ct.get(e);if(!t)return;Ct.delete(e);for(let n of t.scratchOwners.keys())pn.delete(n),delete n.dataset.jx;t.scratchOwners.clear(),t.interned.clear(),t.hoisted.clear(),t.shared.detach(),t.scratch?.detach()}function Xl(e){return Boolean(e)&&typeof e==="object"&&"display"in e}var $r=new WeakMap;function ri(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t)){let s=n[r];n[r]=s!==null&&typeof s==="object"&&o!==null&&typeof o==="object"&&!Array.isArray(o)?ri(s,o):o}return n}function wn(e,t,n={},r={}){oi(e,t,n,r,!1)}function En(e,t,n={},r={}){oi(e,t??{},n,r,!0)}function oi(e,t,n,r,o){mn(e);let s=e.ownerDocument??document,i=Yl(s),a=(Tr||Ar)&&wr(e)?(x)=>ur(x,{dialog:e.tagName==="DIALOG"}):(x)=>x,c=-1,l=0,u=[],f=kt(t,{mediaQueries:n,resolveValue:(x,S,A)=>{if(A==="self"&&x.startsWith("--"))return u.push({name:x,value:S}),null;if(c<0)({serial:c}=i),i.serial+=1;let C=`--jx-r${c}-${l}`;return l+=1,u.push({name:C,value:S}),`var(${C})`},scope:As,transposeSelector:a,transposeValue:dn});if(f.length===0&&u.length===0)return;let d=f.filter((x)=>x.target!=="unscoped"),m=f.filter((x)=>x.target==="unscoped");for(let x of m)Ps(i,i.hoisted,x.text,[x.text]);let w=`jx-${Et(d.map((x)=>x.key).join("|"))}`,y=d.map((x)=>x.text.replaceAll(As,`[data-jx="${w}"]`));if(y.length>0)if(e.dataset.jx=w,o)i.scratch??=ei(s),i.scratchOwners.set(e,y),ti(i);else Ps(i,i.interned,w,y);let h={doc:s,hoisted:m.map((x)=>x.text),interned:y.length>0&&!o?w:null,state:i,stop:null,uid:w,vars:u.map((x)=>x.name)};if(u.length>0){let x=Ge();x.run(()=>{for(let{name:S,value:A}of u)G(()=>{let C=U(A)?Y(A.$ref,r):ke(A,r);e.style.setProperty(S,dn(String(C??"")))})}),h.stop=()=>x.stop()}pn.set(e,h),Qt(()=>mn(e,h),!0)}var Zl=new Set(["contenteditable","draggable","spellcheck"]);function Ql(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Zl.has(n))return String(t);return t?"":null}function vn(e,t,n){for(let[r,o]of Object.entries(t)){let s=Ml(e,r),i=(a)=>{if(a===null||a===void 0){e.removeAttribute(s);return}if(typeof a==="boolean"){let c=Ql(s,a);if(c===null)e.removeAttribute(s);else e.setAttribute(s,c);return}e.setAttribute(s,Cr(e.tagName,r,String(a)))};if(U(o))G(()=>i(Y(o.$ref,n)));else if(le(o))G(()=>i(Bl(o,n)));else i(o)}}function vr(e,t,n,r){let o=r?._path??[],s=document.createComment("jx-array");e.append(s);let{items:i,map:a,filter:c,sort:l,key:u}=t,f=U(u)?u.$ref:null,d=Qe,m=!1,w=(v)=>{if(!m)m=!0,console.warn(`Jx $map: ${v}`)},y=[],h=(v)=>{v.scope.stop(),v.node.remove()},x=(v,P,E)=>{let _=Yo({index:E,item:P}),R=Object.create(n);R.$map=_,Object.defineProperty(R,"$map/item",{enumerable:!0,get:()=>_.item}),Object.defineProperty(R,"$map/index",{enumerable:!0,get:()=>_.index});let I=Ge(!0),te=r?{...r,_path:[...o,"map",E]}:void 0,b=I.run(()=>de(a,R,te));return{key:v,map:_,node:b,scope:I}},S=(v,P)=>{let E=new Map;for(let I of y)E.set(I.key,I);let _=[];for(let I=0;I<v.length;I++){let te=P[I],b=v[I],k=E.get(te);if(k){if(E.delete(te),k.map.item!==b)k.map.item=b;if(k.map.index!==I)k.map.index=I,r?.onNodeMoved?.(k.node,[...o,"map",I]);_.push(k)}else _.push(x(te,b,I))}for(let I of E.values())h(I);let R=y.find((I)=>!E.has(I.key))?.node??s;for(let I of _){if(I.node===R){R=R.nextSibling??s;continue}R.before(I.node)}y=_},A=()=>{let v=U(i)?Y(i.$ref,n):i;if(Array.isArray(v)&&U(c)){let R=Y(c.$ref,n);if(typeof R==="function")v=v.filter(R)}if(Array.isArray(v)&&U(l)){let R=Y(l.$ref,n);if(typeof R==="function")v=[...v].toSorted(R)}let P=Array.isArray(v)&&a?v:[],E=P.map((R,I)=>ec(f,R,I,w)),_=new Set;for(let R=0;R<E.length;R++)if(_.has(E[R]))w(`duplicate key ${String(E[R])} — every occurrence after the first is rebuilt on each change`),E[R]={duplicate:R};else _.add(E[R]);en();try{gn(Sr(d),()=>S(P,E))}finally{tn()}},C=!1,T=!1,g=G(A,{scheduler:()=>{if(C)return;C=!0,queueMicrotask(()=>{if(C=!1,!T)g()})}});Qt(()=>{T=!0;for(let v of y)h(v);y=[]},!0)}function ec(e,t,n,r){if(e===null)return n;if(e==="$map/item")return t;if(e.startsWith("$map/item/")){let o=fe(t,e.slice(10));if(o===void 0||o===null)return r(`key "${e}" is empty for some items — those rows fall back to their index`),n;return o}return r(`key "${e}" is not a $map/item pointer — rows fall back to their index`),n}function Nr(e,t){if(typeof e==="string")return e;if(!Vn(e))return"div";let n=e.$expression;if(n.operator==="?:")return Je(n.target,t,null)?n.value:n.initial;let r=Je(n.target,t,null);return n.cases[String(r)]??n.default}function tc(e,t,n){let r=n?._path??[],o=document.createElement(Nr(e.tagName,t)),s=Qe;if(n?.onNodeCreated)n.onNodeCreated(o,r,e,t);Rr(o,e,t),wn(o,e.style??{},t.$media??{},t),vn(o,e.attributes??{},t);let i=0,a=null,c=null,l=()=>{a?.stop(),a=null};return G(()=>{if(!U(e.$switch)){l(),o.replaceChildren(),i+=1;return}let u=String(Y(e.$switch.$ref,t));if(u===c)return;c=u,l(),o.replaceChildren(),i+=1;let f=e.cases?.[u];if(!f)return;let d=i,m=Ge(!0);a=m;let w=n?{...n,_path:[...r,"cases",u]}:void 0;if(U(f)){let{href:y}=new URL(f.$ref,n?._ctx?.base??location.href);kr(y,n?._ctx).then(async(h)=>{if(d!==i)return;let x=await bn(h,{},y,n?._ctx);if(d!==i)return;o.replaceChildren(),gn(Sr(s),()=>m.run(()=>o.append(de(h,x,w))))}).catch((h)=>console.error("Jx $switch: failed to load external case",f.$ref,h));return}en();try{gn(Sr(s),()=>m.run(()=>o.append(de(f,t,w))))}finally{tn()}}),Qt(l,!0),o}async function nc(e,t,n,r,o){if(e.$src)return rc(e,t,n,r);switch(e.$prototype){case"Request":{let s=ue(null),i=e.debounce??0,a=null;if(!e.manual&&!(o?.skipAutoRequests??Is.skip))G(()=>{let c;if(le(e.url))c=ke(e.url,t);else({url:c}=e);if(!c||c==="undefined"||c.includes("undefined"))return;let l=new AbortController;nn(()=>{if(l.abort(),a!==null)clearTimeout(a)});let u=()=>fetch(c,{method:e.method??"GET",signal:l.signal,...e.headers&&{headers:e.headers},...e.body&&{body:typeof e.body==="object"?JSON.stringify(e.body):e.body}}).then((f)=>f.ok?f.json():Promise.reject(f.statusText)).then((f)=>{s.value=f}).catch((f)=>{if(!(f instanceof Error&&f.name==="AbortError"))s.value={error:String(f)}});if(i>0)a=setTimeout(u,i);else u()});return s}case"URLSearchParams":return bt(()=>{let s={};for(let[i,a]of Object.entries(e))if(i!=="$prototype")s[i]=U(a)?Y(a.$ref,t):le(a)?ke(a,t):a;return new URLSearchParams(s).toString()});case"LocalStorage":case"SessionStorage":{let s=e.$prototype==="LocalStorage"?localStorage:sessionStorage,i=e.key??n,a;try{let l=s.getItem(i);a=l!==null?JSON.parse(l):e.default??null}catch{a=e.default??null}let c=ue(a);return G(()=>{let l=c.value;if(l===null)try{s.removeItem(i)}catch{}else try{s.setItem(i,JSON.stringify(l))}catch{}}),c}case"Cookie":{let s=e.name??n,a=ue((()=>{let c=vs(document.cookie,s);if(c===null)return null;try{return JSON.parse(decodeURIComponent(c))}catch{return c}})()??e.default??null);return G(()=>{document.cookie=Ss(s,a.value,e)}),a}case"IndexedDB":{let s=ue(null),{database:i,store:a,version:c=1,keyPath:l="id",autoIncrement:u=!0,indexes:f=[]}=e;if(!i||!a)throw Error(`Jx: IndexedDB entry '${n}' requires database and store`);let d=indexedDB.open(i,c);return d.addEventListener("upgradeneeded",(m)=>{let w=m.target.result;if(!w.objectStoreNames.contains(a)){let y=w.createObjectStore(a,{autoIncrement:u,keyPath:l});for(let h of f)y.createIndex(h.name,h.keyPath,{unique:h.unique??!1})}}),d.addEventListener("success",(m)=>{let w=m.target.result;s.value={database:i,getStore:(y="readwrite")=>Promise.resolve(w.transaction(a,y).objectStore(a)),isReady:!0,store:a,version:c}}),d.addEventListener("error",()=>{s.value={error:d.error?.message}}),s}case"Set":return new Set(Array.isArray(e.default)?e.default:[]);case"Map":return new Map(Object.entries(se(e.default)?e.default:{}));case"FormData":{let s=new FormData;for(let[i,a]of Object.entries(e.fields??{}))s.append(i,a);return s}case"Blob":return new Blob(e.parts??[],{type:typeof e.type==="string"?e.type:"text/plain"});case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${e.$prototype}" for "${n}". Did you mean to add '$src'?`),ue(null)}}var Mr=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);async function rc(e,t,n,r){let o=e.$src;if(!o||!o.endsWith(".class.json"))throw Error(`Jx: $prototype "${e.$prototype}" requires a .class.json $src, got "${o}". Wrap the class in a .class.json schema with $implementation.`);return sc(e,t,n,r)}async function oc(e,t,n,r){let o,s=Pr(t);if(s instanceof Promise)o=await s;else if(s)o=s;else{try{o=await import(t)}catch{if(r)o=await import(new URL(t,r).href);else throw Error(`Failed to import "${t}"`)}et.set(t,o)}let i=o[n]??o.default?.[n];if(!i)throw Error(`Jx: export "${n}" not found in "${t}"`);if(typeof i!=="function")throw TypeError(`Jx: "${n}" from "${t}" is not a class`);let a={};for(let[d,m]of Object.entries(e))if(!Mr.has(d))a[d]=m;let l=new i(a),u;if(typeof l.resolve==="function")u=await l.resolve();else if("value"in l)({value:u}=l);else u=l;let f=ue(u);if(typeof l.subscribe==="function")l.subscribe((d)=>{f.value=d});return f}async function sc(e,t,n,r){let o=e.$src,s;if(!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("http")&&!o.startsWith("file:"))return un(e,t,n,r);try{let d=r?new URL(o,r).href:o,m=await fetch(d);if(!m.ok)throw Error(`HTTP ${m.status}`);s=await m.json()}catch{return un(e,t,n,r)}if(s.$implementation){if(JSON.stringify(s).includes('"#/$context/'))return un(e,t,n,r);let m=r?new URL(o,r).href:new URL(o,location.href).href,w=new URL(s.$implementation,m).href,y=e.$export??s.title??e.$prototype;try{return await oc(e,w,y,r)}catch{return un(e,t,n,r)}}let a=ic(s),c={};for(let[d,m]of Object.entries(e))if(!Mr.has(d))c[d]=m;let l=new a(c),u;if(typeof l.resolve==="function")u=await l.resolve();else if("value"in l)({value:u}=l);else u=l;let f=ue(u);if(typeof l.subscribe==="function")l.subscribe((d)=>{f.value=d});return f}function ic(e){let t=e.$defs?.fields??{},n=e.$defs?.constructor,r=typeof n==="object"?n:void 0,o=e.$defs?.methods??{};class s{constructor(a={}){for(let[c,l]of Object.entries(t)){let u=l.identifier??c,f=l.access==="private"?`_${u}`:u;if(a[u]!==void 0)this[f]=a[u];else if(l.initializer!==void 0)this[f]=l.initializer;else if(l.default!==void 0)this[f]=structuredClone(l.default);else this[f]=null}if(r?.body){let c=Array.isArray(r.body)?r.body.join(`
8
8
  `):r.body;Function("config",c).call(this,a)}}}for(let[a,c]of Object.entries(o)){let l=c.identifier??a,u=(c.parameters??[]).map((d)=>{if(d.$ref)return d.$ref.split("/").pop();let m=d.identifier??d.name;return typeof m==="string"?m:"arg"}),f=Array.isArray(c.body)?c.body.join(`
9
- `):c.body??"";if(c.role==="accessor"){let d={};if(c.getter)d.get=Function(c.getter.body??"");if(c.setter){let m=(c.setter.parameters??[]).map((w)=>w.$ref?.split("/").pop()??"v");d.set=Function(...m,c.setter.body??"")}Object.defineProperty(s.prototype,l,{...d,configurable:!0})}else if(c.scope==="static")s[l]=Function(...u,f);else s.prototype[l]=Function(...u,f)}return Object.defineProperty(s,"name",{configurable:!0,value:e.title}),s}async function cn(e,t,n,r){let o={};for(let[c,l]of Object.entries(e))if(!Nr.has(c))o[c]=l;let s=Object.values(o).some((c)=>ie(c)),i=(c)=>fetch(Fs("/__jx_resolve__"),{body:JSON.stringify({$base:r,$export:e.$export,$prototype:e.$prototype,$src:e.$src,...c}),headers:{"Content-Type":"application/json"},method:"POST"}).then((l)=>{if(!l.ok)throw Error(`Jx dev proxy ${l.status} for "${n}"`);return l.json()}),a=le(null);if(s)z(()=>{let c={};for(let[l,u]of Object.entries(o))c[l]=ie(u)?ve(u,t):u;i(c).then((l)=>{a.value=l}).catch((l)=>console.error("Jx dev proxy:",l))});else i(o).then((c)=>{a.value=c}).catch((c)=>console.error("Jx dev proxy:",c));return a}async function ic(e,t,n,r){let{$src:o,$export:s}=e,i,a=Cr(o);if(a instanceof Promise)i=await a;else if(a)i=a;else{try{i=await import(o)}catch{if(r)try{i=await import(new URL(o,r).href)}catch{return Rs(e,t,n,r)}else return Rs(e,t,n,r)}Ie.set(o,i)}let c=i[s]??i.default?.[s];if(!c)throw Error(`Jx: export "${s}" not found in "${o}" for "${n}"`);if(typeof c!=="function")throw TypeError(`Jx: "${s}" from "${o}" is not a function`);let l=c,u=e.arguments??{},f=Object.values(u).some((w)=>V(w)),d=()=>{let w={};for(let[b,g]of Object.entries(u))w[b]=V(g)?G(g.$ref,t):g;return w},m=le(null);if(f)z(()=>{let w=d();tn(()=>{}),l(w).then((b)=>{m.value=b}).catch(()=>{})});else m.value=await l(d());return m}async function Rs(e,t,n,r){let o=e.arguments??{},s=Object.values(o).some((l)=>V(l)),i=()=>{let l={};for(let[u,f]of Object.entries(o))l[u]=V(f)?G(f.$ref,t):f;return l},a=(l)=>fetch(Fs("/__jx_server__"),{body:JSON.stringify({$base:r,$export:e.$export,$src:e.$src,arguments:l}),headers:{"Content-Type":"application/json"},method:"POST"}).then((u)=>{if(!u.ok)throw Error(`Jx server proxy ${u.status} for "${n}"`);return u.json()}),c=le(null);if(s)z(()=>{let l=i();tn(()=>{}),a(l).then((u)=>{c.value=u}).catch((u)=>console.error("Jx server proxy:",u))});else a(i()).then((l)=>{c.value=l}).catch((l)=>console.error("Jx server proxy:",l));return c}function G(e,t){if(typeof e!=="string")return e;if(e.startsWith("$map/")||e.startsWith("#/$map/")){let n=(e.startsWith("#/")?e.slice(2):e).split("/"),[,r]=n,s=t.$map?.[r]??t[`$map/${r}`];return n.length>2?xr(s,n.slice(2).join("/")):s}if(e.startsWith("#/state/"))return ce(t,e.slice(8));if(e.startsWith("parent#/"))return ce(t,e.slice(8));if(e.startsWith("window#/"))return xr(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return xr(globalThis.document,e.slice(10));return ce(t,e)??null}function V(e){return _e(e)}function xr(e,t){return ce(e,t)}function $s(e,t,n,r){let o=t.replaceAll(/-([a-z])/g,(i,a)=>a.toUpperCase()),s=e[o];if(typeof s==="boolean"){e[o]=n!==null&&n!=="false";return}if(n===null){let i=r?.get(o);e[o]=i===void 0?typeof s==="number"?0:"":i;return}e[o]=typeof s==="number"?Number(n):n}function ac(e){let t=new Map;for(let[n,r]of Object.entries(e.state??{})){if(r!==null&&typeof r==="object"){let o=r;if("default"in o){t.set(n,o.default);continue}if(lc.some((s)=>(s in o)))continue}t.set(n,r)}return t}var lc=["$expression","$prototype","$ref","$src"],Ns=new Set;function cc(e,t){if(Object.hasOwn(e,t))return!0;if(e.hasAttribute(t))return!0;let n=t.replaceAll(/[A-Z]/gu,(r)=>`-${r.toLowerCase()}`);return n!==t&&e.hasAttribute(n)}function mn(e,t){if(!Kt(e))return!1;let n=t===void 0?e:`${t}:${e}`;if(!Ns.has(n))Ns.add(n),console.warn(`Jx: "${e}" is private state (spec.md §5.6) and cannot be set through $props`+`${t===void 0?"":` (${t})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function uc(e,t){let n=Object.create(t);for(let[r,o]of Object.entries(e.$props??{})){if(mn(r,"$props"))continue;n[r]=V(o)?G(o.$ref,t):o}return n}var si={},At=new Map;async function ii(e,t){let n=t??location.href,{tagName:r}=e;if(!r||!r.includes("-"))throw Error(`Jx redefineElement: tagName "${r}" must contain a hyphen`);if(!customElements.get(r)){await Rt(e,n);return}if(e.$elements)await Mr(e.$elements,n);let o=At.get(r)?.doc.observedAttributes??[],s=e.observedAttributes??[];if(JSON.stringify(o)!==JSON.stringify(s))console.warn(`Jx redefineElement: <${r}> keeps observedAttributes [${o.join(", ")}] as first defined; [${s.join(", ")}] takes effect only in a fresh realm`);At.set(r,{base:n,doc:e})}function ai(e){si=e??{}}async function Mr(e,t,n){for(let r of e){if(typeof r==="string"){try{await import(r.startsWith("/")||r.startsWith(".")?r:`/node_modules/${r}`)}catch(i){console.warn(`Jx: failed to import package "${r}"`,i)}continue}if(!V(r))continue;let{href:o}=new URL(r.$ref,t),s=await Sr(o,n);if(!s.tagName||!s.tagName.includes("-"))continue;if(customElements.get(s.tagName))continue;if(s.$elements)await Mr(s.$elements,o,n);await Rt(s,o)}}var Ms=32,fc={expansion:0,frames:[]},Qe=fc;function hn(e,t){let n=Qe;Qe=e;try{return t()}finally{Qe=n}}function vr(e){return{expansion:e.frames.length,frames:e.frames}}function dc(e,t){if(Object.is(e,t))return!0;if(!_s(e)||!_s(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function _s(e){if(typeof e!=="object"||e===null)return!1;let t=j(e);if(Array.isArray(t))return!0;let n=Object.getPrototypeOf(t);return n===Object.prototype||n===null}function pc(e,t){if(e.tag!==t.tag)return!1;let n=Object.keys(e.props);if(n.length!==Object.keys(t.props).length)return!1;return n.every((r)=>Object.hasOwn(t.props,r)&&dc(e.props[r],t.props[r]))}function mc(e,t){let n=[...e.frames.map((r)=>r.tag),t.tag].join(" → ");if(e.frames.slice(e.expansion).some((r)=>pc(r,t)))throw Error(`Component <${t.tag}> renders itself: ${n}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(e.frames.length>=Ms)throw Error(`Component nesting exceeds ${Ms} levels: ${n}. A component that renders itself with changing props needs a case that stops.`);return{expansion:e.expansion,frames:[...e.frames,t]}}var Os=new Set;async function Rt(e,t){let n=t,r=e;if(typeof e==="string"){if(n=new URL(e,n??location.href).href,Os.has(n))return;Os.add(n),r=await Sr(e)}n??=location.href;let o=r,{tagName:s}=o;if(!s||!s.includes("-"))throw Error(`Jx defineElement: tagName "${s}" must contain a hyphen`);if(customElements.get(s))return;if(o.$elements)await Mr(o.$elements,n);At.set(s,{base:n,doc:o});let i=o,a=n,c=i.observedAttributes??[],l=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return c}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let u=Qe,f={},d=At.get(s)??{base:a,doc:i},{doc:m,base:w}=d,b=await yn(m,{},w,{base:w,media:null,root:this});for(let E of c)if(this.hasAttribute(E))$s(b,E,this.getAttribute(E)),f[E]=this.getAttribute(E);let g=this.dataset.jxProps;if(g){try{let E=JSON.parse(g);for(let[O,M]of Object.entries(E)){if(mn(O,"data-jx-props"))continue;if(O in(m.state??{}))b[O]=M,f[O]=M}}catch{}delete this.dataset.jxProps}let y=this.getAttributeNames().filter((E)=>E.startsWith("props.")&&E.length>6);for(let E of y){let O=E.slice(6);if(mn(O,"props.* attribute")){this.removeAttribute(E);continue}if(O in(m.state??{}))b[O]=this.getAttribute(E),f[O]=this.getAttribute(E),this.removeAttribute(E)}for(let E of Object.keys(m.state??{})){if(Kt(E))continue;if(E in this&&this[E]!==void 0&&cc(this,E))b[E]=this[E],f[E]=this[E]}let S;try{S=mc(u,{props:f,tag:s})}catch(E){if(this.replaceChildren(),!this.isConnected)return;console.error(`Jx: <${s}> was not rendered:`,E),this.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:E,message:E instanceof Error?E.message:String(E)}));return}for(let E of Object.keys(m.state??{})){if(Kt(E))continue;if(!(E in HTMLElement.prototype))Object.defineProperty(this,E,{configurable:!0,get:()=>b[E],set:(O)=>{b[E]=O}})}this._state=b;let A=[...this.childNodes];this.replaceChildren();let C=Yl(m.style)?m.style:{display:"block",...m.style},T=ri(C,Rr.get(this));if(bn(this,T,b.$media??{},b),En(this,m.attributes??{},b),ql(this,m,b),!Array.isArray(m.children)&&m.textContent!==void 0)Qs(this,"textContent",m.textContent,b);let x=Array.isArray(m.children)?m.children:[],v=un;un||=this.dataset.jxPath!==void 0;try{hn(S,()=>{for(let E of x)this.append(ue(E,b))})}finally{un=v}hc(this,A);let{onMount:P}=b;if(typeof P==="function")queueMicrotask(()=>P(b,this))}disconnectedCallback(){if(typeof this._state?.onUnmount==="function")this._state.onUnmount(this._state)}adoptedCallback(){if(typeof this._state?.onAdopted==="function")this._state.onAdopted(this._state)}attributeChangedCallback(u,f,d){if(!this._state||f===d)return;$s(this._state,u,d,ac(At.get(s)?.doc??i))}};customElements.define(s,l)}function Ds(e,t,n,r){let o=document.createElement($r(e.tagName,t));if(n?.onNodeCreated)n.onNodeCreated(o,r??[],e,t);for(let[i,a]of Object.entries(e.$props??{})){if(mn(i,"$props"))continue;let c=(l)=>{o[i]=typeof l==="string"?Ar(o.tagName,i,l):l};if(V(a)){let l=a;c(G(l.$ref,t)),z(()=>{c(G(l.$ref,t))})}else if(ie(a))z(()=>{c(ve(a,t))});else c(a)}if(e.style)Rr.set(o,e.style);bn(o,e.style??{},t.$media??{},t),En(o,e.attributes??{},t),Pr(o,e,t);let s=Array.isArray(e.children)?e.children:[];for(let i=0;i<s.length;i++){let a=s[i],c=n&&r?{...n,_path:[...r,"children",i]}:void 0;if(Bt(a))Er(o,a,t,c);else o.append(ue(a,t,c))}return o}function hc(e,t){let n=e.querySelectorAll("slot");if(n.length===0)return;let r=new Map,o=[];for(let s of t)if(s.nodeType===Node.ELEMENT_NODE&&s.getAttribute("slot")){let i=s.getAttribute("slot");if(!r.has(i))r.set(i,[]);r.get(i).push(s)}else o.push(s);for(let s of n){let i=s.getAttribute("name"),a=i?r.get(i)??[]:o;s.replaceWith(...a.length>0?a:[...s.childNodes])}}function gc(e,t){if(typeof t!=="string"||t==="")return e;let n=e.indexOf("#"),r=n===-1?"":e.slice(n),o=n===-1?e:e.slice(0,n),s=o.indexOf("?"),i=s===-1?o:o.slice(0,s),c=(s===-1?[]:o.slice(s+1).split("&")).filter((l)=>l!==""&&!xc(l));return c.push(`v=${encodeURIComponent(t)}`),`${i}?${c.join("&")}${r}`}function xc(e){let t=e.indexOf("="),n=t===-1?e:e.slice(0,t);if(n==="v")return!0;if(!n.includes("%"))return!1;try{return decodeURIComponent(n)==="v"}catch{return!1}}function yc(e,t){if(!e||!Object.hasOwn(e,t))return;let n=e[t];return typeof n==="string"?n:void 0}function $t(e,t){if(!t||e==="")return null;if(t.space==="repo"){if(!t.fileBaseUrl)return null;let r=ys(e,t.documentDir,t.mounts,t.lanes);if(r===null)return null;let{suffix:o}=Tt(e);return gc(`${t.fileBaseUrl}${bs(r)}${o}`,yc(t.versions,r))}let[n]=t.mounts;return n?bc(e,t.documentDir,n):null}function bc(e,t,n){if(pr(e))return null;let{path:r,suffix:o}=Tt(e),s;try{s=decodeURIComponent(r)}catch{return null}let i=hr(t,s);if(i===null)return null;let a=xs([n],i);if(!a)return null;return`${a}${o}`}function Je(e){return`[data-jx-path='${e.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function wc(e,t){if(!t)return!1;return e.length<=t.length&&e.every((n,r)=>t[r]===n)}function li(e,t,n){let r=n.layoutWrapped&&typeof t==="object"?t?.$__layout:void 0;if(r){let s=typeof r==="object"?r:{};return{chrome:e.length>0&&!wc(e,n.pageContentPrefix),kind:"layout",layoutFile:typeof s.file==="string"?s.file:"",layoutPath:Array.isArray(s.path)?s.path:[]}}let o=e;if(n.layoutWrapped&&n.pageContentPrefix){let s=n.pageContentPrefix;if(e.length>=s.length&&s.every((i,a)=>e[a]===i)){let i=e.slice(s.length),[a]=i;o=typeof a==="number"?["children",a-(n.pageContentOffset??0),...i.slice(1)]:["children",...i]}}if(n.arrayPaths.size>0){let s=!0;while(s){s=!1;for(let i=1;i<o.length-1;i++)if(o[i]==="children"&&o[i+1]===0&&n.arrayPaths.has(o.slice(0,i).join("/"))){o=[...o.slice(0,i),"map",...o.slice(i+2)],s=!0;break}}}return{kind:"path",path:o}}function J(e){return JSON.stringify(e)}function U(e){return JSON.parse(e)}function ci(e){if(e.dataset.jxDefinitionRoot!==void 0)return!1;return e.getAttribute("contenteditable")==="false"||e.tagName.includes("-")}function vn(e,t){let n=e instanceof Element?e:e?.parentElement??null;while(n){if(n instanceof HTMLElement){if(n.dataset.jxPath&&t(n))return{el:n,path:U(n.dataset.jxPath)};if(ci(n))return null}n=n.parentElement}return null}function Sn(e,t){let n=e.querySelector(Je(J(t)));return n instanceof HTMLElement?n:null}function _r(e){return e.textContent?.length??0}function Ec(e,t,n){if(!e.contains(t))return null;let r=e.ownerDocument.createRange();r.setStart(e,0);try{r.setEnd(t,n)}catch{return null}return r.toString().length}function vc(e,t){let n=Math.max(0,Math.min(t,_r(e))),r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=0,s=null,i=r.nextNode();while(i){let a=i.length;if(o+a>=n)return{node:i,offset:n-o};o+=a,s=i,i=r.nextNode()}return s?{node:s,offset:s.length}:{node:e,offset:0}}function Nt(e,t,n){let r=vn(e,n);if(!r||!e)return null;let o=Ec(r.el,e,t);return o===null?null:{offset:o,path:r.path}}function Or(e,t){let n=Sn(e,t.path);return n?vc(n,t.offset):null}function ui(e){return e.offset<=0}function Mt(e,t){return J(e.path)===J(t.path)}function Dr(e,t){let n=[];for(let r of e.querySelectorAll("[data-jx-path]"))if(t(r)&&!Sc(r,e))n.push(r);return n}function Sc(e,t){let n=e.parentElement;while(n&&n!==t){if(ci(n))return!0;n=n.parentElement}return!1}function fi(e,t,n,r){let o=Dr(e,r),s=J(t),i=o.findIndex((c)=>c.dataset.jxPath===s),a=i===-1?void 0:o[i+n];return a?{el:a,path:U(a.dataset.jxPath)}:null}var Lr="jx-site-style";function di(e,t,n,r){let o=[],s=(u,f)=>{for(let d of kt(u,{mediaQueries:t,scope:f,transposeValue:n,...r?{resolveValue:(m,w)=>r(m,w,f)}:{}}))o.push(d.text)},i={},a={},c=[],l=[];for(let[u,f]of Object.entries(e)){if(f!==null&&typeof f==="object"&&!Array.isArray(f)){if(u.startsWith("@"))c.push([u,f]);else if(!u.startsWith("--"))l.push([u,f]);continue}if(St(u)||u.startsWith("@"))continue;if(u.startsWith("--")||u==="colorScheme"||u==="color-scheme")i[u]=f;else a[u]=f}s(i,":root"),s(a,"body");for(let[u,f]of l)if(u.startsWith("&"))s({[u]:f},":root");else s(f,u);for(let[u,f]of c){if(wt(u)||vt(u)){s({[u]:f},null);continue}let d={},m={},w=[];for(let[b,g]of Object.entries(f)){if(g!==null&&typeof g==="object"&&!Array.isArray(g)){if(!b.startsWith("@"))w.push([b,g]);continue}if(b.startsWith("--"))d[b]=g;else m[b]=g}s({[u]:d},":root"),s({[u]:m},"body");for(let[b,g]of w)s({[u]:g},b)}if(Object.values(t).some((u)=>sn(u)!==null)&&!("colorScheme"in e))o.push(":root { color-scheme: light dark }",`:root:where([${Pe}="light"]) { color-scheme: light }`,`:root:where([${Pe}="dark"]) { color-scheme: dark }`);return o.join(`
10
- `)}async function kc(e,t){let n=e.$elements;if(!Array.isArray(n))return;await Promise.all(n.map(async(r)=>{let o=(async()=>{if(typeof r==="string")await import(r.startsWith("/")||r.startsWith(".")?r:`/node_modules/${r}`);else if(r&&typeof r==="object"&&"$ref"in r)await Rt(new URL(String(r.$ref),t).href);else if(r&&typeof r==="object")await Rt(r,t)})();try{await Promise.race([o,new Promise((s,i)=>{setTimeout(()=>i(Error("register timeout")),5000)})])}catch(s){console.warn("iframe canvas: failed to register element",JSON.stringify(r),s)}}))}var pi="jx-canvas-edit-css",Tc=`
9
+ `):c.body??"";if(c.role==="accessor"){let d={};if(c.getter)d.get=Function(c.getter.body??"");if(c.setter){let m=(c.setter.parameters??[]).map((w)=>w.$ref?.split("/").pop()??"v");d.set=Function(...m,c.setter.body??"")}Object.defineProperty(s.prototype,l,{...d,configurable:!0})}else if(c.scope==="static")s[l]=Function(...u,f);else s.prototype[l]=Function(...u,f)}return Object.defineProperty(s,"name",{configurable:!0,value:e.title}),s}async function un(e,t,n,r){let o={};for(let[c,l]of Object.entries(e))if(!Mr.has(c))o[c]=l;let s=Object.values(o).some((c)=>le(c)),i=(c)=>fetch(Hs("/__jx_resolve__"),{body:JSON.stringify({$base:r,$export:e.$export,$prototype:e.$prototype,$src:e.$src,...c}),headers:{"Content-Type":"application/json"},method:"POST"}).then((l)=>{if(!l.ok)throw Error(`Jx dev proxy ${l.status} for "${n}"`);return l.json()}),a=ue(null);if(s)G(()=>{let c={};for(let[l,u]of Object.entries(o))c[l]=le(u)?ke(u,t):u;i(c).then((l)=>{a.value=l}).catch((l)=>console.error("Jx dev proxy:",l))});else i(o).then((c)=>{a.value=c}).catch((c)=>console.error("Jx dev proxy:",c));return a}function si(e,t,n){let r=0;return(o)=>{r+=1;let s=r;new Promise((i)=>{i(t(o))}).then((i)=>{if(s===r)e.value=i}).catch((i)=>{if(s===r)console.error(n,i)})}}async function ac(e,t,n,r){let{$src:o,$export:s}=e,i=Ys.has(o)?Pr(o):void 0;if(!i)return lc(e,t,n,r);let a=i instanceof Promise?await i:i,c=a[s]??a.default?.[s];if(!c)throw Error(`Jx: export "${s}" not found in "${o}" for "${n}"`);if(typeof c!=="function")throw TypeError(`Jx: "${s}" from "${o}" is not a function`);let l=c,u=e.arguments??{},f=Object.values(u).some((w)=>U(w)),d=()=>{let w={};for(let[y,h]of Object.entries(u))w[y]=U(h)?Y(h.$ref,t):h;return w},m=ue(null);if(f){let w=si(m,l,"Jx server function:");G(()=>{let y=d();nn(()=>{}),w(y)})}else m.value=await l(d());return m}async function lc(e,t,n,r){let o=e.arguments??{},s=Object.values(o).some((u)=>U(u)),i=()=>{let u={};for(let[f,d]of Object.entries(o))u[f]=U(d)?Y(d.$ref,t):d;return u},a=(u)=>fetch(Hs("/__jx_server__"),{body:JSON.stringify({$base:r,$export:e.$export,$src:e.$src,arguments:u}),headers:{"Content-Type":"application/json"},method:"POST"}).then((f)=>{if(!f.ok)throw Error(`Jx server proxy ${f.status} for "${n}"`);return f.json()}),c=ue(null),l=si(c,a,"Jx server proxy:");if(s)G(()=>{let u=i();nn(()=>{}),l(u)});else l(i());return c}function Y(e,t){if(typeof e!=="string")return e;if(e.startsWith("$map/")||e.startsWith("#/$map/")){let n=(e.startsWith("#/")?e.slice(2):e).split("/"),[,r]=n,s=t.$map?.[r]??t[`$map/${r}`];return n.length>2?yr(s,n.slice(2).join("/")):s}if(e.startsWith("#/state/"))return fe(t,e.slice(8));if(e.startsWith("parent#/"))return fe(t,e.slice(8));if(e.startsWith("window#/"))return yr(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return yr(globalThis.document,e.slice(10));return fe(t,e)??null}function U(e){return De(e)}function yr(e,t){return fe(e,t)}function Rs(e,t,n,r){let o=t.replaceAll(/-([a-z])/g,(i,a)=>a.toUpperCase()),s=e[o];if(typeof s==="boolean"){e[o]=n!==null&&n!=="false";return}if(n===null){let i=r?.get(o);e[o]=i===void 0?typeof s==="number"?0:"":i;return}e[o]=typeof s==="number"?Number(n):n}function cc(e){let t=new Map;for(let[n,r]of Object.entries(e.state??{})){if(r!==null&&typeof r==="object"){let o=r;if("default"in o){t.set(n,o.default);continue}if(uc.some((s)=>(s in o)))continue}t.set(n,r)}return t}var uc=["$expression","$prototype","$ref","$src"],$s=new Set;function fc(e,t){if(Object.hasOwn(e,t))return!0;if(e.hasAttribute(t))return!0;let n=t.replaceAll(/[A-Z]/gu,(r)=>`-${r.toLowerCase()}`);return n!==t&&e.hasAttribute(n)}function hn(e,t){if(!Vt(e))return!1;let n=t===void 0?e:`${t}:${e}`;if(!$s.has(n))$s.add(n),console.warn(`Jx: "${e}" is private state (spec.md §5.6) and cannot be set through $props`+`${t===void 0?"":` (${t})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function dc(e,t){let n=Object.create(t);for(let[r,o]of Object.entries(e.$props??{})){if(hn(r,"$props"))continue;n[r]=U(o)?Y(o.$ref,t):o}return n}var ii={},At=new Map;async function ai(e,t){let n=t??location.href,{tagName:r}=e;if(!r||!r.includes("-"))throw Error(`Jx redefineElement: tagName "${r}" must contain a hyphen`);if(!customElements.get(r)){await Rt(e,n);return}if(e.$elements)await _r(e.$elements,n);let o=At.get(r)?.doc.observedAttributes??[],s=e.observedAttributes??[];if(JSON.stringify(o)!==JSON.stringify(s))console.warn(`Jx redefineElement: <${r}> keeps observedAttributes [${o.join(", ")}] as first defined; [${s.join(", ")}] takes effect only in a fresh realm`);At.set(r,{base:n,doc:e})}function li(e){ii=e??{}}async function _r(e,t,n){for(let r of e){if(typeof r==="string"){try{await import(r.startsWith("/")||r.startsWith(".")?r:`/node_modules/${r}`)}catch(i){console.warn(`Jx: failed to import package "${r}"`,i)}continue}if(!U(r))continue;let{href:o}=new URL(r.$ref,t),s=await kr(o,n);if(!s.tagName||!s.tagName.includes("-"))continue;if(customElements.get(s.tagName))continue;if(s.$elements)await _r(s.$elements,o,n);await Rt(s,o)}}var Ns=32,pc={expansion:0,frames:[]},Qe=pc;function gn(e,t){let n=Qe;Qe=e;try{return t()}finally{Qe=n}}function Sr(e){return{expansion:e.frames.length,frames:e.frames}}function mc(e,t){if(Object.is(e,t))return!0;if(!Ms(e)||!Ms(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Ms(e){if(typeof e!=="object"||e===null)return!1;let t=j(e);if(Array.isArray(t))return!0;let n=Object.getPrototypeOf(t);return n===Object.prototype||n===null}function hc(e,t){if(e.tag!==t.tag)return!1;let n=Object.keys(e.props);if(n.length!==Object.keys(t.props).length)return!1;return n.every((r)=>Object.hasOwn(t.props,r)&&mc(e.props[r],t.props[r]))}function gc(e,t){let n=[...e.frames.map((r)=>r.tag),t.tag].join(" → ");if(e.frames.slice(e.expansion).some((r)=>hc(r,t)))throw Error(`Component <${t.tag}> renders itself: ${n}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(e.frames.length>=Ns)throw Error(`Component nesting exceeds ${Ns} levels: ${n}. A component that renders itself with changing props needs a case that stops.`);return{expansion:e.expansion,frames:[...e.frames,t]}}var _s=new Set;async function Rt(e,t){let n=t,r=e;if(typeof e==="string"){if(n=new URL(e,n??location.href).href,_s.has(n))return;_s.add(n),r=await kr(e)}n??=location.href;let o=r,{tagName:s}=o;if(!s||!s.includes("-"))throw Error(`Jx defineElement: tagName "${s}" must contain a hyphen`);if(customElements.get(s))return;if(o.$elements)await _r(o.$elements,n);At.set(s,{base:n,doc:o});let i=o,a=n,c=i.observedAttributes??[],l=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return c}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let u=Qe,f={},d=At.get(s)??{base:a,doc:i},{doc:m,base:w}=d,y=await bn(m,{},w,{base:w,media:null,root:this});for(let E of c)if(this.hasAttribute(E))Rs(y,E,this.getAttribute(E)),f[E]=this.getAttribute(E);let h=this.dataset.jxProps;if(h){try{let E=JSON.parse(h);for(let[_,R]of Object.entries(E)){if(hn(_,"data-jx-props"))continue;if(_ in(m.state??{}))y[_]=R,f[_]=R}}catch{}delete this.dataset.jxProps}let x=this.getAttributeNames().filter((E)=>E.startsWith("props.")&&E.length>6);for(let E of x){let _=E.slice(6);if(hn(_,"props.* attribute")){this.removeAttribute(E);continue}if(_ in(m.state??{}))y[_]=this.getAttribute(E),f[_]=this.getAttribute(E),this.removeAttribute(E)}for(let E of Object.keys(m.state??{})){if(Vt(E))continue;if(E in this&&this[E]!==void 0&&fc(this,E))y[E]=this[E],f[E]=this[E]}let S;try{S=gc(u,{props:f,tag:s})}catch(E){if(this.replaceChildren(),!this.isConnected)return;console.error(`Jx: <${s}> was not rendered:`,E),this.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:E,message:E instanceof Error?E.message:String(E)}));return}for(let E of Object.keys(m.state??{})){if(Vt(E))continue;if(!(E in HTMLElement.prototype))Object.defineProperty(this,E,{configurable:!0,get:()=>y[E],set:(_)=>{y[E]=_}})}this._state=y;let A=[...this.childNodes];this.replaceChildren();let C=Xl(m.style)?m.style:{display:"block",...m.style},T=ri(C,$r.get(this));if(wn(this,T,y.$media??{},y),vn(this,m.attributes??{},y),zl(this,m,y),!Array.isArray(m.children)&&m.textContent!==void 0)Qs(this,"textContent",m.textContent,y);let g=Array.isArray(m.children)?m.children:[],v=fn;fn||=this.dataset.jxPath!==void 0;try{gn(S,()=>{for(let E of g)this.append(de(E,y))})}finally{fn=v}xc(this,A);let{onMount:P}=y;if(typeof P==="function")queueMicrotask(()=>P(y,this))}disconnectedCallback(){if(typeof this._state?.onUnmount==="function")this._state.onUnmount(this._state)}adoptedCallback(){if(typeof this._state?.onAdopted==="function")this._state.onAdopted(this._state)}attributeChangedCallback(u,f,d){if(!this._state||f===d)return;Rs(this._state,u,d,cc(At.get(s)?.doc??i))}};customElements.define(s,l)}function Os(e,t,n,r){let o=document.createElement(Nr(e.tagName,t));if(n?.onNodeCreated)n.onNodeCreated(o,r??[],e,t);for(let[i,a]of Object.entries(e.$props??{})){if(hn(i,"$props"))continue;let c=(l)=>{o[i]=typeof l==="string"?Cr(o.tagName,i,l):l};if(U(a)){let l=a;c(Y(l.$ref,t)),G(()=>{c(Y(l.$ref,t))})}else if(le(a))G(()=>{c(ke(a,t))});else c(a)}if(e.style)$r.set(o,e.style);wn(o,e.style??{},t.$media??{},t),vn(o,e.attributes??{},t),Rr(o,e,t);let s=Array.isArray(e.children)?e.children:[];for(let i=0;i<s.length;i++){let a=s[i],c=n&&r?{...n,_path:[...r,"children",i]}:void 0;if(Kt(a))vr(o,a,t,c);else o.append(de(a,t,c))}return o}function xc(e,t){let n=e.querySelectorAll("slot");if(n.length===0)return;let r=new Map,o=[];for(let s of t)if(s.nodeType===Node.ELEMENT_NODE&&s.getAttribute("slot")){let i=s.getAttribute("slot");if(!r.has(i))r.set(i,[]);r.get(i).push(s)}else o.push(s);for(let s of n){let i=s.getAttribute("name"),a=i?r.get(i)??[]:o;s.replaceWith(...a.length>0?a:[...s.childNodes])}}function yc(e,t){if(typeof t!=="string"||t==="")return e;let n=e.indexOf("#"),r=n===-1?"":e.slice(n),o=n===-1?e:e.slice(0,n),s=o.indexOf("?"),i=s===-1?o:o.slice(0,s),c=(s===-1?[]:o.slice(s+1).split("&")).filter((l)=>l!==""&&!bc(l));return c.push(`v=${encodeURIComponent(t)}`),`${i}?${c.join("&")}${r}`}function bc(e){let t=e.indexOf("="),n=t===-1?e:e.slice(0,t);if(n==="v")return!0;if(!n.includes("%"))return!1;try{return decodeURIComponent(n)==="v"}catch{return!1}}function wc(e,t){if(!e||!Object.hasOwn(e,t))return;let n=e[t];return typeof n==="string"?n:void 0}function $t(e,t){if(!t||e==="")return null;if(t.space==="repo"){if(!t.fileBaseUrl)return null;let r=ys(e,t.documentDir,t.mounts,t.lanes);if(r===null)return null;let{suffix:o}=Tt(e);return yc(`${t.fileBaseUrl}${bs(r)}${o}`,wc(t.versions,r))}let[n]=t.mounts;return n?Ec(e,t.documentDir,n):null}function Ec(e,t,n){if(mr(e))return null;let{path:r,suffix:o}=Tt(e),s;try{s=decodeURIComponent(r)}catch{return null}let i=gr(t,s);if(i===null)return null;let a=xs([n],i);if(!a)return null;return`${a}${o}`}function je(e){return`[data-jx-path='${e.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function vc(e,t){if(!t)return!1;return e.length<=t.length&&e.every((n,r)=>t[r]===n)}function ci(e,t,n){let r=n.layoutWrapped&&typeof t==="object"?t?.$__layout:void 0;if(r){let s=typeof r==="object"?r:{};return{chrome:e.length>0&&!vc(e,n.pageContentPrefix),kind:"layout",layoutFile:typeof s.file==="string"?s.file:"",layoutPath:Array.isArray(s.path)?s.path:[]}}let o=e;if(n.layoutWrapped&&n.pageContentPrefix){let s=n.pageContentPrefix;if(e.length>=s.length&&s.every((i,a)=>e[a]===i)){let i=e.slice(s.length),[a]=i;o=typeof a==="number"?["children",a-(n.pageContentOffset??0),...i.slice(1)]:["children",...i]}}if(n.arrayPaths.size>0){let s=!0;while(s){s=!1;for(let i=1;i<o.length-1;i++)if(o[i]==="children"&&o[i+1]===0&&n.arrayPaths.has(o.slice(0,i).join("/"))){o=[...o.slice(0,i),"map",...o.slice(i+2)],s=!0;break}}}return{kind:"path",path:o}}function J(e){return JSON.stringify(e)}function q(e){return JSON.parse(e)}function ui(e){if(e.dataset.jxDefinitionRoot!==void 0)return!1;return e.getAttribute("contenteditable")==="false"||e.tagName.includes("-")}function Sn(e,t){let n=e instanceof Element?e:e?.parentElement??null;while(n){if(n instanceof HTMLElement){if(n.dataset.jxPath&&t(n))return{el:n,path:q(n.dataset.jxPath)};if(ui(n))return null}n=n.parentElement}return null}function kn(e,t){let n=e.querySelector(je(J(t)));return n instanceof HTMLElement?n:null}function Or(e){return e.textContent?.length??0}function Sc(e,t,n){if(!e.contains(t))return null;let r=e.ownerDocument.createRange();r.setStart(e,0);try{r.setEnd(t,n)}catch{return null}return r.toString().length}function kc(e,t){let n=Math.max(0,Math.min(t,Or(e))),r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=0,s=null,i=r.nextNode();while(i){let a=i.length;if(o+a>=n)return{node:i,offset:n-o};o+=a,s=i,i=r.nextNode()}return s?{node:s,offset:s.length}:{node:e,offset:0}}function Nt(e,t,n){let r=Sn(e,n);if(!r||!e)return null;let o=Sc(r.el,e,t);return o===null?null:{offset:o,path:r.path}}function Dr(e,t){let n=kn(e,t.path);return n?kc(n,t.offset):null}function fi(e){return e.offset<=0}function Mt(e,t){return J(e.path)===J(t.path)}function Lr(e,t){let n=[];for(let r of e.querySelectorAll("[data-jx-path]"))if(t(r)&&!Tc(r,e))n.push(r);return n}function Tc(e,t){let n=e.parentElement;while(n&&n!==t){if(ui(n))return!0;n=n.parentElement}return!1}function di(e,t,n,r){let o=Lr(e,r),s=J(t),i=o.findIndex((c)=>c.dataset.jxPath===s),a=i===-1?void 0:o[i+n];return a?{el:a,path:q(a.dataset.jxPath)}:null}var Ir="jx-site-style";function pi(e,t,n,r){let o=[],s=(u,f)=>{for(let d of kt(u,{mediaQueries:t,scope:f,transposeValue:n,...r?{resolveValue:(m,w)=>r(m,w,f)}:{}}))o.push(d.text)},i={},a={},c=[],l=[];for(let[u,f]of Object.entries(e)){if(f!==null&&typeof f==="object"&&!Array.isArray(f)){if(u.startsWith("@"))c.push([u,f]);else if(!u.startsWith("--"))l.push([u,f]);continue}if(St(u)||u.startsWith("@"))continue;if(u.startsWith("--")||u==="colorScheme"||u==="color-scheme")i[u]=f;else a[u]=f}s(i,":root"),s(a,"body");for(let[u,f]of l)if(u.startsWith("&"))s({[u]:f},":root");else s(f,u);for(let[u,f]of c){if(wt(u)||vt(u)){s({[u]:f},null);continue}let d={},m={},w=[];for(let[y,h]of Object.entries(f)){if(h!==null&&typeof h==="object"&&!Array.isArray(h)){if(!y.startsWith("@"))w.push([y,h]);continue}if(y.startsWith("--"))d[y]=h;else m[y]=h}s({[u]:d},":root"),s({[u]:m},"body");for(let[y,h]of w)s({[u]:h},y)}if(Object.values(t).some((u)=>an(u)!==null)&&!("colorScheme"in e))o.push(":root { color-scheme: light dark }",`:root:where([${$e}="light"]) { color-scheme: light }`,`:root:where([${$e}="dark"]) { color-scheme: dark }`);return o.join(`
10
+ `)}async function Ac(e,t){let n=e.$elements;if(!Array.isArray(n))return;await Promise.all(n.map(async(r)=>{let o=(async()=>{if(typeof r==="string")await import(r.startsWith("/")||r.startsWith(".")?r:`/node_modules/${r}`);else if(r&&typeof r==="object"&&"$ref"in r)await Rt(new URL(String(r.$ref),t).href);else if(r&&typeof r==="object")await Rt(r,t)})();try{await Promise.race([o,new Promise((s,i)=>{setTimeout(()=>i(Error("register timeout")),5000)})])}catch(s){console.warn("iframe canvas: failed to register element",JSON.stringify(r),s)}}))}var mi="jx-canvas-edit-css",Cc=`
11
11
  .empty-media-placeholder {
12
12
  display: inline-block;
13
13
  min-width: 120px;
@@ -96,7 +96,7 @@ function ko(e){let{target:t,source:n,targetOrigin:r,acceptOrigin:o,token:s}=e,i=
96
96
  [data-jx-layout-region] [data-jx-layout-region]::before {
97
97
  content: none;
98
98
  }
99
- `;function Ac(e,t){let n=e.head.querySelector(`#${pi}`);if(t!=="design"&&t!=="edit"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=pi,r.textContent=Tc,e.head.append(r)}var mi="jx-canvas-overlay-css",Cc=`
99
+ `;function Pc(e,t){let n=e.head.querySelector(`#${mi}`);if(t!=="design"&&t!=="edit"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=mi,r.textContent=Cc,e.head.append(r)}var hi="jx-canvas-overlay-css",Rc=`
100
100
  /* The UA rule a de-popovered element lost, re-supplied at UA-EQUIVALENT PRECEDENCE.
101
101
 
102
102
  The cascade layer is the mechanism and it is the whole point. An unlayered author declaration
@@ -184,7 +184,7 @@ dialog[data-jx-dialog-open]::before {
184
184
  letter-spacing: 0.08em;
185
185
  pointer-events: none;
186
186
  }
187
- `;function Pc(e,t){let n=e.head.querySelector(`#${mi}`);if(t==="preview"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=mi,r.textContent=Cc,e.head.append(r)}var hi="jx-canvas-diff-css",Rc=`
187
+ `;function $c(e,t){let n=e.head.querySelector(`#${hi}`);if(t==="preview"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=hi,r.textContent=Rc,e.head.append(r)}var gi="jx-canvas-diff-css",Nc=`
188
188
  [data-jx-diff] {
189
189
  position: relative;
190
190
  border-left-width: 3px;
@@ -227,7 +227,7 @@ dialog[data-jx-dialog-open]::before {
227
227
  border-left-color: CanvasText;
228
228
  }
229
229
  }
230
- `;function $c(e,t){let n=e.head.querySelector(`#${hi}`);if(!t){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=hi,r.textContent=Rc,e.head.append(r)}function Nc(e,t){for(let n of e.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(n instanceof HTMLElement)delete n.dataset.jxDiff,delete n.dataset.jxDiffWithin;if(!t?.length)return;for(let n of t){let r=Sn(e,n.path);if(r){r.dataset.jxDiff=n.kind;continue}let{path:o}=n;while(o.length>=2){o=o.slice(0,-2);let s=Sn(e,o);if(s){s.dataset.jxDiffWithin="";break}}}}function Mc(e,t){e.documentElement.toggleAttribute("data-jx-preview",t==="preview")}function kn(e){return e==="design"||e==="edit"}function _c(e,t){if(!kn(t)){e.removeAttribute("contenteditable"),e.removeAttribute("spellcheck"),e.removeAttribute("role"),e.removeAttribute("aria-multiline"),e.removeAttribute("aria-label");return}e.contentEditable="true",e.spellcheck=!0,e.setAttribute("autocorrect","off"),e.setAttribute("writingsuggestions","false"),e.setAttribute("draggable","false"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline","true"),e.setAttribute("aria-label","Document content")}var gi="jx-canvas-stylebook-css",Oc=`
230
+ `;function Mc(e,t){let n=e.head.querySelector(`#${gi}`);if(!t){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=gi,r.textContent=Nc,e.head.append(r)}function _c(e,t){for(let n of e.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(n instanceof HTMLElement)delete n.dataset.jxDiff,delete n.dataset.jxDiffWithin;if(!t?.length)return;for(let n of t){let r=kn(e,n.path);if(r){r.dataset.jxDiff=n.kind;continue}let{path:o}=n;while(o.length>=2){o=o.slice(0,-2);let s=kn(e,o);if(s){s.dataset.jxDiffWithin="";break}}}}function Oc(e,t){e.documentElement.toggleAttribute("data-jx-preview",t==="preview")}function Tn(e){return e==="design"||e==="edit"}function Dc(e,t){if(!Tn(t)){e.removeAttribute("contenteditable"),e.removeAttribute("spellcheck"),e.removeAttribute("role"),e.removeAttribute("aria-multiline"),e.removeAttribute("aria-label");return}e.contentEditable="true",e.spellcheck=!0,e.setAttribute("autocorrect","off"),e.setAttribute("writingsuggestions","false"),e.setAttribute("draggable","false"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline","true"),e.setAttribute("aria-label","Document content")}var xi="jx-canvas-stylebook-css",Lc=`
231
231
  .sb-root {
232
232
  padding: 16px;
233
233
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
@@ -306,10 +306,10 @@ dialog[data-jx-dialog-open]::before {
306
306
  color: color-mix(in srgb, #808080 70%, transparent);
307
307
  font-size: 13px;
308
308
  }
309
- `;function Dc(e,t){let n=e.head.querySelector(`#${gi}`);if(t!=="stylebook"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=gi,r.textContent=Oc,e.head.append(r)}function Ir(e,t={}){let n=document.head.querySelector(`#${Lr}`);if(!e||typeof e!=="object"){n?.remove();return}let r=di(e,t,fn);if(n){n.textContent=r;return}let o=document.createElement("style");o.id=Lr,o.textContent=r,document.head.append(o)}function Jr(e,t){if(t)e.documentElement.dataset.colorScheme=t;else delete e.documentElement.dataset.colorScheme}function _t(e,t){for(let r of e.querySelectorAll("[data-jx-popover-open]"))delete r.dataset.jxPopoverOpen;if(t===null)return;let n=e.querySelector(`[data-jx-popover]${Je(t)}`);if(n)n.dataset.jxPopoverOpen=""}function et(e,t){for(let r of e.querySelectorAll("[data-jx-dialog-open]"))delete r.dataset.jxDialogOpen;if(t===null)return;let n=e.querySelector(`dialog${Je(t)}`);if(n)n.dataset.jxDialogOpen=""}function Lc(e,t=null){let n=e.$head;if(!Array.isArray(n))return;for(let r of n){if(!r?.tagName)continue;let o=String(r.tagName).toLowerCase();if(o==="script"&&!r.attributes?.src)continue;let s={...r.attributes};for(let c of["href","src"]){let l=s[c];if(typeof l!=="string"||l==="")continue;if(!l.startsWith("/")&&!l.startsWith(".")&&!l.startsWith("http")){s[c]=`/node_modules/${l}`;continue}s[c]=$t(l,t)??l}let i=`${o}${s.href?`[href="${String(s.href)}"]`:""}${s.src?`[src="${String(s.src)}"]`:""}`;if(i!==o&&document.head.querySelector(i))continue;let a=document.createElement(o);for(let[c,l]of Object.entries(s))a.setAttribute(c,String(l));if(r.textContent)a.textContent=r.textContent;document.head.append(a)}}function jr(e){let t=[],n=(r)=>t.some((o)=>r.length>o.length&&o.every((s,i)=>r[i]===s));return(r,o,s)=>{if(!(r instanceof HTMLElement))return;let i=o.length===0&&s?.tagName?.includes("-");if(i)r.dataset.jxDefinitionRoot="";let a=!i&&r.tagName.includes("-")&&kn(e.canvasMode);if(a)r.contentEditable="false",t.push(o);let c=li(o,s,e);if(c.kind==="layout"){if(r.dataset.jxLayoutPath=J(c.layoutPath),c.layoutFile)r.dataset.jxLayoutFile=c.layoutFile;if(c.chrome){if(r.dataset.jxLayoutRegion="",kn(e.canvasMode))r.contentEditable="false"}return}if(r.dataset.jxPath=J(c.path),!a&&kn(e.canvasMode)&&n(o))r.contentEditable="true"}}function xi(e,t=3){let n=new WeakMap,r=(o)=>{let s=o.target;if(!(s instanceof HTMLImageElement))return;if(!s.src||s.src.startsWith("data:"))return;let i=(n.get(s)??0)+1;if(i>t)return;n.set(s,i),setTimeout(()=>{let a=s.src;s.src="",s.src=a},150*i)};return e.addEventListener("error",r,!0),()=>e.removeEventListener("error",r,!0)}async function yi(e){let t=e.assets??null;xn(t?(i)=>$t(i,t):null),Is(e.mode!=="preview"),js(e.mode!=="preview"&&!e.allowAutoRequests),Ks(!0),Us(e.mode!=="preview"),qs(e.mode!=="preview"),zs(e.mode!=="preview"),Ys(e.mode==="design"||e.mode==="edit"),Ir(e.siteStyle,e.doc.$media??{}),Lc(e.doc,t),Ac(e.container.ownerDocument,e.mode),Pc(e.container.ownerDocument,e.mode),Mc(e.container.ownerDocument,e.mode),Dc(e.container.ownerDocument,e.mode),$c(e.container.ownerDocument,Boolean(e.diffMarks?.length)),ai(e.doc.$media??{}),await kc(e.doc,e.docBase);let n=await yn(e.doc,{},e.docBase),r=jr(e.mapperCtx),{result:o,stop:s}=gn(()=>ue(e.doc,n,{_path:[],onNodeCreated:r}));return e.container.replaceChildren(o),_t(e.container,e.popoverOpen??null),et(e.container,e.dialogOpen??null),_c(e.container,e.mode),Nc(e.container,e.diffMarks??null),{ctx:{defs:n,docBase:e.docBase,mapperCtx:e.mapperCtx,mode:e.mode},dispose:s}}function Y(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function bi(e){return e.length>=2?e.slice(0,-2):null}function wi(e){return e.at(-1)}function Ei(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((n,r)=>n===t[r])}function tt(e,t){if(e.length>t.length)return!1;return e.every((n,r)=>n===t[r])}var Tn=14,Ic="empty-container-placeholder";function vi(e){let t=ne(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}function Jc(e){let t=getComputedStyle(e),{display:n}=t,r=n==="flex"||n==="inline-flex",o=n==="grid"||n==="inline-grid";return r&&t.flexDirection.startsWith("row")||o&&(t.gridAutoFlow??"").startsWith("column")}function Ti(e,t,n){let r=e.dataset?.jxPath;if(r==null)return null;let o=U(r);if(e.classList.contains(Ic))return[{edge:"center",index:0,insertParentPath:o,rect:vi(e)}];let s=bi(o);if(!s)return null;let i=e.parentElement;if(!i)return null;let a=wi(o);if(typeof a!=="number")return null;let c=vi(e);if(Jc(i)){let u=t.x-c.x;if(u<Tn)return[An("left",s,a,Si(c,!0))];if(c.width-u<Tn)return[An("right",s,a+1,ki(c,!0))];return null}let l=t.y-c.y;if(l<Tn)return[An("top",s,a,Si(c,!1))];if(c.height-l<Tn)return[An("bottom",s,a+1,ki(c,!1))];return null}function An(e,t,n,r){return{edge:e,index:n,insertParentPath:t,rect:r}}function Si(e,t){return t?{height:e.height,width:0,x:e.x,y:e.y}:{height:0,width:e.width,x:e.x,y:e.y}}function ki(e,t){return t?{height:e.height,width:0,x:e.x+e.width,y:e.y}:{height:0,width:e.width,x:e.x,y:e.y+e.height}}function Ai(e){if(!e||e.length===0)return"none";return e.map((t)=>`${t.edge}:${t.insertParentPath.join("/")}:${t.index}`).join("|")}var Hr={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Cn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function Pi(e,t){if(!t)return!1;if(t.contentEditable==="plaintext-only")return!1;let n=window.getSelection();if(!n||!n.rangeCount)return!1;let{anchorNode:r,focusNode:o}=n;if(!r||!o)return!1;if(!t.contains(r)||!t.contains(o))return!1;let s=(i)=>{let a=i;while(a&&a!==t){if(a.nodeType===Node.ELEMENT_NODE&&a.tagName.toLowerCase()===e)return!0;a=a.parentNode}return!1};return s(r)&&s(o)}function Ri(e,t){if(!t)return;let n=window.getSelection();if(!n||!n.rangeCount)return;let r=n.getRangeAt(0);if(r.collapsed)return;if(!t.contains(r.commonAncestorContainer))return;Xc(r);let o=Hc(e,r,t);if(o.length>0)Fc(e,r,t,o);else Wc(e,r,t);nt(t)}function Hc(e,t,n){let r=[],o=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(s){if(s.tagName.toLowerCase()===e&&t.intersectsNode(s))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}});while(o.nextNode())r.push(o.currentNode);return r}function Fc(e,t,n,r){for(let o=r.length-1;o>=0;o--){let s=r[o];$i(s)}}function $i(e){if(!e.parentNode)return;let n=document.createDocumentFragment();while(e.firstChild)n.append(e.firstChild);e.replaceWith(n)}function Wc(e,t,n){let r=t.extractContents(),o=Bc(r),s=Kc(r);if(!r.hasChildNodes()){if(o)t.insertNode(document.createTextNode(o));if(s){let l=document.createTextNode(s);t.collapse(!1),t.insertNode(l)}return}let i=document.createElement(e);i.append(r);let a=document.createDocumentFragment();if(o)a.append(document.createTextNode(o));if(a.append(i),s)a.append(document.createTextNode(s));t.insertNode(a);let c=window.getSelection();if(c){c.removeAllRanges();let l=document.createRange();l.selectNodeContents(i),c.addRange(l)}}function Bc(e){let t=e.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let n=t.textContent??"",r=n.match(/^(\s+)/);if(!r)return null;let o=r[1];if(n.length===o.length)t.remove();else t.textContent=n.slice(o.length);return o}function Kc(e){let t=e.lastChild;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let n=t.textContent??"",r=n.match(/(\s+)$/);if(!r)return null;let o=r[1];if(n.length===o.length)t.remove();else t.textContent=n.slice(0,-o.length);return o}function nt(e){if(!e)return;let t=!0,n=0;while(t&&n<10){if(t=!1,n+=1,e.normalize(),Vc(e))t=!0;if(Uc(e))t=!0;if(qc(e))t=!0;if(zc(e))t=!0;if(Gc(e))t=!0}}function Vc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode,s=o.nextSibling;if(s&&s.nodeType===Node.ELEMENT_NODE&&s.tagName===o.tagName&&Cn.has(o.tagName.toLowerCase())&&Yc(o,s))r.push([o,s])}for(let o=r.length-1;o>=0;o--){let[s,i]=r[o];while(i.firstChild)s.append(i.firstChild);i.remove(),t=!0}return t}function Uc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Cn.has(o.tagName.toLowerCase()))continue;if(o.childNodes.length===1&&o.firstChild!==null&&o.firstChild.nodeType===Node.ELEMENT_NODE&&o.firstChild.tagName===o.tagName)r.push(o)}for(let o of r){let s=o.firstChild;while(s.firstChild)s.before(s.firstChild);s.remove(),t=!0}return t}function qc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Cn.has(o.tagName.toLowerCase()))continue;if(o.childNodes.length===0&&!o.textContent)r.push(o)}for(let o of r)o.remove(),t=!0;return t}function zc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Cn.has(o.tagName.toLowerCase()))continue;if(o===e)continue;let s=o.firstChild;if(s&&s.nodeType===Node.TEXT_NODE){let a=s.textContent??"",c=a.match(/^(\s+)/);if(c&&a.length>c[1].length)r.push({el:o,type:"lift-leading",ws:c[1]})}let i=o.lastChild;if(i&&i.nodeType===Node.TEXT_NODE&&i!==s){let a=i.textContent??"",c=a.match(/(\s+)$/);if(c&&a.length>c[1].length)r.push({el:o,type:"lift-trailing",ws:c[1]})}}for(let o of r)if(o.type==="lift-leading"){let s=o.el.firstChild;s.textContent=(s.textContent??"").slice(o.ws.length),o.el.parentNode?.insertBefore(document.createTextNode(o.ws),o.el),t=!0}else if(o.type==="lift-trailing"){let s=o.el.lastChild;s.textContent=(s.textContent??"").slice(0,-o.ws.length),o.el.parentNode?.insertBefore(document.createTextNode(o.ws),o.el.nextSibling),t=!0}return t}function Gc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(o.tagName.toLowerCase()!=="span")continue;if(o===e)continue;if(o.attributes.length>0)continue;r.push(o)}for(let o of r)$i(o),t=!0;return t}function Yc(e,t){if(e.tagName.toLowerCase()==="a")return e.getAttribute("href")===t.getAttribute("href");return!0}function Xc(e){Ci(e,!0),Ci(e,!1)}function Ci(e,t){let n=t?e.startContainer:e.endContainer,r=t?e.startOffset:e.endOffset;if(n.nodeType!==Node.TEXT_NODE)return;let o=n.textContent??"",s=Zc(o);for(let i of s)if(t){if(r>i.start&&r<i.end)e.setStart(n,i.start)}else if(r>i.start&&r<i.end)e.setEnd(n,i.end)}function Zc(e){let t=[],n=0;while(n<e.length-1){if(e[n]==="$"&&e[n+1]==="{"){let r=n,o=1,s=n+2;while(s<e.length&&o>0){if(e[s]==="{")o+=1;else if(e[s]==="}")o-=1;s+=1}if(o===0){t.push({end:s,start:r}),n=s;continue}}n+=1}return t}var Qc=new Set(["pre"]),eu=new Set(Object.entries(Hr.$defs).filter(([e,t])=>!Qc.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));function Ni(e,t){return t?.[e.toLowerCase()]??eu.has(e.toLowerCase())}var tu={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Ne=tu;function Fr(e){Ne=e}var _=null,oe=null,rt=null,Ot=null,ot=null,$e=null,fe=!1,Lt="",Dt=!1,_i=null;function Oi(e){_i=e}function je(e){return Ni(e.tagName,_i)}function Wr(e,t,n,r){if(_)he(!0);if(_=e,oe=t,rt=n.onCommit,Ot=n.onSplit,ot=n.onInsert,$e=n.onEnd,fe=r?.plainText===!0,Lt=fe?e.textContent??"":"",Dt=!1,e.dataset.jxActiveBlock="",fe){try{e.contentEditable="plaintext-only"}catch{e.contentEditable="true"}e.focus()}e.addEventListener("keydown",Br),e.addEventListener("input",Kr),e.addEventListener("paste",Vr)}function he(e=!1){if(!_)return;if(Fi(!1),Ne.dismiss(),delete _.dataset.jxActiveBlock,fe)_.contentEditable="false";if(_.removeEventListener("keydown",Br),_.removeEventListener("input",Kr),_.removeEventListener("paste",Vr),_=null,oe=null,rt=null,Ot=null,ot=null,fe=!1,Lt="",Dt=!1,e)$e=null;else if($e){let t=$e;$e=null,t()}}function Di(){Fi(!0)}function Li(){return fe&&_!==null}function de(){return _!==null}function st(){return _}function Ii(){return oe}function Ji(){return Ne.isOpen()}function Br(e){if(fe){if(e.key==="Escape"){if(e.preventDefault(),e.stopPropagation(),_)_.textContent=Lt;he();return}if(e.key==="Enter"){e.preventDefault(),e.stopPropagation(),he();return}if((e.ctrlKey||e.metaKey)&&["b","i","u","`"].includes(e.key))e.preventDefault()}}function Kr(){if(Ne.isOpen())zr()}function Vr(e){e.preventDefault();let t=e.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,t)}function ji(){if(!Ot||!_||!oe)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0),n=document.createRange();n.setStart(_,0),n.setEnd(t.startContainer,t.startOffset);let r=document.createRange();r.setStart(t.endContainer,t.endOffset),r.setEnd(_,_.childNodes.length);let o=Mi(n.cloneContents()),s=Mi(r.cloneContents()),i=[...oe],a=Ot;return Hi(),a(i,o,s),!0}function Hi(){if(!_)return;if(delete _.dataset.jxActiveBlock,fe)_.contentEditable="false";if(_.removeEventListener("keydown",Br),_.removeEventListener("input",Kr),_.removeEventListener("paste",Vr),_=null,oe=null,rt=null,Ot=null,ot=null,fe=!1,Lt="",Dt=!1,$e){let e=$e;$e=null,e()}}function Fi(e){if(!rt||!_||!oe)return;if(fe){let n=(_.textContent??"").replaceAll(`
309
+ `;function Ic(e,t){let n=e.head.querySelector(`#${xi}`);if(t!=="stylebook"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=xi,r.textContent=Lc,e.head.append(r)}function Jr(e,t={}){let n=document.head.querySelector(`#${Ir}`);if(!e||typeof e!=="object"){n?.remove();return}let r=pi(e,t,dn);if(n){n.textContent=r;return}let o=document.createElement("style");o.id=Ir,o.textContent=r,document.head.append(o)}function jr(e,t){if(t)e.documentElement.dataset.colorScheme=t;else delete e.documentElement.dataset.colorScheme}function _t(e,t){for(let r of e.querySelectorAll("[data-jx-popover-open]"))delete r.dataset.jxPopoverOpen;if(t===null)return;let n=e.querySelector(`[data-jx-popover]${je(t)}`);if(n)n.dataset.jxPopoverOpen=""}function tt(e,t){for(let r of e.querySelectorAll("[data-jx-dialog-open]"))delete r.dataset.jxDialogOpen;if(t===null)return;let n=e.querySelector(`dialog${je(t)}`);if(n)n.dataset.jxDialogOpen=""}function Jc(e,t=null){let n=e.$head;if(!Array.isArray(n))return;for(let r of n){if(!r?.tagName)continue;let o=String(r.tagName).toLowerCase();if(o==="script"&&!r.attributes?.src)continue;let s={...r.attributes};for(let c of["href","src"]){let l=s[c];if(typeof l!=="string"||l==="")continue;if(!l.startsWith("/")&&!l.startsWith(".")&&!l.startsWith("http")){s[c]=`/node_modules/${l}`;continue}s[c]=$t(l,t)??l}let i=`${o}${s.href?`[href="${String(s.href)}"]`:""}${s.src?`[src="${String(s.src)}"]`:""}`;if(i!==o&&document.head.querySelector(i))continue;let a=document.createElement(o);for(let[c,l]of Object.entries(s))a.setAttribute(c,String(l));if(r.textContent)a.textContent=r.textContent;document.head.append(a)}}function Hr(e){let t=[],n=(r)=>t.some((o)=>r.length>o.length&&o.every((s,i)=>r[i]===s));return(r,o,s)=>{if(!(r instanceof HTMLElement))return;let i=o.length===0&&s?.tagName?.includes("-");if(i)r.dataset.jxDefinitionRoot="";let a=!i&&r.tagName.includes("-")&&Tn(e.canvasMode);if(a)r.contentEditable="false",t.push(o);let c=ci(o,s,e);if(c.kind==="layout"){if(r.dataset.jxLayoutPath=J(c.layoutPath),c.layoutFile)r.dataset.jxLayoutFile=c.layoutFile;if(c.chrome){if(r.dataset.jxLayoutRegion="",Tn(e.canvasMode))r.contentEditable="false"}return}if(r.dataset.jxPath=J(c.path),!a&&Tn(e.canvasMode)&&n(o))r.contentEditable="true"}}function yi(e,t=3){let n=new WeakMap,r=(o)=>{let s=o.target;if(!(s instanceof HTMLImageElement))return;if(!s.src||s.src.startsWith("data:"))return;let i=(n.get(s)??0)+1;if(i>t)return;n.set(s,i),setTimeout(()=>{let a=s.src;s.src="",s.src=a},150*i)};return e.addEventListener("error",r,!0),()=>e.removeEventListener("error",r,!0)}async function bi(e){let t=e.assets??null;yn(t?(i)=>$t(i,t):null),Ls(e.mode!=="preview"),Js(e.mode!=="preview"&&!e.allowAutoRequests),Bs(!0),Vs(e.mode!=="preview"&&e.mode!=="stylebook"),Us(e.mode!=="preview"),qs(e.mode!=="preview"),Gs(e.mode==="design"||e.mode==="edit"),Jr(e.siteStyle,e.doc.$media??{}),Jc(e.doc,t),Pc(e.container.ownerDocument,e.mode),$c(e.container.ownerDocument,e.mode),Oc(e.container.ownerDocument,e.mode),Ic(e.container.ownerDocument,e.mode),Mc(e.container.ownerDocument,Boolean(e.diffMarks?.length)),li(e.doc.$media??{}),await Ac(e.doc,e.docBase);let n=await bn(e.doc,{},e.docBase),r=Hr(e.mapperCtx),{result:o,stop:s}=xn(()=>de(e.doc,n,{_path:[],onNodeCreated:r}));return e.container.replaceChildren(o),_t(e.container,e.popoverOpen??null),tt(e.container,e.dialogOpen??null),Dc(e.container,e.mode),_c(e.container,e.diffMarks??null),{ctx:{defs:n,docBase:e.docBase,mapperCtx:e.mapperCtx,mode:e.mode},dispose:s}}function Z(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function wi(e){return e.length>=2?e.slice(0,-2):null}function Ei(e){return e.at(-1)}function vi(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((n,r)=>n===t[r])}function nt(e,t){if(e.length>t.length)return!1;return e.every((n,r)=>n===t[r])}var An=14,jc="empty-container-placeholder";function Si(e){let t=oe(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}function Hc(e){let t=getComputedStyle(e),{display:n}=t,r=n==="flex"||n==="inline-flex",o=n==="grid"||n==="inline-grid";return r&&t.flexDirection.startsWith("row")||o&&(t.gridAutoFlow??"").startsWith("column")}function Ai(e,t,n){let r=e.dataset?.jxPath;if(r==null)return null;let o=q(r);if(e.classList.contains(jc))return[{edge:"center",index:0,insertParentPath:o,rect:Si(e)}];let s=wi(o);if(!s)return null;let i=e.parentElement;if(!i)return null;let a=Ei(o);if(typeof a!=="number")return null;let c=Si(e);if(Hc(i)){let u=t.x-c.x;if(u<An)return[Cn("left",s,a,ki(c,!0))];if(c.width-u<An)return[Cn("right",s,a+1,Ti(c,!0))];return null}let l=t.y-c.y;if(l<An)return[Cn("top",s,a,ki(c,!1))];if(c.height-l<An)return[Cn("bottom",s,a+1,Ti(c,!1))];return null}function Cn(e,t,n,r){return{edge:e,index:n,insertParentPath:t,rect:r}}function ki(e,t){return t?{height:e.height,width:0,x:e.x,y:e.y}:{height:0,width:e.width,x:e.x,y:e.y}}function Ti(e,t){return t?{height:e.height,width:0,x:e.x+e.width,y:e.y}:{height:0,width:e.width,x:e.x,y:e.y+e.height}}function Ci(e){if(!e||e.length===0)return"none";return e.map((t)=>`${t.edge}:${t.insertParentPath.join("/")}:${t.index}`).join("|")}var Fr={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Pn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function Ri(e,t){if(!t)return!1;if(t.contentEditable==="plaintext-only")return!1;let n=window.getSelection();if(!n||!n.rangeCount)return!1;let{anchorNode:r,focusNode:o}=n;if(!r||!o)return!1;if(!t.contains(r)||!t.contains(o))return!1;let s=(i)=>{let a=i;while(a&&a!==t){if(a.nodeType===Node.ELEMENT_NODE&&a.tagName.toLowerCase()===e)return!0;a=a.parentNode}return!1};return s(r)&&s(o)}function $i(e,t){if(!t)return;let n=window.getSelection();if(!n||!n.rangeCount)return;let r=n.getRangeAt(0);if(r.collapsed)return;if(!t.contains(r.commonAncestorContainer))return;Qc(r);let o=Wc(e,r,t);if(o.length>0)Bc(e,r,t,o);else Kc(e,r,t);rt(t)}function Wc(e,t,n){let r=[],o=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(s){if(s.tagName.toLowerCase()===e&&t.intersectsNode(s))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}});while(o.nextNode())r.push(o.currentNode);return r}function Bc(e,t,n,r){for(let o=r.length-1;o>=0;o--){let s=r[o];Ni(s)}}function Ni(e){if(!e.parentNode)return;let n=document.createDocumentFragment();while(e.firstChild)n.append(e.firstChild);e.replaceWith(n)}function Kc(e,t,n){let r=t.extractContents(),o=Vc(r),s=Uc(r);if(!r.hasChildNodes()){if(o)t.insertNode(document.createTextNode(o));if(s){let l=document.createTextNode(s);t.collapse(!1),t.insertNode(l)}return}let i=document.createElement(e);i.append(r);let a=document.createDocumentFragment();if(o)a.append(document.createTextNode(o));if(a.append(i),s)a.append(document.createTextNode(s));t.insertNode(a);let c=window.getSelection();if(c){c.removeAllRanges();let l=document.createRange();l.selectNodeContents(i),c.addRange(l)}}function Vc(e){let t=e.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let n=t.textContent??"",r=n.match(/^(\s+)/);if(!r)return null;let o=r[1];if(n.length===o.length)t.remove();else t.textContent=n.slice(o.length);return o}function Uc(e){let t=e.lastChild;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let n=t.textContent??"",r=n.match(/(\s+)$/);if(!r)return null;let o=r[1];if(n.length===o.length)t.remove();else t.textContent=n.slice(0,-o.length);return o}function rt(e){if(!e)return;let t=!0,n=0;while(t&&n<10){if(t=!1,n+=1,e.normalize(),qc(e))t=!0;if(zc(e))t=!0;if(Gc(e))t=!0;if(Yc(e))t=!0;if(Xc(e))t=!0}}function qc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode,s=o.nextSibling;if(s&&s.nodeType===Node.ELEMENT_NODE&&s.tagName===o.tagName&&Pn.has(o.tagName.toLowerCase())&&Zc(o,s))r.push([o,s])}for(let o=r.length-1;o>=0;o--){let[s,i]=r[o];while(i.firstChild)s.append(i.firstChild);i.remove(),t=!0}return t}function zc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Pn.has(o.tagName.toLowerCase()))continue;if(o.childNodes.length===1&&o.firstChild!==null&&o.firstChild.nodeType===Node.ELEMENT_NODE&&o.firstChild.tagName===o.tagName)r.push(o)}for(let o of r){let s=o.firstChild;while(s.firstChild)s.before(s.firstChild);s.remove(),t=!0}return t}function Gc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Pn.has(o.tagName.toLowerCase()))continue;if(o.childNodes.length===0&&!o.textContent)r.push(o)}for(let o of r)o.remove(),t=!0;return t}function Yc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Pn.has(o.tagName.toLowerCase()))continue;if(o===e)continue;let s=o.firstChild;if(s&&s.nodeType===Node.TEXT_NODE){let a=s.textContent??"",c=a.match(/^(\s+)/);if(c&&a.length>c[1].length)r.push({el:o,type:"lift-leading",ws:c[1]})}let i=o.lastChild;if(i&&i.nodeType===Node.TEXT_NODE&&i!==s){let a=i.textContent??"",c=a.match(/(\s+)$/);if(c&&a.length>c[1].length)r.push({el:o,type:"lift-trailing",ws:c[1]})}}for(let o of r)if(o.type==="lift-leading"){let s=o.el.firstChild;s.textContent=(s.textContent??"").slice(o.ws.length),o.el.parentNode?.insertBefore(document.createTextNode(o.ws),o.el),t=!0}else if(o.type==="lift-trailing"){let s=o.el.lastChild;s.textContent=(s.textContent??"").slice(0,-o.ws.length),o.el.parentNode?.insertBefore(document.createTextNode(o.ws),o.el.nextSibling),t=!0}return t}function Xc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(o.tagName.toLowerCase()!=="span")continue;if(o===e)continue;if(o.attributes.length>0)continue;r.push(o)}for(let o of r)Ni(o),t=!0;return t}function Zc(e,t){if(e.tagName.toLowerCase()==="a")return e.getAttribute("href")===t.getAttribute("href");return!0}function Qc(e){Pi(e,!0),Pi(e,!1)}function Pi(e,t){let n=t?e.startContainer:e.endContainer,r=t?e.startOffset:e.endOffset;if(n.nodeType!==Node.TEXT_NODE)return;let o=n.textContent??"",s=eu(o);for(let i of s)if(t){if(r>i.start&&r<i.end)e.setStart(n,i.start)}else if(r>i.start&&r<i.end)e.setEnd(n,i.end)}function eu(e){let t=[],n=0;while(n<e.length-1){if(e[n]==="$"&&e[n+1]==="{"){let r=n,o=1,s=n+2;while(s<e.length&&o>0){if(e[s]==="{")o+=1;else if(e[s]==="}")o-=1;s+=1}if(o===0){t.push({end:s,start:r}),n=s;continue}}n+=1}return t}var tu=new Set(["pre"]),nu=new Set(Object.entries(Fr.$defs).filter(([e,t])=>!tu.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));function Mi(e,t){return t?.[e.toLowerCase()]??nu.has(e.toLowerCase())}var ru={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},_e=ru;function Wr(e){_e=e}var M=null,ie=null,ot=null,Ot=null,st=null,Me=null,pe=!1,Lt="",Dt=!1,Oi=null;function Di(e){Oi=e}function He(e){return Mi(e.tagName,Oi)}function Br(e,t,n,r){if(M)xe(!0);if(M=e,ie=t,ot=n.onCommit,Ot=n.onSplit,st=n.onInsert,Me=n.onEnd,pe=r?.plainText===!0,Lt=pe?e.textContent??"":"",Dt=!1,e.dataset.jxActiveBlock="",pe){try{e.contentEditable="plaintext-only"}catch{e.contentEditable="true"}e.focus()}e.addEventListener("keydown",Kr),e.addEventListener("input",Vr),e.addEventListener("paste",Ur)}function xe(e=!1){if(!M)return;if(Wi(!1),_e.dismiss(),delete M.dataset.jxActiveBlock,pe)M.contentEditable="false";if(M.removeEventListener("keydown",Kr),M.removeEventListener("input",Vr),M.removeEventListener("paste",Ur),M=null,ie=null,ot=null,Ot=null,st=null,pe=!1,Lt="",Dt=!1,e)Me=null;else if(Me){let t=Me;Me=null,t()}}function Li(){Wi(!0)}function Ii(){return pe&&M!==null}function me(){return M!==null}function it(){return M}function Ji(){return ie}function ji(){return _e.isOpen()}function Kr(e){if(pe){if(e.key==="Escape"){if(e.preventDefault(),e.stopPropagation(),M)M.textContent=Lt;xe();return}if(e.key==="Enter"){e.preventDefault(),e.stopPropagation(),xe();return}if((e.ctrlKey||e.metaKey)&&["b","i","u","`"].includes(e.key))e.preventDefault()}}function Vr(){if(_e.isOpen())Gr()}function Ur(e){e.preventDefault();let t=e.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,t)}function Hi(){if(!Ot||!M||!ie)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0),n=document.createRange();n.setStart(M,0),n.setEnd(t.startContainer,t.startOffset);let r=document.createRange();r.setStart(t.endContainer,t.endOffset),r.setEnd(M,M.childNodes.length);let o=_i(n.cloneContents()),s=_i(r.cloneContents()),i=[...ie],a=Ot;return Fi(),a(i,o,s),!0}function Fi(){if(!M)return;if(delete M.dataset.jxActiveBlock,pe)M.contentEditable="false";if(M.removeEventListener("keydown",Kr),M.removeEventListener("input",Vr),M.removeEventListener("paste",Ur),M=null,ie=null,ot=null,Ot=null,st=null,pe=!1,Lt="",Dt=!1,Me){let e=Me;Me=null,e()}}function Wi(e){if(!ot||!M||!ie)return;if(pe){let n=(M.textContent??"").replaceAll(`
310
310
  `," ");if(n===Lt.replaceAll(`
311
- `," ")&&!Dt)return;Dt=!0,rt(oe,null,n,e);return}nt(_);let t=Wi(_);rt(oe,t.children??null,t.textContent??null,e)}function nu(e){if(!Array.isArray(e.children)||e.children.length===0)return{textContent:""};let t=[];for(let n of e.children)if(typeof n==="string"&&t.length>0&&typeof t.at(-1)==="string")t[t.length-1]+=n;else t.push(n);if(t.every((n)=>typeof n==="string"))return{textContent:t.join("")};return{children:t}}function Wi(e){let t=e.childNodes;if(t.length===0)return{textContent:""};if(t.length===1&&t[0].nodeType===Node.TEXT_NODE)return{textContent:t[0].textContent};let n=[];for(let r of t){let o=Ur(r);if(o!==null&&o!==void 0)n.push(o)}return nu({children:n})}function Ur(e){if(e.nodeType===Node.TEXT_NODE){let a=e.textContent;if(!a)return null;return a}if(e.nodeType!==Node.ELEMENT_NODE)return null;let t=e,n=t.tagName.toLowerCase(),r={tagName:n},o={b:"strong",i:"em",s:"del",strike:"del"};if(o[n])r.tagName=o[n];let s=t.dataset.jxHref??t.getAttribute("href");if(n==="a"&&s!=null){if(r.attributes={href:s},t.title)r.attributes.title=t.title}if(n==="code")return r.textContent=t.textContent,r;let{childNodes:i}=t;if(i.length===0)r.textContent="";else if(i.length===1&&i[0].nodeType===Node.TEXT_NODE)r.textContent=i[0].textContent;else{r.children=[];for(let a of i){let c=Ur(a);if(c)r.children.push(c)}}return r}function Mi(e){let t=e.childNodes;if(t.length===0)return{textContent:""};if(t.length===1&&t[0].nodeType===Node.TEXT_NODE)return{textContent:t[0].textContent};let n=[];for(let r of t){let o=Ur(r);if(o)n.push(o)}if(n.length===1&&typeof n[0]!=="string"&&n[0].tagName==="span"&&typeof n[0].textContent==="string")return{textContent:n[0].textContent};return n.length>0?{children:n}:{textContent:""}}function Rn(e){let t=document.createRange();return t.setStart(_,0),t.setEnd(e.startContainer,e.startOffset),t.toString()}var Bi=0,Pn=!0;function qr(e){if(!_||!ot||!oe)return;if(fe)return;let t=window.getSelection();if(!t||!t.rangeCount)return;let n=t.getRangeAt(0);Pn=e?.anchored!==!1,Bi=Rn(n).length,Ne.show(_,"",{onSelect:Vi,...Pn?{}:{showFilter:!0}})}function Ki(e){if(e.key!=="/"||e.ctrlKey||e.metaKey||!_)return;let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=Rn(t.getRangeAt(0));if(n===""||n.endsWith(" ")||n.endsWith(`
312
- `))requestAnimationFrame(()=>qr())}function zr(){if(!_||!Pn)return;let e=window.getSelection();if(!e||!e.rangeCount){Ne.dismiss();return}let t=e.getRangeAt(0),n=Rn(t),r=n.lastIndexOf("/");if(r===-1||n.length<Bi-1){Ne.dismiss();return}let o=n.slice(r+1).toLowerCase();Ne.show(_,o,{onSelect:Vi})}function Vi(e){if(!_||!ot||!oe)return;let t=Pn?window.getSelection():null;if(t&&t.rangeCount){let s=t.getRangeAt(0),a=Rn(s).lastIndexOf("/");if(a!==-1){let c=document.createTreeWalker(_,NodeFilter.SHOW_TEXT),l=0,u=null,f=0;while(c.nextNode()){let d=c.currentNode;if(l+d.length>a){u=d,f=a-l;break}l+=d.length}if(u){let d=document.createRange();d.setStart(u,f),d.setEnd(s.startContainer,s.startOffset),d.deleteContents()}}}nt(_);let n=Wi(_),r=[...oe],o=ot;Hi(),o(r,e,n)}function ru(e,t){let{target:n}=e;return n===t||n===t.documentElement||n===t.body}function Gr(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function qi(e,t){let n=ne(e);return{path:U(t),rect:{height:n.height,width:n.width,x:n.x,y:n.y}}}function Ui(e){let t=Gr(e instanceof Element?e:null);if(!t)return null;return qi(t,t.dataset.jxPath)}function ou(e){let t=e.checkVisibility;return typeof t==="function"?t.call(e,{checkVisibilityCSS:!0}):!0}function zi(e,t=document){let n=[],r=[];for(let o of e){let s=t.querySelector(Je(J(o)));if(!s)continue;if(ou(s)){let i=ne(s);n.push({path:o,rect:{height:i.height,width:i.width,x:i.x,y:i.y}})}else r.push(o)}return{hidden:r,hits:n}}var su=new Set(["toggle","show","hide"]);function iu(e,t){if(!(e instanceof Element))return;let n=e.closest("[popovertarget]"),r=n?.getAttribute("popovertarget");if(!n||!r)return;let i=[...n.ownerDocument.querySelectorAll("[data-jx-popover]")].find((l)=>l.id===r)?.dataset.jxPath;if(!i)return;let a=n.getAttribute("popovertargetaction")??"toggle",c=su.has(a)?a:"toggle";t.post({action:c,kind:"popoverTargetClick",targetPath:U(i)})}function au(e,t){if(!(e instanceof Element))return;let n=e.closest("[data-jx-commandfor]"),r=n?.dataset.jxCommandfor,o=n?.getAttribute("command")?.trim().toLowerCase()??"";if(!n||!r||!o)return;let a=[...n.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((c)=>c.id===r)?.dataset.jxPath;if(!a)return;t.post({command:o,kind:"commandTargetClick",targetPath:U(a)})}function Gi(e,t=document,n){let r=null,o=null,s=n?.getGen?.()??0,i=()=>n?.getMode?.()==="preview",a=()=>{e.post({kind:"paneFocus"})},c=(x)=>{if(i()){if(x.target instanceof Element){let E=x.target.closest("a[href]")?.getAttribute("href");if(E&&!E.startsWith("#"))x.preventDefault(),e.post({href:E,kind:"previewNavigate"})}return}let v=Ui(x.target);if(v){let P=x;e.post({additive:P.ctrlKey===!0||P.metaKey===!0,hit:v,kind:"hit"})}iu(x.target,e),au(x.target,e)},l=(x)=>{if(i())return;let v=x?.dataset.jxPath??null;if(v===r)return;r=v,e.post({hit:x&&v?qi(x,v):null,kind:"hover"})},u=()=>{let x=n?.getGen?.()??s;if(x!==s)s=x,o="none"},f=(x,v)=>{if(!n||n.getMode?.()==="stylebook"||i())return;u();let P=n.getShadowDoc(),E=Gr(x instanceof Element?x:null),O=E&&P?Ti(E,v,P):null,M=Ai(O);if(M===o)return;o=M,e.post({kind:"insertZones",zones:O})},d=0,m=null,w=0,b=0,g=(x)=>t.defaultView?.requestAnimationFrame(x)??requestAnimationFrame(x),y=(x)=>t.defaultView?.cancelAnimationFrame(x)??cancelAnimationFrame(x),S=()=>{d=0;let x=m;m=null,l(Gr(x instanceof Element?x:null)),f(x,{x:w,y:b})},A=(x)=>{let v=x;if(m=x.target,w=v.clientX,b=v.clientY,d)return;d=g(S)},C=(x)=>{if(!ru(x,t))return;if(l(null),n&&!i()&&o!=="none")o="none",e.post({kind:"insertZones",zones:null})},T=(x)=>{let v=x;if(i())return;let P=de()?st():null;if(P&&x.target instanceof Node&&P.contains(x.target))return;let E=Ui(x.target);if(!E)return;x.preventDefault(),e.post({kind:"contextMenu",path:E.path,x:v.clientX,y:v.clientY})};return t.addEventListener("pointerdown",a,!0),t.addEventListener("click",c,!0),t.addEventListener("pointermove",A,!0),t.addEventListener("pointerleave",C,!0),t.addEventListener("contextmenu",T,!0),()=>{if(d)y(d),d=0;t.removeEventListener("pointerdown",a,!0),t.removeEventListener("click",c,!0),t.removeEventListener("pointermove",A,!0),t.removeEventListener("pointerleave",C,!0),t.removeEventListener("contextmenu",T,!0)}}var lu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function cu(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function Xr(e,t,n){let r=Ao(e,t,n);return cu(r)}function Zr(e,t,n,r){let o=e.dataset?.jxPath;if(o==null)return null;let s=U(o);if(s.length===0){let d=[...e.children];if(d.length===0)return Yr(r,s)?{edge:"inside",instruction:"make-child",referenceRect:He(e),targetPath:s}:null;return uu(d,t,s,r)}if(!Yr(r,s))return null;let i=Y(n,s),a=(xe(i?.tagName)||"div").toLowerCase(),c=Array.isArray(i?.children)&&i.children.some((d)=>d!=null&&typeof d==="object"),l=lu.has(a)||!c,u=He(e),f=u.height===0?0:(t-u.y)/u.height;if(l)return f<0.5?{edge:"top",instruction:"reorder-above",referenceRect:u,targetPath:s}:{edge:"bottom",instruction:"reorder-below",referenceRect:u,targetPath:s};if(f<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:u,targetPath:s};if(f>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:u,targetPath:s};return{edge:"inside",instruction:"make-child",referenceRect:u,targetPath:s}}function uu(e,t,n,r){let o=1/0,s="reorder-below",i=e.length-1;for(let c=0;c<e.length;c++){let l=He(e[c]),u=Math.abs(t-l.y),f=Math.abs(t-(l.y+l.height));if(u<o)o=u,s="reorder-above",i=c;if(f<o)o=f,s="reorder-below",i=c}let a=[...n,"children",i];if(!Yr(r,a))return null;return{edge:s==="reorder-above"?"top":"bottom",instruction:s,referenceRect:He(e[i]),targetPath:a}}function Yr(e,t){if(e.type!=="tree-node")return!0;let n=e.path;if(Ei(n,t))return!1;return!tt(n,t)}function He(e){let t=ne(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}var fu=40,Yi=12;function Qr(e,t,n=fu){if(e<n)return-1;if(e>t-n)return 1;return 0}var eo=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),to=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Xi=new Set(["deleteByCut","deleteContent"]),Zi=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),du="format",pu=new Set(["insertParagraph","insertLineBreak"]);function Qi(e){let{inputType:t,from:n,to:r}=e;if(t==="insertCompositionText"||t==="insertFromComposition")return{kind:"native"};if(t==="historyUndo"||t==="historyRedo")return{kind:"reject"};if(t.startsWith(du))return{kind:"reject"};if(t==="insertFromDrop"||t==="deleteByDrag")return{kind:"reject"};if(e.inPropHost)return pu.has(t)?{kind:"reject"}:{kind:"native"};if(!n||!r)return{kind:"reject"};let o=Mt(n,r)&&n.offset===r.offset,s=!Mt(n,r);if(t==="insertParagraph")return{from:n,kind:"split",to:r};if(t==="insertLineBreak"&&!s)return{kind:"native"};if(o&&eo.has(t)&&e.atBlockStart)return{at:n,kind:"mergeBackward"};if(o&&to.has(t)&&e.atBlockEnd)return{at:n,kind:"mergeForward"};if(s){if(Zi.has(t)||t==="insertLineBreak")return{from:n,kind:"replaceRange",text:e.data,to:r};if(eo.has(t)||to.has(t)||Xi.has(t))return{from:n,kind:"replaceRange",text:"",to:r};return{kind:"reject"}}if(Zi.has(t)||eo.has(t)||to.has(t)||Xi.has(t))return{kind:"native"};return{kind:"native"}}var mu=500;function $n(e,t){let n=e.ownerDocument.getSelection();if(!n||n.rangeCount===0||!n.anchorNode||!n.focusNode)return null;if(!e.contains(n.anchorNode)||!e.contains(n.focusNode))return null;let r=Nt(n.anchorNode,n.anchorOffset,t),o=Nt(n.focusNode,n.focusOffset,t);return r&&o?{anchor:r,head:o}:null}function It(e,t){let n=Or(e,t.anchor),r=Or(e,t.head)??n;if(!n)return!1;let o=e.ownerDocument.getSelection();if(!o)return!1;let s=e.ownerDocument.createRange();if(s.setStart(n.node,n.offset),o.removeAllRanges(),o.addRange(s),r&&r!==n)o.extend(r.node,r.offset);return!0}function ea(e,t){let n=e.ownerDocument,r=null,o=null,s=()=>{let T=t.getMode?.();return T===void 0||T==="design"||T==="edit"},i=0,a=()=>{if(i)clearTimeout(i),i=0},c=()=>{if(i=0,!r||!t.onCommitTick)return;let T=$n(e,t.isEditableBlock);if(t.onCommitTick(),T)It(e,T)},l=!1,u=()=>{if(!t.onCommitTick||!r||l)return;a(),i=setTimeout(c,t.commitDelayMs??mu)},f=()=>{l=!0,a()},d=()=>{l=!1,u()},m=()=>{a(),r=null,o=null},w=()=>{if(!r)return;a(),r=null,o=null,t.onDeactivate()},b=()=>{if(!s()){w();return}let x=n.getSelection()?.focusNode??null;if(!x)return;if(!e.contains(x)){w();return}let v=vn(x,t.isEditableBlock);if(!v){if(r?.contains(x)){t.onSelectionChange?.();return}w();return}let P=J(v.path);if(P===o){t.onSelectionChange?.();return}w(),r=v.el,o=P,t.onActivate(v.el,v.path)},g=(T)=>{let[x]=typeof T.getTargetRanges==="function"?T.getTargetRanges():[],v=n.getSelection(),P=v&&v.rangeCount>0&&(v.isCollapsed||!x),E,O,M,h;if(P)({startContainer:E,startOffset:O,endContainer:M,endOffset:h}=v.getRangeAt(0));else if(x)({startContainer:E,startOffset:O,endContainer:M,endOffset:h}=x);else return null;let k=Nt(E,O,t.isEditableBlock),R=Nt(M,h,t.isEditableBlock),N=vn(M,t.isEditableBlock);return k&&R&&N?{endEl:N.el,from:k,to:R}:null},y=(T)=>{let x=T;if(!s())return;let v=g(x),P=Qi({atBlockEnd:v?v.to.offset>=_r(v.endEl):!1,atBlockStart:v?ui(v.from):!1,data:x.data??"",from:v?.from??null,inPropHost:r!==null&&o===null,inputType:x.inputType,to:v?.to??null});switch(P.kind){case"native":return;case"split":{if(x.preventDefault(),!Mt(P.from,P.to)&&!t.onReplaceRange)return;t.onSplit?.();return}case"mergeBackward":{x.preventDefault(),t.onMergeBackward?.(P.at);return}case"mergeForward":{x.preventDefault(),t.onMergeForward?.(P.at);return}case"replaceRange":{x.preventDefault(),t.onReplaceRange?.(P.from,P.to,P.text);return}default:x.preventDefault()}},S=(T)=>{if(!s()||!t.onPropActivate)return;let x=T.target instanceof Element?T.target:null;while(x&&x!==e){if(x.dataset?.jxBoundProp){if(x!==r){if(w(),t.onPropActivate(x))r=x,o=null}return}if(x.dataset?.jxPath)return;x=x.parentElement}},A=(T)=>{T.preventDefault()},C=()=>u();return n.addEventListener("selectionchange",b),e.addEventListener("beforeinput",y),e.addEventListener("input",C),e.addEventListener("compositionstart",f),e.addEventListener("compositionend",d),e.addEventListener("dragstart",A),n.addEventListener("pointerdown",S,!0),{capture:()=>$n(e,t.isEditableBlock),forget:m,isComposing:()=>l,flush:()=>{if(l)return;if(i)a(),c()},placeCaret:(T)=>{let x=It(e,{anchor:T,head:T});if(x)b();return x},restore:(T)=>{let x=It(e,T);if(x)b();return x},stop:()=>{n.removeEventListener("selectionchange",b),e.removeEventListener("beforeinput",y),e.removeEventListener("input",C),e.removeEventListener("compositionstart",f),e.removeEventListener("compositionend",d),e.removeEventListener("dragstart",A),n.removeEventListener("pointerdown",S,!0),w()},sync:b}}var ta=(e,t)=>document.execCommand(e,!1,t);function na(e){let t=window.getSelection();if(!t||!t.rangeCount)return{active:!1,href:null};let n=t.anchorNode;while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()==="a"){let r=n;return{active:!0,href:r.dataset.jxHref??r.getAttribute("href")}}n=n.parentNode}return{active:!1,href:null}}function hu(e){let t=window.getSelection();if(!t||!t.rangeCount)return null;let n=t.anchorNode;while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()==="a")return n;n=n.parentNode}return null}function ra(e,t){let n=hu(e);if(n)if(t)n.setAttribute("href",t);else{let r=document.createDocumentFragment();while(n.firstChild)r.append(n.firstChild);n.replaceWith(r)}else if(t)ta("createLink",t);nt(e)}function oa(e,t){e.focus(),ta("insertText",`\${${t}}`)}var Nn=new Set(["img","video","source","iframe","audio"]),Mn="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",gu="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E",xu=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function yu(e){return xu.test(e)}var bu=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),wu=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),sa=["empty-text-placeholder","empty-container-placeholder"];function no(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(bu.has(xe(e.tagName)))return"empty-text-placeholder";if(wu.has(xe(e.tagName)))return"empty-container-placeholder";return null}function Jt(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function ia(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);while(t.nextNode()){let n=t.currentNode;if(n.data.includes("❪"))n.data=n.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function Eu(e){let t=e.map;return{children:t&&typeof t==="object"?[Se(t)]:[],className:"repeater-perimeter",tagName:"div"}}function Se(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>Se(i));if(e.$prototype==="Array")return Eu(e);let t=e,n={},r=!1,o=Nn.has(t.tagName||"");if(o){let{attributes:i,src:a}=t,c=i?.src,l=t.poster,u=i?.poster;if(!(a&&a!==""||c&&c!=="")&&!(l&&l!==""||u&&u!==""))r=!0}for(let[i,a]of Object.entries(t))if(i==="state"||i==="$media"||i==="$elements")n[i]=a;else if(i==="$props"&&a&&typeof a==="object"){let c={};for(let[l,u]of Object.entries(a))if(typeof u==="string"&&u.includes("${"))if(yu(l))c[l]=gu;else if(l==="href"||l==="action")c[l]="";else c[l]=Jt(u);else if(u&&typeof u==="object"&&u.$ref){let f=u.$ref,d=f.startsWith("#/state/")?f.slice(8):f;c[l]=`{${d}}`}else c[l]=u;n[i]=c}else if(i==="children")if(Array.isArray(a))n.children=a.map((c)=>Se(c));else if(a&&typeof a==="object"&&a.$prototype==="Array")n.children=[Se(a)];else n.children=Se(a);else if(i==="cases"&&t.$switch&&a&&typeof a==="object"){let c=Object.keys(a);if(c.length>0){let l=a[c[0]];n.children=l&&typeof l==="object"&&!l.$ref?[Se(l)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${c.join(" | ")}]`}]}}else if(i==="attributes"&&o&&a&&typeof a==="object"){let c=a,l={};for(let[u,f]of Object.entries(c))if(u==="src"||u==="poster")if(typeof f==="string"&&f!==""&&!f.includes("${"))l[u]=f;else r=!0,l[u]=Mn;else if(typeof f==="string"&&f.includes("${")){let d=u==="href"||u==="action";l[u]=d?"":Jt(f)}else if(f&&typeof f==="object"&&f.$ref){let d=f.$ref,m=d.startsWith("#/state/")?d.slice(8):d;l[u]=`{${m}}`}else l[u]=f;n.attributes=l}else if(i==="style")if(a&&typeof a==="object"){let c={};for(let[l,u]of Object.entries(a))if(typeof u!=="string"||!u.includes("${"))c[l]=u;n.style=c}else n.style=a;else if(typeof a==="string"&&a.includes("${"))if((i==="src"||i==="poster")&&Nn.has(t.tagName||""))r=!0,n[i]=Mn;else{let l=i==="src"||i==="href"||i==="poster"||i==="action";n[i]=l?"":Jt(a)}else if(a&&typeof a==="object"&&a.$ref){let c=a.$ref,l=c.startsWith("#/state/")?c.slice(8):c;if((i==="src"||i==="poster")&&Nn.has(t.tagName||""))r=!0,n[i]=Mn;else n[i]=`{${l}}`}else if((i==="src"||i==="poster")&&a===""&&Nn.has(t.tagName||""))r=!0,n[i]=Mn;else n[i]=Se(a);let s=no(n);if(s)n.className=n.className?`${n.className} ${s}`:s;if(r){let i=n.className||"";if(!i.includes("empty-media-placeholder"))n.className=i?`${i} empty-media-placeholder`:"empty-media-placeholder"}return n}var vu={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Su=["strong","em","u","del","sub","sup","code"],_n="jx-pending-format",aa="jx-pending-format-style";function ku(e){let t=e.parentElement;while(t){if(t.tagName.includes("-"))return t;t=t.parentElement}return null}function Tu(e,t){if(!e)return!1;let n=e.attributes;if(n){if(n[`props.${t}`]!==void 0)return!0;let r=new Set([t.toLowerCase(),on(t).toLowerCase()]);for(let[s,i]of Object.entries(n))if(i!==void 0&&r.has(s.toLowerCase()))return!0;let o=n["data-jx-props"];if(typeof o==="string"&&Au(o,t))return!0}if(Pt.has(t)||t.startsWith("$"))return!1;return e[t]!==void 0}function Au(e,t){try{let n=JSON.parse(e);return typeof n==="object"&&n!==null&&t in n}catch{return!1}}function la(e,t){let r=J(t).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),o=e.querySelector(`[data-jx-path='${r}']`);return o instanceof HTMLElement?o:null}function Cu(e){return{height:e.height,width:e.width,x:e.x,y:e.y}}function ca(e,t,n){let r=t.ownerDocument,o=()=>{let h=n?.getMode?.();return h===void 0||h==="design"||h==="edit"},s=null,i=0,a=(h)=>{let k=window.getSelection();if(!k||!k.rangeCount)return null;let R=k.getRangeAt(0);return h.contains(R.commonAncestorContainer)?R:null},c=()=>{let h=st();if(!h)return;let k=a(h);if(k&&!k.collapsed)s=k.cloneRange()},l=()=>{if(r.querySelector(`#${aa}`))return;let h=r.createElement("style");h.id=aa,h.textContent=`::highlight(${_n}) { background-color: Highlight; color: HighlightText; }`,r.head.append(h)},u=()=>{let h=globalThis.Highlight,k=globalThis.CSS?.highlights;if(!h||!k)return;if(s&&s.startContainer.isConnected)l(),k.set(_n,new h(s.cloneRange()));else k.delete(_n)},f=()=>{globalThis.CSS?.highlights?.delete(_n)},d=()=>{let h=st();if(!h||!h.dataset.jxPath)return null;let k=a(h),R=k??s,N=R?Cu(To(R)):null,B=k?k.collapsed:!0,se=Su.filter((ee)=>Pi(ee,h)),Q=na(h);if(Q.active)se.push("a");return i+=1,{activeTags:se,collapsed:B,kind:"selectionChanged",link:Q,localScope:null,path:U(h.dataset.jxPath),rect:N,seq:i}},m=()=>{if(!de())return;c(),u();let h=d();if(h)e.post(h)},w=(h,k)=>{ia(h),e.post({kind:"editStart",path:k}),Wr(h,k,{onCommit:(R,N,B,se)=>e.post({children:N,kind:"editCommit",path:R,textContent:B,...se?{inPlace:!0}:{}}),onEnd:()=>{f(),s=null,e.post({kind:"editEnd"})},onInsert:(R,N,B)=>e.post({cmd:N,commitData:B,kind:"editInsert",path:R}),onSplit:(R,N,B)=>e.post({after:B,before:N,kind:"editSplit",path:R})}),c(),m()},b=(h,k)=>{let R=n?.getShadowDoc?.();if(!R)return!0;let N=Y(R,h);if(Tu(N,k))return!1;let B=N?.$props?.[k];if(B==null)return!0;if(typeof B!=="string")return!1;return!B.includes("${")},g=(h,k,R)=>{e.post({kind:"editStart",path:k,prop:R}),Wr(h,k,{onCommit:(N,B,se,Q)=>e.post({kind:"editCommitProp",path:N,prop:R,value:se??"",...Q?{inPlace:!0}:{}}),onEnd:()=>{f(),s=null,P.forget(),e.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},y=(h)=>{let k=st();if(!k)return;if(Li())return;if(s&&s.startContainer.isConnected&&k.contains(s.commonAncestorContainer)){let R=window.getSelection();k.focus(),R?.removeAllRanges(),R?.addRange(s)}if(h.command==="link")ra(k,h.href);else if(h.command==="insertData")oa(k,h.token);else{let R=vu[h.command];if(R)Ri(R,k)}c(),m()},S=(h)=>{let k=h.dataset.jxBoundProp,R=ku(h),N=R?.dataset.jxPath;if(!k||!R||!N)return!1;let B=U(N);if(!b(B,k))return!1;return g(h,B,k),!0},A=(h,k)=>{let R=fi(t,h,k,je);if(!R)return!1;let[N,B]=k===-1?[h,R.path]:[R.path,h];return P.flush(),e.post({fromPath:N,intoPath:B,kind:"editMerge"}),!0},C=(h,k,R)=>{let N=Dr(t,je),B=J(h.path),se=J(k.path),Q=N.findIndex((ke)=>ke.dataset.jxPath===B),ee=N.findIndex((ke)=>ke.dataset.jxPath===se);if(Q===-1||ee===-1||ee<=Q)return!1;let We=N.slice(Q+1,ee).map((ke)=>U(ke.dataset.jxPath));return P.flush(),e.post({between:We,from:h,kind:"editRangeReplace",text:R,to:k}),!0},T=()=>c(),x=()=>c(),v=()=>c(),P=ea(t,{getMode:()=>n?.getMode?.()??"edit",isEditableBlock:je,onActivate:(h,k)=>w(h,k),onDeactivate:()=>{if(de())he()},onCommitTick:()=>Di(),onMergeBackward:(h)=>A(h.path,-1),onMergeForward:(h)=>A(h.path,1),onReplaceRange:(h,k,R)=>C(h,k,R),onPropActivate:S,onSelectionChange:()=>m(),onSplit:()=>ji()}),E=(h)=>Ki(h),O=()=>{if(Ji())zr()};t.addEventListener("keydown",E),t.addEventListener("input",O),r.addEventListener("mouseup",T,!0),r.addEventListener("keyup",x,!0),r.addEventListener("blur",v,!0);let M=e.onMessage((h)=>{if(h.kind==="applyFormat"){y(h.intent);return}if(h.kind==="openSlash"){qr({anchored:!1});return}if(h.kind==="flushEdits"){P.flush(),e.post({kind:"flushComplete",reqId:h.reqId});return}if(h.kind==="endEdit"){if(de())he();return}if(h.kind!=="enterEdit")return;if(!o())return;if(h.prop!==void 0){let N=la(t,h.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(h.prop)}"]`);if(N)S(N);return}let k=la(t,h.path);if(k&&je(k))P.placeCaret({offset:h.offset??0,path:h.path})});return()=>{if(t.removeEventListener("keydown",E),t.removeEventListener("input",O),r.removeEventListener("mouseup",T,!0),r.removeEventListener("keyup",x,!0),r.removeEventListener("blur",v,!0),P.stop(),M(),f(),s=null,de())he()}}var Pu=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function ua(e,t){let n=!1,r=null,o=null,s={dismiss:()=>{if(!n)return;n=!1,o=null,e.post({kind:"slashDismiss"})},isOpen:()=>n,show:(l,u,f)=>{if({onSelect:r}=f,n&&u===o)return;n=!0,o=u;let d=ne(l);e.post({filter:u,kind:"slashShow",rect:{height:d.height,width:d.width,x:d.left,y:d.top},...f.showFilter===!0?{showFilter:!0}:{}})}};Fr(s);let i=(l)=>{if(!n||!Pu.has(l.key))return;l.preventDefault(),l.stopPropagation(),e.post({key:l.key,kind:"slashNav"})},a=()=>{if(n)s.dismiss()};t.addEventListener("keydown",i,!0),t.addEventListener("mousedown",a,!0);let c=e.onMessage((l)=>{if(l.kind==="slashSelect"){n=!1,o=null,r?.({...l.cmd});return}if(l.kind==="slashDismissed")n=!1,o=null});return()=>{t.removeEventListener("keydown",i,!0),t.removeEventListener("mousedown",a,!0),c(),Fr({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var fa=["global","canvas","caret","grid","code","dock","palette"];var pp={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var Ru=["mod","ctrl","alt","shift"],$u={mod:"mod",cmd:"mod",command:"mod",meta:"mod",super:"mod",ctrl:"ctrl",control:"ctrl",alt:"alt",opt:"alt",option:"alt",shift:"shift"},Nu={up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",esc:"escape",space:" ",spacebar:" ",del:"delete",plus:"=",return:"enter"};function Mu(e){return[...Ru.filter((n)=>e[n]),e.key].join("+")}function _u(e){return/^Digit(\d)$/.exec(e??"")?.[1]}function da(e,t){let n=_u(e.code)??e.key.toLowerCase();if($u[n])return"";let r={mod:t?e.metaKey:e.ctrlKey,ctrl:t?e.ctrlKey:!1,alt:e.altKey,shift:e.shiftKey,key:Nu[n]??n};return Mu(r)}var gp=["global",...fa.filter((e)=>e!=="global"&&e!=="palette")];var Ou=["caret","global"],Du=["canvas","global"],Lu=["global"],On={chords:[],mac:!1};function Iu(e){if(!(e instanceof HTMLElement))return!1;return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"}function Ju(e,t){if(e)return Ou;return t==="preview"?Lu:Du}function ju(e,t=On,n=!1,r="design"){if(Iu(e.target))return!1;let o=da(e,t.mac);if(!o)return!1;let s=Ju(n,r);return t.chords.some((i)=>i.chord===o&&s.includes(i.scope))}function Hu(e){return{altKey:e.altKey,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}}function pa(e,t=document,n=()=>!1,r=()=>On,o=()=>"design"){let s=(i)=>{if(!ju(i,r(),n(),o()))return;i.preventDefault(),e.post({event:Hu(i),kind:"forwardKey"})};return t.addEventListener("keydown",s,!0),()=>t.removeEventListener("keydown",s,!0)}function Fu(e){return JSON.parse(JSON.stringify(e))}function Dn(e){return e===void 0||e===null?e:Fu(e)}function it(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function at(e){if(Array.isArray(e))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!e.children)e.children=[];if(!Array.isArray(e.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return e.children}function ro(e,t){switch(t.op){case"set-key":{let n=it(e,t.path);if(!n)throw Error(`doc-op-node-not-found:${t.path.join("/")}`);let r=n;if(t.value===void 0)delete r[t.key];else r[t.key]=Dn(t.value);return}case"insert-child":{let n=it(e,t.parentPath);at(n).splice(t.index,0,Dn(t.node));return}case"remove-child":{let n=it(e,t.parentPath);at(n).splice(t.index,1);return}case"set-child":{let n=it(e,t.parentPath);at(n).splice(t.index,1,Dn(t.node));return}case"move-child":{Wu(t);let n=it(e,t.fromParentPath),r=it(e,t.toParentPath),o=at(n),s=at(r),[i]=o.splice(t.fromIndex,1);s.splice(t.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${t.op}`)}function Wu(e){let t=[...e.fromParentPath,"children",e.fromIndex],n=e.toParentPath;if(n.length>=t.length&&t.every((r,o)=>r===n[o]))throw Error(`doc-op-move-into-self:${n.join("/")}`)}function lt(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((n)=>lt(n));let t={};for(let[n,r]of Object.entries(e)){if(n.startsWith("on")&&Po(r))continue;if(n==="children")t.children=Array.isArray(r)?r.map((o)=>lt(o)):lt(r);else if(n==="cases"&&typeof r==="object"){let o={};for(let[s,i]of Object.entries(r))o[s]=lt(i);t.cases=o}else if(n==="state"&&typeof r==="object"&&r!==null){let o={};for(let[s,i]of Object.entries(r)){if(i&&typeof i==="object"&&i.timing==="server")continue;o[s]=i}t.state=o}else if(n==="style"||n==="attributes"||n==="$media")t[n]=r;else t[n]=r}return t}var oo=new WeakMap,Ln=new Set;function so(e,t,n){let r=Y(e,t);if(r===void 0)throw Error(`iframe-patch-node-not-found:${t.join("/")}`);let o=typeof r==="string"?r:Se(lt(r)),{result:s,stop:i}=gn(()=>ue(o,n.defs,{_path:Bu(t,n),onNodeCreated:jr(n.mapperCtx)}));if(Ln.add(i),s instanceof HTMLElement)oo.set(s,i);return s}function io(e){let t=[e,...e.querySelectorAll("*")];for(let n of t){if(!(n instanceof HTMLElement))continue;pn(n);let r=oo.get(n);if(r)r(),Ln.delete(r),oo.delete(n)}}function ma(){for(let e of Ln)e();Ln.clear()}function Bu(e,t){let{mapperCtx:n}=t;if(n.layoutWrapped&&n.pageContentPrefix&&e[0]==="children"){let[,r]=e;return typeof r==="number"?[...n.pageContentPrefix,r+(n.pageContentOffset??0),...e.slice(2)]:[...n.pageContentPrefix,...e.slice(1)]}return e}function xa(e,t,n,r,o){for(let i of t)ro(e,i);if(!o?.length){for(let i of t)ha(e,i,n,r);return}let s=new Set(o.map((i)=>J(i)));for(let i of t){if(i.op==="set-key"&&s.has(J(i.path))){Ku(e,i.path,n);continue}ha(e,i,n,r)}}function Ku(e,t,n){let r=wa(n,t);if(r)ct(r,Y(e,t))}function ao(e){if(!e)throw Error("iframe-patch-no-render-ctx");return e}function ha(e,t,n,r){switch(t.op){case"set-key":{if(t.key==="style"){Gu(e,t.path,n,r);return}if(t.key==="textContent"){Yu(e,t.path,n);return}if(t.key.startsWith("on"))return;ga(e,t.path,n,ao(r));return}case"insert-child":{Vu(e,t.parentPath,t.index,n,ao(r));return}case"set-child":{ga(e,[...t.parentPath,"children",t.index],n,ao(r));return}case"remove-child":{Uu(e,t.parentPath,t.index,n);return}case"move-child":{qu(e,t.fromParentPath,t.fromIndex,t.toParentPath,t.toIndex,n);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(t)}`)}}function Vu(e,t,n,r,o){let s=Fe(r,t),i=Y(e,t),a=so(e,[...t,"children",n],o);In(r,t,n,1),ya(s,a,ba(s,i,n)),ct(s,i)}function ga(e,t,n,r){let o=Fe(n,t),s=so(e,t,r);io(o),o.replaceWith(s)}function Uu(e,t,n,r){let o=Fe(r,[...t,"children",n]),s=o.parentElement;if(io(o),o.remove(),In(r,t,n+1,-1),s)ct(s,Y(e,t))}function qu(e,t,n,r,o,s){let i=[...t,"children",n],a=Fe(s,i),c=a.parentElement,l=Fe(s,r);a.remove(),In(s,t,n+1,-1);let u=Jn(l)??r;In(s,u,o,1),zu(a,i,[...u,"children",o]);let f=Y(e,u);if(ya(l,a,ba(l,f,o)),c)ct(c,Y(e,Jn(c)??t));ct(l,f)}function ct(e,t){for(let r of sa)e.classList.remove(r);let n=t?no(t):null;if(n)e.classList.add(n)}function ya(e,t,n){if(n)n.before(t);else e.append(t)}function ba(e,t,n){let r=t?.textContent,o=r!=null&&String(r)!==""?1:0;return e.childNodes[o+n]??null}function In(e,t,n,r){let o=t.length;for(let s of e.querySelectorAll("[data-jx-path]")){let i=Jn(s);if(!i||i.length<o+2||i[o]!=="children")continue;let a=i[o+1];if(typeof a!=="number"||a<n)continue;if(!t.every((l,u)=>i[u]===l))continue;let c=[...i];c[o+1]=a+r,s.dataset.jxPath=J(c)}}function zu(e,t,n){let r=[e,...e.querySelectorAll("[data-jx-path]")];for(let o of r){let s=Jn(o);if(!s||s.length<t.length||!t.every((i,a)=>s[a]===i))continue;o.dataset.jxPath=J([...n,...s.slice(t.length)])}}function Jn(e){let t=e.dataset.jxPath;return t===void 0?null:U(t)}function Gu(e,t,n,r){let o=Fe(n,t),s=Y(e,t),i=r?.defs?.$media??{};wn(o,Xu(s?.style),i)}function Yu(e,t,n){let r=Fe(n,t),o=Y(e,t);r.textContent=Zu(o),ct(r,o)}function Fe(e,t){let n=wa(e,t);if(!n)throw Error(`iframe-patch-element-not-found:${J(t)}`);return n}function wa(e,t){let r=J(t).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),o=e.querySelector(`[data-jx-path='${r}']`);return o instanceof HTMLElement?o:null}function Xu(e){if(!e||typeof e!=="object")return;let t={};for(let[n,r]of Object.entries(e)){if(typeof r==="string"&&r.includes("${"))continue;t[n]=r}return t}function Zu(e){let t=e?.textContent;if(t==null)return"";if(typeof t==="string")return t.includes("${")?Jt(t):t;if(typeof t==="object"&&t.$ref){let n=String(t.$ref);return`{${n.startsWith("#/state/")?n.slice(8):n}}`}return String(t)}function Ea(e){if(e===void 0)return"undefined";let t;try{t=typeof e==="string"?JSON.stringify(e):JSON.stringify(e)??"undefined"}catch{t=String(e)}if(t.length>48)t=`${t.slice(0,47)}…`;return t}function Qu(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&"$expression"in e&&Array.isArray(e.parameters)}function ef(e,t){let n={};for(let r of Object.keys(e))try{let o=e[r];if(typeof o==="function"){if(Qu(t?.[r]))n[r]=o;continue}let s=JSON.stringify(o);n[r]=s===void 0?null:JSON.parse(s)}catch{n[r]=null}return n}function tf(e,t,n){if(!n||n.length===0)return e;let r=t,o=e;for(let s of n){if(!r||typeof r!=="object")break;let i=r;if(i.$prototype==="Array"&&s==="map"){let a=i.items,c=a&&typeof a==="object"&&"$ref"in a?G(a.$ref,o):a;if(Array.isArray(c)&&c.length>0){let l;try{l=structuredClone(c[0])}catch{l=null}let u=Object.create(o);u.$map={index:0,item:l},u["$map/item"]=l,u["$map/index"]=0,o=u}}r=i[s]}return o}function va(e,t,n,r){let o=n&&typeof n==="object"?n.state??null:null;return e.map(({id:s,node:i})=>{let a=new Map,c;try{c=tf(ef(t,o),n,r)}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[]}}try{if(!i||typeof i!=="object"||!("operator"in i))throw Error("not an expression node");return Z(i,c,null,void 0,{report:(l,u)=>a.set(l.join("/"),Ea(u))}),{id:s,values:[...a.entries()]}}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[...a.entries()]}}})}function Sa(e){let t={};for(let n of Object.keys(e))try{let r=e[n];if(typeof r==="function")continue;let o=JSON.stringify(r);if(o===void 0){t[n]=null;continue}if(o.length>256000){t[n]="[large value omitted]";continue}t[n]=JSON.parse(o)}catch{t[n]=null}return t}var ka={"jx-ui:/behaviors/color-area.ts":()=>(K("jqhna8zy"),import("./chunks/color-area-jqhna8zy.js")),"jx-ui:/behaviors/color-field.ts":()=>(K("embq5ctg"),import("./chunks/color-field-embq5ctg.js")),"jx-ui:/behaviors/color-slider.ts":()=>(K("1qmw7wqy"),import("./chunks/color-slider-1qmw7wqy.js")),"jx-ui:/behaviors/combobox.ts":()=>(K("773hdzyj"),import("./chunks/combobox-773hdzyj.js")),"jx-ui:/behaviors/dialog.ts":()=>(K("mtm9fq5t"),import("./chunks/dialog-mtm9fq5t.js")),"jx-ui:/behaviors/listbox.ts":()=>(K("s8fkmnq8"),import("./chunks/listbox-s8fkmnq8.js")),"jx-ui:/behaviors/menu.ts":()=>(K("37d07z9m"),import("./chunks/menu-37d07z9m.js")),"jx-ui:/behaviors/number-field.ts":()=>(K("gw7sq8rn"),import("./chunks/number-field-gw7sq8rn.js")),"jx-ui:/behaviors/action-group.ts":()=>(K("2mqby73c"),import("./chunks/action-group-2mqby73c.js")),"jx-ui:/behaviors/popover.ts":()=>(K("8htra4er"),import("./chunks/popover-8htra4er.js")),"jx-ui:/behaviors/select.ts":()=>(K("n3v7gwas"),import("./chunks/select-n3v7gwas.js")),"jx-ui:/behaviors/split.ts":()=>(K("pff8f3ze"),import("./chunks/split-pff8f3ze.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(K("8qh9a3bm"),import("./chunks/swatch-group-8qh9a3bm.js")),"jx-ui:/behaviors/tabs.ts":()=>(K("jwthg40w"),import("./chunks/tabs-jwthg40w.js")),"jx-ui:/behaviors/toolbar.ts":()=>(K("2nnzqhrj"),import("./chunks/toolbar-2nnzqhrj.js")),"jx-ui:/behaviors/tree.ts":()=>(K("h19v1jfz"),import("./chunks/tree-h19v1jfz.js")),"jx-ui:/behaviors/tooltip.ts":()=>(K("fd6g9xy3"),import("./chunks/tooltip-fd6g9xy3.js")),"jx-ui:/behaviors/textfield.ts":()=>(K("spy3hc77"),import("./chunks/textfield-spy3hc77.js")),"jx-ui:/behaviors/toast.ts":()=>(K("4d35zd64"),import("./chunks/toast-4d35zd64.js")),"jx-ui:/behaviors/toast-host.ts":()=>(K("8sjmfed3"),import("./chunks/toast-host-8sjmfed3.js")),"jx-ui:/color.ts":()=>(K("fpezvnkt"),import("./chunks/color-fpezvnkt.js")),"jx-ui:/icons.ts":()=>(K("qbh8akb1"),import("./chunks/icons-qbh8akb1.js"))};var nf;function Ta(e){nf=new URL("./",e).href}Ta(import.meta.url);for(let[e,t]of Object.entries(ka))Xs(e,t);function jt(e,t,n,r){let o=Xr(e.x,e.y,r);if(!o)return null;return Zr(o,e.y,n,t)}function lo(e){return[...e.dataTransfer?.types??[]].includes("Files")}var rf={type:"block"},uo={},co=null;function Aa(e){return e?{...e,versions:uo}:null}function of(e,t){let n=e.dataset?.jxPath;if(n==null)return null;let r=U(n),o=t?Y(t,r):void 0;return{path:r,rect:He(e),tagName:(xe(o?.tagName)||e.tagName).toLowerCase()}}function sf(e){if(!(e instanceof Element))return null;if(e.closest("[data-jx-path]"))return null;let t=e.closest("[data-jx-layout-region]");if(!(t instanceof HTMLElement))return null;return{className:typeof t.className==="string"?t.className:"",layoutFile:t.dataset.jxLayoutFile??"",layoutPath:U(t.dataset.jxLayoutPath??"[]"),rect:He(t),tagName:t.tagName.toLowerCase()}}var af=new Set(["style","textContent"]);function lf(e){let t=Ii();if(!t)return!1;for(let n of e){let r;if(n.op==="set-key"){if(af.has(n.key)||n.key.startsWith("on"))continue;r=n.path}else if(n.op==="move-child"){if(r=n.fromParentPath,tt(r,t)||tt(n.toParentPath,t))return!0;continue}else r=n.parentPath;if(tt(r,t))return!0}return!1}var cf=2,uf=5000,ff=500;function df(e){let{channel:t,container:n}=e;uo={},co=null;let r=null,o=null,s=-1,i=null,a=-1,c="design",l=null,u=null,f=On,d=null,m=null,w=-1,b=-1,g=0,y=null,S=n.ownerDocument.defaultView;function A(){if(g&&S)S.cancelAnimationFrame(g);g=0,y=null}function C(){g=0;let p=y?.src??m;if(!S||!y||!p||!i)return;let L=Qr(y.y,S.innerHeight);if(L===0)return;let I=S.scrollY;if(S.scrollBy(0,L*Yi),S.scrollY===I)return;let te=jt(y,p,i,n.ownerDocument);t.post({...y.withCursor?{cursor:{x:y.x,y:y.y}}:{},dragSeq:y.dragSeq,gen:y.gen??w,kind:"dragOver",preview:te}),g=S.requestAnimationFrame(C)}function T(p,L,I){if(!S||Qr(p.y,S.innerHeight)===0){A();return}if(y={dragSeq:L,withCursor:I!=null,x:p.x,y:p.y,...I?{gen:I.gen,src:I.src}:{}},!g)g=S.requestAnimationFrame(C)}let x=Gi(t,n.ownerDocument,{getGen:()=>a,getMode:()=>c,getShadowDoc:()=>i}),v=(p)=>{if(c!=="design"&&c!=="edit")return;let L=sf(p.target);if(L)t.post({hit:L,kind:"layoutHit"})};n.ownerDocument.addEventListener("click",v,!0);let P=pa(t,n.ownerDocument,de,()=>f,()=>c),E=ca(t,n,{getMode:()=>c,getShadowDoc:()=>i}),O=ua(t,n.ownerDocument),M=xi(n),h=30000,k=-1;function R(){let p=n.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),L=ne(n),I=0;for(let te of p)I=Math.max(I,ne(te).bottom-L.top);return I}function N(){let p=Math.max(n.scrollHeight,R()),L=Math.min(p,h);if(L>0&&Math.abs(L-k)>=1){k=L;let I=n.firstElementChild,te=I instanceof HTMLElement&&I.dataset.jxDefinitionRoot!==void 0;t.post({fragment:te,height:L,kind:"contentHeight"}),Be()}}let B=S?.ResizeObserver,se=B?new B(()=>N()):null,Q=n.ownerDocument,ee=0,We=0,ke=0,fo="",ut=new Map;function Ca(){let p=Date.now();for(let[L,I]of ut)if(I<=p)ut.delete(L);return ut.size}function Pa(){return{animations:typeof Q.getAnimations==="function"?Q.getAnimations().filter((L)=>L.playState==="running").length:0,fonts:Q.fonts?Q.fonts.status==="loaded":!0,gen:a,images:Ca(),kind:"idle"}}function po(){ee=0;let p=Pa(),L=`${p.gen}|${p.fonts}|${p.animations}|${p.images}`,I=L!==fo;if(I)fo=L,t.post(p);if(We=p.fonts&&p.animations===0&&p.images===0?I?1:We+1:0,We>=cf){N();return}if(Date.now()>=ke)return;ee=S?S.requestAnimationFrame(po):0}function Be(){if(We=0,ke=Date.now()+uf,!ee&&S)ee=S.requestAnimationFrame(po)}let mo=(p)=>{if(p.target instanceof HTMLImageElement)ut.set(p.target,Date.now()+ff),Be()},ho=(p)=>{if(p.target instanceof HTMLImageElement&&ut.delete(p.target))Be()};n.addEventListener("error",mo,!0),n.addEventListener("load",ho,!0),Be(),se?.observe(n);let go=(p)=>{if(c==="preview"){if(p.ctrlKey||p.metaKey)p.preventDefault();return}p.preventDefault(),t.post({ctrlKey:p.ctrlKey,deltaX:p.deltaX,deltaY:p.deltaY,kind:"forwardWheel",metaKey:p.metaKey,shiftKey:p.shiftKey,x:p.clientX,y:p.clientY})};n.ownerDocument.addEventListener("wheel",go,{passive:!1});let Ra=300,xo=0,yo=(p,L)=>{p.preventDefault(),p.stopPropagation();let I={x:p.clientX,y:p.clientY},te=n.ownerDocument,D=Xr(I.x,I.y,te),ge=D?of(D,i):null,Ft=i&&D?Zr(D,I.y,i,rf):null;if(L==="fileDragOver"){if(p.dataTransfer)p.dataTransfer.dropEffect="copy";t.post({hit:ge,kind:"fileDragOver",preview:Ft});return}t.post({files:[...p.dataTransfer?.files??[]],hit:ge,kind:"fileDrop",preview:Ft})},Ht=(p)=>{if(!m){if(lo(p)){yo(p,"fileDragOver");return}let te=Date.now();if(te-xo>=Ra)xo=te,t.post({kind:"nativeDragEnter"});return}if(p.preventDefault(),p.dataTransfer)p.dataTransfer.dropEffect="move";let L={x:p.clientX,y:p.clientY},I=i?jt(L,m,i,n.ownerDocument):null;t.post({cursor:L,dragSeq:b,gen:w,kind:"dragOver",preview:I}),T(L,b)},bo=(p)=>{if(!m){if(lo(p))yo(p,"fileDrop");return}p.preventDefault();let L={x:p.clientX,y:p.clientY},I=i?jt(L,m,i,n.ownerDocument):null;t.post({dragSeq:b,gen:w,instruction:I?.instruction??null,kind:"dropResult",targetPath:I?.targetPath??null}),m=null,w=-1,b=-1,A()},wo=(p)=>{if(!m&&lo(p)&&!p.relatedTarget)t.post({kind:"fileDragLeave"})};n.ownerDocument.addEventListener("dragenter",Ht,!0),n.ownerDocument.addEventListener("dragover",Ht,!0),n.ownerDocument.addEventListener("dragleave",wo,!0),n.ownerDocument.addEventListener("drop",bo,!0);let $a=t.onMessage((p)=>{if(p.kind==="measure"){let{hidden:D,hits:ge}=zi(p.paths,n.ownerDocument);t.post({hidden:D,hits:ge,kind:"geometry",reqId:p.reqId});return}if(p.kind==="evalExpr"){let D=p.gen===a&&d&&i?va(p.exprs,d.defs,i,p.contextPath):[];t.post({gen:p.gen,kind:"evalResult",reqId:p.reqId,results:D});return}if(p.kind==="patch"){let{gen:D}=p;if(D<a){t.post({gen:D,kind:"patchError",message:"patch-behind-render"});return}if(D>a||!i||!d){t.post({gen:D,kind:"patchError",message:"patch-ahead-of-render"});return}let ge=new Set((p.echoPaths??[]).map((Me)=>J(Me))),Ft=ge.size===0?p.forwardOps:p.forwardOps.filter((Me)=>!(Me.op==="set-key"&&ge.has(J(Me.path)))),Eo=de()&&lf(Ft),vo=Eo?$n(n,je):null;if(Eo)he();try{if(xa(i,p.forwardOps,n,d,p.echoPaths),_t(n,l),et(n,u),vo)It(n,vo);t.post({gen:D,kind:"patchComplete"}),Be()}catch(Me){t.post({gen:D,kind:"patchError",message:String(Me?.message??Me)})}return}if(p.kind==="styleUpdate"){if(p.gen!==a||!i)return;i.style=p.style;let D=n.firstElementChild;if(D instanceof HTMLElement)wn(D,p.style,i.$media??{});return}if(p.kind==="dragStart"){m=p.src,w=p.gen,b=p.dragSeq;return}if(p.kind==="dragEnd"||p.kind==="dragCancel"){m=null,w=-1,b=-1,A();return}if(p.kind==="dragMove"){let D=m&&i?jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,kind:"dragOver",preview:D}),T(p.cursor,p.dragSeq);return}if(p.kind==="drop"){let D=m&&i?jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,instruction:D?.instruction??null,kind:"dropResult",targetPath:D?.targetPath??null}),m=null,w=-1,b=-1,A();return}if(p.kind==="assetVersions"){uo=p.versions;let D=Aa(co);if(D)xn((ge)=>$t(ge,D));return}if(p.kind==="keymap"){f={chords:p.chords,mac:p.mac};return}if(p.kind==="setColorScheme"){Jr(n.ownerDocument,p.scheme);return}if(p.kind==="setPopoverOpen"){if(c==="preview")return;l=p.path===null?null:J(p.path),_t(n,l),et(n,u),N();return}if(p.kind==="setDialogOpen"){if(c==="preview")return;u=p.path===null?null:J(p.path),et(n,u),N();return}if(p.kind==="redefineElement"){ii(p.doc,p.base);return}if(p.kind==="setLocale"){let D=n.ownerDocument.documentElement;if(p.locale===null)D.removeAttribute("lang"),D.removeAttribute("dir");else D.setAttribute("lang",p.locale),D.setAttribute("dir",p.dir);return}if(p.kind==="siteStyleUpdate"){Ir(p.siteStyle,p.media);return}if(p.kind!=="render"||p.gen<s)return;if(Jr(n.ownerDocument,p.colorScheme??null),de())he();s=p.gen,co=p.assets??null,Oi(p.editableTags??null);let{gen:L,mapperCtx:I}=p,te=p.shadowDoc;(async()=>{try{if(ma(),o?.(),o=null,r?.dispose(),ni(n.ownerDocument),r=await yi({assets:Aa(p.assets??null),container:n,doc:p.doc,docBase:p.docBase,mapperCtx:{arrayPaths:new Set(I.arrayPaths),canvasMode:I.canvasMode,layoutWrapped:I.layoutWrapped,pageContentOffset:I.pageContentOffset,pageContentPrefix:I.pageContentPrefix},diffMarks:p.diffMarks??null,mode:p.mode,popoverOpen:p.popoverOpen?J(p.popoverOpen):null,dialogOpen:p.dialogOpen?J(p.dialogOpen):null,siteStyle:p.siteStyle,...p.allowAutoRequests?{allowAutoRequests:!0}:{}}),L===s){l=p.popoverOpen?J(p.popoverOpen):null,u=p.dialogOpen?J(p.dialogOpen):null,_t(n,l),et(n,u),i=te,d=r.ctx,a=L,c=p.mode,t.post({gen:L,kind:"renderComplete"}),Be();let D=r.ctx.defs;o=Ws(()=>{try{t.post({gen:L,kind:"dataScope",scope:Sa(D)})}catch{}}),N()}}catch(D){t.post({gen:L,kind:"renderError",message:String(D?.message??D)})}})()});return t.post({kind:"ready"}),()=>{if($a(),x(),P(),E(),O(),M(),ee&&S)S.cancelAnimationFrame(ee);ee=0,n.removeEventListener("error",mo,!0),n.removeEventListener("load",ho,!0),A(),se?.disconnect(),n.ownerDocument.removeEventListener("click",v,!0),n.ownerDocument.removeEventListener("wheel",go),n.ownerDocument.removeEventListener("dragenter",Ht,!0),n.ownerDocument.removeEventListener("dragleave",wo,!0),n.ownerDocument.removeEventListener("dragover",Ht,!0),n.ownerDocument.removeEventListener("drop",bo,!0),o?.(),r?.dispose()}}function pf(e){let t=new URLSearchParams(e.location.search);Hs(t.get("rpcToken"));let n=t.get("parentOrigin"),r=n||"*";if(!n)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let o=e.document.querySelector("#jx-canvas-root")??e.document.body,s=ko({acceptOrigin:r,source:e,target:e.parent,targetOrigin:r,token:t.get("token")||""});return df({channel:s,container:o})}if(typeof window<"u"&&window.parent!==window)pf(window);export{cf as IDLE_QUIET_FRAMES,uf as IDLE_WATCH_MAX_MS,ff as IMAGE_RETRY_WINDOW_MS,pf as bootCanvasIframe,of as fileDropHitFor,lo as isExternalFileDrag,sf as layoutHitFor,lf as patchDisturbsActiveEdit,df as startCanvasIframe};
311
+ `," ")&&!Dt)return;Dt=!0,ot(ie,null,n,e);return}rt(M);let t=Bi(M);ot(ie,t.children??null,t.textContent??null,e)}function ou(e){if(!Array.isArray(e.children)||e.children.length===0)return{textContent:""};let t=[];for(let n of e.children)if(typeof n==="string"&&t.length>0&&typeof t.at(-1)==="string")t[t.length-1]+=n;else t.push(n);if(t.every((n)=>typeof n==="string"))return{textContent:t.join("")};return{children:t}}function Bi(e){let t=e.childNodes;if(t.length===0)return{textContent:""};if(t.length===1&&t[0].nodeType===Node.TEXT_NODE)return{textContent:t[0].textContent};let n=[];for(let r of t){let o=qr(r);if(o!==null&&o!==void 0)n.push(o)}return ou({children:n})}function qr(e){if(e.nodeType===Node.TEXT_NODE){let a=e.textContent;if(!a)return null;return a}if(e.nodeType!==Node.ELEMENT_NODE)return null;let t=e,n=t.tagName.toLowerCase(),r={tagName:n},o={b:"strong",i:"em",s:"del",strike:"del"};if(o[n])r.tagName=o[n];let s=t.dataset.jxHref??t.getAttribute("href");if(n==="a"&&s!=null){if(r.attributes={href:s},t.title)r.attributes.title=t.title}if(n==="code")return r.textContent=t.textContent,r;let{childNodes:i}=t;if(i.length===0)r.textContent="";else if(i.length===1&&i[0].nodeType===Node.TEXT_NODE)r.textContent=i[0].textContent;else{r.children=[];for(let a of i){let c=qr(a);if(c)r.children.push(c)}}return r}function _i(e){let t=e.childNodes;if(t.length===0)return{textContent:""};if(t.length===1&&t[0].nodeType===Node.TEXT_NODE)return{textContent:t[0].textContent};let n=[];for(let r of t){let o=qr(r);if(o)n.push(o)}if(n.length===1&&typeof n[0]!=="string"&&n[0].tagName==="span"&&typeof n[0].textContent==="string")return{textContent:n[0].textContent};return n.length>0?{children:n}:{textContent:""}}function $n(e){let t=document.createRange();return t.setStart(M,0),t.setEnd(e.startContainer,e.startOffset),t.toString()}var Ki=0,Rn=!0;function zr(e){if(!M||!st||!ie)return;if(pe)return;let t=window.getSelection();if(!t||!t.rangeCount)return;let n=t.getRangeAt(0);Rn=e?.anchored!==!1,Ki=$n(n).length,_e.show(M,"",{onSelect:Ui,...Rn?{}:{showFilter:!0}})}function Vi(e){if(e.key!=="/"||e.ctrlKey||e.metaKey||!M)return;let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=$n(t.getRangeAt(0));if(n===""||n.endsWith(" ")||n.endsWith(`
312
+ `))requestAnimationFrame(()=>zr())}function Gr(){if(!M||!Rn)return;let e=window.getSelection();if(!e||!e.rangeCount){_e.dismiss();return}let t=e.getRangeAt(0),n=$n(t),r=n.lastIndexOf("/");if(r===-1||n.length<Ki-1){_e.dismiss();return}let o=n.slice(r+1).toLowerCase();_e.show(M,o,{onSelect:Ui})}function Ui(e){if(!M||!st||!ie)return;let t=Rn?window.getSelection():null;if(t&&t.rangeCount){let s=t.getRangeAt(0),a=$n(s).lastIndexOf("/");if(a!==-1){let c=document.createTreeWalker(M,NodeFilter.SHOW_TEXT),l=0,u=null,f=0;while(c.nextNode()){let d=c.currentNode;if(l+d.length>a){u=d,f=a-l;break}l+=d.length}if(u){let d=document.createRange();d.setStart(u,f),d.setEnd(s.startContainer,s.startOffset),d.deleteContents()}}}rt(M);let n=Bi(M),r=[...ie],o=st;Fi(),o(r,e,n)}function su(e,t){let{target:n}=e;return n===t||n===t.documentElement||n===t.body}function Yr(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function zi(e,t){let n=oe(e);return{path:q(t),rect:{height:n.height,width:n.width,x:n.x,y:n.y}}}function qi(e){let t=Yr(e instanceof Element?e:null);if(!t)return null;return zi(t,t.dataset.jxPath)}function iu(e){let t=e.checkVisibility;return typeof t==="function"?t.call(e,{checkVisibilityCSS:!0}):!0}function Gi(e,t=document){let n=[],r=[];for(let o of e){let s=t.querySelector(je(J(o)));if(!s)continue;if(iu(s)){let i=oe(s);n.push({path:o,rect:{height:i.height,width:i.width,x:i.x,y:i.y}})}else r.push(o)}return{hidden:r,hits:n}}var au=new Set(["toggle","show","hide"]);function lu(e,t){if(!(e instanceof Element))return;let n=e.closest("[popovertarget]"),r=n?.getAttribute("popovertarget");if(!n||!r)return;let i=[...n.ownerDocument.querySelectorAll("[data-jx-popover]")].find((l)=>l.id===r)?.dataset.jxPath;if(!i)return;let a=n.getAttribute("popovertargetaction")??"toggle",c=au.has(a)?a:"toggle";t.post({action:c,kind:"popoverTargetClick",targetPath:q(i)})}function cu(e,t){if(!(e instanceof Element))return;let n=e.closest("[data-jx-commandfor]"),r=n?.dataset.jxCommandfor,o=n?.getAttribute("command")?.trim().toLowerCase()??"";if(!n||!r||!o)return;let a=[...n.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((c)=>c.id===r)?.dataset.jxPath;if(!a)return;t.post({command:o,kind:"commandTargetClick",targetPath:q(a)})}function Yi(e,t=document,n){let r=null,o=null,s=n?.getGen?.()??0,i=()=>n?.getMode?.()==="preview",a=()=>{e.post({kind:"paneFocus"})},c=(g)=>{if(i()){if(g.target instanceof Element){let E=g.target.closest("a[href]")?.getAttribute("href");if(E&&!E.startsWith("#"))g.preventDefault(),e.post({href:E,kind:"previewNavigate"})}return}if(n?.getMode?.()==="stylebook"&&g.target instanceof Element&&g.target.closest("a"))g.preventDefault();let v=qi(g.target);if(v){let P=g;e.post({additive:P.ctrlKey===!0||P.metaKey===!0,hit:v,kind:"hit"})}lu(g.target,e),cu(g.target,e)},l=(g)=>{if(i())return;let v=g?.dataset.jxPath??null;if(v===r)return;r=v,e.post({hit:g&&v?zi(g,v):null,kind:"hover"})},u=()=>{let g=n?.getGen?.()??s;if(g!==s)s=g,o="none"},f=(g,v)=>{if(!n||n.getMode?.()==="stylebook"||i())return;u();let P=n.getShadowDoc(),E=Yr(g instanceof Element?g:null),_=E&&P?Ai(E,v,P):null,R=Ci(_);if(R===o)return;o=R,e.post({kind:"insertZones",zones:_})},d=0,m=null,w=0,y=0,h=(g)=>t.defaultView?.requestAnimationFrame(g)??requestAnimationFrame(g),x=(g)=>t.defaultView?.cancelAnimationFrame(g)??cancelAnimationFrame(g),S=()=>{d=0;let g=m;m=null,l(Yr(g instanceof Element?g:null)),f(g,{x:w,y})},A=(g)=>{let v=g;if(m=g.target,w=v.clientX,y=v.clientY,d)return;d=h(S)},C=(g)=>{if(!su(g,t))return;if(l(null),n&&!i()&&o!=="none")o="none",e.post({kind:"insertZones",zones:null})},T=(g)=>{let v=g;if(i())return;let P=me()?it():null;if(P&&g.target instanceof Node&&P.contains(g.target))return;let E=qi(g.target);if(!E)return;g.preventDefault(),e.post({kind:"contextMenu",path:E.path,x:v.clientX,y:v.clientY})};return t.addEventListener("pointerdown",a,!0),t.addEventListener("click",c,!0),t.addEventListener("pointermove",A,!0),t.addEventListener("pointerleave",C,!0),t.addEventListener("contextmenu",T,!0),()=>{if(d)x(d),d=0;t.removeEventListener("pointerdown",a,!0),t.removeEventListener("click",c,!0),t.removeEventListener("pointermove",A,!0),t.removeEventListener("pointerleave",C,!0),t.removeEventListener("contextmenu",T,!0)}}var uu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fu(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function Zr(e,t,n){let r=Ao(e,t,n);return fu(r)}function Qr(e,t,n,r){let o=e.dataset?.jxPath;if(o==null)return null;let s=q(o);if(s.length===0){let d=[...e.children];if(d.length===0)return Xr(r,s)?{edge:"inside",instruction:"make-child",referenceRect:Fe(e),targetPath:s}:null;return du(d,t,s,r)}if(!Xr(r,s))return null;let i=Z(n,s),a=(be(i?.tagName)||"div").toLowerCase(),c=Array.isArray(i?.children)&&i.children.some((d)=>d!=null&&typeof d==="object"),l=uu.has(a)||!c,u=Fe(e),f=u.height===0?0:(t-u.y)/u.height;if(l)return f<0.5?{edge:"top",instruction:"reorder-above",referenceRect:u,targetPath:s}:{edge:"bottom",instruction:"reorder-below",referenceRect:u,targetPath:s};if(f<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:u,targetPath:s};if(f>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:u,targetPath:s};return{edge:"inside",instruction:"make-child",referenceRect:u,targetPath:s}}function du(e,t,n,r){let o=1/0,s="reorder-below",i=e.length-1;for(let c=0;c<e.length;c++){let l=Fe(e[c]),u=Math.abs(t-l.y),f=Math.abs(t-(l.y+l.height));if(u<o)o=u,s="reorder-above",i=c;if(f<o)o=f,s="reorder-below",i=c}let a=[...n,"children",i];if(!Xr(r,a))return null;return{edge:s==="reorder-above"?"top":"bottom",instruction:s,referenceRect:Fe(e[i]),targetPath:a}}function Xr(e,t){if(e.type!=="tree-node")return!0;let n=e.path;if(vi(n,t))return!1;return!nt(n,t)}function Fe(e){let t=oe(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}var pu=40,Xi=12;function eo(e,t,n=pu){if(e<n)return-1;if(e>t-n)return 1;return 0}var to=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),no=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Zi=new Set(["deleteByCut","deleteContent"]),Qi=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),mu="format",hu=new Set(["insertParagraph","insertLineBreak"]);function ea(e){let{inputType:t,from:n,to:r}=e;if(t==="insertCompositionText"||t==="insertFromComposition")return{kind:"native"};if(t==="historyUndo"||t==="historyRedo")return{kind:"reject"};if(t.startsWith(mu))return{kind:"reject"};if(t==="insertFromDrop"||t==="deleteByDrag")return{kind:"reject"};if(e.inPropHost)return hu.has(t)?{kind:"reject"}:{kind:"native"};if(!n||!r)return{kind:"reject"};let o=Mt(n,r)&&n.offset===r.offset,s=!Mt(n,r);if(t==="insertParagraph")return{from:n,kind:"split",to:r};if(t==="insertLineBreak"&&!s)return{kind:"native"};if(o&&to.has(t)&&e.atBlockStart)return{at:n,kind:"mergeBackward"};if(o&&no.has(t)&&e.atBlockEnd)return{at:n,kind:"mergeForward"};if(s){if(Qi.has(t)||t==="insertLineBreak")return{from:n,kind:"replaceRange",text:e.data,to:r};if(to.has(t)||no.has(t)||Zi.has(t))return{from:n,kind:"replaceRange",text:"",to:r};return{kind:"reject"}}if(Qi.has(t)||to.has(t)||no.has(t)||Zi.has(t))return{kind:"native"};return{kind:"native"}}var gu=500;function Nn(e,t){let n=e.ownerDocument.getSelection();if(!n||n.rangeCount===0||!n.anchorNode||!n.focusNode)return null;if(!e.contains(n.anchorNode)||!e.contains(n.focusNode))return null;let r=Nt(n.anchorNode,n.anchorOffset,t),o=Nt(n.focusNode,n.focusOffset,t);return r&&o?{anchor:r,head:o}:null}function It(e,t){let n=Dr(e,t.anchor),r=Dr(e,t.head)??n;if(!n)return!1;let o=e.ownerDocument.getSelection();if(!o)return!1;let s=e.ownerDocument.createRange();if(s.setStart(n.node,n.offset),o.removeAllRanges(),o.addRange(s),r&&r!==n)o.extend(r.node,r.offset);return!0}function ta(e,t){let n=e.ownerDocument,r=null,o=null,s=()=>{let T=t.getMode?.();return T===void 0||T==="design"||T==="edit"},i=0,a=()=>{if(i)clearTimeout(i),i=0},c=()=>{if(i=0,!r||!t.onCommitTick)return;let T=Nn(e,t.isEditableBlock);if(t.onCommitTick(),T)It(e,T)},l=!1,u=()=>{if(!t.onCommitTick||!r||l)return;a(),i=setTimeout(c,t.commitDelayMs??gu)},f=()=>{l=!0,a()},d=()=>{l=!1,u()},m=()=>{a(),r=null,o=null},w=()=>{if(!r)return;a(),r=null,o=null,t.onDeactivate()},y=()=>{if(!s()){w();return}let g=n.getSelection()?.focusNode??null;if(!g)return;if(!e.contains(g)){w();return}let v=Sn(g,t.isEditableBlock);if(!v){if(r?.contains(g)){t.onSelectionChange?.();return}w();return}let P=J(v.path);if(P===o){t.onSelectionChange?.();return}w(),r=v.el,o=P,t.onActivate(v.el,v.path)},h=(T)=>{let[g]=typeof T.getTargetRanges==="function"?T.getTargetRanges():[],v=n.getSelection(),P=v&&v.rangeCount>0&&(v.isCollapsed||!g),E,_,R,I;if(P)({startContainer:E,startOffset:_,endContainer:R,endOffset:I}=v.getRangeAt(0));else if(g)({startContainer:E,startOffset:_,endContainer:R,endOffset:I}=g);else return null;let te=Nt(E,_,t.isEditableBlock),b=Nt(R,I,t.isEditableBlock),k=Sn(R,t.isEditableBlock);return te&&b&&k?{endEl:k.el,from:te,to:b}:null},x=(T)=>{let g=T;if(!s())return;let v=h(g),P=ea({atBlockEnd:v?v.to.offset>=Or(v.endEl):!1,atBlockStart:v?fi(v.from):!1,data:g.data??"",from:v?.from??null,inPropHost:r!==null&&o===null,inputType:g.inputType,to:v?.to??null});switch(P.kind){case"native":return;case"split":{if(g.preventDefault(),!Mt(P.from,P.to)&&!t.onReplaceRange)return;t.onSplit?.();return}case"mergeBackward":{g.preventDefault(),t.onMergeBackward?.(P.at);return}case"mergeForward":{g.preventDefault(),t.onMergeForward?.(P.at);return}case"replaceRange":{g.preventDefault(),t.onReplaceRange?.(P.from,P.to,P.text);return}default:g.preventDefault()}},S=(T)=>{if(!s()||!t.onPropActivate)return;let g=T.target instanceof Element?T.target:null;while(g&&g!==e){if(g.dataset?.jxBoundProp){if(g!==r){if(w(),t.onPropActivate(g))r=g,o=null}return}if(g.dataset?.jxPath)return;g=g.parentElement}},A=(T)=>{T.preventDefault()},C=()=>u();return n.addEventListener("selectionchange",y),e.addEventListener("beforeinput",x),e.addEventListener("input",C),e.addEventListener("compositionstart",f),e.addEventListener("compositionend",d),e.addEventListener("dragstart",A),n.addEventListener("pointerdown",S,!0),{capture:()=>Nn(e,t.isEditableBlock),forget:m,isComposing:()=>l,flush:()=>{if(l)return;if(i)a(),c()},placeCaret:(T)=>{let g=It(e,{anchor:T,head:T});if(g)y();return g},restore:(T)=>{let g=It(e,T);if(g)y();return g},stop:()=>{n.removeEventListener("selectionchange",y),e.removeEventListener("beforeinput",x),e.removeEventListener("input",C),e.removeEventListener("compositionstart",f),e.removeEventListener("compositionend",d),e.removeEventListener("dragstart",A),n.removeEventListener("pointerdown",S,!0),w()},sync:y}}var na=(e,t)=>document.execCommand(e,!1,t);function ra(e){let t=window.getSelection();if(!t||!t.rangeCount)return{active:!1,href:null};let n=t.anchorNode;while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()==="a"){let r=n;return{active:!0,href:r.dataset.jxHref??r.getAttribute("href")}}n=n.parentNode}return{active:!1,href:null}}function xu(e){let t=window.getSelection();if(!t||!t.rangeCount)return null;let n=t.anchorNode;while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()==="a")return n;n=n.parentNode}return null}function oa(e,t){let n=xu(e);if(n)if(t)n.setAttribute("href",t);else{let r=document.createDocumentFragment();while(n.firstChild)r.append(n.firstChild);n.replaceWith(r)}else if(t)na("createLink",t);rt(e)}function sa(e,t){e.focus(),na("insertText",`\${${t}}`)}var Mn=new Set(["img","video","source","iframe","audio"]),_n="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",yu="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var bu=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function wu(e){return bu.test(e)}var Eu=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),vu=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),ia=["empty-text-placeholder","empty-container-placeholder"];function ro(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(Eu.has(be(e.tagName)))return"empty-text-placeholder";if(vu.has(be(e.tagName)))return"empty-container-placeholder";return null}function Jt(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function aa(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);while(t.nextNode()){let n=t.currentNode;if(n.data.includes("❪"))n.data=n.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function Su(e){let t=e.map;return{children:t&&typeof t==="object"?[Te(t)]:[],className:"repeater-perimeter",tagName:"div"}}function Te(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>Te(i));if(e.$prototype==="Array")return Su(e);let t=e,n={},r=!1,o=Mn.has(t.tagName||"");if(o){let{attributes:i,src:a}=t,c=i?.src,l=t.poster,u=i?.poster;if(!(a&&a!==""||c&&c!=="")&&!(l&&l!==""||u&&u!==""))r=!0}for(let[i,a]of Object.entries(t))if(i==="state"||i==="$media"||i==="$elements")n[i]=a;else if(i==="$props"&&a&&typeof a==="object"){let c={};for(let[l,u]of Object.entries(a))if(typeof u==="string"&&u.includes("${"))if(wu(l))c[l]=yu;else if(l==="href"||l==="action")c[l]="";else c[l]=Jt(u);else if(u&&typeof u==="object"&&u.$ref){let f=u.$ref,d=f.startsWith("#/state/")?f.slice(8):f;c[l]=`{${d}}`}else c[l]=u;n[i]=c}else if(i==="children")if(Array.isArray(a))n.children=a.map((c)=>Te(c));else if(a&&typeof a==="object"&&a.$prototype==="Array")n.children=[Te(a)];else n.children=Te(a);else if(i==="cases"&&t.$switch&&a&&typeof a==="object"){let c=Object.keys(a);if(c.length>0){let l=a[c[0]];n.children=l&&typeof l==="object"&&!l.$ref?[Te(l)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${c.join(" | ")}]`}]}}else if(i==="attributes"&&o&&a&&typeof a==="object"){let c=a,l={};for(let[u,f]of Object.entries(c))if(u==="src"||u==="poster")if(typeof f==="string"&&f!==""&&!f.includes("${"))l[u]=f;else r=!0,l[u]=_n;else if(typeof f==="string"&&f.includes("${")){let d=u==="href"||u==="action";l[u]=d?"":Jt(f)}else if(f&&typeof f==="object"&&f.$ref){let d=f.$ref,m=d.startsWith("#/state/")?d.slice(8):d;l[u]=`{${m}}`}else l[u]=f;n.attributes=l}else if(i==="style")if(a&&typeof a==="object"){let c={};for(let[l,u]of Object.entries(a))if(typeof u!=="string"||!u.includes("${"))c[l]=u;n.style=c}else n.style=a;else if(typeof a==="string"&&a.includes("${"))if((i==="src"||i==="poster")&&Mn.has(t.tagName||""))r=!0,n[i]=_n;else{let l=i==="src"||i==="href"||i==="poster"||i==="action";n[i]=l?"":Jt(a)}else if(a&&typeof a==="object"&&a.$ref){let c=a.$ref,l=c.startsWith("#/state/")?c.slice(8):c;if((i==="src"||i==="poster")&&Mn.has(t.tagName||""))r=!0,n[i]=_n;else n[i]=`{${l}}`}else if((i==="src"||i==="poster")&&a===""&&Mn.has(t.tagName||""))r=!0,n[i]=_n;else n[i]=Te(a);let s=ro(n);if(s)n.className=n.className?`${n.className} ${s}`:s;if(r){let i=n.className||"";if(!i.includes("empty-media-placeholder"))n.className=i?`${i} empty-media-placeholder`:"empty-media-placeholder"}return n}var ku={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Tu=["strong","em","u","del","sub","sup","code"],On="jx-pending-format",la="jx-pending-format-style";function Au(e){let t=e.parentElement;while(t){if(t.tagName.includes("-"))return t;t=t.parentElement}return null}function Cu(e,t){if(!e)return!1;let n=e.attributes;if(n){if(n[`props.${t}`]!==void 0)return!0;let r=new Set([t.toLowerCase(),sn(t).toLowerCase()]);for(let[s,i]of Object.entries(n))if(i!==void 0&&r.has(s.toLowerCase()))return!0;let o=n["data-jx-props"];if(typeof o==="string"&&Pu(o,t))return!0}if(Pt.has(t)||t.startsWith("$"))return!1;return e[t]!==void 0}function Pu(e,t){try{let n=JSON.parse(e);return typeof n==="object"&&n!==null&&t in n}catch{return!1}}function ca(e,t){let r=J(t).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),o=e.querySelector(`[data-jx-path='${r}']`);return o instanceof HTMLElement?o:null}function Ru(e){return{height:e.height,width:e.width,x:e.x,y:e.y}}function ua(e,t,n){let r=t.ownerDocument,o=()=>{let b=n?.getMode?.();return b===void 0||b==="design"||b==="edit"},s=null,i=0,a=(b)=>{let k=window.getSelection();if(!k||!k.rangeCount)return null;let N=k.getRangeAt(0);return b.contains(N.commonAncestorContainer)?N:null},c=()=>{let b=it();if(!b)return;let k=a(b);if(k&&!k.collapsed)s=k.cloneRange()},l=()=>{if(r.querySelector(`#${la}`))return;let b=r.createElement("style");b.id=la,b.textContent=`::highlight(${On}) { background-color: Highlight; color: HighlightText; }`,r.head.append(b)},u=()=>{let b=globalThis.Highlight,k=globalThis.CSS?.highlights;if(!b||!k)return;if(s&&s.startContainer.isConnected)l(),k.set(On,new b(s.cloneRange()));else k.delete(On)},f=()=>{globalThis.CSS?.highlights?.delete(On)},d=()=>{let b=it();if(!b||!b.dataset.jxPath)return null;let k=a(b),N=k??s,F=N?Ru(To(N)):null,B=k?k.collapsed:!0,X=Tu.filter((Ae)=>Ri(Ae,b)),ne=ra(b);if(ne.active)X.push("a");return i+=1,{activeTags:X,collapsed:B,kind:"selectionChanged",link:ne,localScope:null,path:q(b.dataset.jxPath),rect:F,seq:i}},m=()=>{if(!me())return;c(),u();let b=d();if(b)e.post(b)},w=!1,y=(b,k)=>{aa(b),e.post({kind:"editStart",path:k}),Br(b,k,{onCommit:(N,F,B,X)=>{w=!1,e.post({children:F,kind:"editCommit",path:N,textContent:B,...X?{inPlace:!0}:{}})},onEnd:()=>{f(),s=null,e.post({kind:"editEnd"})},onInsert:(N,F,B)=>e.post({cmd:F,commitData:B,kind:"editInsert",path:N}),onSplit:(N,F,B)=>e.post({after:B,before:F,kind:"editSplit",path:N})}),c(),m()},h=(b,k)=>{let N=n?.getShadowDoc?.();if(!N)return!0;let F=Z(N,b);if(Cu(F,k))return!1;let B=F?.$props?.[k];if(B==null)return!0;if(typeof B!=="string")return!1;return!B.includes("${")},x=(b,k,N)=>{e.post({kind:"editStart",path:k,prop:N}),Br(b,k,{onCommit:(F,B,X,ne)=>{w=!1,e.post({kind:"editCommitProp",path:F,prop:N,value:X??"",...ne?{inPlace:!0}:{}})},onEnd:()=>{f(),s=null,E.forget(),e.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},S=(b)=>{let k=it();if(!k)return;if(Ii())return;if(s&&s.startContainer.isConnected&&k.contains(s.commonAncestorContainer)){let N=window.getSelection();k.focus(),N?.removeAllRanges(),N?.addRange(s)}if(b.command==="link")oa(k,b.href);else if(b.command==="insertData")sa(k,b.token);else{let N=ku[b.command];if(N)$i(N,k)}c(),m()},A=(b)=>{let k=b.dataset.jxBoundProp,N=Au(b),F=N?.dataset.jxPath;if(!k||!N||!F)return!1;let B=q(F);if(!h(B,k))return!1;return x(b,B,k),!0},C=(b,k)=>{let N=di(t,b,k,He);if(!N)return!1;let[F,B]=k===-1?[b,N.path]:[N.path,b];return E.flush(),e.post({fromPath:F,intoPath:B,kind:"editMerge"}),!0},T=(b,k,N)=>{let F=Lr(t,He),B=J(b.path),X=J(k.path),ne=F.findIndex((ae)=>ae.dataset.jxPath===B),Ae=F.findIndex((ae)=>ae.dataset.jxPath===X);if(ne===-1||Ae===-1||Ae<=ne)return!1;let Ht=F.slice(ne+1,Ae).map((ae)=>q(ae.dataset.jxPath));return E.flush(),e.post({between:Ht,from:b,kind:"editRangeReplace",text:N,to:k}),!0},g=()=>c(),v=()=>c(),P=()=>c(),E=ta(t,{getMode:()=>n?.getMode?.()??"edit",isEditableBlock:He,onActivate:(b,k)=>y(b,k),onDeactivate:()=>{if(me())xe()},onCommitTick:()=>Li(),onMergeBackward:(b)=>C(b.path,-1),onMergeForward:(b)=>C(b.path,1),onReplaceRange:(b,k,N)=>T(b,k,N),onPropActivate:A,onSelectionChange:()=>m(),onSplit:()=>Hi()}),_=(b)=>Vi(b),R=()=>{if(ji())Gr()},I=()=>{if(!w)w=!0,e.post({kind:"editInput"})};t.addEventListener("input",I),t.addEventListener("keydown",_),t.addEventListener("input",R),r.addEventListener("mouseup",g,!0),r.addEventListener("keyup",v,!0),r.addEventListener("blur",P,!0);let te=e.onMessage((b)=>{if(b.kind==="applyFormat"){S(b.intent);return}if(b.kind==="openSlash"){zr({anchored:!1});return}if(b.kind==="flushEdits"){E.flush(),e.post({kind:"flushComplete",reqId:b.reqId});return}if(b.kind==="endEdit"){if(me())xe();return}if(b.kind!=="enterEdit")return;if(!o())return;if(b.prop!==void 0){let F=ca(t,b.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(b.prop)}"]`);if(F)A(F);return}let k=ca(t,b.path);if(k&&He(k))E.placeCaret({offset:b.offset??0,path:b.path})});return()=>{if(t.removeEventListener("keydown",_),t.removeEventListener("input",R),t.removeEventListener("input",I),r.removeEventListener("mouseup",g,!0),r.removeEventListener("keyup",v,!0),r.removeEventListener("blur",P,!0),E.stop(),te(),f(),s=null,me())xe()}}var $u=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function fa(e,t){let n=!1,r=null,o=null,s={dismiss:()=>{if(!n)return;n=!1,o=null,e.post({kind:"slashDismiss"})},isOpen:()=>n,show:(l,u,f)=>{if({onSelect:r}=f,n&&u===o)return;n=!0,o=u;let d=oe(l);e.post({filter:u,kind:"slashShow",rect:{height:d.height,width:d.width,x:d.left,y:d.top},...f.showFilter===!0?{showFilter:!0}:{}})}};Wr(s);let i=(l)=>{if(!n||!$u.has(l.key))return;l.preventDefault(),l.stopPropagation(),e.post({key:l.key,kind:"slashNav"})},a=()=>{if(n)s.dismiss()};t.addEventListener("keydown",i,!0),t.addEventListener("mousedown",a,!0);let c=e.onMessage((l)=>{if(l.kind==="slashSelect"){n=!1,o=null,r?.({...l.cmd});return}if(l.kind==="slashDismissed")n=!1,o=null});return()=>{t.removeEventListener("keydown",i,!0),t.removeEventListener("mousedown",a,!0),c(),Wr({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var da=["global","canvas","caret","grid","code","dock","palette"];var hp={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var Nu=["mod","ctrl","alt","shift"],Mu={mod:"mod",cmd:"mod",command:"mod",meta:"mod",super:"mod",ctrl:"ctrl",control:"ctrl",alt:"alt",opt:"alt",option:"alt",shift:"shift"},_u={up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",esc:"escape",space:" ",spacebar:" ",del:"delete",plus:"=",return:"enter"};function Ou(e){return[...Nu.filter((n)=>e[n]),e.key].join("+")}function Du(e){return/^Digit(\d)$/.exec(e??"")?.[1]}function pa(e,t){let n=Du(e.code)??e.key.toLowerCase();if(Mu[n])return"";let r={mod:t?e.metaKey:e.ctrlKey,ctrl:t?e.ctrlKey:!1,alt:e.altKey,shift:e.shiftKey,key:_u[n]??n};return Ou(r)}var yp=["global",...da.filter((e)=>e!=="global"&&e!=="palette")];var Lu=["caret","global"],Iu=["canvas","global"],Ju=["global"],Dn={chords:[],mac:!1};function ju(e){if(!(e instanceof HTMLElement))return!1;return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"}function Hu(e,t){if(e)return Lu;return t==="preview"?Ju:Iu}function Fu(e,t=Dn,n=!1,r="design"){if(ju(e.target))return!1;let o=pa(e,t.mac);if(!o)return!1;let s=Hu(n,r);return t.chords.some((i)=>i.chord===o&&s.includes(i.scope))}function Wu(e){return{altKey:e.altKey,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}}function ma(e,t=document,n=()=>!1,r=()=>Dn,o=()=>"design"){let s=(i)=>{if(!Fu(i,r(),n(),o()))return;i.preventDefault(),e.post({event:Wu(i),kind:"forwardKey"})};return t.addEventListener("keydown",s,!0),()=>t.removeEventListener("keydown",s,!0)}function Bu(e){return JSON.parse(JSON.stringify(e))}function Ln(e){return e===void 0||e===null?e:Bu(e)}function at(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function lt(e){if(Array.isArray(e))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!e.children)e.children=[];if(!Array.isArray(e.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return e.children}function oo(e,t){switch(t.op){case"set-key":{let n=at(e,t.path);if(!n)throw Error(`doc-op-node-not-found:${t.path.join("/")}`);let r=n;if(t.value===void 0)delete r[t.key];else r[t.key]=Ln(t.value);return}case"insert-child":{let n=at(e,t.parentPath);lt(n).splice(t.index,0,Ln(t.node));return}case"remove-child":{let n=at(e,t.parentPath);lt(n).splice(t.index,1);return}case"set-child":{let n=at(e,t.parentPath);lt(n).splice(t.index,1,Ln(t.node));return}case"move-child":{Ku(t);let n=at(e,t.fromParentPath),r=at(e,t.toParentPath),o=lt(n),s=lt(r),[i]=o.splice(t.fromIndex,1);s.splice(t.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${t.op}`)}function Ku(e){let t=[...e.fromParentPath,"children",e.fromIndex],n=e.toParentPath;if(n.length>=t.length&&t.every((r,o)=>r===n[o]))throw Error(`doc-op-move-into-self:${n.join("/")}`)}function ct(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((n)=>ct(n));let t={};for(let[n,r]of Object.entries(e)){if(n.startsWith("on")&&Po(r))continue;if(n==="children")t.children=Array.isArray(r)?r.map((o)=>ct(o)):ct(r);else if(n==="cases"&&typeof r==="object"){let o={};for(let[s,i]of Object.entries(r))o[s]=ct(i);t.cases=o}else if(n==="state"&&typeof r==="object"&&r!==null){let o={};for(let[s,i]of Object.entries(r)){if(i&&typeof i==="object"&&i.timing==="server")continue;o[s]=i}t.state=o}else if(n==="style"||n==="attributes"||n==="$media")t[n]=r;else t[n]=r}return t}var so=new WeakMap,In=new Set;function io(e,t,n){let r=Z(e,t);if(r===void 0)throw Error(`iframe-patch-node-not-found:${t.join("/")}`);let o=typeof r==="string"?r:Te(ct(r)),{result:s,stop:i}=xn(()=>de(o,n.defs,{_path:Vu(t,n),onNodeCreated:Hr(n.mapperCtx)}));if(In.add(i),s instanceof HTMLElement)so.set(s,i);return s}function ao(e){let t=[e,...e.querySelectorAll("*")];for(let n of t){if(!(n instanceof HTMLElement))continue;mn(n);let r=so.get(n);if(r)r(),In.delete(r),so.delete(n)}}function ha(){for(let e of In)e();In.clear()}function Vu(e,t){let{mapperCtx:n}=t;if(n.layoutWrapped&&n.pageContentPrefix&&e[0]==="children"){let[,r]=e;return typeof r==="number"?[...n.pageContentPrefix,r+(n.pageContentOffset??0),...e.slice(2)]:[...n.pageContentPrefix,...e.slice(1)]}return e}function ya(e,t,n,r,o){for(let i of t)oo(e,i);if(!o?.length){for(let i of t)ga(e,i,n,r);return}let s=new Set(o.map((i)=>J(i)));for(let i of t){if(i.op==="set-key"&&s.has(J(i.path))){Uu(e,i.path,n);continue}ga(e,i,n,r)}}function Uu(e,t,n){let r=Ea(n,t);if(r)ut(r,Z(e,t))}function lo(e){if(!e)throw Error("iframe-patch-no-render-ctx");return e}function ga(e,t,n,r){switch(t.op){case"set-key":{if(t.key==="style"){Xu(e,t.path,n,r);return}if(t.key==="textContent"){Zu(e,t.path,n);return}if(t.key.startsWith("on"))return;xa(e,t.path,n,lo(r));return}case"insert-child":{qu(e,t.parentPath,t.index,n,lo(r));return}case"set-child":{xa(e,[...t.parentPath,"children",t.index],n,lo(r));return}case"remove-child":{zu(e,t.parentPath,t.index,n);return}case"move-child":{Gu(e,t.fromParentPath,t.fromIndex,t.toParentPath,t.toIndex,n);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(t)}`)}}function qu(e,t,n,r,o){let s=We(r,t),i=Z(e,t),a=io(e,[...t,"children",n],o);Jn(r,t,n,1),ba(s,a,wa(s,i,n)),ut(s,i)}function xa(e,t,n,r){let o=We(n,t),s=io(e,t,r);ao(o),o.replaceWith(s)}function zu(e,t,n,r){let o=We(r,[...t,"children",n]),s=o.parentElement;if(ao(o),o.remove(),Jn(r,t,n+1,-1),s)ut(s,Z(e,t))}function Gu(e,t,n,r,o,s){let i=[...t,"children",n],a=We(s,i),c=a.parentElement,l=We(s,r);a.remove(),Jn(s,t,n+1,-1);let u=jn(l)??r;Jn(s,u,o,1),Yu(a,i,[...u,"children",o]);let f=Z(e,u);if(ba(l,a,wa(l,f,o)),c)ut(c,Z(e,jn(c)??t));ut(l,f)}function ut(e,t){for(let r of ia)e.classList.remove(r);let n=t?ro(t):null;if(n)e.classList.add(n)}function ba(e,t,n){if(n)n.before(t);else e.append(t)}function wa(e,t,n){let r=t?.textContent,o=r!=null&&String(r)!==""?1:0;return e.childNodes[o+n]??null}function Jn(e,t,n,r){let o=t.length;for(let s of e.querySelectorAll("[data-jx-path]")){let i=jn(s);if(!i||i.length<o+2||i[o]!=="children")continue;let a=i[o+1];if(typeof a!=="number"||a<n)continue;if(!t.every((l,u)=>i[u]===l))continue;let c=[...i];c[o+1]=a+r,s.dataset.jxPath=J(c)}}function Yu(e,t,n){let r=[e,...e.querySelectorAll("[data-jx-path]")];for(let o of r){let s=jn(o);if(!s||s.length<t.length||!t.every((i,a)=>s[a]===i))continue;o.dataset.jxPath=J([...n,...s.slice(t.length)])}}function jn(e){let t=e.dataset.jxPath;return t===void 0?null:q(t)}function Xu(e,t,n,r){let o=We(n,t),s=Z(e,t),i=r?.defs?.$media??{};En(o,Qu(s?.style),i)}function Zu(e,t,n){let r=We(n,t),o=Z(e,t);r.textContent=ef(o),ut(r,o)}function We(e,t){let n=Ea(e,t);if(!n)throw Error(`iframe-patch-element-not-found:${J(t)}`);return n}function Ea(e,t){let r=J(t).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),o=e.querySelector(`[data-jx-path='${r}']`);return o instanceof HTMLElement?o:null}function Qu(e){if(!e||typeof e!=="object")return;let t={};for(let[n,r]of Object.entries(e)){if(typeof r==="string"&&r.includes("${"))continue;t[n]=r}return t}function ef(e){let t=e?.textContent;if(t==null)return"";if(typeof t==="string")return t.includes("${")?Jt(t):t;if(typeof t==="object"&&t.$ref){let n=String(t.$ref);return`{${n.startsWith("#/state/")?n.slice(8):n}}`}return String(t)}function va(e){if(e===void 0)return"undefined";let t;try{t=typeof e==="string"?JSON.stringify(e):JSON.stringify(e)??"undefined"}catch{t=String(e)}if(t.length>48)t=`${t.slice(0,47)}…`;return t}function tf(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&"$expression"in e&&Array.isArray(e.parameters)}function nf(e,t){let n={};for(let r of Object.keys(e))try{let o=e[r];if(typeof o==="function"){if(tf(t?.[r]))n[r]=o;continue}let s=JSON.stringify(o);n[r]=s===void 0?null:JSON.parse(s)}catch{n[r]=null}return n}function rf(e,t,n){if(!n||n.length===0)return e;let r=t,o=e;for(let s of n){if(!r||typeof r!=="object")break;let i=r;if(i.$prototype==="Array"&&s==="map"){let a=i.items,c=a&&typeof a==="object"&&"$ref"in a?Y(a.$ref,o):a;if(Array.isArray(c)&&c.length>0){let l;try{l=structuredClone(c[0])}catch{l=null}let u=Object.create(o);u.$map={index:0,item:l},u["$map/item"]=l,u["$map/index"]=0,o=u}}r=i[s]}return o}function Sa(e,t,n,r){let o=n&&typeof n==="object"?n.state??null:null;return e.map(({id:s,node:i})=>{let a=new Map,c;try{c=rf(nf(t,o),n,r)}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[]}}try{if(!i||typeof i!=="object"||!("operator"in i))throw Error("not an expression node");return ee(i,c,null,void 0,{report:(l,u)=>a.set(l.join("/"),va(u))}),{id:s,values:[...a.entries()]}}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[...a.entries()]}}})}function ka(e){let t={};for(let n of Object.keys(e))try{let r=e[n];if(typeof r==="function")continue;let o=JSON.stringify(r);if(o===void 0){t[n]=null;continue}if(o.length>256000){t[n]="[large value omitted]";continue}t[n]=JSON.parse(o)}catch{t[n]=null}return t}var Ta={"jx-ui:/behaviors/color-area.ts":()=>(V("jqhna8zy"),import("./chunks/color-area-jqhna8zy.js")),"jx-ui:/behaviors/color-field.ts":()=>(V("embq5ctg"),import("./chunks/color-field-embq5ctg.js")),"jx-ui:/behaviors/color-slider.ts":()=>(V("1qmw7wqy"),import("./chunks/color-slider-1qmw7wqy.js")),"jx-ui:/behaviors/combobox.ts":()=>(V("773hdzyj"),import("./chunks/combobox-773hdzyj.js")),"jx-ui:/behaviors/dialog.ts":()=>(V("mtm9fq5t"),import("./chunks/dialog-mtm9fq5t.js")),"jx-ui:/behaviors/listbox.ts":()=>(V("s8fkmnq8"),import("./chunks/listbox-s8fkmnq8.js")),"jx-ui:/behaviors/menu.ts":()=>(V("37d07z9m"),import("./chunks/menu-37d07z9m.js")),"jx-ui:/behaviors/number-field.ts":()=>(V("gw7sq8rn"),import("./chunks/number-field-gw7sq8rn.js")),"jx-ui:/behaviors/action-group.ts":()=>(V("2mqby73c"),import("./chunks/action-group-2mqby73c.js")),"jx-ui:/behaviors/popover.ts":()=>(V("8htra4er"),import("./chunks/popover-8htra4er.js")),"jx-ui:/behaviors/select.ts":()=>(V("n3v7gwas"),import("./chunks/select-n3v7gwas.js")),"jx-ui:/behaviors/split.ts":()=>(V("pff8f3ze"),import("./chunks/split-pff8f3ze.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(V("8qh9a3bm"),import("./chunks/swatch-group-8qh9a3bm.js")),"jx-ui:/behaviors/tabs.ts":()=>(V("jwthg40w"),import("./chunks/tabs-jwthg40w.js")),"jx-ui:/behaviors/toolbar.ts":()=>(V("2nnzqhrj"),import("./chunks/toolbar-2nnzqhrj.js")),"jx-ui:/behaviors/tree.ts":()=>(V("h19v1jfz"),import("./chunks/tree-h19v1jfz.js")),"jx-ui:/behaviors/tooltip.ts":()=>(V("fd6g9xy3"),import("./chunks/tooltip-fd6g9xy3.js")),"jx-ui:/behaviors/textfield.ts":()=>(V("spy3hc77"),import("./chunks/textfield-spy3hc77.js")),"jx-ui:/behaviors/toast.ts":()=>(V("4d35zd64"),import("./chunks/toast-4d35zd64.js")),"jx-ui:/behaviors/toast-host.ts":()=>(V("8sjmfed3"),import("./chunks/toast-host-8sjmfed3.js")),"jx-ui:/color.ts":()=>(V("fpezvnkt"),import("./chunks/color-fpezvnkt.js")),"jx-ui:/icons.ts":()=>(V("p44xhjf0"),import("./chunks/icons-p44xhjf0.js"))};var of;function Aa(e){of=new URL("./",e).href}Aa(import.meta.url);for(let[e,t]of Object.entries(Ta))Xs(e,t);function jt(e,t,n,r){let o=Zr(e.x,e.y,r);if(!o)return null;return Qr(o,e.y,n,t)}function co(e){return[...e.dataTransfer?.types??[]].includes("Files")}var sf={type:"block"},fo={},uo=null;function Ca(e){return e?{...e,versions:fo}:null}function af(e,t){let n=e.dataset?.jxPath;if(n==null)return null;let r=q(n),o=t?Z(t,r):void 0;return{path:r,rect:Fe(e),tagName:(be(o?.tagName)||e.tagName).toLowerCase()}}function lf(e){if(!(e instanceof Element))return null;if(e.closest("[data-jx-path]"))return null;let t=e.closest("[data-jx-layout-region]");if(!(t instanceof HTMLElement))return null;return{className:typeof t.className==="string"?t.className:"",layoutFile:t.dataset.jxLayoutFile??"",layoutPath:q(t.dataset.jxLayoutPath??"[]"),rect:Fe(t),tagName:t.tagName.toLowerCase()}}var cf=new Set(["style","textContent"]);function uf(e){let t=Ji();if(!t)return!1;for(let n of e){let r;if(n.op==="set-key"){if(cf.has(n.key)||n.key.startsWith("on"))continue;r=n.path}else if(n.op==="move-child"){if(r=n.fromParentPath,nt(r,t)||nt(n.toParentPath,t))return!0;continue}else r=n.parentPath;if(nt(r,t))return!0}return!1}var ff=2,df=5000,pf=500;function mf(e){let{channel:t,container:n}=e;fo={},uo=null;let r=null,o=null,s=-1,i=null,a=-1,c="design",l=null,u=null,f=Dn,d=null,m=null,w=-1,y=-1,h=0,x=null,S=n.ownerDocument.defaultView;function A(){if(h&&S)S.cancelAnimationFrame(h);h=0,x=null}function C(){h=0;let p=x?.src??m;if(!S||!x||!p||!i)return;let D=eo(x.y,S.innerHeight);if(D===0)return;let L=S.scrollY;if(S.scrollBy(0,D*Xi),S.scrollY===L)return;let re=jt(x,p,i,n.ownerDocument);t.post({...x.withCursor?{cursor:{x:x.x,y:x.y}}:{},dragSeq:x.dragSeq,gen:x.gen??w,kind:"dragOver",preview:re}),h=S.requestAnimationFrame(C)}function T(p,D,L){if(!S||eo(p.y,S.innerHeight)===0){A();return}if(x={dragSeq:D,withCursor:L!=null,x:p.x,y:p.y,...L?{gen:L.gen,src:L.src}:{}},!h)h=S.requestAnimationFrame(C)}let g=Yi(t,n.ownerDocument,{getGen:()=>a,getMode:()=>c,getShadowDoc:()=>i}),v=(p)=>{if(c!=="design"&&c!=="edit")return;let D=lf(p.target);if(D)t.post({hit:D,kind:"layoutHit"})};n.ownerDocument.addEventListener("click",v,!0);let P=ma(t,n.ownerDocument,me,()=>f,()=>c),E=ua(t,n,{getMode:()=>c,getShadowDoc:()=>i}),_=fa(t,n.ownerDocument),R=yi(n),I=30000,te=-1;function b(){let p=n.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),D=oe(n),L=0;for(let re of p)L=Math.max(L,oe(re).bottom-D.top);return L}function k(){let p=Math.max(n.scrollHeight,b()),D=Math.min(p,I);if(D>0&&Math.abs(D-te)>=1){te=D;let L=n.firstElementChild,re=L instanceof HTMLElement&&L.dataset.jxDefinitionRoot!==void 0;t.post({fragment:re,height:D,kind:"contentHeight"}),Be()}}let N=S?.ResizeObserver,F=N?new N(()=>k()):null,B=n.ownerDocument,X=0,ne=0,Ae=0,Ht="",ae=new Map;function Pa(){let p=Date.now();for(let[D,L]of ae)if(L<=p)ae.delete(D);return ae.size}function Ra(){return{animations:typeof B.getAnimations==="function"?B.getAnimations().filter((D)=>D.playState==="running").length:0,fonts:B.fonts?B.fonts.status==="loaded":!0,gen:a,images:Pa(),kind:"idle"}}function po(){X=0;let p=Ra(),D=`${p.gen}|${p.fonts}|${p.animations}|${p.images}`,L=D!==Ht;if(L)Ht=D,t.post(p);if(ne=p.fonts&&p.animations===0&&p.images===0?L?1:ne+1:0,ne>=ff){k();return}if(Date.now()>=Ae)return;X=S?S.requestAnimationFrame(po):0}function Be(){if(ne=0,Ae=Date.now()+df,!X&&S)X=S.requestAnimationFrame(po)}let mo=(p)=>{if(p.target instanceof HTMLImageElement)ae.set(p.target,Date.now()+pf),Be()},ho=(p)=>{if(p.target instanceof HTMLImageElement&&ae.delete(p.target))Be()};n.addEventListener("error",mo,!0),n.addEventListener("load",ho,!0),Be(),F?.observe(n);let go=(p)=>{if(c==="preview"){if(p.ctrlKey||p.metaKey)p.preventDefault();return}p.preventDefault(),t.post({ctrlKey:p.ctrlKey,deltaX:p.deltaX,deltaY:p.deltaY,kind:"forwardWheel",metaKey:p.metaKey,shiftKey:p.shiftKey,x:p.clientX,y:p.clientY})};n.ownerDocument.addEventListener("wheel",go,{passive:!1});let $a=300,xo=0,yo=(p,D)=>{p.preventDefault(),p.stopPropagation();let L={x:p.clientX,y:p.clientY},re=n.ownerDocument,O=Zr(L.x,L.y,re),ye=O?af(O,i):null,Wt=i&&O?Qr(O,L.y,i,sf):null;if(D==="fileDragOver"){if(p.dataTransfer)p.dataTransfer.dropEffect="copy";t.post({hit:ye,kind:"fileDragOver",preview:Wt});return}t.post({files:[...p.dataTransfer?.files??[]],hit:ye,kind:"fileDrop",preview:Wt})},Ft=(p)=>{if(!m){if(co(p)){yo(p,"fileDragOver");return}let re=Date.now();if(re-xo>=$a)xo=re,t.post({kind:"nativeDragEnter"});return}if(p.preventDefault(),p.dataTransfer)p.dataTransfer.dropEffect="move";let D={x:p.clientX,y:p.clientY},L=i?jt(D,m,i,n.ownerDocument):null;t.post({cursor:D,dragSeq:y,gen:w,kind:"dragOver",preview:L}),T(D,y)},bo=(p)=>{if(!m){if(co(p))yo(p,"fileDrop");return}p.preventDefault();let D={x:p.clientX,y:p.clientY},L=i?jt(D,m,i,n.ownerDocument):null;t.post({dragSeq:y,gen:w,instruction:L?.instruction??null,kind:"dropResult",targetPath:L?.targetPath??null}),m=null,w=-1,y=-1,A()},wo=(p)=>{if(!m&&co(p)&&!p.relatedTarget)t.post({kind:"fileDragLeave"})};n.ownerDocument.addEventListener("dragenter",Ft,!0),n.ownerDocument.addEventListener("dragover",Ft,!0),n.ownerDocument.addEventListener("dragleave",wo,!0),n.ownerDocument.addEventListener("drop",bo,!0);let Na=t.onMessage((p)=>{if(p.kind==="measure"){let{hidden:O,hits:ye}=Gi(p.paths,n.ownerDocument);t.post({hidden:O,hits:ye,kind:"geometry",reqId:p.reqId});return}if(p.kind==="evalExpr"){let O=p.gen===a&&d&&i?Sa(p.exprs,d.defs,i,p.contextPath):[];t.post({gen:p.gen,kind:"evalResult",reqId:p.reqId,results:O});return}if(p.kind==="patch"){let{gen:O}=p;if(O<a){t.post({gen:O,kind:"patchError",message:"patch-behind-render"});return}if(O>a||!i||!d){t.post({gen:O,kind:"patchError",message:"patch-ahead-of-render"});return}let ye=new Set((p.echoPaths??[]).map((Oe)=>J(Oe))),Wt=ye.size===0?p.forwardOps:p.forwardOps.filter((Oe)=>!(Oe.op==="set-key"&&ye.has(J(Oe.path)))),Eo=me()&&uf(Wt),vo=Eo?Nn(n,He):null;if(Eo)xe();try{if(ya(i,p.forwardOps,n,d,p.echoPaths),_t(n,l),tt(n,u),vo)It(n,vo);t.post({gen:O,kind:"patchComplete"}),Be()}catch(Oe){t.post({gen:O,kind:"patchError",message:String(Oe?.message??Oe)})}return}if(p.kind==="styleUpdate"){if(p.gen!==a||!i)return;i.style=p.style;let O=n.firstElementChild;if(O instanceof HTMLElement)En(O,p.style,i.$media??{});return}if(p.kind==="dragStart"){m=p.src,w=p.gen,y=p.dragSeq;return}if(p.kind==="dragEnd"||p.kind==="dragCancel"){m=null,w=-1,y=-1,A();return}if(p.kind==="dragMove"){let O=m&&i?jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,kind:"dragOver",preview:O}),T(p.cursor,p.dragSeq);return}if(p.kind==="drop"){let O=m&&i?jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,instruction:O?.instruction??null,kind:"dropResult",targetPath:O?.targetPath??null}),m=null,w=-1,y=-1,A();return}if(p.kind==="assetVersions"){fo=p.versions;let O=Ca(uo);if(O)yn((ye)=>$t(ye,O));return}if(p.kind==="keymap"){f={chords:p.chords,mac:p.mac};return}if(p.kind==="setColorScheme"){jr(n.ownerDocument,p.scheme);return}if(p.kind==="setPopoverOpen"){if(c==="preview")return;l=p.path===null?null:J(p.path),_t(n,l),tt(n,u),k();return}if(p.kind==="setDialogOpen"){if(c==="preview")return;u=p.path===null?null:J(p.path),tt(n,u),k();return}if(p.kind==="redefineElement"){ai(p.doc,p.base);return}if(p.kind==="setLocale"){let O=n.ownerDocument.documentElement;if(p.locale===null)O.removeAttribute("lang"),O.removeAttribute("dir");else O.setAttribute("lang",p.locale),O.setAttribute("dir",p.dir);return}if(p.kind==="siteStyleUpdate"){Jr(p.siteStyle,p.media);return}if(p.kind!=="render"||p.gen<s)return;if(jr(n.ownerDocument,p.colorScheme??null),me())xe();s=p.gen,uo=p.assets??null,Di(p.editableTags??null);let{gen:D,mapperCtx:L}=p,re=p.shadowDoc;(async()=>{try{if(ha(),o?.(),o=null,r?.dispose(),ni(n.ownerDocument),r=await bi({assets:Ca(p.assets??null),container:n,doc:p.doc,docBase:p.docBase,mapperCtx:{arrayPaths:new Set(L.arrayPaths),canvasMode:L.canvasMode,layoutWrapped:L.layoutWrapped,pageContentOffset:L.pageContentOffset,pageContentPrefix:L.pageContentPrefix},diffMarks:p.diffMarks??null,mode:p.mode,popoverOpen:p.popoverOpen?J(p.popoverOpen):null,dialogOpen:p.dialogOpen?J(p.dialogOpen):null,siteStyle:p.siteStyle,...p.allowAutoRequests?{allowAutoRequests:!0}:{}}),D===s){l=p.popoverOpen?J(p.popoverOpen):null,u=p.dialogOpen?J(p.dialogOpen):null,_t(n,l),tt(n,u),i=re,d=r.ctx,a=D,c=p.mode,t.post({gen:D,kind:"renderComplete"}),Be();let O=r.ctx.defs;o=Fs(()=>{try{t.post({gen:D,kind:"dataScope",scope:ka(O)})}catch{}}),k()}}catch(O){t.post({gen:D,kind:"renderError",message:String(O?.message??O)})}})()});return t.post({kind:"ready"}),()=>{if(Na(),g(),P(),E(),_(),R(),X&&S)S.cancelAnimationFrame(X);X=0,n.removeEventListener("error",mo,!0),n.removeEventListener("load",ho,!0),A(),F?.disconnect(),n.ownerDocument.removeEventListener("click",v,!0),n.ownerDocument.removeEventListener("wheel",go),n.ownerDocument.removeEventListener("dragenter",Ft,!0),n.ownerDocument.removeEventListener("dragleave",wo,!0),n.ownerDocument.removeEventListener("dragover",Ft,!0),n.ownerDocument.removeEventListener("drop",bo,!0),o?.(),r?.dispose()}}function hf(e){let t=new URLSearchParams(e.location.search);js(t.get("rpcToken"));let n=t.get("parentOrigin"),r=n||"*";if(!n)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let o=e.document.querySelector("#jx-canvas-root")??e.document.body,s=ko({acceptOrigin:r,source:e,target:e.parent,targetOrigin:r,token:t.get("token")||""});return mf({channel:s,container:o})}if(typeof window<"u"&&window.parent!==window)hf(window);export{ff as IDLE_QUIET_FRAMES,df as IDLE_WATCH_MAX_MS,pf as IMAGE_RETRY_WINDOW_MS,hf as bootCanvasIframe,af as fileDropHitFor,co as isExternalFileDrag,lf as layoutHitFor,uf as patchDisturbsActiveEdit,mf as startCanvasIframe};
313
313
 
314
- //# debugId=A47CEE4258DF3BA464756E2164756E21
314
+ //# debugId=C85ED0AE14F83A8D64756E2164756E21
315
315
  //# sourceMappingURL=iframe-entry.js.map