hyperframes 0.6.79 → 0.6.80
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 +1177 -342
- package/dist/hyperframe-runtime.js +19 -19
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +19 -19
- package/dist/studio/assets/{index-BpS6tww3.js → index-D8oim9P5.js} +3 -3
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
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.6.
|
|
53
|
+
VERSION = true ? "0.6.80" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -3012,7 +3012,9 @@ var init_gsapConstants = __esm({
|
|
|
3012
3012
|
"letterSpacing",
|
|
3013
3013
|
// Filter & Clipping
|
|
3014
3014
|
"filter",
|
|
3015
|
-
"clipPath"
|
|
3015
|
+
"clipPath",
|
|
3016
|
+
// DOM content (number counters, text roll-ups)
|
|
3017
|
+
"innerText"
|
|
3016
3018
|
];
|
|
3017
3019
|
SUPPORTED_EASES = [
|
|
3018
3020
|
"none",
|
|
@@ -39815,7 +39817,7 @@ var RUNTIME_IIFE;
|
|
|
39815
39817
|
var init_runtime_inline = __esm({
|
|
39816
39818
|
"../core/src/generated/runtime-inline.ts"() {
|
|
39817
39819
|
"use strict";
|
|
39818
|
-
RUNTIME_IIFE = '"use strict";(()=>{var ns=Object.create;var xn=Object.defineProperty;var is=Object.getOwnPropertyDescriptor;var rs=Object.getOwnPropertyNames;var os=Object.getPrototypeOf,ss=Object.prototype.hasOwnProperty;var as=(t,e,n)=>e in t?xn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ee=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ls=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of rs(e))!ss.call(t,r)&&r!==n&&xn(t,r,{get:()=>e[r],enumerable:!(i=is(e,r))||i.enumerable});return t};var us=(t,e,n)=>(n=t!=null?ns(os(t)):{},ls(e||!t||!t.__esModule?xn(n,"default",{value:t,enumerable:!0}):n,t));var ye=(t,e,n)=>as(t,typeof e!="symbol"?e+"":e,n);var qi=ee((fc,Fn)=>{var K=String,Hi=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}};Fn.exports=Hi();Fn.exports.createColors=Hi});var wn=ee(()=>{});var qt=ee((hc,zi)=>{"use strict";var Vi=qi(),Ui=wn(),yt=class t extends Error{constructor(e,n,i,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),typeof n<"u"&&typeof i<"u"&&(typeof n=="number"?(this.line=n,this.column=i):(this.line=n.line,this.column=n.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}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(e){if(!this.source)return"";let n=this.source;e==null&&(e=Vi.isColorSupported);let i=u=>u,r=u=>u,o=u=>u;if(e){let{bold:u,gray:m,red:f}=Vi.createColors(!0);r=x=>u(f(x)),i=x=>m(x),Ui&&(o=x=>Ui(x))}let s=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length;return s.slice(l,a).map((u,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-c)+" | ";if(f===this.line){if(u.length>160){let E=20,S=Math.max(0,this.column-E),B=Math.max(this.column+E,this.endColumn+E),D=u.slice(S,B),v=i(x.replace(/\\d/g," "))+u.slice(0,Math.min(this.column-1,E-1)).replace(/[^\\t]/g," ");return r(">")+i(x)+o(D)+`\n `+v+r("^")}let F=i(x.replace(/\\d/g," "))+u.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(x)+o(u)+`\n `+F+r("^")}return" "+i(x)+o(u)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};zi.exports=yt;yt.default=yt});var Nn=ee((xc,$i)=>{"use strict";var _s=/(<)(\\/?style\\b)/gi,Rs=/(<)(!--)/g;function He(t){return typeof t!="string"||!t.includes("<")?t:t.replace(_s,"\\\\3c $2").replace(Rs,"\\\\3c $2")}var ji={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ls(t){return t[0].toUpperCase()+t.slice(1)}var St=class{constructor(e){this.builder=e}atrule(e,n){let i=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(typeof i.afterName<"u"?r+=i.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let s=(i.between||"")+(n?";":"");this.builder(He(r+o+s),e)}}beforeAfter(e,n){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):n==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let s=this.raw(e,null,"indent");if(s.length)for(let l=0;l<o;l++)i+=s}return i}block(e,n){let i=this.raw(e,"between","beforeOpen");this.builder(He(n+i)+"{",e,"start");let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(He(r)),this.builder("}",e,"end")}body(e){let n=e.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let r=this.raw(e,"semicolon"),o=e.type==="document";for(let s=0;s<n.length;s++){let l=n[s],a=this.raw(l,"before");a&&this.builder(o?a:He(a)),this.stringify(l,i!==s||r)}}comment(e){let n=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder(He("/*"+n+e.text+i+"*/"),e)}decl(e,n){let i=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=i.important||" !important"),n&&(o+=";"),this.builder(He(o),e)}document(e){this.body(e)}raw(e,n,i){let r;if(i||(i=n),n&&(r=e.raws[n],typeof r<"u"))return r;let o=e.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return ji[i];let s=e.root(),l=s.rawCache||(s.rawCache={});if(typeof l[i]<"u")return l[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+Ls(i);this[a]?r=this[a](s,e):s.walk(c=>{if(r=c.raws[n],typeof r<"u")return!1})}return typeof r>"u"&&(r=ji[i]),l[i]=r,r}rawBeforeClose(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return n=i.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(e,n){let i;return e.walkComments(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(e,n){let i;return e.walkDecls(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(e){let n;return e.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(e){let n;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return n=i.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(e){let n;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(e){if(e.raws.indent)return e.raws.indent;let n;return e.walk(i=>{let r=i.parent;if(r&&r!==e&&r.parent&&r.parent===e&&typeof i.raws.before<"u"){let o=i.raws.before.split(`\n`);return n=o[o.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(e,n){let i=e[n],r=e.raws[n];return r&&r.value===i?r.raw:i}root(e){if(this.body(e),e.raws.after){let n=e.raws.after,i=e.parent&&e.parent.type==="document";this.builder(i?n:He(n))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(He(e.raws.ownSemicolon),e,"end")}stringify(e,n){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,n)}};$i.exports=St;St.default=St});var bt=ee((gc,Gi)=>{"use strict";var Ds=Nn();function Cn(t,e){new Ds(e).stringify(t)}Gi.exports=Cn;Cn.default=Cn});var Vt=ee((yc,Mn)=>{"use strict";Mn.exports.isClean=Symbol("isClean");Mn.exports.my=Symbol("my")});var Ft=ee((Sc,Ki)=>{"use strict";var Bs=qt(),Is=Nn(),Os=bt(),{isClean:At,my:Ps}=Vt();function Tn(t,e){let n=new t.constructor;for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||i==="proxyCache")continue;let r=t[i],o=typeof r;i==="parent"&&o==="object"?e&&(n[i]=e):i==="source"?n[i]=r:Array.isArray(r)?n[i]=r.map(s=>Tn(s,n)):(o==="object"&&r!==null&&(r=Tn(r)),n[i]=r)}return n}function Oe(t,e){if(e&&typeof e.offset<"u")return e.offset;let n=1,i=1,r=0;for(let o=0;o<t.length;o++){if(i===e.line&&n===e.column){r=o;break}t[o]===`\n`?(n=1,i+=1):n+=1}return r}var Et=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[At]=!1,this[Ps]=!0;for(let n in e)if(n==="nodes"){this.nodes=[];for(let i of e[n])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[n]=e[n]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let n=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let n in e)this[n]=e[n];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let n=Tn(this);for(let i in e)n[i]=e[i];return n}cloneAfter(e={}){let n=this.clone(e);return this.parent.insertAfter(this,n),n}cloneBefore(e={}){let n=this.clone(e);return this.parent.insertBefore(this,n),n}error(e,n={}){if(this.source){let{end:i,start:r}=this.rangeBy(n);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},n)}return new Bs(e)}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:n==="root"?()=>e.root().toProxy():e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&e.markDirty()),!0}}}markClean(){this[At]=!0}markDirty(){if(this[At]){this[At]=!1;let e=this;for(;e=e.parent;)e[At]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let n=this.source.start;if(e.index)n=this.positionInside(e.index);else if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(Oe(i,this.source.start),Oe(i,this.source.end)).indexOf(e.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(e){let n=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=Oe(r,this.source.start),s=o+e;for(let l=o;l<s;l++)r[l]===`\n`?(n=1,i+=1):n+=1;return{column:n,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:Oe(n,this.source.start)},r=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:Oe(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=n.slice(Oe(n,this.source.start),Oe(n,this.source.end)).indexOf(e.word);s!==-1&&(i=this.positionInside(s),r=this.positionInside(s+e.word.length))}else e.start?i={column:e.start.column,line:e.start.line,offset:Oe(n,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:Oe(n,e.end)}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<i.line||r.line===i.line&&r.column<=i.column)&&(r={column:i.column+1,line:i.line,offset:i.offset+1}),{end:r,start:i}}raw(e,n){return new Is().raw(this,e,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let n=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(n,r),n=r):this.parent.insertBefore(n,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,n){let i={},r=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let l=this[s];if(Array.isArray(l))i[s]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,n):a);else if(typeof l=="object"&&l.toJSON)i[s]=l.toJSON(null,n);else if(s==="source"){if(l==null)continue;let a=n.get(l.input);a==null&&(a=o,n.set(l.input,o),o++),i[s]={end:l.end,inputId:a,start:l.start}}else i[s]=l}return r&&(i.inputs=[...n.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Os){e.stringify&&(e=e.stringify);let n="";return e(this,i=>{n+=i}),n}warn(e,n,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(n,r)}};Ki.exports=Et;Et.default=Et});var Nt=ee((bc,Ji)=>{"use strict";var Ws=Ft(),wt=class extends Ws{constructor(e){super(e),this.type="comment"}};Ji.exports=wt;wt.default=wt});var Mt=ee((Ac,Qi)=>{"use strict";var Hs=Ft(),Ct=class extends Hs{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Qi.exports=Ct;Ct.default=Ct});var qe=ee((Ec,or)=>{"use strict";var Yi=Nt(),Zi=Mt(),qs=Ft(),{isClean:Xi,my:er}=Vt(),kn,tr,nr,vn;function ir(t){return t.map(e=>(e.nodes&&(e.nodes=ir(e.nodes)),delete e.source,e))}function rr(t){if(t[Xi]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)rr(e)}var _e=class t extends qs{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(...e){for(let n of e){let i=this.normalize(n,this.last);for(let r of i)this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let n of this.nodes)n.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let n=this.getIterator(),i,r;for(;this.indexes[n]<this.proxyOf.nodes.length&&(i=this.indexes[n],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:e[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...i)=>e[n](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):n==="every"||n==="some"?i=>e[n]((r,...o)=>i(r.toProxy(),...o)):n==="root"?()=>e.root().toProxy():n==="nodes"?e.nodes.map(i=>i.toProxy()):n==="first"||n==="last"?e[n].toProxy():e[n]:e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="name"||n==="params"||n==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,n){let i=this.index(e),r=this.normalize(n,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let s of r)this.proxyOf.nodes.splice(i+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],i<o&&(this.indexes[s]=o+r.length);return this.markDirty(),this}insertBefore(e,n){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let l of o)this.proxyOf.nodes.splice(i,0,l);let s;for(let l in this.indexes)s=this.indexes[l],i<=s&&(this.indexes[l]=s+o.length);return this.markDirty(),this}normalize(e,n){if(typeof e=="string")e=ir(tr(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Zi(e)]}else if(e.selector||e.selectors)e=[new vn(e)];else if(e.name)e=[new kn(e)];else if(e.text)e=[new Yi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[er]||t.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Xi]&&rr(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(r.raws.before=n.raws.before.replace(/\\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let n of e){let i=this.normalize(n,this.first,"prepend").reverse();for(let r of i)this.proxyOf.nodes.unshift(r);for(let r in this.indexes)this.indexes[r]=this.indexes[r]+i.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let n;for(let i in this.indexes)n=this.indexes[i],n>=e&&(this.indexes[i]=n-1);return this.markDirty(),this}replaceValues(e,n,i){return i||(i=n,n={}),this.walkDecls(r=>{n.props&&!n.props.includes(r.prop)||n.fast&&!r.value.includes(n.fast)||(r.value=r.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((n,i)=>{let r;try{r=e(n,i)}catch(o){throw n.addToError(o)}return r!==!1&&n.walk&&(r=n.walk(e)),r})}walkAtRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return n(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="atrule")return n(i,r)}))}walkComments(e){return this.walk((n,i)=>{if(n.type==="comment")return e(n,i)})}walkDecls(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return n(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="decl")return n(i,r)}))}walkRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return n(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="rule")return n(i,r)}))}};_e.registerParse=t=>{tr=t};_e.registerRule=t=>{vn=t};_e.registerAtRule=t=>{kn=t};_e.registerRoot=t=>{nr=t};or.exports=_e;_e.default=_e;_e.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,kn.prototype):t.type==="rule"?Object.setPrototypeOf(t,vn.prototype):t.type==="decl"?Object.setPrototypeOf(t,Zi.prototype):t.type==="comment"?Object.setPrototypeOf(t,Yi.prototype):t.type==="root"&&Object.setPrototypeOf(t,nr.prototype),t[er]=!0,t.nodes&&t.nodes.forEach(e=>{_e.rebuild(e)})}});var Ut=ee((Fc,ar)=>{"use strict";var sr=qe(),nt=class extends sr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};ar.exports=nt;nt.default=nt;sr.registerAtRule(nt)});var zt=ee((wc,cr)=>{"use strict";var Vs=qe(),lr,ur,Ze=class extends Vs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new lr(new ur,this,e).stringify()}};Ze.registerLazyResult=t=>{lr=t};Ze.registerProcessor=t=>{ur=t};cr.exports=Ze;Ze.default=Ze});var fr=ee((Nc,dr)=>{var Us="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",zs=(t,e=21)=>(n=e)=>{let i="",r=n|0;for(;r--;)i+=t[Math.random()*t.length|0];return i},js=(t=21)=>{let e="",n=t|0;for(;n--;)e+=Us[Math.random()*64|0];return e};dr.exports={nanoid:js,customAlphabet:zs}});var jt=ee(()=>{});var $t=ee(()=>{});var _n=ee(()=>{});var mr=ee(()=>{});var Ln=ee((Dc,xr)=>{"use strict";var{existsSync:$s,readFileSync:Gs}=mr(),{dirname:Rn,join:Ks}=jt(),{SourceMapConsumer:pr,SourceMapGenerator:hr}=$t();function Js(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}var Tt=class{constructor(e,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=n.map?n.map.prev:void 0,r=this.loadMap(n.from,i);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Rn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new pr(this.json||this.text)),this.consumerCache}decodeInline(e){let n=/^data:application\\/json;charset=utf-?8;base64,/,i=/^data:application\\/json;base64,/,r=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,s=e.match(r)||e.match(o);if(s)return decodeURIComponent(e.substr(s[0].length));let l=e.match(n)||e.match(i);if(l)return Js(e.substr(l[0].length));let a=e.slice(22);throw a=a.slice(0,a.indexOf(",")),new Error("Unsupported source map encoding "+a)}getAnnotationURL(e){return e.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let n=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let i=e.lastIndexOf(n.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e,n,i){if(!(!i&&!this.unsafeMap&&!/\\.map$/i.test(e))&&(this.root=Rn(e),$s(e)))return this.mapFile=e,Gs(e,"utf-8").toString().trim()}loadMap(e,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let i=n(e);if(i){let r=this.loadFile(i,e,!0);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(n instanceof pr)return hr.fromSourceMap(n).toString();if(n instanceof hr)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 i=this.annotation;e&&(i=Ks(Rn(e),i));let r=this.loadFile(i,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return r}}}startWith(e,n){return e?e.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};xr.exports=Tt;Tt.default=Tt});var kt=ee((Bc,Ar)=>{"use strict";var{nanoid:Qs}=fr(),{isAbsolute:In,resolve:On}=jt(),{SourceMapConsumer:Ys,SourceMapGenerator:Zs}=$t(),{fileURLToPath:gr,pathToFileURL:Gt}=_n(),yr=qt(),Xs=Ln(),Dn=wn(),Bn=Symbol("lineToIndexCache"),ea=!!(Ys&&Zs),Sr=!!(On&&In);function br(t){if(t[Bn])return t[Bn];let e=t.css.split(`\n`),n=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)n[r]=i,i+=e[r].length+1;return t[Bn]=n,n}var it=class{get from(){return this.file||this.id}constructor(e,n={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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&&(!Sr||/^\\w+:\\/\\//.test(n.from)||In(n.from)?this.file=n.from:this.file=On(n.from)),Sr&&ea){let i=new Xs(this.css,n);if(i.text){this.map=i;let r=i.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Qs(6)+">"),this.map&&(this.map.file=this.from)}error(e,n,i,r={}){let o,s,l,a,c;if(n&&typeof n=="object"){let m=n,f=i;if(typeof m.offset=="number"){a=m.offset;let x=this.fromOffset(a);n=x.line,i=x.col}else n=m.line,i=m.column,a=this.fromLineAndColumn(n,i);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);s=x.line,o=x.col}else s=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(i)a=this.fromLineAndColumn(n,i);else{a=n;let m=this.fromOffset(a);n=m.line,i=m.col}let u=this.origin(n,i,s,o);return u?c=new yr(e,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,r.plugin):c=new yr(e,s===void 0?n:{column:i,line:n},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),c.input={column:i,endColumn:o,endLine:s,endOffset:l,line:n,offset:a,source:this.css},this.file&&(Gt&&(c.input.url=Gt(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,n){return br(this)[e-1]+n-1}fromOffset(e){let n=br(this),i=n[n.length-1],r=0;if(e>=i)r=n.length-1;else{let o=n.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<n[s])o=s-1;else if(e>=n[s+1])r=s+1;else{r=s;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:On(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,n,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:e});if(!s.source)return!1;let l;typeof i=="number"&&(l=o.originalPositionFor({column:r,line:i}));let a;In(s.source)?a=Gt(s.source):a=new URL(s.source,this.map.consumer().sourceRoot||Gt(this.map.mapFile));let c={column:s.column,endColumn:l&&l.column,endLine:l&&l.line,line:s.line,url:a.toString()};if(a.protocol==="file:")if(gr)c.file=gr(a);else throw new Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(s.source);return u&&(c.source=u),c}toJSON(){let e={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(e[n]=this[n]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Ar.exports=it;it.default=it;Dn&&Dn.registerInput&&Dn.registerInput(it)});var rt=ee((Ic,Nr)=>{"use strict";var Er=qe(),Fr,wr,Ve=class extends Er{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,n,i){let r=super.normalize(e);if(n){if(i==="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 r)o.raws.before=n.raws.before}return r}removeChild(e,n){let i=this.index(e);return!n&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new Fr(new wr,this,e).stringify()}};Ve.registerLazyResult=t=>{Fr=t};Ve.registerProcessor=t=>{wr=t};Nr.exports=Ve;Ve.default=Ve;Er.registerRoot(Ve)});var Pn=ee((Oc,Cr)=>{"use strict";var vt={comma(t){return vt.split(t,[","],!0)},space(t){let e=[" ",`\n`," "];return vt.split(t,e)},split(t,e,n){let i=[],r="",o=!1,s=0,l=!1,a="",c=!1;for(let u of t)c?c=!1:u==="\\\\"?c=!0:l?u===a&&(l=!1):u===\'"\'||u==="\'"?(l=!0,a=u):u==="("?s+=1:u===")"?s>0&&(s-=1):s===0&&e.includes(u)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=u;return(n||r!=="")&&i.push(r.trim()),i}};Cr.exports=vt;vt.default=vt});var Kt=ee((Pc,Tr)=>{"use strict";var Mr=qe(),ta=Pn(),ot=class extends Mr{get selectors(){return ta.comma(this.selector)}set selectors(e){let n=this.selector?this.selector.match(/,\\s*/):null,i=n?n[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};Tr.exports=ot;ot.default=ot;Mr.registerRule(ot)});var vr=ee((Wc,kr)=>{"use strict";var na=Ut(),ia=Nt(),ra=Mt(),oa=kt(),sa=Ln(),aa=rt(),la=Kt();function _t(t,e){if(Array.isArray(t))return t.map(r=>_t(r));let{inputs:n,...i}=t;if(n){e=[];for(let r of n){let o={...r,__proto__:oa.prototype};o.map&&(o.map={...o.map,__proto__:sa.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=t.nodes.map(r=>_t(r,e))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=e[r])}if(i.type==="root")return new aa(i);if(i.type==="decl")return new ra(i);if(i.type==="rule")return new la(i);if(i.type==="comment")return new ia(i);if(i.type==="atrule")return new na(i);throw new Error("Unknown node type: "+t.type)}kr.exports=_t;_t.default=_t});var Hn=ee((Hc,Ir)=>{"use strict";var{dirname:Jt,relative:Rr,resolve:Lr,sep:Dr}=jt(),{SourceMapConsumer:Br,SourceMapGenerator:Qt}=$t(),{pathToFileURL:_r}=_n(),ua=kt(),ca=!!(Br&&Qt),da=!!(Jt&&Lr&&Rr&&Dr),Wn=class{constructor(e,n,i,r){this.stringify=e,this.mapOpts=i.map||{},this.root=n,this.opts=i,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let n=this.toUrl(this.path(e.file)),i=e.root||Jt(e.file),r;this.mapOpts.sourcesContent===!1?(r=new Br(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let n=this.root.nodes.length-1;n>=0;n--)e=this.root.nodes[n],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",e+3);if(n===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),da&&ca&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,n=>{e+=n}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Qt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Qt({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 Qt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(r.generated.line=e,r.generated.column=n-1,a.source&&a.source.start?(r.source=this.sourcePath(a),r.original.line=a.source.start.line,r.original.column=a.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=l.match(/\\n/g),s?(e+=s.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,a&&c!=="start"){let u=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==u.last||u.raws.semicolon)&&(a.source&&a.source.end?(r.source=this.sourcePath(a),r.original.line=a.source.end.line,r.original.column=a.source.end.column-1,r.generated.line=e,r.generated.column=n-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=n-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\\w+:\\/\\//.test(e))return e;let n=this.memoizedPaths.get(e);if(n)return n;let i=this.opts.to?Jt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Jt(Lr(i,this.mapOpts.annotation)));let r=Rr(i,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let n=e.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let e=new ua(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(n=>{if(n.source){let i=n.source.input.from;if(i&&!e[i]){e[i]=!0;let r=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(r,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(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let n=this.memoizedFileURLs.get(e);if(n)return n;if(_r){let i=_r(e).toString();return this.memoizedFileURLs.set(e,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let n=this.memoizedURLs.get(e);if(n)return n;Dr==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};Ir.exports=Wn});var Wr=ee((qc,Pr)=>{"use strict";var Yt=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Zt=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,fa=/.[\\r\\n"\'(/\\\\]/,Or=/[\\da-f]/i;Pr.exports=function(e,n={}){let i=e.css.valueOf(),r=n.ignoreErrors,o,s,l,a,c,u,m,f,x,F,E=i.length,S=0,B=[],D=[],v=-1;function te(){return S}function q(N){throw e.error("Unclosed "+N,S)}function C(){return D.length===0&&S>=E}function g(N){if(D.length)return D.pop();if(S>=E)return;let w=N?N.ignoreUnclosed:!1;switch(o=i.charCodeAt(S),o){case 10:case 32:case 9:case 13:case 12:{a=S;do a+=1,o=i.charCodeAt(a);while(o===32||o===10||o===9||o===13||o===12);u=["space",i.slice(S,a)],S=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let T=String.fromCharCode(o);u=[T,T,S];break}case 40:{if(F=B.length?B.pop()[1]:"",x=i.charCodeAt(S+1),F==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){a=S;do{if(m=!1,a=i.indexOf(")",a+1),a===-1)if(r||w){a=S;break}else q("bracket");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["brackets",i.slice(S,a+1),S,a],S=a}else S<=v?u=["(","(",S]:(a=i.indexOf(")",S+1),s=i.slice(S,a+1),a===-1||fa.test(s)?(v=a===-1?E:a,u=["(","(",S]):(u=["brackets",s,S,a],S=a));break}case 39:case 34:{c=o===39?"\'":\'"\',a=S;do{if(m=!1,a=i.indexOf(c,a+1),a===-1)if(r||w){a=S+1;break}else q("string");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["string",i.slice(S,a+1),S,a],S=a;break}case 64:{Yt.lastIndex=S+1,Yt.test(i),Yt.lastIndex===0?a=i.length-1:a=Yt.lastIndex-2,u=["at-word",i.slice(S,a+1),S,a],S=a;break}case 92:{for(a=S,l=!0;i.charCodeAt(a+1)===92;)a+=1,l=!l;if(o=i.charCodeAt(a+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(a+=1,Or.test(i.charAt(a)))){for(;Or.test(i.charAt(a+1));)a+=1;i.charCodeAt(a+1)===32&&(a+=1)}u=["word",i.slice(S,a+1),S,a],S=a;break}default:{o===47&&i.charCodeAt(S+1)===42?(a=i.indexOf("*/",S+2)+1,a===0&&(r||w?a=i.length:q("comment")),u=["comment",i.slice(S,a+1),S,a],S=a):(Zt.lastIndex=S+1,Zt.test(i),Zt.lastIndex===0?a=i.length-1:a=Zt.lastIndex-2,u=["word",i.slice(S,a+1),S,a],B.push(u),S=a);break}}return S++,u}function A(N){D.push(N)}return{back:A,endOfFile:C,nextToken:g,position:te}}});var Ur=ee((Vc,Vr)=>{"use strict";var ma=Ut(),pa=Nt(),ha=Mt(),xa=rt(),Hr=Kt(),ga=Wr(),qr={empty:!0,space:!0};function ya(t){for(let e=t.length-1;e>=0;e--){let n=t[e],i=n[3]||n[2];if(i)return i}}var qn=class{constructor(e){this.input=e,this.root=new xa,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let n=new ma;n.name=e[1].slice(1),n.name===""&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i,r,o,s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){l=!0;break}else if(i==="}"){if(a.length>0){for(o=a.length-1,r=a[o];r&&r[0]==="space";)r=a[--o];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),s&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[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(e){let n=this.colon(e);if(n===!1)return;let i=0,r;for(let o=n-1;o>=0&&(r=e[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let n=0,i,r,o;for(let[s,l]of e.entries()){if(r=l,o=r[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!i)this.doubleColon(r);else{if(i[0]==="word"&&i[1]==="progid")continue;return s}i=r}return!1}comment(e){let n=new pa;this.init(n,e[2]),n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++;let i=e[1].slice(2,-2);if(!i.trim())n.text="",n.raws.left=i,n.raws.right="";else{let r=i.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=r[2],n.raws.left=r[1],n.raws.right=r[3]}}createTokenizer(){this.tokenizer=ga(this.input)}decl(e,n){let i=new ha;this.init(i,e[0][2]);let r=e[e.length-1];for(r[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(r[3]||r[2]||ya(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let s=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(o=e[c],o[1].toLowerCase()==="!important"){i.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(i.raws.important=u);break}else if(o[1].toLowerCase()==="important"){let u=e.slice(0),m="";for(let f=c;f>0;f--){let x=u[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=u.pop()[1]+m}m.trim().startsWith("!")&&(i.important=!0,i.raws.important=m,e=u)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),n),i.value.includes(":")&&!n&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let n=new Hr;this.init(n,e[2]),n.selector="",n.raws.between="",this.current=n}end(e){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(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}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(e){if(this.spaces+=e[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(e[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(e){let n=this.input.fromOffset(e);return{column:n.col,line:n.line,offset:e}}init(e,n){this.current.push(e),e.source={input:this.input,start:this.getPosition(n)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let n=!1,i=null,r=!1,o=null,s=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(i=c[0],a.push(c),i==="("||i==="[")o||(o=c),s.push(i==="("?")":"]");else if(l&&r&&i==="{")o||(o=c),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(a,l);return}else break;else if(i==="{"){this.rule(a);return}else if(i==="}"){this.tokenizer.back(a.pop()),n=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&r){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,n,i,r){let o,s,l=i.length,a="",c=!0,u,m;for(let f=0;f<l;f+=1)o=i[f],s=o[0],s==="space"&&f===l-1&&!r?c=!1:s==="comment"?(m=i[f-1]?i[f-1][0]:"empty",u=i[f+1]?i[f+1][0]:"empty",!qr[m]&&!qr[u]?a.slice(-1)===","?c=!1:a+=o[1]:c=!1):a+=o[1];if(!c){let f=i.reduce((x,F)=>x+F[1],"");e.raws[n]={raw:f,value:a}}e[n]=a}rule(e){e.pop();let n=new Hr;this.init(n,e[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(n,"selector",e),this.current=n}spacesAndCommentsFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],!(n!=="space"&&n!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let n,i="";for(;e.length&&(n=e[0][0],!(n!=="space"&&n!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],n==="space");)i=e.pop()[1]+i;return i}stringFrom(e,n){let i="";for(let r=n;r<e.length;r++)i+=e[r][1];return e.splice(n,e.length-n),i}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};Vr.exports=qn});var en=ee((Uc,zr)=>{"use strict";var Sa=qe(),ba=kt(),Aa=Ur();function Xt(t,e){let n=new ba(t,e),i=new Aa(n);try{i.parse()}catch(r){throw r}return i.root}zr.exports=Xt;Xt.default=Xt;Sa.registerParse(Xt)});var Vn=ee((zc,jr)=>{"use strict";var Rt=class{constructor(e,n={}){if(this.type="warning",this.text=e,n.node&&n.node.source){let i=n.node.rangeBy(n);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in n)this[i]=n[i]}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}};jr.exports=Rt;Rt.default=Rt});var tn=ee((jc,$r)=>{"use strict";var Ea=Vn(),Lt=class{get content(){return this.css}constructor(e,n,i){this.processor=e,this.messages=[],this.root=n,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let i=new Ea(e,n);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};$r.exports=Lt;Lt.default=Lt});var Un=ee(($c,Kr)=>{"use strict";var Gr={};Kr.exports=function(e){Gr[e]||(Gr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var $n=ee((Kc,Zr)=>{"use strict";var Fa=qe(),wa=zt(),Na=Hn(),Ca=en(),Jr=tn(),Ma=rt(),Ta=bt(),{isClean:Be,my:ka}=Vt(),Gc=Un(),va={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_a={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},Ra={Once:!0,postcssPlugin:!0,prepare:!0},st=0;function Dt(t){return typeof t=="object"&&typeof t.then=="function"}function Yr(t){let e=!1,n=va[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[n,n+"-"+e,st,n+"Exit",n+"Exit-"+e]:e?[n,n+"-"+e,n+"Exit",n+"Exit-"+e]:t.append?[n,st,n+"Exit"]:[n,n+"Exit"]}function Qr(t){let e;return t.type==="document"?e=["Document",st,"DocumentExit"]:t.type==="root"?e=["Root",st,"RootExit"]:e=Yr(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function zn(t){return t[Be]=!1,t.nodes&&t.nodes.forEach(e=>zn(e)),t}var jn={},Ue=class t{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(e,n,i){this.stringified=!1,this.processed=!1;let r;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))r=zn(n);else if(n instanceof t||n instanceof Jr)r=zn(n.root),n.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{let o=Ca;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(n,i)}catch(s){this.processed=!0,this.error=s}r&&!r[ka]&&Fa.rebuild(r)}this.result=new Jr(e,r,i),this.helpers={...jn,postcss:jn,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(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,n){let i=this.result.lastPlugin;try{n&&n.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(n,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([n,r])};for(let n of this.plugins)if(typeof n=="object")for(let i in n){if(!_a[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ra[i])if(typeof n[i]=="object")for(let r in n[i])r==="*"?e(n,i,n[i][r]):e(n,i+"-"+r.toLowerCase(),n[i][r]);else typeof n[i]=="function"&&e(n,i,n[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let n=this.plugins[e],i=this.runOnRoot(n);if(Dt(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Be];){e[Be]=!0;let n=[Qr(e)];for(;n.length>0;){let i=this.visitTick(n);if(Dt(i))try{await i}catch(r){let o=n[n.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[n,i]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(e.type==="document"){let r=e.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(e,this.helpers)}catch(r){throw this.handleError(r)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return Dt(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,n=Ta;e.syntax&&(n=e.syntax.stringify),e.stringifier&&(n=e.stringifier),n.stringify&&(n=n.stringify);let i=this.result.root.source;if(e.map===void 0&&!(i&&i.input&&i.input.map)){let s="";return n(this.result.root,l=>{s+=l}),this.result.css=s,this.result}let o=new Na(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 e of this.plugins){let n=this.runOnRoot(e);if(Dt(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Be];)e[Be]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let n of e.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,n){return this.async().then(e,n)}toString(){return this.css}visitSync(e,n){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Dt(o))throw this.getAsyncError()}}visitTick(e){let n=e[e.length-1],{node:i,visitors:r}=n;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&n.visitorIndex<r.length){let[s,l]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return l(i.toProxy(),this.helpers)}catch(a){throw this.handleError(a,i)}}if(n.iterator!==0){let s=n.iterator,l;for(;l=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!l[Be]){l[Be]=!0,e.push(Qr(l));return}n.iterator=0,delete i.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===st){i.nodes&&i.nodes.length&&(i[Be]=!0,n.iterator=i.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[Be]=!0;let n=Yr(e);for(let i of n)if(i===st)e.nodes&&e.each(r=>{r[Be]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Ue.registerPostcss=t=>{jn=t};Zr.exports=Ue;Ue.default=Ue;Ma.registerLazyResult(Ue);wa.registerLazyResult(Ue)});var eo=ee((Qc,Xr)=>{"use strict";var La=Hn(),Da=en(),Ba=tn(),Ia=bt(),Jc=Un(),Bt=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 e,n=Da;try{e=n(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,n,i){n=n.toString(),this.stringified=!1,this._processor=e,this._css=n,this._opts=i,this._map=void 0;let r=Ia;this.result=new Ba(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new La(r,void 0,this._opts,n);if(s.isMap()){let[l,a]=s.generate();l&&(this.result.css=l),a&&(this.result.map=a)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,n){return this.async().then(e,n)}toString(){return this._css}warnings(){return[]}};Xr.exports=Bt;Bt.default=Bt});var no=ee((Yc,to)=>{"use strict";var Oa=zt(),Pa=$n(),Wa=eo(),Ha=rt(),Xe=class{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let n=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)n.push(i);else if(typeof i=="function")n.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return n}process(e,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new Wa(this,e,n):new Pa(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};to.exports=Xe;Xe.default=Xe;Ha.registerProcessor(Xe);Oa.registerProcessor(Xe)});var co=ee((Zc,uo)=>{"use strict";var io=Ut(),ro=Nt(),qa=qe(),Va=qt(),oo=Mt(),so=zt(),Ua=vr(),za=kt(),ja=$n(),$a=Pn(),Ga=Ft(),Ka=en(),Gn=no(),Ja=tn(),ao=rt(),lo=Kt(),Qa=bt(),Ya=Vn();function re(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Gn(t)}re.plugin=function(e,n){let i=!1;function r(...s){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...s);return l.postcssPlugin=e,l.postcssVersion=new Gn().version,l}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,l,a){return re([r(a)]).process(s,l)},r};re.stringify=Qa;re.parse=Ka;re.fromJSON=Ua;re.list=$a;re.comment=t=>new ro(t);re.atRule=t=>new io(t);re.decl=t=>new oo(t);re.rule=t=>new lo(t);re.root=t=>new ao(t);re.document=t=>new so(t);re.CssSyntaxError=Va;re.Declaration=oo;re.Container=qa;re.Processor=Gn;re.Document=so;re.Comment=ro;re.Warning=Ya;re.AtRule=io;re.Result=Ja;re.Input=za;re.Rule=lo;re.Root=ao;re.Node=Ga;ja.registerPostcss(re);uo.exports=re;re.default=re});function _(t,e){if(typeof window>"u")return;let n=window,i=n.__hf?.onSwallowed;if(i)try{i({label:t,error:e})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${t} swallowed:`,e)}function Ae(t){try{window.parent.postMessage(t,"*")}catch(e){_("bridge.postMessage",e)}}function hi(t){let e=n=>{let i=n.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){t.onPlay();return}if(r==="pause"){t.onPause();return}if(r==="seek"){t.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="tick"){t.onTick();return}if(r==="set-muted"){t.onSetMuted(!!i.muted);return}if(r==="set-volume"){t.onSetVolume(Math.max(0,Math.min(1,Number(i.volume??1))));return}if(r==="set-media-output-muted"){t.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){t.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="enable-pick-mode"){t.onEnablePickMode();return}if(r==="disable-pick-mode"){t.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&cs(o,s)}};return window.addEventListener("message",e),e}function cs(t,e){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 ${e}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 t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){_("bridge.flashElements.querySelector",i)}}var gn=null;function xi(t){gn=t}function dt(t,e){if(gn)try{gn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){_("runtime.analytics.site1",n)}}function gi(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){_("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){_("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){_("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){_("runtime.adapters.css.site4",c)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?(n.totalTime(i+.001,!0),n.totalTime(i,!1)):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Si(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){_("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){_("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){_("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){_("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ei(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){_("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(bi(i))i.goToAndStop(e*1e3,!1);else if(Ai(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){_("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(bi(e)||Ai(e))&&e.pause()}catch(n){_("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function bi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Ai(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Fi=-1;function Ht(t){if(t!==Fi){Fi=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){_("runtime.adapters.seek-dispatch.site1",e)}}}function wi(){let t=null,e=0;return{name:"three",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfThreeTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ni(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ci(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=n.source.nextElementSibling;if(o instanceof HTMLImageElement&&o.classList.contains("__render_frame__")&&o.complete&&o.naturalWidth>0)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function Mi(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){_("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){_("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){_("runtime.adapters.waapi.site3",a)}}}}function Ti(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function ds(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=u){let S=Math.min(f,E);e(S);let B=Number(t.volume);if(!Number.isFinite(B))continue;let D=Math.max(0,Math.min(1,B)),v=x.at(-1);if((!v||Math.abs(v.volume-D)>1e-4||S===f)&&x.push({time:Number(S.toFixed(6)),volume:Number(D.toFixed(6))}),S===f)break}return x.some(E=>Math.abs(E.volume-c)>1e-4)?x:null}function ki(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=ds(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function vi(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=s.defaultPlaybackRate,u=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,m=s.loop,f=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,x=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(x)||x<=0)&&f!=null&&(x=Math.max(0,(f-a)/u));let F=Number.isFinite(x)&&x>0?l+x:Number.POSITIVE_INFINITY,E=Number.parseFloat(s.dataset.volume??""),S={el:s,start:l,mediaStart:a,duration:Number.isFinite(x)&&x>0?x:Number.POSITIVE_INFINITY,end:F,volume:Number.isFinite(E)?E:null,playbackRate:u,loop:m,sourceDuration:f};i.push(S),s.tagName==="VIDEO"&&r.push(S),Number.isFinite(F)&&(o=Math.max(o,F))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var yn=new WeakMap,ft=new WeakMap,Sn=new WeakSet,et=new WeakSet;function fs(t){if(et.has(t))return;et.add(t);let e=()=>et.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var bn=new WeakMap;function mt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function _i(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<=n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let w=n.sourceDuration-n.mediaStart;w>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%w)}let s=mt(t.userVolume??1),l=mt(n.volume??1),a=bn.get(i),c=mt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=mt(Ti(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=mt(u*s);i.volume=m,bn.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(w){_("runtime.media.site1",w)}let f=.04,x=2,F=i.currentTime||0,E=Math.abs(F-r),S=r-F,B=yn.get(i);yn.set(i,S);let D=B===void 0,v=!D&&Math.abs(S-B)>.5,te=E>3,q=E>.5&&(D||v||te),C=i.tagName==="VIDEO"&&!i.paused,g=B!==void 0&&Math.abs(S-B)<.004,A=!1;if(!C&&!q&&!D&&g&&E>f){let w=(ft.get(i)??0)+1;ft.set(i,w),w>=x&&(A=!0,ft.set(i,0))}else E<=f&&ft.set(i,0);let N=!C&&t.forceSync&&E>.02;if(q||A||N){try{i.currentTime=r}catch(w){_("runtime.media.site2",w)}if(Math.abs(i.currentTime-r)>.5&&!Sn.has(i)){Sn.add(i),i.load();try{i.currentTime=r}catch(w){_("runtime.media.site3",w)}}et.delete(i)}t.playing&&i.paused&&!et.has(i)?(fs(i),i.play().catch(w=>{et.delete(i),(w&&typeof w=="object"&&"name"in w?String(w.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}yn.delete(i),ft.delete(i),Sn.delete(i),bn.delete(i),i.paused||i.pause()}}var ms=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ps=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Ri(t){let e=!1,n=null,i=null,r=null,o=null;function s(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch(N){_("runtime.picker.site1",N)}}function l(g){r=g,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(g){o=g,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(g){let A=g.ownerDocument.defaultView;if(!A)return!1;let N=g;for(;N&&N!==document.body&&N!==document.documentElement;){let w=A.getComputedStyle(N);if(w.display==="none"||w.visibility==="hidden"||w.pointerEvents==="none")return!0;let T=Number.parseFloat(w.opacity);if(Number.isFinite(T)&&T<=.01)return!0;N=N.parentElement}return!1}function u(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight")||g.closest(ms)||c(g))}function m(g){return!!g?.closest(ps)}function f(g){let A=g;if(A.id)return`#${A.id}`;let N=g.getAttribute("data-composition-id");if(N)return`[data-composition-id="${N}"]`;let w=g.getAttribute("data-composition-src");if(w)return`[data-composition-src="${w}"]`;let T=g.getAttribute("data-track-index");if(T)return`[data-track-index="${T}"]`;let L=g.tagName.toLowerCase(),P=g.parentElement;if(!P)return L;let J=P.querySelectorAll(`:scope > ${L}`);if(J.length===1)return L;for(let R=0;R<J.length;R+=1)if(J[R]===g)return`${L}:nth-of-type(${R+1})`;return L}function x(g){let A=g.tagName.toLowerCase(),N=(g.textContent??"").trim().replace(/\\s+/g," "),w=(T,L)=>T.length>L?`${T.slice(0,L-1)}\\u2026`:T;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?N.length>0?w(N,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function F(g,A,N){let w=typeof N=="number"&&N>0?N:8,T=[];if(document.elementsFromPoint)T=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let J=document.elementFromPoint(g,A);T=J?[J]:[]}if(m(T[0]??null))return[];let L={},P=[];for(let J=0;J<T.length;J+=1){let R=T[J];if(!u(R))continue;let ue=`${R.tagName}::${R.id||""}::${J}`;if(!L[ue]&&(L[ue]=!0,P.push(R),P.length>=w))break}return P}function E(g){let A=g.getBoundingClientRect(),N={};for(let T=0;T<g.attributes.length;T+=1){let L=g.attributes[T];L.name.startsWith("data-")&&(N[L.name]=L.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:f(g),label:x(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:N}}function S(g,A,N){return F(g,A,N).map(E)}function B(g){if(!e)return;let N=F(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!u(N)||n===N)return;n&&n.classList.remove("__hf-pick-highlight"),n=N,N.classList.add("__hf-pick-highlight");let w=E(N);l(w),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:w})}function D(g){if(!e)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=S(g.clientX,g.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function v(g){g.key==="Escape"&&(q(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function te(){e||(e=!0,i=document.createElement("style"),i.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(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",B,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function q(){e&&(e=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",B,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function C(){window.__HF_PICKER_API={enable:te,disable:q,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(g,A,N)=>Number.isFinite(g)&&Number.isFinite(A)?S(g,A,N):[],pickAtPoint:(g,A,N)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return null;let w=S(g,A,8);if(!w.length)return null;let T=Math.max(0,Math.min(w.length-1,Number(N??0))),L=w[T]??null;return L?(a(L),t.postMessage({source:"hf-preview",type:"element-picked",elementInfo:L}),q(),L):null},pickManyAtPoint:(g,A,N)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return[];let w=S(g,A,8);if(!w.length)return[];let T=[],L=Array.isArray(N)?N:[0];for(let P of L){let J=Math.max(0,Math.min(w.length-1,Math.floor(Number(P)))),R=w[J];if(!R)continue;T.some(Se=>Se.selector===R.selector&&Se.tagName===R.tagName)||T.push(R)}return T.length?(a(T[0]??null),t.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:T}),q(),T):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:te,disablePickMode:q,installPickerApi:C}}function tt(t,e){let n=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(t)&&t>0?t:0;return Math.floor(i*n+1e-9)/n}function pt(t,e,n){let i=t?.[e];return typeof i=="function"?Number(i.call(t))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&_("runtime.player.nonConformantNum",{prop:e,actual:typeof i}),n)}function ve(t,e){let n=t?.[e];if(typeof n=="function"){n.call(t);return}n!==void 0&&_("runtime.player.nonConformantVoid",{method:e,actual:typeof n})}function ht(t,e,n){if(t){for(let i of Object.values(t))if(!(!i||i===e))try{n(i)}catch(r){_("runtime.player.site1",r)}}}function Li(t,e,n){let i=tt(e,n);return ve(t,"pause"),typeof t.totalTime=="function"?t.totalTime(i,!1):typeof t.seek=="function"&&t.seek(i,!1),i}function hs(t,e,n,i){let r=[];ht(t,e,o=>{ve(o,"play"),r.push(o)});try{return Li(e,n,i)}finally{for(let o of r)try{ve(o,"pause")}catch(s){_("runtime.player.site2",s)}}}function xs(t,e){ht(t,e,n=>{ve(n,"play")})}function Di(t){return{_timeline:null,play:()=>{let e=t.getTimeline();if(!e||t.getIsPlaying())return;let n=Math.max(0,Number(t.getSafeDuration?.()??pt(e,"duration",0))||0);n>0&&Math.max(0,pt(e,"time",0))>=n&&(ve(e,"pause"),typeof e.seek=="function"&&e.seek(0,!1),t.onDeterministicSeek(0),t.setIsPlaying(!1),t.onSyncMedia(0,!1),t.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(t.getPlaybackRate()),ve(e,"play"),ht(t.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play")}),t.onDeterministicPlay(),t.setIsPlaying(!0),t.onShowNativeVideos(),t.onStatePost(!0)},pause:()=>{let e=t.getTimeline();if(!e)return;ve(e,"pause"),ht(t.getTimelineRegistry?.(),e,i=>{ve(i,"pause")});let n=Math.max(0,pt(e,"time",0));t.onDeterministicSeek(n),t.onDeterministicPause(),t.setIsPlaying(!1),t.onSyncMedia(n,!1),t.onRenderFrameSeek(n),t.onStatePost(!0)},seek:(e,n)=>{let i=t.getTimeline();if(!i)return;let r=Math.max(0,Number(e)||0),o=t.getIsPlaying(),s=hs(t.getTimelineRegistry?.(),i,r,t.getCanonicalFps());t.onDeterministicSeek(s),n?.keepPlaying&&o?(typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play"),ht(t.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(t.getPlaybackRate()),ve(l,"play")}),t.onDeterministicPlay(),t.onShowNativeVideos(),t.onSyncMedia(s,!0)):(t.setIsPlaying(!1),t.onSyncMedia(s,!1)),t.onRenderFrameSeek(s),t.onStatePost(!0)},renderSeek:e=>{let n=t.getTimeline(),i=t.getCanonicalFps(),r=n?(xs(t.getTimelineRegistry?.(),n),Li(n,e,i)):tt(Math.max(0,Number(e)||0),i);t.onDeterministicSeek(r),t.setIsPlaying(!1),t.onSyncMedia(r,!1),t.onRenderFrameSeek(r),t.onStatePost(!0)},getTime:()=>pt(t.getTimeline(),"time",0),getDuration:()=>pt(t.getTimeline(),"duration",0),isPlaying:()=>t.getIsPlaying(),setPlaybackRate:e=>t.setPlaybackRate(e),getPlaybackRate:()=>t.getPlaybackRate()}}function Bi(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,nativeVisualWatchdogTick:0,transportClock:null,transportRafId:null}}var gs="data-hf-authored-duration",ys="data-hf-authored-end";function Qe(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Ss(t){return Qe(t.getAttribute("data-duration"))}function bs(t){return Qe(t.getAttribute("data-end"))}function As(t){return Qe(t.getAttribute(gs))}function Es(t){return Qe(t.getAttribute(ys))}function Fs(t){let e=(t??"").trim();if(!e)return null;let n=Qe(e);if(n!=null)return{kind:"absolute",value:n};let i=e.match(/^([A-Za-z0-9_.:-]+)(?:\\s*([+-])\\s*([0-9]*\\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",s=i[3]??"0",l=Number.parseFloat(s),a=Number.isFinite(l)?Math.max(0,l):0,c=o==="-"?-a:a;return{kind:"reference",refId:r,offset:c}}function Ye(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=u=>{let m=document.getElementById(u);return m||(document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`)??null)},l=u=>{let m=r.get(u);if(m!==void 0)return m;let f=null,x=Ss(u)??(n?As(u):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let F=bs(u)??(n?Es(u):null);if(F!=null){let E=c(u,0),S=F-E;Number.isFinite(S)&&S>0&&(f=S)}}if((f==null||f<=0)&&u instanceof HTMLMediaElement){let F=Qe(u.getAttribute("data-playback-start"))??Qe(u.getAttribute("data-media-start"))??0;Number.isFinite(u.duration)&&u.duration>F&&(f=u.duration-F)}if(f==null||f<=0){let F=u.getAttribute("data-composition-id");if(F){let E=e[F]??null;if(E&&typeof E.duration=="function")try{let S=Number(E.duration());Number.isFinite(S)&&S>0&&(f=S)}catch(S){_("runtime.startResolver.site1",S)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(u,f),f):(r.set(u,null),null)},a=(u,m)=>{if(u.hasAttribute("data-composition-id")){let x=u.parentElement?.closest("[data-composition-id]");return x?c(x,m):0}let f=u.closest("[data-composition-id]");return f?c(f,m):0},c=(u,m)=>{let f=i.get(u);if(f!==void 0)return f??m;if(o.has(u))return m;o.add(u);try{let x=Fs(u.getAttribute("data-start"));if(!x){if(u.hasAttribute("data-composition-id")){let D=u.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id"))){let v=c(D,m);return i.set(u,v),v}}return i.set(u,m),m}if(x.kind==="absolute"){let D=Math.max(0,x.value),v=Math.max(0,a(u,m)+D);return i.set(u,v),v}let F=s(x.refId);if(!F)return i.set(u,m),m;let E=c(F,0),S=l(F);if(S==null||S<=0){let D=Math.max(0,E+x.offset);return i.set(u,D),D}let B=Math.max(0,E+S+x.offset);return i.set(u,B),B}finally{o.delete(u)}};return{resolveStartForElement:(u,m=0)=>c(u,Math.max(0,m)),resolveDurationForElement:u=>l(u)}}var ws="data-hf-authored-duration",Ns="data-hf-authored-end";function Ee(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function An(t){return Ee(t.getAttribute("data-duration"))??Ee(t.getAttribute(ws))}function Ii(t){return Ee(t.getAttribute("data-end"))??Ee(t.getAttribute(Ns))}function En(...t){let e=t.filter(n=>Number.isFinite(n??null));return e.length===0?null:Math.max(...e)}var Oi={composition:0,video:1,image:2,element:3,audio:4};function Cs(t){if(t.length===0)return;let e=new Map;for(let s of t){let l=e.get(s.track)??new Set;l.add(s.kind),e.set(s.track,l)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,l)=>s-l);for(let s of o){let l=e.get(s);if(l.size===1)r.set(`${s}:${[...l][0]}`,i++);else{let a=[...l].sort((c,u)=>(Oi[c]??99)-(Oi[u]??99));for(let c of a)r.set(`${s}:${c}`,i++)}}for(let s of t){let l=`${s.track}:${s.kind}`,a=r.get(l);a!=null&&(s.track=a)}}function gt(t){let e=String(t??"").trim();if(!e)return null;let n=e.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Pi(t){let e=t.getAttribute("src")??t.getAttribute("data-src");if(e)return gt(e);let n=t.getAttribute("data-composition-src");if(n)return gt(n);let i=t.querySelector("img[src], video[src], audio[src], source[src]");return i?gt(i.getAttribute("src")):null}function Ms(t){let e=t.className;return typeof e!="string"?null:e.split(/\\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Ts(t){if(!t)return null;try{return new URL(t,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return t.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function ks(t){let e=t.textContent?.replace(/\\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function xt(t){let e=t.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return e?e.replace(/\\b\\w/g,n=>n.toUpperCase()):t}function vs(t,e,n){let i=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=t.getAttribute("data-composition-id");if(r)return xt(r);let o=t.id;if(o)return xt(o);let s=Ms(t);if(s)return xt(s);let l=Ts(Pi(t));if(l)return xt(l);let a=ks(t);return a||`${xt(e)} ${n+1}`}function Wi(t){let n=window.__timelines??{},i=Ye({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=H=>{if(!H)return null;let k=n[H]??null;if(!k||typeof k.duration!="function")return null;try{let O=Number(k.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=H=>{let k=Ee(H.getAttribute("data-duration"));if(k!=null&&k>0)return k;let O=Ee(H.getAttribute("data-playback-start"))??Ee(H.getAttribute("data-media-start"))??0;return Number.isFinite(H.duration)&&H.duration>O?Math.max(0,H.duration-O):null},s=()=>{let H=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(H.length===0)return null;let k=0;for(let O of H){let ie=O.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(ie))continue;let ne=o(O);ne==null||ne<=0||(k=Math.max(k,Math.max(0,ie)+ne))}return k>0?k:null},l=H=>{let k=H.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},a=(H,k)=>{let O=[],ie=null,ne=null,z=null,V=H.parentElement;for(;V;){let $=V.getAttribute("data-composition-id");$&&(O.push($),!z&&V!==k&&(z=$),ie==null&&(ie=i.resolveStartForElement(V,0)),ne==null&&(ne=Ee(V.getAttribute("data-duration"))??r($)??null)),V=V.parentElement}return{parentCompositionId:z,compositionAncestors:O.reverse(),inheritedStart:ie,inheritedDuration:ne}},c=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),m=c?.getAttribute("data-composition-id")??null,f=c?i.resolveStartForElement(c,0):0,x=s(),F=x!=null?Math.max(0,x-Math.max(0,f)):null,E=r(m),S=An(c??document.body),B=En(...u.filter(H=>H!==c).map(H=>{let k=i.resolveStartForElement(H,0),O=i.resolveDurationForElement(H)??r(H.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||O==null||O<=0?null:Math.max(0,k)+O})),D=B!=null?Math.max(0,B-Math.max(0,f)):null,v=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,te=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,q=typeof F=="number"&&Number.isFinite(F)&&F>0?F:null,C=typeof D=="number"&&Number.isFinite(D)&&D>0?D:null,g=En(q,C),A=v!=null&&g!=null&&v>g+1,w=te??(A?g:En(v,q,C))??null,L=(w!=null?f+w:null)??(typeof x=="number"&&Number.isFinite(x)&&x>0?x:null),P=(H,k)=>!Number.isFinite(k)||k<=0?0:L==null||!Number.isFinite(L)?k:!Number.isFinite(H)||H>=L?0:Math.max(0,Math.min(k,L-H)),J=[],R=[],ue=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),Se=0;for(let H=0;H<ue.length;H+=1){let k=ue[H];if(k===c||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let O=a(k,c),ie=i.resolveStartForElement(k,O.inheritedStart??0),ne=k.getAttribute("data-composition-id"),z=An(k);if((z==null||z<=0)&&ne&&ne!==m&&(z=r(ne)),(z==null||z<=0)&&k instanceof HTMLMediaElement){let we=Ee(k.getAttribute("data-playback-start"))??Ee(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(z=Math.max(0,k.duration-we))}if(z==null||z<=0){let we=O.inheritedDuration;if(we!=null&&we>0){let Le=(O.inheritedStart??0)+we;z=Math.max(0,Le-ie)}}if(z==null||z<=0||(z=P(ie,z),z<=0))continue;let V=ie+z;Se=Math.max(Se,V);let $=k.tagName.toLowerCase(),Ce=ne&&ne!==m?"composition":$==="video"?"video":$==="audio"?"audio":$==="img"?"image":"element";J.push({id:k.id||ne||null,label:vs(k,Ce,J.length),start:ie,duration:z,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(H),10)||0,kind:Ce,tagName:$,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:gt(k.getAttribute("data-composition-src")),assetUrl:Pi(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Ee(k.getAttribute("data-timeline-priority"))})}let G=new Set(J.map(H=>H.id)),U=c?.getAttribute("data-composition-id")??null,W=U?n[U]??null:null;if(W&&c){let H=W;if(typeof H.getChildren=="function")try{let k=H.getChildren(!0,!0,!1)??[],O=new Map;for(let z of c.children){let V=z;if(!V.id)continue;let $=V.tagName.toLowerCase();$==="script"||$==="style"||$==="link"||O.set(V,{id:V.id,start:1/0,end:-1/0})}let ie=z=>{let V=z;for(;V;){if(O.has(V))return V;if(V===c)return null;V=V.parentElement}return null};for(let z of k){if(typeof z.targets!="function"||typeof z.startTime!="function"||typeof z.duration!="function")continue;let V=z.startTime(),$=z.parent;for(;$&&$!==W&&typeof $.startTime=="function";)V+=$.startTime(),$=$.parent;let Ce=V+z.duration();if(!(!Number.isFinite(V)||!Number.isFinite(Ce)))for(let we of z.targets()){if(!(we instanceof Element))continue;let $e=ie(we);if(!$e)continue;let Le=O.get($e);Le&&(Le.start=Math.min(Le.start,V),Le.end=Math.max(Le.end,Ce))}}let ne=J.length>0?Math.max(...J.map(z=>z.track))+1:0;for(let[z,V]of O){if(V.start===1/0||V.end===-1/0)continue;let $=z;if(G.has($.id))continue;let Ce=Math.max(0,V.end-V.start);if(Ce<=0)continue;let we=P(V.start,Ce);we<=0||(Se=Math.max(Se,V.start+we),J.push({id:$.id,label:$.getAttribute("data-timeline-label")??$.getAttribute("data-label")??$.getAttribute("aria-label")??$.id,start:V.start,duration:we,track:Number.parseInt($.getAttribute("data-track-index")??$.getAttribute("data-track")??"",10)||ne,kind:"element",tagName:$.tagName.toLowerCase(),compositionId:$.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:$.getAttribute("data-timeline-role"),timelineLabel:$.getAttribute("data-timeline-label"),timelineGroup:$.getAttribute("data-timeline-group"),timelinePriority:Ee($.getAttribute("data-timeline-priority"))}),G.add($.id))}}catch(k){_("runtime.timeline.site1",k)}}if(c&&w!=null&&w>0){let H=J.length>0?Math.max(...J.map(k=>k.track))+1:0;for(let k of c.children){let O=k;if(!O.id||G.has(O.id))continue;let ie=O.getAttribute("data-timeline-role");if(ie!=="overlay"&&ie!=="persistent-overlay")continue;let ne=O.tagName.toLowerCase();if(ne==="script"||ne==="style"||ne==="link"||ne==="meta"||window.getComputedStyle(O).display==="none")continue;let V=P(0,w);V<=0||(Se=Math.max(Se,V),J.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:V,track:Number.parseInt(O.getAttribute("data-track-index")??O.getAttribute("data-track")??"",10)||H,kind:"element",tagName:ne,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:ie,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ee(O.getAttribute("data-timeline-priority"))}),G.add(O.id))}}Cs(J);for(let H of u){if(H===c)continue;let k=H.getAttribute("data-composition-id");if(!k||!l(k))continue;let O=i.resolveStartForElement(H,0),ie=An(H);if((ie==null||ie<=0)&&Ii(H)!=null){let $=Ii(H);ie=Math.max(0,$-O)}let ne=r(k),z=ie&&ie>0?ie:ne;if(z==null||z<=0)continue;let V=P(O,z);V<=0||R.push({id:k,label:H.getAttribute("data-label")??k,start:O,duration:V,thumbnailUrl:gt(H.getAttribute("data-thumbnail-url")),avatarName:null})}let Z=Math.max(1,Se||1,w??0);return{source:"hf-preview",type:"timeline",durationInFrames:A&&te==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(Z*Math.max(1,t.canonicalFps))),clips:J,scenes:R,compositionWidth:Ee(c?.getAttribute("data-width"))??1920,compositionHeight:Ee(c?.getAttribute("data-height"))??1080}}var le=us(co(),1),fo=le.default,Xc=le.default.stringify,ed=le.default.fromJSON,td=le.default.plugin,nd=le.default.parse,id=le.default.list,rd=le.default.document,od=le.default.comment,sd=le.default.atRule,ad=le.default.rule,ld=le.default.decl,ud=le.default.root,cd=le.default.CssSyntaxError,dd=le.default.Declaration,fd=le.default.Container,md=le.default.Processor,pd=le.default.Document,hd=le.default.Comment,xd=le.default.Warning,gd=le.default.AtRule,yd=le.default.Result,Sd=le.default.Input,bd=le.default.Rule,Ad=le.default.Root,Ed=le.default.Node;var Kn="data-hf-authored-id";function Jn(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Qn(t){return t.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Za(t){return t&&t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function mo(t){let e=t.trim();return e?Array.from(new Set([e,Za(e)])).filter(Boolean):[]}function Xa(t){return!!t&&/[\\w-]/.test(t)}function el(t,e,n){let i=mo(e).sort((l,a)=>a.length-l.length);if(i.length===0)return t;let r="",o=0,s=null;for(let l=0;l<t.length;l+=1){let a=t[l],c=l>0?t[l-1]:"";if(s){r+=a,a===s&&c!=="\\\\"&&(s=null);continue}if(a===\'"\'||a==="\'"){s=a,r+=a;continue}if(a==="["){o+=1,r+=a;continue}if(a==="]"){o=Math.max(0,o-1),r+=a;continue}if(a==="#"&&o===0){let u=i.find(m=>t.startsWith(m,l+1));if(u){let m=t[l+1+u.length];if(!Xa(m)){r+=n,l+=u.length;continue}}}r+=a}return r}function tl(t,e){let n=e?.trim();return n?el(t,n,`[${Kn}="${Qn(n)}"]`):t}function nl(t,e,n,i,r){let o=tl(t,i),s=il(o,e,n),l=s.trim();if(!l||/^(html|body|:root|\\*)$/i.test(l))return t;let a=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${Jn(n)}\\\\1\\\\s*\\\\]`,"g");if(a.test(l))return s.replace(a,e);let c=s.match(/^\\s*/)?.[0]??"",u=s.match(/\\s*$/)?.[0]??"";if(r){let m=i?`[${Kn}="${Qn(i)}"]`:null;if(m&&l.startsWith(m)){let f=l.slice(m.length);return`${c}${e}${m}${f}${u}`}}return`${c}${e} ${l}${u}`}function il(t,e,n){let i=Jn(n),r=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return t.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var rl=new Set(["keyframes","-webkit-keyframes","font-face"]);function ol(t){return t?.type==="atrule"}function sl(t){let e=t.parent;for(;e;){if(ol(e)&&rl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Yn(t,e,n,i,r){let o=e.trim();if(!t||!o)return t;let s=n||`[data-composition-id="${Qn(o)}"]`,l=fo.parse(t);return l.walkRules(a=>{sl(a)||(a.selectors=a.selectors.map(c=>nl(c,s,o,i,r?.compoundAuthoredRoot)))}),l.toResult({map:!1}).css}function po(t,e,n="[HyperFrames] composition script error:",i,r=e,o){let s=JSON.stringify(e),l=JSON.stringify(r),a=JSON.stringify(n),c=Jn(e),u=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${c}"|\'${c}\')\\s*\\]`),x=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),F=JSON.stringify(mo(o?.trim()||""));return`(function(){\n var __hfCompId = ${s};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${a};\n var __hfAuthoredRootId = ${u};\n var __hfAuthoredRootAttr = ${JSON.stringify(Kn)};\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 = ${F};\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 return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, target);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, target);\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 return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\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${t.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})();`}function ho(){if(typeof document>"u")return{};let t=Zn(document.documentElement),e=al();return{...t,...e}}function Zn(t){if(!t)return{};let e=t.getAttribute("data-composition-variables");if(!e)return{};let n;try{n=JSON.parse(e)}catch{return{}}if(!Array.isArray(n))return{};let i={};for(let r of n){if(!r||typeof r!="object")continue;let o=r;typeof o.id!="string"||!("default"in o)||(i[o.id]=o.default)}return i}function al(){if(typeof window>"u")return{};let t=window.__hfVariables;return!t||typeof t!="object"||Array.isArray(t)?{}:t}var ll=8e3,ul=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/;function cl(t,e){return`${t}__hf${e}`}var dl=t=>new Promise(e=>{let n=!1,i=Date.now(),r=null,o=s=>{n||(n=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};t.addEventListener("load",()=>o("load"),{once:!0}),t.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),ll)});function Xn(t){for(;t.firstChild;)t.removeChild(t.firstChild);t.textContent=""}var fl=["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 ml(t){let e=document.importNode(t,!0),n=e.getAttribute("id")?.trim();for(let o of fl)e.removeAttribute(o);n&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",n)),e.setAttribute("data-hf-inner-root","true");let i=e.getAttribute("data-width"),r=e.getAttribute("data-height");return e.style.width=i?`${i}px`:"100%",e.style.height=r?`${r}px`:"100%",e}function xo(t,e){let n=t.trim();if(!n)return t;try{return ul.test(n)?new URL(n,document.baseURI).toString():e?new URL(n,e).toString():new URL(n,document.baseURI).toString()}catch{return t}}function pl(t){let e=t.getAttribute("data-variable-values");if(!e)return{};let n;try{n=JSON.parse(e)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function nn(t){let e=(t.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(t.getAttribute("data-hf-original-composition-id")||e||"").trim()||null,runtimeCompositionId:e}}function hl(t){let e=new Map;for(let n of t){let i=nn(n).authoredCompositionId||"";i&&e.set(i,(e.get(i)||0)+1)}return e}function go(t){let e=nn(t).authoredCompositionId;return e?!!document.querySelector(`template#${CSS.escape(e)}-template`):!1}function xl(t){return!!t.querySelector(\'[data-hf-inner-root="true"]\')}function gl(t){return t.hasAttribute("data-composition-src")?!0:go(t)?t.children.length===0||t.hasAttribute("data-hf-original-composition-id")?!0:xl(t):!1}function ti(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(e=>e.hasAttribute("data-composition-src")?!0:go(e))}function yo(){let t=window.__hfVariablesByComp;if(!t)return;let e=new Set(ti().map(n=>nn(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(t))e.has(n)||delete t[n]}function So(t,e=hl(t)){let n=new Map,i=new Map;for(let r of t){let{authoredCompositionId:o,runtimeCompositionId:s}=nn(r),l=gl(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:s});continue}let a=(e.get(o)||0)>1,c=s||o;if(l){let u=a?(n.get(o)||0)+1:0;a&&n.set(o,u),c=a?cl(o,u):o,a?r.setAttribute("data-hf-original-composition-id",o):r.removeAttribute("data-hf-original-composition-id"),r.setAttribute("data-composition-id",c),s&&s!==c&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[s]}i.set(r,{authoredCompositionId:o,runtimeCompositionId:c})}return i}async function ei(t){let e=null;t.authoredCompositionId&&(e=Array.from(t.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x.getAttribute("data-composition-id")===t.authoredCompositionId)??null);let n=e??t.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||t.authoredCompositionId||null,r=t.runtimeCompositionId||i||null,o=e?.getAttribute("id")?.trim()||null,s=r?`[data-composition-id="${CSS.escape(r)}"]`:void 0;if(t.headLinks)for(let f of t.headLinks){let x=f.getAttribute("href")||"";x&&(document.head.querySelector(`link[href="${CSS.escape(x)}"]`)||document.head.appendChild(f.cloneNode(!0)))}if(t.headStyles)for(let f of t.headStyles){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=Yn(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let l=Array.from(n.querySelectorAll("style"));for(let f of l){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=Yn(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let a=[];if(t.headScripts)for(let f of t.headScripts){let x=f.getAttribute("type")?.trim()??"",F=f.getAttribute("src")?.trim()??"";if(F){let E=xo(F,t.compositionUrl);a.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&a.push({kind:"inline",content:E,type:x,scopeCompositionId:i})}}let c=Array.from(n.querySelectorAll("script")),u=[...a];for(let f of c){let x=f.getAttribute("type")?.trim()??"",F=f.getAttribute("src")?.trim()??"";if(F){let E=xo(F,t.compositionUrl);u.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&u.push({kind:"inline",content:E,type:x,scopeCompositionId:i})}f.parentNode?.removeChild(f)}let m=Array.from(n.querySelectorAll("style"));for(let f of m)f.parentNode?.removeChild(f);if(e){let f=e.getAttribute("data-width"),x=e.getAttribute("data-height"),F=t.parseDimensionPx(f),E=t.parseDimensionPx(x);f&&t.host.setAttribute("data-width",f),x&&t.host.setAttribute("data-height",x),F&&t.host instanceof HTMLElement&&(t.host.style.width=F),E&&t.host instanceof HTMLElement&&(t.host.style.height=E),e.hasAttribute("data-timeline-locked")&&t.host.setAttribute("data-timeline-locked",""),t.host.appendChild(ml(e))}else t.hasTemplate?t.host.appendChild(document.importNode(n,!0)):t.host.innerHTML=t.fallbackBodyInnerHtml;if(r){let f={...t.declaredVariableDefaults??{},...pl(t.host)};Object.keys(f).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[r]=f):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[r]}for(let f of u){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=po(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",s,r||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),t.injectedScripts.push(x),f.kind==="external"){let F=await dl(x);F.status!=="load"&&t.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:t.authoredCompositionId,runtimeCompositionId:t.runtimeCompositionId,hostCompositionSrc:t.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:F.status,elapsedMs:F.elapsedMs}})}}}async function bo(t){let e=ti();if(yo(),e.length===0)return;let n=So(e),i=e.filter(r=>{if(r.hasAttribute("data-composition-src")||r.children.length>0)return!1;let o=n.get(r)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(i.length!==0)for(let r of i){let o=n.get(r),s=o?.authoredCompositionId;if(!s)continue;let l=document.querySelector(`template#${CSS.escape(s)}-template`);Xn(r),await ei({host:r,authoredCompositionId:s,runtimeCompositionId:o?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic})}}async function Ao(t){let e=ti();if(yo(),e.length===0)return;let n=So(e),i=e.filter(r=>r.hasAttribute("data-composition-src"));i.length!==0&&await Promise.all(i.map(async r=>{let o=r.getAttribute("data-composition-src");if(!o)return;let s=n.get(r),l=s?.authoredCompositionId||null,a=s?.runtimeCompositionId||l||null,c=null;try{c=new URL(o,document.baseURI)}catch{c=null}Xn(r);try{let u=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(u){await ei({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:u.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),F=new DOMParser().parseFromString(f,"text/html"),E=(l?F.querySelector(`template#${CSS.escape(l)}-template`):null)??F.querySelector("template"),S=E?E.content:F.body,B=E?void 0:Array.from(F.head.querySelectorAll("style")),D=E?void 0:Array.from(F.head.querySelectorAll("script")),v=E?void 0:Array.from(F.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await ei({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:S,hasTemplate:!!E,fallbackBodyInnerHtml:F.body.innerHTML,compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,headStyles:B,headScripts:D,headLinks:v,declaredVariableDefaults:Zn(F.documentElement),onDiagnostic:t.onDiagnostic})}catch(u){t.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,errorMessage:u instanceof Error?u.message:"unknown_error"}}),Xn(r)}}))}function yl(t){return t instanceof HTMLElement?t.dataset.captionWrapper!=="true"?t:t.querySelector(":scope > span")??null:null}function Sl(){let t=[],e=document.querySelectorAll(".caption-group");for(let n of e)for(let i of n.children){if(!(i instanceof HTMLElement))continue;let r=i.dataset.captionWrapper==="true"?i.querySelector(":scope > span"):i.tagName==="SPAN"?i:null;r&&t.push(r)}return t}function bl(t){let e=t.parentElement;if(e?.dataset.captionWrapper==="true")return e;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",t.parentNode?.insertBefore(n,t),n.appendChild(t),n}function ni(){let t=window.gsap;t&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e)||e.length===0)return;let n=Sl();for(let i of e){let r=null;if(i.wordId&&(r=yl(document.getElementById(i.wordId))),!r&&i.wordIndex!==void 0&&(r=n[i.wordIndex]??null),!r)continue;let o={},s={};if(i.x!==void 0&&(o.x=i.x),i.y!==void 0&&(o.y=i.y),i.scale!==void 0&&(o.scale=i.scale),i.rotation!==void 0&&(o.rotation=i.rotation),i.opacity!==void 0&&(s.opacity=i.opacity),i.fontSize!==void 0&&(s.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(s.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(s.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let a=t.getTweensOf(r).filter(u=>u.vars.color!==void 0).sort((u,m)=>u.startTime()-m.startTime()),c=a.length>0?String(a[0].vars.color):"";for(let u of a)String(u.vars.color)===c?i.dimColor&&(u.vars.color=i.dimColor):i.activeColor&&(u.vars.color=i.activeColor);i.dimColor&&t.set(r,{color:i.dimColor})}if(Object.keys(s).length>0&&t.set(r,s),Object.keys(o).length>0){let l=bl(r);t.set(l,o)}}}).catch(()=>{})}var rn=class{constructor(e){ye(this,"_baseTime",0);ye(this,"_playStartMs",null);ye(this,"_rate",1);ye(this,"_duration",1/0);ye(this,"_nowMs");ye(this,"_audioSource",null);this._baseTime=e?.initialTime??0,this._rate=e?.rate??1,this._duration=e?.duration??1/0,this._nowMs=e?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let i=null;if("currentTimeSeconds"in this._audioSource)i=this._audioSource.currentTimeSeconds;else{let{el:r,compositionStart:o,mediaStart:s}=this._audioSource;!r.paused&&Number.isFinite(r.currentTime)&&(i=(r.currentTime-s)/(r.playbackRate>0?r.playbackRate:1)*this._rate+o)}if(i!==null)return Number.isFinite(this._duration)&&i>=this._duration?this._duration:Math.max(0,i)}let e=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+e*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(e){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(e,this._duration)):Math.max(0,e);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(e){let n=Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(e){this._duration=Number.isFinite(e)&&e>0?e:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(e){this._audioSource=e}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:e}=this._audioSource;if(!e.paused&&Number.isFinite(e.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 Eo(t){return!Number.isFinite(t)||t<=0?1:t}var on=class{constructor(){ye(this,"_ctx",null);ye(this,"_bufferCache",new Map);ye(this,"_failedSrcs",new Set);ye(this,"_activeSources",[]);ye(this,"_masterGain",null);ye(this,"_rateAnchorCtx",0);ye(this,"_rateAnchorComp",0);ye(this,"_rate",1);ye(this,"_paused",!0);ye(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!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(e){let n=e.currentSrc||e.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;try{let i=await fetch(n);if(!i.ok)return this._failedSrcs.add(n),_("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;let r=await i.arrayBuffer(),o=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,o),o}catch(i){return this._failedSrcs.add(n),_("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(e,n,i,r,o,s,l,a=1){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=Eo(a),u=this._ctx.createBufferSource();u.buffer=n,u.playbackRate.value=c;let m=this._ctx.createGain();m.gain.value=s,u.connect(m),m.connect(this._masterGain);let f=o-i,x=this._ctx.currentTime;if(this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,f>=0)u.start(0,f+r);else{let S=-f/c;u.start(x+S,r)}let F=e.muted;e.muted=!0;let E={el:e,sourceNode:u,gainNode:m,compositionStart:i,mediaStart:r,scheduledAt:x,priorMuted:F};return this._activeSources.push(E),this._paused=!1,E}catch(c){return _("webAudioTransport.schedule",c),null}}setRate(e){let n=Eo(e);if(n!==this._rate){this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let i of this._activeSources)try{i.sourceNode.playbackRate.value=n}catch(r){_("webAudioTransport.setRate",r)}}}stopAll(){for(let e of this._activeSources){try{e.sourceNode.stop(),e.sourceNode.disconnect(),e.gainNode.disconnect()}catch{}e.el.muted=e.priorMuted}this._activeSources=[],this._paused=!0}setVolume(e){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,e)))}setElementVolume(e,n){let i=Math.max(0,Math.min(1,n));for(let r of this._activeSources)if(r.el===e)try{r.gainNode.gain.value=i}catch(o){_("webAudioTransport.setElementVolume",o)}}setMuted(e){this._masterGain&&(this._masterGain.gain.value=e?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var Fo="data-hf-authored-duration",wo="data-hf-authored-end";function No(){let t=Bi(),e=null,n=null,i=[],r=new Set,o=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){_("runtime.init.site1",d)}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"),window.__timelines=window.__timelines||{};let s=d=>{i.push(d)},l=(d,p,h)=>{let b=h??`${d}:${JSON.stringify(p)}`;r.has(b)||(r.add(b),Ae({source:"hf-preview",type:"diagnostic",code:d,details:p}))},a=d=>{let p={scale:1,focusX:960,focusY:540},h=[],b=[],y={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:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>h,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:()=>b,getRenderState:()=>({...y,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},c=1/60,u=.75,m=2,f=.05,x=100,F=240,E=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??"")}},S=d=>{let p=d.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},B=d=>{if(d==null||d.trim()==="")return null;let p=Number.parseFloat(d);return!Number.isFinite(p)||p<=0?null:`${p}px`},D=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.length===0?null:p.find(h=>!h.parentElement?.closest("[data-composition-id]"))??p[0]??null},v=()=>{let d=D();if(!d)return;let p=B(d.getAttribute("data-width")),h=B(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h),p&&d.style.setProperty("--comp-width",p),h&&d.style.setProperty("--comp-height",h)},te=()=>{let d=D(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(h=>h.hasAttribute("data-duration")||h.hasAttribute("data-end"));for(let h of p){if(d&&h===d)continue;let b=h.getAttribute("data-duration"),y=h.getAttribute("data-end");b!=null&&!h.hasAttribute(Fo)&&h.setAttribute(Fo,b),y!=null&&!h.hasAttribute(wo)&&h.setAttribute(wo,y),h.removeAttribute("data-duration"),h.removeAttribute("data-end")}},q=()=>{let d=D();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let p=B(d.getAttribute("data-width")),h=B(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h);let b=Array.from(d.children);for(let y of b){let M=y.tagName.toLowerCase();if(M==="script"||M==="style"||M==="link"||M==="meta"||!y.hasAttribute("data-start"))continue;let X=(y.style.top==="0px"||y.style.top==="0")&&(y.style.left==="0px"||y.style.left==="0")&&y.style.width==="100%"&&y.style.height==="100%",j=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(y.style.transform);if(X&&j&&!y.hasAttribute("data-width")&&!y.hasAttribute("data-height")){let Je=y.style.top,me=y.style.left,ct=y.style.width,se=y.style.height;y.style.top="",y.style.left="",y.style.width="",y.style.height="";let Q=window.getComputedStyle(y);Q.top!=="auto"||Q.bottom!=="auto"||Q.left!=="auto"||Q.right!=="auto"||Q.width!=="0px"||Q.height!=="0px"||(y.style.top=Je,y.style.left=me,y.style.width=ct,y.style.height=se)}let Y=window.getComputedStyle(y),oe=Y.position;if(oe!=="absolute"&&oe!=="fixed"&&(y.style.position="absolute"),!!y.style.top||!!y.style.bottom||Y.top!=="auto"||Y.bottom!=="auto"||(y.style.top="0"),!!y.style.left||!!y.style.right||Y.left!=="auto"||Y.right!=="auto"||(y.style.left="0"),M!=="audio"){let Je=B(y.getAttribute("data-width")),me=B(y.getAttribute("data-height")),ct=Y.width!=="0px"&&Y.width!=="auto",se=Y.height!=="0px"&&Y.height!=="auto";Je?!y.style.width&&!ct&&(y.style.width=Je):!y.style.width&&Y.width==="0px"&&(y.style.width="100%"),me?!y.style.height&&!se&&(y.style.height=me):!y.style.height&&Y.height==="0px"&&(y.style.height="100%")}}},C=(d,p=0,h)=>Ye({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,p),g=(d,p)=>Ye({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),A=(d,p=0)=>!d.hasAttribute("data-hf-auto-start")&&d.hasAttribute("data-start")?Math.max(0,Number(d.getAttribute("data-start")??0)||0):C(d,p),N=!!document.querySelector("[data-composition-src]"),w=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of d){let h=p.getAttribute("data-composition-id");if(h&&p.children.length===0&&document.querySelector(`template#${CSS.escape(h)}-template`)){w=!0;break}}}let T=!N&&!w,L=d=>{if(!d||typeof d.duration!="function")return null;try{let p=Number(d.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},P=d=>typeof d=="number"&&Number.isFinite(d)&&d>c,J=d=>{let p=Number(d.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let h=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),b=Number.isFinite(h)?Math.max(0,h):0;return Number.isFinite(d.duration)&&d.duration>b?Math.max(0,d.duration-b):null},R=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let p=0;for(let h of d){let b=A(h,0);if(!Number.isFinite(b))continue;let y=J(h);y==null||y<=c||(p=Math.max(p,Math.max(0,b)+y))}return p>c?p:null},ue=()=>{let d=D();if(!d)return null;let p=window.__timelines??{},h=Ye({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),b=0,y=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let M of y){if(!(M instanceof Element)||M.parentElement?.closest("[data-composition-id]")!==d)continue;let j=h.resolveStartForElement(M,0),Y=h.resolveDurationForElement(M);!Number.isFinite(j)||Y==null||Y<=0||(b=Math.max(b,Math.max(0,j)+Y))}return b>c?b:null},Se=()=>{let d=R();return typeof d!="number"||!Number.isFinite(d)||d<=c?null:d},G=d=>P(d)?Math.max(c,d*u):c,U=(d,p=0)=>{let h=L(d),b=Se(),y=ue(),M=Math.max(b??0,y??0),X=Number.isFinite(p)&&p>c?p:0,j=0;return P(h)?j=Math.max(h,M,X):P(M)?j=Math.max(M,X):j=X,j>0?Math.max(0,j):0},W=()=>{let d=window.__timelines??{},p=Ye({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),h=Se(),b=ue(),y=Math.max(h??0,b??0)||null,M=G(y),X=se=>{let Q=document.querySelector(`[data-composition-id="${CSS.escape(se)}"]`);return Q?p.resolveStartForElement(Q,0):0},j=se=>{let Q=window.gsap;if(!Q||typeof Q.timeline!="function")return null;let ce=Q.timeline({paused:!0});for(let xe of se)ce.add(xe.timeline,X(xe.compositionId));return ce},Y=(se,Q)=>{if(!P(se))return null;let ce=window.gsap;if(!ce||typeof ce.timeline!="function")return null;let xe=ce.timeline({paused:!0});if(Q)try{xe.add(Q,0)}catch(ae){_("runtime.init.site2",ae)}let be=xe;if(typeof be.to=="function")try{be.to({},{duration:se})}catch(ae){_("runtime.init.site3",ae)}return xe},oe=(se,Q)=>{let ce=se;if(typeof ce.getChildren!="function")return[];try{let xe=ce.getChildren(!0,!0,!0)??[];if(!Array.isArray(xe))return[];let be=[];for(let ae of Q)if(!xe.some(ke=>ke===ae.timeline))try{let ke=X(ae.compositionId);se.add(ae.timeline,ke),be.push(ae.compositionId)}catch(ke){_("runtime.init.site4",ke)}return be}catch{return[]}},Ie=D(),fe=Ie?.getAttribute("data-composition-id")??null;if(!fe)return{timeline:null};let ge=d[fe]??null,me=(()=>{if(!Ie)return[];let se=new Set,Q=Array.from(Ie.querySelectorAll("[data-composition-id]")),ce=[];for(let xe of Q){let be=xe.getAttribute("data-composition-id");if(!be||be===fe||se.has(be))continue;se.add(be);let ae=d[be]??null;if(!ae||typeof ae.play!="function"||typeof ae.pause!="function")continue;let Ne=L(ae);ce.push({compositionId:be,timeline:ae,durationSeconds:Ne??0})}return ce})(),ct=se=>{for(let Q of se){let ce=Q.timeline;if(typeof ce.paused=="function")try{ce.paused(!1)}catch(xe){_("runtime.init.site5",xe)}}};if(me.length>0&&ct(me),ge){let se=me.length>0?oe(ge,me):[];if((me.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+fe+"\'])"))&&(Z=!0),se.length>0)try{let ae=ge.time();ge.seek(ae,!1)}catch{}let Q=L(ge);if(!P(Q)&&me.length>0){let ae=me.map(ts=>ts.compositionId),Ne=j(me),ke=L(Ne);if(Ne&&P(ke))return{timeline:Ne,selectedTimelineIds:ae,selectedDurationSeconds:ke,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:fe,rootDurationSeconds:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:M,selectedDurationSeconds:ke,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:b,selectedTimelineIds:ae,autoNestedChildren:se}}};let pn=Y(y??0,ge),hn=L(pn);if(pn&&P(hn))return{timeline:pn,selectedTimelineIds:[fe],selectedDurationSeconds:hn,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:fe,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:b,selectedDurationSeconds:hn,selectedTimelineIds:[fe],autoNestedChildren:se}}}}if(!P(Q)&&me.length===0){let ae=Y(y??0,ge),Ne=L(ae);if(ae&&P(Ne))return{timeline:ae,selectedTimelineIds:[fe],selectedDurationSeconds:Ne,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:fe,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:b,selectedDurationSeconds:Ne,selectedTimelineIds:[fe]}}}}let ce=Ie?.getAttribute("data-duration"),xe=ce?parseFloat(ce):null,be=Math.max(P(xe)?xe:0,b??0);if(be>0&&P(be)&&P(Q)&&be>=Q+.5){let ae=ge;if(typeof ae.to=="function")try{ae.to({},{duration:0},be)}catch(ke){_("runtime.init.site6",ke)}let Ne=L(ge);if(P(Ne))return{timeline:ge,selectedTimelineIds:[fe],selectedDurationSeconds:Ne,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:fe,rootDurationSeconds:Q,rootDeclaredDur:xe,authoredCompositionDurationFloorSeconds:b,newDur:Ne}}}}return{timeline:ge,selectedTimelineIds:[fe],selectedDurationSeconds:Q,mediaDurationFloorSeconds:h,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:fe,selectedDurationSeconds:Q,autoNestedChildren:se}}:void 0}}if(me.length>0){let se=me.map(xe=>xe.compositionId),Q=j(me),ce=L(Q);if(Q)return{timeline:Q,selectedTimelineIds:se,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:fe,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:M,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,selectedTimelineIds:se}}}}return{timeline:null}},Z=!1,pe=()=>{if(!T)return!1;let d=t.capturedTimeline,p=L(d),h=P(p);if(d&&h&&Z)return!1;let b=W();if(!b.timeline)return!1;if(d&&d===b.timeline)return typeof d.timeScale=="function"&&d.timeScale(t.playbackRate),!1;t.capturedTimeline=b.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let y=U(t.capturedTimeline,0);if(y>0){try{I.setDuration(y)}catch{}t.capturedTimeline.pause();let M=Math.max(0,t.currentTime||0);typeof t.capturedTimeline.totalTime=="function"&&t.capturedTimeline.totalTime(M,!1);let X=document.querySelectorAll("[data-hf-studio-path-offset]");if(X.length>0&&t.capturedTimeline.getChildren){let j=new Set;try{for(let Y of t.capturedTimeline.getChildren(!0))if(typeof Y.targets=="function")for(let oe of Y.targets())j.add(oe)}catch{}for(let Y of X){if(!j.has(Y))continue;let oe=Y;oe.removeAttribute("data-hf-studio-path-offset"),oe.removeAttribute("data-hf-studio-original-translate"),oe.removeAttribute("data-hf-studio-original-inline-translate"),oe.style.removeProperty("--hf-studio-offset-x"),oe.style.removeProperty("--hf-studio-offset-y"),oe.style.removeProperty("translate")}}}b.diagnostics&&Ae({source:"hf-preview",type:"diagnostic",code:b.diagnostics.code,details:b.diagnostics.details}),Ae({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:b.selectedTimelineIds??[],selectedDurationSeconds:b.selectedDurationSeconds??null,mediaDurationFloorSeconds:b.mediaDurationFloorSeconds??null}});for(let M of V)$.delete(M),Le(M);return!0};window.__hfForceTimelineRebind=()=>{Z=!1,pe()};let Fe=()=>{let d=D();if(!(d instanceof HTMLElement))return;let p=d.getBoundingClientRect(),h=Number(d.getAttribute("data-width")),b=Number(d.getAttribute("data-height")),y=window.getComputedStyle(d),M=Number.isFinite(h)&&h>0&&Number.isFinite(b)&&b>0,X=p.width<=0||p.height<=0||d.clientWidth<=0||d.clientHeight<=0;!M||!X||l("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:h,declaredHeight:b,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:y.display,visibility:y.visibility,overflow:y.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},H=()=>{t.tornDown||(o!=null&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{o=null,Fe()}))},k=()=>{e=d=>{let p=E(d.error??d.message).slice(0,F);if(!p)return;let h=S(p);Ae({source:"hf-preview",type:"diagnostic",code:h.code,details:{category:h.category,message:p,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},n=d=>{let p=E(d.reason).slice(0,F);if(!p)return;let h=S(p);Ae({source:"hf-preview",type:"diagnostic",code:`${h.code}_unhandled_rejection`,details:{category:`${h.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",e),window.addEventListener("unhandledrejection",n)},O=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let h of d){let b=()=>{if(!(h instanceof Element))return;let y=h.tagName.toLowerCase(),M=h.getAttribute("src")??h.getAttribute("href")??h.getAttribute("poster")??null,X=y==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";l(X,{tagName:y,assetUrl:M,currentSrc:(h instanceof HTMLImageElement||h instanceof HTMLMediaElement)&&h.currentSrc||null,readyState:h instanceof HTMLMediaElement?h.readyState:null,networkState:h instanceof HTMLMediaElement?h.networkState:null},`${X}:${y}:${M??"unknown"}`)};h.addEventListener("error",b),s(()=>{h.removeEventListener("error",b)})}let p=document.fonts;p&&p.ready.then(()=>{if(t.tornDown)return;let h=Array.from(p).filter(b=>b.status==="error").map(b=>b.family).filter(b=>!!b).slice(0,10);h.length!==0&&l("runtime_font_load_issue",{failedFamilies:h,totalFaces:Array.from(p).length},`runtime-font-load-issue:${h.join("|")}`)}).catch(()=>{})},ie=(d,p)=>{if(!d.timeline)return!1;let h=t.capturedTimeline;if(h&&h===d.timeline)return!1;let b=Math.max(0,t.currentTime||0),y=t.isPlaying;t.capturedTimeline=d.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);try{t.capturedTimeline.pause(),t.capturedTimeline.seek(b,!1),y&&t.capturedTimeline.play()}catch(M){_("runtime.init.site7",M)}return Ae({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:b,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ne=null,z=!1,V=new Set,$=new WeakMap,Ce=()=>{t.tornDown||(ne!=null&&window.clearTimeout(ne),ne=window.setTimeout(()=>{if(t.tornDown)return;ne=null;let d=W();if(!d.timeline||!P(d.mediaDurationFloorSeconds??null))return;if(!t.capturedTimeline){pe()&&(Ge(),Me(!0));return}if(z)return;let h=L(t.capturedTimeline),b=d.selectedDurationSeconds??L(d.timeline);P(b)&&(!P(h)||b>=h+f)&&ie(d,"manual")&&(z=!0,Ae({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:h??null,selectedDurationSeconds:b??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),Ge(),Me(!0))},x))},we=()=>{for(let d of V)d.removeEventListener("loadedmetadata",Ce),d.removeEventListener("durationchange",Ce);V.clear()},$e=()=>{if(t.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let p of d){if(V.has(p))continue;V.add(p);let h=Number.parseFloat(p.dataset.volume??"");Number.isFinite(h)&&(p.volume=Math.max(0,Math.min(1,h))),p.addEventListener("loadedmetadata",Ce),p.addEventListener("durationchange",Ce),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),Le(p)}},Le=d=>{$.has(d)||ki(d,t.capturedTimeline,U(t.capturedTimeline,0),$)},We=()=>{let d=y=>{let M=y.closest("[data-composition-id]"),X=M?C(M,0):null,j=M?g(M,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:M,inheritedStart:X,inheritedDuration:j}},p=vi({shouldIncludeElement:y=>y.hasAttribute("data-start")||!!d(y).compositionRoot,resolveStartSeconds:y=>{let M=d(y);return A(y,M.inheritedStart??0)},resolveDurationSeconds:y=>{let M=d(y),X=A(y,M.inheritedStart??0),j=Number.parseFloat(y.dataset.playbackStart??y.dataset.mediaStart??"0")||0,Y=M.inheritedStart!=null&&M.inheritedDuration!=null&&M.inheritedDuration>0?Math.max(0,M.inheritedStart+M.inheritedDuration-X):null,oe=Number.isFinite(y.duration)&&y.duration>j?Math.max(0,y.duration-j):null;return oe!=null&&Y!=null?Math.min(oe,Y):oe??Y}});for(let y of p.mediaClips){let M=$.get(y.el);M&&(y.volumeKeyframes=M)}let h=t.mediaForceSyncNextTick;h&&(t.mediaForceSyncNextTick=!1),_i({clips:p.mediaClips,timeSeconds:t.currentTime,playing:t.isPlaying,playbackRate:t.playbackRate,outputMuted:t.mediaOutputMuted||he.isActive(),userMuted:t.bridgeMuted,userVolume:t.bridgeVolume,forceSync:h,onElementVolume:(y,M)=>he.setElementVolume(y,M),onAutoplayBlocked:()=>{t.mediaAutoplayBlockedPosted||(t.mediaAutoplayBlockedPosted=!0,Ae({source:"hf-preview",type:"media-autoplay-blocked"}))}});let b=Array.from(document.querySelectorAll("[data-start]"));for(let y of b){if(!(y instanceof HTMLElement))continue;let M=y.tagName.toLowerCase();if(M==="script"||M==="style"||M==="link"||M==="meta")continue;let X=M==="video"||M==="audio"?A(y,0):C(y,0),j=g(y),Y=y.getAttribute("data-composition-id");if(Y){let fe=(window.__timelines??{})[Y],ge=null;if(fe&&typeof fe.duration=="function"){let me=Number(fe.duration());Number.isFinite(me)&&me>0&&(ge=me)}let Je=y.hasAttribute("data-composition-src")||y.hasAttribute("data-composition-file");j!=null&&j>0&&ge!=null&&!Je?j=Math.min(j,ge):(j==null||j<=0)&&ge!=null&&(j=ge)}let oe=j!=null&&j>0?X+j:Number.POSITIVE_INFINITY,Ie=t.currentTime>=X&&(Number.isFinite(oe)?t.currentTime<=oe:!0);y.style.visibility=Ie?"visible":"hidden"}},Me=d=>{let p=Math.max(0,Math.round((t.currentTime||0)*t.canonicalFps)),h=Date.now();(d||p!==t.bridgeLastPostedFrame||t.isPlaying!==t.bridgeLastPostedPlaying||t.bridgeMuted!==t.bridgeLastPostedMuted||h-t.bridgeLastPostedAt>=t.bridgeMaxPostIntervalMs)&&(t.bridgeLastPostedFrame=p,t.bridgeLastPostedPlaying=t.isPlaying,t.bridgeLastPostedMuted=t.bridgeMuted,t.bridgeLastPostedAt=h,Ae({source:"hf-preview",type:"state",frame:p,isPlaying:t.isPlaying,muted:t.bridgeMuted,playbackRate:t.playbackRate}))},Ge=()=>{te(),v(),q();let d=D();if(d){let h=B(d.getAttribute("data-width")),b=B(d.getAttribute("data-height")),y=h?parseInt(h,10):0,M=b?parseInt(b,10):0;y>0&&M>0&&Ae({source:"hf-preview",type:"stage-size",width:y,height:M})}pe();let p=Wi({canonicalFps:t.canonicalFps});window.__clipManifest=p,Ae(p),H()},De=(d,p=0)=>{for(let h of t.deterministicAdapters){try{d==="discover"&&h.discover(),d==="pause"&&h.pause(),d==="play"&&h.play&&h.play()}catch(b){_("runtime.init.site8",b)}if(d==="discover")try{h.seek({time:p})}catch(b){_("runtime.init.site9",b)}}};if(T)ni();else{let d={injectedStyles:t.injectedCompStyles,injectedScripts:t.injectedCompScripts,parseDimensionPx:B,onDiagnostic:({code:p,details:h})=>{Ae({source:"hf-preview",type:"diagnostic",code:p,details:h})}};Ao(d).then(()=>bo(d)).finally(()=>{T=!0,pe(),window.__renderReady=!0,$e(),De("discover",t.currentTime),O(),ni(),Ge(),Me(!0)})}let Pt=Ri({postMessage:d=>Ae(d)});Pt.installPickerApi();let dn=d=>{let p=Number(d);!Number.isFinite(p)||p<=0?t.playbackRate=1:t.playbackRate=Math.max(.1,Math.min(5,p)),t.mediaForceSyncNextTick=!0,t.capturedTimeline&&typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let h=document.querySelectorAll("video, audio");for(let b of h)if(b instanceof HTMLMediaElement)try{b.playbackRate=t.playbackRate}catch(y){_("runtime.init.site10",y)}},de=Di({getTimeline:()=>t.capturedTimeline,setTimeline:d=>{t.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>t.isPlaying,setIsPlaying:d=>{t.isPlaying!==d&&(t.mediaForceSyncNextTick=!0),t.isPlaying=d},getPlaybackRate:()=>t.playbackRate,setPlaybackRate:dn,getCanonicalFps:()=>t.canonicalFps,onSyncMedia:(d,p)=>{t.currentTime=Math.max(0,Number(d)||0),t.isPlaying!==p&&(t.mediaForceSyncNextTick=!0),t.isPlaying=p,We()},onStatePost:Me,onDeterministicSeek:d=>{for(let p of t.deterministicAdapters)try{p.seek({time:Number(d)||0})}catch(h){_("runtime.init.site11",h)}},onDeterministicPause:()=>De("pause"),onDeterministicPlay:()=>De("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>U(t.capturedTimeline,0)});window.__player=a(de),window.__playerReady=!0,xi(Ae),dt("composition_loaded",{duration:de.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),t.controlBridgeHandler=hi({onPlay:()=>{de.play(),dt("composition_played",{time:de.getTime()})},onPause:()=>{de.pause(),dt("composition_paused",{time:de.getTime()})},onSeek:(d,p)=>{let h=Math.max(0,d)/t.canonicalFps;de.seek(h),dt("composition_seeked",{time:h})},onSetMuted:d=>{t.bridgeMuted=d;let p=d||t.mediaOutputMuted;he.setMuted(p);let h=document.querySelectorAll("video, audio");for(let b of h)b instanceof HTMLMediaElement&&(b.muted=p)},onSetVolume:d=>{t.bridgeVolume=d,he.setVolume(d);let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement))continue;let b=parseFloat(h.dataset.volume??""),y=Number.isFinite(b)?b:1;h.volume=y*d}},onSetMediaOutputMuted:d=>{t.mediaOutputMuted=d;let p=d||t.bridgeMuted;he.setMuted(p);let h=document.querySelectorAll("video, audio");for(let b of h)b instanceof HTMLMediaElement&&(b.muted=p)},onSetPlaybackRate:d=>{dn(d),t.transportClock&&t.transportClock.setRate(t.playbackRate),he.setRate(t.playbackRate)},onTick:()=>{if(t.tornDown||!I.isPlaying())return;let d=I.now();if(t.currentTime=d,Ke(d),I.reachedEnd()){he.stopAll(),I.detachAudioSource(),I.pause(),t.isPlaying=!1;let p=I.getDuration();Number.isFinite(p)&&(I.seek(p),t.currentTime=p,Ke(p)),De("pause"),We(),Me(!0)}},onEnablePickMode:()=>Pt.enablePickMode(),onDisablePickMode:()=>Pt.disablePickMode()}),pe(),t.capturedTimeline&&(de._timeline=t.capturedTimeline),window.__renderReady=!0,T&&setTimeout(()=>{let d=t.capturedTimeline;pe()&&t.capturedTimeline!==d&&(de._timeline=t.capturedTimeline),De("discover",t.currentTime),window.__renderReady=!0,Ge(),Me(!0)},0),t.deterministicAdapters=[Mi(),gi({resolveStartSeconds:d=>C(d,0)}),Si(),Ei(),wi(),Ni(),yi({getTimeline:()=>t.capturedTimeline})],Ci(),k(),$e(),De("discover");let I=new rn;t.transportClock=I;let he=new on,di=!1;he.init().then(d=>{di=d});let Wt=0,fn=!1,Zo=(d,p,h)=>{try{d.pause(),typeof d.totalTime=="function"?d.totalTime(p,!1):d.seek(p,!1)}catch(b){_(h,b)}},Xo=d=>{let p=window.__timelines??{},h=D()?.getAttribute("data-composition-id")??null;for(let[b,y]of Object.entries(p)){if(!y||b===h)continue;let M=document.querySelector(`[data-composition-id="${CSS.escape(b)}"]`);if(!M)continue;let X=C(M,0);if(!Number.isFinite(X))continue;let j=g(M,{includeAuthoredTimingAttrs:!0}),Y=L(y),oe=j!=null&&j>0?j:Y,Ie=Math.max(0,oe!=null&&oe>0?Math.min(oe,d-X):d-X);Zo(y,Ie,"runtime.init.transport.childTimeline")}},es=d=>{let p=window.__timelines??{};for(let h of Object.values(p))if(!(!h||h===d))try{h.play()}catch(b){_("runtime.init.activateSiblings",b)}},Ke=(d,p)=>{let h=t.capturedTimeline;if(h){p?.activateChildren&&es(h);try{typeof h.totalTime=="function"?h.totalTime(d,!1):h.seek(d,!1)}catch(b){_("runtime.init.transport.seek",b)}}else Xo(d);for(let b of t.deterministicAdapters)try{b.seek({time:d})}catch(y){_("runtime.init.transport.adapter",y)}},fi=()=>{if(!(t.tornDown||fn)){fn=!0;try{if(t.transportRafId=window.requestAnimationFrame(fi),Wt+=1,Wt%60===0&&!(I.isPlaying()&&t.capturedTimeline!=null&&I.now()<m)){let h=t.capturedTimeline;if(pe()){t.capturedTimeline&&!de._timeline&&(de._timeline=t.capturedTimeline),t.capturedTimeline&&t.capturedTimeline!==h&&t.capturedTimeline.pause();let b=U(t.capturedTimeline,0);b>0&&I.setDuration(b),Ge()}}if(Wt%20===0&&Ge(),Wt%30===0&&$e(),t.capturedTimeline){let p=U(t.capturedTimeline,0);p>0&&I.setDuration(p)}if(I.isPlaying()&&!t.mediaOutputMuted)if(he.isActive()&&he.context){let p=he.getTime();p>=0&&I.attachAudioSource({currentTimeSeconds:p})}else{let p=document.querySelectorAll("audio[data-start]"),h=!1;for(let b of p){if(!(b instanceof HTMLMediaElement)||!b.isConnected)continue;let y=Number.parseFloat(b.dataset.start??""),M=Number.parseFloat(b.dataset.duration??""),X=Number.isFinite(M)&&M>0?y+M:1/0,j=Number.parseFloat(b.dataset.playbackStart??b.dataset.mediaStart??"0")||0;if(Number.isFinite(y)&&t.currentTime>=y&&t.currentTime<=X){b.paused?!b.error&&b.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(I.attachAudioSource({currentTimeSeconds:t.currentTime}),h=!0):(I.attachAudioSource({el:b,compositionStart:y,mediaStart:j}),h=!0);break}}!h&&I.hasAudioSource()&&I.detachAudioSource()}else I.hasAudioSource()&&I.detachAudioSource();let d=I.now();if(t.currentTime=d,Ke(d),I.isPlaying()&&I.reachedEnd()){he.stopAll(),I.detachAudioSource(),I.pause(),t.isPlaying=!1;let p=I.getDuration();Number.isFinite(p)&&(I.seek(p),t.currentTime=p,Ke(p)),De("pause"),We(),Me(!0);return}I.isPlaying()&&We(),Me(!1)}finally{fn=!1}}},mi=d=>{let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let b=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(b))continue;let y=Number.parseFloat(h.dataset.duration??""),M=Number.isFinite(y)&&y>0?b+y:1/0;if(d<b||d>=M)continue;let X=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,j=d-b+X;if(j>=0)try{h.currentTime=j}catch{}}};if(de.play=()=>{let d=t.capturedTimeline;if(I.isPlaying())return;let p=U(d,0);if(p>0)I.setDuration(p),I.reachedEnd()&&(I.seek(0),t.currentTime=0,Ke(0));else{let h=D(),b=Number(h?.getAttribute("data-duration")??0);b>0&&I.setDuration(b)}if(d&&d.pause(),!!I.play()){if(t.isPlaying=!0,t.mediaForceSyncNextTick=!0,mi(I.now()),di){let h=he.startGeneration(),b=document.querySelectorAll("audio[data-start]");for(let y of b){if(!(y instanceof HTMLMediaElement)||!y.isConnected)continue;let M=Number.parseFloat(y.dataset.start??"");if(!Number.isFinite(M))continue;let X=Number.parseFloat(y.dataset.playbackStart??y.dataset.mediaStart??"0")||0,j=Number.parseFloat(y.dataset.volume??""),Y=Number.isFinite(j)?j:1;he.decodeAudioElement(y).then(oe=>{!oe||!I.isPlaying()||he.schedulePlayback(y,oe,M,X,I.now(),Y*t.bridgeVolume,h,t.playbackRate)})}}De("play"),We(),Me(!0)}},de.pause=()=>{if(!I.isPlaying())return;he.stopAll(),I.detachAudioSource(),I.pause(),t.isPlaying=!1,t.currentTime=I.now(),t.mediaForceSyncNextTick=!0,mi(t.currentTime);let d=t.capturedTimeline;d&&d.pause(),De("pause"),We(),Me(!0)},de.seek=d=>{let p=tt(Math.max(0,Number(d)||0),t.canonicalFps);he.stopAll(),I.detachAudioSource(),I.isPlaying()&&I.pause(),I.seek(p),t.currentTime=I.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0;let b=t.capturedTimeline;b&&b.pause(),Ke(t.currentTime),De("pause"),We(),Me(!0)},de.renderSeek=d=>{let p=tt(Math.max(0,Number(d)||0),t.canonicalFps);I.isPlaying()&&I.pause(),I.seek(p),t.currentTime=I.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0,Ke(t.currentTime,{activateChildren:!0}),We(),Me(!0)},de.getTime=()=>I.now(),de.getDuration=()=>{let d=I.getDuration();return Number.isFinite(d)?d:0},de.isPlaying=()=>I.isPlaying(),de.setPlaybackRate=d=>{dn(d),I.setRate(t.playbackRate),he.setRate(t.playbackRate)},t.capturedTimeline){let d=U(t.capturedTimeline,0);d>0&&I.setDuration(d),t.capturedTimeline.pause()}let pi=window.__player;if(pi){let d=["play","pause","seek","renderSeek","getTime","getDuration","isPlaying"];for(let p of d)Object.defineProperty(pi,p,{get:()=>de[p],set:h=>{de[p]=h},configurable:!0})}t.transportRafId=window.requestAnimationFrame(fi),Ge(),Me(!0);let mn=()=>{if(!t.tornDown){t.tornDown=!0,t.transportRafId!=null&&(window.cancelAnimationFrame(t.transportRafId),t.transportRafId=null),t.transportClock=null,he.destroy(),ne!=null&&(window.clearTimeout(ne),ne=null),o!=null&&(window.cancelAnimationFrame(o),o=null),we(),t.controlBridgeHandler&&(window.removeEventListener("message",t.controlBridgeHandler),t.controlBridgeHandler=null),e&&(window.removeEventListener("error",e),e=null),n&&(window.removeEventListener("unhandledrejection",n),n=null),t.beforeUnloadHandler&&(window.removeEventListener("beforeunload",t.beforeUnloadHandler),t.beforeUnloadHandler=null),Pt.disablePickMode();for(let d of t.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(p){_("runtime.init.site12",p)}t.deterministicAdapters=[];for(let d of i.splice(0))try{d()}catch(p){_("runtime.init.site13",p)}for(let d of t.injectedCompStyles)try{d.remove()}catch(p){_("runtime.init.site14",p)}t.injectedCompStyles=[];for(let d of t.injectedCompScripts)try{d.remove()}catch(p){_("runtime.init.site15",p)}t.injectedCompScripts=[],t.capturedTimeline=null,window.__hfRuntimeTeardown===mn&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=mn,t.beforeUnloadHandler=mn,window.addEventListener("beforeunload",t.beforeUnloadHandler)}var Co=["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"],ii=[[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 Al(t){if(t<=255)return Co[t];let e=0,n=ii.length-1;for(;e<=n;){let i=e+n>>1,r=ii[i];if(t<r[0]){n=i-1;continue}if(t>r[1]){e=i+1;continue}return r[2]}return"L"}function El(t){let e=t.length;if(e===0)return null;let n=new Array(e),i=!1;for(let c=0;c<e;){let u=t.charCodeAt(c),m=u,f=1;if(u>=55296&&u<=56319&&c+1<e){let F=t.charCodeAt(c+1);F>=56320&&F<=57343&&(m=(u-55296<<10)+(F-56320)+65536,f=2)}let x=Al(m);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let F=0;F<f;F++)n[c+F]=x;c+=f}if(!i)return null;let r=0;for(let c=0;c<e;c++){let u=n[c];if(u==="L"){r=0;break}if(u==="R"||u==="AL"){r=1;break}}let o=new Int8Array(e);for(let c=0;c<e;c++)o[c]=r;let s=r&1?"R":"L",l=s,a=l;for(let c=0;c<e;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<e;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<e-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<e;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<e&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<e;c++){let u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<e;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<e&&n[u]==="ON";)u++;let m=c>0?n[c-1]:l,f=u<e?n[u]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let E=c;E<u;E++)n[E]=x;c=u-1}for(let c=0;c<e;c++)n[c]==="ON"&&(n[c]=s);for(let c=0;c<e;c++){let u=n[c];(o[c]&1)===0?u==="R"?o[c]++:(u==="AN"||u==="EN")&&(o[c]+=2):(u==="L"||u==="AN"||u==="EN")&&o[c]++}return o}function Mo(t,e){let n=El(t);if(n===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=n[e[r]];return i}var Fl=/[ \\t\\n\\r\\f]+/g,wl=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Nl(t){let e=t??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Cl(t){if(!wl.test(t))return t;let e=t.replace(Fl," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function Ml(t){return/[\\r\\f]/.test(t)?t.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):t.replace(/\\r\\n/g,`\n`)}var ri=null,Tl;function kl(){return ri===null&&(ri=new Intl.Segmenter(Tl,{granularity:"word"})),ri}var vl=/\\p{Script=Arabic}/u,sn=/\\p{M}/u,Bo=/\\p{Nd}/u;function To(t){return vl.test(t)}function ko(t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=191472&&t<=192093||t>=194560&&t<=195103||t>=196608&&t<=201551||t>=201552&&t<=205743||t>=205744&&t<=210041||t>=63744&&t<=64255||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519}function Re(t){for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(!(n<12288)){if(n>=55296&&n<=56319&&e+1<t.length){let i=t.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(n-55296<<10)+(i-56320)+65536;if(ko(r))return!0;e++;continue}}if(ko(n))return!0}}return!1}function _l(t){let e=un(t);return e!==null&&(ln.has(e)||ze.has(e))}var Rl=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Ll(t){return Re(t)}function Dl(t){let e=un(t);return e!==null&&Rl.has(e)}function an(t){return!_l(t)&&!Dl(t)}var ln=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"]),Ot=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),si=new Set(["\'","\\u2019"]),ze=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Bl=new Set([":",".","\\u060C","\\u061B"]),Il=new Set(["\\u104F"]),Ol=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Pl(t){if(ai(t))return!0;let e=!1;for(let n of t){if(ze.has(n)){e=!0;continue}if(!(e&&sn.test(n)))return!1}return e}function Wl(t){for(let e of t)if(!ln.has(e)&&!ze.has(e))return!1;return t.length>0}function Hl(t){if(ai(t))return!0;for(let e of t)if(!Ot.has(e)&&!si.has(e)&&!sn.test(e))return!1;return t.length>0}function ai(t){let e=!1;for(let n of t)if(!(n==="\\\\"||sn.test(n))){if(Ot.has(n)||ze.has(n)||si.has(n)){e=!0;continue}return!1}return e}function Io(t,e){let n=e-1;if(n<=0)return Math.max(n,0);let i=t.charCodeAt(n);if(i<56320||i>57343)return n;let r=n-1;if(r<0)return n;let o=t.charCodeAt(r);return o>=55296&&o<=56319?r:n}function un(t){if(t.length===0)return null;let e=Io(t,t.length);return t.slice(e)}function ql(t){let e=Array.from(t),n=e.length;for(;n>0;){let i=e[n-1];if(sn.test(i)){n--;continue}if(Ot.has(i)||si.has(i)){n--;continue}break}return n<=0||n===e.length?null:{head:e.slice(0,n).join(""),tail:e.slice(n).join("")}}function Vl(t,e,n){return n==="text"&&!e&&t.length===1&&t!=="-"&&t!=="\\u2014"?t:null}function vo(t,e,n,i){let r=e[i],o=t[i];if(r==null)return o;let s=n[i];if(o.length===s)return o;let l=r.repeat(s);return t[i]=l,l}function _o(t,e){return t&&e!==null&&Bl.has(e)}function Ul(t){let e=un(t);return e!==null&&Il.has(e)}function zl(t){if(t.length<2||t[0]!==" ")return null;let e=t.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function cn(t){let e=t.length;for(;e>0;){let n=Io(t,e),i=t.slice(n,e);if(Ol.has(i))return!0;if(!ze.has(i))return!1;e=n}return!1}function jl(t,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(t===" ")return"preserved-space";if(t===" ")return"tab";if(e.preserveHardBreaks&&t===`\n`)return"hard-break"}return t===" "?"space":t==="\\xA0"||t==="\\u202F"||t==="\\u2060"||t==="\\uFEFF"?"glue":t==="\\u200B"?"zero-width-break":t==="\\xAD"?"soft-hyphen":"text"}var $l=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Te(t){return t.length===1?t[0]:t.join("")}function Gl(t,e){let n=[];for(let i=t.length-1;i>=0;i--)n.push(t[i]);return n.push(e),Te(n)}function Kl(t,e,n,i){if(!$l.test(t))return[{text:t,isWordLike:e,kind:"text",start:n}];let r=[],o=null,s=[],l=n,a=!1,c=0;for(let u of t){let m=jl(u,i),f=m==="text"&&e;if(o!==null&&m===o&&f===a){s.push(u),c+=u.length;continue}o!==null&&r.push({text:Te(s),isWordLike:a,kind:o,start:l}),o=m,s=[u],l=n+c,a=f,c+=u.length}return o!==null&&r.push({text:Te(s),isWordLike:a,kind:o,start:l}),r}function oi(t){return t==="space"||t==="preserved-space"||t==="zero-width-break"||t==="hard-break"}var Jl=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Ql(t,e){let n=t.texts[e];return n.startsWith("www.")?!0:Jl.test(n)&&e+1<t.len&&t.kinds[e+1]==="text"&&t.texts[e+1]==="//"}function Yl(t){return t.includes("?")&&(t.includes("://")||t.startsWith("www."))}function Zl(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let s=0;s<t.len;s++){if(i[s]!=="text"||!Ql(t,s))continue;let l=[e[s]],a=s+1;for(;a<t.len&&!oi(i[a]);){l.push(e[a]),n[s]=!0;let c=e[a].includes("?");if(i[a]="text",e[a]="",a++,c)break}e[s]=Te(l)}let o=0;for(let s=0;s<e.length;s++){let l=e[s];l.length!==0&&(o!==s&&(e[o]=l,n[o]=n[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,n.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:n,kinds:i,starts:r}}function Xl(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o]),!Yl(s))continue;let l=o+1;if(l>=t.len||oi(t.kinds[l]))continue;let a=[],c=t.starts[l],u=l;for(;u<t.len&&!oi(t.kinds[u]);)a.push(t.texts[u]),u++;a.length>0&&(e.push(Te(a)),n.push(!0),i.push("text"),r.push(c),o=u-1)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}var eu=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Ro=/^[A-Za-z0-9_]+[,:;]*$/,Lo=/[,:;]+$/;function Oo(t){for(let e of t)if(Bo.test(e))return!0;return!1}function It(t){if(t.length===0)return!1;for(let e of t)if(!(Bo.test(e)||eu.has(e)))return!1;return!0}function tu(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o];if(l==="text"&&It(s)&&Oo(s)){let a=[s],c=o+1;for(;c<t.len&&t.kinds[c]==="text"&&It(t.texts[c]);)a.push(t.texts[c]),c++;e.push(Te(a)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=c-1;continue}e.push(s),n.push(t.isWordLike[o]),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function nu(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o],a=t.isWordLike[o];if(l==="text"&&a&&Ro.test(s)){let c=[s],u=Lo.test(s),m=o+1;for(;u&&m<t.len&&t.kinds[m]==="text"&&t.isWordLike[m]&&Ro.test(t.texts[m]);){let f=t.texts[m];c.push(f),u=Lo.test(f),m++}e.push(Te(c)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=m-1;continue}e.push(s),n.push(a),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function iu(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(t.kinds[o]==="text"&&s.includes("-")){let l=s.split("-"),a=l.length>1;for(let c=0;c<l.length;c++){let u=l[c];if(!a)break;(u.length===0||!Oo(u)||!It(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){let m=l[u],f=u<l.length-1?`${m}-`:m;e.push(f),n.push(!0),i.push("text"),r.push(t.starts[o]+c),c+=f.length}continue}}e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function ru(t){let e=[],n=[],i=[],r=[],o=0;for(;o<t.len;){let s=[t.texts[o]],l=t.isWordLike[o],a=t.kinds[o],c=t.starts[o];if(a==="glue"){let u=[s[0]],m=c;for(o++;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let f=Te(u);if(o<t.len&&t.kinds[o]==="text")s[0]=f,s.push(t.texts[o]),l=t.isWordLike[o],a="text",c=m,o++;else{e.push(f),n.push(!1),i.push("glue"),r.push(m);continue}}else o++;if(a==="text")for(;o<t.len&&t.kinds[o]==="glue";){let u=[];for(;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let m=Te(u);if(o<t.len&&t.kinds[o]==="text"){s.push(m,t.texts[o]),l=l||t.isWordLike[o],o++;continue}s.push(m)}e.push(Te(s)),n.push(l),i.push(a),r.push(c)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function ou(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Re(e[o])||!Re(e[o+1]))continue;let s=ql(e[o]);s!==null&&(e[o]=s.head,e[o+1]=s.tail+e[o+1],r[o+1]=r[o]+s.head.length)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Do(t,e,n){let i=kl(),r=0,o=[],s=[],l=[],a=[],c=[],u=[],m=[],f=[],x=[],F=[],E=[],S=[];for(let C of i.segment(t))for(let g of Kl(C.segment,C.isWordLike??!1,C.index,n)){let ue=function(){u[R]!==null&&(s[R]=[vo(o,u,m,R)],u[R]=null),s[R].push(g.text),l[R]=l[R]||g.isWordLike,f[R]=f[R]||w,x[R]=x[R]||T,F[R]=P,E[R]=J,S[R]=_o(x[R],L)},A=g.kind==="text",N=Vl(g.text,g.isWordLike,g.kind),w=Re(g.text),T=To(g.text),L=un(g.text),P=cn(g.text),J=Ul(g.text),R=r-1;e.carryCJKAfterClosingQuote&&A&&r>0&&a[R]==="text"&&w&&f[R]&&F[R]||A&&r>0&&a[R]==="text"&&Wl(g.text)&&f[R]||A&&r>0&&a[R]==="text"&&E[R]?ue():A&&r>0&&a[R]==="text"&&g.isWordLike&&T&&S[R]?(ue(),l[R]=!0):N!==null&&r>0&&a[R]==="text"&&u[R]===N?m[R]=(m[R]??1)+1:A&&!g.isWordLike&&r>0&&a[R]==="text"&&(Pl(g.text)||g.text==="-"&&l[R])?ue():(o[r]=g.text,s[r]=[g.text],l[r]=g.isWordLike,a[r]=g.kind,c[r]=g.start,u[r]=N,m[r]=N===null?0:1,f[r]=w,x[r]=T,F[r]=P,E[r]=J,S[r]=_o(T,L),r++)}for(let C=0;C<r;C++){if(u[C]!==null){o[C]=vo(o,u,m,C);continue}o[C]=Te(s[C])}for(let C=1;C<r;C++)a[C]==="text"&&!l[C]&&ai(o[C])&&a[C-1]==="text"&&(o[C-1]+=o[C],l[C-1]=l[C-1]||l[C],o[C]="");let B=Array.from({length:r},()=>null),D=-1;for(let C=r-1;C>=0;C--){let g=o[C];if(g.length!==0){if(a[C]==="text"&&!l[C]&&Hl(g)&&D>=0&&a[D]==="text"){let A=B[D]??[];A.push(g),B[D]=A,c[D]=c[C],o[C]="";continue}D=C}}for(let C=0;C<r;C++){let g=B[C];g!=null&&(o[C]=Gl(g,o[C]))}let v=0;for(let C=0;C<r;C++){let g=o[C];g.length!==0&&(v!==C&&(o[v]=g,l[v]=l[C],a[v]=a[C],c[v]=c[C]),v++)}o.length=v,l.length=v,a.length=v,c.length=v;let te=ru({len:v,texts:o,isWordLike:l,kinds:a,starts:c}),q=ou(nu(iu(tu(Xl(Zl(te))))));for(let C=0;C<q.len-1;C++){let g=zl(q.texts[C]);g!==null&&(q.kinds[C]!=="space"&&q.kinds[C]!=="preserved-space"||q.kinds[C+1]!=="text"||!To(q.texts[C+1])||(q.texts[C]=g.space,q.isWordLike[C]=!1,q.kinds[C]=q.kinds[C]==="preserved-space"?"preserved-space":"space",q.texts[C+1]=g.marks+q.texts[C+1],q.starts[C+1]=q.starts[C]+g.space.length))}return q}function su(t,e){if(t.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}];let n=[],i=0;for(let r=0;r<t.len;r++)t.kinds[r]==="hard-break"&&(n.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<t.len&&n.push({startSegmentIndex:i,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}),n}function au(t){if(t.len<=1)return t;let e=[],n=[],i=[],r=[],o=null,s=!1,l=0,a=!1,c=!1;function u(){o!==null&&(e.push(Te(o)),n.push(s),i.push("text"),r.push(l),o=null)}for(let m=0;m<t.len;m++){let f=t.texts[m],x=t.kinds[m],F=t.isWordLike[m],E=t.starts[m];if(x==="text"){let S=Ll(f),B=an(f);if(o!==null&&a&&c){o.push(f),s=s||F,a=a||S,c=B;continue}u(),o=[f],s=F,l=E,a=S,c=B;continue}u(),e.push(f),n.push(F),i.push(x),r.push(E)}return u(),{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Po(t,e,n="normal",i="normal"){let r=Nl(n),o=r.mode==="pre-wrap"?Ml(t):Cl(t);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?au(Do(o,e,r)):Do(o,e,r);return{normalized:o,chunks:su(s,r),...s}}var at=null,Wo=new Map,lt=null,lu=96,uu=/\\p{Emoji_Presentation}/u,cu=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,li=null,Ho=new Map;function ui(){if(at!==null)return at;if(typeof OffscreenCanvas<"u")return at=new OffscreenCanvas(1,1).getContext("2d"),at;if(typeof document<"u")return at=document.createElement("canvas").getContext("2d"),at;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function du(t){let e=Wo.get(t);return e||(e=new Map,Wo.set(t,e)),e}function Pe(t,e){let n=e.get(t);return n===void 0&&(n={width:ui().measureText(t).width,containsCJK:Re(t)},e.set(t,n)),n}function ut(){if(lt!==null)return lt;if(typeof navigator>"u")return lt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},lt;let t=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&t.includes("Safari/")&&!t.includes("Chrome/")&&!t.includes("Chromium/")&&!t.includes("CriOS/")&&!t.includes("FxiOS/")&&!t.includes("EdgiOS/"),i=t.includes("Chrome/")||t.includes("Chromium/")||t.includes("CriOS/")||t.includes("Edg/");return lt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},lt}function fu(t){let e=t.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function qo(){return li===null&&(li=new Intl.Segmenter(void 0,{granularity:"grapheme"})),li}function mu(t){return uu.test(t)||t.includes("\\uFE0F")}function Vo(t){return cu.test(t)}function pu(t,e){let n=Ho.get(t);if(n!==void 0)return n;let i=ui();i.font=t;let r=i.measureText("\\u{1F600}").width;if(n=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=t,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let s=o.getBoundingClientRect().width;document.body.removeChild(o),r-s>.5&&(n=r-s)}return Ho.set(t,n),n}function hu(t){let e=0,n=qo();for(let i of n.segment(t))mu(i.segment)&&e++;return e}function xu(t,e){return e.emojiCount===void 0&&(e.emojiCount=hu(t)),e.emojiCount}function je(t,e,n){return n===0?e.width:e.width-xu(t,e)*n}function Uo(t,e,n,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=qo(),s=[];for(let u of o.segment(t))s.push(u.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let u=[];for(let m of s){let f=Pe(m,n);u.push(je(m,f,i))}return e.breakableFitAdvances=u,e.breakableFitAdvances}if(r==="pair-context"||s.length>lu){let u=[],m=null,f=0;for(let x of s){let F=Pe(x,n),E=je(x,F,i);if(m===null)u.push(E);else{let S=m+x,B=Pe(S,n);u.push(je(S,B,i)-f)}m=x,f=E}return e.breakableFitAdvances=u,e.breakableFitAdvances}let l=[],a="",c=0;for(let u of s){a+=u;let m=Pe(a,n),f=je(a,m,i);l.push(f-c),c=f}return e.breakableFitAdvances=l,e.breakableFitAdvances}function zo(t,e){let n=ui();n.font=t;let i=du(t),r=fu(t),o=e?pu(t,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function gu(t,e){for(;e<t.widths.length;){let n=t.kinds[e];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;e++}return e}function yu(t,e){if(e<=0)return 0;let n=t%e;return Math.abs(n)<=1e-6?e:e-n}function Su(t,e,n,i,r){let o=0,s=e;for(;o<t.length;){let l=s+t[o];if((o+1<t.length?l+r:l)>n+i)break;s=l,o++}return{fitCount:o,fittedWidth:s}}function jo(t,e){return t.simpleLineWalkFastPath?$o(t,e):Go(t,e)}function $o(t,e,n){let{widths:i,kinds:r,breakableFitAdvances:o}=t;if(i.length===0)return 0;let l=ut().lineFitEpsilon,a=e+l,c=0,u=0,m=!1,f=0,x=0,F=0,E=0,S=-1,B=0;function D(){S=-1,B=0}function v(N=F,w=E,T=u){c++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:N,endGraphemeIndex:w,width:T}),u=0,m=!1,D()}function te(N,w){m=!0,f=N,x=0,F=N+1,E=0,u=w}function q(N,w,T){m=!0,f=N,x=w,F=N,E=w+1,u=T}function C(N,w){if(!m){te(N,w);return}u+=w,F=N+1,E=0}function g(N,w){let T=o[N];for(let L=w;L<T.length;L++){let P=T[L];m?u+P>a?(v(),q(N,L,P)):(u+=P,F=N,E=L+1):q(N,L,P)}m&&F===N&&E===T.length&&(F=N+1,E=0)}let A=0;for(;A<i.length&&!(!m&&(A=gu(t,A),A>=i.length));){let N=i[A],w=r[A],T=w==="space"||w==="preserved-space"||w==="tab"||w==="zero-width-break"||w==="soft-hyphen";if(!m){N>e&&o[A]!==null?g(A,0):te(A,N),T&&(S=A+1,B=u-N),A++;continue}if(u+N>a){if(T){C(A,N),v(A+1,0,u-N),A++;continue}if(S>=0){if(F>S||F===S&&E>0){v();continue}v(S,0,B);continue}if(N>e&&o[A]!==null){v(),g(A,0),A++;continue}v();continue}C(A,N),T&&(S=A+1,B=u-N),A++}return m&&v(),c}function Go(t,e,n){if(t.simpleLineWalkFastPath)return $o(t,e,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:l,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:u}=t;if(i.length===0||u.length===0)return 0;let m=ut(),f=m.lineFitEpsilon,x=e+f,F=0,E=0,S=!1,B=0,D=0,v=0,te=0,q=-1,C=0,g=0,A=null;function N(){q=-1,C=0,g=0,A=null}function w(G=v,U=te,W=E){F++,n?.({startSegmentIndex:B,startGraphemeIndex:D,endSegmentIndex:G,endGraphemeIndex:U,width:W}),E=0,S=!1,N()}function T(G,U){S=!0,B=G,D=0,v=G+1,te=0,E=U}function L(G,U,W){S=!0,B=G,D=U,v=G,te=U+1,E=W}function P(G,U){if(!S){T(G,U);return}E+=U,v=G+1,te=0}function J(G,U,W,Z){if(!U)return;let pe=G==="tab"?0:r[W],Fe=G==="tab"?Z:o[W];q=W+1,C=E-Z+pe,g=E-Z+Fe,A=G}function R(G,U){let W=l[G];for(let Z=U;Z<W.length;Z++){let pe=W[Z];S?E+pe>x?(w(),L(G,Z,pe)):(E+=pe,v=G,te=Z+1):L(G,Z,pe)}S&&v===G&&te===W.length&&(v=G+1,te=0)}function ue(G){if(A!=="soft-hyphen")return!1;let U=l[G];if(U==null)return!1;let{fitCount:W,fittedWidth:Z}=Su(U,E,e,f,a);return W===0?!1:(E=Z,v=G,te=W,N(),W===U.length?(v=G+1,te=0,!0):(w(G,W,Z+a),R(G,W),!0))}function Se(G){F++,n?.({startSegmentIndex:G.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:G.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),N()}for(let G=0;G<u.length;G++){let U=u[G];if(U.startSegmentIndex===U.endSegmentIndex){Se(U);continue}S=!1,E=0,B=U.startSegmentIndex,D=0,v=U.startSegmentIndex,te=0,N();let W=U.startSegmentIndex;for(;W<U.endSegmentIndex;){let Z=s[W],pe=Z==="space"||Z==="preserved-space"||Z==="tab"||Z==="zero-width-break"||Z==="soft-hyphen",Fe=Z==="tab"?yu(E,c):i[W];if(Z==="soft-hyphen"){S&&(v=W+1,te=0,q=W+1,C=E+a,g=E+a,A=Z),W++;continue}if(!S){Fe>e&&l[W]!==null?R(W,0):T(W,Fe),J(Z,pe,W,Fe),W++;continue}if(E+Fe>x){let k=E+(Z==="tab"?0:r[W]),O=E+(Z==="tab"?Fe:o[W]);if(A==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&C<=x){w(q,0,g);continue}if(A==="soft-hyphen"&&ue(W)){W++;continue}if(pe&&k<=x){P(W,Fe),w(W+1,0,O),W++;continue}if(q>=0&&C<=x){if(v>q||v===q&&te>0){w();continue}let ie=q;w(ie,0,g),W=ie;continue}if(Fe>e&&l[W]!==null){w(),R(W,0),W++;continue}w();continue}P(W,Fe),J(Z,pe,W,Fe),W++}if(S){let Z=q===U.consumedEndSegmentIndex?g:E;w(U.consumedEndSegmentIndex,0,Z)}}return F}var ci=null;function bu(){return ci===null&&(ci=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ci}function Au(t){return t?{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 Eu(t,e){let n=[],i=[],r=0,o=!1,s=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,l=!1)}function c(m,f,x){i=[m],r=f,o=x,s=cn(m),l=Ot.has(m)}function u(m,f){i.push(m),o=o||f;let x=cn(m);m.length===1&&ze.has(m)?s=s||x:s=x,l=!1}for(let m of bu().segment(t)){let f=m.segment,x=Re(f);if(i.length===0){c(f,m.index,x);continue}if(l||ln.has(f)||ze.has(f)||e.carryCJKAfterClosingQuote&&x&&s){u(f,x);continue}if(!o&&!x){u(f,x);continue}a(),c(f,m.index,x)}return a(),n}function Fu(t){if(t.length<=1)return t;let e=[],n=[t[0].text],i=t[0].start,r=Re(t[0].text),o=an(t[0].text);function s(){e.push({text:n.length===1?n[0]:n.join(""),start:i})}for(let l=1;l<t.length;l++){let a=t[l],c=Re(a.text),u=an(a.text);if(r&&o){n.push(a.text),r=r||c,o=u;continue}s(),n=[a.text],i=a.start,r=c,o=u}return s(),e}function wu(t,e,n,i){let r=ut(),{cache:o,emojiCorrection:s}=zo(e,Vo(t.normalized)),l=je("-",Pe("-",o),s),c=je(" ",Pe(" ",o),s)*8;if(t.len===0)return Au(n);let u=[],m=[],f=[],x=[],F=t.chunks.length<=1,E=n?[]:null,S=[],B=n?[]:null,D=Array.from({length:t.len});function v(g,A,N,w,T,L,P){T!=="text"&&T!=="space"&&T!=="zero-width-break"&&(F=!1),u.push(A),m.push(N),f.push(w),x.push(T),E?.push(L),S.push(P),B!==null&&B.push(g)}function te(g,A,N,w,T){let L=Pe(g,o),P=je(g,L,s),J=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:P,R=A==="space"||A==="zero-width-break"?0:P;if(T&&w&&g.length>1){let ue="sum-graphemes";It(g)?ue="pair-context":r.preferPrefixWidthsForBreakableRuns&&(ue="segment-prefixes");let Se=Uo(g,L,o,s,ue);v(g,P,J,R,A,N,Se);return}v(g,P,J,R,A,N,null)}for(let g=0;g<t.len;g++){D[g]=u.length;let A=t.texts[g],N=t.isWordLike[g],w=t.kinds[g],T=t.starts[g];if(w==="soft-hyphen"){v(A,0,l,l,w,T,null);continue}if(w==="hard-break"){v(A,0,0,0,w,T,null);continue}if(w==="tab"){v(A,0,0,0,w,T,null);continue}let L=Pe(A,o);if(w==="text"&&L.containsCJK){let P=Eu(A,r),J=i==="keep-all"?Fu(P):P;for(let R=0;R<J.length;R++){let ue=J[R];te(ue.text,"text",T+ue.start,N,i==="keep-all"||!Re(ue.text))}continue}te(A,w,T,N,!0)}let q=Nu(t.chunks,D,u.length),C=E===null?null:Mo(t.normalized,E);return B!==null?{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:F,segLevels:C,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:q,segments:B}:{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:F,segLevels:C,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:q}}function Nu(t,e,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:n,l=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:n,a=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:s,endSegmentIndex:l,consumedEndSegmentIndex:a})}return i}function Cu(t,e,n,i){let r=i?.wordBreak??"normal",o=Po(t,ut(),i?.whiteSpace,r);return wu(o,e,n,r)}function Ko(t,e,n){return Cu(t,e,!1,n)}function Jo(t,e,n){let i=jo(t,e);return{lineCount:i,height:i*n}}var Mu={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Qo(t,e){let n={...Mu,...e},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,s=Ko(t,o),{lineCount:l}=Jo(s,n.maxWidth,r*i);if(l<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:Qo,getVariables:ho};function Yo(){let t=window;t.__hyperframeRuntimeBootstrapped||(t.__hyperframeRuntimeBootstrapped=!0,No())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Yo,{once:!0}):Yo();})();\n';
|
|
39820
|
+
RUNTIME_IIFE = '"use strict";(()=>{var rs=Object.create;var gn=Object.defineProperty;var os=Object.getOwnPropertyDescriptor;var ss=Object.getOwnPropertyNames;var as=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty;var us=(t,e,n)=>e in t?gn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ee=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var cs=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ss(e))!ls.call(t,r)&&r!==n&&gn(t,r,{get:()=>e[r],enumerable:!(i=os(e,r))||i.enumerable});return t};var ds=(t,e,n)=>(n=t!=null?rs(as(t)):{},cs(e||!t||!t.__esModule?gn(n,"default",{value:t,enumerable:!0}):n,t));var ge=(t,e,n)=>us(t,typeof e!="symbol"?e+"":e,n);var Vi=ee((pc,wn)=>{var K=String,qi=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}};wn.exports=qi();wn.exports.createColors=qi});var Nn=ee(()=>{});var Vt=ee((gc,ji)=>{"use strict";var Ui=Vi(),zi=Nn(),St=class t extends Error{constructor(e,n,i,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),typeof n<"u"&&typeof i<"u"&&(typeof n=="number"?(this.line=n,this.column=i):(this.line=n.line,this.column=n.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}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(e){if(!this.source)return"";let n=this.source;e==null&&(e=Ui.isColorSupported);let i=u=>u,r=u=>u,o=u=>u;if(e){let{bold:u,gray:m,red:f}=Ui.createColors(!0);r=x=>u(f(x)),i=x=>m(x),zi&&(o=x=>zi(x))}let s=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length;return s.slice(l,a).map((u,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-c)+" | ";if(f===this.line){if(u.length>160){let E=20,S=Math.max(0,this.column-E),B=Math.max(this.column+E,this.endColumn+E),D=u.slice(S,B),v=i(x.replace(/\\d/g," "))+u.slice(0,Math.min(this.column-1,E-1)).replace(/[^\\t]/g," ");return r(">")+i(x)+o(D)+`\n `+v+r("^")}let F=i(x.replace(/\\d/g," "))+u.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(x)+o(u)+`\n `+F+r("^")}return" "+i(x)+o(u)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};ji.exports=St;St.default=St});var Cn=ee((yc,Gi)=>{"use strict";var Ls=/(<)(\\/?style\\b)/gi,Ds=/(<)(!--)/g;function He(t){return typeof t!="string"||!t.includes("<")?t:t.replace(Ls,"\\\\3c $2").replace(Ds,"\\\\3c $2")}var $i={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Bs(t){return t[0].toUpperCase()+t.slice(1)}var bt=class{constructor(e){this.builder=e}atrule(e,n){let i=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(typeof i.afterName<"u"?r+=i.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let s=(i.between||"")+(n?";":"");this.builder(He(r+o+s),e)}}beforeAfter(e,n){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):n==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let s=this.raw(e,null,"indent");if(s.length)for(let l=0;l<o;l++)i+=s}return i}block(e,n){let i=this.raw(e,"between","beforeOpen");this.builder(He(n+i)+"{",e,"start");let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(He(r)),this.builder("}",e,"end")}body(e){let n=e.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let r=this.raw(e,"semicolon"),o=e.type==="document";for(let s=0;s<n.length;s++){let l=n[s],a=this.raw(l,"before");a&&this.builder(o?a:He(a)),this.stringify(l,i!==s||r)}}comment(e){let n=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder(He("/*"+n+e.text+i+"*/"),e)}decl(e,n){let i=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=i.important||" !important"),n&&(o+=";"),this.builder(He(o),e)}document(e){this.body(e)}raw(e,n,i){let r;if(i||(i=n),n&&(r=e.raws[n],typeof r<"u"))return r;let o=e.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return $i[i];let s=e.root(),l=s.rawCache||(s.rawCache={});if(typeof l[i]<"u")return l[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+Bs(i);this[a]?r=this[a](s,e):s.walk(c=>{if(r=c.raws[n],typeof r<"u")return!1})}return typeof r>"u"&&(r=$i[i]),l[i]=r,r}rawBeforeClose(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return n=i.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(e,n){let i;return e.walkComments(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(e,n){let i;return e.walkDecls(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(e){let n;return e.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(e){let n;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return n=i.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(e){let n;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(e){if(e.raws.indent)return e.raws.indent;let n;return e.walk(i=>{let r=i.parent;if(r&&r!==e&&r.parent&&r.parent===e&&typeof i.raws.before<"u"){let o=i.raws.before.split(`\n`);return n=o[o.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(e,n){let i=e[n],r=e.raws[n];return r&&r.value===i?r.raw:i}root(e){if(this.body(e),e.raws.after){let n=e.raws.after,i=e.parent&&e.parent.type==="document";this.builder(i?n:He(n))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(He(e.raws.ownSemicolon),e,"end")}stringify(e,n){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,n)}};Gi.exports=bt;bt.default=bt});var At=ee((Sc,Ki)=>{"use strict";var Is=Cn();function Mn(t,e){new Is(e).stringify(t)}Ki.exports=Mn;Mn.default=Mn});var Ut=ee((bc,Tn)=>{"use strict";Tn.exports.isClean=Symbol("isClean");Tn.exports.my=Symbol("my")});var wt=ee((Ac,Ji)=>{"use strict";var Os=Vt(),Ps=Cn(),Ws=At(),{isClean:Et,my:Hs}=Ut();function kn(t,e){let n=new t.constructor;for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||i==="proxyCache")continue;let r=t[i],o=typeof r;i==="parent"&&o==="object"?e&&(n[i]=e):i==="source"?n[i]=r:Array.isArray(r)?n[i]=r.map(s=>kn(s,n)):(o==="object"&&r!==null&&(r=kn(r)),n[i]=r)}return n}function Oe(t,e){if(e&&typeof e.offset<"u")return e.offset;let n=1,i=1,r=0;for(let o=0;o<t.length;o++){if(i===e.line&&n===e.column){r=o;break}t[o]===`\n`?(n=1,i+=1):n+=1}return r}var Ft=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[Et]=!1,this[Hs]=!0;for(let n in e)if(n==="nodes"){this.nodes=[];for(let i of e[n])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[n]=e[n]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let n=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let n in e)this[n]=e[n];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let n=kn(this);for(let i in e)n[i]=e[i];return n}cloneAfter(e={}){let n=this.clone(e);return this.parent.insertAfter(this,n),n}cloneBefore(e={}){let n=this.clone(e);return this.parent.insertBefore(this,n),n}error(e,n={}){if(this.source){let{end:i,start:r}=this.rangeBy(n);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},n)}return new Os(e)}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:n==="root"?()=>e.root().toProxy():e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&e.markDirty()),!0}}}markClean(){this[Et]=!0}markDirty(){if(this[Et]){this[Et]=!1;let e=this;for(;e=e.parent;)e[Et]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let n=this.source.start;if(e.index)n=this.positionInside(e.index);else if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(Oe(i,this.source.start),Oe(i,this.source.end)).indexOf(e.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(e){let n=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=Oe(r,this.source.start),s=o+e;for(let l=o;l<s;l++)r[l]===`\n`?(n=1,i+=1):n+=1;return{column:n,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:Oe(n,this.source.start)},r=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:Oe(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=n.slice(Oe(n,this.source.start),Oe(n,this.source.end)).indexOf(e.word);s!==-1&&(i=this.positionInside(s),r=this.positionInside(s+e.word.length))}else e.start?i={column:e.start.column,line:e.start.line,offset:Oe(n,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:Oe(n,e.end)}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<i.line||r.line===i.line&&r.column<=i.column)&&(r={column:i.column+1,line:i.line,offset:i.offset+1}),{end:r,start:i}}raw(e,n){return new Ps().raw(this,e,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let n=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(n,r),n=r):this.parent.insertBefore(n,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,n){let i={},r=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let l=this[s];if(Array.isArray(l))i[s]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,n):a);else if(typeof l=="object"&&l.toJSON)i[s]=l.toJSON(null,n);else if(s==="source"){if(l==null)continue;let a=n.get(l.input);a==null&&(a=o,n.set(l.input,o),o++),i[s]={end:l.end,inputId:a,start:l.start}}else i[s]=l}return r&&(i.inputs=[...n.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ws){e.stringify&&(e=e.stringify);let n="";return e(this,i=>{n+=i}),n}warn(e,n,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(n,r)}};Ji.exports=Ft;Ft.default=Ft});var Ct=ee((Ec,Qi)=>{"use strict";var qs=wt(),Nt=class extends qs{constructor(e){super(e),this.type="comment"}};Qi.exports=Nt;Nt.default=Nt});var Tt=ee((Fc,Yi)=>{"use strict";var Vs=wt(),Mt=class extends Vs{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Yi.exports=Mt;Mt.default=Mt});var qe=ee((wc,sr)=>{"use strict";var Zi=Ct(),Xi=Tt(),Us=wt(),{isClean:er,my:tr}=Ut(),vn,nr,ir,_n;function rr(t){return t.map(e=>(e.nodes&&(e.nodes=rr(e.nodes)),delete e.source,e))}function or(t){if(t[er]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)or(e)}var _e=class t extends Us{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(...e){for(let n of e){let i=this.normalize(n,this.last);for(let r of i)this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let n of this.nodes)n.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let n=this.getIterator(),i,r;for(;this.indexes[n]<this.proxyOf.nodes.length&&(i=this.indexes[n],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:e[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...i)=>e[n](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):n==="every"||n==="some"?i=>e[n]((r,...o)=>i(r.toProxy(),...o)):n==="root"?()=>e.root().toProxy():n==="nodes"?e.nodes.map(i=>i.toProxy()):n==="first"||n==="last"?e[n].toProxy():e[n]:e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="name"||n==="params"||n==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,n){let i=this.index(e),r=this.normalize(n,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let s of r)this.proxyOf.nodes.splice(i+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],i<o&&(this.indexes[s]=o+r.length);return this.markDirty(),this}insertBefore(e,n){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let l of o)this.proxyOf.nodes.splice(i,0,l);let s;for(let l in this.indexes)s=this.indexes[l],i<=s&&(this.indexes[l]=s+o.length);return this.markDirty(),this}normalize(e,n){if(typeof e=="string")e=rr(nr(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Xi(e)]}else if(e.selector||e.selectors)e=[new _n(e)];else if(e.name)e=[new vn(e)];else if(e.text)e=[new Zi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[tr]||t.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[er]&&or(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(r.raws.before=n.raws.before.replace(/\\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let n of e){let i=this.normalize(n,this.first,"prepend").reverse();for(let r of i)this.proxyOf.nodes.unshift(r);for(let r in this.indexes)this.indexes[r]=this.indexes[r]+i.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let n;for(let i in this.indexes)n=this.indexes[i],n>=e&&(this.indexes[i]=n-1);return this.markDirty(),this}replaceValues(e,n,i){return i||(i=n,n={}),this.walkDecls(r=>{n.props&&!n.props.includes(r.prop)||n.fast&&!r.value.includes(n.fast)||(r.value=r.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((n,i)=>{let r;try{r=e(n,i)}catch(o){throw n.addToError(o)}return r!==!1&&n.walk&&(r=n.walk(e)),r})}walkAtRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return n(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="atrule")return n(i,r)}))}walkComments(e){return this.walk((n,i)=>{if(n.type==="comment")return e(n,i)})}walkDecls(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return n(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="decl")return n(i,r)}))}walkRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return n(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="rule")return n(i,r)}))}};_e.registerParse=t=>{nr=t};_e.registerRule=t=>{_n=t};_e.registerAtRule=t=>{vn=t};_e.registerRoot=t=>{ir=t};sr.exports=_e;_e.default=_e;_e.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,vn.prototype):t.type==="rule"?Object.setPrototypeOf(t,_n.prototype):t.type==="decl"?Object.setPrototypeOf(t,Xi.prototype):t.type==="comment"?Object.setPrototypeOf(t,Zi.prototype):t.type==="root"&&Object.setPrototypeOf(t,ir.prototype),t[tr]=!0,t.nodes&&t.nodes.forEach(e=>{_e.rebuild(e)})}});var zt=ee((Nc,lr)=>{"use strict";var ar=qe(),nt=class extends ar{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};lr.exports=nt;nt.default=nt;ar.registerAtRule(nt)});var jt=ee((Cc,dr)=>{"use strict";var zs=qe(),ur,cr,Ye=class extends zs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ur(new cr,this,e).stringify()}};Ye.registerLazyResult=t=>{ur=t};Ye.registerProcessor=t=>{cr=t};dr.exports=Ye;Ye.default=Ye});var mr=ee((Mc,fr)=>{var js="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$s=(t,e=21)=>(n=e)=>{let i="",r=n|0;for(;r--;)i+=t[Math.random()*t.length|0];return i},Gs=(t=21)=>{let e="",n=t|0;for(;n--;)e+=js[Math.random()*64|0];return e};fr.exports={nanoid:Gs,customAlphabet:$s}});var $t=ee(()=>{});var Gt=ee(()=>{});var Rn=ee(()=>{});var pr=ee(()=>{});var Dn=ee((Ic,gr)=>{"use strict";var{existsSync:Ks,readFileSync:Js}=pr(),{dirname:Ln,join:Qs}=$t(),{SourceMapConsumer:hr,SourceMapGenerator:xr}=Gt();function Ys(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}var kt=class{constructor(e,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=n.map?n.map.prev:void 0,r=this.loadMap(n.from,i);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Ln(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new hr(this.json||this.text)),this.consumerCache}decodeInline(e){let n=/^data:application\\/json;charset=utf-?8;base64,/,i=/^data:application\\/json;base64,/,r=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,s=e.match(r)||e.match(o);if(s)return decodeURIComponent(e.substr(s[0].length));let l=e.match(n)||e.match(i);if(l)return Ys(e.substr(l[0].length));let a=e.slice(22);throw a=a.slice(0,a.indexOf(",")),new Error("Unsupported source map encoding "+a)}getAnnotationURL(e){return e.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let n=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let i=e.lastIndexOf(n.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e,n,i){if(!(!i&&!this.unsafeMap&&!/\\.map$/i.test(e))&&(this.root=Ln(e),Ks(e)))return this.mapFile=e,Js(e,"utf-8").toString().trim()}loadMap(e,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let i=n(e);if(i){let r=this.loadFile(i,e,!0);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(n instanceof hr)return xr.fromSourceMap(n).toString();if(n instanceof xr)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 i=this.annotation;e&&(i=Qs(Ln(e),i));let r=this.loadFile(i,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return r}}}startWith(e,n){return e?e.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};gr.exports=kt;kt.default=kt});var vt=ee((Oc,Er)=>{"use strict";var{nanoid:Zs}=mr(),{isAbsolute:On,resolve:Pn}=$t(),{SourceMapConsumer:Xs,SourceMapGenerator:ea}=Gt(),{fileURLToPath:yr,pathToFileURL:Kt}=Rn(),Sr=Vt(),ta=Dn(),Bn=Nn(),In=Symbol("lineToIndexCache"),na=!!(Xs&&ea),br=!!(Pn&&On);function Ar(t){if(t[In])return t[In];let e=t.css.split(`\n`),n=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)n[r]=i,i+=e[r].length+1;return t[In]=n,n}var it=class{get from(){return this.file||this.id}constructor(e,n={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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&&(!br||/^\\w+:\\/\\//.test(n.from)||On(n.from)?this.file=n.from:this.file=Pn(n.from)),br&&na){let i=new ta(this.css,n);if(i.text){this.map=i;let r=i.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Zs(6)+">"),this.map&&(this.map.file=this.from)}error(e,n,i,r={}){let o,s,l,a,c;if(n&&typeof n=="object"){let m=n,f=i;if(typeof m.offset=="number"){a=m.offset;let x=this.fromOffset(a);n=x.line,i=x.col}else n=m.line,i=m.column,a=this.fromLineAndColumn(n,i);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);s=x.line,o=x.col}else s=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(i)a=this.fromLineAndColumn(n,i);else{a=n;let m=this.fromOffset(a);n=m.line,i=m.col}let u=this.origin(n,i,s,o);return u?c=new Sr(e,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,r.plugin):c=new Sr(e,s===void 0?n:{column:i,line:n},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),c.input={column:i,endColumn:o,endLine:s,endOffset:l,line:n,offset:a,source:this.css},this.file&&(Kt&&(c.input.url=Kt(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,n){return Ar(this)[e-1]+n-1}fromOffset(e){let n=Ar(this),i=n[n.length-1],r=0;if(e>=i)r=n.length-1;else{let o=n.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<n[s])o=s-1;else if(e>=n[s+1])r=s+1;else{r=s;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:Pn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,n,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:e});if(!s.source)return!1;let l;typeof i=="number"&&(l=o.originalPositionFor({column:r,line:i}));let a;On(s.source)?a=Kt(s.source):a=new URL(s.source,this.map.consumer().sourceRoot||Kt(this.map.mapFile));let c={column:s.column,endColumn:l&&l.column,endLine:l&&l.line,line:s.line,url:a.toString()};if(a.protocol==="file:")if(yr)c.file=yr(a);else throw new Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(s.source);return u&&(c.source=u),c}toJSON(){let e={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(e[n]=this[n]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Er.exports=it;it.default=it;Bn&&Bn.registerInput&&Bn.registerInput(it)});var rt=ee((Pc,Cr)=>{"use strict";var Fr=qe(),wr,Nr,Ve=class extends Fr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,n,i){let r=super.normalize(e);if(n){if(i==="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 r)o.raws.before=n.raws.before}return r}removeChild(e,n){let i=this.index(e);return!n&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new wr(new Nr,this,e).stringify()}};Ve.registerLazyResult=t=>{wr=t};Ve.registerProcessor=t=>{Nr=t};Cr.exports=Ve;Ve.default=Ve;Fr.registerRoot(Ve)});var Wn=ee((Wc,Mr)=>{"use strict";var _t={comma(t){return _t.split(t,[","],!0)},space(t){let e=[" ",`\n`," "];return _t.split(t,e)},split(t,e,n){let i=[],r="",o=!1,s=0,l=!1,a="",c=!1;for(let u of t)c?c=!1:u==="\\\\"?c=!0:l?u===a&&(l=!1):u===\'"\'||u==="\'"?(l=!0,a=u):u==="("?s+=1:u===")"?s>0&&(s-=1):s===0&&e.includes(u)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=u;return(n||r!=="")&&i.push(r.trim()),i}};Mr.exports=_t;_t.default=_t});var Jt=ee((Hc,kr)=>{"use strict";var Tr=qe(),ia=Wn(),ot=class extends Tr{get selectors(){return ia.comma(this.selector)}set selectors(e){let n=this.selector?this.selector.match(/,\\s*/):null,i=n?n[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};kr.exports=ot;ot.default=ot;Tr.registerRule(ot)});var _r=ee((qc,vr)=>{"use strict";var ra=zt(),oa=Ct(),sa=Tt(),aa=vt(),la=Dn(),ua=rt(),ca=Jt();function Rt(t,e){if(Array.isArray(t))return t.map(r=>Rt(r));let{inputs:n,...i}=t;if(n){e=[];for(let r of n){let o={...r,__proto__:aa.prototype};o.map&&(o.map={...o.map,__proto__:la.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=t.nodes.map(r=>Rt(r,e))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=e[r])}if(i.type==="root")return new ua(i);if(i.type==="decl")return new sa(i);if(i.type==="rule")return new ca(i);if(i.type==="comment")return new oa(i);if(i.type==="atrule")return new ra(i);throw new Error("Unknown node type: "+t.type)}vr.exports=Rt;Rt.default=Rt});var qn=ee((Vc,Or)=>{"use strict";var{dirname:Qt,relative:Lr,resolve:Dr,sep:Br}=$t(),{SourceMapConsumer:Ir,SourceMapGenerator:Yt}=Gt(),{pathToFileURL:Rr}=Rn(),da=vt(),fa=!!(Ir&&Yt),ma=!!(Qt&&Dr&&Lr&&Br),Hn=class{constructor(e,n,i,r){this.stringify=e,this.mapOpts=i.map||{},this.root=n,this.opts=i,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let n=this.toUrl(this.path(e.file)),i=e.root||Qt(e.file),r;this.mapOpts.sourcesContent===!1?(r=new Ir(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let n=this.root.nodes.length-1;n>=0;n--)e=this.root.nodes[n],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",e+3);if(n===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),ma&&fa&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,n=>{e+=n}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Yt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Yt({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 Yt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(r.generated.line=e,r.generated.column=n-1,a.source&&a.source.start?(r.source=this.sourcePath(a),r.original.line=a.source.start.line,r.original.column=a.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=l.match(/\\n/g),s?(e+=s.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,a&&c!=="start"){let u=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==u.last||u.raws.semicolon)&&(a.source&&a.source.end?(r.source=this.sourcePath(a),r.original.line=a.source.end.line,r.original.column=a.source.end.column-1,r.generated.line=e,r.generated.column=n-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=n-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\\w+:\\/\\//.test(e))return e;let n=this.memoizedPaths.get(e);if(n)return n;let i=this.opts.to?Qt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Qt(Dr(i,this.mapOpts.annotation)));let r=Lr(i,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let n=e.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let e=new da(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(n=>{if(n.source){let i=n.source.input.from;if(i&&!e[i]){e[i]=!0;let r=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(r,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(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let n=this.memoizedFileURLs.get(e);if(n)return n;if(Rr){let i=Rr(e).toString();return this.memoizedFileURLs.set(e,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let n=this.memoizedURLs.get(e);if(n)return n;Br==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};Or.exports=Hn});var Hr=ee((Uc,Wr)=>{"use strict";var Zt=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Xt=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,pa=/.[\\r\\n"\'(/\\\\]/,Pr=/[\\da-f]/i;Wr.exports=function(e,n={}){let i=e.css.valueOf(),r=n.ignoreErrors,o,s,l,a,c,u,m,f,x,F,E=i.length,S=0,B=[],D=[],v=-1;function te(){return S}function q(N){throw e.error("Unclosed "+N,S)}function C(){return D.length===0&&S>=E}function g(N){if(D.length)return D.pop();if(S>=E)return;let w=N?N.ignoreUnclosed:!1;switch(o=i.charCodeAt(S),o){case 10:case 32:case 9:case 13:case 12:{a=S;do a+=1,o=i.charCodeAt(a);while(o===32||o===10||o===9||o===13||o===12);u=["space",i.slice(S,a)],S=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let M=String.fromCharCode(o);u=[M,M,S];break}case 40:{if(F=B.length?B.pop()[1]:"",x=i.charCodeAt(S+1),F==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){a=S;do{if(m=!1,a=i.indexOf(")",a+1),a===-1)if(r||w){a=S;break}else q("bracket");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["brackets",i.slice(S,a+1),S,a],S=a}else S<=v?u=["(","(",S]:(a=i.indexOf(")",S+1),s=i.slice(S,a+1),a===-1||pa.test(s)?(v=a===-1?E:a,u=["(","(",S]):(u=["brackets",s,S,a],S=a));break}case 39:case 34:{c=o===39?"\'":\'"\',a=S;do{if(m=!1,a=i.indexOf(c,a+1),a===-1)if(r||w){a=S+1;break}else q("string");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["string",i.slice(S,a+1),S,a],S=a;break}case 64:{Zt.lastIndex=S+1,Zt.test(i),Zt.lastIndex===0?a=i.length-1:a=Zt.lastIndex-2,u=["at-word",i.slice(S,a+1),S,a],S=a;break}case 92:{for(a=S,l=!0;i.charCodeAt(a+1)===92;)a+=1,l=!l;if(o=i.charCodeAt(a+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(a+=1,Pr.test(i.charAt(a)))){for(;Pr.test(i.charAt(a+1));)a+=1;i.charCodeAt(a+1)===32&&(a+=1)}u=["word",i.slice(S,a+1),S,a],S=a;break}default:{o===47&&i.charCodeAt(S+1)===42?(a=i.indexOf("*/",S+2)+1,a===0&&(r||w?a=i.length:q("comment")),u=["comment",i.slice(S,a+1),S,a],S=a):(Xt.lastIndex=S+1,Xt.test(i),Xt.lastIndex===0?a=i.length-1:a=Xt.lastIndex-2,u=["word",i.slice(S,a+1),S,a],B.push(u),S=a);break}}return S++,u}function A(N){D.push(N)}return{back:A,endOfFile:C,nextToken:g,position:te}}});var zr=ee((zc,Ur)=>{"use strict";var ha=zt(),xa=Ct(),ga=Tt(),ya=rt(),qr=Jt(),Sa=Hr(),Vr={empty:!0,space:!0};function ba(t){for(let e=t.length-1;e>=0;e--){let n=t[e],i=n[3]||n[2];if(i)return i}}var Vn=class{constructor(e){this.input=e,this.root=new ya,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let n=new ha;n.name=e[1].slice(1),n.name===""&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i,r,o,s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){l=!0;break}else if(i==="}"){if(a.length>0){for(o=a.length-1,r=a[o];r&&r[0]==="space";)r=a[--o];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),s&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[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(e){let n=this.colon(e);if(n===!1)return;let i=0,r;for(let o=n-1;o>=0&&(r=e[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let n=0,i,r,o;for(let[s,l]of e.entries()){if(r=l,o=r[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!i)this.doubleColon(r);else{if(i[0]==="word"&&i[1]==="progid")continue;return s}i=r}return!1}comment(e){let n=new xa;this.init(n,e[2]),n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++;let i=e[1].slice(2,-2);if(!i.trim())n.text="",n.raws.left=i,n.raws.right="";else{let r=i.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=r[2],n.raws.left=r[1],n.raws.right=r[3]}}createTokenizer(){this.tokenizer=Sa(this.input)}decl(e,n){let i=new ga;this.init(i,e[0][2]);let r=e[e.length-1];for(r[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(r[3]||r[2]||ba(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let s=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(o=e[c],o[1].toLowerCase()==="!important"){i.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(i.raws.important=u);break}else if(o[1].toLowerCase()==="important"){let u=e.slice(0),m="";for(let f=c;f>0;f--){let x=u[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=u.pop()[1]+m}m.trim().startsWith("!")&&(i.important=!0,i.raws.important=m,e=u)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),n),i.value.includes(":")&&!n&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let n=new qr;this.init(n,e[2]),n.selector="",n.raws.between="",this.current=n}end(e){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(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}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(e){if(this.spaces+=e[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(e[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(e){let n=this.input.fromOffset(e);return{column:n.col,line:n.line,offset:e}}init(e,n){this.current.push(e),e.source={input:this.input,start:this.getPosition(n)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let n=!1,i=null,r=!1,o=null,s=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(i=c[0],a.push(c),i==="("||i==="[")o||(o=c),s.push(i==="("?")":"]");else if(l&&r&&i==="{")o||(o=c),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(a,l);return}else break;else if(i==="{"){this.rule(a);return}else if(i==="}"){this.tokenizer.back(a.pop()),n=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&r){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,n,i,r){let o,s,l=i.length,a="",c=!0,u,m;for(let f=0;f<l;f+=1)o=i[f],s=o[0],s==="space"&&f===l-1&&!r?c=!1:s==="comment"?(m=i[f-1]?i[f-1][0]:"empty",u=i[f+1]?i[f+1][0]:"empty",!Vr[m]&&!Vr[u]?a.slice(-1)===","?c=!1:a+=o[1]:c=!1):a+=o[1];if(!c){let f=i.reduce((x,F)=>x+F[1],"");e.raws[n]={raw:f,value:a}}e[n]=a}rule(e){e.pop();let n=new qr;this.init(n,e[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(n,"selector",e),this.current=n}spacesAndCommentsFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],!(n!=="space"&&n!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let n,i="";for(;e.length&&(n=e[0][0],!(n!=="space"&&n!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],n==="space");)i=e.pop()[1]+i;return i}stringFrom(e,n){let i="";for(let r=n;r<e.length;r++)i+=e[r][1];return e.splice(n,e.length-n),i}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};Ur.exports=Vn});var tn=ee((jc,jr)=>{"use strict";var Aa=qe(),Ea=vt(),Fa=zr();function en(t,e){let n=new Ea(t,e),i=new Fa(n);try{i.parse()}catch(r){throw r}return i.root}jr.exports=en;en.default=en;Aa.registerParse(en)});var Un=ee(($c,$r)=>{"use strict";var Lt=class{constructor(e,n={}){if(this.type="warning",this.text=e,n.node&&n.node.source){let i=n.node.rangeBy(n);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in n)this[i]=n[i]}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}};$r.exports=Lt;Lt.default=Lt});var nn=ee((Gc,Gr)=>{"use strict";var wa=Un(),Dt=class{get content(){return this.css}constructor(e,n,i){this.processor=e,this.messages=[],this.root=n,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let i=new wa(e,n);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};Gr.exports=Dt;Dt.default=Dt});var zn=ee((Kc,Jr)=>{"use strict";var Kr={};Jr.exports=function(e){Kr[e]||(Kr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var Gn=ee((Qc,Xr)=>{"use strict";var Na=qe(),Ca=jt(),Ma=qn(),Ta=tn(),Qr=nn(),ka=rt(),va=At(),{isClean:De,my:_a}=Ut(),Jc=zn(),Ra={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},La={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},Da={Once:!0,postcssPlugin:!0,prepare:!0},st=0;function Bt(t){return typeof t=="object"&&typeof t.then=="function"}function Zr(t){let e=!1,n=Ra[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[n,n+"-"+e,st,n+"Exit",n+"Exit-"+e]:e?[n,n+"-"+e,n+"Exit",n+"Exit-"+e]:t.append?[n,st,n+"Exit"]:[n,n+"Exit"]}function Yr(t){let e;return t.type==="document"?e=["Document",st,"DocumentExit"]:t.type==="root"?e=["Root",st,"RootExit"]:e=Zr(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function jn(t){return t[De]=!1,t.nodes&&t.nodes.forEach(e=>jn(e)),t}var $n={},Ue=class t{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(e,n,i){this.stringified=!1,this.processed=!1;let r;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))r=jn(n);else if(n instanceof t||n instanceof Qr)r=jn(n.root),n.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{let o=Ta;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(n,i)}catch(s){this.processed=!0,this.error=s}r&&!r[_a]&&Na.rebuild(r)}this.result=new Qr(e,r,i),this.helpers={...$n,postcss:$n,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(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,n){let i=this.result.lastPlugin;try{n&&n.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(n,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([n,r])};for(let n of this.plugins)if(typeof n=="object")for(let i in n){if(!La[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Da[i])if(typeof n[i]=="object")for(let r in n[i])r==="*"?e(n,i,n[i][r]):e(n,i+"-"+r.toLowerCase(),n[i][r]);else typeof n[i]=="function"&&e(n,i,n[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let n=this.plugins[e],i=this.runOnRoot(n);if(Bt(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[De];){e[De]=!0;let n=[Yr(e)];for(;n.length>0;){let i=this.visitTick(n);if(Bt(i))try{await i}catch(r){let o=n[n.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[n,i]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(e.type==="document"){let r=e.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(e,this.helpers)}catch(r){throw this.handleError(r)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return Bt(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,n=va;e.syntax&&(n=e.syntax.stringify),e.stringifier&&(n=e.stringifier),n.stringify&&(n=n.stringify);let i=this.result.root.source;if(e.map===void 0&&!(i&&i.input&&i.input.map)){let s="";return n(this.result.root,l=>{s+=l}),this.result.css=s,this.result}let o=new Ma(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 e of this.plugins){let n=this.runOnRoot(e);if(Bt(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[De];)e[De]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let n of e.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,n){return this.async().then(e,n)}toString(){return this.css}visitSync(e,n){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Bt(o))throw this.getAsyncError()}}visitTick(e){let n=e[e.length-1],{node:i,visitors:r}=n;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&n.visitorIndex<r.length){let[s,l]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return l(i.toProxy(),this.helpers)}catch(a){throw this.handleError(a,i)}}if(n.iterator!==0){let s=n.iterator,l;for(;l=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!l[De]){l[De]=!0,e.push(Yr(l));return}n.iterator=0,delete i.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===st){i.nodes&&i.nodes.length&&(i[De]=!0,n.iterator=i.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[De]=!0;let n=Zr(e);for(let i of n)if(i===st)e.nodes&&e.each(r=>{r[De]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Ue.registerPostcss=t=>{$n=t};Xr.exports=Ue;Ue.default=Ue;ka.registerLazyResult(Ue);Ca.registerLazyResult(Ue)});var to=ee((Zc,eo)=>{"use strict";var Ba=qn(),Ia=tn(),Oa=nn(),Pa=At(),Yc=zn(),It=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 e,n=Ia;try{e=n(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,n,i){n=n.toString(),this.stringified=!1,this._processor=e,this._css=n,this._opts=i,this._map=void 0;let r=Pa;this.result=new Oa(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new Ba(r,void 0,this._opts,n);if(s.isMap()){let[l,a]=s.generate();l&&(this.result.css=l),a&&(this.result.map=a)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,n){return this.async().then(e,n)}toString(){return this._css}warnings(){return[]}};eo.exports=It;It.default=It});var io=ee((Xc,no)=>{"use strict";var Wa=jt(),Ha=Gn(),qa=to(),Va=rt(),Ze=class{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let n=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)n.push(i);else if(typeof i=="function")n.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return n}process(e,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new qa(this,e,n):new Ha(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};no.exports=Ze;Ze.default=Ze;Va.registerProcessor(Ze);Wa.registerProcessor(Ze)});var fo=ee((ed,co)=>{"use strict";var ro=zt(),oo=Ct(),Ua=qe(),za=Vt(),so=Tt(),ao=jt(),ja=_r(),$a=vt(),Ga=Gn(),Ka=Wn(),Ja=wt(),Qa=tn(),Kn=io(),Ya=nn(),lo=rt(),uo=Jt(),Za=At(),Xa=Un();function re(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Kn(t)}re.plugin=function(e,n){let i=!1;function r(...s){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...s);return l.postcssPlugin=e,l.postcssVersion=new Kn().version,l}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,l,a){return re([r(a)]).process(s,l)},r};re.stringify=Za;re.parse=Qa;re.fromJSON=ja;re.list=Ka;re.comment=t=>new oo(t);re.atRule=t=>new ro(t);re.decl=t=>new so(t);re.rule=t=>new uo(t);re.root=t=>new lo(t);re.document=t=>new ao(t);re.CssSyntaxError=za;re.Declaration=so;re.Container=Ua;re.Processor=Kn;re.Document=ao;re.Comment=oo;re.Warning=Xa;re.AtRule=ro;re.Result=Ya;re.Input=$a;re.Rule=uo;re.Root=lo;re.Node=Ja;Ga.registerPostcss(re);co.exports=re;re.default=re});function _(t,e){if(typeof window>"u")return;let n=window,i=n.__hf?.onSwallowed;if(i)try{i({label:t,error:e})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${t} swallowed:`,e)}function Ae(t){try{window.parent.postMessage(t,"*")}catch(e){_("bridge.postMessage",e)}}function xi(t){let e=n=>{let i=n.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){t.onPlay();return}if(r==="pause"){t.onPause();return}if(r==="seek"){t.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="tick"){t.onTick();return}if(r==="set-muted"){t.onSetMuted(!!i.muted);return}if(r==="set-volume"){t.onSetVolume(Math.max(0,Math.min(1,Number(i.volume??1))));return}if(r==="set-media-output-muted"){t.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){t.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="enable-pick-mode"){t.onEnablePickMode();return}if(r==="disable-pick-mode"){t.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&fs(o,s)}};return window.addEventListener("message",e),e}function fs(t,e){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 ${e}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 t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){_("bridge.flashElements.querySelector",i)}}var yn=null;function gi(t){yn=t}function ft(t,e){if(yn)try{yn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){_("runtime.analytics.site1",n)}}function yi(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){_("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){_("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){_("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){_("runtime.adapters.css.site4",c)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function Si(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?(n.totalTime(i+.001,!0),n.totalTime(i,!1)):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function bi(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){_("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){_("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){_("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){_("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Fi(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){_("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(Ai(i))i.goToAndStop(e*1e3,!1);else if(Ei(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){_("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(Ai(e)||Ei(e))&&e.pause()}catch(n){_("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function Ai(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Ei(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var wi=-1;function qt(t){if(t!==wi){wi=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){_("runtime.adapters.seek-dispatch.site1",e)}}}function Ni(){let t=null,e=0;return{name:"three",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfThreeTime=t,qt(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ci(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,qt(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Mi(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=n.source.nextElementSibling;if(o instanceof HTMLImageElement&&o.classList.contains("__render_frame__")&&o.complete&&o.naturalWidth>0)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function Ti(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){_("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){_("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){_("runtime.adapters.waapi.site3",a)}}}}function ki(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function ms(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=u){let S=Math.min(f,E);e(S);let B=Number(t.volume);if(!Number.isFinite(B))continue;let D=Math.max(0,Math.min(1,B)),v=x.at(-1);if((!v||Math.abs(v.volume-D)>1e-4||S===f)&&x.push({time:Number(S.toFixed(6)),volume:Number(D.toFixed(6))}),S===f)break}return x.some(E=>Math.abs(E.volume-c)>1e-4)?x:null}function vi(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=ms(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function _i(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=s.defaultPlaybackRate,u=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,m=s.loop,f=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,x=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(x)||x<=0)&&f!=null&&(x=Math.max(0,(f-a)/u));let F=Number.isFinite(x)&&x>0?l+x:Number.POSITIVE_INFINITY,E=Number.parseFloat(s.dataset.volume??""),S={el:s,start:l,mediaStart:a,duration:Number.isFinite(x)&&x>0?x:Number.POSITIVE_INFINITY,end:F,volume:Number.isFinite(E)?E:null,playbackRate:u,loop:m,sourceDuration:f};i.push(S),s.tagName==="VIDEO"&&r.push(S),Number.isFinite(F)&&(o=Math.max(o,F))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var Sn=new WeakMap,mt=new WeakMap,bn=new WeakSet,et=new WeakSet;function ps(t){if(et.has(t))return;et.add(t);let e=()=>et.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var An=new WeakMap;function pt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function Ri(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<=n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let w=n.sourceDuration-n.mediaStart;w>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%w)}let s=pt(t.userVolume??1),l=pt(n.volume??1),a=An.get(i),c=pt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=pt(ki(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=pt(u*s);i.volume=m,An.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(w){_("runtime.media.site1",w)}let f=.04,x=2,F=i.currentTime||0,E=Math.abs(F-r),S=r-F,B=Sn.get(i);Sn.set(i,S);let D=B===void 0,v=!D&&Math.abs(S-B)>.5,te=E>3,q=E>.5&&(D||v||te),C=i.tagName==="VIDEO"&&!i.paused,g=B!==void 0&&Math.abs(S-B)<.004,A=!1;if(!C&&!q&&!D&&g&&E>f){let w=(mt.get(i)??0)+1;mt.set(i,w),w>=x&&(A=!0,mt.set(i,0))}else E<=f&&mt.set(i,0);let N=!C&&t.forceSync&&E>.02;if(q||A||N){try{i.currentTime=r}catch(w){_("runtime.media.site2",w)}if(Math.abs(i.currentTime-r)>.5&&!bn.has(i)){bn.add(i),i.load();try{i.currentTime=r}catch(w){_("runtime.media.site3",w)}}et.delete(i)}t.playing&&i.paused&&!et.has(i)?(ps(i),i.play().catch(w=>{et.delete(i),(w&&typeof w=="object"&&"name"in w?String(w.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}Sn.delete(i),mt.delete(i),bn.delete(i),An.delete(i),i.paused||i.pause()}}var hs=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),xs=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Li(t){let e=!1,n=null,i=null,r=null,o=null;function s(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch(N){_("runtime.picker.site1",N)}}function l(g){r=g,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(g){o=g,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(g){let A=g.ownerDocument.defaultView;if(!A)return!1;let N=g;for(;N&&N!==document.body&&N!==document.documentElement;){let w=A.getComputedStyle(N);if(w.display==="none"||w.visibility==="hidden"||w.pointerEvents==="none")return!0;let M=Number.parseFloat(w.opacity);if(Number.isFinite(M)&&M<=.01)return!0;N=N.parentElement}return!1}function u(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight")||g.closest(hs)||c(g))}function m(g){return!!g?.closest(xs)}function f(g){let A=g;if(A.id)return`#${A.id}`;let N=g.getAttribute("data-composition-id");if(N)return`[data-composition-id="${N}"]`;let w=g.getAttribute("data-composition-src");if(w)return`[data-composition-src="${w}"]`;let M=g.getAttribute("data-track-index");if(M)return`[data-track-index="${M}"]`;let L=g.tagName.toLowerCase(),P=g.parentElement;if(!P)return L;let J=P.querySelectorAll(`:scope > ${L}`);if(J.length===1)return L;for(let R=0;R<J.length;R+=1)if(J[R]===g)return`${L}:nth-of-type(${R+1})`;return L}function x(g){let A=g.tagName.toLowerCase(),N=(g.textContent??"").trim().replace(/\\s+/g," "),w=(M,L)=>M.length>L?`${M.slice(0,L-1)}\\u2026`:M;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?N.length>0?w(N,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function F(g,A,N){let w=typeof N=="number"&&N>0?N:8,M=[];if(document.elementsFromPoint)M=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let J=document.elementFromPoint(g,A);M=J?[J]:[]}if(m(M[0]??null))return[];let L={},P=[];for(let J=0;J<M.length;J+=1){let R=M[J];if(!u(R))continue;let ue=`${R.tagName}::${R.id||""}::${J}`;if(!L[ue]&&(L[ue]=!0,P.push(R),P.length>=w))break}return P}function E(g){let A=g.getBoundingClientRect(),N={};for(let M=0;M<g.attributes.length;M+=1){let L=g.attributes[M];L.name.startsWith("data-")&&(N[L.name]=L.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:f(g),label:x(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:N}}function S(g,A,N){return F(g,A,N).map(E)}function B(g){if(!e)return;let N=F(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!u(N)||n===N)return;n&&n.classList.remove("__hf-pick-highlight"),n=N,N.classList.add("__hf-pick-highlight");let w=E(N);l(w),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:w})}function D(g){if(!e)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=S(g.clientX,g.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function v(g){g.key==="Escape"&&(q(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function te(){e||(e=!0,i=document.createElement("style"),i.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(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",B,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function q(){e&&(e=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",B,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function C(){window.__HF_PICKER_API={enable:te,disable:q,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(g,A,N)=>Number.isFinite(g)&&Number.isFinite(A)?S(g,A,N):[],pickAtPoint:(g,A,N)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return null;let w=S(g,A,8);if(!w.length)return null;let M=Math.max(0,Math.min(w.length-1,Number(N??0))),L=w[M]??null;return L?(a(L),t.postMessage({source:"hf-preview",type:"element-picked",elementInfo:L}),q(),L):null},pickManyAtPoint:(g,A,N)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return[];let w=S(g,A,8);if(!w.length)return[];let M=[],L=Array.isArray(N)?N:[0];for(let P of L){let J=Math.max(0,Math.min(w.length-1,Math.floor(Number(P)))),R=w[J];if(!R)continue;M.some(ye=>ye.selector===R.selector&&ye.tagName===R.tagName)||M.push(R)}return M.length?(a(M[0]??null),t.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:M}),q(),M):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:te,disablePickMode:q,installPickerApi:C}}function tt(t,e){let n=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(t)&&t>0?t:0;return Math.floor(i*n+1e-9)/n}function ht(t,e,n){let i=t?.[e];return typeof i=="function"?Number(i.call(t))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&_("runtime.player.nonConformantNum",{prop:e,actual:typeof i}),n)}function ve(t,e){let n=t?.[e];if(typeof n=="function"){n.call(t);return}n!==void 0&&_("runtime.player.nonConformantVoid",{method:e,actual:typeof n})}function xt(t,e,n){if(t){for(let i of Object.values(t))if(!(!i||i===e))try{n(i)}catch(r){_("runtime.player.site1",r)}}}function Di(t,e,n){let i=tt(e,n);return ve(t,"pause"),typeof t.totalTime=="function"?t.totalTime(i,!1):typeof t.seek=="function"&&t.seek(i,!1),i}function gs(t,e,n,i){let r=[];xt(t,e,o=>{ve(o,"play"),r.push(o)});try{return Di(e,n,i)}finally{for(let o of r)try{ve(o,"pause")}catch(s){_("runtime.player.site2",s)}}}function ys(t,e){xt(t,e,n=>{ve(n,"play")})}function Bi(t){return{_timeline:null,play:()=>{let e=t.getTimeline();if(!e||t.getIsPlaying())return;let n=Math.max(0,Number(t.getSafeDuration?.()??ht(e,"duration",0))||0);n>0&&Math.max(0,ht(e,"time",0))>=n&&(ve(e,"pause"),typeof e.seek=="function"&&e.seek(0,!1),t.onDeterministicSeek(0),t.setIsPlaying(!1),t.onSyncMedia(0,!1),t.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(t.getPlaybackRate()),ve(e,"play"),xt(t.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play")}),t.onDeterministicPlay(),t.setIsPlaying(!0),t.onShowNativeVideos(),t.onStatePost(!0)},pause:()=>{let e=t.getTimeline();if(!e)return;ve(e,"pause"),xt(t.getTimelineRegistry?.(),e,i=>{ve(i,"pause")});let n=Math.max(0,ht(e,"time",0));t.onDeterministicSeek(n),t.onDeterministicPause(),t.setIsPlaying(!1),t.onSyncMedia(n,!1),t.onRenderFrameSeek(n),t.onStatePost(!0)},seek:(e,n)=>{let i=t.getTimeline();if(!i)return;let r=Math.max(0,Number(e)||0),o=t.getIsPlaying(),s=gs(t.getTimelineRegistry?.(),i,r,t.getCanonicalFps());t.onDeterministicSeek(s),n?.keepPlaying&&o?(typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play"),xt(t.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(t.getPlaybackRate()),ve(l,"play")}),t.onDeterministicPlay(),t.onShowNativeVideos(),t.onSyncMedia(s,!0)):(t.setIsPlaying(!1),t.onSyncMedia(s,!1)),t.onRenderFrameSeek(s),t.onStatePost(!0)},renderSeek:e=>{let n=t.getTimeline(),i=t.getCanonicalFps(),r=n?(ys(t.getTimelineRegistry?.(),n),Di(n,e,i)):tt(Math.max(0,Number(e)||0),i);t.onDeterministicSeek(r),t.setIsPlaying(!1),t.onSyncMedia(r,!1),t.onRenderFrameSeek(r),t.onStatePost(!0)},getTime:()=>ht(t.getTimeline(),"time",0),getDuration:()=>ht(t.getTimeline(),"duration",0),isPlaying:()=>t.getIsPlaying(),setPlaybackRate:e=>t.setPlaybackRate(e),getPlaybackRate:()=>t.getPlaybackRate()}}function Ii(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,nativeVisualWatchdogTick:0,transportClock:null,transportRafId:null}}var Ss="data-hf-authored-duration",bs="data-hf-authored-end";function Je(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function As(t){return Je(t.getAttribute("data-duration"))}function Es(t){return Je(t.getAttribute("data-end"))}function Fs(t){return Je(t.getAttribute(Ss))}function ws(t){return Je(t.getAttribute(bs))}function Ns(t){let e=(t??"").trim();if(!e)return null;let n=Je(e);if(n!=null)return{kind:"absolute",value:n};let i=e.match(/^([A-Za-z0-9_.:-]+)(?:\\s*([+-])\\s*([0-9]*\\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",s=i[3]??"0",l=Number.parseFloat(s),a=Number.isFinite(l)?Math.max(0,l):0,c=o==="-"?-a:a;return{kind:"reference",refId:r,offset:c}}function Qe(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=u=>{let m=document.getElementById(u);return m||(document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`)??null)},l=u=>{let m=r.get(u);if(m!==void 0)return m;let f=null,x=As(u)??(n?Fs(u):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let F=Es(u)??(n?ws(u):null);if(F!=null){let E=c(u,0),S=F-E;Number.isFinite(S)&&S>0&&(f=S)}}if((f==null||f<=0)&&u instanceof HTMLMediaElement){let F=Je(u.getAttribute("data-playback-start"))??Je(u.getAttribute("data-media-start"))??0;Number.isFinite(u.duration)&&u.duration>F&&(f=u.duration-F)}if(f==null||f<=0){let F=u.getAttribute("data-composition-id");if(F){let E=e[F]??null;if(E&&typeof E.duration=="function")try{let S=Number(E.duration());Number.isFinite(S)&&S>0&&(f=S)}catch(S){_("runtime.startResolver.site1",S)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(u,f),f):(r.set(u,null),null)},a=(u,m)=>{if(u.hasAttribute("data-composition-id")){let x=u.parentElement?.closest("[data-composition-id]");return x?c(x,m):0}let f=u.closest("[data-composition-id]");return f?c(f,m):0},c=(u,m)=>{let f=i.get(u);if(f!==void 0)return f??m;if(o.has(u))return m;o.add(u);try{let x=Ns(u.getAttribute("data-start"));if(!x){if(u.hasAttribute("data-composition-id")){let D=u.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id"))){let v=c(D,m);return i.set(u,v),v}}return i.set(u,m),m}if(x.kind==="absolute"){let D=Math.max(0,x.value),v=Math.max(0,a(u,m)+D);return i.set(u,v),v}let F=s(x.refId);if(!F)return i.set(u,m),m;let E=c(F,0),S=l(F);if(S==null||S<=0){let D=Math.max(0,E+x.offset);return i.set(u,D),D}let B=Math.max(0,E+S+x.offset);return i.set(u,B),B}finally{o.delete(u)}};return{resolveStartForElement:(u,m=0)=>c(u,Math.max(0,m)),resolveDurationForElement:u=>l(u)}}var Cs="data-hf-authored-duration",Ms="data-hf-authored-end";function Ee(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function En(t){return Ee(t.getAttribute("data-duration"))??Ee(t.getAttribute(Cs))}function Oi(t){return Ee(t.getAttribute("data-end"))??Ee(t.getAttribute(Ms))}function Fn(...t){let e=t.filter(n=>Number.isFinite(n??null));return e.length===0?null:Math.max(...e)}var Pi={composition:0,video:1,image:2,element:3,audio:4};function Ts(t){if(t.length===0)return;let e=new Map;for(let s of t){let l=e.get(s.track)??new Set;l.add(s.kind),e.set(s.track,l)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,l)=>s-l);for(let s of o){let l=e.get(s);if(l.size===1)r.set(`${s}:${[...l][0]}`,i++);else{let a=[...l].sort((c,u)=>(Pi[c]??99)-(Pi[u]??99));for(let c of a)r.set(`${s}:${c}`,i++)}}for(let s of t){let l=`${s.track}:${s.kind}`,a=r.get(l);a!=null&&(s.track=a)}}function yt(t){let e=String(t??"").trim();if(!e)return null;let n=e.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Wi(t){let e=t.getAttribute("src")??t.getAttribute("data-src");if(e)return yt(e);let n=t.getAttribute("data-composition-src");if(n)return yt(n);let i=t.querySelector("img[src], video[src], audio[src], source[src]");return i?yt(i.getAttribute("src")):null}function ks(t){let e=t.className;return typeof e!="string"?null:e.split(/\\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function vs(t){if(!t)return null;try{return new URL(t,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return t.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function _s(t){let e=t.textContent?.replace(/\\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function gt(t){let e=t.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return e?e.replace(/\\b\\w/g,n=>n.toUpperCase()):t}function Rs(t,e,n){let i=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=t.getAttribute("data-composition-id");if(r)return gt(r);let o=t.id;if(o)return gt(o);let s=ks(t);if(s)return gt(s);let l=vs(Wi(t));if(l)return gt(l);let a=_s(t);return a||`${gt(e)} ${n+1}`}function Hi(t){let n=window.__timelines??{},i=Qe({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=H=>{if(!H)return null;let k=n[H]??null;if(!k||typeof k.duration!="function")return null;try{let O=Number(k.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=H=>{let k=Ee(H.getAttribute("data-duration"));if(k!=null&&k>0)return k;let O=Ee(H.getAttribute("data-playback-start"))??Ee(H.getAttribute("data-media-start"))??0;return Number.isFinite(H.duration)&&H.duration>O?Math.max(0,H.duration-O):null},s=()=>{let H=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(H.length===0)return null;let k=0;for(let O of H){let ie=O.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(ie))continue;let ne=o(O);ne==null||ne<=0||(k=Math.max(k,Math.max(0,ie)+ne))}return k>0?k:null},l=H=>{let k=H.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},a=(H,k)=>{let O=[],ie=null,ne=null,z=null,V=H.parentElement;for(;V;){let $=V.getAttribute("data-composition-id");$&&(O.push($),!z&&V!==k&&(z=$),ie==null&&(ie=i.resolveStartForElement(V,0)),ne==null&&(ne=Ee(V.getAttribute("data-duration"))??r($)??null)),V=V.parentElement}return{parentCompositionId:z,compositionAncestors:O.reverse(),inheritedStart:ie,inheritedDuration:ne}},c=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),m=c?.getAttribute("data-composition-id")??null,f=c?i.resolveStartForElement(c,0):0,x=s(),F=x!=null?Math.max(0,x-Math.max(0,f)):null,E=r(m),S=En(c??document.body),B=Fn(...u.filter(H=>H!==c).map(H=>{let k=i.resolveStartForElement(H,0),O=i.resolveDurationForElement(H)??r(H.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||O==null||O<=0?null:Math.max(0,k)+O})),D=B!=null?Math.max(0,B-Math.max(0,f)):null,v=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,te=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,q=typeof F=="number"&&Number.isFinite(F)&&F>0?F:null,C=typeof D=="number"&&Number.isFinite(D)&&D>0?D:null,g=Fn(q,C),A=v!=null&&g!=null&&v>g+1,w=te??(A?g:Fn(v,q,C))??null,L=(w!=null?f+w:null)??(typeof x=="number"&&Number.isFinite(x)&&x>0?x:null),P=(H,k)=>!Number.isFinite(k)||k<=0?0:L==null||!Number.isFinite(L)?k:!Number.isFinite(H)||H>=L?0:Math.max(0,Math.min(k,L-H)),J=[],R=[],ue=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ye=0;for(let H=0;H<ue.length;H+=1){let k=ue[H];if(k===c||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let O=a(k,c),ie=i.resolveStartForElement(k,O.inheritedStart??0),ne=k.getAttribute("data-composition-id"),z=En(k);if((z==null||z<=0)&&ne&&ne!==m&&(z=r(ne)),(z==null||z<=0)&&k instanceof HTMLMediaElement){let we=Ee(k.getAttribute("data-playback-start"))??Ee(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(z=Math.max(0,k.duration-we))}if(z==null||z<=0){let we=O.inheritedDuration;if(we!=null&&we>0){let Le=(O.inheritedStart??0)+we;z=Math.max(0,Le-ie)}}if(z==null||z<=0||(z=P(ie,z),z<=0))continue;let V=ie+z;ye=Math.max(ye,V);let $=k.tagName.toLowerCase(),Ce=ne&&ne!==m?"composition":$==="video"?"video":$==="audio"?"audio":$==="img"?"image":"element";J.push({id:k.id||ne||null,label:Rs(k,Ce,J.length),start:ie,duration:z,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(H),10)||0,kind:Ce,tagName:$,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:yt(k.getAttribute("data-composition-src")),assetUrl:Wi(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Ee(k.getAttribute("data-timeline-priority"))})}let G=new Set(J.map(H=>H.id)),U=c?.getAttribute("data-composition-id")??null,W=U?n[U]??null:null;if(W&&c){let H=W;if(typeof H.getChildren=="function")try{let k=H.getChildren(!0,!0,!1)??[],O=new Map;for(let z of c.children){let V=z;if(!V.id)continue;let $=V.tagName.toLowerCase();$==="script"||$==="style"||$==="link"||O.set(V,{id:V.id,start:1/0,end:-1/0})}let ie=z=>{let V=z;for(;V;){if(O.has(V))return V;if(V===c)return null;V=V.parentElement}return null};for(let z of k){if(typeof z.targets!="function"||typeof z.startTime!="function"||typeof z.duration!="function")continue;let V=z.startTime(),$=z.parent;for(;$&&$!==W&&typeof $.startTime=="function";)V+=$.startTime(),$=$.parent;let Ce=V+z.duration();if(!(!Number.isFinite(V)||!Number.isFinite(Ce)))for(let we of z.targets()){if(!(we instanceof Element))continue;let $e=ie(we);if(!$e)continue;let Le=O.get($e);Le&&(Le.start=Math.min(Le.start,V),Le.end=Math.max(Le.end,Ce))}}let ne=J.length>0?Math.max(...J.map(z=>z.track))+1:0;for(let[z,V]of O){if(V.start===1/0||V.end===-1/0)continue;let $=z;if(G.has($.id))continue;let Ce=Math.max(0,V.end-V.start);if(Ce<=0)continue;let we=P(V.start,Ce);we<=0||(ye=Math.max(ye,V.start+we),J.push({id:$.id,label:$.getAttribute("data-timeline-label")??$.getAttribute("data-label")??$.getAttribute("aria-label")??$.id,start:V.start,duration:we,track:Number.parseInt($.getAttribute("data-track-index")??$.getAttribute("data-track")??"",10)||ne,kind:"element",tagName:$.tagName.toLowerCase(),compositionId:$.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:$.getAttribute("data-timeline-role"),timelineLabel:$.getAttribute("data-timeline-label"),timelineGroup:$.getAttribute("data-timeline-group"),timelinePriority:Ee($.getAttribute("data-timeline-priority"))}),G.add($.id))}}catch(k){_("runtime.timeline.site1",k)}}if(c&&w!=null&&w>0){let H=J.length>0?Math.max(...J.map(k=>k.track))+1:0;for(let k of c.children){let O=k;if(!O.id||G.has(O.id))continue;let ie=O.getAttribute("data-timeline-role");if(ie!=="overlay"&&ie!=="persistent-overlay")continue;let ne=O.tagName.toLowerCase();if(ne==="script"||ne==="style"||ne==="link"||ne==="meta"||window.getComputedStyle(O).display==="none")continue;let V=P(0,w);V<=0||(ye=Math.max(ye,V),J.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:V,track:Number.parseInt(O.getAttribute("data-track-index")??O.getAttribute("data-track")??"",10)||H,kind:"element",tagName:ne,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:ie,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ee(O.getAttribute("data-timeline-priority"))}),G.add(O.id))}}Ts(J);for(let H of u){if(H===c)continue;let k=H.getAttribute("data-composition-id");if(!k||!l(k))continue;let O=i.resolveStartForElement(H,0),ie=En(H);if((ie==null||ie<=0)&&Oi(H)!=null){let $=Oi(H);ie=Math.max(0,$-O)}let ne=r(k),z=ie&&ie>0?ie:ne;if(z==null||z<=0)continue;let V=P(O,z);V<=0||R.push({id:k,label:H.getAttribute("data-label")??k,start:O,duration:V,thumbnailUrl:yt(H.getAttribute("data-thumbnail-url")),avatarName:null})}let Z=Math.max(1,ye||1,w??0);return{source:"hf-preview",type:"timeline",durationInFrames:A&&te==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(Z*Math.max(1,t.canonicalFps))),clips:J,scenes:R,compositionWidth:Ee(c?.getAttribute("data-width"))??1920,compositionHeight:Ee(c?.getAttribute("data-height"))??1080}}var le=ds(fo(),1),mo=le.default,td=le.default.stringify,nd=le.default.fromJSON,id=le.default.plugin,rd=le.default.parse,od=le.default.list,sd=le.default.document,ad=le.default.comment,ld=le.default.atRule,ud=le.default.rule,cd=le.default.decl,dd=le.default.root,fd=le.default.CssSyntaxError,md=le.default.Declaration,pd=le.default.Container,hd=le.default.Processor,xd=le.default.Document,gd=le.default.Comment,yd=le.default.Warning,Sd=le.default.AtRule,bd=le.default.Result,Ad=le.default.Input,Ed=le.default.Rule,Fd=le.default.Root,wd=le.default.Node;var Jn="data-hf-authored-id";function Qn(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Yn(t){return t.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function el(t){return t&&t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function po(t){let e=t.trim();return e?Array.from(new Set([e,el(e)])).filter(Boolean):[]}function tl(t){return!!t&&/[\\w-]/.test(t)}function nl(t,e,n){let i=po(e).sort((l,a)=>a.length-l.length);if(i.length===0)return t;let r="",o=0,s=null;for(let l=0;l<t.length;l+=1){let a=t[l],c=l>0?t[l-1]:"";if(s){r+=a,a===s&&c!=="\\\\"&&(s=null);continue}if(a===\'"\'||a==="\'"){s=a,r+=a;continue}if(a==="["){o+=1,r+=a;continue}if(a==="]"){o=Math.max(0,o-1),r+=a;continue}if(a==="#"&&o===0){let u=i.find(m=>t.startsWith(m,l+1));if(u){let m=t[l+1+u.length];if(!tl(m)){r+=n,l+=u.length;continue}}}r+=a}return r}function il(t,e){let n=e?.trim();return n?nl(t,n,`[${Jn}="${Yn(n)}"]`):t}function rl(t,e,n,i,r){let o=il(t,i),s=ol(o,e,n),l=s.trim();if(!l||/^(html|body|:root|\\*)$/i.test(l))return t;let a=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${Qn(n)}\\\\1\\\\s*\\\\]`,"g");if(a.test(l))return s.replace(a,e);let c=s.match(/^\\s*/)?.[0]??"",u=s.match(/\\s*$/)?.[0]??"";if(r){let m=i?`[${Jn}="${Yn(i)}"]`:null;if(m&&l.startsWith(m)){let f=l.slice(m.length);return`${c}${e}${m}${f}${u}`}}return`${c}${e} ${l}${u}`}function ol(t,e,n){let i=Qn(n),r=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return t.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var sl=new Set(["keyframes","-webkit-keyframes","font-face"]);function al(t){return t?.type==="atrule"}function ll(t){let e=t.parent;for(;e;){if(al(e)&&sl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Zn(t,e,n,i,r){let o=e.trim();if(!t||!o)return t;let s=n||`[data-composition-id="${Yn(o)}"]`,l=mo.parse(t);return l.walkRules(a=>{ll(a)||(a.selectors=a.selectors.map(c=>rl(c,s,o,i,r?.compoundAuthoredRoot)))}),l.toResult({map:!1}).css}function ho(t,e,n="[HyperFrames] composition script error:",i,r=e,o){let s=JSON.stringify(e),l=JSON.stringify(r),a=JSON.stringify(n),c=Qn(e),u=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${c}"|\'${c}\')\\s*\\]`),x=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),F=JSON.stringify(po(o?.trim()||""));return`(function(){\n var __hfCompId = ${s};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${a};\n var __hfAuthoredRootId = ${u};\n var __hfAuthoredRootAttr = ${JSON.stringify(Jn)};\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 = ${F};\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 return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, target);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, target);\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 return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\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${t.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})();`}function xo(){if(typeof document>"u")return{};let t=Xn(document.documentElement),e=ul();return{...t,...e}}function Xn(t){if(!t)return{};let e=t.getAttribute("data-composition-variables");if(!e)return{};let n;try{n=JSON.parse(e)}catch{return{}}if(!Array.isArray(n))return{};let i={};for(let r of n){if(!r||typeof r!="object")continue;let o=r;typeof o.id!="string"||!("default"in o)||(i[o.id]=o.default)}return i}function ul(){if(typeof window>"u")return{};let t=window.__hfVariables;return!t||typeof t!="object"||Array.isArray(t)?{}:t}var cl=8e3,dl=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/;function fl(t,e){return`${t}__hf${e}`}var ml=t=>new Promise(e=>{let n=!1,i=Date.now(),r=null,o=s=>{n||(n=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};t.addEventListener("load",()=>o("load"),{once:!0}),t.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),cl)});function ei(t){for(;t.firstChild;)t.removeChild(t.firstChild);t.textContent=""}var pl=["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 hl(t){let e=document.importNode(t,!0),n=e.getAttribute("id")?.trim();for(let o of pl)e.removeAttribute(o);n&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",n)),e.setAttribute("data-hf-inner-root","true");let i=e.getAttribute("data-width"),r=e.getAttribute("data-height");return e.style.width=i?`${i}px`:"100%",e.style.height=r?`${r}px`:"100%",e}function go(t,e){let n=t.trim();if(!n)return t;try{return dl.test(n)?new URL(n,document.baseURI).toString():e?new URL(n,e).toString():new URL(n,document.baseURI).toString()}catch{return t}}function xl(t){let e=t.getAttribute("data-variable-values");if(!e)return{};let n;try{n=JSON.parse(e)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function rn(t){let e=(t.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(t.getAttribute("data-hf-original-composition-id")||e||"").trim()||null,runtimeCompositionId:e}}function gl(t){let e=new Map;for(let n of t){let i=rn(n).authoredCompositionId||"";i&&e.set(i,(e.get(i)||0)+1)}return e}function yo(t){let e=rn(t).authoredCompositionId;return e?!!document.querySelector(`template#${CSS.escape(e)}-template`):!1}function yl(t){return!!t.querySelector(\'[data-hf-inner-root="true"]\')}function Sl(t){return t.hasAttribute("data-composition-src")?!0:yo(t)?t.children.length===0||t.hasAttribute("data-hf-original-composition-id")?!0:yl(t):!1}function ni(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(e=>e.hasAttribute("data-composition-src")?!0:yo(e))}function So(){let t=window.__hfVariablesByComp;if(!t)return;let e=new Set(ni().map(n=>rn(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(t))e.has(n)||delete t[n]}function bo(t,e=gl(t)){let n=new Map,i=new Map;for(let r of t){let{authoredCompositionId:o,runtimeCompositionId:s}=rn(r),l=Sl(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:s});continue}let a=(e.get(o)||0)>1,c=s||o;if(l){let u=a?(n.get(o)||0)+1:0;a&&n.set(o,u),c=a?fl(o,u):o,a?r.setAttribute("data-hf-original-composition-id",o):r.removeAttribute("data-hf-original-composition-id"),r.setAttribute("data-composition-id",c),s&&s!==c&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[s]}i.set(r,{authoredCompositionId:o,runtimeCompositionId:c})}return i}async function ti(t){let e=null;t.authoredCompositionId&&(e=Array.from(t.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x.getAttribute("data-composition-id")===t.authoredCompositionId)??null);let n=e??t.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||t.authoredCompositionId||null,r=t.runtimeCompositionId||i||null,o=e?.getAttribute("id")?.trim()||null,s=r?`[data-composition-id="${CSS.escape(r)}"]`:void 0;if(t.headLinks)for(let f of t.headLinks){let x=f.getAttribute("href")||"";x&&(document.head.querySelector(`link[href="${CSS.escape(x)}"]`)||document.head.appendChild(f.cloneNode(!0)))}if(t.headStyles)for(let f of t.headStyles){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=Zn(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let l=Array.from(n.querySelectorAll("style"));for(let f of l){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=Zn(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let a=[];if(t.headScripts)for(let f of t.headScripts){let x=f.getAttribute("type")?.trim()??"",F=f.getAttribute("src")?.trim()??"";if(F){let E=go(F,t.compositionUrl);a.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&a.push({kind:"inline",content:E,type:x,scopeCompositionId:i})}}let c=Array.from(n.querySelectorAll("script")),u=[...a];for(let f of c){let x=f.getAttribute("type")?.trim()??"",F=f.getAttribute("src")?.trim()??"";if(F){let E=go(F,t.compositionUrl);u.push({kind:"external",src:E,type:x})}else{let E=f.textContent?.trim()??"";E&&u.push({kind:"inline",content:E,type:x,scopeCompositionId:i})}f.parentNode?.removeChild(f)}let m=Array.from(n.querySelectorAll("style"));for(let f of m)f.parentNode?.removeChild(f);if(e){let f=e.getAttribute("data-width"),x=e.getAttribute("data-height"),F=t.parseDimensionPx(f),E=t.parseDimensionPx(x);f&&t.host.setAttribute("data-width",f),x&&t.host.setAttribute("data-height",x),F&&t.host instanceof HTMLElement&&(t.host.style.width=F),E&&t.host instanceof HTMLElement&&(t.host.style.height=E),e.hasAttribute("data-timeline-locked")&&t.host.setAttribute("data-timeline-locked",""),t.host.appendChild(hl(e))}else t.hasTemplate?t.host.appendChild(document.importNode(n,!0)):t.host.innerHTML=t.fallbackBodyInnerHtml;if(r){let f={...t.declaredVariableDefaults??{},...xl(t.host)};Object.keys(f).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[r]=f):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[r]}for(let f of u){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=ho(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",s,r||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),t.injectedScripts.push(x),f.kind==="external"){let F=await ml(x);F.status!=="load"&&t.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:t.authoredCompositionId,runtimeCompositionId:t.runtimeCompositionId,hostCompositionSrc:t.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:F.status,elapsedMs:F.elapsedMs}})}}}async function Ao(t){let e=ni();if(So(),e.length===0)return;let n=bo(e),i=e.filter(r=>{if(r.hasAttribute("data-composition-src")||r.children.length>0)return!1;let o=n.get(r)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(i.length!==0)for(let r of i){let o=n.get(r),s=o?.authoredCompositionId;if(!s)continue;let l=document.querySelector(`template#${CSS.escape(s)}-template`);ei(r),await ti({host:r,authoredCompositionId:s,runtimeCompositionId:o?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic})}}async function Eo(t){let e=ni();if(So(),e.length===0)return;let n=bo(e),i=e.filter(r=>r.hasAttribute("data-composition-src"));i.length!==0&&await Promise.all(i.map(async r=>{let o=r.getAttribute("data-composition-src");if(!o)return;let s=n.get(r),l=s?.authoredCompositionId||null,a=s?.runtimeCompositionId||l||null,c=null;try{c=new URL(o,document.baseURI)}catch{c=null}ei(r);try{let u=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(u){await ti({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:u.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),F=new DOMParser().parseFromString(f,"text/html"),E=(l?F.querySelector(`template#${CSS.escape(l)}-template`):null)??F.querySelector("template"),S=E?E.content:F.body,B=E?void 0:Array.from(F.head.querySelectorAll("style")),D=E?void 0:Array.from(F.head.querySelectorAll("script")),v=E?void 0:Array.from(F.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await ti({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:S,hasTemplate:!!E,fallbackBodyInnerHtml:F.body.innerHTML,compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,headStyles:B,headScripts:D,headLinks:v,declaredVariableDefaults:Xn(F.documentElement),onDiagnostic:t.onDiagnostic})}catch(u){t.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,errorMessage:u instanceof Error?u.message:"unknown_error"}}),ei(r)}}))}function bl(t){return t instanceof HTMLElement?t.dataset.captionWrapper!=="true"?t:t.querySelector(":scope > span")??null:null}function Al(){let t=[],e=document.querySelectorAll(".caption-group");for(let n of e)for(let i of n.children){if(!(i instanceof HTMLElement))continue;let r=i.dataset.captionWrapper==="true"?i.querySelector(":scope > span"):i.tagName==="SPAN"?i:null;r&&t.push(r)}return t}function El(t){let e=t.parentElement;if(e?.dataset.captionWrapper==="true")return e;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",t.parentNode?.insertBefore(n,t),n.appendChild(t),n}function ii(){let t=window.gsap;t&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e)||e.length===0)return;let n=Al();for(let i of e){let r=null;if(i.wordId&&(r=bl(document.getElementById(i.wordId))),!r&&i.wordIndex!==void 0&&(r=n[i.wordIndex]??null),!r)continue;let o={},s={};if(i.x!==void 0&&(o.x=i.x),i.y!==void 0&&(o.y=i.y),i.scale!==void 0&&(o.scale=i.scale),i.rotation!==void 0&&(o.rotation=i.rotation),i.opacity!==void 0&&(s.opacity=i.opacity),i.fontSize!==void 0&&(s.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(s.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(s.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let a=t.getTweensOf(r).filter(u=>u.vars.color!==void 0).sort((u,m)=>u.startTime()-m.startTime()),c=a.length>0?String(a[0].vars.color):"";for(let u of a)String(u.vars.color)===c?i.dimColor&&(u.vars.color=i.dimColor):i.activeColor&&(u.vars.color=i.activeColor);i.dimColor&&t.set(r,{color:i.dimColor})}if(Object.keys(s).length>0&&t.set(r,s),Object.keys(o).length>0){let l=El(r);t.set(l,o)}}}).catch(()=>{})}var on=class{constructor(e){ge(this,"_baseTime",0);ge(this,"_playStartMs",null);ge(this,"_rate",1);ge(this,"_duration",1/0);ge(this,"_nowMs");ge(this,"_audioSource",null);this._baseTime=e?.initialTime??0,this._rate=e?.rate??1,this._duration=e?.duration??1/0,this._nowMs=e?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let i=null;if("currentTimeSeconds"in this._audioSource)i=this._audioSource.currentTimeSeconds;else{let{el:r,compositionStart:o,mediaStart:s}=this._audioSource;!r.paused&&Number.isFinite(r.currentTime)&&(i=(r.currentTime-s)/(r.playbackRate>0?r.playbackRate:1)*this._rate+o)}if(i!==null)return Number.isFinite(this._duration)&&i>=this._duration?this._duration:Math.max(0,i)}let e=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+e*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(e){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(e,this._duration)):Math.max(0,e);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(e){let n=Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(e){this._duration=Number.isFinite(e)&&e>0?e:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(e){this._audioSource=e}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:e}=this._audioSource;if(!e.paused&&Number.isFinite(e.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 Fo(t){return!Number.isFinite(t)||t<=0?1:t}var sn=class{constructor(){ge(this,"_ctx",null);ge(this,"_bufferCache",new Map);ge(this,"_failedSrcs",new Set);ge(this,"_activeSources",[]);ge(this,"_masterGain",null);ge(this,"_rateAnchorCtx",0);ge(this,"_rateAnchorComp",0);ge(this,"_rate",1);ge(this,"_paused",!0);ge(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(e){let n=e.currentSrc||e.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;try{let i=await fetch(n);if(!i.ok)return this._failedSrcs.add(n),_("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;let r=await i.arrayBuffer(),o=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,o),o}catch(i){return this._failedSrcs.add(n),_("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(e,n,i,r,o,s,l,a=1){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=Fo(a),u=this._ctx.createBufferSource();u.buffer=n,u.playbackRate.value=c;let m=this._ctx.createGain();m.gain.value=s,u.connect(m),m.connect(this._masterGain);let f=o-i,x=this._ctx.currentTime;if(this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,f>=0)u.start(0,f+r);else{let S=-f/c;u.start(x+S,r)}let F=e.muted;e.muted=!0;let E={el:e,sourceNode:u,gainNode:m,compositionStart:i,mediaStart:r,scheduledAt:x,priorMuted:F};return this._activeSources.push(E),this._paused=!1,E}catch(c){return _("webAudioTransport.schedule",c),null}}setRate(e){let n=Fo(e);if(n!==this._rate){this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let i of this._activeSources)try{i.sourceNode.playbackRate.value=n}catch(r){_("webAudioTransport.setRate",r)}}}stopAll(){for(let e of this._activeSources){try{e.sourceNode.stop(),e.sourceNode.disconnect(),e.gainNode.disconnect()}catch{}e.el.muted=e.priorMuted}this._activeSources=[],this._paused=!0}setVolume(e){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,e)))}setElementVolume(e,n){let i=Math.max(0,Math.min(1,n));for(let r of this._activeSources)if(r.el===e)try{r.gainNode.gain.value=i}catch(o){_("webAudioTransport.setElementVolume",o)}}setMuted(e){this._masterGain&&(this._masterGain.gain.value=e?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var wo="data-hf-authored-duration",No="data-hf-authored-end";function Co(){let t=Ii(),e=null,n=null,i=[],r=new Set,o=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){_("runtime.init.site1",d)}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"),window.__timelines=window.__timelines||{};let s=d=>{i.push(d)},l=(d,p,h)=>{let b=h??`${d}:${JSON.stringify(p)}`;r.has(b)||(r.add(b),Ae({source:"hf-preview",type:"diagnostic",code:d,details:p}))},a=d=>{let p={scale:1,focusX:960,focusY:540},h=[],b=[],y={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:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>h,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:()=>b,getRenderState:()=>({...y,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},c=1/60,u=.75,m=2,f=.05,x=100,F=240,E=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??"")}},S=d=>{let p=d.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},B=d=>{if(d==null||d.trim()==="")return null;let p=Number.parseFloat(d);return!Number.isFinite(p)||p<=0?null:`${p}px`},D=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.length===0?null:p.find(h=>!h.parentElement?.closest("[data-composition-id]"))??p[0]??null},v=()=>{let d=D();if(!d)return;let p=B(d.getAttribute("data-width")),h=B(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h),p&&d.style.setProperty("--comp-width",p),h&&d.style.setProperty("--comp-height",h)},te=()=>{let d=D(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(h=>h.hasAttribute("data-duration")||h.hasAttribute("data-end"));for(let h of p){if(d&&h===d)continue;let b=h.getAttribute("data-duration"),y=h.getAttribute("data-end");b!=null&&!h.hasAttribute(wo)&&h.setAttribute(wo,b),y!=null&&!h.hasAttribute(No)&&h.setAttribute(No,y),h.removeAttribute("data-duration"),h.removeAttribute("data-end")}},q=()=>{let d=D();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let p=B(d.getAttribute("data-width")),h=B(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h);let b=Array.from(d.children);for(let y of b){let T=y.tagName.toLowerCase();if(T==="script"||T==="style"||T==="link"||T==="meta"||!y.hasAttribute("data-start"))continue;let X=(y.style.top==="0px"||y.style.top==="0")&&(y.style.left==="0px"||y.style.left==="0")&&y.style.width==="100%"&&y.style.height==="100%",j=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(y.style.transform);if(X&&j&&!y.hasAttribute("data-width")&&!y.hasAttribute("data-height")){let Ke=y.style.top,me=y.style.left,dt=y.style.width,se=y.style.height;y.style.top="",y.style.left="",y.style.width="",y.style.height="";let Q=window.getComputedStyle(y);Q.top!=="auto"||Q.bottom!=="auto"||Q.left!=="auto"||Q.right!=="auto"||Q.width!=="0px"||Q.height!=="0px"||(y.style.top=Ke,y.style.left=me,y.style.width=dt,y.style.height=se)}let Y=window.getComputedStyle(y),oe=Y.position;if(oe!=="absolute"&&oe!=="fixed"&&(y.style.position="absolute"),!!y.style.top||!!y.style.bottom||Y.top!=="auto"||Y.bottom!=="auto"||(y.style.top="0"),!!y.style.left||!!y.style.right||Y.left!=="auto"||Y.right!=="auto"||(y.style.left="0"),T!=="audio"){let Ke=B(y.getAttribute("data-width")),me=B(y.getAttribute("data-height")),dt=Y.width!=="0px"&&Y.width!=="auto",se=Y.height!=="0px"&&Y.height!=="auto";Ke?!y.style.width&&!dt&&(y.style.width=Ke):!y.style.width&&Y.width==="0px"&&(y.style.width="100%"),me?!y.style.height&&!se&&(y.style.height=me):!y.style.height&&Y.height==="0px"&&(y.style.height="100%")}}},C=(d,p=0,h)=>Qe({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,p),g=(d,p)=>Qe({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),A=(d,p=0)=>!d.hasAttribute("data-hf-auto-start")&&d.hasAttribute("data-start")?Math.max(0,Number(d.getAttribute("data-start")??0)||0):C(d,p),N=!!document.querySelector("[data-composition-src]"),w=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of d){let h=p.getAttribute("data-composition-id");if(h&&p.children.length===0&&document.querySelector(`template#${CSS.escape(h)}-template`)){w=!0;break}}}let M=!N&&!w,L=d=>{if(!d||typeof d.duration!="function")return null;try{let p=Number(d.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},P=d=>typeof d=="number"&&Number.isFinite(d)&&d>c,J=d=>{let p=Number(d.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let h=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),b=Number.isFinite(h)?Math.max(0,h):0;return Number.isFinite(d.duration)&&d.duration>b?Math.max(0,d.duration-b):null},R=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let p=0;for(let h of d){let b=A(h,0);if(!Number.isFinite(b))continue;let y=J(h);y==null||y<=c||(p=Math.max(p,Math.max(0,b)+y))}return p>c?p:null},ue=()=>{let d=D();if(!d)return null;let p=window.__timelines??{},h=Qe({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),b=0,y=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let T of y){if(!(T instanceof Element)||T.parentElement?.closest("[data-composition-id]")!==d)continue;let j=h.resolveStartForElement(T,0),Y=h.resolveDurationForElement(T);!Number.isFinite(j)||Y==null||Y<=0||(b=Math.max(b,Math.max(0,j)+Y))}return b>c?b:null},ye=()=>{let d=R();return typeof d!="number"||!Number.isFinite(d)||d<=c?null:d},G=d=>P(d)?Math.max(c,d*u):c,U=(d,p=0)=>{let h=L(d),b=ye(),y=ue(),T=Math.max(b??0,y??0),X=Number.isFinite(p)&&p>c?p:0,j=0;return P(h)?j=Math.max(h,T,X):P(T)?j=Math.max(T,X):j=X,j>0?Math.max(0,j):0},W=()=>{let d=window.__timelines??{},p=Qe({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),h=ye(),b=ue(),y=Math.max(h??0,b??0)||null,T=G(y),X=se=>{let Q=document.querySelector(`[data-composition-id="${CSS.escape(se)}"]`);return Q?p.resolveStartForElement(Q,0):0},j=se=>{let Q=window.gsap;if(!Q||typeof Q.timeline!="function")return null;let ce=Q.timeline({paused:!0});for(let he of se)ce.add(he.timeline,X(he.compositionId));return ce},Y=(se,Q)=>{if(!P(se))return null;let ce=window.gsap;if(!ce||typeof ce.timeline!="function")return null;let he=ce.timeline({paused:!0});if(Q)try{he.add(Q,0)}catch(ae){_("runtime.init.site2",ae)}let be=he;if(typeof be.to=="function")try{be.to({},{duration:se})}catch(ae){_("runtime.init.site3",ae)}return he},oe=(se,Q)=>{let ce=se;if(typeof ce.getChildren!="function")return[];try{let he=ce.getChildren(!0,!0,!0)??[];if(!Array.isArray(he))return[];let be=[];for(let ae of Q)if(!he.some(ke=>ke===ae.timeline))try{let ke=X(ae.compositionId);se.add(ae.timeline,ke),be.push(ae.compositionId)}catch(ke){_("runtime.init.site4",ke)}return be}catch{return[]}},Ie=D(),fe=Ie?.getAttribute("data-composition-id")??null;if(!fe)return{timeline:null};let xe=d[fe]??null,me=(()=>{if(!Ie)return[];let se=new Set,Q=Array.from(Ie.querySelectorAll("[data-composition-id]")),ce=[];for(let he of Q){let be=he.getAttribute("data-composition-id");if(!be||be===fe||se.has(be))continue;se.add(be);let ae=d[be]??null;if(!ae||typeof ae.play!="function"||typeof ae.pause!="function")continue;let Ne=L(ae);ce.push({compositionId:be,timeline:ae,durationSeconds:Ne??0})}return ce})(),dt=se=>{for(let Q of se){let ce=Q.timeline;if(typeof ce.paused=="function")try{ce.paused(!1)}catch(he){_("runtime.init.site5",he)}}};if(me.length>0&&dt(me),xe){let se=me.length>0?oe(xe,me):[];if((me.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+fe+"\'])"))&&(Z=!0),se.length>0)try{let ae=xe.time();xe.seek(ae,!1)}catch{}let Q=L(xe);if(!P(Q)&&me.length>0){let ae=me.map(is=>is.compositionId),Ne=j(me),ke=L(Ne);if(Ne&&P(ke))return{timeline:Ne,selectedTimelineIds:ae,selectedDurationSeconds:ke,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:fe,rootDurationSeconds:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:T,selectedDurationSeconds:ke,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:b,selectedTimelineIds:ae,autoNestedChildren:se}}};let hn=Y(y??0,xe),xn=L(hn);if(hn&&P(xn))return{timeline:hn,selectedTimelineIds:[fe],selectedDurationSeconds:xn,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:fe,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:b,selectedDurationSeconds:xn,selectedTimelineIds:[fe],autoNestedChildren:se}}}}if(!P(Q)&&me.length===0){let ae=Y(y??0,xe),Ne=L(ae);if(ae&&P(Ne))return{timeline:ae,selectedTimelineIds:[fe],selectedDurationSeconds:Ne,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:fe,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:b,selectedDurationSeconds:Ne,selectedTimelineIds:[fe]}}}}let ce=Ie?.getAttribute("data-duration"),he=ce?parseFloat(ce):null,be=Math.max(P(he)?he:0,b??0);if(be>0&&P(be)&&P(Q)&&be>=Q+.5){let ae=xe;if(typeof ae.to=="function")try{ae.to({},{duration:0},be)}catch(ke){_("runtime.init.site6",ke)}let Ne=L(xe);if(P(Ne))return{timeline:xe,selectedTimelineIds:[fe],selectedDurationSeconds:Ne,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:fe,rootDurationSeconds:Q,rootDeclaredDur:he,authoredCompositionDurationFloorSeconds:b,newDur:Ne}}}}return{timeline:xe,selectedTimelineIds:[fe],selectedDurationSeconds:Q,mediaDurationFloorSeconds:h,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:fe,selectedDurationSeconds:Q,autoNestedChildren:se}}:void 0}}if(me.length>0){let se=me.map(he=>he.compositionId),Q=j(me),ce=L(Q);if(Q)return{timeline:Q,selectedTimelineIds:se,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:fe,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:T,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,selectedTimelineIds:se}}}}return{timeline:null}},Z=!1,Se=()=>{if(!M)return!1;let d=t.capturedTimeline,p=L(d),h=P(p);if(d&&h&&Z)return!1;let b=W();if(!b.timeline)return!1;if(d&&d===b.timeline)return typeof d.timeScale=="function"&&d.timeScale(t.playbackRate),!1;t.capturedTimeline=b.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let y=U(t.capturedTimeline,0);if(y>0){try{I.setDuration(y)}catch{}t.capturedTimeline.pause();let T=Math.max(0,t.currentTime||0);typeof t.capturedTimeline.totalTime=="function"&&t.capturedTimeline.totalTime(T,!1);let X=document.querySelectorAll("[data-hf-studio-path-offset]");if(X.length>0&&t.capturedTimeline.getChildren){let j=new Set;try{for(let Y of t.capturedTimeline.getChildren(!0))if(typeof Y.targets=="function")for(let oe of Y.targets())j.add(oe)}catch{}for(let Y of X){if(!j.has(Y))continue;let oe=Y;oe.removeAttribute("data-hf-studio-path-offset"),oe.removeAttribute("data-hf-studio-original-translate"),oe.removeAttribute("data-hf-studio-original-inline-translate"),oe.style.removeProperty("--hf-studio-offset-x"),oe.style.removeProperty("--hf-studio-offset-y"),oe.style.removeProperty("translate")}}}b.diagnostics&&Ae({source:"hf-preview",type:"diagnostic",code:b.diagnostics.code,details:b.diagnostics.details}),Ae({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:b.selectedTimelineIds??[],selectedDurationSeconds:b.selectedDurationSeconds??null,mediaDurationFloorSeconds:b.mediaDurationFloorSeconds??null}});for(let T of V)$.delete(T),Le(T);return!0};window.__hfForceTimelineRebind=()=>{Z=!1,Se()};let Fe=()=>{let d=D();if(!(d instanceof HTMLElement))return;let p=d.getBoundingClientRect(),h=Number(d.getAttribute("data-width")),b=Number(d.getAttribute("data-height")),y=window.getComputedStyle(d),T=Number.isFinite(h)&&h>0&&Number.isFinite(b)&&b>0,X=p.width<=0||p.height<=0||d.clientWidth<=0||d.clientHeight<=0;!T||!X||l("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:h,declaredHeight:b,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:y.display,visibility:y.visibility,overflow:y.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},H=()=>{t.tornDown||(o!=null&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{o=null,Fe()}))},k=()=>{e=d=>{let p=E(d.error??d.message).slice(0,F);if(!p)return;let h=S(p);Ae({source:"hf-preview",type:"diagnostic",code:h.code,details:{category:h.category,message:p,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},n=d=>{let p=E(d.reason).slice(0,F);if(!p)return;let h=S(p);Ae({source:"hf-preview",type:"diagnostic",code:`${h.code}_unhandled_rejection`,details:{category:`${h.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",e),window.addEventListener("unhandledrejection",n)},O=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let h of d){let b=()=>{if(!(h instanceof Element))return;let y=h.tagName.toLowerCase(),T=h.getAttribute("src")??h.getAttribute("href")??h.getAttribute("poster")??null,X=y==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";l(X,{tagName:y,assetUrl:T,currentSrc:(h instanceof HTMLImageElement||h instanceof HTMLMediaElement)&&h.currentSrc||null,readyState:h instanceof HTMLMediaElement?h.readyState:null,networkState:h instanceof HTMLMediaElement?h.networkState:null},`${X}:${y}:${T??"unknown"}`)};h.addEventListener("error",b),s(()=>{h.removeEventListener("error",b)})}let p=document.fonts;p&&p.ready.then(()=>{if(t.tornDown)return;let h=Array.from(p).filter(b=>b.status==="error").map(b=>b.family).filter(b=>!!b).slice(0,10);h.length!==0&&l("runtime_font_load_issue",{failedFamilies:h,totalFaces:Array.from(p).length},`runtime-font-load-issue:${h.join("|")}`)}).catch(()=>{})},ie=(d,p)=>{if(!d.timeline)return!1;let h=t.capturedTimeline;if(h&&h===d.timeline)return!1;let b=Math.max(0,t.currentTime||0),y=t.isPlaying;t.capturedTimeline=d.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);try{t.capturedTimeline.pause(),t.capturedTimeline.seek(b,!1),y&&t.capturedTimeline.play()}catch(T){_("runtime.init.site7",T)}return Ae({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:b,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ne=null,z=!1,V=new Set,$=new WeakMap,Ce=()=>{t.tornDown||(ne!=null&&window.clearTimeout(ne),ne=window.setTimeout(()=>{if(t.tornDown)return;ne=null;let d=W();if(!d.timeline||!P(d.mediaDurationFloorSeconds??null))return;if(!t.capturedTimeline){Se()&&(Xe(),Me(!0));return}if(z)return;let h=L(t.capturedTimeline),b=d.selectedDurationSeconds??L(d.timeline);P(b)&&(!P(h)||b>=h+f)&&ie(d,"manual")&&(z=!0,Ae({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:h??null,selectedDurationSeconds:b??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),Xe(),Me(!0))},x))},we=()=>{for(let d of V)d.removeEventListener("loadedmetadata",Ce),d.removeEventListener("durationchange",Ce);V.clear()},$e=()=>{if(t.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let p of d){if(V.has(p))continue;V.add(p);let h=Number.parseFloat(p.dataset.volume??"");Number.isFinite(h)&&(p.volume=Math.max(0,Math.min(1,h))),p.addEventListener("loadedmetadata",Ce),p.addEventListener("durationchange",Ce),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),Le(p)}},Le=d=>{$.has(d)||vi(d,t.capturedTimeline,U(t.capturedTimeline,0),$)},We=()=>{let d=y=>{let T=y.closest("[data-composition-id]"),X=T?C(T,0):null,j=T?g(T,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:T,inheritedStart:X,inheritedDuration:j}},p=_i({shouldIncludeElement:y=>y.hasAttribute("data-start")||!!d(y).compositionRoot,resolveStartSeconds:y=>{let T=d(y);return A(y,T.inheritedStart??0)},resolveDurationSeconds:y=>{let T=d(y),X=A(y,T.inheritedStart??0),j=Number.parseFloat(y.dataset.playbackStart??y.dataset.mediaStart??"0")||0,Y=T.inheritedStart!=null&&T.inheritedDuration!=null&&T.inheritedDuration>0?Math.max(0,T.inheritedStart+T.inheritedDuration-X):null,oe=Number.isFinite(y.duration)&&y.duration>j?Math.max(0,y.duration-j):null;return oe!=null&&Y!=null?Math.min(oe,Y):oe??Y}});for(let y of p.mediaClips){let T=$.get(y.el);T&&(y.volumeKeyframes=T)}let h=t.mediaForceSyncNextTick;h&&(t.mediaForceSyncNextTick=!1),Ri({clips:p.mediaClips,timeSeconds:t.currentTime,playing:t.isPlaying,playbackRate:t.playbackRate,outputMuted:t.mediaOutputMuted||pe.isActive(),userMuted:t.bridgeMuted,userVolume:t.bridgeVolume,forceSync:h,onElementVolume:(y,T)=>pe.setElementVolume(y,T),onAutoplayBlocked:()=>{t.mediaAutoplayBlockedPosted||(t.mediaAutoplayBlockedPosted=!0,Ae({source:"hf-preview",type:"media-autoplay-blocked"}))}});let b=Array.from(document.querySelectorAll("[data-start]"));for(let y of b){if(!(y instanceof HTMLElement))continue;let T=y.tagName.toLowerCase();if(T==="script"||T==="style"||T==="link"||T==="meta")continue;let X=T==="video"||T==="audio"?A(y,0):C(y,0),j=g(y),Y=y.getAttribute("data-composition-id");if(Y){let fe=(window.__timelines??{})[Y],xe=null;if(fe&&typeof fe.duration=="function"){let me=Number(fe.duration());Number.isFinite(me)&&me>0&&(xe=me)}let Ke=y.hasAttribute("data-composition-src")||y.hasAttribute("data-composition-file");j!=null&&j>0&&xe!=null&&!Ke?j=Math.min(j,xe):(j==null||j<=0)&&xe!=null&&(j=xe)}let oe=j!=null&&j>0?X+j:Number.POSITIVE_INFINITY,Ie=t.currentTime>=X&&(Number.isFinite(oe)?t.currentTime<=oe:!0);y.style.visibility=Ie?"visible":"hidden"}},Me=d=>{let p=Math.max(0,Math.round((t.currentTime||0)*t.canonicalFps)),h=Date.now();(d||p!==t.bridgeLastPostedFrame||t.isPlaying!==t.bridgeLastPostedPlaying||t.bridgeMuted!==t.bridgeLastPostedMuted||h-t.bridgeLastPostedAt>=t.bridgeMaxPostIntervalMs)&&(t.bridgeLastPostedFrame=p,t.bridgeLastPostedPlaying=t.isPlaying,t.bridgeLastPostedMuted=t.bridgeMuted,t.bridgeLastPostedAt=h,Ae({source:"hf-preview",type:"state",frame:p,isPlaying:t.isPlaying,muted:t.bridgeMuted,playbackRate:t.playbackRate}))},Xe=()=>{te(),v(),q();let d=D();if(d){let h=B(d.getAttribute("data-width")),b=B(d.getAttribute("data-height")),y=h?parseInt(h,10):0,T=b?parseInt(b,10):0;y>0&&T>0&&Ae({source:"hf-preview",type:"stage-size",width:y,height:T})}Se();let p=Hi({canonicalFps:t.canonicalFps});window.__clipManifest=p,Ae(p),H()},Be=(d,p=0)=>{for(let h of t.deterministicAdapters){try{d==="discover"&&h.discover(),d==="pause"&&h.pause(),d==="play"&&h.play&&h.play()}catch(b){_("runtime.init.site8",b)}if(d==="discover")try{h.seek({time:p})}catch(b){_("runtime.init.site9",b)}}},ct=()=>{window.__renderReady=!1};if(M)ii();else{let d={injectedStyles:t.injectedCompStyles,injectedScripts:t.injectedCompScripts,parseDimensionPx:B,onDiagnostic:({code:p,details:h})=>{Ae({source:"hf-preview",type:"diagnostic",code:p,details:h})}};Eo(d).then(()=>Ao(d)).finally(()=>{M=!0,$e(),O(),ii(),ct()})}let Wt=Li({postMessage:d=>Ae(d)});Wt.installPickerApi();let fn=d=>{let p=Number(d);!Number.isFinite(p)||p<=0?t.playbackRate=1:t.playbackRate=Math.max(.1,Math.min(5,p)),t.mediaForceSyncNextTick=!0,t.capturedTimeline&&typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let h=document.querySelectorAll("video, audio");for(let b of h)if(b instanceof HTMLMediaElement)try{b.playbackRate=t.playbackRate}catch(y){_("runtime.init.site10",y)}},de=Bi({getTimeline:()=>t.capturedTimeline,setTimeline:d=>{t.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>t.isPlaying,setIsPlaying:d=>{t.isPlaying!==d&&(t.mediaForceSyncNextTick=!0),t.isPlaying=d},getPlaybackRate:()=>t.playbackRate,setPlaybackRate:fn,getCanonicalFps:()=>t.canonicalFps,onSyncMedia:(d,p)=>{t.currentTime=Math.max(0,Number(d)||0),t.isPlaying!==p&&(t.mediaForceSyncNextTick=!0),t.isPlaying=p,We()},onStatePost:Me,onDeterministicSeek:d=>{for(let p of t.deterministicAdapters)try{p.seek({time:Number(d)||0})}catch(h){_("runtime.init.site11",h)}},onDeterministicPause:()=>Be("pause"),onDeterministicPlay:()=>Be("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>U(t.capturedTimeline,0)});window.__player=a(de),window.__playerReady=!0,gi(Ae),ft("composition_loaded",{duration:de.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),t.controlBridgeHandler=xi({onPlay:()=>{de.play(),ft("composition_played",{time:de.getTime()})},onPause:()=>{de.pause(),ft("composition_paused",{time:de.getTime()})},onSeek:(d,p)=>{let h=Math.max(0,d)/t.canonicalFps;de.seek(h),ft("composition_seeked",{time:h})},onSetMuted:d=>{t.bridgeMuted=d;let p=d||t.mediaOutputMuted;pe.setMuted(p);let h=document.querySelectorAll("video, audio");for(let b of h)b instanceof HTMLMediaElement&&(b.muted=p)},onSetVolume:d=>{t.bridgeVolume=d,pe.setVolume(d);let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement))continue;let b=parseFloat(h.dataset.volume??""),y=Number.isFinite(b)?b:1;h.volume=y*d}},onSetMediaOutputMuted:d=>{t.mediaOutputMuted=d;let p=d||t.bridgeMuted;pe.setMuted(p);let h=document.querySelectorAll("video, audio");for(let b of h)b instanceof HTMLMediaElement&&(b.muted=p)},onSetPlaybackRate:d=>{fn(d),t.transportClock&&t.transportClock.setRate(t.playbackRate),pe.setRate(t.playbackRate)},onTick:()=>{if(t.tornDown||!I.isPlaying())return;let d=I.now();if(t.currentTime=d,Ge(d),I.reachedEnd()){pe.stopAll(),I.detachAudioSource(),I.pause(),t.isPlaying=!1;let p=I.getDuration();Number.isFinite(p)&&(I.seek(p),t.currentTime=p,Ge(p)),Be("pause"),We(),Me(!0)}},onEnablePickMode:()=>Wt.enablePickMode(),onDisablePickMode:()=>Wt.disablePickMode()}),t.deterministicAdapters=[Ti(),yi({resolveStartSeconds:d=>C(d,0)}),bi(),Fi(),Ni(),Ci(),Si({getTimeline:()=>t.capturedTimeline})],Mi(),k(),$e(),Be("discover");let I=new on;t.transportClock=I;let pe=new sn,fi=!1;pe.init().then(d=>{fi=d});let Xo=()=>{let d=t.capturedTimeline,p=Se();t.capturedTimeline&&(p||t.capturedTimeline!==d||!de._timeline)&&(de._timeline=t.capturedTimeline);let h=U(t.capturedTimeline,0);h>0&&I.setDuration(h),Be("discover",t.currentTime),window.__renderReady=!0,Xe(),Me(!0)};if(ct=()=>{if(!M||window.__hfTimelinesBuilding){window.__renderReady=!1;return}Xo()},window.__hfTimelinesBuilding){window.__renderReady=!1;let d=()=>{window.removeEventListener("hf-timelines-built",d),ct()};window.addEventListener("hf-timelines-built",d)}ct(),M&&setTimeout(()=>{ct()},0);let Ht=0,mn=!1,es=(d,p,h)=>{try{d.pause(),typeof d.totalTime=="function"?d.totalTime(p,!1):d.seek(p,!1)}catch(b){_(h,b)}},ts=d=>{let p=window.__timelines??{},h=D()?.getAttribute("data-composition-id")??null;for(let[b,y]of Object.entries(p)){if(!y||b===h)continue;let T=document.querySelector(`[data-composition-id="${CSS.escape(b)}"]`);if(!T)continue;let X=C(T,0);if(!Number.isFinite(X))continue;let j=g(T,{includeAuthoredTimingAttrs:!0}),Y=L(y),oe=j!=null&&j>0?j:Y,Ie=Math.max(0,oe!=null&&oe>0?Math.min(oe,d-X):d-X);es(y,Ie,"runtime.init.transport.childTimeline")}},ns=d=>{let p=window.__timelines??{};for(let h of Object.values(p))if(!(!h||h===d))try{h.play()}catch(b){_("runtime.init.activateSiblings",b)}},Ge=(d,p)=>{let h=t.capturedTimeline;if(h){p?.activateChildren&&ns(h);try{typeof h.totalTime=="function"?h.totalTime(d,!1):h.seek(d,!1)}catch(b){_("runtime.init.transport.seek",b)}}else ts(d);for(let b of t.deterministicAdapters)try{b.seek({time:d})}catch(y){_("runtime.init.transport.adapter",y)}},mi=()=>{if(!(t.tornDown||mn)){mn=!0;try{if(t.transportRafId=window.requestAnimationFrame(mi),Ht+=1,Ht%60===0&&!(I.isPlaying()&&t.capturedTimeline!=null&&I.now()<m)){let h=t.capturedTimeline;if(Se()){t.capturedTimeline&&!de._timeline&&(de._timeline=t.capturedTimeline),t.capturedTimeline&&t.capturedTimeline!==h&&t.capturedTimeline.pause();let b=U(t.capturedTimeline,0);b>0&&I.setDuration(b),Xe()}}if(Ht%20===0&&Xe(),Ht%30===0&&$e(),t.capturedTimeline){let p=U(t.capturedTimeline,0);p>0&&I.setDuration(p)}if(I.isPlaying()&&!t.mediaOutputMuted)if(pe.isActive()&&pe.context){let p=pe.getTime();p>=0&&I.attachAudioSource({currentTimeSeconds:p})}else{let p=document.querySelectorAll("audio[data-start]"),h=!1;for(let b of p){if(!(b instanceof HTMLMediaElement)||!b.isConnected)continue;let y=Number.parseFloat(b.dataset.start??""),T=Number.parseFloat(b.dataset.duration??""),X=Number.isFinite(T)&&T>0?y+T:1/0,j=Number.parseFloat(b.dataset.playbackStart??b.dataset.mediaStart??"0")||0;if(Number.isFinite(y)&&t.currentTime>=y&&t.currentTime<=X){b.paused?!b.error&&b.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(I.attachAudioSource({currentTimeSeconds:t.currentTime}),h=!0):(I.attachAudioSource({el:b,compositionStart:y,mediaStart:j}),h=!0);break}}!h&&I.hasAudioSource()&&I.detachAudioSource()}else I.hasAudioSource()&&I.detachAudioSource();let d=I.now();if(t.currentTime=d,Ge(d),I.isPlaying()&&I.reachedEnd()){pe.stopAll(),I.detachAudioSource(),I.pause(),t.isPlaying=!1;let p=I.getDuration();Number.isFinite(p)&&(I.seek(p),t.currentTime=p,Ge(p)),Be("pause"),We(),Me(!0);return}I.isPlaying()&&We(),Me(!1)}finally{mn=!1}}},pi=d=>{let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let b=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(b))continue;let y=Number.parseFloat(h.dataset.duration??""),T=Number.isFinite(y)&&y>0?b+y:1/0;if(d<b||d>=T)continue;let X=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,j=d-b+X;if(j>=0)try{h.currentTime=j}catch{}}};if(de.play=()=>{let d=t.capturedTimeline;if(I.isPlaying())return;let p=U(d,0);if(p>0)I.setDuration(p),I.reachedEnd()&&(I.seek(0),t.currentTime=0,Ge(0));else{let h=D(),b=Number(h?.getAttribute("data-duration")??0);b>0&&I.setDuration(b)}if(d&&d.pause(),!!I.play()){if(t.isPlaying=!0,t.mediaForceSyncNextTick=!0,pi(I.now()),fi){let h=pe.startGeneration(),b=document.querySelectorAll("audio[data-start]");for(let y of b){if(!(y instanceof HTMLMediaElement)||!y.isConnected)continue;let T=Number.parseFloat(y.dataset.start??"");if(!Number.isFinite(T))continue;let X=Number.parseFloat(y.dataset.playbackStart??y.dataset.mediaStart??"0")||0,j=Number.parseFloat(y.dataset.volume??""),Y=Number.isFinite(j)?j:1;pe.decodeAudioElement(y).then(oe=>{!oe||!I.isPlaying()||pe.schedulePlayback(y,oe,T,X,I.now(),Y*t.bridgeVolume,h,t.playbackRate)})}}Be("play"),We(),Me(!0)}},de.pause=()=>{if(!I.isPlaying())return;pe.stopAll(),I.detachAudioSource(),I.pause(),t.isPlaying=!1,t.currentTime=I.now(),t.mediaForceSyncNextTick=!0,pi(t.currentTime);let d=t.capturedTimeline;d&&d.pause(),Be("pause"),We(),Me(!0)},de.seek=d=>{let p=tt(Math.max(0,Number(d)||0),t.canonicalFps);pe.stopAll(),I.detachAudioSource(),I.isPlaying()&&I.pause(),I.seek(p),t.currentTime=I.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0;let b=t.capturedTimeline;b&&b.pause(),Ge(t.currentTime),Be("pause"),We(),Me(!0)},de.renderSeek=d=>{let p=tt(Math.max(0,Number(d)||0),t.canonicalFps);I.isPlaying()&&I.pause(),I.seek(p),t.currentTime=I.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0,Ge(t.currentTime,{activateChildren:!0}),We(),Me(!0)},de.getTime=()=>I.now(),de.getDuration=()=>{let d=I.getDuration();return Number.isFinite(d)?d:0},de.isPlaying=()=>I.isPlaying(),de.setPlaybackRate=d=>{fn(d),I.setRate(t.playbackRate),pe.setRate(t.playbackRate)},t.capturedTimeline){let d=U(t.capturedTimeline,0);d>0&&I.setDuration(d),t.capturedTimeline.pause()}let hi=window.__player;if(hi){let d=["play","pause","seek","renderSeek","getTime","getDuration","isPlaying"];for(let p of d)Object.defineProperty(hi,p,{get:()=>de[p],set:h=>{de[p]=h},configurable:!0})}t.transportRafId=window.requestAnimationFrame(mi),Xe(),Me(!0);let pn=()=>{if(!t.tornDown){t.tornDown=!0,t.transportRafId!=null&&(window.cancelAnimationFrame(t.transportRafId),t.transportRafId=null),t.transportClock=null,pe.destroy(),ne!=null&&(window.clearTimeout(ne),ne=null),o!=null&&(window.cancelAnimationFrame(o),o=null),we(),t.controlBridgeHandler&&(window.removeEventListener("message",t.controlBridgeHandler),t.controlBridgeHandler=null),e&&(window.removeEventListener("error",e),e=null),n&&(window.removeEventListener("unhandledrejection",n),n=null),t.beforeUnloadHandler&&(window.removeEventListener("beforeunload",t.beforeUnloadHandler),t.beforeUnloadHandler=null),Wt.disablePickMode();for(let d of t.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(p){_("runtime.init.site12",p)}t.deterministicAdapters=[];for(let d of i.splice(0))try{d()}catch(p){_("runtime.init.site13",p)}for(let d of t.injectedCompStyles)try{d.remove()}catch(p){_("runtime.init.site14",p)}t.injectedCompStyles=[];for(let d of t.injectedCompScripts)try{d.remove()}catch(p){_("runtime.init.site15",p)}t.injectedCompScripts=[],t.capturedTimeline=null,window.__hfRuntimeTeardown===pn&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=pn,t.beforeUnloadHandler=pn,window.addEventListener("beforeunload",t.beforeUnloadHandler)}var Mo=["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"],ri=[[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 Fl(t){if(t<=255)return Mo[t];let e=0,n=ri.length-1;for(;e<=n;){let i=e+n>>1,r=ri[i];if(t<r[0]){n=i-1;continue}if(t>r[1]){e=i+1;continue}return r[2]}return"L"}function wl(t){let e=t.length;if(e===0)return null;let n=new Array(e),i=!1;for(let c=0;c<e;){let u=t.charCodeAt(c),m=u,f=1;if(u>=55296&&u<=56319&&c+1<e){let F=t.charCodeAt(c+1);F>=56320&&F<=57343&&(m=(u-55296<<10)+(F-56320)+65536,f=2)}let x=Fl(m);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let F=0;F<f;F++)n[c+F]=x;c+=f}if(!i)return null;let r=0;for(let c=0;c<e;c++){let u=n[c];if(u==="L"){r=0;break}if(u==="R"||u==="AL"){r=1;break}}let o=new Int8Array(e);for(let c=0;c<e;c++)o[c]=r;let s=r&1?"R":"L",l=s,a=l;for(let c=0;c<e;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<e;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<e-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<e;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<e&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<e;c++){let u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<e;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<e&&n[u]==="ON";)u++;let m=c>0?n[c-1]:l,f=u<e?n[u]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let E=c;E<u;E++)n[E]=x;c=u-1}for(let c=0;c<e;c++)n[c]==="ON"&&(n[c]=s);for(let c=0;c<e;c++){let u=n[c];(o[c]&1)===0?u==="R"?o[c]++:(u==="AN"||u==="EN")&&(o[c]+=2):(u==="L"||u==="AN"||u==="EN")&&o[c]++}return o}function To(t,e){let n=wl(t);if(n===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=n[e[r]];return i}var Nl=/[ \\t\\n\\r\\f]+/g,Cl=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Ml(t){let e=t??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Tl(t){if(!Cl.test(t))return t;let e=t.replace(Nl," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function kl(t){return/[\\r\\f]/.test(t)?t.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):t.replace(/\\r\\n/g,`\n`)}var oi=null,vl;function _l(){return oi===null&&(oi=new Intl.Segmenter(vl,{granularity:"word"})),oi}var Rl=/\\p{Script=Arabic}/u,an=/\\p{M}/u,Io=/\\p{Nd}/u;function ko(t){return Rl.test(t)}function vo(t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=191472&&t<=192093||t>=194560&&t<=195103||t>=196608&&t<=201551||t>=201552&&t<=205743||t>=205744&&t<=210041||t>=63744&&t<=64255||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519}function Re(t){for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(!(n<12288)){if(n>=55296&&n<=56319&&e+1<t.length){let i=t.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(n-55296<<10)+(i-56320)+65536;if(vo(r))return!0;e++;continue}}if(vo(n))return!0}}return!1}function Ll(t){let e=cn(t);return e!==null&&(un.has(e)||ze.has(e))}var Dl=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Bl(t){return Re(t)}function Il(t){let e=cn(t);return e!==null&&Dl.has(e)}function ln(t){return!Ll(t)&&!Il(t)}var un=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"]),Pt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),ai=new Set(["\'","\\u2019"]),ze=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Ol=new Set([":",".","\\u060C","\\u061B"]),Pl=new Set(["\\u104F"]),Wl=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Hl(t){if(li(t))return!0;let e=!1;for(let n of t){if(ze.has(n)){e=!0;continue}if(!(e&&an.test(n)))return!1}return e}function ql(t){for(let e of t)if(!un.has(e)&&!ze.has(e))return!1;return t.length>0}function Vl(t){if(li(t))return!0;for(let e of t)if(!Pt.has(e)&&!ai.has(e)&&!an.test(e))return!1;return t.length>0}function li(t){let e=!1;for(let n of t)if(!(n==="\\\\"||an.test(n))){if(Pt.has(n)||ze.has(n)||ai.has(n)){e=!0;continue}return!1}return e}function Oo(t,e){let n=e-1;if(n<=0)return Math.max(n,0);let i=t.charCodeAt(n);if(i<56320||i>57343)return n;let r=n-1;if(r<0)return n;let o=t.charCodeAt(r);return o>=55296&&o<=56319?r:n}function cn(t){if(t.length===0)return null;let e=Oo(t,t.length);return t.slice(e)}function Ul(t){let e=Array.from(t),n=e.length;for(;n>0;){let i=e[n-1];if(an.test(i)){n--;continue}if(Pt.has(i)||ai.has(i)){n--;continue}break}return n<=0||n===e.length?null:{head:e.slice(0,n).join(""),tail:e.slice(n).join("")}}function zl(t,e,n){return n==="text"&&!e&&t.length===1&&t!=="-"&&t!=="\\u2014"?t:null}function _o(t,e,n,i){let r=e[i],o=t[i];if(r==null)return o;let s=n[i];if(o.length===s)return o;let l=r.repeat(s);return t[i]=l,l}function Ro(t,e){return t&&e!==null&&Ol.has(e)}function jl(t){let e=cn(t);return e!==null&&Pl.has(e)}function $l(t){if(t.length<2||t[0]!==" ")return null;let e=t.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function dn(t){let e=t.length;for(;e>0;){let n=Oo(t,e),i=t.slice(n,e);if(Wl.has(i))return!0;if(!ze.has(i))return!1;e=n}return!1}function Gl(t,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(t===" ")return"preserved-space";if(t===" ")return"tab";if(e.preserveHardBreaks&&t===`\n`)return"hard-break"}return t===" "?"space":t==="\\xA0"||t==="\\u202F"||t==="\\u2060"||t==="\\uFEFF"?"glue":t==="\\u200B"?"zero-width-break":t==="\\xAD"?"soft-hyphen":"text"}var Kl=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Te(t){return t.length===1?t[0]:t.join("")}function Jl(t,e){let n=[];for(let i=t.length-1;i>=0;i--)n.push(t[i]);return n.push(e),Te(n)}function Ql(t,e,n,i){if(!Kl.test(t))return[{text:t,isWordLike:e,kind:"text",start:n}];let r=[],o=null,s=[],l=n,a=!1,c=0;for(let u of t){let m=Gl(u,i),f=m==="text"&&e;if(o!==null&&m===o&&f===a){s.push(u),c+=u.length;continue}o!==null&&r.push({text:Te(s),isWordLike:a,kind:o,start:l}),o=m,s=[u],l=n+c,a=f,c+=u.length}return o!==null&&r.push({text:Te(s),isWordLike:a,kind:o,start:l}),r}function si(t){return t==="space"||t==="preserved-space"||t==="zero-width-break"||t==="hard-break"}var Yl=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Zl(t,e){let n=t.texts[e];return n.startsWith("www.")?!0:Yl.test(n)&&e+1<t.len&&t.kinds[e+1]==="text"&&t.texts[e+1]==="//"}function Xl(t){return t.includes("?")&&(t.includes("://")||t.startsWith("www."))}function eu(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let s=0;s<t.len;s++){if(i[s]!=="text"||!Zl(t,s))continue;let l=[e[s]],a=s+1;for(;a<t.len&&!si(i[a]);){l.push(e[a]),n[s]=!0;let c=e[a].includes("?");if(i[a]="text",e[a]="",a++,c)break}e[s]=Te(l)}let o=0;for(let s=0;s<e.length;s++){let l=e[s];l.length!==0&&(o!==s&&(e[o]=l,n[o]=n[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,n.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:n,kinds:i,starts:r}}function tu(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o]),!Xl(s))continue;let l=o+1;if(l>=t.len||si(t.kinds[l]))continue;let a=[],c=t.starts[l],u=l;for(;u<t.len&&!si(t.kinds[u]);)a.push(t.texts[u]),u++;a.length>0&&(e.push(Te(a)),n.push(!0),i.push("text"),r.push(c),o=u-1)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}var nu=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Lo=/^[A-Za-z0-9_]+[,:;]*$/,Do=/[,:;]+$/;function Po(t){for(let e of t)if(Io.test(e))return!0;return!1}function Ot(t){if(t.length===0)return!1;for(let e of t)if(!(Io.test(e)||nu.has(e)))return!1;return!0}function iu(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o];if(l==="text"&&Ot(s)&&Po(s)){let a=[s],c=o+1;for(;c<t.len&&t.kinds[c]==="text"&&Ot(t.texts[c]);)a.push(t.texts[c]),c++;e.push(Te(a)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=c-1;continue}e.push(s),n.push(t.isWordLike[o]),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function ru(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o],a=t.isWordLike[o];if(l==="text"&&a&&Lo.test(s)){let c=[s],u=Do.test(s),m=o+1;for(;u&&m<t.len&&t.kinds[m]==="text"&&t.isWordLike[m]&&Lo.test(t.texts[m]);){let f=t.texts[m];c.push(f),u=Do.test(f),m++}e.push(Te(c)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=m-1;continue}e.push(s),n.push(a),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function ou(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(t.kinds[o]==="text"&&s.includes("-")){let l=s.split("-"),a=l.length>1;for(let c=0;c<l.length;c++){let u=l[c];if(!a)break;(u.length===0||!Po(u)||!Ot(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){let m=l[u],f=u<l.length-1?`${m}-`:m;e.push(f),n.push(!0),i.push("text"),r.push(t.starts[o]+c),c+=f.length}continue}}e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function su(t){let e=[],n=[],i=[],r=[],o=0;for(;o<t.len;){let s=[t.texts[o]],l=t.isWordLike[o],a=t.kinds[o],c=t.starts[o];if(a==="glue"){let u=[s[0]],m=c;for(o++;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let f=Te(u);if(o<t.len&&t.kinds[o]==="text")s[0]=f,s.push(t.texts[o]),l=t.isWordLike[o],a="text",c=m,o++;else{e.push(f),n.push(!1),i.push("glue"),r.push(m);continue}}else o++;if(a==="text")for(;o<t.len&&t.kinds[o]==="glue";){let u=[];for(;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let m=Te(u);if(o<t.len&&t.kinds[o]==="text"){s.push(m,t.texts[o]),l=l||t.isWordLike[o],o++;continue}s.push(m)}e.push(Te(s)),n.push(l),i.push(a),r.push(c)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function au(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Re(e[o])||!Re(e[o+1]))continue;let s=Ul(e[o]);s!==null&&(e[o]=s.head,e[o+1]=s.tail+e[o+1],r[o+1]=r[o]+s.head.length)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Bo(t,e,n){let i=_l(),r=0,o=[],s=[],l=[],a=[],c=[],u=[],m=[],f=[],x=[],F=[],E=[],S=[];for(let C of i.segment(t))for(let g of Ql(C.segment,C.isWordLike??!1,C.index,n)){let ue=function(){u[R]!==null&&(s[R]=[_o(o,u,m,R)],u[R]=null),s[R].push(g.text),l[R]=l[R]||g.isWordLike,f[R]=f[R]||w,x[R]=x[R]||M,F[R]=P,E[R]=J,S[R]=Ro(x[R],L)},A=g.kind==="text",N=zl(g.text,g.isWordLike,g.kind),w=Re(g.text),M=ko(g.text),L=cn(g.text),P=dn(g.text),J=jl(g.text),R=r-1;e.carryCJKAfterClosingQuote&&A&&r>0&&a[R]==="text"&&w&&f[R]&&F[R]||A&&r>0&&a[R]==="text"&&ql(g.text)&&f[R]||A&&r>0&&a[R]==="text"&&E[R]?ue():A&&r>0&&a[R]==="text"&&g.isWordLike&&M&&S[R]?(ue(),l[R]=!0):N!==null&&r>0&&a[R]==="text"&&u[R]===N?m[R]=(m[R]??1)+1:A&&!g.isWordLike&&r>0&&a[R]==="text"&&(Hl(g.text)||g.text==="-"&&l[R])?ue():(o[r]=g.text,s[r]=[g.text],l[r]=g.isWordLike,a[r]=g.kind,c[r]=g.start,u[r]=N,m[r]=N===null?0:1,f[r]=w,x[r]=M,F[r]=P,E[r]=J,S[r]=Ro(M,L),r++)}for(let C=0;C<r;C++){if(u[C]!==null){o[C]=_o(o,u,m,C);continue}o[C]=Te(s[C])}for(let C=1;C<r;C++)a[C]==="text"&&!l[C]&&li(o[C])&&a[C-1]==="text"&&(o[C-1]+=o[C],l[C-1]=l[C-1]||l[C],o[C]="");let B=Array.from({length:r},()=>null),D=-1;for(let C=r-1;C>=0;C--){let g=o[C];if(g.length!==0){if(a[C]==="text"&&!l[C]&&Vl(g)&&D>=0&&a[D]==="text"){let A=B[D]??[];A.push(g),B[D]=A,c[D]=c[C],o[C]="";continue}D=C}}for(let C=0;C<r;C++){let g=B[C];g!=null&&(o[C]=Jl(g,o[C]))}let v=0;for(let C=0;C<r;C++){let g=o[C];g.length!==0&&(v!==C&&(o[v]=g,l[v]=l[C],a[v]=a[C],c[v]=c[C]),v++)}o.length=v,l.length=v,a.length=v,c.length=v;let te=su({len:v,texts:o,isWordLike:l,kinds:a,starts:c}),q=au(ru(ou(iu(tu(eu(te))))));for(let C=0;C<q.len-1;C++){let g=$l(q.texts[C]);g!==null&&(q.kinds[C]!=="space"&&q.kinds[C]!=="preserved-space"||q.kinds[C+1]!=="text"||!ko(q.texts[C+1])||(q.texts[C]=g.space,q.isWordLike[C]=!1,q.kinds[C]=q.kinds[C]==="preserved-space"?"preserved-space":"space",q.texts[C+1]=g.marks+q.texts[C+1],q.starts[C+1]=q.starts[C]+g.space.length))}return q}function lu(t,e){if(t.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}];let n=[],i=0;for(let r=0;r<t.len;r++)t.kinds[r]==="hard-break"&&(n.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<t.len&&n.push({startSegmentIndex:i,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}),n}function uu(t){if(t.len<=1)return t;let e=[],n=[],i=[],r=[],o=null,s=!1,l=0,a=!1,c=!1;function u(){o!==null&&(e.push(Te(o)),n.push(s),i.push("text"),r.push(l),o=null)}for(let m=0;m<t.len;m++){let f=t.texts[m],x=t.kinds[m],F=t.isWordLike[m],E=t.starts[m];if(x==="text"){let S=Bl(f),B=ln(f);if(o!==null&&a&&c){o.push(f),s=s||F,a=a||S,c=B;continue}u(),o=[f],s=F,l=E,a=S,c=B;continue}u(),e.push(f),n.push(F),i.push(x),r.push(E)}return u(),{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Wo(t,e,n="normal",i="normal"){let r=Ml(n),o=r.mode==="pre-wrap"?kl(t):Tl(t);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?uu(Bo(o,e,r)):Bo(o,e,r);return{normalized:o,chunks:lu(s,r),...s}}var at=null,Ho=new Map,lt=null,cu=96,du=/\\p{Emoji_Presentation}/u,fu=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,ui=null,qo=new Map;function ci(){if(at!==null)return at;if(typeof OffscreenCanvas<"u")return at=new OffscreenCanvas(1,1).getContext("2d"),at;if(typeof document<"u")return at=document.createElement("canvas").getContext("2d"),at;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function mu(t){let e=Ho.get(t);return e||(e=new Map,Ho.set(t,e)),e}function Pe(t,e){let n=e.get(t);return n===void 0&&(n={width:ci().measureText(t).width,containsCJK:Re(t)},e.set(t,n)),n}function ut(){if(lt!==null)return lt;if(typeof navigator>"u")return lt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},lt;let t=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&t.includes("Safari/")&&!t.includes("Chrome/")&&!t.includes("Chromium/")&&!t.includes("CriOS/")&&!t.includes("FxiOS/")&&!t.includes("EdgiOS/"),i=t.includes("Chrome/")||t.includes("Chromium/")||t.includes("CriOS/")||t.includes("Edg/");return lt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},lt}function pu(t){let e=t.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function Vo(){return ui===null&&(ui=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ui}function hu(t){return du.test(t)||t.includes("\\uFE0F")}function Uo(t){return fu.test(t)}function xu(t,e){let n=qo.get(t);if(n!==void 0)return n;let i=ci();i.font=t;let r=i.measureText("\\u{1F600}").width;if(n=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=t,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let s=o.getBoundingClientRect().width;document.body.removeChild(o),r-s>.5&&(n=r-s)}return qo.set(t,n),n}function gu(t){let e=0,n=Vo();for(let i of n.segment(t))hu(i.segment)&&e++;return e}function yu(t,e){return e.emojiCount===void 0&&(e.emojiCount=gu(t)),e.emojiCount}function je(t,e,n){return n===0?e.width:e.width-yu(t,e)*n}function zo(t,e,n,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=Vo(),s=[];for(let u of o.segment(t))s.push(u.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let u=[];for(let m of s){let f=Pe(m,n);u.push(je(m,f,i))}return e.breakableFitAdvances=u,e.breakableFitAdvances}if(r==="pair-context"||s.length>cu){let u=[],m=null,f=0;for(let x of s){let F=Pe(x,n),E=je(x,F,i);if(m===null)u.push(E);else{let S=m+x,B=Pe(S,n);u.push(je(S,B,i)-f)}m=x,f=E}return e.breakableFitAdvances=u,e.breakableFitAdvances}let l=[],a="",c=0;for(let u of s){a+=u;let m=Pe(a,n),f=je(a,m,i);l.push(f-c),c=f}return e.breakableFitAdvances=l,e.breakableFitAdvances}function jo(t,e){let n=ci();n.font=t;let i=mu(t),r=pu(t),o=e?xu(t,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function Su(t,e){for(;e<t.widths.length;){let n=t.kinds[e];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;e++}return e}function bu(t,e){if(e<=0)return 0;let n=t%e;return Math.abs(n)<=1e-6?e:e-n}function Au(t,e,n,i,r){let o=0,s=e;for(;o<t.length;){let l=s+t[o];if((o+1<t.length?l+r:l)>n+i)break;s=l,o++}return{fitCount:o,fittedWidth:s}}function $o(t,e){return t.simpleLineWalkFastPath?Go(t,e):Ko(t,e)}function Go(t,e,n){let{widths:i,kinds:r,breakableFitAdvances:o}=t;if(i.length===0)return 0;let l=ut().lineFitEpsilon,a=e+l,c=0,u=0,m=!1,f=0,x=0,F=0,E=0,S=-1,B=0;function D(){S=-1,B=0}function v(N=F,w=E,M=u){c++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:N,endGraphemeIndex:w,width:M}),u=0,m=!1,D()}function te(N,w){m=!0,f=N,x=0,F=N+1,E=0,u=w}function q(N,w,M){m=!0,f=N,x=w,F=N,E=w+1,u=M}function C(N,w){if(!m){te(N,w);return}u+=w,F=N+1,E=0}function g(N,w){let M=o[N];for(let L=w;L<M.length;L++){let P=M[L];m?u+P>a?(v(),q(N,L,P)):(u+=P,F=N,E=L+1):q(N,L,P)}m&&F===N&&E===M.length&&(F=N+1,E=0)}let A=0;for(;A<i.length&&!(!m&&(A=Su(t,A),A>=i.length));){let N=i[A],w=r[A],M=w==="space"||w==="preserved-space"||w==="tab"||w==="zero-width-break"||w==="soft-hyphen";if(!m){N>e&&o[A]!==null?g(A,0):te(A,N),M&&(S=A+1,B=u-N),A++;continue}if(u+N>a){if(M){C(A,N),v(A+1,0,u-N),A++;continue}if(S>=0){if(F>S||F===S&&E>0){v();continue}v(S,0,B);continue}if(N>e&&o[A]!==null){v(),g(A,0),A++;continue}v();continue}C(A,N),M&&(S=A+1,B=u-N),A++}return m&&v(),c}function Ko(t,e,n){if(t.simpleLineWalkFastPath)return Go(t,e,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:l,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:u}=t;if(i.length===0||u.length===0)return 0;let m=ut(),f=m.lineFitEpsilon,x=e+f,F=0,E=0,S=!1,B=0,D=0,v=0,te=0,q=-1,C=0,g=0,A=null;function N(){q=-1,C=0,g=0,A=null}function w(G=v,U=te,W=E){F++,n?.({startSegmentIndex:B,startGraphemeIndex:D,endSegmentIndex:G,endGraphemeIndex:U,width:W}),E=0,S=!1,N()}function M(G,U){S=!0,B=G,D=0,v=G+1,te=0,E=U}function L(G,U,W){S=!0,B=G,D=U,v=G,te=U+1,E=W}function P(G,U){if(!S){M(G,U);return}E+=U,v=G+1,te=0}function J(G,U,W,Z){if(!U)return;let Se=G==="tab"?0:r[W],Fe=G==="tab"?Z:o[W];q=W+1,C=E-Z+Se,g=E-Z+Fe,A=G}function R(G,U){let W=l[G];for(let Z=U;Z<W.length;Z++){let Se=W[Z];S?E+Se>x?(w(),L(G,Z,Se)):(E+=Se,v=G,te=Z+1):L(G,Z,Se)}S&&v===G&&te===W.length&&(v=G+1,te=0)}function ue(G){if(A!=="soft-hyphen")return!1;let U=l[G];if(U==null)return!1;let{fitCount:W,fittedWidth:Z}=Au(U,E,e,f,a);return W===0?!1:(E=Z,v=G,te=W,N(),W===U.length?(v=G+1,te=0,!0):(w(G,W,Z+a),R(G,W),!0))}function ye(G){F++,n?.({startSegmentIndex:G.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:G.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),N()}for(let G=0;G<u.length;G++){let U=u[G];if(U.startSegmentIndex===U.endSegmentIndex){ye(U);continue}S=!1,E=0,B=U.startSegmentIndex,D=0,v=U.startSegmentIndex,te=0,N();let W=U.startSegmentIndex;for(;W<U.endSegmentIndex;){let Z=s[W],Se=Z==="space"||Z==="preserved-space"||Z==="tab"||Z==="zero-width-break"||Z==="soft-hyphen",Fe=Z==="tab"?bu(E,c):i[W];if(Z==="soft-hyphen"){S&&(v=W+1,te=0,q=W+1,C=E+a,g=E+a,A=Z),W++;continue}if(!S){Fe>e&&l[W]!==null?R(W,0):M(W,Fe),J(Z,Se,W,Fe),W++;continue}if(E+Fe>x){let k=E+(Z==="tab"?0:r[W]),O=E+(Z==="tab"?Fe:o[W]);if(A==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&C<=x){w(q,0,g);continue}if(A==="soft-hyphen"&&ue(W)){W++;continue}if(Se&&k<=x){P(W,Fe),w(W+1,0,O),W++;continue}if(q>=0&&C<=x){if(v>q||v===q&&te>0){w();continue}let ie=q;w(ie,0,g),W=ie;continue}if(Fe>e&&l[W]!==null){w(),R(W,0),W++;continue}w();continue}P(W,Fe),J(Z,Se,W,Fe),W++}if(S){let Z=q===U.consumedEndSegmentIndex?g:E;w(U.consumedEndSegmentIndex,0,Z)}}return F}var di=null;function Eu(){return di===null&&(di=new Intl.Segmenter(void 0,{granularity:"grapheme"})),di}function Fu(t){return t?{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 wu(t,e){let n=[],i=[],r=0,o=!1,s=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,l=!1)}function c(m,f,x){i=[m],r=f,o=x,s=dn(m),l=Pt.has(m)}function u(m,f){i.push(m),o=o||f;let x=dn(m);m.length===1&&ze.has(m)?s=s||x:s=x,l=!1}for(let m of Eu().segment(t)){let f=m.segment,x=Re(f);if(i.length===0){c(f,m.index,x);continue}if(l||un.has(f)||ze.has(f)||e.carryCJKAfterClosingQuote&&x&&s){u(f,x);continue}if(!o&&!x){u(f,x);continue}a(),c(f,m.index,x)}return a(),n}function Nu(t){if(t.length<=1)return t;let e=[],n=[t[0].text],i=t[0].start,r=Re(t[0].text),o=ln(t[0].text);function s(){e.push({text:n.length===1?n[0]:n.join(""),start:i})}for(let l=1;l<t.length;l++){let a=t[l],c=Re(a.text),u=ln(a.text);if(r&&o){n.push(a.text),r=r||c,o=u;continue}s(),n=[a.text],i=a.start,r=c,o=u}return s(),e}function Cu(t,e,n,i){let r=ut(),{cache:o,emojiCorrection:s}=jo(e,Uo(t.normalized)),l=je("-",Pe("-",o),s),c=je(" ",Pe(" ",o),s)*8;if(t.len===0)return Fu(n);let u=[],m=[],f=[],x=[],F=t.chunks.length<=1,E=n?[]:null,S=[],B=n?[]:null,D=Array.from({length:t.len});function v(g,A,N,w,M,L,P){M!=="text"&&M!=="space"&&M!=="zero-width-break"&&(F=!1),u.push(A),m.push(N),f.push(w),x.push(M),E?.push(L),S.push(P),B!==null&&B.push(g)}function te(g,A,N,w,M){let L=Pe(g,o),P=je(g,L,s),J=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:P,R=A==="space"||A==="zero-width-break"?0:P;if(M&&w&&g.length>1){let ue="sum-graphemes";Ot(g)?ue="pair-context":r.preferPrefixWidthsForBreakableRuns&&(ue="segment-prefixes");let ye=zo(g,L,o,s,ue);v(g,P,J,R,A,N,ye);return}v(g,P,J,R,A,N,null)}for(let g=0;g<t.len;g++){D[g]=u.length;let A=t.texts[g],N=t.isWordLike[g],w=t.kinds[g],M=t.starts[g];if(w==="soft-hyphen"){v(A,0,l,l,w,M,null);continue}if(w==="hard-break"){v(A,0,0,0,w,M,null);continue}if(w==="tab"){v(A,0,0,0,w,M,null);continue}let L=Pe(A,o);if(w==="text"&&L.containsCJK){let P=wu(A,r),J=i==="keep-all"?Nu(P):P;for(let R=0;R<J.length;R++){let ue=J[R];te(ue.text,"text",M+ue.start,N,i==="keep-all"||!Re(ue.text))}continue}te(A,w,M,N,!0)}let q=Mu(t.chunks,D,u.length),C=E===null?null:To(t.normalized,E);return B!==null?{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:F,segLevels:C,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:q,segments:B}:{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:F,segLevels:C,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:q}}function Mu(t,e,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:n,l=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:n,a=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:s,endSegmentIndex:l,consumedEndSegmentIndex:a})}return i}function Tu(t,e,n,i){let r=i?.wordBreak??"normal",o=Wo(t,ut(),i?.whiteSpace,r);return Cu(o,e,n,r)}function Jo(t,e,n){return Tu(t,e,!1,n)}function Qo(t,e,n){let i=$o(t,e);return{lineCount:i,height:i*n}}var ku={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Yo(t,e){let n={...ku,...e},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,s=Jo(t,o),{lineCount:l}=Qo(s,n.maxWidth,r*i);if(l<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:Yo,getVariables:xo};function Zo(){let t=window;t.__hyperframeRuntimeBootstrapped||(t.__hyperframeRuntimeBootstrapped=!0,Co())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Zo,{once:!0}):Zo();})();\n';
|
|
39819
39821
|
}
|
|
39820
39822
|
});
|
|
39821
39823
|
|
|
@@ -39872,6 +39874,28 @@ var init_parityContract = __esm({
|
|
|
39872
39874
|
}
|
|
39873
39875
|
});
|
|
39874
39876
|
|
|
39877
|
+
// ../core/src/telemetryRedaction.ts
|
|
39878
|
+
function truncateTelemetryString(value, maxLength) {
|
|
39879
|
+
if (value.length <= maxLength) return value;
|
|
39880
|
+
return `${value.slice(0, maxLength - 1)}\u2026`;
|
|
39881
|
+
}
|
|
39882
|
+
function redactUrlQueryStrings(value) {
|
|
39883
|
+
return value.replace(/\b(https?:\/\/[^\s?]+)\?[^\s]*/g, "$1?\u2026");
|
|
39884
|
+
}
|
|
39885
|
+
function redactFilePaths(value) {
|
|
39886
|
+
return value.replace(/file:\/\/[^\s'")]+/g, "[file-url]").replace(/\/Users\/[^\s'")]+/g, "[path]").replace(/\/(?:home|root|opt|app|workspace|srv|mnt)\/[^\s'")]+/g, "[path]").replace(/\/(?:private\/)?(?:var|tmp)\/[^\s'")]+/g, "[path]").replace(/[A-Za-z]:\\[^\s'")]+/g, "[path]");
|
|
39887
|
+
}
|
|
39888
|
+
function redactTelemetryString(value, maxLength = MAX_TELEMETRY_STRING_LENGTH) {
|
|
39889
|
+
return truncateTelemetryString(redactFilePaths(redactUrlQueryStrings(value)), maxLength);
|
|
39890
|
+
}
|
|
39891
|
+
var MAX_TELEMETRY_STRING_LENGTH;
|
|
39892
|
+
var init_telemetryRedaction = __esm({
|
|
39893
|
+
"../core/src/telemetryRedaction.ts"() {
|
|
39894
|
+
"use strict";
|
|
39895
|
+
MAX_TELEMETRY_STRING_LENGTH = 240;
|
|
39896
|
+
}
|
|
39897
|
+
});
|
|
39898
|
+
|
|
39875
39899
|
// ../core/src/adapters/gsap.ts
|
|
39876
39900
|
function createGSAPFrameAdapter(options) {
|
|
39877
39901
|
const { fps, timeline } = options;
|
|
@@ -43186,6 +43210,7 @@ __export(src_exports, {
|
|
|
43186
43210
|
parseFpsWithDefault: () => parseFpsWithDefault,
|
|
43187
43211
|
parseHtml: () => parseHtml,
|
|
43188
43212
|
quantizeTimeToFrame: () => quantizeTimeToFrame,
|
|
43213
|
+
redactTelemetryString: () => redactTelemetryString,
|
|
43189
43214
|
removeElementFromHtml: () => removeElementFromHtml,
|
|
43190
43215
|
rewriteAssetPath: () => rewriteAssetPath,
|
|
43191
43216
|
rewriteAssetPaths: () => rewriteAssetPaths,
|
|
@@ -43217,6 +43242,7 @@ var init_src = __esm({
|
|
|
43217
43242
|
init_runtime_inline();
|
|
43218
43243
|
init_hyperframesRuntime_engine();
|
|
43219
43244
|
init_parityContract();
|
|
43245
|
+
init_telemetryRedaction();
|
|
43220
43246
|
init_gsap2();
|
|
43221
43247
|
init_text();
|
|
43222
43248
|
init_getVariables();
|
|
@@ -43984,6 +44010,51 @@ var init_client = __esm({
|
|
|
43984
44010
|
});
|
|
43985
44011
|
|
|
43986
44012
|
// src/telemetry/events.ts
|
|
44013
|
+
function renderObservabilityEventProperties(props) {
|
|
44014
|
+
return {
|
|
44015
|
+
observability_render_job_id: props.observabilityRenderJobId,
|
|
44016
|
+
observability_composition_hash: props.observabilityCompositionHash,
|
|
44017
|
+
observability_event_count: props.observabilityEventCount,
|
|
44018
|
+
observability_last_phase: props.observabilityLastPhase,
|
|
44019
|
+
observability_last_status: props.observabilityLastStatus,
|
|
44020
|
+
observability_failed_phase: props.observabilityFailedPhase,
|
|
44021
|
+
browser_diagnostic_count: props.browserDiagnosticCount,
|
|
44022
|
+
browser_diagnostic_errors: props.browserDiagnosticErrors,
|
|
44023
|
+
browser_diagnostic_page_errors: props.browserDiagnosticPageErrors,
|
|
44024
|
+
browser_diagnostic_request_failed: props.browserDiagnosticRequestFailed,
|
|
44025
|
+
browser_diagnostic_http_errors: props.browserDiagnosticHttpErrors,
|
|
44026
|
+
browser_diagnostic_navigation_starts: props.browserDiagnosticNavigationStarts,
|
|
44027
|
+
browser_diagnostic_navigation_failures: props.browserDiagnosticNavigationFailures,
|
|
44028
|
+
browser_diagnostic_console_errors: props.browserDiagnosticConsoleErrors,
|
|
44029
|
+
browser_diagnostic_console_warnings: props.browserDiagnosticConsoleWarnings,
|
|
44030
|
+
capture_mode: props.captureMode,
|
|
44031
|
+
capture_force_screenshot: props.captureForceScreenshot,
|
|
44032
|
+
capture_worker_count: props.captureWorkerCount,
|
|
44033
|
+
capture_use_streaming_encode: props.captureUseStreamingEncode,
|
|
44034
|
+
capture_use_layered_composite: props.captureUseLayeredComposite,
|
|
44035
|
+
capture_use_page_side_compositing: props.captureUsePageSideCompositing,
|
|
44036
|
+
capture_has_hdr_content: props.captureHasHdrContent,
|
|
44037
|
+
capture_browser_gpu_mode: props.captureBrowserGpuMode,
|
|
44038
|
+
capture_protocol_timeout_ms: props.captureProtocolTimeoutMs,
|
|
44039
|
+
capture_page_navigation_timeout_ms: props.capturePageNavigationTimeoutMs,
|
|
44040
|
+
capture_player_ready_timeout_ms: props.capturePlayerReadyTimeoutMs,
|
|
44041
|
+
observability_extract_video_count: props.observabilityExtractVideoCount,
|
|
44042
|
+
observability_extracted_video_count: props.observabilityExtractedVideoCount,
|
|
44043
|
+
observability_extract_total_frames: props.observabilityExtractTotalFrames,
|
|
44044
|
+
observability_extract_max_frames_per_video: props.observabilityExtractMaxFramesPerVideo,
|
|
44045
|
+
observability_extract_avg_frames_per_video: props.observabilityExtractAvgFramesPerVideo,
|
|
44046
|
+
observability_extract_vfr_probe_ms: props.observabilityExtractVfrProbeMs,
|
|
44047
|
+
observability_extract_vfr_preflight_ms: props.observabilityExtractVfrPreflightMs,
|
|
44048
|
+
observability_extract_vfr_preflight_count: props.observabilityExtractVfrPreflightCount,
|
|
44049
|
+
observability_extract_cache_hits: props.observabilityExtractCacheHits,
|
|
44050
|
+
observability_extract_cache_misses: props.observabilityExtractCacheMisses,
|
|
44051
|
+
observability_init_duration_ms: props.observabilityInitDurationMs,
|
|
44052
|
+
observability_init_tween_count: props.observabilityInitTweenCount
|
|
44053
|
+
};
|
|
44054
|
+
}
|
|
44055
|
+
function redactTelemetryMessage(value) {
|
|
44056
|
+
return redactTelemetryString(value);
|
|
44057
|
+
}
|
|
43987
44058
|
function trackCommand(command2) {
|
|
43988
44059
|
trackEvent("cli_command", { command: command2 });
|
|
43989
44060
|
}
|
|
@@ -44021,7 +44092,8 @@ function trackRenderComplete(props) {
|
|
|
44021
44092
|
extract_vfr_preflight_count: props.extractVfrPreflightCount,
|
|
44022
44093
|
extract_phase3_ms: props.extractPhase3Ms,
|
|
44023
44094
|
extract_cache_hits: props.extractCacheHits,
|
|
44024
|
-
extract_cache_misses: props.extractCacheMisses
|
|
44095
|
+
extract_cache_misses: props.extractCacheMisses,
|
|
44096
|
+
...renderObservabilityEventProperties(props)
|
|
44025
44097
|
});
|
|
44026
44098
|
}
|
|
44027
44099
|
function trackRenderError(props) {
|
|
@@ -44033,10 +44105,39 @@ function trackRenderError(props) {
|
|
|
44033
44105
|
gpu: props.gpu,
|
|
44034
44106
|
source: props.source ?? "cli",
|
|
44035
44107
|
failed_stage: props.failedStage,
|
|
44036
|
-
error_message: props.errorMessage,
|
|
44108
|
+
error_message: props.errorMessage ? redactTelemetryMessage(props.errorMessage) : void 0,
|
|
44037
44109
|
elapsed_ms: props.elapsedMs,
|
|
44038
44110
|
peak_memory_mb: props.peakMemoryMb,
|
|
44039
|
-
memory_free_mb: props.memoryFreeMb
|
|
44111
|
+
memory_free_mb: props.memoryFreeMb,
|
|
44112
|
+
...renderObservabilityEventProperties(props)
|
|
44113
|
+
});
|
|
44114
|
+
}
|
|
44115
|
+
function trackRenderObservation(props) {
|
|
44116
|
+
trackEvent("render_observation", {
|
|
44117
|
+
source: props.source ?? "cli",
|
|
44118
|
+
render_job_id: props.renderJobId,
|
|
44119
|
+
phase: props.phase,
|
|
44120
|
+
status: props.status,
|
|
44121
|
+
composition_hash: props.compositionHash,
|
|
44122
|
+
elapsed_ms: props.elapsedMs,
|
|
44123
|
+
duration_ms: props.durationMs,
|
|
44124
|
+
message: props.message ? redactTelemetryMessage(props.message) : void 0,
|
|
44125
|
+
worker_count: props.workerCount,
|
|
44126
|
+
force_screenshot: props.forceScreenshot,
|
|
44127
|
+
use_streaming_encode: props.useStreamingEncode,
|
|
44128
|
+
use_layered_composite: props.useLayeredComposite,
|
|
44129
|
+
use_page_side_compositing: props.usePageSideCompositing,
|
|
44130
|
+
has_hdr_content: props.hasHdrContent,
|
|
44131
|
+
capture_mode: props.captureMode,
|
|
44132
|
+
video_count: props.videoCount,
|
|
44133
|
+
extracted_video_count: props.extractedVideoCount,
|
|
44134
|
+
total_frames_extracted: props.totalFramesExtracted,
|
|
44135
|
+
max_frames_per_video: props.maxFramesPerVideo,
|
|
44136
|
+
avg_frames_per_extracted_video: props.avgFramesPerExtractedVideo,
|
|
44137
|
+
vfr_preflight_count: props.vfrPreflightCount,
|
|
44138
|
+
vfr_preflight_ms: props.vfrPreflightMs,
|
|
44139
|
+
extract_cache_hits: props.cacheHits,
|
|
44140
|
+
extract_cache_misses: props.cacheMisses
|
|
44040
44141
|
});
|
|
44041
44142
|
}
|
|
44042
44143
|
function trackInitTemplate(templateId, props) {
|
|
@@ -44074,6 +44175,7 @@ function trackCommandResult(props) {
|
|
|
44074
44175
|
var init_events = __esm({
|
|
44075
44176
|
"src/telemetry/events.ts"() {
|
|
44076
44177
|
"use strict";
|
|
44178
|
+
init_src();
|
|
44077
44179
|
init_client();
|
|
44078
44180
|
}
|
|
44079
44181
|
});
|
|
@@ -45803,6 +45905,65 @@ var init_runtimeSource = __esm({
|
|
|
45803
45905
|
}
|
|
45804
45906
|
});
|
|
45805
45907
|
|
|
45908
|
+
// src/telemetry/renderObservability.ts
|
|
45909
|
+
function renderObservabilityTelemetryPayload(observability) {
|
|
45910
|
+
if (!observability) return {};
|
|
45911
|
+
const diagnostics = observability.browserDiagnostics;
|
|
45912
|
+
const capture = observability.capture;
|
|
45913
|
+
const extraction = observability.extraction;
|
|
45914
|
+
const init = observability.init;
|
|
45915
|
+
return {
|
|
45916
|
+
observabilityRenderJobId: observability.renderJobId,
|
|
45917
|
+
observabilityCompositionHash: observability.compositionHash,
|
|
45918
|
+
observabilityEventCount: observability.eventCount,
|
|
45919
|
+
observabilityLastPhase: observability.lastEvent?.phase,
|
|
45920
|
+
observabilityLastStatus: observability.lastEvent?.status,
|
|
45921
|
+
observabilityFailedPhase: observability.failedPhase,
|
|
45922
|
+
browserDiagnosticCount: diagnostics.total,
|
|
45923
|
+
browserDiagnosticErrors: diagnostics.errors,
|
|
45924
|
+
browserDiagnosticPageErrors: diagnostics.pageErrors,
|
|
45925
|
+
browserDiagnosticRequestFailed: diagnostics.requestFailed,
|
|
45926
|
+
browserDiagnosticHttpErrors: diagnostics.httpErrors,
|
|
45927
|
+
browserDiagnosticNavigationStarts: diagnostics.navigationStarts,
|
|
45928
|
+
browserDiagnosticNavigationFailures: diagnostics.navigationFailures,
|
|
45929
|
+
browserDiagnosticConsoleErrors: diagnostics.consoleErrors,
|
|
45930
|
+
browserDiagnosticConsoleWarnings: diagnostics.consoleWarnings,
|
|
45931
|
+
captureMode: capture.captureMode,
|
|
45932
|
+
captureForceScreenshot: capture.forceScreenshot,
|
|
45933
|
+
captureWorkerCount: capture.workerCount,
|
|
45934
|
+
captureUseStreamingEncode: capture.useStreamingEncode,
|
|
45935
|
+
captureUseLayeredComposite: capture.useLayeredComposite,
|
|
45936
|
+
captureUsePageSideCompositing: capture.usePageSideCompositing,
|
|
45937
|
+
captureHasHdrContent: capture.hasHdrContent,
|
|
45938
|
+
captureBrowserGpuMode: capture.browserGpuMode,
|
|
45939
|
+
captureProtocolTimeoutMs: capture.protocolTimeoutMs,
|
|
45940
|
+
capturePageNavigationTimeoutMs: capture.pageNavigationTimeoutMs,
|
|
45941
|
+
capturePlayerReadyTimeoutMs: capture.playerReadyTimeoutMs,
|
|
45942
|
+
observabilityExtractVideoCount: extraction?.videoCount,
|
|
45943
|
+
observabilityExtractedVideoCount: extraction?.extractedVideoCount,
|
|
45944
|
+
observabilityExtractTotalFrames: extraction?.totalFramesExtracted,
|
|
45945
|
+
observabilityExtractMaxFramesPerVideo: extraction?.maxFramesPerVideo,
|
|
45946
|
+
observabilityExtractAvgFramesPerVideo: extraction?.avgFramesPerExtractedVideo,
|
|
45947
|
+
observabilityExtractVfrProbeMs: extraction?.vfrProbeMs,
|
|
45948
|
+
observabilityExtractVfrPreflightMs: extraction?.vfrPreflightMs,
|
|
45949
|
+
observabilityExtractVfrPreflightCount: extraction?.vfrPreflightCount,
|
|
45950
|
+
observabilityExtractCacheHits: extraction?.cacheHits,
|
|
45951
|
+
observabilityExtractCacheMisses: extraction?.cacheMisses,
|
|
45952
|
+
observabilityInitDurationMs: init?.initDurationMs,
|
|
45953
|
+
observabilityInitTweenCount: init?.tweenCount
|
|
45954
|
+
};
|
|
45955
|
+
}
|
|
45956
|
+
function renderJobObservabilityTelemetryPayload(job) {
|
|
45957
|
+
return renderObservabilityTelemetryPayload(
|
|
45958
|
+
job?.errorDetails?.observability ?? job?.perfSummary?.observability
|
|
45959
|
+
);
|
|
45960
|
+
}
|
|
45961
|
+
var init_renderObservability = __esm({
|
|
45962
|
+
"src/telemetry/renderObservability.ts"() {
|
|
45963
|
+
"use strict";
|
|
45964
|
+
}
|
|
45965
|
+
});
|
|
45966
|
+
|
|
45806
45967
|
// src/server/studioRenderTelemetry.ts
|
|
45807
45968
|
import { freemem as freemem2 } from "os";
|
|
45808
45969
|
function memSnapshot() {
|
|
@@ -45851,10 +46012,11 @@ function perfPayload(perf, elapsedMs) {
|
|
|
45851
46012
|
capturePeakMs: perf.capturePeakMs,
|
|
45852
46013
|
tmpPeakBytes: perf.tmpPeakBytes,
|
|
45853
46014
|
...stagesPayload(perf.stages),
|
|
45854
|
-
...extractPayload(perf.videoExtractBreakdown)
|
|
46015
|
+
...extractPayload(perf.videoExtractBreakdown),
|
|
46016
|
+
...renderObservabilityTelemetryPayload(perf.observability)
|
|
45855
46017
|
};
|
|
45856
46018
|
}
|
|
45857
|
-
function emitStudioRenderError(opts, elapsedMs, failedStage, err) {
|
|
46019
|
+
function emitStudioRenderError(opts, elapsedMs, failedStage, err, job) {
|
|
45858
46020
|
trackRenderError({
|
|
45859
46021
|
fps: fpsToNumber(opts.fps),
|
|
45860
46022
|
quality: opts.quality,
|
|
@@ -45863,6 +46025,7 @@ function emitStudioRenderError(opts, elapsedMs, failedStage, err) {
|
|
|
45863
46025
|
failedStage,
|
|
45864
46026
|
errorMessage: err instanceof Error ? err.message : String(err),
|
|
45865
46027
|
elapsedMs,
|
|
46028
|
+
...renderJobObservabilityTelemetryPayload(job),
|
|
45866
46029
|
...memSnapshot()
|
|
45867
46030
|
});
|
|
45868
46031
|
}
|
|
@@ -45883,6 +46046,7 @@ var init_studioRenderTelemetry = __esm({
|
|
|
45883
46046
|
"use strict";
|
|
45884
46047
|
init_src();
|
|
45885
46048
|
init_events();
|
|
46049
|
+
init_renderObservability();
|
|
45886
46050
|
init_system();
|
|
45887
46051
|
}
|
|
45888
46052
|
});
|
|
@@ -62987,6 +63151,40 @@ function appendBrowserDiagnostic(session, text) {
|
|
|
62987
63151
|
session.browserConsoleBuffer.shift();
|
|
62988
63152
|
}
|
|
62989
63153
|
}
|
|
63154
|
+
async function collectSessionInitTelemetry(page, initStart) {
|
|
63155
|
+
const initDurationMs = Date.now() - initStart;
|
|
63156
|
+
let tweenCount = 0;
|
|
63157
|
+
try {
|
|
63158
|
+
tweenCount = await page.evaluate(() => {
|
|
63159
|
+
const timelines = window.__timelines || {};
|
|
63160
|
+
const seen = /* @__PURE__ */ new Set();
|
|
63161
|
+
let count = 0;
|
|
63162
|
+
for (const timeline of Object.values(timelines)) {
|
|
63163
|
+
const maybeTimeline = timeline;
|
|
63164
|
+
if (typeof maybeTimeline?.getChildren !== "function") continue;
|
|
63165
|
+
const children = maybeTimeline.getChildren(true, true, false);
|
|
63166
|
+
for (const child of children) {
|
|
63167
|
+
if (child && typeof child === "object" && !seen.has(child)) {
|
|
63168
|
+
seen.add(child);
|
|
63169
|
+
count++;
|
|
63170
|
+
}
|
|
63171
|
+
}
|
|
63172
|
+
}
|
|
63173
|
+
return count;
|
|
63174
|
+
});
|
|
63175
|
+
} catch {
|
|
63176
|
+
tweenCount = 0;
|
|
63177
|
+
}
|
|
63178
|
+
return { initDurationMs, tweenCount };
|
|
63179
|
+
}
|
|
63180
|
+
async function recordSessionInitTelemetry(session, initStart) {
|
|
63181
|
+
const telemetry = await collectSessionInitTelemetry(session.page, initStart);
|
|
63182
|
+
session.initTelemetry = telemetry;
|
|
63183
|
+
appendBrowserDiagnostic(
|
|
63184
|
+
session,
|
|
63185
|
+
`[FrameCapture:INIT] complete initDurationMs=${telemetry.initDurationMs} tweenCount=${telemetry.tweenCount}`
|
|
63186
|
+
);
|
|
63187
|
+
}
|
|
62990
63188
|
function sanitizeDiagnosticUrl(input2) {
|
|
62991
63189
|
if (!input2) return "(empty)";
|
|
62992
63190
|
if (input2.startsWith("data:")) return "data:<redacted>";
|
|
@@ -63014,6 +63212,9 @@ function formatNavigationFailureDiagnostic(input2) {
|
|
|
63014
63212
|
const message = input2.error instanceof Error ? input2.error.message : String(input2.error);
|
|
63015
63213
|
return `[FrameCapture:ERROR] page.goto failed mode=${input2.captureMode} timeoutMs=${input2.timeoutMs} elapsedMs=${input2.elapsedMs} url=${sanitizeDiagnosticUrl(input2.url)} error=${message}`;
|
|
63016
63214
|
}
|
|
63215
|
+
function formatNavigationStartDiagnostic(input2) {
|
|
63216
|
+
return `[FrameCapture:NAV] page.goto start mode=${input2.captureMode} timeoutMs=${input2.timeoutMs} url=${sanitizeDiagnosticUrl(input2.url)}`;
|
|
63217
|
+
}
|
|
63017
63218
|
function formatRequestFailureDiagnostic(input2) {
|
|
63018
63219
|
return `[Browser:REQUESTFAILED] ${input2.method} ${sanitizeDiagnosticUrl(input2.url)} resource=${input2.resourceType} error=${input2.failureText}`;
|
|
63019
63220
|
}
|
|
@@ -63395,6 +63596,15 @@ async function initializeSession(session) {
|
|
|
63395
63596
|
console.log(`[initSession:${session.captureMode}] ${phase} (${Date.now() - initStart}ms)`);
|
|
63396
63597
|
};
|
|
63397
63598
|
const gotoEntryPage = async () => {
|
|
63599
|
+
appendBrowserDiagnostic(
|
|
63600
|
+
session,
|
|
63601
|
+
formatNavigationStartDiagnostic({
|
|
63602
|
+
captureMode: session.captureMode,
|
|
63603
|
+
url,
|
|
63604
|
+
timeoutMs: pageNavigationTimeout
|
|
63605
|
+
})
|
|
63606
|
+
);
|
|
63607
|
+
logInitPhase("page.goto start");
|
|
63398
63608
|
try {
|
|
63399
63609
|
await page.goto(url, { waitUntil: "domcontentloaded", timeout: pageNavigationTimeout });
|
|
63400
63610
|
} catch (error) {
|
|
@@ -63456,6 +63666,7 @@ async function initializeSession(session) {
|
|
|
63456
63666
|
logInitPhase("fonts ready");
|
|
63457
63667
|
await waitForOptionalTailwindReady(page, pageReadyTimeout2);
|
|
63458
63668
|
logInitPhase("tailwind ready");
|
|
63669
|
+
await recordSessionInitTelemetry(session, initStart);
|
|
63459
63670
|
if (session.options.format === "png") {
|
|
63460
63671
|
await initTransparentBackground(session.page);
|
|
63461
63672
|
}
|
|
@@ -63548,6 +63759,7 @@ async function initializeSession(session) {
|
|
|
63548
63759
|
logInitPhase("fonts ready");
|
|
63549
63760
|
await waitForOptionalTailwindReady(page, pageReadyTimeout);
|
|
63550
63761
|
logInitPhase("tailwind ready");
|
|
63762
|
+
await recordSessionInitTelemetry(session, initStart);
|
|
63551
63763
|
warmupState.running = false;
|
|
63552
63764
|
if (lockWarmupTicks) {
|
|
63553
63765
|
await warmupLoopPromise.catch(() => {
|
|
@@ -71201,6 +71413,18 @@ var init_hyperframeRuntimeLoader = __esm({
|
|
|
71201
71413
|
}
|
|
71202
71414
|
});
|
|
71203
71415
|
|
|
71416
|
+
// ../producer/src/generated/hf-early-stub-inline.ts
|
|
71417
|
+
function getHfEarlyStub() {
|
|
71418
|
+
return HF_EARLY_STUB_IIFE;
|
|
71419
|
+
}
|
|
71420
|
+
var HF_EARLY_STUB_IIFE;
|
|
71421
|
+
var init_hf_early_stub_inline = __esm({
|
|
71422
|
+
"../producer/src/generated/hf-early-stub-inline.ts"() {
|
|
71423
|
+
"use strict";
|
|
71424
|
+
HF_EARLY_STUB_IIFE = '"use strict";(()=>{var c=100,k=[],u=[],l=!1,s=!1;function a(n){let e=window.__HF_VIRTUAL_TIME__?.originalRequestAnimationFrame;return typeof e=="function"?e(n):requestAnimationFrame(n)}function p(n){let e=window.__HF_VIRTUAL_TIME__?.originalSetTimeout;if(typeof e=="function"){e(n,0);return}setTimeout(n,0)}function h(n){return n!==null&&typeof n=="object"&&"__hfIsProxy"in n?n.__hfReal:n}function m(n){let e=n.proxy.__hfReal,i=e[n.method];if(typeof i=="function"){let t=n.method==="add"?n.args.map(h):n.args;i.call(e,...t)}}function r(n,e,i){let t={proxy:n,method:e,args:i};return n.__hfQueue.push(t),u.push(t),_(),n}function f(n){let e=n.proxy.__hfQueue.indexOf(n);e>=0&&n.proxy.__hfQueue.splice(e,1)}function o(){for(;u.length>0;){let n=u.shift();n&&(f(n),m(n))}T()}function w(){s=!1,window.__hfTimelinesBuilding=!1;try{window.dispatchEvent(new CustomEvent("hf-timelines-built"))}catch{}}function T(){s||(s=!0,p(()=>{u.length===0?w():s=!1}))}function d(){l=!1;let n=u.splice(0,c);for(let e of n)f(e),m(e);u.length>0?(l=!0,a(d)):w()}function _(){l||(l=!0,window.__hfTimelinesBuilding=!0,a(d))}function y(n){let e={__hfReal:n,__hfQueue:[],__hfIsProxy:!0,to(...i){return r(e,"to",i)},from(...i){return r(e,"from",i)},fromTo(...i){return r(e,"fromTo",i)},set(...i){return r(e,"set",i)},add(...i){return r(e,"add",i)},pause(...i){return o(),n.pause(...i),e},play(...i){return o(),n.play(...i),e},seek(...i){return o(),n.seek(...i),e},totalTime(...i){return o(),i.length>0?(n.totalTime(...i),e):n.totalTime()},time(...i){return o(),i.length>0?(n.time(...i),e):n.time()},duration(...i){return o(),i.length>0?(n.duration(...i),e):n.duration()},getChildren(...i){o();let t=n.getChildren(...i);return Array.isArray(t)?t:[]},paused(...i){return o(),i.length>0?(n.paused(...i),e):n.paused()},timeScale(...i){return o(),i.length>0?(n.timeScale(...i),e):n.timeScale()},kill(){o(),n.kill()}};return k.push(e),e}if(typeof window<"u"){window.__hf||(window.__hf={}),window.__hfTimelinesBuilding=!1;let n=null;try{Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get(){return n},set(e){if(n=e,!e||typeof e.timeline!="function")return;let i=e.timeline.bind(e);e.timeline=t=>y(i(t))}})}catch{}}})();\n';
|
|
71425
|
+
}
|
|
71426
|
+
});
|
|
71427
|
+
|
|
71204
71428
|
// ../producer/src/services/fileServer.ts
|
|
71205
71429
|
import { Hono as Hono3 } from "hono";
|
|
71206
71430
|
import { serve as serve2 } from "@hono/node-server";
|
|
@@ -71442,6 +71666,7 @@ var init_fileServer2 = __esm({
|
|
|
71442
71666
|
"use strict";
|
|
71443
71667
|
init_compiler();
|
|
71444
71668
|
init_hyperframeRuntimeLoader();
|
|
71669
|
+
init_hf_early_stub_inline();
|
|
71445
71670
|
MIME_TYPES3 = {
|
|
71446
71671
|
".html": "text/html; charset=utf-8",
|
|
71447
71672
|
".css": "text/css; charset=utf-8",
|
|
@@ -71572,7 +71797,6 @@ var init_fileServer2 = __esm({
|
|
|
71572
71797
|
if (hasComposition) {
|
|
71573
71798
|
if (window.__player && typeof window.__player.renderSeek === "function") {
|
|
71574
71799
|
window.__playerReady = true;
|
|
71575
|
-
window.__renderReady = true;
|
|
71576
71800
|
return;
|
|
71577
71801
|
}
|
|
71578
71802
|
__realSetTimeout(waitForPlayer, 50);
|
|
@@ -71585,10 +71809,7 @@ var init_fileServer2 = __esm({
|
|
|
71585
71809
|
}
|
|
71586
71810
|
waitForPlayer();
|
|
71587
71811
|
})();`;
|
|
71588
|
-
HF_EARLY_STUB =
|
|
71589
|
-
if (typeof window === "undefined") return;
|
|
71590
|
-
if (!window.__hf) window.__hf = {};
|
|
71591
|
-
})();`;
|
|
71812
|
+
HF_EARLY_STUB = getHfEarlyStub();
|
|
71592
71813
|
HF_PAGE_SIDE_COMPOSITING_STUB = `(function() {
|
|
71593
71814
|
if (typeof window === "undefined") return;
|
|
71594
71815
|
window.__HF_PAGE_SIDE_COMPOSITING__ = true;
|
|
@@ -71643,6 +71864,13 @@ var init_fileServer2 = __esm({
|
|
|
71643
71864
|
configurable: true,
|
|
71644
71865
|
enumerable: true,
|
|
71645
71866
|
get: function() {
|
|
71867
|
+
// While the GSAP tween-batching interceptor (HF_EARLY_STUB) is draining
|
|
71868
|
+
// queued tweens via rAF, the real timelines are still empty. Return 0
|
|
71869
|
+
// here so pollHfReady in the engine keeps waiting (its condition is
|
|
71870
|
+
// __hf.duration > 0), preventing the capture pipeline from seeking
|
|
71871
|
+
// empty timelines and producing blank/incorrect frames.
|
|
71872
|
+
if (window.__hfTimelinesBuilding) return 0;
|
|
71873
|
+
if (!window.__renderReady) return 0;
|
|
71646
71874
|
var d = p.getDuration();
|
|
71647
71875
|
return d > 0 ? d : getDeclaredDuration();
|
|
71648
71876
|
},
|
|
@@ -71757,6 +71985,16 @@ var init_paths = __esm({
|
|
|
71757
71985
|
// ../producer/src/services/render/shared.ts
|
|
71758
71986
|
import { copyFileSync as copyFileSync2, cpSync, existsSync as existsSync34, mkdirSync as mkdirSync19, symlinkSync, writeFileSync as writeFileSync16 } from "fs";
|
|
71759
71987
|
import { basename as basename4, dirname as dirname12, isAbsolute as isAbsolute8, join as join37, relative as relative6, resolve as resolve19 } from "path";
|
|
71988
|
+
function writeFileExclusiveSync(path2, data) {
|
|
71989
|
+
try {
|
|
71990
|
+
writeFileSync16(path2, data, { flag: "wx", mode: 384 });
|
|
71991
|
+
} catch (error) {
|
|
71992
|
+
if (error && typeof error === "object" && "code" in error && error.code === "EEXIST") {
|
|
71993
|
+
return;
|
|
71994
|
+
}
|
|
71995
|
+
throw error;
|
|
71996
|
+
}
|
|
71997
|
+
}
|
|
71760
71998
|
function projectBrowserEndToCompositionTimeline(existingStart, browserStart, browserEnd) {
|
|
71761
71999
|
return browserEnd + (existingStart - browserStart);
|
|
71762
72000
|
}
|
|
@@ -72020,7 +72258,8 @@ function buildRenderErrorDetails(input2) {
|
|
|
72020
72258
|
freeMemoryMB: Math.round(freemem4() / (1024 * 1024)),
|
|
72021
72259
|
browserConsoleTail: input2.lastBrowserConsole.length > 0 ? input2.lastBrowserConsole.slice(-30) : void 0,
|
|
72022
72260
|
perfStages: Object.keys(input2.perfStages).length > 0 ? { ...input2.perfStages } : void 0,
|
|
72023
|
-
hdrDiagnostics: input2.hdrDiagnostics.videoExtractionFailures > 0 || input2.hdrDiagnostics.imageDecodeFailures > 0 ? { ...input2.hdrDiagnostics } : void 0
|
|
72261
|
+
hdrDiagnostics: input2.hdrDiagnostics.videoExtractionFailures > 0 || input2.hdrDiagnostics.imageDecodeFailures > 0 ? { ...input2.hdrDiagnostics } : void 0,
|
|
72262
|
+
observability: input2.observability
|
|
72024
72263
|
};
|
|
72025
72264
|
}
|
|
72026
72265
|
var init_cleanup = __esm({
|
|
@@ -72216,6 +72455,7 @@ function buildRenderPerfSummary(input2) {
|
|
|
72216
72455
|
captureAttempts: input2.captureAttempts.length > 0 ? input2.captureAttempts : void 0,
|
|
72217
72456
|
hdrDiagnostics: input2.hdrDiagnostics.videoExtractionFailures > 0 || input2.hdrDiagnostics.imageDecodeFailures > 0 ? { ...input2.hdrDiagnostics } : void 0,
|
|
72218
72457
|
hdrPerf: input2.hdrPerf ? finalizeHdrPerf(input2.hdrPerf) : void 0,
|
|
72458
|
+
observability: input2.observability,
|
|
72219
72459
|
captureAvgMs: input2.totalFrames > 0 ? Math.round((input2.perfStages.captureMs ?? 0) / input2.totalFrames) : void 0,
|
|
72220
72460
|
peakRssMb: Math.round(input2.peakRssBytes / (1024 * 1024)),
|
|
72221
72461
|
peakHeapUsedMb: Math.round(input2.peakHeapUsedBytes / (1024 * 1024))
|
|
@@ -72229,6 +72469,36 @@ var init_perfSummary = __esm({
|
|
|
72229
72469
|
}
|
|
72230
72470
|
});
|
|
72231
72471
|
|
|
72472
|
+
// ../producer/src/services/render/captureStageError.ts
|
|
72473
|
+
function wrapCaptureStageError(error, browserConsole) {
|
|
72474
|
+
if (error instanceof CaptureStageError) return error;
|
|
72475
|
+
return new CaptureStageError({ cause: error, browserConsole });
|
|
72476
|
+
}
|
|
72477
|
+
function getCaptureStageBrowserConsole(error) {
|
|
72478
|
+
if (error instanceof CaptureStageError) return error.browserConsole;
|
|
72479
|
+
return [];
|
|
72480
|
+
}
|
|
72481
|
+
var CaptureStageError;
|
|
72482
|
+
var init_captureStageError = __esm({
|
|
72483
|
+
"../producer/src/services/render/captureStageError.ts"() {
|
|
72484
|
+
"use strict";
|
|
72485
|
+
init_errorMessage();
|
|
72486
|
+
CaptureStageError = class extends Error {
|
|
72487
|
+
browserConsole;
|
|
72488
|
+
cause;
|
|
72489
|
+
constructor(input2) {
|
|
72490
|
+
super(normalizeErrorMessage(input2.cause));
|
|
72491
|
+
this.name = "CaptureStageError";
|
|
72492
|
+
this.cause = input2.cause;
|
|
72493
|
+
this.browserConsole = input2.browserConsole.slice();
|
|
72494
|
+
if (input2.cause instanceof Error && input2.cause.stack) {
|
|
72495
|
+
this.stack = input2.cause.stack;
|
|
72496
|
+
}
|
|
72497
|
+
}
|
|
72498
|
+
};
|
|
72499
|
+
}
|
|
72500
|
+
});
|
|
72501
|
+
|
|
72232
72502
|
// ../producer/src/services/render/captureCost.ts
|
|
72233
72503
|
import { join as join38 } from "path";
|
|
72234
72504
|
function estimateCaptureCostMultiplier(compiled) {
|
|
@@ -72526,6 +72796,224 @@ var init_captureCost = __esm({
|
|
|
72526
72796
|
}
|
|
72527
72797
|
});
|
|
72528
72798
|
|
|
72799
|
+
// ../producer/src/services/render/observability.ts
|
|
72800
|
+
import { createHash as createHash8 } from "crypto";
|
|
72801
|
+
function sanitizeObservationMessage(value) {
|
|
72802
|
+
return redactTelemetryString(value);
|
|
72803
|
+
}
|
|
72804
|
+
function computeCompositionObservabilityHash(compiledHtml) {
|
|
72805
|
+
return createHash8("sha256").update(compiledHtml, "utf8").digest("hex").slice(0, 16);
|
|
72806
|
+
}
|
|
72807
|
+
function sanitizeObservationData(data) {
|
|
72808
|
+
if (!data) return void 0;
|
|
72809
|
+
const sanitized = {};
|
|
72810
|
+
for (const [key2, value] of Object.entries(data)) {
|
|
72811
|
+
if (RESERVED_LOG_KEYS.has(key2)) continue;
|
|
72812
|
+
if (typeof value === "string") {
|
|
72813
|
+
if (!ALLOWED_STRING_DATA_KEYS.has(key2)) continue;
|
|
72814
|
+
sanitized[key2] = sanitizeObservationMessage(value);
|
|
72815
|
+
} else {
|
|
72816
|
+
sanitized[key2] = value;
|
|
72817
|
+
}
|
|
72818
|
+
}
|
|
72819
|
+
return sanitized;
|
|
72820
|
+
}
|
|
72821
|
+
function isHttpErrorDiagnostic(line) {
|
|
72822
|
+
return /\[Browser:HTTP\d{3}\]/.test(line);
|
|
72823
|
+
}
|
|
72824
|
+
function readUnsignedIntAfter(line, prefix) {
|
|
72825
|
+
const start = line.indexOf(prefix);
|
|
72826
|
+
if (start < 0) return void 0;
|
|
72827
|
+
let value = 0;
|
|
72828
|
+
let digits = 0;
|
|
72829
|
+
for (let i2 = start + prefix.length; i2 < line.length; i2++) {
|
|
72830
|
+
const code = line.charCodeAt(i2);
|
|
72831
|
+
if (code < 48 || code > 57) break;
|
|
72832
|
+
value = value * 10 + code - 48;
|
|
72833
|
+
digits += 1;
|
|
72834
|
+
if (value > Number.MAX_SAFE_INTEGER) return void 0;
|
|
72835
|
+
}
|
|
72836
|
+
return digits > 0 ? value : void 0;
|
|
72837
|
+
}
|
|
72838
|
+
function summarizeInitObservability(lines) {
|
|
72839
|
+
let initDurationMs;
|
|
72840
|
+
let tweenCount;
|
|
72841
|
+
for (const line of lines) {
|
|
72842
|
+
if (!line.includes("[FrameCapture:INIT]")) continue;
|
|
72843
|
+
const duration = readUnsignedIntAfter(line, "initDurationMs=");
|
|
72844
|
+
const tweens = readUnsignedIntAfter(line, "tweenCount=");
|
|
72845
|
+
if (duration !== void 0) {
|
|
72846
|
+
initDurationMs = initDurationMs === void 0 ? duration : Math.max(initDurationMs, duration);
|
|
72847
|
+
}
|
|
72848
|
+
if (tweens !== void 0) {
|
|
72849
|
+
tweenCount = tweenCount === void 0 ? tweens : Math.max(tweenCount, tweens);
|
|
72850
|
+
}
|
|
72851
|
+
}
|
|
72852
|
+
if (initDurationMs === void 0 && tweenCount === void 0) return void 0;
|
|
72853
|
+
return { initDurationMs, tweenCount };
|
|
72854
|
+
}
|
|
72855
|
+
function summarizeBrowserDiagnostics(lines) {
|
|
72856
|
+
let errors = 0;
|
|
72857
|
+
let pageErrors = 0;
|
|
72858
|
+
let requestFailed = 0;
|
|
72859
|
+
let httpErrors = 0;
|
|
72860
|
+
let navigationStarts = 0;
|
|
72861
|
+
let navigationFailures = 0;
|
|
72862
|
+
let consoleErrors = 0;
|
|
72863
|
+
let consoleWarnings = 0;
|
|
72864
|
+
for (const line of lines) {
|
|
72865
|
+
const isPageError = line.includes("PAGEERROR");
|
|
72866
|
+
const isRequestFailed = line.includes("REQUESTFAILED");
|
|
72867
|
+
const isHttpError = isHttpErrorDiagnostic(line);
|
|
72868
|
+
const isNavigationFailure = line.includes("[FrameCapture:ERROR] page.goto failed");
|
|
72869
|
+
const isConsoleError = line.includes("[error]");
|
|
72870
|
+
if (isPageError) pageErrors++;
|
|
72871
|
+
if (isRequestFailed) requestFailed++;
|
|
72872
|
+
if (isHttpError) httpErrors++;
|
|
72873
|
+
if (line.includes("[FrameCapture:NAV] page.goto start")) navigationStarts++;
|
|
72874
|
+
if (isNavigationFailure) navigationFailures++;
|
|
72875
|
+
if (isConsoleError) consoleErrors++;
|
|
72876
|
+
if (line.includes("[warn]")) consoleWarnings++;
|
|
72877
|
+
if (line.includes("ERROR") && !isPageError && !isRequestFailed && !isHttpError && !isNavigationFailure && !isConsoleError) {
|
|
72878
|
+
errors++;
|
|
72879
|
+
}
|
|
72880
|
+
}
|
|
72881
|
+
return {
|
|
72882
|
+
total: lines.length,
|
|
72883
|
+
errors,
|
|
72884
|
+
pageErrors,
|
|
72885
|
+
requestFailed,
|
|
72886
|
+
httpErrors,
|
|
72887
|
+
navigationStarts,
|
|
72888
|
+
navigationFailures,
|
|
72889
|
+
consoleErrors,
|
|
72890
|
+
consoleWarnings
|
|
72891
|
+
};
|
|
72892
|
+
}
|
|
72893
|
+
async function observeRenderStage(recorder, phase, data, fn) {
|
|
72894
|
+
const startedAt = recorder.stageStart(phase, data);
|
|
72895
|
+
try {
|
|
72896
|
+
const result = await fn();
|
|
72897
|
+
recorder.stageEnd(phase, startedAt);
|
|
72898
|
+
return result;
|
|
72899
|
+
} catch (error) {
|
|
72900
|
+
recorder.stageError(phase, startedAt, error);
|
|
72901
|
+
throw error;
|
|
72902
|
+
}
|
|
72903
|
+
}
|
|
72904
|
+
var MAX_EVENTS, ALLOWED_STRING_DATA_KEYS, RESERVED_LOG_KEYS, RenderObservabilityRecorder;
|
|
72905
|
+
var init_observability = __esm({
|
|
72906
|
+
"../producer/src/services/render/observability.ts"() {
|
|
72907
|
+
"use strict";
|
|
72908
|
+
init_src();
|
|
72909
|
+
init_errorMessage();
|
|
72910
|
+
MAX_EVENTS = 160;
|
|
72911
|
+
ALLOWED_STRING_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
72912
|
+
"browserGpuMode",
|
|
72913
|
+
"captureMode",
|
|
72914
|
+
"compositionHash",
|
|
72915
|
+
"effectiveHdr",
|
|
72916
|
+
"format",
|
|
72917
|
+
"quality",
|
|
72918
|
+
"renderJobId",
|
|
72919
|
+
"requestedHdrMode",
|
|
72920
|
+
"requestedWorkers"
|
|
72921
|
+
]);
|
|
72922
|
+
RESERVED_LOG_KEYS = /* @__PURE__ */ new Set([
|
|
72923
|
+
"data",
|
|
72924
|
+
"durationMs",
|
|
72925
|
+
"elapsedMs",
|
|
72926
|
+
"message",
|
|
72927
|
+
"phase",
|
|
72928
|
+
"renderJobId",
|
|
72929
|
+
"status"
|
|
72930
|
+
]);
|
|
72931
|
+
RenderObservabilityRecorder = class {
|
|
72932
|
+
constructor(input2) {
|
|
72933
|
+
this.input = input2;
|
|
72934
|
+
}
|
|
72935
|
+
input;
|
|
72936
|
+
events = [];
|
|
72937
|
+
eventCount = 0;
|
|
72938
|
+
failedPhase;
|
|
72939
|
+
checkpoint(phase, message, data) {
|
|
72940
|
+
return this.record({
|
|
72941
|
+
phase,
|
|
72942
|
+
status: "checkpoint",
|
|
72943
|
+
elapsedMs: Date.now() - this.input.pipelineStartMs,
|
|
72944
|
+
message: sanitizeObservationMessage(message),
|
|
72945
|
+
data: sanitizeObservationData(data)
|
|
72946
|
+
});
|
|
72947
|
+
}
|
|
72948
|
+
stageStart(phase, data) {
|
|
72949
|
+
this.record({
|
|
72950
|
+
phase,
|
|
72951
|
+
status: "start",
|
|
72952
|
+
elapsedMs: Date.now() - this.input.pipelineStartMs,
|
|
72953
|
+
data: sanitizeObservationData(data)
|
|
72954
|
+
});
|
|
72955
|
+
return Date.now();
|
|
72956
|
+
}
|
|
72957
|
+
stageEnd(phase, startedAtMs, data) {
|
|
72958
|
+
this.record({
|
|
72959
|
+
phase,
|
|
72960
|
+
status: "end",
|
|
72961
|
+
elapsedMs: Date.now() - this.input.pipelineStartMs,
|
|
72962
|
+
durationMs: Date.now() - startedAtMs,
|
|
72963
|
+
data: sanitizeObservationData(data)
|
|
72964
|
+
});
|
|
72965
|
+
}
|
|
72966
|
+
stageError(phase, startedAtMs, error, data) {
|
|
72967
|
+
this.failedPhase = phase;
|
|
72968
|
+
this.record({
|
|
72969
|
+
phase,
|
|
72970
|
+
status: "error",
|
|
72971
|
+
elapsedMs: Date.now() - this.input.pipelineStartMs,
|
|
72972
|
+
durationMs: Date.now() - startedAtMs,
|
|
72973
|
+
message: sanitizeObservationMessage(normalizeErrorMessage(error)),
|
|
72974
|
+
data: sanitizeObservationData(data)
|
|
72975
|
+
});
|
|
72976
|
+
}
|
|
72977
|
+
summary(input2) {
|
|
72978
|
+
const lastEvent = this.events[this.events.length - 1];
|
|
72979
|
+
return {
|
|
72980
|
+
renderJobId: this.input.renderJobId,
|
|
72981
|
+
compositionHash: input2.compositionHash,
|
|
72982
|
+
events: this.events.slice(),
|
|
72983
|
+
eventCount: this.eventCount,
|
|
72984
|
+
lastEvent,
|
|
72985
|
+
failedPhase: this.failedPhase,
|
|
72986
|
+
browserDiagnostics: summarizeBrowserDiagnostics(input2.lastBrowserConsole),
|
|
72987
|
+
capture: { ...input2.capture },
|
|
72988
|
+
extraction: input2.extraction ? { ...input2.extraction } : void 0,
|
|
72989
|
+
init: summarizeInitObservability(input2.lastBrowserConsole)
|
|
72990
|
+
};
|
|
72991
|
+
}
|
|
72992
|
+
hasFailure() {
|
|
72993
|
+
return this.failedPhase !== void 0;
|
|
72994
|
+
}
|
|
72995
|
+
record(event) {
|
|
72996
|
+
this.eventCount++;
|
|
72997
|
+
const eventWithJob = { ...event, renderJobId: this.input.renderJobId };
|
|
72998
|
+
this.events.push(eventWithJob);
|
|
72999
|
+
if (this.events.length > MAX_EVENTS) {
|
|
73000
|
+
this.events.shift();
|
|
73001
|
+
}
|
|
73002
|
+
this.input.log.info("[Render:trace]", {
|
|
73003
|
+
renderJobId: eventWithJob.renderJobId,
|
|
73004
|
+
phase: eventWithJob.phase,
|
|
73005
|
+
status: eventWithJob.status,
|
|
73006
|
+
elapsedMs: eventWithJob.elapsedMs,
|
|
73007
|
+
durationMs: eventWithJob.durationMs,
|
|
73008
|
+
message: eventWithJob.message,
|
|
73009
|
+
...eventWithJob.data
|
|
73010
|
+
});
|
|
73011
|
+
return eventWithJob;
|
|
73012
|
+
}
|
|
73013
|
+
};
|
|
73014
|
+
}
|
|
73015
|
+
});
|
|
73016
|
+
|
|
72529
73017
|
// ../producer/src/utils/ffprobe.ts
|
|
72530
73018
|
var init_ffprobe2 = __esm({
|
|
72531
73019
|
"../producer/src/utils/ffprobe.ts"() {
|
|
@@ -74243,6 +74731,9 @@ async function runCaptureStage(input2) {
|
|
|
74243
74731
|
onProgress
|
|
74244
74732
|
);
|
|
74245
74733
|
}
|
|
74734
|
+
} catch (error) {
|
|
74735
|
+
lastBrowserConsole = session.browserConsoleBuffer;
|
|
74736
|
+
throw wrapCaptureStageError(error, lastBrowserConsole);
|
|
74246
74737
|
} finally {
|
|
74247
74738
|
lastBrowserConsole = session.browserConsoleBuffer;
|
|
74248
74739
|
await closeCaptureSession(session);
|
|
@@ -74255,6 +74746,7 @@ var init_captureStage = __esm({
|
|
|
74255
74746
|
"use strict";
|
|
74256
74747
|
init_src2();
|
|
74257
74748
|
init_renderOrchestrator();
|
|
74749
|
+
init_captureStageError();
|
|
74258
74750
|
init_shared();
|
|
74259
74751
|
}
|
|
74260
74752
|
});
|
|
@@ -74385,6 +74877,9 @@ async function runCaptureStreamingStage(input2) {
|
|
|
74385
74877
|
onProgress
|
|
74386
74878
|
);
|
|
74387
74879
|
}
|
|
74880
|
+
} catch (error) {
|
|
74881
|
+
lastBrowserConsole = session.browserConsoleBuffer;
|
|
74882
|
+
throw wrapCaptureStageError(error, lastBrowserConsole);
|
|
74388
74883
|
} finally {
|
|
74389
74884
|
lastBrowserConsole = session.browserConsoleBuffer;
|
|
74390
74885
|
await closeCaptureSession(session);
|
|
@@ -74419,6 +74914,7 @@ var init_captureStreamingStage = __esm({
|
|
|
74419
74914
|
"../producer/src/services/render/stages/captureStreamingStage.ts"() {
|
|
74420
74915
|
"use strict";
|
|
74421
74916
|
init_src2();
|
|
74917
|
+
init_captureStageError();
|
|
74422
74918
|
init_shared();
|
|
74423
74919
|
}
|
|
74424
74920
|
});
|
|
@@ -74490,8 +74986,20 @@ var init_hdrImageTransferCache = __esm({
|
|
|
74490
74986
|
});
|
|
74491
74987
|
|
|
74492
74988
|
// ../producer/src/services/render/stages/captureHdrResources.ts
|
|
74493
|
-
import {
|
|
74989
|
+
import {
|
|
74990
|
+
closeSync,
|
|
74991
|
+
constants,
|
|
74992
|
+
fstatSync,
|
|
74993
|
+
mkdirSync as mkdirSync21,
|
|
74994
|
+
mkdtempSync as mkdtempSync2,
|
|
74995
|
+
openSync,
|
|
74996
|
+
readFileSync as readFileSync28
|
|
74997
|
+
} from "fs";
|
|
74494
74998
|
import { join as join44 } from "path";
|
|
74999
|
+
function tempDirSafePrefix(id) {
|
|
75000
|
+
const safe = id.replace(/[^A-Za-z0-9_.-]/g, "_").slice(0, 80);
|
|
75001
|
+
return safe || "video";
|
|
75002
|
+
}
|
|
74495
75003
|
function planHdrResources(args) {
|
|
74496
75004
|
const { composition, nativeHdrVideoIds, nativeHdrImageIds, projectDir, compiledDir } = args;
|
|
74497
75005
|
const hdrVideoIds = composition.videos.filter((v2) => nativeHdrVideoIds.has(v2.id)).map((v2) => v2.id);
|
|
@@ -74574,8 +75082,8 @@ async function extractHdrVideoFrames(args) {
|
|
|
74574
75082
|
for (const [videoId, srcPath] of prep.hdrVideoSrcPaths) {
|
|
74575
75083
|
const video = composition.videos.find((v2) => v2.id === videoId);
|
|
74576
75084
|
if (!video) continue;
|
|
74577
|
-
|
|
74578
|
-
|
|
75085
|
+
mkdirSync21(framesDir, { recursive: true });
|
|
75086
|
+
const frameDir = mkdtempSync2(join44(framesDir, `hdr_${tempDirSafePrefix(videoId)}-`));
|
|
74579
75087
|
const duration = video.end - video.start;
|
|
74580
75088
|
const dims = prep.hdrExtractionDims.get(videoId) ?? { width, height };
|
|
74581
75089
|
const rawPath = join44(frameDir, "frames.rgb48le");
|
|
@@ -74610,23 +75118,30 @@ async function extractHdrVideoFrames(args) {
|
|
|
74610
75118
|
);
|
|
74611
75119
|
}
|
|
74612
75120
|
const frameSize = dims.width * dims.height * 6;
|
|
74613
|
-
const
|
|
74614
|
-
|
|
74615
|
-
|
|
74616
|
-
|
|
74617
|
-
|
|
74618
|
-
|
|
75121
|
+
const fd = openSync(rawPath, constants.O_RDONLY | NO_FOLLOW_FLAG);
|
|
75122
|
+
let handedOff = false;
|
|
75123
|
+
try {
|
|
75124
|
+
const frameCount = Math.floor(fstatSync(fd).size / frameSize);
|
|
75125
|
+
if (frameCount < 1) {
|
|
75126
|
+
hdrDiagnostics.videoExtractionFailures += 1;
|
|
75127
|
+
throw new Error(
|
|
75128
|
+
`HDR frame extraction produced no frames for video "${videoId}". Aborting render to avoid shipping black HDR layers.`
|
|
75129
|
+
);
|
|
75130
|
+
}
|
|
75131
|
+
out.set(videoId, {
|
|
75132
|
+
dir: frameDir,
|
|
75133
|
+
rawPath,
|
|
75134
|
+
fd,
|
|
75135
|
+
width: dims.width,
|
|
75136
|
+
height: dims.height,
|
|
75137
|
+
frameSize,
|
|
75138
|
+
frameCount,
|
|
75139
|
+
scratch: Buffer.allocUnsafe(frameSize)
|
|
75140
|
+
});
|
|
75141
|
+
handedOff = true;
|
|
75142
|
+
} finally {
|
|
75143
|
+
if (!handedOff) closeSync(fd);
|
|
74619
75144
|
}
|
|
74620
|
-
out.set(videoId, {
|
|
74621
|
-
dir: frameDir,
|
|
74622
|
-
rawPath,
|
|
74623
|
-
fd: openSync(rawPath, "r"),
|
|
74624
|
-
width: dims.width,
|
|
74625
|
-
height: dims.height,
|
|
74626
|
-
frameSize,
|
|
74627
|
-
frameCount,
|
|
74628
|
-
scratch: Buffer.allocUnsafe(frameSize)
|
|
74629
|
-
});
|
|
74630
75145
|
}
|
|
74631
75146
|
return out;
|
|
74632
75147
|
}
|
|
@@ -74671,11 +75186,13 @@ function decodeHdrImageBuffers(args) {
|
|
|
74671
75186
|
}
|
|
74672
75187
|
return out;
|
|
74673
75188
|
}
|
|
75189
|
+
var NO_FOLLOW_FLAG;
|
|
74674
75190
|
var init_captureHdrResources = __esm({
|
|
74675
75191
|
"../producer/src/services/render/stages/captureHdrResources.ts"() {
|
|
74676
75192
|
"use strict";
|
|
74677
75193
|
init_src2();
|
|
74678
75194
|
init_src();
|
|
75195
|
+
NO_FOLLOW_FLAG = constants.O_NOFOLLOW ?? 0;
|
|
74679
75196
|
}
|
|
74680
75197
|
});
|
|
74681
75198
|
|
|
@@ -74906,7 +75423,6 @@ var init_captureHdrFrameShared = __esm({
|
|
|
74906
75423
|
});
|
|
74907
75424
|
|
|
74908
75425
|
// ../producer/src/services/render/stages/captureHdrSequentialLoop.ts
|
|
74909
|
-
import { writeFileSync as writeFileSync17 } from "fs";
|
|
74910
75426
|
import { join as join45 } from "path";
|
|
74911
75427
|
async function runSequentialLayeredFrameLoop(input2) {
|
|
74912
75428
|
const {
|
|
@@ -75027,7 +75543,7 @@ async function runSequentialLayeredFrameLoop(input2) {
|
|
|
75027
75543
|
await compositeHdrFrame(hdrCompositeCtx, normalCanvas, time, stackingInfo, void 0, i2);
|
|
75028
75544
|
addHdrTiming(hdrPerf, "normalCompositeMs", timingStart);
|
|
75029
75545
|
if (debugDumpEnabled && debugDumpDir && i2 % 30 === 0) {
|
|
75030
|
-
|
|
75546
|
+
writeFileExclusiveSync(
|
|
75031
75547
|
join45(debugDumpDir, `frame_${String(i2).padStart(4, "0")}_final_rgb48le.bin`),
|
|
75032
75548
|
normalCanvas
|
|
75033
75549
|
);
|
|
@@ -75063,6 +75579,7 @@ var init_captureHdrSequentialLoop = __esm({
|
|
|
75063
75579
|
"use strict";
|
|
75064
75580
|
init_src2();
|
|
75065
75581
|
init_renderOrchestrator();
|
|
75582
|
+
init_shared();
|
|
75066
75583
|
init_captureHdrFrameShared();
|
|
75067
75584
|
init_shared();
|
|
75068
75585
|
}
|
|
@@ -75270,7 +75787,6 @@ var init_shaderTransitionWorkerPool = __esm({
|
|
|
75270
75787
|
});
|
|
75271
75788
|
|
|
75272
75789
|
// ../producer/src/services/render/stages/captureHdrHybridLoop.ts
|
|
75273
|
-
import { writeFileSync as writeFileSync18 } from "fs";
|
|
75274
75790
|
import { join as join47 } from "path";
|
|
75275
75791
|
async function runHybridLayeredFrameLoop(input2) {
|
|
75276
75792
|
const {
|
|
@@ -75465,7 +75981,7 @@ async function runHybridLayeredFrameLoop(input2) {
|
|
|
75465
75981
|
await compositeHdrFrame(wctx, canvas, time, stackingInfo, void 0, i2);
|
|
75466
75982
|
addHdrTiming(hdrPerf, "normalCompositeMs", timingStart);
|
|
75467
75983
|
if (debugDumpEnabled && debugDumpDir && i2 % 30 === 0) {
|
|
75468
|
-
|
|
75984
|
+
writeFileExclusiveSync(
|
|
75469
75985
|
join47(debugDumpDir, `frame_${String(i2).padStart(4, "0")}_final_rgb48le.bin`),
|
|
75470
75986
|
canvas
|
|
75471
75987
|
);
|
|
@@ -75501,6 +76017,7 @@ var init_captureHdrHybridLoop = __esm({
|
|
|
75501
76017
|
"use strict";
|
|
75502
76018
|
init_src2();
|
|
75503
76019
|
init_renderOrchestrator();
|
|
76020
|
+
init_shared();
|
|
75504
76021
|
init_shaderTransitionWorkerPool();
|
|
75505
76022
|
init_captureHdrFrameShared();
|
|
75506
76023
|
init_shared();
|
|
@@ -75781,6 +76298,9 @@ async function runCaptureHdrStage(input2) {
|
|
|
75781
76298
|
}
|
|
75782
76299
|
captureDurationMs = Date.now() - stageStart;
|
|
75783
76300
|
encodeMs = hdrEncodeResult.durationMs;
|
|
76301
|
+
} catch (error) {
|
|
76302
|
+
lastBrowserConsole = domSession.browserConsoleBuffer;
|
|
76303
|
+
throw wrapCaptureStageError(error, lastBrowserConsole);
|
|
75784
76304
|
} finally {
|
|
75785
76305
|
if (hdrEncoder && !hdrEncoderClosed) {
|
|
75786
76306
|
try {
|
|
@@ -75821,6 +76341,7 @@ var init_captureHdrStage = __esm({
|
|
|
75821
76341
|
init_captureHdrFrameShared();
|
|
75822
76342
|
init_captureHdrSequentialLoop();
|
|
75823
76343
|
init_captureHdrHybridLoop();
|
|
76344
|
+
init_captureStageError();
|
|
75824
76345
|
}
|
|
75825
76346
|
});
|
|
75826
76347
|
|
|
@@ -75965,13 +76486,14 @@ var init_assembleStage = __esm({
|
|
|
75965
76486
|
import {
|
|
75966
76487
|
existsSync as existsSync40,
|
|
75967
76488
|
mkdirSync as mkdirSync24,
|
|
76489
|
+
mkdtempSync as mkdtempSync3,
|
|
75968
76490
|
readFileSync as readFileSync29,
|
|
75969
76491
|
readSync,
|
|
75970
|
-
closeSync,
|
|
76492
|
+
closeSync as closeSync2,
|
|
75971
76493
|
readdirSync as readdirSync16,
|
|
75972
76494
|
rmSync as rmSync9,
|
|
75973
|
-
statSync as
|
|
75974
|
-
writeFileSync as
|
|
76495
|
+
statSync as statSync11,
|
|
76496
|
+
writeFileSync as writeFileSync17,
|
|
75975
76497
|
copyFileSync as copyFileSync4,
|
|
75976
76498
|
appendFileSync
|
|
75977
76499
|
} from "fs";
|
|
@@ -75993,7 +76515,7 @@ function sampleDirectoryBytes(dir) {
|
|
|
75993
76515
|
for (const name of entries2) {
|
|
75994
76516
|
const full = join50(current, name);
|
|
75995
76517
|
try {
|
|
75996
|
-
const st3 =
|
|
76518
|
+
const st3 = statSync11(full);
|
|
75997
76519
|
if (st3.isDirectory()) {
|
|
75998
76520
|
stack.push(full);
|
|
75999
76521
|
} else if (st3.isFile()) {
|
|
@@ -76005,6 +76527,24 @@ function sampleDirectoryBytes(dir) {
|
|
|
76005
76527
|
}
|
|
76006
76528
|
return total;
|
|
76007
76529
|
}
|
|
76530
|
+
function summarizeExtractionObservability(extractionResult, videoCount) {
|
|
76531
|
+
const extracted = extractionResult?.extracted ?? [];
|
|
76532
|
+
const totalFramesExtracted = extractionResult?.totalFramesExtracted ?? 0;
|
|
76533
|
+
const maxFramesPerVideo = extracted.reduce((max, item) => Math.max(max, item.totalFrames), 0);
|
|
76534
|
+
const phaseBreakdown = extractionResult?.phaseBreakdown;
|
|
76535
|
+
return {
|
|
76536
|
+
videoCount,
|
|
76537
|
+
extractedVideoCount: extracted.length,
|
|
76538
|
+
totalFramesExtracted,
|
|
76539
|
+
maxFramesPerVideo,
|
|
76540
|
+
avgFramesPerExtractedVideo: extracted.length > 0 ? Math.round(totalFramesExtracted / extracted.length) : void 0,
|
|
76541
|
+
vfrProbeMs: phaseBreakdown?.vfrProbeMs,
|
|
76542
|
+
vfrPreflightMs: phaseBreakdown?.vfrPreflightMs,
|
|
76543
|
+
vfrPreflightCount: phaseBreakdown?.vfrPreflightCount,
|
|
76544
|
+
cacheHits: phaseBreakdown?.cacheHits,
|
|
76545
|
+
cacheMisses: phaseBreakdown?.cacheMisses
|
|
76546
|
+
};
|
|
76547
|
+
}
|
|
76008
76548
|
function countNonZeroAlpha(rgba) {
|
|
76009
76549
|
let n = 0;
|
|
76010
76550
|
for (let p2 = 3; p2 < rgba.length; p2 += 4) {
|
|
@@ -76243,7 +76783,7 @@ function cropRgb48le(src, srcW, srcH, cropX, cropY, cropW, cropH) {
|
|
|
76243
76783
|
}
|
|
76244
76784
|
function closeHdrVideoFrameSource(source, log2) {
|
|
76245
76785
|
try {
|
|
76246
|
-
|
|
76786
|
+
closeSync2(source.fd);
|
|
76247
76787
|
} catch (err) {
|
|
76248
76788
|
log2?.warn("Failed to close HDR raw frame file", {
|
|
76249
76789
|
rawPath: source.rawPath,
|
|
@@ -76572,7 +77112,7 @@ async function compositeHdrFrame(ctx, canvas, time, fullStacking, elementFilter,
|
|
|
76572
77112
|
const after2 = countNonZeroRgb48(canvas);
|
|
76573
77113
|
const dumpName = `frame_${String(debugFrameIndex).padStart(4, "0")}_layer_${String(layerIdx).padStart(2, "0")}_dom.png`;
|
|
76574
77114
|
const dumpPath = join50(debugDumpDir, dumpName);
|
|
76575
|
-
|
|
77115
|
+
writeFileExclusiveSync(dumpPath, domPng);
|
|
76576
77116
|
log2.info("[diag] dom layer blit", {
|
|
76577
77117
|
frame: debugFrameIndex,
|
|
76578
77118
|
layerIdx,
|
|
@@ -76659,7 +77199,9 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76659
77199
|
const moduleDir = dirname15(fileURLToPath4(import.meta.url));
|
|
76660
77200
|
const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve21(process.env.PRODUCER_RENDERS_DIR, "..") : resolve21(moduleDir, "../..");
|
|
76661
77201
|
const debugDir = join50(producerRoot, ".debug");
|
|
76662
|
-
const
|
|
77202
|
+
const outputDir = dirname15(outputPath);
|
|
77203
|
+
if (!existsSync40(outputDir)) mkdirSync24(outputDir, { recursive: true });
|
|
77204
|
+
const workDir = job.config.debug ? join50(debugDir, job.id) : mkdtempSync3(join50(outputDir, `work-${job.id}-`));
|
|
76663
77205
|
const pipelineStart = Date.now();
|
|
76664
77206
|
const log2 = job.config.logger ?? defaultLogger;
|
|
76665
77207
|
let fileServer = null;
|
|
@@ -76674,6 +77216,11 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76674
77216
|
let hdrPerf;
|
|
76675
77217
|
const perfOutputPath = join50(workDir, "perf-summary.json");
|
|
76676
77218
|
const cfg = { ...job.config.producerConfig ?? resolveConfig() };
|
|
77219
|
+
const observability = new RenderObservabilityRecorder({
|
|
77220
|
+
pipelineStartMs: pipelineStart,
|
|
77221
|
+
log: log2,
|
|
77222
|
+
renderJobId: job.id
|
|
77223
|
+
});
|
|
76677
77224
|
const outputFormat = job.config.format ?? "mp4";
|
|
76678
77225
|
const isWebm = outputFormat === "webm";
|
|
76679
77226
|
const isMov = outputFormat === "mov";
|
|
@@ -76681,6 +77228,20 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76681
77228
|
const needsAlpha = isWebm || isMov || isPngSequence;
|
|
76682
77229
|
const enableChunkedEncode = cfg.enableChunkedEncode;
|
|
76683
77230
|
const chunkedEncodeSize = cfg.chunkSizeFrames;
|
|
77231
|
+
const captureObservability = {
|
|
77232
|
+
forceScreenshot: Boolean(cfg.forceScreenshot),
|
|
77233
|
+
captureMode: cfg.forceScreenshot ? "screenshot" : "beginframe",
|
|
77234
|
+
browserGpuMode: cfg.browserGpuMode,
|
|
77235
|
+
protocolTimeoutMs: cfg.protocolTimeout,
|
|
77236
|
+
pageNavigationTimeoutMs: cfg.pageNavigationTimeout,
|
|
77237
|
+
playerReadyTimeoutMs: cfg.playerReadyTimeout
|
|
77238
|
+
};
|
|
77239
|
+
let extractionObservability;
|
|
77240
|
+
let compositionHash;
|
|
77241
|
+
const updateCaptureObservability = (patch) => {
|
|
77242
|
+
Object.assign(captureObservability, patch);
|
|
77243
|
+
captureObservability.captureMode = captureObservability.forceScreenshot ? "screenshot" : "beginframe";
|
|
77244
|
+
};
|
|
76684
77245
|
let memSampler = null;
|
|
76685
77246
|
try {
|
|
76686
77247
|
memSampler = createMemorySampler();
|
|
@@ -76705,6 +77266,16 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76705
77266
|
pageNavigationTimeout: cfg.pageNavigationTimeout,
|
|
76706
77267
|
playerReadyTimeout: cfg.playerReadyTimeout
|
|
76707
77268
|
});
|
|
77269
|
+
observability.checkpoint("pipeline", "started", {
|
|
77270
|
+
format: outputFormat,
|
|
77271
|
+
quality: job.config.quality,
|
|
77272
|
+
browserGpuMode: cfg.browserGpuMode,
|
|
77273
|
+
forceScreenshot: Boolean(cfg.forceScreenshot),
|
|
77274
|
+
protocolTimeoutMs: cfg.protocolTimeout,
|
|
77275
|
+
pageNavigationTimeoutMs: cfg.pageNavigationTimeout,
|
|
77276
|
+
playerReadyTimeoutMs: cfg.playerReadyTimeout,
|
|
77277
|
+
requestedWorkers: job.config.workers ?? "auto"
|
|
77278
|
+
});
|
|
76708
77279
|
if (!existsSync40(workDir)) mkdirSync24(workDir, { recursive: true });
|
|
76709
77280
|
if (job.config.debug) {
|
|
76710
77281
|
const logPath = join50(workDir, "render.log");
|
|
@@ -76734,7 +77305,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76734
77305
|
`Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
|
|
76735
77306
|
);
|
|
76736
77307
|
}
|
|
76737
|
-
|
|
77308
|
+
writeFileSync17(wrapperPath, standaloneHtml, "utf-8");
|
|
76738
77309
|
htmlPath = wrapperPath;
|
|
76739
77310
|
log2.info("Extracted standalone entry from index.html host context", {
|
|
76740
77311
|
entryFile
|
|
@@ -76742,46 +77313,70 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76742
77313
|
}
|
|
76743
77314
|
const stage1Start = Date.now();
|
|
76744
77315
|
updateJobStatus(job, "preprocessing", "Compiling composition", 5, onProgress);
|
|
76745
|
-
const compileResult = await
|
|
76746
|
-
|
|
76747
|
-
|
|
76748
|
-
|
|
76749
|
-
|
|
76750
|
-
|
|
76751
|
-
|
|
76752
|
-
|
|
76753
|
-
|
|
76754
|
-
|
|
76755
|
-
|
|
77316
|
+
const compileResult = await observeRenderStage(
|
|
77317
|
+
observability,
|
|
77318
|
+
"compile",
|
|
77319
|
+
{ needsAlpha },
|
|
77320
|
+
() => runCompileStage({
|
|
77321
|
+
projectDir,
|
|
77322
|
+
workDir,
|
|
77323
|
+
htmlPath,
|
|
77324
|
+
entryFile,
|
|
77325
|
+
job,
|
|
77326
|
+
cfg,
|
|
77327
|
+
needsAlpha,
|
|
77328
|
+
log: log2,
|
|
77329
|
+
assertNotAborted
|
|
77330
|
+
})
|
|
77331
|
+
);
|
|
76756
77332
|
let compiled = compileResult.compiled;
|
|
77333
|
+
compositionHash = computeCompositionObservabilityHash(compiled.html);
|
|
76757
77334
|
const composition = compileResult.composition;
|
|
76758
77335
|
const { deviceScaleFactor, outputWidth, outputHeight } = compileResult;
|
|
76759
77336
|
const { width, height } = composition;
|
|
76760
77337
|
perfStages.compileOnlyMs = compileResult.compileOnlyMs;
|
|
76761
77338
|
let captureForceScreenshot = compileResult.forceScreenshot;
|
|
77339
|
+
updateCaptureObservability({ forceScreenshot: captureForceScreenshot });
|
|
77340
|
+
observability.checkpoint("compile", "composition metadata resolved", {
|
|
77341
|
+
width,
|
|
77342
|
+
height,
|
|
77343
|
+
videoCount: composition.videos.length,
|
|
77344
|
+
audioCount: composition.audios.length,
|
|
77345
|
+
imageCount: composition.images.length,
|
|
77346
|
+
deviceScaleFactor,
|
|
77347
|
+
forceScreenshot: captureForceScreenshot,
|
|
77348
|
+
compositionHash
|
|
77349
|
+
});
|
|
76762
77350
|
if (cfg.lowMemoryMode) {
|
|
76763
77351
|
captureForceScreenshot = true;
|
|
77352
|
+
updateCaptureObservability({ forceScreenshot: captureForceScreenshot });
|
|
76764
77353
|
log2.info(
|
|
76765
77354
|
"[Render] Low-memory render profile active \u2014 screenshot capture, auto-worker calibration skipped" + (job.config.workers === void 0 ? ", pinned to 1 worker" : "") + ". Override with --no-low-memory-mode or PRODUCER_LOW_MEMORY_MODE=false.",
|
|
76766
77355
|
{ totalMemMb: getSystemTotalMb(), thresholdMb: LOW_MEMORY_TOTAL_MB_THRESHOLD }
|
|
76767
77356
|
);
|
|
76768
77357
|
}
|
|
76769
|
-
const probeResult = await
|
|
76770
|
-
|
|
76771
|
-
|
|
76772
|
-
|
|
76773
|
-
|
|
76774
|
-
|
|
76775
|
-
|
|
76776
|
-
|
|
76777
|
-
|
|
76778
|
-
|
|
76779
|
-
|
|
76780
|
-
|
|
76781
|
-
|
|
76782
|
-
|
|
76783
|
-
|
|
77358
|
+
const probeResult = await observeRenderStage(
|
|
77359
|
+
observability,
|
|
77360
|
+
"browser_probe",
|
|
77361
|
+
{ forceScreenshot: captureForceScreenshot },
|
|
77362
|
+
() => runProbeStage({
|
|
77363
|
+
projectDir,
|
|
77364
|
+
workDir,
|
|
77365
|
+
job,
|
|
77366
|
+
cfg,
|
|
77367
|
+
forceScreenshot: captureForceScreenshot,
|
|
77368
|
+
log: log2,
|
|
77369
|
+
assertNotAborted,
|
|
77370
|
+
compiled,
|
|
77371
|
+
composition,
|
|
77372
|
+
width,
|
|
77373
|
+
height,
|
|
77374
|
+
needsAlpha,
|
|
77375
|
+
deviceScaleFactor
|
|
77376
|
+
})
|
|
77377
|
+
);
|
|
76784
77378
|
compiled = probeResult.compiled;
|
|
77379
|
+
compositionHash = computeCompositionObservabilityHash(compiled.html);
|
|
76785
77380
|
fileServer = probeResult.fileServer;
|
|
76786
77381
|
probeSession = probeResult.probeSession;
|
|
76787
77382
|
lastBrowserConsole = probeResult.lastBrowserConsole;
|
|
@@ -76790,18 +77385,28 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76790
77385
|
const totalFrames = probeResult.totalFrames;
|
|
76791
77386
|
perfStages.browserProbeMs = probeResult.browserProbeMs;
|
|
76792
77387
|
perfStages.compileMs = Date.now() - stage1Start;
|
|
77388
|
+
observability.checkpoint("browser_probe", "duration resolved", {
|
|
77389
|
+
durationSeconds: probeResult.duration,
|
|
77390
|
+
totalFrames,
|
|
77391
|
+
compositionHash
|
|
77392
|
+
});
|
|
76793
77393
|
updateJobStatus(job, "preprocessing", "Extracting video frames", 10, onProgress);
|
|
76794
77394
|
const compiledDir = join50(workDir, "compiled");
|
|
76795
|
-
const extractResult = await
|
|
76796
|
-
|
|
76797
|
-
|
|
76798
|
-
|
|
76799
|
-
|
|
76800
|
-
|
|
76801
|
-
|
|
76802
|
-
|
|
76803
|
-
|
|
76804
|
-
|
|
77395
|
+
const extractResult = await observeRenderStage(
|
|
77396
|
+
observability,
|
|
77397
|
+
"video_extract",
|
|
77398
|
+
{ videoCount: composition.videos.length },
|
|
77399
|
+
() => runExtractVideosStage({
|
|
77400
|
+
projectDir,
|
|
77401
|
+
compiledDir,
|
|
77402
|
+
job,
|
|
77403
|
+
cfg,
|
|
77404
|
+
log: log2,
|
|
77405
|
+
composition,
|
|
77406
|
+
abortSignal,
|
|
77407
|
+
assertNotAborted
|
|
77408
|
+
})
|
|
77409
|
+
);
|
|
76805
77410
|
const {
|
|
76806
77411
|
extractionResult,
|
|
76807
77412
|
frameLookup,
|
|
@@ -76815,6 +77420,21 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76815
77420
|
imageColorSpaces
|
|
76816
77421
|
} = extractResult;
|
|
76817
77422
|
perfStages.videoExtractMs = extractResult.videoExtractMs;
|
|
77423
|
+
extractionObservability = summarizeExtractionObservability(
|
|
77424
|
+
extractionResult,
|
|
77425
|
+
composition.videos.length
|
|
77426
|
+
);
|
|
77427
|
+
observability.checkpoint("video_extract", "frames resolved", {
|
|
77428
|
+
videoCount: extractionObservability.videoCount,
|
|
77429
|
+
extractedVideoCount: extractionObservability.extractedVideoCount,
|
|
77430
|
+
totalFramesExtracted: extractionObservability.totalFramesExtracted,
|
|
77431
|
+
maxFramesPerVideo: extractionObservability.maxFramesPerVideo,
|
|
77432
|
+
avgFramesPerExtractedVideo: extractionObservability.avgFramesPerExtractedVideo ?? null,
|
|
77433
|
+
vfrPreflightCount: extractionObservability.vfrPreflightCount ?? null,
|
|
77434
|
+
vfrPreflightMs: extractionObservability.vfrPreflightMs ?? null,
|
|
77435
|
+
cacheHits: extractionObservability.cacheHits ?? null,
|
|
77436
|
+
cacheMisses: extractionObservability.cacheMisses ?? null
|
|
77437
|
+
});
|
|
76818
77438
|
const effectiveHdr = resolveEffectiveHdrMode({
|
|
76819
77439
|
hdrMode: job.config.hdrMode,
|
|
76820
77440
|
outputFormat,
|
|
@@ -76822,28 +77442,52 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76822
77442
|
imageColorSpaces,
|
|
76823
77443
|
log: log2
|
|
76824
77444
|
});
|
|
76825
|
-
|
|
76826
|
-
|
|
76827
|
-
|
|
76828
|
-
|
|
76829
|
-
|
|
76830
|
-
duration: job.duration,
|
|
76831
|
-
audios: composition.audios,
|
|
76832
|
-
abortSignal,
|
|
76833
|
-
assertNotAborted
|
|
77445
|
+
observability.checkpoint("hdr_detection", "resolved", {
|
|
77446
|
+
requestedHdrMode: job.config.hdrMode ?? "auto",
|
|
77447
|
+
effectiveHdr: effectiveHdr ? effectiveHdr.transfer : "sdr",
|
|
77448
|
+
nativeHdrVideoCount: nativeHdrVideoIds.size,
|
|
77449
|
+
nativeHdrImageCount: nativeHdrImageIds.size
|
|
76834
77450
|
});
|
|
77451
|
+
updateJobStatus(job, "preprocessing", "Processing audio tracks", 20, onProgress);
|
|
77452
|
+
const audioResult = await observeRenderStage(
|
|
77453
|
+
observability,
|
|
77454
|
+
"audio_process",
|
|
77455
|
+
{ audioCount: composition.audios.length },
|
|
77456
|
+
() => runAudioStage({
|
|
77457
|
+
projectDir,
|
|
77458
|
+
workDir,
|
|
77459
|
+
compiledDir,
|
|
77460
|
+
duration: probeResult.duration,
|
|
77461
|
+
audios: composition.audios,
|
|
77462
|
+
abortSignal,
|
|
77463
|
+
assertNotAborted
|
|
77464
|
+
})
|
|
77465
|
+
);
|
|
76835
77466
|
const { audioOutputPath, hasAudio } = audioResult;
|
|
76836
77467
|
perfStages.audioProcessMs = audioResult.audioProcessMs;
|
|
76837
77468
|
const stage4Start = Date.now();
|
|
76838
77469
|
updateJobStatus(job, "rendering", "Starting frame capture", 25, onProgress);
|
|
76839
77470
|
if (!fileServer) {
|
|
76840
|
-
|
|
76841
|
-
|
|
76842
|
-
|
|
76843
|
-
|
|
76844
|
-
|
|
76845
|
-
|
|
76846
|
-
|
|
77471
|
+
const fileServerStart = observability.stageStart("file_server", { reused: false });
|
|
77472
|
+
try {
|
|
77473
|
+
fileServer = await createFileServer2({
|
|
77474
|
+
projectDir,
|
|
77475
|
+
compiledDir: join50(workDir, "compiled"),
|
|
77476
|
+
port: 0,
|
|
77477
|
+
preHeadScripts: [VIRTUAL_TIME_SHIM]
|
|
77478
|
+
});
|
|
77479
|
+
assertNotAborted();
|
|
77480
|
+
observability.stageEnd("file_server", fileServerStart);
|
|
77481
|
+
} catch (error) {
|
|
77482
|
+
observability.stageError("file_server", fileServerStart, error);
|
|
77483
|
+
throw error;
|
|
77484
|
+
}
|
|
77485
|
+
} else {
|
|
77486
|
+
observability.checkpoint("file_server", "reused probe file server");
|
|
77487
|
+
}
|
|
77488
|
+
const activeFileServer = fileServer;
|
|
77489
|
+
if (!activeFileServer) {
|
|
77490
|
+
throw new Error("File server failed to initialize before frame capture");
|
|
76847
77491
|
}
|
|
76848
77492
|
const framesDir = join50(workDir, "captured-frames");
|
|
76849
77493
|
if (!existsSync40(framesDir)) mkdirSync24(framesDir, { recursive: true });
|
|
@@ -76872,25 +77516,43 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76872
77516
|
(r2) => r2.code === "htmlInCanvas"
|
|
76873
77517
|
);
|
|
76874
77518
|
if (job.config.workers === void 0 && totalFrames >= 60 && !htmlInCanvasDetected && !cfg.lowMemoryMode) {
|
|
76875
|
-
const outcome = await
|
|
76876
|
-
|
|
76877
|
-
|
|
76878
|
-
|
|
76879
|
-
|
|
76880
|
-
|
|
76881
|
-
|
|
76882
|
-
|
|
76883
|
-
|
|
76884
|
-
|
|
76885
|
-
|
|
76886
|
-
|
|
76887
|
-
|
|
77519
|
+
const outcome = await observeRenderStage(
|
|
77520
|
+
observability,
|
|
77521
|
+
"capture_calibration",
|
|
77522
|
+
{ forceScreenshot: captureForceScreenshot },
|
|
77523
|
+
() => runCaptureCalibration({
|
|
77524
|
+
cfg,
|
|
77525
|
+
fileServer: activeFileServer,
|
|
77526
|
+
workDir,
|
|
77527
|
+
log: log2,
|
|
77528
|
+
job,
|
|
77529
|
+
totalFrames,
|
|
77530
|
+
forceScreenshot: captureForceScreenshot,
|
|
77531
|
+
probeSession,
|
|
77532
|
+
buildCaptureOptions,
|
|
77533
|
+
createRenderVideoFrameInjector,
|
|
77534
|
+
assertNotAborted
|
|
77535
|
+
})
|
|
77536
|
+
);
|
|
76888
77537
|
captureCalibration = outcome.calibration;
|
|
76889
77538
|
captureForceScreenshot = outcome.forceScreenshot;
|
|
77539
|
+
updateCaptureObservability({ forceScreenshot: captureForceScreenshot });
|
|
76890
77540
|
probeSession = outcome.probeSession;
|
|
76891
77541
|
if (outcome.lastBrowserConsole.length > 0) {
|
|
76892
77542
|
lastBrowserConsole = outcome.lastBrowserConsole;
|
|
76893
77543
|
}
|
|
77544
|
+
observability.checkpoint("capture_calibration", "resolved", {
|
|
77545
|
+
forceScreenshot: captureForceScreenshot,
|
|
77546
|
+
multiplier: outcome.calibration?.estimate.multiplier ?? null,
|
|
77547
|
+
p95Ms: outcome.calibration?.estimate.p95Ms ?? null
|
|
77548
|
+
});
|
|
77549
|
+
} else {
|
|
77550
|
+
observability.checkpoint("capture_calibration", "skipped", {
|
|
77551
|
+
requestedWorkers: job.config.workers ?? "auto",
|
|
77552
|
+
totalFrames,
|
|
77553
|
+
htmlInCanvasDetected,
|
|
77554
|
+
lowMemoryMode: Boolean(cfg.lowMemoryMode)
|
|
77555
|
+
});
|
|
76894
77556
|
}
|
|
76895
77557
|
let workerCount = resolveRenderWorkerCount(
|
|
76896
77558
|
totalFrames,
|
|
@@ -76900,6 +77562,8 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76900
77562
|
log2,
|
|
76901
77563
|
captureCalibration?.estimate
|
|
76902
77564
|
);
|
|
77565
|
+
updateCaptureObservability({ workerCount });
|
|
77566
|
+
observability.checkpoint("worker_resolution", "resolved", { workerCount });
|
|
76903
77567
|
if (workerCount > 1 && probeSession) {
|
|
76904
77568
|
lastBrowserConsole = probeSession.browserConsoleBuffer;
|
|
76905
77569
|
await closeCaptureSession(probeSession);
|
|
@@ -76927,7 +77591,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76927
77591
|
const hasHdrContent = Boolean(effectiveHdr && nativeHdrIds.size > 0);
|
|
76928
77592
|
const usePageSideCompositingForTransitions = cfg.enablePageSideCompositing && compiled.hasShaderTransitions && !hasHdrContent && !isPngSequence && !needsAlpha;
|
|
76929
77593
|
if (usePageSideCompositingForTransitions) {
|
|
76930
|
-
|
|
77594
|
+
activeFileServer.addPreHeadScript(HF_PAGE_SIDE_COMPOSITING_STUB);
|
|
76931
77595
|
log2.info(
|
|
76932
77596
|
"[Render] Page-side compositing enabled \u2014 bypassing Node-side layered shader-blend path. Engine will capture one opaque RGB frame per output frame."
|
|
76933
77597
|
);
|
|
@@ -76937,6 +77601,24 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76937
77601
|
hasShaderTransitions: compiled.hasShaderTransitions,
|
|
76938
77602
|
isPngSequence
|
|
76939
77603
|
});
|
|
77604
|
+
updateCaptureObservability({
|
|
77605
|
+
workerCount,
|
|
77606
|
+
useStreamingEncode,
|
|
77607
|
+
useLayeredComposite,
|
|
77608
|
+
usePageSideCompositing: usePageSideCompositingForTransitions,
|
|
77609
|
+
hasHdrContent,
|
|
77610
|
+
forceScreenshot: captureForceScreenshot
|
|
77611
|
+
});
|
|
77612
|
+
observability.checkpoint("capture_strategy", "resolved", {
|
|
77613
|
+
workerCount,
|
|
77614
|
+
forceScreenshot: captureForceScreenshot,
|
|
77615
|
+
useStreamingEncode,
|
|
77616
|
+
useLayeredComposite,
|
|
77617
|
+
usePageSideCompositing: usePageSideCompositingForTransitions,
|
|
77618
|
+
hasHdrContent,
|
|
77619
|
+
hasShaderTransitions: compiled.hasShaderTransitions,
|
|
77620
|
+
isPngSequence
|
|
77621
|
+
});
|
|
76940
77622
|
const encoderHdr = hasHdrContent ? effectiveHdr : void 0;
|
|
76941
77623
|
const presetFormat = isPngSequence ? "mp4" : outputFormat;
|
|
76942
77624
|
const preset = getEncoderPreset(job.config.quality, presetFormat, encoderHdr);
|
|
@@ -76950,132 +77632,157 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
76950
77632
|
job.framesRendered = 0;
|
|
76951
77633
|
if (useLayeredComposite) {
|
|
76952
77634
|
captureForceScreenshot = true;
|
|
76953
|
-
|
|
76954
|
-
|
|
76955
|
-
|
|
76956
|
-
|
|
76957
|
-
|
|
76958
|
-
|
|
76959
|
-
compiledDir,
|
|
76960
|
-
framesDir,
|
|
76961
|
-
videoOnlyPath,
|
|
76962
|
-
width,
|
|
76963
|
-
height,
|
|
76964
|
-
totalFrames,
|
|
76965
|
-
composition,
|
|
76966
|
-
hasHdrContent,
|
|
76967
|
-
effectiveHdr,
|
|
76968
|
-
nativeHdrVideoIds,
|
|
76969
|
-
nativeHdrImageIds,
|
|
76970
|
-
videoTransfers,
|
|
76971
|
-
imageTransfers,
|
|
76972
|
-
hdrImageSrcPaths,
|
|
76973
|
-
preset,
|
|
76974
|
-
effectiveQuality,
|
|
76975
|
-
effectiveBitrate,
|
|
76976
|
-
fileServer,
|
|
76977
|
-
buildCaptureOptions,
|
|
76978
|
-
createRenderVideoFrameInjector,
|
|
76979
|
-
hdrDiagnostics,
|
|
76980
|
-
abortSignal,
|
|
76981
|
-
assertNotAborted,
|
|
76982
|
-
onProgress
|
|
76983
|
-
});
|
|
76984
|
-
lastBrowserConsole = hdrRes.lastBrowserConsole;
|
|
76985
|
-
hdrPerf = hdrRes.hdrPerf;
|
|
76986
|
-
perfStages.captureMs = hdrRes.captureDurationMs;
|
|
76987
|
-
perfStages.encodeMs = hdrRes.encodeMs;
|
|
76988
|
-
} else {
|
|
76989
|
-
let streamingHandled = false;
|
|
76990
|
-
if (useStreamingEncode) {
|
|
76991
|
-
const streamingRes = await runCaptureStreamingStage({
|
|
76992
|
-
fileServer,
|
|
76993
|
-
workDir,
|
|
76994
|
-
framesDir,
|
|
76995
|
-
videoOnlyPath,
|
|
77635
|
+
updateCaptureObservability({ forceScreenshot: captureForceScreenshot });
|
|
77636
|
+
const hdrRes = await observeRenderStage(
|
|
77637
|
+
observability,
|
|
77638
|
+
"capture_hdr_layered",
|
|
77639
|
+
{ workerCount, forceScreenshot: captureForceScreenshot, hasHdrContent },
|
|
77640
|
+
() => runCaptureHdrStage({
|
|
76996
77641
|
job,
|
|
76997
|
-
totalFrames,
|
|
76998
77642
|
cfg,
|
|
76999
77643
|
forceScreenshot: captureForceScreenshot,
|
|
77000
77644
|
log: log2,
|
|
77001
|
-
|
|
77002
|
-
|
|
77003
|
-
|
|
77004
|
-
|
|
77005
|
-
|
|
77006
|
-
|
|
77007
|
-
|
|
77008
|
-
|
|
77009
|
-
|
|
77010
|
-
|
|
77011
|
-
|
|
77012
|
-
|
|
77013
|
-
|
|
77014
|
-
|
|
77015
|
-
|
|
77016
|
-
|
|
77645
|
+
projectDir,
|
|
77646
|
+
compiledDir,
|
|
77647
|
+
framesDir,
|
|
77648
|
+
videoOnlyPath,
|
|
77649
|
+
width,
|
|
77650
|
+
height,
|
|
77651
|
+
totalFrames,
|
|
77652
|
+
composition,
|
|
77653
|
+
hasHdrContent,
|
|
77654
|
+
effectiveHdr,
|
|
77655
|
+
nativeHdrVideoIds,
|
|
77656
|
+
nativeHdrImageIds,
|
|
77657
|
+
videoTransfers,
|
|
77658
|
+
imageTransfers,
|
|
77659
|
+
hdrImageSrcPaths,
|
|
77660
|
+
preset,
|
|
77661
|
+
effectiveQuality,
|
|
77662
|
+
effectiveBitrate,
|
|
77663
|
+
fileServer: activeFileServer,
|
|
77017
77664
|
buildCaptureOptions,
|
|
77018
77665
|
createRenderVideoFrameInjector,
|
|
77666
|
+
hdrDiagnostics,
|
|
77019
77667
|
abortSignal,
|
|
77020
77668
|
assertNotAborted,
|
|
77021
77669
|
onProgress
|
|
77022
|
-
})
|
|
77670
|
+
})
|
|
77671
|
+
);
|
|
77672
|
+
lastBrowserConsole = hdrRes.lastBrowserConsole;
|
|
77673
|
+
hdrPerf = hdrRes.hdrPerf;
|
|
77674
|
+
perfStages.captureMs = hdrRes.captureDurationMs;
|
|
77675
|
+
perfStages.encodeMs = hdrRes.encodeMs;
|
|
77676
|
+
} else {
|
|
77677
|
+
let streamingHandled = false;
|
|
77678
|
+
if (useStreamingEncode) {
|
|
77679
|
+
const streamingRes = await observeRenderStage(
|
|
77680
|
+
observability,
|
|
77681
|
+
"capture_streaming",
|
|
77682
|
+
{ workerCount, forceScreenshot: captureForceScreenshot },
|
|
77683
|
+
() => runCaptureStreamingStage({
|
|
77684
|
+
fileServer: activeFileServer,
|
|
77685
|
+
workDir,
|
|
77686
|
+
framesDir,
|
|
77687
|
+
videoOnlyPath,
|
|
77688
|
+
job,
|
|
77689
|
+
totalFrames,
|
|
77690
|
+
cfg,
|
|
77691
|
+
forceScreenshot: captureForceScreenshot,
|
|
77692
|
+
log: log2,
|
|
77693
|
+
workerCount,
|
|
77694
|
+
probeSession,
|
|
77695
|
+
outputFormat,
|
|
77696
|
+
streamingEncoderOptions: {
|
|
77697
|
+
fps: job.config.fps,
|
|
77698
|
+
width,
|
|
77699
|
+
height,
|
|
77700
|
+
codec: preset.codec,
|
|
77701
|
+
preset: preset.preset,
|
|
77702
|
+
quality: effectiveQuality,
|
|
77703
|
+
bitrate: effectiveBitrate,
|
|
77704
|
+
pixelFormat: preset.pixelFormat,
|
|
77705
|
+
useGpu: job.config.useGpu,
|
|
77706
|
+
imageFormat: captureOptions.format || "jpeg",
|
|
77707
|
+
hdr: preset.hdr
|
|
77708
|
+
},
|
|
77709
|
+
buildCaptureOptions,
|
|
77710
|
+
createRenderVideoFrameInjector,
|
|
77711
|
+
abortSignal,
|
|
77712
|
+
assertNotAborted,
|
|
77713
|
+
onProgress
|
|
77714
|
+
})
|
|
77715
|
+
);
|
|
77023
77716
|
if (streamingRes.success) {
|
|
77024
77717
|
streamingHandled = true;
|
|
77025
77718
|
workerCount = streamingRes.workerCount;
|
|
77719
|
+
updateCaptureObservability({ workerCount });
|
|
77026
77720
|
probeSession = streamingRes.probeSession;
|
|
77027
77721
|
lastBrowserConsole = streamingRes.lastBrowserConsole;
|
|
77028
77722
|
perfStages.captureMs = Date.now() - stage4Start;
|
|
77029
77723
|
perfStages.encodeMs = streamingRes.encodeMs;
|
|
77030
77724
|
} else {
|
|
77031
77725
|
useStreamingEncode = false;
|
|
77726
|
+
updateCaptureObservability({ useStreamingEncode });
|
|
77727
|
+
observability.checkpoint("capture_streaming", "spawn failed; falling back to disk");
|
|
77032
77728
|
}
|
|
77033
77729
|
}
|
|
77034
77730
|
if (!streamingHandled) {
|
|
77035
|
-
const captureRes = await
|
|
77036
|
-
|
|
77037
|
-
|
|
77038
|
-
|
|
77039
|
-
|
|
77040
|
-
|
|
77041
|
-
|
|
77042
|
-
|
|
77043
|
-
|
|
77044
|
-
|
|
77045
|
-
|
|
77046
|
-
|
|
77047
|
-
|
|
77048
|
-
|
|
77049
|
-
|
|
77050
|
-
|
|
77051
|
-
|
|
77052
|
-
|
|
77053
|
-
|
|
77731
|
+
const captureRes = await observeRenderStage(
|
|
77732
|
+
observability,
|
|
77733
|
+
"capture_disk",
|
|
77734
|
+
{ workerCount, forceScreenshot: captureForceScreenshot, needsAlpha },
|
|
77735
|
+
() => runCaptureStage({
|
|
77736
|
+
fileServer: activeFileServer,
|
|
77737
|
+
workDir,
|
|
77738
|
+
framesDir,
|
|
77739
|
+
job,
|
|
77740
|
+
totalFrames,
|
|
77741
|
+
cfg,
|
|
77742
|
+
forceScreenshot: captureForceScreenshot,
|
|
77743
|
+
log: log2,
|
|
77744
|
+
workerCount,
|
|
77745
|
+
probeSession,
|
|
77746
|
+
needsAlpha,
|
|
77747
|
+
captureAttempts,
|
|
77748
|
+
buildCaptureOptions,
|
|
77749
|
+
createRenderVideoFrameInjector,
|
|
77750
|
+
abortSignal,
|
|
77751
|
+
assertNotAborted,
|
|
77752
|
+
onProgress
|
|
77753
|
+
})
|
|
77754
|
+
);
|
|
77054
77755
|
workerCount = captureRes.workerCount;
|
|
77756
|
+
updateCaptureObservability({ workerCount });
|
|
77055
77757
|
probeSession = captureRes.probeSession;
|
|
77056
77758
|
lastBrowserConsole = captureRes.lastBrowserConsole;
|
|
77057
77759
|
perfStages.captureMs = Date.now() - stage4Start;
|
|
77058
|
-
const encodeRes = await
|
|
77059
|
-
|
|
77060
|
-
|
|
77061
|
-
|
|
77062
|
-
|
|
77063
|
-
|
|
77064
|
-
|
|
77065
|
-
|
|
77066
|
-
|
|
77067
|
-
|
|
77068
|
-
|
|
77069
|
-
|
|
77070
|
-
|
|
77071
|
-
|
|
77072
|
-
|
|
77073
|
-
|
|
77074
|
-
|
|
77075
|
-
|
|
77076
|
-
|
|
77077
|
-
|
|
77078
|
-
|
|
77760
|
+
const encodeRes = await observeRenderStage(
|
|
77761
|
+
observability,
|
|
77762
|
+
"encode",
|
|
77763
|
+
{ hasAudio, isPngSequence, chunkedEncode: enableChunkedEncode },
|
|
77764
|
+
() => runEncodeStage({
|
|
77765
|
+
job,
|
|
77766
|
+
log: log2,
|
|
77767
|
+
outputPath,
|
|
77768
|
+
framesDir,
|
|
77769
|
+
videoOnlyPath,
|
|
77770
|
+
width,
|
|
77771
|
+
height,
|
|
77772
|
+
needsAlpha,
|
|
77773
|
+
hasAudio,
|
|
77774
|
+
audioOutputPath,
|
|
77775
|
+
isPngSequence,
|
|
77776
|
+
preset,
|
|
77777
|
+
effectiveQuality,
|
|
77778
|
+
effectiveBitrate,
|
|
77779
|
+
enableChunkedEncode,
|
|
77780
|
+
chunkedEncodeSize,
|
|
77781
|
+
abortSignal,
|
|
77782
|
+
assertNotAborted,
|
|
77783
|
+
onProgress
|
|
77784
|
+
})
|
|
77785
|
+
);
|
|
77079
77786
|
perfStages.encodeMs = encodeRes.encodeMs;
|
|
77080
77787
|
}
|
|
77081
77788
|
}
|
|
@@ -77089,22 +77796,36 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
77089
77796
|
fileServer.close();
|
|
77090
77797
|
fileServer = null;
|
|
77091
77798
|
if (!isPngSequence) {
|
|
77092
|
-
const assembleRes = await
|
|
77093
|
-
|
|
77094
|
-
|
|
77095
|
-
|
|
77096
|
-
|
|
77097
|
-
|
|
77098
|
-
|
|
77099
|
-
|
|
77100
|
-
|
|
77101
|
-
|
|
77799
|
+
const assembleRes = await observeRenderStage(
|
|
77800
|
+
observability,
|
|
77801
|
+
"assemble",
|
|
77802
|
+
{ hasAudio },
|
|
77803
|
+
() => runAssembleStage({
|
|
77804
|
+
job,
|
|
77805
|
+
videoOnlyPath,
|
|
77806
|
+
audioOutputPath,
|
|
77807
|
+
outputPath,
|
|
77808
|
+
hasAudio,
|
|
77809
|
+
abortSignal,
|
|
77810
|
+
assertNotAborted,
|
|
77811
|
+
onProgress
|
|
77812
|
+
})
|
|
77813
|
+
);
|
|
77102
77814
|
perfStages.assembleMs = assembleRes.assembleMs;
|
|
77815
|
+
} else {
|
|
77816
|
+
observability.checkpoint("assemble", "skipped for png-sequence");
|
|
77103
77817
|
}
|
|
77104
77818
|
job.outputPath = outputPath;
|
|
77105
77819
|
updateJobStatus(job, "complete", "Render complete", 100, onProgress);
|
|
77106
77820
|
const totalElapsed = Date.now() - pipelineStart;
|
|
77107
77821
|
const tmpPeakBytes = existsSync40(workDir) ? sampleDirectoryBytes(workDir) : 0;
|
|
77822
|
+
observability.checkpoint("pipeline", "completed", { totalElapsedMs: totalElapsed });
|
|
77823
|
+
const observabilitySummary = observability.summary({
|
|
77824
|
+
lastBrowserConsole,
|
|
77825
|
+
capture: captureObservability,
|
|
77826
|
+
extraction: extractionObservability,
|
|
77827
|
+
compositionHash
|
|
77828
|
+
});
|
|
77108
77829
|
const perfSummary = buildRenderPerfSummary({
|
|
77109
77830
|
job,
|
|
77110
77831
|
workerCount,
|
|
@@ -77124,13 +77845,14 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
77124
77845
|
captureAttempts,
|
|
77125
77846
|
hdrDiagnostics,
|
|
77126
77847
|
hdrPerf,
|
|
77848
|
+
observability: observabilitySummary,
|
|
77127
77849
|
peakRssBytes: memSampler.peakRssBytes(),
|
|
77128
77850
|
peakHeapUsedBytes: memSampler.peakHeapUsedBytes()
|
|
77129
77851
|
});
|
|
77130
77852
|
job.perfSummary = perfSummary;
|
|
77131
77853
|
if (job.config.debug) {
|
|
77132
77854
|
try {
|
|
77133
|
-
|
|
77855
|
+
writeFileSync17(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
|
|
77134
77856
|
} catch (err) {
|
|
77135
77857
|
log2.debug("Failed to write perf summary", {
|
|
77136
77858
|
perfOutputPath,
|
|
@@ -77171,6 +77893,14 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
77171
77893
|
throw error instanceof RenderCancelledError ? error : new RenderCancelledError("render_cancelled");
|
|
77172
77894
|
}
|
|
77173
77895
|
const errorMessage = normalizeErrorMessage(error);
|
|
77896
|
+
const carriedBrowserConsole = getCaptureStageBrowserConsole(error);
|
|
77897
|
+
if (carriedBrowserConsole.length > 0) {
|
|
77898
|
+
lastBrowserConsole = [...lastBrowserConsole, ...carriedBrowserConsole].slice(-200);
|
|
77899
|
+
}
|
|
77900
|
+
if (!observability.hasFailure()) {
|
|
77901
|
+
const failureStart = Date.now();
|
|
77902
|
+
observability.stageError(job.currentStage || "pipeline", failureStart, error);
|
|
77903
|
+
}
|
|
77174
77904
|
const isTimeoutError = errorMessage.includes("Waiting failed") || errorMessage.includes("timeout exceeded") || errorMessage.includes("Navigation timeout");
|
|
77175
77905
|
const wasParallel = job.config.workers !== 1;
|
|
77176
77906
|
if (isTimeoutError && wasParallel) {
|
|
@@ -77181,12 +77911,19 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
77181
77911
|
job.error = errorMessage;
|
|
77182
77912
|
updateJobStatus(job, "failed", `Failed: ${errorMessage}`, job.progress, onProgress);
|
|
77183
77913
|
job.failedStage = job.currentStage;
|
|
77914
|
+
const observabilitySummary = observability.summary({
|
|
77915
|
+
lastBrowserConsole,
|
|
77916
|
+
capture: captureObservability,
|
|
77917
|
+
extraction: extractionObservability,
|
|
77918
|
+
compositionHash
|
|
77919
|
+
});
|
|
77184
77920
|
job.errorDetails = buildRenderErrorDetails({
|
|
77185
77921
|
error,
|
|
77186
77922
|
pipelineStartMs: pipelineStart,
|
|
77187
77923
|
lastBrowserConsole,
|
|
77188
77924
|
perfStages,
|
|
77189
|
-
hdrDiagnostics
|
|
77925
|
+
hdrDiagnostics,
|
|
77926
|
+
observability: observabilitySummary
|
|
77190
77927
|
});
|
|
77191
77928
|
log2.info("[Render] Failure summary", {
|
|
77192
77929
|
failedStage: job.currentStage,
|
|
@@ -77196,8 +77933,13 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
77196
77933
|
isTimeout: isTimeoutError,
|
|
77197
77934
|
workers: job.config.workers ?? "auto",
|
|
77198
77935
|
protocolTimeout: cfg.protocolTimeout,
|
|
77936
|
+
observedFailedPhase: observabilitySummary.failedPhase,
|
|
77937
|
+
observedLastPhase: observabilitySummary.lastEvent?.phase,
|
|
77938
|
+
observedLastStatus: observabilitySummary.lastEvent?.status,
|
|
77939
|
+
browserDiagnostics: observabilitySummary.browserDiagnostics,
|
|
77940
|
+
extraction: observabilitySummary.extraction,
|
|
77199
77941
|
browserConsoleErrors: lastBrowserConsole.filter(
|
|
77200
|
-
(l) => l.includes("ERROR") || l.includes("PAGEERROR") || l.includes("REQUESTFAILED") || /\[Browser:HTTP\d{3}\]/.test(l)
|
|
77942
|
+
(l) => l.includes("ERROR") || l.includes("PAGEERROR") || l.includes("REQUESTFAILED") || l.includes("[FrameCapture:NAV]") || /\[Browser:HTTP\d{3}\]/.test(l)
|
|
77201
77943
|
).slice(-5)
|
|
77202
77944
|
});
|
|
77203
77945
|
await cleanupRenderResources({
|
|
@@ -77228,7 +77970,9 @@ var init_renderOrchestrator = __esm({
|
|
|
77228
77970
|
init_errorMessage();
|
|
77229
77971
|
init_hdrMode();
|
|
77230
77972
|
init_perfSummary();
|
|
77973
|
+
init_captureStageError();
|
|
77231
77974
|
init_captureCost();
|
|
77975
|
+
init_observability();
|
|
77232
77976
|
init_hdrPerf();
|
|
77233
77977
|
init_compileStage();
|
|
77234
77978
|
init_probeStage();
|
|
@@ -77279,7 +78023,7 @@ var init_config3 = __esm({
|
|
|
77279
78023
|
});
|
|
77280
78024
|
|
|
77281
78025
|
// ../producer/src/services/hyperframeLint.ts
|
|
77282
|
-
import { existsSync as existsSync41, readFileSync as readFileSync30, statSync as
|
|
78026
|
+
import { existsSync as existsSync41, readFileSync as readFileSync30, statSync as statSync12 } from "fs";
|
|
77283
78027
|
import { resolve as resolve22, join as join51 } from "path";
|
|
77284
78028
|
function isStringRecord(value) {
|
|
77285
78029
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
@@ -77308,7 +78052,7 @@ function pickEntryFile(files, preferredEntryFile) {
|
|
|
77308
78052
|
}
|
|
77309
78053
|
function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
77310
78054
|
const absProjectDir = resolve22(projectDir);
|
|
77311
|
-
if (!existsSync41(absProjectDir) || !
|
|
78055
|
+
if (!existsSync41(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
|
|
77312
78056
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
77313
78057
|
}
|
|
77314
78058
|
const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
|
|
@@ -77319,7 +78063,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
|
77319
78063
|
if (!absoluteEntryPath.startsWith(absProjectDir)) {
|
|
77320
78064
|
return { error: `Entry file must stay inside project directory: ${entryFile}` };
|
|
77321
78065
|
}
|
|
77322
|
-
if (existsSync41(absoluteEntryPath) &&
|
|
78066
|
+
if (existsSync41(absoluteEntryPath) && statSync12(absoluteEntryPath).isFile()) {
|
|
77323
78067
|
return {
|
|
77324
78068
|
entryFile,
|
|
77325
78069
|
html: readFileSync30(absoluteEntryPath, "utf-8"),
|
|
@@ -77419,9 +78163,9 @@ var init_semaphore = __esm({
|
|
|
77419
78163
|
import {
|
|
77420
78164
|
existsSync as existsSync42,
|
|
77421
78165
|
mkdirSync as mkdirSync25,
|
|
77422
|
-
statSync as
|
|
77423
|
-
mkdtempSync as
|
|
77424
|
-
writeFileSync as
|
|
78166
|
+
statSync as statSync13,
|
|
78167
|
+
mkdtempSync as mkdtempSync4,
|
|
78168
|
+
writeFileSync as writeFileSync18,
|
|
77425
78169
|
rmSync as rmSync10,
|
|
77426
78170
|
createReadStream
|
|
77427
78171
|
} from "fs";
|
|
@@ -77513,7 +78257,7 @@ async function prepareRenderBody(body) {
|
|
|
77513
78257
|
const projectDir = typeof body.projectDir === "string" ? body.projectDir : void 0;
|
|
77514
78258
|
if (projectDir) {
|
|
77515
78259
|
const absProjectDir = resolve23(projectDir);
|
|
77516
|
-
if (!existsSync42(absProjectDir) || !
|
|
78260
|
+
if (!existsSync42(absProjectDir) || !statSync13(absProjectDir).isDirectory()) {
|
|
77517
78261
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
77518
78262
|
}
|
|
77519
78263
|
const entry = options.entryFile || "index.html";
|
|
@@ -77542,8 +78286,8 @@ async function prepareRenderBody(body) {
|
|
|
77542
78286
|
}
|
|
77543
78287
|
}
|
|
77544
78288
|
const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir4();
|
|
77545
|
-
const tempProjectDir =
|
|
77546
|
-
|
|
78289
|
+
const tempProjectDir = mkdtempSync4(join52(tempRoot, "producer-project-"));
|
|
78290
|
+
writeFileSync18(join52(tempProjectDir, "index.html"), htmlContent, "utf-8");
|
|
77547
78291
|
return {
|
|
77548
78292
|
prepared: {
|
|
77549
78293
|
input: {
|
|
@@ -77680,7 +78424,7 @@ function createRenderHandlers(options = {}) {
|
|
|
77680
78424
|
log2.info(`render progress ${pct}%`, { requestId, stage: j3.currentStage, message });
|
|
77681
78425
|
}
|
|
77682
78426
|
});
|
|
77683
|
-
const fileSize = existsSync42(absoluteOutputPath) ?
|
|
78427
|
+
const fileSize = existsSync42(absoluteOutputPath) ? statSync13(absoluteOutputPath).size : 0;
|
|
77684
78428
|
const durationMs = Date.now() - t0;
|
|
77685
78429
|
const outputToken = store.register(absoluteOutputPath);
|
|
77686
78430
|
const outputUrl = `${outputUrlPrefix}/${outputToken}`;
|
|
@@ -77796,7 +78540,7 @@ function createRenderHandlers(options = {}) {
|
|
|
77796
78540
|
},
|
|
77797
78541
|
abortController.signal
|
|
77798
78542
|
);
|
|
77799
|
-
const fileSize = existsSync42(absoluteOutputPath) ?
|
|
78543
|
+
const fileSize = existsSync42(absoluteOutputPath) ? statSync13(absoluteOutputPath).size : 0;
|
|
77800
78544
|
const outputToken = store.register(absoluteOutputPath);
|
|
77801
78545
|
const outputUrl = `${outputUrlPrefix}/${outputToken}`;
|
|
77802
78546
|
log2.info("render-stream completed", { requestId, fileSize, perf: job.perfSummary ?? null });
|
|
@@ -77859,7 +78603,7 @@ function createRenderHandlers(options = {}) {
|
|
|
77859
78603
|
store.delete(token);
|
|
77860
78604
|
return c3.json({ success: false, error: "Output artifact file missing" }, 404);
|
|
77861
78605
|
}
|
|
77862
|
-
const stats =
|
|
78606
|
+
const stats = statSync13(artifact.path);
|
|
77863
78607
|
return new Response(createReadStream(artifact.path), {
|
|
77864
78608
|
headers: {
|
|
77865
78609
|
"content-type": "video/mp4",
|
|
@@ -77946,9 +78690,9 @@ var init_parityContract2 = __esm({
|
|
|
77946
78690
|
});
|
|
77947
78691
|
|
|
77948
78692
|
// ../producer/src/services/render/stages/planHash.ts
|
|
77949
|
-
import { createHash as
|
|
78693
|
+
import { createHash as createHash9 } from "crypto";
|
|
77950
78694
|
function computePlanHash(input2) {
|
|
77951
|
-
const hash2 =
|
|
78695
|
+
const hash2 = createHash9("sha256");
|
|
77952
78696
|
hash2.update(PLAN_HASH_SCHEMA_PREFIX, "utf8");
|
|
77953
78697
|
hash2.update(input2.compositionHtml);
|
|
77954
78698
|
hash2.update(FIELD_DELIMITER);
|
|
@@ -77995,7 +78739,7 @@ function canonicalJsonStringify(value) {
|
|
|
77995
78739
|
throw new TypeError(`canonicalJsonStringify: unsupported value type ${typeof value}`);
|
|
77996
78740
|
}
|
|
77997
78741
|
function sha256Hex(bytes) {
|
|
77998
|
-
const h3 =
|
|
78742
|
+
const h3 = createHash9("sha256");
|
|
77999
78743
|
h3.update(bytes);
|
|
78000
78744
|
return h3.digest("hex");
|
|
78001
78745
|
}
|
|
@@ -78009,7 +78753,7 @@ var init_planHash = __esm({
|
|
|
78009
78753
|
});
|
|
78010
78754
|
|
|
78011
78755
|
// ../producer/src/services/render/stages/freezePlan.ts
|
|
78012
|
-
import { existsSync as existsSync43, mkdirSync as mkdirSync26, readFileSync as readFileSync31, readdirSync as readdirSync17, writeFileSync as
|
|
78756
|
+
import { existsSync as existsSync43, mkdirSync as mkdirSync26, readFileSync as readFileSync31, readdirSync as readdirSync17, writeFileSync as writeFileSync19 } from "fs";
|
|
78013
78757
|
import { join as join53, relative as relative7, resolve as resolve24 } from "path";
|
|
78014
78758
|
function stripUndefined(value) {
|
|
78015
78759
|
if (Array.isArray(value)) return value.map(stripUndefined);
|
|
@@ -78106,7 +78850,7 @@ async function freezePlan(input2) {
|
|
|
78106
78850
|
}
|
|
78107
78851
|
const metaDir = join53(planDir, "meta");
|
|
78108
78852
|
if (!existsSync43(metaDir)) mkdirSync26(metaDir, { recursive: true });
|
|
78109
|
-
|
|
78853
|
+
writeFileSync19(
|
|
78110
78854
|
join53(metaDir, "composition.json"),
|
|
78111
78855
|
`${JSON.stringify(composition, null, 2)}
|
|
78112
78856
|
`,
|
|
@@ -78114,8 +78858,8 @@ async function freezePlan(input2) {
|
|
|
78114
78858
|
);
|
|
78115
78859
|
const encoderForCanonical = stripUndefined(encoder);
|
|
78116
78860
|
const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
|
|
78117
|
-
|
|
78118
|
-
|
|
78861
|
+
writeFileSync19(join53(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
|
|
78862
|
+
writeFileSync19(join53(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
|
|
78119
78863
|
`, "utf-8");
|
|
78120
78864
|
const { compositionHtml, assets } = collectPlanAssetShas(planDir);
|
|
78121
78865
|
const planHash = computePlanHash({
|
|
@@ -78139,7 +78883,7 @@ async function freezePlan(input2) {
|
|
|
78139
78883
|
hasAudio
|
|
78140
78884
|
};
|
|
78141
78885
|
const planJsonPath = join53(planDir, "plan.json");
|
|
78142
|
-
|
|
78886
|
+
writeFileSync19(planJsonPath, `${JSON.stringify(planJson, null, 2)}
|
|
78143
78887
|
`, "utf-8");
|
|
78144
78888
|
return { planJsonPath, planHash };
|
|
78145
78889
|
}
|
|
@@ -78323,8 +79067,8 @@ import {
|
|
|
78323
79067
|
readdirSync as readdirSync18,
|
|
78324
79068
|
renameSync as renameSync4,
|
|
78325
79069
|
rmSync as rmSync11,
|
|
78326
|
-
statSync as
|
|
78327
|
-
writeFileSync as
|
|
79070
|
+
statSync as statSync14,
|
|
79071
|
+
writeFileSync as writeFileSync20
|
|
78328
79072
|
} from "fs";
|
|
78329
79073
|
import { join as join55, relative as relative8, sep as sep6 } from "path";
|
|
78330
79074
|
function formatBytes(bytes) {
|
|
@@ -78356,7 +79100,7 @@ function measurePlanDirBytes(planDir) {
|
|
|
78356
79100
|
walk(full);
|
|
78357
79101
|
} else if (entry.isFile()) {
|
|
78358
79102
|
try {
|
|
78359
|
-
total +=
|
|
79103
|
+
total += statSync14(full).size;
|
|
78360
79104
|
} catch {
|
|
78361
79105
|
}
|
|
78362
79106
|
}
|
|
@@ -78626,7 +79370,7 @@ async function plan(projectDir, config, planDir) {
|
|
|
78626
79370
|
}))
|
|
78627
79371
|
};
|
|
78628
79372
|
mkdirSync27(join55(planDir, "meta"), { recursive: true });
|
|
78629
|
-
|
|
79373
|
+
writeFileSync20(
|
|
78630
79374
|
join55(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
|
|
78631
79375
|
JSON.stringify(planVideosJson, null, 2),
|
|
78632
79376
|
"utf-8"
|
|
@@ -78771,7 +79515,7 @@ var init_plan = __esm({
|
|
|
78771
79515
|
|
|
78772
79516
|
// ../producer/src/services/distributed/renderChunk.ts
|
|
78773
79517
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
78774
|
-
import { existsSync as existsSync46, mkdirSync as mkdirSync28, readFileSync as readFileSync33, readdirSync as readdirSync19, rmSync as rmSync12, writeFileSync as
|
|
79518
|
+
import { existsSync as existsSync46, mkdirSync as mkdirSync28, readFileSync as readFileSync33, readdirSync as readdirSync19, rmSync as rmSync12, writeFileSync as writeFileSync21 } from "fs";
|
|
78775
79519
|
import { extname as extname9, join as join56 } from "path";
|
|
78776
79520
|
function rebuildExtractedFramesFromPlanDir(planDir, videos) {
|
|
78777
79521
|
const result = [];
|
|
@@ -79057,7 +79801,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
|
|
|
79057
79801
|
producerVersion: plan2.producerVersion,
|
|
79058
79802
|
ffmpegVersion
|
|
79059
79803
|
};
|
|
79060
|
-
|
|
79804
|
+
writeFileSync21(perfPath, `${JSON.stringify(perfPayload2, null, 2)}
|
|
79061
79805
|
`, "utf-8");
|
|
79062
79806
|
try {
|
|
79063
79807
|
rmSync12(workDir, { recursive: true, force: true });
|
|
@@ -79323,8 +80067,8 @@ import {
|
|
|
79323
80067
|
readFileSync as readFileSync34,
|
|
79324
80068
|
readdirSync as readdirSync20,
|
|
79325
80069
|
rmSync as rmSync13,
|
|
79326
|
-
statSync as
|
|
79327
|
-
writeFileSync as
|
|
80070
|
+
statSync as statSync15,
|
|
80071
|
+
writeFileSync as writeFileSync22
|
|
79328
80072
|
} from "fs";
|
|
79329
80073
|
import { dirname as dirname18, join as join57 } from "path";
|
|
79330
80074
|
async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
@@ -79378,7 +80122,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
79378
80122
|
} else {
|
|
79379
80123
|
const concatListPath = join57(workDir, "concat-list.txt");
|
|
79380
80124
|
const concatBody = chunkPaths.map((path2) => `file '${path2.replace(/'/g, "'\\''")}'`).join("\n");
|
|
79381
|
-
|
|
80125
|
+
writeFileSync22(concatListPath, `${concatBody}
|
|
79382
80126
|
`, "utf-8");
|
|
79383
80127
|
const concatArgs = [
|
|
79384
80128
|
"-r",
|
|
@@ -79505,7 +80249,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
79505
80249
|
});
|
|
79506
80250
|
}
|
|
79507
80251
|
}
|
|
79508
|
-
const fileSize = existsSync47(outputPath) ?
|
|
80252
|
+
const fileSize = existsSync47(outputPath) ? statSync15(outputPath).size : 0;
|
|
79509
80253
|
return {
|
|
79510
80254
|
outputPath,
|
|
79511
80255
|
durationMs: Date.now() - start,
|
|
@@ -79518,7 +80262,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
79518
80262
|
mkdirSync29(outputPath, { recursive: true });
|
|
79519
80263
|
let globalIdx = 0;
|
|
79520
80264
|
for (const chunkDir of chunkPaths) {
|
|
79521
|
-
if (!
|
|
80265
|
+
if (!statSync15(chunkDir).isDirectory()) {
|
|
79522
80266
|
throw new Error(
|
|
79523
80267
|
`[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
|
|
79524
80268
|
);
|
|
@@ -79545,7 +80289,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
79545
80289
|
let fileSize = 0;
|
|
79546
80290
|
for (const name of readdirSync20(outputPath)) {
|
|
79547
80291
|
try {
|
|
79548
|
-
fileSize +=
|
|
80292
|
+
fileSize += statSync15(join57(outputPath, name)).size;
|
|
79549
80293
|
} catch {
|
|
79550
80294
|
}
|
|
79551
80295
|
}
|
|
@@ -79673,7 +80417,7 @@ __export(studioServer_exports, {
|
|
|
79673
80417
|
});
|
|
79674
80418
|
import { Hono as Hono5 } from "hono";
|
|
79675
80419
|
import { streamSSE as streamSSE3 } from "hono/streaming";
|
|
79676
|
-
import { existsSync as existsSync48, readFileSync as readFileSync35, writeFileSync as
|
|
80420
|
+
import { existsSync as existsSync48, readFileSync as readFileSync35, writeFileSync as writeFileSync23, statSync as statSync16 } from "fs";
|
|
79677
80421
|
import { resolve as resolve25, join as join58, basename as basename6 } from "path";
|
|
79678
80422
|
function resolveDistDir() {
|
|
79679
80423
|
return resolveStudioBundle().dir;
|
|
@@ -79851,6 +80595,7 @@ function createStudioServer(options) {
|
|
|
79851
80595
|
};
|
|
79852
80596
|
const startTime = Date.now();
|
|
79853
80597
|
(async () => {
|
|
80598
|
+
let renderJob;
|
|
79854
80599
|
try {
|
|
79855
80600
|
const { createRenderJob: createRenderJob2, executeRenderJob: executeRenderJob2 } = await Promise.resolve().then(() => (init_src3(), src_exports3));
|
|
79856
80601
|
const { ensureBrowser: ensureBrowser2 } = await Promise.resolve().then(() => (init_manager2(), manager_exports2));
|
|
@@ -79873,6 +80618,7 @@ function createStudioServer(options) {
|
|
|
79873
80618
|
...manualEditsRenderScript ? { renderBodyScripts: [manualEditsRenderScript] } : {},
|
|
79874
80619
|
...opts.composition ? { entryFile: opts.composition } : {}
|
|
79875
80620
|
});
|
|
80621
|
+
renderJob = job;
|
|
79876
80622
|
const onProgress = (j3) => {
|
|
79877
80623
|
state.progress = j3.progress;
|
|
79878
80624
|
if (j3.currentStage) state.stage = j3.currentStage;
|
|
@@ -79881,7 +80627,7 @@ function createStudioServer(options) {
|
|
|
79881
80627
|
state.status = "complete";
|
|
79882
80628
|
state.progress = 100;
|
|
79883
80629
|
const metaPath = opts.outputPath.replace(/\.(mp4|webm|mov)$/, ".meta.json");
|
|
79884
|
-
|
|
80630
|
+
writeFileSync23(
|
|
79885
80631
|
metaPath,
|
|
79886
80632
|
JSON.stringify({ status: "complete", durationMs: Date.now() - startTime })
|
|
79887
80633
|
);
|
|
@@ -79889,10 +80635,10 @@ function createStudioServer(options) {
|
|
|
79889
80635
|
} catch (err) {
|
|
79890
80636
|
state.status = "failed";
|
|
79891
80637
|
state.error = err instanceof Error ? err.message : String(err);
|
|
79892
|
-
emitStudioRenderError(opts, Date.now() - startTime, state.stage, err);
|
|
80638
|
+
emitStudioRenderError(opts, Date.now() - startTime, state.stage, err, renderJob);
|
|
79893
80639
|
try {
|
|
79894
80640
|
const metaPath = opts.outputPath.replace(/\.(mp4|webm|mov)$/, ".meta.json");
|
|
79895
|
-
|
|
80641
|
+
writeFileSync23(metaPath, JSON.stringify({ status: "failed" }));
|
|
79896
80642
|
} catch {
|
|
79897
80643
|
}
|
|
79898
80644
|
}
|
|
@@ -79977,7 +80723,7 @@ function createStudioServer(options) {
|
|
|
79977
80723
|
async installRegistryBlock(opts) {
|
|
79978
80724
|
const { resolveItem: resolveItem2 } = await Promise.resolve().then(() => (init_resolver(), resolver_exports));
|
|
79979
80725
|
const { installItem: installItem2 } = await Promise.resolve().then(() => (init_installer(), installer_exports));
|
|
79980
|
-
const { readFileSync: readFileSync59, writeFileSync:
|
|
80726
|
+
const { readFileSync: readFileSync59, writeFileSync: writeFileSync38, existsSync: existsSync83 } = await import("fs");
|
|
79981
80727
|
const { join: join92 } = await import("path");
|
|
79982
80728
|
const item = await resolveItem2(opts.blockName);
|
|
79983
80729
|
const { written } = await installItem2(item, { destDir: opts.project.dir });
|
|
@@ -80003,7 +80749,7 @@ function createStudioServer(options) {
|
|
|
80003
80749
|
return match;
|
|
80004
80750
|
}
|
|
80005
80751
|
);
|
|
80006
|
-
|
|
80752
|
+
writeFileSync38(absPath, content, "utf-8");
|
|
80007
80753
|
}
|
|
80008
80754
|
}
|
|
80009
80755
|
}
|
|
@@ -80077,7 +80823,7 @@ function createStudioServer(options) {
|
|
|
80077
80823
|
});
|
|
80078
80824
|
const serveStudioStaticFile = (c3) => {
|
|
80079
80825
|
const filePath = resolve25(studioDir, c3.req.path.slice(1));
|
|
80080
|
-
if (!existsSync48(filePath) || !
|
|
80826
|
+
if (!existsSync48(filePath) || !statSync16(filePath).isFile()) return c3.text("not found", 404);
|
|
80081
80827
|
const content = readFileSync35(filePath);
|
|
80082
80828
|
return new Response(content, {
|
|
80083
80829
|
headers: { "Content-Type": getMimeType(filePath), "Cache-Control": "no-store" }
|
|
@@ -80669,7 +81415,7 @@ import {
|
|
|
80669
81415
|
mkdirSync as mkdirSync31,
|
|
80670
81416
|
copyFileSync as copyFileSync5,
|
|
80671
81417
|
cpSync as cpSync4,
|
|
80672
|
-
writeFileSync as
|
|
81418
|
+
writeFileSync as writeFileSync24,
|
|
80673
81419
|
readFileSync as readFileSync36,
|
|
80674
81420
|
readdirSync as readdirSync21
|
|
80675
81421
|
} from "fs";
|
|
@@ -80774,7 +81520,7 @@ function buildPackageScripts() {
|
|
|
80774
81520
|
function writeDefaultPackageJson(destDir, projectName) {
|
|
80775
81521
|
const packageJsonPath = resolve27(destDir, "package.json");
|
|
80776
81522
|
if (existsSync50(packageJsonPath)) return;
|
|
80777
|
-
|
|
81523
|
+
writeFileSync24(
|
|
80778
81524
|
packageJsonPath,
|
|
80779
81525
|
`${JSON.stringify(
|
|
80780
81526
|
{
|
|
@@ -80836,7 +81582,7 @@ ${html}`;
|
|
|
80836
81582
|
function writeTailwindSupport(destDir) {
|
|
80837
81583
|
for (const file of listHtmlFiles(destDir)) {
|
|
80838
81584
|
const html = readFileSync36(file, "utf-8");
|
|
80839
|
-
|
|
81585
|
+
writeFileSync24(file, injectTailwindBrowserScript(html), "utf-8");
|
|
80840
81586
|
}
|
|
80841
81587
|
}
|
|
80842
81588
|
function patchVideoSrc(dir, videoFilename, durationSeconds) {
|
|
@@ -80853,7 +81599,7 @@ function patchVideoSrc(dir, videoFilename, durationSeconds) {
|
|
|
80853
81599
|
}
|
|
80854
81600
|
const dur = durationSeconds ? String(Math.round(durationSeconds * 100) / 100) : "10";
|
|
80855
81601
|
content = content.replaceAll("__VIDEO_DURATION__", dur);
|
|
80856
|
-
|
|
81602
|
+
writeFileSync24(file, content, "utf-8");
|
|
80857
81603
|
}
|
|
80858
81604
|
}
|
|
80859
81605
|
async function patchTranscript(dir, transcriptPath) {
|
|
@@ -80989,7 +81735,7 @@ function applyResolutionPreset(destDir, resolution) {
|
|
|
80989
81735
|
html = html.replace(viewportRe, `$1width=${width}, height=${height}`);
|
|
80990
81736
|
changed = true;
|
|
80991
81737
|
}
|
|
80992
|
-
if (changed)
|
|
81738
|
+
if (changed) writeFileSync24(file, html, "utf-8");
|
|
80993
81739
|
}
|
|
80994
81740
|
}
|
|
80995
81741
|
async function scaffoldProject(destDir, name, templateId, localVideoName, durationSeconds, tailwind = false, resolution) {
|
|
@@ -81003,7 +81749,7 @@ async function scaffoldProject(destDir, name, templateId, localVideoName, durati
|
|
|
81003
81749
|
patchVideoSrc(destDir, localVideoName, durationSeconds);
|
|
81004
81750
|
if (tailwind) writeTailwindSupport(destDir);
|
|
81005
81751
|
if (resolution) applyResolutionPreset(destDir, resolution);
|
|
81006
|
-
|
|
81752
|
+
writeFileSync24(
|
|
81007
81753
|
resolve27(destDir, "meta.json"),
|
|
81008
81754
|
JSON.stringify(
|
|
81009
81755
|
{
|
|
@@ -81909,13 +82655,13 @@ var init_format = __esm({
|
|
|
81909
82655
|
});
|
|
81910
82656
|
|
|
81911
82657
|
// src/utils/project.ts
|
|
81912
|
-
import { existsSync as existsSync52, statSync as
|
|
82658
|
+
import { existsSync as existsSync52, statSync as statSync17 } from "fs";
|
|
81913
82659
|
import { resolve as resolve30, basename as basename9 } from "path";
|
|
81914
82660
|
function resolveProject(dirArg) {
|
|
81915
82661
|
const dir = resolve30(dirArg ?? ".");
|
|
81916
82662
|
const name = basename9(dir);
|
|
81917
82663
|
const indexPath = resolve30(dir, "index.html");
|
|
81918
|
-
if (!existsSync52(dir) || !
|
|
82664
|
+
if (!existsSync52(dir) || !statSync17(dir).isDirectory()) {
|
|
81919
82665
|
errorBox("Not a directory: " + dir);
|
|
81920
82666
|
process.exit(1);
|
|
81921
82667
|
}
|
|
@@ -82206,7 +82952,7 @@ var init_play = __esm({
|
|
|
82206
82952
|
|
|
82207
82953
|
// src/utils/publishProject.ts
|
|
82208
82954
|
import { basename as basename10, dirname as dirname22, join as join61, posix as posix4, relative as relative10, resolve as resolve32 } from "path";
|
|
82209
|
-
import { existsSync as existsSync54, readdirSync as readdirSync22, readFileSync as readFileSync38, statSync as
|
|
82955
|
+
import { existsSync as existsSync54, readdirSync as readdirSync22, readFileSync as readFileSync38, statSync as statSync18 } from "fs";
|
|
82210
82956
|
import AdmZip from "adm-zip";
|
|
82211
82957
|
function isRecord2(value) {
|
|
82212
82958
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -82313,7 +83059,7 @@ function collectProjectFiles(rootDir, currentDir, paths) {
|
|
|
82313
83059
|
collectProjectFiles(rootDir, absolutePath, paths);
|
|
82314
83060
|
continue;
|
|
82315
83061
|
}
|
|
82316
|
-
if (!
|
|
83062
|
+
if (!statSync18(absolutePath).isFile()) continue;
|
|
82317
83063
|
paths.push(relativePath);
|
|
82318
83064
|
}
|
|
82319
83065
|
}
|
|
@@ -82340,7 +83086,7 @@ function tryResolveExternal(ctx, rawPath, referrerAbsDir) {
|
|
|
82340
83086
|
const absPath = resolve32(referrerAbsDir, rawPath);
|
|
82341
83087
|
if (isPathInside(absPath, ctx.absProjectDir)) return null;
|
|
82342
83088
|
try {
|
|
82343
|
-
if (!existsSync54(absPath) || !
|
|
83089
|
+
if (!existsSync54(absPath) || !statSync18(absPath).isFile()) return null;
|
|
82344
83090
|
} catch {
|
|
82345
83091
|
return null;
|
|
82346
83092
|
}
|
|
@@ -83141,7 +83887,7 @@ __export(render_exports, {
|
|
|
83141
83887
|
renderLocal: () => renderLocal,
|
|
83142
83888
|
resolveBrowserGpuForCli: () => resolveBrowserGpuForCli
|
|
83143
83889
|
});
|
|
83144
|
-
import { mkdirSync as mkdirSync32, readdirSync as readdirSync23, readFileSync as readFileSync40, statSync as
|
|
83890
|
+
import { mkdirSync as mkdirSync32, readdirSync as readdirSync23, readFileSync as readFileSync40, statSync as statSync19, writeFileSync as writeFileSync25, rmSync as rmSync14 } from "fs";
|
|
83145
83891
|
import { cpus as cpus4, freemem as freemem5, tmpdir as tmpdir5 } from "os";
|
|
83146
83892
|
import { resolve as resolve36, dirname as dirname23, join as join63, basename as basename12 } from "path";
|
|
83147
83893
|
import { execFileSync as execFileSync6, spawn as spawn13 } from "child_process";
|
|
@@ -83176,7 +83922,7 @@ function resolveDockerfilePath() {
|
|
|
83176
83922
|
const devPath = resolve36(__dirname, "..", "src", "docker", "Dockerfile.render");
|
|
83177
83923
|
for (const p2 of [builtPath, devPath]) {
|
|
83178
83924
|
try {
|
|
83179
|
-
|
|
83925
|
+
statSync19(p2);
|
|
83180
83926
|
return p2;
|
|
83181
83927
|
} catch {
|
|
83182
83928
|
continue;
|
|
@@ -83206,7 +83952,7 @@ function ensureDockerImage(version, platform9, quiet) {
|
|
|
83206
83952
|
const dockerfilePath = resolveDockerfilePath();
|
|
83207
83953
|
const tmpDir = join63(tmpdir5(), `hyperframes-docker-${Date.now()}`);
|
|
83208
83954
|
mkdirSync32(tmpDir, { recursive: true });
|
|
83209
|
-
|
|
83955
|
+
writeFileSync25(join63(tmpDir, "Dockerfile"), readFileSync40(dockerfilePath));
|
|
83210
83956
|
const targetArch = platform9 === "linux/arm64" ? "arm64" : "amd64";
|
|
83211
83957
|
try {
|
|
83212
83958
|
execFileSync6(
|
|
@@ -83342,6 +84088,9 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
83342
84088
|
process.exit(1);
|
|
83343
84089
|
}
|
|
83344
84090
|
const startTime = Date.now();
|
|
84091
|
+
const logger = createRenderTelemetryLogger(
|
|
84092
|
+
producer.createConsoleLogger?.("info") ?? createNoopProducerLogger()
|
|
84093
|
+
);
|
|
83345
84094
|
if (options.browserPath && !process.env.PRODUCER_HEADLESS_SHELL_PATH) {
|
|
83346
84095
|
process.env.PRODUCER_HEADLESS_SHELL_PATH = options.browserPath;
|
|
83347
84096
|
}
|
|
@@ -83351,6 +84100,7 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
83351
84100
|
format: options.format,
|
|
83352
84101
|
workers: options.workers,
|
|
83353
84102
|
useGpu: options.gpu,
|
|
84103
|
+
logger,
|
|
83354
84104
|
producerConfig: producer.resolveConfig({
|
|
83355
84105
|
browserGpuMode: options.browserGpuMode ?? "software",
|
|
83356
84106
|
...options.pageNavigationTimeoutMs != null ? { pageNavigationTimeout: options.pageNavigationTimeoutMs } : {},
|
|
@@ -83376,7 +84126,8 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
83376
84126
|
startTime,
|
|
83377
84127
|
false,
|
|
83378
84128
|
"Try --docker for containerized rendering",
|
|
83379
|
-
job.failedStage
|
|
84129
|
+
job.failedStage,
|
|
84130
|
+
job
|
|
83380
84131
|
);
|
|
83381
84132
|
}
|
|
83382
84133
|
const elapsed = Date.now() - startTime;
|
|
@@ -83401,7 +84152,88 @@ function getMemorySnapshot() {
|
|
|
83401
84152
|
memoryFreeMb: bytesToMb(freemem5())
|
|
83402
84153
|
};
|
|
83403
84154
|
}
|
|
83404
|
-
function
|
|
84155
|
+
function metaString(meta, key2) {
|
|
84156
|
+
const value = meta?.[key2];
|
|
84157
|
+
return typeof value === "string" ? value : void 0;
|
|
84158
|
+
}
|
|
84159
|
+
function metaNumber(meta, key2) {
|
|
84160
|
+
const value = meta?.[key2];
|
|
84161
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
84162
|
+
}
|
|
84163
|
+
function metaBoolean(meta, key2) {
|
|
84164
|
+
const value = meta?.[key2];
|
|
84165
|
+
return typeof value === "boolean" ? value : void 0;
|
|
84166
|
+
}
|
|
84167
|
+
function trackRenderTraceFromLog(message, meta) {
|
|
84168
|
+
if (message !== "[Render:trace]") return;
|
|
84169
|
+
const status = metaString(meta, "status");
|
|
84170
|
+
if (status !== "checkpoint" && status !== "error") return;
|
|
84171
|
+
trackRenderObservation({
|
|
84172
|
+
source: "cli",
|
|
84173
|
+
renderJobId: metaString(meta, "renderJobId"),
|
|
84174
|
+
phase: metaString(meta, "phase"),
|
|
84175
|
+
status,
|
|
84176
|
+
compositionHash: metaString(meta, "compositionHash"),
|
|
84177
|
+
elapsedMs: metaNumber(meta, "elapsedMs"),
|
|
84178
|
+
durationMs: metaNumber(meta, "durationMs"),
|
|
84179
|
+
message: metaString(meta, "message"),
|
|
84180
|
+
workerCount: metaNumber(meta, "workerCount"),
|
|
84181
|
+
forceScreenshot: metaBoolean(meta, "forceScreenshot"),
|
|
84182
|
+
useStreamingEncode: metaBoolean(meta, "useStreamingEncode"),
|
|
84183
|
+
useLayeredComposite: metaBoolean(meta, "useLayeredComposite"),
|
|
84184
|
+
usePageSideCompositing: metaBoolean(meta, "usePageSideCompositing"),
|
|
84185
|
+
hasHdrContent: metaBoolean(meta, "hasHdrContent"),
|
|
84186
|
+
captureMode: metaString(meta, "captureMode"),
|
|
84187
|
+
videoCount: metaNumber(meta, "videoCount"),
|
|
84188
|
+
extractedVideoCount: metaNumber(meta, "extractedVideoCount"),
|
|
84189
|
+
totalFramesExtracted: metaNumber(meta, "totalFramesExtracted"),
|
|
84190
|
+
maxFramesPerVideo: metaNumber(meta, "maxFramesPerVideo"),
|
|
84191
|
+
avgFramesPerExtractedVideo: metaNumber(meta, "avgFramesPerExtractedVideo"),
|
|
84192
|
+
vfrPreflightCount: metaNumber(meta, "vfrPreflightCount"),
|
|
84193
|
+
vfrPreflightMs: metaNumber(meta, "vfrPreflightMs"),
|
|
84194
|
+
cacheHits: metaNumber(meta, "cacheHits"),
|
|
84195
|
+
cacheMisses: metaNumber(meta, "cacheMisses")
|
|
84196
|
+
});
|
|
84197
|
+
}
|
|
84198
|
+
function createRenderTelemetryLogger(base) {
|
|
84199
|
+
return {
|
|
84200
|
+
error(message, meta) {
|
|
84201
|
+
base.error(message, meta);
|
|
84202
|
+
trackRenderTraceFromLog(message, meta);
|
|
84203
|
+
},
|
|
84204
|
+
warn(message, meta) {
|
|
84205
|
+
base.warn(message, meta);
|
|
84206
|
+
trackRenderTraceFromLog(message, meta);
|
|
84207
|
+
},
|
|
84208
|
+
info(message, meta) {
|
|
84209
|
+
base.info(message, meta);
|
|
84210
|
+
trackRenderTraceFromLog(message, meta);
|
|
84211
|
+
},
|
|
84212
|
+
debug(message, meta) {
|
|
84213
|
+
base.debug(message, meta);
|
|
84214
|
+
trackRenderTraceFromLog(message, meta);
|
|
84215
|
+
},
|
|
84216
|
+
isLevelEnabled(level) {
|
|
84217
|
+
return base.isLevelEnabled?.(level) ?? true;
|
|
84218
|
+
}
|
|
84219
|
+
};
|
|
84220
|
+
}
|
|
84221
|
+
function createNoopProducerLogger() {
|
|
84222
|
+
return {
|
|
84223
|
+
error() {
|
|
84224
|
+
},
|
|
84225
|
+
warn() {
|
|
84226
|
+
},
|
|
84227
|
+
info() {
|
|
84228
|
+
},
|
|
84229
|
+
debug() {
|
|
84230
|
+
},
|
|
84231
|
+
isLevelEnabled() {
|
|
84232
|
+
return true;
|
|
84233
|
+
}
|
|
84234
|
+
};
|
|
84235
|
+
}
|
|
84236
|
+
function handleRenderError(error, options, startTime, docker, hint, failedStage, job) {
|
|
83405
84237
|
const message = normalizeErrorMessage2(error);
|
|
83406
84238
|
trackRenderError({
|
|
83407
84239
|
fps: fpsToNumber(options.fps),
|
|
@@ -83412,6 +84244,7 @@ function handleRenderError(error, options, startTime, docker, hint, failedStage)
|
|
|
83412
84244
|
elapsedMs: Date.now() - startTime,
|
|
83413
84245
|
errorMessage: message,
|
|
83414
84246
|
failedStage,
|
|
84247
|
+
...renderJobObservabilityTelemetryPayload(job),
|
|
83415
84248
|
...getMemorySnapshot()
|
|
83416
84249
|
});
|
|
83417
84250
|
errorBox("Render failed", message, hint);
|
|
@@ -83454,6 +84287,7 @@ function trackRenderMetrics(job, elapsedMs, options, docker) {
|
|
|
83454
84287
|
extractPhase3Ms: extract?.extractMs,
|
|
83455
84288
|
extractCacheHits: extract?.cacheHits,
|
|
83456
84289
|
extractCacheMisses: extract?.cacheMisses,
|
|
84290
|
+
...renderJobObservabilityTelemetryPayload(job),
|
|
83457
84291
|
...getMemorySnapshot()
|
|
83458
84292
|
});
|
|
83459
84293
|
}
|
|
@@ -83461,13 +84295,13 @@ function printRenderComplete(outputPath, elapsedMs, quiet) {
|
|
|
83461
84295
|
if (quiet) return;
|
|
83462
84296
|
let fileSize = "unknown";
|
|
83463
84297
|
try {
|
|
83464
|
-
const stat3 =
|
|
84298
|
+
const stat3 = statSync19(outputPath);
|
|
83465
84299
|
if (stat3.isDirectory()) {
|
|
83466
84300
|
let total = 0;
|
|
83467
84301
|
for (const entry of readdirSync23(outputPath, { withFileTypes: true })) {
|
|
83468
84302
|
if (!entry.isFile()) continue;
|
|
83469
84303
|
try {
|
|
83470
|
-
total +=
|
|
84304
|
+
total += statSync19(join63(outputPath, entry.name)).size;
|
|
83471
84305
|
} catch {
|
|
83472
84306
|
}
|
|
83473
84307
|
}
|
|
@@ -83498,6 +84332,7 @@ var init_render2 = __esm({
|
|
|
83498
84332
|
init_progress();
|
|
83499
84333
|
init_events();
|
|
83500
84334
|
init_feedback();
|
|
84335
|
+
init_renderObservability();
|
|
83501
84336
|
init_system();
|
|
83502
84337
|
init_version();
|
|
83503
84338
|
init_env();
|
|
@@ -83810,7 +84645,7 @@ var init_render2 = __esm({
|
|
|
83810
84645
|
process.exit(1);
|
|
83811
84646
|
}
|
|
83812
84647
|
const pageNavigationTimeoutMs = resolveBrowserTimeoutMsArg(args["browser-timeout"]);
|
|
83813
|
-
const entryFile = resolveCompositionEntryArg(args.composition, project.dir,
|
|
84648
|
+
const entryFile = resolveCompositionEntryArg(args.composition, project.dir, statSync19);
|
|
83814
84649
|
if (!quiet) {
|
|
83815
84650
|
const workerLabel = workers != null ? `${workers} workers` : `auto workers (${CPU_CORE_COUNT} cores detected)`;
|
|
83816
84651
|
console.log("");
|
|
@@ -84695,7 +85530,7 @@ __export(info_exports, {
|
|
|
84695
85530
|
default: () => info_default,
|
|
84696
85531
|
examples: () => examples11
|
|
84697
85532
|
});
|
|
84698
|
-
import { readFileSync as readFileSync43, readdirSync as readdirSync24, statSync as
|
|
85533
|
+
import { readFileSync as readFileSync43, readdirSync as readdirSync24, statSync as statSync20 } from "fs";
|
|
84699
85534
|
import { join as join65 } from "path";
|
|
84700
85535
|
function totalSize(dir) {
|
|
84701
85536
|
let total = 0;
|
|
@@ -84704,7 +85539,7 @@ function totalSize(dir) {
|
|
|
84704
85539
|
if (entry.isDirectory()) {
|
|
84705
85540
|
total += totalSize(path2);
|
|
84706
85541
|
} else {
|
|
84707
|
-
total +=
|
|
85542
|
+
total += statSync20(path2).size;
|
|
84708
85543
|
}
|
|
84709
85544
|
}
|
|
84710
85545
|
return total;
|
|
@@ -84966,7 +85801,7 @@ __export(benchmark_exports, {
|
|
|
84966
85801
|
default: () => benchmark_default,
|
|
84967
85802
|
examples: () => examples13
|
|
84968
85803
|
});
|
|
84969
|
-
import { existsSync as existsSync59, statSync as
|
|
85804
|
+
import { existsSync as existsSync59, statSync as statSync21 } from "fs";
|
|
84970
85805
|
import { resolve as resolve39, join as join66 } from "path";
|
|
84971
85806
|
var examples13, FPS_30, FPS_60, DEFAULT_CONFIGS, benchmark_default;
|
|
84972
85807
|
var init_benchmark = __esm({
|
|
@@ -85060,7 +85895,7 @@ var init_benchmark = __esm({
|
|
|
85060
85895
|
const elapsedMs = Date.now() - startTime;
|
|
85061
85896
|
let fileSize = null;
|
|
85062
85897
|
if (existsSync59(outputPath)) {
|
|
85063
|
-
const stat3 =
|
|
85898
|
+
const stat3 = statSync21(outputPath);
|
|
85064
85899
|
fileSize = stat3.size;
|
|
85065
85900
|
}
|
|
85066
85901
|
runs.push({ elapsedMs, fileSize });
|
|
@@ -86056,7 +86891,7 @@ __export(transcribe_exports2, {
|
|
|
86056
86891
|
default: () => transcribe_default,
|
|
86057
86892
|
examples: () => examples16
|
|
86058
86893
|
});
|
|
86059
|
-
import { existsSync as existsSync62, writeFileSync as
|
|
86894
|
+
import { existsSync as existsSync62, writeFileSync as writeFileSync26 } from "fs";
|
|
86060
86895
|
import { resolve as resolve41, join as join68, extname as extname11, dirname as dirname26 } from "path";
|
|
86061
86896
|
async function importTranscript(inputPath, dir, json) {
|
|
86062
86897
|
const { loadTranscript: loadTranscript2, patchCaptionHtml: patchCaptionHtml2 } = await Promise.resolve().then(() => (init_normalize(), normalize_exports));
|
|
@@ -86066,7 +86901,7 @@ async function importTranscript(inputPath, dir, json) {
|
|
|
86066
86901
|
process.exit(1);
|
|
86067
86902
|
}
|
|
86068
86903
|
const outPath = join68(dir, "transcript.json");
|
|
86069
|
-
|
|
86904
|
+
writeFileSync26(outPath, JSON.stringify(words, null, 2));
|
|
86070
86905
|
patchCaptionHtml2(dir, words);
|
|
86071
86906
|
if (json) {
|
|
86072
86907
|
console.log(
|
|
@@ -86101,7 +86936,7 @@ async function transcribeAudio(inputPath, dir, opts) {
|
|
|
86101
86936
|
);
|
|
86102
86937
|
}
|
|
86103
86938
|
}
|
|
86104
|
-
|
|
86939
|
+
writeFileSync26(result.transcriptPath, JSON.stringify(words, null, 2));
|
|
86105
86940
|
patchCaptionHtml2(dir, words);
|
|
86106
86941
|
if (opts.json) {
|
|
86107
86942
|
console.log(
|
|
@@ -86309,7 +87144,7 @@ __export(synthesize_exports, {
|
|
|
86309
87144
|
synthesize: () => synthesize
|
|
86310
87145
|
});
|
|
86311
87146
|
import { execFileSync as execFileSync7 } from "child_process";
|
|
86312
|
-
import { existsSync as existsSync64, writeFileSync as
|
|
87147
|
+
import { existsSync as existsSync64, writeFileSync as writeFileSync27, mkdirSync as mkdirSync35, readdirSync as readdirSync25, unlinkSync as unlinkSync6 } from "fs";
|
|
86313
87148
|
import { join as join70, dirname as dirname27, basename as basename13 } from "path";
|
|
86314
87149
|
import { homedir as homedir11 } from "os";
|
|
86315
87150
|
function findPython() {
|
|
@@ -86348,7 +87183,7 @@ function hasPythonPackage(python, pkg) {
|
|
|
86348
87183
|
function ensureSynthScript() {
|
|
86349
87184
|
if (!existsSync64(SCRIPT_PATH)) {
|
|
86350
87185
|
mkdirSync35(SCRIPT_DIR, { recursive: true });
|
|
86351
|
-
|
|
87186
|
+
writeFileSync27(SCRIPT_PATH, SYNTH_SCRIPT);
|
|
86352
87187
|
const currentName = basename13(SCRIPT_PATH);
|
|
86353
87188
|
try {
|
|
86354
87189
|
for (const entry of readdirSync25(SCRIPT_DIR)) {
|
|
@@ -87625,7 +88460,7 @@ __export(contactSheet_exports, {
|
|
|
87625
88460
|
createSvgContactSheet: () => createSvgContactSheet
|
|
87626
88461
|
});
|
|
87627
88462
|
import sharp from "sharp";
|
|
87628
|
-
import { readdirSync as readdirSync26, readFileSync as readFileSync48, writeFileSync as
|
|
88463
|
+
import { readdirSync as readdirSync26, readFileSync as readFileSync48, writeFileSync as writeFileSync28, unlinkSync as unlinkSync7, existsSync as existsSync68 } from "fs";
|
|
87629
88464
|
import { join as join73, extname as extname13, basename as basename14, dirname as dirname30 } from "path";
|
|
87630
88465
|
async function createContactSheet(imagePaths, outputPath, opts = {}) {
|
|
87631
88466
|
const {
|
|
@@ -87781,7 +88616,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir) {
|
|
|
87781
88616
|
fit: "contain",
|
|
87782
88617
|
background: { r: 245, g: 245, b: 245, alpha: 1 }
|
|
87783
88618
|
}).flatten({ background: { r: 245, g: 245, b: 245 } }).png().toBuffer();
|
|
87784
|
-
|
|
88619
|
+
writeFileSync28(tmpPath, thumb);
|
|
87785
88620
|
tmpPaths.push(tmpPath);
|
|
87786
88621
|
labels.push(svgFileNames[i2].replace(".svg", ""));
|
|
87787
88622
|
} catch {
|
|
@@ -93976,7 +94811,7 @@ var require_node_domexception = __commonJS({
|
|
|
93976
94811
|
});
|
|
93977
94812
|
|
|
93978
94813
|
// ../../node_modules/.bun/fetch-blob@3.2.0/node_modules/fetch-blob/from.js
|
|
93979
|
-
import { statSync as
|
|
94814
|
+
import { statSync as statSync22, createReadStream as createReadStream2, promises as fs2 } from "fs";
|
|
93980
94815
|
import { basename as basename15 } from "path";
|
|
93981
94816
|
var import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem;
|
|
93982
94817
|
var init_from = __esm({
|
|
@@ -93986,10 +94821,10 @@ var init_from = __esm({
|
|
|
93986
94821
|
init_file();
|
|
93987
94822
|
init_fetch_blob();
|
|
93988
94823
|
({ stat } = fs2);
|
|
93989
|
-
blobFromSync = (path2, type) => fromBlob(
|
|
94824
|
+
blobFromSync = (path2, type) => fromBlob(statSync22(path2), path2, type);
|
|
93990
94825
|
blobFrom = (path2, type) => stat(path2).then((stat3) => fromBlob(stat3, path2, type));
|
|
93991
94826
|
fileFrom = (path2, type) => stat(path2).then((stat3) => fromFile(stat3, path2, type));
|
|
93992
|
-
fileFromSync = (path2, type) => fromFile(
|
|
94827
|
+
fileFromSync = (path2, type) => fromFile(statSync22(path2), path2, type);
|
|
93993
94828
|
fromBlob = (stat3, path2, type = "") => new fetch_blob_default([new BlobDataItem({
|
|
93994
94829
|
path: path2,
|
|
93995
94830
|
size: stat3.size,
|
|
@@ -107780,7 +108615,7 @@ var require_websocket = __commonJS({
|
|
|
107780
108615
|
var http4 = __require("http");
|
|
107781
108616
|
var net2 = __require("net");
|
|
107782
108617
|
var tls = __require("tls");
|
|
107783
|
-
var { randomBytes: randomBytes4, createHash:
|
|
108618
|
+
var { randomBytes: randomBytes4, createHash: createHash11 } = __require("crypto");
|
|
107784
108619
|
var { Duplex, Readable: Readable3 } = __require("stream");
|
|
107785
108620
|
var { URL: URL2 } = __require("url");
|
|
107786
108621
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -108440,7 +109275,7 @@ var require_websocket = __commonJS({
|
|
|
108440
109275
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
108441
109276
|
return;
|
|
108442
109277
|
}
|
|
108443
|
-
const digest =
|
|
109278
|
+
const digest = createHash11("sha1").update(key2 + GUID).digest("base64");
|
|
108444
109279
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
108445
109280
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
108446
109281
|
return;
|
|
@@ -108807,7 +109642,7 @@ var require_websocket_server = __commonJS({
|
|
|
108807
109642
|
var EventEmitter = __require("events");
|
|
108808
109643
|
var http4 = __require("http");
|
|
108809
109644
|
var { Duplex } = __require("stream");
|
|
108810
|
-
var { createHash:
|
|
109645
|
+
var { createHash: createHash11 } = __require("crypto");
|
|
108811
109646
|
var extension2 = require_extension();
|
|
108812
109647
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
108813
109648
|
var subprotocol2 = require_subprotocol();
|
|
@@ -109108,7 +109943,7 @@ var require_websocket_server = __commonJS({
|
|
|
109108
109943
|
);
|
|
109109
109944
|
}
|
|
109110
109945
|
if (this._state > RUNNING) return abortHandshake(socket, 503);
|
|
109111
|
-
const digest =
|
|
109946
|
+
const digest = createHash11("sha1").update(key2 + GUID).digest("base64");
|
|
109112
109947
|
const headers = [
|
|
109113
109948
|
"HTTP/1.1 101 Switching Protocols",
|
|
109114
109949
|
"Upgrade: websocket",
|
|
@@ -127554,11 +128389,11 @@ __export(snapshot_exports, {
|
|
|
127554
128389
|
examples: () => examples23
|
|
127555
128390
|
});
|
|
127556
128391
|
import { spawn as spawn15 } from "child_process";
|
|
127557
|
-
import { existsSync as existsSync69, mkdtempSync as
|
|
128392
|
+
import { existsSync as existsSync69, mkdtempSync as mkdtempSync5, readFileSync as readFileSync49, mkdirSync as mkdirSync36, rmSync as rmSync15, writeFileSync as writeFileSync29 } from "fs";
|
|
127558
128393
|
import { tmpdir as tmpdir6 } from "os";
|
|
127559
128394
|
import { resolve as resolve44, join as join74, relative as relative12, isAbsolute as isAbsolute11 } from "path";
|
|
127560
128395
|
async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDecoder = false) {
|
|
127561
|
-
const tmp =
|
|
128396
|
+
const tmp = mkdtempSync5(join74(tmpdir6(), "hf-snapshot-frame-"));
|
|
127562
128397
|
const outPath = join74(tmp, "frame.png");
|
|
127563
128398
|
try {
|
|
127564
128399
|
const result = await new Promise(
|
|
@@ -127974,7 +128809,7 @@ ${c2.success("\u25C7")} ${paths.length} snapshots saved to snapshots/`);
|
|
|
127974
128809
|
}
|
|
127975
128810
|
}
|
|
127976
128811
|
const descPath = join74(snapshotDir, "descriptions.md");
|
|
127977
|
-
|
|
128812
|
+
writeFileSync29(descPath, descriptions.join("\n"));
|
|
127978
128813
|
console.log(` ${c2.dim("descriptions.md")} (Gemini frame analysis)`);
|
|
127979
128814
|
}
|
|
127980
128815
|
} catch (descErr) {
|
|
@@ -127994,7 +128829,7 @@ ${c2.error("\u2717")} Snapshot failed: ${msg}`);
|
|
|
127994
128829
|
});
|
|
127995
128830
|
|
|
127996
128831
|
// src/capture/assetDownloader.ts
|
|
127997
|
-
import { writeFileSync as
|
|
128832
|
+
import { writeFileSync as writeFileSync30, mkdirSync as mkdirSync37 } from "fs";
|
|
127998
128833
|
import { join as join75, extname as extname14 } from "path";
|
|
127999
128834
|
async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks) {
|
|
128000
128835
|
const assetsDir = join75(outputDir, "assets");
|
|
@@ -128018,7 +128853,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
128018
128853
|
const name = `${finalSlug}.svg`;
|
|
128019
128854
|
const localPath = `assets/svgs/${name}`;
|
|
128020
128855
|
try {
|
|
128021
|
-
|
|
128856
|
+
writeFileSync30(join75(outputDir, localPath), svg.outerHTML, "utf-8");
|
|
128022
128857
|
assets.push({ url: "", localPath, type: "svg" });
|
|
128023
128858
|
} catch {
|
|
128024
128859
|
}
|
|
@@ -128031,7 +128866,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
128031
128866
|
const localPath = `assets/${name}`;
|
|
128032
128867
|
const buffer = await fetchBuffer(icon.href);
|
|
128033
128868
|
if (buffer) {
|
|
128034
|
-
|
|
128869
|
+
writeFileSync30(join75(outputDir, localPath), buffer);
|
|
128035
128870
|
assets.push({ url: icon.href, localPath, type: "favicon" });
|
|
128036
128871
|
break;
|
|
128037
128872
|
}
|
|
@@ -128088,7 +128923,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
128088
128923
|
const name = `${slug}${ext}`;
|
|
128089
128924
|
usedNames.add(slug);
|
|
128090
128925
|
const localPath = `assets/${name}`;
|
|
128091
|
-
|
|
128926
|
+
writeFileSync30(join75(outputDir, localPath), buffer);
|
|
128092
128927
|
assets.push({ url, localPath, type: "image" });
|
|
128093
128928
|
imgIdx++;
|
|
128094
128929
|
} catch {
|
|
@@ -128101,7 +128936,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
128101
128936
|
const localPath = `assets/og-image${ext}`;
|
|
128102
128937
|
const buffer = await fetchBuffer(tokens.ogImage);
|
|
128103
128938
|
if (buffer && buffer.length > 5e3) {
|
|
128104
|
-
|
|
128939
|
+
writeFileSync30(join75(outputDir, localPath), buffer);
|
|
128105
128940
|
assets.push({ url: tokens.ogImage, localPath, type: "image" });
|
|
128106
128941
|
}
|
|
128107
128942
|
} catch {
|
|
@@ -128164,7 +128999,7 @@ async function downloadAndRewriteFonts(css, outputDir) {
|
|
|
128164
128999
|
const relativePath = `assets/fonts/${filename}`;
|
|
128165
129000
|
const buffer = await fetchBuffer(fontUrl);
|
|
128166
129001
|
if (buffer) {
|
|
128167
|
-
|
|
129002
|
+
writeFileSync30(localPath, buffer);
|
|
128168
129003
|
rewritten = rewritten.split(fontUrl).join(relativePath);
|
|
128169
129004
|
familyCounts.set(family, familyCount + 1);
|
|
128170
129005
|
count++;
|
|
@@ -129183,7 +130018,7 @@ var init_designStyleExtractor = __esm({
|
|
|
129183
130018
|
});
|
|
129184
130019
|
|
|
129185
130020
|
// src/capture/fontMetadataExtractor.ts
|
|
129186
|
-
import { readdirSync as readdirSync27, readFileSync as readFileSync50, writeFileSync as
|
|
130021
|
+
import { readdirSync as readdirSync27, readFileSync as readFileSync50, writeFileSync as writeFileSync31, existsSync as existsSync70 } from "fs";
|
|
129187
130022
|
import { join as join76 } from "path";
|
|
129188
130023
|
import * as fontkit from "fontkit";
|
|
129189
130024
|
function isFontCollection(value) {
|
|
@@ -129217,7 +130052,7 @@ function extractFontMetadata(fontsDir, outputPath) {
|
|
|
129217
130052
|
tool: "fontkit"
|
|
129218
130053
|
}
|
|
129219
130054
|
};
|
|
129220
|
-
|
|
130055
|
+
writeFileSync31(outputPath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
129221
130056
|
return manifest;
|
|
129222
130057
|
}
|
|
129223
130058
|
function readSingleFont(fullPath, filename) {
|
|
@@ -129489,7 +130324,7 @@ var init_animationCataloger = __esm({
|
|
|
129489
130324
|
});
|
|
129490
130325
|
|
|
129491
130326
|
// src/capture/mediaCapture.ts
|
|
129492
|
-
import { mkdirSync as mkdirSync38, writeFileSync as
|
|
130327
|
+
import { mkdirSync as mkdirSync38, writeFileSync as writeFileSync32, readdirSync as readdirSync28, readFileSync as readFileSync51, statSync as statSync23 } from "fs";
|
|
129493
130328
|
import { join as join77 } from "path";
|
|
129494
130329
|
async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
129495
130330
|
let savedCount = 0;
|
|
@@ -129522,7 +130357,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
129522
130357
|
const hash2 = buf.toString("base64").slice(0, 100);
|
|
129523
130358
|
if (savedHashes.has(hash2)) continue;
|
|
129524
130359
|
savedHashes.add(hash2);
|
|
129525
|
-
|
|
130360
|
+
writeFileSync32(join77(lottieDir, `animation-${savedCount}.lottie`), buf);
|
|
129526
130361
|
savedCount++;
|
|
129527
130362
|
continue;
|
|
129528
130363
|
}
|
|
@@ -129540,7 +130375,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
129540
130375
|
} catch {
|
|
129541
130376
|
continue;
|
|
129542
130377
|
}
|
|
129543
|
-
|
|
130378
|
+
writeFileSync32(join77(lottieDir, `animation-${savedCount}.json`), jsonData, "utf-8");
|
|
129544
130379
|
savedCount++;
|
|
129545
130380
|
}
|
|
129546
130381
|
} catch {
|
|
@@ -129559,7 +130394,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
|
|
|
129559
130394
|
const fr = raw.fr || 30;
|
|
129560
130395
|
const dur = ((raw.op || 0) - (raw.ip || 0)) / fr;
|
|
129561
130396
|
const previewName = file.replace(".json", "-preview.png");
|
|
129562
|
-
const fileSize =
|
|
130397
|
+
const fileSize = statSync23(join77(lottieDir, file)).size;
|
|
129563
130398
|
if (fileSize > 2e6) continue;
|
|
129564
130399
|
let previewPage;
|
|
129565
130400
|
try {
|
|
@@ -129618,7 +130453,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
|
|
|
129618
130453
|
}
|
|
129619
130454
|
}
|
|
129620
130455
|
if (manifest.length > 0) {
|
|
129621
|
-
|
|
130456
|
+
writeFileSync32(
|
|
129622
130457
|
join77(outputDir, "extracted", "lottie-manifest.json"),
|
|
129623
130458
|
JSON.stringify(manifest, null, 2),
|
|
129624
130459
|
"utf-8"
|
|
@@ -129727,7 +130562,7 @@ async function captureVideoManifest(page, outputDir, progress) {
|
|
|
129727
130562
|
});
|
|
129728
130563
|
}
|
|
129729
130564
|
if (videoManifest.length > 0) {
|
|
129730
|
-
|
|
130565
|
+
writeFileSync32(
|
|
129731
130566
|
join77(outputDir, "extracted", "video-manifest.json"),
|
|
129732
130567
|
JSON.stringify(videoManifest, null, 2),
|
|
129733
130568
|
"utf-8"
|
|
@@ -129744,7 +130579,7 @@ var init_mediaCapture = __esm({
|
|
|
129744
130579
|
});
|
|
129745
130580
|
|
|
129746
130581
|
// src/capture/contentExtractor.ts
|
|
129747
|
-
import { existsSync as existsSync71, readdirSync as readdirSync29, statSync as
|
|
130582
|
+
import { existsSync as existsSync71, readdirSync as readdirSync29, statSync as statSync24, readFileSync as readFileSync52 } from "fs";
|
|
129748
130583
|
import { join as join78 } from "path";
|
|
129749
130584
|
async function detectLibraries(page, capturedShaders) {
|
|
129750
130585
|
let detectedLibraries = [];
|
|
@@ -129875,7 +130710,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings) {
|
|
|
129875
130710
|
const results = await Promise.allSettled(
|
|
129876
130711
|
batch.map(async (file) => {
|
|
129877
130712
|
const filePath = join78(outputDir, "assets", file);
|
|
129878
|
-
const stat3 =
|
|
130713
|
+
const stat3 = statSync24(filePath);
|
|
129879
130714
|
if (stat3.size > 4e6) return { file, caption: "" };
|
|
129880
130715
|
const buffer = readFileSync52(filePath);
|
|
129881
130716
|
const base64 = buffer.toString("base64");
|
|
@@ -129984,7 +130819,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
|
|
|
129984
130819
|
for (const file of readdirSync29(assetsPath)) {
|
|
129985
130820
|
if (file === "svgs" || file === "fonts" || file === "lottie" || file === "videos") continue;
|
|
129986
130821
|
const filePath = join78(assetsPath, file);
|
|
129987
|
-
const stat3 =
|
|
130822
|
+
const stat3 = statSync24(filePath);
|
|
129988
130823
|
if (!stat3.isFile()) continue;
|
|
129989
130824
|
const sizeKb = Math.round(stat3.size / 1024);
|
|
129990
130825
|
const catalogMatch = catalogedAssets.find(
|
|
@@ -130051,7 +130886,7 @@ var agentPromptGenerator_exports = {};
|
|
|
130051
130886
|
__export(agentPromptGenerator_exports, {
|
|
130052
130887
|
generateAgentPrompt: () => generateAgentPrompt
|
|
130053
130888
|
});
|
|
130054
|
-
import { writeFileSync as
|
|
130889
|
+
import { writeFileSync as writeFileSync33, readdirSync as readdirSync30, existsSync as existsSync72 } from "fs";
|
|
130055
130890
|
import { join as join79 } from "path";
|
|
130056
130891
|
function inferColorRole(hex) {
|
|
130057
130892
|
const r2 = parseInt(hex.slice(1, 3), 16) / 255;
|
|
@@ -130071,9 +130906,9 @@ function inferColorRole(hex) {
|
|
|
130071
130906
|
}
|
|
130072
130907
|
function generateAgentPrompt(outputDir, url, tokens, _animations, hasScreenshot, hasLottie, hasShaders, _catalogedAssets, _detectedLibraries) {
|
|
130073
130908
|
const prompt = buildPrompt(outputDir, url, tokens, hasScreenshot, hasLottie, hasShaders);
|
|
130074
|
-
|
|
130075
|
-
|
|
130076
|
-
|
|
130909
|
+
writeFileSync33(join79(outputDir, "AGENTS.md"), prompt, "utf-8");
|
|
130910
|
+
writeFileSync33(join79(outputDir, "CLAUDE.md"), prompt, "utf-8");
|
|
130911
|
+
writeFileSync33(join79(outputDir, ".cursorrules"), prompt, "utf-8");
|
|
130077
130912
|
}
|
|
130078
130913
|
function buildPrompt(outputDir, url, tokens, hasScreenshot, hasLottie, hasShaders) {
|
|
130079
130914
|
const title = tokens.title || new URL(url).hostname.replace(/^www\./, "");
|
|
@@ -130186,7 +131021,7 @@ var init_agentPromptGenerator = __esm({
|
|
|
130186
131021
|
});
|
|
130187
131022
|
|
|
130188
131023
|
// src/capture/scaffolding.ts
|
|
130189
|
-
import { existsSync as existsSync73, writeFileSync as
|
|
131024
|
+
import { existsSync as existsSync73, writeFileSync as writeFileSync34, readFileSync as readFileSync53 } from "fs";
|
|
130190
131025
|
import { join as join80, resolve as resolve45 } from "path";
|
|
130191
131026
|
function loadEnvFile(startDir) {
|
|
130192
131027
|
try {
|
|
@@ -130216,7 +131051,7 @@ async function generateProjectScaffold(outputDir, url, tokens, animationCatalog,
|
|
|
130216
131051
|
const metaPath = join80(outputDir, "meta.json");
|
|
130217
131052
|
if (!existsSync73(metaPath)) {
|
|
130218
131053
|
const hostname = new URL(url).hostname.replace(/^www\./, "");
|
|
130219
|
-
|
|
131054
|
+
writeFileSync34(
|
|
130220
131055
|
metaPath,
|
|
130221
131056
|
JSON.stringify({ id: hostname + "-video", name: tokens.title || hostname }, null, 2),
|
|
130222
131057
|
"utf-8"
|
|
@@ -130251,7 +131086,7 @@ var screenshotCapture_exports = {};
|
|
|
130251
131086
|
__export(screenshotCapture_exports, {
|
|
130252
131087
|
captureScrollScreenshots: () => captureScrollScreenshots
|
|
130253
131088
|
});
|
|
130254
|
-
import { writeFileSync as
|
|
131089
|
+
import { writeFileSync as writeFileSync35, mkdirSync as mkdirSync39 } from "fs";
|
|
130255
131090
|
import { join as join81 } from "path";
|
|
130256
131091
|
async function captureScrollScreenshots(page, outputDir) {
|
|
130257
131092
|
const screenshotsDir = join81(outputDir, "screenshots");
|
|
@@ -130348,7 +131183,7 @@ async function captureScrollScreenshots(page, outputDir) {
|
|
|
130348
131183
|
const filename = `scroll-${String(Math.min(pct, 100)).padStart(3, "0")}.png`;
|
|
130349
131184
|
const filePath = join81(screenshotsDir, filename);
|
|
130350
131185
|
const buffer = await page.screenshot({ type: "png" });
|
|
130351
|
-
|
|
131186
|
+
writeFileSync35(filePath, buffer);
|
|
130352
131187
|
filePaths.push(`screenshots/${filename}`);
|
|
130353
131188
|
}
|
|
130354
131189
|
await page.evaluate(`window.scrollTo(0, 0)`);
|
|
@@ -130621,7 +131456,7 @@ var capture_exports = {};
|
|
|
130621
131456
|
__export(capture_exports, {
|
|
130622
131457
|
captureWebsite: () => captureWebsite
|
|
130623
131458
|
});
|
|
130624
|
-
import { mkdirSync as mkdirSync40, writeFileSync as
|
|
131459
|
+
import { mkdirSync as mkdirSync40, writeFileSync as writeFileSync36, existsSync as existsSync74 } from "fs";
|
|
130625
131460
|
import { join as join82 } from "path";
|
|
130626
131461
|
async function captureWebsite(opts, onProgress) {
|
|
130627
131462
|
const {
|
|
@@ -130816,7 +131651,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
130816
131651
|
return true;
|
|
130817
131652
|
});
|
|
130818
131653
|
capturedShaders = unique;
|
|
130819
|
-
|
|
131654
|
+
writeFileSync36(
|
|
130820
131655
|
join82(outputDir, "extracted", "shaders.json"),
|
|
130821
131656
|
JSON.stringify(unique, null, 2),
|
|
130822
131657
|
"utf-8"
|
|
@@ -130831,7 +131666,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
130831
131666
|
...tokens,
|
|
130832
131667
|
svgs: tokens.svgs.map(({ outerHTML: _, ...rest }) => rest)
|
|
130833
131668
|
};
|
|
130834
|
-
|
|
131669
|
+
writeFileSync36(
|
|
130835
131670
|
join82(outputDir, "extracted", "tokens.json"),
|
|
130836
131671
|
JSON.stringify(tokensForDisk, null, 2),
|
|
130837
131672
|
"utf-8"
|
|
@@ -130839,7 +131674,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
130839
131674
|
progress("style", "Extracting design styles...");
|
|
130840
131675
|
try {
|
|
130841
131676
|
const designStyles = await extractDesignStyles(page1);
|
|
130842
|
-
|
|
131677
|
+
writeFileSync36(
|
|
130843
131678
|
join82(outputDir, "extracted", "design-styles.json"),
|
|
130844
131679
|
JSON.stringify(designStyles, null, 2),
|
|
130845
131680
|
"utf-8"
|
|
@@ -130943,7 +131778,7 @@ ${err.stack}` : String(err);
|
|
|
130943
131778
|
scrollTriggeredElements: (animationCatalog.scrollTargets || []).length,
|
|
130944
131779
|
representativeAnimations: representativeAnims
|
|
130945
131780
|
};
|
|
130946
|
-
|
|
131781
|
+
writeFileSync36(
|
|
130947
131782
|
join82(outputDir, "extracted", "animations.json"),
|
|
130948
131783
|
JSON.stringify(leanCatalog, null, 2),
|
|
130949
131784
|
"utf-8"
|
|
@@ -130955,14 +131790,14 @@ ${err.stack}` : String(err);
|
|
|
130955
131790
|
assets = await downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks);
|
|
130956
131791
|
}
|
|
130957
131792
|
if (visibleTextContent) {
|
|
130958
|
-
|
|
131793
|
+
writeFileSync36(join82(outputDir, "extracted", "visible-text.txt"), visibleTextContent, "utf-8");
|
|
130959
131794
|
}
|
|
130960
131795
|
const geminiCaptions = await captionImagesWithGemini(outputDir, progress, warnings);
|
|
130961
131796
|
progress("design", "Generating asset descriptions...");
|
|
130962
131797
|
try {
|
|
130963
131798
|
const lines = generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCaptions);
|
|
130964
131799
|
if (lines.length > 0) {
|
|
130965
|
-
|
|
131800
|
+
writeFileSync36(
|
|
130966
131801
|
join82(outputDir, "extracted", "asset-descriptions.md"),
|
|
130967
131802
|
"# Asset Descriptions\n\nOne line per file. Read this instead of opening every image individually.\n\n" + lines.map((l) => "- " + l).join("\n") + "\n",
|
|
130968
131803
|
"utf-8"
|
|
@@ -131194,11 +132029,11 @@ var init_capture2 = __esm({
|
|
|
131194
132029
|
} catch (err) {
|
|
131195
132030
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
131196
132031
|
try {
|
|
131197
|
-
const { mkdirSync: mkdirSync44, writeFileSync:
|
|
132032
|
+
const { mkdirSync: mkdirSync44, writeFileSync: writeFileSync38 } = await import("fs");
|
|
131198
132033
|
mkdirSync44(outputDir, { recursive: true });
|
|
131199
132034
|
const isTimeout = /timeout|timed out/i.test(errMsg);
|
|
131200
132035
|
const reason = isTimeout ? "Page navigation timed out \u2014 the site may be blocking headless browsers or requires authentication." : `Capture failed: ${errMsg}`;
|
|
131201
|
-
|
|
132036
|
+
writeFileSync38(
|
|
131202
132037
|
`${outputDir}/BLOCKED.md`,
|
|
131203
132038
|
`# Capture Failed
|
|
131204
132039
|
|
|
@@ -131241,7 +132076,7 @@ __export(state_exports, {
|
|
|
131241
132076
|
stateFilePath: () => stateFilePath,
|
|
131242
132077
|
writeStackOutputs: () => writeStackOutputs
|
|
131243
132078
|
});
|
|
131244
|
-
import { existsSync as existsSync75, mkdirSync as mkdirSync41, readdirSync as readdirSync31, readFileSync as readFileSync54, rmSync as rmSync16, writeFileSync as
|
|
132079
|
+
import { existsSync as existsSync75, mkdirSync as mkdirSync41, readdirSync as readdirSync31, readFileSync as readFileSync54, rmSync as rmSync16, writeFileSync as writeFileSync37 } from "fs";
|
|
131245
132080
|
import { dirname as dirname31, join as join83 } from "path";
|
|
131246
132081
|
function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
131247
132082
|
return join83(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
|
|
@@ -131249,7 +132084,7 @@ function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
|
131249
132084
|
function writeStackOutputs(outputs, cwd = process.cwd()) {
|
|
131250
132085
|
const path2 = stateFilePath(outputs.stackName, cwd);
|
|
131251
132086
|
mkdirSync41(dirname31(path2), { recursive: true });
|
|
131252
|
-
|
|
132087
|
+
writeFileSync37(path2, JSON.stringify(outputs, null, 2) + "\n");
|
|
131253
132088
|
return path2;
|
|
131254
132089
|
}
|
|
131255
132090
|
function readStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
@@ -133367,10 +134202,10 @@ var init_client3 = __esm({
|
|
|
133367
134202
|
});
|
|
133368
134203
|
|
|
133369
134204
|
// src/auth/pkce.ts
|
|
133370
|
-
import { createHash as
|
|
134205
|
+
import { createHash as createHash10, randomBytes as randomBytes3 } from "crypto";
|
|
133371
134206
|
function generatePkcePair() {
|
|
133372
134207
|
const verifier = base64UrlEncode(randomBytes3(VERIFIER_BYTES));
|
|
133373
|
-
const challenge = base64UrlEncode(
|
|
134208
|
+
const challenge = base64UrlEncode(createHash10("sha256").update(verifier).digest());
|
|
133374
134209
|
return { verifier, challenge, method: "S256" };
|
|
133375
134210
|
}
|
|
133376
134211
|
function generateState() {
|