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