hyperframes 0.8.58 → 0.8.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/cli.js +4529 -3220
  2. package/dist/docs/data-attributes.md +2 -1
  3. package/dist/fontLocalizeCli.js +96 -16
  4. package/dist/hyperframe-runtime.js +25 -25
  5. package/dist/hyperframe.manifest.json +1 -1
  6. package/dist/hyperframe.runtime.iife.js +25 -25
  7. package/dist/hyperframes-player.global.js +3 -3
  8. package/dist/registry/localSemantic.js +548 -0
  9. package/dist/skills/hyperframes-cli/SKILL.md +2 -2
  10. package/dist/skills/media-use/SKILL.md +96 -0
  11. package/dist/skills/media-use/audio/assets/sfx/CREDITS.md +35 -0
  12. package/dist/skills/media-use/audio/assets/sfx/chime.mp3 +0 -0
  13. package/dist/skills/media-use/audio/assets/sfx/click-soft.mp3 +0 -0
  14. package/dist/skills/media-use/audio/assets/sfx/click.mp3 +0 -0
  15. package/dist/skills/media-use/audio/assets/sfx/error.mp3 +0 -0
  16. package/dist/skills/media-use/audio/assets/sfx/glitch-1.mp3 +0 -0
  17. package/dist/skills/media-use/audio/assets/sfx/glitch-2.mp3 +0 -0
  18. package/dist/skills/media-use/audio/assets/sfx/glitch-3.mp3 +0 -0
  19. package/dist/skills/media-use/audio/assets/sfx/impact-bass-1.mp3 +0 -0
  20. package/dist/skills/media-use/audio/assets/sfx/impact-bass-2.mp3 +0 -0
  21. package/dist/skills/media-use/audio/assets/sfx/key-press.mp3 +0 -0
  22. package/dist/skills/media-use/audio/assets/sfx/manifest.json +97 -0
  23. package/dist/skills/media-use/audio/assets/sfx/notification.mp3 +0 -0
  24. package/dist/skills/media-use/audio/assets/sfx/ping.mp3 +0 -0
  25. package/dist/skills/media-use/audio/assets/sfx/pop.mp3 +0 -0
  26. package/dist/skills/media-use/audio/assets/sfx/riser.mp3 +0 -0
  27. package/dist/skills/media-use/audio/assets/sfx/sparkle.mp3 +0 -0
  28. package/dist/skills/media-use/audio/assets/sfx/typing.mp3 +0 -0
  29. package/dist/skills/media-use/audio/assets/sfx/whoosh-cinematic.mp3 +0 -0
  30. package/dist/skills/media-use/audio/assets/sfx/whoosh-short.mp3 +0 -0
  31. package/dist/skills/media-use/audio/assets/sfx/whoosh.mp3 +0 -0
  32. package/dist/skills/media-use/audio/references/bgm.md +74 -0
  33. package/dist/skills/media-use/audio/references/captions/authoring.md +163 -0
  34. package/dist/skills/media-use/audio/references/captions/motion.md +87 -0
  35. package/dist/skills/media-use/audio/references/captions/transcript-handling.md +97 -0
  36. package/dist/skills/media-use/audio/references/remove-background.md +143 -0
  37. package/dist/skills/media-use/audio/references/requirements.md +29 -0
  38. package/dist/skills/media-use/audio/references/sfx.md +42 -0
  39. package/dist/skills/media-use/audio/references/transcribe.md +52 -0
  40. package/dist/skills/media-use/audio/references/tts-to-captions.md +26 -0
  41. package/dist/skills/media-use/audio/references/tts.md +165 -0
  42. package/dist/skills/media-use/audio/scripts/audio.mjs +295 -0
  43. package/dist/skills/media-use/audio/scripts/audio.test.mjs +49 -0
  44. package/dist/skills/media-use/audio/scripts/heygen-tts.mjs +121 -0
  45. package/dist/skills/media-use/audio/scripts/lib/audio-meta.mjs +39 -0
  46. package/dist/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +136 -0
  47. package/dist/skills/media-use/audio/scripts/lib/bgm.mjs +257 -0
  48. package/dist/skills/media-use/audio/scripts/lib/bgm.test.mjs +30 -0
  49. package/dist/skills/media-use/audio/scripts/lib/concurrency.mjs +14 -0
  50. package/dist/skills/media-use/audio/scripts/lib/concurrency.test.mjs +41 -0
  51. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +156 -0
  52. package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +103 -0
  53. package/dist/skills/media-use/audio/scripts/lib/python.mjs +63 -0
  54. package/dist/skills/media-use/audio/scripts/lib/python.test.mjs +68 -0
  55. package/dist/skills/media-use/audio/scripts/lib/sfx.mjs +143 -0
  56. package/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +69 -0
  57. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +379 -0
  58. package/dist/skills/media-use/audio/scripts/lib/tts.spawn.test.mjs +158 -0
  59. package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +157 -0
  60. package/dist/skills/media-use/audio/scripts/lyria-recipe.py +136 -0
  61. package/dist/skills/media-use/audio/scripts/wait-bgm.mjs +171 -0
  62. package/dist/skills/media-use/audio/scripts/wait-bgm.test.mjs +65 -0
  63. package/dist/skills/media-use/luts/README.md +28 -0
  64. package/dist/skills/media-use/luts/index.json +57 -0
  65. package/dist/skills/media-use/references/audio.md +19 -0
  66. package/dist/skills/media-use/references/grading.md +160 -0
  67. package/dist/skills/media-use/references/media-treatment-recipes.md +929 -0
  68. package/dist/skills/media-use/references/media-treatments.md +202 -0
  69. package/dist/skills/media-use/references/memory.md +36 -0
  70. package/dist/skills/media-use/references/meta.md +61 -0
  71. package/dist/skills/media-use/references/operations.md +325 -0
  72. package/dist/skills/media-use/references/resolve.md +150 -0
  73. package/dist/skills/media-use/references/setup-providers.md +80 -0
  74. package/dist/skills/media-use/references/telemetry-dashboard.md +49 -0
  75. package/dist/skills/media-use/registry/localSemantic.js +548 -0
  76. package/dist/skills/media-use/scripts/audio-duck.mjs +113 -0
  77. package/dist/skills/media-use/scripts/compatibility.test.mjs +27 -0
  78. package/dist/skills/media-use/scripts/dither.mjs +328 -0
  79. package/dist/skills/media-use/scripts/dither.test.mjs +176 -0
  80. package/dist/skills/media-use/scripts/eval.mjs +369 -0
  81. package/dist/skills/media-use/scripts/lib/adopt.mjs +128 -0
  82. package/dist/skills/media-use/scripts/lib/adopt.test.mjs +95 -0
  83. package/dist/skills/media-use/scripts/lib/bgm-provider.mjs +20 -0
  84. package/dist/skills/media-use/scripts/lib/brand-provider.mjs +59 -0
  85. package/dist/skills/media-use/scripts/lib/bundled-sfx-provider.mjs +119 -0
  86. package/dist/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +139 -0
  87. package/dist/skills/media-use/scripts/lib/cache.mjs +150 -0
  88. package/dist/skills/media-use/scripts/lib/candidates.mjs +91 -0
  89. package/dist/skills/media-use/scripts/lib/candidates.test.mjs +155 -0
  90. package/dist/skills/media-use/scripts/lib/codex-provider.mjs +161 -0
  91. package/dist/skills/media-use/scripts/lib/codex-provider.test.mjs +34 -0
  92. package/dist/skills/media-use/scripts/lib/coverage.test.mjs +132 -0
  93. package/dist/skills/media-use/scripts/lib/cube-build.mjs +181 -0
  94. package/dist/skills/media-use/scripts/lib/cube-build.test.mjs +80 -0
  95. package/dist/skills/media-use/scripts/lib/cube-validate.mjs +198 -0
  96. package/dist/skills/media-use/scripts/lib/cube-validate.test.mjs +125 -0
  97. package/dist/skills/media-use/scripts/lib/cutlist.mjs +184 -0
  98. package/dist/skills/media-use/scripts/lib/cutlist.test.mjs +162 -0
  99. package/dist/skills/media-use/scripts/lib/duck.mjs +95 -0
  100. package/dist/skills/media-use/scripts/lib/duck.test.mjs +153 -0
  101. package/dist/skills/media-use/scripts/lib/error-diffusion.mjs +230 -0
  102. package/dist/skills/media-use/scripts/lib/error-diffusion.test.mjs +102 -0
  103. package/dist/skills/media-use/scripts/lib/freeze.mjs +62 -0
  104. package/dist/skills/media-use/scripts/lib/freeze.test.mjs +46 -0
  105. package/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +265 -0
  106. package/dist/skills/media-use/scripts/lib/grade-analyzer.test.mjs +285 -0
  107. package/dist/skills/media-use/scripts/lib/heygen-cli.mjs +191 -0
  108. package/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +301 -0
  109. package/dist/skills/media-use/scripts/lib/heygen-search.mjs +45 -0
  110. package/dist/skills/media-use/scripts/lib/heygen-search.test.mjs +49 -0
  111. package/dist/skills/media-use/scripts/lib/heygen-video-provider.mjs +138 -0
  112. package/dist/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +435 -0
  113. package/dist/skills/media-use/scripts/lib/image-provider.mjs +44 -0
  114. package/dist/skills/media-use/scripts/lib/index-gen.mjs +63 -0
  115. package/dist/skills/media-use/scripts/lib/local-media-search.mjs +32 -0
  116. package/dist/skills/media-use/scripts/lib/local-models.mjs +318 -0
  117. package/dist/skills/media-use/scripts/lib/local-models.test.mjs +220 -0
  118. package/dist/skills/media-use/scripts/lib/local-run.mjs +78 -0
  119. package/dist/skills/media-use/scripts/lib/local-run.test.mjs +121 -0
  120. package/dist/skills/media-use/scripts/lib/logo-provider.mjs +223 -0
  121. package/dist/skills/media-use/scripts/lib/logo-provider.test.mjs +154 -0
  122. package/dist/skills/media-use/scripts/lib/ltx-video-provider.mjs +94 -0
  123. package/dist/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +316 -0
  124. package/dist/skills/media-use/scripts/lib/lut-preset-provider.mjs +271 -0
  125. package/dist/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +199 -0
  126. package/dist/skills/media-use/scripts/lib/manifest.mjs +229 -0
  127. package/dist/skills/media-use/scripts/lib/manifest.test.mjs +388 -0
  128. package/dist/skills/media-use/scripts/lib/match.mjs +47 -0
  129. package/dist/skills/media-use/scripts/lib/media-fetch.mjs +71 -0
  130. package/dist/skills/media-use/scripts/lib/media-fetch.test.mjs +169 -0
  131. package/dist/skills/media-use/scripts/lib/media-search.d.mts +9 -0
  132. package/dist/skills/media-use/scripts/lib/media-search.mjs +107 -0
  133. package/dist/skills/media-use/scripts/lib/mflux-provider.mjs +128 -0
  134. package/dist/skills/media-use/scripts/lib/mflux-provider.test.mjs +174 -0
  135. package/dist/skills/media-use/scripts/lib/misses.mjs +49 -0
  136. package/dist/skills/media-use/scripts/lib/misses.test.mjs +78 -0
  137. package/dist/skills/media-use/scripts/lib/npx-sync.mjs +31 -0
  138. package/dist/skills/media-use/scripts/lib/npx-sync.test.mjs +50 -0
  139. package/dist/skills/media-use/scripts/lib/parakeet-words.mjs +27 -0
  140. package/dist/skills/media-use/scripts/lib/parakeet-words.test.mjs +44 -0
  141. package/dist/skills/media-use/scripts/lib/prefs-store.mjs +180 -0
  142. package/dist/skills/media-use/scripts/lib/prefs-store.test.mjs +189 -0
  143. package/dist/skills/media-use/scripts/lib/probe.mjs +39 -0
  144. package/dist/skills/media-use/scripts/lib/probe.test.mjs +31 -0
  145. package/dist/skills/media-use/scripts/lib/providers.mjs +5 -0
  146. package/dist/skills/media-use/scripts/lib/recipe-store.mjs +367 -0
  147. package/dist/skills/media-use/scripts/lib/recipe-store.test.mjs +367 -0
  148. package/dist/skills/media-use/scripts/lib/registry.mjs +218 -0
  149. package/dist/skills/media-use/scripts/lib/registry.test.mjs +262 -0
  150. package/dist/skills/media-use/scripts/lib/search.mjs +24 -0
  151. package/dist/skills/media-use/scripts/lib/search.test.mjs +32 -0
  152. package/dist/skills/media-use/scripts/lib/sfx-provider.mjs +23 -0
  153. package/dist/skills/media-use/scripts/lib/specs.mjs +132 -0
  154. package/dist/skills/media-use/scripts/lib/specs.test.mjs +157 -0
  155. package/dist/skills/media-use/scripts/lib/stats.mjs +117 -0
  156. package/dist/skills/media-use/scripts/lib/stats.test.mjs +165 -0
  157. package/dist/skills/media-use/scripts/lib/telemetry.mjs +193 -0
  158. package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +373 -0
  159. package/dist/skills/media-use/scripts/lib/tts-local-provider.mjs +92 -0
  160. package/dist/skills/media-use/scripts/lib/tts-local-provider.test.mjs +72 -0
  161. package/dist/skills/media-use/scripts/lib/usage.mjs +57 -0
  162. package/dist/skills/media-use/scripts/lib/usage.test.mjs +54 -0
  163. package/dist/skills/media-use/scripts/lib/voice-provider.mjs +57 -0
  164. package/dist/skills/media-use/scripts/lib/voice-provider.test.mjs +46 -0
  165. package/dist/skills/media-use/scripts/lib/words.mjs +18 -0
  166. package/dist/skills/media-use/scripts/prefs.mjs +70 -0
  167. package/dist/skills/media-use/scripts/recipe.mjs +103 -0
  168. package/dist/skills/media-use/scripts/resolve.mjs +1287 -0
  169. package/dist/skills/media-use/scripts/transcribe.mjs +180 -0
  170. package/dist/skills/media-use/scripts/transcript-cut.mjs +239 -0
  171. package/dist/skills/registry/localSemantic.js +548 -0
  172. package/dist/studio/assets/{hyperframes-player-zGyOcwwh.js → hyperframes-player-Di7GyCOP.js} +3 -3
  173. package/dist/studio/assets/{index-DKJpHYYd.css → index-CBKb_0TI.css} +1 -1
  174. package/dist/studio/assets/{index-d8ferjRc.js → index-Dpq2lkOm.js} +190 -190
  175. package/dist/studio/assets/{index-ZJaRCDYV.js → index-Dx_pt9m4.js} +1 -1
  176. package/dist/studio/assets/{index-BcE2OSVA.js → index-jAjhQTrB.js} +1 -1
  177. package/dist/studio/index.d.ts +549 -13
  178. package/dist/studio/index.html +2 -2
  179. package/dist/studio/index.js +23133 -21941
  180. package/dist/studio/index.js.map +1 -1
  181. package/dist/studio/styles.css +1 -1
  182. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
- "use strict";(()=>{var qh=Object.create;var Oo=Object.defineProperty;var $h=Object.getOwnPropertyDescriptor;var jh=Object.getOwnPropertyNames;var Kh=Object.getPrototypeOf,Yh=Object.prototype.hasOwnProperty;var Xh=(e,t,n)=>t in e?Oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Jh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jh(t))!Yh.call(e,i)&&i!==n&&Oo(e,i,{get:()=>t[i],enumerable:!(r=$h(t,i))||r.enumerable});return e};var Qh=(e,t,n)=>(n=e!=null?qh(Kh(e)):{},Jh(t||!e||!e.__esModule?Oo(n,"default",{value:e,enumerable:!0}):n,e));var xe=(e,t,n)=>Xh(e,typeof t!="symbol"?t+"":t,n);var ad=ae((y_,$a)=>{var ee=String,od=function(){return{isColorSupported:!1,reset:ee,bold:ee,dim:ee,italic:ee,underline:ee,inverse:ee,hidden:ee,strikethrough:ee,black:ee,red:ee,green:ee,yellow:ee,blue:ee,magenta:ee,cyan:ee,white:ee,gray:ee,bgBlack:ee,bgRed:ee,bgGreen:ee,bgYellow:ee,bgBlue:ee,bgMagenta:ee,bgCyan:ee,bgWhite:ee,blackBright:ee,redBright:ee,greenBright:ee,yellowBright:ee,blueBright:ee,magentaBright:ee,cyanBright:ee,whiteBright:ee,bgBlackBright:ee,bgRedBright:ee,bgGreenBright:ee,bgYellowBright:ee,bgBlueBright:ee,bgMagentaBright:ee,bgCyanBright:ee,bgWhiteBright:ee}};$a.exports=od();$a.exports.createColors=od});var ja=ae(()=>{});var Mi=ae((A_,ud)=>{"use strict";var sd=ad(),ld=ja(),ir=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=sd.isColorSupported);let r=d=>d,i=d=>d,o=d=>d;if(t){let{bold:d,gray:f,red:m}=sd.createColors(!0);i=p=>d(m(p)),r=p=>f(p),ld&&(o=p=>ld(p))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,p=" "+(" "+m).slice(-u)+" | ";if(m===this.line){if(d.length>160){let y=20,x=Math.max(0,this.column-y),_=Math.max(this.column+y,this.endColumn+y),k=d.slice(x,_),C=r(p.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return i(">")+r(p)+o(k)+`
1
+ "use strict";(()=>{var n0=Object.create;var Bo=Object.defineProperty;var r0=Object.getOwnPropertyDescriptor;var i0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,a0=Object.prototype.hasOwnProperty;var s0=(e,t,n)=>t in e?Bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var l0=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of i0(t))!a0.call(e,i)&&i!==n&&Bo(e,i,{get:()=>t[i],enumerable:!(r=r0(t,i))||r.enumerable});return e};var u0=(e,t,n)=>(n=e!=null?n0(o0(e)):{},l0(t||!e||!e.__esModule?Bo(n,"default",{value:e,enumerable:!0}):n,e));var le=(e,t,n)=>s0(e,typeof t!="symbol"?t+"":t,n);var gd=oe((Vw,Xa)=>{var Z=String,hd=function(){return{isColorSupported:!1,reset:Z,bold:Z,dim:Z,italic:Z,underline:Z,inverse:Z,hidden:Z,strikethrough:Z,black:Z,red:Z,green:Z,yellow:Z,blue:Z,magenta:Z,cyan:Z,white:Z,gray:Z,bgBlack:Z,bgRed:Z,bgGreen:Z,bgYellow:Z,bgBlue:Z,bgMagenta:Z,bgCyan:Z,bgWhite:Z,blackBright:Z,redBright:Z,greenBright:Z,yellowBright:Z,blueBright:Z,magentaBright:Z,cyanBright:Z,whiteBright:Z,bgBlackBright:Z,bgRedBright:Z,bgGreenBright:Z,bgYellowBright:Z,bgBlueBright:Z,bgMagentaBright:Z,bgCyanBright:Z,bgWhiteBright:Z}};Xa.exports=hd();Xa.exports.createColors=hd});var Ja=oe(()=>{});var Li=oe(($w,yd)=>{"use strict";var bd=gd(),xd=Ja(),sr=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=bd.isColorSupported);let r=d=>d,i=d=>d,o=d=>d;if(t){let{bold:d,gray:f,red:m}=bd.createColors(!0);i=p=>d(m(p)),r=p=>f(p),xd&&(o=p=>xd(p))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,p=" "+(" "+m).slice(-u)+" | ";if(m===this.line){if(d.length>160){let y=20,x=Math.max(0,this.column-y),w=Math.max(this.column+y,this.endColumn+y),k=d.slice(x,w),C=r(p.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return i(">")+r(p)+o(k)+`
2
2
  `+C+i("^")}let g=r(p.replace(/\d/g," "))+d.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(p)+o(d)+`
3
3
  `+g+i("^")}return" "+r(p)+o(d)}).join(`
4
4
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
5
5
 
6
6
  `+t+`
7
- `),this.name+": "+this.message+t}};ud.exports=ir;ir.default=ir});var Ka=ae((E_,pd)=>{"use strict";var vb=/(<)(\/?style\b)/gi,Ab=/(<)(!--)/g,Eb=/[\t\n\f\r "#'()/;[\\\]{}]/;function Ke(e){return typeof e!="string"||!e.includes("<")?e:e.replace(vb,"\\3c $2").replace(Ab,"\\3c $2")}var cd={after:`
7
+ `),this.name+": "+this.message+t}};yd.exports=sr;sr.default=sr});var Qa=oe((jw,_d)=>{"use strict";var Db=/(<)(\/?style\b)/gi,Ib=/(<)(!--)/g,Pb=/[\t\n\f\r "#'()/;[\\\]{}]/;function Ke(e){return typeof e!="string"||!e.includes("<")?e:e.replace(Db,"\\3c $2").replace(Ib,"\\3c $2")}var Sd={after:`
8
8
  `,beforeClose:`
9
9
  `,beforeComment:`
10
10
  `,beforeDecl:`
11
11
  `,beforeOpen:" ",beforeRule:`
12
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function wb(e){return e[0].toUpperCase()+e.slice(1)}function dd(e,t){let n="@"+t.name,r=t.params?e.rawValue(t,"params"):"",i=t.raws.afterName;return typeof i>"u"?i=r?" ":"":i===""&&r&&!Eb.test(r[0])&&(i=" "),n+i+r}function _b(e){if(!e.prop.startsWith("--"))return!1;let t=e.raws.before;return typeof t>"u"||!/\S$/.test(t)}function fd(e,t,n){let r=n.nodes,i=r.length-1;for(;i>0&&r[i].type==="comment";)i-=1;let o=e.raw(n,"semicolon"),a=n.type==="document";for(let l=r.length-1;l>=0;l--){let s=r[l],u=i!==l||o;!u&&l<r.length-1&&(s.type==="atrule"&&!s.nodes||s.type==="decl"&&_b(s))&&(u=!0),t.push({document:a,node:s,semicolon:u})}}function md(e,t,n,r){let i=e.raw(n,"between","beforeOpen");e.builder(Ke(r+i)+"{",n,"start");let o=n.nodes&&n.nodes.length,a=()=>{let l=o?e.raw(n,"after"):e.raw(n,"after","emptyBody");l&&e.builder(Ke(l)),e.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&e.builder(Ke(n.raws.ownSemicolon),n,"end")};o?(t.push(a),fd(e,t,n)):a()}var or=class e{constructor(t){this.builder=t}atrule(t,n){let r=dd(this,t);if(t.nodes)this.block(t,r);else{let i=(t.raws.between||"")+(n?";":"");this.builder(Ke(r+i),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
13
- `)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(Ke(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(Ke(i)),this.builder("}",t,"end")}body(t){let n=e.prototype,r=["atrule","block","body","rule","stringify"].every(o=>this[o]===n[o]),i=[];for(fd(this,i,t);i.length>0;){let o=i.pop();if(typeof o=="function"){o();continue}let a=o.node,l=this.raw(a,"before");l&&this.builder(o.document?l:Ke(l)),r&&a.type==="rule"?md(this,i,a,this.rawValue(a,"selector")):r&&a.type==="atrule"&&a.nodes?md(this,i,a,dd(this,a)):this.stringify(a,o.semicolon)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(Ke("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(Ke(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return cd[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+wb(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=cd[r]),l[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
12
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ob(e){return e[0].toUpperCase()+e.slice(1)}function vd(e,t){let n="@"+t.name,r=t.params?e.rawValue(t,"params"):"",i=t.raws.afterName;return typeof i>"u"?i=r?" ":"":i===""&&r&&!Pb.test(r[0])&&(i=" "),n+i+r}function Gb(e){if(!e.prop.startsWith("--"))return!1;let t=e.raws.before;return typeof t>"u"||!/\S$/.test(t)}function Ed(e,t,n){let r=n.nodes,i=r.length-1;for(;i>0&&r[i].type==="comment";)i-=1;let o=e.raw(n,"semicolon"),a=n.type==="document";for(let l=r.length-1;l>=0;l--){let s=r[l],u=i!==l||o;!u&&l<r.length-1&&(s.type==="atrule"&&!s.nodes||s.type==="decl"&&Gb(s))&&(u=!0),t.push({document:a,node:s,semicolon:u})}}function Ad(e,t,n,r){let i=e.raw(n,"between","beforeOpen");e.builder(Ke(r+i)+"{",n,"start");let o=n.nodes&&n.nodes.length,a=()=>{let l=o?e.raw(n,"after"):e.raw(n,"after","emptyBody");l&&e.builder(Ke(l)),e.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&e.builder(Ke(n.raws.ownSemicolon),n,"end")};o?(t.push(a),Ed(e,t,n)):a()}var lr=class e{constructor(t){this.builder=t}atrule(t,n){let r=vd(this,t);if(t.nodes)this.block(t,r);else{let i=(t.raws.between||"")+(n?";":"");this.builder(Ke(r+i),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
13
+ `)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(Ke(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(Ke(i)),this.builder("}",t,"end")}body(t){let n=e.prototype,r=["atrule","block","body","rule","stringify"].every(o=>this[o]===n[o]),i=[];for(Ed(this,i,t);i.length>0;){let o=i.pop();if(typeof o=="function"){o();continue}let a=o.node,l=this.raw(a,"before");l&&this.builder(o.document?l:Ke(l)),r&&a.type==="rule"?Ad(this,i,a,this.rawValue(a,"selector")):r&&a.type==="atrule"&&a.nodes?Ad(this,i,a,vd(this,a)):this.stringify(a,o.semicolon)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(Ke("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(Ke(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Sd[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+Ob(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Sd[r]),l[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`
14
14
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
15
15
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
16
16
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
17
17
  `)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
18
- `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(t.source&&t.source.input.hasBOM&&this.builder("\uFEFF",t,"start"),this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:Ke(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(Ke(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};pd.exports=or;or.default=or});var ar=ae((w_,hd)=>{"use strict";var Cb=Ka();function Ya(e,t){new Cb(t).stringify(e)}hd.exports=Ya;Ya.default=Ya});var sr=ae((__,Xa)=>{"use strict";Xa.exports.isClean=Symbol("isClean");Xa.exports.my=Symbol("my")});var cr=ae((C_,gd)=>{"use strict";var Rb=Mi(),Tb=Ka(),kb=ar(),{isClean:lr,my:Mb}=sr();function Fb(e,t){let n=new e.constructor,r=[[e,n,t]];for(;r.length>0;){let[i,o,a]=r.pop();for(let l in i){if(!Object.prototype.hasOwnProperty.call(i,l)||l==="proxyCache")continue;let s=i[l],u=typeof s;if(l==="parent"&&u==="object")a&&(o[l]=a);else if(l==="source")o[l]=s;else if(Array.isArray(s)){let d=[];o[l]=d;for(let f of s){let m=new f.constructor;d.push(m),r.push([f,m,o])}}else{if(u==="object"&&s!==null){let d=new s.constructor;r.push([s,d,void 0]),s=d}o[l]=s}}}return n}function it(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`
19
- `?(n=1,r+=1):n+=1}return i}var ur=class e{get proxyOf(){return this}constructor(t={}){this.raws={},this[lr]=!1,this[Mb]=!0;for(let n of Object.keys(t))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"&&r.parent?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=Fb(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new Rb(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[lr]=!0}markDirty(){if(this[lr]){this[lr]=!1;let t=this;for(;t=t.parent;)t[lr]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:it(n,this.source.start)};if(t.index)r=this.positionInside(t.index);else if(t.word){let o=n.slice(it(n,this.source.start),it(n,this.source.end)).indexOf(t.word);o!==-1&&(r=this.positionInside(o))}return r}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=it(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`
20
- `?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:it(n,this.source.start)},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:it(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(it(n,this.source.start),it(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:it(n,t.start)}:typeof t.index=="number"&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:it(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):typeof t.index=="number"&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new Tb().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r=n==null;n=n||new Map;let i=[],o=[[this,i,0]];for(let l=0;l<o.length;l++){let[s,u,d]=o[l],f={};u[d]=f;for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m)||m==="parent"||m==="proxyCache")continue;let p=s[m];if(Array.isArray(p)){let g=[];f[m]=g;for(let y=0;y<p.length;y++){let x=p[y];typeof x=="object"&&x.toJSON?x.toJSON===e.prototype.toJSON?o.push([x,g,y]):g[y]=x.toJSON(null,n):g[y]=x}}else if(typeof p=="object"&&p.toJSON)p.toJSON===e.prototype.toJSON?o.push([p,f,m]):f[m]=p.toJSON(null,n);else if(m==="source"){if(p==null)continue;let g=n.get(p.input);g==null&&(g=n.size,n.set(p.input,g)),f[m]={end:p.end,inputId:g,start:p.start}}else f[m]=p}}let a=i[0];return r&&(a.inputs=[...n.keys()].map(l=>l.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=kb){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};gd.exports=ur;ur.default=ur});var mr=ae((R_,bd)=>{"use strict";var Nb=cr(),dr=class extends Nb{constructor(t){super(t),this.type="comment"}};bd.exports=dr;dr.default=dr});var pr=ae((T_,xd)=>{"use strict";var Lb=cr(),fr=class extends Lb{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};xd.exports=fr;fr.default=fr});var pt=ae((k_,Cd)=>{"use strict";var Sd=mr(),vd=pr(),yd=cr(),{isClean:Ad,my:Ed}=sr(),Ja,wd,_d,Qa;function Db(e){let t=e.slice();for(;t.length>0;){let n=t.pop();if(delete n.source,n.nodes){n.nodes=n.nodes.slice();for(let r of n.nodes)t.push(r)}}return e.slice()}function Ib(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Ad]=!1,n.proxyOf.nodes)for(let r of n.proxyOf.nodes)t.push(r)}}var ot=class e extends yd{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){let n=[this];for(;n.length>0;){let r=n.pop();if(r!==this&&r.cleanRaws!==e.prototype.cleanRaws){r.cleanRaws(t);continue}if(yd.prototype.cleanRaws.call(r,t),r.nodes)for(let i of r.nodes)n.push(i)}}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=Db(wd(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new vd(t)]}else if(t.selector||t.selectors)t=[new Qa(t)];else if(t.name)t=[new Ja(t)];else if(t.text)t=[new Sd(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ed]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Ad]&&Ib(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let n=[{iterator:this.getIterator(),node:this.proxyOf}];for(;n.length>0;){let{iterator:r,node:i}=n[n.length-1],o=i.indexes[r];if(o>=i.proxyOf.nodes.length){delete i.indexes[r],n.pop();let s=n[n.length-1];s&&(s.node.indexes[s.iterator]+=1);continue}let a=i.proxyOf.nodes[o],l;try{l=t(a,o)}catch(s){throw a.addToError(s)}if(l===!1){for(let s of n)delete s.node.indexes[s.iterator];return!1}a.walk&&a.proxyOf.nodes?n.push({iterator:a.getIterator(),node:a}):i.indexes[r]+=1}}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};ot.registerParse=e=>{wd=e};ot.registerRule=e=>{Qa=e};ot.registerAtRule=e=>{Ja=e};ot.registerRoot=e=>{_d=e};Cd.exports=ot;ot.default=ot;ot.rebuild=e=>{let t=[e];for(;t.length>0;){let n=t.pop();if(n.type==="atrule"?Object.setPrototypeOf(n,Ja.prototype):n.type==="rule"?Object.setPrototypeOf(n,Qa.prototype):n.type==="decl"?Object.setPrototypeOf(n,vd.prototype):n.type==="comment"?Object.setPrototypeOf(n,Sd.prototype):n.type==="root"&&Object.setPrototypeOf(n,_d.prototype),n[Ed]=!0,n.nodes)for(let r of n.nodes)t.push(r)}}});var Fi=ae((M_,Td)=>{"use strict";var Rd=pt(),mn=class extends Rd{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};Td.exports=mn;mn.default=mn;Rd.registerAtRule(mn)});var Ni=ae((F_,Fd)=>{"use strict";var Pb=pt(),kd,Md,Wt=class extends Pb{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new kd(new Md,this,t).stringify()}};Wt.registerLazyResult=e=>{kd=e};Wt.registerProcessor=e=>{Md=e};Fd.exports=Wt;Wt.default=Wt});var Ld=ae((N_,Nd)=>{var Ob="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Gb=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Hb=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Ob[Math.random()*64|0];return t};Nd.exports={nanoid:Hb,customAlphabet:Gb}});var Li=ae(()=>{});var Di=ae(()=>{});var Za=ae(()=>{});var Dd=ae(()=>{});var es=ae((U_,Gd)=>{"use strict";var{existsSync:Bb,readFileSync:Ub,realpathSync:Wb}=Dd(),{dirname:Ii,isAbsolute:Vb,join:zb,relative:qb,sep:$b}=Li(),{SourceMapConsumer:Id,SourceMapGenerator:Pd}=Di();function Od(e){try{return Wb(e)}catch{return e}}function jb(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var hr=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Ii(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Id(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return jb(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!r&&!this.unsafeMap){if(!/\.map$/i.test(t)||!n)return;let i=qb(Od(Ii(n)),Od(t));if(i===".."||i.startsWith(".."+$b)||Vb(i))return}if(this.root=Ii(t),Bb(t))return this.mapFile=t,Ub(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof Id)return Pd.fromSourceMap(n).toString();if(n instanceof Pd)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=zb(Ii(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};Gd.exports=hr;hr.default=hr});var gr=ae((W_,Vd)=>{"use strict";var{nanoid:Kb}=Ld(),{isAbsolute:rs,resolve:is}=Li(),{SourceMapConsumer:Yb,SourceMapGenerator:Xb}=Di(),{fileURLToPath:Hd,pathToFileURL:Pi}=Za(),Bd=Mi(),Jb=es(),ts=ja(),ns=Symbol("lineToIndexCache"),Qb=!!(Yb&&Xb),Ud=!!(is&&rs);function Wd(e){if(e[ns])return e[ns];let t=e.css.split(`
21
- `),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[ns]=n,n}var fn=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!Ud||/^\w+:\/\//.test(n.from)||rs(n.from)?this.file=n.from:this.file=is(n.from)),Ud&&Qb){let r=new Jb(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+Kb(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;if(n&&typeof n=="object"){let f=n,m=r;if(typeof f.offset=="number"){s=f.offset;let p=this.fromOffset(s);n=p.line,r=p.col}else n=f.line,r=f.column,s=this.fromLineAndColumn(n,r);if(typeof m.offset=="number"){l=m.offset;let p=this.fromOffset(l);a=p.line,o=p.col}else a=m.line,o=m.column,l=this.fromLineAndColumn(m.line,m.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let f=this.fromOffset(s);n=f.line,r=f.col}let d=this.origin(n,r,a,o);return d?u=new Bd(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,i.plugin):u=new Bd(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(Pi&&(u.input.url=Pi(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return Wd(this)[t-1]+n-1}fromOffset(t){let n=Wd(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:is(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n-1,line:t});if(!a.source)return!1;let l;if(typeof r=="number"){let f=o.originalPositionFor({column:i-1,line:r});f.source&&(l=f)}let s;rs(a.source)?s=Pi(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||Pi(this.map.mapFile));let u={column:a.column+1,endColumn:l&&l.column+1,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(Hd)u.file=Hd(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=o.sourceContentFor(a.source);return d&&(u.source=d),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};Vd.exports=fn;fn.default=fn;ts&&ts.registerInput&&ts.registerInput(fn)});var pn=ae((V_,jd)=>{"use strict";var zd=pt(),qd,$d,Tt=class extends zd{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=new Set;for(let a of Array.isArray(t)?t:[t])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before<"u"&&i.add(a.raws);let o=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let a of o)i.has(a.raws)||(a.raws.before=n.raws.before)}return o}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new qd(new $d,this,t).stringify()}};Tt.registerLazyResult=e=>{qd=e};Tt.registerProcessor=e=>{$d=e};jd.exports=Tt;Tt.default=Tt;zd.registerRoot(Tt)});var os=ae((z_,Kd)=>{"use strict";var br={comma(e){return br.split(e,[","],!0)},space(e){let t=[" ",`
22
- `," "];return br.split(e,t)},split(e,t,n){if(typeof e!="string")return[];let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let f of e)if(u?u=!1:f==="\\"?u=!0:l?f===s&&(l=!1):f==='"'||f==="'"?(l=!0,s=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&t.includes(f)&&(o=!0),o){let m=i.trim();(n||m!=="")&&r.push(m),i="",o=!1}else i+=f;let d=i.trim();return(n||d!=="")&&r.push(d),r}};Kd.exports=br;br.default=br});var Oi=ae((q_,Xd)=>{"use strict";var Yd=pt(),Zb=os(),hn=class extends Yd{get selectors(){return Zb.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};Xd.exports=hn;hn.default=hn;Yd.registerRule(hn)});var Zd=ae(($_,Qd)=>{"use strict";var ex=Fi(),tx=mr(),nx=pr(),rx=gr(),ix=es(),ox=pn(),ax=Oi();function Jd(e,t){return e.inputs?e.inputs.map(n=>{let r={...n,__proto__:rx.prototype};return r.map&&(r.map={...r.map,__proto__:ix.prototype}),r}):t}function sx(e,t,n){let r={...e};if(delete r.inputs,delete r.nodes,r.source){let{inputId:o,...a}=r.source;r.source=a,o!=null&&(r.source.input=t[o])}let i;if(r.type==="root")i=new ox(r);else if(r.type==="decl")i=new nx(r);else if(r.type==="rule")i=new ax(r);else if(r.type==="comment")i=new tx(r);else if(r.type==="atrule")i=new ex(r);else throw new Error("Unknown node type: "+e.type);if(n){i.nodes=n;for(let o of n)o.parent=i}return i}function Gi(e,t){if(Array.isArray(e))return e.map(i=>Gi(i));let n,r=[{childIndex:0,children:[],inputs:Jd(e,t),json:e}];for(;r.length>0;){let i=r[r.length-1],o=i.json.nodes;if(o&&i.childIndex<o.length){let l=o[i.childIndex];i.childIndex+=1,r.push({childIndex:0,children:[],inputs:Jd(l,i.inputs),json:l});continue}r.pop();let a=sx(i.json,i.inputs,o?i.children:void 0);r.length>0?r[r.length-1].children.push(a):n=a}return n}Qd.exports=Gi;Gi.default=Gi});var ss=ae((j_,om)=>{"use strict";var{dirname:Hi,relative:tm,resolve:nm,sep:rm}=Li(),{SourceMapConsumer:im,SourceMapGenerator:Bi}=Di(),{pathToFileURL:em}=Za(),lx=gr(),ux=!!(im&&Bi),cx=!!(Hi&&nm&&tm&&rm),as=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
18
+ `);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(t.source&&t.source.input.hasBOM&&this.builder("\uFEFF",t,"start"),this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:Ke(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(Ke(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};_d.exports=lr;lr.default=lr});var ur=oe((Kw,wd)=>{"use strict";var Hb=Qa();function Za(e,t){new Hb(t).stringify(e)}wd.exports=Za;Za.default=Za});var cr=oe((Yw,es)=>{"use strict";es.exports.isClean=Symbol("isClean");es.exports.my=Symbol("my")});var fr=oe((Xw,Cd)=>{"use strict";var Bb=Li(),Ub=Qa(),Wb=ur(),{isClean:dr,my:Vb}=cr();function zb(e,t){let n=new e.constructor,r=[[e,n,t]];for(;r.length>0;){let[i,o,a]=r.pop();for(let l in i){if(!Object.prototype.hasOwnProperty.call(i,l)||l==="proxyCache")continue;let s=i[l],u=typeof s;if(l==="parent"&&u==="object")a&&(o[l]=a);else if(l==="source")o[l]=s;else if(Array.isArray(s)){let d=[];o[l]=d;for(let f of s){let m=new f.constructor;d.push(m),r.push([f,m,o])}}else{if(u==="object"&&s!==null){let d=new s.constructor;r.push([s,d,void 0]),s=d}o[l]=s}}}return n}function rt(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`
19
+ `?(n=1,r+=1):n+=1}return i}var mr=class e{get proxyOf(){return this}constructor(t={}){this.raws={},this[dr]=!1,this[Vb]=!0;for(let n of Object.keys(t))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"&&r.parent?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=zb(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new Bb(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[dr]=!0}markDirty(){if(this[dr]){this[dr]=!1;let t=this;for(;t=t.parent;)t[dr]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:rt(n,this.source.start)};if(t.index)r=this.positionInside(t.index);else if(t.word){let o=n.slice(rt(n,this.source.start),rt(n,this.source.end)).indexOf(t.word);o!==-1&&(r=this.positionInside(o))}return r}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=rt(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`
20
+ `?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:rt(n,this.source.start)},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:rt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(rt(n,this.source.start),rt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:rt(n,t.start)}:typeof t.index=="number"&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:rt(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):typeof t.index=="number"&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new Ub().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r=n==null;n=n||new Map;let i=[],o=[[this,i,0]];for(let l=0;l<o.length;l++){let[s,u,d]=o[l],f={};u[d]=f;for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m)||m==="parent"||m==="proxyCache")continue;let p=s[m];if(Array.isArray(p)){let g=[];f[m]=g;for(let y=0;y<p.length;y++){let x=p[y];typeof x=="object"&&x.toJSON?x.toJSON===e.prototype.toJSON?o.push([x,g,y]):g[y]=x.toJSON(null,n):g[y]=x}}else if(typeof p=="object"&&p.toJSON)p.toJSON===e.prototype.toJSON?o.push([p,f,m]):f[m]=p.toJSON(null,n);else if(m==="source"){if(p==null)continue;let g=n.get(p.input);g==null&&(g=n.size,n.set(p.input,g)),f[m]={end:p.end,inputId:g,start:p.start}}else f[m]=p}}let a=i[0];return r&&(a.inputs=[...n.keys()].map(l=>l.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=Wb){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Cd.exports=mr;mr.default=mr});var hr=oe((Jw,Rd)=>{"use strict";var qb=fr(),pr=class extends qb{constructor(t){super(t),this.type="comment"}};Rd.exports=pr;pr.default=pr});var br=oe((Qw,Td)=>{"use strict";var $b=fr(),gr=class extends $b{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};Td.exports=gr;gr.default=gr});var ft=oe((Zw,Pd)=>{"use strict";var Md=hr(),Fd=br(),kd=fr(),{isClean:Nd,my:Ld}=cr(),ts,Dd,Id,ns;function jb(e){let t=e.slice();for(;t.length>0;){let n=t.pop();if(delete n.source,n.nodes){n.nodes=n.nodes.slice();for(let r of n.nodes)t.push(r)}}return e.slice()}function Kb(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Nd]=!1,n.proxyOf.nodes)for(let r of n.proxyOf.nodes)t.push(r)}}var it=class e extends kd{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){let n=[this];for(;n.length>0;){let r=n.pop();if(r!==this&&r.cleanRaws!==e.prototype.cleanRaws){r.cleanRaws(t);continue}if(kd.prototype.cleanRaws.call(r,t),r.nodes)for(let i of r.nodes)n.push(i)}}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=jb(Dd(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Fd(t)]}else if(t.selector||t.selectors)t=[new ns(t)];else if(t.name)t=[new ts(t)];else if(t.text)t=[new Md(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ld]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Nd]&&Kb(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let n=[{iterator:this.getIterator(),node:this.proxyOf}];for(;n.length>0;){let{iterator:r,node:i}=n[n.length-1],o=i.indexes[r];if(o>=i.proxyOf.nodes.length){delete i.indexes[r],n.pop();let s=n[n.length-1];s&&(s.node.indexes[s.iterator]+=1);continue}let a=i.proxyOf.nodes[o],l;try{l=t(a,o)}catch(s){throw a.addToError(s)}if(l===!1){for(let s of n)delete s.node.indexes[s.iterator];return!1}a.walk&&a.proxyOf.nodes?n.push({iterator:a.getIterator(),node:a}):i.indexes[r]+=1}}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};it.registerParse=e=>{Dd=e};it.registerRule=e=>{ns=e};it.registerAtRule=e=>{ts=e};it.registerRoot=e=>{Id=e};Pd.exports=it;it.default=it;it.rebuild=e=>{let t=[e];for(;t.length>0;){let n=t.pop();if(n.type==="atrule"?Object.setPrototypeOf(n,ts.prototype):n.type==="rule"?Object.setPrototypeOf(n,ns.prototype):n.type==="decl"?Object.setPrototypeOf(n,Fd.prototype):n.type==="comment"?Object.setPrototypeOf(n,Md.prototype):n.type==="root"&&Object.setPrototypeOf(n,Id.prototype),n[Ld]=!0,n.nodes)for(let r of n.nodes)t.push(r)}}});var Di=oe((eC,Gd)=>{"use strict";var Od=ft(),pn=class extends Od{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};Gd.exports=pn;pn.default=pn;Od.registerAtRule(pn)});var Ii=oe((tC,Ud)=>{"use strict";var Yb=ft(),Hd,Bd,Wt=class extends Yb{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Hd(new Bd,this,t).stringify()}};Wt.registerLazyResult=e=>{Hd=e};Wt.registerProcessor=e=>{Bd=e};Ud.exports=Wt;Wt.default=Wt});var Vd=oe((nC,Wd)=>{var Xb="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Jb=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Qb=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Xb[Math.random()*64|0];return t};Wd.exports={nanoid:Qb,customAlphabet:Jb}});var Pi=oe(()=>{});var Oi=oe(()=>{});var rs=oe(()=>{});var zd=oe(()=>{});var is=oe((dC,Kd)=>{"use strict";var{existsSync:Zb,readFileSync:ex,realpathSync:tx}=zd(),{dirname:Gi,isAbsolute:nx,join:rx,relative:ix,sep:ox}=Pi(),{SourceMapConsumer:qd,SourceMapGenerator:$d}=Oi();function jd(e){try{return tx(e)}catch{return e}}function ax(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var xr=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Gi(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new qd(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return ax(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!r&&!this.unsafeMap){if(!/\.map$/i.test(t)||!n)return;let i=ix(jd(Gi(n)),jd(t));if(i===".."||i.startsWith(".."+ox)||nx(i))return}if(this.root=Gi(t),Zb(t))return this.mapFile=t,ex(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof qd)return $d.fromSourceMap(n).toString();if(n instanceof $d)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=rx(Gi(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};Kd.exports=xr;xr.default=xr});var yr=oe((mC,Zd)=>{"use strict";var{nanoid:sx}=Vd(),{isAbsolute:ss,resolve:ls}=Pi(),{SourceMapConsumer:lx,SourceMapGenerator:ux}=Oi(),{fileURLToPath:Yd,pathToFileURL:Hi}=rs(),Xd=Li(),cx=is(),os=Ja(),as=Symbol("lineToIndexCache"),dx=!!(lx&&ux),Jd=!!(ls&&ss);function Qd(e){if(e[as])return e[as];let t=e.css.split(`
21
+ `),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[as]=n,n}var hn=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!Jd||/^\w+:\/\//.test(n.from)||ss(n.from)?this.file=n.from:this.file=ls(n.from)),Jd&&dx){let r=new cx(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+sx(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;if(n&&typeof n=="object"){let f=n,m=r;if(typeof f.offset=="number"){s=f.offset;let p=this.fromOffset(s);n=p.line,r=p.col}else n=f.line,r=f.column,s=this.fromLineAndColumn(n,r);if(typeof m.offset=="number"){l=m.offset;let p=this.fromOffset(l);a=p.line,o=p.col}else a=m.line,o=m.column,l=this.fromLineAndColumn(m.line,m.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let f=this.fromOffset(s);n=f.line,r=f.col}let d=this.origin(n,r,a,o);return d?u=new Xd(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,i.plugin):u=new Xd(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(Hi&&(u.input.url=Hi(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return Qd(this)[t-1]+n-1}fromOffset(t){let n=Qd(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:ls(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n-1,line:t});if(!a.source)return!1;let l;if(typeof r=="number"){let f=o.originalPositionFor({column:i-1,line:r});f.source&&(l=f)}let s;ss(a.source)?s=Hi(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||Hi(this.map.mapFile));let u={column:a.column+1,endColumn:l&&l.column+1,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(Yd)u.file=Yd(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=o.sourceContentFor(a.source);return d&&(u.source=d),u}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};Zd.exports=hn;hn.default=hn;os&&os.registerInput&&os.registerInput(hn)});var gn=oe((fC,rm)=>{"use strict";var em=ft(),tm,nm,Tt=class extends em{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let i=new Set;for(let a of Array.isArray(t)?t:[t])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before<"u"&&i.add(a.raws);let o=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let a of o)i.has(a.raws)||(a.raws.before=n.raws.before)}return o}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new tm(new nm,this,t).stringify()}};Tt.registerLazyResult=e=>{tm=e};Tt.registerProcessor=e=>{nm=e};rm.exports=Tt;Tt.default=Tt;em.registerRoot(Tt)});var us=oe((pC,im)=>{"use strict";var Sr={comma(e){return Sr.split(e,[","],!0)},space(e){let t=[" ",`
22
+ `," "];return Sr.split(e,t)},split(e,t,n){if(typeof e!="string")return[];let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let f of e)if(u?u=!1:f==="\\"?u=!0:l?f===s&&(l=!1):f==='"'||f==="'"?(l=!0,s=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&t.includes(f)&&(o=!0),o){let m=i.trim();(n||m!=="")&&r.push(m),i="",o=!1}else i+=f;let d=i.trim();return(n||d!=="")&&r.push(d),r}};im.exports=Sr;Sr.default=Sr});var Bi=oe((hC,am)=>{"use strict";var om=ft(),mx=us(),bn=class extends om{get selectors(){return mx.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};am.exports=bn;bn.default=bn;om.registerRule(bn)});var um=oe((gC,lm)=>{"use strict";var fx=Di(),px=hr(),hx=br(),gx=yr(),bx=is(),xx=gn(),yx=Bi();function sm(e,t){return e.inputs?e.inputs.map(n=>{let r={...n,__proto__:gx.prototype};return r.map&&(r.map={...r.map,__proto__:bx.prototype}),r}):t}function Sx(e,t,n){let r={...e};if(delete r.inputs,delete r.nodes,r.source){let{inputId:o,...a}=r.source;r.source=a,o!=null&&(r.source.input=t[o])}let i;if(r.type==="root")i=new xx(r);else if(r.type==="decl")i=new hx(r);else if(r.type==="rule")i=new yx(r);else if(r.type==="comment")i=new px(r);else if(r.type==="atrule")i=new fx(r);else throw new Error("Unknown node type: "+e.type);if(n){i.nodes=n;for(let o of n)o.parent=i}return i}function Ui(e,t){if(Array.isArray(e))return e.map(i=>Ui(i));let n,r=[{childIndex:0,children:[],inputs:sm(e,t),json:e}];for(;r.length>0;){let i=r[r.length-1],o=i.json.nodes;if(o&&i.childIndex<o.length){let l=o[i.childIndex];i.childIndex+=1,r.push({childIndex:0,children:[],inputs:sm(l,i.inputs),json:l});continue}r.pop();let a=Sx(i.json,i.inputs,o?i.children:void 0);r.length>0?r[r.length-1].children.push(a):n=a}return n}lm.exports=Ui;Ui.default=Ui});var ds=oe((bC,hm)=>{"use strict";var{dirname:Wi,relative:dm,resolve:mm,sep:fm}=Pi(),{SourceMapConsumer:pm,SourceMapGenerator:Vi}=Oi(),{pathToFileURL:cm}=rs(),vx=yr(),Ax=!!(pm&&Vi),Ex=!!(Wi&&mm&&dm&&fm),cs=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
23
23
  `;this.css.includes(`\r
24
24
  `)&&(n=`\r
25
- `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Hi(t.file),i;this.mapOpts.sourcesContent===!1?(i=new im(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t="/*# sourceMappingURL=",n;for(;(n=this.css.lastIndexOf(t))!==-1;){let r=this.css.indexOf("*/",n+t.length);if(r===-1)break;for(;n>0&&this.css[n-1]===`
26
- `;)n--;this.css=this.css.slice(0,n)+this.css.slice(r+2)}}}}generate(){if(this.clearAnnotation(),cx&&ux&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Bi.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Bi({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 Bi({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\n/g),a?(t+=a.length,o=l.lastIndexOf(`
27
- `),n=l.length-o):n+=l.length,s&&u!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Hi(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Hi(nm(r,this.mapOpts.annotation)));let i=tm(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new lx(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(em){let r=em(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;rm==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};om.exports=as});var lm=ae((K_,sm)=>{"use strict";var Ui=/[\t\n\f\r "#'()/;[\\\]{}]/g,Wi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,dx=/.[\r\n"'(/\\]/,am=/[\da-f]/i;sm.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,d,f,m,p,g,y=r.length,x=0,_=[],k=[],C=-1;function L(){return x}function P(E){throw t.error("Unclosed "+E,x)}function F(){return k.length===0&&x>=y}function S(E){if(k.length)return k.pop();if(x>=y)return;let T=E?E.ignoreUnclosed:!1;switch(o=r.charCodeAt(x),o){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);d=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let I=String.fromCharCode(o);d=[I,I,x];break}case 40:{if(g=_.length?_.pop()[1]:"",p=r.charCodeAt(x+1),g==="url"&&p!==39&&p!==34&&p!==32&&p!==10&&p!==9&&p!==12&&p!==13){s=x;do{if(f=!1,s=r.indexOf(")",s+1),s===-1)if(i||T){s=x;break}else P("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["brackets",r.slice(x,s+1),x,s],x=s}else x<=C?d=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||dx.test(a)?(C=s===-1?y:s,d=["(","(",x]):(d=["brackets",a,x,s],x=s));break}case 39:case 34:{u=o===39?"'":'"',s=x;do{if(f=!1,s=r.indexOf(u,s+1),s===-1)if(i||T){s=x+1;break}else P("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{Ui.lastIndex=x+1,Ui.test(r),Ui.lastIndex===0?s=r.length-1:s=Ui.lastIndex-2,d=["at-word",r.slice(x,s+1),x,s],x=s;break}case 92:{for(s=x,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,am.test(r.charAt(s)))){for(;am.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}d=["word",r.slice(x,s+1),x,s],x=s;break}default:{o===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(i||T?s=r.length:P("comment")),d=["comment",r.slice(x,s+1),x,s],x=s):(Wi.lastIndex=x+1,Wi.test(r),Wi.lastIndex===0?s=r.length-1:s=Wi.lastIndex-2,d=["word",r.slice(x,s+1),x,s],_.push(d),x=s);break}}return x++,d}function A(E){k.push(E)}return{back:A,endOfFile:F,nextToken:S,position:L}}});var mm=ae((Y_,dm)=>{"use strict";var mx=Fi(),fx=mr(),px=pr(),hx=pn(),um=Oi(),gx=lm(),cm={empty:!0,space:!0};function bx(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function ls(e,t,n){let r="";for(let i=t;i<n;i++)r+=e[i][1];return r}var us=class{constructor(t){this.input=t,this.root=new hx,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new mx;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new fx;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=gx(this.input)}decl(t,n){let r=new px;this.init(r,t[0][2]);let i=t[t.length-1];i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||bx(t)),r.source.end.offset++;let o=0;for(;t[o][0]!=="word";)o===t.length-1&&this.unknownWord([t[o]]),o++;r.raws.before+=ls(t,0,o),r.source.start=this.getPosition(t[o][2]);let a=o;for(;o<t.length;){let m=t[o][0];if(m===":"||m==="space"||m==="comment")break;o++}r.prop=ls(t,a,o);let l=o,s;for(;o<t.length&&(s=t[o],o++,s[0]!==":");)s[0]==="word"&&/\w/.test(s[1])&&this.unknownWord([s]);r.raws.between=ls(t,l,o),(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let u=o;for(;o<t.length;){let m=t[o][0];if(m!=="space"&&m!=="comment")break;o++}let d=t.slice(u,o);t=t.slice(o),this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(s=t[m],s[1].toLowerCase()==="!important"){r.important=!0;let p=this.stringFrom(t,m);p=this.spacesFromEnd(t)+p,p!==" !important"&&(r.raws.important=p);break}else if(s[1].toLowerCase()==="important"){let p=t.slice(0),g="";for(let y=m;y>0;y--){let x=p[y][0];if(g.trim().startsWith("!")&&x!=="space")break;g=p.pop()[1]+g}g.trim().startsWith("!")&&(r.important=!0,r.raws.important=g,t=p)}if(s[0]!=="space"&&s[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=d.map(m=>m[1]).join(""),d=[]),this.raw(r,"value",d.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new um;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset++)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,a,l=r.length,s="",u=!0,d,f;for(let m=0;m<l;m+=1)o=r[m],a=o[0],a==="space"&&m===l-1&&!i?u=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!cm[f]&&!cm[d]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let m=r.reduce((p,g)=>p+g[1],"");t.raws[n]={raw:m,value:s}}t[n]=s}rule(t){t.pop();let n=new um;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};dm.exports=us});var zi=ae((X_,fm)=>{"use strict";var xx=pt(),yx=gr(),Sx=mm();function Vi(e,t){let n=new yx(e,t),r=new Sx(n);try{r.parse()}catch(i){throw i}return r.root}fm.exports=Vi;Vi.default=Vi;xx.registerParse(Vi)});var cs=ae((J_,pm)=>{"use strict";var vx=pt(),{my:Ax}=sr(),xr=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){n.node[Ax]||vx.rebuild(n.node);let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};pm.exports=xr;xr.default=xr});var qi=ae((Q_,hm)=>{"use strict";var Ex=cs(),yr=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new Ex(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};hm.exports=yr;yr.default=yr});var ds=ae((Z_,bm)=>{"use strict";var gm={};bm.exports=function(t){gm[t]||(gm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var ps=ae((tC,vm)=>{"use strict";var wx=pt(),_x=Ni(),Cx=ss(),Rx=zi(),xm=qi(),Tx=pn(),kx=ar(),{isClean:Ye,my:Mx}=sr(),eC=ds(),Fx={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Nx={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},Lx={Once:!0,postcssPlugin:!0,prepare:!0},gn=0;function Sr(e){return typeof e=="object"&&typeof e.then=="function"}function ms(e){let t=!1,n=Fx[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,gn,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,gn,n+"Exit"]:[n,n+"Exit"]}function ym(e){let t;return e.type==="document"?t=["Document",gn,"DocumentExit"]:e.type==="root"?t=["Root",gn,"RootExit"]:t=ms(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Sm(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Ye]=!1,n.nodes)for(let r of n.nodes)t.push(r)}return e}var fs={},kt=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=Sm(n);else if(n instanceof e||n instanceof xm)i=Sm(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=Rx;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[Mx]&&wx.rebuild(i)}this.result=new xm(t,i,r),this.helpers={...fs,postcss:fs,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!Nx[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Lx[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(Sr(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ye];){t[Ye]=!0;let n=[ym(t)];for(;n.length>0;){let r=this.visitTick(n);if(Sr(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return Sr(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=kx;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let o=new Cx(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(Sr(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ye];)t[Ye]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Sr(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator;n.descending&&(n.descending=!1,r.indexes[a]+=1);let l;for(;l=r.nodes[r.indexes[a]];){if(!l[Ye]){l[Ye]=!0,n.descending=!0,t.push(ym(l));return}r.indexes[a]+=1}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===gn){r.nodes&&r.nodes.length&&(r[Ye]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ye]=!0;let n=[{eventIndex:0,events:ms(t),iterator:0,node:t}];for(;n.length>0;){let r=n[n.length-1],i=r.node;if(r.iterator!==0){let o=r.iterator;r.descending&&(r.descending=!1,i.indexes[o]+=1);let a,l=!1;for(;a=i.nodes[i.indexes[o]];){if(!a[Ye]){a[Ye]=!0,r.descending=!0,n.push({eventIndex:0,events:ms(a),iterator:0,node:a}),l=!0;break}i.indexes[o]+=1}if(l)continue;r.iterator=0,delete i.indexes[o]}if(r.eventIndex<r.events.length){let o=r.events[r.eventIndex];if(r.eventIndex+=1,o===gn)i.nodes&&i.nodes.length&&(r.iterator=i.getIterator());else{let a=this.listeners[o];a&&this.visitSync(a,i.toProxy())&&n.pop()}continue}n.pop()}}warnings(){return this.sync().warnings()}};kt.registerPostcss=e=>{fs=e};vm.exports=kt;kt.default=kt;Tx.registerLazyResult(kt);_x.registerLazyResult(kt)});var Em=ae((rC,Am)=>{"use strict";var Dx=ss(),Ix=zi(),Px=qi(),Ox=ar(),nC=ds(),vr=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=Ix;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i=Ox;this.result=new Px(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Dx(i,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};Am.exports=vr;vr.default=vr});var _m=ae((iC,wm)=>{"use strict";var Gx=Ni(),Hx=ps(),Bx=Em(),Ux=pn(),Vt=class{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new Bx(this,t,n):new Hx(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};wm.exports=Vt;Vt.default=Vt;Ux.registerProcessor(Vt);Gx.registerProcessor(Vt)});var Lm=ae((oC,Nm)=>{"use strict";var Cm=Fi(),Rm=mr(),Wx=pt(),Vx=Mi(),Tm=pr(),km=Ni(),zx=Zd(),qx=gr(),$x=ps(),jx=os(),Kx=cr(),Yx=zi(),hs=_m(),Xx=qi(),Mm=pn(),Fm=Oi(),Jx=ar(),Qx=cs();function le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new hs(e)}le.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
25
+ `),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Wi(t.file),i;this.mapOpts.sourcesContent===!1?(i=new pm(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t="/*# sourceMappingURL=",n;for(;(n=this.css.lastIndexOf(t))!==-1;){let r=this.css.indexOf("*/",n+t.length);if(r===-1)break;for(;n>0&&this.css[n-1]===`
26
+ `;)n--;this.css=this.css.slice(0,n)+this.css.slice(r+2)}}}}generate(){if(this.clearAnnotation(),Ex&&Ax&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Vi.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Vi({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 Vi({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\n/g),a?(t+=a.length,o=l.lastIndexOf(`
27
+ `),n=l.length-o):n+=l.length,s&&u!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Wi(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Wi(mm(r,this.mapOpts.annotation)));let i=dm(r,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new vx(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(cm){let r=cm(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;fm==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};hm.exports=cs});var xm=oe((xC,bm)=>{"use strict";var zi=/[\t\n\f\r "#'()/;[\\\]{}]/g,qi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_x=/.[\r\n"'(/\\]/,gm=/[\da-f]/i;bm.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,d,f,m,p,g,y=r.length,x=0,w=[],k=[],C=-1;function N(){return x}function O(E){throw t.error("Unclosed "+E,x)}function F(){return k.length===0&&x>=y}function S(E){if(k.length)return k.pop();if(x>=y)return;let T=E?E.ignoreUnclosed:!1;switch(o=r.charCodeAt(x),o){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);d=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let L=String.fromCharCode(o);d=[L,L,x];break}case 40:{if(g=w.length?w.pop()[1]:"",p=r.charCodeAt(x+1),g==="url"&&p!==39&&p!==34&&p!==32&&p!==10&&p!==9&&p!==12&&p!==13){s=x;do{if(f=!1,s=r.indexOf(")",s+1),s===-1)if(i||T){s=x;break}else O("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["brackets",r.slice(x,s+1),x,s],x=s}else x<=C?d=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||_x.test(a)?(C=s===-1?y:s,d=["(","(",x]):(d=["brackets",a,x,s],x=s));break}case 39:case 34:{u=o===39?"'":'"',s=x;do{if(f=!1,s=r.indexOf(u,s+1),s===-1)if(i||T){s=x+1;break}else O("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{zi.lastIndex=x+1,zi.test(r),zi.lastIndex===0?s=r.length-1:s=zi.lastIndex-2,d=["at-word",r.slice(x,s+1),x,s],x=s;break}case 92:{for(s=x,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,gm.test(r.charAt(s)))){for(;gm.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}d=["word",r.slice(x,s+1),x,s],x=s;break}default:{o===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(i||T?s=r.length:O("comment")),d=["comment",r.slice(x,s+1),x,s],x=s):(qi.lastIndex=x+1,qi.test(r),qi.lastIndex===0?s=r.length-1:s=qi.lastIndex-2,d=["word",r.slice(x,s+1),x,s],w.push(d),x=s);break}}return x++,d}function v(E){k.push(E)}return{back:v,endOfFile:F,nextToken:S,position:N}}});var Am=oe((yC,vm)=>{"use strict";var wx=Di(),Cx=hr(),Rx=br(),Tx=gn(),ym=Bi(),kx=xm(),Sm={empty:!0,space:!0};function Mx(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function ms(e,t,n){let r="";for(let i=t;i<n;i++)r+=e[i][1];return r}var fs=class{constructor(t){this.input=t,this.root=new Tx,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new wx;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new Cx;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=kx(this.input)}decl(t,n){let r=new Rx;this.init(r,t[0][2]);let i=t[t.length-1];i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||Mx(t)),r.source.end.offset++;let o=0;for(;t[o][0]!=="word";)o===t.length-1&&this.unknownWord([t[o]]),o++;r.raws.before+=ms(t,0,o),r.source.start=this.getPosition(t[o][2]);let a=o;for(;o<t.length;){let m=t[o][0];if(m===":"||m==="space"||m==="comment")break;o++}r.prop=ms(t,a,o);let l=o,s;for(;o<t.length&&(s=t[o],o++,s[0]!==":");)s[0]==="word"&&/\w/.test(s[1])&&this.unknownWord([s]);r.raws.between=ms(t,l,o),(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let u=o;for(;o<t.length;){let m=t[o][0];if(m!=="space"&&m!=="comment")break;o++}let d=t.slice(u,o);t=t.slice(o),this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(s=t[m],s[1].toLowerCase()==="!important"){r.important=!0;let p=this.stringFrom(t,m);p=this.spacesFromEnd(t)+p,p!==" !important"&&(r.raws.important=p);break}else if(s[1].toLowerCase()==="important"){let p=t.slice(0),g="";for(let y=m;y>0;y--){let x=p[y][0];if(g.trim().startsWith("!")&&x!=="space")break;g=p.pop()[1]+g}g.trim().startsWith("!")&&(r.important=!0,r.raws.important=g,t=p)}if(s[0]!=="space"&&s[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=d.map(m=>m[1]).join(""),d=[]),this.raw(r,"value",d.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new ym;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset++)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,i){let o,a,l=r.length,s="",u=!0,d,f;for(let m=0;m<l;m+=1)o=r[m],a=o[0],a==="space"&&m===l-1&&!i?u=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!Sm[f]&&!Sm[d]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let m=r.reduce((p,g)=>p+g[1],"");t.raws[n]={raw:m,value:s}}t[n]=s}rule(t){t.pop();let n=new ym;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let i=n;i<t.length;i++)r+=t[i][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};vm.exports=fs});var ji=oe((SC,Em)=>{"use strict";var Fx=ft(),Nx=yr(),Lx=Am();function $i(e,t){let n=new Nx(e,t),r=new Lx(n);try{r.parse()}catch(i){throw i}return r.root}Em.exports=$i;$i.default=$i;Fx.registerParse($i)});var ps=oe((vC,_m)=>{"use strict";var Dx=ft(),{my:Ix}=cr(),vr=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){n.node[Ix]||Dx.rebuild(n.node);let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};_m.exports=vr;vr.default=vr});var Ki=oe((AC,wm)=>{"use strict";var Px=ps(),Ar=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new Px(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};wm.exports=Ar;Ar.default=Ar});var hs=oe((EC,Rm)=>{"use strict";var Cm={};Rm.exports=function(t){Cm[t]||(Cm[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var xs=oe((wC,Fm)=>{"use strict";var Ox=ft(),Gx=Ii(),Hx=ds(),Bx=ji(),Tm=Ki(),Ux=gn(),Wx=ur(),{isClean:Ye,my:Vx}=cr(),_C=hs(),zx={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},qx={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},$x={Once:!0,postcssPlugin:!0,prepare:!0},xn=0;function Er(e){return typeof e=="object"&&typeof e.then=="function"}function gs(e){let t=!1,n=zx[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,xn,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,xn,n+"Exit"]:[n,n+"Exit"]}function km(e){let t;return e.type==="document"?t=["Document",xn,"DocumentExit"]:e.type==="root"?t=["Root",xn,"RootExit"]:t=gs(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Mm(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Ye]=!1,n.nodes)for(let r of n.nodes)t.push(r)}return e}var bs={},kt=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=Mm(n);else if(n instanceof e||n instanceof Tm)i=Mm(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=Bx;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[Vx]&&Ox.rebuild(i)}this.result=new Tm(t,i,r),this.helpers={...bs,postcss:bs,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!qx[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!$x[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(Er(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ye];){t[Ye]=!0;let n=[km(t)];for(;n.length>0;){let r=this.visitTick(n);if(Er(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return Er(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=Wx;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let o=new Hx(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(Er(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ye];)t[Ye]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Er(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator;n.descending&&(n.descending=!1,r.indexes[a]+=1);let l;for(;l=r.nodes[r.indexes[a]];){if(!l[Ye]){l[Ye]=!0,n.descending=!0,t.push(km(l));return}r.indexes[a]+=1}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===xn){r.nodes&&r.nodes.length&&(r[Ye]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ye]=!0;let n=[{eventIndex:0,events:gs(t),iterator:0,node:t}];for(;n.length>0;){let r=n[n.length-1],i=r.node;if(r.iterator!==0){let o=r.iterator;r.descending&&(r.descending=!1,i.indexes[o]+=1);let a,l=!1;for(;a=i.nodes[i.indexes[o]];){if(!a[Ye]){a[Ye]=!0,r.descending=!0,n.push({eventIndex:0,events:gs(a),iterator:0,node:a}),l=!0;break}i.indexes[o]+=1}if(l)continue;r.iterator=0,delete i.indexes[o]}if(r.eventIndex<r.events.length){let o=r.events[r.eventIndex];if(r.eventIndex+=1,o===xn)i.nodes&&i.nodes.length&&(r.iterator=i.getIterator());else{let a=this.listeners[o];a&&this.visitSync(a,i.toProxy())&&n.pop()}continue}n.pop()}}warnings(){return this.sync().warnings()}};kt.registerPostcss=e=>{bs=e};Fm.exports=kt;kt.default=kt;Ux.registerLazyResult(kt);Gx.registerLazyResult(kt)});var Lm=oe((RC,Nm)=>{"use strict";var jx=ds(),Kx=ji(),Yx=Ki(),Xx=ur(),CC=hs(),_r=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=Kx;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let i=Xx;this.result=new Yx(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new jx(i,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};Nm.exports=_r;_r.default=_r});var Im=oe((TC,Dm)=>{"use strict";var Jx=Ii(),Qx=xs(),Zx=Lm(),ey=gn(),Vt=class{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new Zx(this,t,n):new Qx(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};Dm.exports=Vt;Vt.default=Vt;ey.registerProcessor(Vt);Jx.registerProcessor(Vt)});var Vm=oe((kC,Wm)=>{"use strict";var Pm=Di(),Om=hr(),ty=ft(),ny=Li(),Gm=br(),Hm=Ii(),ry=um(),iy=yr(),oy=xs(),ay=us(),sy=fr(),ly=ji(),ys=Im(),uy=Ki(),Bm=gn(),Um=Bi(),cy=ur(),dy=ps();function ue(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ys(e)}ue.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
28
28
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
29
- https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new hs().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return le([i(s)]).process(a,l)},i};le.stringify=Jx;le.parse=Yx;le.fromJSON=zx;le.list=jx;le.comment=e=>new Rm(e);le.atRule=e=>new Cm(e);le.decl=e=>new Tm(e);le.rule=e=>new Fm(e);le.root=e=>new Mm(e);le.document=e=>new km(e);le.CssSyntaxError=Vx;le.Declaration=Tm;le.Container=Wx;le.Processor=hs;le.Document=km;le.Comment=Rm;le.Warning=Qx;le.AtRule=Cm;le.Result=Xx;le.Input=qx;le.Rule=Fm;le.Root=Mm;le.Node=Kx;$x.registerPostcss(le);Nm.exports=le;le.default=le});function Zr(){return globalThis}function D(e,t){if(typeof window>"u")return;let n=Zr(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var Zh=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data"];function e0(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function t0(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=e0(r,n);return{numerator:r/i,denominator:n/i}}function Go(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function ei(e){return{protocolVersion:1,capabilities:Zh,fps:t0(e)}}function n0(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Jl(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=Go(n.fps);return r===null||!n0(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var Ql=30;function Zl(e){Ql=Number.isFinite(e)&&e>0?e:30}function ye(e){try{window.parent.postMessage({...e,...ei(Ql)},"*")}catch(t){D("bridge.postMessage",t)}}var r0=new Map(Object.entries({play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(i0(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>a0(e),"set-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onSetRuntimeData?.(e.channel,e.payload,e.requestId)},"clear-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onClearRuntimeData?.(e.channel,e.requestId)}}));function i0(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Go(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function o0(e){let t=Jl(e);return t.status!=="unsupported"?!1:(ye({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function a0(e){let t=e.selectors,n=e.duration||800;t&&s0(t,n)}function eu(e){let t=n=>{if(n.source!==window.parent&&n.source!==window)return;let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||o0(r))return;let i=r.action;if(typeof i!="string")return;let o=r0.get(i);o&&o(r,e)};return window.addEventListener("message",t),ye({source:"hf-preview",type:"ready"}),t}function s0(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
29
+ https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new ys().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return ue([i(s)]).process(a,l)},i};ue.stringify=cy;ue.parse=ly;ue.fromJSON=ry;ue.list=ay;ue.comment=e=>new Om(e);ue.atRule=e=>new Pm(e);ue.decl=e=>new Gm(e);ue.rule=e=>new Um(e);ue.root=e=>new Bm(e);ue.document=e=>new Hm(e);ue.CssSyntaxError=ny;ue.Declaration=Gm;ue.Container=ty;ue.Processor=ys;ue.Document=Hm;ue.Comment=Om;ue.Warning=dy;ue.AtRule=Pm;ue.Result=uy;ue.Input=iy;ue.Rule=Um;ue.Root=Bm;ue.Node=sy;oy.registerPostcss(ue);Wm.exports=ue;ue.default=ue});function ni(){return globalThis}function I(e,t){if(typeof window>"u")return;let n=ni(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var c0=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data"];function d0(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function m0(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=d0(r,n);return{numerator:r/i,denominator:n/i}}function Uo(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function ri(e){return{protocolVersion:1,capabilities:c0,fps:m0(e)}}function f0(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function eu(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=Uo(n.fps);return r===null||!f0(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var tu=30;function nu(e){tu=Number.isFinite(e)&&e>0?e:30}function xe(e){try{window.parent.postMessage({...e,...ri(tu)},"*")}catch(t){I("bridge.postMessage",t)}}var p0=new Map(Object.entries({play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(h0(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>b0(e),"set-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onSetRuntimeData?.(e.channel,e.payload,e.requestId)},"clear-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onClearRuntimeData?.(e.channel,e.requestId)}}));function h0(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Uo(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function g0(e){let t=eu(e);return t.status!=="unsupported"?!1:(xe({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function b0(e){let t=e.selectors,n=e.duration||800;t&&x0(t,n)}function ru(e){let t=n=>{if(n.source!==window.parent&&n.source!==window)return;let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||g0(r))return;let i=r.action;if(typeof i!="string")return;let o=p0.get(i);o&&o(r,e)};return window.addEventListener("message",t),xe({source:"hf-preview",type:"ready"}),t}function x0(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
30
30
  .__hf-flash {
31
31
  outline: 2px solid rgba(59, 130, 246, 0.6) !important;
32
32
  outline-offset: 2px !important;
@@ -36,13 +36,13 @@ https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.p
36
36
  0% { outline-color: rgba(59, 130, 246, 0.8); }
37
37
  100% { outline-color: transparent; }
38
38
  }
39
- `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){D("bridge.flashElements.querySelector",r)}}var vt=(e,t,n)=>e>=t&&e<n;var ti=(e,t,n,r)=>vt(e,t,n)||e>=t&&r>0&&n>=r-1e-6;var Ho=null;function tu(e){Ho=e}function Be(e,t){if(Ho)try{Ho({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){D("runtime.analytics.site1",n)}}function l0(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function Qt(e){return`--${l0(e)}`}function nu(e){let t=new Map;for(let n of e){let r=Qt(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function iu(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,Dn(i));let n=ri(),r={...t,...n};for(let i of e)Uo(i,r);return r}var ru=new Set;function ou(e){let t=e?.getAttribute("data-composition-variables");if(!t)return[];let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(r=>!!r&&typeof r=="object"):[]}function u0(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function c0(e){return Array.isArray(e.options)?e.options.map(t=>t&&typeof t=="object"?t.value:t).filter(t=>typeof t=="string"||typeof t=="number"):[]}function d0(e,t){if(typeof e.id!="string")return null;let n=t[e.id];if(n==null||"default"in e&&String(n)===String(e.default))return null;let r=c0(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function Uo(e,t,n){if(!e)return;let r=ou(e);if(r.length===0)return;let i=u0(e,n);for(let o of r){let a=d0(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(ru.has(l))continue;ru.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function Dn(e){let t={};for(let n of ou(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Bo="data-hf-css-vars";function ni(e){return"style"in e&&typeof e.style?.setProperty=="function"}function Wo(e,t){if(!ni(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Qt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Bo,n.join(" "))}function au(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Qt(i);((ni(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function su(e){if(!ni(e))return;let t=e.getAttribute(Bo);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Bo)}}function lu(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=ri(),r=[];for(let i of t)r.push(...m0(i,n,e.defaultView));for(let i of nu(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Qt(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function m0(e,t,n){if(!ni(e))return[];let r=Dn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Qt(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return Wo(e,i),Object.keys(r)}function uu(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function ri(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}var cu="http://www.w3.org/1999/xhtml";function Me(e){return e!=null&&e.nodeType===1}function Ae(e){return Me(e)&&e.namespaceURI===cu}function In(e,t){return Ae(e)&&e.localName===t}function pe(e){return In(e,"video")}function Vo(e){return In(e,"audio")}function ge(e){return pe(e)||Vo(e)}function De(e){return In(e,"img")}function du(e){return In(e,"style")}function mu(e){return In(e,"link")}function zo(e){return Me(e)&&(e.namespaceURI===cu||e.namespaceURI==="http://www.w3.org/2000/svg")}function fu(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,d)=>{let f=null;try{f=u.effect?.getComputedTiming?.()??null}catch(p){D("runtime.adapters.css.site5",p)}if(!f)return{};let m=Number(f.endTime);return Number.isFinite(m)?{endSeconds:d+m/1e3}:{unbounded:!0}},o=(u,d)=>{for(let f of u){try{f.currentTime=d}catch(m){D("runtime.adapters.css.site1",m)}try{f.pause()}catch(m){D("runtime.adapters.css.site2",m)}}},a=u=>{for(let d of u)try{d.play()}catch(f){D("runtime.adapters.css.site3",f)}},l=u=>{for(let d of u)try{d.pause()}catch(f){D("runtime.adapters.css.site4",f)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let d of u){if(!Ae(d))continue;let f=window.getComputedStyle(d);!f.animationName||f.animationName==="none"||t.push({el:d,baseDelay:d.style.animationDelay||"",basePlayState:d.style.animationPlayState||"",animations:n(d)})}},getInferredDurationSeconds:()=>{let u=0;for(let d of t){if(!d.el.isConnected)continue;let f=r(d.el);for(let m of n(d.el)){let p=i(m,f);p.endSeconds!=null&&(u=Math.max(u,p.endSeconds))}}return u>0?u:null},seek:u=>{let d=Number(u.time)||0;for(let f of t){if(!f.el.isConnected)continue;let m=r(f.el),p=Math.max(0,d-m)*1e3,g=f.animations;if(g.length>0){o(g,p);continue}f.el.style.animationPlayState="paused",f.el.style.animationDelay=`-${(p/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let d=u.animations;d.length>0&&l(d),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function pu(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function hu(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){D("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){D("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){D("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){D("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function bu(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){D("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(qo(r))r.goToAndStop(t*1e3,!1);else if($o(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??0;if(Number.isFinite(i)&&i>0){let o=Math.min(100,t/i*100);r.seek(o)}}}}catch(i){D("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(qo(t)||$o(t))&&t.pause()}catch(n){D("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=f0(r)}catch(o){D("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function gu(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function f0(e){return qo(e)?gu(e.totalFrames,e.frameRate):$o(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:gu(e.totalFrames,e.frameRate):null}function qo(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function $o(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var jo=-1,ii=new Set,Zt,Ko=0;function xu(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){D("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));ii.add(i),i.then(o=>{ii.delete(i)&&o.status==="rejected"&&Zt===void 0&&(Zt={reason:o.reason})})}function oi(e){e!==jo&&(jo=e,xu(e))}function ai(e){jo=e,xu(e)}function yu(){return Ko>0}async function Yo(){Ko+=1;let e=Zt;try{for(await Promise.resolve();ii.size>0;){let r=(await Promise.all([...ii])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Zt;if(e===void 0&&(e=t),Zt===t&&(Zt=void 0),e)throw e.reason}finally{Ko-=1}}function Su(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(d=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,d()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(d,f,m){try{r?.call(this,d,f,m)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,oi(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function Ze(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function vu(){return Ze({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function Au(){return Ze({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function Eu(){return Ze({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function wu(){return Ze({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function _u(){return Ze({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var p0=250;function Cu(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(yu()||(window.__hfTypegpuTime=e,ai(e)))},p0))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,oi(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var Pn="data-hf-render-id",Ru="data-hf-group-render-id";function h0(e){return e.getAttribute(Pn)||e.id||null}var g0="__render_frame_",b0="__";function x0(e){return`${g0}${e}${b0}`}function y0(e){let t=h0(e);return t?x0(t):null}function At(e){let t=y0(e);if(!t)return null;let n=document.getElementById(t);return De(n)?n:null}function Tu(e){let t=e.nextElementSibling;if(De(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=At(e);return n&&n.complete&&n.naturalWidth>0?n:null}function ku(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(pe(n?.source)){let o=Tu(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function Mu(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(pe(u)){let d=Tu(u);d&&(l[s]=d)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}var Ht="data-fx-chain",aE=Ht.slice(5),Fu=1,On=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),Xo=(e=.707,t="Bandwidth \u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),si=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Nu={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},Du=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[si(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[On("frequency","Frequency",1e3),si(-40,40,0),Xo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[On("frequency","Frequency",200,20,2e3),si(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[On("frequency","Frequency",4e3,500,2e4),si(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \u2014 the usual fix for rumble on a voice.",params:[On("frequency","Cutoff",300,20,2e4),Xo(.707),Nu],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[On("frequency","Cutoff",8e3,100,2e4),Xo(.707),Nu],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling \u2014 nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times \u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],Jo=new Map(Du.map(e=>[e.id,e]));function Gn(e){return Jo.get(e)}var sE=Du.map(e=>e.id);function Hn(e,t){let n=Jo.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var Et=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Iu(e){let t;try{t=JSON.parse(e)}catch(i){throw new Et(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new Et("Chain file must be a JSON object.");let n=t;if(n.version!==Fu)throw new Et(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Et("Chain file is missing a `nodes` array.");let r=n.nodes.map(S0);return{version:Fu,nodes:r}}function Bn(e){return e.nodes.filter(t=>t.enabled!==!1)}function S0(e,t){if(typeof e!="object"||e===null)throw new Et(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Jo.has(n.type))throw new Et(`Node ${t} has unknown effect type: ${String(n.type)}`);return A0({type:n.type,id:li(n.id),fromCarve:Lu(n.fromCarve),fromPreset:li(n.fromPreset),label:li(n.label),fromEq:li(n.fromEq),fromLeveller:Lu(n.fromLeveller),presetAmount:v0(n.presetAmount),enabled:n.enabled!==!1,params:Hn(n.type,n.params??void 0)})}function li(e){return typeof e=="string"&&e?e:void 0}function Lu(e){return e===!0?!0:void 0}function v0(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function A0(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var Qo=3.981071705534972;function Ue(e){return Number.isFinite(e)?Math.max(0,Math.min(Qo,e)):1}function ui(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Pu(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,i=n?.set;if(!r||!i)return t();let o=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>o,set:a=>{o=Number(a),i.call(e,ui(o))}});try{return t()}finally{delete e.volume,i.call(e,ui(o))}}var en=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),cE=Object.freeze([en.start,en.duration,en.trackIndex]),dE=Object.freeze([en.derivedEnd]),mE=Object.freeze([en.derivedEnd,en.legacyTrack]);function wt(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Gu=/^[A-Za-z0-9_.:-]+$/;function Hu(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Ou(e,t){let n=t;for(;n>=0&&Hu(e,n);)n--;return n}function E0(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function w0(e){let t=e.length-1;if(!Hu(e,t))return null;let n=Ou(e,t);return e[n]==="."&&(n=Ou(e,n-1)),n+1}function _0(e){let t=w0(e);if(t==null)return null;let n=E0(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!Gu.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Zo(e){let t=(e??"").trim();if(!t)return null;let n=wt(t);if(n!=null)return{kind:"absolute",value:n};if(Gu.test(t))return{kind:"reference",refId:t,offset:0};let r=_0(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var Bu=e=>{let t=wt(e);return t!==null&&t>=0?t:null};function Uu(e){return Bu(e("data-playback-start"))??Bu(e("data-media-start"))??0}var Un=.1,Wn=10;function ea(e){return Number.isFinite(e)&&e>0?Math.max(Un,Math.min(Wn,e)):1}function Wu(e,t=1){let n=Number.parseFloat(e("data-playback-rate")??"");return ea(Number.isFinite(n)&&n>0?n:t)}function ta(e){let t=wt(e("data-duration"));return t!==null&&t>0?t:null}function Vu(e,t){let n=ta(e);if(n!==null)return n;let r=wt(e("data-end"));return r!==null?r-t:null}var C0=3;function na(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/ea(n):null}function ra(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:i,playbackRate:o}=e;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(t==="img")return{seconds:C0,source:"default"};if(r===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=na(r,i,o);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var mt="data-automation",AE=mt.slice(5),ci=1,R0=512,dt=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},tn="volume",di="rate";function zn(e){if(e===tn)return{kind:"volume"};if(e===di)return{kind:"rate"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===T0){let i=t[2];return i?{kind:"preset",presetId:i}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var T0="preset";var k0={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},mi={min:0,max:Qo,step:.01,unit:"",label:"Volume",scale:"linear",default:1},zu={min:Un,max:Wn,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function ia(e,t){let n=zn(e);if(!n)return null;if(n.kind==="volume")return mi;if(n.kind==="rate")return zu;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...k0,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Gn(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function Vn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function M0(e){let t=Vn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function qu(e,t){let n=Vn(e),r=Vn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function F0(e){let t=M0(e?.curve),n=qu(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function N0(e,t){let n=Vn(e?.t),r=Vn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...F0(e)}}function $u(e,t){let n=e.map(i=>N0(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,R0)}function L0(e){let t=[];for(let n of e.lanes){if(!zn(n.target))continue;let r=n.target===tn?mi:n.target===di?zu:null,i=$u(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:ci,lanes:t}}function ju(e,t){let n=[];for(let r of e.lanes){let i=ia(r.target,t);if(!i)continue;let o=$u(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:ci,lanes:n}}function fi(e){let t;try{t=JSON.parse(e)}catch(i){throw new dt(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new dt("Automation must be a JSON object.");let n=t;if(n.version!==ci)throw new dt(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new dt("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new dt(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!zn(a.target))throw new dt(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new dt(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return L0({version:ci,lanes:r})}function D0(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function I0(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function P0(e,t,n){let{cx:r,cy:i,w:o}=I0(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=O0(l,s,e),d=1-u,f=d*d+2*o*u*d+u*u;return f>0?(2*o*i*u*d+u*u)/f:e}function O0(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function G0(e,t){let n=qu(t.viaX,t.viaY);return n?P0(Math.min(1,Math.max(0,e)),n.x,n.y):D0(e,t.curve)}function H0(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function ft(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],u=r[l],d=u.t-s.t;return d<=0?u.v:H0(s.v,u.v,G0((t-s.t)/d,s),n)}function Ku(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Yu(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=ft(e,t+l*s/(o-1),i);return a}var pi=new Map,B0=64;function oa(e,t=tn){let n=`${t}\0${e}`,r=pi.get(n);if(r!==void 0)return r;let i=null;try{i=fi(e).lanes.find(o=>o.target===t)??null}catch{i=null}return pi.size>B0&&pi.clear(),pi.set(n,i),i}function Xu(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(mt):null)??"";if(!n)return null;let r=oa(n);return!r||r.points.length===0?null:ft(r,t)}var Ju=48,Qu=new WeakMap;function U0(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,i=[0],o=[0],a=s=>{let u=i[i.length-1];if(s<=u)return;let d=ft(e,u,"log");i.push(s),o.push(o[o.length-1]+(d+ft(e,s,"log"))/2*(s-u))},l=Math.max(0,t[0].t);a(l);for(let s=1;s<t.length;s+=1){let u=t[s-1].t,d=t[s].t;if(!(d<=0))for(let f=1;f<=Ju;f+=1)a(Math.max(u,0)+(d-u)*f/Ju)}return{ts:Float64Array.from(i),ss:Float64Array.from(o),firstRate:n,lastRate:r}}function Zu(e){let t=Qu.get(e);return t||(t=U0(e),Qu.set(e,t)),t}function aa(e){return typeof e!="number"&&e.points.length>0}function ec(e,t){return typeof e=="number"?e:aa(e)?ft(e,t,"log"):1}function tc(e,t,n){let r=0,i=e.length-1;for(;i-r>1;){let o=r+i>>1;e[o]<=n?r=o:i=o}return t[r]+(t[i]-t[r])*(n-e[r])/(e[i]-e[r])}function hi(e,t){if(typeof e=="number")return t*e;if(!aa(e))return t;let{ts:n,ss:r,firstRate:i,lastRate:o}=Zu(e),a=n.length-1;return t<=0?t*i:t>=n[a]?r[a]+(t-n[a])*o:tc(n,r,t)}function nn(e,t){if(typeof e=="number")return t/e;if(!aa(e))return t;let{ts:n,ss:r,firstRate:i,lastRate:o}=Zu(e),a=n.length-1;return t<=0?t/i:t>=r[a]?n[a]+(t-r[a])/o:tc(r,n,t)}function W0(e){return e?oa(e,di):null}function nc(e,t){return W0(e)??t}function rc(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=x=>{let _=Number(x.currentTime);return Number.isFinite(_)&&_>0?_:0},d=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,f=(x,_)=>{let k=l.get(x);if(k)return k;let C={compositionTimeMs:_,animationTimeMs:e?d(u(x),_):u(x)};return l.set(x,C),C},m=(x,_)=>{if(!a.has(x)){a.add(x);let k=()=>{a.delete(x)};try{x.addEventListener("finish",k,{once:!0}),x.addEventListener("cancel",k,{once:!0})}catch(C){D("runtime.adapters.waapi.site4",C)}}f(x,_)},p=(x,_)=>{for(let k of x)m(k,_)},g=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let _=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:_,configurable:!0});let k=function(...C){let L=_.apply(this,C);return m(L,t),L};x.animate=k,r=x,i=_,o=k,n=!0}catch{}},y=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(L){D("runtime.adapters.waapi.site4",L)}if(!_)return{};let k=Number(_.endTime);return Number.isFinite(k)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+k/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,g(),p(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&p(s(),e?_:0);for(let k of a){let C=e?f(k,_):f(k,0),L=C.animationTimeMs+Math.max(0,_-C.compositionTimeMs);try{k.currentTime=L}catch(P){D("runtime.adapters.waapi.site1",P)}try{k.pause()}catch(P){D("runtime.adapters.waapi.site2",P)}}},pause:()=>{e||p(s(),t);for(let x of a)try{x.pause()}catch(_){D("runtime.adapters.waapi.site3",_)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){D("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let _ of s()){let k=y(_);k.endSeconds!=null&&(x=Math.max(x,k.endSeconds))}return x>0?x:null}}}function Fe(e){return wt(e)}function Oe(e){return Wu(t=>e.getAttribute(t),ge(e)?e.defaultPlaybackRate:1)}function _t(e){return nc(e.getAttribute("data-automation"),Oe(e))}function gi(e){return Uu(t=>e.getAttribute(t))}function et(e,t){return V0(t,gi(e),_t(e))}function bi(e){let t=ra({tag:"video",authoredDurationSeconds:ta(n=>e.getAttribute(n)),sourceDurationSeconds:Number.isFinite(e.duration)?e.duration:null,mediaStartSeconds:gi(e),playbackRate:Oe(e)});return t.source==="media"?et(e,e.duration):t.seconds}function rn(e,t=0){return!De(e)||!e.hasAttribute("data-start")&&!e.hasAttribute("data-track-index")?null:ra({tag:"img",authoredDurationSeconds:Vu(n=>e.getAttribute(n),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function V0(e,t,n){return typeof n=="number"?na(e,t,n):Number.isFinite(e)?nn(n,Math.max(0,e-t)):null}function qn(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function on(e){let t=qn(e.start);if(t==null)return null;let n=Math.max(0,t),r=qn(e.duration),i=qn(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=qn(e.end),l=qn(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var xi="data-hf-media-start-basis";function z0(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function q0(e){return z0(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function ic(e){return e.hasAutoStart||e.authoredStart==null||e.hostStart<=0?e.ordinaryStart():q0({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis})}function tt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=m=>{let p=r.getElementById(m);return p||(r.querySelector(`[data-composition-id="${CSS.escape(m)}"]`)??null)},s=m=>{let p=o.get(m);if(p!==void 0)return p;let g=null,y=on({start:0,duration:m.getAttribute("data-duration"),authoredDuration:n?m.getAttribute("data-hf-authored-duration"):null});if(y?.duration!=null&&y.duration>0&&(g=y.duration),g==null||g<=0){let x=d(m,0),_=on({start:x,end:m.getAttribute("data-end"),authoredEnd:n?m.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(g=_.duration)}if((g==null||g<=0)&&ge(m)&&(g=et(m,m.duration)),(g==null||g<=0)&&(g=rn(m)),g==null||g<=0){let x=m.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let k=Number(_.duration());Number.isFinite(k)&&k>0&&(g=k)}catch(k){D("runtime.startResolver.site1",k)}}}return g!=null&&Number.isFinite(g)&&g>0?(o.set(m,g),g):(o.set(m,null),null)},u=(m,p)=>{if(m.hasAttribute("data-composition-id")){let y=m.parentElement?.closest("[data-composition-id]");return y?d(y,p):0}let g=m.closest("[data-composition-id]");return g?d(g,p):0},d=(m,p)=>{let g=i.get(m);if(g!==void 0)return g??p;if(a.has(m))return p;a.add(m);try{let y=Zo(m.getAttribute("data-start"));if(!y){if(m.hasAttribute("data-composition-id")){let L=m.parentElement;if(L&&(L.hasAttribute("data-composition-src")||L.hasAttribute("data-composition-id")||L.hasAttribute("data-composition-file"))){let P=d(L,p);return i.set(m,P),P}}return i.set(m,p),p}if(y.kind==="absolute"){let L=Math.max(0,y.value),P=Math.max(0,u(m,p)+L);return i.set(m,P),P}let x=l(y.refId);if(!x)return i.set(m,p),p;let _=d(x,0),k=s(x);if(k==null||k<=0){let L=Math.max(0,_+y.offset);return i.set(m,L),L}let C=Math.max(0,_+k+y.offset);return i.set(m,C),C}finally{a.delete(m)}};return{resolveStartForElement:(m,p=0)=>d(m,Math.max(0,p)),resolveDurationForElement:m=>s(m),resolveMediaStartForElement:m=>{let p=m.closest("[data-composition-id]"),g=p?d(p,0):0;return ic({authoredStart:Fe(m.getAttribute("data-start")),hostStart:g,hasAutoStart:m.hasAttribute("data-hf-auto-start"),basis:m.getAttribute(xi),ordinaryStart:()=>d(m,g)})}}}function $0(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Ue(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Ue(n)}),i}function oc(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function j0(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function K0(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Y0(e,t){let n=tt({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Fe(e.dataset.end)??void 0,i=Fe(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=K0(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Ue(a)}}function X0(e,t,n,r,{start:i,end:o,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),d=Pu(e,()=>{e.volume=a;let m=[],p;for(let g=s;g<=u+1e-6;g=Math.min(u,g+l)){t(g);let y=Number(e.volume);if(Number.isFinite(y)){let x={time:Number(g.toFixed(6)),volume:Number(Ue(y).toFixed(6))};j0(m,p,x,g===u),p=x}if(g===u)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function ac(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!ge(e)||n<=0)return;let o=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Y0(e,n),s=X0(e,o,n,60,l);if(Number.isFinite(a)&&o(a),s){let u=$0(s,l.start,l.staticVolume);u.length>0&&r.set(e,u)}}var an="hf-audio-group",yi="data-audio-group";function sa(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function la(e,t){let n=Array.from(e?.querySelectorAll?.(`${an}[${Pn}]`)??[]).find(i=>i.getAttribute(Pn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===an?r:null}function Si(e,t){let n=t?.getAttribute?.(Ru)??t?.getAttribute?.(yi);return n?la(e,n)?.hasAttribute("data-hidden")??!1:!1}function sc(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(yi)||null}function lc(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${an}{display:none!important}`,e.head.appendChild(n)}function nt(e){return gi(e)}function uc(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>=0);return n.length>0?Math.min(...n):null}function cc(e){let t=e?.elements??Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=nt(a),u=Oe(a),d=_t(a),f=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,p=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(p)||p<0)&&m!=null&&(p=Math.max(0,nn(d,m-s)));let g=Number.isFinite(p)&&p>=0,y=g?l+p:Number.POSITIVE_INFINITY,x=Number.parseFloat(a.dataset.volume??""),_={el:a,start:l,mediaStart:s,duration:g?p:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(x)?x:null,playbackRate:u,rate:d,loop:f,sourceDuration:m};r.push(_),a.tagName==="VIDEO"&&i.push(_),Number.isFinite(y)&&(o=Math.max(o,y))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ca=new WeakMap,vi=new WeakMap,$n=new WeakMap,da=new WeakSet,sn=new WeakSet;function J0(e){if(sn.has(e))return;sn.add(e);let t=()=>sn.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Q0=3;function Z0(e){return e.error!=null||e.networkState===Q0}var ma=new WeakMap;function ua(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function fa(e){ca.delete(e),vi.delete(e),$n.delete(e),da.delete(e),ma.delete(e)}function dc(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=n.rate??n.playbackRate,o=r.tagName==="VIDEO"&&!n.loop,a=vt(e.timeSeconds,n.start,n.end),l=o&&!a&&e.timeSeconds>=n.end&&ti(e.timeSeconds,n.start,n.end,e.getCompositionDuration()),s=hi(i,Math.min(e.timeSeconds,n.end)-n.start)+n.mediaStart,u=l||o&&n.sourceDuration!=null&&s>=n.sourceDuration&&a;u&&n.sourceDuration!=null&&(s=Math.min(s,n.sourceDuration));let d=vi.get(r),f=r.tagName==="AUDIO"&&(d===void 0||s<d-.04),m=!n.loop&&n.sourceDuration!=null&&s>=n.mediaStart&&s<n.sourceDuration&&(o||f);if((a||l)&&s>=0&&(!r.ended||n.loop||u||m)){if(vi.set(r,s),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let G=n.sourceDuration-n.mediaStart;G>0&&s>=n.sourceDuration&&(s=n.mediaStart+(s-n.mediaStart)%G)}let y=ua(e.userVolume??1),x=Ue(n.volume??1),_=ma.get(r),k=ua(r.volume),C,L=Xu(r,e.timeSeconds-n.start);if(L!==null)C=Ue(L);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let G=e.timeSeconds-n.start;C=Ue(oc(n.volumeKeyframes,G))}else e.isWebAudioRouted?.(r)?C=x:_===void 0?C=x>1?x:k:Math.abs(k-_)>1e-4?C=k:C=x;let F=r.closest("[data-hidden]")!==null||Si(r.ownerDocument,r)?0:ua(C*y);r.volume=F,ma.set(r,F),e.onElementVolume?.(r,F,C),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=ec(i,e.timeSeconds-n.start)*e.playbackRate}catch(G){D("runtime.media.site1",G)}let S=.04,A=2,E=r.currentTime||0,T=Math.abs(E-s),I=s-E,H=ca.get(r);ca.set(r,I);let j=H===void 0,Y=!j&&Math.abs(I-H)>.5,M=T>3,W=r.tagName==="AUDIO"&&j&&E-s>S,te=u&&T>.001||r.ended&&m&&T>.001||W||T>.5&&(j||Y||M),U=r.tagName==="VIDEO"&&!r.paused,K=H!==void 0&&Math.abs(I-H)<.004,z=!1;if(!U&&!te&&!j&&K&&T>S){let G=($n.get(r)??0)+1;$n.set(r,G),G>=A&&(z=!0,$n.set(r,0))}else T<=S&&$n.set(r,0);let J=!U&&e.forceSync&&T>.02;if(te||z||J){if(!(r.tagName==="VIDEO"&&!!At(r))){try{r.currentTime=s}catch(O){D("runtime.media.site2",O)}if(Math.abs(r.currentTime-s)>.5&&!da.has(r)){da.add(r),r.load();try{r.currentTime=s}catch(O){D("runtime.media.site3",O)}}}sn.delete(r)}u?r.paused||r.pause():e.playing&&r.paused&&!sn.has(r)&&!Z0(r)?(J0(r),r.play().catch(G=>{sn.delete(r),(G&&typeof G=="object"&&"name"in G?String(G.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let g=vt(e.timeSeconds,n.start,n.end);fa(r),g&&vi.set(r,s),r.paused||r.pause()}}var eg="hf-proxy",mc="runtime_media_proxy_fallback",fc="runtime_media_proxy_unavailable",jn=new WeakSet,pc=new WeakSet;function Ai(e){return e.currentSrc||e.src}function pa(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:pe(e)&&!!At(e)}function ha(e){let t=Ai(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function tg(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function ng(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function ga(e,t){return t[e]??tg(e,t)??ng(e,t)}function rg(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(eg,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var ig={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function Bt(e,t,n){if(pc.has(e))return;pc.add(e);let r=ig[t];ye({source:"hf-preview",type:"diagnostic",code:fc,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${fc}: "${n}" (${t}): ${r}`)}function ba(e,t=null,n="reactive"){if(jn.has(e))return;let r=Ai(e),i;try{i=rg(r,t)}catch(l){D("runtime.mediaProxy.swap",l),Bt(e,"invalid_source_url",r);return}jn.add(e),fa(e),e.src=i,e.load();let o=t?.codecName??null;ye({source:"hf-preview",type:"diagnostic",code:mc,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${mc}: "${r}" uses a codec (${o??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function hc(e){if(pa(e)||!pe(e)||jn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=ha(e);if(n===null)return;let r=ga(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||ba(e,r,"proactive")}function gc(e){if(pa(e)||!pe(e)||e.videoWidth!==0)return;let t=Ai(e);if(jn.has(e)){Bt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ha(e);if(r===null){Bt(e,"cross_origin",t);return}let i=ga(r,n);if(i&&!i.browserHostile){Bt(e,"browser_safe_codec",t);return}ba(e,i,"reactive")}function bc(e){if(pa(e)||!pe(e))return;let t=Ai(e);if(jn.has(e)){Bt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ha(e);if(r===null){Bt(e,"cross_origin",t);return}let i=ga(r,n);if(i&&!i.browserHostile){Bt(e,"browser_safe_codec",t);return}ba(e,i,"tertiary")}var Re=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);xe(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},og=[0,0,0],ag=[1,1,1],Ei=64;function sg(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function Ct(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Re(`Invalid number "${e}"`,t);return n}function xc(e,t,n){if(e.length!==3)throw new Re(`${t} expects three numbers`,n);return[Ct(e[0],n),Ct(e[1],n),Ct(e[2],n)]}function yc(e,t,n){if(!e)throw new Re(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Re(`${t} must be an integer greater than 1`,n);return r}function lg(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Re("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function ug(e){let t=/^TITLE\s+"([^"]*)"\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\s+(.+)\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function cg(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Sc(e,t={}){let n=t.maxSize??Ei,r=null,i=og,o=ag,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let f=0;f<u.length;f++){let m=f+1,p=sg(u[f]??"").trim();if(!p)continue;let g=p.split(/\s+/),y=(g[0]??"").toUpperCase(),x=g.slice(1);if(y==="TITLE"){r=ug(p);continue}if(y==="DOMAIN_MIN"){i=xc(x,y,m);continue}if(y==="DOMAIN_MAX"){o=xc(x,y,m);continue}if(y==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Re(`${y} expects two numbers`,m);let _=Ct(x[0],m),k=Ct(x[1],m);if(k<=_)throw new Re("LUT_3D_INPUT_RANGE max must exceed min",m);i=[_,_,_],o=[k,k,k];continue}if(y==="LUT_1D_SIZE"){a=yc(x[0],y,m);continue}if(y==="LUT_3D_SIZE"){if(l=yc(x[0],y,m),l>n)throw new Re(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!cg(y)){if(y.startsWith("LUT_"))throw new Re(`Unsupported cube keyword ${y}`,m);continue}if(!l)throw a?new Re("1D cube LUTs are not supported yet",m):new Re("LUT data appears before LUT_3D_SIZE",m);if(g.length!==3)throw new Re("LUT data rows must contain three numbers",m);s.push(Ct(g[0],m),Ct(g[1],m),Ct(g[2],m))}if(a&&l)throw new Re("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Re("1D cube LUTs are not supported yet"):new Re("Missing LUT_3D_SIZE");lg(i,o);let d=l*l*l;if(s.length!==d*3)throw new Re(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function dg(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Kn(e){return Math.round(dg(e)*255)}function xa(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=Kn(e.data[s]??0),i[u+1]=Kn(e.data[s+1]??0),i[u+2]=Kn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var vc="rec709";var be={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var Ac=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Ec=["shadows","midtones","highlights"],wc=["master","red","green","blue"],_c=["hueVsHue","hueVsSaturation","hueVsLuma"];var Cc=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Rc=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var Aw=be.unit,Ew=be.signedUnit,ww=be.effects;var rt=1024,Yn=16;function Tc(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Te(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function mg(e){let t=[],n=[],r=Te(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=Te(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Tc(Te(t,0),Te(t,1),i,Te(n,1)),o[o.length-1]=Tc(Te(t,t.length-1),Te(t,t.length-2),Te(n,n.length-1),Te(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Te(n,a-1),s=Te(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Te(t,a-1),d=Te(t,a),f=2*d+u,m=d+2*u;o[a]=(f+m)/(f/l+m/s)}return o}function kc(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function fg(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function pg(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function Mc(e,t,n,r,i){fg(e,r,i);let o=mg(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Te(e,l+1)[0];)l+=1;let d=Te(e,l),f=Te(e,l+1),m=pg(u,d,f,Te(o,l),Te(o,l+1));a[s]=Math.min(i,Math.max(r,m))}return a}function ln(e,t=rt){if(kc(e,t),e.length>Yn)throw new RangeError(`A color curve supports at most ${Yn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return Mc(e,t,n=>n/(t-1),0,1)}function Sa(e,t,n,r=rt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Yn)throw new RangeError(`A hue curve supports at most ${Yn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return kc(l,r),Mc(l,r,s=>s/r*360,t,n)}var Xn="data-color-grading",Jn="data-hf-color-grading-source-hidden",Ci="data-hf-authored-opacity",Ic="__hf_color_grading_",gg=vc,Ea={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},wa={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},_a={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var Ri=Ac,Pc=Ec,Oc=wc,Gc=_c,Ra=Cc,Ta=Rc,Fc={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Nc={vignette:.18};function ke(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ea,...n},details:{...wa,...r},effects:{..._a,...i}}}var ka=[ke("neutral","Neutral"),ke("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),ke("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),ke("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),ke("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),ke("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),ke("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),ke("vintage-wash","Vintage Wash",Fc,Nc),ke("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),ke("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),ke("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),ke("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),ke("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),ke("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),ke("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),ke("home-movie-8mm","8mm Home Movie",Fc,{...Nc,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),ke("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),ke("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],bg=new Map(ka.map(e=>[e.id,e])),xg=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,yg={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},un={hue:0,amount:0,level:0},Lc={amount:be.unit,level:be.signedUnit},Rt=[[0,0],[1,1]],cn=[],Sg={hueVsHue:be.secondaryHueShift,hueVsSaturation:be.signedUnit,hueVsLuma:be.signedUnit},va={center:0,range:180,softness:0},Aa={min:0,max:1,softness:.05},vg={vignette:be.unit,vignetteMidpoint:be.unit,vignetteRoundness:be.signedUnit,vignetteFeather:be.unit,grain:be.unit,grainSize:be.unit,grainRoughness:be.unit},Ca=be.unit,Ag=be.effects,Hc=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var Eg=ka.filter(e=>Hc.some(t=>e.effects[t]>1e-4)),Nw=ka.filter(e=>!Eg.includes(e)),Lw={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},Bc=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var wg=/^#[0-9a-f]{6}$/i;function _g(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&wg.test(t))?null:e.map(t=>t.toLowerCase())}function Le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _i(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function Uc(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Ie(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?_i(n,t.min,t.max):0}function Ma(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function Cg(e){let t=Le(e)?e:{};return Pc.reduce((n,r)=>{let i=Le(t[r])?t[r]:{};return n[r]={hue:Ma(i.hue,un.hue),amount:Ie(i.amount??un.amount,Lc.amount),level:Ie(i.level??un.level,Lc.level)},n},{shadows:{...un},midtones:{...un},highlights:{...un}})}function Rg(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[_i(t,0,1),_i(n,0,1)]:null}function Wc(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function Tg(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function kg(e){if(!Array.isArray(e)||e.length<2)return Rt;let t=[];for(let n of e){let r=Rg(n);if(!r)return Rt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),Wc(t)||(Tg(t),t.length>16)?Rt:t}function Mg(e){let t=Le(e)?e:{};return Oc.reduce((n,r)=>(n[r]=kg(t[r]),n),{master:Rt,red:Rt,green:Rt,blue:Rt})}function Fg(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[Ma(n),_i(r,t.min,t.max)]:null}function Ng(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return cn;let n=[];for(let r of e){let i=Fg(r,t);if(!i)return cn;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),Wc(n)?cn:n}function Lg(e){let t=Le(e)?e:{};return Gc.reduce((n,r)=>(n[r]=Ng(t[r],Sg[r]),n),{hueVsHue:cn,hueVsSaturation:cn,hueVsLuma:cn})}function Dc(e){let t=Le(e)?e:{},n=Ie(t.min??Aa.min,Ca),r=Ie(t.max??Aa.max,Ca);return{min:Math.min(n,r),max:Math.max(n,r),softness:Ie(t.softness??Aa.softness,be.secondarySoftRangeSoftness)}}function Dg(e){let t=Le(e)?e:{},n=Ie(t.range??va.range,be.secondaryHueRange);return{center:Ma(t.center,va.center),range:n,softness:Ie(t.softness??va.softness,{min:be.secondaryHueSoftness.min,max:be.secondaryHueCombinedMax-n})}}function Ig(e){return{hueShift:Ie(e.hueShift??0,be.secondaryHueShift),saturation:Ie(e.saturation??0,be.signedUnit),luma:Ie(e.luma??0,be.signedUnit),temperature:Ie(e.temperature??0,be.signedUnit),tint:Ie(e.tint??0,be.signedUnit)}}function Pg(e){return!Le(e)||!Le(e.key)||!Le(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:Dg(e.key.hue),saturation:Dc(e.key.saturation),luma:Dc(e.key.luma)},correction:Ig(e.correction)}}function Og(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=Pg(n);r&&t.push(r)}return t}function Gg(e){if(e==null)return null;let t=String(e).trim();return t||null}function Hg(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Le(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:Uc(e.intensity,1)}}function Bg(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Le(n)?n:null}catch{return null}return{preset:t}}return Le(e)?e:null}function Ug(e,t){let n=e.trim().match(xg);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function wi(e,t){if(typeof e=="string"){let r=Ug(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return wi(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>wi(r,t));if(!Le(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=wi(i,t);return n}function Wg(e){return e?bg.get(e)??null:null}function Ti(e){let t=Bg(e);if(!t||t.enabled===!1)return null;let n=Gg(t.preset),r=Wg(n),i=r?.adjust??Ea,o=r?.details??wa,a=r?.effects??_a,l=Le(t.adjust)?t.adjust:{},s=Le(t.details)?t.details:{},u=Le(t.effects)?t.effects:{},d=Ri.reduce((p,g)=>(p[g]=Ie(l[g]??i[g],yg[g]),p),{...Ea}),f=Ra.reduce((p,g)=>(p[g]=Ie(s[g]??o[g],vg[g]),p),{...wa}),m=Ta.reduce((p,g)=>(p[g]=Ie(u[g]??a[g],Ag[g]??Ca),p),{..._a});return{enabled:!0,preset:n,intensity:Uc(t.intensity,r?.intensity??1),adjust:d,wheels:Cg(t.wheels),curves:Mg(t.curves),hueCurves:Lg(t.hueCurves),secondaries:Og(t.secondaries),details:f,effects:m,palette:_g(t.palette),lut:Hg(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():gg}}function Vc(e,t){return Ti(wi(e,t))}function Vg(e){return Pc.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Fa(e){return Oc.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Na(e){return Gc.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function La(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function zc(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Hc.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Ri.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Vg(e.wheels):!1)||(e.curves?Fa(e.curves):!1)||(e.hueCurves?Na(e.hueCurves):!1)||(e.secondaries?La(e.secondaries):!1):!1}var zg=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),qg=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function qc(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,A){try{window.dispatchEvent(new CustomEvent(S,{detail:A}))}catch(E){D("runtime.picker.site1",E)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let A=S.ownerDocument.defaultView;if(!A)return!1;let E=S;for(;E&&E!==document.body&&E!==document.documentElement;){let T=A.getComputedStyle(E);if(T.display==="none"||T.visibility==="hidden"||T.pointerEvents==="none")return!0;let I=Number.parseFloat(T.opacity);if(Number.isFinite(I)&&I<=.01&&!E.hasAttribute(Jn))return!0;E=E.parentElement}return!1}function d(S){if(!S||S===document.body||S===document.documentElement)return!1;let A=S.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(zg)||u(S))}function f(S){return!!S?.closest(qg)}function m(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let E=S.getAttribute("data-composition-id");if(E)return`[data-composition-id="${CSS.escape(E)}"]`;let T=S.getAttribute("data-composition-src");if(T)return`[data-composition-src="${CSS.escape(T)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let H=S.tagName.toLowerCase(),j=S.parentElement;if(!j)return H;let Y=j.querySelectorAll(`:scope > ${H}`);if(Y.length===1)return H;for(let M=0;M<Y.length;M+=1)if(Y[M]===S)return`${H}:nth-of-type(${M+1})`;return H}function p(S){let A=S.tagName.toLowerCase(),E=(S.textContent??"").trim().replace(/\s+/g," "),T=(I,H)=>I.length>H?`${I.slice(0,H-1)}\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?E.length>0?T(E,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function g(S,A,E){let T=typeof E=="number"&&E>0?E:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let Y=document.elementFromPoint(S,A);I=Y?[Y]:[]}if(f(I[0]??null))return[];let H={},j=[];for(let[Y,M]of I.entries()){if(!d(M))continue;let W=`${M.tagName}::${M.id||""}::${Y}`;if(!H[W]&&(H[W]=!0,j.push(M),j.length>=T))break}return j}function y(S){let A=S.getBoundingClientRect(),E={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(E[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:m(S),label:p(S),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:E}}function x(S,A,E){return g(S,A,E).map(y)}function _(S){if(!t)return;let E=g(S.clientX,S.clientY,1)[0]??(Me(S.target)?S.target:null);if(!d(E)||n===E)return;n&&n.classList.remove("__hf-pick-highlight"),n=E,E.classList.add("__hf-pick-highlight");let T=y(E);l(T),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:T})}function k(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let A=x(S.clientX,S.clientY,8);A.length!==0&&(l(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function C(S){S.key==="Escape"&&(P(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function L(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
40
- `),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",_,!0),document.addEventListener("click",k,!0),document.addEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function P(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",_,!0),document.removeEventListener("click",k,!0),document.removeEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function F(){window.__HF_PICKER_API={enable:L,disable:P,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,E)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,E):[],pickAtPoint:(S,A,E)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let T=x(S,A,8);if(!T.length)return null;let I=Math.max(0,Math.min(T.length-1,Number(E??0))),H=T[I]??null;return H?(s(H),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:H}),P(),H):null},pickManyAtPoint:(S,A,E)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let T=x(S,A,8);if(!T.length)return[];let I=[],H=Array.isArray(E)?E:[0];for(let j of H){let Y=Math.max(0,Math.min(T.length-1,Math.floor(Number(j)))),M=T[Y];if(!M)continue;I.some(te=>te.selector===M.selector&&te.tagName===M.tagName)||I.push(M)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),P(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:L,disablePickMode:P,installPickerApi:F}}var $g=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Da(e){return Number.isFinite(e)&&e>0?e:30}function Ia(e){return Number.isFinite(e)&&e>0?e:0}function Pa(e,t){let n=Da(t);return Math.floor(Ia(e)*n+1e-9)/n}function Qn(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return Pa(e,t);let i=Da(t)*r;return Math.round(Ia(e)*i)/i}function Oa(e,t){let n=Da(t),r=Ia(e),i=r*n,o=Math.round(i);return Math.abs(i-o)<=.001?o/n:r}function $c(e,t,n=$g){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function Zn(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&D("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function je(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&D("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function er(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){D("runtime.player.site1",i)}}}function jc(e,t,n,r){let i=Qn(t,n,r?.subFrameDivisions),o=r?.suppressEvents===!0;return je(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function jg(e,t,n,r,i){let o=[];er(e,t,a=>{je(a,"play"),o.push(a)});try{return jc(t,n,r,i)}finally{for(let a of o)try{je(a,"pause")}catch(l){D("runtime.player.site2",l)}}}function Kg(e,t){er(e,t,n=>{je(n,"play")})}function Kc(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??Zn(n,"duration",0))||0);r>0&&Math.max(0,Zn(n,"time",0))>=r&&(je(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),je(n,"play"),er(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),je(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;je(n,"pause"),er(e.getTimelineRegistry?.(),n,i=>{je(i,"pause")});let r=Math.max(0,Zn(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=jg(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),je(i,"play"),er(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),je(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(Kg(e.getTimelineRegistry?.(),i),jc(i,n,o,r)):Qn(Math.max(0,Number(n)||0),o,r?.subFrameDivisions);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Zn(e.getTimeline(),"time",0),getDuration:()=>Zn(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Yc(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var Yg=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Ga(e){return e.id||e.getAttribute("data-hf-id")||null}function Xg(e){return Fe(e)}function Jg(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function Qg(e){return ge(e)?Number.isFinite(e.duration)?et(e,e.duration):null:rn(e)}function Zg(e,t,n,r){let i=Xg(e.getAttribute("data-duration"));return i!=null&&i>0?i:Jg(e,t)??Qg(e)??Math.max(0,n-r)}function eb(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function Xc(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||Yg.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Zg(l,n,r,s)<=0)continue;let u={id:Ga(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return eb(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ha="css:root",Jc=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],tb=new Set([...Jc,"contain","isolation","mask-border","mix-blend-mode","opacity"]),nb=new Set(["absolute","relative"]),rb=new Set(["flex","inline-flex","grid","inline-grid"]),ib=new Set(["layout","paint","strict","content"]),ob=new Set(["size","inline-size"]);function ab(e){return e.position==="fixed"||e.position==="sticky"}function sb(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(nb.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&rb.has(n)}function lb(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:Jc.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function ub(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>ib.has(n))?!0:ob.has(e.getPropertyValue("container-type"))}function cb(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>tb.has(t))}function db(e,t){return ab(t)||sb(e,t)||lb(t)||ub(t)?!0:cb(t)}function mb(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function ki(e){let t=e.ownerDocument.defaultView;if(!t)return Ha;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(db(n,t.getComputedStyle(n)))return mb(n)}catch{return Ha}n=n.parentElement}return Ha}function Ba(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function Ut(e){return Fe(e)}function Ua(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=on({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(Ut).some(o=>o!=null&&o<=0)?0:null)}function Qc(e){return on({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function Wa(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function Va(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function za(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function nr(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function Zc(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return nr(t);let n=e.getAttribute("data-composition-src");if(n)return nr(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?nr(r.getAttribute("src")):null}function pb(e){let t=e.className;return typeof t!="string"?null:t.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function hb(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function gb(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function tr(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function bb(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return tr(i);let o=e.id;if(o)return tr(o);let a=pb(e);if(a)return tr(a);let l=hb(Zc(e));if(l)return tr(l);let s=gb(e);return s||`${tr(t)} ${n+1}`}function ed(e){let n=window.__timelines??{},r=tt({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=G=>{if(!G)return null;let O=n[G]??null;if(!O||typeof O.duration!="function")return null;try{let q=Number(O.duration());return Number.isFinite(q)&&q>0?q:null}catch{return null}},o=()=>{let G=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(G.length===0)return null;let O=0;for(let q of G){let Z=r.resolveMediaStartForElement(q);if(!Number.isFinite(Z))continue;let ce=bi(q);ce==null||ce<=0||(O=Math.max(O,Math.max(0,Z)+ce))}return O>0?O:null},a=(G,O)=>{let q=[],Z=null,ce=null,re=null,V=G.parentElement;for(;V;){let Q=V.getAttribute("data-composition-id");Q&&(q.push(Q),!re&&V!==O&&(re=Q),Z==null&&(Z=r.resolveStartForElement(V,0)),ce==null&&(ce=Ut(V.getAttribute("data-duration"))??i(Q)??null)),V=V.parentElement}return{parentCompositionId:re,compositionAncestors:q.reverse(),inheritedStart:Z,inheritedDuration:ce}},l=document.querySelector("[data-composition-id]"),s=Array.from(document.querySelectorAll("[data-composition-id]")),u=l?.getAttribute("data-composition-id")??null,d=l?r.resolveStartForElement(l,0):0,f=o(),m=f!=null?Math.max(0,f-Math.max(0,d)):null,p=i(u),g=Ua(l??document.body),y=Va(...s.filter(G=>G!==l).map(G=>{let O=r.resolveStartForElement(G,0),q=r.resolveDurationForElement(G)??i(G.getAttribute("data-composition-id"))??null;return!Number.isFinite(O)||q==null||q<=0?null:Math.max(0,O)+q})),x=y!=null?Math.max(0,y-Math.max(0,d)):null,_=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,k=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,C=typeof m=="number"&&Number.isFinite(m)&&m>0?m:null,L=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,P=Va(C,L),F=_!=null&&P!=null&&_>P+1,A=k??(F?P:Va(_,C,L))??null,T=(A!=null?d+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),I=(G,O)=>!Number.isFinite(O)||O<=0?0:T==null||!Number.isFinite(T)?O:!Number.isFinite(G)||G>=T?0:Math.max(0,Math.min(O,T-G)),H=[],j=[],Y=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),M=0;for(let[G,O]of Y.entries()){if(O===l||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(O.tagName))continue;let q=a(O,l),Z=O.tagName.toLowerCase(),ce=Z==="video"||Z==="audio"?r.resolveMediaStartForElement(O):r.resolveStartForElement(O,q.inheritedStart??0),re=O.getAttribute("data-composition-id"),V=Ua(O);if(V==null&&re&&re!==u&&(V=i(re)),V==null&&ge(O)&&Number.isFinite(O.duration)&&(V=et(O,O.duration)),V==null&&(V=rn(O,ce)),V==null){let de=q.inheritedDuration;if(de!=null&&de>0){let ut=(q.inheritedStart??0)+de;V=Math.max(0,ut-ce)}}if(V==null||V<=0||(V=I(ce,V),V<=0))continue;let Q=ce+V;M=Math.max(M,Q);let Ee=re&&re!==u?"composition":Z==="video"?"video":Z==="audio"?"audio":Z==="img"?"image":"element";H.push({id:Ga(O)??re??null,label:bb(O,Ee,H.length),start:ce,duration:V,track:za(O,G),zIndex:Wa(O),stackingContextId:ki(O),kind:Ee,tagName:Z,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:q.compositionAncestors,parentCompositionId:q.parentCompositionId,nodePath:null,compositionSrc:nr(O.getAttribute("data-composition-src")),playbackStart:nt(O),playbackRate:Oe(O),assetUrl:Zc(O),timelineRole:O.getAttribute("data-timeline-role"),timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ut(O.getAttribute("data-timeline-priority"))})}let W=new Set(H.map(G=>G.id)),te=l?.getAttribute("data-composition-id")??null,U=te?n[te]??null:null;if(U&&l){let G=U;if(typeof G.getChildren=="function")try{let O=G.getChildren(!0,!0,!1)??[],q=new Map;for(let re of l.children){let V=re;if(!V.id)continue;let Q=V.tagName.toLowerCase();Q==="script"||Q==="style"||Q==="link"||q.set(V,{id:V.id,start:1/0,end:-1/0})}let Z=re=>{let V=re;for(;V;){if(q.has(V))return V;if(V===l)return null;V=V.parentElement}return null};for(let re of O){if(typeof re.targets!="function"||typeof re.startTime!="function"||typeof re.duration!="function")continue;let V=re.startTime(),Q=re.parent;for(;Q&&Q!==U&&typeof Q.startTime=="function";)V+=Q.startTime(),Q=Q.parent;let Ee=V+re.duration();if(!(!Number.isFinite(V)||!Number.isFinite(Ee)))for(let de of re.targets()){if(!Me(de))continue;let Cn=Z(de);if(!Cn)continue;let ut=q.get(Cn);ut&&(ut.start=Math.min(ut.start,V),ut.end=Math.max(ut.end,Ee))}}let ce=H.length>0?Math.max(...H.map(re=>re.track))+1:0;for(let[re,V]of q){if(V.start===1/0||V.end===-1/0)continue;let Q=re;if(W.has(Q.id))continue;let Ee=Math.max(0,V.end-V.start);if(Ee<=0)continue;let de=I(V.start,Ee);de<=0||(M=Math.max(M,V.start+de),H.push({id:Q.id,label:Q.getAttribute("data-timeline-label")??Q.getAttribute("data-label")??Q.getAttribute("aria-label")??Q.id,start:V.start,duration:de,track:za(Q,ce),zIndex:Wa(Q),stackingContextId:ki(Q),kind:"element",tagName:Q.tagName.toLowerCase(),compositionId:Q.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:nt(Q),playbackRate:Oe(Q),assetUrl:null,timelineRole:Q.getAttribute("data-timeline-role"),timelineLabel:Q.getAttribute("data-timeline-label"),timelineGroup:Q.getAttribute("data-timeline-group"),timelinePriority:Ut(Q.getAttribute("data-timeline-priority"))}),W.add(Q.id))}}catch(O){D("runtime.timeline.site1",O)}}if(l&&A!=null&&A>0){let G=H.length>0?Math.max(...H.map(O=>O.track))+1:0;for(let O of l.children){let q=O;if(!q.id||W.has(q.id))continue;let Z=q.getAttribute("data-timeline-role");if(Z!=="overlay"&&Z!=="persistent-overlay")continue;let ce=q.tagName.toLowerCase();if(ce==="script"||ce==="style"||ce==="link"||ce==="meta"||window.getComputedStyle(q).display==="none")continue;let V=I(0,A);V<=0||(M=Math.max(M,V),H.push({id:q.id,label:q.getAttribute("data-timeline-label")??q.getAttribute("data-label")??q.getAttribute("aria-label")??q.id,start:0,duration:V,track:za(q,G),zIndex:Wa(q),stackingContextId:ki(q),kind:"element",tagName:ce,compositionId:q.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:nt(q),playbackRate:Oe(q),assetUrl:null,timelineRole:Z,timelineLabel:q.getAttribute("data-timeline-label"),timelineGroup:q.getAttribute("data-timeline-group"),timelinePriority:Ut(q.getAttribute("data-timeline-priority"))}),W.add(q.id))}}for(let G of s){if(G===l)continue;let O=G.getAttribute("data-composition-id");if(!O||!Ba(O))continue;let q=r.resolveStartForElement(G,0),Z=Ua(G);if((Z==null||Z<=0)&&Qc(G)!=null){let Q=Qc(G);Z=Math.max(0,Q-q)}let ce=i(O),re=Z&&Z>0?Z:ce;if(re==null||re<=0)continue;let V=I(q,re);V<=0||j.push({id:O,label:G.getAttribute("data-label")??O,start:q,duration:V,thumbnailUrl:nr(G.getAttribute("data-thumbnail-url")),avatarName:null})}let K=Math.max(1,M||1,A??0),z=F&&k==null,J=z?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(K*Math.max(1,e.canonicalFps)));return{...ei(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:z?Number.POSITIVE_INFINITY:K,durationInFrames:J,clips:H,scenes:j,compositionWidth:Ut(l?.getAttribute("data-width"))??1920,compositionHeight:Ut(l?.getAttribute("data-height"))??1080}}var td=e=>e!==null&&Number.isFinite(e)&&e>0;function rr(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if(td(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter(td);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:t}:{seconds:null,source:"unresolved",pendingClips:t,reason:t>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}var qa="data-composition-id",xb="data-composition-src",yb=`[${qa}]`,b_=`[${xb}]`,nd="style",rd="script",Sb='link[rel="stylesheet"], link[rel="preconnect"]';function dn(e){return e?Array.from(e):[]}function id(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=dn(t.querySelectorAll(yb)),l=o?a.find(d=>d.getAttribute(qa)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(qa)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...dn(u?.querySelectorAll(nd)),...dn(t.querySelectorAll(nd))],scriptSources:[...dn(u?.querySelectorAll(rd)),...dn(t.querySelectorAll(rd))],linkSources:dn(n?.querySelectorAll(Sb)),variableDefaultCarriers:[r,l].filter(d=>d!=null)}}var Se=Qh(Lm(),1),Dm=Se.default,aC=Se.default.stringify,sC=Se.default.fromJSON,lC=Se.default.plugin,uC=Se.default.parse,cC=Se.default.list,dC=Se.default.document,mC=Se.default.comment,fC=Se.default.atRule,pC=Se.default.rule,hC=Se.default.decl,gC=Se.default.root,bC=Se.default.CssSyntaxError,xC=Se.default.Declaration,yC=Se.default.Container,SC=Se.default.Processor,vC=Se.default.Document,AC=Se.default.Comment,EC=Se.default.Warning,wC=Se.default.AtRule,_C=Se.default.Result,CC=Se.default.Input,RC=Se.default.Rule,TC=Se.default.Root,kC=Se.default.Node;var gs="data-hf-authored-id",Im="data-hf-inner-root";function bs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xs(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Zx(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function Om(e){let t=e.trim();return t?Array.from(new Set([t,Zx(t)])).filter(Boolean):[]}function ey(e){return!!e&&/[\w-]/.test(e)}function ty(e,t,n){let r=Om(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let d=r.find(f=>e.startsWith(f,l+1));if(d){let f=e[l+1+d.length];if(!ey(f)){i+=n,l+=d.length;continue}}}i+=s}return i}function ny(e,t){let n=t?.trim();return n?ty(e,n,`[${gs}="${xs(n)}"]`):e}function Pm(e){return`${e}:not(:has([${Im}])), ${e} > [${Im}]`}function ry(e,t,n,r,i,o){let a=ny(e,r),l=iy(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?Pm(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${bs(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?Pm(t):l.replace(u,t);let d=l.match(/^\s*/)?.[0]??"",f=l.match(/\s*$/)?.[0]??"";if(i){let m=r?`[${gs}="${xs(r)}"]`:null;if(m&&s.startsWith(m)){let p=s.slice(m.length);return`${d}${t}${m}${p}${f}`}}return`${d}${t} ${s}${f}`}function iy(e,t,n){let r=bs(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var oy=new Set(["keyframes","-webkit-keyframes","font-face"]);function ay(e){return e?.type==="atrule"}function sy(e){let t=e.parent;for(;t;){if(ay(t)&&oy.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function ly(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function Gm(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${xs(o)}"]`,l;try{l=Dm.parse(e)}catch{return""}return l.walkRules(s=>{sy(s)||ly(s)||(s.selectors=s.selectors.map(u=>ry(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function ht(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function Hm(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=ht(t),l=ht(i),s=ht(n),u=bs(t),d=ht(o?.trim()||null),f=ht(r??null),m=ht(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),p=ht(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),g=ht(Om(o?.trim()||""));return`(function(){
39
+ `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){I("bridge.flashElements.querySelector",r)}}var vt=(e,t,n)=>e>=t&&e<n;var ii=(e,t,n,r)=>vt(e,t,n)||e>=t&&r>0&&n>=r-1e-6;var Wo=null;function iu(e){Wo=e}function He(e,t){if(Wo)try{Wo({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){I("runtime.analytics.site1",n)}}function y0(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function Qt(e){return`--${y0(e)}`}function ou(e){let t=new Map;for(let n of e){let r=Qt(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function su(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,Pn(i));let n=ai(),r={...t,...n};for(let i of e)zo(i,r);return r}var au=new Set;function lu(e){let t=e?.getAttribute("data-composition-variables");if(!t)return[];let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(r=>!!r&&typeof r=="object"):[]}function S0(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function v0(e){return Array.isArray(e.options)?e.options.map(t=>t&&typeof t=="object"?t.value:t).filter(t=>typeof t=="string"||typeof t=="number"):[]}function A0(e,t){if(typeof e.id!="string")return null;let n=t[e.id];if(n==null||"default"in e&&String(n)===String(e.default))return null;let r=v0(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function zo(e,t,n){if(!e)return;let r=lu(e);if(r.length===0)return;let i=S0(e,n);for(let o of r){let a=A0(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(au.has(l))continue;au.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function Pn(e){let t={};for(let n of lu(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Vo="data-hf-css-vars";function oi(e){return"style"in e&&typeof e.style?.setProperty=="function"}function qo(e,t){if(!oi(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Qt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Vo,n.join(" "))}function uu(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Qt(i);((oi(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function cu(e){if(!oi(e))return;let t=e.getAttribute(Vo);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Vo)}}function du(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=ai(),r=[];for(let i of t)r.push(...E0(i,n,e.defaultView));for(let i of ou(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Qt(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function E0(e,t,n){if(!oi(e))return[];let r=Pn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Qt(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return qo(e,i),Object.keys(r)}function mu(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function ai(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}var fu="http://www.w3.org/1999/xhtml";function ke(e){return e!=null&&e.nodeType===1}function Ae(e){return ke(e)&&e.namespaceURI===fu}function On(e,t){return Ae(e)&&e.localName===t}function fe(e){return On(e,"video")}function $o(e){return On(e,"audio")}function he(e){return fe(e)||$o(e)}function Le(e){return On(e,"img")}function pu(e){return On(e,"style")}function hu(e){return On(e,"link")}function jo(e){return ke(e)&&(e.namespaceURI===fu||e.namespaceURI==="http://www.w3.org/2000/svg")}function gu(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,d)=>{let f=null;try{f=u.effect?.getComputedTiming?.()??null}catch(p){I("runtime.adapters.css.site5",p)}if(!f)return{};let m=Number(f.endTime);return Number.isFinite(m)?{endSeconds:d+m/1e3}:{unbounded:!0}},o=(u,d)=>{for(let f of u){try{f.currentTime=d}catch(m){I("runtime.adapters.css.site1",m)}try{f.pause()}catch(m){I("runtime.adapters.css.site2",m)}}},a=u=>{for(let d of u)try{d.play()}catch(f){I("runtime.adapters.css.site3",f)}},l=u=>{for(let d of u)try{d.pause()}catch(f){I("runtime.adapters.css.site4",f)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let d of u){if(!Ae(d))continue;let f=window.getComputedStyle(d);!f.animationName||f.animationName==="none"||t.push({el:d,baseDelay:d.style.animationDelay||"",basePlayState:d.style.animationPlayState||"",animations:n(d)})}},getInferredDurationSeconds:()=>{let u=0;for(let d of t){if(!d.el.isConnected)continue;let f=r(d.el);for(let m of n(d.el)){let p=i(m,f);p.endSeconds!=null&&(u=Math.max(u,p.endSeconds))}}return u>0?u:null},seek:u=>{let d=Number(u.time)||0;for(let f of t){if(!f.el.isConnected)continue;let m=r(f.el),p=Math.max(0,d-m)*1e3,g=f.animations;if(g.length>0){o(g,p);continue}f.el.style.animationPlayState="paused",f.el.style.animationDelay=`-${(p/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let d=u.animations;d.length>0&&l(d),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function bu(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function xu(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){I("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){I("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){I("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){I("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Su(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){I("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(Ko(r))r.goToAndStop(t*1e3,!1);else if(Yo(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??0;if(Number.isFinite(i)&&i>0){let o=Math.min(100,t/i*100);r.seek(o)}}}}catch(i){I("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(Ko(t)||Yo(t))&&t.pause()}catch(n){I("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=_0(r)}catch(o){I("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function yu(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function _0(e){return Ko(e)?yu(e.totalFrames,e.frameRate):Yo(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:yu(e.totalFrames,e.frameRate):null}function Ko(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Yo(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var Xo=-1,si=new Set,Zt,Jo=0;function vu(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){I("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));si.add(i),i.then(o=>{si.delete(i)&&o.status==="rejected"&&Zt===void 0&&(Zt={reason:o.reason})})}function li(e){e!==Xo&&(Xo=e,vu(e))}function ui(e){Xo=e,vu(e)}function Au(){return Jo>0}async function Qo(){Jo+=1;let e=Zt;try{for(await Promise.resolve();si.size>0;){let r=(await Promise.all([...si])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Zt;if(e===void 0&&(e=t),Zt===t&&(Zt=void 0),e)throw e.reason}finally{Jo-=1}}function Eu(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(d=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,d()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(d,f,m){try{r?.call(this,d,f,m)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,li(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function Ze(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function _u(){return Ze({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function wu(){return Ze({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function Cu(){return Ze({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function Ru(){return Ze({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function Tu(){return Ze({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var w0=250;function ku(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(Au()||(window.__hfTypegpuTime=e,ui(e)))},w0))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,li(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var Gn="data-hf-render-id",Mu="data-hf-group-render-id";function C0(e){return e.getAttribute(Gn)||e.id||null}var R0="__render_frame_",T0="__";function k0(e){return`${R0}${e}${T0}`}function M0(e){let t=C0(e);return t?k0(t):null}function At(e){let t=M0(e);if(!t)return null;let n=document.getElementById(t);return Le(n)?n:null}function Fu(e){let t=e.nextElementSibling;if(Le(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=At(e);return n&&n.complete&&n.naturalWidth>0?n:null}function Nu(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(fe(n?.source)){let o=Fu(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function Lu(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(fe(u)){let d=Fu(u);d&&(l[s]=d)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}var Ht="data-fx-chain",_E=Ht.slice(5),Du=1,Hn=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),Zo=(e=.707,t="Bandwidth \u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),ci=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Iu={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},Ou=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[ci(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[Hn("frequency","Frequency",1e3),ci(-40,40,0),Zo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Hn("frequency","Frequency",200,20,2e3),ci(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Hn("frequency","Frequency",4e3,500,2e4),ci(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \u2014 the usual fix for rumble on a voice.",params:[Hn("frequency","Cutoff",300,20,2e4),Zo(.707),Iu],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[Hn("frequency","Cutoff",8e3,100,2e4),Zo(.707),Iu],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling \u2014 nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times \u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],ea=new Map(Ou.map(e=>[e.id,e]));function Bn(e){return ea.get(e)}var wE=Ou.map(e=>e.id);function Un(e,t){let n=ea.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var Et=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Gu(e){let t;try{t=JSON.parse(e)}catch(i){throw new Et(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new Et("Chain file must be a JSON object.");let n=t;if(n.version!==Du)throw new Et(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Et("Chain file is missing a `nodes` array.");let r=n.nodes.map(F0);return{version:Du,nodes:r}}function Wn(e){return e.nodes.filter(t=>t.enabled!==!1)}function F0(e,t){if(typeof e!="object"||e===null)throw new Et(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!ea.has(n.type))throw new Et(`Node ${t} has unknown effect type: ${String(n.type)}`);return L0({type:n.type,id:di(n.id),fromCarve:Pu(n.fromCarve),fromPreset:di(n.fromPreset),label:di(n.label),fromEq:di(n.fromEq),fromLeveller:Pu(n.fromLeveller),presetAmount:N0(n.presetAmount),enabled:n.enabled!==!1,params:Un(n.type,n.params??void 0)})}function di(e){return typeof e=="string"&&e?e:void 0}function Pu(e){return e===!0?!0:void 0}function N0(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function L0(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function D0(e){return 10**(e/20)}var ta=D0(12);function Be(e){return Number.isFinite(e)?Math.max(0,Math.min(ta,e)):1}function mi(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Hu(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,i=n?.set;if(!r||!i)return t();let o=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>o,set:a=>{o=Number(a),i.call(e,mi(o))}});try{return t()}finally{delete e.volume,i.call(e,mi(o))}}var en=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),TE=Object.freeze([en.start,en.duration,en.trackIndex]),kE=Object.freeze([en.derivedEnd]),ME=Object.freeze([en.derivedEnd,en.legacyTrack]);function _t(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Uu=/^[A-Za-z0-9_.:-]+$/;function Wu(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Bu(e,t){let n=t;for(;n>=0&&Wu(e,n);)n--;return n}function I0(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function P0(e){let t=e.length-1;if(!Wu(e,t))return null;let n=Bu(e,t);return e[n]==="."&&(n=Bu(e,n-1)),n+1}function O0(e){let t=P0(e);if(t==null)return null;let n=I0(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!Uu.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function na(e){let t=(e??"").trim();if(!t)return null;let n=_t(t);if(n!=null)return{kind:"absolute",value:n};if(Uu.test(t))return{kind:"reference",refId:t,offset:0};let r=O0(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var Vu=e=>{let t=_t(e);return t!==null&&t>=0?t:null};function zu(e){return Vu(e("data-playback-start"))??Vu(e("data-media-start"))??0}var Vn=.1,zn=10;function ra(e){return Number.isFinite(e)&&e>0?Math.max(Vn,Math.min(zn,e)):1}function qu(e,t=1){let n=Number.parseFloat(e("data-playback-rate")??"");return ra(Number.isFinite(n)&&n>0?n:t)}function ia(e){let t=_t(e("data-duration"));return t!==null&&t>0?t:null}function $u(e,t){let n=ia(e);if(n!==null)return n;let r=_t(e("data-end"));return r!==null?r-t:null}var G0=3;function oa(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/ra(n):null}function aa(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:i,playbackRate:o}=e;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(t==="img")return{seconds:G0,source:"default"};if(r===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=oa(r,i,o);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var dt="data-automation",BE=dt.slice(5),fi=1,H0=512,ct=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},tn="volume",pi="rate";function $n(e){if(e===tn)return{kind:"volume"};if(e===pi)return{kind:"rate"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===B0){let i=t[2];return i?{kind:"preset",presetId:i}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var B0="preset";var U0={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},hi={min:0,max:ta,step:.01,unit:"",label:"Volume",scale:"linear",default:1},ju={min:Vn,max:zn,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function sa(e,t){let n=$n(e);if(!n)return null;if(n.kind==="volume")return hi;if(n.kind==="rate")return ju;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...U0,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Bn(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function qn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function W0(e){let t=qn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Ku(e,t){let n=qn(e),r=qn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function V0(e){let t=W0(e?.curve),n=Ku(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function z0(e,t){let n=qn(e?.t),r=qn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...V0(e)}}function Yu(e,t){let n=e.map(i=>z0(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,H0)}function q0(e){let t=[];for(let n of e.lanes){if(!$n(n.target))continue;let r=n.target===tn?hi:n.target===pi?ju:null,i=Yu(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:fi,lanes:t}}function Xu(e,t){let n=[];for(let r of e.lanes){let i=sa(r.target,t);if(!i)continue;let o=Yu(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:fi,lanes:n}}function gi(e){let t;try{t=JSON.parse(e)}catch(i){throw new ct(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new ct("Automation must be a JSON object.");let n=t;if(n.version!==fi)throw new ct(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new ct("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new ct(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!$n(a.target))throw new ct(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new ct(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return q0({version:fi,lanes:r})}function $0(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function j0(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function K0(e,t,n){let{cx:r,cy:i,w:o}=j0(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=Y0(l,s,e),d=1-u,f=d*d+2*o*u*d+u*u;return f>0?(2*o*i*u*d+u*u)/f:e}function Y0(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function X0(e,t){let n=Ku(t.viaX,t.viaY);return n?K0(Math.min(1,Math.max(0,e)),n.x,n.y):$0(e,t.curve)}function J0(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function mt(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],u=r[l],d=u.t-s.t;return d<=0?u.v:J0(s.v,u.v,X0((t-s.t)/d,s),n)}function Ju(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Qu(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=mt(e,t+l*s/(o-1),i);return a}var bi=new Map,Q0=64;function la(e,t=tn){let n=`${t}\0${e}`,r=bi.get(n);if(r!==void 0)return r;let i=null;try{i=gi(e).lanes.find(o=>o.target===t)??null}catch{i=null}return bi.size>Q0&&bi.clear(),bi.set(n,i),i}function Zu(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(dt):null)??"";if(!n)return null;let r=la(n);return!r||r.points.length===0?null:mt(r,t)}var ec=48,tc=new WeakMap;function Z0(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,i=[0],o=[0],a=s=>{let u=i[i.length-1];if(s<=u)return;let d=mt(e,u,"log");i.push(s),o.push(o[o.length-1]+(d+mt(e,s,"log"))/2*(s-u))},l=Math.max(0,t[0].t);a(l);for(let s=1;s<t.length;s+=1){let u=t[s-1].t,d=t[s].t;if(!(d<=0))for(let f=1;f<=ec;f+=1)a(Math.max(u,0)+(d-u)*f/ec)}return{ts:Float64Array.from(i),ss:Float64Array.from(o),firstRate:n,lastRate:r}}function nc(e){let t=tc.get(e);return t||(t=Z0(e),tc.set(e,t)),t}function ua(e){return typeof e!="number"&&e.points.length>0}function rc(e,t){return typeof e=="number"?e:ua(e)?mt(e,t,"log"):1}function ic(e,t,n){let r=0,i=e.length-1;for(;i-r>1;){let o=r+i>>1;e[o]<=n?r=o:i=o}return t[r]+(t[i]-t[r])*(n-e[r])/(e[i]-e[r])}function xi(e,t){if(typeof e=="number")return t*e;if(!ua(e))return t;let{ts:n,ss:r,firstRate:i,lastRate:o}=nc(e),a=n.length-1;return t<=0?t*i:t>=n[a]?r[a]+(t-n[a])*o:ic(n,r,t)}function nn(e,t){if(typeof e=="number")return t/e;if(!ua(e))return t;let{ts:n,ss:r,firstRate:i,lastRate:o}=nc(e),a=n.length-1;return t<=0?t/i:t>=r[a]?n[a]+(t-r[a])/o:ic(r,n,t)}function eg(e){return e?la(e,pi):null}function oc(e,t){return eg(e)??t}function ac(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=x=>{let w=Number(x.currentTime);return Number.isFinite(w)&&w>0?w:0},d=(x,w)=>w<=0?x:x>=w?Math.max(0,x-w):x,f=(x,w)=>{let k=l.get(x);if(k)return k;let C={compositionTimeMs:w,animationTimeMs:e?d(u(x),w):u(x)};return l.set(x,C),C},m=(x,w)=>{if(!a.has(x)){a.add(x);let k=()=>{a.delete(x)};try{x.addEventListener("finish",k,{once:!0}),x.addEventListener("cancel",k,{once:!0})}catch(C){I("runtime.adapters.waapi.site4",C)}}f(x,w)},p=(x,w)=>{for(let k of x)m(k,w)},g=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let w=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:w,configurable:!0});let k=function(...C){let N=w.apply(this,C);return m(N,t),N};x.animate=k,r=x,i=w,o=k,n=!0}catch{}},y=x=>{let w=null;try{w=x.effect?.getComputedTiming?.()??null}catch(N){I("runtime.adapters.waapi.site4",N)}if(!w)return{};let k=Number(w.endTime);return Number.isFinite(k)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+k/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,g(),p(s(),t)},seek:x=>{let w=Math.max(0,(Number(x.time)||0)*1e3);t=w,(!e||a.size>0)&&p(s(),e?w:0);for(let k of a){let C=e?f(k,w):f(k,0),N=C.animationTimeMs+Math.max(0,w-C.compositionTimeMs);try{k.currentTime=N}catch(O){I("runtime.adapters.waapi.site1",O)}try{k.pause()}catch(O){I("runtime.adapters.waapi.site2",O)}}},pause:()=>{e||p(s(),t);for(let x of a)try{x.pause()}catch(w){I("runtime.adapters.waapi.site3",w)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){I("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let w of s()){let k=y(w);k.endSeconds!=null&&(x=Math.max(x,k.endSeconds))}return x>0?x:null}}}function Me(e){return _t(e)}function Pe(e){return qu(t=>e.getAttribute(t),he(e)?e.defaultPlaybackRate:1)}function wt(e){return oc(e.getAttribute("data-automation"),Pe(e))}function yi(e){return zu(t=>e.getAttribute(t))}function et(e,t){return tg(t,yi(e),wt(e))}function Si(e){let t=aa({tag:"video",authoredDurationSeconds:ia(n=>e.getAttribute(n)),sourceDurationSeconds:Number.isFinite(e.duration)?e.duration:null,mediaStartSeconds:yi(e),playbackRate:Pe(e)});return t.source==="media"?et(e,e.duration):t.seconds}function rn(e,t=0){return!Le(e)||!e.hasAttribute("data-start")&&!e.hasAttribute("data-track-index")?null:aa({tag:"img",authoredDurationSeconds:$u(n=>e.getAttribute(n),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function tg(e,t,n){return typeof n=="number"?oa(e,t,n):Number.isFinite(e)?nn(n,Math.max(0,e-t)):null}var on="data-hf-authored-duration",an="data-hf-authored-end";function jn(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function sn(e){let t=jn(e.start);if(t==null)return null;let n=Math.max(0,t),r=jn(e.duration),i=jn(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=jn(e.end),l=jn(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var vi="data-hf-media-start-basis";function ng(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function rg(e){return ng(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function sc(e){return e.hasAutoStart||e.authoredStart==null||e.hostStart<=0?e.ordinaryStart():rg({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis})}function Ue(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=m=>{let p=r.getElementById(m);return p||(r.querySelector(`[data-composition-id="${CSS.escape(m)}"]`)??null)},s=m=>{let p=o.get(m);if(p!==void 0)return p;let g=null,y=sn({start:0,duration:m.getAttribute("data-duration"),authoredDuration:n?m.getAttribute("data-hf-authored-duration"):null});if(y?.duration!=null&&y.duration>0&&(g=y.duration),g==null||g<=0){let x=d(m,0),w=sn({start:x,end:m.getAttribute("data-end"),authoredEnd:n?m.getAttribute("data-hf-authored-end"):null});w?.duration!=null&&w.duration>0&&(g=w.duration)}if((g==null||g<=0)&&he(m)&&(g=et(m,m.duration)),(g==null||g<=0)&&(g=rn(m)),g==null||g<=0){let x=m.getAttribute("data-composition-id");if(x){let w=t[x]??null;if(w&&typeof w.duration=="function")try{let k=Number(w.duration());Number.isFinite(k)&&k>0&&(g=k)}catch(k){I("runtime.startResolver.site1",k)}}}return g!=null&&Number.isFinite(g)&&g>0?(o.set(m,g),g):(o.set(m,null),null)},u=(m,p)=>{if(m.hasAttribute("data-composition-id")){let y=m.parentElement?.closest("[data-composition-id]");return y?d(y,p):0}let g=m.closest("[data-composition-id]");return g?d(g,p):0},d=(m,p)=>{let g=i.get(m);if(g!==void 0)return g??p;if(a.has(m))return p;a.add(m);try{let y=na(m.getAttribute("data-start"));if(!y){if(m.hasAttribute("data-composition-id")){let N=m.parentElement;if(N&&(N.hasAttribute("data-composition-src")||N.hasAttribute("data-composition-id")||N.hasAttribute("data-composition-file"))){let O=d(N,p);return i.set(m,O),O}}return i.set(m,p),p}if(y.kind==="absolute"){let N=Math.max(0,y.value),O=Math.max(0,u(m,p)+N);return i.set(m,O),O}let x=l(y.refId);if(!x)return i.set(m,p),p;let w=d(x,0),k=s(x);if(k==null||k<=0){let N=Math.max(0,w+y.offset);return i.set(m,N),N}let C=Math.max(0,w+k+y.offset);return i.set(m,C),C}finally{a.delete(m)}};return{resolveStartForElement:(m,p=0)=>d(m,Math.max(0,p)),resolveDurationForElement:m=>s(m),resolveMediaStartForElement:m=>{let p=m.closest("[data-composition-id]"),g=p?d(p,0):0;return sc({authoredStart:Me(m.getAttribute("data-start")),hostStart:g,hasAutoStart:m.hasAttribute("data-hf-auto-start"),basis:m.getAttribute(vi),ordinaryStart:()=>d(m,g)})}}}function ig(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Be(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Be(n)}),i}function lc(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function og(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function ag(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function sg(e,t){let n=Ue({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Me(e.dataset.end)??void 0,i=Me(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=ag(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Be(a)}}function lg(e,t,n,r,{start:i,end:o,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),d=Hu(e,()=>{e.volume=a;let m=[],p;for(let g=s;g<=u+1e-6;g=Math.min(u,g+l)){t(g);let y=Number(e.volume);if(Number.isFinite(y)){let x={time:Number(g.toFixed(6)),volume:Number(Be(y).toFixed(6))};og(m,p,x,g===u),p=x}if(g===u)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function uc(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!he(e)||n<=0)return;let o=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=sg(e,n),s=lg(e,o,n,60,l);if(Number.isFinite(a)&&o(a),s){let u=ig(s,l.start,l.staticVolume);u.length>0&&r.set(e,u)}}var mc="data-fade-in",fc="data-fade-out",b_=mc.slice(5),x_=fc.slice(5),pc=Object.freeze({fadeIn:0,fadeOut:0});function ca(e){return Number.isFinite(e)&&e>0?e:0}function cc(e){return e==null||e===""?0:ca(Number.parseFloat(e))}function hc(e){return{fadeIn:cc(e.getAttribute(mc)),fadeOut:cc(e.getAttribute(fc))}}function ug(e,t){let n=ca(e.fadeIn),r=ca(e.fadeOut);if(!Number.isFinite(t)||t<=0)return{fadeIn:n,fadeOut:r};let i=n+r;if(i<=t)return{fadeIn:n,fadeOut:r};let o=t/i;return{fadeIn:n*o,fadeOut:r*o}}function gc(e,t,n){if(!Number.isFinite(e))return 1;let{fadeIn:r,fadeOut:i}=ug(n,t),o=1;return r>0&&(o*=dc(e/r)),i>0&&Number.isFinite(t)&&(o*=dc((t-e)/i)),o}function dc(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var ln="hf-audio-group",Ai="data-audio-group";function da(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function ma(e,t){let n=Array.from(e?.querySelectorAll?.(`${ln}[${Gn}]`)??[]).find(i=>i.getAttribute(Gn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===ln?r:null}function Ei(e,t){let n=t?.getAttribute?.(Mu)??t?.getAttribute?.(Ai);return n?ma(e,n)?.hasAttribute("data-hidden")??!1:!1}function bc(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(Ai)||null}function xc(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${ln}{display:none!important}`,e.head.appendChild(n)}function tt(e){return yi(e)}function yc(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>=0);return n.length>0?Math.min(...n):null}function Sc(e){let t=e?.elements??Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=tt(a),u=Pe(a),d=wt(a),f=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,p=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(p)||p<0)&&m!=null&&(p=Math.max(0,nn(d,m-s)));let g=Number.isFinite(p)&&p>=0,y=g?l+p:Number.POSITIVE_INFINITY,x=Number.parseFloat(a.dataset.volume??""),w={el:a,start:l,mediaStart:s,duration:g?p:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(x)?x:null,playbackRate:u,rate:d,loop:f,sourceDuration:m,fades:hc(a)};r.push(w),a.tagName==="VIDEO"&&i.push(w),Number.isFinite(y)&&(o=Math.max(o,y))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var pa=new WeakMap,_i=new WeakMap,Kn=new WeakMap,ha=new WeakSet,un=new WeakSet;function cg(e){if(un.has(e))return;un.add(e);let t=()=>un.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var dg=3;function mg(e){return e.error!=null||e.networkState===dg}var ga=new WeakMap;function fa(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function ba(e){pa.delete(e),_i.delete(e),Kn.delete(e),ha.delete(e),ga.delete(e)}function vc(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=n.rate??n.playbackRate,o=r.tagName==="VIDEO"&&!n.loop,a=vt(e.timeSeconds,n.start,n.end),l=o&&!a&&e.timeSeconds>=n.end&&ii(e.timeSeconds,n.start,n.end,e.getCompositionDuration()),s=xi(i,Math.min(e.timeSeconds,n.end)-n.start)+n.mediaStart,u=l||o&&n.sourceDuration!=null&&s>=n.sourceDuration&&a;u&&n.sourceDuration!=null&&(s=Math.min(s,n.sourceDuration));let d=_i.get(r),f=r.tagName==="AUDIO"&&(d===void 0||s<d-.04),m=!n.loop&&n.sourceDuration!=null&&s>=n.mediaStart&&s<n.sourceDuration&&(o||f);if((a||l)&&s>=0&&(!r.ended||n.loop||u||m)){if(_i.set(r,s),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let P=n.sourceDuration-n.mediaStart;P>0&&s>=n.sourceDuration&&(s=n.mediaStart+(s-n.mediaStart)%P)}let y=fa(e.userVolume??1),x=Be(n.volume??1),w=ga.get(r),k=fa(r.volume),C,N=Zu(r,e.timeSeconds-n.start);if(N!==null)C=Be(N);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let P=e.timeSeconds-n.start;C=Be(lc(n.volumeKeyframes,P))}else e.isWebAudioRouted?.(r)?C=x:w===void 0?C=x>1?x:k:Math.abs(k-w)>1e-4?C=k:C=x;let O=n.fades??pc;(O.fadeIn>0||O.fadeOut>0)&&(C*=gc(e.timeSeconds-n.start,n.duration,O));let S=r.closest("[data-hidden]")!==null||Ei(r.ownerDocument,r)?0:fa(C*y);r.volume=S,ga.set(r,S),e.onElementVolume?.(r,S,C),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=rc(i,e.timeSeconds-n.start)*e.playbackRate}catch(P){I("runtime.media.site1",P)}let v=.04,E=2,T=r.currentTime||0,L=Math.abs(T-s),G=s-T,z=pa.get(r);pa.set(r,G);let X=z===void 0,M=!X&&Math.abs(G-z)>.5,V=L>3,te=r.tagName==="AUDIO"&&X&&T-s>v,B=u&&L>.001||r.ended&&m&&L>.001||te||L>.5&&(X||M||V),q=r.tagName==="VIDEO"&&!r.paused,$=z!==void 0&&Math.abs(G-z)<.004,J=!1;if(!q&&!B&&!X&&$&&L>v){let P=(Kn.get(r)??0)+1;Kn.set(r,P),P>=E&&(J=!0,Kn.set(r,0))}else L<=v&&Kn.set(r,0);let j=!q&&e.forceSync&&L>.02;if(B||J||j){if(!(r.tagName==="VIDEO"&&!!At(r))){try{r.currentTime=s}catch(U){I("runtime.media.site2",U)}if(Math.abs(r.currentTime-s)>.5&&!ha.has(r)){ha.add(r),r.load();try{r.currentTime=s}catch(U){I("runtime.media.site3",U)}}}un.delete(r)}u?r.paused||r.pause():e.playing&&r.paused&&!un.has(r)&&!mg(r)?(cg(r),r.play().catch(P=>{un.delete(r),(P&&typeof P=="object"&&"name"in P?String(P.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let g=vt(e.timeSeconds,n.start,n.end);ba(r),g&&_i.set(r,s),r.paused||r.pause()}}var fg="hf-proxy",Ac="runtime_media_proxy_fallback",Ec="runtime_media_proxy_unavailable",Yn=new WeakSet,_c=new WeakSet;function wi(e){return e.currentSrc||e.src}function xa(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:fe(e)&&!!At(e)}function ya(e){let t=wi(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function pg(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function hg(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function Sa(e,t){return t[e]??pg(e,t)??hg(e,t)}function gg(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(fg,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var bg={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function Bt(e,t,n){if(_c.has(e))return;_c.add(e);let r=bg[t];xe({source:"hf-preview",type:"diagnostic",code:Ec,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Ec}: "${n}" (${t}): ${r}`)}function va(e,t=null,n="reactive"){if(Yn.has(e))return;let r=wi(e),i;try{i=gg(r,t)}catch(l){I("runtime.mediaProxy.swap",l),Bt(e,"invalid_source_url",r);return}Yn.add(e),ba(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Ac,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Ac}: "${r}" uses a codec (${o??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function wc(e){if(xa(e)||!fe(e)||Yn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=ya(e);if(n===null)return;let r=Sa(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||va(e,r,"proactive")}function Cc(e){if(xa(e)||!fe(e)||e.videoWidth!==0)return;let t=wi(e);if(Yn.has(e)){Bt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ya(e);if(r===null){Bt(e,"cross_origin",t);return}let i=Sa(r,n);if(i&&!i.browserHostile){Bt(e,"browser_safe_codec",t);return}va(e,i,"reactive")}function Rc(e){if(xa(e)||!fe(e))return;let t=wi(e);if(Yn.has(e)){Bt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ya(e);if(r===null){Bt(e,"cross_origin",t);return}let i=Sa(r,n);if(i&&!i.browserHostile){Bt(e,"browser_safe_codec",t);return}va(e,i,"tertiary")}var Ce=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);le(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},xg=[0,0,0],yg=[1,1,1],Ci=64;function Sg(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function Ct(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Ce(`Invalid number "${e}"`,t);return n}function Tc(e,t,n){if(e.length!==3)throw new Ce(`${t} expects three numbers`,n);return[Ct(e[0],n),Ct(e[1],n),Ct(e[2],n)]}function kc(e,t,n){if(!e)throw new Ce(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Ce(`${t} must be an integer greater than 1`,n);return r}function vg(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Ce("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Ag(e){let t=/^TITLE\s+"([^"]*)"\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\s+(.+)\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function Eg(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Mc(e,t={}){let n=t.maxSize??Ci,r=null,i=xg,o=yg,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let f=0;f<u.length;f++){let m=f+1,p=Sg(u[f]??"").trim();if(!p)continue;let g=p.split(/\s+/),y=(g[0]??"").toUpperCase(),x=g.slice(1);if(y==="TITLE"){r=Ag(p);continue}if(y==="DOMAIN_MIN"){i=Tc(x,y,m);continue}if(y==="DOMAIN_MAX"){o=Tc(x,y,m);continue}if(y==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Ce(`${y} expects two numbers`,m);let w=Ct(x[0],m),k=Ct(x[1],m);if(k<=w)throw new Ce("LUT_3D_INPUT_RANGE max must exceed min",m);i=[w,w,w],o=[k,k,k];continue}if(y==="LUT_1D_SIZE"){a=kc(x[0],y,m);continue}if(y==="LUT_3D_SIZE"){if(l=kc(x[0],y,m),l>n)throw new Ce(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!Eg(y)){if(y.startsWith("LUT_"))throw new Ce(`Unsupported cube keyword ${y}`,m);continue}if(!l)throw a?new Ce("1D cube LUTs are not supported yet",m):new Ce("LUT data appears before LUT_3D_SIZE",m);if(g.length!==3)throw new Ce("LUT data rows must contain three numbers",m);s.push(Ct(g[0],m),Ct(g[1],m),Ct(g[2],m))}if(a&&l)throw new Ce("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Ce("1D cube LUTs are not supported yet"):new Ce("Missing LUT_3D_SIZE");vg(i,o);let d=l*l*l;if(s.length!==d*3)throw new Ce(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function _g(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Xn(e){return Math.round(_g(e)*255)}function Aa(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=Xn(e.data[s]??0),i[u+1]=Xn(e.data[s+1]??0),i[u+2]=Xn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var Fc="rec709";var ge={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var Nc=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Lc=["shadows","midtones","highlights"],Dc=["master","red","green","blue"],Ic=["hueVsHue","hueVsSaturation","hueVsLuma"];var Pc=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Oc=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var z_=ge.unit,q_=ge.signedUnit,$_=ge.effects;var nt=1024,Jn=16;function Gc(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Re(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function wg(e){let t=[],n=[],r=Re(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=Re(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Gc(Re(t,0),Re(t,1),i,Re(n,1)),o[o.length-1]=Gc(Re(t,t.length-1),Re(t,t.length-2),Re(n,n.length-1),Re(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Re(n,a-1),s=Re(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Re(t,a-1),d=Re(t,a),f=2*d+u,m=d+2*u;o[a]=(f+m)/(f/l+m/s)}return o}function Hc(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function Cg(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function Rg(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function Bc(e,t,n,r,i){Cg(e,r,i);let o=wg(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Re(e,l+1)[0];)l+=1;let d=Re(e,l),f=Re(e,l+1),m=Rg(u,d,f,Re(o,l),Re(o,l+1));a[s]=Math.min(i,Math.max(r,m))}return a}function cn(e,t=nt){if(Hc(e,t),e.length>Jn)throw new RangeError(`A color curve supports at most ${Jn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return Bc(e,t,n=>n/(t-1),0,1)}function _a(e,t,n,r=nt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Jn)throw new RangeError(`A hue curve supports at most ${Jn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return Hc(l,r),Bc(l,r,s=>s/r*360,t,n)}var Qn="data-color-grading",Zn="data-hf-color-grading-source-hidden",ki="data-hf-authored-opacity",qc="__hf_color_grading_",kg=Fc,Ra={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Ta={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},ka={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var Mi=Nc,$c=Lc,jc=Dc,Kc=Ic,Fa=Pc,Na=Oc,Uc={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Wc={vignette:.18};function Te(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ra,...n},details:{...Ta,...r},effects:{...ka,...i}}}var La=[Te("neutral","Neutral"),Te("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Te("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Te("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Te("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Te("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Te("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Te("vintage-wash","Vintage Wash",Uc,Wc),Te("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Te("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Te("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Te("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Te("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Te("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Te("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Te("home-movie-8mm","8mm Home Movie",Uc,{...Wc,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Te("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Te("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],Mg=new Map(La.map(e=>[e.id,e])),Fg=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,Ng={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},dn={hue:0,amount:0,level:0},Vc={amount:ge.unit,level:ge.signedUnit},Rt=[[0,0],[1,1]],mn=[],Lg={hueVsHue:ge.secondaryHueShift,hueVsSaturation:ge.signedUnit,hueVsLuma:ge.signedUnit},wa={center:0,range:180,softness:0},Ca={min:0,max:1,softness:.05},Dg={vignette:ge.unit,vignetteMidpoint:ge.unit,vignetteRoundness:ge.signedUnit,vignetteFeather:ge.unit,grain:ge.unit,grainSize:ge.unit,grainRoughness:ge.unit},Ma=ge.unit,Ig=ge.effects,Yc=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var Pg=La.filter(e=>Yc.some(t=>e.effects[t]>1e-4)),ew=La.filter(e=>!Pg.includes(e)),tw={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},Xc=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var Og=/^#[0-9a-f]{6}$/i;function Gg(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&Og.test(t))?null:e.map(t=>t.toLowerCase())}function Ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ti(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function Jc(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function De(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Ti(n,t.min,t.max):0}function Da(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function Hg(e){let t=Ne(e)?e:{};return $c.reduce((n,r)=>{let i=Ne(t[r])?t[r]:{};return n[r]={hue:Da(i.hue,dn.hue),amount:De(i.amount??dn.amount,Vc.amount),level:De(i.level??dn.level,Vc.level)},n},{shadows:{...dn},midtones:{...dn},highlights:{...dn}})}function Bg(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[Ti(t,0,1),Ti(n,0,1)]:null}function Qc(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function Ug(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function Wg(e){if(!Array.isArray(e)||e.length<2)return Rt;let t=[];for(let n of e){let r=Bg(n);if(!r)return Rt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),Qc(t)||(Ug(t),t.length>16)?Rt:t}function Vg(e){let t=Ne(e)?e:{};return jc.reduce((n,r)=>(n[r]=Wg(t[r]),n),{master:Rt,red:Rt,green:Rt,blue:Rt})}function zg(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[Da(n),Ti(r,t.min,t.max)]:null}function qg(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return mn;let n=[];for(let r of e){let i=zg(r,t);if(!i)return mn;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),Qc(n)?mn:n}function $g(e){let t=Ne(e)?e:{};return Kc.reduce((n,r)=>(n[r]=qg(t[r],Lg[r]),n),{hueVsHue:mn,hueVsSaturation:mn,hueVsLuma:mn})}function zc(e){let t=Ne(e)?e:{},n=De(t.min??Ca.min,Ma),r=De(t.max??Ca.max,Ma);return{min:Math.min(n,r),max:Math.max(n,r),softness:De(t.softness??Ca.softness,ge.secondarySoftRangeSoftness)}}function jg(e){let t=Ne(e)?e:{},n=De(t.range??wa.range,ge.secondaryHueRange);return{center:Da(t.center,wa.center),range:n,softness:De(t.softness??wa.softness,{min:ge.secondaryHueSoftness.min,max:ge.secondaryHueCombinedMax-n})}}function Kg(e){return{hueShift:De(e.hueShift??0,ge.secondaryHueShift),saturation:De(e.saturation??0,ge.signedUnit),luma:De(e.luma??0,ge.signedUnit),temperature:De(e.temperature??0,ge.signedUnit),tint:De(e.tint??0,ge.signedUnit)}}function Yg(e){return!Ne(e)||!Ne(e.key)||!Ne(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:jg(e.key.hue),saturation:zc(e.key.saturation),luma:zc(e.key.luma)},correction:Kg(e.correction)}}function Xg(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=Yg(n);r&&t.push(r)}return t}function Jg(e){if(e==null)return null;let t=String(e).trim();return t||null}function Qg(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ne(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:Jc(e.intensity,1)}}function Zg(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ne(n)?n:null}catch{return null}return{preset:t}}return Ne(e)?e:null}function eb(e,t){let n=e.trim().match(Fg);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Ri(e,t){if(typeof e=="string"){let r=eb(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Ri(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Ri(r,t));if(!Ne(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Ri(i,t);return n}function tb(e){return e?Mg.get(e)??null:null}function Fi(e){let t=Zg(e);if(!t||t.enabled===!1)return null;let n=Jg(t.preset),r=tb(n),i=r?.adjust??Ra,o=r?.details??Ta,a=r?.effects??ka,l=Ne(t.adjust)?t.adjust:{},s=Ne(t.details)?t.details:{},u=Ne(t.effects)?t.effects:{},d=Mi.reduce((p,g)=>(p[g]=De(l[g]??i[g],Ng[g]),p),{...Ra}),f=Fa.reduce((p,g)=>(p[g]=De(s[g]??o[g],Dg[g]),p),{...Ta}),m=Na.reduce((p,g)=>(p[g]=De(u[g]??a[g],Ig[g]??Ma),p),{...ka});return{enabled:!0,preset:n,intensity:Jc(t.intensity,r?.intensity??1),adjust:d,wheels:Hg(t.wheels),curves:Vg(t.curves),hueCurves:$g(t.hueCurves),secondaries:Xg(t.secondaries),details:f,effects:m,palette:Gg(t.palette),lut:Qg(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():kg}}function Zc(e,t){return Fi(Ri(e,t))}function nb(e){return $c.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Ia(e){return jc.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Pa(e){return Kc.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Oa(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function ed(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Yc.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Mi.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?nb(e.wheels):!1)||(e.curves?Ia(e.curves):!1)||(e.hueCurves?Pa(e.hueCurves):!1)||(e.secondaries?Oa(e.secondaries):!1):!1}var rb=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ib=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function td(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,v){try{window.dispatchEvent(new CustomEvent(S,{detail:v}))}catch(E){I("runtime.picker.site1",E)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let v=S.ownerDocument.defaultView;if(!v)return!1;let E=S;for(;E&&E!==document.body&&E!==document.documentElement;){let T=v.getComputedStyle(E);if(T.display==="none"||T.visibility==="hidden"||T.pointerEvents==="none")return!0;let L=Number.parseFloat(T.opacity);if(Number.isFinite(L)&&L<=.01&&!E.hasAttribute(Zn))return!0;E=E.parentElement}return!1}function d(S){if(!S||S===document.body||S===document.documentElement)return!1;let v=S.tagName.toLowerCase();return!(v==="script"||v==="style"||v==="link"||v==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(rb)||u(S))}function f(S){return!!S?.closest(ib)}function m(S){let v=S;if(v.id)return`#${CSS.escape(v.id)}`;let E=S.getAttribute("data-composition-id");if(E)return`[data-composition-id="${CSS.escape(E)}"]`;let T=S.getAttribute("data-composition-src");if(T)return`[data-composition-src="${CSS.escape(T)}"]`;let L=S.getAttribute("data-track-index");if(L)return`[data-track-index="${CSS.escape(L)}"]`;let G=S.tagName.toLowerCase(),z=S.parentElement;if(!z)return G;let X=z.querySelectorAll(`:scope > ${G}`);if(X.length===1)return G;for(let M=0;M<X.length;M+=1)if(X[M]===S)return`${G}:nth-of-type(${M+1})`;return G}function p(S){let v=S.tagName.toLowerCase(),E=(S.textContent??"").trim().replace(/\s+/g," "),T=(L,G)=>L.length>G?`${L.slice(0,G-1)}\u2026`:L;return v==="h1"||v==="h2"||v==="h3"?"Heading":v==="p"||v==="span"||v==="div"?E.length>0?T(E,56):"Text":v==="img"?"Image":v==="video"?"Video":v==="audio"?"Audio":v==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":v==="section"?"Section":`${v.charAt(0).toUpperCase()}${v.slice(1)}`}function g(S,v,E){let T=typeof E=="number"&&E>0?E:8,L=[];if(document.elementsFromPoint)L=document.elementsFromPoint(S,v);else if(document.elementFromPoint){let X=document.elementFromPoint(S,v);L=X?[X]:[]}if(f(L[0]??null))return[];let G={},z=[];for(let[X,M]of L.entries()){if(!d(M))continue;let V=`${M.tagName}::${M.id||""}::${X}`;if(!G[V]&&(G[V]=!0,z.push(M),z.length>=T))break}return z}function y(S){let v=S.getBoundingClientRect(),E={};for(let L of Array.from(S.attributes))L.name.startsWith("data-")&&(E[L.name]=L.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:m(S),label:p(S),boundingBox:{x:v.left,y:v.top,width:v.width,height:v.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:E}}function x(S,v,E){return g(S,v,E).map(y)}function w(S){if(!t)return;let E=g(S.clientX,S.clientY,1)[0]??(ke(S.target)?S.target:null);if(!d(E)||n===E)return;n&&n.classList.remove("__hf-pick-highlight"),n=E,E.classList.add("__hf-pick-highlight");let T=y(E);l(T),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:T})}function k(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let v=x(S.clientX,S.clientY,8);v.length!==0&&(l(v[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:v,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function C(S){S.key==="Escape"&&(O(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function N(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
40
+ `),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",w,!0),document.addEventListener("click",k,!0),document.addEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function O(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",w,!0),document.removeEventListener("click",k,!0),document.removeEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function F(){window.__HF_PICKER_API={enable:N,disable:O,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,v,E)=>Number.isFinite(S)&&Number.isFinite(v)?x(S,v,E):[],pickAtPoint:(S,v,E)=>{if(!Number.isFinite(S)||!Number.isFinite(v))return null;let T=x(S,v,8);if(!T.length)return null;let L=Math.max(0,Math.min(T.length-1,Number(E??0))),G=T[L]??null;return G?(s(G),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),O(),G):null},pickManyAtPoint:(S,v,E)=>{if(!Number.isFinite(S)||!Number.isFinite(v))return[];let T=x(S,v,8);if(!T.length)return[];let L=[],G=Array.isArray(E)?E:[0];for(let z of G){let X=Math.max(0,Math.min(T.length-1,Math.floor(Number(z)))),M=T[X];if(!M)continue;L.some(te=>te.selector===M.selector&&te.tagName===M.tagName)||L.push(M)}return L.length?(s(L[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:L}),O(),L):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:N,disablePickMode:O,installPickerApi:F}}var ob=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Ga(e){return Number.isFinite(e)&&e>0?e:30}function Ha(e){return Number.isFinite(e)&&e>0?e:0}function Ba(e,t){let n=Ga(t);return Math.floor(Ha(e)*n+1e-9)/n}function er(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return Ba(e,t);let i=Ga(t)*r;return Math.round(Ha(e)*i)/i}function Ua(e,t){let n=Ga(t),r=Ha(e),i=r*n,o=Math.round(i);return Math.abs(i-o)<=.001?o/n:r}function nd(e,t,n=ob){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function tr(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&I("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function je(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&I("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function nr(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){I("runtime.player.site1",i)}}}function rd(e,t,n,r){let i=er(t,n,r?.subFrameDivisions),o=r?.suppressEvents===!0;return je(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function ab(e,t,n,r,i){let o=[];nr(e,t,a=>{je(a,"play"),o.push(a)});try{return rd(t,n,r,i)}finally{for(let a of o)try{je(a,"pause")}catch(l){I("runtime.player.site2",l)}}}function sb(e,t){nr(e,t,n=>{je(n,"play")})}function id(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??tr(n,"duration",0))||0);r>0&&Math.max(0,tr(n,"time",0))>=r&&(je(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),je(n,"play"),nr(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),je(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;je(n,"pause"),nr(e.getTimelineRegistry?.(),n,i=>{je(i,"pause")});let r=Math.max(0,tr(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=ab(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),je(i,"play"),nr(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),je(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(sb(e.getTimelineRegistry?.(),i),rd(i,n,o,r)):er(Math.max(0,Number(n)||0),o,r?.subFrameDivisions);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>tr(e.getTimeline(),"time",0),getDuration:()=>tr(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function od(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var lb=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Wa(e){return e.id||e.getAttribute("data-hf-id")||null}function ub(e){return Me(e)}function cb(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function db(e){return he(e)?Number.isFinite(e.duration)?et(e,e.duration):null:rn(e)}function mb(e,t,n,r){let i=ub(e.getAttribute("data-duration"));return i!=null&&i>0?i:cb(e,t)??db(e)??Math.max(0,n-r)}function fb(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function ad(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||lb.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(mb(l,n,r,s)<=0)continue;let u={id:Wa(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return fb(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Va="css:root",sd=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],pb=new Set([...sd,"contain","isolation","mask-border","mix-blend-mode","opacity"]),hb=new Set(["absolute","relative"]),gb=new Set(["flex","inline-flex","grid","inline-grid"]),bb=new Set(["layout","paint","strict","content"]),xb=new Set(["size","inline-size"]);function yb(e){return e.position==="fixed"||e.position==="sticky"}function Sb(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(hb.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&gb.has(n)}function vb(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:sd.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function Ab(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>bb.has(n))?!0:xb.has(e.getPropertyValue("container-type"))}function Eb(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>pb.has(t))}function _b(e,t){return yb(t)||Sb(e,t)||vb(t)||Ab(t)?!0:Eb(t)}function wb(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function Ni(e){let t=e.ownerDocument.defaultView;if(!t)return Va;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(_b(n,t.getComputedStyle(n)))return wb(n)}catch{return Va}n=n.parentElement}return Va}function za(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function or(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return!1;let i=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),o=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let d=t.timelineRegistry[a],f=d&&typeof d.duration=="function"?Number(d.duration()):null;!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(on)||e.hasAttribute(an))&&(o==null||o<=0)&&f!=null&&Number.isFinite(f)&&f>0&&(o=f)}let l=o!=null&&o>0?i+o:Number.POSITIVE_INFINITY,s=t.exportRenderSeek?Ua(i,t.canonicalFps):i,u=t.exportRenderSeek&&Number.isFinite(l)?Ua(l,t.canonicalFps):l;return ii(t.currentTime,s,u,t.compositionDuration)}function Ut(e){return Me(e)}function qa(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(on),r=sn({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(Ut).some(o=>o!=null&&o<=0)?0:null)}function ld(e){return sn({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(an)})?.end??null}function $a(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function ja(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Ka(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function ir(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function ud(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return ir(t);let n=e.getAttribute("data-composition-src");if(n)return ir(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?ir(r.getAttribute("src")):null}function Rb(e){let t=e.className;return typeof t!="string"?null:t.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Tb(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function kb(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function rr(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Mb(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return rr(i);let o=e.id;if(o)return rr(o);let a=Rb(e);if(a)return rr(a);let l=Tb(ud(e));if(l)return rr(l);let s=kb(e);return s||`${rr(t)} ${n+1}`}function cd(e){let n=window.__timelines??{},r=Ue({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=j=>{if(!j)return null;let P=n[j]??null;if(!P||typeof P.duration!="function")return null;try{let U=Number(P.duration());return Number.isFinite(U)&&U>0?U:null}catch{return null}},o=()=>{let j=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(j.length===0)return null;let P=0;for(let U of j){let ee=r.resolveMediaStartForElement(U);if(!Number.isFinite(ee))continue;let pe=Si(U);pe==null||pe<=0||(P=Math.max(P,Math.max(0,ee)+pe))}return P>0?P:null},a=(j,P)=>{let U=[],ee=null,pe=null,ne=null,W=j.parentElement;for(;W;){let K=W.getAttribute("data-composition-id");K&&(U.push(K),!ne&&W!==P&&(ne=K),ee==null&&(ee=r.resolveStartForElement(W,0)),pe==null&&(pe=Ut(W.getAttribute("data-duration"))??i(K)??null)),W=W.parentElement}return{parentCompositionId:ne,compositionAncestors:U.reverse(),inheritedStart:ee,inheritedDuration:pe}},l=document.querySelector("[data-composition-id]"),s=Array.from(document.querySelectorAll("[data-composition-id]")),u=l?.getAttribute("data-composition-id")??null,d=l?r.resolveStartForElement(l,0):0,f=o(),m=f!=null?Math.max(0,f-Math.max(0,d)):null,p=i(u),g=qa(l??document.body),y=ja(...s.filter(j=>j!==l).map(j=>{let P=r.resolveStartForElement(j,0),U=r.resolveDurationForElement(j)??i(j.getAttribute("data-composition-id"))??null;return!Number.isFinite(P)||U==null||U<=0?null:Math.max(0,P)+U})),x=y!=null?Math.max(0,y-Math.max(0,d)):null,w=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,k=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,C=typeof m=="number"&&Number.isFinite(m)&&m>0?m:null,N=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,O=ja(C,N),F=w!=null&&O!=null&&w>O+1,v=k??(F?O:ja(w,C,N))??null,T=(v!=null?d+v:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),L=(j,P)=>!Number.isFinite(P)||P<=0?0:T==null||!Number.isFinite(T)?P:!Number.isFinite(j)||j>=T?0:Math.max(0,Math.min(P,T-j)),G=[],z=[],X=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),M=0;for(let[j,P]of X.entries()){if(P===l||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(P.tagName))continue;let U=a(P,l),ee=P.tagName.toLowerCase(),pe=ee==="video"||ee==="audio"?r.resolveMediaStartForElement(P):r.resolveStartForElement(P,U.inheritedStart??0),ne=P.getAttribute("data-composition-id"),W=qa(P);if(W==null&&ne&&ne!==u&&(W=i(ne)),W==null&&he(P)&&Number.isFinite(P.duration)&&(W=et(P,P.duration)),W==null&&(W=rn(P,pe)),W==null){let Oe=U.inheritedDuration;if(Oe!=null&&Oe>0){let lt=(U.inheritedStart??0)+Oe;W=Math.max(0,lt-pe)}}if(W==null||W<=0||(W=L(pe,W),W<=0))continue;let K=pe+W;M=Math.max(M,K);let be=ne&&ne!==u?"composition":ee==="video"?"video":ee==="audio"?"audio":ee==="img"?"image":"element";G.push({id:Wa(P)??ne??null,label:Mb(P,be,G.length),start:pe,duration:W,track:Ka(P,j),zIndex:$a(P),stackingContextId:Ni(P),kind:be,tagName:ee,compositionId:P.getAttribute("data-composition-id"),compositionAncestors:U.compositionAncestors,parentCompositionId:U.parentCompositionId,nodePath:null,compositionSrc:ir(P.getAttribute("data-composition-src")),playbackStart:tt(P),playbackRate:Pe(P),assetUrl:ud(P),timelineRole:P.getAttribute("data-timeline-role"),timelineLabel:P.getAttribute("data-timeline-label"),timelineGroup:P.getAttribute("data-timeline-group"),timelinePriority:Ut(P.getAttribute("data-timeline-priority"))})}let V=new Set(G.map(j=>j.id)),te=l?.getAttribute("data-composition-id")??null,B=te?n[te]??null:null;if(B&&l){let j=B;if(typeof j.getChildren=="function")try{let P=j.getChildren(!0,!0,!1)??[],U=new Map;for(let ne of l.children){let W=ne;if(!W.id)continue;let K=W.tagName.toLowerCase();K==="script"||K==="style"||K==="link"||U.set(W,{id:W.id,start:1/0,end:-1/0})}let ee=ne=>{let W=ne;for(;W;){if(U.has(W))return W;if(W===l)return null;W=W.parentElement}return null};for(let ne of P){if(typeof ne.targets!="function"||typeof ne.startTime!="function"||typeof ne.duration!="function")continue;let W=ne.startTime(),K=ne.parent;for(;K&&K!==B&&typeof K.startTime=="function";)W+=K.startTime(),K=K.parent;let be=W+ne.duration();if(!(!Number.isFinite(W)||!Number.isFinite(be)))for(let Oe of ne.targets()){if(!ke(Oe))continue;let Tn=ee(Oe);if(!Tn)continue;let lt=U.get(Tn);lt&&(lt.start=Math.min(lt.start,W),lt.end=Math.max(lt.end,be))}}let pe=G.length>0?Math.max(...G.map(ne=>ne.track))+1:0;for(let[ne,W]of U){if(W.start===1/0||W.end===-1/0)continue;let K=ne;if(V.has(K.id))continue;let be=Math.max(0,W.end-W.start);if(be<=0)continue;let Oe=L(W.start,be);Oe<=0||(M=Math.max(M,W.start+Oe),G.push({id:K.id,label:K.getAttribute("data-timeline-label")??K.getAttribute("data-label")??K.getAttribute("aria-label")??K.id,start:W.start,duration:Oe,track:Ka(K,pe),zIndex:$a(K),stackingContextId:Ni(K),kind:"element",tagName:K.tagName.toLowerCase(),compositionId:K.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:tt(K),playbackRate:Pe(K),assetUrl:null,timelineRole:K.getAttribute("data-timeline-role"),timelineLabel:K.getAttribute("data-timeline-label"),timelineGroup:K.getAttribute("data-timeline-group"),timelinePriority:Ut(K.getAttribute("data-timeline-priority"))}),V.add(K.id))}}catch(P){I("runtime.timeline.site1",P)}}if(l&&v!=null&&v>0){let j=G.length>0?Math.max(...G.map(P=>P.track))+1:0;for(let P of l.children){let U=P;if(!U.id||V.has(U.id))continue;let ee=U.getAttribute("data-timeline-role");if(ee!=="overlay"&&ee!=="persistent-overlay")continue;let pe=U.tagName.toLowerCase();if(pe==="script"||pe==="style"||pe==="link"||pe==="meta"||window.getComputedStyle(U).display==="none")continue;let W=L(0,v);W<=0||(M=Math.max(M,W),G.push({id:U.id,label:U.getAttribute("data-timeline-label")??U.getAttribute("data-label")??U.getAttribute("aria-label")??U.id,start:0,duration:W,track:Ka(U,j),zIndex:$a(U),stackingContextId:Ni(U),kind:"element",tagName:pe,compositionId:U.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:tt(U),playbackRate:Pe(U),assetUrl:null,timelineRole:ee,timelineLabel:U.getAttribute("data-timeline-label"),timelineGroup:U.getAttribute("data-timeline-group"),timelinePriority:Ut(U.getAttribute("data-timeline-priority"))}),V.add(U.id))}}for(let j of s){if(j===l)continue;let P=j.getAttribute("data-composition-id");if(!P||!za(P))continue;let U=r.resolveStartForElement(j,0),ee=qa(j);if((ee==null||ee<=0)&&ld(j)!=null){let K=ld(j);ee=Math.max(0,K-U)}let pe=i(P),ne=ee&&ee>0?ee:pe;if(ne==null||ne<=0)continue;let W=L(U,ne);W<=0||z.push({id:P,label:j.getAttribute("data-label")??P,start:U,duration:W,thumbnailUrl:ir(j.getAttribute("data-thumbnail-url")),avatarName:null})}let q=Math.max(1,M||1,v??0),$=F&&k==null,J=$?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(q*Math.max(1,e.canonicalFps)));return{...ri(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:$?Number.POSITIVE_INFINITY:q,durationInFrames:J,clips:G,scenes:z,compositionWidth:Ut(l?.getAttribute("data-width"))??1920,compositionHeight:Ut(l?.getAttribute("data-height"))??1080}}var dd=e=>e!==null&&Number.isFinite(e)&&e>0;function ar(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if(dd(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter(dd);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:t}:{seconds:null,source:"unresolved",pendingClips:t,reason:t>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}var Ya="data-composition-id",Fb="data-composition-src",Nb=`[${Ya}]`,Uw=`[${Fb}]`,md="style",fd="script",Lb='link[rel="stylesheet"], link[rel="preconnect"]';function fn(e){return e?Array.from(e):[]}function pd(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=fn(t.querySelectorAll(Nb)),l=o?a.find(d=>d.getAttribute(Ya)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(Ya)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...fn(u?.querySelectorAll(md)),...fn(t.querySelectorAll(md))],scriptSources:[...fn(u?.querySelectorAll(fd)),...fn(t.querySelectorAll(fd))],linkSources:fn(n?.querySelectorAll(Lb)),variableDefaultCarriers:[r,l].filter(d=>d!=null)}}var ye=u0(Vm(),1),zm=ye.default,MC=ye.default.stringify,FC=ye.default.fromJSON,NC=ye.default.plugin,LC=ye.default.parse,DC=ye.default.list,IC=ye.default.document,PC=ye.default.comment,OC=ye.default.atRule,GC=ye.default.rule,HC=ye.default.decl,BC=ye.default.root,UC=ye.default.CssSyntaxError,WC=ye.default.Declaration,VC=ye.default.Container,zC=ye.default.Processor,qC=ye.default.Document,$C=ye.default.Comment,jC=ye.default.Warning,KC=ye.default.AtRule,YC=ye.default.Result,XC=ye.default.Input,JC=ye.default.Rule,QC=ye.default.Root,ZC=ye.default.Node;var Ss="data-hf-authored-id",qm="data-hf-inner-root";function vs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function As(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function my(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function jm(e){let t=e.trim();return t?Array.from(new Set([t,my(t)])).filter(Boolean):[]}function fy(e){return!!e&&/[\w-]/.test(e)}function py(e,t,n){let r=jm(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let d=r.find(f=>e.startsWith(f,l+1));if(d){let f=e[l+1+d.length];if(!fy(f)){i+=n,l+=d.length;continue}}}i+=s}return i}function hy(e,t){let n=t?.trim();return n?py(e,n,`[${Ss}="${As(n)}"]`):e}function $m(e){return`${e}:not(:has([${qm}])), ${e} > [${qm}]`}function gy(e,t,n,r,i,o){let a=hy(e,r),l=by(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?$m(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${vs(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?$m(t):l.replace(u,t);let d=l.match(/^\s*/)?.[0]??"",f=l.match(/\s*$/)?.[0]??"";if(i){let m=r?`[${Ss}="${As(r)}"]`:null;if(m&&s.startsWith(m)){let p=s.slice(m.length);return`${d}${t}${m}${p}${f}`}}return`${d}${t} ${s}${f}`}function by(e,t,n){let r=vs(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var xy=new Set(["keyframes","-webkit-keyframes","font-face"]);function yy(e){return e?.type==="atrule"}function Sy(e){let t=e.parent;for(;t;){if(yy(t)&&xy.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function vy(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function Km(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${As(o)}"]`,l;try{l=zm.parse(e)}catch{return""}return l.walkRules(s=>{Sy(s)||vy(s)||(s.selectors=s.selectors.map(u=>gy(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function pt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function Ym(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=pt(t),l=pt(i),s=pt(n),u=vs(t),d=pt(o?.trim()||null),f=pt(r??null),m=pt(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),p=pt(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),g=pt(jm(o?.trim()||""));return`(function(){
41
41
  var __hfCompId = ${a};
42
42
  var __hfTimelineCompId = ${l};
43
43
  var __hfErrorLabel = ${s};
44
44
  var __hfAuthoredRootId = ${d};
45
- var __hfAuthoredRootAttr = ${ht(gs)};
45
+ var __hfAuthoredRootAttr = ${pt(Ss)};
46
46
  var __hfEscapeAttr = function(value) {
47
47
  return (value + "").replace(/\\\\/g, "\\\\\\\\").replace(/"/g, "\\\\\\"");
48
48
  };
@@ -367,12 +367,12 @@ ${e.replace(/<\/(script)/gi,"<\\/$1")}
367
367
  };
368
368
  __hfFindRoot();
369
369
  __hfRun();
370
- })();`}var uy=["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 Bm(e){let t=e.getAttribute("id")?.trim();for(let n of uy)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var cy=8e3,dy=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,my=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,fy=["src","href"];function py(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function Vm(e,t){if(!t)return e;let n=e.trim();if(py(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function zm(e,t){return!t||!e?e:e.replace(my,(n,r,i)=>{let o=Vm(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function hy(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of fy){let i=n.getAttribute(r);if(i==null)continue;let o=Vm(i,t);o!==i&&n.setAttribute(r,o)}}function gy(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=zm(r,t);i!==r&&n.setAttribute("style",i)}}function by(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=zm(r,t);i!==r&&(n.textContent=i)}}function qm(e,t){if(t){hy(e,t),gy(e,t),by(e,t);for(let n of Array.from(e.querySelectorAll("template")))qm(n.content,t)}}function xy(e,t){return`${e}__hf${t}`}var yy=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),cy)});function ys(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Um(e){for(let t of Array.from(e.querySelectorAll("style, script")))t.remove()}function Sy(e){let t=document.importNode(e,!0);Bm(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function vy(e,t){let n=e.trim();if(!n)return e;try{return dy.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function Wm(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function $i(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function Ay(e){let t=new Map;for(let n of e){let r=$i(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function $m(e){let t=$i(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function Ey(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function wy(e){return e.hasAttribute("data-composition-src")?!0:$m(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:Ey(e):!1}function vs(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:$m(t))}function jm(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(vs().map(n=>$i(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Km(e,t=Ay(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=$i(i),l=wy(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let d=s?(n.get(o)||0)+1:0;s&&n.set(o,d),u=s?xy(o,d):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function Ss(e){let t=id({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=Ae(t.innerRoot)?t.innerRoot:null,r=n??e.sourceNode,i=t.authoredCompositionId,o=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let m of t.linkSources){let p=(m.getAttribute("href")||"").trim();if(!p)continue;let g=e.compositionUrl?new URL(p,e.compositionUrl).href:p;if(e.compositionUrl&&Wm(g,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(g)}"]`))continue;let y=m.cloneNode(!0);mu(y)&&(y.href=g,document.head.appendChild(y),e.injectedLinks.push(y))}(m=>{for(let p of m){let g=p.cloneNode(!0);du(g)&&(i&&(g.textContent=Gm(g.textContent||"",i,s,l,{scopeRootSelectors:!0})),document.head.appendChild(g),e.injectedStyles.push(g))}})(t.styleSources);let d=m=>{let p=m.getAttribute("type")?.trim()??"",g=m.getAttribute("src")?.trim()??"";if(g){let x=vy(g,e.compositionUrl);return e.compositionUrl&&Wm(x,e.compositionUrl)?null:{kind:"external",src:x,type:p}}let y=m.textContent?.trim()??"";return y?{kind:"inline",content:y,type:p,scopeCompositionId:o}:null},f=t.scriptSources.map(d).filter(m=>m!==null);if(n){let m=n.getAttribute("data-width"),p=n.getAttribute("data-height"),g=e.parseDimensionPx(m),y=e.parseDimensionPx(p);m&&e.host.setAttribute("data-width",m),p&&e.host.setAttribute("data-height",p),g&&Ae(e.host)&&(e.host.style.width=g),y&&Ae(e.host)&&(e.host.style.height=y),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let x=Sy(n);!e.authoredCompositionId&&i&&x.setAttribute("data-composition-id",i),Um(x),e.host.appendChild(x)}else if(e.hasTemplate){let m=document.importNode(r,!0);Um(m),e.host.appendChild(m)}else e.host.innerHTML=e.fallbackBodyInnerHtml;a&&_y(e,r,a);for(let m of f){let p=document.createElement("script");if(m.type&&(p.type=m.type),p.async=!1,m.kind==="external"?p.src=m.src:m.type.toLowerCase()==="module"?p.textContent=m.content:m.scopeCompositionId?p.textContent=Hm(m.content,m.scopeCompositionId,"[HyperFrames] composition script error:",s,a||m.scopeCompositionId,l):p.textContent=`(function(){${m.content}})();`,document.body.appendChild(p),e.injectedScripts.push(p),m.kind==="external"){let g=await yy(p);g.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:m.src,loadStatus:g.status,elapsedMs:g.elapsedMs}})}}}async function Ym(e){let t=vs();if(jm(),t.length===0)return;let n=Km(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);ys(i),await Ss({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function Xm(e){let t=vs();if(jm(),t.length===0)return;let n=Km(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}ys(i);try{let d=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(d){await Ss({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:d.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let f=await fetch(o);if(!f.ok)throw new Error(`HTTP ${f.status}`);let m=await f.text(),g=new DOMParser().parseFromString(m,"text/html");qm(g,u);let y=(l?g.querySelector(`template#${CSS.escape(l)}-template`):null)??g.querySelector("template"),x=y?y.content:g.body;await Ss({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:x,hasTemplate:!!y,fallbackBodyInnerHtml:g.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:g.head,declaredVariableDefaults:Dn(g.documentElement),variableDeclarer:g.documentElement,onDiagnostic:e.onDiagnostic})}catch(d){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:d instanceof Error?d.message:"unknown_error"}}),ys(i)}}))}function _y(e,t,n){let i={...e.declaredVariableDefaults??(Me(t)?Dn(t):{}),...uu(e.host)};Uo(e.variableDeclarer??(Me(t)?t:null),i,n),su(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,Wo(e.host,{...au(e.host,i,window),...ri()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function Cy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ry(e){if(!Array.isArray(e))throw new Error("expected a JSON array");if(!e.every(Cy))throw new Error("every array entry must be an object");return e}function As(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function Ty(e){return Ae(e)?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function ky(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!Ae(r))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function My(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}function Es(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(t===null)return;let n=Ry(t);if(n.length===0)return;let r=ky();for(let i of n){let o=null;if(i.wordId&&(o=Ty(document.getElementById(i.wordId))),!o&&i.wordIndex!==void 0&&(o=r[i.wordIndex]??null),!o)continue;let a={},l={};if(i.x!==void 0&&(a.x=i.x),i.y!==void 0&&(a.y=i.y),i.scale!==void 0&&(a.scale=i.scale),i.rotation!==void 0&&(a.rotation=i.rotation),i.opacity!==void 0&&(l.opacity=i.opacity),i.fontSize!==void 0&&(l.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(l.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(l.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let u=e.getTweensOf(o).filter(m=>m.vars.color!==void 0).sort((m,p)=>m.startTime()-p.startTime()),d=u.find(m=>As(m)==="dim")??u.find(m=>As(m)===void 0),f=d?String(d.vars.color):"";for(let m of u)(As(m)??(String(m.vars.color)===f?"dim":"active"))==="dim"?i.dimColor&&(m.vars.color=i.dimColor):i.activeColor&&(m.vars.color=i.activeColor);i.dimColor&&e.set(o,{color:i.dimColor})}if(Object.keys(l).length>0&&e.set(o,l),Object.keys(a).length>0){let s=My(o);e.set(s,a)}}}).catch(t=>{let n=t instanceof Error?t.message:String(t);console.error(`[HyperFrames] Invalid caption-overrides.json: ${n}`)})}var _s="data-hf-edit-base-x",Cs="data-hf-edit-base-y",bn="data-hf-edit-original-translate",ji=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},Fy=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},Jm=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,ws=(e,t)=>Jm.test(e)&&Jm.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,Ny=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=Fy(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${ws(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${ws(r,t)} ${ws(i,n)}${a}`},Ly=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},Dy=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},Rs=new WeakMap;function Iy(e,t){let n=Rs.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Be("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=ji(e.getAttribute("data-x"))-ji(e.getAttribute(_s)),i=ji(e.getAttribute("data-y"))-ji(e.getAttribute(Cs));e.hasAttribute(bn)||e.setAttribute(bn,Dy(e)),n===void 0&&Ly(e);let o=e.getAttribute(bn)??"",a=Ny(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),Rs.set(e,e.style.getPropertyValue("translate"))}function Ki(e,t){let n=e.querySelectorAll(`[${bn}]:not([${_s}]):not([${Cs}])`);for(let o=0;o<n.length;o++){let a=n[o];if(a===void 0||!zo(a))continue;let l=a.getAttribute(bn)??"";l===""?a.style.removeProperty("translate"):a.style.setProperty("translate",l),a.removeAttribute(bn),Rs.delete(a)}let r=e.querySelectorAll(`[${_s}], [${Cs}]`),i=0;for(let o=0;o<r.length;o++){let a=r[o];a===void 0||!zo(a)||(Iy(a,t),i+=1)}return i}var Qm="__hfPositionEditsSeekReapplyWrapped",Zm=new WeakSet,ef=new WeakMap,tf=new WeakMap;function nf(e){let t=e,n=()=>{try{Ki(t.document)}catch{}},r=f=>typeof f=="function"&&(Zm.has(f)||!!f[Qm]),i=f=>{Zm.add(f);try{Object.defineProperty(f,Qm,{value:!0})}catch{}},o=f=>{if(typeof f!="function"||r(f))return f;let m=function(...p){let g=f.apply(this,p);return n(),g};return i(m),m},a=(f,m)=>{let p=ef.get(f);if(p?.has(m))return!0;let g=Object.getOwnPropertyDescriptor(f,m);if(g?.configurable===!1){let _=f[m];return typeof _=="function"&&(f[m]=o(_),n()),!1}let y=f[m],x=g?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:g?.enumerable??!0,get:()=>y,set:_=>{y=o(_),x?.call(f,_)}}),y=o(y),p??(p=new Set),p.add(m),ef.set(f,p),n(),!0},l=(f,m)=>{let p=tf.get(t),g=Object.getOwnPropertyDescriptor(t,f);if(!p?.has(f)){if(g?.configurable===!1){let _=t[f];return _?a(_,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:g?.enumerable??!0,get:()=>x,set:_=>{x=_,x&&a(x,m)}}),p??(p=new Set),p.add(f),tf.set(t,p)}let y=t[f];return y?a(y,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let u=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}u-=1,u<=0&&t.clearInterval(d)},50)}function Yi(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function Xi(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ts(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\//i.test(t):!1:!1}var rf=new Set(["img","video","audio","source"]);function Py(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function Oy(e){return e.replace(/[;{}<>\r\n]/g,"")}function Gy(e){if(Xi(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function ks(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=Yi(e);return t.set(n,i),i}function Hy(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function By(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function Uy(e,t){let n=new Set,r=By(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=ks(i,t);for(let[a,l]of Object.entries(o)){let s=Gy(l);s!==null&&Ae(i)&&i.style.setProperty(`--${a}`,Oy(s))}}}function Ms(e){let t=new Map;Uy(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!rf.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(rf).join("/")}.`);continue}let i=Py(ks(n,t)[r]);if(i!==null){if(!Ts(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=ks(n,t)[r];Xi(i)&&Hy(n,String(i))}}var gt=new Map,Wy="data-hf-color-grading-canvas",Vy="__hf_color_grading_canvas__";function hf(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{Ae(r)&&(r.hasAttribute(Ci)||r.setAttribute(Ci,r.style.opacity))},n=r=>{if(Me(r)){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var zy=16,qy=4,yn={enabled:!1,position:.5,softness:0,lineWidth:2},Fs=["#000000","#ffffff"],$y=["#1a1a1a","#f5f5dc"],Rr=3,jy=Rr-1,Ky=5,Ns=`${rt}.0`,of=`${rt-1}.0`,Yy=`${Rr}.0`,Xy=`${(jy+.5)/Rr}`;function Ji(e){let t=e.getAttribute(Xn);return t==null?null:Vc(t,Yi(e))}var Jy=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`
371
- `),Qy=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }"," return base;","}","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${of};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${of});`,` float y = (row + 0.5) / ${Yy};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Ns}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Ns}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Ns}, ${Xy}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`
372
- `),Zy=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`
373
- `),eS=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`
374
- `),tS=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`
375
- `);function qt(e){return pe(e)||De(e)}function af(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function sf(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(D("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function no(e,t=Qy){let n=sf(e,Jy,e.VERTEX_SHADER),r=sf(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(D("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function Qi(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function nS(e,t){let n=no(e,Zy);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function rS(e,t){let n=no(e,eS);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function iS(e,t){let n=no(e,tS);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function wr(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Qi(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function eo(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Ls(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function lf(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Os(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=no(t),r=Qi(t),i=Qi(t,t.NEAREST),o=Qi(t,t.NEAREST);if(!n||!r||!i||!o)return lf(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Ls(t,n,Ri),detailUniforms:Ls(t,n,Ra),effectUniforms:Ls(t,n,Ta),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(lf(t,n,[r,i,o]),null)}function oS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function aS(e){if(!oS(e))return{...yn};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,yn.position,0,1),softness:t(e.softness,yn.softness,0,.25),lineWidth:t(e.lineWidth,yn.lineWidth,0,12)}}function gf(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function ro(e){return e instanceof Error?e.message:"LUT failed to load"}function sS(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function bf(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return sS(t)}function Gs(e){let t=gf(e);if("error"in t)return{state:"error",message:t.error};let n=gt.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Sc(o,{maxSize:Ei})),i={state:"pending",promise:r};for(;gt.size>=zy;){let o=gt.keys().next().value;if(!o)break;gt.delete(o)}return gt.set(t.href,i),r.then(o=>{gt.get(t.href)===i&&gt.set(t.href,{state:"ready",lut:o})},o=>{gt.get(t.href)===i&&gt.set(t.href,{state:"error",message:ro(o)})}),i}function uf(e,t,n){if(e.lut?.src===t)return e.lut;let r=xa(n),{gl:i,program:o}=e;try{return xf(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=ro(a),e.lutLoadingSrc=null,D("runtime.colorGrading.uploadLut",a),null}}async function lS(e){let t=Gs(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function xf(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function uS(e,t,n){let r=xa(n),{gl:i,program:o}=e;return xf(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function st(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Hs(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),st(e.gl,t.scratch),st(e.gl,t.blur),t.bloom&&st(e.gl,t.bloom),e.effectTargets=null)}function Bs(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),st(e.gl,t.moments),st(e.gl,t.output),e.kuwaharaTargets=null)}function Zi(e,t=!1){Hs(e),Bs(e),cS(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function cS(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function dS(e){let t=Os(e.canvas);return t?(Zi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ps(e){if(!e.sourceHidden)return;e.element.removeAttribute(Jn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function mS(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=nS(t,e.program.quad),r=wr(t),i=wr(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&st(t,r),i&&st(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function fS(e,t){return t.bloom||(t.bloom=wr(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function cf(e){let t=e.effectTargets;t?.bloom&&(st(e.gl,t.bloom),t.bloom=null)}function pS(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=rS(t,e.program.quad),o=iS(t,e.program.quad),a=wr(t,n.HALF_FLOAT_OES,t.NEAREST),l=wr(t);return!i||!o||!a||!l?(hS(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function hS(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&st(e,r),i&&st(e,i)}function yf(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return eo(e,t,o,a),eo(e,n,o,a),{width:o,height:a}}function to(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),_r(e,t)}function gS(e,t,n,r,i,o,a){let l=yf(e,t.scratch,r,i/2,o/2),s=a/2;to(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),to(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function bS(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)to(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),to(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function _r(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function xS(e,t,n,r,i,o,a,l){eo(e,t.moments,i.width,i.height),eo(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),_r(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),_r(e,u)}function yS(e,t,n,r){if(n<=0)return!1;let i=yf(e.gl,t.scratch,t.blur,r.width,r.height);return bS(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function SS(e,t,n,r,i,o){if(n<=0)return cf(e),null;o||cf(e);let a=o?fS(e,t):t.blur;return a?(gS(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function vS(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Hs(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=mS(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=yS(e,l,o,n),u=SS(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function AS(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Bs(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=pS(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(xS(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Sf(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=vS(e,t,n,o),l=AS(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function ES(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=gf(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Gs(t);return i.state==="ready"?uf(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(uf(e,r.href,o),We(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=ro(o),e.lutLoadingSrc=null,We(e))})),null)}function Ar(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&qt(n))return n;try{let r=document.querySelector(t);return r&&qt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&qt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&qt(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&qt(r)?r:null}catch{return null}}function vf(e){return pe(e)?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:De(e)&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Af(e){return pe(e)?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:De(e)?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Ef(e){let t=At(e);return t&&Af(t)?t:null}function df(e){if(!pe(e))return!1;let t=Ef(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function wS(e){return De(e)&&e.classList.contains("__render_frame__")}function _S(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function wf(e){if(pe(e)){let t=Ef(e);if(t)return t}return Af(e)?e:null}function mf(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function CS(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=mf(o,"x"),l=mf(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function _f(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*m,s=r*m,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=CS(o||"center"),d=(e-l)*u.x/e,f=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:d,offsetY:f}}function RS(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function ff(e,t){return Math.max(0,Math.round(e>0?e:t))}function TS(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&RS(e,i);let o=window.getComputedStyle(t);$c(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=ff(n.offsetWidth,a.width),s=ff(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),d=Math.round(l*u),f=Math.round(s*u);return r.width!==d&&(r.width=d),r.height!==f&&(r.height=f),{width:d,height:f}}function xn(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function $t(e,t,n,r){e.set(r,(t*rt+n)*4)}function Mt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Ds(e,t,n){return e.length>=3?Sa(e,t,n):new Float32Array(rt)}function zt(e,t){return e[t]??0}function kS(e,t,n){let r=ln(t.red),i=ln(t.green),o=ln(t.blue),a=ln(t.master),l=Ds(n.hueVsHue,-180,180),s=Ds(n.hueVsSaturation,-1,1),u=Ds(n.hueVsLuma,-1,1);for(let d=0;d<rt;d+=1)$t(e,0,d,[zt(r,d),zt(i,d),zt(o,d),zt(a,d)]),$t(e,1,d,[Mt(zt(l,d),180),Mt(zt(s,d),1),Mt(zt(u,d),1),1])}function MS(e,t,n){let r=n*Ky;$t(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),$t(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),$t(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),$t(e,2,r+3,[Mt(t.correction.hueShift,180),Mt(t.correction.saturation,1),Mt(t.correction.luma,1),Mt(t.correction.temperature,1)]),$t(e,2,r+4,[Mt(t.correction.tint,1),.5,.5,1])}function FS(e,t,n){let r=new Float32Array(rt*Rr*4);kS(r,e,t);let i=0;for(let o of n)o.enabled&&(MS(r,o,i),i+=1);return r}var pf=new WeakMap;function NS(e,t,n){let r=pf.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return pf.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function LS(e,t,n,r){let{curves:i,hueCurves:o}=n,a=NS(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(FS(i,o,r),Kn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,rt,Rr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Is(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Cf(e,t,n,r,i,o,a,l,s,u,d,f){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:m,hueCurves:p,secondaries:g}=n,y=Fa(m),x=Na(p),_=La(g)?g.reduce((L,P)=>L+Number(P.enabled),0):0;(y||x||_>0)&&LS(e,t,n,g),Is(e,t.shadowWheel,n.wheels.shadows),Is(e,t.midtoneWheel,n.wheels.midtones),Is(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,y?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,_);for(let[L,P]of t.adjustUniforms)e.uniform1f(P,n.adjust[L]);for(let[L,P]of t.detailUniforms)e.uniform1f(P,n.details[L]);e.uniform1f(t.grainSeed,d),e.uniform1f(t.effectTime,f);for(let[L,P]of t.effectUniforms)e.uniform1f(P,n.effects[L]);let k=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?$y:Fs),C=k[k.length-1]??Fs[1];e.uniform1f(t.paletteSize,k.length),xn(e,t.palette0,k[0]??Fs[0]),xn(e,t.palette1,k[1]??C),xn(e,t.palette2,k[2]??C),xn(e,t.palette3,k[3]??C),xn(e,t.palette4,k[4]??C),xn(e,t.palette5,k[5]??C),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function DS(e){if(!e.sourceHidden){let t=e.element.getAttribute(Ci);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Jn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function bt(e){let t=Bc.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Rf=bt("intensity"),Tf=bt("lut.intensity"),kf=bt("adjust.exposure"),Mf=bt("effects.kuwahara"),Ff=[["blur",bt("effects.blur")],["bloom",bt("effects.bloom")],["kuwahara",Mf],["pixelate",bt("effects.pixelate")],["ascii",bt("effects.ascii")],["dither",bt("effects.dither")]],Nf=[Rf,Tf,kf,...Ff.map(([,e])=>e)];function jt(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Er(e,t){return t!==null&&(zc(t)||Nf.some(n=>jt(e,n)!==null))}function IS(e,t){let n=null;for(let[r,i]of Ff){let o=jt(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function PS(e){let{element:t,grading:n}=e,r=jt(t,Rf),i=jt(t,Tf),o=jt(t,kf),a=IS(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function Lf(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Df(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function We(e){if(e.destroyed||e.contextLost)return!1;let t=wf(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=vf(t);if(!n)return!1;let r=Ae(t)?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=wS(t);s&&_S(e,t),a&&!s&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!s&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let d=TS(e,r);if(!d)return!1;let f=window.getComputedStyle(r),m=_f(d.width,d.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:p,program:g}=e;try{let y=PS(e),x=ES(e);Lf(p,g.texture,t);let _=jt(e.element,Mf)!==null,k=Sf(e,y,d,m,{preserveKuwahara:_});p.bindFramebuffer(p.FRAMEBUFFER,null),p.viewport(0,0,d.width,d.height),p.useProgram(g.program),Df(p,g,k);let C=window.__player?.getTime?.(),L=typeof C=="number"&&Number.isFinite(C)?Math.max(0,C):pe(e.element)?Math.max(0,e.element.currentTime):0,P=e.grainSeed+Math.floor(L*60);return Cf(p,g,y,x,k.blurReady,k.bloomReady,k.kuwaharaReady,e.compare,d,m,P,L),_r(p,g),DS(e),e.hasDrawn=!0,e.drawError=null,!0}catch(y){return e.drawError=y instanceof Error?y.message:"Shader draw failed",D("runtime.colorGrading.drawEntry",y),!1}}function OS(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function GS(){let e=document.createElement("canvas"),t=Os(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function HS(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):pe(e)?Math.max(0,e.currentTime):0}function BS(e,t,n,r){let i=wf(t);if(!i)return null;let o=vf(i);if(!o)return null;let a=OS(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=Ae(i)?i:t,s=window.getComputedStyle(l),u=_f(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Lf(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:HS(t,r),grainSeed:bf(t)+(pe(t)?Math.floor(t.currentTime*60):0)}}async function US(e,t,n,r,i=!1){let o=BS(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,d=[];for(let f of n.slice(0,32)){let m=Ti(f.grading);if(!m){d.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let p=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=uS(e,m.lut.src,await lS(m.lut.src))),p=e.lut),d.push({id:f.id,dataUrl:WS(e,m,p,a,l,s,u)})}catch(g){d.push({id:f.id,dataUrl:null,error:ro(g)})}}return{...a,images:d}}function WS(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,d=Sf(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Df(s,u,d),n||(e.lut=null),Cf(s,u,t,n,d.blurReady,d.bloomReady,d.kuwaharaReady,yn,r,i,o,a),_r(s,u),l.toDataURL("image/png")}function at(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function VS(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&pe(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Cr(e){if(e.destroyed||!pe(e.element)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,We(e),!e.destroyed&&!t.paused&&!t.ended&&Cr(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,We(e),!e.destroyed&&!t.paused&&!t.ended&&Cr(e)})}function zS(e){let t=()=>{We(e)};if(at(e,e.element,"load",t),at(e,e.element,"loadedmetadata",t),at(e,e.element,"loadeddata",t),at(e,e.element,"seeked",t),at(e,e.element,"timeupdate",t),at(e,window,"resize",t),pe(e.element)&&(at(e,e.element,"play",()=>Cr(e)),at(e,e.element,"pause",t)),at(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ps(e)}),at(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!dS(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ps(e);return}e.drawError=null,We(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),We(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function qS(e){if(e.destroyed)return null;e.destroyed=!0,VS(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Hs(e),Bs(e),Ps(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function If(e,t){return e.removeAttribute("style"),t.id?e.id=`${Ic}${t.id}`:e.removeAttribute("id"),e.className=Vy,e.setAttribute(Wy,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function $S(e){return If(document.createElement("canvas"),e)}function Pf(e){let t=new WeakMap,n=new Set,r=[],i=null,o=null,a=Promise.resolve(),l=!1,s=(S,A,E)=>{let T=t.get(S);if(T)return T.grading=A,T.source=E,We(T),pe(S)&&!S.paused&&Cr(T),!0;let I=r.pop();if(I)If(I.canvas,S);else{let j=$S(S),Y=Os(j);if(!Y)return j.remove(),!1;I={canvas:j,gl:Y.gl,program:Y.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let H={element:S,...I,grading:A,compare:{...yn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:E,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(S).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(S).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:bf(S),destroyed:!1};return t.set(S,H),n.add(S),zS(H),We(H),pe(S)&&!S.paused&&Cr(H),!0},u=(S,A)=>{if(l)return!1;let E=Ar(S);if(!E)return!1;let T=t.get(E);if(!T){let I=Ji(E);if(!Er(E,I)||!s(E,I,"attribute"))return!1;T=t.get(E)}return T?(T.compare=aS(A),We(T),!0):!1},d=S=>{let A=t.get(S);if(!A)return;let E=qS(A);E&&(A.contextLost||r.length>=qy?Zi(E,!0):r.push(E)),t.delete(S),n.delete(S)},f=()=>{if(l)return 0;let S=new Set;document.querySelectorAll(`video[${Xn}], img[${Xn}]`).forEach(E=>{if(!qt(E))return;S.add(E);let T=Ji(E);Er(E,T)&&(af(E)||df(E))?s(E,T,"attribute"):d(E)});for(let E of n){let T=t.get(E);T&&(!E.isConnected||T.source==="attribute"&&!S.has(E))&&d(E)}return n.size},m=()=>{if(l)return 0;let S=0;for(let A of n){let E=t.get(A);E&&We(E)&&(S+=1)}return S},p=async()=>{let S=new Set;for(let A of n){let E=t.get(A)?.grading.lut;if(!E?.src.trim()||(E.intensity??1)<=0)continue;let T=Gs(E.src);T.state==="pending"&&S.add(T.promise)}return S.size>0&&await Promise.allSettled(S),m(),S.size},g=()=>{if(l)return 0;let S=0;for(let A of n){let E=t.get(A);!E||!Nf.some(I=>jt(A,I)!==null)||pe(A)&&!A.paused&&!A.ended||We(E)&&(S+=1)}return S},y=(S,A)=>{if(l)return!1;let E=Ar(S);if(!E)return!1;let T=Ti(A);return Er(E,T)?s(E,T,"live"):(d(E),!0)},x=(S,A)=>{if(!qt(S))return!1;let E=t.get(S);if(!E){if(!A)return!1;let T=Ji(S);return Er(S,T)&&s(S,T,"attribute")}return E.sourceVisibleForCanvas=A,!A&&E.source==="attribute"&&d(S),!0},_=S=>{let A=Ar(S);if(!A)return{state:"missing",message:"Media not found"};let E=t.get(A);if(E)return E.effectError?{state:"unavailable",message:E.effectError}:E.drawError?{state:"unavailable",message:E.drawError}:E.lutError?{state:"unavailable",message:`LUT error: ${E.lutError}`}:E.grading.lut&&E.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:E.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:E.lut?"Shader + LUT active":"Shader active"};let T=Ji(A);return Er(A,T)?!af(A)&&!df(A)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},k=async(S,A,E)=>{let T=async()=>{if(l||A.length===0)return null;let H=Ar(S);return!H||(o??(o=GS()),!o)?null:US(o,H,A,E?.maxDimension,E?.useMediaTime)},I=a.then(T,T);return a=I.then(()=>{},()=>{}),I},C=S=>{let A=Ar(S);if(!pe(A))return null;if(!A.paused)return()=>{};let E=A.currentTime,T=A.loop,I=A.muted;return A.loop=!0,A.muted=!0,(A.ended||Number.isFinite(A.duration)&&E>=A.duration)&&(A.currentTime=0),e?.lease(A),A.play().catch(()=>{}),()=>{e?.release(A),A.pause(),A.loop=T,A.muted=I,A.currentTime=E}},L=()=>{if(!l){l=!0,i?.disconnect(),i=null;for(let S of n)d(S);for(let S of r)Zi(S,!0);r.length=0,o&&(Zi(o,!0),o=null)}};document.body&&(i=new MutationObserver(()=>f()),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Xn]}));let P={refresh:f,redraw:m,redrawAnimated:g,waitForActiveLuts:p,setGrading:y,setCompare:u,setSourceVisibility:x,getStatus:_,renderPreviews:k,startPreviewPlayback:C,destroy:L},F=window;return F.__hf=F.__hf||{},F.__hf.colorGrading=P,f(),P}var jS=500,KS=33,io=class{constructor(t){xe(this,"_baseTime",0);xe(this,"_playStartMs",null);xe(this,"_rate",1);xe(this,"_duration",1/0);xe(this,"_nowMs");xe(this,"_audioSource",null);xe(this,"_lastReadMs",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a,rate:l}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=typeof l=="object"?nn(l,i.currentTime-a)+o:(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return this._lastReadMs=null,Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}this._applyStallCorrection();let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>jS&&(this._playStartMs+=n-KS)}this._lastReadMs=t}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),this._lastReadMs=null,!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs(),this._lastReadMs=null)}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var YS=100,XS=8,JS=4096,Us=e=>e;function QS(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function ZS(e){let t=Math.ceil(e*YS);return Math.min(JS,Math.max(XS,t))}function ev(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??Us,u=k=>o+(k-a)/l,d=e.points[t],f=e.points[t+1],m=u(f.t);if(m<=o)return null;let p=Math.max(o,u(d.t)),g=m-p;if(g<=0)return null;if(QS(d,n,i))return{kind:"ramp",time:m,value:s(f.v)};let y=ZS(g),x=Yu(e,Math.max(d.t,a),f.t,y,n),_=new Float32Array(y);for(let k=0;k<y;k+=1)_[k]=s(x[k]??0);return{kind:"curve",time:p,duration:g,values:_}}function tv(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=ev(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??Us)(ft(e,n.elapsed,t))}),i}function nv(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function Tr(e){for(let t of e)t.param.cancelScheduledValues(0)}function Sn(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function Ws(e,t,n,r){if(t.points.length!==0)for(let i of e){if(Tr([i]),Ku(t)){let o=(i.map??Us)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}nv(i.param,tv(t,n,r,i.map))}}function Of(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=zn(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let d=ia(l.target,t);d&&(Ws(u,l,d.scale,r),a.push(...u))}return a}function Gf(e){return e.lanes.find(t=>t.target===tn)??null}var rv=`
370
+ })();`}var Ay=["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 Xm(e){let t=e.getAttribute("id")?.trim();for(let n of Ay)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Ey=8e3,_y=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,wy=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,Cy=["src","href"];function Ry(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function Zm(e,t){if(!t)return e;let n=e.trim();if(Ry(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function ef(e,t){return!t||!e?e:e.replace(wy,(n,r,i)=>{let o=Zm(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function Ty(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Cy){let i=n.getAttribute(r);if(i==null)continue;let o=Zm(i,t);o!==i&&n.setAttribute(r,o)}}function ky(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=ef(r,t);i!==r&&n.setAttribute("style",i)}}function My(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=ef(r,t);i!==r&&(n.textContent=i)}}function tf(e,t){if(t){Ty(e,t),ky(e,t),My(e,t);for(let n of Array.from(e.querySelectorAll("template")))tf(n.content,t)}}function Fy(e,t){return`${e}__hf${t}`}var Ny=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),Ey)});function Es(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Jm(e){for(let t of Array.from(e.querySelectorAll("style, script")))t.remove()}function Ly(e){let t=document.importNode(e,!0);Xm(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function Dy(e,t){let n=e.trim();if(!n)return e;try{return _y.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function Qm(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function Yi(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function Iy(e){let t=new Map;for(let n of e){let r=Yi(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function nf(e){let t=Yi(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function Py(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function Oy(e){return e.hasAttribute("data-composition-src")?!0:nf(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:Py(e):!1}function ws(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:nf(t))}function rf(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(ws().map(n=>Yi(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function of(e,t=Iy(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=Yi(i),l=Oy(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let d=s?(n.get(o)||0)+1:0;s&&n.set(o,d),u=s?Fy(o,d):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function _s(e){let t=pd({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=Ae(t.innerRoot)?t.innerRoot:null,r=n??e.sourceNode,i=t.authoredCompositionId,o=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let m of t.linkSources){let p=(m.getAttribute("href")||"").trim();if(!p)continue;let g=e.compositionUrl?new URL(p,e.compositionUrl).href:p;if(e.compositionUrl&&Qm(g,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(g)}"]`))continue;let y=m.cloneNode(!0);hu(y)&&(y.href=g,document.head.appendChild(y),e.injectedLinks.push(y))}(m=>{for(let p of m){let g=p.cloneNode(!0);pu(g)&&(i&&(g.textContent=Km(g.textContent||"",i,s,l,{scopeRootSelectors:!0})),document.head.appendChild(g),e.injectedStyles.push(g))}})(t.styleSources);let d=m=>{let p=m.getAttribute("type")?.trim()??"",g=m.getAttribute("src")?.trim()??"";if(g){let x=Dy(g,e.compositionUrl);return e.compositionUrl&&Qm(x,e.compositionUrl)?null:{kind:"external",src:x,type:p}}let y=m.textContent?.trim()??"";return y?{kind:"inline",content:y,type:p,scopeCompositionId:o}:null},f=t.scriptSources.map(d).filter(m=>m!==null);if(n){let m=n.getAttribute("data-width"),p=n.getAttribute("data-height"),g=e.parseDimensionPx(m),y=e.parseDimensionPx(p);m&&e.host.setAttribute("data-width",m),p&&e.host.setAttribute("data-height",p),g&&Ae(e.host)&&(e.host.style.width=g),y&&Ae(e.host)&&(e.host.style.height=y),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let x=Ly(n);!e.authoredCompositionId&&i&&x.setAttribute("data-composition-id",i),Jm(x),e.host.appendChild(x)}else if(e.hasTemplate){let m=document.importNode(r,!0);Jm(m),e.host.appendChild(m)}else e.host.innerHTML=e.fallbackBodyInnerHtml;a&&Gy(e,r,a);for(let m of f){let p=document.createElement("script");if(m.type&&(p.type=m.type),p.async=!1,m.kind==="external"?p.src=m.src:m.type.toLowerCase()==="module"?p.textContent=m.content:m.scopeCompositionId?p.textContent=Ym(m.content,m.scopeCompositionId,"[HyperFrames] composition script error:",s,a||m.scopeCompositionId,l):p.textContent=`(function(){${m.content}})();`,document.body.appendChild(p),e.injectedScripts.push(p),m.kind==="external"){let g=await Ny(p);g.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:m.src,loadStatus:g.status,elapsedMs:g.elapsedMs}})}}}async function af(e){let t=ws();if(rf(),t.length===0)return;let n=of(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);Es(i),await _s({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function sf(e){let t=ws();if(rf(),t.length===0)return;let n=of(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}Es(i);try{let d=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(d){await _s({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:d.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let f=await fetch(o);if(!f.ok)throw new Error(`HTTP ${f.status}`);let m=await f.text(),g=new DOMParser().parseFromString(m,"text/html");tf(g,u);let y=(l?g.querySelector(`template#${CSS.escape(l)}-template`):null)??g.querySelector("template"),x=y?y.content:g.body;await _s({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:x,hasTemplate:!!y,fallbackBodyInnerHtml:g.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:g.head,declaredVariableDefaults:Pn(g.documentElement),variableDeclarer:g.documentElement,onDiagnostic:e.onDiagnostic})}catch(d){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:d instanceof Error?d.message:"unknown_error"}}),Es(i)}}))}function Gy(e,t,n){let i={...e.declaredVariableDefaults??(ke(t)?Pn(t):{}),...mu(e.host)};zo(e.variableDeclarer??(ke(t)?t:null),i,n),cu(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,qo(e.host,{...uu(e.host,i,window),...ai()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function Hy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function By(e){if(!Array.isArray(e))throw new Error("expected a JSON array");if(!e.every(Hy))throw new Error("every array entry must be an object");return e}function Cs(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function Uy(e){return Ae(e)?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function Wy(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!Ae(r))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function Vy(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}function Rs(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(t===null)return;let n=By(t);if(n.length===0)return;let r=Wy();for(let i of n){let o=null;if(i.wordId&&(o=Uy(document.getElementById(i.wordId))),!o&&i.wordIndex!==void 0&&(o=r[i.wordIndex]??null),!o)continue;let a={},l={};if(i.x!==void 0&&(a.x=i.x),i.y!==void 0&&(a.y=i.y),i.scale!==void 0&&(a.scale=i.scale),i.rotation!==void 0&&(a.rotation=i.rotation),i.opacity!==void 0&&(l.opacity=i.opacity),i.fontSize!==void 0&&(l.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(l.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(l.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let u=e.getTweensOf(o).filter(m=>m.vars.color!==void 0).sort((m,p)=>m.startTime()-p.startTime()),d=u.find(m=>Cs(m)==="dim")??u.find(m=>Cs(m)===void 0),f=d?String(d.vars.color):"";for(let m of u)(Cs(m)??(String(m.vars.color)===f?"dim":"active"))==="dim"?i.dimColor&&(m.vars.color=i.dimColor):i.activeColor&&(m.vars.color=i.activeColor);i.dimColor&&e.set(o,{color:i.dimColor})}if(Object.keys(l).length>0&&e.set(o,l),Object.keys(a).length>0){let s=Vy(o);e.set(s,a)}}}).catch(t=>{let n=t instanceof Error?t.message:String(t);console.error(`[HyperFrames] Invalid caption-overrides.json: ${n}`)})}var ks="data-hf-edit-base-x",Ms="data-hf-edit-base-y",yn="data-hf-edit-original-translate",Xi=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},zy=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},lf=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,Ts=(e,t)=>lf.test(e)&&lf.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,qy=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=zy(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${Ts(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${Ts(r,t)} ${Ts(i,n)}${a}`},$y=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},jy=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},Fs=new WeakMap;function Ky(e,t){let n=Fs.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){He("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=Xi(e.getAttribute("data-x"))-Xi(e.getAttribute(ks)),i=Xi(e.getAttribute("data-y"))-Xi(e.getAttribute(Ms));e.hasAttribute(yn)||e.setAttribute(yn,jy(e)),n===void 0&&$y(e);let o=e.getAttribute(yn)??"",a=qy(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),Fs.set(e,e.style.getPropertyValue("translate"))}function Ji(e,t){let n=e.querySelectorAll(`[${yn}]:not([${ks}]):not([${Ms}])`);for(let o=0;o<n.length;o++){let a=n[o];if(a===void 0||!jo(a))continue;let l=a.getAttribute(yn)??"";l===""?a.style.removeProperty("translate"):a.style.setProperty("translate",l),a.removeAttribute(yn),Fs.delete(a)}let r=e.querySelectorAll(`[${ks}], [${Ms}]`),i=0;for(let o=0;o<r.length;o++){let a=r[o];a===void 0||!jo(a)||(Ky(a,t),i+=1)}return i}var uf="__hfPositionEditsSeekReapplyWrapped",cf=new WeakSet,df=new WeakMap,mf=new WeakMap;function ff(e){let t=e,n=()=>{try{Ji(t.document)}catch{}},r=f=>typeof f=="function"&&(cf.has(f)||!!f[uf]),i=f=>{cf.add(f);try{Object.defineProperty(f,uf,{value:!0})}catch{}},o=f=>{if(typeof f!="function"||r(f))return f;let m=function(...p){let g=f.apply(this,p);return n(),g};return i(m),m},a=(f,m)=>{let p=df.get(f);if(p?.has(m))return!0;let g=Object.getOwnPropertyDescriptor(f,m);if(g?.configurable===!1){let w=f[m];return typeof w=="function"&&(f[m]=o(w),n()),!1}let y=f[m],x=g?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:g?.enumerable??!0,get:()=>y,set:w=>{y=o(w),x?.call(f,w)}}),y=o(y),p??(p=new Set),p.add(m),df.set(f,p),n(),!0},l=(f,m)=>{let p=mf.get(t),g=Object.getOwnPropertyDescriptor(t,f);if(!p?.has(f)){if(g?.configurable===!1){let w=t[f];return w?a(w,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:g?.enumerable??!0,get:()=>x,set:w=>{x=w,x&&a(x,m)}}),p??(p=new Set),p.add(f),mf.set(t,p)}let y=t[f];return y?a(y,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let u=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}u-=1,u<=0&&t.clearInterval(d)},50)}function Qi(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function Zi(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ns(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\//i.test(t):!1:!1}var pf=new Set(["img","video","audio","source"]);function Yy(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function Xy(e){return e.replace(/[;{}<>\r\n]/g,"")}function Jy(e){if(Zi(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function Ls(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=Qi(e);return t.set(n,i),i}function Qy(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function Zy(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function eS(e,t){let n=new Set,r=Zy(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=Ls(i,t);for(let[a,l]of Object.entries(o)){let s=Jy(l);s!==null&&Ae(i)&&i.style.setProperty(`--${a}`,Xy(s))}}}function Ds(e){let t=new Map;eS(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!pf.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(pf).join("/")}.`);continue}let i=Yy(Ls(n,t)[r]);if(i!==null){if(!Ns(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=Ls(n,t)[r];Zi(i)&&Qy(n,String(i))}}var ht=new Map,tS="data-hf-color-grading-canvas",nS="__hf_color_grading_canvas__";function wf(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{Ae(r)&&(r.hasAttribute(ki)||r.setAttribute(ki,r.style.opacity))},n=r=>{if(ke(r)){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var rS=16,iS=4,vn={enabled:!1,position:.5,softness:0,lineWidth:2},Is=["#000000","#ffffff"],oS=["#1a1a1a","#f5f5dc"],Mr=3,aS=Mr-1,sS=5,Ps=`${nt}.0`,hf=`${nt-1}.0`,lS=`${Mr}.0`,uS=`${(aS+.5)/Mr}`;function eo(e){let t=e.getAttribute(Qn);return t==null?null:Zc(t,Qi(e))}var cS=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`
371
+ `),dS=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }"," return base;","}","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${hf};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${hf});`,` float y = (row + 0.5) / ${lS};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Ps}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Ps}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Ps}, ${uS}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`
372
+ `),mS=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`
373
+ `),fS=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`
374
+ `),pS=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`
375
+ `);function qt(e){return fe(e)||Le(e)}function gf(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function bf(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(I("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function oo(e,t=dS){let n=bf(e,cS,e.VERTEX_SHADER),r=bf(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(I("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function to(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function hS(e,t){let n=oo(e,mS);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function gS(e,t){let n=oo(e,fS);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function bS(e,t){let n=oo(e,pS);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function Rr(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=to(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function ro(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Os(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function xf(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Us(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=oo(t),r=to(t),i=to(t,t.NEAREST),o=to(t,t.NEAREST);if(!n||!r||!i||!o)return xf(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Os(t,n,Mi),detailUniforms:Os(t,n,Fa),effectUniforms:Os(t,n,Na),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(xf(t,n,[r,i,o]),null)}function xS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yS(e){if(!xS(e))return{...vn};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,vn.position,0,1),softness:t(e.softness,vn.softness,0,.25),lineWidth:t(e.lineWidth,vn.lineWidth,0,12)}}function Cf(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function ao(e){return e instanceof Error?e.message:"LUT failed to load"}function SS(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Rf(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return SS(t)}function Ws(e){let t=Cf(e);if("error"in t)return{state:"error",message:t.error};let n=ht.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Mc(o,{maxSize:Ci})),i={state:"pending",promise:r};for(;ht.size>=rS;){let o=ht.keys().next().value;if(!o)break;ht.delete(o)}return ht.set(t.href,i),r.then(o=>{ht.get(t.href)===i&&ht.set(t.href,{state:"ready",lut:o})},o=>{ht.get(t.href)===i&&ht.set(t.href,{state:"error",message:ao(o)})}),i}function yf(e,t,n){if(e.lut?.src===t)return e.lut;let r=Aa(n),{gl:i,program:o}=e;try{return Tf(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=ao(a),e.lutLoadingSrc=null,I("runtime.colorGrading.uploadLut",a),null}}async function vS(e){let t=Ws(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Tf(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function AS(e,t,n){let r=Aa(n),{gl:i,program:o}=e;return Tf(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function at(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Vs(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),at(e.gl,t.scratch),at(e.gl,t.blur),t.bloom&&at(e.gl,t.bloom),e.effectTargets=null)}function zs(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),at(e.gl,t.moments),at(e.gl,t.output),e.kuwaharaTargets=null)}function no(e,t=!1){Vs(e),zs(e),ES(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function ES(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function _S(e){let t=Us(e.canvas);return t?(no(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Bs(e){if(!e.sourceHidden)return;e.element.removeAttribute(Zn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function wS(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=hS(t,e.program.quad),r=Rr(t),i=Rr(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&at(t,r),i&&at(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function CS(e,t){return t.bloom||(t.bloom=Rr(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Sf(e){let t=e.effectTargets;t?.bloom&&(at(e.gl,t.bloom),t.bloom=null)}function RS(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=gS(t,e.program.quad),o=bS(t,e.program.quad),a=Rr(t,n.HALF_FLOAT_OES,t.NEAREST),l=Rr(t);return!i||!o||!a||!l?(TS(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function TS(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&at(e,r),i&&at(e,i)}function kf(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return ro(e,t,o,a),ro(e,n,o,a),{width:o,height:a}}function io(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),Tr(e,t)}function kS(e,t,n,r,i,o,a){let l=kf(e,t.scratch,r,i/2,o/2),s=a/2;io(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),io(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function MS(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)io(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),io(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function Tr(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function FS(e,t,n,r,i,o,a,l){ro(e,t.moments,i.width,i.height),ro(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),Tr(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),Tr(e,u)}function NS(e,t,n,r){if(n<=0)return!1;let i=kf(e.gl,t.scratch,t.blur,r.width,r.height);return MS(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function LS(e,t,n,r,i,o){if(n<=0)return Sf(e),null;o||Sf(e);let a=o?CS(e,t):t.blur;return a?(kS(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function DS(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Vs(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=wS(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=NS(e,l,o,n),u=LS(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function IS(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&zs(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=RS(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(FS(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Mf(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=DS(e,t,n,o),l=IS(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function PS(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=Cf(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Ws(t);return i.state==="ready"?yf(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(yf(e,r.href,o),We(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=ao(o),e.lutLoadingSrc=null,We(e))})),null)}function wr(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&qt(n))return n;try{let r=document.querySelector(t);return r&&qt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&qt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&qt(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&qt(r)?r:null}catch{return null}}function Ff(e){return fe(e)?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:Le(e)&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Nf(e){return fe(e)?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:Le(e)?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Lf(e){let t=At(e);return t&&Nf(t)?t:null}function vf(e){if(!fe(e))return!1;let t=Lf(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function OS(e){return Le(e)&&e.classList.contains("__render_frame__")}function GS(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Df(e){if(fe(e)){let t=Lf(e);if(t)return t}return Nf(e)?e:null}function Af(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function HS(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Af(o,"x"),l=Af(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function If(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*m,s=r*m,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=HS(o||"center"),d=(e-l)*u.x/e,f=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:d,offsetY:f}}function BS(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Ef(e,t){return Math.max(0,Math.round(e>0?e:t))}function US(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&BS(e,i);let o=window.getComputedStyle(t);nd(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Ef(n.offsetWidth,a.width),s=Ef(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),d=Math.round(l*u),f=Math.round(s*u);return r.width!==d&&(r.width=d),r.height!==f&&(r.height=f),{width:d,height:f}}function Sn(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function $t(e,t,n,r){e.set(r,(t*nt+n)*4)}function Mt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Gs(e,t,n){return e.length>=3?_a(e,t,n):new Float32Array(nt)}function zt(e,t){return e[t]??0}function WS(e,t,n){let r=cn(t.red),i=cn(t.green),o=cn(t.blue),a=cn(t.master),l=Gs(n.hueVsHue,-180,180),s=Gs(n.hueVsSaturation,-1,1),u=Gs(n.hueVsLuma,-1,1);for(let d=0;d<nt;d+=1)$t(e,0,d,[zt(r,d),zt(i,d),zt(o,d),zt(a,d)]),$t(e,1,d,[Mt(zt(l,d),180),Mt(zt(s,d),1),Mt(zt(u,d),1),1])}function VS(e,t,n){let r=n*sS;$t(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),$t(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),$t(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),$t(e,2,r+3,[Mt(t.correction.hueShift,180),Mt(t.correction.saturation,1),Mt(t.correction.luma,1),Mt(t.correction.temperature,1)]),$t(e,2,r+4,[Mt(t.correction.tint,1),.5,.5,1])}function zS(e,t,n){let r=new Float32Array(nt*Mr*4);WS(r,e,t);let i=0;for(let o of n)o.enabled&&(VS(r,o,i),i+=1);return r}var _f=new WeakMap;function qS(e,t,n){let r=_f.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return _f.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function $S(e,t,n,r){let{curves:i,hueCurves:o}=n,a=qS(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(zS(i,o,r),Xn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,nt,Mr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Hs(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Pf(e,t,n,r,i,o,a,l,s,u,d,f){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:m,hueCurves:p,secondaries:g}=n,y=Ia(m),x=Pa(p),w=Oa(g)?g.reduce((N,O)=>N+Number(O.enabled),0):0;(y||x||w>0)&&$S(e,t,n,g),Hs(e,t.shadowWheel,n.wheels.shadows),Hs(e,t.midtoneWheel,n.wheels.midtones),Hs(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,y?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,w);for(let[N,O]of t.adjustUniforms)e.uniform1f(O,n.adjust[N]);for(let[N,O]of t.detailUniforms)e.uniform1f(O,n.details[N]);e.uniform1f(t.grainSeed,d),e.uniform1f(t.effectTime,f);for(let[N,O]of t.effectUniforms)e.uniform1f(O,n.effects[N]);let k=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?oS:Is),C=k[k.length-1]??Is[1];e.uniform1f(t.paletteSize,k.length),Sn(e,t.palette0,k[0]??Is[0]),Sn(e,t.palette1,k[1]??C),Sn(e,t.palette2,k[2]??C),Sn(e,t.palette3,k[3]??C),Sn(e,t.palette4,k[4]??C),Sn(e,t.palette5,k[5]??C),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function jS(e){if(!e.sourceHidden){let t=e.element.getAttribute(ki);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Zn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function gt(e){let t=Xc.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Of=gt("intensity"),Gf=gt("lut.intensity"),Hf=gt("adjust.exposure"),Bf=gt("effects.kuwahara"),Uf=[["blur",gt("effects.blur")],["bloom",gt("effects.bloom")],["kuwahara",Bf],["pixelate",gt("effects.pixelate")],["ascii",gt("effects.ascii")],["dither",gt("effects.dither")]],Wf=[Of,Gf,Hf,...Uf.map(([,e])=>e)];function jt(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Cr(e,t){return t!==null&&(ed(t)||Wf.some(n=>jt(e,n)!==null))}function KS(e,t){let n=null;for(let[r,i]of Uf){let o=jt(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function YS(e){let{element:t,grading:n}=e,r=jt(t,Of),i=jt(t,Gf),o=jt(t,Hf),a=KS(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function Vf(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function zf(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function We(e){if(e.destroyed||e.contextLost)return!1;let t=Df(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Ff(t);if(!n)return!1;let r=Ae(t)?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=OS(t);s&&GS(e,t),a&&!s&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!s&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let d=US(e,r);if(!d)return!1;let f=window.getComputedStyle(r),m=If(d.width,d.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:p,program:g}=e;try{let y=YS(e),x=PS(e);Vf(p,g.texture,t);let w=jt(e.element,Bf)!==null,k=Mf(e,y,d,m,{preserveKuwahara:w});p.bindFramebuffer(p.FRAMEBUFFER,null),p.viewport(0,0,d.width,d.height),p.useProgram(g.program),zf(p,g,k);let C=window.__player?.getTime?.(),N=typeof C=="number"&&Number.isFinite(C)?Math.max(0,C):fe(e.element)?Math.max(0,e.element.currentTime):0,O=e.grainSeed+Math.floor(N*60);return Pf(p,g,y,x,k.blurReady,k.bloomReady,k.kuwaharaReady,e.compare,d,m,O,N),Tr(p,g),jS(e),e.hasDrawn=!0,e.drawError=null,!0}catch(y){return e.drawError=y instanceof Error?y.message:"Shader draw failed",I("runtime.colorGrading.drawEntry",y),!1}}function XS(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function JS(){let e=document.createElement("canvas"),t=Us(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function QS(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):fe(e)?Math.max(0,e.currentTime):0}function ZS(e,t,n,r){let i=Df(t);if(!i)return null;let o=Ff(i);if(!o)return null;let a=XS(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=Ae(i)?i:t,s=window.getComputedStyle(l),u=If(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Vf(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:QS(t,r),grainSeed:Rf(t)+(fe(t)?Math.floor(t.currentTime*60):0)}}async function ev(e,t,n,r,i=!1){let o=ZS(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,d=[];for(let f of n.slice(0,32)){let m=Fi(f.grading);if(!m){d.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let p=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=AS(e,m.lut.src,await vS(m.lut.src))),p=e.lut),d.push({id:f.id,dataUrl:tv(e,m,p,a,l,s,u)})}catch(g){d.push({id:f.id,dataUrl:null,error:ao(g)})}}return{...a,images:d}}function tv(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,d=Mf(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),zf(s,u,d),n||(e.lut=null),Pf(s,u,t,n,d.blurReady,d.bloomReady,d.kuwaharaReady,vn,r,i,o,a),Tr(s,u),l.toDataURL("image/png")}function ot(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function nv(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&fe(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function kr(e){if(e.destroyed||!fe(e.element)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,We(e),!e.destroyed&&!t.paused&&!t.ended&&kr(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,We(e),!e.destroyed&&!t.paused&&!t.ended&&kr(e)})}function rv(e){let t=()=>{We(e)};if(ot(e,e.element,"load",t),ot(e,e.element,"loadedmetadata",t),ot(e,e.element,"loadeddata",t),ot(e,e.element,"seeked",t),ot(e,e.element,"timeupdate",t),ot(e,window,"resize",t),fe(e.element)&&(ot(e,e.element,"play",()=>kr(e)),ot(e,e.element,"pause",t)),ot(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Bs(e)}),ot(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!_S(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Bs(e);return}e.drawError=null,We(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),We(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function iv(e){if(e.destroyed)return null;e.destroyed=!0,nv(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Vs(e),zs(e),Bs(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function qf(e,t){return e.removeAttribute("style"),t.id?e.id=`${qc}${t.id}`:e.removeAttribute("id"),e.className=nS,e.setAttribute(tS,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function ov(e){return qf(document.createElement("canvas"),e)}function $f(e){let t=new WeakMap,n=new Set,r=[],i=null,o=null,a=Promise.resolve(),l=!1,s=(S,v,E)=>{let T=t.get(S);if(T)return T.grading=v,T.source=E,We(T),fe(S)&&!S.paused&&kr(T),!0;let L=r.pop();if(L)qf(L.canvas,S);else{let z=ov(S),X=Us(z);if(!X)return z.remove(),!1;L={canvas:z,gl:X.gl,program:X.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let G={element:S,...L,grading:v,compare:{...vn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:E,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(S).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(S).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Rf(S),destroyed:!1};return t.set(S,G),n.add(S),rv(G),We(G),fe(S)&&!S.paused&&kr(G),!0},u=(S,v)=>{if(l)return!1;let E=wr(S);if(!E)return!1;let T=t.get(E);if(!T){let L=eo(E);if(!Cr(E,L)||!s(E,L,"attribute"))return!1;T=t.get(E)}return T?(T.compare=yS(v),We(T),!0):!1},d=S=>{let v=t.get(S);if(!v)return;let E=iv(v);E&&(v.contextLost||r.length>=iS?no(E,!0):r.push(E)),t.delete(S),n.delete(S)},f=()=>{if(l)return 0;let S=new Set;document.querySelectorAll(`video[${Qn}], img[${Qn}]`).forEach(E=>{if(!qt(E))return;S.add(E);let T=eo(E);Cr(E,T)&&(gf(E)||vf(E))?s(E,T,"attribute"):d(E)});for(let E of n){let T=t.get(E);T&&(!E.isConnected||T.source==="attribute"&&!S.has(E))&&d(E)}return n.size},m=()=>{if(l)return 0;let S=0;for(let v of n){let E=t.get(v);E&&We(E)&&(S+=1)}return S},p=async()=>{let S=new Set;for(let v of n){let E=t.get(v)?.grading.lut;if(!E?.src.trim()||(E.intensity??1)<=0)continue;let T=Ws(E.src);T.state==="pending"&&S.add(T.promise)}return S.size>0&&await Promise.allSettled(S),m(),S.size},g=()=>{if(l)return 0;let S=0;for(let v of n){let E=t.get(v);!E||!Wf.some(L=>jt(v,L)!==null)||fe(v)&&!v.paused&&!v.ended||We(E)&&(S+=1)}return S},y=(S,v)=>{if(l)return!1;let E=wr(S);if(!E)return!1;let T=Fi(v);return Cr(E,T)?s(E,T,"live"):(d(E),!0)},x=(S,v)=>{if(!qt(S))return!1;let E=t.get(S);if(!E){if(!v)return!1;let T=eo(S);return Cr(S,T)&&s(S,T,"attribute")}return E.sourceVisibleForCanvas=v,!v&&E.source==="attribute"&&d(S),!0},w=S=>{let v=wr(S);if(!v)return{state:"missing",message:"Media not found"};let E=t.get(v);if(E)return E.effectError?{state:"unavailable",message:E.effectError}:E.drawError?{state:"unavailable",message:E.drawError}:E.lutError?{state:"unavailable",message:`LUT error: ${E.lutError}`}:E.grading.lut&&E.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:E.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:E.lut?"Shader + LUT active":"Shader active"};let T=eo(v);return Cr(v,T)?!gf(v)&&!vf(v)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},k=async(S,v,E)=>{let T=async()=>{if(l||v.length===0)return null;let G=wr(S);return!G||(o??(o=JS()),!o)?null:ev(o,G,v,E?.maxDimension,E?.useMediaTime)},L=a.then(T,T);return a=L.then(()=>{},()=>{}),L},C=S=>{let v=wr(S);if(!fe(v))return null;if(!v.paused)return()=>{};let E=v.currentTime,T=v.loop,L=v.muted;return v.loop=!0,v.muted=!0,(v.ended||Number.isFinite(v.duration)&&E>=v.duration)&&(v.currentTime=0),e?.lease(v),v.play().catch(()=>{}),()=>{e?.release(v),v.pause(),v.loop=T,v.muted=L,v.currentTime=E}},N=()=>{if(!l){l=!0,i?.disconnect(),i=null;for(let S of n)d(S);for(let S of r)no(S,!0);r.length=0,o&&(no(o,!0),o=null)}};document.body&&(i=new MutationObserver(()=>f()),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Qn]}));let O={refresh:f,redraw:m,redrawAnimated:g,waitForActiveLuts:p,setGrading:y,setCompare:u,setSourceVisibility:x,getStatus:w,renderPreviews:k,startPreviewPlayback:C,destroy:N},F=window;return F.__hf=F.__hf||{},F.__hf.colorGrading=O,f(),O}var av=500,sv=33,so=class{constructor(t){le(this,"_baseTime",0);le(this,"_playStartMs",null);le(this,"_rate",1);le(this,"_duration",1/0);le(this,"_nowMs");le(this,"_audioSource",null);le(this,"_lastReadMs",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a,rate:l}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=typeof l=="object"?nn(l,i.currentTime-a)+o:(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return this._lastReadMs=null,Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}this._applyStallCorrection();let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>av&&(this._playStartMs+=n-sv)}this._lastReadMs=t}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),this._lastReadMs=null,!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs(),this._lastReadMs=null)}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var lv=100,uv=8,cv=4096,qs=e=>e;function dv(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function mv(e){let t=Math.ceil(e*lv);return Math.min(cv,Math.max(uv,t))}function fv(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??qs,u=k=>o+(k-a)/l,d=e.points[t],f=e.points[t+1],m=u(f.t);if(m<=o)return null;let p=Math.max(o,u(d.t)),g=m-p;if(g<=0)return null;if(dv(d,n,i))return{kind:"ramp",time:m,value:s(f.v)};let y=mv(g),x=Qu(e,Math.max(d.t,a),f.t,y,n),w=new Float32Array(y);for(let k=0;k<y;k+=1)w[k]=s(x[k]??0);return{kind:"curve",time:p,duration:g,values:w}}function pv(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=fv(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??qs)(mt(e,n.elapsed,t))}),i}function hv(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function Fr(e){for(let t of e)t.param.cancelScheduledValues(0)}function An(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function $s(e,t,n,r){if(t.points.length!==0)for(let i of e){if(Fr([i]),Ju(t)){let o=(i.map??qs)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}hv(i.param,pv(t,n,r,i.map))}}function jf(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=$n(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let d=sa(l.target,t);d&&($s(u,l,d.scale,r),a.push(...u))}return a}function Kf(e){return e.lanes.find(t=>t.target===tn)??null}var gv=`
376
376
  const dbToLin = (db) => Math.pow(10, db / 20);
377
377
 
378
378
  /**
@@ -708,9 +708,9 @@ class HfPitchshift extends AudioWorkletProcessor {
708
708
  }
709
709
  }
710
710
  registerProcessor("hf-pitchshift", HfPitchshift);
711
- `,Vs=new WeakMap;function zs(e){return Hf.has(e)}var Hf=new WeakSet;function qs(e){let t=Vs.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(rv)))}`;await e.audioWorklet.addModule(n),Hf.add(e)})().catch(n=>{throw Vs.delete(e),n}),Vs.set(e,t)),t}function iv(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,d=0;for(let m=0;m<i;m++){u+=s*(l()-u);let p=u*Math.pow(1-m/i,2.5);o[m]=p,d+=p*p}let f=Math.sqrt(d);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var ue=e=>typeof e=="number"?e:Number(e??0),$s=e=>e/1e3;function Vf(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let d=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function zf(e){try{e.stop()}catch{}e.disconnect()}function js(e,t){return[{param:e},{param:t,map:n=>1-n}]}function qf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ks(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var ov=new Set(["peaking","highpass","lowpass"]),Bf=e=>Math.pow(10,e/20),av=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=Bf(ue(i.gain))};return r(t),Ks(n,r,{gain:[{param:n.gain,map:Bf}]})};function kr(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ue(a.frequency),a.q!==void 0&&(i.Q.value=ue(a.q)),t&&(i.gain.value=ue(a.gain))};return o(r),Ks(i,o,{frequency:[{param:i.frequency}],...ov.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function sv(e){return(t,n)=>{let r=Math.tan(Math.PI*ue(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Ks(i,()=>{})}}function Mr(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var lv={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},uv=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=lv[String(a.type)]??Math.tanh,s=Math.pow(10,ue(a.threshold)/20),u=8192,d=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=ue(a.oversample)>=4?"4x":ue(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ue(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},cv=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ue(u.time)/1e3),o.gain.value=ue(u.feedback),qf(a,l,ue(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,$s(u))}],feedback:[{param:o.gain}],mix:js(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},dv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=Vf(e,"sine",ue(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let d=f=>{o.delayTime.value=ue(f.delay)/1e3,l.gain.value=ue(f.depth)/1e3,a.playbackRate.value=ue(f.speed),qf(s,u,ue(f.mix))};return d(t),{input:r,output:i,update:d,automation:{delay:[{param:o.delayTime,map:$s}],depth:[{param:l.gain,map:$s}],speed:[{param:a.playbackRate}],mix:js(s.gain,u.gain)},dispose:()=>{zf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},mv=6,fv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=Vf(e,String(t.type)==="1"?"sine":"triangle",ue(t.speed),n),s=e.createGain(),u=e.createGain(),d=e.createGain(),f=[];r.connect(o);let m=o;for(let g=0;g<mv;g++){let y=e.createBiquadFilter();y.type="allpass",y.Q.value=.7071,s.connect(y.frequency),m.connect(y),m=y,f.push(y)}l.connect(s),m.connect(u).connect(a),o.connect(d).connect(a),a.connect(i);let p=g=>{let y=1e3/Math.max(.1,ue(g.delay));for(let x of f)x.frequency.value=y;s.gain.value=y*ue(g.decay),l.playbackRate.value=ue(g.speed),o.gain.value=ue(g.in_gain),a.gain.value=ue(g.out_gain),u.gain.value=1,d.gain.value=1};return p(t),{input:r,output:i,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{zf(l),[r,i,o,a,s,u,d,...f].forEach(g=>g.disconnect())}}},pv=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let d=`${ue(u.size)}:${ue(u.damping)}`;if(d!==l){let f=iv(e.sampleRate,ue(u.size),ue(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=d}o.gain.value=ue(u.wet),a.gain.value=ue(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},hv={"gain-node":av,"biquad-peaking":kr("peaking",!0),"biquad-lowshelf":kr("lowshelf",!0),"biquad-highshelf":kr("highshelf",!0),"biquad-highpass":kr("highpass",!1),"biquad-lowpass":kr("lowpass",!1),"worklet-compressor":Mr("hf-compressor"),"worklet-limiter":Mr("hf-limiter"),"worklet-gate":Mr("hf-gate"),"worklet-bitcrush":Mr("hf-bitcrush"),"worklet-pitchshift":Mr("hf-pitchshift"),waveshaper:uv,"delay-feedback":cv,"chorus-lfo":dv,"allpass-phaser":fv,convolver:pv};function $f(e){return e.nodes.some(t=>Gn(t.type)?.web.startsWith("worklet-")??!1)}function gv(e,t,n,r=0){let i=Gn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=Hn(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return sv(t)(e,o,r);let a=hv[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function Uf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function Wf(e){return Bn(e).map(t=>{let n=Hn(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function jf(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=Uf(Bn(t)),s=r;for(let m of l){let p=null;if(m.preset){let g=e.createGain(),y=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,y.gain.value=1-m.amount,s.connect(g),g.connect(y).connect(_),p={entry:g,wet:x,dry:y,join:_},s=g}for(let g of m.nodes){let y=gv(e,g.type,g.params??{},n);s.connect(y.input),s=y.output,o.push({...g.id?{id:g.id}:{},type:g.type,handle:y})}p&&m.preset&&(s.connect(p.wet).connect(p.join),a.push({id:m.preset,...p}),s=p.join)}s.connect(i);let u=Wf(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...js(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:d,nodes:o,update(m){if(Wf(m)!==u)return!1;Bn(m).forEach((g,y)=>{let x=o[y];x&&(x.handle.update(Hn(g.type,g.params)),g.id===void 0?delete x.id:x.id=g.id)});let p=0;for(let g of Uf(Bn(m))){if(!g.preset)continue;let y=a[p++];!y||y.id!==g.preset||(y.wet.gain.value=g.amount,y.dry.gain.value=1-g.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:p,dry:g,join:y}of a)m.disconnect(),p.disconnect(),g.disconnect(),y.disconnect();r.disconnect(),i.disconnect()}}}var Kf={version:1,nodes:[]},Yf={version:1,lanes:[]};function Xf(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(mt):null)??"";if(!n)return Yf;try{return ju(fi(n),t)}catch{return Yf}}function vn(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Ht):null)??"";if(!t)return{chain:Kf,raw:""};try{return{chain:Iu(t),raw:t}}catch{return{chain:Kf,raw:""}}}function Jf(e){return Xf(e,vn(e).chain)}function oo(e,t,n,r,i){let{chain:o}=vn(t),a=null,l=[],s=!1,u=0,d=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(C,L)=>{if(C.nodes.length===0){n.connect(r);return}if($f(C)&&!zs(e)){n.connect(r);let P=++u;qs(e).then(()=>{s||P!==u||x(vn(t).chain)}).catch(()=>{});return}try{let P=jf(e,C,L);n.connect(P.input),P.output.connect(r),a=P}catch{n.connect(r)}},m=(C,L)=>{l=L&&a?Of(Xf(t,C),C,a.nodes,L,a.presets):[]},p=i?{...i}:null;f(o,p?.elapsed??0),m(o,p);let g=()=>{if(!p)return null;let C=typeof e.currentTime=="number"?e.currentTime:p.scheduledAt;return{scheduledAt:C,elapsed:p.elapsed+(C-p.scheduledAt)*p.rate,rate:p.rate}},y=C=>{let L=g();L&&(Sn(l,L.scheduledAt),m(C,L))},x=C=>{let L=g();Sn(l,L?.scheduledAt??0),d(),f(C,L?.elapsed??0),m(C,L)},_=null,k=t;return typeof MutationObserver<"u"&&typeof k?.nodeType=="number"&&(_=new MutationObserver(()=>{let C=vn(t);l.length>0&&Tr(l),!a||!a.update(C.chain)?x(C.chain):y(C.chain)}),_.observe(k,{attributes:!0,attributeFilter:[Ht,mt]})),{reanchor:C=>{if(s)return;let L=g();L&&Sn(l,L.scheduledAt),p={...C},m(vn(t).chain,p)},setRate:C=>{let L=g();s||!L||!Number.isFinite(C)||C<=0||C===L.rate||(p={...L,rate:C},Sn(l,L.scheduledAt),m(vn(t).chain,p))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&Sn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var Qf="runtime_web_audio_bypass";function Ys(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function Fr(e,t){return Ys(e,t)!==null}function bv(e){return Fr(e,"crossorigin")?!0:e.crossOrigin!=null}function xv(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function yv(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Ys(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function Sv(e,t){let n;try{n=new URL(e,xv(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function vv(){return typeof window.origin=="string"?window.origin:window.location.origin}function Av(e,t){if(typeof window>"u")return null;let n=Sv(e,t);if(!n)return null;let r=vv(),i=r==="null";return!i&&n.origin===r||bv(t)?null:i?"opaque_document_origin":"cross_origin_no_cors"}function ep(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:Fr(e,"src")}function An(e){for(let t of yv(e)){let n=Av(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function Ev(e){let t=[];Fr(e,Ht)&&t.push("fx-chain"),Fr(e,mt)&&t.push("automation"),Fr(e,yi)&&t.push("audio-group");let n=Number.parseFloat(Ys(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function wv(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var Zf=new WeakSet,_v={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document's security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},Cv={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function En(e,t){if(t.kind==="web-audio"||wv()||Zf.has(e))return;let n=Ev(e);Zf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:_v[t.reason]};ye({source:"hf-preview",type:"diagnostic",code:Qf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 ${Cv[t.reason]}`:"";console.info(`[hyperframes] ${Qf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Xs(e){return!Number.isFinite(e)||e<=0?1:e}function tp(e){return Ue(e)}function Rv(e,t){t||e.paused||!Zr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Tv(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let d=-n/o;return s?e.start(i+d,r,u):e.start(i+d,r),!0}function ao(e,t,n){let r=Gf(Jf(e));r&&Ws([{param:t.gain}],r,mi.scale,n)}function Nr(e){return e.sourceKind==="buffer"}var so=class{constructor(){xe(this,"_ctx",null);xe(this,"_bufferCache",new Map);xe(this,"_failedSrcs",new Set);xe(this,"_mediaElementSources",new WeakMap);xe(this,"_activeSources",[]);xe(this,"_masterGain",null);xe(this,"_masterVolume",1);xe(this,"_masterMuted",!1);xe(this,"_groups",new Map);xe(this,"_rateAnchorCtx",0);xe(this,"_rateAnchorComp",0);xe(this,"_rate",1);xe(this,"_paused",!0);xe(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return D("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return D("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),D("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=An(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),En(t,o),null}return n}if(!this._ctx)return null;let r=An(t);if(r.kind!=="web-audio")return En(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Xs(l),d=this._ctx.createGain();d.gain.value=o;let f=this._ctx.currentTime,m=i-n,p={scheduledAt:f,elapsed:m,rate:u},g=oo(this._ctx,t,s,d,p);d.connect(this.resolveDestination(t,f,i,u)??this._masterGain),ao(t,d,p),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let y={fx:g,el:t,sourceNode:s,sourceKind:"media-element",gainNode:d,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Oe(t),bounded:!1};return t.volume=1,this._activeSources.push(y),this._paused=!1,y}catch(s){return D("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(m){D("webAudioTransport.groupReanchor",m)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>la(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let d=this._ctx.createGain();d.gain.value=tp(sa(s)),d.connect(u);let f=oo(this._ctx,s??{getAttribute:()=>null},o,d,r);return s&&ao(s,d,r),this._groups.set(t,{input:o,fader:d,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{Tr([{param:d.gain}]);let p=l();d.gain.value=tp(sa(p)),u.gain.value=p?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),p&&ao(p,d,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),d.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){D("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=sc(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let d=Xs(s),f=Oe(t),m=d*f,p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=m;let g=this._ctx.createGain();g.gain.value=a;let y=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:y,rate:d},k=oo(this._ctx,t,p,g,_);if(g.connect(this.resolveDestination(t,x,o,d)??this._masterGain),ao(t,g,_),this._rate=d,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Tv(p,{elapsed:y,mediaStart:i,scheduledAt:x,globalRate:d,mediaRate:f,clipDuration:u}))return p.disconnect(),k?.dispose(),g.disconnect(),null;let C=t.muted;t.muted=!0,Rv(t,C);let L={fx:k,el:t,sourceNode:p,sourceKind:"buffer",gainNode:g,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(L),this._paused=!1,p.addEventListener("ended",()=>this.handleSourceEnded(p,L,t,C)),L}catch(d){return D("webAudioTransport.schedule",d),null}}setRate(t){let n=Xs(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{Nr(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){D("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){D("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>Nr(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{Nr(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}Nr(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Ue(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){D("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&Nr(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var Lr="data-hf-studio-manual-edit-gesture";var np=`[${Lr}]`;function rp(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(np)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(np)),i=l=>{for(let s of l){let u=s.target;Me(u)&&(u.hasAttribute(Lr)?r.add(u):r.delete(u))}},o=l=>{l.length!==0&&(i(l),t())},a=new n(o);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Lr]}),{observing:!0,isActive:()=>{o(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Lr))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var ip=333.3333333333333;function op(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var kv=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function ap(e){return Math.max(0,Math.min(1,e))}function sp(e){let t=kv.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?ap(n):null}function lp(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=ap(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var Mv=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Fv=Math.PI*2;function Nv(e){let t=Mv.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Lv(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(Fv*t*e)}function up(e,t){let n=Nv(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Lv(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Dv=24,cp=e=>e>=1?1:0,Iv=e=>e,lo=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Pv=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${lo}\s*,\s*${lo}\s+${lo}\s*,\s*${lo}\s+1\s*,\s*1\s*$`,"i");function dp(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Ov(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<Dv;l+=1){let s=(o+a)/2;dp(s,t,r)<e?o=s:a=s}return dp((o+a)/2,n,i)}function Gv(e){let t=Pv.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>Ov(a,n,r,i,o)}function Hv(e,t){if(!e.startsWith("spring("))return null;let n=sp(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>lp(o,n);return t.set(n,i),i}function Bv(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=Gv(n);return i&&t.set(n,i),i}function mp(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?cp:up(s,i)??Hv(s,r)??Bv(s,n),a=(s,u,d=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Be("custom_ease_parse_failed",{ease:s}),t.call(u,s,...d)??Iv)};e.parseEase=function(u,...d){return a(u,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",cp);let s=u=>{let d=f=>f;d.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}function Uv(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function Wv(e){if(!Uv(e)||e.tagName!=="AUDIO"&&e.tagName!=="VIDEO")return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function Vv(e){let t=Array.from(e.querySelectorAll("video, audio")).filter(Wv).filter(i=>i.readyState<3),n=Array.from(e.querySelectorAll("img")).filter(i=>!i.complete),r=e.fonts?.status==="loading";return{pendingMedia:t,pendingImages:n,fontsLoading:r}}function zv(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},i){let o=t.map(s=>new Promise(u=>{if(s.error){u();return}let d=()=>{s.removeEventListener("canplay",d),s.removeEventListener("error",d),i.removeEventListener("abort",d),u()};s.addEventListener("canplay",d),s.addEventListener("error",d),i.addEventListener("abort",d,{once:!0})})),a=n.map(s=>s.decode?s.decode().catch(()=>{}):Promise.resolve()),l=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...o,...a,l]).then(()=>{})}function qv(e,t){let n=Vv(e);return n.pendingMedia.length===0&&n.pendingImages.length===0&&!n.fontsLoading?null:zv(e,n,t)}var $v=50;function jv(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(r=>{let i,o=()=>{i!==void 0&&clearTimeout(i),t.removeEventListener("abort",o),r()};if(t.aborted){o();return}t.addEventListener("abort",o,{once:!0});let a=()=>{if(n.__renderReady){o();return}i=setTimeout(a,$v)};a()})}var Kv=50,Yv=2,Xv=1500;function Js(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,i=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener("abort",i,{once:!0}),r=e.requestAnimationFrame(o=>{t.removeEventListener("abort",i),n(o)})})}function Jv(e,t){let n=e.defaultView;return n?(async()=>{let r=await Js(n,t);if(t.aborted)return;let i=await Js(n,t),o=0;for(;!t.aborted&&o<Yv;){if(i-r>=Xv)return;let a=await Js(n,t);if(t.aborted)return;o=a-i<Kv?o+1:0,i=a}})():null}var Qv=8e3;function fp(e,t,n={}){let r=n.inputs??[qv,jv,Jv],i=new AbortController,o=r.map(u=>u(e,i.signal)).filter(u=>u!==null);if(o.length===0){t({timedOut:!1});return}let a=n.timeoutMs??Qv,l,s=new Promise(u=>{l=setTimeout(()=>u("timed-out"),a)});Promise.race([Promise.all(o).then(()=>"done"),s]).then(u=>{clearTimeout(l),i.abort(),t({timedOut:u==="timed-out"})})}var el=new Map,Dr=new Map,Qs=new Map,Zs=()=>{},hp=()=>{},pp=0;function tl(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function gp(e){let t=(Qs.get(e)??0)+1;return Qs.set(e,t),t}function bp(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(pp-=1,pp)}function nl(e,t){let n=Dr.get(e);if(!n)return;let r=()=>Qs.get(e)===t.generation&&Dr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&hp(e,t.requestId)},i=>{r()&&Zs(e,t.requestId,i)})}catch(i){r()&&Zs(e,t.requestId,i)}}function xp(e){Zs=e}function yp(e){hp=e}function uo(e,t,n){if(!tl(e))return;let r={payload:t,requestId:bp(n),generation:gp(e)};el.set(e,r),nl(e,r)}function co(e,t){tl(e)&&(el.delete(e),nl(e,{payload:void 0,requestId:bp(t),generation:gp(e)}))}function Sp(e,t){if(!tl(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Dr.set(e,t);let n=el.get(e);return n&&nl(e,n),()=>{Dr.get(e)===t&&Dr.delete(e)}}var rl="data-hf-authored-duration",il="data-hf-authored-end",vp=!1;function lt(e){if(e){if(typeof e.pause!="function"){vp||(vp=!0,Be("timeline_missing_pause",{}));return}try{e.pause()}catch(t){D("runtime.timeline.pause",t)}}}function t1(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function n1(e,t){return t!==null&&e.length===t.length&&e.every((n,r)=>n===t[r])}function Ap(e,t,n){let r=null,i=!0;return()=>{let o=e();if(o.length===0)return r=null,i=!0,!0;if(n1(o,r))return i;r=o,i=!1;let a=o.length===1?o[0]:Promise.all(o);return Promise.resolve(a).then(()=>{r===o&&(i=!0,t())},l=>{r===o&&(i=!0,n(l),t())}),i}}function Ep(){let e=Yc(),t=()=>{};tu(ye),xp((c,h,b)=>{ye({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:h,message:b instanceof Error?b.message:String(b)})}),yp((c,h)=>{try{t()}catch(b){ye({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:h,message:b instanceof Error?b.message:String(b)});return}ye({source:"hf-preview",type:"runtime-data-applied",channel:c,requestId:h})}),Ki(document),Ms(document),lc(document);let n=t1();e.canonicalFps=n.fps??e.canonicalFps,Zl(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,d=(c,h,b)=>{u.has(c)||(u.add(c),Be(h,b))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){D("runtime.init.site1",c)}let f=new io;e.transportClock=f;let m=new so,p=!1;m.init().then(c=>{p=c}),window.__hf=window.__hf||{};let g=c=>c.closest("[data-hidden]")!==null||Si(c.ownerDocument,c),y=()=>{let c=window.gsap,h=window;if(!(!c?.registerPlugin||h.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(b){d("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),D("runtime.autoMarker.install",b)}},x=()=>{let c=window.gsap;if(!c){d("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{mp(c)||d("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){d("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),D("runtime.customEase.install",h)}};y(),x(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{lu(document)}catch(c){D("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let _=()=>{let c=document.querySelector('[data-composition-id][data-root="true"]');if(Ae(c))return c;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(b=>!b.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,h=_()?.getAttribute("data-composition-id")??"root",b={};if(c.length===1)b[h]=c[0];else for(let v=0;v<c.length;v++)b[`tl-${v}`]=c[v];window.__timelines=b}let k=_();k&&!k.hasAttribute("data-start")&&k.setAttribute("data-start","0");let C=c=>{a.push(c)},L=(c,h,b)=>{let v=b??`${c}:${JSON.stringify(h)}`;l.has(v)||(l.add(v),ye({source:"hf-preview",type:"diagnostic",code:c,details:h}))},P=c=>{let h={scale:1,focusX:960,focusY:540},b=[],v=[],w={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>b,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>v,getRenderState:()=>({...w,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},F=1/60,S=.75,A=.05,E=100,T=240,I=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},H=c=>{let h=c.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},j=c=>{if(c==null||c.trim()==="")return null;let h=Number.parseFloat(c);return!Number.isFinite(h)||h<=0?null:`${h}px`},Y=()=>_(),M=()=>{let c=Y();if(!c)return;let h=j(c.getAttribute("data-width")),b=j(c.getAttribute("data-height"));h&&(c.style.width=h),b&&(c.style.height=b),h&&c.style.setProperty("--comp-width",h),b&&c.style.setProperty("--comp-height",b),h&&(document.documentElement.style.width=h),b&&(document.documentElement.style.height=b),h&&(document.body.style.width=h),b&&(document.body.style.height=b)},W=()=>{let c=Y(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(b=>b.hasAttribute("data-duration")||b.hasAttribute("data-end"));for(let b of h){if(c&&b===c)continue;let v=b.getAttribute("data-duration"),w=b.getAttribute("data-end");v!=null&&!b.hasAttribute(rl)&&b.setAttribute(rl,v),w!=null&&!b.hasAttribute(il)&&b.setAttribute(il,w),b.removeAttribute("data-duration"),b.removeAttribute("data-end")}},te=()=>{let c=Y();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let h=j(c.getAttribute("data-width")),b=j(c.getAttribute("data-height"));h&&(c.style.width=h),b&&(c.style.height=b);let v=Array.from(c.children);for(let w of v){let R=w.tagName.toLowerCase();if(R==="script"||R==="style"||R==="link"||R==="meta"||!w.hasAttribute("data-start")||w.hasAttribute("data-hf-autostamped"))continue;let N=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",B=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(w.style.transform);if(N&&B&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let X=w.style.top,we=w.style.left,Gt=w.style.width,Ne=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let Qe=window.getComputedStyle(w);Qe.top!=="auto"||Qe.bottom!=="auto"||Qe.left!=="auto"||Qe.right!=="auto"||Qe.width!=="0px"||Qe.height!=="0px"||(w.style.top=X,w.style.left=we,w.style.width=Gt,w.style.height=Ne)}let $=window.getComputedStyle(w),ne=$.position;if(ne!=="absolute"&&ne!=="fixed"&&(w.style.position="absolute"),!!w.style.top||!!w.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(w.style.top="0"),!!w.style.left||!!w.style.right||$.left!=="auto"||$.right!=="auto"||(w.style.left="0"),R!=="audio"){let X=j(w.getAttribute("data-width")),we=j(w.getAttribute("data-height")),Gt=$.width!=="0px"&&$.width!=="auto",Ne=$.height!=="0px"&&$.height!=="auto";X?!w.style.width&&!Gt&&(w.style.width=X):!w.style.width&&$.width==="0px"&&(w.style.width="100%"),we?!w.style.height&&!Ne&&(w.style.height=we):!w.style.height&&$.height==="0px"&&(w.style.height="100%")}}},U=c=>tt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:c}),K=null,z=c=>{let h=K;K=U(!0);try{return c()}finally{K=h}},J=c=>c&&K?K:U(c),G=(c,h=0,b)=>J(b?.includeAuthoredTimingAttrs??!0).resolveStartForElement(c,h),O=(c,h)=>J(h?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(c),q=c=>{let h=c.closest("[data-composition-id]"),b=h?G(h,0):null,v=h?O(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:b,inheritedDuration:v}},Z=c=>J(!0).resolveMediaStartForElement(c);window.__hfResolveMediaStartSeconds=Z,a.push(()=>{window.__hfResolveMediaStartSeconds===Z&&delete window.__hfResolveMediaStartSeconds});let ce=(c,h,b)=>{let v=c.tagName.toLowerCase();if(v==="script"||v==="style"||v==="link"||v==="meta")return!1;let R=v==="video"||v==="audio"?Z(c):G(c,0),N=O(c),B=c.getAttribute("data-composition-id");if(B){let He=(window.__timelines??{})[B],ie=null;if(He&&typeof He.duration=="function"){let we=Number(He.duration());Number.isFinite(we)&&we>0&&(ie=we)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(rl)||c.hasAttribute(il))&&(N==null||N<=0)&&ie!=null&&(N=ie)}let $=N!=null&&N>0?R+N:Number.POSITIVE_INFINITY,ne=window.__HF_EXPORT_RENDER_SEEK_CONFIG?Oa(R,e.canonicalFps):R,he=window.__HF_EXPORT_RENDER_SEEK_CONFIG&&Number.isFinite($)?Oa($,e.canonicalFps):$;return ti(h,ne,he,b)},re=!!document.querySelector("[data-composition-src]"),V=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of c){let b=h.getAttribute("data-composition-id");if(b&&h.children.length===0&&document.querySelector(`template#${CSS.escape(b)}-template`)){V=!0;break}}}let Q=!re&&!V,Ee=c=>{if(!c||typeof c.duration!="function")return null;try{let h=Number(c.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},de=c=>typeof c=="number"&&Number.isFinite(c)&&c>F,Cn=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));return c.length===0?null:z(()=>{let h=[];for(let v of c){let w=Z(v);if(!Number.isFinite(w))continue;let R=bi(v);R==null||R<=F||h.push(Math.max(0,w)+R)}let{seconds:b}=rr({authoredDurationSeconds:null,clipEndsSeconds:h});return b!==null&&b>F?b:null})},ut=()=>{let c=Y();if(!c)return null;let h=window.__timelines??{},b=tt({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),v=Fe(c.getAttribute("data-duration")),w=[],R=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let B of R){if(!Me(B)||B.parentElement?.closest("[data-composition-id]")!==c)continue;let ne=b.resolveStartForElement(B,0),he=b.resolveDurationForElement(B);!Number.isFinite(ne)||he==null||he<=0||w.push(Math.max(0,ne)+he)}let{seconds:N}=rr({authoredDurationSeconds:null,clipEndsSeconds:[v,...w]});return N!==null&&N>F?N:null},ih=c=>c.hasAttribute("data-composition-id")||c.hasAttribute("data-composition-src"),oh=c=>{let h=window;return!!(h.lottie||h.DotLottie||c.querySelector("[data-lottie-src]"))},pl=()=>{let c=Y();if(!c)return rr({authoredDurationSeconds:null,clipEndsSeconds:[]});let h=tt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:!0}),b=[];for(let w of Array.from(c.querySelectorAll("[data-start]"))){if(!Me(w))continue;let R=h.resolveStartForElement(w,0);if(!Number.isFinite(R))continue;let N=h.resolveDurationForElement(w);N!=null?b.push(Math.max(0,R)+N):(ge(w)||ih(w))&&b.push(null)}oh(c)&&b.push(null);let v=rr({authoredDurationSeconds:null,clipEndsSeconds:b});return v.pendingClips>0?{...v,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:v},yo=null,ah=()=>{if(Rn)return pl();let c=Tn();return yo?.revision!==c&&(yo={revision:c,result:pl()}),yo.result},sh=c=>{window.__hf=window.__hf||{},window.__hf.durationSource={source:c.source,seconds:c.seconds,pendingClips:c.pendingClips},c.source==="derived"&&L("composition_duration_derived",{source:c.source,seconds:c.seconds,pendingClips:c.pendingClips},`composition_duration_derived:${c.seconds}`)},lh=()=>{let c=Cn();return typeof c!="number"||!Number.isFinite(c)||c<=F?null:c},uh=c=>de(c)?Math.max(F,c*S):F,hl=()=>{let c=0;for(let h of e.deterministicAdapters){let b=h.getInferredDurationSeconds;if(typeof b!="function")continue;let v=null;try{v=b()}catch(w){D("runtime.init.adapterDuration",w)}typeof v=="number"&&Number.isFinite(v)&&v>0&&(c=Math.max(c,v))}return c>F?c:null},Rn=!1,gl=()=>Rn&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,ch=["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",xi,"data-playback-rate","data-automation","data-playback-start","data-media-start","id","src"],bl=["loadedmetadata","durationchange","emptied"],Or=null,xl=-1,yl=null,Dt=null,Sl=0,Kt=()=>{},Yt=()=>{Sl+=1,Kt()},vl=()=>({media:lh(),authoredComposition:ut()}),dh=()=>{let c=window.__timelines??{},h="";for(let b of Object.keys(c)){let v=c[b];v&&(h+=`${b}=${Ee(v)??"?"};`)}return h},mh=()=>{if(!(Dt||typeof MutationObserver>"u")){Dt=new MutationObserver(Yt),Dt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:ch});for(let c of bl)document.addEventListener(c,Yt,!0);a.push(()=>{Dt?.disconnect(),Dt=null,Yt();for(let c of bl)document.removeEventListener(c,Yt,!0)})}},Tn=()=>{mh(),Dt&&Dt.takeRecords().length>0&&Yt();let c=dh();return c!==yl&&(yl=c,Yt()),Sl},Al=c=>Rn?vl():(c??(c=Tn()),Or&&xl===c||(xl=c,Or=vl()),Or),ze=(c,h=0,b)=>{let v=Ee(c),{media:w,authoredComposition:R}=Al(b),N=hl(),B=Math.max(w??0,R??0,N??0),$=Number.isFinite(h)&&h>F?h:0,ne=0,he=null;return de(v)?ne=Math.max(v,B,$):de(B)?ne=Math.max(B,$):$>0?ne=$:(he=ah(),ne=he.seconds??0),he?sh(he):window.__hf?.durationSource&&delete window.__hf.durationSource,ne>0?Math.max(0,ne):0},So=()=>{let c=window.__timelines??{},h=me=>{let se=Object.entries(c).filter(fe=>!!fe[1]&&typeof fe[1].play=="function"&&typeof fe[1].pause=="function");if(se.length!==1)return{timeline:null};let oe=se[0];if(!oe)return{timeline:null};let[ve,_e]=oe;return{timeline:_e,selectedTimelineIds:[ve],selectedDurationSeconds:Ee(_e),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:me,soleTimelineId:ve}}}},b=tt({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),{media:v,authoredComposition:w}=Al(),R=Math.max(v??0,w??0)||null,N=uh(R),B=me=>{let se=document.querySelector(`[data-composition-id="${CSS.escape(me)}"]`);return se?b.resolveStartForElement(se,0):0},$=me=>{let se=window.gsap;if(!se||typeof se.timeline!="function")return null;let oe=se.timeline({paused:!0});for(let ve of me)oe.add(ve.timeline,B(ve.compositionId));return oe},ne=(me,se)=>{if(!de(me))return null;let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let ve=oe.timeline({paused:!0});if(se)try{ve.add(se,0)}catch(fe){D("runtime.init.site2",fe)}let _e=ve;if(typeof _e.to=="function")try{_e.to({},{duration:me})}catch(fe){D("runtime.init.site3",fe)}return ve},he=(me,se)=>{if(!me||typeof me.getChildren!="function")return[];try{let oe=me.getChildren(!0,!0,!0);return Array.isArray(oe)?se.filter(ve=>oe.includes(ve.timeline)):[]}catch{return[]}},He=(me,se)=>{let oe=me,ve={addedIds:[],nested:[]};if(typeof oe.getChildren!="function")return ve;try{let _e=oe.getChildren(!0,!0,!0)??[];if(!Array.isArray(_e))return ve;let fe=[];for(let Ce of se)if(!_e.some(ct=>ct===Ce.timeline))try{let ct=B(Ce.compositionId);me.add(Ce.timeline,ct),fe.push(Ce.compositionId)}catch(ct){D("runtime.init.site4",ct)}return{addedIds:fe,nested:he(me,se)}}catch{return ve}},ie=Y(),X=ie?.getAttribute("data-composition-id")??null;if(!X)return h("root_missing_composition_id");let we=c[X]??null,Ne=(()=>{if(!ie)return[];let me=new Set,se=Array.from(ie.querySelectorAll("[data-composition-id]")),oe=[];for(let ve of se){let _e=ve.getAttribute("data-composition-id");if(!_e||_e===X||me.has(_e))continue;me.add(_e);let fe=c[_e]??null;if(!fe||typeof fe.play!="function"||typeof fe.pause!="function")continue;let Ce=Ee(fe);oe.push({compositionId:_e,timeline:fe,durationSeconds:Ce??0})}return oe})(),Qe=me=>{for(let se of me){let oe=se.timeline;if(typeof oe.paused=="function")try{oe.paused(!1)}catch(ve){D("runtime.init.site5",ve)}}};if(we){let me=Ne.length>0?He(we,Ne):{addedIds:[],nested:[]},se=me.addedIds;if(Qe(me.nested),(Ne.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+X+"'])"))&&(Gr=!0),se.length>0)try{let fe=we.time();we.seek(fe,!1)}catch{}let oe=Ee(we);if(!de(oe)&&Ne.length>0){let fe=Ne.map(zh=>zh.compositionId),Ce=$(Ne),Jt=Ee(Ce);if(Ce&&de(Jt))return Qe(he(Ce,Ne)),{timeline:Ce,selectedTimelineIds:fe,selectedDurationSeconds:Jt,mediaDurationFloorSeconds:v,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:X,rootDurationSeconds:oe,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:N,selectedDurationSeconds:Jt,mediaDurationFloorSeconds:v,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:fe,autoNestedChildren:se}}};let ct=ne(R??0,we),Po=Ee(ct);if(ct&&de(Po))return{timeline:ct,selectedTimelineIds:[X],selectedDurationSeconds:Po,mediaDurationFloorSeconds:v,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:oe,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:v,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Po,selectedTimelineIds:[X],autoNestedChildren:se}}}}if(!de(oe)&&Ne.length===0){let fe=ne(R??0,we),Ce=Ee(fe);if(fe&&de(Ce))return{timeline:fe,selectedTimelineIds:[X],selectedDurationSeconds:Ce,mediaDurationFloorSeconds:v,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:oe,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:v,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ce,selectedTimelineIds:[X]}}}}let ve=Fe(ie?.getAttribute("data-duration")),_e=Math.max(de(ve)?ve:0,w??0);if(_e>0&&de(_e)&&de(oe)&&_e>=oe+.5){let fe=we;if(typeof fe.to=="function")try{fe.to({},{duration:0},_e)}catch(Jt){D("runtime.init.site6",Jt)}let Ce=Ee(we);if(de(Ce))return{timeline:we,selectedTimelineIds:[X],selectedDurationSeconds:Ce,mediaDurationFloorSeconds:v,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:X,rootDurationSeconds:oe,rootDeclaredDur:ve,authoredCompositionDurationFloorSeconds:w,newDur:Ce}}}}return{timeline:we,selectedTimelineIds:[X],selectedDurationSeconds:oe,mediaDurationFloorSeconds:v,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:X,selectedDurationSeconds:oe,autoNestedChildren:se}}:void 0}}if(Ne.length>0){let me=Ne.map(ve=>ve.compositionId),se=$(Ne),oe=Ee(se);if(se)return Qe(he(se,Ne)),{timeline:se,selectedTimelineIds:me,selectedDurationSeconds:oe,mediaDurationFloorSeconds:v,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:X,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:N,selectedDurationSeconds:oe,mediaDurationFloorSeconds:v,selectedTimelineIds:me}}}}return h("root_composition_id_unmatched_in_registry")},Gr=!1,fh=c=>{let h=window.gsap,b=c;if(!(!b||typeof b.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let v of b.getChildren(!0,!0,!0)){let w=v,R=w.timeline;if(!R||!("_ease"in R)||typeof R._ease=="function")continue;let N=w.vars?.keyframes,$=(N&&!Array.isArray(N)?N.ease:void 0)??w.vars?.ease??"none";try{let ne=h.parseEase($);typeof ne=="function"&&(R._ease=ne)}catch(ne){Be("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),D("runtime.keyframeEase.repair",ne)}}},kn=()=>{if(x(),!Q)return!1;let c=e.capturedTimeline,h=Ee(c),b=de(h);if(c&&b&&Gr)return!1;let v=So();if(!v.timeline)return!1;if(c&&c===v.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=v.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),fh(e.capturedTimeline);let w=ze(e.capturedTimeline,0);if(w<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),lt(e.capturedTimeline)),w>0){try{f.setDuration(w)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let N=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(N,!1),lt(e.capturedTimeline)}let R=window.__hfStudioManualEditsApply;typeof R=="function"&&R(),Ki(document)}if(v.diagnostics&&ye({source:"hf-preview",type:"diagnostic",code:v.diagnostics.code,details:v.diagnostics.details}),ye({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:v.selectedTimelineIds??[],selectedDurationSeconds:v.selectedDurationSeconds??null,mediaDurationFloorSeconds:v.mediaDurationFloorSeconds??null}}),window.parent!==window){let R=Y(),N=w>0?w:0,B=String(N>0?N:1),$=new Set,ne=ie=>ie.tagName.toLowerCase()===an,he=new Set(document.querySelectorAll("[data-start]")),He=ie=>{let X=ie.parentElement;for(;X&&X!==R;){if(he.has(X))return!0;X=X.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ie of e.capturedTimeline.getChildren(!0))if(typeof ie.targets=="function")for(let X of ie.targets())Ae(X)&&X!==R&&(ne(X)||X.hasAttribute("data-start")||He(X)||$.has(X)||($.add(X),X.setAttribute("data-start","0"),X.setAttribute("data-duration",B),X.setAttribute("data-hf-autostamped","1")))}catch{}if(Ae(R))for(let ie of R.querySelectorAll("[id]"))Ae(ie)&&ie!==R&&(ie.hasAttribute("data-start")||He(ie)||$.has(ie)||ie.tagName==="SCRIPT"||ie.tagName==="STYLE"||ie.tagName==="LINK"||ne(ie)||($.add(ie),ie.setAttribute("data-start","0"),ie.setAttribute("data-duration",B),ie.setAttribute("data-hf-autostamped","1")))}for(let R of Mn)Hr.delete(R),kl(R);return!0},El=()=>{if(e.tornDown)return;let c=So();if(!c.timeline){e.capturedTimeline=null,Gr=!1,f.setDuration(0),zr(e.currentTime);return}e.capturedTimeline!==c.timeline&&(Gr=!1,kn()),zr(e.currentTime)};t=()=>{El(),yt()},window.__hfForceTimelineRebind=El;let ph=()=>{let c=Y();if(!Ae(c))return;let h=c.getBoundingClientRect(),b=Number(c.getAttribute("data-width")),v=Number(c.getAttribute("data-height")),w=window.getComputedStyle(c),R=Number.isFinite(b)&&b>0&&Number.isFinite(v)&&v>0,N=h.width<=0||h.height<=0||c.clientWidth<=0||c.clientHeight<=0;!R||!N||L("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:b,declaredHeight:v,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:w.display,visibility:w.visibility,overflow:w.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},hh=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,ph()}))},gh=()=>{i=c=>{let h=I(c.error??c.message).slice(0,T);if(!h)return;let b=H(h);ye({source:"hf-preview",type:"diagnostic",code:b.code,details:{category:b.category,message:h,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},o=c=>{let h=I(c.reason).slice(0,T);if(!h)return;let b=H(h);ye({source:"hf-preview",type:"diagnostic",code:`${b.code}_unhandled_rejection`,details:{category:`${b.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},bh=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let b of c){let v=()=>{if(!Me(b))return;let w=b.tagName.toLowerCase(),R=b.getAttribute("src")??b.getAttribute("href")??b.getAttribute("poster")??null,N=w==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";L(N,{tagName:w,assetUrl:R,currentSrc:(De(b)||ge(b))&&b.currentSrc||null,readyState:ge(b)?b.readyState:null,networkState:ge(b)?b.networkState:null},`${N}:${w}:${R??"unknown"}`)};b.addEventListener("error",v),C(()=>{b.removeEventListener("error",v)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let b=Array.from(h).filter(v=>v.status==="error").map(v=>v.family).filter(v=>!!v).slice(0,10);b.length!==0&&L("runtime_font_load_issue",{failedFamilies:b,totalFaces:Array.from(h).length},`runtime-font-load-issue:${b.join("|")}`)}).catch(()=>{})},xh=(c,h)=>{if(!c.timeline)return!1;let b=e.capturedTimeline;if(b&&b===c.timeline)return!1;let v=Math.max(0,e.currentTime||0),w=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{lt(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(v,!1),w&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(R){D("runtime.init.site7",R)}return ye({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:v,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},It=null,wl=!1,Mn=new Set,Hr=new WeakMap,Br=()=>{e.tornDown||(It!=null&&window.clearTimeout(It),It=window.setTimeout(()=>{if(e.tornDown||(It=null,gl()))return;let c=So();if(!c.timeline||!de(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){kn()&&(yt(),Pe(!0));return}if(wl)return;let b=Ee(e.capturedTimeline),v=c.selectedDurationSeconds??Ee(c.timeline);de(v)&&(!de(b)||v>=b+A)&&xh(c,"manual")&&(wl=!0,ye({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:b??null,selectedDurationSeconds:v??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),yt(),Pe(!0))},E))},_l=c=>{ge(c.currentTarget)&&gc(c.currentTarget)},Cl=c=>{ge(c.currentTarget)&&bc(c.currentTarget)},Rl=c=>{Vo(c)&&ep(c)&&En(c,An(c))},Tl=c=>{let h=c.currentTarget;ge(h)&&Rl(h)},yh=()=>{for(let c of Mn)c.removeEventListener("loadedmetadata",Br),c.removeEventListener("durationchange",Br),c.removeEventListener("loadedmetadata",_l),c.removeEventListener("loadedmetadata",Tl),c.removeEventListener("error",Cl);Mn.clear()},vo=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let h of c){if(Mn.has(h))continue;Mn.add(h);let b=Number.parseFloat(h.dataset.volume??"");Number.isFinite(b)&&(h.volume=Math.max(0,Math.min(1,b))),h.addEventListener("loadedmetadata",Br),h.addEventListener("durationchange",Br),h.addEventListener("loadedmetadata",Tl),Rl(h),h.addEventListener("loadedmetadata",_l),h.addEventListener("error",Cl),hc(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),kl(h)}},kl=c=>{Hr.has(c)||ac(c,e.capturedTimeline,ze(e.capturedTimeline,0),Hr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Ao=new WeakMap,Sh=c=>{let h=Ao.get(c);if(h!==void 0)return h;let b=window.getComputedStyle(c).position,v=b==="static"||b==="relative"||b==="sticky";return Ao.set(c,v),v},Eo=new WeakMap,vh=c=>{let h=Eo.get(c);if(h!==void 0)return h;let b=c.querySelector("[data-start]")===null;return Eo.set(c,b),b},Ah=()=>{Ao=new WeakMap,Eo=new WeakMap},wo=new WeakSet,_o=new WeakMap,Ur=new WeakSet,Wr=!1,Ml=c=>c.matches("audio[data-start]")||c.querySelector("audio[data-start]")!==null,Fl=new WeakMap,Vr=!0,Eh=()=>{if(Vr){Vr=!1;for(let c of document.querySelectorAll(an)){let h=c.hasAttribute("data-hidden");Fl.get(c)!==h&&(Fl.set(c,h),c.id&&m.setGroupMuted(c.id,h))}}},wh=(c,h,b)=>{let v=Y(),w=ze(e.capturedTimeline,0,b);for(let R of h){if(!Ae(R))continue;if(R.hasAttribute("data-hidden")){Ur.has(R)||(_o.set(R,R.style.getPropertyValue("display")),Ur.add(R),Ml(R)&&(Wr=!0),Vr=!0),R.style.display="none",(pe(R)||De(R))&&r?.setSourceVisibility(R,!1);continue}if(Ur.has(R)){let B=_o.get(R);B?R.style.display=B:R.style.removeProperty("display"),_o.delete(R),Ur.delete(R),Ml(R)&&(Wr=!0),Vr=!0}let N=ce(R,c,w);if(N){let B=R.parentElement;for(;B&&B!==v;){if(Ae(B)&&B.hasAttribute("data-start")&&!ce(B,c,w)){N=!1;break}B=B.parentElement}}R.style.visibility=N?"visible":"hidden",(pe(R)||De(R))&&r?.setSourceVisibility(R,N),N?wo.has(R)&&(R.style.removeProperty("display"),wo.delete(R)):Sh(R)&&vh(R)&&(R.style.display="none",wo.add(R))}Wr&&f.isPlaying()&&(m.stopAll(),Do()),Wr=!1,Eh()},zr=(c,h=Array.from(document.querySelectorAll("[data-start]")),b)=>z(()=>wh(c,h,b)),Fn=null,Nn=null,qr=[],Nl=c=>c.hasAttribute("data-start")||!!q(c).compositionRoot,Co=c=>cc({elements:c,shouldIncludeElement:Nl,resolveStartSeconds:h=>Z(h),resolveDurationSeconds:h=>{let b=q(h),v=Z(h),w=b.inheritedStart!=null&&b.inheritedDuration!=null&&b.inheritedDuration>0?Math.max(0,b.inheritedStart+b.inheritedDuration-v):null,R=Number.isFinite(h.duration)?et(h,h.duration):null,N=Fe(h.dataset.duration),B=N!=null&&N>0?N:null;return uc({isVideo:h.tagName==="VIDEO",sourceDuration:R,hostRemaining:w,explicitDuration:B})}}),_h=()=>{let c=Tn();if(Fn&&Fn.revision===c)return Fn;let h=Co().mediaClips;return Fn={revision:c,clips:h,byStart:[...h].sort((b,v)=>b.start-v.start),byEnd:[...h].sort((b,v)=>b.end-v.end)},Nn=null,qr=[],Fn},Ll=(c,h,b,v)=>{let w=0,R=c.length;for(;w<R;){let B=w+R>>1;h(c[B])<b?w=B+1:R=B}let N=[];for(let B=w;B<c.length&&h(c[B])<=v;B+=1)N.push(c[B]);return N},Ch=(c,h)=>{let b=Nn;if(b===null)return c.clips.map(N=>N.el);let v=Math.min(b,h),w=Math.max(b,h),R=new Set;for(let N of qr)R.add(N.el);for(let N of Ll(c.byStart,B=>B.start,v,w))R.add(N.el);for(let N of Ll(c.byEnd,B=>B.end,v,w))R.add(N.el);return[...R]},$r=new WeakSet,Dl=c=>{$r.add(c)},Il=c=>{$r.delete(c)};window.__hf.leasePausedMedia=Dl,window.__hf.releasePausedMedia=Il;let Rh=()=>{for(let c of document.querySelectorAll("video, audio"))if(ge(c)&&!c.paused&&Nl(c)&&!$r.has(c))return!0;return!1},Pl=()=>Kt();document.addEventListener("play",Pl,!0),a.push(()=>{document.removeEventListener("play",Pl,!0)});let Ge=c=>{let h=!Rn,b=z(()=>{if(!h)return Co().mediaClips;let R=_h();return Co(Ch(R,e.currentTime)).mediaClips});for(let R of b){let N=Hr.get(R.el);N&&(R.volumeKeyframes=N)}let v=e.isPlaying?b:b.filter(R=>!$r.has(R.el)),w=e.mediaForceSyncNextTick;w&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||(dc({clips:v,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:w,getCompositionDuration:()=>ze(e.capturedTimeline,0,c),onElementVolume:(R,N,B)=>m.setElementVolume(R,B),isWebAudioOwned:R=>m.ownsElement(R),isWebAudioRouted:R=>m.routesElement(R),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,ye({source:"hf-preview",type:"media-autoplay-blocked"}))}}),h?(Nn=e.currentTime,qr=b.filter(R=>vt(e.currentTime,R.start,R.end))):(Nn=null,qr=[])),zr(e.currentTime,void 0,c)},Pe=c=>{c&&Kt();let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),b=Date.now();(c||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||b-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=b,ye({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Ro="",Ol=!1,Gl=!1,Hl=0,Th=()=>{let c="";for(let h of document.querySelectorAll("[data-start]"))c+=`${h.id}:${h.tagName}|`;return c},yt=()=>{W(),M(),te();let c=Y();if(c){let v=j(c.getAttribute("data-width")),w=j(c.getAttribute("data-height")),R=v?parseInt(v,10):0,N=w?parseInt(w,10):0;R>0&&N>0&&ye({source:"hf-preview",type:"stage-size",width:R,height:N})}kn();let h=ed({canonicalFps:e.canonicalFps});window.__clipManifest=h;let b=Th();if(Ro!==b&&Ah(),!window.__clipTree||Ro!==b){let v=window;window.__clipTree=Xc({startResolver:tt({timelineRegistry:v.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:v.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Ro=b}ye({...h,assetsReady:Gl}),Ol||(Ol=!0,fp(document,({timedOut:v})=>{e.tornDown||(Gl=!0,ye({source:"hf-preview",type:"assets-ready",timedOut:v}))})),hh()},To=c=>typeof c=="number"&&Number.isFinite(c)&&c>0?c:0,kh=c=>{let h=To(Number(c));if(h<=0)return;let b=Y(),v=To(Fe(b?.getAttribute("data-duration"))),w=Math.max(Hl,To(f.getDuration()),v);h<=w||(Hl=h,b?.setAttribute("data-duration",String(h)),f.setDuration(h),yt(),Pe(!0))},qe=(c,h=0)=>{for(let b of e.deterministicAdapters){try{c==="discover"&&b.discover(),c==="pause"&&b.pause(),c==="play"&&b.play&&b.play()}catch(v){D("runtime.init.site8",v)}if(c==="discover")try{b.seek({time:h,suppressEvents:!0})}catch(v){D("runtime.init.site9",v)}}},Pt=()=>{window.__renderReady=!1},Mh=Ap(()=>{let c=[];for(let h of e.deterministicAdapters){let b=h.getReadyPromise;if(typeof b=="function")try{let v=b();v&&c.push(v)}catch(v){D("runtime.init.adapterReady",v)}}return c},()=>Pt(),c=>D("runtime.init.adapterReady",c)),Fh=Ap(()=>{let c=window.__hf?.buildReady;return c?Object.values(c).filter(h=>h!=null&&typeof h.then=="function"):[]},()=>Pt(),c=>D("runtime.init.buildReady",c));if(Q)Es();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:j,onDiagnostic:({code:h,details:b})=>{ye({source:"hf-preview",type:"diagnostic",code:h,details:b})}};Xm(c).then(()=>Ym(c)).finally(()=>{Q=!0,vo(),bh(),Es(),Ms(document),Pt()})}let jr=qc({postMessage:c=>ye(c)});jr.installPickerApi(),zr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let Je=Pf({lease:Dl,release:Il});r=Je,C(()=>{Je.destroy(),r=null});let ko=c=>{let h=Number(c);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let b=document.querySelectorAll("video, audio");for(let v of b)if(ge(v))try{v.playbackRate=e.playbackRate}catch(w){D("runtime.init.site10",w)}},Bl={play:()=>{let c=e.capturedTimeline;if(f.isPlaying())return;let h=ze(c,0);if(h>0)f.setDuration(h),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Ot(0));else{let b=Y(),v=Number(b?.getAttribute("data-duration")??0);v>0&&f.setDuration(v)}lt(c),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Yl(f.now()),p&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Do(),qe("play"),Ge(),Je.redraw(),Pe(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Yl(e.currentTime);let c=e.capturedTimeline;lt(c),qe("pause"),Ge(),Je.redraw(),Pe(!0)},seek:(c,h)=>{let b=Pa(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let v=f.isPlaying();v&&f.pause(),f.seek(b),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let w=e.capturedTimeline;if(lt(w),Ot(e.currentTime),qe("pause"),h?.keepPlaying&&v){Bl.play();return}Ge(),Je.redraw(),Pe(!0)},renderSeek:(c,h)=>{Rn=!0;let b=Qn(Math.max(0,Number(c)||0),e.canonicalFps,h?.subFrameDivisions);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(b),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Ot(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),qe("pause"),Ge(),Je.redraw(),Pe(!0)},getTime:()=>f.now(),getDuration:()=>{let c=f.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:c=>{ko(c),f.setRate(e.playbackRate),Xl()},getPlaybackRate:()=>e.playbackRate},Ul=ze(e.capturedTimeline,0);Ul>0&&f.setDuration(Ul);let $e=Kc({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:ko,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,h)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Ge()},onStatePost:Pe,onDeterministicSeek:(c,h)=>{for(let b of e.deterministicAdapters)if(!(b.name==="gsap"&&e.capturedTimeline))try{b.seek({time:Number(c)||0,suppressEvents:h?.suppressEvents})}catch(v){D("runtime.init.site11",v)}},onDeterministicPause:()=>qe("pause"),onDeterministicPlay:()=>qe("play"),onRenderFrameSeek:()=>{Je.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>ze(e.capturedTimeline,0),transport:Bl});window.__player=P($e),window.__playerReady=!0,Be("composition_loaded",{duration:$e.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[rc(),fu({resolveStartSeconds:c=>G(c,0)}),hu(),bu(),Su(),vu(),Au(),Eu(),wu(),_u(),Cu(),pu({getTimeline:()=>e.capturedTimeline})],ku(),Mu(),window.__hfReseekGpu=c=>{let h=Math.max(0,Number(c)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,ai(h)},window.__hfWaitForSeekCompletion=Yo,a.push(()=>{window.__hfWaitForSeekCompletion===Yo&&delete window.__hfWaitForSeekCompletion}),gh(),vo(),qe("discover");let Nh=()=>{let c=e.capturedTimeline,h=kn();e.capturedTimeline&&(h||e.capturedTimeline!==c||!$e._timeline)&&($e._timeline=e.capturedTimeline);let b=ze(e.capturedTimeline,0);if(b>0&&f.setDuration(b),qe("discover",e.currentTime),!e.capturedTimeline){let v=window.__timelines??{},w=Object.keys(v).filter(R=>v[R]);if(w.length>0){let N=Y()?.getAttribute("data-composition-id")??null;L("root_timeline_unbound_registry_present",{reason:N?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:N,registeredTimelineKeys:w},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(N?`Root data-composition-id is "${N}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${w.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${N??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,yt(),Pe(!0)},Xt=null,Lh=()=>{if(Xt)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),Xt=null,Pt()};Xt=c,window.addEventListener("hf-timelines-built",c)};C(()=>{Xt&&(window.removeEventListener("hf-timelines-built",Xt),Xt=null)}),Pt=()=>{if(!Q){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Lh();return}if(qe("discover",e.currentTime),!Mh()){window.__renderReady=!1;return}if(!Fh()){window.__renderReady=!1;return}Nh()},Pt(),Q&&setTimeout(()=>{Pt()},0);let Kr=0,Yr=!1,Mo=Number.NaN,Fo=null,Xr=!1,St=null,Jr=!1,Wl="",Vl=-1,Qr=!1,zl=Number.NEGATIVE_INFINITY,Dh=(c,h,b,v)=>{try{let w=v?.suppressEvents===!0;lt(c),typeof c.totalTime=="function"?c.totalTime(h,w):c.seek(h,w)}catch(w){D(b,w)}},Ih=(c,h)=>{let b=window.__timelines??{},v=Y()?.getAttribute("data-composition-id")??null;for(let[w,R]of Object.entries(b)){if(!R||w===v)continue;let N=document.querySelector(`[data-composition-id="${CSS.escape(w)}"]`);if(!N)continue;let B=G(N,0);if(!Number.isFinite(B))continue;let $=Ee(R),ne=nt(N)+hi(_t(N),Math.max(0,c-B)),he=Math.max(0,$!=null&&$>0?Math.min($,ne):ne);Dh(R,he,"runtime.init.transport.childTimeline",h)}},Ph=c=>{let h=window.__timelines??{},b=[];for(let v of Object.values(h))if(!(!v||v===c)){b.push(v);try{v.play()}catch(w){D("runtime.init.activateSiblings",w)}}return b},ql=c=>typeof c=="object"&&c!==null,Ln=new WeakMap,Oh=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],$l=(c,h)=>{let b=c[h];if(typeof b!="function")return null;try{let v=Number(b.call(c));return Number.isFinite(v)?v:null}catch(v){return D("runtime.init.gsapCallbackDuration",v),null}},Gh=c=>{let h=Ln.get(c);if(h!=null)return h;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let b;try{b=c.getChildren(!0,!0,!0)}catch(v){return D("runtime.init.gsapCallbackChildren",v),Ln.set(c,!1),!1}if(!Array.isArray(b))return Ln.set(c,!1),!1;for(let v of b){if(!ql(v))continue;let w=v.vars;if(!ql(w)||!Oh.some($=>typeof w[$]=="function"))continue;let B=$l(v,"totalDuration")??$l(v,"duration");if(B!=null&&B<=1e-6)return Ln.set(c,!0),!0}return Ln.set(c,!1),!1};function Ot(c,h){let b=e.capturedTimeline,v=b&&h?.activateChildren?Ph(b):[];try{Hh(b,c,h)}finally{for(let w of v)lt(w)}}function Hh(c,h,b){let v=b?.suppressEvents===!0;if(c){let w=c,R=h;if(typeof w.totalDuration=="function")try{let N=Number(w.totalDuration());Number.isFinite(N)&&N>0&&h>N&&(R=N)}catch(N){D("runtime.init.transport.clampDuration",N)}try{typeof c.totalTime=="function"?(c.totalTime(R,v),!v&&!Gh(c)&&(c.totalTime(R+.001,!0),c.totalTime(R,!0))):c.seek(R,v)}catch(N){D("runtime.init.transport.seek",N)}}Ih(h,b);for(let w of e.deterministicAdapters)if(!(w.name==="gsap"&&c))try{w.seek({time:h,suppressEvents:v})}catch(R){D("runtime.init.transport.adapter",R)}}let No=rp(document,()=>{Kt()});a.push(()=>No.disconnect());let Bh=()=>{try{return No.isActive()}catch{return!1}},Uh=()=>!f.isPlaying()&&!gl()&&No.observing&&!Xr&&!Qr&&e.currentTime===Mo&&e.capturedTimeline===Fo,jl=()=>`${Tn()}|${hl()??""}`,Kl=()=>{St=window.setTimeout(Wh,e.bridgeMaxPostIntervalMs)},Wh=()=>{if(St=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(jl()!==Wl){Kt();return}Pe(!1),Kl()}},Vh=()=>{if(e.transportRafId=null,e.tornDown)return;let c=Jr;if(Jr=!1,c||!Uh()){e.transportRafId=window.requestAnimationFrame(Lo);return}Wl=jl(),Kl()};Kt=()=>{e.tornDown||(Jr=!0,!(Yr||e.transportRafId!=null)&&(St!=null&&(window.clearTimeout(St),St=null),Jr=!1,e.transportRafId=window.requestAnimationFrame(Lo)))};let Lo=()=>{if(!(e.tornDown||Yr)){Yr=!0;try{Kr+=1;let c=Tn();c!==Vl&&(Vl=c,Qr=!0);let h=Date.now(),b=Qr&&!f.isPlaying()&&h-zl>=ip;if(b&&(zl=h),op({tick:Kr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now(),compositionChanged:b})){let N=e.capturedTimeline;if(kn()){e.capturedTimeline&&!$e._timeline&&($e._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==N&&lt(e.capturedTimeline);let B=ze(e.capturedTimeline,0,c);B>0&&f.setDuration(B),yt()}}if((b||Kr%20===0)&&(yt(),Qr=!1),(b||Kr%30===0)&&vo(),e.capturedTimeline){let N=ze(e.capturedTimeline,0,c);N>0&&(!f.isPlaying()||N>=f.getDuration())&&f.setDuration(N)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let N=m.getTime();N>=0&&f.attachAudioSource({currentTimeSeconds:N})}else{let N=document.querySelectorAll("audio[data-start]"),B=!1;for(let $ of N){if(!ge($)||!$.isConnected||g($))continue;let ne=Z($),he=Fe($.dataset.duration),He=he!=null&&he>0?ne+he:1/0,ie=nt($);if(Number.isFinite(ne)&&vt(e.currentTime,ne,He)){$.paused?!$.error&&$.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),B=!0):(f.attachAudioSource({el:$,compositionStart:ne,mediaStart:ie,rate:_t($)}),B=!0);break}}!B&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let v=f.now();e.currentTime=v;let w=f.isPlaying();if(!w&&Bh()?Xr=!0:(w||Xr||v!==Mo||e.capturedTimeline!==Fo)&&(Ot(v),Mo=v,Fo=e.capturedTimeline,w||(Xr=!1)),w&&Je.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let N=f.getDuration();Number.isFinite(N)&&(f.seek(N),e.currentTime=N,Ot(N)),qe("pause"),Ge(c),Pe(!0);return}f.isPlaying()?Ge(c):Rh()&&(Nn=null,Ge(c)),Pe(!1)}finally{Yr=!1,Vh()}}},Yl=c=>{let h=document.querySelectorAll("video, audio");for(let b of h){if(!ge(b)||!b.isConnected||!b.hasAttribute("data-start"))continue;let v=Z(b);if(!Number.isFinite(v))continue;let w=Fe(b.dataset.duration),R=w!=null&&w>0?v+w:1/0;if(!vt(c,v,R))continue;let N=nt(b),B=c-v+N;if(B>=0)try{b.currentTime=B}catch{}}},Do=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let b of h){if(!ge(b)||!b.isConnected||g(b))continue;let v=Z(b);if(!Number.isFinite(v))continue;let w=nt(b),R=Number.parseFloat(b.dataset.volume??""),N=Number.isFinite(R)?R:1,B=Fe(b.dataset.duration),$=B!=null&&B>0?B:Number.POSITIVE_INFINITY,ne=b.closest("[data-composition-id]");if(ne){let ie=G(ne,0),X=O(ne,{includeAuthoredTimingAttrs:!0});X!=null&&X>0&&($=Math.min($,Math.max(0,ie+X-v)))}let he=An(b);if(En(b,he),typeof _t(b)!="number")continue;(he.kind==="web-audio"?m.scheduleMediaElementPlayback(b,v,w,f.now(),N,c,e.playbackRate):Promise.resolve(null)).then(ie=>{if(ie||!f.isPlaying())return;let X=e.playbackRate*Oe(b),we=b.hasAttribute("data-fx-chain")||b.hasAttribute("data-automation");if(Math.abs(X-1)>1e-9){he.kind==="web-audio"&&we&&(b.muted=!0);return}m.decodeAudioElement(b).then(Gt=>{!Gt||!f.isPlaying()||m.schedulePlayback(b,Gt,v,w,f.now(),N,c,e.playbackRate,$)})})}};function Xl(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&p&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),Do())}if(e.capturedTimeline){let c=ze(e.capturedTimeline,0);c>0&&f.setDuration(c),lt(e.capturedTimeline)}nf(window),e.transportRafId=window.requestAnimationFrame(Lo),yt(),Pe(!0),e.controlBridgeHandler=eu({onPlay:()=>{$e.play(),Be("composition_played",{time:$e.getTime()})},onPause:()=>{$e.pause(),Be("composition_paused",{time:$e.getTime()})},onStopMedia:()=>{m.stopAll();let c=document.querySelectorAll("video, audio");for(let h of c)ge(h)&&!h.paused&&h.pause()},onSeek:(c,h)=>{$e.seek(c),Be("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let h=c||e.mediaOutputMuted;m.setMuted(h);let b=document.querySelectorAll("video, audio");for(let v of b)ge(v)&&(v.muted=h||v.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,m.setVolume(c);let h=document.querySelectorAll("video, audio");for(let b of h){if(!ge(b))continue;let v=parseFloat(b.dataset.volume??""),w=Number.isFinite(v)?v:1;b.volume=ui(w*c)}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let h=c||e.bridgeMuted;m.setMuted(h);let b=document.querySelectorAll("video, audio");for(let v of b)ge(v)&&(v.muted=h||v.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(m.stopAll(),f.detachAudioSource()):Ge())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(m.stopAll(),f.detachAudioSource()),Ge())},onSetPlaybackRate:c=>{ko(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Xl()},onSetRootDuration:kh,onSetColorGrading:(c,h)=>{Je.setGrading(c,h)},onSetColorGradingCompare:(c,h)=>{Je.setCompare(c,h)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let c=f.now();if(e.currentTime=c,Ot(c),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let h=f.getDuration();Number.isFinite(h)&&(f.seek(h),e.currentTime=h,Ot(h)),qe("pause"),Ge(),Pe(!0)}},onEnablePickMode:()=>jr.enablePickMode(),onDisablePickMode:()=>jr.disablePickMode(),onSetRuntimeData:uo,onClearRuntimeData:co,getCanonicalFps:()=>e.canonicalFps});let Io=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),St!=null&&(window.clearTimeout(St),St=null),e.transportClock=null,m.destroy(),It!=null&&(window.clearTimeout(It),It=null),s!=null&&(window.cancelAnimationFrame(s),s=null),yh(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),jr.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(h){D("runtime.init.site12",h)}e.deterministicAdapters=[],window.__hf?.buildReady&&(window.__hf.buildReady={});for(let c of a.splice(0))try{c()}catch(h){D("runtime.init.site13",h)}for(let c of e.injectedCompStyles)try{c.remove()}catch(h){D("runtime.init.site14",h)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(h){D("runtime.init.site15",h)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(h){D("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===Io&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Io,e.beforeUnloadHandler=Io,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var wp=["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"],ol=[[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 r1(e){if(e<=255)return wp[e];let t=0,n=ol.length-1;for(;t<=n;){let r=t+n>>1,i=ol[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function i1(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let d=e.charCodeAt(u),f=d,m=1;if(d>=55296&&d<=56319&&u+1<t){let g=e.charCodeAt(u+1);g>=56320&&g<=57343&&(f=(d-55296<<10)+(g-56320)+65536,m=2)}let p=r1(f);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let g=0;g<m;g++)n[u+g]=p;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let d=n[u];if(d==="L"){i=0;break}if(d==="R"||d==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let d;for(d=u-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=u+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let u=0;u<t;u++){let d=n[u];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let d=u+1;for(;d<t&&n[d]==="ON";)d++;let f=u>0?n[u-1]:l,m=d<t?n[d]:l,p=f!=="L"?"R":"L";if(p===(m!=="L"?"R":"L"))for(let y=u;y<d;y++)n[y]=p;u=d-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let d=n[u];(o[u]&1)===0?d==="R"?o[u]++:(d==="AN"||d==="EN")&&(o[u]+=2):(d==="L"||d==="AN"||d==="EN")&&o[u]++}return o}function _p(e,t){let n=i1(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var o1=/[ \t\n\r\f]+/g,a1=/[\t\n\r\f]| {2,}|^ | $/;function s1(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function l1(e){if(!a1.test(e))return e;let t=e.replace(o1," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function u1(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
711
+ `,js=new WeakMap;function Ks(e){return Yf.has(e)}var Yf=new WeakSet;function Ys(e){let t=js.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(gv)))}`;await e.audioWorklet.addModule(n),Yf.add(e)})().catch(n=>{throw js.delete(e),n}),js.set(e,t)),t}function bv(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,d=0;for(let m=0;m<i;m++){u+=s*(l()-u);let p=u*Math.pow(1-m/i,2.5);o[m]=p,d+=p*p}let f=Math.sqrt(d);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var ce=e=>typeof e=="number"?e:Number(e??0),Xs=e=>e/1e3;function Zf(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let d=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function ep(e){try{e.stop()}catch{}e.disconnect()}function Js(e,t){return[{param:e},{param:t,map:n=>1-n}]}function tp(e,t,n){e.gain.value=n,t.gain.value=1-n}function Qs(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var xv=new Set(["peaking","highpass","lowpass"]),Xf=e=>Math.pow(10,e/20),yv=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=Xf(ce(i.gain))};return r(t),Qs(n,r,{gain:[{param:n.gain,map:Xf}]})};function Nr(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ce(a.frequency),a.q!==void 0&&(i.Q.value=ce(a.q)),t&&(i.gain.value=ce(a.gain))};return o(r),Qs(i,o,{frequency:[{param:i.frequency}],...xv.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function Sv(e){return(t,n)=>{let r=Math.tan(Math.PI*ce(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Qs(i,()=>{})}}function Lr(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var vv={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},Av=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=vv[String(a.type)]??Math.tanh,s=Math.pow(10,ce(a.threshold)/20),u=8192,d=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=ce(a.oversample)>=4?"4x":ce(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ce(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},Ev=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ce(u.time)/1e3),o.gain.value=ce(u.feedback),tp(a,l,ce(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Xs(u))}],feedback:[{param:o.gain}],mix:Js(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},_v=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=Zf(e,"sine",ce(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let d=f=>{o.delayTime.value=ce(f.delay)/1e3,l.gain.value=ce(f.depth)/1e3,a.playbackRate.value=ce(f.speed),tp(s,u,ce(f.mix))};return d(t),{input:r,output:i,update:d,automation:{delay:[{param:o.delayTime,map:Xs}],depth:[{param:l.gain,map:Xs}],speed:[{param:a.playbackRate}],mix:Js(s.gain,u.gain)},dispose:()=>{ep(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},wv=6,Cv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=Zf(e,String(t.type)==="1"?"sine":"triangle",ce(t.speed),n),s=e.createGain(),u=e.createGain(),d=e.createGain(),f=[];r.connect(o);let m=o;for(let g=0;g<wv;g++){let y=e.createBiquadFilter();y.type="allpass",y.Q.value=.7071,s.connect(y.frequency),m.connect(y),m=y,f.push(y)}l.connect(s),m.connect(u).connect(a),o.connect(d).connect(a),a.connect(i);let p=g=>{let y=1e3/Math.max(.1,ce(g.delay));for(let x of f)x.frequency.value=y;s.gain.value=y*ce(g.decay),l.playbackRate.value=ce(g.speed),o.gain.value=ce(g.in_gain),a.gain.value=ce(g.out_gain),u.gain.value=1,d.gain.value=1};return p(t),{input:r,output:i,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{ep(l),[r,i,o,a,s,u,d,...f].forEach(g=>g.disconnect())}}},Rv=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let d=`${ce(u.size)}:${ce(u.damping)}`;if(d!==l){let f=bv(e.sampleRate,ce(u.size),ce(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=d}o.gain.value=ce(u.wet),a.gain.value=ce(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},Tv={"gain-node":yv,"biquad-peaking":Nr("peaking",!0),"biquad-lowshelf":Nr("lowshelf",!0),"biquad-highshelf":Nr("highshelf",!0),"biquad-highpass":Nr("highpass",!1),"biquad-lowpass":Nr("lowpass",!1),"worklet-compressor":Lr("hf-compressor"),"worklet-limiter":Lr("hf-limiter"),"worklet-gate":Lr("hf-gate"),"worklet-bitcrush":Lr("hf-bitcrush"),"worklet-pitchshift":Lr("hf-pitchshift"),waveshaper:Av,"delay-feedback":Ev,"chorus-lfo":_v,"allpass-phaser":Cv,convolver:Rv};function np(e){return e.nodes.some(t=>Bn(t.type)?.web.startsWith("worklet-")??!1)}function kv(e,t,n,r=0){let i=Bn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=Un(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return Sv(t)(e,o,r);let a=Tv[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function Jf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function Qf(e){return Wn(e).map(t=>{let n=Un(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function rp(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=Jf(Wn(t)),s=r;for(let m of l){let p=null;if(m.preset){let g=e.createGain(),y=e.createGain(),x=e.createGain(),w=e.createGain();x.gain.value=m.amount,y.gain.value=1-m.amount,s.connect(g),g.connect(y).connect(w),p={entry:g,wet:x,dry:y,join:w},s=g}for(let g of m.nodes){let y=kv(e,g.type,g.params??{},n);s.connect(y.input),s=y.output,o.push({...g.id?{id:g.id}:{},type:g.type,handle:y})}p&&m.preset&&(s.connect(p.wet).connect(p.join),a.push({id:m.preset,...p}),s=p.join)}s.connect(i);let u=Qf(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Js(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:d,nodes:o,update(m){if(Qf(m)!==u)return!1;Wn(m).forEach((g,y)=>{let x=o[y];x&&(x.handle.update(Un(g.type,g.params)),g.id===void 0?delete x.id:x.id=g.id)});let p=0;for(let g of Jf(Wn(m))){if(!g.preset)continue;let y=a[p++];!y||y.id!==g.preset||(y.wet.gain.value=g.amount,y.dry.gain.value=1-g.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:p,dry:g,join:y}of a)m.disconnect(),p.disconnect(),g.disconnect(),y.disconnect();r.disconnect(),i.disconnect()}}}var ip={version:1,nodes:[]},op={version:1,lanes:[]};function ap(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(dt):null)??"";if(!n)return op;try{return Xu(gi(n),t)}catch{return op}}function En(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Ht):null)??"";if(!t)return{chain:ip,raw:""};try{return{chain:Gu(t),raw:t}}catch{return{chain:ip,raw:""}}}function sp(e){return ap(e,En(e).chain)}function lo(e,t,n,r,i){let{chain:o}=En(t),a=null,l=[],s=!1,u=0,d=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(C,N)=>{if(C.nodes.length===0){n.connect(r);return}if(np(C)&&!Ks(e)){n.connect(r);let O=++u;Ys(e).then(()=>{s||O!==u||x(En(t).chain)}).catch(()=>{});return}try{let O=rp(e,C,N);n.connect(O.input),O.output.connect(r),a=O}catch{n.connect(r)}},m=(C,N)=>{l=N&&a?jf(ap(t,C),C,a.nodes,N,a.presets):[]},p=i?{...i}:null;f(o,p?.elapsed??0),m(o,p);let g=()=>{if(!p)return null;let C=typeof e.currentTime=="number"?e.currentTime:p.scheduledAt;return{scheduledAt:C,elapsed:p.elapsed+(C-p.scheduledAt)*p.rate,rate:p.rate}},y=C=>{let N=g();N&&(An(l,N.scheduledAt),m(C,N))},x=C=>{let N=g();An(l,N?.scheduledAt??0),d(),f(C,N?.elapsed??0),m(C,N)},w=null,k=t;return typeof MutationObserver<"u"&&typeof k?.nodeType=="number"&&(w=new MutationObserver(()=>{let C=En(t);l.length>0&&Fr(l),!a||!a.update(C.chain)?x(C.chain):y(C.chain)}),w.observe(k,{attributes:!0,attributeFilter:[Ht,dt]})),{reanchor:C=>{if(s)return;let N=g();N&&An(l,N.scheduledAt),p={...C},m(En(t).chain,p)},setRate:C=>{let N=g();s||!N||!Number.isFinite(C)||C<=0||C===N.rate||(p={...N,rate:C},An(l,N.scheduledAt),m(En(t).chain,p))},dispose:()=>{s=!0,w?.disconnect(),l.length>0&&An(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}function lp(e,t){e.getFloatTimeDomainData(t);let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,Math.abs(t[r]??0));return n}function Zs(e,t){let n=e.createGain();n.channelCount=2,n.channelCountMode="explicit";let r=e.createChannelSplitter(2),i=e.createAnalyser(),o=e.createAnalyser();i.fftSize=o.fftSize=2048,t.connect(n),n.connect(r),r.connect(i,0),r.connect(o,1);let a=new Float32Array(new ArrayBuffer(2048*4)),l=new Float32Array(new ArrayBuffer(2048*4));return{read:()=>({l:lp(i,a),r:lp(o,l)}),dispose:()=>{try{t.disconnect(n),n.disconnect(),r.disconnect()}catch{}}}}var up="runtime_web_audio_bypass";function el(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function Dr(e,t){return el(e,t)!==null}function Mv(e){return Dr(e,"crossorigin")?!0:e.crossOrigin!=null}function Fv(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function Nv(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=el(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function Lv(e,t){let n;try{n=new URL(e,Fv(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function Dv(){return typeof window.origin=="string"?window.origin:window.location.origin}function Iv(e,t){if(typeof window>"u")return null;let n=Lv(e,t);if(!n)return null;let r=Dv(),i=r==="null";return!i&&n.origin===r||Mv(t)?null:i?"opaque_document_origin":"cross_origin_no_cors"}function dp(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:Dr(e,"src")}function _n(e){for(let t of Nv(e)){let n=Iv(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function Pv(e){let t=[];Dr(e,Ht)&&t.push("fx-chain"),Dr(e,dt)&&t.push("automation"),Dr(e,Ai)&&t.push("audio-group");let n=Number.parseFloat(el(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function Ov(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var cp=new WeakSet,Gv={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document's security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},Hv={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function wn(e,t){if(t.kind==="web-audio"||Ov()||cp.has(e))return;let n=Pv(e);cp.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:Gv[t.reason]};xe({source:"hf-preview",type:"diagnostic",code:up,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 ${Hv[t.reason]}`:"";console.info(`[hyperframes] ${up}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function tl(e){return!Number.isFinite(e)||e<=0?1:e}function mp(e){return Be(e)}function Bv(e,t){t||e.paused||!ni().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Uv(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let d=-n/o;return s?e.start(i+d,r,u):e.start(i+d,r),!0}function uo(e,t,n){let r=Kf(sp(e));r&&$s([{param:t.gain}],r,hi.scale,n)}function Ir(e){return e.sourceKind==="buffer"}var co=class{constructor(){le(this,"_ctx",null);le(this,"_bufferCache",new Map);le(this,"_failedSrcs",new Set);le(this,"_mediaElementSources",new WeakMap);le(this,"_activeSources",[]);le(this,"_masterGain",null);le(this,"_monitorGain",null);le(this,"_masterVolume",1);le(this,"_masterMuted",!1);le(this,"_groups",new Map);le(this,"_metering",!1);le(this,"_masterTap",null);le(this,"_groupTaps",new Map);le(this,"_rateAnchorCtx",0);le(this,"_rateAnchorComp",0);le(this,"_rate",1);le(this,"_paused",!0);le(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._monitorGain=this._ctx.createGain(),this._masterGain.connect(this._monitorGain),this._monitorGain.connect(this._ctx.destination),this.applyMasterGain(),this._metering&&this.attachMasterTap(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return I("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return I("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),I("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=_n(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),wn(t,o),null}return n}if(!this._ctx)return null;let r=_n(t);if(r.kind!=="web-audio")return wn(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=tl(l),d=this._ctx.createGain();d.gain.value=o;let f=this._ctx.currentTime,m=i-n,p={scheduledAt:f,elapsed:m,rate:u},g=lo(this._ctx,t,s,d,p);d.connect(this.resolveDestination(t,f,i,u)??this._masterGain),uo(t,d,p),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let y={fx:g,el:t,sourceNode:s,sourceKind:"media-element",gainNode:d,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Pe(t),bounded:!1};return t.volume=1,this._activeSources.push(y),this._paused=!1,y}catch(s){return I("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(m){I("webAudioTransport.groupReanchor",m)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>ma(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let d=this._ctx.createGain();d.gain.value=mp(da(s)),d.connect(u);let f=lo(this._ctx,s??{getAttribute:()=>null},o,d,r);return s&&uo(s,d,r),this._groups.set(t,{input:o,output:a,isPresent:()=>l()!==null,fader:d,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{Fr([{param:d.gain}]);let p=l();d.gain.value=mp(da(p)),u.gain.value=p?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),p&&uo(p,d,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),d.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),this.attachGroupTap(t,a),o}startMetering(){this._metering=!0,this.attachMasterTap();for(let[t,n]of this._groups)this.attachGroupTap(t,n.output)}stopMetering(){this._metering=!1,this._masterTap?.dispose(),this._masterTap=null;for(let t of this._groupTaps.values())t.dispose();this._groupTaps.clear()}readLevels(){let t={};for(let[n,r]of this._groupTaps)this._groups.get(n)?.isPresent()&&(t[n]=r.read());return{master:this._masterTap?.read()??{l:0,r:0},groups:t}}attachMasterTap(){this._ctx&&this._masterGain&&!this._masterTap&&(this._masterTap=Zs(this._ctx,this._masterGain))}attachGroupTap(t,n){this._metering&&this._ctx&&!this._groupTaps.has(t)&&this._groupTaps.set(t,Zs(this._ctx,n))}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){I("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=bc(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let d=tl(s),f=Pe(t),m=d*f,p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=m;let g=this._ctx.createGain();g.gain.value=a;let y=o-r,x=this._ctx.currentTime,w={scheduledAt:x,elapsed:y,rate:d},k=lo(this._ctx,t,p,g,w);if(g.connect(this.resolveDestination(t,x,o,d)??this._masterGain),uo(t,g,w),this._rate=d,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Uv(p,{elapsed:y,mediaStart:i,scheduledAt:x,globalRate:d,mediaRate:f,clipDuration:u}))return p.disconnect(),k?.dispose(),g.disconnect(),null;let C=t.muted;t.muted=!0,Bv(t,C);let N={fx:k,el:t,sourceNode:p,sourceKind:"buffer",gainNode:g,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(N),this._paused=!1,p.addEventListener("ended",()=>this.handleSourceEnded(p,N,t,C)),N}catch(d){return I("webAudioTransport.schedule",d),null}}setRate(t){let n=tl(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{Ir(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){I("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){I("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>Ir(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{Ir(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}Ir(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Be(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){I("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._monitorGain&&(this._monitorGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&Ir(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll(),this.stopMetering();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._monitorGain=null,this._masterVolume=1,this._masterMuted=!1}};var Pr="data-hf-studio-manual-edit-gesture";var fp=`[${Pr}]`;function pp(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(fp)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(fp)),i=l=>{for(let s of l){let u=s.target;ke(u)&&(u.hasAttribute(Pr)?r.add(u):r.delete(u))}},o=l=>{l.length!==0&&(i(l),t())},a=new n(o);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Pr]}),{observing:!0,isActive:()=>{o(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Pr))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var hp=333.3333333333333;function gp(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var Wv=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function bp(e){return Math.max(0,Math.min(1,e))}function xp(e){let t=Wv.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?bp(n):null}function yp(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=bp(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var Vv=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,zv=Math.PI*2;function qv(e){let t=Vv.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function $v(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(zv*t*e)}function Sp(e,t){let n=qv(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>$v(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var jv=24,vp=e=>e>=1?1:0,Kv=e=>e,mo=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Yv=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${mo}\s*,\s*${mo}\s+${mo}\s*,\s*${mo}\s+1\s*,\s*1\s*$`,"i");function Ap(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Xv(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<jv;l+=1){let s=(o+a)/2;Ap(s,t,r)<e?o=s:a=s}return Ap((o+a)/2,n,i)}function Jv(e){let t=Yv.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>Xv(a,n,r,i,o)}function Qv(e,t){if(!e.startsWith("spring("))return null;let n=xp(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>yp(o,n);return t.set(n,i),i}function Zv(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=Jv(n);return i&&t.set(n,i),i}function Ep(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?vp:Sp(s,i)??Qv(s,r)??Zv(s,n),a=(s,u,d=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&He("custom_ease_parse_failed",{ease:s}),t.call(u,s,...d)??Kv)};e.parseEase=function(u,...d){return a(u,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",vp);let s=u=>{let d=f=>f;d.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var eA="first-frame",tA=3;function nA(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function rA(e){if(!nA(e)||e.tagName!=="AUDIO"&&e.tagName!=="VIDEO")return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function iA(e){return e.hasAttribute("data-start")||e.hasAttribute("data-track-index")}function oA(e,t,n){let r=e;for(;r;){if(iA(r)&&!or(r,{currentTime:0,compositionDuration:Number.POSITIVE_INFINITY,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:t}))return!1;r=r.parentElement}return!0}function _p(e,t,n,r){return t==="all"?!0:oA(e,n,r)}function aA(e,{scope:t="all"}={}){let n=e.defaultView,r=Ue({documentRef:e,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),i=Array.from(e.querySelectorAll("video, audio")).filter(rA).filter(l=>_p(l,t,r,n?.__timelines??{})).filter(l=>l.readyState<tA),o=Array.from(e.querySelectorAll("img")).filter(l=>_p(l,t,r,n?.__timelines??{})).filter(l=>!l.complete),a=e.fonts?.status==="loading";return{pendingMedia:i,pendingImages:o,fontsLoading:a}}function sA(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},i){let o=t.map(s=>new Promise(u=>{if(s.error){u();return}let d=()=>{s.removeEventListener("canplay",d),s.removeEventListener("error",d),i.removeEventListener("abort",d),u()};s.addEventListener("canplay",d),s.addEventListener("error",d),i.addEventListener("abort",d,{once:!0})})),a=n.map(s=>s.decode?s.decode().catch(()=>{}):Promise.resolve()),l=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...o,...a,l]).then(()=>{})}function lA(e,t,{scope:n="all"}={}){let r=aA(e,{scope:n});return r.pendingMedia.length===0&&r.pendingImages.length===0&&!r.fontsLoading?null:sA(e,r,t)}var uA=50;function cA(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(r=>{let i,o=()=>{i!==void 0&&clearTimeout(i),t.removeEventListener("abort",o),r()};if(t.aborted){o();return}t.addEventListener("abort",o,{once:!0});let a=()=>{if(n.__renderReady){o();return}i=setTimeout(a,uA)};a()})}var dA=50,mA=2,fA=1500;function nl(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,i=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener("abort",i,{once:!0}),r=e.requestAnimationFrame(o=>{t.removeEventListener("abort",i),n(o)})})}function pA(e,t){let n=e.defaultView;return n?(async()=>{let r=await nl(n,t);if(t.aborted)return;let i=await nl(n,t),o=0;for(;!t.aborted&&o<mA;){if(i-r>=fA)return;let a=await nl(n,t);if(t.aborted)return;o=a-i<dA?o+1:0,i=a}})():null}var hA=8e3;function gA(e,t,n={}){let r=n.inputs??[(u,d)=>lA(u,d,{scope:n.scope}),cA,pA],i=new AbortController,o=r.map(u=>u(e,i.signal)).filter(u=>u!==null);if(o.length===0){t({timedOut:!1});return}let a=n.timeoutMs??hA,l,s=new Promise(u=>{l=setTimeout(()=>u("timed-out"),a)});Promise.race([Promise.all(o).then(()=>"done"),s]).then(u=>{clearTimeout(l),i.abort(),t({timedOut:u==="timed-out"})})}function wp(e,t,n={}){gA(e,t,{...n,scope:eA})}var ol=new Map,Or=new Map,rl=new Map,il=()=>{},Rp=()=>{},Cp=0;function al(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function Tp(e){let t=(rl.get(e)??0)+1;return rl.set(e,t),t}function kp(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Cp-=1,Cp)}function sl(e,t){let n=Or.get(e);if(!n)return;let r=()=>rl.get(e)===t.generation&&Or.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Rp(e,t.requestId)},i=>{r()&&il(e,t.requestId,i)})}catch(i){r()&&il(e,t.requestId,i)}}function Mp(e){il=e}function Fp(e){Rp=e}function fo(e,t,n){if(!al(e))return;let r={payload:t,requestId:kp(n),generation:Tp(e)};ol.set(e,r),sl(e,r)}function po(e,t){al(e)&&(ol.delete(e),sl(e,{payload:void 0,requestId:kp(t),generation:Tp(e)}))}function Np(e,t){if(!al(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Or.set(e,t);let n=ol.get(e);return n&&sl(e,n),()=>{Or.get(e)===t&&Or.delete(e)}}var Lp=!1;function st(e){if(e){if(typeof e.pause!="function"){Lp||(Lp=!0,He("timeline_missing_pause",{}));return}try{e.pause()}catch(t){I("runtime.timeline.pause",t)}}}function yA(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function SA(e,t){return t!==null&&e.length===t.length&&e.every((n,r)=>n===t[r])}function Dp(e,t,n){let r=null,i=!0;return()=>{let o=e();if(o.length===0)return r=null,i=!0,!0;if(SA(o,r))return i;r=o,i=!1;let a=o.length===1?o[0]:Promise.all(o);return Promise.resolve(a).then(()=>{r===o&&(i=!0,t())},l=>{r===o&&(i=!0,n(l),t())}),i}}function Ip(){let e=od(),t=()=>{};iu(xe),Mp((c,h,b)=>{xe({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:h,message:b instanceof Error?b.message:String(b)})}),Fp((c,h)=>{try{t()}catch(b){xe({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:h,message:b instanceof Error?b.message:String(b)});return}xe({source:"hf-preview",type:"runtime-data-applied",channel:c,requestId:h})}),Ji(document),Ds(document),xc(document);let n=yA();e.canonicalFps=n.fps??e.canonicalFps,nu(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,d=(c,h,b)=>{u.has(c)||(u.add(c),He(h,b))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){I("runtime.init.site1",c)}let f=new so;e.transportClock=f;let m=new co,p=!1;m.init().then(c=>{p=c}),window.__hf=window.__hf||{};let g=c=>c.closest("[data-hidden]")!==null||Ei(c.ownerDocument,c),y=()=>{let c=window.gsap,h=window;if(!(!c?.registerPlugin||h.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(b){d("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),I("runtime.autoMarker.install",b)}},x=()=>{let c=window.gsap;if(!c){d("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Ep(c)||d("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){d("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),I("runtime.customEase.install",h)}};y(),x(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{du(document)}catch(c){I("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let w=()=>{let c=document.querySelector('[data-composition-id][data-root="true"]');if(Ae(c))return c;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(b=>!b.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,h=w()?.getAttribute("data-composition-id")??"root",b={};if(c.length===1)b[h]=c[0];else for(let A=0;A<c.length;A++)b[`tl-${A}`]=c[A];window.__timelines=b}let k=w();k&&!k.hasAttribute("data-start")&&k.setAttribute("data-start","0");let C=c=>{a.push(c)},N=(c,h,b)=>{let A=b??`${c}:${JSON.stringify(h)}`;l.has(A)||(l.add(A),xe({source:"hf-preview",type:"diagnostic",code:c,details:h}))},O=c=>{let h={scale:1,focusX:960,focusY:540},b=[],A=[],_={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>b,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>A,getRenderState:()=>({..._,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},F=1/60,S=.75,v=.05,E=100,T=240,L=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},G=c=>{let h=c.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},z=c=>{if(c==null||c.trim()==="")return null;let h=Number.parseFloat(c);return!Number.isFinite(h)||h<=0?null:`${h}px`},X=()=>w(),M=()=>{let c=X();if(!c)return;let h=z(c.getAttribute("data-width")),b=z(c.getAttribute("data-height"));h&&(c.style.width=h),b&&(c.style.height=b),h&&c.style.setProperty("--comp-width",h),b&&c.style.setProperty("--comp-height",b),h&&(document.documentElement.style.width=h),b&&(document.documentElement.style.height=b),h&&(document.body.style.width=h),b&&(document.body.style.height=b)},V=()=>{let c=X(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(b=>b.hasAttribute("data-duration")||b.hasAttribute("data-end"));for(let b of h){if(c&&b===c)continue;let A=b.getAttribute("data-duration"),_=b.getAttribute("data-end");A!=null&&!b.hasAttribute(on)&&b.setAttribute(on,A),_!=null&&!b.hasAttribute(an)&&b.setAttribute(an,_),b.removeAttribute("data-duration"),b.removeAttribute("data-end")}},te=()=>{let c=X();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let h=z(c.getAttribute("data-width")),b=z(c.getAttribute("data-height"));h&&(c.style.width=h),b&&(c.style.height=b);let A=Array.from(c.children);for(let _ of A){let R=_.tagName.toLowerCase();if(R==="script"||R==="style"||R==="link"||R==="meta"||!_.hasAttribute("data-start")||_.hasAttribute("data-hf-autostamped"))continue;let D=(_.style.top==="0px"||_.style.top==="0")&&(_.style.left==="0px"||_.style.left==="0")&&_.style.width==="100%"&&_.style.height==="100%",H=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(_.style.transform);if(D&&H&&!_.hasAttribute("data-width")&&!_.hasAttribute("data-height")){let Q=_.style.top,we=_.style.left,Gt=_.style.width,Fe=_.style.height;_.style.top="",_.style.left="",_.style.width="",_.style.height="";let Qe=window.getComputedStyle(_);Qe.top!=="auto"||Qe.bottom!=="auto"||Qe.left!=="auto"||Qe.right!=="auto"||Qe.width!=="0px"||Qe.height!=="0px"||(_.style.top=Q,_.style.left=we,_.style.width=Gt,_.style.height=Fe)}let Y=window.getComputedStyle(_),re=Y.position;if(re!=="absolute"&&re!=="fixed"&&(_.style.position="absolute"),!!_.style.top||!!_.style.bottom||Y.top!=="auto"||Y.bottom!=="auto"||(_.style.top="0"),!!_.style.left||!!_.style.right||Y.left!=="auto"||Y.right!=="auto"||(_.style.left="0"),R!=="audio"){let Q=z(_.getAttribute("data-width")),we=z(_.getAttribute("data-height")),Gt=Y.width!=="0px"&&Y.width!=="auto",Fe=Y.height!=="0px"&&Y.height!=="auto";Q?!_.style.width&&!Gt&&(_.style.width=Q):!_.style.width&&Y.width==="0px"&&(_.style.width="100%"),we?!_.style.height&&!Fe&&(_.style.height=we):!_.style.height&&Y.height==="0px"&&(_.style.height="100%")}}},B=c=>Ue({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:c}),q=null,$=c=>{let h=q;q=B(!0);try{return c()}finally{q=h}},J=c=>c&&q?q:B(c),j=(c,h=0,b)=>J(b?.includeAuthoredTimingAttrs??!0).resolveStartForElement(c,h),P=(c,h)=>J(h?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(c),U=c=>{let h=c.closest("[data-composition-id]"),b=h?j(h,0):null,A=h?P(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:b,inheritedDuration:A}},ee=c=>J(!0).resolveMediaStartForElement(c);window.__hfResolveMediaStartSeconds=ee,a.push(()=>{window.__hfResolveMediaStartSeconds===ee&&delete window.__hfResolveMediaStartSeconds});let pe=!!document.querySelector("[data-composition-src]"),ne=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of c){let b=h.getAttribute("data-composition-id");if(b&&h.children.length===0&&document.querySelector(`template#${CSS.escape(b)}-template`)){ne=!0;break}}}let W=!pe&&!ne,K=c=>{if(!c||typeof c.duration!="function")return null;try{let h=Number(c.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},be=c=>typeof c=="number"&&Number.isFinite(c)&&c>F,Oe=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));return c.length===0?null:$(()=>{let h=[];for(let A of c){let _=ee(A);if(!Number.isFinite(_))continue;let R=Si(A);R==null||R<=F||h.push(Math.max(0,_)+R)}let{seconds:b}=ar({authoredDurationSeconds:null,clipEndsSeconds:h});return b!==null&&b>F?b:null})},Tn=()=>{let c=X();if(!c)return null;let h=window.__timelines??{},b=Ue({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),A=Me(c.getAttribute("data-duration")),_=[],R=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let H of R){if(!ke(H)||H.parentElement?.closest("[data-composition-id]")!==c)continue;let re=b.resolveStartForElement(H,0),Se=b.resolveDurationForElement(H);!Number.isFinite(re)||Se==null||Se<=0||_.push(Math.max(0,re)+Se)}let{seconds:D}=ar({authoredDurationSeconds:null,clipEndsSeconds:[A,..._]});return D!==null&&D>F?D:null},lt=c=>c.hasAttribute("data-composition-id")||c.hasAttribute("data-composition-src"),gh=c=>{let h=window;return!!(h.lottie||h.DotLottie||c.querySelector("[data-lottie-src]"))},bl=()=>{let c=X();if(!c)return ar({authoredDurationSeconds:null,clipEndsSeconds:[]});let h=Ue({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:!0}),b=[];for(let _ of Array.from(c.querySelectorAll("[data-start]"))){if(!ke(_))continue;let R=h.resolveStartForElement(_,0);if(!Number.isFinite(R))continue;let D=h.resolveDurationForElement(_);D!=null?b.push(Math.max(0,R)+D):(he(_)||lt(_))&&b.push(null)}gh(c)&&b.push(null);let A=ar({authoredDurationSeconds:null,clipEndsSeconds:b});return A.pendingClips>0?{...A,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:A},Ao=null,bh=()=>{if(kn)return bl();let c=Mn();return Ao?.revision!==c&&(Ao={revision:c,result:bl()}),Ao.result},xh=c=>{window.__hf=window.__hf||{},window.__hf.durationSource={source:c.source,seconds:c.seconds,pendingClips:c.pendingClips},c.source==="derived"&&N("composition_duration_derived",{source:c.source,seconds:c.seconds,pendingClips:c.pendingClips},`composition_duration_derived:${c.seconds}`)},yh=()=>{let c=Oe();return typeof c!="number"||!Number.isFinite(c)||c<=F?null:c},Sh=c=>be(c)?Math.max(F,c*S):F,xl=()=>{let c=0;for(let h of e.deterministicAdapters){let b=h.getInferredDurationSeconds;if(typeof b!="function")continue;let A=null;try{A=b()}catch(_){I("runtime.init.adapterDuration",_)}typeof A=="number"&&Number.isFinite(A)&&A>0&&(c=Math.max(c,A))}return c>F?c:null},kn=!1,yl=()=>kn&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,vh=["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",vi,"data-playback-rate","data-automation","data-playback-start","data-media-start","id","src"],Sl=["loadedmetadata","durationchange","emptied"],Br=null,vl=-1,Al=null,Dt=null,El=0,Kt=()=>{},Yt=()=>{El+=1,Kt()},_l=()=>({media:yh(),authoredComposition:Tn()}),Ah=()=>{let c=window.__timelines??{},h="";for(let b of Object.keys(c)){let A=c[b];A&&(h+=`${b}=${K(A)??"?"};`)}return h},Eh=()=>{if(!(Dt||typeof MutationObserver>"u")){Dt=new MutationObserver(Yt),Dt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:vh});for(let c of Sl)document.addEventListener(c,Yt,!0);a.push(()=>{Dt?.disconnect(),Dt=null,Yt();for(let c of Sl)document.removeEventListener(c,Yt,!0)})}},Mn=()=>{Eh(),Dt&&Dt.takeRecords().length>0&&Yt();let c=Ah();return c!==Al&&(Al=c,Yt()),El},wl=c=>kn?_l():(c??(c=Mn()),Br&&vl===c||(vl=c,Br=_l()),Br),ze=(c,h=0,b)=>{let A=K(c),{media:_,authoredComposition:R}=wl(b),D=xl(),H=Math.max(_??0,R??0,D??0),Y=Number.isFinite(h)&&h>F?h:0,re=0,Se=null;return be(A)?re=Math.max(A,H,Y):be(H)?re=Math.max(H,Y):Y>0?re=Y:(Se=bh(),re=Se.seconds??0),Se?xh(Se):window.__hf?.durationSource&&delete window.__hf.durationSource,re>0?Math.max(0,re):0},Eo=()=>{let c=window.__timelines??{},h=de=>{let se=Object.entries(c).filter(me=>!!me[1]&&typeof me[1].play=="function"&&typeof me[1].pause=="function");if(se.length!==1)return{timeline:null};let ie=se[0];if(!ie)return{timeline:null};let[ve,Ee]=ie;return{timeline:Ee,selectedTimelineIds:[ve],selectedDurationSeconds:K(Ee),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:de,soleTimelineId:ve}}}},b=Ue({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),{media:A,authoredComposition:_}=wl(),R=Math.max(A??0,_??0)||null,D=Sh(R),H=de=>{let se=document.querySelector(`[data-composition-id="${CSS.escape(de)}"]`);return se?b.resolveStartForElement(se,0):0},Y=de=>{let se=window.gsap;if(!se||typeof se.timeline!="function")return null;let ie=se.timeline({paused:!0});for(let ve of de)ie.add(ve.timeline,H(ve.compositionId));return ie},re=(de,se)=>{if(!be(de))return null;let ie=window.gsap;if(!ie||typeof ie.timeline!="function")return null;let ve=ie.timeline({paused:!0});if(se)try{ve.add(se,0)}catch(me){I("runtime.init.site2",me)}let Ee=ve;if(typeof Ee.to=="function")try{Ee.to({},{duration:de})}catch(me){I("runtime.init.site3",me)}return ve},Se=(de,se)=>{if(!de||typeof de.getChildren!="function")return[];try{let ie=de.getChildren(!0,!0,!0);return Array.isArray(ie)?se.filter(ve=>ie.includes(ve.timeline)):[]}catch{return[]}},St=(de,se)=>{let ie=de,ve={addedIds:[],nested:[]};if(typeof ie.getChildren!="function")return ve;try{let Ee=ie.getChildren(!0,!0,!0)??[];if(!Array.isArray(Ee))return ve;let me=[];for(let _e of se)if(!Ee.some(ut=>ut===_e.timeline))try{let ut=H(_e.compositionId);de.add(_e.timeline,ut),me.push(_e.compositionId)}catch(ut){I("runtime.init.site4",ut)}return{addedIds:me,nested:Se(de,se)}}catch{return ve}},ae=X(),Q=ae?.getAttribute("data-composition-id")??null;if(!Q)return h("root_missing_composition_id");let we=c[Q]??null,Fe=(()=>{if(!ae)return[];let de=new Set,se=Array.from(ae.querySelectorAll("[data-composition-id]")),ie=[];for(let ve of se){let Ee=ve.getAttribute("data-composition-id");if(!Ee||Ee===Q||de.has(Ee))continue;de.add(Ee);let me=c[Ee]??null;if(!me||typeof me.play!="function"||typeof me.pause!="function")continue;let _e=K(me);ie.push({compositionId:Ee,timeline:me,durationSeconds:_e??0})}return ie})(),Qe=de=>{for(let se of de){let ie=se.timeline;if(typeof ie.paused=="function")try{ie.paused(!1)}catch(ve){I("runtime.init.site5",ve)}}};if(we){let de=Fe.length>0?St(we,Fe):{addedIds:[],nested:[]},se=de.addedIds;if(Qe(de.nested),(Fe.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+Q+"'])"))&&(Ur=!0),se.length>0)try{let me=we.time();we.seek(me,!1)}catch{}let ie=K(we);if(!be(ie)&&Fe.length>0){let me=Fe.map(t0=>t0.compositionId),_e=Y(Fe),Jt=K(_e);if(_e&&be(Jt))return Qe(Se(_e,Fe)),{timeline:_e,selectedTimelineIds:me,selectedDurationSeconds:Jt,mediaDurationFloorSeconds:A,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Q,rootDurationSeconds:ie,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:D,selectedDurationSeconds:Jt,mediaDurationFloorSeconds:A,authoredCompositionDurationFloorSeconds:_,selectedTimelineIds:me,autoNestedChildren:se}}};let ut=re(R??0,we),Ho=K(ut);if(ut&&be(Ho))return{timeline:ut,selectedTimelineIds:[Q],selectedDurationSeconds:Ho,mediaDurationFloorSeconds:A,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Q,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:A,authoredCompositionDurationFloorSeconds:_,selectedDurationSeconds:Ho,selectedTimelineIds:[Q],autoNestedChildren:se}}}}if(!be(ie)&&Fe.length===0){let me=re(R??0,we),_e=K(me);if(me&&be(_e))return{timeline:me,selectedTimelineIds:[Q],selectedDurationSeconds:_e,mediaDurationFloorSeconds:A,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Q,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:A,authoredCompositionDurationFloorSeconds:_,selectedDurationSeconds:_e,selectedTimelineIds:[Q]}}}}let ve=Me(ae?.getAttribute("data-duration")),Ee=Math.max(be(ve)?ve:0,_??0);if(Ee>0&&be(Ee)&&be(ie)&&Ee>=ie+.5){let me=we;if(typeof me.to=="function")try{me.to({},{duration:0},Ee)}catch(Jt){I("runtime.init.site6",Jt)}let _e=K(we);if(be(_e))return{timeline:we,selectedTimelineIds:[Q],selectedDurationSeconds:_e,mediaDurationFloorSeconds:A,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Q,rootDurationSeconds:ie,rootDeclaredDur:ve,authoredCompositionDurationFloorSeconds:_,newDur:_e}}}}return{timeline:we,selectedTimelineIds:[Q],selectedDurationSeconds:ie,mediaDurationFloorSeconds:A,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Q,selectedDurationSeconds:ie,autoNestedChildren:se}}:void 0}}if(Fe.length>0){let de=Fe.map(ve=>ve.compositionId),se=Y(Fe),ie=K(se);if(se)return Qe(Se(se,Fe)),{timeline:se,selectedTimelineIds:de,selectedDurationSeconds:ie,mediaDurationFloorSeconds:A,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:D,selectedDurationSeconds:ie,mediaDurationFloorSeconds:A,selectedTimelineIds:de}}}}return h("root_composition_id_unmatched_in_registry")},Ur=!1,_h=c=>{let h=window.gsap,b=c;if(!(!b||typeof b.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let A of b.getChildren(!0,!0,!0)){let _=A,R=_.timeline;if(!R||!("_ease"in R)||typeof R._ease=="function")continue;let D=_.vars?.keyframes,Y=(D&&!Array.isArray(D)?D.ease:void 0)??_.vars?.ease??"none";try{let re=h.parseEase(Y);typeof re=="function"&&(R._ease=re)}catch(re){He("keyframe_ease_repair_failed",{ease:typeof Y=="string"?Y:String(Y)}),I("runtime.keyframeEase.repair",re)}}},Fn=()=>{if(x(),!W)return!1;let c=e.capturedTimeline,h=K(c),b=be(h);if(c&&b&&Ur)return!1;let A=Eo();if(!A.timeline)return!1;if(c&&c===A.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=A.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),_h(e.capturedTimeline);let _=ze(e.capturedTimeline,0);if(_<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),st(e.capturedTimeline)),_>0){try{f.setDuration(_)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let D=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(D,!1),st(e.capturedTimeline)}let R=window.__hfStudioManualEditsApply;typeof R=="function"&&R(),Ji(document)}if(A.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:A.diagnostics.code,details:A.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:A.selectedTimelineIds??[],selectedDurationSeconds:A.selectedDurationSeconds??null,mediaDurationFloorSeconds:A.mediaDurationFloorSeconds??null}}),window.parent!==window){let R=X(),D=_>0?_:0,H=String(D>0?D:1),Y=new Set,re=ae=>ae.tagName.toLowerCase()===ln,Se=new Set(document.querySelectorAll("[data-start]")),St=ae=>{let Q=ae.parentElement;for(;Q&&Q!==R;){if(Se.has(Q))return!0;Q=Q.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ae of e.capturedTimeline.getChildren(!0))if(typeof ae.targets=="function")for(let Q of ae.targets())Ae(Q)&&Q!==R&&(re(Q)||Q.hasAttribute("data-start")||St(Q)||Y.has(Q)||(Y.add(Q),Q.setAttribute("data-start","0"),Q.setAttribute("data-duration",H),Q.setAttribute("data-hf-autostamped","1")))}catch{}if(Ae(R))for(let ae of R.querySelectorAll("[id]"))Ae(ae)&&ae!==R&&(ae.hasAttribute("data-start")||St(ae)||Y.has(ae)||ae.tagName==="SCRIPT"||ae.tagName==="STYLE"||ae.tagName==="LINK"||re(ae)||(Y.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",H),ae.setAttribute("data-hf-autostamped","1")))}for(let R of Nn)Wr.delete(R),Nl(R);return!0},Cl=()=>{if(e.tornDown)return;let c=Eo();if(!c.timeline){e.capturedTimeline=null,Ur=!1,f.setDuration(0),jr(e.currentTime);return}e.capturedTimeline!==c.timeline&&(Ur=!1,Fn()),jr(e.currentTime)};t=()=>{Cl(),xt()},window.__hfForceTimelineRebind=Cl;let wh=()=>{let c=X();if(!Ae(c))return;let h=c.getBoundingClientRect(),b=Number(c.getAttribute("data-width")),A=Number(c.getAttribute("data-height")),_=window.getComputedStyle(c),R=Number.isFinite(b)&&b>0&&Number.isFinite(A)&&A>0,D=h.width<=0||h.height<=0||c.clientWidth<=0||c.clientHeight<=0;!R||!D||N("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:b,declaredHeight:A,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:_.display,visibility:_.visibility,overflow:_.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},Ch=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,wh()}))},Rh=()=>{i=c=>{let h=L(c.error??c.message).slice(0,T);if(!h)return;let b=G(h);xe({source:"hf-preview",type:"diagnostic",code:b.code,details:{category:b.category,message:h,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},o=c=>{let h=L(c.reason).slice(0,T);if(!h)return;let b=G(h);xe({source:"hf-preview",type:"diagnostic",code:`${b.code}_unhandled_rejection`,details:{category:`${b.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Th=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let b of c){let A=()=>{if(!ke(b))return;let _=b.tagName.toLowerCase(),R=b.getAttribute("src")??b.getAttribute("href")??b.getAttribute("poster")??null,D=_==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";N(D,{tagName:_,assetUrl:R,currentSrc:(Le(b)||he(b))&&b.currentSrc||null,readyState:he(b)?b.readyState:null,networkState:he(b)?b.networkState:null},`${D}:${_}:${R??"unknown"}`)};b.addEventListener("error",A),C(()=>{b.removeEventListener("error",A)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let b=Array.from(h).filter(A=>A.status==="error").map(A=>A.family).filter(A=>!!A).slice(0,10);b.length!==0&&N("runtime_font_load_issue",{failedFamilies:b,totalFaces:Array.from(h).length},`runtime-font-load-issue:${b.join("|")}`)}).catch(()=>{})},kh=(c,h)=>{if(!c.timeline)return!1;let b=e.capturedTimeline;if(b&&b===c.timeline)return!1;let A=Math.max(0,e.currentTime||0),_=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{st(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(A,!1),_&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(R){I("runtime.init.site7",R)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:A,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},It=null,Rl=!1,Nn=new Set,Wr=new WeakMap,Vr=()=>{e.tornDown||(It!=null&&window.clearTimeout(It),It=window.setTimeout(()=>{if(e.tornDown||(It=null,yl()))return;let c=Eo();if(!c.timeline||!be(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Fn()&&(xt(),Ie(!0));return}if(Rl)return;let b=K(e.capturedTimeline),A=c.selectedDurationSeconds??K(c.timeline);be(A)&&(!be(b)||A>=b+v)&&kh(c,"manual")&&(Rl=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:b??null,selectedDurationSeconds:A??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),xt(),Ie(!0))},E))},Tl=c=>{he(c.currentTarget)&&Cc(c.currentTarget)},kl=c=>{he(c.currentTarget)&&Rc(c.currentTarget)},Ml=c=>{$o(c)&&dp(c)&&wn(c,_n(c))},Fl=c=>{let h=c.currentTarget;he(h)&&Ml(h)},Mh=()=>{for(let c of Nn)c.removeEventListener("loadedmetadata",Vr),c.removeEventListener("durationchange",Vr),c.removeEventListener("loadedmetadata",Tl),c.removeEventListener("loadedmetadata",Fl),c.removeEventListener("error",kl);Nn.clear()},_o=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let h of c){if(Nn.has(h))continue;Nn.add(h);let b=Number.parseFloat(h.dataset.volume??"");Number.isFinite(b)&&(h.volume=Math.max(0,Math.min(1,b))),h.addEventListener("loadedmetadata",Vr),h.addEventListener("durationchange",Vr),h.addEventListener("loadedmetadata",Fl),Ml(h),h.addEventListener("loadedmetadata",Tl),h.addEventListener("error",kl),wc(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),Nl(h)}},Nl=c=>{Wr.has(c)||uc(c,e.capturedTimeline,ze(e.capturedTimeline,0),Wr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},wo=new WeakMap,Fh=c=>{let h=wo.get(c);if(h!==void 0)return h;let b=window.getComputedStyle(c).position,A=b==="static"||b==="relative"||b==="sticky";return wo.set(c,A),A},Co=new WeakMap,Nh=c=>{let h=Co.get(c);if(h!==void 0)return h;let b=c.querySelector("[data-start]")===null;return Co.set(c,b),b},Lh=()=>{wo=new WeakMap,Co=new WeakMap},Ro=new WeakSet,To=new WeakMap,zr=new WeakSet,qr=!1,Ll=c=>c.matches("audio[data-start]")||c.querySelector("audio[data-start]")!==null,Dl=new WeakMap,$r=!0,Dh=()=>{if($r){$r=!1;for(let c of document.querySelectorAll(ln)){let h=c.hasAttribute("data-hidden");Dl.get(c)!==h&&(Dl.set(c,h),c.id&&m.setGroupMuted(c.id,h))}}},Ih=(c,h,b)=>{let A=X(),_=ze(e.capturedTimeline,0,b);for(let R of h){if(!Ae(R))continue;if(R.hasAttribute("data-hidden")){zr.has(R)||(To.set(R,R.style.getPropertyValue("display")),zr.add(R),Ll(R)&&(qr=!0),$r=!0),R.style.display="none",(fe(R)||Le(R))&&r?.setSourceVisibility(R,!1);continue}if(zr.has(R)){let H=To.get(R);H?R.style.display=H:R.style.removeProperty("display"),To.delete(R),zr.delete(R),Ll(R)&&(qr=!0),$r=!0}let D=or(R,{currentTime:c,compositionDuration:_,canonicalFps:e.canonicalFps,exportRenderSeek:!!window.__HF_EXPORT_RENDER_SEEK_CONFIG,timelineRegistry:window.__timelines??{},resolver:J(!0)});if(D){let H=R.parentElement;for(;H&&H!==A;){if(Ae(H)&&H.hasAttribute("data-start")&&!or(H,{currentTime:c,compositionDuration:_,canonicalFps:e.canonicalFps,exportRenderSeek:!!window.__HF_EXPORT_RENDER_SEEK_CONFIG,timelineRegistry:window.__timelines??{},resolver:J(!0)})){D=!1;break}H=H.parentElement}}R.style.visibility=D?"visible":"hidden",(fe(R)||Le(R))&&r?.setSourceVisibility(R,D),D?Ro.has(R)&&(R.style.removeProperty("display"),Ro.delete(R)):Fh(R)&&Nh(R)&&(R.style.display="none",Ro.add(R))}qr&&f.isPlaying()&&(m.stopAll(),Oo()),qr=!1,Dh()},jr=(c,h=Array.from(document.querySelectorAll("[data-start]")),b)=>$(()=>Ih(c,h,b)),Ln=null,Dn=null,Kr=[],Il=c=>c.hasAttribute("data-start")||!!U(c).compositionRoot,ko=c=>Sc({elements:c,shouldIncludeElement:Il,resolveStartSeconds:h=>ee(h),resolveDurationSeconds:h=>{let b=U(h),A=ee(h),_=b.inheritedStart!=null&&b.inheritedDuration!=null&&b.inheritedDuration>0?Math.max(0,b.inheritedStart+b.inheritedDuration-A):null,R=Number.isFinite(h.duration)?et(h,h.duration):null,D=Me(h.dataset.duration),H=D!=null&&D>0?D:null;return yc({isVideo:h.tagName==="VIDEO",sourceDuration:R,hostRemaining:_,explicitDuration:H})}}),Ph=()=>{let c=Mn();if(Ln&&Ln.revision===c)return Ln;let h=ko().mediaClips;return Ln={revision:c,clips:h,byStart:[...h].sort((b,A)=>b.start-A.start),byEnd:[...h].sort((b,A)=>b.end-A.end)},Dn=null,Kr=[],Ln},Pl=(c,h,b,A)=>{let _=0,R=c.length;for(;_<R;){let H=_+R>>1;h(c[H])<b?_=H+1:R=H}let D=[];for(let H=_;H<c.length&&h(c[H])<=A;H+=1)D.push(c[H]);return D},Oh=(c,h)=>{let b=Dn;if(b===null)return c.clips.map(D=>D.el);let A=Math.min(b,h),_=Math.max(b,h),R=new Set;for(let D of Kr)R.add(D.el);for(let D of Pl(c.byStart,H=>H.start,A,_))R.add(D.el);for(let D of Pl(c.byEnd,H=>H.end,A,_))R.add(D.el);return[...R]},Yr=new WeakSet,Ol=c=>{Yr.add(c)},Gl=c=>{Yr.delete(c)};window.__hf.leasePausedMedia=Ol,window.__hf.releasePausedMedia=Gl,window.__hf.audioMeter={start:()=>m.startMetering(),stop:()=>m.stopMetering(),read:()=>m.readLevels()};let Gh=()=>{for(let c of document.querySelectorAll("video, audio"))if(he(c)&&!c.paused&&Il(c)&&!Yr.has(c))return!0;return!1},Hl=()=>Kt();document.addEventListener("play",Hl,!0),a.push(()=>{document.removeEventListener("play",Hl,!0)});let Ge=c=>{let h=!kn,b=$(()=>{if(!h)return ko().mediaClips;let R=Ph();return ko(Oh(R,e.currentTime)).mediaClips});for(let R of b){let D=Wr.get(R.el);D&&(R.volumeKeyframes=D)}let A=e.isPlaying?b:b.filter(R=>!Yr.has(R.el)),_=e.mediaForceSyncNextTick;_&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||(vc({clips:A,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:_,getCompositionDuration:()=>ze(e.capturedTimeline,0,c),onElementVolume:(R,D,H)=>m.setElementVolume(R,H),isWebAudioOwned:R=>m.ownsElement(R),isWebAudioRouted:R=>m.routesElement(R),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),h?(Dn=e.currentTime,Kr=b.filter(R=>vt(e.currentTime,R.start,R.end))):(Dn=null,Kr=[])),jr(e.currentTime,void 0,c)},Ie=c=>{c&&Kt();let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),b=Date.now();(c||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||b-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=b,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Mo="",Bl=!1,Ul=!1,Wl=0,Hh=()=>{let c="";for(let h of document.querySelectorAll("[data-start]"))c+=`${h.id}:${h.tagName}|`;return c},xt=()=>{V(),M(),te();let c=X();if(c){let A=z(c.getAttribute("data-width")),_=z(c.getAttribute("data-height")),R=A?parseInt(A,10):0,D=_?parseInt(_,10):0;R>0&&D>0&&xe({source:"hf-preview",type:"stage-size",width:R,height:D})}Fn();let h=cd({canonicalFps:e.canonicalFps});window.__clipManifest=h;let b=Hh();if(Mo!==b&&Lh(),!window.__clipTree||Mo!==b){let A=window;window.__clipTree=ad({startResolver:Ue({timelineRegistry:A.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:A.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Mo=b}xe({...h,assetsReady:Ul}),Bl||(Bl=!0,wp(document,({timedOut:A})=>{e.tornDown||(Ul=!0,xe({source:"hf-preview",type:"assets-ready",timedOut:A}))})),Ch()},Fo=c=>typeof c=="number"&&Number.isFinite(c)&&c>0?c:0,Bh=c=>{let h=Fo(Number(c));if(h<=0)return;let b=X(),A=Fo(Me(b?.getAttribute("data-duration"))),_=Math.max(Wl,Fo(f.getDuration()),A);h<=_||(Wl=h,b?.setAttribute("data-duration",String(h)),f.setDuration(h),xt(),Ie(!0))},qe=(c,h=0)=>{for(let b of e.deterministicAdapters){try{c==="discover"&&b.discover(),c==="pause"&&b.pause(),c==="play"&&b.play&&b.play()}catch(A){I("runtime.init.site8",A)}if(c==="discover")try{b.seek({time:h,suppressEvents:!0})}catch(A){I("runtime.init.site9",A)}}},Pt=()=>{window.__renderReady=!1},Uh=Dp(()=>{let c=[];for(let h of e.deterministicAdapters){let b=h.getReadyPromise;if(typeof b=="function")try{let A=b();A&&c.push(A)}catch(A){I("runtime.init.adapterReady",A)}}return c},()=>Pt(),c=>I("runtime.init.adapterReady",c)),Wh=Dp(()=>{let c=window.__hf?.buildReady;return c?Object.values(c).filter(h=>h!=null&&typeof h.then=="function"):[]},()=>Pt(),c=>I("runtime.init.buildReady",c));if(W)Rs();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:z,onDiagnostic:({code:h,details:b})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:b})}};sf(c).then(()=>af(c)).finally(()=>{W=!0,_o(),Th(),Rs(),Ds(document),Pt()})}let Xr=td({postMessage:c=>xe(c)});Xr.installPickerApi(),jr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let Je=$f({lease:Ol,release:Gl});r=Je,C(()=>{Je.destroy(),r=null});let No=c=>{let h=Number(c);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let b=document.querySelectorAll("video, audio");for(let A of b)if(he(A))try{A.playbackRate=e.playbackRate}catch(_){I("runtime.init.site10",_)}},Vl={play:()=>{let c=e.capturedTimeline;if(f.isPlaying())return;let h=ze(c,0);if(h>0)f.setDuration(h),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Ot(0));else{let b=X(),A=Number(b?.getAttribute("data-duration")??0);A>0&&f.setDuration(A)}st(c),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Ql(f.now()),p&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Oo(),qe("play"),Ge(),Je.redraw(),Ie(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Ql(e.currentTime);let c=e.capturedTimeline;st(c),qe("pause"),Ge(),Je.redraw(),Ie(!0)},seek:(c,h)=>{let b=Ba(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let A=f.isPlaying();A&&f.pause(),f.seek(b),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let _=e.capturedTimeline;if(st(_),Ot(e.currentTime),qe("pause"),h?.keepPlaying&&A){Vl.play();return}Ge(),Je.redraw(),Ie(!0)},renderSeek:(c,h)=>{kn=!0;let b=er(Math.max(0,Number(c)||0),e.canonicalFps,h?.subFrameDivisions);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(b),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Ot(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),qe("pause"),Ge(),Je.redraw(),Ie(!0)},getTime:()=>f.now(),getDuration:()=>{let c=f.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:c=>{No(c),f.setRate(e.playbackRate),Zl()},getPlaybackRate:()=>e.playbackRate},zl=ze(e.capturedTimeline,0);zl>0&&f.setDuration(zl);let $e=id({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:No,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,h)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Ge()},onStatePost:Ie,onDeterministicSeek:(c,h)=>{for(let b of e.deterministicAdapters)if(!(b.name==="gsap"&&e.capturedTimeline))try{b.seek({time:Number(c)||0,suppressEvents:h?.suppressEvents})}catch(A){I("runtime.init.site11",A)}},onDeterministicPause:()=>qe("pause"),onDeterministicPlay:()=>qe("play"),onRenderFrameSeek:()=>{Je.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>ze(e.capturedTimeline,0),transport:Vl});window.__player=O($e),window.__playerReady=!0,He("composition_loaded",{duration:$e.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[ac(),gu({resolveStartSeconds:c=>j(c,0)}),xu(),Su(),Eu(),_u(),wu(),Cu(),Ru(),Tu(),ku(),bu({getTimeline:()=>e.capturedTimeline})],Nu(),Lu(),window.__hfReseekGpu=c=>{let h=Math.max(0,Number(c)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,ui(h)},window.__hfWaitForSeekCompletion=Qo,a.push(()=>{window.__hfWaitForSeekCompletion===Qo&&delete window.__hfWaitForSeekCompletion}),Rh(),_o(),qe("discover");let Vh=()=>{let c=e.capturedTimeline,h=Fn();e.capturedTimeline&&(h||e.capturedTimeline!==c||!$e._timeline)&&($e._timeline=e.capturedTimeline);let b=ze(e.capturedTimeline,0);if(b>0&&f.setDuration(b),qe("discover",e.currentTime),!e.capturedTimeline){let A=window.__timelines??{},_=Object.keys(A).filter(R=>A[R]);if(_.length>0){let D=X()?.getAttribute("data-composition-id")??null;N("root_timeline_unbound_registry_present",{reason:D?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:D,registeredTimelineKeys:_},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(D?`Root data-composition-id is "${D}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${_.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${D??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,xt(),Ie(!0)},Xt=null,zh=()=>{if(Xt)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),Xt=null,Pt()};Xt=c,window.addEventListener("hf-timelines-built",c)};C(()=>{Xt&&(window.removeEventListener("hf-timelines-built",Xt),Xt=null)}),Pt=()=>{if(!W){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,zh();return}if(qe("discover",e.currentTime),!Uh()){window.__renderReady=!1;return}if(!Wh()){window.__renderReady=!1;return}Vh()},Pt(),W&&setTimeout(()=>{Pt()},0);let Jr=0,Qr=!1,Lo=Number.NaN,Do=null,Zr=!1,yt=null,ei=!1,ql="",$l=-1,ti=!1,jl=Number.NEGATIVE_INFINITY,qh=(c,h,b,A)=>{try{let _=A?.suppressEvents===!0;st(c),typeof c.totalTime=="function"?c.totalTime(h,_):c.seek(h,_)}catch(_){I(b,_)}},$h=(c,h)=>{let b=window.__timelines??{},A=X()?.getAttribute("data-composition-id")??null;for(let[_,R]of Object.entries(b)){if(!R||_===A)continue;let D=document.querySelector(`[data-composition-id="${CSS.escape(_)}"]`);if(!D)continue;let H=j(D,0);if(!Number.isFinite(H))continue;let Y=K(R),re=tt(D)+xi(wt(D),Math.max(0,c-H)),Se=Math.max(0,Y!=null&&Y>0?Math.min(Y,re):re);qh(R,Se,"runtime.init.transport.childTimeline",h)}},jh=c=>{let h=window.__timelines??{},b=[];for(let A of Object.values(h))if(!(!A||A===c)){b.push(A);try{A.play()}catch(_){I("runtime.init.activateSiblings",_)}}return b},Kl=c=>typeof c=="object"&&c!==null,In=new WeakMap,Kh=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Yl=(c,h)=>{let b=c[h];if(typeof b!="function")return null;try{let A=Number(b.call(c));return Number.isFinite(A)?A:null}catch(A){return I("runtime.init.gsapCallbackDuration",A),null}},Yh=c=>{let h=In.get(c);if(h!=null)return h;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let b;try{b=c.getChildren(!0,!0,!0)}catch(A){return I("runtime.init.gsapCallbackChildren",A),In.set(c,!1),!1}if(!Array.isArray(b))return In.set(c,!1),!1;for(let A of b){if(!Kl(A))continue;let _=A.vars;if(!Kl(_)||!Kh.some(Y=>typeof _[Y]=="function"))continue;let H=Yl(A,"totalDuration")??Yl(A,"duration");if(H!=null&&H<=1e-6)return In.set(c,!0),!0}return In.set(c,!1),!1};function Ot(c,h){let b=e.capturedTimeline,A=b&&h?.activateChildren?jh(b):[];try{Xh(b,c,h)}finally{for(let _ of A)st(_)}}function Xh(c,h,b){let A=b?.suppressEvents===!0;if(c){let _=c,R=h;if(typeof _.totalDuration=="function")try{let D=Number(_.totalDuration());Number.isFinite(D)&&D>0&&h>D&&(R=D)}catch(D){I("runtime.init.transport.clampDuration",D)}try{typeof c.totalTime=="function"?(c.totalTime(R,A),!A&&!Yh(c)&&(c.totalTime(R+.001,!0),c.totalTime(R,!0))):c.seek(R,A)}catch(D){I("runtime.init.transport.seek",D)}}$h(h,b);for(let _ of e.deterministicAdapters)if(!(_.name==="gsap"&&c))try{_.seek({time:h,suppressEvents:A})}catch(R){I("runtime.init.transport.adapter",R)}}let Io=pp(document,()=>{Kt()});a.push(()=>Io.disconnect());let Jh=()=>{try{return Io.isActive()}catch{return!1}},Qh=()=>!f.isPlaying()&&!yl()&&Io.observing&&!Zr&&!ti&&e.currentTime===Lo&&e.capturedTimeline===Do,Xl=()=>`${Mn()}|${xl()??""}`,Jl=()=>{yt=window.setTimeout(Zh,e.bridgeMaxPostIntervalMs)},Zh=()=>{if(yt=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(Xl()!==ql){Kt();return}Ie(!1),Jl()}},e0=()=>{if(e.transportRafId=null,e.tornDown)return;let c=ei;if(ei=!1,c||!Qh()){e.transportRafId=window.requestAnimationFrame(Po);return}ql=Xl(),Jl()};Kt=()=>{e.tornDown||(ei=!0,!(Qr||e.transportRafId!=null)&&(yt!=null&&(window.clearTimeout(yt),yt=null),ei=!1,e.transportRafId=window.requestAnimationFrame(Po)))};let Po=()=>{if(!(e.tornDown||Qr)){Qr=!0;try{Jr+=1;let c=Mn();c!==$l&&($l=c,ti=!0);let h=Date.now(),b=ti&&!f.isPlaying()&&h-jl>=hp;if(b&&(jl=h),gp({tick:Jr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now(),compositionChanged:b})){let D=e.capturedTimeline;if(Fn()){e.capturedTimeline&&!$e._timeline&&($e._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==D&&st(e.capturedTimeline);let H=ze(e.capturedTimeline,0,c);H>0&&f.setDuration(H),xt()}}if((b||Jr%20===0)&&(xt(),ti=!1),(b||Jr%30===0)&&_o(),e.capturedTimeline){let D=ze(e.capturedTimeline,0,c);D>0&&(!f.isPlaying()||D>=f.getDuration())&&f.setDuration(D)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let D=m.getTime();D>=0&&f.attachAudioSource({currentTimeSeconds:D})}else{let D=document.querySelectorAll("audio[data-start]"),H=!1;for(let Y of D){if(!he(Y)||!Y.isConnected||g(Y))continue;let re=ee(Y),Se=Me(Y.dataset.duration),St=Se!=null&&Se>0?re+Se:1/0,ae=tt(Y);if(Number.isFinite(re)&&vt(e.currentTime,re,St)){Y.paused?!Y.error&&Y.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),H=!0):(f.attachAudioSource({el:Y,compositionStart:re,mediaStart:ae,rate:wt(Y)}),H=!0);break}}!H&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let A=f.now();e.currentTime=A;let _=f.isPlaying();if(!_&&Jh()?Zr=!0:(_||Zr||A!==Lo||e.capturedTimeline!==Do)&&(Ot(A),Lo=A,Do=e.capturedTimeline,_||(Zr=!1)),_&&Je.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let D=f.getDuration();Number.isFinite(D)&&(f.seek(D),e.currentTime=D,Ot(D)),qe("pause"),Ge(c),Ie(!0);return}f.isPlaying()?Ge(c):Gh()&&(Dn=null,Ge(c)),Ie(!1)}finally{Qr=!1,e0()}}},Ql=c=>{let h=document.querySelectorAll("video, audio");for(let b of h){if(!he(b)||!b.isConnected||!b.hasAttribute("data-start"))continue;let A=ee(b);if(!Number.isFinite(A))continue;let _=Me(b.dataset.duration),R=_!=null&&_>0?A+_:1/0;if(!vt(c,A,R))continue;let D=tt(b),H=c-A+D;if(H>=0)try{b.currentTime=H}catch{}}},Oo=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let b of h){if(!he(b)||!b.isConnected||g(b))continue;let A=ee(b);if(!Number.isFinite(A))continue;let _=tt(b),R=Number.parseFloat(b.dataset.volume??""),D=Number.isFinite(R)?R:1,H=Me(b.dataset.duration),Y=H!=null&&H>0?H:Number.POSITIVE_INFINITY,re=b.closest("[data-composition-id]");if(re){let ae=j(re,0),Q=P(re,{includeAuthoredTimingAttrs:!0});Q!=null&&Q>0&&(Y=Math.min(Y,Math.max(0,ae+Q-A)))}let Se=_n(b);if(wn(b,Se),typeof wt(b)!="number")continue;(Se.kind==="web-audio"?m.scheduleMediaElementPlayback(b,A,_,f.now(),D,c,e.playbackRate):Promise.resolve(null)).then(ae=>{if(ae||!f.isPlaying())return;let Q=e.playbackRate*Pe(b),we=b.hasAttribute("data-fx-chain")||b.hasAttribute("data-automation");if(Math.abs(Q-1)>1e-9){Se.kind==="web-audio"&&we&&(b.muted=!0);return}m.decodeAudioElement(b).then(Gt=>{!Gt||!f.isPlaying()||m.schedulePlayback(b,Gt,A,_,f.now(),D,c,e.playbackRate,Y)})})}};function Zl(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&p&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),Oo())}if(e.capturedTimeline){let c=ze(e.capturedTimeline,0);c>0&&f.setDuration(c),st(e.capturedTimeline)}ff(window),e.transportRafId=window.requestAnimationFrame(Po),xt(),Ie(!0),e.controlBridgeHandler=ru({onPlay:()=>{$e.play(),He("composition_played",{time:$e.getTime()})},onPause:()=>{$e.pause(),He("composition_paused",{time:$e.getTime()})},onStopMedia:()=>{m.stopAll();let c=document.querySelectorAll("video, audio");for(let h of c)he(h)&&!h.paused&&h.pause()},onSeek:(c,h)=>{$e.seek(c),He("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let h=c||e.mediaOutputMuted;m.setMuted(h);let b=document.querySelectorAll("video, audio");for(let A of b)he(A)&&(A.muted=h||A.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,m.setVolume(c);let h=document.querySelectorAll("video, audio");for(let b of h){if(!he(b))continue;let A=parseFloat(b.dataset.volume??""),_=Number.isFinite(A)?A:1;b.volume=mi(_*c)}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let h=c||e.bridgeMuted;m.setMuted(h);let b=document.querySelectorAll("video, audio");for(let A of b)he(A)&&(A.muted=h||A.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(m.stopAll(),f.detachAudioSource()):Ge())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(m.stopAll(),f.detachAudioSource()),Ge())},onSetPlaybackRate:c=>{No(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Zl()},onSetRootDuration:Bh,onSetColorGrading:(c,h)=>{Je.setGrading(c,h)},onSetColorGradingCompare:(c,h)=>{Je.setCompare(c,h)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let c=f.now();if(e.currentTime=c,Ot(c),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let h=f.getDuration();Number.isFinite(h)&&(f.seek(h),e.currentTime=h,Ot(h)),qe("pause"),Ge(),Ie(!0)}},onEnablePickMode:()=>Xr.enablePickMode(),onDisablePickMode:()=>Xr.disablePickMode(),onSetRuntimeData:fo,onClearRuntimeData:po,getCanonicalFps:()=>e.canonicalFps});let Go=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),yt!=null&&(window.clearTimeout(yt),yt=null),e.transportClock=null,m.destroy(),It!=null&&(window.clearTimeout(It),It=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Mh(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Xr.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(h){I("runtime.init.site12",h)}e.deterministicAdapters=[],window.__hf?.buildReady&&(window.__hf.buildReady={});for(let c of a.splice(0))try{c()}catch(h){I("runtime.init.site13",h)}for(let c of e.injectedCompStyles)try{c.remove()}catch(h){I("runtime.init.site14",h)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(h){I("runtime.init.site15",h)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(h){I("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===Go&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Go,e.beforeUnloadHandler=Go,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Pp=["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"],ll=[[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 vA(e){if(e<=255)return Pp[e];let t=0,n=ll.length-1;for(;t<=n;){let r=t+n>>1,i=ll[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function AA(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let d=e.charCodeAt(u),f=d,m=1;if(d>=55296&&d<=56319&&u+1<t){let g=e.charCodeAt(u+1);g>=56320&&g<=57343&&(f=(d-55296<<10)+(g-56320)+65536,m=2)}let p=vA(f);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let g=0;g<m;g++)n[u+g]=p;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let d=n[u];if(d==="L"){i=0;break}if(d==="R"||d==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let d;for(d=u-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=u+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let u=0;u<t;u++){let d=n[u];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let d=u+1;for(;d<t&&n[d]==="ON";)d++;let f=u>0?n[u-1]:l,m=d<t?n[d]:l,p=f!=="L"?"R":"L";if(p===(m!=="L"?"R":"L"))for(let y=u;y<d;y++)n[y]=p;u=d-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let d=n[u];(o[u]&1)===0?d==="R"?o[u]++:(d==="AN"||d==="EN")&&(o[u]+=2):(d==="L"||d==="AN"||d==="EN")&&o[u]++}return o}function Op(e,t){let n=AA(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var EA=/[ \t\n\r\f]+/g,_A=/[\t\n\r\f]| {2,}|^ | $/;function wA(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function CA(e){if(!_A.test(e))return e;let t=e.replace(EA," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function RA(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
712
712
  `).replace(/[\r\f]/g,`
713
713
  `):e.replace(/\r\n/g,`
714
- `)}var al=null,c1;function d1(){return al===null&&(al=new Intl.Segmenter(c1,{granularity:"word"})),al}var m1=/\p{Script=Arabic}/u,mo=/\p{M}/u,Lp=/\p{Nd}/u;function Cp(e){return m1.test(e)}function Rp(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Xe(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let i=(n-55296<<10)+(r-56320)+65536;if(Rp(i))return!0;t++;continue}}if(Rp(n))return!0}}return!1}function f1(e){let t=ho(e);return t!==null&&(po.has(t)||Ft.has(t))}var p1=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function h1(e){return Xe(e)}function g1(e){let t=ho(e);return t!==null&&p1.has(t)}function fo(e){return!f1(e)&&!g1(e)}var po=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"]),Pr=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),ll=new Set(["'","\u2019"]),Ft=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),b1=new Set([":",".","\u060C","\u061B"]),x1=new Set(["\u104F"]),y1=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function S1(e){if(ul(e))return!0;let t=!1;for(let n of e){if(Ft.has(n)){t=!0;continue}if(!(t&&mo.test(n)))return!1}return t}function v1(e){for(let t of e)if(!po.has(t)&&!Ft.has(t))return!1;return e.length>0}function A1(e){if(ul(e))return!0;for(let t of e)if(!Pr.has(t)&&!ll.has(t)&&!mo.test(t))return!1;return e.length>0}function ul(e){let t=!1;for(let n of e)if(!(n==="\\"||mo.test(n))){if(Pr.has(n)||Ft.has(n)||ll.has(n)){t=!0;continue}return!1}return t}function Dp(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function ho(e){if(e.length===0)return null;let t=Dp(e,e.length);return e.slice(t)}function E1(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(mo.test(r)){n--;continue}if(Pr.has(r)||ll.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function w1(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function Tp(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function kp(e,t){return e&&t!==null&&b1.has(t)}function _1(e){let t=ho(e);return t!==null&&x1.has(t)}function C1(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function go(e){let t=e.length;for(;t>0;){let n=Dp(e,t),r=e.slice(n,t);if(y1.has(r))return!0;if(!Ft.has(r))return!1;t=n}return!1}function R1(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
715
- `)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}var T1=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ve(e){return e.length===1?e[0]:e.join("")}function k1(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ve(n)}function M1(e,t,n,r){if(!T1.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let d of e){let f=R1(d,r),m=f==="text"&&t;if(o!==null&&f===o&&m===s){a.push(d),u+=d.length;continue}o!==null&&i.push({text:Ve(a),isWordLike:s,kind:o,start:l}),o=f,a=[d],l=n+u,s=m,u+=d.length}return o!==null&&i.push({text:Ve(a),isWordLike:s,kind:o,start:l}),i}function sl(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var F1=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function N1(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:F1.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function L1(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function D1(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!N1(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!sl(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ve(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function I1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!L1(a))continue;let l=o+1;if(l>=e.len||sl(e.kinds[l]))continue;let s=[],u=e.starts[l],d=l;for(;d<e.len&&!sl(e.kinds[d]);)s.push(e.texts[d]),d++;s.length>0&&(t.push(Ve(s)),n.push(!0),r.push("text"),i.push(u),o=d-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var P1=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Mp=/^[A-Za-z0-9_]+[,:;]*$/,Fp=/[,:;]+$/;function Ip(e){for(let t of e)if(Lp.test(t))return!0;return!1}function Ir(e){if(e.length===0)return!1;for(let t of e)if(!(Lp.test(t)||P1.has(t)))return!1;return!0}function O1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&Ir(a)&&Ip(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Ir(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ve(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function G1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Mp.test(a)){let u=[a],d=Fp.test(a),f=o+1;for(;d&&f<e.len&&e.kinds[f]==="text"&&e.isWordLike[f]&&Mp.test(e.texts[f]);){let m=e.texts[f];u.push(m),d=Fp.test(m),f++}t.push(Ve(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=f-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function H1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let d=l[u];if(!s)break;(d.length===0||!Ip(d)||!Ir(d))&&(s=!1)}if(s){let u=0;for(let d=0;d<l.length;d++){let f=l[d],m=d<l.length-1?`${f}-`:f;t.push(m),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=m.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function B1(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let d=[a[0]],f=u;for(o++;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let m=Ve(d);if(o<e.len&&e.kinds[o]==="text")a[0]=m,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=f,o++;else{t.push(m),n.push(!1),r.push("glue"),i.push(f);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let d=[];for(;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let f=Ve(d);if(o<e.len&&e.kinds[o]==="text"){a.push(f,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(f)}t.push(Ve(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function U1(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Xe(t[o])||!Xe(t[o+1]))continue;let a=E1(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Np(e,t,n){let r=d1(),i=0,o=[],a=[],l=[],s=[],u=[],d=[],f=[],m=[],p=[],g=[],y=[],x=[];for(let F of r.segment(e))for(let S of M1(F.segment,F.isWordLike??!1,F.index,n)){let W=function(){d[M]!==null&&(a[M]=[Tp(o,d,f,M)],d[M]=null),a[M].push(S.text),l[M]=l[M]||S.isWordLike,m[M]=m[M]||T,p[M]=p[M]||I,g[M]=j,y[M]=Y,x[M]=kp(p[M],H)},A=S.kind==="text",E=w1(S.text,S.isWordLike,S.kind),T=Xe(S.text),I=Cp(S.text),H=ho(S.text),j=go(S.text),Y=_1(S.text),M=i-1;t.carryCJKAfterClosingQuote&&A&&i>0&&s[M]==="text"&&T&&m[M]&&g[M]||A&&i>0&&s[M]==="text"&&v1(S.text)&&m[M]||A&&i>0&&s[M]==="text"&&y[M]?W():A&&i>0&&s[M]==="text"&&S.isWordLike&&I&&x[M]?(W(),l[M]=!0):E!==null&&i>0&&s[M]==="text"&&d[M]===E?f[M]=(f[M]??1)+1:A&&!S.isWordLike&&i>0&&s[M]==="text"&&(S1(S.text)||S.text==="-"&&l[M])?W():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,d[i]=E,f[i]=E===null?0:1,m[i]=T,p[i]=I,g[i]=j,y[i]=Y,x[i]=kp(I,H),i++)}for(let F=0;F<i;F++){if(d[F]!==null){o[F]=Tp(o,d,f,F);continue}o[F]=Ve(a[F])}for(let F=1;F<i;F++)s[F]==="text"&&!l[F]&&ul(o[F])&&s[F-1]==="text"&&(o[F-1]+=o[F],l[F-1]=l[F-1]||l[F],o[F]="");let _=Array.from({length:i},()=>null),k=-1;for(let F=i-1;F>=0;F--){let S=o[F];if(S.length!==0){if(s[F]==="text"&&!l[F]&&A1(S)&&k>=0&&s[k]==="text"){let A=_[k]??[];A.push(S),_[k]=A,u[k]=u[F],o[F]="";continue}k=F}}for(let F=0;F<i;F++){let S=_[F];S!=null&&(o[F]=k1(S,o[F]))}let C=0;for(let F=0;F<i;F++){let S=o[F];S.length!==0&&(C!==F&&(o[C]=S,l[C]=l[F],s[C]=s[F],u[C]=u[F]),C++)}o.length=C,l.length=C,s.length=C,u.length=C;let L=B1({len:C,texts:o,isWordLike:l,kinds:s,starts:u}),P=U1(G1(H1(O1(I1(D1(L))))));for(let F=0;F<P.len-1;F++){let S=C1(P.texts[F]);S!==null&&(P.kinds[F]!=="space"&&P.kinds[F]!=="preserved-space"||P.kinds[F+1]!=="text"||!Cp(P.texts[F+1])||(P.texts[F]=S.space,P.isWordLike[F]=!1,P.kinds[F]=P.kinds[F]==="preserved-space"?"preserved-space":"space",P.texts[F+1]=S.marks+P.texts[F+1],P.starts[F+1]=P.starts[F]+S.space.length))}return P}function W1(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function V1(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function d(){o!==null&&(t.push(Ve(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let f=0;f<e.len;f++){let m=e.texts[f],p=e.kinds[f],g=e.isWordLike[f],y=e.starts[f];if(p==="text"){let x=h1(m),_=fo(m);if(o!==null&&s&&u){o.push(m),a=a||g,s=s||x,u=_;continue}d(),o=[m],a=g,l=y,s=x,u=_;continue}d(),t.push(m),n.push(g),r.push(p),i.push(y)}return d(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Pp(e,t,n="normal",r="normal"){let i=s1(n),o=i.mode==="pre-wrap"?u1(e):l1(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?V1(Np(o,t,i)):Np(o,t,i);return{normalized:o,chunks:W1(a,i),...a}}var wn=null,Op=new Map,_n=null,z1=96,q1=/\p{Emoji_Presentation}/u,$1=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,cl=null,Gp=new Map;function dl(){if(wn!==null)return wn;if(typeof OffscreenCanvas<"u")return wn=new OffscreenCanvas(1,1).getContext("2d"),wn;if(typeof document<"u")return wn=document.createElement("canvas").getContext("2d"),wn;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function j1(e){let t=Op.get(e);return t||(t=new Map,Op.set(e,t)),t}function xt(e,t){let n=t.get(e);return n===void 0&&(n={width:dl().measureText(e).width,containsCJK:Xe(e)},t.set(e,n)),n}function Lt(){if(_n!==null)return _n;if(typeof navigator>"u")return _n={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},_n;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return _n={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},_n}function K1(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Hp(){return cl===null&&(cl=new Intl.Segmenter(void 0,{granularity:"grapheme"})),cl}function Y1(e){return q1.test(e)||e.includes("\uFE0F")}function Bp(e){return $1.test(e)}function X1(e,t){let n=Gp.get(e);if(n!==void 0)return n;let r=dl();r.font=e;let i=r.measureText("\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return Gp.set(e,n),n}function J1(e){let t=0,n=Hp();for(let r of n.segment(e))Y1(r.segment)&&t++;return t}function Q1(e,t){return t.emojiCount===void 0&&(t.emojiCount=J1(e)),t.emojiCount}function Nt(e,t,n){return n===0?t.width:t.width-Q1(e,t)*n}function Up(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Hp(),a=[];for(let d of o.segment(e))a.push(d.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let d=[];for(let f of a){let m=xt(f,n);d.push(Nt(f,m,r))}return t.breakableFitAdvances=d,t.breakableFitAdvances}if(i==="pair-context"||a.length>z1){let d=[],f=null,m=0;for(let p of a){let g=xt(p,n),y=Nt(p,g,r);if(f===null)d.push(y);else{let x=f+p,_=xt(x,n);d.push(Nt(x,_,r)-m)}f=p,m=y}return t.breakableFitAdvances=d,t.breakableFitAdvances}let l=[],s="",u=0;for(let d of a){s+=d;let f=xt(s,n),m=Nt(s,f,r);l.push(m-u),u=m}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Wp(e,t){let n=dl();n.font=e;let r=j1(e),i=K1(e),o=t?X1(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function Z1(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function Vp(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function zp(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function eA(e,t){let n=0,r=e.chunks.length;for(;n<r;){let i=Math.floor((n+r)/2);t<e.chunks[i].consumedEndSegmentIndex?r=i:n=i+1}return n<e.chunks.length?n:-1}function qp(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let i=e.chunks[t];if(i.startSegmentIndex===i.endSegmentIndex&&r===i.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<i.startSegmentIndex&&(r=i.startSegmentIndex);r<i.endSegmentIndex;){let o=e.kinds[r];if(o!=="space"&&o!=="zero-width-break"&&o!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return i.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=i.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function $p(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=eA(e,t.segmentIndex);return n<0?-1:qp(e,n,t)}function tA(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:qp(e,r,n)}function jp(e,t){return e.simpleLineWalkFastPath?Kp(e,t):ml(e,t)}function Kp(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=Lt().lineFitEpsilon,s=t+l,u=0,d=0,f=!1,m=0,p=0,g=0,y=0,x=-1,_=0;function k(){x=-1,_=0}function C(E=g,T=y,I=d){u++,n?.({startSegmentIndex:m,startGraphemeIndex:p,endSegmentIndex:E,endGraphemeIndex:T,width:I}),d=0,f=!1,k()}function L(E,T){f=!0,m=E,p=0,g=E+1,y=0,d=T}function P(E,T,I){f=!0,m=E,p=T,g=E,y=T+1,d=I}function F(E,T){if(!f){L(E,T);return}d+=T,g=E+1,y=0}function S(E,T){let I=o[E];for(let H=T;H<I.length;H++){let j=I[H];f?d+j>s?(C(),P(E,H,j)):(d+=j,g=E,y=H+1):P(E,H,j)}f&&g===E&&y===I.length&&(g=E+1,y=0)}let A=0;for(;A<r.length&&!(!f&&(A=Z1(e,A),A>=r.length));){let E=r[A],T=i[A],I=T==="space"||T==="preserved-space"||T==="tab"||T==="zero-width-break"||T==="soft-hyphen";if(!f){E>t&&o[A]!==null?S(A,0):L(A,E),I&&(x=A+1,_=d-E),A++;continue}if(d+E>s){if(I){F(A,E),C(A+1,0,d-E),A++;continue}if(x>=0){if(g>x||g===x&&y>0){C();continue}C(x,0,_);continue}if(E>t&&o[A]!==null){C(),S(A,0),A++;continue}C();continue}F(A,E),I&&(x=A+1,_=d-E),A++}return f&&C(),u}function ml(e,t,n){if(e.simpleLineWalkFastPath)return Kp(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:d}=e;if(r.length===0||d.length===0)return 0;let f=Lt(),m=f.lineFitEpsilon,p=t+m,g=0,y=0,x=!1,_=0,k=0,C=0,L=0,P=-1,F=0,S=0,A=null;function E(){P=-1,F=0,S=0,A=null}function T(U=C,K=L,z=y){g++,n?.({startSegmentIndex:_,startGraphemeIndex:k,endSegmentIndex:U,endGraphemeIndex:K,width:z}),y=0,x=!1,E()}function I(U,K){x=!0,_=U,k=0,C=U+1,L=0,y=K}function H(U,K,z){x=!0,_=U,k=K,C=U,L=K+1,y=z}function j(U,K){if(!x){I(U,K);return}y+=K,C=U+1,L=0}function Y(U,K,z,J){if(!K)return;let G=U==="tab"?0:i[z],O=U==="tab"?J:o[z];P=z+1,F=y-J+G,S=y-J+O,A=U}function M(U,K){let z=l[U];for(let J=K;J<z.length;J++){let G=z[J];x?y+G>p?(T(),H(U,J,G)):(y+=G,C=U,L=J+1):H(U,J,G)}x&&C===U&&L===z.length&&(C=U+1,L=0)}function W(U){if(A!=="soft-hyphen")return!1;let K=l[U];if(K==null)return!1;let{fitCount:z,fittedWidth:J}=zp(K,y,t,m,s);return z===0?!1:(y=J,C=U,L=z,E(),z===K.length?(C=U+1,L=0,!0):(T(U,z,J+s),M(U,z),!0))}function te(U){g++,n?.({startSegmentIndex:U.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:U.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),E()}for(let U=0;U<d.length;U++){let K=d[U];if(K.startSegmentIndex===K.endSegmentIndex){te(K);continue}x=!1,y=0,_=K.startSegmentIndex,k=0,C=K.startSegmentIndex,L=0,E();let z=K.startSegmentIndex;for(;z<K.endSegmentIndex;){let J=a[z],G=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",O=J==="tab"?Vp(y,u):r[z];if(J==="soft-hyphen"){x&&(C=z+1,L=0,P=z+1,F=y+s,S=y+s,A=J),z++;continue}if(!x){O>t&&l[z]!==null?M(z,0):I(z,O),Y(J,G,z,O),z++;continue}if(y+O>p){let Z=y+(J==="tab"?0:i[z]),ce=y+(J==="tab"?O:o[z]);if(A==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&F<=p){T(P,0,S);continue}if(A==="soft-hyphen"&&W(z)){z++;continue}if(G&&Z<=p){j(z,O),T(z+1,0,ce),z++;continue}if(P>=0&&F<=p){if(C>P||C===P&&L>0){T();continue}let re=P;T(re,0,S),z=re;continue}if(O>t&&l[z]!==null){T(),M(z,0),z++;continue}T();continue}j(z,O),Y(J,G,z,O),z++}if(x){let J=P===K.consumedEndSegmentIndex?S:y;T(K.consumedEndSegmentIndex,0,J)}}return g}function Yp(e,t,n,r){let i=e.chunks[n];if(i.startSegmentIndex===i.endSegmentIndex)return t.segmentIndex=i.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:o,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:d,tabStopAdvance:f}=e,m=Lt(),p=m.lineFitEpsilon,g=r+p,y=0,x=!1,_=t.segmentIndex,k=t.graphemeIndex,C=-1,L=0,P=0,F=null;function S(){C=-1,L=0,P=0,F=null}function A(M=_,W=k,te=y){return x?(t.segmentIndex=M,t.graphemeIndex=W,te):null}function E(M,W){x=!0,_=M+1,k=0,y=W}function T(M,W,te){x=!0,_=M,k=W+1,y=te}function I(M,W){if(!x){E(M,W);return}y+=W,_=M+1,k=0}function H(M,W,te,U){if(!W)return;let K=M==="tab"?0:a[te],z=M==="tab"?U:l[te];C=te+1,L=y-U+K,P=y-U+z,F=M}function j(M,W){let te=u[M];for(let U=W;U<te.length;U++){let K=te[U];if(!x)T(M,U,K);else{if(y+K>g)return A();y+=K,_=M,k=U+1}}return x&&_===M&&k===te.length&&(_=M+1,k=0),null}function Y(M){if(F!=="soft-hyphen"||C<0)return null;let W=u[M]??null;if(W!==null){let{fitCount:te,fittedWidth:U}=zp(W,y,r,p,d);if(te===W.length)return y=U,_=M+1,k=0,S(),null;if(te>0)return A(M,te,U+d)}return L<=g?A(C,0,P):null}for(let M=t.segmentIndex;M<i.endSegmentIndex;M++){let W=s[M],te=W==="space"||W==="preserved-space"||W==="tab"||W==="zero-width-break"||W==="soft-hyphen",U=M===t.segmentIndex?t.graphemeIndex:0,K=W==="tab"?Vp(y,f):o[M];if(W==="soft-hyphen"&&U===0){x&&(_=M+1,k=0,C=M+1,L=y+d,P=y+d,F=W);continue}if(!x){if(U>0){let J=j(M,U);if(J!==null)return J}else if(K>r&&u[M]!==null){let J=j(M,0);if(J!==null)return J}else E(M,K);H(W,te,M,K);continue}if(y+K>g){let J=y+(W==="tab"?0:a[M]),G=y+(W==="tab"?K:l[M]);if(F==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&L<=g)return A(C,0,P);let O=Y(M);if(O!==null)return O;if(te&&J<=g)return I(M,K),A(M+1,0,G);if(C>=0&&L<=g)return _>C||_===C&&k>0?A():A(C,0,P);if(K>r&&u[M]!==null){let q=A();if(q!==null)return q;let Z=j(M,0);if(Z!==null)return Z}return A()}I(M,K),H(W,te,M,K)}return C===i.consumedEndSegmentIndex&&k===0?A(i.consumedEndSegmentIndex,0,P):A(i.consumedEndSegmentIndex,0,y)}function nA(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e,l=Lt().lineFitEpsilon,s=n+l,u=0,d=!1,f=t.segmentIndex,m=t.graphemeIndex,p=-1,g=0;for(let y=t.segmentIndex;y<r.length;y++){let x=r[y],_=i[y],k=_==="space"||_==="preserved-space"||_==="tab"||_==="zero-width-break"||_==="soft-hyphen",C=y===t.segmentIndex?t.graphemeIndex:0,L=o[y];if(!d){if(C>0||x>n&&L!==null){let P=L,F=P[C];d=!0,u=F,f=y,m=C+1;for(let S=C+1;S<P.length;S++){let A=P[S];if(u+A>s)return t.segmentIndex=f,t.graphemeIndex=m,u;u+=A,f=y,m=S+1}f===y&&m===P.length&&(f=y+1,m=0)}else d=!0,u=x,f=y+1,m=0;k&&(p=y+1,g=u-x);continue}if(u+x>s)return k?(t.segmentIndex=y+1,t.graphemeIndex=0,u):p>=0?f>p||f===p&&m>0?(t.segmentIndex=f,t.graphemeIndex=m,u):(t.segmentIndex=p,t.graphemeIndex=0,g):(t.segmentIndex=f,t.graphemeIndex=m,u);u+=x,f=y+1,m=0,k&&(p=y+1,g=u-x)}return d?(t.segmentIndex=f,t.graphemeIndex=m,u):null}function rA(e,t,n){let r=$p(e,t);return r<0?null:e.simpleLineWalkFastPath?nA(e,t,n):Yp(e,t,r,n)}function Xp(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,i=0;if(!e.simpleLineWalkFastPath){let o=$p(e,n);for(;o>=0;){let a=Yp(e,n,o,t);if(a===null)return{lineCount:r,maxLineWidth:i};r++,a>i&&(i=a),o=tA(e,o,n)}return{lineCount:r,maxLineWidth:i}}for(;;){let o=rA(e,n,t);if(o===null)return{lineCount:r,maxLineWidth:i};r++,o>i&&(i=o)}}var fl=null;function iA(){return fl===null&&(fl=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fl}function oA(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function aA(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(f,m,p){r=[f],i=m,o=p,a=go(f),l=Pr.has(f)}function d(f,m){r.push(f),o=o||m;let p=go(f);f.length===1&&Ft.has(f)?a=a||p:a=p,l=!1}for(let f of iA().segment(e)){let m=f.segment,p=Xe(m);if(r.length===0){u(m,f.index,p);continue}if(l||po.has(m)||Ft.has(m)||t.carryCJKAfterClosingQuote&&p&&a){d(m,p);continue}if(!o&&!p){d(m,p);continue}s(),u(m,f.index,p)}return s(),n}function sA(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Xe(e[0].text),o=fo(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=Xe(s.text),d=fo(s.text);if(i&&o){n.push(s.text),i=i||u,o=d;continue}a(),n=[s.text],r=s.start,i=u,o=d}return a(),t}function lA(e,t,n,r){let i=Lt(),{cache:o,emojiCorrection:a}=Wp(t,Bp(e.normalized)),l=Nt("-",xt("-",o),a),u=Nt(" ",xt(" ",o),a)*8;if(e.len===0)return oA(n);let d=[],f=[],m=[],p=[],g=e.chunks.length<=1,y=n?[]:null,x=[],_=n?[]:null,k=Array.from({length:e.len});function C(S,A,E,T,I,H,j){I!=="text"&&I!=="space"&&I!=="zero-width-break"&&(g=!1),d.push(A),f.push(E),m.push(T),p.push(I),y?.push(H),x.push(j),_!==null&&_.push(S)}function L(S,A,E,T,I){let H=xt(S,o),j=Nt(S,H,a),Y=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:j,M=A==="space"||A==="zero-width-break"?0:j;if(I&&T&&S.length>1){let W="sum-graphemes";Ir(S)?W="pair-context":i.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");let te=Up(S,H,o,a,W);C(S,j,Y,M,A,E,te);return}C(S,j,Y,M,A,E,null)}for(let S=0;S<e.len;S++){k[S]=d.length;let A=e.texts[S],E=e.isWordLike[S],T=e.kinds[S],I=e.starts[S];if(T==="soft-hyphen"){C(A,0,l,l,T,I,null);continue}if(T==="hard-break"){C(A,0,0,0,T,I,null);continue}if(T==="tab"){C(A,0,0,0,T,I,null);continue}let H=xt(A,o);if(T==="text"&&H.containsCJK){let j=aA(A,i),Y=r==="keep-all"?sA(j):j;for(let M=0;M<Y.length;M++){let W=Y[M];L(W.text,"text",I+W.start,E,r==="keep-all"||!Xe(W.text))}continue}L(A,T,I,E,!0)}let P=uA(e.chunks,k,d.length),F=y===null?null:_p(e.normalized,y);return _!==null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:g,segLevels:F,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P,segments:_}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:g,segLevels:F,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P}}function uA(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function Jp(e,t,n,r){let i=r?.wordBreak??"normal",o=Pp(e,Lt(),r?.whiteSpace,i);return lA(o,t,n,i)}function bo(e,t,n){return Jp(e,t,!1,n)}function Qp(e,t,n){return Jp(e,t,!0,n)}function xo(e,t,n){let r=jp(e,t);return{lineCount:r,height:r*n}}function cA(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function dA(e,t,n){return e.widths.length===0?0:ml(e,t,r=>{n(cA(r))})}function Zp(e,t){return Xp(e,t)}function eh(e){let t=0;return dA(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var mA={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function th(e,t){let n={...mA,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=bo(e,o),{lineCount:l}=xo(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}var nh={prepare:bo,layout:xo,prepareWithSegments:Qp,measureLineStats:Zp,measureNaturalWidth:eh};window.__timelines=window.__timelines||{};hf();window.__hyperframes={fitTextFontSize:th,getVariables:iu,pretext:nh,registerRuntimeDataHandler:Sp,setRuntimeData:uo,clearRuntimeData:co};function rh(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Ep())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",rh,{once:!0}):rh();})();
714
+ `)}var ul=null,TA;function kA(){return ul===null&&(ul=new Intl.Segmenter(TA,{granularity:"word"})),ul}var MA=/\p{Script=Arabic}/u,ho=/\p{M}/u,qp=/\p{Nd}/u;function Gp(e){return MA.test(e)}function Hp(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Xe(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let i=(n-55296<<10)+(r-56320)+65536;if(Hp(i))return!0;t++;continue}}if(Hp(n))return!0}}return!1}function FA(e){let t=xo(e);return t!==null&&(bo.has(t)||Ft.has(t))}var NA=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function LA(e){return Xe(e)}function DA(e){let t=xo(e);return t!==null&&NA.has(t)}function go(e){return!FA(e)&&!DA(e)}var bo=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"]),Hr=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),dl=new Set(["'","\u2019"]),Ft=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),IA=new Set([":",".","\u060C","\u061B"]),PA=new Set(["\u104F"]),OA=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function GA(e){if(ml(e))return!0;let t=!1;for(let n of e){if(Ft.has(n)){t=!0;continue}if(!(t&&ho.test(n)))return!1}return t}function HA(e){for(let t of e)if(!bo.has(t)&&!Ft.has(t))return!1;return e.length>0}function BA(e){if(ml(e))return!0;for(let t of e)if(!Hr.has(t)&&!dl.has(t)&&!ho.test(t))return!1;return e.length>0}function ml(e){let t=!1;for(let n of e)if(!(n==="\\"||ho.test(n))){if(Hr.has(n)||Ft.has(n)||dl.has(n)){t=!0;continue}return!1}return t}function $p(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function xo(e){if(e.length===0)return null;let t=$p(e,e.length);return e.slice(t)}function UA(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(ho.test(r)){n--;continue}if(Hr.has(r)||dl.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function WA(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function Bp(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function Up(e,t){return e&&t!==null&&IA.has(t)}function VA(e){let t=xo(e);return t!==null&&PA.has(t)}function zA(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function yo(e){let t=e.length;for(;t>0;){let n=$p(e,t),r=e.slice(n,t);if(OA.has(r))return!0;if(!Ft.has(r))return!1;t=n}return!1}function qA(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
715
+ `)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}var $A=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ve(e){return e.length===1?e[0]:e.join("")}function jA(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ve(n)}function KA(e,t,n,r){if(!$A.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let d of e){let f=qA(d,r),m=f==="text"&&t;if(o!==null&&f===o&&m===s){a.push(d),u+=d.length;continue}o!==null&&i.push({text:Ve(a),isWordLike:s,kind:o,start:l}),o=f,a=[d],l=n+u,s=m,u+=d.length}return o!==null&&i.push({text:Ve(a),isWordLike:s,kind:o,start:l}),i}function cl(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var YA=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function XA(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:YA.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function JA(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function QA(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!XA(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!cl(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ve(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function ZA(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!JA(a))continue;let l=o+1;if(l>=e.len||cl(e.kinds[l]))continue;let s=[],u=e.starts[l],d=l;for(;d<e.len&&!cl(e.kinds[d]);)s.push(e.texts[d]),d++;s.length>0&&(t.push(Ve(s)),n.push(!0),r.push("text"),i.push(u),o=d-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var e1=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Wp=/^[A-Za-z0-9_]+[,:;]*$/,Vp=/[,:;]+$/;function jp(e){for(let t of e)if(qp.test(t))return!0;return!1}function Gr(e){if(e.length===0)return!1;for(let t of e)if(!(qp.test(t)||e1.has(t)))return!1;return!0}function t1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&Gr(a)&&jp(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Gr(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ve(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function n1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Wp.test(a)){let u=[a],d=Vp.test(a),f=o+1;for(;d&&f<e.len&&e.kinds[f]==="text"&&e.isWordLike[f]&&Wp.test(e.texts[f]);){let m=e.texts[f];u.push(m),d=Vp.test(m),f++}t.push(Ve(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=f-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function r1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let d=l[u];if(!s)break;(d.length===0||!jp(d)||!Gr(d))&&(s=!1)}if(s){let u=0;for(let d=0;d<l.length;d++){let f=l[d],m=d<l.length-1?`${f}-`:f;t.push(m),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=m.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function i1(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let d=[a[0]],f=u;for(o++;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let m=Ve(d);if(o<e.len&&e.kinds[o]==="text")a[0]=m,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=f,o++;else{t.push(m),n.push(!1),r.push("glue"),i.push(f);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let d=[];for(;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let f=Ve(d);if(o<e.len&&e.kinds[o]==="text"){a.push(f,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(f)}t.push(Ve(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function o1(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Xe(t[o])||!Xe(t[o+1]))continue;let a=UA(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function zp(e,t,n){let r=kA(),i=0,o=[],a=[],l=[],s=[],u=[],d=[],f=[],m=[],p=[],g=[],y=[],x=[];for(let F of r.segment(e))for(let S of KA(F.segment,F.isWordLike??!1,F.index,n)){let V=function(){d[M]!==null&&(a[M]=[Bp(o,d,f,M)],d[M]=null),a[M].push(S.text),l[M]=l[M]||S.isWordLike,m[M]=m[M]||T,p[M]=p[M]||L,g[M]=z,y[M]=X,x[M]=Up(p[M],G)},v=S.kind==="text",E=WA(S.text,S.isWordLike,S.kind),T=Xe(S.text),L=Gp(S.text),G=xo(S.text),z=yo(S.text),X=VA(S.text),M=i-1;t.carryCJKAfterClosingQuote&&v&&i>0&&s[M]==="text"&&T&&m[M]&&g[M]||v&&i>0&&s[M]==="text"&&HA(S.text)&&m[M]||v&&i>0&&s[M]==="text"&&y[M]?V():v&&i>0&&s[M]==="text"&&S.isWordLike&&L&&x[M]?(V(),l[M]=!0):E!==null&&i>0&&s[M]==="text"&&d[M]===E?f[M]=(f[M]??1)+1:v&&!S.isWordLike&&i>0&&s[M]==="text"&&(GA(S.text)||S.text==="-"&&l[M])?V():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,d[i]=E,f[i]=E===null?0:1,m[i]=T,p[i]=L,g[i]=z,y[i]=X,x[i]=Up(L,G),i++)}for(let F=0;F<i;F++){if(d[F]!==null){o[F]=Bp(o,d,f,F);continue}o[F]=Ve(a[F])}for(let F=1;F<i;F++)s[F]==="text"&&!l[F]&&ml(o[F])&&s[F-1]==="text"&&(o[F-1]+=o[F],l[F-1]=l[F-1]||l[F],o[F]="");let w=Array.from({length:i},()=>null),k=-1;for(let F=i-1;F>=0;F--){let S=o[F];if(S.length!==0){if(s[F]==="text"&&!l[F]&&BA(S)&&k>=0&&s[k]==="text"){let v=w[k]??[];v.push(S),w[k]=v,u[k]=u[F],o[F]="";continue}k=F}}for(let F=0;F<i;F++){let S=w[F];S!=null&&(o[F]=jA(S,o[F]))}let C=0;for(let F=0;F<i;F++){let S=o[F];S.length!==0&&(C!==F&&(o[C]=S,l[C]=l[F],s[C]=s[F],u[C]=u[F]),C++)}o.length=C,l.length=C,s.length=C,u.length=C;let N=i1({len:C,texts:o,isWordLike:l,kinds:s,starts:u}),O=o1(n1(r1(t1(ZA(QA(N))))));for(let F=0;F<O.len-1;F++){let S=zA(O.texts[F]);S!==null&&(O.kinds[F]!=="space"&&O.kinds[F]!=="preserved-space"||O.kinds[F+1]!=="text"||!Gp(O.texts[F+1])||(O.texts[F]=S.space,O.isWordLike[F]=!1,O.kinds[F]=O.kinds[F]==="preserved-space"?"preserved-space":"space",O.texts[F+1]=S.marks+O.texts[F+1],O.starts[F+1]=O.starts[F]+S.space.length))}return O}function a1(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function s1(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function d(){o!==null&&(t.push(Ve(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let f=0;f<e.len;f++){let m=e.texts[f],p=e.kinds[f],g=e.isWordLike[f],y=e.starts[f];if(p==="text"){let x=LA(m),w=go(m);if(o!==null&&s&&u){o.push(m),a=a||g,s=s||x,u=w;continue}d(),o=[m],a=g,l=y,s=x,u=w;continue}d(),t.push(m),n.push(g),r.push(p),i.push(y)}return d(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Kp(e,t,n="normal",r="normal"){let i=wA(n),o=i.mode==="pre-wrap"?RA(e):CA(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?s1(zp(o,t,i)):zp(o,t,i);return{normalized:o,chunks:a1(a,i),...a}}var Cn=null,Yp=new Map,Rn=null,l1=96,u1=/\p{Emoji_Presentation}/u,c1=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,fl=null,Xp=new Map;function pl(){if(Cn!==null)return Cn;if(typeof OffscreenCanvas<"u")return Cn=new OffscreenCanvas(1,1).getContext("2d"),Cn;if(typeof document<"u")return Cn=document.createElement("canvas").getContext("2d"),Cn;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function d1(e){let t=Yp.get(e);return t||(t=new Map,Yp.set(e,t)),t}function bt(e,t){let n=t.get(e);return n===void 0&&(n={width:pl().measureText(e).width,containsCJK:Xe(e)},t.set(e,n)),n}function Lt(){if(Rn!==null)return Rn;if(typeof navigator>"u")return Rn={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Rn;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Rn={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Rn}function m1(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Jp(){return fl===null&&(fl=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fl}function f1(e){return u1.test(e)||e.includes("\uFE0F")}function Qp(e){return c1.test(e)}function p1(e,t){let n=Xp.get(e);if(n!==void 0)return n;let r=pl();r.font=e;let i=r.measureText("\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return Xp.set(e,n),n}function h1(e){let t=0,n=Jp();for(let r of n.segment(e))f1(r.segment)&&t++;return t}function g1(e,t){return t.emojiCount===void 0&&(t.emojiCount=h1(e)),t.emojiCount}function Nt(e,t,n){return n===0?t.width:t.width-g1(e,t)*n}function Zp(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Jp(),a=[];for(let d of o.segment(e))a.push(d.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let d=[];for(let f of a){let m=bt(f,n);d.push(Nt(f,m,r))}return t.breakableFitAdvances=d,t.breakableFitAdvances}if(i==="pair-context"||a.length>l1){let d=[],f=null,m=0;for(let p of a){let g=bt(p,n),y=Nt(p,g,r);if(f===null)d.push(y);else{let x=f+p,w=bt(x,n);d.push(Nt(x,w,r)-m)}f=p,m=y}return t.breakableFitAdvances=d,t.breakableFitAdvances}let l=[],s="",u=0;for(let d of a){s+=d;let f=bt(s,n),m=Nt(s,f,r);l.push(m-u),u=m}return t.breakableFitAdvances=l,t.breakableFitAdvances}function eh(e,t){let n=pl();n.font=e;let r=d1(e),i=m1(e),o=t?p1(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function b1(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function th(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function nh(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function x1(e,t){let n=0,r=e.chunks.length;for(;n<r;){let i=Math.floor((n+r)/2);t<e.chunks[i].consumedEndSegmentIndex?r=i:n=i+1}return n<e.chunks.length?n:-1}function rh(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let i=e.chunks[t];if(i.startSegmentIndex===i.endSegmentIndex&&r===i.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<i.startSegmentIndex&&(r=i.startSegmentIndex);r<i.endSegmentIndex;){let o=e.kinds[r];if(o!=="space"&&o!=="zero-width-break"&&o!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return i.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=i.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function ih(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=x1(e,t.segmentIndex);return n<0?-1:rh(e,n,t)}function y1(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:rh(e,r,n)}function oh(e,t){return e.simpleLineWalkFastPath?ah(e,t):hl(e,t)}function ah(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=Lt().lineFitEpsilon,s=t+l,u=0,d=0,f=!1,m=0,p=0,g=0,y=0,x=-1,w=0;function k(){x=-1,w=0}function C(E=g,T=y,L=d){u++,n?.({startSegmentIndex:m,startGraphemeIndex:p,endSegmentIndex:E,endGraphemeIndex:T,width:L}),d=0,f=!1,k()}function N(E,T){f=!0,m=E,p=0,g=E+1,y=0,d=T}function O(E,T,L){f=!0,m=E,p=T,g=E,y=T+1,d=L}function F(E,T){if(!f){N(E,T);return}d+=T,g=E+1,y=0}function S(E,T){let L=o[E];for(let G=T;G<L.length;G++){let z=L[G];f?d+z>s?(C(),O(E,G,z)):(d+=z,g=E,y=G+1):O(E,G,z)}f&&g===E&&y===L.length&&(g=E+1,y=0)}let v=0;for(;v<r.length&&!(!f&&(v=b1(e,v),v>=r.length));){let E=r[v],T=i[v],L=T==="space"||T==="preserved-space"||T==="tab"||T==="zero-width-break"||T==="soft-hyphen";if(!f){E>t&&o[v]!==null?S(v,0):N(v,E),L&&(x=v+1,w=d-E),v++;continue}if(d+E>s){if(L){F(v,E),C(v+1,0,d-E),v++;continue}if(x>=0){if(g>x||g===x&&y>0){C();continue}C(x,0,w);continue}if(E>t&&o[v]!==null){C(),S(v,0),v++;continue}C();continue}F(v,E),L&&(x=v+1,w=d-E),v++}return f&&C(),u}function hl(e,t,n){if(e.simpleLineWalkFastPath)return ah(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:d}=e;if(r.length===0||d.length===0)return 0;let f=Lt(),m=f.lineFitEpsilon,p=t+m,g=0,y=0,x=!1,w=0,k=0,C=0,N=0,O=-1,F=0,S=0,v=null;function E(){O=-1,F=0,S=0,v=null}function T(B=C,q=N,$=y){g++,n?.({startSegmentIndex:w,startGraphemeIndex:k,endSegmentIndex:B,endGraphemeIndex:q,width:$}),y=0,x=!1,E()}function L(B,q){x=!0,w=B,k=0,C=B+1,N=0,y=q}function G(B,q,$){x=!0,w=B,k=q,C=B,N=q+1,y=$}function z(B,q){if(!x){L(B,q);return}y+=q,C=B+1,N=0}function X(B,q,$,J){if(!q)return;let j=B==="tab"?0:i[$],P=B==="tab"?J:o[$];O=$+1,F=y-J+j,S=y-J+P,v=B}function M(B,q){let $=l[B];for(let J=q;J<$.length;J++){let j=$[J];x?y+j>p?(T(),G(B,J,j)):(y+=j,C=B,N=J+1):G(B,J,j)}x&&C===B&&N===$.length&&(C=B+1,N=0)}function V(B){if(v!=="soft-hyphen")return!1;let q=l[B];if(q==null)return!1;let{fitCount:$,fittedWidth:J}=nh(q,y,t,m,s);return $===0?!1:(y=J,C=B,N=$,E(),$===q.length?(C=B+1,N=0,!0):(T(B,$,J+s),M(B,$),!0))}function te(B){g++,n?.({startSegmentIndex:B.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:B.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),E()}for(let B=0;B<d.length;B++){let q=d[B];if(q.startSegmentIndex===q.endSegmentIndex){te(q);continue}x=!1,y=0,w=q.startSegmentIndex,k=0,C=q.startSegmentIndex,N=0,E();let $=q.startSegmentIndex;for(;$<q.endSegmentIndex;){let J=a[$],j=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",P=J==="tab"?th(y,u):r[$];if(J==="soft-hyphen"){x&&(C=$+1,N=0,O=$+1,F=y+s,S=y+s,v=J),$++;continue}if(!x){P>t&&l[$]!==null?M($,0):L($,P),X(J,j,$,P),$++;continue}if(y+P>p){let ee=y+(J==="tab"?0:i[$]),pe=y+(J==="tab"?P:o[$]);if(v==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&F<=p){T(O,0,S);continue}if(v==="soft-hyphen"&&V($)){$++;continue}if(j&&ee<=p){z($,P),T($+1,0,pe),$++;continue}if(O>=0&&F<=p){if(C>O||C===O&&N>0){T();continue}let ne=O;T(ne,0,S),$=ne;continue}if(P>t&&l[$]!==null){T(),M($,0),$++;continue}T();continue}z($,P),X(J,j,$,P),$++}if(x){let J=O===q.consumedEndSegmentIndex?S:y;T(q.consumedEndSegmentIndex,0,J)}}return g}function sh(e,t,n,r){let i=e.chunks[n];if(i.startSegmentIndex===i.endSegmentIndex)return t.segmentIndex=i.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:o,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:d,tabStopAdvance:f}=e,m=Lt(),p=m.lineFitEpsilon,g=r+p,y=0,x=!1,w=t.segmentIndex,k=t.graphemeIndex,C=-1,N=0,O=0,F=null;function S(){C=-1,N=0,O=0,F=null}function v(M=w,V=k,te=y){return x?(t.segmentIndex=M,t.graphemeIndex=V,te):null}function E(M,V){x=!0,w=M+1,k=0,y=V}function T(M,V,te){x=!0,w=M,k=V+1,y=te}function L(M,V){if(!x){E(M,V);return}y+=V,w=M+1,k=0}function G(M,V,te,B){if(!V)return;let q=M==="tab"?0:a[te],$=M==="tab"?B:l[te];C=te+1,N=y-B+q,O=y-B+$,F=M}function z(M,V){let te=u[M];for(let B=V;B<te.length;B++){let q=te[B];if(!x)T(M,B,q);else{if(y+q>g)return v();y+=q,w=M,k=B+1}}return x&&w===M&&k===te.length&&(w=M+1,k=0),null}function X(M){if(F!=="soft-hyphen"||C<0)return null;let V=u[M]??null;if(V!==null){let{fitCount:te,fittedWidth:B}=nh(V,y,r,p,d);if(te===V.length)return y=B,w=M+1,k=0,S(),null;if(te>0)return v(M,te,B+d)}return N<=g?v(C,0,O):null}for(let M=t.segmentIndex;M<i.endSegmentIndex;M++){let V=s[M],te=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",B=M===t.segmentIndex?t.graphemeIndex:0,q=V==="tab"?th(y,f):o[M];if(V==="soft-hyphen"&&B===0){x&&(w=M+1,k=0,C=M+1,N=y+d,O=y+d,F=V);continue}if(!x){if(B>0){let J=z(M,B);if(J!==null)return J}else if(q>r&&u[M]!==null){let J=z(M,0);if(J!==null)return J}else E(M,q);G(V,te,M,q);continue}if(y+q>g){let J=y+(V==="tab"?0:a[M]),j=y+(V==="tab"?q:l[M]);if(F==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&N<=g)return v(C,0,O);let P=X(M);if(P!==null)return P;if(te&&J<=g)return L(M,q),v(M+1,0,j);if(C>=0&&N<=g)return w>C||w===C&&k>0?v():v(C,0,O);if(q>r&&u[M]!==null){let U=v();if(U!==null)return U;let ee=z(M,0);if(ee!==null)return ee}return v()}L(M,q),G(V,te,M,q)}return C===i.consumedEndSegmentIndex&&k===0?v(i.consumedEndSegmentIndex,0,O):v(i.consumedEndSegmentIndex,0,y)}function S1(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e,l=Lt().lineFitEpsilon,s=n+l,u=0,d=!1,f=t.segmentIndex,m=t.graphemeIndex,p=-1,g=0;for(let y=t.segmentIndex;y<r.length;y++){let x=r[y],w=i[y],k=w==="space"||w==="preserved-space"||w==="tab"||w==="zero-width-break"||w==="soft-hyphen",C=y===t.segmentIndex?t.graphemeIndex:0,N=o[y];if(!d){if(C>0||x>n&&N!==null){let O=N,F=O[C];d=!0,u=F,f=y,m=C+1;for(let S=C+1;S<O.length;S++){let v=O[S];if(u+v>s)return t.segmentIndex=f,t.graphemeIndex=m,u;u+=v,f=y,m=S+1}f===y&&m===O.length&&(f=y+1,m=0)}else d=!0,u=x,f=y+1,m=0;k&&(p=y+1,g=u-x);continue}if(u+x>s)return k?(t.segmentIndex=y+1,t.graphemeIndex=0,u):p>=0?f>p||f===p&&m>0?(t.segmentIndex=f,t.graphemeIndex=m,u):(t.segmentIndex=p,t.graphemeIndex=0,g):(t.segmentIndex=f,t.graphemeIndex=m,u);u+=x,f=y+1,m=0,k&&(p=y+1,g=u-x)}return d?(t.segmentIndex=f,t.graphemeIndex=m,u):null}function v1(e,t,n){let r=ih(e,t);return r<0?null:e.simpleLineWalkFastPath?S1(e,t,n):sh(e,t,r,n)}function lh(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,i=0;if(!e.simpleLineWalkFastPath){let o=ih(e,n);for(;o>=0;){let a=sh(e,n,o,t);if(a===null)return{lineCount:r,maxLineWidth:i};r++,a>i&&(i=a),o=y1(e,o,n)}return{lineCount:r,maxLineWidth:i}}for(;;){let o=v1(e,n,t);if(o===null)return{lineCount:r,maxLineWidth:i};r++,o>i&&(i=o)}}var gl=null;function A1(){return gl===null&&(gl=new Intl.Segmenter(void 0,{granularity:"grapheme"})),gl}function E1(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function _1(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(f,m,p){r=[f],i=m,o=p,a=yo(f),l=Hr.has(f)}function d(f,m){r.push(f),o=o||m;let p=yo(f);f.length===1&&Ft.has(f)?a=a||p:a=p,l=!1}for(let f of A1().segment(e)){let m=f.segment,p=Xe(m);if(r.length===0){u(m,f.index,p);continue}if(l||bo.has(m)||Ft.has(m)||t.carryCJKAfterClosingQuote&&p&&a){d(m,p);continue}if(!o&&!p){d(m,p);continue}s(),u(m,f.index,p)}return s(),n}function w1(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Xe(e[0].text),o=go(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=Xe(s.text),d=go(s.text);if(i&&o){n.push(s.text),i=i||u,o=d;continue}a(),n=[s.text],r=s.start,i=u,o=d}return a(),t}function C1(e,t,n,r){let i=Lt(),{cache:o,emojiCorrection:a}=eh(t,Qp(e.normalized)),l=Nt("-",bt("-",o),a),u=Nt(" ",bt(" ",o),a)*8;if(e.len===0)return E1(n);let d=[],f=[],m=[],p=[],g=e.chunks.length<=1,y=n?[]:null,x=[],w=n?[]:null,k=Array.from({length:e.len});function C(S,v,E,T,L,G,z){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(g=!1),d.push(v),f.push(E),m.push(T),p.push(L),y?.push(G),x.push(z),w!==null&&w.push(S)}function N(S,v,E,T,L){let G=bt(S,o),z=Nt(S,G,a),X=v==="space"||v==="preserved-space"||v==="zero-width-break"?0:z,M=v==="space"||v==="zero-width-break"?0:z;if(L&&T&&S.length>1){let V="sum-graphemes";Gr(S)?V="pair-context":i.preferPrefixWidthsForBreakableRuns&&(V="segment-prefixes");let te=Zp(S,G,o,a,V);C(S,z,X,M,v,E,te);return}C(S,z,X,M,v,E,null)}for(let S=0;S<e.len;S++){k[S]=d.length;let v=e.texts[S],E=e.isWordLike[S],T=e.kinds[S],L=e.starts[S];if(T==="soft-hyphen"){C(v,0,l,l,T,L,null);continue}if(T==="hard-break"){C(v,0,0,0,T,L,null);continue}if(T==="tab"){C(v,0,0,0,T,L,null);continue}let G=bt(v,o);if(T==="text"&&G.containsCJK){let z=_1(v,i),X=r==="keep-all"?w1(z):z;for(let M=0;M<X.length;M++){let V=X[M];N(V.text,"text",L+V.start,E,r==="keep-all"||!Xe(V.text))}continue}N(v,T,L,E,!0)}let O=R1(e.chunks,k,d.length),F=y===null?null:Op(e.normalized,y);return w!==null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:g,segLevels:F,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:O,segments:w}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:g,segLevels:F,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:O}}function R1(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function uh(e,t,n,r){let i=r?.wordBreak??"normal",o=Kp(e,Lt(),r?.whiteSpace,i);return C1(o,t,n,i)}function So(e,t,n){return uh(e,t,!1,n)}function ch(e,t,n){return uh(e,t,!0,n)}function vo(e,t,n){let r=oh(e,t);return{lineCount:r,height:r*n}}function T1(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function k1(e,t,n){return e.widths.length===0?0:hl(e,t,r=>{n(T1(r))})}function dh(e,t){return lh(e,t)}function mh(e){let t=0;return k1(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var M1={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function fh(e,t){let n={...M1,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=So(e,o),{lineCount:l}=vo(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}var ph={prepare:So,layout:vo,prepareWithSegments:ch,measureLineStats:dh,measureNaturalWidth:mh};window.__timelines=window.__timelines||{};wf();window.__hyperframes={fitTextFontSize:fh,getVariables:su,pretext:ph,registerRuntimeDataHandler:Np,setRuntimeData:fo,clearRuntimeData:po};function hh(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Ip())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",hh,{once:!0}):hh();})();
716
716