// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/utils/htmlToSvg/supportClasses/drawing/_TextDrawer",["../ElementBuilder","../text/TextMeasurer"],function(g,n){return{drawText:function(p,a,q,r){var c=n.getLines(p,a,r);if(c){var h,k=a.isSpanLike?a.style.cw||c.textWidth:a.style.cw;h="center"===a.style.textAlign?"middle":"right"===a.style.textAlign?"end":"start";var l=[];c.lines.forEach(function(d,e){var f=30<=a.style.fontSize?6:5,b=0;a.isSpanLike&&"block"!==a.style.display?b=d.lineHeight-a.style.fontSize:(b=Math.max(2,
Math.round(a.style.fontSize/f)),b+=(d.lineHeight-a.style.fontSize)/2);var f=1<c.lines.length&&c.lines.length-1===e,m=0,m="center"===a.style.textAlign?k/2:"right"===a.style.textAlign?k+(f?-a.style.spanFlowEndOffset:0):0===e?a.style.spanFlowStartOffset:0,b=g.buildElement("text",{fill:a.style.color,x:a.box.x+a.style.paddings.l+a.style.border.l.width+m,y:a.box.y+a.style.paddings.t+(a.isSpanLike?0:a.style.border.t.width)+d.lineHeight*(e+1)-b,style:a.style.getTextStyle(void 0,a.isLink?{"text-decoration":"underline"}:
void 0),"text-anchor":h,opacity:a.style.opacity,transform:a.style.transform,clipParams:q},d.text);a.isLink&&(b=g.buildElement("a",{"xlink:href":a.href,target:a.target},b));l.push(b)});return l}}}});