@oim-media/player-oim 1.35.1 → 1.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -2478,7 +2478,7 @@ function nextWheelZoom(zoom, deltaY, deltaMode, pinch) {
|
|
|
2478
2478
|
* the format can change without the player being touched. Tying both numbers
|
|
2479
2479
|
* together would make an internal fix look like a format break.
|
|
2480
2480
|
*/
|
|
2481
|
-
var CONTRACT_VERSION = "1.35.
|
|
2481
|
+
var CONTRACT_VERSION = "1.35.2";
|
|
2482
2482
|
/**
|
|
2483
2483
|
* What the player implements TODAY, measured and not assumed.
|
|
2484
2484
|
*
|
package/dist/oim-player.js
CHANGED
|
@@ -6,8 +6,8 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
|
|
|
6
6
|
.${O}:hover, .${k}:hover { animation-play-state: var(--oim-parallax-hover, running); }
|
|
7
7
|
@media (prefers-reduced-motion: reduce) {
|
|
8
8
|
.${O}, .${k} { animation: none !important; }
|
|
9
|
-
}`;function j(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+A)/t,l={flex:`0 0 ${t}px`,"transform-origin":`0 0`,transform:`scaleX(${c})`},u={};return e.mirror&&(u.transform=`translateX(${t+A}px) scaleX(-1) scaleX(${c})`),{duplicate:!0,copies:a,container:s,copy:l,secondCopy:u}}function M(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=ee,n.appendChild(r)}var N=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],P=new Set(N);function F(e){return typeof e==`string`&&P.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+-]*\)$/,te=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),ne=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,re=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function ie(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)||te.has(n.toLowerCase())||L.test(n)||ne.test(n))return!0;let r=re.exec(n);return r?ie(r[2],t+1):!1}function ae(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 N){let t=n[i][e];ie(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function oe(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&ie(n)?n:void 0;if(F(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}var se=[`text`,`artistic-text`,`geo`,`shape`,`svg`,`draw`,`image`,`pattern`],ce=1.25,le=.5;function ue(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 ce;return!Number.isFinite(n)||n<=0?ce:Math.min(3,Math.max(le,n))}var de={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 R(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function fe(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(de,t)?t:void 0,blur:R(e.filterBlur,0,100)??0,brightness:R(e.filterBrightness,0,500)??100,contrast:R(e.filterContrast,0,500)??100,saturate:R(e.filterSaturate,0,500)??100,hue:R(e.filterHueRotate,0,360)??0}}function pe(e){let t=fe(e),n=[];return t.preset!==void 0&&n.push(de[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}function me(e,t){return!e&&!t?null:[e?-1:1,t?-1:1]}function he(e){let t=`${e.x}% ${e.y}%`;return{objectFit:`cover`,objectPosition:t,transform:`scale(${e.zoom})`,transformOrigin:t}}var ge={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(ge).filter(e=>e!==`line`&&e!==`scribble`)];function _e(e){if(e&&e!==`rect`&&e!==`rectangle`)return ge[e]}var ve=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,ye={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function be(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,k=(-_-C)/u,A=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},ee=A(1,0,E,D),j=A(E,D,O,k);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),N=j/M,P=4/3*Math.tan(N/4),F=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],I=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],L=[];for(let e=0;e<M;e++){let t=ee+e*N,n=t+N,r=F(t),i=F(n),a=I(t),o=I(n);L.push([r[0]+P*a[0],r[1]+P*a[1],i[0]-P*o[0],i[1]-P*o[1],i[0],i[1]])}return L}function xe(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),ve.lastIndex=n;let t=ve.exec(e);return t?(n=ve.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<ye[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=be(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function Se(e,t){let n=xe(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var Ce=[0,0,100,100],we=[5,5,90,90],Te={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function Ee(e,t){return e===`line`?Te:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function De(e){if(e===void 0)return Ce;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function Oe(e,[t,n,r,i],a){return Se(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function ke(e,t){let n=e.geoShape,r=_e(n);if(n&&r){let e=Ee(n,r);return Oe(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?Ce:we,t)}if(e.svgPath){let n=De(e.svgViewBox);return n?Oe(e.svgPath,n,t):null}return null}var Ae=new Set([`line`,`scribble`]),je=.5523;function Me(e,t,n){return Math.max(0,Math.min(Number.isFinite(e)?e:0,t/2,n/2))}function Ne(e,[t,n,r,i]){let{x:a,y:o,width:s,height:c}=e,l=je;return[`M${a+t} ${o}`,`L${a+s-n} ${o}`,`C${a+s-n+l*n} ${o} ${a+s} ${o+n-l*n} ${a+s} ${o+n}`,`L${a+s} ${o+c-r}`,`C${a+s} ${o+c-r+l*r} ${a+s-r+l*r} ${o+c} ${a+s-r} ${o+c}`,`L${a+i} ${o+c}`,`C${a+i-l*i} ${o+c} ${a} ${o+c-i+l*i} ${a} ${o+c-i}`,`L${a} ${o+t}`,`C${a} ${o+t-l*t} ${a+t-l*t} ${o} ${a+t} ${o}`,`Z`].join(` `)}function Pe(e,t){let n=e.geoShape;return!n||n===`rect`||n===`rectangle`?Ne(t,[e.borderRadiusTopLeft??0,e.borderRadiusTopRight??0,e.borderRadiusBottomRight??0,e.borderRadiusBottomLeft??0].map(e=>Me(e,t.width,t.height))):Ae.has(n)?null:ke({geoShape:n},t)}var Fe=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,Ie=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,Le=`0 0 100 100`,Re=e=>e&&e.length<=2e4&&Fe.test(e)?e:void 0,ze=e=>e&&e.length<=64&&Ie.test(e)?e:Le;function Be(e){let t=_e(e.geoShape),n=Re(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:Le}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&Re(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:Le}:n?{d:n,viewBox:ze(e.svgViewBox)}:null}var Ve=r({createExternalLottieLoader:()=>We,createExternalScriptLoader:()=>Ue,default:()=>qe,vendorUrl:()=>He});function He(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return Ge+n}function Ue(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=Ge+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,``),e.integrity&&(a.integrity=e.integrity,a.crossOrigin=`anonymous`),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 We(e){return Ue({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,integrity:e.integrity,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var Ge,Ke,qe,Je=n((()=>{Ge=`https://cdn.oim.media/player/v1/`,Ke=We({scriptUrl:i,version:`5.13.0`,integrity:`sha384-Gr3FGWSrOz4fzm9bvrWwhuQH87JMUCLlOTaHhpddbnlHHWCZPxMeQ3KUPsomzIii`}),qe={__oimExternal:!0,load:Ke}}));a(),Je();var Ye=()=>globalThis.__oimGenerative,Xe=Ue({scriptUrl:i,file:`vendor/oim-generative-217707439616.js`,marker:`data-oim-generative`,integrity:`sha384-FmlPaAz+LdAsGyhppa/oimQEr3JBk8m3uJUoYF2+3u/EIYFDJZdOx81NWqXk6si9`,read:()=>Ye()}),Ze=(e,t)=>Ye()?.renderGenerativeSVG(e,t)??``;a(),Je();var Qe=()=>globalThis.__oimPatterns,$e=Ue({scriptUrl:i,file:`vendor/oim-patterns-217707439616.js`,marker:`data-oim-patterns`,integrity:`sha384-Ois4Pd/UOYQCGhclJ2zZLDeBUMTrltBFGiHAdYkUpxhF+Qix3QYLOh9wHCGK8cuk`,read:()=>Qe()}),et=e=>Qe()?.generatePatternSVG(e)??``,tt=(...e)=>Qe()?.patternTileUri(...e)??``,nt=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,rt=/^[A-Za-z0-9.%\s-]+$/,it=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,at=/^[A-Za-z]+$/,ot=2048;function st(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 ct(e){let t=it.exec(e);if(!t)return!1;let n=t[1].trim();return at.test(n)||ie(n)}function lt(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>ot||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=nt.exec(t);if(!n)return!1;let r=st(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=ct(i)?r:rt.test(i)?a:null;return!!o&&o.length>0&&o.every(ct)}var ut=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function dt(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${et({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&&ut.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function ft(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("${Ze(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?dt(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=lt(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}var pt=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],z=(e,t,n,r=[0,0,0])=>[...e,0,r[0],...t,0,r[1],...n,0,r[2],0,0,0,1,0],B=e=>z([.213+.787*e,.715-.715*e,.072-.072*e],[.213-.213*e,.715+.285*e,.072-.072*e],[.213-.213*e,.715-.715*e,.072+.928*e]),mt=e=>z([.393+.607*(1-e),.769-.769*(1-e),.189-.189*(1-e)],[.349-.349*(1-e),.686+.314*(1-e),.168-.168*(1-e)],[.272-.272*(1-e),.534-.534*(1-e),.131+.869*(1-e)]),ht=e=>z([e,0,0],[0,e,0],[0,0,e],[.5-.5*e,.5-.5*e,.5-.5*e]),gt=e=>z([e,0,0],[0,e,0],[0,0,e]),_t=(e,t,n,r)=>z([e,0,0],[0,t,0],[0,0,n],r);function vt(e,t){let n=[];for(let r=0;r<4;r++)for(let i=0;i<5;i++){let a=i===4?t[r*5+4]:0;for(let n=0;n<4;n++)a+=t[r*5+n]*e[n*5+i];n.push(a)}return n}var V=(...e)=>e.reduce(vt,pt),yt={"warm-vintage":V(mt(.35),ht(.9),gt(1.05),B(1.1)),"cool-cinema":V(_t(.9,1,1.12),ht(1.1),B(.9)),cyberpunk:V(B(1.6),_t(1.1,.85,1.2)),"monochrome-contrast":V(B(0),ht(1.4)),"teal-orange":V(B(1.2),z([1.1,.05,-.1],[-.05,1,.05],[-.1,.1,1.1])),"bleach-bypass":V(B(.35),ht(1.35),gt(.95)),"cross-process":V(_t(1.1,1.05,.75,[-.05,.05,.1]),ht(1.15)),sepia:mt(1)};Object.keys(yt);function bt(e,t=100){if(!Object.hasOwn(yt,e))return;let n=Math.min(100,Math.max(0,t))/100;return yt[e].map((e,t)=>+(pt[t]+(e-pt[t])*n).toFixed(6))}var xt=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],St=new Set(xt);function Ct(e){return typeof e==`string`&&St.has(e)}var wt=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,Tt=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,Et=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),Dt=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,Ot=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function kt(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(wt.test(n)||Et.has(n.toLowerCase())||Tt.test(n)||Dt.test(n))return!0;let r=Ot.exec(n);return r?kt(r[2],t+1):!1}function At(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&kt(n)?n:void 0;if(Ct(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function jt(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, `+At(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:At(e.shadowColorRole,s):s}function Mt(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 Nt=`#f59e0b`;function Pt(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)||Nt,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`:jt({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 if(a.kind===`texture`)i.push({kind:`texture`,effect:a});else if(a.kind===`filter`){let e=pe(Mt(a));e&&n.push(e)}let a=e?.find(e=>e.kind===`color-grade`),o=a&&bt(a.preset,a.intensity);if(o){let e=`oim-grade-`+t.layerId.replace(/[^A-Za-z0-9_-]/g,`_`);i.push({kind:`color-grade`,id:e,values:o}),n.push(`url(#${e})`)}let s=e?.find(e=>e.kind===`backdrop`),c;return s?.preset===`duotone`?i.push({kind:`duotone`}):c=pe(Mt(s)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:c,defs:i}}var Ft={dots:`dots`,puntos:`dots`,lines:`lines`,lineas:`lines`,rings:`rings`,anillos:`rings`,grain:`grain`,grano:`grain`},It=/^#[0-9a-fA-F]{3,8}$|^rgba?\([\d.,\s%]+\)$/;function Lt(e,t){let n=Math.max(0,Math.min(1,t)),r=(e??``).trim();if(!It.test(r))return`rgba(255, 255, 255, ${n})`;if(r.startsWith(`#`)){let e=r.slice(1);e.length===3&&(e=[...e].map(e=>e+e).join(``));let t=t=>parseInt(e.slice(t,t+2),16)||0;return`rgba(${t(0)}, ${t(2)}, ${t(4)}, ${n})`}let[i=`0`,a=`0`,o=`0`]=r.replace(/rgba?\(|\)/g,``).split(`,`).map(e=>e.trim());return`rgba(${i}, ${a}, ${o}, ${n})`}function Rt(e,t=`#ffffff`){let n=Math.max(0,Math.min(1,e));return`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" result="n"/><feColorMatrix in="n" type="luminanceToAlpha" result="a"/><feFlood flood-color="${It.test(t.trim())?t.trim():`#ffffff`}"/><feComposite in2="a" operator="in"/></filter><rect width="128" height="128" filter="url(#g)" opacity="${n}"/></svg>`}function zt(e,t=.2,n=e=>`${e}px`){let r=Ft[e.type];if(!r)return;let i=Lt(e.color??`#ffffff`,t),a=Math.max(2,e.size||20);if(r===`dots`){let t=n(Math.max(.5,e.thickness??2));return{backgroundImage:`radial-gradient(circle, ${i} ${t}, transparent ${t})`,backgroundSize:`${n(a)} ${n(a)}`}}if(r===`grain`){let r=Rt(t,e.color);return{backgroundImage:`url("data:image/svg+xml;utf8,${encodeURIComponent(r)}")`,backgroundSize:`${n(128)} ${n(128)}`}}let o=Math.max(.5,e.thickness??1);if(r===`rings`){let e=Math.max(0,a-o);return{backgroundImage:`repeating-radial-gradient(circle, transparent 0, transparent ${n(e)}, ${i} ${n(e)}, ${i} ${n(a)}, transparent ${n(a+1)})`,backgroundSize:`100% 100%`}}let s=e=>{let t=(e%180+180)%180;return t===0?180:t},c=e=>`repeating-linear-gradient(${s(e)}deg, ${i} 0px, ${i} ${n(o)}, transparent ${n(o)}, transparent ${n(a)})`,l=e.angle??0;return e.crossed?{backgroundImage:`${c(l)}, ${c(l+90)}`,backgroundSize:`100% 100%, 100% 100%`}:{backgroundImage:c(l),backgroundSize:`100% 100%`}}var Bt=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,Vt=(e,t)=>Bt(e)?t.literal(e.fallback):t.literal(e);function Ht(e,t){let n=(e.colors??[]).map(e=>Vt(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:Bt(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:Vt(e.bg,t),fillPatternBgColorRole:Bt(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 Ut=e=>`${+(e*100).toFixed(4)}%`;function Wt(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} ${Ut(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 Gt=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),Kt=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function qt(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?qt(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return Kt(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?Wt(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return Kt(i?Gt(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return Kt(ft({...Ht(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 Kt(ft({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);case`texture`:return i?{}:zt({...e.texture,color:r.literal(e.texture.color)},e.opacity,t.len)??{};default:return{}}}var Jt={silhouette:null,fillable:!0,round:!1};function Yt(e){if(!e||e.kind===`rect`)return Jt;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=_e(t);return n?{silhouette:Be({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:Jt}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=Be({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:Jt}return Jt}function Xt(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 Zt(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?oe(e.var,e.fallback):typeof e==`string`?oe(null,e):``)||void 0,literal:n=>(t(n)?ae(e)?.colors?.[n.var]??oe(null,n.fallback):typeof n==`string`?oe(null,n):``)||void 0}}function Qt(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 $t(e,t){let n=e?.text;if(!n)return;let r={},i=Qt(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=Qt(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 en(e,t){let[n,r,i,a]=t,o=n+i/2,s=r+a/2,c=e.stops.length,l=e.stops.map((e,t)=>({offset:`${Math.round((e.at??t/(c-1))*1e4)/100}%`,color:e.color}));if(e.type===`radial`)return{tag:`radialGradient`,attrs:{cx:o,cy:s,r:Math.hypot(i/2,a/2)},stops:l};let u=((e.angle??180)-90)*Math.PI/180,d=(Math.abs(i*Math.cos(u))+Math.abs(a*Math.sin(u)))/2,f=Math.cos(u)*d,p=Math.sin(u)*d;return{tag:`linearGradient`,attrs:{x1:o-f,y1:s-p,x2:o+f,y2:s+p},stops:l}}var tn=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0,nn=0;function rn(e,t,n=!1){return an(document,e,t,n).outerHTML}function an(e,t,n,r=!1){let i=`http://www.w3.org/2000/svg`,a=e.createElementNS(i,`svg`);a.setAttribute(`viewBox`,t.viewBox.join(` `)),a.setAttribute(`width`,r?String(t.viewBox[2]):`100%`),a.setAttribute(`height`,r?String(t.viewBox[3]):`100%`),r?a.setAttribute(`xmlns`,i):(a.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),a.style.setProperty(`display`,`block`));let o;if(n.strokeGradient){let{tag:r,attrs:s,stops:c}=en(n.strokeGradient,t.viewBox),l=a.appendChild(e.createElementNS(i,`defs`)).appendChild(e.createElementNS(i,r));l.id=`oim-sg-${++nn}`,l.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of Object.entries(s))l.setAttribute(e,String(t));for(let t of c){let n=l.appendChild(e.createElementNS(i,`stop`));n.setAttribute(`offset`,t.offset),n.setAttribute(`stop-color`,tn(t.color)??`#000`)}o=`url(#${l.id})`}for(let s of t.paths){let t=e.createElementNS(i,`path`);t.setAttribute(`d`,s.d);let c=tn(s.fill===`currentColor`?n.fill??`currentColor`:s.fill),l=o??tn(s.stroke===`currentColor`?n.stroke??`currentColor`:s.stroke);r?(t.setAttribute(`fill`,c??`none`),l&&t.setAttribute(`stroke`,l)):(t.setAttribute(`fill`,`none`),c&&t.style.setProperty(`fill`,c),l&&t.style.setProperty(`stroke`,l)),s.strokeWidth!==void 0&&t.setAttribute(`stroke-width`,String(s.strokeWidth)),s.fillRule&&t.setAttribute(`fill-rule`,s.fillRule),s.cap&&t.setAttribute(`stroke-linecap`,s.cap),s.join&&t.setAttribute(`stroke-linejoin`,s.join),s.opacity!==void 0&&t.setAttribute(`opacity`,String(s.opacity)),s.transform&&t.setAttribute(`transform`,`matrix(${s.transform.join(` `)})`),a.appendChild(t)}return a}function on(e){let t=e.fills?.[0]?.kind;return t===`gradient`||t===`pattern`||t===`generative`}function sn(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=e.strokes?.[0]?.paint,a=n(i),o=i?.kind===`gradient`&&i.gradient?.type!==`conic`?i.gradient:void 0,s=o&&{...o,stops:o.stops.map(e=>({...e,color:t(e.color)??e.color}))};return{fill:r??a,stroke:a??r,...s&&{strokeGradient:s}}}var cn=[`backgroundColor`,`backgroundImage`,`backgroundSize`,`backgroundClip`,`WebkitBackgroundClip`,`color`,`animation`],ln=[`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`],H=`var(--oim-bg-tile, 160px)`,un=`calc(${H} * 1.15)`,U=e=>`background-position: ${e}`,dn=e=>`background-size: ${e} ${e}`,fn=[`@keyframes background-animation-right { from { ${U(`0 0`)} } to { ${U(`${H} 0`)} } }`,`@keyframes background-animation-left { from { ${U(`0 0`)} } to { ${U(`calc(-1 * ${H}) 0`)} } }`,`@keyframes background-animation-up { from { ${U(`0 0`)} } to { ${U(`0 calc(-1 * ${H})`)} } }`,`@keyframes background-animation-down { from { ${U(`0 0`)} } to { ${U(`0 ${H}`)} } }`,`@keyframes background-animation-zoom-in { 0%, 100% { ${dn(H)} } 50% { ${dn(un)} } }`,`@keyframes background-animation-zoom-out { 0%, 100% { ${dn(un)} } 50% { ${dn(H)} } }`,`@keyframes background-animation-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }`].join(` `);function pn(e){if(e.getElementById(`oim-pattern-keyframes`))return;let t=e.createElement(`style`);t.id=`oim-pattern-keyframes`,t.textContent=fn,(e.head||e.documentElement).appendChild(t)}function mn(e,t,n){let r=e.style;for(let e of cn)r[e]=``;e.querySelectorAll(`:scope > [data-oim-fill]`).forEach(e=>e.remove());let i={colors:n.colors,isText:n.isText,resources:n.resources,width:n.width,height:n.height,len:n.len},a,o=[],s=[],c=[];for(let r of t.fills??[]){if(`kind`in r&&r.kind===`image`){n.isText||c.push(r);continue}let t=gn(r,n.colors)??qt(r,i),l=`kind`in r&&r.kind===`pattern`?r.pattern.motion:void 0;if(l?.period&&l.period>0&&ln.includes(l.direction??`right`)){pn(e.ownerDocument);let t=160*(r.pattern.scale||1);e.style.setProperty(`--oim-bg-tile`,n.len?n.len(t):`${t}px`),e.style.animation=`background-animation-${l.direction??`right`} ${l.period}s linear infinite`}if(t.color&&(e.style.color=t.color),t.backgroundClip&&Object.assign(e.style,{backgroundClip:`text`,WebkitBackgroundClip:`text`}),t.backgroundColor&&(a===void 0&&o.length===0?a=t.backgroundColor:(o.unshift(`linear-gradient(${t.backgroundColor}, ${t.backgroundColor})`),s.unshift(`auto`))),t.backgroundImage){o.unshift(t.backgroundImage);let e=/^([\d.]+)px [\d.]+px$/.exec(t.backgroundSize??``);s.unshift(e&&n.size?n.size(+e[1]):t.backgroundSize??`auto`)}}a&&(e.style.backgroundColor=a),o.length&&(e.style.backgroundImage=o.join(`, `)),s.some(e=>e!==`auto`)&&(e.style.backgroundSize=s.join(`, `));for(let t of c)e.appendChild(hn(e,t))}function hn(e,t){let n=e.ownerDocument.createElement(`img`);n.dataset.oimFill=``,t.src.startsWith(`data:image/`)&&(n.src=t.src),n.alt=``,n.draggable=!1,Object.assign(n.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,display:`block`,pointerEvents:`none`,objectFit:t.fit??`cover`});let r=[];if(t.crop){e.style.overflow=`hidden`;let i=he(t.crop);Object.assign(n.style,{objectFit:i.objectFit,objectPosition:i.objectPosition,transformOrigin:i.transformOrigin}),r.push(i.transform)}let i=me(t.flipX,t.flipY);i&&r.push(`scale(${i[0]}, ${i[1]})`),r.length&&(n.style.transform=r.join(` `)),t.opacity!==void 0&&t.opacity!==1&&(n.style.opacity=String(t.opacity));let a=t.filters&&pe(Mt(t.filters));return a&&Object.assign(n.style,{filter:a,clipPath:`inset(0)`}),n}function gn(e,t){if(!(`kind`in e)||e.kind!==`pattern`||!e.pattern.tile)return;let n=e.pattern,r=rn({kind:`paths`,...n.tile},sn({},t.literal),!0),i=tt(Ht(n,t),r,t.literal(n.bg)??`transparent`,t.literal(n.colors?.[0])??`#000000`),a=160*(n.scale||1);return i?{backgroundImage:`url("${i}")`,backgroundSize:`${a}px ${a}px`}:void 0}function _n(){return[`:host { position: relative; display: flex !important; overflow: hidden; width: 100%; height: 100%; background: var(--oim-bg, transparent); user-select: none; -webkit-user-select: none; content-visibility: auto; contain-intrinsic-size: auto 300px; }`,`:host(.oim-player-paused) { pointer-events: none !important; }`,`:host(.oim-player-paused[activate-on="hover"]) { pointer-events: auto !important; }`,`:host(.oim-player-paused) * { animation-play-state: paused !important; transition: none !important; }`,`:host(.oim-align-center) { align-items: center; justify-content: center; }`,`:host(.oim-align-top) { align-items: flex-start; justify-content: center; }`,`:host(.oim-align-bottom) { align-items: flex-end; justify-content: center; }`,`:host(.oim-mobile), :host(.oim-tier-low) { --oim-reveal-blur: 0px; }`,`.oim-player-viewport { position: relative; aspect-ratio: var(--oim-ar, 16/9); flex-shrink: 0; opacity: 0; overflow: hidden; transition: opacity var(--oim-reveal-duration, 0.32s) ease-in-out, filter var(--oim-reveal-duration, 0.32s) ease-in-out; filter: blur(var(--oim-reveal-blur, 14px)); }`,`.oim-player-viewport.oim-viewport--ready { opacity: 1; filter: none; }`,`.oim-player-viewport.oim-viewport--poster { opacity: 1; filter: none; }`,`.oim-player-viewport.oim-viewport--poster:not(.oim-viewport--ready) .oim-layer-overlay { visibility: hidden; }`,`.oim-player-base.oim-base--faded { opacity: 0; transition: opacity 200ms ease-out; }`,`.oim-player-viewport.oim-fit-contain { max-width: 100%; max-height: 100%; }`,`.oim-player-viewport.oim-fit-cover { min-width: 100%; min-height: 100%; max-width: none; max-height: none; }`,`.oim-player-base { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; transition: filter 0.5s ease-in-out; image-rendering: high-quality; image-rendering: -webkit-optimize-contrast; }`,`.oim-layer-overlay { position: absolute; top: 50%; left: 50%; width: var(--oim-overlay-w, 1080px); height: var(--oim-overlay-h, 1920px); transform: translate(-50%, -50%) scale(var(--oim-fit, 1)); transform-origin: center center; z-index: 10; pointer-events: none; transition: opacity 0.5s ease-in-out; container-type: inline-size !important; container-name: oim-viewport; }`,`.oim-layer-overlay [data-oim-id] { pointer-events: auto; }`,`.oim-player-loading { color: var(--oim-text-muted, #8a8a96); font-family: "JetBrains Mono", monospace; font-size: 12px; }`,fn,`.oim-player-error { color: var(--oim-red, #ef4444); font-family: "JetBrains Mono", monospace; font-size: 12px; }`].join(`
|
|
10
|
-
`)}function vn(e){if(!e)return;let t=_n();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)}M(e)}function yn(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 bn=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),xn=new Set([`public`,`author_only`,`sealed`]);function Sn(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?bn.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&xn.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}function Cn(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var wn=`author_only`,Tn=[`public`,`author_only`,`sealed`];function En(e){if(!e||typeof e!=`object`)return wn;let t=Sn(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&Tn.includes(n)?n:wn}function Dn(e){return e===`public`?`verified_authorless`:`verified`}function On(e){let t=Cn(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var kn=`oim:base`;function An(e){let t=t=>{if(typeof t==`string`)return t===kn;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===kn}return t.value===kn||Object.values(t.modes??{}).includes(kn)},n=e=>e.some(e=>e.image!==void 0&&t(e.image.src)||n(e.children??[]));return n(e.layers)}function jn(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 Mn="/**\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={}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\n;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),s=t;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),o&&(s=r))}catch{}if(o){let t=b(e.key_version,s);if(!x({kid:e.key_version,jwk:s,not_after:t},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;if(typeof e.oim==`string`&&e.oim.startsWith(`2.`)){let r=e.layers??[];if(!Array.isArray(r))return n(`layers must be array`),t;let i=[],a=0,o=(e,t)=>{if(e.length>150)return n(`max 150 layers per list`),!1;for(let r of e){if(++a>1e3)return n(`max 1000 layers in total`),!1;i.push({node:r,depth:t})}return!0};if(o(r,1))for(;i.length>0;){let{node:e,depth:t}=i.pop();if(t>32){n(`layer nesting deeper than 32`);break}if(typeof e!=`object`||!e||Array.isArray(e)){n(`layer must be object`);break}if(e.children!==void 0){if(!Array.isArray(e.children)){n(`layer children must be array`);break}if(!o(e.children,t+1))break}}}let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;v(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=H(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await R(e.metadata,r),l=z({isSigned:s,isSigValid:c,keyExpired:s&&c?await B(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(V(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:m(e.metadata)||a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",Nn=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,Mn],{type:`text/javascript;charset=utf-8`});function Pn(e){let t;try{if(t=Nn&&(self.URL||self.webkitURL).createObjectURL(Nn),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Mn),{type:`module`,name:e?.name})}}var Fn=[{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`}}],In=`https://api.oim.media/v1/media/keys`;function W(e){for(let t=0;t<Fn.length;t++)if(Fn[t].kid===e)return Fn[t];return null}function Ln(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||In}function Rn(e,t){let n=W(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 zn(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 Bn=6048e5;function Vn(e,t,n=Date.now()){let r=W(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!W(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)))+Bn}var Hn=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function Un(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 Hn(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new Hn(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:Ln()})})},stats(){return{alive:t!==null,pending:i.size}}}}var Wn=null;function Gn(e,t,n){return Wn||=Un(()=>new Pn),Wn.verify(e,t,n)}var Kn=10485760;async function qn(e,t=Kn){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 G(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await G(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 G(e,t,n=Kn){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 Jn(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 Yn(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 G(e,`deflate`)}catch{try{t=await G(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 G(t,`deflate`)}catch(e){try{i=await G(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 G(o,`deflate`)}catch(e){try{i=await G(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 qn(i)),{image:s,metadata:c,imageHash:await Jn(t)}}var Xn=2**53-1;function Zn(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>Xn:typeof e==`object`&&e?Object.values(e).some(Zn):!1}var Qn=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function $n(e){if(Array.isArray(e))return e.map($n);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=$n(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function er(e){if(Array.isArray(e))return e.map(er);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]=er(e[r]);return t}return e}function tr(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Qn.has(n)||(t[n]=e[n]);let n=er($n(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}var nr=1e3,K={},rr=null,ir=!1,ar=null;function or(){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 sr(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 cr(e){let t=W(e);return t?t.jwk:(K[e]||!ir&&(ar||=or().then(e=>{e.forEach(e=>{K[e.kid]=e}),ir=!0}),await ar,K[e])||await lr(),K[e])}function lr(){return rr||=(async function(){try{let e=Ln(),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 sr(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),rr}async function ur(e){return await lr(),K[e]||null}async function dr(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 cr(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(Zn(e))return!1;let r=tr(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),c=t;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 ur(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),s&&(c=n))}catch{}if(s){let t=Rn(e.key_version,c);if(!zn({kid:e.key_version,jwk:c,not_after:t},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 fr(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`:Dn(En(e.metadata)):`image_unsealed`}async function pr(e,t=Date.now()){let n=e&&e.key_version;return n?W(n)?Vn(n,null,t):Vn(n,await ur(n),t):!1}function mr(e){return e===`image_mismatch`||e===`invalid_signature`}var hr=`OIM_ALTERED`;function gr(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;if(typeof e.oim==`string`&&e.oim.startsWith(`2.`)){let r=e.layers??[];if(!Array.isArray(r))return n(`layers must be array`),t;let i=[],a=0,o=(e,t)=>{if(e.length>150)return n(`max 150 layers per list`),!1;for(let r of e){if(++a>1e3)return n(`max ${nr} layers in total`),!1;i.push({node:r,depth:t})}return!0};if(o(r,1))for(;i.length>0;){let{node:e,depth:t}=i.pop();if(t>32){n(`layer nesting deeper than 32`);break}if(typeof e!=`object`||!e||Array.isArray(e)){n(`layer must be object`);break}if(e.children!==void 0){if(!Array.isArray(e.children)){n(`layer children must be array`);break}if(!o(e.children,t+1))break}}}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}var _r=Math.log(1.05)/100,vr=.01,yr=16,br=800;function xr(e,t,n,r){let i=n===1?t*yr:n===2?t*br:t,a=e*Math.exp(-i*(r?vr:_r));return Math.max(1,Math.min(4,a))}var Sr=`1.35.1`,Cr=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function wr(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 Tr(e,t){let n=wr(e),r=wr(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 Er(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=Tr(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 Dr(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 Or=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,kr=546136,Ar={woff:`wOFF`,woff2:`wOF2`},jr=/^[A-Za-z0-9+/]*={0,2}$/;function Mr(e,t){try{return atob(e.slice(0,8)).startsWith(Ar[t])}catch{return!1}}function Nr(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`||!Or.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>kr||e.data.length%4!=0||!jr.test(e.data)||Mr(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 Pr(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 Fr(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var Ir=(e,t)=>`${t?+(e/t*100).toFixed(4):0}%`,Lr={"top-left":[0,0],top:[-50,0],"top-right":[-100,0],left:[0,-50],center:[-50,-50],right:[-100,-50],"bottom-left":[0,-100],bottom:[-50,-100],"bottom-right":[-100,-100]};function Rr(e,t,n){let r=e.style;r.left=Ir(t.x-n.x,n.width),r.top=Ir(t.y-n.y,n.height),t.width!==void 0&&(r.width=Ir(t.width,n.width)),t.height!==void 0&&(r.height=Ir(t.height,n.height));let[i,a]=Lr[t.anchor??`top-left`];r.transform=[i||a?`translate(${i}%, ${a}%)`:``,t.rotation?`rotate(${t.rotation}deg)`:``,t.flipX?`scaleX(-1)`:``,t.flipY?`scaleY(-1)`:``].filter(Boolean).join(` `)}function zr(e,t,n){e.style.borderRadius=``;let r=t.corners;r===void 0||n||(e.style.borderRadius=(Array.isArray(r)?r:[r]).map(e=>`${e}px`).join(` `))}var Br=`http://www.w3.org/2000/svg`,Vr=0,Hr=e=>e.d??`M `+e.points.split(` `).join(` L `)+` Z`;function Ur(e,t){let n=`oim-image-fill-${++Vr}`,[r,i,a,o]=t.viewBox.trim().split(/\s+/).map(Number),s=a===o?`scale(${1/a})`:`scale(${1/a} ${1/o})`,c=r||i?`${s} translate(${-r} ${-i})`:s,l=e.createElementNS(Br,`svg`);l.setAttribute(`width`,`0`),l.setAttribute(`height`,`0`),l.style.position=`absolute`;let u=e.createElementNS(Br,`clipPath`);u.setAttribute(`id`,n),u.setAttribute(`clipPathUnits`,`objectBoundingBox`);let d=e.createElementNS(Br,t.rect?`rect`:`path`);if(t.rect)for(let[e,n]of[[`x`,`0`],[`y`,`0`],[`width`,`1`],[`height`,`1`],[`rx`,String(t.rect.rx)],[`ry`,String(t.rect.ry)]])d.setAttribute(e,n);else d.setAttribute(`d`,t.d),d.setAttribute(`transform`,c),t.evenodd&&d.setAttribute(`clip-rule`,`evenodd`);return u.appendChild(d),l.appendChild(u),{svg:l,clipPath:`url(#${n})`}}var Wr=[`border`,`outline`,`outlineOffset`,`boxShadow`,`WebkitTextStroke`];function Gr(e,t){for(let n of e.strokes??[]){if(!(`kind`in n.paint)||n.paint.kind!==`color`)continue;let e=t.css(n.paint.value);if(e)return{...n,color:e}}}function Kr(e,t){let n=Gr(e,t.colors);if(!n)return{};let r=`${n.width}px`;if(t.isText)return{WebkitTextStroke:`${r} ${n.color}`};if(t.vector)return{};if(n.align===`inside`)return{boxShadow:`inset 0 0 0 ${r} ${n.color}`};if(n.align===`outside`)return{boxShadow:`0 0 0 ${r} ${n.color}`};let i=`${Number(n.width)/2}px`,a=n.style??`solid`;return t.rounded&&a===`solid`?{boxShadow:`inset 0 0 0 ${i} ${n.color}, 0 0 0 ${i} ${n.color}`}:{outline:`${r} ${a} ${n.color}`,outlineOffset:`-${i}`}}function qr(e,t,n){let r=e.style;for(let e of Wr)r[e]=``;Object.assign(e.style,Kr(t,n))}var Jr=`http://www.w3.org/2000/svg`;function Yr(e,t,n){e.querySelectorAll(`:scope > svg[data-oim-figure]`).forEach(e=>e.remove()),e.querySelectorAll(`:scope > [data-oim-figure-clip]`).forEach(e=>e.replaceWith(...e.querySelectorAll(`:scope > img`))),Zr(e,void 0);let r=Yt(t.geometry),i=on(t)&&!t.mask;r.round&&!r.silhouette&&(e.style.borderRadius=`50%`);let a=r.silhouette;if(!a){if(t.geometry?.kind===`paths`&&!r.path){let r=sn(t,n.colors.css);i?Zr(e,rn(t.geometry,{fill:`#000`,stroke:`#000`},!0)):(e.style.backgroundColor=`transparent`,e.style.backgroundImage=``);let a=an(e.ownerDocument,t.geometry,i?{...r,fill:`none`}:r);a.dataset.oimFigure=``,e.appendChild(a)}return r}let o=t.fills?.[0],s=r.fillable&&o&&`kind`in o&&o.kind===`color`?n.colors.css(o.value):void 0;i?Zr(e,`<svg xmlns="${Jr}" viewBox="${a.viewBox}" preserveAspectRatio="none"><path d="${Hr(a).replace(/[^\d\sMmLlHhVvCcSsQqTtAaZzEe.,+-]/g,``)}"/></svg>`):(e.style.backgroundColor=`transparent`,e.style.backgroundImage=``);let c=Gr({strokes:(t.strokes??[]).filter(e=>!e.align)},n.colors),l=e.ownerDocument.createElementNS(Jr,`svg`);l.dataset.oimFigure=``,l.setAttribute(`viewBox`,a.viewBox),l.setAttribute(`preserveAspectRatio`,`none`),Object.assign(l.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,display:`block`,overflow:`visible`});let u=e.ownerDocument.createElementNS(Jr,a.points?`polygon`:`path`);return a.points?u.setAttribute(`points`,a.points):u.setAttribute(`d`,a.d),u.setAttribute(`fill`,s??`none`),c&&(u.setAttribute(`stroke`,c.color),u.setAttribute(`stroke-width`,String(c.width)),u.setAttribute(`vector-effect`,`non-scaling-stroke`),u.setAttribute(`stroke-linejoin`,`round`),u.setAttribute(`stroke-linecap`,`round`),c.style===`dashed`?u.setAttribute(`stroke-dasharray`,`6,4`):c.style===`dotted`&&u.setAttribute(`stroke-dasharray`,`2,3`)),l.appendChild(u),e.appendChild(l),Xr(e,a),r}function Xr(e,t){let n=e.querySelectorAll(`:scope > img[data-oim-fill]`);if(!n.length)return;let{svg:r,clipPath:i}=Ur(e.ownerDocument,{d:Hr(t),viewBox:t.viewBox}),a=e.ownerDocument.createElement(`div`);a.dataset.oimFigureClip=``,Object.assign(a.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,overflow:`hidden`,pointerEvents:`none`,clipPath:i}),a.append(r,...n),e.insertBefore(a,e.firstChild)}function Zr(e,t){let n=t?`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}")`:``;for(let r of[``,`-webkit-`])e.style.setProperty(`${r}mask-image`,n),e.style.setProperty(`${r}mask-size`,t?`100% 100%`:``),e.style.setProperty(`${r}mask-repeat`,t?`no-repeat`:``)}var Qr=[`overlay`,`soft-light`,`multiply`],$r=(e,t)=>typeof e==`number`&&Number.isFinite(e)?Math.max(1,Math.min(100,e)):t;function ei(e){let t=$r(e,50);return Math.round((2-(t-1)*1.8/99)*1e3)/1e3}function ti(e,t){let n=$r(t?.intensity,20),r=Qr.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="${ei(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>`}var ni=`http://www.w3.org/2000/svg`;function ri(e){let t=e.querySelector(`:scope > svg.oim-grain-defs > defs`);if(t)return t;let n=e.ownerDocument,r=n.createElementNS(ni,`svg`);r.setAttribute(`class`,`oim-grain-defs`),r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`style`,`position:absolute;pointer-events:none`);let i=n.createElementNS(ni,`defs`);return r.appendChild(i),e.appendChild(r),i}function ii(e,t,n){if(typeof DOMParser>`u`)return;let r=e.ownerDocument,i=ri(e);i.querySelector(`#`+t)?.remove();let a=ti(t,{intensity:n.intensity,size:n.size,blend:n.blend}),o=new DOMParser().parseFromString(`<svg xmlns="${ni}"><defs>${a}</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&i.appendChild(r.importNode(o,!0))}function ai(e,t,n){let r=e.ownerDocument,i=ri(e);i.querySelector(`#`+t)?.remove();let a=r.createElementNS(ni,`filter`);a.setAttribute(`id`,t),a.setAttribute(`color-interpolation-filters`,`sRGB`);let o=r.createElementNS(ni,`feColorMatrix`);o.setAttribute(`type`,`matrix`),o.setAttribute(`values`,n.join(` `)),a.appendChild(o),i.appendChild(a)}function oi(){return Promise.resolve().then(()=>(Je(),Ve)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function si(e){if(!e)return;let t=e.trim(),n=/^data:application\/json(;base64)?,/i.exec(t);if(n){let e=t.slice(n[0].length);try{t=n[1]?atob(e):decodeURIComponent(e)}catch{return}}if(t.startsWith(`{`))try{let e=JSON.parse(t);return e&&typeof e==`object`&&Array.isArray(e.layers)?e:void 0}catch{return}}function ci(e,t,n){let r=e.ownerDocument.createElement(`div`);r.className=`oim-lottie`,Object.assign(r.style,{position:`absolute`,inset:`0`}),e.appendChild(r);let i,a=!1;return oi().then(e=>{a||(i=e.loadAnimation({container:r,renderer:`svg`,loop:n.loop,autoplay:!n.paused(),animationData:t}),n.paused()&&i.goToAndStop(0,!0))}).catch(()=>{r.remove()}),{play:()=>i?.play(),pause:()=>i?.pause(),destroy:()=>{a=!0,i?.destroy(),r.remove()}}}var li=`http://www.w3.org/2000/svg`,ui={shadows:`#1e1b4b`,lights:`#fbbf24`};function di(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 fi(e,t){let n=e.createElementNS(li,`filter`);n.setAttribute(`id`,t),n.setAttribute(`color-interpolation-filters`,`sRGB`);let r=e.createElementNS(li,`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`),n.appendChild(r);let i=e.createElementNS(li,`feComponentTransfer`);return[`R`,`G`,`B`].forEach((t,n)=>{let r=e.createElementNS(li,`feFunc`+t);r.setAttribute(`type`,`table`),r.setAttribute(`tableValues`,`${di(ui.shadows,n)} ${di(ui.lights,n)}`),i.appendChild(r)}),n.appendChild(i),n}var pi={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(pi).filter(e=>e!==`line`&&e!==`scribble`)];function mi(e){if(e&&e!==`rect`&&e!==`rectangle`)return pi[e]}var hi=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,gi={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function _i(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,k=(-_-C)/u,A=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},ee=A(1,0,E,D),j=A(E,D,O,k);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),N=j/M,P=4/3*Math.tan(N/4),F=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],I=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],L=[];for(let e=0;e<M;e++){let t=ee+e*N,n=t+N,r=F(t),i=F(n),a=I(t),o=I(n);L.push([r[0]+P*a[0],r[1]+P*a[1],i[0]-P*o[0],i[1]-P*o[1],i[0],i[1]])}return L}function vi(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),hi.lastIndex=n;let t=hi.exec(e);return t?(n=hi.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<gi[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=_i(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function yi(e,t){let n=vi(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var bi=[0,0,100,100],xi=[5,5,90,90],Si={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function Ci(e,t){return e===`line`?Si:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function wi(e){if(e===void 0)return bi;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function Ti(e,[t,n,r,i],a){return yi(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function Ei(e,t){let n=e.geoShape,r=mi(n);if(n&&r){let e=Ci(n,r);return Ti(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?bi:xi,t)}if(e.svgPath){let n=wi(e.svgViewBox);return n?Ti(e.svgPath,n,t):null}return null}function Di(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0];return{x:typeof n.x==`number`?n.x:Number(r[0])/100*t.width,y:typeof n.y==`number`?n.y:Number(r[1])/100*t.height,width:typeof n.width==`number`?n.width:Number(n.width_px)||0,height:typeof n.height==`number`?n.height:Number(n.height_px)||0}}function q(e){return`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`}function Oi(e,t){return e===`rect`||e===`rectangle`?q(t):Ei({geoShape:e},t)}function ki(e,t){let n=e.style||{},r=n.maskShape||n.geoShape,i=n.maskSvgPath||n.svgPath;return i&&(!r||r===`custom`)?Ei({svgPath:i},t):Oi(r||`circle`,t)}function Ai(e,t){return{x:t.x+(e.x||0),y:t.y+(e.y||0),width:e.width||0,height:e.height||0}}function ji(e,t){let n=Ai(e,t);return e.svgPath?Ei({svgPath:e.svgPath},n):Oi(e.shape||`circle`,n)}function Mi(e){let t=e,n=t.cuts||t.style&&t.style.cuts;return Array.isArray(n)?n:[]}function Ni(e,t){let n=Mi(e);return n.length>0?n.map(e=>ji(e,t)??q(Ai(e,t))).join(` `):ki(e,t)??q(t)}function Pi(e,t){let{width:n,height:r}=t,i=e,a=Di(e,t);return`${((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?q(a):`M0 0H${n}V${r}H0Z`} ${Ni(e,a)}`}function Fi(e,t){let n=Di(e,t);return ki(e,n)??q(n)}function Ii(e,t){let{width:n,height:r}=t,i=Di(e,t);return`${`M0 0H${n}V${r}H0Z`} ${q(i)} ${Ni(e,i)}`}function Li(e){let t=e;return{maskShape:t?.kind===`preset`?t.name:t?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[t?.kind??``],maskSvgPath:t?.kind===`paths`?t.paths?.map(e=>e.d).join(` `):void 0}}var Ri=`http://www.w3.org/2000/svg`;function zi(e,t,n){let{width:r,height:i}=n.canvas,{x:a=0,y:o=0,width:s=0,height:c=0}=t.box;if(e.querySelectorAll(`:scope > :not([data-oim-mask-frame])`).forEach(e=>e.remove()),e.querySelector(`:scope > [data-oim-mask-frame]`)?.remove(),Object.assign(e.style,{backgroundColor:`transparent`,backgroundImage:``,border:``,outline:``,boxShadow:``,overflow:`visible`}),!s||!c)return;let l={id:t.id,type:`mask`,style:Li(t.geometry),x:a,y:o,width:s,height:c},u=(e,t)=>`${+(e/t*100).toFixed(4)}%`,d=e.ownerDocument,f=d.createElement(`div`);f.dataset.oimMaskFrame=``,Object.assign(f.style,{position:`absolute`,left:u(-a,s),top:u(-o,c),width:u(r,s),height:u(i,c),pointerEvents:`none`});let p=d.createElement(`div`);p.dataset.oimMaskPaint=``,mn(p,t,{colors:n.colors,isText:!1,size:e=>`${+(e/r*100).toFixed(4)}cqw ${+(e/r*100).toFixed(4)}cqw`});let{svg:m,clipPath:h}=Ur(d,{d:Pi(l,n.canvas),viewBox:`0 0 ${r} ${i}`,evenodd:!0});Object.assign(p.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,clipPath:h}),f.append(m,p);let g=Gr(t,n.colors);if(g&&Number(g.width)>0){let e=d.createElementNS(Ri,`svg`);e.dataset.oimMaskOutline=``,e.setAttribute(`viewBox`,`0 0 ${r} ${i}`),e.setAttribute(`preserveAspectRatio`,`none`),Object.assign(e.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,overflow:`visible`,pointerEvents:`none`});let t=d.createElementNS(Ri,`path`);t.setAttribute(`d`,Fi(l,n.canvas)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,g.color),t.setAttribute(`stroke-width`,String(g.width)),t.setAttribute(`stroke-linejoin`,`round`),e.appendChild(t),f.appendChild(e)}e.appendChild(f)}function Bi(e,t,n){let{x:r=0,y:i=0,width:a=0,height:o=0}=t.box;if(!a||!o||!e.childElementCount)return;let s={id:t.id,type:`mask`,style:Li(t.geometry),x:r,y:i,width:a,height:o},c=e.ownerDocument,l=c.createElement(`div`);l.dataset.oimCutout=t.id;let{svg:u,clipPath:d}=Ur(c,{d:Ii(s,n),viewBox:`0 0 ${n.width} ${n.height}`,evenodd:!0});return Object.assign(l.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,clipPath:d}),l.append(...e.children),e.append(u,l),l}function Vi(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 Hi(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 Ui(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 Wi(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?Ui(n,1-t*.5):n;l.push({dx:i,dy:a,color:u,opacity:1})}return l}var Gi=1.25,Ki=.5;function qi(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 Gi;return!Number.isFinite(n)||n<=0?Gi:Math.min(3,Math.max(Ki,n))}var Ji=1.4;function Yi(e){(!Number.isFinite(e)||e<=0)&&(e=Gi);let t=Ji-e;return t<=0?0:Math.round(t/2*1e4)/1e4}var J=e=>String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`);function Xi(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:qi({lineHeight:r.lineHeight}),fillColor:(m?.kind===`color`?n(m.value):void 0)||`#FBBF24`,curvePathD:Vi(l,u,v,i.curve?.type??`arc`),isCurved:v!==0,extrusionLayers:Wi(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 Zi(e,t=`artistic-text`){let n=J(`curve-path-${t}`),r=J(`artistic-grad-${t}`),i=e.fillColor,a=``;e.textGradientType===`sunset-gold`?(i=`url(#${r})`,a=`
|
|
9
|
+
}`;function j(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+A)/t,l={flex:`0 0 ${t}px`,"transform-origin":`0 0`,transform:`scaleX(${c})`},u={};return e.mirror&&(u.transform=`translateX(${t+A}px) scaleX(-1) scaleX(${c})`),{duplicate:!0,copies:a,container:s,copy:l,secondCopy:u}}function M(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=ee,n.appendChild(r)}var N=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],P=new Set(N);function F(e){return typeof e==`string`&&P.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+-]*\)$/,te=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),ne=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,re=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function ie(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)||te.has(n.toLowerCase())||L.test(n)||ne.test(n))return!0;let r=re.exec(n);return r?ie(r[2],t+1):!1}function ae(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 N){let t=n[i][e];ie(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function oe(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&ie(n)?n:void 0;if(F(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}var se=[`text`,`artistic-text`,`geo`,`shape`,`svg`,`draw`,`image`,`pattern`],ce=1.25,le=.5;function ue(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 ce;return!Number.isFinite(n)||n<=0?ce:Math.min(3,Math.max(le,n))}var de={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 R(e,t,n){if(typeof e==`number`&&Number.isFinite(e))return Math.min(n,Math.max(t,e))}function fe(e){let{filterPreset:t}=e;return{preset:typeof t==`string`&&Object.prototype.hasOwnProperty.call(de,t)?t:void 0,blur:R(e.filterBlur,0,100)??0,brightness:R(e.filterBrightness,0,500)??100,contrast:R(e.filterContrast,0,500)??100,saturate:R(e.filterSaturate,0,500)??100,hue:R(e.filterHueRotate,0,360)??0}}function pe(e){let t=fe(e),n=[];return t.preset!==void 0&&n.push(de[t.preset]),t.blur!==0&&n.push(`blur(${t.blur}px)`),t.brightness!==100&&n.push(`brightness(${t.brightness}%)`),t.contrast!==100&&n.push(`contrast(${t.contrast}%)`),t.saturate!==100&&n.push(`saturate(${t.saturate}%)`),t.hue!==0&&n.push(`hue-rotate(${t.hue}deg)`),n.length>0?n.join(` `):void 0}function me(e,t){return!e&&!t?null:[e?-1:1,t?-1:1]}function he(e){let t=`${e.x}% ${e.y}%`;return{objectFit:`cover`,objectPosition:t,transform:`scale(${e.zoom})`,transformOrigin:t}}var ge={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(ge).filter(e=>e!==`line`&&e!==`scribble`)];function _e(e){if(e&&e!==`rect`&&e!==`rectangle`)return ge[e]}var ve=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,ye={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function be(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,k=(-_-C)/u,A=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},ee=A(1,0,E,D),j=A(E,D,O,k);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),N=j/M,P=4/3*Math.tan(N/4),F=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],I=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],L=[];for(let e=0;e<M;e++){let t=ee+e*N,n=t+N,r=F(t),i=F(n),a=I(t),o=I(n);L.push([r[0]+P*a[0],r[1]+P*a[1],i[0]-P*o[0],i[1]-P*o[1],i[0],i[1]])}return L}function xe(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),ve.lastIndex=n;let t=ve.exec(e);return t?(n=ve.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<ye[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=be(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function Se(e,t){let n=xe(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var Ce=[0,0,100,100],we=[5,5,90,90],Te={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function Ee(e,t){return e===`line`?Te:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function De(e){if(e===void 0)return Ce;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function Oe(e,[t,n,r,i],a){return Se(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function ke(e,t){let n=e.geoShape,r=_e(n);if(n&&r){let e=Ee(n,r);return Oe(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?Ce:we,t)}if(e.svgPath){let n=De(e.svgViewBox);return n?Oe(e.svgPath,n,t):null}return null}var Ae=new Set([`line`,`scribble`]),je=.5523;function Me(e,t,n){return Math.max(0,Math.min(Number.isFinite(e)?e:0,t/2,n/2))}function Ne(e,[t,n,r,i]){let{x:a,y:o,width:s,height:c}=e,l=je;return[`M${a+t} ${o}`,`L${a+s-n} ${o}`,`C${a+s-n+l*n} ${o} ${a+s} ${o+n-l*n} ${a+s} ${o+n}`,`L${a+s} ${o+c-r}`,`C${a+s} ${o+c-r+l*r} ${a+s-r+l*r} ${o+c} ${a+s-r} ${o+c}`,`L${a+i} ${o+c}`,`C${a+i-l*i} ${o+c} ${a} ${o+c-i+l*i} ${a} ${o+c-i}`,`L${a} ${o+t}`,`C${a} ${o+t-l*t} ${a+t-l*t} ${o} ${a+t} ${o}`,`Z`].join(` `)}function Pe(e,t){let n=e.geoShape;return!n||n===`rect`||n===`rectangle`?Ne(t,[e.borderRadiusTopLeft??0,e.borderRadiusTopRight??0,e.borderRadiusBottomRight??0,e.borderRadiusBottomLeft??0].map(e=>Me(e,t.width,t.height))):Ae.has(n)?null:ke({geoShape:n},t)}var Fe=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,Ie=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,Le=`0 0 100 100`,Re=e=>e&&e.length<=2e4&&Fe.test(e)?e:void 0,ze=e=>e&&e.length<=64&&Ie.test(e)?e:Le;function Be(e){let t=_e(e.geoShape),n=Re(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:Le}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&Re(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:Le}:n?{d:n,viewBox:ze(e.svgViewBox)}:null}var Ve=r({createExternalLottieLoader:()=>We,createExternalScriptLoader:()=>Ue,default:()=>qe,vendorUrl:()=>He});function He(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return Ge+n}function Ue(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=Ge+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,``),e.integrity&&(a.integrity=e.integrity,a.crossOrigin=`anonymous`),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 We(e){return Ue({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,integrity:e.integrity,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var Ge,Ke,qe,Je=n((()=>{Ge=`https://cdn.oim.media/player/v1/`,Ke=We({scriptUrl:i,version:`5.13.0`,integrity:`sha384-Gr3FGWSrOz4fzm9bvrWwhuQH87JMUCLlOTaHhpddbnlHHWCZPxMeQ3KUPsomzIii`}),qe={__oimExternal:!0,load:Ke}}));a(),Je();var Ye=()=>globalThis.__oimGenerative,Xe=Ue({scriptUrl:i,file:`vendor/oim-generative-98aa8cd22ae2.js`,marker:`data-oim-generative`,integrity:`sha384-FmlPaAz+LdAsGyhppa/oimQEr3JBk8m3uJUoYF2+3u/EIYFDJZdOx81NWqXk6si9`,read:()=>Ye()}),Ze=(e,t)=>Ye()?.renderGenerativeSVG(e,t)??``;a(),Je();var Qe=()=>globalThis.__oimPatterns,$e=Ue({scriptUrl:i,file:`vendor/oim-patterns-98aa8cd22ae2.js`,marker:`data-oim-patterns`,integrity:`sha384-Ois4Pd/UOYQCGhclJ2zZLDeBUMTrltBFGiHAdYkUpxhF+Qix3QYLOh9wHCGK8cuk`,read:()=>Qe()}),et=e=>Qe()?.generatePatternSVG(e)??``,tt=(...e)=>Qe()?.patternTileUri(...e)??``,nt=/^(?:repeating-)?(?:linear|radial|conic)-gradient\(([\s\S]*)\)$/,rt=/^[A-Za-z0-9.%\s-]+$/,it=/^(.*?)((?:\s+-?\d*\.?\d+(?:%|px|deg|em|rem)?){0,2})$/,at=/^[A-Za-z]+$/,ot=2048;function st(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 ct(e){let t=it.exec(e);if(!t)return!1;let n=t[1].trim();return at.test(n)||ie(n)}function lt(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t||t.length>ot||/[;{}<>"'`]/.test(t)||t.includes(`\\`)||t.includes(`/*`))return!1;let n=nt.exec(t);if(!n)return!1;let r=st(n[1]);if(!r||r.some(e=>!e))return!1;let[i,...a]=r,o=ct(i)?r:rt.test(i)?a:null;return!!o&&o.length>0&&o.every(ct)}var ut=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function dt(e){let t=e.fillPatternScale||1,n=160*t,r={backgroundImage:`url("${et({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&&ut.has(i)&&(r.animation=`background-animation-${i} ${a}s linear infinite`),r}function ft(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("${Ze(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?dt(e):e.fillColor?n?{color:e.fillColor}:{backgroundColor:e.fillColor}:{}:t===`gradient`?r=lt(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}var pt=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],z=(e,t,n,r=[0,0,0])=>[...e,0,r[0],...t,0,r[1],...n,0,r[2],0,0,0,1,0],B=e=>z([.213+.787*e,.715-.715*e,.072-.072*e],[.213-.213*e,.715+.285*e,.072-.072*e],[.213-.213*e,.715-.715*e,.072+.928*e]),mt=e=>z([.393+.607*(1-e),.769-.769*(1-e),.189-.189*(1-e)],[.349-.349*(1-e),.686+.314*(1-e),.168-.168*(1-e)],[.272-.272*(1-e),.534-.534*(1-e),.131+.869*(1-e)]),ht=e=>z([e,0,0],[0,e,0],[0,0,e],[.5-.5*e,.5-.5*e,.5-.5*e]),gt=e=>z([e,0,0],[0,e,0],[0,0,e]),_t=(e,t,n,r)=>z([e,0,0],[0,t,0],[0,0,n],r);function vt(e,t){let n=[];for(let r=0;r<4;r++)for(let i=0;i<5;i++){let a=i===4?t[r*5+4]:0;for(let n=0;n<4;n++)a+=t[r*5+n]*e[n*5+i];n.push(a)}return n}var V=(...e)=>e.reduce(vt,pt),yt={"warm-vintage":V(mt(.35),ht(.9),gt(1.05),B(1.1)),"cool-cinema":V(_t(.9,1,1.12),ht(1.1),B(.9)),cyberpunk:V(B(1.6),_t(1.1,.85,1.2)),"monochrome-contrast":V(B(0),ht(1.4)),"teal-orange":V(B(1.2),z([1.1,.05,-.1],[-.05,1,.05],[-.1,.1,1.1])),"bleach-bypass":V(B(.35),ht(1.35),gt(.95)),"cross-process":V(_t(1.1,1.05,.75,[-.05,.05,.1]),ht(1.15)),sepia:mt(1)};Object.keys(yt);function bt(e,t=100){if(!Object.hasOwn(yt,e))return;let n=Math.min(100,Math.max(0,t))/100;return yt[e].map((e,t)=>+(pt[t]+(e-pt[t])*n).toFixed(6))}var xt=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],St=new Set(xt);function Ct(e){return typeof e==`string`&&St.has(e)}var wt=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,Tt=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,Et=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),Dt=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,Ot=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function kt(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(wt.test(n)||Et.has(n.toLowerCase())||Tt.test(n)||Dt.test(n))return!0;let r=Ot.exec(n);return r?kt(r[2],t+1):!1}function At(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&kt(n)?n:void 0;if(Ct(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}function jt(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, `+At(e.shadowColorRole,s)+` `+Math.round(t*100)+`%, transparent)`:At(e.shadowColorRole,s):s}function Mt(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 Nt=`#f59e0b`;function Pt(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)||Nt,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`:jt({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 if(a.kind===`texture`)i.push({kind:`texture`,effect:a});else if(a.kind===`filter`){let e=pe(Mt(a));e&&n.push(e)}let a=e?.find(e=>e.kind===`color-grade`),o=a&&bt(a.preset,a.intensity);if(o){let e=`oim-grade-`+t.layerId.replace(/[^A-Za-z0-9_-]/g,`_`);i.push({kind:`color-grade`,id:e,values:o}),n.push(`url(#${e})`)}let s=e?.find(e=>e.kind===`backdrop`),c;return s?.preset===`duotone`?i.push({kind:`duotone`}):c=pe(Mt(s)),{filter:n.join(` `),textShadow:r.join(`, `),backdropFilter:c,defs:i}}var Ft={dots:`dots`,puntos:`dots`,lines:`lines`,lineas:`lines`,rings:`rings`,anillos:`rings`,grain:`grain`,grano:`grain`},It=/^#[0-9a-fA-F]{3,8}$|^rgba?\([\d.,\s%]+\)$/;function Lt(e,t){let n=Math.max(0,Math.min(1,t)),r=(e??``).trim();if(!It.test(r))return`rgba(255, 255, 255, ${n})`;if(r.startsWith(`#`)){let e=r.slice(1);e.length===3&&(e=[...e].map(e=>e+e).join(``));let t=t=>parseInt(e.slice(t,t+2),16)||0;return`rgba(${t(0)}, ${t(2)}, ${t(4)}, ${n})`}let[i=`0`,a=`0`,o=`0`]=r.replace(/rgba?\(|\)/g,``).split(`,`).map(e=>e.trim());return`rgba(${i}, ${a}, ${o}, ${n})`}function Rt(e,t=`#ffffff`){let n=Math.max(0,Math.min(1,e));return`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" result="n"/><feColorMatrix in="n" type="luminanceToAlpha" result="a"/><feFlood flood-color="${It.test(t.trim())?t.trim():`#ffffff`}"/><feComposite in2="a" operator="in"/></filter><rect width="128" height="128" filter="url(#g)" opacity="${n}"/></svg>`}function zt(e,t=.2,n=e=>`${e}px`){let r=Ft[e.type];if(!r)return;let i=Lt(e.color??`#ffffff`,t),a=Math.max(2,e.size||20);if(r===`dots`){let t=n(Math.max(.5,e.thickness??2));return{backgroundImage:`radial-gradient(circle, ${i} ${t}, transparent ${t})`,backgroundSize:`${n(a)} ${n(a)}`}}if(r===`grain`){let r=Rt(t,e.color);return{backgroundImage:`url("data:image/svg+xml;utf8,${encodeURIComponent(r)}")`,backgroundSize:`${n(128)} ${n(128)}`}}let o=Math.max(.5,e.thickness??1);if(r===`rings`){let e=Math.max(0,a-o);return{backgroundImage:`repeating-radial-gradient(circle, transparent 0, transparent ${n(e)}, ${i} ${n(e)}, ${i} ${n(a)}, transparent ${n(a+1)})`,backgroundSize:`100% 100%`}}let s=e=>{let t=(e%180+180)%180;return t===0?180:t},c=e=>`repeating-linear-gradient(${s(e)}deg, ${i} 0px, ${i} ${n(o)}, transparent ${n(o)}, transparent ${n(a)})`,l=e.angle??0;return e.crossed?{backgroundImage:`${c(l)}, ${c(l+90)}`,backgroundSize:`100% 100%, 100% 100%`}:{backgroundImage:c(l),backgroundSize:`100% 100%`}}var Bt=e=>e&&typeof e==`object`&&typeof e.var==`string`?e.var:void 0,Vt=(e,t)=>Bt(e)?t.literal(e.fallback):t.literal(e);function Ht(e,t){let n=(e.colors??[]).map(e=>Vt(e,t)).filter(e=>!!e);return{fillPatternType:e.preset,fillPatternColor:n[0],fillPatternColorRole:Bt(e.colors?.[0]),fillPatternColors:n.length>1?n:void 0,fillPatternBgColor:Vt(e.bg,t),fillPatternBgColorRole:Bt(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 Ut=e=>`${+(e*100).toFixed(4)}%`;function Wt(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} ${Ut(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 Gt=e=>({...e,backgroundClip:`text`,WebkitBackgroundClip:`text`,color:`transparent`}),Kt=(e,t)=>t===void 0||t===1?e:{...e,opacity:String(t)};function qt(e,t,n=0){let{colors:r,isText:i}=t;if(`ref`in e){let r=t.resources?.[e.ref];return r&&n<4?qt(r,t,n+1):{}}let a=e=>e?i?{color:e}:{backgroundColor:e}:{};switch(e.kind){case`color`:return Kt(a(r.css(e.value)),e.opacity);case`gradient`:{let t=e.gradient?Wt(e.gradient,r):void 0;if(!t)return{};let n={backgroundImage:t};return Kt(i?Gt(n):n,e.opacity)}case`pattern`:{let t=e.pattern,n=(t.colors??[]).map(e=>r.literal(e)).filter(e=>!!e);return Kt(ft({...Ht(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 Kt(ft({type:i?`text`:`shape`,width:t.width,height:t.height,fillType:`generative`,fillGenerative:e.generative}),e.opacity);case`texture`:return i?{}:zt({...e.texture,color:r.literal(e.texture.color)},e.opacity,t.len)??{};default:return{}}}var Jt={silhouette:null,fillable:!0,round:!1};function Yt(e){if(!e||e.kind===`rect`)return Jt;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=_e(t);return n?{silhouette:Be({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:Jt}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=Be({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:Jt}return Jt}function Xt(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 Zt(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?oe(e.var,e.fallback):typeof e==`string`?oe(null,e):``)||void 0,literal:n=>(t(n)?ae(e)?.colors?.[n.var]??oe(null,n.fallback):typeof n==`string`?oe(null,n):``)||void 0}}function Qt(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 $t(e,t){let n=e?.text;if(!n)return;let r={},i=Qt(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=Qt(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 en(e,t){let[n,r,i,a]=t,o=n+i/2,s=r+a/2,c=e.stops.length,l=e.stops.map((e,t)=>({offset:`${Math.round((e.at??t/(c-1))*1e4)/100}%`,color:e.color}));if(e.type===`radial`)return{tag:`radialGradient`,attrs:{cx:o,cy:s,r:Math.hypot(i/2,a/2)},stops:l};let u=((e.angle??180)-90)*Math.PI/180,d=(Math.abs(i*Math.cos(u))+Math.abs(a*Math.sin(u)))/2,f=Math.cos(u)*d,p=Math.sin(u)*d;return{tag:`linearGradient`,attrs:{x1:o-f,y1:s-p,x2:o+f,y2:s+p},stops:l}}var tn=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0,nn=0;function rn(e,t,n=!1){return an(document,e,t,n).outerHTML}function an(e,t,n,r=!1){let i=`http://www.w3.org/2000/svg`,a=e.createElementNS(i,`svg`);a.setAttribute(`viewBox`,t.viewBox.join(` `)),a.setAttribute(`width`,r?String(t.viewBox[2]):`100%`),a.setAttribute(`height`,r?String(t.viewBox[3]):`100%`),r?a.setAttribute(`xmlns`,i):(a.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),a.style.setProperty(`display`,`block`));let o;if(n.strokeGradient){let{tag:r,attrs:s,stops:c}=en(n.strokeGradient,t.viewBox),l=a.appendChild(e.createElementNS(i,`defs`)).appendChild(e.createElementNS(i,r));l.id=`oim-sg-${++nn}`,l.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of Object.entries(s))l.setAttribute(e,String(t));for(let t of c){let n=l.appendChild(e.createElementNS(i,`stop`));n.setAttribute(`offset`,t.offset),n.setAttribute(`stop-color`,tn(t.color)??`#000`)}o=`url(#${l.id})`}for(let s of t.paths){let t=e.createElementNS(i,`path`);t.setAttribute(`d`,s.d);let c=tn(s.fill===`currentColor`?n.fill??`currentColor`:s.fill),l=o??tn(s.stroke===`currentColor`?n.stroke??`currentColor`:s.stroke);r?(t.setAttribute(`fill`,c??`none`),l&&t.setAttribute(`stroke`,l)):(t.setAttribute(`fill`,`none`),c&&t.style.setProperty(`fill`,c),l&&t.style.setProperty(`stroke`,l)),s.strokeWidth!==void 0&&t.setAttribute(`stroke-width`,String(s.strokeWidth)),s.fillRule&&t.setAttribute(`fill-rule`,s.fillRule),s.cap&&t.setAttribute(`stroke-linecap`,s.cap),s.join&&t.setAttribute(`stroke-linejoin`,s.join),s.opacity!==void 0&&t.setAttribute(`opacity`,String(s.opacity)),s.transform&&t.setAttribute(`transform`,`matrix(${s.transform.join(` `)})`),a.appendChild(t)}return a}function on(e){let t=e.fills?.[0]?.kind;return t===`gradient`||t===`pattern`||t===`generative`}function sn(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=e.strokes?.[0]?.paint,a=n(i),o=i?.kind===`gradient`&&i.gradient?.type!==`conic`?i.gradient:void 0,s=o&&{...o,stops:o.stops.map(e=>({...e,color:t(e.color)??e.color}))};return{fill:r??a,stroke:a??r,...s&&{strokeGradient:s}}}var cn=[`backgroundColor`,`backgroundImage`,`backgroundSize`,`backgroundClip`,`WebkitBackgroundClip`,`color`,`animation`],ln=[`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`],H=`var(--oim-bg-tile, 160px)`,un=`calc(${H} * 1.15)`,U=e=>`background-position: ${e}`,dn=e=>`background-size: ${e} ${e}`,fn=[`@keyframes background-animation-right { from { ${U(`0 0`)} } to { ${U(`${H} 0`)} } }`,`@keyframes background-animation-left { from { ${U(`0 0`)} } to { ${U(`calc(-1 * ${H}) 0`)} } }`,`@keyframes background-animation-up { from { ${U(`0 0`)} } to { ${U(`0 calc(-1 * ${H})`)} } }`,`@keyframes background-animation-down { from { ${U(`0 0`)} } to { ${U(`0 ${H}`)} } }`,`@keyframes background-animation-zoom-in { 0%, 100% { ${dn(H)} } 50% { ${dn(un)} } }`,`@keyframes background-animation-zoom-out { 0%, 100% { ${dn(un)} } 50% { ${dn(H)} } }`,`@keyframes background-animation-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }`].join(` `);function pn(e){if(e.getElementById(`oim-pattern-keyframes`))return;let t=e.createElement(`style`);t.id=`oim-pattern-keyframes`,t.textContent=fn,(e.head||e.documentElement).appendChild(t)}function mn(e,t,n){let r=e.style;for(let e of cn)r[e]=``;e.querySelectorAll(`:scope > [data-oim-fill]`).forEach(e=>e.remove());let i={colors:n.colors,isText:n.isText,resources:n.resources,width:n.width,height:n.height,len:n.len},a,o=[],s=[],c=[];for(let r of t.fills??[]){if(`kind`in r&&r.kind===`image`){n.isText||c.push(r);continue}let t=gn(r,n.colors)??qt(r,i),l=`kind`in r&&r.kind===`pattern`?r.pattern.motion:void 0;if(l?.period&&l.period>0&&ln.includes(l.direction??`right`)){pn(e.ownerDocument);let t=160*(r.pattern.scale||1);e.style.setProperty(`--oim-bg-tile`,n.len?n.len(t):`${t}px`),e.style.animation=`background-animation-${l.direction??`right`} ${l.period}s linear infinite`}if(t.color&&(e.style.color=t.color),t.backgroundClip&&Object.assign(e.style,{backgroundClip:`text`,WebkitBackgroundClip:`text`}),t.backgroundColor&&(a===void 0&&o.length===0?a=t.backgroundColor:(o.unshift(`linear-gradient(${t.backgroundColor}, ${t.backgroundColor})`),s.unshift(`auto`))),t.backgroundImage){o.unshift(t.backgroundImage);let e=/^([\d.]+)px [\d.]+px$/.exec(t.backgroundSize??``);s.unshift(e&&n.size?n.size(+e[1]):t.backgroundSize??`auto`)}}a&&(e.style.backgroundColor=a),o.length&&(e.style.backgroundImage=o.join(`, `)),s.some(e=>e!==`auto`)&&(e.style.backgroundSize=s.join(`, `));for(let t of c)e.appendChild(hn(e,t))}function hn(e,t){let n=e.ownerDocument.createElement(`img`);n.dataset.oimFill=``,t.src.startsWith(`data:image/`)&&(n.src=t.src),n.alt=``,n.draggable=!1,Object.assign(n.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,display:`block`,pointerEvents:`none`,objectFit:t.fit??`cover`});let r=[];if(t.crop){e.style.overflow=`hidden`;let i=he(t.crop);Object.assign(n.style,{objectFit:i.objectFit,objectPosition:i.objectPosition,transformOrigin:i.transformOrigin}),r.push(i.transform)}let i=me(t.flipX,t.flipY);i&&r.push(`scale(${i[0]}, ${i[1]})`),r.length&&(n.style.transform=r.join(` `)),t.opacity!==void 0&&t.opacity!==1&&(n.style.opacity=String(t.opacity));let a=t.filters&&pe(Mt(t.filters));return a&&Object.assign(n.style,{filter:a,clipPath:`inset(0)`}),n}function gn(e,t){if(!(`kind`in e)||e.kind!==`pattern`||!e.pattern.tile)return;let n=e.pattern,r=rn({kind:`paths`,...n.tile},sn({},t.literal),!0),i=tt(Ht(n,t),r,t.literal(n.bg)??`transparent`,t.literal(n.colors?.[0])??`#000000`),a=160*(n.scale||1);return i?{backgroundImage:`url("${i}")`,backgroundSize:`${a}px ${a}px`}:void 0}function _n(){return[`:host { position: relative; display: flex !important; overflow: hidden; width: 100%; height: 100%; background: var(--oim-bg, transparent); user-select: none; -webkit-user-select: none; content-visibility: auto; contain-intrinsic-size: auto 300px; }`,`:host(.oim-player-paused) { pointer-events: none !important; }`,`:host(.oim-player-paused[activate-on="hover"]) { pointer-events: auto !important; }`,`:host(.oim-player-paused) * { animation-play-state: paused !important; transition: none !important; }`,`:host(.oim-align-center) { align-items: center; justify-content: center; }`,`:host(.oim-align-top) { align-items: flex-start; justify-content: center; }`,`:host(.oim-align-bottom) { align-items: flex-end; justify-content: center; }`,`:host(.oim-mobile), :host(.oim-tier-low) { --oim-reveal-blur: 0px; }`,`.oim-player-viewport { position: relative; aspect-ratio: var(--oim-ar, 16/9); flex-shrink: 0; opacity: 0; overflow: hidden; transition: opacity var(--oim-reveal-duration, 0.32s) ease-in-out, filter var(--oim-reveal-duration, 0.32s) ease-in-out; filter: blur(var(--oim-reveal-blur, 14px)); }`,`.oim-player-viewport.oim-viewport--ready { opacity: 1; filter: none; }`,`.oim-player-viewport.oim-viewport--poster { opacity: 1; filter: none; }`,`.oim-player-viewport.oim-viewport--poster:not(.oim-viewport--ready) .oim-layer-overlay { visibility: hidden; }`,`.oim-player-base.oim-base--faded { opacity: 0; transition: opacity 200ms ease-out; }`,`.oim-player-viewport.oim-fit-contain { max-width: 100%; max-height: 100%; }`,`.oim-player-viewport.oim-fit-cover { min-width: 100%; min-height: 100%; max-width: none; max-height: none; }`,`.oim-player-base { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; transition: filter 0.5s ease-in-out; image-rendering: high-quality; image-rendering: -webkit-optimize-contrast; }`,`.oim-layer-overlay { position: absolute; top: 50%; left: 50%; width: var(--oim-overlay-w, 1080px); height: var(--oim-overlay-h, 1920px); transform: translate(-50%, -50%) scale(var(--oim-fit, 1)); transform-origin: center center; z-index: 10; pointer-events: none; transition: opacity 0.5s ease-in-out; container-type: inline-size !important; container-name: oim-viewport; }`,`.oim-layer-overlay [data-oim-id] { pointer-events: auto; }`,`.oim-player-loading { color: var(--oim-text-muted, #8a8a96); font-family: "JetBrains Mono", monospace; font-size: 12px; }`,fn,`.oim-player-error { color: var(--oim-red, #ef4444); font-family: "JetBrains Mono", monospace; font-size: 12px; }`].join(`
|
|
10
|
+
`)}function vn(e){if(!e)return;let t=_n();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)}M(e)}function yn(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 bn=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),xn=new Set([`public`,`author_only`,`sealed`]);function Sn(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?bn.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&xn.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}function Cn(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var wn=`author_only`,Tn=[`public`,`author_only`,`sealed`];function En(e){if(!e||typeof e!=`object`)return wn;let t=Sn(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&Tn.includes(n)?n:wn}function Dn(e){return e===`public`?`verified_authorless`:`verified`}function On(e){let t=Cn(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var kn=`oim:base`;function An(e){let t=t=>{if(typeof t==`string`)return t===kn;if(`ref`in t){let n=e.resources?.[t.ref];return n!==void 0&&`kind`in n&&n.kind===`image`&&n.src===kn}return t.value===kn||Object.values(t.modes??{}).includes(kn)},n=e=>e.some(e=>e.image!==void 0&&t(e.image.src)||n(e.children??[]));return n(e.layers)}function jn(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 Mn="/**\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={}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\n;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),s=t;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),o&&(s=r))}catch{}if(o){let t=b(e.key_version,s);if(!x({kid:e.key_version,jwk:s,not_after:t},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;if(typeof e.oim==`string`&&e.oim.startsWith(`2.`)){let r=e.layers??[];if(!Array.isArray(r))return n(`layers must be array`),t;let i=[],a=0,o=(e,t)=>{if(e.length>150)return n(`max 150 layers per list`),!1;for(let r of e){if(++a>1e3)return n(`max 1000 layers in total`),!1;i.push({node:r,depth:t})}return!0};if(o(r,1))for(;i.length>0;){let{node:e,depth:t}=i.pop();if(t>32){n(`layer nesting deeper than 32`);break}if(typeof e!=`object`||!e||Array.isArray(e)){n(`layer must be object`);break}if(e.children!==void 0){if(!Array.isArray(e.children)){n(`layer children must be array`);break}if(!o(e.children,t+1))break}}}let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;v(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=H(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await R(e.metadata,r),l=z({isSigned:s,isSigValid:c,keyExpired:s&&c?await B(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(V(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:m(e.metadata)||a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",Nn=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,Mn],{type:`text/javascript;charset=utf-8`});function Pn(e){let t;try{if(t=Nn&&(self.URL||self.webkitURL).createObjectURL(Nn),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Mn),{type:`module`,name:e?.name})}}var Fn=[{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`}}],In=`https://api.oim.media/v1/media/keys`;function W(e){for(let t=0;t<Fn.length;t++)if(Fn[t].kid===e)return Fn[t];return null}function Ln(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||In}function Rn(e,t){let n=W(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 zn(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 Bn=6048e5;function Vn(e,t,n=Date.now()){let r=W(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!W(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)))+Bn}var Hn=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function Un(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 Hn(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new Hn(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:Ln()})})},stats(){return{alive:t!==null,pending:i.size}}}}var Wn=null;function Gn(e,t,n){return Wn||=Un(()=>new Pn),Wn.verify(e,t,n)}var Kn=10485760;async function qn(e,t=Kn){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 G(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await G(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 G(e,t,n=Kn){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 Jn(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 Yn(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 G(e,`deflate`)}catch{try{t=await G(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 G(t,`deflate`)}catch(e){try{i=await G(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 G(o,`deflate`)}catch(e){try{i=await G(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 qn(i)),{image:s,metadata:c,imageHash:await Jn(t)}}var Xn=2**53-1;function Zn(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>Xn:typeof e==`object`&&e?Object.values(e).some(Zn):!1}var Qn=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function $n(e){if(Array.isArray(e))return e.map($n);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=$n(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function er(e){if(Array.isArray(e))return e.map(er);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]=er(e[r]);return t}return e}function tr(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))Qn.has(n)||(t[n]=e[n]);let n=er($n(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}var nr=1e3,K={},rr=null,ir=!1,ar=null;function or(){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 sr(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 cr(e){let t=W(e);return t?t.jwk:(K[e]||!ir&&(ar||=or().then(e=>{e.forEach(e=>{K[e.kid]=e}),ir=!0}),await ar,K[e])||await lr(),K[e])}function lr(){return rr||=(async function(){try{let e=Ln(),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 sr(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),rr}async function ur(e){return await lr(),K[e]||null}async function dr(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 cr(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(Zn(e))return!1;let r=tr(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),c=t;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 ur(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),s&&(c=n))}catch{}if(s){let t=Rn(e.key_version,c);if(!zn({kid:e.key_version,jwk:c,not_after:t},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 fr(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`:Dn(En(e.metadata)):`image_unsealed`}async function pr(e,t=Date.now()){let n=e&&e.key_version;return n?W(n)?Vn(n,null,t):Vn(n,await ur(n),t):!1}function mr(e){return e===`image_mismatch`||e===`invalid_signature`}var hr=`OIM_ALTERED`;function gr(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;if(typeof e.oim==`string`&&e.oim.startsWith(`2.`)){let r=e.layers??[];if(!Array.isArray(r))return n(`layers must be array`),t;let i=[],a=0,o=(e,t)=>{if(e.length>150)return n(`max 150 layers per list`),!1;for(let r of e){if(++a>1e3)return n(`max ${nr} layers in total`),!1;i.push({node:r,depth:t})}return!0};if(o(r,1))for(;i.length>0;){let{node:e,depth:t}=i.pop();if(t>32){n(`layer nesting deeper than 32`);break}if(typeof e!=`object`||!e||Array.isArray(e)){n(`layer must be object`);break}if(e.children!==void 0){if(!Array.isArray(e.children)){n(`layer children must be array`);break}if(!o(e.children,t+1))break}}}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}var _r=Math.log(1.05)/100,vr=.01,yr=16,br=800;function xr(e,t,n,r){let i=n===1?t*yr:n===2?t*br:t,a=e*Math.exp(-i*(r?vr:_r));return Math.max(1,Math.min(4,a))}var Sr=`1.35.2`,Cr=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function wr(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 Tr(e,t){let n=wr(e),r=wr(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 Er(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=Tr(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 Dr(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 Or=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,kr=546136,Ar={woff:`wOFF`,woff2:`wOF2`},jr=/^[A-Za-z0-9+/]*={0,2}$/;function Mr(e,t){try{return atob(e.slice(0,8)).startsWith(Ar[t])}catch{return!1}}function Nr(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`||!Or.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>kr||e.data.length%4!=0||!jr.test(e.data)||Mr(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 Pr(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 Fr(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var Ir=(e,t)=>`${t?+(e/t*100).toFixed(4):0}%`,Lr={"top-left":[0,0],top:[-50,0],"top-right":[-100,0],left:[0,-50],center:[-50,-50],right:[-100,-50],"bottom-left":[0,-100],bottom:[-50,-100],"bottom-right":[-100,-100]};function Rr(e,t,n){let r=e.style;r.left=Ir(t.x-n.x,n.width),r.top=Ir(t.y-n.y,n.height),t.width!==void 0&&(r.width=Ir(t.width,n.width)),t.height!==void 0&&(r.height=Ir(t.height,n.height));let[i,a]=Lr[t.anchor??`top-left`];r.transform=[i||a?`translate(${i}%, ${a}%)`:``,t.rotation?`rotate(${t.rotation}deg)`:``,t.flipX?`scaleX(-1)`:``,t.flipY?`scaleY(-1)`:``].filter(Boolean).join(` `)}function zr(e,t,n){e.style.borderRadius=``;let r=t.corners;r===void 0||n||(e.style.borderRadius=(Array.isArray(r)?r:[r]).map(e=>`${e}px`).join(` `))}var Br=`http://www.w3.org/2000/svg`,Vr=0,Hr=e=>e.d??`M `+e.points.split(` `).join(` L `)+` Z`;function Ur(e,t){let n=`oim-image-fill-${++Vr}`,[r,i,a,o]=t.viewBox.trim().split(/\s+/).map(Number),s=a===o?`scale(${1/a})`:`scale(${1/a} ${1/o})`,c=r||i?`${s} translate(${-r} ${-i})`:s,l=e.createElementNS(Br,`svg`);l.setAttribute(`width`,`0`),l.setAttribute(`height`,`0`),l.style.position=`absolute`;let u=e.createElementNS(Br,`clipPath`);u.setAttribute(`id`,n),u.setAttribute(`clipPathUnits`,`objectBoundingBox`);let d=e.createElementNS(Br,t.rect?`rect`:`path`);if(t.rect)for(let[e,n]of[[`x`,`0`],[`y`,`0`],[`width`,`1`],[`height`,`1`],[`rx`,String(t.rect.rx)],[`ry`,String(t.rect.ry)]])d.setAttribute(e,n);else d.setAttribute(`d`,t.d),d.setAttribute(`transform`,c),t.evenodd&&d.setAttribute(`clip-rule`,`evenodd`);return u.appendChild(d),l.appendChild(u),{svg:l,clipPath:`url(#${n})`}}var Wr=[`border`,`outline`,`outlineOffset`,`boxShadow`,`WebkitTextStroke`];function Gr(e,t){for(let n of e.strokes??[]){if(!(`kind`in n.paint)||n.paint.kind!==`color`)continue;let e=t.css(n.paint.value);if(e)return{...n,color:e}}}function Kr(e,t){let n=Gr(e,t.colors);if(!n)return{};let r=`${n.width}px`;if(t.isText)return{WebkitTextStroke:`${r} ${n.color}`};if(t.vector)return{};if(n.align===`inside`)return{boxShadow:`inset 0 0 0 ${r} ${n.color}`};if(n.align===`outside`)return{boxShadow:`0 0 0 ${r} ${n.color}`};let i=`${Number(n.width)/2}px`,a=n.style??`solid`;return t.rounded&&a===`solid`?{boxShadow:`inset 0 0 0 ${i} ${n.color}, 0 0 0 ${i} ${n.color}`}:{outline:`${r} ${a} ${n.color}`,outlineOffset:`-${i}`}}function qr(e,t,n){let r=e.style;for(let e of Wr)r[e]=``;Object.assign(e.style,Kr(t,n))}var Jr=`http://www.w3.org/2000/svg`;function Yr(e,t,n){e.querySelectorAll(`:scope > svg[data-oim-figure]`).forEach(e=>e.remove()),e.querySelectorAll(`:scope > [data-oim-figure-clip]`).forEach(e=>e.replaceWith(...e.querySelectorAll(`:scope > img`))),Zr(e,void 0);let r=Yt(t.geometry),i=on(t)&&!t.mask;r.round&&!r.silhouette&&(e.style.borderRadius=`50%`);let a=r.silhouette;if(!a){if(t.geometry?.kind===`paths`&&!r.path){let r=sn(t,n.colors.css);i?Zr(e,rn(t.geometry,{fill:`#000`,stroke:`#000`},!0)):(e.style.backgroundColor=`transparent`,e.style.backgroundImage=``);let a=an(e.ownerDocument,t.geometry,i?{...r,fill:`none`}:r);a.dataset.oimFigure=``,e.appendChild(a)}return r}let o=t.fills?.[0],s=r.fillable&&o&&`kind`in o&&o.kind===`color`?n.colors.css(o.value):void 0;i?Zr(e,`<svg xmlns="${Jr}" viewBox="${a.viewBox}" preserveAspectRatio="none"><path d="${Hr(a).replace(/[^\d\sMmLlHhVvCcSsQqTtAaZzEe.,+-]/g,``)}"/></svg>`):(e.style.backgroundColor=`transparent`,e.style.backgroundImage=``);let c=Gr({strokes:(t.strokes??[]).filter(e=>!e.align)},n.colors),l=e.ownerDocument.createElementNS(Jr,`svg`);l.dataset.oimFigure=``,l.setAttribute(`viewBox`,a.viewBox),l.setAttribute(`preserveAspectRatio`,`none`),Object.assign(l.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,display:`block`,overflow:`visible`});let u=e.ownerDocument.createElementNS(Jr,a.points?`polygon`:`path`);return a.points?u.setAttribute(`points`,a.points):u.setAttribute(`d`,a.d),u.setAttribute(`fill`,s??`none`),c&&(u.setAttribute(`stroke`,c.color),u.setAttribute(`stroke-width`,String(c.width)),u.setAttribute(`vector-effect`,`non-scaling-stroke`),u.setAttribute(`stroke-linejoin`,`round`),u.setAttribute(`stroke-linecap`,`round`),c.style===`dashed`?u.setAttribute(`stroke-dasharray`,`6,4`):c.style===`dotted`&&u.setAttribute(`stroke-dasharray`,`2,3`)),l.appendChild(u),e.appendChild(l),Xr(e,a),r}function Xr(e,t){let n=e.querySelectorAll(`:scope > img[data-oim-fill]`);if(!n.length)return;let{svg:r,clipPath:i}=Ur(e.ownerDocument,{d:Hr(t),viewBox:t.viewBox}),a=e.ownerDocument.createElement(`div`);a.dataset.oimFigureClip=``,Object.assign(a.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,overflow:`hidden`,pointerEvents:`none`,clipPath:i}),a.append(r,...n),e.insertBefore(a,e.firstChild)}function Zr(e,t){let n=t?`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}")`:``;for(let r of[``,`-webkit-`])e.style.setProperty(`${r}mask-image`,n),e.style.setProperty(`${r}mask-size`,t?`100% 100%`:``),e.style.setProperty(`${r}mask-repeat`,t?`no-repeat`:``)}var Qr=[`overlay`,`soft-light`,`multiply`],$r=(e,t)=>typeof e==`number`&&Number.isFinite(e)?Math.max(1,Math.min(100,e)):t;function ei(e){let t=$r(e,50);return Math.round((2-(t-1)*1.8/99)*1e3)/1e3}function ti(e,t){let n=$r(t?.intensity,20),r=Qr.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="${ei(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>`}var ni=`http://www.w3.org/2000/svg`;function ri(e){let t=e.querySelector(`:scope > svg.oim-grain-defs > defs`);if(t)return t;let n=e.ownerDocument,r=n.createElementNS(ni,`svg`);r.setAttribute(`class`,`oim-grain-defs`),r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`style`,`position:absolute;pointer-events:none`);let i=n.createElementNS(ni,`defs`);return r.appendChild(i),e.appendChild(r),i}function ii(e,t,n){if(typeof DOMParser>`u`)return;let r=e.ownerDocument,i=ri(e);i.querySelector(`#`+t)?.remove();let a=ti(t,{intensity:n.intensity,size:n.size,blend:n.blend}),o=new DOMParser().parseFromString(`<svg xmlns="${ni}"><defs>${a}</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&i.appendChild(r.importNode(o,!0))}function ai(e,t,n){let r=e.ownerDocument,i=ri(e);i.querySelector(`#`+t)?.remove();let a=r.createElementNS(ni,`filter`);a.setAttribute(`id`,t),a.setAttribute(`color-interpolation-filters`,`sRGB`);let o=r.createElementNS(ni,`feColorMatrix`);o.setAttribute(`type`,`matrix`),o.setAttribute(`values`,n.join(` `)),a.appendChild(o),i.appendChild(a)}function oi(){return Promise.resolve().then(()=>(Je(),Ve)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}function si(e){if(!e)return;let t=e.trim(),n=/^data:application\/json(;base64)?,/i.exec(t);if(n){let e=t.slice(n[0].length);try{t=n[1]?atob(e):decodeURIComponent(e)}catch{return}}if(t.startsWith(`{`))try{let e=JSON.parse(t);return e&&typeof e==`object`&&Array.isArray(e.layers)?e:void 0}catch{return}}function ci(e,t,n){let r=e.ownerDocument.createElement(`div`);r.className=`oim-lottie`,Object.assign(r.style,{position:`absolute`,inset:`0`}),e.appendChild(r);let i,a=!1;return oi().then(e=>{a||(i=e.loadAnimation({container:r,renderer:`svg`,loop:n.loop,autoplay:!n.paused(),animationData:t}),n.paused()&&i.goToAndStop(0,!0))}).catch(()=>{r.remove()}),{play:()=>i?.play(),pause:()=>i?.pause(),destroy:()=>{a=!0,i?.destroy(),r.remove()}}}var li=`http://www.w3.org/2000/svg`,ui={shadows:`#1e1b4b`,lights:`#fbbf24`};function di(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 fi(e,t){let n=e.createElementNS(li,`filter`);n.setAttribute(`id`,t),n.setAttribute(`color-interpolation-filters`,`sRGB`);let r=e.createElementNS(li,`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`),n.appendChild(r);let i=e.createElementNS(li,`feComponentTransfer`);return[`R`,`G`,`B`].forEach((t,n)=>{let r=e.createElementNS(li,`feFunc`+t);r.setAttribute(`type`,`table`),r.setAttribute(`tableValues`,`${di(ui.shadows,n)} ${di(ui.lights,n)}`),i.appendChild(r)}),n.appendChild(i),n}var pi={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(pi).filter(e=>e!==`line`&&e!==`scribble`)];function mi(e){if(e&&e!==`rect`&&e!==`rectangle`)return pi[e]}var hi=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,gi={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function _i(e,t,n,r,i,a,o,s,c){let l=Math.abs(n),u=Math.abs(r);if(l===0||u===0||e===s&&t===c)return null;let d=i*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=(e-s)/2,h=(t-c)/2,g=f*m+p*h,_=-p*m+f*h,v=g*g/(l*l)+_*_/(u*u);v>1&&(l*=Math.sqrt(v),u*=Math.sqrt(v));let y=l*l*u*u-l*l*_*_-u*u*g*g,b=l*l*_*_+u*u*g*g,x=Math.sqrt(Math.max(0,y/b));a===o&&(x=-x);let S=x*l*_/u,C=-x*u*g/l,w=f*S-p*C+(e+s)/2,T=p*S+f*C+(t+c)/2,E=(g-S)/l,D=(_-C)/u,O=(-g-S)/l,k=(-_-C)/u,A=(e,t,n,r)=>{let i=(e*n+t*r)/(Math.hypot(e,t)*Math.hypot(n,r)),a=Math.acos(Math.max(-1,Math.min(1,i)));return e*r-t*n<0?-a:a},ee=A(1,0,E,D),j=A(E,D,O,k);!o&&j>0?j-=2*Math.PI:o&&j<0&&(j+=2*Math.PI);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),N=j/M,P=4/3*Math.tan(N/4),F=e=>[w+l*f*Math.cos(e)-u*p*Math.sin(e),T+l*p*Math.cos(e)+u*f*Math.sin(e)],I=e=>[-l*f*Math.sin(e)-u*p*Math.cos(e),-l*p*Math.sin(e)+u*f*Math.cos(e)],L=[];for(let e=0;e<M;e++){let t=ee+e*N,n=t+N,r=F(t),i=F(n),a=I(t),o=I(n);L.push([r[0]+P*a[0],r[1]+P*a[1],i[0]-P*o[0],i[1]-P*o[1],i[0],i[1]])}return L}function vi(e){if(!/^\s*[Mm]/.test(e))return null;let t=[],n=0,r=``,i=0,a=0,o=0,s=0,c=``,l=[0,0],u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},d=()=>{u(),hi.lastIndex=n;let t=hi.exec(e);return t?(n=hi.lastIndex,Number(t[0])):null},f=()=>(u(),e[n]!==`0`&&e[n]!==`1`?null:Number(e[n++]));for(;u(),!(n>=e.length);){if(/[A-Za-z]/.test(e[n])){if(!`MmLlHhVvCcSsQqTtAaZz`.includes(e[n]))return null;r=e[n++]}else if(r===``||r===`Z`||r===`z`)return null;else r===`M`?r=`L`:r===`m`&&(r=`l`);let u=r.toUpperCase(),p=r!==u,m=[];for(let e=0;e<gi[u];e++){let t=u===`A`&&(e===3||e===4)?f():d();if(t===null)return null;m.push(t)}let h=p?i:0,g=p?a:0;switch(u){case`Z`:t.push({cmd:`Z`,args:[]}),i=o,a=s,c=``;break;case`M`:i=m[0]+h,a=m[1]+g,o=i,s=a,t.push({cmd:`M`,args:[i,a]}),c=``;break;case`L`:i=m[0]+h,a=m[1]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`H`:i=m[0]+h,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`V`:a=m[0]+g,t.push({cmd:`L`,args:[i,a]}),c=``;break;case`C`:{let e=[m[0]+h,m[1]+g],n=[m[2]+h,m[3]+g],r=[m[4]+h,m[5]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`S`:{let e=c===`C`?[2*i-l[0],2*a-l[1]]:[i,a],n=[m[0]+h,m[1]+g],r=[m[2]+h,m[3]+g];t.push({cmd:`C`,args:[...e,...n,...r]}),l=[n[0],n[1]],c=`C`,[i,a]=r;break}case`Q`:case`T`:{let e=u===`Q`?[m[0]+h,m[1]+g]:c===`Q`?[2*i-l[0],2*a-l[1]]:[i,a],n=u===`Q`?[m[2]+h,m[3]+g]:[m[0]+h,m[1]+g];t.push({cmd:`C`,args:[i+2/3*(e[0]-i),a+2/3*(e[1]-a),n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1]),n[0],n[1]]}),l=[e[0],e[1]],c=`Q`,[i,a]=n;break}case`A`:{let e=[m[5]+h,m[6]+g],n=_i(i,a,m[0],m[1],m[2],m[3],m[4],e[0],e[1]);if(n)for(let e of n)t.push({cmd:`C`,args:e});else t.push({cmd:`L`,args:e});c=``,[i,a]=e;break}}}return t}function yi(e,t){let n=vi(e);if(!n)return null;let r=e=>{let t=Math.round(e*100)/100;return String(t)};return n.map(({cmd:e,args:n})=>{if(e===`Z`)return`Z`;let i=[];for(let e=0;e<n.length;e+=2){let[a,o]=t(n[e],n[e+1]);i.push(r(a),r(o))}return e+i.join(` `)}).join(``)}var bi=[0,0,100,100],xi=[5,5,90,90],Si={kind:`polygon`,points:[[5,45],[95,45],[95,55],[5,55]]};function Ci(e,t){return e===`line`?Si:t.kind===`path`&&!t.fillable?{...t,d:`${t.d} Z`,fillable:!0}:t}function wi(e){if(e===void 0)return bi;let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n<=0||r<=0?null:t}function Ti(e,[t,n,r,i],a){return yi(e,(e,o)=>[a.x+(e-t)/r*a.width,a.y+(o-n)/i*a.height])}function Ei(e,t){let n=e.geoShape,r=mi(n);if(n&&r){let e=Ci(n,r);return Ti(e.kind===`polygon`?e.points.map(([e,t],n)=>`${n===0?`M`:`L`}${e} ${t}`).join(` `)+` Z`:e.d,n===`line`?bi:xi,t)}if(e.svgPath){let n=wi(e.svgViewBox);return n?Ti(e.svgPath,n,t):null}return null}function Di(e,t){let n=e,r=Array.isArray(n.position)?n.position:[0,0];return{x:typeof n.x==`number`?n.x:Number(r[0])/100*t.width,y:typeof n.y==`number`?n.y:Number(r[1])/100*t.height,width:typeof n.width==`number`?n.width:Number(n.width_px)||0,height:typeof n.height==`number`?n.height:Number(n.height_px)||0}}function q(e){return`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`}function Oi(e,t){return e===`rect`||e===`rectangle`?q(t):Ei({geoShape:e},t)}function ki(e,t){let n=e.style||{},r=n.maskShape||n.geoShape,i=n.maskSvgPath||n.svgPath;return i&&(!r||r===`custom`)?Ei({svgPath:i},t):Oi(r||`circle`,t)}function Ai(e,t){return{x:t.x+(e.x||0),y:t.y+(e.y||0),width:e.width||0,height:e.height||0}}function ji(e,t){let n=Ai(e,t);return e.svgPath?Ei({svgPath:e.svgPath},n):Oi(e.shape||`circle`,n)}function Mi(e){let t=e,n=t.cuts||t.style&&t.style.cuts;return Array.isArray(n)?n:[]}function Ni(e,t){let n=Mi(e);return n.length>0?n.map(e=>ji(e,t)??q(Ai(e,t))).join(` `):ki(e,t)??q(t)}function Pi(e,t){let{width:n,height:r}=t,i=e,a=Di(e,t);return`${((i.maskCoverage||i.style&&i.style.maskCoverage)===`container`?`container`:`canvas`)==`container`?q(a):`M0 0H${n}V${r}H0Z`} ${Ni(e,a)}`}function Fi(e,t){let n=Di(e,t);return ki(e,n)??q(n)}function Ii(e,t){let{width:n,height:r}=t,i=Di(e,t);return`${`M0 0H${n}V${r}H0Z`} ${q(i)} ${Ni(e,i)}`}function Li(e){let t=e;return{maskShape:t?.kind===`preset`?t.name:t?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[t?.kind??``],maskSvgPath:t?.kind===`paths`?t.paths?.map(e=>e.d).join(` `):void 0}}var Ri=`http://www.w3.org/2000/svg`;function zi(e,t,n){let{width:r,height:i}=n.canvas,{x:a=0,y:o=0,width:s=0,height:c=0}=t.box;if(e.querySelectorAll(`:scope > :not([data-oim-mask-frame])`).forEach(e=>e.remove()),e.querySelector(`:scope > [data-oim-mask-frame]`)?.remove(),Object.assign(e.style,{backgroundColor:`transparent`,backgroundImage:``,border:``,outline:``,boxShadow:``,overflow:`visible`}),!s||!c)return;let l={id:t.id,type:`mask`,style:Li(t.geometry),x:a,y:o,width:s,height:c},u=(e,t)=>`${+(e/t*100).toFixed(4)}%`,d=e.ownerDocument,f=d.createElement(`div`);f.dataset.oimMaskFrame=``,Object.assign(f.style,{position:`absolute`,left:u(-a,s),top:u(-o,c),width:u(r,s),height:u(i,c),pointerEvents:`none`});let p=d.createElement(`div`);p.dataset.oimMaskPaint=``,mn(p,t,{colors:n.colors,isText:!1,size:e=>`${+(e/r*100).toFixed(4)}cqw ${+(e/r*100).toFixed(4)}cqw`});let{svg:m,clipPath:h}=Ur(d,{d:Pi(l,n.canvas),viewBox:`0 0 ${r} ${i}`,evenodd:!0});Object.assign(p.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,clipPath:h}),f.append(m,p);let g=Gr(t,n.colors);if(g&&Number(g.width)>0){let e=d.createElementNS(Ri,`svg`);e.dataset.oimMaskOutline=``,e.setAttribute(`viewBox`,`0 0 ${r} ${i}`),e.setAttribute(`preserveAspectRatio`,`none`),Object.assign(e.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,overflow:`visible`,pointerEvents:`none`});let t=d.createElementNS(Ri,`path`);t.setAttribute(`d`,Fi(l,n.canvas)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,g.color),t.setAttribute(`stroke-width`,String(g.width)),t.setAttribute(`stroke-linejoin`,`round`),e.appendChild(t),f.appendChild(e)}e.appendChild(f)}function Bi(e,t,n){let{x:r=0,y:i=0,width:a=0,height:o=0}=t.box;if(!a||!o||!e.childElementCount)return;let s={id:t.id,type:`mask`,style:Li(t.geometry),x:r,y:i,width:a,height:o},c=e.ownerDocument,l=c.createElement(`div`);l.dataset.oimCutout=t.id;let{svg:u,clipPath:d}=Ur(c,{d:Ii(s,n),viewBox:`0 0 ${n.width} ${n.height}`,evenodd:!0});return Object.assign(l.style,{position:`absolute`,left:`0`,top:`0`,width:`100%`,height:`100%`,clipPath:d}),l.append(...e.children),e.append(u,l),l}function Vi(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 Hi(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 Ui(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 Wi(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?Ui(n,1-t*.5):n;l.push({dx:i,dy:a,color:u,opacity:1})}return l}var Gi=1.25,Ki=.5;function qi(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 Gi;return!Number.isFinite(n)||n<=0?Gi:Math.min(3,Math.max(Ki,n))}var Ji=1.4;function Yi(e){(!Number.isFinite(e)||e<=0)&&(e=Gi);let t=Ji-e;return t<=0?0:Math.round(t/2*1e4)/1e4}var J=e=>String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`);function Xi(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:qi({lineHeight:r.lineHeight}),fillColor:(m?.kind===`color`?n(m.value):void 0)||`#FBBF24`,curvePathD:Vi(l,u,v,i.curve?.type??`arc`),isCurved:v!==0,extrusionLayers:Wi(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 Zi(e,t=`artistic-text`){let n=J(`curve-path-${t}`),r=J(`artistic-grad-${t}`),i=e.fillColor,a=``;e.textGradientType===`sunset-gold`?(i=`url(#${r})`,a=`
|
|
11
11
|
<linearGradient id="${r}" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
12
12
|
<stop offset="0%" stop-color="#FDE047" />
|
|
13
13
|
<stop offset="50%" stop-color="#F97316" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oim-media/player-oim",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.2",
|
|
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.35.
|
|
19
|
+
"@oim-media/core": "1.35.2",
|
|
20
20
|
"lottie-web": "^5.12.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
File without changes
|
|
File without changes
|