@pie-players/pie-section-player 0.3.74 → 0.3.75

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 (121) hide show
  1. package/README.md +249 -134
  2. package/dist/browser/assets/{evaluation-worker-DkU_wGh3.js → evaluation-worker-CORp9m0K.js} +39245 -38027
  3. package/dist/browser/chunks/PUA-tLuTiQ7--f2b27953.js +1 -1
  4. package/dist/browser/chunks/accents-BTUYmhn9-cafeb96e.js +1 -1
  5. package/dist/browser/chunks/accents-b-i-CngHZsLL-e0eb98fd.js +1 -1
  6. package/dist/browser/chunks/arabic-BzEHMVZD-30ac1ade.js +1 -1
  7. package/dist/browser/chunks/arrows-VjxlU-jv-2e17c192.js +1 -1
  8. package/dist/browser/chunks/braille-BeWC_Ruq-a3bb8ef9.js +1 -1
  9. package/dist/browser/chunks/braille-d-Dk6J96GO-d832bfbf.js +1 -1
  10. package/dist/browser/chunks/browser-a3c32178.js +17 -16
  11. package/dist/browser/chunks/calculator-element-271c142f.js +7 -3
  12. package/dist/browser/chunks/calligraphic-Cew9cU3x-04cf0735.js +1 -1
  13. package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -0
  14. package/dist/browser/chunks/catalog-owner-d602f784.js +1 -0
  15. package/dist/browser/chunks/cherokee-Cny3FYho-4da7d2f3.js +1 -1
  16. package/dist/browser/chunks/cyrillic-CfCDulXU-5550df0b.js +1 -1
  17. package/dist/browser/chunks/cyrillic-ss-lU7bNGG9-12eb0188.js +1 -1
  18. package/dist/browser/chunks/devanagari-CDIz2h-r-18c38725.js +1 -1
  19. package/dist/browser/chunks/dist-41b39e7f.js +1 -1
  20. package/dist/browser/chunks/dist-59132a53.js +1 -1
  21. package/dist/browser/chunks/dist-60d7afef.js +1 -1
  22. package/dist/browser/chunks/dist-ca9b9622.js +1 -1
  23. package/dist/browser/chunks/double-struck-BpJEQk8y-500ce8dd.js +1 -1
  24. package/dist/browser/chunks/fraktur-rLEq9DEH-44cc14d8.js +1 -1
  25. package/dist/browser/chunks/greek-BlraJTyL-90ce8924.js +1 -1
  26. package/dist/browser/chunks/greek-ss-D-EN2PK0-91610739.js +1 -1
  27. package/dist/browser/chunks/hebrew-GiQZeybp-b583f555.js +1 -1
  28. package/dist/browser/chunks/latin-b-BhEnC7R2-d13e06ff.js +1 -1
  29. package/dist/browser/chunks/latin-bi-DqiIKv3U-1dec8705.js +1 -1
  30. package/dist/browser/chunks/latin-i-B1xtwaE1-21637466.js +1 -1
  31. package/dist/browser/chunks/latin-xfWFlLkD-5bcea5cf.js +1 -1
  32. package/dist/browser/chunks/logger-8b07fb72.js +1 -1
  33. package/dist/browser/chunks/marrows-DD1NgMQi-15b63755.js +1 -1
  34. package/dist/browser/chunks/math-DpWn1mbG-38eeb914.js +1 -1
  35. package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
  36. package/dist/browser/chunks/{mathjax-D2JHb_R_-64780dc5.js → mathjax-BKrHE4xs-3ca05bf6.js} +41 -41
  37. package/dist/browser/chunks/monospace-D116QD2a-98d484fd.js +1 -1
  38. package/dist/browser/chunks/monospace-ex-DcXpouKS-456b403c.js +1 -1
  39. package/dist/browser/chunks/monospace-l-Ct5wkMDs-f34a4a9e.js +1 -1
  40. package/dist/browser/chunks/mshapes-DCp86WSX-c0055952.js +1 -1
  41. package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
  42. package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
  43. package/dist/browser/chunks/phonetics-BwOCw2Y9-d2e3af59.js +1 -1
  44. package/dist/browser/chunks/phonetics-ss-CRtMn02f-579b6135.js +1 -1
  45. package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
  46. package/dist/browser/chunks/provider-4c704118.js +1 -1
  47. package/dist/browser/chunks/{runtime-C7H1jS4E-64772f5e.js → runtime-wcU7KOFU-ac86d7b8.js} +401 -278
  48. package/dist/browser/chunks/sans-serif-BYPZKlE9-2efdbcd9.js +1 -1
  49. package/dist/browser/chunks/sans-serif-b-B0kRKiC--b5530dce.js +1 -1
  50. package/dist/browser/chunks/sans-serif-bi-DXWul6mu-5370dba4.js +1 -1
  51. package/dist/browser/chunks/sans-serif-ex-Boux1kMP-aa178f31.js +1 -1
  52. package/dist/browser/chunks/sans-serif-i-676RFaSO-2db54474.js +1 -1
  53. package/dist/browser/chunks/sans-serif-r-DrN9xdZt-0fc72eea.js +1 -1
  54. package/dist/browser/chunks/script-0ohehnXc-526904f4.js +1 -1
  55. package/dist/browser/chunks/shapes-BG47NodJ-d59b0eca.js +1 -1
  56. package/dist/browser/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-0162a7a9.js} +18 -18
  57. package/dist/browser/chunks/sre-engine-ace23548.js +1 -0
  58. package/dist/browser/chunks/sre-engine-jd8cc08x-42d270e5.js +1 -0
  59. package/dist/browser/chunks/sre-locales-112320af.js +1 -0
  60. package/dist/browser/chunks/symbols-BqnUxf_t-83087e87.js +1 -1
  61. package/dist/browser/chunks/symbols-b-i-eg9k5hmF-9c461ac2.js +1 -1
  62. package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +7 -6
  63. package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +4 -4
  64. package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +2 -2
  65. package/dist/browser/chunks/tool-dictionary-cecff3b4.js +1 -1
  66. package/dist/browser/chunks/tool-graph-cb0338e8.js +4 -4
  67. package/dist/browser/chunks/tool-host-contract-b93b482c.js +1 -1
  68. package/dist/browser/chunks/tool-instance-id-2a92deb0.js +1 -0
  69. package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +2 -2
  70. package/dist/browser/chunks/tool-periodic-table-43b133b8.js +1 -1
  71. package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +1 -1
  72. package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
  73. package/dist/browser/chunks/tool-ruler-1d9a03a6.js +6 -6
  74. package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +7 -7
  75. package/dist/browser/chunks/tts-runtime-config-a7ab1ad4.js +194 -0
  76. package/dist/browser/chunks/variants-2LRNhOUP-966fc49d.js +1 -1
  77. package/dist/browser/pie-section-player.js +199 -85
  78. package/dist/chunks/nl-NL-364d61b9.js +1 -24
  79. package/dist/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-engine-jd8cc08x-42d270e5.js} +1 -1
  80. package/dist/components/shared/composition.d.ts +3 -1
  81. package/dist/components/shared/framework-error-latch.d.ts +32 -0
  82. package/dist/components/shared/host-element.d.ts +10 -0
  83. package/dist/components/shared/kernel-host-default-body.d.ts +14 -0
  84. package/dist/components/shared/layout-host-methods.d.ts +12 -27
  85. package/dist/components/shared/missing-tool-providers.d.ts +8 -8
  86. package/dist/components/shared/section-player-backend-delivery.d.ts +1 -1
  87. package/dist/components/shared/section-player-card-context.d.ts +5 -1
  88. package/dist/components/shared/section-player-host-runtime.d.ts +32 -19
  89. package/dist/components/shared/section-player-layout-context.d.ts +77 -0
  90. package/dist/components/shared/section-player-own-event.d.ts +10 -0
  91. package/dist/components/shared/section-player-runtime-callbacks.d.ts +1 -1
  92. package/dist/components/shared/section-player-shell-layout.svelte.d.ts +3 -11
  93. package/dist/components/shared/section-player-view-state.d.ts +6 -1
  94. package/dist/components/shared/toolkit-ready-wait.d.ts +16 -0
  95. package/dist/contracts/host-hooks.d.ts +0 -7
  96. package/dist/contracts/runtime-host-contract.d.ts +0 -5
  97. package/dist/controllers/SectionController.d.ts +1 -0
  98. package/dist/controllers/types.d.ts +8 -1
  99. package/dist/item-section/index.d.ts +22 -0
  100. package/dist/item-section/index.js +37 -0
  101. package/dist/pie-section-player.d.ts +4 -6
  102. package/dist/pie-section-player.js +19437 -19877
  103. package/dist/policies/index.d.ts +1 -19
  104. package/dist/policies/index.js +6 -14
  105. package/dist/policies/types.d.ts +0 -4
  106. package/package.json +13 -53
  107. package/dist/browser/chunks/custom-element-define-2a92deb0.js +0 -1
  108. package/dist/browser/chunks/nds-icon-button-d602f784.js +0 -194
  109. package/dist/browser/chunks/pie-tool-calculator-cortex-0626bc24.js +0 -9
  110. package/dist/browser/chunks/pie-tool-calculator-geogebra-561236cb.js +0 -9
  111. package/dist/components/item-shell-element.d.ts +0 -1
  112. package/dist/components/shared/shell-registration.d.ts +0 -55
  113. package/dist/contracts/layout-contract.d.ts +0 -17
  114. package/dist/contracts/layout-contract.js +0 -0
  115. package/dist/contracts/layout-parity-metadata.d.ts +0 -4
  116. package/dist/contracts/layout-parity-metadata.js +0 -87
  117. package/dist/contracts/public-events.d.ts +0 -92
  118. package/dist/contracts/public-events.js +0 -12
  119. package/dist/policies/guards.d.ts +0 -2
  120. /package/dist/browser/chunks/{ItemToolBar-wr2myaah-2ce4b643.js → ItemToolBar-jx38w99s-58defccc.js} +0 -0
  121. /package/dist/chunks/{ItemToolBar-wr2myaah-1287ba31.js → ItemToolBar-jx38w99s-1287ba31.js} +0 -0
@@ -1,9 +0,0 @@
1
- import{t as S}from"./defineProperty-a20a667d.js";import{a as hn,i as y,n as _,r as $,t as s}from"./classPrivateFieldGet2-338e0179.js";import{g as gi,n as wi}from"./tool-host-contract-b93b482c.js";import{i as _i}from"./provider-4c704118.js";var Gr,Jr,qe,Et,Nt,ge,fe,At,Wt,Xt,ot,hr,Ft,dt,bt,je,he,E,mr,tt,Fe,at,te,G,et,K,rt,$t,It,Pt,ve,De,Be,Ct,vr,P,ht,mt,Z,Kt,Ae,Ie,dr,Tt,st;typeof window<"u"&&((Gr=(Jr=window).__svelte??(Jr.__svelte={})).v??(Gr.v=new Set)).add("5");var ne={},I=Symbol("uninitialized"),yi="http://www.w3.org/1999/xhtml",mi=Array.isArray,bi=Array.prototype.indexOf,br=Array.prototype.includes,$i=Array.from,Xe=Object.keys,me=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,ki=Object.getOwnPropertyDescriptors,Mi=Object.prototype,xi=Array.prototype,vn=Object.getPrototypeOf,Kr=Object.isExtensible,Si=()=>{};function Ci(t){for(var e=0;e<t.length;e++)t[e]()}function dn(){var t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}var nt=1024,ft=2048,Gt=4096,Er=8192,Ti=16384,Pr=32768,Ur=1<<25,Or=65536,oe=1<<19,Wi=1<<20,Xr=1<<21,Ei=1<<22,Ye=1<<23,we=Symbol("$state"),pn=Symbol("component"),gn=Symbol("legacy props"),Pi=Symbol(""),$r=Symbol("attributes"),Oi=Symbol("class"),ji=Symbol("style"),He=Symbol("text"),Me=new class extends Error{constructor(...t){super(...t),S(this,"name","StaleReactionError"),S(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Ai=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Ii(){console.warn("https://svelte.dev/e/derived_inert")}function lr(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ni(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var O=!1;function Zt(t){O=t}var T;function wt(t){if(t===null)throw lr(),ne;return T=t}function jr(){return wt(Ot(T))}function ee(t){if(O){if(Ot(T)!==null)throw lr(),ne;T=t}}function zi(t=1){if(O){for(var e=t,r=T;e--;)r=Ot(r);T=r}}function wn(t=!0){for(var e=0,r=T;;){if(r.nodeType===8){var n=r.data;if(n==="]"){if(e===0)return r;e-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=Ot(r);t&&r.remove(),r=i}}function Li(t){if(!t||t.nodeType!==8)throw lr(),ne;return t.data}function _n(t){return t===this.v}function Ri(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function yn(t){return!Ri(t,this.v)}function qi(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Fi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Di(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Bi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Hi(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Vi(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Gi(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ji(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ki(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ui(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Xi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Yi(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var sr=!1,or=!1,j=null;function ie(t){j=t}function Ar(t,e=!1,r){j={p:j,i:!1,c:null,e:null,s:t,x:null,r:m,l:or&&!e?{s:null,u:null,$:[]}:null}}function Ir(t){var e=j,r=e.e;if(r!==null){e.e=null;for(var n of r)zn(n)}return t!==void 0&&(e.x=t),e.i=!0,j=e.p,Nr(t)}function Nr(t={}){return me(t,pn,{value:!0}),t}function xe(){return!or||j!==null&&j.l===null}var Lt=[];function mn(){var t=Lt;Lt=[],Ci(t)}function Ht(t){if(Lt.length===0&&!_e){var e=Lt;queueMicrotask(()=>{e===Lt&&mn()})}Lt.push(t)}function Zi(){for(;Lt.length>0;)mn()}var Qi=~(ft|Gt|nt);function A(t,e){t.f=t.f&Qi|e}function zr(t){(t.f&512)!==0||t.deps===null?A(t,nt):A(t,Gt)}function bn(t,e,r){(t.f&2048)!==0?e.add(t):t.f&4096&&r.add(t),A(t,nt)}function ar(t){var e=k,r=m;it(null),_t(null);try{return t()}finally{it(e),_t(r)}}function tl(t,e,r,n){const i=xe()?be:kn;var l=t.filter(h=>!h.settled),o=e.map(i);if(r.length===0&&l.length===0){n(o);return}var a=m,u=el(),c=l.length===1?l[0].promise:l.length>1?Promise.all(l.map(h=>h.promise)):null;function f(h){if((a.f&16384)===0){u();try{n([...o,...h])}catch(v){gt(v,a)}Ze()}}var d=$n();if(r.length===0){c.then(()=>f([])).finally(d);return}function p(){Promise.all(r.map(h=>rl(h))).then(f).catch(h=>gt(h,a)).finally(d)}c?c.then(()=>{u(),p(),Ze()}):p()}function el(){var t=m,e=k,r=j,n=b;return function(i=!0){_t(t),it(e),ie(r),i&&!(t.f&16384)&&(n?.activate(),n?.apply())}}function Ze(t=!0){_t(null),it(null),ie(null),t&&b?.deactivate()}function $n(){var t=m,e=t.b,r=b,n=!!e?.is_rendered();return e?.update_pending_count(1,r),r.increment(n,t),()=>{e?.update_pending_count(-1,r),r.decrement(n,t)}}function be(t){var e=2|ft;return m!==null&&(m.f|=oe),{ctx:j,deps:null,effects:null,equals:_n,f:e,fn:t,reactions:null,rv:0,v:I,wv:0,parent:m,ac:null}}var pe=Symbol("obsolete");function rl(t,e,r){let n=m;n===null&&Fi();var i=void 0,l=Se(I),o=!k,a=new Set;return bl(()=>{var u=m,c=dn();i=c.promise;try{Promise.resolve(t()).then(c.resolve,h=>{h!==Me&&c.reject(h)}).finally(Ze)}catch(h){c.reject(h),Ze()}var f=b;if(o){if((u.f&32768)!==0)var d=$n();if(n.b?.is_rendered())f.async_deriveds.get(u)?.reject(pe);else for(const h of a.values())h.reject(pe);a.add(c),f.async_deriveds.set(u,c)}const p=(h,v=void 0)=>{d?.(),a.delete(c),v!==pe&&(f.activate(),v?(l.f|=Ye,nr(l,v)):(l.f&8388608&&(l.f^=Ye),nr(l,h)),f.deactivate())};c.promise.then(p,h=>p(null,h||"unknown"))}),_l(()=>{for(const u of a)u.reject(pe)}),new Promise(u=>{function c(f){function d(){f===i?u(l):c(i)}f.then(d,d)}c(i)})}function de(t){const e=be(t);return Vn(e),e}function kn(t){const e=be(t);return e.equals=yn,e}function nl(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)U(e[r])}}function Lr(t){var e,r=m,n=t.parent;if(!Mt&&n!==null&&t.v!==I&&(n.f&24576)!==0)return Ii(),t.v;_t(n);try{nl(t),e=Un(t)}finally{_t(r)}return e}function Mn(t){var e=Lr(t);if(!t.equals(e)&&(t.wv=Jn(),(!b?.is_fork||t.deps===null)&&(b!==null?(b.capture(t,e,!0),Mr?.capture(t,e,!0)):t.v=e,t.deps===null))){A(t,nt);return}Mt||(R!==null?(qr()||b?.is_fork)&&R.set(t,e):zr(t))}function il(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&ar(()=>{e.ac.abort(Me),e.ac=null}),e.fn!==null&&(e.teardown=Si),ke(e,0),Dr(e))}function xn(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&se(e)}var kr=null,Yt=null,b=null,Mr=null,R=null,xr=null,_e=!1,pr=!1,$e=null,Qe=null,Sn=0,ll=1,ae=(qe=new WeakMap,Et=new WeakMap,Nt=new WeakMap,ge=new WeakMap,fe=new WeakMap,At=new WeakMap,Wt=new WeakMap,Xt=new WeakMap,ot=new WeakMap,hr=new WeakMap,Ft=new WeakMap,dt=new WeakMap,bt=new WeakMap,je=new WeakMap,he=new WeakMap,E=new WeakSet,mr=class Cn{constructor(){hn(this,E),S(this,"id",ll++),y(this,qe,!1),S(this,"linked",!0),y(this,Et,null),y(this,Nt,null),S(this,"async_deriveds",new Map),S(this,"current",new Map),S(this,"previous",new Map),y(this,ge,new Set),y(this,fe,new Set),y(this,At,0),y(this,Wt,new Map),y(this,Xt,null),y(this,ot,[]),y(this,hr,[]),y(this,Ft,new Set),y(this,dt,new Set),y(this,bt,new Map),y(this,je,new Set),S(this,"is_fork",!1),y(this,he,!1),Yt===null?kr=Yt=this:(_(Nt,Yt,this),_(Et,this,Yt)),Yt=this}skip_effect(e){s(bt,this).has(e)||s(bt,this).set(e,{d:[],m:[]}),s(je,this).delete(e)}unskip_effect(e,r=n=>this.schedule(n)){var n=s(bt,this).get(e);if(n){s(bt,this).delete(e);for(var i of n.d)A(i,ft),r(i);for(i of n.m)A(i,Gt),r(i)}s(je,this).add(e)}capture(e,r,n=!1){e.v!==I&&!this.previous.has(e)&&this.previous.set(e,e.v),!(e.f&8388608)&&(this.current.set(e,[r,n]),R?.set(e,r)),this.is_fork||(e.v=r)}activate(){b=this}deactivate(){b=null,R=null}flush(){try{pr=!0,b=this,$(E,this,tr).call(this)}finally{Sn=0,xr=null,$e=null,Qe=null,pr=!1,b=null,R=null,pt.clear()}}discard(){for(const e of s(fe,this))e(this);s(fe,this).clear();for(const e of this.async_deriveds.values())e.reject(pe);$(E,this,er).call(this),s(Xt,this)?.resolve()}register_created_effect(e){s(hr,this).push(e)}increment(e,r){if(_(At,this,s(At,this)+1),e){let n=s(Wt,this).get(r)??0;s(Wt,this).set(r,n+1)}}decrement(e,r){if(_(At,this,s(At,this)-1),e){let n=s(Wt,this).get(r)??0;n===1?s(Wt,this).delete(r):s(Wt,this).set(r,n-1)}s(he,this)||(_(he,this,!0),Ht(()=>{_(he,this,!1),this.linked&&this.flush()}))}transfer_effects(e,r){for(const n of e)s(Ft,this).add(n);for(const n of r)s(dt,this).add(n);e.clear(),r.clear()}oncommit(e){s(ge,this).add(e)}ondiscard(e){s(fe,this).add(e)}settled(){return(s(Xt,this)??_(Xt,this,dn())).promise}static ensure(){if(b===null){const e=b=new Cn;!pr&&!_e&&Ht(()=>{s(qe,e)||e.flush()})}return b}apply(){if(!sr||!this.is_fork&&s(Et,this)===null&&s(Nt,this)===null){R=null;return}R=new Map;for(const[r,[n]]of this.current)R.set(r,n);for(let r=kr;r!==null;r=s(Nt,r))if(!(r===this||r.is_fork)){var e=!1;if(r.id<this.id){for(const[n,[,i]]of r.current)if(!i&&this.current.has(n)){e=!0;break}}if(!e)for(const[n,i]of r.previous)R.has(n)||R.set(n,i)}}schedule(e){if(xr=e,e.b?.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}s(ot,this).push(e)}},mr);function Yr(){if(this.is_fork)return!0;for(const r of s(Wt,this).keys()){for(var t=r,e=!1;t.parent!==null;){if(s(bt,this).has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}function sl(){var t=[];for(const i of s(ot,this))if(!((i.f&16384)!==0||(i.f&6144)===0)){for(var e=i,r=!1;e.parent!==null;){e=e.parent;var n=e.f;if((n&96)!==0){if((n&1024)===0){r=!0;break}e.f^=nt}}r||t.push(e)}return _(ot,this,[]),t}function tr(){_(qe,this,!0);for(const o of s(Ft,this))s(dt,this).delete(o),A(o,ft),this.schedule(o);for(const o of s(dt,this))A(o,Gt),this.schedule(o);this.apply();for(var t=$e=[],e=[],r=Qe=[];s(ot,this).length>0;){Sn++>1e3&&($(E,this,er).call(this),cl());for(const o of $(E,this,sl).call(this))try{$(E,this,ol).call(this,o,t,e)}catch(a){throw En(o),$(E,this,Yr).call(this)||this.discard(),a}}if(b=null,r.length>0){var n=mr.ensure();for(const o of r)n.schedule(o)}if($e=null,Qe=null,$(E,this,Yr).call(this)){$(E,this,Ne).call(this,e),$(E,this,Ne).call(this,t);for(const[o,a]of s(bt,this))Wn(o,a);r.length>0&&$(E,b,tr).call(b);return}const i=$(E,this,al).call(this);if(i){$(E,this,Ne).call(this,e),$(E,this,Ne).call(this,t),$(E,i,ul).call(i,this);return}s(Ft,this).clear(),s(dt,this).clear();for(const o of s(ge,this))o(this);s(ge,this).clear(),Mr=this,Zr(e),Zr(t),Mr=null,s(Xt,this)?.resolve();var l=b;if(s(At,this)===0&&(s(ot,this).length===0||l!==null)&&$(E,this,er).call(this),s(ot,this).length>0)if(l!==null){for(const o of s(ot,this))s(ot,l).push(o);_(ot,this,[])}else l=this;l!==null&&(pt.clear(),$(E,l,tr).call(l))}function ol(t,e,r){t.f^=nt;for(var n=t.first;n!==null;){var i=n.f,l=(i&96)!==0;if(!(l&&(i&1024)!==0||(i&8192)!==0||s(bt,this).has(n))&&n.fn!==null){l?n.f^=nt:(i&4)!==0?e.push(n):sr&&(i&16777224)!==0?r.push(n):Te(n)&&(i&16&&s(dt,this).add(n),se(n));var o=n.first;if(o!==null){n=o;continue}}for(;n!==null;){var a=n.next;if(a!==null){n=a;break}n=n.parent}}}function al(){for(var t=s(Et,this);t!==null;){if(!t.is_fork){for(const[e,[,r]]of this.current)if(t.current.has(e)&&!r)return t}t=s(Et,t)}return null}function ul(t){for(const[r,n]of t.current)!this.previous.has(r)&&t.previous.has(r)&&this.previous.set(r,t.previous.get(r)),this.current.set(r,n);for(const[r,n]of t.async_deriveds){const i=this.async_deriveds.get(r);i&&n.promise.then(i.resolve).catch(i.reject)}t.async_deriveds.clear(),this.transfer_effects(s(Ft,t),s(dt,t));const e=r=>{var n=r.reactions;if(n!==null&&!((r.f&2)!==0&&(r.f&6144)===0))for(const o of n){var i=o.f;if((i&2)!==0)e(o);else{var l=o;i&4194320&&!this.async_deriveds.has(l)&&(s(dt,this).delete(l),A(l,ft),this.schedule(l))}}};for(const r of this.current.keys())e(r);this.oncommit(()=>t.discard()),$(E,t,er).call(t),b=this,$(E,this,tr).call(this)}function Ne(t){for(var e=0;e<t.length;e+=1)bn(t[e],s(Ft,this),s(dt,this))}function er(){if(this.linked){var t=s(Et,this),e=s(Nt,this);t===null?kr=e:_(Nt,t,e),e===null?Yt=t:_(Et,e,t),this.linked=!1}}function F(t){var e=_e;_e=!0;try{var r;for(t&&(b!==null&&!b.is_fork&&b.flush(),r=t());;){if(Zi(),b===null)return r;b.flush()}}finally{_e=e}}function cl(){try{Vi()}catch(t){gt(t,xr)}}var vt=null;function Zr(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&24576)===0&&Te(n)&&(vt=new Set,se(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&Fn(n),vt?.size>0)){pt.clear();for(const i of vt){if((i.f&24576)!==0)continue;const l=[i];let o=i.parent;for(;o!==null;)vt.has(o)&&(vt.delete(o),l.push(o)),o=o.parent;for(let a=l.length-1;a>=0;a--){const u=l[a];!(u.f&24576)&&se(u)}}vt.clear()}}vt=null}}function Tn(t){b.schedule(t)}function Wn(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),A(t,nt);for(var r=t.first;r!==null;)Wn(r,e),r=r.next}}function En(t){A(t,nt);for(var e=t.first;e!==null;)En(e),e=e.next}var rr=new Set,pt=new Map,Pn=!1;function Se(t,e){return{f:0,v:t,reactions:null,equals:_n,rv:0,wv:0}}function q(t,e){const r=Se(t,e);return Vn(r),r}function fl(t,e=!1,r=!0){const n=Se(t);return e||(n.equals=yn),n}function x(t,e,r=!1){return k!==null&&(!ut||k.f&131072)&&xe()&&k.f&4325394&&(ct===null||!ct.has(t))&&Xi(),nr(t,r?Qt(e):e,Qe)}var zt=null,Sr=0;function nr(t,e,r=null){if(!t.equals(e)){Mt?pt.set(t,e):pt.has(t)||pt.set(t,t.v);var n=ae.ensure();if(n.capture(t,e),(t.f&2)!==0){const i=t;t.f&2048&&Lr(i),R===null&&zr(i)}t.wv=Jn(),zt=null,Sr=0,On(t,ft,r),zt=null,xe()&&m!==null&&m.f&1024&&!(m.f&96)&&(Q===null?xl([t]):Q.push(t)),!n.is_fork&&rr.size>0&&!Pn&&hl()}return e}function hl(){Pn=!1;for(const t of rr){t.f&1024&&A(t,Gt);let e;try{e=Te(t)}catch{e=!0}e&&se(t)}rr.clear()}function ye(t){x(t,t.v+1)}function On(t,e,r){var n=t.reactions;if(n!==null){var i=xe(),l=n.length;if(Sr+=l,Sr>1e5&&zt===null&&(zt=new Set),zt!==null){if(zt.has(t))return;zt.add(t)}for(var o=0;o<l;o++){var a=n[o],u=a.f;if(!(!i&&a===m)){var c=(u&ft)===0;if(c&&A(a,e),(u&131072)!==0)rr.add(a);else if((u&2)!==0){var f=a;R?.delete(f),On(f,Gt,r)}else if(c){var d=a;u&16&&vt!==null&&vt.add(d),r!==null?r.push(d):Tn(d)}}}}}function Qt(t){if(typeof t!="object"||t===null||we in t||pn in t)return t;const e=vn(t);if(e!==Mi&&e!==xi)return t;var r=new Map,n=mi(t),i=q(0),l=null,o=Bt,a=u=>{if(Bt===o)return u();var c=k,f=Bt;it(null),nn(o);var d=u();return it(c),nn(f),d};return n&&r.set("length",q(t.length,l)),new Proxy(t,{defineProperty(u,c,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Ki();var d=r.get(c);return d===void 0?a(()=>{var p=q(f.value,l);return r.set(c,p),p}):x(d,f.value,!0),!0},deleteProperty(u,c){var f=r.get(c);if(f===void 0){if(c in u){const d=a(()=>q(I,l));r.set(c,d),ye(i)}}else x(f,I),ye(i);return!0},get(u,c,f){if(c===we)return t;var d=r.get(c),p=c in u;if(d===void 0&&(!p||Dt(u,c)?.writable)&&(d=a(()=>q(Qt(p?u[c]:I),l)),r.set(c,d)),d!==void 0){var h=g(d);return h===I?void 0:h}return Reflect.get(u,c,f)},getOwnPropertyDescriptor(u,c){this.has?.(u,c);var f=Reflect.getOwnPropertyDescriptor(u,c),d=r.get(c);if(d!==void 0){var p=g(d);if(p===I)return;if(f&&"value"in f)f.value=p;else return{enumerable:!0,configurable:!0,value:p,writable:!0}}return f},has(u,c){if(c===we)return!0;var f=r.get(c),d=f!==void 0&&f.v!==I||Reflect.has(u,c);return(f!==void 0||m!==null&&(!d||Dt(u,c)?.writable))&&(f===void 0&&(f=a(()=>q(d?Qt(u[c]):I,l)),r.set(c,f)),g(f)===I)?!1:d},set(u,c,f,d){var p=r.get(c),h=c in u;if(n&&c==="length")for(var v=f;v<p.v;v+=1){var M=r.get(v+"");M!==void 0?x(M,I):v in u&&(M=a(()=>q(I,l)),r.set(v+"",M))}if(p===void 0)(!h||Dt(u,c)?.writable)&&(p=a(()=>q(void 0,l)),x(p,Qt(f)),r.set(c,p));else{h=p.v!==I;var D=a(()=>Qt(f));x(p,D)}var z=Reflect.getOwnPropertyDescriptor(u,c);if(z?.set&&z.set.call(d,f),!h){if(n&&typeof c=="string"){var B=r.get("length"),H=Number(c);Number.isInteger(H)&&H>=B.v&&x(B,H+1)}ye(i)}return!0},ownKeys(u){g(i);var c=Reflect.ownKeys(u).filter(p=>{var h=r.get(p);return h===void 0||h.v!==I});for(var[f,d]of r)d.v!==I&&!(f in u)&&c.push(f);return c},setPrototypeOf(){Ui()}})}var Qr,jn,An,In;function Cr(){if(Qr===void 0){Qr=window,jn=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;An=Dt(e,"firstChild").get,In=Dt(e,"nextSibling").get,Kr(t)&&(t[Oi]=void 0,t[$r]=null,t[ji]=void 0,t.__e=void 0),Kr(r)&&(r[He]=void 0)}}function Vt(t=""){return document.createTextNode(t)}function le(t){return An.call(t)}function Ot(t){return In.call(t)}function re(t,e){if(!O)return le(t);var r=le(T);if(r===null)r=T.appendChild(Vt());else if(e&&r.nodeType!==3){var n=Vt();return r?.before(n),wt(n),n}return e&&Nn(r),wt(r),r}function tn(t,e=!1){if(!O)return le(t);var r=re(t,e);return ee(t),r}function Ve(t,e=1,r=!1){let n=O?T:t;for(var i;e--;)i=n,n=Ot(n);if(!O)return n;if(r){if(n?.nodeType!==3){var l=Vt();return n===null?i?.after(l):n.before(l),wt(l),l}Nn(n)}return wt(n),n}function vl(t){t.textContent=""}function dl(){return!sr||vt!==null?!1:(m.f&Pr)!==0}function Rr(t,e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?r?document.createElement(t,{is:r}):document.createElement(t):r?document.createElementNS(e,t,{is:r}):document.createElementNS(e,t)}function Nn(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 pl(t){var e=m;if(e===null)return k.f|=Ye,t;if((e.f&32768)===0&&(e.f&4)===0)throw t;gt(t,e)}function gt(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(r){t=r}}e=e.parent}throw t}}function gl(t){m===null&&(k===null&&Hi(t),Bi()),Mt&&Di(t)}function wl(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function yt(t,e){var r=m;r!==null&&r.f&8192&&(t|=Er);var n={ctx:j,deps:null,nodes:null,f:t|ft|512,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};b?.register_created_effect(n);var i=n;if((t&4)!==0)$e!==null?$e.push(n):ae.ensure().schedule(n);else if(e!==null){try{se(n)}catch(o){throw U(n),o}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|=Or))}if(i!==null&&(i.parent=r,r!==null&&wl(i,r),k!==null&&(k.f&2)!==0&&(t&64)===0)){var l=k;(l.effects??(l.effects=[])).push(i)}return n}function qr(){return k!==null&&!ut}function _l(t){const e=yt(8,null);return A(e,nt),e.teardown=t,e}function Tr(t){gl("$effect");var e=m.f;if(!k&&(e&32)!==0&&j!==null&&!j.i){var r=j;(r.e??(r.e=[])).push(t)}else return zn(t)}function zn(t){return yt(4|Wi,t)}function yl(t){ae.ensure();const e=yt(64|oe,t);return()=>{U(e)}}function ml(t){ae.ensure();const e=yt(64|oe,t);return(r={})=>new Promise(n=>{r.outro?Ce(e,()=>{U(e),n(void 0)}):(U(e),n(void 0))})}function Ln(t){return yt(4,t)}function bl(t){return yt(Ei|oe,t)}function Fr(t,e=0){return yt(8|e,t)}function gr(t,e=[],r=[],n=[]){tl(n,e,r,i=>{yt(8,()=>{t(...i.map(g))})})}function Rn(t,e=0){return yt(16|e,t)}function kt(t){return yt(32|oe,t)}function qn(t){var e=t.teardown;if(e!==null){const r=Mt,n=k;rn(!0),it(null);try{e.call(null)}catch(i){gt(i,t.parent)}finally{rn(r),it(n)}}}function Dr(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&ar(()=>{i.abort(Me)});var n=r.next;(r.f&64)!==0?r.parent=null:U(r,e),r=n}}function $l(t){for(var e=t.first;e!==null;){var r=e.next;!(e.f&32)&&U(e),e=r}}function U(t,e=!0){var r=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(kl(t.nodes.start,t.nodes.end),r=!0),t.f|=Ur,Dr(t,e&&!r),ke(t,0);var n=t.nodes&&t.nodes.t;if(n!==null)for(const l of n)l.stop();qn(t),t.f^=Ur,t.f|=Ti;var i=t.parent;i!==null&&i.first!==null&&Fn(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function kl(t,e){for(;t!==null;){var r=t===e?null:Ot(t);t.remove(),t=r}}function Fn(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Ce(t,e,r=!0){var n=[];t.f|=256,Dn(t,n,!0);var i=()=>{r&&U(t),e&&e()},l=n.length;if(l>0){var o=()=>--l||i();for(var a of n)a.out(o)}else i()}function Dn(t,e,r){if((t.f&8192)===0){t.f^=Er;var n=t.nodes&&t.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var l=i.next;if((i.f&64)===0){var o=(i.f&65536)!==0||(i.f&32)!==0&&(t.f&16)!==0;Dn(i,e,o?r:!1)}i=l}}}function en(t){t.f&=-257,Bn(t,!0)}function Bn(t,e){if((t.f&256)===0&&(t.f&8192)!==0){t.f^=Er,!(t.f&1024)&&(A(t,ft),ae.ensure().schedule(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;Bn(r,i?e:!1),r=n}var l=t.nodes&&t.nodes.t;if(l!==null)for(const o of l)(o.is_global||e)&&o.in()}}function Hn(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var i=r===n?null:Ot(r);e.append(r),r=i}}var Ml=null,Ge=!1,Mt=!1;function rn(t){Mt=t}var k=null,ut=!1;function it(t){k=t}var m=null;function _t(t){m=t}var ct=null;function Vn(t){k!==null&&(k.f&2097152||k.f&2)&&(ct??(ct=new Set)).add(t)}var J=null,X=0,Q=null;function xl(t){Q=t}var Gn=1,Rt=0,Bt=Rt;function nn(t){Bt=t}function Jn(){return++Gn}function Te(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var r=t.deps,n=r.length,i=0;i<n;i++){var l=r[i];if(Te(l)&&Mn(l),l.wv>t.wv)return!0}e&512&&R===null&&A(t,nt)}return!1}function Kn(t,e,r=!0){var n=t.reactions;if(n!==null&&!(!sr&&ct!==null&&ct.has(t)))for(var i=0;i<n.length;i++){var l=n[i];(l.f&2)!==0?Kn(l,e,!1):e===l&&(r?A(l,ft):l.f&1024&&A(l,Gt),Tn(l))}}function Un(t){var e=J,r=X,n=Q,i=k,l=ct,o=j,a=ut,u=Bt,c=t.f;J=null,X=0,Q=null,k=(c&96)===0?t:null,ct=null,ie(t.ctx),ut=!1,Bt=++Rt,t.ac!==null&&(ar(()=>{t.ac.abort(Me)}),t.ac=null);try{t.f|=Xr;var f=t.fn,d=f();t.f|=Pr;var p=ln(t);if(xe()&&Q!==null&&!ut&&p!==null&&(t.f&6146)===0)for(var h=0;h<Q.length;h++)Kn(Q[h],t);if(i!==null&&i!==t){if(Rt++,i.deps!==null)for(let v=0;v<r;v+=1)i.deps[v].rv=Rt;if(e!==null)for(const v of e)v.rv=Rt;Q!==null&&(n===null?n=Q:n.push(...Q))}return t.f&8388608&&(t.f^=Ye),d}catch(v){return ln(t),pl(v)}finally{t.f^=Xr,J=e,X=r,Q=n,k=i,ct=l,ie(o),ut=a,Bt=u}}function ln(t){var e=t.deps,r=b?.is_fork;if(J!==null){var n,i;if(r||ke(t,X),e!==null&&X>0)for(e.length=X+J.length,i=0;i<J.length;i++)e[X+i]=J[i];else t.deps=e=J;if(qr()&&(t.f&512)!==0)for(i=X;i<e.length;i++)((n=e[i]).reactions??(n.reactions=[])).push(t)}else!r&&e!==null&&X<e.length&&(ke(t,X),e.length=X);return e}function Sl(t,e){let r=e.reactions;if(r!==null){var n=bi.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(e.f&2)!==0&&(J===null||!br.call(J,e))){var l=e;l.f&512&&(l.f^=512),l.v!==I&&zr(l),l.ac!==null&&ar(()=>{l.ac.abort(Me),l.ac=null,A(l,ft)}),il(l),ke(l,0)}}function ke(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Sl(t,r[n])}function se(t){var e=t.f;if((e&16384)===0){A(t,nt);var r=m,n=Ge;m=t,Ge=(e&96)===0;try{(e&16777232)!==0?$l(t):Dr(t),qn(t);var i=Un(t);t.teardown=typeof i=="function"?i:null,t.wv=Gn}finally{Ge=n,m=r}}}function g(t){var e=(t.f&2)!==0;if(Ml?.add(t),k!==null&&!ut&&!(m!==null&&(m.f&16384)!==0)&&(ct===null||!ct.has(t))){var r=k.deps;if((k.f&2097152)!==0)t.rv<Rt&&(t.rv=Rt,J===null&&r!==null&&r[X]===t?X++:J===null?J=[t]:J.push(t));else{var n;(n=k).deps??(n.deps=[]),br.call(k.deps,t)||k.deps.push(t);var i=t.reactions;i===null?t.reactions=[k]:br.call(i,k)||i.push(k)}}if(Mt&&pt.has(t))return pt.get(t);if(e){var l=t;if(Mt){var o=l.v;return(!(l.f&1024)&&l.reactions!==null||Yn(l))&&(o=Lr(l)),pt.set(l,o),o}var a=(l.f&512)===0&&!ut&&k!==null&&(Ge||(k.f&512)!==0),u=(l.f&Pr)===0;Te(l)&&(a&&(l.f|=512),Mn(l)),a&&!u&&(xn(l),Xn(l))}if(R?.has(t))return R.get(t);if((t.f&8388608)!==0)throw t.v;return t.v}function Xn(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)&&(xn(e),Xn(e))}function Yn(t){if(t.v===I)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(pt.has(e)||(e.f&2)!==0&&Yn(e))return!0;return!1}function We(t){var e=ut;try{return ut=!0,t()}finally{ut=e}}var ze=Symbol("events"),Cl=new Set,sn=new Set,wr=null,_r=!1;function on(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],l=i[0]||t.target;wr=t,_r||(_r=!0,setTimeout(()=>{_r=!1,wr=null}));var o=0,a=wr===t&&t[ze];if(a){var u=i.indexOf(a);if(u!==-1&&(e===document||e===window)){t[ze]=e;return}var c=i.indexOf(e);if(c===-1)return;u<=c&&(o=u)}if(l=i[o]||t.target,l!==e){me(t,"currentTarget",{configurable:!0,get(){return l||r}});var f=k,d=m;it(null),_t(null);try{for(var p,h=[];l!==null&&l!==e;){try{var v=l[ze]?.[n];v!=null&&(!l.disabled||t.target===l)&&v.call(l,t)}catch(M){p?h.push(M):p=M}if(t.cancelBubble)break;o++,l=o<i.length?i[o]:null}if(p){for(let M of h)queueMicrotask(()=>{throw M});throw p}}finally{t[ze]=e,delete t.currentTarget,it(f),_t(d)}}}var Tl=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Wl(t){return Tl?.createHTML(t)??t}function El(t){var e=Rr("template");return e.innerHTML=Wl(t.replaceAll("<!>","<!---->")),e.content}function Je(t,e){var r=m;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function ue(t,e){var r=(e&1)!==0,n=(e&2)!==0,i,l=!t.startsWith("<!>");return()=>{if(O)return Je(T,null),T;i===void 0&&(i=El(l?t:"<!>"+t),r||(i=le(i)));var o=n||jn?document.importNode(i,!0):i.cloneNode(!0);if(r){var a=le(o),u=o.lastChild;Je(a,u)}else Je(o,o);return o}}function qt(t,e){if(O){var r=m;(!(r.f&32768)||r.nodes.end===null)&&(r.nodes.end=T),jr();return}t!==null&&t.before(e)}var Pl=["touchstart","touchmove"];function Ol(t){return Pl.includes(t)}function jl(t){let e=0,r=Se(0),n;return()=>{qr()&&(g(r),Fr(()=>(e===0&&(n=We(()=>t(()=>ye(r)))),e+=1,()=>{Ht(()=>{e-=1,e===0&&(n?.(),n=void 0,ye(r))})})))}}var Al=Or|oe;function Il(t,e,r,n){new Nl(t,e,r,n)}var Nl=(tt=new WeakMap,Fe=new WeakMap,at=new WeakMap,te=new WeakMap,G=new WeakMap,et=new WeakMap,K=new WeakMap,rt=new WeakMap,$t=new WeakMap,It=new WeakMap,Pt=new WeakMap,ve=new WeakMap,De=new WeakMap,Be=new WeakMap,Ct=new WeakMap,vr=new WeakMap,P=new WeakSet,class{constructor(t,e,r,n){hn(this,P),S(this,"parent",void 0),S(this,"is_pending",!1),S(this,"transform_error",void 0),y(this,tt,void 0),y(this,Fe,O?T:null),y(this,at,void 0),y(this,te,void 0),y(this,G,void 0),y(this,et,null),y(this,K,null),y(this,rt,null),y(this,$t,null),y(this,It,0),y(this,Pt,0),y(this,ve,!1),y(this,De,new Set),y(this,Be,new Set),y(this,Ct,null),y(this,vr,jl(()=>(_(Ct,this,Se(s(It,this))),()=>{_(Ct,this,null)}))),_(tt,this,t),_(at,this,e),_(te,this,i=>{var l=m;l.b=this,l.f|=128,r(i)}),this.parent=m.b,this.transform_error=n??this.parent?.transform_error??(i=>i),_(G,this,Rn(()=>{if(O){const i=s(Fe,this);jr();const l=i.data==="[!";if(i.data.startsWith("[?")){const o=JSON.parse(i.data.slice(2));$(P,this,Ll).call(this,o)}else l?$(P,this,Rl).call(this):$(P,this,zl).call(this)}else $(P,this,Qn).call(this)},Al)),O&&_(tt,this,T)}defer_effect(t){bn(t,s(De,this),s(Be,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!s(at,this).pending}update_pending_count(t,e){$(P,this,ti).call(this,t,e),_(It,this,s(It,this)+t),s(Ct,this)&&!s(ve,this)&&(_(ve,this,!0),Ht(()=>{_(ve,this,!1),s(Ct,this)&&nr(s(Ct,this),s(It,this))}))}get_effect_pending(){return s(vr,this).call(this),g(s(Ct,this))}error(t){if(!s(at,this).onerror&&!s(at,this).failed)throw t;b?.is_fork?(s(et,this)&&b.skip_effect(s(et,this)),s(K,this)&&b.skip_effect(s(K,this)),s(rt,this)&&b.skip_effect(s(rt,this)),b.oncommit(()=>{$(P,this,an).call(this,t)})):$(P,this,an).call(this,t)}});function zl(){try{_(et,this,kt(()=>s(te,this).call(this,s(tt,this))))}catch(t){this.error(t)}}function Ll(t){const e=s(at,this).failed,{reset:r,invoke_onerror:n}=$(P,this,Zn).call(this,t);Ht(n),e&&_(rt,this,kt(()=>{e(s(tt,this),()=>t,()=>r)}))}function Zn(t){var e=!1,r=!1;const n=()=>{if(e){Ni();return}e=!0,r&&Yi(),s(rt,this)!==null&&Ce(s(rt,this),()=>{_(rt,this,null)}),$(P,this,Br).call(this,()=>{$(P,this,Qn).call(this)})};return{reset:n,invoke_onerror:()=>{try{r=!0,s(at,this).onerror?.(t,n),r=!1}catch(i){gt(i,s(G,this)&&s(G,this).parent)}}}}function Rl(){const t=s(at,this).pending;t&&(this.is_pending=!0,_(K,this,kt(()=>t(s(tt,this)))),Ht(()=>{var e=_($t,this,document.createDocumentFragment()),r=Vt(),n=!1;if(e.append(r),_(et,this,$(P,this,Br).call(this,()=>{try{return kt(()=>s(te,this).call(this,r))}catch(i){try{this.error(i),n=!0}catch(l){gt(l,s(G,this).parent)}return null}})),s(et,this)===null){_($t,this,null),n&&$(P,this,ir).call(this,b);return}s(Pt,this)===0&&(s(tt,this).before(e),_($t,this,null),Ce(s(K,this),()=>{_(K,this,null)}),$(P,this,ir).call(this,b))}))}function Qn(){try{if(this.is_pending=this.has_pending_snippet(),_(Pt,this,0),_(It,this,0),_(et,this,kt(()=>{s(te,this).call(this,s(tt,this))})),s(Pt,this)>0){var t=_($t,this,document.createDocumentFragment());Hn(s(et,this),t);const e=s(at,this).pending;_(K,this,kt(()=>e(s(tt,this))))}else $(P,this,ir).call(this,b)}catch(e){this.error(e)}}function ir(t){this.is_pending=!1,t.transfer_effects(s(De,this),s(Be,this))}function Br(t){var e=m,r=k,n=j;_t(s(G,this)),it(s(G,this)),ie(s(G,this).ctx);try{return ae.ensure(),t()}finally{_t(e),it(r),ie(n)}}function ti(t,e){if(!this.has_pending_snippet()){var r;this.parent&&$(P,r=this.parent,ti).call(r,t,e);return}_(Pt,this,s(Pt,this)+t),s(Pt,this)===0&&($(P,this,ir).call(this,e),s(K,this)&&Ce(s(K,this),()=>{_(K,this,null)}),s($t,this)&&(s(tt,this).before(s($t,this)),_($t,this,null)))}function an(t){s(et,this)&&(U(s(et,this)),_(et,this,null)),s(K,this)&&(U(s(K,this)),_(K,this,null)),s(rt,this)&&(U(s(rt,this)),_(rt,this,null)),O&&(wt(s(Fe,this)),zi(),wt(wn()));let e=s(at,this).failed;const r=n=>{const{reset:i,invoke_onerror:l}=$(P,this,Zn).call(this,n);l(),e&&_(rt,this,$(P,this,Br).call(this,()=>{try{return kt(()=>{var o=m;o.b=this,o.f|=128,e(s(tt,this),()=>n,()=>i)})}catch(o){return gt(o,s(G,this).parent),null}}))};Ht(()=>{var n;try{n=this.transform_error(t)}catch(i){gt(i,s(G,this)&&s(G,this).parent);return}n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(r,i=>gt(i,s(G,this)&&s(G,this).parent)):r(n)})}function un(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t[He]??(t[He]=t.nodeValue))&&(t[He]=r,t.nodeValue=`${r}`)}function ei(t,e){return ri(t,e)}function ql(t,e){Cr(),e.intro=e.intro??!1;const r=e.target,n=O,i=T;try{for(var l=le(r);l&&(l.nodeType!==8||l.data!=="[");)l=Ot(l);if(!l)throw ne;Zt(!0),wt(l);const o=ri(t,{...e,anchor:l});return Zt(!1),o}catch(o){if(o instanceof Error&&o.message.split(`
2
- `).some(a=>a.startsWith("https://svelte.dev/e/")))throw o;return o!==ne&&console.warn("Failed to hydrate: ",o),e.recover===!1&&Gi(),Cr(),vl(r),Zt(!1),ei(t,e)}finally{Zt(n),wt(i)}}var Le=new Map;function ri(t,{target:e,anchor:r,props:n={},events:i,context:l,intro:o=!0,transformError:a}){Cr();var u=void 0,c=ml(()=>{var f=r??e.appendChild(Vt());Il(f,{pending:()=>{}},h=>{Ar({});var v=j;if(l&&(v.c=l),i&&(n.$$events=i),O&&Je(h,null),u=t(h,n)||Nr(),O&&(m.nodes.end=T,T===null||T.nodeType!==8||T.data!=="]"))throw lr(),ne;Ir()},a);var d=new Set,p=h=>{for(var v=0;v<h.length;v++){var M=h[v];if(!d.has(M)){d.add(M);var D=Ol(M);for(const H of[e,document]){var z=Le.get(H);z===void 0&&(z=new Map,Le.set(H,z));var B=z.get(M);B===void 0?(H.addEventListener(M,on,{passive:D}),z.set(M,1)):z.set(M,B+1)}}}};return p($i(Cl)),sn.add(p),()=>{for(var h of d)for(const D of[e,document]){var v=Le.get(D),M=v.get(h);--M==0?(D.removeEventListener(h,on),v.delete(h),v.size===0&&Le.delete(D)):v.set(h,M)}sn.delete(p),f!==r&&f.parentNode?.removeChild(f)}});return Wr.set(u,c),u}var Wr=new WeakMap;function Fl(t,e){const r=Wr.get(t);return r?(Wr.delete(t),r(e)):Promise.resolve()}var Dl=(ht=new WeakMap,mt=new WeakMap,Z=new WeakMap,Kt=new WeakMap,Ae=new WeakMap,Ie=new WeakMap,dr=new WeakMap,class{constructor(t,e=!0){S(this,"anchor",void 0),y(this,ht,new Map),y(this,mt,new Map),y(this,Z,new Map),y(this,Kt,new Set),y(this,Ae,!0),y(this,Ie,r=>{if(s(ht,this).has(r)){var n=s(ht,this).get(r),i=s(mt,this).get(n);if(i)en(i),s(Kt,this).delete(n);else{var l=s(Z,this).get(n);l&&(en(l.effect),s(mt,this).set(n,l.effect),s(Z,this).delete(n),l.fragment.lastChild.remove(),this.anchor.before(l.fragment),i=l.effect)}for(const[o,a]of s(ht,this)){if(s(ht,this).delete(o),o===r)break;const u=s(Z,this).get(a);u&&(U(u.effect),s(Z,this).delete(a))}for(const[o,a]of s(mt,this)){if(o===n||s(Kt,this).has(o))continue;const u=()=>{if(Array.from(s(ht,this).values()).includes(o)){var c=document.createDocumentFragment();Hn(a,c),c.append(Vt()),s(Z,this).set(o,{effect:a,fragment:c})}else U(a);s(Kt,this).delete(o),s(mt,this).delete(o)};s(Ae,this)||!i?(s(Kt,this).add(o),Ce(a,u,!1)):u()}}}),y(this,dr,r=>{s(ht,this).delete(r);const n=Array.from(s(ht,this).values());for(const[i,l]of s(Z,this))n.includes(i)||(U(l.effect),s(Z,this).delete(i))}),this.anchor=t,_(Ae,this,e)}ensure(t,e){var r=b,n=dl();if(e&&!s(mt,this).has(t)&&!s(Z,this).has(t))if(n){var i=document.createDocumentFragment(),l=Vt();i.append(l),s(Z,this).set(t,{effect:kt(()=>e(l)),fragment:i})}else s(mt,this).set(t,kt(()=>e(this.anchor)));if(s(ht,this).set(r,t),n){for(const[o,a]of s(mt,this))o===t?r.unskip_effect(a):r.skip_effect(a);for(const[o,a]of s(Z,this))o===t?r.unskip_effect(a.effect):r.skip_effect(a.effect);r.oncommit(s(Ie,this)),r.ondiscard(s(dr,this))}else O&&(this.anchor=T),s(Ie,this).call(this,r)}});function Bl(t){j===null&&qi("onMount"),or&&j.l!==null?Hl(j).m.push(t):Tr(()=>{const e=We(t);if(typeof e=="function")return e})}function Hl(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function Ke(t,e,r=!1){var n;O&&(n=T,jr());var i=new Dl(t),l=r?Or:0;function o(a,u){if(O){var c=Li(n);if(a!==parseInt(c.substring(1))){var f=wn();wt(f),i.anchor=f,Zt(!1),i.ensure(a,u),Zt(!0);return}}i.ensure(a,u)}Rn(()=>{var a=!1;e((u,c=0)=>{a=!0,o(c,u)}),a||o(-1,null)},l)}function ni(t,e){Ln(()=>{t=m?.parent?.nodes?.start??t;var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=Rr("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}var Vl=Symbol("is custom element"),Gl=Symbol("is html"),Jl=Ai?"link":"LINK";function Ut(t,e,r,n){var i=Kl(t);O&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===Jl)||i[e]!==(i[e]=r)&&(e==="loading"&&(t[Pi]=r),r==null?t.removeAttribute(e):typeof r!="string"&&Ul(t).has(e)?t[e]=r:t.setAttribute(e,r))}function Kl(t){return t[$r]??(t[$r]={[Vl]:t.nodeName.includes("-"),[Gl]:t.namespaceURI===yi})}var cn=new Map;function Ul(t){var e=t.getAttribute("is")||t.nodeName,r=cn.get(e);if(r)return r;cn.set(e,r=new Set);for(var n,i=t,l=Element.prototype;l!==i;){n=ki(i);for(var o in n)n[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&r.add(o);i=vn(i)}return r}function yr(t,e){return t===e||t?.[we]===e}function fn(t=Nr(),e,r,n){var i=j.r,l=m;return Ln(()=>{var o,a;return Fr(()=>{o=a,a=n?.()||[],We(()=>{yr(r(...a),t)||(e(t,...a),o&&yr(r(...o),t)&&e(null,...o))})}),()=>{let u=l;for(;u!==i&&u.parent!==null&&u.parent.f&33554432;)u=u.parent;const c=()=>{a&&yr(r(...a),t)&&e(null,...a)},f=u.teardown;u.teardown=()=>{c(),f?.()}}}),t}var Re=!1;function Xl(t){var e=Re;try{return Re=!1,[t(),Re]}finally{Re=e}}function V(t,e,r,n){var i=!or||(r&2)!==0,l=(r&8)!==0,o=(r&16)!==0,a=n,u=!0,c=void 0,f=()=>o&&i?(c??(c=be(n)),g(c)):(u&&(u=!1,a=o?We(n):n),a);let d;if(l){var p=we in t||gn in t;d=Dt(t,e)?.set??(p&&e in t?N=>t[e]=N:void 0)}var h,v=!1;l?[h,v]=Xl(()=>t[e]):h=t[e],h===void 0&&n!==void 0&&(h=f(),d&&(i&&Ji(e),d(h)));var M;if(i?M=()=>{var N=t[e];return N===void 0?f():(u=!0,N)}:M=()=>{var N=t[e];return N!==void 0&&(a=void 0),N===void 0?a:N},i&&(r&4)===0)return M;if(d){var D=t.$$legacy;return(function(N,xt){return arguments.length>0?((!i||!xt||D||v)&&d(xt?M():N),N):M()})}var z=!1,B=((r&1)!==0?be:kn)(()=>(z=!1,M()));l&&g(B);var H=m;return(function(N,xt){if(arguments.length>0){const Y=xt?g(B):i&&l?Qt(N):N;return x(B,Y),z=!0,a!==void 0&&(a=Y),N}return Mt&&z||(H.f&16384)!==0?B.v:g(B)})}function Yl(t){return new Zl(t)}var Zl=(Tt=new WeakMap,st=new WeakMap,class{constructor(t){y(this,Tt,void 0),y(this,st,void 0);var e=new Map,r=(i,l)=>{var o=fl(l,!1,!1);return e.set(i,o),o};const n=new Proxy({...t.props||{},$$events:{}},{get(i,l){return g(e.get(l)??r(l,Reflect.get(i,l)))},has(i,l){return l===gn?!0:(g(e.get(l)??r(l,Reflect.get(i,l))),Reflect.has(i,l))},set(i,l,o){return x(e.get(l)??r(l,o),o),Reflect.set(i,l,o)}});_(st,this,(t.hydrate?ql:ei)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!t?.props?.$$host||t.sync===!1)&&F(),_(Tt,this,n.$$events);for(const i of Object.keys(s(st,this)))i==="$set"||i==="$destroy"||i==="$on"||me(this,i,{get(){return s(st,this)[i]},set(l){s(st,this)[i]=l},enumerable:!0});s(st,this).$set=i=>{Object.assign(n,i)},s(st,this).$destroy=()=>{Fl(s(st,this))}}$set(t){s(st,this).$set(t)}$on(t,e){s(Tt,this)[t]=s(Tt,this)[t]||[];const r=(...n)=>e.call(this,...n);return s(Tt,this)[t].push(r),()=>{s(Tt,this)[t]=s(Tt,this)[t].filter(n=>n!==r)}}$destroy(){s(st,this).$destroy()}}),ii;typeof HTMLElement=="function"&&(ii=class extends HTMLElement{constructor(t,e,r){var n=(...i)=>(super(...i),S(this,"$$ctor",void 0),S(this,"$$s",void 0),S(this,"$$c",void 0),S(this,"$$cn",!1),S(this,"$$d",{}),S(this,"$$r",!1),S(this,"$$p_d",{}),S(this,"$$l",{}),S(this,"$$l_u",new Map),S(this,"$$me",void 0),S(this,"$$shadowRoot",null),this);n(),this.$$ctor=t,this.$$s=e,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return i=>{const l=Rr("slot");n!=="default"&&(l.name=n),qt(i,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Ql(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Ue(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Yl({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=yl(()=>{Fr(()=>{this.$$r=!0;for(const n of Xe(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=Ue(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const l=this.$$c.$on(n,i);this.$$l_u.set(i,l)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ue(t,r,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 Xe(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Ue(t,e,r,n){const i=r[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="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 Ql(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function li(t,e,r,n,i,l){let o=class extends ii{constructor(){super(t,r,i),this.$$p_d=e}static get observedAttributes(){return Xe(e).map(a=>(e[a].attribute||a).toLowerCase())}};return Xe(e).forEach(a=>{me(o.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(u){u=Ue(a,u,e),this.$$d[a]=u;var c=this.$$c;c&&(Dt(c,a)?.get?c[a]=u:c.$set({[a]:u}))}})}),n.forEach(a=>{me(o.prototype,a,{get(){return this.$$c?.[a]}})}),l&&(o=l(o)),t.element=o,o}function ts(t){const e=new Set,r=n=>{if(n===void 0)return{$type:"undefined"};if(typeof n=="bigint")return{$type:"bigint",value:n.toString()};if(typeof n=="function")return{$type:"function",value:n.toString()};if(typeof n=="symbol")return{$type:"symbol",value:n.description??""};if(n===null||typeof n!="object")return n;if(e.has(n))return{$type:"circular-reference"};e.add(n);const i=Array.isArray(n)?n.map(r):Object.fromEntries(Object.entries(n).sort(([l],[o])=>l.localeCompare(o)).map(([l,o])=>[l,r(o)]));return e.delete(n),i};return JSON.stringify(r(t))}var es=ue('<div class="pie-tool-calculator__loading svelte-16ps7c2"> </div>'),rs=ue('<div class="pie-tool-calculator__loading pie-tool-calculator__loading--error svelte-16ps7c2">Calculator failed to initialize. <div class="pie-tool-calculator__error-details svelte-16ps7c2"> </div></div>'),ns=ue('<div class="pie-tool-calculator notranslate svelte-16ps7c2" role="region" tabindex="-1" translate="no"><div class="pie-tool-calculator__container svelte-16ps7c2"></div> <!> <!></div>'),is=ue('<div class="pie-tool-calculator__context-host svelte-16ps7c2"><!></div>'),ls={hash:"svelte-16ps7c2",code:`.pie-tool-calculator__context-host.svelte-16ps7c2 {display:flex;width:100%;height:100%;min-height:0;}.pie-tool-calculator.svelte-16ps7c2 {position:relative;display:flex;flex:1 1 auto;min-width:100%;min-height:0;background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__container.svelte-16ps7c2 {position:relative;width:100%;height:100%;min-width:100%;min-height:100%;
3
- /*
4
- * \`--pie-white\`, not the literal. The token inverts by design (#ffffff light,
5
- * #000000 dark, redefined per colour scheme), so a hardcoded white showed
6
- * through as a white plate behind a dark calculator the moment a provider's own
7
- * surface stopped being opaque — and under a PNP colour scheme it was simply
8
- * the wrong colour.
9
- */background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__mount {width:100%;height:100%;min-width:100%;min-height:100%;}.pie-tool-calculator__loading.svelte-16ps7c2 {position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--pie-white, #fff) 90%, transparent);color:var(--pie-text, #334155);font-size:0.9rem;}.pie-tool-calculator__loading--error.svelte-16ps7c2 {flex-direction:column;gap:0.5rem;padding:0.75rem;color:var(--pie-incorrect, #b91c1c);text-align:center;}.pie-tool-calculator__error-details.svelte-16ps7c2 {max-width:95%;color:var(--pie-incorrect, #7f1d1d);font-size:0.8rem;line-height:1.2;word-break:break-word;}.pie-tool-calculator__mount > * {width:100% !important;height:100% !important;}`};function si(t,e){Ar(e,!0),ni(t,ls);let r=V(e,"visible",7,!1),n=V(e,"toolId",7,"calculator"),i=V(e,"providerId",7,""),l=V(e,"calculatorType",7,"basic"),o=V(e,"availableTypes",23,()=>["basic","scientific","graphing"]),a=V(e,"calculatorConfig",23,()=>({})),u=V(e,"toolkitCoordinator",7,null),c=q(null),f=q(null),d=q(null),p=q(null),h=q(!1),v=q(null),M=q(!1);const D=de(()=>_i(g(d))),z=de(()=>u()??g(d)?.toolkitCoordinator),B=de(()=>(typeof o()=="string"?o().split(",").map(w=>w.trim()):o()).filter(w=>w==="basic"||w==="scientific"||w==="graphing")),H=de(()=>g(B).includes(l())?l():g(B)[0]??"basic"),N=de(()=>ts(a()));let xt=null,Y=null,jt=0,ur=!1,Ee=null;const Pe=new Set;Tr(()=>{if(g(c))return wi(g(c),w=>{x(d,w,!0)})});function Hr(){Ee?.disconnect(),Ee=null;for(const w of Pe)clearTimeout(w);Pe.clear()}function cr(){jt+=1,Hr();const w=g(p),W=Y;x(p,null),Y=null;try{w?.destroy()}catch(C){console.warn("[CalculatorTool] calculator cleanup failed:",C)}W?.remove(),xt=null,x(h,!1),x(M,!1)}function Vr(){requestAnimationFrame(()=>{if(!r()||!g(p)||!Y?.isConnected)return;const w=document.activeElement;w instanceof Node&&Y.contains(w)||g(p).focus?.()})}function oi(w,W){Hr(),typeof ResizeObserver<"u"&&(Ee=new ResizeObserver(()=>{r()&&W.isConnected&&w.resize?.()}),Ee.observe(W));for(const C of[60,250,1e3]){const L=setTimeout(()=>{Pe.delete(L),r()&&W.isConnected&&w.resize?.()},C);Pe.add(L)}}async function ai(w,W,C){x(h,!0),x(v,null);try{if(!i())throw new Error("Calculator provider id is required");const L=g(z)?.toolProviderRegistry;if(!L)throw new Error("Calculator provider registry is unavailable");const fr=await(await L.getProvider(i())).createInstance();if(w!==jt||!r()||!C.isConnected){C.remove();return}const Jt=await fr.createCalculator(g(H),C,a());if(w!==jt||!r()||!C.isConnected){Jt.destroy(),C.remove();return}x(p,Jt,!0),xt=W,x(M,C.childElementCount>0),oi(Jt,C),requestAnimationFrame(()=>{w===jt&&(Jt.resize?.(),x(M,C.childElementCount>0),Vr())})}catch(L){if(w!==jt){C.remove();return}x(v,L instanceof Error?L.message:String(L),!0),x(p,null),Y===C&&(Y=null),C.remove(),x(M,!1)}finally{w===jt&&x(h,!1)}}function ui(){ur=!1;const w=g(f),W=g(z);if(!r()||!w||!w.isConnected||!W){(g(p)||g(h)||Y)&&cr(),x(v,null);return}const C=`${i()}:${g(H)}:${g(N)}`;if(g(p)&&xt===C){Vr();return}(g(p)||g(h)||Y)&&cr();const L=document.createElement("div");L.className="pie-tool-calculator__mount",w.replaceChildren(L),Y=L,ai(++jt,C,L)}function ci(){ur||(ur=!0,queueMicrotask(ui))}Tr(()=>{r(),i(),g(H),a(),g(N),g(f),g(z),We(ci)}),Bl(()=>()=>cr());var fi={get visible(){return r()},set visible(w=!1){r(w),F()},get toolId(){return n()},set toolId(w="calculator"){n(w),F()},get providerId(){return i()},set providerId(w=""){i(w),F()},get calculatorType(){return l()},set calculatorType(w="basic"){l(w),F()},get availableTypes(){return o()},set availableTypes(w=["basic","scientific","graphing"]){o(w),F()},get calculatorConfig(){return a()},set calculatorConfig(w={}){a(w),F()},get toolkitCoordinator(){return u()},set toolkitCoordinator(w=null){u(w),F()}},Oe=is(),hi=re(Oe),vi=w=>{var W=ns(),C=re(W);fn(C,lt=>x(f,lt),()=>g(f));var L=Ve(C,2),fr=lt=>{var St=es(),ce=tn(St,!0);gr(pi=>un(ce,pi),[()=>g(D).t("tools.calculator.loading")]),qt(lt,St)};Ke(L,lt=>{(g(h)||!g(v)&&!g(M))&&lt(fr)});var Jt=Ve(L,2),di=lt=>{var St=rs(),ce=tn(Ve(re(St)),!0);ee(St),gr(()=>un(ce,g(v))),qt(lt,St)};Ke(Jt,lt=>{g(v)&&lt(di)}),ee(W),gr((lt,St,ce)=>{Ut(W,"data-tool-id",n()),Ut(W,"data-provider-id",i()),Ut(W,"lang",lt),Ut(W,"dir",St),Ut(W,"aria-label",ce),Ut(C,"data-calculator-type",g(H)),W.dir=W.dir},[()=>g(D).getLocale(),()=>g(D).getDirection?.()??"ltr",()=>g(D).t("tools.calculator.toolA11y")]),qt(w,W)};return Ke(hi,w=>{r()&&w(vi)}),ee(Oe),fn(Oe,w=>x(c,w),()=>g(c)),qt(t,Oe),Ir(fi)}li(si,{visible:{},toolId:{},providerId:{},calculatorType:{},availableTypes:{},calculatorConfig:{},toolkitCoordinator:{}},[],[],{mode:"open"});var ss=ue('<a class="pie-tool-calculator-geogebra__attribution svelte-1y3d5zb" href="https://www.geogebra.org/" target="_blank" rel="noreferrer" aria-label="Made with GeoGebra® (opens in a new tab)">Made with GeoGebra®</a>'),os=ue('<div class="pie-tool-calculator-geogebra__surface svelte-1y3d5zb"><div class="pie-tool-calculator-geogebra__calculator svelte-1y3d5zb"><!></div> <!></div>'),as={hash:"svelte-1y3d5zb",code:".pie-tool-calculator-geogebra__surface.svelte-1y3d5zb {display:flex;flex-direction:column;width:100%;height:100%;min-height:0;}.pie-tool-calculator-geogebra__calculator.svelte-1y3d5zb {display:flex;flex:1 1 auto;min-height:0;}.pie-tool-calculator-geogebra__attribution.svelte-1y3d5zb {align-self:flex-end;flex:0 0 auto;padding:0.1rem 0.25rem;border-radius:0.2rem;background:rgb(255 255 255 / 88%);color:#334155;font-size:0.65rem;}"};function us(t,e){Ar(e,!0),ni(t,as);let r=V(e,"visible",7,!1),n=V(e,"toolId",7,"calculator"),i=V(e,"providerId",7,"calculator-geogebra"),l=V(e,"calculatorType",7,"basic"),o=V(e,"availableTypes",23,()=>["basic","scientific","graphing"]),a=V(e,"calculatorConfig",23,()=>({})),u=V(e,"toolkitCoordinator",7,null);var c={get visible(){return r()},set visible(v=!1){r(v),F()},get toolId(){return n()},set toolId(v="calculator"){n(v),F()},get providerId(){return i()},set providerId(v="calculator-geogebra"){i(v),F()},get calculatorType(){return l()},set calculatorType(v="basic"){l(v),F()},get availableTypes(){return o()},set availableTypes(v=["basic","scientific","graphing"]){o(v),F()},get calculatorConfig(){return a()},set calculatorConfig(v={}){a(v),F()},get toolkitCoordinator(){return u()},set toolkitCoordinator(v=null){u(v),F()}},f=os(),d=re(f);si(re(d),{get visible(){return r()},get toolId(){return n()},get providerId(){return i()},get calculatorType(){return l()},get availableTypes(){return o()},get calculatorConfig(){return a()},get toolkitCoordinator(){return u()}}),ee(d);var p=Ve(d,2),h=v=>{qt(v,ss())};return Ke(p,v=>{r()&&v(h)}),ee(f),qt(t,f),Ir(c)}cs("pie-tool-calculator-geogebra",li(us,{visible:{attribute:"visible",type:"Boolean"},toolId:{attribute:"tool-id",type:"String"},providerId:{attribute:"provider-id",type:"String"},calculatorType:{attribute:"calculator-type",type:"String"},availableTypes:{attribute:"available-types",type:"Array"},calculatorConfig:{type:"Object"},toolkitCoordinator:{type:"Object"}},[],[],void 0,gi));function cs(t,e){customElements.get(t)||customElements.define(t,e)}export{us as default};
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +0,0 @@
1
- /**
2
- * Registration dispatch for the item and passage shells.
3
- *
4
- * Registration is a statement of fact to the runtime, and the runtime takes it
5
- * literally: a `pie-register` makes the toolkit unregister and re-register the
6
- * content's accessibility catalogs, re-run `sectionEngine.register`, and
7
- * re-notify the section controller. Both shells used to dispatch it from the
8
- * same effect that attached their listeners, with `pie-unregister` in that
9
- * effect's cleanup — so every re-run announced a teardown and a rebuild of state
10
- * that had not moved, and between the two the content had no catalogs at all.
11
- *
12
- * Those effects re-run on prop changes, and a shell's props are re-applied
13
- * whenever its parent card's template updates. That made the dispatch the far
14
- * half of a cycle: a reader that re-renders in response to a catalog change
15
- * re-applies a shell's props, which re-registers, which changes catalogs again.
16
- * It shipped once at roughly a thousand rounds per item, ending in Svelte
17
- * abandoning the update at its depth limit with the DOM half-applied — and every
18
- * assertion about the rendered output passed while it was happening, because the
19
- * elements were all present.
20
- *
21
- * So the dispatcher keeps the last identity it announced and says nothing when
22
- * the next one matches.
23
- */
24
- export type ShellRegistrationIdentity = {
25
- kind: "item" | "passage";
26
- host: HTMLElement;
27
- itemId: string;
28
- canonicalItemId: string;
29
- contentKind: string;
30
- item: unknown;
31
- };
32
- export type ShellRegistrationDispatcher = {
33
- /**
34
- * Announce `identity` if it says anything new, and retire the live
35
- * registration when there is nothing left to describe — a shell without a host
36
- * or an id no longer stands for content, and leaving its registration behind
37
- * would strand it in the runtime.
38
- *
39
- * Never dispatches `pie-unregister` before a re-register: both registration
40
- * paths in the toolkit are keyed by element and replace what is there, so the
41
- * unregister only ever created the gap.
42
- */
43
- sync: (identity: ShellRegistrationIdentity | null) => void;
44
- /**
45
- * Retire the live registration, replaying the identity it was made under
46
- * rather than whatever the props say now — by the time a registration is
47
- * retired the props may already describe its replacement, and unregistering
48
- * under the new identity would leave the old one live.
49
- *
50
- * Belongs in a teardown that runs on teardown only. Attaching it to an effect
51
- * that re-runs on prop changes is what made the churn.
52
- */
53
- retire: () => void;
54
- };
55
- export declare function createShellRegistrationDispatcher(): ShellRegistrationDispatcher;
@@ -1,17 +0,0 @@
1
- import { SectionPlayerPublicEventName } from './public-events.js';
2
- export type SectionPlayerLayoutName = "splitpane" | "vertical" | "tabbed";
3
- export type SectionPlayerLayoutCapability = "items-pane" | "passages-pane" | "section-toolbar" | "item-toolbar" | "passage-toolbar" | "readiness-events" | "navigation-events";
4
- export type SectionPlayerBasicPropName = "assessmentId" | "section" | "sectionId" | "attemptId" | "debug" | "showToolbar" | "toolbarPosition" | "narrowLayoutBreakpoint" | "contentMaxWidthNoPassage" | "contentMaxWidthWithPassage" | "splitPaneMinRegionWidth" | "splitPaneInitialPassageWidth" | "splitPaneCollapseStrategy";
5
- export type SectionPlayerAdvancedPropName = "runtime" | "iifeBundleHost" | "toolRegistry" | "sectionHostButtons" | "itemHostButtons" | "passageHostButtons" | "policies" | "toolConfigStrictness" | "hooks" | "onFrameworkError" | "onStageChange" | "onLoadingComplete";
6
- export type SectionPlayerLayoutPropName = SectionPlayerBasicPropName | SectionPlayerAdvancedPropName;
7
- export type SectionPlayerLayoutCommandName = "getSnapshot" | "selectComposition" | "selectNavigation" | "selectReadiness" | "navigateTo" | "navigateNext" | "navigatePrevious" | "getSectionController" | "waitForSectionController";
8
- export type SectionPlayerLayoutContract = {
9
- version: 1;
10
- layout: SectionPlayerLayoutName;
11
- props: readonly SectionPlayerLayoutPropName[];
12
- recommendedBasicProps: readonly SectionPlayerBasicPropName[];
13
- advancedEscapeHatchProps: readonly SectionPlayerAdvancedPropName[];
14
- events: readonly SectionPlayerPublicEventName[];
15
- commands: readonly SectionPlayerLayoutCommandName[];
16
- capabilities: readonly SectionPlayerLayoutCapability[];
17
- };
File without changes
@@ -1,4 +0,0 @@
1
- import { SectionPlayerLayoutContract } from './layout-contract.js';
2
- export declare const SPLITPANE_LAYOUT_CONTRACT: SectionPlayerLayoutContract;
3
- export declare const VERTICAL_LAYOUT_CONTRACT: SectionPlayerLayoutContract;
4
- export declare const TABBED_LAYOUT_CONTRACT: SectionPlayerLayoutContract;
@@ -1,87 +0,0 @@
1
- import { SECTION_PLAYER_PUBLIC_EVENTS as e } from "./public-events.js";
2
- var a = [
3
- "assessmentId",
4
- "section",
5
- "sectionId",
6
- "attemptId",
7
- "debug",
8
- "showToolbar",
9
- "toolbarPosition",
10
- "narrowLayoutBreakpoint",
11
- "contentMaxWidthNoPassage",
12
- "contentMaxWidthWithPassage",
13
- "splitPaneMinRegionWidth",
14
- "splitPaneInitialPassageWidth",
15
- "splitPaneCollapseStrategy"
16
- ], o = [
17
- "runtime",
18
- "iifeBundleHost",
19
- "toolRegistry",
20
- "sectionHostButtons",
21
- "itemHostButtons",
22
- "passageHostButtons",
23
- "policies",
24
- "toolConfigStrictness",
25
- "hooks",
26
- "onFrameworkError",
27
- "onStageChange",
28
- "onLoadingComplete"
29
- ], t = [...a, ...o], s = [
30
- e.runtimeOwned,
31
- e.runtimeInherited,
32
- e.frameworkError,
33
- e.compositionChanged,
34
- e.sessionChanged,
35
- e.stageChange,
36
- e.loadingComplete
37
- ], n = [
38
- "getSnapshot",
39
- "selectComposition",
40
- "selectNavigation",
41
- "selectReadiness",
42
- "navigateTo",
43
- "navigateNext",
44
- "navigatePrevious",
45
- "getSectionController",
46
- "waitForSectionController"
47
- ], i = [
48
- "items-pane",
49
- "passages-pane",
50
- "section-toolbar",
51
- "item-toolbar",
52
- "passage-toolbar",
53
- "readiness-events",
54
- "navigation-events"
55
- ], p = {
56
- version: 1,
57
- layout: "splitpane",
58
- props: t,
59
- recommendedBasicProps: a,
60
- advancedEscapeHatchProps: o,
61
- events: s,
62
- commands: n,
63
- capabilities: i
64
- }, c = {
65
- version: 1,
66
- layout: "vertical",
67
- props: t,
68
- recommendedBasicProps: a,
69
- advancedEscapeHatchProps: o,
70
- events: s,
71
- commands: n,
72
- capabilities: i
73
- }, d = {
74
- version: 1,
75
- layout: "tabbed",
76
- props: t,
77
- recommendedBasicProps: a,
78
- advancedEscapeHatchProps: o,
79
- events: s,
80
- commands: n,
81
- capabilities: i
82
- };
83
- export {
84
- p as SPLITPANE_LAYOUT_CONTRACT,
85
- d as TABBED_LAYOUT_CONTRACT,
86
- c as VERTICAL_LAYOUT_CONTRACT
87
- };
@@ -1,92 +0,0 @@
1
- /**
2
- * Section-player layout-CE public DOM event vocabulary.
3
- *
4
- * **Engine routing (M7).** The *stage / loading-complete /
5
- * framework-error* family is dispatched on the layout CE host by the
6
- * section runtime engine
7
- * (`@pie-players/pie-assessment-toolkit/runtime/engine`) — not by an
8
- * in-CE `$effect` cluster. The kernel attaches the engine to the host
9
- * (`engine.attachHost({ host, sourceCe, frameworkErrorBus })`), and
10
- * the engine's DOM-event bridge dispatches `pie-stage-change`,
11
- * `pie-loading-complete`, and `framework-error`.
12
- *
13
- * **Toolkit events (not engine-routed).** The composition / session /
14
- * runtime-tier family (`composition-changed`, `session-changed`,
15
- * `runtime-owned`, `runtime-inherited`) is dispatched by
16
- * `<pie-assessment-toolkit>` and bubbles through the layout CE host to
17
- * `document`; no section-player component re-dispatches it, so each
18
- * listener receives each dispatch once. It does not flow through the
19
- * engine: the engine owns lifecycle and error reporting, and has no
20
- * opinion on composition or session shape.
21
- *
22
- * **`framework-error` single-emit on the layout host.**
23
- * `<pie-assessment-toolkit>` nested inside a layout CE still
24
- * dispatches its own `framework-error` (with `bubbles: true,
25
- * composed: true`) so direct toolkit consumers keep working. The
26
- * kernel's `handleFrameworkError` listener intercepts that bubbled
27
- * emit at `<pie-section-player-base>` and calls
28
- * `event.stopPropagation()`, leaving the engine-bridge emit on the
29
- * layout host as the single canonical DOM surface for
30
- * section-player consumers. `tests/section-player-event-delivery.spec.ts`
31
- * pins one delivery per error on the layout host and none on
32
- * `document`.
33
- *
34
- * Lifecycle should be consumed through canonical events:
35
- * - `readiness-change` → `pie-stage-change` (the readiness phase
36
- * is also reachable via `selectReadiness()` /
37
- * `getSnapshot().readiness`).
38
- * - `interaction-ready` → `pie-stage-change` filtered on
39
- * `detail.stage === "interactive"`.
40
- * - `ready` → `pie-loading-complete`.
41
- *
42
- * Controller readiness is available through
43
- * `waitForSectionController(timeoutMs)` / `getSectionController()` on the
44
- * layout CE, or by filtering `pie-stage-change` for
45
- * `detail.stage === "engine-ready"`.
46
- *
47
- * Source of truth for the names: `players-shared/src/pie/stages.ts`
48
- * and the `SectionEngineOutput` discriminator in
49
- * `assessment-toolkit/src/runtime/core/engine-output.ts`.
50
- */
51
- export declare const SECTION_PLAYER_PUBLIC_EVENTS: {
52
- readonly runtimeOwned: "runtime-owned";
53
- readonly runtimeInherited: "runtime-inherited";
54
- /**
55
- * Engine-routed (M7). Dispatched by
56
- * `framework-error-bridge.ts` on the layout CE host whenever the
57
- * engine receives a `framework-error` input. See class doc on
58
- * `FrameworkErrorBus` for the back-pressure / fan-out semantics.
59
- */
60
- readonly frameworkError: "framework-error";
61
- readonly compositionChanged: "composition-changed";
62
- readonly sessionChanged: "session-changed";
63
- /**
64
- * Engine-routed (M7). One DOM event family carries every stage
65
- * transition (`composed` → `engine-ready` → `interactive` →
66
- * `disposed`) with the discriminator in `event.detail.stage`.
67
- * Dispatched by the engine's `dom-event-bridge.ts` on each
68
- * `SectionEngineOutput` of kind `stage-change`. See
69
- * `packages/players-shared/src/pie/stages.ts`.
70
- */
71
- readonly stageChange: "pie-stage-change";
72
- /**
73
- * Engine-routed (M7). Companion to `stageChange`. Fires once per
74
- * cohort, once the section controller is ready and the section's
75
- * element pre-warm has resolved for the current items: the same
76
- * condition that moves a layout element to `interactive`.
77
- */
78
- readonly loadingComplete: "pie-loading-complete";
79
- };
80
- export type SectionPlayerPublicEventName = (typeof SECTION_PLAYER_PUBLIC_EVENTS)[keyof typeof SECTION_PLAYER_PUBLIC_EVENTS];
81
- /**
82
- * Readiness phase reported by the engine's readiness derivation. The
83
- * type preserves the readiness payload shape used by
84
- * `selectReadiness()`.
85
- */
86
- export type SectionPlayerReadinessPhase = "bootstrapping" | "interaction-ready" | "loading" | "ready" | "error";
87
- export type SectionPlayerReadinessChangeDetail = {
88
- phase: SectionPlayerReadinessPhase;
89
- interactionReady: boolean;
90
- allLoadingComplete: boolean;
91
- reason?: string;
92
- };
@@ -1,12 +0,0 @@
1
- var e = {
2
- runtimeOwned: "runtime-owned",
3
- runtimeInherited: "runtime-inherited",
4
- frameworkError: "framework-error",
5
- compositionChanged: "composition-changed",
6
- sessionChanged: "session-changed",
7
- stageChange: "pie-stage-change",
8
- loadingComplete: "pie-loading-complete"
9
- };
10
- export {
11
- e as SECTION_PLAYER_PUBLIC_EVENTS
12
- };
@@ -1,2 +0,0 @@
1
- import { SectionPlayerPublicEventName } from '../contracts/public-events.js';
2
- export declare function assertPublicEventName(eventName: string): asserts eventName is SectionPlayerPublicEventName;