hyperframes 0.7.82 → 0.7.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.7.82" : "0.0.0-dev";
53
+ VERSION = true ? "0.7.84" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -58454,7 +58454,7 @@ var RUNTIME_IIFE;
58454
58454
  var init_runtime_inline = __esm({
58455
58455
  "../core/dist/generated/runtime-inline.js"() {
58456
58456
  "use strict";
58457
- RUNTIME_IIFE = '"use strict";(()=>{var od=Object.create;var jr=Object.defineProperty;var ad=Object.getOwnPropertyDescriptor;var sd=Object.getOwnPropertyNames;var ld=Object.getPrototypeOf,ud=Object.prototype.hasOwnProperty;var cd=(e,t,n)=>t in e?jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sd(t))!ud.call(e,i)&&i!==n&&jr(e,i,{get:()=>t[i],enumerable:!(r=ad(t,i))||r.enumerable});return e};var fd=(e,t,n)=>(n=e!=null?od(ld(e)):{},dd(t||!e||!e.__esModule?jr(n,"default",{value:e,enumerable:!0}):n,e));var he=(e,t,n)=>cd(e,typeof t!="symbol"?t+"":t,n);var Fs=Z((Pb,Di)=>{var K=String,Rs=function(){return{isColorSupported:!1,reset:K,bold:K,dim:K,italic:K,underline:K,inverse:K,hidden:K,strikethrough:K,black:K,red:K,green:K,yellow:K,blue:K,magenta:K,cyan:K,white:K,gray:K,bgBlack:K,bgRed:K,bgGreen:K,bgYellow:K,bgBlue:K,bgMagenta:K,bgCyan:K,bgWhite:K,blackBright:K,redBright:K,greenBright:K,yellowBright:K,blueBright:K,magentaBright:K,cyanBright:K,whiteBright:K,bgBlackBright:K,bgRedBright:K,bgGreenBright:K,bgYellowBright:K,bgBlueBright:K,bgMagentaBright:K,bgCyanBright:K,bgWhiteBright:K}};Di.exports=Rs();Di.exports.createColors=Rs});var Ii=Z(()=>{});var er=Z((Hb,Ms)=>{"use strict";var Ls=Fs(),Ns=Ii(),cn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=Ls.isColorSupported);let r=c=>c,i=c=>c,o=c=>c;if(t){let{bold:c,gray:m,red:f}=Ls.createColors(!0);i=x=>c(f(x)),r=x=>m(x),Ns&&(o=x=>Ns(x))}let a=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((c,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-u)+" | ";if(f===this.line){if(c.length>160){let E=20,y=Math.max(0,this.column-E),w=Math.max(this.column+E,this.endColumn+E),T=c.slice(y,w),M=r(x.replace(/\\d/g," "))+c.slice(0,Math.min(this.column-1,E-1)).replace(/[^\\t]/g," ");return i(">")+r(x)+o(T)+`\n `+M+i("^")}let v=r(x.replace(/\\d/g," "))+c.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+r(x)+o(c)+`\n `+v+i("^")}return" "+r(x)+o(c)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};Ms.exports=cn;cn.default=cn});var Pi=Z((Bb,Ds)=>{"use strict";var im=/(<)(\\/?style\\b)/gi,om=/(<)(!--)/g;function ot(e){return typeof e!="string"||!e.includes("<")?e:e.replace(im,"\\\\3c $2").replace(om,"\\\\3c $2")}var ks={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function am(e){return e[0].toUpperCase()+e.slice(1)}var dn=class{constructor(t){this.builder=t}atrule(t,n){let r=t.raws,i="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof r.afterName<"u"?i+=r.afterName:o&&(i+=" "),t.nodes)this.block(t,i+o);else{let a=(r.between||"")+(n?";":"");this.builder(ot(i+o+a),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(ot(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(ot(i)),this.builder("}",t,"end")}body(t){let n=t.nodes,r=n.length-1;for(;r>0&&n[r].type==="comment";)r-=1;let i=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let l=n[a],s=this.raw(l,"before");s&&this.builder(o?s:ot(s)),this.stringify(l,r!==a||i)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(ot("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(ot(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return ks[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+am(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=ks[r]),l[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`\n`);return n=o[o.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:ot(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(ot(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};Ds.exports=dn;dn.default=dn});var fn=Z((Ub,Is)=>{"use strict";var sm=Pi();function Oi(e,t){new sm(t).stringify(e)}Is.exports=Oi;Oi.default=Oi});var tr=Z((Wb,Gi)=>{"use strict";Gi.exports.isClean=Symbol("isClean");Gi.exports.my=Symbol("my")});var hn=Z((Vb,Ps)=>{"use strict";var lm=er(),um=Pi(),cm=fn(),{isClean:mn,my:dm}=tr();function Hi(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(a=>Hi(a,n)):(o==="object"&&i!==null&&(i=Hi(i)),n[r]=i)}return n}function Je(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`\n`?(n=1,r+=1):n+=1}return i}var pn=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[mn]=!1,this[dm]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\\n\\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=Hi(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new lm(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[mn]=!0}markDirty(){if(this[mn]){this[mn]=!1;let t=this;for(;t=t.parent;)t[mn]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n=this.source.start;if(t.index)n=this.positionInside(t.index);else if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,o=r.slice(Je(r,this.source.start),Je(r,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=Je(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`\n`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Je(n,this.source.start)},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Je(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Je(n,this.source.start),Je(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Je(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:Je(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new um().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||new Map;let o=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let l=this[a];if(Array.isArray(l))r[a]=l.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof l=="object"&&l.toJSON)r[a]=l.toJSON(null,n);else if(a==="source"){if(l==null)continue;let s=n.get(l.input);s==null&&(s=o,n.set(l.input,o),o++),r[a]={end:l.end,inputId:s,start:l.start}}else r[a]=l}return i&&(r.inputs=[...n.keys()].map(a=>a.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=cm){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Ps.exports=pn;pn.default=pn});var xn=Z((zb,Os)=>{"use strict";var fm=hn(),gn=class extends fm{constructor(t){super(t),this.type="comment"}};Os.exports=gn;gn.default=gn});var yn=Z(($b,Gs)=>{"use strict";var mm=hn(),bn=class extends mm{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};Gs.exports=bn;bn.default=bn});var at=Z((qb,js)=>{"use strict";var Hs=xn(),Bs=yn(),pm=hn(),{isClean:Us,my:Ws}=tr(),Bi,Vs,zs,Ui;function $s(e){return e.map(t=>(t.nodes&&(t.nodes=$s(t.nodes)),delete t.source,t))}function qs(e){if(e[Us]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)qs(t)}var Be=class e extends pm{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=$s(Vs(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Bs(t)]}else if(t.selector||t.selectors)t=[new Ui(t)];else if(t.name)t=[new Bi(t)];else if(t.text)t=[new Hs(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ws]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Us]&&qs(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};Be.registerParse=e=>{Vs=e};Be.registerRule=e=>{Ui=e};Be.registerAtRule=e=>{Bi=e};Be.registerRoot=e=>{zs=e};js.exports=Be;Be.default=Be;Be.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Bi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ui.prototype):e.type==="decl"?Object.setPrototypeOf(e,Bs.prototype):e.type==="comment"?Object.setPrototypeOf(e,Hs.prototype):e.type==="root"&&Object.setPrototypeOf(e,zs.prototype),e[Ws]=!0,e.nodes&&e.nodes.forEach(t=>{Be.rebuild(t)})}});var nr=Z((jb,Ys)=>{"use strict";var Ks=at(),kt=class extends Ks{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};Ys.exports=kt;kt.default=kt;Ks.registerAtRule(kt)});var rr=Z((Kb,Qs)=>{"use strict";var hm=at(),Xs,Js,xt=class extends hm{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Xs(new Js,this,t).stringify()}};xt.registerLazyResult=e=>{Xs=e};xt.registerProcessor=e=>{Js=e};Qs.exports=xt;xt.default=xt});var el=Z((Yb,Zs)=>{var gm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",xm=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},bm=(e=21)=>{let t="",n=e|0;for(;n--;)t+=gm[Math.random()*64|0];return t};Zs.exports={nanoid:bm,customAlphabet:xm}});var ir=Z(()=>{});var or=Z(()=>{});var Wi=Z(()=>{});var tl=Z(()=>{});var zi=Z((iy,il)=>{"use strict";var{existsSync:ym,readFileSync:Sm}=tl(),{dirname:Vi,join:vm}=ir(),{SourceMapConsumer:nl,SourceMapGenerator:rl}=or();function Em(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Sn=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Vi(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new nl(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\\/json;charset=utf-?8;base64,/,r=/^data:application\\/json;base64,/,i=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return Em(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!(!r&&!this.unsafeMap&&!/\\.map$/i.test(t))&&(this.root=Vi(t),ym(t)))return this.mapFile=t,Sm(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof nl)return rl.fromSourceMap(n).toString();if(n instanceof rl)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=vm(Vi(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};il.exports=Sn;Sn.default=Sn});var vn=Z((oy,ul)=>{"use strict";var{nanoid:Cm}=el(),{isAbsolute:ji,resolve:Ki}=ir(),{SourceMapConsumer:_m,SourceMapGenerator:Am}=or(),{fileURLToPath:ol,pathToFileURL:ar}=Wi(),al=er(),wm=zi(),$i=Ii(),qi=Symbol("lineToIndexCache"),Tm=!!(_m&&Am),sl=!!(Ki&&ji);function ll(e){if(e[qi])return e[qi];let t=e.css.split(`\n`),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[qi]=n,n}var Dt=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!sl||/^\\w+:\\/\\//.test(n.from)||ji(n.from)?this.file=n.from:this.file=Ki(n.from)),sl&&Tm){let r=new wm(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+Cm(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;if(n&&typeof n=="object"){let m=n,f=r;if(typeof m.offset=="number"){s=m.offset;let x=this.fromOffset(s);n=x.line,r=x.col}else n=m.line,r=m.column,s=this.fromLineAndColumn(n,r);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);a=x.line,o=x.col}else a=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let m=this.fromOffset(s);n=m.line,r=m.col}let c=this.origin(n,r,a,o);return c?u=new al(t,c.endLine===void 0?c.line:{column:c.column,line:c.line},c.endLine===void 0?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,i.plugin):u=new al(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(ar&&(u.input.url=ar(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return ll(this)[t-1]+n-1}fromOffset(t){let n=ll(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:Ki(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:i,line:r}));let s;ji(a.source)?s=ar(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||ar(this.map.mapFile));let u={column:a.column,endColumn:l&&l.column,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(ol)u.file=ol(s);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(a.source);return c&&(u.source=c),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};ul.exports=Dt;Dt.default=Dt;$i&&$i.registerInput&&$i.registerInput(Dt)});var It=Z((ay,ml)=>{"use strict";var cl=at(),dl,fl,st=class extends cl{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new dl(new fl,this,t).stringify()}};st.registerLazyResult=e=>{dl=e};st.registerProcessor=e=>{fl=e};ml.exports=st;st.default=st;cl.registerRoot(st)});var Yi=Z((sy,pl)=>{"use strict";var En={comma(e){return En.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return En.split(e,t)},split(e,t,n){let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let c of e)u?u=!1:c==="\\\\"?u=!0:l?c===s&&(l=!1):c===\'"\'||c==="\'"?(l=!0,s=c):c==="("?a+=1:c===")"?a>0&&(a-=1):a===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}};pl.exports=En;En.default=En});var sr=Z((ly,gl)=>{"use strict";var hl=at(),Rm=Yi(),Pt=class extends hl{get selectors(){return Rm.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};gl.exports=Pt;Pt.default=Pt;hl.registerRule(Pt)});var bl=Z((uy,xl)=>{"use strict";var Fm=nr(),Lm=xn(),Nm=yn(),Mm=vn(),km=zi(),Dm=It(),Im=sr();function Cn(e,t){if(Array.isArray(e))return e.map(i=>Cn(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:Mm.prototype};o.map&&(o.map={...o.map,__proto__:km.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Cn(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new Dm(r);if(r.type==="decl")return new Nm(r);if(r.type==="rule")return new Im(r);if(r.type==="comment")return new Lm(r);if(r.type==="atrule")return new Fm(r);throw new Error("Unknown node type: "+e.type)}xl.exports=Cn;Cn.default=Cn});var Ji=Z((cy,_l)=>{"use strict";var{dirname:lr,relative:Sl,resolve:vl,sep:El}=ir(),{SourceMapConsumer:Cl,SourceMapGenerator:ur}=or(),{pathToFileURL:yl}=Wi(),Pm=vn(),Om=!!(Cl&&ur),Gm=!!(lr&&vl&&Sl&&El),Xi=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||lr(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Cl(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`\n`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),Gm&&Om&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=ur.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new ur({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new ur({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\\n/g),a?(t+=a.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,s&&u!=="start"){let c=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==c.last||c.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\\w+:\\/\\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?lr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=lr(vl(r,this.mapOpts.annotation)));let i=Sl(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new Pm(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(yl){let r=yl(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;El==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};_l.exports=Xi});var Tl=Z((dy,wl)=>{"use strict";var cr=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,dr=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,Hm=/.[\\r\\n"\'(/\\\\]/,Al=/[\\da-f]/i;wl.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,m,f,x,v,E=r.length,y=0,w=[],T=[],M=-1;function D(){return y}function P(A){throw t.error("Unclosed "+A,y)}function _(){return T.length===0&&y>=E}function b(A){if(T.length)return T.pop();if(y>=E)return;let R=A?A.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case 10:case 32:case 9:case 13:case 12:{s=y;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(y,s)],y=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);c=[N,N,y];break}case 40:{if(v=w.length?w.pop()[1]:"",x=r.charCodeAt(y+1),v==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){s=y;do{if(m=!1,s=r.indexOf(")",s+1),s===-1)if(i||R){s=y;break}else P("bracket");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["brackets",r.slice(y,s+1),y,s],y=s}else y<=M?c=["(","(",y]:(s=r.indexOf(")",y+1),a=r.slice(y,s+1),s===-1||Hm.test(a)?(M=s===-1?E:s,c=["(","(",y]):(c=["brackets",a,y,s],y=s));break}case 39:case 34:{u=o===39?"\'":\'"\',s=y;do{if(m=!1,s=r.indexOf(u,s+1),s===-1)if(i||R){s=y+1;break}else P("string");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["string",r.slice(y,s+1),y,s],y=s;break}case 64:{cr.lastIndex=y+1,cr.test(r),cr.lastIndex===0?s=r.length-1:s=cr.lastIndex-2,c=["at-word",r.slice(y,s+1),y,s],y=s;break}case 92:{for(s=y,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,Al.test(r.charAt(s)))){for(;Al.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===47&&r.charCodeAt(y+1)===42?(s=r.indexOf("*/",y+2)+1,s===0&&(i||R?s=r.length:P("comment")),c=["comment",r.slice(y,s+1),y,s],y=s):(dr.lastIndex=y+1,dr.test(r),dr.lastIndex===0?s=r.length-1:s=dr.lastIndex-2,c=["word",r.slice(y,s+1),y,s],w.push(c),y=s);break}}return y++,c}function S(A){T.push(A)}return{back:S,endOfFile:_,nextToken:b,position:D}}});var Nl=Z((fy,Ll)=>{"use strict";var Bm=nr(),Um=xn(),Wm=yn(),Vm=It(),Rl=sr(),zm=Tl(),Fl={empty:!0,space:!0};function $m(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var Qi=class{constructor(t){this.input=t,this.root=new Vm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new Bm;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new Um;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=zm(this.input)}decl(t,n){let r=new Wm;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||$m(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],l;for(;t.length&&(l=t[0][0],!(l!=="space"&&l!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),m="";for(let f=u;f>0;f--){let x=c[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=c.pop()[1]+m}m.trim().startsWith("!")&&(r.important=!0,r.raws.important=m,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=a.map(u=>u[1]).join(""),a=[]),this.raw(r,"value",a.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new Rl;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,a,l=r.length,s="",u=!0,c,m;for(let f=0;f<l;f+=1)o=r[f],a=o[0],a==="space"&&f===l-1&&!i?u=!1:a==="comment"?(m=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Fl[m]&&!Fl[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let f=r.reduce((x,v)=>x+v[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Rl;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};Ll.exports=Qi});var mr=Z((my,Ml)=>{"use strict";var qm=at(),jm=vn(),Km=Nl();function fr(e,t){let n=new jm(e,t),r=new Km(n);try{r.parse()}catch(i){throw i}return r.root}Ml.exports=fr;fr.default=fr;qm.registerParse(fr)});var Zi=Z((py,kl)=>{"use strict";var _n=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};kl.exports=_n;_n.default=_n});var pr=Z((hy,Dl)=>{"use strict";var Ym=Zi(),An=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new Ym(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Dl.exports=An;An.default=An});var eo=Z((gy,Pl)=>{"use strict";var Il={};Pl.exports=function(t){Il[t]||(Il[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var ro=Z((by,Bl)=>{"use strict";var Xm=at(),Jm=rr(),Qm=Ji(),Zm=mr(),Ol=pr(),ep=It(),tp=fn(),{isClean:Ke,my:np}=tr(),xy=eo(),rp={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ip={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},op={Once:!0,postcssPlugin:!0,prepare:!0},Ot=0;function wn(e){return typeof e=="object"&&typeof e.then=="function"}function Hl(e){let t=!1,n=rp[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Ot,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Ot,n+"Exit"]:[n,n+"Exit"]}function Gl(e){let t;return e.type==="document"?t=["Document",Ot,"DocumentExit"]:e.type==="root"?t=["Root",Ot,"RootExit"]:t=Hl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function to(e){return e[Ke]=!1,e.nodes&&e.nodes.forEach(t=>to(t)),e}var no={},lt=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=to(n);else if(n instanceof e||n instanceof Ol)i=to(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=Zm;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[np]&&Xm.rebuild(i)}this.result=new Ol(t,i,r),this.helpers={...no,postcss:no,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!ip[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!op[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(wn(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];){t[Ke]=!0;let n=[Gl(t)];for(;n.length>0;){let r=this.visitTick(n);if(wn(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return wn(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=tp;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let o=new Qm(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(wn(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];)t[Ke]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(wn(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator,l;for(;l=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!l[Ke]){l[Ke]=!0,t.push(Gl(l));return}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===Ot){r.nodes&&r.nodes.length&&(r[Ke]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ke]=!0;let n=Hl(t);for(let r of n)if(r===Ot)t.nodes&&t.each(i=>{i[Ke]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};lt.registerPostcss=e=>{no=e};Bl.exports=lt;lt.default=lt;ep.registerLazyResult(lt);Jm.registerLazyResult(lt)});var Wl=Z((Sy,Ul)=>{"use strict";var ap=Ji(),sp=mr(),lp=pr(),up=fn(),yy=eo(),Tn=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=sp;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i=up;this.result=new lp(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new ap(i,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};Ul.exports=Tn;Tn.default=Tn});var zl=Z((vy,Vl)=>{"use strict";var cp=rr(),dp=ro(),fp=Wl(),mp=It(),bt=class{constructor(t=[]){this.version="8.5.14",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new fp(this,t,n):new dp(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};Vl.exports=bt;bt.default=bt;mp.registerProcessor(bt);cp.registerProcessor(bt)});var Ql=Z((Ey,Jl)=>{"use strict";var $l=nr(),ql=xn(),pp=at(),hp=er(),jl=yn(),Kl=rr(),gp=bl(),xp=vn(),bp=ro(),yp=Yi(),Sp=hn(),vp=mr(),io=zl(),Ep=pr(),Yl=It(),Xl=sr(),Cp=fn(),_p=Zi();function le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new io(e)}le.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new io().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return le([i(s)]).process(a,l)},i};le.stringify=Cp;le.parse=vp;le.fromJSON=gp;le.list=yp;le.comment=e=>new ql(e);le.atRule=e=>new $l(e);le.decl=e=>new jl(e);le.rule=e=>new Xl(e);le.root=e=>new Yl(e);le.document=e=>new Kl(e);le.CssSyntaxError=hp;le.Declaration=jl;le.Container=pp;le.Processor=io;le.Document=Kl;le.Comment=ql;le.Warning=_p;le.AtRule=$l;le.Result=Ep;le.Input=xp;le.Rule=Xl;le.Root=Yl;le.Node=Sp;bp.registerPostcss(le);Jl.exports=le;le.default=le});function Un(){return globalThis}function F(e,t){if(typeof window>"u")return;let n=Un(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var md=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1"];function pd(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function hd(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=pd(r,n);return{numerator:r/i,denominator:n/i}}function Kr(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Wn(e){return{protocolVersion:1,capabilities:md,fps:hd(e)}}function gd(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function na(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=Kr(n.fps);return r===null||!gd(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var ra=30;function ia(e){ra=Number.isFinite(e)&&e>0?e:30}function xe(e){try{window.parent.postMessage({...e,...Wn(ra)},"*")}catch(t){F("bridge.postMessage",t)}}var xd={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(bd(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>Sd(e)};function bd(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Kr(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function yd(e){let t=na(e);return t.status!=="unsupported"?!1:(xe({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function Sd(e){let t=e.selectors,n=e.duration||800;t&&vd(t,n)}function oa(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||yd(r))return;let i=r.action;if(typeof i!="string")return;let o=xd[i];o&&o(r,e)};return window.addEventListener("message",t),xe({source:"hf-preview",type:"ready"}),t}function vd(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){F("bridge.flashElements.querySelector",r)}}var Yr=null;function aa(e){Yr=e}function Ne(e,t){if(Yr)try{Yr({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){F("runtime.analytics.site1",n)}}function Ed(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function At(e){return`--${Ed(e)}`}function sa(e){let t=new Map;for(let n of e){let r=At(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function la(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let r of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(r);let t={};for(let r of e)Object.assign(t,Jt(r));let n=zn();return{...t,...n}}function Jt(e){if(!e)return{};let t=e.getAttribute("data-composition-variables");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(!Array.isArray(n))return{};let r={};for(let i of n){if(!i||typeof i!="object")continue;let o=i;typeof o.id!="string"||!("default"in o)||(r[o.id]=o.default)}return r}var Xr="data-hf-css-vars";function Vn(e){return"style"in e&&typeof e.style?.setProperty=="function"}function Jr(e,t){if(!Vn(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=At(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Xr,n.join(" "))}function ua(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=At(i);((Vn(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function ca(e){if(!Vn(e))return;let t=e.getAttribute(Xr);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Xr)}}function da(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=zn(),r=[];for(let i of t)r.push(...Cd(i,n,e.defaultView));for(let i of sa(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${At(i[0]??"")} \\u2014 rename one to avoid cross-talk`)}function Cd(e,t,n){if(!Vn(e))return[];let r=Jt(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=At(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return Jr(e,i),Object.keys(r)}function fa(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function zn(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function ma(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(x){F("runtime.adapters.css.site5",x)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){F("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){F("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){F("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){F("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let x=i(f,m);x.endSeconds!=null&&(u=Math.max(u,x.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),x=Math.max(0,c-f)*1e3,v=m.animations;if(v.length>0){o(v,x);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(x/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function pa(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function ha(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){F("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){F("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){F("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){F("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function xa(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){F("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(Qr(r))r.goToAndStop(t*1e3,!1);else if(Zr(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){F("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(Qr(t)||Zr(t))&&t.pause()}catch(n){F("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=_d(r)}catch(o){F("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function ga(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function _d(e){return Qr(e)?ga(e.totalFrames,e.frameRate):Zr(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:ga(e.totalFrames,e.frameRate):null}function Qr(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Zr(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ei=-1;function $n(e){if(e!==ei){ei=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){F("runtime.adapters.seek-dispatch.site1",t)}}}function ba(e){ei=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){F("runtime.adapters.seek-dispatch.force",t)}}function ya(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,$n(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function $e(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function Sa(){return $e({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function va(){return $e({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function Ea(){return $e({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function Ca(){return $e({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function _a(){return $e({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}function Aa(){let e=null,t=0;return{name:"typegpu",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfTypegpuTime=e,$n(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function wa(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;if(e.id){let n=document.getElementById(`__render_frame_${e.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function Ta(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=wa(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function Ra(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=wa(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function Fa(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=y=>{let w=Number(y.currentTime);return Number.isFinite(w)&&w>0?w:0},c=(y,w)=>w<=0?y:y>=w?Math.max(0,y-w):y,m=(y,w)=>{let T=l.get(y);if(T)return T;let M={compositionTimeMs:w,animationTimeMs:e?c(u(y),w):u(y)};return l.set(y,M),M},f=(y,w)=>{if(!a.has(y)){a.add(y);let T=()=>{a.delete(y)};try{y.addEventListener("finish",T,{once:!0}),y.addEventListener("cancel",T,{once:!0})}catch(M){F("runtime.adapters.waapi.site4",M)}}m(y,w)},x=(y,w)=>{for(let T of y)f(T,w)},v=()=>{if(n||typeof Element>"u")return;let y=Element.prototype;if(typeof y.animate!="function"||y.__hfOriginalAnimate)return;let w=y.animate;try{Object.defineProperty(y,"__hfOriginalAnimate",{value:w,configurable:!0});let T=function(...M){let D=w.apply(this,M);return f(D,t),D};y.animate=T,r=y,i=w,o=T,n=!0}catch{}},E=y=>{let w=null;try{w=y.effect?.getComputedTiming?.()??null}catch(D){F("runtime.adapters.waapi.site4",D)}if(!w)return{};let T=Number(w.endTime);return Number.isFinite(T)?{endSeconds:(l.get(y)?.compositionTimeMs??0)/1e3+T/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,v(),x(s(),t)},seek:y=>{let w=Math.max(0,(Number(y.time)||0)*1e3);t=w,(!e||a.size>0)&&x(s(),e?w:0);for(let T of a){let M=e?m(T,w):m(T,0),D=M.animationTimeMs+Math.max(0,w-M.compositionTimeMs);try{T.currentTime=D}catch(P){F("runtime.adapters.waapi.site1",P)}try{T.pause()}catch(P){F("runtime.adapters.waapi.site2",P)}}},pause:()=>{e||x(s(),t);for(let y of a)try{y.pause()}catch(w){F("runtime.adapters.waapi.site3",w)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(y){F("runtime.adapters.waapi.site5",y)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let y=0;for(let w of s()){let T=E(w);T.endSeconds!=null&&(y=Math.max(y,T.endSeconds))}return y>0?y:null}}}function La(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function Ad(e,t,n,r){let i=Number.parseFloat(e.dataset.start??"0")||0,o=Number.parseFloat(e.dataset.end??""),a=Number.parseFloat(e.dataset.duration??""),l=Number.isFinite(o)&&o>i?o:Number.isFinite(a)&&a>0?i+a:n,s=Number.parseFloat(e.dataset.volume??""),u=Number.isFinite(s)?Math.max(0,Math.min(1,s)):1;e.volume=u;let c=1/Math.min(60,Math.max(1,r)),m=Math.max(0,i),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=c){let y=Math.min(f,E);t(y);let w=Number(e.volume);if(!Number.isFinite(w))continue;let T=Math.max(0,Math.min(1,w)),M=x.at(-1);if((!M||Math.abs(M.volume-T)>1e-4||y===f)&&x.push({time:Number(y.toFixed(6)),volume:Number(T.toFixed(6))}),y===f)break}return x.some(E=>Math.abs(E.volume-u)>1e-4)?x:null}function Na(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Ad(e,o,n,60);Number.isFinite(a)&&o(a),l&&r.set(e,l)}function Ma(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function qe(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return Ma(n)}function Tt(e){let t=Number.parseFloat(e.getAttribute("data-playback-start")??e.getAttribute("data-media-start")??"");return Number.isFinite(t)&&t>=0?t:0}function ka(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>0);return n.length>0?Math.min(...n):null}function Da(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,u=qe(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-s)/u));let x=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),E={el:a,start:l,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:m};r.push(E),a.tagName==="VIDEO"&&i.push(E),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ti=new WeakMap,Zt=new WeakMap,ni=new WeakSet,wt=new WeakSet;function wd(e){if(wt.has(e))return;wt.add(e);let t=()=>wt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Td=3;function Rd(e){return e.error!=null||e.networkState===Td}var ri=new WeakMap;function Qt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function ii(e){ti.delete(e),Zt.delete(e),ni.delete(e),ri.delete(e)}function Ia(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=o&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||l)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let U=n.sourceDuration-n.mediaStart;U>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%U)}let u=Qt(e.userVolume??1),c=Qt(n.volume??1),m=ri.get(r),f=Qt(r.volume),x;n.volumeKeyframes&&n.volumeKeyframes.length>0?x=Qt(La(n.volumeKeyframes,i)):m===void 0||Math.abs(f-m)>1e-4?x=f:x=c;let v=Qt(x*u);r.volume=v,ri.set(r,v),e.onElementVolume?.(r,v),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(U){F("runtime.media.site1",U)}let E=.04,y=2,w=r.currentTime||0,T=Math.abs(w-i),M=i-w,D=ti.get(r);ti.set(r,M);let P=D===void 0,_=!P&&Math.abs(M-D)>.5,b=T>3,S=a&&T>.001||r.ended&&l&&T>.001||T>.5&&(P||_||b),A=r.tagName==="VIDEO"&&!r.paused,R=D!==void 0&&Math.abs(M-D)<.004,N=!1;if(!A&&!S&&!P&&R&&T>E){let U=(Zt.get(r)??0)+1;Zt.set(r,U),U>=y&&(N=!0,Zt.set(r,0))}else T<=E&&Zt.set(r,0);let G=!A&&e.forceSync&&T>.02;if(S||N||G){if(!(r.tagName==="VIDEO"&&r.id&&!!document.getElementById(`__render_frame_${r.id}__`))){try{r.currentTime=i}catch(ne){F("runtime.media.site2",ne)}if(Math.abs(r.currentTime-i)>.5&&!ni.has(r)){ni.add(r),r.load();try{r.currentTime=i}catch(ne){F("runtime.media.site3",ne)}}}wt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!wt.has(r)&&!Rd(r)?(wd(r),r.play().catch(U=>{wt.delete(r),(U&&typeof U=="object"&&"name"in U?String(U.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}ii(r),r.paused||r.pause()}}var Fd="hf-proxy",Pa="runtime_media_proxy_fallback",Oa="runtime_media_proxy_unavailable",en=new WeakSet,Ga=new WeakSet;function qn(e){return e.currentSrc||e.src}function oi(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!e.id&&!!document.getElementById(`__render_frame_${e.id}__`)}function ai(e){let t=qn(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function Ld(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function Nd(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function si(e,t){return t[e]??Ld(e,t)??Nd(e,t)}function Md(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Fd,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var kd={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function gt(e,t,n){if(Ga.has(e))return;Ga.add(e);let r=kd[t];xe({source:"hf-preview",type:"diagnostic",code:Oa,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Oa}: "${n}" (${t}): ${r}`)}function li(e,t=null,n="reactive"){if(en.has(e))return;let r=qn(e),i;try{i=Md(r,t)}catch(l){F("runtime.mediaProxy.swap",l),gt(e,"invalid_source_url",r);return}en.add(e),ii(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Pa,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Pa}: "${r}" uses a codec (${o??"unknown"}) this browser can\'t decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Ha(e){if(oi(e)||!(e instanceof HTMLVideoElement)||en.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=ai(e);if(n===null)return;let r=si(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||li(e,r,"proactive")}function Ba(e){if(oi(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=qn(e);if(en.has(e)){gt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ai(e);if(r===null){gt(e,"cross_origin",t);return}let i=si(r,n);if(i&&!i.browserHostile){gt(e,"browser_safe_codec",t);return}li(e,i,"reactive")}function Ua(e){if(oi(e)||!(e instanceof HTMLVideoElement))return;let t=qn(e);if(en.has(e)){gt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ai(e);if(r===null){gt(e,"cross_origin",t);return}let i=si(r,n);if(i&&!i.browserHostile){gt(e,"browser_safe_codec",t);return}li(e,i,"tertiary")}var be=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);he(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},Dd=[0,0,0],Id=[1,1,1],jn=64;function Pd(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===\'"\'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function nt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new be(`Invalid number "${e}"`,t);return n}function Wa(e,t,n){if(e.length!==3)throw new be(`${t} expects three numbers`,n);return[nt(e[0],n),nt(e[1],n),nt(e[2],n)]}function Va(e,t,n){if(!e)throw new be(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new be(`${t} must be an integer greater than 1`,n);return r}function Od(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new be("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Gd(e){let t=/^TITLE\\s+"([^"]*)"\\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\\s+(.+)\\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function Hd(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function za(e,t={}){let n=t.maxSize??jn,r=null,i=Dd,o=Id,a=null,l=null,s=[],u=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let m=0;m<u.length;m++){let f=m+1,x=Pd(u[m]??"").trim();if(!x)continue;let v=x.split(/\\s+/),E=(v[0]??"").toUpperCase(),y=v.slice(1);if(E==="TITLE"){r=Gd(x);continue}if(E==="DOMAIN_MIN"){i=Wa(y,E,f);continue}if(E==="DOMAIN_MAX"){o=Wa(y,E,f);continue}if(E==="LUT_3D_INPUT_RANGE"){if(y.length!==2)throw new be(`${E} expects two numbers`,f);let w=nt(y[0],f),T=nt(y[1],f);if(T<=w)throw new be("LUT_3D_INPUT_RANGE max must exceed min",f);i=[w,w,w],o=[T,T,T];continue}if(E==="LUT_1D_SIZE"){a=Va(y[0],E,f);continue}if(E==="LUT_3D_SIZE"){if(l=Va(y[0],E,f),l>n)throw new be(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!Hd(E)){if(E.startsWith("LUT_"))throw new be(`Unsupported cube keyword ${E}`,f);continue}if(!l)throw a?new be("1D cube LUTs are not supported yet",f):new be("LUT data appears before LUT_3D_SIZE",f);if(v.length!==3)throw new be("LUT data rows must contain three numbers",f);s.push(nt(v[0],f),nt(v[1],f),nt(v[2],f))}if(a&&l)throw new be("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new be("1D cube LUTs are not supported yet"):new be("Missing LUT_3D_SIZE");Od(i,o);let c=l*l*l;if(s.length!==c*3)throw new be(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function Bd(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function tn(e){return Math.round(Bd(e)*255)}function ui(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=tn(e.data[s]??0),i[u+1]=tn(e.data[s+1]??0),i[u+2]=tn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var $a="rec709";var ce={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var qa=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],ja=["shadows","midtones","highlights"],Ka=["master","red","green","blue"],Ya=["hueVsHue","hueVsSaturation","hueVsLuma"];var Xa=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Ja=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var Ox=ce.unit,Gx=ce.signedUnit,Hx=ce.effects;var je=1024,nn=16;function Qa(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function ye(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Ud(e){let t=[],n=[],r=ye(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=ye(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Qa(ye(t,0),ye(t,1),i,ye(n,1)),o[o.length-1]=Qa(ye(t,t.length-1),ye(t,t.length-2),ye(n,n.length-1),ye(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ye(n,a-1),s=ye(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=ye(t,a-1),c=ye(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function Za(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function Wd(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function Vd(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function es(e,t,n,r,i){Wd(e,r,i);let o=Ud(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>ye(e,l+1)[0];)l+=1;let c=ye(e,l),m=ye(e,l+1),f=Vd(u,c,m,ye(o,l),ye(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function Rt(e,t=je){if(Za(e,t),e.length>nn)throw new RangeError(`A color curve supports at most ${nn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return es(e,t,n=>n/(t-1),0,1)}function di(e,t,n,r=je){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>nn)throw new RangeError(`A hue curve supports at most ${nn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return Za(l,r),es(l,r,s=>s/r*360,t,n)}var rn="data-color-grading",on="data-hf-color-grading-source-hidden",Xn="data-hf-authored-opacity",os="__hf_color_grading_",$d=$a,pi={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},hi={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},gi={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var Jn=qa,as=ja,ss=Ka,ls=Ya,bi=Xa,yi=Ja,ts={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},ns={vignette:.18};function Se(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...pi,...n},details:{...hi,...r},effects:{...gi,...i}}}var Si=[Se("neutral","Neutral"),Se("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Se("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Se("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Se("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Se("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Se("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Se("vintage-wash","Vintage Wash",ts,ns),Se("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Se("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Se("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Se("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Se("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Se("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Se("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Se("home-movie-8mm","8mm Home Movie",ts,{...ns,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Se("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Se("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],qd=new Map(Si.map(e=>[e.id,e])),jd=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,Kd={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},Ft={hue:0,amount:0,level:0},rs={amount:ce.unit,level:ce.signedUnit},rt=[[0,0],[1,1]],Lt=[],Yd={hueVsHue:ce.secondaryHueShift,hueVsSaturation:ce.signedUnit,hueVsLuma:ce.signedUnit},fi={center:0,range:180,softness:0},mi={min:0,max:1,softness:.05},Xd={vignette:ce.unit,vignetteMidpoint:ce.unit,vignetteRoundness:ce.signedUnit,vignetteFeather:ce.unit,grain:ce.unit,grainSize:ce.unit,grainRoughness:ce.unit},xi=ce.unit,Jd=ce.effects,us=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var Qd=Si.filter(e=>us.some(t=>e.effects[t]>1e-4)),jx=Si.filter(e=>!Qd.includes(e)),Kx={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},cs=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var Zd=/^#[0-9a-f]{6}$/i;function ef(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&Zd.test(t))?null:e.map(t=>t.toLowerCase())}function Ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yn(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function ds(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function we(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Yn(n,t.min,t.max):0}function vi(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function tf(e){let t=Ce(e)?e:{};return as.reduce((n,r)=>{let i=Ce(t[r])?t[r]:{};return n[r]={hue:vi(i.hue,Ft.hue),amount:we(i.amount??Ft.amount,rs.amount),level:we(i.level??Ft.level,rs.level)},n},{shadows:{...Ft},midtones:{...Ft},highlights:{...Ft}})}function nf(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[Yn(t,0,1),Yn(n,0,1)]:null}function fs(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function rf(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function of(e){if(!Array.isArray(e)||e.length<2)return rt;let t=[];for(let n of e){let r=nf(n);if(!r)return rt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),fs(t)||(rf(t),t.length>16)?rt:t}function af(e){let t=Ce(e)?e:{};return ss.reduce((n,r)=>(n[r]=of(t[r]),n),{master:rt,red:rt,green:rt,blue:rt})}function sf(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[vi(n),Yn(r,t.min,t.max)]:null}function lf(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return Lt;let n=[];for(let r of e){let i=sf(r,t);if(!i)return Lt;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),fs(n)?Lt:n}function uf(e){let t=Ce(e)?e:{};return ls.reduce((n,r)=>(n[r]=lf(t[r],Yd[r]),n),{hueVsHue:Lt,hueVsSaturation:Lt,hueVsLuma:Lt})}function is(e){let t=Ce(e)?e:{},n=we(t.min??mi.min,xi),r=we(t.max??mi.max,xi);return{min:Math.min(n,r),max:Math.max(n,r),softness:we(t.softness??mi.softness,ce.secondarySoftRangeSoftness)}}function cf(e){let t=Ce(e)?e:{},n=we(t.range??fi.range,ce.secondaryHueRange);return{center:vi(t.center,fi.center),range:n,softness:we(t.softness??fi.softness,{min:ce.secondaryHueSoftness.min,max:ce.secondaryHueCombinedMax-n})}}function df(e){return{hueShift:we(e.hueShift??0,ce.secondaryHueShift),saturation:we(e.saturation??0,ce.signedUnit),luma:we(e.luma??0,ce.signedUnit),temperature:we(e.temperature??0,ce.signedUnit),tint:we(e.tint??0,ce.signedUnit)}}function ff(e){return!Ce(e)||!Ce(e.key)||!Ce(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:cf(e.key.hue),saturation:is(e.key.saturation),luma:is(e.key.luma)},correction:df(e.correction)}}function mf(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=ff(n);r&&t.push(r)}return t}function pf(e){if(e==null)return null;let t=String(e).trim();return t||null}function hf(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ce(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:ds(e.intensity,1)}}function gf(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ce(n)?n:null}catch{return null}return{preset:t}}return Ce(e)?e:null}function xf(e,t){let n=e.trim().match(jd);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Kn(e,t){if(typeof e=="string"){let r=xf(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Kn(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Kn(r,t));if(!Ce(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Kn(i,t);return n}function bf(e){return e?qd.get(e)??null:null}function Qn(e){let t=gf(e);if(!t||t.enabled===!1)return null;let n=pf(t.preset),r=bf(n),i=r?.adjust??pi,o=r?.details??hi,a=r?.effects??gi,l=Ce(t.adjust)?t.adjust:{},s=Ce(t.details)?t.details:{},u=Ce(t.effects)?t.effects:{},c=Jn.reduce((x,v)=>(x[v]=we(l[v]??i[v],Kd[v]),x),{...pi}),m=bi.reduce((x,v)=>(x[v]=we(s[v]??o[v],Xd[v]),x),{...hi}),f=yi.reduce((x,v)=>(x[v]=we(u[v]??a[v],Jd[v]??xi),x),{...gi});return{enabled:!0,preset:n,intensity:ds(t.intensity,r?.intensity??1),adjust:c,wheels:tf(t.wheels),curves:af(t.curves),hueCurves:uf(t.hueCurves),secondaries:mf(t.secondaries),details:m,effects:f,palette:ef(t.palette),lut:hf(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():$d}}function ms(e,t){return Qn(Kn(e,t))}function yf(e){return as.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Ei(e){return ss.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Ci(e){return ls.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function _i(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function ps(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||us.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Jn.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?yf(e.wheels):!1)||(e.curves?Ei(e.curves):!1)||(e.hueCurves?Ci(e.hueCurves):!1)||(e.secondaries?_i(e.secondaries):!1):!1}var Sf=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),vf=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function hs(e){let t=!1,n=null,r=null,i=null,o=null;function a(b,S){try{window.dispatchEvent(new CustomEvent(b,{detail:S}))}catch(A){F("runtime.picker.site1",A)}}function l(b){i=b,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(b){o=b,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(b){let S=b.ownerDocument.defaultView;if(!S)return!1;let A=b;for(;A&&A!==document.body&&A!==document.documentElement;){let R=S.getComputedStyle(A);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let N=Number.parseFloat(R.opacity);if(Number.isFinite(N)&&N<=.01&&!A.hasAttribute(on))return!0;A=A.parentElement}return!1}function c(b){if(!b||b===document.body||b===document.documentElement)return!1;let S=b.tagName.toLowerCase();return!(S==="script"||S==="style"||S==="link"||S==="meta"||b.classList.contains("__hf-pick-highlight")||b.closest(Sf)||u(b))}function m(b){return!!b?.closest(vf)}function f(b){let S=b;if(S.id)return`#${CSS.escape(S.id)}`;let A=b.getAttribute("data-composition-id");if(A)return`[data-composition-id="${CSS.escape(A)}"]`;let R=b.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let N=b.getAttribute("data-track-index");if(N)return`[data-track-index="${CSS.escape(N)}"]`;let G=b.tagName.toLowerCase(),U=b.parentElement;if(!U)return G;let ne=U.querySelectorAll(`:scope > ${G}`);if(ne.length===1)return G;for(let H=0;H<ne.length;H+=1)if(ne[H]===b)return`${G}:nth-of-type(${H+1})`;return G}function x(b){let S=b.tagName.toLowerCase(),A=(b.textContent??"").trim().replace(/\\s+/g," "),R=(N,G)=>N.length>G?`${N.slice(0,G-1)}\\u2026`:N;return S==="h1"||S==="h2"||S==="h3"?"Heading":S==="p"||S==="span"||S==="div"?A.length>0?R(A,56):"Text":S==="img"?"Image":S==="video"?"Video":S==="audio"?"Audio":S==="svg"?"Shape":b.getAttribute("data-composition-src")?"Composition":S==="section"?"Section":`${S.charAt(0).toUpperCase()}${S.slice(1)}`}function v(b,S,A){let R=typeof A=="number"&&A>0?A:8,N=[];if(document.elementsFromPoint)N=document.elementsFromPoint(b,S);else if(document.elementFromPoint){let ne=document.elementFromPoint(b,S);N=ne?[ne]:[]}if(m(N[0]??null))return[];let G={},U=[];for(let[ne,H]of N.entries()){if(!c(H))continue;let J=`${H.tagName}::${H.id||""}::${ne}`;if(!G[J]&&(G[J]=!0,U.push(H),U.length>=R))break}return U}function E(b){let S=b.getBoundingClientRect(),A={};for(let N of Array.from(b.attributes))N.name.startsWith("data-")&&(A[N.name]=N.value);return{id:b.id||null,tagName:b.tagName.toLowerCase(),selector:f(b),label:x(b),boundingBox:{x:S.left,y:S.top,width:S.width,height:S.height},textContent:b.textContent?b.textContent.trim().slice(0,200):null,src:b.getAttribute("src")||b.getAttribute("data-composition-src")||null,dataAttributes:A}}function y(b,S,A){return v(b,S,A).map(E)}function w(b){if(!t)return;let A=v(b.clientX,b.clientY,1)[0]??(b.target instanceof Element?b.target:null);if(!c(A)||n===A)return;n&&n.classList.remove("__hf-pick-highlight"),n=A,A.classList.add("__hf-pick-highlight");let R=E(A);l(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function T(b){if(!t)return;b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation();let S=y(b.clientX,b.clientY,8);S.length!==0&&(l(S[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:S,selectedIndex:0,point:{x:b.clientX,y:b.clientY}}))}function M(b){b.key==="Escape"&&(P(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function D(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`\n`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",w,!0),document.addEventListener("click",T,!0),document.addEventListener("keydown",M,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function P(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",w,!0),document.removeEventListener("click",T,!0),document.removeEventListener("keydown",M,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function _(){window.__HF_PICKER_API={enable:D,disable:P,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(b,S,A)=>Number.isFinite(b)&&Number.isFinite(S)?y(b,S,A):[],pickAtPoint:(b,S,A)=>{if(!Number.isFinite(b)||!Number.isFinite(S))return null;let R=y(b,S,8);if(!R.length)return null;let N=Math.max(0,Math.min(R.length-1,Number(A??0))),G=R[N]??null;return G?(s(G),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),P(),G):null},pickManyAtPoint:(b,S,A)=>{if(!Number.isFinite(b)||!Number.isFinite(S))return[];let R=y(b,S,8);if(!R.length)return[];let N=[],G=Array.isArray(A)?A:[0];for(let U of G){let ne=Math.max(0,Math.min(R.length-1,Math.floor(Number(U)))),H=R[ne];if(!H)continue;N.some(_e=>_e.selector===H.selector&&_e.tagName===H.tagName)||N.push(H)}return N.length?(s(N[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:N}),P(),N):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:D,disablePickMode:P,installPickerApi:_}}var Ef=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Nt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function gs(e,t,n=Ef){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function an(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&F("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function He(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&F("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function sn(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){F("runtime.player.site1",i)}}}function xs(e,t,n,r){let i=Nt(t,n),o=r?.suppressEvents===!0;return He(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function Cf(e,t,n,r,i){let o=[];sn(e,t,a=>{He(a,"play"),o.push(a)});try{return xs(t,n,r,i)}finally{for(let a of o)try{He(a,"pause")}catch(l){F("runtime.player.site2",l)}}}function _f(e,t){sn(e,t,n=>{He(n,"play")})}function bs(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??an(n,"duration",0))||0);r>0&&Math.max(0,an(n,"time",0))>=r&&(He(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),He(n,"play"),sn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),He(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;He(n,"pause"),sn(e.getTimelineRegistry?.(),n,i=>{He(i,"pause")});let r=Math.max(0,an(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=Cf(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),He(i,"play"),sn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),He(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(_f(e.getTimelineRegistry?.(),i),xs(i,n,o,r)):Nt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>an(e.getTimeline(),"time",0),getDuration:()=>an(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function ys(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var Af=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function wi(e){return e.id||e.getAttribute("data-hf-id")||null}function Ai(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function wf(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function Tf(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=Ai(e.getAttribute("data-playback-start"))??Ai(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function Rf(e,t,n,r){let i=Ai(e.getAttribute("data-duration"));return i!=null&&i>0?i:wf(e,t)??Tf(e)??Math.max(0,n-r)}function Ff(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function Ss(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||Af.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Rf(l,n,r,s)<=0)continue;let u={id:wi(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Ff(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ti="css:root",vs=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Lf=new Set([...vs,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Nf=new Set(["absolute","relative"]),Mf=new Set(["flex","inline-flex","grid","inline-grid"]),kf=new Set(["layout","paint","strict","content"]),Df=new Set(["size","inline-size"]);function If(e){return e.position==="fixed"||e.position==="sticky"}function Pf(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Nf.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Mf.has(n)}function Of(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:vs.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function Gf(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>kf.has(n))?!0:Df.has(e.getPropertyValue("container-type"))}function Hf(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Lf.has(t))}function Bf(e,t){return If(t)||Pf(e,t)||Of(t)||Gf(t)?!0:Hf(t)}function Uf(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function Zn(e){let t=e.ownerDocument.defaultView;if(!t)return Ti;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Bf(n,t.getComputedStyle(n)))return Uf(n)}catch{return Ti}n=n.parentElement}return Ti}var Mt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),sb=Object.freeze([Mt.start,Mt.duration,Mt.trackIndex]),lb=Object.freeze([Mt.derivedEnd]),ub=Object.freeze([Mt.derivedEnd,Mt.legacyTrack]);function Me(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Cs=/^[A-Za-z0-9_.:-]+$/;function _s(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Es(e,t){let n=t;for(;n>=0&&_s(e,n);)n--;return n}function Wf(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Vf(e){let t=e.length-1;if(!_s(e,t))return null;let n=Es(e,t);return e[n]==="."&&(n=Es(e,n-1)),n+1}function zf(e){let t=Vf(e);if(t==null)return null;let n=Wf(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!Cs.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Ri(e){let t=(e??"").trim();if(!t)return null;let n=Me(t);if(n!=null)return{kind:"absolute",value:n};if(Cs.test(t))return{kind:"reference",refId:t,offset:0};let r=zf(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var $f="data-hf-authored-duration",qf="data-hf-authored-end";function jf(e){return Me(e.getAttribute("data-duration"))}function Kf(e){return Me(e.getAttribute("data-end"))}function Yf(e){return Me(e.getAttribute($f))}function Xf(e){return Me(e.getAttribute(qf))}function it(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let x=r.getElementById(f);return x||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let x=f.ownerDocument.defaultView?.HTMLMediaElement;return x?f instanceof x:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let x=o.get(f);if(x!==void 0)return x;let v=null,E=jf(f)??(n?Yf(f):null);if(E!=null&&E>0&&(v=E),v==null||v<=0){let y=Kf(f)??(n?Xf(f):null);if(y!=null){let w=m(f,0),T=y-w;Number.isFinite(T)&&T>0&&(v=T)}}if((v==null||v<=0)&&s(f)){let y=Me(f.getAttribute("data-playback-start"))??Me(f.getAttribute("data-media-start"))??0;Number.isFinite(f.duration)&&f.duration>y&&(v=(f.duration-y)/qe(f))}if(v==null||v<=0){let y=f.getAttribute("data-composition-id");if(y){let w=t[y]??null;if(w&&typeof w.duration=="function")try{let T=Number(w.duration());Number.isFinite(T)&&T>0&&(v=T)}catch(T){F("runtime.startResolver.site1",T)}}}return v!=null&&Number.isFinite(v)&&v>0?(o.set(f,v),v):(o.set(f,null),null)},c=(f,x)=>{if(f.hasAttribute("data-composition-id")){let E=f.parentElement?.closest("[data-composition-id]");return E?m(E,x):0}let v=f.closest("[data-composition-id]");return v?m(v,x):0},m=(f,x)=>{let v=i.get(f);if(v!==void 0)return v??x;if(a.has(f))return x;a.add(f);try{let E=Ri(f.getAttribute("data-start"));if(!E){if(f.hasAttribute("data-composition-id")){let D=f.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id")||D.hasAttribute("data-composition-file"))){let P=m(D,x);return i.set(f,P),P}}return i.set(f,x),x}if(E.kind==="absolute"){let D=Math.max(0,E.value),P=Math.max(0,c(f,x)+D);return i.set(f,P),P}let y=l(E.refId);if(!y)return i.set(f,x),x;let w=m(y,0),T=u(y);if(T==null||T<=0){let D=Math.max(0,w+E.offset);return i.set(f,D),D}let M=Math.max(0,w+T+E.offset);return i.set(f,M),M}finally{a.delete(f)}};return{resolveStartForElement:(f,x=0)=>m(f,Math.max(0,x)),resolveDurationForElement:f=>u(f)}}function Fi(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Qf="data-hf-authored-duration",Zf="data-hf-authored-end";function Te(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Li(e){return Te(e.getAttribute("data-duration"))??Te(e.getAttribute(Qf))}function As(e){return Te(e.getAttribute("data-end"))??Te(e.getAttribute(Zf))}function Ni(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function Mi(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function ki(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function un(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function ws(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return un(t);let n=e.getAttribute("data-composition-src");if(n)return un(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?un(r.getAttribute("src")):null}function em(e){let t=e.className;return typeof t!="string"?null:t.split(/\\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function tm(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function nm(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ln(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function rm(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return ln(i);let o=e.id;if(o)return ln(o);let a=em(e);if(a)return ln(a);let l=tm(ws(e));if(l)return ln(l);let s=nm(e);return s||`${ln(t)} ${n+1}`}function Ts(e){let n=window.__timelines??{},r=it({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=B=>{if(!B)return null;let k=n[B]??null;if(!k||typeof k.duration!="function")return null;try{let I=Number(k.duration());return Number.isFinite(I)&&I>0?I:null}catch{return null}},o=B=>{let k=Te(B.getAttribute("data-duration"));if(k!=null&&k>0)return k;let I=Te(B.getAttribute("data-playback-start"))??Te(B.getAttribute("data-media-start"))??0;return Number.isFinite(B.duration)&&B.duration>I?Math.max(0,(B.duration-I)/qe(B)):null},a=()=>{let B=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(B.length===0)return null;let k=0;for(let I of B){let ue=I.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(I,0):Math.max(0,Number(I.getAttribute("data-start")??0)||0);if(!Number.isFinite(ue))continue;let ae=o(I);ae==null||ae<=0||(k=Math.max(k,Math.max(0,ue)+ae))}return k>0?k:null},l=(B,k)=>{let I=[],ue=null,ae=null,$=null,q=B.parentElement;for(;q;){let j=q.getAttribute("data-composition-id");j&&(I.push(j),!$&&q!==k&&($=j),ue==null&&(ue=r.resolveStartForElement(q,0)),ae==null&&(ae=Te(q.getAttribute("data-duration"))??i(j)??null)),q=q.parentElement}return{parentCompositionId:$,compositionAncestors:I.reverse(),inheritedStart:ue,inheritedDuration:ae}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,v=i(c),E=Li(s??document.body),y=Mi(...u.filter(B=>B!==s).map(B=>{let k=r.resolveStartForElement(B,0),I=r.resolveDurationForElement(B)??i(B.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||I==null||I<=0?null:Math.max(0,k)+I})),w=y!=null?Math.max(0,y-Math.max(0,m)):null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,M=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,D=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,P=typeof w=="number"&&Number.isFinite(w)&&w>0?w:null,_=Mi(D,P),b=T!=null&&_!=null&&T>_+1,A=M??(b?_:Mi(T,D,P))??null,N=(A!=null?m+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),G=(B,k)=>!Number.isFinite(k)||k<=0?0:N==null||!Number.isFinite(N)?k:!Number.isFinite(B)||B>=N?0:Math.max(0,Math.min(k,N-B)),U=[],ne=[],H=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),J=0;for(let[B,k]of H.entries()){if(k===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let I=l(k,s),ue=r.resolveStartForElement(k,I.inheritedStart??0),ae=k.getAttribute("data-composition-id"),$=Li(k);if(($==null||$<=0)&&ae&&ae!==c&&($=i(ae)),($==null||$<=0)&&k instanceof HTMLMediaElement){let me=Te(k.getAttribute("data-playback-start"))??Te(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&($=Math.max(0,k.duration-me))}if($==null||$<=0){let me=I.inheritedDuration;if(me!=null&&me>0){let Ie=(I.inheritedStart??0)+me;$=Math.max(0,Ie-ue)}}if($==null||$<=0||($=G(ue,$),$<=0))continue;let q=ue+$;J=Math.max(J,q);let j=k.tagName.toLowerCase(),We=ae&&ae!==c?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";U.push({id:wi(k)??ae??null,label:rm(k,We,U.length),start:ue,duration:$,track:ki(k,B),zIndex:Ni(k),stackingContextId:Zn(k),kind:We,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:I.compositionAncestors,parentCompositionId:I.parentCompositionId,nodePath:null,compositionSrc:un(k.getAttribute("data-composition-src")),playbackStart:Tt(k),playbackRate:qe(k),assetUrl:ws(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Te(k.getAttribute("data-timeline-priority"))})}let _e=new Set(U.map(B=>B.id)),z=s?.getAttribute("data-composition-id")??null,Y=z?n[z]??null:null;if(Y&&s){let B=Y;if(typeof B.getChildren=="function")try{let k=B.getChildren(!0,!0,!1)??[],I=new Map;for(let $ of s.children){let q=$;if(!q.id)continue;let j=q.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||I.set(q,{id:q.id,start:1/0,end:-1/0})}let ue=$=>{let q=$;for(;q;){if(I.has(q))return q;if(q===s)return null;q=q.parentElement}return null};for(let $ of k){if(typeof $.targets!="function"||typeof $.startTime!="function"||typeof $.duration!="function")continue;let q=$.startTime(),j=$.parent;for(;j&&j!==Y&&typeof j.startTime=="function";)q+=j.startTime(),j=j.parent;let We=q+$.duration();if(!(!Number.isFinite(q)||!Number.isFinite(We)))for(let me of $.targets()){if(!(me instanceof Element))continue;let Ct=ue(me);if(!Ct)continue;let Ie=I.get(Ct);Ie&&(Ie.start=Math.min(Ie.start,q),Ie.end=Math.max(Ie.end,We))}}let ae=U.length>0?Math.max(...U.map($=>$.track))+1:0;for(let[$,q]of I){if(q.start===1/0||q.end===-1/0)continue;let j=$;if(_e.has(j.id))continue;let We=Math.max(0,q.end-q.start);if(We<=0)continue;let me=G(q.start,We);me<=0||(J=Math.max(J,q.start+me),U.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:q.start,duration:me,track:ki(j,ae),zIndex:Ni(j),stackingContextId:Zn(j),kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:Tt(j),playbackRate:qe(j),assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:Te(j.getAttribute("data-timeline-priority"))}),_e.add(j.id))}}catch(k){F("runtime.timeline.site1",k)}}if(s&&A!=null&&A>0){let B=U.length>0?Math.max(...U.map(k=>k.track))+1:0;for(let k of s.children){let I=k;if(!I.id||_e.has(I.id))continue;let ue=I.getAttribute("data-timeline-role");if(ue!=="overlay"&&ue!=="persistent-overlay")continue;let ae=I.tagName.toLowerCase();if(ae==="script"||ae==="style"||ae==="link"||ae==="meta"||window.getComputedStyle(I).display==="none")continue;let q=G(0,A);q<=0||(J=Math.max(J,q),U.push({id:I.id,label:I.getAttribute("data-timeline-label")??I.getAttribute("data-label")??I.getAttribute("aria-label")??I.id,start:0,duration:q,track:ki(I,B),zIndex:Ni(I),stackingContextId:Zn(I),kind:"element",tagName:ae,compositionId:I.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:Tt(I),playbackRate:qe(I),assetUrl:null,timelineRole:ue,timelineLabel:I.getAttribute("data-timeline-label"),timelineGroup:I.getAttribute("data-timeline-group"),timelinePriority:Te(I.getAttribute("data-timeline-priority"))}),_e.add(I.id))}}for(let B of u){if(B===s)continue;let k=B.getAttribute("data-composition-id");if(!k||!Fi(k))continue;let I=r.resolveStartForElement(B,0),ue=Li(B);if((ue==null||ue<=0)&&As(B)!=null){let j=As(B);ue=Math.max(0,j-I)}let ae=i(k),$=ue&&ue>0?ue:ae;if($==null||$<=0)continue;let q=G(I,$);q<=0||ne.push({id:k,label:B.getAttribute("data-label")??k,start:I,duration:q,thumbnailUrl:un(B.getAttribute("data-thumbnail-url")),avatarName:null})}let V=Math.max(1,J||1,A??0),ee=b&&M==null,Ae=ee?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{...Wn(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:ee?Number.POSITIVE_INFINITY:V,durationInFrames:Ae,clips:U,scenes:ne,compositionWidth:Te(s?.getAttribute("data-width"))??1920,compositionHeight:Te(s?.getAttribute("data-height"))??1080}}var de=fd(Ql(),1),Zl=de.default,Cy=de.default.stringify,_y=de.default.fromJSON,Ay=de.default.plugin,wy=de.default.parse,Ty=de.default.list,Ry=de.default.document,Fy=de.default.comment,Ly=de.default.atRule,Ny=de.default.rule,My=de.default.decl,ky=de.default.root,Dy=de.default.CssSyntaxError,Iy=de.default.Declaration,Py=de.default.Container,Oy=de.default.Processor,Gy=de.default.Document,Hy=de.default.Comment,By=de.default.Warning,Uy=de.default.AtRule,Wy=de.default.Result,Vy=de.default.Input,zy=de.default.Rule,$y=de.default.Root,qy=de.default.Node;var oo="data-hf-authored-id",eu="data-hf-inner-root";function ao(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function so(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Ap(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function nu(e){let t=e.trim();return t?Array.from(new Set([t,Ap(t)])).filter(Boolean):[]}function wp(e){return!!e&&/[\\w-]/.test(e)}function Tp(e,t,n){let r=nu(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\\\"&&(a=null);continue}if(s===\'"\'||s==="\'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!wp(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function Rp(e,t){let n=t?.trim();return n?Tp(e,n,`[${oo}="${so(n)}"]`):e}function tu(e){return`${e}:not(:has([${eu}])), ${e} > [${eu}]`}function Fp(e,t,n,r,i,o){let a=Rp(e,r),l=Lp(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?tu(t):e;let u=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${ao(n)}\\\\1\\\\s*\\\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?tu(t):l.replace(u,t);let c=l.match(/^\\s*/)?.[0]??"",m=l.match(/\\s*$/)?.[0]??"";if(i){let f=r?`[${oo}="${so(r)}"]`:null;if(f&&s.startsWith(f)){let x=s.slice(f.length);return`${c}${t}${f}${x}${m}`}}return`${c}${t} ${s}${m}`}function Lp(e,t,n){let r=ao(n),i=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${r}"|\'${r}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var Np=new Set(["keyframes","-webkit-keyframes","font-face"]);function Mp(e){return e?.type==="atrule"}function kp(e){let t=e.parent;for(;t;){if(Mp(t)&&Np.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function Dp(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function ru(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${so(o)}"]`,l=Zl.parse(e);return l.walkRules(s=>{kp(s)||Dp(s)||(s.selectors=s.selectors.map(u=>Fp(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function iu(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=JSON.stringify(t),l=JSON.stringify(i),s=JSON.stringify(n),u=ao(t),c=JSON.stringify(o?.trim()||null),m=JSON.stringify(r??null),f=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),x=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),v=JSON.stringify(nu(o?.trim()||""));return`(function(){\n var __hfCompId = ${a};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${s};\n var __hfAuthoredRootId = ${c};\n var __hfAuthoredRootAttr = ${JSON.stringify(oo)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${m} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${f};\n var __hfTimingSelectorPattern = ${x};\n var __hfAuthoredRootIdForms = ${v};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfIsSelectorNameChar = function(char) {\n return !!char && /[\\\\w-]/.test(char);\n };\n var __hfReplaceAuthoredRootIdSelectors = function(selector) {\n if (!__hfAuthoredRootSelector || !__hfAuthoredRootIdForms.length || typeof selector !== "string") {\n return selector;\n }\n var result = "";\n var bracketDepth = 0;\n var quote = null;\n for (var index = 0; index < selector.length; index += 1) {\n var char = selector[index];\n var previousChar = index > 0 ? selector[index - 1] : "";\n if (quote) {\n result += char;\n if (char === quote && previousChar !== "\\\\\\\\") {\n quote = null;\n }\n continue;\n }\n if (char === \'"\' || char === "\'") {\n quote = char;\n result += char;\n continue;\n }\n if (char === "[") {\n bracketDepth += 1;\n result += char;\n continue;\n }\n if (char === "]") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n result += char;\n continue;\n }\n if (char === "#" && bracketDepth === 0) {\n var matchedForm = null;\n for (var formIndex = 0; formIndex < __hfAuthoredRootIdForms.length; formIndex += 1) {\n var form = __hfAuthoredRootIdForms[formIndex];\n if (selector.slice(index + 1, index + 1 + form.length) === form) {\n matchedForm = form;\n break;\n }\n }\n if (matchedForm) {\n var nextChar = selector[index + 1 + matchedForm.length];\n if (!__hfIsSelectorNameChar(nextChar)) {\n result += __hfAuthoredRootSelector;\n index += matchedForm.length;\n continue;\n }\n }\n }\n result += char;\n }\n return result;\n };\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfAuthoredRootSelector) {\n normalized = __hfReplaceAuthoredRootIdSelectors(normalized);\n }\n return normalized;\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var authoredValue = Reflect.get(target, prop, target);\n return authoredValue === undefined\n ? Reflect.get(target, __hfTimelineCompId, target)\n : authoredValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities\n // instead of replacing one with the other.\n var authoredSet = Reflect.set(target, __hfCompId, value, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n return authoredSet && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})();`}var Ip=["data-composition-id","data-composition-file","data-start","data-duration","data-end","data-track-index","data-track","data-composition-src","data-hf-authored-duration","data-hf-authored-end"];function ou(e){let t=e.getAttribute("id")?.trim();for(let n of Ip)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Pp=8e3,Op=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,Gp=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,Hp=["src","href"];function Bp(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function su(e,t){if(!t)return e;let n=e.trim();if(Bp(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function lu(e,t){return!t||!e?e:e.replace(Gp,(n,r,i)=>{let o=su(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function Up(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Hp){let i=n.getAttribute(r);if(i==null)continue;let o=su(i,t);o!==i&&n.setAttribute(r,o)}}function Wp(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=lu(r,t);i!==r&&n.setAttribute("style",i)}}function Vp(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=lu(r,t);i!==r&&(n.textContent=i)}}function uu(e,t){if(t){Up(e,t),Wp(e,t),Vp(e,t);for(let n of Array.from(e.querySelectorAll("template")))uu(n.content,t)}}function zp(e,t){return`${e}__hf${t}`}var $p=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),Pp)});function uo(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function qp(e){let t=document.importNode(e,!0);ou(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function au(e,t){let n=e.trim();if(!n)return e;try{return Op.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function lo(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function hr(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function jp(e){let t=new Map;for(let n of e){let r=hr(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function cu(e){let t=hr(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function Kp(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function Yp(e){return e.hasAttribute("data-composition-src")?!0:cu(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:Kp(e):!1}function fo(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:cu(t))}function du(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(fo().map(n=>hr(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function fu(e,t=jp(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=hr(i),l=Yp(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let c=s?(n.get(o)||0)+1:0;s&&n.set(o,c),u=s?zp(o,c):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function co(e){let t=null;e.authoredCompositionId&&(t=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x instanceof HTMLElement&&x.getAttribute("data-composition-id")===e.authoredCompositionId)??null);let n=t??e.sourceNode,r=t?.getAttribute("data-composition-id")?.trim()||e.authoredCompositionId||null,i=e.runtimeCompositionId||r||null,o=t?.getAttribute("id")?.trim()||null,a=i?`[data-composition-id="${CSS.escape(i)}"]`:void 0;if(e.headLinks)for(let f of e.headLinks){let x=(f.getAttribute("href")||"").trim();if(!x)continue;let v=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&lo(v,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(v)}"]`))continue;let E=f.cloneNode(!0);E.href=v,document.head.appendChild(E),e.injectedLinks.push(E)}let l=f=>{for(let x of f){let v=x.cloneNode(!0);v instanceof HTMLStyleElement&&(r&&(v.textContent=ru(v.textContent||"",r,a,o,{scopeRootSelectors:!0})),document.head.appendChild(v),e.injectedStyles.push(v))}};e.headStyles&&l(e.headStyles),l(Array.from(n.querySelectorAll("style")));let s=[];if(e.headScripts)for(let f of e.headScripts){let x=f.getAttribute("type")?.trim()??"",v=f.getAttribute("src")?.trim()??"";if(v){let E=au(v,e.compositionUrl);if(e.compositionUrl&&lo(E,e.compositionUrl))continue;s.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&s.push({kind:"inline",content:E,type:x,scopeCompositionId:r})}}let u=Array.from(n.querySelectorAll("script")),c=[...s];for(let f of u){let x=f.getAttribute("type")?.trim()??"",v=f.getAttribute("src")?.trim()??"";if(v){let E=au(v,e.compositionUrl);if(e.compositionUrl&&lo(E,e.compositionUrl)){f.parentNode?.removeChild(f);continue}c.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&c.push({kind:"inline",content:E,type:x,scopeCompositionId:r})}f.parentNode?.removeChild(f)}let m=Array.from(n.querySelectorAll("style"));for(let f of m)f.parentNode?.removeChild(f);if(t){let f=t.getAttribute("data-width"),x=t.getAttribute("data-height"),v=e.parseDimensionPx(f),E=e.parseDimensionPx(x);f&&e.host.setAttribute("data-width",f),x&&e.host.setAttribute("data-height",x),v&&e.host instanceof HTMLElement&&(e.host.style.width=v),E&&e.host instanceof HTMLElement&&(e.host.style.height=E),t.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked",""),e.host.appendChild(qp(t))}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;i&&Xp(e,n,i);for(let f of c){let x=document.createElement("script");if(f.type&&(x.type=f.type),x.async=!1,f.kind==="external"?x.src=f.src:f.type.toLowerCase()==="module"?x.textContent=f.content:f.scopeCompositionId?x.textContent=iu(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",a,i||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),f.kind==="external"){let v=await $p(x);v.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:v.status,elapsedMs:v.elapsedMs}})}}}async function mu(e){let t=fo();if(du(),t.length===0)return;let n=fu(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);uo(i),await co({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function pu(e){let t=fo();if(du(),t.length===0)return;let n=fu(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}uo(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await co({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),v=new DOMParser().parseFromString(f,"text/html");uu(v,u);let E=(l?v.querySelector(`template#${CSS.escape(l)}-template`):null)??v.querySelector("template"),y=E?E.content:v.body,w=E?void 0:Array.from(v.head.querySelectorAll("style")),T=E?void 0:Array.from(v.head.querySelectorAll("script")),M=Array.from(v.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await co({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:y,hasTemplate:!!E,fallbackBodyInnerHtml:v.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,headStyles:w,headScripts:T,headLinks:M,declaredVariableDefaults:Jt(v.documentElement),onDiagnostic:e.onDiagnostic})}catch(c){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:c instanceof Error?c.message:"unknown_error"}}),uo(i)}}))}function Xp(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?Jt(t):{}),...fa(e.host)};ca(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,Jr(e.host,{...ua(e.host,i,window),...zn()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function Jp(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function Qp(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!(r instanceof HTMLElement))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function Zp(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}function mo(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=Qp();for(let r of t){let i=null;if(r.wordId&&(i=Jp(document.getElementById(r.wordId))),!i&&r.wordIndex!==void 0&&(i=n[r.wordIndex]??null),!i)continue;let o={},a={};if(r.x!==void 0&&(o.x=r.x),r.y!==void 0&&(o.y=r.y),r.scale!==void 0&&(o.scale=r.scale),r.rotation!==void 0&&(o.rotation=r.rotation),r.opacity!==void 0&&(a.opacity=r.opacity),r.fontSize!==void 0&&(a.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(a.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(a.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let s=e.getTweensOf(i).filter(c=>c.vars.color!==void 0).sort((c,m)=>c.startTime()-m.startTime()),u=s[0]?String(s[0].vars.color):"";for(let c of s)String(c.vars.color)===u?r.dimColor&&(c.vars.color=r.dimColor):r.activeColor&&(c.vars.color=r.activeColor);r.dimColor&&e.set(i,{color:r.dimColor})}if(Object.keys(a).length>0&&e.set(i,a),Object.keys(o).length>0){let l=Zp(i);e.set(l,o)}}}).catch(()=>{})}var ho="data-hf-edit-base-x",go="data-hf-edit-base-y",Gt="data-hf-edit-original-translate",gr=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},e0=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},hu=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,po=(e,t)=>hu.test(e)&&hu.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,t0=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=e0(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${po(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${po(r,t)} ${po(i,n)}${a}`},n0=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},r0=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},xo=new WeakMap;function i0(e,t){let n=xo.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ne("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=gr(e.getAttribute("data-x"))-gr(e.getAttribute(ho)),i=gr(e.getAttribute("data-y"))-gr(e.getAttribute(go));e.hasAttribute(Gt)||e.setAttribute(Gt,r0(e)),n===void 0&&n0(e);let o=e.getAttribute(Gt)??"",a=t0(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),xo.set(e,e.style.getPropertyValue("translate"))}function xr(e,t){let n=e.defaultView?.HTMLElement,r=e.defaultView?.SVGElement,i=s=>n||r?n!==void 0&&s instanceof n||r!==void 0&&s instanceof r:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${Gt}]:not([${ho}]):not([${go}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(Gt)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(Gt),xo.delete(u)}let a=e.querySelectorAll(`[${ho}], [${go}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(i0(u,t),l+=1)}return l}var gu="__hfPositionEditsSeekReapplyWrapped",xu=new WeakSet,bu=new WeakMap,yu=new WeakMap;function Su(e){let t=e,n=()=>{try{xr(t.document)}catch{}},r=m=>typeof m=="function"&&(xu.has(m)||!!m[gu]),i=m=>{xu.add(m);try{Object.defineProperty(m,gu,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||r(m))return m;let f=function(...x){let v=m.apply(this,x);return n(),v};return i(f),f},a=(m,f)=>{let x=bu.get(m);if(x?.has(f))return!0;let v=Object.getOwnPropertyDescriptor(m,f);if(v?.configurable===!1){let w=m[f];return typeof w=="function"&&(m[f]=o(w),n()),!1}let E=m[f],y=v?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:v?.enumerable??!0,get:()=>E,set:w=>{E=o(w),y?.call(m,w)}}),E=o(E),x??(x=new Set),x.add(f),bu.set(m,x),n(),!0},l=(m,f)=>{let x=yu.get(t),v=Object.getOwnPropertyDescriptor(t,m);if(!x?.has(m)){if(v?.configurable===!1){let w=t[m];return w?a(w,f):!1}let y=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:v?.enumerable??!0,get:()=>y,set:w=>{y=w,y&&a(y,f)}}),x??(x=new Set),x.add(m),yu.set(t,x)}let E=t[m];return E?a(E,f):!1},s=()=>{let m=l("__hf","seek"),f=l("__player","renderSeek");return m&&f};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function br(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function yr(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var vu=new Set(["img","video","audio","source"]);function o0(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function a0(e){let t=e.replace(/[\\u0000-\\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\\//i.test(t):!1:!1}function s0(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function l0(e){if(yr(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function bo(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=br(e);return t.set(n,i),i}function u0(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function c0(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function d0(e,t){let n=new Set,r=c0(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=bo(i,t);for(let[a,l]of Object.entries(o)){let s=l0(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,s0(s))}}}function yo(e){let t=new Map;d0(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!vu.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(vu).join("/")}.`);continue}let i=o0(bo(n,t)[r]);if(i!==null){if(!a0(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=bo(n,t)[r];yr(i)&&u0(n,String(i))}}var Qe=new Map,f0="data-hf-color-grading-canvas",m0="__hf_color_grading_canvas__";function Mu(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute(Xn)||r.setAttribute(Xn,r.style.opacity))},n=r=>{if(r instanceof Element){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var p0=16,h0=4,Bt={enabled:!1,position:.5,softness:0,lineWidth:2},So=["#000000","#ffffff"],g0=["#1a1a1a","#f5f5dc"],kn=3,x0=kn-1,b0=5,vo=`${je}.0`,Eu=`${je-1}.0`,y0=`${kn}.0`,S0=`${(x0+.5)/kn}`;function Sr(e){let t=e.getAttribute(rn);return t==null?null:ms(t,br(e))}var v0=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`\n`),E0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }"," return base;","}","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${Eu};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Eu});`,` float y = (row + 0.5) / ${y0};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${vo}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${vo}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${vo}, ${S0}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`\n`),C0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`\n`),_0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`\n`),A0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`\n`);function St(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Cu(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function _u(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(F("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Ar(e,t=E0){let n=_u(e,v0,e.VERTEX_SHADER),r=_u(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(F("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function vr(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function w0(e,t){let n=Ar(e,C0);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function T0(e,t){let n=Ar(e,_0);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function R0(e,t){let n=Ar(e,A0);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function Ln(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=vr(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function Cr(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Eo(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Au(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function wo(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Ar(t),r=vr(t),i=vr(t,t.NEAREST),o=vr(t,t.NEAREST);if(!n||!r||!i||!o)return Au(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Eo(t,n,Jn),detailUniforms:Eo(t,n,bi),effectUniforms:Eo(t,n,yi),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Au(t,n,[r,i,o]),null)}function F0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L0(e){if(!F0(e))return{...Bt};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,Bt.position,0,1),softness:t(e.softness,Bt.softness,0,.25),lineWidth:t(e.lineWidth,Bt.lineWidth,0,12)}}function ku(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function wr(e){return e instanceof Error?e.message:"LUT failed to load"}function N0(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Du(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return N0(t)}function To(e){let t=ku(e);if("error"in t)return{state:"error",message:t.error};let n=Qe.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>za(o,{maxSize:jn})),i={state:"pending",promise:r};for(;Qe.size>=p0;){let o=Qe.keys().next().value;if(!o)break;Qe.delete(o)}return Qe.set(t.href,i),r.then(o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"ready",lut:o})},o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"error",message:wr(o)})}),i}function wu(e,t,n){if(e.lut?.src===t)return e.lut;let r=ui(n),{gl:i,program:o}=e;try{return Iu(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=wr(a),e.lutLoadingSrc=null,F("runtime.colorGrading.uploadLut",a),null}}async function M0(e){let t=To(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Iu(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function k0(e,t,n){let r=ui(n),{gl:i,program:o}=e;return Iu(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Xe(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Ro(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Xe(e.gl,t.scratch),Xe(e.gl,t.blur),t.bloom&&Xe(e.gl,t.bloom),e.effectTargets=null)}function Fo(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Xe(e.gl,t.moments),Xe(e.gl,t.output),e.kuwaharaTargets=null)}function Er(e,t=!1){Ro(e),Fo(e),D0(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function D0(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function I0(e){let t=wo(e.canvas);return t?(Er(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ao(e){if(!e.sourceHidden)return;e.element.removeAttribute(on);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function P0(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=w0(t,e.program.quad),r=Ln(t),i=Ln(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Xe(t,r),i&&Xe(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function O0(e,t){return t.bloom||(t.bloom=Ln(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Tu(e){let t=e.effectTargets;t?.bloom&&(Xe(e.gl,t.bloom),t.bloom=null)}function G0(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=T0(t,e.program.quad),o=R0(t,e.program.quad),a=Ln(t,n.HALF_FLOAT_OES,t.NEAREST),l=Ln(t);return!i||!o||!a||!l?(H0(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function H0(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Xe(e,r),i&&Xe(e,i)}function Pu(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return Cr(e,t,o,a),Cr(e,n,o,a),{width:o,height:a}}function _r(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),Nn(e,t)}function B0(e,t,n,r,i,o,a){let l=Pu(e,t.scratch,r,i/2,o/2),s=a/2;_r(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),_r(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function U0(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)_r(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),_r(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function Nn(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function W0(e,t,n,r,i,o,a,l){Cr(e,t.moments,i.width,i.height),Cr(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),Nn(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),Nn(e,u)}function V0(e,t,n,r){if(n<=0)return!1;let i=Pu(e.gl,t.scratch,t.blur,r.width,r.height);return U0(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function z0(e,t,n,r,i,o){if(n<=0)return Tu(e),null;o||Tu(e);let a=o?O0(e,t):t.blur;return a?(B0(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function $0(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Ro(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=P0(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=V0(e,l,o,n),u=z0(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function q0(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Fo(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=G0(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(W0(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Ou(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=$0(e,t,n,o),l=q0(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function j0(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=ku(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=To(t);return i.state==="ready"?wu(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(wu(e,r.href,o),ke(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=wr(o),e.lutLoadingSrc=null,ke(e))})),null)}function Rn(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&St(n))return n;try{let r=document.querySelector(t);return r&&St(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&St(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&St(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&St(r)?r:null}catch{return null}}function Gu(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Hu(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Bu(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&Hu(t)?t:null}function Ru(e){if(!(e instanceof HTMLVideoElement))return!1;let t=Bu(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function K0(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function Y0(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Uu(e){if(e instanceof HTMLVideoElement){let t=Bu(e);if(t)return t}return Hu(e)?e:null}function Fu(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function X0(e){let t=e.trim().split(/\\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Fu(o,"x"),l=Fu(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function Wu(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=X0(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function J0(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Lu(e,t){return Math.max(0,Math.round(e>0?e:t))}function Q0(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&J0(e,i);let o=window.getComputedStyle(t);gs(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Lu(n.offsetWidth,a.width),s=Lu(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function Ht(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function vt(e,t,n,r){e.set(r,(t*je+n)*4)}function ut(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Co(e,t,n){return e.length>=3?di(e,t,n):new Float32Array(je)}function yt(e,t){return e[t]??0}function Z0(e,t,n){let r=Rt(t.red),i=Rt(t.green),o=Rt(t.blue),a=Rt(t.master),l=Co(n.hueVsHue,-180,180),s=Co(n.hueVsSaturation,-1,1),u=Co(n.hueVsLuma,-1,1);for(let c=0;c<je;c+=1)vt(e,0,c,[yt(r,c),yt(i,c),yt(o,c),yt(a,c)]),vt(e,1,c,[ut(yt(l,c),180),ut(yt(s,c),1),ut(yt(u,c),1),1])}function eh(e,t,n){let r=n*b0;vt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),vt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),vt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),vt(e,2,r+3,[ut(t.correction.hueShift,180),ut(t.correction.saturation,1),ut(t.correction.luma,1),ut(t.correction.temperature,1)]),vt(e,2,r+4,[ut(t.correction.tint,1),.5,.5,1])}function th(e,t,n){let r=new Float32Array(je*kn*4);Z0(r,e,t);let i=0;for(let o of n)o.enabled&&(eh(r,o,i),i+=1);return r}var Nu=new WeakMap;function nh(e,t,n){let r=Nu.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Nu.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function rh(e,t,n,r){let{curves:i,hueCurves:o}=n,a=nh(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(th(i,o,r),tn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,je,kn,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function _o(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Vu(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:x,secondaries:v}=n,E=Ei(f),y=Ci(x),w=_i(v)?v.reduce((D,P)=>D+Number(P.enabled),0):0;(E||y||w>0)&&rh(e,t,n,v),_o(e,t.shadowWheel,n.wheels.shadows),_o(e,t.midtoneWheel,n.wheels.midtones),_o(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,E?1:0),e.uniform1f(t.hueCurvesEnabled,y?1:0),e.uniform1f(t.secondaryCount,w);for(let[D,P]of t.adjustUniforms)e.uniform1f(P,n.adjust[D]);for(let[D,P]of t.detailUniforms)e.uniform1f(P,n.details[D]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[D,P]of t.effectUniforms)e.uniform1f(P,n.effects[D]);let T=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?g0:So),M=T[T.length-1]??So[1];e.uniform1f(t.paletteSize,T.length),Ht(e,t.palette0,T[0]??So[0]),Ht(e,t.palette1,T[1]??M),Ht(e,t.palette2,T[2]??M),Ht(e,t.palette3,T[3]??M),Ht(e,t.palette4,T[4]??M),Ht(e,t.palette5,T[5]??M),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function ih(e){if(!e.sourceHidden){let t=e.element.getAttribute(Xn);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(on,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function Ze(e){let t=cs.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var zu=Ze("intensity"),$u=Ze("lut.intensity"),qu=Ze("adjust.exposure"),ju=Ze("effects.kuwahara"),Ku=[["blur",Ze("effects.blur")],["bloom",Ze("effects.bloom")],["kuwahara",ju],["pixelate",Ze("effects.pixelate")],["ascii",Ze("effects.ascii")],["dither",Ze("effects.dither")]],Yu=[zu,$u,qu,...Ku.map(([,e])=>e)];function Et(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Fn(e,t){return t!==null&&(ps(t)||Yu.some(n=>Et(e,n)!==null))}function oh(e,t){let n=null;for(let[r,i]of Ku){let o=Et(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function ah(e){let{element:t,grading:n}=e,r=Et(t,zu),i=Et(t,$u),o=Et(t,qu),a=oh(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function Xu(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Ju(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function ke(e){if(e.destroyed||e.contextLost)return!1;let t=Uu(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Gu(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=K0(t);if(s&&Y0(e,t),s||!a){let v=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=v.opacity||"1",e.sourceVisibleForCanvas=(s||l!=="hidden")&&v.visibility!=="hidden"}let u=Q0(e,r);if(!u)return!1;let c=window.getComputedStyle(r),m=Wu(u.width,u.height,n.width,n.height,c.objectFit,c.objectPosition),{gl:f,program:x}=e;try{let v=ah(e),E=j0(e);Xu(f,x.texture,t);let y=Et(e.element,ju)!==null,w=Ou(e,v,u,m,{preserveKuwahara:y});f.bindFramebuffer(f.FRAMEBUFFER,null),f.viewport(0,0,u.width,u.height),f.useProgram(x.program),Ju(f,x,w);let T=window.__player?.getTime?.(),M=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(M*60);return Vu(f,x,v,E,w.blurReady,w.bloomReady,w.kuwaharaReady,e.compare,u,m,D,M),Nn(f,x),ih(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",F("runtime.colorGrading.drawEntry",v),!1}}function sh(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function lh(){let e=document.createElement("canvas"),t=wo(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function uh(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function ch(e,t,n,r){let i=Uu(t);if(!i)return null;let o=Gu(i);if(!o)return null;let a=sh(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=Wu(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Xu(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:uh(t,r),grainSeed:Du(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function dh(e,t,n,r,i=!1){let o=ch(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=Qn(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let x=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=k0(e,f.lut.src,await M0(f.lut.src))),x=e.lut),c.push({id:m.id,dataUrl:fh(e,f,x,a,l,s,u)})}catch(v){c.push({id:m.id,dataUrl:null,error:wr(v)})}}return{...a,images:c}}function fh(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Ou(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Ju(s,u,c),n||(e.lut=null),Vu(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,Bt,r,i,o,a),Nn(s,u),l.toDataURL("image/png")}function Ye(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function mh(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Mn(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,ke(e),!e.destroyed&&!t.paused&&!t.ended&&Mn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,ke(e),!e.destroyed&&!t.paused&&!t.ended&&Mn(e)})}function ph(e){let t=()=>{ke(e)};if(Ye(e,e.element,"load",t),Ye(e,e.element,"loadedmetadata",t),Ye(e,e.element,"loadeddata",t),Ye(e,e.element,"seeked",t),Ye(e,e.element,"timeupdate",t),Ye(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Ye(e,e.element,"play",()=>Mn(e)),Ye(e,e.element,"pause",t)),Ye(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ao(e)}),Ye(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!I0(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ao(e);return}e.drawError=null,ke(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),ke(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function hh(e){if(e.destroyed)return null;e.destroyed=!0,mh(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Ro(e),Fo(e),Ao(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function Qu(e,t){return e.removeAttribute("style"),t.id?e.id=`${os}${t.id}`:e.removeAttribute("id"),e.className=m0,e.setAttribute(f0,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function gh(e){return Qu(document.createElement("canvas"),e)}function Zu(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(_,b,S)=>{let A=e.get(_);if(A)return A.grading=b,A.source=S,ke(A),_ instanceof HTMLVideoElement&&!_.paused&&Mn(A),!0;let R=n.pop();if(R)Qu(R.canvas,_);else{let G=gh(_),U=wo(G);if(!U)return G.remove(),!1;R={canvas:G,gl:U.gl,program:U.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let N={element:_,...R,grading:b,compare:{...Bt},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:S,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(_).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(_).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Du(_),destroyed:!1};return e.set(_,N),t.add(_),ph(N),ke(N),_ instanceof HTMLVideoElement&&!_.paused&&Mn(N),!0},s=(_,b)=>{if(a)return!1;let S=Rn(_);if(!S)return!1;let A=e.get(S);if(!A){let R=Sr(S);if(!Fn(S,R)||!l(S,R,"attribute"))return!1;A=e.get(S)}return A?(A.compare=L0(b),ke(A),!0):!1},u=_=>{let b=e.get(_);if(!b)return;let S=hh(b);S&&(b.contextLost||n.length>=h0?Er(S,!0):n.push(S)),e.delete(_),t.delete(_)},c=()=>{if(a)return 0;let _=new Set;document.querySelectorAll(`video[${rn}], img[${rn}]`).forEach(S=>{if(!St(S))return;_.add(S);let A=Sr(S);Fn(S,A)&&(Cu(S)||Ru(S))?l(S,A,"attribute"):u(S)});for(let S of t){let A=e.get(S);A&&(!S.isConnected||A.source==="attribute"&&!_.has(S))&&u(S)}return t.size},m=()=>{if(a)return 0;let _=0;for(let b of t){let S=e.get(b);S&&ke(S)&&(_+=1)}return _},f=async()=>{let _=new Set;for(let b of t){let S=e.get(b)?.grading.lut;if(!S?.src.trim()||(S.intensity??1)<=0)continue;let A=To(S.src);A.state==="pending"&&_.add(A.promise)}return _.size>0&&await Promise.allSettled(_),m(),_.size},x=()=>{if(a)return 0;let _=0;for(let b of t){let S=e.get(b);!S||!Yu.some(R=>Et(b,R)!==null)||b instanceof HTMLVideoElement&&!b.paused&&!b.ended||ke(S)&&(_+=1)}return _},v=(_,b)=>{if(a)return!1;let S=Rn(_);if(!S)return!1;let A=Qn(b);return Fn(S,A)?l(S,A,"live"):(u(S),!0)},E=(_,b)=>{if(!St(_))return!1;let S=e.get(_);if(!S){if(!b)return!1;let A=Sr(_);return Fn(_,A)&&l(_,A,"attribute")}return S.sourceVisibleForCanvas=b,!b&&S.source==="attribute"&&u(_),!0},y=_=>{let b=Rn(_);if(!b)return{state:"missing",message:"Media not found"};let S=e.get(b);if(S)return S.effectError?{state:"unavailable",message:S.effectError}:S.drawError?{state:"unavailable",message:S.drawError}:S.lutError?{state:"unavailable",message:`LUT error: ${S.lutError}`}:S.grading.lut&&S.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:S.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:S.lut?"Shader + LUT active":"Shader active"};let A=Sr(b);return Fn(b,A)?!Cu(b)&&!Ru(b)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},w=async(_,b,S)=>{let A=async()=>{if(a||b.length===0)return null;let N=Rn(_);return!N||(i??(i=lh()),!i)?null:dh(i,N,b,S?.maxDimension,S?.useMediaTime)},R=o.then(A,A);return o=R.then(()=>{},()=>{}),R},T=_=>{let b=Rn(_);if(!(b instanceof HTMLVideoElement))return null;if(!b.paused)return()=>{};let S=b.currentTime,A=b.loop,R=b.muted;return b.loop=!0,b.muted=!0,(b.ended||Number.isFinite(b.duration)&&S>=b.duration)&&(b.currentTime=0),b.play().catch(()=>{}),()=>{b.pause(),b.loop=A,b.muted=R,b.currentTime=S}},M=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let _ of t)u(_);for(let _ of n)Er(_,!0);n.length=0,i&&(Er(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[rn]}));let D={refresh:c,redraw:m,redrawAnimated:x,waitForActiveLuts:f,setGrading:v,setCompare:s,setSourceVisibility:E,getStatus:y,renderPreviews:w,startPreviewPlayback:T,destroy:M},P=window;return P.__hf=P.__hf||{},P.__hf.colorGrading=D,c(),D}var Tr=class{constructor(t){he(this,"_baseTime",0);he(this,"_playStartMs",null);he(this,"_rate",1);he(this,"_duration",1/0);he(this,"_nowMs");he(this,"_audioSource",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};function ec(e){return!Number.isFinite(e)||e<=0?1:e}function xh(e,t){t||e.paused||!Un().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function bh(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,safeRate:o,clipDuration:a}=t,l=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let c=s-n;return l&&c<=0?!1:(l?e.start(0,n+r,c):e.start(0,n+r),!0)}let u=-n/o;return l?e.start(i+u,r,s):e.start(i+u,r),!0}var Rr=class{constructor(){he(this,"_ctx",null);he(this,"_bufferCache",new Map);he(this,"_failedSrcs",new Set);he(this,"_activeSources",[]);he(this,"_masterGain",null);he(this,"_rateAnchorCtx",0);he(this,"_rateAnchorComp",0);he(this,"_rate",1);he(this,"_paused",!0);he(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!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 F("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return F("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),F("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}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 c=ec(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=c;let f=this._ctx.createGain();f.gain.value=a,m.connect(f),f.connect(this._masterGain);let x=o-r,v=this._ctx.currentTime;if(this._rate=c,this._rateAnchorCtx=v,this._rateAnchorComp=o,!bh(m,{elapsed:x,mediaStart:i,scheduledAt:v,safeRate:c,clipDuration:u}))return m.disconnect(),f.disconnect(),null;let E=t.muted;t.muted=!0,xh(t,E);let y={el:t,sourceNode:m,gainNode:f,compositionStart:r,mediaStart:i,scheduledAt:v,priorMuted:E,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(y),this._paused=!1,m.addEventListener("ended",()=>{let w=this._activeSources.indexOf(y);w!==-1&&(this._activeSources.splice(w,1),t.muted=E,this._activeSources.length===0&&(this._paused=!0))}),y}catch(c){return F("webAudioTransport.schedule",c),null}}setRate(t){let n=ec(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.sourceNode.playbackRate.value=n}catch(i){F("webAudioTransport.setRate",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>t.bounded)}stopAll(){for(let t of this._activeSources){try{t.sourceNode.stop(),t.sourceNode.disconnect(),t.gainNode.disconnect()}catch{}t.el.muted=t.priorMuted}this._activeSources=[],this._paused=!0}setVolume(t){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,t)))}setElementVolume(t,n){let r=Math.max(0,Math.min(1,n));for(let i of this._activeSources)if(i.el===t)try{i.gainNode.gain.value=r}catch(o){F("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterGain&&(this._masterGain.gain.value=t?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var tc="data-hf-studio-manual-edit-gesture";function nc(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var yh=/^\\s*spring\\(\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*\\)\\s*$/;function rc(e){return Math.max(0,Math.min(1,e))}function ic(e){let t=yh.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?rc(n):null}function oc(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=rc(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 Sh=/^\\s*wiggle\\(\\s*(\\d+)\\s*,\\s*(easeOut|easeInOut|anticipate|uniform)\\s*(?:,\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)\\s*)?\\)\\s*$/,vh=Math.PI*2;function Eh(e){let t=Sh.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 Ch(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(vh*t*e)}function ac(e,t){let n=Eh(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=>Ch(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var _h=24,sc=e=>e>=1?1:0,Ah=e=>e,Fr=String.raw`([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?)`,wh=new RegExp(String.raw`^\\s*M\\s*0\\s*,\\s*0\\s+C\\s*${Fr}\\s*,\\s*${Fr}\\s+${Fr}\\s*,\\s*${Fr}\\s+1\\s*,\\s*1\\s*$`,"i");function lc(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Th(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<_h;l+=1){let s=(o+a)/2;lc(s,t,r)<e?o=s:a=s}return lc((o+a)/2,n,i)}function Rh(e){let t=wh.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=>Th(a,n,r,i,o)}function Fh(e,t){if(!e.startsWith("spring("))return null;let n=ic(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>oc(o,n);return t.set(n,i),i}function Lh(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=Rh(n);return i&&t.set(n,i),i}function uc(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"?sc:ac(s,i)??Fh(s,r)??Lh(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??Ah)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",sc);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Lo="data-hf-authored-duration",No="data-hf-authored-end",cc=!1;function et(e){if(e){if(typeof e.pause!="function"){cc||(cc=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){F("runtime.timeline.pause",t)}}}function Nh(){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 dc(){let e=ys();aa(xe),xr(document),yo(document);let t=Nh();e.canonicalFps=t.fps??e.canonicalFps,ia(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,h,p)=>{s.has(d)||(s.add(d),Ne(h,p))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){F("runtime.init.site1",d)}let c=new Tr;e.transportClock=c;let m=new Rr,f=!1;m.init().then(d=>{f=d});let x=()=>{let d=window.gsap,h=window;if(!(!d?.registerPlugin||h.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(p){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),F("runtime.autoMarker.install",p)}},v=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{uc(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),F("runtime.customEase.install",h)}};x(),v(),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{da(document)}catch(d){F("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let E=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(p=>!p.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,h=E()?.getAttribute("data-composition-id")??"root",p={};if(d.length===1)p[h]=d[0];else for(let g=0;g<d.length;g++)p[`tl-${g}`]=d[g];window.__timelines=p}let y=E();y&&!y.hasAttribute("data-start")&&y.setAttribute("data-start","0");let w=d=>{o.push(d)},T=(d,h,p)=>{let g=p??`${d}:${JSON.stringify(h)}`;a.has(g)||(a.add(g),xe({source:"hf-preview",type:"diagnostic",code:d,details:h}))},M=d=>{let h={scale:1,focusX:960,focusY:540},p=[],g=[],C={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>p,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>g,getRenderState:()=>({...C,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},D=1/60,P=.75,_=.05,b=100,S=240,A=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},R=d=>{let h=d.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},N=d=>{if(d==null||d.trim()==="")return null;let h=Number.parseFloat(d);return!Number.isFinite(h)||h<=0?null:`${h}px`},G=()=>E(),U=()=>{let d=G();if(!d)return;let h=N(d.getAttribute("data-width")),p=N(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p),h&&d.style.setProperty("--comp-width",h),p&&d.style.setProperty("--comp-height",p)},ne=()=>{let d=G(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(p=>p.hasAttribute("data-duration")||p.hasAttribute("data-end"));for(let p of h){if(d&&p===d)continue;let g=p.getAttribute("data-duration"),C=p.getAttribute("data-end");g!=null&&!p.hasAttribute(Lo)&&p.setAttribute(Lo,g),C!=null&&!p.hasAttribute(No)&&p.setAttribute(No,C),p.removeAttribute("data-duration"),p.removeAttribute("data-end")}},H=()=>{let d=G();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let h=N(d.getAttribute("data-width")),p=N(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p);let g=Array.from(d.children);for(let C of g){let L=C.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta"||!C.hasAttribute("data-start")||C.hasAttribute("data-hf-autostamped"))continue;let O=(C.style.top==="0px"||C.style.top==="0")&&(C.style.left==="0px"||C.style.left==="0")&&C.style.width==="100%"&&C.style.height==="100%",X=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(C.style.transform);if(O&&X&&!C.hasAttribute("data-width")&&!C.hasAttribute("data-height")){let ve=C.style.top,Yt=C.style.left,Ee=C.style.width,Xt=C.style.height;C.style.top="",C.style.left="",C.style.width="",C.style.height="";let re=window.getComputedStyle(C);re.top!=="auto"||re.bottom!=="auto"||re.left!=="auto"||re.right!=="auto"||re.width!=="0px"||re.height!=="0px"||(C.style.top=ve,C.style.left=Yt,C.style.width=Ee,C.style.height=Xt)}let W=window.getComputedStyle(C),se=W.position;if(se!=="absolute"&&se!=="fixed"&&(C.style.position="absolute"),!!C.style.top||!!C.style.bottom||W.top!=="auto"||W.bottom!=="auto"||(C.style.top="0"),!!C.style.left||!!C.style.right||W.left!=="auto"||W.right!=="auto"||(C.style.left="0"),L!=="audio"){let ve=N(C.getAttribute("data-width")),Yt=N(C.getAttribute("data-height")),Ee=W.width!=="0px"&&W.width!=="auto",Xt=W.height!=="0px"&&W.height!=="auto";ve?!C.style.width&&!Ee&&(C.style.width=ve):!C.style.width&&W.width==="0px"&&(C.style.width="100%"),Yt?!C.style.height&&!Xt&&(C.style.height=Yt):!C.style.height&&W.height==="0px"&&(C.style.height="100%")}}},J=(d,h=0,p)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,h),_e=(d,h)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),z=d=>{let h=d.closest("[data-composition-id]"),p=h?J(h,0):null,g=h?_e(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:p,inheritedDuration:g}},Y=d=>{let h=z(d),p=h.inheritedStart??0,g=Me(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||g==null||p<=0)return J(d,p);let C=Me(d.getAttribute("data-duration")),L=h.inheritedDuration,O=L!=null&&L>0?p+L:null,X=C!=null&&C>0?g+C:g;return(O==null?g>=p:g<O&&(X>p||g===p))?g:p+g};window.__hfResolveMediaStartSeconds=Y,o.push(()=>{window.__hfResolveMediaStartSeconds===Y&&delete window.__hfResolveMediaStartSeconds});let V=(d,h)=>{let p=d.tagName.toLowerCase();if(p==="script"||p==="style"||p==="link"||p==="meta")return!1;let C=p==="video"||p==="audio"?Y(d):J(d,0),L=_e(d),O=d.getAttribute("data-composition-id");if(O){let W=(window.__timelines??{})[O],se=null;if(W&&typeof W.duration=="function"){let ie=Number(W.duration());Number.isFinite(ie)&&ie>0&&(se=ie)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(Lo)||d.hasAttribute(No))&&(L==null||L<=0)&&se!=null&&(L=se)}let X=L!=null&&L>0?C+L:Number.POSITIVE_INFINITY;return h>=C&&(Number.isFinite(X)?h<X:!0)},ee=!!document.querySelector("[data-composition-src]"),Ae=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of d){let p=h.getAttribute("data-composition-id");if(p&&h.children.length===0&&document.querySelector(`template#${CSS.escape(p)}-template`)){Ae=!0;break}}}let B=!ee&&!Ae,k=d=>{if(!d||typeof d.duration!="function")return null;try{let h=Number(d.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},I=d=>typeof d=="number"&&Number.isFinite(d)&&d>D,ue=d=>{let h=Number(d.getAttribute("data-duration"));if(Number.isFinite(h)&&h>0)return h;let p=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),g=Number.isFinite(p)?Math.max(0,p):0;return Number.isFinite(d.duration)&&d.duration>g?Math.max(0,d.duration-g):null},ae=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let h=0;for(let p of d){let g=Y(p);if(!Number.isFinite(g))continue;let C=ue(p);C==null||C<=D||(h=Math.max(h,Math.max(0,g)+C))}return h>D?h:null},$=()=>{let d=G();if(!d)return null;let h=window.__timelines??{},p=it({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),g=0,C=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(C)&&C>0&&(g=C);let L=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let O of L){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==d)continue;let W=p.resolveStartForElement(O,0),se=p.resolveDurationForElement(O);!Number.isFinite(W)||se==null||se<=0||(g=Math.max(g,Math.max(0,W)+se))}return g>D?g:null},q=()=>{let d=ae();return typeof d!="number"||!Number.isFinite(d)||d<=D?null:d},j=d=>I(d)?Math.max(D,d*P):D,We=()=>{let d=0;for(let h of e.deterministicAdapters){let p=h.getInferredDurationSeconds;if(typeof p!="function")continue;let g=null;try{g=p()}catch(C){F("runtime.init.adapterDuration",C)}typeof g=="number"&&Number.isFinite(g)&&g>0&&(d=Math.max(d,g))}return d>D?d:null},me=(d,h=0)=>{let p=k(d),g=q(),C=$(),L=We(),O=Math.max(g??0,C??0,L??0),X=Number.isFinite(h)&&h>D?h:0,W=0;return I(p)?W=Math.max(p,O,X):I(O)?W=Math.max(O,X):W=X,W>0?Math.max(0,W):0},Ct=()=>{let d=window.__timelines??{},h=re=>{let Q=Object.entries(d).filter(oe=>!!oe[1]&&typeof oe[1].play=="function"&&typeof oe[1].pause=="function");if(Q.length!==1)return{timeline:null};let fe=Q[0];if(!fe)return{timeline:null};let[pe,ge]=fe;return{timeline:ge,selectedTimelineIds:[pe],selectedDurationSeconds:k(ge),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:re,soleTimelineId:pe}}}},p=it({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),g=q(),C=$(),L=Math.max(g??0,C??0)||null,O=j(L),X=re=>{let Q=document.querySelector(`[data-composition-id="${CSS.escape(re)}"]`);return Q?p.resolveStartForElement(Q,0):0},W=re=>{let Q=window.gsap;if(!Q||typeof Q.timeline!="function")return null;let fe=Q.timeline({paused:!0});for(let pe of re)fe.add(pe.timeline,X(pe.compositionId));return fe},se=(re,Q)=>{if(!I(re))return null;let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let pe=fe.timeline({paused:!0});if(Q)try{pe.add(Q,0)}catch(oe){F("runtime.init.site2",oe)}let ge=pe;if(typeof ge.to=="function")try{ge.to({},{duration:re})}catch(oe){F("runtime.init.site3",oe)}return pe},Le=(re,Q)=>{let fe=re;if(typeof fe.getChildren!="function")return[];try{let pe=fe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let ge=[];for(let oe of Q)if(!pe.some(Ge=>Ge===oe.timeline))try{let Ge=X(oe.compositionId);re.add(oe.timeline,Ge),ge.push(oe.compositionId)}catch(Ge){F("runtime.init.site4",Ge)}return ge}catch{return[]}},ie=G(),te=ie?.getAttribute("data-composition-id")??null;if(!te)return h("root_missing_composition_id");let ve=d[te]??null,Ee=(()=>{if(!ie)return[];let re=new Set,Q=Array.from(ie.querySelectorAll("[data-composition-id]")),fe=[];for(let pe of Q){let ge=pe.getAttribute("data-composition-id");if(!ge||ge===te||re.has(ge))continue;re.add(ge);let oe=d[ge]??null;if(!oe||typeof oe.play!="function"||typeof oe.pause!="function")continue;let Re=k(oe);fe.push({compositionId:ge,timeline:oe,durationSeconds:Re??0})}return fe})(),Xt=re=>{for(let Q of re){let fe=Q.timeline;if(typeof fe.paused=="function")try{fe.paused(!1)}catch(pe){F("runtime.init.site5",pe)}}};if(Ee.length>0&&Xt(Ee),ve){let re=Ee.length>0?Le(ve,Ee):[];if((Ee.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+te+"\'])"))&&(Ie=!0),re.length>0)try{let oe=ve.time();ve.seek(oe,!1)}catch{}let Q=k(ve);if(!I(Q)&&Ee.length>0){let oe=Ee.map(id=>id.compositionId),Re=W(Ee),Ge=k(Re);if(Re&&I(Ge))return{timeline:Re,selectedTimelineIds:oe,selectedDurationSeconds:Ge,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:Ge,mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:C,selectedTimelineIds:oe,autoNestedChildren:re}}};let $r=se(L??0,ve),qr=k($r);if($r&&I(qr))return{timeline:$r,selectedTimelineIds:[te],selectedDurationSeconds:qr,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:C,selectedDurationSeconds:qr,selectedTimelineIds:[te],autoNestedChildren:re}}}}if(!I(Q)&&Ee.length===0){let oe=se(L??0,ve),Re=k(oe);if(oe&&I(Re))return{timeline:oe,selectedTimelineIds:[te],selectedDurationSeconds:Re,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:C,selectedDurationSeconds:Re,selectedTimelineIds:[te]}}}}let fe=ie?.getAttribute("data-duration"),pe=fe?parseFloat(fe):null,ge=Math.max(I(pe)?pe:0,C??0);if(ge>0&&I(ge)&&I(Q)&&ge>=Q+.5){let oe=ve;if(typeof oe.to=="function")try{oe.to({},{duration:0},ge)}catch(Ge){F("runtime.init.site6",Ge)}let Re=k(ve);if(I(Re))return{timeline:ve,selectedTimelineIds:[te],selectedDurationSeconds:Re,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:te,rootDurationSeconds:Q,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:C,newDur:Re}}}}return{timeline:ve,selectedTimelineIds:[te],selectedDurationSeconds:Q,mediaDurationFloorSeconds:g,diagnostics:re.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:te,selectedDurationSeconds:Q,autoNestedChildren:re}}:void 0}}if(Ee.length>0){let re=Ee.map(pe=>pe.compositionId),Q=W(Ee),fe=k(Q);if(Q)return{timeline:Q,selectedTimelineIds:re,selectedDurationSeconds:fe,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:te,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:fe,mediaDurationFloorSeconds:g,selectedTimelineIds:re}}}}return h("root_composition_id_unmatched_in_registry")},Ie=!1,Gc=d=>{let h=window.gsap,p=d;if(!(!p||typeof p.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let g of p.getChildren(!0,!0,!0)){let C=g,L=C.timeline;if(!L||!("_ease"in L)||typeof L._ease=="function")continue;let O=C.vars?.keyframes,W=(O&&!Array.isArray(O)?O.ease:void 0)??C.vars?.ease??"none";try{let se=h.parseEase(W);typeof se=="function"&&(L._ease=se)}catch(se){Ne("keyframe_ease_repair_failed",{ease:typeof W=="string"?W:String(W)}),F("runtime.keyframeEase.repair",se)}}},zt=()=>{if(v(),!B)return!1;let d=e.capturedTimeline,h=k(d),p=I(h);if(d&&p&&Ie)return!1;let g=Ct();if(!g.timeline)return!1;if(d&&d===g.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=g.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Gc(e.capturedTimeline);let C=me(e.capturedTimeline,0);if(C<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),et(e.capturedTimeline)),C>0){try{c.setDuration(C)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let O=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(O,!1),et(e.capturedTimeline)}let L=window.__hfStudioManualEditsApply;typeof L=="function"&&L(),xr(document)}if(g.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:g.diagnostics.code,details:g.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:g.selectedTimelineIds??[],selectedDurationSeconds:g.selectedDurationSeconds??null,mediaDurationFloorSeconds:g.mediaDurationFloorSeconds??null}}),window.parent!==window){let L=G(),O=C>0?C:0,X=String(O>0?O:1),W=new Set,se=new Set(document.querySelectorAll("[data-start]")),Le=ie=>{let te=ie.parentElement;for(;te&&te!==L;){if(se.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ie of e.capturedTimeline.getChildren(!0))if(typeof ie.targets=="function")for(let te of ie.targets())te instanceof HTMLElement&&te!==L&&(te.hasAttribute("data-start")||Le(te)||W.has(te)||(W.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",X),te.setAttribute("data-hf-autostamped","1")))}catch{}if(L instanceof HTMLElement)for(let ie of L.querySelectorAll("[id]"))ie instanceof HTMLElement&&ie!==L&&(ie.hasAttribute("data-start")||Le(ie)||W.has(ie)||ie.tagName==="SCRIPT"||ie.tagName==="STYLE"||ie.tagName==="LINK"||(W.add(ie),ie.setAttribute("data-start","0"),ie.setAttribute("data-duration",X),ie.setAttribute("data-hf-autostamped","1")))}for(let L of $t)Pn.delete(L),zo(L);return!0};window.__hfForceTimelineRebind=()=>{Ie=!1,zt(),Hr(e.currentTime)};let Hc=()=>{let d=G();if(!(d instanceof HTMLElement))return;let h=d.getBoundingClientRect(),p=Number(d.getAttribute("data-width")),g=Number(d.getAttribute("data-height")),C=window.getComputedStyle(d),L=Number.isFinite(p)&&p>0&&Number.isFinite(g)&&g>0,O=h.width<=0||h.height<=0||d.clientWidth<=0||d.clientHeight<=0;!L||!O||T("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:p,declaredHeight:g,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:C.display,visibility:C.visibility,overflow:C.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},Bc=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,Hc()}))},Uc=()=>{r=d=>{let h=A(d.error??d.message).slice(0,S);if(!h)return;let p=R(h);xe({source:"hf-preview",type:"diagnostic",code:p.code,details:{category:p.category,message:h,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let h=A(d.reason).slice(0,S);if(!h)return;let p=R(h);xe({source:"hf-preview",type:"diagnostic",code:`${p.code}_unhandled_rejection`,details:{category:`${p.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},Wc=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let p of d){let g=()=>{if(!(p instanceof Element))return;let C=p.tagName.toLowerCase(),L=p.getAttribute("src")??p.getAttribute("href")??p.getAttribute("poster")??null,O=C==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";T(O,{tagName:C,assetUrl:L,currentSrc:(p instanceof HTMLImageElement||p instanceof HTMLMediaElement)&&p.currentSrc||null,readyState:p instanceof HTMLMediaElement?p.readyState:null,networkState:p instanceof HTMLMediaElement?p.networkState:null},`${O}:${C}:${L??"unknown"}`)};p.addEventListener("error",g),w(()=>{p.removeEventListener("error",g)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let p=Array.from(h).filter(g=>g.status==="error").map(g=>g.family).filter(g=>!!g).slice(0,10);p.length!==0&&T("runtime_font_load_issue",{failedFamilies:p,totalFaces:Array.from(h).length},`runtime-font-load-issue:${p.join("|")}`)}).catch(()=>{})},Vc=(d,h)=>{if(!d.timeline)return!1;let p=e.capturedTimeline;if(p&&p===d.timeline)return!1;let g=Math.max(0,e.currentTime||0),C=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{et(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(g,!1),C&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(L){F("runtime.init.site7",L)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:g,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ft=null,Bo=!1,Uo=!1,$t=new Set,Pn=new WeakMap,On=()=>{e.tornDown||(ft!=null&&window.clearTimeout(ft),ft=window.setTimeout(()=>{if(e.tornDown||(ft=null,Uo&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Ct();if(!d.timeline||!I(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){zt()&&(mt(),Fe(!0));return}if(Bo)return;let p=k(e.capturedTimeline),g=d.selectedDurationSeconds??k(d.timeline);I(g)&&(!I(p)||g>=p+_)&&Vc(d,"manual")&&(Bo=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:p??null,selectedDurationSeconds:g??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),mt(),Fe(!0))},b))},Wo=d=>{d.currentTarget instanceof HTMLMediaElement&&Ba(d.currentTarget)},Vo=d=>{d.currentTarget instanceof HTMLMediaElement&&Ua(d.currentTarget)},zc=()=>{for(let d of $t)d.removeEventListener("loadedmetadata",On),d.removeEventListener("durationchange",On),d.removeEventListener("loadedmetadata",Wo),d.removeEventListener("error",Vo);$t.clear()},Ir=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let h of d){if($t.has(h))continue;$t.add(h);let p=Number.parseFloat(h.dataset.volume??"");Number.isFinite(p)&&(h.volume=Math.max(0,Math.min(1,p))),h.addEventListener("loadedmetadata",On),h.addEventListener("durationchange",On),h.addEventListener("loadedmetadata",Wo),h.addEventListener("error",Vo),Ha(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),zo(h)}},zo=d=>{Pn.has(d)||Na(d,e.capturedTimeline,me(e.capturedTimeline,0),Pn,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Pr=new WeakMap,$o=d=>{let h=Pr.get(d);if(h!==void 0)return h;let p=window.getComputedStyle(d).position,g=p==="static"||p==="relative"||p==="sticky";return Pr.set(d,g),g},Or=new WeakMap,$c=d=>{let h=Or.get(d);if(h!==void 0)return h;let p=d.querySelector("[data-start]")===null;return Or.set(d,p),p},qc=()=>{Pr=new WeakMap,Or=new WeakMap},Gr=new WeakMap,Gn=new WeakSet,Hr=(d,h=Array.from(document.querySelectorAll("[data-start]")))=>{let p=G();for(let g of h){if(!(g instanceof HTMLElement))continue;if(g.hasAttribute("data-hidden")){Gn.has(g)||(Gr.set(g,g.style.getPropertyValue("display")),Gn.add(g)),g.style.display="none",(g instanceof HTMLVideoElement||g instanceof HTMLImageElement)&&n?.setSourceVisibility(g,!1);continue}if(Gn.has(g)){let L=Gr.get(g);L?g.style.display=L:g.style.removeProperty("display"),Gr.delete(g),Gn.delete(g)}let C=V(g,d);if(C){let L=g.parentElement;for(;L&&L!==p;){if(L instanceof HTMLElement&&L.hasAttribute("data-start")&&!V(L,d)){C=!1;break}L=L.parentElement}}g.style.visibility=C?"visible":"hidden",(g instanceof HTMLVideoElement||g instanceof HTMLImageElement)&&n?.setSourceVisibility(g,C),C?$o(g)&&g.style.removeProperty("display"):$o(g)&&$c(g)&&(g.style.display="none")}},Pe=()=>{let d=Da({shouldIncludeElement:p=>p.hasAttribute("data-start")||!!z(p).compositionRoot,resolveStartSeconds:p=>Y(p),resolveDurationSeconds:p=>{let g=z(p),C=Y(p),L=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,O=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-C):null,X=Number.isFinite(p.duration)&&p.duration>L?Math.max(0,p.duration-L):null,W=Number.parseFloat(p.dataset.duration??""),se=Number.isFinite(W)&&W>0?W:null;return ka({isVideo:p.tagName==="VIDEO",sourceDuration:X,hostRemaining:O,explicitDuration:se})}});for(let p of d.mediaClips){let g=Pn.get(p.el);g&&(p.volumeKeyframes=g)}let h=e.mediaForceSyncNextTick;h&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Ia({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted||!e.webAudioMediaDisabled&&!e.nativeMediaSyncDisabled&&m.isActive(),userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:h,onElementVolume:(p,g)=>m.setElementVolume(p,g),isWebAudioOwned:p=>m.ownsElement(p),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Hr(e.currentTime)},Fe=d=>{let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),p=Date.now();(d||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||p-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=p,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Br="",qo=0,jc=()=>{let d="";for(let h of document.querySelectorAll("[data-start]"))d+=`${h.id}:${h.tagName}|`;return d},mt=()=>{ne(),U(),H();let d=G();if(d){let g=N(d.getAttribute("data-width")),C=N(d.getAttribute("data-height")),L=g?parseInt(g,10):0,O=C?parseInt(C,10):0;L>0&&O>0&&xe({source:"hf-preview",type:"stage-size",width:L,height:O})}zt();let h=Ts({canonicalFps:e.canonicalFps});window.__clipManifest=h;let p=jc();if(Br!==p&&qc(),!window.__clipTree||Br!==p){let g=window;window.__clipTree=Ss({startResolver:it({timelineRegistry:g.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:g.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Br=p}xe(h),Bc()},Ur=d=>Number.isFinite(d)&&d>0?d:0,Kc=d=>{let h=Ur(Number(d));if(h<=0)return;let p=G(),g=Ur(Number.parseFloat(p?.getAttribute("data-duration")??"")),C=Math.max(qo,Ur(c.getDuration()),g);h<=C||(qo=h,p?.setAttribute("data-duration",String(h)),c.setDuration(h),mt(),Fe(!0))},Ve=(d,h=0)=>{for(let p of e.deterministicAdapters){try{d==="discover"&&p.discover(),d==="pause"&&p.pause(),d==="play"&&p.play&&p.play()}catch(g){F("runtime.init.site8",g)}if(d==="discover")try{p.seek({time:h,suppressEvents:!0})}catch(g){F("runtime.init.site9",g)}}},pt=()=>{window.__renderReady=!1},qt=null,jt=!0,Yc=()=>{let d=[];for(let h of e.deterministicAdapters){let p=h.getReadyPromise;if(typeof p=="function")try{let g=p();g&&d.push(g)}catch(g){F("runtime.init.adapterReady",g)}}return d},Xc=()=>{let d=Yc();if(d.length===0)return qt=null,jt=!0,!0;let h=d[0];if(!h)return!0;let p=d.length===1?h:Promise.all(d);return p!==qt&&(qt=p,jt=!1,Promise.resolve(p).then(()=>{qt===p&&(jt=!0,pt())},g=>{qt===p&&(jt=!0,F("runtime.init.adapterReady",g),pt())})),jt};if(B)mo();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:N,onDiagnostic:({code:h,details:p})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:p})}};pu(d).then(()=>mu(d)).finally(()=>{B=!0,Ir(),Wc(),mo(),yo(document),pt()})}let Hn=hs({postMessage:d=>xe(d)});Hn.installPickerApi(),Hr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let ze=Zu();n=ze,w(()=>{ze.destroy(),n=null});let Wr=d=>{let h=Number(d);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let p=document.querySelectorAll("video, audio");for(let g of p)if(g instanceof HTMLMediaElement)try{g.playbackRate=e.playbackRate}catch(C){F("runtime.init.site10",C)}},jo={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let h=me(d,0);if(h>0)c.setDuration(h),c.reachedEnd()&&(c.seek(0),e.currentTime=0,ht(0));else{let p=G(),g=Number(p?.getAttribute("data-duration")??0);g>0&&c.setDuration(g)}et(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Zo(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ea(),Ve("play"),Pe(),ze.redraw(),Fe(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,Zo(e.currentTime);let d=e.capturedTimeline;et(d),Ve("pause"),Pe(),ze.redraw(),Fe(!0)},seek:(d,h)=>{let p=Nt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let g=c.isPlaying();g&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let C=e.capturedTimeline;if(et(C),ht(e.currentTime),Ve("pause"),h?.keepPlaying&&g){jo.play();return}Pe(),ze.redraw(),Fe(!0)},renderSeek:(d,h)=>{Uo=!0;let p=Nt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,ht(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),Pe(),ze.redraw(),Fe(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{Wr(d),c.setRate(e.playbackRate),ta()},getPlaybackRate:()=>e.playbackRate},Ko=me(e.capturedTimeline,0);Ko>0&&c.setDuration(Ko);let Oe=bs({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:Wr,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,h)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Pe()},onStatePost:Fe,onDeterministicSeek:(d,h)=>{for(let p of e.deterministicAdapters)if(!(p.name==="gsap"&&e.capturedTimeline))try{p.seek({time:Number(d)||0,suppressEvents:h?.suppressEvents})}catch(g){F("runtime.init.site11",g)}},onDeterministicPause:()=>Ve("pause"),onDeterministicPlay:()=>Ve("play"),onRenderFrameSeek:()=>{ze.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>me(e.capturedTimeline,0),transport:jo});window.__player=M(Oe),window.__playerReady=!0,Ne("composition_loaded",{duration:Oe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Fa(),ma({resolveStartSeconds:d=>J(d,0)}),ha(),xa(),ya(),Sa(),va(),Ea(),Ca(),_a(),Aa(),pa({getTimeline:()=>e.capturedTimeline})],Ta(),Ra(),window.__hfReseekGpu=d=>{let h=Math.max(0,Number(d)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,ba(h)},Uc(),Ir(),Ve("discover");let Jc=()=>{let d=e.capturedTimeline,h=zt();e.capturedTimeline&&(h||e.capturedTimeline!==d||!Oe._timeline)&&(Oe._timeline=e.capturedTimeline);let p=me(e.capturedTimeline,0);if(p>0&&c.setDuration(p),Ve("discover",e.currentTime),!e.capturedTimeline){let g=window.__timelines??{},C=Object.keys(g).filter(L=>g[L]);if(C.length>0){let O=G()?.getAttribute("data-composition-id")??null;T("root_timeline_unbound_registry_present",{reason:O?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:O,registeredTimelineKeys:C},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \\u2014 render will freeze at t=0. "+(O?`Root data-composition-id is "${O}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${C.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${O??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,mt(),Fe(!0)},_t=null,Qc=()=>{if(_t)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),_t=null,pt()};_t=d,window.addEventListener("hf-timelines-built",d)};w(()=>{_t&&(window.removeEventListener("hf-timelines-built",_t),_t=null)}),pt=()=>{if(!B){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Qc();return}if(Ve("discover",e.currentTime),!Xc()){window.__renderReady=!1;return}Jc()},pt(),B&&setTimeout(()=>{pt()},0);let Bn=0,Vr=!1,Zc=(d,h,p,g)=>{try{let C=g?.suppressEvents===!0;et(d),typeof d.totalTime=="function"?d.totalTime(h,C):d.seek(h,C)}catch(C){F(p,C)}},ed=(d,h)=>{let p=window.__timelines??{},g=G()?.getAttribute("data-composition-id")??null;for(let[C,L]of Object.entries(p)){if(!L||C===g)continue;let O=document.querySelector(`[data-composition-id="${CSS.escape(C)}"]`);if(!O)continue;let X=J(O,0);if(!Number.isFinite(X))continue;let W=k(L),se=Tt(O)+Math.max(0,d-X)*qe(O),Le=Math.max(0,W!=null&&W>0?Math.min(W,se):se);Zc(L,Le,"runtime.init.transport.childTimeline",h)}},Yo=d=>{let h=window.__timelines??{};for(let p of Object.values(h))if(!(!p||p===d))try{p.play()}catch(g){F("runtime.init.activateSiblings",g)}},Xo=d=>typeof d=="object"&&d!==null,Kt=new WeakMap,td=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Jo=(d,h)=>{let p=d[h];if(typeof p!="function")return null;try{let g=Number(p.call(d));return Number.isFinite(g)?g:null}catch(g){return F("runtime.init.gsapCallbackDuration",g),null}},nd=d=>{let h=Kt.get(d);if(h!=null)return h;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let p;try{p=d.getChildren(!0,!0,!0)}catch(g){return F("runtime.init.gsapCallbackChildren",g),Kt.set(d,!1),!1}if(!Array.isArray(p))return Kt.set(d,!1),!1;for(let g of p){if(!Xo(g))continue;let C=g.vars;if(!Xo(C)||!td.some(W=>typeof C[W]=="function"))continue;let X=Jo(g,"totalDuration")??Jo(g,"duration");if(X!=null&&X<=1e-6)return Kt.set(d,!0),!0}return Kt.set(d,!1),!1};function ht(d,h){let p=e.capturedTimeline,g=h?.suppressEvents===!0;if(p){h?.activateChildren&&Yo(p);let C=p,L=d;if(typeof C.totalDuration=="function")try{let O=Number(C.totalDuration());Number.isFinite(O)&&O>0&&d>O&&(L=O)}catch(O){F("runtime.init.transport.clampDuration",O)}try{typeof p.totalTime=="function"?(p.totalTime(L,g),!g&&!nd(p)&&(p.totalTime(L+.001,!0),p.totalTime(L,!0))):p.seek(L,g)}catch(O){F("runtime.init.transport.seek",O)}}ed(d,h),p&&h?.activateChildren&&Yo(p);for(let C of e.deterministicAdapters)if(!(C.name==="gsap"&&p))try{C.seek({time:d,suppressEvents:g})}catch(L){F("runtime.init.transport.adapter",L)}}let rd=()=>{try{return document.querySelector(`[${tc}]`)!=null}catch{return!1}},Qo=()=>{if(!(e.tornDown||Vr)){Vr=!0;try{if(e.transportRafId=window.requestAnimationFrame(Qo),Bn+=1,nc({tick:Bn,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let h=e.capturedTimeline;if(zt()){e.capturedTimeline&&!Oe._timeline&&(Oe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==h&&et(e.capturedTimeline);let p=me(e.capturedTimeline,0);p>0&&c.setDuration(p),mt()}}if(Bn%20===0&&mt(),Bn%30===0&&Ir(),e.capturedTimeline){let h=me(e.capturedTimeline,0);h>0&&(!c.isPlaying()||h>=c.getDuration())&&c.setDuration(h)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let h=m.getTime();h>=0&&c.attachAudioSource({currentTimeSeconds:h})}else{let h=document.querySelectorAll("audio[data-start]"),p=!1;for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let C=Number.parseFloat(g.dataset.start??""),L=Number.parseFloat(g.dataset.duration??""),O=Number.isFinite(L)&&L>0?C+L:1/0,X=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0;if(Number.isFinite(C)&&e.currentTime>=C&&e.currentTime<O){g.paused?!g.error&&g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),p=!0):(c.attachAudioSource({el:g,compositionStart:C,mediaStart:X}),p=!0);break}}!p&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!rd())&&ht(d),c.isPlaying()&&ze.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,ht(h)),Ve("pause"),Pe(),Fe(!0);return}c.isPlaying()&&Pe(),Fe(!1)}finally{Vr=!1}}},Zo=d=>{let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let g=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(g))continue;let C=Number.parseFloat(p.dataset.duration??""),L=Number.isFinite(C)&&C>0?g+C:1/0;if(d<g||d>=L)continue;let O=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,X=d-g+O;if(X>=0)try{p.currentTime=X}catch{}}},ea=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let g=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(g))continue;let C=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,L=Number.parseFloat(p.dataset.volume??""),O=Number.isFinite(L)?L:1,X=Number.parseFloat(p.dataset.duration??""),W=Number.isFinite(X)&&X>0?X:Number.POSITIVE_INFINITY,se=p.closest("[data-composition-id]");if(se){let Le=J(se,0),ie=_e(se,{includeAuthoredTimingAttrs:!0});ie!=null&&ie>0&&(W=Math.min(W,Math.max(0,Le+ie-g)))}m.decodeAudioElement(p).then(Le=>{!Le||!c.isPlaying()||m.schedulePlayback(p,Le,g,C,c.now(),O*e.bridgeVolume,d,e.playbackRate,W)})}};function ta(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),ea())}if(e.capturedTimeline){let d=me(e.capturedTimeline,0);d>0&&c.setDuration(d),et(e.capturedTimeline)}Su(window),e.transportRafId=window.requestAnimationFrame(Qo),mt(),Fe(!0),e.controlBridgeHandler=oa({onPlay:()=>{Oe.play(),Ne("composition_played",{time:Oe.getTime()})},onPause:()=>{Oe.pause(),Ne("composition_paused",{time:Oe.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let h of d)h instanceof HTMLMediaElement&&!h.paused&&h.pause()},onSeek:(d,h)=>{Oe.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let h=d||e.mediaOutputMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let g of p)g instanceof HTMLMediaElement&&(g.muted=h||g.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement))continue;let g=parseFloat(p.dataset.volume??""),C=Number.isFinite(g)?g:1;p.volume=C*d}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let h=d||e.bridgeMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let g of p)g instanceof HTMLMediaElement&&(g.muted=h||g.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Pe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Pe())},onSetPlaybackRate:d=>{Wr(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),ta()},onSetRootDuration:Kc,onSetColorGrading:(d,h)=>{ze.setGrading(d,h)},onSetColorGradingCompare:(d,h)=>{ze.setCompare(d,h)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,ht(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,ht(h)),Ve("pause"),Pe(),Fe(!0)}},onEnablePickMode:()=>Hn.enablePickMode(),onDisablePickMode:()=>Hn.disablePickMode(),getCanonicalFps:()=>e.canonicalFps});let zr=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),ft!=null&&(window.clearTimeout(ft),ft=null),l!=null&&(window.cancelAnimationFrame(l),l=null),zc(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Hn.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(h){F("runtime.init.site12",h)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(h){F("runtime.init.site13",h)}for(let d of e.injectedCompStyles)try{d.remove()}catch(h){F("runtime.init.site14",h)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(h){F("runtime.init.site15",h)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(h){F("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===zr&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=zr,e.beforeUnloadHandler=zr,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var fc=["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"],Mo=[[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 Mh(e){if(e<=255)return fc[e];let t=0,n=Mo.length-1;for(;t<=n;){let r=t+n>>1,i=Mo[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function kh(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let v=e.charCodeAt(u+1);v>=56320&&v<=57343&&(m=(c-55296<<10)+(v-56320)+65536,f=2)}let x=Mh(m);(x==="R"||x==="AL"||x==="AN")&&(r=!0);for(let v=0;v<f;v++)n[u+v]=x;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="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 c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}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 c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let E=u;E<c;E++)n[E]=x;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function mc(e,t){let n=kh(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 Dh=/[ \\t\\n\\r\\f]+/g,Ih=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Ph(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Oh(e){if(!Ih.test(e))return e;let t=e.replace(Dh," ");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 Gh(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var ko=null,Hh;function Bh(){return ko===null&&(ko=new Intl.Segmenter(Hh,{granularity:"word"})),ko}var Uh=/\\p{Script=Arabic}/u,Lr=/\\p{M}/u,vc=/\\p{Nd}/u;function pc(e){return Uh.test(e)}function hc(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 Ue(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(hc(i))return!0;t++;continue}}if(hc(n))return!0}}return!1}function Wh(e){let t=kr(e);return t!==null&&(Mr.has(t)||ct.has(t))}var Vh=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function zh(e){return Ue(e)}function $h(e){let t=kr(e);return t!==null&&Vh.has(t)}function Nr(e){return!Wh(e)&&!$h(e)}var Mr=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"]),In=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Io=new Set(["\'","\\u2019"]),ct=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),qh=new Set([":",".","\\u060C","\\u061B"]),jh=new Set(["\\u104F"]),Kh=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Yh(e){if(Po(e))return!0;let t=!1;for(let n of e){if(ct.has(n)){t=!0;continue}if(!(t&&Lr.test(n)))return!1}return t}function Xh(e){for(let t of e)if(!Mr.has(t)&&!ct.has(t))return!1;return e.length>0}function Jh(e){if(Po(e))return!0;for(let t of e)if(!In.has(t)&&!Io.has(t)&&!Lr.test(t))return!1;return e.length>0}function Po(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Lr.test(n))){if(In.has(n)||ct.has(n)||Io.has(n)){t=!0;continue}return!1}return t}function Ec(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 kr(e){if(e.length===0)return null;let t=Ec(e,e.length);return e.slice(t)}function Qh(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Lr.test(r)){n--;continue}if(In.has(r)||Io.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Zh(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function gc(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 xc(e,t){return e&&t!==null&&qh.has(t)}function eg(e){let t=kr(e);return t!==null&&jh.has(t)}function tg(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 Dr(e){let t=e.length;for(;t>0;){let n=Ec(e,t),r=e.slice(n,t);if(Kh.has(r))return!0;if(!ct.has(r))return!1;t=n}return!1}function ng(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var rg=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function De(e){return e.length===1?e[0]:e.join("")}function ig(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),De(n)}function og(e,t,n,r){if(!rg.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=ng(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),i}function Do(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var ag=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function sg(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:ag.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function lg(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function ug(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!sg(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Do(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=De(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function cg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!lg(a))continue;let l=o+1;if(l>=e.len||Do(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!Do(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(De(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var dg=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),bc=/^[A-Za-z0-9_]+[,:;]*$/,yc=/[,:;]+$/;function Cc(e){for(let t of e)if(vc.test(t))return!0;return!1}function Dn(e){if(e.length===0)return!1;for(let t of e)if(!(vc.test(t)||dg.has(t)))return!1;return!0}function fg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&Dn(a)&&Cc(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Dn(e.texts[u]);)s.push(e.texts[u]),u++;t.push(De(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function mg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&bc.test(a)){let u=[a],c=yc.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&bc.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=yc.test(f),m++}t.push(De(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function pg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!Cc(c)||!Dn(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function hg(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=De(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=De(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(De(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function gg(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Ue(t[o])||!Ue(t[o+1]))continue;let a=Qh(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Sc(e,t,n){let r=Bh(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],x=[],v=[],E=[],y=[];for(let _ of r.segment(e))for(let b of og(_.segment,_.isWordLike??!1,_.index,n)){let J=function(){c[H]!==null&&(a[H]=[gc(o,c,m,H)],c[H]=null),a[H].push(b.text),l[H]=l[H]||b.isWordLike,f[H]=f[H]||R,x[H]=x[H]||N,v[H]=U,E[H]=ne,y[H]=xc(x[H],G)},S=b.kind==="text",A=Zh(b.text,b.isWordLike,b.kind),R=Ue(b.text),N=pc(b.text),G=kr(b.text),U=Dr(b.text),ne=eg(b.text),H=i-1;t.carryCJKAfterClosingQuote&&S&&i>0&&s[H]==="text"&&R&&f[H]&&v[H]||S&&i>0&&s[H]==="text"&&Xh(b.text)&&f[H]||S&&i>0&&s[H]==="text"&&E[H]?J():S&&i>0&&s[H]==="text"&&b.isWordLike&&N&&y[H]?(J(),l[H]=!0):A!==null&&i>0&&s[H]==="text"&&c[H]===A?m[H]=(m[H]??1)+1:S&&!b.isWordLike&&i>0&&s[H]==="text"&&(Yh(b.text)||b.text==="-"&&l[H])?J():(o[i]=b.text,a[i]=[b.text],l[i]=b.isWordLike,s[i]=b.kind,u[i]=b.start,c[i]=A,m[i]=A===null?0:1,f[i]=R,x[i]=N,v[i]=U,E[i]=ne,y[i]=xc(N,G),i++)}for(let _=0;_<i;_++){if(c[_]!==null){o[_]=gc(o,c,m,_);continue}o[_]=De(a[_])}for(let _=1;_<i;_++)s[_]==="text"&&!l[_]&&Po(o[_])&&s[_-1]==="text"&&(o[_-1]+=o[_],l[_-1]=l[_-1]||l[_],o[_]="");let w=Array.from({length:i},()=>null),T=-1;for(let _=i-1;_>=0;_--){let b=o[_];if(b.length!==0){if(s[_]==="text"&&!l[_]&&Jh(b)&&T>=0&&s[T]==="text"){let S=w[T]??[];S.push(b),w[T]=S,u[T]=u[_],o[_]="";continue}T=_}}for(let _=0;_<i;_++){let b=w[_];b!=null&&(o[_]=ig(b,o[_]))}let M=0;for(let _=0;_<i;_++){let b=o[_];b.length!==0&&(M!==_&&(o[M]=b,l[M]=l[_],s[M]=s[_],u[M]=u[_]),M++)}o.length=M,l.length=M,s.length=M,u.length=M;let D=hg({len:M,texts:o,isWordLike:l,kinds:s,starts:u}),P=gg(mg(pg(fg(cg(ug(D))))));for(let _=0;_<P.len-1;_++){let b=tg(P.texts[_]);b!==null&&(P.kinds[_]!=="space"&&P.kinds[_]!=="preserved-space"||P.kinds[_+1]!=="text"||!pc(P.texts[_+1])||(P.texts[_]=b.space,P.isWordLike[_]=!1,P.kinds[_]=P.kinds[_]==="preserved-space"?"preserved-space":"space",P.texts[_+1]=b.marks+P.texts[_+1],P.starts[_+1]=P.starts[_]+b.space.length))}return P}function xg(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function bg(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(De(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],x=e.kinds[m],v=e.isWordLike[m],E=e.starts[m];if(x==="text"){let y=zh(f),w=Nr(f);if(o!==null&&s&&u){o.push(f),a=a||v,s=s||y,u=w;continue}c(),o=[f],a=v,l=E,s=y,u=w;continue}c(),t.push(f),n.push(v),r.push(x),i.push(E)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function _c(e,t,n="normal",r="normal"){let i=Ph(n),o=i.mode==="pre-wrap"?Gh(e):Oh(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?bg(Sc(o,t,i)):Sc(o,t,i);return{normalized:o,chunks:xg(a,i),...a}}var Ut=null,Ac=new Map,Wt=null,yg=96,Sg=/\\p{Emoji_Presentation}/u,vg=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Oo=null,wc=new Map;function Go(){if(Ut!==null)return Ut;if(typeof OffscreenCanvas<"u")return Ut=new OffscreenCanvas(1,1).getContext("2d"),Ut;if(typeof document<"u")return Ut=document.createElement("canvas").getContext("2d"),Ut;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Eg(e){let t=Ac.get(e);return t||(t=new Map,Ac.set(e,t)),t}function tt(e,t){let n=t.get(e);return n===void 0&&(n={width:Go().measureText(e).width,containsCJK:Ue(e)},t.set(e,n)),n}function Vt(){if(Wt!==null)return Wt;if(typeof navigator>"u")return Wt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wt;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Wt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Wt}function Cg(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function Tc(){return Oo===null&&(Oo=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Oo}function _g(e){return Sg.test(e)||e.includes("\\uFE0F")}function Rc(e){return vg.test(e)}function Ag(e,t){let n=wc.get(e);if(n!==void 0)return n;let r=Go();r.font=e;let i=r.measureText("\\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return wc.set(e,n),n}function wg(e){let t=0,n=Tc();for(let r of n.segment(e))_g(r.segment)&&t++;return t}function Tg(e,t){return t.emojiCount===void 0&&(t.emojiCount=wg(e)),t.emojiCount}function dt(e,t,n){return n===0?t.width:t.width-Tg(e,t)*n}function Fc(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Tc(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=tt(m,n);c.push(dt(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>yg){let c=[],m=null,f=0;for(let x of a){let v=tt(x,n),E=dt(x,v,r);if(m===null)c.push(E);else{let y=m+x,w=tt(y,n);c.push(dt(y,w,r)-f)}m=x,f=E}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=tt(s,n),f=dt(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Lc(e,t){let n=Go();n.font=e;let r=Eg(e),i=Cg(e),o=t?Ag(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function Rg(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function Fg(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Lg(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function Nc(e,t){return e.simpleLineWalkFastPath?Mc(e,t):kc(e,t)}function Mc(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=Vt().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,x=0,v=0,E=0,y=-1,w=0;function T(){y=-1,w=0}function M(A=v,R=E,N=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:A,endGraphemeIndex:R,width:N}),c=0,m=!1,T()}function D(A,R){m=!0,f=A,x=0,v=A+1,E=0,c=R}function P(A,R,N){m=!0,f=A,x=R,v=A,E=R+1,c=N}function _(A,R){if(!m){D(A,R);return}c+=R,v=A+1,E=0}function b(A,R){let N=o[A];for(let G=R;G<N.length;G++){let U=N[G];m?c+U>s?(M(),P(A,G,U)):(c+=U,v=A,E=G+1):P(A,G,U)}m&&v===A&&E===N.length&&(v=A+1,E=0)}let S=0;for(;S<r.length&&!(!m&&(S=Rg(e,S),S>=r.length));){let A=r[S],R=i[S],N=R==="space"||R==="preserved-space"||R==="tab"||R==="zero-width-break"||R==="soft-hyphen";if(!m){A>t&&o[S]!==null?b(S,0):D(S,A),N&&(y=S+1,w=c-A),S++;continue}if(c+A>s){if(N){_(S,A),M(S+1,0,c-A),S++;continue}if(y>=0){if(v>y||v===y&&E>0){M();continue}M(y,0,w);continue}if(A>t&&o[S]!==null){M(),b(S,0),S++;continue}M();continue}_(S,A),N&&(y=S+1,w=c-A),S++}return m&&M(),u}function kc(e,t,n){if(e.simpleLineWalkFastPath)return Mc(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=Vt(),f=m.lineFitEpsilon,x=t+f,v=0,E=0,y=!1,w=0,T=0,M=0,D=0,P=-1,_=0,b=0,S=null;function A(){P=-1,_=0,b=0,S=null}function R(z=M,Y=D,V=E){v++,n?.({startSegmentIndex:w,startGraphemeIndex:T,endSegmentIndex:z,endGraphemeIndex:Y,width:V}),E=0,y=!1,A()}function N(z,Y){y=!0,w=z,T=0,M=z+1,D=0,E=Y}function G(z,Y,V){y=!0,w=z,T=Y,M=z,D=Y+1,E=V}function U(z,Y){if(!y){N(z,Y);return}E+=Y,M=z+1,D=0}function ne(z,Y,V,ee){if(!Y)return;let Ae=z==="tab"?0:i[V],B=z==="tab"?ee:o[V];P=V+1,_=E-ee+Ae,b=E-ee+B,S=z}function H(z,Y){let V=l[z];for(let ee=Y;ee<V.length;ee++){let Ae=V[ee];y?E+Ae>x?(R(),G(z,ee,Ae)):(E+=Ae,M=z,D=ee+1):G(z,ee,Ae)}y&&M===z&&D===V.length&&(M=z+1,D=0)}function J(z){if(S!=="soft-hyphen")return!1;let Y=l[z];if(Y==null)return!1;let{fitCount:V,fittedWidth:ee}=Lg(Y,E,t,f,s);return V===0?!1:(E=ee,M=z,D=V,A(),V===Y.length?(M=z+1,D=0,!0):(R(z,V,ee+s),H(z,V),!0))}function _e(z){v++,n?.({startSegmentIndex:z.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:z.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),A()}for(let z=0;z<c.length;z++){let Y=c[z];if(Y.startSegmentIndex===Y.endSegmentIndex){_e(Y);continue}y=!1,E=0,w=Y.startSegmentIndex,T=0,M=Y.startSegmentIndex,D=0,A();let V=Y.startSegmentIndex;for(;V<Y.endSegmentIndex;){let ee=a[V],Ae=ee==="space"||ee==="preserved-space"||ee==="tab"||ee==="zero-width-break"||ee==="soft-hyphen",B=ee==="tab"?Fg(E,u):r[V];if(ee==="soft-hyphen"){y&&(M=V+1,D=0,P=V+1,_=E+s,b=E+s,S=ee),V++;continue}if(!y){B>t&&l[V]!==null?H(V,0):N(V,B),ne(ee,Ae,V,B),V++;continue}if(E+B>x){let I=E+(ee==="tab"?0:i[V]),ue=E+(ee==="tab"?B:o[V]);if(S==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&_<=x){R(P,0,b);continue}if(S==="soft-hyphen"&&J(V)){V++;continue}if(Ae&&I<=x){U(V,B),R(V+1,0,ue),V++;continue}if(P>=0&&_<=x){if(M>P||M===P&&D>0){R();continue}let ae=P;R(ae,0,b),V=ae;continue}if(B>t&&l[V]!==null){R(),H(V,0),V++;continue}R();continue}U(V,B),ne(ee,Ae,V,B),V++}if(y){let ee=P===Y.consumedEndSegmentIndex?b:E;R(Y.consumedEndSegmentIndex,0,ee)}}return v}var Ho=null;function Ng(){return Ho===null&&(Ho=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ho}function Mg(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function kg(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,x){r=[m],i=f,o=x,a=Dr(m),l=In.has(m)}function c(m,f){r.push(m),o=o||f;let x=Dr(m);m.length===1&&ct.has(m)?a=a||x:a=x,l=!1}for(let m of Ng().segment(e)){let f=m.segment,x=Ue(f);if(r.length===0){u(f,m.index,x);continue}if(l||Mr.has(f)||ct.has(f)||t.carryCJKAfterClosingQuote&&x&&a){c(f,x);continue}if(!o&&!x){c(f,x);continue}s(),u(f,m.index,x)}return s(),n}function Dg(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Ue(e[0].text),o=Nr(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=Ue(s.text),c=Nr(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function Ig(e,t,n,r){let i=Vt(),{cache:o,emojiCorrection:a}=Lc(t,Rc(e.normalized)),l=dt("-",tt("-",o),a),u=dt(" ",tt(" ",o),a)*8;if(e.len===0)return Mg(n);let c=[],m=[],f=[],x=[],v=e.chunks.length<=1,E=n?[]:null,y=[],w=n?[]:null,T=Array.from({length:e.len});function M(b,S,A,R,N,G,U){N!=="text"&&N!=="space"&&N!=="zero-width-break"&&(v=!1),c.push(S),m.push(A),f.push(R),x.push(N),E?.push(G),y.push(U),w!==null&&w.push(b)}function D(b,S,A,R,N){let G=tt(b,o),U=dt(b,G,a),ne=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,H=S==="space"||S==="zero-width-break"?0:U;if(N&&R&&b.length>1){let J="sum-graphemes";Dn(b)?J="pair-context":i.preferPrefixWidthsForBreakableRuns&&(J="segment-prefixes");let _e=Fc(b,G,o,a,J);M(b,U,ne,H,S,A,_e);return}M(b,U,ne,H,S,A,null)}for(let b=0;b<e.len;b++){T[b]=c.length;let S=e.texts[b],A=e.isWordLike[b],R=e.kinds[b],N=e.starts[b];if(R==="soft-hyphen"){M(S,0,l,l,R,N,null);continue}if(R==="hard-break"){M(S,0,0,0,R,N,null);continue}if(R==="tab"){M(S,0,0,0,R,N,null);continue}let G=tt(S,o);if(R==="text"&&G.containsCJK){let U=kg(S,i),ne=r==="keep-all"?Dg(U):U;for(let H=0;H<ne.length;H++){let J=ne[H];D(J.text,"text",N+J.start,A,r==="keep-all"||!Ue(J.text))}continue}D(S,R,N,A,!0)}let P=Pg(e.chunks,T,c.length),_=E===null?null:mc(e.normalized,E);return w!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:v,segLevels:_,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P,segments:w}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:v,segLevels:_,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P}}function Pg(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function Og(e,t,n,r){let i=r?.wordBreak??"normal",o=_c(e,Vt(),r?.whiteSpace,i);return Ig(o,t,n,i)}function Dc(e,t,n){return Og(e,t,!1,n)}function Ic(e,t,n){let r=Nc(e,t);return{lineCount:r,height:r*n}}var Gg={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Pc(e,t){let n={...Gg,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Dc(e,o),{lineCount:l}=Ic(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};Mu();window.__hyperframes={fitTextFontSize:Pc,getVariables:la};function Oc(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,dc())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oc,{once:!0}):Oc();})();\n';
58457
+ RUNTIME_IIFE = '"use strict";(()=>{var ad=Object.create;var Kr=Object.defineProperty;var sd=Object.getOwnPropertyDescriptor;var ld=Object.getOwnPropertyNames;var ud=Object.getPrototypeOf,cd=Object.prototype.hasOwnProperty;var dd=(e,t,n)=>t in e?Kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ld(t))!cd.call(e,i)&&i!==n&&Kr(e,i,{get:()=>t[i],enumerable:!(r=sd(t,i))||r.enumerable});return e};var md=(e,t,n)=>(n=e!=null?ad(ud(e)):{},fd(t||!e||!e.__esModule?Kr(n,"default",{value:e,enumerable:!0}):n,e));var he=(e,t,n)=>dd(e,typeof t!="symbol"?t+"":t,n);var Fs=Z((Hb,Ii)=>{var K=String,Ls=function(){return{isColorSupported:!1,reset:K,bold:K,dim:K,italic:K,underline:K,inverse:K,hidden:K,strikethrough:K,black:K,red:K,green:K,yellow:K,blue:K,magenta:K,cyan:K,white:K,gray:K,bgBlack:K,bgRed:K,bgGreen:K,bgYellow:K,bgBlue:K,bgMagenta:K,bgCyan:K,bgWhite:K,blackBright:K,redBright:K,greenBright:K,yellowBright:K,blueBright:K,magentaBright:K,cyanBright:K,whiteBright:K,bgBlackBright:K,bgRedBright:K,bgGreenBright:K,bgYellowBright:K,bgBlueBright:K,bgMagentaBright:K,bgCyanBright:K,bgWhiteBright:K}};Ii.exports=Ls();Ii.exports.createColors=Ls});var Pi=Z(()=>{});var tr=Z((Wb,ks)=>{"use strict";var Ns=Fs(),Ms=Pi(),cn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=Ns.isColorSupported);let r=c=>c,i=c=>c,o=c=>c;if(t){let{bold:c,gray:m,red:f}=Ns.createColors(!0);i=x=>c(f(x)),r=x=>m(x),Ms&&(o=x=>Ms(x))}let a=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((c,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-u)+" | ";if(f===this.line){if(c.length>160){let E=20,S=Math.max(0,this.column-E),w=Math.max(this.column+E,this.endColumn+E),T=c.slice(S,w),M=r(x.replace(/\\d/g," "))+c.slice(0,Math.min(this.column-1,E-1)).replace(/[^\\t]/g," ");return i(">")+r(x)+o(T)+`\n `+M+i("^")}let y=r(x.replace(/\\d/g," "))+c.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+r(x)+o(c)+`\n `+y+i("^")}return" "+r(x)+o(c)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};ks.exports=cn;cn.default=cn});var Oi=Z((Vb,Is)=>{"use strict";var sm=/(<)(\\/?style\\b)/gi,lm=/(<)(!--)/g;function ot(e){return typeof e!="string"||!e.includes("<")?e:e.replace(sm,"\\\\3c $2").replace(lm,"\\\\3c $2")}var Ds={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function um(e){return e[0].toUpperCase()+e.slice(1)}var dn=class{constructor(t){this.builder=t}atrule(t,n){let r=t.raws,i="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof r.afterName<"u"?i+=r.afterName:o&&(i+=" "),t.nodes)this.block(t,i+o);else{let a=(r.between||"")+(n?";":"");this.builder(ot(i+o+a),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(ot(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(ot(i)),this.builder("}",t,"end")}body(t){let n=t.nodes,r=n.length-1;for(;r>0&&n[r].type==="comment";)r-=1;let i=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let l=n[a],s=this.raw(l,"before");s&&this.builder(o?s:ot(s)),this.stringify(l,r!==a||i)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(ot("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(ot(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Ds[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+um(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ds[r]),l[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`\n`);return n=o[o.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:ot(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(ot(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};Is.exports=dn;dn.default=dn});var fn=Z((zb,Ps)=>{"use strict";var cm=Oi();function Gi(e,t){new cm(t).stringify(e)}Ps.exports=Gi;Gi.default=Gi});var nr=Z(($b,Hi)=>{"use strict";Hi.exports.isClean=Symbol("isClean");Hi.exports.my=Symbol("my")});var hn=Z((qb,Os)=>{"use strict";var dm=tr(),fm=Oi(),mm=fn(),{isClean:mn,my:pm}=nr();function Bi(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(a=>Bi(a,n)):(o==="object"&&i!==null&&(i=Bi(i)),n[r]=i)}return n}function Je(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`\n`?(n=1,r+=1):n+=1}return i}var pn=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[mn]=!1,this[pm]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\\n\\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=Bi(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new dm(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[mn]=!0}markDirty(){if(this[mn]){this[mn]=!1;let t=this;for(;t=t.parent;)t[mn]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n=this.source.start;if(t.index)n=this.positionInside(t.index);else if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,o=r.slice(Je(r,this.source.start),Je(r,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=Je(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`\n`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Je(n,this.source.start)},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Je(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Je(n,this.source.start),Je(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Je(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:Je(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new fm().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r={},i=n==null;n=n||new Map;let o=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let l=this[a];if(Array.isArray(l))r[a]=l.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof l=="object"&&l.toJSON)r[a]=l.toJSON(null,n);else if(a==="source"){if(l==null)continue;let s=n.get(l.input);s==null&&(s=o,n.set(l.input,o),o++),r[a]={end:l.end,inputId:s,start:l.start}}else r[a]=l}return i&&(r.inputs=[...n.keys()].map(a=>a.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=mm){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Os.exports=pn;pn.default=pn});var xn=Z((jb,Gs)=>{"use strict";var hm=hn(),gn=class extends hm{constructor(t){super(t),this.type="comment"}};Gs.exports=gn;gn.default=gn});var yn=Z((Kb,Hs)=>{"use strict";var gm=hn(),bn=class extends gm{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};Hs.exports=bn;bn.default=bn});var at=Z((Yb,Ks)=>{"use strict";var Bs=xn(),Us=yn(),xm=hn(),{isClean:Ws,my:Vs}=nr(),Ui,zs,$s,Wi;function qs(e){return e.map(t=>(t.nodes&&(t.nodes=qs(t.nodes)),delete t.source,t))}function js(e){if(e[Ws]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)js(t)}var Be=class e extends xm{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=qs(zs(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Us(t)]}else if(t.selector||t.selectors)t=[new Wi(t)];else if(t.name)t=[new Ui(t)];else if(t.text)t=[new Bs(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Vs]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ws]&&js(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};Be.registerParse=e=>{zs=e};Be.registerRule=e=>{Wi=e};Be.registerAtRule=e=>{Ui=e};Be.registerRoot=e=>{$s=e};Ks.exports=Be;Be.default=Be;Be.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Ui.prototype):e.type==="rule"?Object.setPrototypeOf(e,Wi.prototype):e.type==="decl"?Object.setPrototypeOf(e,Us.prototype):e.type==="comment"?Object.setPrototypeOf(e,Bs.prototype):e.type==="root"&&Object.setPrototypeOf(e,$s.prototype),e[Vs]=!0,e.nodes&&e.nodes.forEach(t=>{Be.rebuild(t)})}});var rr=Z((Xb,Xs)=>{"use strict";var Ys=at(),kt=class extends Ys{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};Xs.exports=kt;kt.default=kt;Ys.registerAtRule(kt)});var ir=Z((Jb,Zs)=>{"use strict";var bm=at(),Js,Qs,xt=class extends bm{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Js(new Qs,this,t).stringify()}};xt.registerLazyResult=e=>{Js=e};xt.registerProcessor=e=>{Qs=e};Zs.exports=xt;xt.default=xt});var tl=Z((Qb,el)=>{var ym="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Sm=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},vm=(e=21)=>{let t="",n=e|0;for(;n--;)t+=ym[Math.random()*64|0];return t};el.exports={nanoid:vm,customAlphabet:Sm}});var or=Z(()=>{});var ar=Z(()=>{});var Vi=Z(()=>{});var nl=Z(()=>{});var $i=Z((sy,ol)=>{"use strict";var{existsSync:Em,readFileSync:Cm}=nl(),{dirname:zi,join:_m}=or(),{SourceMapConsumer:rl,SourceMapGenerator:il}=ar();function Am(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Sn=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=zi(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new rl(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\\/json;charset=utf-?8;base64,/,r=/^data:application\\/json;base64,/,i=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return Am(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!(!r&&!this.unsafeMap&&!/\\.map$/i.test(t))&&(this.root=zi(t),Em(t)))return this.mapFile=t,Cm(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof rl)return il.fromSourceMap(n).toString();if(n instanceof il)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=_m(zi(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};ol.exports=Sn;Sn.default=Sn});var vn=Z((ly,cl)=>{"use strict";var{nanoid:wm}=tl(),{isAbsolute:Ki,resolve:Yi}=or(),{SourceMapConsumer:Tm,SourceMapGenerator:Rm}=ar(),{fileURLToPath:al,pathToFileURL:sr}=Vi(),sl=tr(),Lm=$i(),qi=Pi(),ji=Symbol("lineToIndexCache"),Fm=!!(Tm&&Rm),ll=!!(Yi&&Ki);function ul(e){if(e[ji])return e[ji];let t=e.css.split(`\n`),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[ji]=n,n}var Dt=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!ll||/^\\w+:\\/\\//.test(n.from)||Ki(n.from)?this.file=n.from:this.file=Yi(n.from)),ll&&Fm){let r=new Lm(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+wm(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;if(n&&typeof n=="object"){let m=n,f=r;if(typeof m.offset=="number"){s=m.offset;let x=this.fromOffset(s);n=x.line,r=x.col}else n=m.line,r=m.column,s=this.fromLineAndColumn(n,r);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);a=x.line,o=x.col}else a=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let m=this.fromOffset(s);n=m.line,r=m.col}let c=this.origin(n,r,a,o);return c?u=new sl(t,c.endLine===void 0?c.line:{column:c.column,line:c.line},c.endLine===void 0?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,i.plugin):u=new sl(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(sr&&(u.input.url=sr(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return ul(this)[t-1]+n-1}fromOffset(t){let n=ul(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:Yi(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:i,line:r}));let s;Ki(a.source)?s=sr(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||sr(this.map.mapFile));let u={column:a.column,endColumn:l&&l.column,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(al)u.file=al(s);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(a.source);return c&&(u.source=c),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};cl.exports=Dt;Dt.default=Dt;qi&&qi.registerInput&&qi.registerInput(Dt)});var It=Z((uy,pl)=>{"use strict";var dl=at(),fl,ml,st=class extends dl{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let o of i)o.raws.before=n.raws.before}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new fl(new ml,this,t).stringify()}};st.registerLazyResult=e=>{fl=e};st.registerProcessor=e=>{ml=e};pl.exports=st;st.default=st;dl.registerRoot(st)});var Xi=Z((cy,hl)=>{"use strict";var En={comma(e){return En.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return En.split(e,t)},split(e,t,n){let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let c of e)u?u=!1:c==="\\\\"?u=!0:l?c===s&&(l=!1):c===\'"\'||c==="\'"?(l=!0,s=c):c==="("?a+=1:c===")"?a>0&&(a-=1):a===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}};hl.exports=En;En.default=En});var lr=Z((dy,xl)=>{"use strict";var gl=at(),Nm=Xi(),Pt=class extends gl{get selectors(){return Nm.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};xl.exports=Pt;Pt.default=Pt;gl.registerRule(Pt)});var yl=Z((fy,bl)=>{"use strict";var Mm=rr(),km=xn(),Dm=yn(),Im=vn(),Pm=$i(),Om=It(),Gm=lr();function Cn(e,t){if(Array.isArray(e))return e.map(i=>Cn(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:Im.prototype};o.map&&(o.map={...o.map,__proto__:Pm.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Cn(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new Om(r);if(r.type==="decl")return new Dm(r);if(r.type==="rule")return new Gm(r);if(r.type==="comment")return new km(r);if(r.type==="atrule")return new Mm(r);throw new Error("Unknown node type: "+e.type)}bl.exports=Cn;Cn.default=Cn});var Qi=Z((my,Al)=>{"use strict";var{dirname:ur,relative:vl,resolve:El,sep:Cl}=or(),{SourceMapConsumer:_l,SourceMapGenerator:cr}=ar(),{pathToFileURL:Sl}=Vi(),Hm=vn(),Bm=!!(_l&&cr),Um=!!(ur&&El&&vl&&Cl),Ji=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ur(t.file),i;this.mapOpts.sourcesContent===!1?(i=new _l(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`\n`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),Um&&Bm&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=cr.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new cr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new cr({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\\n/g),a?(t+=a.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,s&&u!=="start"){let c=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==c.last||c.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\\w+:\\/\\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?ur(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ur(El(r,this.mapOpts.annotation)));let i=vl(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new Hm(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(Sl){let r=Sl(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;Cl==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};Al.exports=Ji});var Rl=Z((py,Tl)=>{"use strict";var dr=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,fr=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,Wm=/.[\\r\\n"\'(/\\\\]/,wl=/[\\da-f]/i;Tl.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,m,f,x,y,E=r.length,S=0,w=[],T=[],M=-1;function D(){return S}function P(A){throw t.error("Unclosed "+A,S)}function _(){return T.length===0&&S>=E}function b(A){if(T.length)return T.pop();if(S>=E)return;let R=A?A.ignoreUnclosed:!1;switch(o=r.charCodeAt(S),o){case 10:case 32:case 9:case 13:case 12:{s=S;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(S,s)],S=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);c=[N,N,S];break}case 40:{if(y=w.length?w.pop()[1]:"",x=r.charCodeAt(S+1),y==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){s=S;do{if(m=!1,s=r.indexOf(")",s+1),s===-1)if(i||R){s=S;break}else P("bracket");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["brackets",r.slice(S,s+1),S,s],S=s}else S<=M?c=["(","(",S]:(s=r.indexOf(")",S+1),a=r.slice(S,s+1),s===-1||Wm.test(a)?(M=s===-1?E:s,c=["(","(",S]):(c=["brackets",a,S,s],S=s));break}case 39:case 34:{u=o===39?"\'":\'"\',s=S;do{if(m=!1,s=r.indexOf(u,s+1),s===-1)if(i||R){s=S+1;break}else P("string");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["string",r.slice(S,s+1),S,s],S=s;break}case 64:{dr.lastIndex=S+1,dr.test(r),dr.lastIndex===0?s=r.length-1:s=dr.lastIndex-2,c=["at-word",r.slice(S,s+1),S,s],S=s;break}case 92:{for(s=S,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,wl.test(r.charAt(s)))){for(;wl.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(S,s+1),S,s],S=s;break}default:{o===47&&r.charCodeAt(S+1)===42?(s=r.indexOf("*/",S+2)+1,s===0&&(i||R?s=r.length:P("comment")),c=["comment",r.slice(S,s+1),S,s],S=s):(fr.lastIndex=S+1,fr.test(r),fr.lastIndex===0?s=r.length-1:s=fr.lastIndex-2,c=["word",r.slice(S,s+1),S,s],w.push(c),S=s);break}}return S++,c}function v(A){T.push(A)}return{back:v,endOfFile:_,nextToken:b,position:D}}});var Ml=Z((hy,Nl)=>{"use strict";var Vm=rr(),zm=xn(),$m=yn(),qm=It(),Ll=lr(),jm=Rl(),Fl={empty:!0,space:!0};function Km(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var Zi=class{constructor(t){this.input=t,this.root=new qm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new Vm;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new zm;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=jm(this.input)}decl(t,n){let r=new $m;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||Km(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],l;for(;t.length&&(l=t[0][0],!(l!=="space"&&l!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),m="";for(let f=u;f>0;f--){let x=c[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=c.pop()[1]+m}m.trim().startsWith("!")&&(r.important=!0,r.raws.important=m,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=a.map(u=>u[1]).join(""),a=[]),this.raw(r,"value",a.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new Ll;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,a,l=r.length,s="",u=!0,c,m;for(let f=0;f<l;f+=1)o=r[f],a=o[0],a==="space"&&f===l-1&&!i?u=!1:a==="comment"?(m=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Fl[m]&&!Fl[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let f=r.reduce((x,y)=>x+y[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Ll;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};Nl.exports=Zi});var pr=Z((gy,kl)=>{"use strict";var Ym=at(),Xm=vn(),Jm=Ml();function mr(e,t){let n=new Xm(e,t),r=new Jm(n);try{r.parse()}catch(i){throw i}return r.root}kl.exports=mr;mr.default=mr;Ym.registerParse(mr)});var eo=Z((xy,Dl)=>{"use strict";var _n=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};Dl.exports=_n;_n.default=_n});var hr=Z((by,Il)=>{"use strict";var Qm=eo(),An=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new Qm(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Il.exports=An;An.default=An});var to=Z((yy,Ol)=>{"use strict";var Pl={};Ol.exports=function(t){Pl[t]||(Pl[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var io=Z((vy,Ul)=>{"use strict";var Zm=at(),ep=ir(),tp=Qi(),np=pr(),Gl=hr(),rp=It(),ip=fn(),{isClean:Ke,my:op}=nr(),Sy=to(),ap={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},sp={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},lp={Once:!0,postcssPlugin:!0,prepare:!0},Ot=0;function wn(e){return typeof e=="object"&&typeof e.then=="function"}function Bl(e){let t=!1,n=ap[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Ot,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Ot,n+"Exit"]:[n,n+"Exit"]}function Hl(e){let t;return e.type==="document"?t=["Document",Ot,"DocumentExit"]:e.type==="root"?t=["Root",Ot,"RootExit"]:t=Bl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function no(e){return e[Ke]=!1,e.nodes&&e.nodes.forEach(t=>no(t)),e}var ro={},lt=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=no(n);else if(n instanceof e||n instanceof Gl)i=no(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=np;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[op]&&Zm.rebuild(i)}this.result=new Gl(t,i,r),this.helpers={...ro,postcss:ro,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!sp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!lp[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(wn(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];){t[Ke]=!0;let n=[Hl(t)];for(;n.length>0;){let r=this.visitTick(n);if(wn(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return wn(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=ip;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let o=new tp(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(wn(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];)t[Ke]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(wn(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator,l;for(;l=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!l[Ke]){l[Ke]=!0,t.push(Hl(l));return}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===Ot){r.nodes&&r.nodes.length&&(r[Ke]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ke]=!0;let n=Bl(t);for(let r of n)if(r===Ot)t.nodes&&t.each(i=>{i[Ke]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};lt.registerPostcss=e=>{ro=e};Ul.exports=lt;lt.default=lt;rp.registerLazyResult(lt);ep.registerLazyResult(lt)});var Vl=Z((Cy,Wl)=>{"use strict";var up=Qi(),cp=pr(),dp=hr(),fp=fn(),Ey=to(),Tn=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=cp;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i=fp;this.result=new dp(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new up(i,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};Wl.exports=Tn;Tn.default=Tn});var $l=Z((_y,zl)=>{"use strict";var mp=ir(),pp=io(),hp=Vl(),gp=It(),bt=class{constructor(t=[]){this.version="8.5.14",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new hp(this,t,n):new pp(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};zl.exports=bt;bt.default=bt;gp.registerProcessor(bt);mp.registerProcessor(bt)});var Zl=Z((Ay,Ql)=>{"use strict";var ql=rr(),jl=xn(),xp=at(),bp=tr(),Kl=yn(),Yl=ir(),yp=yl(),Sp=vn(),vp=io(),Ep=Xi(),Cp=hn(),_p=pr(),oo=$l(),Ap=hr(),Xl=It(),Jl=lr(),wp=fn(),Tp=eo();function le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new oo(e)}le.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new oo().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return le([i(s)]).process(a,l)},i};le.stringify=wp;le.parse=_p;le.fromJSON=yp;le.list=Ep;le.comment=e=>new jl(e);le.atRule=e=>new ql(e);le.decl=e=>new Kl(e);le.rule=e=>new Jl(e);le.root=e=>new Xl(e);le.document=e=>new Yl(e);le.CssSyntaxError=bp;le.Declaration=Kl;le.Container=xp;le.Processor=oo;le.Document=Yl;le.Comment=jl;le.Warning=Tp;le.AtRule=ql;le.Result=Ap;le.Input=Sp;le.Rule=Jl;le.Root=Xl;le.Node=Cp;vp.registerPostcss(le);Ql.exports=le;le.default=le});function Un(){return globalThis}function L(e,t){if(typeof window>"u")return;let n=Un(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var pd=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1"];function hd(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function gd(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=hd(r,n);return{numerator:r/i,denominator:n/i}}function Yr(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Wn(e){return{protocolVersion:1,capabilities:pd,fps:gd(e)}}function xd(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ra(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=Yr(n.fps);return r===null||!xd(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var ia=30;function oa(e){ia=Number.isFinite(e)&&e>0?e:30}function xe(e){try{window.parent.postMessage({...e,...Wn(ia)},"*")}catch(t){L("bridge.postMessage",t)}}var bd={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(yd(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>vd(e)};function yd(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Yr(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function Sd(e){let t=ra(e);return t.status!=="unsupported"?!1:(xe({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function vd(e){let t=e.selectors,n=e.duration||800;t&&Ed(t,n)}function aa(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||Sd(r))return;let i=r.action;if(typeof i!="string")return;let o=bd[i];o&&o(r,e)};return window.addEventListener("message",t),xe({source:"hf-preview",type:"ready"}),t}function Ed(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){L("bridge.flashElements.querySelector",r)}}var Xr=null;function sa(e){Xr=e}function Ne(e,t){if(Xr)try{Xr({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function Cd(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function At(e){return`--${Cd(e)}`}function la(e){let t=new Map;for(let n of e){let r=At(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function ua(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let r of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(r);let t={};for(let r of e)Object.assign(t,Jt(r));let n=zn();return{...t,...n}}function Jt(e){if(!e)return{};let t=e.getAttribute("data-composition-variables");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(!Array.isArray(n))return{};let r={};for(let i of n){if(!i||typeof i!="object")continue;let o=i;typeof o.id!="string"||!("default"in o)||(r[o.id]=o.default)}return r}var Jr="data-hf-css-vars";function Vn(e){return"style"in e&&typeof e.style?.setProperty=="function"}function Qr(e,t){if(!Vn(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=At(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Jr,n.join(" "))}function ca(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=At(i);((Vn(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function da(e){if(!Vn(e))return;let t=e.getAttribute(Jr);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Jr)}}function fa(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=zn(),r=[];for(let i of t)r.push(..._d(i,n,e.defaultView));for(let i of la(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${At(i[0]??"")} \\u2014 rename one to avoid cross-talk`)}function _d(e,t,n){if(!Vn(e))return[];let r=Jt(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=At(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return Qr(e,i),Object.keys(r)}function ma(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function zn(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function pa(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(x){L("runtime.adapters.css.site5",x)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){L("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){L("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){L("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){L("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let x=i(f,m);x.endSeconds!=null&&(u=Math.max(u,x.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),x=Math.max(0,c-f)*1e3,y=m.animations;if(y.length>0){o(y,x);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(x/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function ha(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function ga(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){L("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){L("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){L("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){L("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function ba(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){L("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(Zr(r))r.goToAndStop(t*1e3,!1);else if(ei(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){L("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(Zr(t)||ei(t))&&t.pause()}catch(n){L("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=Ad(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function xa(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Ad(e){return Zr(e)?xa(e.totalFrames,e.frameRate):ei(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:xa(e.totalFrames,e.frameRate):null}function Zr(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function ei(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ti=-1;function $n(e){if(e!==ti){ti=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){L("runtime.adapters.seek-dispatch.site1",t)}}}function ya(e){ti=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){L("runtime.adapters.seek-dispatch.force",t)}}function Sa(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,$n(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function $e(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function va(){return $e({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function Ea(){return $e({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function Ca(){return $e({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function _a(){return $e({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function Aa(){return $e({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}function wa(){let e=null,t=0;return{name:"typegpu",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfTypegpuTime=e,$n(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function Ta(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;if(e.id){let n=document.getElementById(`__render_frame_${e.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function Ra(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=Ta(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function La(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=Ta(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function Fa(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=S=>{let w=Number(S.currentTime);return Number.isFinite(w)&&w>0?w:0},c=(S,w)=>w<=0?S:S>=w?Math.max(0,S-w):S,m=(S,w)=>{let T=l.get(S);if(T)return T;let M={compositionTimeMs:w,animationTimeMs:e?c(u(S),w):u(S)};return l.set(S,M),M},f=(S,w)=>{if(!a.has(S)){a.add(S);let T=()=>{a.delete(S)};try{S.addEventListener("finish",T,{once:!0}),S.addEventListener("cancel",T,{once:!0})}catch(M){L("runtime.adapters.waapi.site4",M)}}m(S,w)},x=(S,w)=>{for(let T of S)f(T,w)},y=()=>{if(n||typeof Element>"u")return;let S=Element.prototype;if(typeof S.animate!="function"||S.__hfOriginalAnimate)return;let w=S.animate;try{Object.defineProperty(S,"__hfOriginalAnimate",{value:w,configurable:!0});let T=function(...M){let D=w.apply(this,M);return f(D,t),D};S.animate=T,r=S,i=w,o=T,n=!0}catch{}},E=S=>{let w=null;try{w=S.effect?.getComputedTiming?.()??null}catch(D){L("runtime.adapters.waapi.site4",D)}if(!w)return{};let T=Number(w.endTime);return Number.isFinite(T)?{endSeconds:(l.get(S)?.compositionTimeMs??0)/1e3+T/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,y(),x(s(),t)},seek:S=>{let w=Math.max(0,(Number(S.time)||0)*1e3);t=w,(!e||a.size>0)&&x(s(),e?w:0);for(let T of a){let M=e?m(T,w):m(T,0),D=M.animationTimeMs+Math.max(0,w-M.compositionTimeMs);try{T.currentTime=D}catch(P){L("runtime.adapters.waapi.site1",P)}try{T.pause()}catch(P){L("runtime.adapters.waapi.site2",P)}}},pause:()=>{e||x(s(),t);for(let S of a)try{S.pause()}catch(w){L("runtime.adapters.waapi.site3",w)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(S){L("runtime.adapters.waapi.site5",S)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let S=0;for(let w of s()){let T=E(w);T.endSeconds!=null&&(S=Math.max(S,T.endSeconds))}return S>0?S:null}}}function Na(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function wd(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function qn(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Td(e,t){let n=qn(e.dataset.start)??0,r=qn(e.dataset.end),i=qn(e.dataset.duration),o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=qn(e.dataset.volume)??1,l=Math.max(0,Math.min(1,a));return{start:n,end:o,staticVolume:l}}function Rd(e,t,n,r){let{start:i,end:o,staticVolume:a}=Td(e,n);e.volume=a;let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=[],m;for(let x=s;x<=u+1e-6;x=Math.min(u,x+l)){t(x);let y=Number(e.volume);if(Number.isFinite(y)){let E=Math.max(0,Math.min(1,y)),S={time:Number(x.toFixed(6)),volume:Number(E.toFixed(6))};wd(c,m,S,x===u),m=S}if(x===u)break}return c.some(x=>Math.abs(x.volume-a)>1e-4)?c:null}function Ma(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Rd(e,o,n,60);Number.isFinite(a)&&o(a),l&&r.set(e,l)}function ka(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function qe(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return ka(n)}function Tt(e){let t=Number.parseFloat(e.getAttribute("data-playback-start")??e.getAttribute("data-media-start")??"");return Number.isFinite(t)&&t>=0?t:0}function Da(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>0);return n.length>0?Math.min(...n):null}function Ia(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,u=qe(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-s)/u));let x=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,y=Number.parseFloat(a.dataset.volume??""),E={el:a,start:l,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(y)?y:null,playbackRate:u,loop:c,sourceDuration:m};r.push(E),a.tagName==="VIDEO"&&i.push(E),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ni=new WeakMap,Zt=new WeakMap,ri=new WeakSet,wt=new WeakSet;function Ld(e){if(wt.has(e))return;wt.add(e);let t=()=>wt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Fd=3;function Nd(e){return e.error!=null||e.networkState===Fd}var ii=new WeakMap;function Qt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function oi(e){ni.delete(e),Zt.delete(e),ri.delete(e),ii.delete(e)}function Pa(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=o&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||l)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let U=n.sourceDuration-n.mediaStart;U>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%U)}let u=Qt(e.userVolume??1),c=Qt(n.volume??1),m=ii.get(r),f=Qt(r.volume),x;n.volumeKeyframes&&n.volumeKeyframes.length>0?x=Qt(Na(n.volumeKeyframes,i)):m===void 0||Math.abs(f-m)>1e-4?x=f:x=c;let y=Qt(x*u);r.volume=y,ii.set(r,y),e.onElementVolume?.(r,y),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(U){L("runtime.media.site1",U)}let E=.04,S=2,w=r.currentTime||0,T=Math.abs(w-i),M=i-w,D=ni.get(r);ni.set(r,M);let P=D===void 0,_=!P&&Math.abs(M-D)>.5,b=T>3,v=a&&T>.001||r.ended&&l&&T>.001||T>.5&&(P||_||b),A=r.tagName==="VIDEO"&&!r.paused,R=D!==void 0&&Math.abs(M-D)<.004,N=!1;if(!A&&!v&&!P&&R&&T>E){let U=(Zt.get(r)??0)+1;Zt.set(r,U),U>=S&&(N=!0,Zt.set(r,0))}else T<=E&&Zt.set(r,0);let G=!A&&e.forceSync&&T>.02;if(v||N||G){if(!(r.tagName==="VIDEO"&&r.id&&!!document.getElementById(`__render_frame_${r.id}__`))){try{r.currentTime=i}catch(ne){L("runtime.media.site2",ne)}if(Math.abs(r.currentTime-i)>.5&&!ri.has(r)){ri.add(r),r.load();try{r.currentTime=i}catch(ne){L("runtime.media.site3",ne)}}}wt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!wt.has(r)&&!Nd(r)?(Ld(r),r.play().catch(U=>{wt.delete(r),(U&&typeof U=="object"&&"name"in U?String(U.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}oi(r),r.paused||r.pause()}}var Md="hf-proxy",Oa="runtime_media_proxy_fallback",Ga="runtime_media_proxy_unavailable",en=new WeakSet,Ha=new WeakSet;function jn(e){return e.currentSrc||e.src}function ai(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!e.id&&!!document.getElementById(`__render_frame_${e.id}__`)}function si(e){let t=jn(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function kd(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function Dd(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function li(e,t){return t[e]??kd(e,t)??Dd(e,t)}function Id(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Md,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var Pd={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function gt(e,t,n){if(Ha.has(e))return;Ha.add(e);let r=Pd[t];xe({source:"hf-preview",type:"diagnostic",code:Ga,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Ga}: "${n}" (${t}): ${r}`)}function ui(e,t=null,n="reactive"){if(en.has(e))return;let r=jn(e),i;try{i=Id(r,t)}catch(l){L("runtime.mediaProxy.swap",l),gt(e,"invalid_source_url",r);return}en.add(e),oi(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Oa,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Oa}: "${r}" uses a codec (${o??"unknown"}) this browser can\'t decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Ba(e){if(ai(e)||!(e instanceof HTMLVideoElement)||en.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=si(e);if(n===null)return;let r=li(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||ui(e,r,"proactive")}function Ua(e){if(ai(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=jn(e);if(en.has(e)){gt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=si(e);if(r===null){gt(e,"cross_origin",t);return}let i=li(r,n);if(i&&!i.browserHostile){gt(e,"browser_safe_codec",t);return}ui(e,i,"reactive")}function Wa(e){if(ai(e)||!(e instanceof HTMLVideoElement))return;let t=jn(e);if(en.has(e)){gt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=si(e);if(r===null){gt(e,"cross_origin",t);return}let i=li(r,n);if(i&&!i.browserHostile){gt(e,"browser_safe_codec",t);return}ui(e,i,"tertiary")}var be=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);he(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},Od=[0,0,0],Gd=[1,1,1],Kn=64;function Hd(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===\'"\'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function nt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new be(`Invalid number "${e}"`,t);return n}function Va(e,t,n){if(e.length!==3)throw new be(`${t} expects three numbers`,n);return[nt(e[0],n),nt(e[1],n),nt(e[2],n)]}function za(e,t,n){if(!e)throw new be(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new be(`${t} must be an integer greater than 1`,n);return r}function Bd(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new be("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Ud(e){let t=/^TITLE\\s+"([^"]*)"\\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\\s+(.+)\\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function Wd(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function $a(e,t={}){let n=t.maxSize??Kn,r=null,i=Od,o=Gd,a=null,l=null,s=[],u=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let m=0;m<u.length;m++){let f=m+1,x=Hd(u[m]??"").trim();if(!x)continue;let y=x.split(/\\s+/),E=(y[0]??"").toUpperCase(),S=y.slice(1);if(E==="TITLE"){r=Ud(x);continue}if(E==="DOMAIN_MIN"){i=Va(S,E,f);continue}if(E==="DOMAIN_MAX"){o=Va(S,E,f);continue}if(E==="LUT_3D_INPUT_RANGE"){if(S.length!==2)throw new be(`${E} expects two numbers`,f);let w=nt(S[0],f),T=nt(S[1],f);if(T<=w)throw new be("LUT_3D_INPUT_RANGE max must exceed min",f);i=[w,w,w],o=[T,T,T];continue}if(E==="LUT_1D_SIZE"){a=za(S[0],E,f);continue}if(E==="LUT_3D_SIZE"){if(l=za(S[0],E,f),l>n)throw new be(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!Wd(E)){if(E.startsWith("LUT_"))throw new be(`Unsupported cube keyword ${E}`,f);continue}if(!l)throw a?new be("1D cube LUTs are not supported yet",f):new be("LUT data appears before LUT_3D_SIZE",f);if(y.length!==3)throw new be("LUT data rows must contain three numbers",f);s.push(nt(y[0],f),nt(y[1],f),nt(y[2],f))}if(a&&l)throw new be("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new be("1D cube LUTs are not supported yet"):new be("Missing LUT_3D_SIZE");Bd(i,o);let c=l*l*l;if(s.length!==c*3)throw new be(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function Vd(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function tn(e){return Math.round(Vd(e)*255)}function ci(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=tn(e.data[s]??0),i[u+1]=tn(e.data[s+1]??0),i[u+2]=tn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var qa="rec709";var ce={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var ja=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Ka=["shadows","midtones","highlights"],Ya=["master","red","green","blue"],Xa=["hueVsHue","hueVsSaturation","hueVsLuma"];var Ja=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Qa=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var Bx=ce.unit,Ux=ce.signedUnit,Wx=ce.effects;var je=1024,nn=16;function Za(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function ye(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function zd(e){let t=[],n=[],r=ye(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=ye(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Za(ye(t,0),ye(t,1),i,ye(n,1)),o[o.length-1]=Za(ye(t,t.length-1),ye(t,t.length-2),ye(n,n.length-1),ye(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ye(n,a-1),s=ye(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=ye(t,a-1),c=ye(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function es(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function $d(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function qd(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function ts(e,t,n,r,i){$d(e,r,i);let o=zd(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>ye(e,l+1)[0];)l+=1;let c=ye(e,l),m=ye(e,l+1),f=qd(u,c,m,ye(o,l),ye(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function Rt(e,t=je){if(es(e,t),e.length>nn)throw new RangeError(`A color curve supports at most ${nn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return ts(e,t,n=>n/(t-1),0,1)}function fi(e,t,n,r=je){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>nn)throw new RangeError(`A hue curve supports at most ${nn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return es(l,r),ts(l,r,s=>s/r*360,t,n)}var rn="data-color-grading",on="data-hf-color-grading-source-hidden",Jn="data-hf-authored-opacity",as="__hf_color_grading_",Kd=qa,hi={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},gi={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},xi={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var Qn=ja,ss=Ka,ls=Ya,us=Xa,yi=Ja,Si=Qa,ns={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},rs={vignette:.18};function Se(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...hi,...n},details:{...gi,...r},effects:{...xi,...i}}}var vi=[Se("neutral","Neutral"),Se("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Se("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Se("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Se("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Se("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Se("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Se("vintage-wash","Vintage Wash",ns,rs),Se("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Se("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Se("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Se("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Se("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Se("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Se("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Se("home-movie-8mm","8mm Home Movie",ns,{...rs,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Se("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Se("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],Yd=new Map(vi.map(e=>[e.id,e])),Xd=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,Jd={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},Lt={hue:0,amount:0,level:0},is={amount:ce.unit,level:ce.signedUnit},rt=[[0,0],[1,1]],Ft=[],Qd={hueVsHue:ce.secondaryHueShift,hueVsSaturation:ce.signedUnit,hueVsLuma:ce.signedUnit},mi={center:0,range:180,softness:0},pi={min:0,max:1,softness:.05},Zd={vignette:ce.unit,vignetteMidpoint:ce.unit,vignetteRoundness:ce.signedUnit,vignetteFeather:ce.unit,grain:ce.unit,grainSize:ce.unit,grainRoughness:ce.unit},bi=ce.unit,ef=ce.effects,cs=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var tf=vi.filter(e=>cs.some(t=>e.effects[t]>1e-4)),Xx=vi.filter(e=>!tf.includes(e)),Jx={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},ds=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var nf=/^#[0-9a-f]{6}$/i;function rf(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&nf.test(t))?null:e.map(t=>t.toLowerCase())}function Ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Xn(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function fs(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function we(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Xn(n,t.min,t.max):0}function Ei(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function of(e){let t=Ce(e)?e:{};return ss.reduce((n,r)=>{let i=Ce(t[r])?t[r]:{};return n[r]={hue:Ei(i.hue,Lt.hue),amount:we(i.amount??Lt.amount,is.amount),level:we(i.level??Lt.level,is.level)},n},{shadows:{...Lt},midtones:{...Lt},highlights:{...Lt}})}function af(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[Xn(t,0,1),Xn(n,0,1)]:null}function ms(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function sf(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function lf(e){if(!Array.isArray(e)||e.length<2)return rt;let t=[];for(let n of e){let r=af(n);if(!r)return rt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),ms(t)||(sf(t),t.length>16)?rt:t}function uf(e){let t=Ce(e)?e:{};return ls.reduce((n,r)=>(n[r]=lf(t[r]),n),{master:rt,red:rt,green:rt,blue:rt})}function cf(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[Ei(n),Xn(r,t.min,t.max)]:null}function df(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return Ft;let n=[];for(let r of e){let i=cf(r,t);if(!i)return Ft;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),ms(n)?Ft:n}function ff(e){let t=Ce(e)?e:{};return us.reduce((n,r)=>(n[r]=df(t[r],Qd[r]),n),{hueVsHue:Ft,hueVsSaturation:Ft,hueVsLuma:Ft})}function os(e){let t=Ce(e)?e:{},n=we(t.min??pi.min,bi),r=we(t.max??pi.max,bi);return{min:Math.min(n,r),max:Math.max(n,r),softness:we(t.softness??pi.softness,ce.secondarySoftRangeSoftness)}}function mf(e){let t=Ce(e)?e:{},n=we(t.range??mi.range,ce.secondaryHueRange);return{center:Ei(t.center,mi.center),range:n,softness:we(t.softness??mi.softness,{min:ce.secondaryHueSoftness.min,max:ce.secondaryHueCombinedMax-n})}}function pf(e){return{hueShift:we(e.hueShift??0,ce.secondaryHueShift),saturation:we(e.saturation??0,ce.signedUnit),luma:we(e.luma??0,ce.signedUnit),temperature:we(e.temperature??0,ce.signedUnit),tint:we(e.tint??0,ce.signedUnit)}}function hf(e){return!Ce(e)||!Ce(e.key)||!Ce(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:mf(e.key.hue),saturation:os(e.key.saturation),luma:os(e.key.luma)},correction:pf(e.correction)}}function gf(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=hf(n);r&&t.push(r)}return t}function xf(e){if(e==null)return null;let t=String(e).trim();return t||null}function bf(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ce(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:fs(e.intensity,1)}}function yf(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ce(n)?n:null}catch{return null}return{preset:t}}return Ce(e)?e:null}function Sf(e,t){let n=e.trim().match(Xd);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Yn(e,t){if(typeof e=="string"){let r=Sf(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Yn(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Yn(r,t));if(!Ce(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Yn(i,t);return n}function vf(e){return e?Yd.get(e)??null:null}function Zn(e){let t=yf(e);if(!t||t.enabled===!1)return null;let n=xf(t.preset),r=vf(n),i=r?.adjust??hi,o=r?.details??gi,a=r?.effects??xi,l=Ce(t.adjust)?t.adjust:{},s=Ce(t.details)?t.details:{},u=Ce(t.effects)?t.effects:{},c=Qn.reduce((x,y)=>(x[y]=we(l[y]??i[y],Jd[y]),x),{...hi}),m=yi.reduce((x,y)=>(x[y]=we(s[y]??o[y],Zd[y]),x),{...gi}),f=Si.reduce((x,y)=>(x[y]=we(u[y]??a[y],ef[y]??bi),x),{...xi});return{enabled:!0,preset:n,intensity:fs(t.intensity,r?.intensity??1),adjust:c,wheels:of(t.wheels),curves:uf(t.curves),hueCurves:ff(t.hueCurves),secondaries:gf(t.secondaries),details:m,effects:f,palette:rf(t.palette),lut:bf(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():Kd}}function ps(e,t){return Zn(Yn(e,t))}function Ef(e){return ss.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Ci(e){return ls.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function _i(e){return us.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Ai(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function hs(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||cs.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Qn.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Ef(e.wheels):!1)||(e.curves?Ci(e.curves):!1)||(e.hueCurves?_i(e.hueCurves):!1)||(e.secondaries?Ai(e.secondaries):!1):!1}var Cf=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),_f=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function gs(e){let t=!1,n=null,r=null,i=null,o=null;function a(b,v){try{window.dispatchEvent(new CustomEvent(b,{detail:v}))}catch(A){L("runtime.picker.site1",A)}}function l(b){i=b,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(b){o=b,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(b){let v=b.ownerDocument.defaultView;if(!v)return!1;let A=b;for(;A&&A!==document.body&&A!==document.documentElement;){let R=v.getComputedStyle(A);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let N=Number.parseFloat(R.opacity);if(Number.isFinite(N)&&N<=.01&&!A.hasAttribute(on))return!0;A=A.parentElement}return!1}function c(b){if(!b||b===document.body||b===document.documentElement)return!1;let v=b.tagName.toLowerCase();return!(v==="script"||v==="style"||v==="link"||v==="meta"||b.classList.contains("__hf-pick-highlight")||b.closest(Cf)||u(b))}function m(b){return!!b?.closest(_f)}function f(b){let v=b;if(v.id)return`#${CSS.escape(v.id)}`;let A=b.getAttribute("data-composition-id");if(A)return`[data-composition-id="${CSS.escape(A)}"]`;let R=b.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let N=b.getAttribute("data-track-index");if(N)return`[data-track-index="${CSS.escape(N)}"]`;let G=b.tagName.toLowerCase(),U=b.parentElement;if(!U)return G;let ne=U.querySelectorAll(`:scope > ${G}`);if(ne.length===1)return G;for(let H=0;H<ne.length;H+=1)if(ne[H]===b)return`${G}:nth-of-type(${H+1})`;return G}function x(b){let v=b.tagName.toLowerCase(),A=(b.textContent??"").trim().replace(/\\s+/g," "),R=(N,G)=>N.length>G?`${N.slice(0,G-1)}\\u2026`:N;return v==="h1"||v==="h2"||v==="h3"?"Heading":v==="p"||v==="span"||v==="div"?A.length>0?R(A,56):"Text":v==="img"?"Image":v==="video"?"Video":v==="audio"?"Audio":v==="svg"?"Shape":b.getAttribute("data-composition-src")?"Composition":v==="section"?"Section":`${v.charAt(0).toUpperCase()}${v.slice(1)}`}function y(b,v,A){let R=typeof A=="number"&&A>0?A:8,N=[];if(document.elementsFromPoint)N=document.elementsFromPoint(b,v);else if(document.elementFromPoint){let ne=document.elementFromPoint(b,v);N=ne?[ne]:[]}if(m(N[0]??null))return[];let G={},U=[];for(let[ne,H]of N.entries()){if(!c(H))continue;let J=`${H.tagName}::${H.id||""}::${ne}`;if(!G[J]&&(G[J]=!0,U.push(H),U.length>=R))break}return U}function E(b){let v=b.getBoundingClientRect(),A={};for(let N of Array.from(b.attributes))N.name.startsWith("data-")&&(A[N.name]=N.value);return{id:b.id||null,tagName:b.tagName.toLowerCase(),selector:f(b),label:x(b),boundingBox:{x:v.left,y:v.top,width:v.width,height:v.height},textContent:b.textContent?b.textContent.trim().slice(0,200):null,src:b.getAttribute("src")||b.getAttribute("data-composition-src")||null,dataAttributes:A}}function S(b,v,A){return y(b,v,A).map(E)}function w(b){if(!t)return;let A=y(b.clientX,b.clientY,1)[0]??(b.target instanceof Element?b.target:null);if(!c(A)||n===A)return;n&&n.classList.remove("__hf-pick-highlight"),n=A,A.classList.add("__hf-pick-highlight");let R=E(A);l(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function T(b){if(!t)return;b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation();let v=S(b.clientX,b.clientY,8);v.length!==0&&(l(v[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:v,selectedIndex:0,point:{x:b.clientX,y:b.clientY}}))}function M(b){b.key==="Escape"&&(P(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function D(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`\n`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",w,!0),document.addEventListener("click",T,!0),document.addEventListener("keydown",M,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function P(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",w,!0),document.removeEventListener("click",T,!0),document.removeEventListener("keydown",M,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function _(){window.__HF_PICKER_API={enable:D,disable:P,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(b,v,A)=>Number.isFinite(b)&&Number.isFinite(v)?S(b,v,A):[],pickAtPoint:(b,v,A)=>{if(!Number.isFinite(b)||!Number.isFinite(v))return null;let R=S(b,v,8);if(!R.length)return null;let N=Math.max(0,Math.min(R.length-1,Number(A??0))),G=R[N]??null;return G?(s(G),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),P(),G):null},pickManyAtPoint:(b,v,A)=>{if(!Number.isFinite(b)||!Number.isFinite(v))return[];let R=S(b,v,8);if(!R.length)return[];let N=[],G=Array.isArray(A)?A:[0];for(let U of G){let ne=Math.max(0,Math.min(R.length-1,Math.floor(Number(U)))),H=R[ne];if(!H)continue;N.some(_e=>_e.selector===H.selector&&_e.tagName===H.tagName)||N.push(H)}return N.length?(s(N[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:N}),P(),N):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:D,disablePickMode:P,installPickerApi:_}}var Af=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Nt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function xs(e,t,n=Af){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function an(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&L("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function He(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&L("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function sn(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){L("runtime.player.site1",i)}}}function bs(e,t,n,r){let i=Nt(t,n),o=r?.suppressEvents===!0;return He(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function wf(e,t,n,r,i){let o=[];sn(e,t,a=>{He(a,"play"),o.push(a)});try{return bs(t,n,r,i)}finally{for(let a of o)try{He(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function Tf(e,t){sn(e,t,n=>{He(n,"play")})}function ys(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??an(n,"duration",0))||0);r>0&&Math.max(0,an(n,"time",0))>=r&&(He(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),He(n,"play"),sn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),He(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;He(n,"pause"),sn(e.getTimelineRegistry?.(),n,i=>{He(i,"pause")});let r=Math.max(0,an(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=wf(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),He(i,"play"),sn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),He(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(Tf(e.getTimelineRegistry?.(),i),bs(i,n,o,r)):Nt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>an(e.getTimeline(),"time",0),getDuration:()=>an(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Ss(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var Rf=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Ti(e){return e.id||e.getAttribute("data-hf-id")||null}function wi(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Lf(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function Ff(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=wi(e.getAttribute("data-playback-start"))??wi(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function Nf(e,t,n,r){let i=wi(e.getAttribute("data-duration"));return i!=null&&i>0?i:Lf(e,t)??Ff(e)??Math.max(0,n-r)}function Mf(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function vs(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||Rf.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Nf(l,n,r,s)<=0)continue;let u={id:Ti(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Mf(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ri="css:root",Es=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],kf=new Set([...Es,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Df=new Set(["absolute","relative"]),If=new Set(["flex","inline-flex","grid","inline-grid"]),Pf=new Set(["layout","paint","strict","content"]),Of=new Set(["size","inline-size"]);function Gf(e){return e.position==="fixed"||e.position==="sticky"}function Hf(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Df.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&If.has(n)}function Bf(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:Es.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function Uf(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>Pf.has(n))?!0:Of.has(e.getPropertyValue("container-type"))}function Wf(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>kf.has(t))}function Vf(e,t){return Gf(t)||Hf(e,t)||Bf(t)||Uf(t)?!0:Wf(t)}function zf(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function er(e){let t=e.ownerDocument.defaultView;if(!t)return Ri;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Vf(n,t.getComputedStyle(n)))return zf(n)}catch{return Ri}n=n.parentElement}return Ri}var Mt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),cb=Object.freeze([Mt.start,Mt.duration,Mt.trackIndex]),db=Object.freeze([Mt.derivedEnd]),fb=Object.freeze([Mt.derivedEnd,Mt.legacyTrack]);function Me(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var _s=/^[A-Za-z0-9_.:-]+$/;function As(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Cs(e,t){let n=t;for(;n>=0&&As(e,n);)n--;return n}function $f(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function qf(e){let t=e.length-1;if(!As(e,t))return null;let n=Cs(e,t);return e[n]==="."&&(n=Cs(e,n-1)),n+1}function jf(e){let t=qf(e);if(t==null)return null;let n=$f(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!_s.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Li(e){let t=(e??"").trim();if(!t)return null;let n=Me(t);if(n!=null)return{kind:"absolute",value:n};if(_s.test(t))return{kind:"reference",refId:t,offset:0};let r=jf(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var Kf="data-hf-authored-duration",Yf="data-hf-authored-end";function Xf(e){return Me(e.getAttribute("data-duration"))}function Jf(e){return Me(e.getAttribute("data-end"))}function Qf(e){return Me(e.getAttribute(Kf))}function Zf(e){return Me(e.getAttribute(Yf))}function it(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let x=r.getElementById(f);return x||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let x=f.ownerDocument.defaultView?.HTMLMediaElement;return x?f instanceof x:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let x=o.get(f);if(x!==void 0)return x;let y=null,E=Xf(f)??(n?Qf(f):null);if(E!=null&&E>0&&(y=E),y==null||y<=0){let S=Jf(f)??(n?Zf(f):null);if(S!=null){let w=m(f,0),T=S-w;Number.isFinite(T)&&T>0&&(y=T)}}if((y==null||y<=0)&&s(f)){let S=Me(f.getAttribute("data-playback-start"))??Me(f.getAttribute("data-media-start"))??0;Number.isFinite(f.duration)&&f.duration>S&&(y=(f.duration-S)/qe(f))}if(y==null||y<=0){let S=f.getAttribute("data-composition-id");if(S){let w=t[S]??null;if(w&&typeof w.duration=="function")try{let T=Number(w.duration());Number.isFinite(T)&&T>0&&(y=T)}catch(T){L("runtime.startResolver.site1",T)}}}return y!=null&&Number.isFinite(y)&&y>0?(o.set(f,y),y):(o.set(f,null),null)},c=(f,x)=>{if(f.hasAttribute("data-composition-id")){let E=f.parentElement?.closest("[data-composition-id]");return E?m(E,x):0}let y=f.closest("[data-composition-id]");return y?m(y,x):0},m=(f,x)=>{let y=i.get(f);if(y!==void 0)return y??x;if(a.has(f))return x;a.add(f);try{let E=Li(f.getAttribute("data-start"));if(!E){if(f.hasAttribute("data-composition-id")){let D=f.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id")||D.hasAttribute("data-composition-file"))){let P=m(D,x);return i.set(f,P),P}}return i.set(f,x),x}if(E.kind==="absolute"){let D=Math.max(0,E.value),P=Math.max(0,c(f,x)+D);return i.set(f,P),P}let S=l(E.refId);if(!S)return i.set(f,x),x;let w=m(S,0),T=u(S);if(T==null||T<=0){let D=Math.max(0,w+E.offset);return i.set(f,D),D}let M=Math.max(0,w+T+E.offset);return i.set(f,M),M}finally{a.delete(f)}};return{resolveStartForElement:(f,x=0)=>m(f,Math.max(0,x)),resolveDurationForElement:f=>u(f)}}function Fi(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var tm="data-hf-authored-duration",nm="data-hf-authored-end";function Te(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Ni(e){return Te(e.getAttribute("data-duration"))??Te(e.getAttribute(tm))}function ws(e){return Te(e.getAttribute("data-end"))??Te(e.getAttribute(nm))}function Mi(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function ki(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Di(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function un(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function Ts(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return un(t);let n=e.getAttribute("data-composition-src");if(n)return un(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?un(r.getAttribute("src")):null}function rm(e){let t=e.className;return typeof t!="string"?null:t.split(/\\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function im(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function om(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ln(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function am(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return ln(i);let o=e.id;if(o)return ln(o);let a=rm(e);if(a)return ln(a);let l=im(Ts(e));if(l)return ln(l);let s=om(e);return s||`${ln(t)} ${n+1}`}function Rs(e){let n=window.__timelines??{},r=it({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=B=>{if(!B)return null;let k=n[B]??null;if(!k||typeof k.duration!="function")return null;try{let I=Number(k.duration());return Number.isFinite(I)&&I>0?I:null}catch{return null}},o=B=>{let k=Te(B.getAttribute("data-duration"));if(k!=null&&k>0)return k;let I=Te(B.getAttribute("data-playback-start"))??Te(B.getAttribute("data-media-start"))??0;return Number.isFinite(B.duration)&&B.duration>I?Math.max(0,(B.duration-I)/qe(B)):null},a=()=>{let B=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(B.length===0)return null;let k=0;for(let I of B){let ue=I.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(I,0):Math.max(0,Number(I.getAttribute("data-start")??0)||0);if(!Number.isFinite(ue))continue;let ae=o(I);ae==null||ae<=0||(k=Math.max(k,Math.max(0,ue)+ae))}return k>0?k:null},l=(B,k)=>{let I=[],ue=null,ae=null,$=null,q=B.parentElement;for(;q;){let j=q.getAttribute("data-composition-id");j&&(I.push(j),!$&&q!==k&&($=j),ue==null&&(ue=r.resolveStartForElement(q,0)),ae==null&&(ae=Te(q.getAttribute("data-duration"))??i(j)??null)),q=q.parentElement}return{parentCompositionId:$,compositionAncestors:I.reverse(),inheritedStart:ue,inheritedDuration:ae}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,y=i(c),E=Ni(s??document.body),S=ki(...u.filter(B=>B!==s).map(B=>{let k=r.resolveStartForElement(B,0),I=r.resolveDurationForElement(B)??i(B.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||I==null||I<=0?null:Math.max(0,k)+I})),w=S!=null?Math.max(0,S-Math.max(0,m)):null,T=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,M=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,D=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,P=typeof w=="number"&&Number.isFinite(w)&&w>0?w:null,_=ki(D,P),b=T!=null&&_!=null&&T>_+1,A=M??(b?_:ki(T,D,P))??null,N=(A!=null?m+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),G=(B,k)=>!Number.isFinite(k)||k<=0?0:N==null||!Number.isFinite(N)?k:!Number.isFinite(B)||B>=N?0:Math.max(0,Math.min(k,N-B)),U=[],ne=[],H=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),J=0;for(let[B,k]of H.entries()){if(k===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let I=l(k,s),ue=r.resolveStartForElement(k,I.inheritedStart??0),ae=k.getAttribute("data-composition-id"),$=Ni(k);if(($==null||$<=0)&&ae&&ae!==c&&($=i(ae)),($==null||$<=0)&&k instanceof HTMLMediaElement){let me=Te(k.getAttribute("data-playback-start"))??Te(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&($=Math.max(0,k.duration-me))}if($==null||$<=0){let me=I.inheritedDuration;if(me!=null&&me>0){let Ie=(I.inheritedStart??0)+me;$=Math.max(0,Ie-ue)}}if($==null||$<=0||($=G(ue,$),$<=0))continue;let q=ue+$;J=Math.max(J,q);let j=k.tagName.toLowerCase(),We=ae&&ae!==c?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";U.push({id:Ti(k)??ae??null,label:am(k,We,U.length),start:ue,duration:$,track:Di(k,B),zIndex:Mi(k),stackingContextId:er(k),kind:We,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:I.compositionAncestors,parentCompositionId:I.parentCompositionId,nodePath:null,compositionSrc:un(k.getAttribute("data-composition-src")),playbackStart:Tt(k),playbackRate:qe(k),assetUrl:Ts(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Te(k.getAttribute("data-timeline-priority"))})}let _e=new Set(U.map(B=>B.id)),z=s?.getAttribute("data-composition-id")??null,Y=z?n[z]??null:null;if(Y&&s){let B=Y;if(typeof B.getChildren=="function")try{let k=B.getChildren(!0,!0,!1)??[],I=new Map;for(let $ of s.children){let q=$;if(!q.id)continue;let j=q.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||I.set(q,{id:q.id,start:1/0,end:-1/0})}let ue=$=>{let q=$;for(;q;){if(I.has(q))return q;if(q===s)return null;q=q.parentElement}return null};for(let $ of k){if(typeof $.targets!="function"||typeof $.startTime!="function"||typeof $.duration!="function")continue;let q=$.startTime(),j=$.parent;for(;j&&j!==Y&&typeof j.startTime=="function";)q+=j.startTime(),j=j.parent;let We=q+$.duration();if(!(!Number.isFinite(q)||!Number.isFinite(We)))for(let me of $.targets()){if(!(me instanceof Element))continue;let Ct=ue(me);if(!Ct)continue;let Ie=I.get(Ct);Ie&&(Ie.start=Math.min(Ie.start,q),Ie.end=Math.max(Ie.end,We))}}let ae=U.length>0?Math.max(...U.map($=>$.track))+1:0;for(let[$,q]of I){if(q.start===1/0||q.end===-1/0)continue;let j=$;if(_e.has(j.id))continue;let We=Math.max(0,q.end-q.start);if(We<=0)continue;let me=G(q.start,We);me<=0||(J=Math.max(J,q.start+me),U.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:q.start,duration:me,track:Di(j,ae),zIndex:Mi(j),stackingContextId:er(j),kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:Tt(j),playbackRate:qe(j),assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:Te(j.getAttribute("data-timeline-priority"))}),_e.add(j.id))}}catch(k){L("runtime.timeline.site1",k)}}if(s&&A!=null&&A>0){let B=U.length>0?Math.max(...U.map(k=>k.track))+1:0;for(let k of s.children){let I=k;if(!I.id||_e.has(I.id))continue;let ue=I.getAttribute("data-timeline-role");if(ue!=="overlay"&&ue!=="persistent-overlay")continue;let ae=I.tagName.toLowerCase();if(ae==="script"||ae==="style"||ae==="link"||ae==="meta"||window.getComputedStyle(I).display==="none")continue;let q=G(0,A);q<=0||(J=Math.max(J,q),U.push({id:I.id,label:I.getAttribute("data-timeline-label")??I.getAttribute("data-label")??I.getAttribute("aria-label")??I.id,start:0,duration:q,track:Di(I,B),zIndex:Mi(I),stackingContextId:er(I),kind:"element",tagName:ae,compositionId:I.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:Tt(I),playbackRate:qe(I),assetUrl:null,timelineRole:ue,timelineLabel:I.getAttribute("data-timeline-label"),timelineGroup:I.getAttribute("data-timeline-group"),timelinePriority:Te(I.getAttribute("data-timeline-priority"))}),_e.add(I.id))}}for(let B of u){if(B===s)continue;let k=B.getAttribute("data-composition-id");if(!k||!Fi(k))continue;let I=r.resolveStartForElement(B,0),ue=Ni(B);if((ue==null||ue<=0)&&ws(B)!=null){let j=ws(B);ue=Math.max(0,j-I)}let ae=i(k),$=ue&&ue>0?ue:ae;if($==null||$<=0)continue;let q=G(I,$);q<=0||ne.push({id:k,label:B.getAttribute("data-label")??k,start:I,duration:q,thumbnailUrl:un(B.getAttribute("data-thumbnail-url")),avatarName:null})}let V=Math.max(1,J||1,A??0),ee=b&&M==null,Ae=ee?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{...Wn(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:ee?Number.POSITIVE_INFINITY:V,durationInFrames:Ae,clips:U,scenes:ne,compositionWidth:Te(s?.getAttribute("data-width"))??1920,compositionHeight:Te(s?.getAttribute("data-height"))??1080}}var de=md(Zl(),1),eu=de.default,wy=de.default.stringify,Ty=de.default.fromJSON,Ry=de.default.plugin,Ly=de.default.parse,Fy=de.default.list,Ny=de.default.document,My=de.default.comment,ky=de.default.atRule,Dy=de.default.rule,Iy=de.default.decl,Py=de.default.root,Oy=de.default.CssSyntaxError,Gy=de.default.Declaration,Hy=de.default.Container,By=de.default.Processor,Uy=de.default.Document,Wy=de.default.Comment,Vy=de.default.Warning,zy=de.default.AtRule,$y=de.default.Result,qy=de.default.Input,jy=de.default.Rule,Ky=de.default.Root,Yy=de.default.Node;var ao="data-hf-authored-id",tu="data-hf-inner-root";function so(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function lo(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Rp(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ru(e){let t=e.trim();return t?Array.from(new Set([t,Rp(t)])).filter(Boolean):[]}function Lp(e){return!!e&&/[\\w-]/.test(e)}function Fp(e,t,n){let r=ru(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\\\"&&(a=null);continue}if(s===\'"\'||s==="\'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!Lp(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function Np(e,t){let n=t?.trim();return n?Fp(e,n,`[${ao}="${lo(n)}"]`):e}function nu(e){return`${e}:not(:has([${tu}])), ${e} > [${tu}]`}function Mp(e,t,n,r,i,o){let a=Np(e,r),l=kp(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?nu(t):e;let u=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${so(n)}\\\\1\\\\s*\\\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?nu(t):l.replace(u,t);let c=l.match(/^\\s*/)?.[0]??"",m=l.match(/\\s*$/)?.[0]??"";if(i){let f=r?`[${ao}="${lo(r)}"]`:null;if(f&&s.startsWith(f)){let x=s.slice(f.length);return`${c}${t}${f}${x}${m}`}}return`${c}${t} ${s}${m}`}function kp(e,t,n){let r=so(n),i=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${r}"|\'${r}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var Dp=new Set(["keyframes","-webkit-keyframes","font-face"]);function Ip(e){return e?.type==="atrule"}function Pp(e){let t=e.parent;for(;t;){if(Ip(t)&&Dp.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function Op(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function iu(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${lo(o)}"]`,l=eu.parse(e);return l.walkRules(s=>{Pp(s)||Op(s)||(s.selectors=s.selectors.map(u=>Mp(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function ou(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=JSON.stringify(t),l=JSON.stringify(i),s=JSON.stringify(n),u=so(t),c=JSON.stringify(o?.trim()||null),m=JSON.stringify(r??null),f=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),x=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),y=JSON.stringify(ru(o?.trim()||""));return`(function(){\n var __hfCompId = ${a};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${s};\n var __hfAuthoredRootId = ${c};\n var __hfAuthoredRootAttr = ${JSON.stringify(ao)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${m} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${f};\n var __hfTimingSelectorPattern = ${x};\n var __hfAuthoredRootIdForms = ${y};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfIsSelectorNameChar = function(char) {\n return !!char && /[\\\\w-]/.test(char);\n };\n var __hfReplaceAuthoredRootIdSelectors = function(selector) {\n if (!__hfAuthoredRootSelector || !__hfAuthoredRootIdForms.length || typeof selector !== "string") {\n return selector;\n }\n var result = "";\n var bracketDepth = 0;\n var quote = null;\n for (var index = 0; index < selector.length; index += 1) {\n var char = selector[index];\n var previousChar = index > 0 ? selector[index - 1] : "";\n if (quote) {\n result += char;\n if (char === quote && previousChar !== "\\\\\\\\") {\n quote = null;\n }\n continue;\n }\n if (char === \'"\' || char === "\'") {\n quote = char;\n result += char;\n continue;\n }\n if (char === "[") {\n bracketDepth += 1;\n result += char;\n continue;\n }\n if (char === "]") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n result += char;\n continue;\n }\n if (char === "#" && bracketDepth === 0) {\n var matchedForm = null;\n for (var formIndex = 0; formIndex < __hfAuthoredRootIdForms.length; formIndex += 1) {\n var form = __hfAuthoredRootIdForms[formIndex];\n if (selector.slice(index + 1, index + 1 + form.length) === form) {\n matchedForm = form;\n break;\n }\n }\n if (matchedForm) {\n var nextChar = selector[index + 1 + matchedForm.length];\n if (!__hfIsSelectorNameChar(nextChar)) {\n result += __hfAuthoredRootSelector;\n index += matchedForm.length;\n continue;\n }\n }\n }\n result += char;\n }\n return result;\n };\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfAuthoredRootSelector) {\n normalized = __hfReplaceAuthoredRootIdSelectors(normalized);\n }\n return normalized;\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var authoredValue = Reflect.get(target, prop, target);\n return authoredValue === undefined\n ? Reflect.get(target, __hfTimelineCompId, target)\n : authoredValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities\n // instead of replacing one with the other.\n var authoredSet = Reflect.set(target, __hfCompId, value, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n return authoredSet && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})();`}var Gp=["data-composition-id","data-composition-file","data-start","data-duration","data-end","data-track-index","data-track","data-composition-src","data-hf-authored-duration","data-hf-authored-end"];function au(e){let t=e.getAttribute("id")?.trim();for(let n of Gp)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Hp=8e3,Bp=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,Up=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,Wp=["src","href"];function Vp(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function lu(e,t){if(!t)return e;let n=e.trim();if(Vp(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function uu(e,t){return!t||!e?e:e.replace(Up,(n,r,i)=>{let o=lu(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function zp(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Wp){let i=n.getAttribute(r);if(i==null)continue;let o=lu(i,t);o!==i&&n.setAttribute(r,o)}}function $p(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=uu(r,t);i!==r&&n.setAttribute("style",i)}}function qp(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=uu(r,t);i!==r&&(n.textContent=i)}}function cu(e,t){if(t){zp(e,t),$p(e,t),qp(e,t);for(let n of Array.from(e.querySelectorAll("template")))cu(n.content,t)}}function jp(e,t){return`${e}__hf${t}`}var Kp=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),Hp)});function co(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Yp(e){let t=document.importNode(e,!0);au(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function su(e,t){let n=e.trim();if(!n)return e;try{return Bp.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function uo(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function gr(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function Xp(e){let t=new Map;for(let n of e){let r=gr(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function du(e){let t=gr(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function Jp(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function Qp(e){return e.hasAttribute("data-composition-src")?!0:du(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:Jp(e):!1}function mo(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:du(t))}function fu(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(mo().map(n=>gr(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function mu(e,t=Xp(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=gr(i),l=Qp(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let c=s?(n.get(o)||0)+1:0;s&&n.set(o,c),u=s?jp(o,c):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function fo(e){let t=null;e.authoredCompositionId&&(t=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x instanceof HTMLElement&&x.getAttribute("data-composition-id")===e.authoredCompositionId)??null);let n=t??e.sourceNode,r=t?.getAttribute("data-composition-id")?.trim()||e.authoredCompositionId||null,i=e.runtimeCompositionId||r||null,o=t?.getAttribute("id")?.trim()||null,a=i?`[data-composition-id="${CSS.escape(i)}"]`:void 0;if(e.headLinks)for(let f of e.headLinks){let x=(f.getAttribute("href")||"").trim();if(!x)continue;let y=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&uo(y,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(y)}"]`))continue;let E=f.cloneNode(!0);E.href=y,document.head.appendChild(E),e.injectedLinks.push(E)}let l=f=>{for(let x of f){let y=x.cloneNode(!0);y instanceof HTMLStyleElement&&(r&&(y.textContent=iu(y.textContent||"",r,a,o,{scopeRootSelectors:!0})),document.head.appendChild(y),e.injectedStyles.push(y))}};e.headStyles&&l(e.headStyles),l(Array.from(n.querySelectorAll("style")));let s=[];if(e.headScripts)for(let f of e.headScripts){let x=f.getAttribute("type")?.trim()??"",y=f.getAttribute("src")?.trim()??"";if(y){let E=su(y,e.compositionUrl);if(e.compositionUrl&&uo(E,e.compositionUrl))continue;s.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&s.push({kind:"inline",content:E,type:x,scopeCompositionId:r})}}let u=Array.from(n.querySelectorAll("script")),c=[...s];for(let f of u){let x=f.getAttribute("type")?.trim()??"",y=f.getAttribute("src")?.trim()??"";if(y){let E=su(y,e.compositionUrl);if(e.compositionUrl&&uo(E,e.compositionUrl)){f.parentNode?.removeChild(f);continue}c.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&c.push({kind:"inline",content:E,type:x,scopeCompositionId:r})}f.parentNode?.removeChild(f)}let m=Array.from(n.querySelectorAll("style"));for(let f of m)f.parentNode?.removeChild(f);if(t){let f=t.getAttribute("data-width"),x=t.getAttribute("data-height"),y=e.parseDimensionPx(f),E=e.parseDimensionPx(x);f&&e.host.setAttribute("data-width",f),x&&e.host.setAttribute("data-height",x),y&&e.host instanceof HTMLElement&&(e.host.style.width=y),E&&e.host instanceof HTMLElement&&(e.host.style.height=E),t.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked",""),e.host.appendChild(Yp(t))}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;i&&Zp(e,n,i);for(let f of c){let x=document.createElement("script");if(f.type&&(x.type=f.type),x.async=!1,f.kind==="external"?x.src=f.src:f.type.toLowerCase()==="module"?x.textContent=f.content:f.scopeCompositionId?x.textContent=ou(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",a,i||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),f.kind==="external"){let y=await Kp(x);y.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:y.status,elapsedMs:y.elapsedMs}})}}}async function pu(e){let t=mo();if(fu(),t.length===0)return;let n=mu(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);co(i),await fo({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function hu(e){let t=mo();if(fu(),t.length===0)return;let n=mu(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}co(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await fo({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),y=new DOMParser().parseFromString(f,"text/html");cu(y,u);let E=(l?y.querySelector(`template#${CSS.escape(l)}-template`):null)??y.querySelector("template"),S=E?E.content:y.body,w=E?void 0:Array.from(y.head.querySelectorAll("style")),T=E?void 0:Array.from(y.head.querySelectorAll("script")),M=Array.from(y.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await fo({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:S,hasTemplate:!!E,fallbackBodyInnerHtml:y.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,headStyles:w,headScripts:T,headLinks:M,declaredVariableDefaults:Jt(y.documentElement),onDiagnostic:e.onDiagnostic})}catch(c){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:c instanceof Error?c.message:"unknown_error"}}),co(i)}}))}function Zp(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?Jt(t):{}),...ma(e.host)};da(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,Qr(e.host,{...ca(e.host,i,window),...zn()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function e0(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function t0(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!(r instanceof HTMLElement))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function n0(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}function po(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=t0();for(let r of t){let i=null;if(r.wordId&&(i=e0(document.getElementById(r.wordId))),!i&&r.wordIndex!==void 0&&(i=n[r.wordIndex]??null),!i)continue;let o={},a={};if(r.x!==void 0&&(o.x=r.x),r.y!==void 0&&(o.y=r.y),r.scale!==void 0&&(o.scale=r.scale),r.rotation!==void 0&&(o.rotation=r.rotation),r.opacity!==void 0&&(a.opacity=r.opacity),r.fontSize!==void 0&&(a.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(a.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(a.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let s=e.getTweensOf(i).filter(c=>c.vars.color!==void 0).sort((c,m)=>c.startTime()-m.startTime()),u=s[0]?String(s[0].vars.color):"";for(let c of s)String(c.vars.color)===u?r.dimColor&&(c.vars.color=r.dimColor):r.activeColor&&(c.vars.color=r.activeColor);r.dimColor&&e.set(i,{color:r.dimColor})}if(Object.keys(a).length>0&&e.set(i,a),Object.keys(o).length>0){let l=n0(i);e.set(l,o)}}}).catch(()=>{})}var go="data-hf-edit-base-x",xo="data-hf-edit-base-y",Gt="data-hf-edit-original-translate",xr=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},r0=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},gu=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,ho=(e,t)=>gu.test(e)&&gu.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,i0=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=r0(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${ho(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${ho(r,t)} ${ho(i,n)}${a}`},o0=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},a0=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},bo=new WeakMap;function s0(e,t){let n=bo.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ne("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=xr(e.getAttribute("data-x"))-xr(e.getAttribute(go)),i=xr(e.getAttribute("data-y"))-xr(e.getAttribute(xo));e.hasAttribute(Gt)||e.setAttribute(Gt,a0(e)),n===void 0&&o0(e);let o=e.getAttribute(Gt)??"",a=i0(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),bo.set(e,e.style.getPropertyValue("translate"))}function br(e,t){let n=e.defaultView?.HTMLElement,r=e.defaultView?.SVGElement,i=s=>n||r?n!==void 0&&s instanceof n||r!==void 0&&s instanceof r:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${Gt}]:not([${go}]):not([${xo}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(Gt)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(Gt),bo.delete(u)}let a=e.querySelectorAll(`[${go}], [${xo}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(s0(u,t),l+=1)}return l}var xu="__hfPositionEditsSeekReapplyWrapped",bu=new WeakSet,yu=new WeakMap,Su=new WeakMap;function vu(e){let t=e,n=()=>{try{br(t.document)}catch{}},r=m=>typeof m=="function"&&(bu.has(m)||!!m[xu]),i=m=>{bu.add(m);try{Object.defineProperty(m,xu,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||r(m))return m;let f=function(...x){let y=m.apply(this,x);return n(),y};return i(f),f},a=(m,f)=>{let x=yu.get(m);if(x?.has(f))return!0;let y=Object.getOwnPropertyDescriptor(m,f);if(y?.configurable===!1){let w=m[f];return typeof w=="function"&&(m[f]=o(w),n()),!1}let E=m[f],S=y?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:y?.enumerable??!0,get:()=>E,set:w=>{E=o(w),S?.call(m,w)}}),E=o(E),x??(x=new Set),x.add(f),yu.set(m,x),n(),!0},l=(m,f)=>{let x=Su.get(t),y=Object.getOwnPropertyDescriptor(t,m);if(!x?.has(m)){if(y?.configurable===!1){let w=t[m];return w?a(w,f):!1}let S=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:y?.enumerable??!0,get:()=>S,set:w=>{S=w,S&&a(S,f)}}),x??(x=new Set),x.add(m),Su.set(t,x)}let E=t[m];return E?a(E,f):!1},s=()=>{let m=l("__hf","seek"),f=l("__player","renderSeek");return m&&f};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function yr(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function Sr(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Eu=new Set(["img","video","audio","source"]);function l0(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function u0(e){let t=e.replace(/[\\u0000-\\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\\//i.test(t):!1:!1}function c0(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function d0(e){if(Sr(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function yo(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=yr(e);return t.set(n,i),i}function f0(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function m0(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function p0(e,t){let n=new Set,r=m0(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=yo(i,t);for(let[a,l]of Object.entries(o)){let s=d0(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,c0(s))}}}function So(e){let t=new Map;p0(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!Eu.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(Eu).join("/")}.`);continue}let i=l0(yo(n,t)[r]);if(i!==null){if(!u0(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=yo(n,t)[r];Sr(i)&&f0(n,String(i))}}var Qe=new Map,h0="data-hf-color-grading-canvas",g0="__hf_color_grading_canvas__";function ku(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute(Jn)||r.setAttribute(Jn,r.style.opacity))},n=r=>{if(r instanceof Element){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var x0=16,b0=4,Bt={enabled:!1,position:.5,softness:0,lineWidth:2},vo=["#000000","#ffffff"],y0=["#1a1a1a","#f5f5dc"],kn=3,S0=kn-1,v0=5,Eo=`${je}.0`,Cu=`${je-1}.0`,E0=`${kn}.0`,C0=`${(S0+.5)/kn}`;function vr(e){let t=e.getAttribute(rn);return t==null?null:ps(t,yr(e))}var _0=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`\n`),A0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }"," return base;","}","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${Cu};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Cu});`,` float y = (row + 0.5) / ${E0};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Eo}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Eo}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Eo}, ${C0}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`\n`),w0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`\n`),T0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`\n`),R0=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`\n`);function St(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function _u(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Au(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(L("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function wr(e,t=A0){let n=Au(e,_0,e.VERTEX_SHADER),r=Au(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(L("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function Er(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function L0(e,t){let n=wr(e,w0);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function F0(e,t){let n=wr(e,T0);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function N0(e,t){let n=wr(e,R0);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function Fn(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Er(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function _r(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Co(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function wu(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function To(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=wr(t),r=Er(t),i=Er(t,t.NEAREST),o=Er(t,t.NEAREST);if(!n||!r||!i||!o)return wu(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Co(t,n,Qn),detailUniforms:Co(t,n,yi),effectUniforms:Co(t,n,Si),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(wu(t,n,[r,i,o]),null)}function M0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function k0(e){if(!M0(e))return{...Bt};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,Bt.position,0,1),softness:t(e.softness,Bt.softness,0,.25),lineWidth:t(e.lineWidth,Bt.lineWidth,0,12)}}function Du(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function Tr(e){return e instanceof Error?e.message:"LUT failed to load"}function D0(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Iu(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return D0(t)}function Ro(e){let t=Du(e);if("error"in t)return{state:"error",message:t.error};let n=Qe.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>$a(o,{maxSize:Kn})),i={state:"pending",promise:r};for(;Qe.size>=x0;){let o=Qe.keys().next().value;if(!o)break;Qe.delete(o)}return Qe.set(t.href,i),r.then(o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"ready",lut:o})},o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"error",message:Tr(o)})}),i}function Tu(e,t,n){if(e.lut?.src===t)return e.lut;let r=ci(n),{gl:i,program:o}=e;try{return Pu(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Tr(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function I0(e){let t=Ro(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Pu(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function P0(e,t,n){let r=ci(n),{gl:i,program:o}=e;return Pu(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Xe(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Lo(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Xe(e.gl,t.scratch),Xe(e.gl,t.blur),t.bloom&&Xe(e.gl,t.bloom),e.effectTargets=null)}function Fo(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Xe(e.gl,t.moments),Xe(e.gl,t.output),e.kuwaharaTargets=null)}function Cr(e,t=!1){Lo(e),Fo(e),O0(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function O0(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function G0(e){let t=To(e.canvas);return t?(Cr(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function wo(e){if(!e.sourceHidden)return;e.element.removeAttribute(on);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function H0(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=L0(t,e.program.quad),r=Fn(t),i=Fn(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Xe(t,r),i&&Xe(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function B0(e,t){return t.bloom||(t.bloom=Fn(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Ru(e){let t=e.effectTargets;t?.bloom&&(Xe(e.gl,t.bloom),t.bloom=null)}function U0(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=F0(t,e.program.quad),o=N0(t,e.program.quad),a=Fn(t,n.HALF_FLOAT_OES,t.NEAREST),l=Fn(t);return!i||!o||!a||!l?(W0(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function W0(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Xe(e,r),i&&Xe(e,i)}function Ou(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return _r(e,t,o,a),_r(e,n,o,a),{width:o,height:a}}function Ar(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),Nn(e,t)}function V0(e,t,n,r,i,o,a){let l=Ou(e,t.scratch,r,i/2,o/2),s=a/2;Ar(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),Ar(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function z0(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)Ar(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),Ar(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function Nn(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function $0(e,t,n,r,i,o,a,l){_r(e,t.moments,i.width,i.height),_r(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),Nn(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),Nn(e,u)}function q0(e,t,n,r){if(n<=0)return!1;let i=Ou(e.gl,t.scratch,t.blur,r.width,r.height);return z0(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function j0(e,t,n,r,i,o){if(n<=0)return Ru(e),null;o||Ru(e);let a=o?B0(e,t):t.blur;return a?(V0(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function K0(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Lo(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=H0(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=q0(e,l,o,n),u=j0(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function Y0(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Fo(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=U0(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:($0(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Gu(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=K0(e,t,n,o),l=Y0(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function X0(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=Du(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Ro(t);return i.state==="ready"?Tu(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(Tu(e,r.href,o),ke(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Tr(o),e.lutLoadingSrc=null,ke(e))})),null)}function Rn(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&St(n))return n;try{let r=document.querySelector(t);return r&&St(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&St(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&St(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&St(r)?r:null}catch{return null}}function Hu(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Bu(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Uu(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&Bu(t)?t:null}function Lu(e){if(!(e instanceof HTMLVideoElement))return!1;let t=Uu(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function J0(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function Q0(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Wu(e){if(e instanceof HTMLVideoElement){let t=Uu(e);if(t)return t}return Bu(e)?e:null}function Fu(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function Z0(e){let t=e.trim().split(/\\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Fu(o,"x"),l=Fu(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function Vu(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Z0(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function eh(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Nu(e,t){return Math.max(0,Math.round(e>0?e:t))}function th(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&eh(e,i);let o=window.getComputedStyle(t);xs(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Nu(n.offsetWidth,a.width),s=Nu(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function Ht(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function vt(e,t,n,r){e.set(r,(t*je+n)*4)}function ut(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function _o(e,t,n){return e.length>=3?fi(e,t,n):new Float32Array(je)}function yt(e,t){return e[t]??0}function nh(e,t,n){let r=Rt(t.red),i=Rt(t.green),o=Rt(t.blue),a=Rt(t.master),l=_o(n.hueVsHue,-180,180),s=_o(n.hueVsSaturation,-1,1),u=_o(n.hueVsLuma,-1,1);for(let c=0;c<je;c+=1)vt(e,0,c,[yt(r,c),yt(i,c),yt(o,c),yt(a,c)]),vt(e,1,c,[ut(yt(l,c),180),ut(yt(s,c),1),ut(yt(u,c),1),1])}function rh(e,t,n){let r=n*v0;vt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),vt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),vt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),vt(e,2,r+3,[ut(t.correction.hueShift,180),ut(t.correction.saturation,1),ut(t.correction.luma,1),ut(t.correction.temperature,1)]),vt(e,2,r+4,[ut(t.correction.tint,1),.5,.5,1])}function ih(e,t,n){let r=new Float32Array(je*kn*4);nh(r,e,t);let i=0;for(let o of n)o.enabled&&(rh(r,o,i),i+=1);return r}var Mu=new WeakMap;function oh(e,t,n){let r=Mu.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Mu.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function ah(e,t,n,r){let{curves:i,hueCurves:o}=n,a=oh(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(ih(i,o,r),tn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,je,kn,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Ao(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function zu(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:x,secondaries:y}=n,E=Ci(f),S=_i(x),w=Ai(y)?y.reduce((D,P)=>D+Number(P.enabled),0):0;(E||S||w>0)&&ah(e,t,n,y),Ao(e,t.shadowWheel,n.wheels.shadows),Ao(e,t.midtoneWheel,n.wheels.midtones),Ao(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,E?1:0),e.uniform1f(t.hueCurvesEnabled,S?1:0),e.uniform1f(t.secondaryCount,w);for(let[D,P]of t.adjustUniforms)e.uniform1f(P,n.adjust[D]);for(let[D,P]of t.detailUniforms)e.uniform1f(P,n.details[D]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[D,P]of t.effectUniforms)e.uniform1f(P,n.effects[D]);let T=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?y0:vo),M=T[T.length-1]??vo[1];e.uniform1f(t.paletteSize,T.length),Ht(e,t.palette0,T[0]??vo[0]),Ht(e,t.palette1,T[1]??M),Ht(e,t.palette2,T[2]??M),Ht(e,t.palette3,T[3]??M),Ht(e,t.palette4,T[4]??M),Ht(e,t.palette5,T[5]??M),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function sh(e){if(!e.sourceHidden){let t=e.element.getAttribute(Jn);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(on,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function Ze(e){let t=ds.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var $u=Ze("intensity"),qu=Ze("lut.intensity"),ju=Ze("adjust.exposure"),Ku=Ze("effects.kuwahara"),Yu=[["blur",Ze("effects.blur")],["bloom",Ze("effects.bloom")],["kuwahara",Ku],["pixelate",Ze("effects.pixelate")],["ascii",Ze("effects.ascii")],["dither",Ze("effects.dither")]],Xu=[$u,qu,ju,...Yu.map(([,e])=>e)];function Et(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Ln(e,t){return t!==null&&(hs(t)||Xu.some(n=>Et(e,n)!==null))}function lh(e,t){let n=null;for(let[r,i]of Yu){let o=Et(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function uh(e){let{element:t,grading:n}=e,r=Et(t,$u),i=Et(t,qu),o=Et(t,ju),a=lh(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function Ju(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Qu(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function ke(e){if(e.destroyed||e.contextLost)return!1;let t=Wu(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Hu(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=J0(t);if(s&&Q0(e,t),s||!a){let y=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=y.opacity||"1",e.sourceVisibleForCanvas=(s||l!=="hidden")&&y.visibility!=="hidden"}let u=th(e,r);if(!u)return!1;let c=window.getComputedStyle(r),m=Vu(u.width,u.height,n.width,n.height,c.objectFit,c.objectPosition),{gl:f,program:x}=e;try{let y=uh(e),E=X0(e);Ju(f,x.texture,t);let S=Et(e.element,Ku)!==null,w=Gu(e,y,u,m,{preserveKuwahara:S});f.bindFramebuffer(f.FRAMEBUFFER,null),f.viewport(0,0,u.width,u.height),f.useProgram(x.program),Qu(f,x,w);let T=window.__player?.getTime?.(),M=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(M*60);return zu(f,x,y,E,w.blurReady,w.bloomReady,w.kuwaharaReady,e.compare,u,m,D,M),Nn(f,x),sh(e),e.hasDrawn=!0,e.drawError=null,!0}catch(y){return e.drawError=y instanceof Error?y.message:"Shader draw failed",L("runtime.colorGrading.drawEntry",y),!1}}function ch(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function dh(){let e=document.createElement("canvas"),t=To(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function fh(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function mh(e,t,n,r){let i=Wu(t);if(!i)return null;let o=Hu(i);if(!o)return null;let a=ch(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=Vu(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Ju(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:fh(t,r),grainSeed:Iu(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function ph(e,t,n,r,i=!1){let o=mh(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=Zn(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let x=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=P0(e,f.lut.src,await I0(f.lut.src))),x=e.lut),c.push({id:m.id,dataUrl:hh(e,f,x,a,l,s,u)})}catch(y){c.push({id:m.id,dataUrl:null,error:Tr(y)})}}return{...a,images:c}}function hh(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Gu(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Qu(s,u,c),n||(e.lut=null),zu(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,Bt,r,i,o,a),Nn(s,u),l.toDataURL("image/png")}function Ye(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function gh(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Mn(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,ke(e),!e.destroyed&&!t.paused&&!t.ended&&Mn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,ke(e),!e.destroyed&&!t.paused&&!t.ended&&Mn(e)})}function xh(e){let t=()=>{ke(e)};if(Ye(e,e.element,"load",t),Ye(e,e.element,"loadedmetadata",t),Ye(e,e.element,"loadeddata",t),Ye(e,e.element,"seeked",t),Ye(e,e.element,"timeupdate",t),Ye(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Ye(e,e.element,"play",()=>Mn(e)),Ye(e,e.element,"pause",t)),Ye(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",wo(e)}),Ye(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!G0(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",wo(e);return}e.drawError=null,ke(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),ke(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function bh(e){if(e.destroyed)return null;e.destroyed=!0,gh(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Lo(e),Fo(e),wo(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function Zu(e,t){return e.removeAttribute("style"),t.id?e.id=`${as}${t.id}`:e.removeAttribute("id"),e.className=g0,e.setAttribute(h0,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function yh(e){return Zu(document.createElement("canvas"),e)}function ec(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(_,b,v)=>{let A=e.get(_);if(A)return A.grading=b,A.source=v,ke(A),_ instanceof HTMLVideoElement&&!_.paused&&Mn(A),!0;let R=n.pop();if(R)Zu(R.canvas,_);else{let G=yh(_),U=To(G);if(!U)return G.remove(),!1;R={canvas:G,gl:U.gl,program:U.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let N={element:_,...R,grading:b,compare:{...Bt},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:v,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(_).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(_).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Iu(_),destroyed:!1};return e.set(_,N),t.add(_),xh(N),ke(N),_ instanceof HTMLVideoElement&&!_.paused&&Mn(N),!0},s=(_,b)=>{if(a)return!1;let v=Rn(_);if(!v)return!1;let A=e.get(v);if(!A){let R=vr(v);if(!Ln(v,R)||!l(v,R,"attribute"))return!1;A=e.get(v)}return A?(A.compare=k0(b),ke(A),!0):!1},u=_=>{let b=e.get(_);if(!b)return;let v=bh(b);v&&(b.contextLost||n.length>=b0?Cr(v,!0):n.push(v)),e.delete(_),t.delete(_)},c=()=>{if(a)return 0;let _=new Set;document.querySelectorAll(`video[${rn}], img[${rn}]`).forEach(v=>{if(!St(v))return;_.add(v);let A=vr(v);Ln(v,A)&&(_u(v)||Lu(v))?l(v,A,"attribute"):u(v)});for(let v of t){let A=e.get(v);A&&(!v.isConnected||A.source==="attribute"&&!_.has(v))&&u(v)}return t.size},m=()=>{if(a)return 0;let _=0;for(let b of t){let v=e.get(b);v&&ke(v)&&(_+=1)}return _},f=async()=>{let _=new Set;for(let b of t){let v=e.get(b)?.grading.lut;if(!v?.src.trim()||(v.intensity??1)<=0)continue;let A=Ro(v.src);A.state==="pending"&&_.add(A.promise)}return _.size>0&&await Promise.allSettled(_),m(),_.size},x=()=>{if(a)return 0;let _=0;for(let b of t){let v=e.get(b);!v||!Xu.some(R=>Et(b,R)!==null)||b instanceof HTMLVideoElement&&!b.paused&&!b.ended||ke(v)&&(_+=1)}return _},y=(_,b)=>{if(a)return!1;let v=Rn(_);if(!v)return!1;let A=Zn(b);return Ln(v,A)?l(v,A,"live"):(u(v),!0)},E=(_,b)=>{if(!St(_))return!1;let v=e.get(_);if(!v){if(!b)return!1;let A=vr(_);return Ln(_,A)&&l(_,A,"attribute")}return v.sourceVisibleForCanvas=b,!b&&v.source==="attribute"&&u(_),!0},S=_=>{let b=Rn(_);if(!b)return{state:"missing",message:"Media not found"};let v=e.get(b);if(v)return v.effectError?{state:"unavailable",message:v.effectError}:v.drawError?{state:"unavailable",message:v.drawError}:v.lutError?{state:"unavailable",message:`LUT error: ${v.lutError}`}:v.grading.lut&&v.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:v.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:v.lut?"Shader + LUT active":"Shader active"};let A=vr(b);return Ln(b,A)?!_u(b)&&!Lu(b)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},w=async(_,b,v)=>{let A=async()=>{if(a||b.length===0)return null;let N=Rn(_);return!N||(i??(i=dh()),!i)?null:ph(i,N,b,v?.maxDimension,v?.useMediaTime)},R=o.then(A,A);return o=R.then(()=>{},()=>{}),R},T=_=>{let b=Rn(_);if(!(b instanceof HTMLVideoElement))return null;if(!b.paused)return()=>{};let v=b.currentTime,A=b.loop,R=b.muted;return b.loop=!0,b.muted=!0,(b.ended||Number.isFinite(b.duration)&&v>=b.duration)&&(b.currentTime=0),b.play().catch(()=>{}),()=>{b.pause(),b.loop=A,b.muted=R,b.currentTime=v}},M=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let _ of t)u(_);for(let _ of n)Cr(_,!0);n.length=0,i&&(Cr(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[rn]}));let D={refresh:c,redraw:m,redrawAnimated:x,waitForActiveLuts:f,setGrading:y,setCompare:s,setSourceVisibility:E,getStatus:S,renderPreviews:w,startPreviewPlayback:T,destroy:M},P=window;return P.__hf=P.__hf||{},P.__hf.colorGrading=D,c(),D}var Rr=class{constructor(t){he(this,"_baseTime",0);he(this,"_playStartMs",null);he(this,"_rate",1);he(this,"_duration",1/0);he(this,"_nowMs");he(this,"_audioSource",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};function tc(e){return!Number.isFinite(e)||e<=0?1:e}function Sh(e,t){t||e.paused||!Un().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function vh(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,safeRate:o,clipDuration:a}=t,l=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let c=s-n;return l&&c<=0?!1:(l?e.start(0,n+r,c):e.start(0,n+r),!0)}let u=-n/o;return l?e.start(i+u,r,s):e.start(i+u,r),!0}var Lr=class{constructor(){he(this,"_ctx",null);he(this,"_bufferCache",new Map);he(this,"_failedSrcs",new Set);he(this,"_activeSources",[]);he(this,"_masterGain",null);he(this,"_rateAnchorCtx",0);he(this,"_rateAnchorComp",0);he(this,"_rate",1);he(this,"_paused",!0);he(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!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}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 c=tc(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=c;let f=this._ctx.createGain();f.gain.value=a,m.connect(f),f.connect(this._masterGain);let x=o-r,y=this._ctx.currentTime;if(this._rate=c,this._rateAnchorCtx=y,this._rateAnchorComp=o,!vh(m,{elapsed:x,mediaStart:i,scheduledAt:y,safeRate:c,clipDuration:u}))return m.disconnect(),f.disconnect(),null;let E=t.muted;t.muted=!0,Sh(t,E);let S={el:t,sourceNode:m,gainNode:f,compositionStart:r,mediaStart:i,scheduledAt:y,priorMuted:E,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(S),this._paused=!1,m.addEventListener("ended",()=>{let w=this._activeSources.indexOf(S);w!==-1&&(this._activeSources.splice(w,1),t.muted=E,this._activeSources.length===0&&(this._paused=!0))}),S}catch(c){return L("webAudioTransport.schedule",c),null}}setRate(t){let n=tc(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.sourceNode.playbackRate.value=n}catch(i){L("webAudioTransport.setRate",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>t.bounded)}stopAll(){for(let t of this._activeSources){try{t.sourceNode.stop(),t.sourceNode.disconnect(),t.gainNode.disconnect()}catch{}t.el.muted=t.priorMuted}this._activeSources=[],this._paused=!0}setVolume(t){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,t)))}setElementVolume(t,n){let r=Math.max(0,Math.min(1,n));for(let i of this._activeSources)if(i.el===t)try{i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterGain&&(this._masterGain.gain.value=t?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var nc="data-hf-studio-manual-edit-gesture";function rc(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var Eh=/^\\s*spring\\(\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*\\)\\s*$/;function ic(e){return Math.max(0,Math.min(1,e))}function oc(e){let t=Eh.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?ic(n):null}function ac(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=ic(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 Ch=/^\\s*wiggle\\(\\s*(\\d+)\\s*,\\s*(easeOut|easeInOut|anticipate|uniform)\\s*(?:,\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)\\s*)?\\)\\s*$/,_h=Math.PI*2;function Ah(e){let t=Ch.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 wh(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(_h*t*e)}function sc(e,t){let n=Ah(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=>wh(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Th=24,lc=e=>e>=1?1:0,Rh=e=>e,Fr=String.raw`([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?)`,Lh=new RegExp(String.raw`^\\s*M\\s*0\\s*,\\s*0\\s+C\\s*${Fr}\\s*,\\s*${Fr}\\s+${Fr}\\s*,\\s*${Fr}\\s+1\\s*,\\s*1\\s*$`,"i");function uc(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Fh(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<Th;l+=1){let s=(o+a)/2;uc(s,t,r)<e?o=s:a=s}return uc((o+a)/2,n,i)}function Nh(e){let t=Lh.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=>Fh(a,n,r,i,o)}function Mh(e,t){if(!e.startsWith("spring("))return null;let n=oc(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>ac(o,n);return t.set(n,i),i}function kh(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=Nh(n);return i&&t.set(n,i),i}function cc(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"?lc:sc(s,i)??Mh(s,r)??kh(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??Rh)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",lc);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var No="data-hf-authored-duration",Mo="data-hf-authored-end",dc=!1;function et(e){if(e){if(typeof e.pause!="function"){dc||(dc=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function Dh(){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 fc(){let e=Ss();sa(xe),br(document),So(document);let t=Dh();e.canonicalFps=t.fps??e.canonicalFps,oa(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,h,p)=>{s.has(d)||(s.add(d),Ne(h,p))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){L("runtime.init.site1",d)}let c=new Rr;e.transportClock=c;let m=new Lr,f=!1;m.init().then(d=>{f=d});let x=()=>{let d=window.gsap,h=window;if(!(!d?.registerPlugin||h.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(p){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",p)}},y=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{cc(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",h)}};x(),y(),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{fa(document)}catch(d){L("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let E=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(p=>!p.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,h=E()?.getAttribute("data-composition-id")??"root",p={};if(d.length===1)p[h]=d[0];else for(let g=0;g<d.length;g++)p[`tl-${g}`]=d[g];window.__timelines=p}let S=E();S&&!S.hasAttribute("data-start")&&S.setAttribute("data-start","0");let w=d=>{o.push(d)},T=(d,h,p)=>{let g=p??`${d}:${JSON.stringify(h)}`;a.has(g)||(a.add(g),xe({source:"hf-preview",type:"diagnostic",code:d,details:h}))},M=d=>{let h={scale:1,focusX:960,focusY:540},p=[],g=[],C={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>p,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>g,getRenderState:()=>({...C,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},D=1/60,P=.75,_=.05,b=100,v=240,A=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},R=d=>{let h=d.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},N=d=>{if(d==null||d.trim()==="")return null;let h=Number.parseFloat(d);return!Number.isFinite(h)||h<=0?null:`${h}px`},G=()=>E(),U=()=>{let d=G();if(!d)return;let h=N(d.getAttribute("data-width")),p=N(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p),h&&d.style.setProperty("--comp-width",h),p&&d.style.setProperty("--comp-height",p)},ne=()=>{let d=G(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(p=>p.hasAttribute("data-duration")||p.hasAttribute("data-end"));for(let p of h){if(d&&p===d)continue;let g=p.getAttribute("data-duration"),C=p.getAttribute("data-end");g!=null&&!p.hasAttribute(No)&&p.setAttribute(No,g),C!=null&&!p.hasAttribute(Mo)&&p.setAttribute(Mo,C),p.removeAttribute("data-duration"),p.removeAttribute("data-end")}},H=()=>{let d=G();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let h=N(d.getAttribute("data-width")),p=N(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p);let g=Array.from(d.children);for(let C of g){let F=C.tagName.toLowerCase();if(F==="script"||F==="style"||F==="link"||F==="meta"||!C.hasAttribute("data-start")||C.hasAttribute("data-hf-autostamped"))continue;let O=(C.style.top==="0px"||C.style.top==="0")&&(C.style.left==="0px"||C.style.left==="0")&&C.style.width==="100%"&&C.style.height==="100%",X=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(C.style.transform);if(O&&X&&!C.hasAttribute("data-width")&&!C.hasAttribute("data-height")){let ve=C.style.top,Yt=C.style.left,Ee=C.style.width,Xt=C.style.height;C.style.top="",C.style.left="",C.style.width="",C.style.height="";let re=window.getComputedStyle(C);re.top!=="auto"||re.bottom!=="auto"||re.left!=="auto"||re.right!=="auto"||re.width!=="0px"||re.height!=="0px"||(C.style.top=ve,C.style.left=Yt,C.style.width=Ee,C.style.height=Xt)}let W=window.getComputedStyle(C),se=W.position;if(se!=="absolute"&&se!=="fixed"&&(C.style.position="absolute"),!!C.style.top||!!C.style.bottom||W.top!=="auto"||W.bottom!=="auto"||(C.style.top="0"),!!C.style.left||!!C.style.right||W.left!=="auto"||W.right!=="auto"||(C.style.left="0"),F!=="audio"){let ve=N(C.getAttribute("data-width")),Yt=N(C.getAttribute("data-height")),Ee=W.width!=="0px"&&W.width!=="auto",Xt=W.height!=="0px"&&W.height!=="auto";ve?!C.style.width&&!Ee&&(C.style.width=ve):!C.style.width&&W.width==="0px"&&(C.style.width="100%"),Yt?!C.style.height&&!Xt&&(C.style.height=Yt):!C.style.height&&W.height==="0px"&&(C.style.height="100%")}}},J=(d,h=0,p)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,h),_e=(d,h)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),z=d=>{let h=d.closest("[data-composition-id]"),p=h?J(h,0):null,g=h?_e(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:p,inheritedDuration:g}},Y=d=>{let h=z(d),p=h.inheritedStart??0,g=Me(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||g==null||p<=0)return J(d,p);let C=Me(d.getAttribute("data-duration")),F=h.inheritedDuration,O=F!=null&&F>0?p+F:null,X=C!=null&&C>0?g+C:g;return(O==null?g>=p:g<O&&(X>p||g===p))?g:p+g};window.__hfResolveMediaStartSeconds=Y,o.push(()=>{window.__hfResolveMediaStartSeconds===Y&&delete window.__hfResolveMediaStartSeconds});let V=(d,h)=>{let p=d.tagName.toLowerCase();if(p==="script"||p==="style"||p==="link"||p==="meta")return!1;let C=p==="video"||p==="audio"?Y(d):J(d,0),F=_e(d),O=d.getAttribute("data-composition-id");if(O){let W=(window.__timelines??{})[O],se=null;if(W&&typeof W.duration=="function"){let ie=Number(W.duration());Number.isFinite(ie)&&ie>0&&(se=ie)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(No)||d.hasAttribute(Mo))&&(F==null||F<=0)&&se!=null&&(F=se)}let X=F!=null&&F>0?C+F:Number.POSITIVE_INFINITY;return h>=C&&(Number.isFinite(X)?h<X:!0)},ee=!!document.querySelector("[data-composition-src]"),Ae=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of d){let p=h.getAttribute("data-composition-id");if(p&&h.children.length===0&&document.querySelector(`template#${CSS.escape(p)}-template`)){Ae=!0;break}}}let B=!ee&&!Ae,k=d=>{if(!d||typeof d.duration!="function")return null;try{let h=Number(d.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},I=d=>typeof d=="number"&&Number.isFinite(d)&&d>D,ue=d=>{let h=Number(d.getAttribute("data-duration"));if(Number.isFinite(h)&&h>0)return h;let p=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),g=Number.isFinite(p)?Math.max(0,p):0;return Number.isFinite(d.duration)&&d.duration>g?Math.max(0,d.duration-g):null},ae=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let h=0;for(let p of d){let g=Y(p);if(!Number.isFinite(g))continue;let C=ue(p);C==null||C<=D||(h=Math.max(h,Math.max(0,g)+C))}return h>D?h:null},$=()=>{let d=G();if(!d)return null;let h=window.__timelines??{},p=it({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),g=0,C=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(C)&&C>0&&(g=C);let F=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let O of F){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==d)continue;let W=p.resolveStartForElement(O,0),se=p.resolveDurationForElement(O);!Number.isFinite(W)||se==null||se<=0||(g=Math.max(g,Math.max(0,W)+se))}return g>D?g:null},q=()=>{let d=ae();return typeof d!="number"||!Number.isFinite(d)||d<=D?null:d},j=d=>I(d)?Math.max(D,d*P):D,We=()=>{let d=0;for(let h of e.deterministicAdapters){let p=h.getInferredDurationSeconds;if(typeof p!="function")continue;let g=null;try{g=p()}catch(C){L("runtime.init.adapterDuration",C)}typeof g=="number"&&Number.isFinite(g)&&g>0&&(d=Math.max(d,g))}return d>D?d:null},me=(d,h=0)=>{let p=k(d),g=q(),C=$(),F=We(),O=Math.max(g??0,C??0,F??0),X=Number.isFinite(h)&&h>D?h:0,W=0;return I(p)?W=Math.max(p,O,X):I(O)?W=Math.max(O,X):W=X,W>0?Math.max(0,W):0},Ct=()=>{let d=window.__timelines??{},h=re=>{let Q=Object.entries(d).filter(oe=>!!oe[1]&&typeof oe[1].play=="function"&&typeof oe[1].pause=="function");if(Q.length!==1)return{timeline:null};let fe=Q[0];if(!fe)return{timeline:null};let[pe,ge]=fe;return{timeline:ge,selectedTimelineIds:[pe],selectedDurationSeconds:k(ge),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:re,soleTimelineId:pe}}}},p=it({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),g=q(),C=$(),F=Math.max(g??0,C??0)||null,O=j(F),X=re=>{let Q=document.querySelector(`[data-composition-id="${CSS.escape(re)}"]`);return Q?p.resolveStartForElement(Q,0):0},W=re=>{let Q=window.gsap;if(!Q||typeof Q.timeline!="function")return null;let fe=Q.timeline({paused:!0});for(let pe of re)fe.add(pe.timeline,X(pe.compositionId));return fe},se=(re,Q)=>{if(!I(re))return null;let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let pe=fe.timeline({paused:!0});if(Q)try{pe.add(Q,0)}catch(oe){L("runtime.init.site2",oe)}let ge=pe;if(typeof ge.to=="function")try{ge.to({},{duration:re})}catch(oe){L("runtime.init.site3",oe)}return pe},Fe=(re,Q)=>{let fe=re;if(typeof fe.getChildren!="function")return[];try{let pe=fe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let ge=[];for(let oe of Q)if(!pe.some(Ge=>Ge===oe.timeline))try{let Ge=X(oe.compositionId);re.add(oe.timeline,Ge),ge.push(oe.compositionId)}catch(Ge){L("runtime.init.site4",Ge)}return ge}catch{return[]}},ie=G(),te=ie?.getAttribute("data-composition-id")??null;if(!te)return h("root_missing_composition_id");let ve=d[te]??null,Ee=(()=>{if(!ie)return[];let re=new Set,Q=Array.from(ie.querySelectorAll("[data-composition-id]")),fe=[];for(let pe of Q){let ge=pe.getAttribute("data-composition-id");if(!ge||ge===te||re.has(ge))continue;re.add(ge);let oe=d[ge]??null;if(!oe||typeof oe.play!="function"||typeof oe.pause!="function")continue;let Re=k(oe);fe.push({compositionId:ge,timeline:oe,durationSeconds:Re??0})}return fe})(),Xt=re=>{for(let Q of re){let fe=Q.timeline;if(typeof fe.paused=="function")try{fe.paused(!1)}catch(pe){L("runtime.init.site5",pe)}}};if(Ee.length>0&&Xt(Ee),ve){let re=Ee.length>0?Fe(ve,Ee):[];if((Ee.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+te+"\'])"))&&(Ie=!0),re.length>0)try{let oe=ve.time();ve.seek(oe,!1)}catch{}let Q=k(ve);if(!I(Q)&&Ee.length>0){let oe=Ee.map(od=>od.compositionId),Re=W(Ee),Ge=k(Re);if(Re&&I(Ge))return{timeline:Re,selectedTimelineIds:oe,selectedDurationSeconds:Ge,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:Ge,mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:C,selectedTimelineIds:oe,autoNestedChildren:re}}};let qr=se(F??0,ve),jr=k(qr);if(qr&&I(jr))return{timeline:qr,selectedTimelineIds:[te],selectedDurationSeconds:jr,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:C,selectedDurationSeconds:jr,selectedTimelineIds:[te],autoNestedChildren:re}}}}if(!I(Q)&&Ee.length===0){let oe=se(F??0,ve),Re=k(oe);if(oe&&I(Re))return{timeline:oe,selectedTimelineIds:[te],selectedDurationSeconds:Re,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:C,selectedDurationSeconds:Re,selectedTimelineIds:[te]}}}}let fe=ie?.getAttribute("data-duration"),pe=fe?parseFloat(fe):null,ge=Math.max(I(pe)?pe:0,C??0);if(ge>0&&I(ge)&&I(Q)&&ge>=Q+.5){let oe=ve;if(typeof oe.to=="function")try{oe.to({},{duration:0},ge)}catch(Ge){L("runtime.init.site6",Ge)}let Re=k(ve);if(I(Re))return{timeline:ve,selectedTimelineIds:[te],selectedDurationSeconds:Re,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:te,rootDurationSeconds:Q,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:C,newDur:Re}}}}return{timeline:ve,selectedTimelineIds:[te],selectedDurationSeconds:Q,mediaDurationFloorSeconds:g,diagnostics:re.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:te,selectedDurationSeconds:Q,autoNestedChildren:re}}:void 0}}if(Ee.length>0){let re=Ee.map(pe=>pe.compositionId),Q=W(Ee),fe=k(Q);if(Q)return{timeline:Q,selectedTimelineIds:re,selectedDurationSeconds:fe,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:te,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:fe,mediaDurationFloorSeconds:g,selectedTimelineIds:re}}}}return h("root_composition_id_unmatched_in_registry")},Ie=!1,Hc=d=>{let h=window.gsap,p=d;if(!(!p||typeof p.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let g of p.getChildren(!0,!0,!0)){let C=g,F=C.timeline;if(!F||!("_ease"in F)||typeof F._ease=="function")continue;let O=C.vars?.keyframes,W=(O&&!Array.isArray(O)?O.ease:void 0)??C.vars?.ease??"none";try{let se=h.parseEase(W);typeof se=="function"&&(F._ease=se)}catch(se){Ne("keyframe_ease_repair_failed",{ease:typeof W=="string"?W:String(W)}),L("runtime.keyframeEase.repair",se)}}},zt=()=>{if(y(),!B)return!1;let d=e.capturedTimeline,h=k(d),p=I(h);if(d&&p&&Ie)return!1;let g=Ct();if(!g.timeline)return!1;if(d&&d===g.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=g.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Hc(e.capturedTimeline);let C=me(e.capturedTimeline,0);if(C<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),et(e.capturedTimeline)),C>0){try{c.setDuration(C)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let O=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(O,!1),et(e.capturedTimeline)}let F=window.__hfStudioManualEditsApply;typeof F=="function"&&F(),br(document)}if(g.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:g.diagnostics.code,details:g.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:g.selectedTimelineIds??[],selectedDurationSeconds:g.selectedDurationSeconds??null,mediaDurationFloorSeconds:g.mediaDurationFloorSeconds??null}}),window.parent!==window){let F=G(),O=C>0?C:0,X=String(O>0?O:1),W=new Set,se=new Set(document.querySelectorAll("[data-start]")),Fe=ie=>{let te=ie.parentElement;for(;te&&te!==F;){if(se.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ie of e.capturedTimeline.getChildren(!0))if(typeof ie.targets=="function")for(let te of ie.targets())te instanceof HTMLElement&&te!==F&&(te.hasAttribute("data-start")||Fe(te)||W.has(te)||(W.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",X),te.setAttribute("data-hf-autostamped","1")))}catch{}if(F instanceof HTMLElement)for(let ie of F.querySelectorAll("[id]"))ie instanceof HTMLElement&&ie!==F&&(ie.hasAttribute("data-start")||Fe(ie)||W.has(ie)||ie.tagName==="SCRIPT"||ie.tagName==="STYLE"||ie.tagName==="LINK"||(W.add(ie),ie.setAttribute("data-start","0"),ie.setAttribute("data-duration",X),ie.setAttribute("data-hf-autostamped","1")))}for(let F of $t)Pn.delete(F),$o(F);return!0};window.__hfForceTimelineRebind=()=>{Ie=!1,zt(),Br(e.currentTime)};let Bc=()=>{let d=G();if(!(d instanceof HTMLElement))return;let h=d.getBoundingClientRect(),p=Number(d.getAttribute("data-width")),g=Number(d.getAttribute("data-height")),C=window.getComputedStyle(d),F=Number.isFinite(p)&&p>0&&Number.isFinite(g)&&g>0,O=h.width<=0||h.height<=0||d.clientWidth<=0||d.clientHeight<=0;!F||!O||T("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:p,declaredHeight:g,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:C.display,visibility:C.visibility,overflow:C.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},Uc=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,Bc()}))},Wc=()=>{r=d=>{let h=A(d.error??d.message).slice(0,v);if(!h)return;let p=R(h);xe({source:"hf-preview",type:"diagnostic",code:p.code,details:{category:p.category,message:h,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let h=A(d.reason).slice(0,v);if(!h)return;let p=R(h);xe({source:"hf-preview",type:"diagnostic",code:`${p.code}_unhandled_rejection`,details:{category:`${p.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},Vc=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let p of d){let g=()=>{if(!(p instanceof Element))return;let C=p.tagName.toLowerCase(),F=p.getAttribute("src")??p.getAttribute("href")??p.getAttribute("poster")??null,O=C==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";T(O,{tagName:C,assetUrl:F,currentSrc:(p instanceof HTMLImageElement||p instanceof HTMLMediaElement)&&p.currentSrc||null,readyState:p instanceof HTMLMediaElement?p.readyState:null,networkState:p instanceof HTMLMediaElement?p.networkState:null},`${O}:${C}:${F??"unknown"}`)};p.addEventListener("error",g),w(()=>{p.removeEventListener("error",g)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let p=Array.from(h).filter(g=>g.status==="error").map(g=>g.family).filter(g=>!!g).slice(0,10);p.length!==0&&T("runtime_font_load_issue",{failedFamilies:p,totalFaces:Array.from(h).length},`runtime-font-load-issue:${p.join("|")}`)}).catch(()=>{})},zc=(d,h)=>{if(!d.timeline)return!1;let p=e.capturedTimeline;if(p&&p===d.timeline)return!1;let g=Math.max(0,e.currentTime||0),C=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{et(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(g,!1),C&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(F){L("runtime.init.site7",F)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:g,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ft=null,Uo=!1,Wo=!1,$t=new Set,Pn=new WeakMap,On=()=>{e.tornDown||(ft!=null&&window.clearTimeout(ft),ft=window.setTimeout(()=>{if(e.tornDown||(ft=null,Wo&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Ct();if(!d.timeline||!I(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){zt()&&(mt(),Le(!0));return}if(Uo)return;let p=k(e.capturedTimeline),g=d.selectedDurationSeconds??k(d.timeline);I(g)&&(!I(p)||g>=p+_)&&zc(d,"manual")&&(Uo=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:p??null,selectedDurationSeconds:g??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),mt(),Le(!0))},b))},Vo=d=>{d.currentTarget instanceof HTMLMediaElement&&Ua(d.currentTarget)},zo=d=>{d.currentTarget instanceof HTMLMediaElement&&Wa(d.currentTarget)},$c=()=>{for(let d of $t)d.removeEventListener("loadedmetadata",On),d.removeEventListener("durationchange",On),d.removeEventListener("loadedmetadata",Vo),d.removeEventListener("error",zo);$t.clear()},Pr=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let h of d){if($t.has(h))continue;$t.add(h);let p=Number.parseFloat(h.dataset.volume??"");Number.isFinite(p)&&(h.volume=Math.max(0,Math.min(1,p))),h.addEventListener("loadedmetadata",On),h.addEventListener("durationchange",On),h.addEventListener("loadedmetadata",Vo),h.addEventListener("error",zo),Ba(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),$o(h)}},$o=d=>{Pn.has(d)||Ma(d,e.capturedTimeline,me(e.capturedTimeline,0),Pn,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Or=new WeakMap,qo=d=>{let h=Or.get(d);if(h!==void 0)return h;let p=window.getComputedStyle(d).position,g=p==="static"||p==="relative"||p==="sticky";return Or.set(d,g),g},Gr=new WeakMap,qc=d=>{let h=Gr.get(d);if(h!==void 0)return h;let p=d.querySelector("[data-start]")===null;return Gr.set(d,p),p},jc=()=>{Or=new WeakMap,Gr=new WeakMap},Hr=new WeakMap,Gn=new WeakSet,Br=(d,h=Array.from(document.querySelectorAll("[data-start]")))=>{let p=G();for(let g of h){if(!(g instanceof HTMLElement))continue;if(g.hasAttribute("data-hidden")){Gn.has(g)||(Hr.set(g,g.style.getPropertyValue("display")),Gn.add(g)),g.style.display="none",(g instanceof HTMLVideoElement||g instanceof HTMLImageElement)&&n?.setSourceVisibility(g,!1);continue}if(Gn.has(g)){let F=Hr.get(g);F?g.style.display=F:g.style.removeProperty("display"),Hr.delete(g),Gn.delete(g)}let C=V(g,d);if(C){let F=g.parentElement;for(;F&&F!==p;){if(F instanceof HTMLElement&&F.hasAttribute("data-start")&&!V(F,d)){C=!1;break}F=F.parentElement}}g.style.visibility=C?"visible":"hidden",(g instanceof HTMLVideoElement||g instanceof HTMLImageElement)&&n?.setSourceVisibility(g,C),C?qo(g)&&g.style.removeProperty("display"):qo(g)&&qc(g)&&(g.style.display="none")}},Pe=()=>{let d=Ia({shouldIncludeElement:p=>p.hasAttribute("data-start")||!!z(p).compositionRoot,resolveStartSeconds:p=>Y(p),resolveDurationSeconds:p=>{let g=z(p),C=Y(p),F=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,O=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-C):null,X=Number.isFinite(p.duration)&&p.duration>F?Math.max(0,p.duration-F):null,W=Number.parseFloat(p.dataset.duration??""),se=Number.isFinite(W)&&W>0?W:null;return Da({isVideo:p.tagName==="VIDEO",sourceDuration:X,hostRemaining:O,explicitDuration:se})}});for(let p of d.mediaClips){let g=Pn.get(p.el);g&&(p.volumeKeyframes=g)}let h=e.mediaForceSyncNextTick;h&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Pa({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted||!e.webAudioMediaDisabled&&!e.nativeMediaSyncDisabled&&m.isActive(),userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:h,onElementVolume:(p,g)=>m.setElementVolume(p,g),isWebAudioOwned:p=>m.ownsElement(p),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Br(e.currentTime)},Le=d=>{let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),p=Date.now();(d||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||p-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=p,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Ur="",jo=0,Kc=()=>{let d="";for(let h of document.querySelectorAll("[data-start]"))d+=`${h.id}:${h.tagName}|`;return d},mt=()=>{ne(),U(),H();let d=G();if(d){let g=N(d.getAttribute("data-width")),C=N(d.getAttribute("data-height")),F=g?parseInt(g,10):0,O=C?parseInt(C,10):0;F>0&&O>0&&xe({source:"hf-preview",type:"stage-size",width:F,height:O})}zt();let h=Rs({canonicalFps:e.canonicalFps});window.__clipManifest=h;let p=Kc();if(Ur!==p&&jc(),!window.__clipTree||Ur!==p){let g=window;window.__clipTree=vs({startResolver:it({timelineRegistry:g.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:g.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Ur=p}xe(h),Uc()},Wr=d=>Number.isFinite(d)&&d>0?d:0,Yc=d=>{let h=Wr(Number(d));if(h<=0)return;let p=G(),g=Wr(Number.parseFloat(p?.getAttribute("data-duration")??"")),C=Math.max(jo,Wr(c.getDuration()),g);h<=C||(jo=h,p?.setAttribute("data-duration",String(h)),c.setDuration(h),mt(),Le(!0))},Ve=(d,h=0)=>{for(let p of e.deterministicAdapters){try{d==="discover"&&p.discover(),d==="pause"&&p.pause(),d==="play"&&p.play&&p.play()}catch(g){L("runtime.init.site8",g)}if(d==="discover")try{p.seek({time:h,suppressEvents:!0})}catch(g){L("runtime.init.site9",g)}}},pt=()=>{window.__renderReady=!1},qt=null,jt=!0,Xc=()=>{let d=[];for(let h of e.deterministicAdapters){let p=h.getReadyPromise;if(typeof p=="function")try{let g=p();g&&d.push(g)}catch(g){L("runtime.init.adapterReady",g)}}return d},Jc=()=>{let d=Xc();if(d.length===0)return qt=null,jt=!0,!0;let h=d[0];if(!h)return!0;let p=d.length===1?h:Promise.all(d);return p!==qt&&(qt=p,jt=!1,Promise.resolve(p).then(()=>{qt===p&&(jt=!0,pt())},g=>{qt===p&&(jt=!0,L("runtime.init.adapterReady",g),pt())})),jt};if(B)po();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:N,onDiagnostic:({code:h,details:p})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:p})}};hu(d).then(()=>pu(d)).finally(()=>{B=!0,Pr(),Vc(),po(),So(document),pt()})}let Hn=gs({postMessage:d=>xe(d)});Hn.installPickerApi(),Br(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let ze=ec();n=ze,w(()=>{ze.destroy(),n=null});let Vr=d=>{let h=Number(d);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let p=document.querySelectorAll("video, audio");for(let g of p)if(g instanceof HTMLMediaElement)try{g.playbackRate=e.playbackRate}catch(C){L("runtime.init.site10",C)}},Ko={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let h=me(d,0);if(h>0)c.setDuration(h),c.reachedEnd()&&(c.seek(0),e.currentTime=0,ht(0));else{let p=G(),g=Number(p?.getAttribute("data-duration")??0);g>0&&c.setDuration(g)}et(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,ea(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ta(),Ve("play"),Pe(),ze.redraw(),Le(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,ea(e.currentTime);let d=e.capturedTimeline;et(d),Ve("pause"),Pe(),ze.redraw(),Le(!0)},seek:(d,h)=>{let p=Nt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let g=c.isPlaying();g&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let C=e.capturedTimeline;if(et(C),ht(e.currentTime),Ve("pause"),h?.keepPlaying&&g){Ko.play();return}Pe(),ze.redraw(),Le(!0)},renderSeek:(d,h)=>{Wo=!0;let p=Nt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,ht(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),Pe(),ze.redraw(),Le(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{Vr(d),c.setRate(e.playbackRate),na()},getPlaybackRate:()=>e.playbackRate},Yo=me(e.capturedTimeline,0);Yo>0&&c.setDuration(Yo);let Oe=ys({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:Vr,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,h)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Pe()},onStatePost:Le,onDeterministicSeek:(d,h)=>{for(let p of e.deterministicAdapters)if(!(p.name==="gsap"&&e.capturedTimeline))try{p.seek({time:Number(d)||0,suppressEvents:h?.suppressEvents})}catch(g){L("runtime.init.site11",g)}},onDeterministicPause:()=>Ve("pause"),onDeterministicPlay:()=>Ve("play"),onRenderFrameSeek:()=>{ze.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>me(e.capturedTimeline,0),transport:Ko});window.__player=M(Oe),window.__playerReady=!0,Ne("composition_loaded",{duration:Oe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Fa(),pa({resolveStartSeconds:d=>J(d,0)}),ga(),ba(),Sa(),va(),Ea(),Ca(),_a(),Aa(),wa(),ha({getTimeline:()=>e.capturedTimeline})],Ra(),La(),window.__hfReseekGpu=d=>{let h=Math.max(0,Number(d)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,ya(h)},Wc(),Pr(),Ve("discover");let Qc=()=>{let d=e.capturedTimeline,h=zt();e.capturedTimeline&&(h||e.capturedTimeline!==d||!Oe._timeline)&&(Oe._timeline=e.capturedTimeline);let p=me(e.capturedTimeline,0);if(p>0&&c.setDuration(p),Ve("discover",e.currentTime),!e.capturedTimeline){let g=window.__timelines??{},C=Object.keys(g).filter(F=>g[F]);if(C.length>0){let O=G()?.getAttribute("data-composition-id")??null;T("root_timeline_unbound_registry_present",{reason:O?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:O,registeredTimelineKeys:C},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \\u2014 render will freeze at t=0. "+(O?`Root data-composition-id is "${O}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${C.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${O??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,mt(),Le(!0)},_t=null,Zc=()=>{if(_t)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),_t=null,pt()};_t=d,window.addEventListener("hf-timelines-built",d)};w(()=>{_t&&(window.removeEventListener("hf-timelines-built",_t),_t=null)}),pt=()=>{if(!B){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Zc();return}if(Ve("discover",e.currentTime),!Jc()){window.__renderReady=!1;return}Qc()},pt(),B&&setTimeout(()=>{pt()},0);let Bn=0,zr=!1,ed=(d,h,p,g)=>{try{let C=g?.suppressEvents===!0;et(d),typeof d.totalTime=="function"?d.totalTime(h,C):d.seek(h,C)}catch(C){L(p,C)}},td=(d,h)=>{let p=window.__timelines??{},g=G()?.getAttribute("data-composition-id")??null;for(let[C,F]of Object.entries(p)){if(!F||C===g)continue;let O=document.querySelector(`[data-composition-id="${CSS.escape(C)}"]`);if(!O)continue;let X=J(O,0);if(!Number.isFinite(X))continue;let W=k(F),se=Tt(O)+Math.max(0,d-X)*qe(O),Fe=Math.max(0,W!=null&&W>0?Math.min(W,se):se);ed(F,Fe,"runtime.init.transport.childTimeline",h)}},Xo=d=>{let h=window.__timelines??{};for(let p of Object.values(h))if(!(!p||p===d))try{p.play()}catch(g){L("runtime.init.activateSiblings",g)}},Jo=d=>typeof d=="object"&&d!==null,Kt=new WeakMap,nd=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Qo=(d,h)=>{let p=d[h];if(typeof p!="function")return null;try{let g=Number(p.call(d));return Number.isFinite(g)?g:null}catch(g){return L("runtime.init.gsapCallbackDuration",g),null}},rd=d=>{let h=Kt.get(d);if(h!=null)return h;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let p;try{p=d.getChildren(!0,!0,!0)}catch(g){return L("runtime.init.gsapCallbackChildren",g),Kt.set(d,!1),!1}if(!Array.isArray(p))return Kt.set(d,!1),!1;for(let g of p){if(!Jo(g))continue;let C=g.vars;if(!Jo(C)||!nd.some(W=>typeof C[W]=="function"))continue;let X=Qo(g,"totalDuration")??Qo(g,"duration");if(X!=null&&X<=1e-6)return Kt.set(d,!0),!0}return Kt.set(d,!1),!1};function ht(d,h){let p=e.capturedTimeline,g=h?.suppressEvents===!0;if(p){h?.activateChildren&&Xo(p);let C=p,F=d;if(typeof C.totalDuration=="function")try{let O=Number(C.totalDuration());Number.isFinite(O)&&O>0&&d>O&&(F=O)}catch(O){L("runtime.init.transport.clampDuration",O)}try{typeof p.totalTime=="function"?(p.totalTime(F,g),!g&&!rd(p)&&(p.totalTime(F+.001,!0),p.totalTime(F,!0))):p.seek(F,g)}catch(O){L("runtime.init.transport.seek",O)}}td(d,h),p&&h?.activateChildren&&Xo(p);for(let C of e.deterministicAdapters)if(!(C.name==="gsap"&&p))try{C.seek({time:d,suppressEvents:g})}catch(F){L("runtime.init.transport.adapter",F)}}let id=()=>{try{return document.querySelector(`[${nc}]`)!=null}catch{return!1}},Zo=()=>{if(!(e.tornDown||zr)){zr=!0;try{if(e.transportRafId=window.requestAnimationFrame(Zo),Bn+=1,rc({tick:Bn,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let h=e.capturedTimeline;if(zt()){e.capturedTimeline&&!Oe._timeline&&(Oe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==h&&et(e.capturedTimeline);let p=me(e.capturedTimeline,0);p>0&&c.setDuration(p),mt()}}if(Bn%20===0&&mt(),Bn%30===0&&Pr(),e.capturedTimeline){let h=me(e.capturedTimeline,0);h>0&&(!c.isPlaying()||h>=c.getDuration())&&c.setDuration(h)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let h=m.getTime();h>=0&&c.attachAudioSource({currentTimeSeconds:h})}else{let h=document.querySelectorAll("audio[data-start]"),p=!1;for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let C=Number.parseFloat(g.dataset.start??""),F=Number.parseFloat(g.dataset.duration??""),O=Number.isFinite(F)&&F>0?C+F:1/0,X=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0;if(Number.isFinite(C)&&e.currentTime>=C&&e.currentTime<O){g.paused?!g.error&&g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),p=!0):(c.attachAudioSource({el:g,compositionStart:C,mediaStart:X}),p=!0);break}}!p&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!id())&&ht(d),c.isPlaying()&&ze.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,ht(h)),Ve("pause"),Pe(),Le(!0);return}c.isPlaying()&&Pe(),Le(!1)}finally{zr=!1}}},ea=d=>{let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let g=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(g))continue;let C=Number.parseFloat(p.dataset.duration??""),F=Number.isFinite(C)&&C>0?g+C:1/0;if(d<g||d>=F)continue;let O=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,X=d-g+O;if(X>=0)try{p.currentTime=X}catch{}}},ta=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let g=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(g))continue;let C=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,F=Number.parseFloat(p.dataset.volume??""),O=Number.isFinite(F)?F:1,X=Number.parseFloat(p.dataset.duration??""),W=Number.isFinite(X)&&X>0?X:Number.POSITIVE_INFINITY,se=p.closest("[data-composition-id]");if(se){let Fe=J(se,0),ie=_e(se,{includeAuthoredTimingAttrs:!0});ie!=null&&ie>0&&(W=Math.min(W,Math.max(0,Fe+ie-g)))}m.decodeAudioElement(p).then(Fe=>{!Fe||!c.isPlaying()||m.schedulePlayback(p,Fe,g,C,c.now(),O*e.bridgeVolume,d,e.playbackRate,W)})}};function na(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),ta())}if(e.capturedTimeline){let d=me(e.capturedTimeline,0);d>0&&c.setDuration(d),et(e.capturedTimeline)}vu(window),e.transportRafId=window.requestAnimationFrame(Zo),mt(),Le(!0),e.controlBridgeHandler=aa({onPlay:()=>{Oe.play(),Ne("composition_played",{time:Oe.getTime()})},onPause:()=>{Oe.pause(),Ne("composition_paused",{time:Oe.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let h of d)h instanceof HTMLMediaElement&&!h.paused&&h.pause()},onSeek:(d,h)=>{Oe.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let h=d||e.mediaOutputMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let g of p)g instanceof HTMLMediaElement&&(g.muted=h||g.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement))continue;let g=parseFloat(p.dataset.volume??""),C=Number.isFinite(g)?g:1;p.volume=C*d}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let h=d||e.bridgeMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let g of p)g instanceof HTMLMediaElement&&(g.muted=h||g.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Pe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Pe())},onSetPlaybackRate:d=>{Vr(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),na()},onSetRootDuration:Yc,onSetColorGrading:(d,h)=>{ze.setGrading(d,h)},onSetColorGradingCompare:(d,h)=>{ze.setCompare(d,h)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,ht(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,ht(h)),Ve("pause"),Pe(),Le(!0)}},onEnablePickMode:()=>Hn.enablePickMode(),onDisablePickMode:()=>Hn.disablePickMode(),getCanonicalFps:()=>e.canonicalFps});let $r=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),ft!=null&&(window.clearTimeout(ft),ft=null),l!=null&&(window.cancelAnimationFrame(l),l=null),$c(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Hn.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(h){L("runtime.init.site12",h)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(h){L("runtime.init.site13",h)}for(let d of e.injectedCompStyles)try{d.remove()}catch(h){L("runtime.init.site14",h)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(h){L("runtime.init.site15",h)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(h){L("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===$r&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=$r,e.beforeUnloadHandler=$r,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var mc=["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"],ko=[[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 Ih(e){if(e<=255)return mc[e];let t=0,n=ko.length-1;for(;t<=n;){let r=t+n>>1,i=ko[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Ph(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let y=e.charCodeAt(u+1);y>=56320&&y<=57343&&(m=(c-55296<<10)+(y-56320)+65536,f=2)}let x=Ih(m);(x==="R"||x==="AL"||x==="AN")&&(r=!0);for(let y=0;y<f;y++)n[u+y]=x;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="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 c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}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 c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let E=u;E<c;E++)n[E]=x;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function pc(e,t){let n=Ph(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 Oh=/[ \\t\\n\\r\\f]+/g,Gh=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Hh(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Bh(e){if(!Gh.test(e))return e;let t=e.replace(Oh," ");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 Uh(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var Do=null,Wh;function Vh(){return Do===null&&(Do=new Intl.Segmenter(Wh,{granularity:"word"})),Do}var zh=/\\p{Script=Arabic}/u,Nr=/\\p{M}/u,Ec=/\\p{Nd}/u;function hc(e){return zh.test(e)}function gc(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 Ue(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(gc(i))return!0;t++;continue}}if(gc(n))return!0}}return!1}function $h(e){let t=Dr(e);return t!==null&&(kr.has(t)||ct.has(t))}var qh=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function jh(e){return Ue(e)}function Kh(e){let t=Dr(e);return t!==null&&qh.has(t)}function Mr(e){return!$h(e)&&!Kh(e)}var kr=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"]),In=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Po=new Set(["\'","\\u2019"]),ct=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Yh=new Set([":",".","\\u060C","\\u061B"]),Xh=new Set(["\\u104F"]),Jh=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Qh(e){if(Oo(e))return!0;let t=!1;for(let n of e){if(ct.has(n)){t=!0;continue}if(!(t&&Nr.test(n)))return!1}return t}function Zh(e){for(let t of e)if(!kr.has(t)&&!ct.has(t))return!1;return e.length>0}function eg(e){if(Oo(e))return!0;for(let t of e)if(!In.has(t)&&!Po.has(t)&&!Nr.test(t))return!1;return e.length>0}function Oo(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Nr.test(n))){if(In.has(n)||ct.has(n)||Po.has(n)){t=!0;continue}return!1}return t}function Cc(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 Dr(e){if(e.length===0)return null;let t=Cc(e,e.length);return e.slice(t)}function tg(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Nr.test(r)){n--;continue}if(In.has(r)||Po.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function ng(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function xc(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 bc(e,t){return e&&t!==null&&Yh.has(t)}function rg(e){let t=Dr(e);return t!==null&&Xh.has(t)}function ig(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 Ir(e){let t=e.length;for(;t>0;){let n=Cc(e,t),r=e.slice(n,t);if(Jh.has(r))return!0;if(!ct.has(r))return!1;t=n}return!1}function og(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var ag=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function De(e){return e.length===1?e[0]:e.join("")}function sg(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),De(n)}function lg(e,t,n,r){if(!ag.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=og(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),i}function Io(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var ug=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function cg(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:ug.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function dg(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function fg(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!cg(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Io(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=De(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function mg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!dg(a))continue;let l=o+1;if(l>=e.len||Io(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!Io(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(De(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var pg=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),yc=/^[A-Za-z0-9_]+[,:;]*$/,Sc=/[,:;]+$/;function _c(e){for(let t of e)if(Ec.test(t))return!0;return!1}function Dn(e){if(e.length===0)return!1;for(let t of e)if(!(Ec.test(t)||pg.has(t)))return!1;return!0}function hg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&Dn(a)&&_c(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Dn(e.texts[u]);)s.push(e.texts[u]),u++;t.push(De(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function gg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&yc.test(a)){let u=[a],c=Sc.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&yc.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=Sc.test(f),m++}t.push(De(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function xg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!_c(c)||!Dn(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function bg(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=De(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=De(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(De(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function yg(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Ue(t[o])||!Ue(t[o+1]))continue;let a=tg(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function vc(e,t,n){let r=Vh(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],x=[],y=[],E=[],S=[];for(let _ of r.segment(e))for(let b of lg(_.segment,_.isWordLike??!1,_.index,n)){let J=function(){c[H]!==null&&(a[H]=[xc(o,c,m,H)],c[H]=null),a[H].push(b.text),l[H]=l[H]||b.isWordLike,f[H]=f[H]||R,x[H]=x[H]||N,y[H]=U,E[H]=ne,S[H]=bc(x[H],G)},v=b.kind==="text",A=ng(b.text,b.isWordLike,b.kind),R=Ue(b.text),N=hc(b.text),G=Dr(b.text),U=Ir(b.text),ne=rg(b.text),H=i-1;t.carryCJKAfterClosingQuote&&v&&i>0&&s[H]==="text"&&R&&f[H]&&y[H]||v&&i>0&&s[H]==="text"&&Zh(b.text)&&f[H]||v&&i>0&&s[H]==="text"&&E[H]?J():v&&i>0&&s[H]==="text"&&b.isWordLike&&N&&S[H]?(J(),l[H]=!0):A!==null&&i>0&&s[H]==="text"&&c[H]===A?m[H]=(m[H]??1)+1:v&&!b.isWordLike&&i>0&&s[H]==="text"&&(Qh(b.text)||b.text==="-"&&l[H])?J():(o[i]=b.text,a[i]=[b.text],l[i]=b.isWordLike,s[i]=b.kind,u[i]=b.start,c[i]=A,m[i]=A===null?0:1,f[i]=R,x[i]=N,y[i]=U,E[i]=ne,S[i]=bc(N,G),i++)}for(let _=0;_<i;_++){if(c[_]!==null){o[_]=xc(o,c,m,_);continue}o[_]=De(a[_])}for(let _=1;_<i;_++)s[_]==="text"&&!l[_]&&Oo(o[_])&&s[_-1]==="text"&&(o[_-1]+=o[_],l[_-1]=l[_-1]||l[_],o[_]="");let w=Array.from({length:i},()=>null),T=-1;for(let _=i-1;_>=0;_--){let b=o[_];if(b.length!==0){if(s[_]==="text"&&!l[_]&&eg(b)&&T>=0&&s[T]==="text"){let v=w[T]??[];v.push(b),w[T]=v,u[T]=u[_],o[_]="";continue}T=_}}for(let _=0;_<i;_++){let b=w[_];b!=null&&(o[_]=sg(b,o[_]))}let M=0;for(let _=0;_<i;_++){let b=o[_];b.length!==0&&(M!==_&&(o[M]=b,l[M]=l[_],s[M]=s[_],u[M]=u[_]),M++)}o.length=M,l.length=M,s.length=M,u.length=M;let D=bg({len:M,texts:o,isWordLike:l,kinds:s,starts:u}),P=yg(gg(xg(hg(mg(fg(D))))));for(let _=0;_<P.len-1;_++){let b=ig(P.texts[_]);b!==null&&(P.kinds[_]!=="space"&&P.kinds[_]!=="preserved-space"||P.kinds[_+1]!=="text"||!hc(P.texts[_+1])||(P.texts[_]=b.space,P.isWordLike[_]=!1,P.kinds[_]=P.kinds[_]==="preserved-space"?"preserved-space":"space",P.texts[_+1]=b.marks+P.texts[_+1],P.starts[_+1]=P.starts[_]+b.space.length))}return P}function Sg(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function vg(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(De(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],x=e.kinds[m],y=e.isWordLike[m],E=e.starts[m];if(x==="text"){let S=jh(f),w=Mr(f);if(o!==null&&s&&u){o.push(f),a=a||y,s=s||S,u=w;continue}c(),o=[f],a=y,l=E,s=S,u=w;continue}c(),t.push(f),n.push(y),r.push(x),i.push(E)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Ac(e,t,n="normal",r="normal"){let i=Hh(n),o=i.mode==="pre-wrap"?Uh(e):Bh(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?vg(vc(o,t,i)):vc(o,t,i);return{normalized:o,chunks:Sg(a,i),...a}}var Ut=null,wc=new Map,Wt=null,Eg=96,Cg=/\\p{Emoji_Presentation}/u,_g=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Go=null,Tc=new Map;function Ho(){if(Ut!==null)return Ut;if(typeof OffscreenCanvas<"u")return Ut=new OffscreenCanvas(1,1).getContext("2d"),Ut;if(typeof document<"u")return Ut=document.createElement("canvas").getContext("2d"),Ut;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Ag(e){let t=wc.get(e);return t||(t=new Map,wc.set(e,t)),t}function tt(e,t){let n=t.get(e);return n===void 0&&(n={width:Ho().measureText(e).width,containsCJK:Ue(e)},t.set(e,n)),n}function Vt(){if(Wt!==null)return Wt;if(typeof navigator>"u")return Wt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wt;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Wt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Wt}function wg(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function Rc(){return Go===null&&(Go=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Go}function Tg(e){return Cg.test(e)||e.includes("\\uFE0F")}function Lc(e){return _g.test(e)}function Rg(e,t){let n=Tc.get(e);if(n!==void 0)return n;let r=Ho();r.font=e;let i=r.measureText("\\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return Tc.set(e,n),n}function Lg(e){let t=0,n=Rc();for(let r of n.segment(e))Tg(r.segment)&&t++;return t}function Fg(e,t){return t.emojiCount===void 0&&(t.emojiCount=Lg(e)),t.emojiCount}function dt(e,t,n){return n===0?t.width:t.width-Fg(e,t)*n}function Fc(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Rc(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=tt(m,n);c.push(dt(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>Eg){let c=[],m=null,f=0;for(let x of a){let y=tt(x,n),E=dt(x,y,r);if(m===null)c.push(E);else{let S=m+x,w=tt(S,n);c.push(dt(S,w,r)-f)}m=x,f=E}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=tt(s,n),f=dt(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Nc(e,t){let n=Ho();n.font=e;let r=Ag(e),i=wg(e),o=t?Rg(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function Ng(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function Mg(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function kg(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function Mc(e,t){return e.simpleLineWalkFastPath?kc(e,t):Dc(e,t)}function kc(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=Vt().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,x=0,y=0,E=0,S=-1,w=0;function T(){S=-1,w=0}function M(A=y,R=E,N=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:A,endGraphemeIndex:R,width:N}),c=0,m=!1,T()}function D(A,R){m=!0,f=A,x=0,y=A+1,E=0,c=R}function P(A,R,N){m=!0,f=A,x=R,y=A,E=R+1,c=N}function _(A,R){if(!m){D(A,R);return}c+=R,y=A+1,E=0}function b(A,R){let N=o[A];for(let G=R;G<N.length;G++){let U=N[G];m?c+U>s?(M(),P(A,G,U)):(c+=U,y=A,E=G+1):P(A,G,U)}m&&y===A&&E===N.length&&(y=A+1,E=0)}let v=0;for(;v<r.length&&!(!m&&(v=Ng(e,v),v>=r.length));){let A=r[v],R=i[v],N=R==="space"||R==="preserved-space"||R==="tab"||R==="zero-width-break"||R==="soft-hyphen";if(!m){A>t&&o[v]!==null?b(v,0):D(v,A),N&&(S=v+1,w=c-A),v++;continue}if(c+A>s){if(N){_(v,A),M(v+1,0,c-A),v++;continue}if(S>=0){if(y>S||y===S&&E>0){M();continue}M(S,0,w);continue}if(A>t&&o[v]!==null){M(),b(v,0),v++;continue}M();continue}_(v,A),N&&(S=v+1,w=c-A),v++}return m&&M(),u}function Dc(e,t,n){if(e.simpleLineWalkFastPath)return kc(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=Vt(),f=m.lineFitEpsilon,x=t+f,y=0,E=0,S=!1,w=0,T=0,M=0,D=0,P=-1,_=0,b=0,v=null;function A(){P=-1,_=0,b=0,v=null}function R(z=M,Y=D,V=E){y++,n?.({startSegmentIndex:w,startGraphemeIndex:T,endSegmentIndex:z,endGraphemeIndex:Y,width:V}),E=0,S=!1,A()}function N(z,Y){S=!0,w=z,T=0,M=z+1,D=0,E=Y}function G(z,Y,V){S=!0,w=z,T=Y,M=z,D=Y+1,E=V}function U(z,Y){if(!S){N(z,Y);return}E+=Y,M=z+1,D=0}function ne(z,Y,V,ee){if(!Y)return;let Ae=z==="tab"?0:i[V],B=z==="tab"?ee:o[V];P=V+1,_=E-ee+Ae,b=E-ee+B,v=z}function H(z,Y){let V=l[z];for(let ee=Y;ee<V.length;ee++){let Ae=V[ee];S?E+Ae>x?(R(),G(z,ee,Ae)):(E+=Ae,M=z,D=ee+1):G(z,ee,Ae)}S&&M===z&&D===V.length&&(M=z+1,D=0)}function J(z){if(v!=="soft-hyphen")return!1;let Y=l[z];if(Y==null)return!1;let{fitCount:V,fittedWidth:ee}=kg(Y,E,t,f,s);return V===0?!1:(E=ee,M=z,D=V,A(),V===Y.length?(M=z+1,D=0,!0):(R(z,V,ee+s),H(z,V),!0))}function _e(z){y++,n?.({startSegmentIndex:z.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:z.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),A()}for(let z=0;z<c.length;z++){let Y=c[z];if(Y.startSegmentIndex===Y.endSegmentIndex){_e(Y);continue}S=!1,E=0,w=Y.startSegmentIndex,T=0,M=Y.startSegmentIndex,D=0,A();let V=Y.startSegmentIndex;for(;V<Y.endSegmentIndex;){let ee=a[V],Ae=ee==="space"||ee==="preserved-space"||ee==="tab"||ee==="zero-width-break"||ee==="soft-hyphen",B=ee==="tab"?Mg(E,u):r[V];if(ee==="soft-hyphen"){S&&(M=V+1,D=0,P=V+1,_=E+s,b=E+s,v=ee),V++;continue}if(!S){B>t&&l[V]!==null?H(V,0):N(V,B),ne(ee,Ae,V,B),V++;continue}if(E+B>x){let I=E+(ee==="tab"?0:i[V]),ue=E+(ee==="tab"?B:o[V]);if(v==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&_<=x){R(P,0,b);continue}if(v==="soft-hyphen"&&J(V)){V++;continue}if(Ae&&I<=x){U(V,B),R(V+1,0,ue),V++;continue}if(P>=0&&_<=x){if(M>P||M===P&&D>0){R();continue}let ae=P;R(ae,0,b),V=ae;continue}if(B>t&&l[V]!==null){R(),H(V,0),V++;continue}R();continue}U(V,B),ne(ee,Ae,V,B),V++}if(S){let ee=P===Y.consumedEndSegmentIndex?b:E;R(Y.consumedEndSegmentIndex,0,ee)}}return y}var Bo=null;function Dg(){return Bo===null&&(Bo=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Bo}function Ig(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function Pg(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,x){r=[m],i=f,o=x,a=Ir(m),l=In.has(m)}function c(m,f){r.push(m),o=o||f;let x=Ir(m);m.length===1&&ct.has(m)?a=a||x:a=x,l=!1}for(let m of Dg().segment(e)){let f=m.segment,x=Ue(f);if(r.length===0){u(f,m.index,x);continue}if(l||kr.has(f)||ct.has(f)||t.carryCJKAfterClosingQuote&&x&&a){c(f,x);continue}if(!o&&!x){c(f,x);continue}s(),u(f,m.index,x)}return s(),n}function Og(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Ue(e[0].text),o=Mr(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=Ue(s.text),c=Mr(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function Gg(e,t,n,r){let i=Vt(),{cache:o,emojiCorrection:a}=Nc(t,Lc(e.normalized)),l=dt("-",tt("-",o),a),u=dt(" ",tt(" ",o),a)*8;if(e.len===0)return Ig(n);let c=[],m=[],f=[],x=[],y=e.chunks.length<=1,E=n?[]:null,S=[],w=n?[]:null,T=Array.from({length:e.len});function M(b,v,A,R,N,G,U){N!=="text"&&N!=="space"&&N!=="zero-width-break"&&(y=!1),c.push(v),m.push(A),f.push(R),x.push(N),E?.push(G),S.push(U),w!==null&&w.push(b)}function D(b,v,A,R,N){let G=tt(b,o),U=dt(b,G,a),ne=v==="space"||v==="preserved-space"||v==="zero-width-break"?0:U,H=v==="space"||v==="zero-width-break"?0:U;if(N&&R&&b.length>1){let J="sum-graphemes";Dn(b)?J="pair-context":i.preferPrefixWidthsForBreakableRuns&&(J="segment-prefixes");let _e=Fc(b,G,o,a,J);M(b,U,ne,H,v,A,_e);return}M(b,U,ne,H,v,A,null)}for(let b=0;b<e.len;b++){T[b]=c.length;let v=e.texts[b],A=e.isWordLike[b],R=e.kinds[b],N=e.starts[b];if(R==="soft-hyphen"){M(v,0,l,l,R,N,null);continue}if(R==="hard-break"){M(v,0,0,0,R,N,null);continue}if(R==="tab"){M(v,0,0,0,R,N,null);continue}let G=tt(v,o);if(R==="text"&&G.containsCJK){let U=Pg(v,i),ne=r==="keep-all"?Og(U):U;for(let H=0;H<ne.length;H++){let J=ne[H];D(J.text,"text",N+J.start,A,r==="keep-all"||!Ue(J.text))}continue}D(v,R,N,A,!0)}let P=Hg(e.chunks,T,c.length),_=E===null?null:pc(e.normalized,E);return w!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:y,segLevels:_,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P,segments:w}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:y,segLevels:_,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P}}function Hg(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function Bg(e,t,n,r){let i=r?.wordBreak??"normal",o=Ac(e,Vt(),r?.whiteSpace,i);return Gg(o,t,n,i)}function Ic(e,t,n){return Bg(e,t,!1,n)}function Pc(e,t,n){let r=Mc(e,t);return{lineCount:r,height:r*n}}var Ug={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Oc(e,t){let n={...Ug,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Ic(e,o),{lineCount:l}=Pc(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};ku();window.__hyperframes={fitTextFontSize:Oc,getVariables:ua};function Gc(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,fc())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Gc,{once:!0}):Gc();})();\n';
58458
58458
  }
58459
58459
  });
58460
58460
 
@@ -62402,6 +62402,56 @@ import { existsSync as existsSync2, mkdirSync, readFileSync, renameSync, writeFi
62402
62402
  import { join as join3 } from "path";
62403
62403
  import { homedir } from "os";
62404
62404
  import { randomUUID } from "crypto";
62405
+ function readInstallState() {
62406
+ try {
62407
+ if (!existsSync2(STATE_FILE)) return null;
62408
+ const parsed = JSON.parse(readFileSync(STATE_FILE, "utf-8"));
62409
+ if (typeof parsed.markerAt !== "string") return null;
62410
+ return {
62411
+ markerAt: parsed.markerAt,
62412
+ deParallelRouterTrialFired: parsed.deParallelRouterTrialFired === true ? true : void 0
62413
+ };
62414
+ } catch {
62415
+ return null;
62416
+ }
62417
+ }
62418
+ function writeInstallState(next) {
62419
+ mkdirSync(STATE_DIR, { recursive: true, mode: 448 });
62420
+ const tmpFile = `${STATE_FILE}.${process.pid}.tmp`;
62421
+ writeFileSync(tmpFile, JSON.stringify(next, null, 2) + "\n", { mode: 384 });
62422
+ renameSync(tmpFile, STATE_FILE);
62423
+ }
62424
+ function nextInstallState(state, wantFired) {
62425
+ const hadFired = state?.deParallelRouterTrialFired === true;
62426
+ if (state !== null && (hadFired || !wantFired)) return null;
62427
+ return {
62428
+ markerAt: state?.markerAt ?? (/* @__PURE__ */ new Date()).toISOString(),
62429
+ deParallelRouterTrialFired: wantFired || void 0
62430
+ };
62431
+ }
62432
+ function syncInstallState(config) {
62433
+ const wantFired = config.deParallelRouterTrialFired === true;
62434
+ if (stateMarkerSynced && (stateFiredSynced || !wantFired)) return;
62435
+ try {
62436
+ const state = readInstallState();
62437
+ const next = nextInstallState(state, wantFired);
62438
+ if (next !== null) writeInstallState(next);
62439
+ stateMarkerSynced = true;
62440
+ stateFiredSynced = wantFired || state?.deParallelRouterTrialFired === true;
62441
+ } catch {
62442
+ }
62443
+ }
62444
+ function mintConfig() {
62445
+ const state = readInstallState();
62446
+ return {
62447
+ ...DEFAULT_CONFIG,
62448
+ anonymousId: randomUUID(),
62449
+ predecessorFound: state !== null,
62450
+ // The rollover itself: a breaker tripped by a previous install on this
62451
+ // machine stays tripped for the new one.
62452
+ deParallelRouterTrialFired: state?.deParallelRouterTrialFired === true ? true : void 0
62453
+ };
62454
+ }
62405
62455
  function recordRecentRender(id, ok) {
62406
62456
  const config = readConfigFresh();
62407
62457
  const ring = [...config.recentRenders ?? [], { id, at: (/* @__PURE__ */ new Date()).toISOString(), ok }];
@@ -62411,7 +62461,7 @@ function recordRecentRender(id, ok) {
62411
62461
  function readConfig() {
62412
62462
  if (cachedConfig) return { ...cachedConfig };
62413
62463
  if (!existsSync2(CONFIG_FILE)) {
62414
- const config = { ...DEFAULT_CONFIG, anonymousId: randomUUID() };
62464
+ const config = mintConfig();
62415
62465
  writeConfig(config);
62416
62466
  return config;
62417
62467
  }
@@ -62442,6 +62492,7 @@ function readConfig() {
62442
62492
  // with a bare truthy check at the call site (review finding).
62443
62493
  deParallelRouterTrialFired: parsed.deParallelRouterTrialFired === true ? true : void 0,
62444
62494
  deParallelRouterTrialRenderCount: typeof parsed.deParallelRouterTrialRenderCount === "number" ? parsed.deParallelRouterTrialRenderCount : void 0,
62495
+ predecessorFound: typeof parsed.predecessorFound === "boolean" ? parsed.predecessorFound : void 0,
62445
62496
  recentRenders: Array.isArray(parsed.recentRenders) ? parsed.recentRenders.filter(
62446
62497
  (r2) => typeof r2 === "object" && r2 !== null && typeof r2.id === "string" && typeof r2.at === "string" && typeof r2.ok === "boolean"
62447
62498
  ).slice(-MAX_RECENT_RENDERS) : void 0
@@ -62449,11 +62500,7 @@ function readConfig() {
62449
62500
  cachedConfig = config;
62450
62501
  return { ...config };
62451
62502
  } catch {
62452
- const config = {
62453
- ...DEFAULT_CONFIG,
62454
- telemetryEnabled: false,
62455
- anonymousId: randomUUID()
62456
- };
62503
+ const config = { ...mintConfig(), telemetryEnabled: false };
62457
62504
  writeConfig(config);
62458
62505
  return config;
62459
62506
  }
@@ -62472,6 +62519,7 @@ function writeConfigWithResult(config) {
62472
62519
  writeFileSync(tmpFile, JSON.stringify(config, null, 2) + "\n", { mode: 384 });
62473
62520
  renameSync(tmpFile, CONFIG_FILE);
62474
62521
  cachedConfig = { ...config };
62522
+ syncInstallState(config);
62475
62523
  return { ok: true };
62476
62524
  } catch (error) {
62477
62525
  return { ok: false, error: normalizeErrorMessage(error) };
@@ -62483,13 +62531,17 @@ function incrementCommandCount() {
62483
62531
  writeConfig(config);
62484
62532
  return config.commandCount;
62485
62533
  }
62486
- var CONFIG_DIR, CONFIG_FILE, MAX_RECENT_RENDERS, DEFAULT_CONFIG, cachedConfig, CONFIG_PATH;
62534
+ var CONFIG_DIR, CONFIG_FILE, STATE_DIR, STATE_FILE, stateMarkerSynced, stateFiredSynced, MAX_RECENT_RENDERS, DEFAULT_CONFIG, cachedConfig, CONFIG_PATH, STATE_PATH;
62487
62535
  var init_config = __esm({
62488
62536
  "src/telemetry/config.ts"() {
62489
62537
  "use strict";
62490
62538
  init_errorMessage();
62491
62539
  CONFIG_DIR = join3(homedir(), ".hyperframes");
62492
62540
  CONFIG_FILE = join3(CONFIG_DIR, "config.json");
62541
+ STATE_DIR = join3(homedir(), ".local", "state", "hyperframes");
62542
+ STATE_FILE = join3(STATE_DIR, "install-state.json");
62543
+ stateMarkerSynced = false;
62544
+ stateFiredSynced = false;
62493
62545
  MAX_RECENT_RENDERS = 5;
62494
62546
  DEFAULT_CONFIG = {
62495
62547
  telemetryEnabled: true,
@@ -62501,6 +62553,7 @@ var init_config = __esm({
62501
62553
  };
62502
62554
  cachedConfig = null;
62503
62555
  CONFIG_PATH = CONFIG_FILE;
62556
+ STATE_PATH = STATE_FILE;
62504
62557
  }
62505
62558
  });
62506
62559
 
@@ -63471,20 +63524,18 @@ function compareBrowserVersionsDescending(left, right) {
63471
63524
  }
63472
63525
  return 0;
63473
63526
  }
63527
+ function cachedHeadlessShellExecutable(hostPlatform = process.platform, hostArch = process.arch) {
63528
+ return CACHED_HEADLESS_SHELL_EXECUTABLES[`${hostPlatform}/${hostArch}`];
63529
+ }
63474
63530
  function findCachedHeadlessShell(baseDir) {
63475
63531
  if (!existsSync3(baseDir)) return void 0;
63532
+ const executable = cachedHeadlessShellExecutable();
63533
+ if (!executable) return void 0;
63476
63534
  try {
63477
63535
  const versions = readdirSync(baseDir).sort(compareBrowserVersionsDescending);
63478
63536
  for (const version2 of versions) {
63479
- const candidates = [
63480
- join5(baseDir, version2, "chrome-headless-shell-linux64", "chrome-headless-shell"),
63481
- join5(baseDir, version2, "chrome-headless-shell-mac-arm64", "chrome-headless-shell"),
63482
- join5(baseDir, version2, "chrome-headless-shell-mac-x64", "chrome-headless-shell"),
63483
- join5(baseDir, version2, "chrome-headless-shell-win64", "chrome-headless-shell.exe")
63484
- ];
63485
- for (const binary of candidates) {
63486
- if (existsSync3(binary)) return binary;
63487
- }
63537
+ const binary = join5(baseDir, version2, ...executable);
63538
+ if (existsSync3(binary)) return binary;
63488
63539
  }
63489
63540
  } catch {
63490
63541
  }
@@ -63931,7 +63982,7 @@ function getBrowserGpuArgs(mode, platform10) {
63931
63982
  return ["--enable-gpu-rasterization"];
63932
63983
  }
63933
63984
  }
63934
- var _puppeteer, ENABLE_BROWSER_POOL, BEGINFRAME_ONLY_FLAGS, BEGINFRAME_SCREENSHOT_PROBE_ATTEMPTS, BEGINFRAME_PROBE_TIMEOUT_MS, BEGINFRAME_PROBE_CLEANUP_TIMEOUT_MS, _autoBrowserGpuModeCache, browserLeasePool, _cachedVramMb, CANVAS_DRAW_ELEMENT_FEATURE_FLAG, WEBGPU_FLAG;
63985
+ var _puppeteer, CACHED_HEADLESS_SHELL_EXECUTABLES, ENABLE_BROWSER_POOL, BEGINFRAME_ONLY_FLAGS, BEGINFRAME_SCREENSHOT_PROBE_ATTEMPTS, BEGINFRAME_PROBE_TIMEOUT_MS, BEGINFRAME_PROBE_CLEANUP_TIMEOUT_MS, _autoBrowserGpuModeCache, browserLeasePool, _cachedVramMb, CANVAS_DRAW_ELEMENT_FEATURE_FLAG, WEBGPU_FLAG;
63935
63986
  var init_browserManager = __esm({
63936
63987
  "../engine/src/services/browserManager.ts"() {
63937
63988
  "use strict";
@@ -63939,6 +63990,13 @@ var init_browserManager = __esm({
63939
63990
  init_systemMemory();
63940
63991
  init_browserLeasePool();
63941
63992
  init_browserLeasePool();
63993
+ CACHED_HEADLESS_SHELL_EXECUTABLES = {
63994
+ "darwin/arm64": ["chrome-headless-shell-mac-arm64", "chrome-headless-shell"],
63995
+ "darwin/x64": ["chrome-headless-shell-mac-x64", "chrome-headless-shell"],
63996
+ "linux/x64": ["chrome-headless-shell-linux64", "chrome-headless-shell"],
63997
+ "win32/ia32": ["chrome-headless-shell-win32", "chrome-headless-shell.exe"],
63998
+ "win32/x64": ["chrome-headless-shell-win64", "chrome-headless-shell.exe"]
63999
+ };
63942
64000
  ENABLE_BROWSER_POOL = DEFAULT_CONFIG2.enableBrowserPool;
63943
64001
  BEGINFRAME_ONLY_FLAGS = /* @__PURE__ */ new Set([
63944
64002
  "--deterministic-mode",
@@ -66142,6 +66200,12 @@ function appendBrowserDiagnostic(session, text2) {
66142
66200
  }
66143
66201
  async function collectSessionInitTelemetry(page, initStart) {
66144
66202
  const initDurationMs = Date.now() - initStart;
66203
+ let elementCount;
66204
+ try {
66205
+ elementCount = await page.evaluate(() => document.getElementsByTagName("*").length);
66206
+ } catch {
66207
+ elementCount = void 0;
66208
+ }
66145
66209
  let tweenCount = 0;
66146
66210
  try {
66147
66211
  tweenCount = await page.evaluate(() => {
@@ -66164,14 +66228,16 @@ async function collectSessionInitTelemetry(page, initStart) {
66164
66228
  } catch {
66165
66229
  tweenCount = 0;
66166
66230
  }
66167
- return { initDurationMs, tweenCount };
66231
+ return { initDurationMs, tweenCount, elementCount };
66168
66232
  }
66169
66233
  async function recordSessionInitTelemetry(session, initStart) {
66170
66234
  const telemetry = await collectSessionInitTelemetry(session.page, initStart);
66171
66235
  session.initTelemetry = telemetry;
66172
66236
  appendBrowserDiagnostic(
66173
66237
  session,
66174
- `[FrameCapture:INIT] complete initDurationMs=${telemetry.initDurationMs} tweenCount=${telemetry.tweenCount}`
66238
+ `[FrameCapture:INIT] complete initDurationMs=${telemetry.initDurationMs} tweenCount=${telemetry.tweenCount}` + // Omitted rather than zeroed when unmeasured, so the parser reports
66239
+ // absent instead of inventing an empty DOM.
66240
+ (telemetry.elementCount === void 0 ? "" : ` elementCount=${telemetry.elementCount}`)
66175
66241
  );
66176
66242
  }
66177
66243
  function sanitizeDiagnosticUrl(input2) {
@@ -67986,6 +68052,9 @@ function getCapturePerfSummary(session) {
67986
68052
  p95TotalMs: percentileOf(session.capturePerf.frameMs, 0.95),
67987
68053
  p99TotalMs: percentileOf(session.capturePerf.frameMs, 0.99),
67988
68054
  subTimelineWaitOutcome: session.subTimelineWaitOutcome,
68055
+ initDurationMs: session.initTelemetry?.initDurationMs,
68056
+ initTweenCount: session.initTelemetry?.tweenCount,
68057
+ initElementCount: session.initTelemetry?.elementCount,
67989
68058
  warnings: cloneCaptureWarnings(session.warnings),
67990
68059
  staticDedupReused: session.staticDedupCount ?? 0,
67991
68060
  staticDedupEnabled: session.staticDedupEnabled ?? false,
@@ -68091,7 +68160,11 @@ function isExecutablePathCandidate(candidate) {
68091
68160
  }
68092
68161
  function scanPath(name) {
68093
68162
  const pathValue = process.env.PATH;
68094
- if (!pathValue) return void 0;
68163
+ const searchDirs = [
68164
+ ...process.platform === "win32" ? [process.cwd()] : [],
68165
+ ...pathValue ? pathValue.split(delimiter) : []
68166
+ ].filter(Boolean);
68167
+ if (searchDirs.length === 0) return void 0;
68095
68168
  const extensions = process.platform === "win32" ? [
68096
68169
  ".exe",
68097
68170
  ...new Set(
@@ -68100,8 +68173,7 @@ function scanPath(name) {
68100
68173
  ""
68101
68174
  ] : [""];
68102
68175
  const candidates = [];
68103
- for (const dir of pathValue.split(delimiter)) {
68104
- if (!dir) continue;
68176
+ for (const dir of new Set(searchDirs)) {
68105
68177
  for (const ext of extensions) {
68106
68178
  const candidate = join7(dir, `${name}${ext}`);
68107
68179
  if (isExecutablePathCandidate(candidate)) candidates.push(candidate);
@@ -68124,16 +68196,20 @@ function findInProjectLocalBin(name) {
68124
68196
  function lookupOnSystem(name) {
68125
68197
  if (pathLookupCache.has(name)) return pathLookupCache.get(name);
68126
68198
  let found;
68127
- try {
68128
- const command2 = process.platform === "win32" ? "where" : "which";
68129
- const output = execFileSync(command2, [name], {
68130
- encoding: "utf-8",
68131
- stdio: ["pipe", "pipe", "pipe"],
68132
- timeout: 5e3
68133
- });
68134
- found = chooseBestPathCandidate(name, output.split(/\r?\n/));
68135
- } catch {
68199
+ if (process.platform === "win32") {
68136
68200
  found = scanPath(name);
68201
+ } else {
68202
+ try {
68203
+ const output = execFileSync("which", [name], {
68204
+ encoding: "utf-8",
68205
+ stdio: ["pipe", "pipe", "pipe"],
68206
+ timeout: 5e3
68207
+ });
68208
+ const candidate = chooseBestPathCandidate(name, output.split(/\r?\n/));
68209
+ found = candidate && isExecutablePathCandidate(candidate) ? candidate : scanPath(name);
68210
+ } catch {
68211
+ found = scanPath(name);
68212
+ }
68137
68213
  }
68138
68214
  found ??= findInProjectLocalBin(name);
68139
68215
  found ??= findInCommonDirs(name);
@@ -85362,6 +85438,12 @@ function parseAudioElements(html) {
85362
85438
  const end = raw ? parseFloat(raw) : 0;
85363
85439
  return Number.isFinite(end) ? end : 0;
85364
85440
  };
85441
+ const isHidden = (el) => {
85442
+ for (let current2 = el; current2; current2 = current2.parentElement) {
85443
+ if (current2.hasAttribute("data-hidden")) return true;
85444
+ }
85445
+ return false;
85446
+ };
85365
85447
  const build = (el, id, type) => {
85366
85448
  const mediaStartAttr = el.getAttribute("data-media-start");
85367
85449
  const layerAttr = el.getAttribute("data-layer");
@@ -85379,12 +85461,12 @@ function parseAudioElements(html) {
85379
85461
  };
85380
85462
  for (const el of document2.querySelectorAll("audio[id][src]")) {
85381
85463
  const id = el.getAttribute("id");
85382
- if (!id || !el.getAttribute("src")) continue;
85464
+ if (!id || !el.getAttribute("src") || isHidden(el)) continue;
85383
85465
  elements.push(build(el, id, "audio"));
85384
85466
  }
85385
85467
  for (const el of document2.querySelectorAll('video[id][src][data-has-audio="true"]')) {
85386
85468
  const id = el.getAttribute("id");
85387
- if (!id || !el.getAttribute("src")) continue;
85469
+ if (!id || !el.getAttribute("src") || isHidden(el)) continue;
85388
85470
  elements.push(build(el, `${id}-audio`, "video"));
85389
85471
  }
85390
85472
  return elements;
@@ -88898,6 +88980,12 @@ function trackEvent(event, properties = {}, distinctId) {
88898
88980
  // New-agent discovery signals — populated only when agent_runtime is null.
88899
88981
  agent_hint: sys.agent_hint ?? void 0,
88900
88982
  term_program: sys.term_program ?? void 0,
88983
+ // Did this install's mint find a previous install's state marker?
88984
+ // The fleet-wide rate of `true` IS the recoverable-churn fraction —
88985
+ // the share of "new" ids that are really a config wipe on a machine
88986
+ // we already knew. Absent (not false) when the config predates the
88987
+ // marker. Resolved after the shouldTrack guard.
88988
+ install_predecessor_found: readConfig().predecessorFound,
88901
88989
  agent_env_hints: sys.agent_env_hints ?? void 0
88902
88990
  },
88903
88991
  distinctId
@@ -89004,6 +89092,9 @@ function renderObservabilityEventProperties(props) {
89004
89092
  capture_memory_exhaustion_detected: props.captureMemoryExhaustionDetected,
89005
89093
  de_worker_inversion: props.captureDeWorkerInversion,
89006
89094
  de_pre_inversion_workers: props.captureDePreInversionWorkers,
89095
+ composition_element_count: props.captureCompositionElementCount,
89096
+ composition_element_count_source: props.captureCompositionElementCountSource,
89097
+ de_short_band: props.captureDeShortBand,
89007
89098
  de_parallel_router: props.captureDeParallelRouter,
89008
89099
  gpu_renderer: props.captureDeGpuRenderer,
89009
89100
  de_pre_router_workers: props.captureDePreRouterWorkers,
@@ -89024,7 +89115,8 @@ function renderObservabilityEventProperties(props) {
89024
89115
  observability_extract_cache_hits: props.observabilityExtractCacheHits,
89025
89116
  observability_extract_cache_misses: props.observabilityExtractCacheMisses,
89026
89117
  observability_init_duration_ms: props.observabilityInitDurationMs,
89027
- observability_init_tween_count: props.observabilityInitTweenCount
89118
+ observability_init_tween_count: props.observabilityInitTweenCount,
89119
+ observability_init_element_count: props.observabilityInitElementCount
89028
89120
  };
89029
89121
  }
89030
89122
  function redactTelemetryMessage(value) {
@@ -89071,6 +89163,9 @@ function trackRenderComplete(props) {
89071
89163
  de_clamp_reason: props.deClampReason,
89072
89164
  de_worker_inversion: props.deWorkerInversion,
89073
89165
  de_pre_inversion_workers: props.dePreInversionWorkers,
89166
+ composition_element_count: props.compositionElementCount,
89167
+ composition_element_count_source: props.compositionElementCountSource,
89168
+ de_short_band: props.deShortBand,
89074
89169
  de_parallel_router: props.deParallelRouter,
89075
89170
  de_pre_router_workers: props.dePreRouterWorkers,
89076
89171
  de_gate_reason: props.deGateReason,
@@ -96024,6 +96119,9 @@ function renderObservabilityTelemetryPayload(observability) {
96024
96119
  captureMemoryExhaustionDetected: capture2.memoryExhaustionDetected,
96025
96120
  captureDeWorkerInversion: capture2.deWorkerInversion,
96026
96121
  captureDePreInversionWorkers: capture2.dePreInversionWorkers,
96122
+ captureCompositionElementCount: capture2.compositionElementCount,
96123
+ captureCompositionElementCountSource: capture2.compositionElementCountSource,
96124
+ captureDeShortBand: capture2.deShortBand,
96027
96125
  captureDeParallelRouter: capture2.deParallelRouter,
96028
96126
  captureDeGpuRenderer: capture2.deGpuRenderer,
96029
96127
  captureDePreRouterWorkers: capture2.dePreRouterWorkers,
@@ -96044,7 +96142,8 @@ function renderObservabilityTelemetryPayload(observability) {
96044
96142
  observabilityExtractCacheHits: extraction?.cacheHits,
96045
96143
  observabilityExtractCacheMisses: extraction?.cacheMisses,
96046
96144
  observabilityInitDurationMs: init?.initDurationMs,
96047
- observabilityInitTweenCount: init?.tweenCount
96145
+ observabilityInitTweenCount: init?.tweenCount,
96146
+ observabilityInitElementCount: init?.elementCount
96048
96147
  };
96049
96148
  }
96050
96149
  function renderJobObservabilityTelemetryPayload(job) {
@@ -109514,6 +109613,19 @@ var init_fileServer2 = __esm({
109514
109613
  }
109515
109614
  });
109516
109615
 
109616
+ // ../producer/src/services/render/renderFormat.ts
109617
+ function outputNeedsAlpha(format) {
109618
+ return format !== "mp4";
109619
+ }
109620
+ function outputSupportsPageSideShaderCompositing(format) {
109621
+ return format === "mp4" || format === "gif";
109622
+ }
109623
+ var init_renderFormat = __esm({
109624
+ "../producer/src/services/render/renderFormat.ts"() {
109625
+ "use strict";
109626
+ }
109627
+ });
109628
+
109517
109629
  // ../producer/src/utils/paths.ts
109518
109630
  import {
109519
109631
  basename as basename6,
@@ -110393,6 +110505,9 @@ function aggregateDrawElement(perfs, de2) {
110393
110505
  clampReason: de2.clampReason,
110394
110506
  workerInversion: de2.workerInversion ?? "none",
110395
110507
  preInversionWorkers: de2.preInversionWorkers,
110508
+ compositionElementCount: de2.compositionElementCount,
110509
+ compositionElementCountSource: de2.compositionElementCountSource,
110510
+ shortBand: de2.shortBand,
110396
110511
  parallelRouter: de2.parallelRouter ?? "none",
110397
110512
  preRouterWorkers: de2.preRouterWorkers,
110398
110513
  gateReason: gateReasons.length > 0 ? gateReasons.join("|") : void 0,
@@ -110888,22 +111003,24 @@ function readUnsignedIntAfter(line2, prefix) {
110888
111003
  }
110889
111004
  return digits > 0 ? value : void 0;
110890
111005
  }
110891
- function summarizeInitObservability(lines) {
110892
- let initDurationMs;
110893
- let tweenCount;
111006
+ function maxReading(current2, next) {
111007
+ if (next === void 0) return current2;
111008
+ return current2 === void 0 ? next : Math.max(current2, next);
111009
+ }
111010
+ function summarizeInitObservability(lines, fallback) {
111011
+ let initDurationMs = fallback?.initDurationMs;
111012
+ let tweenCount = fallback?.tweenCount;
111013
+ let elementCount = fallback?.elementCount;
110894
111014
  for (const line2 of lines) {
110895
111015
  if (!line2.includes("[FrameCapture:INIT]")) continue;
110896
- const duration = readUnsignedIntAfter(line2, "initDurationMs=");
110897
- const tweens = readUnsignedIntAfter(line2, "tweenCount=");
110898
- if (duration !== void 0) {
110899
- initDurationMs = initDurationMs === void 0 ? duration : Math.max(initDurationMs, duration);
110900
- }
110901
- if (tweens !== void 0) {
110902
- tweenCount = tweenCount === void 0 ? tweens : Math.max(tweenCount, tweens);
110903
- }
111016
+ initDurationMs = maxReading(initDurationMs, readUnsignedIntAfter(line2, "initDurationMs="));
111017
+ tweenCount = maxReading(tweenCount, readUnsignedIntAfter(line2, "tweenCount="));
111018
+ elementCount = maxReading(elementCount, readUnsignedIntAfter(line2, "elementCount="));
111019
+ }
111020
+ if (initDurationMs === void 0 && tweenCount === void 0 && elementCount === void 0) {
111021
+ return void 0;
110904
111022
  }
110905
- if (initDurationMs === void 0 && tweenCount === void 0) return void 0;
110906
- return { initDurationMs, tweenCount };
111023
+ return { initDurationMs, tweenCount, elementCount };
110907
111024
  }
110908
111025
  function summarizeBrowserDiagnostics(lines) {
110909
111026
  let errors = 0;
@@ -111088,7 +111205,7 @@ var init_observability = __esm({
111088
111205
  browserDiagnostics: summarizeBrowserDiagnostics(input2.lastBrowserConsole),
111089
111206
  capture: { ...input2.capture },
111090
111207
  extraction: input2.extraction ? { ...input2.extraction } : void 0,
111091
- init: summarizeInitObservability(input2.lastBrowserConsole)
111208
+ init: summarizeInitObservability(input2.lastBrowserConsole, input2.initFallback)
111092
111209
  };
111093
111210
  }
111094
111211
  hasFailure() {
@@ -115625,7 +115742,7 @@ var init_position_edits_render_inline = __esm({
115625
115742
  });
115626
115743
 
115627
115744
  // ../producer/src/services/htmlCompiler.ts
115628
- import { readFileSync as readFileSync27, existsSync as existsSync45, mkdirSync as mkdirSync21 } from "fs";
115745
+ import { createReadStream as createReadStream2, existsSync as existsSync45, mkdirSync as mkdirSync21, readFileSync as readFileSync27 } from "fs";
115629
115746
  import { join as join41, dirname as dirname21, resolve as resolve30, basename as basename9 } from "path";
115630
115747
  function parseSubCompHtmlForValidity(html) {
115631
115748
  return parseHTML(html).document;
@@ -116523,6 +116640,19 @@ async function localizeRemoteFontFaces(html, downloadDir) {
116523
116640
  (h3, url, relPath) => h3.replaceAll(`url(${url})`, `url("${relPath}")`)
116524
116641
  );
116525
116642
  }
116643
+ async function readLocalFont(absPath) {
116644
+ const chunks = [];
116645
+ let totalBytes = 0;
116646
+ for await (const chunk of createReadStream2(absPath)) {
116647
+ const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
116648
+ totalBytes += buffer.length;
116649
+ if (totalBytes > MAX_LOCAL_FONT_DATA_URI_BYTES) {
116650
+ return { kind: "file-backed" };
116651
+ }
116652
+ chunks.push(buffer);
116653
+ }
116654
+ return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
116655
+ }
116526
116656
  async function embedLocalFontFaces(html, projectDir) {
116527
116657
  const { fontToDataUri: toDataUri } = await Promise.resolve().then(() => (init_fontCompression(), fontCompression_exports));
116528
116658
  const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
@@ -116530,6 +116660,7 @@ async function embedLocalFontFaces(html, projectDir) {
116530
116660
  let result = html;
116531
116661
  const embeddedPaths = /* @__PURE__ */ new Set();
116532
116662
  const dataUriByAbsolutePath = /* @__PURE__ */ new Map();
116663
+ const fileBackedAbsolutePaths = /* @__PURE__ */ new Set();
116533
116664
  let styleMatch;
116534
116665
  while ((styleMatch = styleBlockRe.exec(html)) !== null) {
116535
116666
  const cssText = styleMatch[1] ?? "";
@@ -116544,16 +116675,27 @@ async function embedLocalFontFaces(html, projectDir) {
116544
116675
  if (!localPath || embeddedPaths.has(localPath)) continue;
116545
116676
  const absPath = localPath.startsWith("/") ? localPath : resolve30(projectDir, localPath);
116546
116677
  if (!isPathInside3(absPath, projectDir)) continue;
116547
- if (!existsSync45(absPath)) continue;
116548
116678
  const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
116549
116679
  try {
116680
+ if (fileBackedAbsolutePaths.has(absPath)) {
116681
+ embeddedPaths.add(localPath);
116682
+ continue;
116683
+ }
116550
116684
  let dataUri = dataUriByAbsolutePath.get(absPath);
116551
116685
  if (!dataUri) {
116552
- const buffer = readFileSync27(absPath);
116553
- dataUri = await toDataUri(buffer, ext);
116686
+ const font = await readLocalFont(absPath);
116687
+ if (font.kind === "file-backed") {
116688
+ fileBackedAbsolutePaths.add(absPath);
116689
+ defaultLogger.info(
116690
+ `[Compiler] Kept large local font file-backed: ${localPath} (> ${(MAX_LOCAL_FONT_DATA_URI_BYTES / 1024 / 1024).toFixed(1)} MB)`
116691
+ );
116692
+ embeddedPaths.add(localPath);
116693
+ continue;
116694
+ }
116695
+ dataUri = await toDataUri(font.buffer, ext);
116554
116696
  dataUriByAbsolutePath.set(absPath, dataUri);
116555
116697
  defaultLogger.info(
116556
- `[Compiler] Embedded local font file: ${localPath} (${(buffer.length / 1024).toFixed(0)} KB \u2192 data URI)`
116698
+ `[Compiler] Embedded local font file: ${localPath} (${(font.buffer.length / 1024).toFixed(0)} KB \u2192 data URI)`
116557
116699
  );
116558
116700
  }
116559
116701
  result = result.replaceAll(localPath, dataUri);
@@ -116790,20 +116932,30 @@ async function discoverAudioVolumeAutomationFromTimeline(page, audioIds, composi
116790
116932
  el.volume = Math.max(0, Math.min(1, initialVolumeAttr));
116791
116933
  }
116792
116934
  const keyframes = [];
116793
- for (let t2 = sampleStart; t2 <= sampleEnd + 1e-6; t2 += step) {
116794
- const boundedTime = Math.min(sampleEnd, t2);
116795
- seekTl(boundedTime);
116935
+ let previousSample;
116936
+ for (let t2 = sampleStart; t2 <= sampleEnd + 1e-6; t2 = Math.min(sampleEnd, t2 + step)) {
116937
+ seekTl(t2);
116796
116938
  const rawVolume = Number(el.volume);
116797
- if (!Number.isFinite(rawVolume)) continue;
116939
+ if (!Number.isFinite(rawVolume)) {
116940
+ if (t2 === sampleEnd) break;
116941
+ continue;
116942
+ }
116798
116943
  const volume = Math.max(0, Math.min(1, rawVolume));
116944
+ const sample = {
116945
+ time: Number(t2.toFixed(6)),
116946
+ volume: Number(volume.toFixed(6))
116947
+ };
116799
116948
  const last = keyframes.at(-1);
116800
- if (!last || Math.abs(last.volume - volume) > 1e-4 || boundedTime === sampleEnd) {
116801
- keyframes.push({
116802
- time: Number(boundedTime.toFixed(6)),
116803
- volume: Number(volume.toFixed(6))
116804
- });
116949
+ if (!last || Math.abs(last.volume - volume) > 1e-4) {
116950
+ if (last && previousSample && previousSample.time > last.time) {
116951
+ keyframes.push(previousSample);
116952
+ }
116953
+ keyframes.push(sample);
116954
+ } else if (t2 === sampleEnd && sample.time > last.time) {
116955
+ keyframes.push(sample);
116805
116956
  }
116806
- if (boundedTime === sampleEnd) break;
116957
+ previousSample = sample;
116958
+ if (t2 === sampleEnd) break;
116807
116959
  }
116808
116960
  const staticAttr = Number.parseFloat(el.dataset.volume ?? "");
116809
116961
  const staticVolume = Number.isFinite(staticAttr) ? Math.max(0, Math.min(1, staticAttr)) : 1;
@@ -116957,7 +117109,7 @@ async function recompileWithResolutions(compiled, resolutions, projectDir, downl
116957
117109
  hasShaderTransitions: compiled.hasShaderTransitions
116958
117110
  };
116959
117111
  }
116960
- var EmptyCompositionError, INLINE_SCRIPT_PATTERN, COMPILER_MOUNT_BLOCK_START, COMPILER_MOUNT_BLOCK_END, THREE_D_CONTEXT_PATTERN, MIX_BLEND_MODE_PATTERN, BACKGROUND_IMAGE_DECL_PATTERN, SHADER_TRANSITION_USAGE_PATTERN, ProducerHostIdentityMap, REMOTE_MEDIA_SUBDIR, REMOTE_MEDIA_TAG_RE, REMOTE_IMG_TAG_RE, REMOTE_BG_URL_RE, REMOTE_FONTFACE_URL_RE, MAX_STYLESHEET_BYTES, LOCAL_FONTFACE_URL_RE, GSAP_CDN_BASE;
117112
+ var EmptyCompositionError, INLINE_SCRIPT_PATTERN, COMPILER_MOUNT_BLOCK_START, COMPILER_MOUNT_BLOCK_END, THREE_D_CONTEXT_PATTERN, MIX_BLEND_MODE_PATTERN, BACKGROUND_IMAGE_DECL_PATTERN, SHADER_TRANSITION_USAGE_PATTERN, ProducerHostIdentityMap, REMOTE_MEDIA_SUBDIR, REMOTE_MEDIA_TAG_RE, REMOTE_IMG_TAG_RE, REMOTE_BG_URL_RE, REMOTE_FONTFACE_URL_RE, MAX_STYLESHEET_BYTES, LOCAL_FONTFACE_URL_RE, MAX_LOCAL_FONT_DATA_URI_BYTES, GSAP_CDN_BASE;
116961
117113
  var init_htmlCompiler2 = __esm({
116962
117114
  "../producer/src/services/htmlCompiler.ts"() {
116963
117115
  "use strict";
@@ -117035,6 +117187,7 @@ Check that each file referenced by data-composition-src contains valid HTML with
117035
117187
  REMOTE_FONTFACE_URL_RE = /url\(["']?(https?:\/\/[^"')]+)["']?\)/gi;
117036
117188
  MAX_STYLESHEET_BYTES = 2 * 1024 * 1024;
117037
117189
  LOCAL_FONTFACE_URL_RE = /url\(["']?(?!data:|https?:\/\/)([^"')]+)["']?\)/gi;
117190
+ MAX_LOCAL_FONT_DATA_URI_BYTES = 5 * 1024 * 1024;
117038
117191
  GSAP_CDN_BASE = "https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/";
117039
117192
  }
117040
117193
  });
@@ -117230,6 +117383,9 @@ function hasRuntimeInsertedMedia(html) {
117230
117383
  const scriptBodies = [...document2.querySelectorAll("script")].map((script) => script.textContent ?? "").join("\n");
117231
117384
  return /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(scriptBodies) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(scriptBodies) || /<(?:video|audio)\b[^>]*>/i.test(scriptBodies);
117232
117385
  }
117386
+ function probeRequiresBrowser(args) {
117387
+ return args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
117388
+ }
117233
117389
  async function runProbeStage(input2) {
117234
117390
  const {
117235
117391
  projectDir,
@@ -117259,7 +117415,14 @@ async function runProbeStage(input2) {
117259
117415
  );
117260
117416
  const hasVariableMedia = hasVariableBoundMedia(compiled.html, job.config.variables);
117261
117417
  const hasInsertedMedia = hasRuntimeInsertedMedia(compiled.html);
117262
- const needsBrowser = composition.duration <= 0 || compiled.unresolvedCompositions.length > 0 || hasAutoStart || hasScriptedAudio || hasVariableMedia || hasInsertedMedia;
117418
+ const needsBrowser = probeRequiresBrowser({
117419
+ durationSeconds: composition.duration,
117420
+ unresolvedCompositionCount: compiled.unresolvedCompositions.length,
117421
+ hasAutoStart,
117422
+ hasScriptedAudio,
117423
+ hasVariableMedia,
117424
+ hasInsertedMedia
117425
+ });
117263
117426
  if (needsBrowser) {
117264
117427
  const reasons = [];
117265
117428
  if (composition.duration <= 0) reasons.push("root duration unknown");
@@ -120647,6 +120810,7 @@ function fpsToFfmpegArg2(fps) {
120647
120810
  }
120648
120811
  function buildGifPalettegenArgs(input2) {
120649
120812
  const fpsArg = fpsToFfmpegArg2(input2.fps);
120813
+ const transparency = input2.preserveAlpha ? ":reserve_transparent=1" : "";
120650
120814
  return [
120651
120815
  "-y",
120652
120816
  "-framerate",
@@ -120654,12 +120818,13 @@ function buildGifPalettegenArgs(input2) {
120654
120818
  "-i",
120655
120819
  join55(input2.framesDir, input2.framePattern),
120656
120820
  "-vf",
120657
- `fps=${fpsArg},palettegen=stats_mode=diff`,
120821
+ `fps=${fpsArg},palettegen=stats_mode=diff${transparency}`,
120658
120822
  input2.palettePath
120659
120823
  ];
120660
120824
  }
120661
120825
  function buildGifPaletteuseArgs(input2) {
120662
120826
  const fpsArg = fpsToFfmpegArg2(input2.fps);
120827
+ const transparency = input2.preserveAlpha ? ":alpha_threshold=128" : "";
120663
120828
  return [
120664
120829
  "-y",
120665
120830
  "-framerate",
@@ -120669,7 +120834,7 @@ function buildGifPaletteuseArgs(input2) {
120669
120834
  "-i",
120670
120835
  input2.palettePath,
120671
120836
  "-lavfi",
120672
- `fps=${fpsArg} [x]; [x][1:v] paletteuse=dither=sierra2_4a`,
120837
+ `fps=${fpsArg} [x]; [x][1:v] paletteuse=dither=sierra2_4a${transparency}`,
120673
120838
  "-loop",
120674
120839
  String(input2.loop),
120675
120840
  input2.outputPath
@@ -120711,7 +120876,8 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input2) {
120711
120876
  palettePath: input2.palettePath,
120712
120877
  outputPath,
120713
120878
  fps: input2.fps,
120714
- loop: input2.loop
120879
+ loop: input2.loop,
120880
+ preserveAlpha: input2.preserveAlpha
120715
120881
  };
120716
120882
  try {
120717
120883
  const paletteResult = await runFfmpeg(buildGifPalettegenArgs(argsInput), {
@@ -120803,12 +120969,14 @@ async function runEncodeStage(input2) {
120803
120969
  if (hasAudio) {
120804
120970
  log2.warn("[Render] GIF output does not support audio; audio tracks will be ignored.");
120805
120971
  }
120806
- const framePattern2 = "frame_%06d.jpg";
120972
+ const frameExt2 = needsAlpha ? "png" : "jpg";
120973
+ const framePattern2 = `frame_%06d.${frameExt2}`;
120807
120974
  const loop = resolveGifLoop(job.config.gifLoop);
120808
120975
  const encodeResult2 = await encodeGifFromDir(framesDir, framePattern2, outputPath, {
120809
120976
  fps: job.config.fps,
120810
120977
  loop,
120811
120978
  palettePath: join56(dirname24(videoOnlyPath), "gif-palette.png"),
120979
+ preserveAlpha: needsAlpha,
120812
120980
  signal: abortSignal,
120813
120981
  timeout: engineCfg.ffmpegEncodeTimeout
120814
120982
  });
@@ -121626,6 +121794,65 @@ function shouldUseStreamingEncode(cfg, outputFormat, workerCount, durationSecond
121626
121794
  if (forceParallelStream || process.env.HF_DE_PARALLEL_STREAM === "true") return true;
121627
121795
  return workerCount === 1;
121628
121796
  }
121797
+ function envInt(name, fallback) {
121798
+ const raw = process.env[name];
121799
+ if (raw === void 0 || raw.trim() === "") return fallback;
121800
+ const parsed = Number(raw);
121801
+ return Number.isInteger(parsed) ? parsed : fallback;
121802
+ }
121803
+ function countElementTags(html) {
121804
+ let markup = html;
121805
+ for (let previous = ""; markup !== previous; ) {
121806
+ previous = markup;
121807
+ markup = markup.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, "");
121808
+ }
121809
+ const matches2 = markup.match(
121810
+ /<\/[a-zA-Z]|<(?:img|br|hr|input|source|track|area|base|col|embed|link|meta|param|wbr)\b|<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\/>/gi
121811
+ );
121812
+ return matches2 === null ? 0 : matches2.length;
121813
+ }
121814
+ async function resolveCompositionElementCount(probeSession, html) {
121815
+ if (probeSession?.isInitialized) {
121816
+ try {
121817
+ const liveCount = await probeSession.page.evaluate(
121818
+ // Live HTMLCollection length — avoids materializing a static NodeList
121819
+ // on the large-DOM comps this gate exists to catch (review nit).
121820
+ () => document.getElementsByTagName("*").length
121821
+ );
121822
+ if (typeof liveCount === "number" && Number.isFinite(liveCount)) {
121823
+ return { count: liveCount, source: "live" };
121824
+ }
121825
+ } catch {
121826
+ }
121827
+ }
121828
+ return { count: countElementTags(html), source: "static" };
121829
+ }
121830
+ function mergeWorkerInitObservability(perfs) {
121831
+ let initDurationMs;
121832
+ let tweenCount;
121833
+ let elementCount;
121834
+ for (const perf of perfs) {
121835
+ if (perf.initDurationMs !== void 0) {
121836
+ initDurationMs = initDurationMs === void 0 ? perf.initDurationMs : Math.max(initDurationMs, perf.initDurationMs);
121837
+ }
121838
+ if (perf.initTweenCount !== void 0) {
121839
+ tweenCount = tweenCount === void 0 ? perf.initTweenCount : Math.max(tweenCount, perf.initTweenCount);
121840
+ }
121841
+ if (perf.initElementCount !== void 0) {
121842
+ elementCount = elementCount === void 0 ? perf.initElementCount : Math.max(elementCount, perf.initElementCount);
121843
+ }
121844
+ }
121845
+ if (initDurationMs === void 0 && tweenCount === void 0 && elementCount === void 0) {
121846
+ return void 0;
121847
+ }
121848
+ return { initDurationMs, tweenCount, elementCount };
121849
+ }
121850
+ function resolveDeShortBand(args) {
121851
+ const decisive = args.bandEnabled && args.invertAtBandFloor && !args.invertAtBaseFloor;
121852
+ if (!decisive) return void 0;
121853
+ if (args.elementCountSource !== "live") return "unmeasured";
121854
+ return args.bandOpen ? "applied" : "skipped_elements";
121855
+ }
121629
121856
  function shouldPreferSingleWorkerDrawElement(args) {
121630
121857
  return args.workerCount > 1 && typeof args.requestedWorkers !== "number" && args.useDrawElement && !args.deCompileGate && !args.forceScreenshot && args.outputFormat === "mp4" && args.minFrames > 0 && args.totalFrames >= args.minFrames && args.singleWorkerStreamingOk && !args.layeredOrEffectRoute && !args.supersampling && !args.probeDeGated && !args.experimentalParallelDeOptIn;
121631
121858
  }
@@ -121782,8 +122009,6 @@ async function executeRenderPipeline(input2) {
121782
122009
  renderJobId: job.id
121783
122010
  });
121784
122011
  const outputFormat = job.config.format ?? "mp4";
121785
- const isWebm = outputFormat === "webm";
121786
- const isMov = outputFormat === "mov";
121787
122012
  const isPngSequence = outputFormat === "png-sequence";
121788
122013
  const isGif = outputFormat === "gif";
121789
122014
  const artifactTransaction = new ArtifactTransaction(
@@ -121791,7 +122016,7 @@ async function executeRenderPipeline(input2) {
121791
122016
  isPngSequence ? "directory" : "file"
121792
122017
  );
121793
122018
  const stagedOutputPath = artifactTransaction.stagingPath;
121794
- const needsAlpha = isWebm || isMov || isPngSequence;
122019
+ const needsAlpha = outputNeedsAlpha(outputFormat);
121795
122020
  const enableChunkedEncode = cfg.enableChunkedEncode;
121796
122021
  const chunkedEncodeSize = cfg.chunkSizeFrames;
121797
122022
  const captureObservability = {
@@ -122219,8 +122444,14 @@ async function executeRenderPipeline(input2) {
122219
122444
  const deSingleMinFramesRaw = process.env.HF_DE_SINGLE_MIN_FRAMES;
122220
122445
  const deSingleMinFramesNum = deSingleMinFramesRaw === void 0 || deSingleMinFramesRaw.trim() === "" ? 900 : Number(deSingleMinFramesRaw);
122221
122446
  const deSingleMinFrames = Number.isFinite(deSingleMinFramesNum) ? deSingleMinFramesNum : 900;
122447
+ const deShortBandMinFrames = envInt("HF_DE_SHORT_MIN_FRAMES", 250);
122448
+ const deShortBandMaxElements = envInt("HF_DE_SHORT_MAX_ELEMENTS", 2500);
122449
+ const { count: compositionElementCount, source: compositionElementCountSource } = await resolveCompositionElementCount(probeSession, compiled.html);
122450
+ const deShortBandEnabled = deShortBandMaxElements > 0;
122451
+ const deShortBandOpen = deShortBandEnabled && deShortBandMinFrames > 0 && compositionElementCountSource === "live" && compositionElementCount <= deShortBandMaxElements;
122452
+ const deShortBandRoute = process.env.HF_DE_SHORT_BAND_ROUTE === "true";
122222
122453
  const WOULD_RESOLVE_MULTI_WORKER = 2;
122223
- const deInversionEligible = shouldPreferSingleWorkerDrawElement({
122454
+ const deInversionArgs = {
122224
122455
  workerCount: WOULD_RESOLVE_MULTI_WORKER,
122225
122456
  requestedWorkers: job.config.workers,
122226
122457
  useDrawElement: cfg.useDrawElement,
@@ -122235,7 +122466,21 @@ async function executeRenderPipeline(input2) {
122235
122466
  probeDeGated: probeSession !== null && probeSession.captureMode !== "drawelement" && !probeSession.deInitDeferred,
122236
122467
  experimentalParallelDeOptIn: process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true" || // Verified parallel DE streaming (opt-in) wants its parallelism kept.
122237
122468
  process.env.HF_DE_PARALLEL_STREAM === "true"
122469
+ };
122470
+ const invertAtBaseFloor = shouldPreferSingleWorkerDrawElement(deInversionArgs);
122471
+ const invertAtBandFloor = shouldPreferSingleWorkerDrawElement({
122472
+ ...deInversionArgs,
122473
+ minFrames: Math.min(deSingleMinFrames, deShortBandMinFrames)
122474
+ });
122475
+ const deShortBand = resolveDeShortBand({
122476
+ invertAtBaseFloor,
122477
+ invertAtBandFloor,
122478
+ bandEnabled: deShortBandEnabled,
122479
+ bandOpen: deShortBandOpen,
122480
+ elementCountSource: compositionElementCountSource
122238
122481
  });
122482
+ const deInversionEligible = deShortBandRoute && deShortBand === "applied" ? invertAtBandFloor : invertAtBaseFloor;
122483
+ const deInversionEffectiveMinFrames = deShortBandRoute && deShortBand === "applied" ? Math.min(deSingleMinFrames, deShortBandMinFrames) : deSingleMinFrames;
122239
122484
  const deParallelRouterEnabled = process.env.HF_DE_PARALLEL_ROUTER === "true";
122240
122485
  const deParallelMinFramesRaw = process.env.HF_DE_PARALLEL_MIN_FRAMES;
122241
122486
  const deParallelMinFramesNum = deParallelMinFramesRaw === void 0 || deParallelMinFramesRaw.trim() === "" ? 700 : Number(deParallelMinFramesRaw);
@@ -122375,7 +122620,7 @@ async function executeRenderPipeline(input2) {
122375
122620
  } else if (deInversionEligible && workerCount > 1) {
122376
122621
  deWorkerInversion = "inverted";
122377
122622
  log2.info(
122378
- `[Render] Fast capture: single-worker drawElement streaming preferred over ${workerCount}-worker screenshot capture (${totalFrames} frames >= ${deSingleMinFrames}; verified path, measured faster at every worker count). Set HF_DE_SINGLE_MIN_FRAMES=0 or --workers N to override.`
122623
+ `[Render] Fast capture: single-worker drawElement streaming preferred over ${workerCount}-worker screenshot capture (${totalFrames} frames >= ${deInversionEffectiveMinFrames}; verified path, measured faster at every worker count). Set HF_DE_SINGLE_MIN_FRAMES=0 or --workers N to override.`
122379
122624
  );
122380
122625
  workerCount = 1;
122381
122626
  }
@@ -122390,6 +122635,12 @@ async function executeRenderPipeline(input2) {
122390
122635
  // any resource-pressure failure unique to this cohort.
122391
122636
  dePreInversionWorkers: deWorkerInversion ? preRoutingWorkerCount : void 0,
122392
122637
  dePreRouterWorkers: deParallelRouter ? preRoutingWorkerCount : void 0,
122638
+ // Short-comp band attribution — see the field docs. Emitted on every
122639
+ // render so the fleet element-count distribution is readable, and so a
122640
+ // perf shift can be split into "the new band did it" vs "unchanged".
122641
+ compositionElementCount,
122642
+ compositionElementCountSource,
122643
+ deShortBand,
122393
122644
  // Same rationale as the counters above: carried on live capture
122394
122645
  // observability, not only the success-path perfSummary, so a crash /
122395
122646
  // OOM / timeout still reports which GPU backend it happened on. That
@@ -122468,7 +122719,7 @@ async function executeRenderPipeline(input2) {
122468
122719
  };
122469
122720
  const videoExt = FORMAT_EXT3[outputFormat] ?? ".mp4";
122470
122721
  const videoOnlyPath = join57(workDir, `video-only${videoExt}`);
122471
- const usePageSideCompositingForTransitions = (cfg.enablePageSideCompositing || isGif) && compiled.hasShaderTransitions && !hasHdrContent && !isPngSequence && !needsAlpha;
122722
+ const usePageSideCompositingForTransitions = (cfg.enablePageSideCompositing || isGif) && compiled.hasShaderTransitions && !hasHdrContent && outputSupportsPageSideShaderCompositing(outputFormat);
122472
122723
  if (usePageSideCompositingForTransitions) {
122473
122724
  activeFileServer.addPreHeadScript(HF_PAGE_SIDE_COMPOSITING_STUB);
122474
122725
  if (shouldDiscardProbeSessionForPageSideCompositing({
@@ -122488,7 +122739,7 @@ async function executeRenderPipeline(input2) {
122488
122739
  });
122489
122740
  updateCaptureObservability({ forceScreenshot: captureForceScreenshot });
122490
122741
  log2.info(
122491
- "[Render] Page-side compositing enabled \u2014 bypassing Node-side layered shader-blend path. Engine will capture one opaque RGB screenshot per output frame."
122742
+ `[Render] Page-side compositing enabled \u2014 bypassing Node-side layered shader-blend path. Engine will capture one ${needsAlpha ? "RGBA PNG" : "opaque RGB"} screenshot per output frame.`
122492
122743
  );
122493
122744
  }
122494
122745
  const useLayeredComposite = !usePageSideCompositingForTransitions && shouldUseLayeredComposite({
@@ -122984,6 +123235,7 @@ async function executeRenderPipeline(input2) {
122984
123235
  const observabilitySummary = observability.summary({
122985
123236
  lastBrowserConsole,
122986
123237
  capture: captureObservability,
123238
+ initFallback: mergeWorkerInitObservability(dedupPerfs),
122987
123239
  extraction: extractionObservability,
122988
123240
  compositionHash
122989
123241
  });
@@ -123011,6 +123263,9 @@ async function executeRenderPipeline(input2) {
123011
123263
  clampReason: deClampReason,
123012
123264
  workerInversion: deWorkerInversion,
123013
123265
  preInversionWorkers: deWorkerInversion ? preRoutingWorkerCount : void 0,
123266
+ compositionElementCount,
123267
+ compositionElementCountSource,
123268
+ shortBand: deShortBand,
123014
123269
  parallelRouter: deParallelRouter,
123015
123270
  preRouterWorkers: deParallelRouter ? preRoutingWorkerCount : void 0,
123016
123271
  selfVerifyFallback: deSelfVerifyFallback,
@@ -123088,6 +123343,7 @@ async function executeRenderPipeline(input2) {
123088
123343
  const observabilitySummary = observability.summary({
123089
123344
  lastBrowserConsole,
123090
123345
  capture: captureObservability,
123346
+ initFallback: mergeWorkerInitObservability(dedupPerfs),
123091
123347
  extraction: extractionObservability,
123092
123348
  compositionHash
123093
123349
  });
@@ -123139,6 +123395,7 @@ var init_renderOrchestrator = __esm({
123139
123395
  init_src();
123140
123396
  init_fileServer2();
123141
123397
  init_logger();
123398
+ init_renderFormat();
123142
123399
  init_shared();
123143
123400
  init_cleanup();
123144
123401
  init_renderEventPublisher();
@@ -123922,7 +124179,7 @@ import {
123922
124179
  mkdtempSync as mkdtempSync8,
123923
124180
  writeFileSync as writeFileSync18,
123924
124181
  rmSync as rmSync17,
123925
- createReadStream as createReadStream2
124182
+ createReadStream as createReadStream3
123926
124183
  } from "fs";
123927
124184
  import { resolve as resolve34, dirname as dirname27, join as join60 } from "path";
123928
124185
  import { tmpdir as tmpdir9 } from "os";
@@ -124436,7 +124693,7 @@ function createRenderHandlers(options = {}) {
124436
124693
  return c3.json({ success: false, error: "Output artifact file missing" }, 404);
124437
124694
  }
124438
124695
  const stats = statSync17(artifact.path);
124439
- return new Response(createReadStream2(artifact.path), {
124696
+ return new Response(createReadStream3(artifact.path), {
124440
124697
  headers: {
124441
124698
  "content-type": "video/mp4",
124442
124699
  "content-length": String(stats.size),
@@ -125518,7 +125775,7 @@ async function plan(projectDir, config, planDir) {
125518
125775
  }
125519
125776
  });
125520
125777
  const finalCompiledDir = join65(planDir, "compiled");
125521
- const needsAlpha = config.format === "png-sequence" || config.format === "mov" || config.format === "webm";
125778
+ const needsAlpha = outputNeedsAlpha(config.format);
125522
125779
  const compileResult = await runCompileStage({
125523
125780
  projectDir,
125524
125781
  workDir,
@@ -125752,6 +126009,7 @@ var init_plan = __esm({
125752
126009
  init_planHash();
125753
126010
  init_planValidation();
125754
126011
  init_runtimeEnvSnapshot();
126012
+ init_renderFormat();
125755
126013
  init_shared2();
125756
126014
  init_planProtocol();
125757
126015
  init_planSize();
@@ -127768,7 +128026,7 @@ function findFromEnv2() {
127768
128026
  }
127769
128027
  async function findFromHyperframesCache() {
127770
128028
  if (!existsSync63(CACHE_DIR2)) return {};
127771
- const { Browser, getInstalledBrowsers } = await loadPuppeteerBrowsers();
128029
+ const { Browser, detectBrowserPlatform, getInstalledBrowsers } = await loadPuppeteerBrowsers();
127772
128030
  let installed;
127773
128031
  try {
127774
128032
  installed = await getInstalledBrowsers({ cacheDir: CACHE_DIR2 });
@@ -127780,8 +128038,9 @@ async function findFromHyperframesCache() {
127780
128038
  );
127781
128039
  installed = [];
127782
128040
  }
128041
+ const hostPlatform = detectBrowserPlatform();
127783
128042
  const match = installed.find(
127784
- (b2) => b2.browser === Browser.CHROMEHEADLESSSHELL && b2.buildId === CHROME_VERSION
128043
+ (b2) => b2.browser === Browser.CHROMEHEADLESSSHELL && b2.buildId === CHROME_VERSION && b2.platform === hostPlatform
127785
128044
  );
127786
128045
  if (match && existsSync63(match.executablePath)) {
127787
128046
  return { result: { executablePath: match.executablePath, source: "cache" } };
@@ -127826,8 +128085,13 @@ function compareVersionDirsDescending(a, b2) {
127826
128085
  }
127827
128086
  return 0;
127828
128087
  }
128088
+ function cachedHeadlessShellExecutable2(hostPlatform = process.platform, hostArch = process.arch) {
128089
+ return CACHED_HEADLESS_SHELL_EXECUTABLES2[`${hostPlatform}/${hostArch}`];
128090
+ }
127829
128091
  function findFromPuppeteerCache() {
127830
128092
  if (!existsSync63(PUPPETEER_CACHE_DIR)) return void 0;
128093
+ const executable = cachedHeadlessShellExecutable2();
128094
+ if (!executable) return void 0;
127831
128095
  let versions;
127832
128096
  try {
127833
128097
  versions = [...readdirSync24(PUPPETEER_CACHE_DIR)].sort(compareVersionDirsDescending);
@@ -127835,26 +128099,9 @@ function findFromPuppeteerCache() {
127835
128099
  return void 0;
127836
128100
  }
127837
128101
  for (const version2 of versions) {
127838
- const candidates = [
127839
- join74(PUPPETEER_CACHE_DIR, version2, "chrome-headless-shell-linux64", "chrome-headless-shell"),
127840
- join74(
127841
- PUPPETEER_CACHE_DIR,
127842
- version2,
127843
- "chrome-headless-shell-mac-arm64",
127844
- "chrome-headless-shell"
127845
- ),
127846
- join74(PUPPETEER_CACHE_DIR, version2, "chrome-headless-shell-mac-x64", "chrome-headless-shell"),
127847
- join74(
127848
- PUPPETEER_CACHE_DIR,
127849
- version2,
127850
- "chrome-headless-shell-win64",
127851
- "chrome-headless-shell.exe"
127852
- )
127853
- ];
127854
- for (const binary of candidates) {
127855
- if (existsSync63(binary)) {
127856
- return { executablePath: binary, source: "cache" };
127857
- }
128102
+ const binary = join74(PUPPETEER_CACHE_DIR, version2, ...executable);
128103
+ if (existsSync63(binary)) {
128104
+ return { executablePath: binary, source: "cache" };
127858
128105
  }
127859
128106
  }
127860
128107
  return void 0;
@@ -128069,7 +128316,7 @@ function clearBrowser() {
128069
128316
  function isLinuxArm() {
128070
128317
  return process.platform === "linux" && process.arch === "arm64";
128071
128318
  }
128072
- var CHROME_VERSION, CACHE_ROOT_DIR, CACHE_DIR2, PUPPETEER_CACHE_DIR, INSTALL_LOCK_DIR, INSTALL_RECLAIM_LOCK_DIR, INSTALL_LOCK_TIMINGS, SYSTEM_CHROME_PATHS, _warnedSystemFallback;
128319
+ var CHROME_VERSION, CACHE_ROOT_DIR, CACHE_DIR2, PUPPETEER_CACHE_DIR, INSTALL_LOCK_DIR, INSTALL_RECLAIM_LOCK_DIR, INSTALL_LOCK_TIMINGS, SYSTEM_CHROME_PATHS, CACHED_HEADLESS_SHELL_EXECUTABLES2, _warnedSystemFallback;
128073
128320
  var init_manager2 = __esm({
128074
128321
  "src/browser/manager.ts"() {
128075
128322
  "use strict";
@@ -128092,6 +128339,13 @@ var init_manager2 = __esm({
128092
128339
  "/usr/bin/chromium",
128093
128340
  "/usr/bin/chromium-browser"
128094
128341
  ];
128342
+ CACHED_HEADLESS_SHELL_EXECUTABLES2 = {
128343
+ "darwin/arm64": ["chrome-headless-shell-mac-arm64", "chrome-headless-shell"],
128344
+ "darwin/x64": ["chrome-headless-shell-mac-x64", "chrome-headless-shell"],
128345
+ "linux/x64": ["chrome-headless-shell-linux64", "chrome-headless-shell"],
128346
+ "win32/ia32": ["chrome-headless-shell-win32", "chrome-headless-shell.exe"],
128347
+ "win32/x64": ["chrome-headless-shell-win64", "chrome-headless-shell.exe"]
128348
+ };
128095
128349
  _warnedSystemFallback = false;
128096
128350
  }
128097
128351
  });
@@ -131549,7 +131803,7 @@ var init_mediaProxyPreview = __esm({
131549
131803
  });
131550
131804
 
131551
131805
  // src/utils/compositionServer.ts
131552
- import { createReadStream as createReadStream3, existsSync as existsSync69, statSync as statSync25 } from "fs";
131806
+ import { createReadStream as createReadStream4, existsSync as existsSync69, statSync as statSync25 } from "fs";
131553
131807
  import { resolve as resolve43, dirname as dirname35 } from "path";
131554
131808
  import { Readable as Readable3 } from "stream";
131555
131809
  import { fileURLToPath as fileURLToPath10 } from "url";
@@ -131597,7 +131851,7 @@ function buildRangeResponse(filePath, contentType, rangeHeader) {
131597
131851
  const size = statSync25(filePath).size;
131598
131852
  const last = size - 1;
131599
131853
  const match = rangeHeader ? /^bytes=(\d*)-(\d*)$/.exec(rangeHeader.trim()) : null;
131600
- const body = (start2, end2) => size === 0 ? null : Readable3.toWeb(createReadStream3(filePath, { start: start2, end: end2 }));
131854
+ const body = (start2, end2) => size === 0 ? null : Readable3.toWeb(createReadStream4(filePath, { start: start2, end: end2 }));
131601
131855
  if (!match) {
131602
131856
  return new Response(body(0, last), {
131603
131857
  status: 200,
@@ -134160,9 +134414,10 @@ function resolveBrowserTimeoutMsArg(raw) {
134160
134414
  }
134161
134415
  return result.value;
134162
134416
  }
134163
- function resolveDiagnosticNavigationTimeoutMs(env = process.env) {
134417
+ function resolveDiagnosticNavigationTimeoutMs(env = process.env, minimumTimeoutMs = 0) {
134164
134418
  const parsed = Number(env.PRODUCER_PAGE_NAVIGATION_TIMEOUT_MS);
134165
- return Number.isFinite(parsed) && parsed > 0 ? parsed : 1e4;
134419
+ const configured = Number.isFinite(parsed) && parsed > 0 ? parsed : 1e4;
134420
+ return Math.max(configured, minimumTimeoutMs);
134166
134421
  }
134167
134422
  function normalizeCompositionEntryArg(raw) {
134168
134423
  const trimmed = raw?.trim().replace(/^\.\//, "") || void 0;
@@ -136520,6 +136775,9 @@ function trackRenderMetrics(job, elapsedMs, options, docker) {
136520
136775
  deClampReason: perf?.drawElement?.clampReason,
136521
136776
  deWorkerInversion: perf?.drawElement?.workerInversion,
136522
136777
  dePreInversionWorkers: perf?.drawElement?.preInversionWorkers,
136778
+ compositionElementCount: perf?.drawElement?.compositionElementCount,
136779
+ compositionElementCountSource: perf?.drawElement?.compositionElementCountSource,
136780
+ deShortBand: perf?.drawElement?.shortBand,
136523
136781
  deParallelRouter: perf?.drawElement?.parallelRouter,
136524
136782
  dePreRouterWorkers: perf?.drawElement?.preRouterWorkers,
136525
136783
  deGateReason: perf?.drawElement?.gateReason,
@@ -136997,7 +137255,7 @@ __export(staticProjectServer_exports, {
136997
137255
  serveStaticProjectHtml: () => serveStaticProjectHtml
136998
137256
  });
136999
137257
  import { createServer as createServer2 } from "http";
137000
- import { createReadStream as createReadStream4, existsSync as existsSync77, statSync as statSync29 } from "fs";
137258
+ import { createReadStream as createReadStream5, existsSync as existsSync77, statSync as statSync29 } from "fs";
137001
137259
  import { isAbsolute as isAbsolute14, relative as relative20, resolve as resolve55 } from "path";
137002
137260
  function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
137003
137261
  const size = statSync29(filePath).size;
@@ -137023,7 +137281,7 @@ function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeTyp
137023
137281
  headers["Content-Range"] = `bytes ${start}-${end}/${size}`;
137024
137282
  }
137025
137283
  headers["Content-Length"] = String(end - start + 1);
137026
- const stream = createReadStream4(filePath, { start, end });
137284
+ const stream = createReadStream5(filePath, { start, end });
137027
137285
  stream.on("open", () => {
137028
137286
  res.writeHead(status, headers);
137029
137287
  stream.pipe(res);
@@ -137773,7 +138031,7 @@ async function openSettledCompositionPage(html, url, options) {
137773
138031
  await options.beforeNavigate?.(page);
137774
138032
  await page.goto(url, {
137775
138033
  waitUntil: "domcontentloaded",
137776
- timeout: resolveDiagnosticNavigationTimeoutMs()
138034
+ timeout: resolveDiagnosticNavigationTimeoutMs(process.env, options.navigationTimeoutMs)
137777
138035
  });
137778
138036
  const renderReadyTimedOut = !await waitForCompositionSettle(page, options);
137779
138037
  return { browser: chromeBrowser, page, renderReadyTimedOut };
@@ -139078,6 +139336,7 @@ async function runBrowserCheck(project, options, motion, runGrid) {
139078
139336
  try {
139079
139337
  const launchSettleStart = Date.now();
139080
139338
  const session = await openSettledCompositionPage(html, server.url, {
139339
+ navigationTimeoutMs: options.timeout,
139081
139340
  renderReadyTimeoutMs: options.timeout,
139082
139341
  renderReadyWarningSuffix: "checking the current page state",
139083
139342
  browserGpuMode: resolveCliChromeGpuMode(),
@@ -139121,6 +139380,7 @@ async function captureFindingCrops(project, options, requests) {
139121
139380
  const written = [];
139122
139381
  try {
139123
139382
  const session = await openSettledCompositionPage(html, server.url, {
139383
+ navigationTimeoutMs: options.timeout,
139124
139384
  renderReadyTimeoutMs: options.timeout,
139125
139385
  renderReadyWarningSuffix: "capturing finding crops",
139126
139386
  browserGpuMode: resolveCliChromeGpuMode()
@@ -140997,7 +141257,7 @@ function createCheckCommand(dependencies = DEFAULT_COMMAND_DEPENDENCIES) {
140997
141257
  },
140998
141258
  timeout: {
140999
141259
  type: "string",
141000
- description: "Ms to wait for scripts and media to settle initially (default: 3000)",
141260
+ description: "Initial render-ready timeout in ms; also sets the navigation minimum (10s floor, default: 3000)",
141001
141261
  default: "3000"
141002
141262
  },
141003
141263
  contrast: {
@@ -147547,6 +147807,7 @@ function runStatus() {
147547
147807
  console.log(` ${c.dim("Status:")} ${status}`);
147548
147808
  console.log(` ${c.dim("Source:")} ${effective.source}`);
147549
147809
  console.log(` ${c.dim("Config:")} ${c.accent(CONFIG_PATH)}`);
147810
+ console.log(` ${c.dim("State:")} ${c.accent(STATE_PATH)}`);
147550
147811
  console.log(` ${c.dim("Tracked commands:")} ${c.bold(String(config.commandCount))}`);
147551
147812
  console.log();
147552
147813
  console.log(` ${c.dim("Disable:")} ${c.accent("hyperframes telemetry disable")}`);
@@ -154044,7 +154305,7 @@ var require_node_domexception = __commonJS({
154044
154305
  });
154045
154306
 
154046
154307
  // ../../node_modules/.bun/fetch-blob@3.2.0/node_modules/fetch-blob/from.js
154047
- import { statSync as statSync34, createReadStream as createReadStream5, promises as fs3 } from "fs";
154308
+ import { statSync as statSync34, createReadStream as createReadStream6, promises as fs3 } from "fs";
154048
154309
  import { basename as basename23 } from "path";
154049
154310
  var import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem;
154050
154311
  var init_from = __esm({
@@ -154096,7 +154357,7 @@ var init_from = __esm({
154096
154357
  if (mtimeMs > this.lastModified) {
154097
154358
  throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
154098
154359
  }
154099
- yield* createReadStream5(this.#path, {
154360
+ yield* createReadStream6(this.#path, {
154100
154361
  start: this.#start,
154101
154362
  end: this.#start + this.size - 1
154102
154363
  });