@pie-players/pie-section-player 0.3.75 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +845 -964
  2. package/custom-elements.json +3922 -0
  3. package/dist/browser/assets/{evaluation-worker-CORp9m0K.js → evaluation-worker-0xRDVTJx.js} +82215 -73234
  4. package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
  5. package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
  6. package/dist/browser/chunks/calculator-element-271c142f.js +8 -9
  7. package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -1
  8. package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
  9. package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
  10. package/dist/browser/chunks/custom-element-define-2a92deb0.js +1 -0
  11. package/dist/browser/chunks/dist-41b39e7f.js +1 -1
  12. package/dist/browser/chunks/dist-ca9b9622.js +1 -1
  13. package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
  14. package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
  15. package/dist/browser/chunks/mathjax-BKrHE4xs-3ca05bf6.js +1 -1
  16. package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
  17. package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
  18. package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
  19. package/dist/browser/chunks/provider-4c704118.js +1 -1
  20. package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
  21. package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
  22. package/dist/browser/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
  23. package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
  24. package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +5 -5
  25. package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
  26. package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
  27. package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
  28. package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
  29. package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
  30. package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
  31. package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
  32. package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
  33. package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
  34. package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
  35. package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
  36. package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +24 -30
  37. package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
  38. package/dist/browser/chunks/versioned-tag-54a76be9.js +1 -1
  39. package/dist/browser/pie-section-player.js +66 -65
  40. package/dist/chunks/nl-NL-364d61b9.js +34 -6
  41. package/dist/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
  42. package/dist/component-definitions.d.ts +0 -2
  43. package/dist/components/shared/card-media-region.d.ts +3 -4
  44. package/dist/components/shared/framework-error-latch.d.ts +4 -2
  45. package/dist/components/shared/missing-tool-providers.d.ts +0 -6
  46. package/dist/components/shared/player-preload.d.ts +4 -9
  47. package/dist/components/shared/section-player-card-context.d.ts +0 -3
  48. package/dist/components/shared/section-player-host-runtime.d.ts +0 -2
  49. package/dist/components/shared/section-player-view-state.d.ts +0 -1
  50. package/dist/controllers/SectionController.d.ts +20 -6
  51. package/dist/pie-section-player.js +11279 -11191
  52. package/package.json +11 -9
  53. package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
  54. package/dist/browser/chunks/runtime-wcU7KOFU-ac86d7b8.js +0 -8536
  55. package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
  56. package/dist/browser/chunks/tool-instance-id-2a92deb0.js +0 -1
  57. package/dist/browser/chunks/tts-runtime-config-a7ab1ad4.js +0 -194
  58. /package/dist/browser/chunks/{ItemToolBar-jx38w99s-58defccc.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
  59. /package/dist/chunks/{ItemToolBar-jx38w99s-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
@@ -1,5 +1,5 @@
1
- import{a as Yi,m as Vi,r as Gi}from"./tool-host-contract-b93b482c.js";import{n as Ki,r as Ji,s as Zi}from"./overlay-containment-edaaff13.js";import{t as Qi}from"./pointer-gesture-ce75f0a7.js";import{i as to}from"./provider-4c704118.js";import{t as eo}from"./ToolCoordinator-cc2dc319.js";if(typeof window<"u"){var ir,or;((ir=(or=window).__svelte??(or.__svelte={})).v??(ir.v=new Set)).add("5")}var Jt={},j=Symbol("uninitialized"),no=Array.isArray,ro=Array.prototype.indexOf,wn=Array.prototype.includes,io=Array.from,Ie=Object.keys,he=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,oo=Object.getOwnPropertyDescriptors,so=Object.prototype,ao=Array.prototype,Sr=Object.getPrototypeOf,sr=Object.isExtensible,lo=()=>{};function uo(t){for(var e=0;e<t.length;e++)t[e]()}function Wr(){var t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function ce(t){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(t)}function fo(t,e){if(ce(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ce(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ho(t){var e=fo(t,"string");return ce(e)=="symbol"?e:e+""}function E(t,e,n){return(e=ho(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var G=1024,ot=2048,Ht=4096,Rn=8192,co=16384,zn=32768,ar=1<<25,jn=65536,ne=1<<19,vo=1<<20,lr=1<<21,po=1<<22,Be=1<<23,le=Symbol("$state"),Ar=Symbol("component"),Er=Symbol("legacy props"),wo=Symbol(""),mn=Symbol("attributes"),mo=Symbol("class"),gn=Symbol("style"),Ne=Symbol("text"),me=new class extends Error{constructor(...t){super(...t),E(this,"name","StaleReactionError"),E(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},go=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function bo(){console.warn("https://svelte.dev/e/derived_inert")}function Ze(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function yo(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function Yt(t){T=t}var W;function it(t){if(t===null)throw Ze(),Jt;return W=t}function On(){return it(yt(W))}function Tr(t){if(T){if(yt(W)!==null)throw Ze(),Jt;W=t}}function $o(t=1){if(T){for(var e=t,n=W;e--;)n=yt(n);W=n}}function Pr(t=!0){for(var e=0,n=W;;){if(n.nodeType===8){var r=n.data;if(r==="]"){if(e===0)return n;e-=1}else(r==="["||r==="[!"||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(e+=1)}var i=yt(n);t&&n.remove(),n=i}}function ko(t){if(!t||t.nodeType!==8)throw Ze(),Jt;return t.data}function Rr(t){return t===this.v}function _o(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function zr(t){return!_o(t,this.v)}function xo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Mo(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function So(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Wo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ao(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Eo(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function To(){throw new Error("https://svelte.dev/e/hydration_failed")}function Po(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ro(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function jo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Oo(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Qe=!1,ge=!1,P=null;function Zt(t){P=t}function jr(t,e=!1,n){P={p:P,i:!1,c:null,e:null,s:t,x:null,r:k,l:ge&&!e?{s:null,u:null,$:[]}:null}}function Or(t){var e=P,n=e.e;if(n!==null){e.e=null;for(var r of n)ei(r)}return t!==void 0&&(e.x=t),e.i=!0,P=e.p,Dn(t)}function Dn(t={}){return he(t,Ar,{value:!0}),t}function be(){return!ge||P!==null&&P.l===null}var Rt=[];function Dr(){var t=Rt;Rt=[],uo(t)}function Nt(t){if(Rt.length===0&&!ue){var e=Rt;queueMicrotask(()=>{e===Rt&&Dr()})}Rt.push(t)}function Do(){for(;Rt.length>0;)Dr()}var Lo=~(ot|Ht|G);function R(t,e){t.f=t.f&Lo|e}function Ln(t){(t.f&512)!==0||t.deps===null?R(t,G):R(t,Ht)}function Lr(t,e,n){(t.f&2048)!==0?e.add(t):t.f&4096&&n.add(t),R(t,G)}function tn(t){var e=M,n=k;K(null),dt(null);try{return t()}finally{K(e),dt(n)}}function No(t,e,n,r){const i=be()?de:Cr;var o=t.filter(p=>!p.settled),a=e.map(i);if(n.length===0&&o.length===0){r(a);return}var l=k,h=Co(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(p=>p.promise)):null;function d(p){if((l.f&16384)===0){h();try{r([...a,...p])}catch(m){ct(m,l)}Fe()}}var v=Nr();if(n.length===0){u.then(()=>d([])).finally(v);return}function w(){Promise.all(n.map(p=>Ho(p))).then(d).catch(p=>ct(p,l)).finally(v)}u?u.then(()=>{h(),w(),Fe()}):w()}function Co(){var t=k,e=M,n=P,r=x;return function(i=!0){dt(t),K(e),Zt(n),i&&!(t.f&16384)&&(r?.activate(),r?.apply())}}function Fe(t=!0){dt(null),K(null),Zt(null),t&&x?.deactivate()}function Nr(){var t=k,e=t.b,n=x,r=!!e?.is_rendered();return e?.update_pending_count(1,n),n.increment(r,t),()=>{e?.update_pending_count(-1,n),n.decrement(r,t)}}function de(t){var e=2|ot;return k!==null&&(k.f|=ne),{ctx:P,deps:null,effects:null,equals:Rr,f:e,fn:t,reactions:null,rv:0,v:j,wv:0,parent:k,ac:null}}var se=Symbol("obsolete");function Ho(t,e,n){let r=k;r===null&&Mo();var i=void 0,o=ye(j),a=!M,l=new Set;return ss(()=>{var h=k,u=Wr();i=u.promise;try{Promise.resolve(t()).then(u.resolve,p=>{p!==me&&u.reject(p)}).finally(Fe)}catch(p){u.reject(p),Fe()}var d=x;if(a){if((h.f&32768)!==0)var v=Nr();if(r.b?.is_rendered())d.async_deriveds.get(h)?.reject(se);else for(const p of l.values())p.reject(se);l.add(u),d.async_deriveds.set(h,u)}const w=(p,m=void 0)=>{v?.(),l.delete(u),m!==se&&(d.activate(),m?(o.f|=Be,Ge(o,m)):(o.f&8388608&&(o.f^=Be),Ge(o,p)),d.deactivate())};u.promise.then(w,p=>w(null,p||"unknown"))}),rs(()=>{for(const h of l)h.reject(se)}),new Promise(h=>{function u(d){function v(){d===i?h(o):u(i)}d.then(v,v)}u(i)})}function on(t){const e=de(t);return ui(e),e}function Cr(t){const e=de(t);return e.equals=zr,e}function Io(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)F(e[n])}}function Nn(t){var e,n=k,r=t.parent;if(!bt&&r!==null&&t.v!==j&&(r.f&24576)!==0)return bo(),t.v;dt(r);try{Io(t),e=di(t)}finally{dt(n)}return e}function Hr(t){var e=Nn(t);if(!t.equals(e)&&(t.wv=hi(),(!x?.is_fork||t.deps===null)&&(x!==null?(x.capture(t,e,!0),yn?.capture(t,e,!0)):t.v=e,t.deps===null))){R(t,G);return}bt||(H!==null?(Bn()||x?.is_fork)&&H.set(t,e):Ln(t))}function Bo(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&tn(()=>{e.ac.abort(me),e.ac=null}),e.fn!==null&&(e.teardown=lo),pe(e,0),qn(e))}function Ir(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&te(e)}function Br(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cn(t,e){Br(t,e),e.add(t)}function b(t,e,n){Br(t,e),e.set(t,n)}function y(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function g(t,e,n){return t.set(y(t,e),n),n}function s(t,e){return t.get(y(t,e))}var Fr,bn=null,Ft=null,x=null,yn=null,H=null,$n=null,ue=!1,sn=!1,ve=null,qe=null,qr=0,Fo=1,kn=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,Ue=new WeakMap,Pe=new WeakMap,qt=new WeakMap,Et=new WeakMap,ae=new WeakMap,ut=new WeakMap,ur=new WeakMap,Qt=new WeakMap,wt=new WeakMap,kt=new WeakMap,an=new WeakMap,Re=new WeakMap,z=new WeakSet,It=class Ur{constructor(){Cn(this,z),E(this,"id",Fo++),b(this,kn,!1),E(this,"linked",!0),b(this,Ot,null),b(this,Vt,null),E(this,"async_deriveds",new Map),E(this,"current",new Map),E(this,"previous",new Map),b(this,Ue,new Set),b(this,Pe,new Set),b(this,qt,0),b(this,Et,new Map),b(this,ae,null),b(this,ut,[]),b(this,ur,[]),b(this,Qt,new Set),b(this,wt,new Set),b(this,kt,new Map),b(this,an,new Set),E(this,"is_fork",!1),b(this,Re,!1),Ft===null?bn=Ft=this:(g(Vt,Ft,this),g(Ot,this,Ft)),Ft=this}skip_effect(e){s(kt,this).has(e)||s(kt,this).set(e,{d:[],m:[]}),s(an,this).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=s(kt,this).get(e);if(r){s(kt,this).delete(e);for(var i of r.d)R(i,ot),n(i);for(i of r.m)R(i,Ht),n(i)}s(an,this).add(e)}capture(e,n,r=!1){e.v!==j&&!this.previous.has(e)&&this.previous.set(e,e.v),!(e.f&8388608)&&(this.current.set(e,[n,r]),H?.set(e,n)),this.is_fork||(e.v=n)}activate(){x=this}deactivate(){x=null,H=null}flush(){try{sn=!0,x=this,y(z,this,Xe).call(this)}finally{qr=0,$n=null,ve=null,qe=null,sn=!1,x=null,H=null,ht.clear()}}discard(){for(const e of s(Pe,this))e(this);s(Pe,this).clear();for(const e of this.async_deriveds.values())e.reject(se);y(z,this,Ye).call(this),s(ae,this)?.resolve()}register_created_effect(e){s(ur,this).push(e)}increment(e,n){if(g(qt,this,s(qt,this)+1),e){let r=s(Et,this).get(n)??0;s(Et,this).set(n,r+1)}}decrement(e,n){if(g(qt,this,s(qt,this)-1),e){let r=s(Et,this).get(n)??0;r===1?s(Et,this).delete(n):s(Et,this).set(n,r-1)}s(Re,this)||(g(Re,this,!0),Nt(()=>{g(Re,this,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)s(Qt,this).add(r);for(const r of n)s(wt,this).add(r);e.clear(),n.clear()}oncommit(e){s(Ue,this).add(e)}ondiscard(e){s(Pe,this).add(e)}settled(){return(s(ae,this)??g(ae,this,Wr())).promise}static ensure(){if(x===null){const e=x=new Ur;!sn&&!ue&&Nt(()=>{s(kn,e)||e.flush()})}return x}apply(){if(!Qe||!this.is_fork&&s(Ot,this)===null&&s(Vt,this)===null){H=null;return}H=new Map;for(const[n,[r]]of this.current)H.set(n,r);for(let n=bn;n!==null;n=s(Vt,n))if(!(n===this||n.is_fork)){var e=!1;if(n.id<this.id){for(const[r,[,i]]of n.current)if(!i&&this.current.has(r)){e=!0;break}}if(!e)for(const[r,i]of n.previous)H.has(r)||H.set(r,i)}}schedule(e){if($n=e,e.b?.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}s(ut,this).push(e)}};Fr=It;function fr(){if(this.is_fork)return!0;for(const n of s(Et,this).keys()){for(var t=n,e=!1;t.parent!==null;){if(s(kt,this).has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}function qo(){var t=[];for(const i of s(ut,this))if(!((i.f&16384)!==0||(i.f&6144)===0)){for(var e=i,n=!1;e.parent!==null;){e=e.parent;var r=e.f;if((r&96)!==0){if((r&1024)===0){n=!0;break}e.f^=G}}n||t.push(e)}return g(ut,this,[]),t}function Xe(){g(kn,this,!0);for(const a of s(Qt,this))s(wt,this).delete(a),R(a,ot),this.schedule(a);for(const a of s(wt,this))R(a,Ht),this.schedule(a);this.apply();for(var t=ve=[],e=[],n=qe=[];s(ut,this).length>0;){qr++>1e3&&(y(z,this,Ye).call(this),Vo());for(const a of y(z,this,qo).call(this))try{y(z,this,Uo).call(this,a,t,e)}catch(l){throw Vr(a),y(z,this,fr).call(this)||this.discard(),l}}if(x=null,n.length>0){var r=Fr.ensure();for(const a of n)r.schedule(a)}if(ve=null,qe=null,y(z,this,fr).call(this)){y(z,this,ze).call(this,e),y(z,this,ze).call(this,t);for(const[a,l]of s(kt,this))Yr(a,l);n.length>0&&y(z,x,Xe).call(x);return}const i=y(z,this,Xo).call(this);if(i){y(z,this,ze).call(this,e),y(z,this,ze).call(this,t),y(z,i,Yo).call(i,this);return}s(Qt,this).clear(),s(wt,this).clear();for(const a of s(Ue,this))a(this);s(Ue,this).clear(),yn=this,hr(e),hr(t),yn=null,s(ae,this)?.resolve();var o=x;if(s(qt,this)===0&&(s(ut,this).length===0||o!==null)&&y(z,this,Ye).call(this),s(ut,this).length>0)if(o!==null){for(const a of s(ut,this))s(ut,o).push(a);g(ut,this,[])}else o=this;o!==null&&(ht.clear(),y(z,o,Xe).call(o))}function Uo(t,e,n){t.f^=G;for(var r=t.first;r!==null;){var i=r.f,o=(i&96)!==0;if(!(o&&(i&1024)!==0||(i&8192)!==0||s(kt,this).has(r))&&r.fn!==null){o?r.f^=G:(i&4)!==0?e.push(r):Qe&&(i&16777224)!==0?n.push(r):ke(r)&&(i&16&&s(wt,this).add(r),te(r));var a=r.first;if(a!==null){r=a;continue}}for(;r!==null;){var l=r.next;if(l!==null){r=l;break}r=r.parent}}}function Xo(){for(var t=s(Ot,this);t!==null;){if(!t.is_fork){for(const[e,[,n]]of this.current)if(t.current.has(e)&&!n)return t}t=s(Ot,t)}return null}function Yo(t){for(const[n,r]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,r);for(const[n,r]of t.async_deriveds){const i=this.async_deriveds.get(n);i&&r.promise.then(i.resolve).catch(i.reject)}t.async_deriveds.clear(),this.transfer_effects(s(Qt,t),s(wt,t));const e=n=>{var r=n.reactions;if(r!==null&&!((n.f&2)!==0&&(n.f&6144)===0))for(const a of r){var i=a.f;if((i&2)!==0)e(a);else{var o=a;i&4194320&&!this.async_deriveds.has(o)&&(s(wt,this).delete(o),R(o,ot),this.schedule(o))}}};for(const n of this.current.keys())e(n);this.oncommit(()=>t.discard()),y(z,t,Ye).call(t),x=this,y(z,this,Xe).call(this)}function ze(t){for(var e=0;e<t.length;e+=1)Lr(t[e],s(Qt,this),s(wt,this))}function Ye(){if(this.linked){var t=s(Ot,this),e=s(Vt,this);t===null?bn=e:g(Vt,t,e),e===null?Ft=t:g(Ot,e,t),this.linked=!1}}function _n(t){var e=ue;ue=!0;try{var n;for(t&&(x!==null&&!x.is_fork&&x.flush(),n=t());;){if(Do(),x===null)return n;x.flush()}}finally{ue=e}}function Vo(){try{Eo()}catch(t){ct(t,$n)}}var lt=null;function hr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&24576)===0&&ke(r)&&(lt=new Set,te(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&oi(r),lt?.size>0)){ht.clear();for(const i of lt){if((i.f&24576)!==0)continue;const o=[i];let a=i.parent;for(;a!==null;)lt.has(a)&&(lt.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){const h=o[l];!(h.f&24576)&&te(h)}}lt.clear()}}lt=null}}function Xr(t){x.schedule(t)}function Yr(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):t.f&4096&&e.m.push(t),R(t,G);for(var n=t.first;n!==null;)Yr(n,e),n=n.next}}function Vr(t){R(t,G);for(var e=t.first;e!==null;)Vr(e),e=e.next}var Ve=new Set,ht=new Map,Gr=!1;function ye(t,e){return{f:0,v:t,reactions:null,equals:Rr,rv:0,wv:0}}function N(t,e){const n=ye(t,e);return ui(n),n}function Go(t,e=!1,n=!0){const r=ye(t);if(e||(r.equals=zr),ge&&n&&P!==null&&P.l!==null){var i;((i=P.l).s??(i.s=[])).push(r)}return r}function S(t,e,n=!1){return M!==null&&(!Q||M.f&131072)&&be()&&M.f&4325394&&(et===null||!et.has(t))&&jo(),Ge(t,n?_t(e):e,qe)}var Pt=null,xn=0;function Ge(t,e,n=null){if(!t.equals(e)){bt?ht.set(t,e):ht.has(t)||ht.set(t,t.v);var r=It.ensure();if(r.capture(t,e),(t.f&2)!==0){const i=t;t.f&2048&&Nn(i),H===null&&Ln(i)}t.wv=hi(),Pt=null,xn=0,Kr(t,ot,n),Pt=null,be()&&k!==null&&k.f&1024&&!(k.f&96)&&(V===null?hs([t]):V.push(t)),!r.is_fork&&Ve.size>0&&!Gr&&Ko()}return e}function Ko(){Gr=!1;for(const t of Ve){t.f&1024&&R(t,Ht);let e;try{e=ke(t)}catch{e=!0}e&&te(t)}Ve.clear()}function fe(t){S(t,t.v+1)}function Kr(t,e,n){var r=t.reactions;if(r!==null){var i=be(),o=r.length;if(xn+=o,xn>1e5&&Pt===null&&(Pt=new Set),Pt!==null){if(Pt.has(t))return;Pt.add(t)}for(var a=0;a<o;a++){var l=r[a],h=l.f;if(!(!i&&l===k)){var u=(h&ot)===0;if(u&&R(l,e),(h&131072)!==0)Ve.add(l);else if((h&2)!==0){var d=l;H?.delete(d),Kr(d,Ht,n)}else if(u){var v=l;h&16&&lt!==null&&lt.add(v),n!==null?n.push(v):Xr(v)}}}}}function _t(t){if(typeof t!="object"||t===null||le in t||Ar in t)return t;const e=Sr(t);if(e!==so&&e!==ao)return t;var n=new Map,r=no(t),i=N(0),o=null,a=Dt,l=h=>{if(Dt===a)return h();var u=M,d=Dt;K(null),wr(a);var v=h();return K(u),wr(d),v};return r&&n.set("length",N(t.length,o)),new Proxy(t,{defineProperty(h,u,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&Ro();var v=n.get(u);return v===void 0?l(()=>{var w=N(d.value,o);return n.set(u,w),w}):S(v,d.value,!0),!0},deleteProperty(h,u){var d=n.get(u);if(d===void 0){if(u in h){const v=l(()=>N(j,o));n.set(u,v),fe(i)}}else S(d,j),fe(i);return!0},get(h,u,d){if(u===le)return t;var v=n.get(u),w=u in h;if(v===void 0&&(!w||jt(h,u)?.writable)&&(v=l(()=>N(_t(w?h[u]:j),o)),n.set(u,v)),v!==void 0){var p=f(v);return p===j?void 0:p}return Reflect.get(h,u,d)},getOwnPropertyDescriptor(h,u){this.has?.(h,u);var d=Reflect.getOwnPropertyDescriptor(h,u),v=n.get(u);if(v!==void 0){var w=f(v);if(w===j)return;if(d&&"value"in d)d.value=w;else return{enumerable:!0,configurable:!0,value:w,writable:!0}}return d},has(h,u){if(u===le)return!0;var d=n.get(u),v=d!==void 0&&d.v!==j||Reflect.has(h,u);return(d!==void 0||k!==null&&(!v||jt(h,u)?.writable))&&(d===void 0&&(d=l(()=>N(v?_t(h[u]):j,o)),n.set(u,d)),f(d)===j)?!1:v},set(h,u,d,v){var w=n.get(u),p=u in h;if(r&&u==="length")for(var m=d;m<w.v;m+=1){var _=n.get(m+"");_!==void 0?S(_,j):m in h&&(_=l(()=>N(j,o)),n.set(m+"",_))}if(w===void 0)(!p||jt(h,u)?.writable)&&(w=l(()=>N(void 0,o)),S(w,_t(d)),n.set(u,w));else{p=w.v!==j;var A=l(()=>_t(d));S(w,A)}var D=Reflect.getOwnPropertyDescriptor(h,u);if(D?.set&&D.set.call(v,d),!p){if(r&&typeof u=="string"){var I=n.get("length"),J=Number(u);Number.isInteger(J)&&J>=I.v&&S(I,J+1)}fe(i)}return!0},ownKeys(h){f(i);var u=Reflect.ownKeys(h).filter(w=>{var p=n.get(w);return p===void 0||p.v!==j});for(var[d,v]of n)v.v!==j&&!(d in h)&&u.push(d);return u},setPrototypeOf(){zo()}})}var cr,Jr,Zr,Qr;function Mn(){if(cr===void 0){cr=window,Jr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Zr=jt(e,"firstChild").get,Qr=jt(e,"nextSibling").get,sr(t)&&(t[mo]=void 0,t[mn]=null,t[gn]=void 0,t.__e=void 0),sr(n)&&(n[Ne]=void 0)}}function mt(t=""){return document.createTextNode(t)}function Ct(t){return Zr.call(t)}function yt(t){return Qr.call(t)}function ti(t,e){if(!T)return Ct(t);var n=Ct(W);if(n===null)n=W.appendChild(mt());else if(e&&n.nodeType!==3){var r=mt();return n?.before(r),it(r),r}return e&&In(n),it(n),n}function dr(t,e=!1){if(!T){var n=Ct(t);return n instanceof Comment&&n.data===""?yt(n):n}if(e){if(W?.nodeType!==3){var r=mt();return W?.before(r),it(r),r}In(W)}return W}function Jo(t,e=!1){if(!T)return Ct(t);var n=ti(t,e);return Tr(t),n}function je(t,e=1,n=!1){let r=T?W:t;for(var i;e--;)i=r,r=yt(r);if(!T)return r;if(n){if(r?.nodeType!==3){var o=mt();return r===null?i?.after(o):r.before(o),it(o),o}In(r)}return it(r),r}function Zo(t){t.textContent=""}function Qo(){return!Qe||lt!==null?!1:(k.f&zn)!==0}function Hn(t,e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?n?document.createElement(t,{is:n}):document.createElement(t):n?document.createElementNS(e,t,{is:n}):document.createElementNS(e,t)}function In(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===3;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function ts(t){var e=k;if(e===null)return M.f|=Be,t;if((e.f&32768)===0&&(e.f&4)===0)throw t;ct(t,e)}function ct(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0&&(e.f&33570816)===0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}}function es(t){k===null&&(M===null&&Ao(t),Wo()),bt&&So(t)}function ns(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function vt(t,e){var n=k;n!==null&&n.f&8192&&(t|=Rn);var r={ctx:P,deps:null,nodes:null,f:t|ot|512,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};x?.register_created_effect(r);var i=r;if((t&4)!==0)ve!==null?ve.push(r):It.ensure().schedule(r);else if(e!==null){try{te(r)}catch(a){throw F(r),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,t&16&&t&65536&&i!==null&&(i.f|=jn))}if(i!==null&&(i.parent=n,n!==null&&ns(i,n),M!==null&&(M.f&2)!==0&&(t&64)===0)){var o=M;(o.effects??(o.effects=[])).push(i)}return r}function Bn(){return M!==null&&!Q}function rs(t){const e=vt(8,null);return R(e,G),e.teardown=t,e}function Tt(t){es("$effect");var e=k.f;if(!M&&(e&32)!==0&&P!==null&&!P.i){var n=P;(n.e??(n.e=[])).push(t)}else return ei(t)}function ei(t){return vt(4|vo,t)}function is(t){It.ensure();const e=vt(64|ne,t);return()=>{F(e)}}function os(t){It.ensure();const e=vt(64|ne,t);return(n={})=>new Promise(r=>{n.outro?$e(e,()=>{F(e),r(void 0)}):(F(e),r(void 0))})}function ni(t){return vt(4,t)}function ss(t){return vt(po|ne,t)}function Fn(t,e=0){return vt(8|e,t)}function as(t,e=[],n=[],r=[]){No(r,e,n,i=>{vt(8,()=>{t(...i.map(f))})})}function ri(t,e=0){return vt(16|e,t)}function gt(t){return vt(32|ne,t)}function ii(t){var e=t.teardown;if(e!==null){const n=bt,r=M;pr(!0),K(null);try{e.call(null)}catch(i){ct(i,t.parent)}finally{pr(n),K(r)}}}function qn(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&tn(()=>{i.abort(me)});var r=n.next;(n.f&64)!==0?n.parent=null:F(n,e),n=r}}function ls(t){for(var e=t.first;e!==null;){var n=e.next;!(e.f&32)&&F(e),e=n}}function F(t,e=!0){var n=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(us(t.nodes.start,t.nodes.end),n=!0),t.f|=ar,qn(t,e&&!n),pe(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)o.stop();ii(t),t.f^=ar,t.f|=co;var i=t.parent;i!==null&&i.first!==null&&oi(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function us(t,e){for(;t!==null;){var n=t===e?null:yt(t);t.remove(),t=n}}function oi(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function $e(t,e,n=!0){var r=[];t.f|=256,si(t,r,!0);var i=()=>{n&&F(t),e&&e()},o=r.length;if(o>0){var a=()=>--o||i();for(var l of r)l.out(a)}else i()}function si(t,e,n){if((t.f&8192)===0){t.f^=Rn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&e.push(l);for(var i=t.first;i!==null;){var o=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(t.f&16)!==0;si(i,e,a?n:!1)}i=o}}}function vr(t){t.f&=-257,ai(t,!0)}function ai(t,e){if((t.f&256)===0&&(t.f&8192)!==0){t.f^=Rn,!(t.f&1024)&&(R(t,ot),It.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,i=(n.f&65536)!==0||(n.f&32)!==0;ai(n,i?e:!1),n=r}var o=t.nodes&&t.nodes.t;if(o!==null)for(const a of o)(a.is_global||e)&&a.in()}}function li(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var i=n===r?null:yt(n);e.append(n),n=i}}var fs=null,Ce=!1,bt=!1;function pr(t){bt=t}var M=null,Q=!1;function K(t){M=t}var k=null;function dt(t){k=t}var et=null;function ui(t){M!==null&&(M.f&2097152||M.f&2)&&(et??(et=new Set)).add(t)}var B=null,U=0,V=null;function hs(t){V=t}var fi=1,zt=0,Dt=zt;function wr(t){Dt=t}function hi(){return++fi}function ke(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var n=t.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(ke(o)&&Hr(o),o.wv>t.wv)return!0}e&512&&H===null&&R(t,G)}return!1}function ci(t,e,n=!0){var r=t.reactions;if(r!==null&&!(!Qe&&et!==null&&et.has(t)))for(var i=0;i<r.length;i++){var o=r[i];(o.f&2)!==0?ci(o,e,!1):e===o&&(n?R(o,ot):o.f&1024&&R(o,Ht),Xr(o))}}function di(t){var e=B,n=U,r=V,i=M,o=et,a=P,l=Q,h=Dt,u=t.f;B=null,U=0,V=null,M=(u&96)===0?t:null,et=null,Zt(t.ctx),Q=!1,Dt=++zt,t.ac!==null&&(tn(()=>{t.ac.abort(me)}),t.ac=null);try{t.f|=lr;var d=t.fn,v=d();t.f|=zn;var w=mr(t);if(be()&&V!==null&&!Q&&w!==null&&(t.f&6146)===0)for(var p=0;p<V.length;p++)ci(V[p],t);if(i!==null&&i!==t){if(zt++,i.deps!==null)for(let m=0;m<n;m+=1)i.deps[m].rv=zt;if(e!==null)for(const m of e)m.rv=zt;V!==null&&(r===null?r=V:r.push(...V))}return t.f&8388608&&(t.f^=Be),v}catch(m){return mr(t),ts(m)}finally{t.f^=lr,B=e,U=n,V=r,M=i,et=o,Zt(a),Q=l,Dt=h}}function mr(t){var e=t.deps,n=x?.is_fork;if(B!==null){var r;if(n||pe(t,U),e!==null&&U>0)for(e.length=U+B.length,r=0;r<B.length;r++)e[U+r]=B[r];else t.deps=e=B;if(Bn()&&(t.f&512)!==0)for(r=U;r<e.length;r++){var i;((i=e[r]).reactions??(i.reactions=[])).push(t)}}else!n&&e!==null&&U<e.length&&(pe(t,U),e.length=U);return e}function cs(t,e){let n=e.reactions;if(n!==null){var r=ro.call(n,t);if(r!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(e.f&2)!==0&&(B===null||!wn.call(B,e))){var o=e;o.f&512&&(o.f^=512),o.v!==j&&Ln(o),o.ac!==null&&tn(()=>{o.ac.abort(me),o.ac=null,R(o,ot)}),Bo(o),pe(o,0)}}function pe(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)cs(t,n[r])}function te(t){var e=t.f;if((e&16384)===0){R(t,G);var n=k,r=Ce;k=t,Ce=(e&96)===0;try{(e&16777232)!==0?ls(t):qn(t),ii(t);var i=di(t);t.teardown=typeof i=="function"?i:null,t.wv=fi}finally{Ce=r,k=n}}}function f(t){var e=(t.f&2)!==0;if(fs?.add(t),M!==null&&!Q&&!(k!==null&&(k.f&16384)!==0)&&(et===null||!et.has(t))){var n=M.deps;if((M.f&2097152)!==0)t.rv<zt&&(t.rv=zt,B===null&&n!==null&&n[U]===t?U++:B===null?B=[t]:B.push(t));else{var r;(r=M).deps??(r.deps=[]),wn.call(M.deps,t)||M.deps.push(t);var i=t.reactions;i===null?t.reactions=[M]:wn.call(i,M)||i.push(M)}}if(bt&&ht.has(t))return ht.get(t);if(e){var o=t;if(bt){var a=o.v;return(!(o.f&1024)&&o.reactions!==null||pi(o))&&(a=Nn(o)),ht.set(o,a),a}var l=(o.f&512)===0&&!Q&&M!==null&&(Ce||(M.f&512)!==0),h=(o.f&zn)===0;ke(o)&&(l&&(o.f|=512),Hr(o)),l&&!h&&(Ir(o),vi(o))}if(H?.has(t))return H.get(t);if((t.f&8388608)!==0)throw t.v;return t.v}function vi(t){if(t.f|=512,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&2&&!(e.f&512)&&(Ir(e),vi(e))}function pi(t){if(t.v===j)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(ht.has(e)||(e.f&2)!==0&&pi(e))return!0;return!1}function ee(t){var e=Q;try{return Q=!0,t()}finally{Q=e}}var Gt=Symbol("events"),wi=new Set,Sn=new Set;function ie(t,e,n){(e[Gt]??(e[Gt]={}))[t]=n}function ds(t){for(var e=0;e<t.length;e++)wi.add(t[e]);for(var n of Sn)n(t)}var ln=null,un=!1;function gr(t){var e=this,n=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],o=i[0]||t.target;ln=t,un||(un=!0,setTimeout(()=>{un=!1,ln=null}));var a=0,l=ln===t&&t[Gt];if(l){var h=i.indexOf(l);if(h!==-1&&(e===document||e===window)){t[Gt]=e;return}var u=i.indexOf(e);if(u===-1)return;h<=u&&(a=h)}if(o=i[a]||t.target,o!==e){he(t,"currentTarget",{configurable:!0,get(){return o||n}});var d=M,v=k;K(null),dt(null);try{for(var w,p=[];o!==null&&o!==e;){try{var m=o[Gt]?.[r];m!=null&&(!o.disabled||t.target===o)&&m.call(o,t)}catch(_){w?p.push(_):w=_}if(t.cancelBubble)break;a++,o=a<i.length?i[a]:null}if(w){for(let _ of p)queueMicrotask(()=>{throw _});throw w}}finally{t[Gt]=e,delete t.currentTarget,K(d),dt(v)}}}var vs=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function ps(t){return vs?.createHTML(t)??t}function ws(t){var e=Hn("template");return e.innerHTML=ps(t.replaceAll("<!>","<!---->")),e.content}function Kt(t,e){var n=k;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function ms(t,e){var n=(e&1)!==0,r=(e&2)!==0,i,o=!t.startsWith("<!>");return()=>{if(T)return Kt(W,null),W;i===void 0&&(i=ws(o?t:"<!>"+t),n||(i=Ct(i)));var a=r||Jr?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=Ct(a),h=a.lastChild;Kt(l,h)}else Kt(a,a);return a}}function gs(){if(T)return Kt(W,null),W;var t=document.createDocumentFragment(),e=document.createComment(""),n=mt();return t.append(e,n),Kt(e,n),t}function Wn(t,e){if(T){var n=k;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=W),On();return}t!==null&&t.before(e)}var bs=["touchstart","touchmove"];function ys(t){return bs.includes(t)}function $s(t){let e=0,n=ye(0),r;return()=>{Bn()&&(f(n),Fn(()=>(e===0&&(r=ee(()=>t(()=>fe(n)))),e+=1,()=>{Nt(()=>{e-=1,e===0&&(r?.(),r=void 0,fe(n))})})))}}var ks=jn|ne;function _s(t,e,n,r){new xs(t,e,n,r)}var nt=new WeakMap,An=new WeakMap,ft=new WeakMap,we=new WeakMap,X=new WeakMap,rt=new WeakMap,Y=new WeakMap,tt=new WeakMap,xt=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Oe=new WeakMap,En=new WeakMap,Tn=new WeakMap,Wt=new WeakMap,br=new WeakMap,O=new WeakSet,xs=class{constructor(t,e,n,r){Cn(this,O),E(this,"parent",void 0),E(this,"is_pending",!1),E(this,"transform_error",void 0),b(this,nt,void 0),b(this,An,T?W:null),b(this,ft,void 0),b(this,we,void 0),b(this,X,void 0),b(this,rt,null),b(this,Y,null),b(this,tt,null),b(this,xt,null),b(this,Ut,0),b(this,Lt,0),b(this,Oe,!1),b(this,En,new Set),b(this,Tn,new Set),b(this,Wt,null),b(this,br,$s(()=>(g(Wt,this,ye(s(Ut,this))),()=>{g(Wt,this,null)}))),g(nt,this,t),g(ft,this,e),g(we,this,i=>{var o=k;o.b=this,o.f|=128,n(i)}),this.parent=k.b,this.transform_error=r??this.parent?.transform_error??(i=>i),g(X,this,ri(()=>{if(T){const i=s(An,this);On();const o=i.data==="[!";if(i.data.startsWith("[?")){const a=JSON.parse(i.data.slice(2));y(O,this,Ss).call(this,a)}else o?y(O,this,Ws).call(this):y(O,this,Ms).call(this)}else y(O,this,gi).call(this)},ks)),T&&g(nt,this,W)}defer_effect(t){Lr(t,s(En,this),s(Tn,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(ft,this).pending}update_pending_count(t,e){y(O,this,bi).call(this,t,e),g(Ut,this,s(Ut,this)+t),s(Wt,this)&&!s(Oe,this)&&(g(Oe,this,!0),Nt(()=>{g(Oe,this,!1),s(Wt,this)&&Ge(s(Wt,this),s(Ut,this))}))}get_effect_pending(){return s(br,this).call(this),f(s(Wt,this))}error(t){if(!s(ft,this).onerror&&!s(ft,this).failed)throw t;x?.is_fork?(s(rt,this)&&x.skip_effect(s(rt,this)),s(Y,this)&&x.skip_effect(s(Y,this)),s(tt,this)&&x.skip_effect(s(tt,this)),x.oncommit(()=>{y(O,this,yr).call(this,t)})):y(O,this,yr).call(this,t)}};function Ms(){try{g(rt,this,gt(()=>s(we,this).call(this,s(nt,this))))}catch(t){this.error(t)}}function Ss(t){const e=s(ft,this).failed,{reset:n,invoke_onerror:r}=y(O,this,mi).call(this,t);Nt(r),e&&g(tt,this,gt(()=>{e(s(nt,this),()=>t,()=>n)}))}function mi(t){var e=!1,n=!1;const r=()=>{if(e){yo();return}e=!0,n&&Oo(),s(tt,this)!==null&&$e(s(tt,this),()=>{g(tt,this,null)}),y(O,this,Un).call(this,()=>{y(O,this,gi).call(this)})};return{reset:r,invoke_onerror:()=>{try{n=!0,s(ft,this).onerror?.(t,r),n=!1}catch(i){ct(i,s(X,this)&&s(X,this).parent)}}}}function Ws(){const t=s(ft,this).pending;t&&(this.is_pending=!0,g(Y,this,gt(()=>t(s(nt,this)))),Nt(()=>{var e=g(xt,this,document.createDocumentFragment()),n=mt(),r=!1;if(e.append(n),g(rt,this,y(O,this,Un).call(this,()=>{try{return gt(()=>s(we,this).call(this,n))}catch(i){try{this.error(i),r=!0}catch(o){ct(o,s(X,this).parent)}return null}})),s(rt,this)===null){g(xt,this,null),r&&y(O,this,Ke).call(this,x);return}s(Lt,this)===0&&(s(nt,this).before(e),g(xt,this,null),$e(s(Y,this),()=>{g(Y,this,null)}),y(O,this,Ke).call(this,x))}))}function gi(){try{if(this.is_pending=this.has_pending_snippet(),g(Lt,this,0),g(Ut,this,0),g(rt,this,gt(()=>{s(we,this).call(this,s(nt,this))})),s(Lt,this)>0){var t=g(xt,this,document.createDocumentFragment());li(s(rt,this),t);const e=s(ft,this).pending;g(Y,this,gt(()=>e(s(nt,this))))}else y(O,this,Ke).call(this,x)}catch(e){this.error(e)}}function Ke(t){this.is_pending=!1,t.transfer_effects(s(En,this),s(Tn,this))}function Un(t){var e=k,n=M,r=P;dt(s(X,this)),K(s(X,this)),Zt(s(X,this).ctx);try{return It.ensure(),t()}finally{dt(e),K(n),Zt(r)}}function bi(t,e){if(!this.has_pending_snippet()){if(this.parent){var n;y(O,n=this.parent,bi).call(n,t,e)}return}g(Lt,this,s(Lt,this)+t),s(Lt,this)===0&&(y(O,this,Ke).call(this,e),s(Y,this)&&$e(s(Y,this),()=>{g(Y,this,null)}),s(xt,this)&&(s(nt,this).before(s(xt,this)),g(xt,this,null)))}function yr(t){s(rt,this)&&(F(s(rt,this)),g(rt,this,null)),s(Y,this)&&(F(s(Y,this)),g(Y,this,null)),s(tt,this)&&(F(s(tt,this)),g(tt,this,null)),T&&(it(s(An,this)),$o(),it(Pr()));let e=s(ft,this).failed;const n=r=>{const{reset:i,invoke_onerror:o}=y(O,this,mi).call(this,r);o(),e&&g(tt,this,y(O,this,Un).call(this,()=>{try{return gt(()=>{var a=k;a.b=this,a.f|=128,e(s(nt,this),()=>r,()=>i)})}catch(a){return ct(a,s(X,this).parent),null}}))};Nt(()=>{var r;try{r=this.transform_error(t)}catch(i){ct(i,s(X,this)&&s(X,this).parent);return}r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(n,i=>ct(i,s(X,this)&&s(X,this).parent)):n(r)})}function As(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[Ne]??(t[Ne]=t.nodeValue))&&(t[Ne]=n,t.nodeValue=`${n}`)}function yi(t,e){return $i(t,e)}function Es(t,e){Mn(),e.intro=e.intro??!1;const n=e.target,r=T,i=W;try{for(var o=Ct(n);o&&(o.nodeType!==8||o.data!=="[");)o=yt(o);if(!o)throw Jt;Yt(!0),it(o);const a=$i(t,{...e,anchor:o});return Yt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
- `).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==Jt&&console.warn("Failed to hydrate: ",a),e.recover===!1&&To(),Mn(),Zo(n),Yt(!1),yi(t,e)}finally{Yt(r),it(i)}}var De=new Map;function $i(t,{target:e,anchor:n,props:r={},events:i,context:o,intro:a=!0,transformError:l}){Mn();var h=void 0,u=os(()=>{var d=n??e.appendChild(mt());_s(d,{pending:()=>{}},p=>{jr({});var m=P;if(o&&(m.c=o),i&&(r.$$events=i),T&&Kt(p,null),h=t(p,r)||Dn(),T&&(k.nodes.end=W,W===null||W.nodeType!==8||W.data!=="]"))throw Ze(),Jt;Or()},l);var v=new Set,w=p=>{for(var m=0;m<p.length;m++){var _=p[m];if(!v.has(_)){v.add(_);var A=ys(_);for(const J of[e,document]){var D=De.get(J);D===void 0&&(D=new Map,De.set(J,D));var I=D.get(_);I===void 0?(J.addEventListener(_,gr,{passive:A}),D.set(_,1)):D.set(_,I+1)}}}};return w(io(wi)),Sn.add(w),()=>{for(var p of v)for(const A of[e,document]){var m=De.get(A),_=m.get(p);--_==0?(A.removeEventListener(p,gr),m.delete(p),m.size===0&&De.delete(A)):m.set(p,_)}Sn.delete(w),d!==n&&d.parentNode?.removeChild(d)}});return Pn.set(h,u),h}var Pn=new WeakMap;function Ts(t,e){const n=Pn.get(t);return n?(Pn.delete(t),n(e)):Promise.resolve()}var pt=new WeakMap,$t=new WeakMap,Z=new WeakMap,oe=new WeakMap,fn=new WeakMap,hn=new WeakMap,$r=new WeakMap,Ps=class{constructor(t,e=!0){E(this,"anchor",void 0),b(this,pt,new Map),b(this,$t,new Map),b(this,Z,new Map),b(this,oe,new Set),b(this,fn,!0),b(this,hn,n=>{if(s(pt,this).has(n)){var r=s(pt,this).get(n),i=s($t,this).get(r);if(i)vr(i),s(oe,this).delete(r);else{var o=s(Z,this).get(r);o&&(vr(o.effect),s($t,this).set(r,o.effect),s(Z,this).delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),i=o.effect)}for(const[a,l]of s(pt,this)){if(s(pt,this).delete(a),a===n)break;const h=s(Z,this).get(l);h&&(F(h.effect),s(Z,this).delete(l))}for(const[a,l]of s($t,this)){if(a===r||s(oe,this).has(a))continue;const h=()=>{if(Array.from(s(pt,this).values()).includes(a)){var u=document.createDocumentFragment();li(l,u),u.append(mt()),s(Z,this).set(a,{effect:l,fragment:u})}else F(l);s(oe,this).delete(a),s($t,this).delete(a)};s(fn,this)||!i?(s(oe,this).add(a),$e(l,h,!1)):h()}}}),b(this,$r,n=>{s(pt,this).delete(n);const r=Array.from(s(pt,this).values());for(const[i,o]of s(Z,this))r.includes(i)||(F(o.effect),s(Z,this).delete(i))}),this.anchor=t,g(fn,this,e)}ensure(t,e){var n=x,r=Qo();if(e&&!s($t,this).has(t)&&!s(Z,this).has(t))if(r){var i=document.createDocumentFragment(),o=mt();i.append(o),s(Z,this).set(t,{effect:gt(()=>e(o)),fragment:i})}else s($t,this).set(t,gt(()=>e(this.anchor)));if(s(pt,this).set(n,t),r){for(const[a,l]of s($t,this))a===t?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of s(Z,this))a===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(s(hn,this)),n.ondiscard(s($r,this))}else T&&(this.anchor=W),s(hn,this).call(this,n)}};function Rs(t){P===null&&xo("onMount"),ge&&P.l!==null?zs(P).m.push(t):Tt(()=>{const e=ee(t);if(typeof e=="function")return e})}function zs(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function js(t,e,n=!1){var r;T&&(r=W,On());var i=new Ps(t),o=n?jn:0;function a(l,h){if(T){var u=ko(r);if(l!==parseInt(u.substring(1))){var d=Pr();it(d),i.anchor=d,Yt(!1),i.ensure(l,h),Yt(!0);return}}i.ensure(l,h)}ri(()=>{var l=!1;e((h,u=0)=>{l=!0,a(u,h)}),l||a(-1,null)},o)}function Os(t,e){ni(()=>{t=k?.parent?.nodes?.start??t;var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const i=Hn("style");i.id=e.hash,i.textContent=e.code,r.appendChild(i)}})}function kr(t,e=!1){var n=e?" !important;":";",r="";for(var i of Object.keys(t)){var o=t[i];o!=null&&o!==""&&(r+=" "+i+": "+o+n)}return r}function cn(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Ds(t,e){if(e){var n="",r,i;if(Array.isArray(e)?(r=e[0],i=e[1]):r=e,t){t=String(t).replaceAll(/\/\*.*?\*\//g,"").trim();var o=!1,a=0,l=!1,h=[];r&&h.push(...Object.keys(r).map(cn)),i&&h.push(...Object.keys(i).map(cn));var u=0,d=-1;const _=t.length;for(var v=0;v<_;v++){var w=t[v];if(l?w==="/"&&t[v-1]==="*"&&(l=!1):o?o===w&&(o=!1):w==="/"&&t[v+1]==="*"?l=!0:w==='"'||w==="'"?o=w:w==="("?a++:w===")"&&a--,!l&&o===!1&&a===0){if(w===":"&&d===-1)d=v;else if(w===";"||v===_-1){if(d!==-1){var p=cn(t.substring(u,d).trim());if(!h.includes(p)){w!==";"&&v++;var m=t.substring(u,v).trim();n+=" "+m+";"}}u=v+1,d=-1}}}}return r&&(n+=kr(r)),i&&(n+=kr(i,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function dn(t,e={},n,r){for(var i in n){var o=n[i];e[i]!==o&&(n[i]==null?t.style.removeProperty(i):t.style.setProperty(i,o,r))}}function Ls(t,e,n,r){var i=t[gn];if(T||i!==e){var o=Ds(e,r);(!T||o!==t.getAttribute("style"))&&(o==null?t.removeAttribute("style"):t.style.cssText=o),t[gn]=e}else r&&(Array.isArray(r)?(dn(t,n?.[0],r[0]),dn(t,n?.[1],r[1],"important")):dn(t,n,r));return r}var Ns=Symbol("is custom element"),Cs=Symbol("is html"),Hs=go?"link":"LINK";function st(t,e,n,r){var i=Is(t);T&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===Hs)||i[e]!==(i[e]=n)&&(e==="loading"&&(t[wo]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Bs(t).has(e)?t[e]=n:t.setAttribute(e,n))}function Is(t){return t[mn]??(t[mn]={[Ns]:t.nodeName.includes("-"),[Cs]:t.namespaceURI==="http://www.w3.org/1999/xhtml"})}var _r=new Map;function Bs(t){var e=t.getAttribute("is")||t.nodeName,n=_r.get(e);if(n)return n;_r.set(e,n=new Set);for(var r,i=t,o=Element.prototype;o!==i;){r=oo(i);for(var a in r)r[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&n.add(a);i=Sr(i)}return n}var ki,Xt=new WeakMap,Je=new WeakMap,vn=new WeakMap,xr=new WeakSet,_i=class{constructor(t){Cn(this,xr),b(this,Xt,new WeakMap),b(this,Je,void 0),b(this,vn,void 0),g(vn,this,t)}observe(t,e){var n=s(Xt,this).get(t)||new Set;return n.add(e),s(Xt,this).set(t,n),y(xr,this,Fs).call(this).observe(t,s(vn,this)),()=>{var r=s(Xt,this).get(t);r.delete(e),r.size===0&&(s(Xt,this).delete(t),s(Je,this).unobserve(t))}}};ki=_i;function Fs(){return s(Je,this)??g(Je,this,new ResizeObserver(t=>{for(var e of t){ki.entries.set(e.target,e);for(var n of s(Xt,this).get(e.target)||[])n(e)}}))}E(_i,"entries",new WeakMap);function pn(t,e){return t===e||t?.[le]===e}function qs(t=Dn(),e,n,r){var i=P.r,o=k;return ni(()=>{var a,l;return Fn(()=>{a=l,l=r?.()||[],ee(()=>{pn(n(...l),t)||(e(t,...l),a&&pn(n(...a),t)&&e(null,...a))})}),()=>{let h=o;for(;h!==i&&h.parent!==null&&h.parent.f&33554432;)h=h.parent;const u=()=>{l&&pn(n(...l),t)&&e(null,...l)},d=h.teardown;h.teardown=()=>{u(),d?.()}}}),t}var Le=!1;function Us(t){var e=Le;try{return Le=!1,[t(),Le]}finally{Le=e}}function Mr(t,e,n,r){var i=!ge||(n&2)!==0,o=(n&8)!==0,a=(n&16)!==0,l=r,h=!0,u=void 0,d=()=>a&&i?(u??(u=de(r)),f(u)):(h&&(h=!1,l=a?ee(r):r),l);let v;if(o){var w=le in t||Er in t;v=jt(t,e)?.set??(w&&e in t?L=>t[e]=L:void 0)}var p,m=!1;o?[p,m]=Us(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=d(),v&&(i&&Po(e),v(p)));var _;if(i?_=()=>{var L=t[e];return L===void 0?d():(h=!0,L)}:_=()=>{var L=t[e];return L!==void 0&&(l=void 0),L===void 0?l:L},i&&(n&4)===0)return _;if(v){var A=t.$$legacy;return(function(L,Bt){return arguments.length>0?((!i||!Bt||A||m)&&v(Bt?_():L),L):_()})}var D=!1,I=((n&1)!==0?de:Cr)(()=>(D=!1,_()));o&&f(I);var J=k;return(function(L,Bt){if(arguments.length>0){const _e=Bt?f(I):i&&o?_t(L):L;return S(I,_e),D=!0,l!==void 0&&(l=_e),L}return bt&&D||(J.f&16384)!==0?I.v:f(I)})}function Xs(t){return new Ys(t)}var At=new WeakMap,at=new WeakMap,Ys=class{constructor(t){b(this,At,void 0),b(this,at,void 0);var e=new Map,n=(i,o)=>{var a=Go(o,!1,!1);return e.set(i,a),a};const r=new Proxy({...t.props||{},$$events:{}},{get(i,o){return f(e.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===Er?!0:(f(e.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,a){return S(e.get(o)??n(o,a),a),Reflect.set(i,o,a)}});g(at,this,(t.hydrate?Es:yi)(t.component,{target:t.target,anchor:t.anchor,props:r,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!t?.props?.$$host||t.sync===!1)&&_n(),g(At,this,r.$$events);for(const i of Object.keys(s(at,this)))i==="$set"||i==="$destroy"||i==="$on"||he(this,i,{get(){return s(at,this)[i]},set(o){s(at,this)[i]=o},enumerable:!0});s(at,this).$set=i=>{Object.assign(r,i)},s(at,this).$destroy=()=>{Ts(s(at,this))}}$set(t){s(at,this).$set(t)}$on(t,e){s(At,this)[t]=s(At,this)[t]||[];const n=(...r)=>e.call(this,...r);return s(At,this)[t].push(n),()=>{s(At,this)[t]=s(At,this)[t].filter(r=>r!==n)}}$destroy(){s(at,this).$destroy()}},xi;typeof HTMLElement=="function"&&(xi=class extends HTMLElement{constructor(t,e,n){super(),E(this,"$$ctor",void 0),E(this,"$$s",void 0),E(this,"$$c",void 0),E(this,"$$cn",!1),E(this,"$$d",{}),E(this,"$$r",!1),E(this,"$$p_d",{}),E(this,"$$l",{}),E(this,"$$l_u",new Map),E(this,"$$me",void 0),E(this,"$$shadowRoot",null),this.$$ctor=t,this.$$s=e,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const r=this.$$l_u.get(e);r&&(r(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(r){return i=>{const o=Hn("slot");r!=="default"&&(o.name=r),Wn(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},n=Vs(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=t(r),e.default=!0):e[r]=t(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=He(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Xs({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=is(()=>{Fn(()=>{this.$$r=!0;for(const r of Ie(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=He(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const o=this.$$c.$on(r,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=He(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Ie(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function He(t,e,n,r){const i=n[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Vs(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Gs(t,e,n,r,i,o){let a=class extends xi{constructor(){super(t,n,i),this.$$p_d=e}static get observedAttributes(){return Ie(e).map(l=>(e[l].attribute||l).toLowerCase())}};return Ie(e).forEach(l=>{he(a.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(h){h=He(l,h,e),this.$$d[l]=h;var u=this.$$c;u&&(jt(u,l)?.get?u[l]=h:u.$set({[l]:h}))}})}),r.forEach(l=>{he(a.prototype,l,{get(){return this.$$c?.[l]}})}),o&&(a=o(a)),t.element=a,a}var Ks=ms('<div class="pie-sr-only svelte-a1a4bp" role="status" aria-live="polite" aria-atomic="true"> </div> <div class="pie-tool-line-reader svelte-a1a4bp" role="group" tabindex="0"><div class="pie-tool-line-reader__frame svelte-a1a4bp" aria-hidden="true"></div> <div class="pie-tool-line-reader__outline svelte-a1a4bp" aria-hidden="true"></div> <button type="button" class="pie-tool-line-reader__button pie-tool-line-reader__close svelte-a1a4bp"><svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M1 1 L11 11 M11 1 L1 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button> <button type="button" class="pie-tool-line-reader__resize-handle pie-tool-line-reader__resize-handle--pane svelte-a1a4bp"><svg width="14" height="8" viewBox="0 0 14 8" aria-hidden="true" focusable="false"><path d="M1 2.5 H13 M1 5.5 H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button> <button type="button" class="pie-tool-line-reader__resize-handle pie-tool-line-reader__resize-handle--frame svelte-a1a4bp"><svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M11 4 L4 11 M11 8 L8 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div>',1),Js={hash:"svelte-a1a4bp",code:`.pie-sr-only.svelte-a1a4bp {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}.pie-tool-line-reader.svelte-a1a4bp {border:none;border-radius:4px;
1
+ import{t as Xi}from"./attribute-coercion-b93b482c.js";import{a as Gi,r as Ji}from"./tool-host-contract-fae1c415.js";import{n as Ki,r as Zi,s as Qi}from"./overlay-containment-edaaff13.js";import{t as to}from"./pointer-gesture-ce75f0a7.js";import{i as eo}from"./provider-4c704118.js";import{t as no}from"./ToolCoordinator-0a6c4088.js";if(typeof window<"u"){var or,sr;((or=(sr=window).__svelte??(sr.__svelte={})).v??(or.v=new Set)).add("5")}var Zt={},z=Symbol("uninitialized"),ro=Array.isArray,io=Array.prototype.indexOf,mn=Array.prototype.includes,oo=Array.from,Fe=Object.keys,ce=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,so=Object.getOwnPropertyDescriptors,ao=Object.prototype,lo=Array.prototype,Wr=Object.getPrototypeOf,ar=Object.isExtensible,uo=()=>{};function fo(t){for(var e=0;e<t.length;e++)t[e]()}function Ar(){var t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function de(t){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(t)}function ho(t,e){if(de(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(de(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function co(t){var e=ho(t,"string");return de(e)=="symbol"?e:e+""}function E(t,e,n){return(e=co(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var G=1024,ot=2048,Ht=4096,jn=8192,vo=16384,zn=32768,lr=1<<25,On=65536,re=1<<19,po=1<<20,ur=1<<21,wo=1<<22,Ie=1<<23,ue=Symbol("$state"),Er=Symbol("component"),Tr=Symbol("legacy props"),mo=Symbol(""),gn=Symbol("attributes"),go=Symbol("class"),bn=Symbol("style"),Ne=Symbol("text"),ge=new class extends Error{constructor(...t){super(...t),E(this,"name","StaleReactionError"),E(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},bo=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function yo(){console.warn("https://svelte.dev/e/derived_inert")}function Qe(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function $o(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function Xt(t){T=t}var W;function it(t){if(t===null)throw Qe(),Zt;return W=t}function Dn(){return it(yt(W))}function Pr(t){if(T){if(yt(W)!==null)throw Qe(),Zt;W=t}}function ko(t=1){if(T){for(var e=t,n=W;e--;)n=yt(n);W=n}}function Rr(t=!0){for(var e=0,n=W;;){if(n.nodeType===8){var r=n.data;if(r==="]"){if(e===0)return n;e-=1}else(r==="["||r==="[!"||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(e+=1)}var i=yt(n);t&&n.remove(),n=i}}function _o(t){if(!t||t.nodeType!==8)throw Qe(),Zt;return t.data}function jr(t){return t===this.v}function xo(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function zr(t){return!xo(t,this.v)}function Mo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function So(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Wo(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ao(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Eo(t){throw new Error("https://svelte.dev/e/effect_orphan")}function To(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Po(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ro(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function jo(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Oo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Do(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var tn=!1,be=!1,P=null;function Qt(t){P=t}function Or(t,e=!1,n){P={p:P,i:!1,c:null,e:null,s:t,x:null,r:k,l:be&&!e?{s:null,u:null,$:[]}:null}}function Dr(t){var e=P,n=e.e;if(n!==null){e.e=null;for(var r of n)ni(r)}return t!==void 0&&(e.x=t),e.i=!0,P=e.p,Ln(t)}function Ln(t={}){return ce(t,Er,{value:!0}),t}function ye(){return!be||P!==null&&P.l===null}var Rt=[];function Lr(){var t=Rt;Rt=[],fo(t)}function Ct(t){if(Rt.length===0&&!fe){var e=Rt;queueMicrotask(()=>{e===Rt&&Lr()})}Rt.push(t)}function Lo(){for(;Rt.length>0;)Lr()}var Co=~(ot|Ht|G);function R(t,e){t.f=t.f&Co|e}function Cn(t){(t.f&512)!==0||t.deps===null?R(t,G):R(t,Ht)}function Cr(t,e,n){(t.f&2048)!==0?e.add(t):t.f&4096&&n.add(t),R(t,G)}function en(t){var e=M,n=k;J(null),dt(null);try{return t()}finally{J(e),dt(n)}}function No(t,e,n,r){const i=ye()?ve:Hr;var o=t.filter(p=>!p.settled),a=e.map(i);if(n.length===0&&o.length===0){r(a);return}var l=k,h=Ho(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(p=>p.promise)):null;function d(p){if((l.f&16384)===0){h();try{r([...a,...p])}catch(m){ct(m,l)}qe()}}var v=Nr();if(n.length===0){u.then(()=>d([])).finally(v);return}function w(){Promise.all(n.map(p=>Bo(p))).then(d).catch(p=>ct(p,l)).finally(v)}u?u.then(()=>{h(),w(),qe()}):w()}function Ho(){var t=k,e=M,n=P,r=x;return function(i=!0){dt(t),J(e),Qt(n),i&&!(t.f&16384)&&(r?.activate(),r?.apply())}}function qe(t=!0){dt(null),J(null),Qt(null),t&&x?.deactivate()}function Nr(){var t=k,e=t.b,n=x,r=!!e?.is_rendered();return e?.update_pending_count(1,n),n.increment(r,t),()=>{e?.update_pending_count(-1,n),n.decrement(r,t)}}function ve(t){var e=2|ot;return k!==null&&(k.f|=re),{ctx:P,deps:null,effects:null,equals:jr,f:e,fn:t,reactions:null,rv:0,v:z,wv:0,parent:k,ac:null}}var ae=Symbol("obsolete");function Bo(t,e,n){let r=k;r===null&&So();var i=void 0,o=$e(z),a=!M,l=new Set;return as(()=>{var h=k,u=Ar();i=u.promise;try{Promise.resolve(t()).then(u.resolve,p=>{p!==ge&&u.reject(p)}).finally(qe)}catch(p){u.reject(p),qe()}var d=x;if(a){if((h.f&32768)!==0)var v=Nr();if(r.b?.is_rendered())d.async_deriveds.get(h)?.reject(ae);else for(const p of l.values())p.reject(ae);l.add(u),d.async_deriveds.set(h,u)}const w=(p,m=void 0)=>{v?.(),l.delete(u),m!==ae&&(d.activate(),m?(o.f|=Ie,Je(o,m)):(o.f&8388608&&(o.f^=Ie),Je(o,p)),d.deactivate())};u.promise.then(w,p=>w(null,p||"unknown"))}),is(()=>{for(const h of l)h.reject(ae)}),new Promise(h=>{function u(d){function v(){d===i?h(o):u(i)}d.then(v,v)}u(i)})}function sn(t){const e=ve(t);return fi(e),e}function Hr(t){const e=ve(t);return e.equals=zr,e}function Fo(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)I(e[n])}}function Nn(t){var e,n=k,r=t.parent;if(!bt&&r!==null&&t.v!==z&&(r.f&24576)!==0)return yo(),t.v;dt(r);try{Fo(t),e=vi(t)}finally{dt(n)}return e}function Br(t){var e=Nn(t);if(!t.equals(e)&&(t.wv=ci(),(!x?.is_fork||t.deps===null)&&(x!==null?(x.capture(t,e,!0),$n?.capture(t,e,!0)):t.v=e,t.deps===null))){R(t,G);return}bt||(H!==null?(In()||x?.is_fork)&&H.set(t,e):Cn(t))}function Io(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&en(()=>{e.ac.abort(ge),e.ac=null}),e.fn!==null&&(e.teardown=uo),we(e,0),Un(e))}function Fr(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&ee(e)}function Ir(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hn(t,e){Ir(t,e),e.add(t)}function b(t,e,n){Ir(t,e),e.set(t,n)}function y(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function g(t,e,n){return t.set(y(t,e),n),n}function s(t,e){return t.get(y(t,e))}var qr,yn=null,qt=null,x=null,$n=null,H=null,kn=null,fe=!1,an=!1,pe=null,Ue=null,Ur=0,qo=1,_n=new WeakMap,Ot=new WeakMap,Gt=new WeakMap,Ve=new WeakMap,Re=new WeakMap,Ut=new WeakMap,Et=new WeakMap,le=new WeakMap,ut=new WeakMap,fr=new WeakMap,te=new WeakMap,wt=new WeakMap,kt=new WeakMap,ln=new WeakMap,je=new WeakMap,j=new WeakSet,Bt=class Vr{constructor(){Hn(this,j),E(this,"id",qo++),b(this,_n,!1),E(this,"linked",!0),b(this,Ot,null),b(this,Gt,null),E(this,"async_deriveds",new Map),E(this,"current",new Map),E(this,"previous",new Map),b(this,Ve,new Set),b(this,Re,new Set),b(this,Ut,0),b(this,Et,new Map),b(this,le,null),b(this,ut,[]),b(this,fr,[]),b(this,te,new Set),b(this,wt,new Set),b(this,kt,new Map),b(this,ln,new Set),E(this,"is_fork",!1),b(this,je,!1),qt===null?yn=qt=this:(g(Gt,qt,this),g(Ot,this,qt)),qt=this}skip_effect(e){s(kt,this).has(e)||s(kt,this).set(e,{d:[],m:[]}),s(ln,this).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=s(kt,this).get(e);if(r){s(kt,this).delete(e);for(var i of r.d)R(i,ot),n(i);for(i of r.m)R(i,Ht),n(i)}s(ln,this).add(e)}capture(e,n,r=!1){e.v!==z&&!this.previous.has(e)&&this.previous.set(e,e.v),!(e.f&8388608)&&(this.current.set(e,[n,r]),H?.set(e,n)),this.is_fork||(e.v=n)}activate(){x=this}deactivate(){x=null,H=null}flush(){try{an=!0,x=this,y(j,this,Ye).call(this)}finally{Ur=0,kn=null,pe=null,Ue=null,an=!1,x=null,H=null,ht.clear()}}discard(){for(const e of s(Re,this))e(this);s(Re,this).clear();for(const e of this.async_deriveds.values())e.reject(ae);y(j,this,Xe).call(this),s(le,this)?.resolve()}register_created_effect(e){s(fr,this).push(e)}increment(e,n){if(g(Ut,this,s(Ut,this)+1),e){let r=s(Et,this).get(n)??0;s(Et,this).set(n,r+1)}}decrement(e,n){if(g(Ut,this,s(Ut,this)-1),e){let r=s(Et,this).get(n)??0;r===1?s(Et,this).delete(n):s(Et,this).set(n,r-1)}s(je,this)||(g(je,this,!0),Ct(()=>{g(je,this,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)s(te,this).add(r);for(const r of n)s(wt,this).add(r);e.clear(),n.clear()}oncommit(e){s(Ve,this).add(e)}ondiscard(e){s(Re,this).add(e)}settled(){return(s(le,this)??g(le,this,Ar())).promise}static ensure(){if(x===null){const e=x=new Vr;!an&&!fe&&Ct(()=>{s(_n,e)||e.flush()})}return x}apply(){if(!tn||!this.is_fork&&s(Ot,this)===null&&s(Gt,this)===null){H=null;return}H=new Map;for(const[n,[r]]of this.current)H.set(n,r);for(let n=yn;n!==null;n=s(Gt,n))if(!(n===this||n.is_fork)){var e=!1;if(n.id<this.id){for(const[r,[,i]]of n.current)if(!i&&this.current.has(r)){e=!0;break}}if(!e)for(const[r,i]of n.previous)H.has(r)||H.set(r,i)}}schedule(e){if(kn=e,e.b?.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}s(ut,this).push(e)}};qr=Bt;function hr(){if(this.is_fork)return!0;for(const n of s(Et,this).keys()){for(var t=n,e=!1;t.parent!==null;){if(s(kt,this).has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}function Uo(){var t=[];for(const i of s(ut,this))if(!((i.f&16384)!==0||(i.f&6144)===0)){for(var e=i,n=!1;e.parent!==null;){e=e.parent;var r=e.f;if((r&96)!==0){if((r&1024)===0){n=!0;break}e.f^=G}}n||t.push(e)}return g(ut,this,[]),t}function Ye(){g(_n,this,!0);for(const a of s(te,this))s(wt,this).delete(a),R(a,ot),this.schedule(a);for(const a of s(wt,this))R(a,Ht),this.schedule(a);this.apply();for(var t=pe=[],e=[],n=Ue=[];s(ut,this).length>0;){Ur++>1e3&&(y(j,this,Xe).call(this),Go());for(const a of y(j,this,Uo).call(this))try{y(j,this,Vo).call(this,a,t,e)}catch(l){throw Gr(a),y(j,this,hr).call(this)||this.discard(),l}}if(x=null,n.length>0){var r=qr.ensure();for(const a of n)r.schedule(a)}if(pe=null,Ue=null,y(j,this,hr).call(this)){y(j,this,ze).call(this,e),y(j,this,ze).call(this,t);for(const[a,l]of s(kt,this))Xr(a,l);n.length>0&&y(j,x,Ye).call(x);return}const i=y(j,this,Yo).call(this);if(i){y(j,this,ze).call(this,e),y(j,this,ze).call(this,t),y(j,i,Xo).call(i,this);return}s(te,this).clear(),s(wt,this).clear();for(const a of s(Ve,this))a(this);s(Ve,this).clear(),$n=this,cr(e),cr(t),$n=null,s(le,this)?.resolve();var o=x;if(s(Ut,this)===0&&(s(ut,this).length===0||o!==null)&&y(j,this,Xe).call(this),s(ut,this).length>0)if(o!==null){for(const a of s(ut,this))s(ut,o).push(a);g(ut,this,[])}else o=this;o!==null&&(ht.clear(),y(j,o,Ye).call(o))}function Vo(t,e,n){t.f^=G;for(var r=t.first;r!==null;){var i=r.f,o=(i&96)!==0;if(!(o&&(i&1024)!==0||(i&8192)!==0||s(kt,this).has(r))&&r.fn!==null){o?r.f^=G:(i&4)!==0?e.push(r):tn&&(i&16777224)!==0?n.push(r):_e(r)&&(i&16&&s(wt,this).add(r),ee(r));var a=r.first;if(a!==null){r=a;continue}}for(;r!==null;){var l=r.next;if(l!==null){r=l;break}r=r.parent}}}function Yo(){for(var t=s(Ot,this);t!==null;){if(!t.is_fork){for(const[e,[,n]]of this.current)if(t.current.has(e)&&!n)return t}t=s(Ot,t)}return null}function Xo(t){for(const[n,r]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,r);for(const[n,r]of t.async_deriveds){const i=this.async_deriveds.get(n);i&&r.promise.then(i.resolve).catch(i.reject)}t.async_deriveds.clear(),this.transfer_effects(s(te,t),s(wt,t));const e=n=>{var r=n.reactions;if(r!==null&&!((n.f&2)!==0&&(n.f&6144)===0))for(const a of r){var i=a.f;if((i&2)!==0)e(a);else{var o=a;i&4194320&&!this.async_deriveds.has(o)&&(s(wt,this).delete(o),R(o,ot),this.schedule(o))}}};for(const n of this.current.keys())e(n);this.oncommit(()=>t.discard()),y(j,t,Xe).call(t),x=this,y(j,this,Ye).call(this)}function ze(t){for(var e=0;e<t.length;e+=1)Cr(t[e],s(te,this),s(wt,this))}function Xe(){if(this.linked){var t=s(Ot,this),e=s(Gt,this);t===null?yn=e:g(Gt,t,e),e===null?qt=t:g(Ot,e,t),this.linked=!1}}function xn(t){var e=fe;fe=!0;try{var n;for(t&&(x!==null&&!x.is_fork&&x.flush(),n=t());;){if(Lo(),x===null)return n;x.flush()}}finally{fe=e}}function Go(){try{To()}catch(t){ct(t,kn)}}var lt=null;function cr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&24576)===0&&_e(r)&&(lt=new Set,ee(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&si(r),lt?.size>0)){ht.clear();for(const i of lt){if((i.f&24576)!==0)continue;const o=[i];let a=i.parent;for(;a!==null;)lt.has(a)&&(lt.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){const h=o[l];!(h.f&24576)&&ee(h)}}lt.clear()}}lt=null}}function Yr(t){x.schedule(t)}function Xr(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):t.f&4096&&e.m.push(t),R(t,G);for(var n=t.first;n!==null;)Xr(n,e),n=n.next}}function Gr(t){R(t,G);for(var e=t.first;e!==null;)Gr(e),e=e.next}var Ge=new Set,ht=new Map,Jr=!1;function $e(t,e){return{f:0,v:t,reactions:null,equals:jr,rv:0,wv:0}}function C(t,e){const n=$e(t,e);return fi(n),n}function Jo(t,e=!1,n=!0){const r=$e(t);if(e||(r.equals=zr),be&&n&&P!==null&&P.l!==null){var i;((i=P.l).s??(i.s=[])).push(r)}return r}function S(t,e,n=!1){return M!==null&&(!Q||M.f&131072)&&ye()&&M.f&4325394&&(et===null||!et.has(t))&&Oo(),Je(t,n?_t(e):e,Ue)}var Pt=null,Mn=0;function Je(t,e,n=null){if(!t.equals(e)){bt?ht.set(t,e):ht.has(t)||ht.set(t,t.v);var r=Bt.ensure();if(r.capture(t,e),(t.f&2)!==0){const i=t;t.f&2048&&Nn(i),H===null&&Cn(i)}t.wv=ci(),Pt=null,Mn=0,Kr(t,ot,n),Pt=null,ye()&&k!==null&&k.f&1024&&!(k.f&96)&&(X===null?cs([t]):X.push(t)),!r.is_fork&&Ge.size>0&&!Jr&&Ko()}return e}function Ko(){Jr=!1;for(const t of Ge){t.f&1024&&R(t,Ht);let e;try{e=_e(t)}catch{e=!0}e&&ee(t)}Ge.clear()}function he(t){S(t,t.v+1)}function Kr(t,e,n){var r=t.reactions;if(r!==null){var i=ye(),o=r.length;if(Mn+=o,Mn>1e5&&Pt===null&&(Pt=new Set),Pt!==null){if(Pt.has(t))return;Pt.add(t)}for(var a=0;a<o;a++){var l=r[a],h=l.f;if(!(!i&&l===k)){var u=(h&ot)===0;if(u&&R(l,e),(h&131072)!==0)Ge.add(l);else if((h&2)!==0){var d=l;H?.delete(d),Kr(d,Ht,n)}else if(u){var v=l;h&16&&lt!==null&&lt.add(v),n!==null?n.push(v):Yr(v)}}}}}function _t(t){if(typeof t!="object"||t===null||ue in t||Er in t)return t;const e=Wr(t);if(e!==ao&&e!==lo)return t;var n=new Map,r=ro(t),i=C(0),o=null,a=Dt,l=h=>{if(Dt===a)return h();var u=M,d=Dt;J(null),mr(a);var v=h();return J(u),mr(d),v};return r&&n.set("length",C(t.length,o)),new Proxy(t,{defineProperty(h,u,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&jo();var v=n.get(u);return v===void 0?l(()=>{var w=C(d.value,o);return n.set(u,w),w}):S(v,d.value,!0),!0},deleteProperty(h,u){var d=n.get(u);if(d===void 0){if(u in h){const v=l(()=>C(z,o));n.set(u,v),he(i)}}else S(d,z),he(i);return!0},get(h,u,d){if(u===ue)return t;var v=n.get(u),w=u in h;if(v===void 0&&(!w||zt(h,u)?.writable)&&(v=l(()=>C(_t(w?h[u]:z),o)),n.set(u,v)),v!==void 0){var p=f(v);return p===z?void 0:p}return Reflect.get(h,u,d)},getOwnPropertyDescriptor(h,u){this.has?.(h,u);var d=Reflect.getOwnPropertyDescriptor(h,u),v=n.get(u);if(v!==void 0){var w=f(v);if(w===z)return;if(d&&"value"in d)d.value=w;else return{enumerable:!0,configurable:!0,value:w,writable:!0}}return d},has(h,u){if(u===ue)return!0;var d=n.get(u),v=d!==void 0&&d.v!==z||Reflect.has(h,u);return(d!==void 0||k!==null&&(!v||zt(h,u)?.writable))&&(d===void 0&&(d=l(()=>C(v?_t(h[u]):z,o)),n.set(u,d)),f(d)===z)?!1:v},set(h,u,d,v){var w=n.get(u),p=u in h;if(r&&u==="length")for(var m=d;m<w.v;m+=1){var _=n.get(m+"");_!==void 0?S(_,z):m in h&&(_=l(()=>C(z,o)),n.set(m+"",_))}if(w===void 0)(!p||zt(h,u)?.writable)&&(w=l(()=>C(void 0,o)),S(w,_t(d)),n.set(u,w));else{p=w.v!==z;var A=l(()=>_t(d));S(w,A)}var D=Reflect.getOwnPropertyDescriptor(h,u);if(D?.set&&D.set.call(v,d),!p){if(r&&typeof u=="string"){var B=n.get("length"),K=Number(u);Number.isInteger(K)&&K>=B.v&&S(B,K+1)}he(i)}return!0},ownKeys(h){f(i);var u=Reflect.ownKeys(h).filter(w=>{var p=n.get(w);return p===void 0||p.v!==z});for(var[d,v]of n)v.v!==z&&!(d in h)&&u.push(d);return u},setPrototypeOf(){zo()}})}var dr,Zr,Qr,ti;function Sn(){if(dr===void 0){dr=window,Zr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Qr=zt(e,"firstChild").get,ti=zt(e,"nextSibling").get,ar(t)&&(t[go]=void 0,t[gn]=null,t[bn]=void 0,t.__e=void 0),ar(n)&&(n[Ne]=void 0)}}function mt(t=""){return document.createTextNode(t)}function Nt(t){return Qr.call(t)}function yt(t){return ti.call(t)}function ei(t,e){if(!T)return Nt(t);var n=Nt(W);if(n===null)n=W.appendChild(mt());else if(e&&n.nodeType!==3){var r=mt();return n?.before(r),it(r),r}return e&&Fn(n),it(n),n}function vr(t,e=!1){if(!T){var n=Nt(t);return n instanceof Comment&&n.data===""?yt(n):n}if(e){if(W?.nodeType!==3){var r=mt();return W?.before(r),it(r),r}Fn(W)}return W}function Zo(t,e=!1){if(!T)return Nt(t);var n=ei(t,e);return Pr(t),n}function Oe(t,e=1,n=!1){let r=T?W:t;for(var i;e--;)i=r,r=yt(r);if(!T)return r;if(n){if(r?.nodeType!==3){var o=mt();return r===null?i?.after(o):r.before(o),it(o),o}Fn(r)}return it(r),r}function Qo(t){t.textContent=""}function ts(){return!tn||lt!==null?!1:(k.f&zn)!==0}function Bn(t,e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?n?document.createElement(t,{is:n}):document.createElement(t):n?document.createElementNS(e,t,{is:n}):document.createElementNS(e,t)}function Fn(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===3;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function es(t){var e=k;if(e===null)return M.f|=Ie,t;if((e.f&32768)===0&&(e.f&4)===0)throw t;ct(t,e)}function ct(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0&&(e.f&33570816)===0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}}function ns(t){k===null&&(M===null&&Eo(t),Ao()),bt&&Wo(t)}function rs(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function vt(t,e){var n=k;n!==null&&n.f&8192&&(t|=jn);var r={ctx:P,deps:null,nodes:null,f:t|ot|512,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};x?.register_created_effect(r);var i=r;if((t&4)!==0)pe!==null?pe.push(r):Bt.ensure().schedule(r);else if(e!==null){try{ee(r)}catch(a){throw I(r),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,t&16&&t&65536&&i!==null&&(i.f|=On))}if(i!==null&&(i.parent=n,n!==null&&rs(i,n),M!==null&&(M.f&2)!==0&&(t&64)===0)){var o=M;(o.effects??(o.effects=[])).push(i)}return r}function In(){return M!==null&&!Q}function is(t){const e=vt(8,null);return R(e,G),e.teardown=t,e}function Tt(t){ns("$effect");var e=k.f;if(!M&&(e&32)!==0&&P!==null&&!P.i){var n=P;(n.e??(n.e=[])).push(t)}else return ni(t)}function ni(t){return vt(4|po,t)}function os(t){Bt.ensure();const e=vt(64|re,t);return()=>{I(e)}}function ss(t){Bt.ensure();const e=vt(64|re,t);return(n={})=>new Promise(r=>{n.outro?ke(e,()=>{I(e),r(void 0)}):(I(e),r(void 0))})}function ri(t){return vt(4,t)}function as(t){return vt(wo|re,t)}function qn(t,e=0){return vt(8|e,t)}function ls(t,e=[],n=[],r=[]){No(r,e,n,i=>{vt(8,()=>{t(...i.map(f))})})}function ii(t,e=0){return vt(16|e,t)}function gt(t){return vt(32|re,t)}function oi(t){var e=t.teardown;if(e!==null){const n=bt,r=M;wr(!0),J(null);try{e.call(null)}catch(i){ct(i,t.parent)}finally{wr(n),J(r)}}}function Un(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&en(()=>{i.abort(ge)});var r=n.next;(n.f&64)!==0?n.parent=null:I(n,e),n=r}}function us(t){for(var e=t.first;e!==null;){var n=e.next;!(e.f&32)&&I(e),e=n}}function I(t,e=!0){var n=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(fs(t.nodes.start,t.nodes.end),n=!0),t.f|=lr,Un(t,e&&!n),we(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)o.stop();oi(t),t.f^=lr,t.f|=vo;var i=t.parent;i!==null&&i.first!==null&&si(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function fs(t,e){for(;t!==null;){var n=t===e?null:yt(t);t.remove(),t=n}}function si(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function ke(t,e,n=!0){var r=[];t.f|=256,ai(t,r,!0);var i=()=>{n&&I(t),e&&e()},o=r.length;if(o>0){var a=()=>--o||i();for(var l of r)l.out(a)}else i()}function ai(t,e,n){if((t.f&8192)===0){t.f^=jn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&e.push(l);for(var i=t.first;i!==null;){var o=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(t.f&16)!==0;ai(i,e,a?n:!1)}i=o}}}function pr(t){t.f&=-257,li(t,!0)}function li(t,e){if((t.f&256)===0&&(t.f&8192)!==0){t.f^=jn,!(t.f&1024)&&(R(t,ot),Bt.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,i=(n.f&65536)!==0||(n.f&32)!==0;li(n,i?e:!1),n=r}var o=t.nodes&&t.nodes.t;if(o!==null)for(const a of o)(a.is_global||e)&&a.in()}}function ui(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var i=n===r?null:yt(n);e.append(n),n=i}}var hs=null,He=!1,bt=!1;function wr(t){bt=t}var M=null,Q=!1;function J(t){M=t}var k=null;function dt(t){k=t}var et=null;function fi(t){M!==null&&(M.f&2097152||M.f&2)&&(et??(et=new Set)).add(t)}var F=null,U=0,X=null;function cs(t){X=t}var hi=1,jt=0,Dt=jt;function mr(t){Dt=t}function ci(){return++hi}function _e(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var n=t.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(_e(o)&&Br(o),o.wv>t.wv)return!0}e&512&&H===null&&R(t,G)}return!1}function di(t,e,n=!0){var r=t.reactions;if(r!==null&&!(!tn&&et!==null&&et.has(t)))for(var i=0;i<r.length;i++){var o=r[i];(o.f&2)!==0?di(o,e,!1):e===o&&(n?R(o,ot):o.f&1024&&R(o,Ht),Yr(o))}}function vi(t){var e=F,n=U,r=X,i=M,o=et,a=P,l=Q,h=Dt,u=t.f;F=null,U=0,X=null,M=(u&96)===0?t:null,et=null,Qt(t.ctx),Q=!1,Dt=++jt,t.ac!==null&&(en(()=>{t.ac.abort(ge)}),t.ac=null);try{t.f|=ur;var d=t.fn,v=d();t.f|=zn;var w=gr(t);if(ye()&&X!==null&&!Q&&w!==null&&(t.f&6146)===0)for(var p=0;p<X.length;p++)di(X[p],t);if(i!==null&&i!==t){if(jt++,i.deps!==null)for(let m=0;m<n;m+=1)i.deps[m].rv=jt;if(e!==null)for(const m of e)m.rv=jt;X!==null&&(r===null?r=X:r.push(...X))}return t.f&8388608&&(t.f^=Ie),v}catch(m){return gr(t),es(m)}finally{t.f^=ur,F=e,U=n,X=r,M=i,et=o,Qt(a),Q=l,Dt=h}}function gr(t){var e=t.deps,n=x?.is_fork;if(F!==null){var r;if(n||we(t,U),e!==null&&U>0)for(e.length=U+F.length,r=0;r<F.length;r++)e[U+r]=F[r];else t.deps=e=F;if(In()&&(t.f&512)!==0)for(r=U;r<e.length;r++){var i;((i=e[r]).reactions??(i.reactions=[])).push(t)}}else!n&&e!==null&&U<e.length&&(we(t,U),e.length=U);return e}function ds(t,e){let n=e.reactions;if(n!==null){var r=io.call(n,t);if(r!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(e.f&2)!==0&&(F===null||!mn.call(F,e))){var o=e;o.f&512&&(o.f^=512),o.v!==z&&Cn(o),o.ac!==null&&en(()=>{o.ac.abort(ge),o.ac=null,R(o,ot)}),Io(o),we(o,0)}}function we(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)ds(t,n[r])}function ee(t){var e=t.f;if((e&16384)===0){R(t,G);var n=k,r=He;k=t,He=(e&96)===0;try{(e&16777232)!==0?us(t):Un(t),oi(t);var i=vi(t);t.teardown=typeof i=="function"?i:null,t.wv=hi}finally{He=r,k=n}}}function f(t){var e=(t.f&2)!==0;if(hs?.add(t),M!==null&&!Q&&!(k!==null&&(k.f&16384)!==0)&&(et===null||!et.has(t))){var n=M.deps;if((M.f&2097152)!==0)t.rv<jt&&(t.rv=jt,F===null&&n!==null&&n[U]===t?U++:F===null?F=[t]:F.push(t));else{var r;(r=M).deps??(r.deps=[]),mn.call(M.deps,t)||M.deps.push(t);var i=t.reactions;i===null?t.reactions=[M]:mn.call(i,M)||i.push(M)}}if(bt&&ht.has(t))return ht.get(t);if(e){var o=t;if(bt){var a=o.v;return(!(o.f&1024)&&o.reactions!==null||wi(o))&&(a=Nn(o)),ht.set(o,a),a}var l=(o.f&512)===0&&!Q&&M!==null&&(He||(M.f&512)!==0),h=(o.f&zn)===0;_e(o)&&(l&&(o.f|=512),Br(o)),l&&!h&&(Fr(o),pi(o))}if(H?.has(t))return H.get(t);if((t.f&8388608)!==0)throw t.v;return t.v}function pi(t){if(t.f|=512,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&2&&!(e.f&512)&&(Fr(e),pi(e))}function wi(t){if(t.v===z)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(ht.has(e)||(e.f&2)!==0&&wi(e))return!0;return!1}function ne(t){var e=Q;try{return Q=!0,t()}finally{Q=e}}var Jt=Symbol("events"),mi=new Set,Wn=new Set;function oe(t,e,n){(e[Jt]??(e[Jt]={}))[t]=n}function vs(t){for(var e=0;e<t.length;e++)mi.add(t[e]);for(var n of Wn)n(t)}var un=null,fn=!1;function br(t){var e=this,n=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],o=i[0]||t.target;un=t,fn||(fn=!0,setTimeout(()=>{fn=!1,un=null}));var a=0,l=un===t&&t[Jt];if(l){var h=i.indexOf(l);if(h!==-1&&(e===document||e===window)){t[Jt]=e;return}var u=i.indexOf(e);if(u===-1)return;h<=u&&(a=h)}if(o=i[a]||t.target,o!==e){ce(t,"currentTarget",{configurable:!0,get(){return o||n}});var d=M,v=k;J(null),dt(null);try{for(var w,p=[];o!==null&&o!==e;){try{var m=o[Jt]?.[r];m!=null&&(!o.disabled||t.target===o)&&m.call(o,t)}catch(_){w?p.push(_):w=_}if(t.cancelBubble)break;a++,o=a<i.length?i[a]:null}if(w){for(let _ of p)queueMicrotask(()=>{throw _});throw w}}finally{t[Jt]=e,delete t.currentTarget,J(d),dt(v)}}}var ps=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function ws(t){return ps?.createHTML(t)??t}function ms(t){var e=Bn("template");return e.innerHTML=ws(t.replaceAll("<!>","<!---->")),e.content}function Kt(t,e){var n=k;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function gs(t,e){var n=(e&1)!==0,r=(e&2)!==0,i,o=!t.startsWith("<!>");return()=>{if(T)return Kt(W,null),W;i===void 0&&(i=ms(o?t:"<!>"+t),n||(i=Nt(i)));var a=r||Zr?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=Nt(a),h=a.lastChild;Kt(l,h)}else Kt(a,a);return a}}function bs(){if(T)return Kt(W,null),W;var t=document.createDocumentFragment(),e=document.createComment(""),n=mt();return t.append(e,n),Kt(e,n),t}function An(t,e){if(T){var n=k;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=W),Dn();return}t!==null&&t.before(e)}var ys=["touchstart","touchmove"];function $s(t){return ys.includes(t)}function ks(t){let e=0,n=$e(0),r;return()=>{In()&&(f(n),qn(()=>(e===0&&(r=ne(()=>t(()=>he(n)))),e+=1,()=>{Ct(()=>{e-=1,e===0&&(r?.(),r=void 0,he(n))})})))}}var _s=On|re;function xs(t,e,n,r){new Ms(t,e,n,r)}var nt=new WeakMap,En=new WeakMap,ft=new WeakMap,me=new WeakMap,V=new WeakMap,rt=new WeakMap,Y=new WeakMap,tt=new WeakMap,xt=new WeakMap,Vt=new WeakMap,Lt=new WeakMap,De=new WeakMap,Tn=new WeakMap,Pn=new WeakMap,Wt=new WeakMap,yr=new WeakMap,O=new WeakSet,Ms=class{constructor(t,e,n,r){Hn(this,O),E(this,"parent",void 0),E(this,"is_pending",!1),E(this,"transform_error",void 0),b(this,nt,void 0),b(this,En,T?W:null),b(this,ft,void 0),b(this,me,void 0),b(this,V,void 0),b(this,rt,null),b(this,Y,null),b(this,tt,null),b(this,xt,null),b(this,Vt,0),b(this,Lt,0),b(this,De,!1),b(this,Tn,new Set),b(this,Pn,new Set),b(this,Wt,null),b(this,yr,ks(()=>(g(Wt,this,$e(s(Vt,this))),()=>{g(Wt,this,null)}))),g(nt,this,t),g(ft,this,e),g(me,this,i=>{var o=k;o.b=this,o.f|=128,n(i)}),this.parent=k.b,this.transform_error=r??this.parent?.transform_error??(i=>i),g(V,this,ii(()=>{if(T){const i=s(En,this);Dn();const o=i.data==="[!";if(i.data.startsWith("[?")){const a=JSON.parse(i.data.slice(2));y(O,this,Ws).call(this,a)}else o?y(O,this,As).call(this):y(O,this,Ss).call(this)}else y(O,this,bi).call(this)},_s)),T&&g(nt,this,W)}defer_effect(t){Cr(t,s(Tn,this),s(Pn,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(ft,this).pending}update_pending_count(t,e){y(O,this,yi).call(this,t,e),g(Vt,this,s(Vt,this)+t),s(Wt,this)&&!s(De,this)&&(g(De,this,!0),Ct(()=>{g(De,this,!1),s(Wt,this)&&Je(s(Wt,this),s(Vt,this))}))}get_effect_pending(){return s(yr,this).call(this),f(s(Wt,this))}error(t){if(!s(ft,this).onerror&&!s(ft,this).failed)throw t;x?.is_fork?(s(rt,this)&&x.skip_effect(s(rt,this)),s(Y,this)&&x.skip_effect(s(Y,this)),s(tt,this)&&x.skip_effect(s(tt,this)),x.oncommit(()=>{y(O,this,$r).call(this,t)})):y(O,this,$r).call(this,t)}};function Ss(){try{g(rt,this,gt(()=>s(me,this).call(this,s(nt,this))))}catch(t){this.error(t)}}function Ws(t){const e=s(ft,this).failed,{reset:n,invoke_onerror:r}=y(O,this,gi).call(this,t);Ct(r),e&&g(tt,this,gt(()=>{e(s(nt,this),()=>t,()=>n)}))}function gi(t){var e=!1,n=!1;const r=()=>{if(e){$o();return}e=!0,n&&Do(),s(tt,this)!==null&&ke(s(tt,this),()=>{g(tt,this,null)}),y(O,this,Vn).call(this,()=>{y(O,this,bi).call(this)})};return{reset:r,invoke_onerror:()=>{try{n=!0,s(ft,this).onerror?.(t,r),n=!1}catch(i){ct(i,s(V,this)&&s(V,this).parent)}}}}function As(){const t=s(ft,this).pending;t&&(this.is_pending=!0,g(Y,this,gt(()=>t(s(nt,this)))),Ct(()=>{var e=g(xt,this,document.createDocumentFragment()),n=mt(),r=!1;if(e.append(n),g(rt,this,y(O,this,Vn).call(this,()=>{try{return gt(()=>s(me,this).call(this,n))}catch(i){try{this.error(i),r=!0}catch(o){ct(o,s(V,this).parent)}return null}})),s(rt,this)===null){g(xt,this,null),r&&y(O,this,Ke).call(this,x);return}s(Lt,this)===0&&(s(nt,this).before(e),g(xt,this,null),ke(s(Y,this),()=>{g(Y,this,null)}),y(O,this,Ke).call(this,x))}))}function bi(){try{if(this.is_pending=this.has_pending_snippet(),g(Lt,this,0),g(Vt,this,0),g(rt,this,gt(()=>{s(me,this).call(this,s(nt,this))})),s(Lt,this)>0){var t=g(xt,this,document.createDocumentFragment());ui(s(rt,this),t);const e=s(ft,this).pending;g(Y,this,gt(()=>e(s(nt,this))))}else y(O,this,Ke).call(this,x)}catch(e){this.error(e)}}function Ke(t){this.is_pending=!1,t.transfer_effects(s(Tn,this),s(Pn,this))}function Vn(t){var e=k,n=M,r=P;dt(s(V,this)),J(s(V,this)),Qt(s(V,this).ctx);try{return Bt.ensure(),t()}finally{dt(e),J(n),Qt(r)}}function yi(t,e){if(!this.has_pending_snippet()){if(this.parent){var n;y(O,n=this.parent,yi).call(n,t,e)}return}g(Lt,this,s(Lt,this)+t),s(Lt,this)===0&&(y(O,this,Ke).call(this,e),s(Y,this)&&ke(s(Y,this),()=>{g(Y,this,null)}),s(xt,this)&&(s(nt,this).before(s(xt,this)),g(xt,this,null)))}function $r(t){s(rt,this)&&(I(s(rt,this)),g(rt,this,null)),s(Y,this)&&(I(s(Y,this)),g(Y,this,null)),s(tt,this)&&(I(s(tt,this)),g(tt,this,null)),T&&(it(s(En,this)),ko(),it(Rr()));let e=s(ft,this).failed;const n=r=>{const{reset:i,invoke_onerror:o}=y(O,this,gi).call(this,r);o(),e&&g(tt,this,y(O,this,Vn).call(this,()=>{try{return gt(()=>{var a=k;a.b=this,a.f|=128,e(s(nt,this),()=>r,()=>i)})}catch(a){return ct(a,s(V,this).parent),null}}))};Ct(()=>{var r;try{r=this.transform_error(t)}catch(i){ct(i,s(V,this)&&s(V,this).parent);return}r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(n,i=>ct(i,s(V,this)&&s(V,this).parent)):n(r)})}function Es(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[Ne]??(t[Ne]=t.nodeValue))&&(t[Ne]=n,t.nodeValue=`${n}`)}function $i(t,e){return ki(t,e)}function Ts(t,e){Sn(),e.intro=e.intro??!1;const n=e.target,r=T,i=W;try{for(var o=Nt(n);o&&(o.nodeType!==8||o.data!=="[");)o=yt(o);if(!o)throw Zt;Xt(!0),it(o);const a=ki(t,{...e,anchor:o});return Xt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==Zt&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Po(),Sn(),Qo(n),Xt(!1),$i(t,e)}finally{Xt(r),it(i)}}var Le=new Map;function ki(t,{target:e,anchor:n,props:r={},events:i,context:o,intro:a=!0,transformError:l}){Sn();var h=void 0,u=ss(()=>{var d=n??e.appendChild(mt());xs(d,{pending:()=>{}},p=>{Or({});var m=P;if(o&&(m.c=o),i&&(r.$$events=i),T&&Kt(p,null),h=t(p,r)||Ln(),T&&(k.nodes.end=W,W===null||W.nodeType!==8||W.data!=="]"))throw Qe(),Zt;Dr()},l);var v=new Set,w=p=>{for(var m=0;m<p.length;m++){var _=p[m];if(!v.has(_)){v.add(_);var A=$s(_);for(const K of[e,document]){var D=Le.get(K);D===void 0&&(D=new Map,Le.set(K,D));var B=D.get(_);B===void 0?(K.addEventListener(_,br,{passive:A}),D.set(_,1)):D.set(_,B+1)}}}};return w(oo(mi)),Wn.add(w),()=>{for(var p of v)for(const A of[e,document]){var m=Le.get(A),_=m.get(p);--_==0?(A.removeEventListener(p,br),m.delete(p),m.size===0&&Le.delete(A)):m.set(p,_)}Wn.delete(w),d!==n&&d.parentNode?.removeChild(d)}});return Rn.set(h,u),h}var Rn=new WeakMap;function Ps(t,e){const n=Rn.get(t);return n?(Rn.delete(t),n(e)):Promise.resolve()}var pt=new WeakMap,$t=new WeakMap,Z=new WeakMap,se=new WeakMap,hn=new WeakMap,cn=new WeakMap,kr=new WeakMap,Rs=class{constructor(t,e=!0){E(this,"anchor",void 0),b(this,pt,new Map),b(this,$t,new Map),b(this,Z,new Map),b(this,se,new Set),b(this,hn,!0),b(this,cn,n=>{if(s(pt,this).has(n)){var r=s(pt,this).get(n),i=s($t,this).get(r);if(i)pr(i),s(se,this).delete(r);else{var o=s(Z,this).get(r);o&&(pr(o.effect),s($t,this).set(r,o.effect),s(Z,this).delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),i=o.effect)}for(const[a,l]of s(pt,this)){if(s(pt,this).delete(a),a===n)break;const h=s(Z,this).get(l);h&&(I(h.effect),s(Z,this).delete(l))}for(const[a,l]of s($t,this)){if(a===r||s(se,this).has(a))continue;const h=()=>{if(Array.from(s(pt,this).values()).includes(a)){var u=document.createDocumentFragment();ui(l,u),u.append(mt()),s(Z,this).set(a,{effect:l,fragment:u})}else I(l);s(se,this).delete(a),s($t,this).delete(a)};s(hn,this)||!i?(s(se,this).add(a),ke(l,h,!1)):h()}}}),b(this,kr,n=>{s(pt,this).delete(n);const r=Array.from(s(pt,this).values());for(const[i,o]of s(Z,this))r.includes(i)||(I(o.effect),s(Z,this).delete(i))}),this.anchor=t,g(hn,this,e)}ensure(t,e){var n=x,r=ts();if(e&&!s($t,this).has(t)&&!s(Z,this).has(t))if(r){var i=document.createDocumentFragment(),o=mt();i.append(o),s(Z,this).set(t,{effect:gt(()=>e(o)),fragment:i})}else s($t,this).set(t,gt(()=>e(this.anchor)));if(s(pt,this).set(n,t),r){for(const[a,l]of s($t,this))a===t?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of s(Z,this))a===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(s(cn,this)),n.ondiscard(s(kr,this))}else T&&(this.anchor=W),s(cn,this).call(this,n)}};function js(t){P===null&&Mo("onMount"),be&&P.l!==null?zs(P).m.push(t):Tt(()=>{const e=ne(t);if(typeof e=="function")return e})}function zs(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function Os(t,e,n=!1){var r;T&&(r=W,Dn());var i=new Rs(t),o=n?On:0;function a(l,h){if(T){var u=_o(r);if(l!==parseInt(u.substring(1))){var d=Rr();it(d),i.anchor=d,Xt(!1),i.ensure(l,h),Xt(!0);return}}i.ensure(l,h)}ii(()=>{var l=!1;e((h,u=0)=>{l=!0,a(u,h)}),l||a(-1,null)},o)}function Ds(t,e){ri(()=>{t=k?.parent?.nodes?.start??t;var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const i=Bn("style");i.id=e.hash,i.textContent=e.code,r.appendChild(i)}})}function _r(t,e=!1){var n=e?" !important;":";",r="";for(var i of Object.keys(t)){var o=t[i];o!=null&&o!==""&&(r+=" "+i+": "+o+n)}return r}function dn(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Ls(t,e){if(e){var n="",r,i;if(Array.isArray(e)?(r=e[0],i=e[1]):r=e,t){t=String(t).replaceAll(/\/\*.*?\*\//g,"").trim();var o=!1,a=0,l=!1,h=[];r&&h.push(...Object.keys(r).map(dn)),i&&h.push(...Object.keys(i).map(dn));var u=0,d=-1;const _=t.length;for(var v=0;v<_;v++){var w=t[v];if(l?w==="/"&&t[v-1]==="*"&&(l=!1):o?o===w&&(o=!1):w==="/"&&t[v+1]==="*"?l=!0:w==='"'||w==="'"?o=w:w==="("?a++:w===")"&&a--,!l&&o===!1&&a===0){if(w===":"&&d===-1)d=v;else if(w===";"||v===_-1){if(d!==-1){var p=dn(t.substring(u,d).trim());if(!h.includes(p)){w!==";"&&v++;var m=t.substring(u,v).trim();n+=" "+m+";"}}u=v+1,d=-1}}}}return r&&(n+=_r(r)),i&&(n+=_r(i,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function vn(t,e={},n,r){for(var i in n){var o=n[i];e[i]!==o&&(n[i]==null?t.style.removeProperty(i):t.style.setProperty(i,o,r))}}function Cs(t,e,n,r){var i=t[bn];if(T||i!==e){var o=Ls(e,r);(!T||o!==t.getAttribute("style"))&&(o==null?t.removeAttribute("style"):t.style.cssText=o),t[bn]=e}else r&&(Array.isArray(r)?(vn(t,n?.[0],r[0]),vn(t,n?.[1],r[1],"important")):vn(t,n,r));return r}var Ns=Symbol("is custom element"),Hs=Symbol("is html"),Bs=bo?"link":"LINK";function st(t,e,n,r){var i=Fs(t);T&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===Bs)||i[e]!==(i[e]=n)&&(e==="loading"&&(t[mo]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Is(t).has(e)?t[e]=n:t.setAttribute(e,n))}function Fs(t){return t[gn]??(t[gn]={[Ns]:t.nodeName.includes("-"),[Hs]:t.namespaceURI==="http://www.w3.org/1999/xhtml"})}var xr=new Map;function Is(t){var e=t.getAttribute("is")||t.nodeName,n=xr.get(e);if(n)return n;xr.set(e,n=new Set);for(var r,i=t,o=Element.prototype;o!==i;){r=so(i);for(var a in r)r[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&n.add(a);i=Wr(i)}return n}var _i,Yt=new WeakMap,Ze=new WeakMap,pn=new WeakMap,Mr=new WeakSet,xi=class{constructor(t){Hn(this,Mr),b(this,Yt,new WeakMap),b(this,Ze,void 0),b(this,pn,void 0),g(pn,this,t)}observe(t,e){var n=s(Yt,this).get(t)||new Set;return n.add(e),s(Yt,this).set(t,n),y(Mr,this,qs).call(this).observe(t,s(pn,this)),()=>{var r=s(Yt,this).get(t);r.delete(e),r.size===0&&(s(Yt,this).delete(t),s(Ze,this).unobserve(t))}}};_i=xi;function qs(){return s(Ze,this)??g(Ze,this,new ResizeObserver(t=>{for(var e of t){_i.entries.set(e.target,e);for(var n of s(Yt,this).get(e.target)||[])n(e)}}))}E(xi,"entries",new WeakMap);function wn(t,e){return t===e||t?.[ue]===e}function Us(t=Ln(),e,n,r){var i=P.r,o=k;return ri(()=>{var a,l;return qn(()=>{a=l,l=r?.()||[],ne(()=>{wn(n(...l),t)||(e(t,...l),a&&wn(n(...a),t)&&e(null,...a))})}),()=>{let h=o;for(;h!==i&&h.parent!==null&&h.parent.f&33554432;)h=h.parent;const u=()=>{l&&wn(n(...l),t)&&e(null,...l)},d=h.teardown;h.teardown=()=>{u(),d?.()}}}),t}var Ce=!1;function Vs(t){var e=Ce;try{return Ce=!1,[t(),Ce]}finally{Ce=e}}function Sr(t,e,n,r){var i=!be||(n&2)!==0,o=(n&8)!==0,a=(n&16)!==0,l=r,h=!0,u=void 0,d=()=>a&&i?(u??(u=ve(r)),f(u)):(h&&(h=!1,l=a?ne(r):r),l);let v;if(o){var w=ue in t||Tr in t;v=zt(t,e)?.set??(w&&e in t?L=>t[e]=L:void 0)}var p,m=!1;o?[p,m]=Vs(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=d(),v&&(i&&Ro(e),v(p)));var _;if(i?_=()=>{var L=t[e];return L===void 0?d():(h=!0,L)}:_=()=>{var L=t[e];return L!==void 0&&(l=void 0),L===void 0?l:L},i&&(n&4)===0)return _;if(v){var A=t.$$legacy;return(function(L,Ft){return arguments.length>0?((!i||!Ft||A||m)&&v(Ft?_():L),L):_()})}var D=!1,B=((n&1)!==0?ve:Hr)(()=>(D=!1,_()));o&&f(B);var K=k;return(function(L,Ft){if(arguments.length>0){const xe=Ft?f(B):i&&o?_t(L):L;return S(B,xe),D=!0,l!==void 0&&(l=xe),L}return bt&&D||(K.f&16384)!==0?B.v:f(B)})}function Ys(t){return new Xs(t)}var At=new WeakMap,at=new WeakMap,Xs=class{constructor(t){b(this,At,void 0),b(this,at,void 0);var e=new Map,n=(i,o)=>{var a=Jo(o,!1,!1);return e.set(i,a),a};const r=new Proxy({...t.props||{},$$events:{}},{get(i,o){return f(e.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===Tr?!0:(f(e.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,a){return S(e.get(o)??n(o,a),a),Reflect.set(i,o,a)}});g(at,this,(t.hydrate?Ts:$i)(t.component,{target:t.target,anchor:t.anchor,props:r,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!t?.props?.$$host||t.sync===!1)&&xn(),g(At,this,r.$$events);for(const i of Object.keys(s(at,this)))i==="$set"||i==="$destroy"||i==="$on"||ce(this,i,{get(){return s(at,this)[i]},set(o){s(at,this)[i]=o},enumerable:!0});s(at,this).$set=i=>{Object.assign(r,i)},s(at,this).$destroy=()=>{Ps(s(at,this))}}$set(t){s(at,this).$set(t)}$on(t,e){s(At,this)[t]=s(At,this)[t]||[];const n=(...r)=>e.call(this,...r);return s(At,this)[t].push(n),()=>{s(At,this)[t]=s(At,this)[t].filter(r=>r!==n)}}$destroy(){s(at,this).$destroy()}},Mi;typeof HTMLElement=="function"&&(Mi=class extends HTMLElement{constructor(t,e,n){super(),E(this,"$$ctor",void 0),E(this,"$$s",void 0),E(this,"$$c",void 0),E(this,"$$cn",!1),E(this,"$$d",{}),E(this,"$$r",!1),E(this,"$$p_d",{}),E(this,"$$l",{}),E(this,"$$l_u",new Map),E(this,"$$me",void 0),E(this,"$$shadowRoot",null),this.$$ctor=t,this.$$s=e,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const r=this.$$l_u.get(e);r&&(r(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(r){return i=>{const o=Bn("slot");r!=="default"&&(o.name=r),An(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},n=Gs(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=t(r),e.default=!0):e[r]=t(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=Be(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Ys({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=os(()=>{qn(()=>{this.$$r=!0;for(const r of Fe(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=Be(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const o=this.$$c.$on(r,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Be(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Fe(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Be(t,e,n,r){const i=n[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Gs(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Js(t,e,n,r,i,o){let a=class extends Mi{constructor(){super(t,n,i),this.$$p_d=e}static get observedAttributes(){return Fe(e).map(l=>(e[l].attribute||l).toLowerCase())}};return Fe(e).forEach(l=>{ce(a.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(h){h=Be(l,h,e),this.$$d[l]=h;var u=this.$$c;u&&(zt(u,l)?.get?u[l]=h:u.$set({[l]:h}))}})}),r.forEach(l=>{ce(a.prototype,l,{get(){return this.$$c?.[l]}})}),o&&(a=o(a)),t.element=a,a}var Ks=gs('<div class="pie-sr-only svelte-a1a4bp" role="status" aria-live="polite" aria-atomic="true"> </div> <div class="pie-tool-line-reader svelte-a1a4bp" role="group" tabindex="0"><div class="pie-tool-line-reader__frame svelte-a1a4bp" aria-hidden="true"></div> <div class="pie-tool-line-reader__outline svelte-a1a4bp" aria-hidden="true"></div> <button type="button" class="pie-tool-line-reader__button pie-tool-line-reader__close svelte-a1a4bp"><svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M1 1 L11 11 M11 1 L1 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button> <button type="button" class="pie-tool-line-reader__resize-handle pie-tool-line-reader__resize-handle--pane svelte-a1a4bp"><svg width="14" height="8" viewBox="0 0 14 8" aria-hidden="true" focusable="false"><path d="M1 2.5 H13 M1 5.5 H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button> <button type="button" class="pie-tool-line-reader__resize-handle pie-tool-line-reader__resize-handle--frame svelte-a1a4bp"><svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M11 4 L4 11 M11 8 L8 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div>',1),Zs={hash:"svelte-a1a4bp",code:`.pie-sr-only.svelte-a1a4bp {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}.pie-tool-line-reader.svelte-a1a4bp {border:none;border-radius:4px;
3
3
  /*
4
4
  * Ink-derived rather than fixed black: on a dark scheme this reads as a soft
5
5
  * halo separating the window from the page instead of vanishing into it.
@@ -59,4 +59,4 @@ import{a as Yi,m as Vi,r as Gi}from"./tool-host-contract-b93b482c.js";import{n a
59
59
 
60
60
  /* Resizes the reading window: vertical only, centred on the bottom band. */.pie-tool-line-reader__resize-handle--pane.svelte-a1a4bp {bottom:4px;left:50%;margin-left:-12px;cursor:ns-resize;}
61
61
 
62
- /* Resizes the frame bands and the overall width, so it reads as a corner grip. */.pie-tool-line-reader__resize-handle--frame.svelte-a1a4bp {bottom:4px;right:4px;cursor:nwse-resize;}.pie-tool-line-reader.svelte-a1a4bp:active {cursor:grabbing;}`};function Zs(t,e){jr(e,!0),Os(t,Js);let n=Mr(e,"visible",7,!1),r=Mr(e,"toolId",7,"lineReader");const i=typeof window<"u";let o=N(void 0),a=N(null);const l=on(()=>f(a)?.toolCoordinator);let h=N(null),u=N(_t({x:0,y:0})),d=!1;const v=Zi({getPosition:()=>f(u),setPosition:c=>{S(u,St(c),!0)},onDragStart:c=>f(l)?.bringToFront(c)});let w=N(600),p=N(24),m=N(48),_=N(_t({paneHeight:0,frameBandHeight:0,width:0,mouseX:0,mouseY:0}));const A=on(()=>to(f(a)));let D=N("");const I=Yi("Line Reader",eo.TOOL),J=12,L=200,Bt=32,_e=240,Xn=200,Yn=2e3,Vn=4,xe=10,en=10,Mi=20,Gn=on(()=>f(p)+f(m)*2);Tt(()=>{if(f(o))return Gi(f(o),c=>{S(a,c,!0)})});function Mt(c){S(D,c,!0),setTimeout(()=>S(D,""),1e3)}function Kn(c){return Math.max(J,Math.min(L,c))}function Jn(c){return Math.max(Bt,Math.min(_e,c))}function Me(c){const $=Qn()?.width,q=$===void 0?Yn:Math.min(Yn,$-Vn*2);return Math.max(Xn,Math.min(Math.max(Xn,q),c))}function Zn(){return Ji(f(o))}function Qn(){const c=Zn();return c&&{width:c.width,height:c.height}}function Si(){const c=Zn();if(!c)return;const $=Math.max(c.left,0),q=Math.max(c.top,0),Ae=Math.min(c.right,window.innerWidth),C=Math.min(c.bottom,window.innerHeight);return Ae<=$||C<=q?{x:c.width/2,y:c.height/2}:{x:($+Ae)/2-c.left,y:(q+C)/2-c.top}}function St(c){const $=Qn();return $?Ki(c,{width:f(w),height:f(Gn)},$,Vn):c}function re(){S(u,St(f(u)),!0)}function Se(c){S(p,Kn(f(p)+c),!0),re(),Mt(f(A).t("tools.lineReader.windowHeightAnnounce",{pixels:f(p)}))}function tr(c){S(m,Jn(f(m)+c),!0),re(),Mt(f(A).t("tools.lineReader.frameHeightAnnounce",{pixels:f(m)}))}function er(c){S(w,Me(f(w)+c),!0),re(),Mt(f(A).t("tools.lineReader.widthAnnounce",{pixels:f(w)}))}function nr(){f(l)&&r()&&f(l).hideTool(r())}function Wi(c){const $=c.target,q=$.closest(".pie-tool-line-reader__resize-handle");if(q){Ei(c,q.classList.contains("pie-tool-line-reader__resize-handle--frame")?"frame":"pane",q);return}$.closest("button")||Ai(c)}const We=Qi({onMove:Ti,onEnd:()=>{v.endDragging(),S(h,null)}});function Ai(c){!f(o)||!We.begin(c,f(o))||(f(o).focus({preventScroll:!0}),v.startDragging(c,f(o)))}function Ei(c,$,q){c.stopPropagation(),f(o)&&We.begin(c,f(o))&&(f(o).setPointerCapture(c.pointerId),q.focus({preventScroll:!0}),S(h,$,!0),S(_,{paneHeight:f(p),frameBandHeight:f(m),width:f(w),mouseX:c.clientX,mouseY:c.clientY},!0),f(l)?.bringToFront(f(o)))}function Ti(c){if(v.isDragging()){v.handlePointerMove(c);return}if(!f(h))return;const $=c.clientY-f(_).mouseY;if(f(h)==="pane"){S(p,Kn(f(_).paneHeight+$*2),!0);return}S(m,Jn(f(_).frameBandHeight+$),!0),S(w,Me(f(_).width+(c.clientX-f(_).mouseX)*2),!0),re()}function Pi(c){let $=!1;switch(c.key){case"ArrowUp":S(u,St({x:f(u).x,y:f(u).y-xe}),!0),Mt(f(A).t("toolkit.announce.movedUp",{position:Math.round(f(u).y)})),$=!0;break;case"ArrowDown":S(u,St({x:f(u).x,y:f(u).y+xe}),!0),Mt(f(A).t("toolkit.announce.movedDown",{position:Math.round(f(u).y)})),$=!0;break;case"ArrowLeft":S(u,St({x:f(u).x-xe,y:f(u).y}),!0),Mt(f(A).t("toolkit.announce.movedLeft",{position:Math.round(f(u).x)})),$=!0;break;case"ArrowRight":S(u,St({x:f(u).x+xe,y:f(u).y}),!0),Mt(f(A).t("toolkit.announce.movedRight",{position:Math.round(f(u).x)})),$=!0;break;case"+":case"=":Se(en),$=!0;break;case"-":case"_":Se(-10),$=!0;break;case"Escape":nr(),$=!0}$&&c.preventDefault()}function Ri(c){let $=!1;switch(c.key){case"ArrowUp":Se(-10),$=!0;break;case"ArrowDown":Se(en),$=!0}$&&(c.preventDefault(),c.stopPropagation())}function zi(c){let $=!1;switch(c.key){case"ArrowUp":tr(-10),$=!0;break;case"ArrowDown":tr(en),$=!0;break;case"ArrowLeft":er(-20),$=!0;break;case"ArrowRight":er(Mi),$=!0}$&&(c.preventDefault(),c.stopPropagation())}Tt(()=>I.sync(f(l),r())),Rs(()=>()=>{We.release(),I.release()}),Tt(()=>{f(l)&&f(o)&&r()&&f(l).updateToolElement(r(),f(o))});function ji(){if(d)return;const c=Si();c&&(d=!0,S(w,Me(f(w)),!0),S(u,St(c),!0))}Tt(()=>{n()||ee(()=>We.release())}),Tt(()=>{if(!n()||!f(o))return;ee(ji);const c=setTimeout(()=>f(o)?.focus({preventScroll:!0}),100);return()=>clearTimeout(c)}),Tt(()=>{if(!i||!n())return;const c=()=>{S(w,Me(f(w)),!0),re()};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)});var Oi={get visible(){return n()},set visible(c=!1){n(c),_n()},get toolId(){return r()},set toolId(c="lineReader"){r(c),_n()}},rr=gs(),Di=dr(rr),Li=c=>{var $=Ks(),q=dr($),Ae=Jo(q,!0),C=je(q,2),Ee=je(ti(C),4),Te=je(Ee,2),nn=je(Te,2);Tr(C),qs(C,rn=>S(o,rn),()=>f(o)),as((rn,Ni,Ci,Hi,Ii,Bi,Fi,qi,Ui,Xi)=>{As(Ae,f(D)),Ls(C,`left: ${f(u).x??""}px; top: ${f(u).y??""}px; width: ${f(w)??""}px; height: ${f(Gn)??""}px; --pie-tool-line-reader-band-height: ${f(m)??""}px; --pie-tool-line-reader-side-width: 12px;`),st(C,"lang",rn),st(C,"dir",Ni),st(C,"aria-label",Ci),st(C,"aria-roledescription",Hi),st(Ee,"title",Ii),st(Ee,"aria-label",Bi),st(Te,"title",Fi),st(Te,"aria-label",qi),st(nn,"title",Ui),st(nn,"aria-label",Xi),C.dir=C.dir},[()=>f(A).getLocale(),()=>f(A).getDirection?.()??"ltr",()=>f(A).t("tools.lineReader.applicationA11y",{paneHeight:f(p),frameHeight:f(m)}),()=>f(A).t("tools.lineReader.roleA11y"),()=>f(A).t("tools.lineReader.close"),()=>f(A).t("tools.lineReader.close"),()=>f(A).t("tools.lineReader.resizeWindowA11y"),()=>f(A).t("tools.lineReader.resizeWindowFullA11y",{paneHeight:f(p)}),()=>f(A).t("tools.lineReader.resizeFrameA11y"),()=>f(A).t("tools.lineReader.resizeFrameFullA11y",{frameHeight:f(m),width:f(w)})]),ie("pointerdown",C,Wi),ie("keydown",C,Pi),ie("click",Ee,nr),ie("keydown",Te,Ri),ie("keydown",nn,zi),Wn(c,$)};return js(Di,c=>{n()&&c(Li)}),Wn(t,rr),Or(Oi)}ds(["pointerdown","keydown","click"]);Qs("pie-tool-line-reader",Gs(Zs,{visible:{attribute:"visible",type:"Boolean"},toolId:{attribute:"tool-id",type:"String"}},[],[],{mode:"open"},Vi));function Qs(t,e){customElements.get(t)||customElements.define(t,e)}export{Zs as default};
62
+ /* Resizes the frame bands and the overall width, so it reads as a corner grip. */.pie-tool-line-reader__resize-handle--frame.svelte-a1a4bp {bottom:4px;right:4px;cursor:nwse-resize;}.pie-tool-line-reader.svelte-a1a4bp:active {cursor:grabbing;}`};function Qs(t,e){Or(e,!0),Ds(t,Zs);let n=Sr(e,"visible",7,!1),r=Sr(e,"toolId",7,"lineReader");const i=typeof window<"u";let o=C(void 0),a=C(null);const l=sn(()=>f(a)?.toolCoordinator);let h=C(null),u=C(_t({x:0,y:0})),d=!1;const v=Qi({getPosition:()=>f(u),setPosition:c=>{S(u,St(c),!0)},onDragStart:c=>f(l)?.bringToFront(c)});let w=C(600),p=C(24),m=C(48),_=C(_t({paneHeight:0,frameBandHeight:0,width:0,mouseX:0,mouseY:0}));const A=sn(()=>eo(f(a)));let D=C("");const B=Gi("Line Reader",no.TOOL),K=12,L=200,Ft=32,xe=240,Yn=200,Xn=2e3,Gn=4,Me=10,nn=10,Si=20,Jn=sn(()=>f(p)+f(m)*2);Tt(()=>{if(f(o))return Ji(f(o),c=>{S(a,c,!0)})});let It=null;function Mt(c){It!==null&&clearTimeout(It),S(D,c,!0),It=setTimeout(()=>{S(D,""),It=null},1e3)}function Kn(c){return Math.max(K,Math.min(L,c))}function Zn(c){return Math.max(Ft,Math.min(xe,c))}function Se(c){const $=tr()?.width,q=$===void 0?Xn:Math.min(Xn,$-Gn*2);return Math.max(Yn,Math.min(Math.max(Yn,q),c))}function Qn(){return Zi(f(o))}function tr(){const c=Qn();return c&&{width:c.width,height:c.height}}function Wi(){const c=Qn();if(!c)return;const $=Math.max(c.left,0),q=Math.max(c.top,0),Ee=Math.min(c.right,window.innerWidth),N=Math.min(c.bottom,window.innerHeight);return Ee<=$||N<=q?{x:c.width/2,y:c.height/2}:{x:($+Ee)/2-c.left,y:(q+N)/2-c.top}}function St(c){const $=tr();return $?Ki(c,{width:f(w),height:f(Jn)},$,Gn):c}function ie(){S(u,St(f(u)),!0)}function We(c){S(p,Kn(f(p)+c),!0),ie(),Mt(f(A).t("tools.lineReader.windowHeightAnnounce",{pixels:f(p)}))}function er(c){S(m,Zn(f(m)+c),!0),ie(),Mt(f(A).t("tools.lineReader.frameHeightAnnounce",{pixels:f(m)}))}function nr(c){S(w,Se(f(w)+c),!0),ie(),Mt(f(A).t("tools.lineReader.widthAnnounce",{pixels:f(w)}))}function rr(){f(l)&&r()&&f(l).hideTool(r())}function Ai(c){const $=c.target,q=$.closest(".pie-tool-line-reader__resize-handle");if(q){Ti(c,q.classList.contains("pie-tool-line-reader__resize-handle--frame")?"frame":"pane",q);return}$.closest("button")||Ei(c)}const Ae=to({onMove:Pi,onEnd:()=>{v.endDragging(),S(h,null)}});function Ei(c){!f(o)||!Ae.begin(c,f(o))||(f(o).focus({preventScroll:!0}),v.startDragging(c,f(o)))}function Ti(c,$,q){c.stopPropagation(),f(o)&&Ae.begin(c,f(o))&&(f(o).setPointerCapture(c.pointerId),q.focus({preventScroll:!0}),S(h,$,!0),S(_,{paneHeight:f(p),frameBandHeight:f(m),width:f(w),mouseX:c.clientX,mouseY:c.clientY},!0),f(l)?.bringToFront(f(o)))}function Pi(c){if(v.isDragging()){v.handlePointerMove(c);return}if(!f(h))return;const $=c.clientY-f(_).mouseY;if(f(h)==="pane"){S(p,Kn(f(_).paneHeight+$*2),!0);return}S(m,Zn(f(_).frameBandHeight+$),!0),S(w,Se(f(_).width+(c.clientX-f(_).mouseX)*2),!0),ie()}function Ri(c){let $=!1;switch(c.key){case"ArrowUp":S(u,St({x:f(u).x,y:f(u).y-Me}),!0),Mt(f(A).t("toolkit.announce.movedUp",{position:Math.round(f(u).y)})),$=!0;break;case"ArrowDown":S(u,St({x:f(u).x,y:f(u).y+Me}),!0),Mt(f(A).t("toolkit.announce.movedDown",{position:Math.round(f(u).y)})),$=!0;break;case"ArrowLeft":S(u,St({x:f(u).x-Me,y:f(u).y}),!0),Mt(f(A).t("toolkit.announce.movedLeft",{position:Math.round(f(u).x)})),$=!0;break;case"ArrowRight":S(u,St({x:f(u).x+Me,y:f(u).y}),!0),Mt(f(A).t("toolkit.announce.movedRight",{position:Math.round(f(u).x)})),$=!0;break;case"+":case"=":We(nn),$=!0;break;case"-":case"_":We(-10),$=!0;break;case"Escape":rr(),$=!0}$&&c.preventDefault()}function ji(c){let $=!1;switch(c.key){case"ArrowUp":We(-10),$=!0;break;case"ArrowDown":We(nn),$=!0}$&&(c.preventDefault(),c.stopPropagation())}function zi(c){let $=!1;switch(c.key){case"ArrowUp":er(-10),$=!0;break;case"ArrowDown":er(nn),$=!0;break;case"ArrowLeft":nr(-20),$=!0;break;case"ArrowRight":nr(Si),$=!0}$&&(c.preventDefault(),c.stopPropagation())}Tt(()=>B.sync(f(l),r())),js(()=>()=>{It!==null&&clearTimeout(It),Ae.release(),B.release()}),Tt(()=>{f(l)&&f(o)&&r()&&f(l).updateToolElement(r(),f(o))});function Oi(){if(d)return;const c=Wi();c&&(d=!0,S(w,Se(f(w)),!0),S(u,St(c),!0))}Tt(()=>{n()||ne(()=>Ae.release())}),Tt(()=>{if(!n()||!f(o))return;ne(Oi);const c=setTimeout(()=>f(o)?.focus({preventScroll:!0}),100);return()=>clearTimeout(c)}),Tt(()=>{if(!i||!n())return;const c=()=>{S(w,Se(f(w)),!0),ie()};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)});var Di={get visible(){return n()},set visible(c=!1){n(c),xn()},get toolId(){return r()},set toolId(c="lineReader"){r(c),xn()}},ir=bs(),Li=vr(ir),Ci=c=>{var $=Ks(),q=vr($),Ee=Zo(q,!0),N=Oe(q,2),Te=Oe(ei(N),4),Pe=Oe(Te,2),rn=Oe(Pe,2);Pr(N),Us(N,on=>S(o,on),()=>f(o)),ls((on,Ni,Hi,Bi,Fi,Ii,qi,Ui,Vi,Yi)=>{Es(Ee,f(D)),Cs(N,`left: ${f(u).x??""}px; top: ${f(u).y??""}px; width: ${f(w)??""}px; height: ${f(Jn)??""}px; --pie-tool-line-reader-band-height: ${f(m)??""}px; --pie-tool-line-reader-side-width: 12px;`),st(N,"lang",on),st(N,"dir",Ni),st(N,"aria-label",Hi),st(N,"aria-roledescription",Bi),st(Te,"title",Fi),st(Te,"aria-label",Ii),st(Pe,"title",qi),st(Pe,"aria-label",Ui),st(rn,"title",Vi),st(rn,"aria-label",Yi),N.dir=N.dir},[()=>f(A).getLocale(),()=>f(A).getDirection?.()??"ltr",()=>f(A).t("tools.lineReader.applicationA11y",{paneHeight:f(p),frameHeight:f(m)}),()=>f(A).t("tools.lineReader.roleA11y"),()=>f(A).t("tools.lineReader.close"),()=>f(A).t("tools.lineReader.close"),()=>f(A).t("tools.lineReader.resizeWindowA11y"),()=>f(A).t("tools.lineReader.resizeWindowFullA11y",{paneHeight:f(p)}),()=>f(A).t("tools.lineReader.resizeFrameA11y"),()=>f(A).t("tools.lineReader.resizeFrameFullA11y",{frameHeight:f(m),width:f(w)})]),oe("pointerdown",N,Ai),oe("keydown",N,Ri),oe("click",Te,rr),oe("keydown",Pe,ji),oe("keydown",rn,zi),An(c,$)};return Os(Li,c=>{n()&&c(Ci)}),An(t,ir),Dr(Di)}vs(["pointerdown","keydown","click"]);ta("pie-tool-line-reader",Js(Qs,{visible:{attribute:"visible",type:"Boolean"},toolId:{attribute:"tool-id",type:"String"}},[],[],{mode:"open"},Xi));function ta(t,e){customElements.get(t)||customElements.define(t,e)}export{Qs as default};