clipoox-render 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/package.json +1 -1
  2. package/scripts/render-local.mjs +999 -848
  3. package/web/assets/{FxEmbed-ROS6C_HI.js → FxEmbed-B-D-tbgP.js} +1 -1
  4. package/web/assets/{MotionEmbed-E2hCysi-.js → MotionEmbed-eB-zRpv9.js} +1 -1
  5. package/web/assets/{PluginStore-CwUSpwPp.js → PluginStore-D6UvvVXA.js} +1 -1
  6. package/web/assets/{ShotComposer-DLxWpdYH.js → ShotComposer-CoxtWL6A.js} +5 -5
  7. package/web/assets/{TemplateEmbed-qG1AXdtf.js → TemplateEmbed-DZNaQAJ-.js} +1 -1
  8. package/web/assets/{TimelinePlugins-CB1b6-Cb.js → TimelinePlugins-zhB9Uqav.js} +3 -3
  9. package/web/assets/{TimelineShotFx-CyHTgJHj.js → TimelineShotFx-muTN__gf.js} +2 -2
  10. package/web/assets/{TransitionEmbed-Dym9P7--.js → TransitionEmbed-r_B0toRr.js} +1 -1
  11. package/web/assets/{Whiteboard-BdGjJZXW.js → Whiteboard-f6owS-ne.js} +1 -1
  12. package/web/assets/{aerial-yLD_gDzw.js → aerial-DIj143Yz.js} +2 -2
  13. package/web/assets/{agentTools-B7g6tXTR.js → agentTools-CoNs1wCQ.js} +2 -2
  14. package/web/assets/{aiInbetween-6eKDYbYS.js → aiInbetween-ZFNHEXdI.js} +2 -2
  15. package/web/assets/{analyzerRun-Cr-_79RH.js → analyzerRun-BswbLsRF.js} +1 -1
  16. package/web/assets/{analyzerSandbox-N92T6amg.js → analyzerSandbox-C2rd6s8U.js} +1 -1
  17. package/web/assets/{api-Dnl2uaKO.js → api-DJC95K48.js} +3 -3
  18. package/web/assets/auraTrack-C9diszRB.js +1 -0
  19. package/web/assets/{breakthrough-DSiuVwEX.js → breakthrough-DiHiElqL.js} +2 -2
  20. package/web/assets/{cameraPresets-Cfn7qhXK.js → cameraPresets-DfKERP1j.js} +1 -1
  21. package/web/assets/{cameraTracker-DHdF8Zqx.js → cameraTracker-DFjnZ7tw.js} +1 -1
  22. package/web/assets/{captionLayout-cckQ7p-t.js → captionLayout-CAuhUiW9.js} +1 -1
  23. package/web/assets/{clientExport-pkLbOmEF.js → clientExport-DyqpYM6h.js} +1 -1
  24. package/web/assets/{clientJobs-CcsLDqFM.js → clientJobs-BqkjV5Ld.js} +2 -2
  25. package/web/assets/{depthEstimate-Cav4MmQ1.js → depthEstimate-HrGq0Ffx.js} +1 -1
  26. package/web/assets/{directorTools-DMsatulF.js → directorTools-CLn4xt6m.js} +1 -1
  27. package/web/assets/{distortFrames-D_v-aSVO.js → distortFrames-D-DK2HlN.js} +2 -2
  28. package/web/assets/{distortGL-vhnBRB59.js → distortGL-waTJhiOf.js} +1 -1
  29. package/web/assets/{domino-DBrinEUu.js → domino-BDKBYrNQ.js} +1 -1
  30. package/web/assets/{editTools-BNnAvCw-.js → editTools-BqKU-ucA.js} +1 -1
  31. package/web/assets/{engine-Co-ivzlQ.js → engine-B2YPWQZ2.js} +1 -1
  32. package/web/assets/{exportGlb-D3PrWUvi.js → exportGlb-Cm07JQXt.js} +1 -1
  33. package/web/assets/{faceTracker-ClR-lS6Y.js → faceTracker-DsmLlUZ1.js} +1 -1
  34. package/web/assets/{fightDirector-BlpVAURl.js → fightDirector-BIVLGhAP.js} +1 -1
  35. package/web/assets/{fightDrama-BK0QidpM.js → fightDrama-B_jDQ-cW.js} +2 -2
  36. package/web/assets/{focusTool-sVOb2GGS.js → focusTool-mWs2Eikj.js} +1 -1
  37. package/web/assets/{frameSink-CSRqCnwI.js → frameSink-DWkHUnvV.js} +3 -3
  38. package/web/assets/{glTransitionSources.generated-q0H-ZbnZ.js → glTransitionSources.generated-BJuEUz3E.js} +1 -1
  39. package/web/assets/{gpuCompose-B5bgbHdQ.js → gpuCompose-Fi0sIUI9.js} +1 -1
  40. package/web/assets/{gpuExport-oA2mUsdm.js → gpuExport-Dlf6YjLs.js} +3 -3
  41. package/web/assets/{handMatte-Dj2taFoC.js → handMatte-CvFkZKTL.js} +1 -1
  42. package/web/assets/{handTracker-c6_rvuwA.js → handTracker-CF1hqh09.js} +2 -2
  43. package/web/assets/{index-Ds_8isyf.js → index-EegUntr6.js} +1 -1
  44. package/web/assets/{layer-worker-ClVZG6ZW.js → layer-worker-Drj-NLVj.js} +3 -3
  45. package/web/assets/library-BhH-xsMR.js +1 -0
  46. package/web/assets/{lottieLayer-Cv8ub9f6.js → lottieLayer-Dp_vGTy8.js} +1 -1
  47. package/web/assets/{main-CwrkBJ63.js → main-DAk1Tv1E.js} +52 -52
  48. package/web/assets/{mapBake-DtQboFIX.js → mapBake-CEmw-e9Y.js} +1 -1
  49. package/web/assets/{maskTrack-D4QZfMWc.js → maskTrack-CADMBJDf.js} +1 -1
  50. package/web/assets/{matteFixRun-CytaeRzS.js → matteFixRun-BHD3Qnta.js} +1 -1
  51. package/web/assets/{objectLocate-XuAcemlO.js → objectLocate-DWsEG8eK.js} +1 -1
  52. package/web/assets/{objectSegmenter-D66spD7o.js → objectSegmenter-oGv8YQbI.js} +1 -1
  53. package/web/assets/{objectTrack.worker-BZS6WZ6l.js → objectTrack.worker-B6RVfsq4.js} +570 -419
  54. package/web/assets/{pathTracer-DykgPkkh.js → pathTracer-DxqKEvC7.js} +2 -2
  55. package/web/assets/{pendingMatte-BWBIWajI.js → pendingMatte-Taa0BlLI.js} +2 -2
  56. package/web/assets/{personAi-EhBknW6X.js → personAi-BebqXrqD.js} +2 -2
  57. package/web/assets/{personHq-Ca351o06.js → personHq-Cyq9HWnW.js} +2 -2
  58. package/web/assets/{plateCamera-BcdXD1uI.js → plateCamera-D1A1iEpf.js} +1 -1
  59. package/web/assets/{plateCameraMatch-GPZl1fQQ.js → plateCameraMatch-1_DuZ0LV.js} +2 -2
  60. package/web/assets/{plateFollow-CJUilsNV.js → plateFollow-Ztxwpq5v.js} +2 -2
  61. package/web/assets/{plateMatte-CoEoVjxZ.js → plateMatte-CWT1ymGj.js} +2 -2
  62. package/web/assets/{pluginAutomation-DAPHWZPN.js → pluginAutomation-D73Az7HS.js} +1 -1
  63. package/web/assets/{poseTracker-CzEKvJph.js → poseTracker-b1h08oRY.js} +1 -1
  64. package/web/assets/{productTools-ce-zyZO0.js → productTools-CoJ_Fnfc.js} +2 -2
  65. package/web/assets/remote-kxNNhmis.js +974 -0
  66. package/web/assets/{rigTrack-DMyqb0pb.js → rigTrack-B9r9wrdV.js} +1 -1
  67. package/web/assets/{rotoMaskStore-pE1AIt3I.js → rotoMaskStore-RmW40Pcn.js} +1 -1
  68. package/web/assets/{rotoMatte-7b7Ow64f.js → rotoMatte-DisQplSv.js} +1 -1
  69. package/web/assets/{rotoscope-BUqNTKLd.js → rotoscope-Z8bn-jRs.js} +1 -1
  70. package/web/assets/{sceneTrack-CA21MCOP.js → sceneTrack-BKknn180.js} +1 -1
  71. package/web/assets/{sceneTrack-DlAH5s74.js → sceneTrack-DyVxpl7i.js} +1 -1
  72. package/web/assets/{sceneTrack.worker-COlhlHRe.js → sceneTrack.worker-DKVLLgf9.js} +570 -419
  73. package/web/assets/{shot-worker-DL1ZoIym.js → shot-worker-DM5PUQ6g.js} +1 -1
  74. package/web/assets/{shotFxAgent-DqngnGFb.js → shotFxAgent-CsW0MAiG.js} +1 -1
  75. package/web/assets/{skin-xFScwS3T.js → skin-CXvqtCZI.js} +1 -1
  76. package/web/assets/{spark.module-DjaIF6J1.js → spark.module-B341moK0.js} +1 -1
  77. package/web/assets/{spellDuel-BYNtnE8f.js → spellDuel-KCMEFHLA.js} +2 -2
  78. package/web/assets/{store-CpqHUcA2.js → store-xR02oY0m.js} +1 -1
  79. package/web/assets/{surfaceLight-C7YI9SV8.js → surfaceLight-DBfJxggM.js} +1 -1
  80. package/web/assets/{surfacePin-CzpUj1Cw.js → surfacePin-i-X1Dz68.js} +2 -2
  81. package/web/assets/{textAnimators-B9vO_hbP.js → textAnimators-CeMuG34D.js} +1 -1
  82. package/web/assets/{thumb-BTFsBS1u.js → thumb-DzNl15MN.js} +1 -1
  83. package/web/assets/{timeline3d-DrFaMPPB.js → timeline3d-D0Ws4lcp.js} +2 -2
  84. package/web/assets/{timeline3dExport-Uo0S0CR0.js → timeline3dExport-BO--SpAn.js} +1 -1
  85. package/web/assets/{timelineComp-i-zdaoB2.js → timelineComp-D8PHGHgQ.js} +1 -1
  86. package/web/assets/{timelineOps-DSSaDsU2.js → timelineOps-CEGk2t4h.js} +20 -20
  87. package/web/assets/{timelineProps-0v-s69pw.js → timelineProps-Cm_Irino.js} +1 -1
  88. package/web/assets/{timelineText-DurRhyuh.js → timelineText-DjPW2-dd.js} +1 -1
  89. package/web/assets/{titleArt-CnC0A7x7.js → titleArt-BSu80bfN.js} +3 -3
  90. package/web/assets/{titleFrameBudget-DsM0V482.js → titleFrameBudget-BW-N1-cw.js} +718 -567
  91. package/web/assets/{titleFrames-C8kvflgT.js → titleFrames-BHFaInux.js} +1 -1
  92. package/web/assets/{tool-D1FpErrX.js → tool-Bboi3NDg.js} +1 -1
  93. package/web/assets/{tools-DIvrRu-5.js → tools-kgYkohv8.js} +1 -1
  94. package/web/assets/{toonTools-D9MNdRty.js → toonTools-Bxz_HSqT.js} +2 -2
  95. package/web/assets/{trackAnchor-XvUuvkWP.js → trackAnchor-DK9cEMCf.js} +1 -1
  96. package/web/assets/{userFonts-Djka6RJX.js → userFonts-DSkZHfmh.js} +1 -1
  97. package/web/assets/{vfxAlpha-B-JzzRI1.js → vfxAlpha-B0rNpKZN.js} +1 -1
  98. package/web/assets/vfxBackground-CBTDl1xA.js +2 -0
  99. package/web/assets/{videoExport-NN-QijHd.js → videoExport-Cu0vw-dL.js} +1 -1
  100. package/web/assets/{views-RQBs4zva.js → views-CmulxRJP.js} +1 -1
  101. package/web/assets/{weaponDuel-DKAEYJjO.js → weaponDuel-DuuMMfzY.js} +1 -1
  102. package/web/assets/{windowFrames-DhhJLIs-.js → windowFrames-BP2oDn-n.js} +1 -1
  103. package/web/layer-worker.html +3 -3
  104. package/web/shot-worker.html +22 -22
  105. package/web/assets/auraTrack-C8eAEIWQ.js +0 -1
  106. package/web/assets/library-BK0QVG4O.js +0 -1
  107. package/web/assets/remote-8XzEAnAJ.js +0 -974
  108. package/web/assets/vfxBackground-b053ziDK.js +0 -2
@@ -1,11 +1,11 @@
1
- (function(){"use strict";function vi(t){const e=t.w>>1,c=t.h>>1,o=new Float32Array(e*c),n=t.data,s=t.w;for(let x=0;x<c;x++)for(let d=0;d<e;d++){const g=2*x*s+2*d;o[x*e+d]=(n[g]+n[g+1]+n[g+s]+n[g+s+1])/4}return{w:e,h:c,data:o}}function Ti(t,e=3){const c=[t];for(;c.length<e&&c.at(-1).w>=40;)c.push(vi(c.at(-1)));return c}const oa=(t,e,c)=>{e=Math.max(0,Math.min(t.w-1.001,e)),c=Math.max(0,Math.min(t.h-1.001,c));const o=e|0,n=c|0,s=e-o,x=c-n,d=n*t.w+o,g=t.data;return(g[d]*(1-s)+g[d+1]*s)*(1-x)+(g[d+t.w]*(1-s)+g[d+t.w+1]*s)*x};function Ro(t,e,c,o=5,n=12){let s=0,x=0;for(let P=t.length-1;P>=0;P--){const h=t[P],w=e[P],r=2**P,f=c[0]/r,R=c[1]/r;let X=0,j=0,m=0;const V=[],F=[],E=[];for(let L=-o;L<=o;L++)for(let i=-o;i<=o;i++){const $=(oa(h,f+i+1,R+L)-oa(h,f+i-1,R+L))/2,z=(oa(h,f+i,R+L+1)-oa(h,f+i,R+L-1))/2;X+=$*$,j+=$*z,m+=z*z,V.push($),F.push(z),E.push(oa(h,f+i,R+L))}const a=X*m-j*j;if(a<1e-9)return null;let u=0,M=0;for(let L=0;L<n;L++){let i=0,$=0,z=0;for(let ft=-o;ft<=o;ft++)for(let gt=-o;gt<=o;gt++,z++){const wt=E[z]-oa(w,f+s+u+gt,R+x+M+ft);i+=wt*V[z],$+=wt*F[z]}const U=(m*i-j*$)/a,at=(X*$-j*i)/a;if(u+=U,M+=at,U*U+at*at<1e-4)break}s=(s+u)*(P?2:1),x=(x+M)*(P?2:1)}const d=[c[0]+s,c[1]+x],g=t[0].w,C=t[0].h;return d[0]<2||d[1]<2||d[0]>g-3||d[1]>C-3?null:d}function Ci(t,e,c){return c.map(o=>{const n=Ro(t,e,o);if(!n)return null;const s=Ro(e,t,n);return s&&Math.hypot(s[0]-o[0],s[1]-o[1])<.8?n:null})}const eo=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],co=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],ma=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],ao=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],Bc=(t,e)=>[ma(t[0],e),ma(t[1],e),ma(t[2],e)],ka=t=>[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],Po=(t,e)=>t.map(c=>[0,1,2].map(o=>c[0]*e[0][o]+c[1]*e[1][o]+c[2]*e[2][o])),Ai=()=>[[1,0,0],[0,1,0],[0,0,1]];function zo(t){const e=Math.hypot(t[0],t[1],t[2]);if(e<1e-12)return Ai();const c=ao(t,1/e),o=Math.cos(e),n=Math.sin(e),s=1-o;return[[o+c[0]*c[0]*s,c[0]*c[1]*s-c[2]*n,c[0]*c[2]*s+c[1]*n],[c[1]*c[0]*s+c[2]*n,o+c[1]*c[1]*s,c[1]*c[2]*s-c[0]*n],[c[2]*c[0]*s-c[1]*n,c[2]*c[1]*s+c[0]*n,o+c[2]*c[2]*s]]}function Bo(t){const e=t[0][0]+t[1][1]+t[2][2];let c;if(e>0){const n=Math.sqrt(e+1)*2;c=[(t[2][1]-t[1][2])/n,(t[0][2]-t[2][0])/n,(t[1][0]-t[0][1])/n,n/4]}else if(t[0][0]>t[1][1]&&t[0][0]>t[2][2]){const n=Math.sqrt(1+t[0][0]-t[1][1]-t[2][2])*2;c=[n/4,(t[0][1]+t[1][0])/n,(t[0][2]+t[2][0])/n,(t[2][1]-t[1][2])/n]}else if(t[1][1]>t[2][2]){const n=Math.sqrt(1+t[1][1]-t[0][0]-t[2][2])*2;c=[(t[0][1]+t[1][0])/n,n/4,(t[1][2]+t[2][1])/n,(t[0][2]-t[2][0])/n]}else{const n=Math.sqrt(1+t[2][2]-t[0][0]-t[1][1])*2;c=[(t[0][2]+t[2][0])/n,(t[1][2]+t[2][1])/n,n/4,(t[1][0]-t[0][1])/n]}const o=Math.hypot(...c);return c.map(n=>n/o*(c[3]<0?-1:1))}function Ri(t){const[e,c,o,n]=t;return[[1-2*(c*c+o*o),2*(e*c-o*n),2*(e*o+c*n)],[2*(e*c+o*n),1-2*(e*e+o*o),2*(c*o-e*n)],[2*(e*o-c*n),2*(c*o+e*n),1-2*(e*e+c*c)]]}function Pi(t,e,c,o,n){const s=Bc(t.R,eo(e,t.C));return s[2]>-1e-6?null:[o+c*s[0]/-s[2],n-c*s[1]/-s[2]]}function zi(t,e,c,o,n,s){let x={R:e.R.map(h=>[...h]),C:[...e.C]};const d=h=>{const w=[];for(const{X:r,px:f}of t){const R=Pi(h,r,c,o,n);w.push(R?R[0]-f[0]:50,R?R[1]-f[1]:50)}return w},g=(h,w)=>({R:Po(zo([w[0],w[1],w[2]]),h.R),C:co(h.C,[w[3]*s,w[4]*s,w[5]*s])});for(let h=0;h<12;h++){const w=d(x),r=w.map((m,V)=>V%2?null:Math.hypot(m,w[V+1])).flatMap(m=>m===null?[]:[m<=2?1:2/m,m<=2?1:2/m]),f=[];for(let m=0;m<6;m++){const V=[0,0,0,0,0,0];V[m]=1e-5;const F=d(g(x,V));f.push(F.map((E,a)=>(E-w[a])/1e-5))}const R=Array.from({length:6},()=>new Array(6).fill(0)),X=new Array(6).fill(0);for(let m=0;m<w.length;m++)for(let V=0;V<6;V++){X[V]+=f[V][m]*w[m]*r[m];for(let F=0;F<6;F++)R[V][F]+=f[V][m]*f[F][m]*r[m]}for(let m=0;m<6;m++)R[m][m]*=1.0001;const j=Wo(R,X.map(m=>-m));if(!j||(x=g(x,j),Math.hypot(...j)<1e-7))break}const C=d(x),P=[];for(let h=0;h<t.length;h++)Math.hypot(C[2*h],C[2*h+1])<2.5&&P.push(h);return{pose:x,inliers:P}}function Wo(t,e){const c=e.length,o=t.map((s,x)=>Float64Array.from([...s,e[x]]));for(let s=0;s<c;s++){let x=s;for(let C=s+1;C<c;C++)Math.abs(o[C][s])>Math.abs(o[x][s])&&(x=C);if(Math.abs(o[x][s])<1e-14)return null;[o[s],o[x]]=[o[x],o[s]];const d=o[s],g=d[s];for(let C=s+1;C<c;C++){const P=o[C],h=P[s]/g;if(h!==0)for(let w=s;w<=c;w++)P[w]-=h*d[w]}}const n=new Array(c);for(let s=c-1;s>=0;s--){const x=o[s];let d=x[c];for(let g=s+1;g<c;g++)d-=x[g]*n[g];n[s]=d/x[s]}return n}function Ka(t,e,c,o,n,s,x,d=12,{focal:g=!1}={}){const C=o.filter(u=>t[u]),P=C.length;if(P<3)return n;const h=new Map(C.map((u,M)=>[u,M])),w=[...e.keys()].filter(u=>C.filter(M=>c[M].has(u)).length>=2),r=w.length;if(r<10)return n;const f=[];w.forEach((u,M)=>{for(const L of C)c[L].has(u)&&f.push({c:h.get(L),p:M,px:c[L].get(u)})});const R=C.map(u=>t[u].R.map(M=>[...M])),X=C.map(u=>[...t[u].C]),j=w.map(u=>[...e.get(u)]),m=(u,M,L,i)=>{let $=0;for(const z of f){const U=Bc(u[z.c],eo(L[z.p],M[z.c]));if(U[2]>-1e-6){$+=100;continue}const at=s-i*U[0]/U[2]-z.px[0],ft=x+i*U[1]/U[2]-z.px[1],gt=Math.hypot(at,ft);$+=gt<=2?gt*gt:4*gt-4}return $};let V=.001,F=m(R,X,j,n);const E=6*(P-1)+(g?1:0),a=E-1;for(let u=0;u<d;u++){const M=Array.from({length:E},()=>new Array(E).fill(0)),L=new Array(E).fill(0),i=j.map(()=>[[0,0,0],[0,0,0],[0,0,0]]),$=j.map(()=>[0,0,0]),z=new Map,U=g?j.map(()=>[[0,0,0]]):null;for(const b of f){const O=Bc(R[b.c],eo(j[b.p],X[b.c])),[Q,q,v]=O;if(v>-1e-6)continue;const N=s-n*Q/v-b.px[0],J=x+n*q/v-b.px[1],ot=Math.hypot(N,J),rt=ot<=2?1:2/ot,zc=[-n/v,0,n*Q/(v*v)],ca=[0,n/v,-n*q/(v*v)],ya=R[b.c],Ia=[Bc(ka(ya),zc),Bc(ka(ya),ca)],Ax=[[0,-v,q],[v,0,-Q],[-q,Q,0]],ki=kt=>[...Bc(ka(Ax),kt).map(aa=>-aa),...ao(Bc(ka(ya),kt),-1)],wa=b.c?[ki(zc),ki(ca)]:null,Co=[N,J],Ua=[-Q/v,q/v];for(let kt=0;kt<2;kt++){for(let St=0;St<3;St++){$[b.p][St]+=rt*Ia[kt][St]*Co[kt];for(let _t=0;_t<3;_t++)i[b.p][St][_t]+=rt*Ia[kt][St]*Ia[kt][_t]}if(g){L[a]+=rt*Ua[kt]*Co[kt],M[a][a]+=rt*Ua[kt]*Ua[kt];for(let St=0;St<3;St++)U[b.p][0][St]+=rt*Ua[kt]*Ia[kt][St]}if(!wa)continue;const aa=6*(b.c-1),Si=b.c*r+b.p;let Ao=z.get(Si);Ao||z.set(Si,Ao=Array.from({length:6},()=>[0,0,0]));for(let St=0;St<6;St++){L[aa+St]+=rt*wa[kt][St]*Co[kt];for(let _t=0;_t<6;_t++)M[aa+St][aa+_t]+=rt*wa[kt][St]*wa[kt][_t];for(let _t=0;_t<3;_t++)Ao[St][_t]+=rt*wa[kt][St]*Ia[kt][_t];if(g){const _t=rt*wa[kt][St]*Ua[kt];M[aa+St][a]+=_t,M[a][aa+St]+=_t}}}}const at=i.map(b=>{const O=b.map((Q,q)=>Q.map((v,N)=>v+(q===N?V*(v+1e-9)+1e-9:0)));return Bi(O)}),ft=M.map((b,O)=>b.map((Q,q)=>Q+(O===q?V*(Q+1e-9):0))),gt=L.map(b=>-b),wt=new Map;for(const[b,O]of z){const Q=b%r;wt.has(Q)||wt.set(Q,[]),wt.get(Q).push({o:6*(Math.floor(b/r)-1),B:O})}g&&U.forEach((b,O)=>{wt.has(O)||wt.set(O,[]),wt.get(O).push({o:a,B:b})});for(const[b,O]of wt){const Q=at[b],q=O.map(({o:v,B:N})=>({o:v,M:N.map(J=>Bc(ka(Q),J))}));for(const v of q)for(let N=0;N<v.M.length;N++)gt[v.o+N]+=ma(v.M[N],$[b]);for(const v of q)for(const N of O)for(let J=0;J<v.M.length;J++)for(let ot=0;ot<N.B.length;ot++)ft[v.o+J][N.o+ot]-=ma(v.M[J],N.B[ot])}const l=Wo(ft,gt);if(!l){V*=10;continue}const p=$.map(b=>ao(b,-1));for(const[b,O]of wt)for(const{o:Q,B:q}of O)for(let v=0;v<3;v++)for(let N=0;N<q.length;N++)p[b][v]-=q[N][v]*l[Q+N];const y=R.map((b,O)=>O?Po(zo(l.slice(6*(O-1),6*(O-1)+3)),b):b),k=X.map((b,O)=>O?co(b,l.slice(6*(O-1)+3,6*O)):b),I=j.map((b,O)=>co(b,Bc(at[O],p[O]))),tt=g?n+l[a]:n,A=tt>0?m(y,k,I,tt):1/0;A<F?(F=A,R.splice(0,P,...y),X.splice(0,P,...k),j.splice(0,r,...I),n=tt,V=Math.max(1e-7,V/3)):V*=8}return C.forEach((u,M)=>{t[u]={...t[u],R:R[M],C:X[M]}}),w.forEach((u,M)=>e.set(u,j[M])),n}function Bi(t){const[[e,c,o],[n,s,x],[d,g,C]]=t,P=s*C-x*g,h=-(n*C-x*d),w=n*g-s*d,r=e*P+c*h+o*w;return Math.abs(r)<1e-18?[[0,0,0],[0,0,0],[0,0,0]]:[[P/r,-(c*C-o*g)/r,(c*x-o*s)/r],[h/r,(e*C-o*d)/r,-(e*x-o*n)/r],[w/r,-(e*g-c*d)/r,(e*s-c*n)/r]]}const Ho=Object.freeze({ink:{width:1,tip:.12,press:.45,wobble:.06,alpha:1,retrace:!1,grain:0},pen:{width:.7,tip:.9,press:.04,wobble:.03,alpha:1,retrace:!1,grain:0},crayon:{width:1.1,tip:.7,press:.15,wobble:.14,alpha:.92,retrace:!0,grain:.55},chalk:{width:1.05,tip:.75,press:.12,wobble:.12,alpha:.88,retrace:!1,grain:.7},charcoal:{width:1.2,tip:.4,press:.3,wobble:.18,alpha:.9,retrace:!0,grain:.45},watercolor:{width:1.25,tip:.35,press:.35,wobble:.2,alpha:.55,retrace:!1,grain:0,wet:!0}});Object.freeze(["pencil","marker","brush",...Object.keys(Ho)]);const Qt=(t,e,c,o)=>Object.freeze({id:t,vi:e,en:c,...o}),Lo=Object.freeze([Qt("watercolor-garden","Màu nước vườn","Watercolour garden",{about:["Màu nước loang trên giấy cotton, viền đậm nơi màu đọng","Translucent washes on cotton paper, darker pooled edges"],palette:["#f6efe0","#8fb39a","#e59b8b","#8fb5d4","#e8c170","#b07fa8"],ink:"#5b4a3f",brush:{style:"watercolor",width:.8,taper:.6,press:.5},outline:!0,texture:{type:"wash",amount:.7},paper:{color:"#f6efe0",texture:{type:"paper",amount:.6}},boil:{amount:1.2,fps:6},step:2,tags:["soft","editorial"]}),Qt("ink-wash","Thủy mặc","Ink wash",{about:["Mực tàu trên giấy dó, sắc độ xám, một điểm đỏ ấn","Brush ink on rice paper, grey tones, one red seal"],palette:["#f1ece0","#3c3c3c","#7d7d78","#c0392b","#dcd8cd","#5a6b5d"],ink:"#1d1d1b",brush:{style:"ink",width:1.1,taper:.85,press:.7},outline:!0,texture:{type:"wash",amount:.5},paper:{color:"#f1ece0",texture:{type:"paper",amount:.7}},boil:{amount:.8,fps:4},step:2,tags:["minimal","cinematic"]}),Qt("crayon-book","Sách sáp màu","Crayon book",{about:["Nét sáp màu thiếu nhi, tô gạch, giấy trắng ngà","Kids’ crayon lines and scribbled fills on warm paper"],palette:["#fbf6ea","#f2a93b","#4f9fd8","#e8504b","#cfe8ff","#6b4f8f"],ink:"#3a3226",brush:{style:"crayon",width:1,taper:.3,press:.3},outline:!0,texture:{type:"hatch",scale:.8,angle:-35,amount:.55},paper:{color:"#fbf6ea",texture:{type:"grain",amount:.5}},boil:{amount:2.4,fps:8},step:2,tags:["playful"]}),Qt("midcentury-flat","Phẳng thập niên 50","Midcentury flat",{about:["Mảng màu phẳng không viền, hạt in nhẹ, tông mù tạt – xanh két","Flat shapes without outlines, light print grain, mustard and teal"],palette:["#f3e7cf","#e2a33a","#2f7d79","#d9573b","#a9d6d0","#2c3e50"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:{type:"grain",amount:.35},paper:{color:"#f3e7cf",texture:{type:"grain",amount:.4}},boil:null,step:1,tags:["retro","clean"]}),Qt("rubber-hose","Hoạt hình ống cao su","Rubber-hose toon",{about:["Thập niên 30: đen trắng ngà, viền mực dày, chuyển động trên 2","1930s cartoon: cream greys, thick ink outlines, animated on twos"],palette:["#efe4cc","#e2d7bf","#a69c86","#5b5346","#fbf7ee","#2a251f"],ink:"#14110d",brush:{style:"ink",width:1.3,taper:.2,press:.2},outline:!0,texture:null,paper:{color:"#d8ccb2",texture:{type:"paper",amount:.8}},boil:{amount:1.6,fps:12},step:2,tags:["retro","playful"]}),Qt("riso-print","In riso","Riso print",{about:["Hai–ba màu mực in chồng, chấm tram, lệch bản nhẹ","Two or three overprinted inks, halftone, slight misregistration"],palette:["#f4eee2","#ff4f9a","#2a6fd6","#ffd23f","#ffc2dd","#1d3c78"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"riso",amount:.7},paper:{color:"#f4eee2",texture:{type:"grain",amount:.45}},boil:{amount:.6,fps:6},step:2,tags:["editorial","street"]}),Qt("papercut","Giấy cắt","Papercut",{about:["Lớp giấy cắt đỏ – kem, vân giấy, chuyển động stop-motion","Red and cream cut-paper layers, paper fibres, stop-motion timing"],palette:["#f5e9d4","#c8102e","#8b0a1f","#f0c05a","#ec9a78","#2b2b2b"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"paper",amount:.8},paper:{color:"#f5e9d4",texture:{type:"paper",amount:.9}},boil:{amount:.8,fps:4},step:3,tags:["editorial","playful"]}),Qt("whiteboard","Bảng trắng bút lông","Whiteboard marker",{about:["Bút lông đen – xanh – đỏ trên bảng trắng, tô gạch thưa","Black, blue and red markers on a whiteboard, loose hatching"],palette:["#fbfbf8","#1f5fbf","#d6332f","#2e9e5b","#f2b705","#555555"],ink:"#1b1b1b",brush:{style:"marker",width:.9,taper:.2,press:.1},outline:!0,texture:{type:"hatch",scale:1.2,angle:-45,amount:.35},paper:{color:"#fbfbf8",texture:{type:"grain",amount:.15}},boil:{amount:.8,fps:8},step:1,tags:["clean","corporate"]}),Qt("chalkboard","Bảng phấn","Chalkboard",{about:["Phấn trắng – vàng – hồng trên bảng xanh đen","White, yellow and pink chalk on a green-black board"],palette:["#24342c","#f4f1e8","#f6d65a","#f29bb6","#8fd3e8","#b6e388"],ink:"#f4f1e8",brush:{style:"chalk",width:1,taper:.3,press:.2},outline:!0,texture:{type:"stipple",scale:1,amount:.5},paper:{color:"#24342c",texture:{type:"grain",amount:.55}},boil:{amount:1.6,fps:8},step:2,tags:["retro","playful"]}),Qt("blueprint","Bản vẽ kỹ thuật","Blueprint",{about:["Nét trắng mảnh trên nền xanh lưới kỹ thuật","Thin white lines on blue grid paper"],palette:["#1d4f91","#e9f2ff","#9cc3ff","#ffd166","#6fb1ff","#c8dcff"],ink:"#e9f2ff",brush:{style:"pen",width:.6,taper:0,press:0},outline:!0,texture:{type:"hatch",scale:.7,angle:45,amount:.35},paper:{color:"#1d4f91",texture:{type:"grid",amount:.5}},boil:null,step:1,tags:["tech","minimal"]}),Qt("woodcut","Khắc gỗ","Woodcut",{about:["Mực đen dày, gạch khắc dày đặc, điểm đỏ","Heavy black ink, dense carved hatching, a red accent"],palette:["#efe6d2","#1a1714","#b8322a","#8a7a62","#e3d6b8","#5c4a3a"],ink:"#1a1714",brush:{style:"ink",width:1.4,taper:.6,press:.5},outline:!0,texture:{type:"crosshatch",scale:.8,angle:30,amount:.6},paper:{color:"#efe6d2",texture:{type:"paper",amount:.6}},boil:{amount:.6,fps:4},step:2,tags:["retro","editorial"]}),Qt("one-line","Một nét","One line",{about:["Một nét bút liền, không tô, vẽ dần","A single continuous pen line, no fills, drawn on"],palette:["#f7f4ee","#222222","#d64545","#3b6ea5","#999999","#555555"],ink:"#222222",brush:{style:"pen",width:.8,taper:.4,press:.1},outline:!0,texture:null,fillNone:!0,paper:{color:"#f7f4ee",texture:{type:"grain",amount:.2}},boil:null,step:1,tags:["minimal","clean"]}),Qt("isotype","Biểu tượng isotype","Isotype pictogram",{about:["Biểu tượng phẳng kiểu thống kê, 3 màu, gọn","Flat statistical pictograms, three colours, tidy"],palette:["#eceae4","#1d3557","#e63946","#457b9d","#a8dadc","#f1a208"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:null,paper:{color:"#eceae4",texture:null},boil:null,step:1,tags:["clean","corporate","minimal"]}),Qt("stained-glass","Kính màu","Stained glass",{about:["Viền chì đen dày, mảng màu ngọc rực, vân kính","Thick black leading, jewel colours, glass grain"],palette:["#121212","#1f6fb2","#c0392b","#f1c40f","#a3d9ff","#8e44ad"],ink:"#101010",brush:{style:"pen",width:1.8,taper:0,press:0},outline:!0,texture:{type:"grain",scale:1.6,amount:.5},paper:{color:"#151515",texture:{type:"grain",amount:.3}},boil:null,step:1,text:"#f6e7b4",tags:["bold","luxury"]}),Qt("pencil-sketch","Phác chì","Pencil sketch",{about:["Nét chì than mảnh, tô gạch đan nhạt, giấy vẽ","Graphite lines, light cross-hatching, sketch paper"],palette:["#f5f2ea","#8a8a86","#b9b7b0","#6e6a63","#c9a27e","#9fb0bf"],ink:"#3d3b38",brush:{style:"pencil",width:1.1,taper:.5,press:.4},outline:!0,texture:{type:"crosshatch",scale:1,angle:-40,amount:.45},paper:{color:"#f5f2ea",texture:{type:"paper",amount:.5}},boil:{amount:1.4,fps:8},step:2,tags:["soft","editorial"]}),Qt("pop-halftone","Pop chấm tram","Pop halftone",{about:["Viền đen đậm, chấm tram, vàng – đỏ – xanh rực","Bold black outlines, halftone dots, bright primaries"],palette:["#ffe14d","#ff3b3b","#1e90ff","#ff9f1c","#ffffff","#1a1a1a"],ink:"#111111",brush:{style:"marker",width:1.3,taper:0,press:0},outline:!0,texture:{type:"halftone",scale:1,angle:45,amount:.45},paper:{color:"#ffe14d",texture:{type:"halftone",scale:1.4,amount:.25,color:"#ffcc00"}},boil:null,step:1,tags:["bold","playful"]})]);Object.freeze(Lo.map(t=>t.id));const Sa=(t,e,c,o)=>Object.freeze({id:t,vi:e,en:c,prompt:o}),Wi=Object.freeze([Sa("anime-cel","Anime cel","Anime cel","Japanese anime, clean cel shading, crisp ink line art, flat colour with one shadow tone"),Sa("cartoon-2d","Hoạt hình 2D","2D cartoon","Western 2D cartoon, bold clean outlines, flat bright colours, simple shapes"),Sa("chibi","Chibi","Chibi","cute chibi proportions (big head, small body), soft cel shading, clean outlines"),Sa("comic","Truyện tranh","Comic book","comic book art, heavy ink outlines, halftone shading, strong contrast"),...Lo.map(t=>Sa(t.id,t.vi,t.en,`${t.en}: ${t.about?.[1]||t.en}`))]);Object.freeze(Wi.map(t=>t.id));const oo=(t,e,c,o,n,s)=>Object.freeze({id:t,label:e,min:c,max:o,vi:n,en:s}),Hi=Object.freeze({kling:oo("kling","Kling 4.0",3,15,"Mặc định","Default"),seedance:oo("seedance","Seedance 2.5",4,30,"Chân thực nhất","Most realistic"),wan:oo("wan","Wan 3.0 Prime",2,15,"Bản nháp rẻ","Cheap draft")});Object.freeze(Object.keys(Hi));const na="The person keeps exactly the same speech, lip movements, facial expressions, gestures, actions and timing as in the reference video.",sa=(t,e,c,o,n,s,x)=>Object.freeze({id:t,vi:e,en:c,image:o,hintVi:n,hintEn:s,build:x}),Li=Object.freeze([sa("scene","Đổi cảnh/nền","Change scene","optional","VD: quán cà phê ấm áp buổi tối","e.g. a cosy café at night",(t,e)=>`Edit the reference video: replace only the background and surroundings with ${e?`the place shown in the reference image${t?` — ${t}`:""}`:t||"a bright, modern interior"}. ${na} Keep the same person, face, hair and clothes, the same camera framing and camera motion. Match the light on the person to the new background. Photorealistic, no text.`),sa("camera","Đổi góc máy","Camera angle","optional","VD: cận mặt từ bên trái","e.g. a close-up from the left",(t,e)=>`Re-film the same moment from a different camera angle: ${t||"a closer shot from a slightly different angle"}. ${na} Same person, clothes, location and lighting${e?"; the reference image shows the look of the new angle":""}. Smooth camera, photorealistic, no text.`),sa("character","Thay nhân vật","Swap character","required","VD: giữ giọng nói, đổi trang phục công sở","e.g. keep the office outfit",t=>`Edit the reference video: replace the person with the character in the reference image — the same face, hair, body and outfit as in the image${t?` (${t})`:""}. ${na} Keep the same body positions, background, camera framing and camera motion. One person only, shown once. Photorealistic, no text.`),sa("relight","Đổi ánh sáng","Relight","optional","VD: nắng vàng hoàng hôn từ cửa sổ","e.g. golden sunset light from a window",(t,e)=>`Edit the reference video: change only the lighting to ${t||"warm golden-hour light from the side"}${e?", like the light in the reference image":""}. ${na} Keep everything else the same — person, clothes, background, camera framing and camera motion. Photorealistic, no text.`),sa("dof","Xoá phông","Blur background","optional","VD: phông xoá mạnh hơn","e.g. an even softer background",t=>`Edit the reference video: keep the person sharp and in focus and give the background a shallow depth of field — soft, creamy bokeh like a full-frame camera with an f/1.8 lens${t?`; ${t}`:""}. ${na} Keep the same person, background layout, camera framing and camera motion. Photorealistic, no text.`),sa("custom","Tự viết","Custom","optional","Mô tả thay đổi (tiếng Anh cho kết quả tốt nhất)","Describe the change",t=>`${t||"Edit the reference video."}${/lip|speech|timing/i.test(t)?"":` ${na}`}`)]);Object.freeze(Li.map(t=>t.id));const Di=Object.freeze({overcast:{azimuth:35,elevation:62,intensity:1.6,color:"#f1f4f8",ambient:"#c9d2dc",ambientIntensity:1.25,shadow:.45,softness:.85,contact:.75,env:.9,exposure:1},sun:{azimuth:40,elevation:48,intensity:3.4,color:"#fff3df",ambient:"#bcd2ec",ambientIntensity:.75,shadow:.7,softness:.25,contact:.8,env:.8,exposure:1},golden:{azimuth:70,elevation:16,intensity:3,color:"#ffc58a",ambient:"#8fa6c9",ambientIntensity:.7,shadow:.62,softness:.4,contact:.8,env:.7,exposure:1},night:{azimuth:20,elevation:55,intensity:1.4,color:"#ffd9a8",ambient:"#334866",ambientIntensity:.55,shadow:.5,softness:.55,contact:.85,env:.35,exposure:.85},studio:{azimuth:30,elevation:45,intensity:2.6,color:"#ffffff",ambient:"#ffffff",ambientIntensity:1,shadow:.35,softness:.6,contact:.6,env:1,exposure:1}});Object.freeze({preset:"overcast",...Di.overcast,blur:.5});const _=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,va=_(12,12,9),Ei=[["noodles","Mì / phở","Noodles",["M3 11h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M9 21h6","M14 3l5 6M17 3l4 5"],"phở bún mì hủ_tiếu noodle noodles ramen soup canh","food"],["rice","Cơm","Rice bowl",["M3 12h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M5 12c0-3 3-5.5 7-5.5s7 2.5 7 5.5","M9 21h6"],"cơm gạo cơm_tấm rice meal bữa_ăn","food"],["coffee","Cà phê","Coffee",["M4 9h12v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5Z","M16 11h2a2.5 2.5 0 0 1 0 5h-2","M8 3c-1 1 0 2 0 3M12 3c-1 1 0 2 0 3"],"cà_phê cafe coffee espresso latte quán_cà_phê","food"],["tea","Trà","Tea",["M5 8h12v5a6 6 0 0 1-12 0Z","M3 21h18","M17 9h1.5a2 2 0 0 1 0 4H17"],"trà chè tea trà_chiều","food"],["bubble-tea","Trà sữa","Bubble tea",["M6 7h12l-1.5 14h-9Z","M5 7h14","M12 7l2-5h3","M9.5 17h.01M12 18h.01M14.5 17h.01"],"trà_sữa trân_châu bubble_tea milk_tea đồ_uống","food"],["cake","Bánh kem","Cake",["M4 12h16v8H4Z","M4 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 4 0","M12 12V8","M12 5.5c.8-.8.8-1.8 0-2.5-.8.7-.8 1.7 0 2.5Z"],"bánh_kem bánh_sinh_nhật sinh_nhật cake birthday tiệm_bánh","food"],["pizza","Pizza","Pizza",["M12 21 3 6c6-3 12-3 18 0Z","M4.5 8.5c5-2.2 10-2.2 15 0",_(10,10.5,1),_(14,13,1)],"pizza","food"],["burger","Burger","Burger",["M4 11a8 6 0 0 1 16 0Z","M3 14h18","M4 17h16a2 2 0 0 1-2 3H6a2 2 0 0 1-2-3Z"],"burger hamburger bánh_mì_kẹp đồ_ăn_nhanh fast_food","food"],["fries","Khoai tây chiên","Fries",["M6 10h12l-1.5 11h-9Z","M8 10 7 3M11 10V2M14 10l1-7M17 10l1.5-5"],"khoai_tây_chiên fries snack ăn_vặt","food"],["drumstick","Gà rán","Fried chicken",["M17 4a5 5 0 0 1 0 7l-3.5 3.5a3 3 0 0 1-4-4L13 7a5 5 0 0 1 4-3Z","M10.5 13.5l-5 5",_(4.5,19.5,1.6),_(6.5,20.8,1.2)],"gà gà_rán thịt_gà chicken fried_chicken","food"],["fish","Cá / hải sản","Fish",["M3 12c3-5 9-6 14 0-5 6-11 5-14 0Z","M17 12l4-3v6Z",_(8,11,.6)],"cá hải_sản fish seafood sushi","food"],["steak","Thịt bò","Steak",["M5 8c2-4 10-5 14-1s1 11-6 11-10-6-8-10Z",_(14,10,2),"M7 13c2 1 4 1 6-1M9 16c2 .5 4 0 5-1.5"],"thịt bò bít_tết steak beef thịt_nướng bbq","food"],["egg","Trứng","Egg",["M5 10c0-4 4-6 7-5s6-1 7 3-1 9-7 9-7-3-7-7Z",_(12,12,2.5)],"trứng trứng_ốp egg breakfast bữa_sáng","food"],["bread","Bánh mì","Bread",["M4 11a4 4 0 0 1 2-7h12a4 4 0 0 1 2 7v9H4Z","M9 8v3M13 8v3"],"bánh_mì bread bakery tiệm_bánh","food"],["apple","Trái cây","Fruit",["M12 7c-3-2-8-1-8 5s3 9 5 9c1 0 2-.6 3-.6s2 .6 3 .6c2 0 5-3 5-9s-5-7-8-5Z","M12 7c0-2 1-4 3-4"],"trái_cây hoa_quả táo apple fruit healthy lành_mạnh","food"],["carrot","Rau củ","Vegetables",["M14 7c-3 1-9 7-11 14 7-2 13-8 14-11a2.5 2.5 0 0 0-3-3Z","M15.5 7.5l3.5-4M16.5 8.5l4.5-1.5M15 6.5l.5-4.5","M8 13l2 1.5M6 16.5l2 1.5"],"rau rau_củ cà_rốt vegetable vegetables organic","food"],["chili","Cay","Spicy",["M18 5c-1 7-6 14-14 15 4-3 7-7 9-13","M13 7c1-2 3-3 5-2","M18 5c0-1 1-2 2-2"],"cay ớt spicy chili hot","food"],["wine","Rượu vang","Wine",["M7 3h10l-.5 5a4.5 4.5 0 0 1-9 0Z","M12 13v8M8 21h8"],"rượu rượu_vang vang wine bar nhà_hàng","food"],["beer","Bia","Beer",["M5 8h10v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1Z","M15 11h2a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-2","M5 8a2.5 2.5 0 0 1 3-3 3 3 0 0 1 5 0 2.5 2.5 0 0 1 2 3","M9 12v5M11.5 12v5"],"bia beer nhậu quán_nhậu","food"],["cocktail","Cocktail","Cocktail",["M4 4h16l-8 9Z","M12 13v7M8 20h8","M17 4l2-2"],"cocktail mocktail đồ_uống drink pha_chế","food"],["ice-cream","Kem","Ice cream",["M7 10a5 5 0 0 1 10 0Z","M7 10l5 12 5-12"],"kem ice_cream tráng_miệng dessert","food"],["donut","Bánh ngọt","Donut",[va,_(12,12,3),"M7 8h.01M16 7h.01M8 16h.01M17 15h.01"],"bánh_ngọt donut bánh_vòng snack","food"],["chef","Đầu bếp","Chef",["M7 14a4 4 0 0 1-1-7.8A5 5 0 0 1 12 3a5 5 0 0 1 6 3.2A4 4 0 0 1 17 14Z","M7 14v6h10v-6","M7 17h10"],"đầu_bếp bếp nấu_ăn chef cook công_thức recipe","food"],["cutlery","Nhà hàng","Restaurant",["M7 3v8M5 3v5a2 2 0 0 0 4 0V3","M7 11v10","M17 3c-2 2-2 6 0 8v10"],"nhà_hàng quán_ăn ăn ăn_uống restaurant dining thực_đơn menu","food"],["pot","Nồi","Pot",["M4 10h16v7a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3Z","M2 10h20","M9 7h6","M10 4c-.8.8 0 1.6 0 2.4M14 4c-.8.8 0 1.6 0 2.4"],"nồi lẩu nấu hầm hot_pot","food"],["pan","Chảo","Pan",[_(9,13,6),"M15 13h7"],"chảo xào chiên rán pan fry","food"],["store","Cửa hàng","Shop",["M3 9 5 3h14l2 6","M3 9a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0","M5 12v9h14v-9","M10 21v-5h4v5"],"cửa_hàng shop store tiệm kinh_doanh bán_hàng","food"],["receipt","Hoá đơn","Receipt",["M6 2h12v20l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5-2 1.5Z","M9 7h6M9 11h6M9 15h3"],"hoá_đơn bill receipt thanh_toán đơn_hàng","food"],["scooter","Xe máy giao hàng","Scooter",[_(6,17,2.5),_(18,17,2.5),"M8.5 17h7","M15.5 17 13 9h-3","M13 9l3-4h3","M3 12h7"],"xe_máy shipper giao_đồ_ăn grab xe_ôm scooter motorbike","food"],["pulse","Nhịp tim","Heartbeat",["M2 12h4l2-5 4 10 2-5h8"],"nhịp_tim tim_mạch heartbeat pulse sức_khoẻ health","care"],["stethoscope","Khám bệnh","Doctor",["M6 3v6a4 4 0 0 0 8 0V3","M10 13v3a5 5 0 0 0 10 0v-2",_(20,12,2)],"bác_sĩ khám khám_bệnh phòng_khám doctor clinic y_tế","care"],["pill","Thuốc","Medicine",["M4.6 12.9 12.9 4.6a4.6 4.6 0 0 1 6.5 6.5l-8.3 8.3a4.6 4.6 0 0 1-6.5-6.5Z","M8.8 8.8l6.4 6.4"],"thuốc viên_uống thực_phẩm_chức_năng medicine pill vitamin","care"],["syringe","Tiêm","Injection",["M15 4l5 5-10 10-5-5Z","M18 2l4 4","M5 19l-2 2","M8 11l2 2M11 8l2 2"],"tiêm vắc_xin filler botox injection vaccine","care"],["medical","Y tế","Medical",["M9 3h6v6h6v6h-6v6H9v-6H3V9h6Z"],"y_tế bệnh_viện cấp_cứu medical hospital","care"],["tooth","Răng","Teeth",["M7 3c-3 0-4 3-3.5 6S5 15 6 19c.5 2 2 2 2.5 0l1-4c.4-1.5 2.6-1.5 3 0l1 4c.5 2 2 2 2.5 0 1-4 2-7 2.5-10S20 3 17 3c-2 0-3 1-5 1S9 3 7 3Z"],"răng nha_khoa niềng_răng tẩy_trắng dental teeth","care"],["brain","Trí não","Brain",["M12 5a3 3 0 0 0-5.5-1.5A3.5 3.5 0 0 0 4 9a3.5 3.5 0 0 0 1 6.5A3.5 3.5 0 0 0 9 20a3 3 0 0 0 3-1.5Z","M12 5a3 3 0 0 1 5.5-1.5A3.5 3.5 0 0 1 20 9a3.5 3.5 0 0 1-1 6.5A3.5 3.5 0 0 1 15 20a3 3 0 0 1-3-1.5Z","M12 5v13.5"],"não trí_não tư_duy tâm_lý trí_nhớ brain mind psychology","care"],["dna","Gen / DNA","DNA",["M7 2c0 7 10 7 10 14 0 3-1 5-1 6","M17 2c0 7-10 7-10 14 0 3 1 5 1 6","M9 6h6M8 11h8M8.5 18h7"],"dna gen di_truyền khoa_học tế_bào science","care"],["thermometer","Nhiệt độ","Temperature",["M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0Z","M12 14V9"],"sốt nhiệt_độ nhiệt_kế temperature fever","care"],["bandage","Băng dán","Bandage",["M4.5 14.5 14.5 4.5a3.5 3.5 0 0 1 5 5l-10 10a3.5 3.5 0 0 1-5-5Z","M10 10h.01M14 10h.01M10 14h.01M14 14h.01"],"vết_thương băng_dán sơ_cứu bandage","care"],["first-aid","Sơ cứu","First aid",["M3 7h18v13H3Z","M8 7V4h8v3","M12 10v7M8.5 13.5h7"],"sơ_cứu hộp_thuốc bảo_hiểm first_aid insurance","care"],["dumbbell","Tập gym","Workout",["M2 12h20","M5 8v8M8 6v12M16 6v12M19 8v8"],"gym tập tập_luyện tạ thể_hình workout fitness cơ_bắp","care"],["running","Chạy bộ","Running",[_(15,4,2),"M8 21l3-5 3 2v4","M11 16l1-6 3 2 3 1","M12 10l-4 1-2 3"],"chạy chạy_bộ cardio running marathon vận_động","care"],["yoga","Yoga / thiền","Yoga",[_(12,4.5,2),"M12 7.5V13","M12 9.5l-4 3.5 1.5 1.5M12 9.5l4 3.5-1.5 1.5","M5 18.5c2-2 4.5-2.5 7-2.5s5 .5 7 2.5c-2 1-4.5 1.5-7 1.5s-5-.5-7-1.5Z"],"yoga thiền meditation thư_giãn cân_bằng","care"],["bicycle","Đạp xe","Cycling",[_(5.5,16,3.5),_(18.5,16,3.5),"M5.5 16l4-7h6l3 7","M9.5 9 12 16H5.5","M14 6h2l-.5 3"],"xe_đạp đạp_xe cycling bike","care"],["stopwatch","Bấm giờ","Stopwatch",[_(12,14,7),"M12 14v-4","M10 3h4","M12 3v4","M18 7l1.5-1.5"],"bấm_giờ đồng_hồ_bấm_giờ phút giây timer stopwatch interval","care"],["scale","Cân nặng","Weight",["M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z","M8 10a4 4 0 0 1 8 0Z","M12 10l1.5-2.5"],"cân cân_nặng giảm_cân kg béo weight scale","care"],["drop","Nước","Water",["M12 3c3 4.5 6 8 6 11a6 6 0 0 1-12 0c0-3 3-6.5 6-11Z","M9.5 15a2.5 2.5 0 0 0 2.5 2.5"],"nước uống_nước cấp_nước cấp_ẩm water hydration giọt","care"],["lotion","Mỹ phẩm","Skincare",["M9 3h6v3H9Z","M8 6h8l1 3v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9Z","M10 13h4"],"mỹ_phẩm kem serum dưỡng_da skincare chăm_sóc_da sữa_rửa_mặt","care"],["lipstick","Son môi","Lipstick",["M9 11h6v10H9Z","M10 11V6l4-3v8","M9 15h6"],"son son_môi trang_điểm makeup lipstick","care"],["mirror","Gương","Mirror",[_(12,9,6),"M12 15v6M8 21h8"],"gương làm_đẹp beauty ngoại_hình","care"],["scissors","Cắt tóc","Haircut",[_(6,6,3),_(6,18,3),"M8.2 8.2 20 18M8.2 15.8 20 6"],"cắt cắt_tóc salon tóc barber haircut","care"],["comb","Chải tóc","Comb",["M3 9h18v4H3Z","M5 13v6M8 13v6M11 13v6M14 13v6M17 13v6"],"lược chải_tóc tóc hair","care"],["lotus","Spa","Spa",["M12 20c-5 0-9-3-9-7 3 0 6 1 9 4 3-3 6-4 9-4 0 4-4 7-9 7Z","M12 17c-2-3-2-7 0-11 2 4 2 8 0 11Z"],"spa massage thư_giãn liệu_trình wellness sen","care"],["moon","Giấc ngủ","Sleep",["M20 14a8 8 0 1 1-10-10 6.5 6.5 0 0 0 10 10Z","M16 3h3l-3 3h3"],"ngủ giấc_ngủ mất_ngủ ban_đêm sleep night","care"],["smile","Vui vẻ","Happy",[va,"M8.5 14a4 4 0 0 0 7 0","M9 9.5h.01M15 9.5h.01"],"vui hạnh_phúc hài_lòng cười happy smile","social"],["book","Sách","Book",["M4 4h11a3 3 0 0 1 3 3v14H7a3 3 0 0 1-3-3Z","M4 18a3 3 0 0 1 3-3h11"],"sách tài_liệu ebook book đọc_sách","learn"],["book-open","Bài học","Lesson",["M2 5h7a3 3 0 0 1 3 3v12a2.5 2.5 0 0 0-2.5-2.5H2Z","M22 5h-7a3 3 0 0 0-3 3v12a2.5 2.5 0 0 1 2.5-2.5H22Z"],"bài_học học đọc kiến_thức lesson learn study","learn"],["graduation","Tốt nghiệp","Graduation",["M2 9l10-5 10 5-10 5Z","M6 11v5c3 2.5 9 2.5 12 0v-5","M22 9v6"],"tốt_nghiệp khoá_học đại_học học_viên course graduation education giáo_dục","learn"],["pencil","Viết","Write",["M4 20l1-5L16 4l4 4L9 19Z","M14 6l4 4"],"viết bút ghi_chú bài_tập write note homework","learn"],["ruler","Đo lường","Ruler",["M3 16 16 3l5 5L8 21Z","M7 12l2 2M10 9l2 2M13 6l2 2"],"thước đo kích_thước ruler measure","learn"],["backpack","Học sinh","Student",["M6 8a6 6 0 0 1 12 0v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1Z","M9 4V3h6v1","M8 14h8v4H8Z"],"học_sinh sinh_viên đi_học balo student school","learn"],["school","Trường học","School",["M3 21V10l9-6 9 6v11","M3 21h18","M10 21v-5h4v5",_(12,11,1.8)],"trường trường_học trung_tâm school academy","learn"],["certificate","Chứng chỉ","Certificate",["M4 4h16v12H4Z","M8 8h8M8 11h5",_(16,17,2.5),"M14.5 19 14 22l2-1 2 1-.5-3"],"chứng_chỉ bằng_cấp chứng_nhận certificate diploma","learn"],["robot","AI / robot","AI robot",["M5 8h14v11H5Z","M12 8V5",_(12,3.5,1),"M9 13h.01M15 13h.01","M9.5 16.5h5","M2 12v3M22 12v3"],"ai trí_tuệ_nhân_tạo robot chatbot tự_động automation bot","learn"],["laptop","Máy tính","Laptop",["M5 5h14v10H5Z","M2 19h20l-2-4H4Z"],"laptop máy_tính làm_việc online computer","learn"],["monitor","Màn hình","Screen",["M3 4h18v12H3Z","M8 21h8M12 16v5"],"màn_hình desktop screen dashboard","learn"],["code","Lập trình","Code",["m8 7-5 5 5 5","m16 7 5 5-5 5","m14 4-4 16"],"code lập_trình developer website phần_mềm programming","learn"],["wifi","Internet","Wi-Fi",["M2 9a15 15 0 0 1 20 0","M5 12.5a10 10 0 0 1 14 0","M8.5 16a5 5 0 0 1 7 0","M12 19.5h.01"],"wifi internet mạng kết_nối online","learn"],["server","Dữ liệu","Server",["M4 4h16v6H4Z","M4 14h16v6H4Z","M8 7h.01M8 17h.01"],"máy_chủ server dữ_liệu lưu_trữ hosting database","learn"],["cursor","Click","Click",["M5 3l14 8-6 2-2 6Z","M13 13l5 5"],"click bấm nhấn_vào link chuột cursor","learn"],["gamepad","Game","Game",["M7 7h10a5 5 0 0 1 4.9 6l-.8 4a2.5 2.5 0 0 1-4.3 1.2L14 15h-4l-2.8 3.2A2.5 2.5 0 0 1 2.9 17l-.8-4A5 5 0 0 1 7 7Z","M8 10v4M6 12h4","M15 11h.01M17 13h.01"],"game chơi_game gaming trò_chơi esport","learn"],["headphones","Nghe","Listen",["M4 15v-3a8 8 0 0 1 16 0v3","M4 15h3v6H5a1 1 0 0 1-1-1Z","M20 15h-3v6h2a1 1 0 0 0 1-1Z"],"nghe tai_nghe podcast audio listen","learn"],["mic","Micro","Microphone",["M12 2a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z","M5 11a7 7 0 0 0 14 0","M12 18v4"],"micro nói giọng_nói thu_âm voice speak livestream","learn"],["video-cam","Quay video","Recording",["M3 7h12v10H3Z","M15 10l6-3v10l-6-3"],"quay quay_video camera vlog recording","learn"],["link","Liên kết","Link",["M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1","M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"],"link liên_kết kết_nối đường_dẫn connect","learn"],["puzzle","Giải pháp","Puzzle",["M4 7h4a2 2 0 1 1 4 0h4v4a2 2 0 1 1 0 4v4H4v-4a2 2 0 1 0 0-4Z"],"giải_pháp mảnh_ghép tích_hợp puzzle solution integration","learn"],["search","Tìm kiếm","Search",[_(10.5,10.5,6.5),"m15.5 15.5 5 5"],"tìm tìm_kiếm search google nghiên_cứu research","learn"],["gear","Cài đặt","Settings",[_(12,12,3),_(12,12,7),"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1"],"cài_đặt thiết_lập quy_trình vận_hành settings process setup","learn"],["calculator","Tính toán","Calculator",["M5 3h14v18H5Z","M8 6h8v3H8Z","M8 13h.01M12 13h.01M16 13h.01M8 17h.01M12 17h.01M16 17h.01"],"tính tính_toán máy_tính_tiền kế_toán calculator accounting","learn"],["translate","Ngôn ngữ","Language",["M3 5h10M8 3v2","M5 5c1 4 4 7 7 8","M11 5c-1 4-4 7-7 8","M13 21l4-9 4 9","M14.5 18h5"],"ngôn_ngữ tiếng_anh dịch ngoại_ngữ language translate english","learn"],["download","Tải về","Download",["M12 3v12","m7 10 5 5 5-5","M4 21h16"],"tải tải_về download cài_app","learn"],["battery","Năng lượng","Battery",["M3 7h15v10H3Z","M21 10v4","M6 10v4M9 10v4"],"pin năng_lượng sạc battery energy","learn"],["door","Cửa","Door",["M6 3h12v18H6Z","M14 12h.01","M3 21h18"],"cửa cửa_ra_vào door entrance","place"],["bed","Phòng ngủ","Bedroom",["M3 18V6","M3 13h18v5","M21 18v-5a3 3 0 0 0-3-3h-8v3",_(6.5,10.5,1.5)],"phòng_ngủ giường khách_sạn homestay bedroom hotel","place"],["sofa","Phòng khách","Living room",["M5 11V8a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v3","M3 11a2 2 0 0 1 2 2v2h14v-2a2 2 0 1 1 4 0v5H1v-5a2 2 0 0 1 2-2Z","M5 20v1M19 20v1"],"phòng_khách sofa nội_thất living_room furniture","place"],["bath","Phòng tắm","Bathroom",["M3 12h18v3a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5Z","M6 12V5a2 2 0 0 1 4 0","M7 20l-1 2M17 20l1 2"],"phòng_tắm bồn_tắm wc toilet bathroom","place"],["area","Diện tích","Floor area",["M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5","M4 4l6 6M20 4l-6 6M20 20l-6-6M4 20l6-6"],"diện_tích m2 mét_vuông rộng area size","place"],["plane","Máy bay","Flight",["M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5Z"],"máy_bay bay chuyến_bay vé_máy_bay du_lịch flight travel","place"],["suitcase","Hành lý","Luggage",["M4 7h16v13H4Z","M9 7V4h6v3","M9 7v13M15 7v13"],"vali hành_lý đi_du_lịch luggage trip","place"],["ticket","Vé","Ticket",["M3 7h18v3a2 2 0 0 0 0 4v3H3v-3a2 2 0 0 0 0-4Z","M14 7v2M14 11v2M14 15v2"],"vé voucher sự_kiện ticket event","place"],["map","Bản đồ","Map",["M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3Z","M9 3v15M15 6v15"],"bản_đồ lộ_trình hành_trình map route","place"],["mountain","Núi","Mountain",["M2 20 9 8l4 6 3-4 6 10Z","M7.5 10.5 9 12l1.5-1.5"],"núi leo_núi trekking phượt mountain","place"],["umbrella","Biển","Beach",["M3 11a9 9 0 0 1 18 0Z","M12 11v10","M12 2v2"],"biển bãi_biển nghỉ_dưỡng resort beach ô_dù","place"],["palm","Nhiệt đới","Tropical",["M12 21c0-5 .5-9 1-12","M13 9c-2-3-6-4-9-2 3 0 5 1 6 3","M13 9c1-3 4-5 8-4-3 1-5 3-5 5","M13 9c-1-2-1-5 1-7 1 2 1 5-1 7","M7 21h12"],"dừa nhiệt_đới đảo kỳ_nghỉ tropical island vacation","place"],["sun","Nắng","Sunny",[_(12,12,4),"M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"],"nắng mặt_trời mùa_hè thời_tiết sunny summer weather","place"],["rain","Mưa","Rain",["M7 14a4 4 0 0 1 .5-8A6 6 0 0 1 18.5 8a3.5 3.5 0 0 1-.5 6Z","M8 17l-1 3M12 17l-1 3M16 17l-1 3"],"mưa mùa_mưa bão rain storm","place"],["pool","Hồ bơi","Pool",["M8 12V4M16 12V4M8 6h8M8 10h8","M2 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0","M2 19c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0"],"hồ_bơi bể_bơi bơi pool swimming tiện_ích","place"],["tent","Cắm trại","Camping",["M12 3 2 21h20Z","M9 21l3-6 3 6"],"cắm_trại camping glamping dã_ngoại","place"],["tree","Cây xanh","Greenery",["M12 22v-6","M12 2l6 8h-3l4 6H5l4-6H6Z"],"cây cây_xanh công_viên thiên_nhiên tree park green","place"],["train","Tàu","Train",["M6 3h12a2 2 0 0 1 2 2v10a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V5a2 2 0 0 1 2-2Z","M4 10h16","M8 14h.01M16 14h.01","M8 18l-2 3M16 18l2 3"],"tàu tàu_hoả metro tàu_điện train","place"],["bus","Xe buýt","Bus",["M5 3h14a1 1 0 0 1 1 1v13H4V4a1 1 0 0 1 1-1Z","M4 10h16","M7 14h.01M17 14h.01","M6 17v3M18 17v3"],"xe_buýt xe_khách bus tour","place"],["car","Ô tô","Car",["M3 13l2-5a2 2 0 0 1 2-1h10a2 2 0 0 1 2 1l2 5v5H3Z","M3 13h18",_(7.5,16,1),_(16.5,16,1),"M5 18v2M19 18v2"],"ô_tô xe_hơi xe car vehicle lái_xe","place"],["fuel","Xăng","Fuel",["M4 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M3 21h12","M7 7h4v4H7Z","M14 9h2a2 2 0 0 1 2 2v6a1.5 1.5 0 0 0 3 0V8l-3-3"],"xăng nhiên_liệu đổ_xăng tiết_kiệm_xăng fuel gas","place"],["ev-charge","Xe điện","EV charging",["M5 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M4 21h12","M10 7l-2 4h4l-2 4","M15 10h2a2 2 0 0 1 2 2v4a1.5 1.5 0 0 0 3 0V9"],"xe_điện sạc_xe trạm_sạc vinfast ev electric","place"],["road","Đường đi","Road",["M8 3 4 21M16 3l4 18","M12 4v2M12 10v3M12 17v3"],"con_đường đường_đi đường_phố đường_cao_tốc cao_tốc hành_trình road highway street","place"],["parking","Đỗ xe","Parking",["M4 4h16v16H4Z","M9 17V7h4a3 3 0 0 1 0 6H9"],"đỗ_xe bãi_xe hầm_xe parking","place"],["steering","Lái xe","Driving",[va,_(12,12,2),"M3.5 10h6.5M14 10h6.5M12 14v7"],"lái lái_xe vô_lăng học_lái driving","place"],["speedometer","Tốc độ","Speed",["M4 18a9 9 0 1 1 16 0","M12 14l4-5","M12 14h.01"],"tốc_độ km/h vận_tốc speed performance hiệu_suất","place"],["traffic-light","Giao thông","Traffic",["M8 2h8v20H8Z",_(12,6.5,1.6),_(12,12,1.6),_(12,17.5,1.6)],"giao_thông đèn_đỏ kẹt_xe traffic","place"],["ship","Tàu thuỷ","Ship",["M3 15h18l-3 5H6Z","M5 15V9h14v6","M9 9V5h6v4","M12 2v3"],"tàu_thuỷ du_thuyền cảng xuất_khẩu logistics ship cruise","place"],["megaphone","Thông báo","Announcement",["M3 10v4h4l9 5V5l-9 5Z","M7 14l1.5 6H11l-1-5","M19 9a4 4 0 0 1 0 6"],"thông_báo quảng_cáo marketing loa announce ads","social"],["bell","Chuông","Notification",["M6 16v-5a6 6 0 0 1 12 0v5l2 2H4Z","M10 21h4"],"chuông thông_báo nhắc subscribe đăng_ký_kênh notification","social"],["hashtag","Hashtag","Hashtag",["M5 9h14M5 15h14M10 3 8 21M16 3l-2 18"],"hashtag xu_hướng tag trending","social"],["at","Tài khoản","Mention",[_(12,12,4),"M16 8v5a2.5 2.5 0 0 0 5 0v-1a9 9 0 1 0-3.5 7.1"],"tài_khoản tag nhắc_tên username mention","social"],["user-plus","Theo dõi","Follow",[_(9,8,4),"M2 21a7 7 0 0 1 14 0","M19 8v6M16 11h6"],"follow theo_dõi kết_bạn follower người_theo_dõi","social"],["live","Livestream","Live",[_(12,12,2),"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 7.8a6 6 0 0 1 0 8.4","M4.9 4.9a10 10 0 0 0 0 14.2M19.1 4.9a10 10 0 0 1 0 14.2"],"live livestream phát_sóng trực_tiếp broadcast","social"],["share","Chia sẻ","Share",[_(6,12,2.5),_(18,6,2.5),_(18,18,2.5),"M8.2 10.8l7.6-3.6M8.2 13.2l7.6 3.6"],"chia_sẻ share lan_toả viral","social"],["sad","Buồn","Sad",[va,"M8.5 16a4 4 0 0 1 7 0","M9 9.5h.01M15 9.5h.01"],"buồn thất_vọng chán sad upset","social"],["wow","Bất ngờ","Surprise",[va,_(12,15.5,1.8),"M9 9.5h.01M15 9.5h.01"],"bất_ngờ ngạc_nhiên wow sốc shock","social"],["crown","Đẳng cấp","Premium",["M3 8l4.5 4L12 5l4.5 7L21 8l-2 11H5Z","M5 19h14"],"vương_miện đẳng_cấp vip cao_cấp king queen","money"],["medal","Huy chương","Medal",[_(12,15,5),"M8.5 11 5 3h4l3 6 3-6h4l-3.5 8","M12 13v4"],"huy_chương giải thành_tích medal achievement","money"],["flag","Cột mốc","Milestone",["M5 21V4","M5 4h12l-2 4 2 4H5"],"cột_mốc mục_tiêu về_đích bắt_đầu milestone flag","money"],["handshake","Hợp tác","Partnership",["M2 11l4-4 4 2 3-2 4 1 5 4","M7 12l4 4a1.5 1.5 0 0 0 2-2","M10 14l2 2a1.5 1.5 0 0 0 2-2l-3-3","M13 13l1.5 1.5a1.5 1.5 0 0 0 2-2L13 9"],"hợp_tác đối_tác thoả_thuận deal partner partnership","money"],["briefcase","Công việc","Work",["M3 7h18v13H3Z","M8 7V4h8v3","M3 13h18"],"công_việc việc_làm tuyển_dụng doanh_nghiệp job business office","money"],["wallet","Ví tiền","Wallet",["M3 6a2 2 0 0 1 2-2h12v4","M3 6v12a2 2 0 0 0 2 2h16V8H5a2 2 0 0 1-2-2Z","M16 14h.01"],"ví ví_tiền chi_tiêu ví_điện_tử wallet spending","money"],["card","Thẻ","Card",["M2 5h20v14H2Z","M2 10h20","M6 15h4"],"thẻ thẻ_tín_dụng thanh_toán quẹt_thẻ card payment","money"],["bank","Ngân hàng","Bank",["M3 10 12 4l9 6","M4 10h16","M6 10v8M10 10v8M14 10v8M18 10v8","M3 21h18"],"ngân_hàng vay lãi_suất bank loan","money"],["piggy","Heo đất","Piggy bank",["M5 11a7 6 0 0 1 12-3h2l1 3h1v4h-2l-1 3h-3v2h-3v-2H9v2H6v-3a6 6 0 0 1-1-6Z","M14 9h.01","M9 7h4"],"heo_đất để_dành tích_luỹ piggy saving","money"],["document","Tài liệu","Document",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 13h7M9 17h5"],"tài_liệu hồ_sơ giấy_tờ báo_cáo document file","money"],["contract","Hợp đồng","Contract",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 17c1-2 2 1 3-1s2 1 3 0"],"hợp_đồng ký ký_kết pháp_lý contract sign legal","money"],["folder","Thư mục","Folder",["M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v11H3Z"],"thư_mục lưu_trữ folder","money"],["clipboard","Danh sách","Checklist",["M8 4H6v17h12V4h-2","M9 3h6v3H9Z","m9 13 2 2 4-4"],"checklist danh_sách việc_cần_làm todo kế_hoạch plan","money"],["pie","Tỷ trọng","Pie chart",["M21 12a9 9 0 1 1-9-9v9Z","M15 3a9 9 0 0 1 6 6h-6Z"],"tỷ_trọng thị_phần cơ_cấu pie market_share","money"],["funnel","Phễu","Funnel",["M3 4h18l-7 9v6l-4 2v-8Z"],"phễu lọc chuyển_đổi khách_hàng_tiềm_năng funnel filter conversion","money"],["magnet","Thu hút","Attract",["M5 4v8a7 7 0 0 0 14 0V4h-5v8a2 2 0 0 1-4 0V4Z","M5 8h5M14 8h5"],"thu_hút hút_khách nam_châm attract magnet lead","money"],["hourglass","Chờ đợi","Waiting",["M6 3h12M6 21h12","M7 3c0 5 10 5 10 9s-10 4-10 9","M17 3c0 5-10 5-10 9s10 4 10 9"],"chờ chờ_đợi hạn sắp_hết thời_hạn countdown deadline","money"],["infinity","Không giới hạn","Unlimited",["M12 12c-2-2.7-4-4-6-4a4 4 0 0 0 0 8c2 0 4-1.3 6-4Zm0 0c2 2.7 4 4 6 4a4 4 0 0 0 0-8c-2 0-4 1.3-6 4Z"],"không_giới_hạn mãi_mãi vô_hạn unlimited forever","money"],["refresh","Lặp lại","Repeat",["M21 12a9 9 0 0 1-15.5 6.3L3 16","M3 12a9 9 0 0 1 15.5-6.3L21 8","M3 21v-5h5M21 3v5h-5"],"lặp_lại đổi_trả hoàn_tiền cập_nhật refund repeat update","money"],["paw","Thú cưng","Pets",[_(7,9,1.8),_(17,9,1.8),_(10,5,1.6),_(14,5,1.6),"M12 12c-3 0-5 3-5 5.5 0 2 1.5 2.5 3 2 1-.3 1.5-.5 2-.5s1 .2 2 .5c1.5.5 3 0 3-2 0-2.5-2-5.5-5-5.5Z"],"thú_cưng chó mèo pet dog cat","social"]],Lt=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,Zc=Lt(12,12,9),qi={money:"Tiền",coins:"Tiết kiệm",percent:"Phần trăm",growth:"Tăng trưởng",decline:"Giảm",chart:"Biểu đồ",target:"Mục tiêu",clock:"Thời gian",calendar:"Lịch",user:"Cá nhân",users:"Đội nhóm",cart:"Giỏ hàng",bag:"Sản phẩm",gift:"Quà tặng",tag:"Giảm giá",rocket:"Ra mắt",bulb:"Ý tưởng",bolt:"Nhanh",star:"Ngôi sao",heart:"Trái tim",shield:"Uy tín",lock:"Riêng tư",key:"Bí quyết",check:"Hoàn thành",cross:"Sai",warning:"Lưu ý",question:"Câu hỏi",phone:"Điện thoại",chat:"Tin nhắn",mail:"Email",globe:"Toàn cầu",home:"Nhà",location:"Địa điểm",truck:"Giao hàng",fire:"Nổi bật",trophy:"Chiến thắng",sparkle:"Mới",chip:"Công nghệ",play:"Video",camera:"Ảnh",eye:"Lượt xem",like:"Thích",leaf:"Tự nhiên",music:"Âm nhạc"},Gi={money:"money",coins:"money",percent:"money",growth:"money",decline:"money",chart:"money",target:"money",tag:"money",cart:"money",bag:"money",gift:"money",trophy:"money",user:"social",users:"social",heart:"social",like:"social",chat:"social",mail:"social",phone:"social",eye:"social",fire:"social",play:"social",camera:"social",music:"social",chip:"learn",bulb:"learn",rocket:"learn",question:"learn",globe:"learn",home:"place",location:"place",truck:"place",leaf:"place"},Z=(t,e,c,o)=>[t,{name:qi[t],en:e,d:c,hints:o,group:Gi[t]??"general"}],ja=Object.freeze(Object.fromEntries([Z("money","Money",["M2.5 6.5h19v11h-19Z",Lt(12,12,2.6),"M6 12h.01M18 12h.01"],"tiền giá triệu tỷ nghìn vnd usd $ money price cash cost chi_phí thu_nhập lương giá_tiền"),Z("coins","Savings",["M5 7a7 3 0 1 0 14 0a7 3 0 1 0 -14 0Z","M5 7v5c0 1.7 3.1 3 7 3s7-1.3 7-3V7","M5 12v5c0 1.7 3.1 3 7 3s7-1.3 7-3v-5"],"tiết_kiệm đầu_tư vốn ngân_sách save savings coin invest budget"),Z("percent","Percent",["M19 5 5 19",Lt(6.5,6.5,2.5),Lt(17.5,17.5,2.5)],"% phần_trăm tỷ_lệ percent rate"),Z("growth","Growth",["M3 17l6-6 4 4 8-8","M15 7h6v6"],"tăng tăng_trưởng doanh_thu lợi_nhuận lãi gấp_đôi gấp growth revenue profit increase scale x2 x3 x10"),Z("decline","Decline",["M3 7l6 6 4-4 8 8","M15 17h6v-6"],"giảm thua_lỗ lỗ sụt tụt drop loss decline fall"),Z("chart","Chart",["M4.5 20V11M10 20V5M15.5 20v-6M2.5 20h19"],"số_liệu báo_cáo thống_kê dữ_liệu kết_quả data report stats result analytics"),Z("target","Target",[Zc,Lt(12,12,4.5),Lt(12,12,.6)],"mục_tiêu chính_xác tập_trung target goal aim focus"),Z("clock","Time",[Zc,"M12 7.5V12l3 2"],"thời_gian phút giờ giây đồng_hồ time minute hour second deadline watch"),Z("calendar","Calendar",["M4 5.5h16v15H4Z","M4 10h16M8 3v4M16 3v4"],"ngày lịch tuần tháng năm lịch_hẹn date day week month year schedule"),Z("user","Person",[Lt(12,8,4),"M4.5 20.5a7.5 7.5 0 0 1 15 0"],"khách khách_hàng customer user person client founder"),Z("users","Team",[Lt(9,8.5,3.5),"M2.5 20a6.5 6.5 0 0 1 13 0","M16 5.2a3.5 3.5 0 0 1 0 6.6","M18 14.3a6.5 6.5 0 0 1 3.5 5.7"],"đội đội_ngũ nhóm cộng_đồng nhân_viên team community people staff"),Z("cart","Cart",["M3 4h2.2l2.3 11h10.8l2.2-8H6.3",Lt(10,19.5,1.5),Lt(17,19.5,1.5)],"mua đặt_hàng đơn_hàng giỏ_hàng mua_sắm buy order cart checkout"),Z("bag","Product",["M5 8h14l-1 13H6Z","M9 8V6.5a3 3 0 0 1 6 0V8"],"sản_phẩm mặt_hàng túi product item bag"),Z("gift","Gift",["M3.5 8.5h17v4h-17Z","M5 12.5v8h14v-8M12 8.5v12","M12 8.5C10.5 4.5 6 4.5 6.5 7c.3 1.5 3.5 1.5 5.5 1.5ZM12 8.5c1.5-4 6-4 5.5-1.5-.3 1.5-3.5 1.5-5.5 1.5Z"],"quà quà_tặng tặng miễn_phí ưu_đãi phần_thưởng free gift bonus"),Z("tag","Sale",["M3 12.5V3.5h9l9 9-9 9Z",Lt(7.5,8,.9)],"giảm_giá khuyến_mãi sale discount deal voucher mã_giảm"),Z("rocket","Launch",["M12 2.5c3.5 2.5 5 6.5 3.5 12h-7C7 9 8.5 5 12 2.5Z","M8.5 14.5 6 17l1 4 3-2.5M15.5 14.5 18 17l-1 4-3-2.5",Lt(12,9,1.6)],"ra_mắt khởi_nghiệp bứt_phá phóng launch startup boost"),Z("bulb","Idea",["M9 18h6M10 21h4","M12 3a6 6 0 0 0-3.8 10.6c.6.5.8 1.3.8 2.4h6c0-1.1.2-1.9.8-2.4A6 6 0 0 0 12 3Z"],"ý_tưởng mẹo bí_kíp sáng_tạo idea tip hack creative insight"),Z("bolt","Fast",["M13 2 4.5 13.5H11L10 22l8.5-11.5H12Z"],"nhanh ngay lập_tức năng_lượng tốc_độ fast instant energy power quick speed"),Z("star","Star",["m12 3 2.8 5.8 6.2.9-4.5 4.4 1.1 6.2L12 17.4l-5.6 2.9 1.1-6.2L3 9.7l6.2-.9Z"],"đánh_giá chất_lượng tốt_nhất xuất_sắc cao_cấp star review rating best quality premium"),Z("heart","Love",["M12 20.5S4 15.9 4 10a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.9-8 10.5-8 10.5Z"],"yêu thích tim sức_khoẻ sức_khỏe chăm_sóc love like health care"),Z("shield","Trust",["M12 2.5 4 5.5v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10v-6Z","m8.5 12 2.5 2.5 4.5-5"],"an_toàn bảo_mật bảo_hành uy_tín chính_hãng secure safe trust guarantee warranty"),Z("lock","Private",["M5 10.5h14v10H5Z","M8 10.5V7a4 4 0 0 1 8 0v3.5"],"riêng_tư mật_khẩu khoá private lock password privacy"),Z("key","Key",[Lt(7.5,15.5,4),"M10.5 12.5 20 3M16.5 6.5 19 9M14 9l2 2"],"chìa_khoá chìa_khóa bí_quyết bí_mật key secret unlock"),Z("check","Done",[Zc,"m8 12.5 2.8 2.8L16.5 9.5"],"hoàn_thành hiệu_quả chính_xác xong đúng đạt done ok correct works"),Z("cross","Wrong",[Zc,"m9 9 6 6M15 9l-6 6"],"sai lỗi đừng không_nên tránh sai_lầm mistake wrong error avoid"),Z("warning","Warning",["M12 3.5 2.5 20h19Z","M12 10v4.5M12 17.5h.01"],"lưu_ý cảnh_báo chú_ý nguy_hiểm rủi_ro warning risk careful"),Z("question","Question",[Zc,"M9.5 9.2a2.6 2.6 0 0 1 5 .8c0 1.8-2.5 2.2-2.5 4","M12 17h.01"],"câu_hỏi tại_sao vì_sao thế_nào làm_sao question why how"),Z("phone","Phone",["M8.5 2.5h7A1.5 1.5 0 0 1 17 4v16a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 7 20V4a1.5 1.5 0 0 1 1.5-1.5Z","M11 18.5h2"],"điện_thoại ứng_dụng app gọi mobile phone call smartphone"),Z("chat","Message",["M4 4.5h16V16H10l-5 4v-4H4Z","M8 10.2h.01M12 10.2h.01M16 10.2h.01"],"tin_nhắn nhắn_tin inbox bình_luận chat message comment dm"),Z("mail","Email",["M3 5.5h18v13H3Z","m3 6.5 9 6.5 9-6.5"],"email thư mail newsletter"),Z("globe","Global",[Zc,"M3 12h18","M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z"],"toàn_cầu quốc_tế thế_giới online website web global world international"),Z("home","Home",["m3 11 9-8 9 8","M5 9.5V21h14V9.5","M10 21v-6h4v6"],"nhà ngôi_nhà gia_đình home house family"),Z("location","Location",["M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z",Lt(12,10,2.5)],"địa_chỉ cửa_hàng chi_nhánh vị_trí bản_đồ location address store map"),Z("truck","Delivery",["M2.5 6h11v10h-11Z","M13.5 9.5h4l3 3.5v3h-7",Lt(6.8,18,1.8),Lt(17.3,18,1.8)],"giao_hàng vận_chuyển ship delivery shipping freeship"),Z("fire","Hot",["M12 21.5c4 0 7-2.8 7-6.8 0-3.6-2.4-5.8-4-8.7-.7 1.8-1.7 2.8-2.9 3C12.2 6.4 11 4.2 9 2.5c.2 3.8-4 6-4 12.2 0 4 3 6.8 7 6.8Z"],"hot bán_chạy xu_hướng viral trend cháy_hàng"),Z("trophy","Winner",["M8 3.5h8v6a4 4 0 0 1-8 0Z","M8 5H4.5v1.5A3.5 3.5 0 0 0 8 10M16 5h3.5v1.5A3.5 3.5 0 0 1 16 10","M12 13.5v4M9 21h6M10 17.5h4V21h-4Z"],"chiến_thắng số_1 top giải_thưởng vô_địch winner trophy award champion"),Z("sparkle","New",["m12 2.5 2.2 6.3L20.5 11l-6.3 2.2L12 19.5l-2.2-6.3L3.5 11l6.3-2.2Z","m19 16 .8 2.2L22 19l-2.2.8L19 22l-.8-2.2L16 19l2.2-.8Z"],"mới đặc_biệt thông_minh phép_màu ai new special magic smart"),Z("chip","Tech",["M7 7h10v10H7Z","M10 10h4v4h-4Z","M9 3v4M15 3v4M9 17v4M15 17v4M3 9h4M3 15h4M17 9h4M17 15h4"],"công_nghệ phần_mềm máy_tính tech technology software computer"),Z("play","Video",[Zc,"m10 8.5 5.5 3.5-5.5 3.5Z"],"video clip kênh youtube tiktok play watch"),Z("camera","Photo",["M3 7.5h4l1.5-2.5h7L17 7.5h4v12H3Z",Lt(12,13.3,3.5)],"ảnh hình_ảnh chụp máy_ảnh photo camera picture"),Z("eye","View",["M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12Z",Lt(12,12,3)],"lượt_xem nhìn view views see"),Z("like","Like",["M7 10.5v10H3.5v-10Z","M7 10.5 11 3c1.7 0 2.8 1.3 2.5 3l-.7 3.5H19a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.8 21H7"],"đồng_ý tuyệt_vời like thumbs good great"),Z("leaf","Natural",["M5 19c0-8 5-14 15-14 0 10-6 15-14 15","M5 19c3-4 6-7 10-9"],"tự_nhiên thiên_nhiên hữu_cơ organic eco natural green"),Z("music","Music",["M9 18V5l11-2v13",Lt(6,18,3),Lt(17,16,3)],"âm_nhạc bài_hát âm_thanh nhạc music song sound audio"),...Ei.map(([t,e,c,o,n,s])=>[t,{name:e,en:c,d:o,hints:n,group:s}])].sort((t,e)=>t[0].localeCompare(e[0])))),Oi=Object.keys(ja),Ni=t=>String(t).normalize("NFC").toLowerCase();Oi.flatMap(t=>ja[t].hints.split(" ").map(e=>[Ni(e).replace(/_/g," "),t])),new Set("và của là có không được cho một những các này đó để trong với khi thì mà như cũng đã sẽ rất hơn nhiều tôi bạn mình anh chị em ở từ ra vào lên xuống nên nếu vì nhưng hay còn đang lại cái con người gì sao thế vậy rồi nè nha ạ à ơi ai đâu nào bị bởi tại theo về qua sau trước the a an and or of to in on is are was were for with that this it as at by be i you we they he she my your our not but so if do does did have has had will can just very more".split(" "));const Do=Object.freeze([["cube","Cube","Hộp 3D xoay","3D cube turn",1,["3d","cube","rotate"]],["inside-cube","InsideCube","Trong lòng hộp","Inside the cube",1,["3d","cube","room"]],["cross-warp","CrossWarp","Kéo giãn chéo","Cross warp",.8,["warp","zoom"]],["cross-zoom","CrossZoom","Zoom nhoè chéo","Cross zoom blur",.8,["zoom","blur","impact"]],["doorway","Doorway","Cửa đôi mở","Doorway",1,["3d","door","open"]],["dreamy","Dreamy","Mộng mơ gợn sóng","Dreamy wave",1,["dream","wave","soft"]],["dreamy-zoom","DreamyZoom","Zoom mộng mơ","Dreamy zoom",1,["dream","zoom","flash"]],["ripple","Ripple","Gợn sóng lan","Spreading ripple",1,["water","wave"]],["water-drop","WaterDrop","Giọt nước","Water drop",1.2,["water","drop","ripple"]],["shockwave","Shockwave","Sóng xung kích kính vỡ","Glass shockwave",1.2,["glass","shatter","impact"]],["kaleidoscope","Kaleidoscope","Kính vạn hoa","Kaleidoscope",1,["kaleidoscope","spin","psychedelic"]],["morph","Morph","Biến hình","Morph",1,["morph","liquid"]],["mosaic","Mosaic","Ghép mảnh xoay","Mosaic pan",1.2,["tiles","pan"]],["hexagonalize","Hexagonalize","Lục giác hoá","Hexagonalize",1,["hexagon","pixel","tech"]],["honeycomb","Honeycomb","Tổ ong","Honeycomb",1.2,["hexagon","tiles","tech"]],["puzzle","Puzzle","Ghép hình rơi","Puzzle pieces",1.4,["puzzle","pieces","fall"]],["shatter","Shatter","Vỡ kính","Shatter",1.2,["glass","break","impact"]],["tile-blast","TileBlast","Ô vuông bung ra","Tile blast",1.2,["tiles","explode","3d"]],["tunnel","Tunnel","Đường hầm","Tunnel",1.2,["tunnel","3d","fly"]],["vortex","Vortex","Lốc xoáy mảnh","Vortex",1.4,["tornado","pieces","wind"]],["warp-speed","WarpSpeed","Tốc độ ánh sáng","Warp speed",1.2,["space","speed","stars"]],["gravity-lens","GravityLens","Thấu kính hấp dẫn","Gravity lens",1.2,["space","black hole","warp"]],["fisheye","Fisheye","Mắt cá phồng","Fisheye bulge",1,["lens","bulge"]],["film-burn","FilmBurn","Cháy phim loé","Film burn flare",1.2,["film","retro","light"]],["film-strip","FilmStrip","Cuộn phim trượt","Film strip slip",1.2,["film","retro","projector"]],["glitch-memories","GlitchMemories","Glitch ký ức","Glitch memories",.8,["glitch","digital"]],["datamosh","StripDatamoshGlitch","Datamosh xé dải","Datamosh strips",1,["glitch","datamosh","digital"]],["vhs-tracking","VhsTracking","Nhiễu băng VHS","VHS tracking",1,["vhs","retro","noise"]],["tv-turn-off","TvTurnOff","Tắt TV cũ","Old TV off",1,["tv","retro"]],["ink-bleed","InkBleed","Mực loang nước","Ink bleed",1.4,["ink","organic","art"]],["watercolor","WatercolorDissolve","Màu nước","Watercolour",1.4,["paint","art","soft"]],["smoke","SmokeDissolve","Khói tràn","Smoke dissolve",1.4,["smoke","organic"]],["paper-tear","PaperTear","Xé giấy đôi","Paper tear",1.2,["paper","tear","collage"]],["crumple","Crumple","Vò giấy","Crumple",1.2,["paper","3d"]],["sphere","Sphere","Cuộn thành cầu","Sphere roll",1.2,["3d","ball"]],["book-flip","BookFlip","Lật trang sách","Book page flip",1.2,["book","page","3d"]],["split-flap","SplitFlap","Bảng lật sân bay","Split-flap board",1.4,["board","flip","retro"]],["disintegrate","Disintegrate","Tan thành bụi","Disintegrate",1.4,["dust","particles"]],["vaporize","Vaporize","Bốc hơi","Vaporize",1.4,["smoke","particles"]],["light-rays","LightRays","Tia sáng toả","Light rays",1.2,["light","glow"]],["prisms","Prisms","Lăng trụ xoay","Prism billboard",1.2,["3d","billboard"]],["reeded-glass","ReededGlass","Kính gân","Reeded glass",1,["glass","refraction"]],["swim","Swim","Hoá cá bơi","Swim away",1.4,["fun","organic"]],["heat-haze","HeatHaze","Hơi nóng","Heat haze",1,["heat","distortion"]]].map(([t,e,c,o,n,s])=>Object.freeze({id:t,file:e,name:c,nameEn:o,duration:n,tags:Object.freeze(s)})));Object.freeze(Do.map(t=>t.id));const Ii=t=>`gl-${t}`;Object.freeze(Do.map((t,e)=>Object.freeze({id:Ii(t.id),version:1,name:t.name,category:"Shader GPU",duration:t.duration,tags:["gpu","shader",...t.tags],sortOrder:5e3+e*10,gl:{id:t.id}}))),Object.freeze([{id:"whip",n:1,vi:"Quất",en:"Whip",pts:[[0,0],[.25,.08],[.4,.35],[.5,1],[.6,.35],[.75,.08],[1,0]],fx:{blurH:.8,rgbShift:.3}},{id:"whip-out",n:2,vi:"Quất ra",en:"Whip out",pts:[[0,0],[.3,.25],[.45,.7],[.5,1],[.56,.3],[.65,0],[1,0]],fx:{blurH:.9,shake:.3}},{id:"whip-in",n:3,vi:"Quất vào",en:"Whip in",pts:[[0,0],[.35,0],[.44,.3],[.5,1],[.55,.7],[.7,.25],[1,0]],fx:{blurH:.9,zoomBlur:.3}},{id:"slow-fast-slow",n:4,vi:"Chậm – nhanh – chậm",en:"Slow – fast – slow",pts:[[0,0],[.15,-.6],[.32,-.6],[.5,1],[.68,-.6],[.85,-.6],[1,0]],fx:{blurH:.7,flash:.35}},{id:"punch",n:5,vi:"Đấm",en:"Punch",pts:[[0,0],[.4,0],[.46,1],[.54,1],[.6,0],[1,0]],fx:{zoomBlur:.8,flash:.6,shake:.5}},{id:"double-hit",n:6,vi:"Hai nhịp",en:"Double hit",pts:[[0,0],[.18,.55],[.3,.05],[.42,.2],[.5,1],[.6,.2],[.75,0],[1,0]],fx:{blurH:.6,rgbShift:.5,shake:.4}},{id:"bounce",n:7,vi:"Nảy",en:"Bounce",pts:[[0,0],[.3,.15],[.5,1],[.62,-1],[.8,-.6],[1,0]],fx:{blurV:.7,zoomBlur:.3}},{id:"linear-burst",n:8,vi:"Bùng thẳng",en:"Linear burst",pts:[[0,0],[.5,1],[1,0]],fx:{blurH:.6,zoomBlur:.4}},{id:"plateau",n:9,vi:"Giữ tốc",en:"Plateau",pts:[[0,0],[.2,.85],[.5,1],[.8,.85],[1,0]],fx:{blurH:.5,rgbShift:.25}},{id:"stutter",n:10,vi:"Bậc thang",en:"Stutter",pts:[[0,0],[.2,0],[.23,.35],[.33,.35],[.36,.7],[.45,.7],[.48,1],[.52,1],[.55,.5],[.66,.5],[.69,0],[1,0]],fx:{rgbShift:.6,shake:.6}},{id:"drift",n:11,vi:"Trôi rồi vọt",en:"Drift & rush",pts:[[0,0],[.2,-.8],[.38,-.8],[.5,1],[.7,.3],[1,0]],fx:{blurH:.7,blurV:.3}},{id:"snap",n:12,vi:"Bật",en:"Snap",pts:[[0,0],[.25,-1],[.44,-1],[.5,1],[.56,0],[1,0]],fx:{zoomBlur:.6,flash:.5,rgbShift:.3}}]).map(t=>t.id);const Eo=Object.freeze([.2126,.7152,.0722]),Ui=t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16));function Ta(t){const[e,c,o]=Eo;return[[e+(1-e)*t,c-c*t,o-o*t],[e-e*t,c+(1-c)*t,o-o*t],[e-e*t,c-c*t,o+(1-o)*t]]}function Ki(t){const e=t*Math.PI/180,c=Math.cos(e),o=Math.sin(e);return[[.213+c*.787-o*.213,.715-c*.715-o*.715,.072-c*.072+o*.928],[.213-c*.213+o*.143,.715+c*.285+o*.14,.072-c*.072-o*.283],[.213-c*.213-o*.787,.715-c*.715+o*.715,.072+c*.928+o*.072]]}const qo=(t,e,c)=>[[t,0,0],[0,e,0],[0,0,c]],ji=Object.freeze({"wash-red":"#ff2a1f","wash-magenta":"#e81ccf","wash-yellow":"#ffd21a","wash-lime":"#a3ff00"});function Vi(t,e,c=1.2){const o=Ui(t);return[0,1,2].map(n=>Eo.map((s,x)=>(n===x?1-e:0)+e*c*o[n]/255*s))}const Kc=t=>[t,t,t];Object.freeze({hue:t=>({m:Ki(t*180)}),vivid:t=>({m:Ta(1+.9*t),c:Kc([["s",.15*t]])}),warm:t=>({m:qo(1+.08*t,1+.01*t,1-.12*t),c:[[["add",10*t]],[["add",2*t]],[["add",-6*t]]]}),cool:t=>({m:qo(1-.08*t,1+.01*t,1+.1*t),c:[[["add",-6*t]],[["add",t]],[["add",10*t]]]}),"teal-orange":t=>({m:Ta(1+.15*t),c:[[["s",.5*t]],[["s",.12*t]],[["s",-.45*t]]]}),fade:t=>({m:Ta(1-.35*t),c:Kc([["lift",36*t,255-22*t]])}),contrast:t=>({c:Kc([["s",.7*t]])}),bleach:t=>({m:Ta(1-.55*t),c:Kc([["s",.55*t]])}),posterize:t=>({c:Kc([["post",Math.round(11-9*t)]])}),threshold:t=>({m:Ta(0),c:Kc([["add",255*(.5-t)],["post",1]])}),exposure:t=>({c:Kc([["lift",0,255*2**(2*t)]])}),...Object.fromEntries(Object.entries(ji).map(([t,e])=>[t,c=>({m:Vi(e,c),c:Kc([["s",.3*c]])})]))});const $i=Object.freeze(["split","film","circle","rect","star","heart"]);Object.freeze([...$i,"text"]),[...Object.keys(Ho)];const Xi=Object.freeze({sway:{vi:"Đung đưa",en:"Sway",amount:6,period:3.2,unit:"deg",pivot:"bottom"},swing:{vi:"Lắc con lắc",en:"Swing",amount:9,period:2.4,unit:"deg",pivot:"top"},breathe:{vi:"Thở",en:"Breathe",amount:.025,period:3.6,unit:"ratio",pivot:"bottom"},bob:{vi:"Nhấp nhô",en:"Bob",amount:10,period:2,unit:"box",pivot:"center"},wave:{vi:"Vẫy tay",en:"Wave",amount:22,period:1.1,unit:"deg",pivot:"top"},nod:{vi:"Gật đầu",en:"Nod",amount:4,period:2.6,unit:"deg",pivot:"bottom"},blink:{vi:"Chớp mắt",en:"Blink",amount:.92,period:3.8,unit:"ratio",pivot:"center"},rise:{vi:"Bốc lên (hơi, khói)",en:"Rise (steam, smoke)",amount:150,period:2.6,unit:"box",pivot:"center"},wiggle:{vi:"Rung nhẹ",en:"Wiggle",amount:3,period:.5,unit:"box",pivot:"center"},flicker:{vi:"Nhấp nháy",en:"Flicker",amount:.35,period:.25,unit:"ratio",pivot:"center"},spin:{vi:"Quay tròn",en:"Spin",amount:1,period:6,unit:"turns",pivot:"center"},drift:{vi:"Trôi qua lại",en:"Drift",amount:30,period:8,unit:"box",pivot:"center"}});Object.freeze(Object.keys(Xi)),[["red",0],["yellow",60],["green",120],["cyan",180],["blue",240],["magenta",300]].map(t=>t[0]);const Fi=Object.freeze([{id:"cinematic",name:"Điện ảnh",en:"Cinematic",p:{contrast:1.4,sat:1.05,split:{shadow:[-.07,.01,.08],highlight:[.07,.03,-.05]},hues:[{h:25,w:30,sat:1.18},{h:0,w:18,sat:1.3,lum:-.03},{h:200,w:40,sat:.8}],black:.015}},{id:"teal-orange",name:"Teal & Orange",en:"Teal & Orange",p:{contrast:1.25,sat:1.2,split:{shadow:[-.12,.03,.12],highlight:[.12,.04,-.1]},hues:[{h:30,w:35,sat:1.3},{h:120,w:45,sat:.6,shift:60}]}},{id:"warm-film",name:"Phim ấm",en:"Warm film",p:{wb:[1.14,1.02,.8],contrast:1.15,sat:.95,split:{shadow:[.04,.01,-.04],highlight:[.06,.03,-.05]},black:.04,white:.97}},{id:"cool-noir",name:"Lạnh trinh thám",en:"Cool noir",p:{wb:[.82,.97,1.18],contrast:1.35,sat:.45,split:{shadow:[-.04,.01,.08],highlight:[-.02,0,.03]},black:.015}},{id:"print-film",name:"Phim chiếu rạp",en:"Print film",p:{contrast:1.3,sat:1,split:{shadow:[-.05,.02,.05],highlight:[.05,.02,-.04]},hues:[{h:120,w:50,sat:.7},{h:25,w:30,sat:1.15}],black:.03,white:.95}},{id:"bleach-bypass",name:"Bleach bypass",en:"Bleach bypass",p:{sat:.3,contrast:1.6,black:.02,white:.98}},{id:"matte-fade",name:"Matte nhạt",en:"Faded matte",p:{contrast:.85,sat:.7,black:.14,white:.9,split:{shadow:[0,.03,.05],highlight:[.02,.02,0]}}},{id:"vintage-70s",name:"Cổ điển 70s",en:"Vintage 70s",p:{wb:[1.12,1.04,.74],sat:.75,contrast:1.08,split:{shadow:[.02,.06,-.02],highlight:[.07,.04,-.06]},black:.1,white:.92}},{id:"golden-hour",name:"Giờ vàng",en:"Golden hour",p:{wb:[1.16,1.02,.78],contrast:1.1,sat:1.15,hues:[{h:35,w:40,sat:1.3}],split:{shadow:[.02,0,-.02],highlight:[.06,.03,-.05]},white:.98}},{id:"moonlight",name:"Ánh trăng",en:"Moonlight",p:{wb:[.72,.9,1.25],sat:.4,contrast:1.2,split:{shadow:[-.04,0,.1]},white:.9}},{id:"vivid",name:"Quảng cáo rực rỡ",en:"Vivid commercial",p:{contrast:1.25,sat:1.6,hues:[{h:25,w:25,sat:.9}],black:0,white:1}},{id:"pastel",name:"Pastel mềm",en:"Soft pastel",p:{contrast:.78,sat:.7,black:.12,white:1,split:{shadow:[.06,.02,.06],highlight:[.05,.02,.04]}}},{id:"neon",name:"Neon đêm",en:"Neon night",p:{contrast:1.3,sat:1.5,split:{shadow:[-.04,.02,.14],highlight:[.14,-.04,.1]},hues:[{h:300,w:40,sat:1.4},{h:190,w:40,sat:1.4}]}},{id:"desert",name:"Sa mạc",en:"Desert",p:{wb:[1.14,1,.76],contrast:1.25,sat:.95,hues:[{h:35,w:45,sat:1.3},{h:210,w:40,sat:.5}],black:.03}},{id:"forest",name:"Rừng xanh",en:"Forest green",p:{wb:[.92,1.08,.94],contrast:1.15,sat:1,hues:[{h:110,w:45,sat:1.35,shift:-18},{h:25,w:30,sat:1.05}],split:{shadow:[-.03,.06,.03]}}},{id:"bw-classic",name:"Đen trắng cổ điển",en:"Classic B&W",p:{sat:0,contrast:1.15,black:.02,white:.98}},{id:"bw-contrast",name:"Đen trắng tương phản",en:"High-contrast B&W",p:{sat:0,contrast:1.8}},{id:"sepia",name:"Nâu sepia",en:"Sepia",p:{sat:0,contrast:1.08,tint:[1.15,.97,.72],black:.05,white:.94}}]);new Map(Fi.map(t=>[t.id,t]));const jc=t=>String(Math.round(t*10)/10),nt=(t,e)=>`${jc(t)} ${jc(e)}`,ge=t=>t*Math.PI/180,S=(t,e,c)=>`M${nt(t-c,e)}A${jc(c)} ${jc(c)} 0 1 0 ${nt(t+c,e)}A${jc(c)} ${jc(c)} 0 1 0 ${nt(t-c,e)}Z`,At=(t,e,c,o,n)=>{n=Math.min(n,c/2,o/2);const s=`A${jc(n)} ${jc(n)} 0 0 1 `;return`M${nt(t+n,e)}L${nt(t+c-n,e)}${s}${nt(t+c,e+n)}L${nt(t+c,e+o-n)}${s}${nt(t+c-n,e+o)}L${nt(t+n,e+o)}${s}${nt(t,e+o-n)}L${nt(t,e+n)}${s}${nt(t+n,e)}Z`},vt=(...t)=>"M"+t.map(([e,c])=>nt(e,c)).join("L")+"Z",st=(...t)=>"M"+t.map(([e,c])=>nt(e,c)).join("L"),no=(t,e,c,o,n=-90)=>vt(...Array.from({length:o},(s,x)=>[t+c*Math.cos(ge(n+x*360/o)),e+c*Math.sin(ge(n+x*360/o))])),Re=(t,e,c,o,n,s=-90)=>vt(...Array.from({length:n*2},(x,d)=>{const g=ge(s+d*180/n),C=d%2?o:c;return[t+C*Math.cos(g),e+C*Math.sin(g)]})),nc=(t,e,c,o=.16)=>{const n=c*o;return`M${nt(t,e-c)}Q${nt(t+n,e-n)} ${nt(t+c,e)}Q${nt(t+n,e+n)} ${nt(t,e+c)}Q${nt(t-n,e+n)} ${nt(t-c,e)}Q${nt(t-n,e-n)} ${nt(t,e-c)}Z`},Go=(t,e,c,o=190,n=34)=>{const s=ge(c+180-n),x=ge(c+180+n);return`M${nt(t+o*Math.cos(s),e+o*Math.sin(s))}L${nt(t,e)}L${nt(t+o*Math.cos(x),e+o*Math.sin(x))}`},Pe=(t,e,c,o,n)=>vt(...[[-c/2,-o/2],[c/2,-o/2],[c/2,o/2],[-c/2,o/2]].map(([s,x])=>[t+s*Math.cos(ge(n))-x*Math.sin(ge(n)),e+s*Math.sin(ge(n))+x*Math.cos(ge(n))])),ia=(t,e,c,o)=>no(t,e,c,3,o),so=(t,e,c,o)=>t.replace(/(-?\d*\.?\d+)[ ,]+(-?\d*\.?\d+)/g,(n,s,x)=>nt(+s*e+c,+x*e+o)),Oo="M500 880C140 600 100 330 280 220C400 150 480 220 500 300C520 220 600 150 720 220C900 330 860 600 500 880Z",Vc=(t,e,c)=>so(Oo,c,t-500*c,e-540*c),No="M500 90C640 90 740 190 740 340L740 500C740 600 800 650 860 700L140 700C200 650 260 600 260 500L260 340C260 190 360 90 500 90Z",Io="M400 780C420 860 580 860 600 780Z",Yi=(t,e,c,o,n,s)=>{const x=[],d=(g,C,P,h)=>{const w=Math.hypot(P-g,h-C),r=(P-g)/w,f=(h-C)/w;for(let R=0;R<w-1;R+=n+s){const X=Math.min(w,R+n);x.push(`M${nt(g+r*R,C+f*R)}L${nt(g+r*X,C+f*X)}`)}};return d(t,e,c,e),d(c,e,c,o),d(c,o,t,o),d(t,o,t,e),x.join("")},W=(t,e,c={})=>({d:t,f:e,...c}),H=(t,e,c,o={})=>({d:t,s:e,w:c,...o}),B=(t,e,c,o,n={})=>({d:t,f:e,s:c,w:o,...n}),T=(t,e,c,o,n,s,x,d)=>({id:t,cat:e,name:c,kw:o,primary:n,secondary:s,p:x,...d?{anim:d}:{}}),xt=(t,e=30,c={})=>H(t,"a",e,{h:"marker",...c}),_i={in:"draw",out:"fade",loop:"none"},Zt=(t,e,c,o)=>T(t,"doodle",e,`${c} vẽ tay hand drawn doodle`,"#e2382f","#1c1c22",o,_i),D="#1c1c22",Qi=(t,e,c,o,n,s)=>Array.from({length:c},(x,d)=>{const g=d*360/c,C=d%2?n:o;return`M${nt(t,e)}L${nt(t+C*Math.cos(ge(g-s)),e+C*Math.sin(ge(g-s)))}L${nt(t+C*Math.cos(ge(g+s)),e+C*Math.sin(ge(g+s)))}Z`}).join(""),$c=()=>B(S(500,500,430),"a","b",30),Uo="M290 600C380 780 620 780 710 600",la=(t,e,c,o=64)=>[H(t,"b",o+46),H(Go(...e,c),"b",o+46),H(t,"a",o),H(Go(...e,c),"a",o)],Ko=[S(300,420,190),S(500,330,210),S(720,420,200),S(540,520,200),S(340,530,150)].join(""),io="M500 120C260 120 90 260 90 430C90 560 170 660 290 710C290 790 250 850 180 900C300 890 410 840 470 760C480 760 490 760 500 760C740 760 910 620 910 430C910 260 740 120 500 120Z",lo="M180 140L820 140Q900 140 900 220L900 560Q900 640 820 640L440 640L260 840L280 640L180 640Q100 640 100 560L100 220Q100 140 180 140Z",ra=t=>({a:[Pe(180,200,90,40,30),ia(700,140,60,10),S(870,420,28),Pe(300,760,80,34,-40)].join(""),b:[Pe(520,180,70,34,-20),S(120,520,30),ia(820,760,56,70),Pe(640,880,84,32,18)].join(""),y:[S(380,320,30),Pe(900,160,80,34,50),ia(150,780,58,-20),Pe(560,620,74,30,-60)].join(""),r:[ia(400,600,62,30),Pe(780,300,80,34,-30),S(240,420,26),Pe(470,880,70,30,40)].join(""),g:[Pe(260,100,80,34,-10),S(640,400,30),ia(920,620,56,-40),Pe(120,640,70,30,60)].join(""),u:[ia(560,100,56,-70),Pe(720,560,80,32,20),S(380,860,28),Pe(880,900,60,28,-20)].join("")})[t],jo=[T("arrow-bold","arrow","Mũi tên dày","arrow right chỉ hướng bold","#ffd23f",D,[B(vt([100,380],[560,380],[560,190],[920,500],[560,810],[560,620],[100,620]),"a","b",36)]),T("arrow-curve","arrow","Mũi tên cong","arrow curve chỉ vào","#ff4b55","#ffffff",la("M150 830C130 480 360 280 800 300",[800,300],3)),T("arrow-down","arrow","Mũi tên xuống","arrow down bấm vào dưới","#ffd23f",D,[B(vt([380,100],[620,100],[620,480],[820,480],[500,900],[180,480],[380,480]),"a","b",36)]),T("arrow-chevrons","arrow","Chevron xuống","chevron down swipe vuốt","#ffffff",D,[H(st([200,60],[500,300],[800,60]),"a",90),H(st([200,360],[500,600],[800,360]),"a",90,{o:.65}),H(st([200,660],[500,900],[800,660]),"a",90,{o:.35})]),T("arrow-diagonal","arrow","Mũi tên chéo","arrow diagonal up tăng trưởng","#31c76a","#ffffff",la(st([160,840],[840,160]),[840,160],-45)),T("arrow-loop","arrow","Mũi tên vòng","arrow loop hand drawn vẽ tay","#ffd23f",D,la("M120 840C280 880 440 780 440 620C440 480 310 440 280 540C250 640 380 720 520 620C660 520 720 400 830 250",[830,250],-54,56)),T("arrow-zigzag","arrow","Mũi tên zigzag","arrow zigzag răng cưa","#3aa8ff","#ffffff",la(st([110,820],[270,420],[430,740],[600,340],[860,260]),[860,260],-17,56)),T("arrow-uturn","arrow","Mũi tên quay đầu","arrow u turn quay lại","#ff4b55","#ffffff",la("M220 880L220 440C220 270 340 190 500 190C660 190 780 270 780 440L780 700",[780,700],90)),Zt("doodle-circle","Vòng khoanh vẽ tay","khoanh tròn circle highlight",[xt("M330 230C480 140 760 170 850 380C930 570 790 800 540 840C300 880 120 720 140 480C155 320 300 210 470 190C560 180 640 200 700 230")]),Zt("doodle-oval","Khoanh dẹt vẽ tay","khoanh oval ellipse chữ",[xt("M250 340C420 270 760 290 880 420C980 530 830 680 520 700C250 715 70 620 110 480C140 380 300 330 480 320C590 315 680 330 760 360")]),Zt("doodle-underline","Gạch chân vẽ tay","gạch chân underline nhấn",[xt("M90 560C260 530 470 545 650 535C760 528 850 520 920 530",34)]),Zt("doodle-double-underline","Gạch chân đôi vẽ tay","gạch chân đôi double underline",[xt("M90 520C300 495 620 500 910 515",30),xt("M150 600C360 580 640 585 860 598",26)]),Zt("doodle-wavy","Gạch sóng vẽ tay","gạch sóng wavy squiggle",[xt("M80 520C140 460 200 460 250 520C300 580 360 580 410 520C460 460 520 460 570 520C620 580 680 580 730 520C780 460 840 460 920 520",30)]),Zt("doodle-arrow","Mũi tên vẽ tay","mũi tên chỉ arrow pointer",[xt("M150 820C180 600 360 380 760 260",30),xt("M600 230L770 255L690 410",30)]),Zt("doodle-loop-arrow","Mũi tên xoắn vẽ tay","mũi tên xoắn loop arrow",[xt("M120 820C300 860 470 760 450 600C430 470 300 470 300 560C300 660 470 690 600 560C700 460 740 360 820 250",28),xt("M700 250L825 245L800 370",28)]),Zt("doodle-cross","Gạch chéo vẽ tay","gạch bỏ cross out sai",[xt("M170 230C380 420 600 610 850 790",34),xt("M820 210C620 400 400 610 180 800",34)]),Zt("doodle-check","Dấu tích vẽ tay","dấu tích check đúng",[xt("M170 520C260 600 340 680 410 780C520 560 660 360 860 190",38)]),Zt("doodle-star","Ngôi sao vẽ tay","ngôi sao star nổi bật",[xt("M500 130L590 400L870 410L640 570L730 850L500 680L270 850L360 570L130 410L410 400L505 140",26)]),Zt("doodle-sparks","Tia nhấn vẽ tay","tia nhấn emphasis spark",[xt("M500 360L500 140",30),xt("M330 420L190 270",30),xt("M670 420L810 270",30)]),Zt("doodle-hatch","Gạch bóng vẽ tay","gạch bóng hatching shading",[xt("M160 700L330 300",20),xt("M260 740L450 300",20),xt("M370 770L570 310",20),xt("M480 790L690 320",20),xt("M600 800L800 340",20)]),Zt("doodle-dots","Chấm nguệch ngoạc","chấm scribble dots",[xt("M210 520C170 470 230 420 270 460C310 500 250 560 215 525",26),xt("M480 500C440 450 500 400 540 440C580 480 520 540 485 505",26),xt("M750 520C710 470 770 420 810 460C850 500 790 560 755 525",26)]),Zt("doodle-bracket","Ngoặc vẽ tay","ngoặc bracket nhóm",[xt("M330 140C220 150 210 260 220 380C230 460 200 500 150 505C200 512 230 550 220 630C210 760 230 860 340 870",28),xt("M670 140C780 150 790 260 780 380C770 460 800 500 850 505C800 512 770 550 780 630C790 760 770 860 660 870",28)]),Zt("doodle-box","Khung vẽ tay","khung box hộp",[xt("M140 210C380 190 640 195 880 215C870 420 870 620 885 800C640 815 380 812 120 795C130 600 128 400 150 190",28)]),Zt("doodle-heart","Tim vẽ tay","tim heart thích",[xt("M500 840C200 620 120 400 260 260C380 150 480 230 500 330C520 230 620 150 740 260C880 400 800 620 500 840",28)]),T("arrow-refresh","arrow","Mũi tên làm mới","refresh reload lặp lại","#31c76a","#ffffff",la("M712 247A330 330 0 1 1 288 247",[288,247],-40)),T("badge-star","badge","Huy hiệu sao","badge star ngôi sao best","#ffd23f",D,[B(S(500,500,420),"a","b",34),H(S(500,500,350),"b",14,{o:.5}),W(Re(500,500,250,105,5),"w")]),T("badge-burst","badge","Nổ sao","burst starburst sale nổ","#ff4b55",D,[B(Re(500,500,470,390,18),"a","b",30),H(S(500,500,300),"w",16,{o:.8})]),T("badge-ribbon","badge","Ruy băng","ribbon banner dải băng","#ff4b55","#a31f2b",[W(vt([40,380],[220,380],[220,620],[40,620],[120,500]),"b"),W(vt([960,380],[780,380],[780,620],[960,620],[880,500]),"b"),B(vt([160,300],[840,300],[840,700],[160,700]),"a","k",30),H(st([260,440],[740,440]),"w",34,{o:.9}),H(st([320,560],[680,560]),"w",34,{o:.9})]),T("badge-pill","badge","Nhãn viên thuốc","label pill nhãn tag","#3aa8ff",D,[B(At(80,340,840,320,160),"a","b",32),W(S(250,500,70),"w"),H(st([390,500],[760,500]),"w",50)]),T("badge-shield","badge","Khiên bảo vệ","shield bảo hành guarantee","#3aa8ff",D,[B("M500 90L860 210L860 520C860 720 700 860 500 930C300 860 140 720 140 520L140 210Z","a","b",34),H(st([320,500],[450,630],[690,380]),"w",70)]),T("badge-medal","badge","Huy chương","medal huy chương giải thưởng","#ffd23f",D,[B(vt([260,60],[430,60],[620,520],[450,520]),"b","k",14),B(vt([740,60],[570,60],[380,520],[550,520]),"r","k",14),B(S(500,670,260),"a","b",34),W(Re(500,670,150,65,5),"w")]),T("badge-hexagon","badge","Lục giác","hexagon badge huy hiệu","#a56bff",D,[B(no(500,500,440,6),"a","b",34),H(no(500,500,340,6),"w",16,{o:.8}),W(Re(500,500,150,64,5),"w")]),T("badge-tag","badge","Nhãn mũi tên","label tag nhãn mới new","#31c76a",D,[B(vt([100,300],[760,300],[900,500],[760,700],[100,700]),"a","b",34),W(S(250,500,60),"w"),H(st([380,500],[700,500]),"w",50)]),T("icon-check","icon","Tích tròn","check đúng ok done","#31c76a",D,[B(S(500,500,420),"a","b",34),H(st([270,520],[440,690],[740,330]),"w",100)]),T("icon-cross","icon","X tròn","cross sai wrong close","#ff4b55",D,[B(S(500,500,420),"a","b",34),H("M330 330L670 670M670 330L330 670","w",100)]),T("icon-bulb","icon","Bóng đèn","lightbulb ý tưởng idea tip","#ffd23f",D,[B("M500 100C320 100 220 230 220 380C220 500 300 560 340 640L340 700L660 700L660 640C700 560 780 500 780 380C780 230 680 100 500 100Z","a","b",34),H("M360 790L640 790M410 870L590 870","b",54),H("M420 560L420 420L500 500L580 420L580 560","w",34,{o:.8})]),T("icon-pin","icon","Ghim vị trí","pin location địa điểm map","#ff4b55",D,[B("M500 90C300 90 200 240 200 400C200 600 420 800 500 920C580 800 800 600 800 400C800 240 700 90 500 90Z","a","b",34),W(S(500,400,115),"w")]),T("icon-clock","icon","Đồng hồ giờ","clock time giờ thời gian","#3aa8ff",D,[B(S(500,500,420),"w","b",40),H("M500 500L500 250M500 500L690 590","a",58),W(S(500,500,40),"b"),H("M500 120L500 160M500 840L500 880M120 500L160 500M840 500L880 500","b",30)]),T("icon-bolt","icon","Tia chớp","bolt lightning nhanh flash","#ffd23f",D,[B(vt([590,60],[220,560],[470,560],[400,940],[790,400],[530,400]),"a","b",36)]),T("icon-flame","icon","Ngọn lửa","fire flame hot lửa","#ff7a1a",D,[B("M500 60C560 220 760 320 760 580C760 780 650 920 500 920C350 920 240 780 240 600C240 480 300 400 360 340C370 420 420 460 450 440C400 320 430 180 500 60Z","a","b",34),W("M500 520C560 600 620 660 620 740C620 820 570 880 500 880C430 880 380 820 380 740C380 660 450 600 500 520Z","y")]),T("icon-crown","icon","Vương miện","crown vip king","#ffd23f",D,[B(vt([120,760],[80,300],[330,520],[500,200],[670,520],[920,300],[880,760]),"a","b",34),W(S(80,290,50)+S(500,190,50)+S(920,290,50),"a"),H(st([200,660],[800,660]),"b",30,{o:.6})]),T("icon-search","icon","Kính lúp","magnifier search tìm kiếm zoom","#3aa8ff",D,[H(st([620,620],[880,880]),"b",150),H(st([620,620],[880,880]),"a",100),B(S(420,420,270),"w","b",70)]),T("icon-gift","icon","Hộp quà","gift quà tặng present","#ff4b55",D,[B(At(150,430,700,470,30),"a","b",30),B(At(100,310,800,150,30),"a","b",30),W(At(440,310,120,590,10),"w"),B("M500 310C380 130 210 190 300 310Z","w","b",24),B("M500 310C620 130 790 190 700 310Z","w","b",24)]),T("icon-trophy","icon","Cúp","trophy winner cúp vô địch","#ffd23f",D,[H("M290 190C110 190 110 420 310 440M710 190C890 190 890 420 690 440","b",50),B("M280 100L720 100L700 400C690 540 600 600 500 600C400 600 310 540 300 400Z","a","b",34),B("M440 600L560 600L580 780L420 780Z","a","b",30),B(At(300,780,400,110,30),"a","b",30)]),T("icon-exclaim","icon","Dấu chấm than","exclamation chú ý attention","#ff4b55",D,[B(At(370,90,260,540,130),"a","b",34),B(S(500,790,100),"a","b",34)]),T("icon-question","icon","Dấu hỏi","question hỏi thắc mắc","#3aa8ff",D,[H("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","b",170),H("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","a",110),B(S(510,840,80),"a","b",30)]),T("icon-target","icon","Mục tiêu","target bullseye đích","#ff4b55",D,[B(S(500,500,430),"w","b",34),W(S(500,500,320),"a"),W(S(500,500,210),"w"),W(S(500,500,100),"a"),H(S(500,500,100),"b",20)]),T("face-smile","emotion","Cười tươi","smile happy vui emoji","#ffcf3a","#3a2a10",[$c(),W(S(360,410,52)+S(640,410,52),"b"),H(Uo,"b",56)]),T("face-laugh","emotion","Cười lớn","laugh haha cười","#ffcf3a","#3a2a10",[$c(),H("M270 450Q360 340 450 450M550 450Q640 340 730 450","b",52),W("M250 590L750 590C750 780 640 850 500 850C360 850 250 780 250 590Z","b"),W("M380 790C430 720 570 720 620 790C590 830 410 830 380 790Z","r")]),T("face-wink","emotion","Nháy mắt","wink nháy tinh nghịch","#ffcf3a","#3a2a10",[$c(),W(S(360,410,52),"b"),H("M560 440Q640 360 720 440","b",52),H(Uo,"b",56),W(S(250,570,38)+S(750,570,38),"r",{o:.35})]),T("face-sad","emotion","Buồn","sad cry khóc buồn","#ffcf3a","#3a2a10",[$c(),W(S(360,440,50)+S(640,440,50),"b"),H("M270 360L430 320M730 360L570 320","b",40),H("M310 740C400 620 600 620 690 740","b",56),W("M290 540C250 620 240 670 290 690C340 670 330 620 290 540Z","u")]),T("face-angry","emotion","Giận dữ","angry mad giận","#ff6b4d","#3a1208",[$c(),H("M250 330L450 430M750 330L550 430","b",62),W(S(380,510,42)+S(620,510,42),"b"),H("M320 750Q500 600 680 750","b",56)]),T("face-surprised","emotion","Ngạc nhiên","surprised wow ngạc nhiên","#ffcf3a","#3a2a10",[$c(),B(S(360,410,82)+S(640,410,82),"w","b",26),W(S(360,410,34)+S(640,410,34),"b"),H("M260 260Q360 200 450 260M550 260Q640 200 740 260","b",40),W("M425 700A75 100 0 1 0 575 700A75 100 0 1 0 425 700Z","b")]),T("face-cool","emotion","Ngầu","cool sunglasses kính râm ngầu","#ffcf3a","#3a2a10",[$c(),W(At(150,340,320,190,80)+At(530,340,320,190,80),"b"),H(st([470,400],[530,400]),"b",40),H(st([220,410],[320,410]),"w",26,{o:.5}),H("M310 650C400 770 600 770 690 650","b",52)]),T("face-love","emotion","Mắt trái tim","love heart eyes yêu thích","#ffcf3a","#3a2a10",[$c(),W(Vc(360,420,.23)+Vc(640,420,.23),"r"),H("M290 630C380 800 620 800 710 630","b",52)]),T("bubble-round","bubble","Bóng thoại tròn","speech bubble hội thoại nói","#ffffff",D,[B(io,"a","b",34)]),T("bubble-rect","bubble","Bóng thoại vuông","speech box bubble chat","#ffffff",D,[B(lo,"a","b",34)]),T("bubble-cloud","bubble","Bóng suy nghĩ","thought cloud nghĩ mây","#ffffff",D,[H(Ko,"b",70),W(Ko,"a"),B(S(250,810,66),"a","b",30),B(S(130,915,40),"a","b",26)]),T("bubble-shout","bubble","Bóng hét","shout burst hét la","#ffd23f",D,[B(vt(...Array.from({length:28},(t,e)=>{const c=ge(-90+e*360/28),o=e%2?290:470;return[500+o*Math.cos(c),480+o*Math.sin(c)]})),"a","b",30)]),T("bubble-typing","bubble","Đang nhập","typing dots ba chấm","#ffffff",D,[B(vt([200,620],[170,800],[350,660]),"a","b",30),B(At(100,260,800,400,200),"a","b",34),W(S(340,460,48)+S(500,460,48)+S(660,460,48),"b")]),T("bubble-chat","bubble","Bình luận màu","comment chat message tin nhắn","#3aa8ff",D,[B(lo,"a","b",34),H(st([240,300],[760,300]),"w",48),H(st([240,430],[600,430]),"w",48,{o:.8})]),T("bubble-exclaim","bubble","Bóng chú ý","notice attention lưu ý","#ff4b55",D,[B(io,"a","b",34),H(st([500,270],[500,470]),"w",92),W(S(500,600,52),"w")]),T("bubble-heart","bubble","Bóng yêu thích","love bubble tim","#ffffff",D,[B(io,"a","b",34),W(Vc(500,430,.42),"r")]),T("social-like","social","Thích","like thumbs up ngón cái thích","#3aa8ff",D,[B(vt([90,440],[290,440],[290,900],[90,900]),"b","k",30),B("M340 460L520 100C600 100 640 160 620 260L600 380L840 380C920 380 960 450 930 520L860 800C840 870 800 900 740 900L340 900Z","a","b",34)]),T("social-heart","social","Tim","heart love yêu thích tim","#ff4b55",D,[B(Oo,"a","b",34),H("M250 330C250 280 290 250 340 250","w",36,{o:.7})]),T("social-comment","social","Bình luận","comment bình luận chat","#3aa8ff",D,[B(lo,"a","b",34),W(S(330,390,52)+S(500,390,52)+S(670,390,52),"w")]),T("social-share","social","Chia sẻ","share chia sẻ forward","#31c76a",D,[B("M520 150L920 450L520 750L520 590C300 590 160 680 100 860C130 560 300 380 520 350Z","a","b",34)]),T("social-bell","social","Chuông","bell notification thông báo","#ffd23f",D,[B(No,"a","b",34),B(Io,"a","b",30)]),T("social-subscribe","social","Nút đăng ký","subscribe follow đăng ký theo dõi","#ff4b55",D,[B(At(60,330,880,340,170),"a","b",34),W(so(No,.38,230-500*.38,500-470*.38),"w"),W(so(Io,.38,230-500*.38,500-470*.38),"w"),H(st([420,450],[820,450]),"w",50),H(st([420,560],[700,560]),"w",50,{o:.65})]),T("social-save","social","Lưu","save bookmark lưu","#ffd23f",D,[B("M240 100L760 100L760 900L500 720L240 900Z","a","b",34)]),T("social-play","social","Nút phát","play video phát","#ff4b55",D,[B(S(500,500,430),"a","b",34),W(vt([410,310],[410,690],[740,500]),"w")]),T("social-follow","social","Theo dõi","follow add friend kết bạn","#3aa8ff",D,[B(S(390,300,170),"a","b",30),B("M80 900C80 660 230 570 390 570C550 570 700 660 700 900Z","a","b",30),H("M830 300L830 560M700 430L960 430","b",100),H("M830 300L830 560M700 430L960 430","w",58)]),T("social-views","social","Lượt xem","views eye mắt xem","#3aa8ff",D,[B("M50 500C220 250 780 250 950 500C780 750 220 750 50 500Z","w","b",34),B(S(500,500,170),"a","b",24),W(S(500,500,70),"b"),W(S(540,460,26),"w")]),T("price-tag","price","Thẻ giá","price tag giá nhãn","#ffd23f",D,[B("M110 110L520 110L910 500L500 910L110 520Z","a","b",34),B(S(270,270,62),"w","b",26)]),T("price-percent","price","Huy hiệu %","percent discount giảm giá","#ff4b55",D,[B(S(500,500,430),"a","b",34),H(S(340,340,78),"w",44),H(S(660,660,78),"w",44),H(st([720,280],[280,720]),"w",56)]),T("price-sale","price","Nổ sale %","sale burst khuyến mãi","#ff4b55",D,[B(Re(500,500,480,400,20),"a","b",30),H(S(380,380,60),"w",38),H(S(620,620,60),"w",38),H(st([670,320],[330,680]),"w",50)]),T("price-coin","price","Đồng xu","coin dollar tiền xu","#ffd23f",D,[B(S(500,500,430),"a","b",34),H(S(500,500,340),"b",16,{o:.5}),H("M630 360C610 290 400 280 390 385C380 490 620 510 610 625C600 730 390 730 370 635","w",64),H(st([500,230],[500,770]),"w",42)]),T("price-cart","price","Giỏ hàng","cart shop mua hàng","#31c76a",D,[H("M70 140L220 140L330 620L820 620","b",70),B(vt([270,260],[930,260],[830,580],[360,580]),"a","b",34),B(S(420,790,70),"w","b",30),B(S(740,790,70),"w","b",30)]),T("price-coupon","price","Phiếu giảm giá","coupon voucher mã giảm","#a56bff",D,[B("M70 250L930 250L930 410A100 100 0 0 0 930 590L930 750L70 750L70 590A100 100 0 0 0 70 410Z","a","b",34),H("M650 310L650 360M650 420L650 470M650 530L650 580M650 640L650 690","w",28),H(st([180,420],[520,420]),"w",50),H(st([180,540],[440,540]),"w",50,{o:.7})]),T("price-truck","price","Giao hàng","truck delivery freeship vận chuyển","#3aa8ff",D,[B(vt([60,260],[600,260],[600,720],[60,720]),"a","b",34),B(vt([600,380],[780,380],[930,540],[930,720],[600,720]),"a","b",34),W(vt([670,440],[760,440],[850,540],[670,540]),"w"),B(S(250,740,95),"w","b",34),B(S(750,740,95),"w","b",34)]),T("price-star","price","Sao giá","star price best seller bán chạy","#ffd23f",D,[B(Re(500,510,480,215,5),"a","b",34),H(Re(500,510,330,150,5),"w",16,{o:.6})]),T("frame-corners","frame","Khung ngắm","viewfinder corners góc","#ffffff",D,[H("M120 340L120 120L340 120M660 120L880 120L880 340M880 660L880 880L660 880M340 880L120 880L120 660","a",70)]),T("frame-polaroid","frame","Khung polaroid","polaroid photo ảnh","#ffffff",D,[B("M110 90L890 90L890 910L110 910ZM190 170L810 170L810 700L190 700Z","a","b",30,{eo:!0})]),T("frame-border","frame","Viền bo góc","border rounded viền","#ffd23f",D,[W(At(60,60,880,880,120)+At(150,150,700,700,60),"a",{eo:!0}),H(At(150,150,700,700,60),"b",14)]),T("frame-film","frame","Khung phim","film cinema phim","#ffd23f",D,[W(`M60 160L940 160L940 840L60 840ZM160 300L840 300L840 700L160 700Z${Array.from({length:8},(t,e)=>At(100+e*105,200,55,60,10)+At(100+e*105,740,55,60,10)).join("")}`,"b",{eo:!0}),H("M60 160L940 160L940 840L60 840Z","a",16)]),T("frame-ticket","frame","Khung vé","ticket vé coupon","#ff4b55",D,[B("M70 160L930 160L930 400A100 100 0 0 0 930 600L930 840L70 840L70 600A100 100 0 0 0 70 400ZM170 260L830 260L830 740L170 740Z","a","b",30,{eo:!0})]),T("frame-circle","frame","Khung tròn","circle ring vòng tròn","#ffffff",D,[B(S(500,500,440)+S(500,500,340),"a","b",20,{eo:!0})]),T("frame-tv","frame","Khung TV","tv television màn hình","#3aa8ff",D,[H(st([330,60],[500,210],[670,60]),"b",44),B(At(70,220,860,680,130)+At(160,310,680,500,70),"a","b",30,{eo:!0})]),T("frame-dashed","frame","Khung nét đứt","dashed viền đứt","#ffffff",D,[H(Yi(100,100,900,900,70,50),"a",36)]),T("fx-sparkle","sparkle","Lấp lánh","sparkle twinkle lấp lánh","#fff3a8","#ffffff",[W(S(500,500,260),"a",{o:.4,bl:70}),W(nc(500,500,470,.1),"a"),W(nc(500,500,200,.14),"b")]),T("fx-sparkles","sparkle","Cụm lấp lánh","sparkles cluster nhiều sao","#ffe066","#ffffff",[W(S(400,560,300),"a",{o:.25,bl:80}),W(nc(400,560,340,.12),"a"),W(nc(750,260,190,.14),"a"),W(nc(770,800,120,.16),"b"),W(nc(400,560,120,.16),"b")]),T("fx-shine","sparkle","Tia lấp loáng","shine flare tia sáng","#ffe066","#ffffff",[W(S(500,500,230),"a",{o:.35,bl:70}),W(Re(500,500,470,60,8,-90),"a"),W(Re(500,500,330,50,8,-67.5),"b",{o:.9}),W(S(500,500,90),"b")]),T("fx-light-leak","sparkle","Rò sáng","light leak ánh sáng loá","#ffb347","#ff5da2",[W(S(330,340,260),"a",{o:.6,bl:100}),W(S(680,640,240),"b",{o:.55,bl:100}),W(S(520,520,150),"w",{o:.45,bl:80})]),T("fx-rays","sparkle","Tia nắng","rays sunburst chói","#ffe066","#ffffff",[W(Qi(500,500,16,480,360,6),"a",{o:.9}),W(S(500,500,130),"a",{o:.5,bl:40}),W(S(500,500,80),"b")]),T("fx-confetti","sparkle","Pháo giấy","confetti party mừng","#ff4b55","#3aa8ff",[W(ra("a"),"a"),W(ra("b"),"b"),W(ra("y"),"y"),W(ra("r"),"r"),W(ra("g"),"g"),W(ra("u"),"u")]),T("fx-glow-ring","sparkle","Vòng sáng","glow ring halo","#7cf0ff","#ffffff",[H(S(500,500,330),"a",90,{o:.55,bl:40}),H(S(500,500,330),"b",20)]),T("fx-lens-flare","sparkle","Chói ống kính","lens flare anamorphic","#ffd08a","#ffffff",[H(st([40,300],[620,300]),"b",16,{o:.7,bl:6}),W(S(300,300,150),"b",{o:.85,bl:50}),W(S(300,300,70),"b"),W(S(540,540,60),"a",{o:.6,bl:8}),W(S(680,680,110),"a",{o:.4,bl:12}),W(S(820,820,40),"a",{o:.8,bl:4})]),T("fx-twinkle","sparkle","Sao nhấp nháy","twinkle stars sao nhỏ","#ffe066","#ffffff",[W(nc(250,300,150,.16)+nc(560,620,120,.16),"a"),W(nc(700,220,200,.14)+nc(300,800,100,.18),"b"),W(nc(820,760,170,.14),"a")]),T("fx-heart-burst","sparkle","Tim bay","hearts float like tim bay","#ff4b55","#ff9cc2",[W(Vc(500,600,.55),"a"),W(Vc(250,370,.28),"b",{o:.9}),W(Vc(760,300,.36),"a",{o:.8}),W(Vc(830,660,.2),"w"),W(Vc(170,720,.2),"a",{o:.7})]),T("status-stars","status","5 sao","rating stars đánh giá 5 sao","#ffd23f",D,[B(Array.from({length:5},(t,e)=>Re(140+e*180,500,92,40,5)).join(""),"a","b",12)]),T("status-stars-4","status","4 sao","rating four stars 4 sao","#ffd23f",D,[B(Array.from({length:4},(t,e)=>Re(140+e*180,500,92,40,5)).join(""),"a","b",12),B(Re(860,500,92,40,5),"b","b",12,{o:.3})]),T("status-progress","status","Thanh tiến trình","progress bar loading thanh","#31c76a",D,[B(At(60,400,880,200,100),"w","b",24),W(At(84,424,540,152,76),"a")]),T("status-ring","status","Vòng tiến trình","progress ring vòng phần trăm","#31c76a",D,[H(S(500,500,410),"b",100,{o:.3}),H("M500 90A410 410 0 1 1 90 500","a",100)]),T("status-check","status","Dấu tích lớn","checkmark tick đúng","#31c76a",D,[H(st([140,540],[400,800],[880,200]),"b",200),H(st([140,540],[400,800],[880,200]),"a",130)]),T("status-cross","status","Dấu X lớn","cross x sai","#ff4b55",D,[H("M200 200L800 800M800 200L200 800","b",200),H("M200 200L800 800M800 200L200 800","a",130)]),T("status-checkbox","status","Ô tích","checkbox ô chọn","#31c76a",D,[B(At(110,110,780,780,170),"w","b",34),H(st([270,520],[440,690],[740,320]),"a",110)]),T("status-crossbox","status","Ô gạch X","crossbox ô sai","#ff4b55",D,[B(At(110,110,780,780,170),"w","b",34),H("M310 310L690 690M690 310L310 690","a",110)]),T("status-warning","status","Cảnh báo","warning cảnh báo lưu ý","#ffd23f",D,[B(vt([500,100],[930,850],[70,850]),"a","b",40),H(st([500,370],[500,600]),"b",84),W(S(500,730,46),"b")]),T("status-dots","status","Ba chấm tải","loading dots đang tải","#ffffff",D,[W(S(200,500,80),"a"),W(S(500,500,80),"a",{o:.6}),W(S(800,500,80),"a",{o:.3})])];new Map(jo.map(t=>[t.id,t])),jo.map(t=>t.id);const Zi=Object.freeze({emitter:"point",ex:.5,ey:.5,esize:.2,text:"CLIPOOX",rate:80,burst:0,prerun:0,life:2,speed:220,direction:-90,spread:60,gravity:0,wind:0,drag:.4,turbulence:.2,shape:"glow",size:8,sizeEnd:.3,color:"#fff3c4",colorEnd:"#ff7a1a",opacity:1,blend:"add",seed:1}),Ji={particles:"Custom particles — a free particle system: choose the emitter (point, box, disc, line, ring or text), rate, burst, life, speed, direction, gravity, wind, drag, turbulence, shape and colours","pt-dust":"Floating glow dust particles — soft glowing motes drift and swirl over the whole frame (dust, bokeh, ambience)","pt-sparks":"Spark fountain particles — hot sparks shoot up from the bottom and fall back under gravity (sparks, fire, welding)","pt-firework":"Fireworks burst particles — one burst of sparks explodes outward, slows and falls (fireworks, celebration, new year)","pt-snow":"Snowfall particles — snowflakes fall softly over the whole frame with a light wind (snow, winter, christmas)","pt-rain":"Rain particles — fast rain streaks fall at a slight angle over the whole frame (rain, storm, weather)","pt-smoke":"Rising smoke particles — soft smoke puffs rise from the bottom, grow and fade (smoke, steam, fog, mist)","pt-magic":"Magic swirl dust particles — star sparkles circle a ring and twirl (magic, fairy dust, sparkle, glitter)","pt-text":"Particle text — glowing particles form the words (text = the words; logo text, title made of particles)","pt-hearts":"Floating hearts particles — hearts rise from the bottom and sway (love, like, valentine, wedding)","pt-fireflies":"Fireflies particles — small glowing lights wander slowly in the dark (fireflies, night, glow)","pt-confetti":"Confetti particles — paper confetti bursts in and tumbles down (confetti, party, celebration, winner)"},ze=(t,e,c,o)=>Object.freeze({id:t,name:e,category:"Hạt",duration:c,params:Object.freeze({...Zi,...o}),code:`function render(ctx,t,env){
2
- // `+Ji[t]+` (settings: particles {rate, gravity, shape, color…}).
1
+ (function(){"use strict";function Ci(t){const e=t.w>>1,c=t.h>>1,o=new Float32Array(e*c),n=t.data,s=t.w;for(let x=0;x<c;x++)for(let d=0;d<e;d++){const g=2*x*s+2*d;o[x*e+d]=(n[g]+n[g+1]+n[g+s]+n[g+s+1])/4}return{w:e,h:c,data:o}}function Ai(t,e=3){const c=[t];for(;c.length<e&&c.at(-1).w>=40;)c.push(Ci(c.at(-1)));return c}const oa=(t,e,c)=>{e=Math.max(0,Math.min(t.w-1.001,e)),c=Math.max(0,Math.min(t.h-1.001,c));const o=e|0,n=c|0,s=e-o,x=c-n,d=n*t.w+o,g=t.data;return(g[d]*(1-s)+g[d+1]*s)*(1-x)+(g[d+t.w]*(1-s)+g[d+t.w+1]*s)*x};function zo(t,e,c,o=5,n=12){let s=0,x=0;for(let P=t.length-1;P>=0;P--){const h=t[P],w=e[P],r=2**P,f=c[0]/r,R=c[1]/r;let X=0,j=0,m=0;const V=[],F=[],E=[];for(let L=-o;L<=o;L++)for(let i=-o;i<=o;i++){const $=(oa(h,f+i+1,R+L)-oa(h,f+i-1,R+L))/2,z=(oa(h,f+i,R+L+1)-oa(h,f+i,R+L-1))/2;X+=$*$,j+=$*z,m+=z*z,V.push($),F.push(z),E.push(oa(h,f+i,R+L))}const a=X*m-j*j;if(a<1e-9)return null;let u=0,M=0;for(let L=0;L<n;L++){let i=0,$=0,z=0;for(let ft=-o;ft<=o;ft++)for(let gt=-o;gt<=o;gt++,z++){const wt=E[z]-oa(w,f+s+u+gt,R+x+M+ft);i+=wt*V[z],$+=wt*F[z]}const U=(m*i-j*$)/a,at=(X*$-j*i)/a;if(u+=U,M+=at,U*U+at*at<1e-4)break}s=(s+u)*(P?2:1),x=(x+M)*(P?2:1)}const d=[c[0]+s,c[1]+x],g=t[0].w,C=t[0].h;return d[0]<2||d[1]<2||d[0]>g-3||d[1]>C-3?null:d}function Ri(t,e,c){return c.map(o=>{const n=zo(t,e,o);if(!n)return null;const s=zo(e,t,n);return s&&Math.hypot(s[0]-o[0],s[1]-o[1])<.8?n:null})}const co=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],ao=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],ma=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],oo=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],Wc=(t,e)=>[ma(t[0],e),ma(t[1],e),ma(t[2],e)],ka=t=>[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],Bo=(t,e)=>t.map(c=>[0,1,2].map(o=>c[0]*e[0][o]+c[1]*e[1][o]+c[2]*e[2][o])),Pi=()=>[[1,0,0],[0,1,0],[0,0,1]];function Wo(t){const e=Math.hypot(t[0],t[1],t[2]);if(e<1e-12)return Pi();const c=oo(t,1/e),o=Math.cos(e),n=Math.sin(e),s=1-o;return[[o+c[0]*c[0]*s,c[0]*c[1]*s-c[2]*n,c[0]*c[2]*s+c[1]*n],[c[1]*c[0]*s+c[2]*n,o+c[1]*c[1]*s,c[1]*c[2]*s-c[0]*n],[c[2]*c[0]*s-c[1]*n,c[2]*c[1]*s+c[0]*n,o+c[2]*c[2]*s]]}function Ho(t){const e=t[0][0]+t[1][1]+t[2][2];let c;if(e>0){const n=Math.sqrt(e+1)*2;c=[(t[2][1]-t[1][2])/n,(t[0][2]-t[2][0])/n,(t[1][0]-t[0][1])/n,n/4]}else if(t[0][0]>t[1][1]&&t[0][0]>t[2][2]){const n=Math.sqrt(1+t[0][0]-t[1][1]-t[2][2])*2;c=[n/4,(t[0][1]+t[1][0])/n,(t[0][2]+t[2][0])/n,(t[2][1]-t[1][2])/n]}else if(t[1][1]>t[2][2]){const n=Math.sqrt(1+t[1][1]-t[0][0]-t[2][2])*2;c=[(t[0][1]+t[1][0])/n,n/4,(t[1][2]+t[2][1])/n,(t[0][2]-t[2][0])/n]}else{const n=Math.sqrt(1+t[2][2]-t[0][0]-t[1][1])*2;c=[(t[0][2]+t[2][0])/n,(t[1][2]+t[2][1])/n,n/4,(t[1][0]-t[0][1])/n]}const o=Math.hypot(...c);return c.map(n=>n/o*(c[3]<0?-1:1))}function zi(t){const[e,c,o,n]=t;return[[1-2*(c*c+o*o),2*(e*c-o*n),2*(e*o+c*n)],[2*(e*c+o*n),1-2*(e*e+o*o),2*(c*o-e*n)],[2*(e*o-c*n),2*(c*o+e*n),1-2*(e*e+c*c)]]}function Bi(t,e,c,o,n){const s=Wc(t.R,co(e,t.C));return s[2]>-1e-6?null:[o+c*s[0]/-s[2],n-c*s[1]/-s[2]]}function Wi(t,e,c,o,n,s){let x={R:e.R.map(h=>[...h]),C:[...e.C]};const d=h=>{const w=[];for(const{X:r,px:f}of t){const R=Bi(h,r,c,o,n);w.push(R?R[0]-f[0]:50,R?R[1]-f[1]:50)}return w},g=(h,w)=>({R:Bo(Wo([w[0],w[1],w[2]]),h.R),C:ao(h.C,[w[3]*s,w[4]*s,w[5]*s])});for(let h=0;h<12;h++){const w=d(x),r=w.map((m,V)=>V%2?null:Math.hypot(m,w[V+1])).flatMap(m=>m===null?[]:[m<=2?1:2/m,m<=2?1:2/m]),f=[];for(let m=0;m<6;m++){const V=[0,0,0,0,0,0];V[m]=1e-5;const F=d(g(x,V));f.push(F.map((E,a)=>(E-w[a])/1e-5))}const R=Array.from({length:6},()=>new Array(6).fill(0)),X=new Array(6).fill(0);for(let m=0;m<w.length;m++)for(let V=0;V<6;V++){X[V]+=f[V][m]*w[m]*r[m];for(let F=0;F<6;F++)R[V][F]+=f[V][m]*f[F][m]*r[m]}for(let m=0;m<6;m++)R[m][m]*=1.0001;const j=Lo(R,X.map(m=>-m));if(!j||(x=g(x,j),Math.hypot(...j)<1e-7))break}const C=d(x),P=[];for(let h=0;h<t.length;h++)Math.hypot(C[2*h],C[2*h+1])<2.5&&P.push(h);return{pose:x,inliers:P}}function Lo(t,e){const c=e.length,o=t.map((s,x)=>Float64Array.from([...s,e[x]]));for(let s=0;s<c;s++){let x=s;for(let C=s+1;C<c;C++)Math.abs(o[C][s])>Math.abs(o[x][s])&&(x=C);if(Math.abs(o[x][s])<1e-14)return null;[o[s],o[x]]=[o[x],o[s]];const d=o[s],g=d[s];for(let C=s+1;C<c;C++){const P=o[C],h=P[s]/g;if(h!==0)for(let w=s;w<=c;w++)P[w]-=h*d[w]}}const n=new Array(c);for(let s=c-1;s>=0;s--){const x=o[s];let d=x[c];for(let g=s+1;g<c;g++)d-=x[g]*n[g];n[s]=d/x[s]}return n}function Ka(t,e,c,o,n,s,x,d=12,{focal:g=!1}={}){const C=o.filter(u=>t[u]),P=C.length;if(P<3)return n;const h=new Map(C.map((u,M)=>[u,M])),w=[...e.keys()].filter(u=>C.filter(M=>c[M].has(u)).length>=2),r=w.length;if(r<10)return n;const f=[];w.forEach((u,M)=>{for(const L of C)c[L].has(u)&&f.push({c:h.get(L),p:M,px:c[L].get(u)})});const R=C.map(u=>t[u].R.map(M=>[...M])),X=C.map(u=>[...t[u].C]),j=w.map(u=>[...e.get(u)]),m=(u,M,L,i)=>{let $=0;for(const z of f){const U=Wc(u[z.c],co(L[z.p],M[z.c]));if(U[2]>-1e-6){$+=100;continue}const at=s-i*U[0]/U[2]-z.px[0],ft=x+i*U[1]/U[2]-z.px[1],gt=Math.hypot(at,ft);$+=gt<=2?gt*gt:4*gt-4}return $};let V=.001,F=m(R,X,j,n);const E=6*(P-1)+(g?1:0),a=E-1;for(let u=0;u<d;u++){const M=Array.from({length:E},()=>new Array(E).fill(0)),L=new Array(E).fill(0),i=j.map(()=>[[0,0,0],[0,0,0],[0,0,0]]),$=j.map(()=>[0,0,0]),z=new Map,U=g?j.map(()=>[[0,0,0]]):null;for(const b of f){const O=Wc(R[b.c],co(j[b.p],X[b.c])),[Q,q,v]=O;if(v>-1e-6)continue;const N=s-n*Q/v-b.px[0],J=x+n*q/v-b.px[1],ot=Math.hypot(N,J),rt=ot<=2?1:2/ot,Bc=[-n/v,0,n*Q/(v*v)],ca=[0,n/v,-n*q/(v*v)],ya=R[b.c],Ia=[Wc(ka(ya),Bc),Wc(ka(ya),ca)],Ex=[[0,-v,q],[v,0,-Q],[-q,Q,0]],vi=kt=>[...Wc(ka(Ex),kt).map(aa=>-aa),...oo(Wc(ka(ya),kt),-1)],wa=b.c?[vi(Bc),vi(ca)]:null,Ro=[N,J],Ua=[-Q/v,q/v];for(let kt=0;kt<2;kt++){for(let St=0;St<3;St++){$[b.p][St]+=rt*Ia[kt][St]*Ro[kt];for(let _t=0;_t<3;_t++)i[b.p][St][_t]+=rt*Ia[kt][St]*Ia[kt][_t]}if(g){L[a]+=rt*Ua[kt]*Ro[kt],M[a][a]+=rt*Ua[kt]*Ua[kt];for(let St=0;St<3;St++)U[b.p][0][St]+=rt*Ua[kt]*Ia[kt][St]}if(!wa)continue;const aa=6*(b.c-1),Ti=b.c*r+b.p;let Po=z.get(Ti);Po||z.set(Ti,Po=Array.from({length:6},()=>[0,0,0]));for(let St=0;St<6;St++){L[aa+St]+=rt*wa[kt][St]*Ro[kt];for(let _t=0;_t<6;_t++)M[aa+St][aa+_t]+=rt*wa[kt][St]*wa[kt][_t];for(let _t=0;_t<3;_t++)Po[St][_t]+=rt*wa[kt][St]*Ia[kt][_t];if(g){const _t=rt*wa[kt][St]*Ua[kt];M[aa+St][a]+=_t,M[a][aa+St]+=_t}}}}const at=i.map(b=>{const O=b.map((Q,q)=>Q.map((v,N)=>v+(q===N?V*(v+1e-9)+1e-9:0)));return Hi(O)}),ft=M.map((b,O)=>b.map((Q,q)=>Q+(O===q?V*(Q+1e-9):0))),gt=L.map(b=>-b),wt=new Map;for(const[b,O]of z){const Q=b%r;wt.has(Q)||wt.set(Q,[]),wt.get(Q).push({o:6*(Math.floor(b/r)-1),B:O})}g&&U.forEach((b,O)=>{wt.has(O)||wt.set(O,[]),wt.get(O).push({o:a,B:b})});for(const[b,O]of wt){const Q=at[b],q=O.map(({o:v,B:N})=>({o:v,M:N.map(J=>Wc(ka(Q),J))}));for(const v of q)for(let N=0;N<v.M.length;N++)gt[v.o+N]+=ma(v.M[N],$[b]);for(const v of q)for(const N of O)for(let J=0;J<v.M.length;J++)for(let ot=0;ot<N.B.length;ot++)ft[v.o+J][N.o+ot]-=ma(v.M[J],N.B[ot])}const l=Lo(ft,gt);if(!l){V*=10;continue}const p=$.map(b=>oo(b,-1));for(const[b,O]of wt)for(const{o:Q,B:q}of O)for(let v=0;v<3;v++)for(let N=0;N<q.length;N++)p[b][v]-=q[N][v]*l[Q+N];const y=R.map((b,O)=>O?Bo(Wo(l.slice(6*(O-1),6*(O-1)+3)),b):b),k=X.map((b,O)=>O?ao(b,l.slice(6*(O-1)+3,6*O)):b),I=j.map((b,O)=>ao(b,Wc(at[O],p[O]))),tt=g?n+l[a]:n,A=tt>0?m(y,k,I,tt):1/0;A<F?(F=A,R.splice(0,P,...y),X.splice(0,P,...k),j.splice(0,r,...I),n=tt,V=Math.max(1e-7,V/3)):V*=8}return C.forEach((u,M)=>{t[u]={...t[u],R:R[M],C:X[M]}}),w.forEach((u,M)=>e.set(u,j[M])),n}function Hi(t){const[[e,c,o],[n,s,x],[d,g,C]]=t,P=s*C-x*g,h=-(n*C-x*d),w=n*g-s*d,r=e*P+c*h+o*w;return Math.abs(r)<1e-18?[[0,0,0],[0,0,0],[0,0,0]]:[[P/r,-(c*C-o*g)/r,(c*x-o*s)/r],[h/r,(e*C-o*d)/r,-(e*x-o*n)/r],[w/r,-(e*g-c*d)/r,(e*s-c*n)/r]]}const Do=Object.freeze({ink:{width:1,tip:.12,press:.45,wobble:.06,alpha:1,retrace:!1,grain:0},pen:{width:.7,tip:.9,press:.04,wobble:.03,alpha:1,retrace:!1,grain:0},crayon:{width:1.1,tip:.7,press:.15,wobble:.14,alpha:.92,retrace:!0,grain:.55},chalk:{width:1.05,tip:.75,press:.12,wobble:.12,alpha:.88,retrace:!1,grain:.7},charcoal:{width:1.2,tip:.4,press:.3,wobble:.18,alpha:.9,retrace:!0,grain:.45},watercolor:{width:1.25,tip:.35,press:.35,wobble:.2,alpha:.55,retrace:!1,grain:0,wet:!0}});Object.freeze(["pencil","marker","brush",...Object.keys(Do)]);const Qt=(t,e,c,o)=>Object.freeze({id:t,vi:e,en:c,...o}),Eo=Object.freeze([Qt("watercolor-garden","Màu nước vườn","Watercolour garden",{about:["Màu nước loang trên giấy cotton, viền đậm nơi màu đọng","Translucent washes on cotton paper, darker pooled edges"],palette:["#f6efe0","#8fb39a","#e59b8b","#8fb5d4","#e8c170","#b07fa8"],ink:"#5b4a3f",brush:{style:"watercolor",width:.8,taper:.6,press:.5},outline:!0,texture:{type:"wash",amount:.7},paper:{color:"#f6efe0",texture:{type:"paper",amount:.6}},boil:{amount:1.2,fps:6},step:2,tags:["soft","editorial"]}),Qt("ink-wash","Thủy mặc","Ink wash",{about:["Mực tàu trên giấy dó, sắc độ xám, một điểm đỏ ấn","Brush ink on rice paper, grey tones, one red seal"],palette:["#f1ece0","#3c3c3c","#7d7d78","#c0392b","#dcd8cd","#5a6b5d"],ink:"#1d1d1b",brush:{style:"ink",width:1.1,taper:.85,press:.7},outline:!0,texture:{type:"wash",amount:.5},paper:{color:"#f1ece0",texture:{type:"paper",amount:.7}},boil:{amount:.8,fps:4},step:2,tags:["minimal","cinematic"]}),Qt("crayon-book","Sách sáp màu","Crayon book",{about:["Nét sáp màu thiếu nhi, tô gạch, giấy trắng ngà","Kids’ crayon lines and scribbled fills on warm paper"],palette:["#fbf6ea","#f2a93b","#4f9fd8","#e8504b","#cfe8ff","#6b4f8f"],ink:"#3a3226",brush:{style:"crayon",width:1,taper:.3,press:.3},outline:!0,texture:{type:"hatch",scale:.8,angle:-35,amount:.55},paper:{color:"#fbf6ea",texture:{type:"grain",amount:.5}},boil:{amount:2.4,fps:8},step:2,tags:["playful"]}),Qt("midcentury-flat","Phẳng thập niên 50","Midcentury flat",{about:["Mảng màu phẳng không viền, hạt in nhẹ, tông mù tạt – xanh két","Flat shapes without outlines, light print grain, mustard and teal"],palette:["#f3e7cf","#e2a33a","#2f7d79","#d9573b","#a9d6d0","#2c3e50"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:{type:"grain",amount:.35},paper:{color:"#f3e7cf",texture:{type:"grain",amount:.4}},boil:null,step:1,tags:["retro","clean"]}),Qt("rubber-hose","Hoạt hình ống cao su","Rubber-hose toon",{about:["Thập niên 30: đen trắng ngà, viền mực dày, chuyển động trên 2","1930s cartoon: cream greys, thick ink outlines, animated on twos"],palette:["#efe4cc","#e2d7bf","#a69c86","#5b5346","#fbf7ee","#2a251f"],ink:"#14110d",brush:{style:"ink",width:1.3,taper:.2,press:.2},outline:!0,texture:null,paper:{color:"#d8ccb2",texture:{type:"paper",amount:.8}},boil:{amount:1.6,fps:12},step:2,tags:["retro","playful"]}),Qt("riso-print","In riso","Riso print",{about:["Hai–ba màu mực in chồng, chấm tram, lệch bản nhẹ","Two or three overprinted inks, halftone, slight misregistration"],palette:["#f4eee2","#ff4f9a","#2a6fd6","#ffd23f","#ffc2dd","#1d3c78"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"riso",amount:.7},paper:{color:"#f4eee2",texture:{type:"grain",amount:.45}},boil:{amount:.6,fps:6},step:2,tags:["editorial","street"]}),Qt("papercut","Giấy cắt","Papercut",{about:["Lớp giấy cắt đỏ – kem, vân giấy, chuyển động stop-motion","Red and cream cut-paper layers, paper fibres, stop-motion timing"],palette:["#f5e9d4","#c8102e","#8b0a1f","#f0c05a","#ec9a78","#2b2b2b"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"paper",amount:.8},paper:{color:"#f5e9d4",texture:{type:"paper",amount:.9}},boil:{amount:.8,fps:4},step:3,tags:["editorial","playful"]}),Qt("whiteboard","Bảng trắng bút lông","Whiteboard marker",{about:["Bút lông đen – xanh – đỏ trên bảng trắng, tô gạch thưa","Black, blue and red markers on a whiteboard, loose hatching"],palette:["#fbfbf8","#1f5fbf","#d6332f","#2e9e5b","#f2b705","#555555"],ink:"#1b1b1b",brush:{style:"marker",width:.9,taper:.2,press:.1},outline:!0,texture:{type:"hatch",scale:1.2,angle:-45,amount:.35},paper:{color:"#fbfbf8",texture:{type:"grain",amount:.15}},boil:{amount:.8,fps:8},step:1,tags:["clean","corporate"]}),Qt("chalkboard","Bảng phấn","Chalkboard",{about:["Phấn trắng – vàng – hồng trên bảng xanh đen","White, yellow and pink chalk on a green-black board"],palette:["#24342c","#f4f1e8","#f6d65a","#f29bb6","#8fd3e8","#b6e388"],ink:"#f4f1e8",brush:{style:"chalk",width:1,taper:.3,press:.2},outline:!0,texture:{type:"stipple",scale:1,amount:.5},paper:{color:"#24342c",texture:{type:"grain",amount:.55}},boil:{amount:1.6,fps:8},step:2,tags:["retro","playful"]}),Qt("blueprint","Bản vẽ kỹ thuật","Blueprint",{about:["Nét trắng mảnh trên nền xanh lưới kỹ thuật","Thin white lines on blue grid paper"],palette:["#1d4f91","#e9f2ff","#9cc3ff","#ffd166","#6fb1ff","#c8dcff"],ink:"#e9f2ff",brush:{style:"pen",width:.6,taper:0,press:0},outline:!0,texture:{type:"hatch",scale:.7,angle:45,amount:.35},paper:{color:"#1d4f91",texture:{type:"grid",amount:.5}},boil:null,step:1,tags:["tech","minimal"]}),Qt("woodcut","Khắc gỗ","Woodcut",{about:["Mực đen dày, gạch khắc dày đặc, điểm đỏ","Heavy black ink, dense carved hatching, a red accent"],palette:["#efe6d2","#1a1714","#b8322a","#8a7a62","#e3d6b8","#5c4a3a"],ink:"#1a1714",brush:{style:"ink",width:1.4,taper:.6,press:.5},outline:!0,texture:{type:"crosshatch",scale:.8,angle:30,amount:.6},paper:{color:"#efe6d2",texture:{type:"paper",amount:.6}},boil:{amount:.6,fps:4},step:2,tags:["retro","editorial"]}),Qt("one-line","Một nét","One line",{about:["Một nét bút liền, không tô, vẽ dần","A single continuous pen line, no fills, drawn on"],palette:["#f7f4ee","#222222","#d64545","#3b6ea5","#999999","#555555"],ink:"#222222",brush:{style:"pen",width:.8,taper:.4,press:.1},outline:!0,texture:null,fillNone:!0,paper:{color:"#f7f4ee",texture:{type:"grain",amount:.2}},boil:null,step:1,tags:["minimal","clean"]}),Qt("isotype","Biểu tượng isotype","Isotype pictogram",{about:["Biểu tượng phẳng kiểu thống kê, 3 màu, gọn","Flat statistical pictograms, three colours, tidy"],palette:["#eceae4","#1d3557","#e63946","#457b9d","#a8dadc","#f1a208"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:null,paper:{color:"#eceae4",texture:null},boil:null,step:1,tags:["clean","corporate","minimal"]}),Qt("stained-glass","Kính màu","Stained glass",{about:["Viền chì đen dày, mảng màu ngọc rực, vân kính","Thick black leading, jewel colours, glass grain"],palette:["#121212","#1f6fb2","#c0392b","#f1c40f","#a3d9ff","#8e44ad"],ink:"#101010",brush:{style:"pen",width:1.8,taper:0,press:0},outline:!0,texture:{type:"grain",scale:1.6,amount:.5},paper:{color:"#151515",texture:{type:"grain",amount:.3}},boil:null,step:1,text:"#f6e7b4",tags:["bold","luxury"]}),Qt("pencil-sketch","Phác chì","Pencil sketch",{about:["Nét chì than mảnh, tô gạch đan nhạt, giấy vẽ","Graphite lines, light cross-hatching, sketch paper"],palette:["#f5f2ea","#8a8a86","#b9b7b0","#6e6a63","#c9a27e","#9fb0bf"],ink:"#3d3b38",brush:{style:"pencil",width:1.1,taper:.5,press:.4},outline:!0,texture:{type:"crosshatch",scale:1,angle:-40,amount:.45},paper:{color:"#f5f2ea",texture:{type:"paper",amount:.5}},boil:{amount:1.4,fps:8},step:2,tags:["soft","editorial"]}),Qt("pop-halftone","Pop chấm tram","Pop halftone",{about:["Viền đen đậm, chấm tram, vàng – đỏ – xanh rực","Bold black outlines, halftone dots, bright primaries"],palette:["#ffe14d","#ff3b3b","#1e90ff","#ff9f1c","#ffffff","#1a1a1a"],ink:"#111111",brush:{style:"marker",width:1.3,taper:0,press:0},outline:!0,texture:{type:"halftone",scale:1,angle:45,amount:.45},paper:{color:"#ffe14d",texture:{type:"halftone",scale:1.4,amount:.25,color:"#ffcc00"}},boil:null,step:1,tags:["bold","playful"]})]);Object.freeze(Eo.map(t=>t.id));const Sa=(t,e,c,o)=>Object.freeze({id:t,vi:e,en:c,prompt:o}),Li=Object.freeze([Sa("anime-cel","Anime cel","Anime cel","Japanese anime, clean cel shading, crisp ink line art, flat colour with one shadow tone"),Sa("cartoon-2d","Hoạt hình 2D","2D cartoon","Western 2D cartoon, bold clean outlines, flat bright colours, simple shapes"),Sa("chibi","Chibi","Chibi","cute chibi proportions (big head, small body), soft cel shading, clean outlines"),Sa("comic","Truyện tranh","Comic book","comic book art, heavy ink outlines, halftone shading, strong contrast"),...Eo.map(t=>Sa(t.id,t.vi,t.en,`${t.en}: ${t.about?.[1]||t.en}`))]);Object.freeze(Li.map(t=>t.id));const no=(t,e,c,o,n,s)=>Object.freeze({id:t,label:e,min:c,max:o,vi:n,en:s}),Di=Object.freeze({kling:no("kling","Kling 4.0",3,15,"Mặc định","Default"),seedance:no("seedance","Seedance 2.5",4,30,"Chân thực nhất","Most realistic"),wan:no("wan","Wan 3.0 Prime",2,15,"Bản nháp rẻ","Cheap draft")});Object.freeze(Object.keys(Di));const na="The person keeps exactly the same speech, lip movements, facial expressions, gestures, actions and timing as in the reference video.",sa=(t,e,c,o,n,s,x)=>Object.freeze({id:t,vi:e,en:c,image:o,hintVi:n,hintEn:s,build:x}),Ei=Object.freeze([sa("scene","Đổi cảnh/nền","Change scene","optional","VD: quán cà phê ấm áp buổi tối","e.g. a cosy café at night",(t,e)=>`Edit the reference video: replace only the background and surroundings with ${e?`the place shown in the reference image${t?` — ${t}`:""}`:t||"a bright, modern interior"}. ${na} Keep the same person, face, hair and clothes, the same camera framing and camera motion. Match the light on the person to the new background. Photorealistic, no text.`),sa("camera","Đổi góc máy","Camera angle","optional","VD: cận mặt từ bên trái","e.g. a close-up from the left",(t,e)=>`Re-film the same moment from a different camera angle: ${t||"a closer shot from a slightly different angle"}. ${na} Same person, clothes, location and lighting${e?"; the reference image shows the look of the new angle":""}. Smooth camera, photorealistic, no text.`),sa("character","Thay nhân vật","Swap character","required","VD: giữ giọng nói, đổi trang phục công sở","e.g. keep the office outfit",t=>`Edit the reference video: replace the person with the character in the reference image — the same face, hair, body and outfit as in the image${t?` (${t})`:""}. ${na} Keep the same body positions, background, camera framing and camera motion. One person only, shown once. Photorealistic, no text.`),sa("relight","Đổi ánh sáng","Relight","optional","VD: nắng vàng hoàng hôn từ cửa sổ","e.g. golden sunset light from a window",(t,e)=>`Edit the reference video: change only the lighting to ${t||"warm golden-hour light from the side"}${e?", like the light in the reference image":""}. ${na} Keep everything else the same — person, clothes, background, camera framing and camera motion. Photorealistic, no text.`),sa("dof","Xoá phông","Blur background","optional","VD: phông xoá mạnh hơn","e.g. an even softer background",t=>`Edit the reference video: keep the person sharp and in focus and give the background a shallow depth of field — soft, creamy bokeh like a full-frame camera with an f/1.8 lens${t?`; ${t}`:""}. ${na} Keep the same person, background layout, camera framing and camera motion. Photorealistic, no text.`),sa("custom","Tự viết","Custom","optional","Mô tả thay đổi (tiếng Anh cho kết quả tốt nhất)","Describe the change",t=>`${t||"Edit the reference video."}${/lip|speech|timing/i.test(t)?"":` ${na}`}`)]);Object.freeze(Ei.map(t=>t.id));const qi=Object.freeze({overcast:{azimuth:35,elevation:62,intensity:1.6,color:"#f1f4f8",ambient:"#c9d2dc",ambientIntensity:1.25,shadow:.45,softness:.85,contact:.75,env:.9,exposure:1},sun:{azimuth:40,elevation:48,intensity:3.4,color:"#fff3df",ambient:"#bcd2ec",ambientIntensity:.75,shadow:.7,softness:.25,contact:.8,env:.8,exposure:1},golden:{azimuth:70,elevation:16,intensity:3,color:"#ffc58a",ambient:"#8fa6c9",ambientIntensity:.7,shadow:.62,softness:.4,contact:.8,env:.7,exposure:1},night:{azimuth:20,elevation:55,intensity:1.4,color:"#ffd9a8",ambient:"#334866",ambientIntensity:.55,shadow:.5,softness:.55,contact:.85,env:.35,exposure:.85},studio:{azimuth:30,elevation:45,intensity:2.6,color:"#ffffff",ambient:"#ffffff",ambientIntensity:1,shadow:.35,softness:.6,contact:.6,env:1,exposure:1}});Object.freeze({preset:"overcast",...qi.overcast,blur:.5});const _=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,va=_(12,12,9),Gi=[["noodles","Mì / phở","Noodles",["M3 11h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M9 21h6","M14 3l5 6M17 3l4 5"],"phở bún mì hủ_tiếu noodle noodles ramen soup canh","food"],["rice","Cơm","Rice bowl",["M3 12h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M5 12c0-3 3-5.5 7-5.5s7 2.5 7 5.5","M9 21h6"],"cơm gạo cơm_tấm rice meal bữa_ăn","food"],["coffee","Cà phê","Coffee",["M4 9h12v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5Z","M16 11h2a2.5 2.5 0 0 1 0 5h-2","M8 3c-1 1 0 2 0 3M12 3c-1 1 0 2 0 3"],"cà_phê cafe coffee espresso latte quán_cà_phê","food"],["tea","Trà","Tea",["M5 8h12v5a6 6 0 0 1-12 0Z","M3 21h18","M17 9h1.5a2 2 0 0 1 0 4H17"],"trà chè tea trà_chiều","food"],["bubble-tea","Trà sữa","Bubble tea",["M6 7h12l-1.5 14h-9Z","M5 7h14","M12 7l2-5h3","M9.5 17h.01M12 18h.01M14.5 17h.01"],"trà_sữa trân_châu bubble_tea milk_tea đồ_uống","food"],["cake","Bánh kem","Cake",["M4 12h16v8H4Z","M4 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 4 0","M12 12V8","M12 5.5c.8-.8.8-1.8 0-2.5-.8.7-.8 1.7 0 2.5Z"],"bánh_kem bánh_sinh_nhật sinh_nhật cake birthday tiệm_bánh","food"],["pizza","Pizza","Pizza",["M12 21 3 6c6-3 12-3 18 0Z","M4.5 8.5c5-2.2 10-2.2 15 0",_(10,10.5,1),_(14,13,1)],"pizza","food"],["burger","Burger","Burger",["M4 11a8 6 0 0 1 16 0Z","M3 14h18","M4 17h16a2 2 0 0 1-2 3H6a2 2 0 0 1-2-3Z"],"burger hamburger bánh_mì_kẹp đồ_ăn_nhanh fast_food","food"],["fries","Khoai tây chiên","Fries",["M6 10h12l-1.5 11h-9Z","M8 10 7 3M11 10V2M14 10l1-7M17 10l1.5-5"],"khoai_tây_chiên fries snack ăn_vặt","food"],["drumstick","Gà rán","Fried chicken",["M17 4a5 5 0 0 1 0 7l-3.5 3.5a3 3 0 0 1-4-4L13 7a5 5 0 0 1 4-3Z","M10.5 13.5l-5 5",_(4.5,19.5,1.6),_(6.5,20.8,1.2)],"gà gà_rán thịt_gà chicken fried_chicken","food"],["fish","Cá / hải sản","Fish",["M3 12c3-5 9-6 14 0-5 6-11 5-14 0Z","M17 12l4-3v6Z",_(8,11,.6)],"cá hải_sản fish seafood sushi","food"],["steak","Thịt bò","Steak",["M5 8c2-4 10-5 14-1s1 11-6 11-10-6-8-10Z",_(14,10,2),"M7 13c2 1 4 1 6-1M9 16c2 .5 4 0 5-1.5"],"thịt bò bít_tết steak beef thịt_nướng bbq","food"],["egg","Trứng","Egg",["M5 10c0-4 4-6 7-5s6-1 7 3-1 9-7 9-7-3-7-7Z",_(12,12,2.5)],"trứng trứng_ốp egg breakfast bữa_sáng","food"],["bread","Bánh mì","Bread",["M4 11a4 4 0 0 1 2-7h12a4 4 0 0 1 2 7v9H4Z","M9 8v3M13 8v3"],"bánh_mì bread bakery tiệm_bánh","food"],["apple","Trái cây","Fruit",["M12 7c-3-2-8-1-8 5s3 9 5 9c1 0 2-.6 3-.6s2 .6 3 .6c2 0 5-3 5-9s-5-7-8-5Z","M12 7c0-2 1-4 3-4"],"trái_cây hoa_quả táo apple fruit healthy lành_mạnh","food"],["carrot","Rau củ","Vegetables",["M14 7c-3 1-9 7-11 14 7-2 13-8 14-11a2.5 2.5 0 0 0-3-3Z","M15.5 7.5l3.5-4M16.5 8.5l4.5-1.5M15 6.5l.5-4.5","M8 13l2 1.5M6 16.5l2 1.5"],"rau rau_củ cà_rốt vegetable vegetables organic","food"],["chili","Cay","Spicy",["M18 5c-1 7-6 14-14 15 4-3 7-7 9-13","M13 7c1-2 3-3 5-2","M18 5c0-1 1-2 2-2"],"cay ớt spicy chili hot","food"],["wine","Rượu vang","Wine",["M7 3h10l-.5 5a4.5 4.5 0 0 1-9 0Z","M12 13v8M8 21h8"],"rượu rượu_vang vang wine bar nhà_hàng","food"],["beer","Bia","Beer",["M5 8h10v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1Z","M15 11h2a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-2","M5 8a2.5 2.5 0 0 1 3-3 3 3 0 0 1 5 0 2.5 2.5 0 0 1 2 3","M9 12v5M11.5 12v5"],"bia beer nhậu quán_nhậu","food"],["cocktail","Cocktail","Cocktail",["M4 4h16l-8 9Z","M12 13v7M8 20h8","M17 4l2-2"],"cocktail mocktail đồ_uống drink pha_chế","food"],["ice-cream","Kem","Ice cream",["M7 10a5 5 0 0 1 10 0Z","M7 10l5 12 5-12"],"kem ice_cream tráng_miệng dessert","food"],["donut","Bánh ngọt","Donut",[va,_(12,12,3),"M7 8h.01M16 7h.01M8 16h.01M17 15h.01"],"bánh_ngọt donut bánh_vòng snack","food"],["chef","Đầu bếp","Chef",["M7 14a4 4 0 0 1-1-7.8A5 5 0 0 1 12 3a5 5 0 0 1 6 3.2A4 4 0 0 1 17 14Z","M7 14v6h10v-6","M7 17h10"],"đầu_bếp bếp nấu_ăn chef cook công_thức recipe","food"],["cutlery","Nhà hàng","Restaurant",["M7 3v8M5 3v5a2 2 0 0 0 4 0V3","M7 11v10","M17 3c-2 2-2 6 0 8v10"],"nhà_hàng quán_ăn ăn ăn_uống restaurant dining thực_đơn menu","food"],["pot","Nồi","Pot",["M4 10h16v7a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3Z","M2 10h20","M9 7h6","M10 4c-.8.8 0 1.6 0 2.4M14 4c-.8.8 0 1.6 0 2.4"],"nồi lẩu nấu hầm hot_pot","food"],["pan","Chảo","Pan",[_(9,13,6),"M15 13h7"],"chảo xào chiên rán pan fry","food"],["store","Cửa hàng","Shop",["M3 9 5 3h14l2 6","M3 9a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0","M5 12v9h14v-9","M10 21v-5h4v5"],"cửa_hàng shop store tiệm kinh_doanh bán_hàng","food"],["receipt","Hoá đơn","Receipt",["M6 2h12v20l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5-2 1.5Z","M9 7h6M9 11h6M9 15h3"],"hoá_đơn bill receipt thanh_toán đơn_hàng","food"],["scooter","Xe máy giao hàng","Scooter",[_(6,17,2.5),_(18,17,2.5),"M8.5 17h7","M15.5 17 13 9h-3","M13 9l3-4h3","M3 12h7"],"xe_máy shipper giao_đồ_ăn grab xe_ôm scooter motorbike","food"],["pulse","Nhịp tim","Heartbeat",["M2 12h4l2-5 4 10 2-5h8"],"nhịp_tim tim_mạch heartbeat pulse sức_khoẻ health","care"],["stethoscope","Khám bệnh","Doctor",["M6 3v6a4 4 0 0 0 8 0V3","M10 13v3a5 5 0 0 0 10 0v-2",_(20,12,2)],"bác_sĩ khám khám_bệnh phòng_khám doctor clinic y_tế","care"],["pill","Thuốc","Medicine",["M4.6 12.9 12.9 4.6a4.6 4.6 0 0 1 6.5 6.5l-8.3 8.3a4.6 4.6 0 0 1-6.5-6.5Z","M8.8 8.8l6.4 6.4"],"thuốc viên_uống thực_phẩm_chức_năng medicine pill vitamin","care"],["syringe","Tiêm","Injection",["M15 4l5 5-10 10-5-5Z","M18 2l4 4","M5 19l-2 2","M8 11l2 2M11 8l2 2"],"tiêm vắc_xin filler botox injection vaccine","care"],["medical","Y tế","Medical",["M9 3h6v6h6v6h-6v6H9v-6H3V9h6Z"],"y_tế bệnh_viện cấp_cứu medical hospital","care"],["tooth","Răng","Teeth",["M7 3c-3 0-4 3-3.5 6S5 15 6 19c.5 2 2 2 2.5 0l1-4c.4-1.5 2.6-1.5 3 0l1 4c.5 2 2 2 2.5 0 1-4 2-7 2.5-10S20 3 17 3c-2 0-3 1-5 1S9 3 7 3Z"],"răng nha_khoa niềng_răng tẩy_trắng dental teeth","care"],["brain","Trí não","Brain",["M12 5a3 3 0 0 0-5.5-1.5A3.5 3.5 0 0 0 4 9a3.5 3.5 0 0 0 1 6.5A3.5 3.5 0 0 0 9 20a3 3 0 0 0 3-1.5Z","M12 5a3 3 0 0 1 5.5-1.5A3.5 3.5 0 0 1 20 9a3.5 3.5 0 0 1-1 6.5A3.5 3.5 0 0 1 15 20a3 3 0 0 1-3-1.5Z","M12 5v13.5"],"não trí_não tư_duy tâm_lý trí_nhớ brain mind psychology","care"],["dna","Gen / DNA","DNA",["M7 2c0 7 10 7 10 14 0 3-1 5-1 6","M17 2c0 7-10 7-10 14 0 3 1 5 1 6","M9 6h6M8 11h8M8.5 18h7"],"dna gen di_truyền khoa_học tế_bào science","care"],["thermometer","Nhiệt độ","Temperature",["M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0Z","M12 14V9"],"sốt nhiệt_độ nhiệt_kế temperature fever","care"],["bandage","Băng dán","Bandage",["M4.5 14.5 14.5 4.5a3.5 3.5 0 0 1 5 5l-10 10a3.5 3.5 0 0 1-5-5Z","M10 10h.01M14 10h.01M10 14h.01M14 14h.01"],"vết_thương băng_dán sơ_cứu bandage","care"],["first-aid","Sơ cứu","First aid",["M3 7h18v13H3Z","M8 7V4h8v3","M12 10v7M8.5 13.5h7"],"sơ_cứu hộp_thuốc bảo_hiểm first_aid insurance","care"],["dumbbell","Tập gym","Workout",["M2 12h20","M5 8v8M8 6v12M16 6v12M19 8v8"],"gym tập tập_luyện tạ thể_hình workout fitness cơ_bắp","care"],["running","Chạy bộ","Running",[_(15,4,2),"M8 21l3-5 3 2v4","M11 16l1-6 3 2 3 1","M12 10l-4 1-2 3"],"chạy chạy_bộ cardio running marathon vận_động","care"],["yoga","Yoga / thiền","Yoga",[_(12,4.5,2),"M12 7.5V13","M12 9.5l-4 3.5 1.5 1.5M12 9.5l4 3.5-1.5 1.5","M5 18.5c2-2 4.5-2.5 7-2.5s5 .5 7 2.5c-2 1-4.5 1.5-7 1.5s-5-.5-7-1.5Z"],"yoga thiền meditation thư_giãn cân_bằng","care"],["bicycle","Đạp xe","Cycling",[_(5.5,16,3.5),_(18.5,16,3.5),"M5.5 16l4-7h6l3 7","M9.5 9 12 16H5.5","M14 6h2l-.5 3"],"xe_đạp đạp_xe cycling bike","care"],["stopwatch","Bấm giờ","Stopwatch",[_(12,14,7),"M12 14v-4","M10 3h4","M12 3v4","M18 7l1.5-1.5"],"bấm_giờ đồng_hồ_bấm_giờ phút giây timer stopwatch interval","care"],["scale","Cân nặng","Weight",["M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z","M8 10a4 4 0 0 1 8 0Z","M12 10l1.5-2.5"],"cân cân_nặng giảm_cân kg béo weight scale","care"],["drop","Nước","Water",["M12 3c3 4.5 6 8 6 11a6 6 0 0 1-12 0c0-3 3-6.5 6-11Z","M9.5 15a2.5 2.5 0 0 0 2.5 2.5"],"nước uống_nước cấp_nước cấp_ẩm water hydration giọt","care"],["lotion","Mỹ phẩm","Skincare",["M9 3h6v3H9Z","M8 6h8l1 3v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9Z","M10 13h4"],"mỹ_phẩm kem serum dưỡng_da skincare chăm_sóc_da sữa_rửa_mặt","care"],["lipstick","Son môi","Lipstick",["M9 11h6v10H9Z","M10 11V6l4-3v8","M9 15h6"],"son son_môi trang_điểm makeup lipstick","care"],["mirror","Gương","Mirror",[_(12,9,6),"M12 15v6M8 21h8"],"gương làm_đẹp beauty ngoại_hình","care"],["scissors","Cắt tóc","Haircut",[_(6,6,3),_(6,18,3),"M8.2 8.2 20 18M8.2 15.8 20 6"],"cắt cắt_tóc salon tóc barber haircut","care"],["comb","Chải tóc","Comb",["M3 9h18v4H3Z","M5 13v6M8 13v6M11 13v6M14 13v6M17 13v6"],"lược chải_tóc tóc hair","care"],["lotus","Spa","Spa",["M12 20c-5 0-9-3-9-7 3 0 6 1 9 4 3-3 6-4 9-4 0 4-4 7-9 7Z","M12 17c-2-3-2-7 0-11 2 4 2 8 0 11Z"],"spa massage thư_giãn liệu_trình wellness sen","care"],["moon","Giấc ngủ","Sleep",["M20 14a8 8 0 1 1-10-10 6.5 6.5 0 0 0 10 10Z","M16 3h3l-3 3h3"],"ngủ giấc_ngủ mất_ngủ ban_đêm sleep night","care"],["smile","Vui vẻ","Happy",[va,"M8.5 14a4 4 0 0 0 7 0","M9 9.5h.01M15 9.5h.01"],"vui hạnh_phúc hài_lòng cười happy smile","social"],["book","Sách","Book",["M4 4h11a3 3 0 0 1 3 3v14H7a3 3 0 0 1-3-3Z","M4 18a3 3 0 0 1 3-3h11"],"sách tài_liệu ebook book đọc_sách","learn"],["book-open","Bài học","Lesson",["M2 5h7a3 3 0 0 1 3 3v12a2.5 2.5 0 0 0-2.5-2.5H2Z","M22 5h-7a3 3 0 0 0-3 3v12a2.5 2.5 0 0 1 2.5-2.5H22Z"],"bài_học học đọc kiến_thức lesson learn study","learn"],["graduation","Tốt nghiệp","Graduation",["M2 9l10-5 10 5-10 5Z","M6 11v5c3 2.5 9 2.5 12 0v-5","M22 9v6"],"tốt_nghiệp khoá_học đại_học học_viên course graduation education giáo_dục","learn"],["pencil","Viết","Write",["M4 20l1-5L16 4l4 4L9 19Z","M14 6l4 4"],"viết bút ghi_chú bài_tập write note homework","learn"],["ruler","Đo lường","Ruler",["M3 16 16 3l5 5L8 21Z","M7 12l2 2M10 9l2 2M13 6l2 2"],"thước đo kích_thước ruler measure","learn"],["backpack","Học sinh","Student",["M6 8a6 6 0 0 1 12 0v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1Z","M9 4V3h6v1","M8 14h8v4H8Z"],"học_sinh sinh_viên đi_học balo student school","learn"],["school","Trường học","School",["M3 21V10l9-6 9 6v11","M3 21h18","M10 21v-5h4v5",_(12,11,1.8)],"trường trường_học trung_tâm school academy","learn"],["certificate","Chứng chỉ","Certificate",["M4 4h16v12H4Z","M8 8h8M8 11h5",_(16,17,2.5),"M14.5 19 14 22l2-1 2 1-.5-3"],"chứng_chỉ bằng_cấp chứng_nhận certificate diploma","learn"],["robot","AI / robot","AI robot",["M5 8h14v11H5Z","M12 8V5",_(12,3.5,1),"M9 13h.01M15 13h.01","M9.5 16.5h5","M2 12v3M22 12v3"],"ai trí_tuệ_nhân_tạo robot chatbot tự_động automation bot","learn"],["laptop","Máy tính","Laptop",["M5 5h14v10H5Z","M2 19h20l-2-4H4Z"],"laptop máy_tính làm_việc online computer","learn"],["monitor","Màn hình","Screen",["M3 4h18v12H3Z","M8 21h8M12 16v5"],"màn_hình desktop screen dashboard","learn"],["code","Lập trình","Code",["m8 7-5 5 5 5","m16 7 5 5-5 5","m14 4-4 16"],"code lập_trình developer website phần_mềm programming","learn"],["wifi","Internet","Wi-Fi",["M2 9a15 15 0 0 1 20 0","M5 12.5a10 10 0 0 1 14 0","M8.5 16a5 5 0 0 1 7 0","M12 19.5h.01"],"wifi internet mạng kết_nối online","learn"],["server","Dữ liệu","Server",["M4 4h16v6H4Z","M4 14h16v6H4Z","M8 7h.01M8 17h.01"],"máy_chủ server dữ_liệu lưu_trữ hosting database","learn"],["cursor","Click","Click",["M5 3l14 8-6 2-2 6Z","M13 13l5 5"],"click bấm nhấn_vào link chuột cursor","learn"],["gamepad","Game","Game",["M7 7h10a5 5 0 0 1 4.9 6l-.8 4a2.5 2.5 0 0 1-4.3 1.2L14 15h-4l-2.8 3.2A2.5 2.5 0 0 1 2.9 17l-.8-4A5 5 0 0 1 7 7Z","M8 10v4M6 12h4","M15 11h.01M17 13h.01"],"game chơi_game gaming trò_chơi esport","learn"],["headphones","Nghe","Listen",["M4 15v-3a8 8 0 0 1 16 0v3","M4 15h3v6H5a1 1 0 0 1-1-1Z","M20 15h-3v6h2a1 1 0 0 0 1-1Z"],"nghe tai_nghe podcast audio listen","learn"],["mic","Micro","Microphone",["M12 2a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z","M5 11a7 7 0 0 0 14 0","M12 18v4"],"micro nói giọng_nói thu_âm voice speak livestream","learn"],["video-cam","Quay video","Recording",["M3 7h12v10H3Z","M15 10l6-3v10l-6-3"],"quay quay_video camera vlog recording","learn"],["link","Liên kết","Link",["M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1","M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"],"link liên_kết kết_nối đường_dẫn connect","learn"],["puzzle","Giải pháp","Puzzle",["M4 7h4a2 2 0 1 1 4 0h4v4a2 2 0 1 1 0 4v4H4v-4a2 2 0 1 0 0-4Z"],"giải_pháp mảnh_ghép tích_hợp puzzle solution integration","learn"],["search","Tìm kiếm","Search",[_(10.5,10.5,6.5),"m15.5 15.5 5 5"],"tìm tìm_kiếm search google nghiên_cứu research","learn"],["gear","Cài đặt","Settings",[_(12,12,3),_(12,12,7),"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1"],"cài_đặt thiết_lập quy_trình vận_hành settings process setup","learn"],["calculator","Tính toán","Calculator",["M5 3h14v18H5Z","M8 6h8v3H8Z","M8 13h.01M12 13h.01M16 13h.01M8 17h.01M12 17h.01M16 17h.01"],"tính tính_toán máy_tính_tiền kế_toán calculator accounting","learn"],["translate","Ngôn ngữ","Language",["M3 5h10M8 3v2","M5 5c1 4 4 7 7 8","M11 5c-1 4-4 7-7 8","M13 21l4-9 4 9","M14.5 18h5"],"ngôn_ngữ tiếng_anh dịch ngoại_ngữ language translate english","learn"],["download","Tải về","Download",["M12 3v12","m7 10 5 5 5-5","M4 21h16"],"tải tải_về download cài_app","learn"],["battery","Năng lượng","Battery",["M3 7h15v10H3Z","M21 10v4","M6 10v4M9 10v4"],"pin năng_lượng sạc battery energy","learn"],["door","Cửa","Door",["M6 3h12v18H6Z","M14 12h.01","M3 21h18"],"cửa cửa_ra_vào door entrance","place"],["bed","Phòng ngủ","Bedroom",["M3 18V6","M3 13h18v5","M21 18v-5a3 3 0 0 0-3-3h-8v3",_(6.5,10.5,1.5)],"phòng_ngủ giường khách_sạn homestay bedroom hotel","place"],["sofa","Phòng khách","Living room",["M5 11V8a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v3","M3 11a2 2 0 0 1 2 2v2h14v-2a2 2 0 1 1 4 0v5H1v-5a2 2 0 0 1 2-2Z","M5 20v1M19 20v1"],"phòng_khách sofa nội_thất living_room furniture","place"],["bath","Phòng tắm","Bathroom",["M3 12h18v3a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5Z","M6 12V5a2 2 0 0 1 4 0","M7 20l-1 2M17 20l1 2"],"phòng_tắm bồn_tắm wc toilet bathroom","place"],["area","Diện tích","Floor area",["M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5","M4 4l6 6M20 4l-6 6M20 20l-6-6M4 20l6-6"],"diện_tích m2 mét_vuông rộng area size","place"],["plane","Máy bay","Flight",["M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5Z"],"máy_bay bay chuyến_bay vé_máy_bay du_lịch flight travel","place"],["suitcase","Hành lý","Luggage",["M4 7h16v13H4Z","M9 7V4h6v3","M9 7v13M15 7v13"],"vali hành_lý đi_du_lịch luggage trip","place"],["ticket","Vé","Ticket",["M3 7h18v3a2 2 0 0 0 0 4v3H3v-3a2 2 0 0 0 0-4Z","M14 7v2M14 11v2M14 15v2"],"vé voucher sự_kiện ticket event","place"],["map","Bản đồ","Map",["M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3Z","M9 3v15M15 6v15"],"bản_đồ lộ_trình hành_trình map route","place"],["mountain","Núi","Mountain",["M2 20 9 8l4 6 3-4 6 10Z","M7.5 10.5 9 12l1.5-1.5"],"núi leo_núi trekking phượt mountain","place"],["umbrella","Biển","Beach",["M3 11a9 9 0 0 1 18 0Z","M12 11v10","M12 2v2"],"biển bãi_biển nghỉ_dưỡng resort beach ô_dù","place"],["palm","Nhiệt đới","Tropical",["M12 21c0-5 .5-9 1-12","M13 9c-2-3-6-4-9-2 3 0 5 1 6 3","M13 9c1-3 4-5 8-4-3 1-5 3-5 5","M13 9c-1-2-1-5 1-7 1 2 1 5-1 7","M7 21h12"],"dừa nhiệt_đới đảo kỳ_nghỉ tropical island vacation","place"],["sun","Nắng","Sunny",[_(12,12,4),"M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"],"nắng mặt_trời mùa_hè thời_tiết sunny summer weather","place"],["rain","Mưa","Rain",["M7 14a4 4 0 0 1 .5-8A6 6 0 0 1 18.5 8a3.5 3.5 0 0 1-.5 6Z","M8 17l-1 3M12 17l-1 3M16 17l-1 3"],"mưa mùa_mưa bão rain storm","place"],["pool","Hồ bơi","Pool",["M8 12V4M16 12V4M8 6h8M8 10h8","M2 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0","M2 19c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0"],"hồ_bơi bể_bơi bơi pool swimming tiện_ích","place"],["tent","Cắm trại","Camping",["M12 3 2 21h20Z","M9 21l3-6 3 6"],"cắm_trại camping glamping dã_ngoại","place"],["tree","Cây xanh","Greenery",["M12 22v-6","M12 2l6 8h-3l4 6H5l4-6H6Z"],"cây cây_xanh công_viên thiên_nhiên tree park green","place"],["train","Tàu","Train",["M6 3h12a2 2 0 0 1 2 2v10a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V5a2 2 0 0 1 2-2Z","M4 10h16","M8 14h.01M16 14h.01","M8 18l-2 3M16 18l2 3"],"tàu tàu_hoả metro tàu_điện train","place"],["bus","Xe buýt","Bus",["M5 3h14a1 1 0 0 1 1 1v13H4V4a1 1 0 0 1 1-1Z","M4 10h16","M7 14h.01M17 14h.01","M6 17v3M18 17v3"],"xe_buýt xe_khách bus tour","place"],["car","Ô tô","Car",["M3 13l2-5a2 2 0 0 1 2-1h10a2 2 0 0 1 2 1l2 5v5H3Z","M3 13h18",_(7.5,16,1),_(16.5,16,1),"M5 18v2M19 18v2"],"ô_tô xe_hơi xe car vehicle lái_xe","place"],["fuel","Xăng","Fuel",["M4 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M3 21h12","M7 7h4v4H7Z","M14 9h2a2 2 0 0 1 2 2v6a1.5 1.5 0 0 0 3 0V8l-3-3"],"xăng nhiên_liệu đổ_xăng tiết_kiệm_xăng fuel gas","place"],["ev-charge","Xe điện","EV charging",["M5 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M4 21h12","M10 7l-2 4h4l-2 4","M15 10h2a2 2 0 0 1 2 2v4a1.5 1.5 0 0 0 3 0V9"],"xe_điện sạc_xe trạm_sạc vinfast ev electric","place"],["road","Đường đi","Road",["M8 3 4 21M16 3l4 18","M12 4v2M12 10v3M12 17v3"],"con_đường đường_đi đường_phố đường_cao_tốc cao_tốc hành_trình road highway street","place"],["parking","Đỗ xe","Parking",["M4 4h16v16H4Z","M9 17V7h4a3 3 0 0 1 0 6H9"],"đỗ_xe bãi_xe hầm_xe parking","place"],["steering","Lái xe","Driving",[va,_(12,12,2),"M3.5 10h6.5M14 10h6.5M12 14v7"],"lái lái_xe vô_lăng học_lái driving","place"],["speedometer","Tốc độ","Speed",["M4 18a9 9 0 1 1 16 0","M12 14l4-5","M12 14h.01"],"tốc_độ km/h vận_tốc speed performance hiệu_suất","place"],["traffic-light","Giao thông","Traffic",["M8 2h8v20H8Z",_(12,6.5,1.6),_(12,12,1.6),_(12,17.5,1.6)],"giao_thông đèn_đỏ kẹt_xe traffic","place"],["ship","Tàu thuỷ","Ship",["M3 15h18l-3 5H6Z","M5 15V9h14v6","M9 9V5h6v4","M12 2v3"],"tàu_thuỷ du_thuyền cảng xuất_khẩu logistics ship cruise","place"],["megaphone","Thông báo","Announcement",["M3 10v4h4l9 5V5l-9 5Z","M7 14l1.5 6H11l-1-5","M19 9a4 4 0 0 1 0 6"],"thông_báo quảng_cáo marketing loa announce ads","social"],["bell","Chuông","Notification",["M6 16v-5a6 6 0 0 1 12 0v5l2 2H4Z","M10 21h4"],"chuông thông_báo nhắc subscribe đăng_ký_kênh notification","social"],["hashtag","Hashtag","Hashtag",["M5 9h14M5 15h14M10 3 8 21M16 3l-2 18"],"hashtag xu_hướng tag trending","social"],["at","Tài khoản","Mention",[_(12,12,4),"M16 8v5a2.5 2.5 0 0 0 5 0v-1a9 9 0 1 0-3.5 7.1"],"tài_khoản tag nhắc_tên username mention","social"],["user-plus","Theo dõi","Follow",[_(9,8,4),"M2 21a7 7 0 0 1 14 0","M19 8v6M16 11h6"],"follow theo_dõi kết_bạn follower người_theo_dõi","social"],["live","Livestream","Live",[_(12,12,2),"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 7.8a6 6 0 0 1 0 8.4","M4.9 4.9a10 10 0 0 0 0 14.2M19.1 4.9a10 10 0 0 1 0 14.2"],"live livestream phát_sóng trực_tiếp broadcast","social"],["share","Chia sẻ","Share",[_(6,12,2.5),_(18,6,2.5),_(18,18,2.5),"M8.2 10.8l7.6-3.6M8.2 13.2l7.6 3.6"],"chia_sẻ share lan_toả viral","social"],["sad","Buồn","Sad",[va,"M8.5 16a4 4 0 0 1 7 0","M9 9.5h.01M15 9.5h.01"],"buồn thất_vọng chán sad upset","social"],["wow","Bất ngờ","Surprise",[va,_(12,15.5,1.8),"M9 9.5h.01M15 9.5h.01"],"bất_ngờ ngạc_nhiên wow sốc shock","social"],["crown","Đẳng cấp","Premium",["M3 8l4.5 4L12 5l4.5 7L21 8l-2 11H5Z","M5 19h14"],"vương_miện đẳng_cấp vip cao_cấp king queen","money"],["medal","Huy chương","Medal",[_(12,15,5),"M8.5 11 5 3h4l3 6 3-6h4l-3.5 8","M12 13v4"],"huy_chương giải thành_tích medal achievement","money"],["flag","Cột mốc","Milestone",["M5 21V4","M5 4h12l-2 4 2 4H5"],"cột_mốc mục_tiêu về_đích bắt_đầu milestone flag","money"],["handshake","Hợp tác","Partnership",["M2 11l4-4 4 2 3-2 4 1 5 4","M7 12l4 4a1.5 1.5 0 0 0 2-2","M10 14l2 2a1.5 1.5 0 0 0 2-2l-3-3","M13 13l1.5 1.5a1.5 1.5 0 0 0 2-2L13 9"],"hợp_tác đối_tác thoả_thuận deal partner partnership","money"],["briefcase","Công việc","Work",["M3 7h18v13H3Z","M8 7V4h8v3","M3 13h18"],"công_việc việc_làm tuyển_dụng doanh_nghiệp job business office","money"],["wallet","Ví tiền","Wallet",["M3 6a2 2 0 0 1 2-2h12v4","M3 6v12a2 2 0 0 0 2 2h16V8H5a2 2 0 0 1-2-2Z","M16 14h.01"],"ví ví_tiền chi_tiêu ví_điện_tử wallet spending","money"],["card","Thẻ","Card",["M2 5h20v14H2Z","M2 10h20","M6 15h4"],"thẻ thẻ_tín_dụng thanh_toán quẹt_thẻ card payment","money"],["bank","Ngân hàng","Bank",["M3 10 12 4l9 6","M4 10h16","M6 10v8M10 10v8M14 10v8M18 10v8","M3 21h18"],"ngân_hàng vay lãi_suất bank loan","money"],["piggy","Heo đất","Piggy bank",["M5 11a7 6 0 0 1 12-3h2l1 3h1v4h-2l-1 3h-3v2h-3v-2H9v2H6v-3a6 6 0 0 1-1-6Z","M14 9h.01","M9 7h4"],"heo_đất để_dành tích_luỹ piggy saving","money"],["document","Tài liệu","Document",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 13h7M9 17h5"],"tài_liệu hồ_sơ giấy_tờ báo_cáo document file","money"],["contract","Hợp đồng","Contract",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 17c1-2 2 1 3-1s2 1 3 0"],"hợp_đồng ký ký_kết pháp_lý contract sign legal","money"],["folder","Thư mục","Folder",["M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v11H3Z"],"thư_mục lưu_trữ folder","money"],["clipboard","Danh sách","Checklist",["M8 4H6v17h12V4h-2","M9 3h6v3H9Z","m9 13 2 2 4-4"],"checklist danh_sách việc_cần_làm todo kế_hoạch plan","money"],["pie","Tỷ trọng","Pie chart",["M21 12a9 9 0 1 1-9-9v9Z","M15 3a9 9 0 0 1 6 6h-6Z"],"tỷ_trọng thị_phần cơ_cấu pie market_share","money"],["funnel","Phễu","Funnel",["M3 4h18l-7 9v6l-4 2v-8Z"],"phễu lọc chuyển_đổi khách_hàng_tiềm_năng funnel filter conversion","money"],["magnet","Thu hút","Attract",["M5 4v8a7 7 0 0 0 14 0V4h-5v8a2 2 0 0 1-4 0V4Z","M5 8h5M14 8h5"],"thu_hút hút_khách nam_châm attract magnet lead","money"],["hourglass","Chờ đợi","Waiting",["M6 3h12M6 21h12","M7 3c0 5 10 5 10 9s-10 4-10 9","M17 3c0 5-10 5-10 9s10 4 10 9"],"chờ chờ_đợi hạn sắp_hết thời_hạn countdown deadline","money"],["infinity","Không giới hạn","Unlimited",["M12 12c-2-2.7-4-4-6-4a4 4 0 0 0 0 8c2 0 4-1.3 6-4Zm0 0c2 2.7 4 4 6 4a4 4 0 0 0 0-8c-2 0-4 1.3-6 4Z"],"không_giới_hạn mãi_mãi vô_hạn unlimited forever","money"],["refresh","Lặp lại","Repeat",["M21 12a9 9 0 0 1-15.5 6.3L3 16","M3 12a9 9 0 0 1 15.5-6.3L21 8","M3 21v-5h5M21 3v5h-5"],"lặp_lại đổi_trả hoàn_tiền cập_nhật refund repeat update","money"],["paw","Thú cưng","Pets",[_(7,9,1.8),_(17,9,1.8),_(10,5,1.6),_(14,5,1.6),"M12 12c-3 0-5 3-5 5.5 0 2 1.5 2.5 3 2 1-.3 1.5-.5 2-.5s1 .2 2 .5c1.5.5 3 0 3-2 0-2.5-2-5.5-5-5.5Z"],"thú_cưng chó mèo pet dog cat","social"]],Lt=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,Zc=Lt(12,12,9),Oi={money:"Tiền",coins:"Tiết kiệm",percent:"Phần trăm",growth:"Tăng trưởng",decline:"Giảm",chart:"Biểu đồ",target:"Mục tiêu",clock:"Thời gian",calendar:"Lịch",user:"Cá nhân",users:"Đội nhóm",cart:"Giỏ hàng",bag:"Sản phẩm",gift:"Quà tặng",tag:"Giảm giá",rocket:"Ra mắt",bulb:"Ý tưởng",bolt:"Nhanh",star:"Ngôi sao",heart:"Trái tim",shield:"Uy tín",lock:"Riêng tư",key:"Bí quyết",check:"Hoàn thành",cross:"Sai",warning:"Lưu ý",question:"Câu hỏi",phone:"Điện thoại",chat:"Tin nhắn",mail:"Email",globe:"Toàn cầu",home:"Nhà",location:"Địa điểm",truck:"Giao hàng",fire:"Nổi bật",trophy:"Chiến thắng",sparkle:"Mới",chip:"Công nghệ",play:"Video",camera:"Ảnh",eye:"Lượt xem",like:"Thích",leaf:"Tự nhiên",music:"Âm nhạc"},Ni={money:"money",coins:"money",percent:"money",growth:"money",decline:"money",chart:"money",target:"money",tag:"money",cart:"money",bag:"money",gift:"money",trophy:"money",user:"social",users:"social",heart:"social",like:"social",chat:"social",mail:"social",phone:"social",eye:"social",fire:"social",play:"social",camera:"social",music:"social",chip:"learn",bulb:"learn",rocket:"learn",question:"learn",globe:"learn",home:"place",location:"place",truck:"place",leaf:"place"},Z=(t,e,c,o)=>[t,{name:Oi[t],en:e,d:c,hints:o,group:Ni[t]??"general"}],ja=Object.freeze(Object.fromEntries([Z("money","Money",["M2.5 6.5h19v11h-19Z",Lt(12,12,2.6),"M6 12h.01M18 12h.01"],"tiền giá triệu tỷ nghìn vnd usd $ money price cash cost chi_phí thu_nhập lương giá_tiền"),Z("coins","Savings",["M5 7a7 3 0 1 0 14 0a7 3 0 1 0 -14 0Z","M5 7v5c0 1.7 3.1 3 7 3s7-1.3 7-3V7","M5 12v5c0 1.7 3.1 3 7 3s7-1.3 7-3v-5"],"tiết_kiệm đầu_tư vốn ngân_sách save savings coin invest budget"),Z("percent","Percent",["M19 5 5 19",Lt(6.5,6.5,2.5),Lt(17.5,17.5,2.5)],"% phần_trăm tỷ_lệ percent rate"),Z("growth","Growth",["M3 17l6-6 4 4 8-8","M15 7h6v6"],"tăng tăng_trưởng doanh_thu lợi_nhuận lãi gấp_đôi gấp growth revenue profit increase scale x2 x3 x10"),Z("decline","Decline",["M3 7l6 6 4-4 8 8","M15 17h6v-6"],"giảm thua_lỗ lỗ sụt tụt drop loss decline fall"),Z("chart","Chart",["M4.5 20V11M10 20V5M15.5 20v-6M2.5 20h19"],"số_liệu báo_cáo thống_kê dữ_liệu kết_quả data report stats result analytics"),Z("target","Target",[Zc,Lt(12,12,4.5),Lt(12,12,.6)],"mục_tiêu chính_xác tập_trung target goal aim focus"),Z("clock","Time",[Zc,"M12 7.5V12l3 2"],"thời_gian phút giờ giây đồng_hồ time minute hour second deadline watch"),Z("calendar","Calendar",["M4 5.5h16v15H4Z","M4 10h16M8 3v4M16 3v4"],"ngày lịch tuần tháng năm lịch_hẹn date day week month year schedule"),Z("user","Person",[Lt(12,8,4),"M4.5 20.5a7.5 7.5 0 0 1 15 0"],"khách khách_hàng customer user person client founder"),Z("users","Team",[Lt(9,8.5,3.5),"M2.5 20a6.5 6.5 0 0 1 13 0","M16 5.2a3.5 3.5 0 0 1 0 6.6","M18 14.3a6.5 6.5 0 0 1 3.5 5.7"],"đội đội_ngũ nhóm cộng_đồng nhân_viên team community people staff"),Z("cart","Cart",["M3 4h2.2l2.3 11h10.8l2.2-8H6.3",Lt(10,19.5,1.5),Lt(17,19.5,1.5)],"mua đặt_hàng đơn_hàng giỏ_hàng mua_sắm buy order cart checkout"),Z("bag","Product",["M5 8h14l-1 13H6Z","M9 8V6.5a3 3 0 0 1 6 0V8"],"sản_phẩm mặt_hàng túi product item bag"),Z("gift","Gift",["M3.5 8.5h17v4h-17Z","M5 12.5v8h14v-8M12 8.5v12","M12 8.5C10.5 4.5 6 4.5 6.5 7c.3 1.5 3.5 1.5 5.5 1.5ZM12 8.5c1.5-4 6-4 5.5-1.5-.3 1.5-3.5 1.5-5.5 1.5Z"],"quà quà_tặng tặng miễn_phí ưu_đãi phần_thưởng free gift bonus"),Z("tag","Sale",["M3 12.5V3.5h9l9 9-9 9Z",Lt(7.5,8,.9)],"giảm_giá khuyến_mãi sale discount deal voucher mã_giảm"),Z("rocket","Launch",["M12 2.5c3.5 2.5 5 6.5 3.5 12h-7C7 9 8.5 5 12 2.5Z","M8.5 14.5 6 17l1 4 3-2.5M15.5 14.5 18 17l-1 4-3-2.5",Lt(12,9,1.6)],"ra_mắt khởi_nghiệp bứt_phá phóng launch startup boost"),Z("bulb","Idea",["M9 18h6M10 21h4","M12 3a6 6 0 0 0-3.8 10.6c.6.5.8 1.3.8 2.4h6c0-1.1.2-1.9.8-2.4A6 6 0 0 0 12 3Z"],"ý_tưởng mẹo bí_kíp sáng_tạo idea tip hack creative insight"),Z("bolt","Fast",["M13 2 4.5 13.5H11L10 22l8.5-11.5H12Z"],"nhanh ngay lập_tức năng_lượng tốc_độ fast instant energy power quick speed"),Z("star","Star",["m12 3 2.8 5.8 6.2.9-4.5 4.4 1.1 6.2L12 17.4l-5.6 2.9 1.1-6.2L3 9.7l6.2-.9Z"],"đánh_giá chất_lượng tốt_nhất xuất_sắc cao_cấp star review rating best quality premium"),Z("heart","Love",["M12 20.5S4 15.9 4 10a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.9-8 10.5-8 10.5Z"],"yêu thích tim sức_khoẻ sức_khỏe chăm_sóc love like health care"),Z("shield","Trust",["M12 2.5 4 5.5v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10v-6Z","m8.5 12 2.5 2.5 4.5-5"],"an_toàn bảo_mật bảo_hành uy_tín chính_hãng secure safe trust guarantee warranty"),Z("lock","Private",["M5 10.5h14v10H5Z","M8 10.5V7a4 4 0 0 1 8 0v3.5"],"riêng_tư mật_khẩu khoá private lock password privacy"),Z("key","Key",[Lt(7.5,15.5,4),"M10.5 12.5 20 3M16.5 6.5 19 9M14 9l2 2"],"chìa_khoá chìa_khóa bí_quyết bí_mật key secret unlock"),Z("check","Done",[Zc,"m8 12.5 2.8 2.8L16.5 9.5"],"hoàn_thành hiệu_quả chính_xác xong đúng đạt done ok correct works"),Z("cross","Wrong",[Zc,"m9 9 6 6M15 9l-6 6"],"sai lỗi đừng không_nên tránh sai_lầm mistake wrong error avoid"),Z("warning","Warning",["M12 3.5 2.5 20h19Z","M12 10v4.5M12 17.5h.01"],"lưu_ý cảnh_báo chú_ý nguy_hiểm rủi_ro warning risk careful"),Z("question","Question",[Zc,"M9.5 9.2a2.6 2.6 0 0 1 5 .8c0 1.8-2.5 2.2-2.5 4","M12 17h.01"],"câu_hỏi tại_sao vì_sao thế_nào làm_sao question why how"),Z("phone","Phone",["M8.5 2.5h7A1.5 1.5 0 0 1 17 4v16a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 7 20V4a1.5 1.5 0 0 1 1.5-1.5Z","M11 18.5h2"],"điện_thoại ứng_dụng app gọi mobile phone call smartphone"),Z("chat","Message",["M4 4.5h16V16H10l-5 4v-4H4Z","M8 10.2h.01M12 10.2h.01M16 10.2h.01"],"tin_nhắn nhắn_tin inbox bình_luận chat message comment dm"),Z("mail","Email",["M3 5.5h18v13H3Z","m3 6.5 9 6.5 9-6.5"],"email thư mail newsletter"),Z("globe","Global",[Zc,"M3 12h18","M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z"],"toàn_cầu quốc_tế thế_giới online website web global world international"),Z("home","Home",["m3 11 9-8 9 8","M5 9.5V21h14V9.5","M10 21v-6h4v6"],"nhà ngôi_nhà gia_đình home house family"),Z("location","Location",["M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z",Lt(12,10,2.5)],"địa_chỉ cửa_hàng chi_nhánh vị_trí bản_đồ location address store map"),Z("truck","Delivery",["M2.5 6h11v10h-11Z","M13.5 9.5h4l3 3.5v3h-7",Lt(6.8,18,1.8),Lt(17.3,18,1.8)],"giao_hàng vận_chuyển ship delivery shipping freeship"),Z("fire","Hot",["M12 21.5c4 0 7-2.8 7-6.8 0-3.6-2.4-5.8-4-8.7-.7 1.8-1.7 2.8-2.9 3C12.2 6.4 11 4.2 9 2.5c.2 3.8-4 6-4 12.2 0 4 3 6.8 7 6.8Z"],"hot bán_chạy xu_hướng viral trend cháy_hàng"),Z("trophy","Winner",["M8 3.5h8v6a4 4 0 0 1-8 0Z","M8 5H4.5v1.5A3.5 3.5 0 0 0 8 10M16 5h3.5v1.5A3.5 3.5 0 0 1 16 10","M12 13.5v4M9 21h6M10 17.5h4V21h-4Z"],"chiến_thắng số_1 top giải_thưởng vô_địch winner trophy award champion"),Z("sparkle","New",["m12 2.5 2.2 6.3L20.5 11l-6.3 2.2L12 19.5l-2.2-6.3L3.5 11l6.3-2.2Z","m19 16 .8 2.2L22 19l-2.2.8L19 22l-.8-2.2L16 19l2.2-.8Z"],"mới đặc_biệt thông_minh phép_màu ai new special magic smart"),Z("chip","Tech",["M7 7h10v10H7Z","M10 10h4v4h-4Z","M9 3v4M15 3v4M9 17v4M15 17v4M3 9h4M3 15h4M17 9h4M17 15h4"],"công_nghệ phần_mềm máy_tính tech technology software computer"),Z("play","Video",[Zc,"m10 8.5 5.5 3.5-5.5 3.5Z"],"video clip kênh youtube tiktok play watch"),Z("camera","Photo",["M3 7.5h4l1.5-2.5h7L17 7.5h4v12H3Z",Lt(12,13.3,3.5)],"ảnh hình_ảnh chụp máy_ảnh photo camera picture"),Z("eye","View",["M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12Z",Lt(12,12,3)],"lượt_xem nhìn view views see"),Z("like","Like",["M7 10.5v10H3.5v-10Z","M7 10.5 11 3c1.7 0 2.8 1.3 2.5 3l-.7 3.5H19a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.8 21H7"],"đồng_ý tuyệt_vời like thumbs good great"),Z("leaf","Natural",["M5 19c0-8 5-14 15-14 0 10-6 15-14 15","M5 19c3-4 6-7 10-9"],"tự_nhiên thiên_nhiên hữu_cơ organic eco natural green"),Z("music","Music",["M9 18V5l11-2v13",Lt(6,18,3),Lt(17,16,3)],"âm_nhạc bài_hát âm_thanh nhạc music song sound audio"),...Gi.map(([t,e,c,o,n,s])=>[t,{name:e,en:c,d:o,hints:n,group:s}])].sort((t,e)=>t[0].localeCompare(e[0])))),Ii=Object.keys(ja),Ui=t=>String(t).normalize("NFC").toLowerCase();Ii.flatMap(t=>ja[t].hints.split(" ").map(e=>[Ui(e).replace(/_/g," "),t])),new Set("và của là có không được cho một những các này đó để trong với khi thì mà như cũng đã sẽ rất hơn nhiều tôi bạn mình anh chị em ở từ ra vào lên xuống nên nếu vì nhưng hay còn đang lại cái con người gì sao thế vậy rồi nè nha ạ à ơi ai đâu nào bị bởi tại theo về qua sau trước the a an and or of to in on is are was were for with that this it as at by be i you we they he she my your our not but so if do does did have has had will can just very more".split(" "));const qo=Object.freeze([["cube","Cube","Hộp 3D xoay","3D cube turn",1,["3d","cube","rotate"]],["inside-cube","InsideCube","Trong lòng hộp","Inside the cube",1,["3d","cube","room"]],["cross-warp","CrossWarp","Kéo giãn chéo","Cross warp",.8,["warp","zoom"]],["cross-zoom","CrossZoom","Zoom nhoè chéo","Cross zoom blur",.8,["zoom","blur","impact"]],["doorway","Doorway","Cửa đôi mở","Doorway",1,["3d","door","open"]],["dreamy","Dreamy","Mộng mơ gợn sóng","Dreamy wave",1,["dream","wave","soft"]],["dreamy-zoom","DreamyZoom","Zoom mộng mơ","Dreamy zoom",1,["dream","zoom","flash"]],["ripple","Ripple","Gợn sóng lan","Spreading ripple",1,["water","wave"]],["water-drop","WaterDrop","Giọt nước","Water drop",1.2,["water","drop","ripple"]],["shockwave","Shockwave","Sóng xung kích kính vỡ","Glass shockwave",1.2,["glass","shatter","impact"]],["kaleidoscope","Kaleidoscope","Kính vạn hoa","Kaleidoscope",1,["kaleidoscope","spin","psychedelic"]],["morph","Morph","Biến hình","Morph",1,["morph","liquid"]],["mosaic","Mosaic","Ghép mảnh xoay","Mosaic pan",1.2,["tiles","pan"]],["hexagonalize","Hexagonalize","Lục giác hoá","Hexagonalize",1,["hexagon","pixel","tech"]],["honeycomb","Honeycomb","Tổ ong","Honeycomb",1.2,["hexagon","tiles","tech"]],["puzzle","Puzzle","Ghép hình rơi","Puzzle pieces",1.4,["puzzle","pieces","fall"]],["shatter","Shatter","Vỡ kính","Shatter",1.2,["glass","break","impact"]],["tile-blast","TileBlast","Ô vuông bung ra","Tile blast",1.2,["tiles","explode","3d"]],["tunnel","Tunnel","Đường hầm","Tunnel",1.2,["tunnel","3d","fly"]],["vortex","Vortex","Lốc xoáy mảnh","Vortex",1.4,["tornado","pieces","wind"]],["warp-speed","WarpSpeed","Tốc độ ánh sáng","Warp speed",1.2,["space","speed","stars"]],["gravity-lens","GravityLens","Thấu kính hấp dẫn","Gravity lens",1.2,["space","black hole","warp"]],["fisheye","Fisheye","Mắt cá phồng","Fisheye bulge",1,["lens","bulge"]],["film-burn","FilmBurn","Cháy phim loé","Film burn flare",1.2,["film","retro","light"]],["film-strip","FilmStrip","Cuộn phim trượt","Film strip slip",1.2,["film","retro","projector"]],["glitch-memories","GlitchMemories","Glitch ký ức","Glitch memories",.8,["glitch","digital"]],["datamosh","StripDatamoshGlitch","Datamosh xé dải","Datamosh strips",1,["glitch","datamosh","digital"]],["vhs-tracking","VhsTracking","Nhiễu băng VHS","VHS tracking",1,["vhs","retro","noise"]],["tv-turn-off","TvTurnOff","Tắt TV cũ","Old TV off",1,["tv","retro"]],["ink-bleed","InkBleed","Mực loang nước","Ink bleed",1.4,["ink","organic","art"]],["watercolor","WatercolorDissolve","Màu nước","Watercolour",1.4,["paint","art","soft"]],["smoke","SmokeDissolve","Khói tràn","Smoke dissolve",1.4,["smoke","organic"]],["paper-tear","PaperTear","Xé giấy đôi","Paper tear",1.2,["paper","tear","collage"]],["crumple","Crumple","Vò giấy","Crumple",1.2,["paper","3d"]],["sphere","Sphere","Cuộn thành cầu","Sphere roll",1.2,["3d","ball"]],["book-flip","BookFlip","Lật trang sách","Book page flip",1.2,["book","page","3d"]],["split-flap","SplitFlap","Bảng lật sân bay","Split-flap board",1.4,["board","flip","retro"]],["disintegrate","Disintegrate","Tan thành bụi","Disintegrate",1.4,["dust","particles"]],["vaporize","Vaporize","Bốc hơi","Vaporize",1.4,["smoke","particles"]],["light-rays","LightRays","Tia sáng toả","Light rays",1.2,["light","glow"]],["prisms","Prisms","Lăng trụ xoay","Prism billboard",1.2,["3d","billboard"]],["reeded-glass","ReededGlass","Kính gân","Reeded glass",1,["glass","refraction"]],["swim","Swim","Hoá cá bơi","Swim away",1.4,["fun","organic"]],["heat-haze","HeatHaze","Hơi nóng","Heat haze",1,["heat","distortion"]]].map(([t,e,c,o,n,s])=>Object.freeze({id:t,file:e,name:c,nameEn:o,duration:n,tags:Object.freeze(s)})));Object.freeze(qo.map(t=>t.id));const Ki=t=>`gl-${t}`;Object.freeze(qo.map((t,e)=>Object.freeze({id:Ki(t.id),version:1,name:t.name,category:"Shader GPU",duration:t.duration,tags:["gpu","shader",...t.tags],sortOrder:5e3+e*10,gl:{id:t.id}}))),Object.freeze([{id:"whip",n:1,vi:"Quất",en:"Whip",pts:[[0,0],[.25,.08],[.4,.35],[.5,1],[.6,.35],[.75,.08],[1,0]],fx:{blurH:.8,rgbShift:.3}},{id:"whip-out",n:2,vi:"Quất ra",en:"Whip out",pts:[[0,0],[.3,.25],[.45,.7],[.5,1],[.56,.3],[.65,0],[1,0]],fx:{blurH:.9,shake:.3}},{id:"whip-in",n:3,vi:"Quất vào",en:"Whip in",pts:[[0,0],[.35,0],[.44,.3],[.5,1],[.55,.7],[.7,.25],[1,0]],fx:{blurH:.9,zoomBlur:.3}},{id:"slow-fast-slow",n:4,vi:"Chậm – nhanh – chậm",en:"Slow – fast – slow",pts:[[0,0],[.15,-.6],[.32,-.6],[.5,1],[.68,-.6],[.85,-.6],[1,0]],fx:{blurH:.7,flash:.35}},{id:"punch",n:5,vi:"Đấm",en:"Punch",pts:[[0,0],[.4,0],[.46,1],[.54,1],[.6,0],[1,0]],fx:{zoomBlur:.8,flash:.6,shake:.5}},{id:"double-hit",n:6,vi:"Hai nhịp",en:"Double hit",pts:[[0,0],[.18,.55],[.3,.05],[.42,.2],[.5,1],[.6,.2],[.75,0],[1,0]],fx:{blurH:.6,rgbShift:.5,shake:.4}},{id:"bounce",n:7,vi:"Nảy",en:"Bounce",pts:[[0,0],[.3,.15],[.5,1],[.62,-1],[.8,-.6],[1,0]],fx:{blurV:.7,zoomBlur:.3}},{id:"linear-burst",n:8,vi:"Bùng thẳng",en:"Linear burst",pts:[[0,0],[.5,1],[1,0]],fx:{blurH:.6,zoomBlur:.4}},{id:"plateau",n:9,vi:"Giữ tốc",en:"Plateau",pts:[[0,0],[.2,.85],[.5,1],[.8,.85],[1,0]],fx:{blurH:.5,rgbShift:.25}},{id:"stutter",n:10,vi:"Bậc thang",en:"Stutter",pts:[[0,0],[.2,0],[.23,.35],[.33,.35],[.36,.7],[.45,.7],[.48,1],[.52,1],[.55,.5],[.66,.5],[.69,0],[1,0]],fx:{rgbShift:.6,shake:.6}},{id:"drift",n:11,vi:"Trôi rồi vọt",en:"Drift & rush",pts:[[0,0],[.2,-.8],[.38,-.8],[.5,1],[.7,.3],[1,0]],fx:{blurH:.7,blurV:.3}},{id:"snap",n:12,vi:"Bật",en:"Snap",pts:[[0,0],[.25,-1],[.44,-1],[.5,1],[.56,0],[1,0]],fx:{zoomBlur:.6,flash:.5,rgbShift:.3}}]).map(t=>t.id);const Go=Object.freeze([.2126,.7152,.0722]),ji=t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16));function Ta(t){const[e,c,o]=Go;return[[e+(1-e)*t,c-c*t,o-o*t],[e-e*t,c+(1-c)*t,o-o*t],[e-e*t,c-c*t,o+(1-o)*t]]}function Vi(t){const e=t*Math.PI/180,c=Math.cos(e),o=Math.sin(e);return[[.213+c*.787-o*.213,.715-c*.715-o*.715,.072-c*.072+o*.928],[.213-c*.213+o*.143,.715+c*.285+o*.14,.072-c*.072-o*.283],[.213-c*.213-o*.787,.715-c*.715+o*.715,.072+c*.928+o*.072]]}const Oo=(t,e,c)=>[[t,0,0],[0,e,0],[0,0,c]],$i=Object.freeze({"wash-red":"#ff2a1f","wash-magenta":"#e81ccf","wash-yellow":"#ffd21a","wash-lime":"#a3ff00"});function Xi(t,e,c=1.2){const o=ji(t);return[0,1,2].map(n=>Go.map((s,x)=>(n===x?1-e:0)+e*c*o[n]/255*s))}const Kc=t=>[t,t,t];Object.freeze({hue:t=>({m:Vi(t*180)}),vivid:t=>({m:Ta(1+.9*t),c:Kc([["s",.15*t]])}),warm:t=>({m:Oo(1+.08*t,1+.01*t,1-.12*t),c:[[["add",10*t]],[["add",2*t]],[["add",-6*t]]]}),cool:t=>({m:Oo(1-.08*t,1+.01*t,1+.1*t),c:[[["add",-6*t]],[["add",t]],[["add",10*t]]]}),"teal-orange":t=>({m:Ta(1+.15*t),c:[[["s",.5*t]],[["s",.12*t]],[["s",-.45*t]]]}),fade:t=>({m:Ta(1-.35*t),c:Kc([["lift",36*t,255-22*t]])}),contrast:t=>({c:Kc([["s",.7*t]])}),bleach:t=>({m:Ta(1-.55*t),c:Kc([["s",.55*t]])}),posterize:t=>({c:Kc([["post",Math.round(11-9*t)]])}),threshold:t=>({m:Ta(0),c:Kc([["add",255*(.5-t)],["post",1]])}),exposure:t=>({c:Kc([["lift",0,255*2**(2*t)]])}),...Object.fromEntries(Object.entries($i).map(([t,e])=>[t,c=>({m:Xi(e,c),c:Kc([["s",.3*c]])})]))});const Fi=Object.freeze(["split","film","circle","rect","star","heart"]);Object.freeze([...Fi,"text"]),[...Object.keys(Do)];const Yi=Object.freeze({sway:{vi:"Đung đưa",en:"Sway",amount:6,period:3.2,unit:"deg",pivot:"bottom"},swing:{vi:"Lắc con lắc",en:"Swing",amount:9,period:2.4,unit:"deg",pivot:"top"},breathe:{vi:"Thở",en:"Breathe",amount:.025,period:3.6,unit:"ratio",pivot:"bottom"},bob:{vi:"Nhấp nhô",en:"Bob",amount:10,period:2,unit:"box",pivot:"center"},wave:{vi:"Vẫy tay",en:"Wave",amount:22,period:1.1,unit:"deg",pivot:"top"},nod:{vi:"Gật đầu",en:"Nod",amount:4,period:2.6,unit:"deg",pivot:"bottom"},blink:{vi:"Chớp mắt",en:"Blink",amount:.92,period:3.8,unit:"ratio",pivot:"center"},rise:{vi:"Bốc lên (hơi, khói)",en:"Rise (steam, smoke)",amount:150,period:2.6,unit:"box",pivot:"center"},wiggle:{vi:"Rung nhẹ",en:"Wiggle",amount:3,period:.5,unit:"box",pivot:"center"},flicker:{vi:"Nhấp nháy",en:"Flicker",amount:.35,period:.25,unit:"ratio",pivot:"center"},spin:{vi:"Quay tròn",en:"Spin",amount:1,period:6,unit:"turns",pivot:"center"},drift:{vi:"Trôi qua lại",en:"Drift",amount:30,period:8,unit:"box",pivot:"center"}});Object.freeze(Object.keys(Yi)),[["red",0],["yellow",60],["green",120],["cyan",180],["blue",240],["magenta",300]].map(t=>t[0]);const _i=Object.freeze([{id:"cinematic",name:"Điện ảnh",en:"Cinematic",p:{contrast:1.4,sat:1.05,split:{shadow:[-.07,.01,.08],highlight:[.07,.03,-.05]},hues:[{h:25,w:30,sat:1.18},{h:0,w:18,sat:1.3,lum:-.03},{h:200,w:40,sat:.8}],black:.015}},{id:"teal-orange",name:"Teal & Orange",en:"Teal & Orange",p:{contrast:1.25,sat:1.2,split:{shadow:[-.12,.03,.12],highlight:[.12,.04,-.1]},hues:[{h:30,w:35,sat:1.3},{h:120,w:45,sat:.6,shift:60}]}},{id:"warm-film",name:"Phim ấm",en:"Warm film",p:{wb:[1.14,1.02,.8],contrast:1.15,sat:.95,split:{shadow:[.04,.01,-.04],highlight:[.06,.03,-.05]},black:.04,white:.97}},{id:"cool-noir",name:"Lạnh trinh thám",en:"Cool noir",p:{wb:[.82,.97,1.18],contrast:1.35,sat:.45,split:{shadow:[-.04,.01,.08],highlight:[-.02,0,.03]},black:.015}},{id:"print-film",name:"Phim chiếu rạp",en:"Print film",p:{contrast:1.3,sat:1,split:{shadow:[-.05,.02,.05],highlight:[.05,.02,-.04]},hues:[{h:120,w:50,sat:.7},{h:25,w:30,sat:1.15}],black:.03,white:.95}},{id:"bleach-bypass",name:"Bleach bypass",en:"Bleach bypass",p:{sat:.3,contrast:1.6,black:.02,white:.98}},{id:"matte-fade",name:"Matte nhạt",en:"Faded matte",p:{contrast:.85,sat:.7,black:.14,white:.9,split:{shadow:[0,.03,.05],highlight:[.02,.02,0]}}},{id:"vintage-70s",name:"Cổ điển 70s",en:"Vintage 70s",p:{wb:[1.12,1.04,.74],sat:.75,contrast:1.08,split:{shadow:[.02,.06,-.02],highlight:[.07,.04,-.06]},black:.1,white:.92}},{id:"golden-hour",name:"Giờ vàng",en:"Golden hour",p:{wb:[1.16,1.02,.78],contrast:1.1,sat:1.15,hues:[{h:35,w:40,sat:1.3}],split:{shadow:[.02,0,-.02],highlight:[.06,.03,-.05]},white:.98}},{id:"moonlight",name:"Ánh trăng",en:"Moonlight",p:{wb:[.72,.9,1.25],sat:.4,contrast:1.2,split:{shadow:[-.04,0,.1]},white:.9}},{id:"vivid",name:"Quảng cáo rực rỡ",en:"Vivid commercial",p:{contrast:1.25,sat:1.6,hues:[{h:25,w:25,sat:.9}],black:0,white:1}},{id:"pastel",name:"Pastel mềm",en:"Soft pastel",p:{contrast:.78,sat:.7,black:.12,white:1,split:{shadow:[.06,.02,.06],highlight:[.05,.02,.04]}}},{id:"neon",name:"Neon đêm",en:"Neon night",p:{contrast:1.3,sat:1.5,split:{shadow:[-.04,.02,.14],highlight:[.14,-.04,.1]},hues:[{h:300,w:40,sat:1.4},{h:190,w:40,sat:1.4}]}},{id:"desert",name:"Sa mạc",en:"Desert",p:{wb:[1.14,1,.76],contrast:1.25,sat:.95,hues:[{h:35,w:45,sat:1.3},{h:210,w:40,sat:.5}],black:.03}},{id:"forest",name:"Rừng xanh",en:"Forest green",p:{wb:[.92,1.08,.94],contrast:1.15,sat:1,hues:[{h:110,w:45,sat:1.35,shift:-18},{h:25,w:30,sat:1.05}],split:{shadow:[-.03,.06,.03]}}},{id:"bw-classic",name:"Đen trắng cổ điển",en:"Classic B&W",p:{sat:0,contrast:1.15,black:.02,white:.98}},{id:"bw-contrast",name:"Đen trắng tương phản",en:"High-contrast B&W",p:{sat:0,contrast:1.8}},{id:"sepia",name:"Nâu sepia",en:"Sepia",p:{sat:0,contrast:1.08,tint:[1.15,.97,.72],black:.05,white:.94}}]);new Map(_i.map(t=>[t.id,t]));const jc=t=>String(Math.round(t*10)/10),nt=(t,e)=>`${jc(t)} ${jc(e)}`,ge=t=>t*Math.PI/180,S=(t,e,c)=>`M${nt(t-c,e)}A${jc(c)} ${jc(c)} 0 1 0 ${nt(t+c,e)}A${jc(c)} ${jc(c)} 0 1 0 ${nt(t-c,e)}Z`,At=(t,e,c,o,n)=>{n=Math.min(n,c/2,o/2);const s=`A${jc(n)} ${jc(n)} 0 0 1 `;return`M${nt(t+n,e)}L${nt(t+c-n,e)}${s}${nt(t+c,e+n)}L${nt(t+c,e+o-n)}${s}${nt(t+c-n,e+o)}L${nt(t+n,e+o)}${s}${nt(t,e+o-n)}L${nt(t,e+n)}${s}${nt(t+n,e)}Z`},vt=(...t)=>"M"+t.map(([e,c])=>nt(e,c)).join("L")+"Z",st=(...t)=>"M"+t.map(([e,c])=>nt(e,c)).join("L"),so=(t,e,c,o,n=-90)=>vt(...Array.from({length:o},(s,x)=>[t+c*Math.cos(ge(n+x*360/o)),e+c*Math.sin(ge(n+x*360/o))])),Re=(t,e,c,o,n,s=-90)=>vt(...Array.from({length:n*2},(x,d)=>{const g=ge(s+d*180/n),C=d%2?o:c;return[t+C*Math.cos(g),e+C*Math.sin(g)]})),nc=(t,e,c,o=.16)=>{const n=c*o;return`M${nt(t,e-c)}Q${nt(t+n,e-n)} ${nt(t+c,e)}Q${nt(t+n,e+n)} ${nt(t,e+c)}Q${nt(t-n,e+n)} ${nt(t-c,e)}Q${nt(t-n,e-n)} ${nt(t,e-c)}Z`},No=(t,e,c,o=190,n=34)=>{const s=ge(c+180-n),x=ge(c+180+n);return`M${nt(t+o*Math.cos(s),e+o*Math.sin(s))}L${nt(t,e)}L${nt(t+o*Math.cos(x),e+o*Math.sin(x))}`},Pe=(t,e,c,o,n)=>vt(...[[-c/2,-o/2],[c/2,-o/2],[c/2,o/2],[-c/2,o/2]].map(([s,x])=>[t+s*Math.cos(ge(n))-x*Math.sin(ge(n)),e+s*Math.sin(ge(n))+x*Math.cos(ge(n))])),ia=(t,e,c,o)=>so(t,e,c,3,o),io=(t,e,c,o)=>t.replace(/(-?\d*\.?\d+)[ ,]+(-?\d*\.?\d+)/g,(n,s,x)=>nt(+s*e+c,+x*e+o)),Io="M500 880C140 600 100 330 280 220C400 150 480 220 500 300C520 220 600 150 720 220C900 330 860 600 500 880Z",Vc=(t,e,c)=>io(Io,c,t-500*c,e-540*c),Uo="M500 90C640 90 740 190 740 340L740 500C740 600 800 650 860 700L140 700C200 650 260 600 260 500L260 340C260 190 360 90 500 90Z",Ko="M400 780C420 860 580 860 600 780Z",Qi=(t,e,c,o,n,s)=>{const x=[],d=(g,C,P,h)=>{const w=Math.hypot(P-g,h-C),r=(P-g)/w,f=(h-C)/w;for(let R=0;R<w-1;R+=n+s){const X=Math.min(w,R+n);x.push(`M${nt(g+r*R,C+f*R)}L${nt(g+r*X,C+f*X)}`)}};return d(t,e,c,e),d(c,e,c,o),d(c,o,t,o),d(t,o,t,e),x.join("")},W=(t,e,c={})=>({d:t,f:e,...c}),H=(t,e,c,o={})=>({d:t,s:e,w:c,...o}),B=(t,e,c,o,n={})=>({d:t,f:e,s:c,w:o,...n}),T=(t,e,c,o,n,s,x,d)=>({id:t,cat:e,name:c,kw:o,primary:n,secondary:s,p:x,...d?{anim:d}:{}}),xt=(t,e=30,c={})=>H(t,"a",e,{h:"marker",...c}),Zi={in:"draw",out:"fade",loop:"none"},Zt=(t,e,c,o)=>T(t,"doodle",e,`${c} vẽ tay hand drawn doodle`,"#e2382f","#1c1c22",o,Zi),D="#1c1c22",Ji=(t,e,c,o,n,s)=>Array.from({length:c},(x,d)=>{const g=d*360/c,C=d%2?n:o;return`M${nt(t,e)}L${nt(t+C*Math.cos(ge(g-s)),e+C*Math.sin(ge(g-s)))}L${nt(t+C*Math.cos(ge(g+s)),e+C*Math.sin(ge(g+s)))}Z`}).join(""),$c=()=>B(S(500,500,430),"a","b",30),jo="M290 600C380 780 620 780 710 600",la=(t,e,c,o=64)=>[H(t,"b",o+46),H(No(...e,c),"b",o+46),H(t,"a",o),H(No(...e,c),"a",o)],Vo=[S(300,420,190),S(500,330,210),S(720,420,200),S(540,520,200),S(340,530,150)].join(""),lo="M500 120C260 120 90 260 90 430C90 560 170 660 290 710C290 790 250 850 180 900C300 890 410 840 470 760C480 760 490 760 500 760C740 760 910 620 910 430C910 260 740 120 500 120Z",ro="M180 140L820 140Q900 140 900 220L900 560Q900 640 820 640L440 640L260 840L280 640L180 640Q100 640 100 560L100 220Q100 140 180 140Z",ra=t=>({a:[Pe(180,200,90,40,30),ia(700,140,60,10),S(870,420,28),Pe(300,760,80,34,-40)].join(""),b:[Pe(520,180,70,34,-20),S(120,520,30),ia(820,760,56,70),Pe(640,880,84,32,18)].join(""),y:[S(380,320,30),Pe(900,160,80,34,50),ia(150,780,58,-20),Pe(560,620,74,30,-60)].join(""),r:[ia(400,600,62,30),Pe(780,300,80,34,-30),S(240,420,26),Pe(470,880,70,30,40)].join(""),g:[Pe(260,100,80,34,-10),S(640,400,30),ia(920,620,56,-40),Pe(120,640,70,30,60)].join(""),u:[ia(560,100,56,-70),Pe(720,560,80,32,20),S(380,860,28),Pe(880,900,60,28,-20)].join("")})[t],$o=[T("arrow-bold","arrow","Mũi tên dày","arrow right chỉ hướng bold","#ffd23f",D,[B(vt([100,380],[560,380],[560,190],[920,500],[560,810],[560,620],[100,620]),"a","b",36)]),T("arrow-curve","arrow","Mũi tên cong","arrow curve chỉ vào","#ff4b55","#ffffff",la("M150 830C130 480 360 280 800 300",[800,300],3)),T("arrow-down","arrow","Mũi tên xuống","arrow down bấm vào dưới","#ffd23f",D,[B(vt([380,100],[620,100],[620,480],[820,480],[500,900],[180,480],[380,480]),"a","b",36)]),T("arrow-chevrons","arrow","Chevron xuống","chevron down swipe vuốt","#ffffff",D,[H(st([200,60],[500,300],[800,60]),"a",90),H(st([200,360],[500,600],[800,360]),"a",90,{o:.65}),H(st([200,660],[500,900],[800,660]),"a",90,{o:.35})]),T("arrow-diagonal","arrow","Mũi tên chéo","arrow diagonal up tăng trưởng","#31c76a","#ffffff",la(st([160,840],[840,160]),[840,160],-45)),T("arrow-loop","arrow","Mũi tên vòng","arrow loop hand drawn vẽ tay","#ffd23f",D,la("M120 840C280 880 440 780 440 620C440 480 310 440 280 540C250 640 380 720 520 620C660 520 720 400 830 250",[830,250],-54,56)),T("arrow-zigzag","arrow","Mũi tên zigzag","arrow zigzag răng cưa","#3aa8ff","#ffffff",la(st([110,820],[270,420],[430,740],[600,340],[860,260]),[860,260],-17,56)),T("arrow-uturn","arrow","Mũi tên quay đầu","arrow u turn quay lại","#ff4b55","#ffffff",la("M220 880L220 440C220 270 340 190 500 190C660 190 780 270 780 440L780 700",[780,700],90)),Zt("doodle-circle","Vòng khoanh vẽ tay","khoanh tròn circle highlight",[xt("M330 230C480 140 760 170 850 380C930 570 790 800 540 840C300 880 120 720 140 480C155 320 300 210 470 190C560 180 640 200 700 230")]),Zt("doodle-oval","Khoanh dẹt vẽ tay","khoanh oval ellipse chữ",[xt("M250 340C420 270 760 290 880 420C980 530 830 680 520 700C250 715 70 620 110 480C140 380 300 330 480 320C590 315 680 330 760 360")]),Zt("doodle-underline","Gạch chân vẽ tay","gạch chân underline nhấn",[xt("M90 560C260 530 470 545 650 535C760 528 850 520 920 530",34)]),Zt("doodle-double-underline","Gạch chân đôi vẽ tay","gạch chân đôi double underline",[xt("M90 520C300 495 620 500 910 515",30),xt("M150 600C360 580 640 585 860 598",26)]),Zt("doodle-wavy","Gạch sóng vẽ tay","gạch sóng wavy squiggle",[xt("M80 520C140 460 200 460 250 520C300 580 360 580 410 520C460 460 520 460 570 520C620 580 680 580 730 520C780 460 840 460 920 520",30)]),Zt("doodle-arrow","Mũi tên vẽ tay","mũi tên chỉ arrow pointer",[xt("M150 820C180 600 360 380 760 260",30),xt("M600 230L770 255L690 410",30)]),Zt("doodle-loop-arrow","Mũi tên xoắn vẽ tay","mũi tên xoắn loop arrow",[xt("M120 820C300 860 470 760 450 600C430 470 300 470 300 560C300 660 470 690 600 560C700 460 740 360 820 250",28),xt("M700 250L825 245L800 370",28)]),Zt("doodle-cross","Gạch chéo vẽ tay","gạch bỏ cross out sai",[xt("M170 230C380 420 600 610 850 790",34),xt("M820 210C620 400 400 610 180 800",34)]),Zt("doodle-check","Dấu tích vẽ tay","dấu tích check đúng",[xt("M170 520C260 600 340 680 410 780C520 560 660 360 860 190",38)]),Zt("doodle-star","Ngôi sao vẽ tay","ngôi sao star nổi bật",[xt("M500 130L590 400L870 410L640 570L730 850L500 680L270 850L360 570L130 410L410 400L505 140",26)]),Zt("doodle-sparks","Tia nhấn vẽ tay","tia nhấn emphasis spark",[xt("M500 360L500 140",30),xt("M330 420L190 270",30),xt("M670 420L810 270",30)]),Zt("doodle-hatch","Gạch bóng vẽ tay","gạch bóng hatching shading",[xt("M160 700L330 300",20),xt("M260 740L450 300",20),xt("M370 770L570 310",20),xt("M480 790L690 320",20),xt("M600 800L800 340",20)]),Zt("doodle-dots","Chấm nguệch ngoạc","chấm scribble dots",[xt("M210 520C170 470 230 420 270 460C310 500 250 560 215 525",26),xt("M480 500C440 450 500 400 540 440C580 480 520 540 485 505",26),xt("M750 520C710 470 770 420 810 460C850 500 790 560 755 525",26)]),Zt("doodle-bracket","Ngoặc vẽ tay","ngoặc bracket nhóm",[xt("M330 140C220 150 210 260 220 380C230 460 200 500 150 505C200 512 230 550 220 630C210 760 230 860 340 870",28),xt("M670 140C780 150 790 260 780 380C770 460 800 500 850 505C800 512 770 550 780 630C790 760 770 860 660 870",28)]),Zt("doodle-box","Khung vẽ tay","khung box hộp",[xt("M140 210C380 190 640 195 880 215C870 420 870 620 885 800C640 815 380 812 120 795C130 600 128 400 150 190",28)]),Zt("doodle-heart","Tim vẽ tay","tim heart thích",[xt("M500 840C200 620 120 400 260 260C380 150 480 230 500 330C520 230 620 150 740 260C880 400 800 620 500 840",28)]),T("arrow-refresh","arrow","Mũi tên làm mới","refresh reload lặp lại","#31c76a","#ffffff",la("M712 247A330 330 0 1 1 288 247",[288,247],-40)),T("badge-star","badge","Huy hiệu sao","badge star ngôi sao best","#ffd23f",D,[B(S(500,500,420),"a","b",34),H(S(500,500,350),"b",14,{o:.5}),W(Re(500,500,250,105,5),"w")]),T("badge-burst","badge","Nổ sao","burst starburst sale nổ","#ff4b55",D,[B(Re(500,500,470,390,18),"a","b",30),H(S(500,500,300),"w",16,{o:.8})]),T("badge-ribbon","badge","Ruy băng","ribbon banner dải băng","#ff4b55","#a31f2b",[W(vt([40,380],[220,380],[220,620],[40,620],[120,500]),"b"),W(vt([960,380],[780,380],[780,620],[960,620],[880,500]),"b"),B(vt([160,300],[840,300],[840,700],[160,700]),"a","k",30),H(st([260,440],[740,440]),"w",34,{o:.9}),H(st([320,560],[680,560]),"w",34,{o:.9})]),T("badge-pill","badge","Nhãn viên thuốc","label pill nhãn tag","#3aa8ff",D,[B(At(80,340,840,320,160),"a","b",32),W(S(250,500,70),"w"),H(st([390,500],[760,500]),"w",50)]),T("badge-shield","badge","Khiên bảo vệ","shield bảo hành guarantee","#3aa8ff",D,[B("M500 90L860 210L860 520C860 720 700 860 500 930C300 860 140 720 140 520L140 210Z","a","b",34),H(st([320,500],[450,630],[690,380]),"w",70)]),T("badge-medal","badge","Huy chương","medal huy chương giải thưởng","#ffd23f",D,[B(vt([260,60],[430,60],[620,520],[450,520]),"b","k",14),B(vt([740,60],[570,60],[380,520],[550,520]),"r","k",14),B(S(500,670,260),"a","b",34),W(Re(500,670,150,65,5),"w")]),T("badge-hexagon","badge","Lục giác","hexagon badge huy hiệu","#a56bff",D,[B(so(500,500,440,6),"a","b",34),H(so(500,500,340,6),"w",16,{o:.8}),W(Re(500,500,150,64,5),"w")]),T("badge-tag","badge","Nhãn mũi tên","label tag nhãn mới new","#31c76a",D,[B(vt([100,300],[760,300],[900,500],[760,700],[100,700]),"a","b",34),W(S(250,500,60),"w"),H(st([380,500],[700,500]),"w",50)]),T("icon-check","icon","Tích tròn","check đúng ok done","#31c76a",D,[B(S(500,500,420),"a","b",34),H(st([270,520],[440,690],[740,330]),"w",100)]),T("icon-cross","icon","X tròn","cross sai wrong close","#ff4b55",D,[B(S(500,500,420),"a","b",34),H("M330 330L670 670M670 330L330 670","w",100)]),T("icon-bulb","icon","Bóng đèn","lightbulb ý tưởng idea tip","#ffd23f",D,[B("M500 100C320 100 220 230 220 380C220 500 300 560 340 640L340 700L660 700L660 640C700 560 780 500 780 380C780 230 680 100 500 100Z","a","b",34),H("M360 790L640 790M410 870L590 870","b",54),H("M420 560L420 420L500 500L580 420L580 560","w",34,{o:.8})]),T("icon-pin","icon","Ghim vị trí","pin location địa điểm map","#ff4b55",D,[B("M500 90C300 90 200 240 200 400C200 600 420 800 500 920C580 800 800 600 800 400C800 240 700 90 500 90Z","a","b",34),W(S(500,400,115),"w")]),T("icon-clock","icon","Đồng hồ giờ","clock time giờ thời gian","#3aa8ff",D,[B(S(500,500,420),"w","b",40),H("M500 500L500 250M500 500L690 590","a",58),W(S(500,500,40),"b"),H("M500 120L500 160M500 840L500 880M120 500L160 500M840 500L880 500","b",30)]),T("icon-bolt","icon","Tia chớp","bolt lightning nhanh flash","#ffd23f",D,[B(vt([590,60],[220,560],[470,560],[400,940],[790,400],[530,400]),"a","b",36)]),T("icon-flame","icon","Ngọn lửa","fire flame hot lửa","#ff7a1a",D,[B("M500 60C560 220 760 320 760 580C760 780 650 920 500 920C350 920 240 780 240 600C240 480 300 400 360 340C370 420 420 460 450 440C400 320 430 180 500 60Z","a","b",34),W("M500 520C560 600 620 660 620 740C620 820 570 880 500 880C430 880 380 820 380 740C380 660 450 600 500 520Z","y")]),T("icon-crown","icon","Vương miện","crown vip king","#ffd23f",D,[B(vt([120,760],[80,300],[330,520],[500,200],[670,520],[920,300],[880,760]),"a","b",34),W(S(80,290,50)+S(500,190,50)+S(920,290,50),"a"),H(st([200,660],[800,660]),"b",30,{o:.6})]),T("icon-search","icon","Kính lúp","magnifier search tìm kiếm zoom","#3aa8ff",D,[H(st([620,620],[880,880]),"b",150),H(st([620,620],[880,880]),"a",100),B(S(420,420,270),"w","b",70)]),T("icon-gift","icon","Hộp quà","gift quà tặng present","#ff4b55",D,[B(At(150,430,700,470,30),"a","b",30),B(At(100,310,800,150,30),"a","b",30),W(At(440,310,120,590,10),"w"),B("M500 310C380 130 210 190 300 310Z","w","b",24),B("M500 310C620 130 790 190 700 310Z","w","b",24)]),T("icon-trophy","icon","Cúp","trophy winner cúp vô địch","#ffd23f",D,[H("M290 190C110 190 110 420 310 440M710 190C890 190 890 420 690 440","b",50),B("M280 100L720 100L700 400C690 540 600 600 500 600C400 600 310 540 300 400Z","a","b",34),B("M440 600L560 600L580 780L420 780Z","a","b",30),B(At(300,780,400,110,30),"a","b",30)]),T("icon-exclaim","icon","Dấu chấm than","exclamation chú ý attention","#ff4b55",D,[B(At(370,90,260,540,130),"a","b",34),B(S(500,790,100),"a","b",34)]),T("icon-question","icon","Dấu hỏi","question hỏi thắc mắc","#3aa8ff",D,[H("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","b",170),H("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","a",110),B(S(510,840,80),"a","b",30)]),T("icon-target","icon","Mục tiêu","target bullseye đích","#ff4b55",D,[B(S(500,500,430),"w","b",34),W(S(500,500,320),"a"),W(S(500,500,210),"w"),W(S(500,500,100),"a"),H(S(500,500,100),"b",20)]),T("face-smile","emotion","Cười tươi","smile happy vui emoji","#ffcf3a","#3a2a10",[$c(),W(S(360,410,52)+S(640,410,52),"b"),H(jo,"b",56)]),T("face-laugh","emotion","Cười lớn","laugh haha cười","#ffcf3a","#3a2a10",[$c(),H("M270 450Q360 340 450 450M550 450Q640 340 730 450","b",52),W("M250 590L750 590C750 780 640 850 500 850C360 850 250 780 250 590Z","b"),W("M380 790C430 720 570 720 620 790C590 830 410 830 380 790Z","r")]),T("face-wink","emotion","Nháy mắt","wink nháy tinh nghịch","#ffcf3a","#3a2a10",[$c(),W(S(360,410,52),"b"),H("M560 440Q640 360 720 440","b",52),H(jo,"b",56),W(S(250,570,38)+S(750,570,38),"r",{o:.35})]),T("face-sad","emotion","Buồn","sad cry khóc buồn","#ffcf3a","#3a2a10",[$c(),W(S(360,440,50)+S(640,440,50),"b"),H("M270 360L430 320M730 360L570 320","b",40),H("M310 740C400 620 600 620 690 740","b",56),W("M290 540C250 620 240 670 290 690C340 670 330 620 290 540Z","u")]),T("face-angry","emotion","Giận dữ","angry mad giận","#ff6b4d","#3a1208",[$c(),H("M250 330L450 430M750 330L550 430","b",62),W(S(380,510,42)+S(620,510,42),"b"),H("M320 750Q500 600 680 750","b",56)]),T("face-surprised","emotion","Ngạc nhiên","surprised wow ngạc nhiên","#ffcf3a","#3a2a10",[$c(),B(S(360,410,82)+S(640,410,82),"w","b",26),W(S(360,410,34)+S(640,410,34),"b"),H("M260 260Q360 200 450 260M550 260Q640 200 740 260","b",40),W("M425 700A75 100 0 1 0 575 700A75 100 0 1 0 425 700Z","b")]),T("face-cool","emotion","Ngầu","cool sunglasses kính râm ngầu","#ffcf3a","#3a2a10",[$c(),W(At(150,340,320,190,80)+At(530,340,320,190,80),"b"),H(st([470,400],[530,400]),"b",40),H(st([220,410],[320,410]),"w",26,{o:.5}),H("M310 650C400 770 600 770 690 650","b",52)]),T("face-love","emotion","Mắt trái tim","love heart eyes yêu thích","#ffcf3a","#3a2a10",[$c(),W(Vc(360,420,.23)+Vc(640,420,.23),"r"),H("M290 630C380 800 620 800 710 630","b",52)]),T("bubble-round","bubble","Bóng thoại tròn","speech bubble hội thoại nói","#ffffff",D,[B(lo,"a","b",34)]),T("bubble-rect","bubble","Bóng thoại vuông","speech box bubble chat","#ffffff",D,[B(ro,"a","b",34)]),T("bubble-cloud","bubble","Bóng suy nghĩ","thought cloud nghĩ mây","#ffffff",D,[H(Vo,"b",70),W(Vo,"a"),B(S(250,810,66),"a","b",30),B(S(130,915,40),"a","b",26)]),T("bubble-shout","bubble","Bóng hét","shout burst hét la","#ffd23f",D,[B(vt(...Array.from({length:28},(t,e)=>{const c=ge(-90+e*360/28),o=e%2?290:470;return[500+o*Math.cos(c),480+o*Math.sin(c)]})),"a","b",30)]),T("bubble-typing","bubble","Đang nhập","typing dots ba chấm","#ffffff",D,[B(vt([200,620],[170,800],[350,660]),"a","b",30),B(At(100,260,800,400,200),"a","b",34),W(S(340,460,48)+S(500,460,48)+S(660,460,48),"b")]),T("bubble-chat","bubble","Bình luận màu","comment chat message tin nhắn","#3aa8ff",D,[B(ro,"a","b",34),H(st([240,300],[760,300]),"w",48),H(st([240,430],[600,430]),"w",48,{o:.8})]),T("bubble-exclaim","bubble","Bóng chú ý","notice attention lưu ý","#ff4b55",D,[B(lo,"a","b",34),H(st([500,270],[500,470]),"w",92),W(S(500,600,52),"w")]),T("bubble-heart","bubble","Bóng yêu thích","love bubble tim","#ffffff",D,[B(lo,"a","b",34),W(Vc(500,430,.42),"r")]),T("social-like","social","Thích","like thumbs up ngón cái thích","#3aa8ff",D,[B(vt([90,440],[290,440],[290,900],[90,900]),"b","k",30),B("M340 460L520 100C600 100 640 160 620 260L600 380L840 380C920 380 960 450 930 520L860 800C840 870 800 900 740 900L340 900Z","a","b",34)]),T("social-heart","social","Tim","heart love yêu thích tim","#ff4b55",D,[B(Io,"a","b",34),H("M250 330C250 280 290 250 340 250","w",36,{o:.7})]),T("social-comment","social","Bình luận","comment bình luận chat","#3aa8ff",D,[B(ro,"a","b",34),W(S(330,390,52)+S(500,390,52)+S(670,390,52),"w")]),T("social-share","social","Chia sẻ","share chia sẻ forward","#31c76a",D,[B("M520 150L920 450L520 750L520 590C300 590 160 680 100 860C130 560 300 380 520 350Z","a","b",34)]),T("social-bell","social","Chuông","bell notification thông báo","#ffd23f",D,[B(Uo,"a","b",34),B(Ko,"a","b",30)]),T("social-subscribe","social","Nút đăng ký","subscribe follow đăng ký theo dõi","#ff4b55",D,[B(At(60,330,880,340,170),"a","b",34),W(io(Uo,.38,230-500*.38,500-470*.38),"w"),W(io(Ko,.38,230-500*.38,500-470*.38),"w"),H(st([420,450],[820,450]),"w",50),H(st([420,560],[700,560]),"w",50,{o:.65})]),T("social-save","social","Lưu","save bookmark lưu","#ffd23f",D,[B("M240 100L760 100L760 900L500 720L240 900Z","a","b",34)]),T("social-play","social","Nút phát","play video phát","#ff4b55",D,[B(S(500,500,430),"a","b",34),W(vt([410,310],[410,690],[740,500]),"w")]),T("social-follow","social","Theo dõi","follow add friend kết bạn","#3aa8ff",D,[B(S(390,300,170),"a","b",30),B("M80 900C80 660 230 570 390 570C550 570 700 660 700 900Z","a","b",30),H("M830 300L830 560M700 430L960 430","b",100),H("M830 300L830 560M700 430L960 430","w",58)]),T("social-views","social","Lượt xem","views eye mắt xem","#3aa8ff",D,[B("M50 500C220 250 780 250 950 500C780 750 220 750 50 500Z","w","b",34),B(S(500,500,170),"a","b",24),W(S(500,500,70),"b"),W(S(540,460,26),"w")]),T("price-tag","price","Thẻ giá","price tag giá nhãn","#ffd23f",D,[B("M110 110L520 110L910 500L500 910L110 520Z","a","b",34),B(S(270,270,62),"w","b",26)]),T("price-percent","price","Huy hiệu %","percent discount giảm giá","#ff4b55",D,[B(S(500,500,430),"a","b",34),H(S(340,340,78),"w",44),H(S(660,660,78),"w",44),H(st([720,280],[280,720]),"w",56)]),T("price-sale","price","Nổ sale %","sale burst khuyến mãi","#ff4b55",D,[B(Re(500,500,480,400,20),"a","b",30),H(S(380,380,60),"w",38),H(S(620,620,60),"w",38),H(st([670,320],[330,680]),"w",50)]),T("price-coin","price","Đồng xu","coin dollar tiền xu","#ffd23f",D,[B(S(500,500,430),"a","b",34),H(S(500,500,340),"b",16,{o:.5}),H("M630 360C610 290 400 280 390 385C380 490 620 510 610 625C600 730 390 730 370 635","w",64),H(st([500,230],[500,770]),"w",42)]),T("price-cart","price","Giỏ hàng","cart shop mua hàng","#31c76a",D,[H("M70 140L220 140L330 620L820 620","b",70),B(vt([270,260],[930,260],[830,580],[360,580]),"a","b",34),B(S(420,790,70),"w","b",30),B(S(740,790,70),"w","b",30)]),T("price-coupon","price","Phiếu giảm giá","coupon voucher mã giảm","#a56bff",D,[B("M70 250L930 250L930 410A100 100 0 0 0 930 590L930 750L70 750L70 590A100 100 0 0 0 70 410Z","a","b",34),H("M650 310L650 360M650 420L650 470M650 530L650 580M650 640L650 690","w",28),H(st([180,420],[520,420]),"w",50),H(st([180,540],[440,540]),"w",50,{o:.7})]),T("price-truck","price","Giao hàng","truck delivery freeship vận chuyển","#3aa8ff",D,[B(vt([60,260],[600,260],[600,720],[60,720]),"a","b",34),B(vt([600,380],[780,380],[930,540],[930,720],[600,720]),"a","b",34),W(vt([670,440],[760,440],[850,540],[670,540]),"w"),B(S(250,740,95),"w","b",34),B(S(750,740,95),"w","b",34)]),T("price-star","price","Sao giá","star price best seller bán chạy","#ffd23f",D,[B(Re(500,510,480,215,5),"a","b",34),H(Re(500,510,330,150,5),"w",16,{o:.6})]),T("frame-corners","frame","Khung ngắm","viewfinder corners góc","#ffffff",D,[H("M120 340L120 120L340 120M660 120L880 120L880 340M880 660L880 880L660 880M340 880L120 880L120 660","a",70)]),T("frame-polaroid","frame","Khung polaroid","polaroid photo ảnh","#ffffff",D,[B("M110 90L890 90L890 910L110 910ZM190 170L810 170L810 700L190 700Z","a","b",30,{eo:!0})]),T("frame-border","frame","Viền bo góc","border rounded viền","#ffd23f",D,[W(At(60,60,880,880,120)+At(150,150,700,700,60),"a",{eo:!0}),H(At(150,150,700,700,60),"b",14)]),T("frame-film","frame","Khung phim","film cinema phim","#ffd23f",D,[W(`M60 160L940 160L940 840L60 840ZM160 300L840 300L840 700L160 700Z${Array.from({length:8},(t,e)=>At(100+e*105,200,55,60,10)+At(100+e*105,740,55,60,10)).join("")}`,"b",{eo:!0}),H("M60 160L940 160L940 840L60 840Z","a",16)]),T("frame-ticket","frame","Khung vé","ticket vé coupon","#ff4b55",D,[B("M70 160L930 160L930 400A100 100 0 0 0 930 600L930 840L70 840L70 600A100 100 0 0 0 70 400ZM170 260L830 260L830 740L170 740Z","a","b",30,{eo:!0})]),T("frame-circle","frame","Khung tròn","circle ring vòng tròn","#ffffff",D,[B(S(500,500,440)+S(500,500,340),"a","b",20,{eo:!0})]),T("frame-tv","frame","Khung TV","tv television màn hình","#3aa8ff",D,[H(st([330,60],[500,210],[670,60]),"b",44),B(At(70,220,860,680,130)+At(160,310,680,500,70),"a","b",30,{eo:!0})]),T("frame-dashed","frame","Khung nét đứt","dashed viền đứt","#ffffff",D,[H(Qi(100,100,900,900,70,50),"a",36)]),T("fx-sparkle","sparkle","Lấp lánh","sparkle twinkle lấp lánh","#fff3a8","#ffffff",[W(S(500,500,260),"a",{o:.4,bl:70}),W(nc(500,500,470,.1),"a"),W(nc(500,500,200,.14),"b")]),T("fx-sparkles","sparkle","Cụm lấp lánh","sparkles cluster nhiều sao","#ffe066","#ffffff",[W(S(400,560,300),"a",{o:.25,bl:80}),W(nc(400,560,340,.12),"a"),W(nc(750,260,190,.14),"a"),W(nc(770,800,120,.16),"b"),W(nc(400,560,120,.16),"b")]),T("fx-shine","sparkle","Tia lấp loáng","shine flare tia sáng","#ffe066","#ffffff",[W(S(500,500,230),"a",{o:.35,bl:70}),W(Re(500,500,470,60,8,-90),"a"),W(Re(500,500,330,50,8,-67.5),"b",{o:.9}),W(S(500,500,90),"b")]),T("fx-light-leak","sparkle","Rò sáng","light leak ánh sáng loá","#ffb347","#ff5da2",[W(S(330,340,260),"a",{o:.6,bl:100}),W(S(680,640,240),"b",{o:.55,bl:100}),W(S(520,520,150),"w",{o:.45,bl:80})]),T("fx-rays","sparkle","Tia nắng","rays sunburst chói","#ffe066","#ffffff",[W(Ji(500,500,16,480,360,6),"a",{o:.9}),W(S(500,500,130),"a",{o:.5,bl:40}),W(S(500,500,80),"b")]),T("fx-confetti","sparkle","Pháo giấy","confetti party mừng","#ff4b55","#3aa8ff",[W(ra("a"),"a"),W(ra("b"),"b"),W(ra("y"),"y"),W(ra("r"),"r"),W(ra("g"),"g"),W(ra("u"),"u")]),T("fx-glow-ring","sparkle","Vòng sáng","glow ring halo","#7cf0ff","#ffffff",[H(S(500,500,330),"a",90,{o:.55,bl:40}),H(S(500,500,330),"b",20)]),T("fx-lens-flare","sparkle","Chói ống kính","lens flare anamorphic","#ffd08a","#ffffff",[H(st([40,300],[620,300]),"b",16,{o:.7,bl:6}),W(S(300,300,150),"b",{o:.85,bl:50}),W(S(300,300,70),"b"),W(S(540,540,60),"a",{o:.6,bl:8}),W(S(680,680,110),"a",{o:.4,bl:12}),W(S(820,820,40),"a",{o:.8,bl:4})]),T("fx-twinkle","sparkle","Sao nhấp nháy","twinkle stars sao nhỏ","#ffe066","#ffffff",[W(nc(250,300,150,.16)+nc(560,620,120,.16),"a"),W(nc(700,220,200,.14)+nc(300,800,100,.18),"b"),W(nc(820,760,170,.14),"a")]),T("fx-heart-burst","sparkle","Tim bay","hearts float like tim bay","#ff4b55","#ff9cc2",[W(Vc(500,600,.55),"a"),W(Vc(250,370,.28),"b",{o:.9}),W(Vc(760,300,.36),"a",{o:.8}),W(Vc(830,660,.2),"w"),W(Vc(170,720,.2),"a",{o:.7})]),T("status-stars","status","5 sao","rating stars đánh giá 5 sao","#ffd23f",D,[B(Array.from({length:5},(t,e)=>Re(140+e*180,500,92,40,5)).join(""),"a","b",12)]),T("status-stars-4","status","4 sao","rating four stars 4 sao","#ffd23f",D,[B(Array.from({length:4},(t,e)=>Re(140+e*180,500,92,40,5)).join(""),"a","b",12),B(Re(860,500,92,40,5),"b","b",12,{o:.3})]),T("status-progress","status","Thanh tiến trình","progress bar loading thanh","#31c76a",D,[B(At(60,400,880,200,100),"w","b",24),W(At(84,424,540,152,76),"a")]),T("status-ring","status","Vòng tiến trình","progress ring vòng phần trăm","#31c76a",D,[H(S(500,500,410),"b",100,{o:.3}),H("M500 90A410 410 0 1 1 90 500","a",100)]),T("status-check","status","Dấu tích lớn","checkmark tick đúng","#31c76a",D,[H(st([140,540],[400,800],[880,200]),"b",200),H(st([140,540],[400,800],[880,200]),"a",130)]),T("status-cross","status","Dấu X lớn","cross x sai","#ff4b55",D,[H("M200 200L800 800M800 200L200 800","b",200),H("M200 200L800 800M800 200L200 800","a",130)]),T("status-checkbox","status","Ô tích","checkbox ô chọn","#31c76a",D,[B(At(110,110,780,780,170),"w","b",34),H(st([270,520],[440,690],[740,320]),"a",110)]),T("status-crossbox","status","Ô gạch X","crossbox ô sai","#ff4b55",D,[B(At(110,110,780,780,170),"w","b",34),H("M310 310L690 690M690 310L310 690","a",110)]),T("status-warning","status","Cảnh báo","warning cảnh báo lưu ý","#ffd23f",D,[B(vt([500,100],[930,850],[70,850]),"a","b",40),H(st([500,370],[500,600]),"b",84),W(S(500,730,46),"b")]),T("status-dots","status","Ba chấm tải","loading dots đang tải","#ffffff",D,[W(S(200,500,80),"a"),W(S(500,500,80),"a",{o:.6}),W(S(800,500,80),"a",{o:.3})])];new Map($o.map(t=>[t.id,t])),$o.map(t=>t.id);const tl=Object.freeze({emitter:"point",ex:.5,ey:.5,esize:.2,text:"CLIPOOX",rate:80,burst:0,prerun:0,life:2,speed:220,direction:-90,spread:60,gravity:0,wind:0,drag:.4,turbulence:.2,shape:"glow",size:8,sizeEnd:.3,color:"#fff3c4",colorEnd:"#ff7a1a",opacity:1,blend:"add",seed:1}),el={particles:"Custom particles — a free particle system: choose the emitter (point, box, disc, line, ring or text), rate, burst, life, speed, direction, gravity, wind, drag, turbulence, shape and colours","pt-dust":"Floating glow dust particles — soft glowing motes drift and swirl over the whole frame (dust, bokeh, ambience)","pt-sparks":"Spark fountain particles — hot sparks shoot up from the bottom and fall back under gravity (sparks, fire, welding)","pt-firework":"Fireworks burst particles — one burst of sparks explodes outward, slows and falls (fireworks, celebration, new year)","pt-snow":"Snowfall particles — snowflakes fall softly over the whole frame with a light wind (snow, winter, christmas)","pt-rain":"Rain particles — fast rain streaks fall at a slight angle over the whole frame (rain, storm, weather)","pt-smoke":"Rising smoke particles — soft smoke puffs rise from the bottom, grow and fade (smoke, steam, fog, mist)","pt-magic":"Magic swirl dust particles — star sparkles circle a ring and twirl (magic, fairy dust, sparkle, glitter)","pt-text":"Particle text — glowing particles form the words (text = the words; logo text, title made of particles)","pt-hearts":"Floating hearts particles — hearts rise from the bottom and sway (love, like, valentine, wedding)","pt-fireflies":"Fireflies particles — small glowing lights wander slowly in the dark (fireflies, night, glow)","pt-confetti":"Confetti particles — paper confetti bursts in and tumbles down (confetti, party, celebration, winner)"},ze=(t,e,c,o)=>Object.freeze({id:t,name:e,category:"Hạt",duration:c,params:Object.freeze({...tl,...o}),code:`function render(ctx,t,env){
2
+ // `+el[t]+` (settings: particles {rate, gravity, shape, color…}).
3
3
  M.particles(ctx,t,env,env.params)
4
- }`}),ro=Object.freeze([ze("particles","Hạt tuỳ chỉnh",5,{}),ze("pt-dust","Bụi sáng lơ lửng",8,{emitter:"box",esize:1.1,rate:45,prerun:6,life:6,speed:14,spread:360,drag:.2,turbulence:.6,shape:"glow",size:8,sizeEnd:1,color:"#fff6dc",colorEnd:"#ffd08a",opacity:.85}),ze("pt-sparks","Tia lửa phun",4,{ex:.5,ey:.9,rate:160,life:1.4,speed:900,direction:-90,spread:38,gravity:1100,drag:.3,turbulence:0,shape:"spark",size:4,sizeEnd:.4,color:"#fff1b8",colorEnd:"#ff4a12"}),ze("pt-firework","Pháo hoa",3,{ey:.4,rate:0,burst:320,life:2.8,speed:560,spread:360,gravity:150,drag:1.5,turbulence:.1,shape:"spark",size:5,sizeEnd:.5,color:"#fff6e0",colorEnd:"#ff3df0",seed:5}),ze("pt-snow","Tuyết rơi",10,{emitter:"line",ey:-.05,esize:1.3,rate:70,prerun:11,life:11,speed:80,direction:90,spread:25,wind:12,drag:.1,turbulence:.35,shape:"snow",size:10,sizeEnd:1,color:"#ffffff",colorEnd:"#dceaff",opacity:.9,blend:"normal"}),ze("pt-rain","Mưa",6,{emitter:"line",ey:-.08,esize:1.4,rate:320,prerun:1,life:.9,speed:1700,direction:100,spread:3,drag:0,turbulence:0,shape:"streak",size:2,sizeEnd:1,color:"#cfe0ff",colorEnd:"#9fb8dd",opacity:.55,blend:"normal"}),ze("pt-smoke","Khói bốc",8,{emitter:"disc",ey:.95,esize:.35,rate:18,prerun:5,life:6,speed:120,direction:-90,spread:40,wind:22,drag:.25,turbulence:.9,shape:"smoke",size:36,sizeEnd:4,color:"#cfcfcf",colorEnd:"#5d6168",opacity:.28,blend:"normal"}),ze("pt-magic","Bụi phép xoáy",6,{emitter:"ring",esize:.42,rate:180,prerun:2,life:2.2,speed:40,direction:-90,spread:360,drag:.6,turbulence:1.1,shape:"star",size:12,sizeEnd:.2,color:"#e9d4ff",colorEnd:"#33e0ff"}),ze("pt-text","Chữ hạt sáng",5,{emitter:"text",text:"CLIPOOX",esize:.7,rate:600,prerun:1.6,life:1.6,speed:8,spread:360,drag:1,turbulence:.15,shape:"glow",size:6,sizeEnd:.5,color:"#ffffff",colorEnd:"#7fe3ff"}),ze("pt-hearts","Tim bay",6,{emitter:"line",ey:1.05,esize:.9,rate:10,prerun:3,life:5,speed:160,direction:-90,spread:20,drag:.2,turbulence:.45,shape:"heart",size:26,sizeEnd:1.3,color:"#ff5a8a",colorEnd:"#ff9ac0",blend:"normal"}),ze("pt-fireflies","Đom đóm",10,{emitter:"box",esize:1,rate:12,prerun:7,life:7,speed:20,spread:360,drag:.5,turbulence:1.4,shape:"glow",size:12,sizeEnd:.8,color:"#f4ff8a",colorEnd:"#9dff5c",opacity:1}),ze("pt-confetti","Pháo giấy",4,{ey:-.05,rate:90,burst:120,life:3.5,speed:420,direction:90,spread:120,gravity:520,drag:1.2,turbulence:.6,shape:"square",size:12,sizeEnd:1,color:"#ffd400",colorEnd:"#ff3d7f",blend:"normal",seed:3})]);Object.freeze(ro.map(t=>t.id));const tl=Object.freeze([{key:"bevn",family:"Clipoox Be Vietnam Pro",weight:"800",style:"normal",file:"BeVietnamPro-800.woff2"},{key:"bevn",family:"Clipoox Be Vietnam Pro",weight:"900",style:"normal",file:"BeVietnamPro-900.woff2"},{key:"mont",family:"Clipoox Montserrat",weight:"900",style:"normal",file:"Montserrat-900.woff2"},{key:"mont",family:"Clipoox Montserrat",weight:"100 700",style:"normal",file:"Montserrat-var.woff2"},{key:"anton",family:"Clipoox Anton",weight:"400",style:"normal",file:"Anton-400.woff2"},{key:"oswald",family:"Clipoox Oswald",weight:"700",style:"normal",file:"Oswald-700.woff2"},{key:"play",family:"Clipoox Playfair Display",weight:"800",style:"italic",file:"PlayfairDisplay-800-italic.woff2"},{key:"brico",family:"Clipoox Bricolage Grotesque",weight:"200 800",style:"normal",file:"BricolageGrotesque-var.woff2"},{key:"bungee",family:"Clipoox Bungee",weight:"400",style:"normal",file:"Bungee-400.woff2"}].map(t=>Object.freeze(t)));Object.freeze(Object.fromEntries(Object.entries({bevn:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',mont:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',anton:'Impact, "Arial Narrow", sans-serif',oswald:'"Arial Narrow", system-ui, sans-serif',play:'Georgia, "Times New Roman", serif',brico:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',bungee:'Impact, "Arial Black", sans-serif'}).map(([t,e])=>[t,`"${tl.find(c=>c.key===t).family}", ${e}`])));const Y=Object.freeze([{id:"bold",name:"Bold",tag:"Chữ đậm kiểu Hormozi, nhảy từng từ",accent:"#ffe600"},{id:"clean",name:"Clean",tag:"Tối giản kiểu Apple, nét mảnh",accent:"#ffffff"},{id:"neon",name:"Neon",tag:"Phát sáng, nhấp nháy bật đèn",accent:"#00f0ff"},{id:"podcast",name:"Podcast",tag:"Thanh tên, thẻ trích dẫn, tag khách mời",accent:"#ffb020"},{id:"sale",name:"Sale",tag:"Giá, đếm ngược, huy hiệu giảm giá",accent:"#ff2d2d"},{id:"business",name:"Business",tag:"Doanh nghiệp: KPI, biểu đồ, quy trình, bảng giá",accent:"#2f7bff"},{id:"launch",name:"Launch",tag:"Ra mắt sản phẩm / app: nền kem, chữ gọn, một màu nhấn",accent:"#ff6a2b"},{id:"glow",name:"Glow Story",tag:"Kể chuyện 3D phát sáng trên nền tối: tài chính, creator, cảm xúc",accent:"#22e06b"},{id:"noir",name:"Gold Noir",tag:"Bóng người viền vàng neon, phụ đề chữ đặc: video kinh doanh, bài học",accent:"#ffc400"},{id:"pop",name:"Pop Editorial",tag:"Chữ đen trên giấy, từ khoá đỏ bật ra, hình minh hoạ cho từng ý",accent:"#e8202a"},{id:"illus",name:"Minh hoạ",tag:"Icon phát sáng cho mọi chủ đề: ẩm thực, sức khoẻ, giáo dục, nhà, xe, du lịch…",accent:"#ffd23f"},{id:"studio",name:"Studio Showcase",tag:"Giới thiệu sản phẩm: giao diện timeline 3D, kéo thả, AI, xuất video",accent:"#b4e36a"},{id:"creator",name:"Creator Pro",tag:"Edit kiểu creator cao cấp: chữ sau người, xu 3D, tiền rơi, tia điện, chữ neon",accent:"#ff2b2b"},{id:"mono",name:"Mono Grid",tag:"Đơn sắc trên giấy kẻ chấm: mảng đen, khung chọn, một điểm màu nhấn",accent:"#2fbfa0"},{id:"ai",name:"AI & Tech",tag:"AI và công nghệ: mạng nơ-ron, chat AI, chip phát sáng, dòng dữ liệu, agent",accent:"#7c5cff"},{id:"fin",name:"Fintech",tag:"Tài chính số: biểu đồ nến, giá cổ phiếu, ví, thẻ, lãi kép — xanh tăng, đỏ giảm",accent:"#21c87a"},{id:"explain",name:"Explainer UI",tag:"Minh hoạ lời nói: thẻ giao diện cho từng câu — bình luận, hồ sơ, đồng hồ, thông báo, đóng dấu, công tắc, nút CTA",accent:"#ff3d8b"},{id:"info",name:"Infographic 3D",tag:"Thẻ biểu đồ trắng xoay 3D: vòng carousel, xoè thẻ, bảng nghiêng, vòng %, cột, sóng, radar",accent:"#8b2fc9"},{id:"cyber",name:"Cyber Reveal",tag:"Logo reveal gaming / công nghệ: thẻ neon xoay vòng, chip bảng mạch, chữ cắt lát glitch, hạt vuông, HUD",accent:"#19e3c3"},{id:"kinetic",name:"Kinetic Words",tag:"Chữ động trên talking head: chữ trắng nhỏ + từ đỏ khổng lồ, chữ cong vòm, sóng, nhòe, ghép điểm ảnh, ruy băng",accent:"#e8141c"},{id:"bridge",name:"Bridges",tag:"Chỗ nối cảnh: cửa sổ phóng xuyên, khối chéo, mống mắt, chớp sáng, vệt lia, mực loang, glitch",accent:"#ff5a36"},{id:"tvc",name:"Brand TVC",tag:"TVC doanh nghiệp theo màu thương hiệu: mở thương hiệu, vấn đề → giải pháp, ưu đãi, đánh giá, liên hệ, logo",accent:"#2f6bff"},{id:"home",name:"Home",tag:"Bất động sản: thẻ căn hộ, mặt bằng, ghim bản đồ, giá/m², chìa khoá, tiện ích, trả góp",accent:"#c9a45c"},{id:"health",name:"Health",tag:"Y tế, sức khoẻ: nhịp tim, viên thuốc, thẻ bác sĩ, đặt lịch khám, chỉ số, checklist khám",accent:"#13b5a6"},{id:"fit",name:"Fit & Sport",tag:"Gym, thể thao: đếm rep, đồng hồ hiệp, vòng macro, kỷ lục, đếm bước, lịch tập",accent:"#ff4b1f"},{id:"travel",name:"Travel",tag:"Du lịch, khách sạn: thẻ lên máy bay, tuyến bay, lịch trình, thẻ phòng, thời tiết, dấu hộ chiếu",accent:"#ff7a45"},{id:"menu",name:"Food Menu",tag:"Ẩm thực: bảng menu, công thức, món bốc khói, phiếu order, độ cay, giao món",accent:"#e8492d"},{id:"auto",name:"Auto",tag:"Ô tô, xe máy: đồng hồ tốc độ, thông số, pin xe điện, đặt lái thử, xe lộ dần",accent:"#e10600"},{id:"cine",name:"Cinematic Symbols",tag:"Phim 2D biểu tượng: nhà dưới trời sao, con mắt, thanh kiếm, vương miện, tim, trăng, chìa khoá — quầng sáng, hạt phim, sao nối cảnh",accent:"#ff3b54"},{id:"pulse",name:"Pulse Geometry",tag:"Motion hình học trừu tượng: chấm sáng, thanh neon, vòng mục tiêu, lục giác, vệt sáng — hình lấp khung nối cảnh",accent:"#ff2a3d"},{id:"story",name:"Story Journey",tag:"Kể chuyện hai tông: một vật dẫn (máy bay giấy, bóng, tim, tin nhắn) bay qua phố, tháp, vũ trụ, đường hầm, đồi nhà — cảnh nối cảnh theo vật",accent:"#ff3b5c"},{id:"lumen",name:"Living Glow",tag:"Ánh sáng sống: vòng neon, quả cầu óng ánh, sinh vật phát sáng có xúc tu, quạt mở, quả cầu hologram, đường hầm vòng màu, chữ neon — chớp màu pastel nối cảnh",accent:"#8b5cff"},{id:"rebound",name:"Neon Rebound",tag:"Bóng sáng nảy qua các khung neon nét mảnh: gạch, dốc, răng cưa, trụ, ống, phố, khung lồng khung — camera đi theo quả bóng",accent:"#36d6e7"},{id:"join",name:"Join Lab",tag:"Chuyển cảnh mới cho mọi thể loại: lật khối 3D, gập giấy, cuộn trang, xé giấy, chất lỏng, gợn sóng, hạt tan rồi tụ, chia khung, biến hình, tường chữ, phóng xuyên vật — che vết cắt ở giữa",accent:"#ff5a36"},{id:"fluid",name:"Liquid Flow",tag:"Chất lỏng mềm mại: khối gradient biến hình, giọt rơi, sóng tràn, đèn dung nham, mực loang trong nước, bong bóng, chữ tan chảy — cảnh nối cảnh bằng chất lỏng tràn đầy khung",accent:"#ff6fb5"},{id:"promo",name:"Product Reveal",tag:"Ra mắt sản phẩm / app / AI: logo loé sáng, thẻ kính gradient, thanh gõ lệnh phát sáng, đám biểu tượng kính 3D, mũi tên phóng lên, chân trời vòm tím — vật thể biến hình nối cảnh",accent:"#8a5cff"},{id:"morph",name:"Shape Shifter",tag:"Một yếu tố nối cảnh biến hình khác nhau qua từng cảnh: chấm sáng, sợi chỉ, vòng mũi tên, hình thoi, sao, viên thuốc, dải, thẻ, hàng chấm, cột sáng, mặt trời, giọt, logo — tông hổ phách ấm",accent:"#ff8a1f"},{id:"glass",name:"Kính Fintech",tag:"Tài chính trên kính tối: thẻ kính mờ có vệt sáng lướt, quả cầu trợ lý phát sáng, số dư đếm nhanh, cột xu, biểu đồ bậc thang, đường về đích, nến, vòng phần trăm, biểu tượng và giá — chữ trắng nhỏ + từ khoá xanh điện lớn",accent:"#3a63ff"},{id:"clipooxmotion",name:"Clipoox",tag:"Bộ motion riêng của Clipoox: logo ngọn lửa thật, xanh chanh + đen; cảnh ra mắt nền sáng, cảnh studio nền tối phát sáng, cảnh khuyến mãi (chữ gradient, quay số, đếm số, pill kính, mưa xu, thẻ số dư, HUD) và cảnh số liệu tăng trưởng (khung viền nhãn, đồng hồ vạch, đường tăng trưởng, lưới chấm); có nhóm cảnh dựng riêng cho khổ dọc 9:16 (clipoox-v-*); cảnh phim ra mắt (ô lệnh AI gõ chữ, tiêu đề glitch, dòng trạng thái ánh lướt, cửa sổ bung pháo giấy, bể bóng, mặt pixel, lõi ngọn lửa, hologram, khối thẻ, logo tia sáng)",accent:"#8afb00"},{id:"prodreview",name:"Review sản phẩm",tag:"Review / routine sản phẩm khổ dọc: chú thích BƯỚC 1 / hướng dẫn chữ trắng mờ dần vào, logo chìm, mở logo, packshot pastel, nhãn chỉ sản phẩm, lợi ích, chấm điểm, thẻ mua ngay",accent:"#e2557f"},{id:"course",name:"Course Kit",tag:"Video khoá học / hướng dẫn / hỏi đáp: thanh điều hướng câu hỏi Q1…Q15, ô các bước, thẻ công cụ (biểu tượng + địa chỉ web), thẻ chương, thẻ ý chính, thanh tiến độ, khung cửa sổ quanh video quay màn hình, mũi tên chỉ vùng, khung người nói (PiP), nhãn chủ đề, đường hành trình, ảnh bật ra, bìa sách, khung mô hình xếp tầng, bố cục hai thẻ, dấu thương hiệu góc, bảng so sánh viết tay, tài liệu tô đỏ, bản đồ ghim — kính xanh đậm, kính đen viền neon đỏ hoặc nền trắng sáng biên tập",accent:"#3d7bff"},{id:"aiworkflow",name:"Quy trình AI & HUD game",tag:"Phim ra mắt kiểu 'AI dựng game': thẻ tiêu đề đua xe (dải cờ ca-rô, chớp màu), ô lệnh gắn ảnh + thẻ thương hiệu, quét bản phác thảo, tiêu đề trạng thái + checklist, chọn phong cách 2×2, danh sách bước chữ lớn, khung 3D + thẻ lệnh; HUD game đua xe (vòng, đồng hồ tốc độ, bản đồ nhỏ, ô vật phẩm, thanh tăng tốc), menu tạm dừng, chọn xe / nhân vật, phụ đề kết — có bản dọc 9:16 (aiw-v-*)",accent:"#8afb00"},{id:"techlaunch",name:"Ra mắt công nghệ",tag:"Phim ra mắt app / model AI / thiết bị kiểu biên tập công nghệ sáng: giấy trắng hồng + quầng hồng / chanh, hồng sen + đen, chữ vuông công nghệ, mũi tên >> << đóng khung tiêu đề; chồng chữ + ảnh rải, tên trong khung + nhãn, dựng chữ từng nhịp, nhân vật + bầy thẻ bay, bảng tính năng có khung video, số rải + bậc thang thẻ, khung phát video, khung đầu / giữa / cuối, 4K tách đôi + lưới mặt, thẻ kết — có bản dọc 9:16 (tl-v-*), đổi màu được (bản Clipoox: theme dark + accent chanh)",accent:"#ff1f8e"},{id:"framed",name:"Creator khung",tag:"Talking head creator / khoá học trên nền than chì lưới ô vuông: người nói trong khung bo góc có góc ngoặc vàng, chữ hoa đậm trắng + một màu nhấn, nhãn nhỏ giãn chữ, đường kẻ mảnh; khung người nói, A với B, tiêu đề xếp tầng + con trỏ, đồng hồ đếm giờ → chữ, chip đếm theo ngón tay, thẻ giấy câu hỏi + trả lời, kêu gọi bình luận A hay B, thẻ chương, định nghĩa, tóm tắt checklist, tên giảng viên — có bản dọc 9:16 (fr-v-*), đổi màu nhấn được",accent:"#ffc21a"},{id:"uibeats",name:"Nhịp giao diện",tag:"Nhịp giao diện cho video ra mắt SaaS / app: nút Thích, chip ✓, sao chép link, dán link, chữ hiện từ mờ, thẻ bản nháp",accent:"#f5a524"},{id:"clipooxstudio",name:"Clipoox Studio",tag:'Kiểu "motion viết bằng code" cho phim ra mắt / SaaS / giải thích: giấy kem có quầng đào + chanh và hình học bay, tiêu đề có một chữ nghiêng có chân + đường cong bezier kèm tay nắm, nút chanh; cảnh tối trên lưới chấm (ô lệnh AI, đang tạo, quạt thẻ 3D, code + đồ thị tốc độ, timeline tìm lỗi + vá, thẻ xuất video); bút vẽ path → logo, nhiều con trỏ cộng tác, ba điện thoại, CTA → logo; trang hồ sơ + con dấu, bản đồ lộ trình vẽ tay, bảng khởi hành lật chữ, tiêu đề thẻ nghiêng, chữ glitch; chữ nhấn + vòng đếm trên người nói — tự xếp cho 16:9 và 9:16, đổi màu nhấn + theme sáng / tối',accent:"#8afb00"},{id:"matrix",name:"Ma trận số",tag:"Thế giới số kiểu Ma trận: mưa mã xanh lục, lao xuyên đường hầm dữ liệu, chữ giải mã từ ký tự loạn, màn hình CRT có dòng quét và chữ gõ",accent:"#22ff66"},{id:"lightfx",name:"Dải sáng điện ảnh",tag:"Clip giới thiệu kiểu điện ảnh ánh tím: bó dải sáng bay xoắn trong không gian rồi lao theo xe, tên người hiện bằng tia lửa chạy, cờ lụa in logo bay trong gió",accent:"#b44dff"},{id:"sportcine",name:"Thể thao điện ảnh & Creator",tag:"Quảng cáo thể thao điện ảnh + reel hướng dẫn của creator: lưới chấm halftone chớp, ô phân tích có toạ độ nối bằng cung mảnh, con trỏ có thẻ tên, nhãn thẻ media (pill kính / chip chanh), pill kêu gọi bình luận từ khoá có tim đỏ",accent:"#c8f53c"},{id:"faceholo",name:"HUD hologram bám mặt",tag:"HUD hologram trong suốt để ghim lên khuôn mặt (bám theo chuyển động đầu): bảng cuộc gọi, bàn phím quay số, cột chữ cuộn, lưới quét và khoá mục tiêu trên mặt, bong bóng chat 3D, vòng dữ liệu, trình phát nhạc, nhịp tim, thẻ hồ sơ, chồng thông báo, radar bản đồ, dịch song ngữ, thời tiết",accent:"#7fd8ff"},{id:"history",name:"Chuyện có thật",tag:"Video kể chuyện có thật kiểu phim cổ: nắng cửa sổ trên tường, năm in lớn, tiêu đề chữ nghiêng phát sáng, băng dán đỏ, thẻ viền chỉ khâu chữ màu, chữ bay trong chiều sâu, chữ khối đỏ sau vật, lớp phim cũ, thanh tìm kiếm cuối video",accent:"#e3242b"}].map(t=>Object.freeze(t))),el=Object.freeze(["idea","money","time","growth","target","heart","trophy","rocket","lock","megaphone","gift","globe","chat","mail","user","team","star","fire","check","cross","warning","search","gear","calendar","phone","cart","shield","key","briefcase","camera","music","home","chart","cool","shock","laugh","cry","love","angry","think"]);""+JSON.stringify(Object.fromEntries(Object.entries(ja).map(([t,e])=>[t,e.d])));const Vo=Y.find(t=>t.id==="business"),Be=(t,e,c,o,n)=>({id:t,name:e,category:Vo.name,pack:"business",duration:c,params:{...o,accent:Vo.accent,style:"business"},code:n}),Jc=`const num=s=>{const st=M.stat(s),last=String(s).trim().split(' ').pop()||'',m=last.match(/[.,]([0-9]+)/),d=m?Math.min(2,m[1].length):0,pl=last.charAt(0)==='+';return{label:st.label,v:st.v,d,pre:pl?'+':'',u:st.u.replace('+','')}}
4
+ }`}),xo=Object.freeze([ze("particles","Hạt tuỳ chỉnh",5,{}),ze("pt-dust","Bụi sáng lơ lửng",8,{emitter:"box",esize:1.1,rate:45,prerun:6,life:6,speed:14,spread:360,drag:.2,turbulence:.6,shape:"glow",size:8,sizeEnd:1,color:"#fff6dc",colorEnd:"#ffd08a",opacity:.85}),ze("pt-sparks","Tia lửa phun",4,{ex:.5,ey:.9,rate:160,life:1.4,speed:900,direction:-90,spread:38,gravity:1100,drag:.3,turbulence:0,shape:"spark",size:4,sizeEnd:.4,color:"#fff1b8",colorEnd:"#ff4a12"}),ze("pt-firework","Pháo hoa",3,{ey:.4,rate:0,burst:320,life:2.8,speed:560,spread:360,gravity:150,drag:1.5,turbulence:.1,shape:"spark",size:5,sizeEnd:.5,color:"#fff6e0",colorEnd:"#ff3df0",seed:5}),ze("pt-snow","Tuyết rơi",10,{emitter:"line",ey:-.05,esize:1.3,rate:70,prerun:11,life:11,speed:80,direction:90,spread:25,wind:12,drag:.1,turbulence:.35,shape:"snow",size:10,sizeEnd:1,color:"#ffffff",colorEnd:"#dceaff",opacity:.9,blend:"normal"}),ze("pt-rain","Mưa",6,{emitter:"line",ey:-.08,esize:1.4,rate:320,prerun:1,life:.9,speed:1700,direction:100,spread:3,drag:0,turbulence:0,shape:"streak",size:2,sizeEnd:1,color:"#cfe0ff",colorEnd:"#9fb8dd",opacity:.55,blend:"normal"}),ze("pt-smoke","Khói bốc",8,{emitter:"disc",ey:.95,esize:.35,rate:18,prerun:5,life:6,speed:120,direction:-90,spread:40,wind:22,drag:.25,turbulence:.9,shape:"smoke",size:36,sizeEnd:4,color:"#cfcfcf",colorEnd:"#5d6168",opacity:.28,blend:"normal"}),ze("pt-magic","Bụi phép xoáy",6,{emitter:"ring",esize:.42,rate:180,prerun:2,life:2.2,speed:40,direction:-90,spread:360,drag:.6,turbulence:1.1,shape:"star",size:12,sizeEnd:.2,color:"#e9d4ff",colorEnd:"#33e0ff"}),ze("pt-text","Chữ hạt sáng",5,{emitter:"text",text:"CLIPOOX",esize:.7,rate:600,prerun:1.6,life:1.6,speed:8,spread:360,drag:1,turbulence:.15,shape:"glow",size:6,sizeEnd:.5,color:"#ffffff",colorEnd:"#7fe3ff"}),ze("pt-hearts","Tim bay",6,{emitter:"line",ey:1.05,esize:.9,rate:10,prerun:3,life:5,speed:160,direction:-90,spread:20,drag:.2,turbulence:.45,shape:"heart",size:26,sizeEnd:1.3,color:"#ff5a8a",colorEnd:"#ff9ac0",blend:"normal"}),ze("pt-fireflies","Đom đóm",10,{emitter:"box",esize:1,rate:12,prerun:7,life:7,speed:20,spread:360,drag:.5,turbulence:1.4,shape:"glow",size:12,sizeEnd:.8,color:"#f4ff8a",colorEnd:"#9dff5c",opacity:1}),ze("pt-confetti","Pháo giấy",4,{ey:-.05,rate:90,burst:120,life:3.5,speed:420,direction:90,spread:120,gravity:520,drag:1.2,turbulence:.6,shape:"square",size:12,sizeEnd:1,color:"#ffd400",colorEnd:"#ff3d7f",blend:"normal",seed:3})]);Object.freeze(xo.map(t=>t.id));const cl=Object.freeze([{key:"bevn",family:"Clipoox Be Vietnam Pro",weight:"800",style:"normal",file:"BeVietnamPro-800.woff2"},{key:"bevn",family:"Clipoox Be Vietnam Pro",weight:"900",style:"normal",file:"BeVietnamPro-900.woff2"},{key:"mont",family:"Clipoox Montserrat",weight:"900",style:"normal",file:"Montserrat-900.woff2"},{key:"mont",family:"Clipoox Montserrat",weight:"100 700",style:"normal",file:"Montserrat-var.woff2"},{key:"anton",family:"Clipoox Anton",weight:"400",style:"normal",file:"Anton-400.woff2"},{key:"oswald",family:"Clipoox Oswald",weight:"700",style:"normal",file:"Oswald-700.woff2"},{key:"play",family:"Clipoox Playfair Display",weight:"800",style:"italic",file:"PlayfairDisplay-800-italic.woff2"},{key:"brico",family:"Clipoox Bricolage Grotesque",weight:"200 800",style:"normal",file:"BricolageGrotesque-var.woff2"},{key:"bungee",family:"Clipoox Bungee",weight:"400",style:"normal",file:"Bungee-400.woff2"}].map(t=>Object.freeze(t)));Object.freeze(Object.fromEntries(Object.entries({bevn:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',mont:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',anton:'Impact, "Arial Narrow", sans-serif',oswald:'"Arial Narrow", system-ui, sans-serif',play:'Georgia, "Times New Roman", serif',brico:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',bungee:'Impact, "Arial Black", sans-serif'}).map(([t,e])=>[t,`"${cl.find(c=>c.key===t).family}", ${e}`])));const Y=Object.freeze([{id:"bold",name:"Bold",tag:"Chữ đậm kiểu Hormozi, nhảy từng từ",accent:"#ffe600"},{id:"clean",name:"Clean",tag:"Tối giản kiểu Apple, nét mảnh",accent:"#ffffff"},{id:"neon",name:"Neon",tag:"Phát sáng, nhấp nháy bật đèn",accent:"#00f0ff"},{id:"podcast",name:"Podcast",tag:"Thanh tên, thẻ trích dẫn, tag khách mời",accent:"#ffb020"},{id:"sale",name:"Sale",tag:"Giá, đếm ngược, huy hiệu giảm giá",accent:"#ff2d2d"},{id:"business",name:"Business",tag:"Doanh nghiệp: KPI, biểu đồ, quy trình, bảng giá",accent:"#2f7bff"},{id:"launch",name:"Launch",tag:"Ra mắt sản phẩm / app: nền kem, chữ gọn, một màu nhấn",accent:"#ff6a2b"},{id:"glow",name:"Glow Story",tag:"Kể chuyện 3D phát sáng trên nền tối: tài chính, creator, cảm xúc",accent:"#22e06b"},{id:"noir",name:"Gold Noir",tag:"Bóng người viền vàng neon, phụ đề chữ đặc: video kinh doanh, bài học",accent:"#ffc400"},{id:"pop",name:"Pop Editorial",tag:"Chữ đen trên giấy, từ khoá đỏ bật ra, hình minh hoạ cho từng ý",accent:"#e8202a"},{id:"illus",name:"Minh hoạ",tag:"Icon phát sáng cho mọi chủ đề: ẩm thực, sức khoẻ, giáo dục, nhà, xe, du lịch…",accent:"#ffd23f"},{id:"studio",name:"Studio Showcase",tag:"Giới thiệu sản phẩm: giao diện timeline 3D, kéo thả, AI, xuất video",accent:"#b4e36a"},{id:"creator",name:"Creator Pro",tag:"Edit kiểu creator cao cấp: chữ sau người, xu 3D, tiền rơi, tia điện, chữ neon",accent:"#ff2b2b"},{id:"mono",name:"Mono Grid",tag:"Đơn sắc trên giấy kẻ chấm: mảng đen, khung chọn, một điểm màu nhấn",accent:"#2fbfa0"},{id:"ai",name:"AI & Tech",tag:"AI và công nghệ: mạng nơ-ron, chat AI, chip phát sáng, dòng dữ liệu, agent",accent:"#7c5cff"},{id:"fin",name:"Fintech",tag:"Tài chính số: biểu đồ nến, giá cổ phiếu, ví, thẻ, lãi kép — xanh tăng, đỏ giảm",accent:"#21c87a"},{id:"explain",name:"Explainer UI",tag:"Minh hoạ lời nói: thẻ giao diện cho từng câu — bình luận, hồ sơ, đồng hồ, thông báo, đóng dấu, công tắc, nút CTA",accent:"#ff3d8b"},{id:"info",name:"Infographic 3D",tag:"Thẻ biểu đồ trắng xoay 3D: vòng carousel, xoè thẻ, bảng nghiêng, vòng %, cột, sóng, radar",accent:"#8b2fc9"},{id:"cyber",name:"Cyber Reveal",tag:"Logo reveal gaming / công nghệ: thẻ neon xoay vòng, chip bảng mạch, chữ cắt lát glitch, hạt vuông, HUD",accent:"#19e3c3"},{id:"kinetic",name:"Kinetic Words",tag:"Chữ động trên talking head: chữ trắng nhỏ + từ đỏ khổng lồ, chữ cong vòm, sóng, nhòe, ghép điểm ảnh, ruy băng",accent:"#e8141c"},{id:"bridge",name:"Bridges",tag:"Chỗ nối cảnh: cửa sổ phóng xuyên, khối chéo, mống mắt, chớp sáng, vệt lia, mực loang, glitch",accent:"#ff5a36"},{id:"tvc",name:"Brand TVC",tag:"TVC doanh nghiệp theo màu thương hiệu: mở thương hiệu, vấn đề → giải pháp, ưu đãi, đánh giá, liên hệ, logo",accent:"#2f6bff"},{id:"home",name:"Home",tag:"Bất động sản: thẻ căn hộ, mặt bằng, ghim bản đồ, giá/m², chìa khoá, tiện ích, trả góp",accent:"#c9a45c"},{id:"health",name:"Health",tag:"Y tế, sức khoẻ: nhịp tim, viên thuốc, thẻ bác sĩ, đặt lịch khám, chỉ số, checklist khám",accent:"#13b5a6"},{id:"fit",name:"Fit & Sport",tag:"Gym, thể thao: đếm rep, đồng hồ hiệp, vòng macro, kỷ lục, đếm bước, lịch tập",accent:"#ff4b1f"},{id:"travel",name:"Travel",tag:"Du lịch, khách sạn: thẻ lên máy bay, tuyến bay, lịch trình, thẻ phòng, thời tiết, dấu hộ chiếu",accent:"#ff7a45"},{id:"menu",name:"Food Menu",tag:"Ẩm thực: bảng menu, công thức, món bốc khói, phiếu order, độ cay, giao món",accent:"#e8492d"},{id:"auto",name:"Auto",tag:"Ô tô, xe máy: đồng hồ tốc độ, thông số, pin xe điện, đặt lái thử, xe lộ dần",accent:"#e10600"},{id:"cine",name:"Cinematic Symbols",tag:"Phim 2D biểu tượng: nhà dưới trời sao, con mắt, thanh kiếm, vương miện, tim, trăng, chìa khoá — quầng sáng, hạt phim, sao nối cảnh",accent:"#ff3b54"},{id:"pulse",name:"Pulse Geometry",tag:"Motion hình học trừu tượng: chấm sáng, thanh neon, vòng mục tiêu, lục giác, vệt sáng — hình lấp khung nối cảnh",accent:"#ff2a3d"},{id:"story",name:"Story Journey",tag:"Kể chuyện hai tông: một vật dẫn (máy bay giấy, bóng, tim, tin nhắn) bay qua phố, tháp, vũ trụ, đường hầm, đồi nhà — cảnh nối cảnh theo vật",accent:"#ff3b5c"},{id:"lumen",name:"Living Glow",tag:"Ánh sáng sống: vòng neon, quả cầu óng ánh, sinh vật phát sáng có xúc tu, quạt mở, quả cầu hologram, đường hầm vòng màu, chữ neon — chớp màu pastel nối cảnh",accent:"#8b5cff"},{id:"rebound",name:"Neon Rebound",tag:"Bóng sáng nảy qua các khung neon nét mảnh: gạch, dốc, răng cưa, trụ, ống, phố, khung lồng khung — camera đi theo quả bóng",accent:"#36d6e7"},{id:"join",name:"Join Lab",tag:"Chuyển cảnh mới cho mọi thể loại: lật khối 3D, gập giấy, cuộn trang, xé giấy, chất lỏng, gợn sóng, hạt tan rồi tụ, chia khung, biến hình, tường chữ, phóng xuyên vật — che vết cắt ở giữa",accent:"#ff5a36"},{id:"fluid",name:"Liquid Flow",tag:"Chất lỏng mềm mại: khối gradient biến hình, giọt rơi, sóng tràn, đèn dung nham, mực loang trong nước, bong bóng, chữ tan chảy — cảnh nối cảnh bằng chất lỏng tràn đầy khung",accent:"#ff6fb5"},{id:"promo",name:"Product Reveal",tag:"Ra mắt sản phẩm / app / AI: logo loé sáng, thẻ kính gradient, thanh gõ lệnh phát sáng, đám biểu tượng kính 3D, mũi tên phóng lên, chân trời vòm tím — vật thể biến hình nối cảnh",accent:"#8a5cff"},{id:"morph",name:"Shape Shifter",tag:"Một yếu tố nối cảnh biến hình khác nhau qua từng cảnh: chấm sáng, sợi chỉ, vòng mũi tên, hình thoi, sao, viên thuốc, dải, thẻ, hàng chấm, cột sáng, mặt trời, giọt, logo — tông hổ phách ấm",accent:"#ff8a1f"},{id:"glass",name:"Kính Fintech",tag:"Tài chính trên kính tối: thẻ kính mờ có vệt sáng lướt, quả cầu trợ lý phát sáng, số dư đếm nhanh, cột xu, biểu đồ bậc thang, đường về đích, nến, vòng phần trăm, biểu tượng và giá — chữ trắng nhỏ + từ khoá xanh điện lớn",accent:"#3a63ff"},{id:"clipooxmotion",name:"Clipoox",tag:"Bộ motion riêng của Clipoox: logo ngọn lửa thật, xanh chanh + đen; cảnh ra mắt nền sáng, cảnh studio nền tối phát sáng, cảnh khuyến mãi (chữ gradient, quay số, đếm số, pill kính, mưa xu, thẻ số dư, HUD) và cảnh số liệu tăng trưởng (khung viền nhãn, đồng hồ vạch, đường tăng trưởng, lưới chấm); có nhóm cảnh dựng riêng cho khổ dọc 9:16 (clipoox-v-*); cảnh phim ra mắt (ô lệnh AI gõ chữ, tiêu đề glitch, dòng trạng thái ánh lướt, cửa sổ bung pháo giấy, bể bóng, mặt pixel, lõi ngọn lửa, hologram, khối thẻ, logo tia sáng)",accent:"#8afb00"},{id:"prodreview",name:"Review sản phẩm",tag:"Review / routine sản phẩm khổ dọc: chú thích BƯỚC 1 / hướng dẫn chữ trắng mờ dần vào, logo chìm, mở logo, packshot pastel, nhãn chỉ sản phẩm, lợi ích, chấm điểm, thẻ mua ngay",accent:"#e2557f"},{id:"course",name:"Course Kit",tag:"Video khoá học / hướng dẫn / hỏi đáp: thanh điều hướng câu hỏi Q1…Q15, ô các bước, thẻ công cụ (biểu tượng + địa chỉ web), thẻ chương, thẻ ý chính, thanh tiến độ, khung cửa sổ quanh video quay màn hình, mũi tên chỉ vùng, khung người nói (PiP), nhãn chủ đề, đường hành trình, ảnh bật ra, bìa sách, khung mô hình xếp tầng, bố cục hai thẻ, dấu thương hiệu góc, bảng so sánh viết tay, tài liệu tô đỏ, bản đồ ghim — kính xanh đậm, kính đen viền neon đỏ hoặc nền trắng sáng biên tập",accent:"#3d7bff"},{id:"aiworkflow",name:"Quy trình AI & HUD game",tag:"Phim ra mắt kiểu 'AI dựng game': thẻ tiêu đề đua xe (dải cờ ca-rô, chớp màu), ô lệnh gắn ảnh + thẻ thương hiệu, quét bản phác thảo, tiêu đề trạng thái + checklist, chọn phong cách 2×2, danh sách bước chữ lớn, khung 3D + thẻ lệnh; HUD game đua xe (vòng, đồng hồ tốc độ, bản đồ nhỏ, ô vật phẩm, thanh tăng tốc), menu tạm dừng, chọn xe / nhân vật, phụ đề kết — có bản dọc 9:16 (aiw-v-*)",accent:"#8afb00"},{id:"techlaunch",name:"Ra mắt công nghệ",tag:"Phim ra mắt app / model AI / thiết bị kiểu biên tập công nghệ sáng: giấy trắng hồng + quầng hồng / chanh, hồng sen + đen, chữ vuông công nghệ, mũi tên >> << đóng khung tiêu đề; chồng chữ + ảnh rải, tên trong khung + nhãn, dựng chữ từng nhịp, nhân vật + bầy thẻ bay, bảng tính năng có khung video, số rải + bậc thang thẻ, khung phát video, khung đầu / giữa / cuối, 4K tách đôi + lưới mặt, thẻ kết — có bản dọc 9:16 (tl-v-*), đổi màu được (bản Clipoox: theme dark + accent chanh)",accent:"#ff1f8e"},{id:"framed",name:"Creator khung",tag:"Talking head creator / khoá học trên nền than chì lưới ô vuông: người nói trong khung bo góc có góc ngoặc vàng, chữ hoa đậm trắng + một màu nhấn, nhãn nhỏ giãn chữ, đường kẻ mảnh; khung người nói, A với B, tiêu đề xếp tầng + con trỏ, đồng hồ đếm giờ → chữ, chip đếm theo ngón tay, thẻ giấy câu hỏi + trả lời, kêu gọi bình luận A hay B, thẻ chương, định nghĩa, tóm tắt checklist, tên giảng viên — có bản dọc 9:16 (fr-v-*), đổi màu nhấn được",accent:"#ffc21a"},{id:"uibeats",name:"Nhịp giao diện",tag:"Nhịp giao diện cho video ra mắt SaaS / app: nút Thích, chip ✓, sao chép link, dán link, chữ hiện từ mờ, thẻ bản nháp",accent:"#f5a524"},{id:"clipooxstudio",name:"Clipoox Studio",tag:'Kiểu "motion viết bằng code" cho phim ra mắt / SaaS / giải thích: giấy kem có quầng đào + chanh và hình học bay, tiêu đề có một chữ nghiêng có chân + đường cong bezier kèm tay nắm, nút chanh; cảnh tối trên lưới chấm (ô lệnh AI, đang tạo, quạt thẻ 3D, code + đồ thị tốc độ, timeline tìm lỗi + vá, thẻ xuất video); bút vẽ path → logo, nhiều con trỏ cộng tác, ba điện thoại, CTA → logo; trang hồ sơ + con dấu, bản đồ lộ trình vẽ tay, bảng khởi hành lật chữ, tiêu đề thẻ nghiêng, chữ glitch; chữ nhấn + vòng đếm trên người nói — tự xếp cho 16:9 và 9:16, đổi màu nhấn + theme sáng / tối',accent:"#8afb00"},{id:"matrix",name:"Ma trận số",tag:"Thế giới số kiểu Ma trận: mưa mã xanh lục, lao xuyên đường hầm dữ liệu, chữ giải mã từ ký tự loạn, màn hình CRT có dòng quét và chữ gõ",accent:"#22ff66"},{id:"lightfx",name:"Dải sáng điện ảnh",tag:"Clip giới thiệu kiểu điện ảnh ánh tím: bó dải sáng bay xoắn trong không gian rồi lao theo xe, tên người hiện bằng tia lửa chạy, cờ lụa in logo bay trong gió",accent:"#b44dff"},{id:"sportcine",name:"Thể thao điện ảnh & Creator",tag:"Quảng cáo thể thao điện ảnh + reel hướng dẫn của creator: lưới chấm halftone chớp, ô phân tích có toạ độ nối bằng cung mảnh, con trỏ có thẻ tên, nhãn thẻ media (pill kính / chip chanh), pill kêu gọi bình luận từ khoá có tim đỏ",accent:"#c8f53c"},{id:"faceholo",name:"HUD hologram bám mặt",tag:"HUD hologram trong suốt để ghim lên khuôn mặt (bám theo chuyển động đầu): bảng cuộc gọi, bàn phím quay số, cột chữ cuộn, lưới quét và khoá mục tiêu trên mặt, bong bóng chat 3D, vòng dữ liệu, trình phát nhạc, nhịp tim, thẻ hồ sơ, chồng thông báo, radar bản đồ, dịch song ngữ, thời tiết",accent:"#7fd8ff"},{id:"history",name:"Chuyện có thật",tag:"Video kể chuyện có thật kiểu phim cổ: nắng cửa sổ trên tường, năm in lớn, tiêu đề chữ nghiêng phát sáng, băng dán đỏ, thẻ viền chỉ khâu chữ màu, chữ bay trong chiều sâu, chữ khối đỏ sau vật, lớp phim cũ, thanh tìm kiếm cuối video",accent:"#e3242b"}].map(t=>Object.freeze(t))),al=Object.freeze(["idea","money","time","growth","target","heart","trophy","rocket","lock","megaphone","gift","globe","chat","mail","user","team","star","fire","check","cross","warning","search","gear","calendar","phone","cart","shield","key","briefcase","camera","music","home","chart","cool","shock","laugh","cry","love","angry","think"]);""+JSON.stringify(Object.fromEntries(Object.entries(ja).map(([t,e])=>[t,e.d])));const Xo=Y.find(t=>t.id==="business"),Be=(t,e,c,o,n)=>({id:t,name:e,category:Xo.name,pack:"business",duration:c,params:{...o,accent:Xo.accent,style:"business"},code:n}),Jc=`const num=s=>{const st=M.stat(s),last=String(s).trim().split(' ').pop()||'',m=last.match(/[.,]([0-9]+)/),d=m?Math.min(2,m[1].length):0,pl=last.charAt(0)==='+';return{label:st.label,v:st.v,d,pre:pl?'+':'',u:st.u.replace('+','')}}
5
5
  const show=(n,k)=>{const v=n.v*k;return n.pre+(n.d?v.toFixed(n.d).replace('.',','):M.fmt(v))+n.u}
6
6
  `,uc=`const card=(x,y,w,h,r,a)=>{ctx.save();ctx.fillStyle=M.rgba(sk.panel,a);ctx.shadowColor='rgba(0,0,0,.35)';ctx.shadowBlur=S.u*.04;M.rr(ctx,x,y,w,h,r);ctx.fill();ctx.restore()}
7
7
  `,ue=`const head=(y,size)=>{if(!p.text)return;const f=M.fit(ctx,String(p.text),q=>sk.font(q,'h'),size,S.w,1,.45);ctx.save();ctx.globalAlpha=k.v*M.ease.outCubic(M.range(t,.05,.5));ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=sk.fill;ctx.fillText(f.lines[0],S.cx,y+(1-M.ease.outCubic(M.range(t,.05,.5)))*S.u*.03);ctx.restore()}
8
- `,cl=[Be("biz-kpi-cards","Thẻ KPI tự đếm",5,{text:"Kết quả năm 2025",items:"Doanh thu 2,5tỷ|Khách hàng 12000|Tăng trưởng +38%|Đánh giá 4,9★",position:"center"},`function render(ctx,t,env){
8
+ `,ol=[Be("biz-kpi-cards","Thẻ KPI tự đếm",5,{text:"Kết quả năm 2025",items:"Doanh thu 2,5tỷ|Khách hàng 12000|Tăng trưởng +38%|Đánh giá 4,9★",position:"center"},`function render(ctx,t,env){
9
9
  // Up to 4 cards (2×2) fly in one by one; each number counts up from 0, the accent bar grows on the left.
10
10
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
11
11
  `+Jc+uc+ue+` const list=M.items(p,4).map(num),n=Math.max(1,list.length),cols=n===1?1:2,rows=Math.ceil(n/cols)
@@ -216,8 +216,8 @@
216
216
  ctx.strokeStyle=M.readable(sk.acc);ctx.lineWidth=Math.max(2,r*.28);ctx.lineCap='round';ctx.lineJoin='round';if(tk>.3){ctx.beginPath();ctx.moveTo(c1-r*.45,y);ctx.lineTo(c1-r*.1,y+r*.35);ctx.lineTo(c1+r*.5,y-r*.35);ctx.stroke()}
217
217
  ctx.strokeStyle=M.mix(sk.fill,'#8a93a6',.5);const x2=M.range(t,t0+.3,t0+.55)*r*.4;ctx.beginPath();ctx.moveTo(c2-x2,y-x2);ctx.lineTo(c2+x2,y+x2);ctx.moveTo(c2+x2,y-x2);ctx.lineTo(c2-x2,y+x2);ctx.stroke()
218
218
  ctx.restore()})
219
- }`)],$o=Y.find(t=>t.id==="business"),Dt=(t,e,c,o,n)=>({id:t,name:e,category:$o.name,pack:"business",duration:c,params:{...o,accent:$o.accent,style:"business"},code:n}),Et=`const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
220
- `,al=[Dt("biz-funnel","Phễu chuyển đổi",5,{text:"Phễu bán hàng",items:"Tiếp cận 12000|Quan tâm 4800|Dùng thử 1500|Mua hàng 620",position:"center"},`function render(ctx,t,env){
219
+ }`)],Fo=Y.find(t=>t.id==="business"),Dt=(t,e,c,o,n)=>({id:t,name:e,category:Fo.name,pack:"business",duration:c,params:{...o,accent:Fo.accent,style:"business"},code:n}),Et=`const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
220
+ `,nl=[Dt("biz-funnel","Phễu chuyển đổi",5,{text:"Phễu bán hàng",items:"Tiếp cận 12000|Quan tâm 4800|Dùng thử 1500|Mua hàng 620",position:"center"},`function render(ctx,t,env){
221
221
  // Funnel layers open from the centre one by one; each counts its number, the step-to-step rate sits on the right.
222
222
  `+Et+Jc+ue+` const list=M.items(p).map(num),n=Math.max(1,list.length),th=p.text?S.u*.12:0
223
223
  const W=Math.min(S.w*.8,S.u*(S.port?.85:1)),lh=Math.min(S.u*(S.port?.16:.12),(S.bot-S.top-th)/n*.9),H=lh*n,cx=S.cx,y0=S.y-(H+th)/2+th
@@ -517,7 +517,7 @@
517
517
  const tf=M.fit(ctx,String(p.text||' '),z=>sk.font(z,'h'),S.u*.06,tw,2,.45);ctx.font=tf.font;ctx.fillStyle=sk.fill;tf.lines.forEach((l,i)=>ctx.fillText(l,tx,ty+i*tf.lh-(tf.lines.length-1)*tf.lh/2))
518
518
  if(p.sub){const sf=M.fit(ctx,String(p.sub),z=>sk.font(z,'s'),S.u*.038,tw,1,.45);ctx.font=sf.font;ctx.fillStyle=sk.acc;ctx.fillText(sf.lines[0],tx,ty+tf.lh*tf.lines.length/2+sf.size*.9)}
519
519
  ctx.restore()
520
- }`)],Xo=Y.find(t=>t.id==="launch"),xa=(t,e,c,o,n)=>({id:t,name:e,category:Xo.name,pack:"launch",duration:c,params:{accent:Xo.accent,...o,style:"launch"},code:n}),ol=[xa("launch-question","Câu hỏi mở màn",4,{text:"Ứng dụng của bạn đi được bao xa?",color:"#16161a",position:"center"},`function render(ctx,t,env){
520
+ }`)],Yo=Y.find(t=>t.id==="launch"),xa=(t,e,c,o,n)=>({id:t,name:e,category:Yo.name,pack:"launch",duration:c,params:{accent:Yo.accent,...o,style:"launch"},code:n}),sl=[xa("launch-question","Câu hỏi mở màn",4,{text:"Ứng dụng của bạn đi được bao xa?",color:"#16161a",position:"center"},`function render(ctx,t,env){
521
521
  // Words arrive one by one (blur → sharp, the line re-centres as it grows); slashes and brackets burst out of the
522
522
  // line, code fragments type themselves in the margins, the last word takes the accent. Everything clears at the end.
523
523
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),out=M.ease.inCubic(M.range(t,D-.45,D))
@@ -647,7 +647,7 @@
647
647
  if(k>.001){ctx.save();ctx.globalAlpha=k*(1-out);const b=(1-k)*f.size*.25+out*f.size*.2;if(b>.4)ctx.filter='blur('+b.toFixed(1)+'px)';ctx.fillStyle=col;ctx.fillText(ch,cx-(1-k)*f.size*.3,y+li*f.size*1.02);ctx.restore()}
648
648
  cx+=cw}})
649
649
  ctx.restore()
650
- }`)],Fo=Y.find(t=>t.id==="glow"),bc=(t,e,c,o,n)=>({id:t,name:e,category:Fo.name,pack:"glow",duration:c,params:{accent:Fo.accent,...o,style:"glow"},code:n}),nl=[bc("glow-views-burst","Lượt xem bùng nổ",4,{text:"lượt xem",number:1e6,sub:"views",color:"#eef1f5",position:"center"},`function render(ctx,t,env){
650
+ }`)],_o=Y.find(t=>t.id==="glow"),bc=(t,e,c,o,n)=>({id:t,name:e,category:_o.name,pack:"glow",duration:c,params:{accent:_o.accent,...o,style:"glow"},code:n}),il=[bc("glow-views-burst","Lượt xem bùng nổ",4,{text:"lượt xem",number:1e6,sub:"views",color:"#eef1f5",position:"center"},`function render(ctx,t,env){
651
651
  // Phone cards drift in depth around a counter racing up to the big number; a lit horizon rises behind them.
652
652
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u
653
653
  ctx.save();ctx.globalAlpha=1-k.o
@@ -925,7 +925,7 @@
925
925
  const b=M.ease.outBack(M.range(t,t0+1,t0+1.4));if(b>0){const bs=f.size*1.1,by=ty+f.size*1.4-(1-b)*bs;ctx.save();ctx.globalAlpha*=Math.min(1,b);ctx.strokeStyle=sk.acc;ctx.lineWidth=Math.max(1,bs*.1);ctx.lineJoin='round'
926
926
  ctx.beginPath();ctx.moveTo(S.cx-bs*.35,by);ctx.lineTo(S.cx+bs*.35,by);ctx.lineTo(S.cx+bs*.35,by+bs);ctx.lineTo(S.cx,by+bs*.72);ctx.lineTo(S.cx-bs*.35,by+bs);ctx.closePath();ctx.stroke();ctx.restore()}}
927
927
  ctx.restore()
928
- }`)],Yo=Y.find(t=>t.id==="noir"),Mc=(t,e,c,o,n)=>({id:t,name:e,category:Yo.name,pack:"noir",duration:c,params:{accent:Yo.accent,...o,style:"noir"},code:n}),sl=[Mc("noir-thinker","Người suy tư",3.5,{text:"Kinh doanh khó khăn?",accent2:"#ff2a2a",position:"center"},`function render(ctx,t,env){
928
+ }`)],Qo=Y.find(t=>t.id==="noir"),Mc=(t,e,c,o,n)=>({id:t,name:e,category:Qo.name,pack:"noir",duration:c,params:{accent:Qo.accent,...o,style:"noir"},code:n}),ll=[Mc("noir-thinker","Người suy tư",3.5,{text:"Kinh doanh khó khăn?",accent2:"#ff2a2a",position:"center"},`function render(ctx,t,env){
929
929
  // A suited silhouette with a hand on the chin, rim-lit in the accent, while a red trend line crashes down behind him;
930
930
  // the caption sits across his chest.
931
931
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.3),u=S.u
@@ -1116,7 +1116,7 @@
1116
1116
  M.smear(q,q<.16,(v,am)=>{const sc=1+.3*(1-M.ease.outCubic(M.clamp(v/.16)));ctx.save();ctx.globalAlpha*=am*M.clamp(v*14+.2);ctx.translate(S.cx,S.y);ctx.scale(sc,sc)
1117
1117
  M.glowText(ctx,sk,chunks[i],0,0,u*(S.port?.13:.12),S.w*.9,2,{fill:last?'#ffffff':sk.fill});ctx.restore()})
1118
1118
  ctx.restore()
1119
- }`)],_o=Y.find(t=>t.id==="pop"),yc=(t,e,c,o,n)=>({id:t,name:e,category:_o.name,pack:"pop",duration:c,params:{accent:_o.accent,...o,style:"pop"},code:n}),il=[yc("pop-keyword","Từ khoá đỏ",3,{text:"Bạn đã có ý tưởng và nội dung",sub:"tăng trưởng",bg:"paper",color:"#151515",position:"center"},`function render(ctx,t,env){
1119
+ }`)],Zo=Y.find(t=>t.id==="pop"),yc=(t,e,c,o,n)=>({id:t,name:e,category:Zo.name,pack:"pop",duration:c,params:{accent:Zo.accent,...o,style:"pop"},code:n}),rl=[yc("pop-keyword","Từ khoá đỏ",3,{text:"Bạn đã có ý tưởng và nội dung",sub:"tăng trưởng",bg:"paper",color:"#151515",position:"center"},`function render(ctx,t,env){
1120
1120
  // Lead words arrive one by one (grey → ink), the keyword punches in big and red, a red bar swipes under it; a small
1121
1121
  // barcode sits in the corner like a print tag.
1122
1122
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.25,.3),u=S.u
@@ -1268,7 +1268,7 @@
1268
1268
  ctx.restore()
1269
1269
  M.editorial(ctx,sk,p.text,p.sub,S.cx,S.port?S.top+u*.25:S.top+u*.17,u*(S.port?.12:.1),S.w*.9,t,.2)
1270
1270
  ctx.restore()
1271
- }`)],Qo=Y.find(t=>t.id==="illus"),wc=(t,e,c,o,n)=>({id:t,name:e,category:Qo.name,pack:"illus",duration:c,glyph:!0,params:{accent:Qo.accent,...o,style:"illus"},code:n}),ll=[wc("illus-icon-pop","Icon nảy + nhãn",3,{glyph:"rocket",text:"Ra mắt sản phẩm",sub:"",position:"center"},`function render(ctx,t,env){
1271
+ }`)],Jo=Y.find(t=>t.id==="illus"),wc=(t,e,c,o,n)=>({id:t,name:e,category:Jo.name,pack:"illus",duration:c,glyph:!0,params:{accent:Jo.accent,...o,style:"illus"},code:n}),xl=[wc("illus-icon-pop","Icon nảy + nhãn",3,{glyph:"rocket",text:"Ra mắt sản phẩm",sub:"",position:"center"},`function render(ctx,t,env){
1272
1272
  // One big glowing icon draws itself on and springs in on a soft halo; sparks fly off; the label slides up under it.
1273
1273
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35)
1274
1274
  const s=S.u*.24,pop=M.spring(M.range(t,0,1.3),{freq:1.3,damp:5}),draw=M.ease.outCubic(M.range(t,.05,.8)),y=S.y-S.u*.07
@@ -1428,7 +1428,7 @@
1428
1428
  const by=ey-h/2;ctx.save();ctx.globalAlpha*=e;ctx.translate((1-e)*(left?-1:1)*u*.03,0)
1429
1429
  M.glass(ctx,bx,by,w,h,h*.3,{rim:.6});M.glyph(ctx,p.glyph,bx+h*.6,ey,h*.55,{color:sk.acc,draw:M.range(t,.6,1.1)})
1430
1430
  ctx.textAlign='left';M.ink(ctx,sk,f.lines[0]||'',bx+h*1.1,ey,f.size);ctx.restore()
1431
- }`)],Zo=Y.find(t=>t.id==="creator"),Jt=(t,e,c,o,n)=>({id:t,name:e,category:Zo.name,pack:"creator",duration:c,params:{accent:Zo.accent,...o,style:"creator"},code:n}),rl=[Jt("creator-icon-row","Hàng icon nền tảng",4.5,{items:"play|loop|note",sub:"*,0,1,2",position:"lower"},`function render(ctx,t,env){
1431
+ }`)],tn=Y.find(t=>t.id==="creator"),Jt=(t,e,c,o,n)=>({id:t,name:e,category:tn.name,pack:"creator",duration:c,params:{accent:tn.accent,...o,style:"creator"},code:n}),hl=[Jt("creator-icon-row","Hàng icon nền tảng",4.5,{items:"play|loop|note",sub:"*,0,1,2",position:"lower"},`function render(ctx,t,env){
1432
1432
  // Icon row under a caption: three platform-style app icons (generic glyphs: play tile, loop, note — or any glyph
1433
1433
  // name) pop in one by one, then the ACTIVE one (sub = a list of beats, * = all lit, 0/1/2 = that icon) grows and
1434
1434
  // glows while the others dim, and the row slides so the active icon is centred; the beats share the clip evenly.
@@ -1766,7 +1766,7 @@
1766
1766
  const f=M.fit(ctx,txt,z=>sk.font(z,'s'),qs,mw,2);ctx.save();ctx.globalAlpha*=a;ctx.font=f.font;ctx.fillStyle='rgba(255,255,255,.88)';f.lines.forEach((ln,j)=>ctx.fillText(ln,x0,y0+ts*2.15+i*qs*1.9+j*f.lh+(1-a)*qs*.5));ctx.restore()})
1767
1767
  if(wipe){const w=M.ease.inOutCubic(M.range(t,D-.7,D));if(w>0){ctx.fillStyle='rgba(255,255,255,'+w.toFixed(3)+')';ctx.fillRect(0,0,W,H)}}
1768
1768
  ctx.restore()
1769
- }`)],xl=["talking-head","course","explainer"],te=(t,e=["bold"],c="high",o=[])=>Object.freeze({videoType:[...xl,...o],role:t,style:e,energy:c,orientation:["any"]}),hl={"creator-icon-row":te(["social","list","explain"]),"creator-phone-duo":te(["compare","explain"],["bold","tech"]),"creator-watch-chart":te(["stat","explain"],["tech"]),"creator-scrub-bar":te(["stat","overlay"],["tech","minimal"],"medium"),"creator-dot-list":te(["list","step"],["clean"],"medium"),"creator-offer-card":te(["cta","stat"],["bold","tech"],"high",["affiliate"]),"creator-notify-stack":te(["social","proof"],["tech"],"high",["affiliate"]),"creator-message-chip":te(["social","cta"],["tech","clean"],"medium",["affiliate","podcast"]),"creator-thumb-wall":te(["social","proof","stat"]),"creator-wave-mismatch":te(["compare","explain"],["tech"]),"creator-layout-box":te(["compare","explain"],["tech","minimal"],"medium"),"creator-glass-shatter":te(["explain","transition"]),"creator-reaction-pop":te(["social","sticker","overlay"],["playful","bold"]),"creator-pill-caption":te(["caption","title"],["tech","clean"],"medium"),"creator-chapter-bar":te(["chapter","transition","title"]),"creator-quote-end":te(["quote","outro","cta"])},fl=rl.map(t=>({...t,tags:hl[t.id]})),Jo=Y.find(t=>t.id==="creator"),sc=(t,e,c,o,n)=>({id:t,name:e,category:Jo.name,pack:"creator",duration:c,params:{accent:Jo.accent,...o,style:"creator"},code:n}),pl=[sc("creator-behind-title","Chữ lớn sau người",3.5,{text:"Không nghi ngờ",sub:"2025",from:2023,position:"top"},`function render(ctx,t,env){
1769
+ }`)],fl=["talking-head","course","explainer"],te=(t,e=["bold"],c="high",o=[])=>Object.freeze({videoType:[...fl,...o],role:t,style:e,energy:c,orientation:["any"]}),pl={"creator-icon-row":te(["social","list","explain"]),"creator-phone-duo":te(["compare","explain"],["bold","tech"]),"creator-watch-chart":te(["stat","explain"],["tech"]),"creator-scrub-bar":te(["stat","overlay"],["tech","minimal"],"medium"),"creator-dot-list":te(["list","step"],["clean"],"medium"),"creator-offer-card":te(["cta","stat"],["bold","tech"],"high",["affiliate"]),"creator-notify-stack":te(["social","proof"],["tech"],"high",["affiliate"]),"creator-message-chip":te(["social","cta"],["tech","clean"],"medium",["affiliate","podcast"]),"creator-thumb-wall":te(["social","proof","stat"]),"creator-wave-mismatch":te(["compare","explain"],["tech"]),"creator-layout-box":te(["compare","explain"],["tech","minimal"],"medium"),"creator-glass-shatter":te(["explain","transition"]),"creator-reaction-pop":te(["social","sticker","overlay"],["playful","bold"]),"creator-pill-caption":te(["caption","title"],["tech","clean"],"medium"),"creator-chapter-bar":te(["chapter","transition","title"]),"creator-quote-end":te(["quote","outro","cta"])},dl=hl.map(t=>({...t,tags:pl[t.id]})),en=Y.find(t=>t.id==="creator"),sc=(t,e,c,o,n)=>({id:t,name:e,category:en.name,pack:"creator",duration:c,params:{accent:en.accent,...o,style:"creator"},code:n}),gl=[sc("creator-behind-title","Chữ lớn sau người",3.5,{text:"Không nghi ngờ",sub:"2025",from:2023,position:"top"},`function render(ctx,t,env){
1770
1770
  // A heavy two-tier title meant to sit BEHIND the speaker (placeBehindPerson): the word slams in red with a glow,
1771
1771
  // then the big line (sub) — when it is a number it rolls up from "from" like an odometer, digit by digit.
1772
1772
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.2,.3),u=S.u
@@ -1905,7 +1905,7 @@
1905
1905
  x+=w+6+R()*30}})
1906
1906
  const px=120+1440*((t*.18)%1);ctx.save();ctx.strokeStyle='#ffffff';ctx.lineWidth=2;ctx.shadowColor='#ffffff';ctx.shadowBlur=8;st.line(px,20,px,500);ctx.stroke();ctx.restore()
1907
1907
  ctx.restore()
1908
- }`),...fl],tn=Y.find(t=>t.id==="mono"),mc=(t,e,c,o,n)=>({id:t,name:e,category:tn.name,pack:"mono",duration:c,params:{accent:tn.accent,...o,style:"mono"},code:n}),dl=[mc("mono-grid-paper","Nền giấy kẻ chấm",8,{color:"#e9e9ea"},`function render(ctx,t,env){
1908
+ }`),...dl],cn=Y.find(t=>t.id==="mono"),mc=(t,e,c,o,n)=>({id:t,name:e,category:cn.name,pack:"mono",duration:c,params:{accent:cn.accent,...o,style:"mono"},code:n}),ul=[mc("mono-grid-paper","Nền giấy kẻ chấm",8,{color:"#e9e9ea"},`function render(ctx,t,env){
1909
1909
  // Background: light grey paper with a fine dot grid, a soft vignette and a slow light drift. Full frame, under
1910
1910
  // everything (role background).
1911
1911
  const {width:W,height:H,params:p}=env,u=Math.min(W,H),bg=/^#[0-9a-f]{6}$/i.test(p.color)?p.color:'#e9e9ea'
@@ -2007,7 +2007,7 @@
2007
2007
  const b=M.ease.outCubic(M.range(t,.25,.7));if(main&&b>0){ctx.save();ctx.globalAlpha*=b;ctx.font=mf.font;const ws=main.split(' ');let x=x0;ws.forEach((w,i)=>{ctx.fillStyle=i===ws.length-1?M.mix(sk.fill,'#9a9aa0',.6):sk.fill;ctx.shadowColor='rgba(0,0,0,.18)';ctx.shadowBlur=mf.size*.1;ctx.shadowOffsetY=mf.size*.04;ctx.fillText(w,x,y+(1-b)*mf.size*.2);x+=ctx.measureText(w+' ').width});ctx.restore()}
2008
2008
  const bar=M.ease.outCubic(M.range(t,1,1.5));if(bar>0){ctx.fillStyle=sk.acc;ctx.fillRect(x0,y+mf.size*.7,mw*.25*bar,Math.max(2,u*.006))}
2009
2009
  ctx.restore()
2010
- }`)],en=Y.find(t=>t.id==="ai"),kc=(t,e,c,o,n)=>({id:t,name:e,category:en.name,pack:"ai",duration:c,params:{accent:en.accent,...o,style:"ai"},code:n}),gl=[kc("ai-neural-net","Mạng nơ-ron",4.5,{text:"Mô hình học từ dữ liệu",position:"center"},`function render(ctx,t,env){
2010
+ }`)],an=Y.find(t=>t.id==="ai"),kc=(t,e,c,o,n)=>({id:t,name:e,category:an.name,pack:"ai",duration:c,params:{accent:an.accent,...o,style:"ai"},code:n}),bl=[kc("ai-neural-net","Mạng nơ-ron",4.5,{text:"Mô hình học từ dữ liệu",position:"center"},`function render(ctx,t,env){
2011
2011
  // Layers of nodes wire up left to right, then signals pulse along the edges and the output node lights up.
2012
2012
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u
2013
2013
  const L=[3,5,5,2],w=Math.min(S.w*.86,u*(S.port?.85:1.1)),h=Math.min(u*.5,w*.55),x0=S.cx-w/2,y0=S.y-h/2+u*.03,R=M.rand(9)
@@ -2148,7 +2148,7 @@
2148
2148
  ctx.strokeStyle=M.rgba(sk.acc,.85);ctx.lineWidth=Math.max(1.5,u*.003);ctx.beginPath();for(let j=0;j<=20*q;j++){const s=j/20,x=(1-s)*(1-s)*a[0]+2*(1-s)*s*mx+s*s*b[0],y=(1-s)*(1-s)*a[1]+2*(1-s)*s*my+s*s*b[1];ctx[j?'lineTo':'moveTo'](x,y)}ctx.stroke()}
2149
2149
  ctx.globalAlpha=1-k.o;const f=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.05,S.w*.9,1);if(p.text){ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';M.ink(ctx,sk,f.lines[0]||'',cx,cy+R+f.size*1.1,f.size)}
2150
2150
  ctx.restore()
2151
- }`)],cn=Y.find(t=>t.id==="fin"),Sc=(t,e,c,o,n)=>({id:t,name:e,category:cn.name,pack:"fin",duration:c,params:{accent:cn.accent,accent2:"#ff4d5e",...o,style:"fin"},code:n}),Ca="const A2=/^#[0-9a-f]{6}$/i.test(p.accent2)?p.accent2:'#ff4d5e'",ul=[Sc("fin-candlestick","Biểu đồ nến",5,{text:"VN-INDEX",number:1286,position:"center"},`function render(ctx,t,env){
2151
+ }`)],on=Y.find(t=>t.id==="fin"),Sc=(t,e,c,o,n)=>({id:t,name:e,category:on.name,pack:"fin",duration:c,params:{accent:on.accent,accent2:"#ff4d5e",...o,style:"fin"},code:n}),Ca="const A2=/^#[0-9a-f]{6}$/i.test(p.accent2)?p.accent2:'#ff4d5e'",Ml=[Sc("fin-candlestick","Biểu đồ nến",5,{text:"VN-INDEX",number:1286,position:"center"},`function render(ctx,t,env){
2152
2152
  // Candles print one by one on a glass panel (green up, red down), a price line follows the closes and a live price
2153
2153
  // tag (number) rides the last close; the symbol (text) at the top.
2154
2154
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u;${Ca}
@@ -2281,7 +2281,7 @@
2281
2281
  if(horiz){rx+=cw;rw-=cw}else{ry+=chh;rh-=chh}})
2282
2282
  const tf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.045,S.w*.9,1);if(p.text){ctx.font=tf.font;ctx.textAlign='left';ctx.textBaseline='middle';M.ink(ctx,sk,tf.lines[0]||'',x,y-u*.06,tf.size)}
2283
2283
  ctx.restore()
2284
- }`)],an=Y.find(t=>t.id==="explain"),ee=(t,e,c,o,n)=>({id:t,name:e,category:an.name,pack:"explain",duration:c,params:{accent:an.accent,position:"top",...o,style:"explain"},code:n}),be="const BX=(env,p)=>{const W=env.width,H=env.height,port=H>W*1.1,u=Math.min(W,H),pos=p.position||'top';if(pos==='center')return{x:W*(port?.07:.2),y:H*(port?.2:.1),w:W*(port?.86:.6),h:H*(port?.6:.8),u,port,W,H};if(port)return{x:W*.06,y:H*.06,w:W*.88,h:H*.42,u,port,W,H};return{x:W*.5,y:H*.08,w:W*.44,h:H*.84,u,port,W,H}};const CARD=(c,x,y,w,h,r,acc,a=1)=>{c.save();c.shadowColor=M.rgba(acc,.4*a);c.shadowBlur=r*2;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix(acc,'#16040f',.8));g.addColorStop(1,M.mix(acc,'#0a0207',.9));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowBlur=0;c.strokeStyle=M.rgba(acc,.6);c.lineWidth=Math.max(1,r*.07);c.stroke();c.restore()};const PILL=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const HEAD=(c,sk,s,x,y,z,acc)=>{c.font=sk.font(z,'s','800');c.fillStyle=acc;c.textAlign='left';c.textBaseline='middle';c.beginPath();c.arc(x+z*.25,y,z*.2,0,M.TAU);c.fill();c.fillText(String(s).toUpperCase(),x+z*.8,y)};const HOT=(c,s,x,y,z,acc)=>{c.save();const g=c.createLinearGradient(0,y-z/2,0,y+z/2);g.addColorStop(0,M.mix(acc,'#ffffff',.45));g.addColorStop(1,acc);c.shadowColor=acc;c.shadowBlur=z*.35;c.fillStyle=g;c.fillText(s,x,y);c.shadowBlur=0;c.fillText(s,x,y);c.restore()};",bl=[ee("exp-backdrop","Nền giải thích tím",6,{position:"center"},`function render(ctx,t,env){
2284
+ }`)],nn=Y.find(t=>t.id==="explain"),ee=(t,e,c,o,n)=>({id:t,name:e,category:nn.name,pack:"explain",duration:c,params:{accent:nn.accent,position:"top",...o,style:"explain"},code:n}),be="const BX=(env,p)=>{const W=env.width,H=env.height,port=H>W*1.1,u=Math.min(W,H),pos=p.position||'top';if(pos==='center')return{x:W*(port?.07:.2),y:H*(port?.2:.1),w:W*(port?.86:.6),h:H*(port?.6:.8),u,port,W,H};if(port)return{x:W*.06,y:H*.06,w:W*.88,h:H*.42,u,port,W,H};return{x:W*.5,y:H*.08,w:W*.44,h:H*.84,u,port,W,H}};const CARD=(c,x,y,w,h,r,acc,a=1)=>{c.save();c.shadowColor=M.rgba(acc,.4*a);c.shadowBlur=r*2;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix(acc,'#16040f',.8));g.addColorStop(1,M.mix(acc,'#0a0207',.9));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowBlur=0;c.strokeStyle=M.rgba(acc,.6);c.lineWidth=Math.max(1,r*.07);c.stroke();c.restore()};const PILL=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const HEAD=(c,sk,s,x,y,z,acc)=>{c.font=sk.font(z,'s','800');c.fillStyle=acc;c.textAlign='left';c.textBaseline='middle';c.beginPath();c.arc(x+z*.25,y,z*.2,0,M.TAU);c.fill();c.fillText(String(s).toUpperCase(),x+z*.8,y)};const HOT=(c,s,x,y,z,acc)=>{c.save();const g=c.createLinearGradient(0,y-z/2,0,y+z/2);g.addColorStop(0,M.mix(acc,'#ffffff',.45));g.addColorStop(1,acc);c.shadowColor=acc;c.shadowBlur=z*.35;c.fillStyle=g;c.fillText(s,x,y);c.shadowBlur=0;c.fillText(s,x,y);c.restore()};",yl=[ee("exp-backdrop","Nền giải thích tím",6,{position:"center"},`function render(ctx,t,env){
2285
2285
  // Full-frame plum backdrop: a glow from the top, a slow grid, floating dust and a vignette — under cut-away cards.
2286
2286
  const {width:W,height:H,params:p}=env,sk=M.skin(env,p),u=Math.min(W,H),acc=sk.acc
2287
2287
  const g=ctx.createLinearGradient(0,0,0,H);g.addColorStop(0,M.mix(acc,'#12030e',.72));g.addColorStop(.55,M.mix(acc,'#0b0209',.88));g.addColorStop(1,'#070106');ctx.fillStyle=g;ctx.fillRect(0,0,W,H)
@@ -2497,7 +2497,7 @@
2497
2497
  ctx.textAlign='left';ctx.textBaseline='top';ctx.font=tf.font;ctx.fillStyle='#ffffff';tf.lines.forEach((l,i)=>ctx.fillText(l,x+pad,y+pad*.8+i*tf.size*1.2));if(p.sub){ctx.font=sf.font;ctx.fillStyle=M.mix(sk.acc,'#ffffff',.5);ctx.fillText(sf.lines[0]||'',x+pad,y+pad*.8+tf.lines.length*tf.size*1.2+sf.size*.2)}
2498
2498
  const r=u*.03,bx=x+bw-pad-r,by=y+bh/2+Math.sin(t*6)*r*.12*M.range(t,.6,1);ctx.fillStyle='#ff9a1f';ctx.shadowColor='#ff9a1f';ctx.shadowBlur=r*(.6+.3*Math.sin(t*6));ctx.beginPath();ctx.arc(bx,by,r,0,M.TAU);ctx.fill();ctx.shadowBlur=0;ctx.fillStyle='#ffffff';ctx.beginPath();ctx.ellipse(bx,by-r*.05,r*.5,r*.38,0,0,M.TAU);ctx.fill();ctx.beginPath();ctx.moveTo(bx-r*.2,by+r*.2);ctx.lineTo(bx-r*.35,by+r*.5);ctx.lineTo(bx+r*.05,by+r*.28);ctx.fill()
2499
2499
  ctx.restore()
2500
- }`)],on=Y.find(t=>t.id==="info"),Rt=(t,e,c,o,n)=>({id:t,name:e,category:on.name,pack:"info",duration:c,params:{accent:on.accent,position:"center",...o,style:"info"},code:n}),$t="const PAL=a=>[a,'#f5b800','#16b8d4','#ff5c8a'];const INK='#1d1b2e';const CARD=(c,x,y,w,h,r,a=1)=>{c.save();c.shadowColor='rgba(70,50,140,'+(.2*a)+')';c.shadowBlur=r*2.4;c.shadowOffsetY=r*.7;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const DOTS=(c,x,y,s)=>{c.fillStyle=INK;for(let i=0;i<3;i++){c.beginPath();c.arc(x-i*s*2.4,y,s*.75,0,M.TAU);c.fill()}};",Va=$t+"const KINDS=(p,def)=>{const l=M.items(p,5);return(l.length?l:def).map((s,i)=>{const w=String(s).trim().split(' '),k=w[0],v=parseFloat(w[1]);return{k:['ring','rings','bars','wave','line','hbar'].includes(k)?k:'bars',v:Number.isFinite(v)?v:0,i}})};const MINI=(c,k,w,h,q,v,P,F)=>{const m=Math.min(w,h),R=M.rand(11+Math.round(v)*7+k.length),pad=m*.14,X=pad,Y=pad,iw=w-pad*2,ih=h-pad*2;c.save();c.lineCap='round';c.lineJoin='round';c.textAlign='center';c.textBaseline='middle';if(k==='ring'){const r=m*.3,cx=w/2,cy=h/2+m*.03,pct=v>0?Math.min(100,v):72;c.lineWidth=m*.05;c.strokeStyle='#ece9f5';c.beginPath();c.arc(cx,cy,r,0,M.TAU);c.stroke();c.strokeStyle=P[0];c.beginPath();c.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*q*pct/100);c.stroke();c.strokeStyle=P[1];c.lineWidth=m*.016;c.beginPath();c.arc(cx,cy,r*1.25,-Math.PI/2+.4,-Math.PI/2+.4+M.TAU*q*.3);c.stroke();c.fillStyle=INK;c.font=F(m*.17,'800');c.fillText(Math.round(q*pct)+'%',cx,cy)}else if(k==='rings'){for(let i=0;i<3;i++){const cx=w*(.22+i*.28),cy=h/2+m*.03,r=m*.14,val=Math.round((v||12)*(.55+i*.25));c.lineWidth=m*.035;c.strokeStyle='#ece9f5';c.beginPath();c.arc(cx,cy,r,0,M.TAU);c.stroke();c.strokeStyle=P[(i+2)%4];c.beginPath();c.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*q*(.45+.2*i));c.stroke();c.fillStyle=INK;c.font=F(m*.1,'800');c.fillText(Math.round(val*q),cx,cy)}}else if(k==='bars'){const n=12,bw=iw/n*.5;for(let i=0;i<n;i++){const bx=X+iw*(i+.25)/n,hh=ih*.8*(.2+.75*R())*q;c.fillStyle='#efedf6';c.fillRect(bx,Y,bw,ih*.8);c.fillStyle=P[[1,2,0][i%3]];c.fillRect(bx,Y+ih*.8-hh,bw,hh)}c.strokeStyle=INK;c.lineWidth=Math.max(1,m*.008);c.beginPath();c.moveTo(X,Y+ih*.8);c.lineTo(X+iw,Y+ih*.8);c.stroke();c.fillStyle=INK;c.font=F(m*.05,'800');for(let i=0;i<n;i+=2)c.fillText(String(i+1).padStart(2,'0'),X+iw*(i+.5)/n,Y+ih*.92)}else if(k==='wave'){[1,0].forEach(j=>{c.beginPath();c.moveTo(X,Y+ih);for(let i=0;i<=40;i++){const s=i/40;if(s>q)break;c.lineTo(X+iw*s,Y+ih-ih*(.2+.6*Math.pow(Math.sin(s*Math.PI*(1.3+j*.6)+j*.9+v*.2),2))*(j?.75:1))}c.lineTo(X+iw*Math.min(1,q),Y+ih);c.closePath();c.fillStyle=M.rgba(P[j],.92);c.fill()});c.fillStyle=INK;c.fillRect(X,Y+ih,iw,Math.max(1,m*.006))}else if(k==='line'){[0,1].forEach(j=>{c.beginPath();for(let i=0;i<=40;i++){const s=i/40;if(s>q)break;const yy=Y+ih*(.5-.3*Math.sin(s*Math.PI*1.8+j*1.9+v*.3));if(i)c.lineTo(X+iw*s,yy);else c.moveTo(X+iw*s,yy)}c.setLineDash(j?[m*.035,m*.03]:[]);c.strokeStyle=P[j];c.lineWidth=m*.03;c.stroke()});c.setLineDash([]);c.fillStyle=INK;for(let i=0;i<4;i++){c.beginPath();c.arc(X+iw*R(),Y+ih*R(),m*.012,0,M.TAU);c.fill()}}else{for(let i=0;i<5;i++){const ww=iw*(.3+.65*R())*q,yy=Y+ih*(.12+i*.19);c.strokeStyle=P[[2,1,0][i%3]];c.lineWidth=m*.028;c.beginPath();c.moveTo(X,yy+ih*.05);c.lineTo(X+ww,yy-ih*.04);c.stroke()}}c.restore()};",Ml=[Rt("info-backdrop","Nền oải hương",6,{},`function render(ctx,t,env){
2500
+ }`)],sn=Y.find(t=>t.id==="info"),Rt=(t,e,c,o,n)=>({id:t,name:e,category:sn.name,pack:"info",duration:c,params:{accent:sn.accent,position:"center",...o,style:"info"},code:n}),$t="const PAL=a=>[a,'#f5b800','#16b8d4','#ff5c8a'];const INK='#1d1b2e';const CARD=(c,x,y,w,h,r,a=1)=>{c.save();c.shadowColor='rgba(70,50,140,'+(.2*a)+')';c.shadowBlur=r*2.4;c.shadowOffsetY=r*.7;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const DOTS=(c,x,y,s)=>{c.fillStyle=INK;for(let i=0;i<3;i++){c.beginPath();c.arc(x-i*s*2.4,y,s*.75,0,M.TAU);c.fill()}};",Va=$t+"const KINDS=(p,def)=>{const l=M.items(p,5);return(l.length?l:def).map((s,i)=>{const w=String(s).trim().split(' '),k=w[0],v=parseFloat(w[1]);return{k:['ring','rings','bars','wave','line','hbar'].includes(k)?k:'bars',v:Number.isFinite(v)?v:0,i}})};const MINI=(c,k,w,h,q,v,P,F)=>{const m=Math.min(w,h),R=M.rand(11+Math.round(v)*7+k.length),pad=m*.14,X=pad,Y=pad,iw=w-pad*2,ih=h-pad*2;c.save();c.lineCap='round';c.lineJoin='round';c.textAlign='center';c.textBaseline='middle';if(k==='ring'){const r=m*.3,cx=w/2,cy=h/2+m*.03,pct=v>0?Math.min(100,v):72;c.lineWidth=m*.05;c.strokeStyle='#ece9f5';c.beginPath();c.arc(cx,cy,r,0,M.TAU);c.stroke();c.strokeStyle=P[0];c.beginPath();c.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*q*pct/100);c.stroke();c.strokeStyle=P[1];c.lineWidth=m*.016;c.beginPath();c.arc(cx,cy,r*1.25,-Math.PI/2+.4,-Math.PI/2+.4+M.TAU*q*.3);c.stroke();c.fillStyle=INK;c.font=F(m*.17,'800');c.fillText(Math.round(q*pct)+'%',cx,cy)}else if(k==='rings'){for(let i=0;i<3;i++){const cx=w*(.22+i*.28),cy=h/2+m*.03,r=m*.14,val=Math.round((v||12)*(.55+i*.25));c.lineWidth=m*.035;c.strokeStyle='#ece9f5';c.beginPath();c.arc(cx,cy,r,0,M.TAU);c.stroke();c.strokeStyle=P[(i+2)%4];c.beginPath();c.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*q*(.45+.2*i));c.stroke();c.fillStyle=INK;c.font=F(m*.1,'800');c.fillText(Math.round(val*q),cx,cy)}}else if(k==='bars'){const n=12,bw=iw/n*.5;for(let i=0;i<n;i++){const bx=X+iw*(i+.25)/n,hh=ih*.8*(.2+.75*R())*q;c.fillStyle='#efedf6';c.fillRect(bx,Y,bw,ih*.8);c.fillStyle=P[[1,2,0][i%3]];c.fillRect(bx,Y+ih*.8-hh,bw,hh)}c.strokeStyle=INK;c.lineWidth=Math.max(1,m*.008);c.beginPath();c.moveTo(X,Y+ih*.8);c.lineTo(X+iw,Y+ih*.8);c.stroke();c.fillStyle=INK;c.font=F(m*.05,'800');for(let i=0;i<n;i+=2)c.fillText(String(i+1).padStart(2,'0'),X+iw*(i+.5)/n,Y+ih*.92)}else if(k==='wave'){[1,0].forEach(j=>{c.beginPath();c.moveTo(X,Y+ih);for(let i=0;i<=40;i++){const s=i/40;if(s>q)break;c.lineTo(X+iw*s,Y+ih-ih*(.2+.6*Math.pow(Math.sin(s*Math.PI*(1.3+j*.6)+j*.9+v*.2),2))*(j?.75:1))}c.lineTo(X+iw*Math.min(1,q),Y+ih);c.closePath();c.fillStyle=M.rgba(P[j],.92);c.fill()});c.fillStyle=INK;c.fillRect(X,Y+ih,iw,Math.max(1,m*.006))}else if(k==='line'){[0,1].forEach(j=>{c.beginPath();for(let i=0;i<=40;i++){const s=i/40;if(s>q)break;const yy=Y+ih*(.5-.3*Math.sin(s*Math.PI*1.8+j*1.9+v*.3));if(i)c.lineTo(X+iw*s,yy);else c.moveTo(X+iw*s,yy)}c.setLineDash(j?[m*.035,m*.03]:[]);c.strokeStyle=P[j];c.lineWidth=m*.03;c.stroke()});c.setLineDash([]);c.fillStyle=INK;for(let i=0;i<4;i++){c.beginPath();c.arc(X+iw*R(),Y+ih*R(),m*.012,0,M.TAU);c.fill()}}else{for(let i=0;i<5;i++){const ww=iw*(.3+.65*R())*q,yy=Y+ih*(.12+i*.19);c.strokeStyle=P[[2,1,0][i%3]];c.lineWidth=m*.028;c.beginPath();c.moveTo(X,yy+ih*.05);c.lineTo(X+ww,yy-ih*.04);c.stroke()}}c.restore()};",wl=[Rt("info-backdrop","Nền oải hương",6,{},`function render(ctx,t,env){
2501
2501
  // Full-frame light backdrop: pale grey-white top fading into lilac / periwinkle at the bottom, a slow soft light.
2502
2502
  const {width:W,height:H,params:p}=env,sk=M.skin(env,p),u=Math.min(W,H),acc=sk.acc
2503
2503
  const g=ctx.createLinearGradient(0,0,W*.3,H);g.addColorStop(0,'#eef0f6');g.addColorStop(.45,M.mix(acc,'#e9e8f4',.88));g.addColorStop(1,M.mix(acc,'#7b78d6',.55));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)
@@ -2757,7 +2757,7 @@
2757
2757
  const parts=String(s).trim().split(' '),yr=parts.shift()||'',cap=parts.join(' ');ctx.save();ctx.beginPath();ctx.rect(x-w/2,y,w,h);ctx.clip();ctx.translate(x,y+h/2);ctx.scale(Math.max(.15,face),1);ctx.textAlign='center';ctx.textBaseline='middle'
2758
2758
  ctx.font=sk.font(ch*.3*sc,'n','800');ctx.fillStyle=Pl[0];ctx.fillText(yr,0,-h*.12);const cf=M.fit(ctx,cap,z2=>sk.font(z2,'s','700'),ch*.13*sc,cw*sc*.85,1);ctx.font=cf.font;ctx.fillStyle=INK;ctx.fillText(cf.lines[0]||'',0,h*.2);ctx.restore();ctx.restore()})
2759
2759
  ctx.restore()
2760
- }`)],nn=Y.find(t=>t.id==="cyber"),qt=(t,e,c,o,n)=>({id:t,name:e,category:nn.name,pack:"cyber",duration:c,params:{accent:nn.accent,position:"center",...o,style:"cyber"},code:n}),It="const V='#6b4dff',G='#3dff9a',PK='#ff4fd8';const NEON=(c,col,w,draw,glow=1)=>{c.save();c.strokeStyle=col;c.lineWidth=w;c.lineCap='round';c.lineJoin='round';c.shadowColor=col;c.shadowBlur=w*6*glow;draw();c.stroke();c.shadowBlur=0;c.strokeStyle=M.mix(col,'#ffffff',.55);c.lineWidth=w*.45;draw();c.stroke();c.restore()};const GRAD=(c,x0,y0,x1,y1,acc)=>{const g=c.createLinearGradient(x0,y0,x1,y1);g.addColorStop(0,acc);g.addColorStop(1,G);return g};const SQ=(c,x,y,s,col,a=1)=>{c.save();c.globalAlpha*=a;c.fillStyle=col;c.shadowColor=col;c.shadowBlur=s*2;c.fillRect(x-s/2,y-s/2,s,s);c.restore()};",yl=[qt("cyber-backdrop","Nền đêm tím than",6,{},`function render(ctx,t,env){
2760
+ }`)],ln=Y.find(t=>t.id==="cyber"),qt=(t,e,c,o,n)=>({id:t,name:e,category:ln.name,pack:"cyber",duration:c,params:{accent:ln.accent,position:"center",...o,style:"cyber"},code:n}),It="const V='#6b4dff',G='#3dff9a',PK='#ff4fd8';const NEON=(c,col,w,draw,glow=1)=>{c.save();c.strokeStyle=col;c.lineWidth=w;c.lineCap='round';c.lineJoin='round';c.shadowColor=col;c.shadowBlur=w*6*glow;draw();c.stroke();c.shadowBlur=0;c.strokeStyle=M.mix(col,'#ffffff',.55);c.lineWidth=w*.45;draw();c.stroke();c.restore()};const GRAD=(c,x0,y0,x1,y1,acc)=>{const g=c.createLinearGradient(x0,y0,x1,y1);g.addColorStop(0,acc);g.addColorStop(1,G);return g};const SQ=(c,x,y,s,col,a=1)=>{c.save();c.globalAlpha*=a;c.fillStyle=col;c.shadowColor=col;c.shadowBlur=s*2;c.fillRect(x-s/2,y-s/2,s,s);c.restore()};",ml=[qt("cyber-backdrop","Nền đêm tím than",6,{},`function render(ctx,t,env){
2761
2761
  // Full-frame deep navy-violet night with a faint dot grid, a slow violet glow and a vignette.
2762
2762
  const {width:W,height:H,params:p}=env,sk=M.skin(env,p),u=Math.min(W,H)
2763
2763
  const g=ctx.createLinearGradient(0,0,0,H);g.addColorStop(0,'#0e0733');g.addColorStop(1,'#07031c');ctx.fillStyle=g;ctx.fillRect(0,0,W,H)
@@ -3005,7 +3005,7 @@
3005
3005
  const run=(t*.5)%1;ctx.fillStyle=acc;ctx.shadowColor=acc;ctx.shadowBlur=u*.01;ctx.fillRect(gx+bw*run,y+bh-2,bw*.15,2);ctx.shadowBlur=0
3006
3006
  ctx.textAlign='left';ctx.textBaseline='middle';ctx.font=tf.font;ctx.fillStyle='#ffffff';ctx.fillText(tf.lines[0]||'',gx+u*.03,y+bh*.38);ctx.font=sf.font;ctx.fillStyle=acc;ctx.fillText(sf.lines[0]||'',gx+u*.03,y+bh*.74);ctx.restore()
3007
3007
  ctx.restore()
3008
- }`)],sn=Y.find(t=>t.id==="kinetic"),it=(t,e,c,o,n)=>({id:t,name:e,category:sn.name,pack:"kinetic",duration:c,params:{accent:sn.accent,position:"center",...o,style:"kinetic"},code:n}),bt="const HF=(sk,z)=>sk.font(z,'h'),LF=(sk,z)=>sk.font(z,'s','600');const LITE=(c,s,x,y)=>{c.save();c.fillStyle='#ffffff';c.shadowColor='rgba(0,0,0,.45)';c.shadowBlur=8;c.fillText(s,x,y);c.restore()};const HERO=(c,s,x,y,acc)=>{c.save();c.fillStyle=acc;c.shadowColor='rgba(0,0,0,.35)';c.shadowBlur=10;c.shadowOffsetY=3;c.fillText(s,x,y);c.restore()};const LETTERS=(c,s,fn)=>{const cs=[...s],ws=cs.map(ch=>c.measureText(ch).width),tot=ws.reduce((a,b)=>a+b,0)||1;let run=0;c.textAlign='center';c.textBaseline='middle';cs.forEach((ch,i)=>{const mid=(run+ws[i]/2)/tot;run+=ws[i];const q=fn(mid,i,ws[i],tot);if(!q||q.a<=0)return;c.save();c.globalAlpha*=q.a===undefined?1:q.a;c.translate(q.x,q.y);c.rotate(q.r||0);c.scale(q.sx||q.s||1,q.s||1);c.fillText(ch,0,0);c.restore()})};const RIB=(c,pts,w,acc)=>{if(pts.length<2)return;const g=c.createLinearGradient(pts[0][0],pts[0][1],pts.at(-1)[0],pts.at(-1)[1]);g.addColorStop(0,acc);g.addColorStop(.55,'#e0247a');g.addColorStop(1,'#5b3cff');c.save();c.strokeStyle=g;c.lineWidth=w;c.lineCap='round';c.lineJoin='round';c.shadowColor='#e0247a';c.shadowBlur=w*1.5;c.beginPath();pts.forEach((q,i)=>i?c.lineTo(q[0],q[1]):c.moveTo(q[0],q[1]));c.stroke();c.restore()};",ln=`
3008
+ }`)],rn=Y.find(t=>t.id==="kinetic"),it=(t,e,c,o,n)=>({id:t,name:e,category:rn.name,pack:"kinetic",duration:c,params:{accent:rn.accent,position:"center",...o,style:"kinetic"},code:n}),bt="const HF=(sk,z)=>sk.font(z,'h'),LF=(sk,z)=>sk.font(z,'s','600');const LITE=(c,s,x,y)=>{c.save();c.fillStyle='#ffffff';c.shadowColor='rgba(0,0,0,.45)';c.shadowBlur=8;c.fillText(s,x,y);c.restore()};const HERO=(c,s,x,y,acc)=>{c.save();c.fillStyle=acc;c.shadowColor='rgba(0,0,0,.35)';c.shadowBlur=10;c.shadowOffsetY=3;c.fillText(s,x,y);c.restore()};const LETTERS=(c,s,fn)=>{const cs=[...s],ws=cs.map(ch=>c.measureText(ch).width),tot=ws.reduce((a,b)=>a+b,0)||1;let run=0;c.textAlign='center';c.textBaseline='middle';cs.forEach((ch,i)=>{const mid=(run+ws[i]/2)/tot;run+=ws[i];const q=fn(mid,i,ws[i],tot);if(!q||q.a<=0)return;c.save();c.globalAlpha*=q.a===undefined?1:q.a;c.translate(q.x,q.y);c.rotate(q.r||0);c.scale(q.sx||q.s||1,q.s||1);c.fillText(ch,0,0);c.restore()})};const RIB=(c,pts,w,acc)=>{if(pts.length<2)return;const g=c.createLinearGradient(pts[0][0],pts[0][1],pts.at(-1)[0],pts.at(-1)[1]);g.addColorStop(0,acc);g.addColorStop(.55,'#e0247a');g.addColorStop(1,'#5b3cff');c.save();c.strokeStyle=g;c.lineWidth=w;c.lineCap='round';c.lineJoin='round';c.shadowColor='#e0247a';c.shadowBlur=w*1.5;c.beginPath();pts.forEach((q,i)=>i?c.lineTo(q[0],q[1]):c.moveTo(q[0],q[1]));c.stroke();c.restore()};",xn=`
3009
3009
  const {duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,W=S.W,H=S.H,acc=sk.acc,io=Math.max(.04,Math.min(.6,+p.io||.16)),NB=8
3010
3010
  const dirs={left:[-1,0],right:[1,0],up:[0,-1],down:[0,1]},E=M.ease.inOutCubic,pi=M.range(t,0,io),po=M.range(t,D-io,D),dk=p.dark!==false&&p.dark!=='false'
3011
3011
  if((p.in==='glitch'&&pi<.5)||(p.out==='glitch'&&po>=.5))return
@@ -3022,7 +3022,7 @@
3022
3022
  ;['#ff5f57','#febc2e','#28c840'].forEach((c,i)=>{G.fillStyle=c;G.beginPath();G.arc(bx+bw*.04+i*bw*.035,by+bh*.065,bw*.011,0,7);G.fill()})
3023
3023
  G.fillStyle=ink;G.font=sk.font(bh*.065,'s','600');G.textAlign='center';G.textBaseline='middle';G.fillText(title,S.cx,by+bh*.066)}
3024
3024
  const cursor=(x,y)=>{G.save();G.translate(x,y);G.fillStyle='#ffffff';G.strokeStyle='#000000';G.lineWidth=u*.002;G.beginPath();G.moveTo(0,0);G.lineTo(0,u*.05);G.lineTo(u*.013,u*.038);G.lineTo(u*.03,u*.034);G.closePath();G.fill();G.stroke();G.restore()}
3025
- `,rn=[it("kin-word-collage","Cụm chữ nhảy theo nhịp",5,{items:"xây|!bản dựng|đầu tiên|thêm|!tiêu đề"},`function render(ctx,t,env){
3025
+ `,hn=[it("kin-word-collage","Cụm chữ nhảy theo nhịp",5,{items:"xây|!bản dựng|đầu tiên|thêm|!tiêu đề"},`function render(ctx,t,env){
3026
3026
  ${bt}
3027
3027
  // Words land one per beat into a loose collage (items; a word starting with ! is a HERO — huge heavy red, tilted a
3028
3028
  // touch — the others small white): heroes slam down from big, light words rise in.
@@ -3360,7 +3360,7 @@
3360
3360
  const {params:p}=env,S=M.safe(env,'center'),W=S.W,H=S.H,u=S.u,a=Math.max(0,Math.min(1,+p.amount||.5)),R=M.rand(Math.floor(t*24)+9)
3361
3361
  for(let i=0;i<900*a;i++){const l=R()<.5;ctx.fillStyle=l?'rgba(255,255,255,'+(.05+R()*.07)*a*2+')':'rgba(0,0,0,'+(.06+R()*.08)*a*2+')';const s=u*.0016*(1+R()*1.5);ctx.fillRect(R()*W,R()*H,s,s)}
3362
3362
  const v=ctx.createRadialGradient(W/2,H/2,Math.min(W,H)*.42,W/2,H/2,Math.max(W,H)*.78);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,'+.38*a+')');ctx.fillStyle=v;ctx.fillRect(0,0,W,H)
3363
- }`),it("kin-el","Minh hoạ giao diện (Kinetic Edit)",2,{el:"timeline",label:"After Effects",in:"zoom",out:"left",io:.16,dark:!0},`function render(G,t,env){${ln} const el=()=>{const k=String(p.el||'timeline');G.textAlign='center';G.textBaseline='middle'
3363
+ }`),it("kin-el","Minh hoạ giao diện (Kinetic Edit)",2,{el:"timeline",label:"After Effects",in:"zoom",out:"left",io:.16,dark:!0},`function render(G,t,env){${xn} const el=()=>{const k=String(p.el||'timeline');G.textAlign='center';G.textBaseline='middle'
3364
3364
  if(k==='timeline'){panel(lab);const cols=[acc,'#ff9f1c','#3d8bff','#b06cff'];for(let r=0;r<4;r++){const y=by+bh*(.24+r*.18),g=M.ease.outExpo(M.range(lt,.1+r*.08,.6+r*.08));G.fillStyle=line;G.fillRect(bx+bw*.05,y-bh*.05,bw*.2,bh*.1);G.fillStyle=cols[r];M.rr(G,bx+bw*(.3+r*.05),y-bh*.045,bw*(.5-r*.06)*g,bh*.09,bh*.03);G.fill()
3365
3365
  for(let j=0;j<3;j++){const kq=M.range(lt,.5+r*.1+j*.08,.62+r*.1+j*.08);if(kq>0){G.save();G.translate(bx+bw*(.33+j*.17+r*.03),y);G.rotate(.785);G.scale(kq,kq);G.fillStyle=ink;G.fillRect(-bh*.022,-bh*.022,bh*.044,bh*.044);G.restore()}}}
3366
3366
  const ph=bx+bw*(.3+.6*M.range(lt,.2,D));G.fillStyle=acc;G.fillRect(ph-1,by+bh*.15,2,bh*.8);cursor(bx+bw*(.62+.18*Math.sin(lt*2)),by+bh*.62)}
@@ -3380,7 +3380,7 @@
3380
3380
  const draw=(q,band)=>{G.save();if(band!=null){G.beginPath();G.rect(0,band*H/NB,W,H/NB+1);G.clip()}G.globalAlpha=q.a;G.translate(W/2+q.dx,H/2+q.dy);G.scale(q.s,q.s);G.translate(-W/2,-H/2);const g=M.ease.outExpo(M.range(lt,0,.45));G.translate(0,(1-g)*u*.06);G.globalAlpha*=Math.min(1,g*1.5);el();G.restore()}
3381
3381
  if((p.in==='strips'&&pi<1)||(p.out==='strips'&&po>0)){for(let b=0;b<NB;b++)draw(pose(b),b);return}
3382
3382
  draw(pose(0))
3383
- }`),it("kin-el2","Minh hoạ số liệu (Kinetic Edit)",2,{el:"chart",label:"Doanh thu",glyph:"sparkle",in:"zoom",out:"left",io:.16,dark:!0},`function render(G,t,env){${ln} const el=()=>{const k=String(p.el||'chart');G.textAlign='center';G.textBaseline='middle'
3383
+ }`),it("kin-el2","Minh hoạ số liệu (Kinetic Edit)",2,{el:"chart",label:"Doanh thu",glyph:"sparkle",in:"zoom",out:"left",io:.16,dark:!0},`function render(G,t,env){${xn} const el=()=>{const k=String(p.el||'chart');G.textAlign='center';G.textBaseline='middle'
3384
3384
  if(k==='photo'){const r=bh*.6*q0,cx=S.cx,cy=by+bh*.42,bob=Math.sin(lt*2)*u*.008;G.fillStyle=M.rgba(acc,dk?.18:.14);G.beginPath();G.arc(cx,cy+bob,r*1.02,0,7);G.fill()
3385
3385
  G.strokeStyle=M.rgba(acc,.7);G.lineWidth=u*.004;G.beginPath();G.arc(cx,cy+bob,r*1.1,-1.57,-1.57+6.283*M.range(lt,.05,.6));G.stroke()
3386
3386
  if(!M.photo(G,p.photo,cx,cy+bob,r*2.15,{rot:(1-q0)*-.4+Math.sin(lt*1.4)*.04}))M.glyph(G,String(p.glyph||'sparkle'),cx,cy,r*1.3,{color:acc,draw:M.range(lt,.1,.75),width:2.2})
@@ -3437,12 +3437,12 @@
3437
3437
  box(s0?L(s0,COV,e):COV,s0?1:e);return}
3438
3438
  const e=E((q-.5)/.5);if(!dst){box(COV,1-e);return}
3439
3439
  box(L(COV,dst,e),1-M.range(e,.82,1))
3440
- }`)];for(const t of rn)t.id==="kin-beat"&&delete t.params.position;const xn=Y.find(t=>t.id==="studio"),Gt=(t,e,c,o,n)=>({id:t,name:e,category:xn.name,pack:"studio",duration:c,params:{accent:xn.accent,bg:"studio",...o,style:"studio"},code:n}),jt=`const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,H>W*1.1?'center':p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u,dr=M.ease.inOutCubic(M.range(t,0,D))
3440
+ }`)];for(const t of hn)t.id==="kin-beat"&&delete t.params.position;const fn=Y.find(t=>t.id==="studio"),Gt=(t,e,c,o,n)=>({id:t,name:e,category:fn.name,pack:"studio",duration:c,params:{accent:fn.accent,bg:"studio",...o,style:"studio"},code:n}),jt=`const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,H>W*1.1?'center':p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u,dr=M.ease.inOutCubic(M.range(t,0,D))
3441
3441
  M.backdrop(ctx,env,p.bg)
3442
3442
  // Headline over a soft dark band so it always reads on top of the workspace.
3443
3443
  const head=(t0)=>{const hy=S.port?S.top+u*.14:S.top+u*.08,bh=hy+u*(S.port?.2:.13),g=ctx.createLinearGradient(0,0,0,bh);g.addColorStop(0,'rgba(8,9,11,.92)');g.addColorStop(.7,'rgba(8,9,11,.7)');g.addColorStop(1,'rgba(8,9,11,0)')
3444
3444
  ctx.save();ctx.globalAlpha*=M.range(t,(t0==null?.15:t0)-.1,(t0==null?.15:t0)+.3);ctx.fillStyle=g;ctx.fillRect(0,0,W,bh);ctx.restore()
3445
- return M.editorial(ctx,sk,p.text,p.sub,S.cx,hy,u*(S.port?.1:.075),S.w*.92,t,t0==null?.15:t0,{glow:1})}`,wl=[Gt("studio-hero-tilt","Toàn cảnh giao diện 3D",5,{text:"Dựng video chuyên nghiệp",sub:"trong vài phút"},`function render(ctx,t,env){
3445
+ return M.editorial(ctx,sk,p.text,p.sub,S.cx,hy,u*(S.port?.1:.075),S.w*.92,t,t0==null?.15:t0,{glow:1})}`,kl=[Gt("studio-hero-tilt","Toàn cảnh giao diện 3D",5,{text:"Dựng video chuyên nghiệp",sub:"trong vài phút"},`function render(ctx,t,env){
3446
3446
  // The whole workspace swings in from a steep angle to a three-quarter view and keeps drifting; the playhead runs.
3447
3447
  ${jt}
3448
3448
  const a=M.ease.outCubic(M.range(t,0,1.6))
@@ -3692,7 +3692,7 @@
3692
3692
  if(its[1])st.text(its[1],500,560,32,z=>sk.font(z,'s','600'),'#8A8F98',{align:'center'})
3693
3693
  const sw=M.range(t,1.2,2.2);if(sw>0&&sw<1){ctx.save();st.rr(0,0,1000,640,40);ctx.clip();const x=M.lerp(-300,1300,sw);ctx.fillStyle='rgba(255,255,255,.12)';st.poly([[x,0],[x+120,0],[x-80,640],[x-200,640]]);ctx.fill();ctx.restore()}
3694
3694
  ctx.restore()
3695
- }`)],hn=Y.find(t=>t.id==="bridge"),vc=(t,e,c,o,n)=>({id:t,name:e,category:hn.name,pack:"bridge",duration:c,params:{accent:hn.accent,...o,style:"bridge"},code:n}),Wc="const half=env.duration/2,inn=t<half,u0=M.clamp(inn?t/half:(t-half)/half),c=inn?M.ease.inCubic(u0):1-M.ease.outCubic(u0);const DARK='#0c0c10';",ml=[vc("bridge-portal","Cửa sổ phóng xuyên",3,{text:"3 bước đơn giản",position:"top"},`function render(ctx,t,env){
3695
+ }`)],pn=Y.find(t=>t.id==="bridge"),vc=(t,e,c,o,n)=>({id:t,name:e,category:pn.name,pack:"bridge",duration:c,params:{accent:pn.accent,...o,style:"bridge"},code:n}),Hc="const half=env.duration/2,inn=t<half,u0=M.clamp(inn?t/half:(t-half)/half),c=inn?M.ease.inCubic(u0):1-M.ease.outCubic(u0);const DARK='#0c0c10';",Sl=[vc("bridge-portal","Cửa sổ phóng xuyên",3,{text:"3 bước đơn giản",position:"top"},`function render(ctx,t,env){
3696
3696
  // The portal card of a zoom-through bridge: a rounded window with an accent rim, a soft inner glow and the next
3697
3697
  // idea's title (text) — the bridge grows it to fill the frame (zoom keys) and the scene takes over under its glow.
3698
3698
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.35,.05),u=Math.min(W,H),port=H>W*1.1,acc=sk.acc
@@ -3704,25 +3704,25 @@
3704
3704
  const f=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.07,w*.86,2);ctx.font=f.font;ctx.fillStyle='#ffffff';ctx.textAlign='center';ctx.textBaseline='middle';f.lines.forEach((l,i)=>ctx.fillText(l,cx,cy+(i-(f.lines.length-1)/2)*f.size*1.1))
3705
3705
  ctx.restore()
3706
3706
  }`),vc("bridge-slab","Khối chéo che cắt",1,{},`function render(ctx,t,env){
3707
- ${Wc}
3707
+ ${Hc}
3708
3708
  // A tilted accent slab with a dark echo sweeps across and covers the frame at the midpoint, then carries on out.
3709
3709
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,L=Math.hypot(W,H),pos=inn?-1+c:c-1
3710
3710
  ctx.save();ctx.translate(W/2,H/2);ctx.rotate(-.3);[[DARK,inn?-.1:.1],[acc,0]].forEach(([col,lag])=>{const x=(inn?pos+lag:-(1-c)+lag)*L*1.2;ctx.fillStyle=col;ctx.fillRect(x-L*.6,-L,L*1.2,L*2)});ctx.restore()
3711
3711
  }`),vc("bridge-iris","Mống mắt đóng mở",1,{},`function render(ctx,t,env){
3712
- ${Wc}
3712
+ ${Hc}
3713
3713
  // An iris: a dark field closes in as a shrinking circle with an accent rim until the frame is covered at the
3714
3714
  // midpoint, then opens again from the centre.
3715
3715
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,R=Math.hypot(W,H)/2*(1-c)
3716
3716
  ctx.save();ctx.fillStyle=DARK;ctx.beginPath();ctx.rect(0,0,W,H);ctx.arc(W/2,H/2,Math.max(0,R),0,M.TAU,true);ctx.fill('evenodd')
3717
3717
  if(R>1){ctx.strokeStyle=acc;ctx.lineWidth=Math.min(W,H)*.02;ctx.beginPath();ctx.arc(W/2,H/2,R,0,M.TAU);ctx.stroke()}ctx.restore()
3718
3718
  }`),vc("bridge-flash","Chớp sáng nối cảnh",.8,{},`function render(ctx,t,env){
3719
- ${Wc}
3719
+ ${Hc}
3720
3720
  // A camera flash: a white bloom with an accent light leak peaks at the midpoint and hides the cut.
3721
3721
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc
3722
3722
  ctx.save();const g=ctx.createRadialGradient(W*.3,H*.4,0,W*.3,H*.4,Math.max(W,H));g.addColorStop(0,M.rgba('#ffffff',c));g.addColorStop(.5,M.rgba(M.mix(acc,'#ffffff',.6),c*.9));g.addColorStop(1,M.rgba(acc,c*.75));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)
3723
3723
  ctx.fillStyle=M.rgba('#ffffff',Math.max(0,c*1.4-.4));ctx.fillRect(0,0,W,H);ctx.restore()
3724
3724
  }`),vc("bridge-whip","Vệt lia máy",.8,{},`function render(ctx,t,env){
3725
- ${Wc}
3725
+ ${Hc}
3726
3726
  // A whip pan: streaks of motion-blurred light (accent, white, dark) race horizontally and fill the frame at the
3727
3727
  // midpoint, then thin out the other way.
3728
3728
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,R=M.rand(7),n=26
@@ -3731,19 +3731,19 @@
3731
3731
  const g=ctx.createLinearGradient(x,0,x+len,0);g.addColorStop(0,M.rgba(col,0));g.addColorStop(.5,M.rgba(col,.9*Math.min(1,c*1.5)));g.addColorStop(1,M.rgba(col,0));ctx.fillStyle=g;ctx.fillRect(x,y,len,h)}
3732
3732
  ctx.restore()
3733
3733
  }`),vc("bridge-ink","Mực loang che cảnh",1.2,{},`function render(ctx,t,env){
3734
- ${Wc}
3734
+ ${Hc}
3735
3735
  // Organic ink blobs in the accent and dark bloom from a few points, merge and cover the frame at the midpoint, then
3736
3736
  // shrink back into those points.
3737
3737
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,R=M.rand(19),L=Math.hypot(W,H)
3738
3738
  ctx.save();[[acc,0],[DARK,.12]].forEach(([col,lag])=>{const q=M.clamp(c*1.15-lag);ctx.fillStyle=col;ctx.beginPath();for(let i=0;i<6;i++){const bx=W*R(),by=H*R(),r=L*.55*q*(.6+R()*.5);for(let j=0;j<=24;j++){const a=j/24*M.TAU,rr=r*(1+.12*Math.sin(a*5+i+t*3));const x=bx+Math.cos(a)*rr,y=by+Math.sin(a)*rr;if(j)ctx.lineTo(x,y);else ctx.moveTo(x,y)}ctx.closePath()}ctx.fill()});ctx.restore()
3739
3739
  }`),vc("bridge-stripes","Sọc trượt che cảnh",1,{},`function render(ctx,t,env){
3740
- ${Wc}
3740
+ ${Hc}
3741
3741
  // Vertical stripes drop in one after another (accent / dark alternating) until the frame is covered, then lift
3742
3742
  // away in the same order.
3743
3743
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,n=8,sw=W/n
3744
3744
  ctx.save();for(let i=0;i<n;i++){const q=M.clamp(c*1.6-i/n*.6),h=H*M.ease.inOutCubic(q);ctx.fillStyle=i%2?DARK:acc;if(inn)ctx.fillRect(i*sw,0,sw+1,h);else ctx.fillRect(i*sw,H-h,sw+1,h)}ctx.restore()
3745
3745
  }`),vc("bridge-shapes","Hình bung che cảnh",1.2,{},`function render(ctx,t,env){
3746
- ${Wc}
3746
+ ${Hc}
3747
3747
  // A burst of circles and squares in the accent, white and dark pours out from the centre, grows until it covers the
3748
3748
  // frame at the midpoint, then flies apart.
3749
3749
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,R=M.rand(23),L=Math.hypot(W,H)
@@ -3751,7 +3751,7 @@
3751
3751
  if(i%2){ctx.beginPath();ctx.arc(x,y,s,0,M.TAU);ctx.fill()}else{ctx.save();ctx.translate(x,y);ctx.rotate(a+t*2);ctx.fillRect(-s,-s,s*2,s*2);ctx.restore()}}
3752
3752
  if(c>.85){ctx.fillStyle=M.rgba(DARK,(c-.85)/.15);ctx.fillRect(0,0,W,H)}ctx.restore()
3753
3753
  }`),vc("bridge-glitch","Glitch che cảnh",.8,{},`function render(ctx,t,env){
3754
- ${Wc}
3754
+ ${Hc}
3755
3755
  // Digital glitch: blocks and scanline bands in the accent / dark / RGB split stack up into a full cover at the
3756
3756
  // midpoint and break apart after.
3757
3757
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,R=M.rand(Math.floor(t*30)+1)
@@ -3759,13 +3759,13 @@
3759
3759
  for(let i=0;i<Math.round(30*c)+4;i++){const y=R()*H,h=H*(.01+R()*.08),x=(R()-.3)*W,w=W*(.2+R()*.9);ctx.fillStyle=[acc,'rgba(255,40,120,.8)','rgba(0,230,255,.8)','#ffffff',DARK][i%5];ctx.globalAlpha=.4+.6*c;ctx.fillRect(x,y,w,h)}
3760
3760
  ctx.restore()
3761
3761
  }`),vc("bridge-tunnel","Đường hầm vòng tròn",1.2,{},`function render(ctx,t,env){
3762
- ${Wc}
3762
+ ${Hc}
3763
3763
  // A tunnel: concentric accent / dark rings rush toward the camera from the centre and fill the frame at the
3764
3764
  // midpoint, then keep flying past to reveal the next shot.
3765
3765
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,L=Math.hypot(W,H)/2,n=9,ph=t/D*3
3766
3766
  ctx.save();for(let i=n;i>=0;i--){const z=((i+ph)%n)/n,r=L*Math.pow(z,1.8)*(.2+1.6*c);ctx.fillStyle=i%2?M.rgba(DARK,c):M.rgba(acc,c);ctx.beginPath();ctx.arc(W/2,H/2,r,0,M.TAU);ctx.fill()}
3767
3767
  if(c>.8){ctx.fillStyle=M.rgba(DARK,(c-.8)/.2);ctx.fillRect(0,0,W,H)}ctx.restore()
3768
- }`)],fn=Y.find(t=>t.id==="tvc"),ce=(t,e,c,o,n)=>({id:t,name:e,category:fn.name,pack:"tvc",duration:c,params:{accent:fn.accent,position:"center",...o,style:"tvc"},code:n}),re="const INK='#15161c',SUB='#5d6070';const CARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(20,22,40,.18)';c.shadowBlur=r*2.2;c.shadowOffsetY=r*.6;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const CHIP=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const PILL=(c,s,cx,cy,z)=>{const w=c.measureText(s).width+z*1.4,h=z*1.7;c.save();c.shadowColor='rgba(20,22,40,.16)';c.shadowBlur=z*.8;c.shadowOffsetY=z*.15;c.fillStyle='#ffffff';M.rr(c,cx-w/2,cy-h/2,w,h,h/2);c.fill();c.restore()};const MARK=(c,sk,s,x,y,r,acc)=>{c.save();const g=c.createLinearGradient(x-r,y-r,x+r,y+r);g.addColorStop(0,M.mix(acc,'#ffffff',.2));g.addColorStop(1,M.mix(acc,'#000000',.25));c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.fillStyle=M.readable(acc);c.font=sk.font(r*.9,'h');c.textAlign='center';c.textBaseline='middle';c.fillText(String(s||'?').trim().split(/ +/).slice(0,2).map(w=>w[0]||'').join('').toUpperCase(),x,y+r*.05);c.restore()};",kl=[ce("tvc-backdrop","Nền thương hiệu",6,{number:0},`function render(ctx,t,env){
3768
+ }`)],dn=Y.find(t=>t.id==="tvc"),ce=(t,e,c,o,n)=>({id:t,name:e,category:dn.name,pack:"tvc",duration:c,params:{accent:dn.accent,position:"center",...o,style:"tvc"},code:n}),re="const INK='#15161c',SUB='#5d6070';const CARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(20,22,40,.18)';c.shadowBlur=r*2.2;c.shadowOffsetY=r*.6;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const CHIP=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const PILL=(c,s,cx,cy,z)=>{const w=c.measureText(s).width+z*1.4,h=z*1.7;c.save();c.shadowColor='rgba(20,22,40,.16)';c.shadowBlur=z*.8;c.shadowOffsetY=z*.15;c.fillStyle='#ffffff';M.rr(c,cx-w/2,cy-h/2,w,h,h/2);c.fill();c.restore()};const MARK=(c,sk,s,x,y,r,acc)=>{c.save();const g=c.createLinearGradient(x-r,y-r,x+r,y+r);g.addColorStop(0,M.mix(acc,'#ffffff',.2));g.addColorStop(1,M.mix(acc,'#000000',.25));c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.fillStyle=M.readable(acc);c.font=sk.font(r*.9,'h');c.textAlign='center';c.textBaseline='middle';c.fillText(String(s||'?').trim().split(/ +/).slice(0,2).map(w=>w[0]||'').join('').toUpperCase(),x,y+r*.05);c.restore()};",vl=[ce("tvc-backdrop","Nền thương hiệu",6,{number:0},`function render(ctx,t,env){
3769
3769
  // Full-frame brand backdrop: a soft light gradient tinted by the brand colour with a slow light sweep (numberValue 1 =
3770
3770
  // the dark premium variant); every TVC card sits on it.
3771
3771
  const {width:W,height:H,params:p}=env,sk=M.skin(env,p),acc=sk.acc,dark=+p.number===1,u=Math.min(W,H)
@@ -3944,7 +3944,7 @@
3944
3944
  const tw=u*.3,th=u*.1,gap=u*.03,tot=its.length*(tw+gap);ctx.save();ctx.beginPath();ctx.rect(S.x0,S.y-th,S.w,th*2.2);ctx.clip();const off=(t*u*.06)%tot
3945
3945
  for(let rep=-1;rep<=1;rep++)its.forEach((s,i)=>{const x=S.cx-tot/2+rep*tot+i*(tw+gap)-off+gap/2,a=M.ease.outCubic(M.range(t,.2+i*.12,.6+i*.12));if(a<=0)return;ctx.save();ctx.globalAlpha*=a;CARD(ctx,x,S.y-th/2+u*.03,tw,th,th*.2);ctx.fillStyle=i%2?INK:M.mix(acc,INK,.3);const f=M.fit(ctx,String(s).toUpperCase(),z=>sk.font(z,'h'),th*.32,tw*.85,1);ctx.font=f.font;ctx.fillText(f.lines[0]||'',x+tw/2,S.y+u*.03);ctx.restore()})
3946
3946
  ctx.restore();ctx.restore()
3947
- }`)],pn=Y.find(t=>t.id==="home"),We=(t,e,c,o,n)=>({id:t,name:e,category:pn.name,pack:"home",duration:c,params:{accent:pn.accent,position:"center",...o,style:"home"},code:n}),He="const NV='#0f1b30',MU='rgba(255,255,255,.66)',CR='#f3e6c8';const CY=(S,h)=>Math.max(S.top+h/2,Math.min(S.bot-h/2,S.y));const CARD=(c,x,y,w,h,r,acc)=>{c.save();c.shadowColor='rgba(0,0,0,.42)';c.shadowBlur=r*2.2;c.shadowOffsetY=r*.6;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,'#1b2d50');g.addColorStop(1,NV);c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.restore();c.save();c.strokeStyle=M.rgba(acc,.55);c.lineWidth=Math.max(1,r*.06);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'left';c.textBaseline='middle';c.fillText(s,x,y)};const VN=n=>n>=1e9?String(Math.round(n/1e8)/10).replace('.',',')+' tỷ':n>=1e6?M.fmt(n/1e6)+' triệu':M.fmt(n);const SKY=(c,x,y,w,h,acc)=>{const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,'#203a66');g.addColorStop(.6,M.mix(acc,'#f6dcae',.45));g.addColorStop(.601,'#2a3a52');g.addColorStop(1,'#141f33');c.fillStyle=g;c.fillRect(x,y,w,h)};const HOUSE=(c,x,y,s,acc,on)=>{c.save();c.translate(x,y);c.scale(s,s);const R=(a,b,w,h,f)=>{c.fillStyle=f;c.fillRect(a,b,w,h)};R(-.5,-.36,1,.36,'#101a2c');R(-.38,-.66,.62,.3,'#17243e');R(-.56,-.4,1.12,.045,'#0a1220');R(-.44,-.7,.74,.045,'#0a1220');const L=M.mix(acc,'#fff3d6',.5);c.globalAlpha*=.3+.7*on;R(-.42,-.3,.4,.24,L);R(.12,-.27,.13,.27,M.mix(acc,'#000000',.15));R(-.3,-.6,.42,.17,L);c.restore()};",Sl=[We("home-listing-card","Thẻ tin đăng nhà",5,{text:"Căn hộ 2PN view sông",sub:"Đường Ven Sông, TP. Thủ Đức",number:35e8,items:"2 PN|2 WC|85 m²"},`function render(ctx,t,env){
3947
+ }`)],gn=Y.find(t=>t.id==="home"),We=(t,e,c,o,n)=>({id:t,name:e,category:gn.name,pack:"home",duration:c,params:{accent:gn.accent,position:"center",...o,style:"home"},code:n}),He="const NV='#0f1b30',MU='rgba(255,255,255,.66)',CR='#f3e6c8';const CY=(S,h)=>Math.max(S.top+h/2,Math.min(S.bot-h/2,S.y));const CARD=(c,x,y,w,h,r,acc)=>{c.save();c.shadowColor='rgba(0,0,0,.42)';c.shadowBlur=r*2.2;c.shadowOffsetY=r*.6;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,'#1b2d50');g.addColorStop(1,NV);c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.restore();c.save();c.strokeStyle=M.rgba(acc,.55);c.lineWidth=Math.max(1,r*.06);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'left';c.textBaseline='middle';c.fillText(s,x,y)};const VN=n=>n>=1e9?String(Math.round(n/1e8)/10).replace('.',',')+' tỷ':n>=1e6?M.fmt(n/1e6)+' triệu':M.fmt(n);const SKY=(c,x,y,w,h,acc)=>{const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,'#203a66');g.addColorStop(.6,M.mix(acc,'#f6dcae',.45));g.addColorStop(.601,'#2a3a52');g.addColorStop(1,'#141f33');c.fillStyle=g;c.fillRect(x,y,w,h)};const HOUSE=(c,x,y,s,acc,on)=>{c.save();c.translate(x,y);c.scale(s,s);const R=(a,b,w,h,f)=>{c.fillStyle=f;c.fillRect(a,b,w,h)};R(-.5,-.36,1,.36,'#101a2c');R(-.38,-.66,.62,.3,'#17243e');R(-.56,-.4,1.12,.045,'#0a1220');R(-.44,-.7,.74,.045,'#0a1220');const L=M.mix(acc,'#fff3d6',.5);c.globalAlpha*=.3+.7*on;R(-.42,-.3,.4,.24,L);R(.12,-.27,.13,.27,M.mix(acc,'#000000',.15));R(-.3,-.6,.42,.17,L);c.restore()};",Tl=[We("home-listing-card","Thẻ tin đăng nhà",5,{text:"Căn hộ 2PN view sông",sub:"Đường Ven Sông, TP. Thủ Đức",number:35e8,items:"2 PN|2 WC|85 m²"},`function render(ctx,t,env){
3948
3948
  ${He}
3949
3949
  // Property listing card: a dusk "photo" with a modern house that lights up, the title (text), the address (sub) with a
3950
3950
  // pin, the price (number, shown as tỷ / triệu) counting up in gold and the specs (items, e.g. 3 PN|2 WC|85 m²) as chips.
@@ -4167,7 +4167,7 @@
4167
4167
  ctx.strokeStyle=RED;ctx.lineWidth=bh*.07;M.rr(ctx,-bw/2+bh*.06,-bh/2+bh*.06,bw-bh*.12,bh-bh*.12,bh*.14);ctx.stroke();ctx.lineWidth=bh*.025;M.rr(ctx,-bw/2+bh*.16,-bh/2+bh*.16,bw-bh*.32,bh-bh*.32,bh*.1);ctx.stroke();TX(ctx,tt,0,bh*.03,tf.font,RED,'center')
4168
4168
  const rd=M.rand(17);ctx.fillStyle='rgba(255,255,255,.35)';for(let i=0;i<40;i++){ctx.beginPath();ctx.arc((rd()-.5)*bw*.9,(rd()-.5)*bh*.8,bh*.012*(1+rd()*2),0,M.TAU);ctx.fill()};ctx.restore()
4169
4169
  if(t>hit){const d=M.range(t,hit,hit+.7),rd2=M.rand(23);ctx.save();ctx.globalAlpha=k.v*(1-d);ctx.fillStyle=RED;for(let i=0;i<14;i++){const an=rd2()*M.TAU,r=(bw*.5+rd2()*u*.08)*M.ease.outCubic(d);ctx.beginPath();ctx.arc(cx+Math.cos(an)*r,cy+Math.sin(an)*r*.6,u*.004*(1+rd2()*1.5),0,M.TAU);ctx.fill()}ctx.restore()}}
4170
- }`)],dn=Y.find(t=>t.id==="home"),Hc=(t,e,c,o,n)=>({id:t,name:e,category:dn.name,pack:"home",duration:c,params:{accent:dn.accent,position:"center",...o,style:"home"},code:n}),vl=[Hc("home-news-stack","Thẻ báo chí xếp chồng",5.5,{text:"Quy hoạch đầu tư công",items:"Tiêu đề bài báo thứ nhất về hạ tầng khu vực|Tiêu đề bài báo thứ hai về tiến độ dự án|Tiêu đề bài báo thứ ba",sub:"Nguồn: báo điện tử"},`function render(ctx,t,env){
4170
+ }`)],un=Y.find(t=>t.id==="home"),Lc=(t,e,c,o,n)=>({id:t,name:e,category:un.name,pack:"home",duration:c,params:{accent:un.accent,position:"center",...o,style:"home"},code:n}),Cl=[Lc("home-news-stack","Thẻ báo chí xếp chồng",5.5,{text:"Quy hoạch đầu tư công",items:"Tiêu đề bài báo thứ nhất về hạ tầng khu vực|Tiêu đề bài báo thứ hai về tiến độ dự án|Tiêu đề bài báo thứ ba",sub:"Nguồn: báo điện tử"},`function render(ctx,t,env){
4171
4171
  // News proof: a dark grid board; the header (text) types on with a cursor, then up to 3 article cards (items = headlines,
4172
4172
  // sub = source line) slide up one by one, a little fanned, and a yellow highlighter sweeps across the first headline.
4173
4173
  const {duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,W=S.W,H=S.H,acc=sk.acc
@@ -4194,7 +4194,7 @@
4194
4194
  ctx.fillStyle='#cfd4db';for(let r=0;r<5;r++)ctx.fillRect(x0+iw*.47,py+r*ph/5+ph*.06,iw*.53*(r===4?.55:1),ph*.08)
4195
4195
  ctx.restore()})
4196
4196
  ctx.restore()
4197
- }`),Hc("home-stat-counter","Số liệu đếm + đơn vị + xu hướng",4,{text:"Giá thuê trung bình",number:4.5,number2:5.5,sub:"triệu/tháng",decimals:1,position:"center"},`function render(ctx,t,env){
4197
+ }`),Lc("home-stat-counter","Số liệu đếm + đơn vị + xu hướng",4,{text:"Giá thuê trung bình",number:4.5,number2:5.5,sub:"triệu/tháng",decimals:1,position:"center"},`function render(ctx,t,env){
4198
4198
  // Stat counter: a small label (text) slides in, the big number counts up (number; number2 > number = a range a–b,
4199
4199
  // decimals 0–2, Vietnamese comma), the unit (sub) leans in italic beside it and a trend line with an arrow draws under it.
4200
4200
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u,acc=sk.acc
@@ -4214,7 +4214,7 @@
4214
4214
  for(let i=0;i<pts.length;i++){const x=lx+pts[i][0]*lw,y=ly+pts[i][1]*h,f2=Math.min(1,Math.max(0,d*(pts.length-1)-(i-1)));if(i===0){ctx.moveTo(x,y);continue}if(f2<=0)break;const px=lx+pts[i-1][0]*lw,py=ly+pts[i-1][1]*h,nx=px+(x-px)*f2,ny=py+(y-py)*f2;ctx.lineTo(nx,ny);tip=[nx,ny];ang=Math.atan2(y-py,x-px)}
4215
4215
  ctx.stroke();ctx.save();ctx.translate(tip[0],tip[1]);ctx.rotate(ang);ctx.fillStyle=acc;ctx.beginPath();ctx.moveTo(u*.022,0);ctx.lineTo(-u*.012,-u*.015);ctx.lineTo(-u*.012,u*.015);ctx.closePath();ctx.fill();ctx.restore()}
4216
4216
  ctx.restore()
4217
- }`),Hc("home-typewriter","Chữ gõ máy + con trỏ",4,{text:"Dòng chữ gõ từng ký tự",sub:"",position:"lower"},`function render(ctx,t,env){
4217
+ }`),Lc("home-typewriter","Chữ gõ máy + con trỏ",4,{text:"Dòng chữ gõ từng ký tự",sub:"",position:"lower"},`function render(ctx,t,env){
4218
4218
  // Typewriter caption: the line (text, then sub as a second line) types on letter by letter with a blinking block cursor,
4219
4219
  // white with a soft shadow so it reads over any B-roll; clears at the end.
4220
4220
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.05,.3),u=S.u,acc=sk.acc
@@ -4226,7 +4226,7 @@
4226
4226
  ctx.fillStyle='#ffffff';ctx.fillText(part,x,y);if(m<s.length&&!cur||i===lines.length-1&&!cur)cur=[x+ctx.measureText(part).width,y,f.size]})
4227
4227
  if(cur&&(n<total||Math.floor(t*2.5)%2===0)){ctx.shadowBlur=0;ctx.shadowOffsetY=0;ctx.fillStyle=acc;ctx.fillRect(cur[0]+u*.005,cur[1]-cur[2]*.55,u*.01,cur[2]*1.1)}
4228
4228
  ctx.restore()
4229
- }`),Hc("home-amenity-time","Tiện ích + số phút di chuyển",5,{text:"Tiện ích chỉ cách",items:"palm:Bãi biển:5|ship:Bến du thuyền:7|tree:Công viên:5|school:Trường học:10",sub:"Thời gian minh hoạ",unit:"phút"},`function render(ctx,t,env){
4229
+ }`),Lc("home-amenity-time","Tiện ích + số phút di chuyển",5,{text:"Tiện ích chỉ cách",items:"palm:Bãi biển:5|ship:Bến du thuyền:7|tree:Công viên:5|school:Trường học:10",sub:"Thời gian minh hoạ",unit:"phút"},`function render(ctx,t,env){
4230
4230
  // Amenity distance list: a heading (text), then rows (items "icon:Name:minutes") slide in one by one, each with an icon
4231
4231
  // badge and a minutes chip that counts up (unit, default phút); a small footnote (sub) under the list.
4232
4232
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.35),u=S.u,acc=sk.acc
@@ -4243,7 +4243,7 @@
4243
4243
  ctx.fillStyle=acc;M.rr(ctx,cx,ry-rh*.3,cw,rh*.6,rh*.3);ctx.fill();ctx.fillStyle=M.readable(acc);ctx.textAlign='center';ctx.fillText(txt,cx+cw/2,ry);ctx.textAlign='left'})
4244
4244
  if(p.sub){ctx.globalAlpha=k.v*M.range(t,1,1.5);ctx.font=sk.font(u*.026,'s','500');ctx.fillStyle='rgba(255,255,255,.6)';ctx.fillText(String(p.sub),x+u*.04,y+h-u*.035)}
4245
4245
  ctx.restore()
4246
- }`),Hc("home-sticky-cta","Nút nhận báo giá cố định + logo",20,{text:"Nhận báo giá",sub:"",position:"lower"},`function render(ctx,t,env){
4246
+ }`),Lc("home-sticky-cta","Nút nhận báo giá cố định + logo",20,{text:"Nhận báo giá",sub:"",position:"lower"},`function render(ctx,t,env){
4247
4247
  // Sticky CTA for the whole video: a red pill button at the bottom right (text) with a pointing-hand cursor that taps it
4248
4248
  // every 2.5 s (ripple + press), and a small corner slot top left for the customer's brand (sub; empty = no slot).
4249
4249
  // Chain layers of 20 s (a multiple of the tap cycle) for longer videos; it fades only at the very end of each layer
@@ -4263,7 +4263,7 @@
4263
4263
  if(p.sub){ctx.save();const lf=M.fit(ctx,String(p.sub),z=>sk.font(z,'h','800'),u*.026,u*.3,1),lx=S.W*(S.port?.06:.04),ly=H*(S.port?.06:.07);ctx.globalAlpha=.78*Math.min(1,a);ctx.font=lf.font;const lw=ctx.measureText(lf.lines[0]||'').width
4264
4264
  ctx.fillStyle='rgba(255,255,255,.92)';M.rr(ctx,lx,ly,lf.size*1.8,lf.size*1.8,lf.size*.4);ctx.fill();ctx.fillStyle=red;ctx.fillRect(lx+lf.size*.45,ly+lf.size*.45,lf.size*.9,lf.size*.9)
4265
4265
  ctx.fillStyle='#ffffff';ctx.textAlign='left';ctx.textBaseline='middle';ctx.shadowColor='rgba(0,0,0,.6)';ctx.shadowBlur=u*.01;ctx.fillText(lf.lines[0]||'',lx+lf.size*2.2,ly+lf.size*.9);ctx.restore();void lw}
4266
- }`),Hc("home-money-rain","Mưa tiền",3,{text:"",sub:"",position:"center"},`function render(ctx,t,env){
4266
+ }`),Lc("home-money-rain","Mưa tiền",3,{text:"",sub:"",position:"center"},`function render(ctx,t,env){
4267
4267
  // Money rain: banknotes (drawn, no real currency marks) tumble down the frame at different depths, blurred near ones
4268
4268
  // in front; with text, a big price word (text, sub as a small line) glows in the middle over them.
4269
4269
  const {duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),k=M.io(t,D,.2,.4),u=S.u,W=S.W,H=S.H,acc=sk.acc,r=M.rand(17)
@@ -4277,7 +4277,7 @@
4277
4277
  ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.shadowColor=M.rgba(acc,.9);ctx.shadowBlur=u*.06;ctx.fillStyle='#ffffff';ctx.fillText(f.lines[0]||'',0,0);ctx.shadowBlur=u*.015;ctx.shadowColor='rgba(0,0,0,.7)';ctx.fillText(f.lines[0]||'',0,0)
4278
4278
  if(p.sub){ctx.font=sk.font(f.size*.3,'s','800');ctx.shadowBlur=u*.02;ctx.fillText(String(p.sub).toUpperCase(),0,f.size*.75)}ctx.restore()}
4279
4279
  ctx.restore()
4280
- }`),Hc("home-logo-tile","Thẻ logo dự án bật lên",3,{text:"TÊN DỰ ÁN",sub:"Dòng giới thiệu",position:"center"},`function render(ctx,t,env){
4280
+ }`),Lc("home-logo-tile","Thẻ logo dự án bật lên",3,{text:"TÊN DỰ ÁN",sub:"Dòng giới thiệu",position:"center"},`function render(ctx,t,env){
4281
4281
  // Project logo tile: a rounded teal tile pops over the render (back-eased), the project name (text, spaced capitals)
4282
4282
  // and a small tagline (sub) fade up inside, a light glint sweeps across once.
4283
4283
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.05,.35),u=S.u,a=M.ease.outBack(M.range(t,0,.5))
@@ -4289,7 +4289,7 @@
4289
4289
  ctx.globalAlpha=k.v*q;ctx.fillStyle='#ffffff';ctx.textAlign='center';ctx.textBaseline='middle';ctx.font=tf.font;ctx.fillText(tf.lines[0]||'',S.cx,y+h*.45+(1-q)*u*.02)
4290
4290
  if(p.sub){const sf=M.fit(ctx,String(p.sub).toUpperCase(),z=>sk.font(z,'s','600'),u*.026,w*.8,1);ctx.font=sf.font;ctx.fillStyle='rgba(255,255,255,.9)';ctx.fillText(sf.lines[0]||'',S.cx,y+h*.72)}
4291
4291
  ctx.restore()
4292
- }`),Hc("home-partner-chips","Chip đối tác + bắt tay",3.5,{text:"Được phát triển bởi",items:"Đối tác A|Đối tác B",position:"center"},`function render(ctx,t,env){
4292
+ }`),Lc("home-partner-chips","Chip đối tác + bắt tay",3.5,{text:"Được phát triển bởi",items:"Đối tác A|Đối tác B",position:"center"},`function render(ctx,t,env){
4293
4293
  // Developer credibility: a heading (text) rises, two white partner chips (items, generic names / the customer's own)
4294
4294
  // slide in from the left and right, and a handshake badge pops between them.
4295
4295
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u,acc=sk.acc,its=M.items(p,2)
@@ -4303,7 +4303,7 @@
4303
4303
  const f=M.fit(ctx,s,z=>sk.font(z,'h','800'),ch*.42,cw-ch*1.1,1);ctx.font=f.font;ctx.fillStyle='#1b2430';ctx.textAlign='left';ctx.fillText(f.lines[0]||'',cx-cw/2+ch*.85,S.y+ch*.03)})
4304
4304
  const b=M.ease.outBack(M.range(t,.8,1.2));if(b>0){ctx.globalAlpha=k.v*Math.min(1,b);ctx.save();ctx.translate(S.cx,S.y+u*.14);ctx.scale(b,b);ctx.strokeStyle='#ffffff';ctx.lineWidth=u*.004;ctx.fillStyle=M.rgba(acc,.25);ctx.beginPath();ctx.arc(0,0,u*.07,0,M.TAU);ctx.fill();ctx.stroke();M.glyph(ctx,'handshake',0,0,u*.085,{color:'#ffffff',glow:false,width:2.4});ctx.restore()}
4305
4305
  ctx.restore()
4306
- }`),Hc("home-brand-plate","Nền thương hiệu (thẻ ra mắt dự án)",8,{},`function render(ctx,t,env){
4306
+ }`),Lc("home-brand-plate","Nền thương hiệu (thẻ ra mắt dự án)",8,{},`function render(ctx,t,env){
4307
4307
  // Launch-film backdrop: a solid brand-colour plate (accent) with a soft light and vignette, a ghosted line-art tower drifting
4308
4308
  // on the left, a faded rooftop grid fanning in from the bottom right and a slow diagonal light sweep. No text: the cards
4309
4309
  // (luxuryCard) and gold titles go on top; lay the project's aerial photo over it at low opacity for the real city.
@@ -4332,7 +4332,7 @@
4332
4332
  const sx=((t/D)*1.6-.3)*W,sw=ctx.createLinearGradient(sx-u*.35,0,sx+u*.35,H*.5);sw.addColorStop(0,'rgba(255,240,220,0)');sw.addColorStop(.5,'rgba(255,240,220,.07)');sw.addColorStop(1,'rgba(255,240,220,0)')
4333
4333
  ctx.fillStyle=sw;ctx.fillRect(0,0,W,H)
4334
4334
  ctx.restore()
4335
- }`)],gn=Y.find(t=>t.id==="health"),Le=(t,e,c,o,n)=>({id:t,name:e,category:gn.name,pack:"health",duration:c,params:{accent:gn.accent,position:"center",...o,style:"health"},code:n}),De="const INK='#0b2b33',SUB='#557079',MINT='#e7f6f4';const CARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(11,43,51,.24)';c.shadowBlur=r*2;c.shadowOffsetY=r*.5;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const TOPY=(S,h)=>Math.max(S.top,Math.min(S.y-h/2,S.bot-h));const CROSS=(c,x,y,s)=>{const a=s*.34;c.beginPath();[[-a,-s],[a,-s],[a,-a],[s,-a],[s,a],[a,a],[a,s],[-a,s],[-a,a],[-s,a],[-s,-a],[-a,-a]].forEach(([px,py],i)=>c[i?'lineTo':'moveTo'](x+px,y+py));c.closePath()};const TXT=(c,f,x,y,col)=>{c.font=f.font;c.fillStyle=col;f.lines.forEach((l,i)=>c.fillText(l,x,y+(i-(f.lines.length-1)/2)*f.lh))};const GL=(c,n,x,y,s,col,w)=>M.glyph(c,n,x,y,s,{color:col,glow:false,width:w||2.2});",Tl=[Le("health-heartbeat","Nhịp tim ECG",4,{text:"Nhịp tim ổn định",number:72,position:"lower"},`function render(ctx,t,env){
4335
+ }`)],bn=Y.find(t=>t.id==="health"),Le=(t,e,c,o,n)=>({id:t,name:e,category:bn.name,pack:"health",duration:c,params:{accent:bn.accent,position:"center",...o,style:"health"},code:n}),De="const INK='#0b2b33',SUB='#557079',MINT='#e7f6f4';const CARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(11,43,51,.24)';c.shadowBlur=r*2;c.shadowOffsetY=r*.5;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const TOPY=(S,h)=>Math.max(S.top,Math.min(S.y-h/2,S.bot-h));const CROSS=(c,x,y,s)=>{const a=s*.34;c.beginPath();[[-a,-s],[a,-s],[a,-a],[s,-a],[s,a],[a,a],[a,s],[-a,s],[-a,a],[-s,a],[-s,-a],[-a,-a]].forEach(([px,py],i)=>c[i?'lineTo':'moveTo'](x+px,y+py));c.closePath()};const TXT=(c,f,x,y,col)=>{c.font=f.font;c.fillStyle=col;f.lines.forEach((l,i)=>c.fillText(l,x,y+(i-(f.lines.length-1)/2)*f.lh))};const GL=(c,n,x,y,s,col,w)=>M.glyph(c,n,x,y,s,{color:col,glow:false,width:w||2.2});",Al=[Le("health-heartbeat","Nhịp tim ECG",4,{text:"Nhịp tim ổn định",number:72,position:"lower"},`function render(ctx,t,env){
4336
4336
  ${De}
4337
4337
  // Heartbeat monitor card: an ECG line sweeps across a soft grid strip, a heart pulses on every beat and the BPM
4338
4338
  // (numberValue) counts up beside the label (text).
@@ -4565,7 +4565,7 @@
4565
4565
  ctx.save();ctx.globalAlpha*=e1;TXT(ctx,lf,tx+(1-e1)*u*.03,y+h*.3,SUB);ctx.globalAlpha=(1-k.o)*a*e2;TXT(ctx,nf,tx+(1-e2)*u*.04,y+h*.58,INK);ctx.restore()
4566
4566
  ctx.font=nf.font;const nw=ctx.measureText(nf.lines[0]||'').width,ul=M.ease.inOutCubic(M.range(t,.9,1.5));ctx.fillStyle=acc;M.rr(ctx,tx,y+h*.8,Math.max(0,nw*ul),u*.008,u*.004);ctx.fill()
4567
4567
  ctx.restore()
4568
- }`)],un=Y.find(t=>t.id==="fit"),Ee=(t,e,c,o,n)=>({id:t,name:e,category:un.name,pack:"fit",duration:c,params:{accent:un.accent,position:"center",...o,style:"fit"},code:n}),qe="const DK='#0d0d0d',UP=s=>String(s||'').toUpperCase();const SLAB=(c,x,y,w,h,s,f)=>{c.fillStyle=f;c.beginPath();c.moveTo(x+s,y);c.lineTo(x+w,y);c.lineTo(x+w-s,y+h);c.lineTo(x,y+h);c.closePath();c.fill()};const PANEL=(c,x,y,w,h,r,a)=>{c.save();c.shadowColor='rgba(0,0,0,.5)';c.shadowBlur=r*3;c.shadowOffsetY=r*.8;c.fillStyle='rgba(13,13,13,'+(a||.92)+')';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const TX=(c,s,x,y,font,f,al)=>{c.font=font;c.fillStyle=f;c.textAlign=al||'center';c.textBaseline='middle';c.fillText(s,x,y)};const TL=(c,sk,s,role,z,w,x,y,f,al)=>{const o=M.fit(c,UP(s),q=>sk.font(q,role),z,Math.max(1,w),1);TX(c,o.lines[0]||'',x,y,o.font,f,al);return o};const SHK=(t,t0,a)=>t<t0?0:a*Math.exp(-(t-t0)*9)*Math.sin((t-t0)*62);",Cl=[Ee("fit-rep-counter","Đếm rep",4.5,{text:"Gánh tạ",sub:"Hiệp 3",number:12},`function render(ctx,t,env){
4568
+ }`)],Mn=Y.find(t=>t.id==="fit"),Ee=(t,e,c,o,n)=>({id:t,name:e,category:Mn.name,pack:"fit",duration:c,params:{accent:Mn.accent,position:"center",...o,style:"fit"},code:n}),qe="const DK='#0d0d0d',UP=s=>String(s||'').toUpperCase();const SLAB=(c,x,y,w,h,s,f)=>{c.fillStyle=f;c.beginPath();c.moveTo(x+s,y);c.lineTo(x+w,y);c.lineTo(x+w-s,y+h);c.lineTo(x,y+h);c.closePath();c.fill()};const PANEL=(c,x,y,w,h,r,a)=>{c.save();c.shadowColor='rgba(0,0,0,.5)';c.shadowBlur=r*3;c.shadowOffsetY=r*.8;c.fillStyle='rgba(13,13,13,'+(a||.92)+')';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const TX=(c,s,x,y,font,f,al)=>{c.font=font;c.fillStyle=f;c.textAlign=al||'center';c.textBaseline='middle';c.fillText(s,x,y)};const TL=(c,sk,s,role,z,w,x,y,f,al)=>{const o=M.fit(c,UP(s),q=>sk.font(q,role),z,Math.max(1,w),1);TX(c,o.lines[0]||'',x,y,o.font,f,al);return o};const SHK=(t,t0,a)=>t<t0?0:a*Math.exp(-(t-t0)*9)*Math.sin((t-t0)*62);",Rl=[Ee("fit-rep-counter","Đếm rep",4.5,{text:"Gánh tạ",sub:"Hiệp 3",number:12},`function render(ctx,t,env){
4569
4569
  // Rep counter: a giant rep number (numberValue = reps) counts up with one ring segment lighting per rep, the exercise (text) on an accent slab under it, the set (sub) in a tab above.
4570
4570
  ${qe}
4571
4571
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=S.u,acc=sk.acc,N=Math.max(1,Math.min(50,Math.round(+p.number||10)))
@@ -4794,7 +4794,7 @@
4794
4794
  const gx=nx+(nw+sl*2)*M.range(t,.7,1.3)-sl;SLAB(ctx,gx,y,nh*.35,nh,sl,'rgba(255,255,255,.16)');ctx.restore()
4795
4795
  if(sw){const sx=x+ib*.55,sy=y+nh+u*.008,shh=nh*.55;ctx.save();ctx.beginPath();ctx.rect(sx,sy-2,(sw+sl)*e2,shh+4);ctx.clip();SLAB(ctx,sx,sy,sw+sl*.6,shh,sl*.6,'#ffffff');TX(ctx,sf.lines[0]||'',sx+sl*.3+nh*.4,sy+shh/2+nh*.01,sf.font,DK,'left');ctx.restore()}
4796
4796
  if(e0>0){ctx.save();ctx.translate(x+ib/2,y+nh/2);ctx.scale(e0,e0);ctx.shadowColor='rgba(0,0,0,.4)';ctx.shadowBlur=nh*.3;SLAB(ctx,-ib/2,-nh/2,ib,nh,sl,acc);ctx.shadowBlur=0;ctx.shadowColor='transparent';ctx.fillStyle='#ffffff';M.icon(ctx,String(p.icon||'bolt'),0,0,nh*.28);ctx.restore()}
4797
- }`)],bn=Y.find(t=>t.id==="travel"),Vt=(t,e,c,o,n)=>({id:t,name:e,category:bn.name,pack:"travel",duration:c,params:{accent:bn.accent,position:"center",...o,style:"travel"},code:n}),Ge="const NAVY='#1b2a41',CREAM='#fffaf2',MUT='#7d8798';const CARD=(c,x,y,w,h,r,f)=>{c.save();c.shadowColor='rgba(12,20,40,.32)';c.shadowBlur=r*2;c.shadowOffsetY=r*.5;c.fillStyle=f||CREAM;M.rr(c,x,y,w,h,r);c.fill();c.restore()};const SKY=(c,y,h,acc)=>{const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,NAVY);g.addColorStop(.62,M.mix(acc,NAVY,.3));g.addColorStop(1,M.mix(acc,'#ffd27a',.55));return g};const PLANE=(c,x,y,s,a)=>{c.save();c.translate(x,y);c.rotate(a||0);c.scale(s,s);c.beginPath();c.moveTo(1,0);c.quadraticCurveTo(.95,-.13,.7,-.13);c.lineTo(.18,-.13);c.lineTo(-.22,-.85);c.lineTo(-.42,-.85);c.lineTo(-.2,-.13);c.lineTo(-.62,-.13);c.lineTo(-.8,-.4);c.lineTo(-.95,-.4);c.lineTo(-.85,0);c.lineTo(-.95,.4);c.lineTo(-.8,.4);c.lineTo(-.62,.13);c.lineTo(-.2,.13);c.lineTo(-.42,.85);c.lineTo(-.22,.85);c.lineTo(.18,.13);c.lineTo(.7,.13);c.quadraticCurveTo(.95,.13,1,0);c.closePath();c.fill();c.restore()};const STAR=(c,x,y,r)=>{c.beginPath();for(let i=0;i<10;i++){const q=i%2?r*.45:r,a=-Math.PI/2+i*Math.PI/5;c.lineTo(x+Math.cos(a)*q,y+Math.sin(a)*q)}c.closePath()};const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'center';c.textBaseline='middle';c.fillText(s,x,y)};const CY=(S,h)=>Math.max(S.top+h/2,Math.min(S.y,S.bot-h/2));",Mn="const PAPER='#fdf6e9',TINTS=['#a9b4e8','#b8d4bf','#f3c39b'],PINK='#ff5f9e';const WALL=(c,W,H,u,font,name,t,cols,a,sl)=>{const z=u*.2,s=String(name||'').toUpperCase()+' ';c.save();c.font=font(z);c.textBaseline='middle';c.textAlign='left';c.globalAlpha*=a;const tw=Math.max(1,c.measureText(s).width),n=Math.ceil(H/(z*.92))+1;for(let i=0;i<n;i++){const d=i%2?1:-1,off=((t*u*.07*d+i*tw*.41+(sl||0)*d*W)%tw+tw)%tw;c.fillStyle=cols[i%cols.length];for(let x=off-tw;x<W;x+=tw)c.fillText(s,x,i*z*.92+z*.4)}c.restore()};",yn="const LMS={tower:'p -.42 0 -.22 -.3 -.13 -.56 -.05 -.9 0 -1 .05 -.9 .13 -.56 .22 -.3 .42 0|r -.27 -.33 .54 .04 r -.16 -.58 .32 .035 p -.2 0 -.12 -.16 0 -.2 .12 -.16 .2 0 r -.012 -.85 .024 .25|',clock:'r -.17 -.74 .34 .74 p -.21 -.74 0 -1 .21 -.74 r -.25 -.06 .5 .06|r -.08 -.36 .05 .13 r .03 -.36 .05 .13 r -.04 -.18 .08 .18 c 0 -.55 .125|c 0 -.55 .1',pagoda:'p -.3 -.3 .3 -.3 .42 -.24 -.42 -.24 r -.28 -.24 .56 .24 p -.25 -.54 .25 -.54 .36 -.48 -.36 -.48 r -.22 -.48 .44 .24 p -.19 -.76 .19 -.76 .3 -.7 -.3 -.7 r -.17 -.7 .34 .22 p -.11 -.93 .11 -.93 .23 -.88 -.23 -.88 r -.12 -.88 .24 .18 r -.015 -1 .03 .1|r -.06 -.15 .12 .15 r -.04 -.42 .08 .1 r -.03 -.64 .06 .08|',arch:'r -.42 -.84 .84 .84 r -.46 -1 .92 .16|p -.14 0 -.14 -.38 -.08 -.5 0 -.53 .08 -.5 .14 -.38 .14 0 r -.42 -.72 .84 .03 r -.35 -.6 .12 .2 r .23 -.6 .12 .2|',bridge:'r -.5 -.26 1 .07 r -.33 -.82 .06 .82 r .27 -.82 .06 .82 p -.3 -.8 0 -.28 .3 -.8 .3 -.74 0 -.22 -.3 -.74 p -.3 -.74 -.5 -.37 -.5 -.42 -.3 -.8 p .3 -.8 .5 -.42 .5 -.37 .3 -.74|r -.16 -.5 .012 .25 r .15 -.5 .012 .25 r -.42 -.4 .012 .14 r .41 -.4 .012 .14 r -.5 -.2 1 .02|',lantern:'c -.22 -.6 .17 c .2 -.7 .19 c 0 -.36 .2 r -.235 -.95 .03 .2 r .185 -1 .03 .12 r -.015 -.66 .03 .12 r -.24 -.45 .04 .1 r .18 -.53 .04 .1 r -.02 -.17 .04 .12|r -.3 -.8 .16 .04 r .12 -.9 .16 .04 r -.08 -.58 .16 .04 r -.08 -.18 .16 .04 r -.39 -.61 .34 .025 r .01 -.71 .38 .025 r -.2 -.37 .4 .025|',dome:'r -.4 -.3 .8 .3 r -.3 -.42 .6 .12 c 0 -.42 .3 r -.015 -.95 .03 .25 c 0 -.96 .035 r -.48 -.55 .06 .55 r .42 -.55 .06 .55 p -.48 -.55 -.45 -.64 -.42 -.55 p .42 -.55 .45 -.64 .48 -.55|r -.08 -.2 .16 .2 c 0 -.2 .08 r -.4 -.31 .8 .02 r -.3 -.44 .6 .02|',skyline:'r -.46 -.45 .18 .45 r -.26 -.75 .17 .75 r -.07 -1 .14 1 r .09 -.62 .17 .62 r .28 -.4 .18 .4 p -.07 -1 0 -1.1 .07 -1|r -.22 -.7 .09 .02 r -.22 -.6 .09 .02 r -.22 -.5 .09 .02 r -.04 -.9 .08 .02 r -.04 -.8 .08 .02 r -.04 -.7 .08 .02 r -.04 -.6 .08 .02 r .12 -.55 .11 .02 r .12 -.45 .11 .02 r -.42 -.36 .1 .02 r .32 -.32 .1 .02|',mountain:'p -.5 0 -.16 -.72 -.02 -.52 .12 -.9 .5 0|p .2 -.71 .14 -.75 .09 -.69 .04 -.73 .12 -.9 p -.12 -.62 -.17 -.58 -.22 -.6 -.16 -.72|c .34 -.93 .1'};const SH=(c,str,x,y,s)=>{const a=String(str).split(' ').filter(Boolean);let i=0;while(i<a.length){const k=a[i++];if(k==='c'){const X=+a[i++],Y=+a[i++],R=+a[i++];c.moveTo(x+(X+R)*s,y+Y*s);c.arc(x+X*s,y+Y*s,R*s,0,M.TAU)}else if(k==='r'){const X=+a[i++],Y=+a[i++];c.rect(x+X*s,y+Y*s,+a[i++]*s,+a[i++]*s)}else{let f=1;while(i<a.length&&!isNaN(+a[i])){const X=+a[i++],Y=+a[i++];f?c.moveTo(x+X*s,y+Y*s):c.lineTo(x+X*s,y+Y*s);f=0}c.closePath()}}};const LM=(c,k,x,y,s,col,dk)=>{const d=(LMS[k]||LMS.lantern).split('|');c.save();c.lineJoin='round';c.beginPath();SH(c,d[0],x,y,s);c.shadowColor='rgba(80,40,30,.28)';c.shadowBlur=s*.05;c.shadowOffsetY=s*.025;c.strokeStyle='#ffffff';c.lineWidth=s*.03;c.stroke();c.shadowColor='transparent';c.fillStyle=col;c.fill();c.beginPath();SH(c,d[1],x,y,s);c.fillStyle=dk;c.fill();c.beginPath();SH(c,d[2],x,y,s);c.fillStyle='#ffeec4';c.fill();c.restore()};",wn="const KITS={tower:'camera|coffee|map',clock:'bus|umbrella|camera',pagoda:'tea|scooter|camera',arch:'camera|wine|map',bridge:'ship|sun|camera',lantern:'scooter|camera|tea',dome:'sun|camera|map',skyline:'coffee|bus|phone',mountain:'tent|sun|backpack'};",mn="const STK=(c,g,x,y,s,col,rot,k)=>{if(k<=0)return;c.save();c.translate(x,y);c.rotate(rot);c.scale(k,k);c.shadowColor='rgba(80,40,30,.3)';c.shadowBlur=s*.1;c.shadowOffsetY=s*.05;M.glyph(c,g,0,0,s,{color:'#ffffff',glow:false,width:7});c.shadowColor='transparent';M.glyph(c,g,0,0,s,{color:col,glow:false,width:2.6});c.restore()};const SCOL=['#1b2a41','#e0567a','#2f9e8f','#f08a3c','#5f6fd0'];",kn="const FRAME=(c,x,y,w,h,k,col,lw)=>{if(k<=0)return;const P=[],C=[[x,y],[x+w,y],[x+w,y+h],[x,y+h],[x+w*.1,y-h*.02]];for(let j=0;j<4;j++)for(let i=0;i<16;i++){const f=i/16,a=C[j],b=C[j+1];P.push([M.lerp(a[0],b[0],f)+(M.noise(j*4+i*.4,1)-.5)*lw*1.6,M.lerp(a[1],b[1],f)+(M.noise(j*4+i*.4,7)-.5)*lw*1.6])}P.push(C[4]);c.strokeStyle=col;M.pen(c,P,k,lw)};",xo=Mn+yn+mn+kn,Al=[Vt("travel-boarding-pass","Thẻ lên máy bay",5,{text:"Đà Lạt",sub:"12.08 · 07:45 · Cổng 3",items:"SGN|DLI"},`function render(ctx,t,env){
4797
+ }`)],yn=Y.find(t=>t.id==="travel"),Vt=(t,e,c,o,n)=>({id:t,name:e,category:yn.name,pack:"travel",duration:c,params:{accent:yn.accent,position:"center",...o,style:"travel"},code:n}),Ge="const NAVY='#1b2a41',CREAM='#fffaf2',MUT='#7d8798';const CARD=(c,x,y,w,h,r,f)=>{c.save();c.shadowColor='rgba(12,20,40,.32)';c.shadowBlur=r*2;c.shadowOffsetY=r*.5;c.fillStyle=f||CREAM;M.rr(c,x,y,w,h,r);c.fill();c.restore()};const SKY=(c,y,h,acc)=>{const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,NAVY);g.addColorStop(.62,M.mix(acc,NAVY,.3));g.addColorStop(1,M.mix(acc,'#ffd27a',.55));return g};const PLANE=(c,x,y,s,a)=>{c.save();c.translate(x,y);c.rotate(a||0);c.scale(s,s);c.beginPath();c.moveTo(1,0);c.quadraticCurveTo(.95,-.13,.7,-.13);c.lineTo(.18,-.13);c.lineTo(-.22,-.85);c.lineTo(-.42,-.85);c.lineTo(-.2,-.13);c.lineTo(-.62,-.13);c.lineTo(-.8,-.4);c.lineTo(-.95,-.4);c.lineTo(-.85,0);c.lineTo(-.95,.4);c.lineTo(-.8,.4);c.lineTo(-.62,.13);c.lineTo(-.2,.13);c.lineTo(-.42,.85);c.lineTo(-.22,.85);c.lineTo(.18,.13);c.lineTo(.7,.13);c.quadraticCurveTo(.95,.13,1,0);c.closePath();c.fill();c.restore()};const STAR=(c,x,y,r)=>{c.beginPath();for(let i=0;i<10;i++){const q=i%2?r*.45:r,a=-Math.PI/2+i*Math.PI/5;c.lineTo(x+Math.cos(a)*q,y+Math.sin(a)*q)}c.closePath()};const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'center';c.textBaseline='middle';c.fillText(s,x,y)};const CY=(S,h)=>Math.max(S.top+h/2,Math.min(S.y,S.bot-h/2));",wn="const PAPER='#fdf6e9',TINTS=['#a9b4e8','#b8d4bf','#f3c39b'],PINK='#ff5f9e';const WALL=(c,W,H,u,font,name,t,cols,a,sl)=>{const z=u*.2,s=String(name||'').toUpperCase()+' ';c.save();c.font=font(z);c.textBaseline='middle';c.textAlign='left';c.globalAlpha*=a;const tw=Math.max(1,c.measureText(s).width),n=Math.ceil(H/(z*.92))+1;for(let i=0;i<n;i++){const d=i%2?1:-1,off=((t*u*.07*d+i*tw*.41+(sl||0)*d*W)%tw+tw)%tw;c.fillStyle=cols[i%cols.length];for(let x=off-tw;x<W;x+=tw)c.fillText(s,x,i*z*.92+z*.4)}c.restore()};",mn="const LMS={tower:'p -.42 0 -.22 -.3 -.13 -.56 -.05 -.9 0 -1 .05 -.9 .13 -.56 .22 -.3 .42 0|r -.27 -.33 .54 .04 r -.16 -.58 .32 .035 p -.2 0 -.12 -.16 0 -.2 .12 -.16 .2 0 r -.012 -.85 .024 .25|',clock:'r -.17 -.74 .34 .74 p -.21 -.74 0 -1 .21 -.74 r -.25 -.06 .5 .06|r -.08 -.36 .05 .13 r .03 -.36 .05 .13 r -.04 -.18 .08 .18 c 0 -.55 .125|c 0 -.55 .1',pagoda:'p -.3 -.3 .3 -.3 .42 -.24 -.42 -.24 r -.28 -.24 .56 .24 p -.25 -.54 .25 -.54 .36 -.48 -.36 -.48 r -.22 -.48 .44 .24 p -.19 -.76 .19 -.76 .3 -.7 -.3 -.7 r -.17 -.7 .34 .22 p -.11 -.93 .11 -.93 .23 -.88 -.23 -.88 r -.12 -.88 .24 .18 r -.015 -1 .03 .1|r -.06 -.15 .12 .15 r -.04 -.42 .08 .1 r -.03 -.64 .06 .08|',arch:'r -.42 -.84 .84 .84 r -.46 -1 .92 .16|p -.14 0 -.14 -.38 -.08 -.5 0 -.53 .08 -.5 .14 -.38 .14 0 r -.42 -.72 .84 .03 r -.35 -.6 .12 .2 r .23 -.6 .12 .2|',bridge:'r -.5 -.26 1 .07 r -.33 -.82 .06 .82 r .27 -.82 .06 .82 p -.3 -.8 0 -.28 .3 -.8 .3 -.74 0 -.22 -.3 -.74 p -.3 -.74 -.5 -.37 -.5 -.42 -.3 -.8 p .3 -.8 .5 -.42 .5 -.37 .3 -.74|r -.16 -.5 .012 .25 r .15 -.5 .012 .25 r -.42 -.4 .012 .14 r .41 -.4 .012 .14 r -.5 -.2 1 .02|',lantern:'c -.22 -.6 .17 c .2 -.7 .19 c 0 -.36 .2 r -.235 -.95 .03 .2 r .185 -1 .03 .12 r -.015 -.66 .03 .12 r -.24 -.45 .04 .1 r .18 -.53 .04 .1 r -.02 -.17 .04 .12|r -.3 -.8 .16 .04 r .12 -.9 .16 .04 r -.08 -.58 .16 .04 r -.08 -.18 .16 .04 r -.39 -.61 .34 .025 r .01 -.71 .38 .025 r -.2 -.37 .4 .025|',dome:'r -.4 -.3 .8 .3 r -.3 -.42 .6 .12 c 0 -.42 .3 r -.015 -.95 .03 .25 c 0 -.96 .035 r -.48 -.55 .06 .55 r .42 -.55 .06 .55 p -.48 -.55 -.45 -.64 -.42 -.55 p .42 -.55 .45 -.64 .48 -.55|r -.08 -.2 .16 .2 c 0 -.2 .08 r -.4 -.31 .8 .02 r -.3 -.44 .6 .02|',skyline:'r -.46 -.45 .18 .45 r -.26 -.75 .17 .75 r -.07 -1 .14 1 r .09 -.62 .17 .62 r .28 -.4 .18 .4 p -.07 -1 0 -1.1 .07 -1|r -.22 -.7 .09 .02 r -.22 -.6 .09 .02 r -.22 -.5 .09 .02 r -.04 -.9 .08 .02 r -.04 -.8 .08 .02 r -.04 -.7 .08 .02 r -.04 -.6 .08 .02 r .12 -.55 .11 .02 r .12 -.45 .11 .02 r -.42 -.36 .1 .02 r .32 -.32 .1 .02|',mountain:'p -.5 0 -.16 -.72 -.02 -.52 .12 -.9 .5 0|p .2 -.71 .14 -.75 .09 -.69 .04 -.73 .12 -.9 p -.12 -.62 -.17 -.58 -.22 -.6 -.16 -.72|c .34 -.93 .1'};const SH=(c,str,x,y,s)=>{const a=String(str).split(' ').filter(Boolean);let i=0;while(i<a.length){const k=a[i++];if(k==='c'){const X=+a[i++],Y=+a[i++],R=+a[i++];c.moveTo(x+(X+R)*s,y+Y*s);c.arc(x+X*s,y+Y*s,R*s,0,M.TAU)}else if(k==='r'){const X=+a[i++],Y=+a[i++];c.rect(x+X*s,y+Y*s,+a[i++]*s,+a[i++]*s)}else{let f=1;while(i<a.length&&!isNaN(+a[i])){const X=+a[i++],Y=+a[i++];f?c.moveTo(x+X*s,y+Y*s):c.lineTo(x+X*s,y+Y*s);f=0}c.closePath()}}};const LM=(c,k,x,y,s,col,dk)=>{const d=(LMS[k]||LMS.lantern).split('|');c.save();c.lineJoin='round';c.beginPath();SH(c,d[0],x,y,s);c.shadowColor='rgba(80,40,30,.28)';c.shadowBlur=s*.05;c.shadowOffsetY=s*.025;c.strokeStyle='#ffffff';c.lineWidth=s*.03;c.stroke();c.shadowColor='transparent';c.fillStyle=col;c.fill();c.beginPath();SH(c,d[1],x,y,s);c.fillStyle=dk;c.fill();c.beginPath();SH(c,d[2],x,y,s);c.fillStyle='#ffeec4';c.fill();c.restore()};",kn="const KITS={tower:'camera|coffee|map',clock:'bus|umbrella|camera',pagoda:'tea|scooter|camera',arch:'camera|wine|map',bridge:'ship|sun|camera',lantern:'scooter|camera|tea',dome:'sun|camera|map',skyline:'coffee|bus|phone',mountain:'tent|sun|backpack'};",Sn="const STK=(c,g,x,y,s,col,rot,k)=>{if(k<=0)return;c.save();c.translate(x,y);c.rotate(rot);c.scale(k,k);c.shadowColor='rgba(80,40,30,.3)';c.shadowBlur=s*.1;c.shadowOffsetY=s*.05;M.glyph(c,g,0,0,s,{color:'#ffffff',glow:false,width:7});c.shadowColor='transparent';M.glyph(c,g,0,0,s,{color:col,glow:false,width:2.6});c.restore()};const SCOL=['#1b2a41','#e0567a','#2f9e8f','#f08a3c','#5f6fd0'];",vn="const FRAME=(c,x,y,w,h,k,col,lw)=>{if(k<=0)return;const P=[],C=[[x,y],[x+w,y],[x+w,y+h],[x,y+h],[x+w*.1,y-h*.02]];for(let j=0;j<4;j++)for(let i=0;i<16;i++){const f=i/16,a=C[j],b=C[j+1];P.push([M.lerp(a[0],b[0],f)+(M.noise(j*4+i*.4,1)-.5)*lw*1.6,M.lerp(a[1],b[1],f)+(M.noise(j*4+i*.4,7)-.5)*lw*1.6])}P.push(C[4]);c.strokeStyle=col;M.pen(c,P,k,lw)};",ho=wn+mn+Sn+vn,Pl=[Vt("travel-boarding-pass","Thẻ lên máy bay",5,{text:"Đà Lạt",sub:"12.08 · 07:45 · Cổng 3",items:"SGN|DLI"},`function render(ctx,t,env){
4798
4798
  ${Ge}
4799
4799
  // Boarding pass: the pass card slides up, the from / to airport codes (items) flicker in like a departure board on
4800
4800
  // both sides of a plane that flies along a dotted line, destination (text) and date / time / gate (sub) under them,
@@ -5023,7 +5023,7 @@
5023
5023
  const ba=M.ease.outBack(M.range(t,1.4,1.8));if(ba>0){ctx.save();ctx.translate(x+w-h*.14-bw/2,y+h/2);ctx.scale(ba,ba);ctx.fillStyle='#2fb67c';ctx.beginPath();ctx.arc(0,0,bw/2,0,M.TAU);ctx.fill();ctx.fillStyle='#ffffff';M.icon(ctx,'check',0,0,bw*.26);ctx.restore()}
5024
5024
  ctx.restore()
5025
5025
  }`),Vt("travel-city-poster","Poster thành phố cắt dán",4.5,{text:"HỘI AN",landmark:"lantern",items:"scooter|camera|tea|ticket|sun",sub:"Phố cổ đèn lồng"},`function render(ctx,t,env){
5026
- ${xo+wn}
5026
+ ${ho+kn}
5027
5027
  // Retro collage city poster (full frame): cream paper, the city name (text) as a wall of huge pastel caps scrolling
5028
5028
  // row by row, a duotone landmark (landmark: tower clock pagoda arch bridge lantern dome skyline mountain) rises and
5029
5029
  // settles, a pink marker frame draws round it, stickers (items = icon names, up to 5) pop in, tagline chip (sub).
@@ -5039,7 +5039,7 @@
5039
5039
  const ca=M.ease.outBack(M.range(t,1.7,2.1));if(p.sub&&ca>0){const f=M.fit(ctx,String(p.sub),z=>sk.font(z,'h'),u*.036,S.w*.8,1);ctx.font=f.font;const cw=ctx.measureText(f.lines[0]||'').width+u*.07,ch=f.size*1.9,cy=Math.min(S.bot-ch,by+u*.05);ctx.save();ctx.translate(S.cx,cy+ch/2);ctx.rotate(-.03);ctx.scale(ca,ca);ctx.fillStyle='#1b2a41';M.rr(ctx,-cw/2,-ch/2,cw,ch,ch/2);ctx.fill();ctx.fillStyle=PAPER;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(f.lines[0]||'',0,0);ctx.restore()}
5040
5040
  ctx.restore()
5041
5041
  }`),Vt("travel-city-montage","Chuỗi thành phố cắt dán",7.5,{items:"HÀ NỘI:pagoda|ĐÀ NẴNG:bridge|SÀI GÒN:skyline"},`function render(ctx,t,env){
5042
- ${xo+wn}
5042
+ ${ho+kn}
5043
5043
  // Retro collage city montage (full frame): cities in turn from items "CITY:landmark" (up to 4), each with its own
5044
5044
  // pastel name wall, a duotone landmark rising, a pink marker frame, three stickers and a name chip; a wipe with a
5045
5045
  // pink marker bar swaps one city for the next.
@@ -5055,7 +5055,7 @@
5055
5055
  if(i>0&&tl<.5){CITY(i-1,tl+L);const e=M.ease.inOutCubic(M.range(tl,0,.5)),x=W*(1-e);ctx.save();ctx.beginPath();ctx.rect(x,0,W-x+1,H);ctx.clip();CITY(i,tl);ctx.restore();ctx.fillStyle=PINK;ctx.fillRect(x-u*.012,0,u*.024,H)}else CITY(i,tl)
5056
5056
  ctx.restore()
5057
5057
  }`),Vt("travel-name-wall","Tường tên địa danh",6,{text:"ĐÀ LẠT",number:1},`function render(ctx,t,env){
5058
- ${Mn}
5058
+ ${wn}
5059
5059
  // Name wall (full frame, background): the place name (text) repeated as rows of huge pastel caps that slide in and
5060
5060
  // keep scrolling sideways in opposite directions; number 1 = on cream paper, 0 = letters only over the footage.
5061
5061
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.4,.5),u=Math.min(W,H)
@@ -5063,7 +5063,7 @@
5063
5063
  WALL(ctx,W,H,u,z=>sk.font(z,'h'),p.text,t,TINTS,+p.number!==0?.6:.75,(1-M.ease.outCubic(M.range(t,0,1.2)))*.6)
5064
5064
  ctx.restore()
5065
5065
  }`),Vt("travel-landmark-rise","Địa danh trồi lên",4,{text:"Chùa cổ Hà Nội",landmark:"pagoda"},`function render(ctx,t,env){
5066
- ${yn+kn}
5066
+ ${mn+vn}
5067
5067
  // Landmark rise (compact): a peach disc pops, a duotone landmark (landmark: tower clock pagoda arch bridge lantern
5068
5068
  // dome skyline mountain) rises out of its base line and settles, a pink marker frame draws round it, label (text) below.
5069
5069
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.4),u=S.u,s=u*.38,tot=s*1.3+u*.1,cy=Math.max(S.top+tot/2,Math.min(S.y,S.bot-tot/2)),by=cy-tot/2+s*1.2,bx=S.cx
@@ -5073,7 +5073,7 @@
5073
5073
  const la=M.ease.outBack(M.range(t,1.2,1.6));if(p.text&&la>0){const f=M.fit(ctx,String(p.text),z=>sk.font(z,'h'),u*.042,S.w*.8,1);ctx.font=f.font;const cw=ctx.measureText(f.lines[0]||'').width+u*.07,ch=f.size*1.8;ctx.save();ctx.translate(bx,by+s*.12+ch/2);ctx.rotate(-.025);ctx.scale(la,la);ctx.fillStyle='#1b2a41';M.rr(ctx,-cw/2,-ch/2,cw,ch,ch/2);ctx.fill();ctx.fillStyle='#fdf6e9';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(f.lines[0]||'',0,0);ctx.restore()}
5074
5074
  ctx.restore()
5075
5075
  }`),Vt("travel-sticker-burst","Sticker trải nghiệm",4,{text:"Trải nghiệm không thể bỏ lỡ",items:"camera|scooter|coffee|ship|tent"},`function render(ctx,t,env){
5076
- ${mn}
5076
+ ${Sn}
5077
5077
  // Sticker burst: the title (text) on a cream paper card with a pink marker underline, then up to 5 die-cut stickers
5078
5078
  // (items = icon names) burst out from behind it with overshoot and settle around it, tilted, bobbing.
5079
5079
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.4),u=S.u,g=M.items(p,5),n=Math.max(1,g.length)
@@ -5085,7 +5085,7 @@
5085
5085
  ctx.strokeStyle='#ff5f9e';M.pen(ctx,M.linePts(-cw*.32,ch/2-u*.03,cw*.32,ch/2-u*.035,5,30,u*.006),M.range(t,.4,.9),u*.009);ctx.restore()
5086
5086
  ctx.restore()
5087
5087
  }`),Vt("travel-collage-cta","Thẻ kêu gọi cắt dán",5,{text:"Đặt tour ngay",sub:"Chỉ từ 2.990.000đ · Tháng 12",place:"SA PA",landmark:"mountain",items:"plane|suitcase|camera"},`function render(ctx,t,env){
5088
- ${xo}
5088
+ ${ho}
5089
5089
  // Collage end card: a cream poster panel stamps in with the place name (place) as a pastel wall, a duotone landmark
5090
5090
  // (landmark) with a pink marker frame and stickers (items, up to 3); the big CTA pill (text) slams in, sub under it.
5091
5091
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.4),u=S.u,acc=sk.acc,lk=String(p.landmark||'mountain')
@@ -5100,7 +5100,7 @@
5100
5100
  const ca=M.range(t,1.5,1.7),cs=1+.6*(1-M.ease.outCubic(ca));if(ca>0){const f=M.fit(ctx,String(p.text||'').toUpperCase(),z=>sk.font(z,'h'),h*.06,w*.75,1);ctx.font=f.font;const pw=ctx.measureText(f.lines[0]||'').width+h*.1,ph=f.size*1.9;ctx.save();ctx.globalAlpha*=ca;ctx.translate(S.cx,y+h*.76);ctx.rotate(-.03);ctx.scale(cs,cs);ctx.shadowColor='rgba(40,20,10,.3)';ctx.shadowBlur=u*.02;ctx.shadowOffsetY=u*.008;ctx.fillStyle=acc;M.rr(ctx,-pw/2,-ph/2,pw,ph,ph/2);ctx.fill();ctx.shadowColor='transparent';ctx.fillStyle=M.readable(acc);ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(f.lines[0]||'',0,f.size*.04);ctx.restore()}
5101
5101
  const sa=M.ease.outCubic(M.range(t,1.9,2.3));if(sa>0){const f=M.fit(ctx,String(p.sub||''),z=>sk.font(z,'h'),h*.034,w*.86,1);ctx.globalAlpha*=sa;ctx.font=f.font;ctx.fillStyle='#1b2a41';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(f.lines[0]||'',S.cx,y+h*.89)}
5102
5102
  ctx.restore()
5103
- }`)],Sn=Y.find(t=>t.id==="menu"),Oe=(t,e,c,o,n)=>({id:t,name:e,category:Sn.name,pack:"menu",duration:c,params:{accent:Sn.accent,position:"center",...o,style:"menu"},code:n}),Ne="const CR='#fff6e8',BR='#2a1712';const BOXY=(S,h)=>Math.max(S.top,Math.min(S.y-h/2,S.bot-h));const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'center';c.textBaseline='middle';c.fillText(s||'',x,y)};const PAPER=(c,x,y,w,h,r,acc,d)=>{c.save();c.shadowColor='rgba(42,23,18,.38)';c.shadowBlur=r*1.6;c.shadowOffsetY=r*.4;c.fillStyle=CR;M.rr(c,x,y,w,h,r);c.fill();c.restore();if(d){c.save();c.strokeStyle=M.rgba(acc,.55);c.lineWidth=Math.max(1,r*.1);c.setLineDash([r*.45,r*.35]);M.rr(c,x+r*.55,y+r*.55,w-r*1.1,h-r*1.1,r*.6);c.stroke();c.restore()}};const BOARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(0,0,0,.45)';c.shadowBlur=r*2.5;c.shadowOffsetY=r*.5;c.fillStyle='#8a5330';M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.strokeStyle='rgba(0,0,0,.3)';c.lineWidth=Math.max(1,r*.15);c.stroke();const g=c.createLinearGradient(x,y,x+w,y+h);g.addColorStop(0,'#302a26');g.addColorStop(1,'#1c1815');c.fillStyle=g;M.rr(c,x+r*.9,y+r*.9,w-r*1.8,h-r*1.8,r*.35);c.fill();const R=M.rand(7);c.fillStyle='rgba(255,246,232,.03)';for(let i=0;i<22;i++){c.beginPath();c.ellipse(x+r*2+(w-r*4)*R(),y+r*2+(h-r*4)*R(),w*.07*R()+2,h*.012+1,R()*3,0,M.TAU);c.fill()}c.restore()};const STEAM=(c,x,y,s,t,col)=>{const a0=c.globalAlpha;c.save();c.strokeStyle=col;c.lineCap='round';c.lineWidth=s*.035;for(let i=0;i<3;i++){const ph=(t*.55+i/3)%1;c.globalAlpha=a0*Math.sin(ph*Math.PI)*.75;c.beginPath();for(let j=0;j<=14;j++){const q=j/14,px=x+(i-1)*s*.2+Math.sin(q*5+t*2.5+i*2)*s*.06*(.4+q),py=y-ph*s*.25-q*s*.45;if(j)c.lineTo(px,py);else c.moveTo(px,py)}c.stroke()}c.restore()};const SPL=s=>{const m=String(s).trim().split(' '),l=m[m.length-1]||'';return m.length>1&&/[0-9]/.test(l)?{n:m.slice(0,-1).join(' '),p:l}:{n:String(s),p:''}};const TICK=(s,k)=>{const v=+String(s).replace(/[^0-9]/g,'');if(!v)return s;const n=v*k;return(String(s).includes('.')?M.fmt(n):String(Math.round(n)))+String(s).replace(/[0-9.,]/g,'')};const VND=n=>M.fmt(n)+'đ';",Rl=[Oe("menu-board","Bảng menu phấn",5,{text:"Thực đơn hôm nay",items:"Phở bò tái 55k|Bún chả Hà Nội 50k|Bánh mì đặc biệt 30k|Cà phê sữa đá 25k",sub:"Mở cửa 6:00 – 22:00"},`function render(ctx,t,env){
5103
+ }`)],Tn=Y.find(t=>t.id==="menu"),Oe=(t,e,c,o,n)=>({id:t,name:e,category:Tn.name,pack:"menu",duration:c,params:{accent:Tn.accent,position:"center",...o,style:"menu"},code:n}),Ne="const CR='#fff6e8',BR='#2a1712';const BOXY=(S,h)=>Math.max(S.top,Math.min(S.y-h/2,S.bot-h));const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'center';c.textBaseline='middle';c.fillText(s||'',x,y)};const PAPER=(c,x,y,w,h,r,acc,d)=>{c.save();c.shadowColor='rgba(42,23,18,.38)';c.shadowBlur=r*1.6;c.shadowOffsetY=r*.4;c.fillStyle=CR;M.rr(c,x,y,w,h,r);c.fill();c.restore();if(d){c.save();c.strokeStyle=M.rgba(acc,.55);c.lineWidth=Math.max(1,r*.1);c.setLineDash([r*.45,r*.35]);M.rr(c,x+r*.55,y+r*.55,w-r*1.1,h-r*1.1,r*.6);c.stroke();c.restore()}};const BOARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(0,0,0,.45)';c.shadowBlur=r*2.5;c.shadowOffsetY=r*.5;c.fillStyle='#8a5330';M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.strokeStyle='rgba(0,0,0,.3)';c.lineWidth=Math.max(1,r*.15);c.stroke();const g=c.createLinearGradient(x,y,x+w,y+h);g.addColorStop(0,'#302a26');g.addColorStop(1,'#1c1815');c.fillStyle=g;M.rr(c,x+r*.9,y+r*.9,w-r*1.8,h-r*1.8,r*.35);c.fill();const R=M.rand(7);c.fillStyle='rgba(255,246,232,.03)';for(let i=0;i<22;i++){c.beginPath();c.ellipse(x+r*2+(w-r*4)*R(),y+r*2+(h-r*4)*R(),w*.07*R()+2,h*.012+1,R()*3,0,M.TAU);c.fill()}c.restore()};const STEAM=(c,x,y,s,t,col)=>{const a0=c.globalAlpha;c.save();c.strokeStyle=col;c.lineCap='round';c.lineWidth=s*.035;for(let i=0;i<3;i++){const ph=(t*.55+i/3)%1;c.globalAlpha=a0*Math.sin(ph*Math.PI)*.75;c.beginPath();for(let j=0;j<=14;j++){const q=j/14,px=x+(i-1)*s*.2+Math.sin(q*5+t*2.5+i*2)*s*.06*(.4+q),py=y-ph*s*.25-q*s*.45;if(j)c.lineTo(px,py);else c.moveTo(px,py)}c.stroke()}c.restore()};const SPL=s=>{const m=String(s).trim().split(' '),l=m[m.length-1]||'';return m.length>1&&/[0-9]/.test(l)?{n:m.slice(0,-1).join(' '),p:l}:{n:String(s),p:''}};const TICK=(s,k)=>{const v=+String(s).replace(/[^0-9]/g,'');if(!v)return s;const n=v*k;return(String(s).includes('.')?M.fmt(n):String(Math.round(n)))+String(s).replace(/[0-9.,]/g,'')};const VND=n=>M.fmt(n)+'đ';",zl=[Oe("menu-board","Bảng menu phấn",5,{text:"Thực đơn hôm nay",items:"Phở bò tái 55k|Bún chả Hà Nội 50k|Bánh mì đặc biệt 30k|Cà phê sữa đá 25k",sub:"Mở cửa 6:00 – 22:00"},`function render(ctx,t,env){
5104
5104
  // Chalkboard menu: a wood-framed board drops in, the heading (text) is chalked on with an accent underline, the dishes
5105
5105
  // (items "Name price") write in row by row with dotted leaders while their prices tick up; sub is a small footer.
5106
5106
  ${Ne}
@@ -5340,7 +5340,7 @@
5340
5340
  ctx.fillStyle=acc;ctx.fillRect(-bw/2,-bh/2,bw,bh);ctx.strokeStyle=M.rgba(CR,.7);ctx.lineWidth=u*.002;ctx.setLineDash([u*.006,u*.005]);ctx.strokeRect(-bw/2,-bh/2+u*.006,bw,bh-u*.012);ctx.setLineDash([]);const lf=M.fit(ctx,lab,z=>sk.font(z,'h'),u*.028,w*.42,1);TX(ctx,lf.lines[0],0,u*.002,lf.font,CR);ctx.restore()}
5341
5341
  const bq=M.range(t,1,1.5);if(bq>0&&bq<1){const ox=x+w*.12,oy=y+w*.12;ctx.fillStyle=M.rgba('#ffc23d',1-bq);for(let i=0;i<8;i++){const an=i*M.TAU/8,d=u*(.04+.1*M.ease.outCubic(bq));ctx.save();ctx.translate(ox+Math.cos(an)*d,oy+Math.sin(an)*d);ctx.rotate(an);M.icon(ctx,'star',0,0,u*.012);ctx.restore()}}
5342
5342
  ctx.restore()
5343
- }`)],vn=Y.find(t=>t.id==="auto"),Ie=(t,e,c,o,n)=>({id:t,name:e,category:vn.name,pack:"auto",duration:c,params:{accent:vn.accent,position:"center",...o,style:"auto"},code:n}),Ue="const GR='#0b0b0d';const CHR=(c,x0,y0,x1,y1)=>{const g=c.createLinearGradient(x0,y0,x1,y1);g.addColorStop(0,'#f4f6f8');g.addColorStop(.42,'#8b9198');g.addColorStop(.5,'#2b2e33');g.addColorStop(.62,'#6f757c');g.addColorStop(1,'#e8ebee');return g};const BOX=(S,h)=>Math.max(S.top,Math.min(S.bot-h,S.y-h/2));const PANEL=(c,x,y,w,h,r,acc)=>{c.save();const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,'rgba(32,33,38,.95)');g.addColorStop(1,'rgba(11,11,13,.96)');c.fillStyle=g;c.shadowColor='rgba(0,0,0,.55)';c.shadowBlur=Math.min(w,h)*.12;M.rr(c,x,y,w,h,r);c.fill();c.shadowBlur=0;c.strokeStyle=CHR(c,x,y,x+w*.35,y+h);c.lineWidth=Math.max(1,Math.min(w,h)*.008);M.rr(c,x,y,w,h,r);c.stroke();c.fillStyle=acc;c.fillRect(x+r*1.5,y-1,w*.18,Math.max(3,Math.min(w,h)*.014));c.restore()};const STREAK=(c,x0,x1,y,th,col,a)=>{if(a<=0||x1<=x0)return;c.save();c.globalAlpha*=Math.min(1,a);const g=c.createLinearGradient(x0,0,x1,0);g.addColorStop(0,M.rgba(col,0));g.addColorStop(.8,M.rgba(col,.85));g.addColorStop(1,'#ffffff');c.fillStyle=g;c.shadowColor=col;c.shadowBlur=th*4;c.beginPath();c.moveTo(x0,y);c.lineTo(x1,y-th/2);c.lineTo(x1,y+th/2);c.closePath();c.fill();c.restore()};const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'left';c.textBaseline='middle';c.fillText(s,x,y)};const UP=s=>String(s||'').toUpperCase();const LV=s=>{const w=String(s).split(' ');let j=-1;w.forEach((q,m)=>{if(/[0-9]/.test(q))j=m});if(j<0)j=w.length;return{l:w.slice(0,j).join(' '),v:w.slice(j).join(' '),n:w[j]||''}};",Pl=[Ie("auto-speedometer","Đồng hồ tốc độ",4.5,{text:"Tăng tốc mạnh mẽ",number:240,sub:"km/h"},`function render(ctx,t,env){
5343
+ }`)],Cn=Y.find(t=>t.id==="auto"),Ie=(t,e,c,o,n)=>({id:t,name:e,category:Cn.name,pack:"auto",duration:c,params:{accent:Cn.accent,position:"center",...o,style:"auto"},code:n}),Ue="const GR='#0b0b0d';const CHR=(c,x0,y0,x1,y1)=>{const g=c.createLinearGradient(x0,y0,x1,y1);g.addColorStop(0,'#f4f6f8');g.addColorStop(.42,'#8b9198');g.addColorStop(.5,'#2b2e33');g.addColorStop(.62,'#6f757c');g.addColorStop(1,'#e8ebee');return g};const BOX=(S,h)=>Math.max(S.top,Math.min(S.bot-h,S.y-h/2));const PANEL=(c,x,y,w,h,r,acc)=>{c.save();const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,'rgba(32,33,38,.95)');g.addColorStop(1,'rgba(11,11,13,.96)');c.fillStyle=g;c.shadowColor='rgba(0,0,0,.55)';c.shadowBlur=Math.min(w,h)*.12;M.rr(c,x,y,w,h,r);c.fill();c.shadowBlur=0;c.strokeStyle=CHR(c,x,y,x+w*.35,y+h);c.lineWidth=Math.max(1,Math.min(w,h)*.008);M.rr(c,x,y,w,h,r);c.stroke();c.fillStyle=acc;c.fillRect(x+r*1.5,y-1,w*.18,Math.max(3,Math.min(w,h)*.014));c.restore()};const STREAK=(c,x0,x1,y,th,col,a)=>{if(a<=0||x1<=x0)return;c.save();c.globalAlpha*=Math.min(1,a);const g=c.createLinearGradient(x0,0,x1,0);g.addColorStop(0,M.rgba(col,0));g.addColorStop(.8,M.rgba(col,.85));g.addColorStop(1,'#ffffff');c.fillStyle=g;c.shadowColor=col;c.shadowBlur=th*4;c.beginPath();c.moveTo(x0,y);c.lineTo(x1,y-th/2);c.lineTo(x1,y+th/2);c.closePath();c.fill();c.restore()};const TX=(c,s,x,y,f,col,al)=>{c.font=f;c.fillStyle=col;c.textAlign=al||'left';c.textBaseline='middle';c.fillText(s,x,y)};const UP=s=>String(s||'').toUpperCase();const LV=s=>{const w=String(s).split(' ');let j=-1;w.forEach((q,m)=>{if(/[0-9]/.test(q))j=m});if(j<0)j=w.length;return{l:w.slice(0,j).join(' '),v:w.slice(j).join(' '),n:w[j]||''}};",Bl=[Ie("auto-speedometer","Đồng hồ tốc độ",4.5,{text:"Tăng tốc mạnh mẽ",number:240,sub:"km/h"},`function render(ctx,t,env){
5344
5344
  ${Ue}
5345
5345
  // Speedometer gauge: chrome-rimmed dial with tick marks, labels and a red zone; the needle sweeps to the speed (number)
5346
5346
  // with a glowing red value arc, the digital readout counts up with the unit (sub), the caption (text) under the dial.
@@ -5601,7 +5601,7 @@
5601
5601
  const sq=M.ease.outCubic(M.range(t,.55,1));if(sub&&sq>0){const by=sy+sh+u*.012,bh=u*.05;ctx.save();ctx.globalAlpha*=sq;ctx.beginPath();ctx.rect(x,by-2,(bw2+sl)*sq+2,bh+4);ctx.clip();ctx.fillStyle='rgba(11,11,13,.85)';ctx.beginPath();ctx.moveTo(x+rw*.4,by);ctx.lineTo(x+bw2+sl*.6,by);ctx.lineTo(x+bw2,by+bh);ctx.lineTo(x+rw*.4-sl*.4,by+bh);ctx.closePath();ctx.fill();ctx.fillStyle=acc;ctx.fillRect(x+rw*.4,by,Math.max(2,u*.004),bh)
5602
5602
  TX(ctx,sf.lines[0]||'',x+rw*.4+u*.025,by+bh*.52,sf.font,'rgba(255,255,255,.88)');ctx.restore()}
5603
5603
  ctx.restore()
5604
- }`)],Tn=t=>Y.find(e=>e.id===t),Cn=(t,e,c,o,n,s)=>({id:t,name:e,category:Tn(c).name,pack:c,duration:o,params:{position:"center",...n,accent:Tn(c).accent,style:c},code:s}),zl=`function render(ctx,t,env){
5604
+ }`)],An=t=>Y.find(e=>e.id===t),Rn=(t,e,c,o,n,s)=>({id:t,name:e,category:An(c).name,pack:c,duration:o,params:{position:"center",...n,accent:An(c).accent,style:c},code:s}),Wl=`function render(ctx,t,env){
5605
5605
  // One photo sticker pops in (back-eased scale with a small turn), floats while the caption pill slides up under it,
5606
5606
  // then shrinks away. A soft accent disc sits behind it so the cut-out reads on any footage.
5607
5607
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.45,.35),u=S.u,acc=sk.acc
@@ -5616,7 +5616,7 @@
5616
5616
  ctx.globalAlpha=(1-k.o)*q;ctx.fillStyle=acc;M.rr(ctx,cx-w/2,y,w,h,h/2);ctx.fill();ctx.fillStyle=M.readable(acc);ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(f.lines[0],cx,y+h/2)
5617
5617
  const sub=String(p.sub||'');if(sub){ctx.font=sk.font(u*.04,'s','600');ctx.globalAlpha=(1-k.o)*M.range(t,.6,1);ctx.lineWidth=u*.008;ctx.strokeStyle='rgba(0,0,0,.5)';ctx.strokeText(sub,cx,y+h+u*.045);ctx.fillStyle='#ffffff';ctx.fillText(sub,cx,y+h+u*.045)}}
5618
5618
  ctx.restore()
5619
- }`,Bl=`function render(ctx,t,env){
5619
+ }`,Hl=`function render(ctx,t,env){
5620
5620
  // Three photo stickers fan in one after another (left, right, centre on top), each a little turned, floating out of
5621
5621
  // phase; the caption sits under the group. Items = three sticker ids "a|b|c".
5622
5622
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.35),u=S.u,acc=sk.acc
@@ -5631,7 +5631,7 @@
5631
5631
  ctx.globalAlpha=(1-k.o)*q;ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.lineWidth=u*.012;ctx.strokeStyle='rgba(0,0,0,.55)';ctx.strokeText(f.lines[0],S.cx,y);ctx.fillStyle='#ffffff';ctx.fillText(f.lines[0],S.cx,y)
5632
5632
  ctx.fillStyle=acc;ctx.fillRect(S.cx-u*.06,y+f.lh*.62,u*.12*q,u*.008)}
5633
5633
  ctx.restore()
5634
- }`,Wl=[["home","Căn hộ mẫu","home-apartment","Bàn giao nhà","home-keys|home-house|home-apartment","home"],["health","Khám tổng quát","health-stethoscope","Chăm sóc sức khoẻ","health-pills|health-thermometer|health-firstaid","heart"],["fit","Tập mỗi ngày","fit-dumbbell","Đồ tập thiết yếu","fit-shoe|fit-bottle|fit-gloves","dumbbell"],["travel","Đi Hội An","travel-lantern","Sẵn sàng lên đường","travel-passport|travel-camera|travel-suitcase","plane"],["menu","Phở bò gia truyền","menu-pho","Combo sáng","menu-banhmi|menu-milktea|menu-coffee","coffee"],["auto","Xe điện mới","auto-ev","Trải nghiệm lái thử","auto-keyfob|auto-charger|auto-wheel","car"]].flatMap(([t,e,c,o,n,s])=>[Cn(t+"-photo-pop","Sticker ảnh thật",t,4,{text:e,photo:c,glyph:s,sub:""},zl),Cn(t+"-photo-trio","Bộ 3 sticker ảnh",t,4.5,{text:o,items:n,glyph:s},Bl)]),An=Y.find(t=>t.id==="cine"),ae=(t,e,c,o,n)=>({id:t,name:e,category:An.name,pack:"cine",duration:c,params:{accent:An.accent,position:"center",...o,style:"cine"},code:n}),ho="const HX=(c,d)=>/^#[0-9a-f]{6}$/i.test(c)?c:d,WH='#ffffff',BK='#000000',TAU=Math.PI*2,E=M.ease,MX=M.mix,RA=M.rgba,RG=M.range;const GL=(c,x,y,r,l,a)=>{if(!(a>0&&r>0))return;a=Math.min(1,a);c.save();c.globalCompositeOperation='screen';const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,RA(l,a));g.addColorStop(.3,RA(l,a*.4));g.addColorStop(1,RA(l,0));c.fillStyle=g;c.fillRect(x-r,y-r,r*2,r*2);c.restore()};const SP=(c,x,y,s,w,r)=>{c.save();c.translate(x,y);c.rotate(r);c.beginPath();c.moveTo(s,0);for(let i=0;i<4;i++){c.bezierCurveTo(s*w,s*w,s*w,s*w,0,s);c.rotate(Math.PI/2)}c.closePath();c.restore()};const STAR=(c,x,y,s,l,a,r=0)=>{if(!(a>0&&s>0))return;a=Math.min(1,a);GL(c,x,y,s*2.4,l,.6*a);c.save();c.globalAlpha=a;const f=c.createLinearGradient(x-s*3,0,x+s*3,0);f.addColorStop(0,'rgba(255,255,255,0)');f.addColorStop(.5,'rgba(255,255,255,.75)');f.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=f;c.fillRect(x-s*3,y-s*.025,s*6,s*.05);c.shadowColor=l;c.shadowBlur=s*.9;c.fillStyle=MX(l,WH,.7);SP(c,x,y,s,.06,r);c.fill();c.shadowBlur=0;c.fillStyle=WH;SP(c,x,y,s*.5,.05,r);c.fill();c.restore()};",ic=ho+"const BEGIN=(c,t,e,B,N,F,A)=>{const W=e.width,H=e.height,D=e.duration,p=e.params||{},port=H>W*1.1,u=Math.min(W,H),k=E.outCubic(RG(t,0,.45)),o={e,t,W,H,D,p,port,u,k,bg:HX(p.bg,B),nx:HX(p.next,N),fg:HX(p.fg,F),ac:HX(p.glow,A),cx:W/2,cy:H*(port?.44:.46),q:RG(t,D-.45,D),end:t<=0||t>=D};c.fillStyle=t>=D?o.nx:o.bg;c.fillRect(0,0,W,H);if(o.end)return o;c.save();c.globalAlpha=k;const g=c.createRadialGradient(o.cx,o.cy,0,o.cx,o.cy,Math.hypot(W,H)*.62);g.addColorStop(0,MX(o.bg,o.fg,.12));g.addColorStop(.45,o.bg);g.addColorStop(1,MX(o.bg,BK,.55));c.fillStyle=g;c.fillRect(0,0,W,H);c.restore();GL(c,o.cx,o.cy,u*.95,o.fg,.2*k);GL(c,o.cx,o.cy,u*.8,WH,.3*Math.sin(Math.PI*RG(t,0,.7)));return o};const END=(c,o,x,y)=>{const {W,H,u,t,k,p,D,q}=o;let r=M.rand(17);c.save();c.fillStyle=MX(o.fg,WH,.5);for(let i=0;i<26;i++){const X=r()*W+Math.sin(t*.6+i)*u*.02,Y=((r()*H-t*u*(.015+.04*r()))%H+H)%H,z=u*(.0015+.004*r()),w=k*(.35+.65*Math.abs(Math.sin(t*1.3+i)));c.globalAlpha=w*.7;c.beginPath();c.arc(X,Y,z,0,TAU);c.fill()}r=M.rand(Math.floor(t*24)*131+7);const n=W*H/1600;c.globalAlpha=k;for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,255,255,.07)':'rgba(0,0,0,.11)';c.fillRect(r()*W,r()*H,1.6,1.6)}c.restore();const tx=String(p.text||''),sb=String(p.sub||''),a=E.outCubic(RG(t,.55,1.15))*(1-RG(t,D-.8,D-.45));if(a>0&&(tx||sb)){const S=M.safe(o.e,'lower'),sk=M.skin(o.e,p),s=u*(o.port?.062:.056);let Y=(o.port?H*.76:H*.84)+(1-a)*s*.3;c.save();c.globalAlpha=a;c.textAlign='center';c.textBaseline='middle';c.shadowColor=RA(o.fg,.8);c.shadowBlur=s*.6;c.fillStyle='#fff6ec';if(tx){const f=M.fit(c,tx,z=>sk.font(z,'h'),s,S.w*.86,2);c.font=f.font;Y-=(f.lines.length-1)*f.lh/2;f.lines.forEach(l=>{c.fillText(l,S.cx,Y);Y+=f.lh});Y+=f.size*.95-f.lh}if(sb){M.ls(c,s*.12);const g=M.fit(c,sb.toUpperCase(),z=>sk.font(z,'s'),s*.36,S.w*.8,1);c.font=g.font;c.globalAlpha=a*.8;c.fillText(g.lines[0]||'',S.cx,Y)}c.restore()}if(q<=0)return;if(q>=.86){c.fillStyle=o.nx;c.fillRect(0,0,W,H);return}const R=Math.hypot(Math.max(x,W-x),Math.max(y,H-y)),b=E.outBack(RG(q,0,.3)),g=RG(q,.24,.86),s=M.lerp(u*.1*b,R*1.08,g*g*g),j=g*.6;const w=M.lerp(.07,1,Math.pow(g,1.6));GL(c,x,y,s*2.5+u*.15,WH,.7*b);c.save();c.shadowColor=WH;c.shadowBlur=Math.min(u*.12,s*.6+u*.02);c.fillStyle=MX(WH,o.nx,.15);SP(c,x,y,s*1.05+u*.012,w,j);c.fill();c.shadowBlur=0;c.fillStyle=MX(WH,o.nx,RG(q,.2,.45));SP(c,x,y,s,w,j);c.fill();c.restore();if(g<.6)STAR(c,x,y,s*.55+u*.02,WH,1-g/.6,j)};",$a=ic+"const STARS=(c,o,n,m)=>{const r=M.rand(5);c.save();c.fillStyle=WH;for(let i=0;i<n;i++){const x=r()*o.W,y=r()*m,s=o.u*(.0012+.0028*r());c.globalAlpha=o.k*(.25+.75*Math.abs(Math.sin(o.t*1.6+i*2.4)));c.beginPath();c.arc(x,y,s,0,TAU);c.fill()}c.restore()};",Hl=[ae("cine-night-house","Ngôi nhà dưới trời sao",3.5,{bg:"#0b1633",next:"#c8102e",fg:"#ffd27a",glow:"#36e0c8",text:"",sub:""},`function render(c,t,env){
5634
+ }`,Ll=[["home","Căn hộ mẫu","home-apartment","Bàn giao nhà","home-keys|home-house|home-apartment","home"],["health","Khám tổng quát","health-stethoscope","Chăm sóc sức khoẻ","health-pills|health-thermometer|health-firstaid","heart"],["fit","Tập mỗi ngày","fit-dumbbell","Đồ tập thiết yếu","fit-shoe|fit-bottle|fit-gloves","dumbbell"],["travel","Đi Hội An","travel-lantern","Sẵn sàng lên đường","travel-passport|travel-camera|travel-suitcase","plane"],["menu","Phở bò gia truyền","menu-pho","Combo sáng","menu-banhmi|menu-milktea|menu-coffee","coffee"],["auto","Xe điện mới","auto-ev","Trải nghiệm lái thử","auto-keyfob|auto-charger|auto-wheel","car"]].flatMap(([t,e,c,o,n,s])=>[Rn(t+"-photo-pop","Sticker ảnh thật",t,4,{text:e,photo:c,glyph:s,sub:""},Wl),Rn(t+"-photo-trio","Bộ 3 sticker ảnh",t,4.5,{text:o,items:n,glyph:s},Hl)]),Pn=Y.find(t=>t.id==="cine"),ae=(t,e,c,o,n)=>({id:t,name:e,category:Pn.name,pack:"cine",duration:c,params:{accent:Pn.accent,position:"center",...o,style:"cine"},code:n}),fo="const HX=(c,d)=>/^#[0-9a-f]{6}$/i.test(c)?c:d,WH='#ffffff',BK='#000000',TAU=Math.PI*2,E=M.ease,MX=M.mix,RA=M.rgba,RG=M.range;const GL=(c,x,y,r,l,a)=>{if(!(a>0&&r>0))return;a=Math.min(1,a);c.save();c.globalCompositeOperation='screen';const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,RA(l,a));g.addColorStop(.3,RA(l,a*.4));g.addColorStop(1,RA(l,0));c.fillStyle=g;c.fillRect(x-r,y-r,r*2,r*2);c.restore()};const SP=(c,x,y,s,w,r)=>{c.save();c.translate(x,y);c.rotate(r);c.beginPath();c.moveTo(s,0);for(let i=0;i<4;i++){c.bezierCurveTo(s*w,s*w,s*w,s*w,0,s);c.rotate(Math.PI/2)}c.closePath();c.restore()};const STAR=(c,x,y,s,l,a,r=0)=>{if(!(a>0&&s>0))return;a=Math.min(1,a);GL(c,x,y,s*2.4,l,.6*a);c.save();c.globalAlpha=a;const f=c.createLinearGradient(x-s*3,0,x+s*3,0);f.addColorStop(0,'rgba(255,255,255,0)');f.addColorStop(.5,'rgba(255,255,255,.75)');f.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=f;c.fillRect(x-s*3,y-s*.025,s*6,s*.05);c.shadowColor=l;c.shadowBlur=s*.9;c.fillStyle=MX(l,WH,.7);SP(c,x,y,s,.06,r);c.fill();c.shadowBlur=0;c.fillStyle=WH;SP(c,x,y,s*.5,.05,r);c.fill();c.restore()};",ic=fo+"const BEGIN=(c,t,e,B,N,F,A)=>{const W=e.width,H=e.height,D=e.duration,p=e.params||{},port=H>W*1.1,u=Math.min(W,H),k=E.outCubic(RG(t,0,.45)),o={e,t,W,H,D,p,port,u,k,bg:HX(p.bg,B),nx:HX(p.next,N),fg:HX(p.fg,F),ac:HX(p.glow,A),cx:W/2,cy:H*(port?.44:.46),q:RG(t,D-.45,D),end:t<=0||t>=D};c.fillStyle=t>=D?o.nx:o.bg;c.fillRect(0,0,W,H);if(o.end)return o;c.save();c.globalAlpha=k;const g=c.createRadialGradient(o.cx,o.cy,0,o.cx,o.cy,Math.hypot(W,H)*.62);g.addColorStop(0,MX(o.bg,o.fg,.12));g.addColorStop(.45,o.bg);g.addColorStop(1,MX(o.bg,BK,.55));c.fillStyle=g;c.fillRect(0,0,W,H);c.restore();GL(c,o.cx,o.cy,u*.95,o.fg,.2*k);GL(c,o.cx,o.cy,u*.8,WH,.3*Math.sin(Math.PI*RG(t,0,.7)));return o};const END=(c,o,x,y)=>{const {W,H,u,t,k,p,D,q}=o;let r=M.rand(17);c.save();c.fillStyle=MX(o.fg,WH,.5);for(let i=0;i<26;i++){const X=r()*W+Math.sin(t*.6+i)*u*.02,Y=((r()*H-t*u*(.015+.04*r()))%H+H)%H,z=u*(.0015+.004*r()),w=k*(.35+.65*Math.abs(Math.sin(t*1.3+i)));c.globalAlpha=w*.7;c.beginPath();c.arc(X,Y,z,0,TAU);c.fill()}r=M.rand(Math.floor(t*24)*131+7);const n=W*H/1600;c.globalAlpha=k;for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,255,255,.07)':'rgba(0,0,0,.11)';c.fillRect(r()*W,r()*H,1.6,1.6)}c.restore();const tx=String(p.text||''),sb=String(p.sub||''),a=E.outCubic(RG(t,.55,1.15))*(1-RG(t,D-.8,D-.45));if(a>0&&(tx||sb)){const S=M.safe(o.e,'lower'),sk=M.skin(o.e,p),s=u*(o.port?.062:.056);let Y=(o.port?H*.76:H*.84)+(1-a)*s*.3;c.save();c.globalAlpha=a;c.textAlign='center';c.textBaseline='middle';c.shadowColor=RA(o.fg,.8);c.shadowBlur=s*.6;c.fillStyle='#fff6ec';if(tx){const f=M.fit(c,tx,z=>sk.font(z,'h'),s,S.w*.86,2);c.font=f.font;Y-=(f.lines.length-1)*f.lh/2;f.lines.forEach(l=>{c.fillText(l,S.cx,Y);Y+=f.lh});Y+=f.size*.95-f.lh}if(sb){M.ls(c,s*.12);const g=M.fit(c,sb.toUpperCase(),z=>sk.font(z,'s'),s*.36,S.w*.8,1);c.font=g.font;c.globalAlpha=a*.8;c.fillText(g.lines[0]||'',S.cx,Y)}c.restore()}if(q<=0)return;if(q>=.86){c.fillStyle=o.nx;c.fillRect(0,0,W,H);return}const R=Math.hypot(Math.max(x,W-x),Math.max(y,H-y)),b=E.outBack(RG(q,0,.3)),g=RG(q,.24,.86),s=M.lerp(u*.1*b,R*1.08,g*g*g),j=g*.6;const w=M.lerp(.07,1,Math.pow(g,1.6));GL(c,x,y,s*2.5+u*.15,WH,.7*b);c.save();c.shadowColor=WH;c.shadowBlur=Math.min(u*.12,s*.6+u*.02);c.fillStyle=MX(WH,o.nx,.15);SP(c,x,y,s*1.05+u*.012,w,j);c.fill();c.shadowBlur=0;c.fillStyle=MX(WH,o.nx,RG(q,.2,.45));SP(c,x,y,s,w,j);c.fill();c.restore();if(g<.6)STAR(c,x,y,s*.55+u*.02,WH,1-g/.6,j)};",$a=ic+"const STARS=(c,o,n,m)=>{const r=M.rand(5);c.save();c.fillStyle=WH;for(let i=0;i<n;i++){const x=r()*o.W,y=r()*m,s=o.u*(.0012+.0028*r());c.globalAlpha=o.k*(.25+.75*Math.abs(Math.sin(o.t*1.6+i*2.4)));c.beginPath();c.arc(x,y,s,0,TAU);c.fill()}c.restore()};",Dl=[ae("cine-night-house","Ngôi nhà dưới trời sao",3.5,{bg:"#0b1633",next:"#c8102e",fg:"#ffd27a",glow:"#36e0c8",text:"",sub:""},`function render(c,t,env){
5635
5635
  ${$a}
5636
5636
  // Night house: a small house with one warm lit window sits on a glowing teal horizon under twinkling stars, a 4-point star sparkles above it and bursts into the next colour. Fields: bg (flat first frame), next (flat last frame), fg (window light), accent (horizon glow), text, sub.
5637
5637
  const o=BEGIN(c,t,env,'#0b1633','#c8102e','#ffd27a','#36e0c8');if(o.end)return
@@ -6002,7 +6002,7 @@
6002
6002
  STAR(c,sx,sy,u*.035*(.8+.2*Math.sin(t*6)),WH,k*RG(t,1.6,2),t*.25)
6003
6003
  END(c,o,sx,sy)
6004
6004
  }`),ae("cine-caption","Phụ đề điện ảnh",4,{text:"Mọi câu chuyện bắt đầu từ một tia sáng",sub:"Chương một",fg:"#ffd9a0",color:"#fff6ec",position:"lower"},`function render(c,t,env){
6005
- ${ho}
6005
+ ${fo}
6006
6006
  // Elegant caption (transparent overlay for any scene): a serif line (text) settles in from wide tracking, a thin glowing rule with a tiny star draws under it, the small caps sub follows, a light sweep runs across the words, then all fades. Fields: text, sub, fg (glow), color (text), position.
6007
6007
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),u=S.u,fg=HX(p.fg,'#ffd9a0'),col=HX(p.color,'#fff6ec'),a=E.outCubic(RG(t,0,.9)),A=a*(1-E.inCubic(RG(t,D-.55,D)))
6008
6008
  if(A<=0)return
@@ -6019,13 +6019,13 @@
6019
6019
  if(sb){M.ls(c,sz*.16);const g2=M.fit(c,sb.toUpperCase(),s=>sk.font(s,'s'),sz*.34,S.w*.85,1);c.font=g2.font;c.globalAlpha=A*E.outCubic(RG(t,.7,1.3))*.85;c.fillStyle=col;c.fillText(g2.lines[0]||'',S.cx,y+sz*.6)}
6020
6020
  c.restore()
6021
6021
  }`),ae("cine-spark","Lấp lánh sao bốn cánh",2.5,{fg:"#ffe9b0",size:1,x:.5,position:"center"},`function render(c,t,env){
6022
- ${ho}
6022
+ ${fo}
6023
6023
  // Star sparkle (transparent decoration): a 4-point star pops in, twinkles and turns with a soft bloom, a thin anamorphic flare and two tiny satellite sparkles, then fades. Fields: fg (star colour), size, x (0..1 across the frame), position (top / center / lower).
6024
6024
  const {width:W,duration:D,params:p}=env,S=M.safe(env,p.position),u=S.u,fg=HX(p.fg,'#ffe9b0'),sz=Math.max(.3,Math.min(3,+p.size||1)),x=W*M.clamp(+p.x||.5,.05,.95),y=S.y
6025
6025
  const a=E.outBack(RG(t,0,.45)),out=1-E.inCubic(RG(t,D-.5,D)),tw=.82+.18*Math.sin(t*7)*Math.sin(t*3.1+1),s=u*.06*sz*a*tw
6026
6026
  STAR(c,x,y,s,fg,out*RG(t,0,.12),t*.4)
6027
6027
  for(let j=0;j<2;j++){const q=RG(t,.25+j*.2,.55+j*.2),ss=s*.3*(.55+.45*Math.sin(t*5+j*2)),ox=j?-s*1.9:s*1.6,oy=j?s*.9:-s*1.3;STAR(c,x+ox,y+oy,ss,fg,out*q,-t*.3)}
6028
- }`)],Rn=Y.find(t=>t.id==="pulse"),pt=(t,e,c,o,n)=>({id:t,name:e,category:Rn.name,pack:"pulse",duration:c,params:{accent:Rn.accent,position:"center",...o,style:"pulse"},code:n}),dt="const V='#8b7bff',V2='#a99bff',RD='#ff2a3d',AM='#ffb35c';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,LUM=x=>{const h=M.hex(x);return h[0]*.299+h[1]*.587+h[2]*.114};const CK=p=>{const bg=PC(p.bg,'#07060c'),nx=PC(p.next,'#07060c'),ink=LUM(bg)>140?'#07060c':'#ffffff',fix=f=>{const a=M.hex(f),b=M.hex(bg);return Math.abs(a[0]-b[0])+Math.abs(a[1]-b[1])+Math.abs(a[2]-b[2])<110?ink:f};return{bg,nx,ink,fg:fix(PC(p.fg,V)),f2:fix(PC(p.fg2,PC(p.accent,RD)))}};const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.46,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const NEON=(c,col,w,draw,g=1)=>{if(!(w>0))return;c.save();c.lineCap='round';c.lineJoin='round';c.strokeStyle=col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*8*g;draw();c.stroke();c.shadowBlur=w*3*g;c.stroke();c.shadowBlur=0;c.strokeStyle=LUM(col)<80?col:M.mix(col,'#ffffff',.55);c.lineWidth=w*.45;c.stroke();c.restore()};const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);const g=c.createRadialGradient(x,y,0,x,y,r*4);g.addColorStop(0,M.rgba(col,.5));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.beginPath();c.arc(x,y,r*4,0,M.TAU);c.fill();c.fillStyle=LUM(col)<80?col:M.mix(col,'#ffffff',.45);c.shadowColor=col;c.shadowBlur=r*2.5;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const EDGE=(c,B,k,draw,col)=>{const a=1-M.range(k,.75,1);if(!(k>0)||!(a>0))return;c.save();c.globalAlpha=a;NEON(c,col||B.K.fg,B.u*.006,draw,.9);c.restore()};const POLY=(c,x,y,r,n,rot)=>{c.beginPath();for(let i=0;i<n;i++){const a=rot+i*M.TAU/n;c[i?'lineTo':'moveTo'](x+Math.cos(a)*r,y+Math.sin(a)*r)}c.closePath()};const CC=(c,B,x,y,k,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k;c.fillStyle=B.K.nx;c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();EDGE(c,B,k,()=>{c.beginPath();c.arc(x,y,R,0,M.TAU)},col)};const CP=(c,B,x,y,k,n,rot,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)/Math.cos(Math.PI/n)*1.02-r0)*k;c.fillStyle=B.K.nx;POLY(c,x,y,R,n,rot);c.fill();EDGE(c,B,k,()=>POLY(c,x,y,R,n,rot),col)};const CBAND=(c,B,y,k,h0=0,col)=>{if(!(k>0))return;const h=h0+(Math.max(y,B.H-y)*1.02-h0)*k;c.fillStyle=B.K.nx;c.fillRect(0,y-h,B.W,h*2);EDGE(c,B,k,()=>{c.beginPath();c.moveTo(0,y-h);c.lineTo(B.W,y-h);c.moveTo(0,y+h);c.lineTo(B.W,y+h)},col)};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const TITLE=(c,B,sk,a,y,sz)=>{const s=String(B.p.text||'').toLowerCase();if(!s||!(a>0))return;const f=M.fit(c,s,z=>sk.font(z,'h'),sz,B.S.w*.85,2);c.save();c.globalAlpha=Math.min(1,a);c.font=f.font;c.textAlign='center';c.textBaseline='middle';M.ls(c,f.size*.06);c.fillStyle=B.K.ink;c.shadowColor=B.K.fg;[.7,.22].forEach(b=>{c.shadowBlur=f.size*b;f.lines.forEach((l,i)=>c.fillText(l,B.W/2,y+(i-(f.lines.length-1)/2)*f.lh))});c.restore()};const BALL=(c,x,y,r,col,sx=1,sy=1)=>{if(!(r>0))return;c.save();c.translate(x,y);c.scale(sx,sy);const g=c.createRadialGradient(-r*.35,-r*.4,r*.05,0,0,r);g.addColorStop(0,M.mix(col,'#ffffff',.6));g.addColorStop(.5,col);g.addColorStop(1,M.mix(col,'#000000',.7));c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();c.strokeStyle='rgba(255,255,255,.35)';c.lineWidth=r*.06;c.beginPath();c.arc(0,0,r*.93,.15,1.5);c.stroke();c.fillStyle='rgba(255,255,255,.75)';c.beginPath();c.ellipse(-r*.38,-r*.42,r*.17,r*.1,-.7,0,M.TAU);c.fill();c.restore()};const BIN=(B,x,y,k)=>{const o={l:[-B.u*.25,y],r:[B.W+B.u*.25,y],t:[x,-B.u*.25],b:[x,B.H+B.u*.25]}[String(B.p.ballIn||'')];return o?[M.lerp(o[0],x,k),M.lerp(o[1],y,k),1]:[x,y,k]};const FL=(t,ts,cs)=>{let i=0;ts.forEach(a=>{if(t>=a)i++});return cs[Math.min(i,cs.length-1)]};const CV=(c,B,x,k,w0=0,col)=>{if(!(k>0))return;const h=w0+(Math.max(x,B.W-x)*1.02-w0)*k;c.fillStyle=B.K.nx;c.fillRect(x-h,0,h*2,B.H);EDGE(c,B,k,()=>{c.beginPath();c.moveTo(x-h,0);c.lineTo(x-h,B.H);c.moveTo(x+h,0);c.lineTo(x+h,B.H)},col)};const TY=B=>B.p.position==='center'?B.cy+B.u*.36:B.S.y;",ut="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,sk=M.skin(env,env.params||{}),T1=D-.46",Ll=[pt("pulse-dot-bloom","Chấm sáng nở",2.4,{bg:"#07060c",next:"#8b7bff",fg:"#8b7bff",fg2:"#a99bff",text:"",ballIn:"c"},`function render(ctx,t,env){
6028
+ }`)],zn=Y.find(t=>t.id==="pulse"),pt=(t,e,c,o,n)=>({id:t,name:e,category:zn.name,pack:"pulse",duration:c,params:{accent:zn.accent,position:"center",...o,style:"pulse"},code:n}),dt="const V='#8b7bff',V2='#a99bff',RD='#ff2a3d',AM='#ffb35c';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,LUM=x=>{const h=M.hex(x);return h[0]*.299+h[1]*.587+h[2]*.114};const CK=p=>{const bg=PC(p.bg,'#07060c'),nx=PC(p.next,'#07060c'),ink=LUM(bg)>140?'#07060c':'#ffffff',fix=f=>{const a=M.hex(f),b=M.hex(bg);return Math.abs(a[0]-b[0])+Math.abs(a[1]-b[1])+Math.abs(a[2]-b[2])<110?ink:f};return{bg,nx,ink,fg:fix(PC(p.fg,V)),f2:fix(PC(p.fg2,PC(p.accent,RD)))}};const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.46,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const NEON=(c,col,w,draw,g=1)=>{if(!(w>0))return;c.save();c.lineCap='round';c.lineJoin='round';c.strokeStyle=col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*8*g;draw();c.stroke();c.shadowBlur=w*3*g;c.stroke();c.shadowBlur=0;c.strokeStyle=LUM(col)<80?col:M.mix(col,'#ffffff',.55);c.lineWidth=w*.45;c.stroke();c.restore()};const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);const g=c.createRadialGradient(x,y,0,x,y,r*4);g.addColorStop(0,M.rgba(col,.5));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.beginPath();c.arc(x,y,r*4,0,M.TAU);c.fill();c.fillStyle=LUM(col)<80?col:M.mix(col,'#ffffff',.45);c.shadowColor=col;c.shadowBlur=r*2.5;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const EDGE=(c,B,k,draw,col)=>{const a=1-M.range(k,.75,1);if(!(k>0)||!(a>0))return;c.save();c.globalAlpha=a;NEON(c,col||B.K.fg,B.u*.006,draw,.9);c.restore()};const POLY=(c,x,y,r,n,rot)=>{c.beginPath();for(let i=0;i<n;i++){const a=rot+i*M.TAU/n;c[i?'lineTo':'moveTo'](x+Math.cos(a)*r,y+Math.sin(a)*r)}c.closePath()};const CC=(c,B,x,y,k,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k;c.fillStyle=B.K.nx;c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();EDGE(c,B,k,()=>{c.beginPath();c.arc(x,y,R,0,M.TAU)},col)};const CP=(c,B,x,y,k,n,rot,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)/Math.cos(Math.PI/n)*1.02-r0)*k;c.fillStyle=B.K.nx;POLY(c,x,y,R,n,rot);c.fill();EDGE(c,B,k,()=>POLY(c,x,y,R,n,rot),col)};const CBAND=(c,B,y,k,h0=0,col)=>{if(!(k>0))return;const h=h0+(Math.max(y,B.H-y)*1.02-h0)*k;c.fillStyle=B.K.nx;c.fillRect(0,y-h,B.W,h*2);EDGE(c,B,k,()=>{c.beginPath();c.moveTo(0,y-h);c.lineTo(B.W,y-h);c.moveTo(0,y+h);c.lineTo(B.W,y+h)},col)};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const TITLE=(c,B,sk,a,y,sz)=>{const s=String(B.p.text||'').toLowerCase();if(!s||!(a>0))return;const f=M.fit(c,s,z=>sk.font(z,'h'),sz,B.S.w*.85,2);c.save();c.globalAlpha=Math.min(1,a);c.font=f.font;c.textAlign='center';c.textBaseline='middle';M.ls(c,f.size*.06);c.fillStyle=B.K.ink;c.shadowColor=B.K.fg;[.7,.22].forEach(b=>{c.shadowBlur=f.size*b;f.lines.forEach((l,i)=>c.fillText(l,B.W/2,y+(i-(f.lines.length-1)/2)*f.lh))});c.restore()};const BALL=(c,x,y,r,col,sx=1,sy=1)=>{if(!(r>0))return;c.save();c.translate(x,y);c.scale(sx,sy);const g=c.createRadialGradient(-r*.35,-r*.4,r*.05,0,0,r);g.addColorStop(0,M.mix(col,'#ffffff',.6));g.addColorStop(.5,col);g.addColorStop(1,M.mix(col,'#000000',.7));c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();c.strokeStyle='rgba(255,255,255,.35)';c.lineWidth=r*.06;c.beginPath();c.arc(0,0,r*.93,.15,1.5);c.stroke();c.fillStyle='rgba(255,255,255,.75)';c.beginPath();c.ellipse(-r*.38,-r*.42,r*.17,r*.1,-.7,0,M.TAU);c.fill();c.restore()};const BIN=(B,x,y,k)=>{const o={l:[-B.u*.25,y],r:[B.W+B.u*.25,y],t:[x,-B.u*.25],b:[x,B.H+B.u*.25]}[String(B.p.ballIn||'')];return o?[M.lerp(o[0],x,k),M.lerp(o[1],y,k),1]:[x,y,k]};const FL=(t,ts,cs)=>{let i=0;ts.forEach(a=>{if(t>=a)i++});return cs[Math.min(i,cs.length-1)]};const CV=(c,B,x,k,w0=0,col)=>{if(!(k>0))return;const h=w0+(Math.max(x,B.W-x)*1.02-w0)*k;c.fillStyle=B.K.nx;c.fillRect(x-h,0,h*2,B.H);EDGE(c,B,k,()=>{c.beginPath();c.moveTo(x-h,0);c.lineTo(x-h,B.H);c.moveTo(x+h,0);c.lineTo(x+h,B.H)},col)};const TY=B=>B.p.position==='center'?B.cy+B.u*.36:B.S.y;",ut="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,sk=M.skin(env,env.params||{}),T1=D-.46",El=[pt("pulse-dot-bloom","Chấm sáng nở",2.4,{bg:"#07060c",next:"#8b7bff",fg:"#8b7bff",fg2:"#a99bff",text:"",ballIn:"c"},`function render(ctx,t,env){
6029
6029
  ${dt}
6030
6030
  // A glowing dot pops in at the centre, beats with light rings rippling off it and swells, then blooms until the frame is flat next; ballIn = l | r | t | b | c is where the dot enters (fields: text, bg, next, fg, fg2, ballIn).
6031
6031
  ${ut}
@@ -6417,7 +6417,7 @@
6417
6417
  const dx=S.cx-w/2-u*.05,ph=(t*1.6)%1,r=u*.008*(1+.5*Math.exp(-ph*5))
6418
6418
  ctx.save();ctx.globalAlpha=k.v*(1-ph);NEON(ctx,fg,u*.002,()=>{ctx.beginPath();ctx.arc(dx,S.y,r+u*.016*M.ease.outCubic(ph),0,M.TAU)},.7);ctx.restore()
6419
6419
  DOT(ctx,dx,S.y,r,fg,k.v)
6420
- }`)],Pn=Y.find(t=>t.id==="story"),Me=(t,e,c,o,n)=>({id:t,name:e,category:Pn.name,pack:"story",duration:c,params:{accent:Pn.accent,position:"center",...o,style:"story"},code:n}),me="const CO='#ff3b5c',CR='#efe9d6',CH='#1b1b1d',BK='#0d0d0f',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),RC=(c,...a)=>c.fillRect(...a),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},MIN=Math.min,ABS=Math.abs,HY=Math.hypot;const LUM=x=>{const h=M.hex(x);return h[0]*.3+h[1]*.59+h[2]*.11},FR=(a,b)=>{const n=SN(a*12.99+b*78.23)*43758.5;return n-Math.floor(n)},PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d;const DOT=(c,x,y,r)=>{BP(c);c.arc(x,y,MAX(0,r),0,TAU);c.fill()},PL=(c,...p)=>{BP(c);for(let i=0;i<p.length;i+=2)c.lineTo(p[i],p[i+1]);c.fill()},RF=(c,x,y,w,h,r)=>{M.rr(c,x,y,w,h,r);c.fill()},G=(g,s)=>{s.forEach(o=>g.addColorStop(o[0],o[1]));return g};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,CH),nx=PC(p.next,CO),lt=LUM(bg)>170,ac=PC(p.fg,PC(p.accent,CO)),hi=ED(p.heroIn,'l'),ho=ED(p.heroOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[k=='l'?W*f:k=='r'?-W*f:0,k=='t'?H*f:k=='b'?-H*f:0],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]);const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,hk:p.hero,K:{bg,nx,ac,fg:ABS(LUM(ac)-LUM(bg))<40?(lt?CH:CR):ac,cr:lt?CH:CR,dk:lt?CH:LUM(bg)<60?'#060607':BK},e:pi?1:E.outCubic(RG(t,0,.4)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02;const GLOW=(c,x,y,r,col,a)=>{if(a>0&&r>0){FS(c,G(c.createRadialGradient(x,y,0,x,y,r),[[0,RA(col,MIN(1,a))],[1,RA(col,0)]]));RC(c,x-r,y-r,r*2,r*2)}};const BGL=(c,B,s,x)=>{SV(c);GA(c,B.e);FS(c,G(x?c.createRadialGradient(x[0],x[1],0,x[0],x[1],x[2]):c.createLinearGradient(0,0,0,B.H),s));RC(c,0,0,B.W,B.H);FS(c,G(c.createRadialGradient(B.cx,B.cy,B.u*.35,B.cx,B.cy,HY(B.W,B.H)*.62),[[0,RA(BK,0)],[1,RA(BK,.45)]]));RC(c,0,0,B.W,B.H);RS(c)};const CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GLOW(c,x,y,R*1.3+B.u*.06,B.K.ac,.55*(1-k));FS(c,B.K.nx);DOT(c,x,y,R)}};const END=(c,B)=>{const {W,H,u,t,q}=B,a=B.e*(1-q);if(a>0){let s=String(B.p.text||'').trim();const k=a*(1-RG(q,0,.35)),r=M.rand(Math.floor(t*24)*7+3);SV(c);GA(c,a);for(let i=0;i<W*H/1600;i++){FS(c,i%2?RA(CR,.06):RA(BK,.1));RC(c,r()*W,r()*H,1.5,1.5)}if(s&&k>0){s=s[0].toUpperCase()+s.slice(1).toLowerCase();const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.042,S.w*.8,2),n=f.lines.length,h=n*f.lh+f.size;GA(c,k*.4);FS(c,BK);c.shadowColor=BK;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,k);c.font=f.font;c.textAlign='center';c.textBaseline='middle';FS(c,CR);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh))}RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,H)}if(B.pz)RS(c)};const EP=(B,k)=>{const o=B.u*.16;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},TT=B=>{const m=MAX(.3,B.D-.75);return[.3+m*.34,B.D-.45-m*.3]};const HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HP=(B,tt,sx,sy,hd)=>{const O=B.of(tt),I=B.pi&&HO(B,{l:'r',r:'l',t:'b',b:'t'}[B.hi]),A=I?[I[0]-O[0],I[1]-O[1]]:EP(B,B.hi),Z=B.po?(a=>[a[0]-O[0],a[1]-O[1]])(HO(B,B.ho)):EP(B,B.ho),T=TT(B),X=B.po?B.D-PN:B.D-.45;let x=sx+SN(tt*1.3)*B.u*.02,y=sy+SN(tt*2.4)*B.u*.014,s=1,k=0;if(tt<T[0]){k=E.outCubic(RG(tt,B.pi?PN:.3,T[0]));x=L(A[0],x,k);y=L(A[1],y,k);if(B.hi=='c')s=k}else if(tt>T[1]){k=(B.po?E.inOutCubic:E.inCubic)(RG(tt,T[1],X));x=L(x,Z[0],k);y=L(y,Z[1],k);if(B.ho=='c')s=1-k}y-=SN(k*PI)*B.u*.07;if(hd)s*=MIN(1,1-RG(tt,T[0]-.2,T[0])+RG(tt,T[1],T[1]+.2));return{x,y,s:tt<.3&&!B.pi?0:MAX(0,s)}};const HEART=(c,x,y,s)=>{BP(c);c.moveTo(x,y+s*.9);c.bezierCurveTo(x-s*1.25,y+s*.05,x-s*.95,y-s*.95,x,y-s*.42);c.bezierCurveTo(x+s*.95,y-s*.95,x+s*1.25,y+s*.05,x,y+s*.9)};const HERO=(c,B,h,z,kd)=>{const s=z*h.s,K=B.K,k=kd||B.hk,t=B.t,a=h.a||0;if(!(s>.5))return;SV(c);c.translate(h.x,h.y);FS(c,K.cr);if(k=='heart'){c.rotate(SN(t*3)*.12);GLOW(c,0,0,s*2,K.ac,.4);FS(c,K.ac);HEART(c,0,0,s*.8);c.fill();c.strokeStyle=CR;c.lineWidth=s*.13;c.stroke()}else if(k=='ball'){c.rotate(t*2);DOT(c,0,0,s*.75);FS(c,MX(K.cr,BK,.2));PL(c,0,0,s*.75,0,s*.25,s*.7);PL(c,0,0,-s*.45,-s*.6,-s*.74,0);FS(c,MX(K.cr,BK,.1));PL(c,0,0,-s*.3,s*.7,-s*.72,s*.2)}else if(k=='bubble'){c.rotate(SN(t*2)*.08);RF(c,-s,-s*.62,s*2,s*1.15,s*.45);PL(c,-s*.5,s*.4,-s*.85,s*.85,0,s*.48);FS(c,K.fg);for(let i=-1;i<2;i++)DOT(c,i*s*.42,-s*.05,s*.12)}else if(k=='star'){c.rotate(t*1.5);GLOW(c,0,0,s*2.2,K.fg,.45);FS(c,K.cr);BP(c);for(let i=0;i<8;i++){const r=i%2?s*.32:s;c.lineTo(CS(i*PI/4)*r,SN(i*PI/4)*r)}c.fill()}else{c.rotate(a);if(CS(a)<0)c.scale(1,-1);FS(c,MX(K.cr,CH,.32));PL(c,s,0,-s*.45,0,-s*.66,s*.48);FS(c,K.cr);PL(c,s,0,-s*.85,-s*.62,-s*.45,0)}RS(c)};const FLY=(c,B,F,z)=>{const t=B.t,h=F(t),a=F(t-.04),b=F(t+.04),A=EP(B,B.hi),Z=EP(B,B.ho);if(!(h.s>0))return;if(B.pz){RS(c);SV(c);const o=B.of(t);c.translate(o[0],o[1])}h.a=Math.atan2(b.y-a.y+(Z[1]-A[1])*.004,b.x-a.x+(Z[0]-A[0])*.004+.001);SV(c);c.strokeStyle=B.K.fg;c.lineCap='round';for(let i=1;i<14;i++){const p=F(t-i*.03),o=F(t-i*.03+.03),k=1-i/14;if(!(p.s>0))break;GA(c,k*.8*h.s);c.lineWidth=B.u*.004*k+.5;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);HERO(c,B,h,z);if(B.pz){RS(c);B.cl()}};",ha="const PARTS=(c,B,sd,n,x,y,w,h,col,sz,a)=>{const R=M.rand(sd);SV(c);FS(c,col);for(let i=0;i<n;i++){const f=(R()+B.t*(.1+R()*.2))%1;GA(c,a*B.e*SN(f*PI));DOT(c,x+R()*w+SN(B.t*1.4+i)*B.u*.012,y+h*(1-f),B.u*sz*(.4+R()*.8))}RS(c)};",Xa="const STARS=(c,B,n,m)=>{const r=M.rand(9);SV(c);FS(c,B.K.cr);for(let i=0;i<n;i++){GA(c,B.e*(.25+.75*ABS(SN(B.t*1.7+i*2.3))));DOT(c,r()*B.W,r()*m,B.u*(.001+.003*r()))}RS(c)};const PLANET=(c,B,x,top,R,col)=>{const y=top+R,K=B.K;FS(c,G(c.createRadialGradient(x,y,R*.96,x,y,R*1.1),[[0,RA(K.ac,.6)],[1,RA(K.ac,0)]]));DOT(c,x,y,R*1.1);FS(c,G(c.createLinearGradient(0,top,0,top+B.u*.5),[[0,MX(col,K.ac,.3)],[.25,col]]));DOT(c,x,y,R);c.strokeStyle=RA(MX(K.ac,CR,.4),.8);c.lineWidth=B.u*.004;BP(c);c.arc(x,y,R,PI*1.1,PI*1.9);c.stroke()};",ke="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B",Dl=[Me("story-phone-message","Tin nhắn điện thoại",3.2,{bg:"#1b1b1d",next:"#0d0d0f",fg:"#ff3b5c",hero:"bubble",heroIn:"b",heroOut:"r",msg:"mình vẫn là bạn chứ?",text:""},`function render(c,t,env){
6420
+ }`)],Bn=Y.find(t=>t.id==="story"),Me=(t,e,c,o,n)=>({id:t,name:e,category:Bn.name,pack:"story",duration:c,params:{accent:Bn.accent,position:"center",...o,style:"story"},code:n}),me="const CO='#ff3b5c',CR='#efe9d6',CH='#1b1b1d',BK='#0d0d0f',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),RC=(c,...a)=>c.fillRect(...a),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},MIN=Math.min,ABS=Math.abs,HY=Math.hypot;const LUM=x=>{const h=M.hex(x);return h[0]*.3+h[1]*.59+h[2]*.11},FR=(a,b)=>{const n=SN(a*12.99+b*78.23)*43758.5;return n-Math.floor(n)},PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d;const DOT=(c,x,y,r)=>{BP(c);c.arc(x,y,MAX(0,r),0,TAU);c.fill()},PL=(c,...p)=>{BP(c);for(let i=0;i<p.length;i+=2)c.lineTo(p[i],p[i+1]);c.fill()},RF=(c,x,y,w,h,r)=>{M.rr(c,x,y,w,h,r);c.fill()},G=(g,s)=>{s.forEach(o=>g.addColorStop(o[0],o[1]));return g};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,CH),nx=PC(p.next,CO),lt=LUM(bg)>170,ac=PC(p.fg,PC(p.accent,CO)),hi=ED(p.heroIn,'l'),ho=ED(p.heroOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[k=='l'?W*f:k=='r'?-W*f:0,k=='t'?H*f:k=='b'?-H*f:0],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]);const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,hk:p.hero,K:{bg,nx,ac,fg:ABS(LUM(ac)-LUM(bg))<40?(lt?CH:CR):ac,cr:lt?CH:CR,dk:lt?CH:LUM(bg)<60?'#060607':BK},e:pi?1:E.outCubic(RG(t,0,.4)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02;const GLOW=(c,x,y,r,col,a)=>{if(a>0&&r>0){FS(c,G(c.createRadialGradient(x,y,0,x,y,r),[[0,RA(col,MIN(1,a))],[1,RA(col,0)]]));RC(c,x-r,y-r,r*2,r*2)}};const BGL=(c,B,s,x)=>{SV(c);GA(c,B.e);FS(c,G(x?c.createRadialGradient(x[0],x[1],0,x[0],x[1],x[2]):c.createLinearGradient(0,0,0,B.H),s));RC(c,0,0,B.W,B.H);FS(c,G(c.createRadialGradient(B.cx,B.cy,B.u*.35,B.cx,B.cy,HY(B.W,B.H)*.62),[[0,RA(BK,0)],[1,RA(BK,.45)]]));RC(c,0,0,B.W,B.H);RS(c)};const CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GLOW(c,x,y,R*1.3+B.u*.06,B.K.ac,.55*(1-k));FS(c,B.K.nx);DOT(c,x,y,R)}};const END=(c,B)=>{const {W,H,u,t,q}=B,a=B.e*(1-q);if(a>0){let s=String(B.p.text||'').trim();const k=a*(1-RG(q,0,.35)),r=M.rand(Math.floor(t*24)*7+3);SV(c);GA(c,a);for(let i=0;i<W*H/1600;i++){FS(c,i%2?RA(CR,.06):RA(BK,.1));RC(c,r()*W,r()*H,1.5,1.5)}if(s&&k>0){s=s[0].toUpperCase()+s.slice(1).toLowerCase();const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.042,S.w*.8,2),n=f.lines.length,h=n*f.lh+f.size;GA(c,k*.4);FS(c,BK);c.shadowColor=BK;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,k);c.font=f.font;c.textAlign='center';c.textBaseline='middle';FS(c,CR);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh))}RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,H)}if(B.pz)RS(c)};const EP=(B,k)=>{const o=B.u*.16;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},TT=B=>{const m=MAX(.3,B.D-.75);return[.3+m*.34,B.D-.45-m*.3]};const HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HP=(B,tt,sx,sy,hd)=>{const O=B.of(tt),I=B.pi&&HO(B,{l:'r',r:'l',t:'b',b:'t'}[B.hi]),A=I?[I[0]-O[0],I[1]-O[1]]:EP(B,B.hi),Z=B.po?(a=>[a[0]-O[0],a[1]-O[1]])(HO(B,B.ho)):EP(B,B.ho),T=TT(B),X=B.po?B.D-PN:B.D-.45;let x=sx+SN(tt*1.3)*B.u*.02,y=sy+SN(tt*2.4)*B.u*.014,s=1,k=0;if(tt<T[0]){k=E.outCubic(RG(tt,B.pi?PN:.3,T[0]));x=L(A[0],x,k);y=L(A[1],y,k);if(B.hi=='c')s=k}else if(tt>T[1]){k=(B.po?E.inOutCubic:E.inCubic)(RG(tt,T[1],X));x=L(x,Z[0],k);y=L(y,Z[1],k);if(B.ho=='c')s=1-k}y-=SN(k*PI)*B.u*.07;if(hd)s*=MIN(1,1-RG(tt,T[0]-.2,T[0])+RG(tt,T[1],T[1]+.2));return{x,y,s:tt<.3&&!B.pi?0:MAX(0,s)}};const HEART=(c,x,y,s)=>{BP(c);c.moveTo(x,y+s*.9);c.bezierCurveTo(x-s*1.25,y+s*.05,x-s*.95,y-s*.95,x,y-s*.42);c.bezierCurveTo(x+s*.95,y-s*.95,x+s*1.25,y+s*.05,x,y+s*.9)};const HERO=(c,B,h,z,kd)=>{const s=z*h.s,K=B.K,k=kd||B.hk,t=B.t,a=h.a||0;if(!(s>.5))return;SV(c);c.translate(h.x,h.y);FS(c,K.cr);if(k=='heart'){c.rotate(SN(t*3)*.12);GLOW(c,0,0,s*2,K.ac,.4);FS(c,K.ac);HEART(c,0,0,s*.8);c.fill();c.strokeStyle=CR;c.lineWidth=s*.13;c.stroke()}else if(k=='ball'){c.rotate(t*2);DOT(c,0,0,s*.75);FS(c,MX(K.cr,BK,.2));PL(c,0,0,s*.75,0,s*.25,s*.7);PL(c,0,0,-s*.45,-s*.6,-s*.74,0);FS(c,MX(K.cr,BK,.1));PL(c,0,0,-s*.3,s*.7,-s*.72,s*.2)}else if(k=='bubble'){c.rotate(SN(t*2)*.08);RF(c,-s,-s*.62,s*2,s*1.15,s*.45);PL(c,-s*.5,s*.4,-s*.85,s*.85,0,s*.48);FS(c,K.fg);for(let i=-1;i<2;i++)DOT(c,i*s*.42,-s*.05,s*.12)}else if(k=='star'){c.rotate(t*1.5);GLOW(c,0,0,s*2.2,K.fg,.45);FS(c,K.cr);BP(c);for(let i=0;i<8;i++){const r=i%2?s*.32:s;c.lineTo(CS(i*PI/4)*r,SN(i*PI/4)*r)}c.fill()}else{c.rotate(a);if(CS(a)<0)c.scale(1,-1);FS(c,MX(K.cr,CH,.32));PL(c,s,0,-s*.45,0,-s*.66,s*.48);FS(c,K.cr);PL(c,s,0,-s*.85,-s*.62,-s*.45,0)}RS(c)};const FLY=(c,B,F,z)=>{const t=B.t,h=F(t),a=F(t-.04),b=F(t+.04),A=EP(B,B.hi),Z=EP(B,B.ho);if(!(h.s>0))return;if(B.pz){RS(c);SV(c);const o=B.of(t);c.translate(o[0],o[1])}h.a=Math.atan2(b.y-a.y+(Z[1]-A[1])*.004,b.x-a.x+(Z[0]-A[0])*.004+.001);SV(c);c.strokeStyle=B.K.fg;c.lineCap='round';for(let i=1;i<14;i++){const p=F(t-i*.03),o=F(t-i*.03+.03),k=1-i/14;if(!(p.s>0))break;GA(c,k*.8*h.s);c.lineWidth=B.u*.004*k+.5;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);HERO(c,B,h,z);if(B.pz){RS(c);B.cl()}};",ha="const PARTS=(c,B,sd,n,x,y,w,h,col,sz,a)=>{const R=M.rand(sd);SV(c);FS(c,col);for(let i=0;i<n;i++){const f=(R()+B.t*(.1+R()*.2))%1;GA(c,a*B.e*SN(f*PI));DOT(c,x+R()*w+SN(B.t*1.4+i)*B.u*.012,y+h*(1-f),B.u*sz*(.4+R()*.8))}RS(c)};",Xa="const STARS=(c,B,n,m)=>{const r=M.rand(9);SV(c);FS(c,B.K.cr);for(let i=0;i<n;i++){GA(c,B.e*(.25+.75*ABS(SN(B.t*1.7+i*2.3))));DOT(c,r()*B.W,r()*m,B.u*(.001+.003*r()))}RS(c)};const PLANET=(c,B,x,top,R,col)=>{const y=top+R,K=B.K;FS(c,G(c.createRadialGradient(x,y,R*.96,x,y,R*1.1),[[0,RA(K.ac,.6)],[1,RA(K.ac,0)]]));DOT(c,x,y,R*1.1);FS(c,G(c.createLinearGradient(0,top,0,top+B.u*.5),[[0,MX(col,K.ac,.3)],[.25,col]]));DOT(c,x,y,R);c.strokeStyle=RA(MX(K.ac,CR,.4),.8);c.lineWidth=B.u*.004;BP(c);c.arc(x,y,R,PI*1.1,PI*1.9);c.stroke()};",ke="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B",ql=[Me("story-phone-message","Tin nhắn điện thoại",3.2,{bg:"#1b1b1d",next:"#0d0d0f",fg:"#ff3b5c",hero:"bubble",heroIn:"b",heroOut:"r",msg:"mình vẫn là bạn chứ?",text:""},`function render(c,t,env){
6421
6421
  ${me}
6422
6422
  // Phone message: a hand holds a phone, typing dots then a chat bubble (msg) pops on screen as the hero flies in; it leaves as the hero and the screen zooms to next (fields: msg, text, bg, next, fg, hero, heroIn, heroOut).
6423
6423
  ${ke},T=TT(B),ph=MIN(H*.58,u*.84),pw=ph*.5,py=cy+(1-E.outCubic(RG(t,0,.55)))*H*.75+u*.03,zm=1+.05*t/D,sx=-pw*.44,sy=-ph*.46,sw=pw*.88,sh=ph*.92,by=sy+sh*.42
@@ -6634,8 +6634,8 @@
6634
6634
  let wi=0,mw=0;f.lines.forEach((l,i)=>{const lw=c.measureText(l).width;mw=Math.max(mw,lw);let x=S.cx-lw/2;l.split(' ').forEach(w=>{const a=E(M.range(t,.05+wi*.07,.4+wi*.07));wi++;c.globalAlpha=a*out;c.fillText(w,x,y0+i*f.lh+(1-a)*f.size*.35);x+=c.measureText(w+' ').width})})
6635
6635
  const dr=M.ease.outExpo(M.range(t,.3,1.1)),ly=y0+(n-1)*f.lh+f.size*.78;c.shadowBlur=0;c.shadowOffsetY=0;c.globalAlpha=out;c.strokeStyle=fg;c.lineCap='round';c.lineWidth=Math.max(2,f.size*.07);if(dr>0){c.beginPath();c.moveTo(S.cx-mw/2,ly);c.lineTo(S.cx-mw/2+mw*dr,ly);c.stroke()}
6636
6636
  c.restore()
6637
- }`)],zn=Y.find(t=>t.id==="lumen"),oe=(t,e,c,o,n)=>({id:t,name:e,category:zn.name,pack:"lumen",duration:c,params:{accent:zn.accent,position:"center",...o,style:"lumen"},code:n}),ne="const NV='#05041a',PK='#ff4fa3',AM='#ffb648',VI='#7a4dff',LV='#c49bff',YL='#fff09a',RD='#ff3a5c',IR=[AM,PK,VI,'#2a1680'],VS=[LV,'#9a7bff',VI,'#1d0f5c'];const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,NV),nx:PC(p.next,NV),fg:PC(p.fg,VI),f2:PC(p.fg2,PK)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.44,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;GL(c,x,y,r*6,col,a);c.save();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.6);c.shadowColor=col;c.shadowBlur=r*3;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const SPH=(c,x,y,r,ry=1,cs=IR,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.beginPath();c.moveTo(x-r,y);c.arc(x,y,r,Math.PI,0);c.ellipse(x,y,r,Math.max(.01,r*ry),0,0,Math.PI);c.closePath();const b=c.createLinearGradient(0,y-r,0,y+r*ry);b.addColorStop(0,cs[0]);b.addColorStop(.38,cs[1]);b.addColorStop(.66,cs[2]);b.addColorStop(1,cs[3]);c.fillStyle=b;c.shadowColor=cs[1];c.shadowBlur=r*.6;c.fill();c.shadowBlur=0;const s=c.createRadialGradient(x-r*.3,y-r*.55,0,x-r*.3,y-r*.55,r);s.addColorStop(0,'rgba(255,255,255,.85)');s.addColorStop(.28,'rgba(255,236,246,.24)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.strokeStyle='rgba(236,220,255,.55)';c.lineWidth=Math.max(1,r*.035);c.stroke();c.restore()};const CC=(c,B,x,y,k,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k,cl=col||B.K.fg;GL(c,x,y,R+B.u*.3,cl,1-k);const g=c.createRadialGradient(x,y,R*.55,x,y,R+1);g.addColorStop(0,B.K.nx);g.addColorStop(.8,B.K.nx);g.addColorStop(1,M.mix(B.K.nx,cl,.6*(1-k)));c.fillStyle=g;c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();NEON(c,cl,B.u*.006,()=>{c.beginPath();c.arc(x,y,R,0,M.TAU)},0,1-M.range(k,.6,.95))};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const FL=(t,ts,cs)=>{let i=0;ts.forEach(a=>{if(t>=a)i++});return cs[Math.min(i,cs.length-1)]};const POLY=(c,x,y,r,n,rot)=>{c.beginPath();for(let i=0;i<n;i++){const a=rot+i*M.TAU/n;c[i?'lineTo':'moveTo'](x+Math.cos(a)*r,y+Math.sin(a)*r)}c.closePath()};const MOTE=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,s=R(),y=((R()*B.H-t*B.u*(.03+.06*s))%B.H+B.H)%B.H;DOT(c,x,y,B.u*(.0016+.002*s),[PK,LV,AM][i%3],a*(.35+.5*M.noise(i,t*1.5)))}};",Bn="const DRING=(c,x,y,R,n,d,h,a=1,rot=0)=>{if(!(R>0)||!(a>0))return;c.save();c.globalCompositeOperation='lighter';c.globalAlpha=.16*Math.min(1,a);c.strokeStyle=M.mix(AM,VI,h);c.lineWidth=d*7;c.beginPath();c.arc(x,y,R,0,M.TAU);c.stroke();for(let i=0;i<n;i++){const an=rot+i*M.TAU/n,f=(Math.cos(an-rot*.4)+1)/2,col=M.mix(M.mix('#ffc83a',RD,f),f>.5?VI:'#5b6cff',h),px=x+Math.cos(an)*R,py=y+Math.sin(an)*R;c.globalAlpha=.45*Math.min(1,a);c.fillStyle=col;c.beginPath();c.arc(px,py,d*2.4,0,M.TAU);c.fill();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.2);c.beginPath();c.arc(px,py,d*1.15,0,M.TAU);c.fill()}c.restore()};",fo="const CRT=(c,x,y,s,t,a=1,g=1)=>{if(!(s>0)||!(a>0))return;GL(c,x,y-s*.35,s*3.4,PK,.6*a);for(let i=0;i<7;i++){const f=i/6-.5,x0=x+f*s*1.45,L=s*(1.35+.7*M.noise(i*1.7,.3))*g,ph=t*2.2+i*.9,col=i%2?LV:PK;if(!(L>1))continue;const gr=c.createLinearGradient(0,y,0,y+L);gr.addColorStop(0,M.rgba(col,1));gr.addColorStop(1,M.rgba(VI,0));NEON(c,col,s*.028,()=>{c.beginPath();c.moveTo(x0,y);for(let j=1;j<=8;j++){const k=j/8;c.lineTo(x0+Math.sin(ph-k*2.6)*s*.16*k+f*s*.35*k,y+L*k)}},gr,a*.95)}const sw=Math.sin(t*1.7)*s*.22,Q=[[x+s*.82,y-s*.18],[x+s*1.75,y+s*.45],[x+s*1.25,y-s*1.1],[x+s*2.25,y-s*.75+sw]],pt=k=>{const m=1-k;return[0,1].map(d=>m*m*m*Q[0][d]+3*m*m*k*Q[1][d]+3*m*k*k*Q[2][d]+k*k*k*Q[3][d])},gt=M.clamp(g*1.1-.1);if(gt>0){NEON(c,RD,s*.045,()=>{c.beginPath();for(let i=0;i<=24;i++){const p=pt(i/24*gt);c[i?'lineTo':'moveTo'](p[0],p[1])}},0,a);const p=pt(gt);DOT(c,p[0],p[1],s*.075,AM,a)}SPH(c,x,y,s*(1+.03*Math.sin(t*3.1)),.26+.03*Math.sin(t*3.1+1),IR,a);GL(c,x,y-s*.45,s*1.2,AM,.45*a);DOT(c,x,y-s*1.28-Math.abs(Math.sin(t*2.4))*s*.16,s*.06,YL,a*Math.min(1,g*2))};",Wn="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Ke="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.44",El=[oe("lumen-dot-ring","Vòng chấm neon",2.6,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6638
- ${ne}${Bn}
6637
+ }`)],Wn=Y.find(t=>t.id==="lumen"),oe=(t,e,c,o,n)=>({id:t,name:e,category:Wn.name,pack:"lumen",duration:c,params:{accent:Wn.accent,position:"center",...o,style:"lumen"},code:n}),ne="const NV='#05041a',PK='#ff4fa3',AM='#ffb648',VI='#7a4dff',LV='#c49bff',YL='#fff09a',RD='#ff3a5c',IR=[AM,PK,VI,'#2a1680'],VS=[LV,'#9a7bff',VI,'#1d0f5c'];const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,NV),nx:PC(p.next,NV),fg:PC(p.fg,VI),f2:PC(p.fg2,PK)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.44,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;GL(c,x,y,r*6,col,a);c.save();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.6);c.shadowColor=col;c.shadowBlur=r*3;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const SPH=(c,x,y,r,ry=1,cs=IR,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.beginPath();c.moveTo(x-r,y);c.arc(x,y,r,Math.PI,0);c.ellipse(x,y,r,Math.max(.01,r*ry),0,0,Math.PI);c.closePath();const b=c.createLinearGradient(0,y-r,0,y+r*ry);b.addColorStop(0,cs[0]);b.addColorStop(.38,cs[1]);b.addColorStop(.66,cs[2]);b.addColorStop(1,cs[3]);c.fillStyle=b;c.shadowColor=cs[1];c.shadowBlur=r*.6;c.fill();c.shadowBlur=0;const s=c.createRadialGradient(x-r*.3,y-r*.55,0,x-r*.3,y-r*.55,r);s.addColorStop(0,'rgba(255,255,255,.85)');s.addColorStop(.28,'rgba(255,236,246,.24)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.strokeStyle='rgba(236,220,255,.55)';c.lineWidth=Math.max(1,r*.035);c.stroke();c.restore()};const CC=(c,B,x,y,k,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k,cl=col||B.K.fg;GL(c,x,y,R+B.u*.3,cl,1-k);const g=c.createRadialGradient(x,y,R*.55,x,y,R+1);g.addColorStop(0,B.K.nx);g.addColorStop(.8,B.K.nx);g.addColorStop(1,M.mix(B.K.nx,cl,.6*(1-k)));c.fillStyle=g;c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();NEON(c,cl,B.u*.006,()=>{c.beginPath();c.arc(x,y,R,0,M.TAU)},0,1-M.range(k,.6,.95))};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const FL=(t,ts,cs)=>{let i=0;ts.forEach(a=>{if(t>=a)i++});return cs[Math.min(i,cs.length-1)]};const POLY=(c,x,y,r,n,rot)=>{c.beginPath();for(let i=0;i<n;i++){const a=rot+i*M.TAU/n;c[i?'lineTo':'moveTo'](x+Math.cos(a)*r,y+Math.sin(a)*r)}c.closePath()};const MOTE=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,s=R(),y=((R()*B.H-t*B.u*(.03+.06*s))%B.H+B.H)%B.H;DOT(c,x,y,B.u*(.0016+.002*s),[PK,LV,AM][i%3],a*(.35+.5*M.noise(i,t*1.5)))}};",Hn="const DRING=(c,x,y,R,n,d,h,a=1,rot=0)=>{if(!(R>0)||!(a>0))return;c.save();c.globalCompositeOperation='lighter';c.globalAlpha=.16*Math.min(1,a);c.strokeStyle=M.mix(AM,VI,h);c.lineWidth=d*7;c.beginPath();c.arc(x,y,R,0,M.TAU);c.stroke();for(let i=0;i<n;i++){const an=rot+i*M.TAU/n,f=(Math.cos(an-rot*.4)+1)/2,col=M.mix(M.mix('#ffc83a',RD,f),f>.5?VI:'#5b6cff',h),px=x+Math.cos(an)*R,py=y+Math.sin(an)*R;c.globalAlpha=.45*Math.min(1,a);c.fillStyle=col;c.beginPath();c.arc(px,py,d*2.4,0,M.TAU);c.fill();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.2);c.beginPath();c.arc(px,py,d*1.15,0,M.TAU);c.fill()}c.restore()};",po="const CRT=(c,x,y,s,t,a=1,g=1)=>{if(!(s>0)||!(a>0))return;GL(c,x,y-s*.35,s*3.4,PK,.6*a);for(let i=0;i<7;i++){const f=i/6-.5,x0=x+f*s*1.45,L=s*(1.35+.7*M.noise(i*1.7,.3))*g,ph=t*2.2+i*.9,col=i%2?LV:PK;if(!(L>1))continue;const gr=c.createLinearGradient(0,y,0,y+L);gr.addColorStop(0,M.rgba(col,1));gr.addColorStop(1,M.rgba(VI,0));NEON(c,col,s*.028,()=>{c.beginPath();c.moveTo(x0,y);for(let j=1;j<=8;j++){const k=j/8;c.lineTo(x0+Math.sin(ph-k*2.6)*s*.16*k+f*s*.35*k,y+L*k)}},gr,a*.95)}const sw=Math.sin(t*1.7)*s*.22,Q=[[x+s*.82,y-s*.18],[x+s*1.75,y+s*.45],[x+s*1.25,y-s*1.1],[x+s*2.25,y-s*.75+sw]],pt=k=>{const m=1-k;return[0,1].map(d=>m*m*m*Q[0][d]+3*m*m*k*Q[1][d]+3*m*k*k*Q[2][d]+k*k*k*Q[3][d])},gt=M.clamp(g*1.1-.1);if(gt>0){NEON(c,RD,s*.045,()=>{c.beginPath();for(let i=0;i<=24;i++){const p=pt(i/24*gt);c[i?'lineTo':'moveTo'](p[0],p[1])}},0,a);const p=pt(gt);DOT(c,p[0],p[1],s*.075,AM,a)}SPH(c,x,y,s*(1+.03*Math.sin(t*3.1)),.26+.03*Math.sin(t*3.1+1),IR,a);GL(c,x,y-s*.45,s*1.2,AM,.45*a);DOT(c,x,y-s*1.28-Math.abs(Math.sin(t*2.4))*s*.16,s*.06,YL,a*Math.min(1,g*2))};",Ln="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Ke="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.44",Gl=[oe("lumen-dot-ring","Vòng chấm neon",2.6,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6638
+ ${ne}${Hn}
6639
6639
  // A neon dotted ring (tiny glowing dots, yellow to red) shrinks to a small ring while its hue turns violet, fattens into a glowing two-tone ring, then its core blooms until the frame is flat next (fields: bg, next, fg, fg2).
6640
6640
  ${Ke}
6641
6641
  const sh=M.ease.inOutCubic(M.range(t,.05,1.05)),h=M.ease.inOutCubic(M.range(t,.25,1.1)),rot=t*.9+sh*2.2,fat=M.ease.outCubic(M.range(t,.95,1.45)),gr=M.ease.inOutCubic(M.range(t,1,1.7))
@@ -6690,7 +6690,7 @@
6690
6690
  if(q>0){const h=Math.max(hy,H-hy)*1.02*q;GL(ctx,cx,hy,h+u*.3,K.f2,1-q);ctx.fillStyle=K.nx;ctx.fillRect(0,hy-h,W,h*2);NEON(ctx,K.f2,u*.005,()=>{ctx.beginPath();ctx.moveTo(0,hy-h);ctx.lineTo(W,hy-h);ctx.moveTo(0,hy+h);ctx.lineTo(W,hy+h)},0,1-M.range(q,.6,.95))}
6691
6691
  FIN(ctx,B)
6692
6692
  }`),oe("lumen-creature","Sinh vật phát sáng",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6693
- ${ne}${fo}
6693
+ ${ne}${po}
6694
6694
  // The glowing jelly creature: an iridescent dome with swaying light tentacles, a bobbing spark on top and a red curly tendril with an amber spark tip drifts in the dark among light motes, then its glow fills the frame with next (fields: bg, next, fg, fg2).
6695
6695
  ${Ke}
6696
6696
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.6))),g=M.ease.inOutCubic(M.range(t,.2,1.4)),s=u*(B.S.port?.15:.13)*pop,x=cx-s*.5+Math.sin(t*.9)*u*.01,y=cy-s*.15+Math.sin(t*1.6)*u*.015
@@ -6700,7 +6700,7 @@
6700
6700
  CC(ctx,B,x,y-s*.4,q,s*.9,K.f2)
6701
6701
  FIN(ctx,B)
6702
6702
  }`),oe("lumen-orbit-ring","Vòng quỹ đạo neon",3.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6703
- ${ne}${fo}
6703
+ ${ne}${po}
6704
6704
  // A big violet neon ring draws itself round a small glowing creature, a light dot orbits along it leaving a trail and a pink diamond rides the ring, then the ring expands until the frame is flat next (fields: bg, next, fg, fg2).
6705
6705
  ${Ke}
6706
6706
  const dr=M.ease.inOutCubic(M.range(t,.05,1.05)),R=u*.33*(1+.02*Math.sin(t*2.4)),pop=Math.max(0,M.ease.outBack(M.range(t,0,.6))),s=u*.075*pop,a0=-Math.PI/2
@@ -6770,7 +6770,7 @@
6770
6770
  CC(ctx,B,cx,cy,q,cr,LV)
6771
6771
  FIN(ctx,B)
6772
6772
  }`),oe("lumen-neon-word","Chữ neon sống động",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff3a5c",text:"alive"},`function render(ctx,t,env){
6773
- ${ne}${Bn}
6773
+ ${ne}${Hn}
6774
6774
  // Neon word: the title (text) in a soft rounded sans with a red-pink to violet gradient and a chromatic glow fades in from a blur and breathes, the dot of an i glows amber, then the word collapses into a dotted ring that blooms until the frame is flat next (fields: text, bg, next, fg, fg2).
6775
6775
  ${Ke}
6776
6776
  const sk=M.skin(env,B.p),s=String(B.p.text||''),ap=M.ease.outCubic(M.range(t,.05,.8)),cl=M.ease.inCubic(M.range(t,D-1.2,D-.75)),br=.5+.5*Math.sin(t*2.8)
@@ -6814,7 +6814,7 @@
6814
6814
  ctx.globalAlpha=a;ctx.shadowColor=PK;ctx.shadowBlur=f.size*.35;ctx.fillStyle=g;ctx.fillText(l,S.cx,y);ctx.shadowColor=fg;ctx.shadowBlur=f.size*.12;ctx.fillText(l,S.cx,y)})
6815
6815
  ctx.restore()
6816
6816
  }`),oe("lumen-orb","Quả cầu óng ánh nhỏ",4,{position:"top-right",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6817
- ${ne}${Wn}
6817
+ ${ne}${Ln}
6818
6818
  // Element: a small floating glossy iridescent orb with a soft halo and a light dot circling it on a tilted orbit, in a corner or edge (position: top-right, top-left, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg, fg2).
6819
6819
  const {duration:D,params:p}=env,k=M.io(t,D,.5,.45),u=Math.min(env.width,env.height),r=u*.045,o=SPOT(env,p.position,'top-right',r*5.2,r*3.6),fg=PC(p.fg,VI),f2=PC(p.fg2,PK)
6820
6820
  if(!(k.v>0))return
@@ -6824,7 +6824,7 @@
6824
6824
  GL(ctx,x,y,r*2.6*sc,f2,.8*k.v);SPH(ctx,x,y,r*sc*(1+.03*Math.sin(t*3)),1,[AM,f2,fg,'#2a1680'],k.v)
6825
6825
  if(front)DOT(ctx,d[0],d[1],r*.12,YL,k.v)
6826
6826
  }`),oe("lumen-critter","Sinh vật sáng nhỏ",4,{position:"bottom-left",fg:"#7a4dff"},`function render(ctx,t,env){
6827
- ${ne}${fo}${Wn}
6827
+ ${ne}${po}${Ln}
6828
6828
  // Element: the small glowing jelly creature (dome, swaying tentacles, curly tendril with a spark tip) bobbing gently in a corner or edge (position: bottom-left, bottom-right, top-left, top-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg).
6829
6829
  const {duration:D,params:p}=env,k=M.io(t,D,.5,.45),u=Math.min(env.width,env.height),s=u*.052,o=SPOT(env,p.position,'bottom-left',s*3.6,s*3.7)
6830
6830
  if(!(k.v>0))return
@@ -6841,7 +6841,7 @@
6841
6841
  if(hd>a0){const g=ctx.createLinearGradient(pa[0],pa[1],ph[0],ph[1]);g.addColorStop(0,M.rgba(fg,0));g.addColorStop(.45,M.rgba(fg,.8));g.addColorStop(.8,f2);g.addColorStop(1,AM);NEON(ctx,f2,u*.005,path(a0),g,k.v);const a1=Math.max(0,hd-tl*.35),pb=pt(a1),g2=ctx.createLinearGradient(pb[0],pb[1],ph[0],ph[1]);g2.addColorStop(0,M.rgba(f2,0));g2.addColorStop(1,AM);NEON(ctx,AM,u*.01,path(a1),g2,k.v)}
6842
6842
  const R=M.rand(13);for(let i=0;i<14;i++){const s0=R()*.95,age=hd-s0;if(age<0||age>.4)continue;const p0=pt(s0),dr=R()*M.TAU,f=age/.4;DOT(ctx,p0[0]+Math.cos(dr)*u*.03*f,p0[1]+Math.sin(dr)*u*.03*f+u*.02*f,u*.0025,i%2?LV:AM,k.v*(1-f))}
6843
6843
  const h=pt(hd);GL(ctx,h[0],h[1],u*.12,f2,.8*k.v);M.spark(ctx,h[0],h[1],u*.035,'#ffffff',k.v);DOT(ctx,h[0],h[1],u*.006,YL,k.v)
6844
- }`)],Hn=Y.find(t=>t.id==="rebound"),se=(t,e,c,o,n)=>({id:t,name:e,category:Hn.name,pack:"rebound",duration:c,params:{accent:Hn.accent,position:"center",...o,style:"rebound"},code:n}),xe="const NV='#07071a',CY='#36d6e7',OR='#ff8a3d',RD='#ff3b3b',YE='#ffd23f',WH='#ffffff',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,MIN=Math.min,ABS=Math.abs,HY=Math.hypot,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},RC=(c,...a)=>c.fillRect(...a);const PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d,OP={l:'r',r:'l',t:'b',b:'t',c:'c'},HT=(t,a)=>t<a?0:Math.exp((a-t)*7);const GL=(c,x,y,r,col,a=1)=>{if(r>0&&a>0){SV(c);c.globalCompositeOperation='lighter';const g=c.createRadialGradient(x,y,0,x,y,r),k=MIN(1,a);g.addColorStop(0,RA(col,.5*k));g.addColorStop(.3,RA(col,.14*k));g.addColorStop(1,RA(col,0));FS(c,g);RC(c,x-r,y-r,2*r,2*r);RS(c)}};const NL=(c,u,col,f,a=1,k=1,n=2,w=1)=>{if(!(a>0)||!(k>0))return;const lw=MAX(1,u*.0026*w);SV(c);GA(c,MIN(1,a));c.lineCap=c.lineJoin='round';if(k<1)c.setLineDash([u*n*k,u*n+9]);BP(c);f();c.strokeStyle=col;c.lineWidth=lw;c.shadowColor=col;c.shadowBlur=lw*7;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.strokeStyle=MX(col,WH,.65);c.lineWidth=lw*.5;c.stroke();RS(c)};const BE=(c,x,y,r,col,a=1)=>{if(a>0&&r>0){SV(c);c.globalCompositeOperation='lighter';GA(c,.28*MIN(1,a));FS(c,col);BP(c);c.arc(x,y,r*2.8,0,TAU);c.fill();GA(c,MIN(1,a));FS(c,MX(col,WH,.5));BP(c);c.arc(x,y,r,0,TAU);c.fill();RS(c)}};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,NV),nx=PC(p.next,NV),ac=PC(p.fg,PC(p.accent,CY)),hi=ED(p.ballIn,'l'),ho=ED(p.ballOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[Math.round(k=='l'?W*f:k=='r'?-W*f:0),Math.round(k=='t'?H*f:k=='b'?-H*f:0)],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]),e=pi?1:E.outCubic(RG(t,0,.35));const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}const g=c.createRadialGradient(W/2,H*.45,0,W/2,H*.45,HY(W,H)*.6);g.addColorStop(0,RA(ac,.09*e));g.addColorStop(1,RA('#000000',.3*e));FS(c,g);RC(c,0,0,W,H);return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,K:{bg,nx,ac},e,dr:pi?1:E.outCubic(RG(t,.03,.55)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const EP=(B,k)=>{const o=B.u*.14;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HC=(B,k)=>[k=='l'?B.W*.36:k=='r'?B.W*.64:B.W*.56,k=='t'?B.H*.32:k=='b'?B.H*.62:B.H*.42];const TS=(B,f)=>L(B.pi?PN+.3:.42,(B.po?B.D-PN:B.D-.42)-.42,f);const HP=(B,k,s)=>{const a=HO(B,k),b=HC(B,k),f=E.inOutQuad(s);return{x:L(a[0],b[0],f),y:L(a[1],b[1],f)-SN(PI*s)*B.u*.12,s:1,q:0}},HW=(B,t)=>B.pi&&t<PN?[OP[B.hi],0]:B.po&&t>B.D-PN?[B.ho,B.D-PN]:0;const PATH=(B,tt,K)=>{const D=B.D,u=B.u,O=B.of(tt),hp=(k,s)=>HP(B,k,s);if(B.pi&&tt<PN)return hp(OP[B.hi],tt/PN);if(B.po&&tt>D-PN)return hp(B.ho,(tt-D+PN)/PN);const Q=K.map(a=>a.slice()),F=Q[0];if(B.pi){F[3]=u*.12;Q.unshift([PN,...HC(B,OP[B.hi]),0,1])}else if(B.hi!='c'){const A=EP(B,B.hi);F[3]=B.hi=='t'?(F[2]-A[1])/4:B.hi=='b'?(A[1]-F[2])/2+u*.15:u*.2;Q.unshift([.1,...A,0,1])}const z=Q[Q.length-1];if(B.po)Q.push([D-PN,...HO(B,B.ho),u*.16,1]);else if(B.ho!='c'){const A=EP(B,B.ho);Q.push([D-.42,...A,B.ho=='b'?(A[1]-z[2])/4:B.ho=='t'?(z[2]-A[1])/4:u*.2,1])}let i=0;while(i<Q.length-2&&tt>Q[i+1][0])i++;const a=Q[i],b=Q[i+1]||a,k=RG(tt,a[0],b[0]);let q=0;Q.forEach(p=>{if(!p[4])q=MAX(q,Math.exp(-Math.pow((tt-p[0])/.05,2)))});let s=1;if(B.hi=='c')s=E.outBack(RG(tt,.18,.5));if(B.ho=='c')s*=1-E.inCubic(RG(tt,D-.62,D-.2));if(!B.pi&&B.hi!='c'&&tt<.1||!B.po&&B.ho!='c'&&tt>D-.42)s=0;return{x:L(a[1],b[1],k)+O[0],y:L(a[2],b[2],k)-4*(b[3]||0)*k*(1-k)+O[1],s:MAX(0,s),q:q*.5}};const BALL=(c,x,y,R,col,st,an,q)=>{if(!(R>.3))return;GL(c,x,y,R*11,col,1);GL(c,x,y,R*4,WH,1);SV(c);c.translate(x,y);FS(c,WH);c.shadowColor=MX(col,WH,.5);c.shadowBlur=R*2.2;if(q>.03){c.translate(0,R*q*.8);c.scale(1+q,1-q*.8);BP(c);c.arc(0,0,R,0,TAU)}else{c.rotate(an);const l=R*2*st,h=R*2/Math.sqrt(st);M.rr(c,-l/2,-h/2,l,h,h/2)}c.fill();RS(c)};const FLY=(c,B,K,r)=>{const t=B.t,w=HW(B,t),F=tt=>w?HP(B,w[0],(tt-w[1])/PN):PATH(B,tt,K),h=F(t);if(!(h.s>0))return;if(B.pz)RS(c);const a=F(t-.025),b=F(t+.025),vx=b.x-a.x,vy=b.y-a.y,st=1+MIN(2.8,HY(vx,vy)/(B.u*.07)),R=r*h.s;SV(c);c.globalCompositeOperation='lighter';c.lineCap='round';c.strokeStyle=MX(B.K.ac,WH,.45);for(let i=1;i<10;i++){const p=F(t-i*.025),o=F(t-i*.025+.025),k=1-i/10;if(!(p.s>0))break;GA(c,k*.5);c.lineWidth=R*1.5*k;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);BALL(c,h.x,h.y,R,B.K.ac,st,Math.atan2(vy,vx+1e-4),h.q);if(B.pz)B.cl()};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02,CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GL(c,x,y,R+B.u*.3,B.K.ac,1-k);FS(c,B.K.nx);BP(c);c.arc(x,y,R,0,TAU);c.fill();NL(c,B.u,B.K.ac,()=>c.arc(x,y,R,0,TAU),1-k,1,1,1.6)}};const END=(c,B)=>{const {W,u,q}=B,s=String(B.p.text||'').trim(),a=B.e*(1-RG(q,0,.4));if(s&&a>0){const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.05,S.w*.86,2),n=f.lines.length,h=n*f.lh+f.size;SV(c);GA(c,a*.55);FS(c,NV);c.shadowColor=NV;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,a);c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.shadowColor=B.K.ac;c.shadowBlur=f.size*.4;FS(c,WH);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh));RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,B.H)}if(B.pz)RS(c)};",Ln="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Se="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,dr,q,port}=B,T=f=>TS(B,f)",je={bg:"#07071a",next:"#07071a",fg:"#36d6e7",pan:"",text:""},ql=[se("rebound-dots-merge","Chấm sáng hợp thành bóng",2.6,{...je,ballIn:"c",ballOut:"r"},`function render(c,t,env){
6844
+ }`)],Dn=Y.find(t=>t.id==="rebound"),se=(t,e,c,o,n)=>({id:t,name:e,category:Dn.name,pack:"rebound",duration:c,params:{accent:Dn.accent,position:"center",...o,style:"rebound"},code:n}),xe="const NV='#07071a',CY='#36d6e7',OR='#ff8a3d',RD='#ff3b3b',YE='#ffd23f',WH='#ffffff',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,MIN=Math.min,ABS=Math.abs,HY=Math.hypot,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},RC=(c,...a)=>c.fillRect(...a);const PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d,OP={l:'r',r:'l',t:'b',b:'t',c:'c'},HT=(t,a)=>t<a?0:Math.exp((a-t)*7);const GL=(c,x,y,r,col,a=1)=>{if(r>0&&a>0){SV(c);c.globalCompositeOperation='lighter';const g=c.createRadialGradient(x,y,0,x,y,r),k=MIN(1,a);g.addColorStop(0,RA(col,.5*k));g.addColorStop(.3,RA(col,.14*k));g.addColorStop(1,RA(col,0));FS(c,g);RC(c,x-r,y-r,2*r,2*r);RS(c)}};const NL=(c,u,col,f,a=1,k=1,n=2,w=1)=>{if(!(a>0)||!(k>0))return;const lw=MAX(1,u*.0026*w);SV(c);GA(c,MIN(1,a));c.lineCap=c.lineJoin='round';if(k<1)c.setLineDash([u*n*k,u*n+9]);BP(c);f();c.strokeStyle=col;c.lineWidth=lw;c.shadowColor=col;c.shadowBlur=lw*7;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.strokeStyle=MX(col,WH,.65);c.lineWidth=lw*.5;c.stroke();RS(c)};const BE=(c,x,y,r,col,a=1)=>{if(a>0&&r>0){SV(c);c.globalCompositeOperation='lighter';GA(c,.28*MIN(1,a));FS(c,col);BP(c);c.arc(x,y,r*2.8,0,TAU);c.fill();GA(c,MIN(1,a));FS(c,MX(col,WH,.5));BP(c);c.arc(x,y,r,0,TAU);c.fill();RS(c)}};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,NV),nx=PC(p.next,NV),ac=PC(p.fg,PC(p.accent,CY)),hi=ED(p.ballIn,'l'),ho=ED(p.ballOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[Math.round(k=='l'?W*f:k=='r'?-W*f:0),Math.round(k=='t'?H*f:k=='b'?-H*f:0)],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]),e=pi?1:E.outCubic(RG(t,0,.35));const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}const g=c.createRadialGradient(W/2,H*.45,0,W/2,H*.45,HY(W,H)*.6);g.addColorStop(0,RA(ac,.09*e));g.addColorStop(1,RA('#000000',.3*e));FS(c,g);RC(c,0,0,W,H);return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,K:{bg,nx,ac},e,dr:pi?1:E.outCubic(RG(t,.03,.55)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const EP=(B,k)=>{const o=B.u*.14;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HC=(B,k)=>[k=='l'?B.W*.36:k=='r'?B.W*.64:B.W*.56,k=='t'?B.H*.32:k=='b'?B.H*.62:B.H*.42];const TS=(B,f)=>L(B.pi?PN+.3:.42,(B.po?B.D-PN:B.D-.42)-.42,f);const HP=(B,k,s)=>{const a=HO(B,k),b=HC(B,k),f=E.inOutQuad(s);return{x:L(a[0],b[0],f),y:L(a[1],b[1],f)-SN(PI*s)*B.u*.12,s:1,q:0}},HW=(B,t)=>B.pi&&t<PN?[OP[B.hi],0]:B.po&&t>B.D-PN?[B.ho,B.D-PN]:0;const PATH=(B,tt,K)=>{const D=B.D,u=B.u,O=B.of(tt),hp=(k,s)=>HP(B,k,s);if(B.pi&&tt<PN)return hp(OP[B.hi],tt/PN);if(B.po&&tt>D-PN)return hp(B.ho,(tt-D+PN)/PN);const Q=K.map(a=>a.slice()),F=Q[0];if(B.pi){F[3]=u*.12;Q.unshift([PN,...HC(B,OP[B.hi]),0,1])}else if(B.hi!='c'){const A=EP(B,B.hi);F[3]=B.hi=='t'?(F[2]-A[1])/4:B.hi=='b'?(A[1]-F[2])/2+u*.15:u*.2;Q.unshift([.1,...A,0,1])}const z=Q[Q.length-1];if(B.po)Q.push([D-PN,...HO(B,B.ho),u*.16,1]);else if(B.ho!='c'){const A=EP(B,B.ho);Q.push([D-.42,...A,B.ho=='b'?(A[1]-z[2])/4:B.ho=='t'?(z[2]-A[1])/4:u*.2,1])}let i=0;while(i<Q.length-2&&tt>Q[i+1][0])i++;const a=Q[i],b=Q[i+1]||a,k=RG(tt,a[0],b[0]);let q=0;Q.forEach(p=>{if(!p[4])q=MAX(q,Math.exp(-Math.pow((tt-p[0])/.05,2)))});let s=1;if(B.hi=='c')s=E.outBack(RG(tt,.18,.5));if(B.ho=='c')s*=1-E.inCubic(RG(tt,D-.62,D-.2));if(!B.pi&&B.hi!='c'&&tt<.1||!B.po&&B.ho!='c'&&tt>D-.42)s=0;return{x:L(a[1],b[1],k)+O[0],y:L(a[2],b[2],k)-4*(b[3]||0)*k*(1-k)+O[1],s:MAX(0,s),q:q*.5}};const BALL=(c,x,y,R,col,st,an,q)=>{if(!(R>.3))return;GL(c,x,y,R*11,col,1);GL(c,x,y,R*4,WH,1);SV(c);c.translate(x,y);FS(c,WH);c.shadowColor=MX(col,WH,.5);c.shadowBlur=R*2.2;if(q>.03){c.translate(0,R*q*.8);c.scale(1+q,1-q*.8);BP(c);c.arc(0,0,R,0,TAU)}else{c.rotate(an);const l=R*2*st,h=R*2/Math.sqrt(st);M.rr(c,-l/2,-h/2,l,h,h/2)}c.fill();RS(c)};const FLY=(c,B,K,r)=>{const t=B.t,w=HW(B,t),F=tt=>w?HP(B,w[0],(tt-w[1])/PN):PATH(B,tt,K),h=F(t);if(!(h.s>0))return;if(B.pz)RS(c);const a=F(t-.025),b=F(t+.025),vx=b.x-a.x,vy=b.y-a.y,st=1+MIN(2.8,HY(vx,vy)/(B.u*.07)),R=r*h.s;SV(c);c.globalCompositeOperation='lighter';c.lineCap='round';c.strokeStyle=MX(B.K.ac,WH,.45);for(let i=1;i<10;i++){const p=F(t-i*.025),o=F(t-i*.025+.025),k=1-i/10;if(!(p.s>0))break;GA(c,k*.5);c.lineWidth=R*1.5*k;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);BALL(c,h.x,h.y,R,B.K.ac,st,Math.atan2(vy,vx+1e-4),h.q);if(B.pz)B.cl()};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02,CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GL(c,x,y,R+B.u*.3,B.K.ac,1-k);FS(c,B.K.nx);BP(c);c.arc(x,y,R,0,TAU);c.fill();NL(c,B.u,B.K.ac,()=>c.arc(x,y,R,0,TAU),1-k,1,1,1.6)}};const END=(c,B)=>{const {W,u,q}=B,s=String(B.p.text||'').trim(),a=B.e*(1-RG(q,0,.4));if(s&&a>0){const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.05,S.w*.86,2),n=f.lines.length,h=n*f.lh+f.size;SV(c);GA(c,a*.55);FS(c,NV);c.shadowColor=NV;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,a);c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.shadowColor=B.K.ac;c.shadowBlur=f.size*.4;FS(c,WH);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh));RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,B.H)}if(B.pz)RS(c)};",En="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Se="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,dr,q,port}=B,T=f=>TS(B,f)",je={bg:"#07071a",next:"#07071a",fg:"#36d6e7",pan:"",text:""},Ol=[se("rebound-dots-merge","Chấm sáng hợp thành bóng",2.6,{...je,ballIn:"c",ballOut:"r"},`function render(c,t,env){
6845
6845
  ${xe}
6846
6846
  // Dots merge: five small glowing dots (cyan, orange, red, yellow, white) spiral in, a thin cyan diamond outline draws between them, they merge into the glowing white ball that drops onto a neon floor line, squashes, bounces away on ballOut, then the diamond opens and fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6847
6847
  ${Se},r=u*.034,my=cy-u*.08,fy=cy+u*.3,m=E.inOutCubic(RG(t,.02,.48)),C=[K.ac,OR,RD,YE,WH],ds=u*(.11*E.outBack(RG(t,.1,.42))+.3*E.outCubic(RG(t,.55,1.3))),Q=[[T(0),cx,my,0,1],[T(.4),cx,fy-r,(fy-r-my)/4],[T(1),cx+u*.2,fy-r,u*.22]]
@@ -7012,14 +7012,14 @@
7012
7012
  ctx.globalAlpha=Math.min(1,a)*(1-k.o);ctx.shadowColor=fg;ctx.shadowBlur=f.size*.5;ctx.fillStyle='#ffffff';ctx.fillText(l,S.cx,y);ctx.shadowBlur=f.size*.12;ctx.fillText(l,S.cx,y)})
7013
7013
  ctx.restore()
7014
7014
  }`),se("rebound-ball","Bóng nảy góc",4,{position:"bottom-right",fg:"#36d6e7"},`function render(c,t,env){
7015
- ${xe}${Ln}
7015
+ ${xe}${En}
7016
7016
  // Element: a small glowing white ball keeps bouncing on a short neon line in a corner or edge (position: bottom-right, bottom-left, top-left, top-right, top, lower), squashing on each contact and stretching as it flies; loops over any duration; transparent elsewhere (fields: position, fg).
7017
7017
  const {duration:D,params:p}=env,k=M.io(t,D,.45,.4),u=MIN(env.width,env.height),r=u*.018,o=SPOT(env,p.position,'bottom-right',u*.2,u*.22),ac=PC(p.fg,CY),pe=.62,f=(t%pe)/pe,hg=u*.12,y0=o.y+u*.08,yb=y0-r-4*hg*f*(1-f),vy=4*hg*(1-2*f)/pe,x=o.x+SN(t*1.3)*u*.03,q=Math.exp(-Math.pow(MIN(f,1-f)*pe/.05,2))*.5
7018
7018
  if(!(k.v>0))return
7019
7019
  SV(c);GA(c,k.v);NL(c,u,ac,()=>{c.moveTo(o.x-u*.08,y0);c.lineTo(o.x+u*.08,y0)},1,k.i,.16);NL(c,u,OR,()=>{c.moveTo(o.x-u*.05,y0+u*.014);c.lineTo(o.x+u*.05,y0+u*.014)},.7,k.i,.1);GL(c,x,y0,u*.07,ac,q*1.6)
7020
7020
  BALL(c,x,yb,r*(.4+.6*k.i),ac,1+MIN(1.8,ABS(vy)/(u*1.6)),PI/2,q);RS(c)
7021
7021
  }`),se("rebound-bricks","Chồng gạch neon nhỏ",4,{position:"top-left",fg:"#36d6e7"},`function render(c,t,env){
7022
- ${xe}${Ln}
7022
+ ${xe}${En}
7023
7023
  // Element: a small outlined neon brick stack (red, orange, cyan offset rows) with a little glowing dot bouncing on top, in a corner or edge (position: top-left, top-right, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg).
7024
7024
  const {duration:D,params:p}=env,k=M.io(t,D,.45,.4),u=MIN(env.width,env.height),o=SPOT(env,p.position,'top-left',u*.18,u*.2),ac=PC(p.fg,CY),bw=u*.05,bh=u*.026,base=o.y+u*.08,C=[RD,OR,ac],top=base-3*bh,pe=.7,f=(t%pe)/pe,r=u*.011,q=Math.exp(-Math.pow(MIN(f,1-f)*pe/.05,2))*.5
7025
7025
  if(!(k.v>0))return
@@ -7027,7 +7027,7 @@
7027
7027
  for(let i=0;i<3;i++)for(let j=0;j<2;j++){const x=o.x-bw+j*bw+(i%2?bw*.2:-bw*.2),y=base-(i+1)*bh,g=u*.003,col=C[(i+j)%3];SV(c);GA(c,.12*k.v);FS(c,col);RC(c,x+g,y+g,bw-2*g,bh-2*g);RS(c);NL(c,u,col,()=>c.rect(x+g,y+g,bw-2*g,bh-2*g),1,M.clamp(k.i*1.6-i*.2),.16)}
7028
7028
  NL(c,u,WH,()=>{c.moveTo(o.x-bw*1.6,base);c.lineTo(o.x+bw*1.6,base)},.7,k.i,.16)
7029
7029
  BALL(c,o.x+SN(t*.9)*bw*.4,top-r-4*u*.07*f*(1-f),r*k.i,ac,1+ABS(1-2*f)*.6,PI/2,q);RS(c)
7030
- }`)],Dn=Y.find(t=>t.id==="join"),ie=(t,e,c,o,n)=>({id:t,name:e,category:Dn.name,pack:"join",duration:c,params:{accent:Dn.accent,position:"center",...o,style:"join"},code:n}),le="const D=env.duration,W=env.width,H=env.height,p=env.params||{},h=D/2,hd=Math.min(h*.4,Math.max(D*.06,.07)),inn=t<h,a=M.clamp(t/(h-hd)),b=M.clamp((t-h-hd)/(h-hd)),full=t>=h-hd&&t<=h+hd,HX=/^#[0-9a-f]{6}$/i,A=HX.test(p.accent)?p.accent:'#ff5a36',B=HX.test(p.fg2)?p.fg2:'#0c0c10',C3=HX.test(p.fg3)?p.fg3:'#f4efe6',u=Math.min(W,H),L=Math.hypot(W,H),port=H>W*1.1,E=M.ease.inOutCubic,m=Math.ceil(u*.01)+2,dk=String(p.dir||''),vert=dk==='t'||dk==='b',w=vert?H:W,v=vert?W:H,ang=dk==='r'?Math.PI:dk==='t'?Math.PI/2:dk==='b'?-Math.PI/2:0,ORI=()=>{ctx.translate(W/2,H/2);ctx.rotate(ang);ctx.translate(-w/2,-v/2)},BASE=c=>{if(full){ctx.fillStyle=c;ctx.fillRect(-m,-m,Math.max(W,H)+2*m,Math.max(W,H)+2*m)}};if(!(t>0&&t<D))return;",Gl=[ie("join-cube-turn","Khối lập phương xoay",1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7030
+ }`)],qn=Y.find(t=>t.id==="join"),ie=(t,e,c,o,n)=>({id:t,name:e,category:qn.name,pack:"join",duration:c,params:{accent:qn.accent,position:"center",...o,style:"join"},code:n}),le="const D=env.duration,W=env.width,H=env.height,p=env.params||{},h=D/2,hd=Math.min(h*.4,Math.max(D*.06,.07)),inn=t<h,a=M.clamp(t/(h-hd)),b=M.clamp((t-h-hd)/(h-hd)),full=t>=h-hd&&t<=h+hd,HX=/^#[0-9a-f]{6}$/i,A=HX.test(p.accent)?p.accent:'#ff5a36',B=HX.test(p.fg2)?p.fg2:'#0c0c10',C3=HX.test(p.fg3)?p.fg3:'#f4efe6',u=Math.min(W,H),L=Math.hypot(W,H),port=H>W*1.1,E=M.ease.inOutCubic,m=Math.ceil(u*.01)+2,dk=String(p.dir||''),vert=dk==='t'||dk==='b',w=vert?H:W,v=vert?W:H,ang=dk==='r'?Math.PI:dk==='t'?Math.PI/2:dk==='b'?-Math.PI/2:0,ORI=()=>{ctx.translate(W/2,H/2);ctx.rotate(ang);ctx.translate(-w/2,-v/2)},BASE=c=>{if(full){ctx.fillStyle=c;ctx.fillRect(-m,-m,Math.max(W,H)+2*m,Math.max(W,H)+2*m)}};if(!(t>0&&t<D))return;",Nl=[ie("join-cube-turn","Khối lập phương xoay",1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7031
7031
  ${le}
7032
7032
  // The frame is the front face of a cube that turns in perspective (dir = the side the new face comes from): the
7033
7033
  // accent side face swings in with lambert shading, an inset bevel and a moving specular band and covers the frame
@@ -7287,8 +7287,8 @@
7287
7287
  ctx.globalCompositeOperation='source-over'
7288
7288
  let fb=M.clamp((e-.55)/.45);fb=fb*fb*(3-2*fb);if(fb>0){const g=ctx.createRadialGradient(w*(.3+.4*sP),v*.45,0,w*(.3+.4*sP),v*.45,L*.75);g.addColorStop(0,M.rgba('#fffaf0',fb));g.addColorStop(.45,M.rgba('#ffe6b0',fb));g.addColorStop(1,M.rgba(M.mix(A,'#ffc07a',.55),fb));ctx.fillStyle=g;ctx.fillRect(-m,-m,w+2*m,v+2*m)}
7289
7289
  ctx.restore()
7290
- }`)],En=Y.find(t=>t.id==="fluid"),he=(t,e,c,o,n)=>({id:t,name:e,category:En.name,pack:"fluid",duration:c,params:{accent:En.accent,position:"center",...o,style:"fluid"},code:n}),fe="const PL='#14102a',IK='#0d0b1e',PK='#ff6fb5',PE='#ffb38a',LI='#b49cff',MI='#7ee8c8',BU='#ffe38a',WH='#ffffff';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,PL),nx:PC(p.next,PL),fg:PC(p.fg,PK),f2:PC(p.fg2,LI)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.46,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const QM=(B,col)=>M.mix(col,B.K.nx,B.q);const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{const k=.22*Math.min(1,a)*B.e*(1-B.q);if(!(k>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.6);g.addColorStop(0,M.rgba(col,k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const SM=(c,P)=>{const n=P.length,m=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2],s=m(P[0],P[1%n]);c.moveTo(s[0],s[1]);for(let i=1;i<=n;i++){const a=P[i%n],z=m(a,P[(i+1)%n]);c.quadraticCurveTo(a[0],a[1],z[0],z[1])}c.closePath()};const PTS=(x,y,f,n=72)=>{const o=[];for(let i=0;i<n;i++){const a=i/n*M.TAU,r=Math.max(0,f(a));o.push([x+Math.cos(a)*r,y+Math.sin(a)*r])}return o};const WB=(t,s,A)=>a=>1+A*(.55*Math.sin(2*a+t*1.1+s)+.3*Math.sin(3*a-t*1.4+s*1.7)+.15*Math.sin(5*a+t*.8+s*2.3));const LG=(c,x,y,r,c1,c2)=>{const g=c.createRadialGradient(x-r*.35,y-r*.45,r*.05,x,y,Math.max(1,r*1.25));g.addColorStop(0,M.mix(c1,WH,.45));g.addColorStop(.42,c1);g.addColorStop(1,c2);return g};const HL=(c,x,y,r,a=1)=>{if(!(a>0)||!(r>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x-r*.34,y-r*.44);c.rotate(-.6);c.scale(1,.55);const g=c.createRadialGradient(0,0,0,0,0,r*.42);g.addColorStop(0,'rgba(255,255,255,.72)');g.addColorStop(.5,'rgba(255,255,255,.2)');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.arc(0,0,r*.42,0,M.TAU);c.fill();c.fillStyle='rgba(255,255,255,.85)';c.beginPath();c.arc(-r*.05,-r*.02,r*.075,0,M.TAU);c.fill();c.restore()};const GEL=(c,P,x,y,r,c1,c2,k=1)=>{if(!(r>0))return;c.beginPath();SM(c,P);c.fillStyle=LG(c,x,y,r,c1,c2);c.fill();if(!(k>0))return;c.save();c.clip();c.beginPath();c.rect(x-r*6,y-r*6,r*12,r*12);SM(c,P);c.shadowColor=M.rgba(IK,.5*Math.min(1,k));c.shadowBlur=r*.3;c.shadowOffsetX=-r*.07;c.shadowOffsetY=-r*.12;c.fillStyle=IK;c.fill('evenodd');c.restore();HL(c,x,y,r,k)};",po="const BR=(c,A,B,v=.5)=>{const x1=A[0],y1=A[1],r1=A[2],x2=B[0],y2=B[1],r2=B[2],d=Math.hypot(x2-x1,y2-y1),mx=(r1+r2)*1.3;if(!(r1>0&&r2>0)||d>=mx||d<=Math.abs(r1-r2)+.5)return;const PI=Math.PI,ac=z=>Math.acos(M.clamp(z,-1,1)),o=d<r1+r2,u1=o?ac((r1*r1+d*d-r2*r2)/(2*r1*d)):0,u2=o?ac((r2*r2+d*d-r1*r1)/(2*r2*d)):0,an=Math.atan2(y2-y1,x2-x1),ms=ac((r1-r2)/d),w=v*(o?1:M.clamp((mx-d)/(mx-r1-r2))),a1=an+u1+(ms-u1)*w,a2=an-u1-(ms-u1)*w,a3=an+PI-u2-(PI-u2-ms)*w,a4=an-PI+u2+(PI-u2-ms)*w,V=(x,y,a,r)=>[x+Math.cos(a)*r,y+Math.sin(a)*r],p1=V(x1,y1,a1,r1),p2=V(x1,y1,a2,r1),p3=V(x2,y2,a3,r2),p4=V(x2,y2,a4,r2),k=Math.min(w*2.4,Math.hypot(p3[0]-p1[0],p3[1]-p1[1])/(r1+r2))*Math.min(1,d*2/(r1+r2)),h1=V(p1[0],p1[1],a1-PI/2,r1*k),h2=V(p2[0],p2[1],a2+PI/2,r1*k),h3=V(p3[0],p3[1],a3+PI/2,r2*k),h4=V(p4[0],p4[1],a4-PI/2,r2*k),Q=[p1,p3,p4,p2];let ar=0;for(let i=0;i<4;i++){const a=Q[i],b=Q[(i+1)%4];ar+=a[0]*b[1]-b[0]*a[1]}if(ar>=0){c.moveTo(p1[0],p1[1]);c.bezierCurveTo(h1[0],h1[1],h3[0],h3[1],p3[0],p3[1]);c.lineTo(p4[0],p4[1]);c.bezierCurveTo(h4[0],h4[1],h2[0],h2[1],p2[0],p2[1])}else{c.moveTo(p2[0],p2[1]);c.bezierCurveTo(h2[0],h2[1],h4[0],h4[1],p4[0],p4[1]);c.lineTo(p3[0],p3[1]);c.bezierCurveTo(h3[0],h3[1],h1[0],h1[1],p1[0],p1[1])}c.closePath()};const UNI=(c,L,v=.5)=>{c.beginPath();L.forEach(b=>{if(b[2]>0){c.moveTo(b[0]+b[2],b[1]);c.arc(b[0],b[1],b[2],0,M.TAU)}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)BR(c,L[i],L[j],v)};const UF=(c,L,v=.5,nb)=>{L.forEach(b=>{if(b[2]>0){c.beginPath();c.arc(b[0],b[1],b[2],0,M.TAU);c.fill()}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)if(!nb||nb(i,j)){c.beginPath();BR(c,L[i],L[j],v);c.fill()}};",Ol="const FCT=(L,x,y,rm,n=90)=>{const F=(px,py)=>{let s=0;for(const b of L){if(!(b[2]>0))continue;const dx=px-b[0],dy=py-b[1];s+=b[2]*b[2]/(dx*dx+dy*dy+.01)}return s},o=[],st=Math.max(.5,rm/42);for(let i=0;i<n;i++){const a=i/n*M.TAU,ca=Math.cos(a),sa=Math.sin(a);let r=st;while(r<rm&&F(x+ca*r,y+sa*r)>=1)r+=st;let lo=r-st,hi=r;for(let k=0;k<6;k++){const m=(lo+hi)/2;if(F(x+ca*m,y+sa*m)>=1)lo=m;else hi=m}o.push([x+ca*lo,y+sa*lo])}return o};",go="const TEAR=(c,x,y,r,s=1)=>{const h=y-r*(1+1.4*s);c.moveTo(x,h);c.bezierCurveTo(x+r*.3,y-r*(.55+.7*s),x+r,y-r*.6,x+r,y);c.arc(x,y,r,0,Math.PI);c.bezierCurveTo(x-r,y-r*.6,x-r*.3,y-r*(.55+.7*s),x,h);c.closePath()};const DRIP=(c,x,y,w,L)=>{c.beginPath();if(!(L>0)||!(w>0))return;const b=w*.62*M.clamp(L/(w*1.4),.6,1),e=y+L-b*1.6;c.moveTo(x-w*.75,y-w*.9);c.quadraticCurveTo(x-w*.42,y-w*.3,x-w*.42,y+w*.6);if(e>y+w*.6)c.lineTo(x-w*.38,e);c.quadraticCurveTo(x-w*.38,y+L-b*.9,x-b,y+L);c.arc(x,y+L,b,Math.PI,0,true);c.quadraticCurveTo(x+w*.38,y+L-b*.9,x+w*.38,Math.max(e,y+w*.6));c.lineTo(x+w*.42,y+w*.6);c.quadraticCurveTo(x+w*.42,y-w*.3,x+w*.75,y-w*.9);c.closePath()};",Nl="const BUB=(c,x,y,r,f1,f2,a=1,sx=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x,y);c.scale(sx,1/sx);const g=c.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(f2,.04));g.addColorStop(.72,M.rgba(f2,.12));g.addColorStop(.93,M.rgba(f1,.42));g.addColorStop(1,'rgba(255,255,255,.6)');c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();const rg=c.createLinearGradient(-r,-r,r,r);rg.addColorStop(0,M.rgba(f1,.85));rg.addColorStop(.5,M.rgba(MI,.6));rg.addColorStop(1,M.rgba(f2,.85));c.strokeStyle=rg;c.lineWidth=Math.max(.8,r*.035);c.stroke();c.lineCap='round';c.strokeStyle='rgba(255,255,255,.75)';c.lineWidth=r*.09;c.beginPath();c.arc(0,0,r*.74,Math.PI*1.08,Math.PI*1.42);c.stroke();c.strokeStyle='rgba(255,255,255,.3)';c.lineWidth=r*.05;c.beginPath();c.arc(0,0,r*.8,Math.PI*.15,Math.PI*.4);c.stroke();c.fillStyle='rgba(255,255,255,.9)';c.beginPath();c.arc(-r*.36,-r*.5,r*.07,0,M.TAU);c.fill();c.restore()};",uo="const POOL=(c,B,Y,top,c1,c2,k=1)=>{const W=B.W,H=B.H;c.beginPath();c.moveTo(-5,H+5);for(let i=0;i<=64;i++){const x=i/64*W;c.lineTo(x,Y(x))}c.lineTo(W+5,H+5);c.closePath();const g=c.createLinearGradient(0,top-B.u*.04,0,H);g.addColorStop(0,M.mix(c1,WH,.3*k));g.addColorStop(.22,c1);g.addColorStop(1,c2);c.fillStyle=g;c.fill();if(!(k>0))return;c.save();c.beginPath();for(let i=0;i<=64;i++){const x=i/64*W;c[i?'lineTo':'moveTo'](x,Y(x)+B.u*.004)}c.lineCap='round';c.strokeStyle=M.rgba(WH,.5*k);c.lineWidth=B.u*.004;c.stroke();c.globalAlpha=.12*k;c.lineWidth=B.u*.03;c.translate(0,B.u*.02);c.stroke();c.restore()};",qn="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:S.x1-w/2,y=P.includes('top')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Ve="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.46",Il=[he("fluid-blob-morph","Khối lỏng biến hình",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7291
- ${fe}${Ol}
7290
+ }`)],Gn=Y.find(t=>t.id==="fluid"),he=(t,e,c,o,n)=>({id:t,name:e,category:Gn.name,pack:"fluid",duration:c,params:{accent:Gn.accent,position:"center",...o,style:"fluid"},code:n}),fe="const PL='#14102a',IK='#0d0b1e',PK='#ff6fb5',PE='#ffb38a',LI='#b49cff',MI='#7ee8c8',BU='#ffe38a',WH='#ffffff';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,PL),nx:PC(p.next,PL),fg:PC(p.fg,PK),f2:PC(p.fg2,LI)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.46,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const QM=(B,col)=>M.mix(col,B.K.nx,B.q);const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{const k=.22*Math.min(1,a)*B.e*(1-B.q);if(!(k>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.6);g.addColorStop(0,M.rgba(col,k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const SM=(c,P)=>{const n=P.length,m=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2],s=m(P[0],P[1%n]);c.moveTo(s[0],s[1]);for(let i=1;i<=n;i++){const a=P[i%n],z=m(a,P[(i+1)%n]);c.quadraticCurveTo(a[0],a[1],z[0],z[1])}c.closePath()};const PTS=(x,y,f,n=72)=>{const o=[];for(let i=0;i<n;i++){const a=i/n*M.TAU,r=Math.max(0,f(a));o.push([x+Math.cos(a)*r,y+Math.sin(a)*r])}return o};const WB=(t,s,A)=>a=>1+A*(.55*Math.sin(2*a+t*1.1+s)+.3*Math.sin(3*a-t*1.4+s*1.7)+.15*Math.sin(5*a+t*.8+s*2.3));const LG=(c,x,y,r,c1,c2)=>{const g=c.createRadialGradient(x-r*.35,y-r*.45,r*.05,x,y,Math.max(1,r*1.25));g.addColorStop(0,M.mix(c1,WH,.45));g.addColorStop(.42,c1);g.addColorStop(1,c2);return g};const HL=(c,x,y,r,a=1)=>{if(!(a>0)||!(r>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x-r*.34,y-r*.44);c.rotate(-.6);c.scale(1,.55);const g=c.createRadialGradient(0,0,0,0,0,r*.42);g.addColorStop(0,'rgba(255,255,255,.72)');g.addColorStop(.5,'rgba(255,255,255,.2)');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.arc(0,0,r*.42,0,M.TAU);c.fill();c.fillStyle='rgba(255,255,255,.85)';c.beginPath();c.arc(-r*.05,-r*.02,r*.075,0,M.TAU);c.fill();c.restore()};const GEL=(c,P,x,y,r,c1,c2,k=1)=>{if(!(r>0))return;c.beginPath();SM(c,P);c.fillStyle=LG(c,x,y,r,c1,c2);c.fill();if(!(k>0))return;c.save();c.clip();c.beginPath();c.rect(x-r*6,y-r*6,r*12,r*12);SM(c,P);c.shadowColor=M.rgba(IK,.5*Math.min(1,k));c.shadowBlur=r*.3;c.shadowOffsetX=-r*.07;c.shadowOffsetY=-r*.12;c.fillStyle=IK;c.fill('evenodd');c.restore();HL(c,x,y,r,k)};",go="const BR=(c,A,B,v=.5)=>{const x1=A[0],y1=A[1],r1=A[2],x2=B[0],y2=B[1],r2=B[2],d=Math.hypot(x2-x1,y2-y1),mx=(r1+r2)*1.3;if(!(r1>0&&r2>0)||d>=mx||d<=Math.abs(r1-r2)+.5)return;const PI=Math.PI,ac=z=>Math.acos(M.clamp(z,-1,1)),o=d<r1+r2,u1=o?ac((r1*r1+d*d-r2*r2)/(2*r1*d)):0,u2=o?ac((r2*r2+d*d-r1*r1)/(2*r2*d)):0,an=Math.atan2(y2-y1,x2-x1),ms=ac((r1-r2)/d),w=v*(o?1:M.clamp((mx-d)/(mx-r1-r2))),a1=an+u1+(ms-u1)*w,a2=an-u1-(ms-u1)*w,a3=an+PI-u2-(PI-u2-ms)*w,a4=an-PI+u2+(PI-u2-ms)*w,V=(x,y,a,r)=>[x+Math.cos(a)*r,y+Math.sin(a)*r],p1=V(x1,y1,a1,r1),p2=V(x1,y1,a2,r1),p3=V(x2,y2,a3,r2),p4=V(x2,y2,a4,r2),k=Math.min(w*2.4,Math.hypot(p3[0]-p1[0],p3[1]-p1[1])/(r1+r2))*Math.min(1,d*2/(r1+r2)),h1=V(p1[0],p1[1],a1-PI/2,r1*k),h2=V(p2[0],p2[1],a2+PI/2,r1*k),h3=V(p3[0],p3[1],a3+PI/2,r2*k),h4=V(p4[0],p4[1],a4-PI/2,r2*k),Q=[p1,p3,p4,p2];let ar=0;for(let i=0;i<4;i++){const a=Q[i],b=Q[(i+1)%4];ar+=a[0]*b[1]-b[0]*a[1]}if(ar>=0){c.moveTo(p1[0],p1[1]);c.bezierCurveTo(h1[0],h1[1],h3[0],h3[1],p3[0],p3[1]);c.lineTo(p4[0],p4[1]);c.bezierCurveTo(h4[0],h4[1],h2[0],h2[1],p2[0],p2[1])}else{c.moveTo(p2[0],p2[1]);c.bezierCurveTo(h2[0],h2[1],h4[0],h4[1],p4[0],p4[1]);c.lineTo(p3[0],p3[1]);c.bezierCurveTo(h3[0],h3[1],h1[0],h1[1],p1[0],p1[1])}c.closePath()};const UNI=(c,L,v=.5)=>{c.beginPath();L.forEach(b=>{if(b[2]>0){c.moveTo(b[0]+b[2],b[1]);c.arc(b[0],b[1],b[2],0,M.TAU)}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)BR(c,L[i],L[j],v)};const UF=(c,L,v=.5,nb)=>{L.forEach(b=>{if(b[2]>0){c.beginPath();c.arc(b[0],b[1],b[2],0,M.TAU);c.fill()}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)if(!nb||nb(i,j)){c.beginPath();BR(c,L[i],L[j],v);c.fill()}};",Il="const FCT=(L,x,y,rm,n=90)=>{const F=(px,py)=>{let s=0;for(const b of L){if(!(b[2]>0))continue;const dx=px-b[0],dy=py-b[1];s+=b[2]*b[2]/(dx*dx+dy*dy+.01)}return s},o=[],st=Math.max(.5,rm/42);for(let i=0;i<n;i++){const a=i/n*M.TAU,ca=Math.cos(a),sa=Math.sin(a);let r=st;while(r<rm&&F(x+ca*r,y+sa*r)>=1)r+=st;let lo=r-st,hi=r;for(let k=0;k<6;k++){const m=(lo+hi)/2;if(F(x+ca*m,y+sa*m)>=1)lo=m;else hi=m}o.push([x+ca*lo,y+sa*lo])}return o};",uo="const TEAR=(c,x,y,r,s=1)=>{const h=y-r*(1+1.4*s);c.moveTo(x,h);c.bezierCurveTo(x+r*.3,y-r*(.55+.7*s),x+r,y-r*.6,x+r,y);c.arc(x,y,r,0,Math.PI);c.bezierCurveTo(x-r,y-r*.6,x-r*.3,y-r*(.55+.7*s),x,h);c.closePath()};const DRIP=(c,x,y,w,L)=>{c.beginPath();if(!(L>0)||!(w>0))return;const b=w*.62*M.clamp(L/(w*1.4),.6,1),e=y+L-b*1.6;c.moveTo(x-w*.75,y-w*.9);c.quadraticCurveTo(x-w*.42,y-w*.3,x-w*.42,y+w*.6);if(e>y+w*.6)c.lineTo(x-w*.38,e);c.quadraticCurveTo(x-w*.38,y+L-b*.9,x-b,y+L);c.arc(x,y+L,b,Math.PI,0,true);c.quadraticCurveTo(x+w*.38,y+L-b*.9,x+w*.38,Math.max(e,y+w*.6));c.lineTo(x+w*.42,y+w*.6);c.quadraticCurveTo(x+w*.42,y-w*.3,x+w*.75,y-w*.9);c.closePath()};",Ul="const BUB=(c,x,y,r,f1,f2,a=1,sx=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x,y);c.scale(sx,1/sx);const g=c.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(f2,.04));g.addColorStop(.72,M.rgba(f2,.12));g.addColorStop(.93,M.rgba(f1,.42));g.addColorStop(1,'rgba(255,255,255,.6)');c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();const rg=c.createLinearGradient(-r,-r,r,r);rg.addColorStop(0,M.rgba(f1,.85));rg.addColorStop(.5,M.rgba(MI,.6));rg.addColorStop(1,M.rgba(f2,.85));c.strokeStyle=rg;c.lineWidth=Math.max(.8,r*.035);c.stroke();c.lineCap='round';c.strokeStyle='rgba(255,255,255,.75)';c.lineWidth=r*.09;c.beginPath();c.arc(0,0,r*.74,Math.PI*1.08,Math.PI*1.42);c.stroke();c.strokeStyle='rgba(255,255,255,.3)';c.lineWidth=r*.05;c.beginPath();c.arc(0,0,r*.8,Math.PI*.15,Math.PI*.4);c.stroke();c.fillStyle='rgba(255,255,255,.9)';c.beginPath();c.arc(-r*.36,-r*.5,r*.07,0,M.TAU);c.fill();c.restore()};",bo="const POOL=(c,B,Y,top,c1,c2,k=1)=>{const W=B.W,H=B.H;c.beginPath();c.moveTo(-5,H+5);for(let i=0;i<=64;i++){const x=i/64*W;c.lineTo(x,Y(x))}c.lineTo(W+5,H+5);c.closePath();const g=c.createLinearGradient(0,top-B.u*.04,0,H);g.addColorStop(0,M.mix(c1,WH,.3*k));g.addColorStop(.22,c1);g.addColorStop(1,c2);c.fillStyle=g;c.fill();if(!(k>0))return;c.save();c.beginPath();for(let i=0;i<=64;i++){const x=i/64*W;c[i?'lineTo':'moveTo'](x,Y(x)+B.u*.004)}c.lineCap='round';c.strokeStyle=M.rgba(WH,.5*k);c.lineWidth=B.u*.004;c.stroke();c.globalAlpha=.12*k;c.lineWidth=B.u*.03;c.translate(0,B.u*.02);c.stroke();c.restore()};",On="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:S.x1-w/2,y=P.includes('top')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Ve="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.46",Kl=[he("fluid-blob-morph","Khối lỏng biến hình",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7291
+ ${fe}${Il}
7292
7292
  // A large glossy pink-to-lilac gel blob breathes and morphs between organic shapes while four small droplets orbit and merge into it through soft metaball necks, then it swells until the frame is flat next (fields: bg, next, fg, fg2).
7293
7293
  ${Ve}
7294
7294
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.62))),R=u*(B.S.port?.2:.18)*pop*(1+.035*Math.sin(t*2.4)),L=[[cx,cy,R]],Rm=RM(B,cx,cy),fg=QM(B,K.fg),f2=QM(B,K.f2)
@@ -7300,7 +7300,7 @@
7300
7300
  GEL(ctx,P,cx,cy,M.lerp(R*1.15,Rm,q),fg,f2,1-q)
7301
7301
  FIN(ctx,B)
7302
7302
  }`),he("fluid-drop-splash","Giọt nước rơi",3.4,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7303
- ${fe}${go}${uo}
7303
+ ${fe}${uo}${bo}
7304
7304
  // A single glossy drop falls in slow motion onto a liquid surface, throws up a crown splash with flying droplets, a central jet and spreading rings, then the surface rises until the frame is flat next (fields: bg, next, fg, fg2).
7305
7305
  ${Ve}
7306
7306
  const ti=1.15,tau=t-ti,fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q,lv0=M.lerp(H*1.03,H*(B.S.port?.64:.66),M.ease.outCubic(M.range(t,0,.55))),lv=M.lerp(lv0,-u*.28,q)
@@ -7333,7 +7333,7 @@
7333
7333
  ctx.fillStyle=M.rgba(WH,.55*kk);for(let i=0;i<7;i++){const x=(R()*W+t*u*.05*dir+W*2)%W,y=Y(x)+u*(.012+.05*R());ctx.beginPath();ctx.arc(x,y,u*(.002+.004*R()),0,M.TAU);ctx.fill()}}}
7334
7334
  FIN(ctx,B)
7335
7335
  }`),he("fluid-lava-lamp","Đèn dung nham",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a"},`function render(ctx,t,env){
7336
- ${fe}${po}
7336
+ ${fe}${go}
7337
7337
  // Lava lamp: warm peach-to-pink wax blobs rise, sink, stretch apart and merge with gooey necks over a warm glow, a blob splits off the bottom pool, then they all gather into one that fills the frame with next (fields: bg, next, fg, fg2).
7338
7338
  ${Ve}
7339
7339
  const R=M.rand(41),L=[],Rm=RM(B,cx,cy),Q=(x,y,r)=>L.push([M.lerp(x,cx,q),M.lerp(y,cy,q),M.lerp(r,Rm*1.04,q)])
@@ -7360,7 +7360,7 @@
7360
7360
  if(q>0){const rr=Rm*2.1*q,P=PTS(cx,cy,an=>rr*(1+.22*(M.noise(Math.cos(an)*1.4+5,Math.sin(an)*1.4+t*.4)-.5)*2),64),g=ctx.createRadialGradient(cx,cy,0,cx,cy,rr);g.addColorStop(0,K.nx);g.addColorStop(.6,K.nx);g.addColorStop(.74,M.mix(K.nx,K.f2,.45));g.addColorStop(.86,M.rgba(K.fg,.4));g.addColorStop(1,M.rgba(K.fg,0));ctx.fillStyle=g;ctx.beginPath();SM(ctx,P);ctx.fill()}
7361
7361
  FIN(ctx,B)
7362
7362
  }`),he("fluid-bubbles","Bong bóng",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7363
- ${fe}${Nl}
7363
+ ${fe}${Ul}
7364
7364
  // Glossy soap bubbles of many sizes rise with a gentle wobble, iridescent rims and white highlights, while one big bubble floats up to the centre and expands until the frame is flat next (fields: bg, next, fg, fg2).
7365
7365
  ${Ve}
7366
7366
  const R=M.rand(17),Rm=RM(B,cx,cy)
@@ -7372,7 +7372,7 @@
7372
7372
  BUB(ctx,bx,by,R2,K.fg,K.f2,1-q,1+.05*Math.sin(t*3.4)*(1-q))
7373
7373
  FIN(ctx,B)
7374
7374
  }`),he("fluid-pour","Dòng chảy rót",3.4,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a"},`function render(ctx,t,env){
7375
- ${fe}${uo}
7375
+ ${fe}${bo}
7376
7376
  // A glossy ribbon of pink-to-peach liquid pours from the top in a soft curve into a pool, splashing droplets and ripples where it lands while the pool level rises, then the pour widens and the pool floods the frame with next (fields: bg, next, fg, fg2).
7377
7377
  ${Ve}
7378
7378
  const R=M.rand(9),fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q,hd=M.ease.inQuad(M.range(t,0,.55)),lvl=M.lerp(H*1.02,H*(B.S.port?.64:.58),M.ease.inOutQuad(M.range(t,.35,T1))),lv=M.lerp(lvl,-u*.28,q),wd=u*(.045+.008*Math.sin(t*3))*(1+q*14),yh=M.lerp(-u*.05,lv+u*.02,hd)
@@ -7401,7 +7401,7 @@
7401
7401
  if(q>0){const rr=M.lerp(sr,Rm*1.25,q),P=PTS(sx,sy,a=>rr*WB(t*2,3,.1*(1-q))(a),72);const bg=ctx.createRadialGradient(sx-rr*.3,sy-rr*.35,0,sx,sy,rr);bg.addColorStop(0,M.mix(K.nx,WH,.3*(1-q)));bg.addColorStop(.5,M.mix(K.nx,K.fg,.25*(1-q)));bg.addColorStop(1,K.nx);ctx.save();ctx.beginPath();SM(ctx,P);ctx.fillStyle=bg;ctx.shadowColor=M.rgba(WH,.6*(1-q));ctx.shadowBlur=u*.05;ctx.fill();ctx.restore();ctx.save();ctx.strokeStyle=M.rgba(WH,.5*(1-q));ctx.lineWidth=u*.004;ctx.stroke();ctx.restore()}
7402
7402
  FIN(ctx,B)
7403
7403
  }`),he("fluid-melt-word","Chữ tan chảy",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a",text:"flow"},`function render(ctx,t,env){
7404
- ${fe}${go}${uo}
7404
+ ${fe}${uo}${bo}
7405
7405
  // Melting word: the title (text, one or two lines) in a heavy rounded font with a glossy pink-to-peach gel fill pops in, sags and melts, drips run from the bottoms of its letters and fall into a rising pool, then the pool floods the frame with next (fields: text, bg, next, fg, fg2).
7406
7406
  ${Ve}
7407
7407
  const sk=M.skin(env,B.p),s=String(B.p.text||''),fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q,R=M.rand(7),ap=Math.max(0,M.ease.outBack(M.range(t,0,.55))),mt=M.ease.inOutQuad(M.range(t,.5,T1))
@@ -7432,7 +7432,7 @@
7432
7432
  if(q>0){const rr=Rm*1.22*q,P=PTS(cx,cy,a=>rr*WB(t*3,1,.12*(1-q))(a+tw*.2),72);ctx.beginPath();SM(ctx,P);ctx.fillStyle=K.nx;ctx.fill();ctx.save();ctx.strokeStyle=M.rgba(WH,.35*(1-q));ctx.lineWidth=u*.004;ctx.stroke();ctx.restore()}
7433
7433
  FIN(ctx,B)
7434
7434
  }`),he("fluid-droplet-grid","Lưới giọt nước",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7435
- ${fe}${po}
7435
+ ${fe}${go}
7436
7436
  // A grid of glossy gel droplets pops in from the centre, wobbles, then merges neighbour by neighbour through liquid necks into one rippling sheet, and the sheet fills the frame with next (fields: bg, next, fg, fg2).
7437
7437
  ${Ve}
7438
7438
  const s=u*(B.S.port?.17:.16),nx=Math.ceil(W/s/2)+1,ny=Math.ceil(H/s/2)+1,L=[],Rm=RM(B,cx,cy),fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q
@@ -7477,7 +7477,7 @@
7477
7477
  ctx.shadowColor=M.rgba(fg,.85);ctx.shadowBlur=f.size*.55;ctx.fillText(l,0,0);ctx.shadowColor=M.rgba(IK,.6);ctx.shadowBlur=f.size*.12;ctx.shadowOffsetY=f.size*.03;ctx.fillText(l,0,0);ctx.restore()})
7478
7478
  ctx.restore()
7479
7479
  }`),he("fluid-blob-el","Khối lỏng nhỏ",4,{position:"top-right",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7480
- ${fe}${po}${qn}
7480
+ ${fe}${go}${On}
7481
7481
  // Element: a small glossy gradient gel blob that breathes and morphs in a corner (position: top-right, top-left, bottom-left, bottom-right) while a tiny droplet orbits, pulls away and rejoins it; loops over any duration; transparent elsewhere (fields: position, fg, fg2).
7482
7482
  const {duration:D,params:p}=env,k=M.io(t,D,.5,.45),u=Math.min(env.width,env.height),r0=u*.05,o=SPOT(env,p.position,'top-right',r0*4.6,r0*4.6),fg=PC(p.fg,PK),f2=PC(p.fg2,LI)
7483
7483
  if(!(k.v>0))return
@@ -7485,7 +7485,7 @@
7485
7485
  ctx.save();ctx.globalAlpha=k.v;ctx.beginPath();BR(ctx,[x,y,ra],[sx,sy,rs],.5);ctx.moveTo(sx+rs,sy);ctx.arc(sx,sy,rs,0,M.TAU);ctx.fillStyle=LG(ctx,x,y,r,fg,f2);ctx.fill()
7486
7486
  GEL(ctx,PTS(x,y,an=>r*wb(an),56),x,y,r,fg,f2,1);HL(ctx,sx,sy,rs,1);ctx.restore()
7487
7487
  }`),he("fluid-drip-el","Giọt nhỏ rơi",3,{position:"top-left",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7488
- ${fe}${go}${qn}
7488
+ ${fe}${uo}${On}
7489
7489
  // Element: a small glossy drip swells at the top edge in a corner, falls and lands with a splash ring and tiny droplets, again and again (position: top-left, top-right, bottom-left, bottom-right); transparent elsewhere (fields: position, fg, fg2).
7490
7490
  const {width:W,height:H,duration:D,params:p}=env,k=M.io(t,D,.3,.35),u=Math.min(W,H),r=u*.028,o=SPOT(env,p.position,'top-left',u*.14,u*.26),fg=PC(p.fg,PK),f2=PC(p.fg2,LI),top=o.P.includes('top'),y0=top?0:o.y-u*.12,yl=o.y+u*.08,x=o.x
7491
7491
  if(!(k.v>0))return
@@ -7496,8 +7496,8 @@
7496
7496
  else{const f=(ph-.74)/.26,rx=r*(1+5*M.ease.outCubic(f));ctx.strokeStyle=M.rgba(fg,.75*(1-f));ctx.lineWidth=Math.max(1,u*.003);ctx.beginPath();ctx.ellipse(x,yl,rx,rx*.28,0,0,M.TAU);ctx.stroke();ctx.strokeStyle=M.rgba(WH,.5*(1-f));ctx.beginPath();ctx.ellipse(x,yl,rx*.6,rx*.17,0,0,M.TAU);ctx.stroke()
7497
7497
  for(let j=0;j<3;j++){ctx.beginPath();ctx.arc(x+(j-1)*r*2.6*f,yl-r*3*Math.sin(Math.PI*f)*(j===1?1.4:1),r*.28*(1-f*.5),0,M.TAU);ctx.fill()}}
7498
7498
  ctx.restore()
7499
- }`)],Gn=Y.find(t=>t.id==="promo"),pe=(t,e,c,o,n)=>({id:t,name:e,category:Gn.name,pack:"promo",duration:c,params:{accent:Gn.accent,position:"center",...o,style:"promo"},code:n}),Fa="const BK='#05050b',VI='#8a5cff',BL='#3d6bff',CY='#2fe0ff',MG='#ff4fd8',OR='#ff9a3c',WW='#fff3e2';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,BK),nx:PC(p.next,BK),fg:PC(p.fg,VI),f2:PC(p.fg2,CY)});const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GRD=(c,x0,y0,x1,y1,cs)=>{const g=c.createLinearGradient(x0,y0,x1,y1);cs.forEach((col,i)=>g.addColorStop(i/(cs.length-1),col));return g},RG=(c,x,y,w,h,an,cs)=>GRD(c,x+w/2-Math.cos(an)*w/2,y+h/2-Math.sin(an)*h/2,x+w/2+Math.cos(an)*w/2,y+h/2+Math.sin(an)*h/2,cs);",$e=Fa+"const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.45,D-.04)),sk:M.skin(env,p),s:String(p.text==null?'':p.text).trim()}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const DUST=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,y=R()*B.H,tw=.5+.5*Math.sin(t*(1.5+R()*2)+R()*9),r=B.u*(.001+.0016*R());if(tw*a>.05){c.save();c.globalAlpha=Math.min(1,tw*a*.8);c.fillStyle=[WW,CY,VI,MG][i%4];c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()}}};const RCV=(c,B,x,y,w,h,r,k,col,lc)=>{if(!(k>0))return;const Q=B.u*.08,X=M.lerp(x,-Q,k),Y=M.lerp(y,-Q,k),X2=M.lerp(x+w,B.W+Q,k),Y2=M.lerp(y+h,B.H+Q,k);GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.8,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);const m=M.range(k,.45,.95),g=c.createLinearGradient(X,Y,X2,Y2);[lc||col,col,M.mix(col,'#8a5cff',.7),M.mix(col,'#05050b',.5)].forEach((v,i)=>g.addColorStop(i/3,M.mix(v,B.K.nx,m)));c.fillStyle=g;c.shadowColor=col;c.shadowBlur=B.u*.08*(1-k);M.rr(c,X,Y,X2-X,Y2-Y,r*(1-k));c.fill();c.restore();GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.6,'#ffffff',.9*(1-k))};const TX=(c,B,s,x,y,sz,mw,n,a=1,gc=VI,al='center',wt='600')=>{if(!s||!(a>0))return null;const f=M.fit(c,s,z=>B.sk.font(z,'h',wt),sz,mw,n,.35),lh=f.size*1.28,L=f.lines.length;c.save();c.font=f.font;c.textAlign=al;c.textBaseline='middle';c.globalAlpha=Math.min(1,a);c.fillStyle='#ffffff';f.lines.forEach((l,i)=>{const yy=y+(i-(L-1)/2)*lh;c.shadowColor=gc;c.shadowBlur=f.size*.5;c.fillText(l,x,yy);c.shadowBlur=f.size*.12;c.fillText(l,x,yy)});c.restore();return f};",fa="const STAR=(c,x,y,s,col,a=1,r=0)=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*.8,col,k);c.save();c.globalCompositeOperation='lighter';c.translate(x,y);c.rotate(r);for(let i=0;i<2;i++){const L=s*(i?.62:1);c.save();c.rotate(i*Math.PI/2);c.scale(1,.04);const g=c.createRadialGradient(0,0,0,0,0,L);g.addColorStop(0,M.rgba('#ffffff',k));g.addColorStop(.22,M.rgba(col,.7*k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.beginPath();c.arc(0,0,L,0,M.TAU);c.fill();c.restore()}c.globalAlpha=k;c.fillStyle='#ffffff';c.shadowColor=col;c.shadowBlur=s*.1;c.beginPath();for(let i=0;i<8;i++){const d=i%2?s*.03:s*.17,an=i*Math.PI/4;c.lineTo(Math.cos(an)*d,Math.sin(an)*d)}c.closePath();c.fill();c.restore()};",On="const CC=(c,B,x,y,k,r0,col,lc)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k;GL(c,x,y,R+B.u*.3,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);c.fillStyle=lc?M.mix(lc,B.K.nx,M.range(k,.5,.95)):B.K.nx;c.shadowColor=col;c.shadowBlur=B.u*.1*(1-k);c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();c.restore();GL(c,x,y,R*1.1,'#ffffff',.9*(1-k))};",Ya="const CARD=(c,x,y,w,h,r,cs,an,a=1)=>{if(!(w>1)||!(h>1)||!(a>0))return;const m=Math.min(w,h),lw=Math.max(1.5,m*.014);c.save();c.globalAlpha=Math.min(1,a);M.rr(c,x,y,w,h,r);const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'rgba(30,26,54,.93)');g.addColorStop(1,'rgba(7,7,15,.95)');c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=m*.22;c.fill();c.shadowBlur=lw*6;c.lineWidth=lw;c.strokeStyle=RG(c,x,y,w,h,an,cs);c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.lineWidth=lw*.4;c.strokeStyle='rgba(255,255,255,.45)';c.stroke();const s=c.createLinearGradient(0,y,0,y+h*.45);s.addColorStop(0,'rgba(255,255,255,.13)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.restore()};",Aa="const GN={spark:'sparkle',image:'mountain',eye:'eye',search:'search',music:'music',heart:'heart',chat:'chat',wave:'pulse',flower:'lotus',star:'star',play:'play'};const ICON=(c,x,y,s,gl,ca,cb,a=1,bl=0,rot=0)=>{if(!(s>1)||!(a>0))return;const k=Math.min(1,a),h=s/2,r=s*.26,lw=Math.max(1.2,s*.028);GL(c,x,y,s*1.25,ca,.5*k);c.save();c.translate(x,y);c.rotate(rot);c.globalAlpha=k;if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';M.rr(c,-h,-h,s,s,r);const g=c.createLinearGradient(0,-h,0,h);g.addColorStop(0,'rgba(46,40,78,.96)');g.addColorStop(1,'rgba(9,9,19,.97)');c.fillStyle=g;c.fill();const ig=c.createRadialGradient(0,h*.7,0,0,h*.7,s*.85);ig.addColorStop(0,M.rgba(cb,.5));ig.addColorStop(1,M.rgba(cb,0));c.fillStyle=ig;c.fill();c.lineWidth=lw;c.strokeStyle=GRD(c,-h,-h,h,h,[M.mix(ca,'#ffffff',.55),ca,cb]);c.shadowColor=ca;c.shadowBlur=lw*5;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';const sg=c.createLinearGradient(0,-h,0,0);sg.addColorStop(0,'rgba(255,255,255,.24)');sg.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=sg;M.rr(c,-h+lw,-h+lw,s-lw*2,h*.9,r*.85);c.fill();c.globalCompositeOperation='source-over';if(gl)GL(c,0,0,s*.42,ca,.7);if(gl==='diamond'){c.save();c.scale(s*.5,s*.5);c.beginPath();c.moveTo(-.5,-.12);c.lineTo(-.26,-.42);c.lineTo(.26,-.42);c.lineTo(.5,-.12);c.lineTo(0,.46);c.closePath();c.moveTo(-.5,-.12);c.lineTo(.5,-.12);c.lineWidth=.07;c.lineJoin='round';c.strokeStyle=M.mix(ca,'#ffffff',.35);c.shadowColor=ca;c.shadowBlur=s*.12;c.stroke();c.restore()}else if(gl)M.glyph(c,GN[gl]||gl,0,0,s*.52,{color:M.mix(ca,'#ffffff',.3),width:2.2});c.restore()};",Nn="const MARK=(c,x,y,s,a=1,rot=0,cs=[OR,MG,VI])=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*2.6,cs[0],.6*k);c.save();c.translate(x,y);c.rotate(rot);for(let i=0;i<3;i++){c.save();c.rotate(i*M.TAU/3);const g=c.createLinearGradient(0,-s*.96,0,s*.12);g.addColorStop(0,M.mix(cs[0],'#ffffff',.5));g.addColorStop(.35,cs[0]);g.addColorStop(.75,cs[1]);g.addColorStop(1,cs[2]);c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=s*.25;c.globalAlpha=k*.92;c.globalCompositeOperation=i?'screen':'source-over';c.beginPath();c.ellipse(0,-s*.4,s*.25,s*.55,0,0,M.TAU);c.fill();c.shadowBlur=0;c.globalCompositeOperation='source-over';c.globalAlpha=k*.7;c.strokeStyle='#ffffff';c.lineWidth=s*.03;c.lineCap='round';c.beginPath();c.ellipse(0,-s*.4,s*.19,s*.47,0,Math.PI*1.1,Math.PI*1.45);c.stroke();c.restore()}c.restore();GL(c,x,y,s*.5,WW,.35*k)};",In="const ARW=(c,x,y,a,col,al=1)=>{if(!(a>0)||!(al>0))return;GL(c,x,y,a*3,col,al);c.save();c.globalAlpha=Math.min(1,al);c.beginPath();c.moveTo(x,y-a);c.lineTo(x+a*.62,y+a*.55);c.lineTo(x,y+a*.2);c.lineTo(x-a*.62,y+a*.55);c.closePath();const g=c.createLinearGradient(x,y-a,x,y+a*.55);g.addColorStop(0,'#ffffff');g.addColorStop(.5,M.mix(col,'#ffffff',.4));g.addColorStop(1,col);c.fillStyle=g;c.shadowColor=col;c.shadowBlur=a*.6;c.fill();c.shadowBlur=0;c.lineJoin='round';c.strokeStyle='rgba(255,255,255,.8)';c.lineWidth=Math.max(1,a*.04);c.stroke();c.restore()};",Un="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Xe="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q,S,s}=B,P=S.port",Ul=[pe("promo-logo-spark","Logo loé sáng",2.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff9a3c",text:"Logo"},`function render(ctx,t,env){
7500
- ${$e}${On}${fa}${Nn}
7499
+ }`)],Nn=Y.find(t=>t.id==="promo"),pe=(t,e,c,o,n)=>({id:t,name:e,category:Nn.name,pack:"promo",duration:c,params:{accent:Nn.accent,position:"center",...o,style:"promo"},code:n}),Fa="const BK='#05050b',VI='#8a5cff',BL='#3d6bff',CY='#2fe0ff',MG='#ff4fd8',OR='#ff9a3c',WW='#fff3e2';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,BK),nx:PC(p.next,BK),fg:PC(p.fg,VI),f2:PC(p.fg2,CY)});const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GRD=(c,x0,y0,x1,y1,cs)=>{const g=c.createLinearGradient(x0,y0,x1,y1);cs.forEach((col,i)=>g.addColorStop(i/(cs.length-1),col));return g},RG=(c,x,y,w,h,an,cs)=>GRD(c,x+w/2-Math.cos(an)*w/2,y+h/2-Math.sin(an)*h/2,x+w/2+Math.cos(an)*w/2,y+h/2+Math.sin(an)*h/2,cs);",$e=Fa+"const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.45,D-.04)),sk:M.skin(env,p),s:String(p.text==null?'':p.text).trim()}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const DUST=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,y=R()*B.H,tw=.5+.5*Math.sin(t*(1.5+R()*2)+R()*9),r=B.u*(.001+.0016*R());if(tw*a>.05){c.save();c.globalAlpha=Math.min(1,tw*a*.8);c.fillStyle=[WW,CY,VI,MG][i%4];c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()}}};const RCV=(c,B,x,y,w,h,r,k,col,lc)=>{if(!(k>0))return;const Q=B.u*.08,X=M.lerp(x,-Q,k),Y=M.lerp(y,-Q,k),X2=M.lerp(x+w,B.W+Q,k),Y2=M.lerp(y+h,B.H+Q,k);GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.8,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);const m=M.range(k,.45,.95),g=c.createLinearGradient(X,Y,X2,Y2);[lc||col,col,M.mix(col,'#8a5cff',.7),M.mix(col,'#05050b',.5)].forEach((v,i)=>g.addColorStop(i/3,M.mix(v,B.K.nx,m)));c.fillStyle=g;c.shadowColor=col;c.shadowBlur=B.u*.08*(1-k);M.rr(c,X,Y,X2-X,Y2-Y,r*(1-k));c.fill();c.restore();GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.6,'#ffffff',.9*(1-k))};const TX=(c,B,s,x,y,sz,mw,n,a=1,gc=VI,al='center',wt='600')=>{if(!s||!(a>0))return null;const f=M.fit(c,s,z=>B.sk.font(z,'h',wt),sz,mw,n,.35),lh=f.size*1.28,L=f.lines.length;c.save();c.font=f.font;c.textAlign=al;c.textBaseline='middle';c.globalAlpha=Math.min(1,a);c.fillStyle='#ffffff';f.lines.forEach((l,i)=>{const yy=y+(i-(L-1)/2)*lh;c.shadowColor=gc;c.shadowBlur=f.size*.5;c.fillText(l,x,yy);c.shadowBlur=f.size*.12;c.fillText(l,x,yy)});c.restore();return f};",fa="const STAR=(c,x,y,s,col,a=1,r=0)=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*.8,col,k);c.save();c.globalCompositeOperation='lighter';c.translate(x,y);c.rotate(r);for(let i=0;i<2;i++){const L=s*(i?.62:1);c.save();c.rotate(i*Math.PI/2);c.scale(1,.04);const g=c.createRadialGradient(0,0,0,0,0,L);g.addColorStop(0,M.rgba('#ffffff',k));g.addColorStop(.22,M.rgba(col,.7*k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.beginPath();c.arc(0,0,L,0,M.TAU);c.fill();c.restore()}c.globalAlpha=k;c.fillStyle='#ffffff';c.shadowColor=col;c.shadowBlur=s*.1;c.beginPath();for(let i=0;i<8;i++){const d=i%2?s*.03:s*.17,an=i*Math.PI/4;c.lineTo(Math.cos(an)*d,Math.sin(an)*d)}c.closePath();c.fill();c.restore()};",In="const CC=(c,B,x,y,k,r0,col,lc)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k;GL(c,x,y,R+B.u*.3,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);c.fillStyle=lc?M.mix(lc,B.K.nx,M.range(k,.5,.95)):B.K.nx;c.shadowColor=col;c.shadowBlur=B.u*.1*(1-k);c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();c.restore();GL(c,x,y,R*1.1,'#ffffff',.9*(1-k))};",Ya="const CARD=(c,x,y,w,h,r,cs,an,a=1)=>{if(!(w>1)||!(h>1)||!(a>0))return;const m=Math.min(w,h),lw=Math.max(1.5,m*.014);c.save();c.globalAlpha=Math.min(1,a);M.rr(c,x,y,w,h,r);const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'rgba(30,26,54,.93)');g.addColorStop(1,'rgba(7,7,15,.95)');c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=m*.22;c.fill();c.shadowBlur=lw*6;c.lineWidth=lw;c.strokeStyle=RG(c,x,y,w,h,an,cs);c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.lineWidth=lw*.4;c.strokeStyle='rgba(255,255,255,.45)';c.stroke();const s=c.createLinearGradient(0,y,0,y+h*.45);s.addColorStop(0,'rgba(255,255,255,.13)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.restore()};",Aa="const GN={spark:'sparkle',image:'mountain',eye:'eye',search:'search',music:'music',heart:'heart',chat:'chat',wave:'pulse',flower:'lotus',star:'star',play:'play'};const ICON=(c,x,y,s,gl,ca,cb,a=1,bl=0,rot=0)=>{if(!(s>1)||!(a>0))return;const k=Math.min(1,a),h=s/2,r=s*.26,lw=Math.max(1.2,s*.028);GL(c,x,y,s*1.25,ca,.5*k);c.save();c.translate(x,y);c.rotate(rot);c.globalAlpha=k;if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';M.rr(c,-h,-h,s,s,r);const g=c.createLinearGradient(0,-h,0,h);g.addColorStop(0,'rgba(46,40,78,.96)');g.addColorStop(1,'rgba(9,9,19,.97)');c.fillStyle=g;c.fill();const ig=c.createRadialGradient(0,h*.7,0,0,h*.7,s*.85);ig.addColorStop(0,M.rgba(cb,.5));ig.addColorStop(1,M.rgba(cb,0));c.fillStyle=ig;c.fill();c.lineWidth=lw;c.strokeStyle=GRD(c,-h,-h,h,h,[M.mix(ca,'#ffffff',.55),ca,cb]);c.shadowColor=ca;c.shadowBlur=lw*5;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';const sg=c.createLinearGradient(0,-h,0,0);sg.addColorStop(0,'rgba(255,255,255,.24)');sg.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=sg;M.rr(c,-h+lw,-h+lw,s-lw*2,h*.9,r*.85);c.fill();c.globalCompositeOperation='source-over';if(gl)GL(c,0,0,s*.42,ca,.7);if(gl==='diamond'){c.save();c.scale(s*.5,s*.5);c.beginPath();c.moveTo(-.5,-.12);c.lineTo(-.26,-.42);c.lineTo(.26,-.42);c.lineTo(.5,-.12);c.lineTo(0,.46);c.closePath();c.moveTo(-.5,-.12);c.lineTo(.5,-.12);c.lineWidth=.07;c.lineJoin='round';c.strokeStyle=M.mix(ca,'#ffffff',.35);c.shadowColor=ca;c.shadowBlur=s*.12;c.stroke();c.restore()}else if(gl)M.glyph(c,GN[gl]||gl,0,0,s*.52,{color:M.mix(ca,'#ffffff',.3),width:2.2});c.restore()};",Un="const MARK=(c,x,y,s,a=1,rot=0,cs=[OR,MG,VI])=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*2.6,cs[0],.6*k);c.save();c.translate(x,y);c.rotate(rot);for(let i=0;i<3;i++){c.save();c.rotate(i*M.TAU/3);const g=c.createLinearGradient(0,-s*.96,0,s*.12);g.addColorStop(0,M.mix(cs[0],'#ffffff',.5));g.addColorStop(.35,cs[0]);g.addColorStop(.75,cs[1]);g.addColorStop(1,cs[2]);c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=s*.25;c.globalAlpha=k*.92;c.globalCompositeOperation=i?'screen':'source-over';c.beginPath();c.ellipse(0,-s*.4,s*.25,s*.55,0,0,M.TAU);c.fill();c.shadowBlur=0;c.globalCompositeOperation='source-over';c.globalAlpha=k*.7;c.strokeStyle='#ffffff';c.lineWidth=s*.03;c.lineCap='round';c.beginPath();c.ellipse(0,-s*.4,s*.19,s*.47,0,Math.PI*1.1,Math.PI*1.45);c.stroke();c.restore()}c.restore();GL(c,x,y,s*.5,WW,.35*k)};",Kn="const ARW=(c,x,y,a,col,al=1)=>{if(!(a>0)||!(al>0))return;GL(c,x,y,a*3,col,al);c.save();c.globalAlpha=Math.min(1,al);c.beginPath();c.moveTo(x,y-a);c.lineTo(x+a*.62,y+a*.55);c.lineTo(x,y+a*.2);c.lineTo(x-a*.62,y+a*.55);c.closePath();const g=c.createLinearGradient(x,y-a,x,y+a*.55);g.addColorStop(0,'#ffffff');g.addColorStop(.5,M.mix(col,'#ffffff',.4));g.addColorStop(1,col);c.fillStyle=g;c.shadowColor=col;c.shadowBlur=a*.6;c.fill();c.shadowBlur=0;c.lineJoin='round';c.strokeStyle='rgba(255,255,255,.8)';c.lineWidth=Math.max(1,a*.04);c.stroke();c.restore()};",jn="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Xe="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q,S,s}=B,P=S.port",jl=[pe("promo-logo-spark","Logo loé sáng",2.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff9a3c",text:"Logo"},`function render(ctx,t,env){
7500
+ ${$e}${In}${fa}${Un}
7501
7501
  // Logo spark: a tiny white star spark flashes in the dark, a glossy three-petal logo mark blooms out of it with a warm orange glow and a faint violet halo ring, the wordmark (text, optional) slides out beside it, then the mark swells into warm light that fills the frame with next (fields: text, bg, next, fg, fg2).
7502
7502
  ${Xe}
7503
7503
  const sp=M.range(t,0,.55),pk=Math.sin(Math.PI*sp),pop=Math.max(0,M.ease.outBack(M.range(t,.12,.7))),wm=s?M.ease.outCubic(M.range(t,.5,1.15)):0,br=Math.sin(t*2.6),m0=u*(P?.08:.075),ms=m0*pop*(1+.03*br)*(1+1.6*q),sz=u*(P?.1:.11),mw=S.w-m0*3.4
@@ -7619,7 +7619,7 @@
7619
7619
  RCV(ctx,B,cx-Z/2,cy-Z/2,Z,Z,Z*.26,q,K.fg,M.mix(K.f2,'#ffffff',.4))
7620
7620
  FIN(ctx,B)
7621
7621
  }`),pe("promo-arrow-launch","Mũi tên phóng lên",2.8,{bg:"#05050b",next:"#05050b",fg:"#2fe0ff",fg2:"#8a5cff"},`function render(ctx,t,env){
7622
- ${$e}${fa}${In}
7622
+ ${$e}${fa}${Kn}
7623
7623
  // Arrow launch: a glowing cyan arrow rises from the bottom like a ship with a long tapered light trail (white, cyan, violet), sparks shedding behind it and a star glint at its nose, then the trail floods sideways until the frame is flat next while the arrow flies off (fields: bg, next, fg, fg2).
7624
7624
  ${Xe}
7625
7625
  const yA=k=>M.lerp(H*1.12,H*(P?.36:.34),M.ease.outCubic(M.range(k,.05,1.4)))+Math.sin(k*2.2)*u*.01,a=u*.085,ay=yA(t)-M.ease.inCubic(q)*H*.7,ax=cx+Math.sin(t*1.3)*u*.01,tl=ay+a*.3,tw0=a*.7,tw1=a*(P?2.2:1.8)
@@ -7635,7 +7635,7 @@
7635
7635
  STAR(ctx,ax,ay-a,u*.16*(.75+.25*Math.sin(t*6)),K.fg,.85*M.range(t,.3,.8)*fa)
7636
7636
  FIN(ctx,B)
7637
7637
  }`),pe("promo-dome-horizon","Chân trời vòm tím",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff4fd8",text:"Keep moving"},`function render(ctx,t,env){
7638
- ${$e}${fa}${In}
7638
+ ${$e}${fa}${Kn}
7639
7639
  // Dome horizon: a huge violet glowing planet dome arcs down from the top with a bright magenta rim and an atmosphere glow beneath it, a lens star flare blooms on its rim, the line (text, optional) fades in under it and a small cyan arrow hovers below, then the dome sinks over the frame until it is flat next (fields: text, bg, next, fg, fg2).
7640
7640
  ${Xe}
7641
7641
  const R=Math.hypot(W,H)*.95,dn=M.ease.outCubic(M.range(t,0,1.4)),yb=M.lerp(-H*.02,H*(P?.36:.42),dn),yc=yb-R
@@ -7692,7 +7692,7 @@
7692
7692
  RCV(ctx,B,cx-bw/2*sc,cy-bh/2*sc,bw*sc,bh*sc,bh/2*sc,q,K.fg,M.mix(K.fg,'#ffffff',.3))
7693
7693
  FIN(ctx,B)
7694
7694
  }`),pe("promo-glass-orbit","Biểu tượng xoay quanh logo",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:""},`function render(ctx,t,env){
7695
- ${$e}${On}${Aa}${Nn}
7695
+ ${$e}${In}${Aa}${Un}
7696
7696
  // Glass orbit: the glossy logo mark glows in the centre while six 3D glass app icons orbit it on a tilted ellipse with true depth order (back icons smaller, dimmer, softly blurred) along a gradient light ring, an optional line (text) under it, then the mark swells into light until the frame is flat next (fields: text, bg, next, fg, fg2).
7697
7697
  ${Xe}
7698
7698
  const rx=P?W*.4:u*.58,ry=rx*.3,tl=-.16,N=6,GS=['spark','music','image','chat','heart','search'],CS=[[K.fg,K.f2],[MG,K.fg],[K.f2,BL],[OR,MG],[BL,K.f2],['#5dffa8',K.f2]],op=M.ease.outCubic(M.range(t,0,.65)),ms=u*.085*Math.max(0,M.ease.outBack(M.range(t,0,.5)))*(1+1.4*q)
@@ -7724,7 +7724,7 @@
7724
7724
  ctx.globalAlpha=a;ctx.filter='blur('+((1-a)*u*.01).toFixed(2)+'px)';ctx.shadowColor=fg;ctx.shadowBlur=f.size*.45;ctx.fillText(l,S.cx,y);ctx.shadowColor=M.mix(fg,'#ffffff',.5);ctx.shadowBlur=f.size*.1;ctx.fillText(l,S.cx,y)})
7725
7725
  ctx.restore()
7726
7726
  }`),pe("promo-glass-icon","Biểu tượng kính nổi",4,{position:"top-right",glyph:"spark",fg:"#8a5cff",fg2:"#2fe0ff"},`function render(ctx,t,env){
7727
- ${Fa}${fa}${Aa}${Un}
7727
+ ${Fa}${fa}${Aa}${jn}
7728
7728
  // Element: one floating 3D glass app icon (dark glass, glowing gradient rim, a glowing glyph: spark, image, eye, search, music, heart, chat, diamond) bobbing and tilting gently with a twinkling star glint on its corner, in a corner or edge (position: top-right, top-left, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: glyph, position, fg, fg2).
7729
7729
  const {duration:D,params:p}=env,k=M.io(t,D,.45,.4),u=Math.min(env.width,env.height),sz=u*.12,o=SPOT(env,p.position,'top-right',sz*1.6,sz*1.6),fg=PC(p.fg,VI),f2=PC(p.fg2,CY),gl=['spark','image','eye','search','music','heart','chat','diamond'].includes(p.glyph)?p.glyph:'spark'
7730
7730
  if(!(k.v>0))return
@@ -7732,15 +7732,15 @@
7732
7732
  ICON(ctx,o.x,y,s,gl,fg,f2,k.v,0,Math.sin(t*1.2)*.08)
7733
7733
  STAR(ctx,o.x+s*.42,y-s*.42,sz*.55*tw,f2,k.v*tw)
7734
7734
  }`),pe("promo-star-flare","Tia sao lấp lánh",3,{position:"top-left",fg:"#3d6bff",fg2:"#8a5cff"},`function render(ctx,t,env){
7735
- ${Fa}${fa}${Un}
7735
+ ${Fa}${fa}${jn}
7736
7736
  // Element: a four-point lens star flare (white core, long thin coloured streaks) twinkling and slowly turning in a corner or edge with a smaller companion glint (position: top-left, top-right, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg, fg2).
7737
7737
  const {duration:D,params:p}=env,k=M.io(t,D,.3,.4),u=Math.min(env.width,env.height),sz=u*.16,o=SPOT(env,p.position,'top-left',sz*1.4,sz),fg=PC(p.fg,BL),f2=PC(p.fg2,VI)
7738
7738
  if(!(k.v>0))return
7739
7739
  const tw=.75+.25*Math.sin(t*3.1)+.08*Math.sin(t*7.3),t2=Math.max(0,Math.sin(t*2.2+1.3))
7740
7740
  STAR(ctx,o.x,o.y,sz*tw*(.5+.5*k.i),fg,k.v,Math.sin(t*.6)*.12)
7741
7741
  STAR(ctx,o.x+sz*.55*(o.P.includes('right')?-1:1),o.y+sz*.35*(o.P.includes('bottom')||o.P==='lower'?-1:1),sz*.35*t2,f2,k.v*t2,.4)
7742
- }`)],Kn=Y.find(t=>t.id==="morph"),ve=(t,e,c,o,n)=>({id:t,name:e,category:Kn.name,pack:"morph",duration:c,params:{accent:Kn.accent,position:"center",...o,style:"morph"},code:n}),Fe=(t,e,c)=>({bg:"#120a06",next:"#120a06",fg:"#ff8a1f",fg2:"#fbf3e6",formIn:t,formOut:e,text:c}),Ye="const BR='#120a06',AM='#ff8a1f',GD='#ffc14d',CR='#fbf3e6',HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,LU=c=>{const h=M.hex(c);return(.2126*h[0]+.7152*h[1]+.0722*h[2])/255};const CL=(K,b)=>{const d=c=>Math.abs(LU(c)-LU(b));return d(K.fg)>=.25||d(K.fg)>=d(K.f2)?K.fg:K.f2};const CK=p=>{const K={bg:PC(p.bg,BR),nx:PC(p.next,BR),fg:PC(p.fg,AM),f2:PC(p.fg2,CR)};K.ci=CL(K,K.bg);K.co=CL(K,K.nx);return K};const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.42*k));g.addColorStop(.4,M.rgba(col,.12*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const FS={dot:[.2,.2,2,1,0],ring:[.46,.46,2,0,.07],line:[.03,.5,4,1,0],square:[.4,.4,5,1,0],diamond:[.48,.48,1,0,.07],star:[.5,.5,.6,1,0],pill:[.5,.2,3,1,0],bar:[.5,.07,4,1,0],cross:0,heart:0},FN=72,FV=f=>Object.keys(FS).includes(f)?f:'dot',FM=f=>FS[f]?FS[f].slice(3):[1,0];const FP=(f,i)=>{const th=i*M.TAU/FN,a=th-Math.PI/2,c=Math.cos(a),s=Math.sin(a),pw=(v,e)=>Math.sign(v)*Math.pow(Math.abs(v),e);if(f==='heart')return[16*Math.pow(Math.sin(th),3)/34,(-13*Math.cos(th)+5*Math.cos(2*th)+2*Math.cos(3*th)+Math.cos(4*th)-2.5)/34];if(f==='cross'){const r=(A,B)=>Math.pow(Math.pow(Math.abs(c)/A,8)+Math.pow(Math.abs(s)/B,8),-.125),R=Math.max(r(.5,.15),r(.15,.5));return[c*R,s*R]}const q=FS[f],e=2/q[2];return[q[0]*pw(c,e),q[1]*pw(s,e)]};const FD=(c,fa,fb,k,x,y,S,r,col,a=1,g=1,sx=1,sy=1,w=1)=>{if(!(S>0)||!(a>0))return;fa=FV(fa);fb=FV(fb);k=M.clamp(k);const ma=FM(fa),mb=FM(fb),fl=M.lerp(ma[0],mb[0],k),sw=M.lerp(ma[1],mb[1],k)*S*w,co=Math.cos(r),si=Math.sin(r),A=Math.min(1,a);GL(c,x,y,S*(1.3+.5*Math.min(4,Math.max(sx,sy))),col,.8*g*A);c.save();c.globalAlpha=A;c.beginPath();for(let i=0;i<FN;i++){const p=FP(fa,i),q=FP(fb,i),u=M.lerp(p[0],q[0],k)*S*sx,v=M.lerp(p[1],q[1],k)*S*sy;c[i?'lineTo':'moveTo'](x+u*co-v*si,y+u*si+v*co)}c.closePath();c.lineJoin='round';c.shadowColor=col;c.shadowBlur=S*.25*g;if(fl>.01){c.fillStyle=M.rgba(col,fl);c.fill()}if(sw>.2){c.strokeStyle=col;c.lineWidth=sw;c.stroke()}c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=A*.5*Math.min(1,g);c.strokeStyle=M.mix(col,'#ffffff',.75);c.lineWidth=Math.max(1,Math.min(S*.018,sw>.2?sw*.4:S));c.stroke();c.restore()};const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p),u=Math.min(W,H),hS=u*.12,fi=FV(p.formIn),fo=FV(p.formOut);if(!(t>0)||t>=D-.04){const e=t>0;c.fillStyle=e?K.nx:K.bg;c.fillRect(0,0,W,H);FD(c,e?fo:fi,e?fo:fi,0,W/2,H/2,hS,0,e?K.co:K.ci);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{env,W,H,D,p,K,S,u,hS,cx:W/2,cy:H/2,fi,fo,ki:M.ease.inOutCubic(M.range(t,0,.55)),ko:M.ease.inOutCubic(M.range(t,D-.65,D-.1))}};const FLIP=(c,B,k,m)=>{if(!(k>0))return;const {W,H,cx,cy}=B;c.save();c.fillStyle=B.K.nx;if(m==='iris'){const r=Math.hypot(W,H)*.52*M.ease.inCubic(k);c.beginPath();c.arc(cx,cy,r,0,M.TAU);c.fill();if(k<1){c.globalAlpha=.6*(1-k);c.strokeStyle=B.K.fg;c.lineWidth=B.u*.006;c.shadowColor=B.K.fg;c.shadowBlur=B.u*.03;c.stroke()}}else if(m==='wipe')c.fillRect(0,0,W*M.ease.inOutCubic(k),H);else if(m==='rise'){const h=H*M.ease.inOutCubic(k);c.fillRect(0,H-h,W,h)}else if(m==='cut'){if(k>=.5)c.fillRect(0,0,W,H)}else{c.globalAlpha=M.ease.inOutQuad(k);c.fillRect(0,0,W,H)}c.restore()};const CM=(a,b,k)=>k<=0?a:k>=1?b:M.mix(a,b,k);const CN=(c,B,mf,x,y,S,r,col,a=1,g=1,sx=1,sy=1,w=1)=>{const m=Array.isArray(mf)?mf:[mf,mf,0],o=B.ko>0,L=(p,q)=>M.lerp(M.lerp(p,q,B.ki),p,B.ko),A=[L(B.cx,x),L(B.cy,y),L(B.hS,S),L(0,r),o?CM(col,B.K.co,B.ko):CM(B.K.ci,col,B.ki),L(1,a),L(1,g),L(1,sx),L(1,sy),L(1,w)];if(o)FD(c,m[1],B.fo,B.ko,...A);else if(m[2]>0)FD(c,m[0],m[1],m[2],...A);else FD(c,B.fi,m[0],B.ki,...A)};const TX=(c,B,s,y,z,a,o={})=>{s=String(s||'');if(!s||!(a>0))return 0;const sk=M.skin(B.env,B.p),f=M.fit(c,s,q=>sk.font(q,'h',o.w||'300'),z,o.mw||B.S.w*.9,o.n||2,.4),lh=f.size*1.3,n=f.lines.length,x=o.x===undefined?B.cx:o.x;c.save();c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.globalAlpha=Math.min(1,a);c.fillStyle=o.col||'#ffffff';c.shadowColor=o.gl||B.K.fg;[.55,.12].forEach(b=>{c.shadowBlur=f.size*b;f.lines.forEach((l,i)=>c.fillText(l,x,y+(i-(n-1)/2)*lh))});c.restore();return n*lh};const AMB=(c,B,a,x,y,col,r)=>{a*=Math.min(1,B.ki*1.5)*(1-B.ko);if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,r||B.u*.9);g.addColorStop(0,M.rgba(col||B.K.fg,.2*Math.min(1,a)));g.addColorStop(1,M.rgba(col||B.K.fg,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};",Lc="const MOTE=(c,B,t,n,sd,a=1,col)=>{if(!(a>0))return;const R=M.rand(sd);c.save();c.globalCompositeOperation='lighter';c.fillStyle=col||GD;for(let i=0;i<n;i++){const x=R()*B.W,s=R(),y=((R()*B.H-t*B.u*(.02+.05*s))%B.H+B.H)%B.H;c.globalAlpha=Math.min(1,a)*(.25+.6*M.noise(i,t*1.3));c.beginPath();c.arc(x,y,B.u*(.0018+.0028*s),0,M.TAU);c.fill()}c.restore()};",bo="const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;GL(c,x,y,r*5,col,a);c.save();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.55);c.shadowColor=col;c.shadowBlur=r*2.5;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};",_e="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,hS,cx,cy,S,ki,ko}=B",jn="const STREAK=(c,B,t,a)=>{if(!(a>0))return;for(let i=0;i<3;i++){const x=B.W*(.2+.32*i)+Math.sin(t*.4+i*2)*B.u*.05,y=B.H*(.25+.25*i),r=B.u*(.5+.12*i);c.save();c.translate(x,y);c.rotate(-.6);c.scale(1,.16);const g=c.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(AM,.22*a));g.addColorStop(1,M.rgba(AM,0));c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();c.restore()}};",Kl=[ve("morph-light-thread","Sợi chỉ ánh sáng",3.2,Fe("dot","ring","Hãy bắt đầu"),`function render(ctx,t,env){
7743
- ${Ye}${Lc}${bo}
7742
+ }`)],Vn=Y.find(t=>t.id==="morph"),ve=(t,e,c,o,n)=>({id:t,name:e,category:Vn.name,pack:"morph",duration:c,params:{accent:Vn.accent,position:"center",...o,style:"morph"},code:n}),Fe=(t,e,c)=>({bg:"#120a06",next:"#120a06",fg:"#ff8a1f",fg2:"#fbf3e6",formIn:t,formOut:e,text:c}),Ye="const BR='#120a06',AM='#ff8a1f',GD='#ffc14d',CR='#fbf3e6',HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,LU=c=>{const h=M.hex(c);return(.2126*h[0]+.7152*h[1]+.0722*h[2])/255};const CL=(K,b)=>{const d=c=>Math.abs(LU(c)-LU(b));return d(K.fg)>=.25||d(K.fg)>=d(K.f2)?K.fg:K.f2};const CK=p=>{const K={bg:PC(p.bg,BR),nx:PC(p.next,BR),fg:PC(p.fg,AM),f2:PC(p.fg2,CR)};K.ci=CL(K,K.bg);K.co=CL(K,K.nx);return K};const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.42*k));g.addColorStop(.4,M.rgba(col,.12*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const FS={dot:[.2,.2,2,1,0],ring:[.46,.46,2,0,.07],line:[.03,.5,4,1,0],square:[.4,.4,5,1,0],diamond:[.48,.48,1,0,.07],star:[.5,.5,.6,1,0],pill:[.5,.2,3,1,0],bar:[.5,.07,4,1,0],cross:0,heart:0},FN=72,FV=f=>Object.keys(FS).includes(f)?f:'dot',FM=f=>FS[f]?FS[f].slice(3):[1,0];const FP=(f,i)=>{const th=i*M.TAU/FN,a=th-Math.PI/2,c=Math.cos(a),s=Math.sin(a),pw=(v,e)=>Math.sign(v)*Math.pow(Math.abs(v),e);if(f==='heart')return[16*Math.pow(Math.sin(th),3)/34,(-13*Math.cos(th)+5*Math.cos(2*th)+2*Math.cos(3*th)+Math.cos(4*th)-2.5)/34];if(f==='cross'){const r=(A,B)=>Math.pow(Math.pow(Math.abs(c)/A,8)+Math.pow(Math.abs(s)/B,8),-.125),R=Math.max(r(.5,.15),r(.15,.5));return[c*R,s*R]}const q=FS[f],e=2/q[2];return[q[0]*pw(c,e),q[1]*pw(s,e)]};const FD=(c,fa,fb,k,x,y,S,r,col,a=1,g=1,sx=1,sy=1,w=1)=>{if(!(S>0)||!(a>0))return;fa=FV(fa);fb=FV(fb);k=M.clamp(k);const ma=FM(fa),mb=FM(fb),fl=M.lerp(ma[0],mb[0],k),sw=M.lerp(ma[1],mb[1],k)*S*w,co=Math.cos(r),si=Math.sin(r),A=Math.min(1,a);GL(c,x,y,S*(1.3+.5*Math.min(4,Math.max(sx,sy))),col,.8*g*A);c.save();c.globalAlpha=A;c.beginPath();for(let i=0;i<FN;i++){const p=FP(fa,i),q=FP(fb,i),u=M.lerp(p[0],q[0],k)*S*sx,v=M.lerp(p[1],q[1],k)*S*sy;c[i?'lineTo':'moveTo'](x+u*co-v*si,y+u*si+v*co)}c.closePath();c.lineJoin='round';c.shadowColor=col;c.shadowBlur=S*.25*g;if(fl>.01){c.fillStyle=M.rgba(col,fl);c.fill()}if(sw>.2){c.strokeStyle=col;c.lineWidth=sw;c.stroke()}c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=A*.5*Math.min(1,g);c.strokeStyle=M.mix(col,'#ffffff',.75);c.lineWidth=Math.max(1,Math.min(S*.018,sw>.2?sw*.4:S));c.stroke();c.restore()};const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p),u=Math.min(W,H),hS=u*.12,fi=FV(p.formIn),fo=FV(p.formOut);if(!(t>0)||t>=D-.04){const e=t>0;c.fillStyle=e?K.nx:K.bg;c.fillRect(0,0,W,H);FD(c,e?fo:fi,e?fo:fi,0,W/2,H/2,hS,0,e?K.co:K.ci);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{env,W,H,D,p,K,S,u,hS,cx:W/2,cy:H/2,fi,fo,ki:M.ease.inOutCubic(M.range(t,0,.55)),ko:M.ease.inOutCubic(M.range(t,D-.65,D-.1))}};const FLIP=(c,B,k,m)=>{if(!(k>0))return;const {W,H,cx,cy}=B;c.save();c.fillStyle=B.K.nx;if(m==='iris'){const r=Math.hypot(W,H)*.52*M.ease.inCubic(k);c.beginPath();c.arc(cx,cy,r,0,M.TAU);c.fill();if(k<1){c.globalAlpha=.6*(1-k);c.strokeStyle=B.K.fg;c.lineWidth=B.u*.006;c.shadowColor=B.K.fg;c.shadowBlur=B.u*.03;c.stroke()}}else if(m==='wipe')c.fillRect(0,0,W*M.ease.inOutCubic(k),H);else if(m==='rise'){const h=H*M.ease.inOutCubic(k);c.fillRect(0,H-h,W,h)}else if(m==='cut'){if(k>=.5)c.fillRect(0,0,W,H)}else{c.globalAlpha=M.ease.inOutQuad(k);c.fillRect(0,0,W,H)}c.restore()};const CM=(a,b,k)=>k<=0?a:k>=1?b:M.mix(a,b,k);const CN=(c,B,mf,x,y,S,r,col,a=1,g=1,sx=1,sy=1,w=1)=>{const m=Array.isArray(mf)?mf:[mf,mf,0],o=B.ko>0,L=(p,q)=>M.lerp(M.lerp(p,q,B.ki),p,B.ko),A=[L(B.cx,x),L(B.cy,y),L(B.hS,S),L(0,r),o?CM(col,B.K.co,B.ko):CM(B.K.ci,col,B.ki),L(1,a),L(1,g),L(1,sx),L(1,sy),L(1,w)];if(o)FD(c,m[1],B.fo,B.ko,...A);else if(m[2]>0)FD(c,m[0],m[1],m[2],...A);else FD(c,B.fi,m[0],B.ki,...A)};const TX=(c,B,s,y,z,a,o={})=>{s=String(s||'');if(!s||!(a>0))return 0;const sk=M.skin(B.env,B.p),f=M.fit(c,s,q=>sk.font(q,'h',o.w||'300'),z,o.mw||B.S.w*.9,o.n||2,.4),lh=f.size*1.3,n=f.lines.length,x=o.x===undefined?B.cx:o.x;c.save();c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.globalAlpha=Math.min(1,a);c.fillStyle=o.col||'#ffffff';c.shadowColor=o.gl||B.K.fg;[.55,.12].forEach(b=>{c.shadowBlur=f.size*b;f.lines.forEach((l,i)=>c.fillText(l,x,y+(i-(n-1)/2)*lh))});c.restore();return n*lh};const AMB=(c,B,a,x,y,col,r)=>{a*=Math.min(1,B.ki*1.5)*(1-B.ko);if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,r||B.u*.9);g.addColorStop(0,M.rgba(col||B.K.fg,.2*Math.min(1,a)));g.addColorStop(1,M.rgba(col||B.K.fg,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};",Dc="const MOTE=(c,B,t,n,sd,a=1,col)=>{if(!(a>0))return;const R=M.rand(sd);c.save();c.globalCompositeOperation='lighter';c.fillStyle=col||GD;for(let i=0;i<n;i++){const x=R()*B.W,s=R(),y=((R()*B.H-t*B.u*(.02+.05*s))%B.H+B.H)%B.H;c.globalAlpha=Math.min(1,a)*(.25+.6*M.noise(i,t*1.3));c.beginPath();c.arc(x,y,B.u*(.0018+.0028*s),0,M.TAU);c.fill()}c.restore()};",Mo="const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;GL(c,x,y,r*5,col,a);c.save();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.55);c.shadowColor=col;c.shadowBlur=r*2.5;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};",_e="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,hS,cx,cy,S,ki,ko}=B",$n="const STREAK=(c,B,t,a)=>{if(!(a>0))return;for(let i=0;i<3;i++){const x=B.W*(.2+.32*i)+Math.sin(t*.4+i*2)*B.u*.05,y=B.H*(.25+.25*i),r=B.u*(.5+.12*i);c.save();c.translate(x,y);c.rotate(-.6);c.scale(1,.16);const g=c.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(AM,.22*a));g.addColorStop(1,M.rgba(AM,0));c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();c.restore()}};",Vl=[ve("morph-light-thread","Sợi chỉ ánh sáng",3.2,Fe("dot","ring","Hãy bắt đầu"),`function render(ctx,t,env){
7743
+ ${Ye}${Dc}${Mo}
7744
7744
  // Light thread: the connector stretches into a tall vertical thread of warm light with bright flares at both ends and glowing orbs sliding along it, a thin title (text) fades in across its middle, then the thread shrinks back into the connector, which takes its next form as the frame cuts to next (fields: bg, next, fg, fg2, formIn, formOut, text).
7745
7745
  ${_e}
7746
7746
  const st=M.ease.inOutCubic(M.range(t,.3,1.05))*(1-M.ease.inOutCubic(M.range(t,D-1,D-.6))),L=H*.36*st,tx=M.ease.outCubic(M.range(t,.75,1.35))*(1-M.ease.inCubic(M.range(t,D-1.15,D-.8))),col=K.fg,gp=u*.07*tx
@@ -7754,7 +7754,7 @@
7754
7754
  FLIP(ctx,B,M.range(t,D-.2,D-.12),'cut')
7755
7755
  CN(ctx,B,'line',cx,cy,hS,0,col,1-st)
7756
7756
  }`),ve("morph-arrow-ring","Vòng mũi tên",3.4,Fe("ring","diamond","Từng bước một"),`function render(ctx,t,env){
7757
- ${Ye}${Lc}
7757
+ ${Ye}${Dc}
7758
7758
  // Arrow ring: the connector opens into a big glowing ring with small light chevrons spaced around it, spinning around a thin title (text) in the middle, then the ring closes back down to the connector, which takes its next form while next opens from the centre (fields: bg, next, fg, fg2, formIn, formOut, text).
7759
7759
  ${_e}
7760
7760
  const R=u*(S.port?.3:.28)*(1+.015*Math.sin(t*3)),sh=M.ease.inOutCubic(M.range(t,D-1.15,D-.65)),Sr=M.lerp(R/.46,hS,sh),ar=M.ease.outBack(M.range(t,.55,1.1))*(1-M.ease.inCubic(M.range(t,D-1.25,D-.9))),rot=t*.9+M.ease.inOutCubic(M.range(t,.5,1.6))*2.4,col=K.fg
@@ -7767,7 +7767,7 @@
7767
7767
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'iris')
7768
7768
  CN(ctx,B,'ring',cx,cy,Sr,0,col,1,M.lerp(.7,1,sh),1,1,M.lerp(.13,1,sh))
7769
7769
  }`),ve("morph-diamond-frame","Khung thoi sáng",3.2,Fe("diamond","star","Ý tưởng"),`function render(ctx,t,env){
7770
- ${Ye}${Lc}
7770
+ ${Ye}${Dc}
7771
7771
  // Diamond frame: the connector opens into a big glowing ring that squares off into a rounded diamond outline with light glinting at its corners around a thin title (text), then the diamond folds back down into the connector, which takes its next form as next wipes across (fields: bg, next, fg, fg2, formIn, formOut, text).
7772
7772
  ${_e}
7773
7773
  const Z=u*(S.port?.66:.6),sq=M.ease.inOutCubic(M.range(t,.65,1.3)),sh=M.ease.inOutCubic(M.range(t,D-1.15,D-.65)),br=1+.02*Math.sin(t*2.6),Sd=M.lerp(Z,hS,sh)*br,tx=M.ease.outCubic(M.range(t,1,1.5))*(1-M.ease.inCubic(M.range(t,D-1.3,D-1))),col=K.fg,h=Sd*.48,gl=sq*(1-sh)
@@ -7778,7 +7778,7 @@
7778
7778
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'wipe')
7779
7779
  CN(ctx,B,['ring','diamond',sq],cx,cy,Sd,0,col,1,M.lerp(.7,1,sh),1,1,M.lerp(.14,1,sh))
7780
7780
  }`),ve("morph-sparkle-glow","Ngôi sao lấp lánh",3.2,Fe("star","pill","Tỏa sáng"),`function render(ctx,t,env){
7781
- ${Ye}${Lc}
7781
+ ${Ye}${Dc}
7782
7782
  // Sparkle glow: the connector blooms the frame into a warm amber-to-gold gradient and becomes a big spinning four-point sparkle star with small satellite glints and a thin title (text) under it, then the star spins down into the connector, which takes its next form as next opens from the centre (fields: bg, next, fg, fg2, formIn, formOut, text).
7783
7783
  ${_e}
7784
7784
  const bl=M.ease.inOutCubic(M.range(t,.1,.7)),RR=Math.hypot(W,H)*.56*bl,sc=CL(K,AM),sh=M.ease.inOutCubic(M.range(t,D-1.1,D-.65)),Z=M.lerp(u*.42,hS,sh)*(1+.12*Math.sin(Math.PI*M.range(t,.4,1))),rot=M.ease.inOutCubic(M.range(t,.2,1.4))*Math.PI+t*.35*(1-sh),tx=M.ease.outCubic(M.range(t,.85,1.4))*(1-M.ease.inCubic(M.range(t,D-1.25,D-.95))),y=cy-u*.06*(1-sh)
@@ -7789,7 +7789,7 @@
7789
7789
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'iris')
7790
7790
  CN(ctx,B,'star',cx,y,Z,rot,sc)
7791
7791
  }`),ve("morph-pill-band","Dải viên thuốc",3.2,Fe("pill","square","Ưu đãi hôm nay"),`function render(ctx,t,env){
7792
- ${Ye}${Lc}
7792
+ ${Ye}${Dc}
7793
7793
  // Pill band: the connector stretches into a glowing amber pill that widens into a full-width gold light band carrying a title (text) in dark ink, then the band pulls back into a pill and the connector takes its next form as next rises from the bottom (fields: bg, next, fg, fg2, formIn, formOut, text).
7794
7794
  ${_e}
7795
7795
  const ps=hS*2.2,k2=M.ease.inOutCubic(M.range(t,.6,1.15))*(1-M.ease.inOutCubic(M.range(t,D-1.25,D-.8))),pw=M.lerp(ps,W*1.2,k2),ph=M.lerp(ps*.4,u*(S.port?.2:.22),k2),col=K.fg,tx=M.ease.outCubic(M.range(t,1.05,1.45))*(1-M.ease.inCubic(M.range(t,D-1.45,D-1.2))),ba=M.clamp(k2*4)
@@ -7801,7 +7801,7 @@
7801
7801
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'rise')
7802
7802
  CN(ctx,B,'pill',cx,cy,ps,0,col,1-ba)
7803
7803
  }`),ve("morph-gradient-card","Thẻ chuyển sắc",3.6,Fe("square","cross","Sáng tạo không giới hạn"),`function render(ctx,t,env){
7804
- ${Ye}${Lc}
7804
+ ${Ye}${Dc}
7805
7805
  // Gradient card: the connector squares off and grows into a glowing amber-to-gold gradient card with a sparkle icon, a title (text) and two soft subtitle lines, then the card slides away to the side leaving the connector behind, which takes its next form as next fades in (fields: bg, next, fg, fg2, formIn, formOut, text).
7806
7806
  ${_e}
7807
7807
  const g2=M.ease.inOutCubic(M.range(t,.45,1.05)),ex=M.ease.inCubic(M.range(t,D-1.3,D-.85)),cw=Math.min(S.w*.98,u*.82),chh=cw*.64,w=M.lerp(hS*.8,cw,g2),h=M.lerp(hS*.8,chh,g2),x=cx+ex*W*.85,col=K.fg,ct=M.ease.outCubic(M.range(t,.95,1.4)),ca=M.clamp(g2*3)*(1-ex)
@@ -7814,7 +7814,7 @@
7814
7814
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'fade')
7815
7815
  CN(ctx,B,'square',cx,cy,hS,0,col,Math.max(1-M.clamp(g2*3),M.range(t,D-1.2,D-.8)))
7816
7816
  }`),ve("morph-loading-dots","Hàng chấm chờ",3.4,Fe("cross","line","Đang chuẩn bị điều tuyệt vời"),`function render(ctx,t,env){
7817
- ${Ye}${Lc}${bo}
7817
+ ${Ye}${Dc}${Mo}
7818
7818
  // Loading dots: the connector becomes a light dot that sweeps round a glowing arc, the arc settles into a row of five dots bouncing like a typing indicator above a thin line of text (text), then the dots gather into the middle one, which takes the connector's next form as next wipes across (fields: bg, next, fg, fg2, formIn, formOut, text).
7819
7819
  ${_e}
7820
7820
  const r0=u*.13,sw=M.range(t,.35,1.15),hd=-Math.PI/2+M.TAU*M.ease.inOutCubic(sw),tl=-Math.PI/2+M.TAU*M.ease.inOutCubic(M.range(t,.55,1.2)),st=M.ease.inOutCubic(M.range(t,1.05,1.45)),gm=M.ease.inOutCubic(M.range(t,D-1.1,D-.7)),col=K.fg,sp=u*.07,ry=cy-u*.035,tx=M.ease.outCubic(M.range(t,1.35,1.8))*(1-M.ease.inCubic(M.range(t,D-1.25,D-.95))),dr=u*.017
@@ -7827,7 +7827,7 @@
7827
7827
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'wipe')
7828
7828
  CN(ctx,B,'dot',M.lerp(hx,cx,st),M.lerp(hy,ry,st)-bo(2),dr/.2,0,col)
7829
7829
  }`),ve("morph-light-pole","Cột sáng",3.2,Fe("line","dot","Vươn cao"),`function render(ctx,t,env){
7830
- ${Ye}${Lc}${bo}
7830
+ ${Ye}${Dc}${Mo}
7831
7831
  // Light pole: the connector turns into a light dot that drops to the floor, a vertical pole of light shoots up from the impact with a glowing lamp on top and a pool of light on the floor, a thin title (text) appears under it, then the pole folds back into the connector and the frame cuts to next with the connector in its next form (fields: bg, next, fg, fg2, formIn, formOut, text).
7832
7832
  ${_e}
7833
7833
  const gy=cy+H*(S.port?.22:.26),ty=cy-H*(S.port?.24:.28),dr=M.ease.inCubic(M.range(t,.5,.85)),im=t>=.85?Math.exp(-(t-.85)*4):0,up=M.ease.outCubic(M.range(t,.85,1.45)),cl=M.ease.inOutCubic(M.range(t,D-1.15,D-.7)),col=K.fg,y0=M.lerp(gy,cy+hS*.5,cl),y1=M.lerp(M.lerp(gy,ty,up),cy-hS*.5,cl),pa=up>0?1-cl:0,tx=M.ease.outCubic(M.range(t,1.3,1.75))*(1-M.ease.inCubic(M.range(t,D-1.3,D-1.05)))
@@ -7840,7 +7840,7 @@
7840
7840
  FLIP(ctx,B,M.range(t,D-.2,D-.12),'cut')
7841
7841
  CN(ctx,B,['dot','line',cl],cx,M.lerp(M.lerp(cy,gy,dr),cy,cl),hS,0,col,up>0?cl:1)
7842
7842
  }`),ve("morph-sun-flood","Mặt trời tràn sáng",3.4,Fe("dot","pill","Một ngày mới"),`function render(ctx,t,env){
7843
- ${Ye}${jn}
7843
+ ${Ye}${$n}
7844
7844
  // Sun flood: the connector becomes a light dot that swells into a glowing sun with turning rays, the sun floods the whole frame warm cream with soft orange streaks and a title (text) in dark ink, then the connector comes back as a dot on the cream and takes its next form as next opens from it (fields: bg, next, fg, fg2, formIn, formOut, text).
7845
7845
  ${_e}
7846
7846
  const fl=K.f2,sw=M.ease.inOutCubic(M.range(t,.45,1.2)),fd=M.ease.inCubic(M.range(t,1.15,1.7)),rs=M.lerp(u*.03,u*.2,sw),rf=M.lerp(rs,Math.hypot(W,H)*.56,fd),bk=M.ease.outCubic(M.range(t,1.95,2.35)),sc=CL(K,fl),tx=M.ease.outCubic(M.range(t,1.75,2.2))*(1-M.ease.inCubic(M.range(t,D-1,D-.75))),ra=sw*(1-fd)
@@ -7851,7 +7851,7 @@
7851
7851
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'iris')
7852
7852
  CN(ctx,B,'dot',cx,cy,fd>=1?hS:rs/.2,0,fd>=1?sc:K.fg,fd>=1?bk:1-sw)
7853
7853
  }`),ve("morph-path-tag","Thẻ trên đường đi",4.6,Fe("pill","bar","Ý tưởng|Phác thảo|Thiết kế|Ra mắt"),`function render(ctx,t,env){
7854
- ${Ye}${jn}
7854
+ ${Ye}${$n}
7855
7855
  // Path tag: the connector blooms the frame warm cream with soft orange streaks and becomes an amber pill tag that travels along a dashed wandering path across the frame, its label (text, labels split by |) changing at each stop, then it returns to the centre and takes its next form as next opens (fields: bg, next, fg, fg2, formIn, formOut, text).
7856
7856
  ${_e}
7857
7857
  const fl=K.f2,bl=M.ease.inOutCubic(M.range(t,.1,.6)),sc=CL(K,fl),Q=[[.5,.5],[.76,.64],[.68,.8],[.32,.76],[.24,.5],[.36,.27],[.68,.26],[.5,.5]].map(v=>[v[0]*W,v[1]*H]),lb=String(B.p.text||'').split('|').map(s=>s.trim()).filter(Boolean),t0=.75,Lg=(D-1.55-t0)/4,sv=[0,2/7,4/7,6/7,1]
@@ -7865,7 +7865,7 @@
7865
7865
  FLIP(ctx,B,M.range(t,D-.5,D-.1),'iris')
7866
7866
  CN(ctx,B,'pill',p[0],p[1],u*.2,0,sc,1-ta)
7867
7867
  }`),ve("morph-blob-merge","Giọt sáng hợp nhất",3.8,Fe("bar","heart","Kết nối"),`function render(ctx,t,env){
7868
- ${Ye}${Lc}
7868
+ ${Ye}${Dc}
7869
7869
  // Blob merge: the connector becomes an amber pill label with a word (text), the pill bursts into glowing golden blobs that orbit, stretch and melt into each other through gooey necks, then they merge back into one blob that shrinks into the connector, which takes its next form as next fades in (fields: bg, next, fg, fg2, formIn, formOut, text).
7870
7870
  ${_e}
7871
7871
  const pl=M.ease.outCubic(M.range(t,.45,.75))*(1-M.ease.inCubic(M.range(t,1.05,1.25))),bu=M.ease.outBack(M.range(t,1.15,1.8)),mg=M.ease.inOutCubic(M.range(t,D-1.45,D-.95)),dk=M.ease.inOutCubic(M.range(t,D-1.05,D-.7)),col=K.fg,R0=u*(S.port?.21:.19)*Math.max(0,bu)*(1-mg),R2=M.rand(21),bs=[]
@@ -7900,7 +7900,7 @@
7900
7900
  f.lines.forEach((l,i)=>{const a=M.ease.outCubic(M.range(t,i*.1,.5+i*.1))*(1-k.o),y=y0+i*lh+(1-a)*u*.02;if(!(a>0))return
7901
7901
  ctx.globalAlpha=a;ctx.filter='blur('+((1-a)*u*.01).toFixed(2)+'px)';ctx.fillStyle='#ffffff';ctx.shadowColor=fg;ctx.shadowBlur=f.size*.5;ctx.fillText(l,S.cx,y);ctx.shadowBlur=f.size*.1;ctx.shadowColor='rgba(18,10,6,.8)';ctx.fillText(l,S.cx,y)})
7902
7902
  ctx.restore()
7903
- }`)],Vn=Y.find(t=>t.id==="glass"),Tc=(t,e,c,o,n)=>({id:t,name:e,category:Vn.name,pack:"glass",duration:c,params:{accent:Vn.accent,bg:"none",...o,style:"glass"},code:n}),Cc="const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CY='#3fd8ff';const BG=(c,env,p,t,A)=>{if(!HX.test(String(p.bg)))return;const W=env.width,H=env.height,b=p.bg,L=Math.hypot(W,H);c.fillStyle=b;c.fillRect(0,0,W,H);const g=c.createLinearGradient(0,0,W,H);g.addColorStop(0,M.rgba(b,0));g.addColorStop(.6,M.rgba(M.mix(b,A,.22),.85));g.addColorStop(1,M.rgba(M.mix(b,A,.4),1));c.fillStyle=g;c.fillRect(0,0,W,H);c.save();c.globalCompositeOperation='lighter';c.translate(W*(.62+.05*Math.sin(t*.5)),H*.45);c.rotate(.62);const bm=c.createLinearGradient(-L*.09,0,L*.09,0);bm.addColorStop(0,'rgba(0,0,0,0)');bm.addColorStop(.5,M.rgba(M.mix(A,'#9fb4ff',.4),.16));bm.addColorStop(1,'rgba(0,0,0,0)');c.fillStyle=bm;c.fillRect(-L*.09,-L,L*.18,L*2);c.restore();const v=c.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,L*.62);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,.55)');c.fillStyle=v;c.fillRect(0,0,W,H)};const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.55*Math.min(1,a)));g.addColorStop(.4,M.rgba(col,.16*Math.min(1,a)));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GR=(n,s)=>{const x=String(Math.round(Math.abs(n)));let o='';for(let i=0;i<x.length;i++){if(i&&(x.length-i)%3===0)o+=s;o+=x[i]}return(n<0?'-':'')+o};const FLY=(c,x,y,i,o,u,dir=1)=>{c.translate(x+(1-i)*u*.1*dir-o*u*.08,y+(1-i)*u*.14+o*u*.02);c.rotate((1-i)*-.22*dir+o*.08);const s=.82+.18*i-.06*o;c.scale(s,s);c.transform(1,-.035,.06,1,0,0);c.globalAlpha*=M.clamp(i*1.4)*(1-o);const b=((1-i)+o)*u*.014;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)'};const PANEL=(c,x,y,w,h,r,t,A,sw=1)=>{const f=c.createLinearGradient(x,y,x+w*.3,y+h);f.addColorStop(0,'rgba(34,40,64,.62)');f.addColorStop(1,'rgba(5,7,18,.82)');c.fillStyle=f;M.rr(c,x,y,w,h,r);c.fill();c.save();M.rr(c,x,y,w,h,r);c.clip();GL(c,x+w*.08,y+h*.95,Math.max(w,h)*.55,A,.55);if(sw){const s=((t*.42+.15)%1.5)/1.2,bx=x-w*.5+w*1.9*s,bw=Math.max(w,h)*.22,g=c.createLinearGradient(bx,0,bx+bw,0);g.addColorStop(0,'rgba(255,255,255,0)');g.addColorStop(.5,'rgba(255,255,255,'+(.3*sw)+')');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.moveTo(bx,y);c.lineTo(bx+bw,y);c.lineTo(bx+bw-h*.7,y+h);c.lineTo(bx-h*.7,y+h);c.closePath();c.fill()}c.restore();const e=c.createLinearGradient(x,y,x+w,y+h);e.addColorStop(0,'rgba(236,240,255,.85)');e.addColorStop(.5,'rgba(150,160,190,.3)');e.addColorStop(1,'rgba(220,228,255,.7)');c.strokeStyle=e;c.lineWidth=Math.max(1,Math.min(w,h)*.012);M.rr(c,x,y,w,h,r);c.stroke()};const WL=(c,sk,s,x,y,size,role,col,t,t0,step,o,maxW,glow,al='center')=>{const ws=String(s).split(' ').filter(Boolean);if(!ws.length||!(size>0))return 0;let z=size;c.font=sk.font(z,role);let tw=c.measureText(ws.join(' ')).width;if(tw>maxW){z*=maxW/tw;c.font=sk.font(z,role);tw=maxW}const sp=c.measureText(' ').width,st=Math.min(.08,.45/ws.length);let px=al==='left'?x:x-tw/2;c.textAlign='left';c.textBaseline='alphabetic';ws.forEach((w,i)=>{const t1=Array.isArray(t0)?(t0[i]??t0[t0.length-1]??0):t0+i*step,a=M.ease.outCubic(M.range(t,t1,t1+.3)),e=M.ease.inCubic(M.range(o,i*st,i*st+.55)),ww=c.measureText(w).width;if(a>0&&e<1){c.save();c.globalAlpha*=a*(1-e);const b=(1-a)*z*.12+e*z*.25;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)';c.fillStyle=col;if(glow){c.shadowColor=col;c.shadowBlur=z*.3}c.fillText(w,px-e*z*1.4+(1-a)*z*.2,y+[0,.09,-.05][i%3]*z+(1-a)*z*.4);c.restore()}px+=ww+sp});return z};const TITLE=(c,sk,p,S,t,o,A,t0=.15)=>{const a=String(p.text||''),b=String(p.sub||''),n=a.split(' ').filter(Boolean).length,u=S.u,y=S.H*(S.port?.165:.15);if(a)WL(c,sk,a,S.cx-u*.03,y,u*(S.port?.05:.052),'s','#f2f5ff',t,t0,.16,o,S.w*.9,0);if(b)WL(c,sk,b,S.cx+u*.05,y+u*(S.port?.105:.095),u*(S.port?.1:.088),'h',A,t,t0+n*.16+.1,.18,o,S.w*.86,1);return !!(a||b)};const BOX=(S,ar,has,pos)=>{const top=has?S.H*(S.port?.29:.3):S.top+S.H*.02,b0=pos==='lower'?Math.max(top,S.H*.5):top,b1=pos==='top'?Math.min(S.bot,S.H*.66):S.bot,ah=(b1-b0)*.9,w=Math.min(S.w*(S.port?.86:.62),ah*ar),h=w/ar;return{w,h,x:S.cx-w/2,y:(b0+b1)/2-h/2,cx:S.cx,cy:(b0+b1)/2}};",Xc="const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),A=sk.acc,u=S.u,i=M.ease.outCubic(M.range(t,.02,.45)),o=M.ease.inCubic(M.range(t,D-.3,D));BG(ctx,env,p,t,A);const has=TITLE(ctx,sk,p,S,t,o,A)",jl=[Tc("glass-orb-rise","Quả cầu trợ lý",4,{text:"Nếu bạn có thể",sub:"giao dịch",position:"center"},`function render(ctx,t,env){
7903
+ }`)],Xn=Y.find(t=>t.id==="glass"),Tc=(t,e,c,o,n)=>({id:t,name:e,category:Xn.name,pack:"glass",duration:c,params:{accent:Xn.accent,bg:"none",...o,style:"glass"},code:n}),Cc="const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CY='#3fd8ff';const BG=(c,env,p,t,A)=>{if(!HX.test(String(p.bg)))return;const W=env.width,H=env.height,b=p.bg,L=Math.hypot(W,H);c.fillStyle=b;c.fillRect(0,0,W,H);const g=c.createLinearGradient(0,0,W,H);g.addColorStop(0,M.rgba(b,0));g.addColorStop(.6,M.rgba(M.mix(b,A,.22),.85));g.addColorStop(1,M.rgba(M.mix(b,A,.4),1));c.fillStyle=g;c.fillRect(0,0,W,H);c.save();c.globalCompositeOperation='lighter';c.translate(W*(.62+.05*Math.sin(t*.5)),H*.45);c.rotate(.62);const bm=c.createLinearGradient(-L*.09,0,L*.09,0);bm.addColorStop(0,'rgba(0,0,0,0)');bm.addColorStop(.5,M.rgba(M.mix(A,'#9fb4ff',.4),.16));bm.addColorStop(1,'rgba(0,0,0,0)');c.fillStyle=bm;c.fillRect(-L*.09,-L,L*.18,L*2);c.restore();const v=c.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,L*.62);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,.55)');c.fillStyle=v;c.fillRect(0,0,W,H)};const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.55*Math.min(1,a)));g.addColorStop(.4,M.rgba(col,.16*Math.min(1,a)));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GR=(n,s)=>{const x=String(Math.round(Math.abs(n)));let o='';for(let i=0;i<x.length;i++){if(i&&(x.length-i)%3===0)o+=s;o+=x[i]}return(n<0?'-':'')+o};const FLY=(c,x,y,i,o,u,dir=1)=>{c.translate(x+(1-i)*u*.1*dir-o*u*.08,y+(1-i)*u*.14+o*u*.02);c.rotate((1-i)*-.22*dir+o*.08);const s=.82+.18*i-.06*o;c.scale(s,s);c.transform(1,-.035,.06,1,0,0);c.globalAlpha*=M.clamp(i*1.4)*(1-o);const b=((1-i)+o)*u*.014;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)'};const PANEL=(c,x,y,w,h,r,t,A,sw=1)=>{const f=c.createLinearGradient(x,y,x+w*.3,y+h);f.addColorStop(0,'rgba(34,40,64,.62)');f.addColorStop(1,'rgba(5,7,18,.82)');c.fillStyle=f;M.rr(c,x,y,w,h,r);c.fill();c.save();M.rr(c,x,y,w,h,r);c.clip();GL(c,x+w*.08,y+h*.95,Math.max(w,h)*.55,A,.55);if(sw){const s=((t*.42+.15)%1.5)/1.2,bx=x-w*.5+w*1.9*s,bw=Math.max(w,h)*.22,g=c.createLinearGradient(bx,0,bx+bw,0);g.addColorStop(0,'rgba(255,255,255,0)');g.addColorStop(.5,'rgba(255,255,255,'+(.3*sw)+')');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.moveTo(bx,y);c.lineTo(bx+bw,y);c.lineTo(bx+bw-h*.7,y+h);c.lineTo(bx-h*.7,y+h);c.closePath();c.fill()}c.restore();const e=c.createLinearGradient(x,y,x+w,y+h);e.addColorStop(0,'rgba(236,240,255,.85)');e.addColorStop(.5,'rgba(150,160,190,.3)');e.addColorStop(1,'rgba(220,228,255,.7)');c.strokeStyle=e;c.lineWidth=Math.max(1,Math.min(w,h)*.012);M.rr(c,x,y,w,h,r);c.stroke()};const WL=(c,sk,s,x,y,size,role,col,t,t0,step,o,maxW,glow,al='center')=>{const ws=String(s).split(' ').filter(Boolean);if(!ws.length||!(size>0))return 0;let z=size;c.font=sk.font(z,role);let tw=c.measureText(ws.join(' ')).width;if(tw>maxW){z*=maxW/tw;c.font=sk.font(z,role);tw=maxW}const sp=c.measureText(' ').width,st=Math.min(.08,.45/ws.length);let px=al==='left'?x:x-tw/2;c.textAlign='left';c.textBaseline='alphabetic';ws.forEach((w,i)=>{const t1=Array.isArray(t0)?(t0[i]??t0[t0.length-1]??0):t0+i*step,a=M.ease.outCubic(M.range(t,t1,t1+.3)),e=M.ease.inCubic(M.range(o,i*st,i*st+.55)),ww=c.measureText(w).width;if(a>0&&e<1){c.save();c.globalAlpha*=a*(1-e);const b=(1-a)*z*.12+e*z*.25;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)';c.fillStyle=col;if(glow){c.shadowColor=col;c.shadowBlur=z*.3}c.fillText(w,px-e*z*1.4+(1-a)*z*.2,y+[0,.09,-.05][i%3]*z+(1-a)*z*.4);c.restore()}px+=ww+sp});return z};const TITLE=(c,sk,p,S,t,o,A,t0=.15)=>{const a=String(p.text||''),b=String(p.sub||''),n=a.split(' ').filter(Boolean).length,u=S.u,y=S.H*(S.port?.165:.15);if(a)WL(c,sk,a,S.cx-u*.03,y,u*(S.port?.05:.052),'s','#f2f5ff',t,t0,.16,o,S.w*.9,0);if(b)WL(c,sk,b,S.cx+u*.05,y+u*(S.port?.105:.095),u*(S.port?.1:.088),'h',A,t,t0+n*.16+.1,.18,o,S.w*.86,1);return !!(a||b)};const BOX=(S,ar,has,pos)=>{const top=has?S.H*(S.port?.29:.3):S.top+S.H*.02,b0=pos==='lower'?Math.max(top,S.H*.5):top,b1=pos==='top'?Math.min(S.bot,S.H*.66):S.bot,ah=(b1-b0)*.9,w=Math.min(S.w*(S.port?.86:.62),ah*ar),h=w/ar;return{w,h,x:S.cx-w/2,y:(b0+b1)/2-h/2,cx:S.cx,cy:(b0+b1)/2}};",Xc="const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),A=sk.acc,u=S.u,i=M.ease.outCubic(M.range(t,.02,.45)),o=M.ease.inCubic(M.range(t,D-.3,D));BG(ctx,env,p,t,A);const has=TITLE(ctx,sk,p,S,t,o,A)",$l=[Tc("glass-orb-rise","Quả cầu trợ lý",4,{text:"Nếu bạn có thể",sub:"giao dịch",position:"center"},`function render(ctx,t,env){
7904
7904
  ${Cc}
7905
7905
  // A glowing assistant orb with two blinking eyes rises from a lit blue horizon dome, a soft halo pulsing under it; optional lead words + big blue keyword above (fields: text, sub, accent, bg).
7906
7906
  ${Xc}
@@ -8059,9 +8059,9 @@
8059
8059
  if(a>0&&e<1){ctx.save();ctx.globalAlpha*=M.clamp(a)*(1-e)*fade;ctx.font=sk.font(z,x.B?'h':'s');ctx.textAlign='left';ctx.textBaseline='alphabetic';const bl=(1-M.clamp(a))*z*.15+e*z*.25;if(bl>.4)ctx.filter='blur('+bl.toFixed(1)+'px)'
8060
8060
  const cx=px+ww/2,cy=y-z*.35;ctx.translate(cx-e*z*1.3,cy+(1-M.clamp(a))*z*(x.B?0:.4));const sc=x.B?.6+.4*a:1;ctx.scale(sc,sc);ctx.fillStyle=x.B?A:'#f2f5ff';if(x.B){ctx.shadowColor=A;ctx.shadowBlur=z*.28}ctx.fillText(x.w,-ww/2,z*.35);ctx.restore()}
8061
8061
  px+=ww+g.sp*g.k})})
8062
- }`)],$n=Y.find(t=>t.id==="clipooxmotion"),G=(t,e,c,o,n)=>({id:t,name:e,category:$n.name,pack:"clipooxmotion",duration:c,params:{accent:$n.accent,position:"center",...o,style:"clipooxmotion"},code:n}),mt=(...t)=>({...G(...t),formats:["portrait"]}),Qe=(...t)=>({...G(...t),formats:["landscape"]}),K="const LM='#8afb00',BK='#0d0d0d';const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);const MONO=(s,w='700')=>w+' '+Math.round(s*10)/10+'px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';const OUT=(c,t,D,cx,cy,hold)=>{const o=hold?0:M.ease.inCubic(M.range(t,D-.4,D));c.save();if(o>0){c.globalAlpha*=1-o;c.filter='blur('+(o*16).toFixed(1)+'px)';c.translate(cx,cy);c.scale(1+o*.12,1+o*.12);c.translate(-cx,-cy)}return o};",lt="const LOGO=(c,x,y,h,col,a=1,rot=0)=>{if(!(h>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.fillStyle=col;c.fill('evenodd');c.restore()};",Te="const APP=(c,x,y,s,a=1,rot=0)=>{if(!(s>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.shadowColor='rgba(60,110,0,.35)';c.shadowBlur=s*.25;c.shadowOffsetY=s*.06;c.fillStyle=LM;c.beginPath();c.roundRect(-s/2,-s/2,s,s,s*.22);c.fill();c.shadowColor='transparent';const g=c.createLinearGradient(0,-s/2,0,s/2);g.addColorStop(0,'rgba(255,255,255,.28)');g.addColorStop(.5,'rgba(255,255,255,0)');c.fillStyle=g;c.fill();c.restore();LOGO(c,x,y+s*.02,s*.66,BK,a,rot)};",Ra="const SMR=(c,dx,draw,n=7)=>{if(Math.abs(dx)<1){draw();return}const a0=c.globalAlpha;for(let i=n;i>=0;i--){c.save();c.globalAlpha=a0*(i?.22*(1-i/(n+1)):1);c.translate(-dx*i/n,0);draw();c.restore()}};",Vl=K+lt+Te+Ra,ye="const PA='#f7f8f3',GR='#6b7064';const BG=(c,W,H,u,t)=>{c.fillStyle=PA;c.fillRect(0,0,W,H);[[.04,.04,'#c9ff80',.5],[.97,.98,LM,.32],[.92,.03,'#e6ffc4',.55],[.03,.97,'#eaffd2',.45]].forEach((v,i)=>{const x=W*(v[0]+Math.sin(t*.5+i*2)*.05),y=H*(v[1]+Math.cos(t*.4+i)*.05),R=Math.max(W,H)*.36,g=c.createRadialGradient(x,y,0,x,y,R);g.addColorStop(0,M.rgba(v[2],v[3]));g.addColorStop(1,M.rgba(v[2],0));c.fillStyle=g;c.fillRect(0,0,W,H)});c.fillStyle='rgba(13,13,13,.07)';const s=u*.04,d=Math.max(1.2,u*.0022);for(let x=s/2;x<W;x+=s)for(let y=s/2;y<H;y+=s)c.fillRect(x,y,d,d)};",Xt=Vl+ye+"const MKR=(c,x,y,w,h,k,col=LM)=>{if(!(k>0))return;const sl=h*.18;c.save();c.fillStyle=col;c.beginPath();c.moveTo(x+sl,y-h/2);c.lineTo(x+sl+w*k,y-h/2);c.lineTo(x+w*k-sl,y+h/2);c.lineTo(x-sl,y+h/2);c.closePath();c.fill();c.restore()};"+"const EXT=(c,s,x,y,size,a=1)=>{c.save();c.globalAlpha*=a;c.fillStyle=LM;c.fillText(s,x+size*.035,y+size*.05);c.fillStyle=BK;c.fillText(s,x,y);c.restore()};",ht="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))BG(ctx,W,H,u,t);",et="const DB='#050605',WH='#f2f5ee',DG='#7d8478';const DBG=(c,W,H,u,t)=>{c.fillStyle=DB;c.fillRect(0,0,W,H);const g=c.createRadialGradient(W/2,H*.38,0,W/2,H*.38,Math.max(W,H)*.6);g.addColorStop(0,'rgba(138,251,0,.08)');g.addColorStop(1,'rgba(138,251,0,0)');c.fillStyle=g;c.fillRect(0,0,W,H);c.fillStyle='rgba(255,255,255,.028)';const s=Math.max(3,u*.006);for(let y=0;y<H;y+=s)c.fillRect(0,y,W,1)};",Pa="const GLOWB=(c,x,y,txt,f,s,k=1,g=1)=>{if(!(k>0)||!txt)return;c.save();c.font=f;const w=c.measureText(txt).width+s*2,h=s*2.1;c.translate(x,y);c.scale(k,k);c.shadowColor=LM;c.shadowBlur=s*1.8*g;const gr=c.createLinearGradient(0,-h/2,0,h/2);gr.addColorStop(0,'#d2ff6e');gr.addColorStop(1,LM);c.fillStyle=gr;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h/2);c.fill();c.shadowBlur=0;c.fillStyle=BK;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,h*.03);c.restore()};",Xn="const CHIP=(c,x,y,txt,s,a=1)=>{if(!(a>0)||!txt)return;c.save();c.globalAlpha*=a;c.font=MONO(s,'700');const w=c.measureText(txt).width+s*2.7,h=s*1.9;c.strokeStyle=LM;c.lineWidth=Math.max(1,s*.1);c.fillStyle='rgba(138,251,0,.08)';c.beginPath();c.roundRect(x-w/2,y-h/2,w,h,h*.3);c.fill();c.stroke();c.fillStyle=LM;c.textAlign='left';c.textBaseline='middle';c.fillText(txt,x-w/2+s*1.75,y);c.restore();LOGO(c,x-w/2+s*1,y,s*1.05,LM,a)};",$l="const SPK=(c,x,y,r,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.fillStyle='#ffffff';c.shadowColor=LM;c.shadowBlur=r*.9;c.beginPath();c.moveTo(0,-r);c.quadraticCurveTo(0,0,r,0);c.quadraticCurveTo(0,0,0,r);c.quadraticCurveTo(0,0,-r,0);c.quadraticCurveTo(0,0,0,-r);c.fill();c.restore()};",_a="const CARD=(c,x,y,w,h,r,a=1)=>{if(!(a>0))return;c.save();c.globalAlpha*=a;const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'#1c1e1c');g.addColorStop(1,'#0f100f');c.fillStyle=g;c.beginPath();c.roundRect(x,y,w,h,r);c.fill();c.strokeStyle='rgba(255,255,255,.1)';c.lineWidth=1;c.stroke();c.restore()};const SPIN=(c,x,y,r,t)=>{c.save();c.strokeStyle=LM;c.lineWidth=Math.max(1.5,r*.28);c.lineCap='round';c.beginPath();c.arc(x,y,r,t*6,t*6+4.2);c.stroke();c.restore()};",za="const GT=(c,s,x,y,w,t,al='left',a=1,dk=0)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.textAlign=al;const o=((t*.35)%1)*w*2,x0=al==='center'?x-w/2:x,g=c.createLinearGradient(x0-w+o,0,x0+w+o,0),cs=dk?['#2f6a00','#5cc400','#1d3d00','#2f6a00']:[LM,'#f4ffd0','#ffffff',LM];cs.forEach((v,i)=>g.addColorStop(i/3,v));c.fillStyle=g;c.fillText(s,x,y);c.restore()};",Fn="const WM=(c,W,H,u,t)=>{if(!ON(p))return;LOGO(c,W*.5+Math.sin(t*.25)*u*.04,H*.56,Math.max(W,H)*1.1,'#151715')};",Yn="const COIN=(c,x,y,r,fl,rot,a=1,bl=0)=>{if(!(r>0)||!(a>0))return;const sy=Math.abs(Math.cos(fl)),th=r*.16*Math.sqrt(1-sy*sy)+r*.05,ry=Math.max(.5,r*sy);c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';c.fillStyle='#4f9a00';c.beginPath();c.ellipse(0,th,r,ry,0,0,M.TAU);c.fill();c.fillRect(-r,0,r*2,th);const g=c.createRadialGradient(-r*.3,-r*.3*sy,r*.1,0,0,r*1.1);g.addColorStop(0,'#eaff9e');g.addColorStop(.6,'#a6f02a');g.addColorStop(1,'#6cc000');c.fillStyle=g;c.beginPath();c.ellipse(0,0,r,ry,0,0,M.TAU);c.fill();c.strokeStyle='rgba(60,120,0,.5)';c.lineWidth=r*.05;c.beginPath();c.ellipse(0,0,r*.82,Math.max(.4,r*.82*sy),0,0,M.TAU);c.stroke();c.scale(1,Math.max(.05,sy));LOGO(c,0,0,r*.9,'rgba(70,130,0,.55)');c.restore()};",ct="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))DBG(ctx,W,H,u,t);",lc="const VW=PT?S.w:Math.min(S.w,H*.62),VX=cx-VW/2,VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT;",Ze=K.replace("LM='#8afb00'",()=>"LM=/^#[0-9a-f]{6}$/i.test(String((env.params||{}).accent))?env.params.accent:'#8afb00'").replace("c.filter='blur('+(o*16).toFixed(1)+'px)';","")+"const WH='#f4f6f0',GF='#2b2e2c';",Je=t=>"const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const VW="+(t?"PT?W*.78:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.07:cx-VW/2":"S.x0")+",VT="+(t?"PT?H*.11:H*.1":"S.top")+",VB="+(t?"PT?H*.8:H*.9":"S.bot")+",VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2,TL="+(t?"1":"PT?1:0")+";",Dc="const BGX=(c,m)=>{if(!ON(p))return;const L=m==='paper';c.fillStyle=L?'#f7f8f3':m==='graph'?'#e9ebe6':'#050605';c.fillRect(0,0,W,H);const g=c.createRadialGradient(cx,H*.42,0,cx,H*.42,Math.max(W,H)*.7);g.addColorStop(0,M.rgba(LM,L?.16:.1));g.addColorStop(1,M.rgba(LM,0));c.fillStyle=g;c.fillRect(0,0,W,H)};",Ba="const PW=(s,x)=>{ctx.font=sk.font(s,'s','800');return ctx.measureText(x).width+s*1.4};const PILL=(c,x,y,s,txt,bg,fg,k=1,bd,rot=0,rr=.5)=>{if(!txt||!(k>0))return 0;c.save();const w=PW(s,txt),h=s*1.7;c.translate(x,y);c.rotate(rot);c.scale(k,k);c.fillStyle=bg;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h*rr);c.fill();if(bd){c.strokeStyle=bd;c.lineWidth=Math.max(1,s*.09);c.stroke()}c.fillStyle=fg;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,s*.06);c.restore();return w};",Xl="const FP=(c,x,y,h)=>{c.save();c.translate(x,y);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.restore()};",Mo="const FPILL=(x,y,s,txt,t0,al)=>{String(txt||'').split('|').map(v=>v.trim()).filter(Boolean).slice(0,2).forEach((l,i)=>{const w=PW(s,l),k=Math.max(0,M.spring(t-t0-i*.12,{freq:1.6,damp:7}));PILL(ctx,al==='center'?x:x-w/2,y+i*s*1.85,s,l,i?BK:LM,i?LM:BK,k,0,0,.4)})};",_n=t=>`function render(ctx,t,env){
8062
+ }`)],Fn=Y.find(t=>t.id==="clipooxmotion"),G=(t,e,c,o,n)=>({id:t,name:e,category:Fn.name,pack:"clipooxmotion",duration:c,params:{accent:Fn.accent,position:"center",...o,style:"clipooxmotion"},code:n}),mt=(...t)=>({...G(...t),formats:["portrait"]}),Qe=(...t)=>({...G(...t),formats:["landscape"]}),K="const LM='#8afb00',BK='#0d0d0d';const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);const MONO=(s,w='700')=>w+' '+Math.round(s*10)/10+'px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';const OUT=(c,t,D,cx,cy,hold)=>{const o=hold?0:M.ease.inCubic(M.range(t,D-.4,D));c.save();if(o>0){c.globalAlpha*=1-o;c.filter='blur('+(o*16).toFixed(1)+'px)';c.translate(cx,cy);c.scale(1+o*.12,1+o*.12);c.translate(-cx,-cy)}return o};",lt="const LOGO=(c,x,y,h,col,a=1,rot=0)=>{if(!(h>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.fillStyle=col;c.fill('evenodd');c.restore()};",Te="const APP=(c,x,y,s,a=1,rot=0)=>{if(!(s>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.shadowColor='rgba(60,110,0,.35)';c.shadowBlur=s*.25;c.shadowOffsetY=s*.06;c.fillStyle=LM;c.beginPath();c.roundRect(-s/2,-s/2,s,s,s*.22);c.fill();c.shadowColor='transparent';const g=c.createLinearGradient(0,-s/2,0,s/2);g.addColorStop(0,'rgba(255,255,255,.28)');g.addColorStop(.5,'rgba(255,255,255,0)');c.fillStyle=g;c.fill();c.restore();LOGO(c,x,y+s*.02,s*.66,BK,a,rot)};",Ra="const SMR=(c,dx,draw,n=7)=>{if(Math.abs(dx)<1){draw();return}const a0=c.globalAlpha;for(let i=n;i>=0;i--){c.save();c.globalAlpha=a0*(i?.22*(1-i/(n+1)):1);c.translate(-dx*i/n,0);draw();c.restore()}};",Xl=K+lt+Te+Ra,ye="const PA='#f7f8f3',GR='#6b7064';const BG=(c,W,H,u,t)=>{c.fillStyle=PA;c.fillRect(0,0,W,H);[[.04,.04,'#c9ff80',.5],[.97,.98,LM,.32],[.92,.03,'#e6ffc4',.55],[.03,.97,'#eaffd2',.45]].forEach((v,i)=>{const x=W*(v[0]+Math.sin(t*.5+i*2)*.05),y=H*(v[1]+Math.cos(t*.4+i)*.05),R=Math.max(W,H)*.36,g=c.createRadialGradient(x,y,0,x,y,R);g.addColorStop(0,M.rgba(v[2],v[3]));g.addColorStop(1,M.rgba(v[2],0));c.fillStyle=g;c.fillRect(0,0,W,H)});c.fillStyle='rgba(13,13,13,.07)';const s=u*.04,d=Math.max(1.2,u*.0022);for(let x=s/2;x<W;x+=s)for(let y=s/2;y<H;y+=s)c.fillRect(x,y,d,d)};",Xt=Xl+ye+"const MKR=(c,x,y,w,h,k,col=LM)=>{if(!(k>0))return;const sl=h*.18;c.save();c.fillStyle=col;c.beginPath();c.moveTo(x+sl,y-h/2);c.lineTo(x+sl+w*k,y-h/2);c.lineTo(x+w*k-sl,y+h/2);c.lineTo(x-sl,y+h/2);c.closePath();c.fill();c.restore()};"+"const EXT=(c,s,x,y,size,a=1)=>{c.save();c.globalAlpha*=a;c.fillStyle=LM;c.fillText(s,x+size*.035,y+size*.05);c.fillStyle=BK;c.fillText(s,x,y);c.restore()};",ht="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))BG(ctx,W,H,u,t);",et="const DB='#050605',WH='#f2f5ee',DG='#7d8478';const DBG=(c,W,H,u,t)=>{c.fillStyle=DB;c.fillRect(0,0,W,H);const g=c.createRadialGradient(W/2,H*.38,0,W/2,H*.38,Math.max(W,H)*.6);g.addColorStop(0,'rgba(138,251,0,.08)');g.addColorStop(1,'rgba(138,251,0,0)');c.fillStyle=g;c.fillRect(0,0,W,H);c.fillStyle='rgba(255,255,255,.028)';const s=Math.max(3,u*.006);for(let y=0;y<H;y+=s)c.fillRect(0,y,W,1)};",Pa="const GLOWB=(c,x,y,txt,f,s,k=1,g=1)=>{if(!(k>0)||!txt)return;c.save();c.font=f;const w=c.measureText(txt).width+s*2,h=s*2.1;c.translate(x,y);c.scale(k,k);c.shadowColor=LM;c.shadowBlur=s*1.8*g;const gr=c.createLinearGradient(0,-h/2,0,h/2);gr.addColorStop(0,'#d2ff6e');gr.addColorStop(1,LM);c.fillStyle=gr;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h/2);c.fill();c.shadowBlur=0;c.fillStyle=BK;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,h*.03);c.restore()};",Yn="const CHIP=(c,x,y,txt,s,a=1)=>{if(!(a>0)||!txt)return;c.save();c.globalAlpha*=a;c.font=MONO(s,'700');const w=c.measureText(txt).width+s*2.7,h=s*1.9;c.strokeStyle=LM;c.lineWidth=Math.max(1,s*.1);c.fillStyle='rgba(138,251,0,.08)';c.beginPath();c.roundRect(x-w/2,y-h/2,w,h,h*.3);c.fill();c.stroke();c.fillStyle=LM;c.textAlign='left';c.textBaseline='middle';c.fillText(txt,x-w/2+s*1.75,y);c.restore();LOGO(c,x-w/2+s*1,y,s*1.05,LM,a)};",Fl="const SPK=(c,x,y,r,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.fillStyle='#ffffff';c.shadowColor=LM;c.shadowBlur=r*.9;c.beginPath();c.moveTo(0,-r);c.quadraticCurveTo(0,0,r,0);c.quadraticCurveTo(0,0,0,r);c.quadraticCurveTo(0,0,-r,0);c.quadraticCurveTo(0,0,0,-r);c.fill();c.restore()};",_a="const CARD=(c,x,y,w,h,r,a=1)=>{if(!(a>0))return;c.save();c.globalAlpha*=a;const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'#1c1e1c');g.addColorStop(1,'#0f100f');c.fillStyle=g;c.beginPath();c.roundRect(x,y,w,h,r);c.fill();c.strokeStyle='rgba(255,255,255,.1)';c.lineWidth=1;c.stroke();c.restore()};const SPIN=(c,x,y,r,t)=>{c.save();c.strokeStyle=LM;c.lineWidth=Math.max(1.5,r*.28);c.lineCap='round';c.beginPath();c.arc(x,y,r,t*6,t*6+4.2);c.stroke();c.restore()};",za="const GT=(c,s,x,y,w,t,al='left',a=1,dk=0)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.textAlign=al;const o=((t*.35)%1)*w*2,x0=al==='center'?x-w/2:x,g=c.createLinearGradient(x0-w+o,0,x0+w+o,0),cs=dk?['#2f6a00','#5cc400','#1d3d00','#2f6a00']:[LM,'#f4ffd0','#ffffff',LM];cs.forEach((v,i)=>g.addColorStop(i/3,v));c.fillStyle=g;c.fillText(s,x,y);c.restore()};",_n="const WM=(c,W,H,u,t)=>{if(!ON(p))return;LOGO(c,W*.5+Math.sin(t*.25)*u*.04,H*.56,Math.max(W,H)*1.1,'#151715')};",Qn="const COIN=(c,x,y,r,fl,rot,a=1,bl=0)=>{if(!(r>0)||!(a>0))return;const sy=Math.abs(Math.cos(fl)),th=r*.16*Math.sqrt(1-sy*sy)+r*.05,ry=Math.max(.5,r*sy);c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';c.fillStyle='#4f9a00';c.beginPath();c.ellipse(0,th,r,ry,0,0,M.TAU);c.fill();c.fillRect(-r,0,r*2,th);const g=c.createRadialGradient(-r*.3,-r*.3*sy,r*.1,0,0,r*1.1);g.addColorStop(0,'#eaff9e');g.addColorStop(.6,'#a6f02a');g.addColorStop(1,'#6cc000');c.fillStyle=g;c.beginPath();c.ellipse(0,0,r,ry,0,0,M.TAU);c.fill();c.strokeStyle='rgba(60,120,0,.5)';c.lineWidth=r*.05;c.beginPath();c.ellipse(0,0,r*.82,Math.max(.4,r*.82*sy),0,0,M.TAU);c.stroke();c.scale(1,Math.max(.05,sy));LOGO(c,0,0,r*.9,'rgba(70,130,0,.55)');c.restore()};",ct="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))DBG(ctx,W,H,u,t);",lc="const VW=PT?S.w:Math.min(S.w,H*.62),VX=cx-VW/2,VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT;",Ze=K.replace("LM='#8afb00'",()=>"LM=/^#[0-9a-f]{6}$/i.test(String((env.params||{}).accent))?env.params.accent:'#8afb00'").replace("c.filter='blur('+(o*16).toFixed(1)+'px)';","")+"const WH='#f4f6f0',GF='#2b2e2c';",Je=t=>"const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const VW="+(t?"PT?W*.78:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.07:cx-VW/2":"S.x0")+",VT="+(t?"PT?H*.11:H*.1":"S.top")+",VB="+(t?"PT?H*.8:H*.9":"S.bot")+",VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2,TL="+(t?"1":"PT?1:0")+";",Ec="const BGX=(c,m)=>{if(!ON(p))return;const L=m==='paper';c.fillStyle=L?'#f7f8f3':m==='graph'?'#e9ebe6':'#050605';c.fillRect(0,0,W,H);const g=c.createRadialGradient(cx,H*.42,0,cx,H*.42,Math.max(W,H)*.7);g.addColorStop(0,M.rgba(LM,L?.16:.1));g.addColorStop(1,M.rgba(LM,0));c.fillStyle=g;c.fillRect(0,0,W,H)};",Ba="const PW=(s,x)=>{ctx.font=sk.font(s,'s','800');return ctx.measureText(x).width+s*1.4};const PILL=(c,x,y,s,txt,bg,fg,k=1,bd,rot=0,rr=.5)=>{if(!txt||!(k>0))return 0;c.save();const w=PW(s,txt),h=s*1.7;c.translate(x,y);c.rotate(rot);c.scale(k,k);c.fillStyle=bg;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h*rr);c.fill();if(bd){c.strokeStyle=bd;c.lineWidth=Math.max(1,s*.09);c.stroke()}c.fillStyle=fg;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,s*.06);c.restore();return w};",Yl="const FP=(c,x,y,h)=>{c.save();c.translate(x,y);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.restore()};",yo="const FPILL=(x,y,s,txt,t0,al)=>{String(txt||'').split('|').map(v=>v.trim()).filter(Boolean).slice(0,2).forEach((l,i)=>{const w=PW(s,l),k=Math.max(0,M.spring(t-t0-i*.12,{freq:1.6,damp:7}));PILL(ctx,al==='center'?x:x-w/2,y+i*s*1.85,s,l,i?BK:LM,i?LM:BK,k,0,0,.4)})};",Zn=t=>`function render(ctx,t,env){
8063
8063
  // ${t?"Vertical AI prompt box (9:16)":"AI prompt box"}: a white chat input card pops in under a 'Clipoox × partner' header, the prompt types in letter by letter with a blinking caret, the lime send button pulses, then the words whip-zoom at the camera (fields: text = prompt, sub = partner, bg).
8064
- ${Ze}${lt}${Te}${Je(t)}${Dc}
8064
+ ${Ze}${lt}${Te}${Je(t)}${Ec}
8065
8065
  BGX(ctx,'paper')
8066
8066
  const tx=String(p.text||''),pa=String(p.sub||''),br=String(p.brand||'Clipoox')
8067
8067
  const cw=TL?VW:Math.min(VW*.7,u*1.4),fs=TL?VW*.064:cw*.042,pd=fs*1.15,mw=cw-pd*2
@@ -8084,7 +8084,7 @@
8084
8084
  if(z>0)for(let j=4;j>=1;j--)draw(1+z*5*(1-j*.14),ta*.18*(1-z))
8085
8085
  draw(1+z*5,ta*(1-z))
8086
8086
  if(z<=0&&(t<2.6||Math.floor(t*2.4)%2===0)){ctx.font=f.font;let li=0;typed.forEach((l,i)=>{if(l.length)li=i});const xc=x0+pd+ctx.measureText(typed[li]||'').width+fs*.06;ctx.fillStyle=M.mix(LM,BK,.3);ctx.globalAlpha=ta;ctx.fillRect(xc,ty+lh*(li+.5)-f.size*.55,Math.max(2,fs*.08),f.size*1.1);ctx.globalAlpha=1}
8087
- }`,Qn=t=>`function render(ctx,t,env){
8087
+ }`,Jn=t=>`function render(ctx,t,env){
8088
8088
  // ${t?"Vertical glitch title slam (9:16)":"Glitch title slam"}: the big wordmark slams in with an RGB split and scanline glitch while the background flashes four quick colours (lime, black, graphite, the editable second accent), then settles on black with the sub in a lime-rimmed pill (fields: text, sub, accent2, bg).
8089
8089
  ${Ze}${Je(t)}${Ba}
8090
8090
  const A2=/^#[0-9a-f]{6}$/i.test(String(p.accent2))?p.accent2:'#2f4dff',seq=[LM,BK,GF,A2],bi=Math.floor(t/.32),fl=bi<4?seq[bi]:BK
@@ -8103,9 +8103,9 @@
8103
8103
  ctx.fillStyle=fg===BK?'rgba(13,13,13,.07)':'rgba(255,255,255,.05)';const st=Math.max(3,u*.006);for(let y=0;y<H;y+=st)ctx.fillRect(0,y,W,1)
8104
8104
  if(gi>.3){ctx.fillStyle=M.rgba(LM,.25*gi);for(let i=0;i<4;i++)ctx.fillRect(0,r()*H,W,r()*u*.02)}
8105
8105
  ctx.restore()
8106
- }`,Zn=t=>`function render(ctx,t,env){
8106
+ }`,ts=t=>`function render(ctx,t,env){
8107
8107
  // ${t?"Vertical AI status shimmer (9:16)":"AI status shimmer"}: on black a lime-rimmed status pill with a spinner steps through the AI's status lines (each slides up as the next comes in) while a light shimmer sweeps the words and a thin lime progress line fills under it; the spinner turns into a check (fields: items with | per status line, bg).
8108
- ${Ze}${Je(t)}${Dc}
8108
+ ${Ze}${Je(t)}${Ec}
8109
8109
  BGX(ctx,'dark');OUT(ctx,t,D,cx,cy)
8110
8110
  const it=String(p.items||'').split('|').map(s=>s.trim()).filter(Boolean).slice(0,5),n=it.length
8111
8111
  ctx.textBaseline='middle';ctx.textAlign='left'
@@ -8124,9 +8124,9 @@
8124
8124
  ctx.fillStyle='rgba(255,255,255,.12)';ctx.fillRect(VC-lw/2,ly,lw,lt);ctx.fillStyle=LM;ctx.shadowColor=LM;ctx.shadowBlur=fs*.6;ctx.fillRect(VC-lw/2,ly,lw*lk,lt);ctx.shadowBlur=0
8125
8125
  ctx.restore()
8126
8126
  ctx.restore()
8127
- }`,Jn=t=>`function render(ctx,t,env){
8127
+ }`,es=t=>`function render(ctx,t,env){
8128
8128
  // ${t?"Vertical app window burst (9:16)":"App window burst"}: an app window pops in on paper, the Clipoox flame tile drops in and bounces, then lime / black confetti stars, dots and squares burst out of it with light rays behind, the lime open button under the caption (fields: text = caption, sub = button, bg).
8129
- ${Ze}${lt}${Te}${Je(t)}${Dc}
8129
+ ${Ze}${lt}${Te}${Je(t)}${Ec}
8130
8130
  BGX(ctx,'paper');OUT(ctx,t,D,cx,cy)
8131
8131
  const ww=TL?VW:Math.min(VW*.6,u*1.15),wh=ww*(TL?.86:.64),wx=VC-ww/2,wy=VM-wh/2,ki=M.ease.outBack(M.range(t,0,.4)),bar=ww*.075
8132
8132
  const ix=VC,iy=wy+bar+(wh-bar)*.4,is=wh*.3,tb=t-.3,bo=tb>0?M.ease.outBounce(M.clamp(tb/.7)):0,bk=M.range(t,1.05,2.6),pu=1+.14*Math.sin(Math.PI*M.range(t,1,1.3))
@@ -8148,9 +8148,9 @@
8148
8148
  if(bt){const k=Math.max(0,M.spring(t-.45,{freq:1.6,damp:7})),bx=wx+ww*.95-bw/2;ctx.save();ctx.translate(bx,cy2);ctx.scale(k,k);ctx.shadowColor=LM;ctx.shadowBlur=cs*(.6+.5*Math.sin(t*5)**2);ctx.fillStyle=LM;ctx.beginPath();ctx.roundRect(-bw/2,-bh/2,bw,bh,bh/2);ctx.fill();ctx.shadowBlur=0;ctx.fillStyle=BK;ctx.font=MONO(cs*.95,'700');ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(bt,0,cs*.05);ctx.restore()}
8149
8149
  ctx.restore()
8150
8150
  ctx.restore()
8151
- }`,ts=t=>`function render(ctx,t,env){
8151
+ }`,cs=t=>`function render(ctx,t,env){
8152
8152
  // ${t?"Vertical logo typing reveal (9:16)":"Logo typing reveal"}: soft lime blobs drift on paper, the Clipoox flame tile pops in, then slides into the wordmark as it types on letter by letter behind a blinking cursor (the tile stands in for the first o) and the tagline fades in (fields: text = wordmark, sub = tagline, bg).
8153
- ${Ze}${lt}${Te}${Je(t)}${Dc}
8153
+ ${Ze}${lt}${Te}${Je(t)}${Ec}
8154
8154
  BGX(ctx,'paper')
8155
8155
  if(ON(p)){[[.18,.25,.5],[.82,.2,.4],[.3,.85,.45]].forEach((b,i)=>{const x=W*(b[0]+Math.sin(t*.6+i*2)*.04),y=H*(b[1]+Math.cos(t*.5+i)*.04),R=Math.max(W,H)*b[2]*.6,g=ctx.createRadialGradient(x,y,0,x,y,R);g.addColorStop(0,M.rgba(LM,.32));g.addColorStop(1,M.rgba(LM,0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)})
8156
8156
  const wv=Math.sin(t*.8)*H*.02;ctx.fillStyle=M.rgba(LM,.85);ctx.beginPath();ctx.moveTo(W*.55,H);ctx.bezierCurveTo(W*.7,H*.9+wv,W*.78,H*.72,W,H*.62-wv);ctx.lineTo(W,H);ctx.closePath();ctx.fill()}
@@ -8165,9 +8165,9 @@
8165
8165
  ctx.restore()
8166
8166
  const sb=String(p.sub||'');if(sb){const ss=Math.min(TL?VW*.05:VW*.022,fs*sc*.22);ctx.font=MONO(ss,'700');ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle='#4b5046';ctx.globalAlpha=M.range(t,1.2+gap*cs.length,1.6+gap*cs.length);ctx.fillText(sb.toUpperCase(),VC,wy+fs*sc*.78);ctx.globalAlpha=1}
8167
8167
  ctx.restore()
8168
- }`,es=t=>`function render(ctx,t,env){
8168
+ }`,as=t=>`function render(ctx,t,env){
8169
8169
  // ${t?"Vertical ball-pit flood (9:16)":"Ball-pit flood"}: about a thousand glossy lime, black, graphite and white candy balls pour in from the top and pile up until they fill the frame, burying the flame tile, then bright sticker pills pop on top word by word (fields: text with | per sticker line, bg).
8170
- ${Ze}${lt}${Te}${Je(t)}${Dc}${Ba}
8170
+ ${Ze}${lt}${Te}${Je(t)}${Ec}${Ba}
8171
8171
  BGX(ctx,'paper')
8172
8172
  APP(ctx,VC,VM,u*.2*(1+.05*Math.sin(t*4)),M.clamp(M.range(t,0,.3))*(1-M.range(t,1.9,2.3)))
8173
8173
  const r=u*.022,cw=r*2,rh=r*1.74,cols=Math.ceil(W/cw)+1,rows=Math.ceil(H/rh)+2,R=M.rand(97),C=[LM,'#5fd400','#d2ff6e','#141414',GF,'#f4f6f0',LM,'#141414']
@@ -8181,9 +8181,9 @@
8181
8181
  const lh=s*2.3,y0=VM-(L.length-1)*lh/2;let q=0
8182
8182
  words.forEach((w,li)=>{const ws=w.map(x=>PW(s,x)),tot=ws.reduce((a,b)=>a+b,0)+gp*(w.length-1);let x=VC-tot/2;w.forEach((wd,k)=>{const c=PC[q%4],rot=(R2()-.5)*.16,kk=Math.max(0,M.spring(t-2.3-q*.11,{freq:1.7,damp:6}));q++
8183
8183
  ctx.save();ctx.shadowColor='rgba(0,0,0,.3)';ctx.shadowBlur=s*.5;ctx.shadowOffsetY=s*.15;PILL(ctx,x+ws[k]/2,y0+li*lh+(k%2?s*.12:-s*.12),s,wd,c[0],c[1],kk,'#ffffff',rot,.32);ctx.restore();x+=ws[k]+gp})})
8184
- }`,cs=t=>`function render(ctx,t,env){
8184
+ }`,os=t=>`function render(ctx,t,env){
8185
8185
  // ${t?"Vertical pixel face + feature pill (9:16)":"Pixel face + feature pill"}: on light grid paper a big 8-bit pixel face looks around and blinks, small UI task cards float beside it, a notification card pops a lime check, and a two-line lime feature pill names the feature (fields: text with | per pill line, bg).
8186
- ${Ze}${Je(t)}${Ba}${Mo}
8186
+ ${Ze}${Je(t)}${Ba}${yo}
8187
8187
  const g=TL?VW*.05:u*.042
8188
8188
  if(ON(p)){ctx.fillStyle='#e9ebe6';ctx.fillRect(0,0,W,H);ctx.fillStyle='rgba(13,13,13,.07)';for(let x=(VC%g);x<W;x+=g)ctx.fillRect(x,0,1,H);for(let y=(VM%g);y<H;y+=g)ctx.fillRect(0,y,W,1)}
8189
8189
  OUT(ctx,t,D,cx,cy)
@@ -8198,9 +8198,9 @@
8198
8198
  const r=nw*.17;ctx.fillStyle=LM;ctx.beginPath();ctx.arc(0,-nw*.06,r,0,M.TAU);ctx.fill();ctx.strokeStyle=BK;ctx.lineWidth=r*.22;ctx.lineCap='round';ctx.lineJoin='round';ctx.beginPath();ctx.moveTo(-r*.45,-nw*.06);ctx.lineTo(-r*.1,-nw*.06+r*.38);ctx.lineTo(r*.5,-nw*.06-r*.35);ctx.stroke();ctx.fillStyle='#dfe2db';ctx.fillRect(-nw*.3,nw*.2,nw*.6,nw*.05);ctx.restore()}
8199
8199
  const ps=TL?VW*.07:VW*.032;FPILL(TL?VC:VX+VW,TL?VB-ps*2.6:VB-ps*3.2,ps,p.text,.3,TL?'center':'')
8200
8200
  ctx.restore()
8201
- }`,as=t=>`function render(ctx,t,env){
8201
+ }`,ns=t=>`function render(ctx,t,env){
8202
8202
  // ${t?"Vertical glowing core + card orbit (9:16)":"Glowing core + card orbit"}: on black a glowing Clipoox flame core made of vertical light lines beats like a heart while a ring of small UI cards orbits it in perspective (back cards dim, front cards bright), a dot label on top and a lime feature pill (fields: text with | per pill line, sub = top label, bg).
8203
- ${Ze}${Je(t)}${Dc}${Xl}${Ba}${Mo}
8203
+ ${Ze}${Je(t)}${Ec}${Yl}${Ba}${yo}
8204
8204
  BGX(ctx,'dark');OUT(ctx,t,D,cx,cy)
8205
8205
  const hc=TL?VW*.62:VH*.5,ky=TL?VT+VH*.36:VM-VH*.05,bt=1+.06*Math.pow(Math.max(0,Math.sin(t*M.TAU*1.1)),4),ci=M.ease.outCubic(M.range(t,0,.6))
8206
8206
  const N=16,R=(TL?VW*.56:VW*.3)*(2.2-1.2*ci),Ry=R*.26,ry0=ky+hc*.3,cs=TL?VW*.16:VW*.06,CC=[LM,'#d2ff6e','#f4f6f0',GF,'#8a9086']
@@ -8215,9 +8215,9 @@
8215
8215
  const sb=String(p.sub||'');if(sb){const ss=TL?VW*.038:VW*.016;ctx.font=MONO(ss,'700');ctx.textAlign='center';ctx.textBaseline='middle';ctx.globalAlpha=M.range(t,.2,.6);const tw=ctx.measureText(sb).width;ctx.fillStyle=LM;ctx.beginPath();ctx.arc(VC-tw/2-ss*.9,VT+ss,ss*.32,0,M.TAU);ctx.fill();ctx.fillStyle=WH;ctx.fillText(sb,VC,VT+ss);ctx.globalAlpha=1}
8216
8216
  const ps=TL?VW*.07:VW*.032;FPILL(TL?VC:VX+VW,TL?VB-ps*2.6:VB-ps*3.2,ps,p.text,.3,TL?'center':'')
8217
8217
  ctx.restore()
8218
- }`,os=t=>`function render(ctx,t,env){
8218
+ }`,ss=t=>`function render(ctx,t,env){
8219
8219
  // ${t?"Vertical wireframe hologram + customize panel (9:16)":"Wireframe hologram + customize panel"}: an abstract particle wireframe sphere (a brain-like mesh) turns in 3D on black and shifts from red to lime while a customize panel slides in with three sliders (the colour knob drives the shift) and a lime feature pill (fields: text with | per pill line, sub = panel title, items = slider names, bg).
8220
- ${Ze}${Je(t)}${Dc}${Ba}${Mo}
8220
+ ${Ze}${Je(t)}${Ec}${Ba}${yo}
8221
8221
  BGX(ctx,'dark');OUT(ctx,t,D,cx,cy)
8222
8222
  const cm=M.ease.inOutCubic(M.range(t,.9,2.6)),col=M.mix('#ff3b30',LM,cm),mx=TL?VC:VX+VW*.36,my=TL?VT+VH*.22:VM,R=(TL?VW*.32:VH*.34)*M.ease.outCubic(M.range(t,0,.7)),ry=t*.55,rx=.3,f=R*4+1
8223
8223
  const gl=ctx.createRadialGradient(mx,my,0,mx,my,R*1.6+1);gl.addColorStop(0,M.rgba(col,.22));gl.addColorStop(1,M.rgba(col,0));ctx.fillStyle=gl;ctx.fillRect(0,0,W,H)
@@ -8237,9 +8237,9 @@
8237
8237
  ctx.restore()
8238
8238
  const ps=TL?VW*.07:VW*.032;FPILL(TL?VC:VX+VW,TL?VB-ps*2.6:VB-ps*3.2,ps,p.text,.3,TL?'center':'')
8239
8239
  ctx.restore()
8240
- }`,ns=t=>`function render(ctx,t,env){
8240
+ }`,is=t=>`function render(ctx,t,env){
8241
8241
  // ${t?"Vertical card cloud to cube (9:16)":"Card cloud to cube"}: on paper a cloud of tilted UI cards floats in depth around a bold two-line title (the last line on a lime highlight block), then the cards fly together into an isometric cube of card tiles (fields: text with | per title line, bg).
8242
- ${Ze}${Je(t)}${Dc}
8242
+ ${Ze}${Je(t)}${Ec}
8243
8243
  BGX(ctx,'paper');OUT(ctx,t,D,cx,cy)
8244
8244
  const ccx=TL?VC:VX+VW*.76,ccy=TL?VT+VH*.7:VM+VH*.04,a=(TL?VW*.5:VH*.46)/3/1.7,ex=[.866*a,.5*a],ey=[-.866*a,.5*a],ez=[0,-a],pt=(x,y,z)=>[ccx+ex[0]*(x-1.5)+ey[0]*(y-1.5),ccy+ex[1]*(x-1.5)+ey[1]*(y-1.5)+ez[1]*(z-1.5)]
8245
8245
  const T=[];for(let f=0;f<3;f++)for(let i=0;i<3;i++)for(let j=0;j<3;j++){const c=f===0?[[i,j,3],[i+1,j,3],[i+1,j+1,3],[i,j+1,3]]:f===1?[[3,i,j],[3,i+1,j],[3,i+1,j+1],[3,i,j+1]]:[[i,3,j],[i+1,3,j],[i+1,3,j+1],[i,3,j+1]];T.push({f,q:c.map(v=>pt(v[0],v[1],v[2]))})}
@@ -8257,9 +8257,9 @@
8257
8257
  ctx.fillStyle=BK;ctx.fillText(l,xl,y+fs*.04)})
8258
8258
  ctx.globalAlpha=1
8259
8259
  ctx.restore()
8260
- }`,ss=t=>`function render(ctx,t,env){
8260
+ }`,ls=t=>`function render(ctx,t,env){
8261
8261
  // ${t?"Vertical light-ray end logo (9:16)":"Light-ray end logo"}: on black, lime light rays fan out from behind a big white italic wordmark that flickers on with a chromatic glitch, a small kicker above and the Clipoox flame tile with the site under it — the end logo (fields: text = wordmark, sub = kicker, bg).
8262
- ${Ze}${lt}${Te}${Je(t)}${Dc}
8262
+ ${Ze}${lt}${Te}${Je(t)}${Ec}
8263
8263
  BGX(ctx,'dark')
8264
8264
  const ty=TL?VM-VH*.06:VM-VH*.04,ri=M.ease.outExpo(M.range(t,0,.5)),rl=Math.max(W,H)
8265
8265
  if(ON(p)){const g=ctx.createRadialGradient(VC,ty,0,VC,ty,rl*.8);g.addColorStop(0,M.rgba(LM,.75));g.addColorStop(.35,M.rgba(LM,.18));g.addColorStop(1,M.rgba(LM,0));ctx.fillStyle=g
@@ -8274,7 +8274,7 @@
8274
8274
  const ts=TL?VW*.12:VW*.045,by=ty+fsz*.8+ts*.8,url=String(p.url||''),k=Math.max(0,M.spring(t-.35,{freq:1.6,damp:7}));ctx.font=sk.font(ts*.5,'s','700');const uw=url?ctx.measureText(url).width+ts*.35:0,x0=VC-(ts+uw)/2
8275
8275
  APP(ctx,x0+ts/2,by,ts*k,M.clamp(k));if(url){ctx.textAlign='left';ctx.fillStyle=WH;ctx.globalAlpha=M.clamp(k);ctx.fillText(url,x0+ts+ts*.35,by);ctx.globalAlpha=1}
8276
8276
  ctx.restore()
8277
- }`,is=t=>`function render(ctx,t,env){
8277
+ }`,rs=t=>`function render(ctx,t,env){
8278
8278
  // ${t?"Vertical end credit caption (9:16)":"End credit caption"}: a quiet closing end card — a small flame tile and two short centred caption lines in small caps fade in on off-white (graphite when dark is on) and hold (fields: text with | per line, dark, bg).
8279
8279
  ${Ze}${lt}${Te}${Je(t)}
8280
8280
  const dk=p.dark===true||p.dark==='true'||p.dark===1;if(ON(p)){ctx.fillStyle=dk?'#1b1d1c':'#f6f7f3';ctx.fillRect(0,0,W,H)}
@@ -8283,7 +8283,7 @@
8283
8283
  const ts=fs*2.6,lh=fs*1.45,y0=VM-(L.length-1)*lh/2+ts*.45
8284
8284
  const xc=Math.min(cx,VX+VW-mw*fs/(TL?VW*.045:Math.min(VW*.022,u*.034))/2);APP(ctx,xc,y0-ts*.95-(1-a)*fs,ts,a)
8285
8285
  ctx.font=sk.font(fs,'s','700');ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=dk?'#e8ebe4':'#141614';ctx.globalAlpha=a;L.forEach((l,i)=>ctx.fillText(l,xc,y0+i*lh+(1-a)*fs*.5));ctx.globalAlpha=1
8286
- }`,Fl=[G("clipoox-logo-title","Logo + tiêu đề nảy chữ",4,{brand:"Clipoox",text:"MOTION",sub:"AI VIDEO",badge:"TẶNG THÊM CREDIT"},`function render(ctx,t,env){
8286
+ }`,_l=[G("clipoox-logo-title","Logo + tiêu đề nảy chữ",4,{brand:"Clipoox",text:"MOTION",sub:"AI VIDEO",badge:"TẶNG THÊM CREDIT"},`function render(ctx,t,env){
8287
8287
  // Logo title: the Clipoox flame springs in beside a wordmark that types itself through scrambled letters, the big title drops in letter by letter at uneven heights and settles on a lime extrusion, lime brackets slide apart to reveal the sub, a lime pill badge pops under it (fields: brand, text, sub, badge, bg).
8288
8288
  ${Xt}${ht}
8289
8289
  OUT(ctx,t,D,cx,cy)
@@ -8505,7 +8505,7 @@
8505
8505
  ctx.restore()
8506
8506
  }`),G("clipoox-title-sparkle","Tiêu đề lấp lánh trên video",3.5,{text:"motion",sub:"Studio",brand:"Clipoox",badge:"DÙNG THỬ MIỄN PHÍ",bg:!1},`function render(ctx,t,env){
8507
8507
  // Title sparkle: a lime glitter grid flashes out from the centre over the footage, the title types in through scrambled letters with sparkles beside it, the slanted second word whips in from the right, the white Clipoox flame + name and a glowing lime pill land under it (fields: text, sub, brand, badge, bg; transparent over video by default).
8508
- ${K}${lt}${Ra}${et}${Pa}${$l}${ct}
8508
+ ${K}${lt}${Ra}${et}${Pa}${Fl}${ct}
8509
8509
  // glitter grid
8510
8510
  const gk=M.range(t,0,.8);if(gk<1){const s=u*.024,R=M.rand(4),wave=gk*1.3;ctx.save();ctx.fillStyle=M.rgba(LM,.18*(1-gk));ctx.fillRect(0,0,W,H)
8511
8511
  for(let x=s/2;x<W;x+=s)for(let y=s/2;y<H;y+=s){const r=R(),d=Math.hypot((x-cx)/W,(y-cy)/H)*1.6,a=Math.max(0,1-Math.abs(d-wave)*5)*(r>.45?1:.25)*(1-gk);if(a>.03){ctx.globalAlpha=a;ctx.fillStyle=r>.8?'#ffffff':LM;ctx.fillRect(x-s*.22,y-s*.22,s*.44,s*.44)}}ctx.restore()}
@@ -8556,7 +8556,7 @@
8556
8556
  ctx.restore()
8557
8557
  }`),G("clipoox-url-analyze","Nhập website + Phân tích",4,{chip:"CLIPOOX STUDIO",text:"NHẬP WEBSITE CỦA BẠN",url:"quan-pho-ba-ha.vn",button:"Phân tích ✦"},`function render(ctx,t,env){
8558
8558
  // URL analyze: a lime badge and the headline rise in, the input box types the website with a blinking caret, its border starts to glow lime, the glowing Analyze button is pressed (squash, ring burst, sparks) and the camera rushes into it (fields: chip, text, url, button, bg).
8559
- ${K}${lt}${et}${Pa}${Xn}${ct}
8559
+ ${K}${lt}${et}${Pa}${Yn}${ct}
8560
8560
  const pz=M.ease.inExpo(M.range(t,D-.55,D)),s=u*(PT?.065:.08),hy=cy-s*2.6,iy=cy,by=cy+s*2.1
8561
8561
  ctx.save();ctx.translate(cx,by);ctx.scale(1+pz*4,1+pz*4);ctx.translate(-cx,-by);ctx.globalAlpha=1-M.range(t,D-.15,D)
8562
8562
  CHIP(ctx,cx,hy-s*1.6,String(p.chip||''),s*.36,M.range(t,0,.3))
@@ -8635,7 +8635,7 @@
8635
8635
  ctx.restore();ctx.restore()
8636
8636
  }`),G("clipoox-count-ruler","Thước đếm số lượng",4,{chip:"CLIPOOX STUDIO",text:"TẠO BAO NHIÊU QUẢNG CÁO?",values:"29|21|25|100"},`function render(ctx,t,env){
8637
8637
  // Count ruler: a lime badge and the question sit at the top, a big glowing lime number rolls through the values while a tick ruler scrolls under a glowing lime needle, four product thumbnails show their own small counters (fields: chip, text, values with |, bg).
8638
- ${K}${lt}${et}${Xn}${ct}
8638
+ ${K}${lt}${et}${Yn}${ct}
8639
8639
  OUT(ctx,t,D,cx,cy)
8640
8640
  const vs=String(p.values||'').split('|').map(Number).filter(Number.isFinite);if(!vs.length)vs.push(10)
8641
8641
  const seg=(D-.6)/vs.length,i=Math.min(vs.length-1,Math.floor(t/seg)),pr=vs[Math.max(0,i-1)],k=i?M.ease.inOutCubic(M.range(t-i*seg,0,.45)):1,v=M.lerp(pr,vs[i],k),s=u*(PT?.06:.075),y0=cy-s*3.4
@@ -8707,7 +8707,7 @@
8707
8707
  ctx.restore()
8708
8708
  }`),G("clipoox-counter-dots","Đếm số + chấm tiến độ",4,{from:25,to:300,text:"TỪ 25 ĐẾN 300 CREDIT MỖI GÓI",dots:12},`function render(ctx,t,env){
8709
8709
  // Counter dots: over a dark background with a giant faint flame watermark, a number counts up from one value to another while a row of dots lights up lime one by one, then the sentence under it lights word by word in a lime-to-white gradient (fields: from, to, text, dots, bg).
8710
- ${K}${lt}${et}${za}${Fn}${ct}
8710
+ ${K}${lt}${et}${za}${_n}${ct}
8711
8711
  WM(ctx,W,H,u,t);OUT(ctx,t,D,cx,cy)
8712
8712
  const v0=+p.from||0,v1=Number.isFinite(+p.to)?+p.to:100,ck=M.ease.inOutCubic(M.range(t,.5,2.4)),v=Math.round(M.lerp(v0,v1,ck)),n=Math.max(3,Math.min(20,Math.round(+p.dots||12))),s=u*(PT?.06:.065),y0=cy-s*1.6
8713
8713
  const fmt=M.fmt;ctx.textAlign='center';ctx.textBaseline='middle';ctx.font=sk.font(s*1.1,'n','900');const nk=M.range(t,0,.3)
@@ -8728,7 +8728,7 @@
8728
8728
  ctx.restore()
8729
8729
  }`),G("clipoox-glass-thanks","Cảm ơn trong khung kính",3.5,{text:"CẢM ƠN BẠN ĐÃ",pill:"SÁNG TẠO CÙNG CLIPOOX."},`function render(ctx,t,env){
8730
8730
  // Glass thanks: over the dark flame watermark a small white line rises in, then a dark glass pill with a glowing white rim opens under it holding a shimmering lime-to-white line; at the end the first line leaves and the pill settles in the centre (fields: text, pill, bg).
8731
- ${K}${lt}${et}${za}${Fn}${ct}
8731
+ ${K}${lt}${et}${za}${_n}${ct}
8732
8732
  WM(ctx,W,H,u,t);OUT(ctx,t,D,cx,cy)
8733
8733
  const s=u*(PT?.055:.06),la=String(p.text||'').toUpperCase(),lb=String(p.pill||'').toUpperCase(),mv=M.ease.inOutCubic(M.range(t,D-1.1,D-.6)),yA=cy-s*.75,yB=cy+s*.55-mv*s*.55
8734
8734
  ctx.textAlign='center';ctx.textBaseline='middle'
@@ -8766,7 +8766,7 @@
8766
8766
  f.lines.forEach((l,i)=>{ctx.globalAlpha=M.range(t,.1+i*.12,.4+i*.12)*(1-M.range(t,D-.25,D));ctx.fillText(l,W/2,H/2+(i-(f.lines.length-1)/2)*f.lh*1.05)})
8767
8767
  }`),G("clipoox-coin-rain","Mưa xu + tiêu đề",4,{num:"TẶNG",text:"THÊM CREDIT",pill:"KHI NẠP GÓI CLIPOOX"},`function render(ctx,t,env){
8768
8768
  // Coin rain: glossy lime coins stamped with the flame tumble down past the camera (near ones blurred), the big number pops, the word slides out between lime brackets and a black pill with lime text lands under it (fields: num, text, pill, bg).
8769
- ${K}${lt}${ye}${Yn}${ht}
8769
+ ${K}${lt}${ye}${Qn}${ht}
8770
8770
  OUT(ctx,t,D,cx,cy)
8771
8771
  const R=M.rand(12),cs=[];for(let i=0;i<20;i++)cs.push({x:R(),z:R(),s:R(),ph:R()*6,sp:.6+R()*.8,w:R()*2-1})
8772
8772
  cs.sort((a,b)=>a.z-b.z)
@@ -8783,7 +8783,7 @@
8783
8783
  ctx.restore()
8784
8784
  }`),G("clipoox-chip-circuit","Chip API + mạch sáng",4,{brand:"CLIPOOX",label:"{MCP}",tags:"+25 CR|+100 CR|+300 CR"},`function render(ctx,t,env){
8785
8785
  // Chip circuit: a thick lime API chip turns slightly in 3D, glowing lime circuit traces draw out from its sides at right angles, and at their ends stacks of coins pop up with dark value tags (fields: brand, label, tags with |, bg).
8786
- ${K}${lt}${ye}${Yn}${ht}
8786
+ ${K}${lt}${ye}${Qn}${ht}
8787
8787
  OUT(ctx,t,D,cx,cy)
8788
8788
  const s=u*(PT?.26:.24),sk2=.12*Math.sin(t*.8),ck=Math.max(0,M.spring(t-.05,{freq:1.3,damp:7}))
8789
8789
  const TR=[[[-.5,-.2],[-1.2,-.2],[-1.2,-.75],[-2.2,-.75]],[[.5,.15],[1.3,.15],[1.3,.6],[2.3,.6]],[[0,-.5],[0,-1],[.9,-1],[.9,-1.6]],[[-.5,.3],[-1,.3],[-1,1],[-1.9,1]],[[.5,-.3],[1.7,-.3],[1.7,-1.1]]]
@@ -9290,8 +9290,8 @@
9290
9290
  const k=M.ease.outExpo(M.range(t,.15,.8)),y=rh*(mid+.5);ctx.font=sk.font(fs,'n','900');const sw=ctx.measureText(tx).width,sc=Math.min(1,VW/sw);ctx.save();ctx.translate(cx+(1-k)*W,y);ctx.scale(sc,sc);ctx.textAlign='center';ctx.shadowColor=LM;ctx.shadowBlur=fs*.3;ctx.fillStyle=LM;ctx.fillText(tx,0,fs*.04);ctx.restore()
9291
9291
  const sb=String(p.sub||'');if(sb){const pk=Math.max(0,M.spring(t-.7,{freq:1.6,damp:6})),ss=Math.min(rh*.22,VW*.05);ctx.font=MONO(ss,'700');const pw=ctx.measureText(sb).width+ss*1.8,ph=ss*2;ctx.save();ctx.translate(cx,y+fs*sc*.5+ph*.9);ctx.scale(pk,pk);ctx.fillStyle=DB;ctx.strokeStyle=LM;ctx.lineWidth=Math.max(1,ss*.1);ctx.beginPath();ctx.roundRect(-pw/2,-ph/2,pw,ph,ph/2);ctx.fill();ctx.stroke();ctx.fillStyle=WH;ctx.textAlign='center';ctx.fillText(sb,0,ss*.05);ctx.restore()}
9292
9292
  ctx.restore()
9293
- }`),Qe("clipoox-prompt-box","Ô lệnh AI gõ chữ",4,{text:"Làm video ra mắt sản phẩm mới cho thương hiệu của tôi",sub:"Thương hiệu của bạn",brand:"Clipoox"},_n(0)),mt("clipoox-v-prompt-box","Dọc: ô lệnh AI gõ chữ",4,{text:"Làm video ra mắt sản phẩm mới cho thương hiệu của tôi",sub:"Thương hiệu của bạn",brand:"Clipoox"},_n(1)),Qe("clipoox-glitch-slam","Tiêu đề glitch nháy nền",2.6,{text:"CLIPOOX",sub:"AI VIDEO STUDIO",accent2:"#2f4dff"},Qn(0)),mt("clipoox-v-glitch-slam","Dọc: tiêu đề glitch nháy nền",2.6,{text:"CLIPOOX",sub:"AI VIDEO STUDIO",accent2:"#2f4dff"},Qn(1)),Qe("clipoox-status-shimmer","Dòng trạng thái ánh lướt",3.4,{items:"Đang phân tích sản phẩm…|Đang tìm cảm hứng…|Đang dựng video…"},Zn(0)),mt("clipoox-v-status-shimmer","Dọc: dòng trạng thái ánh lướt",3.4,{items:"Đang phân tích sản phẩm…|Đang tìm cảm hứng…|Đang dựng video…"},Zn(1)),Qe("clipoox-window-burst","Cửa sổ app bung pháo giấy",3.2,{text:"Video ra mắt của bạn",sub:"XEM NGAY"},Jn(0)),mt("clipoox-v-window-burst","Dọc: cửa sổ app bung pháo giấy",3.2,{text:"Video ra mắt của bạn",sub:"XEM NGAY"},Jn(1)),Qe("clipoox-logo-type","Gõ tên thương hiệu + ngọn lửa",3.2,{text:"Clipoox",sub:"AI video studio"},ts(0)),mt("clipoox-v-logo-type","Dọc: gõ tên thương hiệu + ngọn lửa",3.2,{text:"Clipoox",sub:"AI video studio"},ts(1)),Qe("clipoox-ball-pit","Bể bóng tràn khung + nhãn dán",4,{text:"Để AI lo|việc của bạn"},es(0)),mt("clipoox-v-ball-pit","Dọc: bể bóng tràn khung + nhãn dán",4,{text:"Để AI lo|việc của bạn"},es(1)),Qe("clipoox-pixel-face","Mặt pixel + nhãn tính năng",3.5,{text:"AI Editor|tự dựng video"},cs(0)),mt("clipoox-v-pixel-face","Dọc: mặt pixel + nhãn tính năng",3.5,{text:"AI Editor|tự dựng video"},cs(1)),Qe("clipoox-core-orbit","Lõi ngọn lửa + vòng thẻ quay",4,{text:"Mọi model AI|trong một nơi",sub:"CLIPOOX STUDIO"},as(0)),mt("clipoox-v-core-orbit","Dọc: lõi ngọn lửa + vòng thẻ quay",4,{text:"Mọi model AI|trong một nơi",sub:"CLIPOOX STUDIO"},as(1)),Qe("clipoox-holo-mesh","Lưới hologram + bảng tuỳ chỉnh",4,{text:"Tuỳ chỉnh|từng chi tiết",sub:"Tuỳ chỉnh",items:"Tỉ lệ|Màu sắc|Độ sáng"},os(0)),mt("clipoox-v-holo-mesh","Dọc: lưới hologram + bảng tuỳ chỉnh",4,{text:"Tuỳ chỉnh|từng chi tiết",sub:"Tuỳ chỉnh",items:"Tỉ lệ|Màu sắc|Độ sáng"},os(1)),Qe("clipoox-card-cube","Đám thẻ bay ghép khối",4,{text:"Không lo deadline|Dựng video nhanh"},ns(0)),mt("clipoox-v-card-cube","Dọc: đám thẻ bay ghép khối",4,{text:"Không lo deadline|Dựng video nhanh"},ns(1)),Qe("clipoox-ray-logo","Logo kết tia sáng",3.2,{text:"CLIPOOX",sub:"Video dựng bằng",url:"clipoox.com"},ss(0)),mt("clipoox-v-ray-logo","Dọc: logo kết tia sáng",3.2,{text:"CLIPOOX",sub:"Video dựng bằng",url:"clipoox.com"},ss(1)),Qe("clipoox-end-credit","Dòng chữ kết nhỏ",2.6,{text:"Clipoox — AI video studio|Dùng thử tại clipoox.com",dark:!1},is(0)),mt("clipoox-v-end-credit","Dọc: dòng chữ kết nhỏ",2.6,{text:"Clipoox — AI video studio|Dùng thử tại clipoox.com",dark:!1},is(1))],ls=Y.find(t=>t.id==="prodreview"),Ec=(t,e,c,o,n)=>({id:t,name:e,category:ls.name,pack:"prodreview",duration:c,params:{accent:ls.accent,position:"center",...o,style:"prodreview"},code:n}),qc="const INK='#2b2230';const TXT=(c,s,x,y,z,fill)=>{const f=fill||'#ffffff',dk=M.readable(f)==='#ffffff';c.save();c.shadowColor=dk?'rgba(255,255,255,.55)':'rgba(0,0,0,.4)';c.shadowBlur=z*(dk?.3:.24);c.shadowOffsetY=dk?0:z*.05;c.fillStyle=f;c.fillText(s,x,y);c.restore()};const IN=(t,D,a,b)=>{const i=M.ease.outCubic(M.range(t,0,a)),o=M.ease.inCubic(M.range(t,D-b,D));return{a:i*(1-o),bl:Math.max(1-i,o)}};const BL=(c,u,k)=>{c.filter=k>.02?'blur('+Math.round(k*u*.016*10)/10+'px)':'none'};const TICK=(c,x,y,r,col,k)=>{c.save();c.strokeStyle=col;c.lineWidth=r*.22;c.lineCap='round';c.lineJoin='round';c.beginPath();const a=[x-r*.45,y+r*.02],b=[x-r*.12,y+r*.34],d=[x+r*.5,y-r*.32],q=Math.min(1,k*2),w=Math.max(0,k*2-1);c.moveTo(a[0],a[1]);c.lineTo(a[0]+(b[0]-a[0])*q,a[1]+(b[1]-a[1])*q);if(w>0)c.lineTo(b[0]+(d[0]-b[0])*w,b[1]+(d[1]-b[1])*w);c.stroke();c.restore()};",Yl=[Ec("rv-step-caption","Chú thích bước",3,{text:"Dầu gội",sub:"Bước",number:1},`function render(ctx,t,env){
9294
- ${qc}
9293
+ }`),Qe("clipoox-prompt-box","Ô lệnh AI gõ chữ",4,{text:"Làm video ra mắt sản phẩm mới cho thương hiệu của tôi",sub:"Thương hiệu của bạn",brand:"Clipoox"},Zn(0)),mt("clipoox-v-prompt-box","Dọc: ô lệnh AI gõ chữ",4,{text:"Làm video ra mắt sản phẩm mới cho thương hiệu của tôi",sub:"Thương hiệu của bạn",brand:"Clipoox"},Zn(1)),Qe("clipoox-glitch-slam","Tiêu đề glitch nháy nền",2.6,{text:"CLIPOOX",sub:"AI VIDEO STUDIO",accent2:"#2f4dff"},Jn(0)),mt("clipoox-v-glitch-slam","Dọc: tiêu đề glitch nháy nền",2.6,{text:"CLIPOOX",sub:"AI VIDEO STUDIO",accent2:"#2f4dff"},Jn(1)),Qe("clipoox-status-shimmer","Dòng trạng thái ánh lướt",3.4,{items:"Đang phân tích sản phẩm…|Đang tìm cảm hứng…|Đang dựng video…"},ts(0)),mt("clipoox-v-status-shimmer","Dọc: dòng trạng thái ánh lướt",3.4,{items:"Đang phân tích sản phẩm…|Đang tìm cảm hứng…|Đang dựng video…"},ts(1)),Qe("clipoox-window-burst","Cửa sổ app bung pháo giấy",3.2,{text:"Video ra mắt của bạn",sub:"XEM NGAY"},es(0)),mt("clipoox-v-window-burst","Dọc: cửa sổ app bung pháo giấy",3.2,{text:"Video ra mắt của bạn",sub:"XEM NGAY"},es(1)),Qe("clipoox-logo-type","Gõ tên thương hiệu + ngọn lửa",3.2,{text:"Clipoox",sub:"AI video studio"},cs(0)),mt("clipoox-v-logo-type","Dọc: gõ tên thương hiệu + ngọn lửa",3.2,{text:"Clipoox",sub:"AI video studio"},cs(1)),Qe("clipoox-ball-pit","Bể bóng tràn khung + nhãn dán",4,{text:"Để AI lo|việc của bạn"},as(0)),mt("clipoox-v-ball-pit","Dọc: bể bóng tràn khung + nhãn dán",4,{text:"Để AI lo|việc của bạn"},as(1)),Qe("clipoox-pixel-face","Mặt pixel + nhãn tính năng",3.5,{text:"AI Editor|tự dựng video"},os(0)),mt("clipoox-v-pixel-face","Dọc: mặt pixel + nhãn tính năng",3.5,{text:"AI Editor|tự dựng video"},os(1)),Qe("clipoox-core-orbit","Lõi ngọn lửa + vòng thẻ quay",4,{text:"Mọi model AI|trong một nơi",sub:"CLIPOOX STUDIO"},ns(0)),mt("clipoox-v-core-orbit","Dọc: lõi ngọn lửa + vòng thẻ quay",4,{text:"Mọi model AI|trong một nơi",sub:"CLIPOOX STUDIO"},ns(1)),Qe("clipoox-holo-mesh","Lưới hologram + bảng tuỳ chỉnh",4,{text:"Tuỳ chỉnh|từng chi tiết",sub:"Tuỳ chỉnh",items:"Tỉ lệ|Màu sắc|Độ sáng"},ss(0)),mt("clipoox-v-holo-mesh","Dọc: lưới hologram + bảng tuỳ chỉnh",4,{text:"Tuỳ chỉnh|từng chi tiết",sub:"Tuỳ chỉnh",items:"Tỉ lệ|Màu sắc|Độ sáng"},ss(1)),Qe("clipoox-card-cube","Đám thẻ bay ghép khối",4,{text:"Không lo deadline|Dựng video nhanh"},is(0)),mt("clipoox-v-card-cube","Dọc: đám thẻ bay ghép khối",4,{text:"Không lo deadline|Dựng video nhanh"},is(1)),Qe("clipoox-ray-logo","Logo kết tia sáng",3.2,{text:"CLIPOOX",sub:"Video dựng bằng",url:"clipoox.com"},ls(0)),mt("clipoox-v-ray-logo","Dọc: logo kết tia sáng",3.2,{text:"CLIPOOX",sub:"Video dựng bằng",url:"clipoox.com"},ls(1)),Qe("clipoox-end-credit","Dòng chữ kết nhỏ",2.6,{text:"Clipoox — AI video studio|Dùng thử tại clipoox.com",dark:!1},rs(0)),mt("clipoox-v-end-credit","Dọc: dòng chữ kết nhỏ",2.6,{text:"Clipoox — AI video studio|Dùng thử tại clipoox.com",dark:!1},rs(1))],xs=Y.find(t=>t.id==="prodreview"),qc=(t,e,c,o,n)=>({id:t,name:e,category:xs.name,pack:"prodreview",duration:c,params:{accent:xs.accent,position:"center",...o,style:"prodreview"},code:n}),Gc="const INK='#2b2230';const TXT=(c,s,x,y,z,fill)=>{const f=fill||'#ffffff',dk=M.readable(f)==='#ffffff';c.save();c.shadowColor=dk?'rgba(255,255,255,.55)':'rgba(0,0,0,.4)';c.shadowBlur=z*(dk?.3:.24);c.shadowOffsetY=dk?0:z*.05;c.fillStyle=f;c.fillText(s,x,y);c.restore()};const IN=(t,D,a,b)=>{const i=M.ease.outCubic(M.range(t,0,a)),o=M.ease.inCubic(M.range(t,D-b,D));return{a:i*(1-o),bl:Math.max(1-i,o)}};const BL=(c,u,k)=>{c.filter=k>.02?'blur('+Math.round(k*u*.016*10)/10+'px)':'none'};const TICK=(c,x,y,r,col,k)=>{c.save();c.strokeStyle=col;c.lineWidth=r*.22;c.lineCap='round';c.lineJoin='round';c.beginPath();const a=[x-r*.45,y+r*.02],b=[x-r*.12,y+r*.34],d=[x+r*.5,y-r*.32],q=Math.min(1,k*2),w=Math.max(0,k*2-1);c.moveTo(a[0],a[1]);c.lineTo(a[0]+(b[0]-a[0])*q,a[1]+(b[1]-a[1])*q);if(w>0)c.lineTo(b[0]+(d[0]-b[0])*w,b[1]+(d[1]-b[1])*w);c.stroke();c.restore()};",Ql=[qc("rv-step-caption","Chú thích bước",3,{text:"Dầu gội",sub:"Bước",number:1},`function render(ctx,t,env){
9294
+ ${Gc}
9295
9295
  // Step caption for a routine / product review: two centred lines in bold white caps (color = the text colour; a dark one gets a soft light glow) with a soft shadow — the step
9296
9296
  // label (sub, e.g. BƯỚC / STEP) with its number (numberValue), then the step or product name (text, up to 2 lines); it
9297
9297
  // blurs in over 6 frames, holds, fades out, and a short brand-accent rule grows under it.
@@ -9306,8 +9306,8 @@
9306
9306
  if(l2){ctx.font=f2.font;f2.lines.forEach((l,i)=>TXT(ctx,l,S.cx,y0+h1+(i+.5)*f2.size*1.24,f2.size,sk.fill))}
9307
9307
  const g=M.ease.outCubic(M.range(t,.15,.65)),bw=u*.1*g;ctx.filter='none';if(bw>0){ctx.fillStyle=sk.acc;M.rr(ctx,S.cx-bw/2,y0+h1+h2+u*.014,bw,u*.008,u*.004);ctx.fill()}
9308
9308
  ctx.restore()
9309
- }`),Ec("rv-instruction","Chú thích hướng dẫn",3,{text:"Thoa lên tóc sau dầu xả"},`function render(ctx,t,env){
9310
- ${qc}
9309
+ }`),qc("rv-instruction","Chú thích hướng dẫn",3,{text:"Thoa lên tóc sau dầu xả"},`function render(ctx,t,env){
9310
+ ${Gc}
9311
9311
  // Instruction caption for a routine / how-to review: what to do now (text — "thoa lên tóc", "đợi 5 phút") in bold
9312
9312
  // white caps with a soft shadow, centred on one or two lines; blurs in over 6 frames, holds, fades out.
9313
9313
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),u=S.u,k=IN(t,D,.2,.22),s=String(p.text||'').trim().toUpperCase()
@@ -9317,8 +9317,8 @@
9317
9317
  ctx.translate(S.cx,S.y);ctx.scale(sc,sc);ctx.translate(-S.cx,-S.y);BL(ctx,u,k.bl);ctx.font=f.font
9318
9318
  f.lines.forEach((l,i)=>TXT(ctx,l,S.cx,S.y-h/2+(i+.5)*f.size*1.24,f.size,sk.fill))
9319
9319
  ctx.restore()
9320
- }`),Ec("rv-brand-watermark","Logo chìm thương hiệu",10,{text:"LUMIO",sub:"",number:0,position:"lower"},`function render(ctx,t,env){
9321
- ${qc}
9320
+ }`),qc("rv-brand-watermark","Logo chìm thương hiệu",10,{text:"LUMIO",sub:"",number:0,position:"lower"},`function render(ctx,t,env){
9321
+ ${Gc}
9322
9322
  // Brand watermark: the brand wordmark (text) small, letter-spaced, white at 85 % with a soft shadow, bottom-centre
9323
9323
  // (placement top = near the top) for the whole video, an optional tiny line (sub) under it. numberValue 1 = continues
9324
9324
  // a previous piece (no fade-in), 2 = continues into a next piece (no fade-out), 3 = both.
@@ -9330,8 +9330,8 @@
9330
9330
  const f=M.fit(ctx,s,z=>sk.font(z,'h'),u*.046,W*.5,1);ctx.font=f.font;M.ls(ctx,f.size*.18);TXT(ctx,f.lines[0],W/2+f.size*.09,y,f.size)
9331
9331
  const sub=String(p.sub||'').trim().toUpperCase();if(sub){const g=M.fit(ctx,sub,z=>sk.font(z,'q','600'),u*.016,W*.4,1);ctx.font=g.font;M.ls(ctx,g.size*.5);TXT(ctx,g.lines[0],W/2+g.size*.25,y+f.size*.78,g.size)}
9332
9332
  M.ls(ctx,0);ctx.restore()
9333
- }`),Ec("rv-logo-open","Mở logo thương hiệu",2.6,{text:"LUMIO",sub:"",number:0},`function render(ctx,t,env){
9334
- ${qc}
9333
+ }`),qc("rv-logo-open","Mở logo thương hiệu",2.6,{text:"LUMIO",sub:"",number:0},`function render(ctx,t,env){
9334
+ ${Gc}
9335
9335
  // Logo open over the first shot: a ring draws round and the brand initials pop in it, then the mark slides up and
9336
9336
  // fades while the wordmark (text) resolves letter by letter from wide tracking with a blur, a thin brand-accent line
9337
9337
  // under it and an optional tagline (sub); numberValue 1 = the real logo image sits above (no drawn mark).
@@ -9346,8 +9346,8 @@
9346
9346
  const lw=u*.16*M.ease.outCubic(M.range(t,1.1,1.6));if(lw>0){ctx.fillStyle=acc;ctx.fillRect(S.cx-lw/2,wy+f.size*.72,lw,u*.005)}
9347
9347
  const sub=String(p.sub||'').trim();if(sub){const g=M.fit(ctx,sub.toUpperCase(),z=>sk.font(z,'q','600'),u*.026,S.w*.8,1);ctx.font=g.font;M.ls(ctx,g.size*.35);ctx.globalAlpha=out*M.range(t,1.3,1.7);TXT(ctx,g.lines[0],S.cx,wy+f.size*1.15,g.size);M.ls(ctx,0)}}
9348
9348
  ctx.restore()
9349
- }`),Ec("rv-packshot-title","Packshot sản phẩm",3,{text:"Bộ dưỡng Glow",sub:"Mới",items:"LUMIO|SKINCARE",number:0},`function render(ctx,t,env){
9350
- ${qc}
9349
+ }`),qc("rv-packshot-title","Packshot sản phẩm",3,{text:"Bộ dưỡng Glow",sub:"Mới",items:"LUMIO|SKINCARE",number:0},`function render(ctx,t,env){
9350
+ ${Gc}
9351
9351
  // Packshot title card, full frame: a clean pastel backdrop tinted by the brand colour with a soft light, the brand
9352
9352
  // wordmark on top (items[0], a tiny line items[1]), a small NEW tag (sub), the product name big in the brand colour
9353
9353
  // (text, up to 2 lines) and a soft pedestal with its shadow where the product image (a media clip above) stands;
@@ -9366,8 +9366,8 @@
9366
9366
  const nf=M.fit(ctx,bare?'':String(p.text||'').toUpperCase(),q=>sk.font(q,'h'),u*.105,tw,2);ctx.font=nf.font
9367
9367
  nf.lines.forEach((l,i)=>{const a=M.ease.outCubic(M.range(t,.35+i*.12,.8+i*.12));ctx.save();ctx.globalAlpha=a;BL(ctx,u,1-a);ctx.fillStyle=acc;ctx.fillText(l,cx,y+nf.size*.55+i*nf.size*1.08+(1-a)*u*.03);ctx.restore()})
9368
9368
  ctx.restore()
9369
- }`),Ec("rv-product-callout","Nhãn chỉ sản phẩm",3.5,{text:"Serum dưỡng",sub:"Cấp ẩm 72 giờ",posX:-.2,posY:.18},`function render(ctx,t,env){
9370
- ${qc}
9369
+ }`),qc("rv-product-callout","Nhãn chỉ sản phẩm",3.5,{text:"Serum dưỡng",sub:"Cấp ẩm 72 giờ",posX:-.2,posY:.18},`function render(ctx,t,env){
9370
+ ${Gc}
9371
9371
  // Product call-out: a pulsing brand-accent dot on the product (posX / posY from the centre, -1..1), a thin leader
9372
9372
  // line drawing out to a white pill label with the product name (text) and a key benefit or the price (sub) under it.
9373
9373
  const {duration:D,params:p}=env,W=env.width,H=env.height,u=Math.min(W,H),sk=M.skin(env,p),acc=sk.acc,k=M.io(t,D,.3,.3)
@@ -9382,8 +9382,8 @@
9382
9382
  ctx.fillStyle=acc;ctx.fillRect(bx+u*.022,ly-bh/2+u*.022,u*.006,bh-u*.044);ctx.textAlign='left';ctx.textBaseline='middle';ctx.font=nf.font;ctx.fillStyle=INK;ctx.fillText(nf.lines[0]||'',bx+u*.045,ly-(p.sub?sf.size*.62:0))
9383
9383
  if(p.sub){ctx.font=sf.font;ctx.fillStyle=M.mix(acc,'#000000',.15);ctx.fillText(sf.lines[0]||'',bx+u*.045,ly+nf.size*.62)}ctx.restore()}
9384
9384
  ctx.restore()
9385
- }`),Ec("rv-benefit-list","Danh sách lợi ích",4.5,{text:"Vì sao nên dùng",items:"Mềm mượt tức thì|Tóc bóng 72 giờ|Không bết dính"},`function render(ctx,t,env){
9386
- ${qc}
9385
+ }`),qc("rv-benefit-list","Danh sách lợi ích",4.5,{text:"Vì sao nên dùng",items:"Mềm mượt tức thì|Tóc bóng 72 giờ|Không bết dính"},`function render(ctx,t,env){
9386
+ ${Gc}
9387
9387
  // Benefit list: a small heading (text) then 2–4 benefits (items) appearing one by one, each with a brand-accent disc
9388
9388
  // whose white tick draws on, in bold white with a soft shadow over the footage.
9389
9389
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),u=S.u,acc=sk.acc,k=IN(t,D,.25,.3),its=M.items(p,4)
@@ -9396,8 +9396,8 @@
9396
9396
  ctx.save();ctx.globalAlpha*=a;ctx.translate((1-a)*-u*.03,0);ctx.shadowColor='rgba(0,0,0,.3)';ctx.shadowBlur=r*.6;ctx.fillStyle=acc;ctx.beginPath();ctx.arc(cx,cy,r,0,M.TAU);ctx.fill();ctx.shadowColor='transparent';TICK(ctx,cx,cy,r*.9,'#ffffff',M.range(t,.45+i*.45,.8+i*.45))
9397
9397
  ctx.textAlign='left';ctx.font=lf[i].font;TXT(ctx,lf[i].lines[0]||'',cx+r*2,cy,lf[i].size);ctx.restore()})
9398
9398
  ctx.restore()
9399
- }`),Ec("rv-rating","Chấm điểm & kết luận",3.5,{text:"Đáng mua",number:4.8,sub:"Chấm điểm của mình"},`function render(ctx,t,env){
9400
- ${qc}
9399
+ }`),qc("rv-rating","Chấm điểm & kết luận",3.5,{text:"Đáng mua",number:4.8,sub:"Chấm điểm của mình"},`function render(ctx,t,env){
9400
+ ${Gc}
9401
9401
  // Rating / verdict for a consumer review: five stars fill one by one up to the score (numberValue 0–5, decimals fill
9402
9402
  // part of a star) while the score counts up big, the verdict (text, e.g. "Đáng mua") stamps in a brand-accent pill and
9403
9403
  // a small line (sub) under it; numberValue 0 = the verdict alone.
@@ -9413,8 +9413,8 @@
9413
9413
  if(a>0){ctx.save();ctx.translate(S.cx,y);ctx.scale(a,a);ctx.rotate((1-a)*-.15);ctx.shadowColor='rgba(0,0,0,.3)';ctx.shadowBlur=u*.02;ctx.fillStyle=acc;M.rr(ctx,-w/2,-h/2,w,h,h/2);ctx.fill();ctx.shadowColor='transparent';ctx.fillStyle=M.readable(acc);ctx.fillText(f.lines[0]||'',0,f.size*.04);ctx.restore()}y+=h*.95}
9414
9414
  const sub=String(p.sub||'').trim();if(sub){const f=M.fit(ctx,sub,q=>sk.font(q,'q','600'),u*.03,S.w*.8,1);ctx.font=f.font;ctx.globalAlpha=k.a*M.range(t,1.3,1.7);TXT(ctx,f.lines[0]||'',S.cx,y+u*.01,f.size)}
9415
9415
  ctx.restore()
9416
- }`),Ec("rv-cta-end","Thẻ kết mua ngay",3.5,{text:"Bộ dưỡng Glow",sub:"Mua ngay · Link ở bio",position:"lower"},`function render(ctx,t,env){
9417
- ${qc}
9416
+ }`),qc("rv-cta-end","Thẻ kết mua ngay",3.5,{text:"Bộ dưỡng Glow",sub:"Mua ngay · Link ở bio",position:"lower"},`function render(ctx,t,env){
9417
+ ${Gc}
9418
9418
  // End card call to action over the closing shot: the product name (text) in bold white caps with a soft shadow, a
9419
9419
  // brand-accent button (sub, "Mua ngay · Link ở bio") that pops and pulses softly with a tap ripple and an arrow.
9420
9420
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),u=S.u,acc=sk.acc,k=IN(t,D,.25,.3)
@@ -9428,7 +9428,7 @@
9428
9428
  ctx.font=bf.font;ctx.fillStyle=M.readable(acc);ctx.fillText(bf.lines[0]||'',-u*.025,bf.size*.04);const ax=bw/2-u*.06;ctx.strokeStyle=M.readable(acc);ctx.lineWidth=u*.006;ctx.lineCap='round';ctx.beginPath();ctx.moveTo(ax-u*.015,-u*.015);ctx.lineTo(ax,0);ctx.lineTo(ax-u*.015,u*.015);ctx.stroke()
9429
9429
  const rq=M.range((t-1)%1.6,0,.8);if(t>1&&rq<1){ctx.strokeStyle=M.rgba('#ffffff',.7*(1-rq));ctx.lineWidth=u*.004;ctx.beginPath();ctx.arc(bw*.28,bh*.1,u*.012+u*.05*rq,0,M.TAU);ctx.stroke()}ctx.restore()}
9430
9430
  ctx.restore()
9431
- }`)],rs=Y.find(t=>t.id==="course"),Ut=(t,e,c,o,n)=>({id:t,name:e,category:rs.name,pack:"course",duration:c,params:{accent:rs.accent,position:"lower",...o,style:"course"},code:n}),pa="const HX=/^#[0-9a-f]{6}$/i,AC=p=>HX.test(String(p.accent))?p.accent:'#3d7bff',NV='#0a1636',LT=String((env.params||{}).look)==='light';const NE=A=>{const n=parseInt(String(A).slice(1,7),16);return (n>>16&255)>(n&255)+60};const FD=(t,D,f,a,b)=>{const s=String(f||'both'),i=s==='both'||s==='in'?M.ease.outCubic(M.range(t,0,a)):1,o=s==='both'||s==='out'?M.ease.inCubic(M.range(t,D-b,D)):0;return i*(1-o)};",xs="const RRP=(c,x,y,w,h,r)=>{r=Math.max(0,Math.min(r,w/2,h/2));c.moveTo(x+r,y);c.arcTo(x+w,y,x+w,y+h,r);c.arcTo(x+w,y+h,x,y+h,r);c.arcTo(x,y+h,x,y,r);c.arcTo(x,y,x+w,y,r);c.closePath()};const EDGE=(W,H,x,y,w,h)=>({x:Math.max(W*.04,Math.min(W*.96-w,x)),y:Math.max(H*.04,Math.min(H*.96-h,y))});",yo="const IK=s=>{s=String(s);if(s.length<5)return s;const m=s[0]==='#'?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):(s.match(/[0-9.]+/g)||[]).map(Number),a=m[3]==null?1:m[3],l=(m[0]*.3+m[1]*.59+m[2]*.11)/255;return l>.55?(a<.97||l<.95?'rgba(70,72,88,'+a+')':'#1b1b22'):s};const GLL=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(28,22,40,.2)';c.shadowBlur=h*.4;c.shadowOffsetY=h*.12;const q=M.clamp((hi-.3)*3.4),g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#ffffff',M.mix(A,'#ffffff',.12),q));g.addColorStop(1,M.mix('#f3f2f6',M.mix(A,'#000000',.1),q));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.lineWidth=Math.max(1,Math.min(w,h)*.014);c.strokeStyle=M.rgba(M.mix('#dad8e0',A,Math.min(1,hi*1.4)),.9);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLN=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,0,0,.6)';c.shadowBlur=h*.3;c.shadowOffsetY=h*.08;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#171c2e',A,.08+hi*.3));g.addColorStop(1,M.mix('#05060c',A,hi*.2));c.globalAlpha=k*.9;c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.55);s.addColorStop(0,'rgba(255,255,255,'+(.08+.06*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.55);c.restore();const lw=Math.max(1.2,Math.min(Math.min(w,h)*.03,1.4+Math.min(w,h)*.012));c.lineWidth=lw;c.shadowColor=A;c.shadowBlur=Math.min(w,h)*(.16+.22*hi);c.strokeStyle=M.rgba(A,.75+.25*hi);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.lineWidth=Math.max(1,lw*.4);c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.6),.55+.4*hi);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLS=(c,x,y,w,h,r,a=1,hi=0,A='#3d7bff')=>{if(!(w>1)||!(h>1)||!(a>0))return;const k=Math.min(1,a);if(LT){GLL(c,x,y,w,h,r,k,hi,A);return}if(NE(A)){GLN(c,x,y,w,h,r,k,hi,A);return}c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,6,28,.42)';c.shadowBlur=h*.32;c.shadowOffsetY=h*.09;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#33569e',A,hi*.85));g.addColorStop(1,M.mix('#0c1a44',M.mix(A,'#06102e',.45),hi*.85));c.globalAlpha=k*(.8+.2*hi);c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.6);s.addColorStop(0,'rgba(255,255,255,'+(.16+.12*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.6);c.restore();c.lineWidth=Math.max(1,Math.min(Math.min(w,h)*.03,1.6+Math.min(w,h)*.006));c.strokeStyle='rgba(196,218,255,'+(.3+.5*hi)+')';M.rr(c,x,y,w,h,r);c.stroke();if(hi>0){c.shadowColor=A;c.shadowBlur=h*.55*hi;c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.35),.85*hi);M.rr(c,x,y,w,h,r);c.stroke()}c.restore()};const TXT=(c,s,x,y,f,z,col='#ffffff',al='left',a=1)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.font=f;c.textAlign=al;c.textBaseline='alphabetic';const k=LT?IK(col):col;if(k!==col){c.shadowColor='rgba(255,255,255,.65)';c.shadowBlur=z*.2}else{c.shadowColor='rgba(0,6,26,.5)';c.shadowBlur=z*.22;c.shadowOffsetY=z*.04}c.fillStyle=k;c.fillText(s,x,y);c.restore()};",we=pa+xs+yo+"const TILE=(c,sk,x,y,w,h,s,a,hi,A,role='n')=>{GLS(c,x,y,w,h,Math.min(w,h)*.24,a,hi,A);const z=h*.46;c.save();c.font=sk.font(z,role);const f=M.fit(c,s,q=>sk.font(q,role),z,w*.8,1,.4);c.restore();TXT(c,f.lines[0]||'',x+w/2,y+h*.5+f.size*.36,f.font,f.size,hi>.5?'#fff':'rgba(255,255,255,'+(.8+.2*hi)+')','center',a)};",hs="const BL=b=>{const n=parseInt(String(b).slice(1,7),16);return ((n>>16&255)*.3+(n>>8&255)*.59+(n&255)*.11)>140};",fs="const HW=(c,s,x,y,z,f,col,k,sd,al)=>{const ch=[...String(s||'').normalize('NFC')],n=ch.length;if(!n)return 0;c.save();c.font=f;c.textAlign='center';c.textBaseline='alphabetic';const ws=ch.map(q=>c.measureText(q).width),tw=ws.reduce((a,b)=>a+b,0);let px=al==='center'?x-tw/2:al==='right'?x-tw:x;const v=k*n*1.08;c.fillStyle=col;c.strokeStyle=col;c.lineJoin='round';c.lineWidth=z*.05;for(let i=0;i<n;i++){const q=M.clamp(v-i);if(q>0&&ch[i]!==' '){c.save();c.globalAlpha*=Math.min(1,q*1.8);c.translate(px+ws[i]/2+M.wob(sd,i,z*.025),y+M.wob(sd,i+40,z*.035));c.rotate(M.wob(sd,i+80,.09));const e=.72+.28*M.ease.outBack(q);c.scale(e,e);c.fillText(ch[i],0,0);c.strokeText(ch[i],0,0);c.restore()}px+=ws[i]}c.restore();return tw};const RB=(x,y,w,h,o,sd)=>[...M.linePts(x-o,y,x+w+o,y,sd,14,o*.3),...M.linePts(x+w,y-o*.5,x+w,y+h+o,sd+1,10,o*.3),...M.linePts(x+w+o*.5,y+h,x-o,y+h,sd+2,14,o*.3),...M.linePts(x,y+h+o*.5,x+o*.3,y-o*1.4,sd+3,10,o*.3)];",_l=[Ut("course-question-nav","Thanh điều hướng câu hỏi",5,{text:"Làm sao để viết câu lệnh cho AI hiệu quả?",number:1,total:15,sub:"Q",lift:0},`function render(ctx,t,env){
9431
+ }`)],hs=Y.find(t=>t.id==="course"),Ut=(t,e,c,o,n)=>({id:t,name:e,category:hs.name,pack:"course",duration:c,params:{accent:hs.accent,position:"lower",...o,style:"course"},code:n}),pa="const HX=/^#[0-9a-f]{6}$/i,AC=p=>HX.test(String(p.accent))?p.accent:'#3d7bff',NV='#0a1636',LT=String((env.params||{}).look)==='light';const NE=A=>{const n=parseInt(String(A).slice(1,7),16);return (n>>16&255)>(n&255)+60};const FD=(t,D,f,a,b)=>{const s=String(f||'both'),i=s==='both'||s==='in'?M.ease.outCubic(M.range(t,0,a)):1,o=s==='both'||s==='out'?M.ease.inCubic(M.range(t,D-b,D)):0;return i*(1-o)};",fs="const RRP=(c,x,y,w,h,r)=>{r=Math.max(0,Math.min(r,w/2,h/2));c.moveTo(x+r,y);c.arcTo(x+w,y,x+w,y+h,r);c.arcTo(x+w,y+h,x,y+h,r);c.arcTo(x,y+h,x,y,r);c.arcTo(x,y,x+w,y,r);c.closePath()};const EDGE=(W,H,x,y,w,h)=>({x:Math.max(W*.04,Math.min(W*.96-w,x)),y:Math.max(H*.04,Math.min(H*.96-h,y))});",wo="const IK=s=>{s=String(s);if(s.length<5)return s;const m=s[0]==='#'?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):(s.match(/[0-9.]+/g)||[]).map(Number),a=m[3]==null?1:m[3],l=(m[0]*.3+m[1]*.59+m[2]*.11)/255;return l>.55?(a<.97||l<.95?'rgba(70,72,88,'+a+')':'#1b1b22'):s};const GLL=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(28,22,40,.2)';c.shadowBlur=h*.4;c.shadowOffsetY=h*.12;const q=M.clamp((hi-.3)*3.4),g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#ffffff',M.mix(A,'#ffffff',.12),q));g.addColorStop(1,M.mix('#f3f2f6',M.mix(A,'#000000',.1),q));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.lineWidth=Math.max(1,Math.min(w,h)*.014);c.strokeStyle=M.rgba(M.mix('#dad8e0',A,Math.min(1,hi*1.4)),.9);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLN=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,0,0,.6)';c.shadowBlur=h*.3;c.shadowOffsetY=h*.08;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#171c2e',A,.08+hi*.3));g.addColorStop(1,M.mix('#05060c',A,hi*.2));c.globalAlpha=k*.9;c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.55);s.addColorStop(0,'rgba(255,255,255,'+(.08+.06*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.55);c.restore();const lw=Math.max(1.2,Math.min(Math.min(w,h)*.03,1.4+Math.min(w,h)*.012));c.lineWidth=lw;c.shadowColor=A;c.shadowBlur=Math.min(w,h)*(.16+.22*hi);c.strokeStyle=M.rgba(A,.75+.25*hi);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.lineWidth=Math.max(1,lw*.4);c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.6),.55+.4*hi);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLS=(c,x,y,w,h,r,a=1,hi=0,A='#3d7bff')=>{if(!(w>1)||!(h>1)||!(a>0))return;const k=Math.min(1,a);if(LT){GLL(c,x,y,w,h,r,k,hi,A);return}if(NE(A)){GLN(c,x,y,w,h,r,k,hi,A);return}c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,6,28,.42)';c.shadowBlur=h*.32;c.shadowOffsetY=h*.09;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#33569e',A,hi*.85));g.addColorStop(1,M.mix('#0c1a44',M.mix(A,'#06102e',.45),hi*.85));c.globalAlpha=k*(.8+.2*hi);c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.6);s.addColorStop(0,'rgba(255,255,255,'+(.16+.12*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.6);c.restore();c.lineWidth=Math.max(1,Math.min(Math.min(w,h)*.03,1.6+Math.min(w,h)*.006));c.strokeStyle='rgba(196,218,255,'+(.3+.5*hi)+')';M.rr(c,x,y,w,h,r);c.stroke();if(hi>0){c.shadowColor=A;c.shadowBlur=h*.55*hi;c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.35),.85*hi);M.rr(c,x,y,w,h,r);c.stroke()}c.restore()};const TXT=(c,s,x,y,f,z,col='#ffffff',al='left',a=1)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.font=f;c.textAlign=al;c.textBaseline='alphabetic';const k=LT?IK(col):col;if(k!==col){c.shadowColor='rgba(255,255,255,.65)';c.shadowBlur=z*.2}else{c.shadowColor='rgba(0,6,26,.5)';c.shadowBlur=z*.22;c.shadowOffsetY=z*.04}c.fillStyle=k;c.fillText(s,x,y);c.restore()};",we=pa+fs+wo+"const TILE=(c,sk,x,y,w,h,s,a,hi,A,role='n')=>{GLS(c,x,y,w,h,Math.min(w,h)*.24,a,hi,A);const z=h*.46;c.save();c.font=sk.font(z,role);const f=M.fit(c,s,q=>sk.font(q,role),z,w*.8,1,.4);c.restore();TXT(c,f.lines[0]||'',x+w/2,y+h*.5+f.size*.36,f.font,f.size,hi>.5?'#fff':'rgba(255,255,255,'+(.8+.2*hi)+')','center',a)};",ps="const BL=b=>{const n=parseInt(String(b).slice(1,7),16);return ((n>>16&255)*.3+(n>>8&255)*.59+(n&255)*.11)>140};",ds="const HW=(c,s,x,y,z,f,col,k,sd,al)=>{const ch=[...String(s||'').normalize('NFC')],n=ch.length;if(!n)return 0;c.save();c.font=f;c.textAlign='center';c.textBaseline='alphabetic';const ws=ch.map(q=>c.measureText(q).width),tw=ws.reduce((a,b)=>a+b,0);let px=al==='center'?x-tw/2:al==='right'?x-tw:x;const v=k*n*1.08;c.fillStyle=col;c.strokeStyle=col;c.lineJoin='round';c.lineWidth=z*.05;for(let i=0;i<n;i++){const q=M.clamp(v-i);if(q>0&&ch[i]!==' '){c.save();c.globalAlpha*=Math.min(1,q*1.8);c.translate(px+ws[i]/2+M.wob(sd,i,z*.025),y+M.wob(sd,i+40,z*.035));c.rotate(M.wob(sd,i+80,.09));const e=.72+.28*M.ease.outBack(q);c.scale(e,e);c.fillText(ch[i],0,0);c.strokeText(ch[i],0,0);c.restore()}px+=ws[i]}c.restore();return tw};const RB=(x,y,w,h,o,sd)=>[...M.linePts(x-o,y,x+w+o,y,sd,14,o*.3),...M.linePts(x+w,y-o*.5,x+w,y+h+o,sd+1,10,o*.3),...M.linePts(x+w+o*.5,y+h,x-o,y+h,sd+2,14,o*.3),...M.linePts(x,y+h+o*.5,x+o*.3,y-o*1.4,sd+3,10,o*.3)];",Zl=[Ut("course-question-nav","Thanh điều hướng câu hỏi",5,{text:"Làm sao để viết câu lệnh cho AI hiệu quả?",number:1,total:15,sub:"Q",lift:0},`function render(ctx,t,env){
9432
9432
  ${we}
9433
9433
  // Question navigator lower third: a row of small dark-blue glass tiles 1..total (the current one, number, lit in the accent and lifted) above a glass bar with a badge (sub + number: Q1 / Chương 2 / Bước 3) and the question in quotes (text); transparent elsewhere (fields: text, number, sub, total, lift, position lower | top).
9434
9434
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.6,.4),A=AC(p)
@@ -9672,7 +9672,7 @@
9672
9672
  TXT(ctx,it.ti,tx,y+ch*(two?.47:.5)+(two?0:fT.size*.36),fT.font,fT.size,hi>.5?'#fff':'#ffffff','left',k.v*a)
9673
9673
  if(it.su)TXT(ctx,fS.lines[0],tx,y+ch*.8,fS.font,fS.size,hi>.5?'#fdd':'rgba(255,255,255,.78)','left',k.v*a)})
9674
9674
  }`),Ut("course-split-cards","Bố cục hai thẻ",8,{mx:.35,my:.5,mw:.6,mh:.78,px:.815,py:.5,pw:.27,ph:.78,bg:"#f6f5f2",position:"center"},`function render(ctx,t,env){
9675
- ${pa}${xs}${hs}
9675
+ ${pa}${fs}${ps}
9676
9676
  // Split card layout (light editorial lesson): a clean full-frame backdrop (bg: white / off-white, or a theme's dark colour) with two rounded card windows cut out — a big media card (mx / my = its centre 0..1, mw × mh of the frame, corners .06 of its short side) where a B-roll / map / document / photo layer plays, and a tall presenter card (px / py / pw / ph, corners .07 of its width) where the presenter's window sits, a soft pink-red accent glow round it; both cards cast soft shadows; fades in / out; the windows stay transparent (fields: mx, my, mw, mh, px, py, pw, ph, bg).
9677
9677
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),A=AC(p),bg=HX.test(String(p.bg))?p.bg:'#f6f5f2',lt=BL(bg),a=FD(t,D,'both',.3,.3)
9678
9678
  if(!(a>0))return
@@ -9687,7 +9687,7 @@
9687
9687
  ctx.lineWidth=Math.max(1.5,u*.003);ctx.strokeStyle=M.mix(A,'#ffffff',.3);ctx.beginPath();RRP(ctx,...q,qr);ctx.stroke()
9688
9688
  ctx.restore()
9689
9689
  }`),Ut("course-brand-bug","Dấu thương hiệu góc",6,{text:"Thương hiệu",size:.055,posX:-1,posY:-1,fade:"both",position:"top-right"},`function render(ctx,t,env){
9690
- ${pa}${yo}
9690
+ ${pa}${wo}
9691
9691
  // Brand bug: a tiny pill in the top-right corner for the whole lesson (position top-right | top-left; posX / posY 0..1 = its centre; size = its height of the short side) — a small double chevron in the accent and the brand name in bold (text; the brand's own logo is a picture layer instead, placed by courseEdit), glass or white card by the look, slides in once; fade both | in | out | none for back-to-back pieces (fields: text, size, posX, posY, fade, position).
9692
9692
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),a=FD(t,D,p.fade,.5,.5),s=String(p.text||'').trim()
9693
9693
  if(!(a>0)||!s)return
@@ -9699,7 +9699,7 @@
9699
9699
  for(let i=0;i<2;i++){const o=cx+i*h*.17;ctx.globalAlpha=a*(i?1:.5);ctx.beginPath();ctx.moveTo(o-h*.07,cy-h*.15);ctx.lineTo(o+h*.06,cy);ctx.lineTo(o-h*.07,cy+h*.15);ctx.stroke()}ctx.restore()
9700
9700
  TXT(ctx,f.lines[0],x+h*.78,cy+f.size*.36,f.font,f.size,'#ffffff','left',a)
9701
9701
  }`),Ut("course-compare-board","Bảng so sánh viết tay",9,{title:"HAI CÁCH LÊN SÂN KHẤU",leftHead:"Được mời diễn thuyết",leftAmount:"5–10 triệu",leftLines:"Ban tổ chức trả phí|Cần tên tuổi trước|Đi lại nhiều",rightHead:"Tự tổ chức sự kiện",rightAmount:"10–20 triệu",rightLines:"Bán vé và khoá học|Tự tìm khán giả|Giữ toàn bộ lợi nhuận",vs:"VS",bg:"#fbfaf7",position:"center"},`function render(ctx,t,env){
9702
- ${pa}${hs}${fs}
9702
+ ${pa}${ps}${ds}
9703
9703
  // Marker comparison board, full frame: a clean white board (bg; a dark bg = white marker) with a hand-lettered title (title) and a red marker underline, a hand-drawn divider with a big red VS (vs) between two columns (side by side in 16:9, stacked in 9:16), each a heading (leftHead / rightHead), a red amount line (leftAmount / rightAmount, e.g. 5–10 triệu) and 2–4 short lines (leftLines / rightLines split by |), all written on letter by letter in reading order; fades in / out (fields: title, leftHead, leftAmount, leftLines, rightHead, rightAmount, rightLines, vs, bg).
9704
9704
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),P=H>W*1.1,sk=M.skin(env,p),A=AC(p),bg=HX.test(String(p.bg))?p.bg:'#fbfaf7',lt=BL(bg),ink=lt?'#1e1e26':'#f4f2ec',a=FD(t,D,'both',.35,.45)
9705
9705
  if(!(a>0))return
@@ -9720,7 +9720,7 @@
9720
9720
  else{col(p.leftHead,p.leftAmount,p.leftLines,W*.27,top+u*.02,W*.38,2.4,30);col(p.rightHead,p.rightAmount,p.rightLines,W*.73,top+u*.02,W*.38,4.6,60)}
9721
9721
  ctx.restore()
9722
9722
  }`),Ut("course-doc-highlight","Tài liệu đánh dấu",5,{cx:.5,cy:.52,cw:.5,ch:.8,posX:.5,posY:.4,bw:.3,bh:.08,text:"",position:"center"},`function render(ctx,t,env){
9723
- ${pa}${fs}
9723
+ ${pa}${ds}
9724
9724
  // Document highlight: a document / screenshot layer framed as paper — a white margin and a soft shadow round it (cx / cy = its centre 0..1, cw × ch of the frame), the rest of the frame dimmed a little, the sheet pushing in 5 % over the layer (courseEdit keys the document layer the same, linear), then a red translucent marker box sweeps over a region (posX / posY = its centre, bw × bh of the frame; bw 0 = none) with a hand-drawn outline, the rest of the page dims a touch, an optional hand-lettered note beside it (text) (fields: cx, cy, cw, ch, posX, posY, bw, bh, text).
9725
9725
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),a=FD(t,D,'both',.35,.35)
9726
9726
  if(!(a>0))return
@@ -9737,7 +9737,7 @@
9737
9737
  HW(ctx,f.lines[0],nx,ny,f.size,f.font,A,nk,9,rt?'left':'right')}}}
9738
9738
  ctx.restore()
9739
9739
  }`),Ut("course-map-pins","Bản đồ ghim điểm",7,{items:"Hà Nội@.794,.441|Singapore@.788,.578",map:1,text:"",route:1,bg:"#f6f5f2",position:"center"},`function render(ctx,t,env){
9740
- ${pa}${yo}
9740
+ ${pa}${wo}
9741
9741
  // Map pins: 1–4 accent pins (items "label@x,y", 0..1 of the map) drop in with a bounce, a pulse ring, a label card each, a dashed route (route 1), a title tag (text); map 1 = its own dotted world map on bg, map 0 = over a map picture layer (x / y of the frame) (fields: items, map, text, route, bg).
9742
9742
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),bg=HX.test(String(p.bg))?p.bg:'#f6f5f2',a=FD(t,D,'both',.4,.4),dm=Math.round(+p.map)===1
9743
9743
  if(!(a>0))return
@@ -9761,7 +9761,7 @@
9761
9761
  const tt=String(p.text||'').trim();if(tt){const f=M.fit(ctx,tt,v=>sk.font(v,'h','900'),u*.04,W*.4,1,.55);ctx.font=f.font;const h=f.size*1.8,w=ctx.measureText(f.lines[0]).width+f.size*1.6,k=M.ease.outCubic(M.range(t,.1,.6)),x=W*.05-(1-k)*u*.04,y=H*.07
9762
9762
  GLS(ctx,x,y,w,h,h*.3,a*k,.6,A);TXT(ctx,f.lines[0],x+f.size*.8,y+h/2+f.size*.36,f.font,f.size,'#fff','left',a*k)}
9763
9763
  ctx.restore()
9764
- }`)],ps=Y.find(t=>t.id==="aiworkflow"),tc=(t,e,c,o,n,s)=>({id:t,name:e,category:ps.name,pack:"aiworkflow",duration:c,params:{accent:ps.accent,position:"center",...o,style:"aiworkflow"},code:n,tags:s,formats:["landscape"]}),rc=(...t)=>({...tc(...t),formats:["portrait"]}),xc="const HX=/^#[0-9a-f]{6}$/i,LM=HX.test(String((env.params||{}).accent))?env.params.accent:'#8afb00',BL=HX.test(String((env.params||{}).color2))?env.params.color2:'#2f7bff',BK='#0b0b0d',INK='#16171a',GY='#8d9097';const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);const OUT=(c,t,D,cx,cy,d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));c.save();if(o>0){c.globalAlpha*=1-o;c.translate(cx,cy);c.scale(1+o*.08,1+o*.08);c.translate(-cx,-cy)}return o};const TY=(s,k)=>{const a=Array.from(String(s||''));return a.slice(0,Math.floor(a.length*M.clamp(k)+.001)).join('')};const BLR=(c,b)=>{if(b>.4)c.filter='blur('+b.toFixed(1)+'px)'};",hc=t=>"const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const VW="+(t?"PT?W*.78:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.07:cx-VW/2":"S.x0")+",VT="+(t?"PT?H*.11:H*.1":"S.top")+",VB="+(t?"PT?H*.8:H*.9":"S.bot")+",VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2,TL="+(t?"1":"PT?1:0")+";",wo="const BP=(c,x,y,s,txt,k=1,al)=>{if(!txt||!(k>0))return 0;c.save();c.font=sk.font(s,'s','700');const w=c.measureText(txt).width+s*2.7,h=s*1.9,x0=al==='center'?x-w/2:x;c.translate(x0+w/2,y);c.scale(k,k);c.fillStyle=LM;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h/2);c.fill();c.fillStyle=BK;c.textAlign='left';c.textBaseline='middle';c.fillText(txt,-w/2+s*2,s*.06);LOGO(c,-w/2+s*1.1,0,s*1.1,BK);c.restore();return w};",ds="const SPN=(c,x,y,r,col)=>{c.save();c.strokeStyle=col||GY;c.lineWidth=Math.max(1.5,r*.28);c.lineCap='round';c.beginPath();c.arc(x,y,r,t*7,t*7+4.2);c.stroke();c.restore()};const CHK=(c,x,y,r,k,fill)=>{if(!(k>0))return;c.save();c.translate(x,y);c.scale(k,k);if(fill){c.fillStyle=LM;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill()}else{c.strokeStyle=GY;c.lineWidth=r*.15;c.beginPath();c.arc(0,0,r,0,M.TAU);c.stroke()}c.strokeStyle=fill?BK:GY;c.lineWidth=r*.2;c.lineCap='round';c.lineJoin='round';c.beginPath();c.moveTo(-r*.42,0);c.lineTo(-r*.1,r*.32);c.lineTo(r*.45,-r*.3);c.stroke();c.restore()};",gs="const TH=(c,x,y,w,h,v,r)=>{c.save();c.beginPath();c.roundRect(x,y,w,h,r);c.clip();const P=[['#7fc8ff','#ffd9a0','#e9c48a','#e0455a'],['#ff9ec7','#ffe3f1','#f2c66b','#2fb6a8'],['#20304f','#6b4b9a','#3a3346','#ff7a3d'],['#9be7ff','#d7f5e2','#e8d9a8','#7a5cff'],['#ffb36b','#ffe6b8','#d9a066','#2f7bff'],['#1e2b2f','#3d6b5a','#2a3a33','#ffd23f'],['#c9b6ff','#fbe7ff','#b6e3c4','#ff5fa2'],['#87d3ff','#e9f7ff','#cfd8dc','#ff8a00']][v%8];const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,P[0]);g.addColorStop(.6,P[1]);c.fillStyle=g;c.fillRect(x,y,w,h);c.fillStyle=P[2];c.beginPath();c.moveTo(x,y+h*.6);c.quadraticCurveTo(x+w*.5,y+h*.46,x+w,y+h*.64);c.lineTo(x+w,y+h);c.lineTo(x,y+h);c.closePath();c.fill();c.fillStyle='rgba(255,255,255,.5)';c.beginPath();c.moveTo(x+w*.36,y+h);c.lineTo(x+w*.49,y+h*.58);c.lineTo(x+w*.55,y+h*.58);c.lineTo(x+w*.84,y+h);c.closePath();c.fill();c.fillStyle=P[3];c.beginPath();c.moveTo(x+w*.42,y+h*.82);c.lineTo(x+w*.46,y+h*.7);c.lineTo(x+w*.62,y+h*.7);c.lineTo(x+w*.66,y+h*.82);c.closePath();c.fill();c.fillStyle='#1d1d22';c.beginPath();c.arc(x+w*.46,y+h*.83,h*.045,0,M.TAU);c.moveTo(x+w*.66,y+h*.83);c.arc(x+w*.62,y+h*.83,h*.045,0,M.TAU);c.fill();c.restore()};",mo="const GT=(c,s,x,y,size,al='center',k=1)=>{if(!s||!(k>0))return;c.save();c.font=sk.font(size,'n','900');c.textAlign=al;c.textBaseline='middle';c.translate(x,y);c.scale(k,k);c.transform(1,0,-.16,1,0,0);c.lineJoin='round';c.strokeStyle='#1a1020';c.lineWidth=size*.16;c.shadowColor='rgba(0,0,0,.45)';c.shadowOffsetY=size*.08;c.shadowBlur=size*.12;c.strokeText(s,0,0);c.shadowColor='transparent';const g=c.createLinearGradient(0,-size*.5,0,size*.5);g.addColorStop(0,'#ffffff');g.addColorStop(.55,M.mix(LM,'#ffffff',.25));g.addColorStop(1,LM);c.fillStyle=g;c.fillText(s,0,0);c.restore()};",us=t=>`function render(ctx,t,env){
9764
+ }`)],gs=Y.find(t=>t.id==="aiworkflow"),tc=(t,e,c,o,n,s)=>({id:t,name:e,category:gs.name,pack:"aiworkflow",duration:c,params:{accent:gs.accent,position:"center",...o,style:"aiworkflow"},code:n,tags:s,formats:["landscape"]}),rc=(...t)=>({...tc(...t),formats:["portrait"]}),xc="const HX=/^#[0-9a-f]{6}$/i,LM=HX.test(String((env.params||{}).accent))?env.params.accent:'#8afb00',BL=HX.test(String((env.params||{}).color2))?env.params.color2:'#2f7bff',BK='#0b0b0d',INK='#16171a',GY='#8d9097';const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);const OUT=(c,t,D,cx,cy,d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));c.save();if(o>0){c.globalAlpha*=1-o;c.translate(cx,cy);c.scale(1+o*.08,1+o*.08);c.translate(-cx,-cy)}return o};const TY=(s,k)=>{const a=Array.from(String(s||''));return a.slice(0,Math.floor(a.length*M.clamp(k)+.001)).join('')};const BLR=(c,b)=>{if(b>.4)c.filter='blur('+b.toFixed(1)+'px)'};",hc=t=>"const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const VW="+(t?"PT?W*.78:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.07:cx-VW/2":"S.x0")+",VT="+(t?"PT?H*.11:H*.1":"S.top")+",VB="+(t?"PT?H*.8:H*.9":"S.bot")+",VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2,TL="+(t?"1":"PT?1:0")+";",mo="const BP=(c,x,y,s,txt,k=1,al)=>{if(!txt||!(k>0))return 0;c.save();c.font=sk.font(s,'s','700');const w=c.measureText(txt).width+s*2.7,h=s*1.9,x0=al==='center'?x-w/2:x;c.translate(x0+w/2,y);c.scale(k,k);c.fillStyle=LM;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h/2);c.fill();c.fillStyle=BK;c.textAlign='left';c.textBaseline='middle';c.fillText(txt,-w/2+s*2,s*.06);LOGO(c,-w/2+s*1.1,0,s*1.1,BK);c.restore();return w};",us="const SPN=(c,x,y,r,col)=>{c.save();c.strokeStyle=col||GY;c.lineWidth=Math.max(1.5,r*.28);c.lineCap='round';c.beginPath();c.arc(x,y,r,t*7,t*7+4.2);c.stroke();c.restore()};const CHK=(c,x,y,r,k,fill)=>{if(!(k>0))return;c.save();c.translate(x,y);c.scale(k,k);if(fill){c.fillStyle=LM;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill()}else{c.strokeStyle=GY;c.lineWidth=r*.15;c.beginPath();c.arc(0,0,r,0,M.TAU);c.stroke()}c.strokeStyle=fill?BK:GY;c.lineWidth=r*.2;c.lineCap='round';c.lineJoin='round';c.beginPath();c.moveTo(-r*.42,0);c.lineTo(-r*.1,r*.32);c.lineTo(r*.45,-r*.3);c.stroke();c.restore()};",bs="const TH=(c,x,y,w,h,v,r)=>{c.save();c.beginPath();c.roundRect(x,y,w,h,r);c.clip();const P=[['#7fc8ff','#ffd9a0','#e9c48a','#e0455a'],['#ff9ec7','#ffe3f1','#f2c66b','#2fb6a8'],['#20304f','#6b4b9a','#3a3346','#ff7a3d'],['#9be7ff','#d7f5e2','#e8d9a8','#7a5cff'],['#ffb36b','#ffe6b8','#d9a066','#2f7bff'],['#1e2b2f','#3d6b5a','#2a3a33','#ffd23f'],['#c9b6ff','#fbe7ff','#b6e3c4','#ff5fa2'],['#87d3ff','#e9f7ff','#cfd8dc','#ff8a00']][v%8];const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,P[0]);g.addColorStop(.6,P[1]);c.fillStyle=g;c.fillRect(x,y,w,h);c.fillStyle=P[2];c.beginPath();c.moveTo(x,y+h*.6);c.quadraticCurveTo(x+w*.5,y+h*.46,x+w,y+h*.64);c.lineTo(x+w,y+h);c.lineTo(x,y+h);c.closePath();c.fill();c.fillStyle='rgba(255,255,255,.5)';c.beginPath();c.moveTo(x+w*.36,y+h);c.lineTo(x+w*.49,y+h*.58);c.lineTo(x+w*.55,y+h*.58);c.lineTo(x+w*.84,y+h);c.closePath();c.fill();c.fillStyle=P[3];c.beginPath();c.moveTo(x+w*.42,y+h*.82);c.lineTo(x+w*.46,y+h*.7);c.lineTo(x+w*.62,y+h*.7);c.lineTo(x+w*.66,y+h*.82);c.closePath();c.fill();c.fillStyle='#1d1d22';c.beginPath();c.arc(x+w*.46,y+h*.83,h*.045,0,M.TAU);c.moveTo(x+w*.66,y+h*.83);c.arc(x+w*.62,y+h*.83,h*.045,0,M.TAU);c.fill();c.restore()};",ko="const GT=(c,s,x,y,size,al='center',k=1)=>{if(!s||!(k>0))return;c.save();c.font=sk.font(size,'n','900');c.textAlign=al;c.textBaseline='middle';c.translate(x,y);c.scale(k,k);c.transform(1,0,-.16,1,0,0);c.lineJoin='round';c.strokeStyle='#1a1020';c.lineWidth=size*.16;c.shadowColor='rgba(0,0,0,.45)';c.shadowOffsetY=size*.08;c.shadowBlur=size*.12;c.strokeText(s,0,0);c.shadowColor='transparent';const g=c.createLinearGradient(0,-size*.5,0,size*.5);g.addColorStop(0,'#ffffff');g.addColorStop(.55,M.mix(LM,'#ffffff',.25));g.addColorStop(1,LM);c.fillStyle=g;c.fillText(s,0,0);c.restore()};",Ms=t=>`function render(ctx,t,env){
9765
9765
  // ${t?"Vertical racing title card (9:16)":"Racing title card"} — game launch / trailer opener: a full-frame yellow flash and a blue streak frame wipe in, a checker + chevron strip slides across the top, then a heavy italic two-tone 'X IN / Y' title smears on with RGB streaks under small spec text and a lime badge; the image area stays open for footage (fields: text, sub, spec, flash, color2, bg).
9766
9766
  ${xc}${lt}${hc(t)}
9767
9767
  const FL=HX.test(String(p.flash))?p.flash:'#ffe14d',RD=HX.test(String(p.color2))?p.color2:'#c8123c'
@@ -9787,9 +9787,9 @@
9787
9787
  SM(l1,y1,f1,INK,.38);SM(l2,y2,f2,RD,.2);ctx.restore()
9788
9788
  const sp=String(p.spec||'').split('|').filter(Boolean).slice(0,2),ss=f1*.4;ctx.font=sk.font(ss,'s','700');ctx.fillStyle=INK;ctx.globalAlpha=1-ex;sp.forEach((s,i)=>ctx.fillText(TY(s.toUpperCase(),M.range(t,.35+i*.12,.65+i*.12)),x0,y1-f1*1.05-(sp.length-1-i)*ss*1.5));ctx.globalAlpha=1
9789
9789
  if(t>D-.12){const k=M.range(t,D-.12,D);ctx.fillStyle='rgba(27,42,140,'+(k*.9)+')';ctx.fillRect(0,0,W,H);bars(RD,'#ffffff',8,9)}
9790
- }`,bs=t=>`function render(ctx,t,env){
9790
+ }`,ys=t=>`function render(ctx,t,env){
9791
9791
  // ${t?"Vertical prompt box with image attach (9:16)":"Prompt box with image attach"} — AI chat input: the white box blurs in, a picture thumbnail flies in and lands top-left with a colour flash, the brand name types and turns into a lime brand pill, the prompt types fast with a caret, the blue send button pulses and the camera pushes into it (fields: text = prompt, sub = brand, placeholder, color2, bg).
9792
- ${xc}${lt}${hc(t)}${wo}${gs}
9792
+ ${xc}${lt}${hc(t)}${mo}${bs}
9793
9793
  if(ON(p)){const g=ctx.createRadialGradient(cx,cy,0,cx,cy,Math.max(W,H)*.7);g.addColorStop(0,'#4a3a2e');g.addColorStop(1,'#14100d');ctx.fillStyle=g;ctx.fillRect(0,0,W,H);const r=M.rand(4);for(let i=0;i<26;i++){ctx.fillStyle='rgba(255,236,200,'+(.04+r()*.08)+')';ctx.beginPath();ctx.arc(r()*W,r()*H,u*(.02+r()*.06),0,M.TAU);ctx.fill()}}
9794
9794
  const bw=TL?VW:Math.min(VW*.8,u*1.6),bh=bw*(TL?.62:.36),bx=VC-bw/2,by=VM-bh/2,fs=TL?VW*.046:bw*.028,pd=fs*1.3,bi=M.range(t,0,.14),pu=M.ease.inCubic(M.range(t,D-.35,D)),sbx=bx+bw-pd-fs,sby=by+bh-pd-fs*.3
9795
9795
  ctx.save();if(pu>0){ctx.translate(sbx,sby);ctx.scale(1+pu*1.8,1+pu*1.8);ctx.translate(-sbx,-sby);BLR(ctx,pu*10)}BLR(ctx,(1-bi)*14);ctx.globalAlpha*=bi
@@ -9806,7 +9806,7 @@
9806
9806
  const ps=t>=D-.3?1-.14*Math.sin(Math.PI*M.range(t,D-.3,D-.1)):1,pr=fs*1.05;ctx.save();ctx.translate(sbx,sby);ctx.scale(ps,ps);ctx.fillStyle=BL;ctx.beginPath();ctx.arc(0,0,pr,0,M.TAU);ctx.fill();ctx.strokeStyle='#ffffff';ctx.lineWidth=pr*.16;ctx.lineCap='round';ctx.lineJoin='round';ctx.beginPath();ctx.moveTo(0,pr*.42);ctx.lineTo(0,-pr*.4);ctx.moveTo(-pr*.36,-pr*.04);ctx.lineTo(0,-pr*.42);ctx.lineTo(pr*.36,-pr*.04);ctx.stroke();ctx.restore()
9807
9807
  if(t>.3&&t<2.3){const ax=M.lerp(bx+pd+tw*.6,bx+pd+fs*.2,M.ease.inOutCubic(M.range(t,1.1,1.45)))+fs*.2,ay=M.lerp(by+pd+th*.4,ly-fs*.3,M.ease.inOutCubic(M.range(t,1.1,1.45))),a=fs*.9;ctx.fillStyle=INK;ctx.strokeStyle='#ffffff';ctx.lineWidth=a*.08;ctx.beginPath();ctx.moveTo(ax,ay);ctx.lineTo(ax,ay+a);ctx.lineTo(ax+a*.26,ay+a*.75);ctx.lineTo(ax+a*.45,ay+a*1.1);ctx.lineTo(ax+a*.55,ay+a*1.05);ctx.lineTo(ax+a*.38,ay+a*.7);ctx.lineTo(ax+a*.7,ay+a*.7);ctx.closePath();ctx.stroke();ctx.fill()}
9808
9808
  ctx.restore()
9809
- }`,Ms=t=>`function render(ctx,t,env){
9809
+ }`,ws=t=>`function render(ctx,t,env){
9810
9810
  // ${t?"Vertical sketch scan (9:16)":"Sketch scan"} — AI analysing an upload: a paper card of pencil sketches (karts, wheels, mascot heads) while a lime scan band sweeps across it, sparkle stars twinkle at its corners and a white 'scanning…' pill with a spinner sits on it, the camera slowly pushing in and tilting (fields: text = pill, bg).
9811
9811
  ${xc}${hc(t)}
9812
9812
  if(ON(p)){const g=ctx.createLinearGradient(0,0,W,H);g.addColorStop(0,'#5a3b26');g.addColorStop(1,'#24170f');ctx.fillStyle=g;ctx.fillRect(0,0,W,H);ctx.fillStyle='rgba(0,0,0,.18)';for(let i=0;i<7;i++)ctx.fillRect(0,H*(i/7),W,H*.012)}
@@ -9826,9 +9826,9 @@
9826
9826
  const tx=String(p.text||'');if(tx){const fs=TL?VW*.045:cw*.032,dots='...'.slice(0,1+Math.floor(t*3)%3);ctx.font=sk.font(fs,'s','600');const pw=ctx.measureText(tx+'...').width+fs*3.2,ph=fs*2.2,px=x0+cw*.05,py=y0+ch-ph-cw*.04,pk=Math.max(0,M.spring(t-.2,{freq:1.7,damp:7}));ctx.save();ctx.translate(px+pw/2,py+ph/2);ctx.scale(pk,pk);ctx.fillStyle='#ffffff';ctx.shadowColor='rgba(0,0,0,.25)';ctx.shadowBlur=fs;ctx.beginPath();ctx.roundRect(-pw/2,-ph/2,pw,ph,ph/2);ctx.fill();ctx.shadowBlur=0;ctx.strokeStyle=LM;ctx.lineWidth=Math.max(1.5,fs*.12);ctx.stroke();ctx.strokeStyle=INK;ctx.lineWidth=fs*.16;ctx.lineCap='round';ctx.beginPath();ctx.arc(-pw/2+fs*1.25,0,fs*.42,t*7,t*7+4.2);ctx.stroke();ctx.fillStyle=INK;ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillText(tx+dots,-pw/2+fs*2.1,fs*.05);ctx.restore()}
9827
9827
  ctx.restore()
9828
9828
  ctx.restore()
9829
- }`,ys=t=>`function render(ctx,t,env){
9829
+ }`,ms=t=>`function render(ctx,t,env){
9830
9830
  // ${t?"Vertical big status title + checklist (9:16)":"Big status title + checklist"} — AI progress: the brand pill and a big grey status title type on, then shrink into a small header while the checklist lines blur in one by one, each spinner turning into a lime check (fields: text = title, sub = brand, items with | per line, bg).
9831
- ${xc}${lt}${hc(t)}${wo}${ds}
9831
+ ${xc}${lt}${hc(t)}${mo}${us}
9832
9832
  if(ON(p)){ctx.fillStyle='#f6f6f7';ctx.fillRect(0,0,W,H)}
9833
9833
  OUT(ctx,t,D,cx,cy)
9834
9834
  const tt=String(p.text||''),br=String(p.sub||''),it=String(p.items||'').split('|').map(s=>s.trim()).filter(Boolean).slice(0,5),n=it.length
@@ -9841,9 +9841,9 @@
9841
9841
  ctx.save();BLR(ctx,(1-k)*10);ctx.globalAlpha*=k;const ir=sm*.62;if(done)CHK(ctx,lx+ir,y,ir,Math.max(0,M.spring(t-t0-.55,{freq:1.8,damp:7})),1);else SPN(ctx,lx+ir,y,ir*.8)
9842
9842
  const ff=M.fit(ctx,s,z=>sk.font(z,'s','500'),sm,VW-ir*3,TL?2:1,.6);ctx.font=ff.font;ctx.fillStyle=done?'#55585f':INK;ff.lines.forEach((l,j)=>ctx.fillText(l,lx+ir*2.8,y+(j-(ff.lines.length-1)/2)*ff.lh));ctx.restore()})
9843
9843
  ctx.restore()
9844
- }`,ws=t=>`function render(ctx,t,env){
9844
+ }`,ks=t=>`function render(ctx,t,env){
9845
9845
  // ${t?"Vertical style picker (9:16)":"Style picker"} — choose a look: the brand pill pops and 'choose a style' types big, a 2 × 2 grid of game-look thumbnails pops in under a small prompt line, a selection glow hops between cells and confirms, then a blur swap brings the next step's grid (fields: text = title, sub = next step line, items with | per cell label, number = chosen cell, bg).
9846
- ${xc}${lt}${hc(t)}${wo}${gs}
9846
+ ${xc}${lt}${hc(t)}${mo}${bs}
9847
9847
  if(ON(p)){ctx.fillStyle='#ffffff';ctx.fillRect(0,0,W,H)}
9848
9848
  OUT(ctx,t,D,cx,cy)
9849
9849
  const br=String(p.brand||''),tt=String(p.text||''),it=String(p.items||'').split('|').map(s=>s.trim()),pick=Math.max(0,Math.min(3,Math.round(Number(p.number)||2)-1)),nx=String(p.sub||'')
@@ -9858,9 +9858,9 @@
9858
9858
  const a=stage?M.range(t,2.4,2.55):M.range(t,1.12,1.22),hop=stage?pick:(t<1.4?(pick+3)%4:pick),pr=1+.05*Math.sin(Math.PI*M.range(t,1.52,1.7));if(a>0){const x=gx+(hop%2)*(cwid+cg),y=gy+Math.floor(hop/2)*(chh+cg);ctx.save();ctx.globalAlpha*=a;ctx.translate(x+cwid/2,y+chh/2);ctx.scale(pr,pr);ctx.shadowColor=LM;ctx.shadowBlur=cwid*.12;ctx.strokeStyle=LM;ctx.lineWidth=Math.max(2,cwid*.018);ctx.beginPath();ctx.roundRect(-cwid/2,-chh/2,cwid,chh,cwid*.03);ctx.stroke();ctx.shadowBlur=0;ctx.strokeStyle='rgba(255,95,162,.7)';ctx.lineWidth=Math.max(1,cwid*.006);ctx.stroke();ctx.restore()}
9859
9859
  ctx.restore()
9860
9860
  ctx.restore()
9861
- }`,ms=t=>`function render(ctx,t,env){
9861
+ }`,Ss=t=>`function render(ctx,t,env){
9862
9862
  // ${t?"Vertical big step list (9:16)":"Big step list"} — AI progress in big type: the current step sits black with a lime dot and animated trailing dots, then gets a lime check, dims and rises as the next line comes up under it (fields: items with | per step, bg).
9863
- ${xc}${hc(t)}${ds}
9863
+ ${xc}${hc(t)}${us}
9864
9864
  if(ON(p)){ctx.fillStyle='#ffffff';ctx.fillRect(0,0,W,H)}
9865
9865
  OUT(ctx,t,D,cx,cy)
9866
9866
  const it=String(p.items||'').split('|').map(s=>s.trim().replace(/[.…]+$/,'')).filter(Boolean).slice(0,4),n=it.length;if(!n){ctx.restore();return}
@@ -9873,7 +9873,7 @@
9873
9873
  if(done)CHK(ctx,x0+ir,y,ir*1.1,1,1);else{ctx.fillStyle=LM;ctx.beginPath();ctx.arc(x0+ir,y,ir*(1+.08*Math.sin(t*6)),0,M.TAU);ctx.fill()}
9874
9874
  ctx.font=sk.font(fs,'s','500');ctx.fillStyle=done?'#7a7d84':INK;const dt=cur&&!done?'...'.slice(0,1+Math.floor(t*3.5)%3):'';ctx.fillText(s+dt,x0+ir*3.2,y);ctx.restore()})
9875
9875
  ctx.restore()
9876
- }`,ks=t=>`function render(ctx,t,env){
9876
+ }`,vs=t=>`function render(ctx,t,env){
9877
9877
  // ${t?"Vertical 3D viewport mock (9:16)":"3D viewport mock"} — AI builds 3D assets: a dark 3D app viewport (toolbars, axis gizmo, perspective grid floor) with a clay rocket model turning on a turntable, prompt chips with the brand tag popping in and out at the side and the model flashing blue as each is sent (fields: items with | per chip, sub = brand, color2, bg).
9878
9878
  ${xc}${hc(t)}
9879
9879
  const vb=Math.max(4,u*.012);if(ON(p)){ctx.fillStyle='#1d1e21';ctx.fillRect(0,0,W,H);ctx.fillStyle='#26272b';ctx.fillRect(0,0,W,vb*2.6);ctx.fillRect(0,0,vb*3.4,H);ctx.fillStyle='#3a3c42';for(let i=0;i<8;i++){ctx.beginPath();ctx.roundRect(vb*.8,vb*4+i*vb*3.2,vb*1.8,vb*1.8,vb*.4);ctx.fill()}for(let i=0;i<6;i++){ctx.beginPath();ctx.roundRect(vb*5+i*vb*4.2,vb*.6,vb*3.4,vb*1.4,vb*.4);ctx.fill()}
@@ -9897,9 +9897,9 @@
9897
9897
  if(br){ctx.fillStyle=LM;ctx.beginPath();ctx.roundRect(-cwid/2+fs*.8,-fs*.75-(f.lines.length-1)*f.lh/2,bwid,fs*1.5,fs*.75);ctx.fill();ctx.fillStyle=BK;ctx.font=sk.font(fs*.8,'s','700');ctx.fillText(br,-cwid/2+fs*1.6,-(f.lines.length-1)*f.lh/2+fs*.04)}
9898
9898
  ctx.font=f.font;ctx.fillStyle=INK;f.lines.forEach((l,j)=>ctx.fillText(l,-cwid/2+fs*1.1+bwid+fs*.4,(j-(f.lines.length-1)/2)*f.lh));ctx.fillStyle=BL;ctx.beginPath();ctx.arc(cwid/2-fs*1.6,0,fs*.9,0,M.TAU);ctx.fill();ctx.strokeStyle='#ffffff';ctx.lineWidth=fs*.15;ctx.lineCap='round';ctx.beginPath();ctx.moveTo(cwid/2-fs*1.6,fs*.38);ctx.lineTo(cwid/2-fs*1.6,-fs*.38);ctx.moveTo(cwid/2-fs*1.95,-fs*.05);ctx.lineTo(cwid/2-fs*1.6,-fs*.4);ctx.lineTo(cwid/2-fs*1.25,-fs*.05);ctx.stroke();ctx.restore()})
9899
9899
  ctx.restore()
9900
- }`,Ss=t=>`function render(ctx,t,env){
9900
+ }`,Ts=t=>`function render(ctx,t,env){
9901
9901
  // ${t?"Vertical racing game HUD (9:16)":"Racing game HUD"} — a transparent game overlay for gameplay footage: lap counter, speedometer with a green → red arc and needle counting up, a mini-map with a moving dot, item slots, a boost bar and an item pickup that pops into a slot (fields: text = lap, number = speed, from, unit, sub = boost label, boost %, map label).
9902
- ${xc}${hc(t)}${mo}
9902
+ ${xc}${hc(t)}${ko}
9903
9903
  if(ON(p)){const g=ctx.createLinearGradient(0,0,0,H);g.addColorStop(0,'#ffb08a');g.addColorStop(.45,'#ffd9b8');g.addColorStop(.46,'#e9d2b4');g.addColorStop(1,'#f6e6cf');ctx.fillStyle=g;ctx.fillRect(0,0,W,H)}
9904
9904
  OUT(ctx,t,D,cx,cy)
9905
9905
  const m=TL?VW*.04:u*.045,L=VX,R=VX+VW,T=VT,B=VB,pop=d=>Math.max(0,M.spring(t-d,{freq:1.6,damp:6.5}))
@@ -9916,9 +9916,9 @@
9916
9916
  ctx.fillStyle='#ffffff';ctx.strokeStyle='#1a1020';ctx.lineWidth=ss*.04;ctx.beginPath();if(i===0){ctx.moveTo(ss*.08,-ss*.32);ctx.lineTo(-ss*.18,ss*.04);ctx.lineTo(0,ss*.04);ctx.lineTo(-ss*.08,ss*.32);ctx.lineTo(ss*.2,-ss*.06);ctx.lineTo(ss*.02,-ss*.06);ctx.closePath()}else if(i===1){ctx.moveTo(0,-ss*.3);ctx.lineTo(ss*.24,-ss*.18);ctx.lineTo(ss*.2,ss*.12);ctx.lineTo(0,ss*.3);ctx.lineTo(-ss*.2,ss*.12);ctx.lineTo(-ss*.24,-ss*.18);ctx.closePath()}else if(t>pk+.6){for(let j=0;j<10;j++){const r=j%2?ss*.13:ss*.3,an=-Math.PI/2+j*Math.PI/5;ctx.lineTo(Math.cos(an)*r,Math.sin(an)*r)}ctx.closePath()}ctx.stroke();ctx.fill();ctx.restore()}
9917
9917
  if(t>pk&&t<pk+.62){const k=pop(pk),px=M.lerp(TL?VC:L+VW*.3,L+2*ss*1.18+ss/2,fly),py=M.lerp(TL?VM:VM,sy+ss/2,fly),r=ss*.5*(1-fly*.4)*Math.min(1,k);const rk=M.range(t,pk,pk+.35);if(rk<1){ctx.strokeStyle=M.rgba(LM,1-rk);ctx.lineWidth=ss*.08*(1-rk)+1;ctx.beginPath();ctx.arc(px,py,r*(1+rk*1.6),0,M.TAU);ctx.stroke()}ctx.save();ctx.translate(px,py);ctx.rotate(t*4);ctx.fillStyle='#ffd23f';ctx.strokeStyle='#1a1020';ctx.lineWidth=r*.1;ctx.beginPath();for(let j=0;j<10;j++){const rr=j%2?r*.45:r,an=-Math.PI/2+j*Math.PI/5;ctx.lineTo(Math.cos(an)*rr,Math.sin(an)*rr)}ctx.closePath();ctx.stroke();ctx.fill();ctx.restore()}
9918
9918
  ctx.restore()
9919
- }`,vs=t=>`function render(ctx,t,env){
9919
+ }`,Cs=t=>`function render(ctx,t,env){
9920
9920
  // ${t?"Vertical game pause menu (9:16)":"Game pause menu"} — over gameplay footage: the frame dims, a heavy italic pause title drops in, the menu buttons pop one by one and the lime selection highlight slides from the first button to the chosen one and presses it (fields: text = title, items with | per button, number = chosen button, bg).
9921
- ${xc}${hc(t)}${mo}
9921
+ ${xc}${hc(t)}${ko}
9922
9922
  if(ON(p)){ctx.fillStyle='rgba(10,8,16,.5)';ctx.fillRect(0,0,W,H);const g=ctx.createRadialGradient(cx,cy,0,cx,cy,Math.max(W,H)*.65);g.addColorStop(0,'rgba(0,0,0,0)');g.addColorStop(1,'rgba(0,0,0,.45)');ctx.fillStyle=g;ctx.fillRect(0,0,W,H)}
9923
9923
  OUT(ctx,t,D,cx,cy)
9924
9924
  const it=String(p.items||'').split('|').map(s=>s.trim()).filter(Boolean).slice(0,5),n=it.length,sel=Math.max(0,Math.min(n-1,Math.round(Number(p.number)||1)-1)),tf=TL?VW*.15:u*.11
@@ -9929,9 +9929,9 @@
9929
9929
  ctx.save();ctx.translate(VC,y+bh/2);ctx.scale(s,s);ctx.shadowColor=on>.5?LM:'rgba(0,0,0,.4)';ctx.shadowBlur=on>.5?bh*.5:bh*.2;ctx.shadowOffsetY=on>.5?0:bh*.08;const g=ctx.createLinearGradient(0,-bh/2,0,bh/2);g.addColorStop(0,on>.5?M.mix(LM,'#ffffff',.35):'#ffffff');g.addColorStop(1,on>.5?LM:'#c9cbd3');ctx.fillStyle=g;ctx.beginPath();ctx.roundRect(-bw/2,-bh/2,bw,bh,bh*.3);ctx.fill();ctx.shadowColor='transparent';ctx.strokeStyle='#1a1020';ctx.lineWidth=Math.max(1.5,bh*.06);ctx.stroke()
9930
9930
  const f=M.fit(ctx,it[i].toUpperCase(),z=>sk.font(z,'n','900'),fs,bw*.88,1,.5);ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle='#1a1020';ctx.fillText(f.lines[0]||'',0,fs*.06);ctx.restore()}
9931
9931
  ctx.restore()
9932
- }`,Ts=t=>`function render(ctx,t,env){
9932
+ }`,As=t=>`function render(ctx,t,env){
9933
9933
  // ${t?"Vertical character / car select carousel (9:16)":"Character / car select carousel"} — game select screen on purple: a heavy italic title, a spotlight on the centre kart (the side ones dark silhouettes), arrows left and right, the carousel slides to the next one and the lime choose button bounces (fields: text = title, items with | per name, sub = button, bg).
9934
- ${xc}${hc(t)}${mo}
9934
+ ${xc}${hc(t)}${ko}
9935
9935
  if(ON(p)){const g=ctx.createRadialGradient(cx,cy*1.1,0,cx,cy,Math.max(W,H)*.75);g.addColorStop(0,'#7a2a6e');g.addColorStop(.6,'#3a1240');g.addColorStop(1,'#16061c');ctx.fillStyle=g;ctx.fillRect(0,0,W,H)}
9936
9936
  OUT(ctx,t,D,cx,cy)
9937
9937
  const it=String(p.items||'').split('|').map(s=>s.trim()).filter(Boolean),n=Math.max(1,it.length),tf=TL?VW*.12:u*.09,sz=TL?VW*.4:VH*.34,cy0=TL?VM:VM+VH*.02,sp=TL?VW*.52:sz*1.35,sl=M.ease.inOutCubic(M.range(t,1.7,2.15))
@@ -9946,16 +9946,16 @@
9946
9946
  if(nm){ctx.font=sk.font(fs,'n','900');ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle='#ffffff';ctx.globalAlpha=1-Math.sin(Math.PI*sl)*.9;ctx.fillText(nm.toUpperCase(),VC,cy0+sz*.62);ctx.globalAlpha=1}
9947
9947
  if(bt){const bk=Math.max(0,M.spring(t-.3,{freq:1.6,damp:6}))*(1+.08*Math.max(0,Math.sin((t-.6)*7))*(t>2.3?1:0)),bw2=fs*6,bh2=fs*2;ctx.save();ctx.translate(VC,by);ctx.scale(bk,bk);ctx.shadowColor=LM;ctx.shadowBlur=bh2*.4;const g=ctx.createLinearGradient(0,-bh2/2,0,bh2/2);g.addColorStop(0,M.mix(LM,'#ffffff',.35));g.addColorStop(1,LM);ctx.fillStyle=g;ctx.beginPath();ctx.roundRect(-bw2/2,-bh2/2,bw2,bh2,bh2*.25);ctx.fill();ctx.shadowBlur=0;ctx.strokeStyle='#1a1020';ctx.lineWidth=bh2*.07;ctx.stroke();ctx.fillStyle='#1a1020';ctx.font=sk.font(fs,'n','900');ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(bt.toUpperCase(),0,fs*.06);ctx.restore()}
9948
9948
  ctx.restore()
9949
- }`,Cs=t=>`function render(ctx,t,env){
9949
+ }`,Rs=t=>`function render(ctx,t,env){
9950
9950
  // ${t?"Vertical small end subtitle (9:16)":"Small end subtitle"} — a closing caption over footage: one small centred line in white caps with a soft shadow fades in, holds and fades out (fields: text, bg = a dark scrim).
9951
9951
  ${xc}${hc(t)}
9952
9952
  if(ON(p)){ctx.fillStyle='rgba(0,0,0,.35)';ctx.fillRect(0,0,W,H)}
9953
9953
  const s=String(p.text||'').toUpperCase();if(!s)return
9954
9954
  const a=M.range(t,.15,.5)*(1-M.range(t,D-.35,D)),fs=TL?VW*.042:Math.min(VW*.024,u*.036),f=M.fit(ctx,s,z=>sk.font(z,'s','700'),fs,VW*.92,2,.6)
9955
9955
  ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.shadowColor='rgba(0,0,0,.7)';ctx.shadowBlur=f.size*.5;ctx.fillStyle='#ffffff';ctx.globalAlpha=a;f.lines.forEach((l,i)=>ctx.fillText(l,VC,VM+(i-(f.lines.length-1)/2)*f.lh));ctx.globalAlpha=1
9956
- }`,fc=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Tt={race:fc(["tvc","vlog"],["intro","title","hook"],["bold","playful"]),attach:fc(["explainer","tvc"],["explain","hook"],["tech","clean"]),scan:fc(["explainer","tvc"],["explain"],["tech"]),gen:fc(["explainer","course"],["list","step"],["clean","tech"]),style:fc(["explainer","tvc"],["compare","explain"],["tech","clean"]),steps:fc(["explainer","course"],["step","list"],["clean","minimal"]),view:fc(["explainer","tvc"],["explain"],["tech"]),hud:fc(["vlog","tvc"],["overlay","stat"],["playful","bold"]),pause:fc(["vlog"],["overlay"],["playful","bold"]),select:fc(["vlog"],["cta"],["playful","bold"]),sub:fc(["any"],["caption","outro"],["minimal"])},Ql=[tc("aiw-race-title","Thẻ tiêu đề đua xe",2.6,{text:"CLIPOOX IN",sub:"AI WORKFLOW",spec:"EST. 2026|MODEL: AI GAME BUILDER",flash:"#ffe14d",color2:"#c8123c"},us(0),Tt.race),rc("aiw-v-race-title","Dọc: thẻ tiêu đề đua xe",2.6,{text:"CLIPOOX IN",sub:"AI WORKFLOW",spec:"EST. 2026|MODEL: AI GAME BUILDER",flash:"#ffe14d",color2:"#c8123c"},us(1),Tt.race),tc("aiw-prompt-attach","Ô lệnh gắn ảnh",3.1,{text:"Biến bản phác thảo này thành game chơi được. Tạo phong cách hình ảnh và dựng tài sản 3D",sub:"Clipoox",placeholder:"Nhắn cho AI…",color2:"#2f7bff"},bs(0),Tt.attach),rc("aiw-v-prompt-attach","Dọc: ô lệnh gắn ảnh",3.1,{text:"Biến bản phác thảo này thành game chơi được. Tạo phong cách hình ảnh và dựng tài sản 3D",sub:"Clipoox",placeholder:"Nhắn cho AI…",color2:"#2f7bff"},bs(1),Tt.attach),tc("aiw-scan","Quét bản phác thảo",3.2,{text:"Đang quét bản phác thảo"},Ms(0),Tt.scan),rc("aiw-v-scan","Dọc: quét bản phác thảo",3.2,{text:"Đang quét bản phác thảo"},Ms(1),Tt.scan),tc("aiw-gen-checklist","Tiêu đề trạng thái + checklist",3.6,{text:"Đang tạo tài sản 3D ›",sub:"Clipoox",items:"Đã nhận diện nhân vật. Đang dựng khung xương 3D|Đã nhận diện xe. Đang gắn bánh và vật lý|Đã nhận diện bản đồ. Đang tạo màn chơi"},ys(0),Tt.gen),rc("aiw-v-gen-checklist","Dọc: tiêu đề trạng thái + checklist",3.6,{text:"Đang tạo tài sản 3D ›",sub:"Clipoox",items:"Đã nhận diện nhân vật. Đang dựng khung xương 3D|Đã nhận diện xe. Đang gắn bánh và vật lý|Đã nhận diện bản đồ. Đang tạo màn chơi"},ys(1),Tt.gen),tc("aiw-style-pick","Chọn phong cách 2×2",3.2,{text:"Chọn phong cách",brand:"Clipoox",prompt:"Chọn một phong cách để tiếp tục:",sub:"Đã chốt phong cách. Chọn góc máy:",items:"Hoạt hình|Đất sét|Low-poly|Pixel",number:2},ws(0),Tt.style),rc("aiw-v-style-pick","Dọc: chọn phong cách 2×2",3.2,{text:"Chọn phong cách",brand:"Clipoox",prompt:"Chọn một phong cách để tiếp tục:",sub:"Đã chốt phong cách. Chọn góc máy:",items:"Hoạt hình|Đất sét|Low-poly|Pixel",number:2},ws(1),Tt.style),tc("aiw-step-list","Danh sách bước chữ lớn",3.2,{items:"Đã rig nhân vật|Đang xuất sang 3D Shot"},ms(0),Tt.steps),rc("aiw-v-step-list","Dọc: danh sách bước chữ lớn",3.2,{items:"Đã rig nhân vật|Đang xuất sang 3D Shot"},ms(1),Tt.steps),tc("aiw-viewport","Khung 3D + thẻ lệnh",4,{items:"Thêm hoạt ảnh: nhìn lại, mỉm cười|Thêm hoạt ảnh: nhảy lên ăn mừng",sub:"Clipoox",color2:"#2f7bff"},ks(0),Tt.view),rc("aiw-v-viewport","Dọc: khung 3D + thẻ lệnh",4,{items:"Thêm hoạt ảnh: nhìn lại, mỉm cười|Thêm hoạt ảnh: nhảy lên ăn mừng",sub:"Clipoox",color2:"#2f7bff"},ks(1),Tt.view),tc("aiw-race-hud","HUD game đua xe",5,{text:"4/6",number:146,from:131,unit:"km/h",sub:"TĂNG TỐC!",boost:72,map:"Vòng 1-1",bg:!1},Ss(0),Tt.hud),rc("aiw-v-race-hud","Dọc: HUD game đua xe",5,{text:"4/6",number:146,from:131,unit:"km/h",sub:"TĂNG TỐC!",boost:72,map:"Vòng 1-1",bg:!1},Ss(1),Tt.hud),tc("aiw-pause-menu","Menu tạm dừng game",3.2,{text:"TẠM DỪNG",items:"Tiếp tục|Đổi nhân vật|Cài đặt|Thoát ra menu",number:2},vs(0),Tt.pause),rc("aiw-v-pause-menu","Dọc: menu tạm dừng game",3.2,{text:"TẠM DỪNG",items:"Tiếp tục|Đổi nhân vật|Cài đặt|Thoát ra menu",number:2},vs(1),Tt.pause),tc("aiw-select","Chọn xe / nhân vật",4,{text:"CHỌN XE",items:"Tia Chớp|Sóng Biển|Hoàng Hôn",sub:"CHỌN"},Ts(0),Tt.select),rc("aiw-v-select","Dọc: chọn xe / nhân vật",4,{text:"CHỌN XE",items:"Tia Chớp|Sóng Biển|Hoàng Hôn",sub:"CHỌN"},Ts(1),Tt.select),tc("aiw-end-subtitle","Phụ đề kết nhỏ",3,{text:"Quy trình AI: từ bản phác thảo tới game",bg:!1},Cs(0),Tt.sub),rc("aiw-v-end-subtitle","Dọc: phụ đề kết nhỏ",3,{text:"Quy trình AI: từ bản phác thảo tới game",bg:!1},Cs(1),Tt.sub)],As=Y.find(t=>t.id==="techlaunch"),pc=(t,e,c,o,n,s)=>({id:t,name:e,category:As.name,pack:"techlaunch",duration:c,params:{accent:As.accent,position:"center",...o,style:"techlaunch"},code:n,tags:s,formats:["landscape"]}),Ac=(...t)=>({...pc(...t),formats:["portrait"]}),Zl="const HX=/^#[0-9a-f]{6}$/i,PK=HX.test(String(p.accent))?p.accent:'#ff1f8e',DK=p.theme==='dark'||p.theme!=='light'&&/^#(8afb00|c6f432|b4e36a)$/i.test(PK),LM=HX.test(String(p.color2))?p.color2:DK?PK:'#c6f432',INK=DK?'#f2f2f4':'#141418',BG=DK?'#0e0f12':'#fbf7fa',CF=DK?'#17181c':'#ffffff',ON=!(p.bg===false||p.bg==='false'||p.bg===0);",Jl=(t,e)=>"const Q=Math.max(.05,Math.min(1,(+env.duration||"+e+")/"+e+"));t=t/Q;const W=env.width,H=env.height,D=env.duration/Q,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);"+Zl+"const TL="+(t?"1":"PT?1:0")+",VW="+(t?"PT?W*.84:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.08:cx-VW/2":"S.x0")+",VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2;",tr="const BGD=(k=1)=>{if(!ON||k<=0)return;ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=BG;ctx.fillRect(0,0,W,H);const a=t*.25;[[.12+.05*Math.sin(a),.18,PK,DK?.14:.2],[.92,.86+.04*Math.cos(a),LM,DK?.1:.32],[.96,.08,PK,.1]].forEach(q=>{const g=ctx.createRadialGradient(W*q[0],H*q[1],0,W*q[0],H*q[1],Math.max(W,H)*.6);g.addColorStop(0,M.rgba(q[2],q[3]));g.addColorStop(1,M.rgba(q[2],0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)});ctx.restore()};const OUT=(d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));ctx.save();if(o>0){ctx.globalAlpha*=1-o;ctx.translate(cx,cy);ctx.scale(1+o*.06,1+o*.06);ctx.translate(-cx,-cy)}return o};const TX=(s,x,y,z,al,col,o)=>{if(!s||!(z>0))return 0;ctx.font=sk.font(z,'h');ctx.textAlign=al||'left';ctx.textBaseline='middle';if(o){ctx.strokeStyle=col;ctx.lineWidth=Math.max(1,z*.035);ctx.lineJoin='round';ctx.strokeText(s,x,y)}else{ctx.fillStyle=col;ctx.fillText(s,x,y)}return ctx.measureText(s).width};const WS=w=>{let s=String(w||'').trim();const r={acc:0,out:0,pre:0,post:0};for(let i=0;i<4;i++){if(s[0]==='*'){r.acc=1;s=s.slice(1)}else if(s[0]==='~'){r.out=1;s=s.slice(1)}else if(s[0]==='>'){r.pre=1;s=s.slice(1)}}if(s.slice(-1)==='<'){r.post=1;s=s.slice(0,-1)}if(s.slice(-1)==='*'){r.acc=1;s=s.slice(0,-1)}r.s=s.trim().toUpperCase();return r};const CH=(x,y,s,a,n,col,k=1)=>{if(!(k>0)||!(s>0))return;ctx.save();ctx.translate(x,y);ctx.rotate(a);ctx.fillStyle=col;ctx.globalAlpha*=k;for(let i=0;i<n;i++){const o=i*s*.62;ctx.beginPath();ctx.moveTo(o-s*.3,-s*.5);ctx.lineTo(o-s*.1,-s*.5);ctx.lineTo(o+s*.3,0);ctx.lineTo(o-s*.1,s*.5);ctx.lineTo(o-s*.3,s*.5);ctx.lineTo(o+s*.1,0);ctx.closePath();ctx.fill()}ctx.restore()};const CORN=(lab,k=1)=>{if(k<=0)return;ctx.save();ctx.globalAlpha*=k;const f=Math.max(7,u*.016);ctx.font=sk.font(f,'s');ctx.fillStyle=PK;ctx.textBaseline='middle';ctx.textAlign='right';if(lab)ctx.fillText(String(lab).toUpperCase(),W-(PT?W*.08:W*.04),PT?H*.085:H*.06);ctx.fillStyle=INK;const y=PT?H*.86:H*.93,x=PT?W*.08:W*.04;ctx.fillRect(x,y,f*.7,f*.7);ctx.fillStyle=PK;ctx.fillRect(x+f,y,f*.7,f*.7);ctx.fillRect(x,y+f*1.3,f*4.2,f*.45);ctx.restore()};",Rs="const SCR=(s,k,sd=3)=>{const a=Array.from(String(s||'')),n=a.length,r=M.rand(sd*977+Math.floor(t*12)+1),G='ABCDEFGHJKLMNPRSTUVXYZ0123456789#<>/+';return a.map((c,i)=>{const q=M.clamp(k)*n*1.3-i;return q>=1.3||c===' '?c:q>0?G[Math.floor(r()*G.length)]:''}).join('')};",Wa="const SKS=['travel-camera','auto-ev','travel-airplane','menu-pho','home-house','fit-dumbbell','travel-lantern','auto-wheel'];const CARD=(x,y,w,h,v,o={})=>{if(!(w>1&&h>1))return;ctx.save();ctx.beginPath();ctx.rect(x,y,w,h);ctx.clip();const P=[['#7cc8ff','#eaf6ff','#2d6fa8'],['#ff9fc9','#ffe6f1','#a8326b'],['#23324f','#6a59c9','#ff7a59'],['#9be7d8','#f2fff9','#2a8f7a'],['#ffb46b','#fff0d9','#c4552b'],['#1d2430','#3b5a72','#9fd0ff'],['#d7c6ff','#fbf3ff','#6b48c9'],['#8fd4ff','#f6fbff','#ff4d6d']][v%8];const g=ctx.createLinearGradient(0,y,0,y+h);g.addColorStop(0,P[0]);g.addColorStop(1,P[1]);ctx.fillStyle=g;ctx.fillRect(x,y,w,h);ctx.fillStyle=M.rgba(P[2],.55);ctx.beginPath();ctx.moveTo(x,y+h);for(let i=0;i<=8;i++)ctx.lineTo(x+w*i/8,y+h*(.58+.2*(((i*37+v*13)%7)/7)));ctx.lineTo(x+w,y+h);ctx.closePath();ctx.fill();M.photo(ctx,SKS[v%8],x+w*.52,y+h*.56,h*.86,{shadow:false});if(o.tint){ctx.globalCompositeOperation='color';ctx.fillStyle=PK;ctx.fillRect(x,y,w,h);ctx.globalCompositeOperation='source-over';ctx.fillStyle=M.rgba(PK,.2);ctx.fillRect(x,y,w,h)}ctx.restore();ctx.save();ctx.strokeStyle=o.edge||'rgba(255,255,255,.95)';ctx.lineWidth=Math.max(1,o.lw||u*.003);ctx.beginPath();ctx.rect(x,y,w,h);ctx.stroke();ctx.restore()};",Ps="const WIN=(x,y,w,h,lw)=>{ctx.clearRect(x,y,w,h);ctx.save();ctx.strokeStyle=PK;ctx.shadowColor=M.rgba(PK,.6);ctx.shadowBlur=lw*3;ctx.lineWidth=lw;ctx.beginPath();ctx.rect(x,y,w,h);ctx.stroke();ctx.restore()};",Rc=(t,e,c,o)=>`function render(ctx,t,env){
9956
+ }`,fc=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Tt={race:fc(["tvc","vlog"],["intro","title","hook"],["bold","playful"]),attach:fc(["explainer","tvc"],["explain","hook"],["tech","clean"]),scan:fc(["explainer","tvc"],["explain"],["tech"]),gen:fc(["explainer","course"],["list","step"],["clean","tech"]),style:fc(["explainer","tvc"],["compare","explain"],["tech","clean"]),steps:fc(["explainer","course"],["step","list"],["clean","minimal"]),view:fc(["explainer","tvc"],["explain"],["tech"]),hud:fc(["vlog","tvc"],["overlay","stat"],["playful","bold"]),pause:fc(["vlog"],["overlay"],["playful","bold"]),select:fc(["vlog"],["cta"],["playful","bold"]),sub:fc(["any"],["caption","outro"],["minimal"])},Jl=[tc("aiw-race-title","Thẻ tiêu đề đua xe",2.6,{text:"CLIPOOX IN",sub:"AI WORKFLOW",spec:"EST. 2026|MODEL: AI GAME BUILDER",flash:"#ffe14d",color2:"#c8123c"},Ms(0),Tt.race),rc("aiw-v-race-title","Dọc: thẻ tiêu đề đua xe",2.6,{text:"CLIPOOX IN",sub:"AI WORKFLOW",spec:"EST. 2026|MODEL: AI GAME BUILDER",flash:"#ffe14d",color2:"#c8123c"},Ms(1),Tt.race),tc("aiw-prompt-attach","Ô lệnh gắn ảnh",3.1,{text:"Biến bản phác thảo này thành game chơi được. Tạo phong cách hình ảnh và dựng tài sản 3D",sub:"Clipoox",placeholder:"Nhắn cho AI…",color2:"#2f7bff"},ys(0),Tt.attach),rc("aiw-v-prompt-attach","Dọc: ô lệnh gắn ảnh",3.1,{text:"Biến bản phác thảo này thành game chơi được. Tạo phong cách hình ảnh và dựng tài sản 3D",sub:"Clipoox",placeholder:"Nhắn cho AI…",color2:"#2f7bff"},ys(1),Tt.attach),tc("aiw-scan","Quét bản phác thảo",3.2,{text:"Đang quét bản phác thảo"},ws(0),Tt.scan),rc("aiw-v-scan","Dọc: quét bản phác thảo",3.2,{text:"Đang quét bản phác thảo"},ws(1),Tt.scan),tc("aiw-gen-checklist","Tiêu đề trạng thái + checklist",3.6,{text:"Đang tạo tài sản 3D ›",sub:"Clipoox",items:"Đã nhận diện nhân vật. Đang dựng khung xương 3D|Đã nhận diện xe. Đang gắn bánh và vật lý|Đã nhận diện bản đồ. Đang tạo màn chơi"},ms(0),Tt.gen),rc("aiw-v-gen-checklist","Dọc: tiêu đề trạng thái + checklist",3.6,{text:"Đang tạo tài sản 3D ›",sub:"Clipoox",items:"Đã nhận diện nhân vật. Đang dựng khung xương 3D|Đã nhận diện xe. Đang gắn bánh và vật lý|Đã nhận diện bản đồ. Đang tạo màn chơi"},ms(1),Tt.gen),tc("aiw-style-pick","Chọn phong cách 2×2",3.2,{text:"Chọn phong cách",brand:"Clipoox",prompt:"Chọn một phong cách để tiếp tục:",sub:"Đã chốt phong cách. Chọn góc máy:",items:"Hoạt hình|Đất sét|Low-poly|Pixel",number:2},ks(0),Tt.style),rc("aiw-v-style-pick","Dọc: chọn phong cách 2×2",3.2,{text:"Chọn phong cách",brand:"Clipoox",prompt:"Chọn một phong cách để tiếp tục:",sub:"Đã chốt phong cách. Chọn góc máy:",items:"Hoạt hình|Đất sét|Low-poly|Pixel",number:2},ks(1),Tt.style),tc("aiw-step-list","Danh sách bước chữ lớn",3.2,{items:"Đã rig nhân vật|Đang xuất sang 3D Shot"},Ss(0),Tt.steps),rc("aiw-v-step-list","Dọc: danh sách bước chữ lớn",3.2,{items:"Đã rig nhân vật|Đang xuất sang 3D Shot"},Ss(1),Tt.steps),tc("aiw-viewport","Khung 3D + thẻ lệnh",4,{items:"Thêm hoạt ảnh: nhìn lại, mỉm cười|Thêm hoạt ảnh: nhảy lên ăn mừng",sub:"Clipoox",color2:"#2f7bff"},vs(0),Tt.view),rc("aiw-v-viewport","Dọc: khung 3D + thẻ lệnh",4,{items:"Thêm hoạt ảnh: nhìn lại, mỉm cười|Thêm hoạt ảnh: nhảy lên ăn mừng",sub:"Clipoox",color2:"#2f7bff"},vs(1),Tt.view),tc("aiw-race-hud","HUD game đua xe",5,{text:"4/6",number:146,from:131,unit:"km/h",sub:"TĂNG TỐC!",boost:72,map:"Vòng 1-1",bg:!1},Ts(0),Tt.hud),rc("aiw-v-race-hud","Dọc: HUD game đua xe",5,{text:"4/6",number:146,from:131,unit:"km/h",sub:"TĂNG TỐC!",boost:72,map:"Vòng 1-1",bg:!1},Ts(1),Tt.hud),tc("aiw-pause-menu","Menu tạm dừng game",3.2,{text:"TẠM DỪNG",items:"Tiếp tục|Đổi nhân vật|Cài đặt|Thoát ra menu",number:2},Cs(0),Tt.pause),rc("aiw-v-pause-menu","Dọc: menu tạm dừng game",3.2,{text:"TẠM DỪNG",items:"Tiếp tục|Đổi nhân vật|Cài đặt|Thoát ra menu",number:2},Cs(1),Tt.pause),tc("aiw-select","Chọn xe / nhân vật",4,{text:"CHỌN XE",items:"Tia Chớp|Sóng Biển|Hoàng Hôn",sub:"CHỌN"},As(0),Tt.select),rc("aiw-v-select","Dọc: chọn xe / nhân vật",4,{text:"CHỌN XE",items:"Tia Chớp|Sóng Biển|Hoàng Hôn",sub:"CHỌN"},As(1),Tt.select),tc("aiw-end-subtitle","Phụ đề kết nhỏ",3,{text:"Quy trình AI: từ bản phác thảo tới game",bg:!1},Rs(0),Tt.sub),rc("aiw-v-end-subtitle","Dọc: phụ đề kết nhỏ",3,{text:"Quy trình AI: từ bản phác thảo tới game",bg:!1},Rs(1),Tt.sub)],Ps=Y.find(t=>t.id==="techlaunch"),pc=(t,e,c,o,n,s)=>({id:t,name:e,category:Ps.name,pack:"techlaunch",duration:c,params:{accent:Ps.accent,position:"center",...o,style:"techlaunch"},code:n,tags:s,formats:["landscape"]}),Ac=(...t)=>({...pc(...t),formats:["portrait"]}),tr="const HX=/^#[0-9a-f]{6}$/i,PK=HX.test(String(p.accent))?p.accent:'#ff1f8e',DK=p.theme==='dark'||p.theme!=='light'&&/^#(8afb00|c6f432|b4e36a)$/i.test(PK),LM=HX.test(String(p.color2))?p.color2:DK?PK:'#c6f432',INK=DK?'#f2f2f4':'#141418',BG=DK?'#0e0f12':'#fbf7fa',CF=DK?'#17181c':'#ffffff',ON=!(p.bg===false||p.bg==='false'||p.bg===0);",er=(t,e)=>"const Q=Math.max(.05,Math.min(1,(+env.duration||"+e+")/"+e+"));t=t/Q;const W=env.width,H=env.height,D=env.duration/Q,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);"+tr+"const TL="+(t?"1":"PT?1:0")+",VW="+(t?"PT?W*.84:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.08:cx-VW/2":"S.x0")+",VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2;",cr="const BGD=(k=1)=>{if(!ON||k<=0)return;ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=BG;ctx.fillRect(0,0,W,H);const a=t*.25;[[.12+.05*Math.sin(a),.18,PK,DK?.14:.2],[.92,.86+.04*Math.cos(a),LM,DK?.1:.32],[.96,.08,PK,.1]].forEach(q=>{const g=ctx.createRadialGradient(W*q[0],H*q[1],0,W*q[0],H*q[1],Math.max(W,H)*.6);g.addColorStop(0,M.rgba(q[2],q[3]));g.addColorStop(1,M.rgba(q[2],0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)});ctx.restore()};const OUT=(d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));ctx.save();if(o>0){ctx.globalAlpha*=1-o;ctx.translate(cx,cy);ctx.scale(1+o*.06,1+o*.06);ctx.translate(-cx,-cy)}return o};const TX=(s,x,y,z,al,col,o)=>{if(!s||!(z>0))return 0;ctx.font=sk.font(z,'h');ctx.textAlign=al||'left';ctx.textBaseline='middle';if(o){ctx.strokeStyle=col;ctx.lineWidth=Math.max(1,z*.035);ctx.lineJoin='round';ctx.strokeText(s,x,y)}else{ctx.fillStyle=col;ctx.fillText(s,x,y)}return ctx.measureText(s).width};const WS=w=>{let s=String(w||'').trim();const r={acc:0,out:0,pre:0,post:0};for(let i=0;i<4;i++){if(s[0]==='*'){r.acc=1;s=s.slice(1)}else if(s[0]==='~'){r.out=1;s=s.slice(1)}else if(s[0]==='>'){r.pre=1;s=s.slice(1)}}if(s.slice(-1)==='<'){r.post=1;s=s.slice(0,-1)}if(s.slice(-1)==='*'){r.acc=1;s=s.slice(0,-1)}r.s=s.trim().toUpperCase();return r};const CH=(x,y,s,a,n,col,k=1)=>{if(!(k>0)||!(s>0))return;ctx.save();ctx.translate(x,y);ctx.rotate(a);ctx.fillStyle=col;ctx.globalAlpha*=k;for(let i=0;i<n;i++){const o=i*s*.62;ctx.beginPath();ctx.moveTo(o-s*.3,-s*.5);ctx.lineTo(o-s*.1,-s*.5);ctx.lineTo(o+s*.3,0);ctx.lineTo(o-s*.1,s*.5);ctx.lineTo(o-s*.3,s*.5);ctx.lineTo(o+s*.1,0);ctx.closePath();ctx.fill()}ctx.restore()};const CORN=(lab,k=1)=>{if(k<=0)return;ctx.save();ctx.globalAlpha*=k;const f=Math.max(7,u*.016);ctx.font=sk.font(f,'s');ctx.fillStyle=PK;ctx.textBaseline='middle';ctx.textAlign='right';if(lab)ctx.fillText(String(lab).toUpperCase(),W-(PT?W*.08:W*.04),PT?H*.085:H*.06);ctx.fillStyle=INK;const y=PT?H*.86:H*.93,x=PT?W*.08:W*.04;ctx.fillRect(x,y,f*.7,f*.7);ctx.fillStyle=PK;ctx.fillRect(x+f,y,f*.7,f*.7);ctx.fillRect(x,y+f*1.3,f*4.2,f*.45);ctx.restore()};",zs="const SCR=(s,k,sd=3)=>{const a=Array.from(String(s||'')),n=a.length,r=M.rand(sd*977+Math.floor(t*12)+1),G='ABCDEFGHJKLMNPRSTUVXYZ0123456789#<>/+';return a.map((c,i)=>{const q=M.clamp(k)*n*1.3-i;return q>=1.3||c===' '?c:q>0?G[Math.floor(r()*G.length)]:''}).join('')};",Wa="const SKS=['travel-camera','auto-ev','travel-airplane','menu-pho','home-house','fit-dumbbell','travel-lantern','auto-wheel'];const CARD=(x,y,w,h,v,o={})=>{if(!(w>1&&h>1))return;ctx.save();ctx.beginPath();ctx.rect(x,y,w,h);ctx.clip();const P=[['#7cc8ff','#eaf6ff','#2d6fa8'],['#ff9fc9','#ffe6f1','#a8326b'],['#23324f','#6a59c9','#ff7a59'],['#9be7d8','#f2fff9','#2a8f7a'],['#ffb46b','#fff0d9','#c4552b'],['#1d2430','#3b5a72','#9fd0ff'],['#d7c6ff','#fbf3ff','#6b48c9'],['#8fd4ff','#f6fbff','#ff4d6d']][v%8];const g=ctx.createLinearGradient(0,y,0,y+h);g.addColorStop(0,P[0]);g.addColorStop(1,P[1]);ctx.fillStyle=g;ctx.fillRect(x,y,w,h);ctx.fillStyle=M.rgba(P[2],.55);ctx.beginPath();ctx.moveTo(x,y+h);for(let i=0;i<=8;i++)ctx.lineTo(x+w*i/8,y+h*(.58+.2*(((i*37+v*13)%7)/7)));ctx.lineTo(x+w,y+h);ctx.closePath();ctx.fill();M.photo(ctx,SKS[v%8],x+w*.52,y+h*.56,h*.86,{shadow:false});if(o.tint){ctx.globalCompositeOperation='color';ctx.fillStyle=PK;ctx.fillRect(x,y,w,h);ctx.globalCompositeOperation='source-over';ctx.fillStyle=M.rgba(PK,.2);ctx.fillRect(x,y,w,h)}ctx.restore();ctx.save();ctx.strokeStyle=o.edge||'rgba(255,255,255,.95)';ctx.lineWidth=Math.max(1,o.lw||u*.003);ctx.beginPath();ctx.rect(x,y,w,h);ctx.stroke();ctx.restore()};",Bs="const WIN=(x,y,w,h,lw)=>{ctx.clearRect(x,y,w,h);ctx.save();ctx.strokeStyle=PK;ctx.shadowColor=M.rgba(PK,.6);ctx.shadowBlur=lw*3;ctx.lineWidth=lw;ctx.beginPath();ctx.rect(x,y,w,h);ctx.stroke();ctx.restore()};",Rc=(t,e,c,o)=>`function render(ctx,t,env){
9957
9957
  // ${e}
9958
- ${Jl(t,o)}${tr}${c}`,zs=t=>`${Rc(t,(t?"Vertical hook word stack (9:16)":"Hook word stack")+" — launch opener: a pink duotone photo block wipes across the paper, photo cards pop in scattered around it, then the 'X / IS / BACK' words stack on one per beat in huge techno caps, the first in the accent (fields: items = 2–4 stacked words, * = accent, ~ = outline; label = corner tag; theme, accent, color2, bg).",Wa,4)}
9958
+ ${er(t,o)}${cr}${c}`,Ws=t=>`${Rc(t,(t?"Vertical hook word stack (9:16)":"Hook word stack")+" — launch opener: a pink duotone photo block wipes across the paper, photo cards pop in scattered around it, then the 'X / IS / BACK' words stack on one per beat in huge techno caps, the first in the accent (fields: items = 2–4 stacked words, * = accent, ~ = outline; label = corner tag; theme, accent, color2, bg).",Wa,4)}
9959
9959
  BGD();const o=OUT()
9960
9960
  const ws=M.items(p,4).map(WS),n=Math.max(1,ws.length),R=M.rand(11)
9961
9961
  const C=TL?[[.6,.06,.3,-6],[.04,.1,.26,5],[.62,.68,.3,4],[.06,.72,.24,-5],[.36,.88,.22,3]]:[[.62,.08,.17,-5],[.8,.36,.15,6],[.6,.66,.2,4],[.12,.76,.16,-6],[.86,.74,.12,5],[.36,.86,.13,-3],[.04,.08,.12,4]]
@@ -9967,7 +9967,7 @@
9967
9967
  ws.forEach((w,i)=>{const k=M.range(t,.35+i*.2,.55+i*.2);if(k<=0)return;const x=(TL?VX:W*.07)+i*(TL?VW*.04:z*.55),y=y0+i*lh,s=1+.25*(1-M.ease.outCubic(k));ctx.save();ctx.translate(x,y);ctx.scale(s,s);ctx.globalAlpha*=Math.min(1,k*2);const col=k<.35?PK:w.acc||(i===0&&!ws.some(q=>q.acc))?PK:INK;const tw=TX(w.s,0,0,z,'left',col,w.out);if(w.post)CH(tw+z*.35,0,z*.45,Math.PI,2,PK);ctx.restore()})
9968
9968
  CORN(p.label,M.range(t,.3,.6))
9969
9969
  ctx.restore()
9970
- }`,Bs=t=>`${Rc(t,(t?"Vertical framed title lockup (9:16)":"Framed title lockup")+" — product name in a thin accent frame box with corner ticks, the name scramble-types in, >> << chevrons slide in on both sides and pulse, V chevrons bob above, a 'NOW LIVE ON' line (* = accent word) and a pill badge with the site pop under it (fields: text = product name, sub = line under it, badge = pill text, label = corner tag; theme, accent, color2, bg).",Rs,4)}
9970
+ }`,Hs=t=>`${Rc(t,(t?"Vertical framed title lockup (9:16)":"Framed title lockup")+" — product name in a thin accent frame box with corner ticks, the name scramble-types in, >> << chevrons slide in on both sides and pulse, V chevrons bob above, a 'NOW LIVE ON' line (* = accent word) and a pill badge with the site pop under it (fields: text = product name, sub = line under it, badge = pill text, label = corner tag; theme, accent, color2, bg).",zs,4)}
9971
9971
  BGD();const o=OUT()
9972
9972
  const tx=String(p.text||'').toUpperCase();let z=TL?VW*.13:H*.12;ctx.font=sk.font(z,'h');const tw0=ctx.measureText(tx||' ').width,lim=TL?VW*.56:W*.56;if(tw0>lim)z*=lim/tw0;ctx.font=sk.font(z,'h');const tw=Math.max(ctx.measureText(tx||' ').width,z*2)
9973
9973
  const fy=TL?VT+VH*.38:H*.42,fw=tw+z*.9,fh=z*1.55,fk=M.ease.outExpo(M.range(t,0,.35)),fx=cx-fw*fk/2
@@ -9980,7 +9980,7 @@
9980
9980
  const bt=String(p.badge||'');if(bt){const bk=Math.max(0,M.spring(t-1,{freq:1.6,damp:7})),bz=z*.46;ctx.font=sk.font(bz,'s');const bw=ctx.measureText(bt).width+bz*3.2,bh=bz*2.1,by=sy+sz*1.2+bh*.75;ctx.save();ctx.translate(cx,by);ctx.scale(bk,bk);ctx.fillStyle=PK;ctx.beginPath();ctx.roundRect(-bw/2,-bh/2,bw,bh,bh*.18);ctx.fill();ctx.fillStyle='#ffffff';ctx.beginPath();ctx.moveTo(-bw/2+bz*.9,-bz*.45);ctx.lineTo(-bw/2+bz*1.7,0);ctx.lineTo(-bw/2+bz*.9,bz*.45);ctx.closePath();ctx.fill();ctx.font=sk.font(bz,'s');ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillText(bt,-bw/2+bz*2.2,bz*.05);ctx.fillStyle=INK;ctx.fillRect(-bw/2-bz*.9,-bh/2,bz*.22,bh);ctx.fillStyle=PK;ctx.fillRect(-bw/2-bz*1.5,-bh/2,bz*.35,bz*.35);ctx.restore()}
9981
9981
  CORN(p.label,M.range(t,.3,.6))
9982
9982
  ctx.restore()
9983
- }`,Ws=t=>`${Rc(t,(t?"Vertical staggered word build (9:16)":"Staggered word build")+" — one word per beat at its own spot and size (a typing cursor bar follows the newest word), mixed accent and outline words with chevrons, then every word flies into a centred two-line lockup with an accent bar under it (fields: items = 3–5 words, * = accent, ~ = outline, > = chevron before, < = chevrons after; label = corner tag; theme, accent, color2, bg).","",4.5)}
9983
+ }`,Ls=t=>`${Rc(t,(t?"Vertical staggered word build (9:16)":"Staggered word build")+" — one word per beat at its own spot and size (a typing cursor bar follows the newest word), mixed accent and outline words with chevrons, then every word flies into a centred two-line lockup with an accent bar under it (fields: items = 3–5 words, * = accent, ~ = outline, > = chevron before, < = chevrons after; label = corner tag; theme, accent, color2, bg).","",4.5)}
9984
9984
  BGD();const o=OUT()
9985
9985
  const ws=M.items(p,5).map(WS),n=ws.length||1,L=TL?[[.02,.06,.2],[.1,.3,.24],[0,.52,.26],[.16,.76,.22],[.05,.92,.18]]:[[.04,.15,.16],[.22,.38,.19],[.08,.6,.18],[.4,.83,.16],[.58,.18,.14]]
9986
9986
  const gk=M.ease.inOutCubic(M.range(t,D*.55,D*.55+.6)),h1=Math.ceil(n/2),gz0=TL?VW*.16:H*.14
@@ -9997,7 +9997,7 @@
9997
9997
  const bk=M.ease.outExpo(M.range(t,D*.55+.45,D*.55+.9));if(bk>0){const bw=Math.max(...gw)*.42*bk;ctx.fillStyle=PK;ctx.fillRect(cx-bw/2,gy+gz*1.25,bw,Math.max(4,gz*.14))}
9998
9998
  CORN(p.label,M.range(t,.3,.6))
9999
9999
  ctx.restore()
10000
- }`,Hs=t=>`${Rc(t,(t?"Vertical hero card swarm (9:16)":"Hero card swarm")+" — a cut-out hero in the middle (hero = photo sticker id, or put your own cut-out layer above this one) inside a thin accent ring, a dozen small video / photo cards fly in from the edges and orbit around it in depth, then everything blur-whips off to the left (fields: hero, label; theme, accent, color2, bg).",Wa,5)}
10000
+ }`,Ds=t=>`${Rc(t,(t?"Vertical hero card swarm (9:16)":"Hero card swarm")+" — a cut-out hero in the middle (hero = photo sticker id, or put your own cut-out layer above this one) inside a thin accent ring, a dozen small video / photo cards fly in from the edges and orbit around it in depth, then everything blur-whips off to the left (fields: hero, label; theme, accent, color2, bg).",Wa,5)}
10001
10001
  BGD()
10002
10002
  const wk=M.ease.inExpo(M.range(t,D-.45,D-.02)),dx=-wk*W*1.3
10003
10003
  ctx.save();ctx.translate(dx,0)
@@ -10012,7 +10012,7 @@
10012
10012
  ctx.restore()
10013
10013
  if(wk>0){ctx.fillStyle=M.rgba(DK?'#000000':'#ffffff',wk*.6);ctx.fillRect(0,0,W,H)}
10014
10014
  CORN(p.label,M.range(t,.3,.6)*(1-wk))
10015
- }`,Ls=t=>`${Rc(t,(t?"Vertical feature panel over footage (9:16)":"Feature panel over footage")+" — a two-tone headline over a framed video window (transparent: put the footage UNDER this layer), >> << chevrons pulsing at both sides, a row of input chips (photos, a waveform, a text chip) under it; the window flashes pink every beat (fields: text = headline, first word ink, the rest accent; flash false = no flashes; label; theme, accent, color2, bg).",Wa+Ps,5)}
10015
+ }`,Es=t=>`${Rc(t,(t?"Vertical feature panel over footage (9:16)":"Feature panel over footage")+" — a two-tone headline over a framed video window (transparent: put the footage UNDER this layer), >> << chevrons pulsing at both sides, a row of input chips (photos, a waveform, a text chip) under it; the window flashes pink every beat (fields: text = headline, first word ink, the rest accent; flash false = no flashes; label; theme, accent, color2, bg).",Wa+Bs,5)}
10016
10016
  const o=OUT()
10017
10017
  const ww=TL?VW:Math.min(W*.6,H*.5*16/9),wh=TL?VW*.9:ww*9/16,hz=TL?VW*.1:H*.075,wy=(TL?VT+hz*2.4:H*.17),wxc=cx,gk=M.ease.outExpo(M.range(t,0,.4)),gw=M.lerp(ww*.3,ww,gk),gh=M.lerp(wh*.3,wh,gk),wx=wxc-gw/2,wy2=wy+(wh-gh)/2
10018
10018
  BGD();if(ON)WIN(wx,wy2,gw,gh,Math.max(2,u*.004));else{ctx.strokeStyle=PK;ctx.lineWidth=Math.max(2,u*.004);ctx.strokeRect(wx,wy2,gw,gh)}
@@ -10027,7 +10027,7 @@
10027
10027
  ctx.restore()}
10028
10028
  CORN(p.label,M.range(t,.3,.6))
10029
10029
  ctx.restore()
10030
- }`,Ds=t=>`${Rc(t,(t?"Vertical count scatter + card staircase (9:16)":"Count scatter + card staircase")+" — copies of a number pop in scattered (accent, ink, outline), they collapse into the final number which shrinks into a 'N SEC' header, then a staircase of video cards cascades corner to corner over a giant outline numeral with a DURATION label (fields: text = scattered number, number = final number, sub = unit after it, label = bottom label; theme, accent, color2, bg).",Wa,4)}
10030
+ }`,qs=t=>`${Rc(t,(t?"Vertical count scatter + card staircase (9:16)":"Count scatter + card staircase")+" — copies of a number pop in scattered (accent, ink, outline), they collapse into the final number which shrinks into a 'N SEC' header, then a staircase of video cards cascades corner to corner over a giant outline numeral with a DURATION label (fields: text = scattered number, number = final number, sub = unit after it, label = bottom label; theme, accent, color2, bg).",Wa,4)}
10031
10031
  BGD();const o=OUT()
10032
10032
  const a=String(p.text||'10').slice(0,4),fin=String(Number.isFinite(+p.number)?+p.number:30),un=String(p.sub||'').toUpperCase(),Z=TL?VW*.36:H*.36
10033
10033
  ctx.save();ctx.globalAlpha*=.55*M.range(t,1.2,1.8);TX(fin,cx,cy,TL?VW*.9:H*.9,'center',M.mix(PK,'#ffffff',.55),1);ctx.restore()
@@ -10039,7 +10039,7 @@
10039
10039
  for(let i=0;i<n;i++){const t0=1.2+i*.07,k=M.ease.outCubic(M.range(t,t0,t0+.35));if(k<=0)continue;const f=i/(n-1),x=M.lerp(x0,x1,f),y=M.lerp(y0,y1,f)+(1-k)*H*.25;ctx.save();ctx.globalAlpha*=Math.min(1,k*1.5);ctx.shadowColor='rgba(30,0,20,.18)';ctx.shadowBlur=u*.012;const L1=i===n-1?1.4:1;if(L1>1){ctx.shadowColor=M.rgba(PK,.7);ctx.shadowBlur=u*.03}CARD(x-(L1-1)*cw,y,cw*L1,chh*L1,i,i===n-1?{edge:PK,lw:u*.005}:{});ctx.restore()}
10040
10040
  const lk=M.range(t,2.1,2.4),lz=TL?VW*.09:H*.075;if(lk>0&&p.label){ctx.save();ctx.globalAlpha*=lk;TX(String(p.label).toUpperCase(),TL?VX+VW:W*.95,TL?VB+lz*.2:H*.92,lz,'right',INK);ctx.restore()}
10041
10041
  ctx.restore()
10042
- }`,Es=t=>`${Rc(t,(t?"Vertical player UI over footage (9:16)":"Player UI over footage")+" — the last card of a staircase grows into a framed video window (transparent: put the footage UNDER this layer) with a play icon, a progress bar and a running timecode, a header like '30 SEC' with << chevrons, a DURATION label with >> chevrons, lime chevrons sweeping through the window (fields: text = header, label = bottom label, number = seconds the timecode runs to; theme, accent, color2, bg).",Ps,5)}
10042
+ }`,Gs=t=>`${Rc(t,(t?"Vertical player UI over footage (9:16)":"Player UI over footage")+" — the last card of a staircase grows into a framed video window (transparent: put the footage UNDER this layer) with a play icon, a progress bar and a running timecode, a header like '30 SEC' with << chevrons, a DURATION label with >> chevrons, lime chevrons sweeping through the window (fields: text = header, label = bottom label, number = seconds the timecode runs to; theme, accent, color2, bg).",Bs,5)}
10043
10043
  const o=OUT()
10044
10044
  const hz=TL?VW*.1:H*.075,ww=TL?VW:Math.min(W*.82,H*.66*16/9),wh=TL?VH*.62:ww*9/16,wx=cx-ww/2,wy=TL?VT+hz*1.6:H*.15,gk=M.ease.outExpo(M.range(t,0,.45)),sw=ww*.18,sx=wx+ww-sw,sy=wy,x=M.lerp(sx,wx,gk),y=M.lerp(sy,wy,gk),w=M.lerp(sw,ww,gk),h=M.lerp(sw*.62,wh,gk)
10045
10045
  BGD();if(ON)WIN(x,y,w,h,Math.max(2,u*.005));else{ctx.strokeStyle=PK;ctx.lineWidth=Math.max(2,u*.005);ctx.strokeRect(x,y,w,h)}
@@ -10051,7 +10051,7 @@
10051
10051
  const hk=M.range(t,.2,.5);ctx.save();ctx.globalAlpha*=hk;const tw=TX(String(p.text||'').toUpperCase(),wx,wy-hz*.85,hz,'left',INK);CH(wx+tw+hz*.7,wy-hz*.85,hz*.55,Math.PI,2,PK);ctx.restore()
10052
10052
  const lz=hz*.95,lk=M.range(t,.5,.8);if(p.label){ctx.save();ctx.globalAlpha*=lk;ctx.font=sk.font(lz,'h');const lw=ctx.measureText(String(p.label).toUpperCase()).width;TX(String(p.label).toUpperCase(),wx+ww,wy+wh+lz*.9,lz,'right',INK);CH(wx+ww-lw-lz*1.4+Math.sin(t*5)*lz*.1,wy+wh+lz*.9,lz*.55,0,2,PK);ctx.restore()}
10053
10053
  ctx.restore()
10054
- }`,qs=t=>`${Rc(t,(t?"Vertical START / MIDDLE / END frames (9:16)":"START / MIDDLE / END frames")+" — three labelled thumbnails as a big typographic list with index numbers, then they fly into a strip under the full-frame footage (the top turns transparent: put the footage UNDER this layer), the active frame steps 1 → 2 → 3 in the accent with chevrons between (fields: items = the 3 labels, sub = second label word, label; theme, accent, color2, bg).",Wa,5.5)}
10054
+ }`,Os=t=>`${Rc(t,(t?"Vertical START / MIDDLE / END frames (9:16)":"START / MIDDLE / END frames")+" — three labelled thumbnails as a big typographic list with index numbers, then they fly into a strip under the full-frame footage (the top turns transparent: put the footage UNDER this layer), the active frame steps 1 → 2 → 3 in the accent with chevrons between (fields: items = the 3 labels, sub = second label word, label; theme, accent, color2, bg).",Wa,5.5)}
10055
10055
  const o=OUT()
10056
10056
  const it=M.items(p,3).map(s=>s.toUpperCase()),n=Math.max(1,it.length),sb=String(p.sub||'').toUpperCase(),mk=M.ease.inOutCubic(M.range(t,1.9,2.6))
10057
10057
  const sh=TL?VH*.24:H*.25,st=TL?VB-sh:H-sh
@@ -10070,7 +10070,7 @@
10070
10070
  if(mk>=1&&i<n-1){const gx=sx+sw+(TL?(VW/3-sw)/2:(W/3-sw)/2),near=act===i;CH(gx-u*.012,tyy+sth/2,u*(TL?.03:.025),0,2,near?PK:M.rgba(INK,.35),1)}})
10071
10071
  CORN(p.label,M.range(t,.3,.6)*(1-mk))
10072
10072
  ctx.restore()
10073
- }`,Gs=t=>`${Rc(t,(t?"Vertical split 4K title + face grid (9:16)":"Split 4K title + face grid")+" — over a face shot (transparent; pair with pixelate → sharp keys on the footage): 'COMING 4K SOON' in the middle between lime chevrons, then the big title splits to the left and right edges, a magenta frame flashes, and a dotted grid HUD scans over the face area (fields: text = title split after its first character, sub = small word above, label = small word below, posX / posY / size = HUD box; grid false = no HUD; theme, accent, color2, bg).","",4.5)}
10073
+ }`,Ns=t=>`${Rc(t,(t?"Vertical split 4K title + face grid (9:16)":"Split 4K title + face grid")+" — over a face shot (transparent; pair with pixelate → sharp keys on the footage): 'COMING 4K SOON' in the middle between lime chevrons, then the big title splits to the left and right edges, a magenta frame flashes, and a dotted grid HUD scans over the face area (fields: text = title split after its first character, sub = small word above, label = small word below, posX / posY / size = HUD box; grid false = no HUD; theme, accent, color2, bg).","",4.5)}
10074
10074
  if(ON)BGD();const o=OUT()
10075
10075
  const tt=String(p.text||'4K').toUpperCase(),A=tt.slice(0,1),B=tt.slice(1),Z=TL?VW*.36:H*.3,sp=M.ease.inOutExpo(M.range(t,1.15,1.55)),ik=M.ease.outBack(M.range(t,.05,.4))
10076
10076
  const hx=M.clamp(Number.isFinite(+p.posX)?+p.posX:.5,.1,.9)*W,hy=M.clamp(Number.isFinite(+p.posY)?+p.posY:.42,.15,.85)*H,hs=M.clamp(Number.isFinite(+p.size)?+p.size:.3,.1,.6)*u,gw=hs,gh=hs*1.25
@@ -10082,7 +10082,7 @@
10082
10082
  ctx.save();ctx.globalAlpha*=Math.min(1,ik);ctx.shadowColor='rgba(0,0,0,.25)';ctx.shadowBlur=u*.02;TX(A,ax,cy,z2,'left',PK);TX(B,bx,cy,z2,'left',PK);ctx.shadowBlur=0;const sz=z2*.2;TX(String(p.sub||'').toUpperCase(),ax,cy-z2*.62,sz,'left','#ffffff');TX(String(p.label||'').toUpperCase(),bx+wb*z2/Z,cy+z2*.62,sz,'right','#ffffff');ctx.restore()
10083
10083
  const fk=M.range(t,1.55,1.62)*(1-M.range(t,1.75,2.05));if(fk>0){ctx.save();ctx.globalAlpha*=fk;ctx.fillStyle=M.rgba(PK,.32);ctx.fillRect(0,0,W,H);ctx.strokeStyle=PK;ctx.lineWidth=u*.03;ctx.strokeRect(u*.015,u*.015,W-u*.03,H-u*.03);ctx.restore()}
10084
10084
  ctx.restore()
10085
- }`,Os=t=>`${Rc(t,(t?"Vertical end card (9:16)":"End card")+" — accent bands close in from the top and bottom, a white card with a double frame (accent + lime) holds the product name scramble-typed in techno caps and a 'NOW LIVE ON site' line (* = accent word) (fields: text = product name, sub = line under it; theme, accent, color2, bg).",Rs,3.5)}
10085
+ }`,Is=t=>`${Rc(t,(t?"Vertical end card (9:16)":"End card")+" — accent bands close in from the top and bottom, a white card with a double frame (accent + lime) holds the product name scramble-typed in techno caps and a 'NOW LIVE ON site' line (* = accent word) (fields: text = product name, sub = line under it; theme, accent, color2, bg).",zs,3.5)}
10086
10086
  BGD();const o=OUT(.3)
10087
10087
  const bk=M.ease.outExpo(M.range(t,0,.4)),bh=TL?H*.11:H*.14;ctx.save();const g=ctx.createLinearGradient(0,0,0,bh);g.addColorStop(0,PK);g.addColorStop(1,M.mix(PK,'#ffffff',.25));ctx.fillStyle=g;ctx.fillRect(0,-bh+bh*bk,W,bh);ctx.fillRect(0,H-bh*bk,W,bh);ctx.restore()
10088
10088
  const cw=TL?VW:W*.62,ch=TL?VH*.42:H*.46,ck=M.ease.outBack(M.range(t,.1,.45)),x=cx-cw/2,y=(TL?VM:cy)-ch/2
@@ -10090,11 +10090,11 @@
10090
10090
  const tx=String(p.text||'').toUpperCase();let z=TL?cw*.16:ch*.3;ctx.font=sk.font(z,'h');const tw=ctx.measureText(tx||' ').width;if(tw>cw*.78)z*=cw*.78/tw;TX(SCR(tx,M.range(t,.3,.9)),cx,y+ch*.42,z,'center',INK)
10091
10091
  const sw=String(p.sub||'').split(' ').filter(Boolean).map(WS),sz=z*.28,sk2=M.range(t,.75,1.05);if(sw.length&&sk2>0){ctx.font=sk.font(sz,'h');const sp=sz*.4,ww=sw.map(w=>ctx.measureText(w.s).width),tot=ww.reduce((a,b)=>a+b,0)+sp*(sw.length-1),f=Math.min(1,cw*.8/tot),zz=sz*f;let xx=cx-tot*f/2;ctx.save();ctx.globalAlpha*=sk2;sw.forEach((w,i)=>{TX(w.s,xx,y+ch*.7,zz,'left',w.acc?PK:INK);xx+=(ww[i]+sp)*f});ctx.restore()}
10092
10092
  ctx.restore()
10093
- }`,Pc=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Ot={hook:Pc(["tvc","explainer"],["hook","intro","title"],["tech","bold","editorial"]),lock:Pc(["tvc","explainer"],["title","logo","intro"],["tech","editorial"]),words:Pc(["tvc","explainer"],["title","hook","caption"],["tech","bold","editorial"]),swarm:Pc(["tvc","explainer"],["explain","intro"],["tech","editorial"]),panel:Pc(["tvc","explainer"],["explain","list"],["tech","editorial"]),count:Pc(["tvc","explainer"],["stat","explain"],["tech","bold"]),player:Pc(["tvc","explainer"],["explain","stat"],["tech"]),frames:Pc(["tvc","explainer","course"],["step","list","explain"],["tech","editorial"]),k4:Pc(["tvc","explainer"],["title","hook","overlay"],["tech","bold"]),end:Pc(["tvc","explainer"],["cta","outro","logo"],["tech","clean"])},Nt={hook:{items:"*NOVA|IS|BACK",label:"NOVA 4.0"},lock:{text:"NOVA 4.0",sub:"NOW *LIVE* ON",badge:"yourapp.ai",label:"NOVA 4.0"},words:{items:"THE|>DEFINING|*VIDEO<|~MODEL",label:"NOVA 4.0"},swarm:{hero:"",label:"NOVA 4.0"},panel:{text:"MULTI *REFERENCE",flash:!0,label:"NOVA 4.0"},count:{text:"10",number:30,sub:"SEC",label:"DURATION"},player:{text:"30 SEC",label:"DURATION",number:30},frames:{items:"START|MIDDLE|END",sub:"FRAME",label:"NOVA 4.0"},k4:{text:"4K",sub:"COMING",label:"SOON",posX:.5,posY:.42,size:.3,grid:!0,bg:!1},end:{text:"NOVA 4.0",sub:"NOW *LIVE* ON YOURAPP.AI"}},er=[pc("tl-hook-stack","Mở đầu: chồng chữ + ảnh rải",4,Nt.hook,zs(0),Ot.hook),Ac("tl-v-hook-stack","Dọc: mở đầu chồng chữ + ảnh rải",4,Nt.hook,zs(1),Ot.hook),pc("tl-title-lockup","Tên sản phẩm trong khung + nhãn",4,Nt.lock,Bs(0),Ot.lock),Ac("tl-v-title-lockup","Dọc: tên sản phẩm trong khung + nhãn",4,Nt.lock,Bs(1),Ot.lock),pc("tl-word-build","Dựng chữ từng nhịp",4.5,Nt.words,Ws(0),Ot.words),Ac("tl-v-word-build","Dọc: dựng chữ từng nhịp",4.5,Nt.words,Ws(1),Ot.words),pc("tl-hero-swarm","Nhân vật chính + bầy thẻ bay quanh",5,Nt.swarm,Hs(0),Ot.swarm),Ac("tl-v-hero-swarm","Dọc: nhân vật chính + bầy thẻ bay quanh",5,Nt.swarm,Hs(1),Ot.swarm),pc("tl-feature-panel","Bảng tính năng + khung video",5,Nt.panel,Ls(0),Ot.panel),Ac("tl-v-feature-panel","Dọc: bảng tính năng + khung video",5,Nt.panel,Ls(1),Ot.panel),pc("tl-count-stairs","Số rải + bậc thang thẻ",4,Nt.count,Ds(0),Ot.count),Ac("tl-v-count-stairs","Dọc: số rải + bậc thang thẻ",4,Nt.count,Ds(1),Ot.count),pc("tl-player","Khung phát video + thời lượng",5,Nt.player,Es(0),Ot.player),Ac("tl-v-player","Dọc: khung phát video + thời lượng",5,Nt.player,Es(1),Ot.player),pc("tl-frames","Khung đầu / giữa / cuối",5.5,Nt.frames,qs(0),Ot.frames),Ac("tl-v-frames","Dọc: khung đầu / giữa / cuối",5.5,Nt.frames,qs(1),Ot.frames),pc("tl-4k-split","Tiêu đề 4K tách đôi + lưới mặt",4.5,Nt.k4,Gs(0),Ot.k4),Ac("tl-v-4k-split","Dọc: tiêu đề 4K tách đôi + lưới mặt",4.5,Nt.k4,Gs(1),Ot.k4),pc("tl-end-card","Thẻ kết sản phẩm",3.5,Nt.end,Os(0),Ot.end),Ac("tl-v-end-card","Dọc: thẻ kết sản phẩm",3.5,Nt.end,Os(1),Ot.end)],Ns=Y.find(t=>t.id==="framed"),Ce=(t,e,c,o,n,s)=>({id:t,name:e,category:Ns.name,pack:"framed",duration:c,params:{accent:Ns.accent,position:"center",...o,style:"framed"},code:n,tags:s,formats:["landscape"]}),ec=(...t)=>({...Ce(...t),formats:["portrait"]}),cr=t=>"const TL="+(t?"1":"PT?1:0")+",VW="+(t?"PT?W*.84:Math.min(S.w,H*.62)":"S.w")+",VX=cx-VW/2,VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT;",ar=(t,e)=>"const Q=Math.max(.05,Math.min(1,(+env.duration||"+e+")/"+e+"));t=t/Q;const W=env.width,H=env.height,D=(+env.duration||"+e+")/Q,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const HX=/^#[0-9a-f]{6}$/i,AC=HX.test(String(p.accent))?p.accent:'#ffc21a',INK='#f4f2ee',BG='#0e0e10',DIM='rgba(244,242,238,.58)',HR='rgba(244,242,238,.2)',ON=!(p.bg===false||p.bg==='false'||p.bg===0);"+cr(t),or=Object.freeze({win:"ww=TL?VW:W*.5,wh=TL?VH*.66:H*.7,wx=cx-ww/2,wy=TL?VT+VH*.07:H*.14",vs:"ww=TL?VW*.66:W*.3,wh=TL?VH*.5:H*.62,wx=cx-ww/2,wy=TL?VT+VH*.03:H*.15",head:"ww=TL?VW:W*.4,wh=TL?VH*.48:H*.76,wx=TL?VX:W*.53,wy=TL?VT:H*.12",chips:"ww=TL?VW:W*.47,wh=TL?VH*.48:H*.76,wx=TL?VX:W*.07,wy=TL?VT:H*.12",paper:"ww=TL?VW:W*.4,wh=TL?VH*.4:H*.76,wx=TL?VX:W*.06,wy=TL?VT:H*.12",cta:"ww=TL?VW*.52:W*.28,wh=TL?VH*.5:H*.44,wx=cx-ww/2,wy=TL?VT+VH*.3:H*.47"}),nr="u*.028",da=or,sr={ww:"W*p.ww",wh:"H*p.wh",wx:"W*p.wx",wy:"H*p.wy"},ir="OV=[p.wx,p.wy,p.ww,p.wh].every(v=>v!=null&&v!==''&&Number.isFinite(+v))&&+p.ww>0&&+p.wh>0,"+da.win.split(",").map(t=>{const[e,c]=t.split(/=(.*)/);return e+"=OV?"+sr[e]+":("+c+")"}).join(","),lr="const BGD=(k=1)=>{if(!ON||k<=0)return;ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=BG;ctx.fillRect(0,0,W,H);let g=ctx.createRadialGradient(cx,H*.38,0,cx,H*.38,Math.max(W,H)*.7);g.addColorStop(0,'rgba(92,78,56,.26)');g.addColorStop(1,'rgba(92,78,56,0)');ctx.fillStyle=g;ctx.fillRect(0,0,W,H);const s=u*.1,oy=(t*u*.008)%s,x0=cx%s,y0=cy%s-oy;ctx.fillStyle='rgba(255,255,255,.035)';for(let x=x0;x<W;x+=s)ctx.fillRect(x,0,1,H);for(let y=y0;y<H;y+=s)if(y>=0)ctx.fillRect(0,y,W,1);ctx.fillStyle='rgba(255,255,255,.12)';const c=Math.max(2,u*.005);for(let x=x0;x<W;x+=s)for(let y=y0;y<H;y+=s)if(y>=0){ctx.fillRect(x-c,y,c*2+1,1);ctx.fillRect(x,y-c,1,c*2+1)}g=ctx.createRadialGradient(cx,cy,Math.min(W,H)*.3,cx,cy,Math.hypot(W,H)*.62);g.addColorStop(0,'rgba(0,0,0,0)');g.addColorStop(1,'rgba(0,0,0,.75)');ctx.fillStyle=g;ctx.fillRect(0,0,W,H);ctx.restore()};const OUT=(d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));ctx.save();if(o>0)ctx.globalAlpha*=1-o;return o};const WIN=(x,y,w,h,r)=>{if(!(w>2&&h>2))return;r=Math.min(r,w/2,h/2);if(ON){ctx.save();ctx.shadowColor='rgba(0,0,0,.6)';ctx.shadowBlur=u*.06;ctx.shadowOffsetY=u*.014;ctx.fillStyle='#000';ctx.beginPath();ctx.roundRect(x,y,w,h,r);ctx.fill();ctx.restore();ctx.save();ctx.beginPath();ctx.roundRect(x,y,w,h,r);ctx.clip();ctx.clearRect(x-2,y-2,w+4,h+4);ctx.restore()}ctx.save();ctx.strokeStyle=HR;ctx.lineWidth=Math.max(1,u*.0016);ctx.beginPath();ctx.roundRect(x,y,w,h,r);ctx.stroke();ctx.restore()};const BR=(x,y,w,h,L,k=1)=>{if(!(k>0))return;const l=L*M.clamp(k);ctx.save();ctx.strokeStyle=AC;ctx.lineWidth=Math.max(1.5,u*.004);ctx.lineCap='square';ctx.beginPath();[[x,y,1,1],[x+w,y,-1,1],[x,y+h,1,-1],[x+w,y+h,-1,-1]].forEach(c=>{ctx.moveTo(c[0],c[1]+c[3]*l);ctx.lineTo(c[0],c[1]);ctx.lineTo(c[0]+c[2]*l,c[1])});ctx.stroke();ctx.restore()};const LB=(s,x,y,z,al,col,k=1)=>{s=String(s==null?'':s).toUpperCase();if(!s||!(k>0)||!(z>0))return 0;ctx.save();ctx.globalAlpha*=M.clamp(k);ctx.font=sk.font(z,'s');M.ls(ctx,z*.2);ctx.fillStyle=col||DIM;ctx.textAlign=al||'left';ctx.textBaseline='middle';ctx.fillText(s,x,y);const w=ctx.measureText(s).width;ctx.restore();return w};const TY=(s,k)=>{s=String(s==null?'':s);return s.slice(0,Math.ceil(s.length*M.clamp(k)))};const PROG=(k=1)=>{if(!(k>0))return;const y=PT?H*.83:H*.94,a=PT?W*.075:W*.05,b=W-a,f=M.clamp(t/D),lw=Math.max(1,u*.0016);ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=HR;ctx.fillRect(a,y,b-a,lw);ctx.fillStyle=AC;ctx.fillRect(a,y-lw*.5,(b-a)*f,lw*2);ctx.beginPath();ctx.arc(a+(b-a)*f,y+lw*.5,Math.max(2,u*.005),0,M.TAU);ctx.fill();ctx.restore()};",Qa="const HLP=(txt,z,mw)=>{ctx.font=sk.font(z,'h');const sp=ctx.measureText(' ').width*1.05,out=[];let on=0;String(txt||'').split('/').forEach(gr=>{let row=[],rw=0;gr.split(' ').filter(Boolean).forEach(tk=>{const n=(tk.match(/[*]/g)||[]).length,a=on||tk[0]==='*';if(n%2)on=!on;const s=tk.replace(/[*]/g,'').toUpperCase();if(!s)return;const w=ctx.measureText(s).width;if(row.length&&rw+sp+w>mw){out.push(row);row=[];rw=0}const x=row.length?rw+sp:0;row.push({s,a,w,x});rw=x+w});if(row.length)out.push(row)});return out};const FIT=(txt,z,mw,mh,lh=1.04)=>{let L=[];for(let i=0;i<18;i++){L=HLP(txt,z,mw);if(L.length*z*lh<=mh&&L.every(r=>r[r.length-1].x+r[r.length-1].w<=mw+.5))break;z*=.9}return{L,z,lh:z*lh}};const HDRAW=(F,x,y0,al,t0,st,col,hl)=>{let j=0,last=null;F.L.forEach((r,i)=>{const rw=r[r.length-1].x+r[r.length-1].w,ox=al==='center'?x-rw/2:x,y=y0+i*F.lh+F.lh/2;r.forEach(w=>{const a=t0+j*st,k=M.ease.outCubic(M.range(t,a,a+.38));j++;if(k<=0)return;const yy=y+(1-k)*F.z*.42;ctx.save();ctx.globalAlpha*=k;if(hl&&w.a){const hk=M.ease.outCubic(M.range(t,a+.15,a+.5));ctx.fillStyle=AC;ctx.fillRect(ox+w.x-F.z*.08,yy-F.z*.42,(w.w+F.z*.16)*hk,F.z*.84)}const b=(1-k)*F.z*.09;if(b>.4)ctx.filter='blur('+b.toFixed(1)+'px)';ctx.font=sk.font(F.z,'h');ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillStyle=w.a&&!hl?AC:col||INK;ctx.fillText(w.s,ox+w.x,yy+F.z*.04);ctx.restore();last=[ox+w.x+w.w,y,k]})});return{n:j,last}};const CAR=(c,z,on)=>{if(!c||!on)return;ctx.fillStyle=AC;ctx.fillRect(c[0]+z*.1,c[1]-z*.4,Math.max(2,z*.07),z*.8)};",Is=Qa.replace("const HDRAW=(F,x,y0,al,t0,st,col,hl)=>{","const HDRAW=(F,x,y0,al,t0,st,col,hl,tm)=>{").replace("const a=t0+j*st,","const a=tm&&Number.isFinite(tm[j])?tm[j]:t0+j*st,")+"const TM=String(p.times==null?'':p.times).split(',').map(x=>parseFloat(x)/Q);",Us="const LN=(P,k,col,lw)=>{if(!(k>0)||P.length<2)return;let L=0;for(let i=1;i<P.length;i++)L+=Math.hypot(P[i][0]-P[i-1][0],P[i][1]-P[i-1][1]);let w=L*M.clamp(k);ctx.save();ctx.strokeStyle=col||HR;ctx.lineWidth=lw||Math.max(1,u*.0018);ctx.beginPath();ctx.moveTo(P[0][0],P[0][1]);for(let i=1;i<P.length&&w>0;i++){const d=Math.hypot(P[i][0]-P[i-1][0],P[i][1]-P[i-1][1]),f=Math.min(1,w/(d||1));ctx.lineTo(P[i-1][0]+(P[i][0]-P[i-1][0])*f,P[i-1][1]+(P[i][1]-P[i-1][1])*f);w-=d}ctx.stroke();ctx.restore()};",ga="const GW=(x,y,w,h,k,bk)=>{const e=M.ease.outExpo(M.clamp(k)),gw=w*(.82+.18*e),gh=h*(.08+.92*e),g=u*.016+Math.sin(t*2.2)*u*.002;if(e>0)WIN(x+(w-gw)/2,y+(h-gh)/2,gw,gh,"+nr+");BR(x-g,y-g,w+g*2,h+g*2,Math.min(w,h)*.12,M.ease.outCubic(M.clamp(bk)))};",cc=(t,e,c,o)=>`function render(ctx,t,env){
10093
+ }`,Pc=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Ot={hook:Pc(["tvc","explainer"],["hook","intro","title"],["tech","bold","editorial"]),lock:Pc(["tvc","explainer"],["title","logo","intro"],["tech","editorial"]),words:Pc(["tvc","explainer"],["title","hook","caption"],["tech","bold","editorial"]),swarm:Pc(["tvc","explainer"],["explain","intro"],["tech","editorial"]),panel:Pc(["tvc","explainer"],["explain","list"],["tech","editorial"]),count:Pc(["tvc","explainer"],["stat","explain"],["tech","bold"]),player:Pc(["tvc","explainer"],["explain","stat"],["tech"]),frames:Pc(["tvc","explainer","course"],["step","list","explain"],["tech","editorial"]),k4:Pc(["tvc","explainer"],["title","hook","overlay"],["tech","bold"]),end:Pc(["tvc","explainer"],["cta","outro","logo"],["tech","clean"])},Nt={hook:{items:"*NOVA|IS|BACK",label:"NOVA 4.0"},lock:{text:"NOVA 4.0",sub:"NOW *LIVE* ON",badge:"yourapp.ai",label:"NOVA 4.0"},words:{items:"THE|>DEFINING|*VIDEO<|~MODEL",label:"NOVA 4.0"},swarm:{hero:"",label:"NOVA 4.0"},panel:{text:"MULTI *REFERENCE",flash:!0,label:"NOVA 4.0"},count:{text:"10",number:30,sub:"SEC",label:"DURATION"},player:{text:"30 SEC",label:"DURATION",number:30},frames:{items:"START|MIDDLE|END",sub:"FRAME",label:"NOVA 4.0"},k4:{text:"4K",sub:"COMING",label:"SOON",posX:.5,posY:.42,size:.3,grid:!0,bg:!1},end:{text:"NOVA 4.0",sub:"NOW *LIVE* ON YOURAPP.AI"}},ar=[pc("tl-hook-stack","Mở đầu: chồng chữ + ảnh rải",4,Nt.hook,Ws(0),Ot.hook),Ac("tl-v-hook-stack","Dọc: mở đầu chồng chữ + ảnh rải",4,Nt.hook,Ws(1),Ot.hook),pc("tl-title-lockup","Tên sản phẩm trong khung + nhãn",4,Nt.lock,Hs(0),Ot.lock),Ac("tl-v-title-lockup","Dọc: tên sản phẩm trong khung + nhãn",4,Nt.lock,Hs(1),Ot.lock),pc("tl-word-build","Dựng chữ từng nhịp",4.5,Nt.words,Ls(0),Ot.words),Ac("tl-v-word-build","Dọc: dựng chữ từng nhịp",4.5,Nt.words,Ls(1),Ot.words),pc("tl-hero-swarm","Nhân vật chính + bầy thẻ bay quanh",5,Nt.swarm,Ds(0),Ot.swarm),Ac("tl-v-hero-swarm","Dọc: nhân vật chính + bầy thẻ bay quanh",5,Nt.swarm,Ds(1),Ot.swarm),pc("tl-feature-panel","Bảng tính năng + khung video",5,Nt.panel,Es(0),Ot.panel),Ac("tl-v-feature-panel","Dọc: bảng tính năng + khung video",5,Nt.panel,Es(1),Ot.panel),pc("tl-count-stairs","Số rải + bậc thang thẻ",4,Nt.count,qs(0),Ot.count),Ac("tl-v-count-stairs","Dọc: số rải + bậc thang thẻ",4,Nt.count,qs(1),Ot.count),pc("tl-player","Khung phát video + thời lượng",5,Nt.player,Gs(0),Ot.player),Ac("tl-v-player","Dọc: khung phát video + thời lượng",5,Nt.player,Gs(1),Ot.player),pc("tl-frames","Khung đầu / giữa / cuối",5.5,Nt.frames,Os(0),Ot.frames),Ac("tl-v-frames","Dọc: khung đầu / giữa / cuối",5.5,Nt.frames,Os(1),Ot.frames),pc("tl-4k-split","Tiêu đề 4K tách đôi + lưới mặt",4.5,Nt.k4,Ns(0),Ot.k4),Ac("tl-v-4k-split","Dọc: tiêu đề 4K tách đôi + lưới mặt",4.5,Nt.k4,Ns(1),Ot.k4),pc("tl-end-card","Thẻ kết sản phẩm",3.5,Nt.end,Is(0),Ot.end),Ac("tl-v-end-card","Dọc: thẻ kết sản phẩm",3.5,Nt.end,Is(1),Ot.end)],Us=Y.find(t=>t.id==="framed"),Ce=(t,e,c,o,n,s)=>({id:t,name:e,category:Us.name,pack:"framed",duration:c,params:{accent:Us.accent,position:"center",...o,style:"framed"},code:n,tags:s,formats:["landscape"]}),ec=(...t)=>({...Ce(...t),formats:["portrait"]}),or=t=>"const TL="+(t?"1":"PT?1:0")+",VW="+(t?"PT?W*.84:Math.min(S.w,H*.62)":"S.w")+",VX=cx-VW/2,VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT;",nr=(t,e)=>"const Q=Math.max(.05,Math.min(1,(+env.duration||"+e+")/"+e+"));t=t/Q;const W=env.width,H=env.height,D=(+env.duration||"+e+")/Q,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const HX=/^#[0-9a-f]{6}$/i,AC=HX.test(String(p.accent))?p.accent:'#ffc21a',INK='#f4f2ee',BG='#0e0e10',DIM='rgba(244,242,238,.58)',HR='rgba(244,242,238,.2)',ON=!(p.bg===false||p.bg==='false'||p.bg===0);"+or(t),sr=Object.freeze({win:"ww=TL?VW:W*.5,wh=TL?VH*.66:H*.7,wx=cx-ww/2,wy=TL?VT+VH*.07:H*.14",vs:"ww=TL?VW*.66:W*.3,wh=TL?VH*.5:H*.62,wx=cx-ww/2,wy=TL?VT+VH*.03:H*.15",head:"ww=TL?VW:W*.4,wh=TL?VH*.48:H*.76,wx=TL?VX:W*.53,wy=TL?VT:H*.12",chips:"ww=TL?VW:W*.47,wh=TL?VH*.48:H*.76,wx=TL?VX:W*.07,wy=TL?VT:H*.12",paper:"ww=TL?VW:W*.4,wh=TL?VH*.4:H*.76,wx=TL?VX:W*.06,wy=TL?VT:H*.12",cta:"ww=TL?VW*.52:W*.28,wh=TL?VH*.5:H*.44,wx=cx-ww/2,wy=TL?VT+VH*.3:H*.47"}),ir="u*.028",da=sr,lr={ww:"W*p.ww",wh:"H*p.wh",wx:"W*p.wx",wy:"H*p.wy"},rr="OV=[p.wx,p.wy,p.ww,p.wh].every(v=>v!=null&&v!==''&&Number.isFinite(+v))&&+p.ww>0&&+p.wh>0,"+da.win.split(",").map(t=>{const[e,c]=t.split(/=(.*)/);return e+"=OV?"+lr[e]+":("+c+")"}).join(","),xr="const BGD=(k=1)=>{if(!ON||k<=0)return;ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=BG;ctx.fillRect(0,0,W,H);let g=ctx.createRadialGradient(cx,H*.38,0,cx,H*.38,Math.max(W,H)*.7);g.addColorStop(0,'rgba(92,78,56,.26)');g.addColorStop(1,'rgba(92,78,56,0)');ctx.fillStyle=g;ctx.fillRect(0,0,W,H);const s=u*.1,oy=(t*u*.008)%s,x0=cx%s,y0=cy%s-oy;ctx.fillStyle='rgba(255,255,255,.035)';for(let x=x0;x<W;x+=s)ctx.fillRect(x,0,1,H);for(let y=y0;y<H;y+=s)if(y>=0)ctx.fillRect(0,y,W,1);ctx.fillStyle='rgba(255,255,255,.12)';const c=Math.max(2,u*.005);for(let x=x0;x<W;x+=s)for(let y=y0;y<H;y+=s)if(y>=0){ctx.fillRect(x-c,y,c*2+1,1);ctx.fillRect(x,y-c,1,c*2+1)}g=ctx.createRadialGradient(cx,cy,Math.min(W,H)*.3,cx,cy,Math.hypot(W,H)*.62);g.addColorStop(0,'rgba(0,0,0,0)');g.addColorStop(1,'rgba(0,0,0,.75)');ctx.fillStyle=g;ctx.fillRect(0,0,W,H);ctx.restore()};const OUT=(d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));ctx.save();if(o>0)ctx.globalAlpha*=1-o;return o};const WIN=(x,y,w,h,r)=>{if(!(w>2&&h>2))return;r=Math.min(r,w/2,h/2);if(ON){ctx.save();ctx.shadowColor='rgba(0,0,0,.6)';ctx.shadowBlur=u*.06;ctx.shadowOffsetY=u*.014;ctx.fillStyle='#000';ctx.beginPath();ctx.roundRect(x,y,w,h,r);ctx.fill();ctx.restore();ctx.save();ctx.beginPath();ctx.roundRect(x,y,w,h,r);ctx.clip();ctx.clearRect(x-2,y-2,w+4,h+4);ctx.restore()}ctx.save();ctx.strokeStyle=HR;ctx.lineWidth=Math.max(1,u*.0016);ctx.beginPath();ctx.roundRect(x,y,w,h,r);ctx.stroke();ctx.restore()};const BR=(x,y,w,h,L,k=1)=>{if(!(k>0))return;const l=L*M.clamp(k);ctx.save();ctx.strokeStyle=AC;ctx.lineWidth=Math.max(1.5,u*.004);ctx.lineCap='square';ctx.beginPath();[[x,y,1,1],[x+w,y,-1,1],[x,y+h,1,-1],[x+w,y+h,-1,-1]].forEach(c=>{ctx.moveTo(c[0],c[1]+c[3]*l);ctx.lineTo(c[0],c[1]);ctx.lineTo(c[0]+c[2]*l,c[1])});ctx.stroke();ctx.restore()};const LB=(s,x,y,z,al,col,k=1)=>{s=String(s==null?'':s).toUpperCase();if(!s||!(k>0)||!(z>0))return 0;ctx.save();ctx.globalAlpha*=M.clamp(k);ctx.font=sk.font(z,'s');M.ls(ctx,z*.2);ctx.fillStyle=col||DIM;ctx.textAlign=al||'left';ctx.textBaseline='middle';ctx.fillText(s,x,y);const w=ctx.measureText(s).width;ctx.restore();return w};const TY=(s,k)=>{s=String(s==null?'':s);return s.slice(0,Math.ceil(s.length*M.clamp(k)))};const PROG=(k=1)=>{if(!(k>0))return;const y=PT?H*.83:H*.94,a=PT?W*.075:W*.05,b=W-a,f=M.clamp(t/D),lw=Math.max(1,u*.0016);ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=HR;ctx.fillRect(a,y,b-a,lw);ctx.fillStyle=AC;ctx.fillRect(a,y-lw*.5,(b-a)*f,lw*2);ctx.beginPath();ctx.arc(a+(b-a)*f,y+lw*.5,Math.max(2,u*.005),0,M.TAU);ctx.fill();ctx.restore()};",Qa="const HLP=(txt,z,mw)=>{ctx.font=sk.font(z,'h');const sp=ctx.measureText(' ').width*1.05,out=[];let on=0;String(txt||'').split('/').forEach(gr=>{let row=[],rw=0;gr.split(' ').filter(Boolean).forEach(tk=>{const n=(tk.match(/[*]/g)||[]).length,a=on||tk[0]==='*';if(n%2)on=!on;const s=tk.replace(/[*]/g,'').toUpperCase();if(!s)return;const w=ctx.measureText(s).width;if(row.length&&rw+sp+w>mw){out.push(row);row=[];rw=0}const x=row.length?rw+sp:0;row.push({s,a,w,x});rw=x+w});if(row.length)out.push(row)});return out};const FIT=(txt,z,mw,mh,lh=1.04)=>{let L=[];for(let i=0;i<18;i++){L=HLP(txt,z,mw);if(L.length*z*lh<=mh&&L.every(r=>r[r.length-1].x+r[r.length-1].w<=mw+.5))break;z*=.9}return{L,z,lh:z*lh}};const HDRAW=(F,x,y0,al,t0,st,col,hl)=>{let j=0,last=null;F.L.forEach((r,i)=>{const rw=r[r.length-1].x+r[r.length-1].w,ox=al==='center'?x-rw/2:x,y=y0+i*F.lh+F.lh/2;r.forEach(w=>{const a=t0+j*st,k=M.ease.outCubic(M.range(t,a,a+.38));j++;if(k<=0)return;const yy=y+(1-k)*F.z*.42;ctx.save();ctx.globalAlpha*=k;if(hl&&w.a){const hk=M.ease.outCubic(M.range(t,a+.15,a+.5));ctx.fillStyle=AC;ctx.fillRect(ox+w.x-F.z*.08,yy-F.z*.42,(w.w+F.z*.16)*hk,F.z*.84)}const b=(1-k)*F.z*.09;if(b>.4)ctx.filter='blur('+b.toFixed(1)+'px)';ctx.font=sk.font(F.z,'h');ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillStyle=w.a&&!hl?AC:col||INK;ctx.fillText(w.s,ox+w.x,yy+F.z*.04);ctx.restore();last=[ox+w.x+w.w,y,k]})});return{n:j,last}};const CAR=(c,z,on)=>{if(!c||!on)return;ctx.fillStyle=AC;ctx.fillRect(c[0]+z*.1,c[1]-z*.4,Math.max(2,z*.07),z*.8)};",Ks=Qa.replace("const HDRAW=(F,x,y0,al,t0,st,col,hl)=>{","const HDRAW=(F,x,y0,al,t0,st,col,hl,tm)=>{").replace("const a=t0+j*st,","const a=tm&&Number.isFinite(tm[j])?tm[j]:t0+j*st,")+"const TM=String(p.times==null?'':p.times).split(',').map(x=>parseFloat(x)/Q);",js="const LN=(P,k,col,lw)=>{if(!(k>0)||P.length<2)return;let L=0;for(let i=1;i<P.length;i++)L+=Math.hypot(P[i][0]-P[i-1][0],P[i][1]-P[i-1][1]);let w=L*M.clamp(k);ctx.save();ctx.strokeStyle=col||HR;ctx.lineWidth=lw||Math.max(1,u*.0018);ctx.beginPath();ctx.moveTo(P[0][0],P[0][1]);for(let i=1;i<P.length&&w>0;i++){const d=Math.hypot(P[i][0]-P[i-1][0],P[i][1]-P[i-1][1]),f=Math.min(1,w/(d||1));ctx.lineTo(P[i-1][0]+(P[i][0]-P[i-1][0])*f,P[i-1][1]+(P[i][1]-P[i-1][1])*f);w-=d}ctx.stroke();ctx.restore()};",ga="const GW=(x,y,w,h,k,bk)=>{const e=M.ease.outExpo(M.clamp(k)),gw=w*(.82+.18*e),gh=h*(.08+.92*e),g=u*.016+Math.sin(t*2.2)*u*.002;if(e>0)WIN(x+(w-gw)/2,y+(h-gh)/2,gw,gh,"+ir+");BR(x-g,y-g,w+g*2,h+g*2,Math.min(w,h)*.12,M.ease.outCubic(M.clamp(bk)))};",cc=(t,e,c,o)=>`function render(ctx,t,env){
10094
10094
  // ${e}
10095
- ${ar(t,o)}${lr}${c}`,Ks=t=>`${cc(t,(t?"Vertical speaker window (9:16)":"Speaker window")+" — talking-head creator frame: the speaker inside a rounded window (transparent: put the footage UNDER this layer) with accent corner brackets, a typed label above it, an index on the right, a REC timecode under it and a hairline progress line along the bottom (fields: text = label above, sub = index on the right; accent, bg).",ga,4)}
10095
+ ${nr(t,o)}${xr}${c}`,Vs=t=>`${cc(t,(t?"Vertical speaker window (9:16)":"Speaker window")+" — talking-head creator frame: the speaker inside a rounded window (transparent: put the footage UNDER this layer) with accent corner brackets, a typed label above it, an index on the right, a REC timecode under it and a hairline progress line along the bottom (fields: text = label above, sub = index on the right; accent, bg).",ga,4)}
10096
10096
  BGD();const o=OUT()
10097
- const ${ir},z=Math.max(9,u*.023),ly=wy-u*.045
10097
+ const ${rr},z=Math.max(9,u*.023),ly=wy-u*.045
10098
10098
  GW(wx,wy,ww,wh,M.range(t,0,.6),M.range(t,.25,.75))
10099
10099
  const lk=M.range(t,.45,1.05);if(lk>0){ctx.fillStyle=AC;ctx.fillRect(wx,ly-z*.32,z*.64,z*.64);LB(TY(p.text,lk),wx+z*1.3,ly,z,'left',INK)}
10100
10100
  LB(p.sub,wx+ww,ly,z,'right',AC,M.range(t,.6,.9))
@@ -10102,7 +10102,7 @@
10102
10102
  const tk=M.range(t,.8,1.1);if(tk>0){ctx.save();ctx.globalAlpha*=tk;ctx.fillStyle=HR;for(let i=0;i<9;i++)ctx.fillRect(wx+ww-i*z*.9,by-z*(i%4?.25:.45),Math.max(1,u*.0016),z*(i%4?.5:.9));ctx.restore()}
10103
10103
  PROG(M.range(t,.3,.7))
10104
10104
  ctx.restore()
10105
- }`,js=t=>`${cc(t,(t?"Vertical A versus B (9:16)":"A versus B")+" — talking-head compare beat: the speaker window in the middle (transparent: footage UNDER this layer), the A word + glyph on one side and the B word + glyph on the other, small 01 / 02 index labels, a VERSUS label and hairline brackets joining them to the window (fields: items = 2 × glyph:WORD, sub = middle label; accent, bg).",ga+Us,4.5)}
10105
+ }`,$s=t=>`${cc(t,(t?"Vertical A versus B (9:16)":"A versus B")+" — talking-head compare beat: the speaker window in the middle (transparent: footage UNDER this layer), the A word + glyph on one side and the B word + glyph on the other, small 01 / 02 index labels, a VERSUS label and hairline brackets joining them to the window (fields: items = 2 × glyph:WORD, sub = middle label; accent, bg).",ga+js,4.5)}
10106
10106
  BGD();const o=OUT()
10107
10107
  const it=M.glyphItems(p,2);while(it.length<2)it.push({g:'sparkle',l:it.length?'B':'A'})
10108
10108
  const ${da.vs},g=u*.016
@@ -10118,7 +10118,7 @@
10118
10118
  const vk=M.range(t,.9,1.3);LB('/ '+String(p.sub||'versus'),cx,TL?gy:wy+wh+H*.08,lz,'center',DIM,vk)
10119
10119
  PROG(M.range(t,.3,.7))
10120
10120
  ctx.restore()
10121
- }`,Vs=t=>`${cc(t,(t?"Vertical stacked headline + speaker (9:16)":"Stacked headline beside the speaker")+" — talking-head kinetic title: big white caps lines beside the speaker window (transparent: footage UNDER this layer), each word slides up out of a blur in turn, the *accent* words in yellow, a typing caret blinks after the last word (fields: text = lines split by /, *word* = accent; sub = small label above; caret false = no caret; times = seconds per word (comma list, default the built-in rhythm); accent, bg).",ga+Is,4)}
10121
+ }`,Xs=t=>`${cc(t,(t?"Vertical stacked headline + speaker (9:16)":"Stacked headline beside the speaker")+" — talking-head kinetic title: big white caps lines beside the speaker window (transparent: footage UNDER this layer), each word slides up out of a blur in turn, the *accent* words in yellow, a typing caret blinks after the last word (fields: text = lines split by /, *word* = accent; sub = small label above; caret false = no caret; times = seconds per word (comma list, default the built-in rhythm); accent, bg).",ga+Ks,4)}
10122
10122
  BGD();const o=OUT()
10123
10123
  const ${da.head}
10124
10124
  GW(wx,wy,ww,wh,M.range(t,0,.5),M.range(t,.2,.6))
@@ -10129,7 +10129,7 @@
10129
10129
  const done=R.last&&R.last[2]>=1;if(!(p.caret===false||p.caret==='false')&&R.last)CAR(R.last,F.z,!done||Math.floor(t*2.4)%2===0)
10130
10130
  PROG(M.range(t,.3,.7))
10131
10131
  ctx.restore()
10132
- }`,$s=t=>`${cc(t,(t?"Vertical count-up clock to a word (9:16)":"Count-up clock to a word")+" — talking-head time stat (a countdown-style clock): a small label (THIS USED TO TAKE) over a big 00:00:00 clock that counts up to the hours with a tick ruler scrolling under it, then the label turns into the second one (NOW IT TAKES) and the clock slot-rolls away to a word in the accent (fields: number = hours, items = 2 labels, text = the word; accent, bg).","",4.5)}
10132
+ }`,Fs=t=>`${cc(t,(t?"Vertical count-up clock to a word (9:16)":"Count-up clock to a word")+" — talking-head time stat (a countdown-style clock): a small label (THIS USED TO TAKE) over a big 00:00:00 clock that counts up to the hours with a tick ruler scrolling under it, then the label turns into the second one (NOW IT TAKES) and the clock slot-rolls away to a word in the accent (fields: number = hours, items = 2 labels, text = the word; accent, bg).","",4.5)}
10133
10133
  BGD();const o=OUT()
10134
10134
  const lb=M.items(p,2),N=Number.isFinite(+p.number)?Math.round(M.clamp(+p.number,0,99)):48,wd=String(p.text||'').toUpperCase(),pd=x=>(x<10?'0':'')+x
10135
10135
  const mw=TL?VW:W*.78,yc=TL?VT+VH*.48:cy*1.02;let z=TL?VW*.24:H*.24;ctx.font=sk.font(z,'n');let dw=ctx.measureText('0').width,kw=ctx.measureText(':').width*1.1;const tw0=dw*6+kw*2;if(tw0>mw){z*=mw/tw0;dw*=mw/tw0;kw*=mw/tw0}const tw=dw*6+kw*2
@@ -10145,7 +10145,7 @@
10145
10145
  LB('00H',cx-tw/2,ry+z*.24,lz*.7,'left',DIM,rk);LB(N+'H',cx+tw/2,ry+z*.24,lz*.7,'right',DIM,rk)}
10146
10146
  PROG(M.range(t,.3,.7))
10147
10147
  ctx.restore()
10148
- }`,Xs=t=>`${cc(t,(t?"Vertical count-along chips (9:16)":"Count-along chips beside the speaker")+" — talking-head list counted on fingers: next to the speaker window (transparent: footage UNDER this layer) small pill chips (glyph dot + word + index) pop in one by one at their own times, the newest one lit in the accent, a 01 / 03 counter on top (fields: items = glyph:WORD × 2–5, times = seconds per chip (comma list, default even), sub = top label; accent, bg).",ga,4.5)}
10148
+ }`,Ys=t=>`${cc(t,(t?"Vertical count-along chips (9:16)":"Count-along chips beside the speaker")+" — talking-head list counted on fingers: next to the speaker window (transparent: footage UNDER this layer) small pill chips (glyph dot + word + index) pop in one by one at their own times, the newest one lit in the accent, a 01 / 03 counter on top (fields: items = glyph:WORD × 2–5, times = seconds per chip (comma list, default even), sub = top label; accent, bg).",ga,4.5)}
10149
10149
  BGD();const o=OUT()
10150
10150
  const it=M.glyphItems(p,5),n=Math.max(1,it.length),tm=String(p.times==null?'':p.times).split(',').map(x=>parseFloat(x)),R=D*Q,T=i=>(Number.isFinite(tm[i])?tm[i]:.7+i*Math.max(.2,(R-1.5)/n))/Q
10151
10151
  const ${da.chips}
@@ -10162,7 +10162,7 @@
10162
10162
  ctx.restore();LB('0'+(i+1),x0+(1-M.clamp(k))*ch*.9+cw-ch*.45,y+ch/2,lz*.9,'right',on?AC:DIM,Math.min(1,k))})
10163
10163
  PROG(M.range(t,.3,.7))
10164
10164
  ctx.restore()
10165
- }`,Fs=t=>`${cc(t,(t?"Vertical paper question + reply (9:16)":"Paper question card + reply")+" — talking-head question beat: an off-white paper card drops in, slightly turned, next to the speaker window (transparent: footage UNDER this layer) with a black question on it (* = highlighter word), then a small Or label and the reply builds word by word in white caps with a caret (fields: text = question, sub = reply (/ = line break, * = accent), label = the small word between; times = seconds per reply word (comma list); accent, bg).",ga+Is,5)}
10165
+ }`,_s=t=>`${cc(t,(t?"Vertical paper question + reply (9:16)":"Paper question card + reply")+" — talking-head question beat: an off-white paper card drops in, slightly turned, next to the speaker window (transparent: footage UNDER this layer) with a black question on it (* = highlighter word), then a small Or label and the reply builds word by word in white caps with a caret (fields: text = question, sub = reply (/ = line break, * = accent), label = the small word between; times = seconds per reply word (comma list); accent, bg).",ga+Ks,5)}
10166
10166
  BGD();const o=OUT()
10167
10167
  const ${da.paper}
10168
10168
  GW(wx,wy,ww,wh,M.range(t,0,.5),M.range(t,.2,.6))
@@ -10176,7 +10176,7 @@
10176
10176
  if(R.last)CAR(R.last,F2.z,R.last[2]<1||Math.floor(t*2.4)%2===0)
10177
10177
  PROG(M.range(t,.3,.7))
10178
10178
  ctx.restore()
10179
- }`,Ys=t=>`${cc(t,(t?"Vertical comment A or B end CTA (9:16)":"Comment A or B end CTA")+" — talking-head end call to action: a big COMMENT word, under it A or B in the accent with a small or, two glyph slots left and right and hairline brackets running down from the letters to them, the speaker window in the centre (transparent: footage UNDER this layer) (fields: text = big word, items = 2 × glyph:LETTER, sub = the small word between; accent, bg).",ga+Qa+Us,4.5)}
10179
+ }`,Qs=t=>`${cc(t,(t?"Vertical comment A or B end CTA (9:16)":"Comment A or B end CTA")+" — talking-head end call to action: a big COMMENT word, under it A or B in the accent with a small or, two glyph slots left and right and hairline brackets running down from the letters to them, the speaker window in the centre (transparent: footage UNDER this layer) (fields: text = big word, items = 2 × glyph:LETTER, sub = the small word between; accent, bg).",ga+Qa+js,4.5)}
10180
10180
  BGD();const o=OUT()
10181
10181
  const it=M.glyphItems(p,2);while(it.length<2)it.push({g:'sparkle',l:it.length?'B':'A'})
10182
10182
  const F=FIT(p.text,TL?VW*.2:H*.15,TL?VW:W*.8,TL?VH*.13:H*.17,.98);HDRAW(F,cx,TL?VT+VH*.01:H*.07,'center',.1,.1)
@@ -10191,7 +10191,7 @@
10191
10191
  const k=M.ease.outBack(M.range(t,t0+.35,t0+.7));if(k>0){ctx.save();ctx.translate(sx,sy);ctx.scale(k,k);ctx.fillStyle='rgba(255,255,255,.05)';ctx.strokeStyle=HR;ctx.lineWidth=Math.max(1,u*.0018)/k;ctx.beginPath();ctx.roundRect(-ss/2,-ss/2,ss,ss,ss*.2);ctx.fill();ctx.stroke();ctx.restore();M.glyph(ctx,q.g,sx,sy,ss*.5,{color:INK,glow:false,width:1.7,draw:M.range(t,t0+.45,t0+.95)});LB('0'+(i+1),sx,sy+ss*.5+lz*1.3,lz*.85,'center',AC,k)}})
10192
10192
  PROG(M.range(t,.3,.7))
10193
10193
  ctx.restore()
10194
- }`,_s=t=>`${cc(t,(t?"Vertical course chapter card (9:16)":"Course chapter card")+" — online-course chapter title: a small CHAPTER label in the accent, a huge chapter number whose digits roll into place, a hairline that draws across, the chapter title revealed word by word and a row of chapter pips (fields: number = chapter, text = title, sub = small label, total = number of chapters; accent, bg).",Qa,3.5)}
10194
+ }`,Zs=t=>`${cc(t,(t?"Vertical course chapter card (9:16)":"Course chapter card")+" — online-course chapter title: a small CHAPTER label in the accent, a huge chapter number whose digits roll into place, a hairline that draws across, the chapter title revealed word by word and a row of chapter pips (fields: number = chapter, text = title, sub = small label, total = number of chapters; accent, bg).",Qa,3.5)}
10195
10195
  BGD();const o=OUT()
10196
10196
  const n=Number.isFinite(+p.number)?Math.round(M.clamp(+p.number,0,99)):1,ns=(n<10?'0':'')+n,tot=Number.isFinite(+p.total)?Math.round(M.clamp(+p.total,0,12)):5
10197
10197
  const x0=TL?VX:W*.07,lz=Math.max(10,u*.026),ly=TL?VT+VH*.1:H*.2,nz=TL?VW*.5:H*.4,ny=TL?VT+VH*.28:H*.42,hy=TL?VT+VH*.47:H*.65
@@ -10203,7 +10203,7 @@
10203
10203
  const F=FIT(p.text,TL?VW*.15:H*.11,TL?VW:W*.8,TL?VH*.3:H*.2);HDRAW(F,x0,hy+(TL?VH*.04:H*.04),'left',.6,.12)
10204
10204
  if(tot>0){const pk=M.range(t,.9,1.3),pz=Math.max(4,u*.008),px=TL?x0:W*.93-tot*pz*3.2,py=TL?VB-VH*.02:H*.2;ctx.save();ctx.globalAlpha*=pk;for(let i=0;i<tot;i++){ctx.fillStyle=i+1===n?AC:i+1<n?INK:HR;ctx.fillRect(px+i*pz*3.2,py-pz/2,pz*2.4,pz)}ctx.restore();LB(ns+' / '+(tot<10?'0':'')+tot,TL?x0+tot*pz*3.2+lz:W*.93,TL?py:py-lz*1.6,lz*.85,TL?'left':'right',DIM,pk)}
10205
10205
  ctx.restore()
10206
- }`,Qs=t=>`${cc(t,(t?"Vertical definition callout (9:16)":"Definition callout")+" — online-course term card over the footage: a dark panel with accent corner brackets wipes open, a small DEFINITION label, the term in big accent caps, a hairline and the short definition in plain text line by line (fields: text = term, sub = definition, label = small label; position center | lower | top; accent).","",5)}
10206
+ }`,Js=t=>`${cc(t,(t?"Vertical definition callout (9:16)":"Definition callout")+" — online-course term card over the footage: a dark panel with accent corner brackets wipes open, a small DEFINITION label, the term in big accent caps, a hairline and the short definition in plain text line by line (fields: text = term, sub = definition, label = small label; position center | lower | top; accent).","",5)}
10207
10207
  const o=OUT()
10208
10208
  const pd=u*.04,cw=TL?VW:W*.38,x=TL?VX:W*.55,lz=Math.max(9,u*.023),iw=cw-pd*2
10209
10209
  let z=TL?VW*.13:H*.1;ctx.font=sk.font(z,'h');const tx=String(p.text||'').toUpperCase(),tw=ctx.measureText(tx).width;if(tw>iw)z*=iw/tw
@@ -10216,7 +10216,7 @@
10216
10216
  const hy=ty+z*.6+pd*.25;ctx.fillStyle=HR;ctx.fillRect(x+pd,hy,iw*M.ease.inOutCubic(M.range(t,.7,1.2)),Math.max(1,u*.0016))
10217
10217
  ctx.font=f.font;ctx.textAlign='left';ctx.textBaseline='middle';f.lines.forEach((l,i)=>{const a=M.ease.outCubic(M.range(t,1+i*.18,1.4+i*.18));if(a<=0)return;ctx.save();ctx.globalAlpha*=a;ctx.font=f.font;ctx.fillStyle='rgba(244,242,238,.86)';ctx.fillText(l,x+pd,hy+pd*.5+f.lh*(i+.5)+(1-a)*f.lh*.3);ctx.restore()})
10218
10218
  ctx.restore()
10219
- }`,Zs=t=>`${cc(t,(t?"Vertical recap checklist (9:16)":"Recap checklist")+" — online-course lesson recap: a big RECAP title with a small lesson label and a done counter, then 3–5 points revealing one by one, each ticked in the accent with a hairline rule under it (fields: text = title, items = points, sub = small label; accent, bg).",Qa,5)}
10219
+ }`,ti=t=>`${cc(t,(t?"Vertical recap checklist (9:16)":"Recap checklist")+" — online-course lesson recap: a big RECAP title with a small lesson label and a done counter, then 3–5 points revealing one by one, each ticked in the accent with a hairline rule under it (fields: text = title, items = points, sub = small label; accent, bg).",Qa,5)}
10220
10220
  BGD();const o=OUT()
10221
10221
  const it=M.items(p,5),n=Math.max(1,it.length),R=D*Q,T=i=>(.55+i*Math.max(.25,(R-1.8)/n))/Q,lz=Math.max(10,u*.024)
10222
10222
  if(!ON){ctx.save();ctx.fillStyle='rgba(10,10,12,.72)';ctx.beginPath();ctx.roundRect(TL?VX-u*.03:W*.05,TL?VT-u*.02:H*.1,TL?VW+u*.06:W*.9,TL?VH+u*.04:H*.8,u*.02);ctx.fill();ctx.restore()}
@@ -10230,7 +10230,7 @@
10230
10230
  let z=rh*.3;ctx.font=sk.font(z,'h');const tx=String(s).toUpperCase(),mw=lw-b*1.7,tw=ctx.measureText(tx).width;if(tw>mw)z*=mw/tw;ctx.font=sk.font(z,'h');ctx.fillStyle=ck>=1?INK:'rgba(244,242,238,.7)';ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillText(tx,lx+b*1.6,y+z*.04)
10231
10231
  ctx.fillStyle=HR;ctx.fillRect(lx,y+rh/2,lw*M.ease.inOutCubic(M.range(t,T(i)+.1,T(i)+.6)),Math.max(1,u*.0016));ctx.restore()})
10232
10232
  ctx.restore()
10233
- }`,Js=t=>`${cc(t,(t?"Vertical instructor lower third (9:16)":"Instructor lower third")+" — talking-head / course name tag over the footage: an accent tick bar grows, a tracked label types in, the name wipes out of the bar in heavy white caps, the role fades in under it and a hairline with an accent end square draws out (fields: text = name, sub = role, label = small label; position lower | top; accent).","",5)}
10233
+ }`,ei=t=>`${cc(t,(t?"Vertical instructor lower third (9:16)":"Instructor lower third")+" — talking-head / course name tag over the footage: an accent tick bar grows, a tracked label types in, the name wipes out of the bar in heavy white caps, the role fades in under it and a hairline with an accent end square draws out (fields: text = name, sub = role, label = small label; position lower | top; accent).","",5)}
10234
10234
  const o=OUT()
10235
10235
  const top=p.position==='top',x0=TL?W*.08:W*.06,ny=TL?(top?H*.2:H*.69):(top?H*.2:H*.79)
10236
10236
  let nz=TL?W*.08:H*.068;ctx.font=sk.font(nz,'h');const nm=String(p.text||'').toUpperCase(),mw=TL?W*.8:W*.5,nw0=ctx.measureText(nm).width;if(nw0>mw)nz*=mw/nw0
@@ -10243,10 +10243,10 @@
10243
10243
  const rk=M.ease.outCubic(M.range(t,.55,.95));if(rk>0&&rf.lines.length){ctx.save();ctx.globalAlpha*=rk;ctx.font=rf.font;ctx.fillStyle='rgba(244,242,238,.82)';ctx.textAlign='left';ctx.textBaseline='middle';ctx.shadowColor='rgba(0,0,0,.45)';ctx.shadowBlur=rz*.3;ctx.fillText(rf.lines[0],tx,ry+(1-rk)*rz*.4);ctx.restore()}
10244
10244
  const hk=M.ease.inOutCubic(M.range(t,.7,1.2)),hy=ry+rz*.95,hw=(ew+nz*.6)*hk;if(hk>0){ctx.fillStyle='rgba(244,242,238,.35)';ctx.fillRect(tx,hy,hw,Math.max(1,u*.0016));ctx.fillStyle=AC;ctx.fillRect(tx+hw-lz*.5,hy-lz*.25,lz*.5,lz*.5)}
10245
10245
  ctx.restore()
10246
- }`,ti=t=>`${cc(t,(t?"Vertical graphite backdrop (9:16)":"Graphite backdrop")+" — the Framed Creator paper alone, under the speaker and the scenes: near-black graphite with the faint square tile grid (slow drift), a warm lift and a vignette; no text, no window, no fade (fields: offset = seconds already played; bg).","",.5)}
10246
+ }`,ci=t=>`${cc(t,(t?"Vertical graphite backdrop (9:16)":"Graphite backdrop")+" — the Framed Creator paper alone, under the speaker and the scenes: near-black graphite with the faint square tile grid (slow drift), a warm lift and a vignette; no text, no window, no fade (fields: offset = seconds already played; bg).","",.5)}
10247
10247
  t=t+(Number.isFinite(+p.offset)?+p.offset:0)
10248
10248
  BGD()
10249
- }`,ac=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Gc=["talking-head","course"],oc=["editorial","minimal","bold"],yt={win:ac(Gc,["intro","hook","overlay"],oc),vs:ac([...Gc,"explainer"],["compare"],oc),head:ac(Gc,["title","hook","caption"],oc),clock:ac([...Gc,"explainer"],["stat","compare"],oc),chips:ac(Gc,["list","step"],oc),paper:ac(Gc,["hook","quote","compare"],oc),cta:ac(Gc,["cta","outro"],oc),chap:ac(["course","talking-head"],["chapter","title"],oc),def:ac(["course","explainer"],["explain","overlay"],oc),recap:ac(["course","talking-head"],["list","outro"],oc),lower:ac(Gc,["lower-third"],oc),back:ac(Gc,["background"],oc)},Ct={win:{text:"Creator notes",sub:"01"},vs:{items:"scissors:Editing|sparkle:Prompting",sub:"versus"},head:{text:"Impossible / to *scroll* / past.",sub:"Rule 01",caret:!0},clock:{number:48,items:"This used to take|Now it takes",text:"Minutes"},chips:{items:"sparkle:Graphics|pencil:Fonts|music:Sound",times:"",sub:"Three things"},paper:{text:"End of *editing*?",sub:"Just a / *better* / tool?",label:"or"},cta:{text:"Comment",items:"scissors:A|sparkle:B",sub:"or"},chap:{number:1,text:"Find your hook",sub:"Chapter",total:5},def:{text:"B-roll",sub:"Extra footage cut in over the voice to show what the speaker is talking about.",label:"Definition"},recap:{text:"Recap",items:"One idea per video|Hook in 2 seconds|Cut every pause|End on a question",sub:"Lesson 01"},lower:{text:"Lan Nguyen",sub:"Video editor · 8 years on reels",label:"Instructor",position:"lower"}},rr=[Ce("fr-window","Khung người nói + góc ngoặc",4,Ct.win,Ks(0),yt.win),ec("fr-v-window","Dọc: khung người nói + góc ngoặc",4,Ct.win,Ks(1),yt.win),Ce("fr-versus","So sánh A với B",4.5,Ct.vs,js(0),yt.vs),ec("fr-v-versus","Dọc: so sánh A với B",4.5,Ct.vs,js(1),yt.vs),Ce("fr-headline","Tiêu đề xếp tầng + con trỏ",4,Ct.head,Vs(0),yt.head),ec("fr-v-headline","Dọc: tiêu đề xếp tầng + con trỏ",4,Ct.head,Vs(1),yt.head),Ce("fr-clock","Đồng hồ đếm giờ → chữ",4.5,Ct.clock,$s(0),yt.clock),ec("fr-v-clock","Dọc: đồng hồ đếm giờ → chữ",4.5,Ct.clock,$s(1),yt.clock),Ce("fr-chips","Chip đếm theo ngón tay",4.5,Ct.chips,Xs(0),yt.chips),ec("fr-v-chips","Dọc: chip đếm theo ngón tay",4.5,Ct.chips,Xs(1),yt.chips),Ce("fr-paper","Thẻ giấy câu hỏi + trả lời",5,Ct.paper,Fs(0),yt.paper),ec("fr-v-paper","Dọc: thẻ giấy câu hỏi + trả lời",5,Ct.paper,Fs(1),yt.paper),Ce("fr-comment-cta","Kêu gọi bình luận A hay B",4.5,Ct.cta,Ys(0),yt.cta),ec("fr-v-comment-cta","Dọc: kêu gọi bình luận A hay B",4.5,Ct.cta,Ys(1),yt.cta),Ce("fr-chapter","Thẻ chương khoá học",3.5,Ct.chap,_s(0),yt.chap),ec("fr-v-chapter","Dọc: thẻ chương khoá học",3.5,Ct.chap,_s(1),yt.chap),Ce("fr-definition","Định nghĩa thuật ngữ",5,Ct.def,Qs(0),yt.def),ec("fr-v-definition","Dọc: định nghĩa thuật ngữ",5,Ct.def,Qs(1),yt.def),Ce("fr-recap","Tóm tắt bài học (checklist)",5,Ct.recap,Zs(0),yt.recap),ec("fr-v-recap","Dọc: tóm tắt bài học (checklist)",5,Ct.recap,Zs(1),yt.recap),Ce("fr-lower-third","Tên giảng viên (lower third)",5,Ct.lower,Js(0),yt.lower),ec("fr-v-lower-third","Dọc: tên giảng viên (lower third)",5,Ct.lower,Js(1),yt.lower),Ce("fr-backdrop","Nền than chì lưới ô",10,{},ti(0),yt.back),ec("fr-v-backdrop","Dọc: nền than chì lưới ô",10,{},ti(1),yt.back)],ei=Y.find(t=>t.id==="uibeats"),ua=(t,e,c,o,n)=>({id:t,name:e,category:ei.name,pack:"uibeats",duration:c,params:{accent:ei.accent,position:"center",...o,style:"uibeats"},code:n}),xr=[ua("ub-liked","Nút Thích bấm thành Đã thích",3.2,{text:"Thích",text2:"Đã thích"},`function render(ctx,t,env){
10249
+ }`,ac=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Oc=["talking-head","course"],oc=["editorial","minimal","bold"],yt={win:ac(Oc,["intro","hook","overlay"],oc),vs:ac([...Oc,"explainer"],["compare"],oc),head:ac(Oc,["title","hook","caption"],oc),clock:ac([...Oc,"explainer"],["stat","compare"],oc),chips:ac(Oc,["list","step"],oc),paper:ac(Oc,["hook","quote","compare"],oc),cta:ac(Oc,["cta","outro"],oc),chap:ac(["course","talking-head"],["chapter","title"],oc),def:ac(["course","explainer"],["explain","overlay"],oc),recap:ac(["course","talking-head"],["list","outro"],oc),lower:ac(Oc,["lower-third"],oc),back:ac(Oc,["background"],oc)},Ct={win:{text:"Creator notes",sub:"01"},vs:{items:"scissors:Editing|sparkle:Prompting",sub:"versus"},head:{text:"Impossible / to *scroll* / past.",sub:"Rule 01",caret:!0},clock:{number:48,items:"This used to take|Now it takes",text:"Minutes"},chips:{items:"sparkle:Graphics|pencil:Fonts|music:Sound",times:"",sub:"Three things"},paper:{text:"End of *editing*?",sub:"Just a / *better* / tool?",label:"or"},cta:{text:"Comment",items:"scissors:A|sparkle:B",sub:"or"},chap:{number:1,text:"Find your hook",sub:"Chapter",total:5},def:{text:"B-roll",sub:"Extra footage cut in over the voice to show what the speaker is talking about.",label:"Definition"},recap:{text:"Recap",items:"One idea per video|Hook in 2 seconds|Cut every pause|End on a question",sub:"Lesson 01"},lower:{text:"Lan Nguyen",sub:"Video editor · 8 years on reels",label:"Instructor",position:"lower"}},hr=[Ce("fr-window","Khung người nói + góc ngoặc",4,Ct.win,Vs(0),yt.win),ec("fr-v-window","Dọc: khung người nói + góc ngoặc",4,Ct.win,Vs(1),yt.win),Ce("fr-versus","So sánh A với B",4.5,Ct.vs,$s(0),yt.vs),ec("fr-v-versus","Dọc: so sánh A với B",4.5,Ct.vs,$s(1),yt.vs),Ce("fr-headline","Tiêu đề xếp tầng + con trỏ",4,Ct.head,Xs(0),yt.head),ec("fr-v-headline","Dọc: tiêu đề xếp tầng + con trỏ",4,Ct.head,Xs(1),yt.head),Ce("fr-clock","Đồng hồ đếm giờ → chữ",4.5,Ct.clock,Fs(0),yt.clock),ec("fr-v-clock","Dọc: đồng hồ đếm giờ → chữ",4.5,Ct.clock,Fs(1),yt.clock),Ce("fr-chips","Chip đếm theo ngón tay",4.5,Ct.chips,Ys(0),yt.chips),ec("fr-v-chips","Dọc: chip đếm theo ngón tay",4.5,Ct.chips,Ys(1),yt.chips),Ce("fr-paper","Thẻ giấy câu hỏi + trả lời",5,Ct.paper,_s(0),yt.paper),ec("fr-v-paper","Dọc: thẻ giấy câu hỏi + trả lời",5,Ct.paper,_s(1),yt.paper),Ce("fr-comment-cta","Kêu gọi bình luận A hay B",4.5,Ct.cta,Qs(0),yt.cta),ec("fr-v-comment-cta","Dọc: kêu gọi bình luận A hay B",4.5,Ct.cta,Qs(1),yt.cta),Ce("fr-chapter","Thẻ chương khoá học",3.5,Ct.chap,Zs(0),yt.chap),ec("fr-v-chapter","Dọc: thẻ chương khoá học",3.5,Ct.chap,Zs(1),yt.chap),Ce("fr-definition","Định nghĩa thuật ngữ",5,Ct.def,Js(0),yt.def),ec("fr-v-definition","Dọc: định nghĩa thuật ngữ",5,Ct.def,Js(1),yt.def),Ce("fr-recap","Tóm tắt bài học (checklist)",5,Ct.recap,ti(0),yt.recap),ec("fr-v-recap","Dọc: tóm tắt bài học (checklist)",5,Ct.recap,ti(1),yt.recap),Ce("fr-lower-third","Tên giảng viên (lower third)",5,Ct.lower,ei(0),yt.lower),ec("fr-v-lower-third","Dọc: tên giảng viên (lower third)",5,Ct.lower,ei(1),yt.lower),Ce("fr-backdrop","Nền than chì lưới ô",10,{},ci(0),yt.back),ec("fr-v-backdrop","Dọc: nền than chì lưới ô",10,{},ci(1),yt.back)],ai=Y.find(t=>t.id==="uibeats"),ua=(t,e,c,o,n)=>({id:t,name:e,category:ai.name,pack:"uibeats",duration:c,params:{accent:ai.accent,position:"center",...o,style:"uibeats"},code:n}),fr=[ua("ub-liked","Nút Thích bấm thành Đã thích",3.2,{text:"Thích",text2:"Đã thích"},`function render(ctx,t,env){
10250
10250
  // A pill button rises in; the cursor glides to it and clicks; the pill fills with the accent, a heart pops and the label turns to the second text.
10251
10251
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),u=S.u
10252
10252
  const inn=M.ease.outBack(M.range(t,0,.5)),go=M.ease.inCubic(M.range(t,D-.4,D)),hit=1.35,on=M.range(t,hit,hit+.01)
@@ -10362,9 +10362,9 @@
10362
10362
  ctx.save();ctx.translate(S.cx,py);ctx.scale(pk,pk);const g=ctx.createLinearGradient(-bw/2,0,bw/2,0);g.addColorStop(0,M.mix(sk.acc,'#2f7bff',.6));g.addColorStop(1,sk.acc);ctx.fillStyle=g;ctx.shadowColor=M.rgba(sk.acc,.6);ctx.shadowBlur=f2;M.rr(ctx,-bw/2,-bh/2,bw,bh,bh/2);ctx.fill();ctx.shadowColor='transparent'
10363
10363
  ctx.fillStyle='#ffffff';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(lab,0,f2*.03);ctx.restore()}
10364
10364
  ctx.restore()
10365
- }`)],ci=Y.find(t=>t.id==="clipooxstudio"),Pt=(t,e,c,o,n,s)=>({id:t,name:e,category:ci.name,pack:"clipooxstudio",duration:c,params:{accent:ci.accent,position:"center",...o,style:"clipooxstudio"},code:n,tags:s}),hr=(t,e)=>"const Q=Math.max(.05,Math.min(1,(+env.duration||"+e+")/"+e+"));t=t/Q;const W=env.width,H=env.height,D=env.duration/Q,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const HX=/^#[0-9a-f]{6}$/i,AC=HX.test(String(p.accent))?p.accent:'#8afb00',AI=M.readable(AC),DK=p.theme==='dark'?1:p.theme==='light'?0:"+t+",INK=DK?'#f3f5ef':'#141611',MU=DK?'rgba(243,245,239,.55)':'rgba(20,22,17,.52)',BG=DK?'#0c0e0b':'#f6f1e8',CF=DK?'#17191b':'#ffffff',LN=DK?'rgba(255,255,255,.1)':'rgba(20,22,17,.1)',ON=!(p.bg===false||p.bg==='false'||p.bg===0),TAU=M.TAU;",fr="const BGD=(k=1)=>{if(!ON||k<=0)return;ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=BG;ctx.fillRect(0,0,W,H);if(DK){const g=ctx.createRadialGradient(W*.5,H*.55,0,W*.5,H*.55,Math.max(W,H)*.7);g.addColorStop(0,M.rgba(AC,.12));g.addColorStop(1,M.rgba(AC,0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H);const s=u*.045,o=(t*s*.3)%s,d=Math.max(1,u*.0026);ctx.fillStyle='rgba(255,255,255,.08)';for(let y=s-o;y<H;y+=s)for(let x=s/2;x<W;x+=s)ctx.fillRect(x,y,d,d)}else{[[.08,.1,'#ffc4ad',.6],[.94,.92,AC,.3],[.96,.06,'#ffe39a',.4]].forEach((q,i)=>{const a=t*.2+i*2,X=W*(q[0]+.04*Math.sin(a)),Y=H*(q[1]+.04*Math.cos(a)),g=ctx.createRadialGradient(X,Y,0,X,Y,Math.max(W,H)*.62);g.addColorStop(0,M.rgba(q[2],q[3]));g.addColorStop(1,M.rgba(q[2],0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)})}ctx.restore()};const OUT=(d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));ctx.save();if(o>0){ctx.globalAlpha*=1-o;ctx.translate(cx,cy);ctx.scale(1+o*.05,1+o*.05);ctx.translate(-cx,-cy)}return o};const TT=(s,x,y,z,al,col,r,w)=>{s=String(s==null?'':s);if(!s||!(z>0))return 0;ctx.font=sk.font(z,r||'h',w);ctx.textAlign=al||'left';ctx.textBaseline='middle';ctx.fillStyle=col;ctx.fillText(s,x,y);return ctx.measureText(s).width};const TW=(s,z,r,w)=>{ctx.font=sk.font(z,r||'h',w);return ctx.measureText(String(s==null?'':s)).width};const SEG=s=>String(s||'').split('*').map((x,i)=>({s:x,it:i%2===1})).filter(q=>q.s);const RICH=(s,x,y,z,al,col,ic,r)=>{const g=SEG(s),ws=g.map(q=>TW(q.s,q.it?z*1.06:z,q.it?'q':r||'h')),tot=ws.reduce((a,b)=>a+b,0),x0=al==='center'?x-tot/2:al==='right'?x-tot:x;let xx=x0;const it=[];g.forEach((q,i)=>{TT(q.s,xx,y+(q.it?z*.02:0),q.it?z*1.06:z,'left',q.it&&ic?ic:col,q.it?'q':r||'h');if(q.it)it.push([xx,ws[i]]);xx+=ws[i]});return{w:tot,x0,it}};const FZ=(s,z,mw,r)=>{const tot=SEG(s).reduce((a,q)=>a+TW(q.s,q.it?z*1.06:z,q.it?'q':r||'h'),0);return tot>mw?z*mw/tot:z};const TY=(s,k)=>{const a=Array.from(String(s||''));return a.slice(0,Math.round(a.length*M.clamp(k))).join('')};const SH=(b=.05,a)=>{ctx.shadowColor=DK?'rgba(0,0,0,.55)':'rgba(70,45,20,'+(a||.14)+')';ctx.shadowBlur=u*b;ctx.shadowOffsetY=u*b*.25};const NS=()=>{ctx.shadowColor='transparent';ctx.shadowBlur=0;ctx.shadowOffsetY=0};",ba="const CK=(x,y,s,col,k=1)=>{if(k<=0)return;ctx.save();ctx.strokeStyle=col;ctx.lineWidth=s*.2;ctx.lineCap='round';ctx.lineJoin='round';ctx.beginPath();ctx.moveTo(x-s*.45,y);ctx.lineTo(x-s*.12,y+s*.32);if(k>.5)ctx.lineTo(x-s*.12+(s*.6)*M.clamp((k-.5)*2),y+s*.32-(s*.72)*M.clamp((k-.5)*2));ctx.stroke();ctx.restore()};",Ha="const CONF=(k=1,n=14,sd=5,m=1)=>{if(k<=0)return;const R=M.rand(sd),cols=[AC,INK,'#ff7a59',AC,'#ffb21a'];ctx.save();for(let i=0;i<n;i++){let x=R(),y=R();const ty=Math.floor(R()*6),s=u*(.011+R()*.02)*m,sp=.4+R()*.6;if(Math.abs(x-.5)<.3&&Math.abs(y-.5)<.27)x=x<.5?x*.5:1-(1-x)*.5;const pk=M.ease.outBack(M.range(t,.05+i*.035,.45+i*.035))*k;if(pk<=0)continue;const a=t*sp+i,X=W*x+Math.sin(a)*u*.025,Y=H*y+Math.cos(a*.8)*u*.02;ctx.save();ctx.translate(X,Y);ctx.rotate(a*.6);ctx.scale(pk,pk);const c=cols[i%5];ctx.fillStyle=c;ctx.strokeStyle=c;ctx.lineWidth=s*.28;ctx.beginPath();if(ty===0)ctx.arc(0,0,s*.5,0,TAU);else if(ty===1)ctx.arc(0,0,s*.55,0,TAU);else if(ty===2)ctx.rect(-s*.45,-s*.45,s*.9,s*.9);else if(ty===3){ctx.moveTo(0,-s*.6);ctx.lineTo(s*.55,s*.4);ctx.lineTo(-s*.55,s*.4);ctx.closePath()}else if(ty===4)M.rr(ctx,-s*.9,-s*.28,s*1.8,s*.56,s*.28);else{ctx.moveTo(0,-s*.6);ctx.lineTo(s*.6,0);ctx.lineTo(0,s*.6);ctx.lineTo(-s*.6,0);ctx.closePath()}if(ty===1||ty===5)ctx.stroke();else ctx.fill();ctx.restore()}ctx.restore()};",ai="const WIN=(x,y,w,h,title,hi=1)=>{ctx.save();SH(.05);M.rr(ctx,x,y,w,h,u*.018);ctx.fillStyle='#16181b';ctx.fill();NS();ctx.strokeStyle=hi?M.rgba(AC,.85):'rgba(255,255,255,.1)';ctx.lineWidth=Math.max(1.5,u*.0028);if(hi){ctx.shadowColor=M.rgba(AC,.45);ctx.shadowBlur=u*.02}M.rr(ctx,x,y,w,h,u*.018);ctx.stroke();NS();const hb=Math.max(u*.04,h*.07);['#ff5f57','#febc2e','#28c840'].forEach((c,i)=>{ctx.fillStyle=c;ctx.beginPath();ctx.arc(x+hb*.55+i*hb*.42,y+hb*.5,hb*.12,0,TAU);ctx.fill()});ctx.fillStyle='rgba(255,255,255,.06)';ctx.fillRect(x,y+hb,w,Math.max(1,u*.0015));if(title)TT(title,x+hb*2.1,y+hb*.52,hb*.36,'left','#f3f5ef','s','600');ctx.restore();return y+hb};",oi="const PILL=(x,y,s,z,fill,col,r)=>{const w=TW(s,z,r||'s','600')+z*1.6,h=z*1.9;M.rr(ctx,x-w/2,y-h/2,w,h,h/2);ctx.fillStyle=fill;ctx.fill();TT(s,x,y,z,'center',col,r||'s','600');return [w,h]};",zt=(t,e,c,o)=>`function render(ctx,t,env){
10365
+ }`)],oi=Y.find(t=>t.id==="clipooxstudio"),Pt=(t,e,c,o,n,s)=>({id:t,name:e,category:oi.name,pack:"clipooxstudio",duration:c,params:{accent:oi.accent,position:"center",...o,style:"clipooxstudio"},code:n,tags:s}),pr=(t,e)=>"const Q=Math.max(.05,Math.min(1,(+env.duration||"+e+")/"+e+"));t=t/Q;const W=env.width,H=env.height,D=env.duration/Q,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const HX=/^#[0-9a-f]{6}$/i,AC=HX.test(String(p.accent))?p.accent:'#8afb00',AI=M.readable(AC),DK=p.theme==='dark'?1:p.theme==='light'?0:"+t+",INK=DK?'#f3f5ef':'#141611',MU=DK?'rgba(243,245,239,.55)':'rgba(20,22,17,.52)',BG=DK?'#0c0e0b':'#f6f1e8',CF=DK?'#17191b':'#ffffff',LN=DK?'rgba(255,255,255,.1)':'rgba(20,22,17,.1)',ON=!(p.bg===false||p.bg==='false'||p.bg===0),TAU=M.TAU;",dr="const BGD=(k=1)=>{if(!ON||k<=0)return;ctx.save();ctx.globalAlpha*=k;ctx.fillStyle=BG;ctx.fillRect(0,0,W,H);if(DK){const g=ctx.createRadialGradient(W*.5,H*.55,0,W*.5,H*.55,Math.max(W,H)*.7);g.addColorStop(0,M.rgba(AC,.12));g.addColorStop(1,M.rgba(AC,0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H);const s=u*.045,o=(t*s*.3)%s,d=Math.max(1,u*.0026);ctx.fillStyle='rgba(255,255,255,.08)';for(let y=s-o;y<H;y+=s)for(let x=s/2;x<W;x+=s)ctx.fillRect(x,y,d,d)}else{[[.08,.1,'#ffc4ad',.6],[.94,.92,AC,.3],[.96,.06,'#ffe39a',.4]].forEach((q,i)=>{const a=t*.2+i*2,X=W*(q[0]+.04*Math.sin(a)),Y=H*(q[1]+.04*Math.cos(a)),g=ctx.createRadialGradient(X,Y,0,X,Y,Math.max(W,H)*.62);g.addColorStop(0,M.rgba(q[2],q[3]));g.addColorStop(1,M.rgba(q[2],0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)})}ctx.restore()};const OUT=(d=.35)=>{const o=M.ease.inCubic(M.range(t,D-d,D));ctx.save();if(o>0){ctx.globalAlpha*=1-o;ctx.translate(cx,cy);ctx.scale(1+o*.05,1+o*.05);ctx.translate(-cx,-cy)}return o};const TT=(s,x,y,z,al,col,r,w)=>{s=String(s==null?'':s);if(!s||!(z>0))return 0;ctx.font=sk.font(z,r||'h',w);ctx.textAlign=al||'left';ctx.textBaseline='middle';ctx.fillStyle=col;ctx.fillText(s,x,y);return ctx.measureText(s).width};const TW=(s,z,r,w)=>{ctx.font=sk.font(z,r||'h',w);return ctx.measureText(String(s==null?'':s)).width};const SEG=s=>String(s||'').split('*').map((x,i)=>({s:x,it:i%2===1})).filter(q=>q.s);const RICH=(s,x,y,z,al,col,ic,r)=>{const g=SEG(s),ws=g.map(q=>TW(q.s,q.it?z*1.06:z,q.it?'q':r||'h')),tot=ws.reduce((a,b)=>a+b,0),x0=al==='center'?x-tot/2:al==='right'?x-tot:x;let xx=x0;const it=[];g.forEach((q,i)=>{TT(q.s,xx,y+(q.it?z*.02:0),q.it?z*1.06:z,'left',q.it&&ic?ic:col,q.it?'q':r||'h');if(q.it)it.push([xx,ws[i]]);xx+=ws[i]});return{w:tot,x0,it}};const FZ=(s,z,mw,r)=>{const tot=SEG(s).reduce((a,q)=>a+TW(q.s,q.it?z*1.06:z,q.it?'q':r||'h'),0);return tot>mw?z*mw/tot:z};const TY=(s,k)=>{const a=Array.from(String(s||''));return a.slice(0,Math.round(a.length*M.clamp(k))).join('')};const SH=(b=.05,a)=>{ctx.shadowColor=DK?'rgba(0,0,0,.55)':'rgba(70,45,20,'+(a||.14)+')';ctx.shadowBlur=u*b;ctx.shadowOffsetY=u*b*.25};const NS=()=>{ctx.shadowColor='transparent';ctx.shadowBlur=0;ctx.shadowOffsetY=0};",ba="const CK=(x,y,s,col,k=1)=>{if(k<=0)return;ctx.save();ctx.strokeStyle=col;ctx.lineWidth=s*.2;ctx.lineCap='round';ctx.lineJoin='round';ctx.beginPath();ctx.moveTo(x-s*.45,y);ctx.lineTo(x-s*.12,y+s*.32);if(k>.5)ctx.lineTo(x-s*.12+(s*.6)*M.clamp((k-.5)*2),y+s*.32-(s*.72)*M.clamp((k-.5)*2));ctx.stroke();ctx.restore()};",Ha="const CONF=(k=1,n=14,sd=5,m=1)=>{if(k<=0)return;const R=M.rand(sd),cols=[AC,INK,'#ff7a59',AC,'#ffb21a'];ctx.save();for(let i=0;i<n;i++){let x=R(),y=R();const ty=Math.floor(R()*6),s=u*(.011+R()*.02)*m,sp=.4+R()*.6;if(Math.abs(x-.5)<.3&&Math.abs(y-.5)<.27)x=x<.5?x*.5:1-(1-x)*.5;const pk=M.ease.outBack(M.range(t,.05+i*.035,.45+i*.035))*k;if(pk<=0)continue;const a=t*sp+i,X=W*x+Math.sin(a)*u*.025,Y=H*y+Math.cos(a*.8)*u*.02;ctx.save();ctx.translate(X,Y);ctx.rotate(a*.6);ctx.scale(pk,pk);const c=cols[i%5];ctx.fillStyle=c;ctx.strokeStyle=c;ctx.lineWidth=s*.28;ctx.beginPath();if(ty===0)ctx.arc(0,0,s*.5,0,TAU);else if(ty===1)ctx.arc(0,0,s*.55,0,TAU);else if(ty===2)ctx.rect(-s*.45,-s*.45,s*.9,s*.9);else if(ty===3){ctx.moveTo(0,-s*.6);ctx.lineTo(s*.55,s*.4);ctx.lineTo(-s*.55,s*.4);ctx.closePath()}else if(ty===4)M.rr(ctx,-s*.9,-s*.28,s*1.8,s*.56,s*.28);else{ctx.moveTo(0,-s*.6);ctx.lineTo(s*.6,0);ctx.lineTo(0,s*.6);ctx.lineTo(-s*.6,0);ctx.closePath()}if(ty===1||ty===5)ctx.stroke();else ctx.fill();ctx.restore()}ctx.restore()};",ni="const WIN=(x,y,w,h,title,hi=1)=>{ctx.save();SH(.05);M.rr(ctx,x,y,w,h,u*.018);ctx.fillStyle='#16181b';ctx.fill();NS();ctx.strokeStyle=hi?M.rgba(AC,.85):'rgba(255,255,255,.1)';ctx.lineWidth=Math.max(1.5,u*.0028);if(hi){ctx.shadowColor=M.rgba(AC,.45);ctx.shadowBlur=u*.02}M.rr(ctx,x,y,w,h,u*.018);ctx.stroke();NS();const hb=Math.max(u*.04,h*.07);['#ff5f57','#febc2e','#28c840'].forEach((c,i)=>{ctx.fillStyle=c;ctx.beginPath();ctx.arc(x+hb*.55+i*hb*.42,y+hb*.5,hb*.12,0,TAU);ctx.fill()});ctx.fillStyle='rgba(255,255,255,.06)';ctx.fillRect(x,y+hb,w,Math.max(1,u*.0015));if(title)TT(title,x+hb*2.1,y+hb*.52,hb*.36,'left','#f3f5ef','s','600');ctx.restore();return y+hb};",si="const PILL=(x,y,s,z,fill,col,r)=>{const w=TW(s,z,r||'s','600')+z*1.6,h=z*1.9;M.rr(ctx,x-w/2,y-h/2,w,h,h/2);ctx.fillStyle=fill;ctx.fill();TT(s,x,y,z,'center',col,r||'s','600');return [w,h]};",zt=(t,e,c,o)=>`function render(ctx,t,env){
10366
10366
  // ${e}
10367
- ${hr(t,o)}${fr}${c}`,pr=`${zt(0,"AI prompt box + send button opener — a question with one *italic serif* word sits over a white prompt box with an accent edge; the prompt types itself in, a chip shows the tool, the cursor glides to the lime send button and clicks it, confetti drifts around (fields: text = question, * = italic word; sub = typed prompt; items = chip text; theme, accent, bg).",Ha,5)}
10367
+ ${pr(t,o)}${dr}${c}`,gr=`${zt(0,"AI prompt box + send button opener — a question with one *italic serif* word sits over a white prompt box with an accent edge; the prompt types itself in, a chip shows the tool, the cursor glides to the lime send button and clicks it, confetti drifts around (fields: text = question, * = italic word; sub = typed prompt; items = chip text; theme, accent, bg).",Ha,5)}
10368
10368
  BGD();CONF(1,16,7);OUT(.35)
10369
10369
  const bw=PT?W*.86:Math.min(W*.56,u*1.25),bh=bw*(PT?.36:.22),bx=cx-bw/2,by=cy-bh*(PT?.2:.28),qk=M.ease.outCubic(M.range(t,.05,.45)),qs=String(p.text||''),z=FZ(qs,PT?W*.075:H*.075,bw*1.05)
10370
10370
  ctx.save();ctx.globalAlpha*=qk;RICH(qs,cx,by-z*1.1-(1-qk)*u*.03,z,'center',INK);ctx.restore()
@@ -10379,7 +10379,7 @@
10379
10379
  ctx.restore()
10380
10380
  if(t>tc-.85){const ck=M.ease.inOutCubic(M.range(t,tc-.8,tc)),x0=cx+bw*.05,y0=by+bh*1.7;M.cursor(ctx,M.lerp(x0,sx+sr*.15,ck),M.lerp(y0,sy+sr*.15,ck),u*.034,pk>0&&pk<1?pk:0)}
10381
10381
  ctx.restore()
10382
- }`,dr=`${zt(0,"Launch title — a brand line, a huge title with one *italic serif* word, a bezier underline drawn with pen handles, a tagline and a lime pill CTA over confetti (fields: text = title, * = italic word; sub = tagline; items = brand line | CTA; theme, accent, bg).",Ha,5)}
10382
+ }`,ur=`${zt(0,"Launch title — a brand line, a huge title with one *italic serif* word, a bezier underline drawn with pen handles, a tagline and a lime pill CTA over confetti (fields: text = title, * = italic word; sub = tagline; items = brand line | CTA; theme, accent, bg).",Ha,5)}
10383
10383
  BGD();CONF(1,18,3);OUT(.35)
10384
10384
  const ts=String(p.text||''),z=FZ(ts,PT?W*.15:H*.17,PT?W*.88:W*.78),ty=cy-z*(PT?.35:.25),tk=M.ease.outExpo(M.range(t,.15,.75))
10385
10385
  const IT=M.items(p,2),lb=IT[0]||'',lz=z*.2;if(lb){ctx.save();ctx.globalAlpha*=M.range(t,.05,.4);const w=TW(lb,lz,'s','600')+lz*1.8,h=lz*1.9;M.rr(ctx,cx-w/2,ty-z*.95-h/2,w,h,h/2);ctx.fillStyle=AC;ctx.fill();TT(lb,cx,ty-z*.95,lz,'center',AI,'s','600');ctx.restore()}
@@ -10390,7 +10390,7 @@
10390
10390
  const sb=String(p.sub||''),sz=z*.2,sk2=M.ease.outCubic(M.range(t,.9,1.3));if(sb&&sk2>0){ctx.save();ctx.globalAlpha*=sk2;const y=yb+z*.55+(1-sk2)*sz;RICH(sb,cx,y,sz,'center',MU,INK,'s');ctx.restore()}
10391
10391
  const bd=IT[1]||'',bk=M.ease.outBack(M.range(t,1.15,1.55));if(bd&&bk>0){const y=yb+z*1.25,bz=z*.17,w=TW(bd,bz,'s','600')+bz*4.2,h=bz*2.3;ctx.save();ctx.translate(cx,y);ctx.scale(bk,bk);ctx.shadowColor=M.rgba(AC,.55);ctx.shadowBlur=u*.03;M.rr(ctx,-w/2,-h/2,w,h,h/2);ctx.fillStyle=AC;ctx.fill();NS();TT(bd,-w/2+bz*1.1,0,bz,'left',AI,'s','600');const ax=w/2-h*.52;ctx.fillStyle=AI;ctx.beginPath();ctx.arc(ax,0,h*.34,0,TAU);ctx.fill();ctx.fillStyle=AC;ctx.beginPath();ctx.moveTo(ax-h*.09,-h*.14);ctx.lineTo(ax+h*.15,0);ctx.lineTo(ax-h*.09,h*.14);ctx.fill();ctx.restore()}
10392
10392
  ctx.restore()
10393
- }`,gr=`${zt(1,"Cursor click — a blurred tab bar drifts behind; a big cursor glides in with a motion trail and clicks a large accent button, which squashes, rings and turns into a done state with a check (fields: items = tab names, text = button, sub = done text; theme, accent, bg).",ba,4)}
10393
+ }`,br=`${zt(1,"Cursor click — a blurred tab bar drifts behind; a big cursor glides in with a motion trail and clicks a large accent button, which squashes, rings and turns into a done state with a check (fields: items = tab names, text = button, sub = done text; theme, accent, bg).",ba,4)}
10394
10394
  BGD();OUT(.3)
10395
10395
  const tabs=M.items(p,5),tz=PT?W*.045:H*.05,ty=PT?H*.32:H*.27;ctx.save();ctx.filter='blur('+Math.round(u*.006)+'px)';ctx.globalAlpha*=.55;let tw=tabs.reduce((a,s)=>a+TW(s,tz,'s','500')+tz*3.2,0),tx=cx-tw/2-t*u*.02;tabs.forEach((s,i)=>{ctx.fillStyle=i===1?M.rgba(INK,.5):M.rgba(INK,.25);M.rr(ctx,tx,ty-tz*.5,tz,tz,tz*.25);ctx.fill();const w=TW(s,tz,'s','500');TT(s,tx+tz*1.5,ty,tz,'left',INK,'s','500');tx+=w+tz*3.2});ctx.filter='none';ctx.restore()
10396
10396
  const bw=PT?W*.74:W*.42,bh=PT?W*.17:H*.16,bx=cx-bw/2,by=(PT?H*.52:H*.56)-bh/2,ek=M.ease.outBack(M.range(t,.1,.5)),tc=Math.min(D-1.2,1.6),pk=M.range(t,tc,tc+.45),dn=t>=tc+.2,sq=1-.08*Math.sin(Math.PI*M.clamp(pk*2.2))
@@ -10402,7 +10402,7 @@
10402
10402
  const at=k=>[M.lerp(x0,x1,k)+Math.sin(k*Math.PI)*u*.05+dr,M.lerp(y0,y1,k)-Math.sin(k*Math.PI)*u*.12+dr*.4]
10403
10403
  if(tr>0){for(let i=4;i>=1;i--){const q=at(Math.max(0,M.ease.inOutCubic(M.range(t-i*.025,.35,tc))));if(tr<1){ctx.save();ctx.globalAlpha*=.09*(5-i);M.cursor(ctx,q[0],q[1],cs,0);ctx.restore()}}const q=at(e);M.cursor(ctx,q[0],q[1],cs*(1-.1*Math.sin(Math.PI*M.clamp(pk*2.2))),0)}
10404
10404
  ctx.restore()
10405
- }`,ur=`${zt(0,"File browser window — a dark app window slides up with a sidebar and a grid of clip tiles; one tile lights up in the accent, the cursor grabs it and it lifts out of the window as an accent file pill (fields: text = window title, items = sidebar entries, sub = file name; theme, accent, bg).",ai,5)}
10405
+ }`,Mr=`${zt(0,"File browser window — a dark app window slides up with a sidebar and a grid of clip tiles; one tile lights up in the accent, the cursor grabs it and it lifts out of the window as an accent file pill (fields: text = window title, items = sidebar entries, sub = file name; theme, accent, bg).",ni,5)}
10406
10406
  BGD();OUT(.3)
10407
10407
  const ww=PT?W*.9:W*.66,wh=PT?H*.5:H*.66,wx=cx-ww/2,ek=M.ease.outExpo(M.range(t,.05,.55)),wy=(PT?H*.2:H*.13)+(1-ek)*H*.4
10408
10408
  ctx.save();ctx.globalAlpha*=M.clamp(ek*1.5);const top=WIN(wx,wy,ww,wh,String(p.text||'').toUpperCase(),1),sb=ww*(PT?.3:.2),hz=Math.max(7,u*.018)
@@ -10414,7 +10414,7 @@
10414
10414
  if(pick>0){const fn=String(p.sub||''),fz=u*.03,pw=M.lerp(cw*.84,TW(fn,fz,'s','600')+fz*2.4,M.clamp(lift*1.4)),ph=M.lerp(chh*.62,fz*2.2,M.clamp(lift*1.4));ctx.save();ctx.shadowColor=M.rgba(AC,.55);ctx.shadowBlur=u*.03;M.rr(ctx,px-pw/2,py-ph/2,pw,ph,Math.min(ph/2,u*.006+lift*ph));ctx.fillStyle=lift>.3?AC:M.mix('#2a3a30',AC,lift/.3);ctx.fill();NS();ctx.globalAlpha*=M.range(lift,.45,.8);TT(fn,px,py,fz,'center',AI,'s','600');ctx.restore()}
10415
10415
  if(t>.9){const ck=M.ease.inOutCubic(M.range(t,.9,1.5)),x=M.lerp(W*.95,hx+cw*.12,ck)+(px-hx)*lift,y=M.lerp(H*.95,hy+chh*.08,ck)+(py-hy)*lift;M.cursor(ctx,x,y,u*.036,pick>0&&pick<1?pick:0)}
10416
10416
  ctx.restore()
10417
- }`,br=`${zt(1,"Editing timeline fix — an editor panel with a preview, clip lanes and a moving playhead; red error marks flash on a lane while a chat line types the finding, a second accent line types the fix and the marks turn into accent clips with a check (fields: text = finding, sub = fix line; theme, accent, bg).",ai+ba,5.5)}
10417
+ }`,yr=`${zt(1,"Editing timeline fix — an editor panel with a preview, clip lanes and a moving playhead; red error marks flash on a lane while a chat line types the finding, a second accent line types the fix and the marks turn into accent clips with a check (fields: text = finding, sub = fix line; theme, accent, bg).",ni+ba,5.5)}
10418
10418
  BGD();OUT(.3)
10419
10419
  const pw=PT?W*.92:W*.72,ph=PT?H*.46:H*.62,px=cx-pw/2,py=PT?H*.3:H*.27,ek=M.ease.outExpo(M.range(t,.05,.5))
10420
10420
  ctx.save();ctx.globalAlpha*=M.clamp(ek*1.5);ctx.translate(cx,py+ph/2);ctx.scale(.94+.06*ek,.94+.06*ek);ctx.translate(-cx,-(py+ph/2))
@@ -10429,7 +10429,7 @@
10429
10429
  if(ak>0){ctx.save();ctx.strokeStyle=INK;ctx.lineWidth=Math.max(1.5,cz*.1);M.rr(ctx,px,cyy-cz*.55,cz*1.1,cz*1.1,cz*.3);ctx.stroke();TT(TY(a,ak),px+cz*1.6,cyy,cz,'left',INK,'s','500');ctx.restore()}
10430
10430
  if(bk>0){ctx.save();M.rr(ctx,px,cyy+cz*1.4,cz*1.1,cz*1.1,cz*.3);ctx.fillStyle=AC;ctx.fill();TT(TY(b,bk),px+cz*1.6,cyy+cz*1.95,cz,'left',DK?AC:INK,'s','500');ctx.restore()}
10431
10431
  ctx.restore()
10432
- }`,Mr=`${zt(1,"Generating card — a dark card with a fine grid and a soft accent glow holds an accent-edged pill with a spinning ring and the working label; a progress line fills, then the ring turns into a check and the label into the done text (fields: text = working label, sub = done label; theme, accent, bg).",ba,4)}
10432
+ }`,wr=`${zt(1,"Generating card — a dark card with a fine grid and a soft accent glow holds an accent-edged pill with a spinning ring and the working label; a progress line fills, then the ring turns into a check and the label into the done text (fields: text = working label, sub = done label; theme, accent, bg).",ba,4)}
10433
10433
  BGD();OUT(.3)
10434
10434
  const cw=PT?W*.84:W*.5,ch=PT?cw*.7:cw*.56,x=cx-cw/2,y=cy-ch/2,ek=M.ease.outExpo(M.range(t,.05,.45))
10435
10435
  ctx.save();ctx.globalAlpha*=M.clamp(ek*1.5);ctx.translate(cx,cy);ctx.scale(.9+.1*ek,.9+.1*ek);ctx.translate(-cx,-cy);SH(.05);M.rr(ctx,x,y,cw,ch,u*.02);ctx.fillStyle='#121411';ctx.fill();NS()
@@ -10441,7 +10441,7 @@
10441
10441
  TT(lab,ix+lz*.9,0,lz,'left',AC,'s','600');ctx.restore()
10442
10442
  const bk=M.ease.inOutCubic(M.range(t,.5,Math.min(D-1,2.7))),bw=cw*.5;ctx.fillStyle='rgba(255,255,255,.08)';M.rr(ctx,cx-bw/2,cy+phh*1.2,bw,u*.006,u*.003);ctx.fill();ctx.fillStyle=AC;M.rr(ctx,cx-bw/2,cy+phh*1.2,bw*bk,u*.006,u*.003);ctx.fill()
10443
10443
  ctx.restore();ctx.restore()
10444
- }`,yr=`${zt(1,"3D card fan — footage cards slide in from the right and fan out in perspective over the dot grid, each with a small label and an accent dot, the last (hero) card stands upright with an accent glow edge (fields: items = card labels, text = hero label; theme, accent, bg).","",5)}
10444
+ }`,mr=`${zt(1,"3D card fan — footage cards slide in from the right and fan out in perspective over the dot grid, each with a small label and an accent dot, the last (hero) card stands upright with an accent glow edge (fields: items = card labels, text = hero label; theme, accent, bg).","",5)}
10445
10445
  BGD();OUT(.3)
10446
10446
  const L=M.items(p,5),n=5,fk=M.ease.outExpo(M.range(t,.05,1.1)),dr=Math.sin(t*.6)*u*.006,hues=[['#ff9a6b','#3a2a55'],['#6bc4ff','#1c3a4a'],['#ffd36b','#4a3a1c'],['#9a6bff','#24183a'],['#6bffb0','#163a2a']],R=M.rand(12)
10447
10447
  const fy=PT?H*.3:cy,h0=PT?H*.13:H*.3,x0=PT?W*.06:W*.06,span=PT?W*.62:W*.5
@@ -10452,7 +10452,7 @@
10452
10452
  if(hk>0){ctx.save();ctx.translate(hx+hw/2,hy+hh/2);ctx.scale(hk,hk);ctx.translate(-hw/2,-hh/2);ctx.shadowColor=M.rgba(AC,.75);ctx.shadowBlur=u*.06;const g=ctx.createLinearGradient(0,0,hw,hh);g.addColorStop(0,'#ff6b9a');g.addColorStop(1,'#3a1626');M.rr(ctx,0,0,hw,hh,u*.014);ctx.fillStyle=g;ctx.fill();NS();ctx.fillStyle='rgba(255,255,255,.3)';ctx.beginPath();ctx.arc(hw*.5,hh*.36,hw*.16,0,TAU);ctx.fill();ctx.fillStyle='rgba(0,0,0,.25)';ctx.beginPath();ctx.moveTo(0,hh*.74);ctx.quadraticCurveTo(hw*.4,hh*.6,hw,hh*.72);ctx.lineTo(hw,hh);ctx.lineTo(0,hh);ctx.fill();ctx.strokeStyle=AC;ctx.lineWidth=Math.max(2,u*.004);M.rr(ctx,0,0,hw,hh,u*.014);ctx.stroke();ctx.restore()
10453
10453
  const lab=String(p.text||''),lz=u*.026;if(lab){ctx.save();ctx.globalAlpha*=M.range(t,.9,1.2);ctx.fillStyle=AC;ctx.beginPath();ctx.arc(hx+hw/2-TW(lab,lz,'s','600')/2-lz*.8,hy-lz*1.4,lz*.3,0,TAU);ctx.fill();TT(lab,hx+hw/2+lz*.2,hy-lz*1.4,lz,'center','#e9ece4','s','600');ctx.restore()}}
10454
10454
  ctx.restore()
10455
- }`,wr=`${zt(1,"Motion code editor — a code panel types keyframe code with coloured tokens while an accent-edged speed graph draws its overshoot curve with handles, a dot rides it and accent key diamonds land on the lanes below (fields: text = graph title; theme, accent, bg).","",5)}
10455
+ }`,kr=`${zt(1,"Motion code editor — a code panel types keyframe code with coloured tokens while an accent-edged speed graph draws its overshoot curve with handles, a dot rides it and accent key diamonds land on the lanes below (fields: text = graph title; theme, accent, bg).","",5)}
10456
10456
  BGD();OUT(.3)
10457
10457
  const pw=PT?W*.9:W*.38,ph=PT?H*.24:H*.5,cxp=PT?cx-pw/2:W*.07,cyp=PT?H*.13:H*.16,gw=PT?W*.9:W*.45,gh=PT?H*.3:H*.5,gx=PT?cx-gw/2:W*.48,gy=PT?H*.42:H*.16,ek=M.ease.outExpo(M.range(t,.05,.5))
10458
10458
  ctx.save();ctx.globalAlpha*=M.clamp(ek*1.5);[[cxp,cyp,pw,ph,0],[gx,gy,gw,gh,1]].forEach(q=>{SH(.04);M.rr(ctx,q[0],q[1],q[2],q[3],u*.014);ctx.fillStyle='#141613';ctx.fill();NS();ctx.strokeStyle=q[4]?AC:'rgba(255,255,255,.1)';ctx.lineWidth=q[4]?Math.max(1.5,u*.003):1;if(q[4]){ctx.shadowColor=M.rgba(AC,.4);ctx.shadowBlur=u*.02}M.rr(ctx,q[0],q[1],q[2],q[3],u*.014);ctx.stroke();NS()})
@@ -10466,7 +10466,7 @@
10466
10466
  ctx.restore()
10467
10467
  const ly=PT?H*.78:H*.74,lw=PT?W*.9:W*.86,lx=cx-lw/2;for(let l=0;l<3;l++){const y=ly+l*u*.04;ctx.fillStyle='rgba(255,255,255,.05)';M.rr(ctx,lx,y,lw,u*.026,u*.006);ctx.fill();for(let j=0;j<5;j++){const kk=M.ease.outBack(M.range(t,1+l*.2+j*.12,1.3+l*.2+j*.12));if(kk<=0)continue;const x=lx+lw*(.1+j*.2+l*.04),s=u*.01*kk;ctx.save();ctx.translate(x,y+u*.013);ctx.rotate(Math.PI/4);ctx.fillStyle=j%2?'#e9ece4':AC;ctx.fillRect(-s,-s,s*2,s*2);ctx.restore()}}
10468
10468
  ctx.restore()
10469
- }`,mr=`${zt(0,"Render card — a white card shows a spinner dot, 'rendering' with the file name and a frame counter that runs up to the total, a strip of footage thumbnails fills left to right and an accent progress bar with a knob slides to 100 % (fields: text = file name, sub = status word while it renders, number = total frames; theme, accent, bg).",Ha+ba,4.5)}
10469
+ }`,Sr=`${zt(0,"Render card — a white card shows a spinner dot, 'rendering' with the file name and a frame counter that runs up to the total, a strip of footage thumbnails fills left to right and an accent progress bar with a knob slides to 100 % (fields: text = file name, sub = status word while it renders, number = total frames; theme, accent, bg).",Ha+ba,4.5)}
10470
10470
  BGD();CONF(.8,12,9);OUT(.3)
10471
10471
  const cw=PT?W*.88:W*.58,ch=cw*(PT?.62:.4),x=cx-cw/2,y=cy-ch/2,ek=M.ease.outBack(M.range(t,.05,.45))
10472
10472
  ctx.save();ctx.translate(cx,cy);ctx.scale(.9+.1*ek,.9+.1*ek);ctx.translate(-cx,-cy);ctx.globalAlpha*=M.clamp(ek*1.5);SH(.06);M.rr(ctx,x,y,cw,ch,u*.02);ctx.fillStyle=CF;ctx.fill();NS();ctx.strokeStyle=M.rgba(AC,.9);ctx.lineWidth=Math.max(1.5,u*.003);M.rr(ctx,x,y,cw,ch,u*.02);ctx.stroke()
@@ -10477,7 +10477,7 @@
10477
10477
  const by=y+ch*.84,bw=cw*.84,bx=x+cw*.08,bh=Math.max(4,u*.008);ctx.fillStyle=DK?'rgba(255,255,255,.1)':'rgba(20,22,17,.08)';M.rr(ctx,bx,by-bh/2,bw,bh,bh/2);ctx.fill();ctx.fillStyle=AC;M.rr(ctx,bx,by-bh/2,Math.max(bh,bw*pr),bh,bh/2);ctx.fill();ctx.fillStyle=CF;ctx.strokeStyle=AC;ctx.lineWidth=Math.max(2,u*.003);ctx.beginPath();ctx.arc(bx+bw*pr,by,bh*1.3,0,TAU);ctx.fill();ctx.stroke()
10478
10478
  for(let i=0;i<5;i++)TT(i*5+'s',bx+bw*i/4,by+bh*3.2,hz*.6,'center',MU,'s','500')
10479
10479
  ctx.restore();ctx.restore()
10480
- }`,kr=`${zt(1,"Talking-head callout overlay — a small caps label slides in, then a huge heavy word punches in from big to size in the accent with a motion smear, a small line under it, and optional accent segment bars fill one by one (fields: text = big word, sub = line under, items = small line above, number = bar count 0–8; accent, position).","",3.5)}
10480
+ }`,vr=`${zt(1,"Talking-head callout overlay — a small caps label slides in, then a huge heavy word punches in from big to size in the accent with a motion smear, a small line under it, and optional accent segment bars fill one by one (fields: text = big word, sub = line under, items = small line above, number = bar count 0–8; accent, position).","",3.5)}
10481
10481
  OUT(.3)
10482
10482
  const y0=S.y,z=FZ(String(p.text||'').toUpperCase(),PT?W*.17:H*.17,S.w*.9,'n'),lab=String(M.items(p,1)[0]||'').toUpperCase(),sb=String(p.sub||'').toUpperCase(),sh=()=>{ctx.shadowColor='rgba(0,0,0,.55)';ctx.shadowBlur=z*.18;ctx.shadowOffsetY=z*.04}
10483
10483
  const lk=M.ease.outCubic(M.range(t,.05,.35));if(lab&&lk>0){ctx.save();ctx.globalAlpha*=lk;sh();TT(lab,cx-(1-lk)*u*.05,y0-z*.78,z*.22,'center','#ffffff','n');ctx.restore()}
@@ -10485,14 +10485,14 @@
10485
10485
  const sk2=M.ease.outCubic(M.range(t,.5,.8));if(sb&&sk2>0){ctx.save();ctx.globalAlpha*=sk2;sh();TT(sb,cx,y0+z*.74+(1-sk2)*z*.2,z*.22,'center','#ffffff','n');ctx.restore()}
10486
10486
  const nb=Math.max(0,Math.min(8,Math.round(+p.number||0)));if(nb){const bw=Math.min(S.w*.7,z*4),gap=bw*.02,sw=(bw-gap*(nb-1))/nb,by=y0+z*(sb?1.12:.8),bh=Math.max(4,z*.08);for(let i=0;i<nb;i++){const k=M.range(t,.7+i*.12,.9+i*.12),x=cx-bw/2+i*(sw+gap);ctx.fillStyle='rgba(255,255,255,.3)';M.rr(ctx,x,by,sw,bh,bh/2);ctx.fill();if(k>0){ctx.fillStyle=AC;M.rr(ctx,x,by,sw*k,bh,bh/2);ctx.fill()}}}
10487
10487
  ctx.restore()
10488
- }`,Sr=`${zt(1,"Timer ring overlay — an accent ring sweeps around a dark disc while the number counts up to its value, the unit word sits beside it (fields: number = value, text = unit; accent, position).","",3)}
10488
+ }`,Tr=`${zt(1,"Timer ring overlay — an accent ring sweeps around a dark disc while the number counts up to its value, the unit word sits beside it (fields: number = value, text = unit; accent, position).","",3)}
10489
10489
  OUT(.3)
10490
10490
  const r=PT?W*.1:H*.11,N=+p.number||0,ix=cx-(TW(String(p.text||''),r*.7,'n')+r*.4)/2,y=S.y,k=M.ease.outBack(M.range(t,.05,.4)),sw=M.ease.inOutCubic(M.range(t,.2,Math.min(D-.9,1.6)))
10491
10491
  ctx.save();ctx.translate(ix,y);ctx.scale(k,k);ctx.fillStyle='rgba(10,12,10,.6)';ctx.beginPath();ctx.arc(0,0,r,0,TAU);ctx.fill();ctx.strokeStyle='rgba(255,255,255,.18)';ctx.lineWidth=r*.12;ctx.beginPath();ctx.arc(0,0,r*.86,0,TAU);ctx.stroke();ctx.strokeStyle=AC;ctx.lineCap='round';ctx.shadowColor=M.rgba(AC,.6);ctx.shadowBlur=r*.3;ctx.beginPath();ctx.arc(0,0,r*.86,-Math.PI/2,-Math.PI/2+TAU*Math.max(.001,sw));ctx.stroke();NS()
10492
10492
  const v=Number.isInteger(N)?Math.round(N*sw):(N*sw).toFixed(1);TT(String(v),0,r*.04,r*1.05,'center','#ffffff','n');ctx.restore()
10493
10493
  const uk=M.ease.outCubic(M.range(t,.3,.6));ctx.save();ctx.globalAlpha*=uk;ctx.shadowColor='rgba(0,0,0,.5)';ctx.shadowBlur=r*.2;TT(String(p.text||'').toUpperCase(),ix+r*1.25+(1-uk)*r*.3,y,r*.7,'left','#ffffff','n');ctx.restore()
10494
10494
  ctx.restore()
10495
- }`,vr=`${zt(0,"Pen tool to logo — a pen cursor draws a smooth bezier loop with anchor squares, handles and a live size tag; the path lifts away and the brand word lands inside an accent selection box with handles and size marks, then an accent badge pops under it (fields: text = brand word, sub = badge text; theme, accent, bg).",oi,5)}
10495
+ }`,Cr=`${zt(0,"Pen tool to logo — a pen cursor draws a smooth bezier loop with anchor squares, handles and a live size tag; the path lifts away and the brand word lands inside an accent selection box with handles and size marks, then an accent badge pops under it (fields: text = brand word, sub = badge text; theme, accent, bg).",si,5)}
10496
10496
  BGD();OUT(.3)
10497
10497
  const bw=PT?W*.62:W*.36,bh=bw*.46,ox=cx,oy=cy-(PT?H*.05:0),dk=M.ease.inOutCubic(M.range(t,.15,1.5)),fade=1-M.range(t,1.5,1.9)
10498
10498
  const E=a=>[ox+Math.cos(a)*bw*.5,oy+Math.sin(a)*bh*.5*(Math.sin(a)>0?.55:1)]
@@ -10501,7 +10501,7 @@
10501
10501
  const lk=M.ease.outBack(M.range(t,1.6,2.1)),wz=FZ(String(p.text||''),bh*.85,(PT?W*.7:bw*1.1)-bh*.9,'n');if(lk>0){const ww=TW(String(p.text||''),wz,'n'),sx=cx-ww/2-wz*.25,sy=oy-wz*.62,sw2=ww+wz*.5,sh2=wz*1.24;ctx.save();ctx.translate(cx,oy);ctx.scale(lk,lk);ctx.translate(-cx,-oy);ctx.fillStyle=AC;M.rr(ctx,sx-wz*.95,oy-wz*.42,wz*.8,wz*.8,wz*.22);ctx.fill();TT(String(p.text||''),cx+wz*.05,oy+wz*.03,wz,'center',INK,'n');ctx.strokeStyle=AC;ctx.lineWidth=Math.max(1.5,u*.0028);ctx.strokeRect(sx-wz*1.05,sy,sw2+wz*1.05,sh2);const hs=u*.011;[[0,0],[.5,0],[1,0],[0,.5],[1,.5],[0,1],[.5,1],[1,1]].forEach(q=>{const x=sx-wz*1.05+(sw2+wz*1.05)*q[0],y=sy+sh2*q[1];ctx.fillStyle=CF;ctx.fillRect(x-hs/2,y-hs/2,hs,hs);ctx.strokeRect(x-hs/2,y-hs/2,hs,hs)});ctx.restore()}
10502
10502
  const bd=String(p.sub||''),bk=M.ease.outBack(M.range(t,2.2,2.6));if(bd&&bk>0){ctx.save();ctx.translate(cx,oy+bh*.5+u*.13);ctx.scale(bk,bk);PILL(0,0,bd.toUpperCase(),u*.03,AC,AI,'s');ctx.restore()}
10503
10503
  ctx.restore()
10504
- }`,Tr=`${zt(1,"Multiplayer headline — two huge heavy lines stagger in; three coloured cursors with name tags glide to letters, one letter gets an accent selection box with handles and turns accent, another turns coral, a tiny swatch strip appears (fields: items = 2 headline lines, sub = three names split by |; theme, accent, bg).","",5)}
10504
+ }`,Ar=`${zt(1,"Multiplayer headline — two huge heavy lines stagger in; three coloured cursors with name tags glide to letters, one letter gets an accent selection box with handles and turns accent, another turns coral, a tiny swatch strip appears (fields: items = 2 headline lines, sub = three names split by |; theme, accent, bg).","",5)}
10505
10505
  BGD();OUT(.3)
10506
10506
  const Ls=M.items(p,2).map(s=>s.toUpperCase()),z=Math.min(...Ls.map(s=>FZ(s,PT?W*.2:H*.24,PT?W*.82:W*.7,'n'))),lh=z*1.02,x0=PT?W*.05:W*.1,y0=cy-lh*.45,N=String(p.sub||'').split('|').map(s=>s.trim()).filter(Boolean)
10507
10507
  const pos=[];Ls.forEach((s,li)=>{const k=M.ease.outExpo(M.range(t,.1+li*.18,.6+li*.18)),lx=x0+(li?(PT?W*.06:W*.12):0),ly=y0+li*lh;ctx.font=sk.font(z,'n');ctx.textBaseline='middle';ctx.textAlign='left';let x=lx;Array.from(s).forEach((c,ci)=>{const w=ctx.measureText(c).width;pos.push([x,ly,w,li,ci]);x+=w});ctx.save();ctx.globalAlpha*=k;ctx.translate((1-k)*u*.15*(li?-1:1),0);ctx.fillStyle=INK;ctx.fillText(s,lx,ly);ctx.restore()})
@@ -10511,7 +10511,7 @@
10511
10511
  ;[A,B,C2].forEach((q,i)=>{if(!q)return;const k=M.ease.inOutCubic(M.range(t,.05+i*.1,.55+i*.1));if(k<=0)return;const tx=q[0]+q[2]*.7,ty=q[1]+z*.25,sx=i===1?-W*.1:W*1.1,sy=i===2?H*1.1:H*(.1+i*.2),x=M.lerp(sx,tx,k)+Math.sin(t*1.3+i)*u*.004,y=M.lerp(sy,ty,k)+Math.cos(t*1.1+i)*u*.004,cs=u*.03;ctx.save();ctx.translate(x,y);ctx.scale(cs,cs);ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(.25,1);ctx.lineTo(.45,.55);ctx.lineTo(.95,.4);ctx.closePath();ctx.fillStyle=cols[i];ctx.fill();ctx.restore();const nm=N[i]||'';if(nm){const nz=u*.018,nw=TW(nm,nz,'s','600')+nz*1.4,nh=nz*1.8;M.rr(ctx,x+cs*.7,y+cs*.9,nw,nh,nh*.3);ctx.fillStyle=cols[i];ctx.fill();TT(nm,x+cs*.7+nw/2,y+cs*.9+nh/2,nz,'center',i?'#ffffff':AI,'s','600')}})
10512
10512
  const sk3=M.range(t,2.4,2.8);if(sk3>0){const sz=u*.022,sxx=PT?W*.08:W*.78,syy=y0+lh*1.75;ctx.save();ctx.globalAlpha*=sk3;M.rr(ctx,sxx-sz*.4,syy-sz*.4,sz*6,sz*1.8,sz*.4);ctx.fillStyle=DK?'#1b1d1a':'#ffffff';ctx.fill();[AC,'#ff7a59','#7b8cff','#ffb21a'].forEach((c,i)=>{ctx.fillStyle=c;ctx.beginPath();ctx.arc(sxx+sz*.6+i*sz*1.3,syy+sz*.5,sz*.42,0,TAU);ctx.fill()});ctx.restore()}
10513
10513
  ctx.restore()
10514
- }`,Cr=`${zt(0,"Three phone variants — three phone mockups slide in (dark, accent, light), each with an avatar, a balance card holding the number and three list rows; the middle one lifts forward with an accent glow edge and its variant chips appear below (fields: text = balance number, sub = account name, items = 3 variant names; theme, accent, bg).",Ha+oi,5)}
10514
+ }`,Rr=`${zt(0,"Three phone variants — three phone mockups slide in (dark, accent, light), each with an avatar, a balance card holding the number and three list rows; the middle one lifts forward with an accent glow edge and its variant chips appear below (fields: text = balance number, sub = account name, items = 3 variant names; theme, accent, bg).",Ha+si,5)}
10515
10515
  BGD();CONF(.7,10,21);OUT(.3)
10516
10516
  const ph=PT?H*.42:H*.68,pw=ph*.48,gap=PT?pw*.62:pw*1.16,V=M.items(p,3),T3=[['#15171a','#2a2d33','#e9ece4'],[AC,M.mix(AC,'#0b0d0a',.35),AI],['#fffaf3','#ffe2cf','#141611']]
10517
10517
  ;[0,2,1].forEach(i=>{const mid=i===1,ek=M.ease.outExpo(M.range(t,.1+(mid?.15:0),.7+(mid?.15:0))),lift=mid?M.ease.outBack(M.range(t,1,1.5)):0,x=cx+(i-1)*gap*ek-pw/2,y=cy-ph/2-lift*u*.03+(1-ek)*H*.3+(PT?-H*.04:0),s=mid?1+.06*lift:.92;ctx.save();ctx.globalAlpha*=M.clamp(ek*1.4);ctx.translate(x+pw/2,y+ph/2);ctx.scale(s,s);ctx.translate(-pw/2,-ph/2)
@@ -10522,7 +10522,7 @@
10522
10522
  for(let r=0;r<3;r++){const ry=ph*(.55+r*.1),dc=['#4ade80','#60a5fa','#f87171'][r];ctx.fillStyle=dc;ctx.beginPath();ctx.arc(pw*.17,ry,pw*.035,0,TAU);ctx.fill();ctx.fillStyle=M.rgba(fg,.75);M.rr(ctx,pw*.25,ry-pw*.018,pw*.32,pw*.036,pw*.018);ctx.fill();ctx.fillStyle=M.rgba(fg,.45);M.rr(ctx,pw*.68,ry-pw*.018,pw*.16,pw*.036,pw*.018);ctx.fill()}
10523
10523
  ctx.restore();const vk=M.range(t,1.3+i*.1,1.6+i*.1);if(V[i]&&vk>0){ctx.save();ctx.globalAlpha*=vk;const vz=u*.026;PILL(x+pw/2,y+ph+vz*2.2+(mid?u*.02:0),V[i],vz,mid?AC:(DK?'#1b1d1a':'#ffffff'),mid?AI:INK,'s');ctx.restore()}})
10524
10524
  ctx.restore()
10525
- }`,Ar=`${zt(1,"CTA to logo — an accent CTA button sits in a selection box with a size tag; the cursor clicks it (squash + ring), then the button folds into an accent logo tile and the brand word slides out beside it (fields: text = button label, sub = brand word; theme, accent, bg).","",5)}
10525
+ }`,Pr=`${zt(1,"CTA to logo — an accent CTA button sits in a selection box with a size tag; the cursor clicks it (squash + ring), then the button folds into an accent logo tile and the brand word slides out beside it (fields: text = button label, sub = brand word; theme, accent, bg).","",5)}
10526
10526
  BGD();OUT(.3)
10527
10527
  const bz=PT?W*.055:H*.055,lab=String(p.text||''),bw=TW(lab,bz,'s','600')+bz*3.2,bh=bz*2.5,tc=Math.min(D-2.4,1.5),pk=M.range(t,tc,tc+.4),fold=M.ease.inOutCubic(M.range(t,tc+.6,tc+1.2)),ek=M.ease.outBack(M.range(t,.05,.45))
10528
10528
  const ls=bh*1.25,w=M.lerp(bw,ls,fold),h=M.lerp(bh,ls,fold),wd=String(p.sub||''),wz=ls*.72,ww=TW(wd,wz,'n'),gx=cx-fold*(ww+ls*.3)/2,sq=1-.1*Math.sin(Math.PI*M.clamp(pk*2.5))
@@ -10533,7 +10533,7 @@
10533
10533
  if(fold>0){ctx.save();ctx.beginPath();ctx.rect(gx+ls*.6,cy-ls,ww+ls,ls*2);ctx.clip();TT(wd,gx+ls*.65-(1-fold)*ww,cy+wz*.04,wz,'left',INK,'n');ctx.restore()}
10534
10534
  if(t>.5&&t<tc+.9){const ck=M.ease.inOutCubic(M.range(t,.5,tc)),out=M.range(t,tc+.4,tc+.9);ctx.save();ctx.globalAlpha*=1-out;M.cursor(ctx,M.lerp(W*.85,cx+bw*.2,ck),M.lerp(H*.9,cy+bh*.15,ck),u*.04,pk>0&&pk<1?pk:0);ctx.restore()}
10535
10535
  ctx.restore()
10536
- }`,Rr=`${zt(0,"Document spread explainer — an open booklet with a teal header band on each page; field rows type in one by one with leader lines, a photo card is clipped on, an accent 'match' chip appears and a round stamp slams down on the right page (fields: text = left header, sub = right header, items = 'label: value' rows + one item without ':' = stamp word, number = id number; theme, accent, bg).",ba,6)}
10536
+ }`,zr=`${zt(0,"Document spread explainer — an open booklet with a teal header band on each page; field rows type in one by one with leader lines, a photo card is clipped on, an accent 'match' chip appears and a round stamp slams down on the right page (fields: text = left header, sub = right header, items = 'label: value' rows + one item without ':' = stamp word, number = id number; theme, accent, bg).",ba,6)}
10537
10537
  BGD();OUT(.3)
10538
10538
  const bw=PT?W*.94:W*.8,bh=PT?bw*.95:bw*.56,bx=cx-bw/2,by=cy-bh/2,ek=M.ease.outExpo(M.range(t,.05,.5)),pg='#f4ecd6',tl='#2f7f6f',ink='#24302c'
10539
10539
  ctx.save();ctx.globalAlpha*=M.clamp(ek*1.4);ctx.translate(cx,cy);ctx.scale(.94+.06*ek,.94+.06*ek);ctx.translate(-cx,-cy);SH(.05,.22);M.rr(ctx,bx-u*.012,by-u*.012,bw+u*.024,bh+u*.024,u*.02);ctx.fillStyle='#1f4b43';ctx.fill();NS();ctx.fillStyle=pg;M.rr(ctx,bx,by,bw,bh,u*.012);ctx.fill();ctx.fillStyle='rgba(0,0,0,.08)';ctx.fillRect(cx-u*.004,by,u*.008,bh)
@@ -10543,7 +10543,7 @@
10543
10543
  const mk=M.ease.outBack(M.range(t,2.3,2.6));if(mk>0){ctx.save();const x=bx+pw*1.08,y=by+bh*.3;ctx.globalAlpha*=mk;const ID=String(Math.abs(Math.round(+p.number||0))||'');ctx.fillStyle=M.rgba(AC,.45);ctx.fillRect(x-hz*.2,y-hz*.7,TW(ID,hz*1.05,'n')+hz*.4,hz*1.4);TT(ID,x,y,hz*1.05,'left',ink,'n');ctx.restore();ctx.save();ctx.translate(x+pw*.6,y);ctx.scale(mk,mk);const cw=hz*2.6,chh=hz*1.8;M.rr(ctx,-cw/2,-chh/2,cw,chh,chh/2);ctx.fillStyle=AC;ctx.fill();CK(0,0,hz*1.1,AI);ctx.restore()}
10544
10544
  const st=M.range(t,3.1,3.4),sb=String(AL.find(r=>r.indexOf(':')<1)||'').toUpperCase();if(sb&&st>0){const s=1+1.2*(1-M.ease.outCubic(st)),sx=bx+pw*1.55,sy=by+bh*.72,r=bh*.16;ctx.save();ctx.translate(sx,sy);ctx.rotate(-.18);ctx.scale(s,s);ctx.globalAlpha*=M.clamp(st*2)*.92;ctx.strokeStyle='#2e9b55';ctx.lineWidth=r*.08;ctx.beginPath();ctx.arc(0,0,r,0,TAU);ctx.stroke();ctx.lineWidth=r*.03;ctx.beginPath();ctx.arc(0,0,r*.84,0,TAU);ctx.stroke();const z2=FZ(sb,r*.42,r*1.5);TT(sb,0,r*.02,z2,'center','#2e9b55','n');ctx.restore()}
10545
10545
  ctx.restore();ctx.restore()
10546
- }`,Pr=`${zt(0,"Route map explainer — a hand-drawn coast on a pale sea (no real map data), pins drop in with a bounce, a dashed route draws from stop to stop with a moving dot, each stop gets a chip, and an accent legend card lists the title (fields: items = stop names, text = legend title, sub = legend line; theme, accent, bg).",ba,6)}
10546
+ }`,Br=`${zt(0,"Route map explainer — a hand-drawn coast on a pale sea (no real map data), pins drop in with a bounce, a dashed route draws from stop to stop with a moving dot, each stop gets a chip, and an accent legend card lists the title (fields: items = stop names, text = legend title, sub = legend line; theme, accent, bg).",ba,6)}
10547
10547
  BGD(.0);OUT(.3)
10548
10548
  const sea='#cfe7ea',land='#efe4c9',ink='#3b4a46';ctx.fillStyle=sea;ctx.fillRect(0,0,W,H);ctx.strokeStyle='rgba(59,74,70,.08)';ctx.lineWidth=1;for(let i=1;i<12;i++){ctx.beginPath();ctx.moveTo(W*i/12,0);ctx.lineTo(W*i/12,H);ctx.stroke();ctx.beginPath();ctx.moveTo(0,H*i/12);ctx.lineTo(W,H*i/12);ctx.stroke()}
10549
10549
  const blob=(x,y,r,sd)=>{ctx.beginPath();for(let i=0;i<=48;i++){const a=i/48*TAU,q=r*(.75+.35*M.noise(Math.cos(a)*1.6+sd,Math.sin(a)*1.6+sd));const X=x+Math.cos(a)*q*1.25,Y=y+Math.sin(a)*q;i?ctx.lineTo(X,Y):ctx.moveTo(X,Y)}ctx.closePath();ctx.fillStyle=land;ctx.fill();ctx.strokeStyle='rgba(59,74,70,.45)';ctx.lineWidth=Math.max(1,u*.002);ctx.stroke()}
@@ -10553,29 +10553,29 @@
10553
10553
  P2.forEach((q,i)=>{const k=M.ease.outBounce(M.range(t,.2+i*.18,.6+i*.18));if(k<=0)return;const pr=u*.026,y=q[1]-(1-k)*u*.1;ctx.save();ctx.fillStyle='#e0533c';ctx.beginPath();ctx.arc(q[0],y-pr*1.4,pr,Math.PI*.85,Math.PI*2.15);ctx.lineTo(q[0],y);ctx.closePath();ctx.fill();ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(q[0],y-pr*1.4,pr*.4,0,TAU);ctx.fill();ctx.restore();const lk=M.range(t,1+i*.45,1.3+i*.45);if(S2[i]&&lk>0){ctx.save();ctx.globalAlpha*=lk;const z=u*.03,w=TW(S2[i],z,'s','600')+z*1.6,h=z*1.9,x=q[0]+pr*.8,yy=q[1]-pr*3.6;M.rr(ctx,x,yy-h/2,w,h,h*.3);ctx.fillStyle='#ffffff';ctx.fill();ctx.strokeStyle=ink;ctx.lineWidth=1.2;ctx.stroke();TT(S2[i],x+w/2,yy,z,'center',ink,'s','600');ctx.restore()}})
10554
10554
  const lk2=M.ease.outBack(M.range(t,.3,.7)),lw=PT?W*.6:W*.24,lh=lw*.42,lx=PT?W*.06:W*.04,ly=PT?H*.82:H*.06;if(lk2>0){ctx.save();ctx.translate(lx+lw/2,ly+lh/2);ctx.scale(lk2,lk2);ctx.translate(-lw/2,-lh/2);SH(.03,.2);M.rr(ctx,0,0,lw,lh,u*.012);ctx.fillStyle='#ffffff';ctx.fill();NS();ctx.strokeStyle=AC;ctx.lineWidth=Math.max(2,u*.004);M.rr(ctx,0,0,lw,lh,u*.012);ctx.stroke();const z=lh*.22;ctx.fillStyle=AC;M.rr(ctx,lw*.07,lh*.18,z*1.3,z*1.3,z*.3);ctx.fill();CK(lw*.07+z*.65,lh*.18+z*.65,z*.8,AI);TT(String(p.text||''),lw*.07+z*1.8,lh*.18+z*.65,z,'left',ink,'s','700');TT(String(p.sub||''),lw*.07,lh*.7,z*.72,'left','rgba(59,74,70,.7)','s','500');ctx.restore()}
10555
10555
  ctx.restore()
10556
- }`,zr=`${zt(1,"Split-flap departure board — a dark board with an accent edge and a title bar; every row flips through letters, cell by cell, until it settles on its time, place and status (accent status) (fields: text = board title, items = rows 'time place status' split by two spaces or | inside a row is not allowed — use 'HH:MM PLACE / STATUS'; theme, accent, bg).","",5)}
10556
+ }`,Wr=`${zt(1,"Split-flap departure board — a dark board with an accent edge and a title bar; every row flips through letters, cell by cell, until it settles on its time, place and status (accent status) (fields: text = board title, items = rows 'time place status' split by two spaces or | inside a row is not allowed — use 'HH:MM PLACE / STATUS'; theme, accent, bg).","",5)}
10557
10557
  BGD();OUT(.3)
10558
10558
  const rows=M.items(p,6),bw=PT?W*.94:W*.8,cols=PT?25:28,cw=bw*.92/cols,chh=cw*1.45,bh=chh*(rows.length+1.8)+cw,bx=cx-bw/2,by=cy-bh/2,ek=M.ease.outExpo(M.range(t,.05,.45))
10559
10559
  ctx.save();ctx.globalAlpha*=M.clamp(ek*1.5);SH(.05);M.rr(ctx,bx,by,bw,bh,u*.014);ctx.fillStyle='#17181b';ctx.fill();NS();ctx.strokeStyle=AC;ctx.lineWidth=Math.max(2,u*.0035);ctx.shadowColor=M.rgba(AC,.4);ctx.shadowBlur=u*.02;M.rr(ctx,bx,by,bw,bh,u*.014);ctx.stroke();NS()
10560
10560
  const tz=chh*.5;ctx.save();ctx.translate(bx+bw*.04+tz*.5,by+chh*.75);ctx.rotate(-Math.PI/4);ctx.fillStyle=AC;ctx.beginPath();ctx.moveTo(0,-tz*.6);ctx.lineTo(tz*.16,-tz*.1);ctx.lineTo(tz*.6,tz*.12);ctx.lineTo(tz*.6,tz*.24);ctx.lineTo(tz*.14,tz*.12);ctx.lineTo(tz*.1,tz*.45);ctx.lineTo(tz*.24,tz*.56);ctx.lineTo(-tz*.24,tz*.56);ctx.lineTo(-tz*.1,tz*.45);ctx.lineTo(-tz*.14,tz*.12);ctx.lineTo(-tz*.6,tz*.24);ctx.lineTo(-tz*.6,tz*.12);ctx.lineTo(-tz*.16,-tz*.1);ctx.closePath();ctx.fill();ctx.restore();TT(String(p.text||'').toUpperCase(),bx+bw*.04+tz*1.4,by+chh*.75,tz,'left',AC,'n')
10561
10561
  const G='ABCDEFGHIKLMNOPQRSTUVXY0123456789:';rows.forEach((r,ri)=>{const s=r.toUpperCase().split(' / '),txt=(s[0]||'').padEnd(cols-(s[1]||'').length-1,' ').slice(0,cols-(s[1]||'').length-1)+' '+(s[1]||''),y=by+chh*(1.6+ri)+cw*.3;Array.from(txt.slice(0,cols)).forEach((c,ci)=>{const x=bx+bw*.04+ci*cw,set=.5+ri*.25+ci*.035,fl=t<set,rn=M.rand(ri*97+ci*13+Math.floor(t*18))();ctx.fillStyle='#232528';M.rr(ctx,x+1,y,cw-2,chh*.88,cw*.1);ctx.fill();const ch=fl?G[Math.floor(rn*G.length)]:c,st=ci>=cols-(s[1]||'').length;if(ch!==' '||fl)TT(fl&&t<.4+ri*.2?'':ch,x+cw/2,y+chh*.46,chh*.6,'center',st&&!fl?AC:'#f1f2ee','n');ctx.fillStyle='rgba(0,0,0,.55)';ctx.fillRect(x+1,y+chh*.44,cw-2,Math.max(1,u*.0015))})})
10562
10562
  ctx.restore();ctx.restore()
10563
- }`,Br=`${zt(1,"Tilted title plates — two paper plates swing in at slight angles, one cream with an accent edge and one accent, the words type onto them in a bold rounded hand and a scalloped accent seal pops on the corner (fields: items = 2 lines, sub = seal word; theme, accent, bg).","",4.5)}
10563
+ }`,Hr=`${zt(1,"Tilted title plates — two paper plates swing in at slight angles, one cream with an accent edge and one accent, the words type onto them in a bold rounded hand and a scalloped accent seal pops on the corner (fields: items = 2 lines, sub = seal word; theme, accent, bg).","",4.5)}
10564
10564
  BGD();OUT(.3)
10565
10565
  const L=M.items(p,2),z=Math.min(...L.map(s=>FZ(s,PT?W*.11:H*.1,PT?W*.74:W*.46))),pl=[[-.05,-z*.9,'#fbf3df',INK],[.035,z*.75,AC,AI]]
10566
10566
  L.forEach((s,i)=>{const k=M.ease.outBack(M.range(t,.1+i*.3,.55+i*.3));if(k<=0)return;const w=TW(s,z,'h')+z*1.4,h=z*1.7,yy=cy+pl[i][1]+(PT?-H*.04:0),xx=Math.min(W*.95-w/2,Math.max(W*.05+w/2,cx+(i?z*.6:-z*.4)));ctx.save();ctx.translate(xx,yy);ctx.rotate(pl[i][0]*(2-k));ctx.scale(k,k);SH(.03,.3);M.rr(ctx,-w/2,-h/2,w,h,h*.14);ctx.fillStyle=pl[i][2];ctx.fill();NS();ctx.strokeStyle=i?M.rgba(AI,.25):AC;ctx.lineWidth=Math.max(2,u*.004);M.rr(ctx,-w/2,-h/2,w,h,h*.14);ctx.stroke();TT(TY(s,M.range(t,.35+i*.3,.95+i*.3)),-w/2+z*.7,0,z,'left',i?pl[i][3]:'#1d1f1a','h');ctx.restore()})
10567
10567
  const sb=String(p.sub||''),sk2=M.ease.outBack(M.range(t,1.2,1.6));if(sb&&sk2>0){const r=z*.75,w0=TW(L[0]||'',z,'h')+z*1.4,sx=cx-z*.4+w0/2-r*.2,sy=cy-z*.9-z*.85+(PT?-H*.04:0);ctx.save();ctx.translate(sx,sy);ctx.rotate(.2+t*.15);ctx.scale(sk2,sk2);ctx.fillStyle=DK?'#fbf3df':'#ffffff';ctx.beginPath();for(let i=0;i<=72;i++){const a=i/72*TAU,q=r*(1+.07*Math.sin(a*12));i?ctx.lineTo(Math.cos(a)*q,Math.sin(a)*q):ctx.moveTo(Math.cos(a)*q,Math.sin(a)*q)}ctx.closePath();ctx.fill();ctx.strokeStyle=AC;ctx.lineWidth=r*.08;ctx.stroke();ctx.rotate(-.2-t*.15);TT(sb.toUpperCase(),0,0,FZ(sb.toUpperCase(),r*.42,r*1.4),'center','#1d1f1a','n');ctx.restore()}
10568
10568
  ctx.restore()
10569
- }`,Wr=`${zt(1,"Chromatic glitch headline — two heavy lines tear in from horizontal slices with an RGB split and a sideways motion smear, settle clean (second line in the accent) and glitch for a beat now and then (fields: items = 2 lines; theme, accent, bg).","",3.5)}
10569
+ }`,Lr=`${zt(1,"Chromatic glitch headline — two heavy lines tear in from horizontal slices with an RGB split and a sideways motion smear, settle clean (second line in the accent) and glitch for a beat now and then (fields: items = 2 lines; theme, accent, bg).","",3.5)}
10570
10570
  BGD();OUT(.3)
10571
10571
  const L=M.items(p,2).map(s=>s.toUpperCase()),z=Math.min(...L.map(s=>FZ(s,PT?W*.15:H*.2,PT?W*.88:W*.8,'n'))),R=M.rand(Math.floor(t*14)+3),gl=(t%1.6)>1.45?1:0
10572
10572
  L.forEach((s,i)=>{const k=M.range(t,.05+i*.15,.65+i*.15),y=cy+(i-.5)*z*1.02,am=(1-M.ease.outCubic(k))+gl*.25;if(k<=0)return;ctx.save();ctx.font=sk.font(z,'n');ctx.textAlign='center';ctx.textBaseline='middle';const col=i?AC:INK,n=6
10573
10573
  for(let j=0;j<n;j++){const y0=y-z*.55+j*z*1.1/n,off=am>.02?(R()-.5)*u*.18*am:0;ctx.save();ctx.beginPath();ctx.rect(0,y0,W,z*1.1/n+1);ctx.clip();if(am>.02){ctx.globalCompositeOperation=DK?'lighter':'multiply';ctx.fillStyle=DK?'rgba(255,40,80,.8)':'rgba(255,60,90,.7)';ctx.fillText(s,cx+off-u*.012*am*4,y);ctx.fillStyle=DK?'rgba(40,200,255,.8)':'rgba(40,180,255,.7)';ctx.fillText(s,cx+off+u*.012*am*4,y);ctx.globalCompositeOperation='source-over'}ctx.globalAlpha*=M.clamp(k*1.8);ctx.fillStyle=col;ctx.fillText(s,cx+off,y);ctx.restore()}
10574
10574
  if(am>.05){ctx.globalAlpha*=.18*am;for(let m=1;m<4;m++)ctx.fillText(s,cx-m*u*.03*am,y)}ctx.restore()})
10575
10575
  ctx.restore()
10576
- }`,Hr=`${zt(0,"Confetti background — warm cream paper (or graphite with a dot grid) with drifting peach / lime haze and geometric confetti (dots, rings, squares, triangles, pills, diamonds) floating and turning slowly; full frame, put titles on top (fields: number = confetti count 6–40; theme, accent).",Ha,8)}
10576
+ }`,Dr=`${zt(0,"Confetti background — warm cream paper (or graphite with a dot grid) with drifting peach / lime haze and geometric confetti (dots, rings, squares, triangles, pills, diamonds) floating and turning slowly; full frame, put titles on top (fields: number = confetti count 6–40; theme, accent).",Ha,8)}
10577
10577
  BGD();CONF(1,Math.max(6,Math.min(40,Math.round(+p.number||22))),13,2)
10578
- }`,Bt=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Wt={prompt:Bt(["tvc","explainer"],["hook","intro"],["tech","clean"]),title:Bt(["tvc","explainer"],["title","intro","logo"],["editorial","clean"]),click:Bt(["tvc","explainer"],["cta","explain"],["tech","bold"]),files:Bt(["tvc","explainer"],["explain","step"],["tech"]),fix:Bt(["tvc","explainer"],["explain","step"],["tech"]),gen:Bt(["tvc","explainer"],["step","explain"],["tech","clean"]),fan:Bt(["tvc","explainer"],["explain","intro"],["tech"]),graph:Bt(["tvc","explainer","course"],["explain","step"],["tech"]),render:Bt(["tvc","explainer"],["stat","step"],["tech","clean"]),call:Bt(["talking-head","vlog"],["stat","hook"],["bold"]),ring:Bt(["talking-head","vlog","explainer"],["stat"],["bold","clean"]),pen:Bt(["tvc","explainer"],["logo","title"],["tech","clean"]),multi:Bt(["tvc","explainer"],["title","hook"],["tech","bold"]),phones:Bt(["tvc","explainer"],["compare","explain"],["tech","clean"]),cta:Bt(["tvc","explainer"],["cta","logo","outro"],["tech","clean"]),doc:Bt(["explainer","course"],["explain","list","proof"],["editorial"]),map:Bt(["explainer","course"],["explain","step"],["editorial"]),board:Bt(["explainer"],["list","explain"],["editorial","bold"]),plates:Bt(["explainer","course"],["title","hook"],["editorial","bold"]),glitch:Bt(["tvc","explainer","vlog"],["title","hook"],["bold"]),bg:Bt(["any"],["background"],["clean"])},Ht={prompt:{text:"Bạn muốn *làm* video gì?",sub:"Một video ra mắt 20 giây cho cửa hàng của tôi",items:"Clipoox AI"},title:{text:"Clipoox *Motion*",sub:"Mỗi khung hình là code. *Sửa được mọi thứ.*",items:"Clipoox Studio|Dùng thử ngay"},click:{items:"Tiếp thị|Mạng xã hội|Podcast|Khoá học",text:"Tạo video",sub:"Đã gửi"},files:{text:"Dự án xe",items:"Gần đây|Ứng dụng|Màn hình|Tài liệu|Tải về",sub:"Flycam_1.mp4"},fix:{text:"Phát hiện một lỗi liền mạch.",sub:"Vá lại bằng cảnh flycam mới"},gen:{text:"Đang tạo",sub:"Xong"},fan:{items:"Clip video|Ảnh tĩnh|Mẫu chữ|Âm thanh",text:"Clipoox MCP"},graph:{text:"Đồ thị tốc độ"},render:{text:"video_clipoox.mp4",sub:"Đang xuất",number:1200},call:{items:"Thợ dựng chuyên nghiệp:",text:"Vài ngày",sub:"Công sức",number:0,position:"lower"},ring:{number:2,text:"Giờ",position:"lower"},pen:{text:"clipoox",sub:"Bản 2.0 đã ra mắt"},multi:{items:"Thiết kế|Cùng nhau",sub:"An|Minh|Lan"},phones:{text:"12.450.000đ",sub:"Minh Anh",items:"Tối|Chanh|Sáng"},cta:{text:"Dùng thử Clipoox",sub:"clipoox"},doc:{text:"Thông tin",sub:"Mã định danh",items:"Tên: Mướp|Loài: Mèo|Giống: Mèo mướp|Ngày sinh: 04/05/2022|Hợp lệ",number:41207829},map:{items:"Hà Nội|Đà Nẵng|Nha Trang|TP.HCM",text:"Lộ trình",sub:"4 điểm dừng · 3 chặng"},board:{text:"Khởi hành",items:"09:30 HÀ NỘI / ĐÚNG GIỜ|10:15 ĐÀ NẴNG / LÊN MÁY BAY|11:40 HUẾ / MỞ CỬA|12:05 CẦN THƠ / ĐÚNG GIỜ|13:20 ĐÀ LẠT / ĐÚNG GIỜ"},plates:{items:"Vì sao mèo|cần hộ chiếu?",sub:"Mới"},glitch:{items:"Bạn sẽ đi|đến đâu?"},bg:{number:22}},Lr=[Pt("cs-prompt","Ô lệnh AI + nút gửi",5,Ht.prompt,pr,Wt.prompt),Pt("cs-title-curve","Tiêu đề chữ nghiêng + đường cong bezier",5,Ht.title,dr,Wt.title),Pt("cs-cursor-click","Con trỏ bấm nút lớn",4,Ht.click,gr,Wt.click),Pt("cs-file-window","Cửa sổ file → thẻ tên file",5,Ht.files,ur,Wt.files),Pt("cs-timeline-fix","Timeline tìm lỗi + vá",5.5,Ht.fix,br,Wt.fix),Pt("cs-generating","Thẻ đang tạo → xong",4,Ht.gen,Mr,Wt.gen),Pt("cs-card-fan","Quạt thẻ 3D trên lưới chấm",5,Ht.fan,yr,Wt.fan),Pt("cs-graph-editor","Đồ thị tốc độ + code",5,Ht.graph,wr,Wt.graph),Pt("cs-render-card","Thẻ xuất video + tiến độ",4.5,Ht.render,mr,Wt.render),Pt("cs-callout","Chữ nhấn lớn trên người nói",3.5,Ht.call,kr,Wt.call),Pt("cs-timer-ring","Vòng đếm thời gian",3,Ht.ring,Sr,Wt.ring),Pt("cs-pen-logo","Bút vẽ path → logo trong khung chọn",5,Ht.pen,vr,Wt.pen),Pt("cs-multi-cursor","Tiêu đề + nhiều con trỏ cộng tác",5,Ht.multi,Tr,Wt.multi),Pt("cs-phone-trio","Ba điện thoại ba phiên bản",5,Ht.phones,Cr,Wt.phones),Pt("cs-cta-logo","Nút CTA → logo",5,Ht.cta,Ar,Wt.cta),Pt("cs-doc-stamp","Trang hồ sơ + con dấu",6,Ht.doc,Rr,Wt.doc),Pt("cs-route-map","Bản đồ lộ trình vẽ tay",6,Ht.map,Pr,Wt.map),Pt("cs-flip-board","Bảng khởi hành lật chữ",5,Ht.board,zr,Wt.board),Pt("cs-title-plates","Tiêu đề trên thẻ nghiêng + con dấu tròn",4.5,Ht.plates,Br,Wt.plates),Pt("cs-glitch-type","Chữ glitch tách màu",3.5,Ht.glitch,Wr,Wt.glitch),Pt("cs-confetti-bg","Nền giấy + hình học bay",8,Ht.bg,Hr,Wt.bg)],ni=Y.find(t=>t.id==="matrix"),La=(t,e,c,o,n)=>({id:t,name:e,category:ni.name,pack:"matrix",duration:c,params:{accent:ni.accent,position:"center",...o,style:"matrix"},code:n}),Da="const GL='アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン0123456789ZXEΛ';const G=(r)=>GL[Math.floor(r()*GL.length)];const MONO=(z,w)=>(w||'700')+' '+Math.round(z)+'px Menlo, Consolas, monospace';const ON=(v)=>v!==false&&v!=='false';",Dr=[La("mx-code-rain","Mưa mã Ma trận",4,{density:.7,speed:1,size:1,dark:!0},Da+`function render(ctx,t,env){
10578
+ }`,Bt=(t,e,c)=>Object.freeze({videoType:t,role:e,style:c}),Wt={prompt:Bt(["tvc","explainer"],["hook","intro"],["tech","clean"]),title:Bt(["tvc","explainer"],["title","intro","logo"],["editorial","clean"]),click:Bt(["tvc","explainer"],["cta","explain"],["tech","bold"]),files:Bt(["tvc","explainer"],["explain","step"],["tech"]),fix:Bt(["tvc","explainer"],["explain","step"],["tech"]),gen:Bt(["tvc","explainer"],["step","explain"],["tech","clean"]),fan:Bt(["tvc","explainer"],["explain","intro"],["tech"]),graph:Bt(["tvc","explainer","course"],["explain","step"],["tech"]),render:Bt(["tvc","explainer"],["stat","step"],["tech","clean"]),call:Bt(["talking-head","vlog"],["stat","hook"],["bold"]),ring:Bt(["talking-head","vlog","explainer"],["stat"],["bold","clean"]),pen:Bt(["tvc","explainer"],["logo","title"],["tech","clean"]),multi:Bt(["tvc","explainer"],["title","hook"],["tech","bold"]),phones:Bt(["tvc","explainer"],["compare","explain"],["tech","clean"]),cta:Bt(["tvc","explainer"],["cta","logo","outro"],["tech","clean"]),doc:Bt(["explainer","course"],["explain","list","proof"],["editorial"]),map:Bt(["explainer","course"],["explain","step"],["editorial"]),board:Bt(["explainer"],["list","explain"],["editorial","bold"]),plates:Bt(["explainer","course"],["title","hook"],["editorial","bold"]),glitch:Bt(["tvc","explainer","vlog"],["title","hook"],["bold"]),bg:Bt(["any"],["background"],["clean"])},Ht={prompt:{text:"Bạn muốn *làm* video gì?",sub:"Một video ra mắt 20 giây cho cửa hàng của tôi",items:"Clipoox AI"},title:{text:"Clipoox *Motion*",sub:"Mỗi khung hình là code. *Sửa được mọi thứ.*",items:"Clipoox Studio|Dùng thử ngay"},click:{items:"Tiếp thị|Mạng xã hội|Podcast|Khoá học",text:"Tạo video",sub:"Đã gửi"},files:{text:"Dự án xe",items:"Gần đây|Ứng dụng|Màn hình|Tài liệu|Tải về",sub:"Flycam_1.mp4"},fix:{text:"Phát hiện một lỗi liền mạch.",sub:"Vá lại bằng cảnh flycam mới"},gen:{text:"Đang tạo",sub:"Xong"},fan:{items:"Clip video|Ảnh tĩnh|Mẫu chữ|Âm thanh",text:"Clipoox MCP"},graph:{text:"Đồ thị tốc độ"},render:{text:"video_clipoox.mp4",sub:"Đang xuất",number:1200},call:{items:"Thợ dựng chuyên nghiệp:",text:"Vài ngày",sub:"Công sức",number:0,position:"lower"},ring:{number:2,text:"Giờ",position:"lower"},pen:{text:"clipoox",sub:"Bản 2.0 đã ra mắt"},multi:{items:"Thiết kế|Cùng nhau",sub:"An|Minh|Lan"},phones:{text:"12.450.000đ",sub:"Minh Anh",items:"Tối|Chanh|Sáng"},cta:{text:"Dùng thử Clipoox",sub:"clipoox"},doc:{text:"Thông tin",sub:"Mã định danh",items:"Tên: Mướp|Loài: Mèo|Giống: Mèo mướp|Ngày sinh: 04/05/2022|Hợp lệ",number:41207829},map:{items:"Hà Nội|Đà Nẵng|Nha Trang|TP.HCM",text:"Lộ trình",sub:"4 điểm dừng · 3 chặng"},board:{text:"Khởi hành",items:"09:30 HÀ NỘI / ĐÚNG GIỜ|10:15 ĐÀ NẴNG / LÊN MÁY BAY|11:40 HUẾ / MỞ CỬA|12:05 CẦN THƠ / ĐÚNG GIỜ|13:20 ĐÀ LẠT / ĐÚNG GIỜ"},plates:{items:"Vì sao mèo|cần hộ chiếu?",sub:"Mới"},glitch:{items:"Bạn sẽ đi|đến đâu?"},bg:{number:22}},Er=[Pt("cs-prompt","Ô lệnh AI + nút gửi",5,Ht.prompt,gr,Wt.prompt),Pt("cs-title-curve","Tiêu đề chữ nghiêng + đường cong bezier",5,Ht.title,ur,Wt.title),Pt("cs-cursor-click","Con trỏ bấm nút lớn",4,Ht.click,br,Wt.click),Pt("cs-file-window","Cửa sổ file → thẻ tên file",5,Ht.files,Mr,Wt.files),Pt("cs-timeline-fix","Timeline tìm lỗi + vá",5.5,Ht.fix,yr,Wt.fix),Pt("cs-generating","Thẻ đang tạo → xong",4,Ht.gen,wr,Wt.gen),Pt("cs-card-fan","Quạt thẻ 3D trên lưới chấm",5,Ht.fan,mr,Wt.fan),Pt("cs-graph-editor","Đồ thị tốc độ + code",5,Ht.graph,kr,Wt.graph),Pt("cs-render-card","Thẻ xuất video + tiến độ",4.5,Ht.render,Sr,Wt.render),Pt("cs-callout","Chữ nhấn lớn trên người nói",3.5,Ht.call,vr,Wt.call),Pt("cs-timer-ring","Vòng đếm thời gian",3,Ht.ring,Tr,Wt.ring),Pt("cs-pen-logo","Bút vẽ path → logo trong khung chọn",5,Ht.pen,Cr,Wt.pen),Pt("cs-multi-cursor","Tiêu đề + nhiều con trỏ cộng tác",5,Ht.multi,Ar,Wt.multi),Pt("cs-phone-trio","Ba điện thoại ba phiên bản",5,Ht.phones,Rr,Wt.phones),Pt("cs-cta-logo","Nút CTA → logo",5,Ht.cta,Pr,Wt.cta),Pt("cs-doc-stamp","Trang hồ sơ + con dấu",6,Ht.doc,zr,Wt.doc),Pt("cs-route-map","Bản đồ lộ trình vẽ tay",6,Ht.map,Br,Wt.map),Pt("cs-flip-board","Bảng khởi hành lật chữ",5,Ht.board,Wr,Wt.board),Pt("cs-title-plates","Tiêu đề trên thẻ nghiêng + con dấu tròn",4.5,Ht.plates,Hr,Wt.plates),Pt("cs-glitch-type","Chữ glitch tách màu",3.5,Ht.glitch,Lr,Wt.glitch),Pt("cs-confetti-bg","Nền giấy + hình học bay",8,Ht.bg,Dr,Wt.bg)],ii=Y.find(t=>t.id==="matrix"),La=(t,e,c,o,n)=>({id:t,name:e,category:ii.name,pack:"matrix",duration:c,params:{accent:ii.accent,position:"center",...o,style:"matrix"},code:n}),Da="const GL='アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン0123456789ZXEΛ';const G=(r)=>GL[Math.floor(r()*GL.length)];const MONO=(z,w)=>(w||'700')+' '+Math.round(z)+'px Menlo, Consolas, monospace';const ON=(v)=>v!==false&&v!=='false';",qr=[La("mx-code-rain","Mưa mã Ma trận",4,{density:.7,speed:1,size:1,dark:!0},Da+`function render(ctx,t,env){
10579
10579
  // Green code rain: columns of glyphs fall down the whole frame, each with a bright white head and a fading green trail; glyphs flicker as they fall.
10580
10580
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,fs=Math.max(10,Math.min(W,H)*.032*(+p.size||1))
10581
10581
  const fade=M.clamp(M.range(t,0,.35))*(1-M.range(t,D-.35,D)),cols=Math.ceil(W/fs),dens=M.clamp(+p.density||.7,.1,1),sp=Math.max(.2,+p.speed||1)
@@ -10646,7 +10646,7 @@
10646
10646
  ctx.fillStyle=br>.93?'rgba(230,255,236,.95)':M.rgba(acc,.35+.55*br);ctx.fillText(G(M.rand(c*41+k*5+Math.floor(t*12))),c*fs+fs/2,y)}}
10647
10647
  const edge=ctx.createLinearGradient(x1-fs*3,0,x1,0);edge.addColorStop(0,M.rgba(acc,0));edge.addColorStop(1,M.rgba('#e9fff0',.9));ctx.fillStyle=edge;ctx.fillRect(x1-fs*3,0,fs*3,H)
10648
10648
  ctx.restore()
10649
- }`)],si=Y.find(t=>t.id==="lightfx"),Ea=(t,e,c,o,n)=>({id:t,name:e,category:si.name,pack:"lightfx",duration:c,params:{accent:si.accent,position:"center",...o,style:"lightfx"},code:n}),qa="const ON=(v)=>v===true||v==='true';const FONT=(env)=>(env.fonts&&env.fonts.mont)||'system-ui, sans-serif';",Er=[Ea("lr-light-ribbon","Dải sáng xoắn 3D",4.5,{strands:14,loops:1,width:1,speed:1,tx:.5,ty:.62,spread:1},qa+`function render(ctx,t,env){
10649
+ }`)],li=Y.find(t=>t.id==="lightfx"),Ea=(t,e,c,o,n)=>({id:t,name:e,category:li.name,pack:"lightfx",duration:c,params:{accent:li.accent,position:"center",...o,style:"lightfx"},code:n}),qa="const ON=(v)=>v===true||v==='true';const FONT=(env)=>(env.fonts&&env.fonts.mont)||'system-ui, sans-serif';",Gr=[Ea("lr-light-ribbon","Dải sáng xoắn 3D",4.5,{strands:14,loops:1,width:1,speed:1,tx:.5,ty:.62,spread:1},qa+`function render(ctx,t,env){
10650
10650
  // A bundle of thin light ribbons flies in from the left past the camera, loops round in front of it and dives down the road
10651
10651
  // to the vanishing point (tx, ty: where the rider is); near strands are wide and soft, far ones thin; it fades as it leaves.
10652
10652
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,f=H*1.1,cx=(+p.tx||.5)*W,cy=(+p.ty||.62)*H
@@ -10779,7 +10779,7 @@
10779
10779
  if(a<=0)return
10780
10780
  const g=ctx.createRadialGradient(W/2,H/2,0,W/2,H/2,Math.hypot(W,H)*.6);g.addColorStop(0,'rgba(255,245,255,'+a+')');g.addColorStop(.35,M.rgba(acc,.85*a));g.addColorStop(1,M.rgba(acc,.35*a))
10781
10781
  ctx.save();ctx.globalCompositeOperation='lighter';ctx.fillStyle=g;ctx.fillRect(0,0,W,H);ctx.restore()
10782
- }`)],ii=Y.find(t=>t.id==="sportcine"),Ga=(t,e,c,o,n)=>({id:t,name:e,category:ii.name,pack:"sportcine",duration:c,params:{accent:ii.accent,position:"center",...o,style:"sportcine"},code:n}),Oa="const HEX=(v,d)=>/^#[0-9a-f]{6}$/i.test(v)?v:d;const ON=(v)=>v===true||v==='true'||+v>0;const PTS=(list,min,fb)=>{const o=list.map(s=>String(s).split(',').map(Number)).filter(a=>a.length>1&&Number.isFinite(a[0])&&Number.isFinite(a[1])).map(a=>a.slice(0,2).map(v=>M.clamp(v>1.5?v/100:v,.08,.92)));return o.length>=min?o:fb};",qr=[Ga("sc-dot-screen","Lưới chấm halftone chớp",.4,{density:80,strength:.8,color:"#000000"},Oa+`function render(ctx,t,env){
10782
+ }`)],ri=Y.find(t=>t.id==="sportcine"),Ga=(t,e,c,o,n)=>({id:t,name:e,category:ri.name,pack:"sportcine",duration:c,params:{accent:ri.accent,position:"center",...o,style:"sportcine"},code:n}),Oa="const HEX=(v,d)=>/^#[0-9a-f]{6}$/i.test(v)?v:d;const ON=(v)=>v===true||v==='true'||+v>0;const PTS=(list,min,fb)=>{const o=list.map(s=>String(s).split(',').map(Number)).filter(a=>a.length>1&&Number.isFinite(a[0])&&Number.isFinite(a[1])).map(a=>a.slice(0,2).map(v=>M.clamp(v>1.5?v/100:v,.08,.92)));return o.length>=min?o:fb};",Or=[Ga("sc-dot-screen","Lưới chấm halftone chớp",.4,{density:80,strength:.8,color:"#000000"},Oa+`function render(ctx,t,env){
10783
10783
  // Halftone flash (2-6 frames) over footage: a full-frame screen of black dots (blend multiply on a black / white picture), a look.
10784
10784
  // Dot sizes follow a soft moving field; color = dot colour, density = dots across the short side (24-140), strength 0..1 = how big they get.
10785
10785
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),col=HEX(p.color,'#000000')
@@ -10939,7 +10939,7 @@
10939
10939
  const hp=M.ease.outBack(M.range(t,.32,.7)),ph=t>.75?((t-.75)%.8)/.8:1,beat=1+.24*Math.exp(-ph*5.5),hx=x+w-pr-hs
10940
10940
  if(hp>0){ctx.save();ctx.shadowColor='rgba(255,45,70,.75)';ctx.shadowBlur=hs*1.3;ctx.fillStyle='#ff2d46';M.icon(ctx,'heart',hx,hs*.06,hs*hp*beat);ctx.restore()}
10941
10941
  ctx.restore()
10942
- }`)],li=Y.find(t=>t.id==="faceholo"),Ft=(t,e,c,o,n)=>({id:t,name:e,category:li.name,pack:"faceholo",duration:c,params:{accent:li.accent,position:"center",...o,style:"faceholo"},code:n}),Yt="const HEX=(v,d)=>/^#[0-9a-f]{6}$/i.test(v)?v:d;const ENV=(t,D)=>{const i=M.ease.outCubic(M.range(t,0,.4)),o=M.ease.inQuad(M.range(t,D-.3,D)),f=t<.42?(M.noise(t*40,5)>.32?1:.45):.93+.07*M.noise(t*6,9);return {i,a:M.clamp(M.range(t,0,.25))*(1-o)*f,s:.85+.15*i}};const FR=(W,H,lo,hi)=>{let w=W*.9,h=H*.9;if(w/h>hi)w=h*hi;if(w/h<lo)h=w/lo;return {x:(W-w)/2,y:(H-h)/2,w,h,u:Math.min(w,h)}};const GL=(c,col,b)=>{c.shadowColor=col;c.shadowBlur=b};const PANEL=(c,x,y,w,h,r,col,u)=>{c.save();const g=c.createLinearGradient(x,y,x+w*.4,y+h);g.addColorStop(0,M.rgba(col,.2));g.addColorStop(1,M.rgba(col,.05));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();GL(c,M.rgba(col,.85),u*.03);c.strokeStyle=M.rgba(M.mix(col,'#ffffff',.4),.9);c.lineWidth=Math.max(1,u*.004);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.strokeStyle='rgba(255,255,255,.25)';c.lineWidth=Math.max(1,u*.002);c.beginPath();c.moveTo(x+r,y+u*.012);c.lineTo(x+w-r,y+u*.012);c.stroke();c.restore()};const SCAN=(c,x,y,w,h,u,t,col)=>{c.save();c.shadowBlur=0;c.fillStyle=M.rgba(col,.05);const g=Math.max(3,u*.009);for(let v=y;v<y+h;v+=g)c.fillRect(x,v,w,Math.max(1,g*.35));const b=y-h*.2+((t*.3)%1)*h*1.4,a=Math.max(y,b-h*.15),z=Math.min(y+h,b);if(z>a){const q=c.createLinearGradient(0,b-h*.15,0,b);q.addColorStop(0,M.rgba(col,0));q.addColorStop(1,M.rgba(col,.12));c.fillStyle=q;c.fillRect(x,a,w,z-a)}c.restore()};const OPEN=(c,env,t,lo,hi2,rad)=>{const E=ENV(t,env.duration);if(E.a<=0)return null;const B=FR(env.width,env.height,lo,hi2),sk=M.skin(env,env.params),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),cx=B.x+B.w/2,cy=B.y+B.h/2,u=B.u,lw=Math.max(1,u*.004);c.save();c.globalAlpha=E.a;c.translate(cx,cy);c.scale(E.s,E.s);c.translate(-cx,-cy);PANEL(c,B.x,B.y,B.w,B.h,u*rad,acc,u);c.save();M.rr(c,B.x,B.y,B.w,B.h,u*rad);c.clip();SCAN(c,B.x,B.y,B.w,B.h,u,t,acc);c.restore();c.lineWidth=lw;c.strokeStyle=hi;c.fillStyle=hi;GL(c,M.rgba(acc,.9),u*.018);c.lineCap='round';c.lineJoin='round';c.textBaseline='alphabetic';return {...B,E,sk,acc,hi,cx,cy,lw}};",Gr=[Ft("fh-call-panel","Cuộc gọi hologram",6,{text:"Russel Roy",sub:"+123 456 7890",number:83},Yt+`function render(ctx,t,env){
10942
+ }`)],xi=Y.find(t=>t.id==="faceholo"),Ft=(t,e,c,o,n)=>({id:t,name:e,category:xi.name,pack:"faceholo",duration:c,params:{accent:xi.accent,position:"center",...o,style:"faceholo"},code:n}),Yt="const HEX=(v,d)=>/^#[0-9a-f]{6}$/i.test(v)?v:d;const ENV=(t,D)=>{const i=M.ease.outCubic(M.range(t,0,.4)),o=M.ease.inQuad(M.range(t,D-.3,D)),f=t<.42?(M.noise(t*40,5)>.32?1:.45):.93+.07*M.noise(t*6,9);return {i,a:M.clamp(M.range(t,0,.25))*(1-o)*f,s:.85+.15*i}};const FR=(W,H,lo,hi)=>{let w=W*.9,h=H*.9;if(w/h>hi)w=h*hi;if(w/h<lo)h=w/lo;return {x:(W-w)/2,y:(H-h)/2,w,h,u:Math.min(w,h)}};const GL=(c,col,b)=>{c.shadowColor=col;c.shadowBlur=b};const PANEL=(c,x,y,w,h,r,col,u)=>{c.save();const g=c.createLinearGradient(x,y,x+w*.4,y+h);g.addColorStop(0,M.rgba(col,.2));g.addColorStop(1,M.rgba(col,.05));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();GL(c,M.rgba(col,.85),u*.03);c.strokeStyle=M.rgba(M.mix(col,'#ffffff',.4),.9);c.lineWidth=Math.max(1,u*.004);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.strokeStyle='rgba(255,255,255,.25)';c.lineWidth=Math.max(1,u*.002);c.beginPath();c.moveTo(x+r,y+u*.012);c.lineTo(x+w-r,y+u*.012);c.stroke();c.restore()};const SCAN=(c,x,y,w,h,u,t,col)=>{c.save();c.shadowBlur=0;c.fillStyle=M.rgba(col,.05);const g=Math.max(3,u*.009);for(let v=y;v<y+h;v+=g)c.fillRect(x,v,w,Math.max(1,g*.35));const b=y-h*.2+((t*.3)%1)*h*1.4,a=Math.max(y,b-h*.15),z=Math.min(y+h,b);if(z>a){const q=c.createLinearGradient(0,b-h*.15,0,b);q.addColorStop(0,M.rgba(col,0));q.addColorStop(1,M.rgba(col,.12));c.fillStyle=q;c.fillRect(x,a,w,z-a)}c.restore()};const OPEN=(c,env,t,lo,hi2,rad)=>{const E=ENV(t,env.duration);if(E.a<=0)return null;const B=FR(env.width,env.height,lo,hi2),sk=M.skin(env,env.params),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),cx=B.x+B.w/2,cy=B.y+B.h/2,u=B.u,lw=Math.max(1,u*.004);c.save();c.globalAlpha=E.a;c.translate(cx,cy);c.scale(E.s,E.s);c.translate(-cx,-cy);PANEL(c,B.x,B.y,B.w,B.h,u*rad,acc,u);c.save();M.rr(c,B.x,B.y,B.w,B.h,u*rad);c.clip();SCAN(c,B.x,B.y,B.w,B.h,u,t,acc);c.restore();c.lineWidth=lw;c.strokeStyle=hi;c.fillStyle=hi;GL(c,M.rgba(acc,.9),u*.018);c.lineCap='round';c.lineJoin='round';c.textBaseline='alphabetic';return {...B,E,sk,acc,hi,cx,cy,lw}};",Nr=[Ft("fh-call-panel","Cuộc gọi hologram",6,{text:"Russel Roy",sub:"+123 456 7890",number:83},Yt+`function render(ctx,t,env){
10943
10943
  // Hologram phone-call panel filling its frame: "Ongoing call" + a timer counting up from numberValue seconds, an avatar ring, the contact name (text) and number (subText), a live voice waveform, gear / mute / speaker buttons down the left edge.
10944
10944
  // Translucent cool-blue glass, thin glowing lines, scanlines; drawn flat and unmirrored (the face pin tilts / mirrors it).
10945
10945
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D)
@@ -11457,15 +11457,15 @@
11457
11457
  }
11458
11458
  }
11459
11459
  ctx.restore()
11460
- }`)],ri=Y.find(t=>t.id==="history"),Oc=(t,e,c,o,n)=>({id:t,name:e,category:ri.name,pack:"history",duration:c,params:{accent:ri.accent,position:"center",...o,style:"history"},code:n}),Nc="const E=M.ease,RG=M.range,L=M.lerp,RA=M.rgba,CL=M.clamp,MIN=Math.min,MAX=Math.max,PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d;const FT=(env,k,fb)=>(env.fonts||{})[k]||fb,SERIF=(env,z)=>'italic 800 '+Math.round(z)+'px '+FT(env,'play','Georgia, serif'),COND=(env,z)=>'700 '+Math.round(z)+'px '+FT(env,'oswald','Arial Narrow, sans-serif'),HEAVY=(env,z)=>'900 '+Math.round(z)+'px '+FT(env,'bevn','system-ui, sans-serif');const GRAIN=(c,W,H,t,a)=>{const R=M.rand(Math.floor(t*24)*13+5),n=Math.round(W*H/2400);c.save();for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,238,215,'+(.06*a)+')':'rgba(0,0,0,'+(.09*a)+')';c.fillRect(R()*W,R()*H,1.6,1.6)}c.restore()};const WL=(c,W,H,t,D,a,tint,veil)=>{if(a<=0)return;const u=MIN(W,H),pr=D>0?CL(t/D):0;c.save();c.globalAlpha=a;const ww=u*.95,wh=u*1.25,b=u*.05,cx=L(W*.1,W*.8,pr),cy=H*.44,ps=[];for(let i=0;i<2;i++)for(let j=0;j<3;j++)ps.push([-ww/2+i*ww/2+b/2,-wh/2+j*wh/3+b/2,ww/2-b,wh/3-b]);const path=()=>{c.beginPath();ps.forEach(q=>c.rect(q[0],q[1],q[2],q[3]))};c.save();c.translate(cx,cy);c.rotate(-.12);c.transform(1,.16,-.5,1,0,0);c.filter='blur('+Math.round(u*.012)+'px)';c.beginPath();c.rect(-W*4,-H*4,W*8,H*8);ps.forEach(q=>c.rect(q[0],q[1],q[2],q[3]));c.fillStyle='rgba(30,13,2,'+veil+')';c.fill('evenodd');c.fillStyle=RA(tint,.3);path();c.fill();c.filter='none';c.restore();const g=c.createRadialGradient(cx,cy,0,cx,cy,u*.95);g.addColorStop(0,RA(tint,.16));g.addColorStop(1,RA(tint,0));c.fillStyle=g;c.fillRect(0,0,W,H);const R=M.rand(7);for(let i=0;i<34;i++){const x=(R()*W+t*u*.012*(R()+.2))%W,y=(R()*H+H-t*u*.007*R())%H,s=u*(.0012+R()*.0026);c.fillStyle=RA(tint,MAX(0,.22+.25*Math.sin(t*1.7+i)));c.beginPath();c.arc(x,y,s,0,M.TAU);c.fill()}c.restore()};",Or=[Oc("hist-window-light","Nắng cửa sổ trượt trên cảnh",6,{color:"#ffb35c",numberValue:.8},`function render(ctx,t,env){
11461
- ${Nc}
11460
+ }`)],hi=Y.find(t=>t.id==="history"),Nc=(t,e,c,o,n)=>({id:t,name:e,category:hi.name,pack:"history",duration:c,params:{accent:hi.accent,position:"center",...o,style:"history"},code:n}),Ic="const E=M.ease,RG=M.range,L=M.lerp,RA=M.rgba,CL=M.clamp,MIN=Math.min,MAX=Math.max,PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d;const FT=(env,k,fb)=>(env.fonts||{})[k]||fb,SERIF=(env,z)=>'italic 800 '+Math.round(z)+'px '+FT(env,'play','Georgia, serif'),COND=(env,z)=>'700 '+Math.round(z)+'px '+FT(env,'oswald','Arial Narrow, sans-serif'),HEAVY=(env,z)=>'900 '+Math.round(z)+'px '+FT(env,'bevn','system-ui, sans-serif');const GRAIN=(c,W,H,t,a)=>{const R=M.rand(Math.floor(t*24)*13+5),n=Math.round(W*H/2400);c.save();for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,238,215,'+(.06*a)+')':'rgba(0,0,0,'+(.09*a)+')';c.fillRect(R()*W,R()*H,1.6,1.6)}c.restore()};const WL=(c,W,H,t,D,a,tint,veil)=>{if(a<=0)return;const u=MIN(W,H),pr=D>0?CL(t/D):0;c.save();c.globalAlpha=a;const ww=u*.95,wh=u*1.25,b=u*.05,cx=L(W*.1,W*.8,pr),cy=H*.44,ps=[];for(let i=0;i<2;i++)for(let j=0;j<3;j++)ps.push([-ww/2+i*ww/2+b/2,-wh/2+j*wh/3+b/2,ww/2-b,wh/3-b]);const path=()=>{c.beginPath();ps.forEach(q=>c.rect(q[0],q[1],q[2],q[3]))};c.save();c.translate(cx,cy);c.rotate(-.12);c.transform(1,.16,-.5,1,0,0);c.filter='blur('+Math.round(u*.012)+'px)';c.beginPath();c.rect(-W*4,-H*4,W*8,H*8);ps.forEach(q=>c.rect(q[0],q[1],q[2],q[3]));c.fillStyle='rgba(30,13,2,'+veil+')';c.fill('evenodd');c.fillStyle=RA(tint,.3);path();c.fill();c.filter='none';c.restore();const g=c.createRadialGradient(cx,cy,0,cx,cy,u*.95);g.addColorStop(0,RA(tint,.16));g.addColorStop(1,RA(tint,0));c.fillStyle=g;c.fillRect(0,0,W,H);const R=M.rand(7);for(let i=0;i<34;i++){const x=(R()*W+t*u*.012*(R()+.2))%W,y=(R()*H+H-t*u*.007*R())%H,s=u*(.0012+R()*.0026);c.fillStyle=RA(tint,MAX(0,.22+.25*Math.sin(t*1.7+i)));c.beginPath();c.arc(x,y,s,0,M.TAU);c.fill()}c.restore()};",Ir=[Nc("hist-window-light","Nắng cửa sổ trượt trên cảnh",6,{color:"#ffb35c",numberValue:.8},`function render(ctx,t,env){
11461
+ ${Ic}
11462
11462
  // Warm window light sweeping slowly across the shot (a look over a wall, a photo or footage): the tilted shape of a
11463
11463
  // 2 x 3 pane window cut out of a warm veil and lit, its bars in shadow, a soft bloom and dust floating in the beam.
11464
11464
  // color = the light's tint, numberValue = strength 0.15..1.
11465
11465
  const {width:W,height:H,duration:D,params:p}=env,k=M.io(t,D,.7,.7),st=CL(+p.numberValue||.8,.15,1)
11466
11466
  WL(ctx,W,H,t,D,k.v*st,PC(p.color,'#ffb35c'),.42)
11467
- }`),Oc("hist-year-wall","Năm in lớn trên tường nắng",4,{text:"1780",subText:"",color:"#b8641f"},`function render(ctx,t,env){
11468
- ${Nc}
11467
+ }`),Nc("hist-year-wall","Năm in lớn trên tường nắng",4,{text:"1780",subText:"",color:"#b8641f"},`function render(ctx,t,env){
11468
+ ${Ic}
11469
11469
  // A big year / number on a warm sunlit wall (full frame): orange plaster with film grain, window light sliding over it,
11470
11470
  // the year (text) drops in condensed and slanted out of a short blur, a glint runs over it; subText small under it.
11471
11471
  // color = the wall.
@@ -11480,8 +11480,8 @@
11480
11480
  ctx.shadowColor='transparent';ctx.beginPath();ctx.rect(gx-f.size*.25,-f.size,f.size*.5,f.size*2);ctx.clip();ctx.fillStyle='#ffffff';ctx.globalAlpha*=.85;ctx.fillText(f.lines[0],0,0);ctx.restore()
11481
11481
  const sub=String(p.subText||'');if(sub){const q=E.outCubic(RG(t,.6,1.1)),sf=M.fit(ctx,sub,z=>SERIF(env,z),u*.05,S.w*.8,2);ctx.save();ctx.globalAlpha=q*(1-o);ctx.font=sf.font;ctx.textAlign='center';ctx.textBaseline='top'
11482
11482
  ctx.fillStyle='#fff1dc';ctx.shadowColor='rgba(60,20,0,.5)';ctx.shadowBlur=sf.size*.3;sf.lines.forEach((l,i)=>ctx.fillText(l,S.cx,S.y+f.size*.62+i*sf.lh+(1-q)*u*.02));ctx.restore()}
11483
- }`),Oc("hist-serif-title","Tiêu đề chữ nghiêng phát sáng trong cảnh",3.5,{items:"Most Great|Inventions|come from|Labs.",position:"top",color:"#ffcf73"},`function render(ctx,t,env){
11484
- ${Nc}
11483
+ }`),Nc("hist-serif-title","Tiêu đề chữ nghiêng phát sáng trong cảnh",3.5,{items:"Most Great|Inventions|come from|Labs.",position:"top",color:"#ffcf73"},`function render(ctx,t,env){
11484
+ ${Ic}
11485
11485
  // A glowing italic serif title set into the scene (top by default): the lines (items, up to 5) alternate small and big
11486
11486
  // like a magazine lockup ("Most Great | Inventions | come from | Labs."), each word rises out of a soft blur one after
11487
11487
  // another with a warm golden glow behind the letters, then the title blurs away. color = the glow colour.
@@ -11497,8 +11497,8 @@
11497
11497
  x+=ww+sp})
11498
11498
  y+=r.z*.98+gap})
11499
11499
  ctx.restore()
11500
- }`),Oc("hist-tape-label","Băng dán đỏ chữ nghiêng chạy",4.5,{text:"he improved the design and began producing toothbrushes",position:"top"},`function render(ctx,t,env){
11501
- ${Nc}
11500
+ }`),Nc("hist-tape-label","Băng dán đỏ chữ nghiêng chạy",4.5,{text:"he improved the design and began producing toothbrushes",position:"top"},`function render(ctx,t,env){
11501
+ ${Ic}
11502
11502
  // A strip of red tape stuck across the frame (top / center / lower), a little tilted, with the words (text) in a dark
11503
11503
  // italic serif running along it; it slaps on from the left and peels off to the right at the end. accent = tape colour.
11504
11504
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,p.position),u=S.u,acc=PC(p.accent,'#e3313a'),a=E.outCubic(RG(t,0,.35)),o=E.inCubic(RG(t,D-.35,D))
@@ -11511,8 +11511,8 @@
11511
11511
  let w=0;const ws=words.map(x=>ctx.measureText(x).width);ws.forEach(x=>{w+=x+sp});let x=x0+th-((t*u*.12)%MAX(1,w))
11512
11512
  for(let n=0;x<x1&&n<400;n++){const i=n%words.length;if(x+ws[i]>x0)ctx.fillText(words[i],x,th*.04);x+=ws[i]+sp}}
11513
11513
  ctx.restore();ctx.restore()
11514
- }`),Oc("hist-stitch-card","Thẻ viền chỉ khâu, chữ màu xếp chồng",5,{items:"his simple idea|eventually|became|something|billions|use every day"},`function render(ctx,t,env){
11515
- ${Nc}
11514
+ }`),Nc("hist-stitch-card","Thẻ viền chỉ khâu, chữ màu xếp chồng",5,{items:"his simple idea|eventually|became|something|billions|use every day"},`function render(ctx,t,env){
11515
+ ${Ic}
11516
11516
  // A stitched card on a dark slate (full frame): a rounded panel with a dashed thread border sewn around it, then the
11517
11517
  // lines (items, up to 6) stack inside one per beat in heavy uppercase, each line its own neon colour (cyan, red,
11518
11518
  // yellow, green), the first and last small and white, popping in from big out of a blur.
@@ -11531,8 +11531,8 @@
11531
11531
  ctx.font=HEAVY(env,q.z);ctx.shadowColor=q.col;ctx.shadowBlur=q.z*.35;ctx.fillStyle=q.col;ctx.fillText(q.s,0,-q.z/2);ctx.shadowBlur=0;ctx.fillStyle=M.mix(q.col,'#ffffff',.35);ctx.fillText(q.s,0,-q.z/2);ctx.restore()}
11532
11532
  yy+=q.z*.98})}
11533
11533
  ctx.restore()
11534
- }`),Oc("hist-depth-words","Chữ bay lơ lửng trong chiều sâu",4.5,{text:"And the strangest part"},`function render(ctx,t,env){
11535
- ${Nc}
11534
+ }`),Nc("hist-depth-words","Chữ bay lơ lửng trong chiều sâu",4.5,{text:"And the strangest part"},`function render(ctx,t,env){
11535
+ ${Ic}
11536
11536
  // Words floating in depth (full frame, a deep night-blue space): the words of text hang at different distances and the
11537
11537
  // camera drifts forward through them in reading order: the word in focus sharp, nearer and farther ones blurred, the
11538
11538
  // passed ones sliding off past the lens. White italic serif.
@@ -11547,8 +11547,8 @@
11547
11547
  if(a<=0||z<2)return;ctx.save();ctx.globalAlpha*=a;if(bl>.4)ctx.filter='blur('+Math.round(bl)+'px)';ctx.font=SERIF(env,z);const hw=ctx.measureText(q.w).width/2+u*.04,xx=q.z>=f*.6&&hw*2<W?CL(x,hw,W-hw):x
11548
11548
  ctx.shadowColor='rgba(170,200,255,.35)';ctx.shadowBlur=z*.25;ctx.fillStyle='#f4f6fb';ctx.fillText(q.w,xx,y);ctx.restore()})
11549
11549
  ctx.restore()
11550
- }`),Oc("hist-big-word","Chữ khối đỏ 3D đóng sầm (đặt sau vật)",3,{text:"THIS ONE"},`function render(ctx,t,env){
11551
- ${Nc}
11550
+ }`),Nc("hist-big-word","Chữ khối đỏ 3D đóng sầm (đặt sau vật)",3,{text:"THIS ONE"},`function render(ctx,t,env){
11551
+ ${Ic}
11552
11552
  // A heavy red block word slams in with 3D depth (text, e.g. "THIS ONE"): extruded darker layers under the face, a short
11553
11553
  // squash and shake on landing, a sheen on the face. Made to sit BEHIND an object of the footage (placeBehindObject) so
11554
11554
  // the object stands in front of the letters. accent = the colour.
@@ -11560,8 +11560,8 @@
11560
11560
  ctx.shadowColor='rgba(0,0,0,.4)';ctx.shadowBlur=f.size*.2;ctx.shadowOffsetY=f.size*.1;const g=ctx.createLinearGradient(0,-f.size/2,0,f.size/2);g.addColorStop(0,M.mix(acc,'#ffffff',.25));g.addColorStop(.55,acc);g.addColorStop(1,M.mix(acc,'#000000',.15));ctx.fillStyle=g;ctx.fillText(f.lines[0],0,0)
11561
11561
  ctx.shadowColor='transparent';const tw=ctx.measureText(f.lines[0]).width,gx=L(-tw*.7,tw*.7,E.inOutCubic(RG(t,.45,1.3)));ctx.beginPath();ctx.rect(gx-f.size*.3,-f.size,f.size*.35,f.size*2);ctx.clip();ctx.globalAlpha*=.35;ctx.fillStyle='#ffffff';ctx.fillText(f.lines[0],0,0)
11562
11562
  ctx.restore()
11563
- }`),Oc("hist-film-look","Lớp phim cũ: hạt, bụi, nhấp nháy",6,{numberValue:.8},`function render(ctx,t,env){
11564
- ${Nc}
11563
+ }`),Nc("hist-film-look","Lớp phim cũ: hạt, bụi, nhấp nháy",6,{numberValue:.8},`function render(ctx,t,env){
11564
+ ${Ic}
11565
11565
  // An old-film look over the shot: a warm vignette, a gentle exposure flicker, 24 fps grain, dust specks and a hair
11566
11566
  // scratch now and then. numberValue = strength 0.15..1.
11567
11567
  const {width:W,height:H,duration:D,params:p}=env,u=MIN(W,H),k=M.io(t,D,.4,.4),st=CL(+p.numberValue||.8,.15,1)*k.v;if(st<=0)return
@@ -11572,8 +11572,8 @@
11572
11572
  const R=M.rand(fr*31+9),nd=2+Math.floor(R()*4);for(let i=0;i<nd;i++){ctx.fillStyle=R()>.4?'rgba(10,6,2,.55)':'rgba(255,248,235,.45)';ctx.beginPath();ctx.ellipse(R()*W,R()*H,u*(.001+R()*.003),u*(.001+R()*.005),R()*3,0,M.TAU);ctx.fill()}
11573
11573
  const sc=M.rand(Math.floor(t*2)*17+3);if(sc()<.45){const x=sc()*W,w=u*.0018;ctx.fillStyle='rgba(255,250,240,'+(.12+.12*R())+')';ctx.fillRect(x+Math.sin(t*30)*u*.002,0,w,H)}
11574
11574
  ctx.restore()
11575
- }`),Oc("hist-search-cta","Thanh tìm kiếm tự gõ địa chỉ web",4.5,{text:"clipoox.com",position:"center"},`function render(ctx,t,env){
11576
- ${Nc}
11575
+ }`),Nc("hist-search-cta","Thanh tìm kiếm tự gõ địa chỉ web",4.5,{text:"clipoox.com",position:"center"},`function render(ctx,t,env){
11576
+ ${Ic}
11577
11577
  // A search bar types a web address and clicks search (CTA, end card): a dark glass pill slides up, the text (the address)
11578
11578
  // types in with a blinking caret, then a cursor glides to the round search button and clicks it (press + ripple).
11579
11579
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,p.position),u=S.u,s=String(p.text||'').slice(0,40),a=E.outCubic(RG(t,0,.45)),o=E.inCubic(RG(t,D-.35,D))
@@ -11588,7 +11588,7 @@
11588
11588
  if(cl>0){ctx.strokeStyle='rgba(255,255,255,'+(.7*(1-cl))+')';ctx.lineWidth=u*.003;ctx.beginPath();ctx.arc(bcx,bcy,br*(1+1.4*cl),0,M.TAU);ctx.stroke()}
11589
11589
  if(mv>0){const px=L(bcx+u*.22,bcx+br*.2,mv),py=L(bcy+u*.2,bcy+br*.25,mv),z=u*.045*(1-.1*pr);ctx.save();ctx.translate(px,py);ctx.fillStyle='#ffffff';ctx.strokeStyle='#000000';ctx.lineWidth=u*.0025;ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(0,z);ctx.lineTo(z*.27,z*.76);ctx.lineTo(z*.6,z*.7);ctx.closePath();ctx.fill();ctx.stroke();ctx.restore()}
11590
11590
  ctx.restore()
11591
- }`)],xi=t=>Y.find(e=>e.id===t),Mt=(t,e,c,o,n,s)=>({id:t,name:e,category:xi(c).name,pack:c,duration:o,params:{...n,accent:xi(c).accent,style:c},code:s}),hi=[Mt("bold-word-pop","Chữ nhảy từng từ","bold",3.6,{text:"Cách này giúp bạn tăng gấp đôi doanh thu",position:"center"},`function render(ctx,t,env){
11591
+ }`)],fi=t=>Y.find(e=>e.id===t),Mt=(t,e,c,o,n,s)=>({id:t,name:e,category:fi(c).name,pack:c,duration:o,params:{...n,accent:fi(c).accent,style:c},code:s}),pi=[Mt("bold-word-pop","Chữ nhảy từng từ","bold",3.6,{text:"Cách này giúp bạn tăng gấp đôi doanh thu",position:"center"},`function render(ctx,t,env){
11592
11592
  // Word-by-word pop: each word springs in with a motion-blur smear; the newest word takes the accent colour.
11593
11593
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.2,.3)
11594
11594
  const text=sk.caps?String(p.text).toUpperCase():String(p.text)
@@ -11981,7 +11981,7 @@
11981
11981
  for(let i=0;i<2;i++){const x=sx+tw+bh*.18+i*bh*.17+Math.sin(t*6-i*.8)*bh*.04;ctx.globalAlpha=k.v*(.55+.45*i);ctx.beginPath();ctx.moveTo(x,S.y-bh*.15);ctx.lineTo(x+bh*.12,S.y);ctx.lineTo(x,S.y+bh*.15);ctx.stroke()}
11982
11982
  ctx.restore()
11983
11983
  if(p.sub){const sf=M.fit(ctx,String(p.sub),s=>sk.font(s,'s'),S.u*(S.port?.055:.045),S.w,1),e=M.ease.outCubic(M.range(t,.5,1));ctx.save();ctx.globalAlpha=k.v*e;ctx.font=sf.font;ctx.textAlign='center';ctx.textBaseline='middle';M.ink(ctx,sk,sf.lines[0],S.cx,by+bh+sf.size*1.1+(1-e)*S.u*.02,sf.size);ctx.restore()}
11984
- }`),...cl,...al,...ol,...nl,...sl,...il,...ll,...pl,...dl,...gl,...ul,...bl,...Ml,...yl,...rn,...wl,...ml,...kl,...Sl,...vl,...Tl,...Cl,...Al,...Rl,...Pl,...Wl,...Hl,...Ll,...Dl,...El,...ql,...Gl,...Il,...Ul,...Kl,...jl,...Fl,...Yl,..._l,...Ql,...er,...rr,...xr,...Lr,...Dr,...Er,...qr,...Gr,...Or],Nr=[{id:"fxo-glitch-bars",name:"Nhiễu kỹ thuật số",duration:4,params:{amount:.7,colorA:"#ff2a6d",colorB:"#05d9e8",seed:3},code:`function render(ctx,t,env){
11984
+ }`),...ol,...nl,...sl,...il,...ll,...rl,...xl,...gl,...ul,...bl,...Ml,...yl,...wl,...ml,...hn,...kl,...Sl,...vl,...Tl,...Cl,...Al,...Rl,...Pl,...zl,...Bl,...Ll,...Dl,...El,...ql,...Gl,...Ol,...Nl,...Kl,...jl,...Vl,...$l,..._l,...Ql,...Zl,...Jl,...ar,...hr,...fr,...Er,...qr,...Gr,...Or,...Nr,...Ir],Ur=[{id:"fxo-glitch-bars",name:"Nhiễu kỹ thuật số",duration:4,params:{amount:.7,colorA:"#ff2a6d",colorB:"#05d9e8",seed:3},code:`function render(ctx,t,env){
11985
11985
  const {width:W,height:H,params:p}=env,u=Math.min(W,H),A=M.clamp(+p.amount||0),sd=(p.seed|0)+1
11986
11986
  // Bursts: each 0.5 s slot may hold one burst of 0.15–0.38 s; between bursts only rare single-frame ticks.
11987
11987
  const slot=Math.floor(t/.5),rs=M.rand(slot*7907+sd*131),on=rs()<.8,b0=slot*.5+rs()*.15,b1=b0+.15+rs()*.23
@@ -12270,7 +12270,7 @@
12270
12270
  lg.addColorStop(0,M.rgba(p.color,0));lg.addColorStop(1,M.rgba(p.color,.12*A))
12271
12271
  ctx.fillStyle=lg;ctx.fillRect(0,0,W,H)
12272
12272
  ctx.restore()
12273
- }`}],Ir=[{id:"fxo-lens-flare",name:"Lóa ống kính",duration:5,params:{color:"#ffb469",strength:.8,size:1},code:`function render(ctx,t,env){
12273
+ }`}],Kr=[{id:"fxo-lens-flare",name:"Lóa ống kính",duration:5,params:{color:"#ffb469",strength:.8,size:1},code:`function render(ctx,t,env){
12274
12274
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),S=Math.max(.3,+p.size||1)
12275
12275
  const A=M.clamp(+p.strength)*M.range(t,0,Math.min(.4,D*.1))*(1-M.range(t,D-Math.min(.4,D*.1),D))
12276
12276
  if(A<=0)return
@@ -12500,7 +12500,7 @@
12500
12500
  ctx.fillStyle=M.rgba(p.edge,.55);path(1.35,u*.0012);ctx.fill()
12501
12501
  ctx.fillStyle=M.rgba(p.color,.92);path(1,0);ctx.fill()
12502
12502
  ctx.restore()
12503
- }`}],Ur=[{id:"fxo-rain",name:"Mưa rơi",duration:6,params:{amount:.6,color:"#cfdcf0",wind:.35,speed:1,splashes:!0,seed:3},code:`function render(ctx,t,env){
12503
+ }`}],jr=[{id:"fxo-rain",name:"Mưa rơi",duration:6,params:{amount:.6,color:"#cfdcf0",wind:.35,speed:1,splashes:!0,seed:3},code:`function render(ctx,t,env){
12504
12504
  const {width:W,height:H,duration:D,params:p}=env,U=Math.min(W,H),A=M.clamp(+p.amount||0,0,1),sp=M.clamp(+p.speed||1,.3,3)
12505
12505
  const col=p.color,tilt=M.clamp(+p.wind||0,-1,1)*.3,seed=(p.seed|0)+1
12506
12506
  ctx.save()
@@ -12797,7 +12797,7 @@
12797
12797
  // Small gloss glint, top-left.
12798
12798
  ctx.fillStyle='rgba(255,255,255,.85)';ctx.beginPath();ctx.ellipse(-R*.3,-R*.3,R*.09,R*.035,-.7,0,M.TAU);ctx.fill()
12799
12799
  ctx.restore()
12800
- }`}],Kr=[{id:"fxo-paper-bg",name:"Nền giấy chấm lưới",duration:6,params:{color:"#ece4d2",dots:"#b9ad94",grid:.045,stain:.5,seed:4},code:`function render(ctx,t,env){
12800
+ }`}],Vr=[{id:"fxo-paper-bg",name:"Nền giấy chấm lưới",duration:6,params:{color:"#ece4d2",dots:"#b9ad94",grid:.045,stain:.5,seed:4},code:`function render(ctx,t,env){
12801
12801
  const {width:W,height:H,params:p}=env,U=Math.min(W,H),seed=(p.seed|0)+1,g=Math.max(.02,Math.min(.12,+p.grid||.045))*U,st=M.clamp(+p.stain||0,0,1)
12802
12802
  ctx.save()
12803
12803
  ctx.fillStyle=p.color;ctx.fillRect(0,0,W,H)
@@ -12856,8 +12856,8 @@
12856
12856
  ctx.restore()
12857
12857
  }
12858
12858
  ctx.restore()
12859
- }`}],fi=[...Nr,...Ir,...Ur,...Kr].map(t=>Object.freeze({category:"Lớp phủ",...t})),pi="const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);let FT='sans-serif';const VIS=(cam,env,d)=>{const h=2*d*Math.tan(cam.fov*Math.PI/360);return {w:h*env.width/env.height,h}};const TXT=(s,h,o)=>{const m=M3.textPlane(String(s),Object.assign({height:h*String(s).split(String.fromCharCode(10)).length,weight:800,font:'mont',color:'#ffffff'},o||{}));m.userData.fit=1;return m};const FITW=(m,maxW)=>{const w=m.geometry.parameters.width,s=Math.min(1,maxW/w);m.userData.fit=s;m.scale.setScalar(s);return s};let SOFTT=null;const SOFT=()=>SOFTT||(SOFTT=M3.paint(64,64,(x,w,h)=>{const g=x.createRadialGradient(w/2,h/2,0,w/2,h/2,w/2);g.addColorStop(0,'rgba(255,255,255,1)');g.addColorStop(.4,'rgba(255,255,255,.45)');g.addColorStop(1,'rgba(255,255,255,0)');x.fillStyle=g;x.fillRect(0,0,w,h)}));const BGP=(scene,env,o)=>{if(!ON(env.params)){scene.background=null;return}const w=512,h=Math.max(2,Math.round(512*env.height/env.width));scene.background=M3.paint(w,h,(x,W,H)=>{const g=x.createLinearGradient(0,0,0,H);g.addColorStop(0,o.top);g.addColorStop(1,o.bot);x.fillStyle=g;x.fillRect(0,0,W,H);(o.glows||[]).forEach(v=>{const R=Math.max(W,H)*v[2],r=x.createRadialGradient(W*v[0],H*v[1],0,W*v[0],H*v[1],R);r.addColorStop(0,M.rgba(v[3],v[4]));r.addColorStop(1,M.rgba(v[3],0));x.fillStyle=r;x.fillRect(0,0,W,H)});if(o.dots){x.fillStyle=M.rgba(o.ink||'#000000',o.dots);const s=Math.max(W,H)/34;for(let i=s/2;i<W;i+=s)for(let j=s/2;j<H;j+=s)x.fillRect(i-1,j-1,2,2)}if(o.vig){const v=x.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,Math.max(W,H)*.75);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,'+o.vig+')');x.fillStyle=v;x.fillRect(0,0,W,H)}})};const CNT=s=>{const m=/^([^0-9]*)([0-9][0-9.,]*)(.*)$/.exec(String(s).trim());if(!m)return null;const d=m[2];if(/^[0-9]{1,3}([.,][0-9]{3})+$/.test(d))return {pre:m[1],suf:m[3],n:+d.replace(/[.,]/g,''),sep:d.replace(/[0-9]/g,'')[0],dec:0};const q=/^([0-9]+)([.,]([0-9]+))?$/.exec(d);if(!q)return null;return {pre:m[1],suf:m[3],n:+(q[1]+'.'+(q[3]||'0')),sep:'',dec:q[3]?q[3].length:0,dc:q[2]?q[2][0]:'.'}};const FMT=(c,k)=>{const v=c.n*k;let s;if(c.sep){s=String(Math.round(v));let o='';while(s.length>3){o=c.sep+s.slice(-3)+o;s=s.slice(0,-3)}s=s+o}else if(c.dec)s=v.toFixed(c.dec).replace('.',c.dc);else s=String(Math.round(v));return c.pre+s+c.suf};const COUNTER=(str,h,o,steps)=>{const c=CNT(str),g=new THREE.Group(),cache={};steps=steps||16;g.userData.set=k=>{const kq=Math.round(Math.min(1,Math.max(0,k))*steps)/steps,s=c?FMT(c,kq):String(str);let m=cache[s];if(!m){m=TXT(s,h,o);cache[s]=m;g.add(m)}for(const x of g.children)x.visible=x===m;return m};g.userData.set(1);return g};const WRAP=(s,on,n)=>{s=String(s);if(!on||s.length<(n||16)||s.indexOf(String.fromCharCode(10))>=0)return s;const m=s.length/2;let b=-1;for(let i=0;i<s.length;i++)if(s[i]===' '&&(b<0||Math.abs(i-m)<Math.abs(b-m)))b=i;return b<0?s:s.slice(0,b)+String.fromCharCode(10)+s.slice(b+1)};const EL=(geo,mat)=>new THREE.Mesh(geo,mat);const BOB=(t,i)=>Math.sin(t*1.3+i*1.7)*.06;",di=Object.freeze({id:"editorial3d",name:"Editorial 3D",tag:"Vật thể 3D bóng vui nhộn, chữ đậm, nền giấy sáng"}),jr=pi+"const INK0='#141414';let EINK=INK0;const EBG=(scene,env,gl)=>BGP(scene,env,{top:'#f8f4ec',bot:'#ebe3d4',glows:gl||[],dots:.07,ink:'#141414',vig:.1});const EINIT=(scene,env)=>{FT=env.fonts.mont;EINK=env.params.ink||INK0;M3.studio(scene,{intensity:1.15,fill:'#fff3e0'});return env.height>env.width};const DROP=(env,size,op)=>{const s=M3.shadow({size,opacity:op??.22});s.rotation.x=0;s.visible=ON(env.params);return s};const STAR4=c=>{const s=new THREE.Shape();c=c??.14;s.moveTo(0,1);s.quadraticCurveTo(c,c,1,0);s.quadraticCurveTo(c,-c,0,-1);s.quadraticCurveTo(-c,-c,-1,0);s.quadraticCurveTo(-c,c,0,1);return s};",Ma=(t,e,c,o,n)=>({id:t,name:e,category:"3D",pack:di.id,kind:"three",duration:c,params:{...o,bg:!0},code:jr+`
12860
- `+n}),Vr=[Ma("3d-sparkle-star","Ngôi sao lấp lánh 3D",3,{text:"MỚI!",color:"#ffc21a",color2:"#ff4b2b"},`// A glossy 4-point sparkle star spins in and glints; small stars twinkle around it; a bold label below.
12859
+ }`}],di=[...Ur,...Kr,...jr,...Vr].map(t=>Object.freeze({category:"Lớp phủ",...t})),gi="const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);let FT='sans-serif';const VIS=(cam,env,d)=>{const h=2*d*Math.tan(cam.fov*Math.PI/360);return {w:h*env.width/env.height,h}};const TXT=(s,h,o)=>{const m=M3.textPlane(String(s),Object.assign({height:h*String(s).split(String.fromCharCode(10)).length,weight:800,font:'mont',color:'#ffffff'},o||{}));m.userData.fit=1;return m};const FITW=(m,maxW)=>{const w=m.geometry.parameters.width,s=Math.min(1,maxW/w);m.userData.fit=s;m.scale.setScalar(s);return s};let SOFTT=null;const SOFT=()=>SOFTT||(SOFTT=M3.paint(64,64,(x,w,h)=>{const g=x.createRadialGradient(w/2,h/2,0,w/2,h/2,w/2);g.addColorStop(0,'rgba(255,255,255,1)');g.addColorStop(.4,'rgba(255,255,255,.45)');g.addColorStop(1,'rgba(255,255,255,0)');x.fillStyle=g;x.fillRect(0,0,w,h)}));const BGP=(scene,env,o)=>{if(!ON(env.params)){scene.background=null;return}const w=512,h=Math.max(2,Math.round(512*env.height/env.width));scene.background=M3.paint(w,h,(x,W,H)=>{const g=x.createLinearGradient(0,0,0,H);g.addColorStop(0,o.top);g.addColorStop(1,o.bot);x.fillStyle=g;x.fillRect(0,0,W,H);(o.glows||[]).forEach(v=>{const R=Math.max(W,H)*v[2],r=x.createRadialGradient(W*v[0],H*v[1],0,W*v[0],H*v[1],R);r.addColorStop(0,M.rgba(v[3],v[4]));r.addColorStop(1,M.rgba(v[3],0));x.fillStyle=r;x.fillRect(0,0,W,H)});if(o.dots){x.fillStyle=M.rgba(o.ink||'#000000',o.dots);const s=Math.max(W,H)/34;for(let i=s/2;i<W;i+=s)for(let j=s/2;j<H;j+=s)x.fillRect(i-1,j-1,2,2)}if(o.vig){const v=x.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,Math.max(W,H)*.75);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,'+o.vig+')');x.fillStyle=v;x.fillRect(0,0,W,H)}})};const CNT=s=>{const m=/^([^0-9]*)([0-9][0-9.,]*)(.*)$/.exec(String(s).trim());if(!m)return null;const d=m[2];if(/^[0-9]{1,3}([.,][0-9]{3})+$/.test(d))return {pre:m[1],suf:m[3],n:+d.replace(/[.,]/g,''),sep:d.replace(/[0-9]/g,'')[0],dec:0};const q=/^([0-9]+)([.,]([0-9]+))?$/.exec(d);if(!q)return null;return {pre:m[1],suf:m[3],n:+(q[1]+'.'+(q[3]||'0')),sep:'',dec:q[3]?q[3].length:0,dc:q[2]?q[2][0]:'.'}};const FMT=(c,k)=>{const v=c.n*k;let s;if(c.sep){s=String(Math.round(v));let o='';while(s.length>3){o=c.sep+s.slice(-3)+o;s=s.slice(0,-3)}s=s+o}else if(c.dec)s=v.toFixed(c.dec).replace('.',c.dc);else s=String(Math.round(v));return c.pre+s+c.suf};const COUNTER=(str,h,o,steps)=>{const c=CNT(str),g=new THREE.Group(),cache={};steps=steps||16;g.userData.set=k=>{const kq=Math.round(Math.min(1,Math.max(0,k))*steps)/steps,s=c?FMT(c,kq):String(str);let m=cache[s];if(!m){m=TXT(s,h,o);cache[s]=m;g.add(m)}for(const x of g.children)x.visible=x===m;return m};g.userData.set(1);return g};const WRAP=(s,on,n)=>{s=String(s);if(!on||s.length<(n||16)||s.indexOf(String.fromCharCode(10))>=0)return s;const m=s.length/2;let b=-1;for(let i=0;i<s.length;i++)if(s[i]===' '&&(b<0||Math.abs(i-m)<Math.abs(b-m)))b=i;return b<0?s:s.slice(0,b)+String.fromCharCode(10)+s.slice(b+1)};const EL=(geo,mat)=>new THREE.Mesh(geo,mat);const BOB=(t,i)=>Math.sin(t*1.3+i*1.7)*.06;",ui=Object.freeze({id:"editorial3d",name:"Editorial 3D",tag:"Vật thể 3D bóng vui nhộn, chữ đậm, nền giấy sáng"}),$r=gi+"const INK0='#141414';let EINK=INK0;const EBG=(scene,env,gl)=>BGP(scene,env,{top:'#f8f4ec',bot:'#ebe3d4',glows:gl||[],dots:.07,ink:'#141414',vig:.1});const EINIT=(scene,env)=>{FT=env.fonts.mont;EINK=env.params.ink||INK0;M3.studio(scene,{intensity:1.15,fill:'#fff3e0'});return env.height>env.width};const DROP=(env,size,op)=>{const s=M3.shadow({size,opacity:op??.22});s.rotation.x=0;s.visible=ON(env.params);return s};const STAR4=c=>{const s=new THREE.Shape();c=c??.14;s.moveTo(0,1);s.quadraticCurveTo(c,c,1,0);s.quadraticCurveTo(c,-c,0,-1);s.quadraticCurveTo(-c,-c,-1,0);s.quadraticCurveTo(-c,c,0,1);return s};",Ma=(t,e,c,o,n)=>({id:t,name:e,category:"3D",pack:ui.id,kind:"three",duration:c,params:{...o,bg:!0},code:$r+`
12860
+ `+n}),Xr=[Ma("3d-sparkle-star","Ngôi sao lấp lánh 3D",3,{text:"MỚI!",color:"#ffc21a",color2:"#ff4b2b"},`// A glossy 4-point sparkle star spins in and glints; small stars twinkle around it; a bold label below.
12861
12861
  let star,minis=[],glint,label,sh,dist,port,lfit=1
12862
12862
  function setup(THREE,scene,camera,env){
12863
12863
  const p=env.params;port=EINIT(scene,env);EBG(scene,env,[[.5,.4,.45,'#ffe7a8',.5]])
@@ -13022,8 +13022,8 @@ function render(t,env){
13022
13022
  const m=num.userData.set(e.outCubic(M.range(t,.3,2.6)));m.material.opacity=M.range(t,.3,.5);num.scale.setScalar(Math.max(.001,nfit*k*pulse))
13023
13023
  const lk=e.outCubic(M.range(t,.6,1.1));label.material.opacity=lk;label.position.y=-1.75-(1-lk)*.25
13024
13024
  M3.orbit(env.camera,.12*Math.sin(t*.6),{radius:dist,height:0,target:[0,-.05,0]})
13025
- }`)],gi=Object.freeze({id:"clipoox3d",name:"Clipoox 3D",tag:"Cảnh 3D SaaS kiểu đất sét bóng: màn hình, điện thoại, bảng số liệu, logo Clipoox"}),$r=pi+"const LM0='#8afb00',BK='#0d0d0d',WH='#f4f6f0';let A=LM0,MT=null;const TONE={graphite:['#262a21','#0a0b09'],moss:['#1d2a10','#060905'],haze:['#2b3125','#0b0d0a']};const CBG=(scene,env,tone,gl)=>BGP(scene,env,{top:TONE[tone][0],bot:TONE[tone][1],glows:(gl||[[.5,.45,.55,.18]]).map(v=>[v[0],v[1],v[2],A,v[3]]),vig:.5});const MATS=()=>({dark:M3.glossy('#23271f',{roughness:.32}),light:M3.glossy('#eef1ea',{roughness:.28}),lime:M3.glossy(A,{roughness:.22}),silver:M3.metal('#c9cdc4',{roughness:.26}),glass:M3.glass('#e9ffd0',{opacity:.3}),ink:M3.glossy(BK,{roughness:.3}),glow:M3.glow(A)});const FLAME=()=>{const P=(x,y)=>[(x-256)/318,(251-y)/318],s=new THREE.Shape(),o=P(256,410);s.moveTo(o[0],o[1]);const B=(a,b,c,d,e,f)=>{const p1=P(a,b),p2=P(c,d),p3=P(e,f);s.bezierCurveTo(p1[0],p1[1],p2[0],p2[1],p3[0],p3[1])};B(170,410,113,346,118,270);B(121,218,148,180,186,146);B(184,168,190,186,204,198);B(214,150,238,114,272,92);B(280,128,302,150,336,172);B(374,198,396,238,396,280);B(396,353,334,410,256,410);const h=new THREE.Path(),c=P(258,290);h.absarc(c[0],c[1],60/318,0,Math.PI*2,true);s.holes.push(h);return s};const APPT=s=>{const g=new THREE.Group();g.add(EL(M3.roundedBox(s,s,s*.24,s*.23),MT.lime));const fg=new THREE.ExtrudeGeometry(FLAME(),{depth:.14,bevelEnabled:true,bevelThickness:.03,bevelSize:.02,bevelSegments:2,curveSegments:12});fg.center();const f=EL(fg,MT.ink);f.scale.setScalar(s*.6);f.position.z=s*.12+.02;g.add(f);return g};const UI=(kind,w,h,o)=>{o=o||{};return M3.paint(w,h,(x,W,H)=>{const u=Math.min(W,H*2.4)/400,lt=!!o.light,bg=lt?'#f6f7f2':'#171a16',ln=lt?'rgba(0,0,0,.10)':'rgba(255,255,255,.12)',ln2=lt?'rgba(0,0,0,.2)':'rgba(255,255,255,.3)',ink=lt?'#15171a':'#eef2ea',a=A;const RR=(X,Y,w2,h2,r,c)=>{x.fillStyle=c;x.beginPath();x.roundRect(X,Y,Math.max(1,w2),Math.max(1,h2),Math.max(0,Math.min(r,h2/2,w2/2)));x.fill()};RR(0,0,W,H,18*u,bg);const bar=o.bar!==false;if(bar){[0,1,2].forEach(i=>{x.fillStyle=i?ln2:a;x.beginPath();x.arc(22*u+i*16*u,20*u,5*u,0,M.TAU);x.fill()});RR(80*u,16*u,W*.35,8*u,4*u,ln)}const L=18*u,R=W-18*u,T=bar?40*u:16*u,B=H-16*u,cw=R-L,ch=B-T;const BARS=(X,Y,w2,h2,v)=>v.forEach((k,i)=>{const bw=w2/v.length*.62,bx=X+i*w2/v.length+(w2/v.length-bw)/2;RR(bx,Y+h2*(1-k),bw,h2*k,5*u,i===v.length-1?a:ln2)});const LINE=(X,Y,w2,h2,v)=>{x.beginPath();v.forEach((k,i)=>{const px=X+i*w2/(v.length-1),py=Y+h2*(1-k);i?x.lineTo(px,py):x.moveTo(px,py)});x.strokeStyle=a;x.lineWidth=5*u;x.lineJoin='round';x.lineCap='round';x.stroke();x.lineTo(X+w2,Y+h2);x.lineTo(X,Y+h2);x.closePath();const g=x.createLinearGradient(0,Y,0,Y+h2);g.addColorStop(0,M.rgba(a,.35));g.addColorStop(1,M.rgba(a,0));x.fillStyle=g;x.fill()};const AV=(X,Y,r,l)=>{r=Math.max(2,r);x.fillStyle=a;x.beginPath();x.arc(X,Y,r,0,M.TAU);x.fill();x.fillStyle=BK;x.font='800 '+Math.round(r*1.1)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText(l||'C',X,Y+r*.05)};if(kind==='bars')BARS(L,T+6*u,cw,ch-6*u,[.45,.7,.55,.85,.62,1]);else if(kind==='line')LINE(L,T+8*u,cw,ch-8*u,[.3,.5,.42,.7,.6,.92]);else if(kind==='table'){const n=Math.max(2,Math.min(5,Math.floor(ch/(34*u))));for(let i=0;i<n;i++){const y=T+i*ch/n+ch/n/2;x.fillStyle=ln2;x.beginPath();x.arc(L+10*u,y,8*u,0,M.TAU);x.fill();RR(L+28*u,y-5*u,cw*.38,10*u,5*u,ln2);RR(L+28*u+cw*.45,y-5*u,cw*.2,10*u,5*u,ln);RR(R-50*u,y-8*u,50*u,16*u,8*u,i===1?a:ln)}}else if(kind==='video'){RR(L,T,cw,ch-26*u,10*u,'#0b0c0a');const cx=L+cw/2,cy=T+(ch-26*u)/2,r=Math.min(cw,ch)*.16;x.fillStyle=a;x.beginPath();x.arc(cx,cy,r,0,M.TAU);x.fill();x.fillStyle=BK;x.beginPath();x.moveTo(cx-r*.3,cy-r*.45);x.lineTo(cx+r*.5,cy);x.lineTo(cx-r*.3,cy+r*.45);x.closePath();x.fill();RR(L,B-12*u,cw,8*u,4*u,ln2);RR(L,B-12*u,cw*.42,8*u,4*u,a)}else if(kind==='profile'||kind==='chip'){const r=Math.min(ch*.4,30*u);AV(L+r+2*u,T+ch/2,r,o.letter);RR(L+r*2+16*u,T+ch/2-r*.55,cw*.45,r*.42,r*.2,ink);RR(L+r*2+16*u,T+ch/2+r*.15,cw*.3,r*.34,r*.17,ln2)}else if(kind==='donut'){const cx=W/2,cy=T+ch/2,r=Math.min(cw,ch)*.36;x.lineWidth=r*.36;x.strokeStyle=ln2;x.beginPath();x.arc(cx,cy,Math.max(1,r),0,M.TAU);x.stroke();x.strokeStyle=a;x.lineCap='round';x.beginPath();x.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*.68);x.stroke();x.fillStyle=ink;x.font='800 '+Math.round(r*.55)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText('68%',cx,cy)}else if(kind==='chat'){[[0,.62,0],[1,.5,1],[0,.4,0]].forEach((v,i)=>{const bw=cw*v[1],y=T+i*ch/3+4*u,bh=ch/3-10*u;RR(v[0]?R-bw:L,y,bw,bh,bh/2,v[2]?a:ln2)})}else if(kind==='post'){const s=ch;const g=x.createLinearGradient(L,T,L+s,T+s);g.addColorStop(0,a);g.addColorStop(1,M.mix(a,'#1a2a05',.6));RR(L,T,s,s,8*u,g);RR(L+s+14*u,T+s*.18,cw-s-14*u,s*.2,s*.1,ink);RR(L+s+14*u,T+s*.56,(cw-s-14*u)*.6,s*.18,s*.09,ln2)}else if(kind==='feed'){RR(L,T,cw*.5,22*u,11*u,a);for(let i=0;i<4;i++){const y=T+40*u+i*(ch-40*u)/4,hh=(ch-40*u)/4-14*u;RR(L,y,cw,hh,14*u,ln);RR(L+10*u,y+10*u,hh-20*u,hh-20*u,10*u,i%2?ln2:M.rgba(a,.75));RR(L+hh,y+hh*.25,cw*.45,hh*.14,hh*.07,ink);RR(L+hh,y+hh*.55,cw*.3,hh*.12,hh*.06,ln2)}}else if(kind==='glyph'){const cx=W/2,cy=H/2,s=W*.24;x.strokeStyle=a;x.fillStyle=a;x.lineWidth=W*.055;x.lineJoin='round';x.lineCap='round';x.beginPath();const g=o.g;if(g==='chat'){x.roundRect(cx-s,cy-s*.75,s*2,s*1.35,s*.4);x.moveTo(cx-s*.4,cy+s*.6);x.lineTo(cx-s*.7,cy+s);x.lineTo(cx-s*.05,cy+s*.6);x.stroke();[-.45,0,.45].forEach(d=>{x.beginPath();x.arc(cx+d*s,cy-s*.08,s*.12,0,M.TAU);x.fill()})}else if(g==='bag'){x.roundRect(cx-s*.85,cy-s*.4,s*1.7,s*1.35,s*.2);x.stroke();x.beginPath();x.arc(cx,cy-s*.4,s*.45,Math.PI,0);x.stroke()}else if(g==='globe'){x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.ellipse(cx,cy,s*.42,s,0,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s,cy);x.lineTo(cx+s,cy);x.moveTo(cx-s*.85,cy-s*.5);x.lineTo(cx+s*.85,cy-s*.5);x.moveTo(cx-s*.85,cy+s*.5);x.lineTo(cx+s*.85,cy+s*.5);x.stroke()}else if(g==='mega'){x.moveTo(cx-s*.8,cy-s*.3);x.lineTo(cx+s*.6,cy-s*.85);x.lineTo(cx+s*.6,cy+s*.85);x.lineTo(cx-s*.8,cy+s*.3);x.closePath();x.stroke();x.beginPath();x.moveTo(cx-s*.45,cy+s*.35);x.lineTo(cx-s*.3,cy+s*.95);x.stroke()}else if(g==='mail'){x.roundRect(cx-s,cy-s*.7,s*2,s*1.4,s*.15);x.moveTo(cx-s*.9,cy-s*.55);x.lineTo(cx,cy+s*.1);x.lineTo(cx+s*.9,cy-s*.55);x.stroke()}else {x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s*.3,cy-s*.45);x.lineTo(cx+s*.5,cy);x.lineTo(cx-s*.3,cy+s*.45);x.closePath();x.fill()}}else if(kind==='toolbar'){AV(L+ch*.4,T+ch/2,ch*.34,'C');for(let i=0;i<4;i++)RR(L+ch+i*cw*.13,T+ch*.32,cw*.1,ch*.36,ch*.18,i===0?a:ln2);RR(R-cw*.16,T+ch*.22,cw*.16,ch*.56,ch*.28,a)}else if(kind==='panel'){x.strokeStyle=ln;x.lineWidth=1.5*u;for(let i=1;i<6;i++){const y=T+i*ch/6;x.beginPath();x.moveTo(L,y);x.lineTo(R,y);x.stroke()}}else {const sw=cw*.16;RR(L,T,sw,ch,10*u,ln);for(let i=0;i<4;i++)RR(L+10*u,T+14*u+i*26*u,sw-20*u,10*u,5*u,i?ln2:a);const X=L+sw+12*u,cw2=R-X;for(let i=0;i<3;i++){RR(X+i*cw2/3,T,cw2/3-10*u,ch*.26,10*u,ln);RR(X+i*cw2/3+10*u,T+ch*.07,cw2/3*.4,ch*.06,4*u,ln2);RR(X+i*cw2/3+10*u,T+ch*.16,cw2/3*.55,ch*.06,4*u,i?ink:a)}BARS(X,T+ch*.34,cw2*.45,ch*.64,[.4,.62,.5,.8,.66,1]);LINE(X+cw2*.52,T+ch*.36,cw2*.48,ch*.6,[.25,.45,.35,.62,.55,.85])}})};const CARD=(w,h,kind,o)=>{o=o||{};const g=new THREE.Group(),d=o.d||.09,r=o.r||Math.min(w,h)*.14;g.add(EL(M3.roundedBox(w,h,d,r),o.light?MT.light:MT.dark));const px=Math.min(640,Math.max(220,Math.round(240*w))),f=EL(new THREE.PlaneGeometry(w-.05,h-.05),new THREE.MeshBasicMaterial({map:UI(kind,px,Math.round(px*(h-.05)/(w-.05)),o),alphaTest:.5,toneMapped:false}));f.position.z=d/2+.004;g.add(f);return g};const FLOATS=(parent,n,seed,bx)=>{const r=M.rand(seed),geos=[new THREE.TorusGeometry(.3,.12,12,32),new THREE.SphereGeometry(.24,22,14),M3.roundedBox(.36,.36,.36,.08),new THREE.CapsuleGeometry(.12,.32,4,10)],mats=[MT.lime,MT.silver,MT.dark,MT.glass,MT.lime,MT.light],out=[];for(let i=0;i<n;i++){const m=EL(geos[i%4],mats[Math.floor(r()*mats.length)]);m.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],s:.55+r()*.7,ph:r()*6.3,sp:[(r()-.5)*1.4,(r()-.5)*1.4,(r()-.5)*.8],r0:[r()*6,r()*6,r()*6]};parent.add(m);out.push(m)}return out};const FLOATU=(list,t,t0,amp)=>list.forEach((m,i)=>{const u=m.userData,b=u.b,a=amp??1,k=M.ease.outBack(M.range(t,t0+i*.04,t0+.55+i*.04));m.position.set(b[0]+Math.sin(t*.5+u.ph)*.18*a,b[1]+Math.sin(t*.8+u.ph*1.3)*.22*a,b[2]);m.rotation.set(u.r0[0]+t*u.sp[0],u.r0[1]+t*u.sp[1],u.r0[2]+t*u.sp[2]);m.scale.setScalar(Math.max(.001,u.s*k))});const BOKEH=(parent,n,seed,bx)=>{const r=M.rand(seed),out=[];for(let i=0;i<n;i++){const s=new THREE.Sprite(new THREE.SpriteMaterial({map:SOFT(),color:new THREE.Color(r()<.6?A:'#ffffff'),transparent:true,opacity:.08+r()*.2,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));const z=.4+r()*1.6;s.scale.set(z,z,1);s.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],ph:r()*6.3,o:s.material.opacity};parent.add(s);out.push(s)}return out};const BOKU=(list,t,k)=>list.forEach(s=>{const u=s.userData;s.position.set(u.b[0]+Math.sin(t*.3+u.ph)*.3,u.b[1]+Math.cos(t*.25+u.ph)*.3,u.b[2]);s.material.opacity=u.o*k});const PED=r=>{const g=new THREE.Group();g.add(EL(new THREE.CylinderGeometry(r,r*1.05,.42,56),MT.dark));const ring=EL(new THREE.TorusGeometry(r*1.005,.035,8,80),MT.glow);ring.rotation.x=Math.PI/2;ring.position.y=.21;g.add(ring);const disc=EL(new THREE.PlaneGeometry(r*3.4,r*3.4),new THREE.MeshBasicMaterial({map:SOFT(),color:new THREE.Color(A),transparent:true,opacity:.5,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));disc.rotation.x=-Math.PI/2;disc.position.y=-.22;g.add(disc);g.userData={ring,disc};return g};const CURSOR=()=>{const s=new THREE.Shape();[[0,0],[0,-.62],[.16,-.48],[.27,-.72],[.37,-.67],[.26,-.44],[.46,-.44]].forEach((p,i)=>i?s.lineTo(p[0],p[1]):s.moveTo(p[0],p[1]));s.closePath();return EL(new THREE.ExtrudeGeometry(s,{depth:.05,bevelEnabled:true,bevelThickness:.02,bevelSize:.02,bevelSegments:2}),M3.glossy('#ffffff',{roughness:.2}))};const RIPPLE=()=>EL(new THREE.RingGeometry(.16,.22,48),M3.glow(A,{transparent:true,opacity:0,depthWrite:false,side:THREE.DoubleSide}));const INIT=(scene,env)=>{FT=env.fonts.mont;A=env.params.color||LM0;MT=MATS();M3.studio(scene,{intensity:1.05,rim:M.mix(A,'#ffffff',.4)});return env.height>env.width};",Fc=(t,e,c,o,n)=>({id:t,name:e,category:"Clipoox 3D",pack:gi.id,kind:"three",duration:c,params:{...o,color:"#8afb00",bg:!0},code:$r+`
13026
- `+n}),Xr=[Fc("c3d-monitor-pedestal","Màn hình trên bệ sáng 3D",6,{title:"Mọi kênh bán hàng, một màn hình"},`// Monitor on a glowing round pedestal; UI cards fly out of the screen and stack around it; headline above.
13025
+ }`)],bi=Object.freeze({id:"clipoox3d",name:"Clipoox 3D",tag:"Cảnh 3D SaaS kiểu đất sét bóng: màn hình, điện thoại, bảng số liệu, logo Clipoox"}),Fr=gi+"const LM0='#8afb00',BK='#0d0d0d',WH='#f4f6f0';let A=LM0,MT=null;const TONE={graphite:['#262a21','#0a0b09'],moss:['#1d2a10','#060905'],haze:['#2b3125','#0b0d0a']};const CBG=(scene,env,tone,gl)=>BGP(scene,env,{top:TONE[tone][0],bot:TONE[tone][1],glows:(gl||[[.5,.45,.55,.18]]).map(v=>[v[0],v[1],v[2],A,v[3]]),vig:.5});const MATS=()=>({dark:M3.glossy('#23271f',{roughness:.32}),light:M3.glossy('#eef1ea',{roughness:.28}),lime:M3.glossy(A,{roughness:.22}),silver:M3.metal('#c9cdc4',{roughness:.26}),glass:M3.glass('#e9ffd0',{opacity:.3}),ink:M3.glossy(BK,{roughness:.3}),glow:M3.glow(A)});const FLAME=()=>{const P=(x,y)=>[(x-256)/318,(251-y)/318],s=new THREE.Shape(),o=P(256,410);s.moveTo(o[0],o[1]);const B=(a,b,c,d,e,f)=>{const p1=P(a,b),p2=P(c,d),p3=P(e,f);s.bezierCurveTo(p1[0],p1[1],p2[0],p2[1],p3[0],p3[1])};B(170,410,113,346,118,270);B(121,218,148,180,186,146);B(184,168,190,186,204,198);B(214,150,238,114,272,92);B(280,128,302,150,336,172);B(374,198,396,238,396,280);B(396,353,334,410,256,410);const h=new THREE.Path(),c=P(258,290);h.absarc(c[0],c[1],60/318,0,Math.PI*2,true);s.holes.push(h);return s};const APPT=s=>{const g=new THREE.Group();g.add(EL(M3.roundedBox(s,s,s*.24,s*.23),MT.lime));const fg=new THREE.ExtrudeGeometry(FLAME(),{depth:.14,bevelEnabled:true,bevelThickness:.03,bevelSize:.02,bevelSegments:2,curveSegments:12});fg.center();const f=EL(fg,MT.ink);f.scale.setScalar(s*.6);f.position.z=s*.12+.02;g.add(f);return g};const UI=(kind,w,h,o)=>{o=o||{};return M3.paint(w,h,(x,W,H)=>{const u=Math.min(W,H*2.4)/400,lt=!!o.light,bg=lt?'#f6f7f2':'#171a16',ln=lt?'rgba(0,0,0,.10)':'rgba(255,255,255,.12)',ln2=lt?'rgba(0,0,0,.2)':'rgba(255,255,255,.3)',ink=lt?'#15171a':'#eef2ea',a=A;const RR=(X,Y,w2,h2,r,c)=>{x.fillStyle=c;x.beginPath();x.roundRect(X,Y,Math.max(1,w2),Math.max(1,h2),Math.max(0,Math.min(r,h2/2,w2/2)));x.fill()};RR(0,0,W,H,18*u,bg);const bar=o.bar!==false;if(bar){[0,1,2].forEach(i=>{x.fillStyle=i?ln2:a;x.beginPath();x.arc(22*u+i*16*u,20*u,5*u,0,M.TAU);x.fill()});RR(80*u,16*u,W*.35,8*u,4*u,ln)}const L=18*u,R=W-18*u,T=bar?40*u:16*u,B=H-16*u,cw=R-L,ch=B-T;const BARS=(X,Y,w2,h2,v)=>v.forEach((k,i)=>{const bw=w2/v.length*.62,bx=X+i*w2/v.length+(w2/v.length-bw)/2;RR(bx,Y+h2*(1-k),bw,h2*k,5*u,i===v.length-1?a:ln2)});const LINE=(X,Y,w2,h2,v)=>{x.beginPath();v.forEach((k,i)=>{const px=X+i*w2/(v.length-1),py=Y+h2*(1-k);i?x.lineTo(px,py):x.moveTo(px,py)});x.strokeStyle=a;x.lineWidth=5*u;x.lineJoin='round';x.lineCap='round';x.stroke();x.lineTo(X+w2,Y+h2);x.lineTo(X,Y+h2);x.closePath();const g=x.createLinearGradient(0,Y,0,Y+h2);g.addColorStop(0,M.rgba(a,.35));g.addColorStop(1,M.rgba(a,0));x.fillStyle=g;x.fill()};const AV=(X,Y,r,l)=>{r=Math.max(2,r);x.fillStyle=a;x.beginPath();x.arc(X,Y,r,0,M.TAU);x.fill();x.fillStyle=BK;x.font='800 '+Math.round(r*1.1)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText(l||'C',X,Y+r*.05)};if(kind==='bars')BARS(L,T+6*u,cw,ch-6*u,[.45,.7,.55,.85,.62,1]);else if(kind==='line')LINE(L,T+8*u,cw,ch-8*u,[.3,.5,.42,.7,.6,.92]);else if(kind==='table'){const n=Math.max(2,Math.min(5,Math.floor(ch/(34*u))));for(let i=0;i<n;i++){const y=T+i*ch/n+ch/n/2;x.fillStyle=ln2;x.beginPath();x.arc(L+10*u,y,8*u,0,M.TAU);x.fill();RR(L+28*u,y-5*u,cw*.38,10*u,5*u,ln2);RR(L+28*u+cw*.45,y-5*u,cw*.2,10*u,5*u,ln);RR(R-50*u,y-8*u,50*u,16*u,8*u,i===1?a:ln)}}else if(kind==='video'){RR(L,T,cw,ch-26*u,10*u,'#0b0c0a');const cx=L+cw/2,cy=T+(ch-26*u)/2,r=Math.min(cw,ch)*.16;x.fillStyle=a;x.beginPath();x.arc(cx,cy,r,0,M.TAU);x.fill();x.fillStyle=BK;x.beginPath();x.moveTo(cx-r*.3,cy-r*.45);x.lineTo(cx+r*.5,cy);x.lineTo(cx-r*.3,cy+r*.45);x.closePath();x.fill();RR(L,B-12*u,cw,8*u,4*u,ln2);RR(L,B-12*u,cw*.42,8*u,4*u,a)}else if(kind==='profile'||kind==='chip'){const r=Math.min(ch*.4,30*u);AV(L+r+2*u,T+ch/2,r,o.letter);RR(L+r*2+16*u,T+ch/2-r*.55,cw*.45,r*.42,r*.2,ink);RR(L+r*2+16*u,T+ch/2+r*.15,cw*.3,r*.34,r*.17,ln2)}else if(kind==='donut'){const cx=W/2,cy=T+ch/2,r=Math.min(cw,ch)*.36;x.lineWidth=r*.36;x.strokeStyle=ln2;x.beginPath();x.arc(cx,cy,Math.max(1,r),0,M.TAU);x.stroke();x.strokeStyle=a;x.lineCap='round';x.beginPath();x.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*.68);x.stroke();x.fillStyle=ink;x.font='800 '+Math.round(r*.55)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText('68%',cx,cy)}else if(kind==='chat'){[[0,.62,0],[1,.5,1],[0,.4,0]].forEach((v,i)=>{const bw=cw*v[1],y=T+i*ch/3+4*u,bh=ch/3-10*u;RR(v[0]?R-bw:L,y,bw,bh,bh/2,v[2]?a:ln2)})}else if(kind==='post'){const s=ch;const g=x.createLinearGradient(L,T,L+s,T+s);g.addColorStop(0,a);g.addColorStop(1,M.mix(a,'#1a2a05',.6));RR(L,T,s,s,8*u,g);RR(L+s+14*u,T+s*.18,cw-s-14*u,s*.2,s*.1,ink);RR(L+s+14*u,T+s*.56,(cw-s-14*u)*.6,s*.18,s*.09,ln2)}else if(kind==='feed'){RR(L,T,cw*.5,22*u,11*u,a);for(let i=0;i<4;i++){const y=T+40*u+i*(ch-40*u)/4,hh=(ch-40*u)/4-14*u;RR(L,y,cw,hh,14*u,ln);RR(L+10*u,y+10*u,hh-20*u,hh-20*u,10*u,i%2?ln2:M.rgba(a,.75));RR(L+hh,y+hh*.25,cw*.45,hh*.14,hh*.07,ink);RR(L+hh,y+hh*.55,cw*.3,hh*.12,hh*.06,ln2)}}else if(kind==='glyph'){const cx=W/2,cy=H/2,s=W*.24;x.strokeStyle=a;x.fillStyle=a;x.lineWidth=W*.055;x.lineJoin='round';x.lineCap='round';x.beginPath();const g=o.g;if(g==='chat'){x.roundRect(cx-s,cy-s*.75,s*2,s*1.35,s*.4);x.moveTo(cx-s*.4,cy+s*.6);x.lineTo(cx-s*.7,cy+s);x.lineTo(cx-s*.05,cy+s*.6);x.stroke();[-.45,0,.45].forEach(d=>{x.beginPath();x.arc(cx+d*s,cy-s*.08,s*.12,0,M.TAU);x.fill()})}else if(g==='bag'){x.roundRect(cx-s*.85,cy-s*.4,s*1.7,s*1.35,s*.2);x.stroke();x.beginPath();x.arc(cx,cy-s*.4,s*.45,Math.PI,0);x.stroke()}else if(g==='globe'){x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.ellipse(cx,cy,s*.42,s,0,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s,cy);x.lineTo(cx+s,cy);x.moveTo(cx-s*.85,cy-s*.5);x.lineTo(cx+s*.85,cy-s*.5);x.moveTo(cx-s*.85,cy+s*.5);x.lineTo(cx+s*.85,cy+s*.5);x.stroke()}else if(g==='mega'){x.moveTo(cx-s*.8,cy-s*.3);x.lineTo(cx+s*.6,cy-s*.85);x.lineTo(cx+s*.6,cy+s*.85);x.lineTo(cx-s*.8,cy+s*.3);x.closePath();x.stroke();x.beginPath();x.moveTo(cx-s*.45,cy+s*.35);x.lineTo(cx-s*.3,cy+s*.95);x.stroke()}else if(g==='mail'){x.roundRect(cx-s,cy-s*.7,s*2,s*1.4,s*.15);x.moveTo(cx-s*.9,cy-s*.55);x.lineTo(cx,cy+s*.1);x.lineTo(cx+s*.9,cy-s*.55);x.stroke()}else {x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s*.3,cy-s*.45);x.lineTo(cx+s*.5,cy);x.lineTo(cx-s*.3,cy+s*.45);x.closePath();x.fill()}}else if(kind==='toolbar'){AV(L+ch*.4,T+ch/2,ch*.34,'C');for(let i=0;i<4;i++)RR(L+ch+i*cw*.13,T+ch*.32,cw*.1,ch*.36,ch*.18,i===0?a:ln2);RR(R-cw*.16,T+ch*.22,cw*.16,ch*.56,ch*.28,a)}else if(kind==='panel'){x.strokeStyle=ln;x.lineWidth=1.5*u;for(let i=1;i<6;i++){const y=T+i*ch/6;x.beginPath();x.moveTo(L,y);x.lineTo(R,y);x.stroke()}}else {const sw=cw*.16;RR(L,T,sw,ch,10*u,ln);for(let i=0;i<4;i++)RR(L+10*u,T+14*u+i*26*u,sw-20*u,10*u,5*u,i?ln2:a);const X=L+sw+12*u,cw2=R-X;for(let i=0;i<3;i++){RR(X+i*cw2/3,T,cw2/3-10*u,ch*.26,10*u,ln);RR(X+i*cw2/3+10*u,T+ch*.07,cw2/3*.4,ch*.06,4*u,ln2);RR(X+i*cw2/3+10*u,T+ch*.16,cw2/3*.55,ch*.06,4*u,i?ink:a)}BARS(X,T+ch*.34,cw2*.45,ch*.64,[.4,.62,.5,.8,.66,1]);LINE(X+cw2*.52,T+ch*.36,cw2*.48,ch*.6,[.25,.45,.35,.62,.55,.85])}})};const CARD=(w,h,kind,o)=>{o=o||{};const g=new THREE.Group(),d=o.d||.09,r=o.r||Math.min(w,h)*.14;g.add(EL(M3.roundedBox(w,h,d,r),o.light?MT.light:MT.dark));const px=Math.min(640,Math.max(220,Math.round(240*w))),f=EL(new THREE.PlaneGeometry(w-.05,h-.05),new THREE.MeshBasicMaterial({map:UI(kind,px,Math.round(px*(h-.05)/(w-.05)),o),alphaTest:.5,toneMapped:false}));f.position.z=d/2+.004;g.add(f);return g};const FLOATS=(parent,n,seed,bx)=>{const r=M.rand(seed),geos=[new THREE.TorusGeometry(.3,.12,12,32),new THREE.SphereGeometry(.24,22,14),M3.roundedBox(.36,.36,.36,.08),new THREE.CapsuleGeometry(.12,.32,4,10)],mats=[MT.lime,MT.silver,MT.dark,MT.glass,MT.lime,MT.light],out=[];for(let i=0;i<n;i++){const m=EL(geos[i%4],mats[Math.floor(r()*mats.length)]);m.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],s:.55+r()*.7,ph:r()*6.3,sp:[(r()-.5)*1.4,(r()-.5)*1.4,(r()-.5)*.8],r0:[r()*6,r()*6,r()*6]};parent.add(m);out.push(m)}return out};const FLOATU=(list,t,t0,amp)=>list.forEach((m,i)=>{const u=m.userData,b=u.b,a=amp??1,k=M.ease.outBack(M.range(t,t0+i*.04,t0+.55+i*.04));m.position.set(b[0]+Math.sin(t*.5+u.ph)*.18*a,b[1]+Math.sin(t*.8+u.ph*1.3)*.22*a,b[2]);m.rotation.set(u.r0[0]+t*u.sp[0],u.r0[1]+t*u.sp[1],u.r0[2]+t*u.sp[2]);m.scale.setScalar(Math.max(.001,u.s*k))});const BOKEH=(parent,n,seed,bx)=>{const r=M.rand(seed),out=[];for(let i=0;i<n;i++){const s=new THREE.Sprite(new THREE.SpriteMaterial({map:SOFT(),color:new THREE.Color(r()<.6?A:'#ffffff'),transparent:true,opacity:.08+r()*.2,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));const z=.4+r()*1.6;s.scale.set(z,z,1);s.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],ph:r()*6.3,o:s.material.opacity};parent.add(s);out.push(s)}return out};const BOKU=(list,t,k)=>list.forEach(s=>{const u=s.userData;s.position.set(u.b[0]+Math.sin(t*.3+u.ph)*.3,u.b[1]+Math.cos(t*.25+u.ph)*.3,u.b[2]);s.material.opacity=u.o*k});const PED=r=>{const g=new THREE.Group();g.add(EL(new THREE.CylinderGeometry(r,r*1.05,.42,56),MT.dark));const ring=EL(new THREE.TorusGeometry(r*1.005,.035,8,80),MT.glow);ring.rotation.x=Math.PI/2;ring.position.y=.21;g.add(ring);const disc=EL(new THREE.PlaneGeometry(r*3.4,r*3.4),new THREE.MeshBasicMaterial({map:SOFT(),color:new THREE.Color(A),transparent:true,opacity:.5,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));disc.rotation.x=-Math.PI/2;disc.position.y=-.22;g.add(disc);g.userData={ring,disc};return g};const CURSOR=()=>{const s=new THREE.Shape();[[0,0],[0,-.62],[.16,-.48],[.27,-.72],[.37,-.67],[.26,-.44],[.46,-.44]].forEach((p,i)=>i?s.lineTo(p[0],p[1]):s.moveTo(p[0],p[1]));s.closePath();return EL(new THREE.ExtrudeGeometry(s,{depth:.05,bevelEnabled:true,bevelThickness:.02,bevelSize:.02,bevelSegments:2}),M3.glossy('#ffffff',{roughness:.2}))};const RIPPLE=()=>EL(new THREE.RingGeometry(.16,.22,48),M3.glow(A,{transparent:true,opacity:0,depthWrite:false,side:THREE.DoubleSide}));const INIT=(scene,env)=>{FT=env.fonts.mont;A=env.params.color||LM0;MT=MATS();M3.studio(scene,{intensity:1.05,rim:M.mix(A,'#ffffff',.4)});return env.height>env.width};",Fc=(t,e,c,o,n)=>({id:t,name:e,category:"Clipoox 3D",pack:bi.id,kind:"three",duration:c,params:{...o,color:"#8afb00",bg:!0},code:Fr+`
13026
+ `+n}),Yr=[Fc("c3d-monitor-pedestal","Màn hình trên bệ sáng 3D",6,{title:"Mọi kênh bán hàng, một màn hình"},`// Monitor on a glowing round pedestal; UI cards fly out of the screen and stack around it; headline above.
13027
13027
  let root,mon,ped,cards=[],fl=[],bk=[],title,dist=10,port=false,spots=[],ty=2.75
13028
13028
  function setup(THREE,scene,camera,env){
13029
13029
  const p=env.params;port=INIT(scene,env)
@@ -13254,7 +13254,7 @@ function render(t,env){
13254
13254
  sparks.forEach(s=>{const d=s.userData.d,v=s.userData.v*(.4+e.outCubic(kr));s.position.set(d[0]*v,.6+d[1]*v,.2);s.material.opacity=kr>0&&kr<1?1-kr:0})
13255
13255
  const nk=e.outCubic(M.range(t,2.7,3.3)),uk=e.outCubic(M.range(t,2.9,3.5));name.material.opacity=nk;name.position.y=-.75-(1-nk)*.25;url.material.opacity=uk;url.position.y=-1.62-(1-uk)*.25
13256
13256
  M3.orbit(env.camera,M.lerp(-.12,.06,e.inOutCubic(t/D)),{radius:dist*(1.08-.08*e.outCubic(t/D)),height:dist*.04,target:[0,port?.05:.05,0]})
13257
- }`)],Za="three",ko=[{id:"3d-coin-spin",kind:Za,name:"Đồng xu 3D xoay",category:"3D",duration:4,params:{text:"C",sub:"CLIPOOX",color:"#f2c14e",speed:1.2,particles:!0},code:`let spin,coin,sparks,ground,label
13257
+ }`)],Za="three",So=[{id:"3d-coin-spin",kind:Za,name:"Đồng xu 3D xoay",category:"3D",duration:4,params:{text:"C",sub:"CLIPOOX",color:"#f2c14e",speed:1.2,particles:!0},code:`let spin,coin,sparks,ground,label
13258
13258
  function setup(THREE,scene,camera,env){
13259
13259
  const p=env.params
13260
13260
  M3.studio(scene,{intensity:1.1})
@@ -13406,15 +13406,15 @@ function render(t,env){
13406
13406
  m.position.set(l.x,l.y+y,z);m.rotation.set(rx,0,0)
13407
13407
  m.scale.set(l.k*Math.max(.001,sc),l.k*Math.max(.001,sc),l.k*Math.max(.001,sc*sz))
13408
13408
  })
13409
- }`}];ko.push(...Vr,...Xr),Object.freeze([{...di,shelf:!1},{...gi,shelf:!0}]),ko[0].code;const Fr=Object.freeze([{id:"gold-pin",vi:"Ghim vàng",en:"Gold pin",glyph:!0},{id:"gold-hex",vi:"Lục giác vàng",en:"Gold hexagon",glyph:!0},{id:"badge",vi:"Ô vuông viền vàng",en:"Gold-rim badge",glyph:!0},{id:"round",vi:"Ghim tròn màu",en:"Round pin",glyph:!0},{id:"pill",vi:"Nhãn vàng",en:"Gold label",glyph:!1},{id:"tag",vi:"Thẻ tên + đường dẫn",en:"Name tag + leader",glyph:!1},{id:"sign",vi:"Biển bán / cho thuê",en:"Sale sign",glyph:!1},{id:"beacon",vi:"Cột sáng định vị",en:"Light beacon",glyph:!1}]);Object.freeze(Fr.map(t=>t.id));const dc=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,Yr={bridge:["M2 18h20","M5 18V7M19 18V7","M5 7c3 6 11 6 14 0","M9 18v-6M12 18v-5M15 18v-6","M2 21c2.5-1.2 5-1.2 7.5 0s5 1.2 7.5 0 3.5-.8 5-.4"],beach:["M12 4a8 8 0 0 1 8 8H4a8 8 0 0 1 8-8Z","M12 4v-1.5","M12 12l-2.5 8","M2 21c2.5-1.2 5-1.2 7.5 0s5 1.2 7.5 0 3.5-.8 5-.4"],pagoda:["M3 9l9-4 9 4","M5 9.5v2.5h14V9.5","M2 13.5l10-2.5 10 2.5","M6 14v7h12v-7","M10 21v-4h4v4","M12 5V2"],church:["M12 2v5M10 4h4","M6 11l6-4 6 4v10H6Z","M10 21v-5h4v5","M3 21h18"],stadium:["M3 9c0-2 4-3.5 9-3.5S21 7 21 9v6c0 2-4 3.5-9 3.5S3 17 3 15Z","M3 9c0 2 4 3.5 9 3.5S21 11 21 9","M12 12.5v6"],golf:["M8 21V3l9 4-9 4","M4 21c2-1.5 6-1.5 8 0",dc(17,18.5,1.6)],factory:["M3 21V10l5 3v-3l5 3v-3l5 3V4h3v17Z","M2 21h20","M7 17h2M12 17h2M17 17h1.5"],building:["M5 21V3h9v18","M14 8h5v13","M3 21h18","M8 7h3M8 11h3M8 15h3","M16.5 12h.01M16.5 16h.01"],villa:["M2 11l10-7 10 7","M4.5 10v11h15V10","M10 21v-5h4v5","M7 13h2M15 13h2"],hospital:["M4 21V6h16v15","M2 21h20","M12 9v6M9 12h6","M9 21v-3h6v3"],kindergarten:["M4 21V11l8-6 8 6v10","M2 21h20","M9 21v-4h6v4",dc(12,11.5,1.8)],market:["M3 9l1.5-5h15L21 9","M3 9h18v2.5a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0Z","M5 14v7h14v-7","M9 21v-4h6v4"],government:["M3 9l9-5 9 5","M4 9h16","M6 9v9M10 9v9M14 9v9M18 9v9","M3 21h18M4 18h16"],metro:["M7 3h10a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3Z","M4 11h16","M8 14.5h.01M16 14.5h.01","M8 18l-2 3M16 18l2 3","M10 7h4"],anchor:[dc(12,5,2.2),"M12 7.2V21","M5 13a7 7 0 0 0 14 0","M3 13h4M17 13h4"],river:["M2 8c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.2 5-.6","M2 13c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.2 5-.6","M2 18c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.2 5-.6"],cinema:["M3 5h18v14H3Z","M7 5v14M17 5v14","M3 9.5h4M3 14.5h4M17 9.5h4M17 14.5h4"],playground:["M5 21V5","M5 5h4l10 15","M3 21h18","M5 12h6"],sale:["M6 21V4","M4 21h4","M6 6h14v8H6Z","M9.5 10h7"],highway:["M7 3 3 21M17 3l4 18","M12 4v2M12 10v3M12 17v3","M2 9h3M19 9h3"],interchange:[dc(12,12,5),"M12 2v5M12 17v5M2 12h5M17 12h5"],park:["M8 21v-4","M8 3a4.5 4.5 0 0 1 4.3 5.8A4 4 0 0 1 9 17H7a4 4 0 0 1-3.3-8.2A4.5 4.5 0 0 1 8 3Z","M17 21v-3","M17 9l3.5 5h-2l2 4h-7l2-4h-2Z","M3 21h18"],view:["M2 18l6-8 4 5 3-3 7 6",dc(17,6,2.5)],skytrain:["M4 4h16v8H4Z","M8 12v9M16 12v9","M2 21h20","M7.5 8h.01M12 8h.01M16.5 8h.01"],hsr:["M3 15c0-4.5 4.5-8 11-8h3l4 4v4Z","M3 15h18","M6 19h12","M8 11h5"],tunnel:["M3 21V12a9 9 0 0 1 18 0v9","M8 21v-7a4 4 0 0 1 8 0v7","M12 17v4"],overpass:["M2 15h20","M2 9.5c4 0 6-3 10-3s6 3 10 3","M7 15v6M17 15v6","M2 21h20"],toll:["M3 21V9h7v12","M3 9l3.5-5L10 9","M10 13h11","M14 13v8M18 13v8"],ringroad:[dc(12,12,8.5),dc(12,12,3.5),"M12 3.5v2M12 18.5v2M3.5 12h2M18.5 12h2"],container:["M2 14h20l-2 6H4Z","M4.5 14V9h5v5M9.5 14V6.5h5V14M14.5 14v-4h5v4"],logistics:["M3 21V9l9-5 9 5v12","M7 21v-8h10v8","M7 16.5h10"],solar:["M3 17l3-9h12l3 9Z","M8.5 8l-1 9M12 8v9M15.5 8l1 9","M4.6 12.5h14.8","M12 17v4M8 21h8"],lakeview:["M3 15c0-3 4-5 9-5s9 2 9 5-4 5-9 5-9-2-9-5Z","M7.5 15c1.5 1 3 1 4.5 0s3-1 4.5 0"],theater:["M4 4h16v7a8 8 0 0 1-16 0Z","M8.5 9h.01M15.5 9h.01","M9 13.5c1.6 1.4 4.4 1.4 6 0"],monument:["M10 21V8l2-5 2 5v13","M6 21h12","M8 17.5h8"],ambulance:["M2 17V7h11v10","M13 10h4l4 4v3h-8","M5.5 12h4M7.5 10v4",dc(6,18,1.8),dc(17,18,1.8)],tennis:[dc(12,12,9),"M5.6 5.6c3.5 3.5 3.5 9.3 0 12.8","M18.4 5.6c-3.5 3.5-3.5 9.3 0 12.8"],island:["M2 20c4-2.5 16-2.5 20 0","M12 17.5c0-4 .5-7 1-9.5","M13 8c-2-2-5-2-7 0 2 0 4 .5 5 2","M13 8c1-2 4-3 6-2-2 .5-4 2-4 3","M13 8c-.5-2-.2-4 1.5-5.5"],skyline:["M3 21V10h4v11M9 21V4h6v17M17 21v-8h4v8","M2 21h20","M11.5 8h1M11.5 12h1M11.5 16h1"],heliport:[dc(12,12,9),"M8.5 7v10M15.5 7v10M8.5 12h7"]},_r={school:"Trường học",university:"Đại học",kindergarten:"Mầm non",hospital:"Bệnh viện",clinic:"Phòng khám",pharmacy:"Nhà thuốc",medical:"Y tế",mall:"Trung tâm thương mại",supermarket:"Siêu thị",market:"Chợ",store:"Cửa hàng",restaurant:"Nhà hàng",cafe:"Cà phê",hotel:"Khách sạn",resort:"Resort",pool:"Hồ bơi",gym:"Phòng gym",spa:"Spa",golf:"Sân golf",stadium:"Sân vận động",cinema:"Rạp chiếu phim",playground:"Khu vui chơi",camping:"Cắm trại",airport:"Sân bay",port:"Cảng biển",anchor:"Bến tàu",metro:"Metro",train:"Ga tàu",bus:"Bến xe buýt",bridge:"Cầu",highway:"Cao tốc",interchange:"Nút giao",road:"Đường lớn",parking:"Bãi đỗ xe",gas:"Cây xăng",ev:"Trạm sạc xe điện",bicycle:"Đường xe đạp",beach:"Bãi biển",park:"Công viên",tree:"Cây xanh",river:"Sông",lake:"Hồ",mountain:"Núi",view:"Cảnh quan",sun:"Bình minh",government:"Cơ quan hành chính",bank:"Ngân hàng",atm:"ATM",police:"Công an",pagoda:"Chùa",church:"Nhà thờ",wifi:"Wifi",apartment:"Chung cư",villa:"Biệt thự",home:"Nhà phố",factory:"Khu công nghiệp",office:"Văn phòng",land:"Lô đất",sale:"Đang bán",key:"Bàn giao",location:"Vị trí",star:"Điểm nổi bật",skytrain:"Đường sắt trên cao",hsr:"Đường sắt tốc độ cao",tunnel:"Hầm chui",overpass:"Cầu vượt",toll:"Trạm thu phí",ringroad:"Đường vành đai",ferry:"Bến phà",container:"Cảng container",logistics:"Trung tâm logistics",heliport:"Sân đỗ trực thăng",bikeshare:"Xe đạp công cộng",brt:"Buýt nhanh BRT",power:"Trạm điện",solar:"Điện mặt trời",water:"Nhà máy nước",postoffice:"Bưu điện",fire:"Phòng cháy chữa cháy",security:"An ninh 24/7",datacenter:"Trung tâm dữ liệu",coworking:"Văn phòng chia sẻ",library:"Thư viện",museum:"Bảo tàng",theater:"Nhà hát",monument:"Quảng trường",walking:"Phố đi bộ",nightmarket:"Chợ đêm",convenience:"Cửa hàng tiện lợi",sports:"Khu thể thao",tennis:"Sân tennis",ambulance:"Cấp cứu",dental:"Nha khoa",vet:"Thú y",island:"Đảo",lakeview:"Hồ cảnh quan",cbd:"Trung tâm tài chính",embassy:"Lãnh sự quán"},ui=Object.freeze(Object.fromEntries(Object.entries({school:["edu","School","school","truong hoc,truong tieu hoc,tieu hoc,thcs,thpt,truong quoc te,truong,school"],university:["edu","University","graduation","dai hoc,truong dai hoc,cao dang,truong cao dang,hoc vien,university,college,campus"],kindergarten:["edu","Kindergarten","kindergarten","mam non,mau giao,nha tre,kindergarten,preschool"],hospital:["health","Hospital","hospital","benh vien,hospital"],clinic:["health","Clinic","stethoscope","phong kham,bac si,nha khoa,clinic,doctor,dental"],pharmacy:["health","Pharmacy","pill","nha thuoc,hieu thuoc,pharmacy,drugstore"],medical:["health","Medical","medical","y te,tram y te,medical,health"],mall:["shop","Shopping mall","bag","trung tam thuong mai,tttm,mall,shopping,vincom,aeon,lotte"],supermarket:["shop","Supermarket","cart","sieu thi,supermarket,grocery,bach hoa"],market:["shop","Market","market","cho,market"],store:["shop","Shop","store","cua hang,shop,store"],restaurant:["shop","Restaurant","cutlery","nha hang,an uong,restaurant,food"],cafe:["shop","Café","coffee","ca phe,cafe,coffee"],hotel:["stay","Hotel","bed","khach san,hotel"],resort:["stay","Resort","palm","resort,nghi duong"],pool:["stay","Swimming pool","pool","ho boi,be boi,pool,swim"],gym:["stay","Gym","dumbbell","gym,the hinh,fitness"],spa:["stay","Spa","lotus","spa,wellness"],golf:["stay","Golf course","golf","san golf,golf"],stadium:["stay","Stadium","stadium","san van dong,nha thi dau,stadium,arena"],cinema:["stay","Cinema","cinema","rap chieu phim,rap phim,cinema,movie"],playground:["stay","Playground","playground","khu vui choi,san choi,playground"],camping:["stay","Camping","tent","cam trai,glamping,camping"],airport:["transport","Airport","plane","san bay,airport"],port:["transport","Seaport","ship","cang bien,cang,port,harbour,harbor"],anchor:["transport","Pier","anchor","ben tau,ben du thuyen,du thuyen,pier,marina"],metro:["transport","Metro","metro","metro,tau dien,subway"],train:["transport","Railway station","train","ga tau,duong sat,nha ga,train,railway"],bus:["transport","Bus station","bus","ben xe,xe buyt,bus"],bridge:["transport","Bridge","bridge","cau,bridge"],highway:["transport","Expressway","highway","cao toc,quoc lo,expressway,highway"],interchange:["transport","Interchange","interchange","nut giao,vong xoay,interchange,roundabout"],road:["transport","Main road","road","duong lon,dai lo,road,avenue,boulevard"],parking:["transport","Parking","parking","bai do xe,bai xe,parking"],gas:["transport","Petrol station","fuel","cay xang,tram xang,xang dau,petrol,gas station"],ev:["transport","EV charging","ev-charge","tram sac,xe dien,ev charging,vinfast"],bicycle:["transport","Bike lane","bicycle","xe dap,bike"],beach:["nature","Beach","beach","bai bien,bien,vinh,beach,sea,bay"],park:["nature","Park","park","cong vien,park,garden"],tree:["nature","Green space","tree","cay xanh,mang xanh,green"],river:["nature","River","river","song,kenh,river,canal"],lake:["nature","Lake","drop","ho,lake"],mountain:["nature","Mountain","mountain","nui,doi,mountain,hill"],view:["nature","Scenic view","view","canh quan,tam nhin,view"],sun:["nature","Sunrise","sun","binh minh,hoang hon,sunrise,sunset"],government:["civic","Government office","government","ubnd,uy ban,co quan,hanh chinh,bao tang,government,city hall,museum"],bank:["civic","Bank","bank","ngan hang,bank"],atm:["civic","ATM","card","atm"],police:["civic","Police","shield","cong an,an ninh,police,security"],pagoda:["civic","Pagoda","pagoda","chua,den,pagoda,temple"],church:["civic","Church","church","nha tho,church,cathedral"],wifi:["civic","Wi-Fi","wifi","wifi,internet"],apartment:["estate","Apartments","building","chung cu,can ho,toa nha,apartment,condo,tower"],villa:["estate","Villa","villa","biet thu,villa"],home:["estate","Townhouse","home","nha pho,shophouse,townhouse,house"],factory:["estate","Industrial park","factory","khu cong nghiep,kcn,nha may,factory,industrial"],office:["estate","Office","briefcase","van phong,office"],land:["estate","Land plot","area","lo dat,dat nen,land,plot"],sale:["estate","For sale","sale","dang ban,cho thue,for sale,rent"],key:["estate","Handover","key","ban giao,chia khoa,handover,key"],location:["estate","Location","location","vi tri,dia diem,location"],star:["estate","Highlight","star","noi bat,diem nhan,highlight,landmark"],skytrain:["transport","Elevated rail","skytrain","duong sat tren cao,metro tren cao,skytrain,elevated rail"],hsr:["transport","High-speed rail","hsr","duong sat toc do cao,toc do cao,high speed rail,bullet train"],tunnel:["transport","Tunnel","tunnel","ham chui,ham,tunnel,underpass"],overpass:["transport","Flyover","overpass","cau vuot,flyover,overpass"],toll:["transport","Toll plaza","toll","tram thu phi,thu phi,toll"],ringroad:["transport","Ring road","ringroad","vanh dai,duong vanh dai,ring road,beltway"],ferry:["transport","Ferry","ship","ben pha,pha,ferry"],container:["transport","Container port","container","cang container,container,cang cont"],logistics:["transport","Logistics hub","logistics","trung tam logistics,logistics,kho van,kho bai,warehouse,icd"],heliport:["transport","Heliport","heliport","truc thang,heliport,helipad"],bikeshare:["transport","Bike share","bicycle","xe dap cong cong,bike share"],brt:["transport","BRT bus","bus","brt,buyt nhanh"],power:["civic","Power station","bolt","tram dien,dien luc,tram bien ap,power,substation"],solar:["civic","Solar farm","solar","dien mat troi,solar"],water:["civic","Water works","drop","nha may nuoc,cap nuoc,water supply"],postoffice:["civic","Post office","mail","buu dien,post office"],fire:["civic","Fire station","fire","phong chay chua chay,pccc,cuu hoa,fire station"],security:["civic","24/7 security","shield","an ninh 24/7,an ninh,bao ve,security"],datacenter:["civic","Data centre","server","trung tam du lieu,data center,data centre"],coworking:["civic","Coworking","laptop","van phong chia se,coworking"],embassy:["civic","Consulate","flag","lanh su quan,dai su quan,embassy,consulate"],library:["stay","Library","book-open","thu vien,library"],museum:["stay","Museum","government","bao tang,museum"],theater:["stay","Theatre","theater","nha hat,theatre,theater,opera"],monument:["stay","Square","monument","quang truong,tuong dai,square,plaza,monument"],walking:["stay","Walking street","running","pho di bo,walking street"],sports:["stay","Sports complex","running","khu the thao,cong vien the thao,sports complex,sport"],tennis:["stay","Tennis court","tennis","san tennis,tennis,pickleball"],nightmarket:["shop","Night market","market","cho dem,night market"],convenience:["shop","Convenience store","store","cua hang tien loi,circle k,ministop,7-eleven,convenience store"],ambulance:["health","Emergency","ambulance","cap cuu,ambulance,emergency"],dental:["health","Dental clinic","tooth","nha khoa,dental,dentist"],vet:["health","Vet","paw","thu y,vet,pet"],island:["nature","Island","island","dao,hon,island"],lakeview:["nature","Landscape lake","lakeview","ho canh quan,ho dieu hoa,lake view"],cbd:["estate","City centre","skyline","trung tam tai chinh,trung tam thanh pho,cbd,downtown,trung tam"]}).map(([t,[e,c,o,n]])=>{const s=Yr[o]??ja[o]?.d;if(!s)throw new Error(`map glyph ${t}: no drawing ${o}`);return[t,Object.freeze({id:t,group:e,vi:_r[t],en:c,d:s,words:n})]})));Object.freeze(Object.keys(ui));function Qr(t,e,c,o,n,s,x,d){const g=d||'"Be Vietnam Pro", system-ui, sans-serif',C=[[0,"#fff4c8"],[.32,"#f4cf68"],[.66,"#c88f2a"],[1,"#7f5210"]];function P(a,u,M,L=C){const i=a.createLinearGradient(0,u,0,M);for(const[$,z]of L)i.addColorStop($,z);return i}const h=(a,u)=>{const M=parseInt(a.slice(1),16),L=i=>Math.max(0,Math.min(255,Math.round(u<0?(M>>i&255)*(1+u):(M>>i&255)+(255-(M>>i&255))*u)));return`rgb(${L(16)},${L(8)},${L(0)})`};function w(a,u,M,L,i,$,z=2.1){const U=x(u)||x("location")||{d:[]};a.save(),a.translate(M-i/2,L-i/2),a.scale(i/24,i/24),a.strokeStyle=$,a.lineWidth=z,a.lineCap="round",a.lineJoin="round",a.fillStyle="transparent";for(const at of U.d)a.stroke(new Path2D(at));a.restore()}function r(a,u,M,L,i,{color:$="#ffffff",weight:z=800,align:U="center",base:at="alphabetic",shadow:ft=!0,spacing:gt=0}={}){a.save(),a.font=`${z} ${i}px ${g}`,a.textAlign=U,a.textBaseline=at,a.fillStyle=$,gt&&(a.letterSpacing=`${gt}px`),ft&&(a.shadowColor="rgba(0,0,0,.85)",a.shadowBlur=i*.45,a.shadowOffsetY=i*.08),a.fillText(u,M,L),a.restore()}const f=(a,u,M,L=800,i=0)=>{a.save(),a.font=`${L} ${M}px ${g}`,i&&(a.letterSpacing=`${i}px`);const $=a.measureText(u).width;return a.restore(),$};function R(a,u,M,L,i,$){a.beginPath(),a.roundRect(u,M,L,i,$)}function X(a,[u,M],L,i){a.save(),a.globalAlpha=.35*i,a.fillStyle="#000",a.filter=`blur(${3*L}px)`,a.beginPath(),a.ellipse(u,M,14*L,5*L,0,0,Math.PI*2),a.fill(),a.restore()}function j(a,u,M,L){a.save(),a.globalAlpha=.32,a.fillStyle="#ffffff",a.beginPath(),a.ellipse(u-L*.32,M-L*.48,L*.48,L*.22,-.45,0,Math.PI*2),a.fill(),a.restore()}function m(a,u,M,L,i){let $=L-8*i;u.sub&&(r(a,u.sub,M,$,11*i,{weight:600,color:"#f1d58a"}),$-=14*i),u.label&&r(a,u.label,M,$,16*i)}const V=(a,u,M,L,i)=>{const $=Math.acos(Math.min(.99,L/i));a.beginPath(),a.moveTo(u,M+i),a.lineTo(u+L*Math.sin($),M+L*Math.cos($)),a.arc(u,M,L,Math.PI/2-$,Math.PI/2+$,!0),a.closePath()},F=(a,u,M,L)=>{a.beginPath();for(let i=0;i<6;i++){const $=-Math.PI/2+i*Math.PI/3;a[i?"lineTo":"moveTo"](u+L*Math.cos($),M+L*Math.sin($))}a.closePath()};function E(a,u,M,L,i,$){const[z,U]=L,at=u.color;a.save();for(const l of M.rings){if(l.a<=0)continue;const p=$?$(.15+.85*l.r):null;if(a.save(),a.globalAlpha=l.a*.85*M.alpha,a.strokeStyle=at,a.lineWidth=2.4*i,a.shadowColor=at,a.shadowBlur=8*i,a.beginPath(),p&&p.length>2){a.moveTo(p[0][0],p[0][1]);for(const y of p.slice(1))a.lineTo(y[0],y[1]);a.closePath()}else a.ellipse(z,U,(10+60*l.r)*i,(4+22*l.r)*i,0,0,Math.PI*2);a.stroke(),a.restore()}const ft=(1-M.drop)*-46*i,gt=.55+.45*Math.min(1.08,M.drop);a.globalAlpha=M.alpha;const wt=l=>{a.save(),a.translate(z,U),a.scale(gt,gt),a.translate(-z,-U+ft/gt),l(),a.restore()};switch(u.look){case"gold-pin":{const l=24*i,p=54*i,y=z,k=U-p;X(a,L,i,M.drop),wt(()=>{a.save(),a.translate(2.4*i,3*i),V(a,y,k,l,p),a.fillStyle="#5c3a0b",a.fill(),a.restore(),V(a,y,k,l,p),a.fillStyle=P(a,k-l,U),a.fill(),a.lineWidth=1.2*i,a.strokeStyle="rgba(255,246,210,.7)",a.stroke();const I=a.createRadialGradient(y,k-l*.2,0,y,k,l*.66);I.addColorStop(0,"#3a280b"),I.addColorStop(1,"#130c03"),a.beginPath(),a.arc(y,k,l*.66,0,Math.PI*2),a.fillStyle=I,a.fill(),a.lineWidth=1.4*i,a.strokeStyle="#f6d98a",a.stroke(),w(a,u.icon,y,k,l*.82,P(a,k-l*.5,k+l*.5,[[0,"#fff1bd"],[1,"#e2ad3f"]]),2.3),j(a,y,k,l)}),a.globalAlpha=M.alpha*M.label,m(a,u,z,U-p-l+ft,i);break}case"gold-hex":{const l=27*i,p=z,y=U-50*i;X(a,L,i,M.drop);const k=()=>{F(a,p,y,l),a.moveTo(p-8*i,y+l*.9),a.lineTo(p,U-6*i),a.lineTo(p+8*i,y+l*.9)};wt(()=>{a.save(),a.translate(2.4*i,3*i),k(),a.fillStyle="#5c3a0b",a.fill(),a.restore(),k(),a.fillStyle=P(a,y-l,y+l),a.fill(),a.lineWidth=1.2*i,a.strokeStyle="rgba(255,246,210,.75)",a.stroke(),F(a,p,y,l*.8),a.lineWidth=1.2*i,a.strokeStyle="rgba(110,70,10,.55)",a.stroke(),w(a,u.icon,p,y,l*.95,"#2a1b04",2.4),j(a,p,y,l)}),a.globalAlpha=M.alpha*M.label,m(a,u,z,y-l+ft,i);break}case"badge":{const l=46*i,p=z,y=U-46*i;wt(()=>{const k=()=>{R(a,p-l/2,y-l/2,l,l,7*i),a.moveTo(p-7*i,y+l/2-1),a.lineTo(p,y+l/2+9*i),a.lineTo(p+7*i,y+l/2-1)};a.save(),a.shadowColor="rgba(0,0,0,.55)",a.shadowBlur=10*i,a.shadowOffsetY=4*i,k();const I=a.createLinearGradient(0,y-l/2,0,y+l/2);I.addColorStop(0,"#262d36"),I.addColorStop(1,"#0a0d11"),a.fillStyle=I,a.fill(),a.restore(),k(),a.lineWidth=2.4*i,a.strokeStyle=P(a,y-l/2,y+l/2+9*i),a.stroke(),R(a,p-l/2+4*i,y-l/2+4*i,l-8*i,l-8*i,4*i),a.lineWidth=.8*i,a.strokeStyle="rgba(233,185,73,.35)",a.stroke(),w(a,u.icon,p,y,l*.56,P(a,y-l*.3,y+l*.3,[[0,"#ffe9a3"],[1,"#d9a03a"]]),2.2)}),a.globalAlpha=M.alpha,a.beginPath(),a.arc(z,U,3.2*i,0,Math.PI*2),a.fillStyle=at,a.fill(),a.globalAlpha=M.alpha*M.label,m(a,u,z,y-l/2+ft,i);break}case"round":{const l=21*i,p=z,y=U-46*i;a.save(),a.strokeStyle="rgba(255,255,255,.85)",a.lineWidth=2*i,a.beginPath(),a.moveTo(z,U),a.lineTo(z,U+ft-46*i+l),a.stroke(),a.beginPath(),a.arc(z,U,3.5*i,0,Math.PI*2),a.fillStyle="#fff",a.fill(),a.restore(),wt(()=>{a.save(),a.shadowColor="rgba(0,0,0,.5)",a.shadowBlur=10*i,a.shadowOffsetY=4*i;const k=a.createRadialGradient(p-l*.3,y-l*.35,l*.1,p,y,l);k.addColorStop(0,h(at,.45)),k.addColorStop(.7,at),k.addColorStop(1,h(at,-.35)),a.beginPath(),a.arc(p,y,l,0,Math.PI*2),a.fillStyle=k,a.fill(),a.restore(),a.beginPath(),a.arc(p,y,l,0,Math.PI*2),a.lineWidth=2.8*i,a.strokeStyle="#ffffff",a.stroke(),w(a,u.icon,p,y,l*1.05,"#ffffff",2.3),j(a,p,y,l)}),a.globalAlpha=M.alpha*M.label,m(a,u,z,y-l+ft,i);break}case"pill":{const l=u.label||x(u.icon)?.vi||"",p=15*i,y=f(a,l,p)+30*i,k=30*i,I=U-36*i;wt(()=>{const tt=()=>{R(a,z-y/2,I-k/2,y,k,k/2),a.moveTo(z-6*i,I+k/2-1),a.lineTo(z,I+k/2+8*i),a.lineTo(z+6*i,I+k/2-1)};a.save(),a.translate(1.6*i,2.2*i),tt(),a.fillStyle="#5c3a0b",a.fill(),a.restore(),a.save(),a.shadowColor="rgba(0,0,0,.45)",a.shadowBlur=8*i,tt(),a.fillStyle=P(a,I-k/2,I+k/2),a.fill(),a.restore(),tt(),a.lineWidth=1*i,a.strokeStyle="rgba(255,246,210,.8)",a.stroke(),r(a,l,z,I+p*.36,p,{color:"#2a1b04",shadow:!1}),a.save(),a.globalAlpha=.3,a.fillStyle="#fff",R(a,z-y/2+6*i,I-k/2+3*i,y-12*i,k*.32,k*.16),a.fill(),a.restore()}),u.sub&&(a.globalAlpha=M.alpha*M.label,r(a,u.sub,z,I-k/2-6*i+ft,11*i,{weight:600}));break}case"tag":{const l=(u.label||x(u.icon)?.vi||"").toUpperCase(),p=(u.sub||"").toUpperCase(),y=18*i,k=10*i,I=12*i,tt=Math.max(f(a,l,y),p?f(a,p,k,600,2.2*i):0)+I*2,A=(p?50:36)*i,b=64*i*M.drop,O=z-I-4*i,Q=U-b-A;a.save(),a.strokeStyle=at,a.lineWidth=2*i,a.shadowColor=at,a.shadowBlur=6*i,a.beginPath(),a.moveTo(z,U),a.lineTo(z,U-b),a.stroke(),a.beginPath(),a.arc(z,U,5*i,0,Math.PI*2),a.lineWidth=2.2*i,a.stroke(),a.beginPath(),a.arc(z,U,2.2*i,0,Math.PI*2),a.fillStyle="#fff",a.fill(),a.restore(),M.label>0&&(a.save(),a.globalAlpha=M.alpha*M.label,a.save(),a.shadowColor="rgba(0,0,0,.6)",a.shadowBlur=12*i,R(a,O,Q,tt*(.4+.6*M.label),A,3*i),a.fillStyle="rgba(10,12,16,.9)",a.fill(),a.restore(),a.fillStyle=P(a,Q+A-3*i,Q+A),a.fillRect(O,Q+A-3*i,tt*(.4+.6*M.label),3*i),R(a,O,Q,tt*(.4+.6*M.label),A,3*i),a.lineWidth=.8*i,a.strokeStyle="rgba(233,185,73,.45)",a.stroke(),p&&r(a,p,O+I,Q+16*i,k,{weight:600,color:"#e9b949",align:"left",shadow:!1,spacing:2.2*i}),r(a,l,O+I,Q+A-12*i,y,{align:"left",shadow:!1}),a.restore());break}case"sign":{const l=(u.label||"BÁN NHÀ").toUpperCase(),p=20*i,y=Math.max(f(a,l,p,900),u.sub?f(a,u.sub,11*i,600):0)+34*i,k=96*i*M.drop,I=U-k,tt=z-4*i,A=36*i;if(a.save(),a.strokeStyle="#f2f2f2",a.lineWidth=4.5*i,a.lineCap="round",a.shadowColor="rgba(0,0,0,.5)",a.shadowBlur=6*i,a.beginPath(),a.moveTo(z,U),a.lineTo(z,I),a.lineTo(z+y*(.15+.85*M.label),I),a.stroke(),a.restore(),M.label>0){a.save(),a.globalAlpha=M.alpha*M.label;const b=I+8*i;a.save(),a.shadowColor="rgba(0,0,0,.55)",a.shadowBlur=10*i,a.shadowOffsetY=3*i,a.fillStyle=at,a.fillRect(tt+8*i,b,y-8*i,A),a.restore();const O=a.createLinearGradient(0,b,0,b+A);O.addColorStop(0,"rgba(255,255,255,.22)"),O.addColorStop(.5,"rgba(255,255,255,0)"),a.fillStyle=O,a.fillRect(tt+8*i,b,y-8*i,A),a.strokeStyle="#ffffff",a.lineWidth=2*i,a.strokeRect(tt+11*i,b+3*i,y-14*i,A-6*i),r(a,l,tt+4*i+y/2,b+A/2+p*.36,p,{weight:900,shadow:!1}),u.sub&&(a.fillStyle="#ffffff",a.fillRect(tt+8*i,b+A,y-8*i,20*i),r(a,u.sub,tt+4*i+y/2,b+A+14*i,11*i,{weight:600,color:"#222",shadow:!1})),a.restore()}break}case"beacon":{const l=130*i*M.drop,p=12*i;a.save(),a.globalCompositeOperation="lighter";const y=a.createLinearGradient(0,U,0,U-l);y.addColorStop(0,at),y.addColorStop(.6,h(at,.2).replace("rgb","rgba").replace(")",",.35)")),y.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=y,a.filter=`blur(${2*i}px)`,a.beginPath(),a.moveTo(z-p/2,U),a.lineTo(z-p*.2,U-l),a.lineTo(z+p*.2,U-l),a.lineTo(z+p/2,U),a.closePath(),a.fill(),a.filter="none";const k=a.createRadialGradient(z,U,0,z,U,16*i);k.addColorStop(0,"#ffffff"),k.addColorStop(.3,at),k.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=k,a.beginPath(),a.arc(z,U,16*i,0,Math.PI*2),a.fill(),a.restore(),a.globalAlpha=M.alpha*M.label,m(a,u,z,U-l,i);break}}a.restore()}return e&&E(t,e,c,o,n,s),{drawGlyph:w}}const Zr=Object.fromEntries(Object.values(ui).map(t=>[t.id,{d:t.d,vi:t.vi}])),Jr=Object.freeze({id:"map-icon",name:"Icon bản đồ",category:"Bản đồ",duration:5,params:{icon:"location",look:"gold-pin",label:"",sub:"",color:"#e9b949",size:1,pulse:0},code:`const GLYPHS=${JSON.stringify(Zr)}
13410
- ${Qr.toString()}
13409
+ }`}];So.push(...Xr,...Yr),Object.freeze([{...ui,shelf:!1},{...bi,shelf:!0}]),So[0].code;const _r=Object.freeze([{id:"gold-pin",vi:"Ghim vàng",en:"Gold pin",glyph:!0},{id:"gold-hex",vi:"Lục giác vàng",en:"Gold hexagon",glyph:!0},{id:"badge",vi:"Ô vuông viền vàng",en:"Gold-rim badge",glyph:!0},{id:"round",vi:"Ghim tròn màu",en:"Round pin",glyph:!0},{id:"pill",vi:"Nhãn vàng",en:"Gold label",glyph:!1},{id:"tag",vi:"Thẻ tên + đường dẫn",en:"Name tag + leader",glyph:!1},{id:"sign",vi:"Biển bán / cho thuê",en:"Sale sign",glyph:!1},{id:"beacon",vi:"Cột sáng định vị",en:"Light beacon",glyph:!1}]);Object.freeze(_r.map(t=>t.id));const dc=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,Qr={bridge:["M2 18h20","M5 18V7M19 18V7","M5 7c3 6 11 6 14 0","M9 18v-6M12 18v-5M15 18v-6","M2 21c2.5-1.2 5-1.2 7.5 0s5 1.2 7.5 0 3.5-.8 5-.4"],beach:["M12 4a8 8 0 0 1 8 8H4a8 8 0 0 1 8-8Z","M12 4v-1.5","M12 12l-2.5 8","M2 21c2.5-1.2 5-1.2 7.5 0s5 1.2 7.5 0 3.5-.8 5-.4"],pagoda:["M3 9l9-4 9 4","M5 9.5v2.5h14V9.5","M2 13.5l10-2.5 10 2.5","M6 14v7h12v-7","M10 21v-4h4v4","M12 5V2"],church:["M12 2v5M10 4h4","M6 11l6-4 6 4v10H6Z","M10 21v-5h4v5","M3 21h18"],stadium:["M3 9c0-2 4-3.5 9-3.5S21 7 21 9v6c0 2-4 3.5-9 3.5S3 17 3 15Z","M3 9c0 2 4 3.5 9 3.5S21 11 21 9","M12 12.5v6"],golf:["M8 21V3l9 4-9 4","M4 21c2-1.5 6-1.5 8 0",dc(17,18.5,1.6)],factory:["M3 21V10l5 3v-3l5 3v-3l5 3V4h3v17Z","M2 21h20","M7 17h2M12 17h2M17 17h1.5"],building:["M5 21V3h9v18","M14 8h5v13","M3 21h18","M8 7h3M8 11h3M8 15h3","M16.5 12h.01M16.5 16h.01"],villa:["M2 11l10-7 10 7","M4.5 10v11h15V10","M10 21v-5h4v5","M7 13h2M15 13h2"],hospital:["M4 21V6h16v15","M2 21h20","M12 9v6M9 12h6","M9 21v-3h6v3"],kindergarten:["M4 21V11l8-6 8 6v10","M2 21h20","M9 21v-4h6v4",dc(12,11.5,1.8)],market:["M3 9l1.5-5h15L21 9","M3 9h18v2.5a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0Z","M5 14v7h14v-7","M9 21v-4h6v4"],government:["M3 9l9-5 9 5","M4 9h16","M6 9v9M10 9v9M14 9v9M18 9v9","M3 21h18M4 18h16"],metro:["M7 3h10a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3Z","M4 11h16","M8 14.5h.01M16 14.5h.01","M8 18l-2 3M16 18l2 3","M10 7h4"],anchor:[dc(12,5,2.2),"M12 7.2V21","M5 13a7 7 0 0 0 14 0","M3 13h4M17 13h4"],river:["M2 8c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.2 5-.6","M2 13c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.2 5-.6","M2 18c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.2 5-.6"],cinema:["M3 5h18v14H3Z","M7 5v14M17 5v14","M3 9.5h4M3 14.5h4M17 9.5h4M17 14.5h4"],playground:["M5 21V5","M5 5h4l10 15","M3 21h18","M5 12h6"],sale:["M6 21V4","M4 21h4","M6 6h14v8H6Z","M9.5 10h7"],highway:["M7 3 3 21M17 3l4 18","M12 4v2M12 10v3M12 17v3","M2 9h3M19 9h3"],interchange:[dc(12,12,5),"M12 2v5M12 17v5M2 12h5M17 12h5"],park:["M8 21v-4","M8 3a4.5 4.5 0 0 1 4.3 5.8A4 4 0 0 1 9 17H7a4 4 0 0 1-3.3-8.2A4.5 4.5 0 0 1 8 3Z","M17 21v-3","M17 9l3.5 5h-2l2 4h-7l2-4h-2Z","M3 21h18"],view:["M2 18l6-8 4 5 3-3 7 6",dc(17,6,2.5)],skytrain:["M4 4h16v8H4Z","M8 12v9M16 12v9","M2 21h20","M7.5 8h.01M12 8h.01M16.5 8h.01"],hsr:["M3 15c0-4.5 4.5-8 11-8h3l4 4v4Z","M3 15h18","M6 19h12","M8 11h5"],tunnel:["M3 21V12a9 9 0 0 1 18 0v9","M8 21v-7a4 4 0 0 1 8 0v7","M12 17v4"],overpass:["M2 15h20","M2 9.5c4 0 6-3 10-3s6 3 10 3","M7 15v6M17 15v6","M2 21h20"],toll:["M3 21V9h7v12","M3 9l3.5-5L10 9","M10 13h11","M14 13v8M18 13v8"],ringroad:[dc(12,12,8.5),dc(12,12,3.5),"M12 3.5v2M12 18.5v2M3.5 12h2M18.5 12h2"],container:["M2 14h20l-2 6H4Z","M4.5 14V9h5v5M9.5 14V6.5h5V14M14.5 14v-4h5v4"],logistics:["M3 21V9l9-5 9 5v12","M7 21v-8h10v8","M7 16.5h10"],solar:["M3 17l3-9h12l3 9Z","M8.5 8l-1 9M12 8v9M15.5 8l1 9","M4.6 12.5h14.8","M12 17v4M8 21h8"],lakeview:["M3 15c0-3 4-5 9-5s9 2 9 5-4 5-9 5-9-2-9-5Z","M7.5 15c1.5 1 3 1 4.5 0s3-1 4.5 0"],theater:["M4 4h16v7a8 8 0 0 1-16 0Z","M8.5 9h.01M15.5 9h.01","M9 13.5c1.6 1.4 4.4 1.4 6 0"],monument:["M10 21V8l2-5 2 5v13","M6 21h12","M8 17.5h8"],ambulance:["M2 17V7h11v10","M13 10h4l4 4v3h-8","M5.5 12h4M7.5 10v4",dc(6,18,1.8),dc(17,18,1.8)],tennis:[dc(12,12,9),"M5.6 5.6c3.5 3.5 3.5 9.3 0 12.8","M18.4 5.6c-3.5 3.5-3.5 9.3 0 12.8"],island:["M2 20c4-2.5 16-2.5 20 0","M12 17.5c0-4 .5-7 1-9.5","M13 8c-2-2-5-2-7 0 2 0 4 .5 5 2","M13 8c1-2 4-3 6-2-2 .5-4 2-4 3","M13 8c-.5-2-.2-4 1.5-5.5"],skyline:["M3 21V10h4v11M9 21V4h6v17M17 21v-8h4v8","M2 21h20","M11.5 8h1M11.5 12h1M11.5 16h1"],heliport:[dc(12,12,9),"M8.5 7v10M15.5 7v10M8.5 12h7"]},Zr={school:"Trường học",university:"Đại học",kindergarten:"Mầm non",hospital:"Bệnh viện",clinic:"Phòng khám",pharmacy:"Nhà thuốc",medical:"Y tế",mall:"Trung tâm thương mại",supermarket:"Siêu thị",market:"Chợ",store:"Cửa hàng",restaurant:"Nhà hàng",cafe:"Cà phê",hotel:"Khách sạn",resort:"Resort",pool:"Hồ bơi",gym:"Phòng gym",spa:"Spa",golf:"Sân golf",stadium:"Sân vận động",cinema:"Rạp chiếu phim",playground:"Khu vui chơi",camping:"Cắm trại",airport:"Sân bay",port:"Cảng biển",anchor:"Bến tàu",metro:"Metro",train:"Ga tàu",bus:"Bến xe buýt",bridge:"Cầu",highway:"Cao tốc",interchange:"Nút giao",road:"Đường lớn",parking:"Bãi đỗ xe",gas:"Cây xăng",ev:"Trạm sạc xe điện",bicycle:"Đường xe đạp",beach:"Bãi biển",park:"Công viên",tree:"Cây xanh",river:"Sông",lake:"Hồ",mountain:"Núi",view:"Cảnh quan",sun:"Bình minh",government:"Cơ quan hành chính",bank:"Ngân hàng",atm:"ATM",police:"Công an",pagoda:"Chùa",church:"Nhà thờ",wifi:"Wifi",apartment:"Chung cư",villa:"Biệt thự",home:"Nhà phố",factory:"Khu công nghiệp",office:"Văn phòng",land:"Lô đất",sale:"Đang bán",key:"Bàn giao",location:"Vị trí",star:"Điểm nổi bật",skytrain:"Đường sắt trên cao",hsr:"Đường sắt tốc độ cao",tunnel:"Hầm chui",overpass:"Cầu vượt",toll:"Trạm thu phí",ringroad:"Đường vành đai",ferry:"Bến phà",container:"Cảng container",logistics:"Trung tâm logistics",heliport:"Sân đỗ trực thăng",bikeshare:"Xe đạp công cộng",brt:"Buýt nhanh BRT",power:"Trạm điện",solar:"Điện mặt trời",water:"Nhà máy nước",postoffice:"Bưu điện",fire:"Phòng cháy chữa cháy",security:"An ninh 24/7",datacenter:"Trung tâm dữ liệu",coworking:"Văn phòng chia sẻ",library:"Thư viện",museum:"Bảo tàng",theater:"Nhà hát",monument:"Quảng trường",walking:"Phố đi bộ",nightmarket:"Chợ đêm",convenience:"Cửa hàng tiện lợi",sports:"Khu thể thao",tennis:"Sân tennis",ambulance:"Cấp cứu",dental:"Nha khoa",vet:"Thú y",island:"Đảo",lakeview:"Hồ cảnh quan",cbd:"Trung tâm tài chính",embassy:"Lãnh sự quán"},Mi=Object.freeze(Object.fromEntries(Object.entries({school:["edu","School","school","truong hoc,truong tieu hoc,tieu hoc,thcs,thpt,truong quoc te,truong,school"],university:["edu","University","graduation","dai hoc,truong dai hoc,cao dang,truong cao dang,hoc vien,university,college,campus"],kindergarten:["edu","Kindergarten","kindergarten","mam non,mau giao,nha tre,kindergarten,preschool"],hospital:["health","Hospital","hospital","benh vien,hospital"],clinic:["health","Clinic","stethoscope","phong kham,bac si,nha khoa,clinic,doctor,dental"],pharmacy:["health","Pharmacy","pill","nha thuoc,hieu thuoc,pharmacy,drugstore"],medical:["health","Medical","medical","y te,tram y te,medical,health"],mall:["shop","Shopping mall","bag","trung tam thuong mai,tttm,mall,shopping,vincom,aeon,lotte"],supermarket:["shop","Supermarket","cart","sieu thi,supermarket,grocery,bach hoa"],market:["shop","Market","market","cho,market"],store:["shop","Shop","store","cua hang,shop,store"],restaurant:["shop","Restaurant","cutlery","nha hang,an uong,restaurant,food"],cafe:["shop","Café","coffee","ca phe,cafe,coffee"],hotel:["stay","Hotel","bed","khach san,hotel"],resort:["stay","Resort","palm","resort,nghi duong"],pool:["stay","Swimming pool","pool","ho boi,be boi,pool,swim"],gym:["stay","Gym","dumbbell","gym,the hinh,fitness"],spa:["stay","Spa","lotus","spa,wellness"],golf:["stay","Golf course","golf","san golf,golf"],stadium:["stay","Stadium","stadium","san van dong,nha thi dau,stadium,arena"],cinema:["stay","Cinema","cinema","rap chieu phim,rap phim,cinema,movie"],playground:["stay","Playground","playground","khu vui choi,san choi,playground"],camping:["stay","Camping","tent","cam trai,glamping,camping"],airport:["transport","Airport","plane","san bay,airport"],port:["transport","Seaport","ship","cang bien,cang,port,harbour,harbor"],anchor:["transport","Pier","anchor","ben tau,ben du thuyen,du thuyen,pier,marina"],metro:["transport","Metro","metro","metro,tau dien,subway"],train:["transport","Railway station","train","ga tau,duong sat,nha ga,train,railway"],bus:["transport","Bus station","bus","ben xe,xe buyt,bus"],bridge:["transport","Bridge","bridge","cau,bridge"],highway:["transport","Expressway","highway","cao toc,quoc lo,expressway,highway"],interchange:["transport","Interchange","interchange","nut giao,vong xoay,interchange,roundabout"],road:["transport","Main road","road","duong lon,dai lo,road,avenue,boulevard"],parking:["transport","Parking","parking","bai do xe,bai xe,parking"],gas:["transport","Petrol station","fuel","cay xang,tram xang,xang dau,petrol,gas station"],ev:["transport","EV charging","ev-charge","tram sac,xe dien,ev charging,vinfast"],bicycle:["transport","Bike lane","bicycle","xe dap,bike"],beach:["nature","Beach","beach","bai bien,bien,vinh,beach,sea,bay"],park:["nature","Park","park","cong vien,park,garden"],tree:["nature","Green space","tree","cay xanh,mang xanh,green"],river:["nature","River","river","song,kenh,river,canal"],lake:["nature","Lake","drop","ho,lake"],mountain:["nature","Mountain","mountain","nui,doi,mountain,hill"],view:["nature","Scenic view","view","canh quan,tam nhin,view"],sun:["nature","Sunrise","sun","binh minh,hoang hon,sunrise,sunset"],government:["civic","Government office","government","ubnd,uy ban,co quan,hanh chinh,bao tang,government,city hall,museum"],bank:["civic","Bank","bank","ngan hang,bank"],atm:["civic","ATM","card","atm"],police:["civic","Police","shield","cong an,an ninh,police,security"],pagoda:["civic","Pagoda","pagoda","chua,den,pagoda,temple"],church:["civic","Church","church","nha tho,church,cathedral"],wifi:["civic","Wi-Fi","wifi","wifi,internet"],apartment:["estate","Apartments","building","chung cu,can ho,toa nha,apartment,condo,tower"],villa:["estate","Villa","villa","biet thu,villa"],home:["estate","Townhouse","home","nha pho,shophouse,townhouse,house"],factory:["estate","Industrial park","factory","khu cong nghiep,kcn,nha may,factory,industrial"],office:["estate","Office","briefcase","van phong,office"],land:["estate","Land plot","area","lo dat,dat nen,land,plot"],sale:["estate","For sale","sale","dang ban,cho thue,for sale,rent"],key:["estate","Handover","key","ban giao,chia khoa,handover,key"],location:["estate","Location","location","vi tri,dia diem,location"],star:["estate","Highlight","star","noi bat,diem nhan,highlight,landmark"],skytrain:["transport","Elevated rail","skytrain","duong sat tren cao,metro tren cao,skytrain,elevated rail"],hsr:["transport","High-speed rail","hsr","duong sat toc do cao,toc do cao,high speed rail,bullet train"],tunnel:["transport","Tunnel","tunnel","ham chui,ham,tunnel,underpass"],overpass:["transport","Flyover","overpass","cau vuot,flyover,overpass"],toll:["transport","Toll plaza","toll","tram thu phi,thu phi,toll"],ringroad:["transport","Ring road","ringroad","vanh dai,duong vanh dai,ring road,beltway"],ferry:["transport","Ferry","ship","ben pha,pha,ferry"],container:["transport","Container port","container","cang container,container,cang cont"],logistics:["transport","Logistics hub","logistics","trung tam logistics,logistics,kho van,kho bai,warehouse,icd"],heliport:["transport","Heliport","heliport","truc thang,heliport,helipad"],bikeshare:["transport","Bike share","bicycle","xe dap cong cong,bike share"],brt:["transport","BRT bus","bus","brt,buyt nhanh"],power:["civic","Power station","bolt","tram dien,dien luc,tram bien ap,power,substation"],solar:["civic","Solar farm","solar","dien mat troi,solar"],water:["civic","Water works","drop","nha may nuoc,cap nuoc,water supply"],postoffice:["civic","Post office","mail","buu dien,post office"],fire:["civic","Fire station","fire","phong chay chua chay,pccc,cuu hoa,fire station"],security:["civic","24/7 security","shield","an ninh 24/7,an ninh,bao ve,security"],datacenter:["civic","Data centre","server","trung tam du lieu,data center,data centre"],coworking:["civic","Coworking","laptop","van phong chia se,coworking"],embassy:["civic","Consulate","flag","lanh su quan,dai su quan,embassy,consulate"],library:["stay","Library","book-open","thu vien,library"],museum:["stay","Museum","government","bao tang,museum"],theater:["stay","Theatre","theater","nha hat,theatre,theater,opera"],monument:["stay","Square","monument","quang truong,tuong dai,square,plaza,monument"],walking:["stay","Walking street","running","pho di bo,walking street"],sports:["stay","Sports complex","running","khu the thao,cong vien the thao,sports complex,sport"],tennis:["stay","Tennis court","tennis","san tennis,tennis,pickleball"],nightmarket:["shop","Night market","market","cho dem,night market"],convenience:["shop","Convenience store","store","cua hang tien loi,circle k,ministop,7-eleven,convenience store"],ambulance:["health","Emergency","ambulance","cap cuu,ambulance,emergency"],dental:["health","Dental clinic","tooth","nha khoa,dental,dentist"],vet:["health","Vet","paw","thu y,vet,pet"],island:["nature","Island","island","dao,hon,island"],lakeview:["nature","Landscape lake","lakeview","ho canh quan,ho dieu hoa,lake view"],cbd:["estate","City centre","skyline","trung tam tai chinh,trung tam thanh pho,cbd,downtown,trung tam"]}).map(([t,[e,c,o,n]])=>{const s=Qr[o]??ja[o]?.d;if(!s)throw new Error(`map glyph ${t}: no drawing ${o}`);return[t,Object.freeze({id:t,group:e,vi:Zr[t],en:c,d:s,words:n})]})));Object.freeze(Object.keys(Mi));function Jr(t,e,c,o,n,s,x,d){const g=d||'"Be Vietnam Pro", system-ui, sans-serif',C=[[0,"#fff4c8"],[.32,"#f4cf68"],[.66,"#c88f2a"],[1,"#7f5210"]];function P(a,u,M,L=C){const i=a.createLinearGradient(0,u,0,M);for(const[$,z]of L)i.addColorStop($,z);return i}const h=(a,u)=>{const M=parseInt(a.slice(1),16),L=i=>Math.max(0,Math.min(255,Math.round(u<0?(M>>i&255)*(1+u):(M>>i&255)+(255-(M>>i&255))*u)));return`rgb(${L(16)},${L(8)},${L(0)})`};function w(a,u,M,L,i,$,z=2.1){const U=x(u)||x("location")||{d:[]};a.save(),a.translate(M-i/2,L-i/2),a.scale(i/24,i/24),a.strokeStyle=$,a.lineWidth=z,a.lineCap="round",a.lineJoin="round",a.fillStyle="transparent";for(const at of U.d)a.stroke(new Path2D(at));a.restore()}function r(a,u,M,L,i,{color:$="#ffffff",weight:z=800,align:U="center",base:at="alphabetic",shadow:ft=!0,spacing:gt=0}={}){a.save(),a.font=`${z} ${i}px ${g}`,a.textAlign=U,a.textBaseline=at,a.fillStyle=$,gt&&(a.letterSpacing=`${gt}px`),ft&&(a.shadowColor="rgba(0,0,0,.85)",a.shadowBlur=i*.45,a.shadowOffsetY=i*.08),a.fillText(u,M,L),a.restore()}const f=(a,u,M,L=800,i=0)=>{a.save(),a.font=`${L} ${M}px ${g}`,i&&(a.letterSpacing=`${i}px`);const $=a.measureText(u).width;return a.restore(),$};function R(a,u,M,L,i,$){a.beginPath(),a.roundRect(u,M,L,i,$)}function X(a,[u,M],L,i){a.save(),a.globalAlpha=.35*i,a.fillStyle="#000",a.filter=`blur(${3*L}px)`,a.beginPath(),a.ellipse(u,M,14*L,5*L,0,0,Math.PI*2),a.fill(),a.restore()}function j(a,u,M,L){a.save(),a.globalAlpha=.32,a.fillStyle="#ffffff",a.beginPath(),a.ellipse(u-L*.32,M-L*.48,L*.48,L*.22,-.45,0,Math.PI*2),a.fill(),a.restore()}function m(a,u,M,L,i){let $=L-8*i;u.sub&&(r(a,u.sub,M,$,11*i,{weight:600,color:"#f1d58a"}),$-=14*i),u.label&&r(a,u.label,M,$,16*i)}const V=(a,u,M,L,i)=>{const $=Math.acos(Math.min(.99,L/i));a.beginPath(),a.moveTo(u,M+i),a.lineTo(u+L*Math.sin($),M+L*Math.cos($)),a.arc(u,M,L,Math.PI/2-$,Math.PI/2+$,!0),a.closePath()},F=(a,u,M,L)=>{a.beginPath();for(let i=0;i<6;i++){const $=-Math.PI/2+i*Math.PI/3;a[i?"lineTo":"moveTo"](u+L*Math.cos($),M+L*Math.sin($))}a.closePath()};function E(a,u,M,L,i,$){const[z,U]=L,at=u.color;a.save();for(const l of M.rings){if(l.a<=0)continue;const p=$?$(.15+.85*l.r):null;if(a.save(),a.globalAlpha=l.a*.85*M.alpha,a.strokeStyle=at,a.lineWidth=2.4*i,a.shadowColor=at,a.shadowBlur=8*i,a.beginPath(),p&&p.length>2){a.moveTo(p[0][0],p[0][1]);for(const y of p.slice(1))a.lineTo(y[0],y[1]);a.closePath()}else a.ellipse(z,U,(10+60*l.r)*i,(4+22*l.r)*i,0,0,Math.PI*2);a.stroke(),a.restore()}const ft=(1-M.drop)*-46*i,gt=.55+.45*Math.min(1.08,M.drop);a.globalAlpha=M.alpha;const wt=l=>{a.save(),a.translate(z,U),a.scale(gt,gt),a.translate(-z,-U+ft/gt),l(),a.restore()};switch(u.look){case"gold-pin":{const l=24*i,p=54*i,y=z,k=U-p;X(a,L,i,M.drop),wt(()=>{a.save(),a.translate(2.4*i,3*i),V(a,y,k,l,p),a.fillStyle="#5c3a0b",a.fill(),a.restore(),V(a,y,k,l,p),a.fillStyle=P(a,k-l,U),a.fill(),a.lineWidth=1.2*i,a.strokeStyle="rgba(255,246,210,.7)",a.stroke();const I=a.createRadialGradient(y,k-l*.2,0,y,k,l*.66);I.addColorStop(0,"#3a280b"),I.addColorStop(1,"#130c03"),a.beginPath(),a.arc(y,k,l*.66,0,Math.PI*2),a.fillStyle=I,a.fill(),a.lineWidth=1.4*i,a.strokeStyle="#f6d98a",a.stroke(),w(a,u.icon,y,k,l*.82,P(a,k-l*.5,k+l*.5,[[0,"#fff1bd"],[1,"#e2ad3f"]]),2.3),j(a,y,k,l)}),a.globalAlpha=M.alpha*M.label,m(a,u,z,U-p-l+ft,i);break}case"gold-hex":{const l=27*i,p=z,y=U-50*i;X(a,L,i,M.drop);const k=()=>{F(a,p,y,l),a.moveTo(p-8*i,y+l*.9),a.lineTo(p,U-6*i),a.lineTo(p+8*i,y+l*.9)};wt(()=>{a.save(),a.translate(2.4*i,3*i),k(),a.fillStyle="#5c3a0b",a.fill(),a.restore(),k(),a.fillStyle=P(a,y-l,y+l),a.fill(),a.lineWidth=1.2*i,a.strokeStyle="rgba(255,246,210,.75)",a.stroke(),F(a,p,y,l*.8),a.lineWidth=1.2*i,a.strokeStyle="rgba(110,70,10,.55)",a.stroke(),w(a,u.icon,p,y,l*.95,"#2a1b04",2.4),j(a,p,y,l)}),a.globalAlpha=M.alpha*M.label,m(a,u,z,y-l+ft,i);break}case"badge":{const l=46*i,p=z,y=U-46*i;wt(()=>{const k=()=>{R(a,p-l/2,y-l/2,l,l,7*i),a.moveTo(p-7*i,y+l/2-1),a.lineTo(p,y+l/2+9*i),a.lineTo(p+7*i,y+l/2-1)};a.save(),a.shadowColor="rgba(0,0,0,.55)",a.shadowBlur=10*i,a.shadowOffsetY=4*i,k();const I=a.createLinearGradient(0,y-l/2,0,y+l/2);I.addColorStop(0,"#262d36"),I.addColorStop(1,"#0a0d11"),a.fillStyle=I,a.fill(),a.restore(),k(),a.lineWidth=2.4*i,a.strokeStyle=P(a,y-l/2,y+l/2+9*i),a.stroke(),R(a,p-l/2+4*i,y-l/2+4*i,l-8*i,l-8*i,4*i),a.lineWidth=.8*i,a.strokeStyle="rgba(233,185,73,.35)",a.stroke(),w(a,u.icon,p,y,l*.56,P(a,y-l*.3,y+l*.3,[[0,"#ffe9a3"],[1,"#d9a03a"]]),2.2)}),a.globalAlpha=M.alpha,a.beginPath(),a.arc(z,U,3.2*i,0,Math.PI*2),a.fillStyle=at,a.fill(),a.globalAlpha=M.alpha*M.label,m(a,u,z,y-l/2+ft,i);break}case"round":{const l=21*i,p=z,y=U-46*i;a.save(),a.strokeStyle="rgba(255,255,255,.85)",a.lineWidth=2*i,a.beginPath(),a.moveTo(z,U),a.lineTo(z,U+ft-46*i+l),a.stroke(),a.beginPath(),a.arc(z,U,3.5*i,0,Math.PI*2),a.fillStyle="#fff",a.fill(),a.restore(),wt(()=>{a.save(),a.shadowColor="rgba(0,0,0,.5)",a.shadowBlur=10*i,a.shadowOffsetY=4*i;const k=a.createRadialGradient(p-l*.3,y-l*.35,l*.1,p,y,l);k.addColorStop(0,h(at,.45)),k.addColorStop(.7,at),k.addColorStop(1,h(at,-.35)),a.beginPath(),a.arc(p,y,l,0,Math.PI*2),a.fillStyle=k,a.fill(),a.restore(),a.beginPath(),a.arc(p,y,l,0,Math.PI*2),a.lineWidth=2.8*i,a.strokeStyle="#ffffff",a.stroke(),w(a,u.icon,p,y,l*1.05,"#ffffff",2.3),j(a,p,y,l)}),a.globalAlpha=M.alpha*M.label,m(a,u,z,y-l+ft,i);break}case"pill":{const l=u.label||x(u.icon)?.vi||"",p=15*i,y=f(a,l,p)+30*i,k=30*i,I=U-36*i;wt(()=>{const tt=()=>{R(a,z-y/2,I-k/2,y,k,k/2),a.moveTo(z-6*i,I+k/2-1),a.lineTo(z,I+k/2+8*i),a.lineTo(z+6*i,I+k/2-1)};a.save(),a.translate(1.6*i,2.2*i),tt(),a.fillStyle="#5c3a0b",a.fill(),a.restore(),a.save(),a.shadowColor="rgba(0,0,0,.45)",a.shadowBlur=8*i,tt(),a.fillStyle=P(a,I-k/2,I+k/2),a.fill(),a.restore(),tt(),a.lineWidth=1*i,a.strokeStyle="rgba(255,246,210,.8)",a.stroke(),r(a,l,z,I+p*.36,p,{color:"#2a1b04",shadow:!1}),a.save(),a.globalAlpha=.3,a.fillStyle="#fff",R(a,z-y/2+6*i,I-k/2+3*i,y-12*i,k*.32,k*.16),a.fill(),a.restore()}),u.sub&&(a.globalAlpha=M.alpha*M.label,r(a,u.sub,z,I-k/2-6*i+ft,11*i,{weight:600}));break}case"tag":{const l=(u.label||x(u.icon)?.vi||"").toUpperCase(),p=(u.sub||"").toUpperCase(),y=18*i,k=10*i,I=12*i,tt=Math.max(f(a,l,y),p?f(a,p,k,600,2.2*i):0)+I*2,A=(p?50:36)*i,b=64*i*M.drop,O=z-I-4*i,Q=U-b-A;a.save(),a.strokeStyle=at,a.lineWidth=2*i,a.shadowColor=at,a.shadowBlur=6*i,a.beginPath(),a.moveTo(z,U),a.lineTo(z,U-b),a.stroke(),a.beginPath(),a.arc(z,U,5*i,0,Math.PI*2),a.lineWidth=2.2*i,a.stroke(),a.beginPath(),a.arc(z,U,2.2*i,0,Math.PI*2),a.fillStyle="#fff",a.fill(),a.restore(),M.label>0&&(a.save(),a.globalAlpha=M.alpha*M.label,a.save(),a.shadowColor="rgba(0,0,0,.6)",a.shadowBlur=12*i,R(a,O,Q,tt*(.4+.6*M.label),A,3*i),a.fillStyle="rgba(10,12,16,.9)",a.fill(),a.restore(),a.fillStyle=P(a,Q+A-3*i,Q+A),a.fillRect(O,Q+A-3*i,tt*(.4+.6*M.label),3*i),R(a,O,Q,tt*(.4+.6*M.label),A,3*i),a.lineWidth=.8*i,a.strokeStyle="rgba(233,185,73,.45)",a.stroke(),p&&r(a,p,O+I,Q+16*i,k,{weight:600,color:"#e9b949",align:"left",shadow:!1,spacing:2.2*i}),r(a,l,O+I,Q+A-12*i,y,{align:"left",shadow:!1}),a.restore());break}case"sign":{const l=(u.label||"BÁN NHÀ").toUpperCase(),p=20*i,y=Math.max(f(a,l,p,900),u.sub?f(a,u.sub,11*i,600):0)+34*i,k=96*i*M.drop,I=U-k,tt=z-4*i,A=36*i;if(a.save(),a.strokeStyle="#f2f2f2",a.lineWidth=4.5*i,a.lineCap="round",a.shadowColor="rgba(0,0,0,.5)",a.shadowBlur=6*i,a.beginPath(),a.moveTo(z,U),a.lineTo(z,I),a.lineTo(z+y*(.15+.85*M.label),I),a.stroke(),a.restore(),M.label>0){a.save(),a.globalAlpha=M.alpha*M.label;const b=I+8*i;a.save(),a.shadowColor="rgba(0,0,0,.55)",a.shadowBlur=10*i,a.shadowOffsetY=3*i,a.fillStyle=at,a.fillRect(tt+8*i,b,y-8*i,A),a.restore();const O=a.createLinearGradient(0,b,0,b+A);O.addColorStop(0,"rgba(255,255,255,.22)"),O.addColorStop(.5,"rgba(255,255,255,0)"),a.fillStyle=O,a.fillRect(tt+8*i,b,y-8*i,A),a.strokeStyle="#ffffff",a.lineWidth=2*i,a.strokeRect(tt+11*i,b+3*i,y-14*i,A-6*i),r(a,l,tt+4*i+y/2,b+A/2+p*.36,p,{weight:900,shadow:!1}),u.sub&&(a.fillStyle="#ffffff",a.fillRect(tt+8*i,b+A,y-8*i,20*i),r(a,u.sub,tt+4*i+y/2,b+A+14*i,11*i,{weight:600,color:"#222",shadow:!1})),a.restore()}break}case"beacon":{const l=130*i*M.drop,p=12*i;a.save(),a.globalCompositeOperation="lighter";const y=a.createLinearGradient(0,U,0,U-l);y.addColorStop(0,at),y.addColorStop(.6,h(at,.2).replace("rgb","rgba").replace(")",",.35)")),y.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=y,a.filter=`blur(${2*i}px)`,a.beginPath(),a.moveTo(z-p/2,U),a.lineTo(z-p*.2,U-l),a.lineTo(z+p*.2,U-l),a.lineTo(z+p/2,U),a.closePath(),a.fill(),a.filter="none";const k=a.createRadialGradient(z,U,0,z,U,16*i);k.addColorStop(0,"#ffffff"),k.addColorStop(.3,at),k.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=k,a.beginPath(),a.arc(z,U,16*i,0,Math.PI*2),a.fill(),a.restore(),a.globalAlpha=M.alpha*M.label,m(a,u,z,U-l,i);break}}a.restore()}return e&&E(t,e,c,o,n,s),{drawGlyph:w}}const tx=Object.fromEntries(Object.values(Mi).map(t=>[t.id,{d:t.d,vi:t.vi}])),ex=Object.freeze({id:"map-icon",name:"Icon bản đồ",category:"Bản đồ",duration:5,params:{icon:"location",look:"gold-pin",label:"",sub:"",color:"#e9b949",size:1,pulse:0},code:`const GLYPHS=${JSON.stringify(tx)}
13410
+ ${Jr.toString()}
13411
13411
  function render(ctx,t,env){
13412
13412
  const {width:W,height:H,params:p}=env,s=Math.max(0,t),u=Math.min(1,s/.45),c1=1.70158,c3=c1+1
13413
13413
  const drop=1+c3*(u-1)**3+c1*(u-1)**2,alpha=Math.min(1,s/.18),label=Math.max(0,Math.min(1,(s-.3)/.25))
13414
13414
  const rings=p.pulse?[0,1].map(k=>{const ph=((s+k)%2)/2;return {r:ph,a:(1-ph)*Math.min(1,s/.3)}}):[]
13415
13415
  const icon={icon:p.icon,look:p.look,label:p.label||undefined,sub:p.sub||undefined,color:p.color,pulse:!!p.pulse,size:p.size||1,at:[0,0],show:0}
13416
13416
  paintMapIcon(ctx,icon,{drop,alpha,label,rings},[W/2,H/2],H/720*(p.size||1),undefined,id=>GLYPHS[id],env.fonts&&env.fonts.bevn)
13417
- }`}),tx=Object.freeze({id:"vfx-smoke-poof",name:"Khói bụp",category:"VFX",duration:1.1,params:{color:"#f2f2ee",shade:"#b9bcc2",puffs:16,sparks:1,size:1},code:`function render(ctx,t,env){
13417
+ }`}),cx=Object.freeze({id:"vfx-smoke-poof",name:"Khói bụp",category:"VFX",duration:1.1,params:{color:"#f2f2ee",shade:"#b9bcc2",puffs:16,sparks:1,size:1},code:`function render(ctx,t,env){
13418
13418
  const {width:W,height:H,params:p}=env,k=H/720*(p.size||1),cx=W/2,cy=H/2,N=Math.max(4,Math.min(40,p.puffs|0||16)),D=1.1
13419
13419
  if(t<0||t>D)return
13420
13420
  const rnd=M.rand(11)
@@ -13433,7 +13433,7 @@ function render(ctx,t,env){
13433
13433
  // sparks in the first third
13434
13434
  if(p.sparks&&t<.4){const u=t/.4;ctx.strokeStyle='rgba(255,244,214,'+(1-u)+')';ctx.lineWidth=2.2*k;ctx.lineCap='round'
13435
13435
  for(let i=0;i<10;i++){const ang=rnd()*Math.PI*2,l0=60*k+rnd()*90*k,l=l0*(.3+u);ctx.beginPath();ctx.moveTo(cx+Math.cos(ang)*l*.6,cy+Math.sin(ang)*l*.6);ctx.lineTo(cx+Math.cos(ang)*l,cy+Math.sin(ang)*l);ctx.stroke()}}
13436
- }`}),ex=Object.freeze({id:"vfx-debris-burst",name:"Mảnh vụn văng",category:"VFX",duration:1.2,params:{color:"#2a2622",dust:"#d9d4cc",shards:34,size:1,seed:7},code:`function render(ctx,t,env){
13436
+ }`}),ax=Object.freeze({id:"vfx-debris-burst",name:"Mảnh vụn văng",category:"VFX",duration:1.2,params:{color:"#2a2622",dust:"#d9d4cc",shards:34,size:1,seed:7},code:`function render(ctx,t,env){
13437
13437
  const {width:W,height:H,params:p}=env,k=H/720*(p.size||1),cx=W/2,cy=H/2,N=Math.max(6,Math.min(80,p.shards|0||34)),D=1.2
13438
13438
  if(t<0||t>D)return
13439
13439
  const rnd=M.rand((p.seed|0)||7)
@@ -13453,7 +13453,7 @@ function render(ctx,t,env){
13453
13453
  for(let j=0;j<sides;j++){const aa=j/sides*Math.PI*2,rr=s*(.55+.45*((i*7+j*3)%5)/4);j?ctx.lineTo(Math.cos(aa)*rr,Math.sin(aa)*rr*.7):ctx.moveTo(Math.cos(aa)*rr,Math.sin(aa)*rr*.7)}
13454
13454
  ctx.closePath();ctx.fill();ctx.restore()
13455
13455
  }
13456
- }`}),cx=Object.freeze({id:"vfx-speed-bolt",name:"Vệt sét",category:"VFX",duration:3,params:{color:"#ffb02e",core:"#fff7e0",width:1,length:.4,jag:.6,fps:30,t0:0,n:0},code:`function render(ctx,t,env){
13456
+ }`}),ox=Object.freeze({id:"vfx-speed-bolt",name:"Vệt sét",category:"VFX",duration:3,params:{color:"#ffb02e",core:"#fff7e0",width:1,length:.4,jag:.6,fps:30,t0:0,n:0},code:`function render(ctx,t,env){
13457
13457
  const {width:W,height:H,fps:F,params:p}=env,k=H/720*(p.width||1),n=p.n|0
13458
13458
  if(n<2)return
13459
13459
  let s='';for(let i=0;i<15;i++)s+=p['p'+i]||''
@@ -13479,7 +13479,7 @@ function render(ctx,t,env){
13479
13479
  const hd=pts[pts.length-1],r=M.rand(fr*977+5);ctx.save();ctx.strokeStyle=M.rgba(p.core,.9);ctx.shadowColor=p.color;ctx.shadowBlur=10*k;ctx.lineWidth=1.6*k
13480
13480
  for(let i=0;i<5;i++){const a=r()*Math.PI*2,l=(10+r()*26)*k;ctx.beginPath();ctx.moveTo(hd[0],hd[1]);ctx.lineTo(hd[0]+Math.cos(a)*l,hd[1]+Math.sin(a)*l);ctx.stroke()}
13481
13481
  const g=ctx.createRadialGradient(hd[0],hd[1],0,hd[0],hd[1],40*k);g.addColorStop(0,M.rgba(p.core,.85));g.addColorStop(1,M.rgba(p.color,0));ctx.fillStyle=g;ctx.fillRect(hd[0]-40*k,hd[1]-40*k,80*k,80*k);ctx.restore()
13482
- }`}),ax=Object.freeze({id:"vfx-breath-mist",name:"Hơi thở",category:"VFX",duration:1.6,params:{color:"#f4f7ff",shade:"#9fb6d6",angle:200,length:1,size:1,puffs:26,seed:5},code:`function render(ctx,t,env){
13482
+ }`}),nx=Object.freeze({id:"vfx-breath-mist",name:"Hơi thở",category:"VFX",duration:1.6,params:{color:"#f4f7ff",shade:"#9fb6d6",angle:200,length:1,size:1,puffs:26,seed:5},code:`function render(ctx,t,env){
13483
13483
  const {width:W,height:H,params:p}=env,k=H/720*(p.size||1),cx=W/2,cy=H/2,D=env.duration||1.6,N=Math.max(6,Math.min(60,p.puffs|0||26))
13484
13484
  if(t<0||t>D)return
13485
13485
  const rnd=M.rand((p.seed|0)||5),a0=(p.angle??200)*Math.PI/180,ux=Math.cos(a0),uy=Math.sin(a0),vx=-uy,vy=ux,L=(p.length||1)*260*k
@@ -13495,7 +13495,7 @@ function render(ctx,t,env){
13495
13495
  const g=ctx.createRadialGradient(x,y,r*.1,x,y,r);g.addColorStop(0,M.rgba(p.color,a));g.addColorStop(.55,M.rgba(p.shade,a*.5));g.addColorStop(1,M.rgba(p.shade,0))
13496
13496
  ctx.fillStyle=g;ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);ctx.fill()
13497
13497
  }
13498
- }`}),ox=Object.freeze({id:"vfx-light-pillar",name:"Cột sáng",category:"VFX",duration:.9,params:{color:"#ffd166",core:"#fffaf0",bolts:5,size:1,seed:3},code:`function render(ctx,t,env){
13498
+ }`}),sx=Object.freeze({id:"vfx-light-pillar",name:"Cột sáng",category:"VFX",duration:.9,params:{color:"#ffd166",core:"#fffaf0",bolts:5,size:1,seed:3},code:`function render(ctx,t,env){
13499
13499
  const {width:W,height:H,fps:F,params:p}=env,k=H/720*(p.size||1),cx=(p.x??.5)*W,cy=(p.y??.5)*H,D=env.duration||.9
13500
13500
  if(t<0||t>D)return
13501
13501
  const u=t/D,e=Math.min(1,t/.05)*Math.pow(1-u,1.3),hgt=(p.x==null?Math.min(cy+40*k,620*k):cy+40*k)*(0.6+0.4*Math.min(1,t/.12)),wd=(34+30*e)*k
@@ -13516,161 +13516,312 @@ function render(ctx,t,env){
13516
13516
  const rs=M.rand(17+(p.seed|0));ctx.strokeStyle=M.rgba(p.core,.9*e);ctx.lineWidth=1.8*k
13517
13517
  for(let i=0;i<14;i++){const a=-Math.PI*(.05+.9*rs()),d=(40+260*rs())*k*Math.min(1,u*3),l=(8+18*rs())*k;ctx.beginPath();ctx.moveTo(cx+Math.cos(a)*d,cy+Math.sin(a)*d);ctx.lineTo(cx+Math.cos(a)*(d+l),cy+Math.sin(a)*(d+l));ctx.stroke()}
13518
13518
  ctx.restore()
13519
- }`}),nx=Object.freeze({id:"vfx-weapon-slash",name:"Vệt chém kiếm khí",category:"VFX",duration:.55,params:{color:"#38bdf8",core:"#ffffff",angle:-28,arc:155,flip:!1,width:1,size:1,glow:1,speed:1,sparks:!0,seed:13},code:`function render(ctx,t,env){
13520
- const {width:W,height:H,params:p}=env,spd=Math.max(.3,Math.min(3,Number(p.speed)||1)),D=(env.duration||.55)/spd
13521
- if(t<0||t>D)return
13522
- const u=t/D,k=H/720*(p.size||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),cx=(p.x??.5)*W,cy=(p.y??.5)*H
13523
- const dir=p.flip?-1:1,ang0=(p.angle??-28)*Math.PI/180,span=Math.max(40,Math.min(280,p.arc||155))*Math.PI/180
13524
- const head=Math.min(1,Math.pow(u/.42,.65)),tail=Math.max(0,Math.min(head,(u-.14)/.78))
13525
- const fade=Math.pow(Math.max(0,1-Math.max(0,u-.25)/.75),1.35)
13526
- if(head-tail<.005||fade<=.005)return
13527
- const R=260*k,wBase=46*k*(p.width||1),N=44
13528
- const pt=(q,dr)=>{const a=(-span/2+span*q)*dir;return [Math.cos(a)*(R+dr)-R*.58,Math.sin(a)*(R+dr)*.78]}
13529
- ctx.save();ctx.translate(cx,cy);ctx.rotate(ang0);ctx.globalCompositeOperation='lighter'
13530
- const drawCrescent=(scaleW,col,alpha,blur)=>{
13531
- ctx.save();if(blur*gl>0){ctx.shadowColor=p.color;ctx.shadowBlur=blur*gl}
13532
- ctx.beginPath()
13533
- for(let i=0;i<=N;i++){const f=i/N,q=tail+(head-tail)*f,w=wBase*scaleW*Math.sin(Math.pow(f,.7)*Math.PI);const [x,y]=pt(q,w*.68);i?ctx.lineTo(x,y):ctx.moveTo(x,y)}
13534
- for(let i=N;i>=0;i--){const f=i/N,q=tail+(head-tail)*f,w=wBase*scaleW*Math.sin(Math.pow(f,.7)*Math.PI);const [x,y]=pt(q,-w*.32);ctx.lineTo(x,y)}
13535
- ctx.closePath();ctx.fillStyle=M.rgba(col,Math.min(1,alpha*fade));ctx.fill();ctx.restore()
13536
- }
13537
- // Outer plasma sheath, saturated energy blade, razor white-hot core + silky curling qi wisps
13538
- drawCrescent(2.4,p.color,.16*Math.min(1.6,gl),42*k)
13539
- drawCrescent(1.85,p.color,.32*Math.min(1.5,gl),28*k)
13540
- drawCrescent(1.08,p.color,.86,14*k)
13541
- drawCrescent(.46,p.core,.98,4*k)
13542
- for(let s=0;s<7;s++){const off=(s-3)*wBase*.28,ph=s*1.3;ctx.beginPath()
13543
- for(let i=0;i<=N;i++){const f=i/N,q=tail+(head-tail)*f,curl=Math.sin(f*Math.PI*2.5-u*9+ph)*wBase*.22;const [x,y]=pt(q,(off+curl)*Math.sin(f*Math.PI));i?ctx.lineTo(x,y):ctx.moveTo(x,y)}
13544
- ctx.strokeStyle=M.rgba(s===3?p.core:p.color,(s===3?.48:.16)*fade*Math.min(1.4,gl));ctx.lineWidth=(s===3?2.2:8+s%3*4)*k;ctx.lineCap='round';ctx.stroke()}
13545
- // Leading tip flare + center slash gleam
13546
- if(u<.58&&gl>.05){const [hx,hy]=pt(head,0),fl=(1-u/.58),r=85*k*fl*(.6+.4*gl)
13547
- const g=ctx.createRadialGradient(hx,hy,0,hx,hy,r);g.addColorStop(0,M.rgba(p.core,.98*fl));g.addColorStop(.38,M.rgba(p.color,.58*fl));g.addColorStop(1,M.rgba(p.color,0))
13548
- ctx.fillStyle=g;ctx.fillRect(hx-r,hy-r,r*2,r*2)}
13549
- // Trailing energy sparks shed along the arc
13550
- if(p.sparks){const rnd=M.rand((p.seed|0)||13);ctx.lineCap='round'
13551
- for(let i=0;i<26;i++){const sq=rnd(),born=sq*.32,age=(t-born)/(D*.72);if(age<=0||age>=1)continue
13552
- const [bx,by]=pt(sq,(rnd()-.5)*wBase*1.4),out=(30+rnd()*130)*k*age,a=(-span/2+span*sq)*dir+(rnd()-.5)*.6
13553
- const sx=bx+Math.cos(a)*out,sy=by+Math.sin(a)*out,len=(14+rnd()*34)*k*(1-age*.7),al=Math.pow(1-age,1.15)*fade
13554
- ctx.strokeStyle=M.rgba(i%3?p.color:p.core,al);ctx.lineWidth=(1.6+rnd()*1.8)*k
13555
- ctx.beginPath();ctx.moveTo(sx,sy);ctx.lineTo(sx-Math.cos(a)*len,sy-Math.sin(a)*len);ctx.stroke()}}
13556
- ctx.restore()
13557
- }`}),sx=Object.freeze({id:"vfx-cross-slash",name:"Song trảm chữ thập",category:"VFX",duration:.65,params:{color:"#f43f5e",core:"#fff5f7",angle:-35,spread:78,delay:.08,width:1,size:1,glow:1,speed:1,sparks:!0,seed:17},code:`function render(ctx,t,env){
13558
- const {width:W,height:H,params:p}=env,spd=Math.max(.3,Math.min(3,Number(p.speed)||1)),D=(env.duration||.65)/spd
13559
- if(t<0||t>D)return
13560
- const k=H/720*(p.size||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),cx=(p.x??.5)*W,cy=(p.y??.5)*H
13561
- const a1=(p.angle??-35)*Math.PI/180,sp=(p.spread??78)*Math.PI/180,dly=Math.max(0,Math.min(.25,p.delay??.08))/spd
13562
- ctx.save();ctx.translate(cx,cy);ctx.globalCompositeOperation='lighter'
13563
- const stroke=(delay,rot)=>{
13564
- const lt=t-delay,dur=D-delay;if(lt<=0||lt>=dur)return
13565
- const u=lt/dur,head=Math.min(1,Math.pow(u/.28,.6)),tail=Math.max(0,(u-.18)/.76),fade=Math.pow(Math.max(0,1-Math.max(0,u-.22)/.78),1.4)
13566
- if(head-tail<.01||fade<=.01)return
13567
- const L=340*k,w=22*k*(p.width||1)
13568
- ctx.save();ctx.rotate(rot)
13569
- const x0=-L+2*L*tail,x1=-L+2*L*head,xm=(x0+x1)/2
13570
- const draw=(mw,col,al,bl)=>{ctx.save();if(bl*gl>0){ctx.shadowColor=p.color;ctx.shadowBlur=bl*gl}
13571
- ctx.beginPath();ctx.moveTo(x0,0);ctx.quadraticCurveTo(xm,-w*mw,x1,0);ctx.quadraticCurveTo(xm,w*mw,x0,0);ctx.closePath()
13572
- ctx.fillStyle=M.rgba(col,Math.min(1,al*fade));ctx.fill();ctx.restore()}
13573
- draw(1.8,p.color,.34*Math.min(1.5,gl),24*k);draw(1.0,p.color,.85,10*k);draw(.38,p.core,.98,3*k)
13574
- ctx.restore()
13575
- }
13576
- stroke(0,a1);stroke(dly,a1+sp)
13577
- // Blazing intersection star-flare when second slash crosses the first
13578
- const ft=t-dly;if(ft>0&&ft<.32/spd&&gl>.05){const fl=Math.min(1,ft/(.03/spd))*Math.pow(1-ft/(.32/spd),1.6),r=135*k*fl*(.6+.4*gl)
13579
- const g=ctx.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(p.core,.95*fl));g.addColorStop(.35,M.rgba(p.color,.55*fl));g.addColorStop(1,M.rgba(p.color,0))
13580
- ctx.fillStyle=g;ctx.fillRect(-r,-r,r*2,r*2)
13581
- ctx.strokeStyle=M.rgba(p.core,.9*fl);ctx.lineWidth=2.4*k
13582
- for(let i=0;i<2;i++){const a=a1+(i?sp:0)+Math.PI/4,rl=150*k*fl;ctx.beginPath();ctx.moveTo(-Math.cos(a)*rl,-Math.sin(a)*rl);ctx.lineTo(Math.cos(a)*rl,Math.sin(a)*rl);ctx.stroke()}}
13583
- // Directional clash sparks from intersection
13584
- if(p.sparks!==false){const rnd=M.rand((p.seed|0)||17);ctx.lineCap='round'
13585
- for(let i=0;i<22;i++){const age=(t-dly*.75)/(D*.75);if(age<=0||age>=1)continue
13586
- const a=rnd()*Math.PI*2,dist=(35+rnd()*240)*k*(1-Math.exp(-4*age)),len=(10+rnd()*26)*k*(1-age),al=Math.pow(1-age,1.3)
13587
- ctx.strokeStyle=M.rgba(i%2?p.color:p.core,al);ctx.lineWidth=(1.4+rnd()*1.6)*k
13588
- ctx.beginPath();ctx.moveTo(Math.cos(a)*dist,Math.sin(a)*dist);ctx.lineTo(Math.cos(a)*(dist+len),Math.sin(a)*(dist+len));ctx.stroke()}}
13589
- ctx.restore()
13590
- }`}),ix=Object.freeze({id:"vfx-clash-sparks",name:"Tia lửa giao kiếm",category:"VFX",duration:.75,params:{color:"#ffb02e",core:"#ffffff",sparks:36,size:1,glow:1,flare:1,ring:!0,seed:23},code:`function render(ctx,t,env){
13591
- const {width:W,height:H,params:p}=env,D=env.duration||.75
13592
- if(t<0||t>D)return
13593
- const u=t/D,k=H/720*(p.size||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),flScale=Math.max(0,Math.min(2.5,p.flare??1))
13594
- const cx=(p.x??.5)*W,cy=(p.y??.5)*H,N=Math.max(0,Math.min(80,p.sparks|0))
13595
- ctx.save();ctx.translate(cx,cy);ctx.globalCompositeOperation='lighter'
13596
- // Core flash + blazing 4-point anamorphic clash star
13597
- if(u<.52&&flScale>.05){const fl=Math.min(1,t/.02)*Math.pow(1-u/.52,1.35),r=195*k*fl*flScale
13598
- const g=ctx.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(p.core,.98*fl));g.addColorStop(.28,M.rgba(p.color,.72*fl));g.addColorStop(1,M.rgba(p.color,0))
13599
- ctx.fillStyle=g;ctx.fillRect(-r,-r,r*2,r*2)
13600
- const flare=(len,wid,ang)=>{ctx.save();ctx.rotate(ang);const sg=ctx.createLinearGradient(-len,0,len,0)
13601
- sg.addColorStop(0,M.rgba(p.color,0));sg.addColorStop(.5,M.rgba(p.core,.95*fl));sg.addColorStop(1,M.rgba(p.color,0))
13602
- ctx.fillStyle=sg;ctx.beginPath();ctx.moveTo(-len,0);ctx.quadraticCurveTo(0,-wid,len,0);ctx.quadraticCurveTo(0,wid,-len,0);ctx.fill();ctx.restore()}
13603
- flare(380*k*fl*flScale,13*k*fl,0);flare(185*k*fl*flScale,8*k*fl,Math.PI/2);flare(150*k*fl*flScale,5*k*fl,Math.PI/4);flare(150*k*fl*flScale,5*k*fl,-Math.PI/4)}
13604
- // Soft glowing double shockwave rings
13605
- if(p.ring!==false&&u<.62){const ru=u/.62,rad=(26+255*(1-Math.exp(-4.2*ru)))*k,ra=Math.pow(1-ru,1.55)*.9
13606
- const rg=ctx.createRadialGradient(0,0,Math.max(1,rad-28*k),0,0,rad+24*k)
13607
- rg.addColorStop(0,M.rgba(p.color,0));rg.addColorStop(.55,M.rgba(p.color,ra*.42*Math.min(1.5,gl)));rg.addColorStop(1,M.rgba(p.color,0))
13608
- ctx.fillStyle=rg;ctx.beginPath();ctx.arc(0,0,rad+24*k,0,Math.PI*2);ctx.fill()
13609
- ctx.strokeStyle=M.rgba(p.core,ra*.85);ctx.lineWidth=(4.5*(1-ru)+1.2)*k;ctx.shadowColor=p.color;ctx.shadowBlur=18*k*gl
13610
- ctx.beginPath();ctx.arc(0,0,rad,0,Math.PI*2);ctx.stroke();ctx.shadowBlur=0}
13611
- // High-velocity metallic sparks with gravity & velocity-stretched glowing trails
13612
- const rnd=M.rand((p.seed|0)||23);ctx.lineCap='round'
13613
- for(let i=0;i<N;i++){
13614
- const a=rnd()*Math.PI*2,sp=(380+rnd()*880)*k,life=.42+rnd()*.58,q=t/life
13615
- if(q>=1)continue
13616
- const drag=(1-Math.exp(-3.1*t))/3.1,x=Math.cos(a)*sp*drag,y=Math.sin(a)*sp*drag+420*k*t*t
13617
- const vx=Math.cos(a)*sp*Math.exp(-3.1*t),vy=Math.sin(a)*sp*Math.exp(-3.1*t)+840*k*t,al=Math.pow(1-q,1.05)
13618
- ctx.strokeStyle=M.rgba(i%3?p.color:p.core,al);ctx.lineWidth=(1.8+rnd()*2.4)*k*(1-q*.45);ctx.shadowColor=p.color;ctx.shadowBlur=8*k*gl
13619
- ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x-vx*.048,y-vy*.048);ctx.stroke()
13620
- }
13621
- ctx.shadowBlur=0;ctx.restore()
13622
- }`}),lx=Object.freeze({id:"vfx-energy-ribbon",name:"Vệt năng lượng chuyển động",category:"VFX",duration:3,params:{color:"#38bdf8",core:"#ffffff",width:1,length:.35,glow:1,sparks:!0,fps:30,t0:0,n:0},code:`function render(ctx,t,env){
13623
- const {width:W,height:H,fps:F,params:p}=env,k=H/720*(p.width||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),n=p.n|0
13624
- if(n<2)return
13625
- let s='';for(let i=0;i<15;i++)s+=p['p'+i]||''
13626
- const at=i=>[parseInt(s.substr(i*4,2),36)/1295*W,parseInt(s.substr(i*4+2,2),36)/1295*H]
13627
- const h=(t-(p.t0||0))*(p.fps||30),tail=h-(p.length||.35)*(p.fps||30)
13628
- if(h<0||tail>n-1)return
13629
- const i0=Math.max(0,Math.ceil(tail)),i1=Math.min(n-1,Math.floor(h)),pts=[]
13630
- if(tail>0&&i0>0){const a=at(i0-1),b=at(i0),f=tail-(i0-1);pts.push([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f])}
13631
- for(let i=i0;i<=i1;i++)pts.push(at(i))
13632
- if(h<n-1&&i1+1<n){const a=at(i1),b=at(i1+1),f=h-i1;pts.push([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f])}
13633
- if(pts.length<2)return
13634
- // Compute smooth normals along the ribbon so width tapers cleanly from tail (0) to glowing head (1)
13635
- const L=pts.length,norms=[]
13636
- for(let i=0;i<L;i++){const a=pts[Math.max(0,i-1)],b=pts[Math.min(L-1,i+1)],dx=b[0]-a[0],dy=b[1]-a[1],d=Math.hypot(dx,dy)||1;norms.push([-dy/d,dx/d])}
13637
- ctx.save();ctx.globalCompositeOperation='lighter'
13638
- // Smooth unified quadratic-bezier polygon tapered cleanly at BOTH tail (0) and razor tip (1)
13639
- const drawRibbon=(wScale,col,alpha,blur)=>{
13640
- const left=[],right=[]
13641
- for(let i=0;i<L;i++){
13642
- const q=i/(L-1),taper=Math.sin(Math.pow(q,.72)*Math.PI),w=22*k*wScale*taper
13643
- left.push([pts[i][0]+norms[i][0]*w,pts[i][1]+norms[i][1]*w])
13644
- right.push([pts[i][0]-norms[i][0]*w,pts[i][1]-norms[i][1]*w])
13519
+ }`}),ix=`
13520
+ precision highp float;
13521
+ varying vec2 vUv;
13522
+ float hash(vec2 p){p=fract(p*vec2(123.34,456.21));p+=dot(p,p+45.32);return fract(p.x*p.y);}
13523
+ float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+vec2(1,1)),f.x),f.y);}
13524
+ const mat2 R2=mat2(0.80,-0.60,0.60,0.80);
13525
+ float fbm(vec2 p){float v=0.0,a=0.5;for(int i=0;i<6;i++){v+=a*noise(p);p=R2*p*2.04+vec2(1.7,9.2);a*=0.5;}return v;}
13526
+ float fluidSilk(vec2 p,float t){
13527
+ vec2 q=vec2(fbm(p+vec2(0.0,-t*1.25)),fbm(p+vec2(5.2,1.3-t*1.05)));
13528
+ vec2 r=vec2(fbm(p+3.1*q+vec2(1.7,9.2-t*1.5)),fbm(p+3.1*q+vec2(8.3,2.8-t*1.25)));
13529
+ float f=fbm(p+2.5*r),ridge=1.0-abs(f*2.0-1.0);
13530
+ return mix(f*f,pow(ridge,2.5),0.54);
13531
+ }
13532
+ vec3 aces(vec3 x){return clamp((x*(2.51*x+0.03))/(x*(2.43*x+0.59)+0.14),0.0,1.0);}
13533
+ vec3 plasmaRamp(vec3 col,vec3 core,float d){
13534
+ vec3 deep=col*vec3(0.55,0.28,0.22);
13535
+ vec3 c=mix(deep,col,smoothstep(0.05,0.45,d));
13536
+ return mix(c,core,smoothstep(0.45,1.02,d));
13537
+ }
13538
+ vec4 outPremul(vec3 hdr){
13539
+ vec3 s=pow(aces(max(hdr,0.0)),vec3(1.0/2.2));
13540
+ float a=clamp(max(s.r,max(s.g,s.b))*1.38,0.0,1.0);
13541
+ return vec4(s,a);
13542
+ }
13543
+ `,lx="varying vec2 vUv;void main(){vUv=uv;gl_Position=vec4(position.xy,0.0,1.0);}";function Ja(t,e,c,o=""){return`let mat,u;
13544
+ const VS=${JSON.stringify(lx)};
13545
+ const FS=${JSON.stringify(ix)} + ${JSON.stringify(t+`
13546
+ void main(){
13547
+ `+e+`
13548
+ }`)};
13549
+ function hex3(THREE,h,fb){const c=new THREE.Color(h||fb);return new THREE.Vector3(Math.pow(c.r,2.2),Math.pow(c.g,2.2),Math.pow(c.b,2.2));}
13550
+ function setup(THREE,scene,camera,env){
13551
+ const p=env.params||{};
13552
+ u={uTime:{value:0},uDur:{value:env.duration||0.65},uRes:{value:new THREE.Vector2(env.width||1280,env.height||720)},${c}};
13553
+ mat=new THREE.ShaderMaterial({vertexShader:VS,fragmentShader:FS,uniforms:u,transparent:true,depthTest:false,depthWrite:false});
13554
+ const mesh=new THREE.Mesh(new THREE.PlaneGeometry(2,2),mat);
13555
+ mesh.frustumCulled=false;scene.add(mesh);
13556
+ }
13557
+ function render(t,env){if(u){u.uTime.value=t;u.uDur.value=env.duration||0.65;u.uRes.value.set(env.width||1280,env.height||720);${o}}}`}const rx=Object.freeze({id:"vfx-weapon-slash",name:"Vệt chém kiếm khí",category:"VFX",kind:"three",duration:.6,params:{color:"#ff9a1a",core:"#fffdf2",angle:-18,arc:155,flip:!1,width:1,size:1,glow:1.2,speed:1,sparks:!0,seed:13},code:Ja(`uniform float uTime,uDur,uAngle,uArc,uFlip,uWidth,uSize,uGlow,uSpeed,uSparks,uSeed;
13558
+ uniform vec2 uRes,uPos;
13559
+ uniform vec3 uCol,uCore;`,`float spd=max(0.3,uSpeed),D=uDur/spd;
13560
+ if(uTime<0.0||uTime>D){gl_FragColor=vec4(0.0);return;}
13561
+ float u=uTime/D,asp=uRes.x/uRes.y;
13562
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13563
+ vec2 sp=(uv-uPos)*vec2(asp,1.0)/max(0.25,uSize);
13564
+ float ca=cos(-uAngle),sa=sin(-uAngle);
13565
+ sp=vec2(sp.x*ca-sp.y*sa,sp.x*sa+sp.y*ca);
13566
+ if(uFlip>0.5)sp.x=-sp.x;
13567
+ float curv=clamp(uArc/155.0,0.3,1.8)*0.22;
13568
+ float curveY=sp.y-curv*(sp.x*sp.x*1.5-0.14);
13569
+ float headX=mix(-0.48,0.68,pow(clamp(u/0.46,0.0,1.0),0.65));
13570
+ float tailX=mix(-0.62,0.28,pow(clamp((u-0.10)/0.85,0.0,1.0),1.25));
13571
+ float along=smoothstep(tailX,tailX+0.24,sp.x)*(1.0-smoothstep(headX-0.06,headX+0.05,sp.x));
13572
+ float fade=smoothstep(0.0,0.08,u)*pow(max(0.0,1.0-max(0.0,u-0.25)/0.75),1.3);
13573
+ float sf=fluidSilk(sp*vec2(4.2,7.5)-vec2(uTime*5.2,uSeed*0.3),uTime*2.4);
13574
+ float w=max(0.3,uWidth);
13575
+ float bladeCore=exp(-pow(curveY/(0.015*w+0.022*sf),2.0))*along;
13576
+ float bladeSheath=exp(-pow((curveY+0.014)/(0.068*w+0.058*sf),2.0))*along*smoothstep(0.18,0.86,sf);
13577
+ float val=(bladeCore*1.65+bladeSheath*1.15)*fade*uGlow;
13578
+ vec3 col=plasmaRamp(uCol,uCore,val*0.95)*val*1.25;
13579
+ // Optical anamorphic glint at leading tip
13580
+ vec2 tip=vec2(headX,curv*(headX*headX*1.5-0.14));
13581
+ vec2 td=sp-tip;
13582
+ col+=mix(uCol,uCore,0.65)*exp(-abs(td.y)*75.0)*exp(-abs(td.x)*3.5)*0.55*fade*(1.0-smoothstep(0.35,0.75,u))*uGlow;
13583
+ // Bokeh embers trailing off the turbulent wake
13584
+ if(uSparks>0.5){
13585
+ for(int i=0;i<24;i++){float fi=float(i)+uSeed;
13586
+ float q=fract(sin(fi*12.9898)*43758.5453),born=q*0.36,age=(u-born)/0.68;
13587
+ if(age<=0.0||age>=1.0)continue;
13588
+ float bx=mix(-0.42,0.58,q),by=curv*(bx*bx*1.5-0.14);
13589
+ vec2 vel=vec2(cos(fi*2.1)*0.16,sin(fi*3.7)*0.18-0.06);
13590
+ vec2 ep=vec2(bx,by)+vel*age;
13591
+ float d=length(sp-ep),rad=mix(0.003,0.009,fract(fi*0.41))*(1.0-age*0.5);
13592
+ col+=mix(uCol,uCore,fract(fi*0.61))*(exp(-d*d/(rad*rad))*1.3+exp(-d/(rad*3.5))*0.35)*pow(1.0-age,1.2)*fade*uGlow;
13645
13593
  }
13646
- ctx.save();if(blur*gl>0){ctx.shadowColor=p.color;ctx.shadowBlur=blur*gl}
13647
- ctx.beginPath();ctx.moveTo(left[0][0],left[0][1])
13648
- for(let i=1;i<L-1;i++){const mx=(left[i][0]+left[i+1][0])/2,my=(left[i][1]+left[i+1][1])/2;ctx.quadraticCurveTo(left[i][0],left[i][1],mx,my)}
13649
- ctx.lineTo(pts[L-1][0],pts[L-1][1])
13650
- for(let i=L-2;i>0;i--){const mx=(right[i][0]+right[i-1][0])/2,my=(right[i][1]+right[i-1][1])/2;ctx.quadraticCurveTo(right[i][0],right[i][1],mx,my)}
13651
- ctx.lineTo(right[0][0],right[0][1]);ctx.closePath()
13652
- const grad=ctx.createLinearGradient(pts[0][0],pts[0][1],pts[L-1][0],pts[L-1][1])
13653
- grad.addColorStop(0,M.rgba(col,0));grad.addColorStop(.35,M.rgba(col,alpha*.65));grad.addColorStop(.85,M.rgba(col,alpha));grad.addColorStop(1,M.rgba(p.core,alpha))
13654
- ctx.fillStyle=grad;ctx.fill();ctx.restore()
13655
- }
13656
- drawRibbon(2.55,p.color,.16*Math.min(1.6,gl),40*k)
13657
- drawRibbon(1.8,p.color,.36*Math.min(1.5,gl),26*k)
13658
- drawRibbon(1.02,p.color,.86,12*k)
13659
- drawRibbon(.40,p.core,.98,3*k)
13660
- // Silky curled plasma wisps trailing along the ribbon
13661
- ctx.lineCap='round'
13662
- for(let s=0;s<4;s++){ctx.beginPath()
13663
- for(let i=0;i<L;i++){const q=i/(L-1),w=Math.sin(q*Math.PI*3-t*10+s*1.7)*22*k*Math.sin(q*Math.PI);const px=pts[i][0]+norms[i][0]*w,py=pts[i][1]+norms[i][1]*w;i?ctx.lineTo(px,py):ctx.moveTo(px,py)}
13664
- ctx.strokeStyle=M.rgba(s%2?p.core:p.color,.16*Math.min(1.5,gl));ctx.lineWidth=(5+s*3)*k;ctx.stroke()}
13665
- // Head glow + trailing micro-sparks
13666
- if(gl>.05){const hd=pts[L-1],hr=44*k*(.6+.4*gl)
13667
- const g=ctx.createRadialGradient(hd[0],hd[1],0,hd[0],hd[1],hr);g.addColorStop(0,M.rgba(p.core,.95));g.addColorStop(.4,M.rgba(p.color,.55));g.addColorStop(1,M.rgba(p.color,0))
13668
- ctx.fillStyle=g;ctx.fillRect(hd[0]-hr,hd[1]-hr,hr*2,hr*2)}
13669
- if(p.sparks){const fr=Math.floor(t*(F||30)),rnd=M.rand(fr*173+19);ctx.fillStyle=M.rgba(p.core,.9);ctx.shadowColor=p.color;ctx.shadowBlur=8*k*gl
13670
- for(let i=0;i<14;i++){const idx=Math.max(1,Math.floor(rnd()*(L-1))),pt=pts[idx],nm=norms[idx],off=(rnd()-.5)*36*k,r=(1.4+rnd()*2.6)*k
13671
- ctx.beginPath();ctx.arc(pt[0]+nm[0]*off,pt[1]+nm[1]*off,r,0,Math.PI*2);ctx.fill()}}
13672
- ctx.restore()
13673
- }`}),Ic=[{id:"aurora-bg",name:"Nền aurora",category:"Nền",duration:6,params:{colorA:"#0b1026",colorB:"#6a3cff",colorC:"#00e0c6",speed:1},code:`function render(ctx,t,env){
13594
+ }
13595
+ gl_FragColor=outPremul(col);`,"uCol:{value:hex3(THREE,p.color,'#ff9a1a')},uCore:{value:hex3(THREE,p.core,'#fffdf2')},uPos:{value:new THREE.Vector2(p.x??0.5,p.y??0.5)},uAngle:{value:Number(p.angle??-18)*Math.PI/180},uArc:{value:Number(p.arc??155)},uFlip:{value:p.flip?1:0},uWidth:{value:Number(p.width??1)},uSize:{value:Number(p.size??1)},uGlow:{value:Number(p.glow??1.2)},uSpeed:{value:Number(p.speed??1)},uSparks:{value:p.sparks===false?0:1},uSeed:{value:Number(p.seed??13)}")}),xx=Object.freeze({id:"vfx-cross-slash",name:"Song trảm chữ thập",category:"VFX",kind:"three",duration:.65,params:{color:"#ff3b5c",core:"#fff5f7",angle:-32,spread:74,delay:.08,width:1,size:1,glow:1.2,speed:1,sparks:!0,seed:17},code:Ja(`uniform float uTime,uDur,uAngle,uSpread,uDelay,uWidth,uSize,uGlow,uSpeed,uSparks,uSeed;
13596
+ uniform vec2 uRes,uPos;
13597
+ uniform vec3 uCol,uCore;
13598
+ float evalStroke(vec2 p,float rot,float lt,float dur,float w,float seed){
13599
+ if(lt<=0.0||lt>=dur)return 0.0;
13600
+ float u=lt/dur,ca=cos(-rot),sa=sin(-rot);
13601
+ vec2 q=vec2(p.x*ca-p.y*sa,p.x*sa+p.y*ca);
13602
+ float head=mix(-0.55,0.62,pow(clamp(u/0.34,0.0,1.0),0.6));
13603
+ float tail=mix(-0.62,0.35,pow(clamp((u-0.16)/0.78,0.0,1.0),1.3));
13604
+ float along=smoothstep(tail,tail+0.22,q.x)*(1.0-smoothstep(head-0.05,head+0.04,q.x));
13605
+ float fade=smoothstep(0.0,0.06,u)*pow(max(0.0,1.0-max(0.0,u-0.22)/0.78),1.35);
13606
+ float sf=fluidSilk(q*vec2(4.8,8.5)-vec2(lt*6.0,seed),lt*2.5);
13607
+ float core=exp(-pow(q.y/(0.013*w+0.018*sf),2.0))*along;
13608
+ float sheath=exp(-pow(q.y/(0.058*w+0.048*sf),2.0))*along*smoothstep(0.2,0.85,sf);
13609
+ return (core*1.65+sheath*1.1)*fade;
13610
+ }`,`float spd=max(0.3,uSpeed),D=uDur/spd,dly=uDelay/spd;
13611
+ if(uTime<0.0||uTime>D){gl_FragColor=vec4(0.0);return;}
13612
+ float asp=uRes.x/uRes.y;
13613
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13614
+ vec2 p=(uv-uPos)*vec2(asp,1.0)/max(0.25,uSize);
13615
+ float s1=evalStroke(p,uAngle,uTime,D,uWidth,uSeed*0.2);
13616
+ float s2=evalStroke(p,uAngle+uSpread,uTime-dly,D-dly,uWidth,uSeed*0.5+3.1);
13617
+ float ft=uTime-dly,fl=(ft>0.0&&ft<0.36/spd)?smoothstep(0.0,0.025/spd,ft)*pow(1.0-ft/(0.36/spd),1.5):0.0;
13618
+ float r=length(p);
13619
+ float burst=(exp(-r*14.0)+exp(-abs(p.y)*85.0)*exp(-abs(p.x)*4.0)*0.85+exp(-abs(p.x)*85.0)*exp(-abs(p.y)*6.0)*0.65)*fl;
13620
+ float val=(s1+s2+burst*1.35)*uGlow;
13621
+ vec3 col=plasmaRamp(uCol,uCore,val*0.92)*val*1.2;
13622
+ if(uSparks>0.5&&ft>0.0){
13623
+ float age=clamp(ft/(D*0.75),0.0,1.0);
13624
+ for(int i=0;i<24;i++){float fi=float(i)+uSeed;
13625
+ float a=fi*2.39996,dist=mix(0.04,0.48,fract(sin(fi*41.2)*43758.5))*(1.0-exp(-4.2*age));
13626
+ float d=length(p-vec2(cos(a),sin(a))*dist),rad=mix(0.003,0.009,fract(fi*0.37))*(1.0-age*0.5);
13627
+ col+=mix(uCol,uCore,fract(fi*0.53))*(exp(-d*d/(rad*rad))*1.3+exp(-d/(rad*3.2))*0.3)*pow(1.0-age,1.2)*uGlow;
13628
+ }
13629
+ }
13630
+ gl_FragColor=outPremul(col);`,"uCol:{value:hex3(THREE,p.color,'#ff3b5c')},uCore:{value:hex3(THREE,p.core,'#fff5f7')},uPos:{value:new THREE.Vector2(p.x??0.5,p.y??0.5)},uAngle:{value:Number(p.angle??-32)*Math.PI/180},uSpread:{value:Number(p.spread??74)*Math.PI/180},uDelay:{value:Number(p.delay??0.08)},uWidth:{value:Number(p.width??1)},uSize:{value:Number(p.size??1)},uGlow:{value:Number(p.glow??1.2)},uSpeed:{value:Number(p.speed??1)},uSparks:{value:p.sparks===false?0:1},uSeed:{value:Number(p.seed??17)}")}),hx=Object.freeze({id:"vfx-clash-sparks",name:"Tia lửa giao kiếm",category:"VFX",kind:"three",duration:.8,params:{color:"#ffaa22",core:"#fffdf2",sparks:36,size:1,glow:1.2,flare:1.2,ring:!0,seed:23},code:Ja(`uniform float uTime,uDur,uSparks,uSize,uGlow,uFlare,uRing,uSeed;
13631
+ uniform vec2 uRes,uPos;
13632
+ uniform vec3 uCol,uCore;`,`if(uTime<0.0||uTime>uDur){gl_FragColor=vec4(0.0);return;}
13633
+ float u=uTime/uDur,asp=uRes.x/uRes.y;
13634
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13635
+ vec2 p=(uv-uPos)*vec2(asp,1.0)/max(0.25,uSize);
13636
+ float r=length(p);
13637
+ vec3 col=vec3(0.0);
13638
+ // 1. Expanding 6-octave turbulent fluid plasma shockwave (ZERO flat 2D circle!)
13639
+ if(uRing>0.5&&u<0.85){
13640
+ float ru=u/0.85,ringR=0.04+pow(ru,0.68)*0.68;
13641
+ float wf=fluidSilk(p*5.2+vec2(uSeed*0.2,-uTime*2.2),uTime*2.0);
13642
+ float ring=exp(-pow((r-ringR)/(0.026+0.036*wf),2.0))*(0.45+1.25*wf)*pow(1.0-ru,1.25)*uGlow;
13643
+ col+=plasmaRamp(uCol,uCore,ring*1.1)*ring*1.3;
13644
+ }
13645
+ // 2. Blazing optical 4-point anamorphic clash flare
13646
+ if(u<0.58&&uFlare>0.05){
13647
+ float fl=smoothstep(0.0,0.03,u)*pow(1.0-u/0.58,1.35)*uFlare*uGlow;
13648
+ float core=exp(-r*14.0)*1.35;
13649
+ float stH=exp(-abs(p.y)*75.0)*exp(-abs(p.x)*2.4)*1.15;
13650
+ float stV=exp(-abs(p.x)*85.0)*exp(-abs(p.y)*5.5)*0.65;
13651
+ col+=plasmaRamp(uCol,uCore,(core+stH+stV)*0.8)*(core+stH+stV)*fl;
13652
+ }
13653
+ // 3. High-velocity glowing bokeh sparks with gravity arcs & motion stretch
13654
+ int N=int(clamp(uSparks,0.0,60.0));
13655
+ for(int i=0;i<60;i++){if(i>=N)break;float fi=float(i)+uSeed;
13656
+ float a=fi*2.39996+fract(sin(fi*91.1)*43758.5)*0.5;
13657
+ float sp=0.45+fract(sin(fi*17.3)*43758.5)*0.95;
13658
+ float life=0.38+fract(sin(fi*53.7)*43758.5)*0.58,q=uTime/life;
13659
+ if(q>=1.0)continue;
13660
+ float drag=(1.0-exp(-3.2*uTime))/3.2;
13661
+ vec2 pos=vec2(cos(a)*sp*drag,sin(a)*sp*drag+0.42*uTime*uTime);
13662
+ vec2 vel=normalize(vec2(cos(a)*sp*exp(-3.2*uTime),sin(a)*sp*exp(-3.2*uTime)+0.84*uTime)+1e-4);
13663
+ vec2 d=p-pos;
13664
+ float along=dot(d,vel),perp=length(d-vel*along);
13665
+ float stretch=0.018*(1.0-q*0.6);
13666
+ float dist=length(vec2(max(0.0,abs(along)-stretch),perp));
13667
+ float rad=mix(0.0025,0.007,fract(fi*0.41))*(1.0-q*0.45);
13668
+ col+=mix(uCol,uCore,fract(fi*0.59))*(exp(-dist*dist/(rad*rad))*1.35+exp(-dist/(rad*3.5))*0.35)*pow(1.0-q,1.1)*uGlow;
13669
+ }
13670
+ gl_FragColor=outPremul(col);`,"uCol:{value:hex3(THREE,p.color,'#ffaa22')},uCore:{value:hex3(THREE,p.core,'#fffdf2')},uPos:{value:new THREE.Vector2(p.x??0.5,p.y??0.5)},uSparks:{value:Number(p.sparks??36)},uSize:{value:Number(p.size??1)},uGlow:{value:Number(p.glow??1.2)},uFlare:{value:Number(p.flare??1.2)},uRing:{value:p.ring===false?0:1},uSeed:{value:Number(p.seed??23)}")}),fx=Object.freeze({id:"vfx-energy-ribbon",name:"Vệt năng lượng chuyển động",category:"VFX",kind:"three",duration:3,params:{color:"#ff9a1a",core:"#fffdf2",width:1,length:.38,glow:1.25,sparks:!0,fps:30,t0:0,n:0},code:Ja(`uniform float uTime,uDur,uWidth,uGlow,uSparks;
13671
+ uniform int uCount;
13672
+ uniform vec2 uRes;
13673
+ uniform vec2 uPts[24];
13674
+ uniform vec3 uCol,uCore;`,`if(uCount<2){gl_FragColor=vec4(0.0);return;}
13675
+ float asp=uRes.x/uRes.y;
13676
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13677
+ vec2 p=uv*vec2(asp,1.0);
13678
+ float minD=1e5,bestQ=0.0;
13679
+ for(int i=0;i<23;i++){
13680
+ if(i>=uCount-1)break;
13681
+ vec2 a=uPts[i]*vec2(asp,1.0),b=uPts[i+1]*vec2(asp,1.0);
13682
+ vec2 ab=b-a;float h=clamp(dot(p-a,ab)/max(1e-5,dot(ab,ab)),0.0,1.0);
13683
+ float d=length(p-(a+ab*h));
13684
+ if(d<minD){minD=d;bestQ=(float(i)+h)/float(uCount-1);}
13685
+ }
13686
+ float taper=sin(pow(clamp(bestQ,0.0,1.0),0.65)*3.14159);
13687
+ float sf=fluidSilk(p*6.2-vec2(uTime*3.5,uTime*1.8),uTime*2.0);
13688
+ float w=max(0.3,uWidth);
13689
+ float core=exp(-pow(minD/(0.011*w*taper+0.004),2.0))*smoothstep(0.02,0.22,bestQ);
13690
+ float sheath=exp(-pow(minD/(0.048*w*taper+0.025*sf),2.0))*smoothstep(0.18,0.88,sf)*smoothstep(0.0,0.18,bestQ);
13691
+ vec2 hd=uPts[uCount-1]*vec2(asp,1.0);
13692
+ float headGlow=exp(-length(p-hd)*18.0)*0.95;
13693
+ float val=(core*1.55+sheath*1.15+headGlow)*uGlow;
13694
+ vec3 col=plasmaRamp(uCol,uCore,val*0.92)*val*1.2;
13695
+ gl_FragColor=outPremul(col);`,"uCol:{value:hex3(THREE,p.color,'#ff9a1a')},uCore:{value:hex3(THREE,p.core,'#fffdf2')},uWidth:{value:Number(p.width??1)},uGlow:{value:Number(p.glow??1.25)},uSparks:{value:p.sparks===false?0:1},uCount:{value:0},uPts:{value:Array.from({length:24},()=>new THREE.Vector2(0,0))}","const p=env.params||{},n=p.n|0;if(n>=2){let s='';for(let i=0;i<15;i++)s+=p['p'+i]||'';const at=i=>[parseInt(s.substr(i*4,2),36)/1295,parseInt(s.substr(i*4+2,2),36)/1295];const fps=p.fps||30,h=(t-(p.t0||0))*fps,tail=h-(p.length||0.38)*fps;if(h>=0&&tail<=n-1){const i0=Math.max(0,Math.ceil(tail)),i1=Math.min(n-1,Math.floor(h)),pts=[];if(tail>0&&i0>0){const a=at(i0-1),b=at(i0),f=tail-(i0-1);pts.push([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f]);}for(let i=i0;i<=i1;i++)pts.push(at(i));if(h<n-1&&i1+1<n){const a=at(i1),b=at(i1+1),f=h-i1;pts.push([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f]);}const cnt=Math.min(24,pts.length);u.uCount.value=cnt;for(let k=0;k<cnt;k++){const idx=cnt>1?Math.round(k*(pts.length-1)/(cnt-1)):0;u.uPts.value[k].set(pts[idx][0],pts[idx][1]);}}else u.uCount.value=0;}else u.uCount.value=0;")}),px=`
13696
+ precision highp float;
13697
+ varying vec2 vUv;
13698
+ float hash(vec2 p){p=fract(p*vec2(123.34,456.21));p+=dot(p,p+45.32);return fract(p.x*p.y);}
13699
+ float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+vec2(1,1)),f.x),f.y);}
13700
+ const mat2 R2=mat2(0.80,-0.60,0.60,0.80);
13701
+ float fbm(vec2 p){float v=0.0,a=0.5;for(int i=0;i<6;i++){v+=a*noise(p);p=R2*p*2.04+vec2(1.7,9.2);a*=0.5;}return v;}
13702
+ float fluidSilk(vec2 p,float t){
13703
+ vec2 q=vec2(fbm(p+vec2(0.0,-t*1.15)),fbm(p+vec2(5.2,1.3-t*0.95)));
13704
+ vec2 r=vec2(fbm(p+3.2*q+vec2(1.7,9.2-t*1.45)),fbm(p+3.2*q+vec2(8.3,2.8-t*1.2)));
13705
+ float f=fbm(p+2.6*r),ridge=1.0-abs(f*2.0-1.0);
13706
+ return mix(f*f,pow(ridge,2.6),0.52);
13707
+ }
13708
+ vec3 aces(vec3 x){return clamp((x*(2.51*x+0.03))/(x*(2.43*x+0.59)+0.14),0.0,1.0);}
13709
+ vec3 ramp3(vec3 c2,vec3 c1,vec3 c0,float d){
13710
+ vec3 c=mix(c2,c1,smoothstep(0.06,0.48,d));
13711
+ return mix(c,c0,smoothstep(0.48,1.02,d));
13712
+ }
13713
+ vec4 outPremul(vec3 hdr){
13714
+ vec3 s=pow(aces(max(hdr,0.0)),vec3(1.0/2.2));
13715
+ float a=clamp(max(s.r,max(s.g,s.b))*1.35,0.0,1.0);
13716
+ return vec4(s,a);
13717
+ }
13718
+ `,dx="varying vec2 vUv;void main(){vUv=uv;gl_Position=vec4(position.xy,0.0,1.0);}";function vo(t,e,c){return`let mat,u;
13719
+ const VS=${JSON.stringify(dx)};
13720
+ const FS=${JSON.stringify(px)} + ${JSON.stringify(t+`
13721
+ void main(){
13722
+ `+e+`
13723
+ }`)};
13724
+ function hex3(THREE,h,fb){const c=new THREE.Color(h||fb);return new THREE.Vector3(Math.pow(c.r,2.2),Math.pow(c.g,2.2),Math.pow(c.b,2.2));}
13725
+ function setup(THREE,scene,camera,env){
13726
+ const p=env.params||{};
13727
+ u={uTime:{value:0},uDur:{value:env.duration||3},uRes:{value:new THREE.Vector2(env.width||1280,env.height||720)},${c}};
13728
+ mat=new THREE.ShaderMaterial({vertexShader:VS,fragmentShader:FS,uniforms:u,transparent:true,depthTest:false,depthWrite:false});
13729
+ const mesh=new THREE.Mesh(new THREE.PlaneGeometry(2,2),mat);
13730
+ mesh.frustumCulled=false;scene.add(mesh);
13731
+ }
13732
+ function render(t,env){if(u){u.uTime.value=t;u.uDur.value=env.duration||3;u.uRes.value.set(env.width||1280,env.height||720);}}`}const gx=Object.freeze({id:"vfx-qi-core",name:"Tụ khí kết ấn",category:"VFX",kind:"three",duration:3,params:{color:"#ffae19",color2:"#b83200",core:"#fffdf2",swirl:1,silk:1,size:1,glow:1.15,speed:1,motes:40,x:.5,y:.5,seed:19},code:vo(`uniform float uTime,uDur,uSwirl,uSilk,uSize,uGlow,uSpeed,uMotes,uSeed;
13733
+ uniform vec2 uRes,uPos;
13734
+ uniform vec3 uCol,uCol2,uCore;`,`float t=uTime*uSpeed;
13735
+ float fade=smoothstep(0.0,0.28,uTime)*(1.0-smoothstep(uDur-0.38,uDur,uTime));
13736
+ if(fade<=0.002){gl_FragColor=vec4(0.0);return;}
13737
+ float asp=uRes.x/uRes.y;
13738
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13739
+ vec2 pp=(uv-uPos)*vec2(asp,1.0)/max(0.25,uSize);
13740
+ float r=length(pp);
13741
+ float twist=r*6.8*uSwirl-t*2.6;
13742
+ vec2 sw=vec2(pp.x*cos(twist)-pp.y*sin(twist),pp.x*sin(twist)+pp.y*cos(twist));
13743
+ float f=fluidSilk(sw*(6.2/max(0.3,uSilk))+vec2(uSeed*0.37,0.0),t*1.45);
13744
+ float envR=exp(-r*r/0.024);
13745
+ float outerWisp=exp(-r*r/0.085)*smoothstep(0.22,0.88,f);
13746
+ float pulse=0.93+0.07*sin(t*10.0);
13747
+ float starH=exp(-abs(pp.y)*95.0)*exp(-abs(pp.x)*9.5);
13748
+ float starV=exp(-abs(pp.x)*95.0)*exp(-abs(pp.y)*8.5);
13749
+ float coreDot=exp(-r*22.0);
13750
+ float qi=(outerWisp*1.15+envR*(0.52+0.95*f)+coreDot*1.25+(starH+starV)*0.82)*fade*pulse*uGlow;
13751
+ vec3 col=ramp3(uCol2,uCol,uCore,qi*0.92)*qi*1.15;
13752
+ // Subtle optical anamorphic streak
13753
+ col+=mix(uCol,uCore,0.5)*exp(-abs(pp.y)*55.0)*exp(-abs(pp.x)*2.4)*0.42*fade*uGlow;
13754
+ // Floating bokeh embers
13755
+ int M=int(clamp(uMotes,0.0,60.0));
13756
+ for(int i=0;i<60;i++){if(i>=M)break;float fi=float(i)+uSeed;
13757
+ float life=1.1+fract(sin(fi*78.233)*43758.5453)*1.3;
13758
+ float u=fract((t*0.6+fi*0.173)/life);
13759
+ float a0=fi*2.39996+u*1.6*uSwirl;
13760
+ vec2 ep=vec2(cos(a0),sin(a0))*mix(0.03,0.42,pow(u,0.85))-vec2(0.0,u*0.08);
13761
+ float d=length(pp-ep),rad=mix(0.003,0.011,fract(fi*0.37))*(1.0-u*0.45);
13762
+ col+=mix(uCol,uCore,fract(fi*0.61))*(exp(-d*d/(rad*rad))*1.2+exp(-d/(rad*3.5))*0.3)*sin(u*3.14159)*fade*uGlow;
13763
+ }
13764
+ gl_FragColor=outPremul(col);`,"uCol:{value:hex3(THREE,p.color,'#ffae19')},uCol2:{value:hex3(THREE,p.color2,'#b83200')},uCore:{value:hex3(THREE,p.core,'#fffdf2')},uPos:{value:new THREE.Vector2(p.x??0.5,p.y??0.5)},uSwirl:{value:Number(p.swirl??1)},uSilk:{value:Number(p.silk??1)},uSize:{value:Number(p.size??1)},uGlow:{value:Number(p.glow??1.15)},uSpeed:{value:Number(p.speed??1)},uMotes:{value:Number(p.motes??40)},uSeed:{value:Number(p.seed??19)}")}),ux=Object.freeze({id:"vfx-qi-aura",name:"Hào quang nội lực mịn",category:"VFX",kind:"three",duration:3.5,params:{color:"#ff9a1a",color2:"#a82600",core:"#fff8e0",intensity:1,flow:1,turbulence:1,width:1,height:1,glow:1.15,embers:40,x:.5,y:.72,seed:29},code:vo(`uniform float uTime,uDur,uIntensity,uFlow,uTurb,uWidth,uHeight,uGlow,uEmbers,uSeed;
13765
+ uniform vec2 uRes,uPos;
13766
+ uniform vec3 uCol,uCol2,uCore;`,`float t=uTime*uFlow;
13767
+ float fade=smoothstep(0.0,0.3,uTime)*(1.0-smoothstep(uDur-0.4,uDur,uTime));
13768
+ if(fade<=0.002){gl_FragColor=vec4(0.0);return;}
13769
+ float asp=uRes.x/uRes.y;
13770
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13771
+ vec2 ap=(uv-uPos)*vec2(asp/max(0.25,uWidth),1.0/max(0.25,uHeight));
13772
+ // Rising organic flame silhouette (wider at base, tapering fluidly upward)
13773
+ float riseMask=smoothstep(0.32,-0.15,ap.y)*smoothstep(-0.85,-0.12,ap.y);
13774
+ float taper=mix(0.42,0.16,clamp((-ap.y+0.15)/0.85,0.0,1.0));
13775
+ float shape=exp(-(ap.x*ap.x)/(taper*taper))*riseMask;
13776
+ float silk=fluidSilk(ap*vec2(4.2,2.6)*uTurb+vec2(uSeed*0.21,t*0.65),t*1.25);
13777
+ float d=smoothstep(0.14,0.88,silk*shape*2.15)*uIntensity*fade;
13778
+ vec3 col=ramp3(uCol2,uCol,uCore,d*0.92)*d*1.15*uGlow;
13779
+ // Rising golden bokeh embers
13780
+ int E=int(clamp(uEmbers,0.0,60.0));
13781
+ for(int i=0;i<60;i++){if(i>=E)break;float fi=float(i)+uSeed;
13782
+ float life=1.0+fract(sin(fi*78.233)*43758.5453)*1.4;
13783
+ float u=fract((t*0.7+fi*0.191)/life);
13784
+ float sx=(fract(sin(fi*12.9898)*43758.5453)-0.5)*0.68;
13785
+ vec2 ep=vec2(sx*(1.0-u*0.25)+sin(u*5.0+fi)*0.045,0.16-u*0.86);
13786
+ float dist=length(ap-ep),rad=mix(0.003,0.010,fract(fi*0.43))*(1.0-u*0.45);
13787
+ col+=mix(uCol,uCore,fract(fi*0.57))*(exp(-dist*dist/(rad*rad))*1.25+exp(-dist/(rad*3.6))*0.3)*sin(u*3.14159)*fade*uGlow;
13788
+ }
13789
+ gl_FragColor=outPremul(col);`,"uCol:{value:hex3(THREE,p.color,'#ff9a1a')},uCol2:{value:hex3(THREE,p.color2,'#a82600')},uCore:{value:hex3(THREE,p.core,'#fff8e0')},uPos:{value:new THREE.Vector2(p.x??0.5,p.y??0.72)},uIntensity:{value:Number(p.intensity??1)},uFlow:{value:Number(p.flow??1)},uTurb:{value:Number(p.turbulence??1)},uWidth:{value:Number(p.width??1)},uHeight:{value:Number(p.height??1)},uGlow:{value:Number(p.glow??1.15)},uEmbers:{value:Number(p.embers??40)},uSeed:{value:Number(p.seed??29)}")}),bx=Object.freeze({id:"vfx-yinyang-vortex",name:"Xoáy nội lực Âm Dương",category:"VFX",kind:"three",duration:3.5,params:{colorA:"#e6f9ff",colorB:"#080e1c",mistColor:"#38bdf8",ripple:1,size:1,speed:1,glow:1.1,motes:44,x:.5,y:.5,seed:37},code:vo(`uniform float uTime,uDur,uRipple,uSize,uSpeed,uGlow,uMotes,uSeed;
13790
+ uniform vec2 uRes,uPos;
13791
+ uniform vec3 uColA,uColB,uMist;`,`float t=uTime*uSpeed;
13792
+ float fade=smoothstep(0.0,0.3,uTime)*(1.0-smoothstep(uDur-0.4,uDur,uTime));
13793
+ if(fade<=0.002){gl_FragColor=vec4(0.0);return;}
13794
+ float asp=uRes.x/uRes.y;
13795
+ vec2 uv=vec2(vUv.x,1.0-vUv.y);
13796
+ vec2 p=(uv-uPos)*vec2(asp,1.0)/max(0.25,uSize);
13797
+ float r=length(p),ang=atan(p.y,p.x);
13798
+ float rot=ang-t*1.25+r*5.2;
13799
+ vec2 sw=vec2(cos(rot),sin(rot))*r;
13800
+ float f=fluidSilk(sw*5.2+vec2(uSeed*0.13,0.0),t*1.2);
13801
+ // Two opposing spiral currents (Yang bright fluid silk + Yin dark ink body with cyan rim)
13802
+ float spiral=sin(ang-t*1.35+r*7.2+f*2.2*uRipple);
13803
+ float ringEnv=exp(-pow((r-0.22)/0.16,2.0));
13804
+ float yang=smoothstep(0.05,0.85,spiral)*ringEnv*(0.55+0.85*f);
13805
+ float yin=smoothstep(0.05,0.85,-spiral)*ringEnv*(0.65+0.6*f);
13806
+ float outerRipple=exp(-r*r/0.22)*smoothstep(0.25,0.88,f)*0.55;
13807
+ vec3 col=uMist*outerRipple*uGlow;
13808
+ col+=mix(uMist,uColA,smoothstep(0.15,0.75,yang))*yang*1.35*uGlow;
13809
+ // Subtle icy rim around the obsidian Yin current
13810
+ float yinRim=smoothstep(0.1,0.45,yin)*(1.0-smoothstep(0.45,0.85,yin));
13811
+ col+=uMist*yinRim*0.55*uGlow;
13812
+ // Stardust motes
13813
+ int M=int(clamp(uMotes,0.0,60.0));
13814
+ for(int i=0;i<60;i++){if(i>=M)break;float fi=float(i)+uSeed;
13815
+ float a=fi*2.39996+t*(0.35+fract(fi*0.31)*0.45),rad=mix(0.09,0.48,fract(fi*0.67));
13816
+ float d=length(p-vec2(cos(a),sin(a))*rad),mr=mix(0.0025,0.007,fract(fi*0.41));
13817
+ float tw=0.45+0.55*sin(t*4.0+fi*2.1);
13818
+ col+=mix(uMist,uColA,0.6)*(exp(-d*d/(mr*mr))*1.2+exp(-d/(mr*3.2))*0.25)*tw*uGlow;
13819
+ }
13820
+ vec3 s=pow(aces(max(col*fade,0.0)),vec3(1.0/2.2));
13821
+ float darkAlpha=clamp(yin*0.72*fade,0.0,0.82);
13822
+ float lightAlpha=clamp(max(s.r,max(s.g,s.b))*1.35,0.0,1.0);
13823
+ vec3 finalRgb=mix(uColB,s,clamp(lightAlpha/(lightAlpha+darkAlpha+1e-4),0.0,1.0));
13824
+ gl_FragColor=vec4(finalRgb,clamp(max(lightAlpha,darkAlpha),0.0,1.0));`,"uColA:{value:hex3(THREE,p.colorA,'#e6f9ff')},uColB:{value:hex3(THREE,p.colorB,'#080e1c')},uMist:{value:hex3(THREE,p.mistColor,'#38bdf8')},uPos:{value:new THREE.Vector2(p.x??0.5,p.y??0.5)},uRipple:{value:Number(p.ripple??1)},uSize:{value:Number(p.size??1)},uSpeed:{value:Number(p.speed??1)},uGlow:{value:Number(p.glow??1.1)},uMotes:{value:Number(p.motes??44)},uSeed:{value:Number(p.seed??37)}")}),zc=[{id:"aurora-bg",name:"Nền aurora",category:"Nền",duration:6,params:{colorA:"#0b1026",colorB:"#6a3cff",colorC:"#00e0c6",speed:1},code:`function render(ctx,t,env){
13674
13825
  const {width:W,height:H,params:p}=env
13675
13826
  ctx.fillStyle=p.colorA;ctx.fillRect(0,0,W,H)
13676
13827
  ctx.globalCompositeOperation='lighter'
@@ -13958,4 +14109,4 @@ function render(ctx,t,env){
13958
14109
  const s=ctx.createLinearGradient(0,-size*.5,0,size*.15);s.addColorStop(0,'rgba(255,255,255,.4)');s.addColorStop(1,'rgba(255,255,255,0)')
13959
14110
  ctx.fillStyle=s;ctx.fillText(text,0,0)
13960
14111
  ctx.restore()
13961
- }`}];Ic.push(...fi),Ic.push(...hi),Ic.push(...ko),Ic.push(Jr),Ic.push(tx),Ic.push(ex,cx),Ic.push(ax,ox),Ic.push(nx,sx,ix,lx),Ic.push(...ro);const So={"lower-third":{text:"name",subText:"role",color:"accent"},"kinetic-title":{text:"text",subText:"sub",color:"accent"},"keyword-pop":{text:"text",color:"accent",placement:"position"},"progress-ring":{text:"label",color:"accent",numberValue:"to"},"particle-burst":{color:"color"},"aurora-bg":{color:"colorB"},vignette:{color:"color"},"film-grain":{},"light-leak":{color:"color"},letterbox:{color:"color"},vhs:{},"3d-coin-spin":{text:"text",subText:"sub",color:"color"},"3d-bar-chart":{text:"title",color:"color"},"3d-phone-cards":{text:"title",color:"color"},"m3d-extrude-title":{text:"text",color:"color",numberValue:"depth",booleanValue:"stand",angle:"tilt"},"3d-sparkle-star":{text:"text",color:"color"},"3d-bounce-ball-title":{text:"title",color:"color"},"3d-shape-morph":{text:"text",color:"color"},"3d-target-dart":{text:"text",color:"color"},"3d-gradient-bars":{text:"title",subText:"value",color:"color"},"3d-counter-orb":{text:"label",numberValue:"to",color:"color"},"c3d-monitor-pedestal":{text:"title",color:"color"},"c3d-phone-feed":{text:"text",subText:"big",color:"color"},"c3d-floating-chaos":{text:"title",color:"color"},"c3d-channel-hub":{text:"title",items:"items",color:"color"},"c3d-dashboard-live":{text:"label",subText:"value",color:"color"},"c3d-window-assemble":{text:"title",color:"color"},"c3d-orbit-shapes":{color:"color"},"c3d-plane-logo":{text:"url",subText:"name",color:"color"}};for(const t of hi){const e=o=>o in t.params,c={text:"text",color:"accent",placement:"position",style:"style"};e("sub")&&(c.subText="sub"),e("number")&&(c.numberValue="number"),e("items")&&(c.items="items"),e("posX")&&(c.posX="posX",c.posY="posY"),e("icon")&&(c.icon="icon"),e("glyph")&&(c.icon="glyph"),So[t.id]=c}for(const t of ro)So[t.id]=t.id==="particles"||t.params.emitter==="text"?{color:"color",text:"text"}:{color:"color"};for(const t of fi)So[t.id]="color"in t.params?{color:"color"}:{};Object.freeze(["heart","star","fire","bolt","cart","check","bell","play",...el.filter(t=>!["heart","star","fire","cart","check"].includes(t))]),Object.freeze([{id:"clean",name:"Lọc tạp âm",en:"Clean Voice",hint:"Bớt tiếng ồn nền, ù quạt, xì"},{id:"dereverb",name:"Giảm vang",en:"De-Reverb",hint:"Bớt tiếng vang phòng (mức nhẹ)"},{id:"enhance",name:"Giọng rõ hơn",en:"Enhance",hint:"Giọng sáng, rõ, đều hơn"},{id:"level",name:"Cân âm lượng",en:"Auto Level",hint:"Đưa về độ lớn chuẩn -16 LUFS"},{id:"master",name:"Hoàn thiện",en:"Master",hint:"Nén nhẹ, -14 LUFS, chống vỡ tiếng"}]).map(t=>t.id),Object.freeze([{id:"phone-row",label:"Dàn điện thoại",type:"phone"},{id:"phone-toss",label:"Điện thoại tung bay",type:"phone"},{id:"laptop-turn",label:"Laptop xoay",type:"laptop"}]).map(t=>t.id);const rx={person:["person","personPending","colorPerson","depthMap","matteFix","shocks","impacts","trail","hands","hud","face","smoothSlow","vfx","vfxShot","vfxFinish","vfxGlow","sceneTrack","objectTracks","pendingPin","join","freeze"],layer:["title","shape","card","motion","lottie","geo","element","solid","adjust","nullLayer","device","deviceScreen","bend","bendStrip","gen","clientJobs","mapAnno","modelAnim","modelRotation","modelSpin","modelGround","modelLook","modelLaunch","modelDepth"],sound:["audioFx","audioTools","muffle"]};new Map(Object.entries(rx).flatMap(([t,e])=>e.map(c=>[c,t])));const xx=["display","position","top","right","bottom","left","width","height","minWidth","minHeight","maxWidth","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","flex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyContent","gap","rowGap","columnGap","overflow","color","opacity","background","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","backgroundClip","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","boxShadow","boxSizing","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign","textTransform","textDecoration","textShadow","whiteSpace","wordBreak","textOverflow","lineClamp","transform","transformOrigin","objectFit","objectPosition"];new Set(xx);const Yc=Object.freeze({work:640,fps:30,longFps:15,long:20,maxFrames:600,seeds:240,minPoints:6,points:200,smooth:.3,smoothFrames:4,smoothTolPx:.35,keyTolPx:.05,max:6,regionPoints:[3,64],size:[.005,20],glue:{text:1.6,plane:1,null:.3,model:1}}),_c=t=>Math.round(t*1e6)/1e6,vo=t=>Math.round(t*1e3)/1e3,de=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],Uc=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],Kt=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],Ae=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],To=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],ta=t=>{const e=Math.hypot(...t)||1;return Kt(t,1/e)},gc=(t,e)=>[Ae(t[0],e),Ae(t[1],e),Ae(t[2],e)],Qc=t=>[0,1,2].map(e=>[t[0][e],t[1][e],t[2][e]]),Ja=(t,e)=>t.map(c=>[0,1,2].map(o=>c[0]*e[0][o]+c[1]*e[1][o]+c[2]*e[2][o])),bi=()=>[[1,0,0],[0,1,0],[0,0,1]],to=t=>{if(!t.length)return 0;const e=[...t].sort((c,o)=>c-o);return e[e.length>>1]},Mi=Math.PI/180;function yi(t,e,c){let o=!1;for(let n=0,s=t.length-1;n<t.length;s=n++){const[x,d]=t[n],[g,C]=t[s];d>c!=C>c&&e<(g-x)*(c-d)/(C-d)+x&&(o=!o)}return o}function hx(t){const e=[...t].sort((s,x)=>s[0]-x[0]||s[1]-x[1]);if(e.length<3)return e;const c=(s,x,d)=>(x[0]-s[0])*(d[1]-s[1])-(x[1]-s[1])*(d[0]-s[0]),o=[],n=[];for(const s of e){for(;o.length>=2&&c(o.at(-2),o.at(-1),s)<=0;)o.pop();o.push(s)}for(const s of[...e].reverse()){for(;n.length>=2&&c(n.at(-2),n.at(-1),s)<=0;)n.pop();n.push(s)}return[...o.slice(0,-1),...n.slice(0,-1)]}function fx(t,e,c,o){if(yi(t,e,c))return!0;for(let n=0,s=t.length-1;n<t.length;s=n++){const[x,d]=t[s],[g,C]=t[n],P=g-x,h=C-d,w=P*P+h*h,r=w?Math.max(0,Math.min(1,((e-x)*P+(c-d)*h)/w)):0;if(Math.hypot(x+r*P-e,d+r*h-c)<=o)return!0}return!1}function px(t,e,c,{n:o=Yc.seeds,minScore:n=1e-4,taken:s=[]}={}){const{w:x,h:d,data:g}=t,C=4,P=Math.max(C,Math.floor(c[0])),h=Math.max(C,Math.floor(c[1])),w=Math.min(x-C-1,Math.ceil(c[2])),r=Math.min(d-C-1,Math.ceil(c[3]));if(!(w>P&&r>h))return[];let f=0;for(let m=h;m<=r;m+=2)for(let V=P;V<=w;V+=2)e(V,m)&&(f+=4);const R=Math.max(5,Math.sqrt(f/Math.max(1,o))),X=[],j=(m,V)=>s.some(F=>Math.abs(F[0]-m)<R*.7&&Math.abs(F[1]-V)<R*.7);for(let m=h;m<=r;m+=R)for(let V=P;V<=w;V+=R){let F=null;for(let E=Math.round(m);E<Math.min(r+1,m+R);E++)for(let a=Math.round(V);a<Math.min(w+1,V+R);a++){if(!e(a,E))continue;let u=0,M=0,L=0;for(let $=-2;$<=2;$++)for(let z=-2;z<=2;z++){const U=(E+$)*x+a+z,at=(g[U+1]-g[U-1])/2,ft=(g[U+x]-g[U-x])/2;u+=at*at,M+=at*ft,L+=ft*ft}const i=(u+L)/2-Math.sqrt(((u-L)/2)**2+M*M);i>n&&(!F||i>F[2])&&(F=[a,E,i])}F&&!j(F[0],F[1])&&X.push([F[0],F[1]])}return X}const dx=(t,e,c,o,n)=>{const s=gc(t.R,de(e,t.C));return s[2]>-1e-6?null:[o+c*s[0]/-s[2],n-c*s[1]/-s[2]]},ea=(t,e,c,o,n,s)=>{const x=dx(t,e,o,n,s);return x?Math.hypot(x[0]-c[0],x[1]-c[1]):1e3},wi=(t,e,c,o,n,s)=>Uc(t.C,gc(Qc(t.R),[(e[0]-n)/o*c,-(e[1]-s)/o*c,-c]));function gx(t,e){const c=Math.cos(e),o=Math.sin(e),n=1-c;return[[c+t[0]*t[0]*n,t[0]*t[1]*n-t[2]*o,t[0]*t[2]*n+t[1]*o],[t[1]*t[0]*n+t[2]*o,c+t[1]*t[1]*n,t[1]*t[2]*n-t[0]*o],[t[2]*t[0]*n-t[1]*o,t[2]*t[1]*n+t[0]*o,c+t[2]*t[2]*n]]}function ux(t,e){if(e.length<4)return null;const c=Kt(e.reduce((f,R)=>Uc(f,R),[0,0,0]),1/e.length),o=[[0,0,0],[0,0,0],[0,0,0]];for(const f of e){const R=de(f,c);for(let X=0;X<3;X++)for(let j=0;j<3;j++)o[X][j]+=R[X]*R[j]}const{values:n,vectors:s}=Na(o),x=[0,1,2].reduce((f,R)=>n[R]<n[f]?R:f,0),d=gc(t.R,de(c,t.C)),g=ta(d),C=gc(t.R,s.map(f=>f[x])),P=de(Kt(g,2*Ae(C,g)),C),h=To(C,P),w=Math.hypot(...h);if(w<Math.sin(.5*Mi))return null;const r=Ja(gx(Kt(h,1/w),Math.atan2(w,Ae(C,P))),t.R);return{R:r,C:de(c,gc(Qc(r),d))}}function bx(t){const e=t.length,c=t.map(s=>[...s]),o=Array.from({length:e},(s,x)=>Array.from({length:e},(d,g)=>x===g?1:0));for(let s=0;s<60;s++){let x=0;for(let d=0;d<e;d++)for(let g=d+1;g<e;g++)x+=c[d][g]**2;if(x<1e-24)break;for(let d=0;d<e;d++)for(let g=d+1;g<e;g++){if(Math.abs(c[d][g])<1e-300)continue;const C=(c[g][g]-c[d][d])/(2*c[d][g]),P=Math.sign(C||1)/(Math.abs(C)+Math.sqrt(C*C+1)),h=1/Math.sqrt(P*P+1),w=P*h;for(let r=0;r<e;r++){const f=c[r][d],R=c[r][g];c[r][d]=h*f-w*R,c[r][g]=w*f+h*R}for(let r=0;r<e;r++){const f=c[d][r],R=c[g][r];c[d][r]=h*f-w*R,c[g][r]=w*f+h*R}for(let r=0;r<e;r++){const f=o[r][d],R=o[r][g];o[r][d]=h*f-w*R,o[r][g]=w*f+h*R}}}let n=0;for(let s=1;s<e;s++)c[s][s]<c[n][n]&&(n=s);return o.map(s=>s[n])}function Mx(t,e){if(t.length<8)return[];const c=Array.from({length:9},()=>new Array(9).fill(0));for(let E=0;E<t.length;E++){const[a,u]=t[E],[M,L]=e[E];for(const i of[[a,u,1,0,0,0,-M*a,-M*u,-M],[0,0,0,a,u,1,-L*a,-L*u,-L]])for(let $=0;$<9;$++)for(let z=0;z<9;z++)c[$][z]+=i[$]*i[z]}const o=bx(c),n=[[o[0],o[1],o[2]],[o[3],o[4],o[5]],[o[6],o[7],o[8]]],{values:s}=Na(Ja(Qc(n),n)),x=Math.sqrt([...s].sort((E,a)=>E-a)[1]);let d=n.map(E=>E.map(a=>a/x)),g=0;for(let E=0;E<t.length;E++)g+=Ae([e[E][0],e[E][1],1],gc(d,[t[E][0],t[E][1],1]))>0?1:-1;g<0&&(d=d.map(E=>E.map(a=>-a)));const{values:C,vectors:P}=Na(Ja(Qc(d),d)),h=[0,1,2].sort((E,a)=>C[a]-C[E]),w=C[h[0]],r=C[h[2]],f=P.map(E=>E[h[0]]),R=P.map(E=>E[h[1]]),X=P.map(E=>E[h[2]]);if(!(w-r>1e-9))return[];const j=Math.sqrt(w-r),m=Math.sqrt(Math.max(0,1-r))/j,V=Math.sqrt(Math.max(0,w-1))/j,F=[];for(const E of[Uc(Kt(f,m),Kt(X,V)),de(Kt(f,m),Kt(X,V))]){let a=ta(To(R,E));a[2]>0&&(a=Kt(a,-1)),F.push(a)}return F}function yx(t,e,{iters:c=80,thr:o=1}={}){const n=t.length;if(n<8)return null;let s=5;const x=()=>(s=s*1664525+1013904223>>>0)/2**32,d=r=>{const f=[[0,0,0],[0,0,0],[0,0,0]],R=[0,0,0],X=[0,0,0];for(const V of r){const F=[t[V][0],t[V][1],1];for(let E=0;E<3;E++){R[E]+=F[E]*e[V][0],X[E]+=F[E]*e[V][1];for(let a=0;a<3;a++)f[E][a]+=F[E]*F[a]}}const j=mi(f,R),m=mi(f,X);return j&&m?[j,m]:null},g=r=>t.map((f,R)=>Math.hypot(r[0][0]*f[0]+r[0][1]*f[1]+r[0][2]-e[R][0],r[1][0]*f[0]+r[1][1]*f[1]+r[1][2]-e[R][1]));let C=null,P=-1;for(let r=0;r<c;r++){const f=[Math.floor(x()*n),Math.floor(x()*n),Math.floor(x()*n)];if(f[0]===f[1]||f[1]===f[2]||f[0]===f[2])continue;const R=d(f);if(!R)continue;const X=g(R).filter(j=>j<o).length;X>P&&(P=X,C=R)}if(!C)return null;const h=g(C),w=d(h.map((r,f)=>r<o*1.5?f:-1).filter(r=>r>=0))??C;return g(w)}function wx(t){if(t.length<8)return null;const e=Kt(t.reduce((x,d)=>Uc(x,d),[0,0,0]),1/t.length),c=[[0,0,0],[0,0,0],[0,0,0]];for(const x of t){const d=de(x,e);for(let g=0;g<3;g++)for(let C=0;C<3;C++)c[g][C]+=d[g]*d[C]}const{values:o,vectors:n}=Na(c),s=[0,1,2].sort((x,d)=>o[x]-o[d]);return o[s[0]]<.15**2*o[s[1]]?{O:e,n:ta(n.map(x=>x[s[0]]))}:null}function mx(t,e,{w:c,h:o,f:n,region:s,follow:x,seed:d,onProgress:g=null,seeds:C=Yc.seeds}){const P=c/2,h=o/2,w=Yc.minPoints,r=Array.from({length:t},()=>new Map),f=new Map,R=new Map,X=new Map,j=new Map,m=new Array(t).fill(null);let V=0,F=0;const E=l=>[Math.min(...l.map(p=>p[0])),Math.min(...l.map(p=>p[1])),Math.max(...l.map(p=>p[0])),Math.max(...l.map(p=>p[1]))];m[e]={R:bi(),C:[0,0,0]};for(const l of d(e,(p,y)=>yi(s,p,y),[],E(s))){const p=V++;r[e].set(p,l),f.set(p,wi(m[e],l,1,n,P,h)),R.set(p,e)}if(f.size<10)throw Error("FLAT");const a=(l,p)=>f.has(l)&&(R.get(l)===e||Math.abs(p-R.get(l))>=3),u=l=>{f.delete(l);for(const p of r)p.delete(l)},M=(l,p)=>{const y=[...r[l]].filter(([k])=>a(k,l)).map(([k,I])=>[Math.hypot(I[0]-p[0],I[1]-p[1]),-gc(m[l].R,de(f.get(k),m[l].C))[2]]).sort((k,I)=>k[0]-I[0]).slice(0,6);return y.length?to(y.map(k=>k[1])):1},L=()=>{const l=m.map((y,k)=>y&&k!==e?k:-1).filter(y=>y>=0),p=Math.max(1,Math.ceil(l.length/20));Ka(m,f,r,[e,...l.filter((y,k)=>k%p===0||k===l.length-1)],n,P,h,4)},i=(l,p,y=!0)=>{const k=b=>b&&b.R.flat().every(Number.isFinite)&&b.C.every(Number.isFinite),I=b=>{let O;try{O=zi(l,b,n,P,h,1).pose}catch{return null}if(!k(O))return null;const Q=l.map(q=>ea(O,q.X,q.px,n,P,h));return{pose:O,res:Q,e:Q.reduce((q,v)=>q+Math.min(v,3),0)/Q.length}};let tt=I(p);const A=y&&ux(p,l.map(b=>b.X));if(k(A)){const b=I(A);b&&(!tt||b.e<tt.e*.98)&&(tt=b)}return tt??{pose:p,res:l.map(b=>ea(p,b.X,b.px,n,P,h)),e:1/0}},$=l=>{let p=new Map([...r[e]].filter(([k])=>f.has(k))),y=0;for(let k=e+l;k>=0&&k<t;k+=l){const I=[...p.keys()],tt=x(k-l,k,I.map(v=>p.get(v))),A=new Map;I.forEach((v,N)=>{tt[N]&&A.set(v,tt[N])});{const v=[...A.keys()],N=v.map(rt=>p.get(rt)),J=v.map(rt=>A.get(rt)),ot=yx(N,J);if(ot){const rt=Math.max(1,3*to(ot));v.forEach((zc,ca)=>{const ya=ot[ca]>rt?(j.get(zc)??0)+1:0;j.set(zc,ya),ya>=2&&(u(zc),A.delete(zc))})}}const b=()=>{const v=[...A].filter(([J])=>a(J,k));if(v.length<w)return null;const N=v.map(([J,ot])=>({X:f.get(J),px:ot}));return{...i(N,m[k-l],k%3===0),use:v}};let O=b();if(!O)break;const Q=Math.max(1.5,3*to(O.res));let q=0;for(const[v,N]of A){const rt=ea(O.pose,f.get(v),N,n,P,h)>(a(v,k)?Q:3*Q+4)?(X.get(v)??0)+1:0;X.set(v,rt),rt>=2&&(u(v),A.delete(v),q++)}if(q&&(O=b(),!O))break;m[k]=O.pose;for(const[v,N]of A)r[k].set(v,N);if(p=A,p.size<C*.7){const v=hx([...p].filter(([N])=>a(N,k)).map(([,N])=>N));if(v.length>=3){const N=Math.max(3,c*.012);for(const J of d(k,(ot,rt)=>fx(v,ot,rt,N),[...p.values()],E(v).map((ot,rt)=>ot+(rt<2?-N:N)))){const ot=V++;f.set(ot,wi(m[k],J,M(k,J),n,P,h)),R.set(ot,k),p.set(ot,J),r[k].set(ot,J)}}}++y>=15&&(y=0,L()),g?.(++F/t)}};$(1),$(-1);const z=m.map((l,p)=>l?p:-1).filter(l=>l>=0),U=Math.max(1,Math.ceil(z.length/36)),at=[e,...z.filter((l,p)=>l!==e&&(p%U===0||p===z.length-1))],ft=(l=!1,p=!1)=>{for(const y of z){if(!l&&at.includes(y))continue;const k=[];for(const[I,tt]of r[y])f.has(I)&&k.push({X:f.get(I),px:tt});k.length>=w&&y!==e&&(m[y]=i(k,m[y],p).pose)}},gt=()=>{let l=0;for(const p of at)for(const[y,k]of r[p])if(f.has(y)){const I=ea(m[p],f.get(y),k,n,P,h);l+=I<=2?I*I:4*I-4}return l},wt=wx([...r[e].keys()].filter(l=>f.has(l)).map(l=>f.get(l)));if(wt){const l=()=>({P:m.map(q=>q&&{R:q.R.map(v=>[...v]),C:[...q.C]}),X:new Map([...f].map(([q,v])=>[q,[...v]]))}),p=q=>{q.P.forEach((v,N)=>{m[N]=v&&{R:v.R.map(J=>[...J]),C:[...v.C]}}),f.clear();for(const[v,N]of q.X)f.set(v,[...N])},y=q=>{let v=0;for(const N of q)for(const[J,ot]of r[N])if(f.has(J)){const rt=ea(m[N],f.get(J),ot,n,P,h);v+=rt<=2?rt*rt:4*rt-4}return v},k=()=>{for(const q of[1,-1])for(let v=e+q;m[v];v+=q){const N=[];for(const[J,ot]of r[v])f.has(J)&&N.push({X:f.get(J),px:ot});m[v]=N.length>=w?i(N,m[v-q],!0).pose:{...m[v-q]}}},I=q=>[...r[e].keys()].filter(v=>r[q].has(v)&&f.has(v)),A=[z.find(q=>I(q).length>=12),[...z].reverse().find(q=>I(q).length>=12)].filter(q=>q!==void 0&&q!==e).map(q=>{const v=I(q),N=J=>[(J[0]-P)/n,(J[1]-h)/n];return Mx(v.map(J=>N(r[e].get(J))),v.map(J=>N(r[q].get(J))))}).filter(q=>q.length),b=[];if(A.length===2)for(const q of A[0]){const v=A[1].reduce((N,J)=>Ae(J,q)>Ae(N,q)?J:N);Ae(q,v)>Math.cos(15*Mi)&&b.push(ta(Uc(q,v)))}else A.length===1&&b.push(...A[0]);const O=l();let Q={cost:y(z),st:O};for(const q of b){const v=[q[0],-q[1],-q[2]];p(O);for(const J of r[e].keys()){const ot=f.get(J);if(!ot)continue;const rt=ta(ot),zc=Ae(v,rt);if(Math.abs(zc)>.05){const ca=Ae(v,wt.O)/zc;ca>0&&f.set(J,Kt(rt,ca))}}k(),Ka(m,f,r,at,n,P,h,8),ft(!0,!0);const N=y(z);N<Q.cost&&(Q={cost:N,st:l()})}p(Q.st)}for(let l=0;l<4;l++){ft(!0,l===0);const p=new Map;for(const I of z)for(const[tt,A]of r[I])f.has(tt)&&p.set(tt,Math.max(p.get(tt)??0,ea(m[I],f.get(tt),A,n,P,h)));const y=Math.max(1.5,2.5*to([...p.values()]));let k=0;for(const[I,tt]of p)tt>y&&(u(I),k++);if(Ka(m,f,r,at,n,P,h,8),ft(),!k&&l)break}for(let l=0,p=gt();l<8;l++){Ka(m,f,r,at,n,P,h,5);const y=gt();if(y>p*.998)break;p=y}return ft(!0),g?.(1),{poses:m,points:f,obs:r,ref:e}}function kx(t,e,{w:c,h:o,mw:n,mh:s,f:x,region:d,smooth:g=Yc.smooth,id:C="o1",name:P=""}){const{poses:h,points:w,obs:r,ref:f}=t,R=c/2,X=o/2,j=[...w.values()];if(j.length<Yc.minPoints)throw Error("FLAT");const m=Kt(j.reduce((A,b)=>Uc(A,b),[0,0,0]),1/j.length),V=h[f].C,F=h[f].R,E=Math.hypot(...de(m,V))||1,a=[[0,0,0],[0,0,0],[0,0,0]];for(const A of j){const b=de(A,m);for(let O=0;O<3;O++)for(let Q=0;Q<3;Q++)a[O][Q]+=b[O]*b[Q]}const{values:u,vectors:M}=Na(a),L=[0,1,2].sort((A,b)=>u[A]-u[b]),i=u[L[0]]<.08**2*u[L[1]];let $=Qc(F);if(i){let A=ta(M.map(q=>q[L[0]]));Ae(A,de(V,m))<0&&(A=Kt(A,-1));const b=gc(Qc(F),[1,0,0]),O=ta(de(b,Kt(A,Ae(A,b)))),Q=To(A,O);$=Qc([O,Q,A])}const z=A=>Kt(gc(Qc($),de(A,m)),1/E),U=h.map((A,b)=>A?b:-1).filter(A=>A>=0),at=Math.min(...U),ft=Math.max(...U),gt=[];for(let A=at;A<=ft;A++){const b=h[A]??h[gt.length?A-1:f];h[A]=b;const O=Ja(b.R,$),Q=Kt(gc(b.R,de(m,b.C)),1/E);let q=0,v=0;for(const[N,J]of r[A]){const ot=w.get(N);ot&&(q+=ea(b,ot,J,x,R,X),v++)}gt.push({t:e[A],R:O,T:Q,err:v?q/v:0,n:v})}const wt=new Map;for(const A of r)for(const b of A.keys())w.has(b)&&wt.set(b,(wt.get(b)??0)+1);const l=[...wt].sort((A,b)=>b[1]-A[1]).slice(0,Yc.points).map(([A])=>z(w.get(A))),p=l.map(A=>A[0]).sort((A,b)=>A-b),y=Math.max(1e-4,p[Math.floor(p.length*.98)]-p[Math.floor(p.length*.02)]),k=Sx(gt,l,x,g);let I=0,tt=0;for(const A of gt)I+=A.err*A.n,tt+=A.n;return{v:1,id:C,...P?{name:String(P).slice(0,40)}:{},w:c,h:o,mw:n||c,mh:s||o,f:_c(x),ref:_c(e[f]),region:d.map(A=>[vo(A[0]),vo(A[1])]),plane:i,width:_c(y),err:_c(tt?I/tt:0),smooth:g,frames:k.map((A,b)=>[_c(A.t),...Bo(A.R).map(_c),...A.T.map(_c),vo(gt[b].err),gt[b].n]),points:l.map(A=>A.map(_c))}}function Sx(t,e,c,o){if(!(o>0)||t.length<3)return t;const n=o*Yc.smoothFrames,s=Math.ceil(n*2.5),x=Yc.smoothTolPx,d=e.filter((h,w)=>w%Math.max(1,Math.floor(e.length/40))===0),g=(h,w)=>{const r=Uc(gc(h.R,w),h.T);return r[2]>-1e-6?null:[c*r[0]/-r[2],c*r[1]/-r[2]]},C=(h,w)=>{let r=0;for(const f of d){const R=g(h,f),X=g(w,f);R&&X&&(r=Math.max(r,Math.hypot(R[0]-X[0],R[1]-X[1])))}return r},P=t.map(h=>Bo(h.R));return t.map((h,w)=>{let r=0,f=[0,0,0],R=[0,0,0,0];for(let F=Math.max(0,w-s);F<=Math.min(t.length-1,w+s);F++){const E=Math.exp(-((F-w)**2)/(2*n*n)),a=vx(P[F],P[w])<0?P[F].map(u=>-u):P[F];r+=E,f=Uc(f,Kt(t[F].T,E)),R=R.map((u,M)=>u+a[M]*E)}const X=F=>{const E=P[w].map((u,M)=>u+(R[M]/r-u)*F),a=Math.hypot(...E);return{...h,R:Ri(E.map(u=>u/a)),T:Uc(h.T,Kt(de(Kt(f,1/r),h.T),F))}};let j=1,m=X(1),V=C(h,m);for(let F=0;F<6&&V>x;F++)j*=Math.max(.3,x/V*.95),m=X(j),V=C(h,m);return V>x?h:m})}const vx=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3];function mi(t,e){const c=n=>n[0][0]*(n[1][1]*n[2][2]-n[1][2]*n[2][1])-n[0][1]*(n[1][0]*n[2][2]-n[1][2]*n[2][0])+n[0][2]*(n[1][0]*n[2][1]-n[1][1]*n[2][0]),o=c(t);return Math.abs(o)>1e-30?[0,1,2].map(n=>c(t.map((s,x)=>s.map((d,g)=>g===n?e[x]:d)))/o):null}function Na(t){const e=t.map(o=>[...o]),c=bi();for(let o=0;o<40;o++){let n=0;for(let s=0;s<3;s++)for(let x=s+1;x<3;x++)n+=e[s][x]**2;if(n<1e-26)break;for(let s=0;s<3;s++)for(let x=s+1;x<3;x++){if(Math.abs(e[s][x])<1e-300)continue;const d=(e[x][x]-e[s][s])/(2*e[s][x]),g=Math.sign(d||1)/(Math.abs(d)+Math.sqrt(d*d+1)),C=1/Math.sqrt(g*g+1),P=g*C;for(let h=0;h<3;h++){const w=e[h][s],r=e[h][x];e[h][s]=C*w-P*r,e[h][x]=P*w+C*r}for(let h=0;h<3;h++){const w=e[s][h],r=e[x][h];e[s][h]=C*w-P*r,e[x][h]=P*w+C*r}for(let h=0;h<3;h++){const w=c[h][s],r=c[h][x];c[h][s]=C*w-P*r,c[h][x]=P*w+C*r}}}return{values:[e[0][0],e[1][1],e[2][2]],vectors:c}}const Tx=t=>{const e=new Float32Array(t.data.length);for(let c=0;c<e.length;c++)e[c]=t.data[c]/255;return{w:t.w,h:t.h,data:e}};function Cx(t,e,{ref:c,region:o,f:n,mw:s,mh:x,smooth:d,onProgress:g=null,id:C,name:P}={}){if(t.length<3)throw Error("FLAT");const h=t[0].w,w=t[0].h,r=new Map,f=X=>{let j=r.get(X);return j||(r.size>3&&r.delete(r.keys().next().value),j=Ti(Tx(t[X])),r.set(X,j)),j},R=mx(t.length,c,{w:h,h:w,f:n,region:o,onProgress:g,follow:(X,j,m)=>Ci(f(X),f(j),m),seed:(X,j,m,V)=>px(f(X)[0],j,V,{taken:m})});if(R.poses.filter(Boolean).length<Math.min(t.length,3))throw Error("LOST");return kx(R,e,{w:h,h:w,mw:s,mh:x,f:n,region:o,smooth:d,id:C,name:P})}self.onmessage=t=>{let e=-1;const c=o=>{(o-e>=.02||o>=1)&&(e=o,self.postMessage({type:"progress",u:o}))};try{self.postMessage({type:"done",result:Cx(t.data.frames,t.data.times,{...t.data.opts,onProgress:c})})}catch(o){self.postMessage({type:"error",message:o.message||String(o)})}}})();
14112
+ }`}];zc.push(...di),zc.push(...pi),zc.push(...So),zc.push(ex),zc.push(cx),zc.push(ax,ox),zc.push(nx,sx),zc.push(gx,ux,bx),zc.push(rx,xx,hx,fx),zc.push(...xo);const To={"lower-third":{text:"name",subText:"role",color:"accent"},"kinetic-title":{text:"text",subText:"sub",color:"accent"},"keyword-pop":{text:"text",color:"accent",placement:"position"},"progress-ring":{text:"label",color:"accent",numberValue:"to"},"particle-burst":{color:"color"},"aurora-bg":{color:"colorB"},vignette:{color:"color"},"film-grain":{},"light-leak":{color:"color"},letterbox:{color:"color"},vhs:{},"3d-coin-spin":{text:"text",subText:"sub",color:"color"},"3d-bar-chart":{text:"title",color:"color"},"3d-phone-cards":{text:"title",color:"color"},"m3d-extrude-title":{text:"text",color:"color",numberValue:"depth",booleanValue:"stand",angle:"tilt"},"3d-sparkle-star":{text:"text",color:"color"},"3d-bounce-ball-title":{text:"title",color:"color"},"3d-shape-morph":{text:"text",color:"color"},"3d-target-dart":{text:"text",color:"color"},"3d-gradient-bars":{text:"title",subText:"value",color:"color"},"3d-counter-orb":{text:"label",numberValue:"to",color:"color"},"c3d-monitor-pedestal":{text:"title",color:"color"},"c3d-phone-feed":{text:"text",subText:"big",color:"color"},"c3d-floating-chaos":{text:"title",color:"color"},"c3d-channel-hub":{text:"title",items:"items",color:"color"},"c3d-dashboard-live":{text:"label",subText:"value",color:"color"},"c3d-window-assemble":{text:"title",color:"color"},"c3d-orbit-shapes":{color:"color"},"c3d-plane-logo":{text:"url",subText:"name",color:"color"}};for(const t of pi){const e=o=>o in t.params,c={text:"text",color:"accent",placement:"position",style:"style"};e("sub")&&(c.subText="sub"),e("number")&&(c.numberValue="number"),e("items")&&(c.items="items"),e("posX")&&(c.posX="posX",c.posY="posY"),e("icon")&&(c.icon="icon"),e("glyph")&&(c.icon="glyph"),To[t.id]=c}for(const t of xo)To[t.id]=t.id==="particles"||t.params.emitter==="text"?{color:"color",text:"text"}:{color:"color"};for(const t of di)To[t.id]="color"in t.params?{color:"color"}:{};Object.freeze(["heart","star","fire","bolt","cart","check","bell","play",...al.filter(t=>!["heart","star","fire","cart","check"].includes(t))]),Object.freeze([{id:"clean",name:"Lọc tạp âm",en:"Clean Voice",hint:"Bớt tiếng ồn nền, ù quạt, xì"},{id:"dereverb",name:"Giảm vang",en:"De-Reverb",hint:"Bớt tiếng vang phòng (mức nhẹ)"},{id:"enhance",name:"Giọng rõ hơn",en:"Enhance",hint:"Giọng sáng, rõ, đều hơn"},{id:"level",name:"Cân âm lượng",en:"Auto Level",hint:"Đưa về độ lớn chuẩn -16 LUFS"},{id:"master",name:"Hoàn thiện",en:"Master",hint:"Nén nhẹ, -14 LUFS, chống vỡ tiếng"}]).map(t=>t.id),Object.freeze([{id:"phone-row",label:"Dàn điện thoại",type:"phone"},{id:"phone-toss",label:"Điện thoại tung bay",type:"phone"},{id:"laptop-turn",label:"Laptop xoay",type:"laptop"}]).map(t=>t.id);const Mx={person:["person","personPending","colorPerson","depthMap","matteFix","shocks","impacts","trail","hands","hud","face","smoothSlow","vfx","vfxShot","vfxFinish","vfxGlow","sceneTrack","objectTracks","pendingPin","join","freeze"],layer:["title","shape","card","motion","lottie","geo","element","solid","adjust","nullLayer","device","deviceScreen","bend","bendStrip","gen","clientJobs","mapAnno","modelAnim","modelRotation","modelSpin","modelGround","modelLook","modelLaunch","modelDepth"],sound:["audioFx","audioTools","muffle"]};new Map(Object.entries(Mx).flatMap(([t,e])=>e.map(c=>[c,t])));const yx=["display","position","top","right","bottom","left","width","height","minWidth","minHeight","maxWidth","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","flex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyContent","gap","rowGap","columnGap","overflow","color","opacity","background","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","backgroundClip","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","boxShadow","boxSizing","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign","textTransform","textDecoration","textShadow","whiteSpace","wordBreak","textOverflow","lineClamp","transform","transformOrigin","objectFit","objectPosition"];new Set(yx);const Yc=Object.freeze({work:640,fps:30,longFps:15,long:20,maxFrames:600,seeds:240,minPoints:6,points:200,smooth:.3,smoothFrames:4,smoothTolPx:.35,keyTolPx:.05,max:6,regionPoints:[3,64],size:[.005,20],glue:{text:1.6,plane:1,null:.3,model:1}}),_c=t=>Math.round(t*1e6)/1e6,Co=t=>Math.round(t*1e3)/1e3,de=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],Uc=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],Kt=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],Ae=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],Ao=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],ta=t=>{const e=Math.hypot(...t)||1;return Kt(t,1/e)},gc=(t,e)=>[Ae(t[0],e),Ae(t[1],e),Ae(t[2],e)],Qc=t=>[0,1,2].map(e=>[t[0][e],t[1][e],t[2][e]]),to=(t,e)=>t.map(c=>[0,1,2].map(o=>c[0]*e[0][o]+c[1]*e[1][o]+c[2]*e[2][o])),yi=()=>[[1,0,0],[0,1,0],[0,0,1]],eo=t=>{if(!t.length)return 0;const e=[...t].sort((c,o)=>c-o);return e[e.length>>1]},wi=Math.PI/180;function mi(t,e,c){let o=!1;for(let n=0,s=t.length-1;n<t.length;s=n++){const[x,d]=t[n],[g,C]=t[s];d>c!=C>c&&e<(g-x)*(c-d)/(C-d)+x&&(o=!o)}return o}function wx(t){const e=[...t].sort((s,x)=>s[0]-x[0]||s[1]-x[1]);if(e.length<3)return e;const c=(s,x,d)=>(x[0]-s[0])*(d[1]-s[1])-(x[1]-s[1])*(d[0]-s[0]),o=[],n=[];for(const s of e){for(;o.length>=2&&c(o.at(-2),o.at(-1),s)<=0;)o.pop();o.push(s)}for(const s of[...e].reverse()){for(;n.length>=2&&c(n.at(-2),n.at(-1),s)<=0;)n.pop();n.push(s)}return[...o.slice(0,-1),...n.slice(0,-1)]}function mx(t,e,c,o){if(mi(t,e,c))return!0;for(let n=0,s=t.length-1;n<t.length;s=n++){const[x,d]=t[s],[g,C]=t[n],P=g-x,h=C-d,w=P*P+h*h,r=w?Math.max(0,Math.min(1,((e-x)*P+(c-d)*h)/w)):0;if(Math.hypot(x+r*P-e,d+r*h-c)<=o)return!0}return!1}function kx(t,e,c,{n:o=Yc.seeds,minScore:n=1e-4,taken:s=[]}={}){const{w:x,h:d,data:g}=t,C=4,P=Math.max(C,Math.floor(c[0])),h=Math.max(C,Math.floor(c[1])),w=Math.min(x-C-1,Math.ceil(c[2])),r=Math.min(d-C-1,Math.ceil(c[3]));if(!(w>P&&r>h))return[];let f=0;for(let m=h;m<=r;m+=2)for(let V=P;V<=w;V+=2)e(V,m)&&(f+=4);const R=Math.max(5,Math.sqrt(f/Math.max(1,o))),X=[],j=(m,V)=>s.some(F=>Math.abs(F[0]-m)<R*.7&&Math.abs(F[1]-V)<R*.7);for(let m=h;m<=r;m+=R)for(let V=P;V<=w;V+=R){let F=null;for(let E=Math.round(m);E<Math.min(r+1,m+R);E++)for(let a=Math.round(V);a<Math.min(w+1,V+R);a++){if(!e(a,E))continue;let u=0,M=0,L=0;for(let $=-2;$<=2;$++)for(let z=-2;z<=2;z++){const U=(E+$)*x+a+z,at=(g[U+1]-g[U-1])/2,ft=(g[U+x]-g[U-x])/2;u+=at*at,M+=at*ft,L+=ft*ft}const i=(u+L)/2-Math.sqrt(((u-L)/2)**2+M*M);i>n&&(!F||i>F[2])&&(F=[a,E,i])}F&&!j(F[0],F[1])&&X.push([F[0],F[1]])}return X}const Sx=(t,e,c,o,n)=>{const s=gc(t.R,de(e,t.C));return s[2]>-1e-6?null:[o+c*s[0]/-s[2],n-c*s[1]/-s[2]]},ea=(t,e,c,o,n,s)=>{const x=Sx(t,e,o,n,s);return x?Math.hypot(x[0]-c[0],x[1]-c[1]):1e3},ki=(t,e,c,o,n,s)=>Uc(t.C,gc(Qc(t.R),[(e[0]-n)/o*c,-(e[1]-s)/o*c,-c]));function vx(t,e){const c=Math.cos(e),o=Math.sin(e),n=1-c;return[[c+t[0]*t[0]*n,t[0]*t[1]*n-t[2]*o,t[0]*t[2]*n+t[1]*o],[t[1]*t[0]*n+t[2]*o,c+t[1]*t[1]*n,t[1]*t[2]*n-t[0]*o],[t[2]*t[0]*n-t[1]*o,t[2]*t[1]*n+t[0]*o,c+t[2]*t[2]*n]]}function Tx(t,e){if(e.length<4)return null;const c=Kt(e.reduce((f,R)=>Uc(f,R),[0,0,0]),1/e.length),o=[[0,0,0],[0,0,0],[0,0,0]];for(const f of e){const R=de(f,c);for(let X=0;X<3;X++)for(let j=0;j<3;j++)o[X][j]+=R[X]*R[j]}const{values:n,vectors:s}=Na(o),x=[0,1,2].reduce((f,R)=>n[R]<n[f]?R:f,0),d=gc(t.R,de(c,t.C)),g=ta(d),C=gc(t.R,s.map(f=>f[x])),P=de(Kt(g,2*Ae(C,g)),C),h=Ao(C,P),w=Math.hypot(...h);if(w<Math.sin(.5*wi))return null;const r=to(vx(Kt(h,1/w),Math.atan2(w,Ae(C,P))),t.R);return{R:r,C:de(c,gc(Qc(r),d))}}function Cx(t){const e=t.length,c=t.map(s=>[...s]),o=Array.from({length:e},(s,x)=>Array.from({length:e},(d,g)=>x===g?1:0));for(let s=0;s<60;s++){let x=0;for(let d=0;d<e;d++)for(let g=d+1;g<e;g++)x+=c[d][g]**2;if(x<1e-24)break;for(let d=0;d<e;d++)for(let g=d+1;g<e;g++){if(Math.abs(c[d][g])<1e-300)continue;const C=(c[g][g]-c[d][d])/(2*c[d][g]),P=Math.sign(C||1)/(Math.abs(C)+Math.sqrt(C*C+1)),h=1/Math.sqrt(P*P+1),w=P*h;for(let r=0;r<e;r++){const f=c[r][d],R=c[r][g];c[r][d]=h*f-w*R,c[r][g]=w*f+h*R}for(let r=0;r<e;r++){const f=c[d][r],R=c[g][r];c[d][r]=h*f-w*R,c[g][r]=w*f+h*R}for(let r=0;r<e;r++){const f=o[r][d],R=o[r][g];o[r][d]=h*f-w*R,o[r][g]=w*f+h*R}}}let n=0;for(let s=1;s<e;s++)c[s][s]<c[n][n]&&(n=s);return o.map(s=>s[n])}function Ax(t,e){if(t.length<8)return[];const c=Array.from({length:9},()=>new Array(9).fill(0));for(let E=0;E<t.length;E++){const[a,u]=t[E],[M,L]=e[E];for(const i of[[a,u,1,0,0,0,-M*a,-M*u,-M],[0,0,0,a,u,1,-L*a,-L*u,-L]])for(let $=0;$<9;$++)for(let z=0;z<9;z++)c[$][z]+=i[$]*i[z]}const o=Cx(c),n=[[o[0],o[1],o[2]],[o[3],o[4],o[5]],[o[6],o[7],o[8]]],{values:s}=Na(to(Qc(n),n)),x=Math.sqrt([...s].sort((E,a)=>E-a)[1]);let d=n.map(E=>E.map(a=>a/x)),g=0;for(let E=0;E<t.length;E++)g+=Ae([e[E][0],e[E][1],1],gc(d,[t[E][0],t[E][1],1]))>0?1:-1;g<0&&(d=d.map(E=>E.map(a=>-a)));const{values:C,vectors:P}=Na(to(Qc(d),d)),h=[0,1,2].sort((E,a)=>C[a]-C[E]),w=C[h[0]],r=C[h[2]],f=P.map(E=>E[h[0]]),R=P.map(E=>E[h[1]]),X=P.map(E=>E[h[2]]);if(!(w-r>1e-9))return[];const j=Math.sqrt(w-r),m=Math.sqrt(Math.max(0,1-r))/j,V=Math.sqrt(Math.max(0,w-1))/j,F=[];for(const E of[Uc(Kt(f,m),Kt(X,V)),de(Kt(f,m),Kt(X,V))]){let a=ta(Ao(R,E));a[2]>0&&(a=Kt(a,-1)),F.push(a)}return F}function Rx(t,e,{iters:c=80,thr:o=1}={}){const n=t.length;if(n<8)return null;let s=5;const x=()=>(s=s*1664525+1013904223>>>0)/2**32,d=r=>{const f=[[0,0,0],[0,0,0],[0,0,0]],R=[0,0,0],X=[0,0,0];for(const V of r){const F=[t[V][0],t[V][1],1];for(let E=0;E<3;E++){R[E]+=F[E]*e[V][0],X[E]+=F[E]*e[V][1];for(let a=0;a<3;a++)f[E][a]+=F[E]*F[a]}}const j=Si(f,R),m=Si(f,X);return j&&m?[j,m]:null},g=r=>t.map((f,R)=>Math.hypot(r[0][0]*f[0]+r[0][1]*f[1]+r[0][2]-e[R][0],r[1][0]*f[0]+r[1][1]*f[1]+r[1][2]-e[R][1]));let C=null,P=-1;for(let r=0;r<c;r++){const f=[Math.floor(x()*n),Math.floor(x()*n),Math.floor(x()*n)];if(f[0]===f[1]||f[1]===f[2]||f[0]===f[2])continue;const R=d(f);if(!R)continue;const X=g(R).filter(j=>j<o).length;X>P&&(P=X,C=R)}if(!C)return null;const h=g(C),w=d(h.map((r,f)=>r<o*1.5?f:-1).filter(r=>r>=0))??C;return g(w)}function Px(t){if(t.length<8)return null;const e=Kt(t.reduce((x,d)=>Uc(x,d),[0,0,0]),1/t.length),c=[[0,0,0],[0,0,0],[0,0,0]];for(const x of t){const d=de(x,e);for(let g=0;g<3;g++)for(let C=0;C<3;C++)c[g][C]+=d[g]*d[C]}const{values:o,vectors:n}=Na(c),s=[0,1,2].sort((x,d)=>o[x]-o[d]);return o[s[0]]<.15**2*o[s[1]]?{O:e,n:ta(n.map(x=>x[s[0]]))}:null}function zx(t,e,{w:c,h:o,f:n,region:s,follow:x,seed:d,onProgress:g=null,seeds:C=Yc.seeds}){const P=c/2,h=o/2,w=Yc.minPoints,r=Array.from({length:t},()=>new Map),f=new Map,R=new Map,X=new Map,j=new Map,m=new Array(t).fill(null);let V=0,F=0;const E=l=>[Math.min(...l.map(p=>p[0])),Math.min(...l.map(p=>p[1])),Math.max(...l.map(p=>p[0])),Math.max(...l.map(p=>p[1]))];m[e]={R:yi(),C:[0,0,0]};for(const l of d(e,(p,y)=>mi(s,p,y),[],E(s))){const p=V++;r[e].set(p,l),f.set(p,ki(m[e],l,1,n,P,h)),R.set(p,e)}if(f.size<10)throw Error("FLAT");const a=(l,p)=>f.has(l)&&(R.get(l)===e||Math.abs(p-R.get(l))>=3),u=l=>{f.delete(l);for(const p of r)p.delete(l)},M=(l,p)=>{const y=[...r[l]].filter(([k])=>a(k,l)).map(([k,I])=>[Math.hypot(I[0]-p[0],I[1]-p[1]),-gc(m[l].R,de(f.get(k),m[l].C))[2]]).sort((k,I)=>k[0]-I[0]).slice(0,6);return y.length?eo(y.map(k=>k[1])):1},L=()=>{const l=m.map((y,k)=>y&&k!==e?k:-1).filter(y=>y>=0),p=Math.max(1,Math.ceil(l.length/20));Ka(m,f,r,[e,...l.filter((y,k)=>k%p===0||k===l.length-1)],n,P,h,4)},i=(l,p,y=!0)=>{const k=b=>b&&b.R.flat().every(Number.isFinite)&&b.C.every(Number.isFinite),I=b=>{let O;try{O=Wi(l,b,n,P,h,1).pose}catch{return null}if(!k(O))return null;const Q=l.map(q=>ea(O,q.X,q.px,n,P,h));return{pose:O,res:Q,e:Q.reduce((q,v)=>q+Math.min(v,3),0)/Q.length}};let tt=I(p);const A=y&&Tx(p,l.map(b=>b.X));if(k(A)){const b=I(A);b&&(!tt||b.e<tt.e*.98)&&(tt=b)}return tt??{pose:p,res:l.map(b=>ea(p,b.X,b.px,n,P,h)),e:1/0}},$=l=>{let p=new Map([...r[e]].filter(([k])=>f.has(k))),y=0;for(let k=e+l;k>=0&&k<t;k+=l){const I=[...p.keys()],tt=x(k-l,k,I.map(v=>p.get(v))),A=new Map;I.forEach((v,N)=>{tt[N]&&A.set(v,tt[N])});{const v=[...A.keys()],N=v.map(rt=>p.get(rt)),J=v.map(rt=>A.get(rt)),ot=Rx(N,J);if(ot){const rt=Math.max(1,3*eo(ot));v.forEach((Bc,ca)=>{const ya=ot[ca]>rt?(j.get(Bc)??0)+1:0;j.set(Bc,ya),ya>=2&&(u(Bc),A.delete(Bc))})}}const b=()=>{const v=[...A].filter(([J])=>a(J,k));if(v.length<w)return null;const N=v.map(([J,ot])=>({X:f.get(J),px:ot}));return{...i(N,m[k-l],k%3===0),use:v}};let O=b();if(!O)break;const Q=Math.max(1.5,3*eo(O.res));let q=0;for(const[v,N]of A){const rt=ea(O.pose,f.get(v),N,n,P,h)>(a(v,k)?Q:3*Q+4)?(X.get(v)??0)+1:0;X.set(v,rt),rt>=2&&(u(v),A.delete(v),q++)}if(q&&(O=b(),!O))break;m[k]=O.pose;for(const[v,N]of A)r[k].set(v,N);if(p=A,p.size<C*.7){const v=wx([...p].filter(([N])=>a(N,k)).map(([,N])=>N));if(v.length>=3){const N=Math.max(3,c*.012);for(const J of d(k,(ot,rt)=>mx(v,ot,rt,N),[...p.values()],E(v).map((ot,rt)=>ot+(rt<2?-N:N)))){const ot=V++;f.set(ot,ki(m[k],J,M(k,J),n,P,h)),R.set(ot,k),p.set(ot,J),r[k].set(ot,J)}}}++y>=15&&(y=0,L()),g?.(++F/t)}};$(1),$(-1);const z=m.map((l,p)=>l?p:-1).filter(l=>l>=0),U=Math.max(1,Math.ceil(z.length/36)),at=[e,...z.filter((l,p)=>l!==e&&(p%U===0||p===z.length-1))],ft=(l=!1,p=!1)=>{for(const y of z){if(!l&&at.includes(y))continue;const k=[];for(const[I,tt]of r[y])f.has(I)&&k.push({X:f.get(I),px:tt});k.length>=w&&y!==e&&(m[y]=i(k,m[y],p).pose)}},gt=()=>{let l=0;for(const p of at)for(const[y,k]of r[p])if(f.has(y)){const I=ea(m[p],f.get(y),k,n,P,h);l+=I<=2?I*I:4*I-4}return l},wt=Px([...r[e].keys()].filter(l=>f.has(l)).map(l=>f.get(l)));if(wt){const l=()=>({P:m.map(q=>q&&{R:q.R.map(v=>[...v]),C:[...q.C]}),X:new Map([...f].map(([q,v])=>[q,[...v]]))}),p=q=>{q.P.forEach((v,N)=>{m[N]=v&&{R:v.R.map(J=>[...J]),C:[...v.C]}}),f.clear();for(const[v,N]of q.X)f.set(v,[...N])},y=q=>{let v=0;for(const N of q)for(const[J,ot]of r[N])if(f.has(J)){const rt=ea(m[N],f.get(J),ot,n,P,h);v+=rt<=2?rt*rt:4*rt-4}return v},k=()=>{for(const q of[1,-1])for(let v=e+q;m[v];v+=q){const N=[];for(const[J,ot]of r[v])f.has(J)&&N.push({X:f.get(J),px:ot});m[v]=N.length>=w?i(N,m[v-q],!0).pose:{...m[v-q]}}},I=q=>[...r[e].keys()].filter(v=>r[q].has(v)&&f.has(v)),A=[z.find(q=>I(q).length>=12),[...z].reverse().find(q=>I(q).length>=12)].filter(q=>q!==void 0&&q!==e).map(q=>{const v=I(q),N=J=>[(J[0]-P)/n,(J[1]-h)/n];return Ax(v.map(J=>N(r[e].get(J))),v.map(J=>N(r[q].get(J))))}).filter(q=>q.length),b=[];if(A.length===2)for(const q of A[0]){const v=A[1].reduce((N,J)=>Ae(J,q)>Ae(N,q)?J:N);Ae(q,v)>Math.cos(15*wi)&&b.push(ta(Uc(q,v)))}else A.length===1&&b.push(...A[0]);const O=l();let Q={cost:y(z),st:O};for(const q of b){const v=[q[0],-q[1],-q[2]];p(O);for(const J of r[e].keys()){const ot=f.get(J);if(!ot)continue;const rt=ta(ot),Bc=Ae(v,rt);if(Math.abs(Bc)>.05){const ca=Ae(v,wt.O)/Bc;ca>0&&f.set(J,Kt(rt,ca))}}k(),Ka(m,f,r,at,n,P,h,8),ft(!0,!0);const N=y(z);N<Q.cost&&(Q={cost:N,st:l()})}p(Q.st)}for(let l=0;l<4;l++){ft(!0,l===0);const p=new Map;for(const I of z)for(const[tt,A]of r[I])f.has(tt)&&p.set(tt,Math.max(p.get(tt)??0,ea(m[I],f.get(tt),A,n,P,h)));const y=Math.max(1.5,2.5*eo([...p.values()]));let k=0;for(const[I,tt]of p)tt>y&&(u(I),k++);if(Ka(m,f,r,at,n,P,h,8),ft(),!k&&l)break}for(let l=0,p=gt();l<8;l++){Ka(m,f,r,at,n,P,h,5);const y=gt();if(y>p*.998)break;p=y}return ft(!0),g?.(1),{poses:m,points:f,obs:r,ref:e}}function Bx(t,e,{w:c,h:o,mw:n,mh:s,f:x,region:d,smooth:g=Yc.smooth,id:C="o1",name:P=""}){const{poses:h,points:w,obs:r,ref:f}=t,R=c/2,X=o/2,j=[...w.values()];if(j.length<Yc.minPoints)throw Error("FLAT");const m=Kt(j.reduce((A,b)=>Uc(A,b),[0,0,0]),1/j.length),V=h[f].C,F=h[f].R,E=Math.hypot(...de(m,V))||1,a=[[0,0,0],[0,0,0],[0,0,0]];for(const A of j){const b=de(A,m);for(let O=0;O<3;O++)for(let Q=0;Q<3;Q++)a[O][Q]+=b[O]*b[Q]}const{values:u,vectors:M}=Na(a),L=[0,1,2].sort((A,b)=>u[A]-u[b]),i=u[L[0]]<.08**2*u[L[1]];let $=Qc(F);if(i){let A=ta(M.map(q=>q[L[0]]));Ae(A,de(V,m))<0&&(A=Kt(A,-1));const b=gc(Qc(F),[1,0,0]),O=ta(de(b,Kt(A,Ae(A,b)))),Q=Ao(A,O);$=Qc([O,Q,A])}const z=A=>Kt(gc(Qc($),de(A,m)),1/E),U=h.map((A,b)=>A?b:-1).filter(A=>A>=0),at=Math.min(...U),ft=Math.max(...U),gt=[];for(let A=at;A<=ft;A++){const b=h[A]??h[gt.length?A-1:f];h[A]=b;const O=to(b.R,$),Q=Kt(gc(b.R,de(m,b.C)),1/E);let q=0,v=0;for(const[N,J]of r[A]){const ot=w.get(N);ot&&(q+=ea(b,ot,J,x,R,X),v++)}gt.push({t:e[A],R:O,T:Q,err:v?q/v:0,n:v})}const wt=new Map;for(const A of r)for(const b of A.keys())w.has(b)&&wt.set(b,(wt.get(b)??0)+1);const l=[...wt].sort((A,b)=>b[1]-A[1]).slice(0,Yc.points).map(([A])=>z(w.get(A))),p=l.map(A=>A[0]).sort((A,b)=>A-b),y=Math.max(1e-4,p[Math.floor(p.length*.98)]-p[Math.floor(p.length*.02)]),k=Wx(gt,l,x,g);let I=0,tt=0;for(const A of gt)I+=A.err*A.n,tt+=A.n;return{v:1,id:C,...P?{name:String(P).slice(0,40)}:{},w:c,h:o,mw:n||c,mh:s||o,f:_c(x),ref:_c(e[f]),region:d.map(A=>[Co(A[0]),Co(A[1])]),plane:i,width:_c(y),err:_c(tt?I/tt:0),smooth:g,frames:k.map((A,b)=>[_c(A.t),...Ho(A.R).map(_c),...A.T.map(_c),Co(gt[b].err),gt[b].n]),points:l.map(A=>A.map(_c))}}function Wx(t,e,c,o){if(!(o>0)||t.length<3)return t;const n=o*Yc.smoothFrames,s=Math.ceil(n*2.5),x=Yc.smoothTolPx,d=e.filter((h,w)=>w%Math.max(1,Math.floor(e.length/40))===0),g=(h,w)=>{const r=Uc(gc(h.R,w),h.T);return r[2]>-1e-6?null:[c*r[0]/-r[2],c*r[1]/-r[2]]},C=(h,w)=>{let r=0;for(const f of d){const R=g(h,f),X=g(w,f);R&&X&&(r=Math.max(r,Math.hypot(R[0]-X[0],R[1]-X[1])))}return r},P=t.map(h=>Ho(h.R));return t.map((h,w)=>{let r=0,f=[0,0,0],R=[0,0,0,0];for(let F=Math.max(0,w-s);F<=Math.min(t.length-1,w+s);F++){const E=Math.exp(-((F-w)**2)/(2*n*n)),a=Hx(P[F],P[w])<0?P[F].map(u=>-u):P[F];r+=E,f=Uc(f,Kt(t[F].T,E)),R=R.map((u,M)=>u+a[M]*E)}const X=F=>{const E=P[w].map((u,M)=>u+(R[M]/r-u)*F),a=Math.hypot(...E);return{...h,R:zi(E.map(u=>u/a)),T:Uc(h.T,Kt(de(Kt(f,1/r),h.T),F))}};let j=1,m=X(1),V=C(h,m);for(let F=0;F<6&&V>x;F++)j*=Math.max(.3,x/V*.95),m=X(j),V=C(h,m);return V>x?h:m})}const Hx=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3];function Si(t,e){const c=n=>n[0][0]*(n[1][1]*n[2][2]-n[1][2]*n[2][1])-n[0][1]*(n[1][0]*n[2][2]-n[1][2]*n[2][0])+n[0][2]*(n[1][0]*n[2][1]-n[1][1]*n[2][0]),o=c(t);return Math.abs(o)>1e-30?[0,1,2].map(n=>c(t.map((s,x)=>s.map((d,g)=>g===n?e[x]:d)))/o):null}function Na(t){const e=t.map(o=>[...o]),c=yi();for(let o=0;o<40;o++){let n=0;for(let s=0;s<3;s++)for(let x=s+1;x<3;x++)n+=e[s][x]**2;if(n<1e-26)break;for(let s=0;s<3;s++)for(let x=s+1;x<3;x++){if(Math.abs(e[s][x])<1e-300)continue;const d=(e[x][x]-e[s][s])/(2*e[s][x]),g=Math.sign(d||1)/(Math.abs(d)+Math.sqrt(d*d+1)),C=1/Math.sqrt(g*g+1),P=g*C;for(let h=0;h<3;h++){const w=e[h][s],r=e[h][x];e[h][s]=C*w-P*r,e[h][x]=P*w+C*r}for(let h=0;h<3;h++){const w=e[s][h],r=e[x][h];e[s][h]=C*w-P*r,e[x][h]=P*w+C*r}for(let h=0;h<3;h++){const w=c[h][s],r=c[h][x];c[h][s]=C*w-P*r,c[h][x]=P*w+C*r}}}return{values:[e[0][0],e[1][1],e[2][2]],vectors:c}}const Lx=t=>{const e=new Float32Array(t.data.length);for(let c=0;c<e.length;c++)e[c]=t.data[c]/255;return{w:t.w,h:t.h,data:e}};function Dx(t,e,{ref:c,region:o,f:n,mw:s,mh:x,smooth:d,onProgress:g=null,id:C,name:P}={}){if(t.length<3)throw Error("FLAT");const h=t[0].w,w=t[0].h,r=new Map,f=X=>{let j=r.get(X);return j||(r.size>3&&r.delete(r.keys().next().value),j=Ai(Lx(t[X])),r.set(X,j)),j},R=zx(t.length,c,{w:h,h:w,f:n,region:o,onProgress:g,follow:(X,j,m)=>Ri(f(X),f(j),m),seed:(X,j,m,V)=>kx(f(X)[0],j,V,{taken:m})});if(R.poses.filter(Boolean).length<Math.min(t.length,3))throw Error("LOST");return Bx(R,e,{w:h,h:w,mw:s,mh:x,f:n,region:o,smooth:d,id:C,name:P})}self.onmessage=t=>{let e=-1;const c=o=>{(o-e>=.02||o>=1)&&(e=o,self.postMessage({type:"progress",u:o}))};try{self.postMessage({type:"done",result:Dx(t.data.frames,t.data.times,{...t.data.opts,onProgress:c})})}catch(o){self.postMessage({type:"error",message:o.message||String(o)})}}})();