@hyperframes/core 0.8.42 → 0.8.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-inline.js","sourceRoot":"","sources":["../../src/generated/runtime-inline.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,YAAY,GAAW,
|
|
1
|
+
{"version":3,"file":"runtime-inline.js","sourceRoot":"","sources":["../../src/generated/runtime-inline.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,YAAY,GAAW,mmrZAAmmrZ,CAAC;AAEjorZ;;;;GAIG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -701,7 +701,7 @@ class HfPitchshift extends AudioWorkletProcessor {
|
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
registerProcessor("hf-pitchshift", HfPitchshift);
|
|
704
|
-
`,_s=new WeakMap;function Cs(e){return tf.has(e)}var tf=new WeakSet;function Rs(e){let t=_s.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(Qy)))}`;await e.audioWorklet.addModule(n),tf.add(e)})().catch(n=>{throw _s.delete(e),n}),_s.set(e,t)),t}function Zy(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,d=0;for(let m=0;m<i;m++){u+=s*(l()-u);let h=u*Math.pow(1-m/i,2.5);o[m]=h,d+=h*h}let f=Math.sqrt(d);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var ue=e=>typeof e=="number"?e:Number(e??0),Ts=e=>e/1e3;function af(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let d=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function sf(e){try{e.stop()}catch{}e.disconnect()}function ks(e,t){return[{param:e},{param:t,map:n=>1-n}]}function lf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ms(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var ev=new Set(["peaking","highpass","lowpass"]),nf=e=>Math.pow(10,e/20),tv=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=nf(ue(i.gain))};return r(t),Ms(n,r,{gain:[{param:n.gain,map:nf}]})};function Ar(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ue(a.frequency),a.q!==void 0&&(i.Q.value=ue(a.q)),t&&(i.gain.value=ue(a.gain))};return o(r),Ms(i,o,{frequency:[{param:i.frequency}],...ev.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function nv(e){return(t,n)=>{let r=Math.tan(Math.PI*ue(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Ms(i,()=>{})}}function Er(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var rv={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},iv=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=rv[String(a.type)]??Math.tanh,s=Math.pow(10,ue(a.threshold)/20),u=8192,d=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=ue(a.oversample)>=4?"4x":ue(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ue(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},ov=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ue(u.time)/1e3),o.gain.value=ue(u.feedback),lf(a,l,ue(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Ts(u))}],feedback:[{param:o.gain}],mix:ks(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},av=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=af(e,"sine",ue(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let d=f=>{o.delayTime.value=ue(f.delay)/1e3,l.gain.value=ue(f.depth)/1e3,a.playbackRate.value=ue(f.speed),lf(s,u,ue(f.mix))};return d(t),{input:r,output:i,update:d,automation:{delay:[{param:o.delayTime,map:Ts}],depth:[{param:l.gain,map:Ts}],speed:[{param:a.playbackRate}],mix:ks(s.gain,u.gain)},dispose:()=>{sf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},sv=6,lv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=af(e,String(t.type)==="1"?"sine":"triangle",ue(t.speed),n),s=e.createGain(),u=e.createGain(),d=e.createGain(),f=[];r.connect(o);let m=o;for(let b=0;b<sv;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),m.connect(v),m=v,f.push(v)}l.connect(s),m.connect(u).connect(a),o.connect(d).connect(a),a.connect(i);let h=b=>{let v=1e3/Math.max(.1,ue(b.delay));for(let x of f)x.frequency.value=v;s.gain.value=v*ue(b.decay),l.playbackRate.value=ue(b.speed),o.gain.value=ue(b.in_gain),a.gain.value=ue(b.out_gain),u.gain.value=1,d.gain.value=1};return h(t),{input:r,output:i,update:h,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{sf(l),[r,i,o,a,s,u,d,...f].forEach(b=>b.disconnect())}}},uv=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let d=`${ue(u.size)}:${ue(u.damping)}`;if(d!==l){let f=Zy(e.sampleRate,ue(u.size),ue(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=d}o.gain.value=ue(u.wet),a.gain.value=ue(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},cv={"gain-node":tv,"biquad-peaking":Ar("peaking",!0),"biquad-lowshelf":Ar("lowshelf",!0),"biquad-highshelf":Ar("highshelf",!0),"biquad-highpass":Ar("highpass",!1),"biquad-lowpass":Ar("lowpass",!1),"worklet-compressor":Er("hf-compressor"),"worklet-limiter":Er("hf-limiter"),"worklet-gate":Er("hf-gate"),"worklet-bitcrush":Er("hf-bitcrush"),"worklet-pitchshift":Er("hf-pitchshift"),waveshaper:iv,"delay-feedback":ov,"chorus-lfo":av,"allpass-phaser":lv,convolver:uv};function uf(e){return e.nodes.some(t=>In(t.type)?.web.startsWith("worklet-")??!1)}function dv(e,t,n,r=0){let i=In(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=Pn(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return nv(t)(e,o,r);let a=cv[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function rf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function of(e){return On(e).map(t=>{let n=Pn(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function cf(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=rf(On(t)),s=r;for(let m of l){let h=null;if(m.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,v.gain.value=1-m.amount,s.connect(b),b.connect(v).connect(_),h={entry:b,wet:x,dry:v,join:_},s=b}for(let b of m.nodes){let v=dv(e,b.type,b.params??{},n);s.connect(v.input),s=v.output,o.push({...b.id?{id:b.id}:{},type:b.type,handle:v})}h&&m.preset&&(s.connect(h.wet).connect(h.join),a.push({id:m.preset,...h}),s=h.join)}s.connect(i);let u=of(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...ks(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:d,nodes:o,update(m){if(of(m)!==u)return!1;On(m).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(Pn(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let h=0;for(let b of rf(On(m))){if(!b.preset)continue;let v=a[h++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:h,dry:b,join:v}of a)m.disconnect(),h.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var df={version:1,nodes:[]},mf={version:1,lanes:[]};function ff(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(ut):null)??"";if(!n)return mf;try{return _u(ui(n),t)}catch{return mf}}function gn(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(It):null)??"";if(!t)return{chain:df,raw:""};try{return{chain:Au(t),raw:t}}catch{return{chain:df,raw:""}}}function pf(e){return ff(e,gn(e).chain)}function Xi(e,t,n,r,i){let{chain:o}=gn(t),a=null,l=[],s=!1,u=0,d=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(C,F)=>{if(C.nodes.length===0){n.connect(r);return}if(uf(C)&&!Cs(e)){n.connect(r);let D=++u;Rs(e).then(()=>{s||D!==u||x(gn(t).chain)}).catch(()=>{});return}try{let D=cf(e,C,F);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},m=(C,F)=>{l=F&&a?Zm(ff(t,C),C,a.nodes,F,a.presets):[]},h=i?{...i}:null;f(o,h?.elapsed??0),m(o,h);let b=()=>{if(!h)return null;let C=typeof e.currentTime=="number"?e.currentTime:h.scheduledAt;return{scheduledAt:C,elapsed:h.elapsed+(C-h.scheduledAt)*h.rate,rate:h.rate}},v=C=>{let F=b();F&&(hn(l,F.scheduledAt),m(C,F))},x=C=>{let F=b();hn(l,F?.scheduledAt??0),d(),f(C,F?.elapsed??0),m(C,F)},_=null,T=t;return typeof MutationObserver<"u"&&typeof T?.nodeType=="number"&&(_=new MutationObserver(()=>{let C=gn(t);l.length>0&&Sr(l),!a||!a.update(C.chain)?x(C.chain):v(C.chain)}),_.observe(T,{attributes:!0,attributeFilter:[It,ut]})),{reanchor:C=>{if(s)return;let F=b();F&&hn(l,F.scheduledAt),h={...C},m(gn(t).chain,h)},setRate:C=>{let F=b();s||!F||!Number.isFinite(C)||C<=0||C===F.rate||(h={...F,rate:C},hn(l,F.scheduledAt),m(gn(t).chain,h))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&hn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var hf="runtime_web_audio_bypass";function Fs(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function wr(e,t){return Fs(e,t)!==null}function mv(e){return wr(e,"crossorigin")?!0:e.crossOrigin!=null}function fv(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function pv(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Fs(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function hv(e,t){let n;try{n=new URL(e,fv(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function gv(){return typeof window.origin=="string"?window.origin:window.location.origin}function bv(e,t){if(typeof window>"u")return null;let n=hv(e,t);if(!n)return null;let r=gv(),i=r==="null";return!i&&n.origin===r||mv(t)?null:i?"opaque_document_origin":"cross_origin_no_cors"}function bf(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:wr(e,"src")}function bn(e){for(let t of pv(e)){let n=bv(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function xv(e){let t=[];wr(e,It)&&t.push("fx-chain"),wr(e,ut)&&t.push("automation"),wr(e,di)&&t.push("audio-group");let n=Number.parseFloat(Fs(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function yv(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var gf=new WeakSet,vv={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document's security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},Sv={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function xn(e,t){if(t.kind==="web-audio"||yv()||gf.has(e))return;let n=xv(e);gf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:vv[t.reason]};ve({source:"hf-preview",type:"diagnostic",code:hf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 ${Sv[t.reason]}`:"";console.info(`[hyperframes] ${hf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Ns(e){return!Number.isFinite(e)||e<=0?1:e}function xf(e){return Ue(e)}function Av(e,t){t||e.paused||!Kr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Ev(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let d=-n/o;return s?e.start(i+d,r,u):e.start(i+d,r),!0}function Ji(e,t,n){let r=ef(pf(e));r&&ws([{param:t.gain}],r,li.scale,n)}function _r(e){return e.sourceKind==="buffer"}var Qi=class{constructor(){ye(this,"_ctx",null);ye(this,"_bufferCache",new Map);ye(this,"_failedSrcs",new Set);ye(this,"_mediaElementSources",new WeakMap);ye(this,"_activeSources",[]);ye(this,"_masterGain",null);ye(this,"_masterVolume",1);ye(this,"_masterMuted",!1);ye(this,"_groups",new Map);ye(this,"_rateAnchorCtx",0);ye(this,"_rateAnchorComp",0);ye(this,"_rate",1);ye(this,"_paused",!0);ye(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return L("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return L("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),L("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=bn(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),xn(t,o),null}return n}if(!this._ctx)return null;let r=bn(t);if(r.kind!=="web-audio")return xn(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Ns(l),d=this._ctx.createGain();d.gain.value=o;let f=this._ctx.currentTime,m=i-n,h={scheduledAt:f,elapsed:m,rate:u},b=Xi(this._ctx,t,s,d,h);d.connect(this.resolveDestination(t,f,i,u)??this._masterGain),Ji(t,d,h),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:d,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Le(t),bounded:!1};return t.volume=1,this._activeSources.push(v),this._paused=!1,v}catch(s){return L("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(m){L("webAudioTransport.groupReanchor",m)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>$o(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let d=this._ctx.createGain();d.gain.value=xf(qo(s)),d.connect(u);let f=Xi(this._ctx,s??{getAttribute:()=>null},o,d,r);return s&&Ji(s,d,r),this._groups.set(t,{input:o,fader:d,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{Sr([{param:d.gain}]);let h=l();d.gain.value=xf(qo(h)),u.gain.value=h?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),h&&Ji(h,d,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),d.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){L("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=ku(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let d=Ns(s),f=Le(t),m=d*f,h=this._ctx.createBufferSource();h.buffer=n,h.playbackRate.value=m;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:d},T=Xi(this._ctx,t,h,b,_);if(b.connect(this.resolveDestination(t,x,o,d)??this._masterGain),Ji(t,b,_),this._rate=d,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Ev(h,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:d,mediaRate:f,clipDuration:u}))return h.disconnect(),T?.dispose(),b.disconnect(),null;let C=t.muted;t.muted=!0,Av(t,C);let F={fx:T,el:t,sourceNode:h,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(F),this._paused=!1,h.addEventListener("ended",()=>this.handleSourceEnded(h,F,t,C)),F}catch(d){return L("webAudioTransport.schedule",d),null}}setRate(t){let n=Ns(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{_r(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>_r(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{_r(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}_r(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Ue(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&_r(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var Cr="data-hf-studio-manual-edit-gesture";var yf=`[${Cr}]`;function vf(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(yf)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(yf)),i=l=>{for(let s of l){let u=s.target;Ne(u)&&(u.hasAttribute(Cr)?r.add(u):r.delete(u))}},o=l=>{l.length!==0&&(i(l),t())},a=new n(o);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Cr]}),{observing:!0,isActive:()=>{o(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Cr))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var Sf=333.3333333333333;function Af(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var wv=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function Ef(e){return Math.max(0,Math.min(1,e))}function wf(e){let t=wv.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Ef(n):null}function _f(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Ef(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var _v=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Cv=Math.PI*2;function Rv(e){let t=_v.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Tv(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(Cv*t*e)}function Cf(e,t){let n=Rv(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Tv(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var kv=24,Rf=e=>e>=1?1:0,Mv=e=>e,Zi=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Fv=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${Zi}\s*,\s*${Zi}\s+${Zi}\s*,\s*${Zi}\s+1\s*,\s*1\s*$`,"i");function Tf(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Nv(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<kv;l+=1){let s=(o+a)/2;Tf(s,t,r)<e?o=s:a=s}return Tf((o+a)/2,n,i)}function Lv(e){let t=Fv.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>Nv(a,n,r,i,o)}function Dv(e,t){if(!e.startsWith("spring("))return null;let n=wf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>_f(o,n);return t.set(n,i),i}function Iv(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=Lv(n);return i&&t.set(n,i),i}function kf(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?Rf:Cf(s,i)??Dv(s,r)??Iv(s,n),a=(s,u,d=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Be("custom_ease_parse_failed",{ease:s}),t.call(u,s,...d)??Mv)};e.parseEase=function(u,...d){return a(u,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",Rf);let s=u=>{let d=f=>f;d.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Is=new Map,Rr=new Map,Ls=new Map,Ds=()=>{},Ff=()=>{},Mf=0;function Ps(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function Nf(e){let t=(Ls.get(e)??0)+1;return Ls.set(e,t),t}function Lf(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Mf-=1,Mf)}function Os(e,t){let n=Rr.get(e);if(!n)return;let r=()=>Ls.get(e)===t.generation&&Rr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Ff(e,t.requestId)},i=>{r()&&Ds(e,t.requestId,i)})}catch(i){r()&&Ds(e,t.requestId,i)}}function Df(e){Ds=e}function If(e){Ff=e}function eo(e,t,n){if(!Ps(e))return;let r={payload:t,requestId:Lf(n),generation:Nf(e)};Is.set(e,r),Os(e,r)}function to(e,t){Ps(e)&&(Is.delete(e),Os(e,{payload:void 0,requestId:Lf(t),generation:Nf(e)}))}function Pf(e,t){if(!Ps(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Rr.set(e,t);let n=Is.get(e);return n&&Os(e,n),()=>{Rr.get(e)===t&&Rr.delete(e)}}var Gs="data-hf-authored-duration",Hs="data-hf-authored-end",Of=!1;function rt(e){if(e){if(typeof e.pause!="function"){Of||(Of=!0,Be("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function Gv(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function Gf(){let e=bc(),t=()=>{};Ll(ve),Df((c,p,g)=>{ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)})}),If((c,p)=>{try{t()}catch(g){ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)});return}ve({source:"hf-preview",type:"runtime-data-applied",channel:c,requestId:p})}),Hi(document),ms(document),Mu(document);let n=Gv();e.canonicalFps=n.fps??e.canonicalFps,Fl(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,d=(c,p,g)=>{u.has(c)||(u.add(c),Be(p,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){L("runtime.init.site1",c)}let f=new Yi;e.transportClock=f;let m=new Qi,h=!1;m.init().then(c=>{h=c}),window.__hf=window.__hf||{};let b=c=>c.closest("[data-hidden]")!==null||mi(c.ownerDocument,c),v=()=>{let c=window.gsap,p=window;if(!(!c?.registerPlugin||p.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(g){d("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},x=()=>{let c=window.gsap;if(!c){d("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{kf(c)||d("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){d("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",p)}};v(),x(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Bl(document)}catch(c){L("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let _=()=>{let c=document.querySelector('[data-composition-id][data-root="true"]');if(Se(c))return c;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,p=_()?.getAttribute("data-composition-id")??"root",g={};if(c.length===1)g[p]=c[0];else for(let y=0;y<c.length;y++)g[`tl-${y}`]=c[y];window.__timelines=g}let T=_();T&&!T.hasAttribute("data-start")&&T.setAttribute("data-start","0");let C=c=>{a.push(c)},F=(c,p,g)=>{let y=g??`${c}:${JSON.stringify(p)}`;l.has(y)||(l.add(y),ve({source:"hf-preview",type:"diagnostic",code:c,details:p}))},D=c=>{let p={scale:1,focusX:960,focusY:540},g=[],y=[],E={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...E,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},M=1/60,S=.75,A=.05,w=100,R=240,I=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},H=c=>{let p=c.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},j=c=>{if(c==null||c.trim()==="")return null;let p=Number.parseFloat(c);return!Number.isFinite(p)||p<=0?null:`${p}px`},X=()=>_(),k=()=>{let c=X();if(!c)return;let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g),p&&c.style.setProperty("--comp-width",p),g&&c.style.setProperty("--comp-height",g)},U=()=>{let c=X(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(c&&g===c)continue;let y=g.getAttribute("data-duration"),E=g.getAttribute("data-end");y!=null&&!g.hasAttribute(Gs)&&g.setAttribute(Gs,y),E!=null&&!g.hasAttribute(Hs)&&g.setAttribute(Hs,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},te=()=>{let c=X();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g);let y=Array.from(c.children);for(let E of y){let N=E.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let P=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",K=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(P&&K&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Y=E.style.top,Re=E.style.left,Dt=E.style.width,Fe=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let Xe=window.getComputedStyle(E);Xe.top!=="auto"||Xe.bottom!=="auto"||Xe.left!=="auto"||Xe.right!=="auto"||Xe.width!=="0px"||Xe.height!=="0px"||(E.style.top=Y,E.style.left=Re,E.style.width=Dt,E.style.height=Fe)}let $=window.getComputedStyle(E),ne=$.position;if(ne!=="absolute"&&ne!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||$.left!=="auto"||$.right!=="auto"||(E.style.left="0"),N!=="audio"){let Y=j(E.getAttribute("data-width")),Re=j(E.getAttribute("data-height")),Dt=$.width!=="0px"&&$.width!=="auto",Fe=$.height!=="0px"&&$.height!=="auto";Y?!E.style.width&&!Dt&&(E.style.width=Y):!E.style.width&&$.width==="0px"&&(E.style.width="100%"),Re?!E.style.height&&!Fe&&(E.style.height=Re):!E.style.height&&$.height==="0px"&&(E.style.height="100%")}}},B=c=>st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:c}),G=null,W=c=>{let p=G;G=B(!0);try{return c()}finally{G=p}},Q=c=>c&&G?G:B(c),q=(c,p=0,g)=>Q(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(c,p),O=(c,p)=>Q(p?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(c),V=c=>{let p=c.closest("[data-composition-id]"),g=p?q(p,0):null,y=p?O(p,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:p,inheritedStart:g,inheritedDuration:y}},Z=c=>Q(!0).resolveMediaStartForElement(c);window.__hfResolveMediaStartSeconds=Z,a.push(()=>{window.__hfResolveMediaStartSeconds===Z&&delete window.__hfResolveMediaStartSeconds});let pe=(c,p)=>{let g=c.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let E=g==="video"||g==="audio"?Z(c):q(c,0),N=O(c),P=c.getAttribute("data-composition-id");if(P){let Ee=(window.__timelines??{})[P],He=null;if(Ee&&typeof Ee.duration=="function"){let Y=Number(Ee.duration());Number.isFinite(Y)&&Y>0&&(He=Y)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(Gs)||c.hasAttribute(Hs))&&(N==null||N<=0)&&He!=null&&(N=He)}let K=N!=null&&N>0?E+N:Number.POSITIVE_INFINITY,$=window.__HF_EXPORT_RENDER_SEEK_CONFIG?xa(E,e.canonicalFps):E,ne=window.__HF_EXPORT_RENDER_SEEK_CONFIG&&Number.isFinite(K)?xa(K,e.canonicalFps):K;return p>=$&&(Number.isFinite(ne)?p<ne:!0)},re=!!document.querySelector("[data-composition-src]"),z=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of c){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){z=!0;break}}}let J=!re&&!z,Ae=c=>{if(!c||typeof c.duration!="function")return null;try{let p=Number(c.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},ce=c=>typeof c=="number"&&Number.isFinite(c)&&c>M,Sn=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));return c.length===0?null:W(()=>{let p=0;for(let g of c){let y=Z(g);if(!Number.isFinite(y))continue;let E=ri(g);E==null||E<=M||(p=Math.max(p,Math.max(0,y)+E))}return p>M?p:null})},it=()=>{let c=X();if(!c)return null;let p=window.__timelines??{},g=st({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),y=0,E=Ce(c.getAttribute("data-duration"));E!=null&&E>0&&(y=E);let N=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let P of N){if(!Ne(P)||P.parentElement?.closest("[data-composition-id]")!==c)continue;let $=g.resolveStartForElement(P,0),ne=g.resolveDurationForElement(P);!Number.isFinite($)||ne==null||ne<=0||(y=Math.max(y,Math.max(0,$)+ne))}return y>M?y:null},yp=()=>{let c=Sn();return typeof c!="number"||!Number.isFinite(c)||c<=M?null:c},vp=c=>ce(c)?Math.max(M,c*S):M,Ys=()=>{let c=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let y=null;try{y=g()}catch(E){L("runtime.init.adapterDuration",E)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(c=Math.max(c,y))}return c>M?c:null},Mr=!1,Xs=()=>Mr&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,Sp=["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",ii,"data-playback-rate","data-playback-start","data-media-start","id","src"],Js=["loadedmetadata","durationchange","emptied"],Fr=null,Qs=-1,Zs=null,Mt=null,el=0,zt=()=>{},qt=()=>{el+=1,zt()},tl=()=>({media:yp(),authoredComposition:it()}),Ap=()=>{let c=window.__timelines??{},p="";for(let g of Object.keys(c)){let y=c[g];y&&(p+=`${g}=${Ae(y)??"?"};`)}return p},Ep=()=>{if(!(Mt||typeof MutationObserver>"u")){Mt=new MutationObserver(qt),Mt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Sp});for(let c of Js)document.addEventListener(c,qt,!0);a.push(()=>{Mt?.disconnect(),Mt=null,qt();for(let c of Js)document.removeEventListener(c,qt,!0)})}},Nr=()=>{Ep(),Mt&&Mt.takeRecords().length>0&&qt();let c=Ap();return c!==Zs&&(Zs=c,qt()),el},nl=c=>Mr?tl():(c??(c=Nr()),Fr&&Qs===c||(Qs=c,Fr=tl()),Fr),ot=(c,p=0,g)=>{let y=Ae(c),{media:E,authoredComposition:N}=nl(g),P=Ys(),K=Math.max(E??0,N??0,P??0),$=Number.isFinite(p)&&p>M?p:0,ne=0;return ce(y)?ne=Math.max(y,K,$):ce(K)?ne=Math.max(K,$):ne=$,ne>0?Math.max(0,ne):0},uo=()=>{let c=window.__timelines??{},p=de=>{let se=Object.entries(c).filter(me=>!!me[1]&&typeof me[1].play=="function"&&typeof me[1].pause=="function");if(se.length!==1)return{timeline:null};let ie=se[0];if(!ie)return{timeline:null};let[xe,we]=ie;return{timeline:we,selectedTimelineIds:[xe],selectedDurationSeconds:Ae(we),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:de,soleTimelineId:xe}}}},g=st({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),{media:y,authoredComposition:E}=nl(),N=Math.max(y??0,E??0)||null,P=vp(N),K=de=>{let se=document.querySelector(`[data-composition-id="${CSS.escape(de)}"]`);return se?g.resolveStartForElement(se,0):0},$=de=>{let se=window.gsap;if(!se||typeof se.timeline!="function")return null;let ie=se.timeline({paused:!0});for(let xe of de)ie.add(xe.timeline,K(xe.compositionId));return ie},ne=(de,se)=>{if(!ce(de))return null;let ie=window.gsap;if(!ie||typeof ie.timeline!="function")return null;let xe=ie.timeline({paused:!0});if(se)try{xe.add(se,0)}catch(me){L("runtime.init.site2",me)}let we=xe;if(typeof we.to=="function")try{we.to({},{duration:de})}catch(me){L("runtime.init.site3",me)}return xe},Ee=(de,se)=>{if(!de||typeof de.getChildren!="function")return[];try{let ie=de.getChildren(!0,!0,!0);return Array.isArray(ie)?se.filter(xe=>ie.includes(xe.timeline)):[]}catch{return[]}},He=(de,se)=>{let ie=de,xe={addedIds:[],nested:[]};if(typeof ie.getChildren!="function")return xe;try{let we=ie.getChildren(!0,!0,!0)??[];if(!Array.isArray(we))return xe;let me=[];for(let _e of se)if(!we.some(at=>at===_e.timeline))try{let at=K(_e.compositionId);de.add(_e.timeline,at),me.push(_e.compositionId)}catch(at){L("runtime.init.site4",at)}return{addedIds:me,nested:Ee(de,se)}}catch{return xe}},ae=X(),Y=ae?.getAttribute("data-composition-id")??null;if(!Y)return p("root_missing_composition_id");let Re=c[Y]??null,Fe=(()=>{if(!ae)return[];let de=new Set,se=Array.from(ae.querySelectorAll("[data-composition-id]")),ie=[];for(let xe of se){let we=xe.getAttribute("data-composition-id");if(!we||we===Y||de.has(we))continue;de.add(we);let me=c[we]??null;if(!me||typeof me.play!="function"||typeof me.pause!="function")continue;let _e=Ae(me);ie.push({compositionId:we,timeline:me,durationSeconds:_e??0})}return ie})(),Xe=de=>{for(let se of de){let ie=se.timeline;if(typeof ie.paused=="function")try{ie.paused(!1)}catch(xe){L("runtime.init.site5",xe)}}};if(Re){let de=Fe.length>0?He(Re,Fe):{addedIds:[],nested:[]},se=de.addedIds;if(Xe(de.nested),(Fe.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+Y+"'])"))&&(Lr=!0),se.length>0)try{let me=Re.time();Re.seek(me,!1)}catch{}let ie=Ae(Re);if(!ce(ie)&&Fe.length>0){let me=Fe.map(th=>th.compositionId),_e=$(Fe),jt=Ae(_e);if(_e&&ce(jt))return Xe(Ee(_e,Fe)),{timeline:_e,selectedTimelineIds:me,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:me,autoNestedChildren:se}}};let at=ne(N??0,Re),Co=Ae(at);if(at&&ce(Co))return{timeline:at,selectedTimelineIds:[Y],selectedDurationSeconds:Co,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Co,selectedTimelineIds:[Y],autoNestedChildren:se}}}}if(!ce(ie)&&Fe.length===0){let me=ne(N??0,Re),_e=Ae(me);if(me&&ce(_e))return{timeline:me,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:_e,selectedTimelineIds:[Y]}}}}let xe=Ce(ae?.getAttribute("data-duration")),we=Math.max(ce(xe)?xe:0,E??0);if(we>0&&ce(we)&&ce(ie)&&we>=ie+.5){let me=Re;if(typeof me.to=="function")try{me.to({},{duration:0},we)}catch(jt){L("runtime.init.site6",jt)}let _e=Ae(Re);if(ce(_e))return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Y,rootDurationSeconds:ie,rootDeclaredDur:xe,authoredCompositionDurationFloorSeconds:E,newDur:_e}}}}return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Y,selectedDurationSeconds:ie,autoNestedChildren:se}}:void 0}}if(Fe.length>0){let de=Fe.map(xe=>xe.compositionId),se=$(Fe),ie=Ae(se);if(se)return Xe(Ee(se,Fe)),{timeline:se,selectedTimelineIds:de,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Y,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,selectedTimelineIds:de}}}}return p("root_composition_id_unmatched_in_registry")},Lr=!1,wp=c=>{let p=window.gsap,g=c;if(!(!g||typeof g.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let y of g.getChildren(!0,!0,!0)){let E=y,N=E.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let P=E.vars?.keyframes,$=(P&&!Array.isArray(P)?P.ease:void 0)??E.vars?.ease??"none";try{let ne=p.parseEase($);typeof ne=="function"&&(N._ease=ne)}catch(ne){Be("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",ne)}}},An=()=>{if(x(),!J)return!1;let c=e.capturedTimeline,p=Ae(c),g=ce(p);if(c&&g&&Lr)return!1;let y=uo();if(!y.timeline)return!1;if(c&&c===y.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),wp(e.capturedTimeline);let E=ot(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),rt(e.capturedTimeline)),E>0){try{f.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let P=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(P,!1),rt(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),Hi(document)}if(y.diagnostics&&ve({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),ve({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=X(),P=E>0?E:0,K=String(P>0?P:1),$=new Set,ne=ae=>ae.tagName.toLowerCase()===Zt,Ee=new Set(document.querySelectorAll("[data-start]")),He=ae=>{let Y=ae.parentElement;for(;Y&&Y!==N;){if(Ee.has(Y))return!0;Y=Y.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ae of e.capturedTimeline.getChildren(!0))if(typeof ae.targets=="function")for(let Y of ae.targets())Se(Y)&&Y!==N&&(ne(Y)||Y.hasAttribute("data-start")||He(Y)||$.has(Y)||($.add(Y),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration",K),Y.setAttribute("data-hf-autostamped","1")))}catch{}if(Se(N))for(let ae of N.querySelectorAll("[id]"))Se(ae)&&ae!==N&&(ae.hasAttribute("data-start")||He(ae)||$.has(ae)||ae.tagName==="SCRIPT"||ae.tagName==="STYLE"||ae.tagName==="LINK"||ne(ae)||($.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",K),ae.setAttribute("data-hf-autostamped","1")))}for(let N of En)Dr.delete(N),ul(N);return!0},rl=()=>{if(e.tornDown)return;let c=uo();if(!c.timeline){e.capturedTimeline=null,Lr=!1,f.setDuration(0),Hr(e.currentTime);return}e.capturedTimeline!==c.timeline&&(Lr=!1,An()),Hr(e.currentTime)};t=()=>{rl(),ht()},window.__hfForceTimelineRebind=rl;let _p=()=>{let c=X();if(!Se(c))return;let p=c.getBoundingClientRect(),g=Number(c.getAttribute("data-width")),y=Number(c.getAttribute("data-height")),E=window.getComputedStyle(c),N=Number.isFinite(g)&&g>0&&Number.isFinite(y)&&y>0,P=p.width<=0||p.height<=0||c.clientWidth<=0||c.clientHeight<=0;!N||!P||F("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:y,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},Cp=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,_p()}))},Rp=()=>{i=c=>{let p=I(c.error??c.message).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},o=c=>{let p=I(c.reason).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Tp=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of c){let y=()=>{if(!Ne(g))return;let E=g.tagName.toLowerCase(),N=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";F(P,{tagName:E,assetUrl:N,currentSrc:(Oe(g)||ge(g))&&g.currentSrc||null,readyState:ge(g)?g.readyState:null,networkState:ge(g)?g.networkState:null},`${P}:${E}:${N??"unknown"}`)};g.addEventListener("error",y),C(()=>{g.removeEventListener("error",y)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let g=Array.from(p).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);g.length!==0&&F("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},kp=(c,p)=>{if(!c.timeline)return!1;let g=e.capturedTimeline;if(g&&g===c.timeline)return!1;let y=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{rt(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){L("runtime.init.site7",N)}return ve({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:y,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},Ft=null,il=!1,En=new Set,Dr=new WeakMap,Ir=()=>{e.tornDown||(Ft!=null&&window.clearTimeout(Ft),Ft=window.setTimeout(()=>{if(e.tornDown||(Ft=null,Xs()))return;let c=uo();if(!c.timeline||!ce(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){An()&&(ht(),Pe(!0));return}if(il)return;let g=Ae(e.capturedTimeline),y=c.selectedDurationSeconds??Ae(c.timeline);ce(y)&&(!ce(g)||y>=g+A)&&kp(c,"manual")&&(il=!0,ve({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:y??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),ht(),Pe(!0))},w))},ol=c=>{ge(c.currentTarget)&&Gu(c.currentTarget)},al=c=>{ge(c.currentTarget)&&Hu(c.currentTarget)},sl=c=>{Lo(c)&&bf(c)&&xn(c,bn(c))},ll=c=>{let p=c.currentTarget;ge(p)&&sl(p)},Mp=()=>{for(let c of En)c.removeEventListener("loadedmetadata",Ir),c.removeEventListener("durationchange",Ir),c.removeEventListener("loadedmetadata",ol),c.removeEventListener("loadedmetadata",ll),c.removeEventListener("error",al);En.clear()},co=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let p of c){if(En.has(p))continue;En.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",Ir),p.addEventListener("durationchange",Ir),p.addEventListener("loadedmetadata",ll),sl(p),p.addEventListener("loadedmetadata",ol),p.addEventListener("error",al),Ou(p),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),ul(p)}},ul=c=>{Dr.has(c)||bu(c,e.capturedTimeline,ot(e.capturedTimeline,0),Dr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},mo=new WeakMap,Fp=c=>{let p=mo.get(c);if(p!==void 0)return p;let g=window.getComputedStyle(c).position,y=g==="static"||g==="relative"||g==="sticky";return mo.set(c,y),y},fo=new WeakMap,Np=c=>{let p=fo.get(c);if(p!==void 0)return p;let g=c.querySelector("[data-start]")===null;return fo.set(c,g),g},Lp=()=>{mo=new WeakMap,fo=new WeakMap},po=new WeakSet,ho=new WeakMap,Pr=new WeakSet,Or=!1,cl=c=>c.matches("audio[data-start]")||c.querySelector("audio[data-start]")!==null,dl=new WeakMap,Gr=!0,Dp=()=>{if(Gr){Gr=!1;for(let c of document.querySelectorAll(Zt)){let p=c.hasAttribute("data-hidden");dl.get(c)!==p&&(dl.set(c,p),c.id&&m.setGroupMuted(c.id,p))}}},Ip=(c,p)=>{let g=X();for(let y of p){if(!Se(y))continue;if(y.hasAttribute("data-hidden")){Pr.has(y)||(ho.set(y,y.style.getPropertyValue("display")),Pr.add(y),cl(y)&&(Or=!0),Gr=!0),y.style.display="none",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,!1);continue}if(Pr.has(y)){let N=ho.get(y);N?y.style.display=N:y.style.removeProperty("display"),ho.delete(y),Pr.delete(y),cl(y)&&(Or=!0),Gr=!0}let E=pe(y,c);if(E){let N=y.parentElement;for(;N&&N!==g;){if(Se(N)&&N.hasAttribute("data-start")&&!pe(N,c)){E=!1;break}N=N.parentElement}}y.style.visibility=E?"visible":"hidden",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,E),E?po.has(y)&&(y.style.removeProperty("display"),po.delete(y)):Fp(y)&&Np(y)&&(y.style.display="none",po.add(y))}Or&&f.isPlaying()&&(m.stopAll(),wo()),Or=!1,Dp()},Hr=(c,p=Array.from(document.querySelectorAll("[data-start]")))=>W(()=>Ip(c,p)),wn=null,_n=null,Br=[],ml=c=>c.hasAttribute("data-start")||!!V(c).compositionRoot,go=c=>Nu({elements:c,shouldIncludeElement:ml,resolveStartSeconds:p=>Z(p),resolveDurationSeconds:p=>{let g=V(p),y=Z(p),E=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-y):null,N=Number.isFinite(p.duration)?xt(p,p.duration):null,P=Ce(p.dataset.duration),K=P!=null&&P>0?P:null;return Fu({isVideo:p.tagName==="VIDEO",sourceDuration:N,hostRemaining:E,explicitDuration:K})}}),Pp=()=>{let c=Nr();if(wn&&wn.revision===c)return wn;let p=go().mediaClips;return wn={revision:c,clips:p,byStart:[...p].sort((g,y)=>g.start-y.start),byEnd:[...p].sort((g,y)=>g.end-y.end)},_n=null,Br=[],wn},fl=(c,p,g,y)=>{let E=0,N=c.length;for(;E<N;){let K=E+N>>1;p(c[K])<g?E=K+1:N=K}let P=[];for(let K=E;K<c.length&&p(c[K])<=y;K+=1)P.push(c[K]);return P},Op=(c,p)=>{let g=_n;if(g===null)return c.clips.map(P=>P.el);let y=Math.min(g,p),E=Math.max(g,p),N=new Set;for(let P of Br)N.add(P.el);for(let P of fl(c.byStart,K=>K.start,y,E))N.add(P.el);for(let P of fl(c.byEnd,K=>K.end,y,E))N.add(P.el);return[...N]},Ur=new WeakSet,pl=c=>{Ur.add(c)},hl=c=>{Ur.delete(c)};window.__hf.leasePausedMedia=pl,window.__hf.releasePausedMedia=hl;let Gp=()=>{for(let c of document.querySelectorAll("video, audio"))if(ge(c)&&!c.paused&&ml(c)&&!Ur.has(c))return!0;return!1},gl=()=>zt();document.addEventListener("play",gl,!0),a.push(()=>{document.removeEventListener("play",gl,!0)});let Ge=()=>{let c=!Mr,p=W(()=>{if(!c)return go().mediaClips;let E=Pp();return go(Op(E,e.currentTime)).mediaClips});for(let E of p){let N=Dr.get(E.el);N&&(E.volumeKeyframes=N)}let g=e.isPlaying?p:p.filter(E=>!Ur.has(E.el)),y=e.mediaForceSyncNextTick;y&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||(Lu({clips:g,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:y,onElementVolume:(E,N,P)=>m.setElementVolume(E,P),isWebAudioOwned:E=>m.ownsElement(E),isWebAudioRouted:E=>m.routesElement(E),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,ve({source:"hf-preview",type:"media-autoplay-blocked"}))}}),c?(_n=e.currentTime,Br=p.filter(E=>e.currentTime>=E.start&&e.currentTime<E.end)):(_n=null,Br=[])),Hr(e.currentTime)},Pe=c=>{c&&zt();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(c||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,ve({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},bo="",bl=0,Hp=()=>{let c="";for(let p of document.querySelectorAll("[data-start]"))c+=`${p.id}:${p.tagName}|`;return c},ht=()=>{U(),k(),te();let c=X();if(c){let y=j(c.getAttribute("data-width")),E=j(c.getAttribute("data-height")),N=y?parseInt(y,10):0,P=E?parseInt(E,10):0;N>0&&P>0&&ve({source:"hf-preview",type:"stage-size",width:N,height:P})}An();let p=Ac({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=Hp();if(bo!==g&&Lp(),!window.__clipTree||bo!==g){let y=window;window.__clipTree=xc({startResolver:st({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),bo=g}ve(p),Cp()},xo=c=>typeof c=="number"&&Number.isFinite(c)&&c>0?c:0,Bp=c=>{let p=xo(Number(c));if(p<=0)return;let g=X(),y=xo(Ce(g?.getAttribute("data-duration"))),E=Math.max(bl,xo(f.getDuration()),y);p<=E||(bl=p,g?.setAttribute("data-duration",String(p)),f.setDuration(p),ht(),Pe(!0))},ze=(c,p=0)=>{for(let g of e.deterministicAdapters){try{c==="discover"&&g.discover(),c==="pause"&&g.pause(),c==="play"&&g.play&&g.play()}catch(y){L("runtime.init.site8",y)}if(c==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},Nt=()=>{window.__renderReady=!1},Cn=null,Rn=!0,Up=()=>{let c=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let y=g();y&&c.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return c},Wp=()=>{let c=Up();if(c.length===0)return Cn=null,Rn=!0,!0;let p=c[0];if(!p)return!0;let g=c.length===1?p:Promise.all(c);return g!==Cn&&(Cn=g,Rn=!1,Promise.resolve(g).then(()=>{Cn===g&&(Rn=!0,Nt())},y=>{Cn===g&&(Rn=!0,L("runtime.init.adapterReady",y),Nt())})),Rn};if(J)os();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:j,onDiagnostic:({code:p,details:g})=>{ve({source:"hf-preview",type:"diagnostic",code:p,details:g})}};fm(c).then(()=>mm(c)).finally(()=>{J=!0,co(),Tp(),os(),ms(document),Nt()})}let Wr=fc({postMessage:c=>ve(c)});Wr.installPickerApi(),Hr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let Ye=Qm({lease:pl,release:hl});r=Ye,C(()=>{Ye.destroy(),r=null});let yo=c=>{let p=Number(c);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let y of g)if(ge(y))try{y.playbackRate=e.playbackRate}catch(E){L("runtime.init.site10",E)}},xl={play:()=>{let c=e.capturedTimeline;if(f.isPlaying())return;let p=ot(c,0);if(p>0)f.setDuration(p),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Lt(0));else{let g=X(),y=Number(g?.getAttribute("data-duration")??0);y>0&&f.setDuration(y)}rt(c),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Rl(f.now()),h&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&wo(),ze("play"),Ge(),Ye.redraw(),Pe(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Rl(e.currentTime);let c=e.capturedTimeline;rt(c),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},seek:(c,p)=>{let g=on(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let y=f.isPlaying();y&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(rt(E),Lt(e.currentTime),ze("pause"),p?.keepPlaying&&y){xl.play();return}Ge(),Ye.redraw(),Pe(!0)},renderSeek:(c,p)=>{Mr=!0;let g=on(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Lt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},getTime:()=>f.now(),getDuration:()=>{let c=f.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:c=>{yo(c),f.setRate(e.playbackRate),Tl()},getPlaybackRate:()=>e.playbackRate},yl=ot(e.capturedTimeline,0);yl>0&&f.setDuration(yl);let qe=gc({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:yo,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,p)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Ge()},onStatePost:Pe,onDeterministicSeek:(c,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(c)||0,suppressEvents:p?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>ze("pause"),onDeterministicPlay:()=>ze("play"),onRenderFrameSeek:()=>{Ye.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>ot(e.capturedTimeline,0),transport:xl});window.__player=D(qe),window.__playerReady=!0,Be("composition_loaded",{duration:qe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[uu(),ql({resolveStartSeconds:c=>q(c,0)}),jl(),Yl(),Ql(),Zl(),eu(),tu(),nu(),ru(),iu(),$l({getTimeline:()=>e.capturedTimeline})],su(),lu(),window.__hfReseekGpu=c=>{let p=Math.max(0,Number(c)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,ei(p)},window.__hfWaitForSeekCompletion=Ho,a.push(()=>{window.__hfWaitForSeekCompletion===Ho&&delete window.__hfWaitForSeekCompletion}),Rp(),co(),ze("discover");let Vp=()=>{let c=e.capturedTimeline,p=An();e.capturedTimeline&&(p||e.capturedTimeline!==c||!qe._timeline)&&(qe._timeline=e.capturedTimeline);let g=ot(e.capturedTimeline,0);if(g>0&&f.setDuration(g),ze("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},E=Object.keys(y).filter(N=>y[N]);if(E.length>0){let P=X()?.getAttribute("data-composition-id")??null;F("root_timeline_unbound_registry_present",{reason:P?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:P,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(P?`Root data-composition-id is "${P}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${P??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,ht(),Pe(!0)},$t=null,zp=()=>{if($t)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),$t=null,Nt()};$t=c,window.addEventListener("hf-timelines-built",c)};C(()=>{$t&&(window.removeEventListener("hf-timelines-built",$t),$t=null)}),Nt=()=>{if(!J){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,zp();return}if(ze("discover",e.currentTime),!Wp()){window.__renderReady=!1;return}Vp()},Nt(),J&&setTimeout(()=>{Nt()},0);let Vr=0,zr=!1,vo=Number.NaN,So=null,qr=!1,gt=null,$r=!1,vl="",Sl=-1,jr=!1,Al=Number.NEGATIVE_INFINITY,qp=(c,p,g,y)=>{try{let E=y?.suppressEvents===!0;rt(c),typeof c.totalTime=="function"?c.totalTime(p,E):c.seek(p,E)}catch(E){L(g,E)}},$p=(c,p)=>{let g=window.__timelines??{},y=X()?.getAttribute("data-composition-id")??null;for(let[E,N]of Object.entries(g)){if(!N||E===y)continue;let P=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!P)continue;let K=q(P,0);if(!Number.isFinite(K))continue;let $=Ae(N),ne=Qe(P)+Math.max(0,c-K)*Le(P),Ee=Math.max(0,$!=null&&$>0?Math.min($,ne):ne);qp(N,Ee,"runtime.init.transport.childTimeline",p)}},jp=c=>{let p=window.__timelines??{},g=[];for(let y of Object.values(p))if(!(!y||y===c)){g.push(y);try{y.play()}catch(E){L("runtime.init.activateSiblings",E)}}return g},El=c=>typeof c=="object"&&c!==null,Tn=new WeakMap,Kp=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],wl=(c,p)=>{let g=c[p];if(typeof g!="function")return null;try{let y=Number(g.call(c));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Yp=c=>{let p=Tn.get(c);if(p!=null)return p;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let g;try{g=c.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),Tn.set(c,!1),!1}if(!Array.isArray(g))return Tn.set(c,!1),!1;for(let y of g){if(!El(y))continue;let E=y.vars;if(!El(E)||!Kp.some($=>typeof E[$]=="function"))continue;let K=wl(y,"totalDuration")??wl(y,"duration");if(K!=null&&K<=1e-6)return Tn.set(c,!0),!0}return Tn.set(c,!1),!1};function Lt(c,p){let g=e.capturedTimeline,y=g&&p?.activateChildren?jp(g):[];try{Xp(g,c,p)}finally{for(let E of y)rt(E)}}function Xp(c,p,g){let y=g?.suppressEvents===!0;if(c){let E=c,N=p;if(typeof E.totalDuration=="function")try{let P=Number(E.totalDuration());Number.isFinite(P)&&P>0&&p>P&&(N=P)}catch(P){L("runtime.init.transport.clampDuration",P)}try{typeof c.totalTime=="function"?(c.totalTime(N,y),!y&&!Yp(c)&&(c.totalTime(N+.001,!0),c.totalTime(N,!0))):c.seek(N,y)}catch(P){L("runtime.init.transport.seek",P)}}$p(p,g);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&c))try{E.seek({time:p,suppressEvents:y})}catch(N){L("runtime.init.transport.adapter",N)}}let Ao=vf(document,()=>{zt()});a.push(()=>Ao.disconnect());let Jp=()=>{try{return Ao.isActive()}catch{return!1}},Qp=()=>!f.isPlaying()&&!Xs()&&Ao.observing&&!qr&&!jr&&e.currentTime===vo&&e.capturedTimeline===So,_l=()=>`${Nr()}|${Ys()??""}`,Cl=()=>{gt=window.setTimeout(Zp,e.bridgeMaxPostIntervalMs)},Zp=()=>{if(gt=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(_l()!==vl){zt();return}Pe(!1),Cl()}},eh=()=>{if(e.transportRafId=null,e.tornDown)return;let c=$r;if($r=!1,c||!Qp()){e.transportRafId=window.requestAnimationFrame(Eo);return}vl=_l(),Cl()};zt=()=>{e.tornDown||($r=!0,!(zr||e.transportRafId!=null)&&(gt!=null&&(window.clearTimeout(gt),gt=null),$r=!1,e.transportRafId=window.requestAnimationFrame(Eo)))};let Eo=()=>{if(!(e.tornDown||zr)){zr=!0;try{Vr+=1;let c=Nr();c!==Sl&&(Sl=c,jr=!0);let p=Date.now(),g=jr&&!f.isPlaying()&&p-Al>=Sf;if(g&&(Al=p),Af({tick:Vr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now(),compositionChanged:g})){let P=e.capturedTimeline;if(An()){e.capturedTimeline&&!qe._timeline&&(qe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==P&&rt(e.capturedTimeline);let K=ot(e.capturedTimeline,0,c);K>0&&f.setDuration(K),ht()}}if((g||Vr%20===0)&&(ht(),jr=!1),(g||Vr%30===0)&&co(),e.capturedTimeline){let P=ot(e.capturedTimeline,0,c);P>0&&(!f.isPlaying()||P>=f.getDuration())&&f.setDuration(P)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let P=m.getTime();P>=0&&f.attachAudioSource({currentTimeSeconds:P})}else{let P=document.querySelectorAll("audio[data-start]"),K=!1;for(let $ of P){if(!ge($)||!$.isConnected||b($))continue;let ne=Z($),Ee=Ce($.dataset.duration),He=Ee!=null&&Ee>0?ne+Ee:1/0,ae=Qe($);if(Number.isFinite(ne)&&e.currentTime>=ne&&e.currentTime<He){$.paused?!$.error&&$.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),K=!0):(f.attachAudioSource({el:$,compositionStart:ne,mediaStart:ae}),K=!0);break}}!K&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let y=f.now();e.currentTime=y;let E=f.isPlaying();if(!E&&Jp()?qr=!0:(E||qr||y!==vo||e.capturedTimeline!==So)&&(Lt(y),vo=y,So=e.capturedTimeline,E||(qr=!1)),E&&Ye.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let P=f.getDuration();Number.isFinite(P)&&(f.seek(P),e.currentTime=P,Lt(P)),ze("pause"),Ge(),Pe(!0);return}f.isPlaying()?Ge():Gp()&&(_n=null,Ge()),Pe(!1)}finally{zr=!1,eh()}}},Rl=c=>{let p=document.querySelectorAll("video, audio");for(let g of p){if(!ge(g)||!g.isConnected||!g.hasAttribute("data-start"))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Ce(g.dataset.duration),N=E!=null&&E>0?y+E:1/0;if(c<y||c>=N)continue;let P=Qe(g),K=c-y+P;if(K>=0)try{g.currentTime=K}catch{}}},wo=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=m.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let g of p){if(!ge(g)||!g.isConnected||b(g))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Qe(g),N=Number.parseFloat(g.dataset.volume??""),P=Number.isFinite(N)?N:1,K=Ce(g.dataset.duration),$=K!=null&&K>0?K:Number.POSITIVE_INFINITY,ne=g.closest("[data-composition-id]");if(ne){let ae=q(ne,0),Y=O(ne,{includeAuthoredTimingAttrs:!0});Y!=null&&Y>0&&($=Math.min($,Math.max(0,ae+Y-y)))}let Ee=bn(g);xn(g,Ee),(Ee.kind==="web-audio"?m.scheduleMediaElementPlayback(g,y,E,f.now(),P,c,e.playbackRate):Promise.resolve(null)).then(ae=>{if(ae||!f.isPlaying())return;let Y=e.playbackRate*Le(g),Re=g.hasAttribute("data-fx-chain")||g.hasAttribute("data-automation");if(Math.abs(Y-1)>1e-9){Ee.kind==="web-audio"&&Re&&(g.muted=!0);return}m.decodeAudioElement(g).then(Dt=>{!Dt||!f.isPlaying()||m.schedulePlayback(g,Dt,y,E,f.now(),P,c,e.playbackRate,$)})})}};function Tl(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&h&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),wo())}if(e.capturedTimeline){let c=ot(e.capturedTimeline,0);c>0&&f.setDuration(c),rt(e.capturedTimeline)}ym(window),e.transportRafId=window.requestAnimationFrame(Eo),ht(),Pe(!0),e.controlBridgeHandler=Nl({onPlay:()=>{qe.play(),Be("composition_played",{time:qe.getTime()})},onPause:()=>{qe.pause(),Be("composition_paused",{time:qe.getTime()})},onStopMedia:()=>{m.stopAll();let c=document.querySelectorAll("video, audio");for(let p of c)ge(p)&&!p.paused&&p.pause()},onSeek:(c,p)=>{qe.seek(c),Be("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let p=c||e.mediaOutputMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)ge(y)&&(y.muted=p||y.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,m.setVolume(c);let p=document.querySelectorAll("video, audio");for(let g of p){if(!ge(g))continue;let y=parseFloat(g.dataset.volume??""),E=Number.isFinite(y)?y:1;g.volume=ti(E*c)}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let p=c||e.bridgeMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)ge(y)&&(y.muted=p||y.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(m.stopAll(),f.detachAudioSource()):Ge())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(m.stopAll(),f.detachAudioSource()),Ge())},onSetPlaybackRate:c=>{yo(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Tl()},onSetRootDuration:Bp,onSetColorGrading:(c,p)=>{Ye.setGrading(c,p)},onSetColorGradingCompare:(c,p)=>{Ye.setCompare(c,p)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let c=f.now();if(e.currentTime=c,Lt(c),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let p=f.getDuration();Number.isFinite(p)&&(f.seek(p),e.currentTime=p,Lt(p)),ze("pause"),Ge(),Pe(!0)}},onEnablePickMode:()=>Wr.enablePickMode(),onDisablePickMode:()=>Wr.disablePickMode(),onSetRuntimeData:eo,onClearRuntimeData:to,getCanonicalFps:()=>e.canonicalFps});let _o=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),gt!=null&&(window.clearTimeout(gt),gt=null),e.transportClock=null,m.destroy(),Ft!=null&&(window.clearTimeout(Ft),Ft=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Mp(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Wr.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(p){L("runtime.init.site12",p)}e.deterministicAdapters=[];for(let c of a.splice(0))try{c()}catch(p){L("runtime.init.site13",p)}for(let c of e.injectedCompStyles)try{c.remove()}catch(p){L("runtime.init.site14",p)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(p){L("runtime.init.site15",p)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(p){L("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===_o&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=_o,e.beforeUnloadHandler=_o,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Hf=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Bs=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Hv(e){if(e<=255)return Hf[e];let t=0,n=Bs.length-1;for(;t<=n;){let r=t+n>>1,i=Bs[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Bv(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let d=e.charCodeAt(u),f=d,m=1;if(d>=55296&&d<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(f=(d-55296<<10)+(b-56320)+65536,m=2)}let h=Hv(f);(h==="R"||h==="AL"||h==="AN")&&(r=!0);for(let b=0;b<m;b++)n[u+b]=h;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let d=n[u];if(d==="L"){i=0;break}if(d==="R"||d==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let d;for(d=u-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=u+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let u=0;u<t;u++){let d=n[u];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let d=u+1;for(;d<t&&n[d]==="ON";)d++;let f=u>0?n[u-1]:l,m=d<t?n[d]:l,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let v=u;v<d;v++)n[v]=h;u=d-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let d=n[u];(o[u]&1)===0?d==="R"?o[u]++:(d==="AN"||d==="EN")&&(o[u]+=2):(d==="L"||d==="AN"||d==="EN")&&o[u]++}return o}function Bf(e,t){let n=Bv(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var Uv=/[ \t\n\r\f]+/g,Wv=/[\t\n\r\f]| {2,}|^ | $/;function Vv(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function zv(e){if(!Wv.test(e))return e;let t=e.replace(Uv," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function qv(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
704
|
+
`,_s=new WeakMap;function Cs(e){return tf.has(e)}var tf=new WeakSet;function Rs(e){let t=_s.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(Qy)))}`;await e.audioWorklet.addModule(n),tf.add(e)})().catch(n=>{throw _s.delete(e),n}),_s.set(e,t)),t}function Zy(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,d=0;for(let m=0;m<i;m++){u+=s*(l()-u);let h=u*Math.pow(1-m/i,2.5);o[m]=h,d+=h*h}let f=Math.sqrt(d);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var ue=e=>typeof e=="number"?e:Number(e??0),Ts=e=>e/1e3;function af(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let d=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function sf(e){try{e.stop()}catch{}e.disconnect()}function ks(e,t){return[{param:e},{param:t,map:n=>1-n}]}function lf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ms(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var ev=new Set(["peaking","highpass","lowpass"]),nf=e=>Math.pow(10,e/20),tv=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=nf(ue(i.gain))};return r(t),Ms(n,r,{gain:[{param:n.gain,map:nf}]})};function Ar(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ue(a.frequency),a.q!==void 0&&(i.Q.value=ue(a.q)),t&&(i.gain.value=ue(a.gain))};return o(r),Ms(i,o,{frequency:[{param:i.frequency}],...ev.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function nv(e){return(t,n)=>{let r=Math.tan(Math.PI*ue(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Ms(i,()=>{})}}function Er(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var rv={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},iv=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=rv[String(a.type)]??Math.tanh,s=Math.pow(10,ue(a.threshold)/20),u=8192,d=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=ue(a.oversample)>=4?"4x":ue(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ue(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},ov=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ue(u.time)/1e3),o.gain.value=ue(u.feedback),lf(a,l,ue(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Ts(u))}],feedback:[{param:o.gain}],mix:ks(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},av=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=af(e,"sine",ue(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let d=f=>{o.delayTime.value=ue(f.delay)/1e3,l.gain.value=ue(f.depth)/1e3,a.playbackRate.value=ue(f.speed),lf(s,u,ue(f.mix))};return d(t),{input:r,output:i,update:d,automation:{delay:[{param:o.delayTime,map:Ts}],depth:[{param:l.gain,map:Ts}],speed:[{param:a.playbackRate}],mix:ks(s.gain,u.gain)},dispose:()=>{sf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},sv=6,lv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=af(e,String(t.type)==="1"?"sine":"triangle",ue(t.speed),n),s=e.createGain(),u=e.createGain(),d=e.createGain(),f=[];r.connect(o);let m=o;for(let b=0;b<sv;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),m.connect(v),m=v,f.push(v)}l.connect(s),m.connect(u).connect(a),o.connect(d).connect(a),a.connect(i);let h=b=>{let v=1e3/Math.max(.1,ue(b.delay));for(let x of f)x.frequency.value=v;s.gain.value=v*ue(b.decay),l.playbackRate.value=ue(b.speed),o.gain.value=ue(b.in_gain),a.gain.value=ue(b.out_gain),u.gain.value=1,d.gain.value=1};return h(t),{input:r,output:i,update:h,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{sf(l),[r,i,o,a,s,u,d,...f].forEach(b=>b.disconnect())}}},uv=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let d=`${ue(u.size)}:${ue(u.damping)}`;if(d!==l){let f=Zy(e.sampleRate,ue(u.size),ue(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=d}o.gain.value=ue(u.wet),a.gain.value=ue(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},cv={"gain-node":tv,"biquad-peaking":Ar("peaking",!0),"biquad-lowshelf":Ar("lowshelf",!0),"biquad-highshelf":Ar("highshelf",!0),"biquad-highpass":Ar("highpass",!1),"biquad-lowpass":Ar("lowpass",!1),"worklet-compressor":Er("hf-compressor"),"worklet-limiter":Er("hf-limiter"),"worklet-gate":Er("hf-gate"),"worklet-bitcrush":Er("hf-bitcrush"),"worklet-pitchshift":Er("hf-pitchshift"),waveshaper:iv,"delay-feedback":ov,"chorus-lfo":av,"allpass-phaser":lv,convolver:uv};function uf(e){return e.nodes.some(t=>In(t.type)?.web.startsWith("worklet-")??!1)}function dv(e,t,n,r=0){let i=In(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=Pn(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return nv(t)(e,o,r);let a=cv[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function rf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function of(e){return On(e).map(t=>{let n=Pn(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function cf(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=rf(On(t)),s=r;for(let m of l){let h=null;if(m.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,v.gain.value=1-m.amount,s.connect(b),b.connect(v).connect(_),h={entry:b,wet:x,dry:v,join:_},s=b}for(let b of m.nodes){let v=dv(e,b.type,b.params??{},n);s.connect(v.input),s=v.output,o.push({...b.id?{id:b.id}:{},type:b.type,handle:v})}h&&m.preset&&(s.connect(h.wet).connect(h.join),a.push({id:m.preset,...h}),s=h.join)}s.connect(i);let u=of(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...ks(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:d,nodes:o,update(m){if(of(m)!==u)return!1;On(m).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(Pn(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let h=0;for(let b of rf(On(m))){if(!b.preset)continue;let v=a[h++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:h,dry:b,join:v}of a)m.disconnect(),h.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var df={version:1,nodes:[]},mf={version:1,lanes:[]};function ff(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(ut):null)??"";if(!n)return mf;try{return _u(ui(n),t)}catch{return mf}}function gn(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(It):null)??"";if(!t)return{chain:df,raw:""};try{return{chain:Au(t),raw:t}}catch{return{chain:df,raw:""}}}function pf(e){return ff(e,gn(e).chain)}function Xi(e,t,n,r,i){let{chain:o}=gn(t),a=null,l=[],s=!1,u=0,d=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(C,F)=>{if(C.nodes.length===0){n.connect(r);return}if(uf(C)&&!Cs(e)){n.connect(r);let D=++u;Rs(e).then(()=>{s||D!==u||x(gn(t).chain)}).catch(()=>{});return}try{let D=cf(e,C,F);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},m=(C,F)=>{l=F&&a?Zm(ff(t,C),C,a.nodes,F,a.presets):[]},h=i?{...i}:null;f(o,h?.elapsed??0),m(o,h);let b=()=>{if(!h)return null;let C=typeof e.currentTime=="number"?e.currentTime:h.scheduledAt;return{scheduledAt:C,elapsed:h.elapsed+(C-h.scheduledAt)*h.rate,rate:h.rate}},v=C=>{let F=b();F&&(hn(l,F.scheduledAt),m(C,F))},x=C=>{let F=b();hn(l,F?.scheduledAt??0),d(),f(C,F?.elapsed??0),m(C,F)},_=null,T=t;return typeof MutationObserver<"u"&&typeof T?.nodeType=="number"&&(_=new MutationObserver(()=>{let C=gn(t);l.length>0&&Sr(l),!a||!a.update(C.chain)?x(C.chain):v(C.chain)}),_.observe(T,{attributes:!0,attributeFilter:[It,ut]})),{reanchor:C=>{if(s)return;let F=b();F&&hn(l,F.scheduledAt),h={...C},m(gn(t).chain,h)},setRate:C=>{let F=b();s||!F||!Number.isFinite(C)||C<=0||C===F.rate||(h={...F,rate:C},hn(l,F.scheduledAt),m(gn(t).chain,h))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&hn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var hf="runtime_web_audio_bypass";function Fs(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function wr(e,t){return Fs(e,t)!==null}function mv(e){return wr(e,"crossorigin")?!0:e.crossOrigin!=null}function fv(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function pv(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Fs(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function hv(e,t){let n;try{n=new URL(e,fv(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function gv(){return typeof window.origin=="string"?window.origin:window.location.origin}function bv(e,t){if(typeof window>"u")return null;let n=hv(e,t);if(!n)return null;let r=gv(),i=r==="null";return!i&&n.origin===r||mv(t)?null:i?"opaque_document_origin":"cross_origin_no_cors"}function bf(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:wr(e,"src")}function bn(e){for(let t of pv(e)){let n=bv(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function xv(e){let t=[];wr(e,It)&&t.push("fx-chain"),wr(e,ut)&&t.push("automation"),wr(e,di)&&t.push("audio-group");let n=Number.parseFloat(Fs(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function yv(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var gf=new WeakSet,vv={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document's security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},Sv={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function xn(e,t){if(t.kind==="web-audio"||yv()||gf.has(e))return;let n=xv(e);gf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:vv[t.reason]};ve({source:"hf-preview",type:"diagnostic",code:hf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 ${Sv[t.reason]}`:"";console.info(`[hyperframes] ${hf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Ns(e){return!Number.isFinite(e)||e<=0?1:e}function xf(e){return Ue(e)}function Av(e,t){t||e.paused||!Kr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Ev(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let d=-n/o;return s?e.start(i+d,r,u):e.start(i+d,r),!0}function Ji(e,t,n){let r=ef(pf(e));r&&ws([{param:t.gain}],r,li.scale,n)}function _r(e){return e.sourceKind==="buffer"}var Qi=class{constructor(){ye(this,"_ctx",null);ye(this,"_bufferCache",new Map);ye(this,"_failedSrcs",new Set);ye(this,"_mediaElementSources",new WeakMap);ye(this,"_activeSources",[]);ye(this,"_masterGain",null);ye(this,"_masterVolume",1);ye(this,"_masterMuted",!1);ye(this,"_groups",new Map);ye(this,"_rateAnchorCtx",0);ye(this,"_rateAnchorComp",0);ye(this,"_rate",1);ye(this,"_paused",!0);ye(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return L("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return L("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),L("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=bn(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),xn(t,o),null}return n}if(!this._ctx)return null;let r=bn(t);if(r.kind!=="web-audio")return xn(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Ns(l),d=this._ctx.createGain();d.gain.value=o;let f=this._ctx.currentTime,m=i-n,h={scheduledAt:f,elapsed:m,rate:u},b=Xi(this._ctx,t,s,d,h);d.connect(this.resolveDestination(t,f,i,u)??this._masterGain),Ji(t,d,h),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:d,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Le(t),bounded:!1};return t.volume=1,this._activeSources.push(v),this._paused=!1,v}catch(s){return L("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(m){L("webAudioTransport.groupReanchor",m)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>$o(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let d=this._ctx.createGain();d.gain.value=xf(qo(s)),d.connect(u);let f=Xi(this._ctx,s??{getAttribute:()=>null},o,d,r);return s&&Ji(s,d,r),this._groups.set(t,{input:o,fader:d,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{Sr([{param:d.gain}]);let h=l();d.gain.value=xf(qo(h)),u.gain.value=h?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),h&&Ji(h,d,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),d.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){L("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=ku(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let d=Ns(s),f=Le(t),m=d*f,h=this._ctx.createBufferSource();h.buffer=n,h.playbackRate.value=m;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:d},T=Xi(this._ctx,t,h,b,_);if(b.connect(this.resolveDestination(t,x,o,d)??this._masterGain),Ji(t,b,_),this._rate=d,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Ev(h,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:d,mediaRate:f,clipDuration:u}))return h.disconnect(),T?.dispose(),b.disconnect(),null;let C=t.muted;t.muted=!0,Av(t,C);let F={fx:T,el:t,sourceNode:h,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(F),this._paused=!1,h.addEventListener("ended",()=>this.handleSourceEnded(h,F,t,C)),F}catch(d){return L("webAudioTransport.schedule",d),null}}setRate(t){let n=Ns(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{_r(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>_r(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{_r(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}_r(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Ue(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&_r(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var Cr="data-hf-studio-manual-edit-gesture";var yf=`[${Cr}]`;function vf(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(yf)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(yf)),i=l=>{for(let s of l){let u=s.target;Ne(u)&&(u.hasAttribute(Cr)?r.add(u):r.delete(u))}},o=l=>{l.length!==0&&(i(l),t())},a=new n(o);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Cr]}),{observing:!0,isActive:()=>{o(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Cr))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var Sf=333.3333333333333;function Af(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var wv=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function Ef(e){return Math.max(0,Math.min(1,e))}function wf(e){let t=wv.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Ef(n):null}function _f(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Ef(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var _v=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Cv=Math.PI*2;function Rv(e){let t=_v.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Tv(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(Cv*t*e)}function Cf(e,t){let n=Rv(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Tv(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var kv=24,Rf=e=>e>=1?1:0,Mv=e=>e,Zi=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Fv=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${Zi}\s*,\s*${Zi}\s+${Zi}\s*,\s*${Zi}\s+1\s*,\s*1\s*$`,"i");function Tf(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Nv(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<kv;l+=1){let s=(o+a)/2;Tf(s,t,r)<e?o=s:a=s}return Tf((o+a)/2,n,i)}function Lv(e){let t=Fv.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>Nv(a,n,r,i,o)}function Dv(e,t){if(!e.startsWith("spring("))return null;let n=wf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>_f(o,n);return t.set(n,i),i}function Iv(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=Lv(n);return i&&t.set(n,i),i}function kf(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?Rf:Cf(s,i)??Dv(s,r)??Iv(s,n),a=(s,u,d=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Be("custom_ease_parse_failed",{ease:s}),t.call(u,s,...d)??Mv)};e.parseEase=function(u,...d){return a(u,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",Rf);let s=u=>{let d=f=>f;d.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Is=new Map,Rr=new Map,Ls=new Map,Ds=()=>{},Ff=()=>{},Mf=0;function Ps(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function Nf(e){let t=(Ls.get(e)??0)+1;return Ls.set(e,t),t}function Lf(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Mf-=1,Mf)}function Os(e,t){let n=Rr.get(e);if(!n)return;let r=()=>Ls.get(e)===t.generation&&Rr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Ff(e,t.requestId)},i=>{r()&&Ds(e,t.requestId,i)})}catch(i){r()&&Ds(e,t.requestId,i)}}function Df(e){Ds=e}function If(e){Ff=e}function eo(e,t,n){if(!Ps(e))return;let r={payload:t,requestId:Lf(n),generation:Nf(e)};Is.set(e,r),Os(e,r)}function to(e,t){Ps(e)&&(Is.delete(e),Os(e,{payload:void 0,requestId:Lf(t),generation:Nf(e)}))}function Pf(e,t){if(!Ps(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Rr.set(e,t);let n=Is.get(e);return n&&Os(e,n),()=>{Rr.get(e)===t&&Rr.delete(e)}}var Gs="data-hf-authored-duration",Hs="data-hf-authored-end",Of=!1;function rt(e){if(e){if(typeof e.pause!="function"){Of||(Of=!0,Be("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function Gv(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function Gf(){let e=bc(),t=()=>{};Ll(ve),Df((c,p,g)=>{ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)})}),If((c,p)=>{try{t()}catch(g){ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)});return}ve({source:"hf-preview",type:"runtime-data-applied",channel:c,requestId:p})}),Hi(document),ms(document),Mu(document);let n=Gv();e.canonicalFps=n.fps??e.canonicalFps,Fl(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,d=(c,p,g)=>{u.has(c)||(u.add(c),Be(p,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){L("runtime.init.site1",c)}let f=new Yi;e.transportClock=f;let m=new Qi,h=!1;m.init().then(c=>{h=c}),window.__hf=window.__hf||{};let b=c=>c.closest("[data-hidden]")!==null||mi(c.ownerDocument,c),v=()=>{let c=window.gsap,p=window;if(!(!c?.registerPlugin||p.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(g){d("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},x=()=>{let c=window.gsap;if(!c){d("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{kf(c)||d("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){d("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",p)}};v(),x(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Bl(document)}catch(c){L("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let _=()=>{let c=document.querySelector('[data-composition-id][data-root="true"]');if(Se(c))return c;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,p=_()?.getAttribute("data-composition-id")??"root",g={};if(c.length===1)g[p]=c[0];else for(let y=0;y<c.length;y++)g[`tl-${y}`]=c[y];window.__timelines=g}let T=_();T&&!T.hasAttribute("data-start")&&T.setAttribute("data-start","0");let C=c=>{a.push(c)},F=(c,p,g)=>{let y=g??`${c}:${JSON.stringify(p)}`;l.has(y)||(l.add(y),ve({source:"hf-preview",type:"diagnostic",code:c,details:p}))},D=c=>{let p={scale:1,focusX:960,focusY:540},g=[],y=[],E={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...E,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},M=1/60,S=.75,A=.05,w=100,R=240,I=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},H=c=>{let p=c.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},j=c=>{if(c==null||c.trim()==="")return null;let p=Number.parseFloat(c);return!Number.isFinite(p)||p<=0?null:`${p}px`},X=()=>_(),k=()=>{let c=X();if(!c)return;let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g),p&&c.style.setProperty("--comp-width",p),g&&c.style.setProperty("--comp-height",g),p&&(document.documentElement.style.width=p),g&&(document.documentElement.style.height=g),p&&(document.body.style.width=p),g&&(document.body.style.height=g)},U=()=>{let c=X(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(c&&g===c)continue;let y=g.getAttribute("data-duration"),E=g.getAttribute("data-end");y!=null&&!g.hasAttribute(Gs)&&g.setAttribute(Gs,y),E!=null&&!g.hasAttribute(Hs)&&g.setAttribute(Hs,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},te=()=>{let c=X();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g);let y=Array.from(c.children);for(let E of y){let N=E.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let P=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",K=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(P&&K&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Y=E.style.top,Re=E.style.left,Dt=E.style.width,Fe=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let Xe=window.getComputedStyle(E);Xe.top!=="auto"||Xe.bottom!=="auto"||Xe.left!=="auto"||Xe.right!=="auto"||Xe.width!=="0px"||Xe.height!=="0px"||(E.style.top=Y,E.style.left=Re,E.style.width=Dt,E.style.height=Fe)}let $=window.getComputedStyle(E),ne=$.position;if(ne!=="absolute"&&ne!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||$.left!=="auto"||$.right!=="auto"||(E.style.left="0"),N!=="audio"){let Y=j(E.getAttribute("data-width")),Re=j(E.getAttribute("data-height")),Dt=$.width!=="0px"&&$.width!=="auto",Fe=$.height!=="0px"&&$.height!=="auto";Y?!E.style.width&&!Dt&&(E.style.width=Y):!E.style.width&&$.width==="0px"&&(E.style.width="100%"),Re?!E.style.height&&!Fe&&(E.style.height=Re):!E.style.height&&$.height==="0px"&&(E.style.height="100%")}}},B=c=>st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:c}),G=null,W=c=>{let p=G;G=B(!0);try{return c()}finally{G=p}},Q=c=>c&&G?G:B(c),q=(c,p=0,g)=>Q(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(c,p),O=(c,p)=>Q(p?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(c),V=c=>{let p=c.closest("[data-composition-id]"),g=p?q(p,0):null,y=p?O(p,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:p,inheritedStart:g,inheritedDuration:y}},Z=c=>Q(!0).resolveMediaStartForElement(c);window.__hfResolveMediaStartSeconds=Z,a.push(()=>{window.__hfResolveMediaStartSeconds===Z&&delete window.__hfResolveMediaStartSeconds});let pe=(c,p)=>{let g=c.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let E=g==="video"||g==="audio"?Z(c):q(c,0),N=O(c),P=c.getAttribute("data-composition-id");if(P){let Ee=(window.__timelines??{})[P],He=null;if(Ee&&typeof Ee.duration=="function"){let Y=Number(Ee.duration());Number.isFinite(Y)&&Y>0&&(He=Y)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(Gs)||c.hasAttribute(Hs))&&(N==null||N<=0)&&He!=null&&(N=He)}let K=N!=null&&N>0?E+N:Number.POSITIVE_INFINITY,$=window.__HF_EXPORT_RENDER_SEEK_CONFIG?xa(E,e.canonicalFps):E,ne=window.__HF_EXPORT_RENDER_SEEK_CONFIG&&Number.isFinite(K)?xa(K,e.canonicalFps):K;return p>=$&&(Number.isFinite(ne)?p<ne:!0)},re=!!document.querySelector("[data-composition-src]"),z=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of c){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){z=!0;break}}}let J=!re&&!z,Ae=c=>{if(!c||typeof c.duration!="function")return null;try{let p=Number(c.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},ce=c=>typeof c=="number"&&Number.isFinite(c)&&c>M,Sn=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));return c.length===0?null:W(()=>{let p=0;for(let g of c){let y=Z(g);if(!Number.isFinite(y))continue;let E=ri(g);E==null||E<=M||(p=Math.max(p,Math.max(0,y)+E))}return p>M?p:null})},it=()=>{let c=X();if(!c)return null;let p=window.__timelines??{},g=st({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),y=0,E=Ce(c.getAttribute("data-duration"));E!=null&&E>0&&(y=E);let N=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let P of N){if(!Ne(P)||P.parentElement?.closest("[data-composition-id]")!==c)continue;let $=g.resolveStartForElement(P,0),ne=g.resolveDurationForElement(P);!Number.isFinite($)||ne==null||ne<=0||(y=Math.max(y,Math.max(0,$)+ne))}return y>M?y:null},yp=()=>{let c=Sn();return typeof c!="number"||!Number.isFinite(c)||c<=M?null:c},vp=c=>ce(c)?Math.max(M,c*S):M,Ys=()=>{let c=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let y=null;try{y=g()}catch(E){L("runtime.init.adapterDuration",E)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(c=Math.max(c,y))}return c>M?c:null},Mr=!1,Xs=()=>Mr&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,Sp=["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",ii,"data-playback-rate","data-playback-start","data-media-start","id","src"],Js=["loadedmetadata","durationchange","emptied"],Fr=null,Qs=-1,Zs=null,Mt=null,el=0,zt=()=>{},qt=()=>{el+=1,zt()},tl=()=>({media:yp(),authoredComposition:it()}),Ap=()=>{let c=window.__timelines??{},p="";for(let g of Object.keys(c)){let y=c[g];y&&(p+=`${g}=${Ae(y)??"?"};`)}return p},Ep=()=>{if(!(Mt||typeof MutationObserver>"u")){Mt=new MutationObserver(qt),Mt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Sp});for(let c of Js)document.addEventListener(c,qt,!0);a.push(()=>{Mt?.disconnect(),Mt=null,qt();for(let c of Js)document.removeEventListener(c,qt,!0)})}},Nr=()=>{Ep(),Mt&&Mt.takeRecords().length>0&&qt();let c=Ap();return c!==Zs&&(Zs=c,qt()),el},nl=c=>Mr?tl():(c??(c=Nr()),Fr&&Qs===c||(Qs=c,Fr=tl()),Fr),ot=(c,p=0,g)=>{let y=Ae(c),{media:E,authoredComposition:N}=nl(g),P=Ys(),K=Math.max(E??0,N??0,P??0),$=Number.isFinite(p)&&p>M?p:0,ne=0;return ce(y)?ne=Math.max(y,K,$):ce(K)?ne=Math.max(K,$):ne=$,ne>0?Math.max(0,ne):0},uo=()=>{let c=window.__timelines??{},p=de=>{let se=Object.entries(c).filter(me=>!!me[1]&&typeof me[1].play=="function"&&typeof me[1].pause=="function");if(se.length!==1)return{timeline:null};let ie=se[0];if(!ie)return{timeline:null};let[xe,we]=ie;return{timeline:we,selectedTimelineIds:[xe],selectedDurationSeconds:Ae(we),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:de,soleTimelineId:xe}}}},g=st({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),{media:y,authoredComposition:E}=nl(),N=Math.max(y??0,E??0)||null,P=vp(N),K=de=>{let se=document.querySelector(`[data-composition-id="${CSS.escape(de)}"]`);return se?g.resolveStartForElement(se,0):0},$=de=>{let se=window.gsap;if(!se||typeof se.timeline!="function")return null;let ie=se.timeline({paused:!0});for(let xe of de)ie.add(xe.timeline,K(xe.compositionId));return ie},ne=(de,se)=>{if(!ce(de))return null;let ie=window.gsap;if(!ie||typeof ie.timeline!="function")return null;let xe=ie.timeline({paused:!0});if(se)try{xe.add(se,0)}catch(me){L("runtime.init.site2",me)}let we=xe;if(typeof we.to=="function")try{we.to({},{duration:de})}catch(me){L("runtime.init.site3",me)}return xe},Ee=(de,se)=>{if(!de||typeof de.getChildren!="function")return[];try{let ie=de.getChildren(!0,!0,!0);return Array.isArray(ie)?se.filter(xe=>ie.includes(xe.timeline)):[]}catch{return[]}},He=(de,se)=>{let ie=de,xe={addedIds:[],nested:[]};if(typeof ie.getChildren!="function")return xe;try{let we=ie.getChildren(!0,!0,!0)??[];if(!Array.isArray(we))return xe;let me=[];for(let _e of se)if(!we.some(at=>at===_e.timeline))try{let at=K(_e.compositionId);de.add(_e.timeline,at),me.push(_e.compositionId)}catch(at){L("runtime.init.site4",at)}return{addedIds:me,nested:Ee(de,se)}}catch{return xe}},ae=X(),Y=ae?.getAttribute("data-composition-id")??null;if(!Y)return p("root_missing_composition_id");let Re=c[Y]??null,Fe=(()=>{if(!ae)return[];let de=new Set,se=Array.from(ae.querySelectorAll("[data-composition-id]")),ie=[];for(let xe of se){let we=xe.getAttribute("data-composition-id");if(!we||we===Y||de.has(we))continue;de.add(we);let me=c[we]??null;if(!me||typeof me.play!="function"||typeof me.pause!="function")continue;let _e=Ae(me);ie.push({compositionId:we,timeline:me,durationSeconds:_e??0})}return ie})(),Xe=de=>{for(let se of de){let ie=se.timeline;if(typeof ie.paused=="function")try{ie.paused(!1)}catch(xe){L("runtime.init.site5",xe)}}};if(Re){let de=Fe.length>0?He(Re,Fe):{addedIds:[],nested:[]},se=de.addedIds;if(Xe(de.nested),(Fe.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+Y+"'])"))&&(Lr=!0),se.length>0)try{let me=Re.time();Re.seek(me,!1)}catch{}let ie=Ae(Re);if(!ce(ie)&&Fe.length>0){let me=Fe.map(th=>th.compositionId),_e=$(Fe),jt=Ae(_e);if(_e&&ce(jt))return Xe(Ee(_e,Fe)),{timeline:_e,selectedTimelineIds:me,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:me,autoNestedChildren:se}}};let at=ne(N??0,Re),Co=Ae(at);if(at&&ce(Co))return{timeline:at,selectedTimelineIds:[Y],selectedDurationSeconds:Co,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Co,selectedTimelineIds:[Y],autoNestedChildren:se}}}}if(!ce(ie)&&Fe.length===0){let me=ne(N??0,Re),_e=Ae(me);if(me&&ce(_e))return{timeline:me,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:_e,selectedTimelineIds:[Y]}}}}let xe=Ce(ae?.getAttribute("data-duration")),we=Math.max(ce(xe)?xe:0,E??0);if(we>0&&ce(we)&&ce(ie)&&we>=ie+.5){let me=Re;if(typeof me.to=="function")try{me.to({},{duration:0},we)}catch(jt){L("runtime.init.site6",jt)}let _e=Ae(Re);if(ce(_e))return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Y,rootDurationSeconds:ie,rootDeclaredDur:xe,authoredCompositionDurationFloorSeconds:E,newDur:_e}}}}return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Y,selectedDurationSeconds:ie,autoNestedChildren:se}}:void 0}}if(Fe.length>0){let de=Fe.map(xe=>xe.compositionId),se=$(Fe),ie=Ae(se);if(se)return Xe(Ee(se,Fe)),{timeline:se,selectedTimelineIds:de,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Y,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,selectedTimelineIds:de}}}}return p("root_composition_id_unmatched_in_registry")},Lr=!1,wp=c=>{let p=window.gsap,g=c;if(!(!g||typeof g.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let y of g.getChildren(!0,!0,!0)){let E=y,N=E.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let P=E.vars?.keyframes,$=(P&&!Array.isArray(P)?P.ease:void 0)??E.vars?.ease??"none";try{let ne=p.parseEase($);typeof ne=="function"&&(N._ease=ne)}catch(ne){Be("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",ne)}}},An=()=>{if(x(),!J)return!1;let c=e.capturedTimeline,p=Ae(c),g=ce(p);if(c&&g&&Lr)return!1;let y=uo();if(!y.timeline)return!1;if(c&&c===y.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),wp(e.capturedTimeline);let E=ot(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),rt(e.capturedTimeline)),E>0){try{f.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let P=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(P,!1),rt(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),Hi(document)}if(y.diagnostics&&ve({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),ve({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=X(),P=E>0?E:0,K=String(P>0?P:1),$=new Set,ne=ae=>ae.tagName.toLowerCase()===Zt,Ee=new Set(document.querySelectorAll("[data-start]")),He=ae=>{let Y=ae.parentElement;for(;Y&&Y!==N;){if(Ee.has(Y))return!0;Y=Y.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ae of e.capturedTimeline.getChildren(!0))if(typeof ae.targets=="function")for(let Y of ae.targets())Se(Y)&&Y!==N&&(ne(Y)||Y.hasAttribute("data-start")||He(Y)||$.has(Y)||($.add(Y),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration",K),Y.setAttribute("data-hf-autostamped","1")))}catch{}if(Se(N))for(let ae of N.querySelectorAll("[id]"))Se(ae)&&ae!==N&&(ae.hasAttribute("data-start")||He(ae)||$.has(ae)||ae.tagName==="SCRIPT"||ae.tagName==="STYLE"||ae.tagName==="LINK"||ne(ae)||($.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",K),ae.setAttribute("data-hf-autostamped","1")))}for(let N of En)Dr.delete(N),ul(N);return!0},rl=()=>{if(e.tornDown)return;let c=uo();if(!c.timeline){e.capturedTimeline=null,Lr=!1,f.setDuration(0),Hr(e.currentTime);return}e.capturedTimeline!==c.timeline&&(Lr=!1,An()),Hr(e.currentTime)};t=()=>{rl(),ht()},window.__hfForceTimelineRebind=rl;let _p=()=>{let c=X();if(!Se(c))return;let p=c.getBoundingClientRect(),g=Number(c.getAttribute("data-width")),y=Number(c.getAttribute("data-height")),E=window.getComputedStyle(c),N=Number.isFinite(g)&&g>0&&Number.isFinite(y)&&y>0,P=p.width<=0||p.height<=0||c.clientWidth<=0||c.clientHeight<=0;!N||!P||F("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:y,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},Cp=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,_p()}))},Rp=()=>{i=c=>{let p=I(c.error??c.message).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},o=c=>{let p=I(c.reason).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Tp=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of c){let y=()=>{if(!Ne(g))return;let E=g.tagName.toLowerCase(),N=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";F(P,{tagName:E,assetUrl:N,currentSrc:(Oe(g)||ge(g))&&g.currentSrc||null,readyState:ge(g)?g.readyState:null,networkState:ge(g)?g.networkState:null},`${P}:${E}:${N??"unknown"}`)};g.addEventListener("error",y),C(()=>{g.removeEventListener("error",y)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let g=Array.from(p).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);g.length!==0&&F("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},kp=(c,p)=>{if(!c.timeline)return!1;let g=e.capturedTimeline;if(g&&g===c.timeline)return!1;let y=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{rt(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){L("runtime.init.site7",N)}return ve({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:y,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},Ft=null,il=!1,En=new Set,Dr=new WeakMap,Ir=()=>{e.tornDown||(Ft!=null&&window.clearTimeout(Ft),Ft=window.setTimeout(()=>{if(e.tornDown||(Ft=null,Xs()))return;let c=uo();if(!c.timeline||!ce(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){An()&&(ht(),Pe(!0));return}if(il)return;let g=Ae(e.capturedTimeline),y=c.selectedDurationSeconds??Ae(c.timeline);ce(y)&&(!ce(g)||y>=g+A)&&kp(c,"manual")&&(il=!0,ve({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:y??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),ht(),Pe(!0))},w))},ol=c=>{ge(c.currentTarget)&&Gu(c.currentTarget)},al=c=>{ge(c.currentTarget)&&Hu(c.currentTarget)},sl=c=>{Lo(c)&&bf(c)&&xn(c,bn(c))},ll=c=>{let p=c.currentTarget;ge(p)&&sl(p)},Mp=()=>{for(let c of En)c.removeEventListener("loadedmetadata",Ir),c.removeEventListener("durationchange",Ir),c.removeEventListener("loadedmetadata",ol),c.removeEventListener("loadedmetadata",ll),c.removeEventListener("error",al);En.clear()},co=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let p of c){if(En.has(p))continue;En.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",Ir),p.addEventListener("durationchange",Ir),p.addEventListener("loadedmetadata",ll),sl(p),p.addEventListener("loadedmetadata",ol),p.addEventListener("error",al),Ou(p),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),ul(p)}},ul=c=>{Dr.has(c)||bu(c,e.capturedTimeline,ot(e.capturedTimeline,0),Dr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},mo=new WeakMap,Fp=c=>{let p=mo.get(c);if(p!==void 0)return p;let g=window.getComputedStyle(c).position,y=g==="static"||g==="relative"||g==="sticky";return mo.set(c,y),y},fo=new WeakMap,Np=c=>{let p=fo.get(c);if(p!==void 0)return p;let g=c.querySelector("[data-start]")===null;return fo.set(c,g),g},Lp=()=>{mo=new WeakMap,fo=new WeakMap},po=new WeakSet,ho=new WeakMap,Pr=new WeakSet,Or=!1,cl=c=>c.matches("audio[data-start]")||c.querySelector("audio[data-start]")!==null,dl=new WeakMap,Gr=!0,Dp=()=>{if(Gr){Gr=!1;for(let c of document.querySelectorAll(Zt)){let p=c.hasAttribute("data-hidden");dl.get(c)!==p&&(dl.set(c,p),c.id&&m.setGroupMuted(c.id,p))}}},Ip=(c,p)=>{let g=X();for(let y of p){if(!Se(y))continue;if(y.hasAttribute("data-hidden")){Pr.has(y)||(ho.set(y,y.style.getPropertyValue("display")),Pr.add(y),cl(y)&&(Or=!0),Gr=!0),y.style.display="none",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,!1);continue}if(Pr.has(y)){let N=ho.get(y);N?y.style.display=N:y.style.removeProperty("display"),ho.delete(y),Pr.delete(y),cl(y)&&(Or=!0),Gr=!0}let E=pe(y,c);if(E){let N=y.parentElement;for(;N&&N!==g;){if(Se(N)&&N.hasAttribute("data-start")&&!pe(N,c)){E=!1;break}N=N.parentElement}}y.style.visibility=E?"visible":"hidden",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,E),E?po.has(y)&&(y.style.removeProperty("display"),po.delete(y)):Fp(y)&&Np(y)&&(y.style.display="none",po.add(y))}Or&&f.isPlaying()&&(m.stopAll(),wo()),Or=!1,Dp()},Hr=(c,p=Array.from(document.querySelectorAll("[data-start]")))=>W(()=>Ip(c,p)),wn=null,_n=null,Br=[],ml=c=>c.hasAttribute("data-start")||!!V(c).compositionRoot,go=c=>Nu({elements:c,shouldIncludeElement:ml,resolveStartSeconds:p=>Z(p),resolveDurationSeconds:p=>{let g=V(p),y=Z(p),E=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-y):null,N=Number.isFinite(p.duration)?xt(p,p.duration):null,P=Ce(p.dataset.duration),K=P!=null&&P>0?P:null;return Fu({isVideo:p.tagName==="VIDEO",sourceDuration:N,hostRemaining:E,explicitDuration:K})}}),Pp=()=>{let c=Nr();if(wn&&wn.revision===c)return wn;let p=go().mediaClips;return wn={revision:c,clips:p,byStart:[...p].sort((g,y)=>g.start-y.start),byEnd:[...p].sort((g,y)=>g.end-y.end)},_n=null,Br=[],wn},fl=(c,p,g,y)=>{let E=0,N=c.length;for(;E<N;){let K=E+N>>1;p(c[K])<g?E=K+1:N=K}let P=[];for(let K=E;K<c.length&&p(c[K])<=y;K+=1)P.push(c[K]);return P},Op=(c,p)=>{let g=_n;if(g===null)return c.clips.map(P=>P.el);let y=Math.min(g,p),E=Math.max(g,p),N=new Set;for(let P of Br)N.add(P.el);for(let P of fl(c.byStart,K=>K.start,y,E))N.add(P.el);for(let P of fl(c.byEnd,K=>K.end,y,E))N.add(P.el);return[...N]},Ur=new WeakSet,pl=c=>{Ur.add(c)},hl=c=>{Ur.delete(c)};window.__hf.leasePausedMedia=pl,window.__hf.releasePausedMedia=hl;let Gp=()=>{for(let c of document.querySelectorAll("video, audio"))if(ge(c)&&!c.paused&&ml(c)&&!Ur.has(c))return!0;return!1},gl=()=>zt();document.addEventListener("play",gl,!0),a.push(()=>{document.removeEventListener("play",gl,!0)});let Ge=()=>{let c=!Mr,p=W(()=>{if(!c)return go().mediaClips;let E=Pp();return go(Op(E,e.currentTime)).mediaClips});for(let E of p){let N=Dr.get(E.el);N&&(E.volumeKeyframes=N)}let g=e.isPlaying?p:p.filter(E=>!Ur.has(E.el)),y=e.mediaForceSyncNextTick;y&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||(Lu({clips:g,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:y,onElementVolume:(E,N,P)=>m.setElementVolume(E,P),isWebAudioOwned:E=>m.ownsElement(E),isWebAudioRouted:E=>m.routesElement(E),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,ve({source:"hf-preview",type:"media-autoplay-blocked"}))}}),c?(_n=e.currentTime,Br=p.filter(E=>e.currentTime>=E.start&&e.currentTime<E.end)):(_n=null,Br=[])),Hr(e.currentTime)},Pe=c=>{c&&zt();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(c||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,ve({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},bo="",bl=0,Hp=()=>{let c="";for(let p of document.querySelectorAll("[data-start]"))c+=`${p.id}:${p.tagName}|`;return c},ht=()=>{U(),k(),te();let c=X();if(c){let y=j(c.getAttribute("data-width")),E=j(c.getAttribute("data-height")),N=y?parseInt(y,10):0,P=E?parseInt(E,10):0;N>0&&P>0&&ve({source:"hf-preview",type:"stage-size",width:N,height:P})}An();let p=Ac({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=Hp();if(bo!==g&&Lp(),!window.__clipTree||bo!==g){let y=window;window.__clipTree=xc({startResolver:st({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),bo=g}ve(p),Cp()},xo=c=>typeof c=="number"&&Number.isFinite(c)&&c>0?c:0,Bp=c=>{let p=xo(Number(c));if(p<=0)return;let g=X(),y=xo(Ce(g?.getAttribute("data-duration"))),E=Math.max(bl,xo(f.getDuration()),y);p<=E||(bl=p,g?.setAttribute("data-duration",String(p)),f.setDuration(p),ht(),Pe(!0))},ze=(c,p=0)=>{for(let g of e.deterministicAdapters){try{c==="discover"&&g.discover(),c==="pause"&&g.pause(),c==="play"&&g.play&&g.play()}catch(y){L("runtime.init.site8",y)}if(c==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},Nt=()=>{window.__renderReady=!1},Cn=null,Rn=!0,Up=()=>{let c=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let y=g();y&&c.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return c},Wp=()=>{let c=Up();if(c.length===0)return Cn=null,Rn=!0,!0;let p=c[0];if(!p)return!0;let g=c.length===1?p:Promise.all(c);return g!==Cn&&(Cn=g,Rn=!1,Promise.resolve(g).then(()=>{Cn===g&&(Rn=!0,Nt())},y=>{Cn===g&&(Rn=!0,L("runtime.init.adapterReady",y),Nt())})),Rn};if(J)os();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:j,onDiagnostic:({code:p,details:g})=>{ve({source:"hf-preview",type:"diagnostic",code:p,details:g})}};fm(c).then(()=>mm(c)).finally(()=>{J=!0,co(),Tp(),os(),ms(document),Nt()})}let Wr=fc({postMessage:c=>ve(c)});Wr.installPickerApi(),Hr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let Ye=Qm({lease:pl,release:hl});r=Ye,C(()=>{Ye.destroy(),r=null});let yo=c=>{let p=Number(c);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let y of g)if(ge(y))try{y.playbackRate=e.playbackRate}catch(E){L("runtime.init.site10",E)}},xl={play:()=>{let c=e.capturedTimeline;if(f.isPlaying())return;let p=ot(c,0);if(p>0)f.setDuration(p),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Lt(0));else{let g=X(),y=Number(g?.getAttribute("data-duration")??0);y>0&&f.setDuration(y)}rt(c),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Rl(f.now()),h&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&wo(),ze("play"),Ge(),Ye.redraw(),Pe(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Rl(e.currentTime);let c=e.capturedTimeline;rt(c),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},seek:(c,p)=>{let g=on(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let y=f.isPlaying();y&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(rt(E),Lt(e.currentTime),ze("pause"),p?.keepPlaying&&y){xl.play();return}Ge(),Ye.redraw(),Pe(!0)},renderSeek:(c,p)=>{Mr=!0;let g=on(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Lt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},getTime:()=>f.now(),getDuration:()=>{let c=f.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:c=>{yo(c),f.setRate(e.playbackRate),Tl()},getPlaybackRate:()=>e.playbackRate},yl=ot(e.capturedTimeline,0);yl>0&&f.setDuration(yl);let qe=gc({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:yo,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,p)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Ge()},onStatePost:Pe,onDeterministicSeek:(c,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(c)||0,suppressEvents:p?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>ze("pause"),onDeterministicPlay:()=>ze("play"),onRenderFrameSeek:()=>{Ye.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>ot(e.capturedTimeline,0),transport:xl});window.__player=D(qe),window.__playerReady=!0,Be("composition_loaded",{duration:qe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[uu(),ql({resolveStartSeconds:c=>q(c,0)}),jl(),Yl(),Ql(),Zl(),eu(),tu(),nu(),ru(),iu(),$l({getTimeline:()=>e.capturedTimeline})],su(),lu(),window.__hfReseekGpu=c=>{let p=Math.max(0,Number(c)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,ei(p)},window.__hfWaitForSeekCompletion=Ho,a.push(()=>{window.__hfWaitForSeekCompletion===Ho&&delete window.__hfWaitForSeekCompletion}),Rp(),co(),ze("discover");let Vp=()=>{let c=e.capturedTimeline,p=An();e.capturedTimeline&&(p||e.capturedTimeline!==c||!qe._timeline)&&(qe._timeline=e.capturedTimeline);let g=ot(e.capturedTimeline,0);if(g>0&&f.setDuration(g),ze("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},E=Object.keys(y).filter(N=>y[N]);if(E.length>0){let P=X()?.getAttribute("data-composition-id")??null;F("root_timeline_unbound_registry_present",{reason:P?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:P,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(P?`Root data-composition-id is "${P}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${P??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,ht(),Pe(!0)},$t=null,zp=()=>{if($t)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),$t=null,Nt()};$t=c,window.addEventListener("hf-timelines-built",c)};C(()=>{$t&&(window.removeEventListener("hf-timelines-built",$t),$t=null)}),Nt=()=>{if(!J){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,zp();return}if(ze("discover",e.currentTime),!Wp()){window.__renderReady=!1;return}Vp()},Nt(),J&&setTimeout(()=>{Nt()},0);let Vr=0,zr=!1,vo=Number.NaN,So=null,qr=!1,gt=null,$r=!1,vl="",Sl=-1,jr=!1,Al=Number.NEGATIVE_INFINITY,qp=(c,p,g,y)=>{try{let E=y?.suppressEvents===!0;rt(c),typeof c.totalTime=="function"?c.totalTime(p,E):c.seek(p,E)}catch(E){L(g,E)}},$p=(c,p)=>{let g=window.__timelines??{},y=X()?.getAttribute("data-composition-id")??null;for(let[E,N]of Object.entries(g)){if(!N||E===y)continue;let P=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!P)continue;let K=q(P,0);if(!Number.isFinite(K))continue;let $=Ae(N),ne=Qe(P)+Math.max(0,c-K)*Le(P),Ee=Math.max(0,$!=null&&$>0?Math.min($,ne):ne);qp(N,Ee,"runtime.init.transport.childTimeline",p)}},jp=c=>{let p=window.__timelines??{},g=[];for(let y of Object.values(p))if(!(!y||y===c)){g.push(y);try{y.play()}catch(E){L("runtime.init.activateSiblings",E)}}return g},El=c=>typeof c=="object"&&c!==null,Tn=new WeakMap,Kp=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],wl=(c,p)=>{let g=c[p];if(typeof g!="function")return null;try{let y=Number(g.call(c));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Yp=c=>{let p=Tn.get(c);if(p!=null)return p;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let g;try{g=c.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),Tn.set(c,!1),!1}if(!Array.isArray(g))return Tn.set(c,!1),!1;for(let y of g){if(!El(y))continue;let E=y.vars;if(!El(E)||!Kp.some($=>typeof E[$]=="function"))continue;let K=wl(y,"totalDuration")??wl(y,"duration");if(K!=null&&K<=1e-6)return Tn.set(c,!0),!0}return Tn.set(c,!1),!1};function Lt(c,p){let g=e.capturedTimeline,y=g&&p?.activateChildren?jp(g):[];try{Xp(g,c,p)}finally{for(let E of y)rt(E)}}function Xp(c,p,g){let y=g?.suppressEvents===!0;if(c){let E=c,N=p;if(typeof E.totalDuration=="function")try{let P=Number(E.totalDuration());Number.isFinite(P)&&P>0&&p>P&&(N=P)}catch(P){L("runtime.init.transport.clampDuration",P)}try{typeof c.totalTime=="function"?(c.totalTime(N,y),!y&&!Yp(c)&&(c.totalTime(N+.001,!0),c.totalTime(N,!0))):c.seek(N,y)}catch(P){L("runtime.init.transport.seek",P)}}$p(p,g);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&c))try{E.seek({time:p,suppressEvents:y})}catch(N){L("runtime.init.transport.adapter",N)}}let Ao=vf(document,()=>{zt()});a.push(()=>Ao.disconnect());let Jp=()=>{try{return Ao.isActive()}catch{return!1}},Qp=()=>!f.isPlaying()&&!Xs()&&Ao.observing&&!qr&&!jr&&e.currentTime===vo&&e.capturedTimeline===So,_l=()=>`${Nr()}|${Ys()??""}`,Cl=()=>{gt=window.setTimeout(Zp,e.bridgeMaxPostIntervalMs)},Zp=()=>{if(gt=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(_l()!==vl){zt();return}Pe(!1),Cl()}},eh=()=>{if(e.transportRafId=null,e.tornDown)return;let c=$r;if($r=!1,c||!Qp()){e.transportRafId=window.requestAnimationFrame(Eo);return}vl=_l(),Cl()};zt=()=>{e.tornDown||($r=!0,!(zr||e.transportRafId!=null)&&(gt!=null&&(window.clearTimeout(gt),gt=null),$r=!1,e.transportRafId=window.requestAnimationFrame(Eo)))};let Eo=()=>{if(!(e.tornDown||zr)){zr=!0;try{Vr+=1;let c=Nr();c!==Sl&&(Sl=c,jr=!0);let p=Date.now(),g=jr&&!f.isPlaying()&&p-Al>=Sf;if(g&&(Al=p),Af({tick:Vr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now(),compositionChanged:g})){let P=e.capturedTimeline;if(An()){e.capturedTimeline&&!qe._timeline&&(qe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==P&&rt(e.capturedTimeline);let K=ot(e.capturedTimeline,0,c);K>0&&f.setDuration(K),ht()}}if((g||Vr%20===0)&&(ht(),jr=!1),(g||Vr%30===0)&&co(),e.capturedTimeline){let P=ot(e.capturedTimeline,0,c);P>0&&(!f.isPlaying()||P>=f.getDuration())&&f.setDuration(P)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let P=m.getTime();P>=0&&f.attachAudioSource({currentTimeSeconds:P})}else{let P=document.querySelectorAll("audio[data-start]"),K=!1;for(let $ of P){if(!ge($)||!$.isConnected||b($))continue;let ne=Z($),Ee=Ce($.dataset.duration),He=Ee!=null&&Ee>0?ne+Ee:1/0,ae=Qe($);if(Number.isFinite(ne)&&e.currentTime>=ne&&e.currentTime<He){$.paused?!$.error&&$.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),K=!0):(f.attachAudioSource({el:$,compositionStart:ne,mediaStart:ae}),K=!0);break}}!K&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let y=f.now();e.currentTime=y;let E=f.isPlaying();if(!E&&Jp()?qr=!0:(E||qr||y!==vo||e.capturedTimeline!==So)&&(Lt(y),vo=y,So=e.capturedTimeline,E||(qr=!1)),E&&Ye.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let P=f.getDuration();Number.isFinite(P)&&(f.seek(P),e.currentTime=P,Lt(P)),ze("pause"),Ge(),Pe(!0);return}f.isPlaying()?Ge():Gp()&&(_n=null,Ge()),Pe(!1)}finally{zr=!1,eh()}}},Rl=c=>{let p=document.querySelectorAll("video, audio");for(let g of p){if(!ge(g)||!g.isConnected||!g.hasAttribute("data-start"))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Ce(g.dataset.duration),N=E!=null&&E>0?y+E:1/0;if(c<y||c>=N)continue;let P=Qe(g),K=c-y+P;if(K>=0)try{g.currentTime=K}catch{}}},wo=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=m.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let g of p){if(!ge(g)||!g.isConnected||b(g))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Qe(g),N=Number.parseFloat(g.dataset.volume??""),P=Number.isFinite(N)?N:1,K=Ce(g.dataset.duration),$=K!=null&&K>0?K:Number.POSITIVE_INFINITY,ne=g.closest("[data-composition-id]");if(ne){let ae=q(ne,0),Y=O(ne,{includeAuthoredTimingAttrs:!0});Y!=null&&Y>0&&($=Math.min($,Math.max(0,ae+Y-y)))}let Ee=bn(g);xn(g,Ee),(Ee.kind==="web-audio"?m.scheduleMediaElementPlayback(g,y,E,f.now(),P,c,e.playbackRate):Promise.resolve(null)).then(ae=>{if(ae||!f.isPlaying())return;let Y=e.playbackRate*Le(g),Re=g.hasAttribute("data-fx-chain")||g.hasAttribute("data-automation");if(Math.abs(Y-1)>1e-9){Ee.kind==="web-audio"&&Re&&(g.muted=!0);return}m.decodeAudioElement(g).then(Dt=>{!Dt||!f.isPlaying()||m.schedulePlayback(g,Dt,y,E,f.now(),P,c,e.playbackRate,$)})})}};function Tl(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&h&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),wo())}if(e.capturedTimeline){let c=ot(e.capturedTimeline,0);c>0&&f.setDuration(c),rt(e.capturedTimeline)}ym(window),e.transportRafId=window.requestAnimationFrame(Eo),ht(),Pe(!0),e.controlBridgeHandler=Nl({onPlay:()=>{qe.play(),Be("composition_played",{time:qe.getTime()})},onPause:()=>{qe.pause(),Be("composition_paused",{time:qe.getTime()})},onStopMedia:()=>{m.stopAll();let c=document.querySelectorAll("video, audio");for(let p of c)ge(p)&&!p.paused&&p.pause()},onSeek:(c,p)=>{qe.seek(c),Be("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let p=c||e.mediaOutputMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)ge(y)&&(y.muted=p||y.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,m.setVolume(c);let p=document.querySelectorAll("video, audio");for(let g of p){if(!ge(g))continue;let y=parseFloat(g.dataset.volume??""),E=Number.isFinite(y)?y:1;g.volume=ti(E*c)}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let p=c||e.bridgeMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)ge(y)&&(y.muted=p||y.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(m.stopAll(),f.detachAudioSource()):Ge())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(m.stopAll(),f.detachAudioSource()),Ge())},onSetPlaybackRate:c=>{yo(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Tl()},onSetRootDuration:Bp,onSetColorGrading:(c,p)=>{Ye.setGrading(c,p)},onSetColorGradingCompare:(c,p)=>{Ye.setCompare(c,p)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let c=f.now();if(e.currentTime=c,Lt(c),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let p=f.getDuration();Number.isFinite(p)&&(f.seek(p),e.currentTime=p,Lt(p)),ze("pause"),Ge(),Pe(!0)}},onEnablePickMode:()=>Wr.enablePickMode(),onDisablePickMode:()=>Wr.disablePickMode(),onSetRuntimeData:eo,onClearRuntimeData:to,getCanonicalFps:()=>e.canonicalFps});let _o=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),gt!=null&&(window.clearTimeout(gt),gt=null),e.transportClock=null,m.destroy(),Ft!=null&&(window.clearTimeout(Ft),Ft=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Mp(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Wr.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(p){L("runtime.init.site12",p)}e.deterministicAdapters=[];for(let c of a.splice(0))try{c()}catch(p){L("runtime.init.site13",p)}for(let c of e.injectedCompStyles)try{c.remove()}catch(p){L("runtime.init.site14",p)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(p){L("runtime.init.site15",p)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(p){L("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===_o&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=_o,e.beforeUnloadHandler=_o,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Hf=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Bs=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Hv(e){if(e<=255)return Hf[e];let t=0,n=Bs.length-1;for(;t<=n;){let r=t+n>>1,i=Bs[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Bv(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let d=e.charCodeAt(u),f=d,m=1;if(d>=55296&&d<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(f=(d-55296<<10)+(b-56320)+65536,m=2)}let h=Hv(f);(h==="R"||h==="AL"||h==="AN")&&(r=!0);for(let b=0;b<m;b++)n[u+b]=h;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let d=n[u];if(d==="L"){i=0;break}if(d==="R"||d==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let d;for(d=u-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=u+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let u=0;u<t;u++){let d=n[u];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let d=u+1;for(;d<t&&n[d]==="ON";)d++;let f=u>0?n[u-1]:l,m=d<t?n[d]:l,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let v=u;v<d;v++)n[v]=h;u=d-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let d=n[u];(o[u]&1)===0?d==="R"?o[u]++:(d==="AN"||d==="EN")&&(o[u]+=2):(d==="L"||d==="AN"||d==="EN")&&o[u]++}return o}function Bf(e,t){let n=Bv(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var Uv=/[ \t\n\r\f]+/g,Wv=/[\t\n\r\f]| {2,}|^ | $/;function Vv(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function zv(e){if(!Wv.test(e))return e;let t=e.replace(Uv," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function qv(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
705
705
|
`).replace(/[\r\f]/g,`
|
|
706
706
|
`):e.replace(/\r\n/g,`
|
|
707
707
|
`)}var Us=null,$v;function jv(){return Us===null&&(Us=new Intl.Segmenter($v,{granularity:"word"})),Us}var Kv=/\p{Script=Arabic}/u,no=/\p{M}/u,Kf=/\p{Nd}/u;function Uf(e){return Kv.test(e)}function Wf(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Ke(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let i=(n-55296<<10)+(r-56320)+65536;if(Wf(i))return!0;t++;continue}}if(Wf(n))return!0}}return!1}function Yv(e){let t=oo(e);return t!==null&&(io.has(t)||Rt.has(t))}var Xv=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function Jv(e){return Ke(e)}function Qv(e){let t=oo(e);return t!==null&&Xv.has(t)}function ro(e){return!Yv(e)&&!Qv(e)}var io=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011","\u3017","\u3019","\u301B","\u30FC","\u3005","\u303B","\u309D","\u309E","\u30FD","\u30FE"]),kr=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),Vs=new Set(["'","\u2019"]),Rt=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),Zv=new Set([":",".","\u060C","\u061B"]),e1=new Set(["\u104F"]),t1=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function n1(e){if(zs(e))return!0;let t=!1;for(let n of e){if(Rt.has(n)){t=!0;continue}if(!(t&&no.test(n)))return!1}return t}function r1(e){for(let t of e)if(!io.has(t)&&!Rt.has(t))return!1;return e.length>0}function i1(e){if(zs(e))return!0;for(let t of e)if(!kr.has(t)&&!Vs.has(t)&&!no.test(t))return!1;return e.length>0}function zs(e){let t=!1;for(let n of e)if(!(n==="\\"||no.test(n))){if(kr.has(n)||Rt.has(n)||Vs.has(n)){t=!0;continue}return!1}return t}function Yf(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function oo(e){if(e.length===0)return null;let t=Yf(e,e.length);return e.slice(t)}function o1(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(no.test(r)){n--;continue}if(kr.has(r)||Vs.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function a1(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function Vf(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function zf(e,t){return e&&t!==null&&Zv.has(t)}function s1(e){let t=oo(e);return t!==null&&e1.has(t)}function l1(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function ao(e){let t=e.length;for(;t>0;){let n=Yf(e,t),r=e.slice(n,t);if(t1.has(r))return!0;if(!Rt.has(r))return!1;t=n}return!1}function u1(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.43",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -282,9 +282,9 @@
|
|
|
282
282
|
"bpm-detective": "^2.0.5",
|
|
283
283
|
"linkedom": "^0.18.12",
|
|
284
284
|
"postcss": "^8.5.8",
|
|
285
|
-
"@hyperframes/lint": "0.8.
|
|
286
|
-
"@hyperframes/
|
|
287
|
-
"@hyperframes/
|
|
285
|
+
"@hyperframes/lint": "0.8.43",
|
|
286
|
+
"@hyperframes/studio-server": "0.8.43",
|
|
287
|
+
"@hyperframes/parsers": "0.8.43"
|
|
288
288
|
},
|
|
289
289
|
"devDependencies": {
|
|
290
290
|
"@types/jsdom": "^28.0.0",
|