1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5050],{5050:function(e,a,i){i.d(a,{ImageDrawer:function(){return s}});var t=i(7363);class s{constructor(e){this.loadImageShape=async e=>{if(!this._engine.loadImage)throw Error(`${t.gK} image shape not initialized`);await this._engine.loadImage({gif:e.gif,name:e.name,replaceColor:e.replaceColor??!1,src:e.src})},this._engine=e}addImage(e){this._engine.images||(this._engine.images=[]),this._engine.images.push(e)}async draw(e){let{context:a,radius:t,particle:s,opacity:n}=e,l=s.image,g=l?.element;if(l){if(a.globalAlpha=n,l.gif&&l.gifData){let{drawGif:a}=await i.e(3082).then(i.bind(i,3082));a(e)}else if(g){let e=l.ratio,i={x:-t,y:-t},s=2*t;a.drawImage(g,i.x,i.y,s,s/e)}a.globalAlpha=1}}getSidesCount(){return 12}async init(e){let a=e.actualOptions;if(a.preload&&this._engine.loadImage)for(let e of a.preload)await this._engine.loadImage(e)}async loadShape(e){if("image"!==e.shape&&"images"!==e.shape)return;this._engine.images||(this._engine.images=[]);let a=e.shapeData;a&&(this._engine.images.find(e=>e.name===a.name||e.source===a.src)||(await this.loadImageShape(a),await this.loadShape(e)))}async particleInit(e,a){let t;if("image"!==a.shape&&"images"!==a.shape)return;this._engine.images||(this._engine.images=[]);let s=this._engine.images,n=a.shapeData;if(!n)return;let l=a.getFillColor(),g=s.find(e=>e.name===n.name||e.source===n.src);if(!g)return;let o=n.replaceColor??g.replaceColor;if(g.loading){setTimeout(()=>{this.particleInit(e,a)});return}if(g.svgData&&l){let{replaceImageColor:e}=await Promise.resolve().then(i.bind(i,4471));t=await e(g,n,l,a)}else t={color:l,data:g,element:g.element,gif:g.gif,gifData:g.gifData,gifLoopCount:g.gifLoopCount,loaded:!0,ratio:n.width&&n.height?n.width/n.height:g.ratio??1,replaceColor:o,source:n.src};t.ratio||(t.ratio=1);let r={image:t,fill:n.fill??a.shapeFill,close:n.close??a.shapeClose};a.image=r.image,a.shapeFill=r.fill,a.shapeClose=r.close}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.