@oim-media/player-oim 1.32.3 → 1.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -313,6 +313,7 @@ async function readHead(src, e) {
313
313
  if (head.done && head.seal && "idat" in head) {
314
314
  await reader.cancel().catch(() => {});
315
315
  e.head = buf;
316
+ e.validator = res.headers.get("ETag") ?? res.headers.get("Last-Modified") ?? void 0;
316
317
  return {
317
318
  png: new Blob([posterPng(buf, head.sealStart)], { type: "image/png" }),
318
319
  seal: head.seal,
@@ -408,8 +409,12 @@ var fileCache = {
408
409
  e.pending++;
409
410
  evict();
410
411
  const head = e.head;
412
+ const validator = e.validator;
411
413
  e.head = void 0;
412
- e.blob = (head ? fetch(src, { headers: { Range: "bytes=" + head.length + "-" } }).then(async (res) => {
414
+ e.validator = void 0;
415
+ const rangeHeaders = { Range: "bytes=" + (head?.length ?? 0) + "-" };
416
+ if (validator) rangeHeaders["If-Range"] = validator;
417
+ e.blob = (head ? fetch(src, { headers: rangeHeaders }).then(async (res) => {
413
418
  if (!res.ok) throw new Error("HTTP " + res.status);
414
419
  return res.status === 206 ? new Blob([head, await res.blob()]) : res.blob();
415
420
  }) : fetch(src).then((res) => {
@@ -7301,7 +7306,7 @@ function nextWheelZoom(zoom, deltaY, deltaMode, pinch) {
7301
7306
  * the format can change without the player being touched. Tying both numbers
7302
7307
  * together would make an internal fix look like a format break.
7303
7308
  */
7304
- var CONTRACT_VERSION = "1.32.3";
7309
+ var CONTRACT_VERSION = "1.32.4";
7305
7310
  /**
7306
7311
  * What the player implements TODAY, measured and not assumed.
7307
7312
  *
@@ -1,4 +1,4 @@
1
- var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i,a=n((()=>{i=typeof document<`u`&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src||null}));a();function o(e,t={},n=!1){let r=e.getAttribute(`mode`)===`full`,i=(t,n)=>{if(t!==void 0)return t===!0;let i=e.getAttribute(n);return i===null?!r:i===`true`};return{disableAnimations:i(t.disableAnimations,`disable-animations`)||n,disableActions:i(t.disableActions,`disable-actions`)}}var s={activeConnections:0,MAX_CONCURRENT_DECOMPRESSIONS:3,queue:[],requestRender:function(e,t,n,r,i){this.queue.push({engine:e,blob:t,src:n,resolve:r,reject:i}),this.next()},next:function(){if(this.queue.length===0||this.activeConnections>=this.MAX_CONCURRENT_DECOMPRESSIONS)return;let e=this.queue.shift();e&&this.executeRender(e)},executeRender:function(e){let t=this;t.activeConnections++,e.engine._executeLoad(e.blob,e.src).then(function(n){t.activeConnections--,e.resolve(n),t.next()}).catch(function(n){t.activeConnections--,e.reject(n),t.next()})}};function c(e,t,n,r=``){e.setAttribute(t,r),e.setAttribute(n,r)}var l={tampered:{es:`Archivo alterado: no coincide con su firma. OIM no lo muestra.`,en:`Tampered file: it does not match its signature. OIM does not show it.`},button:{es:`Botón`,en:`Button`},image:{es:`Imagen`,en:`Image`},loadError:{es:`Error cargando OIM: `,en:`Could not load OIM: `}};function u(e,t){let n=(t??``).toLowerCase().startsWith(`es`);return l[e][n?`es`:`en`]}function d(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return!1;let i=n.userAgent||``;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i)||n.platform===`MacIntel`&&n.maxTouchPoints>1)return!0;if(n.maxTouchPoints>1&&r&&typeof r.matchMedia==`function`)try{let e=r.matchMedia(`(pointer: fine)`).matches,t=r.matchMedia(`(hover: hover)`).matches;if(!e&&!t)return!0}catch{}return!1}function f(e){let t=e??(typeof window<`u`?window:void 0);if(!t||typeof t.matchMedia!=`function`)return!1;try{return t.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function p(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return`high`;let i=n.connection;if(i&&i.saveData===!0)return`low`;let a=n.deviceMemory;if(typeof a==`number`&&a<=2)return`low`;let o=n.hardwareConcurrency||4;return o<=2?`low`:d(n,r)?o<=4||typeof a==`number`&&a<=4?`low`:`medium`:o>=8&&(typeof a!=`number`||a>=8)?`high`:`medium`}function m(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);return{tier:p(n,r),isMobile:d(n,r),prefersReducedMotion:f(r),cores:n?.hardwareConcurrency||4,memoryGb:n?.deviceMemory,saveData:!!n?.connection?.saveData}}var h=`OIM_Seal`,g=[`OIM_Data`,`OIM_JSON_DATA`],_=new Uint8Array([0,0,0,0,73,69,78,68,174,66,96,130]);function v(e){let t=e.indexOf(0);return t===-1?``:new TextDecoder(`latin1`).decode(e.subarray(0,t))}function y(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(let r=8;r+8<=e.length;){let i=t.getUint32(r),a=r+12+i;if(a>e.length)return{done:!1};let o=new TextDecoder(`latin1`).decode(e.subarray(r+4,r+8)),s=e.subarray(r+8,r+8+i);if(o===`IDAT`)n.push(s);else if(o===`IEND`)return{done:!0,seal:null,idat:n,sealStart:r,end:a};else if(o===`tEXt`||o===`zTXt`||o===`iTXt`){let e=v(s);if(e===h){let t=null;try{t=JSON.parse(new TextDecoder().decode(s.subarray(e.length+1)))}catch{t=null}return{done:!0,seal:t&&typeof t==`object`?t:null,idat:n,sealStart:r,end:a}}if(g.includes(e))return{done:!0,seal:null,idat:n,sealStart:r,end:a}}r=a}return{done:!1}}function b(e,t){let n=new Uint8Array(t+_.length);return n.set(e.subarray(0,t),0),n.set(_,t),n}function x(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function S(e){let t=x(e,e.reduce((e,t)=>e+t.length,0)),n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,t));return Array.from(n,e=>e.toString(16).padStart(2,`0`)).join(``)}async function C(e,t){let n=await fetch(e);if(!n.ok)return null;if(!n.body){let e=await n.blob();return t.bytes=e.size,t.blob=Promise.resolve(e),null}let r=n.body.getReader(),i=[],a=0;for(;;){let{value:e,done:n}=await r.read();e&&(i.push(e),a+=e.length);let o=x(i,a),s=n?{done:!0,seal:null}:y(o);if(s.done&&s.seal&&`idat`in s)return await r.cancel().catch(()=>{}),t.head=o,{png:new Blob([b(o,s.sealStart)],{type:`image/png`}),seal:s.seal,imageHash:await S(s.idat)};if(n||s.done){for(;!n;){let e=await r.read();if(e.done)break;i.push(e.value),a+=e.value.length}let e=new Blob([x(i,a)]);return t.bytes=e.size,t.blob=Promise.resolve(e),null}}}var w=20,T=52428800,E=new Map,D=new WeakMap,O=0,ee=0,k=0;function A(e){try{return new URL(e,typeof document<`u`?document.baseURI:void 0).href}catch{return e}}function j(e){if(typeof e!=`string`){let t=D.get(e);return t||(t={bytes:0,lastUsed:0,pending:0},D.set(e,t)),t.lastUsed=++k,t}let t=A(e),n=E.get(t);return n?n.lastUsed=++k:(n={bytes:0,lastUsed:0,pending:0},E.set(t,n)),n}function M(){let e=0;return E.forEach(t=>{e+=t.bytes}),e}function te(){for(;E.size>w||M()>T;){let e=null,t=1/0;if(E.forEach((n,r)=>{n.pending===0&&n.lastUsed<t&&(t=n.lastUsed,e=r)}),e===null)return;E.delete(e)}}function N(e,t){let n=typeof e==`string`?E.get(A(e)):D.get(e);n&&delete n[t]}var P={getBlob(e){if(typeof e!=`string`)return Promise.resolve(e);let t=j(e);if(!t.blob){O++,t.pending++,te();let n=t.head;t.head=void 0,t.blob=(n?fetch(e,{headers:{Range:`bytes=`+n.length+`-`}}).then(async e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.status===206?new Blob([n,await e.blob()]):e.blob()}):fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.blob()})).then(e=>(t.bytes=e.size,t.lastUsed=++k,te(),e)).catch(t=>{throw N(e,`blob`),t}).finally(()=>{t.pending--})}return t.blob},getVerified(e,t){let n=j(e);return n.verified||=(ee++,n.pending++,P.getBlob(e).then(t).catch(t=>{throw N(e,`verified`),t}).finally(()=>{n.pending--})),n.verified},readPoster(e){let t=j(e);return!t.poster&&t.blob?Promise.resolve(null):(t.poster||=(t.pending++,C(e,t).catch(()=>null).finally(()=>{t.pending--})),t.poster)},sniff(e){let t=e=>e.then(e=>e.slice(0,16).arrayBuffer()).then(e=>new Uint8Array(e));return typeof e==`string`?P.readPoster(e).then(()=>{let n=j(e);return n.head?n.head.slice(0,16):t(P.getBlob(e))}).catch(()=>null):t(Promise.resolve(e)).catch(()=>null)},stats(){return{fetches:O,verifications:ee,entries:E.size,bytes:M()}},clear(){E.clear(),O=0,ee=0,k=0}};typeof window<`u`&&window.__OIM_BENCH__===!0&&(window.__oimCacheStats=()=>P.stats());function ne(){return`:host { position: relative; display: flex !important; overflow: hidden; width: 100%; height: 100%; background: var(--oim-bg, transparent); user-select: none; content-visibility: auto; contain-intrinsic-size: auto 300px; }
1
+ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i,a=n((()=>{i=typeof document<`u`&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src||null}));a();function o(e,t={},n=!1){let r=e.getAttribute(`mode`)===`full`,i=(t,n)=>{if(t!==void 0)return t===!0;let i=e.getAttribute(n);return i===null?!r:i===`true`};return{disableAnimations:i(t.disableAnimations,`disable-animations`)||n,disableActions:i(t.disableActions,`disable-actions`)}}var s={activeConnections:0,MAX_CONCURRENT_DECOMPRESSIONS:3,queue:[],requestRender:function(e,t,n,r,i){this.queue.push({engine:e,blob:t,src:n,resolve:r,reject:i}),this.next()},next:function(){if(this.queue.length===0||this.activeConnections>=this.MAX_CONCURRENT_DECOMPRESSIONS)return;let e=this.queue.shift();e&&this.executeRender(e)},executeRender:function(e){let t=this;t.activeConnections++,e.engine._executeLoad(e.blob,e.src).then(function(n){t.activeConnections--,e.resolve(n),t.next()}).catch(function(n){t.activeConnections--,e.reject(n),t.next()})}};function c(e,t,n,r=``){e.setAttribute(t,r),e.setAttribute(n,r)}var l={tampered:{es:`Archivo alterado: no coincide con su firma. OIM no lo muestra.`,en:`Tampered file: it does not match its signature. OIM does not show it.`},button:{es:`Botón`,en:`Button`},image:{es:`Imagen`,en:`Image`},loadError:{es:`Error cargando OIM: `,en:`Could not load OIM: `}};function u(e,t){let n=(t??``).toLowerCase().startsWith(`es`);return l[e][n?`es`:`en`]}function d(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return!1;let i=n.userAgent||``;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i)||n.platform===`MacIntel`&&n.maxTouchPoints>1)return!0;if(n.maxTouchPoints>1&&r&&typeof r.matchMedia==`function`)try{let e=r.matchMedia(`(pointer: fine)`).matches,t=r.matchMedia(`(hover: hover)`).matches;if(!e&&!t)return!0}catch{}return!1}function f(e){let t=e??(typeof window<`u`?window:void 0);if(!t||typeof t.matchMedia!=`function`)return!1;try{return t.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function p(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);if(!n)return`high`;let i=n.connection;if(i&&i.saveData===!0)return`low`;let a=n.deviceMemory;if(typeof a==`number`&&a<=2)return`low`;let o=n.hardwareConcurrency||4;return o<=2?`low`:d(n,r)?o<=4||typeof a==`number`&&a<=4?`low`:`medium`:o>=8&&(typeof a!=`number`||a>=8)?`high`:`medium`}function m(e,t){let n=e??(typeof navigator<`u`?navigator:void 0),r=t??(typeof window<`u`?window:void 0);return{tier:p(n,r),isMobile:d(n,r),prefersReducedMotion:f(r),cores:n?.hardwareConcurrency||4,memoryGb:n?.deviceMemory,saveData:!!n?.connection?.saveData}}var h=`OIM_Seal`,g=[`OIM_Data`,`OIM_JSON_DATA`],_=new Uint8Array([0,0,0,0,73,69,78,68,174,66,96,130]);function v(e){let t=e.indexOf(0);return t===-1?``:new TextDecoder(`latin1`).decode(e.subarray(0,t))}function y(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(let r=8;r+8<=e.length;){let i=t.getUint32(r),a=r+12+i;if(a>e.length)return{done:!1};let o=new TextDecoder(`latin1`).decode(e.subarray(r+4,r+8)),s=e.subarray(r+8,r+8+i);if(o===`IDAT`)n.push(s);else if(o===`IEND`)return{done:!0,seal:null,idat:n,sealStart:r,end:a};else if(o===`tEXt`||o===`zTXt`||o===`iTXt`){let e=v(s);if(e===h){let t=null;try{t=JSON.parse(new TextDecoder().decode(s.subarray(e.length+1)))}catch{t=null}return{done:!0,seal:t&&typeof t==`object`?t:null,idat:n,sealStart:r,end:a}}if(g.includes(e))return{done:!0,seal:null,idat:n,sealStart:r,end:a}}r=a}return{done:!1}}function b(e,t){let n=new Uint8Array(t+_.length);return n.set(e.subarray(0,t),0),n.set(_,t),n}function x(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function S(e){let t=x(e,e.reduce((e,t)=>e+t.length,0)),n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,t));return Array.from(n,e=>e.toString(16).padStart(2,`0`)).join(``)}async function C(e,t){let n=await fetch(e);if(!n.ok)return null;if(!n.body){let e=await n.blob();return t.bytes=e.size,t.blob=Promise.resolve(e),null}let r=n.body.getReader(),i=[],a=0;for(;;){let{value:e,done:o}=await r.read();e&&(i.push(e),a+=e.length);let s=x(i,a),c=o?{done:!0,seal:null}:y(s);if(c.done&&c.seal&&`idat`in c)return await r.cancel().catch(()=>{}),t.head=s,t.validator=n.headers.get(`ETag`)??n.headers.get(`Last-Modified`)??void 0,{png:new Blob([b(s,c.sealStart)],{type:`image/png`}),seal:c.seal,imageHash:await S(c.idat)};if(o||c.done){for(;!o;){let e=await r.read();if(e.done)break;i.push(e.value),a+=e.value.length}let e=new Blob([x(i,a)]);return t.bytes=e.size,t.blob=Promise.resolve(e),null}}}var w=20,T=52428800,E=new Map,D=new WeakMap,O=0,ee=0,k=0;function A(e){try{return new URL(e,typeof document<`u`?document.baseURI:void 0).href}catch{return e}}function j(e){if(typeof e!=`string`){let t=D.get(e);return t||(t={bytes:0,lastUsed:0,pending:0},D.set(e,t)),t.lastUsed=++k,t}let t=A(e),n=E.get(t);return n?n.lastUsed=++k:(n={bytes:0,lastUsed:0,pending:0},E.set(t,n)),n}function M(){let e=0;return E.forEach(t=>{e+=t.bytes}),e}function te(){for(;E.size>w||M()>T;){let e=null,t=1/0;if(E.forEach((n,r)=>{n.pending===0&&n.lastUsed<t&&(t=n.lastUsed,e=r)}),e===null)return;E.delete(e)}}function N(e,t){let n=typeof e==`string`?E.get(A(e)):D.get(e);n&&delete n[t]}var P={getBlob(e){if(typeof e!=`string`)return Promise.resolve(e);let t=j(e);if(!t.blob){O++,t.pending++,te();let n=t.head,r=t.validator;t.head=void 0,t.validator=void 0;let i={Range:`bytes=`+(n?.length??0)+`-`};r&&(i[`If-Range`]=r),t.blob=(n?fetch(e,{headers:i}).then(async e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.status===206?new Blob([n,await e.blob()]):e.blob()}):fetch(e).then(e=>{if(!e.ok)throw Error(`HTTP `+e.status);return e.blob()})).then(e=>(t.bytes=e.size,t.lastUsed=++k,te(),e)).catch(t=>{throw N(e,`blob`),t}).finally(()=>{t.pending--})}return t.blob},getVerified(e,t){let n=j(e);return n.verified||=(ee++,n.pending++,P.getBlob(e).then(t).catch(t=>{throw N(e,`verified`),t}).finally(()=>{n.pending--})),n.verified},readPoster(e){let t=j(e);return!t.poster&&t.blob?Promise.resolve(null):(t.poster||=(t.pending++,C(e,t).catch(()=>null).finally(()=>{t.pending--})),t.poster)},sniff(e){let t=e=>e.then(e=>e.slice(0,16).arrayBuffer()).then(e=>new Uint8Array(e));return typeof e==`string`?P.readPoster(e).then(()=>{let n=j(e);return n.head?n.head.slice(0,16):t(P.getBlob(e))}).catch(()=>null):t(Promise.resolve(e)).catch(()=>null)},stats(){return{fetches:O,verifications:ee,entries:E.size,bytes:M()}},clear(){E.clear(),O=0,ee=0,k=0}};typeof window<`u`&&window.__OIM_BENCH__===!0&&(window.__oimCacheStats=()=>P.stats());function ne(){return`:host { position: relative; display: flex !important; overflow: hidden; width: 100%; height: 100%; background: var(--oim-bg, transparent); user-select: none; content-visibility: auto; contain-intrinsic-size: auto 300px; }
2
2
  :host(.oim-player-paused) { pointer-events: none !important; }
3
3
  :host(.oim-player-paused[activate-on="hover"]) { pointer-events: auto !important; }
4
4
  :host(.oim-player-paused) * { animation-play-state: paused !important; transition: none !important; }
@@ -48,7 +48,7 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
48
48
  @keyframes background-animation-zoom-out { 0%, 100% { background-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); -webkit-mask-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); mask-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); } 50% { background-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); -webkit-mask-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); mask-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); } }
49
49
  @keyframes background-animation-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
50
50
  @keyframes background-animation-none { }
51
- [data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function F(e){if(!e)return;let t=ne();if(document.head&&!document.getElementById(`oim-player-styles`)){let e=document.createElement(`style`);e.id=`oim-player-styles`,e.textContent=t,document.head.appendChild(e)}if(e.getElementById&&!e.getElementById(`oim-player-styles`)){let n=document.createElement(`style`);n.id=`oim-player-styles`,n.textContent=t,e.appendChild(n)}}function I(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}var L=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),re=new Set([`public`,`author_only`,`sealed`]);function ie(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?L.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&re.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var ae=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],oe=new Set(ae);function se(e){return typeof e==`string`&&oe.has(e)}var R=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,ce=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,le=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),ue=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,de=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function fe(e,t=0){if(typeof e!=`string`)return!1;let n=e.trim();if(!n||n.length>128||t>4||/[;{}<>"]/.test(n)||n.includes(`\\`)||/url\(|expression\(|\/\*/i.test(n))return!1;if(R.test(n)||le.has(n.toLowerCase())||ce.test(n)||ue.test(n))return!0;let r=de.exec(n);return r?fe(r[2],t+1):!1}function pe(e,t={}){let n=e.palettes??{},r=Object.hasOwn(n,`dark`)&&Object.hasOwn(n,`light`)&&t.prefersDark!==void 0?t.prefersDark?`dark`:`light`:void 0,i=[t.requested,r,e.defaultPalette].find(e=>typeof e==`string`&&Object.hasOwn(n,e));if(i===void 0)return null;let a={};for(let e of ae){let t=n[i][e];fe(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function z(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&fe(n)?n:void 0;if(se(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function me(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var he={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function ge(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function _e(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(he,t)?t:void 0,blur:ge(e.filterBlur,0,100)??0,brightness:ge(e.filterBrightness,0,500)??100,contrast:ge(e.filterContrast,0,500)??100,saturate:ge(e.filterSaturate,0,500)??100,hue:ge(e.filterHueRotate,0,360)??0}}function ve(e){let t=_e(e),n=[];return t.preset!==void 0&&n.push(he[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}var ye=`author_only`,be=[`public`,`author_only`,`sealed`];function B(e){if(!e||typeof e!=`object`)return ye;let t=ie(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&be.includes(n)?n:ye}function V(e){return e===`public`?`verified_authorless`:`verified`}function xe(e){return!!e&&e.type===`group`}function H(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function Se(e){let t=new Set;for(let n of e||[])xe(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||xe(r))continue;let e=H(r);if(!e||!t.has(e))continue;let i=n.get(e);i?i.push(String(r.id)):n.set(e,[String(r.id)])}return n}function U(e){let t=me(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var W=`oim:base`;function Ce(e){let t=t=>{if(typeof t==`string`)return t===W;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===W}return t.value===W||Object.values(t.modes??{}).includes(W)},n=e=>e.some(e=>e.image!==void 0&&t(e.image.src)||n(e.children??[]));return n(e.layers)}function we(e){let t=structuredClone(e),n=[],r=e.resources??{},i=e=>{if(!(`ref`in e))return e;if(Object.prototype.hasOwnProperty.call(r,e.ref))return structuredClone(r[e.ref]);n.includes(e.ref)||n.push(e.ref)},a=e=>e.flatMap(e=>i(e)??[]),o=e=>{for(let t of e){if(t.fills&&=a(t.fills),t.strokes&&=t.strokes.flatMap(e=>{let t=i(e.paint);return t?[{...e,paint:t}]:[]}),t.image&&typeof t.image.src==`object`&&`ref`in t.image.src){let e=t.image.src,i=Object.prototype.hasOwnProperty.call(r,e.ref)?r[e.ref]:void 0;i&&`kind`in i&&i.kind===`image`?t.image={...t.image,src:i.src}:(delete t.image,n.includes(e.ref)||n.push(e.ref))}t.children&&o(t.children)}};return t.canvas.fills&&(t.canvas.fills=a(t.canvas.fills)),o(t.layers),{document:t,missing:n}}var Te=r({createExternalLottieLoader:()=>Oe,createExternalScriptLoader:()=>De,default:()=>G,vendorUrl:()=>Ee});function Ee(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return ke+n}function De(e){let t=null;return function(){let n=e.read();if(n)return Promise.resolve(n);if(t)return t;let r=e.doc??document,i=ke+e.file;if(e.scriptUrl)try{i=new URL(e.file,e.scriptUrl).href}catch{}return t=new Promise((t,n)=>{let a=r.createElement(`script`);a.src=i,a.async=!0,a.setAttribute(e.marker,``),a.onload=()=>{let r=e.read();r?t(r):n(Error(`Script loaded from ${i} but did not define what was expected`))},a.onerror=()=>{a.remove(),n(Error(`Could not load ${i}`))},(r.head||r.documentElement).appendChild(a)}),t.catch(()=>{t=null}),t}}function Oe(e){return De({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var ke,Ae,G,K=n((()=>{ke=`https://cdn.oim.media/player/v1/`,Ae=Oe({scriptUrl:i,version:`5.13.0`}),G={__oimExternal:!0,load:Ae}}));a(),K();var je=`__oimUpgrade`,Me=()=>globalThis[je],q=De({scriptUrl:i,file:`vendor/oim-upgrade-46b8ceeec5ee.js`,marker:`data-oim-upgrade`,read:()=>Me()}),Ne=e=>{let t=Me();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Pe(){return Me()?Promise.resolve():q().then(()=>void 0)}function Fe(e){let t=e?.modes?.palette;if(!e||!t)return;let n=Object.fromEntries(t.map(e=>[e,{}]));for(let[t,r]of Object.entries(e.values??{}))for(let[e,i]of Object.entries(r))n[e]&&typeof i==`string`&&(n[e][t]=i);return n}function Ie(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?z(e.var,e.fallback):typeof e==`string`?z(null,e):``)||void 0,literal:n=>(t(n)?pe(e)?.colors?.[n.var]??z(null,n.fallback):typeof n==`string`?z(null,n):``)||void 0}}a(),K();var J=()=>globalThis.__oimGenerative,Le=De({scriptUrl:i,file:`vendor/oim-generative-46b8ceeec5ee.js`,marker:`data-oim-generative`,read:()=>J()}),Re=(e,t)=>J()?.renderGenerativeSVG(e,t)??``;a(),K();var Y=()=>globalThis.__oimPatterns,ze=De({scriptUrl:i,file:`vendor/oim-patterns-46b8ceeec5ee.js`,marker:`data-oim-patterns`,read:()=>Y()}),Be=e=>Y()?.generatePatternSVG(e)??``,Ve=(...e)=>Y()?.patternTileUri(...e)??``,He=e=>Y()?.isMultiColorPattern(e)??!1,Ue=(...e)=>Y()?.resolvePatternColors(...e)??{fgColor:`#000000`,bgColor:`transparent`},We={triangle:{kind:`polygon`,points:[[50,5],[95,90],[5,90]]},star:{kind:`polygon`,points:[[50,2],[62,38],[100,38],[69,59],[80,95],[50,73],[20,95],[31,59],[0,38],[38,38]]},arrow:{kind:`polygon`,points:[[5,40],[60,40],[60,20],[95,50],[60,80],[60,60],[5,60]]},diamond:{kind:`polygon`,points:[[50,5],[95,50],[50,95],[5,50]]},hexagon:{kind:`polygon`,points:[[25,5],[75,5],[95,50],[75,95],[25,95],[5,50]]},circle:{kind:`path`,d:`M 50,5 A 45,45 0 1,1 49.999,5 Z`,fillable:!0},heart:{kind:`path`,d:`M 50,88 C 10,60 -5,30 15,12 C 30,-2 50,5 50,25 C 50,5 70,-2 85,12 C 105,30 90,60 50,88 Z`,fillable:!0},line:{kind:`path`,d:`M 5,50 L 95,50`,fillable:!1},blob:{kind:`path`,d:`M 50,10 C 75,10 92,25 90,50 C 88,75 75,90 50,90 C 25,90 10,75 10,50 C 10,25 25,10 50,10 Z`,fillable:!0},scribble:{kind:`path`,d:`M 5,80 Q 25,65 50,75 T 95,70 Q 75,85 50,82 T 5,88`,fillable:!1},pill:{kind:`path`,d:`M 30,25 L 70,25 C 83.8,25 95,36.2 95,50 C 95,63.8 83.8,75 70,75 L 30,75 C 16.2,75 5,63.8 5,50 C 5,36.2 16.2,25 30,25 Z`,fillable:!0},octagon:{kind:`polygon`,points:[[30,5],[70,5],[95,30],[95,70],[70,95],[30,95],[5,70],[5,30]]},pentagon:{kind:`polygon`,points:[[50,5],[94.7,37.5],[77.6,90],[22.4,90],[5.3,37.5]]},cross:{kind:`polygon`,points:[[35,5],[65,5],[65,35],[95,35],[95,65],[65,65],[65,95],[35,95],[35,65],[5,65],[5,35],[35,35]]},moon:{kind:`path`,d:`M 50,5 C 25.15,5 5,25.15 5,50 C 5,74.85 25.15,95 50,95 C 30,80 30,20 50,5 Z`,fillable:!0},cloud:{kind:`path`,d:`M 25,85 C 8,85 5,62 22,58 C 14,40 35,32 45,42 C 48,22 75,20 78,42 C 96,40 97,66 80,68 C 80,78 78,85 68,85 Z`,fillable:!0},drop:{kind:`path`,d:`M 50,5 C 62,25 80,45 80,65 C 80,81.5 66.5,95 50,95 C 33.5,95 20,81.5 20,65 C 20,45 38,25 50,5 Z`,fillable:!0},bolt:{kind:`polygon`,points:[[62,5],[18,58],[46,58],[34,95],[82,40],[55,40],[72,5]]},bubble:{kind:`path`,d:`M 20,5 L 80,5 C 88.3,5 95,11.7 95,20 L 95,57 C 95,65.3 88.3,72 80,72 L 42,72 L 22,93 L 28,72 L 20,72 C 11.7,72 5,65.3 5,57 L 5,20 C 5,11.7 11.7,5 20,5 Z`,fillable:!0},flower:{kind:`path`,d:`M 65.6,41.0 C 85.5,35.7 97.5,39.9 95.0,50.0 C 97.5,60.1 85.5,64.3 65.6,59.0 C 80.1,73.5 82.5,86.1 72.5,89.0 C 65.0,96.2 55.3,87.9 50.0,68.0 C 44.7,87.9 35.0,96.2 27.5,89.0 C 17.5,86.1 19.9,73.5 34.4,59.0 C 14.5,64.3 2.5,60.1 5.0,50.0 C 2.5,39.9 14.5,35.7 34.4,41.0 C 19.9,26.5 17.5,13.9 27.5,11.0 C 35.0,3.8 44.7,12.1 50.0,32.0 C 55.3,12.1 65.0,3.8 72.5,11.0 C 82.5,13.9 80.1,26.5 65.6,41.0 Z`,fillable:!0},burst:{kind:`polygon`,points:[[95,50],[82.8,58.8],[89,72.5],[74,74],[72.5,89],[58.8,82.8],[50,95],[41.2,82.8],[27.5,89],[26,74],[11,72.5],[17.2,58.8],[5,50],[17.2,41.2],[11,27.5],[26,26],[27.5,11],[41.2,17.2],[50,5],[58.8,17.2],[72.5,11],[74,26],[89,27.5],[82.8,41.2]]},arch:{kind:`path`,d:`M 5,95 L 5,50 C 5,25.15 25.15,5 50,5 C 74.85,5 95,25.15 95,50 L 95,95 Z`,fillable:!0}};[...Object.keys(We).filter(e=>e!==`line`&&e!==`scribble`)];function Ge(e){if(e&&e!==`rect`&&e!==`rectangle`)return We[e]}function Ke(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var qe=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,Je=/^[A-Za-z0-9.%\s-]+$/,Ye=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,Xe=/^[A-Za-z]+$/,Ze=2048;function Qe(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`(`)n++;else if(a===`)`){if(--n<0)return null}else a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return n===0?(t.push(e.slice(r).trim()),t):null}function $e(e){let t=Ye.exec(e);if(!t)return!1;let n=t[1].trim();return Xe.test(n)||fe(n)}function et(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>Ze||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=qe.exec(t);if(!n)return!1;let r=Qe(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=$e(i)?r:Je.test(i)?a:null;return!!o&&o.length>0&&o.every($e)}var tt=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,nt=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,rt=`0 0 100 100`,it=e=>e&&e.length<=2e4&&tt.test(e)?e:void 0,at=e=>e&&e.length<=64&&nt.test(e)?e:rt;function ot(e){let t=Ge(e.geoShape),n=it(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:rt}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&it(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:rt}:n?{d:n,viewBox:at(e.svgViewBox)}:null}var st=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function ct(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${Be({type:e.fillPatternType||`clouds`,bgColor:e.fillPatternBgColor||`transparent`,fgColor:e.fillPatternColor||`#000000`,scale:t,svgs:e.fillPatternSvgs,colors:e.fillPatternColors,sizes:e.fillPatternSizes,counts:e.fillPatternCounts,dispersions:e.fillPatternDispersions})}")`,backgroundSize:`${n}px ${n}px`,backgroundRepeat:`repeat`,"--oim-bg-tile":`${n}px`},i=e.fillPatternDirection||`right`,a=e.fillPatternSpeed;return a&&a>0&&st.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function lt(e){let t=e.fillType||(e.fillColor?`color`:`none`);if(t===`none`)return{};let n=e.type===`text`,r={};return t===`generative`?r=e.fillGenerative?{backgroundImage:`url("${Re(e.fillGenerative,{width:e.width||100,height:e.height||100})}")`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`}:e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`pattern`?r=e.fillPatternType?ct(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=et(e.fillGradient)?{backgroundImage:e.fillGradient}:{}:(t===`color`||t===`image`)&&(r=e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}),n&&(t===`gradient`||t===`generative`&&e.fillGenerative||t===`pattern`&&e.fillPatternType)?{...r,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}:r}function ut(e,t){if(!e&&t?.svgPath){let e=ot({svgPath:t.svgPath,svgViewBox:t.svgViewBox});return e?.d?dt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.viewBox}" preserveAspectRatio="none"><path d="${e.d}" fill="black"/></svg>`):{}}if(!e||e===`rectangle`)return{};let n=We[e];return!n||n.kind===`path`&&!n.fillable?{}:dt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${n.kind===`polygon`?`<polygon points="${Ke(n.points)}" fill="black"/>`:`<path d="${n.d}" fill="black"/>`}</svg>`)}function dt(e){let t=`url("data:image/svg+xml,${encodeURIComponent(e)}")`;return{maskImage:t,WebkitMaskImage:t,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`}}function ft(e){if(!/<svg\b/i.test(e))return{};let t=e.replace(/\bfill="[^"]*"/g,`fill="#000"`).replace(/\bstroke="(?!none")[^"]*"/g,`stroke="#000"`).replace(/([;"'\s{])fill\s*:\s*[^;"'}]+/g,`$1fill:#000`).replace(/([;"'\s{])stroke\s*:\s*(?!none\b)[^;"'}]+/g,`$1stroke:#000`);/xmlns=/.test(t)||(t=t.replace(/<svg\b/i,`<svg xmlns="http://www.w3.org/2000/svg"`));let n=`url("data:image/svg+xml,${encodeURIComponent(t)}")`;return{maskImage:n,WebkitMaskImage:n,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}}function pt(e){let t=ct(e);return Object.assign(t,ut(e.geoShape)),t}var mt=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,ht=(e,t)=>mt(e)?t.literal(e.fallback):t.literal(e);function gt(e,t){let n=(e.colors??[]).map(e=>ht(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:mt(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:ht(e.bg,t),fillPatternBgColorRole:mt(e.bg),fillPatternScale:e.scale,fillPatternSizes:e.sizes,fillPatternCounts:e.counts,fillPatternDispersions:e.dispersions,fillPatternSvgs:e.svgs,fillPatternDirection:e.motion?.direction,fillPatternSpeed:e.motion?.period}}var _t=e=>`${+(e*100).toFixed(4)}%`;function vt(e,t){let n=[];for(let r of e.stops){let e=t.css(r.color);if(!e)return;n.push(r.at===void 0?e:`${e} ${_t(r.at)}`)}let r=e.type===`linear`?e.angle===void 0?``:`${e.angle}deg, `:e.type===`conic`?e.angle===void 0?``:`from ${e.angle}deg, `:``;return`${e.type}-gradient(${r}${n.join(`, `)})`}var yt=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),bt=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function xt(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?xt(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return bt(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?vt(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return bt(i?yt(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return bt(lt({...gt(t,r),type:i?`text`:`shape`,fillType:`pattern`,fillPatternType:t.preset??`clouds`,fillPatternColor:n[0],fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:r.literal(t.bg)}),e.opacity)}case`generative`:return bt(lt({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);default:return{}}}function St(e,t){if(typeof e==`number`)return e;if(e&&typeof e==`object`&&`value`in e){let{value:n,modes:r}=e,i=r?.[t];return typeof i==`number`?i:typeof n==`number`?n:void 0}}function Ct(e,t){let n=e?.text;if(!n)return;let r={},i=St(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=St(n.maxWidth,t);return a!==void 0&&(r.maxWidth=`${+a.toFixed(4)}px`),n.font?.family&&(r.fontFamily=n.font.family),n.font?.weight!==void 0&&(r.fontWeight=String(n.font.weight)),n.font?.italic&&(r.fontStyle=`italic`),n.letterSpacing!==void 0&&(r.letterSpacing=`${n.letterSpacing}px`),n.transform&&(r.textTransform=n.transform),n.decoration&&(r.textDecoration=n.decoration),r}function wt(e,t){let[n,r,i,a]=t,o=n+i/2,s=r+a/2,c=e.stops.length,l=e.stops.map((e,t)=>({offset:`${Math.round((e.at??t/(c-1))*1e4)/100}%`,color:e.color}));if(e.type===`radial`)return{tag:`radialGradient`,attrs:{cx:o,cy:s,r:Math.hypot(i/2,a/2)},stops:l};let u=((e.angle??180)-90)*Math.PI/180,d=(Math.abs(i*Math.cos(u))+Math.abs(a*Math.sin(u)))/2,f=Math.cos(u)*d,p=Math.sin(u)*d;return{tag:`linearGradient`,attrs:{x1:o-f,y1:s-p,x2:o+f,y2:s+p},stops:l}}function X(e,t){if(!e||typeof e!=`object`)return;let n=(t||``).toLowerCase();if(e[n]!==void 0)return e[n];let r=Object.keys(e);for(let t=0;t<r.length;t++)if(r[t].toLowerCase()===n)return e[r[t]]}function Tt(e,t){let n=e||{};if(n[`*`]!==void 0){let e=X(n,t);return typeof e==`string`?e:String(n[`*`]??``)}function r(e){if(n[e]!==void 0&&n[e]!==``)return n[e];let t=e.toLowerCase(),r=e.toUpperCase();if(n[r]!==void 0&&n[r]!==``)return n[r];if(n[t]!==void 0&&n[t]!==``)return n[t];let i=Object.keys(n);for(let e=0;e<i.length;e++)if(i[e].toLowerCase()===t&&n[i[e]]!==``)return n[i[e]]}let i=r(t)||r(`en`)||r(`es`)||r(`default`)||``;if(!i){let e=Object.keys(n);e.length>0&&(i=n[e[0]]||``)}return i}function Et(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function Dt(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var Ot=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function kt(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(Ot.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function At(e,t){let n=e&&e.style||{},r=Tt(e&&e.content,t),i=Et(e,r);return{content:r,size:kt(X(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:Dt(e)?`none`:X(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function jt(e,t,n){let r=At(e,t),i=At(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var Mt={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function Nt(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function Pt(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(Mt,t)?t:void 0,blur:Nt(e.filterBlur,0,100)??0,brightness:Nt(e.filterBrightness,0,500)??100,contrast:Nt(e.filterContrast,0,500)??100,saturate:Nt(e.filterSaturate,0,500)??100,hue:Nt(e.filterHueRotate,0,360)??0}}function Ft(e){let t=Pt(e),n=[];return t.preset!==void 0&&n.push(Mt[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}function It(e){let t=e.shadowOpacity===void 0?1:Math.max(0,Math.min(100,e.shadowOpacity))/100,n=(e.shadowColor||`#000000`).replace(`#`,``),r=n.length===3?n.split(``).map(function(e){return e+e}).join(``):n,i=parseInt(r.substring(0,2),16)||0,a=parseInt(r.substring(2,4),16)||0,o=parseInt(r.substring(4,6),16)||0,s=`rgba(`+i+`, `+a+`, `+o+`, `+t+`)`;return e.shadowColorRole?t<1?`color-mix(in srgb, `+z(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:z(e.shadowColorRole,s):s}function Lt(e){let t=e??{},n=e=>typeof e==`number`?+(e*100).toFixed(6):void 0;return{filterPreset:t.preset,filterBlur:t.blur,filterBrightness:n(t.brightness),filterContrast:n(t.contrast),filterSaturate:n(t.saturate),filterHueRotate:t.hueRotate}}var Rt=`#f59e0b`;function zt(e,t){let n=[],r=[],i=[];for(let a of e??[])if(a.kind===`blur`)n.push(`blur(${a.radius}px)`);else if(a.kind===`glow`){let e=t.colorCss(a.color)||Rt,i=a.radius;t.isText?r.push(`0px 0px ${i*.4}px ${e}`,`0px 0px ${i}px ${e}`):n.push(`drop-shadow(0px 0px ${i*.4}px ${e}) drop-shadow(0px 0px ${i}px ${e})`)}else if(a.kind===`shadow`){let e=a.color&&typeof a.color==`object`?a.color:void 0,i=a.opacity===void 0?t.colorCss(a.color??`#000000`)||`#000000`:It({shadowColor:e?e.fallback:a.color,shadowOpacity:a.opacity*100,shadowColorRole:e?.var}),o=`${a.x||0}px ${a.y||0}px ${a.blur||0}px ${i}`;t.isText?r.push(o):n.push(`drop-shadow(${o})`)}else if(a.kind===`grain`){if(!t.grainable)continue;let e=`oim-grain-`+t.layerId.replace(/[^A-Za-z0-9_-]/g,`_`);i.push({kind:`grain`,id:e,effect:a}),n.push(`url(#${e})`)}else a.kind===`texture`&&i.push({kind:`texture`,effect:a});let a=e?.find(e=>e.kind===`backdrop`),o;return a?.preset===`duotone`?i.push({kind:`duotone`}):o=Ft(Lt(a)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:o,defs:i}}var Bt=new WeakMap;function Vt(e){let t=new Map,n=e=>{for(let r of e)t.set(r.id,r),n(r.children??[])};return n(e),t}function Ht(e){let t=Bt.get(e);if(t)return t;try{t=Vt(Ne(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e),t=new Map}return Bt.set(e,t),t}function Ut(e,t){Bt.set(e,Vt(t.layers))}function Wt(e){let t=e.anchor??`top-left`;return[/left/.test(t)?`0%`:/right/.test(t)?`-100%`:`-50%`,/^top/.test(t)?`0%`:/^bottom/.test(t)?`-100%`:`-50%`]}function Gt(e,t){let n=e.mask??{},r=e.fills?.[0],i=r&&`gradient`in r&&r.gradient?vt(r.gradient,t):void 0,a=e.geometry,o=a?.kind===`preset`?a.name:a?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[a?.kind??``],s=e=>typeof e==`string`?{role:void 0,literal:e}:e&&typeof e==`object`?{role:e.var,literal:e.fallback}:{role:void 0,literal:void 0},c=e.fills?.[0],l=s(c?.kind===`color`?c.value:void 0),u=e.strokes?.[0],d=s(u?.paint?.kind===`color`?u.paint.value:void 0);return{maskMode:n.mode===`cutout`?`cutout`:`window`,maskFeather:n.feather,maskCoverage:n.scope===`group`?`container`:`canvas`,maskShape:o,maskSvgPath:a?.kind===`paths`?a.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:l.literal,maskBgColorRole:l.role,fillType:i?`gradient`:void 0,fillGradient:i,fillColorRole:void 0,maskStrokeColor:d.literal,maskStrokeColorRole:d.role,strokeColorRole:void 0,maskStrokeWidth:u?.width,cuts:e.extensions?.studio?.maskCuts}}function Kt(e,t){if(typeof e==`string`)return e===`oim:base`?``:e;if(!(`value`in e)||typeof e.value!=`string`)return``;let n=X(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var qt=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0,Jt=0;function Yt(e,t,n=!1){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e.viewBox.join(` `)),i.setAttribute(`width`,n?String(e.viewBox[2]):`100%`),i.setAttribute(`height`,n?String(e.viewBox[3]):`100%`),n?i.setAttribute(`xmlns`,r):(i.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),i.style.setProperty(`display`,`block`));let a;if(t.strokeGradient){let{tag:n,attrs:o,stops:s}=wt(t.strokeGradient,e.viewBox),c=i.appendChild(document.createElementNS(r,`defs`)).appendChild(document.createElementNS(r,n));c.id=`oim-sg-${++Jt}`,c.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of Object.entries(o))c.setAttribute(e,String(t));for(let e of s){let t=c.appendChild(document.createElementNS(r,`stop`));t.setAttribute(`offset`,e.offset),t.setAttribute(`stop-color`,qt(e.color)??`#000`)}a=`url(#${c.id})`}for(let o of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,o.d);let s=qt(o.fill===`currentColor`?t.fill??`currentColor`:o.fill),c=a??qt(o.stroke===`currentColor`?t.stroke??`currentColor`:o.stroke);n?(e.setAttribute(`fill`,s??`none`),c&&e.setAttribute(`stroke`,c)):(e.setAttribute(`fill`,`none`),s&&e.style.setProperty(`fill`,s),c&&e.style.setProperty(`stroke`,c)),o.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(o.strokeWidth)),o.fillRule&&e.setAttribute(`fill-rule`,o.fillRule),o.cap&&e.setAttribute(`stroke-linecap`,o.cap),o.join&&e.setAttribute(`stroke-linejoin`,o.join),o.opacity!==void 0&&e.setAttribute(`opacity`,String(o.opacity)),o.transform&&e.setAttribute(`transform`,`matrix(${o.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function Xt(e){let t=e.fills?.[0]?.kind;return t===`gradient`||t===`pattern`||t===`generative`}function Zt(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=e.strokes?.[0]?.paint,a=n(i),o=i?.kind===`gradient`&&i.gradient?.type!==`conic`?i.gradient:void 0,s=o&&{...o,stops:o.stops.map(e=>({...e,color:t(e.color)??e.color}))};return{fill:r??a,stroke:a??r,...s&&{strokeGradient:s}}}function Qt(e){if(typeof e==`number`)return{px:`${e}px`};if(e&&typeof e==`object`&&`value`in e){let{value:t,modes:n}=e,r=Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,`${t}px`]));return{px:`${t}px`,byLang:Object.keys(r).length>0?r:void 0}}return{}}function $t(e,t){e.content=t.content;let n=Qt(t.font?.size),r=Qt(t.maxWidth);n.px&&(e.style.fontSize=n.px),n.byLang&&(e.style.fontSizes=n.byLang),r.px&&(e.style.maxWidth=r.px),r.byLang&&(e.style.maxWidths=r.byLang)}function en(e){let t=[],n=(e,r)=>{for(let i of e){let e=i.type===`shape`&&!!i.effects?.some(e=>e.kind===`backdrop`),a=i.mask?`mask`:i.text?.artistic?`artistic-text`:e?`filter`:i.type,o={id:i.id,type:a,style:r?{groupId:r}:{}};i.text&&$t(o,i.text),t.push(o),n(i.children??[],i.id)}};n(e.layers);let r={canvas_width:e.canvas.width,canvas_height:e.canvas.height,languages:e.languages,slots:t};e.canvas.fills?.length&&(r.canvasFills=e.canvas.fills),e.fonts&&(r.fonts=e.fonts);let i=Fe(e.variables);return i&&(r.palettes=i),e.variables?.defaults?.palette&&(r.defaultPalette=e.variables.defaults.palette),Ut(r,e),r}var tn="/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst e=10485760;async function t(t,r=e){let i=t.replace(/\\s+/g,``);try{let e=atob(i);if(e.trim().startsWith(`{`)){if(e.length>r)throw Error(`Metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);try{return JSON.parse(await n(o,`deflate`,r))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await n(o,`deflate-raw`,r))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function n(t,n,r=e){let i=new DecompressionStream(n),a=i.writable.getWriter();a.write(t).catch(function(){}),a.close().catch(function(){});let o=i.readable.getReader(),s=[],c=0;try{for(;;){let{done:e,value:t}=await o.read();if(e)break;if(t){if(c+=t.byteLength,c>r)throw await o.cancel(),Error(`Decompressed metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);s.push(t)}}}finally{o.releaseLock()}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.byteLength;return new TextDecoder().decode(l)}async function r(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function i(e){let i=await e.arrayBuffer(),a=new DataView(i),o=8,s=null,c=null,l=[new Uint8Array(i,0,8)];for(;o<i.byteLength;){let e=a.getUint32(o,!1),t=o+4,r=String.fromCharCode(a.getUint8(t),a.getUint8(t+1),a.getUint8(t+2),a.getUint8(t+3)),u=8+e+4;if(r===`tEXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r.slice(a+1),t=null;try{t=await n(e,`deflate`)}catch{try{t=await n(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{c=JSON.parse(t)}catch{}else s=new TextDecoder(`latin1`).decode(e);o+=u;continue}}}else if(r===`zTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r.slice(a+2);if(e===0)try{s=await n(t,`deflate`)}catch(e){try{s=await n(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(s){o+=u;continue}}}}else if(r===`iTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r[a+2],i=r.slice(a+3),c=i.indexOf(0);if(c!==-1){let r=i.slice(c+1),a=r.indexOf(0);if(a!==-1){let i=r.slice(a+1);if(e===1){if(t===0)try{s=await n(i,`deflate`)}catch(e){try{s=await n(i,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else s=new TextDecoder().decode(i);if(s){o+=u;continue}}}}}}l.push(new Uint8Array(i,o,u)),o+=u}let u=new Blob(l,{type:`image/png`}),d=null;return c?d=c:s&&(d=s.trimStart().startsWith(`{`)?JSON.parse(s):await t(s)),{image:u,metadata:d,imageHash:await r(i)}}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction a(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst o=/* @__PURE__ */ new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),s=/* @__PURE__ */ new Set([`public`,`author_only`,`sealed`]);function c(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?o.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&s.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction l(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst u=`author_only`,d=[`public`,`author_only`,`sealed`];function f(e){if(!e||typeof e!=`object`)return u;let t=c(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&d.includes(n)?n:u}function p(e){return e===`public`?`verified_authorless`:`verified`}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction m(e){let t=l(e)?.oim;return typeof t==`string`&&/^2\\./.test(t)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst h=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}];function g(e){for(let t=0;t<h.length;t++)if(h[t].kid===e)return h[t];return null}let _=null;function v(e){_=typeof e==`string`&&e?e:null}function y(){if(_)return _;let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||`https://api.oim.media/v1/media/keys`}function b(e,t){let n=g(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function x(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}function S(e,t,n=Date.now()){let r=g(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!g(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+6048e5}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst C=2**53-1;function w(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>C:typeof e==`object`&&e?Object.values(e).some(w):!1}const T=/* @__PURE__ */ new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function E(e){if(Array.isArray(e))return e.map(E);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=E(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function D(e){if(Array.isArray(e))return e.map(D);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=D(e[r]);return t}return e}function O(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))T.has(n)||(t[n]=e[n]);let n=D(E(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst k={};let A=null,j=!1,M=null;function N(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function P(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function F(e){let t=g(e);return t?t.jwk:(k[e]||!j&&(M||=N().then(e=>{e.forEach(e=>{k[e.kid]=e}),j=!0}),await M,k[e])||await I(),k[e])}function I(){return A||=(async function(){try{let e=y(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];k[t.kid]=t}await P(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),A}async function L(e){return await I(),k[e]||null}async function R(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await F(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(w(e))return!1;let n=O(e),r=atob(e.signature),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,i,t)},o=await a(t,n);if(!o&&e.creator_user_id){let n={},r=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function i(e){if(Array.isArray(e))return e.map(i);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort();for(let r=0;r<n.length;r++)t[n[r]]=i(e[n[r]]);return t}return e}for(let t=0;t<r.length;t++)n[r[t]]=i(e[r[t]]);o=await a(t,new TextEncoder().encode(JSON.stringify(n)))}if(!o)try{let r=await L(e.key_version);r&&(r.x!==t.x||r.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),o=await a(r,n))}catch{}if(o){let n=b(e.key_version,t);if(!x({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return o||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),o}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function z(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:p(f(e.metadata)):`image_unsealed`}async function B(e,t=Date.now()){let n=e&&e.key_version;return n?g(n)?S(n,null,t):S(n,await L(n),t):!1}function V(e){return e===`image_mismatch`||e===`invalid_signature`}function H(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;v(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=H(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await R(e.metadata,r),l=z({isSigned:s,isSigValid:c,keyExpired:s&&c?await B(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(V(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:m(e.metadata)||a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",nn=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,tn],{type:`text/javascript;charset=utf-8`});function rn(e){let t;try{if(t=nn&&(self.URL||self.webkitURL).createObjectURL(nn),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(tn),{type:`module`,name:e?.name})}}var an=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}],on=`https://api.oim.media/v1/media/keys`;function sn(e){for(let t=0;t<an.length;t++)if(an[t].kid===e)return an[t];return null}function cn(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||on}function ln(e,t){let n=sn(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function un(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}var dn=6048e5;function fn(e,t,n=Date.now()){let r=sn(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!sn(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+dn}var pn=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function mn(e){let t=null,n=null,r=1,i=new Map;function a(e){let t=[...i.values()];i.clear(),t.forEach(t=>t.reject(e))}function o(){if(t)return t;let n=e();return n.onmessage=e=>{let t=e.data,n=t&&typeof t.id==`number`?i.get(t.id):void 0;n&&(i.delete(t.id),n.resolve(t))},n.onerror=e=>{try{n.terminate()}catch{}t===n&&(t=null),a(e)},t=n,n}return{verify(e,t,a){if(n)return Promise.reject(new pn(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new pn(e))}let c=r++;return new Promise((n,r)=>{i.set(c,{resolve:n,reject:r}),s.postMessage({id:c,blob:e,hostname:t,origin:a,keysUrl:cn()})})},stats(){return{alive:t!==null,pending:i.size}}}}var hn=null;function gn(e,t,n){return hn||=mn(()=>new rn),hn.verify(e,t,n)}var _n=10485760;async function vn(e,t=_n){let n=e.replace(/\s+/g,``);try{let e=atob(n);if(e.trim().startsWith(`{`)){if(e.length>t)throw Error(`Metadata exceeds the limit of ${t/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);try{return JSON.parse(await Z(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await Z(i,`deflate-raw`,t))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function Z(e,t,n=_n){let r=new DecompressionStream(t),i=r.writable.getWriter();i.write(e).catch(function(){}),i.close().catch(function(){});let a=r.readable.getReader(),o=[],s=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(t){if(s+=t.byteLength,s>n)throw await a.cancel(),Error(`Decompressed metadata exceeds the limit of ${n/1048576}MB (zip bomb detected)`);o.push(t)}}}finally{a.releaseLock()}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return new TextDecoder().decode(c)}async function yn(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function bn(e){let t=await e.arrayBuffer(),n=new DataView(t),r=8,i=null,a=null,o=[new Uint8Array(t,0,8)];for(;r<t.byteLength;){let e=n.getUint32(r,!1),s=r+4,c=String.fromCharCode(n.getUint8(s),n.getUint8(s+1),n.getUint8(s+2),n.getUint8(s+3)),l=8+e+4;if(c===`tEXt`){let n=new Uint8Array(t,s+4,e),o=n.indexOf(0);if(o!==-1){let e=new TextDecoder().decode(n.slice(0,o));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n.slice(o+1),t=null;try{t=await Z(e,`deflate`)}catch{try{t=await Z(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{a=JSON.parse(t)}catch{}else i=new TextDecoder(`latin1`).decode(e);r+=l;continue}}}else if(c===`zTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n.slice(a+2);if(e===0)try{i=await Z(t,`deflate`)}catch(e){try{i=await Z(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(i){r+=l;continue}}}}else if(c===`iTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n[a+2],o=n.slice(a+3),s=o.indexOf(0);if(s!==-1){let n=o.slice(s+1),a=n.indexOf(0);if(a!==-1){let o=n.slice(a+1);if(e===1){if(t===0)try{i=await Z(o,`deflate`)}catch(e){try{i=await Z(o,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else i=new TextDecoder().decode(o);if(i){r+=l;continue}}}}}}o.push(new Uint8Array(t,r,l)),r+=l}let s=new Blob(o,{type:`image/png`}),c=null;return a?c=a:i&&(c=i.trimStart().startsWith(`{`)?JSON.parse(i):await vn(i)),{image:s,metadata:c,imageHash:await yn(t)}}var xn=2**53-1;function Sn(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>xn:typeof e==`object`&&e?Object.values(e).some(Sn):!1}var Cn=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function wn(e){if(Array.isArray(e))return e.map(wn);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=wn(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function Tn(e){if(Array.isArray(e))return e.map(Tn);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=Tn(e[r]);return t}return e}function En(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Cn.has(n)||(t[n]=e[n]);let n=Tn(wn(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}function Dn(e,t){let n=e||``,r=``;for(let e=0;e<n.length;e++)n.charCodeAt(e)>=32&&(r+=n.charAt(e));return r=r.trim(),r.charAt(0)===`#`?!0:t?!1:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r)||/^https?:/i.test(r)||/^data:image\//i.test(r)}function On(e){if(typeof DOMParser>`u`)return e;try{let t=new DOMParser().parseFromString(e,`text/html`),n=`svg.g.defs.symbol.use.title.desc.path.circle.rect.polygon.polyline.ellipse.line.lineargradient.radialgradient.stop.pattern.image.clippath.mask.filter.fegaussianblur.fecolormatrix.fecomponenttransfer.fefunca.fefuncr.fefuncg.fefuncb.feblend.feoffset.femerge.femergenode.feflood.fecomposite.text.tspan.span.div.br.p.a.b.i.strong.em.img`.split(`.`),r=`class.style.id.lang.aria-hidden.part.transform.d.cx.cy.r.rx.ry.x.y.dx.dy.x1.y1.x2.y2.fx.fy.width.height.points.viewbox.preserveaspectratio.vector-effect.fill.stroke.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.offset.stop-color.stop-opacity.gradientunits.gradienttransform.spreadmethod.patternunits.patterncontentunits.patterntransform.clip-path.clippathunits.mask.maskunits.maskcontentunits.filter.filterunits.primitiveunits.stddeviation.result.in.in2.mode.type.values.tablevalues.flood-color.flood-opacity.operator.font-family.font-size.font-weight.font-style.text-anchor.dominant-baseline.letter-spacing.word-spacing.href.src.target.rel.alt.data-slot-id.allow-lottie.show-controls.crossorigin`.split(`.`),i=t.body.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let t=i[e],a=t.tagName.toLowerCase();if(n.indexOf(a)===-1){t.parentNode?.removeChild(t);continue}let o=t.attributes;for(let e=o.length-1;e>=0;e--){let n=o[e],i=n.name.toLowerCase();if(i.indexOf(`on`)===0||r.indexOf(i)===-1)t.removeAttribute(n.name);else{if(i===`href`&&!Dn(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=An(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&jn(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(Mn(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function kn(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function An(e){return typeof e==`string`?e.indexOf(`\\`)!==-1||/@import|image-set\s*\(/i.test(e)?``:e.indexOf(`(`)===-1?e:e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,function(e,t,n){let r=String(n).trim().toLowerCase();return r.indexOf(`#`)===0||r.indexOf(`data:`)===0?e:`none`}):e}function jn(e){let t=typeof e==`string`?e:``;if(t.indexOf(`\\`)!==-1||/image-set\s*\(|@import/i.test(t))return!0;let n=/url\(\s*['"]?\s*([^'")\s]*)/gi,r;for(;(r=n.exec(t))!==null;){let e=r[1].trim().toLowerCase();if(e.indexOf(`#`)!==0&&e.indexOf(`data:`)!==0)return!0}return!1}function Mn(e){let t=(e||``).trim();if(t.indexOf(`data:image/`)!==0)return!1;let n=t.indexOf(`,`);if(n===-1)return!1;let r=t.substring(0,n).toLowerCase();if(r.indexOf(`;base64`)===-1)return!1;let i=r.substring(5,r.indexOf(`;`));return[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`,`image/gif`].indexOf(i)!==-1}function Nn(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var Pn={},Fn=null,In=!1,Ln=null;function Rn(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function zn(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function Bn(e){let t=sn(e);return t?t.jwk:(Pn[e]||!In&&(Ln||=Rn().then(e=>{e.forEach(e=>{Pn[e.kid]=e}),In=!0}),await Ln,Pn[e])||await Vn(),Pn[e])}function Vn(){return Fn||=(async function(){try{let e=cn(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];Pn[t.kid]=t}await zn(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),Fn}async function Hn(e){return await Vn(),Pn[e]||null}async function Un(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await Bn(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(Sn(e))return!1;let r=En(e),i=atob(e.signature),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);let o=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,a,t)},s=await o(t,r);if(!s&&e.creator_user_id){let r={},i=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function n(e){if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={},r=Object.keys(e).sort();for(let i=0;i<r.length;i++)t[r[i]]=n(e[r[i]]);return t}return e}for(let t=0;t<i.length;t++)r[i[t]]=n(e[i[t]]);s=await o(t,new TextEncoder().encode(JSON.stringify(r)))}if(!s)try{let n=await Hn(e.key_version);n&&(n.x!==t.x||n.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),s=await o(n,r))}catch{}if(s){let n=ln(e.key_version,t);if(!un({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return s||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),s}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function Wn(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:V(B(e.metadata)):`image_unsealed`}async function Gn(e,t=Date.now()){let n=e&&e.key_version;return n?sn(n)?fn(n,null,t):fn(n,await Hn(n),t):!1}function Kn(e){return e===`image_mismatch`||e===`invalid_signature`}var qn=`OIM_ALTERED`;function Jn(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}async function Yn(e,t){if(!e||e.v!==1||e.alg!==`sha256-idat`||typeof e.image_hash!=`string`||typeof e.signature!=`string`||typeof e.key_version!=`string`||!t||e.image_hash.toLowerCase()!==t.toLowerCase())return`invalid`;let n=new TextEncoder().encode(JSON.stringify({alg:e.alg,image_hash:e.image_hash,key_version:e.key_version,v:e.v}));try{let t=atob(e.signature),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let i=async e=>{let t=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!1,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},t,r,n)},a=await Bn(e.key_version),o=!!a&&await i(a);if(!o){let t=await Hn(e.key_version).catch(()=>null);t&&(!a||t.x!==a.x||t.y!==a.y)&&(o=await i(t))}if(!o)return`invalid`}catch{return`invalid`}return await Gn({key_version:e.key_version})?`expired_key`:`ok`}var Xn=Math.log(1.05)/100,Zn=.01,Qn=16,$n=800;function er(e,t,n,r){let i=n===1?t*Qn:n===2?t*$n:t,a=e*Math.exp(-i*(r?Zn:Xn));return Math.max(1,Math.min(4,a))}var tr=`1.32.3`,nr=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function rr(e){if(typeof e!=`string`)return null;let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function ir(e,t){let n=rr(e),r=rr(t);if(!n||!r)return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}function ar(e,t){let n=e&&typeof e.min_player==`string`?e.min_player:null,r=(Array.isArray(e?.capabilities)?e.capabilities:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),i=(Array.isArray(e?.capabilities_required)?e.capabilities_required:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),a=ir(n,t.version),o=a||i.length>0,s=a||r.length>0||i.length>0;return{requiredVersion:n,versionTooOld:a,missingCapabilities:r,missingRequiredCapabilities:i,cannotRender:o,hasNotice:s,hayAlgoQueDecir:s}}function or(e){let t=[];return e.versionTooOld&&t.push(`the file requires format version ${e.requiredVersion}`),e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0&&t.push(`requires ${e.missingRequiredCapabilities.join(`, `)}`),e.missingCapabilities&&e.missingCapabilities.length>0&&t.push(`uses ${e.missingCapabilities.join(`, `)}`),t.length===0?``:`${e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0?`It cannot be fully rendered`:`Rendered what was possible`}: ${t.join(` and `)}.`}var sr=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,cr=546136,lr={woff:`wOFF`,woff2:`wOF2`};function ur(e,t){try{return atob(e.slice(0,8)).startsWith(lr[t])}catch{return!1}}function dr(e){let t=e&&Array.isArray(e.fonts)?e.fonts:[],n=[];for(let e of t)e&&typeof e==`object`&&(e.format!==`woff`&&e.format!==`woff2`||typeof e.family!=`string`||typeof e.data!=`string`||typeof e.name!=`string`||!sr.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>cr||!ur(e.data,e.format)||n.push({family:e.family,name:e.name,weight:e.weight,style:e.style,format:e.format,data:e.data}));return n}async function fr(e,t=document.fonts,n=(e,t,n)=>new FontFace(e,t,n)){let r=new Map;return await Promise.all(e.map(async e=>{try{let i=n(e.name,`url(data:font/${e.format};base64,${e.data})`,{weight:String(e.weight),style:e.style});await i.load(),t.add(i),r.set(e.family,e.name)}catch{}})),r}function pr(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var mr=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function hr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`{`||r===`}`){if(e[n+1]===r){t.push({kind:`text`,s:r}),n+=2;continue}if(r===`{`){let r=mr.exec(e.slice(n));if(r){t.push({kind:r[1]?`close`:`open`,name:r[2],raw:r[0],at:n}),n+=r[0].length;continue}}t.push({kind:`stray`,raw:r,at:n}),n+=1;continue}let i=n;for(;i<e.length&&e[i]!==`{`&&e[i]!==`}`;)i++;t.push({kind:`text`,s:e.slice(n,i)}),n=i}return t}function gr(e,t){let n=[],r=[],i,a=null,o=(e,t)=>{i||={reason:e,at:t}},s=e=>{if(!e)return;let t=n[n.length-1];t&&t.mark===(a??void 0)?t.text+=e:n.push(a?{text:e,mark:a}:{text:e})};for(let n of hr(e))n.kind===`text`?s(n.s):n.kind===`stray`?(o(`stray brace`,n.at),s(n.raw)):t.includes(n.name)?n.kind===`open`?a?(o(`"${n.name}" inside "${a}"`,n.at),s(n.raw)):(a=n.name,r.push(n.name)):a===n.name?a=null:(o(`"${n.name}" closed without being open`,n.at),s(n.raw)):(o(`unknown mark "${n.name}"`,n.at),s(n.raw));return a&&o(`"${a}" is not closed`,e.length),{runs:n,sequence:r,error:i}}function _r(e,t){return gr(e,t).runs}function vr(e){return e.replace(/[{}]/g,e=>e+e)}function yr(e,t){return _r(e,t).map(e=>e.text).join(``)}function br(e,t){let n=``,r=[];for(let i of _r(e,t))i.mark&&r.push({from:n.length,to:n.length+i.text.length,mark:i.mark}),n+=i.text;return{plain:n,ranges:r}}function xr(e,t){let n=``,r=0;for(let i of[...t].sort((e,t)=>e.from-t.from)){let t=Math.max(i.from,r),a=Math.min(i.to,e.length);a<=t||(n+=vr(e.slice(r,t))+`{${i.mark}}`+vr(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+vr(e.slice(r))}function Sr(e){let t={underline:e.underline===!0},n=z(e.colorRole,e.color);if(n&&(t.color=n),e.bold&&(t.fontWeight=700),e.italic&&(t.fontStyle=`italic`),e.highlight){let n=e.highlight;t.highlight={style:n.style??`marker`,color:z(n.colorRole,n.color)||`rgba(245, 158, 11, 0.35)`,paddingX:n.paddingX??4,paddingY:n.paddingY??2,borderRadius:n.borderRadius??3}}return t}function Cr(e,t){return yr(e,Object.keys(t??{}))}function wr(e,t,n){e.textContent=``;for(let r of _r(t,Object.keys(n??{}))){let t=r.mark?n?.[r.mark]:void 0;if(!r.mark||!t){e.appendChild(document.createTextNode(r.text));continue}let i=document.createElement(`span`);i.dataset.mark=r.mark,i.textContent=r.text;let a=Sr(t),o=i.style;a.color&&(o.color=a.color),a.fontWeight&&(o.fontWeight=String(a.fontWeight)),a.fontStyle&&(o.fontStyle=a.fontStyle),a.underline&&(o.textDecoration=`underline`);let s=a.highlight;s&&(s.style===`underline-thick`?o.boxShadow=`inset 0 -.4em 0 ${s.color}`:o.backgroundColor=s.color,o.borderRadius=s.style===`pill`?`9999px`:s.style===`box`?`0`:`${s.borderRadius}px`,o.padding=`${s.paddingY}px ${s.paddingX}px`,o.boxDecorationBreak=`clone`,o.webkitBoxDecorationBreak=`clone`),e.appendChild(i)}}function Tr(e){let t={scale:e.lines===3?3.2:2.2,lineHeight:.85,marginRight:e.marginRight??8,fontWeight:700};return e.color&&(t.color=e.color),e.fontFamily&&(t.fontFamily=e.fontFamily),t}function Er(e,t){let{plain:n,ranges:r}=br(e,t);if(!n)return{letter:``,rest:``};let i=r.map(e=>({...e,from:Math.max(0,e.from-1),to:e.to-1}));return{letter:n[0],rest:xr(n.slice(1),i)}}var Dr=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function Or(e){if(e.svg&&/<svg[\s>]/i.test(e.svg))return{image:`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}")`,size:`100% 100%`};if(e.type===`image`&&e.image&&Dr.test(e.image)){let t=e.fit===`contain`?`contain`:e.fit===`fill`?`100% 100%`:`cover`;return{image:`url("${e.image}")`,size:t}}return null}var kr=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Ar=.35,jr=.05,Mr=[`slide-up`,`reveal-mask`,`rise-words`];function Nr(e){return typeof e==`string`&&kr.includes(e)}function Pr(e){return e===`reveal-mask`}function Fr(e,t){return Mr.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function Ir(e,t=jr,n=0){return n+e*t}function Lr(e,t){let n=Math.max(0,Math.min(1,t)),r=n*(2-n);if(e===`slide-up`)return{opacity:r,translateYEm:(1-r)*.6,scale:1,rotateDeg:0};if(e===`reveal-mask`)return{opacity:1,translateYEm:(1-r)*1.2,scale:1,rotateDeg:0};if(e===`scale-in`)return{opacity:r,translateYEm:0,scale:.6+.4*r,rotateDeg:0};if(e===`rise-words`)return{opacity:r,translateYEm:(1-r)*.8,scale:1,rotateDeg:(1-r)*8};if(e===`bounce-chars`){let e=r===0?0:r<.7?r/.7*1.15:1.15-(r-.7)/.3*.15;return{opacity:r,translateYEm:0,scale:Math.round(e*1e6)/1e6,rotateDeg:0}}return{opacity:r,translateYEm:0,scale:1,rotateDeg:0}}function Rr(e,t=10){return Array.from({length:t+1},(n,r)=>Lr(e,r/t))}function zr(){return Promise.resolve().then(()=>(K(),Te)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function Br(e){let t=[];return e.generative&&t.push(Le()),e.patterns&&t.push(ze()),Promise.all(t).then(()=>void 0)}var Vr=/^(fill|background)Pattern/;function Hr(e){let t={generative:!1,patterns:!1},n=new Set,r=e=>{if(!e||typeof e!=`object`||n.has(e)||t.generative&&t.patterns)return;if(n.add(e),Array.isArray(e)){e.forEach(r);return}let i=e;(i.kind===`generative`||i.fillType===`generative`||i.fillGenerative)&&(t.generative=!0),(i.kind===`pattern`||i.fillType===`pattern`||`drawing`in i)&&(t.patterns=!0);for(let e in i)Vr.test(e)&&i[e]!=null&&(t.patterns=!0),r(i[e])};return r(e),t}var Ur={silhouette:null,fillable:!0,round:!1};function Wr(e){if(!e||e.kind===`rect`)return Ur;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=Ge(t);return n?{silhouette:ot({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:Ur}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=ot({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:Ur}return Ur}var Gr=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,Kr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function qr(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,ee=(-_-C)/u,k=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},A=k(1,0,E,D),j=k(E,D,O,ee);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),te=j/M,N=4/3*Math.tan(te/4),P=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],ne=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],F=[];for(let e=0;e<M;e++){let t=A+e*te,n=t+te,r=P(t),i=P(n),a=ne(t),o=ne(n);F.push([r[0]+N*a[0],r[1]+N*a[1],i[0]-N*o[0],i[1]-N*o[1],i[0],i[1]])}return F}function Jr(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),Gr.lastIndex=n;let t=Gr.exec(e);return t?(n=Gr.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<Kr[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=qr(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function Yr(e,t){let n=Jr(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var Xr=[0,0,100,100],Zr=[5,5,90,90],Qr={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function $r(e,t){return e===`line`?Qr:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function ei(e){if(e===void 0)return Xr;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function ti(e,[t,n,r,i],a){return Yr(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function ni(e,t){let n=e.geoShape,r=Ge(n);if(n&&r){let e=$r(n,r);return ti(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?Xr:Zr,t)}if(e.svgPath){let n=ei(e.svgViewBox);return n?ti(e.svgPath,n,t):null}return null}var ri=new Set([`line`,`scribble`]),ii=.5523;function ai(e,t,n){return Math.max(0,Math.min(Number.isFinite(e)?e:0,t/2,n/2))}function oi(e,[t,n,r,i]){let{x:a,y:o,width:s,height:c}=e,l=ii;return[`M${a+t} ${o}`,`L${a+s-n} ${o}`,`C${a+s-n+l*n} ${o} ${a+s} ${o+n-l*n} ${a+s} ${o+n}`,`L${a+s} ${o+c-r}`,`C${a+s} ${o+c-r+l*r} ${a+s-r+l*r} ${o+c} ${a+s-r} ${o+c}`,`L${a+i} ${o+c}`,`C${a+i-l*i} ${o+c} ${a} ${o+c-i+l*i} ${a} ${o+c-i}`,`L${a} ${o+t}`,`C${a} ${o+t-l*t} ${a+t-l*t} ${o} ${a+t} ${o}`,`Z`].join(` `)}function si(e,t){let n=e.geoShape;return!n||n===`rect`||n===`rectangle`?oi(t,[e.borderRadiusTopLeft??0,e.borderRadiusTopRight??0,e.borderRadiusBottomRight??0,e.borderRadiusBottomLeft??0].map(e=>ai(e,t.width,t.height))):ri.has(n)?null:ni({geoShape:n},t)}var ci={x:0,y:0,width:100,height:100};function li(e){return`mask-clip-${e.id}`}function ui(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0];return{x:typeof n.x==`number`?n.x:Number(r[0])/100*t.width,y:typeof n.y==`number`?n.y:Number(r[1])/100*t.height,width:typeof n.width==`number`?n.width:Number(n.width_px)||0,height:typeof n.height==`number`?n.height:Number(n.height_px)||0}}function di(e){return`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`}function fi(e,t){return e===`rect`||e===`rectangle`?di(t):ni({geoShape:e},t)}function pi(e,t){let n=e.style||{},r=n.maskShape||n.geoShape,i=n.maskSvgPath||n.svgPath;return i&&(!r||r===`custom`)?ni({svgPath:i},t):fi(r||`circle`,t)}function mi(e,t){return{x:t.x+(e.x||0),y:t.y+(e.y||0),width:e.width||0,height:e.height||0}}function hi(e,t){let n=mi(e,t);return e.svgPath?ni({svgPath:e.svgPath},n):fi(e.shape||`circle`,n)}function gi(e){let t=e,n=t.cuts||t.style&&t.style.cuts;return Array.isArray(n)?n:[]}function _i(e,t){let n=gi(e);return n.length>0?n.map(e=>hi(e,t)??di(mi(e,t))).join(` `):pi(e,t)??di(t)}function vi(e){let t=gi(e);return t.length>0?t.every(e=>hi(e,ci)!==null):pi(e,ci)!==null}function yi(e,t){let{width:n,height:r}=t,i=e,a=ui(e,t);return`${((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?di(a):`M0 0H${n}V${r}H0Z`} ${_i(e,a)}`}function bi(e,t){let n=ui(e,t);return pi(e,n)??di(n)}function xi(e,t){if(!e||e===`rectangle`||e===`rect`)return{};let n=si({geoShape:e},{x:0,y:0,width:t.width,height:t.height});return n===null?{}:{clipPath:`path("${n}")`}}var Si={shadows:`#1e1b4b`,lights:`#fbbf24`};function Ci(e){return`duotone-filter-${e.id}`}function wi(e){return`mask-feather-${e.id}`}function Ti(e,t){let{width:n,height:r}=t,i=ui(e,t);return`${`M0 0H${n}V${r}H0Z`} ${di(i)} ${_i(e,i)}`}function Ei(e){let t=[];for(let n of e)if(n.type===`mask`){let e=n.style||{};if(e.maskMode!==`cutout`){t=[...t,{kind:`shape`,shape:n}];continue}let r=e.maskFeather&&e.maskFeather>0?{maskStyle:`url(#${wi(n)})`}:{clipPath:`url(#${li(n)})`};t=t.map(e=>e.clipPath||e.maskStyle?{kind:`filterGroup`,shape:n,children:[e],...r}:{...e,...r})}else t=[...t,{kind:`shape`,shape:n}];return t}var Di=6,Oi=5,ki=8,Ai=2*Math.PI/Di,ji=`oim-wave-chars`;function Mi(){let e=[];for(let t=0;t<=ki;t++){let n=t/ki,r=parseFloat((n*100).toFixed(4)),i=Math.sin(n*2*Math.PI)*Oi,a=parseFloat(i.toFixed(4));e.push(` ${r}% { transform: translateY(${a}px); }`)}return`@keyframes ${ji} {\n${e.join(`
51
+ [data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function F(e){if(!e)return;let t=ne();if(document.head&&!document.getElementById(`oim-player-styles`)){let e=document.createElement(`style`);e.id=`oim-player-styles`,e.textContent=t,document.head.appendChild(e)}if(e.getElementById&&!e.getElementById(`oim-player-styles`)){let n=document.createElement(`style`);n.id=`oim-player-styles`,n.textContent=t,e.appendChild(n)}}function I(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}var L=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),re=new Set([`public`,`author_only`,`sealed`]);function ie(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?L.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&re.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var ae=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],oe=new Set(ae);function se(e){return typeof e==`string`&&oe.has(e)}var R=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,ce=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,le=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),ue=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,de=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function fe(e,t=0){if(typeof e!=`string`)return!1;let n=e.trim();if(!n||n.length>128||t>4||/[;{}<>"]/.test(n)||n.includes(`\\`)||/url\(|expression\(|\/\*/i.test(n))return!1;if(R.test(n)||le.has(n.toLowerCase())||ce.test(n)||ue.test(n))return!0;let r=de.exec(n);return r?fe(r[2],t+1):!1}function pe(e,t={}){let n=e.palettes??{},r=Object.hasOwn(n,`dark`)&&Object.hasOwn(n,`light`)&&t.prefersDark!==void 0?t.prefersDark?`dark`:`light`:void 0,i=[t.requested,r,e.defaultPalette].find(e=>typeof e==`string`&&Object.hasOwn(n,e));if(i===void 0)return null;let a={};for(let e of ae){let t=n[i][e];fe(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function z(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&fe(n)?n:void 0;if(se(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function me(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var he={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function ge(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function _e(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(he,t)?t:void 0,blur:ge(e.filterBlur,0,100)??0,brightness:ge(e.filterBrightness,0,500)??100,contrast:ge(e.filterContrast,0,500)??100,saturate:ge(e.filterSaturate,0,500)??100,hue:ge(e.filterHueRotate,0,360)??0}}function ve(e){let t=_e(e),n=[];return t.preset!==void 0&&n.push(he[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}var ye=`author_only`,be=[`public`,`author_only`,`sealed`];function B(e){if(!e||typeof e!=`object`)return ye;let t=ie(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&be.includes(n)?n:ye}function V(e){return e===`public`?`verified_authorless`:`verified`}function xe(e){return!!e&&e.type===`group`}function H(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function Se(e){let t=new Set;for(let n of e||[])xe(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||xe(r))continue;let e=H(r);if(!e||!t.has(e))continue;let i=n.get(e);i?i.push(String(r.id)):n.set(e,[String(r.id)])}return n}function U(e){let t=me(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var W=`oim:base`;function Ce(e){let t=t=>{if(typeof t==`string`)return t===W;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===W}return t.value===W||Object.values(t.modes??{}).includes(W)},n=e=>e.some(e=>e.image!==void 0&&t(e.image.src)||n(e.children??[]));return n(e.layers)}function we(e){let t=structuredClone(e),n=[],r=e.resources??{},i=e=>{if(!(`ref`in e))return e;if(Object.prototype.hasOwnProperty.call(r,e.ref))return structuredClone(r[e.ref]);n.includes(e.ref)||n.push(e.ref)},a=e=>e.flatMap(e=>i(e)??[]),o=e=>{for(let t of e){if(t.fills&&=a(t.fills),t.strokes&&=t.strokes.flatMap(e=>{let t=i(e.paint);return t?[{...e,paint:t}]:[]}),t.image&&typeof t.image.src==`object`&&`ref`in t.image.src){let e=t.image.src,i=Object.prototype.hasOwnProperty.call(r,e.ref)?r[e.ref]:void 0;i&&`kind`in i&&i.kind===`image`?t.image={...t.image,src:i.src}:(delete t.image,n.includes(e.ref)||n.push(e.ref))}t.children&&o(t.children)}};return t.canvas.fills&&(t.canvas.fills=a(t.canvas.fills)),o(t.layers),{document:t,missing:n}}var Te=r({createExternalLottieLoader:()=>Oe,createExternalScriptLoader:()=>De,default:()=>G,vendorUrl:()=>Ee});function Ee(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return ke+n}function De(e){let t=null;return function(){let n=e.read();if(n)return Promise.resolve(n);if(t)return t;let r=e.doc??document,i=ke+e.file;if(e.scriptUrl)try{i=new URL(e.file,e.scriptUrl).href}catch{}return t=new Promise((t,n)=>{let a=r.createElement(`script`);a.src=i,a.async=!0,a.setAttribute(e.marker,``),a.onload=()=>{let r=e.read();r?t(r):n(Error(`Script loaded from ${i} but did not define what was expected`))},a.onerror=()=>{a.remove(),n(Error(`Could not load ${i}`))},(r.head||r.documentElement).appendChild(a)}),t.catch(()=>{t=null}),t}}function Oe(e){return De({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var ke,Ae,G,K=n((()=>{ke=`https://cdn.oim.media/player/v1/`,Ae=Oe({scriptUrl:i,version:`5.13.0`}),G={__oimExternal:!0,load:Ae}}));a(),K();var je=`__oimUpgrade`,Me=()=>globalThis[je],q=De({scriptUrl:i,file:`vendor/oim-upgrade-3f63168f9e35.js`,marker:`data-oim-upgrade`,read:()=>Me()}),Ne=e=>{let t=Me();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Pe(){return Me()?Promise.resolve():q().then(()=>void 0)}function Fe(e){let t=e?.modes?.palette;if(!e||!t)return;let n=Object.fromEntries(t.map(e=>[e,{}]));for(let[t,r]of Object.entries(e.values??{}))for(let[e,i]of Object.entries(r))n[e]&&typeof i==`string`&&(n[e][t]=i);return n}function Ie(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?z(e.var,e.fallback):typeof e==`string`?z(null,e):``)||void 0,literal:n=>(t(n)?pe(e)?.colors?.[n.var]??z(null,n.fallback):typeof n==`string`?z(null,n):``)||void 0}}a(),K();var J=()=>globalThis.__oimGenerative,Le=De({scriptUrl:i,file:`vendor/oim-generative-3f63168f9e35.js`,marker:`data-oim-generative`,read:()=>J()}),Re=(e,t)=>J()?.renderGenerativeSVG(e,t)??``;a(),K();var Y=()=>globalThis.__oimPatterns,ze=De({scriptUrl:i,file:`vendor/oim-patterns-3f63168f9e35.js`,marker:`data-oim-patterns`,read:()=>Y()}),Be=e=>Y()?.generatePatternSVG(e)??``,Ve=(...e)=>Y()?.patternTileUri(...e)??``,He=e=>Y()?.isMultiColorPattern(e)??!1,Ue=(...e)=>Y()?.resolvePatternColors(...e)??{fgColor:`#000000`,bgColor:`transparent`},We={triangle:{kind:`polygon`,points:[[50,5],[95,90],[5,90]]},star:{kind:`polygon`,points:[[50,2],[62,38],[100,38],[69,59],[80,95],[50,73],[20,95],[31,59],[0,38],[38,38]]},arrow:{kind:`polygon`,points:[[5,40],[60,40],[60,20],[95,50],[60,80],[60,60],[5,60]]},diamond:{kind:`polygon`,points:[[50,5],[95,50],[50,95],[5,50]]},hexagon:{kind:`polygon`,points:[[25,5],[75,5],[95,50],[75,95],[25,95],[5,50]]},circle:{kind:`path`,d:`M 50,5 A 45,45 0 1,1 49.999,5 Z`,fillable:!0},heart:{kind:`path`,d:`M 50,88 C 10,60 -5,30 15,12 C 30,-2 50,5 50,25 C 50,5 70,-2 85,12 C 105,30 90,60 50,88 Z`,fillable:!0},line:{kind:`path`,d:`M 5,50 L 95,50`,fillable:!1},blob:{kind:`path`,d:`M 50,10 C 75,10 92,25 90,50 C 88,75 75,90 50,90 C 25,90 10,75 10,50 C 10,25 25,10 50,10 Z`,fillable:!0},scribble:{kind:`path`,d:`M 5,80 Q 25,65 50,75 T 95,70 Q 75,85 50,82 T 5,88`,fillable:!1},pill:{kind:`path`,d:`M 30,25 L 70,25 C 83.8,25 95,36.2 95,50 C 95,63.8 83.8,75 70,75 L 30,75 C 16.2,75 5,63.8 5,50 C 5,36.2 16.2,25 30,25 Z`,fillable:!0},octagon:{kind:`polygon`,points:[[30,5],[70,5],[95,30],[95,70],[70,95],[30,95],[5,70],[5,30]]},pentagon:{kind:`polygon`,points:[[50,5],[94.7,37.5],[77.6,90],[22.4,90],[5.3,37.5]]},cross:{kind:`polygon`,points:[[35,5],[65,5],[65,35],[95,35],[95,65],[65,65],[65,95],[35,95],[35,65],[5,65],[5,35],[35,35]]},moon:{kind:`path`,d:`M 50,5 C 25.15,5 5,25.15 5,50 C 5,74.85 25.15,95 50,95 C 30,80 30,20 50,5 Z`,fillable:!0},cloud:{kind:`path`,d:`M 25,85 C 8,85 5,62 22,58 C 14,40 35,32 45,42 C 48,22 75,20 78,42 C 96,40 97,66 80,68 C 80,78 78,85 68,85 Z`,fillable:!0},drop:{kind:`path`,d:`M 50,5 C 62,25 80,45 80,65 C 80,81.5 66.5,95 50,95 C 33.5,95 20,81.5 20,65 C 20,45 38,25 50,5 Z`,fillable:!0},bolt:{kind:`polygon`,points:[[62,5],[18,58],[46,58],[34,95],[82,40],[55,40],[72,5]]},bubble:{kind:`path`,d:`M 20,5 L 80,5 C 88.3,5 95,11.7 95,20 L 95,57 C 95,65.3 88.3,72 80,72 L 42,72 L 22,93 L 28,72 L 20,72 C 11.7,72 5,65.3 5,57 L 5,20 C 5,11.7 11.7,5 20,5 Z`,fillable:!0},flower:{kind:`path`,d:`M 65.6,41.0 C 85.5,35.7 97.5,39.9 95.0,50.0 C 97.5,60.1 85.5,64.3 65.6,59.0 C 80.1,73.5 82.5,86.1 72.5,89.0 C 65.0,96.2 55.3,87.9 50.0,68.0 C 44.7,87.9 35.0,96.2 27.5,89.0 C 17.5,86.1 19.9,73.5 34.4,59.0 C 14.5,64.3 2.5,60.1 5.0,50.0 C 2.5,39.9 14.5,35.7 34.4,41.0 C 19.9,26.5 17.5,13.9 27.5,11.0 C 35.0,3.8 44.7,12.1 50.0,32.0 C 55.3,12.1 65.0,3.8 72.5,11.0 C 82.5,13.9 80.1,26.5 65.6,41.0 Z`,fillable:!0},burst:{kind:`polygon`,points:[[95,50],[82.8,58.8],[89,72.5],[74,74],[72.5,89],[58.8,82.8],[50,95],[41.2,82.8],[27.5,89],[26,74],[11,72.5],[17.2,58.8],[5,50],[17.2,41.2],[11,27.5],[26,26],[27.5,11],[41.2,17.2],[50,5],[58.8,17.2],[72.5,11],[74,26],[89,27.5],[82.8,41.2]]},arch:{kind:`path`,d:`M 5,95 L 5,50 C 5,25.15 25.15,5 50,5 C 74.85,5 95,25.15 95,50 L 95,95 Z`,fillable:!0}};[...Object.keys(We).filter(e=>e!==`line`&&e!==`scribble`)];function Ge(e){if(e&&e!==`rect`&&e!==`rectangle`)return We[e]}function Ke(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var qe=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,Je=/^[A-Za-z0-9.%\s-]+$/,Ye=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,Xe=/^[A-Za-z]+$/,Ze=2048;function Qe(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`(`)n++;else if(a===`)`){if(--n<0)return null}else a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return n===0?(t.push(e.slice(r).trim()),t):null}function $e(e){let t=Ye.exec(e);if(!t)return!1;let n=t[1].trim();return Xe.test(n)||fe(n)}function et(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>Ze||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=qe.exec(t);if(!n)return!1;let r=Qe(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=$e(i)?r:Je.test(i)?a:null;return!!o&&o.length>0&&o.every($e)}var tt=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,nt=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,rt=`0 0 100 100`,it=e=>e&&e.length<=2e4&&tt.test(e)?e:void 0,at=e=>e&&e.length<=64&&nt.test(e)?e:rt;function ot(e){let t=Ge(e.geoShape),n=it(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:rt}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&it(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:rt}:n?{d:n,viewBox:at(e.svgViewBox)}:null}var st=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function ct(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${Be({type:e.fillPatternType||`clouds`,bgColor:e.fillPatternBgColor||`transparent`,fgColor:e.fillPatternColor||`#000000`,scale:t,svgs:e.fillPatternSvgs,colors:e.fillPatternColors,sizes:e.fillPatternSizes,counts:e.fillPatternCounts,dispersions:e.fillPatternDispersions})}")`,backgroundSize:`${n}px ${n}px`,backgroundRepeat:`repeat`,"--oim-bg-tile":`${n}px`},i=e.fillPatternDirection||`right`,a=e.fillPatternSpeed;return a&&a>0&&st.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function lt(e){let t=e.fillType||(e.fillColor?`color`:`none`);if(t===`none`)return{};let n=e.type===`text`,r={};return t===`generative`?r=e.fillGenerative?{backgroundImage:`url("${Re(e.fillGenerative,{width:e.width||100,height:e.height||100})}")`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`}:e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`pattern`?r=e.fillPatternType?ct(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=et(e.fillGradient)?{backgroundImage:e.fillGradient}:{}:(t===`color`||t===`image`)&&(r=e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}),n&&(t===`gradient`||t===`generative`&&e.fillGenerative||t===`pattern`&&e.fillPatternType)?{...r,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}:r}function ut(e,t){if(!e&&t?.svgPath){let e=ot({svgPath:t.svgPath,svgViewBox:t.svgViewBox});return e?.d?dt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${e.viewBox}" preserveAspectRatio="none"><path d="${e.d}" fill="black"/></svg>`):{}}if(!e||e===`rectangle`)return{};let n=We[e];return!n||n.kind===`path`&&!n.fillable?{}:dt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${n.kind===`polygon`?`<polygon points="${Ke(n.points)}" fill="black"/>`:`<path d="${n.d}" fill="black"/>`}</svg>`)}function dt(e){let t=`url("data:image/svg+xml,${encodeURIComponent(e)}")`;return{maskImage:t,WebkitMaskImage:t,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`}}function ft(e){if(!/<svg\b/i.test(e))return{};let t=e.replace(/\bfill="[^"]*"/g,`fill="#000"`).replace(/\bstroke="(?!none")[^"]*"/g,`stroke="#000"`).replace(/([;"'\s{])fill\s*:\s*[^;"'}]+/g,`$1fill:#000`).replace(/([;"'\s{])stroke\s*:\s*(?!none\b)[^;"'}]+/g,`$1stroke:#000`);/xmlns=/.test(t)||(t=t.replace(/<svg\b/i,`<svg xmlns="http://www.w3.org/2000/svg"`));let n=`url("data:image/svg+xml,${encodeURIComponent(t)}")`;return{maskImage:n,WebkitMaskImage:n,maskSize:`100% 100%`,WebkitMaskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}}function pt(e){let t=ct(e);return Object.assign(t,ut(e.geoShape)),t}var mt=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,ht=(e,t)=>mt(e)?t.literal(e.fallback):t.literal(e);function gt(e,t){let n=(e.colors??[]).map(e=>ht(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:mt(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:ht(e.bg,t),fillPatternBgColorRole:mt(e.bg),fillPatternScale:e.scale,fillPatternSizes:e.sizes,fillPatternCounts:e.counts,fillPatternDispersions:e.dispersions,fillPatternSvgs:e.svgs,fillPatternDirection:e.motion?.direction,fillPatternSpeed:e.motion?.period}}var _t=e=>`${+(e*100).toFixed(4)}%`;function vt(e,t){let n=[];for(let r of e.stops){let e=t.css(r.color);if(!e)return;n.push(r.at===void 0?e:`${e} ${_t(r.at)}`)}let r=e.type===`linear`?e.angle===void 0?``:`${e.angle}deg, `:e.type===`conic`?e.angle===void 0?``:`from ${e.angle}deg, `:``;return`${e.type}-gradient(${r}${n.join(`, `)})`}var yt=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),bt=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function xt(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?xt(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return bt(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?vt(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return bt(i?yt(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return bt(lt({...gt(t,r),type:i?`text`:`shape`,fillType:`pattern`,fillPatternType:t.preset??`clouds`,fillPatternColor:n[0],fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:r.literal(t.bg)}),e.opacity)}case`generative`:return bt(lt({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);default:return{}}}function St(e,t){if(typeof e==`number`)return e;if(e&&typeof e==`object`&&`value`in e){let{value:n,modes:r}=e,i=r?.[t];return typeof i==`number`?i:typeof n==`number`?n:void 0}}function Ct(e,t){let n=e?.text;if(!n)return;let r={},i=St(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=St(n.maxWidth,t);return a!==void 0&&(r.maxWidth=`${+a.toFixed(4)}px`),n.font?.family&&(r.fontFamily=n.font.family),n.font?.weight!==void 0&&(r.fontWeight=String(n.font.weight)),n.font?.italic&&(r.fontStyle=`italic`),n.letterSpacing!==void 0&&(r.letterSpacing=`${n.letterSpacing}px`),n.transform&&(r.textTransform=n.transform),n.decoration&&(r.textDecoration=n.decoration),r}function wt(e,t){let[n,r,i,a]=t,o=n+i/2,s=r+a/2,c=e.stops.length,l=e.stops.map((e,t)=>({offset:`${Math.round((e.at??t/(c-1))*1e4)/100}%`,color:e.color}));if(e.type===`radial`)return{tag:`radialGradient`,attrs:{cx:o,cy:s,r:Math.hypot(i/2,a/2)},stops:l};let u=((e.angle??180)-90)*Math.PI/180,d=(Math.abs(i*Math.cos(u))+Math.abs(a*Math.sin(u)))/2,f=Math.cos(u)*d,p=Math.sin(u)*d;return{tag:`linearGradient`,attrs:{x1:o-f,y1:s-p,x2:o+f,y2:s+p},stops:l}}function X(e,t){if(!e||typeof e!=`object`)return;let n=(t||``).toLowerCase();if(e[n]!==void 0)return e[n];let r=Object.keys(e);for(let t=0;t<r.length;t++)if(r[t].toLowerCase()===n)return e[r[t]]}function Tt(e,t){let n=e||{};if(n[`*`]!==void 0){let e=X(n,t);return typeof e==`string`?e:String(n[`*`]??``)}function r(e){if(n[e]!==void 0&&n[e]!==``)return n[e];let t=e.toLowerCase(),r=e.toUpperCase();if(n[r]!==void 0&&n[r]!==``)return n[r];if(n[t]!==void 0&&n[t]!==``)return n[t];let i=Object.keys(n);for(let e=0;e<i.length;e++)if(i[e].toLowerCase()===t&&n[i[e]]!==``)return n[i[e]]}let i=r(t)||r(`en`)||r(`es`)||r(`default`)||``;if(!i){let e=Object.keys(n);e.length>0&&(i=n[e[0]]||``)}return i}function Et(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function Dt(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var Ot=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function kt(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(Ot.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function At(e,t){let n=e&&e.style||{},r=Tt(e&&e.content,t),i=Et(e,r);return{content:r,size:kt(X(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:Dt(e)?`none`:X(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function jt(e,t,n){let r=At(e,t),i=At(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var Mt={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`};function Nt(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function Pt(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(Mt,t)?t:void 0,blur:Nt(e.filterBlur,0,100)??0,brightness:Nt(e.filterBrightness,0,500)??100,contrast:Nt(e.filterContrast,0,500)??100,saturate:Nt(e.filterSaturate,0,500)??100,hue:Nt(e.filterHueRotate,0,360)??0}}function Ft(e){let t=Pt(e),n=[];return t.preset!==void 0&&n.push(Mt[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}function It(e){let t=e.shadowOpacity===void 0?1:Math.max(0,Math.min(100,e.shadowOpacity))/100,n=(e.shadowColor||`#000000`).replace(`#`,``),r=n.length===3?n.split(``).map(function(e){return e+e}).join(``):n,i=parseInt(r.substring(0,2),16)||0,a=parseInt(r.substring(2,4),16)||0,o=parseInt(r.substring(4,6),16)||0,s=`rgba(`+i+`, `+a+`, `+o+`, `+t+`)`;return e.shadowColorRole?t<1?`color-mix(in srgb, `+z(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:z(e.shadowColorRole,s):s}function Lt(e){let t=e??{},n=e=>typeof e==`number`?+(e*100).toFixed(6):void 0;return{filterPreset:t.preset,filterBlur:t.blur,filterBrightness:n(t.brightness),filterContrast:n(t.contrast),filterSaturate:n(t.saturate),filterHueRotate:t.hueRotate}}var Rt=`#f59e0b`;function zt(e,t){let n=[],r=[],i=[];for(let a of e??[])if(a.kind===`blur`)n.push(`blur(${a.radius}px)`);else if(a.kind===`glow`){let e=t.colorCss(a.color)||Rt,i=a.radius;t.isText?r.push(`0px 0px ${i*.4}px ${e}`,`0px 0px ${i}px ${e}`):n.push(`drop-shadow(0px 0px ${i*.4}px ${e}) drop-shadow(0px 0px ${i}px ${e})`)}else if(a.kind===`shadow`){let e=a.color&&typeof a.color==`object`?a.color:void 0,i=a.opacity===void 0?t.colorCss(a.color??`#000000`)||`#000000`:It({shadowColor:e?e.fallback:a.color,shadowOpacity:a.opacity*100,shadowColorRole:e?.var}),o=`${a.x||0}px ${a.y||0}px ${a.blur||0}px ${i}`;t.isText?r.push(o):n.push(`drop-shadow(${o})`)}else if(a.kind===`grain`){if(!t.grainable)continue;let e=`oim-grain-`+t.layerId.replace(/[^A-Za-z0-9_-]/g,`_`);i.push({kind:`grain`,id:e,effect:a}),n.push(`url(#${e})`)}else a.kind===`texture`&&i.push({kind:`texture`,effect:a});let a=e?.find(e=>e.kind===`backdrop`),o;return a?.preset===`duotone`?i.push({kind:`duotone`}):o=Ft(Lt(a)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:o,defs:i}}var Bt=new WeakMap;function Vt(e){let t=new Map,n=e=>{for(let r of e)t.set(r.id,r),n(r.children??[])};return n(e),t}function Ht(e){let t=Bt.get(e);if(t)return t;try{t=Vt(Ne(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e),t=new Map}return Bt.set(e,t),t}function Ut(e,t){Bt.set(e,Vt(t.layers))}function Wt(e){let t=e.anchor??`top-left`;return[/left/.test(t)?`0%`:/right/.test(t)?`-100%`:`-50%`,/^top/.test(t)?`0%`:/^bottom/.test(t)?`-100%`:`-50%`]}function Gt(e,t){let n=e.mask??{},r=e.fills?.[0],i=r&&`gradient`in r&&r.gradient?vt(r.gradient,t):void 0,a=e.geometry,o=a?.kind===`preset`?a.name:a?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[a?.kind??``],s=e=>typeof e==`string`?{role:void 0,literal:e}:e&&typeof e==`object`?{role:e.var,literal:e.fallback}:{role:void 0,literal:void 0},c=e.fills?.[0],l=s(c?.kind===`color`?c.value:void 0),u=e.strokes?.[0],d=s(u?.paint?.kind===`color`?u.paint.value:void 0);return{maskMode:n.mode===`cutout`?`cutout`:`window`,maskFeather:n.feather,maskCoverage:n.scope===`group`?`container`:`canvas`,maskShape:o,maskSvgPath:a?.kind===`paths`?a.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:l.literal,maskBgColorRole:l.role,fillType:i?`gradient`:void 0,fillGradient:i,fillColorRole:void 0,maskStrokeColor:d.literal,maskStrokeColorRole:d.role,strokeColorRole:void 0,maskStrokeWidth:u?.width,cuts:e.extensions?.studio?.maskCuts}}function Kt(e,t){if(typeof e==`string`)return e===`oim:base`?``:e;if(!(`value`in e)||typeof e.value!=`string`)return``;let n=X(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var qt=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0,Jt=0;function Yt(e,t,n=!1){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e.viewBox.join(` `)),i.setAttribute(`width`,n?String(e.viewBox[2]):`100%`),i.setAttribute(`height`,n?String(e.viewBox[3]):`100%`),n?i.setAttribute(`xmlns`,r):(i.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),i.style.setProperty(`display`,`block`));let a;if(t.strokeGradient){let{tag:n,attrs:o,stops:s}=wt(t.strokeGradient,e.viewBox),c=i.appendChild(document.createElementNS(r,`defs`)).appendChild(document.createElementNS(r,n));c.id=`oim-sg-${++Jt}`,c.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of Object.entries(o))c.setAttribute(e,String(t));for(let e of s){let t=c.appendChild(document.createElementNS(r,`stop`));t.setAttribute(`offset`,e.offset),t.setAttribute(`stop-color`,qt(e.color)??`#000`)}a=`url(#${c.id})`}for(let o of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,o.d);let s=qt(o.fill===`currentColor`?t.fill??`currentColor`:o.fill),c=a??qt(o.stroke===`currentColor`?t.stroke??`currentColor`:o.stroke);n?(e.setAttribute(`fill`,s??`none`),c&&e.setAttribute(`stroke`,c)):(e.setAttribute(`fill`,`none`),s&&e.style.setProperty(`fill`,s),c&&e.style.setProperty(`stroke`,c)),o.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(o.strokeWidth)),o.fillRule&&e.setAttribute(`fill-rule`,o.fillRule),o.cap&&e.setAttribute(`stroke-linecap`,o.cap),o.join&&e.setAttribute(`stroke-linejoin`,o.join),o.opacity!==void 0&&e.setAttribute(`opacity`,String(o.opacity)),o.transform&&e.setAttribute(`transform`,`matrix(${o.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function Xt(e){let t=e.fills?.[0]?.kind;return t===`gradient`||t===`pattern`||t===`generative`}function Zt(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=e.strokes?.[0]?.paint,a=n(i),o=i?.kind===`gradient`&&i.gradient?.type!==`conic`?i.gradient:void 0,s=o&&{...o,stops:o.stops.map(e=>({...e,color:t(e.color)??e.color}))};return{fill:r??a,stroke:a??r,...s&&{strokeGradient:s}}}function Qt(e){if(typeof e==`number`)return{px:`${e}px`};if(e&&typeof e==`object`&&`value`in e){let{value:t,modes:n}=e,r=Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,`${t}px`]));return{px:`${t}px`,byLang:Object.keys(r).length>0?r:void 0}}return{}}function $t(e,t){e.content=t.content;let n=Qt(t.font?.size),r=Qt(t.maxWidth);n.px&&(e.style.fontSize=n.px),n.byLang&&(e.style.fontSizes=n.byLang),r.px&&(e.style.maxWidth=r.px),r.byLang&&(e.style.maxWidths=r.byLang)}function en(e){let t=[],n=(e,r)=>{for(let i of e){let e=i.type===`shape`&&!!i.effects?.some(e=>e.kind===`backdrop`),a=i.mask?`mask`:i.text?.artistic?`artistic-text`:e?`filter`:i.type,o={id:i.id,type:a,style:r?{groupId:r}:{}};i.text&&$t(o,i.text),t.push(o),n(i.children??[],i.id)}};n(e.layers);let r={canvas_width:e.canvas.width,canvas_height:e.canvas.height,languages:e.languages,slots:t};e.canvas.fills?.length&&(r.canvasFills=e.canvas.fills),e.fonts&&(r.fonts=e.fonts);let i=Fe(e.variables);return i&&(r.palettes=i),e.variables?.defaults?.palette&&(r.defaultPalette=e.variables.defaults.palette),Ut(r,e),r}var tn="/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst e=10485760;async function t(t,r=e){let i=t.replace(/\\s+/g,``);try{let e=atob(i);if(e.trim().startsWith(`{`)){if(e.length>r)throw Error(`Metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);try{return JSON.parse(await n(o,`deflate`,r))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await n(o,`deflate-raw`,r))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function n(t,n,r=e){let i=new DecompressionStream(n),a=i.writable.getWriter();a.write(t).catch(function(){}),a.close().catch(function(){});let o=i.readable.getReader(),s=[],c=0;try{for(;;){let{done:e,value:t}=await o.read();if(e)break;if(t){if(c+=t.byteLength,c>r)throw await o.cancel(),Error(`Decompressed metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);s.push(t)}}}finally{o.releaseLock()}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.byteLength;return new TextDecoder().decode(l)}async function r(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function i(e){let i=await e.arrayBuffer(),a=new DataView(i),o=8,s=null,c=null,l=[new Uint8Array(i,0,8)];for(;o<i.byteLength;){let e=a.getUint32(o,!1),t=o+4,r=String.fromCharCode(a.getUint8(t),a.getUint8(t+1),a.getUint8(t+2),a.getUint8(t+3)),u=8+e+4;if(r===`tEXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r.slice(a+1),t=null;try{t=await n(e,`deflate`)}catch{try{t=await n(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{c=JSON.parse(t)}catch{}else s=new TextDecoder(`latin1`).decode(e);o+=u;continue}}}else if(r===`zTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r.slice(a+2);if(e===0)try{s=await n(t,`deflate`)}catch(e){try{s=await n(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(s){o+=u;continue}}}}else if(r===`iTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r[a+2],i=r.slice(a+3),c=i.indexOf(0);if(c!==-1){let r=i.slice(c+1),a=r.indexOf(0);if(a!==-1){let i=r.slice(a+1);if(e===1){if(t===0)try{s=await n(i,`deflate`)}catch(e){try{s=await n(i,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else s=new TextDecoder().decode(i);if(s){o+=u;continue}}}}}}l.push(new Uint8Array(i,o,u)),o+=u}let u=new Blob(l,{type:`image/png`}),d=null;return c?d=c:s&&(d=s.trimStart().startsWith(`{`)?JSON.parse(s):await t(s)),{image:u,metadata:d,imageHash:await r(i)}}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction a(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst o=/* @__PURE__ */ new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),s=/* @__PURE__ */ new Set([`public`,`author_only`,`sealed`]);function c(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?o.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&s.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction l(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst u=`author_only`,d=[`public`,`author_only`,`sealed`];function f(e){if(!e||typeof e!=`object`)return u;let t=c(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&d.includes(n)?n:u}function p(e){return e===`public`?`verified_authorless`:`verified`}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction m(e){let t=l(e)?.oim;return typeof t==`string`&&/^2\\./.test(t)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst h=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}];function g(e){for(let t=0;t<h.length;t++)if(h[t].kid===e)return h[t];return null}let _=null;function v(e){_=typeof e==`string`&&e?e:null}function y(){if(_)return _;let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||`https://api.oim.media/v1/media/keys`}function b(e,t){let n=g(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function x(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}function S(e,t,n=Date.now()){let r=g(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!g(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+6048e5}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst C=2**53-1;function w(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>C:typeof e==`object`&&e?Object.values(e).some(w):!1}const T=/* @__PURE__ */ new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function E(e){if(Array.isArray(e))return e.map(E);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=E(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function D(e){if(Array.isArray(e))return e.map(D);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=D(e[r]);return t}return e}function O(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))T.has(n)||(t[n]=e[n]);let n=D(E(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst k={};let A=null,j=!1,M=null;function N(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function P(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function F(e){let t=g(e);return t?t.jwk:(k[e]||!j&&(M||=N().then(e=>{e.forEach(e=>{k[e.kid]=e}),j=!0}),await M,k[e])||await I(),k[e])}function I(){return A||=(async function(){try{let e=y(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];k[t.kid]=t}await P(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),A}async function L(e){return await I(),k[e]||null}async function R(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await F(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(w(e))return!1;let n=O(e),r=atob(e.signature),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,i,t)},o=await a(t,n);if(!o&&e.creator_user_id){let n={},r=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function i(e){if(Array.isArray(e))return e.map(i);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort();for(let r=0;r<n.length;r++)t[n[r]]=i(e[n[r]]);return t}return e}for(let t=0;t<r.length;t++)n[r[t]]=i(e[r[t]]);o=await a(t,new TextEncoder().encode(JSON.stringify(n)))}if(!o)try{let r=await L(e.key_version);r&&(r.x!==t.x||r.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),o=await a(r,n))}catch{}if(o){let n=b(e.key_version,t);if(!x({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return o||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),o}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function z(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:p(f(e.metadata)):`image_unsealed`}async function B(e,t=Date.now()){let n=e&&e.key_version;return n?g(n)?S(n,null,t):S(n,await L(n),t):!1}function V(e){return e===`image_mismatch`||e===`invalid_signature`}function H(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;v(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=H(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await R(e.metadata,r),l=z({isSigned:s,isSigValid:c,keyExpired:s&&c?await B(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(V(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:m(e.metadata)||a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",nn=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,tn],{type:`text/javascript;charset=utf-8`});function rn(e){let t;try{if(t=nn&&(self.URL||self.webkitURL).createObjectURL(nn),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(tn),{type:`module`,name:e?.name})}}var an=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}],on=`https://api.oim.media/v1/media/keys`;function sn(e){for(let t=0;t<an.length;t++)if(an[t].kid===e)return an[t];return null}function cn(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||on}function ln(e,t){let n=sn(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function un(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}var dn=6048e5;function fn(e,t,n=Date.now()){let r=sn(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!sn(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+dn}var pn=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function mn(e){let t=null,n=null,r=1,i=new Map;function a(e){let t=[...i.values()];i.clear(),t.forEach(t=>t.reject(e))}function o(){if(t)return t;let n=e();return n.onmessage=e=>{let t=e.data,n=t&&typeof t.id==`number`?i.get(t.id):void 0;n&&(i.delete(t.id),n.resolve(t))},n.onerror=e=>{try{n.terminate()}catch{}t===n&&(t=null),a(e)},t=n,n}return{verify(e,t,a){if(n)return Promise.reject(new pn(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new pn(e))}let c=r++;return new Promise((n,r)=>{i.set(c,{resolve:n,reject:r}),s.postMessage({id:c,blob:e,hostname:t,origin:a,keysUrl:cn()})})},stats(){return{alive:t!==null,pending:i.size}}}}var hn=null;function gn(e,t,n){return hn||=mn(()=>new rn),hn.verify(e,t,n)}var _n=10485760;async function vn(e,t=_n){let n=e.replace(/\s+/g,``);try{let e=atob(n);if(e.trim().startsWith(`{`)){if(e.length>t)throw Error(`Metadata exceeds the limit of ${t/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);try{return JSON.parse(await Z(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await Z(i,`deflate-raw`,t))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function Z(e,t,n=_n){let r=new DecompressionStream(t),i=r.writable.getWriter();i.write(e).catch(function(){}),i.close().catch(function(){});let a=r.readable.getReader(),o=[],s=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(t){if(s+=t.byteLength,s>n)throw await a.cancel(),Error(`Decompressed metadata exceeds the limit of ${n/1048576}MB (zip bomb detected)`);o.push(t)}}}finally{a.releaseLock()}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return new TextDecoder().decode(c)}async function yn(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function bn(e){let t=await e.arrayBuffer(),n=new DataView(t),r=8,i=null,a=null,o=[new Uint8Array(t,0,8)];for(;r<t.byteLength;){let e=n.getUint32(r,!1),s=r+4,c=String.fromCharCode(n.getUint8(s),n.getUint8(s+1),n.getUint8(s+2),n.getUint8(s+3)),l=8+e+4;if(c===`tEXt`){let n=new Uint8Array(t,s+4,e),o=n.indexOf(0);if(o!==-1){let e=new TextDecoder().decode(n.slice(0,o));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n.slice(o+1),t=null;try{t=await Z(e,`deflate`)}catch{try{t=await Z(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{a=JSON.parse(t)}catch{}else i=new TextDecoder(`latin1`).decode(e);r+=l;continue}}}else if(c===`zTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n.slice(a+2);if(e===0)try{i=await Z(t,`deflate`)}catch(e){try{i=await Z(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(i){r+=l;continue}}}}else if(c===`iTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n[a+2],o=n.slice(a+3),s=o.indexOf(0);if(s!==-1){let n=o.slice(s+1),a=n.indexOf(0);if(a!==-1){let o=n.slice(a+1);if(e===1){if(t===0)try{i=await Z(o,`deflate`)}catch(e){try{i=await Z(o,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else i=new TextDecoder().decode(o);if(i){r+=l;continue}}}}}}o.push(new Uint8Array(t,r,l)),r+=l}let s=new Blob(o,{type:`image/png`}),c=null;return a?c=a:i&&(c=i.trimStart().startsWith(`{`)?JSON.parse(i):await vn(i)),{image:s,metadata:c,imageHash:await yn(t)}}var xn=2**53-1;function Sn(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>xn:typeof e==`object`&&e?Object.values(e).some(Sn):!1}var Cn=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function wn(e){if(Array.isArray(e))return e.map(wn);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=wn(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function Tn(e){if(Array.isArray(e))return e.map(Tn);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=Tn(e[r]);return t}return e}function En(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Cn.has(n)||(t[n]=e[n]);let n=Tn(wn(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}function Dn(e,t){let n=e||``,r=``;for(let e=0;e<n.length;e++)n.charCodeAt(e)>=32&&(r+=n.charAt(e));return r=r.trim(),r.charAt(0)===`#`?!0:t?!1:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r)||/^https?:/i.test(r)||/^data:image\//i.test(r)}function On(e){if(typeof DOMParser>`u`)return e;try{let t=new DOMParser().parseFromString(e,`text/html`),n=`svg.g.defs.symbol.use.title.desc.path.circle.rect.polygon.polyline.ellipse.line.lineargradient.radialgradient.stop.pattern.image.clippath.mask.filter.fegaussianblur.fecolormatrix.fecomponenttransfer.fefunca.fefuncr.fefuncg.fefuncb.feblend.feoffset.femerge.femergenode.feflood.fecomposite.text.tspan.span.div.br.p.a.b.i.strong.em.img`.split(`.`),r=`class.style.id.lang.aria-hidden.part.transform.d.cx.cy.r.rx.ry.x.y.dx.dy.x1.y1.x2.y2.fx.fy.width.height.points.viewbox.preserveaspectratio.vector-effect.fill.stroke.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.offset.stop-color.stop-opacity.gradientunits.gradienttransform.spreadmethod.patternunits.patterncontentunits.patterntransform.clip-path.clippathunits.mask.maskunits.maskcontentunits.filter.filterunits.primitiveunits.stddeviation.result.in.in2.mode.type.values.tablevalues.flood-color.flood-opacity.operator.font-family.font-size.font-weight.font-style.text-anchor.dominant-baseline.letter-spacing.word-spacing.href.src.target.rel.alt.data-slot-id.allow-lottie.show-controls.crossorigin`.split(`.`),i=t.body.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let t=i[e],a=t.tagName.toLowerCase();if(n.indexOf(a)===-1){t.parentNode?.removeChild(t);continue}let o=t.attributes;for(let e=o.length-1;e>=0;e--){let n=o[e],i=n.name.toLowerCase();if(i.indexOf(`on`)===0||r.indexOf(i)===-1)t.removeAttribute(n.name);else{if(i===`href`&&!Dn(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=An(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&jn(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(Mn(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function kn(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function An(e){return typeof e==`string`?e.indexOf(`\\`)!==-1||/@import|image-set\s*\(/i.test(e)?``:e.indexOf(`(`)===-1?e:e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,function(e,t,n){let r=String(n).trim().toLowerCase();return r.indexOf(`#`)===0||r.indexOf(`data:`)===0?e:`none`}):e}function jn(e){let t=typeof e==`string`?e:``;if(t.indexOf(`\\`)!==-1||/image-set\s*\(|@import/i.test(t))return!0;let n=/url\(\s*['"]?\s*([^'")\s]*)/gi,r;for(;(r=n.exec(t))!==null;){let e=r[1].trim().toLowerCase();if(e.indexOf(`#`)!==0&&e.indexOf(`data:`)!==0)return!0}return!1}function Mn(e){let t=(e||``).trim();if(t.indexOf(`data:image/`)!==0)return!1;let n=t.indexOf(`,`);if(n===-1)return!1;let r=t.substring(0,n).toLowerCase();if(r.indexOf(`;base64`)===-1)return!1;let i=r.substring(5,r.indexOf(`;`));return[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`,`image/gif`].indexOf(i)!==-1}function Nn(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var Pn={},Fn=null,In=!1,Ln=null;function Rn(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function zn(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function Bn(e){let t=sn(e);return t?t.jwk:(Pn[e]||!In&&(Ln||=Rn().then(e=>{e.forEach(e=>{Pn[e.kid]=e}),In=!0}),await Ln,Pn[e])||await Vn(),Pn[e])}function Vn(){return Fn||=(async function(){try{let e=cn(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];Pn[t.kid]=t}await zn(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),Fn}async function Hn(e){return await Vn(),Pn[e]||null}async function Un(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await Bn(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(Sn(e))return!1;let r=En(e),i=atob(e.signature),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);let o=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,a,t)},s=await o(t,r);if(!s&&e.creator_user_id){let r={},i=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function n(e){if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={},r=Object.keys(e).sort();for(let i=0;i<r.length;i++)t[r[i]]=n(e[r[i]]);return t}return e}for(let t=0;t<i.length;t++)r[i[t]]=n(e[i[t]]);s=await o(t,new TextEncoder().encode(JSON.stringify(r)))}if(!s)try{let n=await Hn(e.key_version);n&&(n.x!==t.x||n.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),s=await o(n,r))}catch{}if(s){let n=ln(e.key_version,t);if(!un({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return s||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),s}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function Wn(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:V(B(e.metadata)):`image_unsealed`}async function Gn(e,t=Date.now()){let n=e&&e.key_version;return n?sn(n)?fn(n,null,t):fn(n,await Hn(n),t):!1}function Kn(e){return e===`image_mismatch`||e===`invalid_signature`}var qn=`OIM_ALTERED`;function Jn(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}async function Yn(e,t){if(!e||e.v!==1||e.alg!==`sha256-idat`||typeof e.image_hash!=`string`||typeof e.signature!=`string`||typeof e.key_version!=`string`||!t||e.image_hash.toLowerCase()!==t.toLowerCase())return`invalid`;let n=new TextEncoder().encode(JSON.stringify({alg:e.alg,image_hash:e.image_hash,key_version:e.key_version,v:e.v}));try{let t=atob(e.signature),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let i=async e=>{let t=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!1,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},t,r,n)},a=await Bn(e.key_version),o=!!a&&await i(a);if(!o){let t=await Hn(e.key_version).catch(()=>null);t&&(!a||t.x!==a.x||t.y!==a.y)&&(o=await i(t))}if(!o)return`invalid`}catch{return`invalid`}return await Gn({key_version:e.key_version})?`expired_key`:`ok`}var Xn=Math.log(1.05)/100,Zn=.01,Qn=16,$n=800;function er(e,t,n,r){let i=n===1?t*Qn:n===2?t*$n:t,a=e*Math.exp(-i*(r?Zn:Xn));return Math.max(1,Math.min(4,a))}var tr=`1.32.4`,nr=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function rr(e){if(typeof e!=`string`)return null;let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function ir(e,t){let n=rr(e),r=rr(t);if(!n||!r)return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}function ar(e,t){let n=e&&typeof e.min_player==`string`?e.min_player:null,r=(Array.isArray(e?.capabilities)?e.capabilities:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),i=(Array.isArray(e?.capabilities_required)?e.capabilities_required:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),a=ir(n,t.version),o=a||i.length>0,s=a||r.length>0||i.length>0;return{requiredVersion:n,versionTooOld:a,missingCapabilities:r,missingRequiredCapabilities:i,cannotRender:o,hasNotice:s,hayAlgoQueDecir:s}}function or(e){let t=[];return e.versionTooOld&&t.push(`the file requires format version ${e.requiredVersion}`),e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0&&t.push(`requires ${e.missingRequiredCapabilities.join(`, `)}`),e.missingCapabilities&&e.missingCapabilities.length>0&&t.push(`uses ${e.missingCapabilities.join(`, `)}`),t.length===0?``:`${e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0?`It cannot be fully rendered`:`Rendered what was possible`}: ${t.join(` and `)}.`}var sr=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,cr=546136,lr={woff:`wOFF`,woff2:`wOF2`};function ur(e,t){try{return atob(e.slice(0,8)).startsWith(lr[t])}catch{return!1}}function dr(e){let t=e&&Array.isArray(e.fonts)?e.fonts:[],n=[];for(let e of t)e&&typeof e==`object`&&(e.format!==`woff`&&e.format!==`woff2`||typeof e.family!=`string`||typeof e.data!=`string`||typeof e.name!=`string`||!sr.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>cr||!ur(e.data,e.format)||n.push({family:e.family,name:e.name,weight:e.weight,style:e.style,format:e.format,data:e.data}));return n}async function fr(e,t=document.fonts,n=(e,t,n)=>new FontFace(e,t,n)){let r=new Map;return await Promise.all(e.map(async e=>{try{let i=n(e.name,`url(data:font/${e.format};base64,${e.data})`,{weight:String(e.weight),style:e.style});await i.load(),t.add(i),r.set(e.family,e.name)}catch{}})),r}function pr(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var mr=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function hr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`{`||r===`}`){if(e[n+1]===r){t.push({kind:`text`,s:r}),n+=2;continue}if(r===`{`){let r=mr.exec(e.slice(n));if(r){t.push({kind:r[1]?`close`:`open`,name:r[2],raw:r[0],at:n}),n+=r[0].length;continue}}t.push({kind:`stray`,raw:r,at:n}),n+=1;continue}let i=n;for(;i<e.length&&e[i]!==`{`&&e[i]!==`}`;)i++;t.push({kind:`text`,s:e.slice(n,i)}),n=i}return t}function gr(e,t){let n=[],r=[],i,a=null,o=(e,t)=>{i||={reason:e,at:t}},s=e=>{if(!e)return;let t=n[n.length-1];t&&t.mark===(a??void 0)?t.text+=e:n.push(a?{text:e,mark:a}:{text:e})};for(let n of hr(e))n.kind===`text`?s(n.s):n.kind===`stray`?(o(`stray brace`,n.at),s(n.raw)):t.includes(n.name)?n.kind===`open`?a?(o(`"${n.name}" inside "${a}"`,n.at),s(n.raw)):(a=n.name,r.push(n.name)):a===n.name?a=null:(o(`"${n.name}" closed without being open`,n.at),s(n.raw)):(o(`unknown mark "${n.name}"`,n.at),s(n.raw));return a&&o(`"${a}" is not closed`,e.length),{runs:n,sequence:r,error:i}}function _r(e,t){return gr(e,t).runs}function vr(e){return e.replace(/[{}]/g,e=>e+e)}function yr(e,t){return _r(e,t).map(e=>e.text).join(``)}function br(e,t){let n=``,r=[];for(let i of _r(e,t))i.mark&&r.push({from:n.length,to:n.length+i.text.length,mark:i.mark}),n+=i.text;return{plain:n,ranges:r}}function xr(e,t){let n=``,r=0;for(let i of[...t].sort((e,t)=>e.from-t.from)){let t=Math.max(i.from,r),a=Math.min(i.to,e.length);a<=t||(n+=vr(e.slice(r,t))+`{${i.mark}}`+vr(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+vr(e.slice(r))}function Sr(e){let t={underline:e.underline===!0},n=z(e.colorRole,e.color);if(n&&(t.color=n),e.bold&&(t.fontWeight=700),e.italic&&(t.fontStyle=`italic`),e.highlight){let n=e.highlight;t.highlight={style:n.style??`marker`,color:z(n.colorRole,n.color)||`rgba(245, 158, 11, 0.35)`,paddingX:n.paddingX??4,paddingY:n.paddingY??2,borderRadius:n.borderRadius??3}}return t}function Cr(e,t){return yr(e,Object.keys(t??{}))}function wr(e,t,n){e.textContent=``;for(let r of _r(t,Object.keys(n??{}))){let t=r.mark?n?.[r.mark]:void 0;if(!r.mark||!t){e.appendChild(document.createTextNode(r.text));continue}let i=document.createElement(`span`);i.dataset.mark=r.mark,i.textContent=r.text;let a=Sr(t),o=i.style;a.color&&(o.color=a.color),a.fontWeight&&(o.fontWeight=String(a.fontWeight)),a.fontStyle&&(o.fontStyle=a.fontStyle),a.underline&&(o.textDecoration=`underline`);let s=a.highlight;s&&(s.style===`underline-thick`?o.boxShadow=`inset 0 -.4em 0 ${s.color}`:o.backgroundColor=s.color,o.borderRadius=s.style===`pill`?`9999px`:s.style===`box`?`0`:`${s.borderRadius}px`,o.padding=`${s.paddingY}px ${s.paddingX}px`,o.boxDecorationBreak=`clone`,o.webkitBoxDecorationBreak=`clone`),e.appendChild(i)}}function Tr(e){let t={scale:e.lines===3?3.2:2.2,lineHeight:.85,marginRight:e.marginRight??8,fontWeight:700};return e.color&&(t.color=e.color),e.fontFamily&&(t.fontFamily=e.fontFamily),t}function Er(e,t){let{plain:n,ranges:r}=br(e,t);if(!n)return{letter:``,rest:``};let i=r.map(e=>({...e,from:Math.max(0,e.from-1),to:e.to-1}));return{letter:n[0],rest:xr(n.slice(1),i)}}var Dr=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function Or(e){if(e.svg&&/<svg[\s>]/i.test(e.svg))return{image:`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}")`,size:`100% 100%`};if(e.type===`image`&&e.image&&Dr.test(e.image)){let t=e.fit===`contain`?`contain`:e.fit===`fill`?`100% 100%`:`cover`;return{image:`url("${e.image}")`,size:t}}return null}var kr=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Ar=.35,jr=.05,Mr=[`slide-up`,`reveal-mask`,`rise-words`];function Nr(e){return typeof e==`string`&&kr.includes(e)}function Pr(e){return e===`reveal-mask`}function Fr(e,t){return Mr.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function Ir(e,t=jr,n=0){return n+e*t}function Lr(e,t){let n=Math.max(0,Math.min(1,t)),r=n*(2-n);if(e===`slide-up`)return{opacity:r,translateYEm:(1-r)*.6,scale:1,rotateDeg:0};if(e===`reveal-mask`)return{opacity:1,translateYEm:(1-r)*1.2,scale:1,rotateDeg:0};if(e===`scale-in`)return{opacity:r,translateYEm:0,scale:.6+.4*r,rotateDeg:0};if(e===`rise-words`)return{opacity:r,translateYEm:(1-r)*.8,scale:1,rotateDeg:(1-r)*8};if(e===`bounce-chars`){let e=r===0?0:r<.7?r/.7*1.15:1.15-(r-.7)/.3*.15;return{opacity:r,translateYEm:0,scale:Math.round(e*1e6)/1e6,rotateDeg:0}}return{opacity:r,translateYEm:0,scale:1,rotateDeg:0}}function Rr(e,t=10){return Array.from({length:t+1},(n,r)=>Lr(e,r/t))}function zr(){return Promise.resolve().then(()=>(K(),Te)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function Br(e){let t=[];return e.generative&&t.push(Le()),e.patterns&&t.push(ze()),Promise.all(t).then(()=>void 0)}var Vr=/^(fill|background)Pattern/;function Hr(e){let t={generative:!1,patterns:!1},n=new Set,r=e=>{if(!e||typeof e!=`object`||n.has(e)||t.generative&&t.patterns)return;if(n.add(e),Array.isArray(e)){e.forEach(r);return}let i=e;(i.kind===`generative`||i.fillType===`generative`||i.fillGenerative)&&(t.generative=!0),(i.kind===`pattern`||i.fillType===`pattern`||`drawing`in i)&&(t.patterns=!0);for(let e in i)Vr.test(e)&&i[e]!=null&&(t.patterns=!0),r(i[e])};return r(e),t}var Ur={silhouette:null,fillable:!0,round:!1};function Wr(e){if(!e||e.kind===`rect`)return Ur;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=Ge(t);return n?{silhouette:ot({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:Ur}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=ot({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:Ur}return Ur}var Gr=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,Kr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function qr(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,ee=(-_-C)/u,k=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},A=k(1,0,E,D),j=k(E,D,O,ee);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),te=j/M,N=4/3*Math.tan(te/4),P=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],ne=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],F=[];for(let e=0;e<M;e++){let t=A+e*te,n=t+te,r=P(t),i=P(n),a=ne(t),o=ne(n);F.push([r[0]+N*a[0],r[1]+N*a[1],i[0]-N*o[0],i[1]-N*o[1],i[0],i[1]])}return F}function Jr(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),Gr.lastIndex=n;let t=Gr.exec(e);return t?(n=Gr.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<Kr[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=qr(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function Yr(e,t){let n=Jr(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var Xr=[0,0,100,100],Zr=[5,5,90,90],Qr={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function $r(e,t){return e===`line`?Qr:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function ei(e){if(e===void 0)return Xr;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function ti(e,[t,n,r,i],a){return Yr(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function ni(e,t){let n=e.geoShape,r=Ge(n);if(n&&r){let e=$r(n,r);return ti(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?Xr:Zr,t)}if(e.svgPath){let n=ei(e.svgViewBox);return n?ti(e.svgPath,n,t):null}return null}var ri=new Set([`line`,`scribble`]),ii=.5523;function ai(e,t,n){return Math.max(0,Math.min(Number.isFinite(e)?e:0,t/2,n/2))}function oi(e,[t,n,r,i]){let{x:a,y:o,width:s,height:c}=e,l=ii;return[`M${a+t} ${o}`,`L${a+s-n} ${o}`,`C${a+s-n+l*n} ${o} ${a+s} ${o+n-l*n} ${a+s} ${o+n}`,`L${a+s} ${o+c-r}`,`C${a+s} ${o+c-r+l*r} ${a+s-r+l*r} ${o+c} ${a+s-r} ${o+c}`,`L${a+i} ${o+c}`,`C${a+i-l*i} ${o+c} ${a} ${o+c-i+l*i} ${a} ${o+c-i}`,`L${a} ${o+t}`,`C${a} ${o+t-l*t} ${a+t-l*t} ${o} ${a+t} ${o}`,`Z`].join(` `)}function si(e,t){let n=e.geoShape;return!n||n===`rect`||n===`rectangle`?oi(t,[e.borderRadiusTopLeft??0,e.borderRadiusTopRight??0,e.borderRadiusBottomRight??0,e.borderRadiusBottomLeft??0].map(e=>ai(e,t.width,t.height))):ri.has(n)?null:ni({geoShape:n},t)}var ci={x:0,y:0,width:100,height:100};function li(e){return`mask-clip-${e.id}`}function ui(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0];return{x:typeof n.x==`number`?n.x:Number(r[0])/100*t.width,y:typeof n.y==`number`?n.y:Number(r[1])/100*t.height,width:typeof n.width==`number`?n.width:Number(n.width_px)||0,height:typeof n.height==`number`?n.height:Number(n.height_px)||0}}function di(e){return`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`}function fi(e,t){return e===`rect`||e===`rectangle`?di(t):ni({geoShape:e},t)}function pi(e,t){let n=e.style||{},r=n.maskShape||n.geoShape,i=n.maskSvgPath||n.svgPath;return i&&(!r||r===`custom`)?ni({svgPath:i},t):fi(r||`circle`,t)}function mi(e,t){return{x:t.x+(e.x||0),y:t.y+(e.y||0),width:e.width||0,height:e.height||0}}function hi(e,t){let n=mi(e,t);return e.svgPath?ni({svgPath:e.svgPath},n):fi(e.shape||`circle`,n)}function gi(e){let t=e,n=t.cuts||t.style&&t.style.cuts;return Array.isArray(n)?n:[]}function _i(e,t){let n=gi(e);return n.length>0?n.map(e=>hi(e,t)??di(mi(e,t))).join(` `):pi(e,t)??di(t)}function vi(e){let t=gi(e);return t.length>0?t.every(e=>hi(e,ci)!==null):pi(e,ci)!==null}function yi(e,t){let{width:n,height:r}=t,i=e,a=ui(e,t);return`${((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?di(a):`M0 0H${n}V${r}H0Z`} ${_i(e,a)}`}function bi(e,t){let n=ui(e,t);return pi(e,n)??di(n)}function xi(e,t){if(!e||e===`rectangle`||e===`rect`)return{};let n=si({geoShape:e},{x:0,y:0,width:t.width,height:t.height});return n===null?{}:{clipPath:`path("${n}")`}}var Si={shadows:`#1e1b4b`,lights:`#fbbf24`};function Ci(e){return`duotone-filter-${e.id}`}function wi(e){return`mask-feather-${e.id}`}function Ti(e,t){let{width:n,height:r}=t,i=ui(e,t);return`${`M0 0H${n}V${r}H0Z`} ${di(i)} ${_i(e,i)}`}function Ei(e){let t=[];for(let n of e)if(n.type===`mask`){let e=n.style||{};if(e.maskMode!==`cutout`){t=[...t,{kind:`shape`,shape:n}];continue}let r=e.maskFeather&&e.maskFeather>0?{maskStyle:`url(#${wi(n)})`}:{clipPath:`url(#${li(n)})`};t=t.map(e=>e.clipPath||e.maskStyle?{kind:`filterGroup`,shape:n,children:[e],...r}:{...e,...r})}else t=[...t,{kind:`shape`,shape:n}];return t}var Di=6,Oi=5,ki=8,Ai=2*Math.PI/Di,ji=`oim-wave-chars`;function Mi(){let e=[];for(let t=0;t<=ki;t++){let n=t/ki,r=parseFloat((n*100).toFixed(4)),i=Math.sin(n*2*Math.PI)*Oi,a=parseFloat(i.toFixed(4));e.push(` ${r}% { transform: translateY(${a}px); }`)}return`@keyframes ${ji} {\n${e.join(`
52
52
  `)}\n}`}function Ni(e,t,n){return n-(Ai-(e*t%Ai+Ai)%Ai)%Ai}var Pi=.7,Fi={isActive:!1,cyanOffset:{x:0,y:0},magentaOffset:{x:0,y:0},jitterSkew:0,slices:[]};function Ii(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}function Li(e,t=1,n=0,r=50){if(e<=0||e<n)return Fi;let i=Math.max(.01,t),a=e-n,o=a*i%1;if(o<.7)return Fi;let s=Math.floor(a*i)*100+Math.floor((o-Pi)/.30000000000000004*6)*10,c=.08*Math.max(1,Math.min(100,r)),l=e=>Math.round(e*100)/100,u=Ii(s+5),d=s+10,f=l(Ii(d)*80),p=e=>({x:l((Ii(e)*2-1)*c),y:l((Ii(e+1)*2-1)*c*.4)});return{isActive:!0,cyanOffset:p(s+1),magentaOffset:p(s+3),jitterSkew:u>.6?l((u*2-1)*.03*r):0,slices:[{topPercent:f,bottomPercent:Math.min(100,l(f+5+Ii(d+1)*20)),shiftX:l((Ii(d+2)*2-1)*1.5*c)}]}}function Ri(e,t){if(e===`glitch-slice`){let e=t.slices[0];return{skewX:0,copies:[{dx:t.isActive&&e?e.shiftX:0,dy:0,opacity:t.isActive&&e?1:0,clip:{top:e?e.topPercent:0,bottom:e?e.bottomPercent:0}}]}}return{skewX:t.jitterSkew,copies:[{color:`#00ffff`,dx:t.cyanOffset.x,dy:t.cyanOffset.y,opacity:t.isActive?.85:0},{color:`#ff00ff`,dx:t.magentaOffset.x,dy:t.magentaOffset.y,opacity:t.isActive?.85:0}]}}var zi={effect:`fade`,durationIn:300,durationOut:250,easing:`ease`};function Bi(e,t){return e===void 0?t:Array.isArray(e)?`cubic-bezier(${e.join(`,`)})`:e}var Vi={"slide-up":`0 4cqw`,"slide-down":`0 -4cqw`,"slide-left":`4cqw 0`,"slide-right":`-4cqw 0`};function Hi(e,t){let n={opacity:0},r={opacity:1},i=Vi[e];return i?(n.translate=i,r.translate=`0 0`):e===`scale`&&(n.scale=`0.92`,r.scale=`1`),t?[n,r]:[r,n]}function Ui(e,t){return e?{duration:e.duration,easing:Bi(e.easing,`ease-out`),effect:e.effect}:{duration:t?zi.durationIn:zi.durationOut,easing:zi.easing,effect:zi.effect}}function Wi(e,t,n=20,r=0,i=!0,a=!1){if(a)return{visibleText:e,showCursor:!1,isComplete:!0};let o=t-r,s=o>0?Math.min(e.length,Math.floor(o*Math.max(.1,n))):0;return{visibleText:e.slice(0,s),showCursor:i&&(t%.8+.8)%.8<.4,isComplete:s>=e.length}}function Gi(e,t,n){let r=t.backgroundPatternColorRole||t.fillPatternColorRole,i=t.backgroundPatternBgColorRole||t.fillPatternBgColorRole,a=Ue(t,null);if(e.style.backgroundColor=i?z(i,a.bgColor):a.bgColor,r){let i=Ve(t,n,`transparent`,`#000000`,`transparent`);if(i){e.classList.add(`oim-pat-dyn`),e.style.setProperty(`--oim-pat-fg`,z(r,a.fgColor)),e.style.setProperty(`--oim-pat-mask`,`url("`+i+`")`),e.style.backgroundImage=He(t)?`url("`+Ve(t,n,`transparent`,`transparent`)+`")`:`none`;return}}e.classList.remove(`oim-pat-dyn`);let o=i?`transparent`:a.bgColor,s=a.fgColor+`|`+o;if(e.dataset.oimPat===s)return;let c=Ve(t,n,o,a.fgColor);c&&(e.style.backgroundImage=`url("`+c+`")`),e.dataset.oimPat=s}var Ki=`oim-trim-draw`,qi=`@keyframes oim-trim-draw {
53
53
  from { stroke-dashoffset: var(--oim-trim-from); }
54
54
  to { stroke-dashoffset: var(--oim-trim-to); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oim-media/player-oim",
3
- "version": "1.32.3",
3
+ "version": "1.32.4",
4
4
  "description": "Web player for OIM interactive images: a framework-free <oim-player> element that verifies the signature and composes each layer.",
5
5
  "keywords": [
6
6
  "oim",
@@ -16,7 +16,7 @@
16
16
  "main": "./dist/esm/index.js",
17
17
  "types": "./src/index.d.ts",
18
18
  "dependencies": {
19
- "@oim-media/core": "1.32.3",
19
+ "@oim-media/core": "1.32.4",
20
20
  "lottie-web": "^5.12.2"
21
21
  },
22
22
  "devDependencies": {