(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();const Rr=!1;var Nr=Array.isArray,Ns=Array.prototype.indexOf,nn=Array.prototype.includes,Mn=Array.from,$r=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,$s=Object.getOwnPropertyDescriptors,Os=Object.prototype,qs=Array.prototype,Or=Object.getPrototypeOf,vr=Object.isExtensible;const zs=()=>{};function Is(n){for(var e=0;e<n.length;e++)n[e]()}function qr(){var n,e,t=new Promise((r,s)=>{n=r,e=s});return{promise:t,resolve:n,reject:e}}const Fe=2,It=4,En=8,zr=1<<24,We=16,Ze=32,bt=64,Dn=128,er=256,Ge=512,Me=1024,be=2048,He=4096,Oe=8192,Se=16384,Bt=32768,rn=1<<25,Dt=65536,mn=1<<17,Ds=1<<18,Ht=1<<19,Ls=1<<20,et=1<<25,gn=1<<21,Ot=1<<22,mt=1<<23,Jt=Symbol("$state"),Ir=Symbol("component"),Us=Symbol("legacy props"),js=Symbol(""),Dr=Symbol("attributes"),Ln=Symbol("class"),Un=Symbol("style"),jn=Symbol("text"),hn=Symbol("form reset"),ln=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Bs=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),Hs=1,Vs=2,Lr=4,Ys=8,Ws=16,Xs=1,Ks=4,Gs=8,Zs=16,Js=1,Qs=2,Ur={},xe=Symbol("uninitialized"),ei="http://www.w3.org/1999/xhtml";function ti(){console.warn("https://svelte.dev/e/derived_inert")}function ni(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function jr(n){return n===this.v}function ri(n,e){return n!=n?e==e:n!==e||n!==null&&typeof n=="object"||typeof n=="function"}function Br(n){return!ri(n,this.v)}function Hr(n){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function si(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function ii(n,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ai(n){throw new Error("https://svelte.dev/e/effect_in_teardown")}function oi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function li(n){throw new Error("https://svelte.dev/e/effect_orphan")}function ci(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ui(n){throw new Error("https://svelte.dev/e/props_invalid_value")}function fi(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function di(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function hi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function vi(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}let pi=!1,Ae=null;function Lt(n){Ae=n}function it(n,e=!1,t){Ae={p:Ae,i:!1,c:null,e:null,s:n,x:null,r:oe,l:null}}function at(n){var e=Ae,t=e.e;if(t!==null){e.e=null;for(var r of t)ls(r)}return e.i=!0,Ae=e.p,tr(n)}function tr(n={}){return $r(n,Ir,{value:!0}),n}function Vr(){return!0}let kt=[];function Yr(){var n=kt;kt=[],Is(n)}function ct(n){if(kt.length===0&&!Qt){var e=kt;queueMicrotask(()=>{e===kt&&Yr()})}kt.push(n)}function mi(){for(;kt.length>0;)Yr()}const gi=-7169;function _e(n,e){n.f=n.f&gi|e}function nr(n){(n.f&Ge)!==0||n.deps===null?_e(n,Me):_e(n,He)}function Wr(n,e,t){(n.f&be)!==0?e.add(n):(n.f&He)!==0&&t.add(n),_e(n,Me)}let pr=!1;function _i(){pr||(pr=!0,document.addEventListener("reset",n=>{Promise.resolve().then(()=>{if(!n.defaultPrevented)for(const e of n.target.elements)e[hn]?.()})},{capture:!0}))}function Vt(n){var e=ae,t=oe;Ve(null),st(null);try{return n()}finally{Ve(e),st(t)}}function bi(n,e,t,r=t){n.addEventListener(e,()=>Vt(t));const s=n[hn];s?n[hn]=()=>{s(),r(!0)}:n[hn]=()=>r(!0),_i()}function yi(n,e,t,r){const s=sn;var i=n.filter(f=>!f.settled),o=e.map(s);if(t.length===0&&i.length===0){r(o);return}var c=oe,l=wi(),u=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(f=>f.promise)):null;function h(f){if((c.f&Se)===0){l();try{r([...o,...f])}catch(m){Qe(m,c)}_n()}}var d=Xr();if(t.length===0){u.then(()=>h([])).finally(d);return}function v(){Promise.all(t.map(f=>xi(f))).then(h).catch(f=>Qe(f,c)).finally(d)}u?u.then(()=>{if((c.f&Se)!==0){d();return}l(),v(),_n()}):v()}function wi(){var n=oe,e=ae,t=Ae,r=ne;return function(i=!0){st(n),Ve(e),Lt(t),i&&(n.f&Se)===0&&(r?.activate(),r?.apply())}}function _n(n=!0){st(null),Ve(null),Lt(null),n&&ne?.deactivate()}function Xr(){var n=oe,e=n.b,t=ne,r=!!e?.is_rendered();return e?.update_pending_count(1,t),t.increment(r,n),()=>{e?.update_pending_count(-1,t),t.decrement(r,n)}}function sn(n){var e=Fe|be;return oe!==null&&(oe.f|=Ht),{ctx:Ae,deps:null,effects:null,equals:jr,f:e,fn:n,reactions:null,rv:0,v:xe,wv:0,parent:oe,ac:null}}const Kt=Symbol("obsolete");function xi(n,e,t){let r=oe;r===null&&si();var s=void 0,i=At(xe),o=!ae,c=new Set;return zi(()=>{var l=oe,u=qr();s=u.promise;try{Promise.resolve(n()).then(u.resolve,f=>{f!==ln&&u.reject(f)}).finally(_n)}catch(f){u.reject(f),_n()}var h=ne;if(o){if((l.f&Bt)!==0)var d=Xr();if(r.b?.is_rendered())h.async_deriveds.get(l)?.reject(Kt);else for(const f of c.values())f.reject(Kt);c.add(u),h.async_deriveds.set(l,u)}const v=(f,m=void 0)=>{d?.(),c.delete(u),m!==Kt&&(h.activate(),m?(i.f|=mt,Ut(i,m)):((i.f&mt)!==0&&(i.f^=mt),Ut(i,f)),h.deactivate())};u.promise.then(v,f=>v(null,f||"unknown"))}),os(()=>{for(const l of c)l.reject(Kt)}),new Promise(l=>{function u(h){function d(){h===s?l(i):u(s)}h.then(d,d)}u(s)})}function he(n){const e=sn(n);return vs(e),e}function Kr(n){const e=sn(n);return e.equals=Br,e}function ki(n){var e=n.effects;if(e!==null){n.effects=null;for(var t=0;t<e.length;t+=1)Le(e[t])}}function rr(n){var e,t=oe,r=n.parent;if(!dt&&r!==null&&n.v!==xe&&(r.f&(Se|Oe))!==0)return ti(),n.v;st(r);try{ki(n),e=_s(n)}finally{st(t)}return e}function Gr(n){var e=rr(n);if(!n.equals(e)&&(n.wv=ms(),(!ne?.is_fork||n.deps===null)&&(ne!==null?(ne.capture(n,e,!0),qt?.capture(n,e,!0)):n.v=e,n.deps===null))){_e(n,Me);return}dt||(Xe!==null?(ar()||ne?.is_fork)&&Xe.set(n,e):nr(n))}function Mi(n){if(n.effects!==null)for(const e of n.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&Vt(()=>{e.ac.abort(ln),e.ac=null}),e.fn!==null&&(e.teardown=zs),on(e,0),cr(e))}function Zr(n){if(n.effects!==null)for(const e of n.effects)e.teardown&&e.fn!==null&&jt(e)}let An=null,Ft=null,ne=null,qt=null,Xe=null,Bn=null,Qt=!1,Tn=!1,en=null,vn=null;var mr=0;let Ei=1;class yt{id=Ei++;#e=!1;linked=!0;#s=null;#t=null;async_deriveds=new Map;current=new Map;previous=new Map;#o=new Set;#r=new Set;#a=0;#n=new Map;#l=null;#i=[];#m=[];#c=new Set;#u=new Set;#d=new Map;#g=new Set;is_fork=!1;#f=!1;constructor(){Ft===null?An=Ft=this:(Ft.#t=this,this.#s=Ft),Ft=this}#w(){if(this.is_fork)return!0;for(const r of this.#n.keys()){for(var e=r,t=!1;e.parent!==null;){if(this.#d.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#d.has(e)||this.#d.set(e,{d:[],m:[]}),this.#g.delete(e)}unskip_effect(e,t=r=>this.schedule(r)){var r=this.#d.get(e);if(r){this.#d.delete(e);for(var s of r.d)_e(s,be),t(s);for(s of r.m)_e(s,He),t(s)}this.#g.add(e)}#x(){var e=[];for(const i of this.#i)if(!((i.f&Se)!==0||(i.f&(be|He))===0)){for(var t=i,r=!1;t.parent!==null;){t=t.parent;var s=t.f;if((s&(bt|Ze))!==0){if((s&Me)===0){r=!0;break}t.f^=Me}}r||e.push(t)}return this.#i=[],e}#_(){this.#e=!0;for(const c of this.#c)this.#u.delete(c),_e(c,be),this.schedule(c);for(const c of this.#u)_e(c,He),this.schedule(c);this.apply();for(var e=en=[],t=[],r=vn=[];this.#i.length>0;){mr++>1e3&&(this.#p(),Ai());for(const c of this.#x())try{this.#b(c,e,t)}catch(l){throw es(c),this.#w()||this.discard(),l}}if(ne=null,r.length>0){var s=yt.ensure();for(const c of r)s.schedule(c)}if(en=null,vn=null,this.#w()){this.#v(t),this.#v(e);for(const[c,l]of this.#d)Qr(c,l);r.length>0&&ne.#_();return}const i=this.#h();if(i){this.#v(t),this.#v(e),i.#k(this);return}this.#c.clear(),this.#u.clear();for(const c of this.#o)c(this);this.#o.clear(),qt=this,gr(t),gr(e),qt=null,this.#l?.resolve();var o=ne;if(this.#a===0&&(this.#i.length===0||o!==null)&&this.#p(),this.#i.length>0)if(o!==null){for(const c of this.#i)o.#i.push(c);this.#i=[]}else o=this;o!==null&&(nt.clear(),o.#_())}#b(e,t,r){e.f^=Me;for(var s=e.first;s!==null;){var i=s.f,o=(i&(Ze|bt))!==0,c=o&&(i&Me)!==0,l=c||(i&Oe)!==0||this.#d.has(s);if(!l&&s.fn!==null){o?s.f^=Me:(i&It)!==0?t.push(s):un(s)&&((i&We)!==0&&this.#u.add(s),jt(s));var u=s.first;if(u!==null){s=u;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}}#h(){for(var e=this.#s;e!==null;){if(!e.is_fork){for(const[t,[,r]]of this.current)if(e.current.has(t)&&!r)return e}e=e.#s}return null}#k(e){for(const[r,s]of e.current)!this.previous.has(r)&&e.previous.has(r)&&this.previous.set(r,e.previous.get(r)),this.current.set(r,s);for(const[r,s]of e.async_deriveds){const i=this.async_deriveds.get(r);i&&s.promise.then(i.resolve).catch(i.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#c,e.#u);const t=r=>{var s=r.reactions;if(s!==null&&!((r.f&Fe)!==0&&(r.f&(be|He))===0))for(const c of s){var i=c.f;if((i&Fe)!==0)t(c);else{var o=c;i&(Ot|We)&&!this.async_deriveds.has(o)&&(this.#u.delete(o),_e(o,be),this.schedule(o))}}};for(const r of this.current.keys())t(r);this.oncommit(()=>e.discard()),e.#p(),ne=this,this.#_()}#v(e){for(var t=0;t<e.length;t+=1)Wr(e[t],this.#c,this.#u)}capture(e,t,r=!1){e.v!==xe&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&mt)===0&&(this.current.set(e,[t,r]),Xe?.set(e,t)),this.is_fork||(e.v=t)}activate(){ne=this}deactivate(){ne=null,Xe=null}flush(){try{Tn=!0,ne=this,this.#_()}finally{mr=0,Bn=null,en=null,vn=null,Tn=!1,ne=null,Xe=null,nt.clear()}}discard(){for(const e of this.#r)e(this);this.#r.clear();for(const e of this.async_deriveds.values())e.reject(Kt);this.#p(),this.#l?.resolve()}register_created_effect(e){this.#m.push(e)}#y(){for(let d=An;d!==null;d=d.#t){var e=d.id<this.id,t=[];for(const[v,[f,m]]of this.current){if(d.current.has(v)){var r=d.current.get(v)[0];if(e&&f!==r)d.current.set(v,[f,m]);else continue}t.push(v)}if(e)for(const[v,f]of this.async_deriveds){const m=d.async_deriveds.get(v);m&&f.promise.then(m.resolve).catch(m.reject)}var s=[...d.current.keys()].filter(v=>!d.current.get(v)[1]);if(!(!d.#e||s.length===0)){var i=s.filter(v=>!this.current.has(v));if(i.length===0)e&&d.discard();else if(t.length>0){if(e)for(const v of this.#g)d.unskip_effect(v,f=>{(f.f&(We|Ot))!==0?d.schedule(f):d.#v([f])});d.activate();var o=new Set,c=new Map;for(var l of t)Jr(l,i,o,c);c=new Map;var u=[...d.current].filter(([v,f])=>{const m=this.current.get(v);return m?m[0]!==f[0]||m[1]!==f[1]:!0}).map(([v])=>v);if(u.length>0)for(const v of this.#m)(v.f&(Se|Oe|mn))===0&&sr(v,u,c)&&((v.f&(Ot|We))!==0?(_e(v,be),d.schedule(v)):d.#c.add(v));if(d.#i.length>0&&!d.#f){d.apply();for(var h of d.#x())d.#b(h,[],[])}d.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let r=this.#n.get(t)??0;this.#n.set(t,r+1)}}decrement(e,t){if(this.#a-=1,e){let r=this.#n.get(t)??0;r===1?this.#n.delete(t):this.#n.set(t,r-1)}this.#f||(this.#f=!0,ct(()=>{this.#f=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(const r of e)this.#c.add(r);for(const r of t)this.#u.add(r);e.clear(),t.clear()}oncommit(e){this.#o.add(e)}ondiscard(e){this.#r.add(e)}settled(){return(this.#l??=qr()).promise}static ensure(){if(ne===null){const e=ne=new yt;!Tn&&!Qt&&ct(()=>{e.#e||e.flush()})}return ne}apply(){{Xe=null;return}}schedule(e){if(Bn=e,e.b?.is_pending&&(e.f&(It|En|zr))!==0&&(e.f&Bt)===0){e.b.defer_effect(e);return}this.#i.push(e)}#p(){if(this.linked){var e=this.#s,t=this.#t;e===null?An=t:e.#t=t,t===null?Ft=e:t.#s=e,this.linked=!1}}}function Si(n){var e=Qt,t=qt;qt=null,Qt=!0;try{for(var r;;){if(mi(),ne===null)return r;ne.flush()}}finally{Qt=e,qt=t}}function Ai(){try{ci()}catch(n){Qe(n,Bn)}}let lt=null;function gr(n){var e=n.length;if(e!==0){for(var t=0;t<e;){var r=n[t++];if((r.f&(Se|Oe))===0&&un(r)&&(lt=new Set,jt(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&fs(r),lt?.size>0)){nt.clear();for(const s of lt){if((s.f&(Se|Oe))!==0)continue;const i=[s];let o=s.parent;for(;o!==null;)lt.has(o)&&(lt.delete(o),i.push(o)),o=o.parent;for(let c=i.length-1;c>=0;c--){const l=i[c];(l.f&(Se|Oe))===0&&jt(l)}}lt.clear()}}lt=null}}function Jr(n,e,t,r){if(!t.has(n)&&(t.add(n),n.reactions!==null))for(const s of n.reactions){const i=s.f;(i&Fe)!==0?Jr(s,e,t,r):(i&(Ot|We))!==0&&(i&be)===0&&sr(s,e,r)&&(_e(s,be),ir(s))}}function sr(n,e,t){const r=t.get(n);if(r!==void 0)return r;if(n.deps!==null)for(const s of n.deps){if(nn.call(e,s))return!0;if((s.f&Fe)!==0&&sr(s,e,t))return t.set(s,!0),!0}return t.set(n,!1),!1}function ir(n){ne.schedule(n)}function Qr(n,e){if(!((n.f&Ze)!==0&&(n.f&Me)!==0)){(n.f&be)!==0?e.d.push(n):(n.f&He)!==0&&e.m.push(n),_e(n,Me);for(var t=n.first;t!==null;)Qr(t,e),t=t.next}}function es(n){_e(n,Me);for(var e=n.first;e!==null;)es(e),e=e.next}let bn=new Set;const nt=new Map;let ts=!1;function At(n,e){var t={f:0,v:n,reactions:null,equals:jr,rv:0,wv:0};return t}function D(n,e){const t=At(n);return vs(t),t}function Ti(n,e=!1,t=!0){const r=At(n);return e||(r.equals=Br),r}function C(n,e,t=!1){ae!==null&&(!Ke||(ae.f&mn)!==0)&&Vr()&&(ae.f&(Fe|We|Ot|mn))!==0&&(rt===null||!rt.has(n))&&hi();let r=t?ke(e):e;return Ut(n,r,vn)}var xt=null,Hn=0;function Ut(n,e,t=null){if(!n.equals(e)){dt?nt.set(n,e):nt.has(n)||nt.set(n,n.v);var r=yt.ensure();if(r.capture(n,e),(n.f&Fe)!==0){const s=n;(n.f&be)!==0&&rr(s),Xe===null&&nr(s)}n.wv=ms(),xt=null,Hn=0,ns(n,be,t),xt=null,oe!==null&&(oe.f&Me)!==0&&(oe.f&(Ze|bt))===0&&(je===null?Li([n]):je.push(n)),!r.is_fork&&bn.size>0&&!ts&&Pi()}return e}function Pi(){ts=!1;for(const n of bn){(n.f&Me)!==0&&_e(n,He);let e;try{e=un(n)}catch{e=!0}e&&jt(n)}bn.clear()}function tn(n){C(n,n.v+1)}function ns(n,e,t){var r=n.reactions;if(r!==null){var s=r.length;if(Hn+=s,Hn>1e5&&xt===null&&(xt=new Set),xt!==null){if(xt.has(n))return;xt.add(n)}for(var i=0;i<s;i++){var o=r[i],c=o.f,l=(c&be)===0;if(l&&_e(o,e),(c&mn)!==0)bn.add(o);else if((c&Fe)!==0){var u=o;Xe?.delete(u),ns(u,He,t)}else if(l){var h=o;(c&We)!==0&<!==null&<.add(h),t!==null?t.push(h):ir(h)}}}}function ke(n){if(typeof n!="object"||n===null||Jt in n||Ir in n)return n;const e=Or(n);if(e!==Os&&e!==qs)return n;var t=new Map,r=Nr(n),s=D(0),i=St,o=c=>{if(St===i)return c();var l=ae,u=St;Ve(null),br(i);var h=c();return Ve(l),br(u),h};return r&&t.set("length",D(n.length)),new Proxy(n,{defineProperty(c,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&fi();var h=t.get(l);return h===void 0?o(()=>{var d=D(u.value);return t.set(l,d),d}):C(h,u.value,!0),!0},deleteProperty(c,l){var u=t.get(l);if(u===void 0){if(l in c){const h=o(()=>D(xe));t.set(l,h),tn(s)}}else C(u,xe),tn(s);return!0},get(c,l,u){if(l===Jt)return n;var h=t.get(l),d=l in c;if(h===void 0&&(!d||$t(c,l)?.writable)&&(h=o(()=>{var f=ke(d?c[l]:xe),m=D(f);return m}),t.set(l,h)),h!==void 0){var v=a(h);return v===xe?void 0:v}return Reflect.get(c,l,u)},getOwnPropertyDescriptor(c,l){this.has?.(c,l);var u=Reflect.getOwnPropertyDescriptor(c,l),h=t.get(l);if(h!==void 0){var d=a(h);if(d===xe)return;if(u&&"value"in u)u.value=d;else return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(c,l){if(l===Jt)return!0;var u=t.get(l),h=u!==void 0&&u.v!==xe||Reflect.has(c,l);if(u!==void 0||oe!==null&&(!h||$t(c,l)?.writable)){u===void 0&&(u=o(()=>{var v=h?ke(c[l]):xe,f=D(v);return f}),t.set(l,u));var d=a(u);if(d===xe)return!1}return h},set(c,l,u,h){var d=t.get(l),v=l in c;if(r&&l==="length")for(var f=u;f<d.v;f+=1){var m=t.get(f+"");m!==void 0?C(m,xe):f in c&&(m=o(()=>D(xe)),t.set(f+"",m))}if(d===void 0)(!v||$t(c,l)?.writable)&&(d=o(()=>D(void 0)),C(d,ke(u)),t.set(l,d));else{v=d.v!==xe;var O=o(()=>ke(u));C(d,O)}var b=Reflect.getOwnPropertyDescriptor(c,l);if(b?.set&&b.set.call(h,u),!v){if(r&&typeof l=="string"){var k=t.get("length"),N=Number(l);Number.isInteger(N)&&N>=k.v&&C(k,N+1)}tn(s)}return!0},ownKeys(c){a(s);var l=Reflect.ownKeys(c).filter(d=>{var v=t.get(d);return v===void 0||v.v!==xe});for(var[u,h]of t)h.v!==xe&&!(u in c)&&l.push(u);return l},setPrototypeOf(){di()}})}var an,rs,ss,is;function Ci(){if(an===void 0){an=window,rs=/Firefox/.test(navigator.userAgent);var n=Element.prototype,e=Node.prototype,t=Text.prototype;ss=$t(e,"firstChild").get,is=$t(e,"nextSibling").get,vr(n)&&(n[Ln]=void 0,n[Dr]=null,n[Un]=void 0,n.__e=void 0),vr(t)&&(t[jn]=void 0)}}function gt(n=""){return document.createTextNode(n)}function Tt(n){return ss.call(n)}function cn(n){return is.call(n)}function V(n,e){return Tt(n)}function Sn(n,e=!1){{var t=Tt(n);return t instanceof Comment&&t.data===""?cn(t):t}}function Y(n,e=!1){return Tt(n)}function y(n,e=1,t=!1){let r=n;for(;e--;)r=cn(r);return r}function Fi(n){n.textContent=""}function as(){return!1}function Ri(n,e,t){return t?document.createElement(n,{is:t}):document.createElement(n)}function Ni(n){var e=oe;if(e===null)return ae.f|=mt,n;if((e.f&Bt)===0&&(e.f&It)===0)throw n;Qe(n,e)}function Qe(n,e){if(n===Ur)throw n;if(!(e!==null&&(e.f&Se)!==0)){for(;e!==null;){if((e.f&Dn)!==0&&(e.f&(Se|rn))===0){if((e.f&Bt)===0)throw n;try{e.b.error(n);return}catch(t){n=t}}e=e.parent}throw n}}function $i(n){oe===null&&(ae===null&&li(),oi()),dt&&ai()}function Oi(n,e){var t=e.last;t===null?e.last=e.first=n:(t.next=n,n.prev=t,e.last=n)}function ht(n,e){var t=oe;t!==null&&(t.f&Oe)!==0&&(n|=Oe);var r={ctx:Ae,deps:null,nodes:null,f:n|be|Ge,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};ne?.register_created_effect(r);var s=r;if((n&It)!==0)en!==null?en.push(r):yt.ensure().schedule(r);else if(e!==null){try{jt(r)}catch(o){throw Le(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Ht)===0&&(s=s.first,(n&We)!==0&&(n&Dt)!==0&&s!==null&&(s.f|=Dt))}if(s!==null&&(s.parent=t,t!==null&&Oi(s,t),ae!==null&&(ae.f&Fe)!==0&&(n&bt)===0)){var i=ae;(i.effects??=[]).push(s)}return r}function ar(){return ae!==null&&!Ke}function os(n){const e=ht(En,null);return _e(e,Me),e.teardown=n,e}function _t(n){$i();var e=oe.f,t=!ae&&(e&Ze)!==0&&Ae!==null&&!Ae.i;if(t){var r=Ae;(r.e??=[]).push(n)}else return ls(n)}function ls(n){return ht(It|Ls,n)}function qi(n){yt.ensure();const e=ht(bt|Ht,n);return(t={})=>new Promise(r=>{t.outro?Et(e,()=>{Le(e),r(void 0)}):(Le(e),r(void 0))})}function cs(n){return ht(It,n)}function zi(n){return ht(Ot|Ht,n)}function or(n,e=0){return ht(En|e,n)}function ee(n,e=[],t=[],r=[]){yi(r,e,t,s=>{ht(En,()=>{n(...s.map(a))})})}function lr(n,e=0){var t=ht(We|e,n);return t}function Be(n){return ht(Ze|Ht,n)}function us(n){var e=n.teardown;if(e!==null){const t=dt,r=ae;_r(!0),Ve(null);try{e.call(null)}catch(s){Qe(s,n.parent)}finally{_r(t),Ve(r)}}}function cr(n,e=!1){var t=n.first;for(n.first=n.last=null;t!==null;){const s=t.ac;s!==null&&Vt(()=>{s.abort(ln)});var r=t.next;(t.f&bt)!==0?t.parent=null:Le(t,e),t=r}}function Ii(n){for(var e=n.first;e!==null;){var t=e.next;(e.f&Ze)===0&&Le(e),e=t}}function Le(n,e=!0){var t=!1;(e||(n.f&Ds)!==0)&&n.nodes!==null&&n.nodes.end!==null&&(Di(n.nodes.start,n.nodes.end),t=!0),n.f|=rn,cr(n,e&&!t),on(n,0);var r=n.nodes&&n.nodes.t;if(r!==null)for(const i of r)i.stop();us(n),n.f^=rn,n.f|=Se;var s=n.parent;s!==null&&s.first!==null&&fs(n),n.next=n.prev=n.teardown=n.ctx=n.deps=n.fn=n.nodes=n.ac=n.b=null}function Di(n,e){for(;n!==null;){var t=n===e?null:cn(n);n.remove(),n=t}}function fs(n){var e=n.parent,t=n.prev,r=n.next;t!==null&&(t.next=r),r!==null&&(r.prev=t),e!==null&&(e.first===n&&(e.first=r),e.last===n&&(e.last=t))}function Et(n,e,t=!0){var r=[];n.f|=er,ds(n,r,!0);var s=()=>{t&&Le(n),e&&e()},i=r.length;if(i>0){var o=()=>--i||s();for(var c of r)c.out(o)}else s()}function ds(n,e,t){if((n.f&Oe)===0){n.f^=Oe;var r=n.nodes&&n.nodes.t;if(r!==null)for(const c of r)(c.is_global||t)&&e.push(c);for(var s=n.first;s!==null;){var i=s.next;if((s.f&bt)===0){var o=(s.f&Dt)!==0||(s.f&Ze)!==0&&(n.f&We)!==0;ds(s,e,o?t:!1)}s=i}}}function yn(n){n.f&=~er,hs(n,!0)}function hs(n,e){if((n.f&er)===0&&(n.f&Oe)!==0){n.f^=Oe,(n.f&Me)===0&&(_e(n,be),yt.ensure().schedule(n));for(var t=n.first;t!==null;){var r=t.next,s=(t.f&Dt)!==0||(t.f&Ze)!==0;hs(t,s?e:!1),t=r}var i=n.nodes&&n.nodes.t;if(i!==null)for(const o of i)(o.is_global||e)&&o.in()}}function ur(n,e){if(n.nodes)for(var t=n.nodes.start,r=n.nodes.end;t!==null;){var s=t===r?null:cn(t);e.append(t),t=s}}let dt=!1;function _r(n){dt=n}let ae=null,Ke=!1;function Ve(n){ae=n}let oe=null;function st(n){oe=n}let rt=null;function vs(n){ae!==null&&((ae.f&gn)!==0||(ae.f&Fe)!==0)&&(rt??=new Set).add(n)}let Ie=null,Ue=0,je=null;function Li(n){je=n}let ps=1,Mt=0,St=Mt;function br(n){St=n}function ms(){return++ps}function un(n){var e=n.f;if((e&be)!==0)return!0;if((e&He)!==0){for(var t=n.deps,r=t.length,s=0;s<r;s++){var i=t[s];if(un(i)&&Gr(i),i.wv>n.wv)return!0}(e&Ge)!==0&&Xe===null&&_e(n,Me)}return!1}function gs(n,e,t=!0){var r=n.reactions;if(r!==null&&!(rt!==null&&rt.has(n)))for(var s=0;s<r.length;s++){var i=r[s];(i.f&Fe)!==0?gs(i,e,!1):e===i&&(t?_e(i,be):(i.f&Me)!==0&&_e(i,He),ir(i))}}function _s(n){var e=Ie,t=Ue,r=je,s=ae,i=rt,o=Ae,c=Ke,l=St,u=n.f;Ie=null,Ue=0,je=null,ae=(u&(Ze|bt))===0?n:null,rt=null,Lt(n.ctx),Ke=!1,St=++Mt,n.ac!==null&&(Vt(()=>{n.ac.abort(ln)}),n.ac=null);try{n.f|=gn;var h=n.fn,d=h();n.f|=Bt;var v=yr(n);if(Vr()&&je!==null&&!Ke&&v!==null&&(n.f&(Fe|He|be))===0)for(var f=0;f<je.length;f++)gs(je[f],n);if(s!==null&&s!==n){if(Mt++,s.deps!==null)for(let m=0;m<t;m+=1)s.deps[m].rv=Mt;if(e!==null)for(const m of e)m.rv=Mt;je!==null&&(r===null?r=je:r.push(...je))}return(n.f&mt)!==0&&(n.f^=mt),d}catch(m){return yr(n),Ni(m)}finally{n.f^=gn,Ie=e,Ue=t,je=r,ae=s,rt=i,Lt(o),Ke=c,St=l}}function yr(n){var e=n.deps,t=ne?.is_fork;if(Ie!==null){var r;if(t||on(n,Ue),e!==null&&Ue>0)for(e.length=Ue+Ie.length,r=0;r<Ie.length;r++)e[Ue+r]=Ie[r];else n.deps=e=Ie;if(ar()&&(n.f&Ge)!==0)for(r=Ue;r<e.length;r++)(e[r].reactions??=[]).push(n)}else!t&&e!==null&&Ue<e.length&&(on(n,Ue),e.length=Ue);return e}function Ui(n,e){let t=e.reactions;if(t!==null){var r=Ns.call(t,n);if(r!==-1){var s=t.length-1;s===0?t=e.reactions=null:(t[r]=t[s],t.pop())}}if(t===null&&(e.f&Fe)!==0&&(Ie===null||!nn.call(Ie,e))){var i=e;(i.f&Ge)!==0&&(i.f^=Ge),i.v!==xe&&nr(i),i.ac!==null&&Vt(()=>{i.ac.abort(ln),i.ac=null,_e(i,be)}),Mi(i),on(i,0)}}function on(n,e){var t=n.deps;if(t!==null)for(var r=e;r<t.length;r++)Ui(n,t[r])}function jt(n){var e=n.f;if((e&Se)===0){_e(n,Me);var t=oe;oe=n;try{(e&(We|zr))!==0?Ii(n):cr(n),us(n);var r=_s(n);n.teardown=typeof r=="function"?r:null,n.wv=ps;var s;Rr&&pi&&(n.f&be)!==0&&n.deps}finally{oe=t}}}async function ji(){await Promise.resolve(),Si()}function a(n){var e=n.f,t=(e&Fe)!==0;if(ae!==null&&!Ke){var r=oe!==null&&(oe.f&Se)!==0;if(!r&&(rt===null||!rt.has(n))){var s=ae.deps;if((ae.f&gn)!==0)n.rv<Mt&&(n.rv=Mt,Ie===null&&s!==null&&s[Ue]===n?Ue++:Ie===null?Ie=[n]:Ie.push(n));else{ae.deps??=[],nn.call(ae.deps,n)||ae.deps.push(n);var i=n.reactions;i===null?n.reactions=[ae]:nn.call(i,ae)||i.push(ae)}}}if(dt&&nt.has(n))return nt.get(n);if(t){var o=n;if(dt){var c=o.v;return((o.f&Me)===0&&o.reactions!==null||ys(o))&&(c=rr(o)),nt.set(o,c),c}var l=(o.f&Ge)===0&&!Ke&&ae!==null&&(ae.f&Ge)!==0,u=(o.f&Bt)===0;un(o)&&(l&&(o.f|=Ge),Gr(o)),l&&!u&&(Zr(o),bs(o))}if(Xe?.has(n))return Xe.get(n);if((n.f&mt)!==0)throw n.v;return n.v}function bs(n){if(n.f|=Ge,n.deps!==null)for(const t of n.deps){var e=t.reactions;e===null?t.reactions=[n]:nn.call(e,n)||e.push(n),(t.f&Fe)!==0&&(t.f&Ge)===0&&(Zr(t),bs(t))}}function ys(n){if(n.v===xe)return!0;if(n.deps===null)return!1;for(const e of n.deps)if(nt.has(e)||(e.f&Fe)!==0&&ys(e))return!0;return!1}function vt(n){var e=Ke;try{return Ke=!0,n()}finally{Ke=e}}const Bi=["touchstart","touchmove"];function Hi(n){return Bi.includes(n)}const Gt=Symbol("events"),ws=new Set,Vn=new Set;function Vi(n,e,t,r={}){function s(i){if(r.capture||Yn.call(e,i),!i.cancelBubble)return Vt(()=>t?.call(this,i))}return n.startsWith("pointer")||n.startsWith("touch")||n==="wheel"?(s.__removed=!1,ct(()=>{s.__removed||e.addEventListener(n,s,r)})):e.addEventListener(n,s,r),s}function Pt(n,e,t,r,s){var i={capture:r,passive:s},o=Vi(n,e,t,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&os(()=>{o.__removed=!0,e.removeEventListener(n,o,i)})}function H(n,e,t){(e[Gt]??={})[n]=t}function wt(n){for(var e=0;e<n.length;e++)ws.add(n[e]);for(var t of Vn)t(n)}let Pn=null,Cn=!1;function Yn(n){var e=this,t=e.ownerDocument,r=n.type,s=n.composedPath?.()||[],i=s[0]||n.target;Pn=n,Cn||(Cn=!0,setTimeout(()=>{Cn=!1,Pn=null}));var o=0,c=Pn===n&&n[Gt];if(c){var l=s.indexOf(c);if(l!==-1&&(e===document||e===window)){n[Gt]=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(i=s[o]||n.target,i!==e){$r(n,"currentTarget",{configurable:!0,get(){return i||t}});var h=ae,d=oe;Ve(null),st(null);try{for(var v,f=[];i!==null&&i!==e;){try{var m=i[Gt]?.[r];m!=null&&(!i.disabled||n.target===i)&&m.call(i,n)}catch(O){v?f.push(O):v=O}if(n.cancelBubble)break;o++,i=o<s.length?s[o]:null}if(v){for(let O of f)queueMicrotask(()=>{throw O});throw v}}finally{n[Gt]=e,delete n.currentTarget,Ve(h),st(d)}}}const Yi=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:n=>n});function Wi(n){return Yi?.createHTML(n)??n}function xs(n){var e=Ri("template");return e.innerHTML=Wi(n.replaceAll("<!>","<!---->")),e.content}function wn(n,e){var t=oe;t.nodes===null&&(t.nodes={start:n,end:e,a:null,t:null})}function G(n,e){var t=(e&Js)!==0,r=(e&Qs)!==0,s,i=!n.startsWith("<!>");return()=>{s===void 0&&(s=xs(i?n:"<!>"+n),t||(s=Tt(s)));var o=r||rs?document.importNode(s,!0):s.cloneNode(!0);if(t){var c=Tt(o),l=o.lastChild;wn(c,l)}else wn(o,o);return o}}function Xi(n,e,t="svg"){var r=!n.startsWith("<!>"),s=`<${t}>${r?n:"<!>"+n}</${t}>`,i;return()=>{if(!i){var o=xs(s),c=Tt(o);i=Tt(c)}var l=i.cloneNode(!0);return wn(l,l),l}}function fr(n,e){return Xi(n,e,"svg")}function Wn(n=""){{var e=gt(n+"");return wn(e,e),e}}function j(n,e){n!==null&&n.before(e)}function Ki(n){let e=0,t=At(0),r;return()=>{ar()&&(a(t),or(()=>(e===0&&(r=vt(()=>n(()=>tn(t)))),e+=1,()=>{ct(()=>{e-=1,e===0&&(r?.(),r=void 0,tn(t))})})))}}var Gi=Dt|Ht;function Zi(n,e,t,r){new Ji(n,e,t,r)}class Ji{parent;is_pending=!1;transform_error;#e;#s=null;#t;#o;#r;#a=null;#n=null;#l=null;#i=null;#m=0;#c=0;#u=!1;#d=new Set;#g=new Set;#f=null;#w=Ki(()=>(this.#f=At(this.#m),()=>{this.#f=null}));constructor(e,t,r,s){this.#e=e,this.#t=t,this.#o=i=>{var o=oe;o.b=this,o.f|=Dn,r(i)},this.parent=oe.b,this.transform_error=s??this.parent?.transform_error??(i=>i),this.#r=lr(()=>{this.#v()},Gi)}#x(){try{this.#a=Be(()=>this.#o(this.#e))}catch(e){this.error(e)}}#_(e){const t=this.#t.failed,{reset:r,invoke_onerror:s}=this.#b(e);ct(s),t&&(this.#l=Be(()=>{t(this.#e,()=>e,()=>r)}))}#b(e){var t=!1,r=!1;const s=()=>{if(!this.#h()){if(t){ni();return}t=!0,r&&vi(),this.#l!==null&&Et(this.#l,()=>{this.#l=null}),this.#p(()=>{this.#v()})}};return{reset:s,invoke_onerror:()=>{if(!this.#h())try{r=!0,this.#t.onerror?.(e,s),r=!1}catch(o){Qe(o,this.#r&&this.#r.parent)}}}}#h(){return(this.#r.f&(Se|rn))!==0}#k(){const e=this.#t.pending;e&&(this.is_pending=!0,this.#n=Be(()=>e(this.#e)),ct(()=>{if(!this.#h()){var t=this.#i=document.createDocumentFragment(),r=gt(),s=!1;if(t.append(r),this.#a=this.#p(()=>{try{return Be(()=>this.#o(r))}catch(i){try{this.error(i),s=!0}catch(o){Qe(o,this.#r.parent)}return null}}),this.#a===null){this.#i=null,s&&this.#y(ne);return}this.#c===0&&(this.#e.before(t),this.#i=null,Et(this.#n,()=>{this.#n=null}),this.#y(ne))}}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#c=0,this.#m=0,this.#a=Be(()=>{this.#o(this.#e)}),this.#c>0){var e=this.#i=document.createDocumentFragment();ur(this.#a,e);const t=this.#t.pending;this.#n=Be(()=>t(this.#e))}else this.#y(ne)}catch(t){this.error(t)}}#y(e){this.is_pending=!1,e.transfer_effects(this.#d,this.#g)}defer_effect(e){Wr(e,this.#d,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#p(e){var t=oe,r=ae,s=Ae;st(this.#r),Ve(this.#r),Lt(this.#r.ctx);try{return yt.ensure(),e()}finally{st(t),Ve(r),Lt(s)}}#M(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#M(e,t);return}this.#c+=e,this.#c===0&&(this.#y(t),this.#n&&Et(this.#n,()=>{this.#n=null}),this.#i&&(this.#e.before(this.#i),this.#i=null))}update_pending_count(e,t){this.#M(e,t),this.#m+=e,!(!this.#f||this.#u)&&(this.#u=!0,ct(()=>{this.#u=!1,this.#f&&Ut(this.#f,this.#m)}))}get_effect_pending(){return this.#w(),a(this.#f)}error(e){if(e===Ur||!this.#t.onerror&&!this.#t.failed)throw e;ne?.is_fork?(this.#a&&ne.skip_effect(this.#a),this.#n&&ne.skip_effect(this.#n),this.#l&&ne.skip_effect(this.#l),ne.oncommit(()=>{this.#h()||this.#E(e)})):this.#E(e)}#E(e){this.#a&&(Le(this.#a),this.#a=null),this.#n&&(Le(this.#n),this.#n=null),this.#l&&(Le(this.#l),this.#l=null);let t=this.#t.failed;const r=s=>{if(this.#h())return;const{reset:i,invoke_onerror:o}=this.#b(s);o(),t&&!this.#h()&&(this.#l=this.#p(()=>{try{return Be(()=>{var c=oe;c.b=this,c.f|=Dn,t(this.#e,()=>s,()=>i)})}catch(c){return Qe(c,this.#r.parent),null}}))};ct(()=>{if(!this.#h()){var s;try{s=this.transform_error(e)}catch(i){Qe(i,this.#r&&this.#r.parent);return}s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(r,i=>Qe(i,this.#r&&this.#r.parent)):r(s)}})}}function U(n,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(n[jn]??=n.nodeValue)&&(n[jn]=t,n.nodeValue=`${t}`)}function Fn(n,e){return Qi(n,e)}const fn=new Map;function Qi(n,{target:e,anchor:t,props:r={},events:s,context:i,intro:o=!0,transformError:c}){Ci();var l=void 0,u=qi(()=>{var h=t??e.appendChild(gt());Zi(h,{pending:()=>{}},f=>{it({});var m=Ae;i&&(m.c=i),s&&(r.$$events=s),l=n(f,r)||tr(),at()},c);var d=new Set,v=f=>{for(var m=0;m<f.length;m++){var O=f[m];if(!d.has(O)){d.add(O);var b=Hi(O);for(const S of[e,document]){var k=fn.get(S);k===void 0&&(k=new Map,fn.set(S,k));var N=k.get(O);N===void 0?(S.addEventListener(O,Yn,{passive:b}),k.set(O,1)):k.set(O,N+1)}}}};return v(Mn(ws)),Vn.add(v),()=>{for(var f of d)for(const b of[e,document]){var m=fn.get(b),O=m.get(f);--O==0?(b.removeEventListener(f,Yn),m.delete(f),m.size===0&&fn.delete(b)):m.set(f,O)}Vn.delete(v),h!==t&&h.parentNode?.removeChild(h)}});return ea.set(l,u),l}let ea=new WeakMap;class ta{anchor;#e=new Map;#s=new Map;#t=new Map;#o=new Set;#r=!0;constructor(e,t=!0){this.anchor=e,this.#r=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),r=this.#s.get(t);if(r)yn(r),this.#o.delete(t);else{var s=this.#t.get(t);s&&(yn(s.effect),this.#s.set(t,s.effect),this.#t.delete(t),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[i,o]of this.#e){if(this.#e.delete(i),i===e)break;const c=this.#t.get(o);c&&(Le(c.effect),this.#t.delete(o))}for(const[i,o]of this.#s){if(i===t||this.#o.has(i))continue;const c=()=>{if(Array.from(this.#e.values()).includes(i)){var u=document.createDocumentFragment();ur(o,u),u.append(gt()),this.#t.set(i,{effect:o,fragment:u})}else Le(o);this.#o.delete(i),this.#s.delete(i)};this.#r||!r?(this.#o.add(i),Et(o,c,!1)):c()}}};#n=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[r,s]of this.#t)t.includes(r)||(Le(s.effect),this.#t.delete(r))};ensure(e,t){var r=ne,s=as();if(t&&!this.#s.has(e)&&!this.#t.has(e))if(s){var i=document.createDocumentFragment(),o=gt();i.append(o),this.#t.set(e,{effect:Be(()=>t(o)),fragment:i})}else this.#s.set(e,Be(()=>t(this.anchor)));if(this.#e.set(r,e),s){for(const[c,l]of this.#s)c===e?r.unskip_effect(l):r.skip_effect(l);for(const[c,l]of this.#t)c===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(this.#a),r.ondiscard(this.#n)}else this.#a(r)}}function ue(n,e,t=!1){var r=new ta(n),s=t?Dt:0;function i(o,c){r.ensure(o,c)}lr(()=>{var o=!1;e((c,l=0)=>{o=!0,i(l,c)}),o||i(-1,null)},s)}function na(n,e){return e}function ra(n,e,t){for(var r=[],s=e.length,i,o=e.length,c=0;c<s;c++){let d=e[c];Et(d,()=>{if(i){if(i.pending.delete(d),i.done.add(d),i.pending.size===0){var v=n.outrogroups;Xn(n,Mn(i.done)),v.delete(i),v.size===0&&(n.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&t!==null&&n.pending.size===0;if(l){var u=t,h=u.parentNode;Fi(h),h.append(u),n.items.clear()}Xn(n,e,!l)}else i={pending:new Set(e),done:new Set},(n.outrogroups??=new Set).add(i)}function Xn(n,e,t=!0){var r;if(n.pending.size>0){r=new Set;for(const o of n.pending.values())for(const c of o)r.add(n.items.get(c).e)}for(var s=0;s<e.length;s++){var i=e[s];if(r?.has(i)){i.f|=et;const o=document.createDocumentFragment();ur(i,o)}else Le(e[s],t)}}var wr;function De(n,e,t,r,s,i=null){var o=n,c=new Map,l=(e&Lr)!==0;if(l){var u=n;o=u.appendChild(gt())}var h=null,d=Kr(()=>{var N=t();return Nr(N)?N:N==null?[]:Mn(N)}),v=new Map,f=!0;function m(N){if((k.effect.f&Se)===0){k.pending.delete(N);var S=a(d);k.fallback=h,sa(k,S,o,e,r),h!==null&&(S.length===0?(h.f&et)===0?yn(h):(h.f^=et,Zt(h,null,o)):Et(h,()=>{h=null}))}}function O(N){k.pending.delete(N)}var b=lr(()=>{for(var N=a(d),S=N.length,$=new Set,Z=ne,q=as(),z=0;z<S;z+=1){var Q=N[z],ce=r(Q,z),P=f?null:c.get(ce);P?(P.v&&Ut(P.v,Q),P.i&&Ut(P.i,z),q&&Z.unskip_effect(P.e)):(P=ia(c,f?o:wr??=gt(),Q,ce,z,s,e,t),f||(P.e.f|=et),c.set(ce,P)),$.add(ce)}if(S===0&&i&&!h&&(f?h=Be(()=>i(o)):(h=Be(()=>i(wr??=gt())),h.f|=et)),S>$.size&&ii(),!f)if(v.set(Z,$),q){for(const[K,re]of c)$.has(K)||Z.skip_effect(re.e);Z.oncommit(m),Z.ondiscard(O)}else m(Z);a(d)}),k={effect:b,items:c,pending:v,outrogroups:null,fallback:h};f=!1}function Xt(n){for(;n!==null&&(n.f&Ze)===0;)n=n.next;return n}function sa(n,e,t,r,s){var i=(r&Ys)!==0,o=e.length,c=n.items,l=Xt(n.effect.first),u,h=null,d,v=[],f=[],m,O,b,k;if(i)for(k=0;k<o;k+=1)m=e[k],O=s(m,k),b=c.get(O).e,(b.f&et)===0&&(b.nodes?.a?.measure(),(d??=new Set).add(b));for(k=0;k<o;k+=1){if(m=e[k],O=s(m,k),b=c.get(O).e,n.outrogroups!==null)for(const P of n.outrogroups)P.pending.delete(b),P.done.delete(b);if((b.f&Oe)!==0&&(yn(b),i&&(b.nodes?.a?.unfix(),(d??=new Set).delete(b))),(b.f&et)!==0)if(b.f^=et,b===l)Zt(b,null,t);else{var N=h?h.next:l;b===n.effect.last&&(n.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),pt(n,h,b),pt(n,b,N),Zt(b,N,t),h=b,v=[],f=[],l=Xt(h.next);continue}if(b!==l){if(u!==void 0&&u.has(b)){if(v.length<f.length){var S=f[0],$;h=S.prev;var Z=v[0],q=v[v.length-1];for($=0;$<v.length;$+=1)Zt(v[$],S,t);for($=0;$<f.length;$+=1)u.delete(f[$]);pt(n,Z.prev,q.next),pt(n,h,Z),pt(n,q,S),l=S,h=q,k-=1,v=[],f=[]}else u.delete(b),Zt(b,l,t),pt(n,b.prev,b.next),pt(n,b,h===null?n.effect.first:h.next),pt(n,h,b),h=b;continue}for(v=[],f=[];l!==null&&l!==b;)(u??=new Set).add(l),f.push(l),l=Xt(l.next);if(l===null)continue}(b.f&et)===0&&v.push(b),h=b,l=Xt(b.next)}if(n.outrogroups!==null){for(const P of n.outrogroups)P.pending.size===0&&(Xn(n,Mn(P.done)),n.outrogroups?.delete(P));n.outrogroups.size===0&&(n.outrogroups=null)}if(l!==null||u!==void 0){var z=[];if(u!==void 0)for(b of u)(b.f&Oe)===0&&z.push(b);for(;l!==null;)(l.f&Oe)===0&&l!==n.fallback&&z.push(l),l=Xt(l.next);var Q=z.length;if(Q>0){var ce=(r&Lr)!==0&&o===0?t:null;if(i){for(k=0;k<Q;k+=1)z[k].nodes?.a?.measure();for(k=0;k<Q;k+=1)z[k].nodes?.a?.fix()}ra(n,z,ce)}}i&&ct(()=>{if(d!==void 0)for(b of d)b.nodes?.a?.apply()})}function ia(n,e,t,r,s,i,o,c){var l=(o&Hs)!==0?(o&Ws)===0?Ti(t,!1,!1):At(t):null,u=(o&Vs)!==0?At(s):null;return{v:l,i:u,e:Be(()=>(i(e,l??t,u??s,c),()=>{n.delete(r)}))}}function Zt(n,e,t){if(n.nodes)for(var r=n.nodes.start,s=n.nodes.end,i=e&&(e.f&et)===0?e.nodes.start:t;r!==null;){var o=cn(r);if(i.before(r),r===s)return;r=o}}function pt(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}const xr=[...`
\r\f \v\uFEFF`];function aa(n,e,t){var r=n==null?"":""+n;if(e&&(r=r?r+" "+e:e),t){for(var s of Object.keys(t))if(t[s])r=r?r+" "+s:s;else if(r.length)for(var i=s.length,o=0;(o=r.indexOf(s,o))>=0;){var c=o+i;(o===0||xr.includes(r[o-1]))&&(c===r.length||xr.includes(r[c]))?r=(o===0?"":r.substring(0,o))+r.substring(c+1):o=c}}return r===""?null:r}function kr(n,e=!1){var t=e?" !important;":";",r="";for(var s of Object.keys(n)){var i=n[s];i!=null&&i!==""&&(r+=" "+s+": "+i+t)}return r}function oa(n,e){if(e){var t="",r,s;return Array.isArray(e)?(r=e[0],s=e[1]):r=e,r&&(t+=kr(r)),s&&(t+=kr(s,!0)),t=t.trim(),t===""?null:t}return String(n)}function ut(n,e,t,r,s,i){var o=n[Ln];if(o!==t||o===void 0){var c=aa(t,r,i);c==null?n.removeAttribute("class"):n.className=c,n[Ln]=t}else if(i&&s!==i)for(var l in i){var u=!!i[l];(s==null||u!==!!s[l])&&n.classList.toggle(l,u)}return i}function Rn(n,e={},t,r){for(var s in t){var i=t[s];e[s]!==i&&(t[s]==null?n.style.removeProperty(s):n.style.setProperty(s,i,r))}}function $e(n,e,t,r){var s=n[Un];if(s!==e){var i=oa(e,r);i==null?n.removeAttribute("style"):n.style.cssText=i,n[Un]=e}else r&&(Array.isArray(r)?(Rn(n,t?.[0],r[0]),Rn(n,t?.[1],r[1],"important")):Rn(n,t,r));return r}const la=Symbol("is custom element"),ca=Symbol("is html"),ua=Bs?"progress":"PROGRESS";function Mr(n,e){var t=ks(n);t.value===(t.value=e??void 0)||n.value===e&&(e!==0||n.nodeName!==ua)||(n.value=e??"")}function x(n,e,t,r){var s=ks(n);s[e]!==(s[e]=t)&&(e==="loading"&&(n[js]=t),t==null?n.removeAttribute(e):typeof t!="string"&&fa(n).has(e)?n[e]=t:n.setAttribute(e,t))}function ks(n){return n[Dr]??={[la]:n.nodeName.includes("-"),[ca]:n.namespaceURI===ei}}var Er=new Map;function fa(n){var e=n.getAttribute("is")||n.nodeName,t=Er.get(e);if(t)return t;Er.set(e,t=new Set);for(var r,s=n,i=Element.prototype;i!==s;){r=$s(s);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&t.add(o);s=Or(s)}return t}function da(n,e,t=e){var r=new WeakSet;bi(n,"input",async s=>{var i=s?n.defaultValue:n.value;if(i=Nn(n)?$n(i):i,t(i),ne!==null&&r.add(ne),await ji(),i!==(i=e())){var o=n.selectionStart,c=n.selectionEnd,l=n.value.length;if(n.value=i??"",c!==null){var u=n.value.length;o===c&&c===l&&u>l?(n.selectionStart=u,n.selectionEnd=u):(n.selectionStart=o,n.selectionEnd=Math.min(c,u))}}}),vt(e)==null&&n.value&&(t(Nn(n)?$n(n.value):n.value),ne!==null&&r.add(ne)),or(()=>{var s=e();if(n===document.activeElement){var i=ne;if(r.has(i))return}Nn(n)&&s===$n(n.value)||n.type==="date"&&!s&&!n.value||s!==n.value&&(n.value=s??"")})}function Nn(n){var e=n.type;return e==="number"||e==="range"}function $n(n){return n===""?null:+n}class dr{#e=new WeakMap;#s;#t;static entries=new WeakMap;constructor(e){this.#t=e}observe(e,t){var r=this.#e.get(e)||new Set;return r.add(t),this.#e.set(e,r),this.#o().observe(e,this.#t),()=>{var s=this.#e.get(e);s.delete(t),s.size===0&&(this.#e.delete(e),this.#s.unobserve(e))}}#o(){return this.#s??(this.#s=new ResizeObserver(e=>{for(var t of e){dr.entries.set(t.target,t);for(var r of this.#e.get(t.target)||[])r(t)}}))}}var ha=new dr({box:"border-box"});function va(n,e,t){var r=ha.observe(n,()=>t(n[e]));cs(()=>(vt(()=>t(n[e])),r))}function On(n,e){return n===e||n?.[Jt]===e}function ft(n=tr(),e,t,r){var s=Ae.r,i=oe;return cs(()=>{var o,c;return or(()=>{o=c,c=[],vt(()=>{On(t(...c),n)||(e(n,...c),o&&On(t(...o),n)&&e(null,...o))})}),()=>{let l=i;for(;l!==s&&l.parent!==null&&l.parent.f&rn;)l=l.parent;const u=()=>{c&&On(t(...c),n)&&e(null,...c)},h=l.teardown;l.teardown=()=>{u(),h?.()}}}),n}let dn=!1;function pa(n){var e=dn;try{return dn=!1,[n(),dn]}finally{dn=e}}function tt(n,e,t,r){var s=!0,i=(t&Gs)!==0,o=(t&Zs)!==0,c=r,l=!0,u=void 0,h=()=>o&&s?(u??=sn(r),a(u)):(l&&(l=!1,c=o?vt(r):r),c);let d;if(i){var v=Jt in n||Us in n;d=$t(n,e)?.set??(v&&e in n?$=>n[e]=$:void 0)}var f,m=!1;i?[f,m]=pa(()=>n[e]):f=n[e],f===void 0&&r!==void 0&&(f=h(),d&&(ui(),d(f)));var O;if(O=()=>{var $=n[e];return $===void 0?h():(l=!0,$)},(t&Ks)===0)return O;if(d){var b=n.$$legacy;return(function($,Z){return arguments.length>0?((!Z||b||m)&&d(Z?O():$),$):O()})}var k=!1,N=((t&Xs)!==0?sn:Kr)(()=>(k=!1,O()));i&&a(N);var S=oe;return(function($,Z){if(arguments.length>0){const q=Z?a(N):i?ke($):$;return C(N,q),k=!0,c!==void 0&&(c=q),$}return dt&&k||(S.f&Se)!==0?N.v:a(N)})}function Yt(n){Ae===null&&Hr(),_t(()=>{const e=vt(n);if(typeof e=="function")return e})}function Ms(n){Ae===null&&Hr(),Yt(()=>()=>vt(n))}const Kn=1,zt={Webp:1,Jpeg:2,Rgba:3,Surface:4,Pcm:5},xn=16;function Es(n){if(n.byteLength<xn)return null;const e=new DataView(n),t=e.getUint8(8);return t<1||t>5?null:{frame:e.getUint32(0,!0),width:e.getUint16(4,!0),height:e.getUint16(6,!0),format:t,len:e.getUint32(12,!0)}}const ma={[zt.Jpeg]:"image/jpeg",[zt.Webp]:"image/webp"};async function ga(n){const e=Es(n);if(!e||e.format===zt.Pcm||e.format===zt.Surface)return null;const t=new Uint8Array(n,xn,e.len);let r;if(e.format===zt.Rgba){const s=new ImageData(new Uint8ClampedArray(t),e.width,e.height);r=await createImageBitmap(s)}else r=await createImageBitmap(new Blob([t],{type:ma[e.format]}));return{header:e,image:r}}function _a(n,e,t){const r=new URL(n,t);return r.protocol==="http:"&&(r.protocol="ws:"),r.protocol==="https:"&&(r.protocol="wss:"),e&&r.searchParams.set("token",e),r.toString()}const ba=4401,Ss="unauthorized";function ya(n,e,t){return Math.min(t,e*2**Math.max(0,n-1))}class wa{kind="ws";ws=null;handlers=null;attempt=0;timer=null;closed=!1;latestFrame=-1;decodeChain=Promise.resolve();url;min;max;WS;constructor(e){const t=typeof location<"u"?location.href:"http://127.0.0.1/";this.url=_a(e.url,e.token,t),this.min=e.minDelayMs??250,this.max=e.maxDelayMs??5e3,this.WS=e.WebSocketImpl??WebSocket}connect(e){this.handlers=e,this.closed=!1,this.open()}open(){const e=this.handlers;if(!e||this.closed)return;e.status(this.attempt===0?{state:"connecting"}:{state:"reconnecting",attempt:this.attempt,delayMs:0});const t=new this.WS(this.url);t.binaryType="arraybuffer",this.ws=t,t.onopen=()=>{this.attempt=0,e.status({state:"open"})},t.onmessage=r=>{if(typeof r.data=="string"){let o;try{o=JSON.parse(r.data)}catch{return}this.decodeChain=this.decodeChain.then(()=>e.event(o));return}const s=r.data,i=Es(s);if(i?.format===zt.Pcm){const o=Math.min(s.byteLength,xn+i.len),c=s.slice(xn,o);this.decodeChain=this.decodeChain.then(()=>e.audio?.({rate:i.width,pcm:c}));return}this.decodeChain=this.decodeChain.then(async()=>{const o=await ga(s);o&&(this.latestFrame=o.header.frame,e.frame(o))})},t.onclose=r=>{if(this.ws=null,this.closed)return;if(r?.code===ba){this.closed=!0,e.status({state:"closed",reason:Ss});return}this.attempt+=1;const s=ya(this.attempt,this.min,this.max);e.status({state:"reconnecting",attempt:this.attempt,delayMs:s}),this.timer=setTimeout(()=>this.open(),s)},t.onerror=()=>t.close()}send(e){this.ws?.readyState===1&&this.ws.send(JSON.stringify(e))}close(){this.closed=!0,this.timer&&clearTimeout(this.timer),this.ws?.close(),this.handlers?.status({state:"closed",reason:"closed by editor"})}get lastFrame(){return this.latestFrame}}class xa{kind="mock";h=null;frame=0;playing=null;viewport={w:640,h:360};selected=null;sent=[];notes=[];fps=30;size=[1920,1080];scenes=[{name:"intro",start:0,frames:60,transition:0,transition_at:0},{name:"outro",start:60,frames:60,transition:0,transition_at:0}];metas={intro:{version:1,markers:{beat:1},eases:{slide:[.65,0,.35,1]},tunables:{speed:1.5}},outro:{version:1,markers:{fade:.5},eases:{},tunables:{}}};get total(){return 120}connect(e){this.h=e,e.status({state:"connecting"}),queueMicrotask(()=>{e.status({state:"open"}),this.emitNotes()})}emit(e){this.h?.event(e)}noteEdit(e){if(e.type==="NoteAdd"){const t=this.notes.reduce((i,o)=>Math.max(i,o.id),0)+1,{crop_png:r,...s}=e;delete s.type,this.notes.push({...s,id:t,status:"open",crop:r?`${t}.png`:void 0,created:0})}else if(e.type==="NoteSet"){const t=this.notes.find(r=>r.id===e.id);t&&e.status&&(t.status=e.status)}else if(e.type==="NoteDelete")this.notes=this.notes.filter(t=>t.id!==e.id);else return!1;return this.emitNotes(),!0}emitNotes(){this.emit({type:"Notes",notes:this.notes})}inject(e){this.emit(e)}markers(){return Object.entries(this.metas).flatMap(([e,t])=>Object.entries(t.markers??{}).map(([r,s])=>({scene:e,name:r,time:s})))}timeline(){this.emit({type:"Timeline",frames:this.total,markers:this.markers(),scenes:this.scenes,audio_waveform:Array.from({length:240},(e,t)=>Math.abs(Math.sin(t/7))*.8),slides:[{scene:"intro",frame:30,notes:"Say hello."},{scene:"intro",frame:59,notes:"The square moves."},{scene:"outro",frame:119,notes:""}]})}squareX(e){return 200+e/this.total*1400}async show(){const e=this.frame;this.emit({type:"Frame",index:e});const[t,r]=this.size,s=Math.min(this.viewport.w/t,this.viewport.h/r,1),i=Math.max(1,Math.round(t*s)),o=Math.max(1,Math.round(r*s));let c=null;if(typeof OffscreenCanvas<"u"){const l=new OffscreenCanvas(i,o),u=l.getContext("2d");u.fillStyle="#141414",u.fillRect(0,0,i,o),u.fillStyle="#e13238",u.fillRect((this.squareX(e)-100)*s,440*s,200*s,200*s),u.fillStyle="#fff",u.font=`${Math.round(48*s)}px sans-serif`,u.fillText(`frame ${e}`,40*s,80*s),c=l.transferToImageBitmap()}if(c){const l={header:{frame:e,width:i,height:o,format:3,len:i*o*4},image:c};this.h?.frame(l)}if(this.selected!==null){const l=this.squareX(e);this.emit({type:"Signals",node_id:this.selected,values:[{name:"x",value:(l-960).toFixed(3)},{name:"y",value:"0.000"},{name:"fill",value:"#e13238ff"}],bounds:[l-100,440,l+100,440,l+100,640,l-100,640]})}}send(e){if(this.sent.push(e),!this.noteEdit(e))switch(e.type){case"Hello":if(e.protocol_version!==Kn){this.emit({type:"Error",kind:"Incompatible",message:"protocol mismatch",spans:[]});return}this.emit({type:"Ready",protocol_version:Kn,engine_version:"mock",fps:this.fps,size:this.size,scenes:this.scenes});for(const[t,r]of Object.entries(this.metas))this.emit({type:"MetaChanged",scene:t,meta:r});this.timeline(),this.emit({type:"Tree",nodes:[{id:0,parent:null,kind:"Group",name:"view"},{id:1,parent:0,kind:"Rect",name:"square"}]}),this.show();break;case"Seek":this.frame=Math.max(0,Math.min(this.total-1,e.frame)),this.show();break;case"Step":this.stopPlayback(),this.frame=Math.max(0,Math.min(this.total-1,this.frame+e.delta)),this.emit({type:"Playback",playing:!1,frame:this.frame}),this.show();break;case"Play":this.stopPlayback(),this.emit({type:"Playback",playing:!0,frame:this.frame}),this.playing=setInterval(()=>{this.frame=(this.frame+1)%this.total,this.show()},1e3/this.fps);break;case"Pause":this.stopPlayback(),this.emit({type:"Playback",playing:!1,frame:this.frame});break;case"SetViewport":this.viewport={w:e.w*e.dpr,h:e.h*e.dpr},this.show();break;case"SetMarker":{const t=e.scene??Object.keys(this.metas).find(s=>e.name in(this.metas[s]?.markers??{})),r=t?this.metas[t]:void 0;if(!t||!r){this.emit({type:"Error",kind:"Meta",message:`no marker named \`${e.name}\``,spans:[]});return}r.markers={...r.markers,[e.name]:e.time},this.emit({type:"MetaChanged",scene:t,meta:r}),this.timeline(),this.show();break}case"SetEase":case"SetTunable":{const t=this.metas.intro;e.type==="SetEase"?t.eases={...t.eases,[e.name]:e.value}:t.tunables={...t.tunables,[e.name]:e.value},this.emit({type:"MetaChanged",scene:"intro",meta:t}),this.show();break}case"Pick":{const t=this.squareX(this.frame),r=Math.abs(e.x-t)<=100&&Math.abs(e.y-540)<=100;this.selected=r?1:null,this.emit({type:"Selected",node_id:this.selected}),this.show();break}case"Select":this.selected=e.node_id??null,this.emit({type:"Selected",node_id:this.selected}),this.show();break;case"SetTransition":{const t=this.scenes.find(r=>r.name===e.scene);if(!t){this.emit({type:"Error",kind:"Meta",message:`no scene named \`${e.scene}\``,spans:[]});return}t.transition=Math.max(0,Math.round(e.seconds*this.fps)),this.timeline(),this.show();break}}}stopPlayback(){this.playing!==null&&clearInterval(this.playing),this.playing=null}close(){this.stopPlayback(),this.h?.status({state:"closed",reason:"closed"})}}const ka="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(ka);const Ma={"app.title":"oxframe","conn.connecting":"Connecting…","conn.open":"Connected","conn.reconnecting":"Reconnecting…","conn.closed":"Disconnected","conn.unauthorized":"Link expired: open the URL printed by `oxframe dev`","status.building":"Building…","status.reloaded":"Reloaded","status.incompatible":"Version mismatch","error.build":"Build failed","error.runtime":"Runtime error","error.meta":"Could not apply the edit","error.incompatible":"Incompatible versions","error.dismiss":"Dismiss","error.previous":"The previous version keeps running.","transport.play":"Play (Space)","transport.pause":"Pause (Space)","transport.prev":"Previous frame (, or < for 10)","transport.next":"Next frame (. or > for 10)","transport.start":"Go to start (Home)","transport.end":"Go to end (End)","timeline.label":"Timeline","timeline.marker":"Marker {name} at {time} s. Drag or use ←/→ to move.","timeline.addMarker":"Add marker at playhead (M)","timeline.transition":"Transition into {name}, {seconds} s. Drag the right edge to change it.","timeline.soundtrack":"Soundtrack {name}","inspector.tree":"Scene","inspector.signals":"Signals","inspector.noSelection":"Click a node in the viewport or the tree.","inspector.tunables":"Tunables","inspector.eases":"Eases","inspector.none":"None yet — use tune!() and ease!() in your scene.","curve.title":"Ease “{name}”","curve.presets":"Presets","curve.close":"Close","viewport.label":"Preview","viewport.axes":"Axes","viewport.fit":"Fit (double-click)","theme.toggle":"Toggle light/dark theme","help.title":"Shortcuts","help.keys":"Space play/pause · ←/→ 5 s · Shift+←/→ 1 s · ,/. frame · </> 10 frames · Home/End · M marker · wheel zoom · Alt/middle-drag pan"},Ea=Ma;function B(n,e={}){return Ea[n].replace(/\{(\w+)\}/g,(t,r)=>String(e[r]??`{${r}}`))}var Sa=G('<span class="chip ok svelte-yic9pk" data-testid="reloaded"> </span>'),Aa=G('<span class="dim svelte-yic9pk"> </span>'),Ta=G('<button class="comment" title="Mark something in the frame and write a note for the agent (C)" data-testid="comment-mode">Comment</button>'),Pa=G('<header class="svelte-yic9pk"><strong class="logo svelte-yic9pk"> </strong> <span role="status" aria-live="polite" data-testid="status"><span class="dot svelte-yic9pk" aria-hidden="true"></span> </span> <!> <span class="spacer svelte-yic9pk"></span> <!> <!> <button> </button> <button>1:1</button> <button> </button> <span class="help svelte-yic9pk">?</span></header>');function Ca(n,e){it(e,!0);let t=tt(e,"editor",7);const r=he(()=>{const q=t().connection;if(t().error?.kind==="Incompatible")return{cls:"bad",text:B("status.incompatible")};if(t().building)return{cls:"busy",text:B("status.building")};switch(q.state){case"open":return{cls:"ok",text:B("conn.open")};case"connecting":return{cls:"busy",text:B("conn.connecting")};case"reconnecting":return{cls:"busy",text:B("conn.reconnecting")};default:return{cls:"bad",text:q.reason===Ss?B("conn.unauthorized"):B("conn.closed")}}});let s=D(!1);_t(()=>{if(!t().reloadedAt)return;C(s,!0);const q=setTimeout(()=>C(s,!1),1500);return()=>clearTimeout(q)});var i=Pa(),o=V(i),c=Y(o,!0),l=y(o,2),u=y(V(l),1,!0),h=y(l,2);{var d=q=>{var z=Sa(),Q=Y(z,!0);ee(ce=>U(Q,ce),[()=>B("status.reloaded")]),j(q,z)};ue(h,q=>{a(s)&&q(d)})}var v=y(h,4);{var f=q=>{var z=Aa(),Q=Y(z);ee(()=>U(Q,`engine ${t().engineVersion??""} · ${t().size[0]??""}×${t().size[1]??""} · ${t().fps??""} fps`)),j(q,z)};ue(v,q=>{t().engineVersion&&q(f)})}var m=y(v,2);{var O=q=>{var z=Ta();ee(()=>x(z,"aria-pressed",t().commenting)),H("click",z,()=>t().toggleCommenting()),j(q,z)};ue(m,q=>{t().notes!==null&&q(O)})}var b=y(m,2),k=Y(b,!0),N=y(b,2),S=y(N,2),$=Y(S,!0),Z=y(S,2);ee((q,z,Q,ce,P,K,re,qe)=>{U(c,q),ut(l,1,`chip ${a(r).cls??""}`,"svelte-yic9pk"),U(u,a(r).text),x(b,"aria-pressed",t().showAxes),x(b,"title",z),U(k,Q),x(N,"title",ce),x(S,"title",P),x(S,"aria-label",K),U($,e.theme==="dark"?"☾":"☀"),x(Z,"title",re),x(Z,"aria-label",qe)},[()=>B("app.title"),()=>B("viewport.axes"),()=>B("viewport.axes"),()=>B("viewport.fit"),()=>B("theme.toggle"),()=>B("theme.toggle"),()=>B("help.keys"),()=>B("help.keys")]),H("click",b,()=>t().showAxes=!t().showAxes),H("click",N,()=>t().resetView()),H("click",S,function(...q){e.onToggleTheme?.apply(this,q)}),j(n,i),at()}wt(["click"]);function Gn(n,e,t,r,s){const o=Math.min(e.w/n[0],e.h/n[1])*t;return{scale:o,ox:e.w/2-n[0]*o/2+r,oy:e.h/2-n[1]*o/2+s}}function pn(n,e,t){return[(e-n.ox)/n.scale,(t-n.oy)/n.scale]}function Rt(n,e,t){return[n.ox+e*n.scale,n.oy+t*n.scale]}function Fa(n,e,t,r,s,i,o,c){const l=Gn(n,e,t,r,s),[u,h]=pn(l,o,c),d=Gn(n,e,i,0,0),[v,f]=Rt(d,u,h);return{panX:o-v,panY:c-f}}function Ra(n,e){const[t,r]=e,s=i=>Math.round(i*10)/10;return[s(n[0]-t/2),s(n[1]-r/2),s(n[2]-t/2),s(n[3]-r/2)]}function Na(n,e){const[t,r]=e;return[n[0]+t/2,n[1]+r/2,n[2]+t/2,n[3]+r/2]}function Zn(n,e,t,r){return[Math.min(n,t),Math.min(e,r),Math.max(n,t),Math.max(e,r)]}async function $a(n,e,t){if(typeof OffscreenCanvas>"u")return;const[r,s]=e,i=n.width/r,o=48,c=Math.max(0,t[0]-o),l=Math.max(0,t[1]-o),u=Math.min(r,t[2]+o),h=Math.min(s,t[3]+o),d=Math.max(1,Math.round((u-c)*i)),v=Math.max(1,Math.round((h-l)*i)),f=new OffscreenCanvas(d,v),m=f.getContext("2d");if(!m)return;m.drawImage(n,c*i,l*i,d,v,0,0,d,v),m.strokeStyle="#ff3b6b",m.lineWidth=Math.max(2,3*i),m.strokeRect((t[0]-c)*i,(t[1]-l)*i,(t[2]-t[0])*i,(t[3]-t[1])*i);const O=await f.convertToBlob({type:"image/png"}),b=new Uint8Array(await O.arrayBuffer());let k="";for(let N=0;N<b.length;N+=32768)k+=String.fromCharCode(...b.subarray(N,N+32768));return btoa(k)}function Oa(n,e,t){const r=.5/Math.max(1,t);return e>=n.time[0]-r&&e<=n.time[1]+r}var qa=G('<div class="note-area svelte-10js0q2"><span class="note-badge svelte-10js0q2"> </span></div>'),za=G('<div class="note-area drafting svelte-10js0q2"></div>'),Ia=G('<span class="dim svelte-10js0q2"> </span>'),Da=G('<div class="note-area drafting svelte-10js0q2"></div> <form class="note-form svelte-10js0q2" data-testid="note-form"><div class="note-meta svelte-10js0q2"> <!></div> <textarea rows="3" placeholder="What should change? (Ctrl+Enter to send)" aria-label="Note for the agent" data-testid="note-text" class="svelte-10js0q2"></textarea> <div class="note-actions svelte-10js0q2"><button type="button" title="Move the playhead, then press to cover the time up to it">Until playhead</button> <span class="spacer svelte-10js0q2"></span> <button type="button">Cancel</button> <button type="submit" class="primary svelte-10js0q2" data-testid="note-save">Add note</button></div></form>',1),La=fr('<svg viewBox="0 0 24 24" aria-hidden="true" class="svelte-10js0q2"><rect x="6" y="5" width="4" height="14" rx="1"></rect><rect x="14" y="5" width="4" height="14" rx="1"></rect></svg>'),Ua=fr('<svg viewBox="0 0 24 24" aria-hidden="true" class="svelte-10js0q2"><path d="M8 5.5v13l11-6.5z"></path></svg>'),ja=G('<button data-testid="center-play"><!></button>'),Ba=G('<div data-testid="viewport"><canvas class="svelte-10js0q2"></canvas> <!> <!> <!> <!> <span class="zoom svelte-10js0q2" aria-live="off"> </span></div>');function Ha(n,e){it(e,!0);let t=tt(e,"editor",7),r,s,i=D(ke({w:0,h:0}));const o=he(()=>Gn(t().size,a(i),t().zoom,t().panX,t().panY));Yt(()=>{const g=new ResizeObserver(([F])=>{if(!F)return;const{width:W,height:w}=F.contentRect;C(i,{w:Math.round(W),h:Math.round(w)},!0),t().setViewport(a(i).w,a(i).h)});return g.observe(r),()=>g.disconnect()}),_t(()=>{const g=s?.getContext("2d");if(!g)return;const F=typeof devicePixelRatio=="number"?devicePixelRatio:1,{w:W,h:w}=a(i);(s.width!==Math.round(W*F)||s.height!==Math.round(w*F))&&(s.width=Math.round(W*F),s.height=Math.round(w*F)),g.setTransform(F,0,0,F,0,0),g.clearRect(0,0,W,w);const[M,A]=t().size,T=a(o),I=t().image;g.fillStyle="#000",g.fillRect(T.ox,T.oy,M*T.scale,A*T.scale),I&&(g.imageSmoothingQuality="high",g.drawImage(I,T.ox,T.oy,M*T.scale,A*T.scale));const X=getComputedStyle(r).getPropertyValue("--m-accent")||"#6cb2eb";if(t().showAxes){const[R,E]=Rt(T,M/2,A/2);g.strokeStyle="rgba(255,255,255,0.25)",g.lineWidth=1,g.setLineDash([4,4]),g.beginPath(),g.moveTo(T.ox,E+.5),g.lineTo(T.ox+M*T.scale,E+.5),g.moveTo(R+.5,T.oy),g.lineTo(R+.5,T.oy+A*T.scale),g.stroke(),g.setLineDash([])}const se=t().bounds;if(se&&t().selected!==null){g.strokeStyle=X,g.lineWidth=2,g.beginPath();for(let R=0;R<4;R++){const[E,L]=Rt(T,se[2*R],se[2*R+1]);R===0?g.moveTo(E,L):g.lineTo(E,L)}g.closePath(),g.stroke()}});const c=he(()=>Rt(a(o),t().size[0]/2,t().size[1]/2));let l=D(!1),u;function h(){C(l,!0),clearTimeout(u),u=setTimeout(()=>C(l,!1),1500)}let d=null,v=D(null);function f(g){const[F,W]=Rt(a(o),g[0],g[1]),[w,M]=Rt(a(o),g[2],g[3]);return{left:F,top:W,width:Math.max(2,w-F),height:Math.max(2,M-W)}}const m=he(()=>(t().notes??[]).filter(g=>g.status==="open"&&g.bounds&&Oa(g,t().time,t().fps)));let O=D(null);_t(()=>{t().draft&&a(O)?.focus()});function b(g){g.key==="Enter"&&(g.ctrlKey||g.metaKey)?(g.preventDefault(),t().saveDraft()):g.key==="Escape"&&(g.preventDefault(),t().draft=null)}function k(g){const F=s.getBoundingClientRect();return[g.clientX-F.left,g.clientY-F.top]}function N(g){s.setPointerCapture(g.pointerId),d={x:g.clientX,y:g.clientY,px:t().panX,py:t().panY,moved:!1}}function S(g){if(h(),!d)return;const F=g.clientX-d.x,W=g.clientY-d.y;Math.abs(F)+Math.abs(W)>3&&(d.moved=!0);const w=g.altKey||g.buttons===4||g.buttons===2;if(d.moved&&w)t().setZoom(t().zoom,d.px+F,d.py+W);else if(d.moved&&t().commenting){const M=s.getBoundingClientRect(),[A,T]=pn(a(o),d.x-M.left,d.y-M.top),[I,X]=pn(a(o),g.clientX-M.left,g.clientY-M.top),[se,R]=t().size,E=(L,ie)=>Math.max(0,Math.min(ie,L));C(v,Zn(E(A,se),E(T,R),E(I,se),E(X,R)),!0)}}function $(g){const F=d;d=null;const W=a(v);if(C(v,null),t().commenting&&W&&g.button===0){W[2]-W[0]>8&&W[3]-W[1]>8&&t().startDraft(W);return}if(!F||F.moved||g.button!==0)return;const[w,M]=k(g),[A,T]=pn(a(o),w,M),[I,X]=t().size;if(A<0||T<0||A>I||T>X){t().select(null);return}t().commenting?t().startDraftAt(A,T):t().pick(A,T)}function Z(g){g.preventDefault();const[F,W]=k(g),w=Math.exp(-g.deltaY*.0015),M=Math.max(.1,Math.min(16,t().zoom*w)),A=Fa(t().size,a(i),t().zoom,t().panX,t().panY,M,F,W);t().setZoom(M,A.panX,A.panY)}var q=Ba();let z;var Q=V(q);ft(Q,g=>s=g,()=>s);var ce=y(Q,2);De(ce,17,()=>a(m),g=>g.id,(g,F)=>{const W=he(()=>f(Na(a(F).bounds,t().size)));var w=qa();let M;var A=V(w),T=Y(A,!0);ee(()=>{x(w,"data-testid",`note-area-${a(F).id??""}`),M=$e(w,"",M,{left:`${a(W).left??""}px`,top:`${a(W).top??""}px`,width:`${a(W).width??""}px`,height:`${a(W).height??""}px`}),x(A,"title",a(F).text),U(T,a(F).id)}),j(g,w)});var P=y(ce,2);{var K=g=>{const F=he(()=>f(a(v)));var W=za();let w;ee(()=>w=$e(W,"",w,{left:`${a(F).left??""}px`,top:`${a(F).top??""}px`,width:`${a(F).width??""}px`,height:`${a(F).height??""}px`})),j(g,W)};ue(P,g=>{a(v)&&g(K)})}var re=y(P,2);{var qe=g=>{const F=he(()=>t().draft),W=he(()=>f(a(F).rect));var w=Da(),M=Sn(w);let A;var T=y(M,2);let I;var X=V(T),se=V(X),R=y(se);{var E=pe=>{var _=Ia(),p=Y(_,!0);ee(()=>U(p,a(F).node.source)),j(pe,_)};ue(R,pe=>{a(F).node?.source&&pe(E)})}var L=y(X,2);ft(L,pe=>C(O,pe),()=>a(O));var ie=y(L,2),fe=V(ie),ve=y(fe,4),Te=y(ve,2);ee((pe,_,p,te,le)=>{A=$e(M,"",A,{left:`${a(W).left??""}px`,top:`${a(W).top??""}px`,width:`${a(W).width??""}px`,height:`${a(W).height??""}px`}),I=$e(T,"",I,{left:pe,top:_}),U(se,`${(a(F).node?a(F).node.label:"Area")??""} · ${p??""}${te??""} s `),Te.disabled=le},[()=>`${Math.max(8,Math.min(a(i).w-328,a(W).left))}px`,()=>`${Math.min(a(i).h-170,a(W).top+a(W).height+8)}px`,()=>a(F).time[0].toFixed(2),()=>a(F).time[1]>a(F).time[0]?`–${a(F).time[1].toFixed(2)}`:"",()=>!a(F).text.trim()]),Pt("submit",T,pe=>{pe.preventDefault(),t().saveDraft()}),H("keydown",L,b),da(L,()=>a(F).text,pe=>a(F).text=pe),H("click",fe,()=>t().draftUntilPlayhead()),H("click",ve,()=>t().draft=null),j(g,w)};ue(re,g=>{t().draft&&g(qe)})}var Re=y(re,2);{var Ye=g=>{var F=ja();let W,w;var M=V(F);{var A=I=>{var X=La();j(I,X)},T=I=>{var X=Ua();j(I,X)};ue(M,I=>{t().playing?I(A):I(T,-1)})}ee(()=>{W=ut(F,1,"center-play svelte-10js0q2",null,W,{shown:!t().playing||a(l)}),x(F,"aria-label",t().playing?"Pause":"Play"),x(F,"title",`${t().playing?"Pause":"Play"} (Space)`),w=$e(F,"",w,{left:`${a(c)[0]??""}px`,top:`${a(c)[1]??""}px`})}),H("click",F,()=>t().togglePlay()),H("pointermove",F,h),H("dblclick",F,I=>I.stopPropagation()),j(g,F)};ue(Re,g=>{t().ready&&t().frames>0&&!t().commenting&&g(Ye)})}var ze=y(Re,2),ot=Y(ze);ft(q,g=>r=g,()=>r),ee(g=>{z=ut(q,1,"viewport svelte-10js0q2",null,z,{commenting:t().commenting}),x(Q,"data-frame",t().imageFrame),x(Q,"aria-label",`frame ${t().imageFrame??""}`),U(ot,`${g??""}%`)},[()=>Math.round(t().zoom*100)]),H("pointerdown",Q,N),H("pointermove",Q,S),H("pointerup",Q,$),Pt("wheel",Q,Z),H("dblclick",Q,()=>t().resetView()),H("contextmenu",Q,g=>g.preventDefault()),j(n,q),at()}wt(["pointerdown","pointermove","pointerup","dblclick","contextmenu","keydown","click"]);const Nt=48e3,Va=.45,Ya=.25,Sr=.89;function kn(n){const e=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));return e>=0?n.slice(e+1):n}function Ar(n){const e=kn(n);return/^[A-Za-z0-9._-]+\.(wav|mp3|ogg|flac)$/.test(e)?`/audio/${e}`:null}function qn(n,e){return String.fromCharCode(n.getUint8(e),n.getUint8(e+1),n.getUint8(e+2),n.getUint8(e+3))}function Wa(n){if(n.byteLength<44)return null;const e=new DataView(n);if(qn(e,0)!=="RIFF"||qn(e,8)!=="WAVE")return null;let t=12,r=0,s=0,i=0,o=0,c=null;for(;t+8<=e.byteLength;){const v=qn(e,t),f=e.getUint32(t+4,!0),m=t+8;if(m+f>e.byteLength)break;v==="fmt "&&f>=16?(r=e.getUint16(m,!0),s=e.getUint16(m+2,!0),i=e.getUint32(m+4,!0),o=e.getUint16(m+14,!0)):v==="data"&&(c=n.slice(m,m+f)),t=m+f+f%2}if(r!==1||!c||s<1||i<1||o!==16&&o!==8)return null;const l=o/8,u=Math.floor(c.byteLength/(l*s)),h=new Float32Array(u),d=new DataView(c);for(let v=0;v<u;v++){let f=0;for(let m=0;m<s;m++){const O=(v*s+m)*l;f+=o===16?d.getInt16(O,!0)/32768:(d.getUint8(O)-128)/128}h[v]=f/s}return{rate:i,samples:h}}function Xa(n,e){const t=Math.max(1,Math.ceil(Math.max(0,e)*Nt)),r=new Float32Array(t),s=new Uint8Array(t);for(const o of n)o.priority&&Tr(o,t,c=>{s[c]=1});for(const o of n)Tr(o,t,(c,l)=>{const u=o.music?Va*(s[c]?Ya:1):1;r[c]=(r[c]??0)+l*u});let i=0;for(let o=0;o<t;o++)i=Math.max(i,Math.abs(r[o]??0));if(i>Sr){const o=Sr/i;for(let c=0;c<t;c++)r[c]=(r[c]??0)*o}return r}function Tr(n,e,t){const r=Math.round(n.start*Nt),s=n.seconds>0?Math.round(n.seconds*Nt):Math.ceil(n.samples.length*Nt/Math.max(1,n.rate)),i=n.rate/Nt;for(let o=0;o<s;o++){const c=r+o;if(c<0||c>=e)continue;const l=Math.floor(o*i);if(l>=n.samples.length)break;t(c,n.samples[l]??0)}}const Pr=new Map;function Ka(n){const e=Pr.get(n);if(e)return e;const t=(async()=>{try{const r=await fetch(n);return r.ok?Wa(await r.arrayBuffer()):null}catch{return null}})();return Pr.set(n,t),t}function Ga(n,e){const t=Math.max(1,e),r=new Array(t).fill(0);if(n.length===0)return r;for(let s=0;s<t;s++){const i=Math.floor(s*n.length/t),o=Math.max(i+1,Math.floor((s+1)*n.length/t));let c=0;for(let l=i;l<o&&l<n.length;l++)c=Math.max(c,Math.abs(n[l]??0));r[s]=c}return r}const As="oxframe-editor-view";function Za(n){const e=new URLSearchParams(n.replace(/^#/,"")),t=l=>{const u=e.get(l);if(u===null||u==="")return;const h=Number(u);return Number.isFinite(h)?h:void 0},r={},s=t("f");s!==void 0&&(r.frame=Math.max(0,Math.round(s)));const i=t("z");i!==void 0&&i>0&&(r.zoom=i);const o=t("px");o!==void 0&&(r.panX=o);const c=t("py");if(c!==void 0&&(r.panY=c),e.has("s")){const l=t("s");r.selected=l===void 0?null:l}return r}const Ja=new Set(["f","z","px","py","s"]);function Qa(n){return n.replace(/^#/,"").split("&").filter(e=>e!==""&&!Ja.has(e.split("=")[0]))}function eo(n,e=[]){const t=new URLSearchParams;return t.set("f",String(n.frame)),n.zoom!==1&&t.set("z",n.zoom.toFixed(3)),(n.panX!==0||n.panY!==0)&&(t.set("px",n.panX.toFixed(1)),t.set("py",n.panY.toFixed(1))),n.selected!==null&&t.set("s",String(n.selected)),`#${[...e,t.toString()].join("&")}`}function to(){let n={};try{n=JSON.parse(sessionStorage.getItem(As)??"{}")}catch{n={}}return{...n,...Za(typeof location>"u"?"":location.hash)}}function no(n){try{sessionStorage.setItem(As,JSON.stringify(n))}catch{}typeof history<"u"&&history.replaceState(history.state,"",`${location.pathname}${location.search}${eo(n,Qa(location.hash))}`)}const ro=15e3;function so(){return typeof performance>"u"?!1:performance.getEntriesByType?.("navigation")[0]?.type==="reload"}class io{constructor(e,t={}){if(this.backend=e,this.persistEnabled=t.persist??!0,this.uiVersion=t.uiVersion??"0.1.0",this.persistEnabled){const r=to();this.restoredFrame=so()?0:r.frame??null,this.zoom=r.zoom??1,this.panX=r.panX??0,this.panY=r.panY??0,this.selected=r.selected??null}}backend;#e=D(ke({state:"connecting"}));get connection(){return a(this.#e)}set connection(e){C(this.#e,e,!0)}#s=D(!1);get ready(){return a(this.#s)}set ready(e){C(this.#s,e,!0)}#t=D("");get engineVersion(){return a(this.#t)}set engineVersion(e){C(this.#t,e,!0)}#o=D(60);get fps(){return a(this.#o)}set fps(e){C(this.#o,e,!0)}#r=D(ke([1920,1080]));get size(){return a(this.#r)}set size(e){C(this.#r,e,!0)}#a=D(0);get frames(){return a(this.#a)}set frames(e){C(this.#a,e,!0)}#n=D(0);get frame(){return a(this.#n)}set frame(e){C(this.#n,e,!0)}#l=D(!1);get playing(){return a(this.#l)}set playing(e){C(this.#l,e,!0)}#i=D(ke([]));get scenes(){return a(this.#i)}set scenes(e){C(this.#i,e,!0)}#m=D(ke([]));get markers(){return a(this.#m)}set markers(e){C(this.#m,e,!0)}#c=D(null);get waveform(){return a(this.#c)}set waveform(e){C(this.#c,e)}#u=D(ke([]));get clips(){return a(this.#u)}set clips(e){C(this.#u,e,!0)}#d=D(ke([]));get slides(){return a(this.#d)}set slides(e){C(this.#d,e,!0)}#g=D(ke({}));get metas(){return a(this.#g)}set metas(e){C(this.#g,e,!0)}#f=D(ke([]));get tree(){return a(this.#f)}set tree(e){C(this.#f,e,!0)}#w=D(null);get selected(){return a(this.#w)}set selected(e){C(this.#w,e,!0)}#x=D(ke([]));get signals(){return a(this.#x)}set signals(e){C(this.#x,e,!0)}#_=D(null);get bounds(){return a(this.#_)}set bounds(e){C(this.#_,e,!0)}#b=D(!1);get building(){return a(this.#b)}set building(e){C(this.#b,e,!0)}#h=D(0);get reloadedAt(){return a(this.#h)}set reloadedAt(e){C(this.#h,e,!0)}#k=D(null);get error(){return a(this.#k)}set error(e){C(this.#k,e,!0)}#v=D(null);get image(){return a(this.#v)}set image(e){C(this.#v,e)}#y=D(-1);get imageFrame(){return a(this.#y)}set imageFrame(e){C(this.#y,e,!0)}#p=D(1);get zoom(){return a(this.#p)}set zoom(e){C(this.#p,e,!0)}#M=D(0);get panX(){return a(this.#M)}set panX(e){C(this.#M,e,!0)}#E=D(0);get panY(){return a(this.#E)}set panY(e){C(this.#E,e,!0)}#S=D(!0);get showAxes(){return a(this.#S)}set showAxes(e){C(this.#S,e,!0)}viewport={w:0,h:0};#A=D(null);get selectedMarker(){return a(this.#A)}set selectedMarker(e){C(this.#A,e,!0)}#T=D(null);get editingEase(){return a(this.#T)}set editingEase(e){C(this.#T,e,!0)}#P=D(null);get notes(){return a(this.#P)}set notes(e){C(this.#P,e,!0)}#C=D(!1);get commenting(){return a(this.#C)}set commenting(e){C(this.#C,e,!0)}#F=D(null);get draft(){return a(this.#F)}set draft(e){C(this.#F,e,!0)}draftPick=null;restoredFrame=null;rewoundAt=-1/0;persistEnabled;uiVersion;pcm=null;pcmFromEngine=!1;audioGen=0;audioCtx=null;audioNode=null;start(){this.backend.connect({event:e=>this.handle(e),frame:e=>this.onFrame(e),status:e=>this.onStatus(e),audio:e=>this.onPcm(e)})}stop(){this.backend.close()}send(e){this.backend.send(e)}onStatus(e){this.connection=e,e.state==="open"?(this.send({type:"Hello",protocol_version:Kn,ui_version:this.uiVersion}),this.send({type:"Pause"})):(this.ready=!1,this.playing=!1,this.stopAudio())}onFrame(e){this.image?.close?.(),this.image=e.image,this.imageFrame=e.header.frame}handle(e){const t=e;if(t.type==="Notes"){this.notes=t.notes??[];return}switch(e.type){case"Ready":this.ready=!0,this.engineVersion=e.engine_version,this.fps=e.fps,this.size=e.size,this.scenes=e.scenes,this.building=!1,this.error?.kind==="Incompatible"&&(this.error=null),this.resync();break;case"Reloaded":{const r=this.playing;this.playing=!1,this.reloadedAt=Date.now(),this.building=!1,this.error=null,this.stopAudio(),this.pcm=null,this.pcmFromEngine=!1,this.audioGen++,this.waveform=null,this.clips=[],this.reloadedAt-this.rewoundAt>=ro&&(this.rewoundAt=this.reloadedAt,this.restoredFrame=0),this.restoredFrame??=this.frame,this.resync(),r&&this.play();break}case"Building":this.building=!0;break;case"Error":this.building=!1,this.error={kind:e.kind,message:e.message,spans:e.spans??[]};break;case"Frame":this.playing&&e.index<this.frame&&this.startAudio(e.index),this.frame=e.index,this.savePersist();break;case"Playback":this.playing=e.playing,this.frame=e.frame,e.playing?this.startAudio(e.frame):this.stopAudio();break;case"Timeline":this.frames=e.frames,this.markers=e.markers,this.scenes=e.scenes,this.clips=e.audio_clips??[],this.slides=e.slides??[],e.audio_waveform&&(this.waveform=e.audio_waveform),this.loadHostedAudio();break;case"Tree":this.tree=e.nodes;break;case"Signals":e.node_id===this.selected&&(this.signals=e.values,this.bounds=e.bounds??null,this.draftPick&&e.bounds&&this.draftFromNode(e.node_id,e.bounds));break;case"Selected":if(this.selected=e.node_id,e.node_id===null&&this.draftPick){const{x:r,y:s}=this.draftPick;this.draftPick=null,this.startDraft(Zn(r-60,s-60,r+60,s+60))}e.node_id===null&&(this.signals=[],this.bounds=null),this.savePersist();break;case"MetaChanged":this.metas={...this.metas,[e.scene]:e.meta},this.error?.kind==="Meta"&&(this.error=null),this.loadHostedAudio();break}}resync(){this.viewport.w>0&&this.sendViewport();const e=this.restoredFrame??this.frame;this.restoredFrame=null,this.frame=e,this.send({type:"Seek",frame:e}),this.selected!==null&&this.send({type:"Select",node_id:this.selected})}restart(){this.pause(),this.playing=!1,this.restoredFrame=0,this.seek(0),this.savePersist()}get lastFrame(){return Math.max(0,this.frames-1)}seek(e){const t=Math.max(0,Math.min(this.lastFrame,Math.round(e)));this.frame=t,this.send({type:"Seek",frame:t}),this.playing&&this.startAudio(t)}seekBy(e){this.seek(this.frame+Math.round(e*this.fps))}onPcm(e){const t=new Int16Array(e.pcm),r=new Float32Array(t.length);for(let s=0;s<t.length;s++)r[s]=(t[s]??0)/32768;this.pcmFromEngine=!0,this.audioGen++,this.pcm={rate:e.rate,samples:r},this.playing&&this.startAudio(this.frame)}async loadHostedAudio(){if(this.pcmFromEngine||this.frames<=0||typeof fetch!="function")return;const e=this.hostedPlan();if(e.length===0)return;const t=++this.audioGen,r=new Map;for(const c of e){const l=Ar(c.file);if(!l||r.has(l))continue;const u=await Ka(l);u&&r.set(l,u)}if(t!==this.audioGen||this.pcmFromEngine)return;const s=[];for(const c of e){const l=r.get(Ar(c.file)??"");l&&s.push({samples:l.samples,rate:l.rate,start:c.start,seconds:c.seconds,music:c.music,priority:c.priority})}if(s.length===0)return;const i=this.frames/Math.max(1,this.fps),o=Xa(s,i);this.pcm={rate:Nt,samples:o},(!this.waveform||this.waveform.length===0)&&(this.waveform=Ga(o,Math.min(this.frames,4096))),this.playing&&this.startAudio(this.frame)}hostedPlan(){const e=[],t=new Set;for(const r of Object.values(this.metas)){const s=r.audio?.file;if(!s)continue;const i=kn(s);t.has(i)||(t.add(i),e.push({file:s,start:r.audio?.offset??0,seconds:0,music:!0,priority:!1}))}for(const r of this.clips)r.text||e.push({file:r.name,start:r.start,seconds:r.seconds,music:!1,priority:r.priority});return e}startAudio(e){this.stopAudio();const t=this.pcm;if(!t||t.samples.length===0||typeof AudioContext>"u")return;this.audioCtx??=new AudioContext;const r=this.audioCtx.createBuffer(1,t.samples.length,t.rate);r.getChannelData(0).set(t.samples);const s=this.audioCtx.createBufferSource();s.buffer=r,s.connect(this.audioCtx.destination);const i=Math.max(0,Math.min(r.duration,e/Math.max(1,this.fps)));s.start(0,i),this.audioNode=s}stopAudio(){const e=this.audioNode;if(this.audioNode=null,!!e)try{e.stop()}catch{}}play(){this.send({type:"Play"})}pause(){this.send({type:"Pause"})}togglePlay(){this.playing?this.pause():this.play()}step(e){this.send({type:"Step",delta:e})}setViewport(e,t){this.viewport={w:e,h:t},this.sendViewport()}sendViewport(){const e=typeof devicePixelRatio=="number"?devicePixelRatio:1;this.send({type:"SetViewport",w:Math.max(1,Math.round(this.viewport.w*this.zoom)),h:Math.max(1,Math.round(this.viewport.h*this.zoom)),dpr:e})}setZoom(e,t=this.panX,r=this.panY){const s=Math.max(.1,Math.min(16,e)),i=Math.abs(s-this.zoom)>1e-6;this.zoom=s,this.panX=t,this.panY=r,i&&this.viewport.w>0&&this.sendViewport(),this.savePersist()}resetView(){this.setZoom(1,0,0)}sceneStart(e){const t=this.scenes.find(r=>r.name===e);return t?t.start/this.fps:0}sceneAt(e){return[...this.scenes].reverse().find(t=>t.start<=e)??this.scenes[0]}markerFrame(e){return Math.round((this.sceneStart(e.scene)+e.time)*this.fps)}moveMarker(e,t,r){const s=Math.max(0,r/this.fps-this.sceneStart(e));this.send({type:"SetMarker",name:t,time:Number(s.toFixed(6)),scene:e})}markerAtPlayhead(){const e=this.sceneAt(this.frame);if(!e)return;if(this.selectedMarker){this.moveMarker(this.selectedMarker.scene,this.selectedMarker.name,this.frame);return}const t=new Set(this.markers.filter(i=>i.scene===e.name).map(i=>i.name));let r=1;for(;t.has(`marker-${r}`);)r+=1;const s=`marker-${r}`;this.moveMarker(e.name,s,this.frame),this.selectedMarker={scene:e.name,name:s}}setEase(e,t){this.send({type:"SetEase",name:e,value:t})}setTunable(e,t){this.send({type:"SetTunable",name:e,value:t})}setTransition(e,t){this.send({type:"SetTransition",scene:e,seconds:Number(Math.max(0,t).toFixed(6))})}pick(e,t){this.send({type:"Pick",x:e,y:t})}select(e){this.selected=e,this.send({type:"Select",node_id:e})}get time(){return this.frame/Math.max(1,this.fps)}toggleCommenting(){this.commenting=!this.commenting,this.draft=null,this.draftPick=null,this.commenting&&this.playing&&this.pause()}startDraft(e,t){const r=Number(this.time.toFixed(3));this.draft={rect:e,time:[r,r],node:t,text:""}}startDraftAt(e,t){this.draftPick={x:e,y:t},this.pick(e,t)}draftFromNode(e,t){this.draftPick=null;const r=[t[0],t[2],t[4],t[6]],s=[t[1],t[3],t[5],t[7]],i=this.tree.find(c=>c.id===e),o=i?i.name??i.kind:`#${e}`;this.startDraft(Zn(Math.min(...r),Math.min(...s),Math.max(...r),Math.max(...s)),{id:e,label:o,source:i?.source})}draftUntilPlayhead(){if(!this.draft)return;const e=Number(this.time.toFixed(3)),t=this.draft.time[0];this.draft.time=[Math.min(t,e),Math.max(t,e)]}async saveDraft(){const e=this.draft;if(!e||!e.text.trim())return;this.draft=null;const t=this.image?await $a(this.image,this.size,e.rect).catch(()=>{}):void 0,r=this.scenes.find(s=>this.frame>=s.start&&this.frame<s.start+s.frames);this.sendCli({type:"NoteAdd",text:e.text.trim(),time:e.time,scene:r?.name,node:e.node?.label,source:e.node?.source,bounds:Ra(e.rect,this.size),crop_png:t})}setNoteStatus(e,t){this.sendCli({type:"NoteSet",id:e,status:t})}deleteNote(e){this.sendCli({type:"NoteDelete",id:e})}goToNote(e){this.seek(Math.round(e.time[0]*this.fps))}noteCropUrl(e){if(!e.crop||typeof location>"u")return null;const t=new URLSearchParams(location.search).get("token")??"";return`/notes/${encodeURIComponent(e.crop)}?token=${encodeURIComponent(t)}`}sendCli(e){this.backend.send(e)}dismissError(){this.error=null}savePersist(){this.persistEnabled&&no({frame:this.frame,zoom:this.zoom,panX:this.panX,panY:this.panY,selected:this.selected})}}function Cr(n,e){const t=n/Math.max(1,e),r=Math.floor(t/60),s=Math.floor(t%60),i=n%Math.max(1,e);return`${r}:${String(s).padStart(2,"0")}.${String(i).padStart(2,"0")}`}var ao=G('<div class="transition svelte-112n2zp"><button class="trim svelte-112n2zp"></button></div>'),oo=G('<div class="scene svelte-112n2zp"><span> </span></div> <!>',1),lo=G('<div class="clip music svelte-112n2zp" data-testid="audio-track"><span class="svelte-112n2zp"> </span></div>'),co=G('<div data-testid="audio-clip"><span class="svelte-112n2zp"> </span></div>'),uo=G('<button class="note-span svelte-112n2zp"></button>'),fo=G('<button><span class="flag svelte-112n2zp"> </span></button>'),ho=G('<section class="timeline svelte-112n2zp"><div class="transport svelte-112n2zp"><button>⏮</button> <button>◀︎</button> <button class="play svelte-112n2zp" data-testid="play"> </button> <button>▶︎</button> <button>⏭</button> <span class="time svelte-112n2zp" data-testid="time"> </span> <span class="frame svelte-112n2zp" data-testid="frame"> </span> <span class="spacer svelte-112n2zp"></span> <button>+ M</button></div> <div role="slider" tabindex="0" data-testid="track"><div class="scenes svelte-112n2zp"></div> <!> <!> <canvas class="wave svelte-112n2zp" aria-hidden="true"></canvas> <!> <!> <div class="playhead svelte-112n2zp" aria-hidden="true"></div></div></section>');function vo(n,e){it(e,!0);let t=tt(e,"editor",7),r,s,i=D(0);const o=he(()=>Math.max(1,t().frames)),c=he(()=>{const _=[],p=new Set;for(const te of Object.values(t().metas)){const le=te.audio?.file;if(!le)continue;const J=kn(le);p.has(J)||(p.add(J),_.push({name:J,file:le,start:te.audio?.offset??0}))}return _}),l=_=>_/Math.max(1,a(o)-1)*a(i),u=_=>{const p=r.getBoundingClientRect(),te=Math.min(1,Math.max(0,(_-p.left)/Math.max(1,p.width)));return Math.round(te*(a(o)-1))};let h=!1,d=!1,v=null;function f(_){v=_,requestAnimationFrame(()=>{v!==null&&t().seek(v),v=null})}function m(_){const p=_.target;p.dataset.marker||p.closest("[data-transition]")||(h=!0,r.setPointerCapture(_.pointerId),d=t().playing,d&&t().pause(),f(u(_.clientX)))}function O(_){h&&f(u(_.clientX))}function b(){h&&(h=!1,d&&(d=!1,requestAnimationFrame(()=>t().play())))}let k=D(null);const N=_=>a(k)&&a(k).m.name===_.name&&a(k).m.scene===_.scene?a(k).frame:t().markerFrame(_);function S(_,p){_.stopPropagation(),_.target.setPointerCapture(_.pointerId),t().selectedMarker={scene:p.scene,name:p.name},C(k,{m:p,frame:t().markerFrame(p)},!0)}function $(_){a(k)&&C(k,{...a(k),frame:u(_.clientX)},!0)}function Z(){if(!a(k))return;const{m:_,frame:p}=a(k);C(k,null),p!==t().markerFrame(_)&&t().moveMarker(_.scene,_.name,p)}function q(_,p){const te=_.key==="ArrowLeft"?-1:_.key==="ArrowRight"?1:0;te?(_.preventDefault(),t().moveMarker(p.scene,p.name,t().markerFrame(p)+te*(_.shiftKey?10:1))):_.key==="Enter"&&t().seek(t().markerFrame(p))}let z=D(null);const Q=_=>a(z)&&a(z).name===_.name?a(z).frames:_.transition??0;function ce(_,p){_.stopPropagation(),_.currentTarget.setPointerCapture(_.pointerId),C(z,{name:p.name,frames:p.transition??0},!0)}function P(_,p){if(!a(z)||a(z).name!==p.name)return;const te=p.start+(p.transition_at??0);C(z,{name:p.name,frames:Math.max(0,u(_.clientX)-te)},!0)}function K(_){if(!a(z)||a(z).name!==_.name)return;const p=a(z).frames;C(z,null),p!==(_.transition??0)&&t().setTransition(_.name,p/t().fps)}_t(()=>{const _=t().waveform,p=s?.getContext("2d");if(!p)return;const te=devicePixelRatio||1,le=28;if(s.width=Math.max(1,Math.round(a(i)*te)),s.height=Math.round(le*te),p.setTransform(te,0,0,te,0,0),p.clearRect(0,0,a(i),le),!_||_.length===0)return;p.fillStyle=getComputedStyle(s).getPropertyValue("--m-wave")||"#4b5563";const J=_.length;for(let me=0;me<a(i);me++){const ye=_[Math.min(J-1,Math.floor(me/a(i)*J))]??0,we=Math.max(ye>.02?2:1,Math.pow(ye,.55)*le);p.fillRect(me,(le-we)/2,1,we)}});var re=ho(),qe=V(re),Re=V(qe),Ye=y(Re,2),ze=y(Ye,2),ot=Y(ze,!0),g=y(ze,2),F=y(g,2),W=y(F,2),w=Y(W,!0),M=y(W,2),A=Y(M),T=y(M,4),I=y(qe,2);let X;x(I,"aria-valuemin",0);var se=V(I);De(se,21,()=>t().scenes,_=>_.name,(_,p)=>{var te=oo(),le=Sn(te);let J;var me=V(le),ye=Y(me,!0),we=y(le,2);{var Ne=Pe=>{var Ce=ao();let Ct;var Je=Y(Ce);ee((de,ge,Wt,Rs)=>{x(Ce,"data-transition",a(p).name),x(Ce,"data-testid",`transition-${a(p).name??""}`),x(Ce,"title",de),Ct=$e(Ce,"",Ct,{left:ge,width:Wt}),x(Je,"data-transition",a(p).name),x(Je,"aria-label",Rs)},[()=>B("timeline.transition",{name:a(p).name,seconds:(Q(a(p))/t().fps).toFixed(2)}),()=>`${l(a(p).start+(a(p).transition_at??0))??""}px`,()=>`${Math.max(8,l(a(p).start+(a(p).transition_at??0)+Q(a(p)))-l(a(p).start+(a(p).transition_at??0)))}px`,()=>B("timeline.transition",{name:a(p).name,seconds:(Q(a(p))/t().fps).toFixed(2)})]),H("pointerdown",Je,de=>ce(de,a(p))),H("pointermove",Je,de=>P(de,a(p))),H("pointerup",Je,()=>K(a(p))),j(Pe,Ce)},Ee=he(()=>Q(a(p))>0);ue(we,Pe=>{a(Ee)&&Pe(Ne)})}ee((Pe,Ce)=>{x(le,"title",a(p).name),J=$e(le,"",J,{left:Pe,width:Ce}),U(ye,a(p).name)},[()=>`${l(a(p).start)??""}px`,()=>`${Math.max(0,l(a(p).start+a(p).frames-1)-l(a(p).start))}px`]),j(_,te)});var R=y(se,2);De(R,17,()=>a(c),_=>_.name,(_,p,te,le)=>{var J=lo();let me;var ye=V(J),we=Y(ye,!0);ee((Ne,Ee,Pe)=>{x(J,"title",Ne),me=$e(J,"",me,{left:Ee,width:Pe}),U(we,a(p).name)},[()=>B("timeline.soundtrack",{name:a(p).file}),()=>`${l(a(p).start*t().fps)??""}px`,()=>`${Math.max(2,a(i)-l(a(p).start*t().fps))}px`]),j(_,J)});var E=y(R,2);De(E,19,()=>t().clips,(_,p)=>_.name+":"+p,(_,p)=>{var te=co();let le,J;var me=V(te),ye=Y(me,!0);ee((we,Ne,Ee)=>{le=ut(te,1,"clip svelte-112n2zp",null,le,{effect:a(c).length>0,priority:a(p).priority}),x(te,"title",a(p).text??a(p).name),J=$e(te,"",J,{left:we,width:Ne}),U(ye,Ee)},[()=>`${l(a(p).start*t().fps)??""}px`,()=>`${Math.max(2,l((a(p).start+a(p).seconds)*t().fps)-l(a(p).start*t().fps))}px`,()=>a(p).text??kn(a(p).name)]),j(_,te)});var L=y(E,2);let ie;ft(L,_=>s=_,()=>s);var fe=y(L,2);De(fe,17,()=>(t().notes??[]).filter(_=>_.status==="open"),_=>_.id,(_,p)=>{const te=he(()=>Math.round(a(p).time[0]*t().fps)),le=he(()=>Math.round(a(p).time[1]*t().fps));var J=uo();let me;ee((ye,we,Ne)=>{x(J,"title",`#${a(p).id??""} · ${a(p).text??""}`),x(J,"aria-label",`Note ${a(p).id??""} at ${ye??""} s: ${a(p).text??""}`),x(J,"data-testid",`note-tick-${a(p).id??""}`),me=$e(J,"",me,{left:we,width:Ne})},[()=>a(p).time[0].toFixed(2),()=>`${l(a(te))??""}px`,()=>`${Math.max(6,l(a(le))-l(a(te)))}px`]),H("click",J,()=>t().goToNote(a(p))),j(_,J)});var ve=y(fe,2);De(ve,17,()=>t().markers,_=>_.scene+"/"+_.name,(_,p)=>{const te=he(()=>N(a(p))),le=he(()=>t().selectedMarker?.name===a(p).name&&t().selectedMarker?.scene===a(p).scene);var J=fo();let me,ye;var we=V(J),Ne=Y(we,!0);ee((Ee,Pe,Ce)=>{me=ut(J,1,"marker svelte-112n2zp",null,me,{selected:a(le)}),x(J,"data-marker",a(p).name),x(J,"data-testid",`marker-${a(p).name??""}`),x(J,"aria-label",Ee),x(J,"title",`${a(p).name??""} · ${Pe??""} s`),ye=$e(J,"",ye,{left:Ce}),U(Ne,a(p).name)},[()=>B("timeline.marker",{name:a(p).name,time:(a(te)/t().fps).toFixed(2)}),()=>(a(te)/t().fps).toFixed(2),()=>`${l(a(te))??""}px`]),H("pointerdown",J,Ee=>S(Ee,a(p))),H("pointermove",J,$),H("pointerup",J,Z),H("keydown",J,Ee=>q(Ee,a(p))),Pt("focus",J,()=>t().selectedMarker={scene:a(p).scene,name:a(p).name}),j(_,J)});var Te=y(ve,2);let pe;ft(I,_=>r=_,()=>r),ee((_,p,te,le,J,me,ye,we,Ne,Ee,Pe,Ce,Ct,Je,de,ge)=>{x(re,"aria-label",_),x(Re,"title",p),x(Re,"aria-label",te),x(Ye,"title",le),x(Ye,"aria-label",J),x(ze,"title",me),x(ze,"aria-label",ye),U(ot,t().playing?"❚❚":"▶"),x(g,"title",we),x(g,"aria-label",Ne),x(F,"title",Ee),x(F,"aria-label",Pe),U(w,Ce),U(A,`${t().frame??""} / ${t().lastFrame??""}`),x(T,"title",Ct),X=ut(I,1,"track svelte-112n2zp",null,X,{"with-music":a(c).length>0}),x(I,"aria-label",Je),x(I,"aria-valuemax",t().lastFrame),x(I,"aria-valuenow",t().frame),x(I,"aria-valuetext",de),ie=$e(L,"",ie,{width:`${a(i)??""}px`}),pe=$e(Te,"",pe,{left:ge})},[()=>B("timeline.label"),()=>B("transport.start"),()=>B("transport.start"),()=>B("transport.prev"),()=>B("transport.prev"),()=>t().playing?B("transport.pause"):B("transport.play"),()=>t().playing?B("transport.pause"):B("transport.play"),()=>B("transport.next"),()=>B("transport.next"),()=>B("transport.end"),()=>B("transport.end"),()=>Cr(t().frame,t().fps),()=>B("timeline.addMarker"),()=>B("timeline.label"),()=>Cr(t().frame,t().fps),()=>`${l(t().frame)??""}px`]),H("click",Re,()=>t().seek(0)),H("click",Ye,()=>t().step(-1)),H("click",ze,()=>t().togglePlay()),H("click",g,()=>t().step(1)),H("click",F,()=>t().seek(t().lastFrame)),H("click",T,()=>t().markerAtPlayhead()),H("pointerdown",I,m),H("pointermove",I,O),H("pointerup",I,b),Pt("pointercancel",I,b),va(I,"clientWidth",_=>C(i,_)),j(n,re),at()}wt(["click","pointerdown","pointermove","pointerup","keydown"]);var po=G(`<p class="dim svelte-gu3dqx">Press <kbd>C</kbd>, then click or drag in the frame. <code>oxframe check</code> gives open notes
to the agent first.</p>`),mo=G('<img loading="lazy" class="svelte-gu3dqx"/>'),go=G('<p class="note-reply svelte-gu3dqx"> </p>'),_o=G("<button>Resolve</button>"),bo=G('<span class="dim svelte-gu3dqx">done</span> <button>Reopen</button>',1),yo=G('<li><button class="note-go svelte-gu3dqx" title="Go to the note"><span class="note-id svelte-gu3dqx"> </span> <!></button> <p class="note-text svelte-gu3dqx"> </p> <!> <!> <div class="note-row svelte-gu3dqx"><!> <button>Delete</button></div></li>'),wo=G('<ol class="notes svelte-gu3dqx"></ol>'),xo=G('<section data-testid="notes" class="svelte-gu3dqx"><h2 class="svelte-gu3dqx">Notes for the agent</h2> <!></section>'),ko=G('<span class="name"> </span>'),Mo=G('<li role="treeitem"><button><span class="kind svelte-gu3dqx"> </span> <!> <span class="id svelte-gu3dqx"> </span></button></li>'),zn=G('<p class="dim svelte-gu3dqx"> </p>'),Eo=G('<span class="swatch svelte-gu3dqx"></span>'),So=G('<tr><th scope="row" class="svelte-gu3dqx"> </th><td class="svelte-gu3dqx"><!> </td></tr>'),Ao=G('<table data-testid="signals" class="svelte-gu3dqx"><tbody></tbody></table>'),To=G('<label class="tunable svelte-gu3dqx"><span class="svelte-gu3dqx"> </span> <input type="range"/> <input type="number"/></label>'),Po=G('<button class="ease svelte-gu3dqx"><svg viewBox="-2 -2 28 28" width="28" height="28" aria-hidden="true" class="svelte-gu3dqx"><path fill="none" stroke="currentColor" stroke-width="2"></path></svg> <span> </span> <code class="svelte-gu3dqx"> </code></button>'),Co=G('<aside class="inspector svelte-gu3dqx"><!> <section class="svelte-gu3dqx"><h2 class="svelte-gu3dqx"> </h2> <ul class="tree svelte-gu3dqx" role="tree" data-testid="tree"></ul></section> <section class="svelte-gu3dqx"><h2 class="svelte-gu3dqx"> </h2> <!></section> <section class="svelte-gu3dqx"><h2 class="svelte-gu3dqx"> </h2> <!> <!></section> <section class="svelte-gu3dqx"><h2 class="svelte-gu3dqx"> </h2> <!> <!></section></aside>');function Fo(n,e){it(e,!0);let t=tt(e,"editor",7);const r=he(()=>{const w=new Map(t().tree.map(A=>[A.id,A])),M=A=>{let T=0,I=A.parent;for(;I!=null&&T<64;)T+=1,I=w.get(I)?.parent??null;return T};return t().tree.map(A=>({n:A,depth:M(A)}))}),s=he(()=>Object.entries(t().metas).flatMap(([w,M])=>Object.entries(M.tunables??{}).map(([A,T])=>({scene:w,name:A,value:T})))),i=he(()=>Object.entries(t().metas).flatMap(([w,M])=>Object.entries(M.eases??{}).map(([A,T])=>({scene:w,name:A,value:T}))));function o(w){const M=w===0?10:Math.abs(w)*2,A=w>=0?0:w-M,T=w>=0?Math.max(w*2,1):w+M;return[A,T,(T-A)/200]}const c=new Map;function l(w,M){clearTimeout(c.get(w)),c.set(w,setTimeout(()=>t().setTunable(w,M),60))}const u=new Map;function h(w,M){return u.has(w)||u.set(w,o(M)),u.get(w)}function d(w){const[M=0,A=0,T=1,I=1]=w,X=24;return`M0 ${X} C${M*X} ${X-A*X} ${T*X} ${X-I*X} ${X} 0`}var v=Co(),f=V(v);{var m=w=>{var M=xo(),A=y(V(M),2);{var T=X=>{var se=po();j(X,se)},I=X=>{var se=wo();De(se,21,()=>t().notes,R=>R.id,(R,E)=>{const L=he(()=>t().noteCropUrl(a(E)));var ie=yo();let fe;var ve=V(ie),Te=V(ve),pe=Y(Te),_=y(Te),p=y(_);{var te=de=>{var ge=Wn();ee(()=>U(ge,`· ${a(E).node??""}`)),j(de,ge)};ue(p,de=>{a(E).node&&de(te)})}var le=y(ve,2),J=Y(le,!0),me=y(le,2);{var ye=de=>{var ge=mo();ee(()=>{x(ge,"src",a(L)),x(ge,"alt",`The marked area of note ${a(E).id??""}`)}),j(de,ge)};ue(me,de=>{a(L)&&de(ye)})}var we=y(me,2);{var Ne=de=>{var ge=go(),Wt=Y(ge);ee(()=>{x(ge,"data-testid",`note-reply-${a(E).id??""}`),U(Wt,`↳ ${a(E).reply??""}`)}),j(de,ge)};ue(we,de=>{a(E).reply&&de(Ne)})}var Ee=y(we,2),Pe=V(Ee);{var Ce=de=>{var ge=_o();H("click",ge,()=>t().setNoteStatus(a(E).id,"done")),j(de,ge)},Ct=de=>{var ge=bo(),Wt=y(Sn(ge),2);H("click",Wt,()=>t().setNoteStatus(a(E).id,"open")),j(de,ge)};ue(Pe,de=>{a(E).status==="open"?de(Ce):de(Ct,-1)})}var Je=y(Pe,2);ee((de,ge)=>{x(ie,"data-testid",`note-${a(E).id??""}`),fe=ut(ie,1,"svelte-gu3dqx",null,fe,{done:a(E).status==="done"}),U(pe,`#${a(E).id??""}`),U(_,` ${de??""}${ge??""} s `),U(J,a(E).text),x(Je,"aria-label",`Delete note ${a(E).id??""}`)},[()=>a(E).time[0].toFixed(2),()=>a(E).time[1]>a(E).time[0]?`–${a(E).time[1].toFixed(2)}`:""]),H("click",ve,()=>t().goToNote(a(E))),H("click",Je,()=>t().deleteNote(a(E).id)),j(R,ie)}),j(X,se)};ue(A,X=>{t().notes.length===0?X(T):X(I,-1)})}j(w,M)};ue(f,w=>{t().notes!==null&&w(m)})}var O=y(f,2),b=V(O),k=Y(b,!0),N=y(b,2);De(N,21,()=>a(r),({n:w,depth:M})=>w.id,(w,M)=>{let A=()=>a(M).n,T=()=>a(M).depth;var I=Mo(),X=V(I);let se,R;var E=V(X),L=Y(E,!0),ie=y(E,2);{var fe=pe=>{var _=ko(),p=Y(_,!0);ee(()=>U(p,A().name)),j(pe,_)};ue(ie,pe=>{A().name&&pe(fe)})}var ve=y(ie,2),Te=Y(ve);ee(()=>{x(I,"aria-selected",t().selected===A().id),se=ut(X,1,"node svelte-gu3dqx",null,se,{sel:t().selected===A().id}),R=$e(X,"",R,{"padding-left":`${8+T()*12}px`}),U(L,A().kind),U(Te,`#${A().id??""}`)}),H("click",X,()=>t().select(A().id===t().selected?null:A().id)),j(w,I)});var S=y(O,2),$=V(S),Z=Y($,!0),q=y($,2);{var z=w=>{var M=zn(),A=Y(M,!0);ee(T=>U(A,T),[()=>B("inspector.noSelection")]),j(w,M)},Q=w=>{var M=Ao(),A=V(M);De(A,21,()=>t().signals,T=>T.name,(T,I)=>{var X=So(),se=V(X),R=Y(se,!0),E=y(se),L=V(E);{var ie=Te=>{var pe=Eo();let _;ee(()=>_=$e(pe,"",_,{background:a(I).value})),j(Te,pe)},fe=he(()=>/^#[0-9a-f]{8}$/i.test(a(I).value));ue(L,Te=>{a(fe)&&Te(ie)})}var ve=y(L);ee(()=>{U(R,a(I).name),U(ve,` ${a(I).value??""}`)}),j(T,X)}),j(w,M)};ue(q,w=>{t().selected===null?w(z):w(Q,-1)})}var ce=y(S,2),P=V(ce),K=Y(P,!0),re=y(P,2);{var qe=w=>{var M=zn(),A=Y(M,!0);ee(T=>U(A,T),[()=>B("inspector.none")]),j(w,M)};ue(re,w=>{a(s).length===0&&w(qe)})}var Re=y(re,2);De(Re,17,()=>a(s),w=>w.scene+w.name,(w,M)=>{const A=he(()=>{const[E,L,ie]=h(a(M).name,a(M).value);return{min:E,max:L,step:ie}});var T=To(),I=V(T),X=Y(I,!0),se=y(I,2),R=y(se,2);ee(()=>{U(X,a(M).name),x(se,"min",a(A).min),x(se,"max",a(A).max),x(se,"step",a(A).step),Mr(se,a(M).value),x(se,"data-testid",`tunable-${a(M).name??""}`),x(R,"step",a(A).step),Mr(R,a(M).value),x(R,"aria-label",`${a(M).name??""} value`)}),H("input",se,E=>l(a(M).name,+E.currentTarget.value)),H("change",R,E=>t().setTunable(a(M).name,+E.currentTarget.value)),j(w,T)});var Ye=y(ce,2),ze=V(Ye),ot=Y(ze,!0),g=y(ze,2);{var F=w=>{var M=zn(),A=Y(M,!0);ee(T=>U(A,T),[()=>B("inspector.none")]),j(w,M)};ue(g,w=>{a(i).length===0&&w(F)})}var W=y(g,2);De(W,17,()=>a(i),w=>w.scene+w.name,(w,M)=>{var A=Po(),T=V(A),I=Y(T),X=y(T,2),se=Y(X,!0),R=y(X,2),E=Y(R,!0);ee((L,ie)=>{x(A,"data-testid",`ease-${a(M).name??""}`),x(I,"d",L),U(se,a(M).name),U(E,ie)},[()=>d(a(M).value),()=>a(M).value.map(L=>L.toFixed(2)).join(", ")]),H("click",A,()=>t().editingEase={scene:a(M).scene,name:a(M).name}),j(w,A)}),ee((w,M,A,T)=>{U(k,w),U(Z,M),U(K,A),U(ot,T)},[()=>B("inspector.tree"),()=>B("inspector.signals"),()=>B("inspector.tunables"),()=>B("inspector.eases")]),j(n,v),at()}wt(["click","input","change"]);var Ro=G('<span class="dim svelte-1qw5yfa"> </span>'),No=G("<li><code> </code> </li>"),$o=G('<ul class="svelte-1qw5yfa"></ul>'),Oo=G('<div class="overlay svelte-1qw5yfa" role="alert" data-testid="error-overlay"><header class="svelte-1qw5yfa"><strong class="svelte-1qw5yfa"> </strong> <!> <button class="svelte-1qw5yfa"> </button></header> <!> <pre class="svelte-1qw5yfa"> </pre></div>');function qo(n,e){it(e,!0);const t=he(()=>e.editor.error),r=he(()=>a(t).kind==="Build"?B("error.build"):a(t).kind==="Incompatible"?B("error.incompatible"):a(t).kind==="Meta"?B("error.meta"):B("error.runtime"));var s=Oo(),i=V(s),o=V(i),c=Y(o,!0),l=y(o,2);{var u=b=>{var k=Ro(),N=Y(k,!0);ee(S=>U(N,S),[()=>B("error.previous")]),j(b,k)};ue(l,b=>{a(t).kind==="Build"&&b(u)})}var h=y(l,2),d=Y(h,!0),v=y(i,2);{var f=b=>{var k=$o();De(k,21,()=>a(t).spans,na,(N,S)=>{var $=No(),Z=V($),q=Y(Z),z=y(Z);ee(()=>{U(q,`${a(S).file??""}:${a(S).line??""}:${a(S).column??""}`),U(z,` ${a(S).message??""}`)}),j(N,$)}),j(b,k)};ue(v,b=>{a(t).spans.length&&b(f)})}var m=y(v,2),O=Y(m,!0);ee(b=>{U(c,a(r)),U(d,b),U(O,a(t).message)},[()=>B("error.dismiss")]),H("click",h,()=>e.editor.dismissError()),j(n,s),at()}wt(["click"]);function zo(n,e,t,r){const s=3*n,i=3*(t-n)-s,o=1-s-i,c=3*e,l=3*(r-e)-c,u=1-c-l,h=f=>((o*f+i)*f+s)*f,d=f=>((u*f+l)*f+c)*f,v=f=>(3*o*f+2*i)*f+s;return f=>{if(f<=0)return 0;if(f>=1)return 1;let m=f;for(let k=0;k<8;k++){const N=h(m)-f;if(Math.abs(N)<1e-7)return d(m);const S=v(m);if(Math.abs(S)<1e-6)break;m=Math.min(1,Math.max(0,m-N/S))}let O=0,b=1;m=f;for(let k=0;k<40;k++){const N=h(m);if(Math.abs(N-f)<1e-7)break;N<f?O=m:b=m,m=(O+b)/2}return d(m)}}const Fr={linear:[0,0,1,1],ease:[.25,.1,.25,1],"in-out-cubic":[.65,0,.35,1],"in-cubic":[.32,0,.67,0],"out-cubic":[.33,1,.68,1],"in-out-sine":[.37,0,.63,1],"in-out-expo":[.87,0,.13,1],"out-back":[.34,1.56,.64,1],"in-out-back":[.68,-.6,.32,1.6]};var Io=fr('<circle r="8" class="handle svelte-12hhbkq" tabindex="0" role="slider"></circle>'),Do=G("<option> </option>"),Lo=G('<div class="backdrop svelte-12hhbkq" role="presentation"></div> <div class="dialog svelte-12hhbkq" role="dialog" aria-modal="true" data-testid="curve-editor"><header class="svelte-12hhbkq"><strong> </strong> <button> </button></header> <svg role="group" class="svelte-12hhbkq"><rect class="unit svelte-12hhbkq"></rect><line class="arm svelte-12hhbkq"></line><line class="arm svelte-12hhbkq"></line><path class="curve svelte-12hhbkq"></path><circle r="4" class="fixed svelte-12hhbkq"></circle><circle r="4" class="fixed svelte-12hhbkq"></circle><!><circle r="5" class="dot svelte-12hhbkq"></circle></svg> <div class="row svelte-12hhbkq"><label> <select><option>—</option><!></select></label> <code class="svelte-12hhbkq"> </code></div></div>',1);function Uo(n,e){it(e,!0);let t=tt(e,"editor",7);const r=he(()=>t().editingEase),s=he(()=>t().metas[a(r).scene]?.eases?.[a(r).name]??[.65,0,.35,1]);let i=he(()=>[a(s)[0]??0,a(s)[1]??0,a(s)[2]??1,a(s)[3]??1]);const o=240,c=20,l=R=>c+R*o,u=R=>c+(1.5-R)*(o/2),h=(R,E)=>[Math.min(1,Math.max(0,(R-c)/o)),Math.min(1.5,Math.max(-.5,1.5-(E-c)/(o/2)))];let d,v=null,f;function m(){clearTimeout(f),f=setTimeout(()=>t().setEase(a(r).name,[...a(i)]),80)}function O(R){if(v===null)return;const E=d.getBoundingClientRect(),L=(c*2+o)/E.width,[ie,fe]=h((R.clientX-E.left)*L,(R.clientY-E.top)*L),ve=[...a(i)];ve[v*2]=Number(ie.toFixed(3)),ve[v*2+1]=Number(fe.toFixed(3)),C(i,ve),m()}function b(R,E){const L=R.shiftKey?.1:.01,fe={ArrowLeft:[-L,0],ArrowRight:[L,0],ArrowUp:[0,L],ArrowDown:[0,-L]}[R.key];if(!fe)return;R.preventDefault();const ve=[...a(i)];ve[E*2]=Math.min(1,Math.max(0,ve[E*2]+fe[0])),ve[E*2+1]=Math.min(1.5,Math.max(-.5,ve[E*2+1]+fe[1])),C(i,ve),m()}const k=he(()=>`M${l(0)} ${u(0)} C${l(a(i)[0])} ${u(a(i)[1])} ${l(a(i)[2])} ${u(a(i)[3])} ${l(1)} ${u(1)}`);let N=D(0);Yt(()=>{let R=0;const E=performance.now(),L=ie=>{const fe=(ie-E)/1400%1.4;C(N,zo(...a(i))(Math.min(1,fe)),!0),R=requestAnimationFrame(L)};return R=requestAnimationFrame(L),()=>cancelAnimationFrame(R)});var S=Lo(),$=Sn(S),Z=y($,2),q=V(Z),z=V(q),Q=Y(z,!0),ce=y(z,2),P=Y(ce,!0),K=y(q,2);x(K,"viewBox","0 0 280 280");var re=V(K);x(re,"width",o),x(re,"height",o/2);var qe=y(re),Re=y(qe),Ye=y(Re),ze=y(Ye),ot=y(ze),g=y(ot);De(g,16,()=>[0,1],R=>R,(R,E)=>{var L=Io();ee((ie,fe,ve,Te)=>{x(L,"cx",ie),x(L,"cy",fe),x(L,"aria-label",`control point ${E+1}`),x(L,"aria-valuetext",`${ve??""}, ${Te??""}`),x(L,"aria-valuenow",a(i)[E*2+1]),x(L,"data-testid",`handle-${E??""}`)},[()=>l(a(i)[E*2]),()=>u(a(i)[E*2+1]),()=>a(i)[E*2].toFixed(2),()=>a(i)[E*2+1].toFixed(2)]),H("pointerdown",L,ie=>{v=E,d.setPointerCapture(ie.pointerId)}),H("keydown",L,ie=>b(ie,E)),j(R,L)});var F=y(g);x(F,"cy",o+c*2-6),ft(K,R=>d=R,()=>d);var W=y(K,2),w=V(W),M=V(w),A=y(M),T=V(A);T.value=T.__value="";var I=y(T);De(I,16,()=>Object.keys(Fr),R=>R,(R,E)=>{var L=Do(),ie=Y(L,!0),fe={};ee(()=>{U(ie,E),fe!==(fe=E)&&(L.value=(L.__value=fe)??"")}),j(R,L)});var X=y(w,2),se=Y(X);ee((R,E,L,ie,fe,ve,Te,pe,_,p,te,le,J,me,ye,we,Ne,Ee,Pe,Ce)=>{x(Z,"aria-label",R),U(Q,E),U(P,L),x(re,"x",ie),x(re,"y",fe),x(qe,"x1",ve),x(qe,"y1",Te),x(qe,"x2",pe),x(qe,"y2",_),x(Re,"x1",p),x(Re,"y1",te),x(Re,"x2",le),x(Re,"y2",J),x(Ye,"d",a(k)),x(ze,"cx",me),x(ze,"cy",ye),x(ot,"cx",we),x(ot,"cy",Ne),x(F,"cx",Ee),U(M,`${Pe??""} `),U(se,`[${Ce??""}]`)},[()=>B("curve.title",{name:a(r).name}),()=>B("curve.title",{name:a(r).name}),()=>B("curve.close"),()=>l(0),()=>u(1),()=>l(0),()=>u(0),()=>l(a(i)[0]),()=>u(a(i)[1]),()=>l(1),()=>u(1),()=>l(a(i)[2]),()=>u(a(i)[3]),()=>l(0),()=>u(0),()=>l(1),()=>u(1),()=>l(a(N)),()=>B("curve.presets"),()=>a(i).map(R=>R.toFixed(2)).join(", ")]),H("click",$,()=>t().editingEase=null),H("click",ce,()=>t().editingEase=null),H("pointermove",K,O),H("pointerup",K,()=>v=null),H("change",A,R=>{const E=Fr[R.currentTarget.value];E&&(C(i,[...E]),m())}),j(n,S),at()}wt(["click","pointermove","pointerup","pointerdown","keydown","change"]);var jo=G('<div data-testid="editor" tabindex="-1"><!> <main class="svelte-1ctqrjb"><section class="stage svelte-1ctqrjb"><!> <!></section> <!></main> <!> <!></div>');function Bo(n,e){it(e,!0);let t=tt(e,"editor",7),r=tt(e,"autostart",3,!0),s=tt(e,"compact",3,!1),i=tt(e,"scopedKeys",3,!1),o;function c(){try{const P=localStorage.getItem("oxframe-theme");if(P==="dark"||P==="light")return P}catch{}return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}let l=D(ke(vt(()=>e.theme)??c()));function u(){C(l,a(l)==="dark"?"light":"dark",!0);try{localStorage.setItem("oxframe-theme",a(l))}catch{}document.documentElement.dataset.theme=a(l),window.dispatchEvent(new CustomEvent("oxframe-theme",{detail:a(l)}))}const h=P=>{const K=P.detail;(K==="dark"||K==="light")&&C(l,K,!0)};Yt(()=>{window.addEventListener("oxframe-theme",h),r()&&t().start()}),Ms(()=>{typeof window<"u"&&window.removeEventListener("oxframe-theme",h),r()&&t().stop()});function d(P){const K=P.target;if(i()&&!o?.contains(document.activeElement)||K&&(K.closest("input, textarea, select, [contenteditable]")||K.isContentEditable)||K?.dataset.marker&&(P.key==="ArrowLeft"||P.key==="ArrowRight"))return;const re=P.shiftKey?1:5;switch(P.key){case" ":t().togglePlay();break;case"ArrowLeft":t().seekBy(-re);break;case"ArrowRight":t().seekBy(re);break;case",":t().step(-1);break;case".":t().step(1);break;case"<":t().step(-10);break;case">":t().step(10);break;case"Home":t().seek(0);break;case"End":t().seek(t().lastFrame);break;case"m":case"M":t().markerAtPlayhead();break;case"c":case"C":if(t().notes===null||P.ctrlKey||P.metaKey)return;t().toggleCommenting();break;case"Escape":t().draft?t().draft=null:t().commenting?t().toggleCommenting():t().editingEase?t().editingEase=null:t().error?t().dismissError():t().selectedMarker=null;break;default:return}P.preventDefault()}var v=jo();Pt("keydown",an,d);let f;var m=V(v);{var O=P=>{Ca(P,{get editor(){return t()},get theme(){return a(l)},onToggleTheme:u})};ue(m,P=>{s()||P(O)})}var b=y(m,2),k=V(b),N=V(k);Ha(N,{get editor(){return t()}});var S=y(N,2);{var $=P=>{qo(P,{get editor(){return t()}})};ue(S,P=>{t().error&&P($)})}var Z=y(k,2);{var q=P=>{Fo(P,{get editor(){return t()}})};ue(Z,P=>{s()||P(q)})}var z=y(b,2);vo(z,{get editor(){return t()}});var Q=y(z,2);{var ce=P=>{Uo(P,{get editor(){return t()}})};ue(Q,P=>{t().editingEase&&P(ce)})}ft(v,P=>o=P,()=>o),ee(P=>{f=ut(v,1,"oxframe-editor svelte-1ctqrjb",null,f,{compact:s()}),x(v,"data-theme",a(l)),x(k,"aria-label",P)},[()=>B("viewport.label")]),j(n,v),at()}const Ts="oxframe-present";class Ho{constructor(e){this.editor=e}editor;#e=D(-1);get index(){return a(this.#e)}set index(e){C(this.#e,e,!0)}target=null;channel=null;get stops(){return this.editor.slides.length>0?this.editor.slides:this.editor.scenes.filter(e=>e.frames>0).map(e=>({scene:e.name,frame:e.start+e.frames-1,notes:""}))}get total(){return this.stops.length}frameOf(e){return e<0?0:this.stops[e]?.frame??this.editor.lastFrame}next(){if(this.target!==null){this.land(this.target);return}if(this.index+1>=this.total)return;this.index+=1;const e=this.frameOf(this.index);if(e<=this.editor.frame){this.land(e);return}this.target=e,this.editor.play(),this.broadcast()}prev(){this.target=null,this.index=Math.max(-1,this.index-1),this.editor.pause(),this.editor.seek(this.frameOf(this.index)),this.broadcast()}first(){this.target=null,this.index=-1,this.editor.pause(),this.editor.seek(0),this.broadcast()}onFrame(e){this.target!==null&&e>=this.target&&this.land(this.target)}land(e){this.target=null,this.editor.pause(),this.editor.seek(e),this.broadcast()}status(){const e=r=>this.stops[r]?.notes??"",t=this.target!==null?this.index:this.index+1;return{index:this.index,total:this.total,notes:e(t),nextNotes:e(t+1),playing:this.target!==null}}connect(){if(typeof BroadcastChannel>"u")return()=>{};const e=new BroadcastChannel(Ts);return this.channel=e,e.onmessage=t=>{const r=t.data;r.type==="next"?this.next():r.type==="prev"?this.prev():r.type==="first"?this.first():r.type==="hello"&&this.broadcast()},()=>{e.close(),this.channel=null}}broadcast(){this.channel?.postMessage({type:"status",status:this.status()})}}function Ps(n){switch(n){case"ArrowRight":case"ArrowDown":case"PageDown":case" ":case"Enter":return"next";case"ArrowLeft":case"ArrowUp":case"PageUp":case"Backspace":return"prev";case"Home":return"first";default:return null}}var Vo=G('<p class="hint svelte-n614vz">→ next · ← back · F full screen · N notes</p>'),Yo=G('<p class="error svelte-n614vz" role="alert"> </p>'),Wo=G('<div class="present svelte-n614vz" data-testid="present" role="presentation"><canvas class="svelte-n614vz"></canvas> <div class="counter svelte-n614vz" data-testid="present-counter"> </div> <!> <!></div>');function Xo(n,e){it(e,!0);let t=tt(e,"autostart",3,!0);const r=new Ho(vt(()=>e.editor));let s,i,o=D(ke({w:0,h:0})),c=D(!0);Yt(()=>{t()&&e.editor.start();const S=r.connect(),$=new ResizeObserver(([q])=>{if(!q)return;const{width:z,height:Q}=q.contentRect;C(o,{w:Math.round(z),h:Math.round(Q)},!0),e.editor.setViewport(a(o).w,a(o).h)});$.observe(s);const Z=setTimeout(()=>C(c,!1),4e3);return()=>{$.disconnect(),S(),clearTimeout(Z)}}),Ms(()=>{t()&&e.editor.stop()}),_t(()=>{r.onFrame(e.editor.frame)}),_t(()=>{e.editor.slides,r.broadcast()}),_t(()=>{const S=i?.getContext("2d");if(!S)return;const $=typeof devicePixelRatio=="number"?devicePixelRatio:1,{w:Z,h:q}=a(o);(i.width!==Math.round(Z*$)||i.height!==Math.round(q*$))&&(i.width=Math.round(Z*$),i.height=Math.round(q*$)),S.setTransform($,0,0,$,0,0),S.fillStyle="#000",S.fillRect(0,0,Z,q);const[z,Q]=e.editor.size,ce=Math.min(Z/z,q/Q),[P,K]=[z*ce,Q*ce],re=e.editor.image;re&&(S.imageSmoothingQuality="high",S.drawImage(re,(Z-P)/2,(q-K)/2,P,K))});function l(S){if(S.key==="f"||S.key==="F")u();else if(S.key==="n"||S.key==="N")h();else{const $=Ps(S.key);if(!$)return;r[$]()}S.preventDefault()}async function u(){document.fullscreenElement?await document.exitFullscreen():await s.requestFullscreen?.()}function h(){const S=new URL(location.href);S.searchParams.set("present","notes"),window.open(S.toString(),"oxframe-notes","width=720,height=520")}var d=Wo();Pt("keydown",an,l);var v=V(d);ft(v,S=>i=S,()=>i);var f=y(v,2),m=Y(f),O=y(f,2);{var b=S=>{var $=Vo();j(S,$)};ue(O,S=>{a(c)&&S(b)})}var k=y(O,2);{var N=S=>{var $=Yo(),Z=Y($,!0);ee(()=>U(Z,e.editor.error.message)),j(S,$)};ue(k,S=>{e.editor.error&&S(N)})}ft(d,S=>s=S,()=>s),ee(()=>U(m,`${r.index+1} / ${r.total??""}`)),H("click",d,()=>r.next()),j(n,d),at()}wt(["click"]);var Ko=G('<div class="notes svelte-18gf6mg" data-testid="present-notes"><header class="svelte-18gf6mg"><span class="slide svelte-18gf6mg" data-testid="present-notes-counter"><!></span> <span class="timer svelte-18gf6mg" data-testid="present-timer"> </span> <button type="button" class="svelte-18gf6mg">Reset timer</button></header> <section><h2 class="svelte-18gf6mg">Now</h2> <p class="text svelte-18gf6mg" data-testid="present-notes-now"> </p></section> <section class="next svelte-18gf6mg"><h2 class="svelte-18gf6mg">Next</h2> <p class="text svelte-18gf6mg"> </p></section> <footer class="svelte-18gf6mg"><button type="button" class="svelte-18gf6mg">← Back</button> <button type="button" class="svelte-18gf6mg">Next →</button></footer></div>');function Go(n,e){it(e,!0);let t=D(null),r=D(null),s=D(ke(Date.now())),i=null;Yt(()=>{if(typeof BroadcastChannel>"u")return;i=new BroadcastChannel(Ts),i.onmessage=re=>{re.data.type==="status"&&(C(t,re.data.status,!0),a(r)===null&&a(t).index>=0&&C(r,Date.now(),!0))},o({type:"hello"});const K=setInterval(()=>C(s,Date.now(),!0),500);return()=>{clearInterval(K),i?.close()}});function o(K){i?.postMessage(K)}function c(K){const re=Ps(K.key);re&&(o({type:re}),K.preventDefault())}const l=he(()=>{if(a(r)===null)return"0:00";const K=Math.floor((a(s)-a(r))/1e3);return`${Math.floor(K/60)}:${String(K%60).padStart(2,"0")}`});var u=Ko();Pt("keydown",an,c);var h=V(u),d=V(h),v=V(d);{var f=K=>{var re=Wn();ee(()=>U(re,`Stop ${a(t).index+1} of ${a(t).total??""}`)),j(K,re)},m=K=>{var re=Wn("Waiting for the presentation…");j(K,re)};ue(v,K=>{a(t)?K(f):K(m,-1)})}var O=y(d,2),b=Y(O,!0),k=y(O,2),N=y(h,2),S=y(V(N),2),$=Y(S,!0),Z=y(N,2),q=y(V(Z),2),z=Y(q,!0),Q=y(Z,2),ce=V(Q),P=y(ce,2);ee(()=>{U(b,a(l)),U($,a(t)?.notes||"—"),U(z,a(t)?.nextNotes||"—")}),H("click",k,()=>C(r,Date.now(),!0)),H("click",ce,()=>o({type:"prev"})),H("click",P,()=>o({type:"next"})),j(n,u),at()}wt(["click"]);const hr=new URLSearchParams(location.search),Cs=window.__OXFRAME_CONFIG__??{},Zo=hr.get("backend")??Cs.backend??"ws",Fs=Zo==="mock"?new xa:new wa({url:Cs.url??"/ws",token:hr.get("token")??void 0}),Jn=hr.get("present"),Qn=new io(Fs,{uiVersion:"0.2.1",persist:Jn===null});window.__oxframe={editor:Qn,backend:Fs};const In=document.getElementById("app");Jn==="notes"?Fn(Go,{target:In}):Jn!==null?Fn(Xo,{target:In,props:{editor:Qn}}):Fn(Bo,{target:In,props:{editor:Qn}});