@jxsuite/studio 8.1.0 → 9.0.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/dist/chunks/{2020-dg097k3e.js → 2020-89fz3pfy.js} +3 -3
- package/dist/chunks/adapter-ay13gema.js +4 -0
- package/dist/chunks/add-new-flow-nmkqpjym.js +4 -0
- package/dist/chunks/cf-account-picker-2e06qxey.js +4 -0
- package/dist/chunks/cf-settings-5y04810c.js +4 -0
- package/dist/chunks/color-04361ttk.js +4 -0
- package/dist/chunks/{color-area-vh9cew51.js → color-area-h8dbasp1.js} +2 -2
- package/dist/chunks/{color-field-e78f16bs.js → color-field-qv5r2b16.js} +3 -3
- package/dist/chunks/{color-slider-fg4yhvk6.js → color-slider-nz2mrzky.js} +2 -2
- package/dist/chunks/components-3vf75n83.js +4 -0
- package/dist/chunks/content-source-4f2raf4a.js +4 -0
- package/dist/chunks/{convert-to-repeater-grnmea6c.js → convert-to-repeater-j9hfcj4f.js} +3 -3
- package/dist/chunks/editor-645krvtz.js +4 -0
- package/dist/chunks/entry-commands-3qmv8wkr.js +4 -0
- package/dist/chunks/{extension-sections-rp7fkega.js → extension-sections-thfke054.js} +3 -3
- package/dist/chunks/file-ops-kkhp9ma7.js +4 -0
- package/dist/chunks/files-yswdhxrf.js +4 -0
- package/dist/chunks/format-host-4g8ex6bz.js +4 -0
- package/dist/chunks/fs-events-z9gpvc6t.js +4 -0
- package/dist/chunks/grid-open-fm4j183c.js +4 -0
- package/dist/chunks/{grid-view-x26rfpz1.js → grid-view-7d2nx83y.js} +10 -10
- package/dist/chunks/{iframe-entry-pkgmcgp0.js → iframe-entry-2x9bn5ng.js} +4 -4
- package/dist/chunks/{iframe-entry-02wzcyvy.js → iframe-entry-btck0e9s.js} +4 -4
- package/dist/chunks/iframe-host-q7fedsmr.js +4 -0
- package/dist/chunks/{index-203h71wy.js → index-jxmt7vh8.js} +3 -3
- package/dist/chunks/index-pt4wh98x.js +4 -0
- package/dist/chunks/{javascript-ww5pv5ae.js → javascript-vmqp56ke.js} +2 -2
- package/dist/chunks/{jsonMode-vwbdwwq3.js → jsonMode-n3wmpant.js} +6 -6
- package/dist/chunks/jx-validate-19y62knt.js +4 -0
- package/dist/chunks/layers-panel-1qvc83y9.js +4 -0
- package/dist/chunks/layers-qf0bc7ze.js +4 -0
- package/dist/chunks/lit-html-wyqw04y2.js +4 -0
- package/dist/chunks/media-library-f9d5qcjb.js +4 -0
- package/dist/chunks/media-picker-rsb1fmk2.js +4 -0
- package/dist/chunks/{monaco-binding-63tqze27.js → monaco-binding-wfhmz89d.js} +3 -3
- package/dist/chunks/monaco-buffer-ak0raadw.js +4 -0
- package/dist/chunks/{monaco-setup-zyyynnj8.js → monaco-setup-fty7a8vg.js} +3 -3
- package/dist/chunks/notify-4qj70q0x.js +4 -0
- package/dist/chunks/parse-n8dfxnqf.js +4 -0
- package/dist/chunks/platform-ehg6t9vd.js +4 -0
- package/dist/chunks/publish-panel-yhmda3cd.js +4 -0
- package/dist/chunks/{publish-quick-ajzdhhs6.js → publish-quick-12hh8926.js} +3 -3
- package/dist/chunks/publish-workspace-hx8qdv9p.js +4 -0
- package/dist/chunks/quick-search-r955m3q1.js +4 -0
- package/dist/chunks/references-8gxv0x7t.js +4 -0
- package/dist/chunks/right-panel-jarwqjpy.js +4 -0
- package/dist/chunks/source-control-84qt25m9.js +4 -0
- package/dist/chunks/studio-0nefxhar.js +7 -0
- package/dist/chunks/studio-0rg30pvs.js +5 -0
- package/dist/chunks/{studio-3q6n9qvq.js → studio-14hh60j8.js} +4 -4
- package/dist/chunks/studio-1cfyd1ys.js +5 -0
- package/dist/chunks/studio-2bq7hheq.js +5 -0
- package/dist/chunks/{studio-mmqr9awv.js → studio-32d8wyxq.js} +33 -33
- package/dist/chunks/studio-3hpcawh8.js +4 -0
- package/dist/chunks/{studio-zm7dnr9g.js → studio-4j35hgsw.js} +4 -4
- package/dist/chunks/{studio-bqgs90r8.js → studio-4qg61g9j.js} +4 -4
- package/dist/chunks/studio-4rgem12q.js +5 -0
- package/dist/chunks/studio-6k9djnxw.js +5 -0
- package/dist/chunks/studio-6rbaedw2.js +9 -0
- package/dist/chunks/studio-732mw0g8.js +5 -0
- package/dist/chunks/studio-79r8msnr.js +7 -0
- package/dist/chunks/studio-7q6jdd4h.js +5 -0
- package/dist/chunks/{studio-jqrg9xxg.js → studio-881z1xrx.js} +4 -4
- package/dist/chunks/{studio-9wyqyfqy.js → studio-8hf8qcm1.js} +4 -4
- package/dist/chunks/{studio-6vrxzkba.js → studio-8pne0rx4.js} +4 -4
- package/dist/chunks/{studio-wcakp5bt.js → studio-9179bsm7.js} +7 -7
- package/dist/chunks/{studio-xddgbwhe.js → studio-9ff0vqff.js} +3 -3
- package/dist/chunks/{studio-25a5by3h.js → studio-9gzvypw4.js} +4 -4
- package/dist/chunks/studio-9ndgd55w.js +5 -0
- package/dist/chunks/studio-9ra9e7m4.js +5 -0
- package/dist/chunks/studio-a6e5fzve.js +5 -0
- package/dist/chunks/studio-a9k86nq6.js +5 -0
- package/dist/chunks/studio-ae7a69jc.js +6 -0
- package/dist/chunks/studio-aghsg0ds.js +7 -0
- package/dist/chunks/{studio-2b8443ms.js → studio-ajw4k8hp.js} +3 -3
- package/dist/chunks/{studio-957jg8g3.js → studio-apapy17g.js} +4 -4
- package/dist/chunks/{studio-hnx1h1pr.js → studio-by8x0jvc.js} +4 -4
- package/dist/chunks/{studio-hxq1ebp0.js → studio-c88gq88j.js} +6 -6
- package/dist/chunks/{studio-a6x058ew.js → studio-cg54vtet.js} +4 -4
- package/dist/chunks/studio-dvhxxxbd.js +5 -0
- package/dist/chunks/{studio-1meqbxns.js → studio-e4rq6x0q.js} +4 -4
- package/dist/chunks/{studio-v2ek69cb.js → studio-ekzbgnjp.js} +4 -4
- package/dist/chunks/{studio-2dtc90zs.js → studio-fg4fj9ec.js} +6 -6
- package/dist/chunks/studio-fj6jzgxw.js +5 -0
- package/dist/chunks/{studio-txkx6586.js → studio-g45r5vm8.js} +7 -7
- package/dist/chunks/{studio-v0gsjav0.js → studio-gczve8zf.js} +4 -4
- package/dist/chunks/studio-ge08zwpv.js +5 -0
- package/dist/chunks/{studio-1gdfsr49.js → studio-gk9yk8dj.js} +7 -7
- package/dist/chunks/{studio-cpdzrdgp.js → studio-gskkgfe3.js} +4 -4
- package/dist/chunks/{studio-94ppxeqy.js → studio-h4jbgne2.js} +8 -8
- package/dist/chunks/{studio-kdseew9m.js → studio-hcy9zeac.js} +4 -4
- package/dist/chunks/studio-ht81xjkr.js +5 -0
- package/dist/chunks/{studio-73wz63nn.js → studio-jr30g4ae.js} +4 -4
- package/dist/chunks/{studio-fqs1a22a.js → studio-k5n4es74.js} +4 -4
- package/dist/chunks/{studio-j5jqvyn3.js → studio-k6hbx2fc.js} +4 -4
- package/dist/chunks/{studio-332hesdk.js → studio-kqh7fxn6.js} +4 -4
- package/dist/chunks/{studio-8nyw10dp.js → studio-kyw47pet.js} +4 -4
- package/dist/chunks/studio-mkw17ngg.js +5 -0
- package/dist/chunks/{studio-02phtmqn.js → studio-myb4mf0h.js} +4 -4
- package/dist/chunks/{studio-d140sy8e.js → studio-n4qq1n57.js} +4 -4
- package/dist/chunks/{studio-bf0rgyf7.js → studio-nfmpmkqb.js} +4 -4
- package/dist/chunks/studio-nfwacw31.js +5 -0
- package/dist/chunks/{studio-z42kysg7.js → studio-nm86874b.js} +136 -136
- package/dist/chunks/studio-nqexty8x.js +16 -0
- package/dist/chunks/studio-nr0kcqc6.js +5 -0
- package/dist/chunks/{studio-dmn7gpba.js → studio-nvfa137z.js} +5 -5
- package/dist/chunks/studio-psh8mwnw.js +4 -0
- package/dist/chunks/{studio-4dsdnan2.js → studio-qd0cycm4.js} +5 -5
- package/dist/chunks/{studio-zht0x0v3.js → studio-qevf5z9d.js} +4 -4
- package/dist/chunks/studio-qs5fmhtj.js +14 -0
- package/dist/chunks/studio-ry4789ng.js +7 -0
- package/dist/chunks/studio-s4fq9jht.js +5 -0
- package/dist/chunks/studio-sc35ttdk.js +5 -0
- package/dist/chunks/studio-sm2f0sc6.js +6 -0
- package/dist/chunks/{studio-rdnezzkd.js → studio-spza69tb.js} +5 -5
- package/dist/chunks/studio-t6dqnnft.js +5 -0
- package/dist/chunks/{studio-hw60n5dh.js → studio-tfmhnwyr.js} +3 -3
- package/dist/chunks/studio-tn7v8gey.js +6 -0
- package/dist/chunks/{studio-nsv7g1qn.js → studio-trcfer2b.js} +4 -4
- package/dist/chunks/studio-tyw7tk0x.js +5 -0
- package/dist/chunks/{studio-533py3yy.js → studio-tyzgte21.js} +4 -4
- package/dist/chunks/studio-vtey9w98.js +5 -0
- package/dist/chunks/studio-ws2r1d7e.js +5 -0
- package/dist/chunks/studio-x2trkhk5.js +5 -0
- package/dist/chunks/{studio-c5dj3dzk.js → studio-xzgp0cp7.js} +4 -4
- package/dist/chunks/studio-y47090vq.js +5 -0
- package/dist/chunks/{studio-nm9qev4p.js → studio-yjh9gddd.js} +5 -5
- package/dist/chunks/studio-ywf9y1e2.js +5 -0
- package/dist/chunks/{studio-x3ge4rts.js → studio-z1p91z5a.js} +4 -4
- package/dist/chunks/studio-ztppbam0.js +5 -0
- package/dist/chunks/{toast-host-1yg5ar8d.js → toast-host-g3r2s0kn.js} +2 -2
- package/dist/chunks/toast-w11qpkyz.js +4 -0
- package/dist/chunks/{tsMode-vra2hh7y.js → tsMode-byje4a01.js} +5 -5
- package/dist/chunks/workspace-7q4arnt3.js +4 -0
- package/dist/chunks/workspace-home-ge027kr6.js +4 -0
- package/dist/chunks/{ws-client-72x5n99j.js → ws-client-h09h6sqg.js} +3 -3
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +77 -77
- package/dist/studio.js +89 -89
- package/package.json +11 -12
- package/src/collab/collab-session.ts +6 -2
- package/src/commands/context.ts +4 -0
- package/src/commands/defaults.ts +2 -0
- package/src/commands/live-context.ts +2 -0
- package/src/files/files.ts +6 -3
- package/src/new-project/new-project-modal.ts +1 -4
- package/src/panels/ai-panel.ts +27 -34
- package/src/platform.ts +20 -0
- package/src/platforms/devserver.ts +2 -120
- package/src/services/ai-ask.ts +29 -171
- package/src/services/ai-command-tools.ts +40 -50
- package/src/services/ai-import-tools.ts +4 -5
- package/src/services/ai-project-tools.ts +13 -3
- package/src/services/ai-tools.ts +26 -564
- package/src/services/ai-writes.ts +84 -2
- package/src/services/document-assistant.ts +29 -58
- package/src/services/harness/assistant-tools.ts +68 -0
- package/src/services/harness/interaction-store.ts +118 -0
- package/src/services/harness/studio-documents.ts +105 -0
- package/src/services/harness/turn-hooks.ts +1 -6
- package/src/services/project-adoption.ts +8 -16
- package/src/services/tool-executor.ts +25 -22
- package/src/state.ts +3 -13
- package/src/surfaces/files-panel.json +12 -0
- package/src/surfaces/files-panel.ts +5 -2
- package/src/surfaces/welcome.ts +4 -1
- package/src/tabs/selection.ts +14 -109
- package/src/tabs/tab.ts +10 -1
- package/src/tabs/transact.ts +316 -124
- package/src/types.ts +13 -8
- package/dist/chunks/adapter-tck81zft.js +0 -4
- package/dist/chunks/add-new-flow-a1w0bnm6.js +0 -4
- package/dist/chunks/cf-account-picker-ce3kp3x1.js +0 -4
- package/dist/chunks/cf-settings-7ye6x7g2.js +0 -4
- package/dist/chunks/color-4gj49xq6.js +0 -4
- package/dist/chunks/components-qce0v93f.js +0 -4
- package/dist/chunks/content-source-jjx8kgzr.js +0 -4
- package/dist/chunks/editor-bkja5dbv.js +0 -4
- package/dist/chunks/entry-commands-1wh0btvg.js +0 -4
- package/dist/chunks/file-ops-6pe4z7an.js +0 -4
- package/dist/chunks/files-ybpp3j38.js +0 -4
- package/dist/chunks/format-host-3mtbhxk1.js +0 -4
- package/dist/chunks/fs-events-xfanfxds.js +0 -4
- package/dist/chunks/grid-open-dg5qmnaj.js +0 -4
- package/dist/chunks/iframe-host-j2bk2xkc.js +0 -4
- package/dist/chunks/index-fkrm7pdk.js +0 -4
- package/dist/chunks/jx-validate-w7v32f6a.js +0 -4
- package/dist/chunks/layers-g7j732cm.js +0 -4
- package/dist/chunks/layers-panel-gjrsxcck.js +0 -4
- package/dist/chunks/lit-html-jdfz9rhc.js +0 -4
- package/dist/chunks/media-library-9j0v4wmk.js +0 -4
- package/dist/chunks/media-picker-cpyyt2m0.js +0 -4
- package/dist/chunks/monaco-buffer-9wcme176.js +0 -4
- package/dist/chunks/notify-rahnnnv4.js +0 -4
- package/dist/chunks/parse-v77xtwv7.js +0 -4
- package/dist/chunks/platform-b2aqv7v5.js +0 -4
- package/dist/chunks/publish-panel-4yk2461b.js +0 -4
- package/dist/chunks/publish-workspace-mxestzcf.js +0 -4
- package/dist/chunks/quick-search-9g6z65b0.js +0 -4
- package/dist/chunks/references-c26enpxs.js +0 -4
- package/dist/chunks/right-panel-9d0e0yg7.js +0 -4
- package/dist/chunks/source-control-xyn3a8ds.js +0 -4
- package/dist/chunks/studio-0khd0xdw.js +0 -5
- package/dist/chunks/studio-1fvzq9vs.js +0 -5
- package/dist/chunks/studio-1yhz0s8p.js +0 -5
- package/dist/chunks/studio-2c2mjyzj.js +0 -6
- package/dist/chunks/studio-3pndhat0.js +0 -9
- package/dist/chunks/studio-4fjqdzrb.js +0 -6
- package/dist/chunks/studio-5abge3wy.js +0 -5
- package/dist/chunks/studio-74nzv280.js +0 -5
- package/dist/chunks/studio-7cg75gtj.js +0 -14
- package/dist/chunks/studio-89cwmnae.js +0 -5
- package/dist/chunks/studio-8m1t83kn.js +0 -7
- package/dist/chunks/studio-a3evp7f6.js +0 -6
- package/dist/chunks/studio-ana67wax.js +0 -5
- package/dist/chunks/studio-b4xhpcwy.js +0 -4
- package/dist/chunks/studio-c4rcaftm.js +0 -5
- package/dist/chunks/studio-cgjt1zce.js +0 -5
- package/dist/chunks/studio-cq87hree.js +0 -5
- package/dist/chunks/studio-e1g64q43.js +0 -5
- package/dist/chunks/studio-e8pzjjhf.js +0 -5
- package/dist/chunks/studio-f8kz3krj.js +0 -7
- package/dist/chunks/studio-fw3jp9m7.js +0 -5
- package/dist/chunks/studio-g6ysm05p.js +0 -7
- package/dist/chunks/studio-gmhd0j3f.js +0 -5
- package/dist/chunks/studio-gqpty626.js +0 -5
- package/dist/chunks/studio-grp684wx.js +0 -5
- package/dist/chunks/studio-h98520qr.js +0 -5
- package/dist/chunks/studio-hvxt8z79.js +0 -5
- package/dist/chunks/studio-j4e627w1.js +0 -5
- package/dist/chunks/studio-kt2j51sa.js +0 -5
- package/dist/chunks/studio-m4w6sygj.js +0 -16
- package/dist/chunks/studio-nqxqf8p2.js +0 -4
- package/dist/chunks/studio-p89w12s2.js +0 -7
- package/dist/chunks/studio-pbagym4j.js +0 -5
- package/dist/chunks/studio-pr23qhrw.js +0 -5
- package/dist/chunks/studio-r4ya3sb2.js +0 -5
- package/dist/chunks/studio-rm9m3z60.js +0 -5
- package/dist/chunks/studio-tpmnbgmt.js +0 -5
- package/dist/chunks/studio-ttxhq5yt.js +0 -5
- package/dist/chunks/studio-y1x65h5r.js +0 -5
- package/dist/chunks/studio-zf188hnd.js +0 -5
- package/dist/chunks/toast-1gv0h53h.js +0 -4
- package/dist/chunks/workspace-3nt93k48.js +0 -4
- package/dist/chunks/workspace-home-zbgyqqws.js +0 -4
- package/src/services/directory-picker.ts +0 -187
- package/src/services/gated-registry.ts +0 -77
package/dist/iframe-entry.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{e,i,x,t,n,s,r,v,b,j,k,R,D,S,l,c,I,F,Z,W,J,u,w}from"./chunks/iframe-entry-42hpmwz5.js";var
|
|
2
|
-
var ur="jx:canvas";function Go(o){let{target:a,source:d,targetOrigin:f,acceptOrigin:p,token:m}=o,g=new Set,h=(y)=>{if(p!=="*"&&y.origin!==p)return;let E=y.data;if(!n(E)||!(ur in E)||E[ur]!==m)return;let A="payload"in E?E.payload:void 0;for(let T of g)T(A)};return d.addEventListener("message",h),{dispose(){g.clear(),d.removeEventListener("message",h)},onMessage(y){return g.add(y),()=>g.delete(y)},post(y){a.postMessage({[ur]:m,payload:y},f)}}}function dr(o){return o.ownerDocument.defaultView?.getComputedStyle(o).display==="contents"}function Pe(o){let a=o.getBoundingClientRect();if(a.width>0||a.height>0||!o.hasChildNodes()||!dr(o))return a;let d=null;for(let f of o.childNodes){let p=null;if(f instanceof Element)p=Pe(f);else if(f.nodeType===Node.TEXT_NODE){let m=o.ownerDocument.createRange();m.selectNodeContents(f),p=m.getBoundingClientRect()}if(!p||p.width===0&&p.height===0)continue;d=d?{bottom:Math.max(d.bottom,p.bottom),left:Math.min(d.left,p.left),right:Math.max(d.right,p.right),top:Math.min(d.top,p.top)}:{bottom:p.bottom,left:p.left,right:p.right,top:p.top}}return d?new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top):a}function Yo(o){return o.getBoundingClientRect()}function Xo(o,a,d=document){return d.elementFromPoint(o,a)}function fr(o){let a=Object.create(null);for(let d of o.split(","))a[d]=1;return(d)=>(d in a)}var pn=Object.assign;var Xl=Object.prototype.hasOwnProperty,mn=(o,a)=>Xl.call(o,a),ct=Array.isArray,$t=(o)=>Qo(o)==="[object Map]";var Zo=(o)=>typeof o==="function",Zl=(o)=>typeof o==="string",ut=(o)=>typeof o==="symbol",dt=(o)=>o!==null&&typeof o==="object";var Ql=Object.prototype.toString,Qo=(o)=>Ql.call(o),ei=(o)=>Qo(o).slice(8,-1);var hn=(o)=>Zl(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var gn=(o)=>{let a=Object.create(null);return(d)=>a[d]||(a[d]=o(d))},ec=/-\w/g,fp=gn((o)=>o.replace(ec,(a)=>a.slice(1).toUpperCase())),tc=/\B([A-Z])/g,pp=gn((o)=>o.replace(tc,"-$1").toLowerCase()),ti=gn((o)=>o.charAt(0).toUpperCase()+o.slice(1)),mp=gn((o)=>o?`on${ti(o)}`:""),Ie=(o,a)=>!Object.is(o,a);var nc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var hp=fr(nc+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var be;class ii{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&be)if(be.active)this.parent=be,this.index=(be.scopes||(be.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,a;if(this.scopes){let d=this.scopes.slice();for(o=0,a=d.length;o<a;o++)d[o].pause()}for(o=0,a=this.effects.length;o<a;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,a;if(this.scopes){let f=this.scopes.slice();for(o=0,a=f.length;o<a;o++)f[o].resume()}let d=this.effects.slice();for(o=0,a=d.length;o<a;o++)d[o].resume()}}}run(o){if(this._active){let a=be;try{return be=this,o()}finally{be=a}}}on(){if(++this._on===1)this.prevScope=be,be=this}off(){if(this._on>0&&--this._on===0){if(be===this)be=this.prevScope;else{let o=be;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let a,d;for(a=0,d=this.effects.length;a<d;a++)this.effects[a].stop();this.effects.length=0;for(a=0,d=this.cleanups.length;a<d;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){let f=this.scopes.slice();for(a=0,d=f.length;a<d;a++)f[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let f=this.parent.scopes.pop();if(f&&f!==this)this.parent.scopes[this.index]=f,f.index=this.index}this.parent=void 0}}}function pt(o){return new ii(o)}function Sn(o,a=!1){if(be)be.cleanups.push(o)}var ue;var pr=new WeakSet;class bn{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,be)if(be.active)be.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,pr.has(this))pr.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))ai(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ni(this),li(this);let o=ue,a=$e;ue=this,$e=!0;try{return this.fn()}finally{ci(this),ue=o,$e=a,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)wr(o);this.deps=this.depsTail=void 0,ni(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)pr.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(gr(this))this.run()}get dirty(){return gr(this)}}var si=0,Mt,kt;function ai(o,a=!1){if(o.flags|=8,a){o.next=kt,kt=o;return}o.next=Mt,Mt=o}function Er(){si++}function vr(){if(--si>0)return;if(kt){let a=kt;kt=void 0;while(a){let d=a.next;a.next=void 0,a.flags&=-9,a=d}}let o;while(Mt){let a=Mt;Mt=void 0;while(a){let d=a.next;if(a.next=void 0,a.flags&=-9,a.flags&1)try{a.trigger()}catch(f){if(!o)o=f}a=d}}if(o)throw o}function li(o){for(let a=o.deps;a;a=a.nextDep)a.version=-1,a.prevActiveLink=a.dep.activeLink,a.dep.activeLink=a}function ci(o){let a,d=o.depsTail,f=d;while(f){let p=f.prevDep;if(f.version===-1){if(f===d)d=p;wr(f),rc(f)}else a=f;f.dep.activeLink=f.prevActiveLink,f.prevActiveLink=void 0,f=p}o.deps=a,o.depsTail=d}function gr(o){for(let a=o.deps;a;a=a.nextDep)if(a.dep.version!==a.version||a.dep.computed&&(ui(a.dep.computed)||a.dep.version!==a.version))return!0;if(o._dirty)return!0;return!1}function ui(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===_t)return;if(o.globalVersion=_t,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!gr(o)))return;o.flags|=2;let a=o.dep,d=ue,f=$e;ue=o,$e=!0;try{li(o);let p=o.fn(o._value);if(a.version===0||Ie(p,o._value))o.flags|=128,o._value=p,a.version++}catch(p){throw a.version++,p}finally{ue=d,$e=f,ci(o),o.flags&=-3}}function wr(o,a=!1){let{dep:d,prevSub:f,nextSub:p}=o;if(f)f.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=f,o.nextSub=void 0;if(d.subs===o){if(d.subs=f,!f&&d.computed){d.computed.flags&=-5;for(let m=d.computed.deps;m;m=m.nextDep)wr(m,!0)}}if(!a&&!--d.sc&&d.map)d.map.delete(d.key)}function rc(o){let{prevDep:a,nextDep:d}=o;if(a)a.nextDep=d,o.prevDep=void 0;if(d)d.prevDep=a,o.nextDep=void 0}function we(o,a){if(o.effect instanceof bn)o=o.effect.fn;let d=new bn(o);if(a)pn(d,a);try{d.run()}catch(p){throw d.stop(),p}let f=d.run.bind(d);return f.effect=d,f}var $e=!0,di=[];function Jt(){di.push($e),$e=!1}function Lt(){let o=di.pop();$e=o===void 0?!0:o}function En(o,a=!1){if(ue instanceof bn)ue.cleanup=o}function ni(o){let{cleanup:a}=o;if(o.cleanup=void 0,a){let d=ue;ue=void 0;try{a()}finally{ue=d}}}var _t=0;class fi{constructor(o,a){this.sub=o,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class vn{constructor(o){this.computed=o,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(o){if(!ue||!$e||ue===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==ue){if(a=this.activeLink=new fi(ue,this),!ue.deps)ue.deps=ue.depsTail=a;else a.prevDep=ue.depsTail,ue.depsTail.nextDep=a,ue.depsTail=a;pi(a)}else if(a.version===-1){if(a.version=this.version,a.nextDep){let d=a.nextDep;if(d.prevDep=a.prevDep,a.prevDep)a.prevDep.nextDep=d;if(a.prevDep=ue.depsTail,a.nextDep=void 0,ue.depsTail.nextDep=a,ue.depsTail=a,ue.deps===a)ue.deps=d}}return a}trigger(o){this.version++,_t++,this.notify(o)}notify(o){Er();try{for(let a=this.subs;a;a=a.prevSub)if(a.sub.notify())a.sub.dep.notify()}finally{vr()}}}function pi(o){if(o.dep.sc++,o.sub.flags&4){let a=o.dep.computed;if(a&&!o.dep.subs){a.flags|=20;for(let f=a.deps;f;f=f.nextDep)pi(f)}let d=o.dep.subs;if(d!==o){if(o.prevSub=d,d)d.nextSub=o}o.dep.subs=o}}var xr=new WeakMap,tt=Symbol(""),yr=Symbol(""),Dt=Symbol("");function Te(o,a,d){if($e&&ue){let f=xr.get(o);if(!f)xr.set(o,f=new Map);let p=f.get(d);if(!p)f.set(d,p=new vn),p.map=f,p.key=d;p.track()}}function Ke(o,a,d,f,p,m){let g=xr.get(o);if(!g){_t++;return}let h=(y)=>{if(y)y.trigger()};if(Er(),a==="clear")g.forEach(h);else{let y=ct(o),E=y&&hn(d);if(y&&d==="length"){let A=Number(f);g.forEach((T,C)=>{if(C==="length"||C===Dt||!ut(C)&&C>=A)h(T)})}else{if(d!==void 0||g.has(void 0))h(g.get(d));if(E)h(g.get(Dt));switch(a){case"add":if(!y){if(h(g.get(tt)),$t(o))h(g.get(yr))}else if(E)h(g.get("length"));break;case"delete":if(!y){if(h(g.get(tt)),$t(o))h(g.get(yr))}break;case"set":if($t(o))h(g.get(tt));break}}}vr()}function ft(o){let a=le(o);if(a===o)return a;if(Te(a,"iterate",Dt),qe(o))return a;if(!He(o))return a.map(Je);return It(o)?a.map((d)=>nt(Je(d))):a.map(nt)}function Tr(o){return Te(o=le(o),"iterate",Dt),o}function De(o,a){if(He(o))return It(o)?nt(Je(a)):nt(a);return Je(a)}var oc={__proto__:null,[Symbol.iterator](){return mr(this,Symbol.iterator,(o)=>De(this,o))},concat(...o){return ft(this).concat(...o.map((a)=>ct(a)?ft(a):a))},entries(){return mr(this,"entries",(o)=>(o[1]=De(this,o[1]),o))},every(o,a){return je(this,"every",o,a,void 0,arguments)},filter(o,a){return je(this,"filter",o,a,(d)=>d.map((f)=>De(this,f)),arguments)},find(o,a){return je(this,"find",o,a,(d)=>De(this,d),arguments)},findIndex(o,a){return je(this,"findIndex",o,a,void 0,arguments)},findLast(o,a){return je(this,"findLast",o,a,(d)=>De(this,d),arguments)},findLastIndex(o,a){return je(this,"findLastIndex",o,a,void 0,arguments)},forEach(o,a){return je(this,"forEach",o,a,void 0,arguments)},includes(...o){return hr(this,"includes",o)},indexOf(...o){return hr(this,"indexOf",o)},join(o){return ft(this).join(o)},lastIndexOf(...o){return hr(this,"lastIndexOf",o)},map(o,a){return je(this,"map",o,a,void 0,arguments)},pop(){return Ot(this,"pop")},push(...o){return Ot(this,"push",o)},reduce(o,...a){return oi(this,"reduce",o,a)},reduceRight(o,...a){return oi(this,"reduceRight",o,a)},shift(){return Ot(this,"shift")},some(o,a){return je(this,"some",o,a,void 0,arguments)},splice(...o){return Ot(this,"splice",o)},toReversed(){return ft(this).toReversed()},toSorted(o){return ft(this).toSorted(o)},toSpliced(...o){return ft(this).toSpliced(...o)},unshift(...o){return Ot(this,"unshift",o)},values(){return mr(this,"values",(o)=>De(this,o))}};function mr(o,a,d){let f=Tr(o),p=f[a],m=p.call(f);if(f!==o&&!qe(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let g=Object.create(Object.getPrototypeOf(m));if(g.next=()=>ri(m.next(),d),p!==mi[a])Object.defineProperties(g,{return:{get(){let h=m.return;return typeof h==="function"?h.bind(m):h}},throw:{get(){let h=m.throw;return typeof h==="function"?h.bind(m):h}}});return g}m._next=m.next,m.next=()=>ri(m._next(),d)}return m}function ri(o,a){if(!o.done)o.value=a(o.value);return o}var mi=Array.prototype;function je(o,a,d,f,p,m){let g=Tr(o),h=g!==o&&!qe(o),y=g[a];if(y!==mi[a]){let T=y.apply(o,m);return h?Je(T):T}let E=d;if(g!==o){if(h)E=function(T,C){return d.call(this,De(o,T),C,o)};else if(d.length>2)E=function(T,C){return d.call(this,T,C,o)}}let A=y.call(g,E,f);return h&&p?p(A):A}function oi(o,a,d,f){let p=Tr(o),m=p!==o&&!qe(o),g=d,h=!1;if(p!==o){if(m)h=f.length===0,g=function(E,A,T){if(h)h=!1,E=De(o,E);return d.call(this,E,De(o,A),T,o)};else if(d.length>3)g=function(E,A,T){return d.call(this,E,A,T,o)}}let y=p[a](g,...f);return h?De(o,y):y}function hr(o,a,d){let f=le(o);Te(f,"iterate",Dt);let p=f[a](...d);if((p===-1||p===!1)&&xc(d[0]))return d[0]=le(d[0]),f[a](...d);return p}function Ot(o,a,d=[]){Jt(),Er();let f=le(o)[a].apply(o,d);return vr(),Lt(),f}var ic=fr("__proto__,__v_isRef,__isVue"),hi=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(ut));function sc(o){if(!ut(o))o=String(o);let a=le(this);return Te(a,"has",o),a.hasOwnProperty(o)}class Ar{constructor(o=!1,a=!1){this._isReadonly=o,this._isShallow=a}get(o,a,d){if(a==="__v_skip")return o.__v_skip;let f=this._isReadonly,p=this._isShallow;if(a==="__v_isReactive")return!f;else if(a==="__v_isReadonly")return f;else if(a==="__v_isShallow")return p;else if(a==="__v_raw"){if(d===(f?p?hc:bi:p?yi:xi).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(d))return o;return}let m=ct(o);if(!f){let h;if(m&&(h=oc[a]))return h;if(a==="hasOwnProperty")return sc}let g=Reflect.get(o,a,Ue(o)?o:d);if(ut(a)?hi.has(a):ic(a))return g;if(!f)Te(o,"get",a);if(p)return g;if(Ue(g)){let h=m&&hn(a)?g:g.value;return f&&dt(h)?Sr(h):h}if(dt(g))return f?Sr(g):wn(g);return g}}class Cr extends Ar{constructor(o=!1){super(!1,o)}set(o,a,d,f){let p=o[a],m=ct(o)&&hn(a);if(!this._isShallow){let y=He(p);if(!qe(d)&&!He(d))p=le(p),d=le(d);if(!m&&Ue(p)&&!Ue(d))if(y)return!0;else return p.value=d,!0}let g=m?Number(a)<o.length:mn(o,a),h=Reflect.set(o,a,d,Ue(o)?o:f);if(o===le(f)&&h){if(!g)Ke(o,"add",a,d);else if(Ie(d,p))Ke(o,"set",a,d,p)}return h}deleteProperty(o,a){let d=mn(o,a),f=o[a],p=Reflect.deleteProperty(o,a);if(p&&d)Ke(o,"delete",a,void 0,f);return p}has(o,a){let d=Reflect.has(o,a);if(!ut(a)||!hi.has(a))Te(o,"has",a);return d}ownKeys(o){return Te(o,"iterate",ct(o)?"length":tt),Reflect.ownKeys(o)}}class gi extends Ar{constructor(o=!1){super(!0,o)}set(o,a){return!0}deleteProperty(o,a){return!0}}var ac=new Cr,lc=new gi,cc=new Cr(!0);var br=(o)=>o,xn=(o)=>Reflect.getPrototypeOf(o);function uc(o,a,d){return function(...f){let p=this.__v_raw,m=le(p),g=$t(m),h=o==="entries"||o===Symbol.iterator&&g,y=o==="keys"&&g,E=p[o](...f),A=d?br:a?nt:Je;return!a&&Te(m,"iterate",y?yr:tt),pn(Object.create(E),{next(){let{value:T,done:C}=E.next();return C?{value:T,done:C}:{value:h?[A(T[0]),A(T[1])]:A(T),done:C}}})}}function yn(o){return function(...a){return o==="delete"?!1:o==="clear"?void 0:this}}function dc(o,a){let d={get(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"get",p);Te(g,"get",h)}let{has:y}=xn(g),E=a?br:o?nt:Je;if(y.call(g,p))return E(m.get(p));else if(y.call(g,h))return E(m.get(h));else if(m!==g)m.get(p)},get size(){let p=this.__v_raw;return!o&&Te(le(p),"iterate",tt),p.size},has(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"has",p);Te(g,"has",h)}return p===h?m.has(p):m.has(p)||m.has(h)},forEach(p,m){let g=this,h=g.__v_raw,y=le(h),E=a?br:o?nt:Je;return!o&&Te(y,"iterate",tt),h.forEach((A,T)=>p.call(m,E(A),E(T),g))}};return pn(d,o?{add:yn("add"),set:yn("set"),delete:yn("delete"),clear:yn("clear")}:{add(p){let m=le(this),g=xn(m),h=le(p),y=!a&&!qe(p)&&!He(p)?h:p;if(!(g.has.call(m,y)||Ie(p,y)&&g.has.call(m,p)||Ie(h,y)&&g.has.call(m,h)))m.add(y),Ke(m,"add",y,y);return this},set(p,m){if(!a&&!qe(m)&&!He(m))m=le(m);let g=le(this),{has:h,get:y}=xn(g),E=h.call(g,p);if(!E)p=le(p),E=h.call(g,p);let A=y.call(g,p);if(g.set(p,m),!E)Ke(g,"add",p,m);else if(Ie(m,A))Ke(g,"set",p,m,A);return this},delete(p){let m=le(this),{has:g,get:h}=xn(m),y=g.call(m,p);if(!y)p=le(p),y=g.call(m,p);let E=h?h.call(m,p):void 0,A=m.delete(p);if(y)Ke(m,"delete",p,void 0,E);return A},clear(){let p=le(this),m=p.size!==0,g=void 0,h=p.clear();if(m)Ke(p,"clear",void 0,void 0,void 0);return h}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{d[p]=uc(p,o,a)}),d}function Pr(o,a){let d=dc(o,a);return(f,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return a;else if(p==="__v_raw")return f;return Reflect.get(mn(d,p)&&p in f?d:f,p,m)}}var fc={get:Pr(!1,!1)},pc={get:Pr(!1,!0)},mc={get:Pr(!0,!1)};var xi=new WeakMap,yi=new WeakMap,bi=new WeakMap,hc=new WeakMap;function gc(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wn(o){if(He(o))return o;return Nr(o,!1,ac,fc,xi)}function Si(o){return Nr(o,!1,cc,pc,yi)}function Sr(o){return Nr(o,!0,lc,mc,bi)}function Nr(o,a,d,f,p){if(!dt(o))return o;if(o.__v_raw&&!(a&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let g=gc(ei(o));if(g===0)return o;let h=new Proxy(o,g===2?f:d);return p.set(o,h),h}function It(o){if(He(o))return It(o.__v_raw);return!!(o&&o.__v_isReactive)}function He(o){return!!(o&&o.__v_isReadonly)}function qe(o){return!!(o&&o.__v_isShallow)}function xc(o){return o?!!o.__v_raw:!1}function le(o){let a=o&&o.__v_raw;return a?le(a):o}var Je=(o)=>dt(o)?wn(o):o,nt=(o)=>dt(o)?Sr(o):o;function Ue(o){return o?o.__v_isRef===!0:!1}function ze(o){return yc(o,!1)}function yc(o,a){if(Ue(o))return o;return new Ei(o,a)}class Ei{constructor(o,a){this.dep=new vn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?o:le(o),this._value=a?o:Je(o),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(o){let a=this._rawValue,d=this.__v_isShallow||qe(o)||He(o);if(o=d?o:le(o),Ie(o,a))this._rawValue=o,this._value=d?o:Je(o),this.dep.trigger()}}class vi{constructor(o,a,d){this.fn=o,this.setter=a,this._value=void 0,this.dep=new vn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_t-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=d}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return ai(this,!0),!0}get value(){let o=this.dep.track();if(ui(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function jt(o,a,d=!1){let f,p;if(Zo(o))f=o;else f=o.get,p=o.set;return new vi(f,p,d)}function Tn(o){return o.replaceAll(/[A-Z]/g,(a)=>`-${a.toLowerCase()}`)}var bc=new Set(["all","print","screen","speech"]);function wi(o,a){if(o.startsWith("@--"))return a[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let d=o.slice(2,-1).trim();return bc.has(d.toLowerCase())?d:o.slice(1)}return null}function Ht(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Vt(o){return o.startsWith("@keyframes")}function Ti(o,a){let d=[];for(let f of Rr(o))for(let p of Rr(a))d.push(Sc(f,p));return d.join(", ")}function Sc(o,a){if(a.startsWith("&"))return a.replaceAll("&",o);if(a.startsWith("[")||a.startsWith(":")||a.startsWith("."))return`${o}${a}`;return`${o} ${a}`}function Rr(o){let a=[],d=0,f=null,p=0;for(let g=0;g<o.length;g+=1){let h=o[g];if(f){if(h==="\\")g+=1;else if(h===f)f=null;continue}if(h==='"'||h==="'")f=h;else if(h==="("||h==="[")d+=1;else if(h===")"||h==="]")d=Math.max(0,d-1);else if(h===","&&d===0)a.push(o.slice(p,g)),p=g+1}a.push(o.slice(p));let m=a.flatMap((g)=>{let h=g.trim();return h===""?[]:[h]});return m.length>0?m:[o]}var Ec=/[\s>+~,()]/,vc=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function wc(o,a){let d="",f=0;for(;;){let p=o.indexOf("[open]",f);if(p===-1)return d+o.slice(f);let m=p;while(m>0&&!Ec.test(o.charAt(m-1)))m-=1;let g=vc.exec(o.slice(m,p))?.[0]?.toLowerCase(),h=g===void 0?a.dialog===!0:g==="dialog";d+=o.slice(f,p)+(h?"[data-jx-dialog-open]":"[open]"),f=p+6}}function $r(o,a={}){if(o.includes("::backdrop"))return null;let d=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return wc(d,a)}var Ge="data-color-scheme";function An(o){let a=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return a==="light"||a==="dark"?a:null}function Ai(o,a){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ge}]))`,forced:`${o}:where([${Ge}="${a}"])`};return{auto:`:where(:root:not([${Ge}])) ${o}`,forced:`:where(:root[${Ge}="${a}"]) ${o}`}}function Wt(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function Or(o){return o.startsWith("--")?o:Tn(o)}function Ft(o){let a=2166136261;for(let d=0;d<o.length;d+=1)a^=o.charCodeAt(d),a=Math.imul(a,16777619);return(a>>>0).toString(36)}function Ci(o,a,d){let f=d.map(([m,g])=>`${m}: ${g}`).join("; "),p=a===null?f:`${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Tc(o,a,d){let f=d.map(({selector:m,declarations:g})=>`${m} { ${g.map(([h,y])=>`${h}: ${y}`).join("; ")} }`).join(" "),p=`@keyframes ${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Ac(o){let a=Object.keys(o).filter((f)=>Vt(f));if(a.length===0)return o;let d={...o};for(let f of a)delete d[f];return d}function Cc(o){let a=o.startsWith("&")?o.slice(1):o;return a===""||a.startsWith(":")||a.startsWith(".")||a.startsWith("[")}function Bt(o,a={}){let{scope:d=null,mediaQueries:f={},transposeValue:p=(L)=>L,transposeSelector:m=(L)=>L,resolveValue:g}=a,h=[],y=(L)=>L!==null&&typeof L==="object"&&!Array.isArray(L)&&!r(L),E=(L,_)=>{if(y(_))return[_];if(!Ht(L)||!Array.isArray(_)||_.length===0)return[];return _.every((Y)=>y(Y))?_:[]},A=(L,_,Y,q)=>{if(_===void 0||_===null)return null;if(r(_))return Y?g?.(L,_,q)??null:null;if(n(_))return null;let G=String(_);if(c(G))return Y?g?.(L,G,q)??null:null;return p(G)},T=(L,_,Y=!0,q="self")=>{let G=[];for(let[U,M]of Object.entries(L)){if(E(U,M).length>0)continue;if(_&&(U.startsWith("@")||Wt(U)))continue;if(U.startsWith("$"))continue;let B=A(U,M,Y,q);if(B!==null)G.push([Or(U),B])}return G},C=(L,_,Y,q,G)=>{if(Y.length===0)return;let U=_;if(U!==null){let te=m(U);if(te===null)return;U=te}let M=Ci(L,U,Y),B={text:M,conditions:[...L],selector:U,declarations:Y,target:q,key:Ft(M)};if(e(G)&&G!=="")B.description=G;h.push(B)},H=(L,_,Y)=>{let q=L.slice(10).trim();if(q==="")return;let G=[];for(let[M,B]of Object.entries(_)){if(!y(B))continue;let te=T(B,!0,!1,"unscoped");if(te.length>0)G.push({declarations:te,selector:M.trim()})}if(G.length===0)return;let U=Tc(Y,q,G);h.push({blocks:G,conditions:[...Y],declarations:[],key:Ft(U),selector:null,target:"unscoped",text:U})},O=(L,_,Y,q,G)=>{if(L==="@--")return;if(Ht(L)){C([...q,L],null,T(_,!1,!0,"unscoped"),"unscoped",_.$description);return}if(Vt(L)){H(L,_,q);return}let U=wi(L,f),M=U===null?L:`@media ${U}`,B=U===null?null:An(U);if(B!==null&&Y!==null){let{auto:te,forced:X}=Ai(Y,B);K(_,te,[...q,M],G),K(Ac(_),X,q,G);return}K(_,Y,[...q,M],G)};function K(L,_,Y,q){C(Y,_,T(L,!0,!0,q),q,L.$description);for(let[G,U]of Object.entries(L))for(let M of E(G,U))if(G.startsWith("@"))O(G,M,_,Y,q);else if(_!==null)K(M,Ti(_,G),Y,Cc(G)?q:"descendant")}return K(o,d,[],"self"),h}var Fe="en-US",Pi="UTC",Ni=[{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."}],Ri=Ni.map((o)=>o.path),$i=Object.fromEntries(Ni.map((o)=>[o.path,o.params.indexOf("locale")]));function Pc(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function Mr(o){if(o==="")return[];return o.split("/").map((a)=>Pc(a))}function he(o,a){let d=o;for(let f of Mr(a))d=d?.[f];return d}function kr(o){let a=o.$map;return n(a)?a:void 0}function Nc(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function ki(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var _i=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Di=new Set(["!","-"]),Ji=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Rc=new Set(["=","+=","-=","*=","/="]),$c=new Set(["push","pop","shift","unshift","splice"]),Li=new Set(["reduce","map","filter"]),Ii=new Set(["?:","switch"]),ji=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"]),Oc=new Set([..._i,...Di,...Ji,...Li,...Ii,...ji,"call"]),Mc=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",...Ri]),kc=new Map([["Intl/compare",(o,a,d,f)=>new Intl.Collator(d??Fe,f).compare(o,a)],["Intl/displayName",(o,a,d,f)=>new Intl.DisplayNames(d??Fe,{...f,type:a??"language"}).of(o)],["Intl/formatDate",(o,a,d)=>new Intl.DateTimeFormat(a??Fe,{timeZone:Pi,...d}).format(new Date(o))],["Intl/formatList",(o,a,d)=>new Intl.ListFormat(a??Fe,d).format(o)],["Intl/formatNumber",(o,a,d)=>new Intl.NumberFormat(a??Fe,d).format(o)],["Intl/formatRelativeTime",(o,a,d,f)=>new Intl.RelativeTimeFormat(d??Fe,f).format(o,a)],["Intl/plural",(o,a,d)=>new Intl.PluralRules(a??Fe,d).select(o)],["Intl/segment",(o,a,d)=>[...new Intl.Segmenter(d??Fe,{granularity:a??"grapheme"}).segment(o)].map((f)=>f.segment)]]);function _c(o,a,d){let f=$i[o];if(f===void 0||f<0||a[f]!=null)return a;let p=he(d.$page,"locale");if(!e(p)||p==="")return a;let m=[...a];return m[f]=p,m}function Dc(o){return o.startsWith("window#/")&&Mc.has(o.slice(8))}function Hi(o){return _i.has(o)}var Oi=64,Jc=64;function pe(o,a){if(!o)return;let d=(o.depth??0)+1;if(d>Jc)return;return{depth:d,path:[...o.path??[],...Array.isArray(a)?a:[a]],report:o.report}}function fe(o,a,d,f,p){if(o===null||o===void 0)return o;if(Nc(o))return Ae(o,a,d,f,p);if(ki(o)){let m=Cn(o.$ref,a,d,f);return p?.report(p.path??[],m),m}if(Array.isArray(o))return Fi(o,a,d,f,p);return p?.report(p.path??[],o),o}function Fi(o,a,d,f,p){return o.map((m,g)=>fe(m,a,d,f,pe(p,g)))}function Lc(o,a,d,f){let p=(m)=>{if(!o.slice(m.length).includes("/"))return a;return Cn(o.slice(0,o.lastIndexOf("/")),a,d,f)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?Cn(o.slice(0,o.lastIndexOf("/")),a,d,f):void 0;return}function Cn(o,a,d,f){if(o==="$reduce/acc")return f?.acc;if(o.startsWith("$reduce/"))return f?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=f?.args?.[p[0]];return p.length>1?he(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return he(d,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=kr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];return p.length>2?he(g,p.slice(2).join("/")):g}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function Ic(o,a,d,f){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=kr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];if(p.length>2){let y=p.slice(2),E=y.pop(),A=y.length>0?he(g,y.join("/")):g;return{key:E,obj:A}}return{key:m==="item"?"$map/item":"$map/index",obj:kr(a)??a}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:a};let g=Mr(p),h=g.pop(),y=a;for(let E of g)y=y[E];return{key:h,obj:y}}return{key:o,obj:a}}function Ae(o,a,d,f,p){let m=jc(o,a,d,f,p);return p?.report(p.path??[],m),m}function Mi(o,a,d){switch(o){case"+":return a+d;case"-":return a-d;case"*":return a*d;case"/":return a/d;case"%":return a%d;case"<":return a<d;case"<=":return a<=d;case">":return a>d;default:return a>=d}}function jc(o,a,d,f,p){let{operator:m,target:g,value:h,initial:y}=o;if(!Oc.has(m))throw Error(`$expression: unknown operator "${m}"`);if(Di.has(m)&&!("value"in o)){let E=fe(g,a,d,f,pe(p,"target"));if(m==="!")return!E;if(m==="-")return-E}if(m==="call"){let E=ki(g)?g.$ref:void 0;if(!e(E))throw TypeError("$expression: call target must be a $ref pointer");let A=(f?.callDepth??0)+1;if(A>Oi)throw Error(`$expression: call depth exceeded (${Oi})`);let T=Array.isArray(h)?h.map((H,O)=>fe(H,a,d,f,pe(p,["value",O]))):[];if(E.startsWith("window#/")){if(!Dc(E))throw Error(`$expression: "${E}" is not a blessed pure global`);let H=E.slice(8),O=kc.get(H);if(O)return O(..._c(H,T,a));let K=he(globalThis.window,H),L=H.lastIndexOf("/"),_=L===-1?globalThis.window:he(globalThis.window,H.slice(0,L));return K.apply(_,T)}let C=Cn(E,a,d,f);if(t(C))return C.apply(Lc(E,a,d,f),T);if(n(C)&&"$expression"in C){let H=C,O={};for(let[K,L]of(H.parameters??[]).entries()){let _=e(L)?L:L?.name??"";if(!_)continue;O[_]=T[K]===void 0&&n(L)&&"default"in L?L.default:T[K]}return Ae(H.$expression,a,d,{args:O,callDepth:A})}throw TypeError(`$expression: call target "${E}" is not callable`)}if(Ii.has(m)){if(m==="?:"){let H=fe(g,a,d,f,pe(p,"target"));if(p){let O=fe(h,a,d,f,pe(p,"value")),K=fe(y,a,d,f,pe(p,"initial"));return H?O:K}return H?fe(h,a,d,f):fe(y,a,d,f)}let E=fe(g,a,d,f,pe(p,"target")),A=String(E),T=o.cases??{},C=Object.hasOwn(T,A);if(p){let H;for(let[K,L]of Object.entries(T)){let _=fe(L,a,d,f,pe(p,["cases",K]));if(K===A)H=_}let O=fe(o.default,a,d,f,pe(p,"default"));return C?H:O}return C?fe(T[A],a,d,f):fe(o.default,a,d,f)}if(Ji.has(m)){let E=fe(g,a,d,f,pe(p,"target")),A=fe(h,a,d,f,pe(p,"value"));switch(m){case"===":return E===A;case"!==":return E!==A;case"&&":return E&&A;case"||":return E||A;case"??":return E??A;default:return Mi(m,E,A)}}if(Rc.has(m)){let E=fe(h,a,d,f,pe(p,"value")),{obj:A,key:T}=Ic(g.$ref,a,d,f);A[T]=m==="="?E:Mi(m.slice(0,-1),A[T],E);return}if($c.has(m)){let E=fe(g,a,d,f,pe(p,"target"));switch(m){case"push":return E.push(fe(h,a,d,f,pe(p,"value")));case"unshift":return E.unshift(fe(h,a,d,f,pe(p,"value")));case"pop":return E.pop();case"shift":return E.shift();case"splice":{let A=fe(h,a,d,f,pe(p,"value"));return E.splice(...A)}default:break}}if(ji.has(m)){let E=fe(g,a,d,f,pe(p,"target")),A=h===void 0?[]:Array.isArray(h)?Fi(h,a,d,f,pe(p,"value")):[fe(h,a,d,f,pe(p,"value"))],T=he(E,m);if(!t(T))return;return T.apply(E,A)}if(Li.has(m)){let E=fe(g,a,d,f,pe(p,"target")),A=h;if(m==="reduce"){let T=fe(y,a,d,f,pe(p,"initial"));for(let[C,H]of E.entries())T=Ae(A,a,d,{acc:T,index:C,item:H},C===0?pe(p,"value"):void 0);return T}if(m==="map")return E.map((T,C)=>Ae(A,a,d,{...f,index:C,item:T},C===0?pe(p,"value"):void 0));if(m==="filter")return E.filter((T,C)=>Ae(A,a,d,{...f,index:C,item:T},C===0?pe(p,"value"):void 0))}return}function rt(o,a,d,f){return fe(o,a,d,f)}function Pn(o){let a=o.replaceAll("\\","/");return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function Vi(o){let a=Pn(o);return a.startsWith("/")?a:`/${a}`}function Wi(o,a){return[...o].toSorted((d,f)=>f[a].length-d[a].length)}function Hc(o,a){return o===a||o.startsWith(`${a}/`)}function Bi(o,a){let d=Pn(a);for(let f of Wi(o,"dir")){let p=Pn(f.dir);if(!Hc(d,p)||d===p)continue;let m=d.slice(p.length+1),{filter:g}=f;if(g&&!g(m))return null;let h=m.split("/").map((y)=>encodeURIComponent(y)).join("/");return`${Vi(f.urlPrefix)}/${h}`}return null}function Fc(o,a){let d=a.split("#")[0].split("?")[0];if(!d.startsWith("/"))return null;let f;try{f=decodeURIComponent(d)}catch{return null}if(/%2e|%2f/i.test(f))return null;for(let p of Wi(o,"urlPrefix")){let m=Vi(p.urlPrefix);if(!f.startsWith(`${m}/`))continue;let h=f.slice(m.length+1).split("/");if(h.some((E)=>E===""||E==="."||E===".."))return null;let{filter:y}=p;if(y&&!y(h.join("/")))return null;return`${Pn(p.dir)}/${h.join("/")}`}return null}var Dp=String.raw`"'\s<>()\\`;var Vc="public";function Kt(o){let a=o.search(/[#?]/);return a===-1?{path:o,suffix:""}:{path:o.slice(0,a),suffix:o.slice(a)}}function _r(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function Dr(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function Jr(o,a){let f=(o===""||o==="."?[]:Dr(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of a.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.join("/")}function Wc(o,a,d){let{path:f}=Kt(o);if(!f.startsWith("/"))return[];let p;try{p=decodeURIComponent(f)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((h)=>h==="."||h===".."))return[];let g=[];for(let h of d){if(h==="mounts"){let y=Fc(a,f);if(y!==null&&!y.startsWith("/")&&!/^[A-Za-z]:/.test(y))g.push(Dr(y));continue}g.push(h==="root"?m:`${Vc}/${m}`)}return[...new Set(g)]}function Ki(o,a,d,f){let{path:p}=Kt(o);if(p==="")return null;if(_r(o))return p.startsWith("/")?Wc(p,d,f)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let g=Jr(a,m);if(g===null||g===""||g===Dr(a))return null;return g}function Ui(o){return o.split("/").map((a)=>encodeURIComponent(a)).join("/")}function qi(o){let a=[],d=0;while(d<o.length){while(d<o.length&&(/\s/.test(o[d])||o[d]===","))d+=1;if(d>=o.length)break;let f=d;while(d<o.length&&!/\s/.test(o[d]))d+=1;let p=o.slice(f,d);if(p.endsWith(",")){a.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(d<o.length&&/\s/.test(o[d]))d+=1;let m=d;while(d<o.length&&o[d]!==",")d+=1;let g=o.slice(m,d).trim();if(d+=1,p=p.replace(/,+$/,""),p!=="")a.push({descriptor:g,url:p})}return a}function zi(o){return o.map(({url:a,descriptor:d})=>d?`${a} ${d}`:a).join(", ")}function Bc(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function Kc(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function mt(o,a,d,f={}){let p=f.args?{args:f.args}:void 0;for(let m of o){let g=Bc(m);switch(g.kind){case"expression":{let h=Ae(g.node,a,d,p);if(Kc(h))await h;break}case"if":{let h=g.node,y=rt(h.if,a,d,p)?h.then:h.else;if(Array.isArray(y))await mt(y,a,d,f);break}case"switch":{let h=g.node,y=String(rt(h.$switch,a,d,p)),E=h.cases??{},A=Object.hasOwn(E,y)?E[y]:h.default;if(Array.isArray(A))await mt(A,a,d,f);break}case"dispatch":{let h=g.node,y=t(f.target)?f.target():f.target,E=d?.currentTarget??y;if(!E)break;let A={};if("detail"in h)A.detail=rt(h.detail,a,d,p);if(h.bubbles!==void 0)A.bubbles=h.bubbles;if(h.composed!==void 0)A.composed=h.composed;E.dispatchEvent(new CustomEvent(h.dispatchEvent,A));break}case"stopPropagation":{d?.stopPropagation();break}case"preventDefault":{d?.preventDefault();break}default:break}}}function Gi(o,a){for(let d of o.split(";")){let f=d.indexOf("=");if(f===-1)continue;if(d.slice(0,f).trim()===a)return d.slice(f+1)}return null}function Yi(o,a,d){let f=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(a))}`];if(d.maxAge!==void 0)p.push(`Max-Age=${d.maxAge}`);let m=f?"/":d.path;if(m)p.push(`Path=${m}`);if(d.domain&&!f)p.push(`Domain=${d.domain}`);let{sameSite:g}=d;if(d.secure===!0||f||o.startsWith("__Secure-")||g?.toLowerCase()==="none")p.push("Secure");if(g)p.push(`SameSite=${g}`);return p.join("; ")}function Lr(o){return t(o)}var Ir=new Map;function Uc(o){return o.headers?.get("Content-Type")??""}async function Kr(o,a){if(!e(o))return o;let d=a?.resolver?.(o);if(d)return d;if(Ir.has(o))return Ir.get(o);let f=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);if(Uc(p).includes("text/html"))throw Error(`Jx: ${o} 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 p.json()});return Ir.set(o,f),f}var qc=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),ys={skip:!1};function bs(o){ys.skip=o}var Ss={skip:!1};function Es(o){Ss.skip=o}var Hr=null;function vs(o){Hr=o||null}function ws(o){return Hr?`${o}?token=${encodeURIComponent(Hr)}`:o}function Ts(o){let a=pt(!0);return a.run(()=>{we(o)}),()=>a.stop()}function bt(o){let a=pt(!0);try{return{result:a.run(o),stop:()=>a.stop()}}catch(d){throw a.stop(),d}}var As=!1;function Cs(o){As=o}var zc=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Gc=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function Yc(o){if(!As||!o.includes("v"))return o;return o.replaceAll(zc,(a,d,f)=>`${d}${Gc.get(f.toLowerCase())??`cq${f}`}`)}var Ps=!1;function Ns(o){Ps=o}var Ur=!1;function Rs(o){Ur=o}var qr=!1;function $s(o){qr=o}var Rn=!1;function Fr(o){return Rn||o.dataset.jxPath!==void 0}function Xc(o,a){if(Ps&&a==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(Ur&&a==="popover"&&Fr(o))return"data-jx-popover";if(qr&&Fr(o)){if(a==="commandfor")return"data-jx-commandfor";if(a==="inert")return"data-jx-inert";if(a==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return a}var xt=null;function Jn(o){xt=o}var Zc=new Set(["src","poster","data"]),Qc=new Set(["srcset","imagesrcset"]),eu=new Set(["LINK"]);function tu(o,a){return Zc.has(a)||a==="href"&&eu.has(o)}function zr(o,a,d){if(!xt||d==="")return d;let f=a.toLowerCase();if(Qc.has(f)){let p=qi(d),m=p.map((h)=>{let y=xt?.(h.url,f)??null;if(y===null||y===h.url)return h;return{descriptor:h.descriptor,url:y}});return m.some((h,y)=>h!==p[y])?zi(m):d}if(!tu(o,f))return d;return xt(d,f)??d}var nu=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function ru(o){if(!xt||!o.includes("url("))return o;return o.replaceAll(nu,(a,d,f)=>{let p=f===""?null:xt?.(f,"url()")??null;return p===null?a:`url(${d}${p}${d})`})}function $n(o){return Yc(ru(o))}var Os=!1;function Ms(o){Os=o}var ou=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function iu(o,a,d){if(!Os||o!=="textContent")return null;let f=null;if(r(a)){if(!a.$ref.startsWith("#/state/"))return null;let m=a.$ref.slice(8);f=m&&!m.includes("/")?m:null}else if(e(a))f=ou.exec(a)?.[1]??null;if(!f)return null;let p=le(d)[f];if(Ue(p)||t(p))return null;if(n(p))return null;return f}async function Ln(o,a={},d=location.href,f){let p=()=>f?.root??null,m={},g=o.state??{},h=It(a);for(let T of Object.keys(a))if(h&&!(T in g))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>a[T],set:(C)=>{a[T]=C}});else m[T]=a[T];let y=o.imports??{};for(let[,T]of Object.entries(g))if(R(T)&&!T.$src){let C=y[T.$prototype];if(C){if(!C.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${C}"`);continue}T.$src=C}}for(let[T,C]of Object.entries(g)){if(e(C)){if(!C.includes("${"))m[T]=C;continue}if(i(C)||x(C)||C===null){m[T]=C;continue}if(Array.isArray(C)){m[T]=C;continue}if(n(C)){if(C.$prototype)continue;if(b(C))continue;if(D(C))continue;if("default"in C){m[T]=C.default;continue}if(su(C))continue;m[T]=C}}let E=wn(m);for(let[T,C]of Object.entries(g))if(e(C)&&C.includes("${"))E[T]=jt(()=>Js(C,E));for(let[T,C]of Object.entries(g))if(b(C)){let H=C.$expression;if(j(C)){let O=C.parameters;E[T]=(...K)=>Ae(H,E,null,{args:Xi(O,K)})}else if(Hi(H.operator)){let O=(K,L)=>Ae(H,K,L);E[T]=O}else E[T]=jt(()=>Ae(H,E,null))}for(let[T,C]of Object.entries(g))if(k(C)){let{body:H}=C;if(Array.isArray(C.parameters)&&C.parameters.length>0){let O=C.parameters;E[T]=(...K)=>mt(H,E,null,{args:Xi(O,K),target:p})}else{let O=(K,L)=>{mt(H,K,L??null,{target:p})};E[T]=O}}else if(v(C))E[T]=await du(C,E,T,d);for(let[T,C]of Object.entries(g))if(R(C))E[T]=await Cu(C,E,T,d,f);if(!(f?.skipServerFunctions??ys.skip)){for(let[T,C]of Object.entries(g))if(D(C))E[T]=await ku(C,E,T,d)}let A=f?.media??Gs;if(o.$media)E.$media=o.$media;else if(!E.$media&&Object.keys(A).length>0)E.$media=A;return E}function Xi(o,a){let d={};for(let[f,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;d[m]=a[f]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:a[f]}return d}function su(o){for(let a of Object.keys(o))if(qc.has(a))return!0;return!1}var ks=["state","$map","item","index","$site","$page"];function _s(o){let a=lu(o);return[o,a,a?.item,a?.index,o.$site,o.$page]}function Ye(o,a){let d=Zi.get(o);if(!d)d=Function(...ks,`return \`${o}\``),Ds(Zi,o,d);return d(..._s(a))}var Zi=new Map,Qi=new Map,au=4096;function Ds(o,a,d){if(o.size>=au)o.clear();o.set(a,d)}var es=new Set,ts=null;function In(o,a,d){we(()=>{try{a()}catch(f){if(ts)ts(f instanceof Error?f:Error(String(f)),o);else if(!es.has(o))es.add(o),console.warn(`jx: template ${JSON.stringify(o)} threw:`,f);d?.()}})}function lu(o){return o.$map}function cu(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let a=0;for(let d=1;d<o.length;d+=1){let f=o[d];if(f==="{")a+=1;else if(f==="}"){if(a-=1,a===0)return d===o.length-1}}return!1}function Js(o,a){if(!cu(o))return Ye(o,a);let d=Qi.get(o);if(!d)d=Function(...ks,`return (${o.slice(2,-1)})`),Ds(Qi,o,d);return d(..._s(a))}var Ls=null;function Is(o){Ls=o}var ns="npm:";async function uu(o,a){if(o.startsWith(ns)){let d=o.slice(ns.length);return ht(Ls?.(d)??d)}if(a)try{return await ht(new URL(o,a).href)}catch{return ht(o)}return ht(o)}function ht(o){return import(o)}var St=new Map,gt=new Map,js=new Set;function Hs(o,a){if(js.add(o),t(a)){St.delete(o),gt.set(o,a);return}gt.delete(o),St.set(o,a)}function Gr(o){let a=St.get(o);if(a)return a;let d=gt.get(o);if(!d)return;if(!t(d))return d;let f=d(),p=(async()=>{try{let m=await f;return St.set(o,m),gt.delete(o),m}catch(m){throw gt.set(o,d),m}})();return gt.set(o,p),p}async function du(o,a,d,f){if(o.body&&o.$src)throw Error(`Jx: '${d}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let h=Vr(o),y=Function(...h,"");return Object.defineProperty(y,"name",{configurable:!0,value:o.name??d}),y}let p;if(e(o.body)){let h=Vr(o);p=Function(...h,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??d})}else{let h=o.$src;if(!h)throw Error(`Jx: '${d}' has neither body nor $src`);let y=o.$export??d,E,A=Gr(h);if(A instanceof Promise)E=await A;else if(A)E=A;else E=await uu(h,f),St.set(h,E);let T=E[y]??E.default?.[y];if(!t(T))throw TypeError(`Jx: export "${y}" not found or not a function in "${h}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,g=!1;if(!m)g=e(o.body)?I(o.body):p.length<=1&&I(p.toString());if(g)return jt(()=>p(a));return p}function Vr(o){let a=o.parameters?W(o.parameters):o.arguments??[];return a.length>0&&a[0]==="state"?a:["state",...a]}var Gt=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"]);function Yr(o){return Object.create(o)}function jn(o){return o.$media??{}}function Hn(o){return o}function fu(o){let a=Hn(o)._state;return n(a)?a:null}function pu(o){return t(o)}var rs=new Set,mu="http://www.w3.org/2000/svg",hu="http://www.w3.org/1998/Math/MathML";function gu(o,a){if(o==="svg")return mu;if(o==="math")return hu;return a??null}function Oe(o,a,d){let f=d?._path??[];if(e(o)||i(o)||x(o)){let T=document.createTextNode(String(o));if(c(o))In(o,()=>{T.textContent=Ye(o,a)},()=>{T.textContent=""});return T}let p=a;for(let[T,C]of Object.entries(o))if(T.startsWith("$")&&!Gt.has(T)){if(p===a)p=Yr(a);p[T]=r(C)?Se(C.$ref,a):C}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!rs.has(T))rs.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=Qr(o.tagName,p),g=m.includes("-")&&customElements.get(m);if(o.$props&&g)return ms(o,p,d,f);if(o.$props){if(m.includes("-"))return ms(o,p,d,f);let{$props:T,...C}=o;return Oe(C,Iu(o,p),d)}if(o.$switch)return Au(o,p,d);let h=gu(m,d?._ns),y=m==="foreignObject"?null:h,E=h?document.createElementNS(h,m):document.createElement(m);if(d?.onNodeCreated)d.onNodeCreated(E,f,o,p);if(Xr(E,o,p),o.style&&m.includes("-"))Zr.set(E,o.style);Fn(E,o.style??{},jn(p),p),Wn(E,o.attributes??{},p);let A=o.children;if(S(A)){let T=d||y?{...d,_ns:y,_path:[...f,"children"]}:void 0;Wr(E,A,p,T)}else if(Array.isArray(A))for(let T=0;T<A.length;T++){let C=A[T],H=d||y?{...d,_ns:y,_path:[...f,"children",T]}:void 0;if(S(C))Wr(E,C,p,H);else E.append(Oe(C,p,H))}return E}function Xr(o,a,d){for(let[f,p]of Object.entries(a)){if(Gt.has(f))continue;if(f.startsWith("$"))continue;if(f.startsWith("on")&&Fs(o,f,p,d))continue;Vs(o,f,p,d)}}function Fs(o,a,d,f){let p=a.slice(2),m=f;if(r(d)){let g=Se(d.$ref,f);if(pu(g))o.addEventListener(p,(h)=>g(m,h));return!0}if(k(d)){let{body:g}=d;return o.addEventListener(p,(h)=>{mt(g,m,h)}),!0}if(v(d)&&e(d.body)){let g=Vr(d),h=Function(...g,d.body);return o.addEventListener(p,(y)=>h(m,y)),!0}if(b(d)){let g=d.$expression;return o.addEventListener(p,(h)=>Ae(g,m,h)),!0}return!1}function xu(o,a,d){for(let[f,p]of Object.entries(a))if(f.startsWith("on")&&!Gt.has(f))Fs(o,f,p,d)}function Vs(o,a,d,f){let p=Hn(o),m=iu(a,d,f);if(m)o.dataset.jxBoundProp=m;let g=(y)=>e(y)?zr(o.tagName,a,y):y,h=(y)=>{let E=o;if(a==="className"&&!(E instanceof HTMLElement)){E.setAttribute("class",y==null?"":String(y));return}if(p[a]===y)return;p[a]=y};if(r(d)){let y=d;if(a==="id"){p[a]=Se(y.$ref,f);return}we(()=>{h(g(Se(y.$ref,f)))});return}if(c(d)){let y=d;In(y,()=>{h(g(Ye(y,f)))});return}h(g(d))}function os(o,a){let d=[];return{detach:a,insert(f){let p=[];for(let g of f){let h=o.cssRules.length;try{o.insertRule(g,h)}catch{continue}let y=o.cssRules[h];if(y)p.push(y)}let m={rules:p,texts:f};return d.push(m),m},remove(f){let p=d.indexOf(f);if(p!==-1)d.splice(p,1);if(f.rules.length===0)return;let m=[...o.cssRules],g=f.rules.map((h)=>m.indexOf(h)).filter((h)=>h>=0).toSorted((h,y)=>y-h);for(let h of g)o.deleteRule(h);f.rules.length=0},replaceAll(f){d.length=0,d.push({rules:[],texts:f}),o.replaceSync(f.join(`
|
|
1
|
+
import{e,i,x,t,n,s,r,v,b,j,k,R,D,S,l,c,I,F,Z,W,J,u,w}from"./chunks/iframe-entry-42hpmwz5.js";var Go,cr,fn,me=(o,a)=>{for(var[d,f,p]of Go||[])for(var m=[o],g=globalThis,h=g.document,y,E,A,T,C;E=m.pop();)if(!cr[E]&&(A=f[E])){cr[E]=1;for(T=1;T<A.length;T++)m.push(p[A[T]]);if(!a&&E!==o&&(y=h&&h.head)){if(fn===void 0)fn=(T=h.querySelector("meta[property=csp-nonce]"))&&(T.nonce||T.getAttribute("nonce"))||"";if(C=h.createElement("link"),C.rel="modulepreload",C.crossOrigin="",fn)C.nonce=fn;C.href=new g.URL(A[0],d),y.appendChild(C)}}},Zl=(o,a,d,f)=>{for(var p={},m=0;m<a.length;m++)p[a[m]]=d[m];(Go||=[]).push([o,p,a]),cr||={},me(a[f],1)};Zl(import.meta.url,["j3zcycb0","j0ebwr5s","dj1pvgz7","wewc8rq2","w11qpkyz","g3r2s0kn","04361ttk","853n6qt3","y62xq0ty","4aan7g6g","9tf4cjrk","rzds841e","m5rwn31z","ewh24n1f","f5cw3tgp","44cm5cta","h8dbasp1","qv5r2b16","nz2mrzky","6hs00996","c4x05vyx","7gka1h86","d2jxpgma","42hpmwz5","b5qgggyp","2x9bn5ng","btck0e9s"],[["./iframe-entry.js",23],["./chunks/tree-j0ebwr5s.js",23],["./chunks/tooltip-dj1pvgz7.js",24,23],["./chunks/textfield-wewc8rq2.js"],["./chunks/toast-w11qpkyz.js",25],["./chunks/toast-host-g3r2s0kn.js",25],["./chunks/color-04361ttk.js",26],["./chunks/icons-853n6qt3.js",23],["./chunks/number-field-y62xq0ty.js"],["./chunks/action-group-4aan7g6g.js"],["./chunks/popover-9tf4cjrk.js",24],["./chunks/select-rzds841e.js"],["./chunks/split-m5rwn31z.js",23],["./chunks/swatch-group-ewh24n1f.js"],["./chunks/tabs-f5cw3tgp.js"],["./chunks/toolbar-44cm5cta.js"],["./chunks/color-area-h8dbasp1.js",26,23],["./chunks/color-field-qv5r2b16.js",26,24,23],["./chunks/color-slider-nz2mrzky.js",26],["./chunks/combobox-6hs00996.js",24],["./chunks/dialog-c4x05vyx.js"],["./chunks/listbox-7gka1h86.js",23],["./chunks/menu-d2jxpgma.js",24,23],["./chunks/iframe-entry-42hpmwz5.js"],["./chunks/iframe-entry-b5qgggyp.js",23],["./chunks/iframe-entry-2x9bn5ng.js"],["./chunks/iframe-entry-btck0e9s.js",23]],0);
|
|
2
|
+
var ur="jx:canvas";function Yo(o){let{target:a,source:d,targetOrigin:f,acceptOrigin:p,token:m}=o,g=new Set,h=(y)=>{if(p!=="*"&&y.origin!==p)return;let E=y.data;if(!n(E)||!(ur in E)||E[ur]!==m)return;let A="payload"in E?E.payload:void 0;for(let T of g)T(A)};return d.addEventListener("message",h),{dispose(){g.clear(),d.removeEventListener("message",h)},onMessage(y){return g.add(y),()=>g.delete(y)},post(y){a.postMessage({[ur]:m,payload:y},f)}}}function dr(o){return o.ownerDocument.defaultView?.getComputedStyle(o).display==="contents"}function Pe(o){let a=o.getBoundingClientRect();if(a.width>0||a.height>0||!o.hasChildNodes()||!dr(o))return a;let d=null;for(let f of o.childNodes){let p=null;if(f instanceof Element)p=Pe(f);else if(f.nodeType===Node.TEXT_NODE){let m=o.ownerDocument.createRange();m.selectNodeContents(f),p=m.getBoundingClientRect()}if(!p||p.width===0&&p.height===0)continue;d=d?{bottom:Math.max(d.bottom,p.bottom),left:Math.min(d.left,p.left),right:Math.max(d.right,p.right),top:Math.min(d.top,p.top)}:{bottom:p.bottom,left:p.left,right:p.right,top:p.top}}return d?new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top):a}function Xo(o){return o.getBoundingClientRect()}function Zo(o,a,d=document){return d.elementFromPoint(o,a)}function fr(o){let a=Object.create(null);for(let d of o.split(","))a[d]=1;return(d)=>(d in a)}var pn=Object.assign;var Ql=Object.prototype.hasOwnProperty,mn=(o,a)=>Ql.call(o,a),ut=Array.isArray,$t=(o)=>ei(o)==="[object Map]";var Qo=(o)=>typeof o==="function",ec=(o)=>typeof o==="string",dt=(o)=>typeof o==="symbol",ft=(o)=>o!==null&&typeof o==="object";var tc=Object.prototype.toString,ei=(o)=>tc.call(o),ti=(o)=>ei(o).slice(8,-1);var hn=(o)=>ec(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var gn=(o)=>{let a=Object.create(null);return(d)=>a[d]||(a[d]=o(d))},nc=/-\w/g,hp=gn((o)=>o.replace(nc,(a)=>a.slice(1).toUpperCase())),rc=/\B([A-Z])/g,gp=gn((o)=>o.replace(rc,"-$1").toLowerCase()),ni=gn((o)=>o.charAt(0).toUpperCase()+o.slice(1)),xp=gn((o)=>o?`on${ni(o)}`:""),Ie=(o,a)=>!Object.is(o,a);var oc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var yp=fr(oc+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var be;class si{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&be)if(be.active)this.parent=be,this.index=(be.scopes||(be.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,a;if(this.scopes){let d=this.scopes.slice();for(o=0,a=d.length;o<a;o++)d[o].pause()}for(o=0,a=this.effects.length;o<a;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,a;if(this.scopes){let f=this.scopes.slice();for(o=0,a=f.length;o<a;o++)f[o].resume()}let d=this.effects.slice();for(o=0,a=d.length;o<a;o++)d[o].resume()}}}run(o){if(this._active){let a=be;try{return be=this,o()}finally{be=a}}}on(){if(++this._on===1)this.prevScope=be,be=this}off(){if(this._on>0&&--this._on===0){if(be===this)be=this.prevScope;else{let o=be;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let a,d;for(a=0,d=this.effects.length;a<d;a++)this.effects[a].stop();this.effects.length=0;for(a=0,d=this.cleanups.length;a<d;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){let f=this.scopes.slice();for(a=0,d=f.length;a<d;a++)f[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let f=this.parent.scopes.pop();if(f&&f!==this)this.parent.scopes[this.index]=f,f.index=this.index}this.parent=void 0}}}function mt(o){return new si(o)}function Sn(o,a=!1){if(be)be.cleanups.push(o)}var ue;var pr=new WeakSet;class bn{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,be)if(be.active)be.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,pr.has(this))pr.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))li(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ri(this),ci(this);let o=ue,a=$e;ue=this,$e=!0;try{return this.fn()}finally{ui(this),ue=o,$e=a,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)wr(o);this.deps=this.depsTail=void 0,ri(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)pr.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(gr(this))this.run()}get dirty(){return gr(this)}}var ai=0,Mt,kt;function li(o,a=!1){if(o.flags|=8,a){o.next=kt,kt=o;return}o.next=Mt,Mt=o}function vr(){ai++}function Er(){if(--ai>0)return;if(kt){let a=kt;kt=void 0;while(a){let d=a.next;a.next=void 0,a.flags&=-9,a=d}}let o;while(Mt){let a=Mt;Mt=void 0;while(a){let d=a.next;if(a.next=void 0,a.flags&=-9,a.flags&1)try{a.trigger()}catch(f){if(!o)o=f}a=d}}if(o)throw o}function ci(o){for(let a=o.deps;a;a=a.nextDep)a.version=-1,a.prevActiveLink=a.dep.activeLink,a.dep.activeLink=a}function ui(o){let a,d=o.depsTail,f=d;while(f){let p=f.prevDep;if(f.version===-1){if(f===d)d=p;wr(f),ic(f)}else a=f;f.dep.activeLink=f.prevActiveLink,f.prevActiveLink=void 0,f=p}o.deps=a,o.depsTail=d}function gr(o){for(let a=o.deps;a;a=a.nextDep)if(a.dep.version!==a.version||a.dep.computed&&(di(a.dep.computed)||a.dep.version!==a.version))return!0;if(o._dirty)return!0;return!1}function di(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===Jt)return;if(o.globalVersion=Jt,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!gr(o)))return;o.flags|=2;let a=o.dep,d=ue,f=$e;ue=o,$e=!0;try{ci(o);let p=o.fn(o._value);if(a.version===0||Ie(p,o._value))o.flags|=128,o._value=p,a.version++}catch(p){throw a.version++,p}finally{ue=d,$e=f,ui(o),o.flags&=-3}}function wr(o,a=!1){let{dep:d,prevSub:f,nextSub:p}=o;if(f)f.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=f,o.nextSub=void 0;if(d.subs===o){if(d.subs=f,!f&&d.computed){d.computed.flags&=-5;for(let m=d.computed.deps;m;m=m.nextDep)wr(m,!0)}}if(!a&&!--d.sc&&d.map)d.map.delete(d.key)}function ic(o){let{prevDep:a,nextDep:d}=o;if(a)a.nextDep=d,o.prevDep=void 0;if(d)d.prevDep=a,o.nextDep=void 0}function we(o,a){if(o.effect instanceof bn)o=o.effect.fn;let d=new bn(o);if(a)pn(d,a);try{d.run()}catch(p){throw d.stop(),p}let f=d.run.bind(d);return f.effect=d,f}var $e=!0,fi=[];function Dt(){fi.push($e),$e=!1}function Lt(){let o=fi.pop();$e=o===void 0?!0:o}function vn(o,a=!1){if(ue instanceof bn)ue.cleanup=o}function ri(o){let{cleanup:a}=o;if(o.cleanup=void 0,a){let d=ue;ue=void 0;try{a()}finally{ue=d}}}var Jt=0;class pi{constructor(o,a){this.sub=o,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class En{constructor(o){this.computed=o,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(o){if(!ue||!$e||ue===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==ue){if(a=this.activeLink=new pi(ue,this),!ue.deps)ue.deps=ue.depsTail=a;else a.prevDep=ue.depsTail,ue.depsTail.nextDep=a,ue.depsTail=a;mi(a)}else if(a.version===-1){if(a.version=this.version,a.nextDep){let d=a.nextDep;if(d.prevDep=a.prevDep,a.prevDep)a.prevDep.nextDep=d;if(a.prevDep=ue.depsTail,a.nextDep=void 0,ue.depsTail.nextDep=a,ue.depsTail=a,ue.deps===a)ue.deps=d}}return a}trigger(o){this.version++,Jt++,this.notify(o)}notify(o){vr();try{for(let a=this.subs;a;a=a.prevSub)if(a.sub.notify())a.sub.dep.notify()}finally{Er()}}}function mi(o){if(o.dep.sc++,o.sub.flags&4){let a=o.dep.computed;if(a&&!o.dep.subs){a.flags|=20;for(let f=a.deps;f;f=f.nextDep)mi(f)}let d=o.dep.subs;if(d!==o){if(o.prevSub=d,d)d.nextSub=o}o.dep.subs=o}}var xr=new WeakMap,tt=Symbol(""),yr=Symbol(""),_t=Symbol("");function Te(o,a,d){if($e&&ue){let f=xr.get(o);if(!f)xr.set(o,f=new Map);let p=f.get(d);if(!p)f.set(d,p=new En),p.map=f,p.key=d;p.track()}}function Ke(o,a,d,f,p,m){let g=xr.get(o);if(!g){Jt++;return}let h=(y)=>{if(y)y.trigger()};if(vr(),a==="clear")g.forEach(h);else{let y=ut(o),E=y&&hn(d);if(y&&d==="length"){let A=Number(f);g.forEach((T,C)=>{if(C==="length"||C===_t||!dt(C)&&C>=A)h(T)})}else{if(d!==void 0||g.has(void 0))h(g.get(d));if(E)h(g.get(_t));switch(a){case"add":if(!y){if(h(g.get(tt)),$t(o))h(g.get(yr))}else if(E)h(g.get("length"));break;case"delete":if(!y){if(h(g.get(tt)),$t(o))h(g.get(yr))}break;case"set":if($t(o))h(g.get(tt));break}}}Er()}function pt(o){let a=le(o);if(a===o)return a;if(Te(a,"iterate",_t),qe(o))return a;if(!He(o))return a.map(De);return It(o)?a.map((d)=>nt(De(d))):a.map(nt)}function Tr(o){return Te(o=le(o),"iterate",_t),o}function _e(o,a){if(He(o))return It(o)?nt(De(a)):nt(a);return De(a)}var sc={__proto__:null,[Symbol.iterator](){return mr(this,Symbol.iterator,(o)=>_e(this,o))},concat(...o){return pt(this).concat(...o.map((a)=>ut(a)?pt(a):a))},entries(){return mr(this,"entries",(o)=>(o[1]=_e(this,o[1]),o))},every(o,a){return je(this,"every",o,a,void 0,arguments)},filter(o,a){return je(this,"filter",o,a,(d)=>d.map((f)=>_e(this,f)),arguments)},find(o,a){return je(this,"find",o,a,(d)=>_e(this,d),arguments)},findIndex(o,a){return je(this,"findIndex",o,a,void 0,arguments)},findLast(o,a){return je(this,"findLast",o,a,(d)=>_e(this,d),arguments)},findLastIndex(o,a){return je(this,"findLastIndex",o,a,void 0,arguments)},forEach(o,a){return je(this,"forEach",o,a,void 0,arguments)},includes(...o){return hr(this,"includes",o)},indexOf(...o){return hr(this,"indexOf",o)},join(o){return pt(this).join(o)},lastIndexOf(...o){return hr(this,"lastIndexOf",o)},map(o,a){return je(this,"map",o,a,void 0,arguments)},pop(){return Ot(this,"pop")},push(...o){return Ot(this,"push",o)},reduce(o,...a){return ii(this,"reduce",o,a)},reduceRight(o,...a){return ii(this,"reduceRight",o,a)},shift(){return Ot(this,"shift")},some(o,a){return je(this,"some",o,a,void 0,arguments)},splice(...o){return Ot(this,"splice",o)},toReversed(){return pt(this).toReversed()},toSorted(o){return pt(this).toSorted(o)},toSpliced(...o){return pt(this).toSpliced(...o)},unshift(...o){return Ot(this,"unshift",o)},values(){return mr(this,"values",(o)=>_e(this,o))}};function mr(o,a,d){let f=Tr(o),p=f[a],m=p.call(f);if(f!==o&&!qe(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let g=Object.create(Object.getPrototypeOf(m));if(g.next=()=>oi(m.next(),d),p!==hi[a])Object.defineProperties(g,{return:{get(){let h=m.return;return typeof h==="function"?h.bind(m):h}},throw:{get(){let h=m.throw;return typeof h==="function"?h.bind(m):h}}});return g}m._next=m.next,m.next=()=>oi(m._next(),d)}return m}function oi(o,a){if(!o.done)o.value=a(o.value);return o}var hi=Array.prototype;function je(o,a,d,f,p,m){let g=Tr(o),h=g!==o&&!qe(o),y=g[a];if(y!==hi[a]){let T=y.apply(o,m);return h?De(T):T}let E=d;if(g!==o){if(h)E=function(T,C){return d.call(this,_e(o,T),C,o)};else if(d.length>2)E=function(T,C){return d.call(this,T,C,o)}}let A=y.call(g,E,f);return h&&p?p(A):A}function ii(o,a,d,f){let p=Tr(o),m=p!==o&&!qe(o),g=d,h=!1;if(p!==o){if(m)h=f.length===0,g=function(E,A,T){if(h)h=!1,E=_e(o,E);return d.call(this,E,_e(o,A),T,o)};else if(d.length>3)g=function(E,A,T){return d.call(this,E,A,T,o)}}let y=p[a](g,...f);return h?_e(o,y):y}function hr(o,a,d){let f=le(o);Te(f,"iterate",_t);let p=f[a](...d);if((p===-1||p===!1)&&bc(d[0]))return d[0]=le(d[0]),f[a](...d);return p}function Ot(o,a,d=[]){Dt(),vr();let f=le(o)[a].apply(o,d);return Er(),Lt(),f}var ac=fr("__proto__,__v_isRef,__isVue"),gi=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(dt));function lc(o){if(!dt(o))o=String(o);let a=le(this);return Te(a,"has",o),a.hasOwnProperty(o)}class Ar{constructor(o=!1,a=!1){this._isReadonly=o,this._isShallow=a}get(o,a,d){if(a==="__v_skip")return o.__v_skip;let f=this._isReadonly,p=this._isShallow;if(a==="__v_isReactive")return!f;else if(a==="__v_isReadonly")return f;else if(a==="__v_isShallow")return p;else if(a==="__v_raw"){if(d===(f?p?xc:Si:p?bi:yi).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(d))return o;return}let m=ut(o);if(!f){let h;if(m&&(h=sc[a]))return h;if(a==="hasOwnProperty")return lc}let g=Reflect.get(o,a,Ue(o)?o:d);if(dt(a)?gi.has(a):ac(a))return g;if(!f)Te(o,"get",a);if(p)return g;if(Ue(g)){let h=m&&hn(a)?g:g.value;return f&&ft(h)?Sr(h):h}if(ft(g))return f?Sr(g):wn(g);return g}}class Cr extends Ar{constructor(o=!1){super(!1,o)}set(o,a,d,f){let p=o[a],m=ut(o)&&hn(a);if(!this._isShallow){let y=He(p);if(!qe(d)&&!He(d))p=le(p),d=le(d);if(!m&&Ue(p)&&!Ue(d))if(y)return!0;else return p.value=d,!0}let g=m?Number(a)<o.length:mn(o,a),h=Reflect.set(o,a,d,Ue(o)?o:f);if(o===le(f)&&h){if(!g)Ke(o,"add",a,d);else if(Ie(d,p))Ke(o,"set",a,d,p)}return h}deleteProperty(o,a){let d=mn(o,a),f=o[a],p=Reflect.deleteProperty(o,a);if(p&&d)Ke(o,"delete",a,void 0,f);return p}has(o,a){let d=Reflect.has(o,a);if(!dt(a)||!gi.has(a))Te(o,"has",a);return d}ownKeys(o){return Te(o,"iterate",ut(o)?"length":tt),Reflect.ownKeys(o)}}class xi extends Ar{constructor(o=!1){super(!0,o)}set(o,a){return!0}deleteProperty(o,a){return!0}}var cc=new Cr,uc=new xi,dc=new Cr(!0);var br=(o)=>o,xn=(o)=>Reflect.getPrototypeOf(o);function fc(o,a,d){return function(...f){let p=this.__v_raw,m=le(p),g=$t(m),h=o==="entries"||o===Symbol.iterator&&g,y=o==="keys"&&g,E=p[o](...f),A=d?br:a?nt:De;return!a&&Te(m,"iterate",y?yr:tt),pn(Object.create(E),{next(){let{value:T,done:C}=E.next();return C?{value:T,done:C}:{value:h?[A(T[0]),A(T[1])]:A(T),done:C}}})}}function yn(o){return function(...a){return o==="delete"?!1:o==="clear"?void 0:this}}function pc(o,a){let d={get(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"get",p);Te(g,"get",h)}let{has:y}=xn(g),E=a?br:o?nt:De;if(y.call(g,p))return E(m.get(p));else if(y.call(g,h))return E(m.get(h));else if(m!==g)m.get(p)},get size(){let p=this.__v_raw;return!o&&Te(le(p),"iterate",tt),p.size},has(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(Ie(p,h))Te(g,"has",p);Te(g,"has",h)}return p===h?m.has(p):m.has(p)||m.has(h)},forEach(p,m){let g=this,h=g.__v_raw,y=le(h),E=a?br:o?nt:De;return!o&&Te(y,"iterate",tt),h.forEach((A,T)=>p.call(m,E(A),E(T),g))}};return pn(d,o?{add:yn("add"),set:yn("set"),delete:yn("delete"),clear:yn("clear")}:{add(p){let m=le(this),g=xn(m),h=le(p),y=!a&&!qe(p)&&!He(p)?h:p;if(!(g.has.call(m,y)||Ie(p,y)&&g.has.call(m,p)||Ie(h,y)&&g.has.call(m,h)))m.add(y),Ke(m,"add",y,y);return this},set(p,m){if(!a&&!qe(m)&&!He(m))m=le(m);let g=le(this),{has:h,get:y}=xn(g),E=h.call(g,p);if(!E)p=le(p),E=h.call(g,p);let A=y.call(g,p);if(g.set(p,m),!E)Ke(g,"add",p,m);else if(Ie(m,A))Ke(g,"set",p,m,A);return this},delete(p){let m=le(this),{has:g,get:h}=xn(m),y=g.call(m,p);if(!y)p=le(p),y=g.call(m,p);let E=h?h.call(m,p):void 0,A=m.delete(p);if(y)Ke(m,"delete",p,void 0,E);return A},clear(){let p=le(this),m=p.size!==0,g=void 0,h=p.clear();if(m)Ke(p,"clear",void 0,void 0,void 0);return h}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{d[p]=fc(p,o,a)}),d}function Pr(o,a){let d=pc(o,a);return(f,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return a;else if(p==="__v_raw")return f;return Reflect.get(mn(d,p)&&p in f?d:f,p,m)}}var mc={get:Pr(!1,!1)},hc={get:Pr(!1,!0)},gc={get:Pr(!0,!1)};var yi=new WeakMap,bi=new WeakMap,Si=new WeakMap,xc=new WeakMap;function yc(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wn(o){if(He(o))return o;return Nr(o,!1,cc,mc,yi)}function vi(o){return Nr(o,!1,dc,hc,bi)}function Sr(o){return Nr(o,!0,uc,gc,Si)}function Nr(o,a,d,f,p){if(!ft(o))return o;if(o.__v_raw&&!(a&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let g=yc(ti(o));if(g===0)return o;let h=new Proxy(o,g===2?f:d);return p.set(o,h),h}function It(o){if(He(o))return It(o.__v_raw);return!!(o&&o.__v_isReactive)}function He(o){return!!(o&&o.__v_isReadonly)}function qe(o){return!!(o&&o.__v_isShallow)}function bc(o){return o?!!o.__v_raw:!1}function le(o){let a=o&&o.__v_raw;return a?le(a):o}var De=(o)=>ft(o)?wn(o):o,nt=(o)=>ft(o)?Sr(o):o;function Ue(o){return o?o.__v_isRef===!0:!1}function ze(o){return Sc(o,!1)}function Sc(o,a){if(Ue(o))return o;return new Ei(o,a)}class Ei{constructor(o,a){this.dep=new En,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?o:le(o),this._value=a?o:De(o),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(o){let a=this._rawValue,d=this.__v_isShallow||qe(o)||He(o);if(o=d?o:le(o),Ie(o,a))this._rawValue=o,this._value=d?o:De(o),this.dep.trigger()}}class wi{constructor(o,a,d){this.fn=o,this.setter=a,this._value=void 0,this.dep=new En(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Jt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=d}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return li(this,!0),!0}get value(){let o=this.dep.track();if(di(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function jt(o,a,d=!1){let f,p;if(Qo(o))f=o;else f=o.get,p=o.set;return new wi(f,p,d)}function Tn(o){return o.replaceAll(/[A-Z]/g,(a)=>`-${a.toLowerCase()}`)}var vc=new Set(["all","print","screen","speech"]);function Ti(o,a){if(o.startsWith("@--"))return a[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let d=o.slice(2,-1).trim();return vc.has(d.toLowerCase())?d:o.slice(1)}return null}function Ht(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Vt(o){return o.startsWith("@keyframes")}function Ai(o,a){let d=[];for(let f of Rr(o))for(let p of Rr(a))d.push(Ec(f,p));return d.join(", ")}function Ec(o,a){let d=Ci(a,o);if(d!==null)return d;if(a.startsWith("[")||a.startsWith(":")||a.startsWith("."))return`${o}${a}`;return`${o} ${a}`}function $r(o){let a=[],d=null,f=0;for(let p=0;p<o.length;p+=1){let m=o[p];if(d){if(m==="\\")p+=1;else if(m===d)d=null;continue}if(m==="\\")p+=1;else if(m==='"'||m==="'")d=m;else if(m==="[")f+=1;else if(m==="]")f=Math.max(0,f-1);else if(m==="&"&&f===0)a.push(p)}return a}function Ci(o,a){return $r(o).length>0?wc(o,a):null}function wc(o,a){let d="",f=0;for(let p of $r(o))d+=o.slice(f,p)+a,f=p+1;return d+o.slice(f)}function Rr(o){let a=[],d=0,f=null,p=0;for(let g=0;g<o.length;g+=1){let h=o[g];if(f){if(h==="\\")g+=1;else if(h===f)f=null;continue}if(h==='"'||h==="'")f=h;else if(h==="("||h==="[")d+=1;else if(h===")"||h==="]")d=Math.max(0,d-1);else if(h===","&&d===0)a.push(o.slice(p,g)),p=g+1}a.push(o.slice(p));let m=a.flatMap((g)=>{let h=g.trim();return h===""?[]:[h]});return m.length>0?m:[o]}var Tc=/[\s>+~,()]/,Ac=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function Cc(o,a){let d="",f=0;for(;;){let p=o.indexOf("[open]",f);if(p===-1)return d+o.slice(f);let m=p;while(m>0&&!Tc.test(o.charAt(m-1)))m-=1;let g=Ac.exec(o.slice(m,p))?.[0]?.toLowerCase(),h=g===void 0?a.dialog===!0:g==="dialog";d+=o.slice(f,p)+(h?"[data-jx-dialog-open]":"[open]"),f=p+6}}function Or(o,a={}){if(o.includes("::backdrop"))return null;let d=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return Cc(d,a)}var Ge="data-color-scheme";function An(o){let a=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return a==="light"||a==="dark"?a:null}function Pi(o,a){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ge}]))`,forced:`${o}:where([${Ge}="${a}"])`};return{auto:`:where(:root:not([${Ge}])) ${o}`,forced:`:where(:root[${Ge}="${a}"]) ${o}`}}function Wt(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function Mr(o){return o.startsWith("--")?o:Tn(o)}function Ft(o){let a=2166136261;for(let d=0;d<o.length;d+=1)a^=o.charCodeAt(d),a=Math.imul(a,16777619);return(a>>>0).toString(36)}function Ni(o,a,d){let f=d.map(([m,g])=>`${m}: ${g}`).join("; "),p=a===null?f:`${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Pc(o,a,d){let f=d.map(({selector:m,declarations:g})=>`${m} { ${g.map(([h,y])=>`${h}: ${y}`).join("; ")} }`).join(" "),p=`@keyframes ${a} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Nc(o){let a=Object.keys(o).filter((f)=>Vt(f));if(a.length===0)return o;let d={...o};for(let f of a)delete d[f];return d}function Rc(o){let d=$r(o).at(-1),f=d===void 0?o:o.slice(d+1);return f===""||f.startsWith(":")||f.startsWith(".")||f.startsWith("[")}function Bt(o,a={}){let{scope:d=null,mediaQueries:f={},transposeValue:p=(L)=>L,transposeSelector:m=(L)=>L,resolveValue:g}=a,h=[],y=(L)=>L!==null&&typeof L==="object"&&!Array.isArray(L)&&!r(L),E=(L,_)=>{if(y(_))return[_];if(!Ht(L)||!Array.isArray(_)||_.length===0)return[];return _.every((Y)=>y(Y))?_:[]},A=(L,_,Y,q)=>{if(_===void 0||_===null)return null;if(r(_))return Y?g?.(L,_,q)??null:null;if(n(_))return null;let G=String(_);if(c(G))return Y?g?.(L,G,q)??null:null;return p(G)},T=(L,_,Y=!0,q="self")=>{let G=[];for(let[U,M]of Object.entries(L)){if(E(U,M).length>0)continue;if(_&&(U.startsWith("@")||Wt(U)))continue;if(U.startsWith("$"))continue;let B=A(U,M,Y,q);if(B!==null)G.push([Mr(U),B])}return G},C=(L,_,Y,q,G)=>{if(Y.length===0)return;let U=_;if(U!==null){let te=m(U);if(te===null)return;U=te}let M=Ni(L,U,Y),B={text:M,conditions:[...L],selector:U,declarations:Y,target:q,key:Ft(M)};if(e(G)&&G!=="")B.description=G;h.push(B)},H=(L,_,Y)=>{let q=L.slice(10).trim();if(q==="")return;let G=[];for(let[M,B]of Object.entries(_)){if(!y(B))continue;let te=T(B,!0,!1,"unscoped");if(te.length>0)G.push({declarations:te,selector:M.trim()})}if(G.length===0)return;let U=Pc(Y,q,G);h.push({blocks:G,conditions:[...Y],declarations:[],key:Ft(U),selector:null,target:"unscoped",text:U})},O=(L,_,Y,q,G)=>{if(L==="@--")return;if(Ht(L)){C([...q,L],null,T(_,!1,!0,"unscoped"),"unscoped",_.$description);return}if(Vt(L)){H(L,_,q);return}let U=Ti(L,f),M=U===null?L:`@media ${U}`,B=U===null?null:An(U);if(B!==null&&Y!==null){let{auto:te,forced:X}=Pi(Y,B);K(_,te,[...q,M],G),K(Nc(_),X,q,G);return}K(_,Y,[...q,M],G)};function K(L,_,Y,q){C(Y,_,T(L,!0,!0,q),q,L.$description);for(let[G,U]of Object.entries(L))for(let M of E(G,U))if(G.startsWith("@"))O(G,M,_,Y,q);else if(_!==null)K(M,Ai(_,G),Y,Rc(G)?q:"descendant")}return K(o,d,[],"self"),h}var Fe="en-US",Ri="UTC",$i=[{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."}],Oi=$i.map((o)=>o.path),Mi=Object.fromEntries($i.map((o)=>[o.path,o.params.indexOf("locale")]));function $c(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function kr(o){if(o==="")return[];return o.split("/").map((a)=>$c(a))}function he(o,a){let d=o;for(let f of kr(a))d=d?.[f];return d}function Jr(o){let a=o.$map;return n(a)?a:void 0}function Oc(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function _i(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var Di=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Li=new Set(["!","-"]),Ii=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Mc=new Set(["=","+=","-=","*=","/="]),kc=new Set(["push","pop","shift","unshift","splice"]),ji=new Set(["reduce","map","filter"]),Hi=new Set(["?:","switch"]),Fi=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"]),Jc=new Set([...Di,...Li,...Ii,...ji,...Hi,...Fi,"call"]),_c=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",...Oi]),Dc=new Map([["Intl/compare",(o,a,d,f)=>new Intl.Collator(d??Fe,f).compare(o,a)],["Intl/displayName",(o,a,d,f)=>new Intl.DisplayNames(d??Fe,{...f,type:a??"language"}).of(o)],["Intl/formatDate",(o,a,d)=>new Intl.DateTimeFormat(a??Fe,{timeZone:Ri,...d}).format(new Date(o))],["Intl/formatList",(o,a,d)=>new Intl.ListFormat(a??Fe,d).format(o)],["Intl/formatNumber",(o,a,d)=>new Intl.NumberFormat(a??Fe,d).format(o)],["Intl/formatRelativeTime",(o,a,d,f)=>new Intl.RelativeTimeFormat(d??Fe,f).format(o,a)],["Intl/plural",(o,a,d)=>new Intl.PluralRules(a??Fe,d).select(o)],["Intl/segment",(o,a,d)=>[...new Intl.Segmenter(d??Fe,{granularity:a??"grapheme"}).segment(o)].map((f)=>f.segment)]]);function Lc(o,a,d){let f=Mi[o];if(f===void 0||f<0||a[f]!=null)return a;let p=he(d.$page,"locale");if(!e(p)||p==="")return a;let m=[...a];return m[f]=p,m}function Ic(o){return o.startsWith("window#/")&&_c.has(o.slice(8))}function Vi(o){return Di.has(o)}var ki=64,jc=64;function pe(o,a){if(!o)return;let d=(o.depth??0)+1;if(d>jc)return;return{depth:d,path:[...o.path??[],...Array.isArray(a)?a:[a]],report:o.report}}function fe(o,a,d,f,p){if(o===null||o===void 0)return o;if(Oc(o))return Ae(o,a,d,f,p);if(_i(o)){let m=Cn(o.$ref,a,d,f);return p?.report(p.path??[],m),m}if(Array.isArray(o))return Wi(o,a,d,f,p);return p?.report(p.path??[],o),o}function Wi(o,a,d,f,p){return o.map((m,g)=>fe(m,a,d,f,pe(p,g)))}function Hc(o,a,d,f){let p=(m)=>{if(!o.slice(m.length).includes("/"))return a;return Cn(o.slice(0,o.lastIndexOf("/")),a,d,f)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?Cn(o.slice(0,o.lastIndexOf("/")),a,d,f):void 0;return}function Cn(o,a,d,f){if(o==="$reduce/acc")return f?.acc;if(o.startsWith("$reduce/"))return f?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=f?.args?.[p[0]];return p.length>1?he(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return he(d,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=Jr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];return p.length>2?he(g,p.slice(2).join("/")):g}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function Fc(o,a,d,f){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=Jr(a);if(m==="item")g=f?.item??h?.item??a["$map/item"];else if(m==="index")g=f?.index??h?.index??a["$map/index"];else g=h?.[m]??a[`$map/${m}`];if(p.length>2){let y=p.slice(2),E=y.pop(),A=y.length>0?he(g,y.join("/")):g;return{key:E,obj:A}}return{key:m==="item"?"$map/item":"$map/index",obj:Jr(a)??a}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:a};let g=kr(p),h=g.pop(),y=a;for(let E of g)y=y[E];return{key:h,obj:y}}return{key:o,obj:a}}function Ae(o,a,d,f,p){let m=Vc(o,a,d,f,p);return p?.report(p.path??[],m),m}function Ji(o,a,d){switch(o){case"+":return a+d;case"-":return a-d;case"*":return a*d;case"/":return a/d;case"%":return a%d;case"<":return a<d;case"<=":return a<=d;case">":return a>d;default:return a>=d}}function Vc(o,a,d,f,p){let{operator:m,target:g,value:h,initial:y}=o;if(!Jc.has(m))throw Error(`$expression: unknown operator "${m}"`);if(Li.has(m)&&!("value"in o)){let E=fe(g,a,d,f,pe(p,"target"));if(m==="!")return!E;if(m==="-")return-E}if(m==="call"){let E=_i(g)?g.$ref:void 0;if(!e(E))throw TypeError("$expression: call target must be a $ref pointer");let A=(f?.callDepth??0)+1;if(A>ki)throw Error(`$expression: call depth exceeded (${ki})`);let T=Array.isArray(h)?h.map((H,O)=>fe(H,a,d,f,pe(p,["value",O]))):[];if(E.startsWith("window#/")){if(!Ic(E))throw Error(`$expression: "${E}" is not a blessed pure global`);let H=E.slice(8),O=Dc.get(H);if(O)return O(...Lc(H,T,a));let K=he(globalThis.window,H),L=H.lastIndexOf("/"),_=L===-1?globalThis.window:he(globalThis.window,H.slice(0,L));return K.apply(_,T)}let C=Cn(E,a,d,f);if(t(C))return C.apply(Hc(E,a,d,f),T);if(n(C)&&"$expression"in C){let H=C,O={};for(let[K,L]of(H.parameters??[]).entries()){let _=e(L)?L:L?.name??"";if(!_)continue;O[_]=T[K]===void 0&&n(L)&&"default"in L?L.default:T[K]}return Ae(H.$expression,a,d,{args:O,callDepth:A})}throw TypeError(`$expression: call target "${E}" is not callable`)}if(Hi.has(m)){if(m==="?:"){let H=fe(g,a,d,f,pe(p,"target"));if(p){let O=fe(h,a,d,f,pe(p,"value")),K=fe(y,a,d,f,pe(p,"initial"));return H?O:K}return H?fe(h,a,d,f):fe(y,a,d,f)}let E=fe(g,a,d,f,pe(p,"target")),A=String(E),T=o.cases??{},C=Object.hasOwn(T,A);if(p){let H;for(let[K,L]of Object.entries(T)){let _=fe(L,a,d,f,pe(p,["cases",K]));if(K===A)H=_}let O=fe(o.default,a,d,f,pe(p,"default"));return C?H:O}return C?fe(T[A],a,d,f):fe(o.default,a,d,f)}if(Ii.has(m)){let E=fe(g,a,d,f,pe(p,"target")),A=fe(h,a,d,f,pe(p,"value"));switch(m){case"===":return E===A;case"!==":return E!==A;case"&&":return E&&A;case"||":return E||A;case"??":return E??A;default:return Ji(m,E,A)}}if(Mc.has(m)){let E=fe(h,a,d,f,pe(p,"value")),{obj:A,key:T}=Fc(g.$ref,a,d,f);A[T]=m==="="?E:Ji(m.slice(0,-1),A[T],E);return}if(kc.has(m)){let E=fe(g,a,d,f,pe(p,"target"));switch(m){case"push":return E.push(fe(h,a,d,f,pe(p,"value")));case"unshift":return E.unshift(fe(h,a,d,f,pe(p,"value")));case"pop":return E.pop();case"shift":return E.shift();case"splice":{let A=fe(h,a,d,f,pe(p,"value"));return E.splice(...A)}default:break}}if(Fi.has(m)){let E=fe(g,a,d,f,pe(p,"target")),A=h===void 0?[]:Array.isArray(h)?Wi(h,a,d,f,pe(p,"value")):[fe(h,a,d,f,pe(p,"value"))],T=he(E,m);if(!t(T))return;return T.apply(E,A)}if(ji.has(m)){let E=fe(g,a,d,f,pe(p,"target")),A=h;if(m==="reduce"){let T=fe(y,a,d,f,pe(p,"initial"));for(let[C,H]of E.entries())T=Ae(A,a,d,{acc:T,index:C,item:H},C===0?pe(p,"value"):void 0);return T}if(m==="map")return E.map((T,C)=>Ae(A,a,d,{...f,index:C,item:T},C===0?pe(p,"value"):void 0));if(m==="filter")return E.filter((T,C)=>Ae(A,a,d,{...f,index:C,item:T},C===0?pe(p,"value"):void 0))}return}function rt(o,a,d,f){return fe(o,a,d,f)}function Pn(o){let a=o.replaceAll("\\","/");return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function Bi(o){let a=Pn(o);return a.startsWith("/")?a:`/${a}`}function Ki(o,a){return[...o].toSorted((d,f)=>f[a].length-d[a].length)}function Wc(o,a){return o===a||o.startsWith(`${a}/`)}function Ui(o,a){let d=Pn(a);for(let f of Ki(o,"dir")){let p=Pn(f.dir);if(!Wc(d,p)||d===p)continue;let m=d.slice(p.length+1),{filter:g}=f;if(g&&!g(m))return null;let h=m.split("/").map((y)=>encodeURIComponent(y)).join("/");return`${Bi(f.urlPrefix)}/${h}`}return null}function Bc(o,a){let d=a.split("#")[0].split("?")[0];if(!d.startsWith("/"))return null;let f;try{f=decodeURIComponent(d)}catch{return null}if(/%2e|%2f/i.test(f))return null;for(let p of Ki(o,"urlPrefix")){let m=Bi(p.urlPrefix);if(!f.startsWith(`${m}/`))continue;let h=f.slice(m.length+1).split("/");if(h.some((E)=>E===""||E==="."||E===".."))return null;let{filter:y}=p;if(y&&!y(h.join("/")))return null;return`${Pn(p.dir)}/${h.join("/")}`}return null}var Ip=String.raw`"'\s<>()\\`;var Kc="public";function Kt(o){let a=o.search(/[#?]/);return a===-1?{path:o,suffix:""}:{path:o.slice(0,a),suffix:o.slice(a)}}function _r(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function Dr(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function Lr(o,a){let f=(o===""||o==="."?[]:Dr(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of a.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.join("/")}function Uc(o,a,d){let{path:f}=Kt(o);if(!f.startsWith("/"))return[];let p;try{p=decodeURIComponent(f)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((h)=>h==="."||h===".."))return[];let g=[];for(let h of d){if(h==="mounts"){let y=Bc(a,f);if(y!==null&&!y.startsWith("/")&&!/^[A-Za-z]:/.test(y))g.push(Dr(y));continue}g.push(h==="root"?m:`${Kc}/${m}`)}return[...new Set(g)]}function qi(o,a,d,f){let{path:p}=Kt(o);if(p==="")return null;if(_r(o))return p.startsWith("/")?Uc(p,d,f)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let g=Lr(a,m);if(g===null||g===""||g===Dr(a))return null;return g}function zi(o){return o.split("/").map((a)=>encodeURIComponent(a)).join("/")}function Gi(o){let a=[],d=0;while(d<o.length){while(d<o.length&&(/\s/.test(o[d])||o[d]===","))d+=1;if(d>=o.length)break;let f=d;while(d<o.length&&!/\s/.test(o[d]))d+=1;let p=o.slice(f,d);if(p.endsWith(",")){a.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(d<o.length&&/\s/.test(o[d]))d+=1;let m=d;while(d<o.length&&o[d]!==",")d+=1;let g=o.slice(m,d).trim();if(d+=1,p=p.replace(/,+$/,""),p!=="")a.push({descriptor:g,url:p})}return a}function Yi(o){return o.map(({url:a,descriptor:d})=>d?`${a} ${d}`:a).join(", ")}function qc(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function zc(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function ht(o,a,d,f={}){let p=f.args?{args:f.args}:void 0;for(let m of o){let g=qc(m);switch(g.kind){case"expression":{let h=Ae(g.node,a,d,p);if(zc(h))await h;break}case"if":{let h=g.node,y=rt(h.if,a,d,p)?h.then:h.else;if(Array.isArray(y))await ht(y,a,d,f);break}case"switch":{let h=g.node,y=String(rt(h.$switch,a,d,p)),E=h.cases??{},A=Object.hasOwn(E,y)?E[y]:h.default;if(Array.isArray(A))await ht(A,a,d,f);break}case"dispatch":{let h=g.node,y=t(f.target)?f.target():f.target,E=d?.currentTarget??y;if(!E)break;let A={};if("detail"in h)A.detail=rt(h.detail,a,d,p);if(h.bubbles!==void 0)A.bubbles=h.bubbles;if(h.composed!==void 0)A.composed=h.composed;E.dispatchEvent(new CustomEvent(h.dispatchEvent,A));break}case"stopPropagation":{d?.stopPropagation();break}case"preventDefault":{d?.preventDefault();break}default:break}}}function Xi(o,a){for(let d of o.split(";")){let f=d.indexOf("=");if(f===-1)continue;if(d.slice(0,f).trim()===a)return d.slice(f+1)}return null}function Zi(o,a,d){let f=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(a))}`];if(d.maxAge!==void 0)p.push(`Max-Age=${d.maxAge}`);let m=f?"/":d.path;if(m)p.push(`Path=${m}`);if(d.domain&&!f)p.push(`Domain=${d.domain}`);let{sameSite:g}=d;if(d.secure===!0||f||o.startsWith("__Secure-")||g?.toLowerCase()==="none")p.push("Secure");if(g)p.push(`SameSite=${g}`);return p.join("; ")}function Ir(o){return t(o)}var jr=new Map;function Gc(o){return o.headers?.get("Content-Type")??""}async function Ur(o,a){if(!e(o))return o;let d=a?.resolver?.(o);if(d)return d;if(jr.has(o))return jr.get(o);let f=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);if(Gc(p).includes("text/html"))throw Error(`Jx: ${o} 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 p.json()});return jr.set(o,f),f}var Yc=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),Ss={skip:!1};function vs(o){Ss.skip=o}var Es={skip:!1};function ws(o){Es.skip=o}var Fr=null;function Ts(o){Fr=o||null}function As(o){return Fr?`${o}?token=${encodeURIComponent(Fr)}`:o}function Cs(o){let a=mt(!0);return a.run(()=>{we(o)}),()=>a.stop()}function St(o){let a=mt(!0);try{return{result:a.run(o),stop:()=>a.stop()}}catch(d){throw a.stop(),d}}var Ps=!1;function Ns(o){Ps=o}var Xc=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Zc=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function Qc(o){if(!Ps||!o.includes("v"))return o;return o.replaceAll(Xc,(a,d,f)=>`${d}${Zc.get(f.toLowerCase())??`cq${f}`}`)}var Rs=!1;function $s(o){Rs=o}var qr=!1;function Os(o){qr=o}var zr=!1;function Ms(o){zr=o}var Rn=!1;function Vr(o){return Rn||o.dataset.jxPath!==void 0}function eu(o,a){if(Rs&&a==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(qr&&a==="popover"&&Vr(o))return"data-jx-popover";if(zr&&Vr(o)){if(a==="commandfor")return"data-jx-commandfor";if(a==="inert")return"data-jx-inert";if(a==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return a}var yt=null;function Dn(o){yt=o}var tu=new Set(["src","poster","data"]),nu=new Set(["srcset","imagesrcset"]),ru=new Set(["LINK"]);function ou(o,a){return tu.has(a)||a==="href"&&ru.has(o)}function Gr(o,a,d){if(!yt||d==="")return d;let f=a.toLowerCase();if(nu.has(f)){let p=Gi(d),m=p.map((h)=>{let y=yt?.(h.url,f)??null;if(y===null||y===h.url)return h;return{descriptor:h.descriptor,url:y}});return m.some((h,y)=>h!==p[y])?Yi(m):d}if(!ou(o,f))return d;return yt(d,f)??d}var iu=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function su(o){if(!yt||!o.includes("url("))return o;return o.replaceAll(iu,(a,d,f)=>{let p=f===""?null:yt?.(f,"url()")??null;return p===null?a:`url(${d}${p}${d})`})}function $n(o){return Qc(su(o))}var ks=!1;function Js(o){ks=o}var au=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function lu(o,a,d){if(!ks||o!=="textContent")return null;let f=null;if(r(a)){if(!a.$ref.startsWith("#/state/"))return null;let m=a.$ref.slice(8);f=m&&!m.includes("/")?m:null}else if(e(a))f=au.exec(a)?.[1]??null;if(!f)return null;let p=le(d)[f];if(Ue(p)||t(p))return null;if(n(p))return null;return f}async function Ln(o,a={},d=location.href,f){let p=()=>f?.root??null,m={},g=o.state??{},h=It(a);for(let T of Object.keys(a))if(h&&!(T in g))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>a[T],set:(C)=>{a[T]=C}});else m[T]=a[T];let y=o.imports??{};for(let[,T]of Object.entries(g))if(R(T)&&!T.$src){let C=y[T.$prototype];if(C){if(!C.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${C}"`);continue}T.$src=C}}for(let[T,C]of Object.entries(g)){if(e(C)){if(!C.includes("${"))m[T]=C;continue}if(i(C)||x(C)||C===null){m[T]=C;continue}if(Array.isArray(C)){m[T]=C;continue}if(n(C)){if(C.$prototype)continue;if(b(C))continue;if(D(C))continue;if("default"in C){m[T]=C.default;continue}if(cu(C))continue;m[T]=C}}let E=wn(m);for(let[T,C]of Object.entries(g))if(e(C)&&C.includes("${"))E[T]=jt(()=>Is(C,E));for(let[T,C]of Object.entries(g))if(b(C)){let H=C.$expression;if(j(C)){let O=C.parameters;E[T]=(...K)=>Ae(H,E,null,{args:Qi(O,K)})}else if(Vi(H.operator)){let O=(K,L)=>Ae(H,K,L);E[T]=O}else E[T]=jt(()=>Ae(H,E,null))}for(let[T,C]of Object.entries(g))if(k(C)){let{body:H}=C;if(Array.isArray(C.parameters)&&C.parameters.length>0){let O=C.parameters;E[T]=(...K)=>ht(H,E,null,{args:Qi(O,K),target:p})}else{let O=(K,L)=>{ht(H,K,L??null,{target:p})};E[T]=O}}else if(v(C))E[T]=await mu(C,E,T,d);for(let[T,C]of Object.entries(g))if(R(C))E[T]=await Ru(C,E,T,d,f);if(!(f?.skipServerFunctions??Ss.skip)){for(let[T,C]of Object.entries(g))if(D(C))E[T]=await Du(C,E,T,d)}let A=f?.media??Xs;if(o.$media)E.$media=o.$media;else if(!E.$media&&Object.keys(A).length>0)E.$media=A;return E}function Qi(o,a){let d={};for(let[f,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;d[m]=a[f]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:a[f]}return d}function cu(o){for(let a of Object.keys(o))if(Yc.has(a))return!0;return!1}var _s=["state","$map","item","index","$site","$page"];function Ds(o){let a=du(o);return[o,a,a?.item,a?.index,o.$site,o.$page]}function Ye(o,a){let d=es.get(o);if(!d)d=Function(..._s,`return \`${o}\``),Ls(es,o,d);return d(...Ds(a))}var es=new Map,ts=new Map,uu=4096;function Ls(o,a,d){if(o.size>=uu)o.clear();o.set(a,d)}var ns=new Set,rs=null;function In(o,a,d){we(()=>{try{a()}catch(f){if(rs)rs(f instanceof Error?f:Error(String(f)),o);else if(!ns.has(o))ns.add(o),console.warn(`jx: template ${JSON.stringify(o)} threw:`,f);d?.()}})}function du(o){return o.$map}function fu(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let a=0;for(let d=1;d<o.length;d+=1){let f=o[d];if(f==="{")a+=1;else if(f==="}"){if(a-=1,a===0)return d===o.length-1}}return!1}function Is(o,a){if(!fu(o))return Ye(o,a);let d=ts.get(o);if(!d)d=Function(..._s,`return (${o.slice(2,-1)})`),Ls(ts,o,d);return d(...Ds(a))}var js=null;function Hs(o){js=o}var os="npm:";async function pu(o,a){if(o.startsWith(os)){let d=o.slice(os.length);return gt(js?.(d)??d)}if(a)try{return await gt(new URL(o,a).href)}catch{return gt(o)}return gt(o)}function gt(o){return import(o)}var vt=new Map,xt=new Map,Fs=new Set;function Vs(o,a){if(Fs.add(o),t(a)){vt.delete(o),xt.set(o,a);return}xt.delete(o),vt.set(o,a)}function Yr(o){let a=vt.get(o);if(a)return a;let d=xt.get(o);if(!d)return;if(!t(d))return d;let f=d(),p=(async()=>{try{let m=await f;return vt.set(o,m),xt.delete(o),m}catch(m){throw xt.set(o,d),m}})();return xt.set(o,p),p}async function mu(o,a,d,f){if(o.body&&o.$src)throw Error(`Jx: '${d}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let h=Wr(o),y=Function(...h,"");return Object.defineProperty(y,"name",{configurable:!0,value:o.name??d}),y}let p;if(e(o.body)){let h=Wr(o);p=Function(...h,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??d})}else{let h=o.$src;if(!h)throw Error(`Jx: '${d}' has neither body nor $src`);let y=o.$export??d,E,A=Yr(h);if(A instanceof Promise)E=await A;else if(A)E=A;else E=await pu(h,f),vt.set(h,E);let T=E[y]??E.default?.[y];if(!t(T))throw TypeError(`Jx: export "${y}" not found or not a function in "${h}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,g=!1;if(!m)g=e(o.body)?I(o.body):p.length<=1&&I(p.toString());if(g)return jt(()=>p(a));return p}function Wr(o){let a=o.parameters?W(o.parameters):o.arguments??[];return a.length>0&&a[0]==="state"?a:["state",...a]}var Gt=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"]);function Xr(o){return Object.create(o)}function jn(o){return o.$media??{}}function Hn(o){return o}function hu(o){let a=Hn(o)._state;return n(a)?a:null}function gu(o){return t(o)}var is=new Set,xu="http://www.w3.org/2000/svg",yu="http://www.w3.org/1998/Math/MathML";function bu(o,a){if(o==="svg")return xu;if(o==="math")return yu;return a??null}function Oe(o,a,d){let f=d?._path??[];if(e(o)||i(o)||x(o)){let T=document.createTextNode(String(o));if(c(o))In(o,()=>{T.textContent=Ye(o,a)},()=>{T.textContent=""});return T}let p=a;for(let[T,C]of Object.entries(o))if(T.startsWith("$")&&!Gt.has(T)){if(p===a)p=Xr(a);p[T]=r(C)?Se(C.$ref,a):C}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!is.has(T))is.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=eo(o.tagName,p),g=m.includes("-")&&customElements.get(m);if(o.$props&&g)return gs(o,p,d,f);if(o.$props){if(m.includes("-"))return gs(o,p,d,f);let{$props:T,...C}=o;return Oe(C,Fu(o,p),d)}if(o.$switch)return Nu(o,p,d);let h=bu(m,d?._ns),y=m==="foreignObject"?null:h,E=h?document.createElementNS(h,m):document.createElement(m);if(d?.onNodeCreated)d.onNodeCreated(E,f,o,p);if(Zr(E,o,p),o.style&&m.includes("-"))Qr.set(E,o.style);Fn(E,o.style??{},jn(p),p),Wn(E,o.attributes??{},p);let A=o.children;if(S(A)){let T=d||y?{...d,_ns:y,_path:[...f,"children"]}:void 0;Br(E,A,p,T)}else if(Array.isArray(A))for(let T=0;T<A.length;T++){let C=A[T],H=d||y?{...d,_ns:y,_path:[...f,"children",T]}:void 0;if(S(C))Br(E,C,p,H);else E.append(Oe(C,p,H))}return E}function Zr(o,a,d){for(let[f,p]of Object.entries(a)){if(Gt.has(f))continue;if(f.startsWith("$"))continue;if(f.startsWith("on")&&Ws(o,f,p,d))continue;Bs(o,f,p,d)}}function Ws(o,a,d,f){let p=a.slice(2),m=f;if(r(d)){let g=Se(d.$ref,f);if(gu(g))o.addEventListener(p,(h)=>g(m,h));return!0}if(k(d)){let{body:g}=d;return o.addEventListener(p,(h)=>{ht(g,m,h)}),!0}if(v(d)&&e(d.body)){let g=Wr(d),h=Function(...g,d.body);return o.addEventListener(p,(y)=>h(m,y)),!0}if(b(d)){let g=d.$expression;return o.addEventListener(p,(h)=>Ae(g,m,h)),!0}return!1}function Su(o,a,d){for(let[f,p]of Object.entries(a))if(f.startsWith("on")&&!Gt.has(f))Ws(o,f,p,d)}function Bs(o,a,d,f){let p=Hn(o),m=lu(a,d,f);if(m)o.dataset.jxBoundProp=m;let g=(y)=>e(y)?Gr(o.tagName,a,y):y,h=(y)=>{let E=o;if(a==="className"&&!(E instanceof HTMLElement)){E.setAttribute("class",y==null?"":String(y));return}if(p[a]===y)return;p[a]=y};if(r(d)){let y=d;if(a==="id"){p[a]=Se(y.$ref,f);return}we(()=>{h(g(Se(y.$ref,f)))});return}if(c(d)){let y=d;In(y,()=>{h(g(Ye(y,f)))});return}h(g(d))}function ss(o,a){let d=[];return{detach:a,insert(f){let p=[];for(let g of f){let h=o.cssRules.length;try{o.insertRule(g,h)}catch{continue}let y=o.cssRules[h];if(y)p.push(y)}let m={rules:p,texts:f};return d.push(m),m},remove(f){let p=d.indexOf(f);if(p!==-1)d.splice(p,1);if(f.rules.length===0)return;let m=[...o.cssRules],g=f.rules.map((h)=>m.indexOf(h)).filter((h)=>h>=0).toSorted((h,y)=>y-h);for(let h of g)o.deleteRule(h);f.rules.length=0},replaceAll(f){d.length=0,d.push({rules:[],texts:f}),o.replaceSync(f.join(`
|
|
3
3
|
`))},text(){return d.flatMap((f)=>f.texts.join(`
|
|
4
4
|
`)).join(`
|
|
5
|
-
`)}}}function
|
|
5
|
+
`)}}}function vu(o){let a=[],d=()=>{o.textContent=a.map((f)=>f.texts.join(`
|
|
6
6
|
`)).join(`
|
|
7
|
-
`)};return{detach(){o.remove()},insert(f){let p={rules:[],texts:f};return a.push(p),d(),p},remove(f){let p=a.indexOf(f);if(p!==-1)a.splice(p,1),d()},replaceAll(f){a.length=0,a.push({rules:[],texts:f}),d()},text(){return o.textContent}}}function Ws(o){let d=o.defaultView?.CSSStyleSheet;if(t(d)&&Array.isArray(o.adoptedStyleSheets))try{let p=new d;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],os(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let f=o.createElement("style");return f.dataset.jxSheet="",(bu(o)??o.documentElement).append(f),f.sheet?os(f.sheet,()=>f.remove()):yu(f)}function bu(o){return o.head}var zt=new WeakMap;function Su(o){let a=zt.get(o);if(a)return a;let d={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:Ws(o)};return zt.set(o,d),d}var On=new WeakMap,is="\x01jx-scope\x01";function Bs(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function ss(o,a,d){let f=a.get(d);if(f.refs-=1,f.refs<=0)a.delete(d),o.shared.remove(f.inserted)}function as(o,a,d,f){let p=a.get(d);if(p){p.refs+=1;return}a.set(d,{inserted:o.shared.insert(f),refs:1})}function Mn(o,a){let d=On.get(o);if(!d||a!==void 0&&d!==a)return;On.delete(o),d.stop?.();for(let p of d.vars)o.style.removeProperty(p);if(delete o.dataset.jx,zt.get(d.doc)!==d.state)return;let{state:f}=d;if(d.interned===null){if(f.scratchOwners.delete(o))Bs(f)}else ss(f,f.interned,d.interned);for(let p of d.hoisted)ss(f,f.hoisted,p)}function Ks(o=document){let a=zt.get(o);if(!a)return;zt.delete(o);for(let d of a.scratchOwners.keys())On.delete(d),delete d.dataset.jx;a.scratchOwners.clear(),a.interned.clear(),a.hoisted.clear(),a.shared.detach(),a.scratch?.detach()}function Eu(o){return n(o)&&"display"in o}var Zr=new WeakMap;function Us(o,a){if(!a)return o;let d={...o};for(let[f,p]of Object.entries(a)){let m=d[f];d[f]=F(p)&&n(m)?Us(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return d}function Fn(o,a,d={},f={}){qs(o,a,d,f,!1)}function Vn(o,a,d={},f={}){qs(o,a??{},d,f,!0)}function qs(o,a,d,f,p){Mn(o);let m=o.ownerDocument,g=Su(m),h=(Ur||qr)&&Fr(o)?(_)=>$r(_,{dialog:o.tagName==="DIALOG"}):(_)=>_,y=-1,E=0,A=[],T=Bt(a,{mediaQueries:d,resolveValue:(_,Y,q)=>{if(q==="self"&&_.startsWith("--"))return A.push({name:_,value:Y}),null;let G;if(q==="self")G=`--jx-s${E}`;else{if(y<0)({serial:y}=g),g.serial+=1;G=`--jx-r${y}-${E}`}return E+=1,A.push({name:G,value:Y}),`var(${G})`},scope:is,transposeSelector:h,transposeValue:$n});if(T.length===0&&A.length===0)return;let C=T.filter((_)=>_.target!=="unscoped"),H=T.filter((_)=>_.target==="unscoped");for(let _ of H)as(g,g.hoisted,_.text,[_.text]);let O=`jx-${Ft(C.map((_)=>_.key).join("|"))}`,K=C.map((_)=>_.text.replaceAll(is,`[data-jx="${O}"]`));if(K.length>0)if(o.dataset.jx=O,p)g.scratch??=Ws(m),g.scratchOwners.set(o,K),Bs(g);else as(g,g.interned,O,K);let L={doc:m,hoisted:H.map((_)=>_.text),interned:K.length>0&&!p?O:null,state:g,stop:null,uid:O,vars:A.map((_)=>_.name)};if(A.length>0){let _=pt();_.run(()=>{for(let{name:Y,value:q}of A)we(()=>{let G=r(q)?Se(q.$ref,f):Ye(q,f);o.style.setProperty(Y,$n(String(G??"")))})}),L.stop=()=>_.stop()}On.set(o,L),Sn(()=>Mn(o,L),!0)}var vu=new Set(["contenteditable","draggable","spellcheck"]);function wu(o,a){let d=o.toLowerCase();if(d.startsWith("aria-")||vu.has(d))return String(a);return a?"":null}function Wn(o,a,d){for(let[f,p]of Object.entries(a)){let m=Xc(o,f),g=(h)=>{if(h===null||h===void 0){o.removeAttribute(m);return}if(x(h)){let y=wu(m,h);if(y===null)o.removeAttribute(m);else o.setAttribute(m,y);return}o.setAttribute(m,zr(o.tagName,f,String(h)))};if(r(p))we(()=>g(Se(p.$ref,d)));else if(c(p))In(p,()=>g(Js(p,d)));else g(p)}}function Wr(o,a,d,f){let p=f?._path??[],m=document.createComment("jx-array");o.append(m);let{items:g,map:h,filter:y,sort:E,key:A}=a,T=r(A)?A.$ref:null,C=yt,H=!1,O=(B)=>{if(!H)H=!0,console.warn(`Jx $map: ${B}`)},K=[],L=(B)=>{B.node.remove(),B.scope.stop()},_=(B,te,X)=>{let ce=Si({index:X,item:te}),ee=Yr(d);ee.$map=ce,Object.defineProperty(ee,"$map/item",{enumerable:!0,get:()=>ce.item}),Object.defineProperty(ee,"$map/index",{enumerable:!0,get:()=>ce.index});let re=pt(!0),Ee=f?{...f,_path:[...p,"map",X]}:void 0,V=re.run(()=>Oe(h,ee,Ee));return{key:B,map:ce,node:V,scope:re}},Y=(B,te)=>{let X=new Map;for(let re of K)X.set(re.key,re);let ce=[];for(let re=0;re<B.length;re++){let Ee=te[re],V=B[re],N=X.get(Ee);if(N){if(X.delete(Ee),N.map.item!==V)N.map.item=V;if(N.map.index!==re)N.map.index=re,f?.onNodeMoved?.(N.node,[...p,"map",re]);ce.push(N)}else ce.push(_(Ee,V,re))}for(let re of X.values())L(re);let ee=K.find((re)=>!X.has(re.key))?.node??m;for(let re of ce){if(re.node===ee){ee=ee.nextSibling??m;continue}ee.before(re.node)}K=ce},q=()=>{let B=r(g)?Se(g.$ref,d):g;if(Array.isArray(B)&&r(y)){let ee=Se(y.$ref,d);if(t(ee))B=B.filter(ee)}if(Array.isArray(B)&&r(E)){let ee=Se(E.$ref,d);if(t(ee)){let re=ee;B=[...B].toSorted(re)}}let te=Array.isArray(B)&&h?B:[],X=te.map((ee,re)=>Tu(T,ee,re,O)),ce=new Set;for(let ee=0;ee<X.length;ee++)if(ce.has(X[ee]))O(`duplicate key ${String(X[ee])} — every occurrence after the first is rebuilt on each change`),X[ee]={duplicate:ee};else ce.add(X[ee]);Jt();try{Dn(Br(C),()=>Y(te,X))}finally{Lt()}},G=!1,U=!1,M=we(q,{scheduler:()=>{if(G)return;G=!0,queueMicrotask(()=>{if(G=!1,!U)M()})}});Sn(()=>{U=!0;for(let B of K)L(B);K=[]},!0)}function Tu(o,a,d,f){if(o===null)return d;if(o==="$map/item")return a;if(o.startsWith("$map/item/")){let p=he(a,o.slice(10));if(p===void 0||p===null)return f(`key "${o}" is empty for some items — those rows fall back to their index`),d;return p}return f(`key "${o}" is not a $map/item pointer — rows fall back to their index`),d}function Qr(o,a){if(e(o))return o;if(!J(o))return"div";let d=o.$expression;if(d.operator==="?:")return rt(d.target,a,null)?d.value:d.initial;let f=rt(d.target,a,null);return d.cases[String(f)]??d.default}function Au(o,a,d){let f=d?._path??[],p=document.createElement(Qr(o.tagName,a)),m=yt;if(d?.onNodeCreated)d.onNodeCreated(p,f,o,a);Xr(p,o,a),Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a);let g=0,h=null,y=null,E=()=>{h?.stop(),h=null};return we(()=>{if(!r(o.$switch)){p.replaceChildren(),E(),g+=1;return}let A=String(Se(o.$switch.$ref,a));if(A===y)return;y=A,p.replaceChildren(),E(),g+=1;let T=o.cases?.[A];if(!T)return;let C=g,H=pt(!0);h=H;let O=d?{...d,_path:[...f,"cases",A]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,d?._ctx?.base??location.href);Kr(K,d?._ctx).then(async(L)=>{if(C!==g)return;let _=await Ln(L,{},K,d?._ctx);if(C!==g)return;p.replaceChildren(),Dn(Br(m),()=>H.run(()=>p.append(Oe(L,_,O))))}).catch((L)=>console.error("Jx $switch: failed to load external case",T.$ref,L));return}Jt();try{Dn(Br(m),()=>H.run(()=>p.append(Oe(T,a,O))))}finally{Lt()}}),Sn(E,!0),p}var kn=ze;async function Cu(o,a,d,f,p){if(o.$src)return Nu(o,a,d,f);switch(o.$prototype){case"Request":{let m=ze(null),g=o.debounce??0,h=null;if(!o.manual&&!(p?.skipAutoRequests??Ss.skip))we(()=>{let y;if(c(o.url))y=Ye(o.url,a);else({url:y}=o);if(!y||y==="undefined"||y.includes("undefined"))return;let E=new AbortController;En(()=>{if(E.abort(),h!==null)clearTimeout(h)});let A=()=>fetch(y,{method:o.method??"GET",signal:E.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}});if(g>0)h=setTimeout(A,g);else A()});return m}case"URLSearchParams":return jt(()=>{let m={};for(let[g,h]of Object.entries(o))if(g!=="$prototype")m[g]=r(h)?Se(h.$ref,a):c(h)?Ye(h,a):h;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,g=o.key??d,h;try{let E=m.getItem(g);h=E!==null?JSON.parse(E):o.default??null}catch{h=o.default??null}let y=kn(h);return we(()=>{let E=y.value;if(E===null)try{m.removeItem(g)}catch{}else try{m.setItem(g,JSON.stringify(E))}catch{}}),y}case"Cookie":{let m=o.name??d,h=kn((()=>{let y=Gi(document.cookie,m);if(y===null)return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}})()??o.default??null);return we(()=>{document.cookie=Yi(m,h.value,o)}),h}case"IndexedDB":{let m=ze(null),{database:g,store:h,version:y=1,keyPath:E="id",autoIncrement:A=!0,indexes:T=[]}=o;if(!g||!h)throw Error(`Jx: IndexedDB entry '${d}' requires database and store`);let C=indexedDB.open(g,y);return C.addEventListener("upgradeneeded",(H)=>{let O=H.target.result;if(!O.objectStoreNames.contains(h)){let K=O.createObjectStore(h,{autoIncrement:A,keyPath:E});for(let L of T)K.createIndex(L.name,L.keyPath,{unique:L.unique??!1})}}),C.addEventListener("success",(H)=>{let O=H.target.result;m.value={database:g,getStore:(K="readwrite")=>Promise.resolve(O.transaction(h,K).objectStore(h)),isReady:!0,store:h,version:y}}),C.addEventListener("error",()=>{m.value={error:C.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(s(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[g,h]of Object.entries(o.fields??{}))m.append(g,h);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${d}". Did you mean to add '$src'?`),ze(null)}}var Pu=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function eo(o){let a={};for(let[d,f]of Object.entries(o))if(!Pu.has(d))a[d]=f;return a}async function Nu(o,a,d,f){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return $u(o,a,d,f)}async function Ru(o,a,d,f){let p,m=Gr(a);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await ht(a)}catch{if(f){let A=new URL(a,f).href;p=await ht(A)}else throw Error(`Failed to import "${a}"`)}St.set(a,p)}let g=p[d]??p.default?.[d];if(!g)throw Error(`Jx: export "${d}" not found in "${a}"`);if(!t(g))throw TypeError(`Jx: "${d}" from "${a}" is not a class`);let h=new g(eo(o)),y=t(h.resolve)?await h.resolve():("value"in h)?h.value:h,E=kn(y);if(t(h.subscribe))h.subscribe((A)=>{E.value=A});return E}async function $u(o,a,d,f){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return Nn(o,a,d,f);try{let T=f?new URL(p,f).href:p,C=await fetch(T);if(!C.ok)throw Error(`HTTP ${C.status}`);m=await C.json()}catch{return Nn(o,a,d,f)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return Nn(o,a,d,f);let C=f?new URL(p,f).href:new URL(p,location.href).href,H=new URL(m.$implementation,C).href,O=o.$export??m.title??o.$prototype;try{return await Ru(o,H,O,f)}catch{return Nn(o,a,d,f)}}let y=new(Mu(m))(eo(o)),E=t(y.resolve)?await y.resolve():("value"in y)?y.value:y,A=kn(E);if(t(y.subscribe))y.subscribe((T)=>{A.value=T});return A}function Ou(o){return n(o)}function Mu(o){let a=o.$defs?.fields??{},d=o.$defs?.constructor,f=Ou(d)?d:void 0,p=o.$defs?.methods??{};class m{constructor(g={}){for(let[h,y]of Object.entries(a)){let E=y.identifier??h,A=y.access==="private"?`_${E}`:E;if(g[E]!==void 0)this[A]=g[E];else if(y.initializer!==void 0)this[A]=y.initializer;else if(y.default!==void 0)this[A]=structuredClone(y.default);else this[A]=null}if(f?.body){let h=Array.isArray(f.body)?f.body.join(`
|
|
7
|
+
`)};return{detach(){o.remove()},insert(f){let p={rules:[],texts:f};return a.push(p),d(),p},remove(f){let p=a.indexOf(f);if(p!==-1)a.splice(p,1),d()},replaceAll(f){a.length=0,a.push({rules:[],texts:f}),d()},text(){return o.textContent}}}function Ks(o){let d=o.defaultView?.CSSStyleSheet;if(t(d)&&Array.isArray(o.adoptedStyleSheets))try{let p=new d;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],ss(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let f=o.createElement("style");return f.dataset.jxSheet="",(Eu(o)??o.documentElement).append(f),f.sheet?ss(f.sheet,()=>f.remove()):vu(f)}function Eu(o){return o.head}var zt=new WeakMap;function wu(o){let a=zt.get(o);if(a)return a;let d={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:Ks(o)};return zt.set(o,d),d}var On=new WeakMap,as="\x01jx-scope\x01";function Us(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function ls(o,a,d){let f=a.get(d);if(f.refs-=1,f.refs<=0)a.delete(d),o.shared.remove(f.inserted)}function cs(o,a,d,f){let p=a.get(d);if(p){p.refs+=1;return}a.set(d,{inserted:o.shared.insert(f),refs:1})}function Mn(o,a){let d=On.get(o);if(!d||a!==void 0&&d!==a)return;On.delete(o),d.stop?.();for(let p of d.vars)o.style.removeProperty(p);if(delete o.dataset.jx,zt.get(d.doc)!==d.state)return;let{state:f}=d;if(d.interned===null){if(f.scratchOwners.delete(o))Us(f)}else ls(f,f.interned,d.interned);for(let p of d.hoisted)ls(f,f.hoisted,p)}function qs(o=document){let a=zt.get(o);if(!a)return;zt.delete(o);for(let d of a.scratchOwners.keys())On.delete(d),delete d.dataset.jx;a.scratchOwners.clear(),a.interned.clear(),a.hoisted.clear(),a.shared.detach(),a.scratch?.detach()}function Tu(o){return n(o)&&"display"in o}var Qr=new WeakMap;function zs(o,a){if(!a)return o;let d={...o};for(let[f,p]of Object.entries(a)){let m=d[f];d[f]=F(p)&&n(m)?zs(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return d}function Fn(o,a,d={},f={}){Gs(o,a,d,f,!1)}function Vn(o,a,d={},f={}){Gs(o,a??{},d,f,!0)}function Gs(o,a,d,f,p){Mn(o);let m=o.ownerDocument,g=wu(m),h=(qr||zr)&&Vr(o)?(_)=>Or(_,{dialog:o.tagName==="DIALOG"}):(_)=>_,y=-1,E=0,A=[],T=Bt(a,{mediaQueries:d,resolveValue:(_,Y,q)=>{if(q==="self"&&_.startsWith("--"))return A.push({name:_,value:Y}),null;let G;if(q==="self")G=`--jx-s${E}`;else{if(y<0)({serial:y}=g),g.serial+=1;G=`--jx-r${y}-${E}`}return E+=1,A.push({name:G,value:Y}),`var(${G})`},scope:as,transposeSelector:h,transposeValue:$n});if(T.length===0&&A.length===0)return;let C=T.filter((_)=>_.target!=="unscoped"),H=T.filter((_)=>_.target==="unscoped");for(let _ of H)cs(g,g.hoisted,_.text,[_.text]);let O=`jx-${Ft(C.map((_)=>_.key).join("|"))}`,K=C.map((_)=>_.text.replaceAll(as,`[data-jx="${O}"]`));if(K.length>0)if(o.dataset.jx=O,p)g.scratch??=Ks(m),g.scratchOwners.set(o,K),Us(g);else cs(g,g.interned,O,K);let L={doc:m,hoisted:H.map((_)=>_.text),interned:K.length>0&&!p?O:null,state:g,stop:null,uid:O,vars:A.map((_)=>_.name)};if(A.length>0){let _=mt();_.run(()=>{for(let{name:Y,value:q}of A)we(()=>{let G=r(q)?Se(q.$ref,f):Ye(q,f);o.style.setProperty(Y,$n(String(G??"")))})}),L.stop=()=>_.stop()}On.set(o,L),Sn(()=>Mn(o,L),!0)}var Au=new Set(["contenteditable","draggable","spellcheck"]);function Cu(o,a){let d=o.toLowerCase();if(d.startsWith("aria-")||Au.has(d))return String(a);return a?"":null}function Wn(o,a,d){for(let[f,p]of Object.entries(a)){let m=eu(o,f),g=(h)=>{if(h===null||h===void 0){o.removeAttribute(m);return}if(x(h)){let y=Cu(m,h);if(y===null)o.removeAttribute(m);else o.setAttribute(m,y);return}o.setAttribute(m,Gr(o.tagName,f,String(h)))};if(r(p))we(()=>g(Se(p.$ref,d)));else if(c(p))In(p,()=>g(Is(p,d)));else g(p)}}function Br(o,a,d,f){let p=f?._path??[],m=document.createComment("jx-array");o.append(m);let{items:g,map:h,filter:y,sort:E,key:A}=a,T=r(A)?A.$ref:null,C=bt,H=!1,O=(B)=>{if(!H)H=!0,console.warn(`Jx $map: ${B}`)},K=[],L=(B)=>{B.node.remove(),B.scope.stop()},_=(B,te,X)=>{let ce=vi({index:X,item:te}),ee=Xr(d);ee.$map=ce,Object.defineProperty(ee,"$map/item",{enumerable:!0,get:()=>ce.item}),Object.defineProperty(ee,"$map/index",{enumerable:!0,get:()=>ce.index});let re=mt(!0),ve=f?{...f,_path:[...p,"map",X]}:void 0,V=re.run(()=>Oe(h,ee,ve));return{key:B,map:ce,node:V,scope:re}},Y=(B,te)=>{let X=new Map;for(let re of K)X.set(re.key,re);let ce=[];for(let re=0;re<B.length;re++){let ve=te[re],V=B[re],N=X.get(ve);if(N){if(X.delete(ve),N.map.item!==V)N.map.item=V;if(N.map.index!==re)N.map.index=re,f?.onNodeMoved?.(N.node,[...p,"map",re]);ce.push(N)}else ce.push(_(ve,V,re))}for(let re of X.values())L(re);let ee=K.find((re)=>!X.has(re.key))?.node??m;for(let re of ce){if(re.node===ee){ee=ee.nextSibling??m;continue}ee.before(re.node)}K=ce},q=()=>{let B=r(g)?Se(g.$ref,d):g;if(Array.isArray(B)&&r(y)){let ee=Se(y.$ref,d);if(t(ee))B=B.filter(ee)}if(Array.isArray(B)&&r(E)){let ee=Se(E.$ref,d);if(t(ee)){let re=ee;B=[...B].toSorted(re)}}let te=Array.isArray(B)&&h?B:[],X=te.map((ee,re)=>Pu(T,ee,re,O)),ce=new Set;for(let ee=0;ee<X.length;ee++)if(ce.has(X[ee]))O(`duplicate key ${String(X[ee])} — every occurrence after the first is rebuilt on each change`),X[ee]={duplicate:ee};else ce.add(X[ee]);Dt();try{_n(Kr(C),()=>Y(te,X))}finally{Lt()}},G=!1,U=!1,M=we(q,{scheduler:()=>{if(G)return;G=!0,queueMicrotask(()=>{if(G=!1,!U)M()})}});Sn(()=>{U=!0;for(let B of K)L(B);K=[]},!0)}function Pu(o,a,d,f){if(o===null)return d;if(o==="$map/item")return a;if(o.startsWith("$map/item/")){let p=he(a,o.slice(10));if(p===void 0||p===null)return f(`key "${o}" is empty for some items — those rows fall back to their index`),d;return p}return f(`key "${o}" is not a $map/item pointer — rows fall back to their index`),d}function eo(o,a){if(e(o))return o;if(!J(o))return"div";let d=o.$expression;if(d.operator==="?:")return rt(d.target,a,null)?d.value:d.initial;let f=rt(d.target,a,null);return d.cases[String(f)]??d.default}function Nu(o,a,d){let f=d?._path??[],p=document.createElement(eo(o.tagName,a)),m=bt;if(d?.onNodeCreated)d.onNodeCreated(p,f,o,a);Zr(p,o,a),Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a);let g=0,h=null,y=null,E=()=>{h?.stop(),h=null};return we(()=>{if(!r(o.$switch)){p.replaceChildren(),E(),g+=1;return}let A=String(Se(o.$switch.$ref,a));if(A===y)return;y=A,p.replaceChildren(),E(),g+=1;let T=o.cases?.[A];if(!T)return;let C=g,H=mt(!0);h=H;let O=d?{...d,_path:[...f,"cases",A]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,d?._ctx?.base??location.href);Ur(K,d?._ctx).then(async(L)=>{if(C!==g)return;let _=await Ln(L,{},K,d?._ctx);if(C!==g)return;p.replaceChildren(),_n(Kr(m),()=>H.run(()=>p.append(Oe(L,_,O))))}).catch((L)=>console.error("Jx $switch: failed to load external case",T.$ref,L));return}Dt();try{_n(Kr(m),()=>H.run(()=>p.append(Oe(T,a,O))))}finally{Lt()}}),Sn(E,!0),p}var kn=ze;async function Ru(o,a,d,f,p){if(o.$src)return Ou(o,a,d,f);switch(o.$prototype){case"Request":{let m=ze(null),g=o.debounce??0,h=null;if(!o.manual&&!(p?.skipAutoRequests??Es.skip))we(()=>{let y;if(c(o.url))y=Ye(o.url,a);else({url:y}=o);if(!y||y==="undefined"||y.includes("undefined"))return;let E=new AbortController;vn(()=>{if(E.abort(),h!==null)clearTimeout(h)});let A=()=>fetch(y,{method:o.method??"GET",signal:E.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}});if(g>0)h=setTimeout(A,g);else A()});return m}case"URLSearchParams":return jt(()=>{let m={};for(let[g,h]of Object.entries(o))if(g!=="$prototype")m[g]=r(h)?Se(h.$ref,a):c(h)?Ye(h,a):h;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,g=o.key??d,h;try{let E=m.getItem(g);h=E!==null?JSON.parse(E):o.default??null}catch{h=o.default??null}let y=kn(h);return we(()=>{let E=y.value;if(E===null)try{m.removeItem(g)}catch{}else try{m.setItem(g,JSON.stringify(E))}catch{}}),y}case"Cookie":{let m=o.name??d,h=kn((()=>{let y=Xi(document.cookie,m);if(y===null)return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}})()??o.default??null);return we(()=>{document.cookie=Zi(m,h.value,o)}),h}case"IndexedDB":{let m=ze(null),{database:g,store:h,version:y=1,keyPath:E="id",autoIncrement:A=!0,indexes:T=[]}=o;if(!g||!h)throw Error(`Jx: IndexedDB entry '${d}' requires database and store`);let C=indexedDB.open(g,y);return C.addEventListener("upgradeneeded",(H)=>{let O=H.target.result;if(!O.objectStoreNames.contains(h)){let K=O.createObjectStore(h,{autoIncrement:A,keyPath:E});for(let L of T)K.createIndex(L.name,L.keyPath,{unique:L.unique??!1})}}),C.addEventListener("success",(H)=>{let O=H.target.result;m.value={database:g,getStore:(K="readwrite")=>Promise.resolve(O.transaction(h,K).objectStore(h)),isReady:!0,store:h,version:y}}),C.addEventListener("error",()=>{m.value={error:C.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(s(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[g,h]of Object.entries(o.fields??{}))m.append(g,h);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${d}". Did you mean to add '$src'?`),ze(null)}}var $u=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function to(o){let a={};for(let[d,f]of Object.entries(o))if(!$u.has(d))a[d]=f;return a}async function Ou(o,a,d,f){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return ku(o,a,d,f)}async function Mu(o,a,d,f){let p,m=Yr(a);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await gt(a)}catch{if(f){let A=new URL(a,f).href;p=await gt(A)}else throw Error(`Failed to import "${a}"`)}vt.set(a,p)}let g=p[d]??p.default?.[d];if(!g)throw Error(`Jx: export "${d}" not found in "${a}"`);if(!t(g))throw TypeError(`Jx: "${d}" from "${a}" is not a class`);let h=new g(to(o)),y=t(h.resolve)?await h.resolve():("value"in h)?h.value:h,E=kn(y);if(t(h.subscribe))h.subscribe((A)=>{E.value=A});return E}async function ku(o,a,d,f){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return Nn(o,a,d,f);try{let T=f?new URL(p,f).href:p,C=await fetch(T);if(!C.ok)throw Error(`HTTP ${C.status}`);m=await C.json()}catch{return Nn(o,a,d,f)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return Nn(o,a,d,f);let C=f?new URL(p,f).href:new URL(p,location.href).href,H=new URL(m.$implementation,C).href,O=o.$export??m.title??o.$prototype;try{return await Mu(o,H,O,f)}catch{return Nn(o,a,d,f)}}let y=new(_u(m))(to(o)),E=t(y.resolve)?await y.resolve():("value"in y)?y.value:y,A=kn(E);if(t(y.subscribe))y.subscribe((T)=>{A.value=T});return A}function Ju(o){return n(o)}function _u(o){let a=o.$defs?.fields??{},d=o.$defs?.constructor,f=Ju(d)?d:void 0,p=o.$defs?.methods??{};class m{constructor(g={}){for(let[h,y]of Object.entries(a)){let E=y.identifier??h,A=y.access==="private"?`_${E}`:E;if(g[E]!==void 0)this[A]=g[E];else if(y.initializer!==void 0)this[A]=y.initializer;else if(y.default!==void 0)this[A]=structuredClone(y.default);else this[A]=null}if(f?.body){let h=Array.isArray(f.body)?f.body.join(`
|
|
8
8
|
`):f.body;Function("config",h).call(this,g)}}}for(let[g,h]of Object.entries(p)){let y=h.identifier??g,E=(h.parameters??[]).map((T)=>{if(T.$ref)return T.$ref.split("/").pop()??"";let C=T.identifier??T.name;return e(C)?C:"arg"}),A=Array.isArray(h.body)?h.body.join(`
|
|
9
|
-
`):h.body??"";if(h.role==="accessor"){let T={};if(h.getter)T.get=Function(h.getter.body??"");if(h.setter){let C=(h.setter.parameters??[]).map((H)=>H.$ref?.split("/").pop()??"v");T.set=Function(...C,h.setter.body??"")}Object.defineProperty(m.prototype,y,{...T,configurable:!0})}else if(h.scope==="static")m[y]=Function(...E,A);else m.prototype[y]=Function(...E,A)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function Nn(o,a,d,f){let p=eo(o),m=Object.values(p).some((y)=>c(y)),g=(y)=>fetch(ws("/__jx_resolve__"),{body:JSON.stringify({$base:f,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...y}),headers:{"Content-Type":"application/json"},method:"POST"}).then((E)=>{if(!E.ok)throw Error(`Jx dev proxy ${E.status} for "${d}"`);return E.json()}),h=ze(null);if(m)we(()=>{let y={};for(let[E,A]of Object.entries(p))y[E]=c(A)?Ye(A,a):A;g(y).then((E)=>{h.value=E}).catch((E)=>console.error("Jx dev proxy:",E))});else g(p).then((y)=>{h.value=y}).catch((y)=>console.error("Jx dev proxy:",y));return h}function zs(o,a,d){let f=0;return(p)=>{f+=1;let m=f;new Promise((g)=>{g(a(p))}).then((g)=>{if(m===f)o.value=g}).catch((g)=>{if(m===f)console.error(d,g)})}}async function ku(o,a,d,f){let{$src:p,$export:m}=o,g=js.has(p)?Gr(p):void 0;if(!g)return _u(o,a,d,f);let h=g instanceof Promise?await g:g,y=h[m]??h.default?.[m];if(!y)throw Error(`Jx: export "${m}" not found in "${p}" for "${d}"`);if(!t(y))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let E=y,A=o.arguments??{},T=Object.values(A).some((O)=>r(O)),C=()=>{let O={};for(let[K,L]of Object.entries(A))O[K]=r(L)?Se(L.$ref,a):L;return O},H=ze(null);if(T){let O=zs(H,E,"Jx server function:");we(()=>{let K=C();En(()=>{}),O(K)})}else H.value=await E(C());return H}async function _u(o,a,d,f){let p=o.arguments??{},m=Object.values(p).some((A)=>r(A)),g=()=>{let A={};for(let[T,C]of Object.entries(p))A[T]=r(C)?Se(C.$ref,a):C;return A},h=(A)=>fetch(ws("/__jx_server__"),{body:JSON.stringify({$base:f,$export:o.$export,$src:o.$src,arguments:A}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${d}"`);return T.json()}),y=ze(null),E=zs(y,h,"Jx server proxy:");if(m)we(()=>{let A=g();En(()=>{}),E(A)});else E(g());return y}function Se(o,a){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let d=(o.startsWith("#/")?o.slice(2):o).split("/"),[,f]=d,m=a.$map?.[f]??a[`$map/${f}`];return d.length>2?he(m,d.slice(2).join("/")):m}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function ls(o,a,d,f){let p=a.replaceAll(/-([a-z])/g,(g,h)=>h.toUpperCase()),m=o[p];if(x(m)){o[p]=d!==null&&d!=="false";return}if(d===null){let g=f?.get(p);o[p]=g===void 0?i(m)?0:"":g;return}o[p]=i(m)?Number(d):d}function cs(o){let a=new Map;for(let[d,f]of Object.entries(o.state??{})){if(n(f)){if("default"in f){a.set(d,f.default);continue}if(Du.some((p)=>(p in f)))continue}a.set(d,f)}return a}var Du=["$expression","$prototype","$ref","$src"],us=new Set;function Ju(o,a){if(Object.hasOwn(o,a))return!0;if(o.hasAttribute(a))return!0;let d=a.replaceAll(/[A-Z]/gu,(f)=>`-${f.toLowerCase()}`);return d!==a&&o.hasAttribute(d)}function Lu(o,a){for(let d=Reflect.getPrototypeOf(o);d;d=Reflect.getPrototypeOf(d)){let f=Object.getOwnPropertyDescriptor(d,a);if(f)return f.set}return}function _n(o,a){if(!w(o))return!1;let d=a===void 0?o:`${a}:${o}`;if(!us.has(d))us.add(d),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${a===void 0?"":` (${a})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function Iu(o,a){let d=Yr(a);for(let[f,p]of Object.entries(o.$props??{})){if(_n(f,"$props"))continue;d[f]=r(p)?Se(p.$ref,a):p}return d}var Gs={},qt=new Map;async function Ys(o,a){let d=a??location.href,{tagName:f}=o;if(!f||!f.includes("-"))throw Error(`Jx redefineElement: tagName "${f}" must contain a hyphen`);if(!customElements.get(f)){await Yt(o,d);return}if(o.$elements)await to(o.$elements,d);let p=qt.get(f)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${f}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);qt.set(f,{base:d,doc:o})}function Xs(o){Gs=o??{}}async function to(o,a,d){for(let f of o){if(e(f)){try{await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`)}catch(g){console.warn(`Jx: failed to import package "${f}"`,g)}continue}if(!r(f))continue;let{href:p}=new URL(f.$ref,a),m=await Kr(p,d);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await to(m.$elements,p,d);await Yt(m,p)}}var ds=32,ju={expansion:0,frames:[]},yt=ju;function jr(o,a,d){if(!o.isConnected)return;console.error(`Jx: <${a}> was not rendered:`,d),o.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:d,message:d.message}))}function Dn(o,a){let d=yt;yt=o;try{return a()}finally{yt=d}}function Br(o){return{expansion:o.frames.length,frames:o.frames}}function Hu(o,a){if(Object.is(o,a))return!0;if(!fs(o)||!fs(a))return!1;try{return JSON.stringify(o)===JSON.stringify(a)}catch{return!1}}function fs(o){if(!n(o))return!1;let a=le(o);if(Array.isArray(a))return!0;let d=Object.getPrototypeOf(a);return d===Object.prototype||d===null}function Fu(o,a){if(o.tag!==a.tag)return!1;let d=Object.keys(o.props);if(d.length!==Object.keys(a.props).length)return!1;return d.every((f)=>Object.hasOwn(a.props,f)&&Hu(o.props[f],a.props[f]))}function Vu(o,a){let d=[...o.frames.map((f)=>f.tag),a.tag].join(" → ");if(o.frames.slice(o.expansion).some((f)=>Fu(f,a)))throw Error(`Component <${a.tag}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=ds)throw Error(`Component nesting exceeds ${ds} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,a]}}var ps=new Set;async function Yt(o,a){let d=a,f;if(e(o)){if(d=new URL(o,d??location.href).href,ps.has(d))return;ps.add(d),f=await Kr(o)}else f=o;d??=location.href;let{tagName:p}=f;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(f.$elements)await to(f.$elements,d);qt.set(p,{base:d,doc:f});let m=f,g=d,h=m.observedAttributes??[],y=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return h}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let E=yt,A={},T=qt.get(p)??{base:g,doc:m},{doc:C,base:H}=T,O=await Ln(C,{},H,{base:H,media:null,root:this});for(let N of h)if(this.hasAttribute(N))ls(O,N,this.getAttribute(N)),A[N]=this.getAttribute(N);let K=this.dataset.jxProps;if(K){try{let N=JSON.parse(K),z=n(N)||e(N)?Object.entries(N):[];for(let[Q,de]of z){if(_n(Q,"data-jx-props"))continue;if(Q in(C.state??{}))O[Q]=de,A[Q]=de}}catch{}delete this.dataset.jxProps}let L=this.getAttributeNames().filter((N)=>N.startsWith("props.")&&N.length>6);for(let N of L){let z=N.slice(6);if(_n(z,"props.* attribute")){this.removeAttribute(N);continue}if(z in(C.state??{}))O[z]=this.getAttribute(N),A[z]=this.getAttribute(N),this.removeAttribute(N)}for(let N of Object.keys(C.state??{})){if(w(N))continue;let z=Hn(this);if(N in this&&z[N]!==void 0&&Ju(this,N))O[N]=z[N],A[N]=z[N]}let _;try{_=Vu(E,{props:A,tag:p})}catch(N){this.replaceChildren(),jr(this,p,N instanceof Error?N:Error(String(N)));return}for(let N of Object.keys(C.state??{})){if(w(N))continue;let z=Lu(this,N);Object.defineProperty(this,N,{configurable:!0,get:()=>O[N],set:(Q)=>{z?.call(this,Q),O[N]=Q}})}this._state=O;let Y=Ku(this);this.replaceChildren();let q=C.style,G=q&&Eu(q)?q:{display:"block",...q},U=Us(G,Zr.get(this));if(Fn(this,U,jn(O),O),Wn(this,C.attributes??{},O),xu(this,C,O),!Array.isArray(C.children)&&C.textContent!==void 0)Vs(this,"textContent",C.textContent,O);let M=Array.isArray(C.children)?C.children:[],B=()=>{let N=Rn;Rn||=this.dataset.jxPath!==void 0;let z=null;try{Dn(_,()=>{for(let Q of M)this.append(Oe(Q,O))})}catch(Q){z=Q instanceof Error?Q:Error(String(Q))}finally{Rn=N}return qu(this,Y),z},te=()=>{let{onMount:N}=O;if(Lr(N))queueMicrotask(()=>N.call(this,O,this))},X=bt(B),ce=X.result;if(!ce){te();return}jr(this,p,ce);let ee=[...cs(C).keys()].filter((N)=>!w(N)),re=ce.message,Ee=!1,V=we(()=>{for(let N of ee)O[N]},{scheduler:()=>{if(Ee)return;Ee=!0,queueMicrotask(()=>{if(Ee=!1,!this.isConnected){V.effect.stop();return}V(),X.stop(),this.replaceChildren(),Jt();try{X=bt(B)}finally{Lt()}let N=X.result;if(!N)V.effect.stop(),te();else if(N.message!==re)re=N.message,jr(this,p,N)})}})}disconnectedCallback(){let E=this._state;if(E&&Lr(E.onUnmount))E.onUnmount(E)}adoptedCallback(){let E=this._state;if(E&&Lr(E.onAdopted))E.onAdopted(E)}attributeChangedCallback(E,A,T){if(!this._state||A===T)return;ls(this._state,E,T,cs(qt.get(p)?.doc??m))}};customElements.define(p,y)}function ms(o,a,d,f){let p=document.createElement(Qr(o.tagName,a));if(d?.onNodeCreated)d.onNodeCreated(p,f??[],o,a);for(let[g,h]of Object.entries(o.$props??{})){if(_n(g,"$props"))continue;let y=(E)=>{let A=e(E)?zr(p.tagName,g,E):E;Hn(p)[g]=A;let T=fu(p);if(T&&g in HTMLElement.prototype&&Object.hasOwn(le(T),g))T[g]=A};if(r(h)){let E=h;y(Se(E.$ref,a)),we(()=>{y(Se(E.$ref,a))})}else if(c(h))In(h,()=>{y(Ye(h,a))});else y(h)}if(o.style)Zr.set(p,o.style);Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a),Xr(p,o,a);let m=Array.isArray(o.children)?o.children:[];for(let g=0;g<m.length;g++){let h=m[g],y=d&&f?{...d,_path:[...f,"children",g]}:void 0;if(S(h))Wr(p,h,a,y);else p.append(Oe(h,a,y))}return p}function Zs(o){return o.nodeType===Node.ELEMENT_NODE}function Qs(o){return o.nodeType===Node.TEXT_NODE}function hs(o){return o.nodeType===Node.COMMENT_NODE}var Wu=/^[\t\n\f\r ]+$/u,gs="jx-slot",xs="data-jx-slots",Bu="jx.slot.group",Ut=(()=>{let o=Symbol.for(Bu),a=globalThis;return a[o]??=new WeakMap,a[o]})();function Ku(o){let a=o.getAttribute(xs);if(a===null)return[...o.childNodes];o.removeAttribute(xs);let d=`${gs} ${a} `,f=`/${gs} ${a}`,p=[],m=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_COMMENT);for(let h=m.nextNode();h;h=m.nextNode())if(hs(h)&&h.data.startsWith(d))p.push(h);let g=[];for(let h of p){let y=decodeURIComponent(h.data.slice(d.length));for(let E=h.nextSibling;E;E=E.nextSibling){if(hs(E)&&E.data===f)break;Ut.set(E,y),g.push(E)}}return g}function Uu(o){return o.some((a)=>Zs(a)||Qs(a)&&a.data!=="")}function qu(o,a){let d=[...o.querySelectorAll("slot")];if(d.length===0)return;let f=new Map;for(let m of a){if(Qs(m)&&Wu.test(m.data))continue;let g=Ut.get(m);Ut.delete(m);let h=g??(Zs(m)?m.getAttribute("slot")??"":""),y=f.get(h);if(!y)y=[],f.set(h,y);y.push(m)}let p=new Set;for(let m of d){let g=m.getAttribute("name")??"",h=[];if(!p.has(g))p.add(g),h=f.get(g)??[];let y=Uu(h)?h:[...h,...m.childNodes],E=m.parentElement;if(E&&E!==o&&E.localName.includes("-")){let A=Ut.get(m)??m.getAttribute("slot")??"";for(let T of y)Ut.set(T,A)}m.replaceWith(...y)}}function Gu(o,a){if(!e(a)||a==="")return o;let d=o.indexOf("#"),f=d===-1?"":o.slice(d),p=d===-1?o:o.slice(0,d),m=p.indexOf("?"),g=m===-1?p:p.slice(0,m),y=(m===-1?[]:p.slice(m+1).split("&")).filter((E)=>E!==""&&!Yu(E));return y.push(`v=${encodeURIComponent(a)}`),`${g}?${y.join("&")}${f}`}function Yu(o){let a=o.indexOf("="),d=a===-1?o:o.slice(0,a);if(d==="v")return!0;if(!d.includes("%"))return!1;try{return decodeURIComponent(d)==="v"}catch{return!1}}function Xu(o,a){if(!o||!Object.hasOwn(o,a))return;let d=o[a];return e(d)?d:void 0}function Xt(o,a){if(!a||o==="")return null;if(a.space==="repo"){if(!a.fileBaseUrl)return null;let f=Ki(o,a.documentDir,a.mounts,a.lanes);if(f===null)return null;let{suffix:p}=Kt(o);return Gu(`${a.fileBaseUrl}${Ui(f)}${p}`,Xu(a.versions,f))}let[d]=a.mounts;return d?Zu(o,a.documentDir,d):null}function Zu(o,a,d){if(_r(o))return null;let{path:f,suffix:p}=Kt(o),m;try{m=decodeURIComponent(f)}catch{return null}let g=Jr(a,m);if(g===null)return null;let h=Bi([d],g);if(!h)return null;return`${h}${p}`}var ea=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180" viewBox="0 0 320 180"><rect width="320" height="180" fill="#808080" fill-opacity="0.16"/><g fill="#808080" fill-opacity="0.38"><circle cx="118" cy="64" r="14"/><path d="M60 140l52-50 34 30 38-46 76 66z"/></g></svg>')}`;function Qu(o){let a=o.getAttribute("src")?.trim()??"",d=o.getAttribute("srcset")?.trim()??"";if(a!==""||d!=="")return!1;return!(o.parentElement?.localName==="picture"?o.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function no(o){if(Qu(o))o.setAttribute("data-jx-image-placeholder",""),o.setAttribute("src",ea);else if(o.hasAttribute("data-jx-image-placeholder")&&o.getAttribute("src")!==ea)o.removeAttribute("data-jx-image-placeholder")}function na(o){return o.localName==="img"}function ta(o){if(o.nodeType!==o.ELEMENT_NODE||!("querySelectorAll"in o))return[];let a=o,d=[...a.querySelectorAll("img")];return na(a)?[a,...d]:d}function ra(o){for(let f of ta(o))no(f);let d=new(o.ownerDocument.defaultView?.MutationObserver??MutationObserver)((f)=>{for(let p of f){if(p.type==="attributes"){let{target:m}=p;if(m.nodeType===m.ELEMENT_NODE&&"localName"in m){let g=m;if(na(g))no(g)}continue}for(let m of p.addedNodes)for(let g of ta(m))no(g)}});return d.observe(o,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>d.disconnect()}function ot(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function ed(o,a){if(!a)return!1;return o.length<=a.length&&o.every((d,f)=>a[f]===d)}function oa(o,a,d){let f=d.layoutWrapped&&n(a)?a.$__layout:void 0;if(f){let m=s(f)?f:{},{file:g,path:h}=m;return{chrome:o.length>0&&!ed(o,d.pageContentPrefix),kind:"layout",layoutFile:e(g)?g:"",layoutPath:Array.isArray(h)?h:[]}}let p=o;if(d.layoutWrapped&&d.pageContentPrefix){let m=d.pageContentPrefix;if(o.length>=m.length&&m.every((g,h)=>o[h]===g)){let g=o.slice(m.length),[h]=g;p=i(h)?["children",h-(d.pageContentOffset??0),...g.slice(1)]:["children",...g]}}if(d.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let g=1;g<p.length-1;g++)if(p[g]==="children"&&p[g+1]===0&&d.arrayPaths.has(p.slice(0,g).join("/"))){p=[...p.slice(0,g),"map",...p.slice(g+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function ge(o){return JSON.parse(o)}function ia(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function Bn(o,a){let d=o instanceof Element?o:o?.parentElement??null;while(d){if(d instanceof HTMLElement){if(d.dataset.jxPath&&a(d))return{el:d,path:ge(d.dataset.jxPath)};if(ia(d))return null}d=d.parentElement}return null}function Kn(o,a){let d=o.querySelector(ot(ae(a)));return d instanceof HTMLElement?d:null}function ro(o){return o.textContent.length}function td(o,a,d){if(!o.contains(a))return null;let f=o.ownerDocument.createRange();f.setStart(o,0);try{f.setEnd(a,d)}catch{return null}return f.toString().length}function nd(o,a){let d=Math.max(0,Math.min(a,ro(o))),f=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,g=f.nextNode();while(g){let h=g.length;if(p+h>=d)return{node:g,offset:d-p};p+=h,m=g,g=f.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function Zt(o,a,d){let f=Bn(o,d);if(!f||!o)return null;let p=td(f.el,o,a);return p===null?null:{offset:p,path:f.path}}function oo(o,a){let d=Kn(o,a.path);return d?nd(d,a.offset):null}function sa(o){return o.offset<=0}function Qt(o,a){return ae(o.path)===ae(a.path)}function io(o,a){let d=[];for(let f of o.querySelectorAll("[data-jx-path]"))if(a(f)&&!rd(f,o))d.push(f);return d}function rd(o,a){let d=o.parentElement;while(d&&d!==a){if(ia(d))return!0;d=d.parentElement}return!1}function aa(o,a,d,f){let p=io(o,f),m=ae(a),g=p.findIndex((y)=>y.dataset.jxPath===m),h=g===-1?void 0:p[g+d];return h?{el:h,path:ge(h.dataset.jxPath)}:null}var so="jx-site-style",od={body:"body",root:":root"};function la(o,a,d,f,p=od){let m=[],g=(T,C)=>{let H={mediaQueries:a,scope:C,transposeValue:d};if(f)H.resolveValue=(O,K)=>f(O,K,C);for(let O of Bt(T,H))m.push(O.text)},h={},y={},E=[],A=[];for(let[T,C]of Object.entries(o)){if(n(C)&&!Array.isArray(C)){if(T.startsWith("@"))E.push([T,C]);else if(!T.startsWith("--"))A.push([T,C]);continue}if(Wt(T)||T.startsWith("@"))continue;if(T.startsWith("--")||T==="colorScheme"||T==="color-scheme")h[T]=C;else y[T]=C}g(h,p.root),g(y,p.body);for(let[T,C]of A)if(T.startsWith("&"))g({[T]:C},p.root);else g(C,T);for(let[T,C]of E){if(Ht(T)||Vt(T)){g({[T]:C},null);continue}let H={},O={},K=[];for(let[L,_]of Object.entries(C)){if(n(_)&&!Array.isArray(_)){if(!L.startsWith("@"))K.push([L,_]);continue}if(L.startsWith("--"))H[L]=_;else O[L]=_}g({[T]:H},p.root),g({[T]:O},p.body);for(let[L,_]of K)g({[T]:_},L)}if(Object.values(a).some((T)=>An(T)!==null)&&!("colorScheme"in o))m.push(`${p.root} { color-scheme: light dark }`,`${p.root}:where([${Ge}="light"]) { color-scheme: light }`,`${p.root}:where([${Ge}="dark"]) { color-scheme: dark }`);return m.join(`
|
|
10
|
-
`)}async function
|
|
9
|
+
`):h.body??"";if(h.role==="accessor"){let T={};if(h.getter)T.get=Function(h.getter.body??"");if(h.setter){let C=(h.setter.parameters??[]).map((H)=>H.$ref?.split("/").pop()??"v");T.set=Function(...C,h.setter.body??"")}Object.defineProperty(m.prototype,y,{...T,configurable:!0})}else if(h.scope==="static")m[y]=Function(...E,A);else m.prototype[y]=Function(...E,A)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function Nn(o,a,d,f){let p=to(o),m=Object.values(p).some((y)=>c(y)),g=(y)=>fetch(As("/__jx_resolve__"),{body:JSON.stringify({$base:f,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...y}),headers:{"Content-Type":"application/json"},method:"POST"}).then((E)=>{if(!E.ok)throw Error(`Jx dev proxy ${E.status} for "${d}"`);return E.json()}),h=ze(null);if(m)we(()=>{let y={};for(let[E,A]of Object.entries(p))y[E]=c(A)?Ye(A,a):A;g(y).then((E)=>{h.value=E}).catch((E)=>console.error("Jx dev proxy:",E))});else g(p).then((y)=>{h.value=y}).catch((y)=>console.error("Jx dev proxy:",y));return h}function Ys(o,a,d){let f=0;return(p)=>{f+=1;let m=f;new Promise((g)=>{g(a(p))}).then((g)=>{if(m===f)o.value=g}).catch((g)=>{if(m===f)console.error(d,g)})}}async function Du(o,a,d,f){let{$src:p,$export:m}=o,g=Fs.has(p)?Yr(p):void 0;if(!g)return Lu(o,a,d,f);let h=g instanceof Promise?await g:g,y=h[m]??h.default?.[m];if(!y)throw Error(`Jx: export "${m}" not found in "${p}" for "${d}"`);if(!t(y))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let E=y,A=o.arguments??{},T=Object.values(A).some((O)=>r(O)),C=()=>{let O={};for(let[K,L]of Object.entries(A))O[K]=r(L)?Se(L.$ref,a):L;return O},H=ze(null);if(T){let O=Ys(H,E,"Jx server function:");we(()=>{let K=C();vn(()=>{}),O(K)})}else H.value=await E(C());return H}async function Lu(o,a,d,f){let p=o.arguments??{},m=Object.values(p).some((A)=>r(A)),g=()=>{let A={};for(let[T,C]of Object.entries(p))A[T]=r(C)?Se(C.$ref,a):C;return A},h=(A)=>fetch(As("/__jx_server__"),{body:JSON.stringify({$base:f,$export:o.$export,$src:o.$src,arguments:A}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${d}"`);return T.json()}),y=ze(null),E=Ys(y,h,"Jx server proxy:");if(m)we(()=>{let A=g();vn(()=>{}),E(A)});else E(g());return y}function Se(o,a){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let d=(o.startsWith("#/")?o.slice(2):o).split("/"),[,f]=d,m=a.$map?.[f]??a[`$map/${f}`];return d.length>2?he(m,d.slice(2).join("/")):m}if(o.startsWith("#/state/"))return he(a,o.slice(8));if(o.startsWith("parent#/"))return he(a,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(a,o)??null}function us(o,a,d,f){let p=a.replaceAll(/-([a-z])/g,(g,h)=>h.toUpperCase()),m=o[p];if(x(m)){o[p]=d!==null&&d!=="false";return}if(d===null){let g=f?.get(p);o[p]=g===void 0?i(m)?0:"":g;return}o[p]=i(m)?Number(d):d}function ds(o){let a=new Map;for(let[d,f]of Object.entries(o.state??{})){if(n(f)){if("default"in f){a.set(d,f.default);continue}if(Iu.some((p)=>(p in f)))continue}a.set(d,f)}return a}var Iu=["$expression","$prototype","$ref","$src"],fs=new Set;function ju(o,a){if(Object.hasOwn(o,a))return!0;if(o.hasAttribute(a))return!0;let d=a.replaceAll(/[A-Z]/gu,(f)=>`-${f.toLowerCase()}`);return d!==a&&o.hasAttribute(d)}function Hu(o,a){for(let d=Reflect.getPrototypeOf(o);d;d=Reflect.getPrototypeOf(d)){let f=Object.getOwnPropertyDescriptor(d,a);if(f)return f.set}return}function Jn(o,a){if(!w(o))return!1;let d=a===void 0?o:`${a}:${o}`;if(!fs.has(d))fs.add(d),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${a===void 0?"":` (${a})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function Fu(o,a){let d=Xr(a);for(let[f,p]of Object.entries(o.$props??{})){if(Jn(f,"$props"))continue;d[f]=r(p)?Se(p.$ref,a):p}return d}var Xs={},qt=new Map;async function Zs(o,a){let d=a??location.href,{tagName:f}=o;if(!f||!f.includes("-"))throw Error(`Jx redefineElement: tagName "${f}" must contain a hyphen`);if(!customElements.get(f)){await Yt(o,d);return}if(o.$elements)await no(o.$elements,d);let p=qt.get(f)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${f}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);qt.set(f,{base:d,doc:o})}function Qs(o){Xs=o??{}}async function no(o,a,d){for(let f of o){if(e(f)){try{await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`)}catch(g){console.warn(`Jx: failed to import package "${f}"`,g)}continue}if(!r(f))continue;let{href:p}=new URL(f.$ref,a),m=await Ur(p,d);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await no(m.$elements,p,d);await Yt(m,p)}}var ps=32,Vu={expansion:0,frames:[]},bt=Vu;function Hr(o,a,d){if(!o.isConnected)return;console.error(`Jx: <${a}> was not rendered:`,d),o.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:d,message:d.message}))}function _n(o,a){let d=bt;bt=o;try{return a()}finally{bt=d}}function Kr(o){return{expansion:o.frames.length,frames:o.frames}}function Wu(o,a){if(Object.is(o,a))return!0;if(!ms(o)||!ms(a))return!1;try{return JSON.stringify(o)===JSON.stringify(a)}catch{return!1}}function ms(o){if(!n(o))return!1;let a=le(o);if(Array.isArray(a))return!0;let d=Object.getPrototypeOf(a);return d===Object.prototype||d===null}function Bu(o,a){if(o.tag!==a.tag)return!1;let d=Object.keys(o.props);if(d.length!==Object.keys(a.props).length)return!1;return d.every((f)=>Object.hasOwn(a.props,f)&&Wu(o.props[f],a.props[f]))}function Ku(o,a){let d=[...o.frames.map((f)=>f.tag),a.tag].join(" → ");if(o.frames.slice(o.expansion).some((f)=>Bu(f,a)))throw Error(`Component <${a.tag}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=ps)throw Error(`Component nesting exceeds ${ps} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,a]}}var hs=new Set;async function Yt(o,a){let d=a,f;if(e(o)){if(d=new URL(o,d??location.href).href,hs.has(d))return;hs.add(d),f=await Ur(o)}else f=o;d??=location.href;let{tagName:p}=f;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(f.$elements)await no(f.$elements,d);qt.set(p,{base:d,doc:f});let m=f,g=d,h=m.observedAttributes??[],y=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return h}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let E=bt,A={},T=qt.get(p)??{base:g,doc:m},{doc:C,base:H}=T,O=await Ln(C,{},H,{base:H,media:null,root:this});for(let N of h)if(this.hasAttribute(N))us(O,N,this.getAttribute(N)),A[N]=this.getAttribute(N);let K=this.dataset.jxProps;if(K){try{let N=JSON.parse(K),z=n(N)||e(N)?Object.entries(N):[];for(let[Q,de]of z){if(Jn(Q,"data-jx-props"))continue;if(Q in(C.state??{}))O[Q]=de,A[Q]=de}}catch{}delete this.dataset.jxProps}let L=this.getAttributeNames().filter((N)=>N.startsWith("props.")&&N.length>6);for(let N of L){let z=N.slice(6);if(Jn(z,"props.* attribute")){this.removeAttribute(N);continue}if(z in(C.state??{}))O[z]=this.getAttribute(N),A[z]=this.getAttribute(N),this.removeAttribute(N)}for(let N of Object.keys(C.state??{})){if(w(N))continue;let z=Hn(this);if(N in this&&z[N]!==void 0&&ju(this,N))O[N]=z[N],A[N]=z[N]}let _;try{_=Ku(E,{props:A,tag:p})}catch(N){this.replaceChildren(),Hr(this,p,N instanceof Error?N:Error(String(N)));return}for(let N of Object.keys(C.state??{})){if(w(N))continue;let z=Hu(this,N);Object.defineProperty(this,N,{configurable:!0,get:()=>O[N],set:(Q)=>{z?.call(this,Q),O[N]=Q}})}this._state=O;let Y=zu(this);this.replaceChildren();let q=C.style,G=q&&Tu(q)?q:{display:"block",...q},U=zs(G,Qr.get(this));if(Fn(this,U,jn(O),O),Wn(this,C.attributes??{},O),Su(this,C,O),!Array.isArray(C.children)&&C.textContent!==void 0)Bs(this,"textContent",C.textContent,O);let M=Array.isArray(C.children)?C.children:[],B=()=>{let N=Rn;Rn||=this.dataset.jxPath!==void 0;let z=null;try{_n(_,()=>{for(let Q of M)this.append(Oe(Q,O))})}catch(Q){z=Q instanceof Error?Q:Error(String(Q))}finally{Rn=N}return Yu(this,Y),z},te=()=>{let{onMount:N}=O;if(Ir(N))queueMicrotask(()=>N.call(this,O,this))},X=St(B),ce=X.result;if(!ce){te();return}Hr(this,p,ce);let ee=[...ds(C).keys()].filter((N)=>!w(N)),re=ce.message,ve=!1,V=we(()=>{for(let N of ee)O[N]},{scheduler:()=>{if(ve)return;ve=!0,queueMicrotask(()=>{if(ve=!1,!this.isConnected){V.effect.stop();return}V(),X.stop(),this.replaceChildren(),Dt();try{X=St(B)}finally{Lt()}let N=X.result;if(!N)V.effect.stop(),te();else if(N.message!==re)re=N.message,Hr(this,p,N)})}})}disconnectedCallback(){let E=this._state;if(E&&Ir(E.onUnmount))E.onUnmount(E)}adoptedCallback(){let E=this._state;if(E&&Ir(E.onAdopted))E.onAdopted(E)}attributeChangedCallback(E,A,T){if(!this._state||A===T)return;us(this._state,E,T,ds(qt.get(p)?.doc??m))}};customElements.define(p,y)}function gs(o,a,d,f){let p=document.createElement(eo(o.tagName,a));if(d?.onNodeCreated)d.onNodeCreated(p,f??[],o,a);for(let[g,h]of Object.entries(o.$props??{})){if(Jn(g,"$props"))continue;let y=(E)=>{let A=e(E)?Gr(p.tagName,g,E):E;Hn(p)[g]=A;let T=hu(p);if(T&&g in HTMLElement.prototype&&Object.hasOwn(le(T),g))T[g]=A};if(r(h)){let E=h;y(Se(E.$ref,a)),we(()=>{y(Se(E.$ref,a))})}else if(c(h))In(h,()=>{y(Ye(h,a))});else y(h)}if(o.style)Qr.set(p,o.style);Fn(p,o.style??{},jn(a),a),Wn(p,o.attributes??{},a),Zr(p,o,a);let m=Array.isArray(o.children)?o.children:[];for(let g=0;g<m.length;g++){let h=m[g],y=d&&f?{...d,_path:[...f,"children",g]}:void 0;if(S(h))Br(p,h,a,y);else p.append(Oe(h,a,y))}return p}function ea(o){return o.nodeType===Node.ELEMENT_NODE}function ta(o){return o.nodeType===Node.TEXT_NODE}function xs(o){return o.nodeType===Node.COMMENT_NODE}var Uu=/^[\t\n\f\r ]+$/u,ys="jx-slot",bs="data-jx-slots",qu="jx.slot.group",Ut=(()=>{let o=Symbol.for(qu),a=globalThis;return a[o]??=new WeakMap,a[o]})();function zu(o){let a=o.getAttribute(bs);if(a===null)return[...o.childNodes];o.removeAttribute(bs);let d=`${ys} ${a} `,f=`/${ys} ${a}`,p=[],m=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_COMMENT);for(let h=m.nextNode();h;h=m.nextNode())if(xs(h)&&h.data.startsWith(d))p.push(h);let g=[];for(let h of p){let y=decodeURIComponent(h.data.slice(d.length));for(let E=h.nextSibling;E;E=E.nextSibling){if(xs(E)&&E.data===f)break;Ut.set(E,y),g.push(E)}}return g}function Gu(o){return o.some((a)=>ea(a)||ta(a)&&a.data!=="")}function Yu(o,a){let d=[...o.querySelectorAll("slot")];if(d.length===0)return;let f=new Map;for(let m of a){if(ta(m)&&Uu.test(m.data))continue;let g=Ut.get(m);Ut.delete(m);let h=g??(ea(m)?m.getAttribute("slot")??"":""),y=f.get(h);if(!y)y=[],f.set(h,y);y.push(m)}let p=new Set;for(let m of d){let g=m.getAttribute("name")??"",h=[];if(!p.has(g))p.add(g),h=f.get(g)??[];let y=Gu(h)?h:[...h,...m.childNodes],E=m.parentElement;if(E&&E!==o&&E.localName.includes("-")){let A=Ut.get(m)??m.getAttribute("slot")??"";for(let T of y)Ut.set(T,A)}m.replaceWith(...y)}}function Zu(o,a){if(!e(a)||a==="")return o;let d=o.indexOf("#"),f=d===-1?"":o.slice(d),p=d===-1?o:o.slice(0,d),m=p.indexOf("?"),g=m===-1?p:p.slice(0,m),y=(m===-1?[]:p.slice(m+1).split("&")).filter((E)=>E!==""&&!Qu(E));return y.push(`v=${encodeURIComponent(a)}`),`${g}?${y.join("&")}${f}`}function Qu(o){let a=o.indexOf("="),d=a===-1?o:o.slice(0,a);if(d==="v")return!0;if(!d.includes("%"))return!1;try{return decodeURIComponent(d)==="v"}catch{return!1}}function ed(o,a){if(!o||!Object.hasOwn(o,a))return;let d=o[a];return e(d)?d:void 0}function Xt(o,a){if(!a||o==="")return null;if(a.space==="repo"){if(!a.fileBaseUrl)return null;let f=qi(o,a.documentDir,a.mounts,a.lanes);if(f===null)return null;let{suffix:p}=Kt(o);return Zu(`${a.fileBaseUrl}${zi(f)}${p}`,ed(a.versions,f))}let[d]=a.mounts;return d?td(o,a.documentDir,d):null}function td(o,a,d){if(_r(o))return null;let{path:f,suffix:p}=Kt(o),m;try{m=decodeURIComponent(f)}catch{return null}let g=Lr(a,m);if(g===null)return null;let h=Ui([d],g);if(!h)return null;return`${h}${p}`}var na=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180" viewBox="0 0 320 180"><rect width="320" height="180" fill="#808080" fill-opacity="0.16"/><g fill="#808080" fill-opacity="0.38"><circle cx="118" cy="64" r="14"/><path d="M60 140l52-50 34 30 38-46 76 66z"/></g></svg>')}`;function nd(o){let a=o.getAttribute("src")?.trim()??"",d=o.getAttribute("srcset")?.trim()??"";if(a!==""||d!=="")return!1;return!(o.parentElement?.localName==="picture"?o.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function ro(o){if(nd(o))o.setAttribute("data-jx-image-placeholder",""),o.setAttribute("src",na);else if(o.hasAttribute("data-jx-image-placeholder")&&o.getAttribute("src")!==na)o.removeAttribute("data-jx-image-placeholder")}function oa(o){return o.localName==="img"}function ra(o){if(o.nodeType!==o.ELEMENT_NODE||!("querySelectorAll"in o))return[];let a=o,d=[...a.querySelectorAll("img")];return oa(a)?[a,...d]:d}function ia(o){for(let f of ra(o))ro(f);let d=new(o.ownerDocument.defaultView?.MutationObserver??MutationObserver)((f)=>{for(let p of f){if(p.type==="attributes"){let{target:m}=p;if(m.nodeType===m.ELEMENT_NODE&&"localName"in m){let g=m;if(oa(g))ro(g)}continue}for(let m of p.addedNodes)for(let g of ra(m))ro(g)}});return d.observe(o,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>d.disconnect()}function ot(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function rd(o,a){if(!a)return!1;return o.length<=a.length&&o.every((d,f)=>a[f]===d)}function sa(o,a,d){let f=d.layoutWrapped&&n(a)?a.$__layout:void 0;if(f){let m=s(f)?f:{},{file:g,path:h}=m;return{chrome:o.length>0&&!rd(o,d.pageContentPrefix),kind:"layout",layoutFile:e(g)?g:"",layoutPath:Array.isArray(h)?h:[]}}let p=o;if(d.layoutWrapped&&d.pageContentPrefix){let m=d.pageContentPrefix;if(o.length>=m.length&&m.every((g,h)=>o[h]===g)){let g=o.slice(m.length),[h]=g;p=i(h)?["children",h-(d.pageContentOffset??0),...g.slice(1)]:["children",...g]}}if(d.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let g=1;g<p.length-1;g++)if(p[g]==="children"&&p[g+1]===0&&d.arrayPaths.has(p.slice(0,g).join("/"))){p=[...p.slice(0,g),"map",...p.slice(g+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function ge(o){return JSON.parse(o)}function aa(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function Bn(o,a){let d=o instanceof Element?o:o?.parentElement??null;while(d){if(d instanceof HTMLElement){if(d.dataset.jxPath&&a(d))return{el:d,path:ge(d.dataset.jxPath)};if(aa(d))return null}d=d.parentElement}return null}function Kn(o,a){let d=o.querySelector(ot(ae(a)));return d instanceof HTMLElement?d:null}function oo(o){return o.textContent.length}function od(o,a,d){if(!o.contains(a))return null;let f=o.ownerDocument.createRange();f.setStart(o,0);try{f.setEnd(a,d)}catch{return null}return f.toString().length}function id(o,a){let d=Math.max(0,Math.min(a,oo(o))),f=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,g=f.nextNode();while(g){let h=g.length;if(p+h>=d)return{node:g,offset:d-p};p+=h,m=g,g=f.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function Zt(o,a,d){let f=Bn(o,d);if(!f||!o)return null;let p=od(f.el,o,a);return p===null?null:{offset:p,path:f.path}}function io(o,a){let d=Kn(o,a.path);return d?id(d,a.offset):null}function la(o){return o.offset<=0}function Qt(o,a){return ae(o.path)===ae(a.path)}function so(o,a){let d=[];for(let f of o.querySelectorAll("[data-jx-path]"))if(a(f)&&!sd(f,o))d.push(f);return d}function sd(o,a){let d=o.parentElement;while(d&&d!==a){if(aa(d))return!0;d=d.parentElement}return!1}function ca(o,a,d,f){let p=so(o,f),m=ae(a),g=p.findIndex((y)=>y.dataset.jxPath===m),h=g===-1?void 0:p[g+d];return h?{el:h,path:ge(h.dataset.jxPath)}:null}var ao="jx-site-style",ad={body:"body",root:":root"};function ua(o,a,d,f,p=ad){let m=[],g=(T,C)=>{let H={mediaQueries:a,scope:C,transposeValue:d};if(f)H.resolveValue=(O,K)=>f(O,K,C);for(let O of Bt(T,H))m.push(O.text)},h={},y={},E=[],A=[];for(let[T,C]of Object.entries(o)){if(n(C)&&!Array.isArray(C)){if(T.startsWith("@"))E.push([T,C]);else if(!T.startsWith("--"))A.push([T,C]);continue}if(Wt(T)||T.startsWith("@"))continue;if(T.startsWith("--")||T==="colorScheme"||T==="color-scheme")h[T]=C;else y[T]=C}g(h,p.root),g(y,p.body);for(let[T,C]of A)if(T.startsWith("&"))g({[T]:C},p.root);else g(C,T);for(let[T,C]of E){if(Ht(T)||Vt(T)){g({[T]:C},null);continue}let H={},O={},K=[];for(let[L,_]of Object.entries(C)){if(n(_)&&!Array.isArray(_)){if(!L.startsWith("@"))K.push([L,_]);continue}if(L.startsWith("--"))H[L]=_;else O[L]=_}g({[T]:H},p.root),g({[T]:O},p.body);for(let[L,_]of K)g({[T]:_},L)}if(Object.values(a).some((T)=>An(T)!==null)&&!("colorScheme"in o))m.push(`${p.root} { color-scheme: light dark }`,`${p.root}:where([${Ge}="light"]) { color-scheme: light }`,`${p.root}:where([${Ge}="dark"]) { color-scheme: dark }`);return m.join(`
|
|
10
|
+
`)}async function ld(o,a){let d=o.$elements;if(!Array.isArray(d))return;await Promise.all(d.map(async(f)=>{let p=(async()=>{if(e(f))await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`);else if(n(f)&&"$ref"in f)await Yt(new URL(String(f.$ref),a).href);else if(n(f))await Yt(f,a)})();try{await Promise.race([p,new Promise((m,g)=>{setTimeout(()=>g(Error("register timeout")),5000)})])}catch(m){console.warn("iframe canvas: failed to register element",JSON.stringify(f),m)}}))}var da="jx-canvas-edit-css",cd=`
|
|
11
11
|
.empty-media-placeholder {
|
|
12
12
|
display: inline-block;
|
|
13
13
|
min-width: 120px;
|
|
@@ -96,7 +96,7 @@ var ur="jx:canvas";function Go(o){let{target:a,source:d,targetOrigin:f,acceptOri
|
|
|
96
96
|
[data-jx-layout-region] [data-jx-layout-region]::before {
|
|
97
97
|
content: none;
|
|
98
98
|
}
|
|
99
|
-
`;function
|
|
99
|
+
`;function ud(o,a){let d=o.head.querySelector(`#${da}`);if(a!=="design"&&a!=="edit"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=da,f.textContent=cd,o.head.append(f)}var fa="jx-canvas-overlay-css",dd=`
|
|
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 fd(o,a){let d=o.head.querySelector(`#${fa}`);if(a==="preview"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=fa,f.textContent=dd,o.head.append(f)}var pa="jx-canvas-diff-css",pd=`
|
|
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 md(o,a){let d=o.head.querySelector(`#${pa}`);if(!a){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=pa,f.textContent=pd,o.head.append(f)}function hd(o,a){for(let d of o.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(d instanceof HTMLElement)delete d.dataset.jxDiff,delete d.dataset.jxDiffWithin;if(!a?.length)return;for(let d of a){let f=Kn(o,d.path);if(f){f.dataset.jxDiff=d.kind;continue}let{path:p}=d;while(p.length>=2){p=p.slice(0,-2);let m=Kn(o,p);if(m){m.dataset.jxDiffWithin="";break}}}}function gd(o,a){o.documentElement.toggleAttribute("data-jx-preview",a==="preview")}function Un(o){return o==="design"||o==="edit"}function xd(o,a){if(!Un(a)){o.removeAttribute("contenteditable"),o.removeAttribute("spellcheck"),o.removeAttribute("role"),o.removeAttribute("aria-multiline"),o.removeAttribute("aria-label");return}o.contentEditable="true",o.spellcheck=!0,o.setAttribute("autocorrect","off"),o.setAttribute("writingsuggestions","false"),o.setAttribute("draggable","false"),o.setAttribute("role","textbox"),o.setAttribute("aria-multiline","true"),o.setAttribute("aria-label","Document content")}var ma="jx-canvas-stylebook-css",yd=`
|
|
231
231
|
.sb-root {
|
|
232
232
|
padding: 16px;
|
|
233
233
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
|
@@ -310,10 +310,10 @@ dialog[data-jx-dialog-open]::before {
|
|
|
310
310
|
color: color-mix(in srgb, #808080 70%, transparent);
|
|
311
311
|
font-size: 13px;
|
|
312
312
|
}
|
|
313
|
-
`;function gd(o,a){let d=o.head.querySelector(`#${fa}`);if(a!=="stylebook"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=fa,f.textContent=hd,o.head.append(f)}function ao(o,a={}){let d=document.head.querySelector(`#${so}`);if(!o||!n(o)){d?.remove();return}let f=la(o,a,$n);if(d){d.textContent=f;return}let p=document.createElement("style");p.id=so,p.textContent=f,document.head.append(p)}function lo(o,a){if(a)o.documentElement.dataset.colorScheme=a;else delete o.documentElement.dataset.colorScheme}function ma(o){let a=o.documentElement;return{dir:a.getAttribute("dir"),lang:a.getAttribute("lang")}}function pa(o,a,d){if(d===null)o.removeAttribute(a);else o.setAttribute(a,d)}function qn(o,a,d){let f=o.documentElement;pa(f,"lang",a?.locale??d.lang),pa(f,"dir",a?.dir==="rtl"?"rtl":d.dir)}function en(o,a){for(let f of o.querySelectorAll("[data-jx-popover-open]"))delete f.dataset.jxPopoverOpen;if(a===null)return;let d=o.querySelector(`[data-jx-popover]${ot(a)}`);if(d)d.dataset.jxPopoverOpen=""}function Et(o,a){for(let f of o.querySelectorAll("[data-jx-dialog-open]"))delete f.dataset.jxDialogOpen;if(a===null)return;let d=o.querySelector(`dialog${ot(a)}`);if(d)d.dataset.jxDialogOpen=""}function xd(o,a=null){let d=o.$head;if(!Array.isArray(d))return;for(let f of d){if(!n(f)||!f.tagName)continue;let p=String(f.tagName).toLowerCase();if(p==="script"&&!f.attributes?.src)continue;let m={...f.attributes};for(let y of["href","src"]){let E=m[y];if(!e(E)||E==="")continue;if(!E.startsWith("/")&&!E.startsWith(".")&&!E.startsWith("http")){m[y]=`/node_modules/${E}`;continue}m[y]=Xt(E,a)??E}let g=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(g!==p&&document.head.querySelector(g))continue;let h=document.createElement(p);for(let[y,E]of Object.entries(m))h.setAttribute(y,String(E));if(f.textContent)h.textContent=String(f.textContent);document.head.append(h)}}function co(o){let a=[],d=(f)=>a.some((p)=>f.length>p.length&&p.every((m,g)=>f[g]===m));return(f,p,m)=>{if(!(f instanceof HTMLElement))return;let g=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(g)f.dataset.jxDefinitionRoot="";let h=!g&&f.tagName.includes("-")&&Un(o.canvasMode);if(h)f.contentEditable="false",a.push(p);let y=oa(p,m,o);if(y.kind==="layout"){if(f.dataset.jxLayoutPath=ae(y.layoutPath),y.layoutFile)f.dataset.jxLayoutFile=y.layoutFile;if(y.chrome){if(f.dataset.jxLayoutRegion="",Un(o.canvasMode))f.contentEditable="false"}return}if(f.dataset.jxPath=ae(y.path),!h&&Un(o.canvasMode)&&d(p))f.contentEditable="true"}}function uo(o){let a=o.getAttribute("src")?.trim()??"";return a!==""&&!a.startsWith("data:")}function ha(o,a=3){let d=new WeakMap,f=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!uo(m))return;let g=(d.get(m)??0)+1;if(g>a)return;d.set(m,g),setTimeout(()=>{let h=m.src;m.src="",m.src=h},150*g)};return o.addEventListener("error",f,!0),()=>o.removeEventListener("error",f,!0)}async function ga(o){let a=o.assets??null;Jn(a?(h)=>Xt(h,a):null),bs(o.mode!=="preview"),Es(o.mode!=="preview"&&!o.allowAutoRequests),Cs(!0),Ns(o.mode!=="preview"&&o.mode!=="stylebook"),Rs(o.mode!=="preview"),$s(o.mode!=="preview"),Ms(o.mode==="design"||o.mode==="edit"),ao(o.siteStyle,o.doc.$media??{}),xd(o.doc,a),ad(o.container.ownerDocument,o.mode),cd(o.container.ownerDocument,o.mode),pd(o.container.ownerDocument,o.mode),gd(o.container.ownerDocument,o.mode),dd(o.container.ownerDocument,Boolean(o.diffMarks?.length)),Xs(o.doc.$media??{}),await id(o.doc,o.docBase);let d=await Ln(o.doc,{},o.docBase),f=co(o.mapperCtx),{result:p,stop:m}=bt(()=>Oe(o.doc,d,{_path:[],onNodeCreated:f}));o.container.replaceChildren(p),en(o.container,o.popoverOpen??null),Et(o.container,o.dialogOpen??null),md(o.container,o.mode),fd(o.container,o.diffMarks??null);let g=o.mode==="stylebook"?ra(o.container):null;return{ctx:{defs:d,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:()=>{g?.(),m()}}}function yd(o){return JSON.parse(JSON.stringify(o))}function zn(o){return o===void 0||o===null?o:yd(o)}function xe(o,a){let d=o;for(let f of a){if(d==null)return;d=d[f]}return d}function xa(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function fo(o,a){let{op:d}=a;switch(a.op){case"set-key":{let f=xe(o,a.path);if(!f)throw Error(`doc-op-node-not-found:${a.path.join("/")}`);if(a.value===void 0)delete f[a.key];else f[a.key]=zn(a.value);return}case"insert-child":{tn(o,a.parentPath).splice(a.index,0,zn(a.node));return}case"remove-child":{tn(o,a.parentPath).splice(a.index,1);return}case"set-child":{tn(o,a.parentPath).splice(a.index,1,zn(a.node));return}case"move-child":{bd(a);let f=tn(o,a.fromParentPath),p=tn(o,a.toParentPath),[m]=f.splice(a.fromIndex,1);p.splice(a.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${d}`)}function tn(o,a){let d=xe(o,a);if(d==null)throw TypeError(`doc-op-node-not-found:${a.join("/")}`);return xa(d)}function bd(o){let a=[...o.fromParentPath,"children",o.fromIndex],d=o.toParentPath;if(d.length>=a.length&&a.every((f,p)=>f===d[p]))throw Error(`doc-op-move-into-self:${d.join("/")}`)}function ya(o){return o.length>=2?o.slice(0,-2):null}function ba(o){return o.at(-1)}function Sa(o,a){if(o===a)return!0;if(!o||!a||o.length!==a.length)return!1;return o.every((d,f)=>d===a[f])}function vt(o,a){if(o.length>a.length)return!1;return o.every((d,f)=>d===a[f])}var Gn=14,Sd="empty-container-placeholder";function Ea(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}function Ed(o){let a=getComputedStyle(o),{display:d}=a,f=d==="flex"||d==="inline-flex",p=d==="grid"||d==="inline-grid";return f&&a.flexDirection.startsWith("row")||p&&a.gridAutoFlow.startsWith("column")}function Ta(o,a,d){let f=o.dataset.jxPath;if(f==null)return null;let p=ge(f);if(o.classList.contains(Sd))return[{edge:"center",index:0,insertParentPath:p,rect:Ea(o)}];let m=ya(p);if(!m)return null;let g=o.parentElement;if(!g)return null;let h=ba(p);if(!i(h))return null;let y=Ea(o);if(Ed(g)){let A=a.x-y.x;if(A<Gn)return[Yn("left",m,h,va(y,!0))];if(y.width-A<Gn)return[Yn("right",m,h+1,wa(y,!0))];return null}let E=a.y-y.y;if(E<Gn)return[Yn("top",m,h,va(y,!1))];if(y.height-E<Gn)return[Yn("bottom",m,h+1,wa(y,!1))];return null}function Yn(o,a,d,f){return{edge:o,index:d,insertParentPath:a,rect:f}}function va(o,a){return a?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function wa(o,a){return a?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function Aa(o){if(!o||o.length===0)return"none";return o.map((a)=>`${a.edge}:${a.insertParentPath.join("/")}:${a.index}`).join("|")}var Xn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function po(o){return o.nodeType===Node.ELEMENT_NODE}function Ca(o){return o.nodeType===Node.TEXT_NODE}function Na(o,a){if(!a)return!1;if(a.contentEditable==="plaintext-only")return!1;let d=window.getSelection();if(!d||!d.rangeCount)return!1;let{anchorNode:f,focusNode:p}=d;if(!f||!p)return!1;if(!a.contains(f)||!a.contains(p))return!1;let m=(g)=>{let h=g;while(h&&h!==a){if(po(h)&&h.tagName.toLowerCase()===o)return!0;h=h.parentNode}return!1};return m(f)&&m(p)}function Ra(o,a){if(!a)return;let d=window.getSelection();if(!d||!d.rangeCount)return;let f=d.getRangeAt(0);if(f.collapsed)return;if(!a.contains(f.commonAncestorContainer))return;kd(f);let p=vd(o,f,a);if(p.length>0)wd(o,f,a,p);else Td(o,f,a);wt(a)}function vd(o,a,d){let f=[];for(let p of d.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&a.intersectsNode(p))f.push(p);return f}function wd(o,a,d,f){for(let p=f.length-1;p>=0;p--){let m=f[p];$a(m)}}function $a(o){if(!o.parentNode)return;let d=document.createDocumentFragment();while(o.firstChild)d.append(o.firstChild);o.replaceWith(d)}function Td(o,a,d){let f=a.extractContents(),p=Ad(f),m=Cd(f);if(!f.hasChildNodes()){if(p)a.insertNode(document.createTextNode(p));if(m){let E=document.createTextNode(m);a.collapse(!1),a.insertNode(E)}return}let g=document.createElement(o);g.append(f);let h=document.createDocumentFragment();if(p)h.append(document.createTextNode(p));if(h.append(g),m)h.append(document.createTextNode(m));a.insertNode(h);let y=window.getSelection();if(y){y.removeAllRanges();let E=document.createRange();E.selectNodeContents(g),y.addRange(E)}}function Ad(o){let a=o.firstChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/^(\s+)/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(p.length);return p}function Cd(o){let a=o.lastChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/(\s+)$/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(0,-p.length);return p}function wt(o){if(!o)return;let a=!0,d=0;while(a&&d<10){if(a=!1,d+=1,o.normalize(),Pd(o))a=!0;if(Nd(o))a=!0;if(Rd(o))a=!0;if($d(o))a=!0;if(Od(o))a=!0}}function Pd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){let p=f.nextSibling;if(p&&po(p)&&p.tagName===f.tagName&&Xn.has(f.tagName.toLowerCase())&&Md(f,p))d.push([f,p])}for(let f=d.length-1;f>=0;f--){let[p,m]=d[f];while(m.firstChild)p.append(m.firstChild);m.remove(),a=!0}return a}function Nd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;let p=f.firstChild;if(f.childNodes.length===1&&p!==null&&po(p)&&p.tagName===f.tagName)d.push(f)}for(let f of d){let p=f.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),a=!0}return a}function Rd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f.childNodes.length===0&&!f.textContent)d.push(f)}for(let f of d)f.remove(),a=!0;return a}function $d(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f===o)continue;let p=f.firstChild;if(p&&Ca(p)){let g=p.textContent,h=g.match(/^(\s+)/);if(h&&g.length>h[1].length)d.push({el:f,text:p,type:"lift-leading",ws:h[1]})}let m=f.lastChild;if(m&&Ca(m)&&m!==p){let g=m.textContent,h=g.match(/(\s+)$/);if(h&&g.length>h[1].length)d.push({el:f,text:m,type:"lift-trailing",ws:h[1]})}}for(let f of d){if(f.type==="lift-leading")f.text.textContent=f.text.textContent.slice(f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el);else f.text.textContent=f.text.textContent.slice(0,-f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el.nextSibling);a=!0}return a}function Od(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(f.tagName.toLowerCase()!=="span")continue;if(f===o)continue;if(f.attributes.length>0)continue;d.push(f)}for(let f of d)$a(f),a=!0;return a}function Md(o,a){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===a.getAttribute("href");return!0}function kd(o){Pa(o,!0),Pa(o,!1)}function Pa(o,a){let d=a?o.startContainer:o.endContainer,f=a?o.startOffset:o.endOffset;if(d.nodeType!==Node.TEXT_NODE)return;let p=d.textContent??"",m=_d(p);for(let g of m)if(a){if(f>g.start&&f<g.end)o.setStart(d,g.start)}else if(f>g.start&&f<g.end)o.setEnd(d,g.end)}function _d(o){let a=[],d=0;while(d<o.length-1){if(o[d]==="$"&&o[d+1]==="{"){let f=d,p=1,m=d+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){a.push({end:m,start:f}),d=m;continue}}d+=1}return a}var Zn=(o,a)=>document.execCommand(o,!1,a);function Oa(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function Ma(o){let a=window.getSelection();if(!a||!a.rangeCount)return{active:!1,href:null};let d=a.anchorNode;while(d&&d!==o){if(Oa(d))return{active:!0,href:d.dataset.jxHref??d.getAttribute("href")};d=d.parentNode}return{active:!1,href:null}}function Dd(o){let a=window.getSelection();if(!a||!a.rangeCount)return null;let d=a.anchorNode;while(d&&d!==o){if(Oa(d))return d;d=d.parentNode}return null}function ka(o,a){let d=Dd(o);if(d)if(a)d.setAttribute("href",a);else{let f=document.createDocumentFragment();while(d.firstChild)f.append(d.firstChild);d.replaceWith(f)}else if(a)Zn("createLink",a);wt(o)}function _a(o,a){o.focus(),Zn("insertText",`\${${a}}`)}var Da={$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 Ja=Da.$defs,Ld=new Set(["pre"]),Id=new Set(Object.entries(Ja).filter(([o,a])=>!Ld.has(o)&&(a.$inlineChildren?.length??0)>0).map(([o])=>o));function La(o,a){return a?.[o.toLowerCase()]??Id.has(o.toLowerCase())}var jd={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Ze=jd;function mo(o){Ze=o}var ne=null,Ne=null,Tt=null,nn=null,At=null,Xe=null,Me=!1,on="",rn=!1,ja=null;function Ha(o){ja=o}function it(o){return La(o.tagName,ja)}function ho(o,a,d,f){if(ne)Le(!0);if(ne=o,Ne=a,Tt=d.onCommit,nn=d.onSplit,At=d.onInsert,Xe=d.onEnd,Me=f?.plainText===!0,on=Me?o.textContent:"",rn=!1,o.dataset.jxActiveBlock="",Me){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",go),o.addEventListener("input",xo),o.addEventListener("paste",yo)}function Le(o=!1){if(!ne)return;if(qa(!1),Ze.dismiss(),delete ne.dataset.jxActiveBlock,Me)ne.contentEditable="false";if(ne.removeEventListener("keydown",go),ne.removeEventListener("input",xo),ne.removeEventListener("paste",yo),ne=null,Ne=null,Tt=null,nn=null,At=null,Me=!1,on="",rn=!1,o)Xe=null;else if(Xe){let a=Xe;Xe=null,a()}}function Fa(){qa(!0)}function Va(){return Me&&ne!==null}function ke(){return ne!==null}function Ct(){return ne}function Wa(){return Ne}function Ba(){return Ze.isOpen()}function go(o){if(Me){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),ne)ne.textContent=on;Le();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Le();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function xo(){if(Ze.isOpen())Eo()}function yo(o){o.preventDefault();let a=o.clipboardData?.getData("text/plain")??"";Zn("insertText",a)}function Ka(){if(!nn||!ne||!Ne)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let a=o.getRangeAt(0),d=document.createRange();d.setStart(ne,0),d.setEnd(a.startContainer,a.startOffset);let f=document.createRange();f.setStart(a.endContainer,a.endOffset),f.setEnd(ne,ne.childNodes.length);let p=Ia(d.cloneContents()),m=Ia(f.cloneContents()),g=[...Ne],h=nn;return Ua(),h(g,p,m),!0}function Ua(){if(!ne)return;if(delete ne.dataset.jxActiveBlock,Me)ne.contentEditable="false";if(ne.removeEventListener("keydown",go),ne.removeEventListener("input",xo),ne.removeEventListener("paste",yo),ne=null,Ne=null,Tt=null,nn=null,At=null,Me=!1,on="",rn=!1,Xe){let o=Xe;Xe=null,o()}}function qa(o){if(!Tt||!ne||!Ne)return;if(Me){let d=ne.textContent.replaceAll(`
|
|
313
|
+
`;function bd(o,a){let d=o.head.querySelector(`#${ma}`);if(a!=="stylebook"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=ma,f.textContent=yd,o.head.append(f)}function lo(o,a={}){let d=document.head.querySelector(`#${ao}`);if(!o||!n(o)){d?.remove();return}let f=ua(o,a,$n);if(d){d.textContent=f;return}let p=document.createElement("style");p.id=ao,p.textContent=f,document.head.append(p)}function co(o,a){if(a)o.documentElement.dataset.colorScheme=a;else delete o.documentElement.dataset.colorScheme}function ga(o){let a=o.documentElement;return{dir:a.getAttribute("dir"),lang:a.getAttribute("lang")}}function ha(o,a,d){if(d===null)o.removeAttribute(a);else o.setAttribute(a,d)}function qn(o,a,d){let f=o.documentElement;ha(f,"lang",a?.locale??d.lang),ha(f,"dir",a?.dir==="rtl"?"rtl":d.dir)}function en(o,a){for(let f of o.querySelectorAll("[data-jx-popover-open]"))delete f.dataset.jxPopoverOpen;if(a===null)return;let d=o.querySelector(`[data-jx-popover]${ot(a)}`);if(d)d.dataset.jxPopoverOpen=""}function Et(o,a){for(let f of o.querySelectorAll("[data-jx-dialog-open]"))delete f.dataset.jxDialogOpen;if(a===null)return;let d=o.querySelector(`dialog${ot(a)}`);if(d)d.dataset.jxDialogOpen=""}function Sd(o,a=null){let d=o.$head;if(!Array.isArray(d))return;for(let f of d){if(!n(f)||!f.tagName)continue;let p=String(f.tagName).toLowerCase();if(p==="script"&&!f.attributes?.src)continue;let m={...f.attributes};for(let y of["href","src"]){let E=m[y];if(!e(E)||E==="")continue;if(!E.startsWith("/")&&!E.startsWith(".")&&!E.startsWith("http")){m[y]=`/node_modules/${E}`;continue}m[y]=Xt(E,a)??E}let g=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(g!==p&&document.head.querySelector(g))continue;let h=document.createElement(p);for(let[y,E]of Object.entries(m))h.setAttribute(y,String(E));if(f.textContent)h.textContent=String(f.textContent);document.head.append(h)}}function uo(o){let a=[],d=(f)=>a.some((p)=>f.length>p.length&&p.every((m,g)=>f[g]===m));return(f,p,m)=>{if(!(f instanceof HTMLElement))return;let g=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(g)f.dataset.jxDefinitionRoot="";let h=!g&&f.tagName.includes("-")&&Un(o.canvasMode);if(h)f.contentEditable="false",a.push(p);let y=sa(p,m,o);if(y.kind==="layout"){if(f.dataset.jxLayoutPath=ae(y.layoutPath),y.layoutFile)f.dataset.jxLayoutFile=y.layoutFile;if(y.chrome){if(f.dataset.jxLayoutRegion="",Un(o.canvasMode))f.contentEditable="false"}return}if(f.dataset.jxPath=ae(y.path),!h&&Un(o.canvasMode)&&d(p))f.contentEditable="true"}}function fo(o){let a=o.getAttribute("src")?.trim()??"";return a!==""&&!a.startsWith("data:")}function xa(o,a=3){let d=new WeakMap,f=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!fo(m))return;let g=(d.get(m)??0)+1;if(g>a)return;d.set(m,g),setTimeout(()=>{let h=m.src;m.src="",m.src=h},150*g)};return o.addEventListener("error",f,!0),()=>o.removeEventListener("error",f,!0)}async function ya(o){let a=o.assets??null;Dn(a?(h)=>Xt(h,a):null),vs(o.mode!=="preview"),ws(o.mode!=="preview"&&!o.allowAutoRequests),Ns(!0),$s(o.mode!=="preview"&&o.mode!=="stylebook"),Os(o.mode!=="preview"),Ms(o.mode!=="preview"),Js(o.mode==="design"||o.mode==="edit"),lo(o.siteStyle,o.doc.$media??{}),Sd(o.doc,a),ud(o.container.ownerDocument,o.mode),fd(o.container.ownerDocument,o.mode),gd(o.container.ownerDocument,o.mode),bd(o.container.ownerDocument,o.mode),md(o.container.ownerDocument,Boolean(o.diffMarks?.length)),Qs(o.doc.$media??{}),await ld(o.doc,o.docBase);let d=await Ln(o.doc,{},o.docBase),f=uo(o.mapperCtx),{result:p,stop:m}=St(()=>Oe(o.doc,d,{_path:[],onNodeCreated:f}));o.container.replaceChildren(p),en(o.container,o.popoverOpen??null),Et(o.container,o.dialogOpen??null),xd(o.container,o.mode),hd(o.container,o.diffMarks??null);let g=o.mode==="stylebook"?ia(o.container):null;return{ctx:{defs:d,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:()=>{g?.(),m()}}}function vd(o){return JSON.parse(JSON.stringify(o))}function zn(o){return o===void 0||o===null?o:vd(o)}function xe(o,a){let d=o;for(let f of a){if(d==null)return;d=d[f]}return d}function ba(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function po(o,a){let{op:d}=a;switch(a.op){case"set-key":{let f=xe(o,a.path);if(!f)throw Error(`doc-op-node-not-found:${a.path.join("/")}`);if(a.value===void 0)delete f[a.key];else f[a.key]=zn(a.value);return}case"insert-child":{tn(o,a.parentPath).splice(a.index,0,zn(a.node));return}case"remove-child":{tn(o,a.parentPath).splice(a.index,1);return}case"set-child":{tn(o,a.parentPath).splice(a.index,1,zn(a.node));return}case"move-child":{Ed(a);let f=tn(o,a.fromParentPath),p=tn(o,a.toParentPath),[m]=f.splice(a.fromIndex,1);p.splice(a.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${d}`)}function tn(o,a){let d=xe(o,a);if(d==null)throw TypeError(`doc-op-node-not-found:${a.join("/")}`);return ba(d)}function Ed(o){let a=[...o.fromParentPath,"children",o.fromIndex],d=o.toParentPath;if(d.length>=a.length&&a.every((f,p)=>f===d[p]))throw Error(`doc-op-move-into-self:${d.join("/")}`)}function it(o,a){if(o.length>a.length)return!1;return o.every((d,f)=>d===a[f])}function Sa(o){return o.length>=2?o.slice(0,-2):null}function va(o){return o.at(-1)}function Ea(o,a){if(o===a)return!0;if(!o||!a||o.length!==a.length)return!1;return o.every((d,f)=>d===a[f])}var Gn=14,wd="empty-container-placeholder";function wa(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}function Td(o){let a=getComputedStyle(o),{display:d}=a,f=d==="flex"||d==="inline-flex",p=d==="grid"||d==="inline-grid";return f&&a.flexDirection.startsWith("row")||p&&a.gridAutoFlow.startsWith("column")}function Ca(o,a,d){let f=o.dataset.jxPath;if(f==null)return null;let p=ge(f);if(o.classList.contains(wd))return[{edge:"center",index:0,insertParentPath:p,rect:wa(o)}];let m=Sa(p);if(!m)return null;let g=o.parentElement;if(!g)return null;let h=va(p);if(!i(h))return null;let y=wa(o);if(Td(g)){let A=a.x-y.x;if(A<Gn)return[Yn("left",m,h,Ta(y,!0))];if(y.width-A<Gn)return[Yn("right",m,h+1,Aa(y,!0))];return null}let E=a.y-y.y;if(E<Gn)return[Yn("top",m,h,Ta(y,!1))];if(y.height-E<Gn)return[Yn("bottom",m,h+1,Aa(y,!1))];return null}function Yn(o,a,d,f){return{edge:o,index:d,insertParentPath:a,rect:f}}function Ta(o,a){return a?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function Aa(o,a){return a?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function Pa(o){if(!o||o.length===0)return"none";return o.map((a)=>`${a.edge}:${a.insertParentPath.join("/")}:${a.index}`).join("|")}var Xn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function mo(o){return o.nodeType===Node.ELEMENT_NODE}function Na(o){return o.nodeType===Node.TEXT_NODE}function $a(o,a){if(!a)return!1;if(a.contentEditable==="plaintext-only")return!1;let d=window.getSelection();if(!d||!d.rangeCount)return!1;let{anchorNode:f,focusNode:p}=d;if(!f||!p)return!1;if(!a.contains(f)||!a.contains(p))return!1;let m=(g)=>{let h=g;while(h&&h!==a){if(mo(h)&&h.tagName.toLowerCase()===o)return!0;h=h.parentNode}return!1};return m(f)&&m(p)}function Oa(o,a){if(!a)return;let d=window.getSelection();if(!d||!d.rangeCount)return;let f=d.getRangeAt(0);if(f.collapsed)return;if(!a.contains(f.commonAncestorContainer))return;Dd(f);let p=Ad(o,f,a);if(p.length>0)Cd(o,f,a,p);else Pd(o,f,a);wt(a)}function Ad(o,a,d){let f=[];for(let p of d.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&a.intersectsNode(p))f.push(p);return f}function Cd(o,a,d,f){for(let p=f.length-1;p>=0;p--){let m=f[p];Ma(m)}}function Ma(o){if(!o.parentNode)return;let d=document.createDocumentFragment();while(o.firstChild)d.append(o.firstChild);o.replaceWith(d)}function Pd(o,a,d){let f=a.extractContents(),p=Nd(f),m=Rd(f);if(!f.hasChildNodes()){if(p)a.insertNode(document.createTextNode(p));if(m){let E=document.createTextNode(m);a.collapse(!1),a.insertNode(E)}return}let g=document.createElement(o);g.append(f);let h=document.createDocumentFragment();if(p)h.append(document.createTextNode(p));if(h.append(g),m)h.append(document.createTextNode(m));a.insertNode(h);let y=window.getSelection();if(y){y.removeAllRanges();let E=document.createRange();E.selectNodeContents(g),y.addRange(E)}}function Nd(o){let a=o.firstChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/^(\s+)/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(p.length);return p}function Rd(o){let a=o.lastChild;if(!a||a.nodeType!==Node.TEXT_NODE)return null;let d=a.textContent??"",f=d.match(/(\s+)$/);if(!f)return null;let p=f[1];if(d.length===p.length)a.remove();else a.textContent=d.slice(0,-p.length);return p}function wt(o){if(!o)return;let a=!0,d=0;while(a&&d<10){if(a=!1,d+=1,o.normalize(),$d(o))a=!0;if(Od(o))a=!0;if(Md(o))a=!0;if(kd(o))a=!0;if(Jd(o))a=!0}}function $d(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){let p=f.nextSibling;if(p&&mo(p)&&p.tagName===f.tagName&&Xn.has(f.tagName.toLowerCase())&&_d(f,p))d.push([f,p])}for(let f=d.length-1;f>=0;f--){let[p,m]=d[f];while(m.firstChild)p.append(m.firstChild);m.remove(),a=!0}return a}function Od(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;let p=f.firstChild;if(f.childNodes.length===1&&p!==null&&mo(p)&&p.tagName===f.tagName)d.push(f)}for(let f of d){let p=f.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),a=!0}return a}function Md(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f.childNodes.length===0&&!f.textContent)d.push(f)}for(let f of d)f.remove(),a=!0;return a}function kd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Xn.has(f.tagName.toLowerCase()))continue;if(f===o)continue;let p=f.firstChild;if(p&&Na(p)){let g=p.textContent,h=g.match(/^(\s+)/);if(h&&g.length>h[1].length)d.push({el:f,text:p,type:"lift-leading",ws:h[1]})}let m=f.lastChild;if(m&&Na(m)&&m!==p){let g=m.textContent,h=g.match(/(\s+)$/);if(h&&g.length>h[1].length)d.push({el:f,text:m,type:"lift-trailing",ws:h[1]})}}for(let f of d){if(f.type==="lift-leading")f.text.textContent=f.text.textContent.slice(f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el);else f.text.textContent=f.text.textContent.slice(0,-f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el.nextSibling);a=!0}return a}function Jd(o){let a=!1,d=[];for(let f of o.querySelectorAll("*")){if(f.tagName.toLowerCase()!=="span")continue;if(f===o)continue;if(f.attributes.length>0)continue;d.push(f)}for(let f of d)Ma(f),a=!0;return a}function _d(o,a){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===a.getAttribute("href");return!0}function Dd(o){Ra(o,!0),Ra(o,!1)}function Ra(o,a){let d=a?o.startContainer:o.endContainer,f=a?o.startOffset:o.endOffset;if(d.nodeType!==Node.TEXT_NODE)return;let p=d.textContent??"",m=Ld(p);for(let g of m)if(a){if(f>g.start&&f<g.end)o.setStart(d,g.start)}else if(f>g.start&&f<g.end)o.setEnd(d,g.end)}function Ld(o){let a=[],d=0;while(d<o.length-1){if(o[d]==="$"&&o[d+1]==="{"){let f=d,p=1,m=d+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){a.push({end:m,start:f}),d=m;continue}}d+=1}return a}var Zn=(o,a)=>document.execCommand(o,!1,a);function ka(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function Ja(o){let a=window.getSelection();if(!a||!a.rangeCount)return{active:!1,href:null};let d=a.anchorNode;while(d&&d!==o){if(ka(d))return{active:!0,href:d.dataset.jxHref??d.getAttribute("href")};d=d.parentNode}return{active:!1,href:null}}function Id(o){let a=window.getSelection();if(!a||!a.rangeCount)return null;let d=a.anchorNode;while(d&&d!==o){if(ka(d))return d;d=d.parentNode}return null}function _a(o,a){let d=Id(o);if(d)if(a)d.setAttribute("href",a);else{let f=document.createDocumentFragment();while(d.firstChild)f.append(d.firstChild);d.replaceWith(f)}else if(a)Zn("createLink",a);wt(o)}function Da(o,a){o.focus(),Zn("insertText",`\${${a}}`)}var La={$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 Ia=La.$defs,Hd=new Set(["pre"]),Fd=new Set(Object.entries(Ia).filter(([o,a])=>!Hd.has(o)&&(a.$inlineChildren?.length??0)>0).map(([o])=>o));function ja(o,a){return a?.[o.toLowerCase()]??Fd.has(o.toLowerCase())}var Vd={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Ze=Vd;function ho(o){Ze=o}var ne=null,Ne=null,Tt=null,nn=null,At=null,Xe=null,Me=!1,on="",rn=!1,Fa=null;function Va(o){Fa=o}function st(o){return ja(o.tagName,Fa)}function go(o,a,d,f){if(ne)Le(!0);if(ne=o,Ne=a,Tt=d.onCommit,nn=d.onSplit,At=d.onInsert,Xe=d.onEnd,Me=f?.plainText===!0,on=Me?o.textContent:"",rn=!1,o.dataset.jxActiveBlock="",Me){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",xo),o.addEventListener("input",yo),o.addEventListener("paste",bo)}function Le(o=!1){if(!ne)return;if(Ga(!1),Ze.dismiss(),delete ne.dataset.jxActiveBlock,Me)ne.contentEditable="false";if(ne.removeEventListener("keydown",xo),ne.removeEventListener("input",yo),ne.removeEventListener("paste",bo),ne=null,Ne=null,Tt=null,nn=null,At=null,Me=!1,on="",rn=!1,o)Xe=null;else if(Xe){let a=Xe;Xe=null,a()}}function Wa(){Ga(!0)}function Ba(){return Me&&ne!==null}function ke(){return ne!==null}function Ct(){return ne}function Ka(){return Ne}function Ua(){return Ze.isOpen()}function xo(o){if(Me){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),ne)ne.textContent=on;Le();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Le();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function yo(){if(Ze.isOpen())Eo()}function bo(o){o.preventDefault();let a=o.clipboardData?.getData("text/plain")??"";Zn("insertText",a)}function qa(){if(!nn||!ne||!Ne)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let a=o.getRangeAt(0),d=document.createRange();d.setStart(ne,0),d.setEnd(a.startContainer,a.startOffset);let f=document.createRange();f.setStart(a.endContainer,a.endOffset),f.setEnd(ne,ne.childNodes.length);let p=Ha(d.cloneContents()),m=Ha(f.cloneContents()),g=[...Ne],h=nn;return za(),h(g,p,m),!0}function za(){if(!ne)return;if(delete ne.dataset.jxActiveBlock,Me)ne.contentEditable="false";if(ne.removeEventListener("keydown",xo),ne.removeEventListener("input",yo),ne.removeEventListener("paste",bo),ne=null,Ne=null,Tt=null,nn=null,At=null,Me=!1,on="",rn=!1,Xe){let o=Xe;Xe=null,o()}}function Ga(o){if(!Tt||!ne||!Ne)return;if(Me){let d=ne.textContent.replaceAll(`
|
|
314
314
|
`," ");if(d===on.replaceAll(`
|
|
315
|
-
`," ")&&!rn)return;rn=!0,Tt(Ne,null,d,o);return}wt(ne);let a=
|
|
316
|
-
`))requestAnimationFrame(()=>So())}function Eo(){if(!ne||!Qn)return;let o=window.getSelection();if(!o||!o.rangeCount){Ze.dismiss();return}let a=o.getRangeAt(0),d=er(a),f=d.lastIndexOf("/");if(f===-1||d.length<Ga-1){Ze.dismiss();return}let p=d.slice(f+1).toLowerCase();Ze.show(ne,p,{onSelect:Xa})}function Xa(o){if(!ne||!At||!Ne)return;let a=Qn?window.getSelection():null;if(a&&a.rangeCount){let m=a.getRangeAt(0),h=er(m).lastIndexOf("/");if(h!==-1){let y=document.createTreeWalker(ne,NodeFilter.SHOW_TEXT),E=0,A=null,T=0;while(y.nextNode()){let C=y.currentNode;if(E+C.length>h){A=C,T=h-E;break}E+=C.length}if(A){let C=document.createRange();C.setStart(A,T),C.setEnd(m.startContainer,m.startOffset),C.deleteContents()}}}wt(ne);let d=za(ne),f=[...Ne],p=At;Ua(),p(f,o,d)}function Wd(o,a){let{target:d}=o;return d===a||d===a.documentElement||d===a.body}function vo(o){let a=o instanceof Element?o:null;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function Qa(o,a){let d=Pe(o);return{path:ge(a),rect:{height:d.height,width:d.width,x:d.x,y:d.y}}}function Za(o){let a=vo(o instanceof Element?o:null);if(!a)return null;return Qa(a,a.dataset.jxPath)}function el(o){let a=o.checkVisibility;if(!t(a)||a.call(o,{checkVisibilityCSS:!0}))return!0;return dr(o)&&[...o.children].some((d)=>el(d))}function tl(o,a=document){let d=[],f=[];for(let p of o){let m=a.querySelector(ot(ae(p)));if(!m)continue;if(el(m)){let g=Pe(m);d.push({path:p,rect:{height:g.height,width:g.width,x:g.x,y:g.y}})}else f.push(p)}return{hidden:f,hits:d}}var Bd=new Set(["toggle","show","hide"]);function Kd(o){return Bd.has(o)}function Ud(o,a){if(!(o instanceof Element))return;let d=o.closest("[popovertarget]"),f=d?.getAttribute("popovertarget");if(!d||!f)return;let g=[...d.ownerDocument.querySelectorAll("[data-jx-popover]")].find((E)=>E.id===f)?.dataset.jxPath;if(!g)return;let h=d.getAttribute("popovertargetaction")??"toggle",y=Kd(h)?h:"toggle";a.post({action:y,kind:"popoverTargetClick",targetPath:ge(g)})}function qd(o,a){if(!(o instanceof Element))return;let d=o.closest("[data-jx-commandfor]"),f=d?.dataset.jxCommandfor,p=d?.getAttribute("command")?.trim().toLowerCase()??"";if(!d||!f||!p)return;let h=[...d.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((y)=>y.id===f)?.dataset.jxPath;if(!h)return;a.post({command:p,kind:"commandTargetClick",targetPath:ge(h)})}function nl(o,a=document,d){let f=null,p=null,m=d?.getGen?.()??0,g=()=>d?.getMode?.()==="preview",h=()=>{o.post({kind:"paneFocus"})},y=(M)=>{if(g()){if(M.target instanceof Element){let X=M.target.closest("a[href]")?.getAttribute("href");if(X&&!X.startsWith("#"))M.preventDefault(),o.post({href:X,kind:"previewNavigate"})}return}if(d?.getMode?.()==="stylebook"&&M.target instanceof Element&&M.target.closest("a"))M.preventDefault();let B=Za(M.target);if(B)o.post({additive:M.ctrlKey===!0||M.metaKey===!0,hit:B,kind:"hit"});Ud(M.target,o),qd(M.target,o)},E=(M)=>{if(g())return;let B=M?.dataset.jxPath??null;if(B===f)return;f=B,o.post({hit:M&&B?Qa(M,B):null,kind:"hover"})},A=()=>{let M=d?.getGen?.()??m;if(M!==m)m=M,p="none"},T=(M,B)=>{if(!d||d.getMode?.()==="stylebook"||g())return;A();let te=d.getShadowDoc(),X=vo(M instanceof Element?M:null),ce=X&&te?Ta(X,B,te):null,ee=Aa(ce);if(ee===p)return;p=ee,o.post({kind:"insertZones",zones:ce})},C=0,H=null,O=0,K=0,L=(M)=>a.defaultView?.requestAnimationFrame(M)??requestAnimationFrame(M),_=(M)=>a.defaultView?.cancelAnimationFrame(M)??cancelAnimationFrame(M),Y=()=>{C=0;let M=H;H=null,E(vo(M instanceof Element?M:null)),T(M,{x:O,y:K})},q=(M)=>{if(H=M.target,O=M.clientX,K=M.clientY,C)return;C=L(Y)},G=(M)=>{if(!Wd(M,a))return;if(E(null),d&&!g()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},U=(M)=>{if(g())return;let B=ke()?Ct():null;if(B&&M.target instanceof Node&&B.contains(M.target))return;let te=Za(M.target);if(!te)return;M.preventDefault(),o.post({kind:"contextMenu",path:te.path,x:M.clientX,y:M.clientY})};return a.addEventListener("pointerdown",h,!0),a.addEventListener("click",y,!0),a.addEventListener("pointermove",q,!0),a.addEventListener("pointerleave",G,!0),a.addEventListener("contextmenu",U,!0),()=>{if(C)_(C),C=0;a.removeEventListener("pointerdown",h,!0),a.removeEventListener("click",y,!0),a.removeEventListener("pointermove",q,!0),a.removeEventListener("pointerleave",G,!0),a.removeEventListener("contextmenu",U,!0)}}var zd=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),rl=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Gd=new Set([...rl,"button","dt","h1","h2","h3","h4","h5","h6","label","legend","p","pre","summary"]);function ol(o){return(u(o?.tagName)||"div").toLowerCase()}function Yd(o,a){let d=o.type==="block"?o.tag??"":ol(xe(a,o.path));return rl.has(d.toLowerCase())}function Xd(o,a){let d=null,f=o;while(f){let p=ge(f.dataset.jxPath??"");if(p.length===0)break;if(Gd.has(ol(xe(a,p))))d=f;f=il(f.parentElement)}return d}function il(o){let a=o;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function wo(o,a,d){let f=Xo(o,a,d);return il(f)}function To(o,a,d,f){let p=o.dataset.jxPath;if(p==null)return null;let m=ge(p);if(m.length===0){let H=[...o.children];if(H.length===0)return tr(f,m)?{edge:"inside",instruction:"make-child",referenceRect:Qe(o),targetPath:m}:null;return Zd(H,a,m,f)}if(!tr(f,m))return null;let g=Yd(f,d)?null:Xd(o,d);if(g){let H=ge(g.dataset.jxPath??"");if(!tr(f,H))return null;let O=Qe(g);return(O.height===0?0:(a-O.y)/O.height)<0.5?{edge:"top",instruction:"reorder-above",referenceRect:O,targetPath:H}:{edge:"bottom",instruction:"reorder-below",referenceRect:O,targetPath:H}}let h=xe(d,m),y=(u(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((H)=>n(H)),A=zd.has(y)||!E,T=Qe(o),C=T.height===0?0:(a-T.y)/T.height;if(A)return C<0.5?{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};if(C<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m};if(C>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:T,targetPath:m}}function Zd(o,a,d,f){let p=1/0,m="reorder-below",g=o.length-1;for(let y=0;y<o.length;y++){let E=Qe(o[y]),A=Math.abs(a-E.y),T=Math.abs(a-(E.y+E.height));if(A<p)p=A,m="reorder-above",g=y;if(T<p)p=T,m="reorder-below",g=y}let h=[...d,"children",g];if(!tr(f,h))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:Qe(o[g]),targetPath:h}}function tr(o,a){if(o.type!=="tree-node")return!0;let d=o.path;if(Sa(d,a))return!1;return!vt(d,a)}function Qe(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}var Qd=40,sl=12;function Ao(o,a,d=Qd){if(o<d)return-1;if(o>a-d)return 1;return 0}var Co=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),Po=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),al=new Set(["deleteByCut","deleteContent"]),ll=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),ef="format",tf=new Set(["insertParagraph","insertLineBreak"]);function cl(o){let{inputType:a,from:d,to:f}=o;if(a==="insertCompositionText"||a==="insertFromComposition")return{kind:"native"};if(a==="historyUndo"||a==="historyRedo")return{kind:"reject"};if(a.startsWith(ef))return{kind:"reject"};if(a==="insertFromDrop"||a==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return tf.has(a)?{kind:"reject"}:{kind:"native"};if(!d||!f)return{kind:"reject"};let p=Qt(d,f)&&d.offset===f.offset,m=!Qt(d,f);if(a==="insertParagraph")return{from:d,kind:"split",to:f};if(a==="insertLineBreak"&&!m)return{kind:"native"};if(p&&Co.has(a)&&o.atBlockStart)return{at:d,kind:"mergeBackward"};if(p&&Po.has(a)&&o.atBlockEnd)return{at:d,kind:"mergeForward"};if(m){if(ll.has(a)||a==="insertLineBreak")return{from:d,kind:"replaceRange",text:o.data,to:f};if(Co.has(a)||Po.has(a)||al.has(a))return{from:d,kind:"replaceRange",text:"",to:f};return{kind:"reject"}}if(ll.has(a)||Co.has(a)||Po.has(a)||al.has(a))return{kind:"native"};return{kind:"native"}}var nf=500;function nr(o,a){let d=o.ownerDocument.getSelection();if(!d||d.rangeCount===0||!d.anchorNode||!d.focusNode)return null;if(!o.contains(d.anchorNode)||!o.contains(d.focusNode))return null;let f=Zt(d.anchorNode,d.anchorOffset,a),p=Zt(d.focusNode,d.focusOffset,a);return f&&p?{anchor:f,head:p}:null}function sn(o,a){let d=oo(o,a.anchor),f=oo(o,a.head)??d;if(!d)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(m),f&&f!==d)p.extend(f.node,f.offset);return!0}function ul(o){return"dataset"in o}function dl(o,a){let d=o.ownerDocument,f=null,p=null,m=()=>{let U=a.getMode?.();return U===void 0||U==="design"||U==="edit"},g=null,h=()=>{if(g!==null)clearTimeout(g),g=null},y=()=>{if(g=null,!f||!a.onCommitTick)return;let U=nr(o,a.isEditableBlock);if(a.onCommitTick(),U)sn(o,U)},E=!1,A=()=>{if(!a.onCommitTick||!f||E)return;h(),g=setTimeout(y,a.commitDelayMs??nf)},T=()=>{E=!0,h()},C=()=>{E=!1,A()},H=()=>{h(),f=null,p=null},O=()=>{if(!f)return;h(),f=null,p=null,a.onDeactivate()},K=()=>{if(!m()){O();return}let M=d.getSelection()?.focusNode??null;if(!M)return;if(!o.contains(M)){O();return}let B=Bn(M,a.isEditableBlock);if(!B){if(f?.contains(M)){a.onSelectionChange?.();return}O();return}let te=ae(B.path);if(te===p){a.onSelectionChange?.();return}O(),f=B.el,p=te,a.onActivate(B.el,B.path)},L=(U)=>{let[M]=t(U.getTargetRanges)?U.getTargetRanges():[],B=d.getSelection(),te=B&&B.rangeCount>0&&(B.isCollapsed||!M),X,ce,ee,re;if(te)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:re}=B.getRangeAt(0));else if(M)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:re}=M);else return null;let Ee=Zt(X,ce,a.isEditableBlock),V=Zt(ee,re,a.isEditableBlock),N=Bn(ee,a.isEditableBlock);return Ee&&V&&N?{endEl:N.el,from:Ee,to:V}:null},_=(U)=>{if(!m())return;let M=L(U),B=cl({atBlockEnd:M?M.to.offset>=ro(M.endEl):!1,atBlockStart:M?sa(M.from):!1,data:U.data??"",from:M?.from??null,inPropHost:f!==null&&p===null,inputType:U.inputType,to:M?.to??null});switch(B.kind){case"native":return;case"split":{if(U.preventDefault(),!Qt(B.from,B.to)&&!a.onReplaceRange)return;a.onSplit?.();return}case"mergeBackward":{U.preventDefault(),a.onMergeBackward?.(B.at);return}case"mergeForward":{U.preventDefault(),a.onMergeForward?.(B.at);return}case"replaceRange":{U.preventDefault(),a.onReplaceRange?.(B.from,B.to,B.text);return}default:U.preventDefault()}},Y=(U)=>{if(!m())return;let M=U.target instanceof Element?U.target:null,B=a.onPropActivate?M:null;while(B&&B!==o){if(ul(B)&&B.dataset.jxBoundProp&&a.onPropActivate){let te=B;if(te!==f){if(O(),a.onPropActivate(te))f=te,p=null}return}if(ul(B)&&B.dataset.jxPath)break;B=B.parentElement}if(M?.closest("[contenteditable]")?.getAttribute("contenteditable")==="false")d.getSelection()?.removeAllRanges()},q=(U)=>{U.preventDefault()},G=()=>A();return d.addEventListener("selectionchange",K),o.addEventListener("beforeinput",_),o.addEventListener("input",G),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",C),o.addEventListener("dragstart",q),d.addEventListener("pointerdown",Y,!0),{capture:()=>nr(o,a.isEditableBlock),forget:H,isComposing:()=>E,flush:()=>{if(E)return;if(g!==null)h(),y()},placeCaret:(U)=>{let M=sn(o,{anchor:U,head:U});if(M)K();return M},restore:(U)=>{let M=sn(o,U);if(M)K();return M},stop:()=>{d.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",_),o.removeEventListener("input",G),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",C),o.removeEventListener("dragstart",q),d.removeEventListener("pointerdown",Y,!0),O()},sync:K}}function Ve(o){return n(o)}function Pt(o){if(Array.isArray(o))return o.map((d)=>Pt(d));if(!l(o))return o;let a={};for(let[d,f]of Object.entries(o)){if(d.startsWith("on")&&Z(f))continue;if(d==="children")a.children=Array.isArray(f)?f.map((p)=>Pt(p)):Pt(f);else if(d==="cases"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f))p[m]=Pt(g);a.cases=p}else if(d==="state"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f)){if(s(g)&&g.timing==="server")continue;p[m]=g}a.state=p}else a[d]=f}return a}var rf=new Set(["img","video","source","iframe","audio"]),fl="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",of="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var sf=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function pl(o){return sf.test(o)}var af=/(?<![\w$.])(?:item|index|\$map)\b/u;function We(o){if(e(o))return o.includes("${")&&af.test(o);return l(o)&&e(o.$ref)&&/^(?:#\/)?\$map\//u.test(o.$ref)}function rr(o,a){if(o==="href"||o==="action")return"";if(pl(o))return of;if(e(a))return an(a);return l(a)&&e(a.$ref)?vl(a.$ref):""}var lf=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"]),cf=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),ml=["empty-text-placeholder","empty-container-placeholder"],uf=["width","height","inlineSize","blockSize"];function df(o){let{style:a}=o;if(!n(a))return!1;return uf.some((d)=>{let f=a[d],p=i(f)?String(f):e(f)?f.trim():"";return p!==""&&p!=="auto"})}function Ro(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(df(o))return null;if(lf.has(u(o.tagName)))return"empty-text-placeholder";if(cf.has(u(o.tagName)))return"empty-container-placeholder";return null}function an(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function hl(o){let a=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(a.nextNode()){let d=a.currentNode;if(d.data.includes("❪"))d.data=d.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function ff(o,a){let d=o.map;return{children:n(d)?[et(d,yl(o.items,a))]:[],className:"repeater-perimeter",tagName:"div"}}function gl(o){return JSON.stringify(o)}function xl(o){let a=o.startsWith("#/")?o.slice(2):o,[d,...f]=a.split("/"),p=d==="state"||d==="$map"?d:null;if(p===null)return null;let m=f.map((g)=>g.replaceAll("~1","/").replaceAll("~0","~"));return p+m.map((g)=>`?.[${gl(g)}]`).join("")}function No(o,a){if(a===null)return`(${o})`;return`((r) => ((item, index, $map) => (${o}))(r, 0, { index: 0, item: r }))(${a})`}function yl(o,a){if(Array.isArray(o))return`${gl(o)}[0]`;if(r(o)){let f=xl(o.$ref);return f===null?null:`${No(f,a)}?.[0]`}let d=e(o)?bl(o):[];if(e(o)&&d.length===1&&pf(o,d[0]))return`${No(d[0].expr,a)}?.[0]`;return null}function pf(o,a){return a.start===0&&a.end===o.length-1}function bl(o){let a=[],d=o.indexOf("${");while(d!==-1){let f=0,p=-1;for(let m=d+1;m<o.length;m+=1)if(o[m]==="{")f+=1;else if(o[m]==="}"){if(f-=1,f===0){p=m;break}}if(p===-1)break;a.push({end:p,expr:o.slice(d+2,p),start:d}),d=o.indexOf("${",p+1)}return a}function Sl(o,a=null){let d=bl(o);if(d.length===0)return o;let f="",p=0;for(let{start:m,end:g,expr:h}of d)f+=o.slice(p,m),f+=`\${(() => { try { return ${No(h,a)}; } catch { return ""; } })()}`,p=g+1;return f+o.slice(p)}function mf(o,a){let d=o.startsWith("#/")?o.slice(2):o;if(d!=="$map"&&!d.startsWith("$map/"))return{$ref:o};let f=xl(o);return a===null||f===null?void 0:Sl(`\${${f}}`,a)}function El(o,a){let d=o,f=null;for(let p of a){if(Array.isArray(d)){d=i(p)?d[p]:void 0;continue}if(!l(d))return f;if(p==="map"&&d.$prototype==="Array")f=yl(d.items,f);d=e(p)?d[p]:void 0}return f}function vl(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function wl(o,a=null){return et(o,a)}function et(o,a){if(Array.isArray(o))return o.map((h)=>et(h,a));if(!l(o))return o;if(o.$prototype==="Array")return ff(o,a);let d=o,f={},p=!1,m=e(d.tagName)&&rf.has(d.tagName);if(m){let{attributes:h,src:y}=d,E=h?.src,A=d.poster,T=h?.poster;if(!(y&&y!==""||E&&E!=="")&&!(A&&A!==""||T&&T!==""))p=!0}for(let[h,y]of Object.entries(d))if(h==="state"||h==="$media"||h==="$elements")f[h]=y;else if(h==="$props"&&Ve(y)){let E={};for(let[A,T]of Object.entries(y))if(!We(T))E[A]=T;else if(e(T))E[A]=pl(A)||A==="href"||A==="action"?rr(A,T):Sl(T,a);else if(r(T)){let C=mf(T.$ref,a);if(C!==void 0)E[A]=C}else E[A]=T;f[h]=E}else if(h==="children")if(Array.isArray(y))f.children=y.map((E)=>et(E,a));else if(l(y)&&y.$prototype==="Array")f.children=[et(y,a)];else f.children=et(y,a);else if(h==="cases"&&d.$switch&&Ve(y)){let[E]=Object.entries(y);if(E){let[,A]=E;f.children=Ve(A)&&!(l(A)&&A.$ref)?[et(A,a)]:[{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: ${Object.keys(y).join(" | ")}]`}]}}else if(h==="attributes"&&m&&Ve(y)){let E={};for(let[A,T]of Object.entries(y))if((A==="src"||A==="poster")&&(T===""||T==null||We(T)))p=!0,E[A]=fl;else E[A]=We(T)?rr(A,T):T;f.attributes=E}else if(h==="attributes"&&Ve(y)){let E={};for(let[A,T]of Object.entries(y))E[A]=We(T)?rr(A,T):T;f.attributes=E}else if(h==="style")if(Ve(y)){let E={};for(let[A,T]of Object.entries(y))if(!We(T))E[A]=T;f.style=E}else f.style=y;else if(h==="$switch"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&l(y)&&y.$ref)f[h]=vl(y.$ref);else if(m&&(h==="src"||h==="poster"))if(y===""||y==null||We(y))p=!0,f[h]=fl;else f[h]=y;else if(We(y))f[h]=rr(h,y);else if(e(y)||l(y)&&y.$ref)f[h]=y;else f[h]=et(y,a);let g=Ro(f);if(g)f.className=f.className?`${f.className} ${g}`:g;if(p){let h=e(f.className)?f.className:"";if(!h.includes("empty-media-placeholder"))f.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return f}var hf={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},$o=globalThis,gf=["strong","em","u","del","sub","sup","code"],or="jx-pending-format",Tl="jx-pending-format-style";function xf(o){let a=o.parentElement;while(a){if(a.tagName.includes("-"))return a;a=a.parentElement}return null}function yf(o,a){if(!o)return!1;let d=o.attributes;if(d){if(d[`props.${a}`]!==void 0)return!0;let f=new Set([a.toLowerCase(),Tn(a).toLowerCase()]);for(let m of Object.keys(d))if(d[m]!==void 0&&f.has(m.toLowerCase()))return!0;let p=d["data-jx-props"];if(e(p)&&bf(p,a))return!0}if(Gt.has(a)||a.startsWith("$"))return!1;return o[a]!==void 0}function bf(o,a){try{let d=JSON.parse(o);return n(d)&&a in d}catch{return!1}}function Al(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Sf(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function Cl(o,a,d){let f=a.ownerDocument,p=()=>{let V=d?.getMode?.();return V===void 0||V==="design"||V==="edit"},m=null,g=0,h=(V)=>{let N=window.getSelection();if(!N||!N.rangeCount)return null;let z=N.getRangeAt(0);return V.contains(z.commonAncestorContainer)?z:null},y=()=>{let V=Ct();if(!V)return;let N=h(V);if(N&&!N.collapsed)m=N.cloneRange()},E=()=>{if(f.querySelector(`#${Tl}`))return;let V=f.createElement("style");V.id=Tl,V.textContent=`::highlight(${or}) { background-color: Highlight; color: HighlightText; }`,f.head.append(V)},A=()=>{let V=$o.Highlight,N=$o.CSS?.highlights;if(!V||!N)return;if(m&&m.startContainer.isConnected)E(),N.set(or,new V(m.cloneRange()));else N.delete(or)},T=()=>{$o.CSS?.highlights?.delete(or)},C=()=>{let V=Ct();if(!V||!V.dataset.jxPath)return null;let N=h(V),z=N??m,Q=z?Sf(Yo(z)):null,de=N?N.collapsed:!0,_e=gf.filter((Ce)=>Na(Ce,V)),ye=Ma(V);if(ye.active)_e.push("a");return g+=1,{activeTags:_e,collapsed:de,kind:"selectionChanged",link:ye,localScope:null,path:ge(V.dataset.jxPath),rect:Q,seq:g}},H=()=>{if(!ke())return;y(),A();let V=C();if(V)o.post(V)},O=!1,K=(V,N)=>{hl(V),o.post({kind:"editStart",path:N}),ho(V,N,{onCommit:(z,Q,de,_e)=>{O=!1;let ye={children:Q,kind:"editCommit",path:z,textContent:de};if(_e)ye.inPlace=!0;o.post(ye)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(z,Q,de)=>o.post({cmd:Q,commitData:de,kind:"editInsert",path:z}),onSplit:(z,Q,de)=>o.post({after:de,before:Q,kind:"editSplit",path:z})}),y(),H()},L=(V,N)=>{let z=d?.getShadowDoc?.();if(!z)return!0;let Q=xe(z,V);if(yf(Q,N))return!1;let de=Q?.$props?.[N];if(de==null)return!0;if(!e(de))return!1;return!de.includes("${")},_=(V,N,z)=>{o.post({kind:"editStart",path:N,prop:z}),ho(V,N,{onCommit:(Q,de,_e,ye)=>{O=!1;let Ce={kind:"editCommitProp",path:Q,prop:z,value:_e??""};if(ye)Ce.inPlace=!0;o.post(Ce)},onEnd:()=>{T(),m=null,X.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},Y=(V)=>{let N=Ct();if(!N)return;if(Va())return;if(m&&m.startContainer.isConnected&&N.contains(m.commonAncestorContainer)){let z=window.getSelection();N.focus(),z?.removeAllRanges(),z?.addRange(m)}if(V.command==="link")ka(N,V.href);else if(V.command==="insertData")_a(N,V.token);else{let z=hf[V.command];if(z)Ra(z,N)}y(),H()},q=(V)=>{let N=V.dataset.jxBoundProp,z=xf(V),Q=z?.dataset.jxPath;if(!N||!z||!Q)return!1;let de=ge(Q);if(!L(de,N))return!1;return _(V,de,N),!0},G=(V,N)=>{let z=aa(a,V,N,it);if(!z)return!1;let[Q,de]=N===-1?[V,z.path]:[z.path,V];return X.flush(),o.post({fromPath:Q,intoPath:de,kind:"editMerge"}),!0},U=(V,N,z)=>{let Q=io(a,it),de=ae(V.path),_e=ae(N.path),ye=Q.findIndex((Be)=>Be.dataset.jxPath===de),Ce=Q.findIndex((Be)=>Be.dataset.jxPath===_e);if(ye===-1||Ce===-1||Ce<=ye)return!1;let cn=Q.slice(ye+1,Ce).map((Be)=>ge(Be.dataset.jxPath));return X.flush(),o.post({between:cn,from:V,kind:"editRangeReplace",text:z,to:N}),!0},M=()=>y(),B=()=>y(),te=()=>y(),X=dl(a,{getMode:()=>d?.getMode?.()??"edit",isEditableBlock:it,onActivate:(V,N)=>K(V,N),onDeactivate:()=>{if(ke())Le()},onCommitTick:()=>Fa(),onMergeBackward:(V)=>G(V.path,-1),onMergeForward:(V)=>G(V.path,1),onReplaceRange:(V,N,z)=>U(V,N,z),onPropActivate:q,onSelectionChange:()=>H(),onSplit:()=>Ka()}),ce=(V)=>Ya(V),ee=()=>{if(Ba())Eo()},re=()=>{if(!O)O=!0,o.post({kind:"editInput"})};a.addEventListener("input",re),a.addEventListener("keydown",ce),a.addEventListener("input",ee),f.addEventListener("mouseup",M,!0),f.addEventListener("keyup",B,!0),f.addEventListener("blur",te,!0);let Ee=o.onMessage((V)=>{if(V.kind==="applyFormat"){Y(V.intent);return}if(V.kind==="openSlash"){So({anchored:!1});return}if(V.kind==="flushEdits"){X.flush(),o.post({kind:"flushComplete",reqId:V.reqId});return}if(V.kind==="endEdit"){if(ke())Le();return}if(V.kind!=="enterEdit")return;if(!p())return;if(V.prop!==void 0){let Q=Al(a,V.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(V.prop)}"]`);if(Q)q(Q);return}let N=Al(a,V.path);if(N&&it(N))X.placeCaret({offset:V.offset??0,path:V.path})});return()=>{if(a.removeEventListener("keydown",ce),a.removeEventListener("input",ee),a.removeEventListener("input",re),f.removeEventListener("mouseup",M,!0),f.removeEventListener("keyup",B,!0),f.removeEventListener("blur",te,!0),X.stop(),Ee(),T(),m=null,ke())Le()}}var Ef=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function vf(o){return Ef.has(o)}function Pl(o,a){let d=!1,f=null,p=null,m={dismiss:()=>{if(!d)return;d=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>d,show:(E,A,T)=>{if({onSelect:f}=T,d&&A===p)return;d=!0,p=A;let C=Pe(E),H={filter:A,kind:"slashShow",rect:{height:C.height,width:C.width,x:C.left,y:C.top}};if(T.showFilter===!0)H.showFilter=!0;o.post(H)}};mo(m);let g=(E)=>{if(!d||!vf(E.key))return;E.preventDefault(),E.stopPropagation(),o.post({key:E.key,kind:"slashNav"})},h=()=>{if(d)m.dismiss()};a.addEventListener("keydown",g,!0),a.addEventListener("mousedown",h,!0);let y=o.onMessage((E)=>{if(E.kind==="slashSelect"){d=!1,p=null,f?.({...E.cmd});return}if(E.kind==="slashDismissed")d=!1,p=null});return()=>{a.removeEventListener("keydown",g,!0),a.removeEventListener("mousedown",h,!0),y(),mo({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var Nl=["global","canvas","caret","grid","code","dock","palette"];var Rh={"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 wf=["mod","ctrl","alt","shift"],Tf=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),Af=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function Cf(o){return[...wf.filter((d)=>o[d]),o.key].join("+")}function Pf(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function Rl(o,a){let d=Pf(o.code)??o.key.toLowerCase();if(Tf.has(d))return"";let f={mod:a?o.metaKey:o.ctrlKey,ctrl:a?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:Af.get(d)??d};return Cf(f)}var kh=["global",...Nl.filter((o)=>o!=="global"&&o!=="palette")];var Nf=["caret","global"],Rf=["canvas","global"],$f=["global"],ir={chords:[],mac:!1};function Of(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function Mf(o,a){if(o)return Nf;return a==="preview"?$f:Rf}function kf(o,a=ir,d=!1,f="design"){if(Of(o.target))return!1;let p=Rl(o,a.mac);if(!p)return!1;let m=Mf(d,f);return a.chords.some((g)=>g.chord===p&&m.includes(g.scope))}function _f(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function $l(o,a=document,d=()=>!1,f=()=>ir,p=()=>"design"){let m=(g)=>{if(!kf(g,f(),d(),p()))return;g.preventDefault(),o.post({event:_f(g),kind:"forwardKey"})};return a.addEventListener("keydown",m,!0),()=>a.removeEventListener("keydown",m,!0)}var Oo=new WeakMap,sr=new Set;function Mo(o,a,d){let f=xe(o,a);if(f===void 0)throw Error(`iframe-patch-node-not-found:${a.join("/")}`);let p=e(f)?f:wl(Pt(f),El(o,a)),{result:m,stop:g}=bt(()=>Oe(p,d.defs,{_path:Df(a,d),onNodeCreated:co(d.mapperCtx)}));if(sr.add(g),m instanceof HTMLElement)Oo.set(m,g);return m}function ko(o){let a=[o,...o.querySelectorAll("*")];for(let d of a){if(!(d instanceof HTMLElement))continue;Mn(d);let f=Oo.get(d);if(f)f(),sr.delete(f),Oo.delete(d)}}function Ol(){for(let o of sr)o();sr.clear()}function Df(o,a){let{mapperCtx:d}=a;if(d.layoutWrapped&&d.pageContentPrefix&&o[0]==="children"){let[,f]=o;return i(f)?[...d.pageContentPrefix,f+(d.pageContentOffset??0),...o.slice(2)]:[...d.pageContentPrefix,...o.slice(1)]}return o}function _l(o,a,d,f,p){for(let g of a)fo(o,g);if(!p?.length){for(let g of a)Ml(o,g,d,f);return}let m=new Set(p.map((g)=>ae(g)));for(let g of a){if(g.op==="set-key"&&m.has(ae(g.path))){Jf(o,g.path,d);continue}Ml(o,g,d,f)}}function Jf(o,a,d){let f=Ll(d,a);if(f)Nt(f,xe(o,a))}function _o(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function Ml(o,a,d,f){switch(a.op){case"set-key":{if(a.key==="style"){Ff(o,a.path,d,f);return}if(a.key==="textContent"){Vf(o,a.path,d);return}if(a.key.startsWith("on"))return;kl(o,a.path,d,_o(f));return}case"insert-child":{Lf(o,a.parentPath,a.index,d,_o(f));return}case"set-child":{kl(o,[...a.parentPath,"children",a.index],d,_o(f));return}case"remove-child":{If(o,a.parentPath,a.index,d);return}case"move-child":{jf(o,a.fromParentPath,a.fromIndex,a.toParentPath,a.toIndex,d);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(a)}`)}}function Lf(o,a,d,f,p){let m=st(f,a),g=xe(o,a),h=Mo(o,[...a,"children",d],p);ar(f,a,d,1),Dl(m,h,Jl(m,g,d)),Nt(m,g)}function kl(o,a,d,f){let p=st(d,a),m=Mo(o,a,f);ko(p),p.replaceWith(m)}function If(o,a,d,f){let p=st(f,[...a,"children",d]),m=p.parentElement;if(ko(p),p.remove(),ar(f,a,d+1,-1),m)Nt(m,xe(o,a))}function jf(o,a,d,f,p,m){let g=[...a,"children",d],h=st(m,g),y=h.parentElement,E=st(m,f);h.remove(),ar(m,a,d+1,-1);let A=lr(E)??f;ar(m,A,p,1),Hf(h,g,[...A,"children",p]);let T=xe(o,A);if(Dl(E,h,Jl(E,T,p)),y)Nt(y,xe(o,lr(y)??a));Nt(E,T)}function Nt(o,a){for(let f of ml)o.classList.remove(f);let d=a?Ro(a):null;if(d)o.classList.add(d)}function Dl(o,a,d){if(d)d.before(a);else o.append(a)}function Jl(o,a,d){let f=a?.textContent,p=f!=null&&String(f)!==""?1:0;return o.childNodes[p+d]??null}function ar(o,a,d,f){let p=a.length;for(let m of o.querySelectorAll("[data-jx-path]")){let g=lr(m);if(!g||g.length<p+2||g[p]!=="children")continue;let h=g[p+1];if(!i(h)||h<d)continue;if(!a.every((E,A)=>g[A]===E))continue;let y=[...g];y[p+1]=h+f,m.dataset.jxPath=ae(y)}}function Hf(o,a,d){let f=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of f){let m=lr(p);if(!m||m.length<a.length||!a.every((g,h)=>m[h]===g))continue;p.dataset.jxPath=ae([...d,...m.slice(a.length)])}}function lr(o){let a=o.dataset.jxPath;return a===void 0?null:ge(a)}function Ff(o,a,d,f){let p=st(d,a),m=xe(o,a),g=f?.defs.$media??{};Vn(p,Wf(m?.style),g,f?.defs??{})}function Vf(o,a,d){let f=st(d,a),p=xe(o,a);f.textContent=Bf(p),Nt(f,p)}function st(o,a){let d=Ll(o,a);if(!d)throw Error(`iframe-patch-element-not-found:${ae(a)}`);return d}function Ll(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Wf(o){if(!o||!n(o))return;let a={};for(let[d,f]of Object.entries(o)){if(We(f))continue;a[d]=f}return a}function Bf(o){let a=o?.textContent;if(a==null)return"";if(e(a))return a.includes("${")?an(a):a;if(n(a)&&a.$ref){let d=String(a.$ref);return`{${d.startsWith("#/state/")?d.slice(8):d}}`}return String(a)}function Il(o){if(o===void 0)return"undefined";let a;try{a=JSON.stringify(o)??"undefined"}catch{a=String(o)}if(a.length>48)a=`${a.slice(0,47)}…`;return a}function Kf(o){return s(o)&&"$expression"in o&&Array.isArray(o.parameters)}function Uf(o){try{return structuredClone(o)}catch{return null}}function qf(o,a){let d={};for(let f of Object.keys(o))try{let p=o[f];if(t(p)){if(Kf(a?.[f]))d[f]=p;continue}let m=JSON.stringify(p);d[f]=m===void 0?null:JSON.parse(m)}catch{d[f]=null}return d}function zf(o,a,d){if(!d||d.length===0)return o;let f=a,p=o;for(let m of d){if(!n(f))break;let g=f;if(g.$prototype==="Array"&&m==="map"){let h=g.items,y=r(h)?Se(h.$ref,p):h;if(Array.isArray(y)&&y.length>0){let[E]=y,A=Uf(E),T=Object.create(p);T.$map={index:0,item:A},T["$map/item"]=A,T["$map/index"]=0,p=T}}f=g[m]}return p}function jl(o,a,d,f){let p=d?.state??null;return o.map(({id:m,node:g})=>{let h=new Map,y;try{y=zf(qf(a,p),d,f)}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[]}}try{if(!n(g)||!("operator"in g))throw Error("not an expression node");return Ae(g,y,null,void 0,{report:(E,A)=>{h.set(E.join("/"),Il(A))}}),{id:m,values:[...h.entries()]}}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[...h.entries()]}}})}var Gf=256000,Yf="[large value omitted]";function Hl(o){let a={};for(let d of Object.keys(o))try{let f=o[d];if(t(f))continue;let p=JSON.stringify(f);if(p===void 0){a[d]=null;continue}if(p.length>Gf){a[d]=Yf;continue}a[d]=JSON.parse(p)}catch{a[d]=null}return a}function Fl(o,a){return new URL(`/node_modules/${o}`,a).href}var Vl={"jx-ui:/behaviors/color-area.ts":()=>(me("vh9cew51"),import("./chunks/color-area-vh9cew51.js")),"jx-ui:/behaviors/color-field.ts":()=>(me("e78f16bs"),import("./chunks/color-field-e78f16bs.js")),"jx-ui:/behaviors/color-slider.ts":()=>(me("fg4yhvk6"),import("./chunks/color-slider-fg4yhvk6.js")),"jx-ui:/behaviors/combobox.ts":()=>(me("6hs00996"),import("./chunks/combobox-6hs00996.js")),"jx-ui:/behaviors/dialog.ts":()=>(me("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(me("7gka1h86"),import("./chunks/listbox-7gka1h86.js")),"jx-ui:/behaviors/menu.ts":()=>(me("d2jxpgma"),import("./chunks/menu-d2jxpgma.js")),"jx-ui:/behaviors/number-field.ts":()=>(me("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(me("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(me("9tf4cjrk"),import("./chunks/popover-9tf4cjrk.js")),"jx-ui:/behaviors/select.ts":()=>(me("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(me("m5rwn31z"),import("./chunks/split-m5rwn31z.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(me("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(me("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(me("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(me("j0ebwr5s"),import("./chunks/tree-j0ebwr5s.js")),"jx-ui:/behaviors/tooltip.ts":()=>(me("dj1pvgz7"),import("./chunks/tooltip-dj1pvgz7.js")),"jx-ui:/behaviors/textfield.ts":()=>(me("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(me("1gv0h53h"),import("./chunks/toast-1gv0h53h.js")),"jx-ui:/behaviors/toast-host.ts":()=>(me("1yg5ar8d"),import("./chunks/toast-host-1yg5ar8d.js")),"jx-ui:/color.ts":()=>(me("4gj49xq6"),import("./chunks/color-4gj49xq6.js")),"jx-ui:/icons.ts":()=>(me("853n6qt3"),import("./chunks/icons-853n6qt3.js"))};var Xf;function Wl(o){Xf=new URL("./",o).href}Wl(import.meta.url);for(let[o,a]of Object.entries(Vl))Hs(o,a);Is((o)=>Fl(o,location.href));function ln(o,a,d,f){let p=wo(o.x,o.y,f);if(!p)return null;return To(p,o.y,d,a)}function Do(o){return[...o.dataTransfer?.types??[]].includes("Files")}var Zf={type:"block"},Lo={},Jo=null;function Bl(o){return o?{...o,versions:Lo}:null}function Qf(o,a){let d=o.dataset.jxPath;if(d==null)return null;let f=ge(d),p=a?xe(a,f):void 0;return{path:f,rect:Qe(o),tagName:(u(p?.tagName)||o.tagName).toLowerCase()}}function ep(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let a=o.closest("[data-jx-layout-region]");if(!(a instanceof HTMLElement))return null;return{className:a.className,layoutFile:a.dataset.jxLayoutFile??"",layoutPath:ge(a.dataset.jxLayoutPath??"[]"),rect:Qe(a),tagName:a.tagName.toLowerCase()}}function Kl(o){let a=n(o)&&"message"in o?o.message:void 0;return String(a??o)}var tp=new Set(["style","textContent"]);function np(o){let a=Wa();if(!a)return!1;for(let d of o){let f;if(d.op==="set-key"){if(tp.has(d.key)||d.key.startsWith("on"))continue;f=d.path}else if(d.op==="move-child"){if(f=d.fromParentPath,vt(f,a)||vt(d.toParentPath,a))return!0;continue}else f=d.parentPath;if(vt(f,a))return!0}return!1}var rp=2,op=5000,ip=500;function sp(o){let{channel:a,container:d}=o;Lo={},Jo=null;let f=null,p=null,m=-1,g=ma(d.ownerDocument),h=null,y=-1,E="design",A=null,T=null,C=ir,H=null,O=null,K=-1,L=-1,_=0,Y=null,q=d.ownerDocument.defaultView;function G(){if(_&&q)q.cancelAnimationFrame(_);_=0,Y=null}function U(){_=0;let P=Y?.src??O;if(!q||!Y||!P||!h)return;let ie=Ao(Y.y,q.innerHeight);if(ie===0)return;let oe=q.scrollY;if(q.scrollBy(0,ie*sl),q.scrollY===oe)return;let ve=ln(Y,P,h,d.ownerDocument),se={dragSeq:Y.dragSeq,gen:Y.gen??K,kind:"dragOver",preview:ve};if(Y.withCursor)se.cursor={x:Y.x,y:Y.y};a.post(se),_=q.requestAnimationFrame(U)}function M(P,ie,oe){if(!q||Ao(P.y,q.innerHeight)===0){G();return}let ve={dragSeq:ie,withCursor:oe!=null,x:P.x,y:P.y};if(oe)ve.gen=oe.gen,ve.src=oe.src;if(Y=ve,!_)_=q.requestAnimationFrame(U)}let B=nl(a,d.ownerDocument,{getGen:()=>y,getMode:()=>E,getShadowDoc:()=>h}),te=(P)=>{if(E!=="design"&&E!=="edit")return;let ie=ep(P.target);if(ie)a.post({hit:ie,kind:"layoutHit"})};d.ownerDocument.addEventListener("click",te,!0);let X=$l(a,d.ownerDocument,ke,()=>C,()=>E),ce=Cl(a,d,{getMode:()=>E,getShadowDoc:()=>h}),ee=Pl(a,d.ownerDocument),re=ha(d),Ee=30000,V=-1;function N(){let P=d.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),ie=Pe(d),oe=0;for(let ve of P)oe=Math.max(oe,Pe(ve).bottom-ie.top);return oe}function z(){let P=Math.max(d.scrollHeight,N()),ie=Math.min(P,Ee);if(ie>0&&Math.abs(ie-V)>=1){V=ie;let oe=d.firstElementChild,ve=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;a.post({fragment:ve,height:ie,kind:"contentHeight"}),at()}}let Q=q?.ResizeObserver,de=Q?new Q(()=>z()):null,_e=d.ownerDocument,ye=0,Ce=0,cn=0,Be="",Rt=new Map;function Ul(){let P=Date.now();for(let[ie,oe]of Rt)if(oe<=P)Rt.delete(ie);return Rt.size}function ql(){let P=_e;return{animations:P.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:P.fonts?P.fonts.status==="loaded":!0,gen:y,images:Ul(),kind:"idle"}}function Io(){ye=0;let P=ql(),ie=`${P.gen}|${P.fonts}|${P.animations}|${P.images}`,oe=ie!==Be;if(oe)Be=ie,a.post(P);if(Ce=P.fonts&&P.animations===0&&P.images===0?oe?1:Ce+1:0,Ce>=rp){z();return}if(Date.now()>=cn)return;ye=q?q.requestAnimationFrame(Io):0}function at(){if(Ce=0,cn=Date.now()+op,!ye&&q)ye=q.requestAnimationFrame(Io)}let jo=(P)=>{if(P.target instanceof HTMLImageElement&&uo(P.target))Rt.set(P.target,Date.now()+ip),at()},Ho=(P)=>{if(P.target instanceof HTMLImageElement&&Rt.delete(P.target))at()};d.addEventListener("error",jo,!0),d.addEventListener("load",Ho,!0),at(),de?.observe(d);let Fo=(P)=>{if(E==="preview"){if(P.ctrlKey||P.metaKey)P.preventDefault();return}P.preventDefault(),a.post({ctrlKey:P.ctrlKey,deltaX:P.deltaX,deltaY:P.deltaY,kind:"forwardWheel",metaKey:P.metaKey,shiftKey:P.shiftKey,x:P.clientX,y:P.clientY})};d.ownerDocument.addEventListener("wheel",Fo,{passive:!1});let zl=300,Vo=0,Wo=(P,ie)=>{P.preventDefault(),P.stopPropagation();let oe={x:P.clientX,y:P.clientY},ve=d.ownerDocument,se=wo(oe.x,oe.y,ve),Re=se?Qf(se,h):null,dn=h&&se?To(se,oe.y,h,Zf):null;if(ie==="fileDragOver"){if(P.dataTransfer)P.dataTransfer.dropEffect="copy";a.post({hit:Re,kind:"fileDragOver",preview:dn});return}a.post({files:[...P.dataTransfer?.files??[]],hit:Re,kind:"fileDrop",preview:dn})},un=(P)=>{if(!O){if(Do(P)){Wo(P,"fileDragOver");return}let ve=Date.now();if(ve-Vo>=zl)Vo=ve,a.post({kind:"nativeDragEnter"});return}if(P.preventDefault(),P.dataTransfer)P.dataTransfer.dropEffect="move";let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,O,h,d.ownerDocument):null;a.post({cursor:ie,dragSeq:L,gen:K,kind:"dragOver",preview:oe}),M(ie,L)},Bo=(P)=>{if(!O){if(Do(P))Wo(P,"fileDrop");return}P.preventDefault();let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,O,h,d.ownerDocument):null;a.post({dragSeq:L,gen:K,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),O=null,K=-1,L=-1,G()},Ko=(P)=>{if(!O&&Do(P)&&!P.relatedTarget)a.post({kind:"fileDragLeave"})};d.ownerDocument.addEventListener("dragenter",un,!0),d.ownerDocument.addEventListener("dragover",un,!0),d.ownerDocument.addEventListener("dragleave",Ko,!0),d.ownerDocument.addEventListener("drop",Bo,!0);let Gl=a.onMessage((P)=>{if(P.kind==="measure"){let{hidden:se,hits:Re}=tl(P.paths,d.ownerDocument);a.post({hidden:se,hits:Re,kind:"geometry",reqId:P.reqId});return}if(P.kind==="evalExpr"){let se=P.gen===y&&H&&h?jl(P.exprs,H.defs,h,P.contextPath):[];a.post({gen:P.gen,kind:"evalResult",reqId:P.reqId,results:se});return}if(P.kind==="patch"){let{gen:se}=P;if(se<y){a.post({gen:se,kind:"patchError",message:"patch-behind-render"});return}if(se>y||!h||!H){a.post({gen:se,kind:"patchError",message:"patch-ahead-of-render"});return}let Re=new Set((P.echoPaths??[]).map((lt)=>ae(lt))),dn=Re.size===0?P.forwardOps:P.forwardOps.filter((lt)=>!(lt.op==="set-key"&&Re.has(ae(lt.path)))),Uo=ke()&&np(dn),qo=Uo?nr(d,it):null;if(Uo)Le();try{if(_l(h,P.forwardOps,d,H,P.echoPaths),en(d,A),Et(d,T),qo)sn(d,qo);a.post({gen:se,kind:"patchComplete"}),at()}catch(lt){a.post({gen:se,kind:"patchError",message:Kl(lt)})}return}if(P.kind==="styleUpdate"){if(P.gen!==y||!h)return;h.style=P.style;let se=d.firstElementChild;if(se instanceof HTMLElement)Vn(se,P.style,h.$media??{});return}if(P.kind==="dragStart"){O=P.src,K=P.gen,L=P.dragSeq;return}if(P.kind==="dragEnd"||P.kind==="dragCancel"){O=null,K=-1,L=-1,G();return}if(P.kind==="dragMove"){let se=O&&h?ln(P.cursor,O,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,kind:"dragOver",preview:se}),M(P.cursor,P.dragSeq);return}if(P.kind==="drop"){let se=O&&h?ln(P.cursor,O,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,instruction:se?.instruction??null,kind:"dropResult",targetPath:se?.targetPath??null}),O=null,K=-1,L=-1,G();return}if(P.kind==="assetVersions"){Lo=P.versions;let se=Bl(Jo);if(se)Jn((Re)=>Xt(Re,se));return}if(P.kind==="keymap"){C={chords:P.chords,mac:P.mac};return}if(P.kind==="setColorScheme"){lo(d.ownerDocument,P.scheme);return}if(P.kind==="setPopoverOpen"){if(E==="preview")return;A=P.path===null?null:ae(P.path),en(d,A),Et(d,T),z();return}if(P.kind==="setDialogOpen"){if(E==="preview")return;T=P.path===null?null:ae(P.path),Et(d,T),z();return}if(P.kind==="redefineElement"){Ys(P.doc,P.base);return}if(P.kind==="setLocale"){qn(d.ownerDocument,P.locale===null?null:{dir:P.dir,locale:P.locale},g);return}if(P.kind==="siteStyleUpdate"){ao(P.siteStyle,P.media);return}if(P.kind!=="render"||P.gen<m)return;if(lo(d.ownerDocument,P.colorScheme??null),qn(d.ownerDocument,P.locale??null,g),ke())Le();m=P.gen,Jo=P.assets??null,Ha(P.editableTags??null);let{gen:ie,mapperCtx:oe}=P,ve=P.shadowDoc;(async()=>{try{Ol(),p?.(),p=null,f?.dispose(),Ks(d.ownerDocument);let se={assets:Bl(P.assets??null),container:d,doc:P.doc,docBase:P.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:P.diffMarks??null,mode:P.mode,popoverOpen:P.popoverOpen?ae(P.popoverOpen):null,dialogOpen:P.dialogOpen?ae(P.dialogOpen):null,siteStyle:P.siteStyle};if(P.allowAutoRequests)se.allowAutoRequests=!0;if(f=await ga(se),ie===m){A=P.popoverOpen?ae(P.popoverOpen):null,T=P.dialogOpen?ae(P.dialogOpen):null,en(d,A),Et(d,T),h=ve,H=f.ctx,y=ie,E=P.mode,a.post({gen:ie,kind:"renderComplete"}),at();let{defs:Re}=f.ctx;p=Ts(()=>{try{a.post({gen:ie,kind:"dataScope",scope:Hl(Re)})}catch{}}),z()}}catch(se){a.post({gen:ie,kind:"renderError",message:Kl(se)})}})()});return a.post({kind:"ready"}),()=>{if(Gl(),qn(d.ownerDocument,null,g),B(),X(),ce(),ee(),re(),ye&&q)q.cancelAnimationFrame(ye);ye=0,d.removeEventListener("error",jo,!0),d.removeEventListener("load",Ho,!0),G(),de?.disconnect(),d.ownerDocument.removeEventListener("click",te,!0),d.ownerDocument.removeEventListener("wheel",Fo),d.ownerDocument.removeEventListener("dragenter",un,!0),d.ownerDocument.removeEventListener("dragleave",Ko,!0),d.ownerDocument.removeEventListener("dragover",un,!0),d.ownerDocument.removeEventListener("drop",Bo,!0),p?.(),f?.dispose()}}function ap(o){let a=new URLSearchParams(o.location.search);vs(a.get("rpcToken"));let d=a.get("parentOrigin"),f=d||"*";if(!d)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 p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,g=Go({acceptOrigin:f,source:o,target:o.parent,targetOrigin:f,token:a.get("token")||""});return sp({channel:g,container:m})}if(typeof window<"u"&&window.parent!==window)ap(window);export{rp as IDLE_QUIET_FRAMES,op as IDLE_WATCH_MAX_MS,ip as IMAGE_RETRY_WINDOW_MS,ap as bootCanvasIframe,Qf as fileDropHitFor,Do as isExternalFileDrag,ep as layoutHitFor,np as patchDisturbsActiveEdit,sp as startCanvasIframe};
|
|
315
|
+
`," ")&&!rn)return;rn=!0,Tt(Ne,null,d,o);return}wt(ne);let a=Ya(ne);Tt(Ne,a.children??null,a.textContent??null,o)}function Wd(o){if(!Array.isArray(o.children)||o.children.length===0)return{textContent:""};let a=[];for(let d of o.children){let f=a.at(-1);if(e(d)&&e(f))a[a.length-1]=f+d;else a.push(d)}if(a.every((d)=>e(d)))return{textContent:a.join("")};return{children:a}}function Ya(o){let a=o.childNodes;if(a.length===0)return{textContent:""};if(a.length===1&&a[0].nodeType===Node.TEXT_NODE)return{textContent:a[0].textContent};let d=[];for(let f of a){let p=So(f);if(p!==null)d.push(p)}return Wd({children:d})}function Bd(o){return o.nodeType===Node.ELEMENT_NODE&&"dataset"in o}var Kd=new Map([["b","strong"],["i","em"],["s","del"],["strike","del"]]);function So(o){if(o.nodeType===Node.TEXT_NODE){let h=o.textContent;if(!h)return null;return h}if(!Bd(o))return null;let a=o,d=a.tagName.toLowerCase(),f={tagName:d},p=Kd.get(d);if(p)f.tagName=p;let m=a.dataset.jxHref??a.getAttribute("href");if(d==="a"&&m!=null){if(f.attributes={href:m},"title"in a&&e(a.title)&&a.title)f.attributes.title=a.title}if(d==="code")return f.textContent=a.textContent,f;let{childNodes:g}=a;if(g.length===0)f.textContent="";else if(g.length===1&&g[0].nodeType===Node.TEXT_NODE)f.textContent=g[0].textContent;else{f.children=[];for(let h of g){let y=So(h);if(y)f.children.push(y)}}return f}function Ha(o){let a=o.childNodes;if(a.length===0)return{textContent:""};if(a.length===1&&a[0].nodeType===Node.TEXT_NODE)return{textContent:a[0].textContent};let d=[];for(let p of a){let m=So(p);if(m)d.push(m)}let[f]=d;if(d.length===1&&f!==void 0&&!e(f)&&f.tagName==="span"&&e(f.textContent))return{textContent:f.textContent};return d.length>0?{children:d}:{textContent:""}}function er(o){let a=document.createRange();return a.setStart(ne,0),a.setEnd(o.startContainer,o.startOffset),a.toString()}var Xa=0,Qn=!0;function vo(o){if(!ne||!At||!Ne)return;if(Me)return;let a=window.getSelection();if(!a||!a.rangeCount)return;let d=a.getRangeAt(0);Qn=o?.anchored!==!1,Xa=er(d).length;let f={onSelect:Qa};if(!Qn)f.showFilter=!0;Ze.show(ne,"",f)}function Za(o){if(o.key!=="/"||o.ctrlKey||o.metaKey||!ne)return;let a=window.getSelection();if(!a||a.rangeCount===0)return;let d=er(a.getRangeAt(0));if(d===""||d.endsWith(" ")||d.endsWith(`
|
|
316
|
+
`))requestAnimationFrame(()=>vo())}function Eo(){if(!ne||!Qn)return;let o=window.getSelection();if(!o||!o.rangeCount){Ze.dismiss();return}let a=o.getRangeAt(0),d=er(a),f=d.lastIndexOf("/");if(f===-1||d.length<Xa-1){Ze.dismiss();return}let p=d.slice(f+1).toLowerCase();Ze.show(ne,p,{onSelect:Qa})}function Qa(o){if(!ne||!At||!Ne)return;let a=Qn?window.getSelection():null;if(a&&a.rangeCount){let m=a.getRangeAt(0),h=er(m).lastIndexOf("/");if(h!==-1){let y=document.createTreeWalker(ne,NodeFilter.SHOW_TEXT),E=0,A=null,T=0;while(y.nextNode()){let C=y.currentNode;if(E+C.length>h){A=C,T=h-E;break}E+=C.length}if(A){let C=document.createRange();C.setStart(A,T),C.setEnd(m.startContainer,m.startOffset),C.deleteContents()}}}wt(ne);let d=Ya(ne),f=[...Ne],p=At;za(),p(f,o,d)}function Ud(o,a){let{target:d}=o;return d===a||d===a.documentElement||d===a.body}function wo(o){let a=o instanceof Element?o:null;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function tl(o,a){let d=Pe(o);return{path:ge(a),rect:{height:d.height,width:d.width,x:d.x,y:d.y}}}function el(o){let a=wo(o instanceof Element?o:null);if(!a)return null;return tl(a,a.dataset.jxPath)}function nl(o){let a=o.checkVisibility;if(!t(a)||a.call(o,{checkVisibilityCSS:!0}))return!0;return dr(o)&&[...o.children].some((d)=>nl(d))}function rl(o,a=document){let d=[],f=[];for(let p of o){let m=a.querySelector(ot(ae(p)));if(!m)continue;if(nl(m)){let g=Pe(m);d.push({path:p,rect:{height:g.height,width:g.width,x:g.x,y:g.y}})}else f.push(p)}return{hidden:f,hits:d}}var qd=new Set(["toggle","show","hide"]);function zd(o){return qd.has(o)}function Gd(o,a){if(!(o instanceof Element))return;let d=o.closest("[popovertarget]"),f=d?.getAttribute("popovertarget");if(!d||!f)return;let g=[...d.ownerDocument.querySelectorAll("[data-jx-popover]")].find((E)=>E.id===f)?.dataset.jxPath;if(!g)return;let h=d.getAttribute("popovertargetaction")??"toggle",y=zd(h)?h:"toggle";a.post({action:y,kind:"popoverTargetClick",targetPath:ge(g)})}function Yd(o,a){if(!(o instanceof Element))return;let d=o.closest("[data-jx-commandfor]"),f=d?.dataset.jxCommandfor,p=d?.getAttribute("command")?.trim().toLowerCase()??"";if(!d||!f||!p)return;let h=[...d.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((y)=>y.id===f)?.dataset.jxPath;if(!h)return;a.post({command:p,kind:"commandTargetClick",targetPath:ge(h)})}function ol(o,a=document,d){let f=null,p=null,m=d?.getGen?.()??0,g=()=>d?.getMode?.()==="preview",h=()=>{o.post({kind:"paneFocus"})},y=(M)=>{if(g()){if(M.target instanceof Element){let X=M.target.closest("a[href]")?.getAttribute("href");if(X&&!X.startsWith("#"))M.preventDefault(),o.post({href:X,kind:"previewNavigate"})}return}if(d?.getMode?.()==="stylebook"&&M.target instanceof Element&&M.target.closest("a"))M.preventDefault();let B=el(M.target);if(B)o.post({additive:M.ctrlKey===!0||M.metaKey===!0,hit:B,kind:"hit"});Gd(M.target,o),Yd(M.target,o)},E=(M)=>{if(g())return;let B=M?.dataset.jxPath??null;if(B===f)return;f=B,o.post({hit:M&&B?tl(M,B):null,kind:"hover"})},A=()=>{let M=d?.getGen?.()??m;if(M!==m)m=M,p="none"},T=(M,B)=>{if(!d||d.getMode?.()==="stylebook"||g())return;A();let te=d.getShadowDoc(),X=wo(M instanceof Element?M:null),ce=X&&te?Ca(X,B,te):null,ee=Pa(ce);if(ee===p)return;p=ee,o.post({kind:"insertZones",zones:ce})},C=0,H=null,O=0,K=0,L=(M)=>a.defaultView?.requestAnimationFrame(M)??requestAnimationFrame(M),_=(M)=>a.defaultView?.cancelAnimationFrame(M)??cancelAnimationFrame(M),Y=()=>{C=0;let M=H;H=null,E(wo(M instanceof Element?M:null)),T(M,{x:O,y:K})},q=(M)=>{if(H=M.target,O=M.clientX,K=M.clientY,C)return;C=L(Y)},G=(M)=>{if(!Ud(M,a))return;if(E(null),d&&!g()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},U=(M)=>{if(g())return;let B=ke()?Ct():null;if(B&&M.target instanceof Node&&B.contains(M.target))return;let te=el(M.target);if(!te)return;M.preventDefault(),o.post({kind:"contextMenu",path:te.path,x:M.clientX,y:M.clientY})};return a.addEventListener("pointerdown",h,!0),a.addEventListener("click",y,!0),a.addEventListener("pointermove",q,!0),a.addEventListener("pointerleave",G,!0),a.addEventListener("contextmenu",U,!0),()=>{if(C)_(C),C=0;a.removeEventListener("pointerdown",h,!0),a.removeEventListener("click",y,!0),a.removeEventListener("pointermove",q,!0),a.removeEventListener("pointerleave",G,!0),a.removeEventListener("contextmenu",U,!0)}}var Xd=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),il=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Zd=new Set([...il,"button","dt","h1","h2","h3","h4","h5","h6","label","legend","p","pre","summary"]);function sl(o){return(u(o?.tagName)||"div").toLowerCase()}function Qd(o,a){let d=o.type==="block"?o.tag??"":sl(xe(a,o.path));return il.has(d.toLowerCase())}function ef(o,a){let d=null,f=o;while(f){let p=ge(f.dataset.jxPath??"");if(p.length===0)break;if(Zd.has(sl(xe(a,p))))d=f;f=al(f.parentElement)}return d}function al(o){let a=o;while(a){if(a instanceof HTMLElement&&a.dataset.jxPath)return a;a=a.parentElement}return null}function To(o,a,d){let f=Zo(o,a,d);return al(f)}function Ao(o,a,d,f){let p=o.dataset.jxPath;if(p==null)return null;let m=ge(p);if(m.length===0){let H=[...o.children];if(H.length===0)return tr(f,m)?{edge:"inside",instruction:"make-child",referenceRect:Qe(o),targetPath:m}:null;return tf(H,a,m,f)}if(!tr(f,m))return null;let g=Qd(f,d)?null:ef(o,d);if(g){let H=ge(g.dataset.jxPath??"");if(!tr(f,H))return null;let O=Qe(g);return(O.height===0?0:(a-O.y)/O.height)<0.5?{edge:"top",instruction:"reorder-above",referenceRect:O,targetPath:H}:{edge:"bottom",instruction:"reorder-below",referenceRect:O,targetPath:H}}let h=xe(d,m),y=(u(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((H)=>n(H)),A=Xd.has(y)||!E,T=Qe(o),C=T.height===0?0:(a-T.y)/T.height;if(A)return C<0.5?{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};if(C<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m};if(C>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:T,targetPath:m}}function tf(o,a,d,f){let p=1/0,m="reorder-below",g=o.length-1;for(let y=0;y<o.length;y++){let E=Qe(o[y]),A=Math.abs(a-E.y),T=Math.abs(a-(E.y+E.height));if(A<p)p=A,m="reorder-above",g=y;if(T<p)p=T,m="reorder-below",g=y}let h=[...d,"children",g];if(!tr(f,h))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:Qe(o[g]),targetPath:h}}function tr(o,a){if(o.type!=="tree-node")return!0;let d=o.path;if(Ea(d,a))return!1;return!it(d,a)}function Qe(o){let a=Pe(o);return{height:a.height,width:a.width,x:a.x,y:a.y}}var nf=40,ll=12;function Co(o,a,d=nf){if(o<d)return-1;if(o>a-d)return 1;return 0}var Po=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),No=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),cl=new Set(["deleteByCut","deleteContent"]),ul=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),rf="format",of=new Set(["insertParagraph","insertLineBreak"]);function dl(o){let{inputType:a,from:d,to:f}=o;if(a==="insertCompositionText"||a==="insertFromComposition")return{kind:"native"};if(a==="historyUndo"||a==="historyRedo")return{kind:"reject"};if(a.startsWith(rf))return{kind:"reject"};if(a==="insertFromDrop"||a==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return of.has(a)?{kind:"reject"}:{kind:"native"};if(!d||!f)return{kind:"reject"};let p=Qt(d,f)&&d.offset===f.offset,m=!Qt(d,f);if(a==="insertParagraph")return{from:d,kind:"split",to:f};if(a==="insertLineBreak"&&!m)return{kind:"native"};if(p&&Po.has(a)&&o.atBlockStart)return{at:d,kind:"mergeBackward"};if(p&&No.has(a)&&o.atBlockEnd)return{at:d,kind:"mergeForward"};if(m){if(ul.has(a)||a==="insertLineBreak")return{from:d,kind:"replaceRange",text:o.data,to:f};if(Po.has(a)||No.has(a)||cl.has(a))return{from:d,kind:"replaceRange",text:"",to:f};return{kind:"reject"}}if(ul.has(a)||Po.has(a)||No.has(a)||cl.has(a))return{kind:"native"};return{kind:"native"}}var sf=500;function nr(o,a){let d=o.ownerDocument.getSelection();if(!d||d.rangeCount===0||!d.anchorNode||!d.focusNode)return null;if(!o.contains(d.anchorNode)||!o.contains(d.focusNode))return null;let f=Zt(d.anchorNode,d.anchorOffset,a),p=Zt(d.focusNode,d.focusOffset,a);return f&&p?{anchor:f,head:p}:null}function sn(o,a){let d=io(o,a.anchor),f=io(o,a.head)??d;if(!d)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(m),f&&f!==d)p.extend(f.node,f.offset);return!0}function fl(o){return"dataset"in o}function pl(o,a){let d=o.ownerDocument,f=null,p=null,m=()=>{let U=a.getMode?.();return U===void 0||U==="design"||U==="edit"},g=null,h=()=>{if(g!==null)clearTimeout(g),g=null},y=()=>{if(g=null,!f||!a.onCommitTick)return;let U=nr(o,a.isEditableBlock);if(a.onCommitTick(),U)sn(o,U)},E=!1,A=()=>{if(!a.onCommitTick||!f||E)return;h(),g=setTimeout(y,a.commitDelayMs??sf)},T=()=>{E=!0,h()},C=()=>{E=!1,A()},H=()=>{h(),f=null,p=null},O=()=>{if(!f)return;h(),f=null,p=null,a.onDeactivate()},K=()=>{if(!m()){O();return}let M=d.getSelection()?.focusNode??null;if(!M)return;if(!o.contains(M)){O();return}let B=Bn(M,a.isEditableBlock);if(!B){if(f?.contains(M)){a.onSelectionChange?.();return}O();return}let te=ae(B.path);if(te===p){a.onSelectionChange?.();return}O(),f=B.el,p=te,a.onActivate(B.el,B.path)},L=(U)=>{let[M]=t(U.getTargetRanges)?U.getTargetRanges():[],B=d.getSelection(),te=B&&B.rangeCount>0&&(B.isCollapsed||!M),X,ce,ee,re;if(te)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:re}=B.getRangeAt(0));else if(M)({startContainer:X,startOffset:ce,endContainer:ee,endOffset:re}=M);else return null;let ve=Zt(X,ce,a.isEditableBlock),V=Zt(ee,re,a.isEditableBlock),N=Bn(ee,a.isEditableBlock);return ve&&V&&N?{endEl:N.el,from:ve,to:V}:null},_=(U)=>{if(!m())return;let M=L(U),B=dl({atBlockEnd:M?M.to.offset>=oo(M.endEl):!1,atBlockStart:M?la(M.from):!1,data:U.data??"",from:M?.from??null,inPropHost:f!==null&&p===null,inputType:U.inputType,to:M?.to??null});switch(B.kind){case"native":return;case"split":{if(U.preventDefault(),!Qt(B.from,B.to)&&!a.onReplaceRange)return;a.onSplit?.();return}case"mergeBackward":{U.preventDefault(),a.onMergeBackward?.(B.at);return}case"mergeForward":{U.preventDefault(),a.onMergeForward?.(B.at);return}case"replaceRange":{U.preventDefault(),a.onReplaceRange?.(B.from,B.to,B.text);return}default:U.preventDefault()}},Y=(U)=>{if(!m())return;let M=U.target instanceof Element?U.target:null,B=a.onPropActivate?M:null;while(B&&B!==o){if(fl(B)&&B.dataset.jxBoundProp&&a.onPropActivate){let te=B;if(te!==f){if(O(),a.onPropActivate(te))f=te,p=null}return}if(fl(B)&&B.dataset.jxPath)break;B=B.parentElement}if(M?.closest("[contenteditable]")?.getAttribute("contenteditable")==="false")d.getSelection()?.removeAllRanges()},q=(U)=>{U.preventDefault()},G=()=>A();return d.addEventListener("selectionchange",K),o.addEventListener("beforeinput",_),o.addEventListener("input",G),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",C),o.addEventListener("dragstart",q),d.addEventListener("pointerdown",Y,!0),{capture:()=>nr(o,a.isEditableBlock),forget:H,isComposing:()=>E,flush:()=>{if(E)return;if(g!==null)h(),y()},placeCaret:(U)=>{let M=sn(o,{anchor:U,head:U});if(M)K();return M},restore:(U)=>{let M=sn(o,U);if(M)K();return M},stop:()=>{d.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",_),o.removeEventListener("input",G),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",C),o.removeEventListener("dragstart",q),d.removeEventListener("pointerdown",Y,!0),O()},sync:K}}function Ve(o){return n(o)}function Pt(o){if(Array.isArray(o))return o.map((d)=>Pt(d));if(!l(o))return o;let a={};for(let[d,f]of Object.entries(o)){if(d.startsWith("on")&&Z(f))continue;if(d==="children")a.children=Array.isArray(f)?f.map((p)=>Pt(p)):Pt(f);else if(d==="cases"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f))p[m]=Pt(g);a.cases=p}else if(d==="state"&&Ve(f)){let p={};for(let[m,g]of Object.entries(f)){if(s(g)&&g.timing==="server")continue;p[m]=g}a.state=p}else a[d]=f}return a}var af=new Set(["img","video","source","iframe","audio"]),ml="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",lf="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var cf=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function hl(o){return cf.test(o)}var uf=/(?<![\w$.])(?:item|index|\$map)\b/u;function We(o){if(e(o))return o.includes("${")&&uf.test(o);return l(o)&&e(o.$ref)&&/^(?:#\/)?\$map\//u.test(o.$ref)}function rr(o,a){if(o==="href"||o==="action")return"";if(hl(o))return lf;if(e(a))return an(a);return l(a)&&e(a.$ref)?Tl(a.$ref):""}var df=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"]),ff=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),gl=["empty-text-placeholder","empty-container-placeholder"],pf=["width","height","inlineSize","blockSize"];function mf(o){let{style:a}=o;if(!n(a))return!1;return pf.some((d)=>{let f=a[d],p=i(f)?String(f):e(f)?f.trim():"";return p!==""&&p!=="auto"})}function $o(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(mf(o))return null;if(df.has(u(o.tagName)))return"empty-text-placeholder";if(ff.has(u(o.tagName)))return"empty-container-placeholder";return null}function an(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function xl(o){let a=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(a.nextNode()){let d=a.currentNode;if(d.data.includes("❪"))d.data=d.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function hf(o,a){let d=o.map;return{children:n(d)?[et(d,Sl(o.items,a))]:[],className:"repeater-perimeter",tagName:"div"}}function yl(o){return JSON.stringify(o)}function bl(o){let a=o.startsWith("#/")?o.slice(2):o,[d,...f]=a.split("/"),p=d==="state"||d==="$map"?d:null;if(p===null)return null;let m=f.map((g)=>g.replaceAll("~1","/").replaceAll("~0","~"));return p+m.map((g)=>`?.[${yl(g)}]`).join("")}function Ro(o,a){if(a===null)return`(${o})`;return`((r) => ((item, index, $map) => (${o}))(r, 0, { index: 0, item: r }))(${a})`}function Sl(o,a){if(Array.isArray(o))return`${yl(o)}[0]`;if(r(o)){let f=bl(o.$ref);return f===null?null:`${Ro(f,a)}?.[0]`}let d=e(o)?vl(o):[];if(e(o)&&d.length===1&&gf(o,d[0]))return`${Ro(d[0].expr,a)}?.[0]`;return null}function gf(o,a){return a.start===0&&a.end===o.length-1}function vl(o){let a=[],d=o.indexOf("${");while(d!==-1){let f=0,p=-1;for(let m=d+1;m<o.length;m+=1)if(o[m]==="{")f+=1;else if(o[m]==="}"){if(f-=1,f===0){p=m;break}}if(p===-1)break;a.push({end:p,expr:o.slice(d+2,p),start:d}),d=o.indexOf("${",p+1)}return a}function El(o,a=null){let d=vl(o);if(d.length===0)return o;let f="",p=0;for(let{start:m,end:g,expr:h}of d)f+=o.slice(p,m),f+=`\${(() => { try { return ${Ro(h,a)}; } catch { return ""; } })()}`,p=g+1;return f+o.slice(p)}function xf(o,a){let d=o.startsWith("#/")?o.slice(2):o;if(d!=="$map"&&!d.startsWith("$map/"))return{$ref:o};let f=bl(o);return a===null||f===null?void 0:El(`\${${f}}`,a)}function wl(o,a){let d=o,f=null;for(let p of a){if(Array.isArray(d)){d=i(p)?d[p]:void 0;continue}if(!l(d))return f;if(p==="map"&&d.$prototype==="Array")f=Sl(d.items,f);d=e(p)?d[p]:void 0}return f}function Tl(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function Al(o,a=null){return et(o,a)}function et(o,a){if(Array.isArray(o))return o.map((h)=>et(h,a));if(!l(o))return o;if(o.$prototype==="Array")return hf(o,a);let d=o,f={},p=!1,m=e(d.tagName)&&af.has(d.tagName);if(m){let{attributes:h,src:y}=d,E=h?.src,A=d.poster,T=h?.poster;if(!(y&&y!==""||E&&E!=="")&&!(A&&A!==""||T&&T!==""))p=!0}for(let[h,y]of Object.entries(d))if(h==="state"||h==="$media"||h==="$elements")f[h]=y;else if(h==="$props"&&Ve(y)){let E={};for(let[A,T]of Object.entries(y))if(!We(T))E[A]=T;else if(e(T))E[A]=hl(A)||A==="href"||A==="action"?rr(A,T):El(T,a);else if(r(T)){let C=xf(T.$ref,a);if(C!==void 0)E[A]=C}else E[A]=T;f[h]=E}else if(h==="children")if(Array.isArray(y))f.children=y.map((E)=>et(E,a));else if(l(y)&&y.$prototype==="Array")f.children=[et(y,a)];else f.children=et(y,a);else if(h==="cases"&&d.$switch&&Ve(y)){let[E]=Object.entries(y);if(E){let[,A]=E;f.children=Ve(A)&&!(l(A)&&A.$ref)?[et(A,a)]:[{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: ${Object.keys(y).join(" | ")}]`}]}}else if(h==="attributes"&&m&&Ve(y)){let E={};for(let[A,T]of Object.entries(y))if((A==="src"||A==="poster")&&(T===""||T==null||We(T)))p=!0,E[A]=ml;else E[A]=We(T)?rr(A,T):T;f.attributes=E}else if(h==="attributes"&&Ve(y)){let E={};for(let[A,T]of Object.entries(y))E[A]=We(T)?rr(A,T):T;f.attributes=E}else if(h==="style")if(Ve(y)){let E={};for(let[A,T]of Object.entries(y))if(!We(T))E[A]=T;f.style=E}else f.style=y;else if(h==="$switch"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&e(y)&&y.includes("${"))f[h]=an(y);else if(h==="textContent"&&l(y)&&y.$ref)f[h]=Tl(y.$ref);else if(m&&(h==="src"||h==="poster"))if(y===""||y==null||We(y))p=!0,f[h]=ml;else f[h]=y;else if(We(y))f[h]=rr(h,y);else if(e(y)||l(y)&&y.$ref)f[h]=y;else f[h]=et(y,a);let g=$o(f);if(g)f.className=f.className?`${f.className} ${g}`:g;if(p){let h=e(f.className)?f.className:"";if(!h.includes("empty-media-placeholder"))f.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return f}var yf={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Oo=globalThis,bf=["strong","em","u","del","sub","sup","code"],or="jx-pending-format",Cl="jx-pending-format-style";function Sf(o){let a=o.parentElement;while(a){if(a.tagName.includes("-"))return a;a=a.parentElement}return null}function vf(o,a){if(!o)return!1;let d=o.attributes;if(d){if(d[`props.${a}`]!==void 0)return!0;let f=new Set([a.toLowerCase(),Tn(a).toLowerCase()]);for(let m of Object.keys(d))if(d[m]!==void 0&&f.has(m.toLowerCase()))return!0;let p=d["data-jx-props"];if(e(p)&&Ef(p,a))return!0}if(Gt.has(a)||a.startsWith("$"))return!1;return o[a]!==void 0}function Ef(o,a){try{let d=JSON.parse(o);return n(d)&&a in d}catch{return!1}}function Pl(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function wf(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function Nl(o,a,d){let f=a.ownerDocument,p=()=>{let V=d?.getMode?.();return V===void 0||V==="design"||V==="edit"},m=null,g=0,h=(V)=>{let N=window.getSelection();if(!N||!N.rangeCount)return null;let z=N.getRangeAt(0);return V.contains(z.commonAncestorContainer)?z:null},y=()=>{let V=Ct();if(!V)return;let N=h(V);if(N&&!N.collapsed)m=N.cloneRange()},E=()=>{if(f.querySelector(`#${Cl}`))return;let V=f.createElement("style");V.id=Cl,V.textContent=`::highlight(${or}) { background-color: Highlight; color: HighlightText; }`,f.head.append(V)},A=()=>{let V=Oo.Highlight,N=Oo.CSS?.highlights;if(!V||!N)return;if(m&&m.startContainer.isConnected)E(),N.set(or,new V(m.cloneRange()));else N.delete(or)},T=()=>{Oo.CSS?.highlights?.delete(or)},C=()=>{let V=Ct();if(!V||!V.dataset.jxPath)return null;let N=h(V),z=N??m,Q=z?wf(Xo(z)):null,de=N?N.collapsed:!0,Je=bf.filter((Ce)=>$a(Ce,V)),ye=Ja(V);if(ye.active)Je.push("a");return g+=1,{activeTags:Je,collapsed:de,kind:"selectionChanged",link:ye,localScope:null,path:ge(V.dataset.jxPath),rect:Q,seq:g}},H=()=>{if(!ke())return;y(),A();let V=C();if(V)o.post(V)},O=!1,K=(V,N)=>{xl(V),o.post({kind:"editStart",path:N}),go(V,N,{onCommit:(z,Q,de,Je)=>{O=!1;let ye={children:Q,kind:"editCommit",path:z,textContent:de};if(Je)ye.inPlace=!0;o.post(ye)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(z,Q,de)=>o.post({cmd:Q,commitData:de,kind:"editInsert",path:z}),onSplit:(z,Q,de)=>o.post({after:de,before:Q,kind:"editSplit",path:z})}),y(),H()},L=(V,N)=>{let z=d?.getShadowDoc?.();if(!z)return!0;let Q=xe(z,V);if(vf(Q,N))return!1;let de=Q?.$props?.[N];if(de==null)return!0;if(!e(de))return!1;return!de.includes("${")},_=(V,N,z)=>{o.post({kind:"editStart",path:N,prop:z}),go(V,N,{onCommit:(Q,de,Je,ye)=>{O=!1;let Ce={kind:"editCommitProp",path:Q,prop:z,value:Je??""};if(ye)Ce.inPlace=!0;o.post(Ce)},onEnd:()=>{T(),m=null,X.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},Y=(V)=>{let N=Ct();if(!N)return;if(Ba())return;if(m&&m.startContainer.isConnected&&N.contains(m.commonAncestorContainer)){let z=window.getSelection();N.focus(),z?.removeAllRanges(),z?.addRange(m)}if(V.command==="link")_a(N,V.href);else if(V.command==="insertData")Da(N,V.token);else{let z=yf[V.command];if(z)Oa(z,N)}y(),H()},q=(V)=>{let N=V.dataset.jxBoundProp,z=Sf(V),Q=z?.dataset.jxPath;if(!N||!z||!Q)return!1;let de=ge(Q);if(!L(de,N))return!1;return _(V,de,N),!0},G=(V,N)=>{let z=ca(a,V,N,st);if(!z)return!1;let[Q,de]=N===-1?[V,z.path]:[z.path,V];return X.flush(),o.post({fromPath:Q,intoPath:de,kind:"editMerge"}),!0},U=(V,N,z)=>{let Q=so(a,st),de=ae(V.path),Je=ae(N.path),ye=Q.findIndex((Be)=>Be.dataset.jxPath===de),Ce=Q.findIndex((Be)=>Be.dataset.jxPath===Je);if(ye===-1||Ce===-1||Ce<=ye)return!1;let cn=Q.slice(ye+1,Ce).map((Be)=>ge(Be.dataset.jxPath));return X.flush(),o.post({between:cn,from:V,kind:"editRangeReplace",text:z,to:N}),!0},M=()=>y(),B=()=>y(),te=()=>y(),X=pl(a,{getMode:()=>d?.getMode?.()??"edit",isEditableBlock:st,onActivate:(V,N)=>K(V,N),onDeactivate:()=>{if(ke())Le()},onCommitTick:()=>Wa(),onMergeBackward:(V)=>G(V.path,-1),onMergeForward:(V)=>G(V.path,1),onReplaceRange:(V,N,z)=>U(V,N,z),onPropActivate:q,onSelectionChange:()=>H(),onSplit:()=>qa()}),ce=(V)=>Za(V),ee=()=>{if(Ua())Eo()},re=()=>{if(!O)O=!0,o.post({kind:"editInput"})};a.addEventListener("input",re),a.addEventListener("keydown",ce),a.addEventListener("input",ee),f.addEventListener("mouseup",M,!0),f.addEventListener("keyup",B,!0),f.addEventListener("blur",te,!0);let ve=o.onMessage((V)=>{if(V.kind==="applyFormat"){Y(V.intent);return}if(V.kind==="openSlash"){vo({anchored:!1});return}if(V.kind==="flushEdits"){X.flush(),o.post({kind:"flushComplete",reqId:V.reqId});return}if(V.kind==="endEdit"){if(ke())Le();return}if(V.kind!=="enterEdit")return;if(!p())return;if(V.prop!==void 0){let Q=Pl(a,V.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(V.prop)}"]`);if(Q)q(Q);return}let N=Pl(a,V.path);if(N&&st(N))X.placeCaret({offset:V.offset??0,path:V.path})});return()=>{if(a.removeEventListener("keydown",ce),a.removeEventListener("input",ee),a.removeEventListener("input",re),f.removeEventListener("mouseup",M,!0),f.removeEventListener("keyup",B,!0),f.removeEventListener("blur",te,!0),X.stop(),ve(),T(),m=null,ke())Le()}}var Tf=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function Af(o){return Tf.has(o)}function Rl(o,a){let d=!1,f=null,p=null,m={dismiss:()=>{if(!d)return;d=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>d,show:(E,A,T)=>{if({onSelect:f}=T,d&&A===p)return;d=!0,p=A;let C=Pe(E),H={filter:A,kind:"slashShow",rect:{height:C.height,width:C.width,x:C.left,y:C.top}};if(T.showFilter===!0)H.showFilter=!0;o.post(H)}};ho(m);let g=(E)=>{if(!d||!Af(E.key))return;E.preventDefault(),E.stopPropagation(),o.post({key:E.key,kind:"slashNav"})},h=()=>{if(d)m.dismiss()};a.addEventListener("keydown",g,!0),a.addEventListener("mousedown",h,!0);let y=o.onMessage((E)=>{if(E.kind==="slashSelect"){d=!1,p=null,f?.({...E.cmd});return}if(E.kind==="slashDismissed")d=!1,p=null});return()=>{a.removeEventListener("keydown",g,!0),a.removeEventListener("mousedown",h,!0),y(),ho({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var $l=["global","canvas","caret","grid","code","dock","palette"];var kh={"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 Cf=["mod","ctrl","alt","shift"],Pf=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),Nf=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function Rf(o){return[...Cf.filter((d)=>o[d]),o.key].join("+")}function $f(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function Ol(o,a){let d=$f(o.code)??o.key.toLowerCase();if(Pf.has(d))return"";let f={mod:a?o.metaKey:o.ctrlKey,ctrl:a?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:Nf.get(d)??d};return Rf(f)}var Lh=["global",...$l.filter((o)=>o!=="global"&&o!=="palette")];var Of=["caret","global"],Mf=["canvas","global"],kf=["global"],ir={chords:[],mac:!1};function Jf(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function _f(o,a){if(o)return Of;return a==="preview"?kf:Mf}function Df(o,a=ir,d=!1,f="design"){if(Jf(o.target))return!1;let p=Ol(o,a.mac);if(!p)return!1;let m=_f(d,f);return a.chords.some((g)=>g.chord===p&&m.includes(g.scope))}function Lf(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function Ml(o,a=document,d=()=>!1,f=()=>ir,p=()=>"design"){let m=(g)=>{if(!Df(g,f(),d(),p()))return;g.preventDefault(),o.post({event:Lf(g),kind:"forwardKey"})};return a.addEventListener("keydown",m,!0),()=>a.removeEventListener("keydown",m,!0)}var Mo=new WeakMap,sr=new Set;function ko(o,a,d){let f=xe(o,a);if(f===void 0)throw Error(`iframe-patch-node-not-found:${a.join("/")}`);let p=e(f)?f:Al(Pt(f),wl(o,a)),{result:m,stop:g}=St(()=>Oe(p,d.defs,{_path:If(a,d),onNodeCreated:uo(d.mapperCtx)}));if(sr.add(g),m instanceof HTMLElement)Mo.set(m,g);return m}function Jo(o){let a=[o,...o.querySelectorAll("*")];for(let d of a){if(!(d instanceof HTMLElement))continue;Mn(d);let f=Mo.get(d);if(f)f(),sr.delete(f),Mo.delete(d)}}function kl(){for(let o of sr)o();sr.clear()}function If(o,a){let{mapperCtx:d}=a;if(d.layoutWrapped&&d.pageContentPrefix&&o[0]==="children"){let[,f]=o;return i(f)?[...d.pageContentPrefix,f+(d.pageContentOffset??0),...o.slice(2)]:[...d.pageContentPrefix,...o.slice(1)]}return o}function Dl(o,a,d,f,p){for(let g of a)po(o,g);if(!p?.length){for(let g of a)Jl(o,g,d,f);return}let m=new Set(p.map((g)=>ae(g)));for(let g of a){if(g.op==="set-key"&&m.has(ae(g.path))){jf(o,g.path,d);continue}Jl(o,g,d,f)}}function jf(o,a,d){let f=jl(d,a);if(f)Nt(f,xe(o,a))}function _o(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function Jl(o,a,d,f){switch(a.op){case"set-key":{if(a.key==="style"){Bf(o,a.path,d,f);return}if(a.key==="textContent"){Kf(o,a.path,d);return}if(a.key.startsWith("on"))return;_l(o,a.path,d,_o(f));return}case"insert-child":{Hf(o,a.parentPath,a.index,d,_o(f));return}case"set-child":{_l(o,[...a.parentPath,"children",a.index],d,_o(f));return}case"remove-child":{Ff(o,a.parentPath,a.index,d);return}case"move-child":{Vf(o,a.fromParentPath,a.fromIndex,a.toParentPath,a.toIndex,d);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(a)}`)}}function Hf(o,a,d,f,p){let m=at(f,a),g=xe(o,a),h=ko(o,[...a,"children",d],p);ar(f,a,d,1),Ll(m,h,Il(m,g,d)),Nt(m,g)}function _l(o,a,d,f){let p=at(d,a),m=ko(o,a,f);Jo(p),p.replaceWith(m)}function Ff(o,a,d,f){let p=at(f,[...a,"children",d]),m=p.parentElement;if(Jo(p),p.remove(),ar(f,a,d+1,-1),m)Nt(m,xe(o,a))}function Vf(o,a,d,f,p,m){let g=[...a,"children",d],h=at(m,g),y=h.parentElement,E=at(m,f);h.remove(),ar(m,a,d+1,-1);let A=lr(E)??f;ar(m,A,p,1),Wf(h,g,[...A,"children",p]);let T=xe(o,A);if(Ll(E,h,Il(E,T,p)),y)Nt(y,xe(o,lr(y)??a));Nt(E,T)}function Nt(o,a){for(let f of gl)o.classList.remove(f);let d=a?$o(a):null;if(d)o.classList.add(d)}function Ll(o,a,d){if(d)d.before(a);else o.append(a)}function Il(o,a,d){let f=a?.textContent,p=f!=null&&String(f)!==""?1:0;return o.childNodes[p+d]??null}function ar(o,a,d,f){let p=a.length;for(let m of o.querySelectorAll("[data-jx-path]")){let g=lr(m);if(!g||g.length<p+2||g[p]!=="children")continue;let h=g[p+1];if(!i(h)||h<d)continue;if(!a.every((E,A)=>g[A]===E))continue;let y=[...g];y[p+1]=h+f,m.dataset.jxPath=ae(y)}}function Wf(o,a,d){let f=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of f){let m=lr(p);if(!m||m.length<a.length||!a.every((g,h)=>m[h]===g))continue;p.dataset.jxPath=ae([...d,...m.slice(a.length)])}}function lr(o){let a=o.dataset.jxPath;return a===void 0?null:ge(a)}function Bf(o,a,d,f){let p=at(d,a),m=xe(o,a),g=f?.defs.$media??{};Vn(p,Uf(m?.style),g,f?.defs??{})}function Kf(o,a,d){let f=at(d,a),p=xe(o,a);f.textContent=qf(p),Nt(f,p)}function at(o,a){let d=jl(o,a);if(!d)throw Error(`iframe-patch-element-not-found:${ae(a)}`);return d}function jl(o,a){let f=ae(a).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Uf(o){if(!o||!n(o))return;let a={};for(let[d,f]of Object.entries(o)){if(We(f))continue;a[d]=f}return a}function qf(o){let a=o?.textContent;if(a==null)return"";if(e(a))return a.includes("${")?an(a):a;if(n(a)&&a.$ref){let d=String(a.$ref);return`{${d.startsWith("#/state/")?d.slice(8):d}}`}return String(a)}function Hl(o){if(o===void 0)return"undefined";let a;try{a=JSON.stringify(o)??"undefined"}catch{a=String(o)}if(a.length>48)a=`${a.slice(0,47)}…`;return a}function zf(o){return s(o)&&"$expression"in o&&Array.isArray(o.parameters)}function Gf(o){try{return structuredClone(o)}catch{return null}}function Yf(o,a){let d={};for(let f of Object.keys(o))try{let p=o[f];if(t(p)){if(zf(a?.[f]))d[f]=p;continue}let m=JSON.stringify(p);d[f]=m===void 0?null:JSON.parse(m)}catch{d[f]=null}return d}function Xf(o,a,d){if(!d||d.length===0)return o;let f=a,p=o;for(let m of d){if(!n(f))break;let g=f;if(g.$prototype==="Array"&&m==="map"){let h=g.items,y=r(h)?Se(h.$ref,p):h;if(Array.isArray(y)&&y.length>0){let[E]=y,A=Gf(E),T=Object.create(p);T.$map={index:0,item:A},T["$map/item"]=A,T["$map/index"]=0,p=T}}f=g[m]}return p}function Fl(o,a,d,f){let p=d?.state??null;return o.map(({id:m,node:g})=>{let h=new Map,y;try{y=Xf(Yf(a,p),d,f)}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[]}}try{if(!n(g)||!("operator"in g))throw Error("not an expression node");return Ae(g,y,null,void 0,{report:(E,A)=>{h.set(E.join("/"),Hl(A))}}),{id:m,values:[...h.entries()]}}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[...h.entries()]}}})}var Zf=256000,Qf="[large value omitted]";function Vl(o){let a={};for(let d of Object.keys(o))try{let f=o[d];if(t(f))continue;let p=JSON.stringify(f);if(p===void 0){a[d]=null;continue}if(p.length>Zf){a[d]=Qf;continue}a[d]=JSON.parse(p)}catch{a[d]=null}return a}function Wl(o,a){return new URL(`/node_modules/${o}`,a).href}var Bl={"jx-ui:/behaviors/color-area.ts":()=>(me("h8dbasp1"),import("./chunks/color-area-h8dbasp1.js")),"jx-ui:/behaviors/color-field.ts":()=>(me("qv5r2b16"),import("./chunks/color-field-qv5r2b16.js")),"jx-ui:/behaviors/color-slider.ts":()=>(me("nz2mrzky"),import("./chunks/color-slider-nz2mrzky.js")),"jx-ui:/behaviors/combobox.ts":()=>(me("6hs00996"),import("./chunks/combobox-6hs00996.js")),"jx-ui:/behaviors/dialog.ts":()=>(me("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(me("7gka1h86"),import("./chunks/listbox-7gka1h86.js")),"jx-ui:/behaviors/menu.ts":()=>(me("d2jxpgma"),import("./chunks/menu-d2jxpgma.js")),"jx-ui:/behaviors/number-field.ts":()=>(me("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(me("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(me("9tf4cjrk"),import("./chunks/popover-9tf4cjrk.js")),"jx-ui:/behaviors/select.ts":()=>(me("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(me("m5rwn31z"),import("./chunks/split-m5rwn31z.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(me("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(me("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(me("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(me("j0ebwr5s"),import("./chunks/tree-j0ebwr5s.js")),"jx-ui:/behaviors/tooltip.ts":()=>(me("dj1pvgz7"),import("./chunks/tooltip-dj1pvgz7.js")),"jx-ui:/behaviors/textfield.ts":()=>(me("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(me("w11qpkyz"),import("./chunks/toast-w11qpkyz.js")),"jx-ui:/behaviors/toast-host.ts":()=>(me("g3r2s0kn"),import("./chunks/toast-host-g3r2s0kn.js")),"jx-ui:/color.ts":()=>(me("04361ttk"),import("./chunks/color-04361ttk.js")),"jx-ui:/icons.ts":()=>(me("853n6qt3"),import("./chunks/icons-853n6qt3.js"))};var ep;function Kl(o){ep=new URL("./",o).href}Kl(import.meta.url);for(let[o,a]of Object.entries(Bl))Vs(o,a);Hs((o)=>Wl(o,location.href));function ln(o,a,d,f){let p=To(o.x,o.y,f);if(!p)return null;return Ao(p,o.y,d,a)}function Do(o){return[...o.dataTransfer?.types??[]].includes("Files")}var tp={type:"block"},Io={},Lo=null;function Ul(o){return o?{...o,versions:Io}:null}function np(o,a){let d=o.dataset.jxPath;if(d==null)return null;let f=ge(d),p=a?xe(a,f):void 0;return{path:f,rect:Qe(o),tagName:(u(p?.tagName)||o.tagName).toLowerCase()}}function rp(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let a=o.closest("[data-jx-layout-region]");if(!(a instanceof HTMLElement))return null;return{className:a.className,layoutFile:a.dataset.jxLayoutFile??"",layoutPath:ge(a.dataset.jxLayoutPath??"[]"),rect:Qe(a),tagName:a.tagName.toLowerCase()}}function ql(o){let a=n(o)&&"message"in o?o.message:void 0;return String(a??o)}var op=new Set(["style","textContent"]);function ip(o){let a=Ka();if(!a)return!1;for(let d of o){let f;if(d.op==="set-key"){if(op.has(d.key)||d.key.startsWith("on"))continue;f=d.path}else if(d.op==="move-child"){if(f=d.fromParentPath,it(f,a)||it(d.toParentPath,a))return!0;continue}else f=d.parentPath;if(it(f,a))return!0}return!1}var sp=2,ap=5000,lp=500;function cp(o){let{channel:a,container:d}=o;Io={},Lo=null;let f=null,p=null,m=-1,g=ga(d.ownerDocument),h=null,y=-1,E="design",A=null,T=null,C=ir,H=null,O=null,K=-1,L=-1,_=0,Y=null,q=d.ownerDocument.defaultView;function G(){if(_&&q)q.cancelAnimationFrame(_);_=0,Y=null}function U(){_=0;let P=Y?.src??O;if(!q||!Y||!P||!h)return;let ie=Co(Y.y,q.innerHeight);if(ie===0)return;let oe=q.scrollY;if(q.scrollBy(0,ie*ll),q.scrollY===oe)return;let Ee=ln(Y,P,h,d.ownerDocument),se={dragSeq:Y.dragSeq,gen:Y.gen??K,kind:"dragOver",preview:Ee};if(Y.withCursor)se.cursor={x:Y.x,y:Y.y};a.post(se),_=q.requestAnimationFrame(U)}function M(P,ie,oe){if(!q||Co(P.y,q.innerHeight)===0){G();return}let Ee={dragSeq:ie,withCursor:oe!=null,x:P.x,y:P.y};if(oe)Ee.gen=oe.gen,Ee.src=oe.src;if(Y=Ee,!_)_=q.requestAnimationFrame(U)}let B=ol(a,d.ownerDocument,{getGen:()=>y,getMode:()=>E,getShadowDoc:()=>h}),te=(P)=>{if(E!=="design"&&E!=="edit")return;let ie=rp(P.target);if(ie)a.post({hit:ie,kind:"layoutHit"})};d.ownerDocument.addEventListener("click",te,!0);let X=Ml(a,d.ownerDocument,ke,()=>C,()=>E),ce=Nl(a,d,{getMode:()=>E,getShadowDoc:()=>h}),ee=Rl(a,d.ownerDocument),re=xa(d),ve=30000,V=-1;function N(){let P=d.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),ie=Pe(d),oe=0;for(let Ee of P)oe=Math.max(oe,Pe(Ee).bottom-ie.top);return oe}function z(){let P=Math.max(d.scrollHeight,N()),ie=Math.min(P,ve);if(ie>0&&Math.abs(ie-V)>=1){V=ie;let oe=d.firstElementChild,Ee=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;a.post({fragment:Ee,height:ie,kind:"contentHeight"}),lt()}}let Q=q?.ResizeObserver,de=Q?new Q(()=>z()):null,Je=d.ownerDocument,ye=0,Ce=0,cn=0,Be="",Rt=new Map;function zl(){let P=Date.now();for(let[ie,oe]of Rt)if(oe<=P)Rt.delete(ie);return Rt.size}function Gl(){let P=Je;return{animations:P.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:P.fonts?P.fonts.status==="loaded":!0,gen:y,images:zl(),kind:"idle"}}function jo(){ye=0;let P=Gl(),ie=`${P.gen}|${P.fonts}|${P.animations}|${P.images}`,oe=ie!==Be;if(oe)Be=ie,a.post(P);if(Ce=P.fonts&&P.animations===0&&P.images===0?oe?1:Ce+1:0,Ce>=sp){z();return}if(Date.now()>=cn)return;ye=q?q.requestAnimationFrame(jo):0}function lt(){if(Ce=0,cn=Date.now()+ap,!ye&&q)ye=q.requestAnimationFrame(jo)}let Ho=(P)=>{if(P.target instanceof HTMLImageElement&&fo(P.target))Rt.set(P.target,Date.now()+lp),lt()},Fo=(P)=>{if(P.target instanceof HTMLImageElement&&Rt.delete(P.target))lt()};d.addEventListener("error",Ho,!0),d.addEventListener("load",Fo,!0),lt(),de?.observe(d);let Vo=(P)=>{if(E==="preview"){if(P.ctrlKey||P.metaKey)P.preventDefault();return}P.preventDefault(),a.post({ctrlKey:P.ctrlKey,deltaX:P.deltaX,deltaY:P.deltaY,kind:"forwardWheel",metaKey:P.metaKey,shiftKey:P.shiftKey,x:P.clientX,y:P.clientY})};d.ownerDocument.addEventListener("wheel",Vo,{passive:!1});let Yl=300,Wo=0,Bo=(P,ie)=>{P.preventDefault(),P.stopPropagation();let oe={x:P.clientX,y:P.clientY},Ee=d.ownerDocument,se=To(oe.x,oe.y,Ee),Re=se?np(se,h):null,dn=h&&se?Ao(se,oe.y,h,tp):null;if(ie==="fileDragOver"){if(P.dataTransfer)P.dataTransfer.dropEffect="copy";a.post({hit:Re,kind:"fileDragOver",preview:dn});return}a.post({files:[...P.dataTransfer?.files??[]],hit:Re,kind:"fileDrop",preview:dn})},un=(P)=>{if(!O){if(Do(P)){Bo(P,"fileDragOver");return}let Ee=Date.now();if(Ee-Wo>=Yl)Wo=Ee,a.post({kind:"nativeDragEnter"});return}if(P.preventDefault(),P.dataTransfer)P.dataTransfer.dropEffect="move";let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,O,h,d.ownerDocument):null;a.post({cursor:ie,dragSeq:L,gen:K,kind:"dragOver",preview:oe}),M(ie,L)},Ko=(P)=>{if(!O){if(Do(P))Bo(P,"fileDrop");return}P.preventDefault();let ie={x:P.clientX,y:P.clientY},oe=h?ln(ie,O,h,d.ownerDocument):null;a.post({dragSeq:L,gen:K,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),O=null,K=-1,L=-1,G()},Uo=(P)=>{if(!O&&Do(P)&&!P.relatedTarget)a.post({kind:"fileDragLeave"})};d.ownerDocument.addEventListener("dragenter",un,!0),d.ownerDocument.addEventListener("dragover",un,!0),d.ownerDocument.addEventListener("dragleave",Uo,!0),d.ownerDocument.addEventListener("drop",Ko,!0);let Xl=a.onMessage((P)=>{if(P.kind==="measure"){let{hidden:se,hits:Re}=rl(P.paths,d.ownerDocument);a.post({hidden:se,hits:Re,kind:"geometry",reqId:P.reqId});return}if(P.kind==="evalExpr"){let se=P.gen===y&&H&&h?Fl(P.exprs,H.defs,h,P.contextPath):[];a.post({gen:P.gen,kind:"evalResult",reqId:P.reqId,results:se});return}if(P.kind==="patch"){let{gen:se}=P;if(se<y){a.post({gen:se,kind:"patchError",message:"patch-behind-render"});return}if(se>y||!h||!H){a.post({gen:se,kind:"patchError",message:"patch-ahead-of-render"});return}let Re=new Set((P.echoPaths??[]).map((ct)=>ae(ct))),dn=Re.size===0?P.forwardOps:P.forwardOps.filter((ct)=>!(ct.op==="set-key"&&Re.has(ae(ct.path)))),qo=ke()&&ip(dn),zo=qo?nr(d,st):null;if(qo)Le();try{if(Dl(h,P.forwardOps,d,H,P.echoPaths),en(d,A),Et(d,T),zo)sn(d,zo);a.post({gen:se,kind:"patchComplete"}),lt()}catch(ct){a.post({gen:se,kind:"patchError",message:ql(ct)})}return}if(P.kind==="styleUpdate"){if(P.gen!==y||!h)return;h.style=P.style;let se=d.firstElementChild;if(se instanceof HTMLElement)Vn(se,P.style,h.$media??{});return}if(P.kind==="dragStart"){O=P.src,K=P.gen,L=P.dragSeq;return}if(P.kind==="dragEnd"||P.kind==="dragCancel"){O=null,K=-1,L=-1,G();return}if(P.kind==="dragMove"){let se=O&&h?ln(P.cursor,O,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,kind:"dragOver",preview:se}),M(P.cursor,P.dragSeq);return}if(P.kind==="drop"){let se=O&&h?ln(P.cursor,O,h,d.ownerDocument):null;a.post({dragSeq:P.dragSeq,gen:K,instruction:se?.instruction??null,kind:"dropResult",targetPath:se?.targetPath??null}),O=null,K=-1,L=-1,G();return}if(P.kind==="assetVersions"){Io=P.versions;let se=Ul(Lo);if(se)Dn((Re)=>Xt(Re,se));return}if(P.kind==="keymap"){C={chords:P.chords,mac:P.mac};return}if(P.kind==="setColorScheme"){co(d.ownerDocument,P.scheme);return}if(P.kind==="setPopoverOpen"){if(E==="preview")return;A=P.path===null?null:ae(P.path),en(d,A),Et(d,T),z();return}if(P.kind==="setDialogOpen"){if(E==="preview")return;T=P.path===null?null:ae(P.path),Et(d,T),z();return}if(P.kind==="redefineElement"){Zs(P.doc,P.base);return}if(P.kind==="setLocale"){qn(d.ownerDocument,P.locale===null?null:{dir:P.dir,locale:P.locale},g);return}if(P.kind==="siteStyleUpdate"){lo(P.siteStyle,P.media);return}if(P.kind!=="render"||P.gen<m)return;if(co(d.ownerDocument,P.colorScheme??null),qn(d.ownerDocument,P.locale??null,g),ke())Le();m=P.gen,Lo=P.assets??null,Va(P.editableTags??null);let{gen:ie,mapperCtx:oe}=P,Ee=P.shadowDoc;(async()=>{try{kl(),p?.(),p=null,f?.dispose(),qs(d.ownerDocument);let se={assets:Ul(P.assets??null),container:d,doc:P.doc,docBase:P.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:P.diffMarks??null,mode:P.mode,popoverOpen:P.popoverOpen?ae(P.popoverOpen):null,dialogOpen:P.dialogOpen?ae(P.dialogOpen):null,siteStyle:P.siteStyle};if(P.allowAutoRequests)se.allowAutoRequests=!0;if(f=await ya(se),ie===m){A=P.popoverOpen?ae(P.popoverOpen):null,T=P.dialogOpen?ae(P.dialogOpen):null,en(d,A),Et(d,T),h=Ee,H=f.ctx,y=ie,E=P.mode,a.post({gen:ie,kind:"renderComplete"}),lt();let{defs:Re}=f.ctx;p=Cs(()=>{try{a.post({gen:ie,kind:"dataScope",scope:Vl(Re)})}catch{}}),z()}}catch(se){a.post({gen:ie,kind:"renderError",message:ql(se)})}})()});return a.post({kind:"ready"}),()=>{if(Xl(),qn(d.ownerDocument,null,g),B(),X(),ce(),ee(),re(),ye&&q)q.cancelAnimationFrame(ye);ye=0,d.removeEventListener("error",Ho,!0),d.removeEventListener("load",Fo,!0),G(),de?.disconnect(),d.ownerDocument.removeEventListener("click",te,!0),d.ownerDocument.removeEventListener("wheel",Vo),d.ownerDocument.removeEventListener("dragenter",un,!0),d.ownerDocument.removeEventListener("dragleave",Uo,!0),d.ownerDocument.removeEventListener("dragover",un,!0),d.ownerDocument.removeEventListener("drop",Ko,!0),p?.(),f?.dispose()}}function up(o){let a=new URLSearchParams(o.location.search);Ts(a.get("rpcToken"));let d=a.get("parentOrigin"),f=d||"*";if(!d)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 p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,g=Yo({acceptOrigin:f,source:o,target:o.parent,targetOrigin:f,token:a.get("token")||""});return cp({channel:g,container:m})}if(typeof window<"u"&&window.parent!==window)up(window);export{sp as IDLE_QUIET_FRAMES,ap as IDLE_WATCH_MAX_MS,lp as IMAGE_RETRY_WINDOW_MS,up as bootCanvasIframe,np as fileDropHitFor,Do as isExternalFileDrag,rp as layoutHitFor,ip as patchDisturbsActiveEdit,cp as startCanvasIframe};
|
|
317
317
|
|
|
318
|
-
//# debugId=
|
|
318
|
+
//# debugId=4A6CC328BEDFB88164756E2164756E21
|
|
319
319
|
//# sourceMappingURL=iframe-entry.js.map
|