clipoox-render 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/render-local.mjs +1480 -1479
- package/web/assets/FxEmbed-BymBArNa.js +1 -0
- package/web/assets/MotionEmbed-PmXWSWe5.js +1 -0
- package/web/assets/PluginStore-BVsm6n6N.js +3 -0
- package/web/assets/{ShotComposer-AHScyNYv.js → ShotComposer-Dprx-Yi7.js} +4 -4
- package/web/assets/TemplateEmbed-CrZXoUk_.js +2 -0
- package/web/assets/{TimelinePlugins-CkP5P9b_.js → TimelinePlugins-B1KGtbmb.js} +3 -3
- package/web/assets/TimelineShotFx-DoLx312Y.js +2 -0
- package/web/assets/TransitionEmbed-C5SUosv2.js +1 -0
- package/web/assets/{Whiteboard-C9Mwa3nF.js → Whiteboard-DybaKCdo.js} +3 -3
- package/web/assets/aerial-DSt_mJNA.js +2 -0
- package/web/assets/agentTools-CxZqRLeR.js +2 -0
- package/web/assets/analyzerRun-DCJwb_-Z.js +1 -0
- package/web/assets/{analyzerSandbox-DQGHjUCa.js → analyzerSandbox-DO5ZTv5q.js} +2 -2
- package/web/assets/{api-C5pOWyBM.js → api-BsKbf3l3.js} +4 -4
- package/web/assets/auraTrack-QR0WqBHp.js +1 -0
- package/web/assets/breakthrough-Dv1bndQb.js +2 -0
- package/web/assets/{cameraPresets-CeStHDvF.js → cameraPresets-B234aNzE.js} +1 -1
- package/web/assets/{captionLayout-BAdmqwdS.js → captionLayout-CNgb471H.js} +1 -1
- package/web/assets/clientExport-NtJmxOYP.js +1 -0
- package/web/assets/{depthEstimate-1OjTo_pb.js → depthEstimate-wVYSJtW8.js} +1 -1
- package/web/assets/directorTools-BqFcShgT.js +1 -0
- package/web/assets/{distortFrames-D39fkQ_H.js → distortFrames-D3TQNcJA.js} +2 -2
- package/web/assets/{distortGL-5uNfls9s.js → distortGL-BklPDXPq.js} +1 -1
- package/web/assets/editTools-BQlG5WB_.js +1 -0
- package/web/assets/exportEncode-CaKEPgsy.js +1 -0
- package/web/assets/exportGlb-DstxwzH5.js +2 -0
- package/web/assets/faceTracker-DWxxieVC.js +1 -0
- package/web/assets/fightDirector-OMlPZgjv.js +1 -0
- package/web/assets/fightDrama-G7bXfpQu.js +2 -0
- package/web/assets/{frameSink-CB1EghW0.js → frameSink-Dj71jCRb.js} +3 -3
- package/web/assets/{gpuCompose-EfzSAeMh.js → gpuCompose-DIxBHlTa.js} +1 -1
- package/web/assets/gpuExport-CPSw_dmq.js +189 -0
- package/web/assets/handMatte-DHsHHz4m.js +1 -0
- package/web/assets/handTracker-D_O-C4Dw.js +2 -0
- package/web/assets/{index-BGZJld3s.js → index-CZn97Ygs.js} +1 -1
- package/web/assets/layer-worker-Bar7WgOA.js +5 -0
- package/web/assets/library-BtBrCaFk.js +1 -0
- package/web/assets/{lottieLayer-BhLbZOpr.js → lottieLayer-CfUPParC.js} +4 -4
- package/web/assets/{lottie_light_canvas-D9fsNLID.js → lottie_light_canvas-7iv3btPX.js} +1 -1
- package/web/assets/main-BPmr0TOL.css +1 -0
- package/web/assets/{main-BNZrzSIG.js → main-M1vRa-gd.js} +32 -32
- package/web/assets/{mapBake-BAG6i5fI.js → mapBake-lPNhNZgv.js} +1 -1
- package/web/assets/maskTrack-D2jUh7aw.js +1 -0
- package/web/assets/matteFixRun-B7tWV9Y1.js +1 -0
- package/web/assets/motionBlur-uAm030t9.js +1 -0
- package/web/assets/{objectLocate-Dhktxe5z.js → objectLocate-BDqfSo9J.js} +1 -1
- package/web/assets/pendingMatte-q35zVaiB.js +2 -0
- package/web/assets/personAi-ZjQVo-80.js +2 -0
- package/web/assets/plateCamera-A2E_WO_x.js +1 -0
- package/web/assets/plateCameraMatch-D41LQrsm.js +2 -0
- package/web/assets/plateFollow-CNfi4xuP.js +2 -0
- package/web/assets/plateMatte-BdIxGhw5.js +2 -0
- package/web/assets/{pluginAutomation-DdZOnpoV.js → pluginAutomation-BtQ_w2TB.js} +1 -1
- package/web/assets/poseTracker-DVX__OK7.js +1 -0
- package/web/assets/productTools-r2RgILaA.js +2 -0
- package/web/assets/{remote-DXG553d8.js → remote-sTZauTqM.js} +77 -77
- package/web/assets/rigTrack-Bx9QHlFv.js +1 -0
- package/web/assets/{rotoMaskStore-DrRawyH9.js → rotoMaskStore-pxpRt5Cj.js} +1 -1
- package/web/assets/{rotoMatte-2EcyuvBX.js → rotoMatte-DyXlW4jK.js} +1 -1
- package/web/assets/rotoscope-GORCSVBr.js +1 -0
- package/web/assets/shot-worker-B8JWkmBz.js +1 -0
- package/web/assets/{shotFxAgent-CETPcjzU.js → shotFxAgent-CzHfe75S.js} +2 -2
- package/web/assets/{skin-BQG1Iz6Q.js → skin-BkaT2QuX.js} +1 -1
- package/web/assets/{spark.module-CMSPLU2n.js → spark.module-BRT8yMS4.js} +10 -10
- package/web/assets/spellDuel-BUy289OT.js +2 -0
- package/web/assets/{store-Dxq3MZF3.js → store-BSSbvpzr.js} +1 -1
- package/web/assets/{surfaceLight-B_OSTxcx.js → surfaceLight-CMaBhZ_d.js} +1 -1
- package/web/assets/surfacePin-DM9b9ubh.js +2 -0
- package/web/assets/textAnimators-Cihw35O8.js +1 -0
- package/web/assets/{thumb-xLFX6lDN.js → thumb-Cs636sYt.js} +1 -1
- package/web/assets/{timeline3d-DqXTKdEK.js → timeline3d-BEuZZOxM.js} +2 -2
- package/web/assets/{timeline3dExport-MWomW4fF.js → timeline3dExport-CmSI_pjv.js} +1 -1
- package/web/assets/timelineComp-CRRzLazc.js +1 -0
- package/web/assets/timelineProps-tN2YsMYN.js +1 -0
- package/web/assets/timelineText-CkoUgWcY.js +1 -0
- package/web/assets/{titleArt-CAOxtyHl.js → titleArt-CcTdJuOC.js} +5 -5
- package/web/assets/{titleFrameBudget-BjW--v_T.js → titleFrameBudget-3MFHWIT6.js} +1 -1
- package/web/assets/titleFrames-w-iWje9N.js +1 -0
- package/web/assets/{tool-DEWWeyCz.js → tool-BhIsq238.js} +1 -1
- package/web/assets/tools-DMUnabc_.js +1 -0
- package/web/assets/toonTools-CICrV3QB.js +2 -0
- package/web/assets/trackAnchor-D2bB5mZE.js +1 -0
- package/web/assets/userFonts-BZ4QL-zq.js +1 -0
- package/web/assets/{vfxAlpha-vbbI-03F.js → vfxAlpha-D3Dk1tfF.js} +2 -2
- package/web/assets/vfxBackground-CHlCg8lb.js +2 -0
- package/web/assets/{vfxTrack-BmxWjlDi.js → vfxTrack-CqiQDEYm.js} +1 -1
- package/web/assets/videoExport-l5MGvMn_.js +1 -0
- package/web/assets/views-BdWnG2xK.js +1 -0
- package/web/assets/weaponDuel-B2wTffPC.js +1 -0
- package/web/assets/{windowFrames-DydW5Al5.js → windowFrames-CoIyWqxr.js} +1 -1
- package/web/layer-worker.html +3 -3
- package/web/assets/FxEmbed-B5TQxKxk.js +0 -1
- package/web/assets/MotionEmbed-Catb_GgA.js +0 -1
- package/web/assets/PluginStore-8TjQawtB.js +0 -3
- package/web/assets/TemplateEmbed-Cao8Z5fY.js +0 -2
- package/web/assets/TimelineShotFx-DvmPZQXM.js +0 -2
- package/web/assets/TransitionEmbed-o4UxJ35e.js +0 -1
- package/web/assets/aerial-BPRLPci2.js +0 -2
- package/web/assets/agentTools-CSnN-LvS.js +0 -2
- package/web/assets/analyzerRun-5zJsmMS1.js +0 -1
- package/web/assets/auraTrack-pF-WhpH3.js +0 -1
- package/web/assets/breakthrough-DQN1i-Pw.js +0 -2
- package/web/assets/clientExport-Ca9a3Jiy.js +0 -1
- package/web/assets/directorTools-CvmghG_6.js +0 -1
- package/web/assets/editTools-CUoVvupD.js +0 -1
- package/web/assets/exportEncode-pFxeatJt.js +0 -1
- package/web/assets/exportGlb-MK05aKqH.js +0 -2
- package/web/assets/faceTracker-_rQOgBvX.js +0 -1
- package/web/assets/fightDirector-Dt60kfbV.js +0 -1
- package/web/assets/fightDrama-py4jxSdn.js +0 -2
- package/web/assets/gpuExport-Cnv2NfEb.js +0 -189
- package/web/assets/handMatte-DZCsuqD2.js +0 -1
- package/web/assets/handTracker-Btr9L-Hu.js +0 -2
- package/web/assets/layer-worker-Rbo-YZv-.js +0 -5
- package/web/assets/library-CdukL2BW.js +0 -1
- package/web/assets/main-By_IEoB_.css +0 -1
- package/web/assets/maskTrack-AZwAVz1c.js +0 -1
- package/web/assets/matteFixRun-wTHGiGGf.js +0 -1
- package/web/assets/pendingMatte-iKz2-XBZ.js +0 -2
- package/web/assets/personAi-BEVyjCii.js +0 -2
- package/web/assets/plateCamera-D_J3-X06.js +0 -1
- package/web/assets/plateCameraMatch-C0peOvBn.js +0 -2
- package/web/assets/plateFollow-BbJMVxfg.js +0 -2
- package/web/assets/plateMatte-u5wKpsUN.js +0 -2
- package/web/assets/poseTracker--VJYw-hX.js +0 -1
- package/web/assets/productTools-DbhbyJxx.js +0 -2
- package/web/assets/rigTrack-CW9_kg5j.js +0 -1
- package/web/assets/rotoscope-_CYT-9ry.js +0 -1
- package/web/assets/shot-worker-BxIzQRZh.js +0 -1
- package/web/assets/spellDuel-eZvRwaxi.js +0 -2
- package/web/assets/surfacePin-CfLBhSrm.js +0 -2
- package/web/assets/timelineProps-KL6XCR4Q.js +0 -1
- package/web/assets/timelineText-DEK2BRyU.js +0 -1
- package/web/assets/titleFrames-WfiLHzjf.js +0 -1
- package/web/assets/tools-CBfIZX8_.js +0 -1
- package/web/assets/toonTools-D7jucq3t.js +0 -2
- package/web/assets/trackAnchor-DFqKIb8a.js +0 -1
- package/web/assets/userFonts-txN4I-eo.js +0 -1
- package/web/assets/vfxBackground-C1dHlJN6.js +0 -2
- package/web/assets/videoExport-DiNI9GY1.js +0 -1
- package/web/assets/views-sH39zgjD.js +0 -1
- package/web/assets/weaponDuel-CEvRDeuE.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rotoMaskStore-pxpRt5Cj.js","assets/titleFrameBudget-3MFHWIT6.js","assets/api-BsKbf3l3.js","assets/timeline3dExport-CmSI_pjv.js","assets/timeline3d-BEuZZOxM.js","assets/three.module-Bx43vjkH.js","assets/GLTFLoader-Dy6SrZg8.js","assets/RoomEnvironment-Dmv_G5ka.js","assets/frameSink-Dj71jCRb.js","assets/titleFrames-w-iWje9N.js","assets/titleArt-CcTdJuOC.js","assets/textAnimators-Cihw35O8.js","assets/lottieLayer-CfUPParC.js","assets/rigTrack-Bx9QHlFv.js","assets/rotoMatte-DyXlW4jK.js","assets/store-BSSbvpzr.js","assets/windowFrames-CoIyWqxr.js","assets/gpuExport-CPSw_dmq.js","assets/timelineComp-CRRzLazc.js","assets/gpuCompose-DIxBHlTa.js","assets/motionBlur-uAm030t9.js","assets/exportEncode-CaKEPgsy.js","assets/distortGL-BklPDXPq.js","assets/id3-BCR9Bqgo.js","assets/output-BwZzMbp-.js","assets/clientExport-NtJmxOYP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as p,b$ as F,iM as v}from"./titleFrameBudget-3MFHWIT6.js";import{FrameSink as $,SKIPPED_FRAME as P}from"./frameSink-Dj71jCRb.js";class x extends ${want;next=new Map;last=new Map;out={};constructor(i){super({put:async()=>{throw Error("a pick sink keeps its frames")}}),this.want=new Map;for(const[c,e]of Object.entries(i))for(const[s,r]of Object.entries(e||{}))this.want.set(`${c}
|
|
3
|
+
${s}`,new Set(r));this.wants=(c,e,s)=>{const r=this.want.get(`${c}
|
|
4
|
+
${e}`);return!!r&&(s===void 0||r.has(s))}}async push(i,c,e){const s=`${i}
|
|
5
|
+
${c}`,r=this.next.get(s)??0;if(this.next.set(s,r+1),e===P)return;const n=e==="="?this.last.get(s):e;n!==void 0&&(this.last.set(s,n),this.want.get(s)?.has(r)&&(((this.out[i]??={})[c]??={})[r]=n))}picked(){return this.out}}const y=(o,i)=>Object.keys(o[i]||{}).length>0,R={async frames({clips:o,format:i,camera:c=null,want:e}){const{unpackMasks:s}=await p(async()=>{const{unpackMasks:a}=await import("./rotoMaskStore-pxpRt5Cj.js").then(w=>w.X);return{unpackMasks:a}},__vite__mapDeps([0,1,2])),r=await s(o);o=r.clips;const n=new x(e),g={},d=F(i).fps,k=n.wants,f=async(a,w,u)=>{for(const h of w){n.wants=(l,E,t)=>l===a&&E===h&&k(l,E,t);try{await u()}catch(l){g[h]=String(l?.message||l).slice(0,200)}finally{n.wants=k}}},_=a=>Object.keys(e[a]||{});if(y(e,"modelFrames")){const{render3DFrames:a}=await p(async()=>{const{render3DFrames:w}=await import("./timeline3dExport-CmSI_pjv.js");return{render3DFrames:w}},__vite__mapDeps([3,1,4,5,6,2,7,8]));await f("modelFrames",_("modelFrames"),()=>a(o,i,n,void 0,c))}if(y(e,"titleFrames")){const{renderTitleFrames:a}=await p(async()=>{const{renderTitleFrames:u}=await import("./titleFrames-w-iWje9N.js");return{renderTitleFrames:u}},__vite__mapDeps([9,1,10,11,12,13,2,8])),w=[...o,...v(o)];await f("titleFrames",_("titleFrames"),()=>a(w,i,n,void 0,c))}if(y(e,"matteFrames")){const a=await p(()=>import("./rotoMatte-DyXlW4jK.js").then(u=>u.r),__vite__mapDeps([14,1,2,15])),w=[...o,...a.maskedCopies(o)];await f("matteFrames",_("matteFrames"),()=>a.renderMatteFrames(w,d,n))}if(y(e,"windowFrames")){const a=await p(()=>import("./windowFrames-CoIyWqxr.js"),__vite__mapDeps([16,1,14,2,15]));await f("windowFrames",_("windowFrames"),()=>a.renderWindowFrames(o,d,n))}return{frames:n.picked(),failed:g,missingMasks:r.missing}},async gpuExport({clips:o,format:i,tracks:c={},camera:e=null,encode:s=null,range:r,only:n,name:g="film.mp4"}){const d=await p(()=>import("./gpuExport-CPSw_dmq.js"),__vite__mapDeps([17,1,18,19,20,21,2,22,23,24]));if(!await d.gpuExportSupported(i,s))throw Object.assign(new Error("no hardware video encoder in this browser"),{name:"NoEncoder"});const{softwareRetry:k}=await p(async()=>{const{softwareRetry:t}=await import("./clientExport-NtJmxOYP.js");return{softwareRetry:t}},__vite__mapDeps([25,1,18])),f=t=>{try{window.__clipooxProgress?.(t)}catch{}};let _=!1;const a=`/__clipoox/out/${encodeURIComponent(g)}`,w=()=>new WritableStream({async write(t){const m=await fetch(`${a}?at=${t.position}`,{method:"PATCH",body:t.data});if(!m.ok)throw new Error(`the film could not be handed over (${m.status})`)}}),u=t=>d.exportOnGpu(o,{format:i,encode:s,tracks:c,camera:e,onProgress:f,software:t,liveMotion:!0,range:r,only:n,sink:w()}),h=t=>{const m=t instanceof Error?`${t.name}: ${t.message}`:String(t);return new Error(`${d.gpuExportStage()||"start"}${r?` (frames ${r.from}–${r.to})`:""}: ${m}`)},l=await u(!1).catch(t=>{if(!k(t,d.gpuExportStage(),s))throw h(t);return _=!0,u(!0).catch(m=>{throw h(m)})});let E="";try{const t=document.createElement("canvas").getContext("webgl2"),m=t?.getExtension("WEBGL_debug_renderer_info");E=String(m&&t?t.getParameter(m.UNMASKED_RENDERER_WEBGL):"").slice(0,120)}catch{}return{ms:l.ms,software:_,gpu:E}}};window.__layerWorker=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gv as f}from"./remote-sTZauTqM.js";import{i4 as v,hp as G,i5 as L,i6 as P}from"./remote-sTZauTqM.js";import{e as l}from"./skin-BkaT2QuX.js";import"./api-BsKbf3l3.js";import"./titleFrameBudget-3MFHWIT6.js";import"./three.module-Bx43vjkH.js";import"./GLTFLoader-Dy6SrZg8.js";import"./store-BSSbvpzr.js";import"./rotoMaskStore-pxpRt5Cj.js";import"./textAnimators-Cihw35O8.js";import"./timelineComp-CRRzLazc.js";import"./rigTrack-Bx9QHlFv.js";async function S(o,s,a,m=2e4){let e;for(const t=Date.now()+m;!e&&Date.now()<t;){const i=o.getStage().items.find(r=>r.id===s);if(!i||i.rig!==a)return!1;e=o.engine()?.objects?.children.find(r=>r.userData.id===s)?.children[0],e||await new Promise(r=>setTimeout(r,150))}if(!e)return!1;const p=f(a,{positions:l(e).positions});let n=!1;return o.setStage(t=>({...t,items:t.items.map(i=>i.id===s&&i.rig===a?(n=!0,{...i,rig:p}):i)})),n}export{S as fitLibraryFingers,v as libraryModelFields,G as libraryModelItem,L as libraryRig,P as wantsFingers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{hH as Dt,lS as Bt,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CZn97Ygs.js","assets/api-BsKbf3l3.js","assets/titleFrameBudget-3MFHWIT6.js","assets/opentype.module-DcKU8U04.js","assets/GLTFLoader-Dy6SrZg8.js","assets/three.module-Bx43vjkH.js","assets/lottie_light_canvas-7iv3btPX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{hH as Dt,lS as Bt,js as Nt,lT as pn,lU as Ft,lV as dn,lW as mn,N as gn,lX as yn,lY as wn,lZ as bn,_ as U,l_ as Mn,hG as _n,l$ as kn,m0 as Sn,m1 as An,m2 as ft,m3 as En,f_ as tt,gz as Tn,g0 as nt,gA as xn,fA as V,gt as ct,gB as vn,cB as Ce,m4 as On,go as rt,m5 as Ln,gp as Gt,gC as Pn,m6 as $n,m7 as Rn,m8 as Cn,m9 as In,ma as jn,mb as Dn,mc as Bn,md as Ht,me as Nn,mf as Fn,mg as Gn,br as Hn,bB as zn,mh as Wn,mi as fe,mj as qn,mk as Un,ml as Kn,mm as Vn,mn as Jn,mo as ce,mp as Ie,mq as ht,mr as Yn,ms as Xn,bx as Zn,mt as Qn,mu as ut,mv as er,mw as tr,gr as nr,cK as rr,fn as sr,gq as zt,c0 as or,g$ as ar,eb as oe,iq as ir,eQ as lr,fl as fr,b_ as we,ec as je,ed as pt,mx as cr,my as W,hF as hr,kS as ur}from"./titleFrameBudget-3MFHWIT6.js";import{W as pr,X as dr,r as mr}from"./rigTrack-Bx9QHlFv.js";import{t as le,bU as gr,az as yr,s as wr}from"./api-BsKbf3l3.js";function De(e){if(typeof e!="string")return null;const t=(o,a=!1)=>o.split(",").map(i=>i.trim()).filter(Boolean).map(i=>{const[l,f]=i.split(/\s+as\s+/);return a?f?`${f}:${l}`:l:f?`${l}:${f}`:l}).join(",");let n=e.replace(/^import\s*\{([^}]*)\}\s*from\s*['"]three['"];?/m,(o,a)=>`const {${t(a)}}=THREE;`);if(n=n.replace(/^import\s*\{([^}]*)\}\s*from\s*['"]\.\.\/utils\/([A-Za-z]+)\.js['"];?/mg,(o,a,i)=>`const {${t(a)}}=__deps.${i};`),/^\s*import\s/m.test(n))return null;const r=/^export\s*\{([^}]*)\};?[ \t]*$/m,s=r.exec(n);return!s||(n=n.replace(r,`return {${t(s[1],!0)}};`),/^export\s/m.test(n))?null:'"use strict";'+n}const Wt=`async(THREE,items,LOADERS,flip)=>{
|
|
3
3
|
const out=new Map()
|
|
4
4
|
const bmp=(data)=>createImageBitmap(new Blob([data]),flip?{imageOrientation:'flipY',premultiplyAlpha:'none'}:{})
|
|
5
5
|
for(const it of items){
|
|
@@ -151,8 +151,8 @@ onmessage=e=>{if(e.source!==parent)return;const m=e.data
|
|
|
151
151
|
const timer=setTimeout(()=>kill(m.layer,'Motion code took longer than '+ms/1000+'s for one frame (endless loop?)'),ms)
|
|
152
152
|
inflight.set(m.req,{layer:m.layer,timer});x.w.postMessage(m)}
|
|
153
153
|
parent.postMessage({type:'boot'},'*')
|
|
154
|
-
<\/script>`;let G=null,ee=null,Br=0;const Ae=new Map,Ee=new Map;function Nr(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)+":"+e.length}let te=null;function Fr(){return te||(te=Promise.all(wn.map(async t=>{const n=await fetch(bn+t.file);if(!n.ok)throw Error(t.file);return{family:t.family,weight:t.weight,style:t.style,data:await n.arrayBuffer()}})).catch(()=>(te=null,[])),te)}let Ne=null,be=null;function Gr(){return Ne??=Promise.all([U(()=>import("./three-D7Ssject.js"),[]),U(()=>import("./RoomEnvironment-grxZ6k9f.js"),[])]).then(([e,t])=>({src:e.default,room:Mn(t.default)})).catch(e=>{throw Ne=null,e}),Ne}function Hr(){return be??=Gr().then(e=>{G?.contentWindow?.postMessage({type:"three",src:e.src,room:e.room},"*")}).catch(e=>{throw be=null,e}),be}let Fe=null,Me=null;function zr(){return Fe??=Promise.all([U(()=>import("./opentype-D4-4HGq7.js"),[]),...Object.entries(kn).map(async([e,t])=>{const n=await fetch(t);if(!n.ok)throw Error(`Font ${n.status}`);return{key:e,data:await n.arrayBuffer()}})]).then(([e,...t])=>({src:e.default,fonts:t})).catch(e=>{throw Fe=null,e}),Fe}function Wr(){return Me??=zr().then(e=>{G?.contentWindow?.postMessage({type:"glyphs",src:e.src,fonts:e.fonts.map(t=>({key:t.key,data:t.data.slice(0)}))},"*")}).catch(e=>{throw Me=null,e}),Me}const Ge=new Map;let _e=new Map;function qr(e){return Promise.all(e.map(t=>{let n=_e.get(t);if(!n){let r=Ge.get(t);r||(r=fetch(dr(t)).then(s=>s.ok?s.arrayBuffer():null).catch(()=>null),Ge.set(t,r)),n=r.then(s=>{if(!s){Ge.delete(t),_e.delete(t);return}G?.contentWindow?.postMessage({type:"stickers",items:[{id:t,data:s.slice(0)}]},"*")}),_e.set(t,n)}return n}))}let He=null,ke=null;function Ur(){return He??=Promise.all([U(()=>import("./GLTFLoader-DYtnVu-I.js"),[]),U(()=>import("./BufferGeometryUtils-_ZXHoOh1.js"),[]),U(()=>import("./SkeletonUtils-CfWUgbiL.js"),[])]).then(([e,t,n])=>{const r=De(e.default),s=De(t.default),o=De(n.default);if(!r||!s||!o)throw Error("GLTFLoader shape changed");return{gltf:r,bgu:s,skel:o}}).catch(e=>{throw He=null,e}),He}function Kr(){return ke??=Ur().then(e=>{G?.contentWindow?.postMessage({type:"gltf",...e},"*")}).catch(e=>{throw ke=null,e}),ke}const Te=new Map,J=new Map;function go(e,t){const n=t.slice().buffer;Te.set(e,n),J.delete(`local:${e}`)}function yo(e){for(const t of[...Te.keys()])t.startsWith(e)&&(Te.delete(t),J.delete(`local:${t}`))}let ne=null;function Vr(e){if(!ne){const t={uris:new Set,run:Promise.resolve({})};t.run=new Promise(n=>setTimeout(n,0)).then(()=>(ne=null,gr([...t.uris]))),ne=t}return ne.uris.add(e),ne.run.then(t=>{const n=t[e];if(!n)throw Error(le("Không tải được tài nguyên của lớp plug-in ({0}).",[e.split("/").pop()||"?"]));return n})}function Jr(e){let t=J.get(e);return t||(t=e.startsWith("local:")?Promise.resolve().then(()=>{const n=Te.get(e.slice(6));if(!n)throw Error("local asset missing");return n}):Vr(e).then(n=>fetch(n)).then(n=>{if(!n.ok)throw Error(le("Không tải được tài nguyên của lớp plug-in ({0}).",[e.split("/").pop()||"?"]));return n.arrayBuffer()}),J.set(e,t),t.catch(()=>J.delete(e)),J.size>64&&J.delete(J.keys().next().value)),t}async function Yr(e,t){const n=_r(t),r=await Jr(n.uri),s=new Uint8Array(r),o={...n.grid?{grid:n.grid}:{},...n.fps?{fps:n.fps}:{}};if(s[0]===103&&s[1]===108&&s[2]===84&&s[3]===70)return{name:e,kind:"model",data:r.slice(0)};if(s[0]===67&&s[1]===88&&s[2]===83&&s[3]===81)return{name:e,kind:"sequence",frames:$r(s).map(a=>a.slice().buffer),...o};if(/\.cube$/i.test(e)||/\.cube$/i.test(n.uri)){const a=_n(Dt(new TextDecoder().decode(s)));return{name:e,kind:"lut",size:a.size,data:a.data.buffer.slice(0)}}return{name:e,kind:"image",data:r.slice(0),...o}}const xe=new Map;async function Xr(e,t,n){const r=t.assets;if(!r||!Object.keys(r).length)return;const s=JSON.stringify(r);if(xe.get(e)===s)return;n&&await Kr().catch(()=>{throw Error(le("Không tải được bộ đọc mô hình 3D — kiểm tra mạng rồi thử lại."))});const a=(await Promise.all(Object.entries(r).map(([i,l])=>Yr(i,l)))).map(i=>i.kind==="lut"?{...i,data:new Float32Array(i.data)}:i);G?.contentWindow?.postMessage({type:"assets",layer:e,items:a},"*"),xe.set(e,s)}function Zr(){if(ee&&G?.isConnected)return ee;G?.remove(),Ee.clear(),ae.clear(),_e=new Map,be=null,Me=null,ke=null,xe.clear();const e=document.createElement("iframe");return G=e,e.setAttribute("sandbox","allow-scripts"),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.title="motion-sandbox",e.style.cssText="position:fixed;width:1px;height:1px;left:-10px;top:-10px;border:0;opacity:0;pointer-events:none",e.srcdoc=Dr,ee=new Promise((t,n)=>{const r=window.setTimeout(()=>{window.removeEventListener("message",s),G===e&&(G.remove(),G=null,ee=null),n(Error("Motion sandbox did not start"))},8e3),s=o=>{o.source===e.contentWindow&&o.data?.type==="boot"&&(window.clearTimeout(r),window.removeEventListener("message",s),Fr().then(a=>{e.contentWindow?.postMessage({type:"fonts",fonts:a},"*"),t()}))};window.addEventListener("message",s)}),document.body.appendChild(e),ee}window.addEventListener("message",e=>{if(!G||e.source!==G.contentWindow||e.data?.type!=="frame")return;const t=Ae.get(e.data.req);t&&(Ae.delete(e.data.req),window.clearTimeout(t.timer),e.data.bmp?t.resolve(e.data.bmp):t.reject(Error(e.data.error===Yt?le("Trình duyệt không chạy được WebGL nên không vẽ được lớp Motion 3D. Hãy bật tăng tốc phần cứng hoặc dùng Chrome / Edge bản mới."):String(e.data.error||"Motion frame failed"))))});const ae=new Map,ve=new Map,Qr=1500;let Oe=Promise.resolve(),wt=Promise.resolve(),Xe=0,Ze=-1/0;async function es(){for(;;){const e=Oe;if(await e,e!==Oe)continue;const t=Ze+Qr-performance.now();if(!Xe&&t<=0)return;await new Promise(n=>window.setTimeout(n,Math.max(100,t)))}}async function wo(e){await Zr();const t=gn(e.motion.code),n=e.motion.kind==="three",r=Nr(e.motion.assets?t+"\0"+JSON.stringify(e.motion.assets):t);n&&await Hr(),await Xr(e.layer,e.motion,n),n&&yn(t)&&await Wr().catch(()=>{throw Error(le("Không tải được phông chữ cho chữ 3D nổi — kiểm tra mạng rồi thử lại."))});const s=n?[]:pr(t,e.motion.params||{});if(s.length&&await qr(s),!n)return Qe(e,t,r);if(!e.background){Xe++,Ze=performance.now();try{return await bt(e,t,r)}finally{Xe--,Ze=performance.now()}}return bt(e,t,r)}function bt(e,t,n){const r=n+"|"+JSON.stringify(e.motion.params||{})+"|"+e.width+"x"+e.height;if(ae.get(e.layer)===r)return Qe(e,t,n);const s=ve.get(e.layer)??0,o=G,a=()=>{if((ve.get(e.layer)??0)!==s||G!==o)throw Error("dropped");return Qe(e,t,n).then(l=>(G===o&&ae.set(e.layer,r),l),l=>{throw ae.delete(e.layer),l})};if(e.background){const l=wt.then(es).then(a);return wt=l.catch(()=>{}),l}const i=Oe.then(a);return Oe=i.catch(()=>{}),i}function Qe(e,t,n){const r=e.motion.kind==="three",s=++Br,o=Ee.get(e.layer)!==n;return Ee.set(e.layer,n),new Promise((a,i)=>{const l=window.setTimeout(()=>{Ae.delete(s),i(Error("Motion frame timed out"))},(r?Jt:o?Cr:Vt)+2e3);Ae.set(s,{resolve:a,reject:i,timer:l}),G.contentWindow.postMessage({type:"frame",req:s,layer:e.layer,key:n,code:t,params:e.motion.params||{},t:e.t,width:e.width,height:e.height,duration:e.duration,fps:e.fps??30,...r?{kind:"three",surface:e.surface??null}:{space:e.space??null}},"*")})}function bo(e){ve.set(e,(ve.get(e)??0)+1),ae.delete(e),xe.delete(e),G?.contentWindow&&Ee.delete(e)&&G.contentWindow.postMessage({type:"drop",layer:e},"*")}function z(e,t){let n=Math.imul(e^2654435769,2246822507)^Math.imul(t+1,3266489909);return n^=n>>>13,n=Math.imul(n,668265263),n^=n>>>16,(n>>>0)/4294967296}const Xt=(e,t)=>{const n=Math.floor(e),r=e-n,s=r*r*(3-2*r);return(z(n,t)*(1-s)+z(n+1,t)*s)*2-1},Zt=e=>{let t=7;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t>>>0},he=new Map;function Qt(e,t,n,r){const s=`${e}|${t.toFixed(2)}|${n%7}|${r}`;let o=he.get(s);if(o)return o;he.size>64&&he.clear();const a=128,i=n%7;o=Object.assign(document.createElement("canvas"),{width:a,height:a});const l=o.getContext("2d"),f=l.createImageData(a,a),[h,c,u]=[1,3,5].map(d=>parseInt(e.slice(d,d+2),16)),p=new Float32Array(a*a);for(let d=0;d<a*a;d++)p[d]=z(d,i+9);const k=(d,S)=>p[(S+a)%a*a+(d+a)%a],E=r?1-t*.35:t*.4;for(let d=0;d<a;d++)for(let S=0;S<a;S++){let w=0;for(let M=-1;M<=1;M++)for(let y=-1;y<=1;y++)w+=k(S+y,d+M);const g=Math.min(1,Math.max(0,((w/9-.5)*2.4+.5)*.6+.4*k(S,d))),_=(d*a+S)*4;f.data[_]=h,f.data[_+1]=c,f.data[_+2]=u,f.data[_+3]=g>E?r?Math.round(160+95*(g-E)/(1-E+1e-6)):255:0}return l.putImageData(f,0,0),he.set(s,o),o}function ts(e,t,n,r=0){return e.createPattern(Qt(t,Math.max(0,Math.min(1,n)),r,!1),"repeat")??t}function ue(e,t,n,r=0){return e.createPattern(Qt(t,Math.max(0,Math.min(1,n)),r,!0),"repeat")??t}function en(e,t,n,r,s,o){const a=r.amount??.5,i=r.scale??1,l=r.color??An(s,null),[f,h,c,u]=n,p=(f+c)/2,k=(h+u)/2,E=Math.hypot(c-f,u-h)/2+4,d=(r.angle??0)*Math.PI/180;e.save(),r.type==="riso"&&(e.save(),e.globalAlpha*=.42*a,e.globalCompositeOperation="multiply",e.translate(4*i,-3*i),e.fillStyle=l,e.fill(t),e.restore()),e.clip(t);const S=(w,g,_,M)=>{e.save(),e.globalAlpha*=M,e.strokeStyle=l,e.lineWidth=_,e.lineCap="butt",e.translate(p,k),e.rotate(w),e.beginPath();for(let y=-E;y<=E;y+=g){const A=Xt(y/g,o+5)*g*.12;e.moveTo(-E,y+A),e.lineTo(E,y-A)}e.stroke(),e.restore()};switch(r.type){case"hatch":S(d,13*i,1.4+a*2.6,.35+a*.55);break;case"crosshatch":S(d,12*i,1.2+a*2,.3+a*.5),S(d+Math.PI/2,12*i,1.2+a*2,.25+a*.45);break;case"halftone":case"riso":{const w=(r.type==="riso"?9:12)*i;e.save(),e.fillStyle=l,e.globalAlpha*=r.type==="riso"?.5:.85,e.translate(p,k),e.rotate(d),e.beginPath();for(let g=-E;g<=E;g+=w)for(let _=-E;_<=E;_+=w){const M=.25+.75*Math.max(0,Math.min(1,(_+g)/(2*E)+.5)),y=w*.5*Math.sqrt(a*M);y>.3&&(e.moveTo(_+y,g),e.arc(_,g,y,0,Math.PI*2))}e.fill(),e.restore(),r.type==="riso"&&(e.globalAlpha*=.5,e.fillStyle=ue(e,"#ffffff",.3+a*.4,o),e.fillRect(f-4,h-4,c-f+8,u-h+8));break}case"grain":e.globalAlpha*=.3+a*.3,e.fillStyle=ue(e,l,.2+a*.5,o),e.fillRect(f-4,h-4,c-f+8,u-h+8);break;case"stipple":{const w=10*i,g=Math.min(4e3,Math.round((c-f)*(u-h)/(w*w)*a*1.6));e.fillStyle=l,e.globalAlpha*=.8,e.beginPath();for(let _=0;_<g;_++){const M=f+z(_,o+1)*(c-f),y=h+z(_,o+2)*(u-h),A=.9+z(_,o+3)*1.4*i;e.moveTo(M+A,y),e.arc(M,y,A,0,Math.PI*2)}e.fill();break}case"wash":{for(let w=0;w<3;w++){const g=f+(c-f)*(.2+.6*z(w,o+4)),_=h+(u-h)*(.2+.6*z(w,o+6)),M=Math.max(8,Math.min(c-f,u-h)*(.35+.3*z(w,o+8))),y=e.createRadialGradient(g,_,0,g,_,M);y.addColorStop(0,l),y.addColorStop(1,l+"00"),e.save(),e.globalAlpha*=.22*a,e.fillStyle=y,e.fillRect(g-M,_-M,M*2,M*2),e.restore()}e.save(),e.globalAlpha*=.5*a,e.strokeStyle=l,e.lineWidth=7*i,e.lineJoin="round",e.stroke(t),e.restore(),e.globalAlpha*=.25,e.fillStyle=ue(e,l,.3,o),e.fillRect(f-4,h-4,c-f+8,u-h+8);break}case"paper":{e.save(),e.globalAlpha*=.2+a*.2,e.fillStyle=ue(e,l,.2+a*.4,o),e.fillRect(f-4,h-4,c-f+8,u-h+8),e.restore();const w=Math.min(900,Math.round((c-f)*(u-h)/4e3*a*i));e.strokeStyle=l,e.lineWidth=.7,e.globalAlpha*=.18,e.beginPath();for(let g=0;g<w;g++){const _=f+z(g,o+11)*(c-f),M=h+z(g,o+12)*(u-h),y=z(g,o+13)*Math.PI*2,A=6+z(g,o+14)*14;e.moveTo(_,M),e.quadraticCurveTo(_+Math.cos(y+.6)*A*.6,M+Math.sin(y+.6)*A*.6,_+Math.cos(y)*A,M+Math.sin(y)*A)}e.stroke();break}case"grid":{const w=40*i;e.strokeStyle=l,e.beginPath();const g=Math.floor(f/w)*w,_=Math.floor(h/w)*w;for(let M=g;M<=c;M+=w)e.moveTo(M,h),e.lineTo(M,u);for(let M=_;M<=u;M+=w)e.moveTo(f,M),e.lineTo(c,M);e.lineWidth=1.2,e.globalAlpha*=.35*a+.1,e.stroke(),e.beginPath();for(let M=Math.floor(f/(w*5))*w*5;M<=c;M+=w*5)e.moveTo(M,h),e.lineTo(M,u);for(let M=Math.floor(h/(w*5))*w*5;M<=u;M+=w*5)e.moveTo(f,M),e.lineTo(c,M);e.lineWidth=2.4,e.stroke();break}}e.restore()}const tn=(e,t,n,r)=>t*Xt(e/38,r+n*977);function ns(e,t,n,r){const s=Math.floor(n*t.fps+1e-6),o=Zt(r)+(t.seed??0)*131|0;return e.map((a,i)=>{const l=Sn(a.pts,a.closed,10);if(l.length<2)return a;const f=[];let h=0;const c=a.closed&&l.length>2?l.length-1:l.length;for(let u=0;u<c;u++){u&&(h+=Math.hypot(l[u][0]-l[u-1][0],l[u][1]-l[u-1][1]));const p=l[Math.max(0,u-1)],k=l[Math.min(l.length-1,u+1)],E=k[0]-p[0],d=k[1]-p[1],S=Math.hypot(E,d)||1,w=tn(h,t.amount,s,o+i*17);f.push([l[u][0]-d/S*w,l[u][1]+E/S*w])}return{pts:f,closed:a.closed}})}const pe=new Map;function nn(e,t,n,r){const s=Math.floor(n*t.fps+1e-6),o=`${s}|${r}|${t.amount}|${e}`;let a=pe.get(o);if(a)return a;pe.size>600&&pe.clear();const i=as(e);if(a=new Path2D,!i.L)return a.addPath(new Path2D(e)),a;const l=new Set;let f=0;const h=c=>{if(!(c-f+1<2)){for(let p=f;p<=c;p++){const k=Math.max(f,p-1),E=Math.min(c,p+1),d=i.xs[E]-i.xs[k],S=i.ys[E]-i.ys[k],w=Math.hypot(d,S)||1,g=tn(i.ss[p],t.amount,s,r),_=i.xs[p]-S/w*g,M=i.ys[p]+d/w*g;p===f?a.moveTo(_,M):a.lineTo(_,M)}Math.hypot(i.xs[c]-i.xs[f],i.ys[c]-i.ys[f])<i.step*2&&(a.closePath(),l.add(f))}};for(let c=1;c<i.ss.length;c++)Math.hypot(i.xs[c]-i.xs[c-1],i.ys[c]-i.ys[c-1])>i.step*3&&(h(c-1),f=c);return h(i.ss.length-1),pe.set(o,a),a}const de=new Map,rs=e=>{let t=de.get(e);return t||(de.size>2e3&&de.clear(),t=new Path2D(e),de.set(e,t)),t},Mt=e=>{const t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)};function ss(e,t,n,r,s,o){const a=t.params,i={...a,parts:a.rig?mr(t,r):a.parts??[]},l=t.stroke,f=t.fill,h=f.type!=="none",c=M=>!!l&&l.width>0&&M.line!==!1&&(M.fill===null||i.outline!==!1),u=Math.max(0,Math.min(1,n.end)-Math.max(0,n.start)),p=u>=1&&!n.offset,k=i.parts.map(M=>p?1:Math.max(1,Le(M.d))),E=i.parts.map((M,y)=>c(M)?k[y]:p?1:Math.max(40,k[y]*.35)),d=E.reduce((M,y)=>M+y,0)||1,S=Math.max(0,n.start)*d,w=S+u*d,g=Zt(t.id)+(o?.seed??0)*131;let _=0;i.parts.forEach((M,y)=>{const A=E[y],P=_;_=_+A;const T=p?1:Math.max(0,Math.min(1,(w-P)/A))-Math.max(0,Math.min(1,(S-P)/A));if(T<=0)return;const R=o?nn(M.d,o,r,g+y*29):rs(M.d),C=v=>{if(!c(M)||!l)return;e.globalAlpha=s*t.opacity*(l.opacity??1)*(M.o??1);const m=Le(M.d),b=p?m:m*T,O=l.width*(M.lw??1)*(v?2:1);if(l.hand){const $={...l.hand,...o?{boil:Math.max(l.hand.boil??0,o.fps)}:{}};ot(e,M.d,{color:l.color,width:O,from:p?0:Math.max(0,(S-P)/A)*m,len:b,hand:$,time:r})}else e.strokeStyle=l.color,e.lineWidth=O,e.lineCap=l.cap??"round",e.lineJoin=l.join??"round",p||!m?e.setLineDash([]):(e.setLineDash([b,m*2]),e.lineDashOffset=-Math.max(0,(S-P)/A)*m),e.stroke(R),e.setLineDash([])},I=h&&!!M.fill;if(I&&C(!0),I){if(e.globalAlpha=s*t.opacity*(f.opacity??1)*(M.o??1)*(p?1:c(M)?Mt((T-.6)/.4):Mt(T)),e.globalAlpha>0){e.fillStyle=M.fill,M.eo?e.fill(R,"evenodd"):e.fill(R);const v=f.texture;v&&(e.save(),M.eo&&e.clip(R,"evenodd"),en(e,R,os(M.d),v,M.fill,g+y),e.restore())}}else C(!1)})}const me=new Map;function os(e){let t=me.get(e);if(t)return t;const n=e.match(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi)?.map(Number)??[];let r=1/0,s=1/0,o=-1/0,a=-1/0;for(let i=0;i+1<n.length;i+=2)r=Math.min(r,n[i]),o=Math.max(o,n[i]),s=Math.min(s,n[i+1]),a=Math.max(a,n[i+1]);return t=Number.isFinite(r)?[r,s,o,a]:[-50,-50,50,50],me.size>2e3&&me.clear(),me.set(e,t),t}const re=new Map;function st(e){let t=re.get(e);if(t)return t;re.size>400&&re.clear();const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",e);let r=0;try{r=n.getTotalLength()}catch{r=0}if(!Number.isFinite(r)||r<=0)return t={xs:new Float32Array(0),ys:new Float32Array(0),ss:new Float32Array(0),L:0,step:1},re.set(e,t),t;const s=Math.max(1.5,r/900),o=Math.ceil(r/s)+1,a=new Float32Array(o),i=new Float32Array(o),l=new Float32Array(o);for(let f=0;f<o;f++){const h=Math.min(r,f*s),c=n.getPointAtLength(h);a[f]=c.x,i[f]=c.y,l[f]=h}return t={xs:a,ys:i,ss:l,L:r,step:s},re.set(e,t),t}const Le=e=>st(e).L,as=e=>st(e);function _t(e,t){let n=Math.imul(e^2654435769,2246822507)^Math.imul(t+1,3266489909);return n^=n>>>13,n=Math.imul(n,668265263),n^=n>>>16,(n>>>0)/4294967296*2-1}function kt(e,t){const n=Math.floor(e),r=e-n,s=r*r*(3-2*r);return _t(n,t)*(1-s)+_t(n+1,t)*s}const St=e=>{const t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)};function At(e,t,n,r,s,o,a,i,l,f=0){if(r-n+1<2)return;const c=t.ss[r]-t.ss[n],u=[],p=[],k=Math.max(.001,Math.min(c*.15,s*3)),E=Math.max(.001,Math.min(c*.22,s*4));for(let d=n;d<=r;d++){const S=Math.max(n,d-1),w=Math.min(r,d+1),g=t.xs[w]-t.xs[S],_=t.ys[w]-t.ys[S],M=Math.hypot(g,_)||1,y=-_/M,A=g/M,P=t.ss[d],L=P-t.ss[n],T=kt(P/(s*3+24),a)*o.wobble*s,R=1+o.press*kt(P/(s*6+48),a+7),C=o.tip+(1-o.tip)*Math.min(St(L/k),St((c-L)/E)),I=Math.max(.15,s/2*R*C),v=t.xs[d]+y*T,m=t.ys[d]+A*T;u.push(v+y*I,m+A*I),p.push(v-y*I,m-A*I)}e.beginPath(),e.moveTo(u[0],u[1]);for(let d=2;d<u.length;d+=2)e.lineTo(u[d],u[d+1]);for(let d=p.length-2;d>=0;d-=2)e.lineTo(p[d],p[d+1]);if(e.closePath(),e.fill(),f>0){const d=e.globalAlpha;e.globalAlpha=d*f,e.lineWidth=Math.max(.4,s*.07),e.lineJoin="round",e.strokeStyle=e.fillStyle,e.stroke(),e.globalAlpha=d}}function ot(e,t,n){const r=st(t);if(!r.L||n.len<=0)return;let s=ft[n.hand.style]??En[n.hand.style]??ft.marker;(n.hand.taper!==void 0||n.hand.press!==void 0)&&(s={...s,...n.hand.taper!==void 0?{tip:Math.max(.02,1-n.hand.taper)}:{},...n.hand.press!==void 0?{press:n.hand.press*.6}:{}});const o=Math.max(.5,n.width*s.width),a=n.hand.boil?Math.floor(n.time*n.hand.boil+1e-6):0,i=(n.hand.seed??0)*131+a*977|0,l=r.L,f=Math.max(0,Math.min(l,n.from)),h=Math.min(l,n.len),c=f+h<=l+1e-6?[[f,Math.min(l,f+h)]]:[[f,l],[0,f+h-l]],u=e.globalAlpha;e.save(),e.fillStyle=s.grain?ts(e,n.color,s.grain,n.hand.seed??0):n.color;const p=s.wet?[[1,s.alpha*.5,i],[.9,s.alpha*.4,i+11],[1.08,s.alpha*.3,i+23]]:[[1,s.alpha,i]];s.retrace&&p.push([.45,s.alpha*.35,i+3]);for(const[k,E,d]of p){e.globalAlpha=u*E;for(const[S,w]of c){let g=-1;for(let _=0;_<r.ss.length;_++){const M=r.ss[_]>=S-1e-6&&r.ss[_]<=w+1e-6,y=g>=0&&_>g&&Math.hypot(r.xs[_]-r.xs[_-1],r.ys[_]-r.ys[_-1])>r.step*3;g>=0&&(!M||y)&&(At(e,r,g,_-1,o*k,s,d,!0,!0,s.wet?.5:0),g=-1),M&&g<0&&(g=_)}g>=0&&At(e,r,g,r.ss.length-1,o*k,s,d,!0,!0,s.wet?.5:0)}}e.restore()}const Mo=e=>"paths"in e?e.trim?.offset??0:0,rn=1280,Se=720,_o=e=>e&&"size"in e&&e.size?{W:e.size[0],H:e.size[1]}:e?.square?{W:Se,H:Se}:{W:rn,H:Se},Et=new Map;function sn(e){let t=Et.get(e);if(t===void 0){const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",e);try{t=n.getTotalLength()}catch{t=0}Et.set(e,t=Number.isFinite(t)?t:0)}return t}function ko(e,t,n,r=rn,s=Se,o=0){const a=Math.min(r,s)/V,i=(r-V*a)/2,l=(s-V*a)/2;if(tt(t)){const c=t.step&&t.step>1?Tn(o,t.step):o,u=t.boil&&t.boil.amount>0?t.boil:null,p=t.items.map(E=>nt(E,c)),k=xn(t.items,p);e.save(),e.translate(i,l),e.scale(a,a),t.items.forEach((E,d)=>{if(E.hidden||E.span&&(o<E.span[0]-1e-6||o>=E.span[1]-1e-6))return;const S=k.get(E.id);S?(e.save(),e.transform(...S),Tt(e,p[d],n,c,a,u),e.restore()):Tt(e,p[d],n,c,a,u)}),e.restore();return}const f=Math.max(0,Math.min(1,n.end)-Math.max(0,n.start)),h=n.offset??0;e.save(),e.translate(i,l),e.scale(a,a);for(const c of t.paths){const u=new Path2D(c.d),p=c.opacity??1;if(e.filter=c.blur?`blur(${(c.blur*a).toFixed(2)}px)`:"none",c.fill&&f>0&&(e.globalAlpha=Math.min(1,f)*p,e.fillStyle=c.fill,c.rule?e.fill(u,c.rule):e.fill(u),e.globalAlpha=1),!c.stroke||f<=0)continue;if(e.globalAlpha=p,c.hand){const w=Le(c.d);ot(e,c.d,{color:c.stroke,width:c.strokeWidth??18,from:((n.start+h)%1+1)%1*w,len:f*w,hand:c.hand,time:o}),e.globalAlpha=1;continue}if(e.strokeStyle=c.stroke,e.lineWidth=c.strokeWidth??18,e.lineCap=c.cap??"round",e.lineJoin="round",f>=1&&h===0){e.setLineDash([]),e.stroke(u),e.globalAlpha=1;continue}const k=sn(c.d);if(!k)continue;const E=((n.start+h)%1+1)%1*k,d=f*k,S=Math.min(d,k-E);e.setLineDash([S,k*2]),e.lineDashOffset=-E,e.stroke(u),d>S&&(e.setLineDash([d-S,k*2]),e.lineDashOffset=0,e.stroke(u))}e.setLineDash([]),e.globalAlpha=1,e.filter="none",e.restore()}const is={add:"source-over",subtract:"destination-out",intersect:"destination-in",exclude:"xor"};function Tt(e,t,n,r,s=1,o=null){const a=o&&!t.params.d&&t.type!=="art"?ns(ct(t,r),o,r,t.id):ct(t,r),i=t.fill,l=t.stroke,f=vn(t.ops,n),h=t.params.d?o?nn(t.params.d,o,r,t.id.length*131+t.id.charCodeAt(t.id.length-1)):new Path2D(t.params.d):new Path2D(a.map(E=>Ce(E.pts,E.closed)).join(" ")),c=Math.max(0,Math.min(1,f.end)-Math.max(0,f.start)),u=f.offset??0,p=!(c>=1&&u===0),k=On(t.ops);e.save(),k&&(e.globalCompositeOperation=is[k]),e.transform(...rt(t));for(const E of Ln(t.ops)){if(e.save(),e.transform(...E.m),t.type==="art"){c>0&&ss(e,t,f,r,E.alpha,o),e.setLineDash([]),e.filter="none",e.restore();continue}if(i.type!=="none"&&c>0&&t.type!=="line"&&(e.globalAlpha=t.opacity*(i.opacity??1)*Math.min(1,c)*E.alpha,e.fillStyle=ls(e,t,r),e.fill(h),i.texture&&en(e,h,Gt(t,r),i.texture,i.color??i.stops?.[0]?.[0]??"#c6f432",t.id.length*97+t.id.charCodeAt(0))),l&&l.width>0&&c>0)if(e.globalAlpha=t.opacity*(l.opacity??1)*E.alpha,e.strokeStyle=l.color,e.lineWidth=l.width,e.lineCap=l.cap??"round",e.lineJoin=l.join??"round",e.miterLimit=10,l.blur&&(e.filter=`blur(${(l.blur*s*Math.abs(t.scale[0]||1)).toFixed(2)}px)`),l.hand){const d=o?{...l.hand,boil:Math.max(l.hand.boil??0,o.fps)}:l.hand;for(const S of t.params.d?[t.params.d]:a.map(w=>Ce(w.pts,w.closed))){const w=Le(S);ot(e,S,{color:l.color,width:l.width,from:((f.start+u)%1+1)%1*w,len:c*w,hand:d,time:r})}}else if(!p)l.dash&&l.dash[0]+l.dash[1]>0?(e.setLineDash(l.dash),e.lineDashOffset=-(l.dashOffset??0)):e.setLineDash([]),e.stroke(h);else if(t.params.d&&t.params.box){const d=sn(t.params.d);if(d){const S=((f.start+u)%1+1)%1*d,w=c*d,g=Math.min(w,d-S);e.setLineDash([g,d*2]),e.lineDashOffset=-S,e.stroke(h),w>g&&(e.setLineDash([w-g,d*2]),e.lineDashOffset=0,e.stroke(h))}}else for(const d of t.params.d?[]:a){const S=Pn(d.pts,d.closed);if(!S)continue;const w=new Path2D(Ce(d.pts,d.closed)),g=((f.start+u)%1+1)%1*S,_=c*S,M=Math.min(_,S-g),y=A=>{const P=l.dash;if(!P||P[0]+P[1]<=0)return[A,S*2];const L=P[0]+P[1],T=[];let R=0;for(let C=((l.dashOffset??0)%L+L)%L-L;C<A&&T.length<4e3;C+=L){const I=Math.max(0,C),v=Math.min(A,C+P[0]);v<=I||(T.length?T.push(I-R,v-I):(I>0&&T.push(0,I),T.push(v-I)),R=v)}return T.length?[...T,S*2]:[0,S*2]};e.setLineDash(y(M)),e.lineDashOffset=-g,e.stroke(w),_>M&&(e.setLineDash(y(_-M)),e.lineDashOffset=0,e.stroke(w))}e.setLineDash([]),e.filter="none",e.restore()}e.restore()}function ls(e,t,n){const r=t.fill;if(r.type==="color"||!r.stops)return r.color??"#c6f432";const[s,o,a,i]=Gt(t,n),l=s+(a-s)*(r.cx??.5),f=o+(i-o)*(r.cy??.5);let h;if(r.type==="radial")h=e.createRadialGradient(l,f,0,l,f,Math.max(1,Math.hypot(a-s,i-o)/2));else{const c=(r.angle??0)*Math.PI/180,u=Math.cos(c),p=Math.sin(c),k=Math.abs(u)*(a-s)/2+Math.abs(p)*(i-o)/2;h=e.createLinearGradient(l-u*k,f-p*k,l+u*k,f+p*k)}for(const[c,u]of r.stops)h.addColorStop(u,c);return h}function So(e,t,n,r,s){const o=-r/2,a=-s/2,i=Math.max(0,Math.min(1,n));if(e.beginPath(),t==="wipe-left")e.rect(o,a,r*i,s);else if(t==="wipe-right")e.rect(o+r*(1-i),a,r*i,s);else if(t==="wipe-down")e.rect(o,a,r,s*i);else if(t==="wipe-up")e.rect(o,a+s*(1-i),r,s*i);else if(t==="iris")e.arc(0,0,i*Math.hypot(r,s)/2,0,Math.PI*2);else if(t==="split-h")e.rect(-r*i/2,a,r*i,s);else if(t==="split-v")e.rect(o,-s*i/2,r,s*i);else if(t==="split-h-edges"){const l=r*i/2;e.rect(o,a,l,s),e.rect(r/2-l,a,l,s)}else if(t==="watercolor")if(i>=1)e.rect(o,a,r,s);else{const l=$n(i)*Math.hypot(r,s)/2;for(let f=0;f<256;f++){const h=f/256*Math.PI*2,c=l*(1+Rn(h)),u=Math.sin(h)*c,p=-Math.cos(h)*c;f?e.lineTo(u,p):e.moveTo(u,p)}e.closePath()}else if(i>=1&&/^(torn|blocks)/.test(t))e.rect(o,a,r,s);else if(t==="torn"||t==="torn-back"){const l=Cn(t==="torn"?i:1-i),f=In().map(c=>[o+(l-jn(c))*r,a+c*s]),h=t==="torn"?o-r:o+2*r;e.moveTo(h,a);for(const[c,u]of f)e.lineTo(c,u);e.lineTo(h,a+s),e.closePath()}else if(t==="blocks"||t==="blocks-back"){const l=Dn.n,f=Math.max(r,s)/800;for(let h=0;h<l;h++)for(let c=0;c<l;c++){const u=Bn(c,h);(t==="blocks"?u<i:u>=1-i)&&e.rect(o+c*r/l-f,a+h*s/l-f,r/l+2*f,s/l+2*f)}}else e.moveTo(0,0),e.arc(0,0,Math.hypot(r,s),-Math.PI/2,-Math.PI/2+i*Math.PI*2),e.closePath();e.clip()}let xt=null;const fs=()=>xt??=Promise.all(Fn.map(async e=>{const t=await fetch(e.url);if(!t.ok)throw Error(`Font ${e.url}: HTTP ${t.status}`);return{name:e.name,weight:e.weight,style:"normal",data:await t.arrayBuffer()}})).catch(e=>{throw xt=null,e});let vt=null;const cs=()=>vt??=U(()=>import("./index-BGZJld3s.js"),__vite__mapDeps([0,1,2,3])).then(e=>e.default).catch(e=>{throw vt=null,e}),hs=48,ze=new Map,We=new Map,on=(e,t,n)=>(e.set(t,n),e.size>hs&&e.delete(e.keys().next().value),n);function us(e){const t=Ht(e);return ze.get(t)??on(ze,t,(async()=>{const[n,r]=await Promise.all([cs(),fs()]);return n(Nn(e),{width:e.width,height:e.height,fonts:r})})().catch(n=>{throw ze.delete(t),n}))}const ps=e=>Math.min(2,2560/Math.max(e.width,e.height));function Ao(e){const t=Ht(e);return We.get(t)??on(We,t,(async()=>{const n=await us(e),r=new Image,s=ps(e);r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,await r.decode();const o=Object.assign(document.createElement("canvas"),{width:Math.round(e.width*s),height:Math.round(e.height*s)}),a=o.getContext("2d");if(!a)throw Error("Canvas unavailable");return a.drawImage(r,0,0,o.width,o.height),o})().catch(n=>{throw We.delete(t),n}))}const ds=Object.freeze({dark:"dark",light:"positron",atlas:"liberty",neon:"dark",lime:"dark",paper:"positron",mono:"positron",satellite:"positron"}),ms="https://tiles.maps.eox.at/wmts/1.0.0/s2cloudless_3857/default/g/{z}/{y}/{x}.jpg",gs=14,ys="EOxCloudless 2016 https://cloudless.eox.at by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016)",ie=Object.freeze({source:"sentinel",tiles:ms,maxzoom:gs,credit:ys}),ws="Powered by Esri · Source: Esri, Vantor, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",ge=(e,t,n,r,s,o,a,i,l,f,h,c)=>({bg:e,land:t,park:n,water:r,waterLine:s,building:o,road:a,roadMajor:i,rail:l,boundary:f,text:h,halo:c}),bs=Object.freeze({neon:ge("#070b1a","#0b1226","#0c1a2a","#02040c","#0a2a55","#121c3a","#1b3b7a","#00e5ff","#233060","#ff2fd0","#bfe9ff","#050814"),lime:ge("#0b0d0a","#0f120d","#121a10","#050605","#1d2a16","#171c13","#2a3322","#c6ff3d","#2a3322","#9bcc2e","#e9ffc4","#070806"),paper:ge("#efe4cc","#e9dcc0","#d8d3a6","#b9cfc9","#9fbab4","#dccaa5","#fbf5e6","#c98f4a","#b8a888","#8a5a3c","#4a3a28","#f4ead4"),mono:ge("#f2f2f2","#ececec","#e2e2e2","#cfcfcf","#bdbdbd","#dedede","#ffffff","#9a9a9a","#c8c8c8","#6e6e6e","#3a3a3a","#f7f7f7")}),Ms=/motorway|trunk|primary|major/;function an(e){const t=e["source-layer"]??"",n=e.id??"";return e.type==="background"?"bg":e.type==="symbol"?"label":t==="water"?"water":t==="waterway"?"waterLine":t==="park"||t==="landcover"?"park":t==="landuse"||t==="aeroway"?e.type==="line"?"road":"land":t==="building"?"building":t==="transportation"?/rail|transit/.test(n)?"rail":Ms.test(n)?"roadMajor":"road":t==="boundary"?"boundary":"other"}function _s(e,t){const n=an(e),r={...e.paint??{}};if(n==="other")return e.type==="raster"||e.type==="hillshade"?null:e;if(n==="label")return r["text-color"]=t.text,r["text-halo-color"]=t.halo,{...e,paint:r};const s=n==="bg"?t.bg:t[n];return e.type==="background"?r["background-color"]=s:e.type==="fill"?(r["fill-color"]=s,delete r["fill-pattern"],"fill-outline-color"in r&&(r["fill-outline-color"]=s)):e.type==="fill-extrusion"?(r["fill-extrusion-color"]=s,delete r["fill-extrusion-pattern"]):e.type==="line"&&(r["line-color"]=s,delete r["line-pattern"]),{...e,paint:r}}function ks(e,t=ie){const n=[];for(const r of e.layers){const s=an(r);if(s==="label")n.push({...r,paint:{...r.paint??{},"text-color":"#ffffff","text-halo-color":"rgba(0,0,0,.85)","text-halo-width":1.6}});else if(s==="boundary"&&r.type==="line"){const o=["<=",["get","admin_level"],4];n.push({...r,filter:r.filter?["all",r.filter,o]:o,paint:{...r.paint??{},"line-color":"rgba(255,255,255,.55)"}})}else s==="roadMajor"&&r.type==="line"&&n.push({...r,paint:{...r.paint??{},"line-color":"rgba(255,236,170,.22)"}})}return{...e,sources:{...e.sources,"cx-sat":{type:"raster",tiles:[t.tiles],tileSize:256,maxzoom:t.maxzoom,attribution:t.credit}},layers:[{id:"cx-sat-bg",type:"background",paint:{"background-color":"#0b0f12"}},{id:"cx-sat",type:"raster",source:"cx-sat",paint:{"raster-fade-duration":0}},...n]}}const Ot=Object.freeze({dark:"#30353f",light:"#e4e1da",atlas:"#ddd6cc",neon:"#26367a",lime:"#323d27",paper:"#dccaa5",mono:"#dcdcdc",satellite:"#d6d0c6"});function Lt(e,t=null,n=1){const r=typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t)?t:Ot[e]??Ot.dark,s=Math.max(0,Math.min(2,Number(n)||1));return"#"+[1,3,5].map(o=>Math.min(255,Math.round(parseInt(r.slice(o,o+2),16)*s)).toString(16).padStart(2,"0")).join("")}function Ss(e,t,n=ie){if(e==="satellite")return ks(t,n??ie);const r=bs[e];return r?{...t,layers:t.layers.map(s=>_s(s,r)).filter(Boolean)}:t}function As(e,t,n=ie){return e==="satellite"?[(n??ie).credit,t]:[t]}function Es(e,t,n){const r=[];for(const s of e){let o="";for(const a of String(s).split(" ")){const i=o?o+" "+a:a;o&&t(i)>n?(r.push(o),o=a):o=i}o&&r.push(o)}return r}const Ts=e=>Hn[e];function xs(e,t,n,r,s,o){Gn(e,t,n,r,s,o,Ts)}const Pt=Object.fromEntries(Object.entries(ds).map(([e,t])=>[e,`https://tiles.openfreemap.org/styles/${t}`])),vs="OpenFreeMap © OpenMapTiles · Data © OpenStreetMap contributors",Os=[110.8,15.4,113.2,17.4],Ls=[111.2,6,118,12.2],$t=([e,t,n,r])=>[[e,t],[n,t],[n,r],[e,r],[e,t]],Rt={type:"MultiPolygon",coordinates:[[$t(Os)],[$t(Ls)]]},Ps=e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{name:e==="vi"?`Quần đảo Hoàng Sa
|
|
154
|
+
<\/script>`;let G=null,ee=null,Br=0;const Ae=new Map,Ee=new Map;function Nr(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)+":"+e.length}let te=null;function Fr(){return te||(te=Promise.all(wn.map(async t=>{const n=await fetch(bn+t.file);if(!n.ok)throw Error(t.file);return{family:t.family,weight:t.weight,style:t.style,data:await n.arrayBuffer()}})).catch(()=>(te=null,[])),te)}let Ne=null,be=null;function Gr(){return Ne??=Promise.all([U(()=>import("./three-D7Ssject.js"),[]),U(()=>import("./RoomEnvironment-grxZ6k9f.js"),[])]).then(([e,t])=>({src:e.default,room:Mn(t.default)})).catch(e=>{throw Ne=null,e}),Ne}function Hr(){return be??=Gr().then(e=>{G?.contentWindow?.postMessage({type:"three",src:e.src,room:e.room},"*")}).catch(e=>{throw be=null,e}),be}let Fe=null,Me=null;function zr(){return Fe??=Promise.all([U(()=>import("./opentype-D4-4HGq7.js"),[]),...Object.entries(kn).map(async([e,t])=>{const n=await fetch(t);if(!n.ok)throw Error(`Font ${n.status}`);return{key:e,data:await n.arrayBuffer()}})]).then(([e,...t])=>({src:e.default,fonts:t})).catch(e=>{throw Fe=null,e}),Fe}function Wr(){return Me??=zr().then(e=>{G?.contentWindow?.postMessage({type:"glyphs",src:e.src,fonts:e.fonts.map(t=>({key:t.key,data:t.data.slice(0)}))},"*")}).catch(e=>{throw Me=null,e}),Me}const Ge=new Map;let _e=new Map;function qr(e){return Promise.all(e.map(t=>{let n=_e.get(t);if(!n){let r=Ge.get(t);r||(r=fetch(dr(t)).then(s=>s.ok?s.arrayBuffer():null).catch(()=>null),Ge.set(t,r)),n=r.then(s=>{if(!s){Ge.delete(t),_e.delete(t);return}G?.contentWindow?.postMessage({type:"stickers",items:[{id:t,data:s.slice(0)}]},"*")}),_e.set(t,n)}return n}))}let He=null,ke=null;function Ur(){return He??=Promise.all([U(()=>import("./GLTFLoader-DYtnVu-I.js"),[]),U(()=>import("./BufferGeometryUtils-_ZXHoOh1.js"),[]),U(()=>import("./SkeletonUtils-CfWUgbiL.js"),[])]).then(([e,t,n])=>{const r=De(e.default),s=De(t.default),o=De(n.default);if(!r||!s||!o)throw Error("GLTFLoader shape changed");return{gltf:r,bgu:s,skel:o}}).catch(e=>{throw He=null,e}),He}function Kr(){return ke??=Ur().then(e=>{G?.contentWindow?.postMessage({type:"gltf",...e},"*")}).catch(e=>{throw ke=null,e}),ke}const Te=new Map,J=new Map;function go(e,t){const n=t.slice().buffer;Te.set(e,n),J.delete(`local:${e}`)}function yo(e){for(const t of[...Te.keys()])t.startsWith(e)&&(Te.delete(t),J.delete(`local:${t}`))}let ne=null;function Vr(e){if(!ne){const t={uris:new Set,run:Promise.resolve({})};t.run=new Promise(n=>setTimeout(n,0)).then(()=>(ne=null,gr([...t.uris]))),ne=t}return ne.uris.add(e),ne.run.then(t=>{const n=t[e];if(!n)throw Error(le("Không tải được tài nguyên của lớp plug-in ({0}).",[e.split("/").pop()||"?"]));return n})}function Jr(e){let t=J.get(e);return t||(t=e.startsWith("local:")?Promise.resolve().then(()=>{const n=Te.get(e.slice(6));if(!n)throw Error("local asset missing");return n}):Vr(e).then(n=>fetch(n)).then(n=>{if(!n.ok)throw Error(le("Không tải được tài nguyên của lớp plug-in ({0}).",[e.split("/").pop()||"?"]));return n.arrayBuffer()}),J.set(e,t),t.catch(()=>J.delete(e)),J.size>64&&J.delete(J.keys().next().value)),t}async function Yr(e,t){const n=_r(t),r=await Jr(n.uri),s=new Uint8Array(r),o={...n.grid?{grid:n.grid}:{},...n.fps?{fps:n.fps}:{}};if(s[0]===103&&s[1]===108&&s[2]===84&&s[3]===70)return{name:e,kind:"model",data:r.slice(0)};if(s[0]===67&&s[1]===88&&s[2]===83&&s[3]===81)return{name:e,kind:"sequence",frames:$r(s).map(a=>a.slice().buffer),...o};if(/\.cube$/i.test(e)||/\.cube$/i.test(n.uri)){const a=_n(Dt(new TextDecoder().decode(s)));return{name:e,kind:"lut",size:a.size,data:a.data.buffer.slice(0)}}return{name:e,kind:"image",data:r.slice(0),...o}}const xe=new Map;async function Xr(e,t,n){const r=t.assets;if(!r||!Object.keys(r).length)return;const s=JSON.stringify(r);if(xe.get(e)===s)return;n&&await Kr().catch(()=>{throw Error(le("Không tải được bộ đọc mô hình 3D — kiểm tra mạng rồi thử lại."))});const a=(await Promise.all(Object.entries(r).map(([i,l])=>Yr(i,l)))).map(i=>i.kind==="lut"?{...i,data:new Float32Array(i.data)}:i);G?.contentWindow?.postMessage({type:"assets",layer:e,items:a},"*"),xe.set(e,s)}function Zr(){if(ee&&G?.isConnected)return ee;G?.remove(),Ee.clear(),ae.clear(),_e=new Map,be=null,Me=null,ke=null,xe.clear();const e=document.createElement("iframe");return G=e,e.setAttribute("sandbox","allow-scripts"),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.title="motion-sandbox",e.style.cssText="position:fixed;width:1px;height:1px;left:-10px;top:-10px;border:0;opacity:0;pointer-events:none",e.srcdoc=Dr,ee=new Promise((t,n)=>{const r=window.setTimeout(()=>{window.removeEventListener("message",s),G===e&&(G.remove(),G=null,ee=null),n(Error("Motion sandbox did not start"))},8e3),s=o=>{o.source===e.contentWindow&&o.data?.type==="boot"&&(window.clearTimeout(r),window.removeEventListener("message",s),Fr().then(a=>{e.contentWindow?.postMessage({type:"fonts",fonts:a},"*"),t()}))};window.addEventListener("message",s)}),document.body.appendChild(e),ee}window.addEventListener("message",e=>{if(!G||e.source!==G.contentWindow||e.data?.type!=="frame")return;const t=Ae.get(e.data.req);t&&(Ae.delete(e.data.req),window.clearTimeout(t.timer),e.data.bmp?t.resolve(e.data.bmp):t.reject(Error(e.data.error===Yt?le("Trình duyệt không chạy được WebGL nên không vẽ được lớp Motion 3D. Hãy bật tăng tốc phần cứng hoặc dùng Chrome / Edge bản mới."):String(e.data.error||"Motion frame failed"))))});const ae=new Map,ve=new Map,Qr=1500;let Oe=Promise.resolve(),wt=Promise.resolve(),Xe=0,Ze=-1/0;async function es(){for(;;){const e=Oe;if(await e,e!==Oe)continue;const t=Ze+Qr-performance.now();if(!Xe&&t<=0)return;await new Promise(n=>window.setTimeout(n,Math.max(100,t)))}}async function wo(e){await Zr();const t=gn(e.motion.code),n=e.motion.kind==="three",r=Nr(e.motion.assets?t+"\0"+JSON.stringify(e.motion.assets):t);n&&await Hr(),await Xr(e.layer,e.motion,n),n&&yn(t)&&await Wr().catch(()=>{throw Error(le("Không tải được phông chữ cho chữ 3D nổi — kiểm tra mạng rồi thử lại."))});const s=n?[]:pr(t,e.motion.params||{});if(s.length&&await qr(s),!n)return Qe(e,t,r);if(!e.background){Xe++,Ze=performance.now();try{return await bt(e,t,r)}finally{Xe--,Ze=performance.now()}}return bt(e,t,r)}function bt(e,t,n){const r=n+"|"+JSON.stringify(e.motion.params||{})+"|"+e.width+"x"+e.height;if(ae.get(e.layer)===r)return Qe(e,t,n);const s=ve.get(e.layer)??0,o=G,a=()=>{if((ve.get(e.layer)??0)!==s||G!==o)throw Error("dropped");return Qe(e,t,n).then(l=>(G===o&&ae.set(e.layer,r),l),l=>{throw ae.delete(e.layer),l})};if(e.background){const l=wt.then(es).then(a);return wt=l.catch(()=>{}),l}const i=Oe.then(a);return Oe=i.catch(()=>{}),i}function Qe(e,t,n){const r=e.motion.kind==="three",s=++Br,o=Ee.get(e.layer)!==n;return Ee.set(e.layer,n),new Promise((a,i)=>{const l=window.setTimeout(()=>{Ae.delete(s),i(Error("Motion frame timed out"))},(r?Jt:o?Cr:Vt)+2e3);Ae.set(s,{resolve:a,reject:i,timer:l}),G.contentWindow.postMessage({type:"frame",req:s,layer:e.layer,key:n,code:t,params:e.motion.params||{},t:e.t,width:e.width,height:e.height,duration:e.duration,fps:e.fps??30,...r?{kind:"three",surface:e.surface??null}:{space:e.space??null}},"*")})}function bo(e){ve.set(e,(ve.get(e)??0)+1),ae.delete(e),xe.delete(e),G?.contentWindow&&Ee.delete(e)&&G.contentWindow.postMessage({type:"drop",layer:e},"*")}function z(e,t){let n=Math.imul(e^2654435769,2246822507)^Math.imul(t+1,3266489909);return n^=n>>>13,n=Math.imul(n,668265263),n^=n>>>16,(n>>>0)/4294967296}const Xt=(e,t)=>{const n=Math.floor(e),r=e-n,s=r*r*(3-2*r);return(z(n,t)*(1-s)+z(n+1,t)*s)*2-1},Zt=e=>{let t=7;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t>>>0},he=new Map;function Qt(e,t,n,r){const s=`${e}|${t.toFixed(2)}|${n%7}|${r}`;let o=he.get(s);if(o)return o;he.size>64&&he.clear();const a=128,i=n%7;o=Object.assign(document.createElement("canvas"),{width:a,height:a});const l=o.getContext("2d"),f=l.createImageData(a,a),[h,c,u]=[1,3,5].map(d=>parseInt(e.slice(d,d+2),16)),p=new Float32Array(a*a);for(let d=0;d<a*a;d++)p[d]=z(d,i+9);const k=(d,S)=>p[(S+a)%a*a+(d+a)%a],E=r?1-t*.35:t*.4;for(let d=0;d<a;d++)for(let S=0;S<a;S++){let w=0;for(let M=-1;M<=1;M++)for(let y=-1;y<=1;y++)w+=k(S+y,d+M);const g=Math.min(1,Math.max(0,((w/9-.5)*2.4+.5)*.6+.4*k(S,d))),_=(d*a+S)*4;f.data[_]=h,f.data[_+1]=c,f.data[_+2]=u,f.data[_+3]=g>E?r?Math.round(160+95*(g-E)/(1-E+1e-6)):255:0}return l.putImageData(f,0,0),he.set(s,o),o}function ts(e,t,n,r=0){return e.createPattern(Qt(t,Math.max(0,Math.min(1,n)),r,!1),"repeat")??t}function ue(e,t,n,r=0){return e.createPattern(Qt(t,Math.max(0,Math.min(1,n)),r,!0),"repeat")??t}function en(e,t,n,r,s,o){const a=r.amount??.5,i=r.scale??1,l=r.color??An(s,null),[f,h,c,u]=n,p=(f+c)/2,k=(h+u)/2,E=Math.hypot(c-f,u-h)/2+4,d=(r.angle??0)*Math.PI/180;e.save(),r.type==="riso"&&(e.save(),e.globalAlpha*=.42*a,e.globalCompositeOperation="multiply",e.translate(4*i,-3*i),e.fillStyle=l,e.fill(t),e.restore()),e.clip(t);const S=(w,g,_,M)=>{e.save(),e.globalAlpha*=M,e.strokeStyle=l,e.lineWidth=_,e.lineCap="butt",e.translate(p,k),e.rotate(w),e.beginPath();for(let y=-E;y<=E;y+=g){const A=Xt(y/g,o+5)*g*.12;e.moveTo(-E,y+A),e.lineTo(E,y-A)}e.stroke(),e.restore()};switch(r.type){case"hatch":S(d,13*i,1.4+a*2.6,.35+a*.55);break;case"crosshatch":S(d,12*i,1.2+a*2,.3+a*.5),S(d+Math.PI/2,12*i,1.2+a*2,.25+a*.45);break;case"halftone":case"riso":{const w=(r.type==="riso"?9:12)*i;e.save(),e.fillStyle=l,e.globalAlpha*=r.type==="riso"?.5:.85,e.translate(p,k),e.rotate(d),e.beginPath();for(let g=-E;g<=E;g+=w)for(let _=-E;_<=E;_+=w){const M=.25+.75*Math.max(0,Math.min(1,(_+g)/(2*E)+.5)),y=w*.5*Math.sqrt(a*M);y>.3&&(e.moveTo(_+y,g),e.arc(_,g,y,0,Math.PI*2))}e.fill(),e.restore(),r.type==="riso"&&(e.globalAlpha*=.5,e.fillStyle=ue(e,"#ffffff",.3+a*.4,o),e.fillRect(f-4,h-4,c-f+8,u-h+8));break}case"grain":e.globalAlpha*=.3+a*.3,e.fillStyle=ue(e,l,.2+a*.5,o),e.fillRect(f-4,h-4,c-f+8,u-h+8);break;case"stipple":{const w=10*i,g=Math.min(4e3,Math.round((c-f)*(u-h)/(w*w)*a*1.6));e.fillStyle=l,e.globalAlpha*=.8,e.beginPath();for(let _=0;_<g;_++){const M=f+z(_,o+1)*(c-f),y=h+z(_,o+2)*(u-h),A=.9+z(_,o+3)*1.4*i;e.moveTo(M+A,y),e.arc(M,y,A,0,Math.PI*2)}e.fill();break}case"wash":{for(let w=0;w<3;w++){const g=f+(c-f)*(.2+.6*z(w,o+4)),_=h+(u-h)*(.2+.6*z(w,o+6)),M=Math.max(8,Math.min(c-f,u-h)*(.35+.3*z(w,o+8))),y=e.createRadialGradient(g,_,0,g,_,M);y.addColorStop(0,l),y.addColorStop(1,l+"00"),e.save(),e.globalAlpha*=.22*a,e.fillStyle=y,e.fillRect(g-M,_-M,M*2,M*2),e.restore()}e.save(),e.globalAlpha*=.5*a,e.strokeStyle=l,e.lineWidth=7*i,e.lineJoin="round",e.stroke(t),e.restore(),e.globalAlpha*=.25,e.fillStyle=ue(e,l,.3,o),e.fillRect(f-4,h-4,c-f+8,u-h+8);break}case"paper":{e.save(),e.globalAlpha*=.2+a*.2,e.fillStyle=ue(e,l,.2+a*.4,o),e.fillRect(f-4,h-4,c-f+8,u-h+8),e.restore();const w=Math.min(900,Math.round((c-f)*(u-h)/4e3*a*i));e.strokeStyle=l,e.lineWidth=.7,e.globalAlpha*=.18,e.beginPath();for(let g=0;g<w;g++){const _=f+z(g,o+11)*(c-f),M=h+z(g,o+12)*(u-h),y=z(g,o+13)*Math.PI*2,A=6+z(g,o+14)*14;e.moveTo(_,M),e.quadraticCurveTo(_+Math.cos(y+.6)*A*.6,M+Math.sin(y+.6)*A*.6,_+Math.cos(y)*A,M+Math.sin(y)*A)}e.stroke();break}case"grid":{const w=40*i;e.strokeStyle=l,e.beginPath();const g=Math.floor(f/w)*w,_=Math.floor(h/w)*w;for(let M=g;M<=c;M+=w)e.moveTo(M,h),e.lineTo(M,u);for(let M=_;M<=u;M+=w)e.moveTo(f,M),e.lineTo(c,M);e.lineWidth=1.2,e.globalAlpha*=.35*a+.1,e.stroke(),e.beginPath();for(let M=Math.floor(f/(w*5))*w*5;M<=c;M+=w*5)e.moveTo(M,h),e.lineTo(M,u);for(let M=Math.floor(h/(w*5))*w*5;M<=u;M+=w*5)e.moveTo(f,M),e.lineTo(c,M);e.lineWidth=2.4,e.stroke();break}}e.restore()}const tn=(e,t,n,r)=>t*Xt(e/38,r+n*977);function ns(e,t,n,r){const s=Math.floor(n*t.fps+1e-6),o=Zt(r)+(t.seed??0)*131|0;return e.map((a,i)=>{const l=Sn(a.pts,a.closed,10);if(l.length<2)return a;const f=[];let h=0;const c=a.closed&&l.length>2?l.length-1:l.length;for(let u=0;u<c;u++){u&&(h+=Math.hypot(l[u][0]-l[u-1][0],l[u][1]-l[u-1][1]));const p=l[Math.max(0,u-1)],k=l[Math.min(l.length-1,u+1)],E=k[0]-p[0],d=k[1]-p[1],S=Math.hypot(E,d)||1,w=tn(h,t.amount,s,o+i*17);f.push([l[u][0]-d/S*w,l[u][1]+E/S*w])}return{pts:f,closed:a.closed}})}const pe=new Map;function nn(e,t,n,r){const s=Math.floor(n*t.fps+1e-6),o=`${s}|${r}|${t.amount}|${e}`;let a=pe.get(o);if(a)return a;pe.size>600&&pe.clear();const i=as(e);if(a=new Path2D,!i.L)return a.addPath(new Path2D(e)),a;const l=new Set;let f=0;const h=c=>{if(!(c-f+1<2)){for(let p=f;p<=c;p++){const k=Math.max(f,p-1),E=Math.min(c,p+1),d=i.xs[E]-i.xs[k],S=i.ys[E]-i.ys[k],w=Math.hypot(d,S)||1,g=tn(i.ss[p],t.amount,s,r),_=i.xs[p]-S/w*g,M=i.ys[p]+d/w*g;p===f?a.moveTo(_,M):a.lineTo(_,M)}Math.hypot(i.xs[c]-i.xs[f],i.ys[c]-i.ys[f])<i.step*2&&(a.closePath(),l.add(f))}};for(let c=1;c<i.ss.length;c++)Math.hypot(i.xs[c]-i.xs[c-1],i.ys[c]-i.ys[c-1])>i.step*3&&(h(c-1),f=c);return h(i.ss.length-1),pe.set(o,a),a}const de=new Map,rs=e=>{let t=de.get(e);return t||(de.size>2e3&&de.clear(),t=new Path2D(e),de.set(e,t)),t},Mt=e=>{const t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)};function ss(e,t,n,r,s,o){const a=t.params,i={...a,parts:a.rig?mr(t,r):a.parts??[]},l=t.stroke,f=t.fill,h=f.type!=="none",c=M=>!!l&&l.width>0&&M.line!==!1&&(M.fill===null||i.outline!==!1),u=Math.max(0,Math.min(1,n.end)-Math.max(0,n.start)),p=u>=1&&!n.offset,k=i.parts.map(M=>p?1:Math.max(1,Le(M.d))),E=i.parts.map((M,y)=>c(M)?k[y]:p?1:Math.max(40,k[y]*.35)),d=E.reduce((M,y)=>M+y,0)||1,S=Math.max(0,n.start)*d,w=S+u*d,g=Zt(t.id)+(o?.seed??0)*131;let _=0;i.parts.forEach((M,y)=>{const A=E[y],P=_;_=_+A;const T=p?1:Math.max(0,Math.min(1,(w-P)/A))-Math.max(0,Math.min(1,(S-P)/A));if(T<=0)return;const R=o?nn(M.d,o,r,g+y*29):rs(M.d),C=v=>{if(!c(M)||!l)return;e.globalAlpha=s*t.opacity*(l.opacity??1)*(M.o??1);const m=Le(M.d),b=p?m:m*T,O=l.width*(M.lw??1)*(v?2:1);if(l.hand){const $={...l.hand,...o?{boil:Math.max(l.hand.boil??0,o.fps)}:{}};ot(e,M.d,{color:l.color,width:O,from:p?0:Math.max(0,(S-P)/A)*m,len:b,hand:$,time:r})}else e.strokeStyle=l.color,e.lineWidth=O,e.lineCap=l.cap??"round",e.lineJoin=l.join??"round",p||!m?e.setLineDash([]):(e.setLineDash([b,m*2]),e.lineDashOffset=-Math.max(0,(S-P)/A)*m),e.stroke(R),e.setLineDash([])},I=h&&!!M.fill;if(I&&C(!0),I){if(e.globalAlpha=s*t.opacity*(f.opacity??1)*(M.o??1)*(p?1:c(M)?Mt((T-.6)/.4):Mt(T)),e.globalAlpha>0){e.fillStyle=M.fill,M.eo?e.fill(R,"evenodd"):e.fill(R);const v=f.texture;v&&(e.save(),M.eo&&e.clip(R,"evenodd"),en(e,R,os(M.d),v,M.fill,g+y),e.restore())}}else C(!1)})}const me=new Map;function os(e){let t=me.get(e);if(t)return t;const n=e.match(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi)?.map(Number)??[];let r=1/0,s=1/0,o=-1/0,a=-1/0;for(let i=0;i+1<n.length;i+=2)r=Math.min(r,n[i]),o=Math.max(o,n[i]),s=Math.min(s,n[i+1]),a=Math.max(a,n[i+1]);return t=Number.isFinite(r)?[r,s,o,a]:[-50,-50,50,50],me.size>2e3&&me.clear(),me.set(e,t),t}const re=new Map;function st(e){let t=re.get(e);if(t)return t;re.size>400&&re.clear();const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",e);let r=0;try{r=n.getTotalLength()}catch{r=0}if(!Number.isFinite(r)||r<=0)return t={xs:new Float32Array(0),ys:new Float32Array(0),ss:new Float32Array(0),L:0,step:1},re.set(e,t),t;const s=Math.max(1.5,r/900),o=Math.ceil(r/s)+1,a=new Float32Array(o),i=new Float32Array(o),l=new Float32Array(o);for(let f=0;f<o;f++){const h=Math.min(r,f*s),c=n.getPointAtLength(h);a[f]=c.x,i[f]=c.y,l[f]=h}return t={xs:a,ys:i,ss:l,L:r,step:s},re.set(e,t),t}const Le=e=>st(e).L,as=e=>st(e);function _t(e,t){let n=Math.imul(e^2654435769,2246822507)^Math.imul(t+1,3266489909);return n^=n>>>13,n=Math.imul(n,668265263),n^=n>>>16,(n>>>0)/4294967296*2-1}function kt(e,t){const n=Math.floor(e),r=e-n,s=r*r*(3-2*r);return _t(n,t)*(1-s)+_t(n+1,t)*s}const St=e=>{const t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)};function At(e,t,n,r,s,o,a,i,l,f=0){if(r-n+1<2)return;const c=t.ss[r]-t.ss[n],u=[],p=[],k=Math.max(.001,Math.min(c*.15,s*3)),E=Math.max(.001,Math.min(c*.22,s*4));for(let d=n;d<=r;d++){const S=Math.max(n,d-1),w=Math.min(r,d+1),g=t.xs[w]-t.xs[S],_=t.ys[w]-t.ys[S],M=Math.hypot(g,_)||1,y=-_/M,A=g/M,P=t.ss[d],L=P-t.ss[n],T=kt(P/(s*3+24),a)*o.wobble*s,R=1+o.press*kt(P/(s*6+48),a+7),C=o.tip+(1-o.tip)*Math.min(St(L/k),St((c-L)/E)),I=Math.max(.15,s/2*R*C),v=t.xs[d]+y*T,m=t.ys[d]+A*T;u.push(v+y*I,m+A*I),p.push(v-y*I,m-A*I)}e.beginPath(),e.moveTo(u[0],u[1]);for(let d=2;d<u.length;d+=2)e.lineTo(u[d],u[d+1]);for(let d=p.length-2;d>=0;d-=2)e.lineTo(p[d],p[d+1]);if(e.closePath(),e.fill(),f>0){const d=e.globalAlpha;e.globalAlpha=d*f,e.lineWidth=Math.max(.4,s*.07),e.lineJoin="round",e.strokeStyle=e.fillStyle,e.stroke(),e.globalAlpha=d}}function ot(e,t,n){const r=st(t);if(!r.L||n.len<=0)return;let s=ft[n.hand.style]??En[n.hand.style]??ft.marker;(n.hand.taper!==void 0||n.hand.press!==void 0)&&(s={...s,...n.hand.taper!==void 0?{tip:Math.max(.02,1-n.hand.taper)}:{},...n.hand.press!==void 0?{press:n.hand.press*.6}:{}});const o=Math.max(.5,n.width*s.width),a=n.hand.boil?Math.floor(n.time*n.hand.boil+1e-6):0,i=(n.hand.seed??0)*131+a*977|0,l=r.L,f=Math.max(0,Math.min(l,n.from)),h=Math.min(l,n.len),c=f+h<=l+1e-6?[[f,Math.min(l,f+h)]]:[[f,l],[0,f+h-l]],u=e.globalAlpha;e.save(),e.fillStyle=s.grain?ts(e,n.color,s.grain,n.hand.seed??0):n.color;const p=s.wet?[[1,s.alpha*.5,i],[.9,s.alpha*.4,i+11],[1.08,s.alpha*.3,i+23]]:[[1,s.alpha,i]];s.retrace&&p.push([.45,s.alpha*.35,i+3]);for(const[k,E,d]of p){e.globalAlpha=u*E;for(const[S,w]of c){let g=-1;for(let _=0;_<r.ss.length;_++){const M=r.ss[_]>=S-1e-6&&r.ss[_]<=w+1e-6,y=g>=0&&_>g&&Math.hypot(r.xs[_]-r.xs[_-1],r.ys[_]-r.ys[_-1])>r.step*3;g>=0&&(!M||y)&&(At(e,r,g,_-1,o*k,s,d,!0,!0,s.wet?.5:0),g=-1),M&&g<0&&(g=_)}g>=0&&At(e,r,g,r.ss.length-1,o*k,s,d,!0,!0,s.wet?.5:0)}}e.restore()}const Mo=e=>"paths"in e?e.trim?.offset??0:0,rn=1280,Se=720,_o=e=>e&&"size"in e&&e.size?{W:e.size[0],H:e.size[1]}:e?.square?{W:Se,H:Se}:{W:rn,H:Se},Et=new Map;function sn(e){let t=Et.get(e);if(t===void 0){const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",e);try{t=n.getTotalLength()}catch{t=0}Et.set(e,t=Number.isFinite(t)?t:0)}return t}function ko(e,t,n,r=rn,s=Se,o=0){const a=Math.min(r,s)/V,i=(r-V*a)/2,l=(s-V*a)/2;if(tt(t)){const c=t.step&&t.step>1?Tn(o,t.step):o,u=t.boil&&t.boil.amount>0?t.boil:null,p=t.items.map(E=>nt(E,c)),k=xn(t.items,p);e.save(),e.translate(i,l),e.scale(a,a),t.items.forEach((E,d)=>{if(E.hidden||E.span&&(o<E.span[0]-1e-6||o>=E.span[1]-1e-6))return;const S=k.get(E.id);S?(e.save(),e.transform(...S),Tt(e,p[d],n,c,a,u),e.restore()):Tt(e,p[d],n,c,a,u)}),e.restore();return}const f=Math.max(0,Math.min(1,n.end)-Math.max(0,n.start)),h=n.offset??0;e.save(),e.translate(i,l),e.scale(a,a);for(const c of t.paths){const u=new Path2D(c.d),p=c.opacity??1;if(e.filter=c.blur?`blur(${(c.blur*a).toFixed(2)}px)`:"none",c.fill&&f>0&&(e.globalAlpha=Math.min(1,f)*p,e.fillStyle=c.fill,c.rule?e.fill(u,c.rule):e.fill(u),e.globalAlpha=1),!c.stroke||f<=0)continue;if(e.globalAlpha=p,c.hand){const w=Le(c.d);ot(e,c.d,{color:c.stroke,width:c.strokeWidth??18,from:((n.start+h)%1+1)%1*w,len:f*w,hand:c.hand,time:o}),e.globalAlpha=1;continue}if(e.strokeStyle=c.stroke,e.lineWidth=c.strokeWidth??18,e.lineCap=c.cap??"round",e.lineJoin="round",f>=1&&h===0){e.setLineDash([]),e.stroke(u),e.globalAlpha=1;continue}const k=sn(c.d);if(!k)continue;const E=((n.start+h)%1+1)%1*k,d=f*k,S=Math.min(d,k-E);e.setLineDash([S,k*2]),e.lineDashOffset=-E,e.stroke(u),d>S&&(e.setLineDash([d-S,k*2]),e.lineDashOffset=0,e.stroke(u))}e.setLineDash([]),e.globalAlpha=1,e.filter="none",e.restore()}const is={add:"source-over",subtract:"destination-out",intersect:"destination-in",exclude:"xor"};function Tt(e,t,n,r,s=1,o=null){const a=o&&!t.params.d&&t.type!=="art"?ns(ct(t,r),o,r,t.id):ct(t,r),i=t.fill,l=t.stroke,f=vn(t.ops,n),h=t.params.d?o?nn(t.params.d,o,r,t.id.length*131+t.id.charCodeAt(t.id.length-1)):new Path2D(t.params.d):new Path2D(a.map(E=>Ce(E.pts,E.closed)).join(" ")),c=Math.max(0,Math.min(1,f.end)-Math.max(0,f.start)),u=f.offset??0,p=!(c>=1&&u===0),k=On(t.ops);e.save(),k&&(e.globalCompositeOperation=is[k]),e.transform(...rt(t));for(const E of Ln(t.ops)){if(e.save(),e.transform(...E.m),t.type==="art"){c>0&&ss(e,t,f,r,E.alpha,o),e.setLineDash([]),e.filter="none",e.restore();continue}if(i.type!=="none"&&c>0&&t.type!=="line"&&(e.globalAlpha=t.opacity*(i.opacity??1)*Math.min(1,c)*E.alpha,e.fillStyle=ls(e,t,r),e.fill(h),i.texture&&en(e,h,Gt(t,r),i.texture,i.color??i.stops?.[0]?.[0]??"#c6f432",t.id.length*97+t.id.charCodeAt(0))),l&&l.width>0&&c>0)if(e.globalAlpha=t.opacity*(l.opacity??1)*E.alpha,e.strokeStyle=l.color,e.lineWidth=l.width,e.lineCap=l.cap??"round",e.lineJoin=l.join??"round",e.miterLimit=10,l.blur&&(e.filter=`blur(${(l.blur*s*Math.abs(t.scale[0]||1)).toFixed(2)}px)`),l.hand){const d=o?{...l.hand,boil:Math.max(l.hand.boil??0,o.fps)}:l.hand;for(const S of t.params.d?[t.params.d]:a.map(w=>Ce(w.pts,w.closed))){const w=Le(S);ot(e,S,{color:l.color,width:l.width,from:((f.start+u)%1+1)%1*w,len:c*w,hand:d,time:r})}}else if(!p)l.dash&&l.dash[0]+l.dash[1]>0?(e.setLineDash(l.dash),e.lineDashOffset=-(l.dashOffset??0)):e.setLineDash([]),e.stroke(h);else if(t.params.d&&t.params.box){const d=sn(t.params.d);if(d){const S=((f.start+u)%1+1)%1*d,w=c*d,g=Math.min(w,d-S);e.setLineDash([g,d*2]),e.lineDashOffset=-S,e.stroke(h),w>g&&(e.setLineDash([w-g,d*2]),e.lineDashOffset=0,e.stroke(h))}}else for(const d of t.params.d?[]:a){const S=Pn(d.pts,d.closed);if(!S)continue;const w=new Path2D(Ce(d.pts,d.closed)),g=((f.start+u)%1+1)%1*S,_=c*S,M=Math.min(_,S-g),y=A=>{const P=l.dash;if(!P||P[0]+P[1]<=0)return[A,S*2];const L=P[0]+P[1],T=[];let R=0;for(let C=((l.dashOffset??0)%L+L)%L-L;C<A&&T.length<4e3;C+=L){const I=Math.max(0,C),v=Math.min(A,C+P[0]);v<=I||(T.length?T.push(I-R,v-I):(I>0&&T.push(0,I),T.push(v-I)),R=v)}return T.length?[...T,S*2]:[0,S*2]};e.setLineDash(y(M)),e.lineDashOffset=-g,e.stroke(w),_>M&&(e.setLineDash(y(_-M)),e.lineDashOffset=0,e.stroke(w))}e.setLineDash([]),e.filter="none",e.restore()}e.restore()}function ls(e,t,n){const r=t.fill;if(r.type==="color"||!r.stops)return r.color??"#c6f432";const[s,o,a,i]=Gt(t,n),l=s+(a-s)*(r.cx??.5),f=o+(i-o)*(r.cy??.5);let h;if(r.type==="radial")h=e.createRadialGradient(l,f,0,l,f,Math.max(1,Math.hypot(a-s,i-o)/2));else{const c=(r.angle??0)*Math.PI/180,u=Math.cos(c),p=Math.sin(c),k=Math.abs(u)*(a-s)/2+Math.abs(p)*(i-o)/2;h=e.createLinearGradient(l-u*k,f-p*k,l+u*k,f+p*k)}for(const[c,u]of r.stops)h.addColorStop(u,c);return h}function So(e,t,n,r,s){const o=-r/2,a=-s/2,i=Math.max(0,Math.min(1,n));if(e.beginPath(),t==="wipe-left")e.rect(o,a,r*i,s);else if(t==="wipe-right")e.rect(o+r*(1-i),a,r*i,s);else if(t==="wipe-down")e.rect(o,a,r,s*i);else if(t==="wipe-up")e.rect(o,a+s*(1-i),r,s*i);else if(t==="iris")e.arc(0,0,i*Math.hypot(r,s)/2,0,Math.PI*2);else if(t==="split-h")e.rect(-r*i/2,a,r*i,s);else if(t==="split-v")e.rect(o,-s*i/2,r,s*i);else if(t==="split-h-edges"){const l=r*i/2;e.rect(o,a,l,s),e.rect(r/2-l,a,l,s)}else if(t==="watercolor")if(i>=1)e.rect(o,a,r,s);else{const l=$n(i)*Math.hypot(r,s)/2;for(let f=0;f<256;f++){const h=f/256*Math.PI*2,c=l*(1+Rn(h)),u=Math.sin(h)*c,p=-Math.cos(h)*c;f?e.lineTo(u,p):e.moveTo(u,p)}e.closePath()}else if(i>=1&&/^(torn|blocks)/.test(t))e.rect(o,a,r,s);else if(t==="torn"||t==="torn-back"){const l=Cn(t==="torn"?i:1-i),f=In().map(c=>[o+(l-jn(c))*r,a+c*s]),h=t==="torn"?o-r:o+2*r;e.moveTo(h,a);for(const[c,u]of f)e.lineTo(c,u);e.lineTo(h,a+s),e.closePath()}else if(t==="blocks"||t==="blocks-back"){const l=Dn.n,f=Math.max(r,s)/800;for(let h=0;h<l;h++)for(let c=0;c<l;c++){const u=Bn(c,h);(t==="blocks"?u<i:u>=1-i)&&e.rect(o+c*r/l-f,a+h*s/l-f,r/l+2*f,s/l+2*f)}}else e.moveTo(0,0),e.arc(0,0,Math.hypot(r,s),-Math.PI/2,-Math.PI/2+i*Math.PI*2),e.closePath();e.clip()}let xt=null;const fs=()=>xt??=Promise.all(Fn.map(async e=>{const t=await fetch(e.url);if(!t.ok)throw Error(`Font ${e.url}: HTTP ${t.status}`);return{name:e.name,weight:e.weight,style:"normal",data:await t.arrayBuffer()}})).catch(e=>{throw xt=null,e});let vt=null;const cs=()=>vt??=U(()=>import("./index-CZn97Ygs.js"),__vite__mapDeps([0,1,2,3])).then(e=>e.default).catch(e=>{throw vt=null,e}),hs=48,ze=new Map,We=new Map,on=(e,t,n)=>(e.set(t,n),e.size>hs&&e.delete(e.keys().next().value),n);function us(e){const t=Ht(e);return ze.get(t)??on(ze,t,(async()=>{const[n,r]=await Promise.all([cs(),fs()]);return n(Nn(e),{width:e.width,height:e.height,fonts:r})})().catch(n=>{throw ze.delete(t),n}))}const ps=e=>Math.min(2,2560/Math.max(e.width,e.height));function Ao(e){const t=Ht(e);return We.get(t)??on(We,t,(async()=>{const n=await us(e),r=new Image,s=ps(e);r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,await r.decode();const o=Object.assign(document.createElement("canvas"),{width:Math.round(e.width*s),height:Math.round(e.height*s)}),a=o.getContext("2d");if(!a)throw Error("Canvas unavailable");return a.drawImage(r,0,0,o.width,o.height),o})().catch(n=>{throw We.delete(t),n}))}const ds=Object.freeze({dark:"dark",light:"positron",atlas:"liberty",neon:"dark",lime:"dark",paper:"positron",mono:"positron",satellite:"positron"}),ms="https://tiles.maps.eox.at/wmts/1.0.0/s2cloudless_3857/default/g/{z}/{y}/{x}.jpg",gs=14,ys="EOxCloudless 2016 https://cloudless.eox.at by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016)",ie=Object.freeze({source:"sentinel",tiles:ms,maxzoom:gs,credit:ys}),ws="Powered by Esri · Source: Esri, Vantor, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",ge=(e,t,n,r,s,o,a,i,l,f,h,c)=>({bg:e,land:t,park:n,water:r,waterLine:s,building:o,road:a,roadMajor:i,rail:l,boundary:f,text:h,halo:c}),bs=Object.freeze({neon:ge("#070b1a","#0b1226","#0c1a2a","#02040c","#0a2a55","#121c3a","#1b3b7a","#00e5ff","#233060","#ff2fd0","#bfe9ff","#050814"),lime:ge("#0b0d0a","#0f120d","#121a10","#050605","#1d2a16","#171c13","#2a3322","#c6ff3d","#2a3322","#9bcc2e","#e9ffc4","#070806"),paper:ge("#efe4cc","#e9dcc0","#d8d3a6","#b9cfc9","#9fbab4","#dccaa5","#fbf5e6","#c98f4a","#b8a888","#8a5a3c","#4a3a28","#f4ead4"),mono:ge("#f2f2f2","#ececec","#e2e2e2","#cfcfcf","#bdbdbd","#dedede","#ffffff","#9a9a9a","#c8c8c8","#6e6e6e","#3a3a3a","#f7f7f7")}),Ms=/motorway|trunk|primary|major/;function an(e){const t=e["source-layer"]??"",n=e.id??"";return e.type==="background"?"bg":e.type==="symbol"?"label":t==="water"?"water":t==="waterway"?"waterLine":t==="park"||t==="landcover"?"park":t==="landuse"||t==="aeroway"?e.type==="line"?"road":"land":t==="building"?"building":t==="transportation"?/rail|transit/.test(n)?"rail":Ms.test(n)?"roadMajor":"road":t==="boundary"?"boundary":"other"}function _s(e,t){const n=an(e),r={...e.paint??{}};if(n==="other")return e.type==="raster"||e.type==="hillshade"?null:e;if(n==="label")return r["text-color"]=t.text,r["text-halo-color"]=t.halo,{...e,paint:r};const s=n==="bg"?t.bg:t[n];return e.type==="background"?r["background-color"]=s:e.type==="fill"?(r["fill-color"]=s,delete r["fill-pattern"],"fill-outline-color"in r&&(r["fill-outline-color"]=s)):e.type==="fill-extrusion"?(r["fill-extrusion-color"]=s,delete r["fill-extrusion-pattern"]):e.type==="line"&&(r["line-color"]=s,delete r["line-pattern"]),{...e,paint:r}}function ks(e,t=ie){const n=[];for(const r of e.layers){const s=an(r);if(s==="label")n.push({...r,paint:{...r.paint??{},"text-color":"#ffffff","text-halo-color":"rgba(0,0,0,.85)","text-halo-width":1.6}});else if(s==="boundary"&&r.type==="line"){const o=["<=",["get","admin_level"],4];n.push({...r,filter:r.filter?["all",r.filter,o]:o,paint:{...r.paint??{},"line-color":"rgba(255,255,255,.55)"}})}else s==="roadMajor"&&r.type==="line"&&n.push({...r,paint:{...r.paint??{},"line-color":"rgba(255,236,170,.22)"}})}return{...e,sources:{...e.sources,"cx-sat":{type:"raster",tiles:[t.tiles],tileSize:256,maxzoom:t.maxzoom,attribution:t.credit}},layers:[{id:"cx-sat-bg",type:"background",paint:{"background-color":"#0b0f12"}},{id:"cx-sat",type:"raster",source:"cx-sat",paint:{"raster-fade-duration":0}},...n]}}const Ot=Object.freeze({dark:"#30353f",light:"#e4e1da",atlas:"#ddd6cc",neon:"#26367a",lime:"#323d27",paper:"#dccaa5",mono:"#dcdcdc",satellite:"#d6d0c6"});function Lt(e,t=null,n=1){const r=typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t)?t:Ot[e]??Ot.dark,s=Math.max(0,Math.min(2,Number(n)||1));return"#"+[1,3,5].map(o=>Math.min(255,Math.round(parseInt(r.slice(o,o+2),16)*s)).toString(16).padStart(2,"0")).join("")}function Ss(e,t,n=ie){if(e==="satellite")return ks(t,n??ie);const r=bs[e];return r?{...t,layers:t.layers.map(s=>_s(s,r)).filter(Boolean)}:t}function As(e,t,n=ie){return e==="satellite"?[(n??ie).credit,t]:[t]}function Es(e,t,n){const r=[];for(const s of e){let o="";for(const a of String(s).split(" ")){const i=o?o+" "+a:a;o&&t(i)>n?(r.push(o),o=a):o=i}o&&r.push(o)}return r}const Ts=e=>Hn[e];function xs(e,t,n,r,s,o){Gn(e,t,n,r,s,o,Ts)}const Pt=Object.fromEntries(Object.entries(ds).map(([e,t])=>[e,`https://tiles.openfreemap.org/styles/${t}`])),vs="OpenFreeMap © OpenMapTiles · Data © OpenStreetMap contributors",Os=[110.8,15.4,113.2,17.4],Ls=[111.2,6,118,12.2],$t=([e,t,n,r])=>[[e,t],[n,t],[n,r],[e,r],[e,t]],Rt={type:"MultiPolygon",coordinates:[[$t(Os)],[$t(Ls)]]},Ps=e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{name:e==="vi"?`Quần đảo Hoàng Sa
|
|
155
155
|
(Việt Nam)`:`Hoang Sa Islands
|
|
156
156
|
(Viet Nam)`},geometry:{type:"Point",coordinates:[112.1,16.45]}},{type:"Feature",properties:{name:e==="vi"?`Quần đảo Trường Sa
|
|
157
157
|
(Việt Nam)`:`Truong Sa Islands
|
|
158
|
-
(Viet Nam)`},geometry:{type:"Point",coordinates:[114.2,9.9]}}]});function $s(e,t="vi"){const n=structuredClone(e),s=["case",["==",["get","name:en"],"South China Sea"],t==="vi"?"Biển Đông":"East Sea (Bien Dong)",t==="vi"?["coalesce",["get","name:vi"],["get","name:latin"],["get","name"]]:["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]]];for(const a of n.layers)/disputed/.test(a.id)&&(a.layout={...a.layout,visibility:"none"}),a.type==="symbol"&&a.layout?.["text-field"]&&(a.layout={...a.layout,"text-field":s},a.filter=a.filter?["all",a.filter,["!",["within",Rt]]]:["!",["within",Rt]]);const o=n.layers.find(a=>a.type==="symbol"&&a.layout?.["text-font"])?.layout["text-font"]??["Noto Sans Bold"];return n.sources["cx-vn"]={type:"geojson",data:Ps(t)},n.glyphs&&n.layers.push({id:"cx-vn-islands",type:"symbol",source:"cx-vn",minzoom:3.5,layout:{"text-field":["get","name"],"text-font":o,"text-size":["interpolate",["linear"],["zoom"],4,15,8,20],"text-allow-overlap":!0},paint:{"text-color":"#e8f1ff","text-halo-color":"rgba(10,20,40,.9)","text-halo-width":1.8}}),n}const ln=e=>({source:"esri",tiles:`${location.origin}/api/geo/hd/${e.id}/{z}/{y}/{x}`,maxzoom:e.maxZoom,credit:ws}),qe=new Map;async function Rs(e,t,n=null){const r=`${e}:${t}:${n?.id??""}:${n?.maxZoom??""}`;let s=qe.get(r);return s||(s=(async()=>{const o=await fetch(Pt[e]??Pt.dark).then(a=>{if(!a.ok)throw Error(`Map style HTTP ${a.status}`);return a.json()});return $s(Ss(e,o,n&&e==="satellite"?ln(n):null),t)})(),qe.set(r,s),s.catch(()=>qe.delete(r))),s}const Cs=e=>[{id:"cx-route-glow",type:"line",source:"cx-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":["*",["get","width"],3],"line-opacity":.28,"line-blur":6}},{id:"cx-route",type:"line",source:"cx-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":["get","width"]}},{id:"cx-pin-ring",type:"circle",source:"cx-pins",paint:{"circle-radius":["*",13,["get","scale"]],"circle-color":["get","color"],"circle-opacity":.25}},{id:"cx-pin",type:"circle",source:"cx-pins",paint:{"circle-radius":["*",7,["get","scale"]],"circle-color":["get","color"],"circle-stroke-color":"#ffffff","circle-stroke-width":2.5}},{id:"cx-pin-label",type:"symbol",source:"cx-pins",layout:{"text-field":["get","label"],"text-font":e,"text-size":["*",22,["min",1,["get","scale"]]],"text-offset":[0,-1.5],"text-anchor":"bottom","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#ffffff","text-halo-color":"rgba(0,0,0,.85)","text-halo-width":2}}];let Is=null;const at=()=>Is??=Promise.all([U(()=>import("./three.module-Bx43vjkH.js"),[]),U(()=>import("./GLTFLoader-Dy6SrZg8.js").then(e=>e.a),__vite__mapDeps([4,5]))]),Ue=new Map;function Ct(e){let t=Ue.get(e);return t||(t=(async()=>{const[n,{GLTFLoader:r}]=await at(),s=await new r().loadAsync(await yr(e));s.scene.traverse(h=>{h.frustumCulled=!1});const o=new n.Box3().setFromObject(s.scene),a=o.getSize(new n.Vector3);if(!(a.y>0))throw Error("GLB không có hình học hợp lệ");const i=1/a.y,l=o.getCenter(new n.Vector3);s.scene.scale.setScalar(i),s.scene.position.set(-l.x*i,-o.min.y*i,-l.z*i);const f=new n.Group;return f.add(s.scene),f.userData.size=[a.x*i,a.z*i],f})(),Ue.set(e,t),t.catch(()=>Ue.delete(e))),t}const Ke=new Map;function js(e){let t=Ke.get(e);return t||(t=(async()=>{const[n]=await at(),r=await wr({gcsUri:e}),s=new n.TextureLoader;s.setCrossOrigin("anonymous");const o=await s.loadAsync(r);return o.colorSpace=n.SRGBColorSpace,o.anisotropy=8,o})(),Ke.set(e,t),t.catch(()=>Ke.delete(e))),t}function Ds(e,[t,n],r){const s=new e.Group,o=t*1.08,a=n*1.08,i=new e.Mesh(new e.BoxGeometry(o,.004,a),new e.MeshBasicMaterial({color:r,transparent:!0,opacity:.35,blending:e.AdditiveBlending,depthWrite:!1})),l=new e.LineSegments(new e.EdgesGeometry(new e.BoxGeometry(o,.004,a)),new e.LineBasicMaterial({color:r,transparent:!0,opacity:1,blending:e.AdditiveBlending,depthWrite:!1}));return s.add(i,l),s.traverse(f=>{f.frustumCulled=!1}),s}function Bs(e,t){let n=null;const r=new e.Scene,s=new e.Camera,o=new e.HemisphereLight(16777215,3817552,2.4);o.position.set(0,0,1),r.add(o);const a=new e.DirectionalLight(16777215,2.6);return a.position.set(.6,-.8,1.4),r.add(a),{id:"cx-models",type:"custom",renderingMode:"3d",onAdd(i,l){n=new e.WebGLRenderer({canvas:i.getCanvas(),context:l,antialias:!0}),n.autoClear=!1},render(i,l){const f=t();if(!n||!f)return;const h=new e.Matrix4().fromArray(l.defaultProjectionData.mainMatrix);n.resetState();for(const{holder:c,m:u,scale:p,cut:k,glow:E,scan:d}of f.placed.values()){if(!(p>0))continue;const{origin:S,local:w}=tr(u,p);c.matrixAutoUpdate=!1,c.matrix.fromArray(w),s.projectionMatrix.copy(h).multiply(new e.Matrix4().makeTranslation(S[0],S[1],S[2])),n.clippingPlanes=k<1?[new e.Plane(new e.Vector3(0,0,-1),Math.max(1e-12,k*w[6]))]:[],d&&(d.visible=E>0,d.position.y=k,d.traverse(g=>{const _=g.material;_&&(_.opacity=(g.type==="LineSegments"?1:.35)*E)})),r.add(c),n.render(r,s),r.remove(c),n.clippingPlanes=[]}}}}const Z=new Map;let Ns=null;const Fs=()=>Ns??=Promise.all([U(()=>import("./maplibre-gl-Dngacpy6.js"),[]),U(()=>import("./maplibre-gl-worker-CD34yISW.js"),[])]).then(([e,t])=>(e.setWorkerUrl(t.default),e));async function Gs(e,t,n,r,s=null){const[o,a]=await Promise.all([Fs(),Rs(e,t,s)]),i=Object.assign(document.createElement("div"),{className:"tl-geo-offscreen"});Object.assign(i.style,{position:"fixed",left:"-20000px",top:"0",width:`${n}px`,height:`${r}px`,pointerEvents:"none"}),document.body.appendChild(i);const l=new o.Map({container:i,style:a,interactive:!1,attributionControl:!1,fadeDuration:0,pixelRatio:1,maxPitch:Math.max(60,Zn.maxPitch),canvasContextAttributes:{preserveDrawingBuffer:!0,antialias:!0},center:[0,0],zoom:1});await new Promise((c,u)=>{const p=setTimeout(()=>u(Error("Bản đồ không tải được (hết thời gian)")),2e4);l.once("load",()=>{clearTimeout(p),c()}),l.once("error",k=>{l.loaded()||(clearTimeout(p),u(Error(String(k.error?.message??"map error"))))})});const f=a.layers.find(c=>c.type==="symbol"&&c.layout?.["text-font"])?.layout["text-font"]??["Noto Sans Bold"];l.addSource("cx-route",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),l.addSource("cx-pins",{type:"geojson",data:{type:"FeatureCollection",features:[]}});for(const c of Cs(f))(c.type!=="symbol"||a.glyphs)&&l.addLayer(c);const h={map:l,canvas:l.getCanvas(),box:i,style:e,W:n,H:r,placed:new Map,three:(await at())[0],city:""};return l.addLayer(Bs(h.three,()=>h),l.getLayer("cx-pin-ring")?"cx-pin-ring":void 0),h}const Y="cx-buildings",It=new WeakMap;function Hs(e){return e.getStyle().layers.filter(t=>t["source-layer"]==="building"&&t.id!==Y)}function zs(e,t,n){const{map:r}=e,s=t?`${t.color??""}:${t.opacity}:${t.light}`:"";if(s!==e.city){const o=Hs(r),a=It.get(e)??new Map(o.map(i=>[i.id,i.layout?.visibility??"visible"]));It.set(e,a),r.getLayer(Y)&&r.removeLayer(Y);for(const i of o)r.setLayoutProperty(i.id,"visibility",t?"none":a.get(i.id)??"visible");if(t){const i=o[0]?.source??Object.entries(r.getStyle().sources).find(([,l])=>l.type==="vector")?.[0];if(i){const l=Qn(t.light,e.style),f=r.getStyle().layers.find(h=>h.type==="symbol")?.id;r.addLayer({id:Y,type:"fill-extrusion",source:i,"source-layer":"building",minzoom:13,filter:["!=",["get","hide_3d"],!0],paint:{"fill-extrusion-color":l.top&&!t.color?["interpolate",["linear"],["coalesce",["get","render_height"],0],0,Lt(e.style,null,l.tint),220,l.top]:Lt(e.style,t.color,l.tint),"fill-extrusion-opacity":t.opacity,"fill-extrusion-vertical-gradient":!0,"fill-extrusion-height":0,"fill-extrusion-base":0}},f),r.setLight(l.light),r.setSky(l.sky)}}else r.setSky({});e.city=s}if(t&&r.getLayer(Y)){const o=t.height*n;r.setPaintProperty(Y,"fill-extrusion-height",["*",["max",["coalesce",["get","render_height"],0],6],o]),r.setPaintProperty(Y,"fill-extrusion-base",["*",["coalesce",["get","render_min_height"],0],o])}}function Ws(e,t){return new Promise(n=>{const r=()=>{clearTimeout(s),n()},s=setTimeout(r,t);e.once("idle",r),e.triggerRepaint()})}async function Eo(e,t,n,r,s,{wait:o=2e4,lang:a="vi",duration:i=1/0,live:l=!1}={}){const f=zn(t,i)?t.hd:null,h=`${t.style}:${a}:${n.W}x${n.H}:${f?.id??""}`,c=Z.get(e);let u=c?.p;if(!c||c.sig!==h){c&&c.p.then(fn,()=>{});const y=Gs(t.style,a,n.W,n.H,f);u=y,Z.set(e,{sig:h,p:y}),y.catch(()=>{Z.get(e)?.p===y&&Z.delete(e)})}const p=await u,{map:k}=p;Re.set(e,{pl:p,W:n.W,H:n.H});const E=new Set;for(const[y,A]of(t.models??[]).entries()){const P=Wn(A,r),L=`${y}:${A.gcsUri}`;E.add(L);let T=p.placed.get(L);if(!T){const R=await Ct(A.gcsUri);T={holder:new p.three.Group().add(R.clone(!0)),m:A,scale:0,cut:1,glow:0},p.placed.set(L,T)}if(A.reveal==="build"&&!T.scan){const R=await Ct(A.gcsUri);T.scan=Ds(p.three,R.userData.size??[1,1],A.color??"#5ef3ff"),T.holder.add(T.scan)}T.m=A,T.scale=P?P.scale:0,T.cut=P?.cut??1,T.glow=P?.glow??0}const d=fe(t,r,[n.W,n.H]).bearing??0;for(const[y,A]of(t.images??[]).entries()){const P=qn(A,r),L=`img:${y}:${A.gcsUri}`;E.add(L);let T=p.placed.get(L);if(!T){const C=p.three,I=await js(A.gcsUri),v=I.image,m=v?.width&&v?.height?v.height/v.width:A.aspect,b=new C.MeshBasicMaterial({map:I,transparent:!0,side:C.DoubleSide,alphaTest:.03,toneMapped:!1}),O=new C.Mesh(new C.PlaneGeometry(1,m).translate(0,m/2,0),b);O.frustumCulled=!1;const $=new C.Group().add(O);T={holder:new C.Group().add($),m:{at:A.at,height:A.width,rotation:0},scale:0,cut:1,glow:0,tilter:$,aspect:m,mat:b},p.placed.set(L,T)}const R=(P?.tilt??A.tilt)*Math.PI/180;T.tilter.rotation.x=-(Math.PI/2-R),T.tilter.position.z=T.aspect/2*Math.cos(R),T.mat.opacity=P?.alpha??0,T.m={at:A.at,height:A.width,rotation:(A.face==="camera"?d:0)+A.rotation},T.scale=P?P.scale:0}for(const y of[...p.placed.keys()])E.has(y)||p.placed.delete(y);k.jumpTo(fe(t,r,[n.W,n.H])),zs(p,t.buildings,Un(t,r)?.k??0);const S=Kn(t,r),w=t.route?.look==="saber"||t.route?.look==="electric"||t.route?.look==="trail";k.getSource("cx-route").setData({type:"FeatureCollection",features:S&&t.route&&!w?[{type:"Feature",properties:{color:t.route.color,width:t.route.width},geometry:{type:"LineString",coordinates:S}}]:[]}),k.getSource("cx-pins").setData({type:"FeatureCollection",features:Vn(t,r).map(y=>({type:"Feature",properties:{label:y.label,color:y.color,scale:y.scale},geometry:{type:"Point",coordinates:y.at}}))}),t.route&&!w&&k.setPaintProperty("cx-route","line-dasharray",t.route.look==="dashed"?[2,1.5]:[1,0]),l?k.redraw():await Ws(k,o);const g=s.getContext("2d");if(!g)return;g.clearRect(0,0,s.width,s.height),g.drawImage(p.canvas,0,0,s.width,s.height);const _=y=>{const A=k.project(y);return[A.x*s.width/n.W,A.y*s.height/n.H]};for(const y of t.areas??[]){const A=Jn(y,r);if(!A)continue;const P=y.paths.map(T=>T.map(_));if(A.fill>0){g.save(),g.fillStyle=y.color,g.globalAlpha=A.fill,g.beginPath();for(const T of P){g.moveTo(T[0][0],T[0][1]);for(const R of T.slice(1))g.lineTo(R[0],R[1]);g.closePath()}g.fill("evenodd"),g.restore()}const L=y.width*s.width/n.W;for(const[T,R]of A.paths.entries()){const C=R.map(_);if(y.look==="line"||y.look==="dashed"){g.save(),g.strokeStyle=y.color,g.lineWidth=L,g.lineJoin="round",g.setLineDash(y.look==="dashed"?[L*3,L*2]:[]),g.beginPath(),g.moveTo(C[0][0],C[0][1]);for(const I of C.slice(1))g.lineTo(I[0],I[1]);g.stroke(),g.restore()}else ye(g,y.look==="electric"?Ie(C,r,{amp:L*1.6,step:L*4,seed:3+T}):C,y.color,L,ce(r+T*.13),A.done||T>0)}}if(t.route?.look==="trail"&&r>=t.route.start){const y=fe(t,r,[n.W,n.H]),A=Math.max(30,ht(y.zoom,y.center[1])*t.route.width*16);qs(g,Yn(t.route.points,9,A).map(P=>P.map(_)),t.route,r,t.route.width*s.width/n.W)}else if(w&&S&&t.route){const y=s.width/n.W,A=s.height/n.H,P=S.map(L=>{const T=k.project(L);return[T.x*y,T.y*A]});if(t.route.look==="electric"){const L=t.route.width*y;ye(g,Ie(P,r,{amp:L*1.8,step:L*3,seed:1}),t.route.color,L,ce(r),!1),ye(g,Ie(P,r,{amp:L*2.6,step:L*2.2,seed:7}),t.route.color,L*.45,ce(r+.37)*.8,!0)}else ye(g,P,t.route.color,t.route.width*y,ce(r))}if(t.icons?.length){const y=fe(t,r,[n.W,n.H]),A=s.height/720,P=ht(y.zoom,y.center[1])*n.H/720,L=t.icons.map(v=>({ic:v,st:Xn(v,r),p:_(v.at)})).filter(v=>v.st&&v.p[0]>-240*A&&v.p[0]<s.width+240*A&&v.p[1]>-60*A&&v.p[1]<s.height+260*A),T=v=>v==="tag"||v==="beacon"||v==="sign",R=new Map(t.icons.map((v,m)=>[v,m])),C=[],I=new Set;for(const v of[...L].sort((m,b)=>Number(T(b.ic.look))-Number(T(m.ic.look))||m.ic.show-b.ic.show||R.get(m.ic)-R.get(b.ic))){if(!v.ic.label&&!v.ic.sub){I.add(v);continue}const m=A*v.ic.size,b=Math.max(70,Math.max(v.ic.label?.length??0,v.ic.sub?.length??0)*8.4)*m,O=v.p[1]-(T(v.ic.look)?130:100)*m,$=[v.p[0]-(T(v.ic.look)?16*m:b/2),O,v.p[0]+(T(v.ic.look)?b:b/2),v.p[1]-(T(v.ic.look)?60:52)*m];C.some(D=>$[0]<D[2]&&$[2]>D[0]&&$[1]<D[3]&&$[3]>D[1])||(C.push($),I.add(v))}for(const v of L.sort((m,b)=>m.p[1]-b.p[1])){const{ic:m,st:b,p:O}=v,$=P*70*m.size,D=Math.cos(m.at[1]*Math.PI/180),H=X=>Array.from({length:40},(it,un)=>{const lt=un/40*Math.PI*2;return _([m.at[0]+$*X*Math.cos(lt)/(111320*D),m.at[1]+$*X*Math.sin(lt)/111320])});xs(g,m,I.has(v)?b:{...b,label:0},O,A*m.size,H)}}const M=er(r);if(M>0){const y=Math.max(10,Math.round(s.height/60));g.save(),g.globalAlpha=M,g.font=`500 ${y}px system-ui, sans-serif`,g.textAlign="right",g.textBaseline="bottom",g.shadowColor="rgba(0,0,0,.8)",g.shadowBlur=y*.35,g.fillStyle="rgba(255,255,255,.92)",Es(As(t.style,vs,f?ln(f):null),A=>g.measureText(A).width,s.width-y*1.2).reverse().forEach((A,P)=>g.fillText(A,s.width-y*.6,s.height-y*.4-P*y*1.35)),g.restore()}}function ye(e,t,n,r,s=1,o=!1){if(t.length<2)return;const a=()=>{e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(const u of t.slice(1))e.lineTo(u[0],u[1])};e.save(),e.globalCompositeOperation="lighter",e.lineCap="round",e.lineJoin="round";const i=[[14,34,.14],[7,18,.26],[3.6,8,.5],[1.9,3,.85]];for(const[u,p,k]of i)e.filter=`blur(${p*Math.max(.6,r/5)}px)`,e.strokeStyle=n,e.globalAlpha=Math.min(1,k*s),e.lineWidth=r*u,a(),e.stroke();if(e.filter="none",e.globalAlpha=1,e.strokeStyle="#ffffff",e.lineWidth=Math.max(1.2,r*.55),a(),e.stroke(),o){e.restore();return}const[l,f]=t[t.length-1],h=r*4.5*s,c=e.createRadialGradient(l,f,0,l,f,h);c.addColorStop(0,"rgba(255,255,255,1)"),c.addColorStop(.25,n),c.addColorStop(1,"rgba(0,0,0,0)"),e.fillStyle=c,e.beginPath(),e.arc(l,f,h,0,Math.PI*2),e.fill(),e.restore()}function Ve(e,t,n){const r=[0];for(let f=1;f<e.length;f++)r.push(r[f-1]+Math.hypot(e[f][0]-e[f-1][0],e[f][1]-e[f-1][1]));const s=r[r.length-1];if(!(s>0)||n<=t)return[];const o=f=>{let h=1;for(;h<r.length-1&&r[h]<f;)h++;const c=(f-r[h-1])/(r[h]-r[h-1]||1);return[e[h-1][0]+(e[h][0]-e[h-1][0])*c,e[h-1][1]+(e[h][1]-e[h-1][1])*c]},a=t*s,i=n*s,l=[o(a)];for(let f=1;f<e.length-1;f++)r[f]>a&&r[f]<i&&l.push(e[f]);return l.push(o(i)),l}function qs(e,t,n,r,s){if(t.length<2)return;const o=c=>{if(c.length<2)return!1;e.beginPath(),e.moveTo(c[0][0],c[0][1]);for(const u of c.slice(1))e.lineTo(u[0],u[1]);return!0},a=Math.max(1,s*.3),i=t[t.length>>1],l=i.length>>1,f=Math.hypot(t[0][l][0]-t[t.length-1][l][0],t[0][l][1]-t[t.length-1][l][1]);e.save(),e.globalCompositeOperation="lighter",e.lineCap="round",e.lineJoin="round";const h=ut(n,t.length>>1,r);h&&o(Ve(i,0,h.drawn))&&(e.filter=`blur(${Math.max(2,f*.45)}px)`,e.strokeStyle=n.color,e.globalAlpha=.1,e.lineWidth=f*1.15,e.stroke(),e.filter="none"),t.forEach((c,u)=>{const p=ut(n,u,r);if(!p)return;const k=a*(u%3===1?1.6:1);o(Ve(c,0,p.drawn))&&(e.globalCompositeOperation="source-over",e.strokeStyle=n.color,e.filter=`blur(${k}px)`,e.globalAlpha=.45,e.lineWidth=k*2.2,e.stroke(),e.filter="none",e.globalAlpha=1,e.lineWidth=k,e.stroke(),e.globalCompositeOperation="lighter"),p.streak&&o(Ve(c,p.streak.a,p.streak.b))&&(e.strokeStyle="#fff6cf",e.filter=`blur(${k}px)`,e.globalAlpha=.75,e.lineWidth=k*2.6,e.stroke(),e.filter="none",e.globalAlpha=1,e.lineWidth=k*1.4,e.stroke())}),e.restore()}function fn(e){try{e.map.remove()}catch{}e.box.remove()}function To(e){Re.delete(e);const t=Z.get(e);t&&(Z.delete(e),t.p.then(fn,()=>{}))}const Re=new Map;function xo(e,t,n){const r=Re.get(e);if(!r)return null;const s=r.pl.map.unproject([t*r.W,n*r.H]);return Number.isFinite(s.lng)&&Number.isFinite(s.lat)?[+s.lng.toFixed(6),+s.lat.toFixed(6)]:null}function vo(e,t){const n=Re.get(e);if(!n)return null;const r=n.pl.map.project(t);return[r.x/n.W,r.y/n.H]}const jt=e=>Math.round(e*1e4)/1e4,cn=e=>e?.square?{SW:720,SH:720}:{SW:1280,SH:720};function Us(e,t,n,r,[s,o]){const{SW:a,SH:i}=cn(e.shape),l=Math.min(a,i)/V,f=(a-V*l)/2+s*l,h=(i-V*l)/2+o*l,c=we(e,f/a,h/i,t,n,r,a,i);return[c.px,c.py]}function Ks(e,t,n,r,s,o){const{SW:a,SH:i}=cn(e.shape),l=Math.min(a,i)/V,f=or(e,s,o,t,n,r,a,i);return[(f.u*a-(a-V*l)/2)/l,(f.v*i-(i-V*l)/2)/l]}const Vs=e=>tt(e)&&e.items.some(t=>t.pins&&Object.keys(t.pins).length);function Oo(e,t,n,r=1280,s=720){const o=e.shape;return Vs(o)?{...o,items:o.items.map(a=>{if(!a.pins||!a.params.pts)return a;const i=nt(a,n,{motion:!1}),l=nr(rt(i)),f=i.params.pts.map((u,p)=>{const k=a.pins[p]!==void 0&&t.find(S=>S.id===a.pins[p]&&rr(S));if(!k)return u;const E=sr(k,Math.max(0,Math.min(k.duration,e.start+n-k.start)),r,s),d=zt(l,...Ks(e,n,r,s,r/2+E.x*r,s/2+E.y*s));return u.length===6?[d[0],d[1],...u.slice(2)]:d}),{keys:h,...c}=i;return{...c,params:{...i.params,pts:f}}})}:o}function Lo(e,t,n,r,s,o,{chain:a=!1,makeId:i,labels:l}){if(!tt(t.shape))throw Error("Chọn một layer Shape");const f=t.shape.items.find(d=>d.id===n);if(!f||f.type!=="path"||!f.params.pts)throw Error("Chọn một đường Pen trong layer Shape");const h=nt(f,r,{motion:!1}),c=h.params.pts,u=rt(h);if(a&&c.length<2)throw Error("Đường cần ít nhất 2 điểm");if(c.length>32)throw Error("Đường có quá nhiều điểm (tối đa 32)");let p=[...e];const k=[],E={};return c.forEach((d,S)=>{const[w,g]=Us(t,r,s,o,zt(u,d[0],d[1]));let _=ar({id:i(S),track:t.track,start:t.start,duration:t.duration,label:l(S)});if(_={..._,...oe(_,"x",jt((w-s/2)/s),0)},_={..._,...oe(_,"y",jt((g-o/2)/o),0)},p=[...p,_],a&&S>0){const M=k[S-1].id;_={..._,...ir(p,_,M,Math.max(0,Math.min(_.duration,r)),s,o)},p=p.map(y=>y.id===_.id?_:y)}k.push(_),E[S]=_.id}),lr(e),{nulls:k,shape:{...t.shape,items:t.shape.items.map(d=>d.id===n?{...d,pins:E}:d)}}}function Po(e,t,n,r,s,o,a){if(["x","y","zoom"].some(b=>fr(e,b)))throw Error("Layer có key vị trí / tỉ lệ: bỏ key trước khi cắt sát nội dung");const i=e.crop??{left:0,right:0,top:0,bottom:0},l={left:Math.max(i.left,t.left),top:Math.max(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)};if(1-l.left-l.right<.02||1-l.top-l.bottom<.02)throw Error("Không tìm thấy nội dung để cắt");if(["left","top","right","bottom"].every(b=>Math.abs(l[b]-i[b])<1e-4))throw Error("Layer đã sát nội dung");const f=b=>Math.round(b*1e4)/1e4,h=Object.fromEntries(Object.entries(l).map(([b,O])=>[b,f(O)])),c=1-i.left-i.right,u=1-i.top-i.bottom,p=b=>(b-i.left)/c,k=b=>(b-i.top)/u,E=[[p(l.left),k(l.top)],[p(1-l.right),k(l.top)],[p(1-l.right),k(1-l.bottom)]].map(([b,O])=>we(e,b,O,n,r,s,o,a)),d=b=>Math.hypot(b[1].px-b[0].px,b[1].py-b[0].py),S=b=>[(b[0].px+b[2].px)/2,(b[0].py+b[2].py)/2];let w={...e,crop:h};const g=[[0,0],[1,0],[1,1]].map(([b,O])=>we(w,b,O,n,r,s,o,a)),_=je(e,"zoom",n)*d(E)/d(g);if(!(_>0)||_>pt)throw Error(`Cắt sát nội dung cần tỉ lệ layer ngoài giới hạn (tối đa ${pt*100}%)`);w={...w,...oe(w,"zoom",f(_),n)};const M=[[0,0],[1,0],[1,1]].map(([b,O])=>we(w,b,O,n,r,s,o,a)),[y,A]=S(E),[P,L]=S(M),T=cr(e,e.start+n,r,s),R=-T.rot*Math.PI/180,C=(y-P)/(T.zoom||1),I=(A-L)/(T.zoom||1),v=C*Math.cos(R)-I*Math.sin(R),m=C*Math.sin(R)+I*Math.cos(R);return w={...w,...oe(w,"x",f(je(e,"x",n)+v/r),n)},w={...w,...oe(w,"y",f(je(e,"y",n)+m/s),n)},{crop:h,...Object.fromEntries(Object.keys(w).filter(b=>w[b]!==e[b]&&b!=="crop").map(b=>[b,w[b]]))}}function $o(e,t,n,{alpha:r=8,dark:s=16}={}){let o=!1;for(let c=3;c<e.length;c+=4)if(e[c]<250){o=!0;break}const a=c=>o?e[c+3]>r:Math.max(e[c],e[c+1],e[c+2])>s;let i=t,l=n,f=-1,h=-1;for(let c=0;c<n;c++)for(let u=0;u<t;u++)a((c*t+u)*4)&&(u<i&&(i=u),u>f&&(f=u),c<l&&(l=c),c>h&&(h=c));return f<0?null:{left:i/t,top:l/n,right:(t-1-f)/t,bottom:(n-1-h)/n}}const Pe=5*1024*1024,$e=10*1024*1024,Js=200,Ys="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",Xs=/^data:image\/(png|jpe?g|webp|gif);base64,[A-Za-z0-9+/=\s]*$/,se=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Zs(e){if(!se(e))throw W("Not a Lottie animation");const t=structuredClone(e),{w:n,h:r,fr:s,ip:o,op:a}=t;if(!Array.isArray(t.layers)||!t.layers.length)throw W("Not a Lottie animation (no layers)");const i=ur({w:Math.round(n),h:Math.round(r),fr:s,ip:o,op:a});if(t.assets!==void 0&&!Array.isArray(t.assets))throw W("Invalid Lottie assets");const l={expressions:0,assets:0,fonts:0},f=[[t,0]];for(;f.length;){const[h,c]=f.pop();if(c>Js)throw W("Lottie file is nested too deeply");if(Array.isArray(h)){for(const u of h)u&&typeof u=="object"&&f.push([u,c+1]);continue}typeof h.x=="string"&&(delete h.x,l.expressions++);for(const u of Object.keys(h)){const p=h[u];p&&typeof p=="object"&&f.push([p,c+1])}}for(const h of t.assets||[]){if(!se(h))throw W("Invalid Lottie assets");Array.isArray(h.layers)||h.p!==void 0&&((typeof h.p!="string"||!Xs.test(h.p))&&(h.p=Ys,l.assets++),h.u="",h.e=1)}if(se(t.fonts)&&Array.isArray(t.fonts.list))for(const h of t.fonts.list)se(h)&&(h.fPath!==void 0&&(delete h.fPath,l.fonts++),h.fOrigin="n",h.origin=0);return{data:t,meta:i,removed:l}}const et=e=>new TextDecoder("utf-8",{fatal:!0}).decode(e),Qs=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)},eo=e=>e.length>4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,to={png:"png",jpg:"jpeg",jpeg:"jpeg",webp:"webp",gif:"gif"};function no(e){if(e.length>$e)throw W("Lottie file is too large");let t;try{t=hr(e,{filter:i=>i.originalSize<=Pe&&(i.name==="manifest.json"||/^(animations|a|images|i)\/[^/]+$/.test(i.name))})}catch{throw W("Invalid .lottie file")}let n=0;for(const i of Object.values(t))if(n+=i.length,i.length>Pe||n>$e*2)throw W("Lottie file is too large");let r=null;if(t["manifest.json"])try{const i=JSON.parse(et(t["manifest.json"]));r=Array.isArray(i?.animations)&&typeof i.animations[0]?.id=="string"?i.animations[0].id:null}catch{}const s=Object.keys(t).filter(i=>/^(animations|a)\/[^/]+\.json$/.test(i)).sort(),o=r&&s.find(i=>i===`animations/${r}.json`||i===`a/${r}.json`)||s[0];if(!o)throw W("No animation in the .lottie file");const a=JSON.parse(et(t[o]));for(const i of Array.isArray(a?.assets)?a.assets:[]){if(!se(i)||typeof i.p!="string"||i.e===1||i.p.startsWith("data:"))continue;const l=t[`images/${i.p}`]??t[`i/${i.p}`],f=to[i.p.split(".").pop()?.toLowerCase()??""];l&&f&&(i.p=`data:image/${f};base64,${Qs(l)}`,i.u="",i.e=1)}return a}function hn(e){if(!(e instanceof Uint8Array))throw W("Not a Lottie animation");let t;if(eo(e))t=no(e);else{if(e.length>Pe)throw W("Lottie file is too large");try{t=JSON.parse(et(e))}catch{throw W("Not a Lottie animation")}}const n=Zs(t),r=JSON.stringify(n.data);if(r.length>Pe)throw W("Lottie file is too large");return{...n,text:r}}const Je=new Map;function ro(e){let t=Je.get(e);return t||(t=(async()=>{const n=await fetch(e);if(!n.ok)throw Error(`HTTP ${n.status}`);if(Number(n.headers.get("content-length"))>$e)throw Error("Lottie file is too large");return hn(new Uint8Array(await n.arrayBuffer())).data})(),Je.set(e,t),t.catch(()=>Je.delete(e))),t}const Q=new Map;let so=null;const oo=()=>so??=U(()=>import("./lottie_light_canvas-D9fsNLID.js").then(e=>e.l),__vite__mapDeps([6,1,2])).then(e=>e.default),ao=()=>({play(){},seek(){},playing(){},rate(){},setVolume(){}});async function io(e,t,n){const[r,s]=await Promise.all([oo(),ro(e)]),o=Object.assign(document.createElement("canvas"),{width:t,height:n}),a=o.getContext("2d");if(!a)throw Error("Canvas unavailable");const i=r.loadAnimation({renderer:"canvas",loop:!1,autoplay:!1,animationData:structuredClone(s),audioFactory:ao,rendererSettings:{context:a,clearCanvas:!0,preserveAspectRatio:"xMidYMid meet",dpr:1}});return i.isLoaded||await new Promise(l=>{const f=setTimeout(l,8e3);i.addEventListener("DOMLoaded",()=>{clearTimeout(f),l()})}),{canvas:o,anim:i}}async function Ro(e,t,n,r,s){const o=Q.get(e);let a=o?.p;if(!o||o.url!==t||o.W!==n.W||o.H!==n.H){o&&o.p.then(h=>h.anim.destroy(),()=>{});const f=io(t,n.W,n.H);a=f,Q.set(e,{url:t,W:n.W,H:n.H,p:f}),f.catch(()=>{Q.get(e)?.p===f&&Q.delete(e)})}const i=await a;i.anim.goToAndStop(r,!0);const l=s.getContext("2d");l&&(l.clearRect(0,0,s.width,s.height),l.drawImage(i.canvas,0,0,s.width,s.height))}function Co(e){const t=Q.get(e);t&&(Q.delete(e),t.p.then(n=>n.anim.destroy(),()=>{}))}async function Io(e){if(e.size>$e)throw Error("Lottie file is too large");const t=hn(new Uint8Array(await e.arrayBuffer())),n=`${e.name.replace(/\.(json|lottie)$/i,"")||"lottie"}.json`;return{file:new File([t.text],n,{type:"application/json"}),meta:t.meta,removed:t.removed}}const jo=e=>/\.(json|lottie)$/i.test(e.name)||e.type==="application/json"||e.type==="application/zip+dotlottie";export{B as A,hn as B,ho as C,uo as D,go as E,yo as F,ro as G,Pe as L,rn as S,ko as a,xs as b,us as c,bo as d,To as e,Eo as f,vo as g,xo as h,Vs as i,Ao as j,Co as k,Ro as l,wo as m,So as n,Se as o,Oo as p,$o as q,Lo as r,_o as s,Mo as t,Po as u,jo as v,Io as w,mo as x,po as y,Rr as z};
|
|
158
|
+
(Viet Nam)`},geometry:{type:"Point",coordinates:[114.2,9.9]}}]});function $s(e,t="vi"){const n=structuredClone(e),s=["case",["==",["get","name:en"],"South China Sea"],t==="vi"?"Biển Đông":"East Sea (Bien Dong)",t==="vi"?["coalesce",["get","name:vi"],["get","name:latin"],["get","name"]]:["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]]];for(const a of n.layers)/disputed/.test(a.id)&&(a.layout={...a.layout,visibility:"none"}),a.type==="symbol"&&a.layout?.["text-field"]&&(a.layout={...a.layout,"text-field":s},a.filter=a.filter?["all",a.filter,["!",["within",Rt]]]:["!",["within",Rt]]);const o=n.layers.find(a=>a.type==="symbol"&&a.layout?.["text-font"])?.layout["text-font"]??["Noto Sans Bold"];return n.sources["cx-vn"]={type:"geojson",data:Ps(t)},n.glyphs&&n.layers.push({id:"cx-vn-islands",type:"symbol",source:"cx-vn",minzoom:3.5,layout:{"text-field":["get","name"],"text-font":o,"text-size":["interpolate",["linear"],["zoom"],4,15,8,20],"text-allow-overlap":!0},paint:{"text-color":"#e8f1ff","text-halo-color":"rgba(10,20,40,.9)","text-halo-width":1.8}}),n}const ln=e=>({source:"esri",tiles:`${location.origin}/api/geo/hd/${e.id}/{z}/{y}/{x}`,maxzoom:e.maxZoom,credit:ws}),qe=new Map;async function Rs(e,t,n=null){const r=`${e}:${t}:${n?.id??""}:${n?.maxZoom??""}`;let s=qe.get(r);return s||(s=(async()=>{const o=await fetch(Pt[e]??Pt.dark).then(a=>{if(!a.ok)throw Error(`Map style HTTP ${a.status}`);return a.json()});return $s(Ss(e,o,n&&e==="satellite"?ln(n):null),t)})(),qe.set(r,s),s.catch(()=>qe.delete(r))),s}const Cs=e=>[{id:"cx-route-glow",type:"line",source:"cx-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":["*",["get","width"],3],"line-opacity":.28,"line-blur":6}},{id:"cx-route",type:"line",source:"cx-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["get","color"],"line-width":["get","width"]}},{id:"cx-pin-ring",type:"circle",source:"cx-pins",paint:{"circle-radius":["*",13,["get","scale"]],"circle-color":["get","color"],"circle-opacity":.25}},{id:"cx-pin",type:"circle",source:"cx-pins",paint:{"circle-radius":["*",7,["get","scale"]],"circle-color":["get","color"],"circle-stroke-color":"#ffffff","circle-stroke-width":2.5}},{id:"cx-pin-label",type:"symbol",source:"cx-pins",layout:{"text-field":["get","label"],"text-font":e,"text-size":["*",22,["min",1,["get","scale"]]],"text-offset":[0,-1.5],"text-anchor":"bottom","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#ffffff","text-halo-color":"rgba(0,0,0,.85)","text-halo-width":2}}];let Is=null;const at=()=>Is??=Promise.all([U(()=>import("./three.module-Bx43vjkH.js"),[]),U(()=>import("./GLTFLoader-Dy6SrZg8.js").then(e=>e.a),__vite__mapDeps([4,5]))]),Ue=new Map;function Ct(e){let t=Ue.get(e);return t||(t=(async()=>{const[n,{GLTFLoader:r}]=await at(),s=await new r().loadAsync(await yr(e));s.scene.traverse(h=>{h.frustumCulled=!1});const o=new n.Box3().setFromObject(s.scene),a=o.getSize(new n.Vector3);if(!(a.y>0))throw Error("GLB không có hình học hợp lệ");const i=1/a.y,l=o.getCenter(new n.Vector3);s.scene.scale.setScalar(i),s.scene.position.set(-l.x*i,-o.min.y*i,-l.z*i);const f=new n.Group;return f.add(s.scene),f.userData.size=[a.x*i,a.z*i],f})(),Ue.set(e,t),t.catch(()=>Ue.delete(e))),t}const Ke=new Map;function js(e){let t=Ke.get(e);return t||(t=(async()=>{const[n]=await at(),r=await wr({gcsUri:e}),s=new n.TextureLoader;s.setCrossOrigin("anonymous");const o=await s.loadAsync(r);return o.colorSpace=n.SRGBColorSpace,o.anisotropy=8,o})(),Ke.set(e,t),t.catch(()=>Ke.delete(e))),t}function Ds(e,[t,n],r){const s=new e.Group,o=t*1.08,a=n*1.08,i=new e.Mesh(new e.BoxGeometry(o,.004,a),new e.MeshBasicMaterial({color:r,transparent:!0,opacity:.35,blending:e.AdditiveBlending,depthWrite:!1})),l=new e.LineSegments(new e.EdgesGeometry(new e.BoxGeometry(o,.004,a)),new e.LineBasicMaterial({color:r,transparent:!0,opacity:1,blending:e.AdditiveBlending,depthWrite:!1}));return s.add(i,l),s.traverse(f=>{f.frustumCulled=!1}),s}function Bs(e,t){let n=null;const r=new e.Scene,s=new e.Camera,o=new e.HemisphereLight(16777215,3817552,2.4);o.position.set(0,0,1),r.add(o);const a=new e.DirectionalLight(16777215,2.6);return a.position.set(.6,-.8,1.4),r.add(a),{id:"cx-models",type:"custom",renderingMode:"3d",onAdd(i,l){n=new e.WebGLRenderer({canvas:i.getCanvas(),context:l,antialias:!0}),n.autoClear=!1},render(i,l){const f=t();if(!n||!f)return;const h=new e.Matrix4().fromArray(l.defaultProjectionData.mainMatrix);n.resetState();for(const{holder:c,m:u,scale:p,cut:k,glow:E,scan:d}of f.placed.values()){if(!(p>0))continue;const{origin:S,local:w}=tr(u,p);c.matrixAutoUpdate=!1,c.matrix.fromArray(w),s.projectionMatrix.copy(h).multiply(new e.Matrix4().makeTranslation(S[0],S[1],S[2])),n.clippingPlanes=k<1?[new e.Plane(new e.Vector3(0,0,-1),Math.max(1e-12,k*w[6]))]:[],d&&(d.visible=E>0,d.position.y=k,d.traverse(g=>{const _=g.material;_&&(_.opacity=(g.type==="LineSegments"?1:.35)*E)})),r.add(c),n.render(r,s),r.remove(c),n.clippingPlanes=[]}}}}const Z=new Map;let Ns=null;const Fs=()=>Ns??=Promise.all([U(()=>import("./maplibre-gl-Dngacpy6.js"),[]),U(()=>import("./maplibre-gl-worker-CD34yISW.js"),[])]).then(([e,t])=>(e.setWorkerUrl(t.default),e));async function Gs(e,t,n,r,s=null){const[o,a]=await Promise.all([Fs(),Rs(e,t,s)]),i=Object.assign(document.createElement("div"),{className:"tl-geo-offscreen"});Object.assign(i.style,{position:"fixed",left:"-20000px",top:"0",width:`${n}px`,height:`${r}px`,pointerEvents:"none"}),document.body.appendChild(i);const l=new o.Map({container:i,style:a,interactive:!1,attributionControl:!1,fadeDuration:0,pixelRatio:1,maxPitch:Math.max(60,Zn.maxPitch),canvasContextAttributes:{preserveDrawingBuffer:!0,antialias:!0},center:[0,0],zoom:1});await new Promise((c,u)=>{const p=setTimeout(()=>u(Error("Bản đồ không tải được (hết thời gian)")),2e4);l.once("load",()=>{clearTimeout(p),c()}),l.once("error",k=>{l.loaded()||(clearTimeout(p),u(Error(String(k.error?.message??"map error"))))})});const f=a.layers.find(c=>c.type==="symbol"&&c.layout?.["text-font"])?.layout["text-font"]??["Noto Sans Bold"];l.addSource("cx-route",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),l.addSource("cx-pins",{type:"geojson",data:{type:"FeatureCollection",features:[]}});for(const c of Cs(f))(c.type!=="symbol"||a.glyphs)&&l.addLayer(c);const h={map:l,canvas:l.getCanvas(),box:i,style:e,W:n,H:r,placed:new Map,three:(await at())[0],city:""};return l.addLayer(Bs(h.three,()=>h),l.getLayer("cx-pin-ring")?"cx-pin-ring":void 0),h}const Y="cx-buildings",It=new WeakMap;function Hs(e){return e.getStyle().layers.filter(t=>t["source-layer"]==="building"&&t.id!==Y)}function zs(e,t,n){const{map:r}=e,s=t?`${t.color??""}:${t.opacity}:${t.light}`:"";if(s!==e.city){const o=Hs(r),a=It.get(e)??new Map(o.map(i=>[i.id,i.layout?.visibility??"visible"]));It.set(e,a),r.getLayer(Y)&&r.removeLayer(Y);for(const i of o)r.setLayoutProperty(i.id,"visibility",t?"none":a.get(i.id)??"visible");if(t){const i=o[0]?.source??Object.entries(r.getStyle().sources).find(([,l])=>l.type==="vector")?.[0];if(i){const l=Qn(t.light,e.style),f=r.getStyle().layers.find(h=>h.type==="symbol")?.id;r.addLayer({id:Y,type:"fill-extrusion",source:i,"source-layer":"building",minzoom:13,filter:["!=",["get","hide_3d"],!0],paint:{"fill-extrusion-color":l.top&&!t.color?["interpolate",["linear"],["coalesce",["get","render_height"],0],0,Lt(e.style,null,l.tint),220,l.top]:Lt(e.style,t.color,l.tint),"fill-extrusion-opacity":t.opacity,"fill-extrusion-vertical-gradient":!0,"fill-extrusion-height":0,"fill-extrusion-base":0}},f),r.setLight(l.light),r.setSky(l.sky)}}else r.setSky({});e.city=s}if(t&&r.getLayer(Y)){const o=t.height*n;r.setPaintProperty(Y,"fill-extrusion-height",["*",["max",["coalesce",["get","render_height"],0],6],o]),r.setPaintProperty(Y,"fill-extrusion-base",["*",["coalesce",["get","render_min_height"],0],o])}}function Ws(e,t){return new Promise(n=>{const r=()=>{clearTimeout(s),n()},s=setTimeout(r,t);e.once("idle",r),e.triggerRepaint()})}async function Eo(e,t,n,r,s,{wait:o=2e4,lang:a="vi",duration:i=1/0,live:l=!1}={}){const f=zn(t,i)?t.hd:null,h=`${t.style}:${a}:${n.W}x${n.H}:${f?.id??""}`,c=Z.get(e);let u=c?.p;if(!c||c.sig!==h){c&&c.p.then(fn,()=>{});const y=Gs(t.style,a,n.W,n.H,f);u=y,Z.set(e,{sig:h,p:y}),y.catch(()=>{Z.get(e)?.p===y&&Z.delete(e)})}const p=await u,{map:k}=p;Re.set(e,{pl:p,W:n.W,H:n.H});const E=new Set;for(const[y,A]of(t.models??[]).entries()){const P=Wn(A,r),L=`${y}:${A.gcsUri}`;E.add(L);let T=p.placed.get(L);if(!T){const R=await Ct(A.gcsUri);T={holder:new p.three.Group().add(R.clone(!0)),m:A,scale:0,cut:1,glow:0},p.placed.set(L,T)}if(A.reveal==="build"&&!T.scan){const R=await Ct(A.gcsUri);T.scan=Ds(p.three,R.userData.size??[1,1],A.color??"#5ef3ff"),T.holder.add(T.scan)}T.m=A,T.scale=P?P.scale:0,T.cut=P?.cut??1,T.glow=P?.glow??0}const d=fe(t,r,[n.W,n.H]).bearing??0;for(const[y,A]of(t.images??[]).entries()){const P=qn(A,r),L=`img:${y}:${A.gcsUri}`;E.add(L);let T=p.placed.get(L);if(!T){const C=p.three,I=await js(A.gcsUri),v=I.image,m=v?.width&&v?.height?v.height/v.width:A.aspect,b=new C.MeshBasicMaterial({map:I,transparent:!0,side:C.DoubleSide,alphaTest:.03,toneMapped:!1}),O=new C.Mesh(new C.PlaneGeometry(1,m).translate(0,m/2,0),b);O.frustumCulled=!1;const $=new C.Group().add(O);T={holder:new C.Group().add($),m:{at:A.at,height:A.width,rotation:0},scale:0,cut:1,glow:0,tilter:$,aspect:m,mat:b},p.placed.set(L,T)}const R=(P?.tilt??A.tilt)*Math.PI/180;T.tilter.rotation.x=-(Math.PI/2-R),T.tilter.position.z=T.aspect/2*Math.cos(R),T.mat.opacity=P?.alpha??0,T.m={at:A.at,height:A.width,rotation:(A.face==="camera"?d:0)+A.rotation},T.scale=P?P.scale:0}for(const y of[...p.placed.keys()])E.has(y)||p.placed.delete(y);k.jumpTo(fe(t,r,[n.W,n.H])),zs(p,t.buildings,Un(t,r)?.k??0);const S=Kn(t,r),w=t.route?.look==="saber"||t.route?.look==="electric"||t.route?.look==="trail";k.getSource("cx-route").setData({type:"FeatureCollection",features:S&&t.route&&!w?[{type:"Feature",properties:{color:t.route.color,width:t.route.width},geometry:{type:"LineString",coordinates:S}}]:[]}),k.getSource("cx-pins").setData({type:"FeatureCollection",features:Vn(t,r).map(y=>({type:"Feature",properties:{label:y.label,color:y.color,scale:y.scale},geometry:{type:"Point",coordinates:y.at}}))}),t.route&&!w&&k.setPaintProperty("cx-route","line-dasharray",t.route.look==="dashed"?[2,1.5]:[1,0]),l?k.redraw():await Ws(k,o);const g=s.getContext("2d");if(!g)return;g.clearRect(0,0,s.width,s.height),g.drawImage(p.canvas,0,0,s.width,s.height);const _=y=>{const A=k.project(y);return[A.x*s.width/n.W,A.y*s.height/n.H]};for(const y of t.areas??[]){const A=Jn(y,r);if(!A)continue;const P=y.paths.map(T=>T.map(_));if(A.fill>0){g.save(),g.fillStyle=y.color,g.globalAlpha=A.fill,g.beginPath();for(const T of P){g.moveTo(T[0][0],T[0][1]);for(const R of T.slice(1))g.lineTo(R[0],R[1]);g.closePath()}g.fill("evenodd"),g.restore()}const L=y.width*s.width/n.W;for(const[T,R]of A.paths.entries()){const C=R.map(_);if(y.look==="line"||y.look==="dashed"){g.save(),g.strokeStyle=y.color,g.lineWidth=L,g.lineJoin="round",g.setLineDash(y.look==="dashed"?[L*3,L*2]:[]),g.beginPath(),g.moveTo(C[0][0],C[0][1]);for(const I of C.slice(1))g.lineTo(I[0],I[1]);g.stroke(),g.restore()}else ye(g,y.look==="electric"?Ie(C,r,{amp:L*1.6,step:L*4,seed:3+T}):C,y.color,L,ce(r+T*.13),A.done||T>0)}}if(t.route?.look==="trail"&&r>=t.route.start){const y=fe(t,r,[n.W,n.H]),A=Math.max(30,ht(y.zoom,y.center[1])*t.route.width*16);qs(g,Yn(t.route.points,9,A).map(P=>P.map(_)),t.route,r,t.route.width*s.width/n.W)}else if(w&&S&&t.route){const y=s.width/n.W,A=s.height/n.H,P=S.map(L=>{const T=k.project(L);return[T.x*y,T.y*A]});if(t.route.look==="electric"){const L=t.route.width*y;ye(g,Ie(P,r,{amp:L*1.8,step:L*3,seed:1}),t.route.color,L,ce(r),!1),ye(g,Ie(P,r,{amp:L*2.6,step:L*2.2,seed:7}),t.route.color,L*.45,ce(r+.37)*.8,!0)}else ye(g,P,t.route.color,t.route.width*y,ce(r))}if(t.icons?.length){const y=fe(t,r,[n.W,n.H]),A=s.height/720,P=ht(y.zoom,y.center[1])*n.H/720,L=t.icons.map(v=>({ic:v,st:Xn(v,r),p:_(v.at)})).filter(v=>v.st&&v.p[0]>-240*A&&v.p[0]<s.width+240*A&&v.p[1]>-60*A&&v.p[1]<s.height+260*A),T=v=>v==="tag"||v==="beacon"||v==="sign",R=new Map(t.icons.map((v,m)=>[v,m])),C=[],I=new Set;for(const v of[...L].sort((m,b)=>Number(T(b.ic.look))-Number(T(m.ic.look))||m.ic.show-b.ic.show||R.get(m.ic)-R.get(b.ic))){if(!v.ic.label&&!v.ic.sub){I.add(v);continue}const m=A*v.ic.size,b=Math.max(70,Math.max(v.ic.label?.length??0,v.ic.sub?.length??0)*8.4)*m,O=v.p[1]-(T(v.ic.look)?130:100)*m,$=[v.p[0]-(T(v.ic.look)?16*m:b/2),O,v.p[0]+(T(v.ic.look)?b:b/2),v.p[1]-(T(v.ic.look)?60:52)*m];C.some(D=>$[0]<D[2]&&$[2]>D[0]&&$[1]<D[3]&&$[3]>D[1])||(C.push($),I.add(v))}for(const v of L.sort((m,b)=>m.p[1]-b.p[1])){const{ic:m,st:b,p:O}=v,$=P*70*m.size,D=Math.cos(m.at[1]*Math.PI/180),H=X=>Array.from({length:40},(it,un)=>{const lt=un/40*Math.PI*2;return _([m.at[0]+$*X*Math.cos(lt)/(111320*D),m.at[1]+$*X*Math.sin(lt)/111320])});xs(g,m,I.has(v)?b:{...b,label:0},O,A*m.size,H)}}const M=er(r);if(M>0){const y=Math.max(10,Math.round(s.height/60));g.save(),g.globalAlpha=M,g.font=`500 ${y}px system-ui, sans-serif`,g.textAlign="right",g.textBaseline="bottom",g.shadowColor="rgba(0,0,0,.8)",g.shadowBlur=y*.35,g.fillStyle="rgba(255,255,255,.92)",Es(As(t.style,vs,f?ln(f):null),A=>g.measureText(A).width,s.width-y*1.2).reverse().forEach((A,P)=>g.fillText(A,s.width-y*.6,s.height-y*.4-P*y*1.35)),g.restore()}}function ye(e,t,n,r,s=1,o=!1){if(t.length<2)return;const a=()=>{e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(const u of t.slice(1))e.lineTo(u[0],u[1])};e.save(),e.globalCompositeOperation="lighter",e.lineCap="round",e.lineJoin="round";const i=[[14,34,.14],[7,18,.26],[3.6,8,.5],[1.9,3,.85]];for(const[u,p,k]of i)e.filter=`blur(${p*Math.max(.6,r/5)}px)`,e.strokeStyle=n,e.globalAlpha=Math.min(1,k*s),e.lineWidth=r*u,a(),e.stroke();if(e.filter="none",e.globalAlpha=1,e.strokeStyle="#ffffff",e.lineWidth=Math.max(1.2,r*.55),a(),e.stroke(),o){e.restore();return}const[l,f]=t[t.length-1],h=r*4.5*s,c=e.createRadialGradient(l,f,0,l,f,h);c.addColorStop(0,"rgba(255,255,255,1)"),c.addColorStop(.25,n),c.addColorStop(1,"rgba(0,0,0,0)"),e.fillStyle=c,e.beginPath(),e.arc(l,f,h,0,Math.PI*2),e.fill(),e.restore()}function Ve(e,t,n){const r=[0];for(let f=1;f<e.length;f++)r.push(r[f-1]+Math.hypot(e[f][0]-e[f-1][0],e[f][1]-e[f-1][1]));const s=r[r.length-1];if(!(s>0)||n<=t)return[];const o=f=>{let h=1;for(;h<r.length-1&&r[h]<f;)h++;const c=(f-r[h-1])/(r[h]-r[h-1]||1);return[e[h-1][0]+(e[h][0]-e[h-1][0])*c,e[h-1][1]+(e[h][1]-e[h-1][1])*c]},a=t*s,i=n*s,l=[o(a)];for(let f=1;f<e.length-1;f++)r[f]>a&&r[f]<i&&l.push(e[f]);return l.push(o(i)),l}function qs(e,t,n,r,s){if(t.length<2)return;const o=c=>{if(c.length<2)return!1;e.beginPath(),e.moveTo(c[0][0],c[0][1]);for(const u of c.slice(1))e.lineTo(u[0],u[1]);return!0},a=Math.max(1,s*.3),i=t[t.length>>1],l=i.length>>1,f=Math.hypot(t[0][l][0]-t[t.length-1][l][0],t[0][l][1]-t[t.length-1][l][1]);e.save(),e.globalCompositeOperation="lighter",e.lineCap="round",e.lineJoin="round";const h=ut(n,t.length>>1,r);h&&o(Ve(i,0,h.drawn))&&(e.filter=`blur(${Math.max(2,f*.45)}px)`,e.strokeStyle=n.color,e.globalAlpha=.1,e.lineWidth=f*1.15,e.stroke(),e.filter="none"),t.forEach((c,u)=>{const p=ut(n,u,r);if(!p)return;const k=a*(u%3===1?1.6:1);o(Ve(c,0,p.drawn))&&(e.globalCompositeOperation="source-over",e.strokeStyle=n.color,e.filter=`blur(${k}px)`,e.globalAlpha=.45,e.lineWidth=k*2.2,e.stroke(),e.filter="none",e.globalAlpha=1,e.lineWidth=k,e.stroke(),e.globalCompositeOperation="lighter"),p.streak&&o(Ve(c,p.streak.a,p.streak.b))&&(e.strokeStyle="#fff6cf",e.filter=`blur(${k}px)`,e.globalAlpha=.75,e.lineWidth=k*2.6,e.stroke(),e.filter="none",e.globalAlpha=1,e.lineWidth=k*1.4,e.stroke())}),e.restore()}function fn(e){try{e.map.remove()}catch{}e.box.remove()}function To(e){Re.delete(e);const t=Z.get(e);t&&(Z.delete(e),t.p.then(fn,()=>{}))}const Re=new Map;function xo(e,t,n){const r=Re.get(e);if(!r)return null;const s=r.pl.map.unproject([t*r.W,n*r.H]);return Number.isFinite(s.lng)&&Number.isFinite(s.lat)?[+s.lng.toFixed(6),+s.lat.toFixed(6)]:null}function vo(e,t){const n=Re.get(e);if(!n)return null;const r=n.pl.map.project(t);return[r.x/n.W,r.y/n.H]}const jt=e=>Math.round(e*1e4)/1e4,cn=e=>e?.square?{SW:720,SH:720}:{SW:1280,SH:720};function Us(e,t,n,r,[s,o]){const{SW:a,SH:i}=cn(e.shape),l=Math.min(a,i)/V,f=(a-V*l)/2+s*l,h=(i-V*l)/2+o*l,c=we(e,f/a,h/i,t,n,r,a,i);return[c.px,c.py]}function Ks(e,t,n,r,s,o){const{SW:a,SH:i}=cn(e.shape),l=Math.min(a,i)/V,f=or(e,s,o,t,n,r,a,i);return[(f.u*a-(a-V*l)/2)/l,(f.v*i-(i-V*l)/2)/l]}const Vs=e=>tt(e)&&e.items.some(t=>t.pins&&Object.keys(t.pins).length);function Oo(e,t,n,r=1280,s=720){const o=e.shape;return Vs(o)?{...o,items:o.items.map(a=>{if(!a.pins||!a.params.pts)return a;const i=nt(a,n,{motion:!1}),l=nr(rt(i)),f=i.params.pts.map((u,p)=>{const k=a.pins[p]!==void 0&&t.find(S=>S.id===a.pins[p]&&rr(S));if(!k)return u;const E=sr(k,Math.max(0,Math.min(k.duration,e.start+n-k.start)),r,s),d=zt(l,...Ks(e,n,r,s,r/2+E.x*r,s/2+E.y*s));return u.length===6?[d[0],d[1],...u.slice(2)]:d}),{keys:h,...c}=i;return{...c,params:{...i.params,pts:f}}})}:o}function Lo(e,t,n,r,s,o,{chain:a=!1,makeId:i,labels:l}){if(!tt(t.shape))throw Error("Chọn một layer Shape");const f=t.shape.items.find(d=>d.id===n);if(!f||f.type!=="path"||!f.params.pts)throw Error("Chọn một đường Pen trong layer Shape");const h=nt(f,r,{motion:!1}),c=h.params.pts,u=rt(h);if(a&&c.length<2)throw Error("Đường cần ít nhất 2 điểm");if(c.length>32)throw Error("Đường có quá nhiều điểm (tối đa 32)");let p=[...e];const k=[],E={};return c.forEach((d,S)=>{const[w,g]=Us(t,r,s,o,zt(u,d[0],d[1]));let _=ar({id:i(S),track:t.track,start:t.start,duration:t.duration,label:l(S)});if(_={..._,...oe(_,"x",jt((w-s/2)/s),0)},_={..._,...oe(_,"y",jt((g-o/2)/o),0)},p=[...p,_],a&&S>0){const M=k[S-1].id;_={..._,...ir(p,_,M,Math.max(0,Math.min(_.duration,r)),s,o)},p=p.map(y=>y.id===_.id?_:y)}k.push(_),E[S]=_.id}),lr(e),{nulls:k,shape:{...t.shape,items:t.shape.items.map(d=>d.id===n?{...d,pins:E}:d)}}}function Po(e,t,n,r,s,o,a){if(["x","y","zoom"].some(b=>fr(e,b)))throw Error("Layer có key vị trí / tỉ lệ: bỏ key trước khi cắt sát nội dung");const i=e.crop??{left:0,right:0,top:0,bottom:0},l={left:Math.max(i.left,t.left),top:Math.max(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)};if(1-l.left-l.right<.02||1-l.top-l.bottom<.02)throw Error("Không tìm thấy nội dung để cắt");if(["left","top","right","bottom"].every(b=>Math.abs(l[b]-i[b])<1e-4))throw Error("Layer đã sát nội dung");const f=b=>Math.round(b*1e4)/1e4,h=Object.fromEntries(Object.entries(l).map(([b,O])=>[b,f(O)])),c=1-i.left-i.right,u=1-i.top-i.bottom,p=b=>(b-i.left)/c,k=b=>(b-i.top)/u,E=[[p(l.left),k(l.top)],[p(1-l.right),k(l.top)],[p(1-l.right),k(1-l.bottom)]].map(([b,O])=>we(e,b,O,n,r,s,o,a)),d=b=>Math.hypot(b[1].px-b[0].px,b[1].py-b[0].py),S=b=>[(b[0].px+b[2].px)/2,(b[0].py+b[2].py)/2];let w={...e,crop:h};const g=[[0,0],[1,0],[1,1]].map(([b,O])=>we(w,b,O,n,r,s,o,a)),_=je(e,"zoom",n)*d(E)/d(g);if(!(_>0)||_>pt)throw Error(`Cắt sát nội dung cần tỉ lệ layer ngoài giới hạn (tối đa ${pt*100}%)`);w={...w,...oe(w,"zoom",f(_),n)};const M=[[0,0],[1,0],[1,1]].map(([b,O])=>we(w,b,O,n,r,s,o,a)),[y,A]=S(E),[P,L]=S(M),T=cr(e,e.start+n,r,s),R=-T.rot*Math.PI/180,C=(y-P)/(T.zoom||1),I=(A-L)/(T.zoom||1),v=C*Math.cos(R)-I*Math.sin(R),m=C*Math.sin(R)+I*Math.cos(R);return w={...w,...oe(w,"x",f(je(e,"x",n)+v/r),n)},w={...w,...oe(w,"y",f(je(e,"y",n)+m/s),n)},{crop:h,...Object.fromEntries(Object.keys(w).filter(b=>w[b]!==e[b]&&b!=="crop").map(b=>[b,w[b]]))}}function $o(e,t,n,{alpha:r=8,dark:s=16}={}){let o=!1;for(let c=3;c<e.length;c+=4)if(e[c]<250){o=!0;break}const a=c=>o?e[c+3]>r:Math.max(e[c],e[c+1],e[c+2])>s;let i=t,l=n,f=-1,h=-1;for(let c=0;c<n;c++)for(let u=0;u<t;u++)a((c*t+u)*4)&&(u<i&&(i=u),u>f&&(f=u),c<l&&(l=c),c>h&&(h=c));return f<0?null:{left:i/t,top:l/n,right:(t-1-f)/t,bottom:(n-1-h)/n}}const Pe=5*1024*1024,$e=10*1024*1024,Js=200,Ys="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",Xs=/^data:image\/(png|jpe?g|webp|gif);base64,[A-Za-z0-9+/=\s]*$/,se=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Zs(e){if(!se(e))throw W("Not a Lottie animation");const t=structuredClone(e),{w:n,h:r,fr:s,ip:o,op:a}=t;if(!Array.isArray(t.layers)||!t.layers.length)throw W("Not a Lottie animation (no layers)");const i=ur({w:Math.round(n),h:Math.round(r),fr:s,ip:o,op:a});if(t.assets!==void 0&&!Array.isArray(t.assets))throw W("Invalid Lottie assets");const l={expressions:0,assets:0,fonts:0},f=[[t,0]];for(;f.length;){const[h,c]=f.pop();if(c>Js)throw W("Lottie file is nested too deeply");if(Array.isArray(h)){for(const u of h)u&&typeof u=="object"&&f.push([u,c+1]);continue}typeof h.x=="string"&&(delete h.x,l.expressions++);for(const u of Object.keys(h)){const p=h[u];p&&typeof p=="object"&&f.push([p,c+1])}}for(const h of t.assets||[]){if(!se(h))throw W("Invalid Lottie assets");Array.isArray(h.layers)||h.p!==void 0&&((typeof h.p!="string"||!Xs.test(h.p))&&(h.p=Ys,l.assets++),h.u="",h.e=1)}if(se(t.fonts)&&Array.isArray(t.fonts.list))for(const h of t.fonts.list)se(h)&&(h.fPath!==void 0&&(delete h.fPath,l.fonts++),h.fOrigin="n",h.origin=0);return{data:t,meta:i,removed:l}}const et=e=>new TextDecoder("utf-8",{fatal:!0}).decode(e),Qs=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)},eo=e=>e.length>4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,to={png:"png",jpg:"jpeg",jpeg:"jpeg",webp:"webp",gif:"gif"};function no(e){if(e.length>$e)throw W("Lottie file is too large");let t;try{t=hr(e,{filter:i=>i.originalSize<=Pe&&(i.name==="manifest.json"||/^(animations|a|images|i)\/[^/]+$/.test(i.name))})}catch{throw W("Invalid .lottie file")}let n=0;for(const i of Object.values(t))if(n+=i.length,i.length>Pe||n>$e*2)throw W("Lottie file is too large");let r=null;if(t["manifest.json"])try{const i=JSON.parse(et(t["manifest.json"]));r=Array.isArray(i?.animations)&&typeof i.animations[0]?.id=="string"?i.animations[0].id:null}catch{}const s=Object.keys(t).filter(i=>/^(animations|a)\/[^/]+\.json$/.test(i)).sort(),o=r&&s.find(i=>i===`animations/${r}.json`||i===`a/${r}.json`)||s[0];if(!o)throw W("No animation in the .lottie file");const a=JSON.parse(et(t[o]));for(const i of Array.isArray(a?.assets)?a.assets:[]){if(!se(i)||typeof i.p!="string"||i.e===1||i.p.startsWith("data:"))continue;const l=t[`images/${i.p}`]??t[`i/${i.p}`],f=to[i.p.split(".").pop()?.toLowerCase()??""];l&&f&&(i.p=`data:image/${f};base64,${Qs(l)}`,i.u="",i.e=1)}return a}function hn(e){if(!(e instanceof Uint8Array))throw W("Not a Lottie animation");let t;if(eo(e))t=no(e);else{if(e.length>Pe)throw W("Lottie file is too large");try{t=JSON.parse(et(e))}catch{throw W("Not a Lottie animation")}}const n=Zs(t),r=JSON.stringify(n.data);if(r.length>Pe)throw W("Lottie file is too large");return{...n,text:r}}const Je=new Map;function ro(e){let t=Je.get(e);return t||(t=(async()=>{const n=await fetch(e);if(!n.ok)throw Error(`HTTP ${n.status}`);if(Number(n.headers.get("content-length"))>$e)throw Error("Lottie file is too large");return hn(new Uint8Array(await n.arrayBuffer())).data})(),Je.set(e,t),t.catch(()=>Je.delete(e))),t}const Q=new Map;let so=null;const oo=()=>so??=U(()=>import("./lottie_light_canvas-7iv3btPX.js").then(e=>e.l),__vite__mapDeps([6,1,2])).then(e=>e.default),ao=()=>({play(){},seek(){},playing(){},rate(){},setVolume(){}});async function io(e,t,n){const[r,s]=await Promise.all([oo(),ro(e)]),o=Object.assign(document.createElement("canvas"),{width:t,height:n}),a=o.getContext("2d");if(!a)throw Error("Canvas unavailable");const i=r.loadAnimation({renderer:"canvas",loop:!1,autoplay:!1,animationData:structuredClone(s),audioFactory:ao,rendererSettings:{context:a,clearCanvas:!0,preserveAspectRatio:"xMidYMid meet",dpr:1}});return i.isLoaded||await new Promise(l=>{const f=setTimeout(l,8e3);i.addEventListener("DOMLoaded",()=>{clearTimeout(f),l()})}),{canvas:o,anim:i}}async function Ro(e,t,n,r,s){const o=Q.get(e);let a=o?.p;if(!o||o.url!==t||o.W!==n.W||o.H!==n.H){o&&o.p.then(h=>h.anim.destroy(),()=>{});const f=io(t,n.W,n.H);a=f,Q.set(e,{url:t,W:n.W,H:n.H,p:f}),f.catch(()=>{Q.get(e)?.p===f&&Q.delete(e)})}const i=await a;i.anim.goToAndStop(r,!0);const l=s.getContext("2d");l&&(l.clearRect(0,0,s.width,s.height),l.drawImage(i.canvas,0,0,s.width,s.height))}function Co(e){const t=Q.get(e);t&&(Q.delete(e),t.p.then(n=>n.anim.destroy(),()=>{}))}async function Io(e){if(e.size>$e)throw Error("Lottie file is too large");const t=hn(new Uint8Array(await e.arrayBuffer())),n=`${e.name.replace(/\.(json|lottie)$/i,"")||"lottie"}.json`;return{file:new File([t.text],n,{type:"application/json"}),meta:t.meta,removed:t.removed}}const jo=e=>/\.(json|lottie)$/i.test(e.name)||e.type==="application/json"||e.type==="application/zip+dotlottie";export{B as A,hn as B,ho as C,uo as D,go as E,yo as F,ro as G,Pe as L,rn as S,ko as a,xs as b,us as c,bo as d,To as e,Eo as f,vo as g,xo as h,Vs as i,Ao as j,Co as k,Ro as l,wo as m,So as n,Se as o,Oo as p,$o as q,Lo as r,_o as s,Mo as t,Po as u,jo as v,Io as w,mo as x,po as y,Rr as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Lr}from"./api-C5pOWyBM.js";function Ir(Ce,ze){for(var pe=0;pe<ze.length;pe++){const Mt=ze[pe];if(typeof Mt!="string"&&!Array.isArray(Mt)){for(const Xt in Mt)if(Xt!=="default"&&!(Xt in Ce)){const se=Object.getOwnPropertyDescriptor(Mt,Xt);se&&Object.defineProperty(Ce,Xt,se.get?se:{enumerable:!0,get:()=>Mt[Xt]})}}}return Object.freeze(Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"}))}var Be={exports:{}},Vr=Be.exports,Ss;function Rr(){return Ss||(Ss=1,(function(Ce,ze){typeof navigator<"u"&&(function(pe,Mt){Ce.exports=Mt()})(Vr,(function(){var pe="http://www.w3.org/2000/svg",Mt="",Xt=!1,se=-999999,xs=function(e){Xt=!!e},Ps=function(){return Xt},ws=function(e){Mt=e},bt=function(){return Mt};function _t(t){return document.createElement(t)}function Y(t,e){var i,s=t.length,n;for(i=0;i<s;i+=1){n=t[i].prototype;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e.prototype[r]=n[r])}}function As(t){function e(){}return e.prototype=t,e}var Ts=(function(){function t(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(i){this.audios.push(i)},pause:function(){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].pause()},resume:function(){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].resume()},setRate:function(i){var s,n=this.audios.length;for(s=0;s<n;s+=1)this.audios[s].setRate(i)},createAudio:function(i){return this.audioFactory?this.audioFactory(i):window.Howl?new window.Howl({src:[i]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(i){this.audioFactory=i},setVolume:function(i){this._volume=i,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}})(),rt=(function(){function t(i,s){var n=0,r=[],a;switch(i){case"int16":case"uint8c":a=1;break;default:a=1.1;break}for(n=0;n<s;n+=1)r.push(a);return r}function e(i,s){return i==="float32"?new Float32Array(s):i==="int16"?new Int16Array(s):i==="uint8c"?new Uint8ClampedArray(s):t(i,s)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:t})();function $(t){return Array.apply(null,{length:t})}var Pi=!0,wi=null,Ai="",Ms=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Et=Math.pow,Ti=Math.sqrt,pt=Math.floor,Es=Math.min,Mi=150,tt=Math.PI/180,Ht=.5519;function ai(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function Ei(t,e){this.type=t,this.direction=e<0?-1:1}function Fi(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function Li(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function Ii(t,e){this.type=t,this.target=e}function Fs(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function Ls(t){this.type="configError",this.nativeError=t}var vt=(function(){var t=0;return function(){return t+=1,Ai+"__lottie_element_"+t}})();function oi(t,e,i){var s,n,r,a,l,o,c,d;switch(a=Math.floor(t*6),l=t*6-a,o=i*(1-e),c=i*(1-l*e),d=i*(1-(1-l)*e),a%6){case 0:s=i,n=d,r=o;break;case 1:s=c,n=i,r=o;break;case 2:s=o,n=i,r=d;break;case 3:s=o,n=c,r=i;break;case 4:s=d,n=o,r=i;break;case 5:s=i,n=o,r=c;break}return[s,n,r]}function hi(t,e,i){var s=Math.max(t,e,i),n=Math.min(t,e,i),r=s-n,a,l=s===0?0:r/s,o=s/255;switch(s){case n:a=0;break;case t:a=e-i+r*(e<i?6:0),a/=6*r;break;case e:a=i-t+r*2,a/=6*r;break;case i:a=t-e+r*4,a/=6*r;break}return[a,l,o]}function Vi(t,e){var i=hi(t[0]*255,t[1]*255,t[2]*255);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),oi(i[0],i[1],i[2])}function Ri(t,e){var i=hi(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),oi(i[0],i[1],i[2])}function Oi(t,e){var i=hi(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),oi(i[0],i[1],i[2])}(function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(s,n,r){return s<0&&(s=0),n<0&&(n=0),r<0&&(r=0),"#"+t[s]+t[n]+t[r]}})();var Is=function(e){Pi=!!e},Vs=function(){return Pi},Rs=function(e){wi=e},qe=function(){return wi},Ne=function(e){Mi=e},We=function(){return Mi},Os=function(e){Ai=e};function N(t){return document.createElementNS(pe,t)}function je(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?je=function(i){return typeof i}:je=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},je(t)}var Se=(function(){var t=1,e=[],i,s,n={onmessage:function(){},postMessage:function(C){i({data:C})}},r={postMessage:function(C){n.onmessage({data:C})}};function a(f){if(window.Worker&&window.Blob&&Ps()){var C=new Blob(["var _workerSelf = self; self.onmessage = ",f.toString()],{type:"text/javascript"}),S=URL.createObjectURL(C);return new Worker(S)}return i=f,n}function l(){s||(s=a(function(C){function S(){function A(F,m){var k,h,p=F.length,E,w,R,q;for(h=0;h<p;h+=1)if(k=F[h],"ks"in k&&!k.completed){if(k.completed=!0,k.hasMask){var j=k.masksProperties;for(w=j.length,E=0;E<w;E+=1)if(j[E].pt.k.i)_(j[E].pt.k);else for(q=j[E].pt.k.length,R=0;R<q;R+=1)j[E].pt.k[R].s&&_(j[E].pt.k[R].s[0]),j[E].pt.k[R].e&&_(j[E].pt.k[R].e[0])}k.ty===0?(k.layers=u(k.refId,m),A(k.layers,m)):k.ty===4?v(k.shapes):k.ty===5&&G(k)}}function b(F,m){if(F){var k=0,h=F.length;for(k=0;k<h;k+=1)F[k].t===1&&(F[k].data.layers=u(F[k].data.refId,m),A(F[k].data.layers,m))}}function g(F,m){for(var k=0,h=m.length;k<h;){if(m[k].id===F)return m[k];k+=1}return null}function u(F,m){var k=g(F,m);return k?k.layers.__used?JSON.parse(JSON.stringify(k.layers)):(k.layers.__used=!0,k.layers):null}function v(F){var m,k=F.length,h,p;for(m=k-1;m>=0;m-=1)if(F[m].ty==="sh")if(F[m].ks.k.i)_(F[m].ks.k);else for(p=F[m].ks.k.length,h=0;h<p;h+=1)F[m].ks.k[h].s&&_(F[m].ks.k[h].s[0]),F[m].ks.k[h].e&&_(F[m].ks.k[h].e[0]);else F[m].ty==="gr"&&v(F[m].it)}function _(F){var m,k=F.i.length;for(m=0;m<k;m+=1)F.i[m][0]+=F.v[m][0],F.i[m][1]+=F.v[m][1],F.o[m][0]+=F.v[m][0],F.o[m][1]+=F.v[m][1]}function P(F,m){var k=m?m.split("."):[100,100,100];return F[0]>k[0]?!0:k[0]>F[0]?!1:F[1]>k[1]?!0:k[1]>F[1]?!1:F[2]>k[2]?!0:k[2]>F[2]?!1:null}var T=(function(){var F=[4,4,14];function m(h){var p=h.t.d;h.t.d={k:[{s:p,t:0}]}}function k(h){var p,E=h.length;for(p=0;p<E;p+=1)h[p].ty===5&&m(h[p])}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})(),M=(function(){var F=[4,7,99];return function(m){if(m.chars&&!P(F,m.v)){var k,h=m.chars.length;for(k=0;k<h;k+=1){var p=m.chars[k];p.data&&p.data.shapes&&(v(p.data.shapes),p.data.ip=0,p.data.op=99999,p.data.st=0,p.data.sr=1,p.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},m.chars[k].t||(p.data.shapes.push({ty:"no"}),p.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}})(),L=(function(){var F=[5,7,15];function m(h){var p=h.t.p;typeof p.a=="number"&&(p.a={a:0,k:p.a}),typeof p.p=="number"&&(p.p={a:0,k:p.p}),typeof p.r=="number"&&(p.r={a:0,k:p.r})}function k(h){var p,E=h.length;for(p=0;p<E;p+=1)h[p].ty===5&&m(h[p])}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})(),W=(function(){var F=[4,1,9];function m(h){var p,E=h.length,w,R;for(p=0;p<E;p+=1)if(h[p].ty==="gr")m(h[p].it);else if(h[p].ty==="fl"||h[p].ty==="st")if(h[p].c.k&&h[p].c.k[0].i)for(R=h[p].c.k.length,w=0;w<R;w+=1)h[p].c.k[w].s&&(h[p].c.k[w].s[0]/=255,h[p].c.k[w].s[1]/=255,h[p].c.k[w].s[2]/=255,h[p].c.k[w].s[3]/=255),h[p].c.k[w].e&&(h[p].c.k[w].e[0]/=255,h[p].c.k[w].e[1]/=255,h[p].c.k[w].e[2]/=255,h[p].c.k[w].e[3]/=255);else h[p].c.k[0]/=255,h[p].c.k[1]/=255,h[p].c.k[2]/=255,h[p].c.k[3]/=255}function k(h){var p,E=h.length;for(p=0;p<E;p+=1)h[p].ty===4&&m(h[p].shapes)}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})(),B=(function(){var F=[4,4,18];function m(h){var p,E=h.length,w,R;for(p=E-1;p>=0;p-=1)if(h[p].ty==="sh")if(h[p].ks.k.i)h[p].ks.k.c=h[p].closed;else for(R=h[p].ks.k.length,w=0;w<R;w+=1)h[p].ks.k[w].s&&(h[p].ks.k[w].s[0].c=h[p].closed),h[p].ks.k[w].e&&(h[p].ks.k[w].e[0].c=h[p].closed);else h[p].ty==="gr"&&m(h[p].it)}function k(h){var p,E,w=h.length,R,q,j,X;for(E=0;E<w;E+=1){if(p=h[E],p.hasMask){var H=p.masksProperties;for(q=H.length,R=0;R<q;R+=1)if(H[R].pt.k.i)H[R].pt.k.c=H[R].cl;else for(X=H[R].pt.k.length,j=0;j<X;j+=1)H[R].pt.k[j].s&&(H[R].pt.k[j].s[0].c=H[R].cl),H[R].pt.k[j].e&&(H[R].pt.k[j].e[0].c=H[R].cl)}p.ty===4&&m(p.shapes)}}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})();function V(F){F.__complete||(W(F),T(F),M(F),L(F),B(F),A(F.layers,F.assets),b(F.chars,F.assets),F.__complete=!0)}function G(F){F.t.a.length===0&&"m"in F.t.p}var O={};return O.completeData=V,O.checkColors=W,O.checkChars=M,O.checkPathProperties=L,O.checkShapes=B,O.completeLayers=A,O}if(r.dataManager||(r.dataManager=S()),r.assetLoader||(r.assetLoader=(function(){function A(g){var u=g.getResponseHeader("content-type");return u&&g.responseType==="json"&&u.indexOf("json")!==-1||g.response&&je(g.response)==="object"?g.response:g.response&&typeof g.response=="string"?JSON.parse(g.response):g.responseText?JSON.parse(g.responseText):null}function b(g,u,v,_){var P,T=new XMLHttpRequest;try{T.responseType="json"}catch{}T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200)P=A(T),v(P);else try{P=A(T),v(P)}catch(M){_&&_(M)}};try{T.open(["G","E","T"].join(""),g,!0)}catch{T.open(["G","E","T"].join(""),u+"/"+g,!0)}T.send()}return{load:b}})()),C.data.type==="loadAnimation")r.assetLoader.load(C.data.path,C.data.fullPath,function(A){r.dataManager.completeData(A),r.postMessage({id:C.data.id,payload:A,status:"success"})},function(){r.postMessage({id:C.data.id,status:"error"})});else if(C.data.type==="complete"){var y=C.data.animation;r.dataManager.completeData(y),r.postMessage({id:C.data.id,payload:y,status:"success"})}else C.data.type==="loadData"&&r.assetLoader.load(C.data.path,C.data.fullPath,function(A){r.postMessage({id:C.data.id,payload:A,status:"success"})},function(){r.postMessage({id:C.data.id,status:"error"})})}),s.onmessage=function(f){var C=f.data,S=C.id,y=e[S];e[S]=null,C.status==="success"?y.onComplete(C.payload):y.onError&&y.onError()})}function o(f,C){t+=1;var S="processId_"+t;return e[S]={onComplete:f,onError:C},S}function c(f,C,S){l();var y=o(C,S);s.postMessage({type:"loadAnimation",path:f,fullPath:window.location.origin+window.location.pathname,id:y})}function d(f,C,S){l();var y=o(C,S);s.postMessage({type:"loadData",path:f,fullPath:window.location.origin+window.location.pathname,id:y})}function x(f,C,S){l();var y=o(C,S);s.postMessage({type:"complete",animation:f,id:y})}return{loadAnimation:c,loadData:d,completeAnimation:x}})(),Ds=(function(){var t=(function(){var b=_t("canvas");b.width=1,b.height=1;var g=b.getContext("2d");return g.fillStyle="rgba(0,0,0,0)",g.fillRect(0,0,1,1),b})();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function s(b,g,u){var v="";if(b.e)v=b.p;else if(g){var _=b.p;_.indexOf("images/")!==-1&&(_=_.split("/")[1]),v=g+_}else v=u,v+=b.u?b.u:"",v+=b.p;return v}function n(b){var g=0,u=setInterval(function(){var v=b.getBBox();(v.width||g>500)&&(this._imageLoaded(),clearInterval(u)),g+=1}.bind(this),50)}function r(b){var g=s(b,this.assetsPath,this.path),u=N("image");Ms?this.testImageLoaded(u):u.addEventListener("load",this._imageLoaded,!1),u.addEventListener("error",function(){v.img=t,this._imageLoaded()}.bind(this),!1),u.setAttributeNS("http://www.w3.org/1999/xlink","href",g),this._elementHelper.append?this._elementHelper.append(u):this._elementHelper.appendChild(u);var v={img:u,assetData:b};return v}function a(b){var g=s(b,this.assetsPath,this.path),u=_t("img");u.crossOrigin="anonymous",u.addEventListener("load",this._imageLoaded,!1),u.addEventListener("error",function(){v.img=t,this._imageLoaded()}.bind(this),!1),u.src=g;var v={img:u,assetData:b};return v}function l(b){var g={assetData:b},u=s(b,this.assetsPath,this.path);return Se.loadData(u,function(v){g.img=v,this._footageLoaded()}.bind(this),function(){g.img={},this._footageLoaded()}.bind(this)),g}function o(b,g){this.imagesLoadedCb=g;var u,v=b.length;for(u=0;u<v;u+=1)b[u].layers||(!b[u].t||b[u].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(b[u]))):b[u].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(b[u]))))}function c(b){this.path=b||""}function d(b){this.assetsPath=b||""}function x(b){for(var g=0,u=this.images.length;g<u;){if(this.images[g].assetData===b)return this.images[g].img;g+=1}return null}function f(){this.imagesLoadedCb=null,this.images.length=0}function C(){return this.totalImages===this.loadedAssets}function S(){return this.totalFootages===this.loadedFootagesCount}function y(b,g){b==="svg"?(this._elementHelper=g,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function A(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=n.bind(this),this.createFootageData=l.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return A.prototype={loadAssets:o,setAssetsPath:d,setPath:c,loadedImages:C,loadedFootages:S,destroy:f,getAsset:x,createImgData:a,createImageData:r,imageLoaded:e,footageLoaded:i,setCacheType:y},A})();function Di(){}Di.prototype={triggerEvent:function(e,i){if(this._cbs[e])for(var s=this._cbs[e],n=0;n<s.length;n+=1)s[n](i)},addEventListener:function(e,i){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(i),function(){this.removeEventListener(e,i)}.bind(this)},removeEventListener:function(e,i){if(!i)this._cbs[e]=null;else if(this._cbs[e]){for(var s=0,n=this._cbs[e].length;s<n;)this._cbs[e][s]===i&&(this._cbs[e].splice(s,1),s-=1,n-=1),s+=1;this._cbs[e].length||(this._cbs[e]=null)}}};var Bs=(function(){function t(e){for(var i=e.split(`\r
|
|
1
|
+
import{g as Lr}from"./api-BsKbf3l3.js";function Ir(Ce,ze){for(var pe=0;pe<ze.length;pe++){const Mt=ze[pe];if(typeof Mt!="string"&&!Array.isArray(Mt)){for(const Xt in Mt)if(Xt!=="default"&&!(Xt in Ce)){const se=Object.getOwnPropertyDescriptor(Mt,Xt);se&&Object.defineProperty(Ce,Xt,se.get?se:{enumerable:!0,get:()=>Mt[Xt]})}}}return Object.freeze(Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"}))}var Be={exports:{}},Vr=Be.exports,Ss;function Rr(){return Ss||(Ss=1,(function(Ce,ze){typeof navigator<"u"&&(function(pe,Mt){Ce.exports=Mt()})(Vr,(function(){var pe="http://www.w3.org/2000/svg",Mt="",Xt=!1,se=-999999,xs=function(e){Xt=!!e},Ps=function(){return Xt},ws=function(e){Mt=e},bt=function(){return Mt};function _t(t){return document.createElement(t)}function Y(t,e){var i,s=t.length,n;for(i=0;i<s;i+=1){n=t[i].prototype;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e.prototype[r]=n[r])}}function As(t){function e(){}return e.prototype=t,e}var Ts=(function(){function t(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(i){this.audios.push(i)},pause:function(){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].pause()},resume:function(){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].resume()},setRate:function(i){var s,n=this.audios.length;for(s=0;s<n;s+=1)this.audios[s].setRate(i)},createAudio:function(i){return this.audioFactory?this.audioFactory(i):window.Howl?new window.Howl({src:[i]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(i){this.audioFactory=i},setVolume:function(i){this._volume=i,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var i,s=this.audios.length;for(i=0;i<s;i+=1)this.audios[i].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}})(),rt=(function(){function t(i,s){var n=0,r=[],a;switch(i){case"int16":case"uint8c":a=1;break;default:a=1.1;break}for(n=0;n<s;n+=1)r.push(a);return r}function e(i,s){return i==="float32"?new Float32Array(s):i==="int16"?new Int16Array(s):i==="uint8c"?new Uint8ClampedArray(s):t(i,s)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:t})();function $(t){return Array.apply(null,{length:t})}var Pi=!0,wi=null,Ai="",Ms=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Et=Math.pow,Ti=Math.sqrt,pt=Math.floor,Es=Math.min,Mi=150,tt=Math.PI/180,Ht=.5519;function ai(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function Ei(t,e){this.type=t,this.direction=e<0?-1:1}function Fi(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function Li(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function Ii(t,e){this.type=t,this.target=e}function Fs(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function Ls(t){this.type="configError",this.nativeError=t}var vt=(function(){var t=0;return function(){return t+=1,Ai+"__lottie_element_"+t}})();function oi(t,e,i){var s,n,r,a,l,o,c,d;switch(a=Math.floor(t*6),l=t*6-a,o=i*(1-e),c=i*(1-l*e),d=i*(1-(1-l)*e),a%6){case 0:s=i,n=d,r=o;break;case 1:s=c,n=i,r=o;break;case 2:s=o,n=i,r=d;break;case 3:s=o,n=c,r=i;break;case 4:s=d,n=o,r=i;break;case 5:s=i,n=o,r=c;break}return[s,n,r]}function hi(t,e,i){var s=Math.max(t,e,i),n=Math.min(t,e,i),r=s-n,a,l=s===0?0:r/s,o=s/255;switch(s){case n:a=0;break;case t:a=e-i+r*(e<i?6:0),a/=6*r;break;case e:a=i-t+r*2,a/=6*r;break;case i:a=t-e+r*4,a/=6*r;break}return[a,l,o]}function Vi(t,e){var i=hi(t[0]*255,t[1]*255,t[2]*255);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),oi(i[0],i[1],i[2])}function Ri(t,e){var i=hi(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),oi(i[0],i[1],i[2])}function Oi(t,e){var i=hi(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),oi(i[0],i[1],i[2])}(function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(s,n,r){return s<0&&(s=0),n<0&&(n=0),r<0&&(r=0),"#"+t[s]+t[n]+t[r]}})();var Is=function(e){Pi=!!e},Vs=function(){return Pi},Rs=function(e){wi=e},qe=function(){return wi},Ne=function(e){Mi=e},We=function(){return Mi},Os=function(e){Ai=e};function N(t){return document.createElementNS(pe,t)}function je(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?je=function(i){return typeof i}:je=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},je(t)}var Se=(function(){var t=1,e=[],i,s,n={onmessage:function(){},postMessage:function(C){i({data:C})}},r={postMessage:function(C){n.onmessage({data:C})}};function a(f){if(window.Worker&&window.Blob&&Ps()){var C=new Blob(["var _workerSelf = self; self.onmessage = ",f.toString()],{type:"text/javascript"}),S=URL.createObjectURL(C);return new Worker(S)}return i=f,n}function l(){s||(s=a(function(C){function S(){function A(F,m){var k,h,p=F.length,E,w,R,q;for(h=0;h<p;h+=1)if(k=F[h],"ks"in k&&!k.completed){if(k.completed=!0,k.hasMask){var j=k.masksProperties;for(w=j.length,E=0;E<w;E+=1)if(j[E].pt.k.i)_(j[E].pt.k);else for(q=j[E].pt.k.length,R=0;R<q;R+=1)j[E].pt.k[R].s&&_(j[E].pt.k[R].s[0]),j[E].pt.k[R].e&&_(j[E].pt.k[R].e[0])}k.ty===0?(k.layers=u(k.refId,m),A(k.layers,m)):k.ty===4?v(k.shapes):k.ty===5&&G(k)}}function b(F,m){if(F){var k=0,h=F.length;for(k=0;k<h;k+=1)F[k].t===1&&(F[k].data.layers=u(F[k].data.refId,m),A(F[k].data.layers,m))}}function g(F,m){for(var k=0,h=m.length;k<h;){if(m[k].id===F)return m[k];k+=1}return null}function u(F,m){var k=g(F,m);return k?k.layers.__used?JSON.parse(JSON.stringify(k.layers)):(k.layers.__used=!0,k.layers):null}function v(F){var m,k=F.length,h,p;for(m=k-1;m>=0;m-=1)if(F[m].ty==="sh")if(F[m].ks.k.i)_(F[m].ks.k);else for(p=F[m].ks.k.length,h=0;h<p;h+=1)F[m].ks.k[h].s&&_(F[m].ks.k[h].s[0]),F[m].ks.k[h].e&&_(F[m].ks.k[h].e[0]);else F[m].ty==="gr"&&v(F[m].it)}function _(F){var m,k=F.i.length;for(m=0;m<k;m+=1)F.i[m][0]+=F.v[m][0],F.i[m][1]+=F.v[m][1],F.o[m][0]+=F.v[m][0],F.o[m][1]+=F.v[m][1]}function P(F,m){var k=m?m.split("."):[100,100,100];return F[0]>k[0]?!0:k[0]>F[0]?!1:F[1]>k[1]?!0:k[1]>F[1]?!1:F[2]>k[2]?!0:k[2]>F[2]?!1:null}var T=(function(){var F=[4,4,14];function m(h){var p=h.t.d;h.t.d={k:[{s:p,t:0}]}}function k(h){var p,E=h.length;for(p=0;p<E;p+=1)h[p].ty===5&&m(h[p])}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})(),M=(function(){var F=[4,7,99];return function(m){if(m.chars&&!P(F,m.v)){var k,h=m.chars.length;for(k=0;k<h;k+=1){var p=m.chars[k];p.data&&p.data.shapes&&(v(p.data.shapes),p.data.ip=0,p.data.op=99999,p.data.st=0,p.data.sr=1,p.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},m.chars[k].t||(p.data.shapes.push({ty:"no"}),p.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}})(),L=(function(){var F=[5,7,15];function m(h){var p=h.t.p;typeof p.a=="number"&&(p.a={a:0,k:p.a}),typeof p.p=="number"&&(p.p={a:0,k:p.p}),typeof p.r=="number"&&(p.r={a:0,k:p.r})}function k(h){var p,E=h.length;for(p=0;p<E;p+=1)h[p].ty===5&&m(h[p])}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})(),W=(function(){var F=[4,1,9];function m(h){var p,E=h.length,w,R;for(p=0;p<E;p+=1)if(h[p].ty==="gr")m(h[p].it);else if(h[p].ty==="fl"||h[p].ty==="st")if(h[p].c.k&&h[p].c.k[0].i)for(R=h[p].c.k.length,w=0;w<R;w+=1)h[p].c.k[w].s&&(h[p].c.k[w].s[0]/=255,h[p].c.k[w].s[1]/=255,h[p].c.k[w].s[2]/=255,h[p].c.k[w].s[3]/=255),h[p].c.k[w].e&&(h[p].c.k[w].e[0]/=255,h[p].c.k[w].e[1]/=255,h[p].c.k[w].e[2]/=255,h[p].c.k[w].e[3]/=255);else h[p].c.k[0]/=255,h[p].c.k[1]/=255,h[p].c.k[2]/=255,h[p].c.k[3]/=255}function k(h){var p,E=h.length;for(p=0;p<E;p+=1)h[p].ty===4&&m(h[p].shapes)}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})(),B=(function(){var F=[4,4,18];function m(h){var p,E=h.length,w,R;for(p=E-1;p>=0;p-=1)if(h[p].ty==="sh")if(h[p].ks.k.i)h[p].ks.k.c=h[p].closed;else for(R=h[p].ks.k.length,w=0;w<R;w+=1)h[p].ks.k[w].s&&(h[p].ks.k[w].s[0].c=h[p].closed),h[p].ks.k[w].e&&(h[p].ks.k[w].e[0].c=h[p].closed);else h[p].ty==="gr"&&m(h[p].it)}function k(h){var p,E,w=h.length,R,q,j,X;for(E=0;E<w;E+=1){if(p=h[E],p.hasMask){var H=p.masksProperties;for(q=H.length,R=0;R<q;R+=1)if(H[R].pt.k.i)H[R].pt.k.c=H[R].cl;else for(X=H[R].pt.k.length,j=0;j<X;j+=1)H[R].pt.k[j].s&&(H[R].pt.k[j].s[0].c=H[R].cl),H[R].pt.k[j].e&&(H[R].pt.k[j].e[0].c=H[R].cl)}p.ty===4&&m(p.shapes)}}return function(h){if(P(F,h.v)&&(k(h.layers),h.assets)){var p,E=h.assets.length;for(p=0;p<E;p+=1)h.assets[p].layers&&k(h.assets[p].layers)}}})();function V(F){F.__complete||(W(F),T(F),M(F),L(F),B(F),A(F.layers,F.assets),b(F.chars,F.assets),F.__complete=!0)}function G(F){F.t.a.length===0&&"m"in F.t.p}var O={};return O.completeData=V,O.checkColors=W,O.checkChars=M,O.checkPathProperties=L,O.checkShapes=B,O.completeLayers=A,O}if(r.dataManager||(r.dataManager=S()),r.assetLoader||(r.assetLoader=(function(){function A(g){var u=g.getResponseHeader("content-type");return u&&g.responseType==="json"&&u.indexOf("json")!==-1||g.response&&je(g.response)==="object"?g.response:g.response&&typeof g.response=="string"?JSON.parse(g.response):g.responseText?JSON.parse(g.responseText):null}function b(g,u,v,_){var P,T=new XMLHttpRequest;try{T.responseType="json"}catch{}T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200)P=A(T),v(P);else try{P=A(T),v(P)}catch(M){_&&_(M)}};try{T.open(["G","E","T"].join(""),g,!0)}catch{T.open(["G","E","T"].join(""),u+"/"+g,!0)}T.send()}return{load:b}})()),C.data.type==="loadAnimation")r.assetLoader.load(C.data.path,C.data.fullPath,function(A){r.dataManager.completeData(A),r.postMessage({id:C.data.id,payload:A,status:"success"})},function(){r.postMessage({id:C.data.id,status:"error"})});else if(C.data.type==="complete"){var y=C.data.animation;r.dataManager.completeData(y),r.postMessage({id:C.data.id,payload:y,status:"success"})}else C.data.type==="loadData"&&r.assetLoader.load(C.data.path,C.data.fullPath,function(A){r.postMessage({id:C.data.id,payload:A,status:"success"})},function(){r.postMessage({id:C.data.id,status:"error"})})}),s.onmessage=function(f){var C=f.data,S=C.id,y=e[S];e[S]=null,C.status==="success"?y.onComplete(C.payload):y.onError&&y.onError()})}function o(f,C){t+=1;var S="processId_"+t;return e[S]={onComplete:f,onError:C},S}function c(f,C,S){l();var y=o(C,S);s.postMessage({type:"loadAnimation",path:f,fullPath:window.location.origin+window.location.pathname,id:y})}function d(f,C,S){l();var y=o(C,S);s.postMessage({type:"loadData",path:f,fullPath:window.location.origin+window.location.pathname,id:y})}function x(f,C,S){l();var y=o(C,S);s.postMessage({type:"complete",animation:f,id:y})}return{loadAnimation:c,loadData:d,completeAnimation:x}})(),Ds=(function(){var t=(function(){var b=_t("canvas");b.width=1,b.height=1;var g=b.getContext("2d");return g.fillStyle="rgba(0,0,0,0)",g.fillRect(0,0,1,1),b})();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function s(b,g,u){var v="";if(b.e)v=b.p;else if(g){var _=b.p;_.indexOf("images/")!==-1&&(_=_.split("/")[1]),v=g+_}else v=u,v+=b.u?b.u:"",v+=b.p;return v}function n(b){var g=0,u=setInterval(function(){var v=b.getBBox();(v.width||g>500)&&(this._imageLoaded(),clearInterval(u)),g+=1}.bind(this),50)}function r(b){var g=s(b,this.assetsPath,this.path),u=N("image");Ms?this.testImageLoaded(u):u.addEventListener("load",this._imageLoaded,!1),u.addEventListener("error",function(){v.img=t,this._imageLoaded()}.bind(this),!1),u.setAttributeNS("http://www.w3.org/1999/xlink","href",g),this._elementHelper.append?this._elementHelper.append(u):this._elementHelper.appendChild(u);var v={img:u,assetData:b};return v}function a(b){var g=s(b,this.assetsPath,this.path),u=_t("img");u.crossOrigin="anonymous",u.addEventListener("load",this._imageLoaded,!1),u.addEventListener("error",function(){v.img=t,this._imageLoaded()}.bind(this),!1),u.src=g;var v={img:u,assetData:b};return v}function l(b){var g={assetData:b},u=s(b,this.assetsPath,this.path);return Se.loadData(u,function(v){g.img=v,this._footageLoaded()}.bind(this),function(){g.img={},this._footageLoaded()}.bind(this)),g}function o(b,g){this.imagesLoadedCb=g;var u,v=b.length;for(u=0;u<v;u+=1)b[u].layers||(!b[u].t||b[u].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(b[u]))):b[u].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(b[u]))))}function c(b){this.path=b||""}function d(b){this.assetsPath=b||""}function x(b){for(var g=0,u=this.images.length;g<u;){if(this.images[g].assetData===b)return this.images[g].img;g+=1}return null}function f(){this.imagesLoadedCb=null,this.images.length=0}function C(){return this.totalImages===this.loadedAssets}function S(){return this.totalFootages===this.loadedFootagesCount}function y(b,g){b==="svg"?(this._elementHelper=g,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function A(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=n.bind(this),this.createFootageData=l.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return A.prototype={loadAssets:o,setAssetsPath:d,setPath:c,loadedImages:C,loadedFootages:S,destroy:f,getAsset:x,createImgData:a,createImageData:r,imageLoaded:e,footageLoaded:i,setCacheType:y},A})();function Di(){}Di.prototype={triggerEvent:function(e,i){if(this._cbs[e])for(var s=this._cbs[e],n=0;n<s.length;n+=1)s[n](i)},addEventListener:function(e,i){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(i),function(){this.removeEventListener(e,i)}.bind(this)},removeEventListener:function(e,i){if(!i)this._cbs[e]=null;else if(this._cbs[e]){for(var s=0,n=this._cbs[e].length;s<n;)this._cbs[e][s]===i&&(this._cbs[e].splice(s,1),s-=1,n-=1),s+=1;this._cbs[e].length||(this._cbs[e]=null)}}};var Bs=(function(){function t(e){for(var i=e.split(`\r
|
|
2
2
|
`),s={},n,r=0,a=0;a<i.length;a+=1)n=i[a].split(":"),n.length===2&&(s[n[0]]=n[1].trim(),r+=1);if(r===0)throw new Error;return s}return function(e){for(var i=[],s=0;s<e.length;s+=1){var n=e[s],r={time:n.tm,duration:n.dr};try{r.payload=JSON.parse(e[s].cm)}catch{try{r.payload=t(e[s].cm)}catch{r.payload={name:e[s].cm}}}i.push(r)}return i}})(),zs=(function(){function t(e){this.compositions.push(e)}return function(){function e(i){for(var s=0,n=this.compositions.length;s<n;){if(this.compositions[s].data&&this.compositions[s].data.nm===i)return this.compositions[s].prepareFrame&&this.compositions[s].data.xt&&this.compositions[s].prepareFrame(this.currentFrame),this.compositions[s].compInterface;s+=1}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}})(),ke={},qs=function(e,i){ke[e]=i};function Ns(t){return ke[t]}function Ws(){if(ke.canvas)return"canvas";for(var t in ke)if(ke[t])return t;return""}function xe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xe=function(i){return typeof i}:xe=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},xe(t)}var z=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=vt(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=Vs(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=zs(),this.imagePreloader=new Ds,this.audioController=Ts(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new ai("drawnFrame",0,0,0),this.expressionsPlugin=qe()};Y([Di],z),z.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var i=Ns(e);this.renderer=new i(this,t.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,t.loop===""||t.loop===null||t.loop===void 0||t.loop===!0?this.loop=!0:t.loop===!1?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(t,"autoloadSegments")?t.autoloadSegments:!0,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(t.path.lastIndexOf("\\")!==-1?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),Se.loadAnimation(t.path,this.configAnimation,this.onSetupError))},z.prototype.onSetupError=function(){this.trigger("data_failed")},z.prototype.setupAnimation=function(t){Se.completeAnimation(t,this.configAnimation)},z.prototype.setData=function(t,e){e&&xe(e)!=="object"&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},s=t.attributes;i.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",i.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:Ws()||"canvas";var n=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";n==="false"?i.loop=!1:n==="true"?i.loop=!0:n!==""&&(i.loop=parseInt(n,10));var r=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:s.getNamedItem("bm-autoplay")?s.getNamedItem("bm-autoplay").value:!0;i.autoplay=r!=="false",i.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"";var a=s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"";a==="false"&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")},z.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,n=t.layers,r,a=n.length;for(r=0;r<a;r+=1)for(i=0;i<s;){if(e[i].id===n[r].id){e[i]=n[r];break}i+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,i=0;i<s;i+=1)this.animationData.assets.push(t.assets[i]);this.animationData.__complete=!1,Se.completeAnimation(this.animationData,this.onSegmentComplete)},z.prototype.onSegmentComplete=function(t){this.animationData=t;var e=qe();e&&e.initExpressions(this),this.loadNextSegment()},z.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||t.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,Se.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},z.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},z.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},z.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},z.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.markers=Bs(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},z.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},z.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=qe();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},z.prototype.resize=function(t,e){var i=typeof t=="number"?t:void 0,s=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(i,s)},z.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},z.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},z.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},z.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},z.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},z.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause())},z.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},z.prototype.getMarkerData=function(t){for(var e,i=0;i<this.markers.length;i+=1)if(e=this.markers[i],e.payload&&e.payload.name===t)return e;return null},z.prototype.goToAndStop=function(t,e,i){if(!(i&&this.name!==i)){var s=Number(t);if(isNaN(s)){var n=this.getMarkerData(t);n&&this.goToAndStop(n.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},z.prototype.goToAndPlay=function(t,e,i){if(!(i&&this.name!==i)){var s=Number(t);if(isNaN(s)){var n=this.getMarkerData(t);n&&(n.duration?this.playSegments([n.time,n.time+n.duration],!0):this.goToAndStop(n.time,!0))}else this.goToAndStop(s,e,i);this.play()}},z.prototype.advanceTime=function(t){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},z.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},z.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0)},z.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),xe(t[0])==="object"){var i,s=t.length;for(i=0;i<s;i+=1)this.segments.push(t[i])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},z.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},z.prototype.checkSegments=function(t){return this.segments.length?(this.adjustSegment(this.segments.shift(),t),!0):!1},z.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},z.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},z.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},z.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},z.prototype.setLoop=function(t){this.loop=t},z.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},z.prototype.getVolume=function(){return this.audioController.getVolume()},z.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},z.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},z.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},z.prototype.getPath=function(){return this.path},z.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;i.indexOf("images/")!==-1&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},z.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},z.prototype.hide=function(){this.renderer.hide()},z.prototype.show=function(){this.renderer.show()},z.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},z.prototype.updateDocumentData=function(t,e,i){try{var s=this.renderer.getElementByPath(t);s.updateDocumentData(e,i)}catch{}},z.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new ai(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(t,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(t,new Fi(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new Ei(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new Li(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new Ii(t,this));break;default:this.triggerEvent(t)}t==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new ai(t,this.currentFrame,this.totalFrames,this.frameMult)),t==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new Fi(t,this.loop,this.playCount,this.frameMult)),t==="complete"&&this.onComplete&&this.onComplete.call(this,new Ei(t,this.frameMult)),t==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new Li(t,this.firstFrame,this.totalFrames)),t==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new Ii(t,this))},z.prototype.triggerRenderFrameError=function(t){var e=new Fs(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},z.prototype.triggerConfigError=function(t){var e=new Ls(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var nt=(function(){var t={},e=[],i=0,s=0,n=0,r=!0,a=!1;function l(m){for(var k=0,h=m.target;k<s;)e[k].animation===h&&(e.splice(k,1),k-=1,s-=1,h.isPaused||x()),k+=1}function o(m,k){if(!m)return null;for(var h=0;h<s;){if(e[h].elem===m&&e[h].elem!==null)return e[h].animation;h+=1}var p=new z;return f(p,m),p.setData(m,k),p}function c(){var m,k=e.length,h=[];for(m=0;m<k;m+=1)h.push(e[m].animation);return h}function d(){n+=1,W()}function x(){n-=1}function f(m,k){m.addEventListener("destroy",l),m.addEventListener("_active",d),m.addEventListener("_idle",x),e.push({elem:k,animation:m}),s+=1}function C(m){var k=new z;return f(k,null),k.setParams(m),k}function S(m,k){var h;for(h=0;h<s;h+=1)e[h].animation.setSpeed(m,k)}function y(m,k){var h;for(h=0;h<s;h+=1)e[h].animation.setDirection(m,k)}function A(m){var k;for(k=0;k<s;k+=1)e[k].animation.play(m)}function b(m){var k=m-i,h;for(h=0;h<s;h+=1)e[h].animation.advanceTime(k);i=m,n&&!a?window.requestAnimationFrame(b):r=!0}function g(m){i=m,window.requestAnimationFrame(b)}function u(m){var k;for(k=0;k<s;k+=1)e[k].animation.pause(m)}function v(m,k,h){var p;for(p=0;p<s;p+=1)e[p].animation.goToAndStop(m,k,h)}function _(m){var k;for(k=0;k<s;k+=1)e[k].animation.stop(m)}function P(m){var k;for(k=0;k<s;k+=1)e[k].animation.togglePause(m)}function T(m){var k;for(k=s-1;k>=0;k-=1)e[k].animation.destroy(m)}function M(m,k,h){var p=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),E,w=p.length;for(E=0;E<w;E+=1)h&&p[E].setAttribute("data-bm-type",h),o(p[E],m);if(k&&w===0){h||(h="svg");var R=document.getElementsByTagName("body")[0];R.innerText="";var q=_t("div");q.style.width="100%",q.style.height="100%",q.setAttribute("data-bm-type",h),R.appendChild(q),o(q,m)}}function L(){var m;for(m=0;m<s;m+=1)e[m].animation.resize()}function W(){!a&&n&&r&&(window.requestAnimationFrame(g),r=!1)}function B(){a=!0}function V(){a=!1,W()}function G(m,k){var h;for(h=0;h<s;h+=1)e[h].animation.setVolume(m,k)}function O(m){var k;for(k=0;k<s;k+=1)e[k].animation.mute(m)}function F(m){var k;for(k=0;k<s;k+=1)e[k].animation.unmute(m)}return t.registerAnimation=o,t.loadAnimation=C,t.setSpeed=S,t.setDirection=y,t.play=A,t.pause=u,t.stop=_,t.togglePause=P,t.searchAnimations=M,t.resize=L,t.goToAndStop=v,t.destroy=T,t.freeze=B,t.unfreeze=V,t.setVolume=G,t.mute=O,t.unmute=F,t.getRegisteredAnimations=c,t})(),Pe=(function(){var t={};t.getBezierEasing=i;var e={};function i(g,u,v,_,P){var T=P||("bez_"+g+"_"+u+"_"+v+"_"+_).replace(/\./g,"p");if(e[T])return e[T];var M=new b([g,u,v,_]);return e[T]=M,M}var s=4,n=.001,r=1e-7,a=10,l=11,o=1/(l-1),c=typeof Float32Array=="function";function d(g,u){return 1-3*u+3*g}function x(g,u){return 3*u-6*g}function f(g){return 3*g}function C(g,u,v){return((d(u,v)*g+x(u,v))*g+f(u))*g}function S(g,u,v){return 3*d(u,v)*g*g+2*x(u,v)*g+f(u)}function y(g,u,v,_,P){var T,M,L=0;do M=u+(v-u)/2,T=C(M,_,P)-g,T>0?v=M:u=M;while(Math.abs(T)>r&&++L<a);return M}function A(g,u,v,_){for(var P=0;P<s;++P){var T=S(u,v,_);if(T===0)return u;var M=C(u,v,_)-g;u-=M/T}return u}function b(g){this._p=g,this._mSampleValues=c?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return b.prototype={get:function(u){var v=this._p[0],_=this._p[1],P=this._p[2],T=this._p[3];return this._precomputed||this._precompute(),v===_&&P===T?u:u===0?0:u===1?1:C(this._getTForX(u),_,T)},_precompute:function(){var u=this._p[0],v=this._p[1],_=this._p[2],P=this._p[3];this._precomputed=!0,(u!==v||_!==P)&&this._calcSampleValues()},_calcSampleValues:function(){for(var u=this._p[0],v=this._p[2],_=0;_<l;++_)this._mSampleValues[_]=C(_*o,u,v)},_getTForX:function(u){for(var v=this._p[0],_=this._p[2],P=this._mSampleValues,T=0,M=1,L=l-1;M!==L&&P[M]<=u;++M)T+=o;--M;var W=(u-P[M])/(P[M+1]-P[M]),B=T+W*o,V=S(B,v,_);return V>=n?A(u,B,v,_):V===0?B:y(u,T,T+o,v,_)}},t})(),Bi=(function(){function t(e){return e.concat($(e.length))}return{double:t}})(),Ge=(function(){return function(t,e,i){var s=0,n=t,r=$(n),a={newElement:l,release:o};function l(){var c;return s?(s-=1,c=r[s]):c=e(),c}function o(c){s===n&&(r=Bi.double(r),n*=2),i&&i(c),r[s]=c,s+=1}return a}})(),zi=(function(){function t(){return{addedLength:0,percents:rt("float32",We()),lengths:rt("float32",We())}}return Ge(8,t)})(),qi=(function(){function t(){return{lengths:[],totalLength:0}}function e(i){var s,n=i.lengths.length;for(s=0;s<n;s+=1)zi.release(i.lengths[s]);i.lengths.length=0}return Ge(8,t,e)})();function js(){var t=Math;function e(f,C,S,y,A,b){var g=f*y+C*A+S*b-A*y-b*f-S*C;return g>-.001&&g<.001}function i(f,C,S,y,A,b,g,u,v){if(S===0&&b===0&&v===0)return e(f,C,y,A,g,u);var _=t.sqrt(t.pow(y-f,2)+t.pow(A-C,2)+t.pow(b-S,2)),P=t.sqrt(t.pow(g-f,2)+t.pow(u-C,2)+t.pow(v-S,2)),T=t.sqrt(t.pow(g-y,2)+t.pow(u-A,2)+t.pow(v-b,2)),M;return _>P?_>T?M=_-P-T:M=T-P-_:T>P?M=T-P-_:M=P-_-T,M>-1e-4&&M<1e-4}var s=(function(){return function(f,C,S,y){var A=We(),b,g,u,v,_,P=0,T,M=[],L=[],W=zi.newElement();for(u=S.length,b=0;b<A;b+=1){for(_=b/(A-1),T=0,g=0;g<u;g+=1)v=Et(1-_,3)*f[g]+3*Et(1-_,2)*_*S[g]+3*(1-_)*Et(_,2)*y[g]+Et(_,3)*C[g],M[g]=v,L[g]!==null&&(T+=Et(M[g]-L[g],2)),L[g]=M[g];T&&(T=Ti(T),P+=T),W.percents[b]=_,W.lengths[b]=P}return W.addedLength=P,W}})();function n(f){var C=qi.newElement(),S=f.c,y=f.v,A=f.o,b=f.i,g,u=f._length,v=C.lengths,_=0;for(g=0;g<u-1;g+=1)v[g]=s(y[g],y[g+1],A[g],b[g+1]),_+=v[g].addedLength;return S&&u&&(v[g]=s(y[g],y[0],A[g],b[0]),_+=v[g].addedLength),C.totalLength=_,C}function r(f){this.segmentLength=0,this.points=new Array(f)}function a(f,C){this.partialLength=f,this.point=C}var l=(function(){var f={};return function(C,S,y,A){var b=(C[0]+"_"+C[1]+"_"+S[0]+"_"+S[1]+"_"+y[0]+"_"+y[1]+"_"+A[0]+"_"+A[1]).replace(/\./g,"p");if(!f[b]){var g=We(),u,v,_,P,T,M=0,L,W,B=null;C.length===2&&(C[0]!==S[0]||C[1]!==S[1])&&e(C[0],C[1],S[0],S[1],C[0]+y[0],C[1]+y[1])&&e(C[0],C[1],S[0],S[1],S[0]+A[0],S[1]+A[1])&&(g=2);var V=new r(g);for(_=y.length,u=0;u<g;u+=1){for(W=$(_),T=u/(g-1),L=0,v=0;v<_;v+=1)P=Et(1-T,3)*C[v]+3*Et(1-T,2)*T*(C[v]+y[v])+3*(1-T)*Et(T,2)*(S[v]+A[v])+Et(T,3)*S[v],W[v]=P,B!==null&&(L+=Et(W[v]-B[v],2));L=Ti(L),M+=L,V.points[u]=new a(L,W),B=W}V.segmentLength=M,f[b]=V}return f[b]}})();function o(f,C){var S=C.percents,y=C.lengths,A=S.length,b=pt((A-1)*f),g=f*C.addedLength,u=0;if(b===A-1||b===0||g===y[b])return S[b];for(var v=y[b]>g?-1:1,_=!0;_;)if(y[b]<=g&&y[b+1]>g?(u=(g-y[b])/(y[b+1]-y[b]),_=!1):b+=v,b<0||b>=A-1){if(b===A-1)return S[b];_=!1}return S[b]+(S[b+1]-S[b])*u}function c(f,C,S,y,A,b){var g=o(A,b),u=1-g,v=t.round((u*u*u*f[0]+(g*u*u+u*g*u+u*u*g)*S[0]+(g*g*u+u*g*g+g*u*g)*y[0]+g*g*g*C[0])*1e3)/1e3,_=t.round((u*u*u*f[1]+(g*u*u+u*g*u+u*u*g)*S[1]+(g*g*u+u*g*g+g*u*g)*y[1]+g*g*g*C[1])*1e3)/1e3;return[v,_]}var d=rt("float32",8);function x(f,C,S,y,A,b,g){A<0?A=0:A>1&&(A=1);var u=o(A,g);b=b>1?1:b;var v=o(b,g),_,P=f.length,T=1-u,M=1-v,L=T*T*T,W=u*T*T*3,B=u*u*T*3,V=u*u*u,G=T*T*M,O=u*T*M+T*u*M+T*T*v,F=u*u*M+T*u*v+u*T*v,m=u*u*v,k=T*M*M,h=u*M*M+T*v*M+T*M*v,p=u*v*M+T*v*v+u*M*v,E=u*v*v,w=M*M*M,R=v*M*M+M*v*M+M*M*v,q=v*v*M+M*v*v+v*M*v,j=v*v*v;for(_=0;_<P;_+=1)d[_*4]=t.round((L*f[_]+W*S[_]+B*y[_]+V*C[_])*1e3)/1e3,d[_*4+1]=t.round((G*f[_]+O*S[_]+F*y[_]+m*C[_])*1e3)/1e3,d[_*4+2]=t.round((k*f[_]+h*S[_]+p*y[_]+E*C[_])*1e3)/1e3,d[_*4+3]=t.round((w*f[_]+R*S[_]+q*y[_]+j*C[_])*1e3)/1e3;return d}return{getSegmentsLength:n,getNewSegment:x,getPointInSegment:c,buildBezierData:l,pointOnLine2D:e,pointOnLine3D:i}}var Ft=js(),re=se,Ni=Math.abs;function Wi(t,e){var i=this.offsetTime,s;this.propType==="multidimensional"&&(s=rt("float32",this.pv.length));for(var n=e.lastIndex,r=n,a=this.keyframes.length-1,l=!0,o,c,d;l;){if(o=this.keyframes[r],c=this.keyframes[r+1],r===a-1&&t>=c.t-i){o.h&&(o=c),n=0;break}if(c.t-i>t){n=r;break}r<a-1?r+=1:(n=0,l=!1)}d=this.keyframesMetadata[r]||{};var x,f,C,S,y,A,b=c.t-i,g=o.t-i,u;if(o.to){d.bezierData||(d.bezierData=Ft.buildBezierData(o.s,c.s||o.e,o.to,o.ti));var v=d.bezierData;if(t>=b||t<g){var _=t>=b?v.points.length-1:0;for(f=v.points[_].point.length,x=0;x<f;x+=1)s[x]=v.points[_].point[x]}else{d.__fnct?A=d.__fnct:(A=Pe.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n).get,d.__fnct=A),C=A((t-g)/(b-g));var P=v.segmentLength*C,T,M=e.lastFrame<t&&e._lastKeyframeIndex===r?e._lastAddedLength:0;for(y=e.lastFrame<t&&e._lastKeyframeIndex===r?e._lastPoint:0,l=!0,S=v.points.length;l;){if(M+=v.points[y].partialLength,P===0||C===0||y===v.points.length-1){for(f=v.points[y].point.length,x=0;x<f;x+=1)s[x]=v.points[y].point[x];break}else if(P>=M&&P<M+v.points[y+1].partialLength){for(T=(P-M)/v.points[y+1].partialLength,f=v.points[y].point.length,x=0;x<f;x+=1)s[x]=v.points[y].point[x]+(v.points[y+1].point[x]-v.points[y].point[x])*T;break}y<S-1?y+=1:l=!1}e._lastPoint=y,e._lastAddedLength=M-v.points[y].partialLength,e._lastKeyframeIndex=r}}else{var L,W,B,V,G;if(a=o.s.length,u=c.s||o.e,this.sh&&o.h!==1)if(t>=b)s[0]=u[0],s[1]=u[1],s[2]=u[2];else if(t<=g)s[0]=o.s[0],s[1]=o.s[1],s[2]=o.s[2];else{var O=ji(o.s),F=ji(u),m=(t-g)/(b-g);Ys(s,Gs(O,F,m))}else for(r=0;r<a;r+=1)o.h!==1&&(t>=b?C=1:t<g?C=0:(o.o.x.constructor===Array?(d.__fnct||(d.__fnct=[]),d.__fnct[r]?A=d.__fnct[r]:(L=o.o.x[r]===void 0?o.o.x[0]:o.o.x[r],W=o.o.y[r]===void 0?o.o.y[0]:o.o.y[r],B=o.i.x[r]===void 0?o.i.x[0]:o.i.x[r],V=o.i.y[r]===void 0?o.i.y[0]:o.i.y[r],A=Pe.getBezierEasing(L,W,B,V).get,d.__fnct[r]=A)):d.__fnct?A=d.__fnct:(L=o.o.x,W=o.o.y,B=o.i.x,V=o.i.y,A=Pe.getBezierEasing(L,W,B,V).get,o.keyframeMetadata=A),C=A((t-g)/(b-g)))),u=c.s||o.e,G=o.h===1?o.s[r]:o.s[r]+(u[r]-o.s[r])*C,this.propType==="multidimensional"?s[r]=G:s=G}return e.lastIndex=n,s}function Gs(t,e,i){var s=[],n=t[0],r=t[1],a=t[2],l=t[3],o=e[0],c=e[1],d=e[2],x=e[3],f,C,S,y,A;return C=n*o+r*c+a*d+l*x,C<0&&(C=-C,o=-o,c=-c,d=-d,x=-x),1-C>1e-6?(f=Math.acos(C),S=Math.sin(f),y=Math.sin((1-i)*f)/S,A=Math.sin(i*f)/S):(y=1-i,A=i),s[0]=y*n+A*o,s[1]=y*r+A*c,s[2]=y*a+A*d,s[3]=y*l+A*x,s}function Ys(t,e){var i=e[0],s=e[1],n=e[2],r=e[3],a=Math.atan2(2*s*r-2*i*n,1-2*s*s-2*n*n),l=Math.asin(2*i*s+2*n*r),o=Math.atan2(2*i*r-2*s*n,1-2*i*i-2*n*n);t[0]=a/tt,t[1]=l/tt,t[2]=o/tt}function ji(t){var e=t[0]*tt,i=t[1]*tt,s=t[2]*tt,n=Math.cos(e/2),r=Math.cos(i/2),a=Math.cos(s/2),l=Math.sin(e/2),o=Math.sin(i/2),c=Math.sin(s/2),d=n*r*a-l*o*c,x=l*o*a+n*r*c,f=l*r*a+n*o*c,C=n*o*a-l*r*c;return[x,f,C,d]}function Gi(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==re&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function Ye(t){var e;if(this.propType==="unidimensional")e=t*this.mult,Ni(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i<s;)e=t[i]*this.mult,Ni(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function Xe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function He(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function Xs(t,e,i,s){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=Xe,this.setVValue=Ye,this.addEffect=He}function Hs(t,e,i,s){this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var n,r=e.k.length;for(this.v=rt("float32",r),this.pv=rt("float32",r),this.vel=rt("float32",r),n=0;n<r;n+=1)this.v[n]=e.k[n]*this.mult,this.pv[n]=e.k[n];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=Xe,this.setVValue=Ye,this.addEffect=He}function Js(t,e,i,s){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:re,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.v=re,this.pv=re,this._isFirstFrame=!0,this.getValue=Xe,this.setVValue=Ye,this.interpolateValue=Wi,this.effectsSequence=[Gi.bind(this)],this.addEffect=He}function Ks(t,e,i,s){this.propType="multidimensional";var n,r=e.k.length,a,l,o,c;for(n=0;n<r-1;n+=1)e.k[n].to&&e.k[n].s&&e.k[n+1]&&e.k[n+1].s&&(a=e.k[n].s,l=e.k[n+1].s,o=e.k[n].to,c=e.k[n].ti,(a.length===2&&!(a[0]===l[0]&&a[1]===l[1])&&Ft.pointOnLine2D(a[0],a[1],l[0],l[1],a[0]+o[0],a[1]+o[1])&&Ft.pointOnLine2D(a[0],a[1],l[0],l[1],l[0]+c[0],l[1]+c[1])||a.length===3&&!(a[0]===l[0]&&a[1]===l[1]&&a[2]===l[2])&&Ft.pointOnLine3D(a[0],a[1],a[2],l[0],l[1],l[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&Ft.pointOnLine3D(a[0],a[1],a[2],l[0],l[1],l[2],l[0]+c[0],l[1]+c[1],l[2]+c[2]))&&(e.k[n].to=null,e.k[n].ti=null),a[0]===l[0]&&a[1]===l[1]&&o[0]===0&&o[1]===0&&c[0]===0&&c[1]===0&&(a.length===2||a[2]===l[2]&&o[2]===0&&c[2]===0)&&(e.k[n].to=null,e.k[n].ti=null));this.effectsSequence=[Gi.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.getValue=Xe,this.setVValue=Ye,this.interpolateValue=Wi,this.frameId=-1;var d=e.k[0].s.length;for(this.v=rt("float32",d),this.pv=rt("float32",d),n=0;n<d;n+=1)this.v[n]=re,this.pv[n]=re;this._caching={lastFrame:re,lastIndex:0,value:rt("float32",d)},this.addEffect=He}var I=(function(){function t(i,s,n,r,a){s.sid&&(s=i.globalData.slotManager.getProp(s));var l;if(!s.k.length)l=new Xs(i,s,r,a);else if(typeof s.k[0]=="number")l=new Hs(i,s,r,a);else switch(n){case 0:l=new Js(i,s,r,a);break;case 1:l=new Ks(i,s,r,a);break}return l.effectsSequence.length&&a.addDynamicProperty(l),l}var e={getProp:t};return e})();function ht(){}ht.prototype={addDynamicProperty:function(e){this.dynamicProperties.indexOf(e)===-1&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var e,i=this.dynamicProperties.length;for(e=0;e<i;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var ne=(function(){function t(){return rt("float32",2)}return Ge(8,t)})();function qt(){this.c=!1,this._length=0,this._maxLength=8,this.v=$(this._maxLength),this.o=$(this._maxLength),this.i=$(this._maxLength)}qt.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=ne.newElement(),this.o[i]=ne.newElement(),this.i[i]=ne.newElement(),i+=1},qt.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},qt.prototype.doubleArrayLength=function(){this.v=this.v.concat($(this._maxLength)),this.i=this.i.concat($(this._maxLength)),this.o=this.o.concat($(this._maxLength)),this._maxLength*=2},qt.prototype.setXYAt=function(t,e,i,s,n){var r;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[];break}(!r[s]||r[s]&&!n)&&(r[s]=ne.newElement()),r[s][0]=t,r[s][1]=e},qt.prototype.setTripleAt=function(t,e,i,s,n,r,a,l){this.setXYAt(t,e,"v",a,l),this.setXYAt(i,s,"o",a,l),this.setXYAt(n,r,"i",a,l)},qt.prototype.reverse=function(){var t=new qt;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,n=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),n=1);var r=this._length-1,a=this._length,l;for(l=n;l<a;l+=1)t.setTripleAt(e[r][0],e[r][1],s[r][0],s[r][1],i[r][0],i[r][1],l,!1),r-=1;return t},qt.prototype.length=function(){return this._length};var ut=(function(){function t(){return new qt}function e(n){var r=n._length,a;for(a=0;a<r;a+=1)ne.release(n.v[a]),ne.release(n.i[a]),ne.release(n.o[a]),n.v[a]=null,n.i[a]=null,n.o[a]=null;n._length=0,n.c=!1}function i(n){var r=s.newElement(),a,l=n._length===void 0?n.v.length:n._length;for(r.setLength(l),r.c=n.c,a=0;a<l;a+=1)r.setTripleAt(n.v[a][0],n.v[a][1],n.o[a][0],n.o[a][1],n.i[a][0],n.i[a][1],a);return r}var s=Ge(4,t,e);return s.clone=i,s})();function li(){this._length=0,this._maxLength=4,this.shapes=$(this._maxLength)}li.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat($(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},li.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)ut.release(this.shapes[t]);this._length=0};var ue=(function(){var t={newShapeCollection:n,release:r},e=0,i=4,s=$(i);function n(){var a;return e?(e-=1,a=s[e]):a=new li,a}function r(a){var l,o=a._length;for(l=0;l<o;l+=1)ut.release(a.shapes[l]);a._length=0,e===i&&(s=Bi.double(s),i*=2),s[e]=a,e+=1}return t})(),ce=(function(){var t=-999999;function e(b,g,u){var v=u.lastIndex,_,P,T,M,L,W,B,V,G,O=this.keyframes;if(b<O[0].t-this.offsetTime)_=O[0].s[0],T=!0,v=0;else if(b>=O[O.length-1].t-this.offsetTime)_=O[O.length-1].s?O[O.length-1].s[0]:O[O.length-2].e[0],T=!0;else{for(var F=v,m=O.length-1,k=!0,h,p,E;k&&(h=O[F],p=O[F+1],!(p.t-this.offsetTime>b));)F<m-1?F+=1:k=!1;if(E=this.keyframesMetadata[F]||{},T=h.h===1,v=F,!T){if(b>=p.t-this.offsetTime)V=1;else if(b<h.t-this.offsetTime)V=0;else{var w;E.__fnct?w=E.__fnct:(w=Pe.getBezierEasing(h.o.x,h.o.y,h.i.x,h.i.y).get,E.__fnct=w),V=w((b-(h.t-this.offsetTime))/(p.t-this.offsetTime-(h.t-this.offsetTime)))}P=p.s?p.s[0]:h.e[0]}_=h.s[0]}for(W=g._length,B=_.i[0].length,u.lastIndex=v,M=0;M<W;M+=1)for(L=0;L<B;L+=1)G=T?_.i[M][L]:_.i[M][L]+(P.i[M][L]-_.i[M][L])*V,g.i[M][L]=G,G=T?_.o[M][L]:_.o[M][L]+(P.o[M][L]-_.o[M][L])*V,g.o[M][L]=G,G=T?_.v[M][L]:_.v[M][L]+(P.v[M][L]-_.v[M][L])*V,g.v[M][L]=G}function i(){var b=this.comp.renderedFrame-this.offsetTime,g=this.keyframes[0].t-this.offsetTime,u=this.keyframes[this.keyframes.length-1].t-this.offsetTime,v=this._caching.lastFrame;return v!==t&&(v<g&&b<g||v>u&&b>u)||(this._caching.lastIndex=v<b?this._caching.lastIndex:0,this.interpolateShape(b,this.pv,this._caching)),this._caching.lastFrame=b,this.pv}function s(){this.paths=this.localShapeCollection}function n(b,g){if(b._length!==g._length||b.c!==g.c)return!1;var u,v=b._length;for(u=0;u<v;u+=1)if(b.v[u][0]!==g.v[u][0]||b.v[u][1]!==g.v[u][1]||b.o[u][0]!==g.o[u][0]||b.o[u][1]!==g.o[u][1]||b.i[u][0]!==g.i[u][0]||b.i[u][1]!==g.i[u][1])return!1;return!0}function r(b){n(this.v,b)||(this.v=ut.clone(b),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var b;this.kf?b=this.pv:this.data.ks?b=this.data.ks.k:b=this.data.pt.k;var g,u=this.effectsSequence.length;for(g=0;g<u;g+=1)b=this.effectsSequence[g](b);this.setVValue(b),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function l(b,g,u){this.propType="shape",this.comp=b.comp,this.container=b,this.elem=b,this.data=g,this.k=!1,this.kf=!1,this._mdf=!1;var v=u===3?g.pt.k:g.ks.k;this.v=ut.clone(v),this.pv=ut.clone(this.v),this.localShapeCollection=ue.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=s,this.effectsSequence=[]}function o(b){this.effectsSequence.push(b),this.container.addDynamicProperty(this)}l.prototype.interpolateShape=e,l.prototype.getValue=a,l.prototype.setVValue=r,l.prototype.addEffect=o;function c(b,g,u){this.propType="shape",this.comp=b.comp,this.elem=b,this.container=b,this.offsetTime=b.data.st,this.keyframes=u===3?g.pt.k:g.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var v=this.keyframes[0].s[0].i.length;this.v=ut.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,v),this.pv=ut.clone(this.v),this.localShapeCollection=ue.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=t,this.reset=s,this._caching={lastFrame:t,lastIndex:0},this.effectsSequence=[i.bind(this)]}c.prototype.getValue=a,c.prototype.interpolateShape=e,c.prototype.setVValue=r,c.prototype.addEffect=o;var d=(function(){var b=Ht;function g(u,v){this.v=ut.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=ue.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=v.d,this.elem=u,this.comp=u.comp,this.frameId=-1,this.initDynamicPropertyContainer(u),this.p=I.getProp(u,v.p,1,0,this),this.s=I.getProp(u,v.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return g.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var v=this.p.v[0],_=this.p.v[1],P=this.s.v[0]/2,T=this.s.v[1]/2,M=this.d!==3,L=this.v;L.v[0][0]=v,L.v[0][1]=_-T,L.v[1][0]=M?v+P:v-P,L.v[1][1]=_,L.v[2][0]=v,L.v[2][1]=_+T,L.v[3][0]=M?v-P:v+P,L.v[3][1]=_,L.i[0][0]=M?v-P*b:v+P*b,L.i[0][1]=_-T,L.i[1][0]=M?v+P:v-P,L.i[1][1]=_-T*b,L.i[2][0]=M?v+P*b:v-P*b,L.i[2][1]=_+T,L.i[3][0]=M?v-P:v+P,L.i[3][1]=_+T*b,L.o[0][0]=M?v+P*b:v-P*b,L.o[0][1]=_-T,L.o[1][0]=M?v+P:v-P,L.o[1][1]=_+T*b,L.o[2][0]=M?v-P*b:v+P*b,L.o[2][1]=_+T,L.o[3][0]=M?v-P:v+P,L.o[3][1]=_-T*b}},Y([ht],g),g})(),x=(function(){function b(g,u){this.v=ut.newElement(),this.v.setPathData(!0,0),this.elem=g,this.comp=g.comp,this.data=u,this.frameId=-1,this.d=u.d,this.initDynamicPropertyContainer(g),u.sy===1?(this.ir=I.getProp(g,u.ir,0,0,this),this.is=I.getProp(g,u.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=I.getProp(g,u.pt,0,0,this),this.p=I.getProp(g,u.p,1,0,this),this.r=I.getProp(g,u.r,0,tt,this),this.or=I.getProp(g,u.or,0,0,this),this.os=I.getProp(g,u.os,0,.01,this),this.localShapeCollection=ue.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return b.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var u=Math.floor(this.pt.v)*2,v=Math.PI*2/u,_=!0,P=this.or.v,T=this.ir.v,M=this.os.v,L=this.is.v,W=2*Math.PI*P/(u*2),B=2*Math.PI*T/(u*2),V,G,O,F,m=-Math.PI/2;m+=this.r.v;var k=this.data.d===3?-1:1;for(this.v._length=0,V=0;V<u;V+=1){G=_?P:T,O=_?M:L,F=_?W:B;var h=G*Math.cos(m),p=G*Math.sin(m),E=h===0&&p===0?0:p/Math.sqrt(h*h+p*p),w=h===0&&p===0?0:-h/Math.sqrt(h*h+p*p);h+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(h,p,h-E*F*O*k,p-w*F*O*k,h+E*F*O*k,p+w*F*O*k,V,!0),_=!_,m+=v*k}},convertPolygonToPath:function(){var u=Math.floor(this.pt.v),v=Math.PI*2/u,_=this.or.v,P=this.os.v,T=2*Math.PI*_/(u*4),M,L=-Math.PI*.5,W=this.data.d===3?-1:1;for(L+=this.r.v,this.v._length=0,M=0;M<u;M+=1){var B=_*Math.cos(L),V=_*Math.sin(L),G=B===0&&V===0?0:V/Math.sqrt(B*B+V*V),O=B===0&&V===0?0:-B/Math.sqrt(B*B+V*V);B+=+this.p.v[0],V+=+this.p.v[1],this.v.setTripleAt(B,V,B-G*T*P*W,V-O*T*P*W,B+G*T*P*W,V+O*T*P*W,M,!0),L+=v*W}this.paths.length=0,this.paths[0]=this.v}},Y([ht],b),b})(),f=(function(){function b(g,u){this.v=ut.newElement(),this.v.c=!0,this.localShapeCollection=ue.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=g,this.comp=g.comp,this.frameId=-1,this.d=u.d,this.initDynamicPropertyContainer(g),this.p=I.getProp(g,u.p,1,0,this),this.s=I.getProp(g,u.s,1,0,this),this.r=I.getProp(g,u.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return b.prototype={convertRectToPath:function(){var u=this.p.v[0],v=this.p.v[1],_=this.s.v[0]/2,P=this.s.v[1]/2,T=Es(_,P,this.r.v),M=T*(1-Ht);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(u+_,v-P+T,u+_,v-P+T,u+_,v-P+M,0,!0),this.v.setTripleAt(u+_,v+P-T,u+_,v+P-M,u+_,v+P-T,1,!0),T!==0?(this.v.setTripleAt(u+_-T,v+P,u+_-T,v+P,u+_-M,v+P,2,!0),this.v.setTripleAt(u-_+T,v+P,u-_+M,v+P,u-_+T,v+P,3,!0),this.v.setTripleAt(u-_,v+P-T,u-_,v+P-T,u-_,v+P-M,4,!0),this.v.setTripleAt(u-_,v-P+T,u-_,v-P+M,u-_,v-P+T,5,!0),this.v.setTripleAt(u-_+T,v-P,u-_+T,v-P,u-_+M,v-P,6,!0),this.v.setTripleAt(u+_-T,v-P,u+_-M,v-P,u+_-T,v-P,7,!0)):(this.v.setTripleAt(u-_,v+P,u-_+M,v+P,u-_,v+P,2),this.v.setTripleAt(u-_,v-P,u-_,v-P+M,u-_,v-P,3))):(this.v.setTripleAt(u+_,v-P+T,u+_,v-P+M,u+_,v-P+T,0,!0),T!==0?(this.v.setTripleAt(u+_-T,v-P,u+_-T,v-P,u+_-M,v-P,1,!0),this.v.setTripleAt(u-_+T,v-P,u-_+M,v-P,u-_+T,v-P,2,!0),this.v.setTripleAt(u-_,v-P+T,u-_,v-P+T,u-_,v-P+M,3,!0),this.v.setTripleAt(u-_,v+P-T,u-_,v+P-M,u-_,v+P-T,4,!0),this.v.setTripleAt(u-_+T,v+P,u-_+T,v+P,u-_+M,v+P,5,!0),this.v.setTripleAt(u+_-T,v+P,u+_-M,v+P,u+_-T,v+P,6,!0),this.v.setTripleAt(u+_,v+P-T,u+_,v+P-T,u+_,v+P-M,7,!0)):(this.v.setTripleAt(u-_,v-P,u-_+M,v-P,u-_,v-P,1,!0),this.v.setTripleAt(u-_,v+P,u-_,v+P-M,u-_,v+P,2,!0),this.v.setTripleAt(u+_,v+P,u+_-M,v+P,u+_,v+P,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:s},Y([ht],b),b})();function C(b,g,u){var v;if(u===3||u===4){var _=u===3?g.pt:g.ks,P=_.k;P.length?v=new c(b,g,u):v=new l(b,g,u)}else u===5?v=new f(b,g):u===6?v=new d(b,g):u===7&&(v=new x(b,g));return v.k&&b.addDynamicProperty(v),v}function S(){return l}function y(){return c}var A={};return A.getShapeProp=C,A.getConstructorFunction=S,A.getKeyframedConstructorFunction=y,A})();/*!
|
|
3
3
|
Transformation Matrix v2.0
|
|
4
4
|
(c) Epistemex 2014-2015
|