@jxsuite/studio 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/chunks/{2020-g8mwpbkq.js → 2020-cs2sb9t1.js} +3 -3
- package/dist/chunks/adapter-y5gdq19c.js +4 -0
- package/dist/chunks/cf-account-picker-882a7ecm.js +4 -0
- package/dist/chunks/cf-settings-20dznc3j.js +4 -0
- package/dist/chunks/components-q037dya7.js +4 -0
- package/dist/chunks/content-source-37x3vsap.js +4 -0
- package/dist/chunks/convert-to-repeater-grfep2w8.js +4 -0
- package/dist/chunks/editor-j5sq149q.js +4 -0
- package/dist/chunks/entry-commands-c5h3nqck.js +4 -0
- package/dist/chunks/extension-sections-dp8endhx.js +4 -0
- package/dist/chunks/file-ops-937cvqk6.js +4 -0
- package/dist/chunks/files-tznwe1p1.js +4 -0
- package/dist/chunks/format-host-e2pjvd25.js +4 -0
- package/dist/chunks/fs-events-fv64ak3s.js +4 -0
- package/dist/chunks/git-panel-gb713ttc.js +4 -0
- package/dist/chunks/grid-view-5amhg604.js +51 -0
- package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
- package/dist/chunks/iframe-host-t819mcg5.js +4 -0
- package/dist/chunks/{index-arg188jq.js → index-9ydfe04y.js} +3 -3
- package/dist/chunks/index-m0x5ztax.js +4 -0
- package/dist/chunks/{javascript-zcdmye2k.js → javascript-d9pqgc2p.js} +2 -2
- package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-800yvbem.js} +5 -5
- package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
- package/dist/chunks/layers-4bsr82wz.js +4 -0
- package/dist/chunks/layers-panel-b6shnaax.js +4 -0
- package/dist/chunks/lit-html-cfn61dn7.js +4 -0
- package/dist/chunks/media-picker-ej0kdh1j.js +4 -0
- package/dist/chunks/menu-rtxf9chb.js +4 -0
- package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-62dtmgbf.js} +3 -3
- package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
- package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-tj13ndtm.js} +3 -3
- package/dist/chunks/notify-ahs57a2z.js +4 -0
- package/dist/chunks/platform-v9xyfkbx.js +4 -0
- package/dist/chunks/publish-panel-bq36xcmj.js +4 -0
- package/dist/chunks/quick-search-zm00h9dh.js +4 -0
- package/dist/chunks/references-99ws0b0m.js +4 -0
- package/dist/chunks/right-panel-pq2f71q3.js +4 -0
- package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
- package/dist/chunks/studio-01kbbqg3.js +928 -0
- package/dist/chunks/{studio-hf4qdjc8.js → studio-01qza1n3.js} +4 -4
- package/dist/chunks/{studio-pkkw32j0.js → studio-03wwfvyt.js} +4 -4
- package/dist/chunks/{studio-7gqyhjns.js → studio-0bbxhhce.js} +4 -4
- package/dist/chunks/studio-0k9mvpgj.js +14 -0
- package/dist/chunks/studio-0scebvb9.js +6 -0
- package/dist/chunks/studio-1a99w39s.js +5 -0
- package/dist/chunks/studio-1wvfxkyy.js +5 -0
- package/dist/chunks/studio-1x8x26k3.js +5 -0
- package/dist/chunks/studio-222rqyyc.js +5 -0
- package/dist/chunks/studio-4xppwncr.js +4 -0
- package/dist/chunks/{studio-xcng8nx7.js → studio-54g077x3.js} +5 -5
- package/dist/chunks/studio-56z7evx4.js +10 -0
- package/dist/chunks/studio-5e9zsamh.js +9 -0
- package/dist/chunks/studio-65fhspdd.js +5 -0
- package/dist/chunks/studio-693nhyky.js +5 -0
- package/dist/chunks/{studio-7jazdy6y.js → studio-7pgy3xaf.js} +4 -4
- package/dist/chunks/studio-888knnkc.js +5 -0
- package/dist/chunks/studio-9mqfamps.js +5 -0
- package/dist/chunks/studio-a7xqhc3n.js +5 -0
- package/dist/chunks/studio-aje966s9.js +5 -0
- package/dist/chunks/studio-aqmph6k4.js +5 -0
- package/dist/chunks/studio-c6w3tq7t.js +5 -0
- package/dist/chunks/{studio-6j2jn55a.js → studio-c6zdm25z.js} +8 -8
- package/dist/chunks/{studio-f8jyp45j.js → studio-c9d3pxf7.js} +4 -4
- package/dist/chunks/studio-ceb34dxj.js +5 -0
- package/dist/chunks/studio-cvbkkfqb.js +5 -0
- package/dist/chunks/studio-cxt150pj.js +7 -0
- package/dist/chunks/studio-dkn3x3hz.js +5 -0
- package/dist/chunks/studio-e6re3rk1.js +5 -0
- package/dist/chunks/{studio-5n1km79v.js → studio-edbtvcd1.js} +4 -4
- package/dist/chunks/{studio-xc8ebsts.js → studio-eh0rac07.js} +4 -4
- package/dist/chunks/{studio-625ezz59.js → studio-evwgp1ym.js} +4 -4
- package/dist/chunks/{studio-he2fhrgp.js → studio-f195h2hq.js} +4 -4
- package/dist/chunks/studio-fqq890ap.js +4 -0
- package/dist/chunks/studio-frb0qbf7.js +6 -0
- package/dist/chunks/studio-gfn1kpxj.js +6 -0
- package/dist/chunks/studio-gh97gngt.js +5 -0
- package/dist/chunks/{studio-awqghqxv.js → studio-gp02nqnw.js} +4 -4
- package/dist/chunks/{studio-x9sagq2d.js → studio-hjbg8d5y.js} +7 -7
- package/dist/chunks/studio-j6gnhvaa.js +5 -0
- package/dist/chunks/studio-mwxgyn9h.js +7 -0
- package/dist/chunks/{studio-x5esgzct.js → studio-n78gjfy8.js} +4 -4
- package/dist/chunks/studio-nbxqcgvf.js +5 -0
- package/dist/chunks/{studio-p1eggxcf.js → studio-nt06yybj.js} +4 -4
- package/dist/chunks/{studio-hc9q4j24.js → studio-p7c1agz0.js} +5 -5
- package/dist/chunks/{studio-8r4y2x0z.js → studio-pwqfmt4p.js} +4 -4
- package/dist/chunks/{studio-5wfrgee9.js → studio-r3kaka4d.js} +4 -4
- package/dist/chunks/studio-semd1s8s.js +5 -0
- package/dist/chunks/studio-skzanb0k.js +5 -0
- package/dist/chunks/studio-spf2skgc.js +5 -0
- package/dist/chunks/{studio-b4epb26c.js → studio-st75kn99.js} +7 -7
- package/dist/chunks/{studio-eq27rrr0.js → studio-sxc0zvpt.js} +3 -3
- package/dist/chunks/studio-t1eedsyx.js +4 -0
- package/dist/chunks/{studio-73czgk6a.js → studio-tp642n5g.js} +4 -4
- package/dist/chunks/studio-tw7rre6s.js +5 -0
- package/dist/chunks/{studio-7by9a93k.js → studio-tzegmy4w.js} +4 -4
- package/dist/chunks/studio-vavmwshr.js +5 -0
- package/dist/chunks/studio-wma2c6g8.js +5 -0
- package/dist/chunks/studio-x92tgnee.js +64 -0
- package/dist/chunks/studio-xk0z6msk.js +5 -0
- package/dist/chunks/{studio-c4pnt1c6.js → studio-xry7tk3z.js} +5 -5
- package/dist/chunks/studio-xta2vxp6.js +9 -0
- package/dist/chunks/{studio-21enxdr8.js → studio-xy3tv3az.js} +4 -4
- package/dist/chunks/studio-y7jehjrp.js +5 -0
- package/dist/chunks/{studio-k1eaqyzm.js → studio-yr04mv2j.js} +4 -4
- package/dist/chunks/{studio-mhhc9btt.js → studio-zd4kayn2.js} +4 -4
- package/dist/chunks/studio-zpnk016a.js +16 -0
- package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-k9s9fcag.js} +5 -5
- package/dist/chunks/workspace-b69mgm0e.js +4 -0
- package/dist/chunks/ws-client-0ja08haa.js +4 -0
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +62 -59
- package/dist/studio.css +1 -1
- package/dist/studio.js +121 -123
- package/package.json +5 -5
- package/src/account/action-flow.ts +294 -0
- package/src/account/action-required.ts +68 -0
- package/src/account-status.ts +29 -1
- package/src/browse/library-model.ts +3 -1
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +3 -1
- package/src/canvas/asset-resolve.ts +79 -1
- package/src/canvas/iframe-entry.ts +38 -1
- package/src/canvas/iframe-host.ts +85 -0
- package/src/canvas/iframe-protocol.ts +13 -0
- package/src/canvas/stage-scrollbar.ts +7 -7
- package/src/files/asset-versions.ts +294 -0
- package/src/files/file-ops.ts +5 -8
- package/src/files/files.ts +61 -9
- package/src/files/fs-events.ts +279 -28
- package/src/files/media-meta.ts +2 -1
- package/src/files/media-paths.ts +5 -2
- package/src/files/media-upload.ts +5 -1
- package/src/new-project/add-repo-modal.ts +12 -1
- package/src/new-project/new-project-modal.ts +12 -1
- package/src/panels/git-panel.ts +25 -2
- package/src/panels/jump-bar.ts +132 -158
- package/src/panels/pane-context.ts +8 -8
- package/src/panels/pane-grid.ts +18 -26
- package/src/panels/style-panel.ts +2 -2
- package/src/platform-errors.ts +61 -1
- package/src/platforms/cloud.ts +389 -50
- package/src/platforms/devserver.ts +17 -1
- package/src/publish/pages-service.ts +17 -7
- package/src/services/ai-models.ts +30 -6
- package/src/services/ai-system-prompt.ts +81 -51
- package/src/services/context-manager.ts +41 -70
- package/src/services/document-assistant.ts +12 -3
- package/src/services/harness/chat-reducer.ts +115 -0
- package/src/services/harness/turn-hooks.ts +50 -0
- package/src/services/tool-executor.ts +69 -288
- package/src/services/tool-outcomes.ts +12 -10
- package/src/settings/preferences-accounts.ts +42 -3
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/studio.ts +20 -6
- package/src/surfaces/block-action-bar.json +6 -1
- package/src/surfaces/dialog.ts +5 -0
- package/src/surfaces/jump-bar.json +9 -12
- package/src/surfaces/jump-bar.ts +15 -16
- package/src/surfaces/pane-context.json +2 -2
- package/src/surfaces/pane-grid.json +8 -25
- package/src/surfaces/pane-grid.ts +7 -8
- package/src/surfaces/statusbar.json +71 -3
- package/src/surfaces/statusbar.ts +66 -139
- package/src/surfaces/style-panel.json +3 -3
- package/src/surfaces/style-panel.ts +11 -1
- package/src/surfaces/welcome.json +86 -1
- package/src/surfaces/welcome.ts +61 -2
- package/src/types.ts +84 -2
- package/src/ui/ai-managed-connect.ts +41 -4
- package/src/ui/media-picker.ts +2 -1
- package/dist/chunks/adapter-bsbs78x9.js +0 -4
- package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
- package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
- package/dist/chunks/components-s51h3b7c.js +0 -4
- package/dist/chunks/content-source-ty3be0qg.js +0 -4
- package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
- package/dist/chunks/editor-t002b41m.js +0 -4
- package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
- package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
- package/dist/chunks/file-ops-78zeytkm.js +0 -4
- package/dist/chunks/files-gatzrz8v.js +0 -4
- package/dist/chunks/format-host-r59b1651.js +0 -4
- package/dist/chunks/fs-events-f8h91ndt.js +0 -4
- package/dist/chunks/git-panel-y12zf7nj.js +0 -4
- package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
- package/dist/chunks/grid-view-tafenfm2.css +0 -1
- package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
- package/dist/chunks/index-5aghyrfh.js +0 -4
- package/dist/chunks/jx-validate-653krkrf.js +0 -4
- package/dist/chunks/layers-32p8gtae.js +0 -4
- package/dist/chunks/layers-panel-rs58m105.js +0 -4
- package/dist/chunks/lit-html-54bmkwz3.js +0 -4
- package/dist/chunks/media-picker-5bb04wct.js +0 -4
- package/dist/chunks/menu-cbha7w2e.js +0 -4
- package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
- package/dist/chunks/notify-dc1nz5ar.js +0 -4
- package/dist/chunks/platform-2m49s1zf.js +0 -4
- package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
- package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
- package/dist/chunks/references-vx7mbj9f.js +0 -4
- package/dist/chunks/right-panel-7jzpbxja.js +0 -4
- package/dist/chunks/section-registry-gjryse41.js +0 -4
- package/dist/chunks/studio-3znfhcxg.js +0 -5
- package/dist/chunks/studio-58qam27v.js +0 -4
- package/dist/chunks/studio-6j59fwaw.js +0 -5
- package/dist/chunks/studio-7z69g1gx.js +0 -5
- package/dist/chunks/studio-93j3v6zx.js +0 -5
- package/dist/chunks/studio-9gf6v8zy.js +0 -5
- package/dist/chunks/studio-9rhmettf.js +0 -4
- package/dist/chunks/studio-ac5aq677.js +0 -10
- package/dist/chunks/studio-as65vbns.js +0 -5
- package/dist/chunks/studio-bkv0sga4.js +0 -6
- package/dist/chunks/studio-bttmqef4.js +0 -5
- package/dist/chunks/studio-c3y9d41k.js +0 -5
- package/dist/chunks/studio-ccegp7gz.js +0 -9
- package/dist/chunks/studio-chxabn98.js +0 -6
- package/dist/chunks/studio-cktcdsxz.js +0 -16
- package/dist/chunks/studio-cnspfke5.js +0 -5
- package/dist/chunks/studio-de3p1ktm.js +0 -5
- package/dist/chunks/studio-fsbcn530.js +0 -928
- package/dist/chunks/studio-gftga7a3.js +0 -64
- package/dist/chunks/studio-hf1rpcq0.js +0 -4
- package/dist/chunks/studio-hz02hq70.js +0 -5
- package/dist/chunks/studio-jnb285we.js +0 -5
- package/dist/chunks/studio-jsv3s3s1.js +0 -5
- package/dist/chunks/studio-ks7cksh0.js +0 -5
- package/dist/chunks/studio-nptx0dbs.js +0 -5
- package/dist/chunks/studio-pg0z7k98.js +0 -5
- package/dist/chunks/studio-pve0b2f2.js +0 -5
- package/dist/chunks/studio-q7zmjv3b.js +0 -6
- package/dist/chunks/studio-rpmvw7kj.js +0 -5
- package/dist/chunks/studio-rwhss52s.js +0 -5
- package/dist/chunks/studio-sbg3g3h0.js +0 -5
- package/dist/chunks/studio-sq1bn60g.js +0 -14
- package/dist/chunks/studio-vwz7rma2.js +0 -5
- package/dist/chunks/studio-wa55e8gf.js +0 -5
- package/dist/chunks/studio-x0mzdha2.js +0 -5
- package/dist/chunks/studio-xrgpakvc.js +0 -9
- package/dist/chunks/studio-xt3djk1w.js +0 -7
- package/dist/chunks/studio-yh3nggx1.js +0 -7
- package/dist/chunks/studio-zmecp6hq.js +0 -5
- package/dist/chunks/workspace-g6dvaete.js +0 -4
- package/dist/chunks/ws-client-shf41j5p.js +0 -4
package/dist/iframe-entry.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
function Eo(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 vo(e){return e.getBoundingClientRect()}function So(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 ko(e){return Ke(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Jn(e){return ft(e)&&Array.isArray(e.body)}function jn(e){return re(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function Hn(e){return re(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Wt(e){return re(e)&&e.$prototype==="Array"}function ie(e){return typeof e==="string"&&e.includes("${")}function Fn(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function To(e){return _e(e)||ft(e)||Ke(e)}function Ao(e){if(!e)return[];return e.map((t)=>typeof t==="string"?t:t.name)}function Wn(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 Ra(e){if(typeof e==="string")return[e];if(!Wn(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 ge(e){return typeof e==="string"?e:Ra(e).join("|")}function Bt(e){return e.startsWith("#")}function Bn(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var Kt=Object.assign;var $a=Object.prototype.hasOwnProperty,Vt=(e,t)=>$a.call(e,t),Ve=Array.isArray,dt=(e)=>Po(e)==="[object Map]";var Co=(e)=>typeof e==="function",Na=(e)=>typeof e==="string",Ue=(e)=>typeof e==="symbol",qe=(e)=>e!==null&&typeof e==="object";var Ma=Object.prototype.toString,Po=(e)=>Ma.call(e),Ro=(e)=>Po(e).slice(8,-1);var Ut=(e)=>Na(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var qt=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},_a=/-\w/g,df=qt((e)=>e.replace(_a,(t)=>t.slice(1).toUpperCase())),Oa=/\B([A-Z])/g,pf=qt((e)=>e.replace(Oa,"-$1").toLowerCase()),$o=qt((e)=>e.charAt(0).toUpperCase()+e.slice(1)),mf=qt((e)=>e?`on${$o(e)}`:""),xe=(e,t)=>!Object.is(e,t);var Da="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var hf=Bn(Da+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var q;class _o{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 _o(e)}function Xt(e,t=!1){if(q)q.cleanups.push(e)}var H;var Kn=new WeakSet;class Yt{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,Kn.has(this))Kn.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Do(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,No(this),Lo(this);let e=H,t=ae;H=this,ae=!0;try{return this.fn()}finally{Io(this),H=e,ae=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)er(e);this.deps=this.depsTail=void 0,No(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)Kn.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(qn(this))this.run()}get dirty(){return qn(this)}}var Oo=0,mt,ht;function Do(e,t=!1){if(e.flags|=8,t){e.next=ht,ht=e;return}e.next=mt,mt=e}function Zn(){Oo++}function Qn(){if(--Oo>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 Lo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Io(e){let t,n=e.depsTail,r=n;while(r){let o=r.prevDep;if(r.version===-1){if(r===n)n=o;er(r),La(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function qn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Jo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Jo(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||!qn(e)))return;e.flags|=2;let t=e.dep,n=H,r=ae;H=e,ae=!0;try{Lo(e);let o=e.fn(e._value);if(t.version===0||xe(o,e._value))e.flags|=128,e._value=o,t.version++}catch(o){throw t.version++,o}finally{H=n,ae=r,Io(e),e.flags&=-3}}function er(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)er(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function La(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 Yt)e=e.effect.fn;let n=new Yt(e);if(t)Kt(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,jo=[];function Zt(){jo.push(ae),ae=!1}function Qt(){let e=jo.pop();ae=e===void 0?!0:e}function en(e,t=!1){if(H instanceof Yt)H.cleanup=e}function No(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 Ho{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 tn{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 Ho(H,this),!H.deps)H.deps=H.depsTail=t;else t.prevDep=H.depsTail,H.depsTail.nextDep=t,H.depsTail=t;Fo(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){Zn();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{Qn()}}}function Fo(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)Fo(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var zn=new WeakMap,Oe=Symbol(""),Gn=Symbol(""),xt=Symbol("");function X(e,t,n){if(ae&&H){let r=zn.get(e);if(!r)zn.set(e,r=new Map);let o=r.get(n);if(!o)r.set(n,o=new tn),o.map=r,o.key=n;o.track()}}function ke(e,t,n,r,o,s){let i=zn.get(e);if(!i){gt++;return}let a=(c)=>{if(c)c.trigger()};if(Zn(),t==="clear")i.forEach(a);else{let c=Ve(e),l=c&&Ut(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(Gn))}else if(l)a(i.get("length"));break;case"delete":if(!c){if(a(i.get(Oe)),dt(e))a(i.get(Gn))}break;case"set":if(dt(e))a(i.get(Oe));break}}}Qn()}function ze(e){let t=j(e);if(t===e)return t;if(X(t,"iterate",xt),Ae(e))return t;if(!be(e))return t.map(me);return yt(e)?t.map((n)=>De(me(n))):t.map(De)}function tr(e){return X(e=j(e),"iterate",xt),e}function pe(e,t){if(be(e))return yt(e)?De(me(t)):De(t);return me(t)}var Ia={__proto__:null,[Symbol.iterator](){return Vn(this,Symbol.iterator,(e)=>pe(this,e))},concat(...e){return ze(this).concat(...e.map((t)=>Ve(t)?ze(t):t))},entries(){return Vn(this,"entries",(e)=>(e[1]=pe(this,e[1]),e))},every(e,t){return ye(this,"every",e,t,void 0,arguments)},filter(e,t){return ye(this,"filter",e,t,(n)=>n.map((r)=>pe(this,r)),arguments)},find(e,t){return ye(this,"find",e,t,(n)=>pe(this,n),arguments)},findIndex(e,t){return ye(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ye(this,"findLast",e,t,(n)=>pe(this,n),arguments)},findLastIndex(e,t){return ye(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ye(this,"forEach",e,t,void 0,arguments)},includes(...e){return Un(this,"includes",e)},indexOf(...e){return Un(this,"indexOf",e)},join(e){return ze(this).join(e)},lastIndexOf(...e){return Un(this,"lastIndexOf",e)},map(e,t){return ye(this,"map",e,t,void 0,arguments)},pop(){return pt(this,"pop")},push(...e){return pt(this,"push",e)},reduce(e,...t){return Mo(this,"reduce",e,t)},reduceRight(e,...t){return Mo(this,"reduceRight",e,t)},shift(){return pt(this,"shift")},some(e,t){return ye(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 Vn(this,"values",(e)=>pe(this,e))}};function Vn(e,t,n){let r=tr(e),o=r[t]();if(r!==e&&!Ae(e))o._next=o.next,o.next=()=>{let s=o._next();if(!s.done)s.value=n(s.value);return s};return o}var Ja=Array.prototype;function ye(e,t,n,r,o,s){let i=tr(e),a=i!==e&&!Ae(e),c=i[t];if(c!==Ja[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 Mo(e,t,n,r){let o=tr(e),s=o!==e&&!Ae(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 Un(e,t,n){let r=j(e);X(r,"iterate",xt);let o=r[t](...n);if((o===-1||o===!1)&&Xa(n[0]))return n[0]=j(n[0]),r[t](...n);return o}function pt(e,t,n=[]){Zt(),Zn();let r=j(e)[t].apply(e,n);return Qn(),Qt(),r}var ja=Bn("__proto__,__v_isRef,__isVue"),Wo=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Ue));function Ha(e){if(!Ue(e))e=String(e);let t=j(this);return X(t,"has",e),t.hasOwnProperty(e)}class nr{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?Ga:Uo:o?Vo:Ko).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=Ve(e);if(!r){let a;if(s&&(a=Ia[t]))return a;if(t==="hasOwnProperty")return Ha}let i=Reflect.get(e,t,Te(e)?e:n);if(Ue(t)?Wo.has(t):ja(t))return i;if(!r)X(e,"get",t);if(o)return i;if(Te(i)){let a=s&&Ut(t)?i:i.value;return r&&qe(a)?Xn(a):a}if(qe(i))return r?Xn(i):nn(i);return i}}class rr extends nr{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t],s=Ve(e)&&Ut(t);if(!this._isShallow){let c=be(o);if(!Ae(n)&&!be(n))o=j(o),n=j(n);if(!s&&Te(o)&&!Te(n))if(c)return!0;else return o.value=n,!0}let i=s?Number(t)<e.length:Vt(e,t),a=Reflect.set(e,t,n,Te(e)?e:r);if(e===j(r)&&a){if(!i)ke(e,"add",t,n);else if(xe(n,o))ke(e,"set",t,n,o)}return a}deleteProperty(e,t){let n=Vt(e,t),r=e[t],o=Reflect.deleteProperty(e,t);if(o&&n)ke(e,"delete",t,void 0,r);return o}has(e,t){let n=Reflect.has(e,t);if(!Ue(t)||!Wo.has(t))X(e,"has",t);return n}ownKeys(e){return X(e,"iterate",Ve(e)?"length":Oe),Reflect.ownKeys(e)}}class Bo extends nr{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Fa=new rr,Wa=new Bo,Ba=new rr(!0);var Yn=(e)=>e,zt=(e)=>Reflect.getPrototypeOf(e);function Ka(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?Yn:t?De:me;return!t&&X(s,"iterate",c?Gn:Oe),Kt(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 Gt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Va(e,t){let n={get(o){let s=this.__v_raw,i=j(s),a=j(o);if(!e){if(xe(o,a))X(i,"get",o);X(i,"get",a)}let{has:c}=zt(i),l=t?Yn: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(xe(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?Yn:e?De:me;return!e&&X(c,"iterate",Oe),a.forEach((u,f)=>o.call(s,l(u),l(f),i))}};return Kt(n,e?{add:Gt("add"),set:Gt("set"),delete:Gt("delete"),clear:Gt("clear")}:{add(o){let s=j(this),i=zt(s),a=j(o),c=!t&&!Ae(o)&&!be(o)?a:o;if(!(i.has.call(s,c)||xe(o,c)&&i.has.call(s,o)||xe(a,c)&&i.has.call(s,a)))s.add(c),ke(s,"add",c,c);return this},set(o,s){if(!t&&!Ae(s)&&!be(s))s=j(s);let i=j(this),{has:a,get:c}=zt(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)ke(i,"add",o,s);else if(xe(s,u))ke(i,"set",o,s,u);return this},delete(o){let s=j(this),{has:i,get:a}=zt(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)ke(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)ke(o,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((o)=>{n[o]=Ka(o,e,t)}),n}function or(e,t){let n=Va(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(Vt(n,o)&&o in r?n:r,o,s)}}var Ua={get:or(!1,!1)},qa={get:or(!1,!0)},za={get:or(!0,!1)};var Ko=new WeakMap,Vo=new WeakMap,Uo=new WeakMap,Ga=new WeakMap;function Ya(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function nn(e){if(be(e))return e;return sr(e,!1,Fa,Ua,Ko)}function qo(e){return sr(e,!1,Ba,qa,Vo)}function Xn(e){return sr(e,!0,Wa,za,Uo)}function sr(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=Ya(Ro(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(be(e))return yt(e.__v_raw);return!!(e&&e.__v_isReactive)}function be(e){return!!(e&&e.__v_isReadonly)}function Ae(e){return!!(e&&e.__v_isShallow)}function Xa(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)?nn(e):e,De=(e)=>qe(e)?Xn(e):e;function Te(e){return e?e.__v_isRef===!0:!1}function le(e){return Za(e,!1)}function Za(e,t){if(Te(e))return e;return new zo(e,t)}class zo{constructor(e,t){this.dep=new tn,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||Ae(e)||be(e);if(e=n?e:j(e),xe(e,t))this._rawValue=e,this._value=n?e:me(e),this.dep.trigger()}}class Go{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new tn(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 Do(this,!0),!0}get value(){let e=this.dep.track();if(Jo(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(Co(e))r=e;else r=e.get,o=e.set;return new Go(r,o,n)}function rn(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var Qa=new Set(["all","print","screen","speech"]);function Yo(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return Qa.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 Xo(e,t){let n=[];for(let r of ir(e))for(let o of ir(t))n.push(el(r,o));return n.join(", ")}function el(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function ir(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 tl=/[\s>+~,()]/,nl=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function rl(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&&!tl.test(e[s-1]))s-=1;let i=nl.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 ar(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 rl(n,t)}var Ce="data-color-scheme";function on(e){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1]??null}function Zo(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${Ce}]))`,forced:`${e}:where([${Ce}="${t}"])`};return{auto:`:where(:root:not([${Ce}])) ${e}`,forced:`:where(:root[${Ce}="${t}"]) ${e}`}}function St(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function lr(e){return e.startsWith("--")?e:rn(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 Qo(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 ol(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 sl(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 il(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([lr(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=Qo(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=ol(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=Yo(g,r),x=T===null?g:`@media ${T}`,v=T===null?null:on(T);if(v!==null&&S!==null){let{auto:P,forced:E}=Zo(S,v);b(y,P,[...A,x],C),b(sl(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,Xo(y,C),S,il(C)?A:"descendant")}return b(e,n,[],"self"),a}var we="en-US",es="UTC",ts=[{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."}],ns=ts.map((e)=>e.path),rs=Object.fromEntries(ts.map((e)=>[e.path,e.params.indexOf("locale")]));function al(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function cr(e){if(e==="")return[];return e.split("/").map((t)=>al(t))}function ce(e,t){let n=e;for(let r of cr(t))n=n?.[r];return n}function ur(e){let t=e.$map;return t&&typeof t==="object"?t:void 0}var ss=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),is=new Set(["!","-"]),as=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),ll=new Set(["=","+=","-=","*=","/="]),cl=new Set(["push","pop","shift","unshift","splice"]),ls=new Set(["reduce","map","filter"]),cs=new Set(["?:","switch"]),us=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"]),ul=new Set([...ss,...is,...as,...ls,...cs,...us,"call"]),fl=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",...ns]),dl={"Intl/compare":(e,t,n,r)=>new Intl.Collator(n??we,r).compare(e,t),"Intl/displayName":(e,t,n,r)=>new Intl.DisplayNames(n??we,{...r,type:t??"language"}).of(e),"Intl/formatDate":(e,t,n)=>new Intl.DateTimeFormat(t??we,{timeZone:es,...n}).format(new Date(e)),"Intl/formatList":(e,t,n)=>new Intl.ListFormat(t??we,n).format(e),"Intl/formatNumber":(e,t,n)=>new Intl.NumberFormat(t??we,n).format(e),"Intl/formatRelativeTime":(e,t,n,r)=>new Intl.RelativeTimeFormat(n??we,r).format(e,t),"Intl/plural":(e,t,n)=>new Intl.PluralRules(t??we,n).select(e),"Intl/segment":(e,t,n)=>[...new Intl.Segmenter(n??we,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)};function pl(e,t,n){let r=rs[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 ml(e){return e.startsWith("window#/")&&fl.has(e.slice(8))}function fs(e){return ss.has(e)}var os=64,hl=64;function W(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>hl)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=sn(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 gl(e,t,n,r){let o=(s)=>{if(!e.slice(s.length).includes("/"))return t;return sn(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?sn(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function sn(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?Pe(s,o.slice(1).join("/")):s}if(e.startsWith("event#/")){let o=e.slice(7);return Pe(n,o)}if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=ur(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?Pe(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 Pe(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Pe(globalThis.document,e.slice(10));return ce(t,e)??null}function xl(e,t,n,r){if(e.startsWith("$map/")){let o=e.split("/"),[,s]=o,i,a=ur(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?Pe(i,c.join("/")):i;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:ur(t)??t}}if(e.startsWith("#/state/")){let o=e.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let i=cr(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=yl(e,t,n,r,o);return o?.report(o.path??[],s),s}function yl(e,t,n,r,o){let{operator:s,target:i,value:a,initial:c}=e;if(!ul.has(s))throw Error(`$expression: unknown operator "${s}"`);if(is.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>os)throw Error(`$expression: call depth exceeded (${os})`);let f=Array.isArray(a)?a.map((m,w)=>F(m,t,n,r,W(o,["value",w]))):[];if(l.startsWith("window#/")){if(!ml(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),w=dl[m];if(w)return w(...pl(m,f,t));let b=Pe(globalThis.window,m),g=m.lastIndexOf("/"),y=g===-1?globalThis.window:Pe(globalThis.window,m.slice(0,g));return b.apply(y,f)}let d=sn(l,t,n,r);if(typeof d==="function")return d.apply(gl(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(cs.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(as.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(ll.has(s)){let l=F(a,t,n,r,W(o,"value")),{obj:u,key:f}=xl(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(cl.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(us.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(ls.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 Pe(e,t){return ce(e,t)}function Le(e,t,n,r){return F(e,t,n,r)}function an(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function ds(e){let t=an(e);return t.startsWith("/")?t:`/${t}`}function ps(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function bl(e,t){return e===t||e.startsWith(`${t}/`)}function ms(e,t){let n=an(t);for(let r of ps(e,"dir")){let o=an(r.dir);if(!bl(n,o)||n===o)continue;let i=n.slice(o.length+1).split("/").map((a)=>encodeURIComponent(a)).join("/");return`${ds(r.urlPrefix)}/${i}`}return null}function wl(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 ps(e,"urlPrefix")){let s=ds(o.urlPrefix);if(!r.startsWith(`${s}/`))continue;let a=r.slice(s.length+1).split("/");if(a.some((c)=>c===""||c==="."||c===".."))return null;return`${an(o.dir)}/${a.join("/")}`}return null}var _f=String.raw`"'\s<>()\\`;var El="public";function Tt(e){let t=e.search(/[#?]/);return t===-1?{path:e,suffix:""}:{path:e.slice(0,t),suffix:e.slice(t)}}function fr(e){return e===""||e.startsWith("/")||e.startsWith("#")||e.includes("${")||/^[a-z][\w+.-]*:/i.test(e)}function dr(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function pr(e,t){let r=(e===""||e==="."?[]:dr(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 vl(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=wl(t,r);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))i.push(dr(c));continue}i.push(a==="root"?s:`${El}/${s}`)}return[...new Set(i)]}function hs(e,t,n,r){let{path:o}=Tt(e);if(o==="")return null;if(fr(e))return o.startsWith("/")?vl(o,n,r)[0]??null:null;if(o.endsWith("/"))return null;let s;try{s=decodeURIComponent(o)}catch{return null}let i=pr(t,s);if(i===null||i===""||i===dr(t))return null;return i}function gs(e){return e.split("/").map((t)=>encodeURIComponent(t)).join("/")}function xs(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 ys(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Sl(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(Sl(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 bs(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 ws(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 mr=new Map;async function Er(e,t){if(typeof e!=="string")return e;let n=t?.resolver?.(e);if(n)return n;if(mr.has(e))return mr.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 mr.set(e,r),r}var kl=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),_s={skip:!1};function Os(e){_s.skip=e}var Ds={skip:!1};function Ls(e){Ds.skip=e}var gr=null;function Is(e){gr=e||null}function Js(e){return gr?`${e}?token=${encodeURIComponent(gr)}`:e}function js(e){let t=Ge(!0);return t.run(()=>{z(e)}),()=>t.stop()}function hn(e){let t=Ge(!0);try{return{result:t.run(e),stop:()=>t.stop()}}catch(n){throw t.stop(),n}}var Hs=!1;function Fs(e){Hs=e}var Tl=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Al={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};function Cl(e){if(!Hs||!e.includes("v"))return e;return e.replace(Tl,(t,n,r)=>`${n}${Al[r.toLowerCase()]??`cq${r}`}`)}var Ws=!1;function Bs(e){Ws=e}var vr=!1;function Ks(e){vr=e}var Sr=!1;function Vs(e){Sr=e}var cn=!1;function xr(e){return cn||e.dataset.jxPath!==void 0}function Pl(e,t){if(Ws&&t==="href"&&(e.tagName==="A"||e.tagName==="AREA"))return"data-jx-href";if(vr&&t==="popover"&&xr(e))return"data-jx-popover";if(Sr&&xr(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 Us(e){Ze=e}var Rl=new Set(["src","poster","data"]),$l=new Set(["srcset","imagesrcset"]),Nl=new Set(["LINK"]);function Ml(e,t){return Rl.has(t)||t==="href"&&Nl.has(e)}function kr(e,t,n){if(!Ze||n==="")return n;let r=t.toLowerCase();if($l.has(r)){let o=xs(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?ys(i):n}if(!Ml(e,r))return n;return Ze(n,r)??n}var _l=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function Ol(e){if(!Ze||!e.includes("url("))return e;return e.replaceAll(_l,(t,n,r)=>{let o=r===""?null:Ze?.(r,"url()")??null;return o===null?t:`url(${n}${o}${n})`})}function un(e){return Cl(Ol(e))}var qs=!1;function zs(e){qs=e}var Dl=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function Ll(e,t,n){if(!qs||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=Dl.exec(t)?.[1]??null;if(!r)return null;let o=j(n)[r];if(Te(o)||typeof o==="function")return null;if(typeof o==="object"&&o!==null)return null;return r}async function gn(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(jn(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(Hn(d))continue;if("default"in d){s[f]=d.default;continue}if(Il(d))continue;s[f]=d}}let l=nn(s);for(let[f,d]of Object.entries(i))if(typeof d==="string"&&d.includes("${"))l[f]=bt(()=>Ee(d,l));for(let[f,d]of Object.entries(i))if(Ke(d)){let m=d.$expression;if(ko(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(fs(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(Jn(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 Hl(d,l,f,n);for(let[f,d]of Object.entries(i))if(jn(d))l[f]=await Zl(d,l,f,n,r);if(!(r?.skipServerFunctions??_s.skip)){for(let[f,d]of Object.entries(i))if(Hn(d))l[f]=await rc(d,l,f,n)}let u=r?.media??ri;if(e.$media)l.$media=e.$media;else if(!l.$media&&Object.keys(u).length>0)l.$media=u;return l}function Il(e){for(let t of Object.keys(e))if(kl.has(t))return!0;return!1}function Ee(e,t){let n=t?.$map;return Function("state","$map","item","index",`return \`${e}\``)(t,n,n?.item,n?.index)}function Jl(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 jl(e,t){if(!Jl(e))return Ee(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 Gs(e,t){if(typeof t==="function"){Ie.delete(e),Xe.set(e,t);return}Xe.delete(e),Ie.set(e,t)}function Tr(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 Hl(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=yr(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=yr(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=Tr(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=Fn(e.body);else if(o)i=o.length<=1&&Fn(o.toString())}if(i)return bt(()=>o(t));return o}function yr(e){let t=e.parameters?Ao(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"]),Es=new Set,Fl="http://www.w3.org/2000/svg",Wl="http://www.w3.org/1998/Math/MathML";function Bl(e,t){if(e==="svg")return Fl;if(e==="math")return Wl;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=Ee(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(!Es.has(f))Es.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=Pr(e.tagName,o),i=s.includes("-")&&customElements.get(s);if(e.$props&&i)return Ms(e,o,n,r);if(e.$props){if(s.includes("-"))return Ms(e,o,n,r);let{$props:f,...d}=e;return ue(d,ac(e,o),n)}if(e.$switch)return Xl(e,o,n);let a=Bl(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(Ar(l,e,o),e.style&&s.includes("-"))Cr.set(l,e.style);xn(l,e.style??{},o.$media??{},o),bn(l,e.attributes??{},o);let u=e.children;if(Wt(u)){let f=n||c?{...n,_ns:c,_path:[...r,"children"]}:void 0;br(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(Wt(d))br(l,d,o,m);else l.append(ue(d,o,m))}return l}function Ar(e,t,n){for(let[r,o]of Object.entries(t)){if(Pt.has(r))continue;if(r.startsWith("$"))continue;if(r.startsWith("on")&&Ys(e,r,o,n))continue;Xs(e,r,o,n)}}function Ys(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(Jn(n)){let{body:i}=n;return e.addEventListener(o,(a)=>{Ye(i,s,a)}),!0}if(ft(n)&&typeof n.body==="string"){let i=yr(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 Kl(e,t,n){for(let[r,o]of Object.entries(t))if(r.startsWith("on")&&!Pt.has(r))Ys(e,r,o,n)}function Xs(e,t,n,r){let o=e,s=Ll(t,n,r);if(s)e.dataset.jxBoundProp=s;let i=(c)=>typeof c==="string"?kr(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(Ee(n,r)))});return}a(i(n))}function vs(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,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,["01w7484k","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 i=n.slice(o.length+1).split("/").map((a)=>encodeURIComponent(a)).join("/");return`${hs(r.urlPrefix)}/${i}`}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((c)=>c===""||c==="."||c===".."))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(`
|
|
3
3
|
`))},text(){return n.flatMap((r)=>r.texts.join(`
|
|
4
4
|
`)).join(`
|
|
5
|
-
`)}}}function
|
|
5
|
+
`)}}}function zl(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 Zs(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],vs(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?vs(r.sheet,()=>r.remove()):Vl(r)}var Ct=new WeakMap;function Ul(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:Zs(e)};return Ct.set(e,n),n}var fn=new WeakMap,Ss="\x01jx-scope\x01";function Qs(e){e.scratch.replaceAll([...e.scratchOwners.values()].flat())}function ks(e,t,n){let r=t.get(n);if(r.refs-=1,r.refs<=0)t.delete(n),e.shared.remove(r.inserted)}function Ts(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 dn(e,t){let n=fn.get(e);if(!n||t!==void 0&&n!==t)return;fn.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))Qs(r)}else ks(r,r.interned,n.interned);for(let o of n.hoisted)ks(r,r.hoisted,o)}function ei(e=document){let t=Ct.get(e);if(!t)return;Ct.delete(e);for(let n of t.scratchOwners.keys())fn.delete(n),delete n.dataset.jx;t.scratchOwners.clear(),t.interned.clear(),t.hoisted.clear(),t.shared.detach(),t.scratch?.detach()}function ql(e){return Boolean(e)&&typeof e==="object"&&"display"in e}var Cr=new WeakMap;function ti(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)?ti(s,o):o}return n}function xn(e,t,n={},r={}){ni(e,t,n,r,!1)}function yn(e,t,n={},r={}){ni(e,t??{},n,r,!0)}function ni(e,t,n,r,o){dn(e);let s=e.ownerDocument??document,i=Ul(s),a=(vr||Sr)&&xr(e)?(y)=>ar(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:Ss,transposeSelector:a,transposeValue:un});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)Ts(i,i.hoisted,y.text,[y.text]);let w=`jx-${Et(d.map((y)=>y.key).join("|"))}`,b=d.map((y)=>y.text.replaceAll(Ss,`[data-jx="${w}"]`));if(b.length>0)if(e.dataset.jx=w,o)i.scratch??=Zs(s),i.scratchOwners.set(e,b),Qs(i);else Ts(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):Ee(A,r);e.style.setProperty(S,un(String(C??"")))})}),g.stop=()=>y.stop()}fn.set(e,g),Xt(()=>dn(e,g),!0)}var zl=new Set(["contenteditable","draggable","spellcheck"]);function Gl(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||zl.has(n))return String(t);return t?"":null}function bn(e,t,n){for(let[r,o]of Object.entries(t)){let s=Pl(e,r),i=(a)=>{if(a===null||a===void 0){e.removeAttribute(s);return}if(typeof a==="boolean"){let c=Gl(s,a);if(c===null)e.removeAttribute(s);else e.setAttribute(s,c);return}e.setAttribute(s,kr(e.tagName,r,String(a)))};if(V(o))z(()=>i(G(o.$ref,n)));else if(ie(o))z(()=>i(jl(o,n)));else i(o)}}function br(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=qo({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)=>Yl(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]);Zt();try{mn(wr(d),()=>S(P,E))}finally{Qt()}},C=!1,T=!1,x=z(A,{scheduler:()=>{if(C)return;C=!0,queueMicrotask(()=>{if(C=!1,!T)x()})}});Xt(()=>{T=!0;for(let v of b)g(v);b=[]},!0)}function Yl(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 Pr(e,t){if(typeof e==="string")return e;if(!Wn(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 Xl(e,t,n){let r=n?._path??[],o=document.createElement(Pr(e.tagName,t)),s=Qe;if(n?.onNodeCreated)n.onNodeCreated(o,r,e,t);Ar(o,e,t),xn(o,e.style??{},t.$media??{},t),bn(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);Er(b,n?._ctx).then(async(g)=>{if(d!==i)return;let y=await gn(g,{},b,n?._ctx);if(d!==i)return;o.replaceChildren(),mn(wr(s),()=>m.run(()=>o.append(ue(g,y,w))))}).catch((g)=>console.error("Jx $switch: failed to load external case",f.$ref,g));return}Zt();try{mn(wr(s),()=>m.run(()=>o.append(ue(f,t,w))))}finally{Qt()}}),Xt(l,!0),o}async function Zl(e,t,n,r,o){if(e.$src)return Ql(e,t,n,r);switch(e.$prototype){case"Request":{let s=le(null),i=e.debounce??0,a=null;if(!e.manual&&!(o?.skipAutoRequests??Ds.skip))z(()=>{let c;if(ie(e.url))c=Ee(e.url,t);else({url:c}=e);if(!c||c==="undefined"||c.includes("undefined"))return;let l=new AbortController;en(()=>{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)?Ee(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=bs(document.cookie,s);if(c===null)return null;try{return JSON.parse(decodeURIComponent(c))}catch{return c}})()??e.default??null);return z(()=>{document.cookie=ws(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 Rr=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);async function Ql(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 tc(e,t,n,r)}async function ec(e,t,n,r){let o,s=Tr(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(!Rr.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 tc(e,t,n,r){let o=e.$src,s;if(!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("http")&&!o.startsWith("file:"))return ln(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 ln(e,t,n,r)}if(s.$implementation){if(JSON.stringify(s).includes('"#/$context/'))return ln(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 ec(e,w,b,r)}catch{return ln(e,t,n,r)}}let a=nc(s),c={};for(let[d,m]of Object.entries(e))if(!Rr.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 nc(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()):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(`
|
|
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 ln(e,t,n,r){let o={};for(let[c,l]of Object.entries(e))if(!Rr.has(c))o[c]=l;let s=Object.values(o).some((c)=>ie(c)),i=(c)=>fetch(Js("/__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)?Ee(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 rc(e,t,n,r){let{$src:o,$export:s}=e,i,a=Tr(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 As(e,t,n,r)}else return As(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();en(()=>{}),l(w).then((b)=>{m.value=b}).catch(()=>{})});else m.value=await l(d());return m}async function As(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(Js("/__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();en(()=>{}),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?hr(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 hr(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return hr(globalThis.document,e.slice(10));return ce(t,e)??null}function V(e){return _e(e)}function hr(e,t){return ce(e,t)}function Cs(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 oc(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(sc.some((s)=>(s in o)))continue}t.set(n,r)}return t}var sc=["$expression","$prototype","$ref","$src"],Ps=new Set;function ic(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 pn(e,t){if(!Bt(e))return!1;let n=t===void 0?e:`${t}:${e}`;if(!Ps.has(n))Ps.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 ac(e,t){let n=Object.create(t);for(let[r,o]of Object.entries(e.$props??{})){if(pn(r,"$props"))continue;n[r]=V(o)?G(o.$ref,t):o}return n}var ri={},At=new Map;async function oi(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 si(e){ri=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(!V(r))continue;let{href:o}=new URL(r.$ref,t),s=await Er(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 Rs=32,lc={expansion:0,frames:[]},Qe=lc;function mn(e,t){let n=Qe;Qe=e;try{return t()}finally{Qe=n}}function wr(e){return{expansion:e.frames.length,frames:e.frames}}function cc(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 uc(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)&&cc(e.props[r],t.props[r]))}function fc(e,t){let n=[...e.frames.map((r)=>r.tag),t.tag].join(" → ");if(e.frames.slice(e.expansion).some((r)=>uc(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>=Rs)throw Error(`Component nesting exceeds ${Rs} levels: ${n}. A component that renders itself with changing props needs a case that stops.`);return{expansion:e.expansion,frames:[...e.frames,t]}}var Ns=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,Ns.has(n))return;Ns.add(n),r=await Er(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,b=await gn(m,{},w,{base:w,media:null,root:this});for(let E of c)if(this.hasAttribute(E))Cs(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(pn(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(pn(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(Bt(E))continue;if(E in this&&this[E]!==void 0&&ic(this,E))b[E]=this[E],f[E]=this[E]}let S;try{S=fc(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(Bt(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=ql(m.style)?m.style:{display:"block",...m.style},T=ti(C,Cr.get(this));if(xn(this,T,b.$media??{},b),bn(this,m.attributes??{},b),Kl(this,m,b),!Array.isArray(m.children)&&m.textContent!==void 0)Xs(this,"textContent",m.textContent,b);let x=Array.isArray(m.children)?m.children:[],v=cn;cn||=this.dataset.jxPath!==void 0;try{mn(S,()=>{for(let E of x)this.append(ue(E,b))})}finally{cn=v}dc(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;Cs(this._state,u,d,oc(At.get(s)?.doc??i))}};customElements.define(s,l)}function Ms(e,t,n,r){let o=document.createElement(Pr(e.tagName,t));if(n?.onNodeCreated)n.onNodeCreated(o,r??[],e,t);for(let[i,a]of Object.entries(e.$props??{})){if(pn(i,"$props"))continue;let c=(l)=>{o[i]=typeof l==="string"?kr(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(Ee(a,t))});else c(a)}if(e.style)Cr.set(o,e.style);xn(o,e.style??{},t.$media??{},t),bn(o,e.attributes??{},t),Ar(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(Wt(a))br(o,a,t,c);else o.append(ue(a,t,c))}return o}function dc(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 Nr(e,t){if(!t||e==="")return null;if(t.space==="repo"){if(!t.fileBaseUrl)return null;let r=hs(e,t.documentDir,t.mounts,t.lanes);if(r===null)return null;let{suffix:o}=Tt(e);return`${t.fileBaseUrl}${gs(r)}${o}`}let[n]=t.mounts;return n?pc(e,t.documentDir,n):null}function pc(e,t,n){if(fr(e))return null;let{path:r,suffix:o}=Tt(e),s;try{s=decodeURIComponent(r)}catch{return null}let i=pr(t,s);if(i===null)return null;let a=ms([n],i);if(!a)return null;return`${a}${o}`}function Je(e){return`[data-jx-path='${e.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function mc(e,t){if(!t)return!1;return e.length<=t.length&&e.every((n,r)=>t[r]===n)}function ii(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&&!mc(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 ai(e){if(e.dataset.jxDefinitionRoot!==void 0)return!1;return e.getAttribute("contenteditable")==="false"||e.tagName.includes("-")}function wn(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(ai(n))return null}n=n.parentElement}return null}function En(e,t){let n=e.querySelector(Je(J(t)));return n instanceof HTMLElement?n:null}function Mr(e){return e.textContent?.length??0}function hc(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 gc(e,t){let n=Math.max(0,Math.min(t,Mr(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 $t(e,t,n){let r=wn(e,n);if(!r||!e)return null;let o=hc(r.el,e,t);return o===null?null:{offset:o,path:r.path}}function _r(e,t){let n=En(e,t.path);return n?gc(n,t.offset):null}function li(e){return e.offset<=0}function Nt(e,t){return J(e.path)===J(t.path)}function Or(e,t){let n=[];for(let r of e.querySelectorAll("[data-jx-path]"))if(t(r)&&!xc(r,e))n.push(r);return n}function xc(e,t){let n=e.parentElement;while(n&&n!==t){if(ai(n))return!0;n=n.parentElement}return!1}function ci(e,t,n,r){let o=Or(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 Dr="jx-site-style";function ui(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)=>on(u)!==null)&&!("colorScheme"in e))o.push(":root { color-scheme: light dark }",`:root:where([${Ce}="light"]) { color-scheme: light }`,`:root:where([${Ce}="dark"]) { color-scheme: dark }`);return o.join(`
|
|
10
|
-
`)}async function
|
|
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=`
|
|
11
11
|
.empty-media-placeholder {
|
|
12
12
|
display: inline-block;
|
|
13
13
|
min-width: 120px;
|
|
@@ -96,7 +96,7 @@ function Eo(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
|
|
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=`
|
|
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
|
|
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=`
|
|
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
|
|
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=`
|
|
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 Rc(e,t){let n=e.head.querySelector(`#${mi}`);if(t!=="stylebook"){n?.remove();return}if(n)return;let r=e.createElement("style");r.id=mi,r.textContent=Pc,e.head.append(r)}function Lr(e,t={}){let n=document.head.querySelector(`#${Dr}`);if(!e||typeof e!=="object"){n?.remove();return}let r=ui(e,t,un);if(n){n.textContent=r;return}let o=document.createElement("style");o.id=Dr,o.textContent=r,document.head.append(o)}function Ir(e,t){if(t)e.documentElement.dataset.colorScheme=t;else delete e.documentElement.dataset.colorScheme}function Mt(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 $c(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]=Nr(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("-")&&vn(e.canvasMode);if(a)r.contentEditable="false",t.push(o);let c=ii(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="",vn(e.canvasMode))r.contentEditable="false"}return}if(r.dataset.jxPath=J(c.path),!a&&vn(e.canvasMode)&&n(o))r.contentEditable="true"}}function hi(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 gi(e){let t=e.assets??null;Us(t?(i)=>Nr(i,t):null),Os(e.mode!=="preview"),Ls(e.mode!=="preview"&&!e.allowAutoRequests),Fs(!0),Bs(e.mode!=="preview"),Ks(e.mode!=="preview"),Vs(e.mode!=="preview"),zs(e.mode==="design"||e.mode==="edit"),Lr(e.siteStyle,e.doc.$media??{}),$c(e.doc,t),wc(e.container.ownerDocument,e.mode),vc(e.container.ownerDocument,e.mode),Ac(e.container.ownerDocument,e.mode),Rc(e.container.ownerDocument,e.mode),kc(e.container.ownerDocument,Boolean(e.diffMarks?.length)),si(e.doc.$media??{}),await yc(e.doc,e.docBase);let n=await gn(e.doc,{},e.docBase),r=Jr(e.mapperCtx),{result:o,stop:s}=hn(()=>ue(e.doc,n,{_path:[],onNodeCreated:r}));return e.container.replaceChildren(o),Mt(e.container,e.popoverOpen??null),et(e.container,e.dialogOpen??null),Cc(e.container,e.mode),Tc(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 xi(e){return e.length>=2?e.slice(0,-2):null}function yi(e){return e.at(-1)}function bi(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 Sn=14,Nc="empty-container-placeholder";function wi(e){let t=ne(e);return{height:t.height,width:t.width,x:t.x,y:t.y}}function Mc(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 Si(e,t,n){let r=e.dataset?.jxPath;if(r==null)return null;let o=U(r);if(e.classList.contains(Nc))return[{edge:"center",index:0,insertParentPath:o,rect:wi(e)}];let s=xi(o);if(!s)return null;let i=e.parentElement;if(!i)return null;let a=yi(o);if(typeof a!=="number")return null;let c=wi(e);if(Mc(i)){let u=t.x-c.x;if(u<Sn)return[kn("left",s,a,Ei(c,!0))];if(c.width-u<Sn)return[kn("right",s,a+1,vi(c,!0))];return null}let l=t.y-c.y;if(l<Sn)return[kn("top",s,a,Ei(c,!1))];if(c.height-l<Sn)return[kn("bottom",s,a+1,vi(c,!1))];return null}function kn(e,t,n,r){return{edge:e,index:n,insertParentPath:t,rect:r}}function Ei(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 vi(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 ki(e){if(!e||e.length===0)return"none";return e.map((t)=>`${t.edge}:${t.insertParentPath.join("/")}:${t.index}`).join("|")}var jr={$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 Tn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function Ai(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 Ci(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;Vc(r);let o=Oc(e,r,t);if(o.length>0)Dc(e,r,t,o);else Lc(e,r,t);nt(t)}function Oc(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 Dc(e,t,n,r){for(let o=r.length-1;o>=0;o--){let s=r[o];Pi(s)}}function Pi(e){if(!e.parentNode)return;let n=document.createDocumentFragment();while(e.firstChild)n.append(e.firstChild);e.replaceWith(n)}function Lc(e,t,n){let r=t.extractContents(),o=Ic(r),s=Jc(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 Ic(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 Jc(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(),jc(e))t=!0;if(Hc(e))t=!0;if(Fc(e))t=!0;if(Wc(e))t=!0;if(Bc(e))t=!0}}function jc(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&&Tn.has(o.tagName.toLowerCase())&&Kc(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 Hc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Tn.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 Fc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Tn.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 Wc(e){let t=!1,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=[];while(n.nextNode()){let o=n.currentNode;if(!Tn.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 Bc(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)Pi(o),t=!0;return t}function Kc(e,t){if(e.tagName.toLowerCase()==="a")return e.getAttribute("href")===t.getAttribute("href");return!0}function Vc(e){Ti(e,!0),Ti(e,!1)}function Ti(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=Uc(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 Uc(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"]),zc=new Set(Object.entries(jr.$defs).filter(([e,t])=>!qc.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));function Ri(e,t){return t?.[e.toLowerCase()]??zc.has(e.toLowerCase())}var Gc={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},$e=Gc;function Hr(e){$e=e}var _=null,oe=null,rt=null,_t=null,ot=null,Re=null,fe=!1,Dt="",Ot=!1,Ni=null;function Mi(e){Ni=e}function je(e){return Ri(e.tagName,Ni)}function Fr(e,t,n,r){if(_)he(!0);if(_=e,oe=t,rt=n.onCommit,_t=n.onSplit,ot=n.onInsert,Re=n.onEnd,fe=r?.plainText===!0,Dt=fe?e.textContent??"":"",Ot=!1,e.dataset.jxActiveBlock="",fe){try{e.contentEditable="plaintext-only"}catch{e.contentEditable="true"}e.focus()}e.addEventListener("keydown",Wr),e.addEventListener("input",Br),e.addEventListener("paste",Kr)}function he(e=!1){if(!_)return;if(ji(!1),$e.dismiss(),delete _.dataset.jxActiveBlock,fe)_.contentEditable="false";if(_.removeEventListener("keydown",Wr),_.removeEventListener("input",Br),_.removeEventListener("paste",Kr),_=null,oe=null,rt=null,_t=null,ot=null,fe=!1,Dt="",Ot=!1,e)Re=null;else if(Re){let t=Re;Re=null,t()}}function _i(){ji(!0)}function Oi(){return fe&&_!==null}function de(){return _!==null}function st(){return _}function Di(){return oe}function Li(){return $e.isOpen()}function Wr(e){if(fe){if(e.key==="Escape"){if(e.preventDefault(),e.stopPropagation(),_)_.textContent=Dt;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 Br(){if($e.isOpen())qr()}function Kr(e){e.preventDefault();let t=e.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,t)}function Ii(){if(!_t||!_||!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=$i(n.cloneContents()),s=$i(r.cloneContents()),i=[...oe],a=_t;return Ji(),a(i,o,s),!0}function Ji(){if(!_)return;if(delete _.dataset.jxActiveBlock,fe)_.contentEditable="false";if(_.removeEventListener("keydown",Wr),_.removeEventListener("input",Br),_.removeEventListener("paste",Kr),_=null,oe=null,rt=null,_t=null,ot=null,fe=!1,Dt="",Ot=!1,Re){let e=Re;Re=null,e()}}function ji(e){if(!rt||!_||!oe)return;if(fe){let n=(_.textContent??"").replaceAll(`
|
|
310
|
-
`," ");if(n===
|
|
311
|
-
`," ")&&!
|
|
312
|
-
`))requestAnimationFrame(()=>Ur())}function qr(){if(!_||!An)return;let e=window.getSelection();if(!e||!e.rangeCount){$e.dismiss();return}let t=e.getRangeAt(0),n=Cn(t),r=n.lastIndexOf("/");if(r===-1||n.length<Fi-1){$e.dismiss();return}let o=n.slice(r+1).toLowerCase();$e.show(_,o,{onSelect:Bi})}function Bi(e){if(!_||!ot||!oe)return;let t=An?window.getSelection():null;if(t&&t.rangeCount){let s=t.getRangeAt(0),a=Cn(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=Hi(_),r=[...oe],o=ot;Ji(),o(r,e,n)}function Xc(e,t){let{target:n}=e;return n===t||n===t.documentElement||n===t.body}function zr(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function Vi(e,t){let n=ne(e);return{path:U(t),rect:{height:n.height,width:n.width,x:n.x,y:n.y}}}function Ki(e){let t=zr(e instanceof Element?e:null);if(!t)return null;return Vi(t,t.dataset.jxPath)}function Zc(e){let t=e.checkVisibility;return typeof t==="function"?t.call(e,{checkVisibilityCSS:!0}):!0}function Ui(e,t=document){let n=[],r=[];for(let o of e){let s=t.querySelector(Je(J(o)));if(!s)continue;if(Zc(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 Qc=new Set(["toggle","show","hide"]);function eu(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=Qc.has(a)?a:"toggle";t.post({action:c,kind:"popoverTargetClick",targetPath:U(i)})}function tu(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 qi(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=Ki(x.target);if(v){let P=x;e.post({additive:P.ctrlKey===!0||P.metaKey===!0,hit:v,kind:"hit"})}eu(x.target,e),tu(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?Vi(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=zr(x instanceof Element?x:null),O=E&&P?Si(E,v,P):null,M=ki(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(zr(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(!Xc(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=Ki(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 nu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ru(e){let t=e instanceof Element?e:null;while(t){if(t.dataset?.jxPath)return t;t=t.parentElement}return null}function Yr(e,t,n){let r=So(e,t,n);return ru(r)}function Xr(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 Gr(r,s)?{edge:"inside",instruction:"make-child",referenceRect:He(e),targetPath:s}:null;return ou(d,t,s,r)}if(!Gr(r,s))return null;let i=Y(n,s),a=(ge(i?.tagName)||"div").toLowerCase(),c=Array.isArray(i?.children)&&i.children.some((d)=>d!=null&&typeof d==="object"),l=nu.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 ou(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(!Gr(r,a))return null;return{edge:s==="reorder-above"?"top":"bottom",instruction:s,referenceRect:He(e[i]),targetPath:a}}function Gr(e,t){if(e.type!=="tree-node")return!0;let n=e.path;if(bi(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 su=40,zi=12;function Zr(e,t,n=su){if(e<n)return-1;if(e>t-n)return 1;return 0}var Qr=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),eo=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),Gi=new Set(["deleteByCut","deleteContent"]),Yi=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),iu="format",au=new Set(["insertParagraph","insertLineBreak"]);function Xi(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(iu))return{kind:"reject"};if(t==="insertFromDrop"||t==="deleteByDrag")return{kind:"reject"};if(e.inPropHost)return au.has(t)?{kind:"reject"}:{kind:"native"};if(!n||!r)return{kind:"reject"};let o=Nt(n,r)&&n.offset===r.offset,s=!Nt(n,r);if(t==="insertParagraph")return{from:n,kind:"split",to:r};if(t==="insertLineBreak"&&!s)return{kind:"native"};if(o&&Qr.has(t)&&e.atBlockStart)return{at:n,kind:"mergeBackward"};if(o&&eo.has(t)&&e.atBlockEnd)return{at:n,kind:"mergeForward"};if(s){if(Yi.has(t)||t==="insertLineBreak")return{from:n,kind:"replaceRange",text:e.data,to:r};if(Qr.has(t)||eo.has(t)||Gi.has(t))return{from:n,kind:"replaceRange",text:"",to:r};return{kind:"reject"}}if(Yi.has(t)||Qr.has(t)||eo.has(t)||Gi.has(t))return{kind:"native"};return{kind:"native"}}var lu=500;function Pn(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=$t(n.anchorNode,n.anchorOffset,t),o=$t(n.focusNode,n.focusOffset,t);return r&&o?{anchor:r,head:o}:null}function Lt(e,t){let n=_r(e,t.anchor),r=_r(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 Zi(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=Pn(e,t.isEditableBlock);if(t.onCommitTick(),T)Lt(e,T)},l=!1,u=()=>{if(!t.onCommitTick||!r||l)return;a(),i=setTimeout(c,t.commitDelayMs??lu)},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=wn(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=$t(E,O,t.isEditableBlock),R=$t(M,h,t.isEditableBlock),N=wn(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=Xi({atBlockEnd:v?v.to.offset>=Mr(v.endEl):!1,atBlockStart:v?li(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(),!Nt(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:()=>Pn(e,t.isEditableBlock),forget:m,isComposing:()=>l,flush:()=>{if(l)return;if(i)a(),c()},placeCaret:(T)=>{let x=Lt(e,{anchor:T,head:T});if(x)b();return x},restore:(T)=>{let x=Lt(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 Qi=(e,t)=>document.execCommand(e,!1,t);function ea(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 cu(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 ta(e,t){let n=cu(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)Qi("createLink",t);nt(e)}function na(e,t){e.focus(),Qi("insertText",`\${${t}}`)}var Rn=new Set(["img","video","source","iframe","audio"]),$n="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",uu="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",fu=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function du(e){return fu.test(e)}var pu=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"]),mu=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),ra=["empty-text-placeholder","empty-container-placeholder"];function to(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(pu.has(ge(e.tagName)))return"empty-text-placeholder";if(mu.has(ge(e.tagName)))return"empty-container-placeholder";return null}function It(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function oa(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 hu(e){let t=e.map;return{children:t&&typeof t==="object"?[ve(t)]:[],className:"repeater-perimeter",tagName:"div"}}function ve(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>ve(i));if(e.$prototype==="Array")return hu(e);let t=e,n={},r=!1,o=Rn.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(du(l))c[l]=uu;else if(l==="href"||l==="action")c[l]="";else c[l]=It(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)=>ve(c));else if(a&&typeof a==="object"&&a.$prototype==="Array")n.children=[ve(a)];else n.children=ve(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?[ve(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?"":It(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")&&Rn.has(t.tagName||""))r=!0,n[i]=$n;else{let l=i==="src"||i==="href"||i==="poster"||i==="action";n[i]=l?"":It(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")&&Rn.has(t.tagName||""))r=!0,n[i]=$n;else n[i]=`{${l}}`}else if((i==="src"||i==="poster")&&a===""&&Rn.has(t.tagName||""))r=!0,n[i]=$n;else n[i]=ve(a);let s=to(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 gu={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},xu=["strong","em","u","del","sub","sup","code"],Nn="jx-pending-format",sa="jx-pending-format-style";function yu(e){let t=e.parentElement;while(t){if(t.tagName.includes("-"))return t;t=t.parentElement}return null}function bu(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(),rn(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"&&wu(o,t))return!0}if(Pt.has(t)||t.startsWith("$"))return!1;return e[t]!==void 0}function wu(e,t){try{let n=JSON.parse(e);return typeof n==="object"&&n!==null&&t in n}catch{return!1}}function ia(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 Eu(e){return{height:e.height,width:e.width,x:e.x,y:e.y}}function aa(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(`#${sa}`))return;let h=r.createElement("style");h.id=sa,h.textContent=`::highlight(${Nn}) { 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(Nn,new h(s.cloneRange()));else k.delete(Nn)},f=()=>{globalThis.CSS?.highlights?.delete(Nn)},d=()=>{let h=st();if(!h||!h.dataset.jxPath)return null;let k=a(h),R=k??s,N=R?Eu(vo(R)):null,B=k?k.collapsed:!0,se=xu.filter((ee)=>Ai(ee,h)),Q=ea(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)=>{oa(h),e.post({kind:"editStart",path:k}),Fr(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(bu(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}),Fr(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(Oi())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")ta(k,h.href);else if(h.command==="insertData")na(k,h.token);else{let R=gu[h.command];if(R)Ci(R,k)}c(),m()},S=(h)=>{let k=h.dataset.jxBoundProp,R=yu(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=ci(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=Or(t,je),B=J(h.path),se=J(k.path),Q=N.findIndex((Se)=>Se.dataset.jxPath===B),ee=N.findIndex((Se)=>Se.dataset.jxPath===se);if(Q===-1||ee===-1||ee<=Q)return!1;let We=N.slice(Q+1,ee).map((Se)=>U(Se.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=Zi(t,{getMode:()=>n?.getMode?.()??"edit",isEditableBlock:je,onActivate:(h,k)=>w(h,k),onDeactivate:()=>{if(de())he()},onCommitTick:()=>_i(),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:()=>Ii()}),E=(h)=>Wi(h),O=()=>{if(Li())qr()};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"){Ur({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=ia(t,h.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(h.prop)}"]`);if(N)S(N);return}let k=ia(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 vu=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function la(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}:{}})}};Hr(s);let i=(l)=>{if(!n||!vu.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(),Hr({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var ca=["global","canvas","caret","grid","code","dock","palette"];var ap={"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 Su=["mod","ctrl","alt","shift"],ku={mod:"mod",cmd:"mod",command:"mod",meta:"mod",super:"mod",ctrl:"ctrl",control:"ctrl",alt:"alt",opt:"alt",option:"alt",shift:"shift"},Tu={up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",esc:"escape",space:" ",spacebar:" ",del:"delete",plus:"=",return:"enter"};function Au(e){return[...Su.filter((n)=>e[n]),e.key].join("+")}function Cu(e){return/^Digit(\d)$/.exec(e??"")?.[1]}function ua(e,t){let n=Cu(e.code)??e.key.toLowerCase();if(ku[n])return"";let r={mod:t?e.metaKey:e.ctrlKey,ctrl:t?e.ctrlKey:!1,alt:e.altKey,shift:e.shiftKey,key:Tu[n]??n};return Au(r)}var up=["global",...ca.filter((e)=>e!=="global"&&e!=="palette")];var Pu=["caret","global"],Ru=["canvas","global"],$u=["global"],Mn={chords:[],mac:!1};function Nu(e){if(!(e instanceof HTMLElement))return!1;return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"}function Mu(e,t){if(e)return Pu;return t==="preview"?$u:Ru}function _u(e,t=Mn,n=!1,r="design"){if(Nu(e.target))return!1;let o=ua(e,t.mac);if(!o)return!1;let s=Mu(n,r);return t.chords.some((i)=>i.chord===o&&s.includes(i.scope))}function Ou(e){return{altKey:e.altKey,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}}function fa(e,t=document,n=()=>!1,r=()=>Mn,o=()=>"design"){let s=(i)=>{if(!_u(i,r(),n(),o()))return;i.preventDefault(),e.post({event:Ou(i),kind:"forwardKey"})};return t.addEventListener("keydown",s,!0),()=>t.removeEventListener("keydown",s,!0)}function Du(e){return JSON.parse(JSON.stringify(e))}function _n(e){return e===void 0||e===null?e:Du(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 no(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]=_n(t.value);return}case"insert-child":{let n=it(e,t.parentPath);at(n).splice(t.index,0,_n(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,_n(t.node));return}case"move-child":{Lu(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 Lu(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")&&To(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 ro=new WeakMap,On=new Set;function oo(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:ve(lt(r)),{result:s,stop:i}=hn(()=>ue(o,n.defs,{_path:Iu(t,n),onNodeCreated:Jr(n.mapperCtx)}));if(On.add(i),s instanceof HTMLElement)ro.set(s,i);return s}function so(e){let t=[e,...e.querySelectorAll("*")];for(let n of t){if(!(n instanceof HTMLElement))continue;dn(n);let r=ro.get(n);if(r)r(),On.delete(r),ro.delete(n)}}function da(){for(let e of On)e();On.clear()}function Iu(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 ha(e,t,n,r,o){for(let i of t)no(e,i);if(!o?.length){for(let i of t)pa(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))){Ju(e,i.path,n);continue}pa(e,i,n,r)}}function Ju(e,t,n){let r=ya(n,t);if(r)ct(r,Y(e,t))}function io(e){if(!e)throw Error("iframe-patch-no-render-ctx");return e}function pa(e,t,n,r){switch(t.op){case"set-key":{if(t.key==="style"){Bu(e,t.path,n,r);return}if(t.key==="textContent"){Ku(e,t.path,n);return}if(t.key.startsWith("on"))return;ma(e,t.path,n,io(r));return}case"insert-child":{ju(e,t.parentPath,t.index,n,io(r));return}case"set-child":{ma(e,[...t.parentPath,"children",t.index],n,io(r));return}case"remove-child":{Hu(e,t.parentPath,t.index,n);return}case"move-child":{Fu(e,t.fromParentPath,t.fromIndex,t.toParentPath,t.toIndex,n);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(t)}`)}}function ju(e,t,n,r,o){let s=Fe(r,t),i=Y(e,t),a=oo(e,[...t,"children",n],o);Dn(r,t,n,1),ga(s,a,xa(s,i,n)),ct(s,i)}function ma(e,t,n,r){let o=Fe(n,t),s=oo(e,t,r);so(o),o.replaceWith(s)}function Hu(e,t,n,r){let o=Fe(r,[...t,"children",n]),s=o.parentElement;if(so(o),o.remove(),Dn(r,t,n+1,-1),s)ct(s,Y(e,t))}function Fu(e,t,n,r,o,s){let i=[...t,"children",n],a=Fe(s,i),c=a.parentElement,l=Fe(s,r);a.remove(),Dn(s,t,n+1,-1);let u=Ln(l)??r;Dn(s,u,o,1),Wu(a,i,[...u,"children",o]);let f=Y(e,u);if(ga(l,a,xa(l,f,o)),c)ct(c,Y(e,Ln(c)??t));ct(l,f)}function ct(e,t){for(let r of ra)e.classList.remove(r);let n=t?to(t):null;if(n)e.classList.add(n)}function ga(e,t,n){if(n)n.before(t);else e.append(t)}function xa(e,t,n){let r=t?.textContent,o=r!=null&&String(r)!==""?1:0;return e.childNodes[o+n]??null}function Dn(e,t,n,r){let o=t.length;for(let s of e.querySelectorAll("[data-jx-path]")){let i=Ln(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 Wu(e,t,n){let r=[e,...e.querySelectorAll("[data-jx-path]")];for(let o of r){let s=Ln(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 Ln(e){let t=e.dataset.jxPath;return t===void 0?null:U(t)}function Bu(e,t,n,r){let o=Fe(n,t),s=Y(e,t),i=r?.defs?.$media??{};yn(o,Vu(s?.style),i)}function Ku(e,t,n){let r=Fe(n,t),o=Y(e,t);r.textContent=Uu(o),ct(r,o)}function Fe(e,t){let n=ya(e,t);if(!n)throw Error(`iframe-patch-element-not-found:${J(t)}`);return n}function ya(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 Vu(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 Uu(e){let t=e?.textContent;if(t==null)return"";if(typeof t==="string")return t.includes("${")?It(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 ba(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 zu(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 Gu(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 wa(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=Gu(zu(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("/"),ba(u))}),{id:s,values:[...a.entries()]}}catch(l){return{error:l instanceof Error?l.message:String(l),id:s,values:[...a.entries()]}}})}function Ea(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 va={"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 Yu;function Sa(e){Yu=new URL("./",e).href}Sa(import.meta.url);for(let[e,t]of Object.entries(va))Gs(e,t);function Jt(e,t,n,r){let o=Yr(e.x,e.y,r);if(!o)return null;return Xr(o,e.y,n,t)}function ao(e){return[...e.dataTransfer?.types??[]].includes("Files")}var Xu={type:"block"};function Zu(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:(ge(o?.tagName)||e.tagName).toLowerCase()}}function Qu(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 ef=new Set(["style","textContent"]);function tf(e){let t=Di();if(!t)return!1;for(let n of e){let r;if(n.op==="set-key"){if(ef.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 nf=2,rf=5000,of=500;function sf(e){let{channel:t,container:n}=e,r=null,o=null,s=-1,i=null,a=-1,c="design",l=null,u=null,f=Mn,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 D=Zr(y.y,S.innerHeight);if(D===0)return;let L=S.scrollY;if(S.scrollBy(0,D*zi),S.scrollY===L)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,D,L){if(!S||Zr(p.y,S.innerHeight)===0){A();return}if(y={dragSeq:D,withCursor:L!=null,x:p.x,y:p.y,...L?{gen:L.gen,src:L.src}:{}},!g)g=S.requestAnimationFrame(C)}let x=qi(t,n.ownerDocument,{getGen:()=>a,getMode:()=>c,getShadowDoc:()=>i}),v=(p)=>{if(c!=="design"&&c!=="edit")return;let D=Qu(p.target);if(D)t.post({hit:D,kind:"layoutHit"})};n.ownerDocument.addEventListener("click",v,!0);let P=fa(t,n.ownerDocument,de,()=>f,()=>c),E=aa(t,n,{getMode:()=>c,getShadowDoc:()=>i}),O=la(t,n.ownerDocument),M=hi(n),h=30000,k=-1;function R(){let p=n.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),D=ne(n),L=0;for(let te of p)L=Math.max(L,ne(te).bottom-D.top);return L}function N(){let p=Math.max(n.scrollHeight,R()),D=Math.min(p,h);if(D>0&&Math.abs(D-k)>=1){k=D;let L=n.firstElementChild,te=L instanceof HTMLElement&&L.dataset.jxDefinitionRoot!==void 0;t.post({fragment:te,height:D,kind:"contentHeight"}),Be()}}let B=S?.ResizeObserver,se=B?new B(()=>N()):null,Q=n.ownerDocument,ee=0,We=0,Se=0,lo="",ut=new Map;function ka(){let p=Date.now();for(let[D,L]of ut)if(L<=p)ut.delete(D);return ut.size}function Ta(){return{animations:typeof Q.getAnimations==="function"?Q.getAnimations().filter((D)=>D.playState==="running").length:0,fonts:Q.fonts?Q.fonts.status==="loaded":!0,gen:a,images:ka(),kind:"idle"}}function co(){ee=0;let p=Ta(),D=`${p.gen}|${p.fonts}|${p.animations}|${p.images}`,L=D!==lo;if(L)lo=D,t.post(p);if(We=p.fonts&&p.animations===0&&p.images===0?L?1:We+1:0,We>=nf){N();return}if(Date.now()>=Se)return;ee=S?S.requestAnimationFrame(co):0}function Be(){if(We=0,Se=Date.now()+rf,!ee&&S)ee=S.requestAnimationFrame(co)}let uo=(p)=>{if(p.target instanceof HTMLImageElement)ut.set(p.target,Date.now()+of),Be()},fo=(p)=>{if(p.target instanceof HTMLImageElement&&ut.delete(p.target))Be()};n.addEventListener("error",uo,!0),n.addEventListener("load",fo,!0),Be(),se?.observe(n);let po=(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",po,{passive:!1});let Aa=300,mo=0,ho=(p,D)=>{p.preventDefault(),p.stopPropagation();let L={x:p.clientX,y:p.clientY},te=n.ownerDocument,I=Yr(L.x,L.y,te),Ne=I?Zu(I,i):null,Ht=i&&I?Xr(I,L.y,i,Xu):null;if(D==="fileDragOver"){if(p.dataTransfer)p.dataTransfer.dropEffect="copy";t.post({hit:Ne,kind:"fileDragOver",preview:Ht});return}t.post({files:[...p.dataTransfer?.files??[]],hit:Ne,kind:"fileDrop",preview:Ht})},jt=(p)=>{if(!m){if(ao(p)){ho(p,"fileDragOver");return}let te=Date.now();if(te-mo>=Aa)mo=te,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:b,gen:w,kind:"dragOver",preview:L}),T(D,b)},go=(p)=>{if(!m){if(ao(p))ho(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:b,gen:w,instruction:L?.instruction??null,kind:"dropResult",targetPath:L?.targetPath??null}),m=null,w=-1,b=-1,A()},xo=(p)=>{if(!m&&ao(p)&&!p.relatedTarget)t.post({kind:"fileDragLeave"})};n.ownerDocument.addEventListener("dragenter",jt,!0),n.ownerDocument.addEventListener("dragover",jt,!0),n.ownerDocument.addEventListener("dragleave",xo,!0),n.ownerDocument.addEventListener("drop",go,!0);let Ca=t.onMessage((p)=>{if(p.kind==="measure"){let{hidden:I,hits:Ne}=Ui(p.paths,n.ownerDocument);t.post({hidden:I,hits:Ne,kind:"geometry",reqId:p.reqId});return}if(p.kind==="evalExpr"){let I=p.gen===a&&d&&i?wa(p.exprs,d.defs,i,p.contextPath):[];t.post({gen:p.gen,kind:"evalResult",reqId:p.reqId,results:I});return}if(p.kind==="patch"){let{gen:I}=p;if(I<a){t.post({gen:I,kind:"patchError",message:"patch-behind-render"});return}if(I>a||!i||!d){t.post({gen:I,kind:"patchError",message:"patch-ahead-of-render"});return}let Ne=new Set((p.echoPaths??[]).map((Me)=>J(Me))),Ht=Ne.size===0?p.forwardOps:p.forwardOps.filter((Me)=>!(Me.op==="set-key"&&Ne.has(J(Me.path)))),yo=de()&&tf(Ht),bo=yo?Pn(n,je):null;if(yo)he();try{if(ha(i,p.forwardOps,n,d,p.echoPaths),Mt(n,l),et(n,u),bo)Lt(n,bo);t.post({gen:I,kind:"patchComplete"}),Be()}catch(Me){t.post({gen:I,kind:"patchError",message:String(Me?.message??Me)})}return}if(p.kind==="styleUpdate"){if(p.gen!==a||!i)return;i.style=p.style;let I=n.firstElementChild;if(I instanceof HTMLElement)yn(I,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 I=m&&i?Jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,kind:"dragOver",preview:I}),T(p.cursor,p.dragSeq);return}if(p.kind==="drop"){let I=m&&i?Jt(p.cursor,m,i,n.ownerDocument):null;t.post({dragSeq:p.dragSeq,gen:w,instruction:I?.instruction??null,kind:"dropResult",targetPath:I?.targetPath??null}),m=null,w=-1,b=-1,A();return}if(p.kind==="keymap"){f={chords:p.chords,mac:p.mac};return}if(p.kind==="setColorScheme"){Ir(n.ownerDocument,p.scheme);return}if(p.kind==="setPopoverOpen"){if(c==="preview")return;l=p.path===null?null:J(p.path),Mt(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"){oi(p.doc,p.base);return}if(p.kind==="setLocale"){let I=n.ownerDocument.documentElement;if(p.locale===null)I.removeAttribute("lang"),I.removeAttribute("dir");else I.setAttribute("lang",p.locale),I.setAttribute("dir",p.dir);return}if(p.kind==="siteStyleUpdate"){Lr(p.siteStyle,p.media);return}if(p.kind!=="render"||p.gen<s)return;if(Ir(n.ownerDocument,p.colorScheme??null),de())he();s=p.gen,Mi(p.editableTags??null);let{gen:D,mapperCtx:L}=p,te=p.shadowDoc;(async()=>{try{if(da(),o?.(),o=null,r?.dispose(),ei(n.ownerDocument),r=await gi({assets: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,Mt(n,l),et(n,u),i=te,d=r.ctx,a=D,c=p.mode,t.post({gen:D,kind:"renderComplete"}),Be();let I=r.ctx.defs;o=js(()=>{try{t.post({gen:D,kind:"dataScope",scope:Ea(I)})}catch{}}),N()}}catch(I){t.post({gen:D,kind:"renderError",message:String(I?.message??I)})}})()});return t.post({kind:"ready"}),()=>{if(Ca(),x(),P(),E(),O(),M(),ee&&S)S.cancelAnimationFrame(ee);ee=0,n.removeEventListener("error",uo,!0),n.removeEventListener("load",fo,!0),A(),se?.disconnect(),n.ownerDocument.removeEventListener("click",v,!0),n.ownerDocument.removeEventListener("wheel",po),n.ownerDocument.removeEventListener("dragenter",jt,!0),n.ownerDocument.removeEventListener("dragleave",xo,!0),n.ownerDocument.removeEventListener("dragover",jt,!0),n.ownerDocument.removeEventListener("drop",go,!0),o?.(),r?.dispose()}}function af(e){let t=new URLSearchParams(e.location.search);Is(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=Eo({acceptOrigin:r,source:e,target:e.parent,targetOrigin:r,token:t.get("token")||""});return sf({channel:s,container:o})}if(typeof window<"u"&&window.parent!==window)af(window);export{nf as IDLE_QUIET_FRAMES,rf as IDLE_WATCH_MAX_MS,of as IMAGE_RETRY_WINDOW_MS,af as bootCanvasIframe,Zu as fileDropHitFor,ao as isExternalFileDrag,Qu as layoutHitFor,tf as patchDisturbsActiveEdit,sf as startCanvasIframe};
|
|
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(`
|
|
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};
|
|
313
313
|
|
|
314
|
-
//# debugId=
|
|
314
|
+
//# debugId=7E9E1ED1A8D7735E64756E2164756E21
|
|
315
315
|
//# sourceMappingURL=iframe-entry.js.map
|