"use strict";(self.webpackChunkfirebird=self.webpackChunkfirebird||[]).push([[1185],{1185:(x,d,r)=>{r.r(d),r.d(d,{TPolyLinePainter:()=>l});var o=r(467),_=r(6998),c=r(9041),P=r(675),m=r(9025),E=r(6714),u=r(6370);const f=(0,_.BIT)(14);class l extends P.JW{moveDrag(t,n){this.dx+=t,this.dy+=n,(0,c.bk)(this.draw_g.select("path"),this.dx,this.dy)}moveEnd(t){if(t)return;const n=this.getObject(),a=this.getAxisToSvgFunc(this.isndc);let e="";for(let s=0;s<=n.fLastPoint;++s){const h=this.svgToAxis("x",a.x(n.fX[s])+this.dx,this.isndc),i=this.svgToAxis("y",a.y(n.fY[s])+this.dy,this.isndc);n.fX[s]=h,n.fY[s]=i,e+=`SetPoint(${s},${h},${i});;`}this.submitCanvExec(e+"Notify();;"),this.redraw()}getUserRanges(){const t=this.getObject();if(t.TestBit(f)||!t.fLastPoint)return null;let a=t.fX[0],e=a,s=t.fY[0],h=s;for(let i=1;i<=t.fLastPoint;++i)a=Math.min(a,t.fX[i]),e=Math.max(e,t.fX[i]),s=Math.min(s,t.fY[i]),h=Math.max(h,t.fY[i]);return{minx:a,miny:s,maxx:e,maxy:h}}redraw(){this.createG();const t=this.getObject(),n=t.TestBit(f),a=this.getDrawOpt()||t.fOption,e=t._typename===_.clTPolyLine&&(0,_.isStr)(a)&&a.toLowerCase().indexOf("f")>=0,s=this.getAxisToSvgFunc(n);this.createAttLine({attr:t}),this.createAttFill({attr:t,enable:e});let h="";for(let i=0;i<=t.fLastPoint;++i)h+=`${i>0?"L":"M"}${s.x(t.fX[i])},${s.y(t.fY[i])}`;return this.draw_g.append("svg:path").attr("d",h+(e?"Z":"")).call(e?()=>{}:this.lineatt.func).call(this.fillatt.func),(0,u.wh)(this),(0,E.X2)(this),this.dx=this.dy=0,this.isndc=n,this}static draw(t,n,a){return(0,o.A)(function*(){const e=new l(t,n,a);return(0,m.ensureTCanvas)(e,!1).then(()=>e.redraw())})()}}}}]);