@oim-media/player-oim 1.30.2 → 1.31.0
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 +102 -68
- package/dist/oim-player.js +11 -11
- package/package.json +2 -2
- /package/dist/vendor/{oim-generative-788e5348ee7b.js → oim-generative-24aba9f1061a.js} +0 -0
- /package/dist/vendor/{oim-patterns-788e5348ee7b.js → oim-patterns-24aba9f1061a.js} +0 -0
- /package/dist/vendor/{oim-upgrade-788e5348ee7b.js → oim-upgrade-24aba9f1061a.js} +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mediaFilterCss } from "@oim-media/core";
|
|
1
2
|
// ../scene/src/legacy/modes.ts
|
|
2
3
|
/**
|
|
3
4
|
* @license
|
|
@@ -2000,7 +2001,7 @@ function normalize(style) {
|
|
|
2000
2001
|
};
|
|
2001
2002
|
}
|
|
2002
2003
|
/** Fixed order: preset, blur, brightness, contrast, saturation, hue-rotate. `undefined` if everything is neutral. */
|
|
2003
|
-
function mediaFilterCss(style) {
|
|
2004
|
+
function mediaFilterCss$1(style) {
|
|
2004
2005
|
const a = normalize(style);
|
|
2005
2006
|
const parts = [];
|
|
2006
2007
|
if (a.preset !== void 0) parts.push(FILTER_PRESET_CSS[a.preset]);
|
|
@@ -3381,6 +3382,90 @@ function compareLangs(slot, before, after) {
|
|
|
3381
3382
|
if (a.size !== b.size || a.maxWidthValue !== b.maxWidthValue) return "style-only";
|
|
3382
3383
|
return "none";
|
|
3383
3384
|
}
|
|
3385
|
+
// ../scene/src/legacy/shadow.ts
|
|
3386
|
+
/**
|
|
3387
|
+
* @license
|
|
3388
|
+
* Copyright (c) 2026 Xue Studios LLC
|
|
3389
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3390
|
+
*/
|
|
3391
|
+
/** The shadow colour with its opacity, for drop-shadow and text-shadow alike. */
|
|
3392
|
+
function shadowColorCss(style) {
|
|
3393
|
+
const alpha = style.shadowOpacity !== void 0 ? Math.max(0, Math.min(100, style.shadowOpacity)) / 100 : 1;
|
|
3394
|
+
const sanitized = (style.shadowColor || "#000000").replace("#", "");
|
|
3395
|
+
const complete = sanitized.length === 3 ? sanitized.split("").map(function(c) {
|
|
3396
|
+
return c + c;
|
|
3397
|
+
}).join("") : sanitized;
|
|
3398
|
+
const r = parseInt(complete.substring(0, 2), 16) || 0;
|
|
3399
|
+
const g = parseInt(complete.substring(2, 4), 16) || 0;
|
|
3400
|
+
const b = parseInt(complete.substring(4, 6), 16) || 0;
|
|
3401
|
+
const baseColor = "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
|
|
3402
|
+
return style.shadowColorRole ? alpha < 1 ? "color-mix(in srgb, " + resolveCssColor(style.shadowColorRole, baseColor) + " " + Math.round(alpha * 100) + "%, transparent)" : resolveCssColor(style.shadowColorRole, baseColor) : baseColor;
|
|
3403
|
+
}
|
|
3404
|
+
// ../scene/src/blocks/effects.ts
|
|
3405
|
+
/**
|
|
3406
|
+
* @license
|
|
3407
|
+
* Copyright (c) 2026 Xue Studios LLC
|
|
3408
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3409
|
+
*/
|
|
3410
|
+
/** The image filters of a backdrop or a filter, as the media-filter CSS reads them. */
|
|
3411
|
+
function filterStyle(filters) {
|
|
3412
|
+
const f = filters ?? {};
|
|
3413
|
+
const percent = (v) => typeof v === "number" ? +(v * 100).toFixed(6) : void 0;
|
|
3414
|
+
return {
|
|
3415
|
+
filterPreset: f.preset,
|
|
3416
|
+
filterBlur: f.blur,
|
|
3417
|
+
filterBrightness: percent(f.brightness),
|
|
3418
|
+
filterContrast: percent(f.contrast),
|
|
3419
|
+
filterSaturate: percent(f.saturate),
|
|
3420
|
+
filterHueRotate: f.hueRotate
|
|
3421
|
+
};
|
|
3422
|
+
}
|
|
3423
|
+
/** A glow with no colour, or one the document cannot resolve, is this amber. */
|
|
3424
|
+
var GLOW_FALLBACK = "#f59e0b";
|
|
3425
|
+
function effectsToStyle(effects, ctx) {
|
|
3426
|
+
const filter = [];
|
|
3427
|
+
const textShadow = [];
|
|
3428
|
+
const defs = [];
|
|
3429
|
+
for (const fx of effects ?? []) if (fx.kind === "blur") filter.push(`blur(${fx.radius}px)`);
|
|
3430
|
+
else if (fx.kind === "glow") {
|
|
3431
|
+
const c = ctx.colorCss(fx.color) || GLOW_FALLBACK;
|
|
3432
|
+
const r = fx.radius;
|
|
3433
|
+
if (ctx.isText) textShadow.push(`0px 0px ${r * .4}px ${c}`, `0px 0px ${r}px ${c}`);
|
|
3434
|
+
else filter.push(`drop-shadow(0px 0px ${r * .4}px ${c}) drop-shadow(0px 0px ${r}px ${c})`);
|
|
3435
|
+
} else if (fx.kind === "shadow") {
|
|
3436
|
+
const bound = fx.color && typeof fx.color === "object" ? fx.color : void 0;
|
|
3437
|
+
const c = fx.opacity !== void 0 ? shadowColorCss({
|
|
3438
|
+
shadowColor: bound ? bound.fallback : fx.color,
|
|
3439
|
+
shadowOpacity: fx.opacity * 100,
|
|
3440
|
+
shadowColorRole: bound?.var
|
|
3441
|
+
}) : ctx.colorCss(fx.color ?? "#000000") || "#000000";
|
|
3442
|
+
const part = `${fx.x || 0}px ${fx.y || 0}px ${fx.blur || 0}px ${c}`;
|
|
3443
|
+
if (ctx.isText) textShadow.push(part);
|
|
3444
|
+
else filter.push(`drop-shadow(${part})`);
|
|
3445
|
+
} else if (fx.kind === "grain") {
|
|
3446
|
+
if (!ctx.grainable) continue;
|
|
3447
|
+
const id = "oim-grain-" + ctx.layerId.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
3448
|
+
defs.push({
|
|
3449
|
+
kind: "grain",
|
|
3450
|
+
id,
|
|
3451
|
+
effect: fx
|
|
3452
|
+
});
|
|
3453
|
+
filter.push(`url(#${id})`);
|
|
3454
|
+
} else if (fx.kind === "texture") defs.push({
|
|
3455
|
+
kind: "texture",
|
|
3456
|
+
effect: fx
|
|
3457
|
+
});
|
|
3458
|
+
const backdrop = effects?.find((fx) => fx.kind === "backdrop");
|
|
3459
|
+
let backdropFilter;
|
|
3460
|
+
if (backdrop?.preset === "duotone") defs.push({ kind: "duotone" });
|
|
3461
|
+
else backdropFilter = mediaFilterCss(filterStyle(backdrop));
|
|
3462
|
+
return {
|
|
3463
|
+
filter: filter.join(" "),
|
|
3464
|
+
textShadow: textShadow.join(", "),
|
|
3465
|
+
backdropFilter,
|
|
3466
|
+
defs
|
|
3467
|
+
};
|
|
3468
|
+
}
|
|
3384
3469
|
// ../scene/src/legacy/v2-layers.ts
|
|
3385
3470
|
/**
|
|
3386
3471
|
* @license
|
|
@@ -3423,23 +3508,6 @@ function anchorShift(box) {
|
|
|
3423
3508
|
return [/left/.test(anchor) ? "0%" : /right/.test(anchor) ? "-100%" : "-50%", /^top/.test(anchor) ? "0%" : /^bottom/.test(anchor) ? "-100%" : "-50%"];
|
|
3424
3509
|
}
|
|
3425
3510
|
/**
|
|
3426
|
-
* A 2.0 filter set as the 1.x style fields, so the one function all three
|
|
3427
|
-
* renderers share (`mediaFilterCss`) still writes the CSS. Every key is
|
|
3428
|
-
* present, so spreading it over a 1.x style replaces that style's filters.
|
|
3429
|
-
*/
|
|
3430
|
-
function filterStyle(filters) {
|
|
3431
|
-
const f = filters ?? {};
|
|
3432
|
-
const percent = (v) => typeof v === "number" ? +(v * 100).toFixed(6) : void 0;
|
|
3433
|
-
return {
|
|
3434
|
-
filterPreset: f.preset,
|
|
3435
|
-
filterBlur: f.blur,
|
|
3436
|
-
filterBrightness: percent(f.brightness),
|
|
3437
|
-
filterContrast: percent(f.contrast),
|
|
3438
|
-
filterSaturate: percent(f.saturate),
|
|
3439
|
-
filterHueRotate: f.hueRotate
|
|
3440
|
-
};
|
|
3441
|
-
}
|
|
3442
|
-
/**
|
|
3443
3511
|
* The 1.x mask fields of a 2.0 mask layer, so the mask helpers keep one input.
|
|
3444
3512
|
* Every field is written, absent ones as `undefined`, so nothing of 1.x shows through.
|
|
3445
3513
|
*/
|
|
@@ -4737,7 +4805,7 @@ function nextWheelZoom(zoom, deltaY, deltaMode, pinch) {
|
|
|
4737
4805
|
* the format can change without the player being touched. Tying both numbers
|
|
4738
4806
|
* together would make an internal fix look like a format break.
|
|
4739
4807
|
*/
|
|
4740
|
-
var CONTRACT_VERSION = "1.
|
|
4808
|
+
var CONTRACT_VERSION = "1.31.0";
|
|
4741
4809
|
/**
|
|
4742
4810
|
* What the player implements TODAY, measured and not assumed.
|
|
4743
4811
|
*
|
|
@@ -8683,25 +8751,6 @@ function artworkLabel(meta, nodes, lang, principal = lang) {
|
|
|
8683
8751
|
if (t && t.type === "text") return t.text;
|
|
8684
8752
|
return playerString("image", lang);
|
|
8685
8753
|
}
|
|
8686
|
-
// ../scene/src/legacy/shadow.ts
|
|
8687
|
-
/**
|
|
8688
|
-
* @license
|
|
8689
|
-
* Copyright (c) 2026 Xue Studios LLC
|
|
8690
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
8691
|
-
*/
|
|
8692
|
-
/** The shadow colour with its opacity, for drop-shadow and text-shadow alike. */
|
|
8693
|
-
function shadowColorCss(style) {
|
|
8694
|
-
const alpha = style.shadowOpacity !== void 0 ? Math.max(0, Math.min(100, style.shadowOpacity)) / 100 : 1;
|
|
8695
|
-
const sanitized = (style.shadowColor || "#000000").replace("#", "");
|
|
8696
|
-
const complete = sanitized.length === 3 ? sanitized.split("").map(function(c) {
|
|
8697
|
-
return c + c;
|
|
8698
|
-
}).join("") : sanitized;
|
|
8699
|
-
const r = parseInt(complete.substring(0, 2), 16) || 0;
|
|
8700
|
-
const g = parseInt(complete.substring(2, 4), 16) || 0;
|
|
8701
|
-
const b = parseInt(complete.substring(4, 6), 16) || 0;
|
|
8702
|
-
const baseColor = "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
|
|
8703
|
-
return style.shadowColorRole ? alpha < 1 ? "color-mix(in srgb, " + resolveCssColor(style.shadowColorRole, baseColor) + " " + Math.round(alpha * 100) + "%, transparent)" : resolveCssColor(style.shadowColorRole, baseColor) : baseColor;
|
|
8704
|
-
}
|
|
8705
8754
|
// ../core/src/crop.ts
|
|
8706
8755
|
/**
|
|
8707
8756
|
* @license
|
|
@@ -8800,7 +8849,7 @@ function mountImageFill(slotEl, paint, silhouette, resolvedUrl, fallbackColor) {
|
|
|
8800
8849
|
const flip = flipScale(paint.flipX, paint.flipY);
|
|
8801
8850
|
img.style.transform = flip ? `${crop.transform} scale(${flip[0]}, ${flip[1]})`.trim() : crop.transform;
|
|
8802
8851
|
img.style.transformOrigin = crop.transformOrigin;
|
|
8803
|
-
img.style.filter = mediaFilterCss(filterStyle(paint.filters)) ?? "";
|
|
8852
|
+
img.style.filter = mediaFilterCss$1(filterStyle(paint.filters)) ?? "";
|
|
8804
8853
|
img.addEventListener("error", () => {
|
|
8805
8854
|
box.remove();
|
|
8806
8855
|
if (!fallbackColor) return;
|
|
@@ -10051,7 +10100,7 @@ var LegacyRenderer = class {
|
|
|
10051
10100
|
}
|
|
10052
10101
|
imgEl.style.display = "block";
|
|
10053
10102
|
imgEl.style.pointerEvents = "none";
|
|
10054
|
-
imgEl.style.filter = slot.type === "image" ? mediaFilterCss(filterStyle(v2Own.image?.filters)) ?? "" : "";
|
|
10103
|
+
imgEl.style.filter = slot.type === "image" ? mediaFilterCss$1(filterStyle(v2Own.image?.filters)) ?? "" : "";
|
|
10055
10104
|
loopWrap.style.width = "100%";
|
|
10056
10105
|
loopWrap.style.height = "100%";
|
|
10057
10106
|
hoverWrap.style.width = "100%";
|
|
@@ -10548,31 +10597,18 @@ var LegacyRenderer = class {
|
|
|
10548
10597
|
const addTextShadow = (part) => {
|
|
10549
10598
|
slotEl.style.textShadow = slotEl.style.textShadow ? slotEl.style.textShadow + ", " + part : part;
|
|
10550
10599
|
};
|
|
10551
|
-
const
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
shadowColorRole: bound?.var
|
|
10564
|
-
}) : v2Colors.css(fx.color ?? "#000000") || "#000000";
|
|
10565
|
-
const part = (fx.x || 0) + "px " + (fx.y || 0) + "px " + (fx.blur || 0) + "px " + c;
|
|
10566
|
-
if (slotType === "text") addTextShadow(part);
|
|
10567
|
-
else addFilter("drop-shadow(" + part + ")");
|
|
10568
|
-
} else if (fx.kind === "grain") {
|
|
10569
|
-
if (!GRAIN_LAYER_TYPES.includes(slotType)) continue;
|
|
10570
|
-
const grainId = "oim-grain-" + String(slot.id).replace(/[^A-Za-z0-9_-]/g, "_");
|
|
10571
|
-
self._defineLayerGrain(grainId, fx);
|
|
10572
|
-
addFilter("url(#" + grainId + ")");
|
|
10573
|
-
} else if (fx.kind === "texture") applyTexture({
|
|
10574
|
-
...fx,
|
|
10575
|
-
color: fx.color === void 0 ? void 0 : v2Literal(fx.color)
|
|
10600
|
+
const fxStyle = effectsToStyle(v2Own.effects, {
|
|
10601
|
+
isText: slotType === "text",
|
|
10602
|
+
grainable: GRAIN_LAYER_TYPES.includes(slotType),
|
|
10603
|
+
layerId: String(slot.id),
|
|
10604
|
+
colorCss: (color) => v2Colors.css(color)
|
|
10605
|
+
});
|
|
10606
|
+
if (fxStyle.filter) addFilter(fxStyle.filter);
|
|
10607
|
+
if (fxStyle.textShadow) addTextShadow(fxStyle.textShadow);
|
|
10608
|
+
for (const def of fxStyle.defs) if (def.kind === "grain") self._defineLayerGrain(def.id, def.effect);
|
|
10609
|
+
else if (def.kind === "texture") applyTexture({
|
|
10610
|
+
...def.effect,
|
|
10611
|
+
color: def.effect.color === void 0 ? void 0 : v2Literal(def.effect.color)
|
|
10576
10612
|
});
|
|
10577
10613
|
const targetOpacity = v2Own.opacity ?? 1;
|
|
10578
10614
|
slotEl.dataset.oimOpacity = String(targetOpacity);
|
|
@@ -10583,9 +10619,7 @@ var LegacyRenderer = class {
|
|
|
10583
10619
|
slotEl.style.pointerEvents = "none";
|
|
10584
10620
|
}
|
|
10585
10621
|
if (slotType === "filter") {
|
|
10586
|
-
const
|
|
10587
|
-
const filterCss = mediaFilterCss(filterStyle(backdrop));
|
|
10588
|
-
const filterValue = backdrop?.preset === "duotone" ? "url(#" + getDuotoneFilterId(slot) + ")" : filterCss;
|
|
10622
|
+
const filterValue = fxStyle.defs.some((def) => def.kind === "duotone") ? "url(#" + getDuotoneFilterId(slot) + ")" : fxStyle.backdropFilter;
|
|
10589
10623
|
if (filterValue) {
|
|
10590
10624
|
slotEl.style.backdropFilter = filterValue;
|
|
10591
10625
|
slotEl.style.webkitBackdropFilter = filterValue;
|
package/dist/oim-player.js
CHANGED
|
@@ -48,19 +48,19 @@ 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 M(e){if(!e)return;let t=ae();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 N(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 P=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),oe=new Set([`public`,`author_only`,`sealed`]);function se(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?P.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&oe.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var ce=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],le=new Set(ce);function ue(e){return typeof e==`string`&&le.has(e)}var F=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,I=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,de=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),fe=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,pe=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function L(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(F.test(n)||de.has(n.toLowerCase())||I.test(n)||fe.test(n))return!0;let r=pe.exec(n);return r?L(r[2],t+1):!1}function R(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 ce){let t=n[i][e];L(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&&L(n)?n:void 0;if(ue(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`,B=[`public`,`author_only`,`sealed`];function V(e){if(!e||typeof e!=`object`)return ye;let t=se(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&B.includes(n)?n:ye}function H(e){return e===`public`?`verified_authorless`:`verified`}function be(e){return!!e&&e.type===`group`}function xe(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||[])be(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||be(r))continue;let e=xe(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:()=>q,vendorUrl:()=>Ee});function Ee(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return G+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=G+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 G,K,q,ke=n((()=>{G=`https://cdn.oim.media/player/v1/`,K=Oe({scriptUrl:i,version:`5.13.0`}),q={__oimExternal:!0,load:K}}));a(),ke();var Ae=`__oimUpgrade`,J=()=>globalThis[Ae],je=De({scriptUrl:i,file:`vendor/oim-upgrade-788e5348ee7b.js`,marker:`data-oim-upgrade`,read:()=>J()}),Me=e=>{let t=J();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Ne(){return J()?Promise.resolve():je().then(()=>void 0)}function Pe(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 Fe(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)?R(e)?.colors?.[n.var]??z(null,n.fallback):typeof n==`string`?z(null,n):``)||void 0}}function Ie(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 Le(e,t){let n=e?.text;if(!n)return;let r={},i=Ie(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=Ie(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 Y(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 Re(e,t){let n=e||{};if(n[`*`]!==void 0){let e=Y(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 ze(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function Be(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var Ve=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function He(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(Ve.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function Ue(e,t){let n=e&&e.style||{},r=Re(e&&e.content,t),i=ze(e,r);return{content:r,size:He(Y(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:Be(e)?`none`:Y(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function We(e,t,n){let r=Ue(e,t),i=Ue(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var Ge=new WeakMap;function Ke(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 X(e){let t=Ge.get(e);if(t)return t;try{t=Ke(Me(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e),t=new Map}return Ge.set(e,t),t}function qe(e,t){Ge.set(e,Ke(t.layers))}function Je(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 Ye(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}}function Xe(e){let t=e.mask??{},n=e.geometry,r=n?.kind===`preset`?n.name:n?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[n?.kind??``],i=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},a=e.fills?.[0],o=i(a?.kind===`color`?a.value:void 0),s=e.strokes?.[0],c=i(s?.paint?.kind===`color`?s.paint.value:void 0);return{maskMode:t.mode===`cutout`?`cutout`:`window`,maskFeather:t.feather,maskCoverage:t.scope===`group`?`container`:`canvas`,maskShape:r,maskSvgPath:n?.kind===`paths`?n.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:o.literal,maskBgColorRole:o.role,fillColorRole:void 0,maskStrokeColor:c.literal,maskStrokeColorRole:c.role,strokeColorRole:void 0,maskStrokeWidth:s?.width,cuts:e.extensions?.studio?.maskCuts}}function Ze(e,t){if(typeof e==`string`)return e===`oim:base`?``:e;if(!(`value`in e)||typeof e.value!=`string`)return``;let n=Y(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var Qe=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0;function $e(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`));for(let a of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,a.d);let o=Qe(a.fill===`currentColor`?t.fill??`currentColor`:a.fill),s=Qe(a.stroke===`currentColor`?t.stroke??`currentColor`:a.stroke);n?(e.setAttribute(`fill`,o??`none`),s&&e.setAttribute(`stroke`,s)):(e.setAttribute(`fill`,`none`),o&&e.style.setProperty(`fill`,o),s&&e.style.setProperty(`stroke`,s)),a.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(a.strokeWidth)),a.fillRule&&e.setAttribute(`fill-rule`,a.fillRule),a.cap&&e.setAttribute(`stroke-linecap`,a.cap),a.join&&e.setAttribute(`stroke-linejoin`,a.join),a.opacity!==void 0&&e.setAttribute(`opacity`,String(a.opacity)),a.transform&&e.setAttribute(`transform`,`matrix(${a.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function et(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=n(e.strokes?.[0]?.paint);return{fill:r??i,stroke:i??r}}function tt(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 nt(e,t){e.content=t.content;let n=tt(t.font?.size),r=tt(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 rt(e){let t=[],n=(e,r)=>{for(let i of e){let e=i.mask?`mask`:i.text?.artistic?`artistic-text`:i.type,a={id:i.id,type:e,style:r?{groupId:r}:{}};i.text&&nt(a,i.text),t.push(a),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=Pe(e.variables);return i&&(r.palettes=i),e.variables?.defaults?.palette&&(r.defaultPalette=e.variables.defaults.palette),qe(r,e),r}var it="/**\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)})}};",at=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,it],{type:`text/javascript;charset=utf-8`});function ot(e){let t;try{if(t=at&&(self.URL||self.webkitURL).createObjectURL(at),!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(it),{type:`module`,name:e?.name})}}var st=[{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`}}],ct=`https://api.oim.media/v1/media/keys`;function lt(e){for(let t=0;t<st.length;t++)if(st[t].kid===e)return st[t];return null}function ut(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||ct}function dt(e,t){let n=lt(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 ft(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 pt=6048e5;function mt(e,t,n=Date.now()){let r=lt(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!lt(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)))+pt}var ht=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function gt(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 ht(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new ht(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:ut()})})},stats(){return{alive:t!==null,pending:i.size}}}}var _t=null;function vt(e,t,n){return _t||=gt(()=>new ot),_t.verify(e,t,n)}var yt=10485760;async function bt(e,t=yt){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=yt){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 xt(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 St(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 bt(i)),{image:s,metadata:c,imageHash:await xt(t)}}var Ct=2**53-1;function wt(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>Ct:typeof e==`object`&&e?Object.values(e).some(wt):!1}var Tt=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function Et(e){if(Array.isArray(e))return e.map(Et);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=Et(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function Dt(e){if(Array.isArray(e))return e.map(Dt);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]=Dt(e[r]);return t}return e}function Ot(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Tt.has(n)||(t[n]=e[n]);let n=Dt(Et(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}function kt(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 At(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`&&!kt(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=Mt(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&Nt(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(Pt(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function jt(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function Mt(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 Nt(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 Pt(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 Ft(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var It={},Lt=null,Rt=!1,zt=null;function Bt(){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 Vt(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 Ht(e){let t=lt(e);return t?t.jwk:(It[e]||!Rt&&(zt||=Bt().then(e=>{e.forEach(e=>{It[e.kid]=e}),Rt=!0}),await zt,It[e])||await Ut(),It[e])}function Ut(){return Lt||=(async function(){try{let e=ut(),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];It[t.kid]=t}await Vt(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),Lt}async function Wt(e){return await Ut(),It[e]||null}async function Gt(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 Ht(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(wt(e))return!1;let r=Ot(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 Wt(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=dt(e.key_version,t);if(!ft({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 Kt(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`:H(V(e.metadata)):`image_unsealed`}async function qt(e,t=Date.now()){let n=e&&e.key_version;return n?lt(n)?mt(n,null,t):mt(n,await Wt(n),t):!1}function Jt(e){return e===`image_mismatch`||e===`invalid_signature`}var Yt=`OIM_ALTERED`;function Xt(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 Zt(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 Ht(e.key_version),o=!!a&&await i(a);if(!o){let t=await Wt(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 qt({key_version:e.key_version})?`expired_key`:`ok`}var Qt=Math.log(1.05)/100,$t=.01,en=16,tn=800;function nn(e,t,n,r){let i=n===1?t*en:n===2?t*tn:t,a=e*Math.exp(-i*(r?$t:Qt));return Math.max(1,Math.min(4,a))}var rn=`1.30.2`,an=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function on(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 sn(e,t){let n=on(e),r=on(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 cn(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=sn(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 ln(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 un=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,dn=546136,fn={woff:`wOFF`,woff2:`wOF2`};function pn(e,t){try{return atob(e.slice(0,8)).startsWith(fn[t])}catch{return!1}}function mn(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`||!un.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>dn||!pn(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 hn(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 gn(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var _n=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function vn(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=_n.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 yn(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 vn(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 bn(e,t){return yn(e,t).runs}function xn(e){return e.replace(/[{}]/g,e=>e+e)}function Sn(e,t){return bn(e,t).map(e=>e.text).join(``)}function Cn(e,t){let n=``,r=[];for(let i of bn(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 wn(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+=xn(e.slice(r,t))+`{${i.mark}}`+xn(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+xn(e.slice(r))}function Tn(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 En(e,t){return Sn(e,Object.keys(t??{}))}function Dn(e,t,n){e.textContent=``;for(let r of bn(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=Tn(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 On(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 kn(e,t){let{plain:n,ranges:r}=Cn(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:wn(n.slice(1),i)}}var An=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function jn(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&&An.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 Mn=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Nn=.35,Pn=.05,Fn=[`slide-up`,`reveal-mask`,`rise-words`];function In(e){return typeof e==`string`&&Mn.includes(e)}function Ln(e){return e===`reveal-mask`}function Rn(e,t){return Fn.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function zn(e,t=Pn,n=0){return n+e*t}function Bn(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 Vn(e,t=10){return Array.from({length:t+1},(n,r)=>Bn(e,r/t))}function Hn(){return Promise.resolve().then(()=>(ke(),Te)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}a(),ke();var Un=()=>globalThis.__oimGenerative,Wn=De({scriptUrl:i,file:`vendor/oim-generative-788e5348ee7b.js`,marker:`data-oim-generative`,read:()=>Un()}),Gn=(e,t)=>Un()?.renderGenerativeSVG(e,t)??``;a(),ke();var Kn=()=>globalThis.__oimPatterns,qn=De({scriptUrl:i,file:`vendor/oim-patterns-788e5348ee7b.js`,marker:`data-oim-patterns`,read:()=>Kn()}),Jn=e=>Kn()?.generatePatternSVG(e)??``,Yn=(...e)=>Kn()?.patternTileUri(...e)??``,Xn=e=>Kn()?.isMultiColorPattern(e)??!1,Zn=(...e)=>Kn()?.resolvePatternColors(...e)??{fgColor:`#000000`,bgColor:`transparent`};function Qn(e){let t=[];return e.generative&&t.push(Wn()),e.patterns&&t.push(qn()),Promise.all(t).then(()=>void 0)}var $n=/^(fill|background)Pattern/;function er(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)$n.test(e)&&i[e]!=null&&(t.patterns=!0),r(i[e])};return r(e),t}var tr={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(tr).filter(e=>e!==`line`&&e!==`scribble`)];function nr(e){if(e&&e!==`rect`&&e!==`rectangle`)return tr[e]}function rr(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var ir=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,ar=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,or=`0 0 100 100`,sr=e=>e&&e.length<=2e4&&ir.test(e)?e:void 0,cr=e=>e&&e.length<=64&&ar.test(e)?e:or;function lr(e){let t=nr(e.geoShape),n=sr(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:or}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&sr(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:or}:n?{d:n,viewBox:cr(e.svgViewBox)}:null}var ur={silhouette:null,fillable:!0,round:!1};function dr(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=nr(t);return n?{silhouette:lr({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=lr({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 fr=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,pr=/^[A-Za-z0-9.%\s-]+$/,mr=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,hr=/^[A-Za-z]+$/,gr=2048;function _r(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 vr(e){let t=mr.exec(e);if(!t)return!1;let n=t[1].trim();return hr.test(n)||L(n)}function yr(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>gr||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=fr.exec(t);if(!n)return!1;let r=_r(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=vr(i)?r:pr.test(i)?a:null;return!!o&&o.length>0&&o.every(vr)}var br=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function xr(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${Jn({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&&br.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function Sr(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("${Gn(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?xr(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=yr(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 Cr(e,t){if(!e&&t?.svgPath){let e=lr({svgPath:t.svgPath,svgViewBox:t.svgViewBox});return e?.d?wr(`<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=tr[e];return!n||n.kind===`path`&&!n.fillable?{}:wr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${n.kind===`polygon`?`<polygon points="${rr(n.points)}" fill="black"/>`:`<path d="${n.d}" fill="black"/>`}</svg>`)}function wr(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 Tr(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 Er(e){let t=xr(e);return Object.assign(t,Cr(e.geoShape)),t}var Dr=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,Or=(e,t)=>Dr(e)?t.literal(e.fallback):t.literal(e);function kr(e,t){let n=(e.colors??[]).map(e=>Or(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:Dr(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:Or(e.bg,t),fillPatternBgColorRole:Dr(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 Ar=e=>`${+(e*100).toFixed(4)}%`;function jr(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} ${Ar(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 Mr=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),Nr=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function Pr(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?Pr(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return Nr(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?jr(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return Nr(i?Mr(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return Nr(Sr({...kr(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 Nr(Sr({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);default:return{}}}var Fr={circle:`M50 0 A50 50 0 1 1 49.99 0 Z`,rectangle:`M0 0 H100 V100 H0 Z`,heart:`M50 88 C10 60 -5 30 15 12 C30 -2 50 5 50 25 C50 5 70 -2 85 12 C105 30 90 60 50 88 Z`,blob:`M40 4 C70 -4 100 20 96 48 C104 78 72 100 44 96 C12 100 -8 72 4 44 C0 16 16 8 40 4 Z`,triangle:`M50 5 L95 90 L5 90 Z`,star:`M50 2 L62 38 L100 38 L69 59 L80 95 L50 73 L20 95 L31 59 L0 38 L38 38 Z`,line:`M5 45 L95 45 L95 55 L5 55 Z`,arrow:`M5 40 L60 40 L60 20 L95 50 L60 80 L60 60 L5 60 Z`,diamond:`M50 5 L95 50 L50 95 L5 50 Z`,hexagon:`M25 5 L75 5 L95 50 L75 95 L25 95 L5 50 Z`};function Ir(e){return`mask-clip-${e.id}`}function Lr(e){let t=e.style||{},n=t.maskShape||t.geoShape,r=t.maskSvgPath||t.svgPath;return r&&(!n||n===`custom`)?r:n&&Fr[n]||Fr.circle}function Rr(e,t){let{width:n,height:r}=t,i=e,a=Array.isArray(i.position)?i.position:[0,0],o=typeof i.x==`number`?i.x:Number(a[0])/100*n,s=typeof i.y==`number`?i.y:Number(a[1])/100*r,c=typeof i.width==`number`?i.width:Number(i.width_px)||0,l=typeof i.height==`number`?i.height:Number(i.height_px)||0,u=((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?`M${o} ${s}H${o+c}V${s+l}H${o}Z`:`M0 0H${n}V${r}H0Z`,d=i.cuts||i.style&&i.style.cuts;return d&&Array.isArray(d)&&d.length>0?`${u} ${d.map(e=>Ur(e.svgPath||Fr[e.shape]||Fr.circle,o+(e.x||0),s+(e.y||0),e.width||0,e.height||0)).join(` `)}`:`${u} ${Ur(Lr(e),o,s,c,l)}`}function zr(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0],i=typeof n.x==`number`?n.x:Number(r[0])/100*t.width,a=typeof n.y==`number`?n.y:Number(r[1])/100*t.height,o=typeof n.width==`number`?n.width:Number(n.width_px)||0,s=typeof n.height==`number`?n.height:Number(n.height_px)||0;return Ur(Lr(e),i,a,o,s)}var Br={shadows:`#1e1b4b`,lights:`#fbbf24`};function Vr(e){return`duotone-filter-${e.id}`}function Hr(e){return`mask-feather-${e.id}`}function Ur(e,t,n,r,i){let a=e.replace(/,/g,` `).match(/[a-df-z]|-?\d+(?:\.\d+)?/gi)||[],o=0,s=0,c=``,l=0,u=``;for(;l<a.length;){let e=a[l];if(/^[a-df-z]$/i.test(e))u=e,l++,(u===`Z`||u===`z`)&&(c+=`Z `);else if(u===`M`||u===`m`||u===`L`||u===`l`){o=parseFloat(e),s=parseFloat(a[l+1]),l+=2;let d=t+o/100*r,f=n+s/100*i;c+=`${u===`m`?`M`:u===`l`?`L`:u} ${parseFloat(d.toFixed(3))} ${parseFloat(f.toFixed(3))} `}else if(u===`H`||u===`h`){o=parseFloat(e),l++;let a=t+o/100*r,u=n+s/100*i;c+=`L ${parseFloat(a.toFixed(3))} ${parseFloat(u.toFixed(3))} `}else if(u===`V`||u===`v`){s=parseFloat(e),l++;let a=t+o/100*r,u=n+s/100*i;c+=`L ${parseFloat(a.toFixed(3))} ${parseFloat(u.toFixed(3))} `}else if(u===`C`||u===`c`){let e=parseFloat(a[l]),u=parseFloat(a[l+1]),d=parseFloat(a[l+2]),f=parseFloat(a[l+3]),p=parseFloat(a[l+4]),m=parseFloat(a[l+5]);l+=6,o=p,s=m;let h=t+e/100*r,g=n+u/100*i,_=t+d/100*r,v=n+f/100*i,y=t+p/100*r,b=n+m/100*i;c+=`C ${parseFloat(h.toFixed(3))} ${parseFloat(g.toFixed(3))} ${parseFloat(_.toFixed(3))} ${parseFloat(v.toFixed(3))} ${parseFloat(y.toFixed(3))} ${parseFloat(b.toFixed(3))} `}else if(u===`A`||u===`a`){let e=parseFloat(a[l]),u=parseFloat(a[l+1]),d=parseFloat(a[l+2]),f=parseFloat(a[l+3]),p=parseFloat(a[l+4]),m=parseFloat(a[l+5]),h=parseFloat(a[l+6]);l+=7,o=m,s=h;let g=e/100*r,_=u/100*i,v=t+m/100*r,y=n+h/100*i;c+=`A ${parseFloat(g.toFixed(3))} ${parseFloat(_.toFixed(3))} ${d} ${f} ${p} ${parseFloat(v.toFixed(3))} ${parseFloat(y.toFixed(3))} `}else c+=`${e} `,l++}return c.trim()}function Wr(e,t){let{width:n,height:r}=t,i=e,a=Array.isArray(i.position)?i.position:[0,0],o=typeof i.x==`number`?i.x:Number(a[0])/100*n,s=typeof i.y==`number`?i.y:Number(a[1])/100*r,c=typeof i.width==`number`?i.width:Number(i.width_px)||0,l=typeof i.height==`number`?i.height:Number(i.height_px)||0,u=`M0 0H${n}V${r}H0Z`,d=`M${o} ${s}H${o+c}V${s+l}H${o}Z`,f=i.cuts||i.style&&i.style.cuts;return f&&Array.isArray(f)&&f.length>0?`${u} ${d} ${f.map(e=>Ur(e.svgPath||Fr[e.shape]||Fr.circle,o+(e.x||0),s+(e.y||0),e.width||0,e.height||0)).join(` `)}`:`${u} ${d} ${Ur(Lr(e),o,s,c,l)}`}function Gr(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(#${Hr(n)})`}:{clipPath:`url(#${Ir(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 Kr=6,qr=5,Jr=8,Yr=2*Math.PI/Kr,Xr=`oim-wave-chars`;function Zr(){let e=[];for(let t=0;t<=Jr;t++){let n=t/Jr,r=parseFloat((n*100).toFixed(4)),i=Math.sin(n*2*Math.PI)*qr,a=parseFloat(i.toFixed(4));e.push(` ${r}% { transform: translateY(${a}px); }`)}return`@keyframes ${Xr} {\n${e.join(`
|
|
52
|
-
`)}\n}`}function
|
|
51
|
+
[data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function M(e){if(!e)return;let t=ae();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 N(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 P=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),F=new Set([`public`,`author_only`,`sealed`]);function oe(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?P.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&F.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var se=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],ce=new Set(se);function le(e){return typeof e==`string`&&ce.has(e)}var I=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,L=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,ue=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),de=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,fe=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function R(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(I.test(n)||ue.has(n.toLowerCase())||L.test(n)||de.test(n))return!0;let r=fe.exec(n);return r?R(r[2],t+1):!1}function z(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 se){let t=n[i][e];R(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function B(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&R(n)?n:void 0;if(le(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function pe(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var me={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 he(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function ge(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(me,t)?t:void 0,blur:he(e.filterBlur,0,100)??0,brightness:he(e.filterBrightness,0,500)??100,contrast:he(e.filterContrast,0,500)??100,saturate:he(e.filterSaturate,0,500)??100,hue:he(e.filterHueRotate,0,360)??0}}function _e(e){let t=ge(e),n=[];return t.preset!==void 0&&n.push(me[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 ve=`author_only`,V=[`public`,`author_only`,`sealed`];function H(e){if(!e||typeof e!=`object`)return ve;let t=oe(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&V.includes(n)?n:ve}function U(e){return e===`public`?`verified_authorless`:`verified`}function ye(e){return!!e&&e.type===`group`}function be(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function xe(e){let t=new Set;for(let n of e||[])ye(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||ye(r))continue;let e=be(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 W(e){let t=pe(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var Se=`oim:base`;function Ce(e){let t=t=>{if(typeof t==`string`)return t===Se;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===Se}return t.value===Se||Object.values(t.modes??{}).includes(Se)},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:()=>q,vendorUrl:()=>Ee});function Ee(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return G+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=G+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 G,K,q,ke=n((()=>{G=`https://cdn.oim.media/player/v1/`,K=Oe({scriptUrl:i,version:`5.13.0`}),q={__oimExternal:!0,load:K}}));a(),ke();var Ae=`__oimUpgrade`,J=()=>globalThis[Ae],je=De({scriptUrl:i,file:`vendor/oim-upgrade-24aba9f1061a.js`,marker:`data-oim-upgrade`,read:()=>J()}),Me=e=>{let t=J();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Ne(){return J()?Promise.resolve():je().then(()=>void 0)}function Pe(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 Y(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?B(e.var,e.fallback):typeof e==`string`?B(null,e):``)||void 0,literal:n=>(t(n)?z(e)?.colors?.[n.var]??B(null,n.fallback):typeof n==`string`?B(null,n):``)||void 0}}function Fe(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 Ie(e,t){let n=e?.text;if(!n)return;let r={},i=Fe(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=Fe(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 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 Le(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 Re(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function ze(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var Be=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function Ve(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(Be.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function He(e,t){let n=e&&e.style||{},r=Le(e&&e.content,t),i=Re(e,r);return{content:r,size:Ve(X(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:ze(e)?`none`:X(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function Ue(e,t,n){let r=He(e,t),i=He(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var We={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 Ke(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(We,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 qe(e){let t=Ke(e),n=[];return t.preset!==void 0&&n.push(We[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}a(),ke();var Je=()=>globalThis.__oimGenerative,Ye=De({scriptUrl:i,file:`vendor/oim-generative-24aba9f1061a.js`,marker:`data-oim-generative`,read:()=>Je()}),Xe=(e,t)=>Je()?.renderGenerativeSVG(e,t)??``;a(),ke();var Ze=()=>globalThis.__oimPatterns,Qe=De({scriptUrl:i,file:`vendor/oim-patterns-24aba9f1061a.js`,marker:`data-oim-patterns`,read:()=>Ze()}),$e=e=>Ze()?.generatePatternSVG(e)??``,et=(...e)=>Ze()?.patternTileUri(...e)??``,tt=e=>Ze()?.isMultiColorPattern(e)??!1,nt=(...e)=>Ze()?.resolvePatternColors(...e)??{fgColor:`#000000`,bgColor:`transparent`};function rt(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, `+B(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:B(e.shadowColorRole,s):s}function it(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 at=`#f59e0b`;function ot(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)||at,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`:rt({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=qe(it(a)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:o,defs:i}}var st=new WeakMap;function ct(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 lt(e){let t=st.get(e);if(t)return t;try{t=ct(Me(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e),t=new Map}return st.set(e,t),t}function ut(e,t){st.set(e,ct(t.layers))}function dt(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 ft(e){let t=e.mask??{},n=e.geometry,r=n?.kind===`preset`?n.name:n?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[n?.kind??``],i=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},a=e.fills?.[0],o=i(a?.kind===`color`?a.value:void 0),s=e.strokes?.[0],c=i(s?.paint?.kind===`color`?s.paint.value:void 0);return{maskMode:t.mode===`cutout`?`cutout`:`window`,maskFeather:t.feather,maskCoverage:t.scope===`group`?`container`:`canvas`,maskShape:r,maskSvgPath:n?.kind===`paths`?n.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:o.literal,maskBgColorRole:o.role,fillColorRole:void 0,maskStrokeColor:c.literal,maskStrokeColorRole:c.role,strokeColorRole:void 0,maskStrokeWidth:s?.width,cuts:e.extensions?.studio?.maskCuts}}function pt(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 mt=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0;function ht(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`));for(let a of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,a.d);let o=mt(a.fill===`currentColor`?t.fill??`currentColor`:a.fill),s=mt(a.stroke===`currentColor`?t.stroke??`currentColor`:a.stroke);n?(e.setAttribute(`fill`,o??`none`),s&&e.setAttribute(`stroke`,s)):(e.setAttribute(`fill`,`none`),o&&e.style.setProperty(`fill`,o),s&&e.style.setProperty(`stroke`,s)),a.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(a.strokeWidth)),a.fillRule&&e.setAttribute(`fill-rule`,a.fillRule),a.cap&&e.setAttribute(`stroke-linecap`,a.cap),a.join&&e.setAttribute(`stroke-linejoin`,a.join),a.opacity!==void 0&&e.setAttribute(`opacity`,String(a.opacity)),a.transform&&e.setAttribute(`transform`,`matrix(${a.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function gt(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=n(e.strokes?.[0]?.paint);return{fill:r??i,stroke:i??r}}function _t(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 vt(e,t){e.content=t.content;let n=_t(t.font?.size),r=_t(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 yt(e){let t=[],n=(e,r)=>{for(let i of e){let e=i.mask?`mask`:i.text?.artistic?`artistic-text`:i.type,a={id:i.id,type:e,style:r?{groupId:r}:{}};i.text&&vt(a,i.text),t.push(a),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=Pe(e.variables);return i&&(r.palettes=i),e.variables?.defaults?.palette&&(r.defaultPalette=e.variables.defaults.palette),ut(r,e),r}var bt="/**\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)})}};",xt=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,bt],{type:`text/javascript;charset=utf-8`});function St(e){let t;try{if(t=xt&&(self.URL||self.webkitURL).createObjectURL(xt),!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(bt),{type:`module`,name:e?.name})}}var Ct=[{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`}}],wt=`https://api.oim.media/v1/media/keys`;function Tt(e){for(let t=0;t<Ct.length;t++)if(Ct[t].kid===e)return Ct[t];return null}function Et(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||wt}function Dt(e,t){let n=Tt(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 Ot(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 kt=6048e5;function At(e,t,n=Date.now()){let r=Tt(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!Tt(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)))+kt}var jt=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function Mt(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 jt(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new jt(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:Et()})})},stats(){return{alive:t!==null,pending:i.size}}}}var Nt=null;function Pt(e,t,n){return Nt||=Mt(()=>new St),Nt.verify(e,t,n)}var Ft=10485760;async function It(e,t=Ft){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=Ft){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 Lt(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 Rt(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 It(i)),{image:s,metadata:c,imageHash:await Lt(t)}}var zt=2**53-1;function Bt(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>zt:typeof e==`object`&&e?Object.values(e).some(Bt):!1}var Vt=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function Ht(e){if(Array.isArray(e))return e.map(Ht);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=Ht(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function Ut(e){if(Array.isArray(e))return e.map(Ut);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]=Ut(e[r]);return t}return e}function Wt(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Vt.has(n)||(t[n]=e[n]);let n=Ut(Ht(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}function Gt(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 Kt(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`&&!Gt(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=Jt(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&Yt(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(Xt(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function qt(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function Jt(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 Yt(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 Xt(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 Zt(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var Qt={},$t=null,en=!1,tn=null;function nn(){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 rn(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 an(e){let t=Tt(e);return t?t.jwk:(Qt[e]||!en&&(tn||=nn().then(e=>{e.forEach(e=>{Qt[e.kid]=e}),en=!0}),await tn,Qt[e])||await on(),Qt[e])}function on(){return $t||=(async function(){try{let e=Et(),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];Qt[t.kid]=t}await rn(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),$t}async function sn(e){return await on(),Qt[e]||null}async function cn(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 an(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(Bt(e))return!1;let r=Wt(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 sn(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=Dt(e.key_version,t);if(!Ot({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 ln(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`:U(H(e.metadata)):`image_unsealed`}async function un(e,t=Date.now()){let n=e&&e.key_version;return n?Tt(n)?At(n,null,t):At(n,await sn(n),t):!1}function dn(e){return e===`image_mismatch`||e===`invalid_signature`}var fn=`OIM_ALTERED`;function pn(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 mn(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 an(e.key_version),o=!!a&&await i(a);if(!o){let t=await sn(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 un({key_version:e.key_version})?`expired_key`:`ok`}var hn=Math.log(1.05)/100,gn=.01,_n=16,vn=800;function yn(e,t,n,r){let i=n===1?t*_n:n===2?t*vn:t,a=e*Math.exp(-i*(r?gn:hn));return Math.max(1,Math.min(4,a))}var bn=`1.31.0`,xn=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function Sn(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 Cn(e,t){let n=Sn(e),r=Sn(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 wn(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=Cn(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 Tn(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 En=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,Dn=546136,On={woff:`wOFF`,woff2:`wOF2`};function kn(e,t){try{return atob(e.slice(0,8)).startsWith(On[t])}catch{return!1}}function An(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`||!En.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>Dn||!kn(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 jn(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 Mn(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var Nn=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function Pn(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=Nn.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 Fn(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 Pn(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 In(e,t){return Fn(e,t).runs}function Ln(e){return e.replace(/[{}]/g,e=>e+e)}function Rn(e,t){return In(e,t).map(e=>e.text).join(``)}function zn(e,t){let n=``,r=[];for(let i of In(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 Bn(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+=Ln(e.slice(r,t))+`{${i.mark}}`+Ln(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+Ln(e.slice(r))}function Vn(e){let t={underline:e.underline===!0},n=B(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:B(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 Hn(e,t){return Rn(e,Object.keys(t??{}))}function Un(e,t,n){e.textContent=``;for(let r of In(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=Vn(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 Wn(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 Gn(e,t){let{plain:n,ranges:r}=zn(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:Bn(n.slice(1),i)}}var Kn=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function qn(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&&Kn.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 Jn=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Yn=.35,Xn=.05,Zn=[`slide-up`,`reveal-mask`,`rise-words`];function Qn(e){return typeof e==`string`&&Jn.includes(e)}function $n(e){return e===`reveal-mask`}function er(e,t){return Zn.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function tr(e,t=Xn,n=0){return n+e*t}function nr(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)=>nr(e,r/t))}function ir(){return Promise.resolve().then(()=>(ke(),Te)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function ar(e){let t=[];return e.generative&&t.push(Ye()),e.patterns&&t.push(Qe()),Promise.all(t).then(()=>void 0)}var or=/^(fill|background)Pattern/;function sr(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)or.test(e)&&i[e]!=null&&(t.patterns=!0),r(i[e])};return r(e),t}var cr={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(cr).filter(e=>e!==`line`&&e!==`scribble`)];function lr(e){if(e&&e!==`rect`&&e!==`rectangle`)return cr[e]}function ur(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var dr=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,fr=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,pr=`0 0 100 100`,mr=e=>e&&e.length<=2e4&&dr.test(e)?e:void 0,hr=e=>e&&e.length<=64&&fr.test(e)?e:pr;function gr(e){let t=lr(e.geoShape),n=mr(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:pr}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&mr(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:pr}:n?{d:n,viewBox:hr(e.svgViewBox)}:null}var _r={silhouette:null,fillable:!0,round:!1};function vr(e){if(!e||e.kind===`rect`)return _r;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=lr(t);return n?{silhouette:gr({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:_r}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=gr({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:_r}return _r}var yr=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,br=/^[A-Za-z0-9.%\s-]+$/,xr=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,Sr=/^[A-Za-z]+$/,Cr=2048;function wr(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 Tr(e){let t=xr.exec(e);if(!t)return!1;let n=t[1].trim();return Sr.test(n)||R(n)}function Er(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>Cr||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=yr.exec(t);if(!n)return!1;let r=wr(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=Tr(i)?r:br.test(i)?a:null;return!!o&&o.length>0&&o.every(Tr)}var Dr=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function Or(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${$e({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&&Dr.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function kr(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("${Xe(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?Or(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=Er(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 Ar(e,t){if(!e&&t?.svgPath){let e=gr({svgPath:t.svgPath,svgViewBox:t.svgViewBox});return e?.d?jr(`<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=cr[e];return!n||n.kind===`path`&&!n.fillable?{}:jr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${n.kind===`polygon`?`<polygon points="${ur(n.points)}" fill="black"/>`:`<path d="${n.d}" fill="black"/>`}</svg>`)}function jr(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 Mr(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 Nr(e){let t=Or(e);return Object.assign(t,Ar(e.geoShape)),t}var Pr=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,Fr=(e,t)=>Pr(e)?t.literal(e.fallback):t.literal(e);function Ir(e,t){let n=(e.colors??[]).map(e=>Fr(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:Pr(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:Fr(e.bg,t),fillPatternBgColorRole:Pr(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 Lr=e=>`${+(e*100).toFixed(4)}%`;function Rr(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} ${Lr(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 zr=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),Br=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function Vr(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?Vr(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return Br(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?Rr(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return Br(i?zr(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return Br(kr({...Ir(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 Br(kr({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);default:return{}}}var Hr={circle:`M50 0 A50 50 0 1 1 49.99 0 Z`,rectangle:`M0 0 H100 V100 H0 Z`,heart:`M50 88 C10 60 -5 30 15 12 C30 -2 50 5 50 25 C50 5 70 -2 85 12 C105 30 90 60 50 88 Z`,blob:`M40 4 C70 -4 100 20 96 48 C104 78 72 100 44 96 C12 100 -8 72 4 44 C0 16 16 8 40 4 Z`,triangle:`M50 5 L95 90 L5 90 Z`,star:`M50 2 L62 38 L100 38 L69 59 L80 95 L50 73 L20 95 L31 59 L0 38 L38 38 Z`,line:`M5 45 L95 45 L95 55 L5 55 Z`,arrow:`M5 40 L60 40 L60 20 L95 50 L60 80 L60 60 L5 60 Z`,diamond:`M50 5 L95 50 L50 95 L5 50 Z`,hexagon:`M25 5 L75 5 L95 50 L75 95 L25 95 L5 50 Z`};function Ur(e){return`mask-clip-${e.id}`}function Wr(e){let t=e.style||{},n=t.maskShape||t.geoShape,r=t.maskSvgPath||t.svgPath;return r&&(!n||n===`custom`)?r:n&&Hr[n]||Hr.circle}function Gr(e,t){let{width:n,height:r}=t,i=e,a=Array.isArray(i.position)?i.position:[0,0],o=typeof i.x==`number`?i.x:Number(a[0])/100*n,s=typeof i.y==`number`?i.y:Number(a[1])/100*r,c=typeof i.width==`number`?i.width:Number(i.width_px)||0,l=typeof i.height==`number`?i.height:Number(i.height_px)||0,u=((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?`M${o} ${s}H${o+c}V${s+l}H${o}Z`:`M0 0H${n}V${r}H0Z`,d=i.cuts||i.style&&i.style.cuts;return d&&Array.isArray(d)&&d.length>0?`${u} ${d.map(e=>Xr(e.svgPath||Hr[e.shape]||Hr.circle,o+(e.x||0),s+(e.y||0),e.width||0,e.height||0)).join(` `)}`:`${u} ${Xr(Wr(e),o,s,c,l)}`}function Kr(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0],i=typeof n.x==`number`?n.x:Number(r[0])/100*t.width,a=typeof n.y==`number`?n.y:Number(r[1])/100*t.height,o=typeof n.width==`number`?n.width:Number(n.width_px)||0,s=typeof n.height==`number`?n.height:Number(n.height_px)||0;return Xr(Wr(e),i,a,o,s)}var qr={shadows:`#1e1b4b`,lights:`#fbbf24`};function Jr(e){return`duotone-filter-${e.id}`}function Yr(e){return`mask-feather-${e.id}`}function Xr(e,t,n,r,i){let a=e.replace(/,/g,` `).match(/[a-df-z]|-?\d+(?:\.\d+)?/gi)||[],o=0,s=0,c=``,l=0,u=``;for(;l<a.length;){let e=a[l];if(/^[a-df-z]$/i.test(e))u=e,l++,(u===`Z`||u===`z`)&&(c+=`Z `);else if(u===`M`||u===`m`||u===`L`||u===`l`){o=parseFloat(e),s=parseFloat(a[l+1]),l+=2;let d=t+o/100*r,f=n+s/100*i;c+=`${u===`m`?`M`:u===`l`?`L`:u} ${parseFloat(d.toFixed(3))} ${parseFloat(f.toFixed(3))} `}else if(u===`H`||u===`h`){o=parseFloat(e),l++;let a=t+o/100*r,u=n+s/100*i;c+=`L ${parseFloat(a.toFixed(3))} ${parseFloat(u.toFixed(3))} `}else if(u===`V`||u===`v`){s=parseFloat(e),l++;let a=t+o/100*r,u=n+s/100*i;c+=`L ${parseFloat(a.toFixed(3))} ${parseFloat(u.toFixed(3))} `}else if(u===`C`||u===`c`){let e=parseFloat(a[l]),u=parseFloat(a[l+1]),d=parseFloat(a[l+2]),f=parseFloat(a[l+3]),p=parseFloat(a[l+4]),m=parseFloat(a[l+5]);l+=6,o=p,s=m;let h=t+e/100*r,g=n+u/100*i,_=t+d/100*r,v=n+f/100*i,y=t+p/100*r,b=n+m/100*i;c+=`C ${parseFloat(h.toFixed(3))} ${parseFloat(g.toFixed(3))} ${parseFloat(_.toFixed(3))} ${parseFloat(v.toFixed(3))} ${parseFloat(y.toFixed(3))} ${parseFloat(b.toFixed(3))} `}else if(u===`A`||u===`a`){let e=parseFloat(a[l]),u=parseFloat(a[l+1]),d=parseFloat(a[l+2]),f=parseFloat(a[l+3]),p=parseFloat(a[l+4]),m=parseFloat(a[l+5]),h=parseFloat(a[l+6]);l+=7,o=m,s=h;let g=e/100*r,_=u/100*i,v=t+m/100*r,y=n+h/100*i;c+=`A ${parseFloat(g.toFixed(3))} ${parseFloat(_.toFixed(3))} ${d} ${f} ${p} ${parseFloat(v.toFixed(3))} ${parseFloat(y.toFixed(3))} `}else c+=`${e} `,l++}return c.trim()}function Zr(e,t){let{width:n,height:r}=t,i=e,a=Array.isArray(i.position)?i.position:[0,0],o=typeof i.x==`number`?i.x:Number(a[0])/100*n,s=typeof i.y==`number`?i.y:Number(a[1])/100*r,c=typeof i.width==`number`?i.width:Number(i.width_px)||0,l=typeof i.height==`number`?i.height:Number(i.height_px)||0,u=`M0 0H${n}V${r}H0Z`,d=`M${o} ${s}H${o+c}V${s+l}H${o}Z`,f=i.cuts||i.style&&i.style.cuts;return f&&Array.isArray(f)&&f.length>0?`${u} ${d} ${f.map(e=>Xr(e.svgPath||Hr[e.shape]||Hr.circle,o+(e.x||0),s+(e.y||0),e.width||0,e.height||0)).join(` `)}`:`${u} ${d} ${Xr(Wr(e),o,s,c,l)}`}function Qr(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(#${Yr(n)})`}:{clipPath:`url(#${Ur(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 $r=6,ei=5,ti=8,ni=2*Math.PI/$r,ri=`oim-wave-chars`;function ii(){let e=[];for(let t=0;t<=ti;t++){let n=t/ti,r=parseFloat((n*100).toFixed(4)),i=Math.sin(n*2*Math.PI)*ei,a=parseFloat(i.toFixed(4));e.push(` ${r}% { transform: translateY(${a}px); }`)}return`@keyframes ${ri} {\n${e.join(`
|
|
52
|
+
`)}\n}`}function ai(e,t,n){return n-(ni-(e*t%ni+ni)%ni)%ni}var oi=.7,si={isActive:!1,cyanOffset:{x:0,y:0},magentaOffset:{x:0,y:0},jitterSkew:0,slices:[]};function ci(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 si;let i=Math.max(.01,t),a=e-n,o=a*i%1;if(o<.7)return si;let s=Math.floor(a*i)*100+Math.floor((o-oi)/.30000000000000004*6)*10,c=.08*Math.max(1,Math.min(100,r)),l=e=>Math.round(e*100)/100,u=ci(s+5),d=s+10,f=l(ci(d)*80),p=e=>({x:l((ci(e)*2-1)*c),y:l((ci(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+ci(d+1)*20)),shiftX:l((ci(d+2)*2-1)*1.5*c)}]}}function ui(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 di={effect:`fade`,durationIn:300,durationOut:250,easing:`ease`};function fi(e,t){return e===void 0?t:Array.isArray(e)?`cubic-bezier(${e.join(`,`)})`:e}var pi={"slide-up":`0 4cqw`,"slide-down":`0 -4cqw`,"slide-left":`4cqw 0`,"slide-right":`-4cqw 0`};function mi(e,t){let n={opacity:0},r={opacity:1},i=pi[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 hi(e,t){return e?{duration:e.duration,easing:fi(e.easing,`ease-out`),effect:e.effect}:{duration:t?di.durationIn:di.durationOut,easing:di.easing,effect:di.effect}}function gi(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 _i(e,t,n){let r=t.backgroundPatternColorRole||t.fillPatternColorRole,i=t.backgroundPatternBgColorRole||t.fillPatternBgColorRole,a=nt(t,null);if(e.style.backgroundColor=i?B(i,a.bgColor):a.bgColor,r){let i=et(t,n,`transparent`,`#000000`,`transparent`);if(i){e.classList.add(`oim-pat-dyn`),e.style.setProperty(`--oim-pat-fg`,B(r,a.fgColor)),e.style.setProperty(`--oim-pat-mask`,`url("`+i+`")`),e.style.backgroundImage=tt(t)?`url("`+et(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=et(t,n,o,a.fgColor);c&&(e.style.backgroundImage=`url("`+c+`")`),e.dataset.oimPat=s}var vi=`oim-trim-draw`,yi=`@keyframes oim-trim-draw {
|
|
53
53
|
from { stroke-dashoffset: var(--oim-trim-from); }
|
|
54
54
|
to { stroke-dashoffset: var(--oim-trim-to); }
|
|
55
|
-
}`;function
|
|
55
|
+
}`;function bi(e,t){if(!t||t<=0||!e.strokeWidth)return{};let n=e.trimStart??0,r=e.trimEnd??100,i=e.trimDuration??0;if(n<=0&&r>=100&&i<=0)return{};let a=Math.max(0,(r-n)/100)*t,o=t,s=-(n/100)*t||0,c={strokeDasharray:`${a} ${o}`,strokeDashoffset:s};return i>0&&(c[`--oim-trim-from`]=`${s+a}px`,c[`--oim-trim-to`]=`${s}px`,c.animation=`${vi} ${i}s ease-out forwards`),c}function xi(e){if(!e)return;let t=`oim-trim-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=yi,e.appendChild(n)}function Si(e,t){e.querySelectorAll(`path, circle, rect, polygon, polyline, ellipse, line`).forEach(function(e){try{let n=bi(t,e.getTotalLength());n.strokeDasharray&&(e.style.strokeDasharray=n.strokeDasharray,e.style.strokeDashoffset=String(n.strokeDashoffset??0)),n.animation&&(e.style.setProperty(`--oim-trim-from`,n[`--oim-trim-from`]||`0px`),e.style.setProperty(`--oim-trim-to`,n[`--oim-trim-to`]||`0px`),e.style.animation=n.animation)}catch{}})}var Ci=/^#[0-9a-fA-F]{3,8}$|^rgba?\([\d.,\s%]+\)$/;function wi(e,t){Math.max(1,Math.min(100,t?.intensity??15));let n=t?.baseFrequency??.8,r=`<feTurbulence type="fractalNoise" baseFrequency="${Math.max(.1,Math.min(2,n))}" numOctaves="${Math.max(1,Math.min(4,t?.numOctaves??3))}" stitchTiles="stitch"/>`,i=t?.color?.trim();return i&&Ci.test(i)?`<filter id="${e}">${r.replace(`/>`,` result="n"/>`)}<feColorMatrix in="n" type="luminanceToAlpha" result="a"/><feFlood flood-color="${i}"/><feComposite in2="a" operator="in"/></filter>`:`<filter id="${e}">${r}<feColorMatrix type="saturate" values="0"/></filter>`}var Ti=[`overlay`,`soft-light`,`multiply`],Ei=[`text`,`artistic-text`,`geo`,`shape`,`svg`,`draw`,`image`,`pattern`],Di=(e,t)=>typeof e==`number`&&Number.isFinite(e)?Math.max(1,Math.min(100,e)):t;function Oi(e){let t=Di(e,50);return Math.round((2-(t-1)*1.8/99)*1e3)/1e3}function ki(e,t){let n=Di(t?.intensity,20),r=Ti.includes(t?.blend)?t.blend:`overlay`,i=Math.round(n)/100;return`<filter id="${e}" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB"><feTurbulence type="fractalNoise" baseFrequency="${Oi(t?.size)}" numOctaves="3" seed="7" stitchTiles="stitch" result="n"/><feColorMatrix in="n" type="saturate" values="0" result="g"/><feComposite in="g" in2="SourceAlpha" operator="in" result="m"/><feComponentTransfer in="m" result="t"><feFuncA type="linear" slope="${i}"/></feComponentTransfer><feBlend in="t" in2="SourceGraphic" mode="${r}"/></filter>`}function Ai(e){let t=(e||``).trim();return/^#[0-9a-fA-F]{3,8}$/.test(t)||/^rgba?\([\d.,\s%]+\)$/.test(t)?t:`#ffffff`}function ji(e=`#ffffff`,t=.35,n=.75,r=3){let i=`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="${n}" numOctaves="${r}" stitchTiles="stitch" result="n"/><feColorMatrix in="n" type="luminanceToAlpha" result="a"/><feFlood flood-color="${Ai(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="128" height="128" filter="url(#g)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(i)}`}function Mi(e=`#ffffff`,t=.3){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><filter id="d"><feTurbulence type="fractalNoise" baseFrequency="0.04 0.9" numOctaves="3" result="t1"/><feColorMatrix in="t1" type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -15" result="scratches"/><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" result="t2"/><feColorMatrix in="t2" type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 25 -22" result="dust"/><feMerge result="m"><feMergeNode in="scratches"/><feMergeNode in="dust"/></feMerge><feColorMatrix in="m" type="luminanceToAlpha" result="a"/><feFlood flood-color="${Ai(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="256" height="256" filter="url(#d)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(n)}`}function Ni(e=`#ffffff`,t=.25){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><filter id="vp"><feTurbulence type="fractalNoise" baseFrequency="0.02 0.04" numOctaves="4" result="t"/><feColorMatrix in="t" type="luminanceToAlpha" result="a"/><feFlood flood-color="${Ai(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="256" height="256" filter="url(#vp)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(n)}`}function Pi(e=`#ffffff`,t=.3){let n=`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><filter id="rc"><feTurbulence type="fractalNoise" baseFrequency="0.35 0.35" numOctaves="3" result="t"/><feColorMatrix in="t" type="luminanceToAlpha" result="a"/><feFlood flood-color="${Ai(e)}"/><feComposite in2="a" operator="in"/></filter><rect width="128" height="128" filter="url(#rc)" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(n)}`}function Fi(e=`#ffffff`,t=.25,n=16,r=2.5){let i=Ai(e),a=Math.max(.01,Math.min(1,t)),o=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}"><circle cx="${n/2}" cy="${n/2}" r="${r}" fill="${i}" opacity="${a}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(o)}`}function Ii(e=`#ffffff`,t=.2,n=8,r=1){let i=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}"><rect width="${n}" height="${r}" fill="${Ai(e)}" opacity="${Math.max(.01,Math.min(1,t))}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(i)}`}function Li(e=`#ffffff`,t=.25,n=32){let r=Ai(e),i=Math.max(.01,Math.min(1,t)),a=n/2-1,o=n/4,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}"><circle cx="${n/2}" cy="${n/2}" r="${a}" fill="none" stroke="${r}" stroke-width="1.5" opacity="${i}"/><circle cx="${n/2}" cy="${n/2}" r="${o}" fill="none" stroke="${r}" stroke-width="1.5" opacity="${i}"/></svg>`;return`data:image/svg+xml;utf8,${encodeURIComponent(s)}`}var Ri={"film-grain-35mm":{defaultBlend:`overlay`,defaultIntensity:35,tileWidth:128,tileHeight:128,getDataUri:(e=`#ffffff`,t)=>ji(e,(t===void 0?35:t)/100,.75,3)},"fine-noise":{defaultBlend:`overlay`,defaultIntensity:25,tileWidth:128,tileHeight:128,getDataUri:(e=`#ffffff`,t)=>ji(e,(t===void 0?25:t)/100,.95,2)},"dust-scratches":{defaultBlend:`screen`,defaultIntensity:30,tileWidth:256,tileHeight:256,getDataUri:(e=`#ffffff`,t)=>Mi(e,(t===void 0?30:t)/100)},"vintage-paper":{defaultBlend:`multiply`,defaultIntensity:25,tileWidth:256,tileHeight:256,getDataUri:(e=`#ffffff`,t)=>Ni(e,(t===void 0?25:t)/100)},"rough-canvas":{defaultBlend:`overlay`,defaultIntensity:30,tileWidth:128,tileHeight:128,getDataUri:(e=`#ffffff`,t)=>Pi(e,(t===void 0?30:t)/100)},"halftone-dots":{defaultBlend:`overlay`,defaultIntensity:25,tileWidth:16,tileHeight:16,getDataUri:(e=`#ffffff`,t)=>Fi(e,(t===void 0?25:t)/100,16,2.5)},scanlines:{defaultBlend:`overlay`,defaultIntensity:20,tileWidth:8,tileHeight:8,getDataUri:(e=`#ffffff`,t)=>Ii(e,(t===void 0?20:t)/100,8,1)},"concentric-rings":{defaultBlend:`soft-light`,defaultIntensity:25,tileWidth:32,tileHeight:32,getDataUri:(e=`#ffffff`,t)=>Li(e,(t===void 0?25:t)/100,32)}},zi=`oim-parallax-track`,Bi=`oim-parallax-pista`,Vi=1,Hi=`@keyframes oim-parallax-infinite {
|
|
56
56
|
0% { transform: translateX(0px); }
|
|
57
57
|
100% { transform: translateX(calc(-1 * var(--oim-parallax-unit, 0px))); }
|
|
58
58
|
}
|
|
59
|
-
.${
|
|
60
|
-
.${
|
|
59
|
+
.${zi}, .${Bi} { display: flex; width: max-content; will-change: transform; }
|
|
60
|
+
.${zi}:hover, .${Bi}:hover { animation-play-state: var(--oim-parallax-hover, running); }
|
|
61
61
|
@media (prefers-reduced-motion: reduce) {
|
|
62
|
-
.${
|
|
63
|
-
}`;function
|
|
62
|
+
.${zi}, .${Bi} { animation: none !important; }
|
|
63
|
+
}`;function Ui(e,t,n=t){if(!e||typeof e.speedPxSec!=`number`||!Number.isFinite(e.speedPxSec)||e.speedPxSec<=0||typeof t!=`number`||!Number.isFinite(t)||t<=0)return{duplicate:!1,copies:0,container:{},copy:{},secondCopy:{}};let r=e.mirror?2:1,i=t*r,a=Math.ceil((Number.isFinite(n)&&n>0?n:t)/t)+r;e.mirror&&a%2!=0&&(a+=1);let o=i/e.speedPxSec;if(!Number.isFinite(o)||o<=0)return{duplicate:!1,copies:0,container:{},copy:{},secondCopy:{}};let s={"align-self":`flex-start`,"flex-shrink":`0`,"--oim-parallax-unit":`${i}px`,"--oim-parallax-unidad":`${i}px`,"animation-name":`oim-parallax-infinite`,"animation-duration":`${o}s`,"animation-timing-function":`linear`,"animation-iteration-count":`infinite`,"animation-direction":e.direction===`left_to_right`?`reverse`:`normal`};e.pauseOnHover&&(s[`--oim-parallax-hover`]=`paused`);let c=(t+Vi)/t,l={flex:`0 0 ${t}px`,"transform-origin":`0 0`,transform:`scaleX(${c})`},u={};return e.mirror&&(u.transform=`translateX(${t+Vi}px) scaleX(-1) scaleX(${c})`),{duplicate:!0,copies:a,container:s,copy:l,secondCopy:u}}function Wi(e){if(!e)return;let t=`oim-parallax-styles`;if(e.getElementById(t))return;let n=e.head||e,r=(e.ownerDocument||e).createElement(`style`);r.id=t,r.textContent=Hi,n.appendChild(r)}var Gi=8;function Ki(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[];for(let e of t){let t=n[n.length-1];t&&e.y-t[0].y<=Gi?t.push(e):n.push([e])}return n.flatMap(e=>e.sort((e,t)=>e.x-t.x))}function qi(e,t,n){let r=X(e.alt,t)??X(e.alt,n);return typeof r==`string`?r.trim():``}function Ji(e,t,n,r=!0){let i=[];for(let a of e||[]){if(!a||a.type===`group`||a.type===`mask`||a.type===`filter`||Array.isArray(a.languages)&&!a.languages.includes(`*`)&&!a.languages.includes(t))continue;let e=a.style||{};if(e.isVisible===!1)continue;let o=e.decorative===!0?``:qi(e,t,n),s=a.type&&a.type!==`text`&&a.type!==`artistic-text`?``:Hn(Le(a.content,t),e.marks).trim(),c=r&&(a.isInteractive===!0||e.isInteractive===!0||a.interaction&&a.interaction.action_type===`toggle_elements`),l=null;c?l={type:`button`,label:s||o||u(`button`,t),slotId:String(a.id)}:s&&e.decorative!==!0?l={type:`text`,lang:t,text:s}:o&&(l={type:`image`,label:o});let d=Array.isArray(a.position)?a.position:[0,0];l&&i.push({x:Number(d[0])||0,y:Number(d[1])||0,node:l})}return Ki(i).map(e=>e.node)}function Yi(e,t,n,r=n){let i=X(e&&e.description,n)??X(e&&e.description,r);if(typeof i==`string`&&i.trim())return i.trim();let a=t.find(e=>e.type===`text`);return a&&a.type===`text`?a.text:u(`image`,n)}function Xi(e){let t=`${e.x}% ${e.y}%`;return{objectFit:`cover`,objectPosition:t,transform:`scale(${e.zoom})`,transformOrigin:t}}function Zi(e,t){return!e&&!t?null:[e?-1:1,t?-1:1]}var Qi=`http://www.w3.org/2000/svg`,$i=0;function ea(e,t,n,r,i){let a=`oim-image-fill-${++$i}`,[o,s,c,l]=n.viewBox.trim().split(/\s+/).map(Number),u=c===l?`scale(${1/c})`:`scale(${1/c} ${1/l})`,d=o||s?`${u} translate(${-o} ${-s})`:u,f=document.createElement(`div`);f.className=`oim-image-fill`,f.style.position=`absolute`,f.style.left=`0`,f.style.top=`0`,f.style.width=`100%`,f.style.height=`100%`,f.style.overflow=`hidden`,f.style.pointerEvents=`none`,f.style.clipPath=`url(#${a})`;let p=document.createElementNS(Qi,`svg`);p.setAttribute(`width`,`0`),p.setAttribute(`height`,`0`),p.style.position=`absolute`;let m=document.createElementNS(Qi,`clipPath`);m.setAttribute(`id`,a),m.setAttribute(`clipPathUnits`,`objectBoundingBox`);let h=document.createElementNS(Qi,n.rect?`rect`:`path`);n.rect?(h.setAttribute(`x`,`0`),h.setAttribute(`y`,`0`),h.setAttribute(`width`,`1`),h.setAttribute(`height`,`1`),h.setAttribute(`rx`,String(n.rect.rx)),h.setAttribute(`ry`,String(n.rect.ry))):(h.setAttribute(`d`,n.d),h.setAttribute(`transform`,d)),m.appendChild(h),p.appendChild(m),f.appendChild(p);let g=Xi(t.crop??{x:50,y:50,zoom:1}),_=document.createElement(`img`);_.alt=``,_.draggable=!1,_.style.width=`100%`,_.style.height=`100%`,_.style.display=`block`,_.style.objectFit=g.objectFit,_.style.objectPosition=g.objectPosition;let v=Zi(t.flipX,t.flipY);_.style.transform=v?`${g.transform} scale(${v[0]}, ${v[1]})`.trim():g.transform,_.style.transformOrigin=g.transformOrigin,_.style.filter=_e(it(t.filters))??``,_.addEventListener(`error`,()=>{if(f.remove(),i){if(n.rect)e.style.backgroundColor=i;else for(let t of Array.from(e.children))if(t.tagName.toLowerCase()===`svg`)for(let e of Array.from(t.children))e.setAttribute(`fill`,i)}}),_.src=r,f.appendChild(_),e.insertBefore(f,e.firstChild)}function ta(e,t){return{left:`0px`,top:`0px`,width:t.width+`px`,height:t.height+`px`,transformOrigin:e.x+e.width/2+`px `+(e.y+e.height/2)+`px`,pointerEvents:`none`}}var na=1.25,ra=.5;function ia(e){let t=e&&e.lineHeight,n;if(typeof t==`number`)n=t;else if(typeof t==`string`&&t.trim()!==``)n=Number(t);else return na;return!Number.isFinite(n)||n<=0?na:Math.min(3,Math.max(ra,n))}var aa=1.4;function oa(e){(!Number.isFinite(e)||e<=0)&&(e=na);let t=aa-e;return t<=0?0:Math.round(t/2*1e4)/1e4}function sa(e){return e.isParallaxGroup?`hidden`:e.isText||e.hasFilterOrShadow||e.hasKeyframes?`visible`:`hidden`}function ca(e){e.style.minWidth=`24px`,e.style.minHeight=`24px`}function la(e,t,n,r,i){if(!t)return;let a={},o=t=>{let i=da(t||{});for(let t of Object.keys(i))a[t]===void 0&&(a[t]=e.style.getPropertyValue(t));n(e,i),t?.actions&&t.actions.length>0&&r&&r.run(t.actions,`hover`)},s=()=>{n(e,a),t.hover?.actions&&t.hover.actions.length>0&&r&&r.revert(t.hover.actions)},c=t.active?.actions;r&&(e.addEventListener(`click`,()=>{r.run(c||[],`click`)}),e.style.cursor=`pointer`),e.addEventListener(`mouseenter`,()=>o(t.hover)),e.addEventListener(`mouseleave`,s),e.addEventListener(`pointerdown`,n=>{n.pointerType!==`mouse`&&(o(t.hover),i&&i(e,s))})}function ua(e){return e<=10?e:e/100}function da(e){let t={};return e.scale!==void 0&&(t[`--oim-slot-hover-scale`]=String(ua(e.scale))),e.rotation!==void 0&&(t[`--oim-rot`]=`${e.rotation}deg`),e.opacity!==void 0&&(t.opacity=String(e.opacity/100)),e.color&&(t.color=e.color),e.transitionDuration!==void 0&&(t[`--oim-transition-duration`]=`${e.transitionDuration}s`),t}function fa(e,t){let n={},r={};if(!e||e.length===0)return{visibility:n,texts:r};for(let i of e){let e=i.target;if(!e)continue;let a=t[e]===void 0||t[e];i.type===`show`?n[e]=!0:i.type===`hide`?n[e]=!1:i.type===`toggle`?n[e]=!a:i.type===`setText`&&(r[e]=i.value!==void 0&&i.value!==null?String(i.value):``)}return{visibility:n,texts:r}}function pa(e,t,n,r=`arc`){let i=t/2,a=Math.max(-100,Math.min(100,n));if(a===0)return`M 0 ${i} L ${e} ${i}`;let o=t*.45,s=a/100*o;if(r===`wave`)return`M 0 ${i} C ${e*.25} ${i-s}, ${e*.75} ${i+s}, ${e} ${i}`;let c=i+s*.5,l=i-s;return`M 0 ${c} Q ${e/2} ${l} ${e} ${c}`}function ma(e,t,n){let r=String(e??``).split(/\r\n|\r|\n/),i=t*n,a=(r.length-1)/2;return r.map((e,t)=>({text:e,offset:(t-a)*i}))}function ha(e,t){if(typeof e!=`string`||!e.startsWith(`#`))return e;let n=e.slice(1);if(n.length===3&&(n=n.split(``).map(e=>e+e).join(``)),n.length!==6)return e;let r=parseInt(n,16);if(Number.isNaN(r))return e;let i=e=>Math.max(0,Math.min(255,Math.floor(e*(1-t)))),a=i(r>>16),o=i(r>>8&255),s=i(r&255);return`#${((1<<24)+(a<<16)+(o<<8)+s).toString(16).slice(1)}`}function ga(e,t,n=`#111827`,r=!0){let i=Math.max(0,Math.min(60,e));if(i===0)return[];let a=t*Math.PI/180,o=Math.cos(a),s=Math.sin(a),c=Math.max(1,Math.round(i)),l=[];for(let e=c;e>=1;e--){let t=e/c,i=Math.round(o*e*10)/10,a=Math.round(s*e*10)/10,u=r?ha(n,1-t*.5):n;l.push({dx:i,dy:a,color:u,opacity:1})}return l}function _a(e,t,n){let r=e.text,i=r.artistic??{},a=r.content,o=a[t]||a.es||a.en||Object.values(a)[0]||`CARTEL`,s=(e,t)=>typeof e==`number`?e:e&&typeof e==`object`&&typeof e.value==`number`?e.value:t,c=e.box,l=c.width||400,u=c.height||120,d=r.font?.size,f=(d&&typeof d==`object`&&`modes`in d?d.modes[t]:void 0)??s(d,48),p=r.font?.weight,m=e.fills?.[0],h=t=>e.strokes?.find(e=>e.align===t),g=h(`outside`),_=h(`inside`),v=i.curve?.amount??0,y=i.extrusion;return{text:String(o),width:l,height:u,fontFamily:r.font?.family||`Bangers`,fontSize:f,bold:p===`bold`||Number(p)>=700,letterSpacing:r.letterSpacing??0,lineHeight:ia({lineHeight:r.lineHeight}),fillColor:(m?.kind===`color`?n(m.value):void 0)||`#FBBF24`,curvePathD:pa(l,u,v,i.curve?.type??`arc`),isCurved:v!==0,extrusionLayers:ga(y?.depth??0,y?.angle??45,y?.color!==void 0&&n(y.color)||`#111827`,y?.shading!==!1),outerStrokeColor:g?n(g.paint.value):void 0,outerStrokeWidth:g?s(g.width,0):0,innerStrokeColor:_?n(_.paint.value):void 0,innerStrokeWidth:_?s(_.width,0):0,textGradientType:m?.kind===`gradient`&&m.preset?m.preset:`none`}}function va(e,t=`artistic-text`){let n=`curve-path-${t}`,r=`artistic-grad-${t}`,i=e.fillColor,a=``;e.textGradientType===`sunset-gold`?(i=`url(#${r})`,a=`
|
|
64
64
|
<linearGradient id="${r}" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
65
65
|
<stop offset="0%" stop-color="#FDE047" />
|
|
66
66
|
<stop offset="50%" stop-color="#F97316" />
|
|
@@ -79,7 +79,7 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
|
|
|
79
79
|
<stop offset="100%" stop-color="#A5F3FC" />
|
|
80
80
|
</linearGradient>`);let o=`${e.fontFamily}, sans-serif`,s=e.bold?`bold`:`normal`,c=e.letterSpacing?`letter-spacing="${e.letterSpacing}px"`:``,l=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`),u=t=>{let r=``;return r=e.isCurved?`${e.extrusionLayers.map(r=>`<text font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} fill="${r.color}" stroke="${r.color}" stroke-width="${e.outerStrokeWidth>0?e.outerStrokeWidth:1}" stroke-linejoin="round" transform="translate(${r.dx}, ${r.dy})" opacity="${r.opacity}"><textPath href="#${n}" startOffset="50%" text-anchor="middle">${t}</textPath></text>`).join(`
|
|
81
81
|
`)}\n${e.outerStrokeWidth>0&&e.outerStrokeColor?`<text font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} fill="none" stroke="${e.outerStrokeColor}" stroke-width="${e.outerStrokeWidth*2}" stroke-linejoin="round"><textPath href="#${n}" startOffset="50%" text-anchor="middle">${t}</textPath></text>`:``}\n${`<text font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} fill="${i}" stroke="${e.innerStrokeWidth>0?e.innerStrokeColor||`#FFFFFF`:`none`}" stroke-width="${e.innerStrokeWidth>0?e.innerStrokeWidth:0}" paint-order="stroke fill" stroke-linejoin="round"><textPath href="#${n}" startOffset="50%" text-anchor="middle">${t}</textPath></text>`}`:`${e.extrusionLayers.map(n=>`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="${n.color}" stroke="${n.color}" stroke-width="${e.outerStrokeWidth>0?e.outerStrokeWidth:1}" stroke-linejoin="round" transform="translate(${n.dx}, ${n.dy})" opacity="${n.opacity}">${t}</text>`).join(`
|
|
82
|
-
`)}\n${e.outerStrokeWidth>0&&e.outerStrokeColor?`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="none" stroke="${e.outerStrokeColor}" stroke-width="${e.outerStrokeWidth*2}" stroke-linejoin="round">${t}</text>`:``}\n${`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="${i}" stroke="${e.innerStrokeWidth>0?e.innerStrokeColor||`#FFFFFF`:`none`}" stroke-width="${e.innerStrokeWidth>0?e.innerStrokeWidth:0}" paint-order="stroke fill" stroke-linejoin="round">${t}</text>`}`,r},d=
|
|
82
|
+
`)}\n${e.outerStrokeWidth>0&&e.outerStrokeColor?`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="none" stroke="${e.outerStrokeColor}" stroke-width="${e.outerStrokeWidth*2}" stroke-linejoin="round">${t}</text>`:``}\n${`<text x="50%" y="50%" font-family="${o}" font-size="${e.fontSize}" font-weight="${s}" ${c} text-anchor="middle" dominant-baseline="central" fill="${i}" stroke="${e.innerStrokeWidth>0?e.innerStrokeColor||`#FFFFFF`:`none`}" stroke-width="${e.innerStrokeWidth>0?e.innerStrokeWidth:0}" paint-order="stroke fill" stroke-linejoin="round">${t}</text>`}`,r},d=ma(e.text||``,e.fontSize,e.lineHeight).map(e=>`<g transform="translate(0, ${e.offset})">${u(l(e.text))}</g>`).join(`
|
|
83
83
|
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 ${e.width} ${e.height}" preserveAspectRatio="xMidYMid meet" overflow="visible" style="pointer-events:none;">
|
|
84
84
|
<defs>
|
|
85
85
|
${a}
|
|
@@ -88,6 +88,6 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
|
|
|
88
88
|
<g>
|
|
89
89
|
${d}
|
|
90
90
|
</g>
|
|
91
|
-
</svg>`}function
|
|
92
|
-
`){e.appendChild(document.createElement(`br`));continue}let o=document.createElement(`span`);o.textContent=a===` `?`\xA0`:a,o.style.display=`inline-block`,o.style.animationName=Xr,o.style.animationDuration=Yr+`s`,o.style.animationTimingFunction=`linear`,o.style.animationIterationCount=`infinite`,o.style.animationDelay=Qr(t,n,r)+`s`,e.appendChild(o)}}function ma(e,t,n,r,i){e.textContent=``,Rn(t,n).forEach((t,a)=>{if(/^\s+$/.test(t)){e.appendChild(document.createTextNode(t));return}let o=document.createElement(`span`);o.textContent=t,o.className=`oim-entrance`;let s=o.style;if(s.display=`inline-block`,s.animation=`oim-entrance-${n} ${Nn}s linear ${zn(a,r,i)}s both`,!Ln(n)){e.appendChild(o);return}let c=document.createElement(`span`);c.className=`oim-entrance-clip`,c.style.display=`inline-block`,c.style.overflow=`hidden`,c.style.verticalAlign=`top`,c.appendChild(o),e.appendChild(c)})}function ha(e,t){if(!e)return;let n=`oim-entrance-`+t;if(e.getElementById(n))return;let r=Vn(t),i=r.some(e=>e.rotateDeg!==0),a=r.map((e,t)=>`${t*100/(r.length-1)}%{opacity:${e.opacity};transform:translateY(${e.translateYEm}em) scale(${e.scale})${i?` rotate(${e.rotateDeg}deg)`:``}}`).join(``),o=document.createElement(`style`);o.id=n,o.textContent=`@keyframes ${n}{${a}}@media (prefers-reduced-motion: reduce){.oim-entrance{animation:none!important}}`,e.appendChild(o)}function ga(e){if(!e)return;let t=`oim-wave-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=Zr(),e.appendChild(n)}function _a(e,t,n){let r=0,i=performance.now(),a=null,o=()=>r+(a===null?0:performance.now()-i),s=()=>t(o()/1e3),c=()=>{a===null&&(i=performance.now(),a=setInterval(s,e))},l=()=>{a!==null&&(r=o(),clearInterval(a),a=null)};return c(),{pause:l,play:c,stop:()=>{l(),n?.()}}}function va(e,t,n=20,r=0,i=!0){let a=a=>{let o=li(t,a,n,r,i,!1);e.textContent=o.visibleText+(o.showCursor?`|`:``)};return a(0),_a(40,a)}function ya(e,t,n,r=1,i=0,a=50){e.textContent=``,e.style.display=`inline-block`,e.style.position=`relative`;let o=()=>{let e=document.createElement(`span`);return e.textContent=t,e},s=ri(n,ni(0)).copies.map(e=>{let t=o();t.setAttribute(`aria-hidden`,`true`);let n=t.style;return n.position=`absolute`,n.left=`0`,n.top=`0`,n.width=`100%`,n.height=`100%`,n.pointerEvents=`none`,n.opacity=`0`,e.color&&(n.color=e.color),t}),c=o();c.style.position=`relative`,n===`glitch-slice`?e.append(c,...s):e.append(...s,c);let l=t=>{let o=ri(n,ni(t,r,i,a));e.style.transform=o.skewX?`skewX(${o.skewX}deg)`:`none`,o.copies.forEach((e,t)=>{let n=s[t].style;n.opacity=String(e.opacity),n.transform=`translate(${e.dx}px, ${e.dy}px)`,e.clip&&(n.clipPath=`inset(${e.clip.top}% 0 ${100-e.clip.bottom}% 0)`)})};return _a(33,l,()=>l(0))}function ba(e,t){if(!t?.enabled)return;let n=t.color||`rgba(245,158,11,.35)`,r=t.style===`underline-thick`,i=e.style;i.backgroundColor=r?`transparent`:n,r&&(i.boxShadow=`inset 0 -.4em 0 ${n}`),i.borderRadius=t.style===`pill`?`9999px`:t.style===`box`?`0`:`${t.borderRadius??3}px`,i.padding=`${t.paddingY??2}px ${t.paddingX??4}px`,i.boxDecorationBreak=i.webkitBoxDecorationBreak=`clone`}function xa(e,t,n,r){if(!n?.enabled||!t)return!1;let{letter:i,rest:a}=kn(t,Object.keys(r??{}));if(!i)return!1;let o=document.createElement(`span`),s=o.style,c=On(n);return o.textContent=i,s.float=`left`,s.fontSize=`${c.scale}em`,s.lineHeight=String(c.lineHeight),s.marginRight=`${c.marginRight}px`,c.fontFamily&&(s.fontFamily=c.fontFamily),c.color&&(s.color=c.color),s.fontWeight=String(c.fontWeight),s.userSelect=`none`,Dn(e,a,r),e.prepend(o),!0}function Sa(e){if(e.length<2)return 0;let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)}function Ca(e,t){let n=(e||``).replace(`#`,``),r=parseInt(n.substring(t*2,t*2+2),16)||0;return Math.round(r/255*1e3)/1e3}function wa(e,t){let n=`http://www.w3.org/2000/svg`,r=e.style||{},i=t.width,a=t.height,o=Array.isArray(e.position)?e.position:[0,0],s=typeof e.x==`number`?e.x:Number(o[0])/100*i,c=typeof e.y==`number`?e.y:Number(o[1])/100*a,l=document.createElementNS(n,`svg`);l.setAttribute(`viewBox`,`0 0 `+i+` `+a),l.setAttribute(`preserveAspectRatio`,`none`),l.style.position=`absolute`,l.style.left=-s+`px`,l.style.top=-c+`px`,l.style.width=i+`px`,l.style.height=a+`px`,l.style.flex=`none`,l.style.overflow=`visible`,l.style.display=`block`,l.style.pointerEvents=`none`;let u=document.createElementNS(n,`path`);u.setAttribute(`d`,Rr(e,t)),u.setAttribute(`fill`,z(r.maskBgColorRole||r.fillColorRole,r.maskBgColor||`#38BDF8`)),u.setAttribute(`fill-rule`,`evenodd`),l.appendChild(u);let d=r.maskStrokeWidth??0;if(d>0){let i=document.createElementNS(n,`path`);i.setAttribute(`d`,zr(e,t)),i.setAttribute(`fill`,`none`),i.setAttribute(`stroke`,z(r.maskStrokeColorRole||r.strokeColorRole,r.maskStrokeColor||`#FFFFFF`)),i.setAttribute(`stroke-width`,String(d)),i.setAttribute(`stroke-linejoin`,`round`),l.appendChild(i)}return l}function Ta(e,t){let n=`http://www.w3.org/2000/svg`,r=document.createElementNS(n,`svg`);r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`style`,`position:absolute`),r.setAttribute(`aria-hidden`,`true`);let i=document.createElementNS(n,`defs`);return r.appendChild(i),e.forEach(function(e){let r=e.style||{};if(e.type===`mask`&&r.maskMode===`cutout`){let a=r.maskFeather,o=Wr(e,t);if(a&&a>0){let r=Hr(e)+`-blur`,s=document.createElementNS(n,`filter`);s.setAttribute(`id`,r),s.setAttribute(`filterUnits`,`userSpaceOnUse`),s.setAttribute(`x`,`0`),s.setAttribute(`y`,`0`),s.setAttribute(`width`,String(t.width)),s.setAttribute(`height`,String(t.height));let c=document.createElementNS(n,`feGaussianBlur`);c.setAttribute(`stdDeviation`,String(a)),s.appendChild(c),i.appendChild(s);let l=document.createElementNS(n,`mask`);l.setAttribute(`id`,Hr(e)),l.setAttribute(`maskUnits`,`userSpaceOnUse`);let u=document.createElementNS(n,`rect`);u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,String(t.width)),u.setAttribute(`height`,String(t.height)),u.setAttribute(`fill`,`black`),l.appendChild(u);let d=document.createElementNS(n,`g`);d.setAttribute(`filter`,`url(#`+r+`)`);let f=document.createElementNS(n,`path`);f.setAttribute(`d`,o),f.setAttribute(`fill`,`white`),f.setAttribute(`clip-rule`,`evenodd`),f.setAttribute(`fill-rule`,`evenodd`),d.appendChild(f),l.appendChild(d),i.appendChild(l)}else{let t=document.createElementNS(n,`clipPath`);t.setAttribute(`id`,Ir(e)),t.setAttribute(`clipPathUnits`,`userSpaceOnUse`);let r=document.createElementNS(n,`path`);r.setAttribute(`d`,o),r.setAttribute(`clip-rule`,`evenodd`),t.appendChild(r),i.appendChild(t)}}if(e.type===`filter`&&e.duotone){let t=document.createElementNS(n,`filter`);t.setAttribute(`id`,Vr(e));let r=document.createElementNS(n,`feColorMatrix`);r.setAttribute(`type`,`matrix`),r.setAttribute(`values`,`0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 1 0`),t.appendChild(r);let a=document.createElementNS(n,`feComponentTransfer`);[`R`,`G`,`B`].forEach(function(e,t){let r=document.createElementNS(n,`feFunc`+e);r.setAttribute(`type`,`table`);let i=t;r.setAttribute(`tableValues`,Ca(Br.shadows,i)+` `+Ca(Br.lights,i)),a.appendChild(r)}),t.appendChild(a),i.appendChild(t)}}),r}function Ea(e,t,n){let r=n.get(e.shape.id);r&&(e.clipPath&&(r.style.clipPath=e.clipPath),e.maskStyle&&(r.style.mask=e.maskStyle),t.appendChild(r))}var Da=1200,Oa=class{updateScale(){}sceneReady(){}updateViewportSize(){}host;poster=`auto`;metadata=null;securityStatus=`unsigned`;embeddedFontFamilies=new Map;imageUrl=null;lang;showControls;activeSlotId=null;zoom=1;panX=0;panY=0;_stage=null;_viewport=null;_baseImg=null;_overlay=null;_lottieInstances=[];_onDragMove=null;_onDragEnd=null;_animations=[];_textAnimations=[];_paused=!1;_revealAnims=new Map;_timelines=new Map;_warnedPlay=new Set;_heldTimelines=new Set;_isStill(){let e=this.host;if(!this.disableAnimations||!e||typeof e.getAttribute!=`function`)return!1;let t=e.getAttribute(`disable-animations`);return t!==null&&t!==`false`||e.getAttribute(`mode`)===`image`}_resizeObserver=null;_onFullscreenChange=null;_retryViewportSize=!1;allowZoom;showLanguageSelector;showSlots;allowLottie;allowDynamicColors=!0;disableAnimations;disableActions;dropdownBlur;fit;align;_deviceProfile;applyPalette(){let e=this._viewport;if(!e)return;let t=typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches,n=this.allowDynamicColors?R(this.metadata??{},{requested:this.host.getAttribute(`palette`),prefersDark:t}):null;for(let t of ce){let r=n?.colors[t];r?e.style.setProperty(`--oim-palette-`+t,r):e.style.removeProperty(`--oim-palette-`+t)}}async renderSlots(e){if(!this.metadata||!this.host||this.poster===`only`)return;let t=(this.metadata.slots||this.metadata.elements||[]).some(function(e){return e.type===`mask`||e.type===`filter`}),n=e&&e.onlyIds&&e.onlyIds.size>0&&!t?e.onlyIds:null;if(this._viewport&&!this._revealed&&this._viewport.classList.remove(`oim-viewport--ready`),!this.showSlots){this._overlay&&(this._overlay.innerHTML=``),this._viewport&&this._viewport.classList.add(`oim-viewport--ready`),this.sceneReady();return}n?this._destroyLottiesIn(n):this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]);let r=this._overlay;if(!r)return;let i=this._viewport?this._viewport.querySelector(`.oim-noise-overlay`):null,a=Array.isArray(this.metadata?.effects)?this.metadata.effects.find(e=>e&&e.type===`texture`&&e.enabled!==!1):null;if(a){let e=ji[a.preset];if(e){let t=i||document.createElement(`div`);t.className=`oim-noise-overlay`,t.style.position=`absolute`,t.style.inset=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.pointerEvents=`none`,t.style.mixBlendMode=a.blend||e.defaultBlend||`overlay`;let n=(a.intensity===void 0?e.defaultIntensity:a.intensity)/100;t.style.opacity=n.toFixed(2),t.style.zIndex=`999`;let r=a.scale||1,o=e.tileWidth*r,s=e.tileHeight*r;t.style.backgroundImage=`url("${e.getDataUri(a.color)}")`,t.style.backgroundRepeat=`repeat`,t.style.backgroundSize=`${o}px ${s}px`,!i&&this._viewport&&this._viewport.appendChild(t)}}else if(this.metadata&&this.metadata.grain&&this.metadata.grain.enabled){let e=this.metadata.grain,t=e.intensity??15,n=e.blendMode??`overlay`,r=e.baseFrequency??.8,a=i||document.createElement(`div`);a.className=`oim-noise-overlay`,a.style.position=`absolute`,a.style.inset=`0`,a.style.width=`100%`,a.style.height=`100%`,a.style.pointerEvents=`none`,a.style.mixBlendMode=n,a.style.opacity=(t/100).toFixed(2),a.style.zIndex=`999`;let o=`oim-global-noise-filter`,s=_i(o,{intensity:t,baseFrequency:r,color:e.color}),c=`data:image/svg+xml;utf8,`+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs>${s}</defs><rect width="100%" height="100%" filter="url(#${o})"/></svg>`);a.style.backgroundImage=`url("${c}")`,!i&&this._viewport&&this._viewport.appendChild(a)}else i&&i.remove();let o=this,s=this.metadata.slots||this.metadata.elements||[],l=e=>{let t=String(e?.message??e);console.error(`[OimPlayer] A part of the player did not load; the work is shown without it.`,t),this.host.dispatchEvent(new CustomEvent(`oim:error`,{detail:{code:`chunk`,message:t}}))};await Ne().catch(l),await Qn(er([this.metadata,Array.from(X(this.metadata).values())])).catch(l);let u=X(o.metadata);s.forEach(function(e){let t=e&&e.type===`mask`?u.get(String(e.id)):void 0;if(t){e.style={...e.style,...Xe(t)};let{x:n,y:r,width:i,height:a}=t.box;Object.assign(e,{x:n,y:r,width:i??0,height:a??0})}});let d=[],f=o.metadata&&(o.metadata.artboardWidth||o.metadata.canvasWidth||o.metadata.canvas_width)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_width||o.metadata.canvas.width:0)||(o._baseImg&&o._baseImg.naturalWidth>0?o._baseImg.naturalWidth:1080),p=o.metadata&&(o.metadata.artboardHeight||o.metadata.canvasHeight||o.metadata.canvas_height)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_height||o.metadata.canvas.height:0)||(o._baseImg&&o._baseImg.naturalHeight>0?Math.round(f*(o._baseImg.naturalHeight/o._baseImg.naturalWidth)):1920);r.style.setProperty(`--oim-overlay-w`,f+`px`),r.style.setProperty(`--oim-overlay-h`,p+`px`);let m=document.createDocumentFragment(),h={},g=new Map,_=X(o.metadata);(this.metadata.zones||[]).forEach(e=>{let t=_.get(String(e?.id));if(!t||t.type!==`group`)return;let n=document.createElement(`div`);n.className=`oim-zone`,n.id=`oim-zone-`+t.id,n.style.position=`absolute`,n.style.inset=`0`;let r=t.children?.find(e=>e.id===t.id+`__background`),i=r?.fills?.[0],a=t.effects?.find(e=>e.kind===`backdrop`)?.blur;if(r||a){let e=t.box,s=document.createElement(`div`);s.className=`oim-zone-box`,s.style.position=`absolute`,s.style.left=e.x+`px`,s.style.top=e.y+`px`,s.style.width=(e.width??0)+`px`,s.style.height=(e.height??0)+`px`,i&&`kind`in i&&i.kind===`color`&&(s.style.background=Fe(o.metadata).css(i.value)||``),typeof r?.corners==`number`&&(s.style.borderRadius=r.corners+`px`),a&&(s.style.backdropFilter=`blur(`+a+`px)`,s.style.webkitBackdropFilter=s.style.backdropFilter),n.appendChild(s)}m.appendChild(n),h[t.id]=n;for(let e of t.children??[])g.set(e.id,t.id)});let v=Se(s),y=X(o.metadata),b=Fe(o.metadata),x=o.metadata.canvasFills?.[0];if(x&&o._overlay&&!n){let e=Pr(x,{colors:b,width:o.metadata.canvas_width,height:o.metadata.canvas_height});for(let[t,n]of Object.entries(e))o._overlay.style[t]=n}let ee=e=>e&&typeof e==`object`&&typeof e.fallback==`string`?b.literal(e.fallback):b.literal(e),S=s.map(async e=>{let t=e.type,r=y.get(String(e.id));if(n&&!n.has(String(e.id)))return null;let i=e.style||{};if(e.tracking_data,t===`mask`&&i.maskMode===`cutout`){let t=g.get(String(e.id));return t&&h[t]&&console.warn(`[OimPlayer] Slot "`+e.id+`" is a mask layer inside zone "`+t+`". Mask layers are only supported in the top-level slot stack, so this one will neither render nor clip anything. Move it out of the zone.`),null}if(!r)return console.warn(`[OimPlayer] Slot "`+e.id+`" has no 2.0 layer; it is not painted.`),null;let a=r.box,s=Ue(e,o.lang),l=r.type===`text`?r.text?.content:void 0,u=t===`image`?r.image:void 0,d=r.type===`shape`&&r.geometry?.kind===`paths`&&!dr(r.geometry).path?r.geometry:void 0,m=l?Re(l,o.lang):u?Ze(u.src,o.lang):d&&!Be(e)?$e(d,et(r,b.css)):r.type===`lottie`?r.lottie?.src??``:s.content,_=!o.disableActions&&(!!r.interactions?.length||!!r.animations?.some(e=>e.on===`hover`||e.on===`press`)),x=t===`mask`&&i.maskMode!==`cutout`,S=t===`artistic-text`,C=t===`geo`||t===`shape`||t===`draw`||t===`filter`||t===`container`||x||_||S,w=e.is_background_pattern===!0||e.id===`background-pattern-slot`;if(!(t===`group`&&v.has(String(e.id)))&&!(t===`pattern`||w)&&!m&&!(C&&(r.fills?.length||a.width!==void 0||t===`filter`||t===`container`||x||_||S)))return null;let T=ze(e,m),E=m,D=!1;T||(/<svg|<span|<div|<a|<img/i.test(E)&&(E=E.replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`)),D=!!d&&!Be(e));let te=!T&&(D||/<svg|<span|<div|<a|<img/i.test(E));E=E.replace(/\\n/g,`
|
|
93
|
-
`);let O=r.type===`text`?r.text?.align??`left`:`left`,k=`center`;O===`left`?k=`flex-start`:O===`right`&&(k=`flex-end`);let A=document.createElement(`div`);A.className=`oim-slot`,A.setAttribute(`part`,`slot`),A.setAttribute(`data-slot-id`,e.id),r.languages&&!r.languages.includes(o.lang)&&(A.style.display=`none`),A.style.zIndex=w?`0`:`1`;let ne=r.animations?.find(e=>e.on===`enter`&&e.preset);A._oimReveal=ne?{effect:ne.preset,duration:ne.duration,easing:ne.easing}:void 0;let re=!!r.interactions?.length;_||re&&!o.disableActions||A.setAttribute(`data-oim-passthrough`,``);let ie=r.fills?.[0],j=ie?.kind===`pattern`?ie.pattern:void 0,ae=j?kr(j,b):{};if(w){A.style.pointerEvents=`none`;let e=d?$e(d,et(r,b.literal),!0):``;if(e||j){if(ui(A,ae,e),(j?.fit===`cover`?`cover`:`tile`)==`cover`)A.style.backgroundSize=`cover`,A.style.backgroundRepeat=`no-repeat`,A.style.backgroundPosition=`center`,A.style.setProperty(`--oim-pat-size`,`cover`),A.style.setProperty(`--oim-pat-repeat`,`no-repeat`),A.style.setProperty(`--oim-pat-pos`,`center`);else{let e=160*(j?.scale||1)/f*100;A.style.backgroundSize=e.toFixed(4)+`cqw `+e.toFixed(4)+`cqw`,A.style.backgroundRepeat=`repeat`,A.style.setProperty(`--oim-bg-tile`,e.toFixed(4)+`cqw`)}let t=j?.motion,n=t?`background-animation-${t.direction} ${t.period||8}s linear infinite`:void 0;!o.disableAnimations&&typeof n==`string`&&n.indexOf(`background-animation-`)===0&&(A.style.animation=n),E=``,D=!1}}if(t===`pattern`){let e=dr(r.type===`shape`?r.geometry:void 0),t=Er({...ae,geoShape:e.round?`circle`:e.preset});for(let[e,n]of Object.entries(t))e.startsWith(`--`)?A.style.setProperty(e,n):A.style[e]=n;(ae.fillPatternColorRole||ae.fillPatternBgColorRole)&&ui(A,ae,``)}let M=document.createElement(`div`);M.className=`oim-slot-loop-wrap`;let N=document.createElement(`div`);N.className=`oim-slot-hover-wrap`,(D||T||t===`lottie`||S)&&(M.style.height=`100%`,N.style.height=`100%`);let P=null,oe=t===`text`?r.fills?.[0]:void 0;if(oe){let e=Pr(oe,{colors:b,isText:!0,width:r.box.width||f,height:r.box.height||p});P=Object.keys(e).length>0?e:null}let se=P!==null&&(P.backgroundClip===`text`||P.webkitBackgroundClip===`text`),ce=r.box.width!==void 0&&r.box.height!==void 0,le=se&&ce;if(T){let t=E.trim();if(t.startsWith(`<`)){let e=t.match(/src=["']([^"']+)["']/);e&&e[1]&&(t=e[1])}let n=jt(t),i=document.createElement(`img`);n?i.src=t:(console.warn(`[OimPlayer] Image not embedded in the file (network URLs are not loaded), slot:`,e.id),i.src=``),i.alt=``,i.draggable=!1,i.style.width=`100%`,i.style.height=`100%`;let a=u?.fit,o=u?.crop;if(i.style.objectFit=a||`cover`,o){let e=Wi(o);i.style.objectFit=e.objectFit,i.style.objectPosition=e.objectPosition,i.style.transform=e.transform,i.style.transformOrigin=e.transformOrigin,N.style.overflow=`hidden`}i.style.display=`block`,i.style.pointerEvents=`none`,i.style.filter=e.type===`image`?ve(Ye(r.image?.filters))??``:``,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,i.onerror=function(t){console.error(`[OimPlayer] Image slot failed to load for slot:`,e.id,`error:`,t),i.style.display=`none`},N.appendChild(i)}else if(t===`lottie`){let t=document.createElement(`div`);t.className=`oim-lottie-container`,t.style.width=`100%`,t.style.height=`100%`,N.appendChild(t),o.allowLottie?Hn().then(function(n){let r=typeof E==`string`&&(E.startsWith(`http`)||E.endsWith(`.json`)||E.trim().indexOf(`{`)!==0);if(r){console.warn(`[OimPlayer] Lottie animation must be a valid JSON string. External URLs are not supported.`);return}let i=n.loadAnimation({container:t,renderer:`svg`,loop:!o.disableAnimations,autoplay:!o.disableAnimations&&!o._paused,path:r?E.trim():void 0,animationData:r?void 0:JSON.parse(E)});o.disableAnimations&&i.goToAndStop(0,!0),o._lottieInstances.push({slotId:String(e.id),inst:i})}).catch(function(e){console.error(`[OIM Player] Error loading local Lottie bundle. Hiding dynamic element:`,e),A.style.display=`none`}):(console.warn(`[OIM Player] Lottie animation slot ${e.id} detected but allowLottie option is false. Hiding dynamic element.`),A.style.display=`none`)}else if(S){M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.display=`flex`,N.style.alignItems=`center`,N.style.justifyContent=`center`,N.style.pointerEvents=`none`;let t=da(r,o.lang,ee),n=gn(t.fontFamily,o.embeddedFontFamilies);n&&(t.fontFamily=n.replace(/, sans-serif$/,``));let i=fa(t,String(e.id));if(typeof DOMParser<`u`){let e=new DOMParser().parseFromString(i,`image/svg+xml`).documentElement;e&&N.appendChild(e)}else N.innerHTML=i}else if(te){let e=N;if(le){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let t=At(E);if(typeof DOMParser<`u`){let n=new DOMParser().parseFromString(t,`text/html`);for(;n.body.firstChild;)e.appendChild(n.body.firstChild)}else{let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}}else{let e=N;if(le){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let n=r.animations?.find(e=>e.on===`load`&&e.preset),i=n?.params??{},a={type:n?.preset,speed:i.speed,delay:n?.delay?+(n.delay/1e3).toFixed(6):void 0,cursor:i.cursor,intensity:i.intensity},s=a.type,c=(t===`text`?r.text:void 0)??{};ba(e,c.highlight);let l=c.marks,u=En(E,l);s===`wave-chars`&&!o.disableAnimations?(ga(o.host.shadowRoot),pa(e,u,typeof a.speed==`number`?a.speed:.05,typeof a.delay==`number`?a.delay:0)):In(s)&&!o.disableAnimations?(ha(o.host.shadowRoot,s),ma(e,u,s,a.speed,a.delay)):s===`typewriter`&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,va(e,u,a.speed,a.delay,a.cursor)):s?.startsWith(`glitch-`)&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,ya(e,u,s,a.speed,a.delay,a.intensity)):xa(e,E,c.dropCap,l)||Dn(e,E,l)}M.appendChild(N);let ue=r.motion?.loop,F=ue?{enabled:!0,speedPxSec:ue.speedPxSec,direction:ue.direction,mirror:ue.mirror??!0,pauseOnHover:!!ue.pauseOnHover}:void 0,I=!1;if(F&&F.enabled){let e=F.infinite||{},t=e.enabled===!1||o._isStill()?0:F.speedPxSec===void 0?e.speedPxSec===void 0?e.speed_px_sec===void 0?F.mode===`infinite_horizontal`?F.speed===void 0?20:F.speed:0:e.speed_px_sec:e.speedPxSec:F.speedPxSec,n=F.direction||e.direction||`right_to_left`,i=F.mirror===void 0?F.seamlessTile===void 0?e.mirror===void 0?e.seamlessTile===void 0?e.seamless_tile===void 0||!!e.seamless_tile:!!e.seamlessTile:!!e.mirror:!!F.seamlessTile:!!F.mirror,a=F.pauseOnHover===void 0?e.pauseOnHover===void 0?!!e.pause_on_hover:!!e.pauseOnHover:!!F.pauseOnHover,s=Ii({speedPxSec:Number(t)||0,direction:n,mirror:i,pauseOnHover:a},r.box.width||f||f,f);if(s.duplicate){I=!0,Li(o.host.shadowRoot);let e=document.createElement(`div`);e.className=`${Mi} ${Ni}`;for(let[t,n]of Object.entries(s.container))e.style.setProperty(t,n);for(let t=0;t<s.copies;t++){let n=t===0?M:M.cloneNode(!0);for(let[e,t]of Object.entries(s.copy))n.style.setProperty(e,t);if(t%2==1)for(let[e,t]of Object.entries(s.secondCopy))n.style.setProperty(e,t);e.appendChild(n)}A.appendChild(e)}}I||A.appendChild(M);let de=r.geometry?.trim,fe=r.animations?.find(e=>e.on===`load`&&e.tracks?.some(e=>e.property===`trimEnd`)),pe=e=>+(e*100).toFixed(6),L=de||fe?{strokeWidth:1,trimStart:pe(de?.start??0),trimEnd:pe(de?.end??1),trimDuration:fe?+(fe.duration/1e3).toFixed(6):0}:void 0;te&&L&&(L.trimDuration&&mi(o.host.shadowRoot),hi(N,L));let R=Le(r,o.lang),z={lineHeight:r.text?.lineHeight},me=R?.fontSize??`16px`,he=R?.fontFamily,ge=w?`none`:R?.maxWidth??(r.type===`text`&&!T?`80%`:`none`),_e=S||!T&&!D&&t!==`lottie`&&E.trim()!==``;if(he&&_e){let e=Ft(he),t=gn(e,o.embeddedFontFamilies);A.style.setProperty(`font-family`,t||e)}if(k=I||O===`left`?`flex-start`:O===`right`?`flex-end`:`center`,A.style.maxWidth=ge,A.style.fontSize=me,A.style.lineHeight=String(Qi(z)),R)for(let e of[`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`textDecoration`])R[e]&&(A.style[e]=R[e]);if(t===`text`&&oe){let e=`kind`in oe&&oe.kind===`color`?b.css(oe.value):``;e&&A.style.setProperty(`color`,e)}if(P){if(le){M.style.position=`absolute`,M.style.top=`0`,M.style.left=`0`,M.style.right=`0`,M.style.bottom=`0`,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.boxSizing=`border-box`,N.style.setProperty(`padding-right`,`0.25em`,`important`),N.style.display=`flex`,N.style.flexDirection=`column`,N.style.justifyContent=`center`,N.style.alignItems=k,Object.assign(N.style,P);let e=ea(Qi(z));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}else if(Object.assign(A.style,P),se){let e=ea(Qi(z));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}}A.style.textAlign=O,A.style.display=`flex`,A.style.flexDirection=`column`,A.style.justifyContent=`center`,A.style.alignItems=k,A.style.opacity=`0`,A.style.transition=`opacity 0.3s ease`,A.style.whiteSpace=`pre-line`,A.style.overflow=ta({isText:t===`text`,isParallaxGroup:!!r.motion?.loop||!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop),hasFilterOrShadow:!1,hasKeyframes:!!r.animations?.some(ka)});let ye=o.metadata?.canvas_width||o.metadata?.canvasWidth||(o.metadata?.canvas?o.metadata.canvas.natural_width:800);_&&na(A),a.width!==void 0&&a.height!==void 0?(A.style.width=(a.width/ye*100).toFixed(4)+`cqw`,A.style.height=(a.height/ye*100).toFixed(4)+`cqw`):(A.style.width=`max-content`,A.style.height=`auto`);let B=r.fills?.[0],V=B&&`kind`in B?B.kind:void 0,H=dr(r.type===`shape`?r.geometry:void 0),xe=(t===`svg`||D)&&!x&&(V===`pattern`||V===`generative`),Se=C&&!x&&V===`image`?String(B.src||``).trim():``,U=!!Se&&jt(Se),W=xe||(t===`geo`||t===`shape`)&&!x&&(U||V===`gradient`||V===`generative`||V===`pattern`&&!w),Ce=r.fills?.[1],we=V===`image`&&Ce?.kind===`color`?b.css(Ce.value):void 0,Te=V===`color`?b.css(B.value):U?void 0:we,Ee=r?.type===`shape`&&r.geometry?.kind===`paths`;Te&&C&&!x&&t!==`text`&&!S&&!W&&!Ee&&A.style.setProperty(`background-color`,Te);let De=t===`svg`||D||r.geometry?.kind===`paths`||C&&!!H.silhouette,Oe=y.get(String(e.id)),G=Oe?.strokes?.find(e=>!e.align&&`kind`in e.paint&&e.paint.kind===`color`&&typeof e.width==`number`),K=Oe?.type===`text`?{color:``,width:0,style:void 0}:G?{color:b.css(G.paint.value)||``,width:G.width,style:G.style}:{color:``,width:0,style:void 0};K.color&&K.width&&!x&&!De&&A.style.setProperty(`border`,`${K.width}px ${K.style||`solid`} ${K.color}`),Se&&!U&&console.warn(`[OimPlayer] Fill image not embedded in the file (network URLs are not loaded), slot:`,e.id);let q=C&&!x?H.silhouette:null;if(q){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`viewBox`,q.viewBox),t.setAttribute(`preserveAspectRatio`,`none`),t.style.position=`absolute`,t.style.left=`0`,t.style.top=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`block`,t.style.overflow=`visible`;let n=document.createElementNS(e,q.points?`polygon`:`path`);q.points?n.setAttribute(`points`,q.points):n.setAttribute(`d`,q.d);let r=H.fillable,i=r&&U;n.setAttribute(`fill`,r&&Te&&!W&&!i?Te:`none`);let a=G?K.width:0,o=G?K.color:``;a&&o&&(n.setAttribute(`stroke`,o),n.setAttribute(`stroke-width`,String(a)),n.setAttribute(`vector-effect`,`non-scaling-stroke`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`stroke-linecap`,`round`),K.style===`dashed`?n.setAttribute(`stroke-dasharray`,`6,4`):K.style===`dotted`&&n.setAttribute(`stroke-dasharray`,`2,3`)),t.appendChild(n),A.appendChild(t),i&&Ji(A,B,{d:q.d??`M `+q.points.split(` `).join(` L `)+` Z`,viewBox:q.viewBox},Se,we),A.style.backgroundColor=`transparent`,A.style.padding=`0`,A.style.overflow=`visible`}else C&&!x&&H.round&&(A.style.borderRadius=`50%`);if(U&&!q){let e=typeof r.corners==`number`?r.corners:0,t=r.box.width||f,n=r.box.height||p;Ji(A,B,{d:``,viewBox:`0 0 1 1`,rect:{rx:Math.min(Math.max(e/t,0),.5),ry:Math.min(Math.max(e/n,0),.5)}},Se,we)}if(W){let e=document.createElement(`div`);e.className=`oim-fill-layer`,e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.borderRadius=`inherit`;let t={...B?Pr(B,{colors:b,width:r.box.width||f,height:r.box.height||p}):{},...U&&Ce?.kind===`color`&&ee(Ce.value)?{backgroundColor:ee(Ce.value)}:{},...xe?Tr(E):Cr(H.round?`circle`:H.preset,H.path?{svgPath:H.path.d,svgViewBox:H.path.viewBox}:void 0)};xe&&!M.style.position&&(M.style.position=`relative`);for(let[n,r]of Object.entries(t))n.startsWith(`--`)?e.style.setProperty(n,r):e.style[n]=r;A.insertBefore(e,A.firstChild)}x&&(A.style.overflow=`visible`,A.style.display=`block`,A.style.setProperty(`padding`,`0`,`important`),A.appendChild(wa(e,{width:f,height:p}))),(!_e&&!x||I)&&A.style.setProperty(`padding`,`0`,`important`);let ke=g.get(String(e.id)),Ae=null;{let e=a;A.style.position=`absolute`;let t,n=`-50%`;if(e.width!==void 0&&e.height!==void 0){t=I||O===`left`?`0%`:O===`right`?`-100%`:`-50%`;let n=t===`0%`?0:t===`-100%`?1:.5;A.style.left=(e.x+e.width*n).toFixed(2)+`px`,n>0&&_e&&!S&&(A.style.left=`calc(${A.style.left} + ${.25*n}em)`),A.style.top=(e.y+e.height/2).toFixed(2)+`px`}else[t,n]=Je(e),I&&(t=`0%`),A.style.left=e.x.toFixed(2)+`px`,A.style.top=e.y.toFixed(2)+`px`;A.style.setProperty(`--oim-tx`,t),A.style.setProperty(`--oim-ty`,n),A.style.setProperty(`--oim-rot`,(e.rotation||0)+`deg`),Ae={x:e.x,y:e.y,width:e.width??0,height:e.height??0}}let J=be(e)&&!w&&Ae?Yi(Ae,{width:f,height:p}):null;w&&(A.style.left=`0`,A.style.top=`0`,A.style.width=`100%`,A.style.height=`100%`,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.padding=`0`,A.style.boxSizing=`border-box`,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-rot`,`0deg`));let je=y.get(String(e.id))?.type===`text`?(()=>{let t=y.get(String(e.id))?.strokes?.[0];return t&&`kind`in t.paint&&t.paint.kind===`color`&&typeof t.width==`number`?{width:t.width,color:b.css(t.paint.value)||``}:void 0})():void 0;je&&(A.style.setProperty(`-webkit-text-stroke`,je.width+`px `+je.color),A.style.setProperty(`paint-order`,`stroke fill`));let Me=e=>{let n=ji[e.preset];if(n){if(t===`text`||t===`artistic-text`){let t=e.scale||1,i=n.tileWidth*t,a=n.tileHeight*t,o=r.fills?.[0],s=o?.kind===`color`&&b.css(o.value)||`#18181b`,c=o?.kind===`gradient`?Pr(o,{colors:b}).backgroundImage:void 0,l=e.blend||n.defaultBlend||`overlay`;c?(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), `+c,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l+`, normal`):(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), linear-gradient(`+s+`, `+s+`)`,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l),A.style.webkitBackgroundClip=`text`,A.style.backgroundClip=`text`,A.style.webkitTextFillColor=`transparent`,A.style.color=`transparent`;let u=ea(Qi(z));u>0&&(A.style.setProperty(`padding-top`,u+`em`,`important`),A.style.setProperty(`padding-bottom`,u+`em`,`important`))}else{let r=document.createElement(`div`);r.className=`oim-effect-texture`,r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.borderRadius=`inherit`,r.style.mixBlendMode=e.blend||n.defaultBlend||`overlay`;let i=(e.intensity===void 0?n.defaultIntensity:e.intensity)/100;r.style.opacity=String(i);let a=e.scale||1,o=n.tileWidth*a,s=n.tileHeight*a;r.style.backgroundImage=`url("${n.getDataUri(e.color,e.intensity)}")`,r.style.backgroundRepeat=`repeat`,r.style.backgroundSize=`${o}px ${s}px`,r.style.zIndex=`1`;let c=jn({type:t,svg:D?E:void 0,image:T?E.trim():void 0,fit:u?.fit});if(c){let e=r.style;e.maskImage=e.webkitMaskImage=c.image,e.maskSize=e.webkitMaskSize=c.size,e.maskRepeat=e.webkitMaskRepeat=`no-repeat`,e.maskPosition=e.webkitMaskPosition=`center`}A.appendChild(r)}}},Ne=e=>{A.style.filter=(A.style.filter?A.style.filter+` `:``)+e},Pe=e=>{A.style.textShadow=A.style.textShadow?A.style.textShadow+`, `+e:e},Fe=r.effects;for(let n of Fe??[])if(n.kind===`blur`)Ne(`blur(`+n.radius+`px)`);else if(n.kind===`glow`){let e=b.css(n.color)||`#f59e0b`,r=n.radius;t===`text`?Pe(`0px 0px `+r*.4+`px `+e+`, 0px 0px `+r+`px `+e):Ne(`drop-shadow(0px 0px `+r*.4+`px `+e+`) drop-shadow(0px 0px `+r+`px `+e+`)`)}else if(n.kind===`shadow`){let e=n.color&&typeof n.color==`object`?n.color:void 0,r=n.opacity===void 0?b.css(n.color??`#000000`)||`#000000`:Ui({shadowColor:e?e.fallback:n.color,shadowOpacity:n.opacity*100,shadowColorRole:e?.var}),i=(n.x||0)+`px `+(n.y||0)+`px `+(n.blur||0)+`px `+r;t===`text`?Pe(i):Ne(`drop-shadow(`+i+`)`)}else if(n.kind===`grain`){if(!yi.includes(t))continue;let r=`oim-grain-`+String(e.id).replace(/[^A-Za-z0-9_-]/g,`_`);o._defineLayerGrain(r,n),Ne(`url(#`+r+`)`)}else n.kind===`texture`&&Me({...n,color:n.color===void 0?void 0:ee(n.color)});let Ie=r.opacity??1;if(A.dataset.oimOpacity=String(Ie),A.style.setProperty(`--oim-target-opacity`,String(Ie)),r.visible===!1&&(A.style.display=`none`,A.style.opacity=`0`,A.style.pointerEvents=`none`),t===`filter`){let t=r.effects?.find(e=>e.kind===`backdrop`),n=ve(Ye(t)),i=t?.preset===`duotone`?`url(#`+Vr(e)+`)`:n;i&&(A.style.backdropFilter=i,A.style.webkitBackdropFilter=i)}if(t===`container`){let e=r.box.width||300,t=r.box.height||200,n=r.fills?.[0],i=n?Pr(n,{colors:b,width:e,height:t}):{};Object.assign(A.style,i)}let Y=r.corners;if(Y!==void 0&&!H.round&&(A.style.borderRadius=(Array.isArray(Y)?Y:[Y]).map(e=>e+`px`).join(` `)),J){A.style.left=J.left,A.style.top=J.top,A.style.width=J.width,A.style.height=J.height,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.setProperty(`padding`,`0`,`important`),A.style.transformOrigin=J.transformOrigin,A.style.pointerEvents=J.pointerEvents,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-scale`,`1`);let t=!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop);A.style.overflow=t?`hidden`:`visible`,c(M,`data-oim-group`,`data-oim-grupo`,String(e.id)),M.style.transformOrigin=J.transformOrigin,M.style.height=`100%`,M.style.overflow=`visible`}let Ve=r.animations?.find(ka),He=r.animations?.find(e=>e.on===`loop`&&e.preset),We=r.animations?.find(e=>e.on===`hover`&&e.preset),Ge=e=>e?+(e/1e3).toFixed(6):0,Ke=Ve||He||We?{frames:Ve?Na(Ve.tracks):void 0,duration:Ve?Ge(Ve.duration):0,trigger:Ve?.on===`action`?`action`:void 0,loop:He?.preset,loopDuration:Ge(He?.duration),loopDelay:Ge(He?.delay),hover:We?.preset}:void 0;if(Ke&&!o.disableAnimations){let t=Ke;if(t.frames&&typeof M.animate==`function`){let n=t.duration;{let r=t.frames,i=t.trigger===`action`,a=M.animate(r,{duration:n*1e3,iterations:i?1:1/0,easing:`linear`,...i?{fill:`both`}:{}});i?(a.pause(),a.currentTime=0):(o._paused&&a.pause(),o._animations.push(a)),o._timelines.set(String(e.id),a)}}t.loop&&t.loop!==`none`&&t.loop!==`custom`&&(M.classList.add(`oim-loop-`+t.loop),t.loopDuration&&M.style.setProperty(`--oim-loop-duration`,t.loopDuration+`s`),t.loopDelay&&M.style.setProperty(`--oim-loop-delay`,t.loopDelay+`s`)),t.hover&&t.hover!==`none`&&t.hover!==`custom`&&N.classList.add(`oim-hover-`+t.hover)}let X=r.animations?.find(e=>e.on===`hover`&&e.tracks),qe=e=>{let t=X?.tracks?.find(t=>t.property===e)?.keyframes;return t?t[t.length-1].v:void 0},Xe=e=>(r.interactions??[]).filter(t=>t.on===e).flatMap(e=>e.actions),Qe={hover:{scale:qe(`scale`),rotation:qe(`rotation`),opacity:qe(`opacity`)===void 0?void 0:+(qe(`opacity`)*100).toFixed(6),transitionDuration:X&&X.duration>0?+(X.duration/1e3).toFixed(6):void 0,actions:Xe(`hover`)},active:{actions:Xe(`press`)}};if(!o.disableActions&&(X||r.interactions?.length)){let t={},n={},r=new Set;ra(A,Qe,function(e,t){o.queueUpdate(e,t)},{run:function(i,a){let s=o.host.shadowRoot;if(!s)return;let c=new CustomEvent(`oim:action`,{cancelable:!0,detail:{slot:e.id,name:e.name,trigger:a||`unknown`,targets:i.map(function(e){return e.target}),types:i.map(function(e){return e.type})}});if(o.host.dispatchEvent(c),c.defaultPrevented)return;i.forEach(function(e){e.type===`play`&&e.target&&o._playTimeline(String(e.target))});let l={};i.forEach(function(i){if(!i.target||i.type===`play`)return;let a=s.querySelector(`[data-slot-id="`+i.target+`"]`);!a&&!r.has(i.target)&&(r.add(i.target),console.warn(`[OimPlayer] The slot "`+e.id+`" has an action "`+i.type+`" aimed at "`+i.target+`", which does not exist in this file. It does nothing.`));let o=!a||a.style.display!==`none`&&a.style.opacity!==`0`;if(l[i.target]=o,t[i.target]===void 0&&(t[i.target]=o),i.type===`setText`&&n[i.target]===void 0){let e=a?a.querySelector(`.oim-slot-hover-wrap`):null;n[i.target]=e?e.textContent||``:a&&a.textContent||``}});let u=oa(i,l);for(let[e,t]of Object.entries(u.visibility)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);n&&(t?o._showSlotElement(n):o._hideSlotElement(n))}for(let[e,t]of Object.entries(u.texts)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);if(!n)continue;let r=n.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:n.textContent=t}},revert:function(e){let r=o.host.shadowRoot;r&&e.forEach(function(e){if(!e.target||e.type===`play`)return;let i=r.querySelector(`[data-slot-id="`+e.target+`"]`);if(i){if(t[e.target]!==void 0){let n=t[e.target];delete t[e.target],n?o._showSlotElement(i):o._hideSlotElement(i)}if(n[e.target]!==void 0){let t=n[e.target];delete n[e.target];let r=i.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:i.textContent=t}}})}},function(e,t){o._activeTouchSlot&&o._activeTouchSlot.el!==e&&o._activeTouchSlot.leave(),o._activeTouchSlot={el:e,leave:t}})}S&&(A.style.backgroundColor=`transparent`,A.style.overflow=`visible`,A.style.setProperty(`padding`,`0`,`important`));let tt=Gi(a.flipX,a.flipY);if(tt){let e=document.createElement(`div`);for(e.setAttribute(`data-oim-flip`,``),e.style.width=`100%`,e.style.height=`100%`,e.style.transformOrigin=`50% 50%`,e.style.transform=`scale(`+tt[0]+`, `+tt[1]+`)`;A.firstChild;)e.appendChild(A.firstChild);A.appendChild(e)}return{slotEl:A,zoneId:ke,slot:e}}),C=await Promise.all(S),w=[],T=new Set;s.forEach(function(e,t){let n=e&&e.id!==void 0&&e.id!==null&&e.id!==``?String(e.id):``,r;n?T.has(n)?(console.warn(`[OimPlayer] Duplicate slot id "`+n+`" at index `+t+`; rendering it unkeyed and in stack order.`),r=`__oim-dup-`+n+`-`+t):r=n:(console.warn(`[OimPlayer] Slot #`+t+` has no id; rendering it unkeyed and in stack order.`,e),r=`__oim-unkeyed-`+t),T.add(r),w.push(r)});let E=new Map;C.forEach(function(e,t){if(!e)return;let n=e.slotEl,r=e.zoneId;r&&h[r]?h[r].appendChild(n):E.set(w[t],n)});let D=[];s.forEach(function(e,t){let n=g.get(String(e.id));n&&h[n]||D.push({id:w[t],type:e.type,style:e.style||{},duotone:e.type===`filter`&&y.get(String(e.id))?.effects?.some(e=>e.kind===`backdrop`&&e.preset===`duotone`),position:e.position,width_px:e.width_px,height_px:e.height_px})});let te=Gr(D),O=D.some(function(e){return e.type===`mask`}),k=D.some(function(e){return!!e.duotone});if((O||k)&&m.appendChild(Ta(D,{width:f,height:p})),te.forEach(function(e){Ea(e,m,E)}),n?C.forEach(function(e){if(!e)return;let t=e.slotEl.getAttribute(`data-slot-id`)||``,n=r.querySelector(`[data-slot-id="`+t+`"]`);if(n&&n.parentNode){let t=n.querySelectorAll(`[data-oim-group] > [data-slot-id], :scope > [data-slot-id]`);for(let n=0;n<t.length;n++)e.slotEl.appendChild(t[n]);n.parentNode.replaceChild(e.slotEl,n)}}):(r.innerHTML=``,r.appendChild(m)),v.size>0){let e=function(e){for(let t in h)if(h[t]&&h[t].contains(e))return!0;return!1};v.forEach(function(t,n){let i=r.querySelector(`[data-slot-id="`+n+`"]`);if(!i||e(i))return;let a=i.querySelector(`[data-oim-group="`+n+`"]`)||i;t.forEach(function(t){let n=r.querySelector(`[data-slot-id="`+t+`"]`);n&&!e(n)&&a.appendChild(n)})})}try{await Promise.all(d)}catch(e){console.warn(`[OIM Player] Font load fallback activado.`,e)}r.querySelectorAll(`.oim-slot`).forEach(function(e){e.style.opacity=e.dataset.oimOpacity===void 0?`1`:e.dataset.oimOpacity}),await o._mediaSettled(r),o._buildA11y(),o.updateViewportSize(),o.updateScale(),o._viewport&&(o._viewport.classList.add(`oim-viewport--ready`),o._revealed=!0,o.sceneReady())}_defineLayerGrain(e,t){let n=this._viewport||this._overlay;if(!n||typeof DOMParser>`u`)return;let r=n.querySelector(`:scope > svg.oim-grain-defs > defs`);if(!r){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`class`,`oim-grain-defs`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`style`,`position:absolute;pointer-events:none`),r=document.createElementNS(e,`defs`),t.appendChild(r),n.appendChild(t)}let i=r.querySelector(`#`+e);i&&i.remove();let a=Si(e,{intensity:t.intensity,size:t.size,blend:t.blend}),o=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"><defs>`+a+`</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&r.appendChild(document.importNode(o,!0))}_revealed=!1;_mediaSettled(e){let t=[];e.querySelectorAll(`img`).forEach(function(e){typeof e.decode==`function`&&e.getAttribute(`src`)&&t.push(e.decode().catch(function(){}))}),(this._lottieInstances||[]).forEach(function(e){let n=e.inst;n&&!n.isLoaded&&typeof n.addEventListener==`function`&&t.push(new Promise(function(e){n.addEventListener(`DOMLoaded`,e),n.addEventListener(`data_failed`,e)}))});let n=new Promise(function(e){setTimeout(e,Da)});return Promise.race([Promise.all(t),n]).then(()=>new Promise(function(e){typeof requestAnimationFrame==`function`?requestAnimationFrame(function(){requestAnimationFrame(function(){e()})}):e()}))}_pendingDOMUpdates=new Map;_isUpdateScheduled=!1;_updateCallbacks=[];queueUpdate(e,t,n){let r={};for(let[e,n]of Object.entries(t))(typeof n==`string`||n===void 0)&&(r[e]=n);this._pendingDOMUpdates.set(e,{...this._pendingDOMUpdates.get(e)||{},...r}),n&&this._updateCallbacks.push(n),this._isUpdateScheduled||(this._isUpdateScheduled=!0,requestAnimationFrame(()=>this._flushDOMUpdates()))}_flushDOMUpdates(){this._pendingDOMUpdates.forEach((e,t)=>{for(let[n,r]of Object.entries(e))n.startsWith(`--`)?r===``||r==null?t.style.removeProperty(n):t.style.setProperty(n,String(r)):t.style[n]=r}),this._pendingDOMUpdates.clear(),this._isUpdateScheduled=!1;let e=this._updateCallbacks;this._updateCallbacks=[],e.forEach(e=>{try{e()}catch(e){console.error(e)}})}_hideSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`none`,opacity:`0`,pointerEvents:`none`}):this.queueUpdate(e,{pointerEvents:`none`},()=>{this._runReveal(e,!1,()=>this.queueUpdate(e,{display:`none`}))})}_showSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`flex`,opacity:`1`,pointerEvents:`auto`}):this.queueUpdate(e,{display:`flex`,pointerEvents:`auto`},()=>this._runReveal(e,!0))}_playTimeline(e){let t=this._timelines.get(e);t?(t.currentTime=0,this._paused||t.play()):!this.disableAnimations&&!this._warnedPlay.has(e)&&(this._warnedPlay.add(e),console.warn(`[OimPlayer] play: no animation`,e))}_runReveal(e,t,n){let r=this._revealAnims.get(e),i=r?getComputedStyle(e):void 0;r&&(r.cancel(),this._revealAnims.delete(e)),e.style.opacity=t?`1`:`0`;let a=ci(e._oimReveal,t);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||a.duration===0||typeof e.animate!=`function`){n?.();return}let o=si(a.effect,t);if(i)for(let e of[`opacity`,`translate`,`scale`]){let t=i[e];t&&t!==`none`&&(o[0][e]=t)}let s=e.animate(o,{duration:a.duration,easing:a.easing,fill:`both`});this._paused&&s.pause(),this._revealAnims.set(e,s),s.onfinish=()=>{this._revealAnims.delete(e),s.cancel(),n?.()}}_buildA11y(){let e=this._viewport;if(!e||!this.metadata)return;let t=this.metadata,n=t.lang&&t.lang[0]||t.languages&&t.languages[0]||this.lang,r=this._a11yHidden,i=this._a11yShown,a=Vi((t.slots||t.elements||[]).filter(function(e){return!r.has(String(e&&e.id))}).map(function(e){return i.has(String(e&&e.id))?Object.assign({},e,{style:Object.assign({},e.style,{isVisible:!0})}):e}),this.lang,n,!this.disableActions);this._overlay&&this._overlay.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`figure`),e.setAttribute(`aria-label`,Hi(t,a,this.lang,n));let o=e.querySelector(`.oim-a11y`);o||(o=document.createElement(`div`),o.className=`oim-a11y`,o.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap`,e.appendChild(o)),o.textContent=``;let s=this;a.forEach(function(e){let t;if(e.type===`text`)t=document.createElement(`p`),t.setAttribute(`lang`,e.lang),t.textContent=e.text;else if(e.type===`image`)t=document.createElement(`span`),t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,e.label);else{t=document.createElement(`button`),t.setAttribute(`type`,`button`),t.textContent=e.label;let n=function(){let t=s._overlay&&s._overlay.querySelector(`[data-slot-id="`+CSS.escape(e.slotId)+`"]`);t&&t.click()};t.addEventListener(`click`,n),t.addEventListener(`keydown`,function(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())})}o.appendChild(t)})}_a11yHidden=new Set;_a11yShown=new Set;executeToggleState(e){if(!e)return;let t=this.host.shadowRoot;if(!t)return;let n=this,r=e.hide_slots||[];r.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._hideSlotElement(r)});let i=e.show_slots||[];i.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._showSlotElement(r)}),r.forEach(function(e){n._a11yHidden.add(String(e)),n._a11yShown.delete(String(e))}),i.forEach(function(e){n._a11yShown.add(String(e)),n._a11yHidden.delete(String(e))}),this._buildA11y()}_activeTouchSlot=null;clearSlots(){this._activeTouchSlot&&=null;let e=this._overlay;e&&(e.replaceChildren?e.replaceChildren():e.innerHTML=``)}setLang(e){if(this.lang===e)return;let t=this.lang;this.lang=e,this.host.setAttribute(`lang`,e),this._buildA11y();let n=this._classifyLangChange(t,e);(n.styleOnly.size>0||n.content.size>0)&&(this._prefersLessMotion()||this._isLowTierOrMobile()?this._switchWithFade(n):this._switchWithBlur(n)),this.host.dispatchEvent(new CustomEvent(`oim:langchange`,{detail:{lang:e}}))}_isLowTierOrMobile(){let e=this.host;if(e&&typeof e.getAttribute==`function`){let t=e.getAttribute(`tier`)||e.getAttribute(`quality`);if(t===`low`)return!0;if(t===`high`)return!1}return this._deviceProfile.isMobile||this._deviceProfile.tier===`low`}_prefersLessMotion(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}_switchWithBlur(e){let t=this._viewport,n=this;t?(t.style.transition=`filter 0.18s ease-out`,t.style.filter=`blur(14px)`,setTimeout(function(){let r=n._applyLangChange(e),i=new Promise(function(e){setTimeout(e,600)});Promise.race([r||Promise.resolve(),i]).then(function(){t.style.transition=`filter 0.32s ease-in-out`,t.style.filter=`none`})},180)):this._applyLangChange(e)}_switchWithFade(e){let t=this.host.shadowRoot,n=this,r=new Set([...e.styleOnly,...e.content]),i=[];t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&!/opacity/i.test(n.style.animationName||``)&&i.push(n)}),i.forEach(function(e){e.style.transition=`opacity 0.12s linear`,e.style.opacity=`0`}),setTimeout(function(){n._applyLangChange(e),t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&(n.style.opacity=n.dataset.oimOpacity===void 0?`1`:n.dataset.oimOpacity)})},120)}_classifyLangChange(e,t){let n=new Set,r=new Set;return this.metadata&&(this.metadata.slots||this.metadata.elements||[]).forEach(function(i){if(!i||i.id===void 0||i.id===null)return;let a=We(i,e,t);a===`content`?r.add(String(i.id)):a===`style-only`&&n.add(String(i.id)),Array.isArray(i.languages)&&!i.languages.includes(`*`)&&i.languages.includes(e)!==i.languages.includes(t)&&n.add(String(i.id))}),{styleOnly:n,content:r}}_applyLangChange(e){let t=this.host.shadowRoot;if(t&&e.styleOnly.size>0&&this.metadata){let n=this.metadata.slots||this.metadata.elements||[],r=this;n.forEach(function(n){if(!n||!e.styleOnly.has(String(n.id)))return;let i=t.querySelector(`[data-slot-id="`+n.id+`"]`);if(!i)return;Array.isArray(n.languages)&&!n.languages.includes(`*`)&&(i.style.display=n.languages.includes(r.lang)?``:`none`);let a=Ue(n,r.lang),o=n.type===`text`?Le(X(r.metadata).get(String(n.id)),r.lang):void 0;i.style.fontSize=o?.fontSize??a.size,i.style.maxWidth=o?.maxWidth??a.maxWidthValue})}return e.content.size>0?this.renderSlots({onlyIds:e.content}):null}play(){this._paused=!1,this._isStill()||(this._animations.forEach(function(e){try{e.play()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.play()}catch{}}),this._textAnimations.forEach(function(e){e.play()}),this._revealAnims.forEach(function(e){e.play()}),this._heldTimelines.forEach(function(e){e.play()}),this._heldTimelines.clear())}pause(){this._paused=!0,this._textAnimations.forEach(function(e){e.pause()}),this._revealAnims.forEach(function(e){e.pause()});let e=this._heldTimelines;this._timelines.forEach(function(t){t.playState===`running`&&t.effect?.getTiming().iterations!==1/0&&(t.pause(),e.add(t))}),this._animations.forEach(function(e){try{e.pause()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.pause()}catch{}})}_bornPausedIfNeeded(e,t){this._paused&&t.pause(),e.push(t)}_destroyLottiesIn(e){if(!this._lottieInstances)return;let t=[];this._lottieInstances.forEach(function(n){if(e.has(n.slotId))try{n.inst.destroy()}catch{}else t.push(n)}),this._lottieInstances=t}};function ka(e){return(e.on===`loop`||e.on===`action`)&&!!e.tracks&&e.tracks.some(e=>Aa[e.property]!==void 0)}var Aa={x:0,y:0,rotation:0,scale:1,opacity:1,blur:0},ja=[`x`,`y`,`rotation`,`scale`];function Ma(e,t,n){if(!e)return n;let r=e.keyframes,i=r.find(e=>e.t===t);if(i)return i.v;let a=r.findIndex(e=>e.t>t);if(a<=0)return a===0?r[0].v:r[r.length-1].v;let o=r[a-1],s=r[a];return o.v+(s.v-o.v)*(t-o.t)/(s.t-o.t)}function Na(e){let t=t=>e.find(e=>e.property===t),n=ja.some(e=>t(e)),r=new Map;for(let t of e)if(Aa[t.property]!==void 0)for(let e of t.keyframes){let n=r.get(e.t);n||r.set(e.t,n={offset:e.t}),e.e!==void 0&&(n.easing=ai(e.e,`linear`)),t.property===`opacity`?n.opacity=e.v:t.property===`blur`?n.filter=e.v>0?`blur(`+e.v+`px)`:`none`:n.moves=!0}return[...r.values()].sort((e,t)=>e.offset-t.offset).map(function(e){let{moves:r,...i}=e;if(n&&r){let n=n=>Ma(t(n),e.offset,Aa[n]);i.transform=`translate(`+n(`x`)+`px, `+n(`y`)+`px) rotate(`+n(`rotation`)+`deg) scale(`+n(`scale`)+`)`}return i})}function Pa(e){if(!U(e))return e;let t=we(e);return t.missing.forEach(e=>console.warn(`[OimPlayer] resource "${e}" is not in the document`)),rt(t.document)}var Fa=class extends Oa{fileMetadata=null;_posterFade=!1;constructor(e,t){super();let n=t||{};this.host=e,this.poster=n.poster===`only`?`only`:`auto`,this.lang=e.getAttribute(`lang`)||`en`,this.showControls=e.getAttribute(`show-controls`)!==`false`,this._deviceProfile=m(),this.allowZoom=n.allowZoom===!0,this.showLanguageSelector=n.showLanguageSelector!==!1,this.showSlots=n.showSlots!==!1,this.allowLottie=n.allowLottie!==!1&&e.getAttribute(`allow-lottie`)!==`false`,this.allowDynamicColors=n.allowDynamicColors!==!1&&e.getAttribute(`allow-dynamic-colors`)!==`false`;let r=o(e,n,typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);this.disableAnimations=r.disableAnimations,this.disableActions=r.disableActions,this.dropdownBlur=n.dropdownBlur!==!1&&e.getAttribute(`dropdown-blur`)!==`false`,this.fit=n.fit||`contain`,this.align=n.align||`center`}destroy(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._onFullscreenChange&&(document.removeEventListener(`fullscreenchange`,this._onFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`MSFullscreenChange`,this._onFullscreenChange)),this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]),this._animations.forEach(function(e){try{e.cancel()}catch{}}),this._animations=[],this._timelines.clear(),this._revealAnims.clear(),this._heldTimelines.clear(),this._textAnimations.forEach(function(e){try{e.stop()}catch{}}),this._textAnimations=[],this._onDragMove&&=(window.removeEventListener(`mousemove`,this._onDragMove),null),this._onDragEnd&&=(window.removeEventListener(`mouseup`,this._onDragEnd),null)}async load(e){let t=this.host,n=t.shadowRoot||t.attachShadow({mode:`open`});try{if(typeof e==`string`?this.imageUrl=e:(this.imageUrl&&this.imageUrl.startsWith(`blob:`)&&URL.revokeObjectURL(this.imageUrl),this.imageUrl=URL.createObjectURL(e)),t.classList.add(`oim-player-host`),t.classList.add(`oim-align-`+this.align),t.classList.add(`oim-tier-`+this._deviceProfile.tier),this._deviceProfile.isMobile&&t.classList.add(`oim-mobile`),n.innerHTML=`<div class="oim-player-viewport oim-fit-`+this.fit+`" part="viewport"><img class="oim-player-base" crossorigin="anonymous"`+(typeof e==`string`?``:` src="`+this.imageUrl+`"`)+` alt="" aria-hidden="true" part="base" /><div class="oim-layer-overlay" aria-hidden="true" part="overlay"></div></div>`,M(n),this._viewport=n.querySelector(`.oim-player-viewport`),this._baseImg=n.querySelector(`.oim-player-base`),this._overlay=n.querySelector(`.oim-layer-overlay`),this._stage=this.host,!this.allowDynamicColors&&this._viewport)for(let e of ce)this._viewport.style.setProperty(`--oim-color-`+e,`initial`);this.applyPalette(),(this._prefersLessMotion()||this._isLowTierOrMobile())&&this._viewport&&(this._viewport.style.filter=`none`);let r=this,i=null,a=()=>{i||=requestAnimationFrame(()=>{r.updateViewportSize(),r.updateScale(),i=null})};typeof ResizeObserver<`u`&&this._viewport&&(this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(a),this._resizeObserver.observe(this.host)),this._onFullscreenChange=a,document.addEventListener(`fullscreenchange`,this._onFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.addEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.addEventListener(`MSFullscreenChange`,this._onFullscreenChange);let o=this._baseImg,l=this._viewport;function d(){l&&o&&o.naturalWidth>0&&(l.style.setProperty(`--oim-ar`,o.naturalWidth+` / `+o.naturalHeight),r._baseImg=o,r.updateViewportSize(),r.updateScale(),r.metadata&&r.renderSlots())}if(o&&o.complete&&o.naturalWidth>0?d():o&&(o.onload=d),this.updateViewportSize(),this.updateScale(),this._bindViewportEvents(),typeof e==`string`&&o){let i=await j.readPoster(e);if(i){let e=await Zt(i.seal,i.imageHash);if(e===`invalid`){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,M(n);let e=n.querySelector(`.oim-player-error`);return e&&(e.textContent=u(`tampered`,r.lang)),t.dispatchEvent(new CustomEvent(`error`,{detail:Error(Yt)})),!1}if(e===`expired_key`)try{c(t,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}if(this.imageUrl=URL.createObjectURL(i.png),o.src=this.imageUrl,this.poster===`only`)return this.securityStatus=e===`ok`?`verified`:`expired_key`,l?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),t.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:null,security:this.securityStatus}})),!0}else o.src=e}return j.getBlob(e).then(t=>new Promise((n,i)=>{s.requestRender(r,t,e,n,i)})).catch(e=>{if(console.error(`[OimPlayer::ImageEngine::load]`,e),String(e&&e.message).indexOf(`OIM_ALTERED`)===0){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,M(n);let e=n.querySelector(`.oim-player-error`);e&&(e.textContent=u(`tampered`,r.lang))}throw t.dispatchEvent(new CustomEvent(`error`,{detail:e})),e})}catch(e){console.error(`[OimPlayer::ImageEngine]`,e),n.innerHTML=`<div class="oim-player-error" part="error"></div>`;let r=n.querySelector(`.oim-player-error`);return r&&(r.textContent=u(`loadError`,this.lang)+e.message),t.dispatchEvent(new CustomEvent(`error`,{detail:e})),!1}}async _verifyMainThread(e){let t=await St(e);if(!t.metadata)return{metadata:{slots:[]},security:`no_metadata`,announce:!1};let n=Xt(t.metadata);if(n.length>0)return{refused:!0,security:`corrupt`,error:`Corrupted or tampered OIM file: `+n[0]};let r=!!(t.metadata.signature&&t.metadata.key_version),i=await Gt(t.metadata),a=Kt({isSigned:r,isSigValid:i,keyExpired:r&&i?await qt(t.metadata):!1,metadata:t.metadata,imageHash:t.imageHash});if(Jt(a))return{refused:!0,security:a,error:Yt+`: `+a};let o,s=!1;return i?a===`unsigned`||a===`expired_key`?o={slots:[],elements:[],layers:[]}:(s=!0,U(t.metadata)||N(t.metadata),o=t.metadata):o={slots:[]},{metadata:o,security:a,announce:s}}async _verifyWithWorker(e){let t=typeof window<`u`?window.location.hostname:``,n=typeof window<`u`?window.location.origin:``,r;try{r=await vt(e,t,n)}catch(t){return console.warn(`[OimPlayer] Web Worker unavailable or crashed (possibly blocked by CSP). Falling back to main-thread execution.`,t),this._verifyMainThread(e)}return r.success?{metadata:r.metadata,security:r.security||`unsigned`,announce:!0}:r.refused?{refused:!0,security:r.security,error:r.error}:(console.warn(`[OimPlayer] Web Worker reported execution failure. Falling back to main-thread execution.`,r.error),this._verifyMainThread(e))}async _verify(e){return typeof Worker>`u`?this._verifyMainThread(e):this._verifyWithWorker(e)}async _applyVerified(e){let t=this,n=this.poster===`only`;this._posterFade=!n&&U(e.metadata)&&!Ce(e.metadata);let r=structuredClone(e.metadata);if(this.fileMetadata=r,this.metadata=n?structuredClone(r):Pa(structuredClone(r)),n||this.applyPalette(),this.securityStatus=e.security,this.securityStatus===`unsigned`){try{c(this.host,`data-oim-unsigned`,`data-oim-sin-firma`)}catch{}console.warn(`[OimPlayer] Unsigned file: painting the base image only. Interactive layers need a signature.`)}if(this.securityStatus===`expired_key`){try{c(this.host,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}console.warn(`[OimPlayer] This work was signed with a retired key. Ask the author to export it again.`)}return n?(this._viewport?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0):(e.announce&&t._announceUnsupported(this.metadata),this.embeddedFontFamilies=await hn(mn(this.metadata)),this._posterFade&&this._viewport?.classList.add(`oim-viewport--poster`),this.updateViewportSize(),this.updateScale(),await this.renderSlots(),typeof document<`u`&&document.fonts&&document.fonts.ready.then(()=>{t.host&&t._overlay&&(t.updateViewportSize(),t.updateScale(),t._overlay.querySelectorAll(`.oim-slot`).forEach(e=>{let t=e.style.transition;e.style.setProperty(`transition`,`none`,`important`),e.offsetWidth,e.style.transition=t}))}),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0)}sceneReady(){let e=this._baseImg;this._posterFade&&e&&(this._posterFade=!1,this._prefersLessMotion()?e.style.display=`none`:(e.classList.add(`oim-base--faded`),setTimeout(()=>{e.style.display=`none`},200)))}async _executeLoad(e,t){try{let n=await j.getVerified(t??e,e=>this._verify(e));if(n.refused)throw this.securityStatus=n.security,Error(n.error);return this._applyVerified(n)}catch(e){throw console.error(`[OimPlayer::ImageEngine::_executeLoad]`,e),e}}_announceUnsupported(e){let t;try{t=cn(e,{version:rn,capabilities:an})}catch{return}if(!t.hasNotice)return;let n=ln(t);try{console.warn(`[OimPlayer] `+n)}catch{}try{t.missingCapabilities&&t.missingCapabilities.length>0&&c(this.host,`data-oim-unsupported`,`data-oim-sin-soporte`,t.missingCapabilities.join(` `)),t.missingRequiredCapabilities&&t.missingRequiredCapabilities.length>0&&c(this.host,`data-oim-missing-required`,`data-oim-requeridas-faltantes`,t.missingRequiredCapabilities.join(` `)),t.versionTooOld&&t.requiredVersion&&c(this.host,`data-oim-required-version`,`data-oim-version-exigida`,t.requiredVersion),this.host.dispatchEvent(new CustomEvent(`oim:incomplete`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}})),t.cannotRender&&this.host.dispatchEvent(new CustomEvent(`oim:unsupported`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}}))}catch{}}updateScale(){if(!this._viewport)return;let e=this._viewport.offsetWidth,t=this.metadata&&this.metadata.canvas?this.metadata.canvas.natural_width||this.metadata.canvas.width:0,n=e/(this.metadata&&(this.metadata.artboardWidth||this.metadata.canvasWidth||this.metadata.canvas_width)||t||this._baseImg&&this._baseImg.naturalWidth||1080);this._viewport.style.setProperty(`--oim-fit`,n.toFixed(6))}updateViewportSize(){if(!this._viewport)return;let e=this._baseImg?this._baseImg.naturalWidth:0,t=this._baseImg?this._baseImg.naturalHeight:0;if(e===0&&this.metadata&&this.metadata.canvas&&(e=this.metadata.canvas.natural_width||this.metadata.canvas.width||1080,t=this.metadata.canvas.natural_height||this.metadata.canvas.height||1920),e===0)return;let n=this.host.offsetWidth,r=this.host.offsetHeight;if(n===0||r===0){if(!this._retryViewportSize){this._retryViewportSize=!0;let e=this;setTimeout(()=>{e._retryViewportSize=!1,e.updateViewportSize(),e.updateScale()},100)}return}let i=e/t,a=n/r,o,s;this.fit===`cover`?a>i?(o=n,s=n/i):(s=r,o=r*i):a>i?(s=r,o=r*i):(o=n,s=n/i),this._viewport.style.width=Math.round(o)+`px`,this._viewport.style.height=Math.round(s)+`px`}_bindViewportEvents(){let e=this,t=this._stage;if(!t)return;t.addEventListener(`pointerdown`,function(t){if(t.pointerType!==`mouse`&&e._activeTouchSlot&&(typeof t.composedPath==`function`?t.composedPath():[]).indexOf(e._activeTouchSlot.el)===-1){let t=e._activeTouchSlot;e._activeTouchSlot=null,t.leave()}});let n=!1,r=0,i=0,a=0,o=0;t.addEventListener(`mousedown`,function(s){e.allowZoom&&(e.zoom<=1||s.target.closest(`.oim-slot`)||(n=!0,e._viewport&&(e._viewport.style.transition=`none`),t.style.cursor=`grabbing`,r=s.clientX,i=s.clientY,a=e.panX,o=e.panY,s.preventDefault()))}),this._onDragMove=function(t){if(!n)return;let s=t.clientX-r,c=t.clientY-i;e.panX=a+s,e.panY=o+c,e._constrainPan(),e._applyViewportTransform()},window.addEventListener(`mousemove`,this._onDragMove),this._onDragEnd=function(){n&&(n=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`),t.style.cursor=e.zoom>1?`grab`:`default`)},window.addEventListener(`mouseup`,this._onDragEnd);let s=null,c=1,l=!1,u=0,d=0,f=0,p=0;t.addEventListener(`touchstart`,function(t){if(e.allowZoom){if(t.touches.length===2)s=Sa(t.touches),c=e.zoom,l=!1,e._viewport&&(e._viewport.style.transition=`none`);else if(t.touches.length===1&&e.zoom>1){if(t.target.closest(`.oim-slot`))return;l=!0,u=t.touches[0].clientX,d=t.touches[0].clientY,f=e.panX,p=e.panY,e._viewport&&(e._viewport.style.transition=`none`)}}},{passive:!0}),t.addEventListener(`touchmove`,function(t){if(e.allowZoom){if(t.touches.length===2&&s!==null){let n=Sa(t.touches);if(s>0){let t=n/s;e.setZoom(c*t)}}else if(t.touches.length===1&&l){let n=t.touches[0].clientX-u,r=t.touches[0].clientY-d;e.panX=f+n,e.panY=p+r,e._constrainPan(),e._applyViewportTransform()}}},{passive:!0}),t.addEventListener(`touchend`,function(){s=null,l=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`)},{passive:!0}),e.allowZoom&&t.addEventListener(`wheel`,function(t){t.preventDefault(),e.setZoom(nn(e.zoom,t.deltaY,t.deltaMode,t.ctrlKey))},{passive:!1})}_constrainPan(){let e=this.host;if(!e)return;let t=e.clientWidth,n=e.clientHeight,r=this.zoom,i=Math.max(0,t*(r-1)/2),a=Math.max(0,n*(r-1)/2);this.panX=Math.max(-i,Math.min(i,this.panX)),this.panY=Math.max(-a,Math.min(a,this.panY))}_applyViewportTransform(){this._viewport&&(this._viewport.style.transform=`translate3d(`+this.panX+`px, `+this.panY+`px, 0) scale(`+this.zoom+`)`)}setZoom(e){this.zoom=Math.max(1,Math.min(4,e)),this.zoom<=1&&(this.panX=0,this.panY=0),this._constrainPan(),this._applyViewportTransform();let t=this._stage;t&&(t.style.cursor=this.zoom>1?`grab`:`default`)}};function Ia(e,t){let n=``;if(typeof e==`string`){let t=e.indexOf(`#`),r=e.indexOf(`?`),i=t===-1?r===-1?e.length:r:t,a=e.lastIndexOf(`.`,i);a!==-1&&(n=e.substring(a+1,i).toLowerCase())}else if(e&&e.name){let t=e.name,r=t.lastIndexOf(`.`);r!==-1&&(n=t.substring(r+1).toLowerCase())}if(n===`oim`||n===`png`)return`image`;if(n===`ovm`||n===`webm`||n===`mp4`||n===`mkv`)return`video`;if(t){let e=String.fromCharCode(t[0],t[1],t[2],t[3]);if(e===`PNG`)return`image`;if(e===`OVM\0`||e===`Eߣ`)return`video`}return`image`}function La(e){if(!e)return null;let t=e.trim();if(/^data:image\//i.test(t))return t;try{let e=new URL(t,document.baseURI);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}var Q=Object.create(HTMLElement.prototype);function Ra(){if(typeof document>`u`||document.getElementById(`oim-player-gap`))return;let e=document.createElement(`style`);e.id=`oim-player-gap`,e.textContent=`:where(oim-player){display:block}:where(oim-player:not([data-oim-loaded])){min-height:200px}`,(document.head||document.documentElement).appendChild(e)}Q.connectedCallback=function(){Ra(),this.classList.add(`oim-player-host`),this._engine=null,this._src=this.getAttribute(`src`),this._oimOptions||={},this.hasAttribute(`fit`)&&(this._oimOptions.fit=this.getAttribute(`fit`)),this.hasAttribute(`align`)&&(this._oimOptions.align=this.getAttribute(`align`)),this.hasAttribute(`dropdown-blur`)&&(this._oimOptions.dropdownBlur=this.getAttribute(`dropdown-blur`)!==`false`),this.hasAttribute(`allow-lottie`)&&(this._oimOptions.allowLottie=this.getAttribute(`allow-lottie`)!==`false`),this.hasAttribute(`allow-dynamic-colors`)&&(this._oimOptions.allowDynamicColors=this.getAttribute(`allow-dynamic-colors`)!==`false`),this.hasAttribute(`placeholder`)&&(this._oimOptions.placeholder=this.getAttribute(`placeholder`)),this.hasAttribute(`poster`)&&(this._oimOptions.poster=this.getAttribute(`poster`)),this.hasAttribute(`allow-zoom`)&&(this._oimOptions.allowZoom=this.getAttribute(`allow-zoom`)===`true`),this._syncPlaceholder(),this._mqOscuro=typeof matchMedia==`function`?matchMedia(`(prefers-color-scheme: dark)`):null,this._onEsquema=()=>this._engine&&this._engine.applyPalette(),this._mqOscuro&&this._mqOscuro.addEventListener(`change`,this._onEsquema),this._replantearActividad()},Q._replantearActividad=function(){if(this._src&&this.isConnected){if(!this._observers){if(!(`IntersectionObserver`in window)){this._moveTo(`active`);return}let e=this,t=()=>e._scheduleDecision();this._observers=[new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isNear=r.isIntersecting),t()},{rootMargin:`200px`}),new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isVisible=r.isIntersecting),t()},{threshold:[0,.01]})],this._observers.forEach(e=>e.observe(this)),this._onTabChange=t,document.addEventListener(`visibilitychange`,this._onTabChange),this.getAttribute(`activate-on`)===`hover`&&(this._onPointerEnter=()=>{e._hasPointer=!0,t()},this._onPointerLeave=()=>{e._hasPointer=!1,t()},this.addEventListener(`mouseenter`,this._onPointerEnter),this.addEventListener(`mouseleave`,this._onPointerLeave))}this._scheduleDecision()}},Q._scheduleDecision=function(){if(this._activityFrame)return;let e=this;this._activityFrame=requestAnimationFrame(function(){e._activityFrame=null,e._decide()})},Q._decide=function(){if(!this._src||!this.isConnected)return;let e=typeof document<`u`&&document.visibilityState===`hidden`,t,n;if(typeof this._isNear==`boolean`||typeof this._isVisible==`boolean`){t=this._isNear??!1;let r=this._isVisible??!1;n=(t||r)&&r&&!e,t||=r}else{let r=this.getBoundingClientRect(),i=window.innerHeight||0;t=r.bottom>-200&&r.top<i+200,n=t&&!e&&r.bottom>0&&r.top<i}this.getAttribute(`activate-on`)===`hover`&&typeof matchMedia==`function`&&matchMedia(`(hover: hover)`).matches&&(n&&=!!this._hasPointer),this.getAttribute(`activate-on`)===`manual`&&(n=!1),this._moveTo(n?`active`:t?`ready`:`dormant`)},Q._moveTo=function(e){this._activityState!==e&&(this._activityState=e,e!==`dormant`&&(this._engine||this._initPlayer(),e===`active`?this.play():this.pause()))},Q._startAutoRotateLang=function(){this._stopAutoRotateLang();let e=this.getAttribute(`auto-rotate-lang`);if(!e||e===`false`||this.classList.contains(`oim-player-paused`))return;let t=parseInt(e,10);(isNaN(t)||t<=0)&&(t=3e3);let n=this;this._autoRotateIntervalId=setInterval(()=>{let e=n._engine?n._engine.metadata:null;if(!e)return;let t=e.slots||e.elements||[],r={};for(let e=0;e<t.length;e++){let n=t[e].content||{};Object.keys(n).forEach(e=>{r[e.toLowerCase()]=!0})}let i=Object.keys(r).sort();if(i.length<=1)return;let a=(n.getAttribute(`lang`)||n._engine&&n._engine.lang||`en`).toLowerCase(),o=i[(i.indexOf(a)+1)%i.length];n.setAttribute(`lang`,o)},t)},Q._stopAutoRotateLang=function(){this._autoRotateIntervalId&&=(clearInterval(this._autoRotateIntervalId),null)},Q.disconnectedCallback=function(){this._mqOscuro&&=(this._mqOscuro.removeEventListener(`change`,this._onEsquema),null),this._stopAutoRotateLang(),this._observers&&=(this._observers.forEach(e=>e.disconnect()),null),this._onTabChange&&=(document.removeEventListener(`visibilitychange`,this._onTabChange),null),this._onPointerEnter&&(this.removeEventListener(`mouseenter`,this._onPointerEnter),this.removeEventListener(`mouseleave`,this._onPointerLeave),this._onPointerEnter=null,this._onPointerLeave=null),this._activityFrame&&=(cancelAnimationFrame(this._activityFrame),null),this._isNear=null,this._isVisible=null,this._activityState=`dormant`,this._engine&&this._engine.destroy&&this._engine.destroy()},Q.attributeChangedCallback=function(e,t,n){if(e===`placeholder`&&t!==n)this._oimOptions||={},this._oimOptions.placeholder=n,this._syncPlaceholder();else if(e===`poster`&&t!==n)this._oimOptions||={},this._oimOptions.poster=n,this._engine&&this._initPlayer();else if(e===`palette`&&t!==n)this._engine&&this._engine.applyPalette();else if(e===`src`&&t!==n)this._src=n,this._engine?this._initPlayer():this._replantearActividad();else if(e===`activate-on`&&t!==n)this._replantearActividad();else if(e===`lang`&&t!==n)this._engine&&this._engine.setLang&&this._engine.setLang(n);else if((e===`fit`||e===`align`)&&t!==n)this._oimOptions||={},this._oimOptions[e]=n,this._syncPlaceholder(),this._initPlayer();else if(e===`dropdown-blur`&&t!==n)this._oimOptions||={},this._oimOptions.dropdownBlur=n!==`false`,this._engine&&(this._engine.dropdownBlur=n!==`false`);else if(e===`allow-lottie`&&t!==n)this._oimOptions||={},this._oimOptions.allowLottie=n!==`false`,this._engine&&(this._engine.allowLottie=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots());else if(e===`auto-rotate-lang`&&t!==n)this._startAutoRotateLang();else if((e===`mode`||e===`disable-animations`||e===`disable-actions`)&&t!==n){if(this._engine){let e=typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=o(this,this._oimOptions||{},!!e);this._engine.disableAnimations=t.disableAnimations,this._engine.disableActions=t.disableActions,this._engine.renderSlots&&this._engine.renderSlots()}}else e===`show-slots`&&t!==n&&(this._oimOptions||={},this._oimOptions.showSlots=n!==`false`,this._engine&&(this._engine.showSlots=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots()))},Q._syncPlaceholder=function(){let e=this._engine||this._placeholderSettled?null:La(this._oimOptions&&this._oimOptions.placeholder);if(!e){this._removePlaceholder();return}let t=this.shadowRoot||this.attachShadow({mode:`open`});if(!t.querySelector(`img.oim-placeholder`)){let e=document.createElement(`style`);e.className=`oim-placeholder-style`,e.textContent=`:host{position:relative}`;let n=document.createElement(`img`);n.className=`oim-placeholder`,n.alt=``,n.decoding=`async`,n.addEventListener(`error`,()=>this._removePlaceholder()),t.append(e,n)}let n=t.querySelector(`img.oim-placeholder`),r=this._oimOptions&&this._oimOptions.fit===`cover`?`cover`:`contain`,i=this._oimOptions&&this._oimOptions.align,a=i===`top`?`center top`:i===`bottom`?`center bottom`:`center center`;n.setAttribute(`style`,`position:absolute;inset:0;width:100%;height:100%;object-fit:${r};object-position:${a}`),n.getAttribute(`src`)!==e&&n.setAttribute(`src`,e)},Q._removePlaceholder=function(){this.shadowRoot&&this.shadowRoot.querySelectorAll(`.oim-placeholder, .oim-placeholder-style`).forEach(e=>e.remove())},Q._initPlayer=function(){if(!this._src)return;this._loading=!0;let e=this,t=this._src;e._oimOptions||={},e.hasAttribute(`fit`)&&(e._oimOptions.fit=e.getAttribute(`fit`)),e.hasAttribute(`align`)&&(e._oimOptions.align=e.getAttribute(`align`)),e.hasAttribute(`dropdown-blur`)&&(e._oimOptions.dropdownBlur=e.getAttribute(`dropdown-blur`)!==`false`),e.hasAttribute(`placeholder`)&&(e._oimOptions.placeholder=e.getAttribute(`placeholder`)),e.hasAttribute(`poster`)&&(e._oimOptions.poster=e.getAttribute(`poster`)),e.hasAttribute(`allow-lottie`)&&(e._oimOptions.allowLottie=e.getAttribute(`allow-lottie`)!==`false`),e.hasAttribute(`allow-zoom`)&&(e._oimOptions.allowZoom=e.getAttribute(`allow-zoom`)===`true`);let n;n=t instanceof Blob?t.slice(0,16).arrayBuffer().then(e=>new Uint8Array(e)).catch(()=>null):j.sniff(t),n.then(n=>{if(!e.isConnected)return;let r=Ia(t,n);e._engine&&e._engine.destroy&&e._engine.destroy(),r===`video`&&console.warn(`[OimPlayer] Video media detected. Video support has been migrated to <ovm-player> from @oim-media/player-ovm. Falling back to ImageEngine.`),e._engine=new Fa(e,e._oimOptions),e._loading=!1,e.classList.contains(`oim-player-paused`)&&e._engine.pause(),c(e,`data-oim-loaded`,`data-oim-cargado`);let i=()=>{e._placeholderSettled=!0,e._syncPlaceholder()};e._engine.load(t).then(()=>{i(),e._startAutoRotateLang()}).catch(e=>{i(),console.warn(`[OimPlayer] Engine load error during auto-rotate initialization:`,e)})})},Q._wake=function(){this._engine||this._loading||!this._src||this._initPlayer()},Q.getMetadata=function(){return this._wake(),this._engine?this._engine.fileMetadata:null},Q.getSecurityStatus=function(){return this._wake(),this._engine?this._engine.securityStatus||`unsigned`:null},Q.setLang=function(e){this._wake(),this._engine&&this._engine.setLang&&this._engine.setLang(e)},Q.setZoom=function(e){this._engine&&this._engine.setZoom&&this._engine.setZoom(e)},Q.play=function(){this._wake(),this.classList.remove(`oim-player-paused`),this._engine&&this._engine.play&&this._engine.play(),this._startAutoRotateLang()},Q.pause=function(){this.classList.add(`oim-player-paused`),this._engine&&this._engine.pause&&this._engine.pause(),this._stopAutoRotateLang()},Q.seek=function(e){this._engine&&this._engine.seek&&this._engine.seek(e)},Q.getEngine=function(){return this._engine},Q.destroy=function(){this._engine&&this._engine.destroy&&(this._engine.destroy(),this._engine=null),this.parentNode&&this.parentNode.removeChild(this)};var za=[`src`,`placeholder`,`poster`,`lang`,`activate-on`,`fit`,`align`,`dropdown-blur`,`allow-lottie`,`palette`,`auto-rotate-lang`,`disable-animations`,`disable-actions`,`mode`,`show-slots`],$;typeof customElements<`u`&&!customElements.get(`oim-player`)&&($=class extends HTMLElement{_engine=null;_src=null},$.prototype.connectedCallback=Q.connectedCallback,$.prototype.disconnectedCallback=Q.disconnectedCallback,$.prototype.attributeChangedCallback=Q.attributeChangedCallback,$.prototype.getMetadata=Q.getMetadata,$.prototype.getSecurityStatus=Q.getSecurityStatus,$.prototype.setLang=Q.setLang,$.prototype.setZoom=Q.setZoom,$.prototype.play=Q.play,$.prototype.pause=Q.pause,$.prototype.seek=Q.seek,$.prototype.getEngine=Q.getEngine,$.prototype._initPlayer=Q._initPlayer,$.prototype._syncPlaceholder=Q._syncPlaceholder,$.prototype._removePlaceholder=Q._removePlaceholder,$.prototype._replantearActividad=Q._replantearActividad,$.prototype._decide=Q._decide,$.prototype._scheduleDecision=Q._scheduleDecision,$.prototype._moveTo=Q._moveTo,$.prototype._wake=Q._wake,$.prototype._startAutoRotateLang=Q._startAutoRotateLang,$.prototype._stopAutoRotateLang=Q._stopAutoRotateLang,$.prototype.destroy=Q.destroy,$.observedAttributes=za,Object.defineProperty($.prototype,"src",{get:function(){return this._src},set:function(e){this._src=e,typeof e==`string`?this.setAttribute(`src`,e):this._initPlayer()}}),Object.defineProperty($.prototype,"languages",{get:function(){if(!this._engine||!this._engine.metadata)return[];let e=this._engine.metadata.slots||this._engine.metadata.elements||[],t={};for(let n=0;n<e.length;n++){let r=e[n].content||{};Object.keys(r).forEach(e=>{t[e.toLowerCase()]=!0})}return Object.keys(t).sort()}}),Object.defineProperty($.prototype,"currentLang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`}}),Object.defineProperty($.prototype,"lang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`},set:function(e){this.setAttribute(`lang`,e)}}),customElements.define(`oim-player`,$)),window.OimPlayerElement=Q;var Ba={mount:function(e,t,n){let r=typeof e==`string`?document.getElementById(e):e;if(!r)return console.error(`[OimPlayer.mount] Container not found:`,e),null;let i=document.createElement(`oim-player`);return i._oimOptions=n||{},i.src=t,i.setAttribute(`show-controls`,n&&n.showLanguageSelector===!1?`false`:`true`),n&&n.allowLottie===!1&&i.setAttribute(`allow-lottie`,`false`),r.replaceChildren?r.replaceChildren(i):(r.innerHTML=``,r.appendChild(i)),i}},Va=Ba.mount;return window.OimPlayer=Ba,e.OimPlayer=Ba,e.default=Ba,e.OimPlayerElement=Q,e.mount=Va,e})({});
|
|
91
|
+
</svg>`}function ya(e,t,n,r){e.textContent=``;let i=Array.from(t);for(let t=0;t<i.length;t++){let a=i[t];if(a===`
|
|
92
|
+
`){e.appendChild(document.createElement(`br`));continue}let o=document.createElement(`span`);o.textContent=a===` `?`\xA0`:a,o.style.display=`inline-block`,o.style.animationName=ri,o.style.animationDuration=ni+`s`,o.style.animationTimingFunction=`linear`,o.style.animationIterationCount=`infinite`,o.style.animationDelay=ai(t,n,r)+`s`,e.appendChild(o)}}function ba(e,t,n,r,i){e.textContent=``,er(t,n).forEach((t,a)=>{if(/^\s+$/.test(t)){e.appendChild(document.createTextNode(t));return}let o=document.createElement(`span`);o.textContent=t,o.className=`oim-entrance`;let s=o.style;if(s.display=`inline-block`,s.animation=`oim-entrance-${n} ${Yn}s linear ${tr(a,r,i)}s both`,!$n(n)){e.appendChild(o);return}let c=document.createElement(`span`);c.className=`oim-entrance-clip`,c.style.display=`inline-block`,c.style.overflow=`hidden`,c.style.verticalAlign=`top`,c.appendChild(o),e.appendChild(c)})}function xa(e,t){if(!e)return;let n=`oim-entrance-`+t;if(e.getElementById(n))return;let r=rr(t),i=r.some(e=>e.rotateDeg!==0),a=r.map((e,t)=>`${t*100/(r.length-1)}%{opacity:${e.opacity};transform:translateY(${e.translateYEm}em) scale(${e.scale})${i?` rotate(${e.rotateDeg}deg)`:``}}`).join(``),o=document.createElement(`style`);o.id=n,o.textContent=`@keyframes ${n}{${a}}@media (prefers-reduced-motion: reduce){.oim-entrance{animation:none!important}}`,e.appendChild(o)}function Sa(e){if(!e)return;let t=`oim-wave-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=ii(),e.appendChild(n)}function Ca(e,t,n){let r=0,i=performance.now(),a=null,o=()=>r+(a===null?0:performance.now()-i),s=()=>t(o()/1e3),c=()=>{a===null&&(i=performance.now(),a=setInterval(s,e))},l=()=>{a!==null&&(r=o(),clearInterval(a),a=null)};return c(),{pause:l,play:c,stop:()=>{l(),n?.()}}}function wa(e,t,n=20,r=0,i=!0){let a=a=>{let o=gi(t,a,n,r,i,!1);e.textContent=o.visibleText+(o.showCursor?`|`:``)};return a(0),Ca(40,a)}function Ta(e,t,n,r=1,i=0,a=50){e.textContent=``,e.style.display=`inline-block`,e.style.position=`relative`;let o=()=>{let e=document.createElement(`span`);return e.textContent=t,e},s=ui(n,li(0)).copies.map(e=>{let t=o();t.setAttribute(`aria-hidden`,`true`);let n=t.style;return n.position=`absolute`,n.left=`0`,n.top=`0`,n.width=`100%`,n.height=`100%`,n.pointerEvents=`none`,n.opacity=`0`,e.color&&(n.color=e.color),t}),c=o();c.style.position=`relative`,n===`glitch-slice`?e.append(c,...s):e.append(...s,c);let l=t=>{let o=ui(n,li(t,r,i,a));e.style.transform=o.skewX?`skewX(${o.skewX}deg)`:`none`,o.copies.forEach((e,t)=>{let n=s[t].style;n.opacity=String(e.opacity),n.transform=`translate(${e.dx}px, ${e.dy}px)`,e.clip&&(n.clipPath=`inset(${e.clip.top}% 0 ${100-e.clip.bottom}% 0)`)})};return Ca(33,l,()=>l(0))}function Ea(e,t){if(!t?.enabled)return;let n=t.color||`rgba(245,158,11,.35)`,r=t.style===`underline-thick`,i=e.style;i.backgroundColor=r?`transparent`:n,r&&(i.boxShadow=`inset 0 -.4em 0 ${n}`),i.borderRadius=t.style===`pill`?`9999px`:t.style===`box`?`0`:`${t.borderRadius??3}px`,i.padding=`${t.paddingY??2}px ${t.paddingX??4}px`,i.boxDecorationBreak=i.webkitBoxDecorationBreak=`clone`}function Da(e,t,n,r){if(!n?.enabled||!t)return!1;let{letter:i,rest:a}=Gn(t,Object.keys(r??{}));if(!i)return!1;let o=document.createElement(`span`),s=o.style,c=Wn(n);return o.textContent=i,s.float=`left`,s.fontSize=`${c.scale}em`,s.lineHeight=String(c.lineHeight),s.marginRight=`${c.marginRight}px`,c.fontFamily&&(s.fontFamily=c.fontFamily),c.color&&(s.color=c.color),s.fontWeight=String(c.fontWeight),s.userSelect=`none`,Un(e,a,r),e.prepend(o),!0}function Oa(e){if(e.length<2)return 0;let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)}function ka(e,t){let n=(e||``).replace(`#`,``),r=parseInt(n.substring(t*2,t*2+2),16)||0;return Math.round(r/255*1e3)/1e3}function Aa(e,t){let n=`http://www.w3.org/2000/svg`,r=e.style||{},i=t.width,a=t.height,o=Array.isArray(e.position)?e.position:[0,0],s=typeof e.x==`number`?e.x:Number(o[0])/100*i,c=typeof e.y==`number`?e.y:Number(o[1])/100*a,l=document.createElementNS(n,`svg`);l.setAttribute(`viewBox`,`0 0 `+i+` `+a),l.setAttribute(`preserveAspectRatio`,`none`),l.style.position=`absolute`,l.style.left=-s+`px`,l.style.top=-c+`px`,l.style.width=i+`px`,l.style.height=a+`px`,l.style.flex=`none`,l.style.overflow=`visible`,l.style.display=`block`,l.style.pointerEvents=`none`;let u=document.createElementNS(n,`path`);u.setAttribute(`d`,Gr(e,t)),u.setAttribute(`fill`,B(r.maskBgColorRole||r.fillColorRole,r.maskBgColor||`#38BDF8`)),u.setAttribute(`fill-rule`,`evenodd`),l.appendChild(u);let d=r.maskStrokeWidth??0;if(d>0){let i=document.createElementNS(n,`path`);i.setAttribute(`d`,Kr(e,t)),i.setAttribute(`fill`,`none`),i.setAttribute(`stroke`,B(r.maskStrokeColorRole||r.strokeColorRole,r.maskStrokeColor||`#FFFFFF`)),i.setAttribute(`stroke-width`,String(d)),i.setAttribute(`stroke-linejoin`,`round`),l.appendChild(i)}return l}function ja(e,t){let n=`http://www.w3.org/2000/svg`,r=document.createElementNS(n,`svg`);r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`style`,`position:absolute`),r.setAttribute(`aria-hidden`,`true`);let i=document.createElementNS(n,`defs`);return r.appendChild(i),e.forEach(function(e){let r=e.style||{};if(e.type===`mask`&&r.maskMode===`cutout`){let a=r.maskFeather,o=Zr(e,t);if(a&&a>0){let r=Yr(e)+`-blur`,s=document.createElementNS(n,`filter`);s.setAttribute(`id`,r),s.setAttribute(`filterUnits`,`userSpaceOnUse`),s.setAttribute(`x`,`0`),s.setAttribute(`y`,`0`),s.setAttribute(`width`,String(t.width)),s.setAttribute(`height`,String(t.height));let c=document.createElementNS(n,`feGaussianBlur`);c.setAttribute(`stdDeviation`,String(a)),s.appendChild(c),i.appendChild(s);let l=document.createElementNS(n,`mask`);l.setAttribute(`id`,Yr(e)),l.setAttribute(`maskUnits`,`userSpaceOnUse`);let u=document.createElementNS(n,`rect`);u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,String(t.width)),u.setAttribute(`height`,String(t.height)),u.setAttribute(`fill`,`black`),l.appendChild(u);let d=document.createElementNS(n,`g`);d.setAttribute(`filter`,`url(#`+r+`)`);let f=document.createElementNS(n,`path`);f.setAttribute(`d`,o),f.setAttribute(`fill`,`white`),f.setAttribute(`clip-rule`,`evenodd`),f.setAttribute(`fill-rule`,`evenodd`),d.appendChild(f),l.appendChild(d),i.appendChild(l)}else{let t=document.createElementNS(n,`clipPath`);t.setAttribute(`id`,Ur(e)),t.setAttribute(`clipPathUnits`,`userSpaceOnUse`);let r=document.createElementNS(n,`path`);r.setAttribute(`d`,o),r.setAttribute(`clip-rule`,`evenodd`),t.appendChild(r),i.appendChild(t)}}if(e.type===`filter`&&e.duotone){let t=document.createElementNS(n,`filter`);t.setAttribute(`id`,Jr(e));let r=document.createElementNS(n,`feColorMatrix`);r.setAttribute(`type`,`matrix`),r.setAttribute(`values`,`0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 1 0`),t.appendChild(r);let a=document.createElementNS(n,`feComponentTransfer`);[`R`,`G`,`B`].forEach(function(e,t){let r=document.createElementNS(n,`feFunc`+e);r.setAttribute(`type`,`table`);let i=t;r.setAttribute(`tableValues`,ka(qr.shadows,i)+` `+ka(qr.lights,i)),a.appendChild(r)}),t.appendChild(a),i.appendChild(t)}}),r}function Ma(e,t,n){let r=n.get(e.shape.id);r&&(e.clipPath&&(r.style.clipPath=e.clipPath),e.maskStyle&&(r.style.mask=e.maskStyle),t.appendChild(r))}var Na=1200,Pa=class{updateScale(){}sceneReady(){}updateViewportSize(){}host;poster=`auto`;metadata=null;securityStatus=`unsigned`;embeddedFontFamilies=new Map;imageUrl=null;lang;showControls;activeSlotId=null;zoom=1;panX=0;panY=0;_stage=null;_viewport=null;_baseImg=null;_overlay=null;_lottieInstances=[];_onDragMove=null;_onDragEnd=null;_animations=[];_textAnimations=[];_paused=!1;_revealAnims=new Map;_timelines=new Map;_warnedPlay=new Set;_heldTimelines=new Set;_isStill(){let e=this.host;if(!this.disableAnimations||!e||typeof e.getAttribute!=`function`)return!1;let t=e.getAttribute(`disable-animations`);return t!==null&&t!==`false`||e.getAttribute(`mode`)===`image`}_resizeObserver=null;_onFullscreenChange=null;_retryViewportSize=!1;allowZoom;showLanguageSelector;showSlots;allowLottie;allowDynamicColors=!0;disableAnimations;disableActions;dropdownBlur;fit;align;_deviceProfile;applyPalette(){let e=this._viewport;if(!e)return;let t=typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches,n=this.allowDynamicColors?z(this.metadata??{},{requested:this.host.getAttribute(`palette`),prefersDark:t}):null;for(let t of se){let r=n?.colors[t];r?e.style.setProperty(`--oim-palette-`+t,r):e.style.removeProperty(`--oim-palette-`+t)}}async renderSlots(e){if(!this.metadata||!this.host||this.poster===`only`)return;let t=(this.metadata.slots||this.metadata.elements||[]).some(function(e){return e.type===`mask`||e.type===`filter`}),n=e&&e.onlyIds&&e.onlyIds.size>0&&!t?e.onlyIds:null;if(this._viewport&&!this._revealed&&this._viewport.classList.remove(`oim-viewport--ready`),!this.showSlots){this._overlay&&(this._overlay.innerHTML=``),this._viewport&&this._viewport.classList.add(`oim-viewport--ready`),this.sceneReady();return}n?this._destroyLottiesIn(n):this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]);let r=this._overlay;if(!r)return;let i=this._viewport?this._viewport.querySelector(`.oim-noise-overlay`):null,a=Array.isArray(this.metadata?.effects)?this.metadata.effects.find(e=>e&&e.type===`texture`&&e.enabled!==!1):null;if(a){let e=Ri[a.preset];if(e){let t=i||document.createElement(`div`);t.className=`oim-noise-overlay`,t.style.position=`absolute`,t.style.inset=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.pointerEvents=`none`,t.style.mixBlendMode=a.blend||e.defaultBlend||`overlay`;let n=(a.intensity===void 0?e.defaultIntensity:a.intensity)/100;t.style.opacity=n.toFixed(2),t.style.zIndex=`999`;let r=a.scale||1,o=e.tileWidth*r,s=e.tileHeight*r;t.style.backgroundImage=`url("${e.getDataUri(a.color)}")`,t.style.backgroundRepeat=`repeat`,t.style.backgroundSize=`${o}px ${s}px`,!i&&this._viewport&&this._viewport.appendChild(t)}}else if(this.metadata&&this.metadata.grain&&this.metadata.grain.enabled){let e=this.metadata.grain,t=e.intensity??15,n=e.blendMode??`overlay`,r=e.baseFrequency??.8,a=i||document.createElement(`div`);a.className=`oim-noise-overlay`,a.style.position=`absolute`,a.style.inset=`0`,a.style.width=`100%`,a.style.height=`100%`,a.style.pointerEvents=`none`,a.style.mixBlendMode=n,a.style.opacity=(t/100).toFixed(2),a.style.zIndex=`999`;let o=`oim-global-noise-filter`,s=wi(o,{intensity:t,baseFrequency:r,color:e.color}),c=`data:image/svg+xml;utf8,`+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs>${s}</defs><rect width="100%" height="100%" filter="url(#${o})"/></svg>`);a.style.backgroundImage=`url("${c}")`,!i&&this._viewport&&this._viewport.appendChild(a)}else i&&i.remove();let o=this,s=this.metadata.slots||this.metadata.elements||[],l=e=>{let t=String(e?.message??e);console.error(`[OimPlayer] A part of the player did not load; the work is shown without it.`,t),this.host.dispatchEvent(new CustomEvent(`oim:error`,{detail:{code:`chunk`,message:t}}))};await Ne().catch(l),await ar(sr([this.metadata,Array.from(lt(this.metadata).values())])).catch(l);let u=lt(o.metadata);s.forEach(function(e){let t=e&&e.type===`mask`?u.get(String(e.id)):void 0;if(t){e.style={...e.style,...ft(t)};let{x:n,y:r,width:i,height:a}=t.box;Object.assign(e,{x:n,y:r,width:i??0,height:a??0})}});let d=[],f=o.metadata&&(o.metadata.artboardWidth||o.metadata.canvasWidth||o.metadata.canvas_width)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_width||o.metadata.canvas.width:0)||(o._baseImg&&o._baseImg.naturalWidth>0?o._baseImg.naturalWidth:1080),p=o.metadata&&(o.metadata.artboardHeight||o.metadata.canvasHeight||o.metadata.canvas_height)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_height||o.metadata.canvas.height:0)||(o._baseImg&&o._baseImg.naturalHeight>0?Math.round(f*(o._baseImg.naturalHeight/o._baseImg.naturalWidth)):1920);r.style.setProperty(`--oim-overlay-w`,f+`px`),r.style.setProperty(`--oim-overlay-h`,p+`px`);let m=document.createDocumentFragment(),h={},g=new Map,_=lt(o.metadata);(this.metadata.zones||[]).forEach(e=>{let t=_.get(String(e?.id));if(!t||t.type!==`group`)return;let n=document.createElement(`div`);n.className=`oim-zone`,n.id=`oim-zone-`+t.id,n.style.position=`absolute`,n.style.inset=`0`;let r=t.children?.find(e=>e.id===t.id+`__background`),i=r?.fills?.[0],a=t.effects?.find(e=>e.kind===`backdrop`)?.blur;if(r||a){let e=t.box,s=document.createElement(`div`);s.className=`oim-zone-box`,s.style.position=`absolute`,s.style.left=e.x+`px`,s.style.top=e.y+`px`,s.style.width=(e.width??0)+`px`,s.style.height=(e.height??0)+`px`,i&&`kind`in i&&i.kind===`color`&&(s.style.background=Y(o.metadata).css(i.value)||``),typeof r?.corners==`number`&&(s.style.borderRadius=r.corners+`px`),a&&(s.style.backdropFilter=`blur(`+a+`px)`,s.style.webkitBackdropFilter=s.style.backdropFilter),n.appendChild(s)}m.appendChild(n),h[t.id]=n;for(let e of t.children??[])g.set(e.id,t.id)});let v=xe(s),y=lt(o.metadata),b=Y(o.metadata),x=o.metadata.canvasFills?.[0];if(x&&o._overlay&&!n){let e=Vr(x,{colors:b,width:o.metadata.canvas_width,height:o.metadata.canvas_height});for(let[t,n]of Object.entries(e))o._overlay.style[t]=n}let ee=e=>e&&typeof e==`object`&&typeof e.fallback==`string`?b.literal(e.fallback):b.literal(e),S=s.map(async e=>{let t=e.type,r=y.get(String(e.id));if(n&&!n.has(String(e.id)))return null;let i=e.style||{};if(e.tracking_data,t===`mask`&&i.maskMode===`cutout`){let t=g.get(String(e.id));return t&&h[t]&&console.warn(`[OimPlayer] Slot "`+e.id+`" is a mask layer inside zone "`+t+`". Mask layers are only supported in the top-level slot stack, so this one will neither render nor clip anything. Move it out of the zone.`),null}if(!r)return console.warn(`[OimPlayer] Slot "`+e.id+`" has no 2.0 layer; it is not painted.`),null;let a=r.box,s=He(e,o.lang),l=r.type===`text`?r.text?.content:void 0,u=t===`image`?r.image:void 0,d=r.type===`shape`&&r.geometry?.kind===`paths`&&!vr(r.geometry).path?r.geometry:void 0,m=l?Le(l,o.lang):u?pt(u.src,o.lang):d&&!ze(e)?ht(d,gt(r,b.css)):r.type===`lottie`?r.lottie?.src??``:s.content,_=!o.disableActions&&(!!r.interactions?.length||!!r.animations?.some(e=>e.on===`hover`||e.on===`press`)),x=t===`mask`&&i.maskMode!==`cutout`,S=t===`artistic-text`,C=t===`geo`||t===`shape`||t===`draw`||t===`filter`||t===`container`||x||_||S,w=e.is_background_pattern===!0||e.id===`background-pattern-slot`;if(!(t===`group`&&v.has(String(e.id)))&&!(t===`pattern`||w)&&!m&&!(C&&(r.fills?.length||a.width!==void 0||t===`filter`||t===`container`||x||_||S)))return null;let T=Re(e,m),E=m,D=!1;T||(/<svg|<span|<div|<a|<img/i.test(E)&&(E=E.replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`)),D=!!d&&!ze(e));let te=!T&&(D||/<svg|<span|<div|<a|<img/i.test(E));E=E.replace(/\\n/g,`
|
|
93
|
+
`);let O=r.type===`text`?r.text?.align??`left`:`left`,k=`center`;O===`left`?k=`flex-start`:O===`right`&&(k=`flex-end`);let A=document.createElement(`div`);A.className=`oim-slot`,A.setAttribute(`part`,`slot`),A.setAttribute(`data-slot-id`,e.id),r.languages&&!r.languages.includes(o.lang)&&(A.style.display=`none`),A.style.zIndex=w?`0`:`1`;let ne=r.animations?.find(e=>e.on===`enter`&&e.preset);A._oimReveal=ne?{effect:ne.preset,duration:ne.duration,easing:ne.easing}:void 0;let re=!!r.interactions?.length;_||re&&!o.disableActions||A.setAttribute(`data-oim-passthrough`,``);let ie=r.fills?.[0],j=ie?.kind===`pattern`?ie.pattern:void 0,ae=j?Ir(j,b):{};if(w){A.style.pointerEvents=`none`;let e=d?ht(d,gt(r,b.literal),!0):``;if(e||j){if(_i(A,ae,e),(j?.fit===`cover`?`cover`:`tile`)==`cover`)A.style.backgroundSize=`cover`,A.style.backgroundRepeat=`no-repeat`,A.style.backgroundPosition=`center`,A.style.setProperty(`--oim-pat-size`,`cover`),A.style.setProperty(`--oim-pat-repeat`,`no-repeat`),A.style.setProperty(`--oim-pat-pos`,`center`);else{let e=160*(j?.scale||1)/f*100;A.style.backgroundSize=e.toFixed(4)+`cqw `+e.toFixed(4)+`cqw`,A.style.backgroundRepeat=`repeat`,A.style.setProperty(`--oim-bg-tile`,e.toFixed(4)+`cqw`)}let t=j?.motion,n=t?`background-animation-${t.direction} ${t.period||8}s linear infinite`:void 0;!o.disableAnimations&&typeof n==`string`&&n.indexOf(`background-animation-`)===0&&(A.style.animation=n),E=``,D=!1}}if(t===`pattern`){let e=vr(r.type===`shape`?r.geometry:void 0),t=Nr({...ae,geoShape:e.round?`circle`:e.preset});for(let[e,n]of Object.entries(t))e.startsWith(`--`)?A.style.setProperty(e,n):A.style[e]=n;(ae.fillPatternColorRole||ae.fillPatternBgColorRole)&&_i(A,ae,``)}let M=document.createElement(`div`);M.className=`oim-slot-loop-wrap`;let N=document.createElement(`div`);N.className=`oim-slot-hover-wrap`,(D||T||t===`lottie`||S)&&(M.style.height=`100%`,N.style.height=`100%`);let P=null,F=t===`text`?r.fills?.[0]:void 0;if(F){let e=Vr(F,{colors:b,isText:!0,width:r.box.width||f,height:r.box.height||p});P=Object.keys(e).length>0?e:null}let oe=P!==null&&(P.backgroundClip===`text`||P.webkitBackgroundClip===`text`),se=r.box.width!==void 0&&r.box.height!==void 0,ce=oe&&se;if(T){let t=E.trim();if(t.startsWith(`<`)){let e=t.match(/src=["']([^"']+)["']/);e&&e[1]&&(t=e[1])}let n=qt(t),i=document.createElement(`img`);n?i.src=t:(console.warn(`[OimPlayer] Image not embedded in the file (network URLs are not loaded), slot:`,e.id),i.src=``),i.alt=``,i.draggable=!1,i.style.width=`100%`,i.style.height=`100%`;let a=u?.fit,o=u?.crop;if(i.style.objectFit=a||`cover`,o){let e=Xi(o);i.style.objectFit=e.objectFit,i.style.objectPosition=e.objectPosition,i.style.transform=e.transform,i.style.transformOrigin=e.transformOrigin,N.style.overflow=`hidden`}i.style.display=`block`,i.style.pointerEvents=`none`,i.style.filter=e.type===`image`?_e(it(r.image?.filters))??``:``,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,i.onerror=function(t){console.error(`[OimPlayer] Image slot failed to load for slot:`,e.id,`error:`,t),i.style.display=`none`},N.appendChild(i)}else if(t===`lottie`){let t=document.createElement(`div`);t.className=`oim-lottie-container`,t.style.width=`100%`,t.style.height=`100%`,N.appendChild(t),o.allowLottie?ir().then(function(n){let r=typeof E==`string`&&(E.startsWith(`http`)||E.endsWith(`.json`)||E.trim().indexOf(`{`)!==0);if(r){console.warn(`[OimPlayer] Lottie animation must be a valid JSON string. External URLs are not supported.`);return}let i=n.loadAnimation({container:t,renderer:`svg`,loop:!o.disableAnimations,autoplay:!o.disableAnimations&&!o._paused,path:r?E.trim():void 0,animationData:r?void 0:JSON.parse(E)});o.disableAnimations&&i.goToAndStop(0,!0),o._lottieInstances.push({slotId:String(e.id),inst:i})}).catch(function(e){console.error(`[OIM Player] Error loading local Lottie bundle. Hiding dynamic element:`,e),A.style.display=`none`}):(console.warn(`[OIM Player] Lottie animation slot ${e.id} detected but allowLottie option is false. Hiding dynamic element.`),A.style.display=`none`)}else if(S){M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.display=`flex`,N.style.alignItems=`center`,N.style.justifyContent=`center`,N.style.pointerEvents=`none`;let t=_a(r,o.lang,ee),n=Mn(t.fontFamily,o.embeddedFontFamilies);n&&(t.fontFamily=n.replace(/, sans-serif$/,``));let i=va(t,String(e.id));if(typeof DOMParser<`u`){let e=new DOMParser().parseFromString(i,`image/svg+xml`).documentElement;e&&N.appendChild(e)}else N.innerHTML=i}else if(te){let e=N;if(ce){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let t=Kt(E);if(typeof DOMParser<`u`){let n=new DOMParser().parseFromString(t,`text/html`);for(;n.body.firstChild;)e.appendChild(n.body.firstChild)}else{let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}}else{let e=N;if(ce){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let n=r.animations?.find(e=>e.on===`load`&&e.preset),i=n?.params??{},a={type:n?.preset,speed:i.speed,delay:n?.delay?+(n.delay/1e3).toFixed(6):void 0,cursor:i.cursor,intensity:i.intensity},s=a.type,c=(t===`text`?r.text:void 0)??{};Ea(e,c.highlight);let l=c.marks,u=Hn(E,l);s===`wave-chars`&&!o.disableAnimations?(Sa(o.host.shadowRoot),ya(e,u,typeof a.speed==`number`?a.speed:.05,typeof a.delay==`number`?a.delay:0)):Qn(s)&&!o.disableAnimations?(xa(o.host.shadowRoot,s),ba(e,u,s,a.speed,a.delay)):s===`typewriter`&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,wa(e,u,a.speed,a.delay,a.cursor)):s?.startsWith(`glitch-`)&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,Ta(e,u,s,a.speed,a.delay,a.intensity)):Da(e,E,c.dropCap,l)||Un(e,E,l)}M.appendChild(N);let le=r.motion?.loop,I=le?{enabled:!0,speedPxSec:le.speedPxSec,direction:le.direction,mirror:le.mirror??!0,pauseOnHover:!!le.pauseOnHover}:void 0,L=!1;if(I&&I.enabled){let e=I.infinite||{},t=e.enabled===!1||o._isStill()?0:I.speedPxSec===void 0?e.speedPxSec===void 0?e.speed_px_sec===void 0?I.mode===`infinite_horizontal`?I.speed===void 0?20:I.speed:0:e.speed_px_sec:e.speedPxSec:I.speedPxSec,n=I.direction||e.direction||`right_to_left`,i=I.mirror===void 0?I.seamlessTile===void 0?e.mirror===void 0?e.seamlessTile===void 0?e.seamless_tile===void 0||!!e.seamless_tile:!!e.seamlessTile:!!e.mirror:!!I.seamlessTile:!!I.mirror,a=I.pauseOnHover===void 0?e.pauseOnHover===void 0?!!e.pause_on_hover:!!e.pauseOnHover:!!I.pauseOnHover,s=Ui({speedPxSec:Number(t)||0,direction:n,mirror:i,pauseOnHover:a},r.box.width||f||f,f);if(s.duplicate){L=!0,Wi(o.host.shadowRoot);let e=document.createElement(`div`);e.className=`${zi} ${Bi}`;for(let[t,n]of Object.entries(s.container))e.style.setProperty(t,n);for(let t=0;t<s.copies;t++){let n=t===0?M:M.cloneNode(!0);for(let[e,t]of Object.entries(s.copy))n.style.setProperty(e,t);if(t%2==1)for(let[e,t]of Object.entries(s.secondCopy))n.style.setProperty(e,t);e.appendChild(n)}A.appendChild(e)}}L||A.appendChild(M);let ue=r.geometry?.trim,de=r.animations?.find(e=>e.on===`load`&&e.tracks?.some(e=>e.property===`trimEnd`)),fe=e=>+(e*100).toFixed(6),R=ue||de?{strokeWidth:1,trimStart:fe(ue?.start??0),trimEnd:fe(ue?.end??1),trimDuration:de?+(de.duration/1e3).toFixed(6):0}:void 0;te&&R&&(R.trimDuration&&xi(o.host.shadowRoot),Si(N,R));let z=Ie(r,o.lang),B={lineHeight:r.text?.lineHeight},pe=z?.fontSize??`16px`,me=z?.fontFamily,he=w?`none`:z?.maxWidth??(r.type===`text`&&!T?`80%`:`none`),ge=S||!T&&!D&&t!==`lottie`&&E.trim()!==``;if(me&&ge){let e=Zt(me),t=Mn(e,o.embeddedFontFamilies);A.style.setProperty(`font-family`,t||e)}if(k=L||O===`left`?`flex-start`:O===`right`?`flex-end`:`center`,A.style.maxWidth=he,A.style.fontSize=pe,A.style.lineHeight=String(ia(B)),z)for(let e of[`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`textDecoration`])z[e]&&(A.style[e]=z[e]);if(t===`text`&&F){let e=`kind`in F&&F.kind===`color`?b.css(F.value):``;e&&A.style.setProperty(`color`,e)}if(P){if(ce){M.style.position=`absolute`,M.style.top=`0`,M.style.left=`0`,M.style.right=`0`,M.style.bottom=`0`,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.boxSizing=`border-box`,N.style.setProperty(`padding-right`,`0.25em`,`important`),N.style.display=`flex`,N.style.flexDirection=`column`,N.style.justifyContent=`center`,N.style.alignItems=k,Object.assign(N.style,P);let e=oa(ia(B));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}else if(Object.assign(A.style,P),oe){let e=oa(ia(B));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}}A.style.textAlign=O,A.style.display=`flex`,A.style.flexDirection=`column`,A.style.justifyContent=`center`,A.style.alignItems=k,A.style.opacity=`0`,A.style.transition=`opacity 0.3s ease`,A.style.whiteSpace=`pre-line`,A.style.overflow=sa({isText:t===`text`,isParallaxGroup:!!r.motion?.loop||!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop),hasFilterOrShadow:!1,hasKeyframes:!!r.animations?.some(Fa)});let ve=o.metadata?.canvas_width||o.metadata?.canvasWidth||(o.metadata?.canvas?o.metadata.canvas.natural_width:800);_&&ca(A),a.width!==void 0&&a.height!==void 0?(A.style.width=(a.width/ve*100).toFixed(4)+`cqw`,A.style.height=(a.height/ve*100).toFixed(4)+`cqw`):(A.style.width=`max-content`,A.style.height=`auto`);let V=r.fills?.[0],H=V&&`kind`in V?V.kind:void 0,U=vr(r.type===`shape`?r.geometry:void 0),be=(t===`svg`||D)&&!x&&(H===`pattern`||H===`generative`),xe=C&&!x&&H===`image`?String(V.src||``).trim():``,W=!!xe&&qt(xe),Se=be||(t===`geo`||t===`shape`)&&!x&&(W||H===`gradient`||H===`generative`||H===`pattern`&&!w),Ce=r.fills?.[1],we=H===`image`&&Ce?.kind===`color`?b.css(Ce.value):void 0,Te=H===`color`?b.css(V.value):W?void 0:we,Ee=r?.type===`shape`&&r.geometry?.kind===`paths`;Te&&C&&!x&&t!==`text`&&!S&&!Se&&!Ee&&A.style.setProperty(`background-color`,Te);let De=t===`svg`||D||r.geometry?.kind===`paths`||C&&!!U.silhouette,Oe=y.get(String(e.id)),G=Oe?.strokes?.find(e=>!e.align&&`kind`in e.paint&&e.paint.kind===`color`&&typeof e.width==`number`),K=Oe?.type===`text`?{color:``,width:0,style:void 0}:G?{color:b.css(G.paint.value)||``,width:G.width,style:G.style}:{color:``,width:0,style:void 0};K.color&&K.width&&!x&&!De&&A.style.setProperty(`border`,`${K.width}px ${K.style||`solid`} ${K.color}`),xe&&!W&&console.warn(`[OimPlayer] Fill image not embedded in the file (network URLs are not loaded), slot:`,e.id);let q=C&&!x?U.silhouette:null;if(q){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`viewBox`,q.viewBox),t.setAttribute(`preserveAspectRatio`,`none`),t.style.position=`absolute`,t.style.left=`0`,t.style.top=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`block`,t.style.overflow=`visible`;let n=document.createElementNS(e,q.points?`polygon`:`path`);q.points?n.setAttribute(`points`,q.points):n.setAttribute(`d`,q.d);let r=U.fillable,i=r&&W;n.setAttribute(`fill`,r&&Te&&!Se&&!i?Te:`none`);let a=G?K.width:0,o=G?K.color:``;a&&o&&(n.setAttribute(`stroke`,o),n.setAttribute(`stroke-width`,String(a)),n.setAttribute(`vector-effect`,`non-scaling-stroke`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`stroke-linecap`,`round`),K.style===`dashed`?n.setAttribute(`stroke-dasharray`,`6,4`):K.style===`dotted`&&n.setAttribute(`stroke-dasharray`,`2,3`)),t.appendChild(n),A.appendChild(t),i&&ea(A,V,{d:q.d??`M `+q.points.split(` `).join(` L `)+` Z`,viewBox:q.viewBox},xe,we),A.style.backgroundColor=`transparent`,A.style.padding=`0`,A.style.overflow=`visible`}else C&&!x&&U.round&&(A.style.borderRadius=`50%`);if(W&&!q){let e=typeof r.corners==`number`?r.corners:0,t=r.box.width||f,n=r.box.height||p;ea(A,V,{d:``,viewBox:`0 0 1 1`,rect:{rx:Math.min(Math.max(e/t,0),.5),ry:Math.min(Math.max(e/n,0),.5)}},xe,we)}if(Se){let e=document.createElement(`div`);e.className=`oim-fill-layer`,e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.borderRadius=`inherit`;let t={...V?Vr(V,{colors:b,width:r.box.width||f,height:r.box.height||p}):{},...W&&Ce?.kind===`color`&&ee(Ce.value)?{backgroundColor:ee(Ce.value)}:{},...be?Mr(E):Ar(U.round?`circle`:U.preset,U.path?{svgPath:U.path.d,svgViewBox:U.path.viewBox}:void 0)};be&&!M.style.position&&(M.style.position=`relative`);for(let[n,r]of Object.entries(t))n.startsWith(`--`)?e.style.setProperty(n,r):e.style[n]=r;A.insertBefore(e,A.firstChild)}x&&(A.style.overflow=`visible`,A.style.display=`block`,A.style.setProperty(`padding`,`0`,`important`),A.appendChild(Aa(e,{width:f,height:p}))),(!ge&&!x||L)&&A.style.setProperty(`padding`,`0`,`important`);let ke=g.get(String(e.id)),Ae=null;{let e=a;A.style.position=`absolute`;let t,n=`-50%`;if(e.width!==void 0&&e.height!==void 0){t=L||O===`left`?`0%`:O===`right`?`-100%`:`-50%`;let n=t===`0%`?0:t===`-100%`?1:.5;A.style.left=(e.x+e.width*n).toFixed(2)+`px`,n>0&&ge&&!S&&(A.style.left=`calc(${A.style.left} + ${.25*n}em)`),A.style.top=(e.y+e.height/2).toFixed(2)+`px`}else[t,n]=dt(e),L&&(t=`0%`),A.style.left=e.x.toFixed(2)+`px`,A.style.top=e.y.toFixed(2)+`px`;A.style.setProperty(`--oim-tx`,t),A.style.setProperty(`--oim-ty`,n),A.style.setProperty(`--oim-rot`,(e.rotation||0)+`deg`),Ae={x:e.x,y:e.y,width:e.width??0,height:e.height??0}}let J=ye(e)&&!w&&Ae?ta(Ae,{width:f,height:p}):null;w&&(A.style.left=`0`,A.style.top=`0`,A.style.width=`100%`,A.style.height=`100%`,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.padding=`0`,A.style.boxSizing=`border-box`,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-rot`,`0deg`));let je=y.get(String(e.id))?.type===`text`?(()=>{let t=y.get(String(e.id))?.strokes?.[0];return t&&`kind`in t.paint&&t.paint.kind===`color`&&typeof t.width==`number`?{width:t.width,color:b.css(t.paint.value)||``}:void 0})():void 0;je&&(A.style.setProperty(`-webkit-text-stroke`,je.width+`px `+je.color),A.style.setProperty(`paint-order`,`stroke fill`));let Me=e=>{let n=Ri[e.preset];if(n){if(t===`text`||t===`artistic-text`){let t=e.scale||1,i=n.tileWidth*t,a=n.tileHeight*t,o=r.fills?.[0],s=o?.kind===`color`&&b.css(o.value)||`#18181b`,c=o?.kind===`gradient`?Vr(o,{colors:b}).backgroundImage:void 0,l=e.blend||n.defaultBlend||`overlay`;c?(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), `+c,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l+`, normal`):(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), linear-gradient(`+s+`, `+s+`)`,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l),A.style.webkitBackgroundClip=`text`,A.style.backgroundClip=`text`,A.style.webkitTextFillColor=`transparent`,A.style.color=`transparent`;let u=oa(ia(B));u>0&&(A.style.setProperty(`padding-top`,u+`em`,`important`),A.style.setProperty(`padding-bottom`,u+`em`,`important`))}else{let r=document.createElement(`div`);r.className=`oim-effect-texture`,r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.borderRadius=`inherit`,r.style.mixBlendMode=e.blend||n.defaultBlend||`overlay`;let i=(e.intensity===void 0?n.defaultIntensity:e.intensity)/100;r.style.opacity=String(i);let a=e.scale||1,o=n.tileWidth*a,s=n.tileHeight*a;r.style.backgroundImage=`url("${n.getDataUri(e.color,e.intensity)}")`,r.style.backgroundRepeat=`repeat`,r.style.backgroundSize=`${o}px ${s}px`,r.style.zIndex=`1`;let c=qn({type:t,svg:D?E:void 0,image:T?E.trim():void 0,fit:u?.fit});if(c){let e=r.style;e.maskImage=e.webkitMaskImage=c.image,e.maskSize=e.webkitMaskSize=c.size,e.maskRepeat=e.webkitMaskRepeat=`no-repeat`,e.maskPosition=e.webkitMaskPosition=`center`}A.appendChild(r)}}},Ne=e=>{A.style.filter=(A.style.filter?A.style.filter+` `:``)+e},Pe=e=>{A.style.textShadow=A.style.textShadow?A.style.textShadow+`, `+e:e},Y=ot(r.effects,{isText:t===`text`,grainable:Ei.includes(t),layerId:String(e.id),colorCss:e=>b.css(e)});Y.filter&&Ne(Y.filter),Y.textShadow&&Pe(Y.textShadow);for(let e of Y.defs)e.kind===`grain`?o._defineLayerGrain(e.id,e.effect):e.kind===`texture`&&Me({...e.effect,color:e.effect.color===void 0?void 0:ee(e.effect.color)});let Fe=r.opacity??1;if(A.dataset.oimOpacity=String(Fe),A.style.setProperty(`--oim-target-opacity`,String(Fe)),r.visible===!1&&(A.style.display=`none`,A.style.opacity=`0`,A.style.pointerEvents=`none`),t===`filter`){let t=Y.defs.some(e=>e.kind===`duotone`)?`url(#`+Jr(e)+`)`:Y.backdropFilter;t&&(A.style.backdropFilter=t,A.style.webkitBackdropFilter=t)}if(t===`container`){let e=r.box.width||300,t=r.box.height||200,n=r.fills?.[0],i=n?Vr(n,{colors:b,width:e,height:t}):{};Object.assign(A.style,i)}let X=r.corners;if(X!==void 0&&!U.round&&(A.style.borderRadius=(Array.isArray(X)?X:[X]).map(e=>e+`px`).join(` `)),J){A.style.left=J.left,A.style.top=J.top,A.style.width=J.width,A.style.height=J.height,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.setProperty(`padding`,`0`,`important`),A.style.transformOrigin=J.transformOrigin,A.style.pointerEvents=J.pointerEvents,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-scale`,`1`);let t=!!v.get(e.id)?.some(e=>y.get(String(e))?.motion?.loop);A.style.overflow=t?`hidden`:`visible`,c(M,`data-oim-group`,`data-oim-grupo`,String(e.id)),M.style.transformOrigin=J.transformOrigin,M.style.height=`100%`,M.style.overflow=`visible`}let Be=r.animations?.find(Fa),Ve=r.animations?.find(e=>e.on===`loop`&&e.preset),Ue=r.animations?.find(e=>e.on===`hover`&&e.preset),We=e=>e?+(e/1e3).toFixed(6):0,Ge=Be||Ve||Ue?{frames:Be?za(Be.tracks):void 0,duration:Be?We(Be.duration):0,trigger:Be?.on===`action`?`action`:void 0,loop:Ve?.preset,loopDuration:We(Ve?.duration),loopDelay:We(Ve?.delay),hover:Ue?.preset}:void 0;if(Ge&&!o.disableAnimations){let t=Ge;if(t.frames&&typeof M.animate==`function`){let n=t.duration;{let r=t.frames,i=t.trigger===`action`,a=M.animate(r,{duration:n*1e3,iterations:i?1:1/0,easing:`linear`,...i?{fill:`both`}:{}});i?(a.pause(),a.currentTime=0):(o._paused&&a.pause(),o._animations.push(a)),o._timelines.set(String(e.id),a)}}t.loop&&t.loop!==`none`&&t.loop!==`custom`&&(M.classList.add(`oim-loop-`+t.loop),t.loopDuration&&M.style.setProperty(`--oim-loop-duration`,t.loopDuration+`s`),t.loopDelay&&M.style.setProperty(`--oim-loop-delay`,t.loopDelay+`s`)),t.hover&&t.hover!==`none`&&t.hover!==`custom`&&N.classList.add(`oim-hover-`+t.hover)}let Ke=r.animations?.find(e=>e.on===`hover`&&e.tracks),qe=e=>{let t=Ke?.tracks?.find(t=>t.property===e)?.keyframes;return t?t[t.length-1].v:void 0},Je=e=>(r.interactions??[]).filter(t=>t.on===e).flatMap(e=>e.actions),Ye={hover:{scale:qe(`scale`),rotation:qe(`rotation`),opacity:qe(`opacity`)===void 0?void 0:+(qe(`opacity`)*100).toFixed(6),transitionDuration:Ke&&Ke.duration>0?+(Ke.duration/1e3).toFixed(6):void 0,actions:Je(`hover`)},active:{actions:Je(`press`)}};if(!o.disableActions&&(Ke||r.interactions?.length)){let t={},n={},r=new Set;la(A,Ye,function(e,t){o.queueUpdate(e,t)},{run:function(i,a){let s=o.host.shadowRoot;if(!s)return;let c=new CustomEvent(`oim:action`,{cancelable:!0,detail:{slot:e.id,name:e.name,trigger:a||`unknown`,targets:i.map(function(e){return e.target}),types:i.map(function(e){return e.type})}});if(o.host.dispatchEvent(c),c.defaultPrevented)return;i.forEach(function(e){e.type===`play`&&e.target&&o._playTimeline(String(e.target))});let l={};i.forEach(function(i){if(!i.target||i.type===`play`)return;let a=s.querySelector(`[data-slot-id="`+i.target+`"]`);!a&&!r.has(i.target)&&(r.add(i.target),console.warn(`[OimPlayer] The slot "`+e.id+`" has an action "`+i.type+`" aimed at "`+i.target+`", which does not exist in this file. It does nothing.`));let o=!a||a.style.display!==`none`&&a.style.opacity!==`0`;if(l[i.target]=o,t[i.target]===void 0&&(t[i.target]=o),i.type===`setText`&&n[i.target]===void 0){let e=a?a.querySelector(`.oim-slot-hover-wrap`):null;n[i.target]=e?e.textContent||``:a&&a.textContent||``}});let u=fa(i,l);for(let[e,t]of Object.entries(u.visibility)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);n&&(t?o._showSlotElement(n):o._hideSlotElement(n))}for(let[e,t]of Object.entries(u.texts)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);if(!n)continue;let r=n.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:n.textContent=t}},revert:function(e){let r=o.host.shadowRoot;r&&e.forEach(function(e){if(!e.target||e.type===`play`)return;let i=r.querySelector(`[data-slot-id="`+e.target+`"]`);if(i){if(t[e.target]!==void 0){let n=t[e.target];delete t[e.target],n?o._showSlotElement(i):o._hideSlotElement(i)}if(n[e.target]!==void 0){let t=n[e.target];delete n[e.target];let r=i.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:i.textContent=t}}})}},function(e,t){o._activeTouchSlot&&o._activeTouchSlot.el!==e&&o._activeTouchSlot.leave(),o._activeTouchSlot={el:e,leave:t}})}S&&(A.style.backgroundColor=`transparent`,A.style.overflow=`visible`,A.style.setProperty(`padding`,`0`,`important`));let Xe=Zi(a.flipX,a.flipY);if(Xe){let e=document.createElement(`div`);for(e.setAttribute(`data-oim-flip`,``),e.style.width=`100%`,e.style.height=`100%`,e.style.transformOrigin=`50% 50%`,e.style.transform=`scale(`+Xe[0]+`, `+Xe[1]+`)`;A.firstChild;)e.appendChild(A.firstChild);A.appendChild(e)}return{slotEl:A,zoneId:ke,slot:e}}),C=await Promise.all(S),w=[],T=new Set;s.forEach(function(e,t){let n=e&&e.id!==void 0&&e.id!==null&&e.id!==``?String(e.id):``,r;n?T.has(n)?(console.warn(`[OimPlayer] Duplicate slot id "`+n+`" at index `+t+`; rendering it unkeyed and in stack order.`),r=`__oim-dup-`+n+`-`+t):r=n:(console.warn(`[OimPlayer] Slot #`+t+` has no id; rendering it unkeyed and in stack order.`,e),r=`__oim-unkeyed-`+t),T.add(r),w.push(r)});let E=new Map;C.forEach(function(e,t){if(!e)return;let n=e.slotEl,r=e.zoneId;r&&h[r]?h[r].appendChild(n):E.set(w[t],n)});let D=[];s.forEach(function(e,t){let n=g.get(String(e.id));n&&h[n]||D.push({id:w[t],type:e.type,style:e.style||{},duotone:e.type===`filter`&&y.get(String(e.id))?.effects?.some(e=>e.kind===`backdrop`&&e.preset===`duotone`),position:e.position,width_px:e.width_px,height_px:e.height_px})});let te=Qr(D),O=D.some(function(e){return e.type===`mask`}),k=D.some(function(e){return!!e.duotone});if((O||k)&&m.appendChild(ja(D,{width:f,height:p})),te.forEach(function(e){Ma(e,m,E)}),n?C.forEach(function(e){if(!e)return;let t=e.slotEl.getAttribute(`data-slot-id`)||``,n=r.querySelector(`[data-slot-id="`+t+`"]`);if(n&&n.parentNode){let t=n.querySelectorAll(`[data-oim-group] > [data-slot-id], :scope > [data-slot-id]`);for(let n=0;n<t.length;n++)e.slotEl.appendChild(t[n]);n.parentNode.replaceChild(e.slotEl,n)}}):(r.innerHTML=``,r.appendChild(m)),v.size>0){let e=function(e){for(let t in h)if(h[t]&&h[t].contains(e))return!0;return!1};v.forEach(function(t,n){let i=r.querySelector(`[data-slot-id="`+n+`"]`);if(!i||e(i))return;let a=i.querySelector(`[data-oim-group="`+n+`"]`)||i;t.forEach(function(t){let n=r.querySelector(`[data-slot-id="`+t+`"]`);n&&!e(n)&&a.appendChild(n)})})}try{await Promise.all(d)}catch(e){console.warn(`[OIM Player] Font load fallback activado.`,e)}r.querySelectorAll(`.oim-slot`).forEach(function(e){e.style.opacity=e.dataset.oimOpacity===void 0?`1`:e.dataset.oimOpacity}),await o._mediaSettled(r),o._buildA11y(),o.updateViewportSize(),o.updateScale(),o._viewport&&(o._viewport.classList.add(`oim-viewport--ready`),o._revealed=!0,o.sceneReady())}_defineLayerGrain(e,t){let n=this._viewport||this._overlay;if(!n||typeof DOMParser>`u`)return;let r=n.querySelector(`:scope > svg.oim-grain-defs > defs`);if(!r){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`class`,`oim-grain-defs`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`style`,`position:absolute;pointer-events:none`),r=document.createElementNS(e,`defs`),t.appendChild(r),n.appendChild(t)}let i=r.querySelector(`#`+e);i&&i.remove();let a=ki(e,{intensity:t.intensity,size:t.size,blend:t.blend}),o=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"><defs>`+a+`</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&r.appendChild(document.importNode(o,!0))}_revealed=!1;_mediaSettled(e){let t=[];e.querySelectorAll(`img`).forEach(function(e){typeof e.decode==`function`&&e.getAttribute(`src`)&&t.push(e.decode().catch(function(){}))}),(this._lottieInstances||[]).forEach(function(e){let n=e.inst;n&&!n.isLoaded&&typeof n.addEventListener==`function`&&t.push(new Promise(function(e){n.addEventListener(`DOMLoaded`,e),n.addEventListener(`data_failed`,e)}))});let n=new Promise(function(e){setTimeout(e,Na)});return Promise.race([Promise.all(t),n]).then(()=>new Promise(function(e){typeof requestAnimationFrame==`function`?requestAnimationFrame(function(){requestAnimationFrame(function(){e()})}):e()}))}_pendingDOMUpdates=new Map;_isUpdateScheduled=!1;_updateCallbacks=[];queueUpdate(e,t,n){let r={};for(let[e,n]of Object.entries(t))(typeof n==`string`||n===void 0)&&(r[e]=n);this._pendingDOMUpdates.set(e,{...this._pendingDOMUpdates.get(e)||{},...r}),n&&this._updateCallbacks.push(n),this._isUpdateScheduled||(this._isUpdateScheduled=!0,requestAnimationFrame(()=>this._flushDOMUpdates()))}_flushDOMUpdates(){this._pendingDOMUpdates.forEach((e,t)=>{for(let[n,r]of Object.entries(e))n.startsWith(`--`)?r===``||r==null?t.style.removeProperty(n):t.style.setProperty(n,String(r)):t.style[n]=r}),this._pendingDOMUpdates.clear(),this._isUpdateScheduled=!1;let e=this._updateCallbacks;this._updateCallbacks=[],e.forEach(e=>{try{e()}catch(e){console.error(e)}})}_hideSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`none`,opacity:`0`,pointerEvents:`none`}):this.queueUpdate(e,{pointerEvents:`none`},()=>{this._runReveal(e,!1,()=>this.queueUpdate(e,{display:`none`}))})}_showSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`flex`,opacity:`1`,pointerEvents:`auto`}):this.queueUpdate(e,{display:`flex`,pointerEvents:`auto`},()=>this._runReveal(e,!0))}_playTimeline(e){let t=this._timelines.get(e);t?(t.currentTime=0,this._paused||t.play()):!this.disableAnimations&&!this._warnedPlay.has(e)&&(this._warnedPlay.add(e),console.warn(`[OimPlayer] play: no animation`,e))}_runReveal(e,t,n){let r=this._revealAnims.get(e),i=r?getComputedStyle(e):void 0;r&&(r.cancel(),this._revealAnims.delete(e)),e.style.opacity=t?`1`:`0`;let a=hi(e._oimReveal,t);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||a.duration===0||typeof e.animate!=`function`){n?.();return}let o=mi(a.effect,t);if(i)for(let e of[`opacity`,`translate`,`scale`]){let t=i[e];t&&t!==`none`&&(o[0][e]=t)}let s=e.animate(o,{duration:a.duration,easing:a.easing,fill:`both`});this._paused&&s.pause(),this._revealAnims.set(e,s),s.onfinish=()=>{this._revealAnims.delete(e),s.cancel(),n?.()}}_buildA11y(){let e=this._viewport;if(!e||!this.metadata)return;let t=this.metadata,n=t.lang&&t.lang[0]||t.languages&&t.languages[0]||this.lang,r=this._a11yHidden,i=this._a11yShown,a=Ji((t.slots||t.elements||[]).filter(function(e){return!r.has(String(e&&e.id))}).map(function(e){return i.has(String(e&&e.id))?Object.assign({},e,{style:Object.assign({},e.style,{isVisible:!0})}):e}),this.lang,n,!this.disableActions);this._overlay&&this._overlay.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`figure`),e.setAttribute(`aria-label`,Yi(t,a,this.lang,n));let o=e.querySelector(`.oim-a11y`);o||(o=document.createElement(`div`),o.className=`oim-a11y`,o.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap`,e.appendChild(o)),o.textContent=``;let s=this;a.forEach(function(e){let t;if(e.type===`text`)t=document.createElement(`p`),t.setAttribute(`lang`,e.lang),t.textContent=e.text;else if(e.type===`image`)t=document.createElement(`span`),t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,e.label);else{t=document.createElement(`button`),t.setAttribute(`type`,`button`),t.textContent=e.label;let n=function(){let t=s._overlay&&s._overlay.querySelector(`[data-slot-id="`+CSS.escape(e.slotId)+`"]`);t&&t.click()};t.addEventListener(`click`,n),t.addEventListener(`keydown`,function(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())})}o.appendChild(t)})}_a11yHidden=new Set;_a11yShown=new Set;executeToggleState(e){if(!e)return;let t=this.host.shadowRoot;if(!t)return;let n=this,r=e.hide_slots||[];r.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._hideSlotElement(r)});let i=e.show_slots||[];i.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._showSlotElement(r)}),r.forEach(function(e){n._a11yHidden.add(String(e)),n._a11yShown.delete(String(e))}),i.forEach(function(e){n._a11yShown.add(String(e)),n._a11yHidden.delete(String(e))}),this._buildA11y()}_activeTouchSlot=null;clearSlots(){this._activeTouchSlot&&=null;let e=this._overlay;e&&(e.replaceChildren?e.replaceChildren():e.innerHTML=``)}setLang(e){if(this.lang===e)return;let t=this.lang;this.lang=e,this.host.setAttribute(`lang`,e),this._buildA11y();let n=this._classifyLangChange(t,e);(n.styleOnly.size>0||n.content.size>0)&&(this._prefersLessMotion()||this._isLowTierOrMobile()?this._switchWithFade(n):this._switchWithBlur(n)),this.host.dispatchEvent(new CustomEvent(`oim:langchange`,{detail:{lang:e}}))}_isLowTierOrMobile(){let e=this.host;if(e&&typeof e.getAttribute==`function`){let t=e.getAttribute(`tier`)||e.getAttribute(`quality`);if(t===`low`)return!0;if(t===`high`)return!1}return this._deviceProfile.isMobile||this._deviceProfile.tier===`low`}_prefersLessMotion(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}_switchWithBlur(e){let t=this._viewport,n=this;t?(t.style.transition=`filter 0.18s ease-out`,t.style.filter=`blur(14px)`,setTimeout(function(){let r=n._applyLangChange(e),i=new Promise(function(e){setTimeout(e,600)});Promise.race([r||Promise.resolve(),i]).then(function(){t.style.transition=`filter 0.32s ease-in-out`,t.style.filter=`none`})},180)):this._applyLangChange(e)}_switchWithFade(e){let t=this.host.shadowRoot,n=this,r=new Set([...e.styleOnly,...e.content]),i=[];t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&!/opacity/i.test(n.style.animationName||``)&&i.push(n)}),i.forEach(function(e){e.style.transition=`opacity 0.12s linear`,e.style.opacity=`0`}),setTimeout(function(){n._applyLangChange(e),t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&(n.style.opacity=n.dataset.oimOpacity===void 0?`1`:n.dataset.oimOpacity)})},120)}_classifyLangChange(e,t){let n=new Set,r=new Set;return this.metadata&&(this.metadata.slots||this.metadata.elements||[]).forEach(function(i){if(!i||i.id===void 0||i.id===null)return;let a=Ue(i,e,t);a===`content`?r.add(String(i.id)):a===`style-only`&&n.add(String(i.id)),Array.isArray(i.languages)&&!i.languages.includes(`*`)&&i.languages.includes(e)!==i.languages.includes(t)&&n.add(String(i.id))}),{styleOnly:n,content:r}}_applyLangChange(e){let t=this.host.shadowRoot;if(t&&e.styleOnly.size>0&&this.metadata){let n=this.metadata.slots||this.metadata.elements||[],r=this;n.forEach(function(n){if(!n||!e.styleOnly.has(String(n.id)))return;let i=t.querySelector(`[data-slot-id="`+n.id+`"]`);if(!i)return;Array.isArray(n.languages)&&!n.languages.includes(`*`)&&(i.style.display=n.languages.includes(r.lang)?``:`none`);let a=He(n,r.lang),o=n.type===`text`?Ie(lt(r.metadata).get(String(n.id)),r.lang):void 0;i.style.fontSize=o?.fontSize??a.size,i.style.maxWidth=o?.maxWidth??a.maxWidthValue})}return e.content.size>0?this.renderSlots({onlyIds:e.content}):null}play(){this._paused=!1,this._isStill()||(this._animations.forEach(function(e){try{e.play()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.play()}catch{}}),this._textAnimations.forEach(function(e){e.play()}),this._revealAnims.forEach(function(e){e.play()}),this._heldTimelines.forEach(function(e){e.play()}),this._heldTimelines.clear())}pause(){this._paused=!0,this._textAnimations.forEach(function(e){e.pause()}),this._revealAnims.forEach(function(e){e.pause()});let e=this._heldTimelines;this._timelines.forEach(function(t){t.playState===`running`&&t.effect?.getTiming().iterations!==1/0&&(t.pause(),e.add(t))}),this._animations.forEach(function(e){try{e.pause()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.pause()}catch{}})}_bornPausedIfNeeded(e,t){this._paused&&t.pause(),e.push(t)}_destroyLottiesIn(e){if(!this._lottieInstances)return;let t=[];this._lottieInstances.forEach(function(n){if(e.has(n.slotId))try{n.inst.destroy()}catch{}else t.push(n)}),this._lottieInstances=t}};function Fa(e){return(e.on===`loop`||e.on===`action`)&&!!e.tracks&&e.tracks.some(e=>Ia[e.property]!==void 0)}var Ia={x:0,y:0,rotation:0,scale:1,opacity:1,blur:0},La=[`x`,`y`,`rotation`,`scale`];function Ra(e,t,n){if(!e)return n;let r=e.keyframes,i=r.find(e=>e.t===t);if(i)return i.v;let a=r.findIndex(e=>e.t>t);if(a<=0)return a===0?r[0].v:r[r.length-1].v;let o=r[a-1],s=r[a];return o.v+(s.v-o.v)*(t-o.t)/(s.t-o.t)}function za(e){let t=t=>e.find(e=>e.property===t),n=La.some(e=>t(e)),r=new Map;for(let t of e)if(Ia[t.property]!==void 0)for(let e of t.keyframes){let n=r.get(e.t);n||r.set(e.t,n={offset:e.t}),e.e!==void 0&&(n.easing=fi(e.e,`linear`)),t.property===`opacity`?n.opacity=e.v:t.property===`blur`?n.filter=e.v>0?`blur(`+e.v+`px)`:`none`:n.moves=!0}return[...r.values()].sort((e,t)=>e.offset-t.offset).map(function(e){let{moves:r,...i}=e;if(n&&r){let n=n=>Ra(t(n),e.offset,Ia[n]);i.transform=`translate(`+n(`x`)+`px, `+n(`y`)+`px) rotate(`+n(`rotation`)+`deg) scale(`+n(`scale`)+`)`}return i})}function Ba(e){if(!W(e))return e;let t=we(e);return t.missing.forEach(e=>console.warn(`[OimPlayer] resource "${e}" is not in the document`)),yt(t.document)}var Va=class extends Pa{fileMetadata=null;_posterFade=!1;constructor(e,t){super();let n=t||{};this.host=e,this.poster=n.poster===`only`?`only`:`auto`,this.lang=e.getAttribute(`lang`)||`en`,this.showControls=e.getAttribute(`show-controls`)!==`false`,this._deviceProfile=m(),this.allowZoom=n.allowZoom===!0,this.showLanguageSelector=n.showLanguageSelector!==!1,this.showSlots=n.showSlots!==!1,this.allowLottie=n.allowLottie!==!1&&e.getAttribute(`allow-lottie`)!==`false`,this.allowDynamicColors=n.allowDynamicColors!==!1&&e.getAttribute(`allow-dynamic-colors`)!==`false`;let r=o(e,n,typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);this.disableAnimations=r.disableAnimations,this.disableActions=r.disableActions,this.dropdownBlur=n.dropdownBlur!==!1&&e.getAttribute(`dropdown-blur`)!==`false`,this.fit=n.fit||`contain`,this.align=n.align||`center`}destroy(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._onFullscreenChange&&(document.removeEventListener(`fullscreenchange`,this._onFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`MSFullscreenChange`,this._onFullscreenChange)),this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]),this._animations.forEach(function(e){try{e.cancel()}catch{}}),this._animations=[],this._timelines.clear(),this._revealAnims.clear(),this._heldTimelines.clear(),this._textAnimations.forEach(function(e){try{e.stop()}catch{}}),this._textAnimations=[],this._onDragMove&&=(window.removeEventListener(`mousemove`,this._onDragMove),null),this._onDragEnd&&=(window.removeEventListener(`mouseup`,this._onDragEnd),null)}async load(e){let t=this.host,n=t.shadowRoot||t.attachShadow({mode:`open`});try{if(typeof e==`string`?this.imageUrl=e:(this.imageUrl&&this.imageUrl.startsWith(`blob:`)&&URL.revokeObjectURL(this.imageUrl),this.imageUrl=URL.createObjectURL(e)),t.classList.add(`oim-player-host`),t.classList.add(`oim-align-`+this.align),t.classList.add(`oim-tier-`+this._deviceProfile.tier),this._deviceProfile.isMobile&&t.classList.add(`oim-mobile`),n.innerHTML=`<div class="oim-player-viewport oim-fit-`+this.fit+`" part="viewport"><img class="oim-player-base" crossorigin="anonymous"`+(typeof e==`string`?``:` src="`+this.imageUrl+`"`)+` alt="" aria-hidden="true" part="base" /><div class="oim-layer-overlay" aria-hidden="true" part="overlay"></div></div>`,M(n),this._viewport=n.querySelector(`.oim-player-viewport`),this._baseImg=n.querySelector(`.oim-player-base`),this._overlay=n.querySelector(`.oim-layer-overlay`),this._stage=this.host,!this.allowDynamicColors&&this._viewport)for(let e of se)this._viewport.style.setProperty(`--oim-color-`+e,`initial`);this.applyPalette(),(this._prefersLessMotion()||this._isLowTierOrMobile())&&this._viewport&&(this._viewport.style.filter=`none`);let r=this,i=null,a=()=>{i||=requestAnimationFrame(()=>{r.updateViewportSize(),r.updateScale(),i=null})};typeof ResizeObserver<`u`&&this._viewport&&(this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(a),this._resizeObserver.observe(this.host)),this._onFullscreenChange=a,document.addEventListener(`fullscreenchange`,this._onFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.addEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.addEventListener(`MSFullscreenChange`,this._onFullscreenChange);let o=this._baseImg,l=this._viewport;function d(){l&&o&&o.naturalWidth>0&&(l.style.setProperty(`--oim-ar`,o.naturalWidth+` / `+o.naturalHeight),r._baseImg=o,r.updateViewportSize(),r.updateScale(),r.metadata&&r.renderSlots())}if(o&&o.complete&&o.naturalWidth>0?d():o&&(o.onload=d),this.updateViewportSize(),this.updateScale(),this._bindViewportEvents(),typeof e==`string`&&o){let i=await j.readPoster(e);if(i){let e=await mn(i.seal,i.imageHash);if(e===`invalid`){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,M(n);let e=n.querySelector(`.oim-player-error`);return e&&(e.textContent=u(`tampered`,r.lang)),t.dispatchEvent(new CustomEvent(`error`,{detail:Error(fn)})),!1}if(e===`expired_key`)try{c(t,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}if(this.imageUrl=URL.createObjectURL(i.png),o.src=this.imageUrl,this.poster===`only`)return this.securityStatus=e===`ok`?`verified`:`expired_key`,l?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),t.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:null,security:this.securityStatus}})),!0}else o.src=e}return j.getBlob(e).then(t=>new Promise((n,i)=>{s.requestRender(r,t,e,n,i)})).catch(e=>{if(console.error(`[OimPlayer::ImageEngine::load]`,e),String(e&&e.message).indexOf(`OIM_ALTERED`)===0){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,M(n);let e=n.querySelector(`.oim-player-error`);e&&(e.textContent=u(`tampered`,r.lang))}throw t.dispatchEvent(new CustomEvent(`error`,{detail:e})),e})}catch(e){console.error(`[OimPlayer::ImageEngine]`,e),n.innerHTML=`<div class="oim-player-error" part="error"></div>`;let r=n.querySelector(`.oim-player-error`);return r&&(r.textContent=u(`loadError`,this.lang)+e.message),t.dispatchEvent(new CustomEvent(`error`,{detail:e})),!1}}async _verifyMainThread(e){let t=await Rt(e);if(!t.metadata)return{metadata:{slots:[]},security:`no_metadata`,announce:!1};let n=pn(t.metadata);if(n.length>0)return{refused:!0,security:`corrupt`,error:`Corrupted or tampered OIM file: `+n[0]};let r=!!(t.metadata.signature&&t.metadata.key_version),i=await cn(t.metadata),a=ln({isSigned:r,isSigValid:i,keyExpired:r&&i?await un(t.metadata):!1,metadata:t.metadata,imageHash:t.imageHash});if(dn(a))return{refused:!0,security:a,error:fn+`: `+a};let o,s=!1;return i?a===`unsigned`||a===`expired_key`?o={slots:[],elements:[],layers:[]}:(s=!0,W(t.metadata)||N(t.metadata),o=t.metadata):o={slots:[]},{metadata:o,security:a,announce:s}}async _verifyWithWorker(e){let t=typeof window<`u`?window.location.hostname:``,n=typeof window<`u`?window.location.origin:``,r;try{r=await Pt(e,t,n)}catch(t){return console.warn(`[OimPlayer] Web Worker unavailable or crashed (possibly blocked by CSP). Falling back to main-thread execution.`,t),this._verifyMainThread(e)}return r.success?{metadata:r.metadata,security:r.security||`unsigned`,announce:!0}:r.refused?{refused:!0,security:r.security,error:r.error}:(console.warn(`[OimPlayer] Web Worker reported execution failure. Falling back to main-thread execution.`,r.error),this._verifyMainThread(e))}async _verify(e){return typeof Worker>`u`?this._verifyMainThread(e):this._verifyWithWorker(e)}async _applyVerified(e){let t=this,n=this.poster===`only`;this._posterFade=!n&&W(e.metadata)&&!Ce(e.metadata);let r=structuredClone(e.metadata);if(this.fileMetadata=r,this.metadata=n?structuredClone(r):Ba(structuredClone(r)),n||this.applyPalette(),this.securityStatus=e.security,this.securityStatus===`unsigned`){try{c(this.host,`data-oim-unsigned`,`data-oim-sin-firma`)}catch{}console.warn(`[OimPlayer] Unsigned file: painting the base image only. Interactive layers need a signature.`)}if(this.securityStatus===`expired_key`){try{c(this.host,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}console.warn(`[OimPlayer] This work was signed with a retired key. Ask the author to export it again.`)}return n?(this._viewport?.classList.add(`oim-viewport--poster`,`oim-viewport--ready`),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0):(e.announce&&t._announceUnsupported(this.metadata),this.embeddedFontFamilies=await jn(An(this.metadata)),this._posterFade&&this._viewport?.classList.add(`oim-viewport--poster`),this.updateViewportSize(),this.updateScale(),await this.renderSlots(),typeof document<`u`&&document.fonts&&document.fonts.ready.then(()=>{t.host&&t._overlay&&(t.updateViewportSize(),t.updateScale(),t._overlay.querySelectorAll(`.oim-slot`).forEach(e=>{let t=e.style.transition;e.style.setProperty(`transition`,`none`,`important`),e.offsetWidth,e.style.transition=t}))}),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.fileMetadata,security:this.securityStatus}})),!0)}sceneReady(){let e=this._baseImg;this._posterFade&&e&&(this._posterFade=!1,this._prefersLessMotion()?e.style.display=`none`:(e.classList.add(`oim-base--faded`),setTimeout(()=>{e.style.display=`none`},200)))}async _executeLoad(e,t){try{let n=await j.getVerified(t??e,e=>this._verify(e));if(n.refused)throw this.securityStatus=n.security,Error(n.error);return this._applyVerified(n)}catch(e){throw console.error(`[OimPlayer::ImageEngine::_executeLoad]`,e),e}}_announceUnsupported(e){let t;try{t=wn(e,{version:bn,capabilities:xn})}catch{return}if(!t.hasNotice)return;let n=Tn(t);try{console.warn(`[OimPlayer] `+n)}catch{}try{t.missingCapabilities&&t.missingCapabilities.length>0&&c(this.host,`data-oim-unsupported`,`data-oim-sin-soporte`,t.missingCapabilities.join(` `)),t.missingRequiredCapabilities&&t.missingRequiredCapabilities.length>0&&c(this.host,`data-oim-missing-required`,`data-oim-requeridas-faltantes`,t.missingRequiredCapabilities.join(` `)),t.versionTooOld&&t.requiredVersion&&c(this.host,`data-oim-required-version`,`data-oim-version-exigida`,t.requiredVersion),this.host.dispatchEvent(new CustomEvent(`oim:incomplete`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}})),t.cannotRender&&this.host.dispatchEvent(new CustomEvent(`oim:unsupported`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}}))}catch{}}updateScale(){if(!this._viewport)return;let e=this._viewport.offsetWidth,t=this.metadata&&this.metadata.canvas?this.metadata.canvas.natural_width||this.metadata.canvas.width:0,n=e/(this.metadata&&(this.metadata.artboardWidth||this.metadata.canvasWidth||this.metadata.canvas_width)||t||this._baseImg&&this._baseImg.naturalWidth||1080);this._viewport.style.setProperty(`--oim-fit`,n.toFixed(6))}updateViewportSize(){if(!this._viewport)return;let e=this._baseImg?this._baseImg.naturalWidth:0,t=this._baseImg?this._baseImg.naturalHeight:0;if(e===0&&this.metadata&&this.metadata.canvas&&(e=this.metadata.canvas.natural_width||this.metadata.canvas.width||1080,t=this.metadata.canvas.natural_height||this.metadata.canvas.height||1920),e===0)return;let n=this.host.offsetWidth,r=this.host.offsetHeight;if(n===0||r===0){if(!this._retryViewportSize){this._retryViewportSize=!0;let e=this;setTimeout(()=>{e._retryViewportSize=!1,e.updateViewportSize(),e.updateScale()},100)}return}let i=e/t,a=n/r,o,s;this.fit===`cover`?a>i?(o=n,s=n/i):(s=r,o=r*i):a>i?(s=r,o=r*i):(o=n,s=n/i),this._viewport.style.width=Math.round(o)+`px`,this._viewport.style.height=Math.round(s)+`px`}_bindViewportEvents(){let e=this,t=this._stage;if(!t)return;t.addEventListener(`pointerdown`,function(t){if(t.pointerType!==`mouse`&&e._activeTouchSlot&&(typeof t.composedPath==`function`?t.composedPath():[]).indexOf(e._activeTouchSlot.el)===-1){let t=e._activeTouchSlot;e._activeTouchSlot=null,t.leave()}});let n=!1,r=0,i=0,a=0,o=0;t.addEventListener(`mousedown`,function(s){e.allowZoom&&(e.zoom<=1||s.target.closest(`.oim-slot`)||(n=!0,e._viewport&&(e._viewport.style.transition=`none`),t.style.cursor=`grabbing`,r=s.clientX,i=s.clientY,a=e.panX,o=e.panY,s.preventDefault()))}),this._onDragMove=function(t){if(!n)return;let s=t.clientX-r,c=t.clientY-i;e.panX=a+s,e.panY=o+c,e._constrainPan(),e._applyViewportTransform()},window.addEventListener(`mousemove`,this._onDragMove),this._onDragEnd=function(){n&&(n=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`),t.style.cursor=e.zoom>1?`grab`:`default`)},window.addEventListener(`mouseup`,this._onDragEnd);let s=null,c=1,l=!1,u=0,d=0,f=0,p=0;t.addEventListener(`touchstart`,function(t){if(e.allowZoom){if(t.touches.length===2)s=Oa(t.touches),c=e.zoom,l=!1,e._viewport&&(e._viewport.style.transition=`none`);else if(t.touches.length===1&&e.zoom>1){if(t.target.closest(`.oim-slot`))return;l=!0,u=t.touches[0].clientX,d=t.touches[0].clientY,f=e.panX,p=e.panY,e._viewport&&(e._viewport.style.transition=`none`)}}},{passive:!0}),t.addEventListener(`touchmove`,function(t){if(e.allowZoom){if(t.touches.length===2&&s!==null){let n=Oa(t.touches);if(s>0){let t=n/s;e.setZoom(c*t)}}else if(t.touches.length===1&&l){let n=t.touches[0].clientX-u,r=t.touches[0].clientY-d;e.panX=f+n,e.panY=p+r,e._constrainPan(),e._applyViewportTransform()}}},{passive:!0}),t.addEventListener(`touchend`,function(){s=null,l=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`)},{passive:!0}),e.allowZoom&&t.addEventListener(`wheel`,function(t){t.preventDefault(),e.setZoom(yn(e.zoom,t.deltaY,t.deltaMode,t.ctrlKey))},{passive:!1})}_constrainPan(){let e=this.host;if(!e)return;let t=e.clientWidth,n=e.clientHeight,r=this.zoom,i=Math.max(0,t*(r-1)/2),a=Math.max(0,n*(r-1)/2);this.panX=Math.max(-i,Math.min(i,this.panX)),this.panY=Math.max(-a,Math.min(a,this.panY))}_applyViewportTransform(){this._viewport&&(this._viewport.style.transform=`translate3d(`+this.panX+`px, `+this.panY+`px, 0) scale(`+this.zoom+`)`)}setZoom(e){this.zoom=Math.max(1,Math.min(4,e)),this.zoom<=1&&(this.panX=0,this.panY=0),this._constrainPan(),this._applyViewportTransform();let t=this._stage;t&&(t.style.cursor=this.zoom>1?`grab`:`default`)}};function Ha(e,t){let n=``;if(typeof e==`string`){let t=e.indexOf(`#`),r=e.indexOf(`?`),i=t===-1?r===-1?e.length:r:t,a=e.lastIndexOf(`.`,i);a!==-1&&(n=e.substring(a+1,i).toLowerCase())}else if(e&&e.name){let t=e.name,r=t.lastIndexOf(`.`);r!==-1&&(n=t.substring(r+1).toLowerCase())}if(n===`oim`||n===`png`)return`image`;if(n===`ovm`||n===`webm`||n===`mp4`||n===`mkv`)return`video`;if(t){let e=String.fromCharCode(t[0],t[1],t[2],t[3]);if(e===`PNG`)return`image`;if(e===`OVM\0`||e===`Eߣ`)return`video`}return`image`}function Ua(e){if(!e)return null;let t=e.trim();if(/^data:image\//i.test(t))return t;try{let e=new URL(t,document.baseURI);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}var Q=Object.create(HTMLElement.prototype);function Wa(){if(typeof document>`u`||document.getElementById(`oim-player-gap`))return;let e=document.createElement(`style`);e.id=`oim-player-gap`,e.textContent=`:where(oim-player){display:block}:where(oim-player:not([data-oim-loaded])){min-height:200px}`,(document.head||document.documentElement).appendChild(e)}Q.connectedCallback=function(){Wa(),this.classList.add(`oim-player-host`),this._engine=null,this._src=this.getAttribute(`src`),this._oimOptions||={},this.hasAttribute(`fit`)&&(this._oimOptions.fit=this.getAttribute(`fit`)),this.hasAttribute(`align`)&&(this._oimOptions.align=this.getAttribute(`align`)),this.hasAttribute(`dropdown-blur`)&&(this._oimOptions.dropdownBlur=this.getAttribute(`dropdown-blur`)!==`false`),this.hasAttribute(`allow-lottie`)&&(this._oimOptions.allowLottie=this.getAttribute(`allow-lottie`)!==`false`),this.hasAttribute(`allow-dynamic-colors`)&&(this._oimOptions.allowDynamicColors=this.getAttribute(`allow-dynamic-colors`)!==`false`),this.hasAttribute(`placeholder`)&&(this._oimOptions.placeholder=this.getAttribute(`placeholder`)),this.hasAttribute(`poster`)&&(this._oimOptions.poster=this.getAttribute(`poster`)),this.hasAttribute(`allow-zoom`)&&(this._oimOptions.allowZoom=this.getAttribute(`allow-zoom`)===`true`),this._syncPlaceholder(),this._mqOscuro=typeof matchMedia==`function`?matchMedia(`(prefers-color-scheme: dark)`):null,this._onEsquema=()=>this._engine&&this._engine.applyPalette(),this._mqOscuro&&this._mqOscuro.addEventListener(`change`,this._onEsquema),this._replantearActividad()},Q._replantearActividad=function(){if(this._src&&this.isConnected){if(!this._observers){if(!(`IntersectionObserver`in window)){this._moveTo(`active`);return}let e=this,t=()=>e._scheduleDecision();this._observers=[new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isNear=r.isIntersecting),t()},{rootMargin:`200px`}),new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isVisible=r.isIntersecting),t()},{threshold:[0,.01]})],this._observers.forEach(e=>e.observe(this)),this._onTabChange=t,document.addEventListener(`visibilitychange`,this._onTabChange),this.getAttribute(`activate-on`)===`hover`&&(this._onPointerEnter=()=>{e._hasPointer=!0,t()},this._onPointerLeave=()=>{e._hasPointer=!1,t()},this.addEventListener(`mouseenter`,this._onPointerEnter),this.addEventListener(`mouseleave`,this._onPointerLeave))}this._scheduleDecision()}},Q._scheduleDecision=function(){if(this._activityFrame)return;let e=this;this._activityFrame=requestAnimationFrame(function(){e._activityFrame=null,e._decide()})},Q._decide=function(){if(!this._src||!this.isConnected)return;let e=typeof document<`u`&&document.visibilityState===`hidden`,t,n;if(typeof this._isNear==`boolean`||typeof this._isVisible==`boolean`){t=this._isNear??!1;let r=this._isVisible??!1;n=(t||r)&&r&&!e,t||=r}else{let r=this.getBoundingClientRect(),i=window.innerHeight||0;t=r.bottom>-200&&r.top<i+200,n=t&&!e&&r.bottom>0&&r.top<i}this.getAttribute(`activate-on`)===`hover`&&typeof matchMedia==`function`&&matchMedia(`(hover: hover)`).matches&&(n&&=!!this._hasPointer),this.getAttribute(`activate-on`)===`manual`&&(n=!1),this._moveTo(n?`active`:t?`ready`:`dormant`)},Q._moveTo=function(e){this._activityState!==e&&(this._activityState=e,e!==`dormant`&&(this._engine||this._initPlayer(),e===`active`?this.play():this.pause()))},Q._startAutoRotateLang=function(){this._stopAutoRotateLang();let e=this.getAttribute(`auto-rotate-lang`);if(!e||e===`false`||this.classList.contains(`oim-player-paused`))return;let t=parseInt(e,10);(isNaN(t)||t<=0)&&(t=3e3);let n=this;this._autoRotateIntervalId=setInterval(()=>{let e=n._engine?n._engine.metadata:null;if(!e)return;let t=e.slots||e.elements||[],r={};for(let e=0;e<t.length;e++){let n=t[e].content||{};Object.keys(n).forEach(e=>{r[e.toLowerCase()]=!0})}let i=Object.keys(r).sort();if(i.length<=1)return;let a=(n.getAttribute(`lang`)||n._engine&&n._engine.lang||`en`).toLowerCase(),o=i[(i.indexOf(a)+1)%i.length];n.setAttribute(`lang`,o)},t)},Q._stopAutoRotateLang=function(){this._autoRotateIntervalId&&=(clearInterval(this._autoRotateIntervalId),null)},Q.disconnectedCallback=function(){this._mqOscuro&&=(this._mqOscuro.removeEventListener(`change`,this._onEsquema),null),this._stopAutoRotateLang(),this._observers&&=(this._observers.forEach(e=>e.disconnect()),null),this._onTabChange&&=(document.removeEventListener(`visibilitychange`,this._onTabChange),null),this._onPointerEnter&&(this.removeEventListener(`mouseenter`,this._onPointerEnter),this.removeEventListener(`mouseleave`,this._onPointerLeave),this._onPointerEnter=null,this._onPointerLeave=null),this._activityFrame&&=(cancelAnimationFrame(this._activityFrame),null),this._isNear=null,this._isVisible=null,this._activityState=`dormant`,this._engine&&this._engine.destroy&&this._engine.destroy()},Q.attributeChangedCallback=function(e,t,n){if(e===`placeholder`&&t!==n)this._oimOptions||={},this._oimOptions.placeholder=n,this._syncPlaceholder();else if(e===`poster`&&t!==n)this._oimOptions||={},this._oimOptions.poster=n,this._engine&&this._initPlayer();else if(e===`palette`&&t!==n)this._engine&&this._engine.applyPalette();else if(e===`src`&&t!==n)this._src=n,this._engine?this._initPlayer():this._replantearActividad();else if(e===`activate-on`&&t!==n)this._replantearActividad();else if(e===`lang`&&t!==n)this._engine&&this._engine.setLang&&this._engine.setLang(n);else if((e===`fit`||e===`align`)&&t!==n)this._oimOptions||={},this._oimOptions[e]=n,this._syncPlaceholder(),this._initPlayer();else if(e===`dropdown-blur`&&t!==n)this._oimOptions||={},this._oimOptions.dropdownBlur=n!==`false`,this._engine&&(this._engine.dropdownBlur=n!==`false`);else if(e===`allow-lottie`&&t!==n)this._oimOptions||={},this._oimOptions.allowLottie=n!==`false`,this._engine&&(this._engine.allowLottie=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots());else if(e===`auto-rotate-lang`&&t!==n)this._startAutoRotateLang();else if((e===`mode`||e===`disable-animations`||e===`disable-actions`)&&t!==n){if(this._engine){let e=typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=o(this,this._oimOptions||{},!!e);this._engine.disableAnimations=t.disableAnimations,this._engine.disableActions=t.disableActions,this._engine.renderSlots&&this._engine.renderSlots()}}else e===`show-slots`&&t!==n&&(this._oimOptions||={},this._oimOptions.showSlots=n!==`false`,this._engine&&(this._engine.showSlots=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots()))},Q._syncPlaceholder=function(){let e=this._engine||this._placeholderSettled?null:Ua(this._oimOptions&&this._oimOptions.placeholder);if(!e){this._removePlaceholder();return}let t=this.shadowRoot||this.attachShadow({mode:`open`});if(!t.querySelector(`img.oim-placeholder`)){let e=document.createElement(`style`);e.className=`oim-placeholder-style`,e.textContent=`:host{position:relative}`;let n=document.createElement(`img`);n.className=`oim-placeholder`,n.alt=``,n.decoding=`async`,n.addEventListener(`error`,()=>this._removePlaceholder()),t.append(e,n)}let n=t.querySelector(`img.oim-placeholder`),r=this._oimOptions&&this._oimOptions.fit===`cover`?`cover`:`contain`,i=this._oimOptions&&this._oimOptions.align,a=i===`top`?`center top`:i===`bottom`?`center bottom`:`center center`;n.setAttribute(`style`,`position:absolute;inset:0;width:100%;height:100%;object-fit:${r};object-position:${a}`),n.getAttribute(`src`)!==e&&n.setAttribute(`src`,e)},Q._removePlaceholder=function(){this.shadowRoot&&this.shadowRoot.querySelectorAll(`.oim-placeholder, .oim-placeholder-style`).forEach(e=>e.remove())},Q._initPlayer=function(){if(!this._src)return;this._loading=!0;let e=this,t=this._src;e._oimOptions||={},e.hasAttribute(`fit`)&&(e._oimOptions.fit=e.getAttribute(`fit`)),e.hasAttribute(`align`)&&(e._oimOptions.align=e.getAttribute(`align`)),e.hasAttribute(`dropdown-blur`)&&(e._oimOptions.dropdownBlur=e.getAttribute(`dropdown-blur`)!==`false`),e.hasAttribute(`placeholder`)&&(e._oimOptions.placeholder=e.getAttribute(`placeholder`)),e.hasAttribute(`poster`)&&(e._oimOptions.poster=e.getAttribute(`poster`)),e.hasAttribute(`allow-lottie`)&&(e._oimOptions.allowLottie=e.getAttribute(`allow-lottie`)!==`false`),e.hasAttribute(`allow-zoom`)&&(e._oimOptions.allowZoom=e.getAttribute(`allow-zoom`)===`true`);let n;n=t instanceof Blob?t.slice(0,16).arrayBuffer().then(e=>new Uint8Array(e)).catch(()=>null):j.sniff(t),n.then(n=>{if(!e.isConnected)return;let r=Ha(t,n);e._engine&&e._engine.destroy&&e._engine.destroy(),r===`video`&&console.warn(`[OimPlayer] Video media detected. Video support has been migrated to <ovm-player> from @oim-media/player-ovm. Falling back to ImageEngine.`),e._engine=new Va(e,e._oimOptions),e._loading=!1,e.classList.contains(`oim-player-paused`)&&e._engine.pause(),c(e,`data-oim-loaded`,`data-oim-cargado`);let i=()=>{e._placeholderSettled=!0,e._syncPlaceholder()};e._engine.load(t).then(()=>{i(),e._startAutoRotateLang()}).catch(e=>{i(),console.warn(`[OimPlayer] Engine load error during auto-rotate initialization:`,e)})})},Q._wake=function(){this._engine||this._loading||!this._src||this._initPlayer()},Q.getMetadata=function(){return this._wake(),this._engine?this._engine.fileMetadata:null},Q.getSecurityStatus=function(){return this._wake(),this._engine?this._engine.securityStatus||`unsigned`:null},Q.setLang=function(e){this._wake(),this._engine&&this._engine.setLang&&this._engine.setLang(e)},Q.setZoom=function(e){this._engine&&this._engine.setZoom&&this._engine.setZoom(e)},Q.play=function(){this._wake(),this.classList.remove(`oim-player-paused`),this._engine&&this._engine.play&&this._engine.play(),this._startAutoRotateLang()},Q.pause=function(){this.classList.add(`oim-player-paused`),this._engine&&this._engine.pause&&this._engine.pause(),this._stopAutoRotateLang()},Q.seek=function(e){this._engine&&this._engine.seek&&this._engine.seek(e)},Q.getEngine=function(){return this._engine},Q.destroy=function(){this._engine&&this._engine.destroy&&(this._engine.destroy(),this._engine=null),this.parentNode&&this.parentNode.removeChild(this)};var Ga=[`src`,`placeholder`,`poster`,`lang`,`activate-on`,`fit`,`align`,`dropdown-blur`,`allow-lottie`,`palette`,`auto-rotate-lang`,`disable-animations`,`disable-actions`,`mode`,`show-slots`],$;typeof customElements<`u`&&!customElements.get(`oim-player`)&&($=class extends HTMLElement{_engine=null;_src=null},$.prototype.connectedCallback=Q.connectedCallback,$.prototype.disconnectedCallback=Q.disconnectedCallback,$.prototype.attributeChangedCallback=Q.attributeChangedCallback,$.prototype.getMetadata=Q.getMetadata,$.prototype.getSecurityStatus=Q.getSecurityStatus,$.prototype.setLang=Q.setLang,$.prototype.setZoom=Q.setZoom,$.prototype.play=Q.play,$.prototype.pause=Q.pause,$.prototype.seek=Q.seek,$.prototype.getEngine=Q.getEngine,$.prototype._initPlayer=Q._initPlayer,$.prototype._syncPlaceholder=Q._syncPlaceholder,$.prototype._removePlaceholder=Q._removePlaceholder,$.prototype._replantearActividad=Q._replantearActividad,$.prototype._decide=Q._decide,$.prototype._scheduleDecision=Q._scheduleDecision,$.prototype._moveTo=Q._moveTo,$.prototype._wake=Q._wake,$.prototype._startAutoRotateLang=Q._startAutoRotateLang,$.prototype._stopAutoRotateLang=Q._stopAutoRotateLang,$.prototype.destroy=Q.destroy,$.observedAttributes=Ga,Object.defineProperty($.prototype,"src",{get:function(){return this._src},set:function(e){this._src=e,typeof e==`string`?this.setAttribute(`src`,e):this._initPlayer()}}),Object.defineProperty($.prototype,"languages",{get:function(){if(!this._engine||!this._engine.metadata)return[];let e=this._engine.metadata.slots||this._engine.metadata.elements||[],t={};for(let n=0;n<e.length;n++){let r=e[n].content||{};Object.keys(r).forEach(e=>{t[e.toLowerCase()]=!0})}return Object.keys(t).sort()}}),Object.defineProperty($.prototype,"currentLang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`}}),Object.defineProperty($.prototype,"lang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`},set:function(e){this.setAttribute(`lang`,e)}}),customElements.define(`oim-player`,$)),window.OimPlayerElement=Q;var Ka={mount:function(e,t,n){let r=typeof e==`string`?document.getElementById(e):e;if(!r)return console.error(`[OimPlayer.mount] Container not found:`,e),null;let i=document.createElement(`oim-player`);return i._oimOptions=n||{},i.src=t,i.setAttribute(`show-controls`,n&&n.showLanguageSelector===!1?`false`:`true`),n&&n.allowLottie===!1&&i.setAttribute(`allow-lottie`,`false`),r.replaceChildren?r.replaceChildren(i):(r.innerHTML=``,r.appendChild(i)),i}},qa=Ka.mount;return window.OimPlayer=Ka,e.OimPlayer=Ka,e.default=Ka,e.OimPlayerElement=Q,e.mount=qa,e})({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oim-media/player-oim",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
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.
|
|
19
|
+
"@oim-media/core": "1.31.0",
|
|
20
20
|
"lottie-web": "^5.12.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|