// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../kernel ../../request ../../core/colorUtils ../../core/Error ../../core/has ../../libs/maquette/projection ../../libs/maquette/projector ./svgUtils ./utils".split(" "),function(t,y,z,u,A,B,H,C,D,E){function w(e,d){x.append(e,d);x.detach(d)}function F(e,d,b){return e?z(e,{responseType:"image"}).then(g=>{g=g.data;const q=g.width,a=g.height,l=q/a;let h=d;b&&(h=Math.min(h,Math.max(q,a)));return{image:g,width:1>=l?Math.ceil(h*l):h,height:1>=l?h:Math.ceil(h/l)}}):Promise.reject(new A("renderUtils: imageDataSize", "href not provided."))}const x=C.createProjector();t.renderOnce=w;t.renderSymbol=function(e,d,b){const g=Math.ceil(d[0]),q=Math.ceil(d[1]);if(!e.some(a=>!!a.length))return null;d=b?.node||document.createElement("div");null!=b.opacity&&(d.style.opacity=b.opacity.toString());null!=b.effectView&&(d.style.filter=E.getCSSFilterFromEffectList(b.effectView));w(d,()=>D.renderSVG(e,g,q,b));return d};t.tintImageWithColor=function(e,d,b,g,q){return F(e,d,q).then(a=>{const l=a.width??d,h=a.height??d;var f;if(f= a.image)f=b&&"ignore"!==g?"multiply"===g&&255===b.r&&255===b.g&&255===b.b&&1===b.a?!1:!0:!1;if(f){var c=a.image.width,m=a.image.height;B("edge")&&/\.svg$/i.test(e)&&(--c,--m);f=Math.ceil(l);var n=Math.ceil(h);var k=document.createElement("canvas");k.width=f;k.height=n;k.style.width=f+"px";k.style.height=n+"px";k=k.getContext("2d");k.clearRect(0,0,f,n);f=k;f.drawImage(a.image,0,0,c,m,0,0,l,h);n=f.getImageData(0,0,l,h);k=[b.r/255,b.g/255,b.b/255,b.a];const G=u.toHSV(b);for(let v=0;v({url:e,width:d,height:d}))};Object.defineProperty(t, Symbol.toStringTag,{value:"Module"})});