"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[4438],{4438:(t,a,e)=>{e.d(a,{loadTextShape:()=>o});var s=e(9201);const i=["text","character","char","multiline-text"];class n{constructor(){this._drawLine=(t,a,e,s,i,n)=>{const o={x:-a.length*e/2,y:e/2},r=2*e;n?t.fillText(a,o.x,o.y+r*i):t.strokeText(a,o.x,o.y+r*i)}}draw(t){const{context:a,particle:e,radius:i,opacity:n}=t,o=e.shapeData;if(!o)return;const r=o.value;if(void 0===r)return;void 0===e.text&&(e.text=(0,s.wA)(r,e.randomIndexData));const l=e.text,c=o.style??"",p=o.weight??"400",h=2*Math.round(i),d=o.font??"Verdana",u=e.shapeFill,x=l?.split("\n");if(x){a.font=`${c} ${p} ${h}px "${d}"`,a.globalAlpha=n;for(let t=0;t<x.length;t++)this._drawLine(a,x[t],i,n,t,u);a.globalAlpha=1}}async init(t){const a=t.actualOptions;if(i.find((t=>(0,s.dB)(t,a.particles.shape.type)))){const t=i.map((t=>a.particles.shape.options[t])).find((t=>!!t)),e=[];(0,s.KH)(t,(t=>{e.push((0,s.mx)(t.font,t.weight))})),await Promise.all(e)}}particleInit(t,a){if(!a.shape||!i.includes(a.shape))return;const e=a.shapeData;if(void 0===e)return;const n=e.value;void 0!==n&&(a.text=(0,s.wA)(n,a.randomIndexData))}}async function o(t,a=!0){await t.addShape(i,new n,a)}}}]);