@syncfusion/ej2-progressbar
Version:
Essential JS 2 ProgressBar Component
10 lines • 78.2 kB
JavaScript
/*!
* filename: ej2-progressbar.umd.min.js
* version : 30.1.37
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base"],t):t((e=e||self).ej={},e.ej2Base,e.ej2SvgBase)}(this,function(e,S,k){"use strict";function z(e,t){this.x=e,this.y=t}B=function(e,t){return(B=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}))(e,t)};var B,M,t=function(e,t){function r(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},u=function(e,t,r,i){this.x=e,this.y=t,this.height=r,this.width=i},r=function(e,t){this.height=e,this.width=t},_=(M=k.PathOption,t(G,M),G);function G(e,t,r,i,o,n,a,s,l,c){e=M.call(this,e,t,r,i,o,c)||this;return e.y=n.y,e.x=n.x,e.height=n.height,e.width=n.width,e.rx=a||0,e.ry=s||0,e.transform=l||"",e.stroke=0!==r&&""!==e.stroke?i:"transparent",e}var i=function(e,t,r){this.r=e,this.g=t,this.b=r};function N(e){return"#"+o(e.r)+o(e.g)+o(e.b)}function o(e){e=e.toString(16);return 1===e.length?"0"+e:e}var U=function(e,t,r,i,o,n,a,s,l,c,p){this.id=e,this["font-size"]=t,this["font-style"]=r,this["font-family"]=i,this["font-weight"]=o,this["text-anchor"]=n,this.fill=a,this.x=s,this.y=l,this.width=c||0,this.height=p||0};function T(e,t,r,i){i=(i-90)*(Math.PI/180);return{x:e+r*Math.cos(i),y:t+r*Math.sin(i)}}function A(e,t,r,i,o,n,a){var s=T(e,t,r,i),l=T(e,t,r,o),c="0",p=n?"0":"1",c=n?(o<=i?i:i+360)-o<=180?"0":"1":(i<=o?o:o+360)-i<=180?"0":"1",n=a?"M "+e+" "+t+" L "+s.x+" "+s.y+" A "+r+" "+r+" 0 "+c+" "+p+" "+l.x+" "+l.y+" Z":"M"+s.x+" "+s.y+"A"+r+" "+r+" 0 "+c+" "+p+" "+l.x+" "+l.y;return n}function b(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function H(e,t){for(var r=Object.keys(e),i=0;i<r.length;i++)t.setAttribute(r[i],e[r[i]]);return t}function w(e,t,r,i,o){t+=o?-r:r;return(o?r:-r)*Math.cos(e/i*(Math.PI/2))+t}var j="annotationRender";function X(e){return document.getElementById(e)}function Y(e){if(!e)return null;e="string"==typeof e?X(e):e;e&&S.remove(e)}var V,n,a=function(e,t){this.x=e,this.y=t},t=(V=function(e,t){return(V=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}))(e,t)},function(e,t){function r(){this.constructor=e}V(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=function(e,t,r,i){var o,n=arguments.length,a=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;0<=s;s--)(o=e[s])&&(a=(n<3?o(a):3<n?o(t,r,a):o(t,r))||a);return 3<n&&a&&Object.defineProperty(t,r,a),a},q=(n=S.ChildProperty,t(l,n),s([S.Property(10)],l.prototype,"top",void 0),s([S.Property(10)],l.prototype,"bottom",void 0),s([S.Property(10)],l.prototype,"left",void 0),s([S.Property(10)],l.prototype,"right",void 0),l);function l(){return null!==n&&n.apply(this,arguments)||this}c=S.ChildProperty,t(p,c),s([S.Property("Normal")],p.prototype,"fontStyle",void 0),s([S.Property("16px")],p.prototype,"size",void 0),s([S.Property("Normal")],p.prototype,"fontWeight",void 0),s([S.Property("")],p.prototype,"color",void 0),s([S.Property("Segoe UI")],p.prototype,"fontFamily",void 0),s([S.Property(null)],p.prototype,"opacity",void 0),s([S.Property("Far")],p.prototype,"textAlignment",void 0),s([S.Property("")],p.prototype,"text",void 0);var c,$=p;function p(){return null!==c&&c.apply(this,arguments)||this}h=S.ChildProperty,t(d,h),s([S.Property(!1)],d.prototype,"enable",void 0),s([S.Property(2e3)],d.prototype,"duration",void 0),s([S.Property(0)],d.prototype,"delay",void 0);var h,Z=d;function d(){return null!==h&&h.apply(this,arguments)||this}g=S.ChildProperty,t(m,g),s([S.Property(null)],m.prototype,"content",void 0),s([S.Property(0)],m.prototype,"annotationAngle",void 0),s([S.Property("0%")],m.prototype,"annotationRadius",void 0);var g,J=m;function m(){return null!==g&&g.apply(this,arguments)||this}K=S.ChildProperty,t(ee,K),s([S.Property("")],ee.prototype,"color",void 0),s([S.Property(1)],ee.prototype,"width",void 0);var K,Q=ee;function ee(){return null!==K&&K.apply(this,arguments)||this}te=S.ChildProperty,t(y,te),s([S.Property(!1)],y.prototype,"enable",void 0),s([S.Property(null)],y.prototype,"fill",void 0),s([S.Property(null)],y.prototype,"format",void 0),s([S.Property(!1)],y.prototype,"showTooltipOnHover",void 0),s([S.Complex({fontFamily:null,size:"12px",fontWeight:null,fontStyle:"Normal",color:null},$)],y.prototype,"textStyle",void 0),s([S.Complex({color:"#cccccc",width:.5},Q)],y.prototype,"border",void 0);var te,re=y;function y(){return null!==te&&te.apply(this,arguments)||this}ie=S.ChildProperty,t(f,ie),s([S.Property("")],f.prototype,"color",void 0),s([S.Property(null)],f.prototype,"start",void 0),s([S.Property(null)],f.prototype,"end",void 0);var ie,t=f;function f(){return null!==ie&&ie.apply(this,arguments)||this}var L=.9,E=359.99,oe="valueChanged",ne="progressCompleted",ae="http://www.w3.org/2000/svg",se="tooltipRender",s=(v.prototype.render=function(e,t){return this.annotation=e,S.createElement("div",{id:this.control.element.id+"Annotation"+t,styles:"position:absolute;z-index:1",innerHTML:e.content})},v.prototype.processAnnotation=function(e,t,r){var i=new a(0,0),e=this.render(e,t);e?this.setElementStyle(i,e,r):this.control.redraw&&(Y(e.id),this.control.isReact)&&this.control.clearTemplate()},v.prototype.setElementStyle=function(e,t,r){t={cancel:!1,name:j,content:t,location:e};this.control.trigger(j,t),t.cancel||(e=this.Location(this.annotation.annotationRadius,this.annotation.annotationAngle),t.content.style.left=e.left+"px",t.content.style.top=e.top+"px",t.content.style.transform="translate(-50%, -50%)",t.content.setAttribute("aria-label","Annotation"),r.appendChild(t.content),this.control.isReact&&this.control.renderReactTemplates())},v.prototype.Location=function(e,t){var r,i,o,e=parseFloat(e);return{top:0===e&&0===t?(r=(i=this.control.progressRect).x+i.width/2,i.y+i.height/2):(t=(t-90)*(Math.PI/180),i=Math.round(this.control.progressSize.width/2.25),o=Math.round(this.control.progressSize.height/2.25),r=e*Math.cos(t)+i,e*Math.sin(t)+o),left:r}},v);function v(e){this.control=e}C.prototype.doLinearAnimation=function(e,t,r,i,o){var n=this,a=new S.Animation({}),s=e,l=t.isActive?3e3:t.animation.duration,c=s.getAttribute("width"),p=s.getAttribute("x"),h=0,d=0,u=t.enableRtl&&"Round4px"!==t.cornerRadius?parseInt(p,10):i,g=t.enableRtl&&"Round4px"!==t.cornerRadius?parseInt(c,10)-i:parseInt(c,10)-u,m=parseInt(p,10)-g;s.style.visibility="hidden",a.animate(s,{duration:0===t.animation.duration&&"Enable"===S.animationMode?2e3:l,delay:r,progress:function(e){t.cancelResize=!0,t.enableRtl&&"Round4px"!==t.cornerRadius?e.timeStamp>=e.delay&&(s.style.visibility="visible",t.isActive?(d=n.activeAnimate(e.timeStamp/e.duration,parseInt(p,10),parseInt(c,10),!0),h=w(e.timeStamp,.5,.5,e.duration,!0),o.setAttribute("opacity",h.toString())):d=w(e.timeStamp,u,g,e.duration,!0),s.setAttribute("x",d.toString())):e.timeStamp>=e.delay&&(s.style.visibility="visible",t.isActive?(d=n.activeAnimate(e.timeStamp/e.duration,0,parseInt(c,10),!1),h=w(e.timeStamp,.5,.5,e.duration,!0),o.setAttribute("opacity",h.toString())):d=w(e.timeStamp,u,g,e.duration,!1),s.setAttribute("width",d.toString()))},end:function(){t.cancelResize=!1,s.style.visibility="",t.enableRtl&&"Round4px"!==t.cornerRadius?t.isActive?(s.setAttribute("x",p.toString()),n.doLinearAnimation(e,t,r,i,o)):s.setAttribute("x",m.toString()):(s.setAttribute("width",c),t.isActive&&n.doLinearAnimation(e,t,r,i,o)),t.trigger("animationComplete",{value:t.value,trackColor:t.trackColor,progressColor:t.progressColor})}})},C.prototype.doLinearIndeterminate=function(e,t,r,i,o){var n=this,a=new S.Animation({}),s=e,l=s.getAttribute("x"),c=s.getAttribute("width"),p=0,h=c?-parseInt(c,10):-t,d=i.progressRect.x+i.progressRect.width+(c?parseInt(c,10):t),c=i.enableProgressSegments?i.animation.duration+1e3:i.animation.duration;a.animate(o,{duration:0===i.animation.duration&&"Enable"===S.animationMode?2e3:c,delay:0,progress:function(e){p=i.enableRtl&&"Round4px"!==i.cornerRadius?w(e.timeStamp,parseInt(l,10)||i.progressRect.x+t,d,e.duration,!0):w(e.timeStamp,h,d,e.duration,!1),i.enableProgressSegments?s.setAttribute("d",i.getPathLine(p,t,r)):s.setAttribute("x",p.toString())},end:function(){i.enableRtl&&!i.enableProgressSegments&&"Round4px"!==i.cornerRadius?s.setAttribute("x",l.toString()):i.enableProgressSegments||s.setAttribute("x",h.toString()),i.destroyIndeterminate||n.doLinearIndeterminate(e,t,r,i,o)}})},C.prototype.doStripedAnimation=function(e,t,r){var i=this,o=new S.Animation({}),n=1e3/t.animation.duration;o.animate(e,{duration:0===t.animation.duration&&"Enable"===S.animationMode?2e3:t.animation.duration,delay:t.animation.delay,progress:function(){r+=t.enableRtl?-n:n,e.setAttribute("gradientTransform","translate("+r+") rotate(-45)")},end:function(){t.destroyIndeterminate||i.doStripedAnimation(e,t,r)}})},C.prototype.doCircularAnimation=function(t,r,e,i,o,n,a,s,l,c,p,h){var d=this,u=new S.Animation({}),g=n,m=a.startAngle,y=e+s/2,f=0,b=0,v=a.isActive?3e3:a.animation.duration;if(m+="Round"===a.cornerRadius&&o!==E&&0!==o?a.enableRtl?.45*s:-.45*s:0,o+="Round"===a.cornerRadius&&o!==E&&0!==o?.45*s:0,i+="Round"===a.cornerRadius&&o!==E&&0!==o?a.enableRtl?-.45*s:.45*s:0,"Round"===a.cornerRadius&&o!==E&&0!==o&&a.startAngle===a.endAngle)for(var P=T(t,r,y,m).x,C=T(t,r,y,i).x;a.enableRtl!==180<=a.startAngle?C<=P:P<=C;)i+=a.enableRtl?.1:-.1,C=T(t,r,y,i).x;var F=S.isNullOrUndefined(c)?m:c,R=S.isNullOrUndefined(c)?o:o-p;g.setAttribute("visibility","Hidden"),u.animate(g,{duration:0===a.animation.duration&&"Enable"===S.animationMode?2e3:v,delay:l,progress:function(e){a.cancelResize=!0,e.timeStamp>=e.delay&&(g.setAttribute("visibility","visible"),a.isActive?(f=d.activeAnimate(e.timeStamp/e.duration,F,R,a.enableRtl),b=w(e.timeStamp,.5,.5,e.duration,!0),h.setAttribute("opacity",b.toString())):f=w(e.timeStamp,F,R,e.duration,a.enableRtl),g.setAttribute("d",A(t,r,y,m,f%360,a.enableRtl,!0)))},end:function(){a.cancelResize=!1,g.setAttribute("visibility",""),g.setAttribute("d",A(t,r,y,m,i,a.enableRtl,!0)),a.isActive&&d.doCircularAnimation(t,r,e,i,o,n,a,s,l,c,p,h),a.trigger("animationComplete",{value:a.value,trackColor:a.trackColor,progressColor:a.progressColor})}})},C.prototype.doCircularIndeterminate=function(e,t,r,i,o,n,a,s,l){var c=this,p=new S.Animation({}),h=a+(t.enableProgressSegments?0:s/2),d=0===t.animation.duration&&"Enable"===S.animationMode?2e3:t.animation.duration,u=t.enableProgressSegments?4e3/d:6e3/d;p.animate(l,{progress:function(){e.style.visibility="visible",r+=t.enableRtl?-u:u,i+=t.enableRtl?-u:u,e.setAttribute("d",A(o,n,h,r%360,i%360,t.enableRtl,!t.enableProgressSegments))},end:function(){t.destroyIndeterminate||c.doCircularIndeterminate(e,t,r,i,o,n,a,s,l)}})},C.prototype.doLabelAnimation=function(t,r,i,o,e,n){var a,s,l=new S.Animation({}),c=new S.Animation({}),p=t.innerHTML,h=0,d=0,u=0,g=o.labelStyle.text,m=o.labelStyle.textAlignment,y=parseInt(t.getAttribute("x"),10);t.setAttribute("visibility","Hidden"),"Linear"===o.type&&(a=(a=o.enableRtl?o.progressRect.x+o.progressRect.width+n/2:r-n/2)<=0?0:a,s=o.enableRtl?a-y:y-a),l.animate(t,{duration:0===o.animation.duration&&"Enable"===S.animationMode?2e3:o.animation.duration,delay:e,progress:function(e){o.cancelResize=!0,e.name="SlideRight","Linear"===o.type?e.timeStamp>=e.delay&&""===g&&(t.setAttribute("visibility","visible"),h=w(e.timeStamp,r,i,e.duration,!1),u=parseInt((Math.round(h)/o.progressRect.width*100).toString(),10),t.innerHTML=u.toString()+"%","Far"!==m&&"Center"!==m||(d=w(e.timeStamp,a,s,e.duration,o.enableRtl),t.setAttribute("x",d.toString()))):"Circular"===o.type&&""===g&&(t.setAttribute("visibility","visible"),h=w(e.timeStamp,r,i-r,e.duration,!1),u=parseInt((Math.round(h)/o.totalAngle*100).toString(),10),t.innerHTML=u.toString()+"%")},end:function(){o.cancelResize=!1,""===g?(t.innerHTML=p,t.setAttribute("x",y.toString())):c.animate(t,{progress:function(e){t.setAttribute("visibility","visible"),h=w(e.timeStamp,0,1,e.duration,!1),t.setAttribute("opacity",h.toString())},end:function(){t.setAttribute("opacity","1")}})}})},C.prototype.doAnnotationAnimation=function(e,t,r,i){var o,n,a,s,l=new S.Animation({}),c=0<t.annotations.length,p=t.startAngle,h=t.totalAngle,d=(c&&t.progressAnnotationModule&&(n=document.getElementById(t.element.id+"Annotation0").children[0])&&n.children[0]&&"SPAN"===n.children[0].tagName&&(o=n.children[0]),n=(t.argsData.value-t.minimum)/(t.maximum-t.minimum)*t.totalAngle,t.annotateTotal=n=t.argsData.value<t.minimum?0:n,t.annotateEnd=p+n,s=(t.argsData.value-t.minimum)/(t.maximum-t.minimum)*100,s=t.argsData.value<t.minimum?0:Math.round(s),S.isNullOrUndefined(r)?p:r),u=S.isNullOrUndefined(r)?n:n-i;t.argsData.value<=t.minimum?o.innerHTML=s+"%":l.animate(e,{duration:0===t.animation.duration&&"Enable"===S.animationMode?2e3:t.animation.duration,delay:t.animation.delay,progress:function(e){t.cancelResize=!0,c&&o&&(a=w(e.timeStamp,d,u,e.duration,!1),a=parseInt(((Math.round(a)-p)/h*100).toString(),10),o.innerHTML=a?a.toString()+"%":"0%")},end:function(){t.cancelResize=!1,o.innerHTML=s+"%"}})},C.prototype.activeAnimate=function(e,t,r,i){e=1-Math.pow(1-e,3);return t+(i?-e*r:e*r)};var P=C;function C(){}le=function(e,t){return(le=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}))(e,t)};(function(e,t){function r(){this.constructor=e}le(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(F,ce=s),F.prototype.renderAnnotations=function(e){var r=this,t=(this.annotations=this.progress.annotations,document.getElementById(this.progress.element.id+"Annotation_collections"));this.parentElement=t||S.createElement("div",{id:this.progress.element.id+"Annotation_collections",styles:"position:absolute"}),this.annotations.map(function(e,t){r.processAnnotation(e,t,r.parentElement)}),t||e.appendChild(this.parentElement),this.progress.animation.enable&&!this.progress.isIndeterminate&&this.animation.doAnnotationAnimation(this.progress.clipPath,this.progress)},F.prototype.getModuleName=function(){return"ProgressAnnotation"},F.prototype.destroy=function(){};var le,ce,s=F;function F(e,t){var r=ce.call(this,e)||this;return r.animation=new P,r.progress=e,r.annotations=t,r}R.prototype.tooltip=function(e){var t,r=document.getElementById(this.control.element.id+"_tooltip"),i=r&&0<parseInt(r.getAttribute("opacity"),10);this.previousPosition=r.style.left?parseInt(r.style.left,10):0,this.renderTooltip(e,this.control,!i),this.control.tooltip.enable&&"Circular"===this.control.type&&this.control.animation.enable&&!this.control.tooltip.showTooltipOnHover&&(r.style.visibility="hidden",t=this.control.secondaryProgress?this.control.circular.delay+this.control.animation.duration:this.control.animation.duration,this.tooltipDelay(this.control,r,t)),this.control.animation.enable&&!this.control.tooltip.showTooltipOnHover&&"Circular"!==this.control.type&&(t=(this.control.secondaryProgress?this.control.linear:this.control.animation).delay,this.control.secondaryProgress&&(r.style.visibility="hidden"),this.toolTipAnimation(r,this.control,t))},R.prototype.tooltipDelay=function(e,t,r){new S.Animation({}).animate(t,{duration:e.animation.duration,delay:r,progress:function(e){e.element.style.visibility="visible"}})},R.prototype.toolTipAnimation=function(e,i,t){var o=this,r=new S.Animation({}),n=parseInt(e.style.left,10),a=document.getElementById(this.control.element.id+"_tooltip_svg"),s=parseInt(a.getAttribute("width"),10);r.animate(e,{duration:i.animation.duration,delay:t,progress:function(e){var t,r;i.cancelResize=!0,e.name="SlideRight","Linear"===i.type&&e.timeStamp>=e.delay&&(e.element.style.visibility="visible",r=o.previousPosition||0-(s/2-o.control.progressRect.x-5),t=o.previousPosition?n-r:n+(s/2-o.control.progressRect.x-5),r=w(e.timeStamp,r,t,e.duration,i.enableRtl),e.element.style.left="",e.element.style.left=r+"px".toString())},end:function(e){i.cancelResize=!1,e.element.style.left="",e.element.style.left=n+"px".toString()}})},R.prototype.renderTooltip=function(e,t,r){this.textFormat=this.format(this.control.tooltip.showTooltipOnHover&&(0<=e.target.id.indexOf("Linearbuffer")||0<=e.target.id.indexOf("Circularbuffer"))?this.control.secondaryProgress:this.control.value),this.triggerTooltipRender(e,r,this.textFormat)},R.prototype.format=function(e){var t,r=e.toString();return this.control.tooltip.format&&(r=this.control.tooltip.format,t=new RegExp("${value}","gm"),r=r.replace(t.source,e.toString())),r},R.prototype.removeTooltip=function(e){var t=this;document.getElementById(this.control.element.id+"_tooltip")&&(this.fadeInInterval=+setTimeout(function(){t.svgTooltip&&t.svgTooltip.fadeOut()},e))},R.prototype.triggerTooltipRender=function(e,t,r){var i={cancel:!1,name:se,text:r+"%"};this.control.trigger(se,i),r=i.text,i.cancel||(this.text=[].concat(i.text),"Linear"===this.control.type?(r=this.control.linear.linearProgressWidth-2.5+this.control.progressRect.x,i="Round4px"===this.control.cornerRadius?this.control.progressRect.y+5:this.control.progressRect.y+this.control.progressRect.height/2-(this.control.progressThickness||this.control.themeStyle.linearProgressThickness)/2+5,this.createTooltip(this.control,t,(!this.control.tooltip.enable||this.control.tooltip.showTooltipOnHover)&&0<=e.target.id.indexOf("Linearbuffer")?new a(this.control.linear.bufferWidth-2.5+this.control.progressRect.x,i):new a("Round4px"===this.control.cornerRadius?r-5:r,i),this.control.initialClipRect)):(r=this.control.circular.endPosition.x-2.5,i=this.control.circular.endPosition.y+this.control.progressRect.y-2.5,this.createTooltip(this.control,t,(!this.control.tooltip.enable||this.control.tooltip.showTooltipOnHover)&&0<=e.target.id.indexOf("Circularbuffer")?new a(this.control.circular.bufferEndPosition.x-2.5,this.control.circular.bufferEndPosition.y+this.control.progressRect.y-2.5):new a(r,i),this.control.initialClipRect))),this.isRendered=!0},R.prototype.createTooltip=function(e,t,r,i){var o=S.extend({},this.control.tooltip.textStyle,null,!0);o.fontWeight=o.fontWeight||this.control.themeStyle.tooltipLabelFont.fontWeight,t?this.svgTooltip=new k.Tooltip({opacity:this.control.tooltip.textStyle.opacity||("Material3"===this.control.theme||"Material3Dark"===this.control.theme||-1<this.control.theme.indexOf("Bootstrap5")?1:.75),header:"",content:this.text,fill:this.control.tooltip.fill,border:this.control.tooltip.border,enableAnimation:!0,location:r,theme:this.control.theme,areaBounds:i,template:null,offset:7.5,marginX:8,marginY:4.5,textStyle:o,arrowPadding:7,availableSize:this.control.progressSize,duration:300,blazorTemplate:{name:"Template",parent:this.control.tooltip},controlInstance:this.control,enableRTL:e.enableRtl,controlName:"Progressbar"},"#"+this.control.element.id+"_tooltip"):this.svgTooltip&&(this.svgTooltip.location=r,this.svgTooltip.content=this.text,this.svgTooltip.header="",this.svgTooltip.offset=7.5,this.svgTooltip.textStyle=o,this.svgTooltip.areaBounds=i,this.svgTooltip.arrowPadding=7,this.svgTooltip.dataBind())},R.prototype.getModuleName=function(){return"ProgressTooltip"},R.prototype.destroy=function(){};var pe=R;function R(e){this.text=[],this.previousPosition=0,this.control=e}x.prototype.createLinearSegment=function(e,t,r,i,o,n){for(var a,s=e.enableRtl?"Round"===e.cornerRadius?e.progressRect.x+e.progressRect.width-.45*o:e.progressRect.x+e.progressRect.width:"Round"===e.cornerRadius?e.progressRect.x+.45*o:e.progressRect.x,l=e.progressRect.y+e.progressRect.height/2,c=e.gapWidth||e.themeStyle.linearGapWidth,p=n/e.segmentCount,h=(n-(e.segmentCount-1)*c-("Round"===e.cornerRadius?e.segmentCount*(L*o):0))/e.segmentCount,d="Round"===e.cornerRadius?c+L*o:c,u=e.renderer.createGroup({id:e.element.id+t}),g=Math.ceil(r/p),m=0,y="Round"===e.cornerRadius?r-L*o:r,f=e.progressThickness||e.themeStyle.linearProgressThickness,b=0;b<g;b++)a=m<e.segmentColor.length?e.segmentColor[m]:e.segmentColor[m=0],m++,a=new k.PathOption(e.element.id+t+b,"none",f,a,i,"0",this.getLinearSegmentPath(s,l,y<h?y:h,e.enableRtl)),a=e.renderer.drawPath(a),"Round"===e.cornerRadius&&a.setAttribute("stroke-linecap","round"),u.appendChild(a),s+=e.enableRtl?-h-d:h+d,y=(y-=h+d)<0?0:y;return u},x.prototype.getLinearSegmentPath=function(e,t,r,i){return"M "+e+" "+t+" L"+(e+(i?-r:r))+" "+t},x.prototype.createCircularSegment=function(e,t,r,i,o,n,a,s,l,c){var p=e.startAngle,h=this.widthToAngle(e.minimum,e.maximum,n,e.totalAngle);h-="Round"===e.cornerRadius&&e.totalAngle===E?this.widthToAngle(0,c,.45*s,l):0;for(var d,u,g,n=(c-(e.totalAngle===E?e.segmentCount:e.segmentCount-1)*(e.gapWidth||e.themeStyle.circularGapWidth)-("Round"===e.cornerRadius?(e.totalAngle===E?e.segmentCount:e.segmentCount-1)*L*s:0))/e.segmentCount,m=this.widthToAngle(0,c,c/e.segmentCount,l),y=(m-="Round"===e.cornerRadius&&e.totalAngle===E?this.widthToAngle(0,c,.45*s,l):0,this.widthToAngle(0,c,n,l)),f=this.widthToAngle(0,c,e.gapWidth||e.themeStyle.circularGapWidth,l),b=(f+="Round"===e.cornerRadius?this.widthToAngle(0,c,L*s,l):0,e.renderer.createGroup({id:e.element.id+t})),n=Math.floor(h/m),v=Math.ceil((h-f*n)/y),P=(p+(e.enableRtl?-y:y))%360,C=0,F=e.progressThickness||e.themeStyle.circularProgressThickness,R=0;R<v;R++)d=A(r,i,o,p,u=e.enableRtl?e.startAngle-h>P?e.startAngle-h:P:e.startAngle+h<P?e.startAngle+h:P,e.enableRtl),g=C<e.segmentColor.length?e.segmentColor[C]:e.segmentColor[C=0],C++,g=new k.PathOption(e.element.id+t+R,"none",F,g,a,"0",d),d=e.renderer.drawPath(g),"Round"===e.cornerRadius&&d.setAttribute("stroke-linecap","round"),b.appendChild(d),p=u+(e.enableRtl?-f:f),P+=e.enableRtl?-y-f:y+f;return b},x.prototype.widthToAngle=function(e,t,r,i){return(r-e)/(t-e)*i},x.prototype.createLinearRange=function(e,t,r){for(var i,o,n,a,s=t.progressRect.x+(t.enableRtl?t.progressRect.width:0),l=t.progressRect.y+t.progressRect.height/2,c=t.renderer.createGroup({id:t.element.id+"_LinearRangeGroup"}),p=t.rangeColors,h=t.progressThickness||t.themeStyle.linearProgressThickness,d=t.themeStyle.progressOpacity,u=t.minimum,g=t.value,m=t.enableRtl?.1:-.1,y=0;y<p.length;y++)i=p[y].start>=u&&p[y].start<=g&&p[y].end>=u&&p[y].end<=g,o=e*t.calculateProgressRange(p[y].start,u,g),n=e*t.calculateProgressRange(p[y].end,u,g),o=s+(t.enableRtl?-o:o),n=s+(t.enableRtl?-n:n),o=i?t.isGradient&&0<y?o+m:o:s,a=t.isGradient?"url(#lineRangeGrad_"+y+")":p[y].color,a=new k.PathOption(t.element.id+"_LinearRange_"+y,"none",h,a,d,"0","M "+o+" "+l+" L"+(n=i?n:s)+" "+l),i=t.renderer.drawPath(a),"Round"===t.cornerRadius&&r&&i.setAttribute("stroke-linecap","round"),c.appendChild(i),t.isGradient&&(a=(p.length-1===y?p[y]:p[y+1]).color,i=this.setLinearGradientColor(y,p[y].color,a,o,n,t),c.appendChild(i));return c},x.prototype.createCircularRange=function(e,t,r,i){for(var o,n,a,s=i.renderer.createGroup({id:i.element.id+"_CircularRangeGroup"}),l=i.rangeColors,c=i.progressThickness||i.themeStyle.linearProgressThickness,p=i.themeStyle.progressOpacity,h=i.minimum,d=i.value,u=i.startAngle,g=this.widthToAngle(i.minimum,i.maximum,i.value,i.totalAngle),m=0;m<l.length;m++)a=l[m].start>=h&&l[m].start<=d&&l[m].end>=h&&l[m].end<=d,o=this.widthToAngle(h,d,l[m].start,g),n=this.widthToAngle(h,d,l[m].end,g),o=a?(u+(i.enableRtl?-o:o))%360:u,n=a?(u+(i.enableRtl?-n:n))%360:u,a=i.isGradient?"url(#circleRangeGrad_"+m+")":l[m].color,a=new k.PathOption(i.element.id+"_CircularRange_"+m,"none",c,a,p,"0",A(e,t,r,o,n,i.enableRtl)),a=i.renderer.drawPath(a),"Round"===i.cornerRadius&&o!==n&&a.setAttribute("stroke-linecap","round"),s.appendChild(a),i.isGradient&&(a=(l.length-1===m?l[m]:l[m+1]).color,a=this.setCircularGradientColor(m,l[m].color,a,o,n,r,e,t,i),s.appendChild(a));return s},x.prototype.setLinearGradientColor=function(e,t,r,i,o,n){var a=[],e={id:"lineRangeGrad_"+e,x1:i.toString(),x2:o.toString()},i=(a[0]={color:t,colorStop:"50%"},a[1]={color:r,colorStop:"100%"},n.renderer.drawGradient("linearGradient",e,a));return i.firstElementChild.setAttribute("gradientUnits","userSpaceOnUse"),i},x.prototype.setCircularGradientColor=function(e,t,r,i,o,n,a,s,l){var c=[],i=T(a,s,n,i),a=T(a,s,n,o),s={id:"circleRangeGrad_"+e,x1:i.x.toString(),x2:a.x.toString(),y1:i.y.toString(),y2:a.y.toString()},n=(c[0]={color:t,colorStop:"50%"},c[1]={color:r,colorStop:"100%"},l.renderer.drawGradient("linearGradient",s,c));return n.firstElementChild.setAttribute("gradientUnits","userSpaceOnUse"),n};var he=x;function x(){}O.prototype.renderLinearTrack=function(){var e,t,r=this.progress,i=r.renderer.createGroup({id:r.element.id+"_LinearTrackGroup"}),o=(this.isRange=""!==this.progress.rangeColors[0].color||null!==this.progress.rangeColors[0].start||null!==this.progress.rangeColors[0].end,r.trackThickness||r.themeStyle.linearTrackThickness),n=r.argsData.trackColor||r.themeStyle.linearTrackColor;"Round4px"===r.cornerRadius?e=1<r.segmentCount?this.createRoundCornerSegment("_LinearTrack_",n,o,!0,0,r):(t=new k.PathOption(r.element.id+"_Lineartrack",n,0,"none",r.themeStyle.trackOpacity,"0",this.cornerRadius(r.progressRect.x,r.progressRect.y,r.progressRect.width,o,4,"")),r.renderer.drawPath(t)):(t=new k.PathOption(r.element.id+"_Lineartrack","none",o,n,r.themeStyle.trackOpacity,"0",r.getPathLine(r.progressRect.x,r.progressRect.width,o)),e=r.renderer.drawPath(t),r.trackWidth=e.getTotalLength(),"Round"!==r.cornerRadius||this.isRange||e.setAttribute("stroke-linecap","round"),1<r.segmentCount&&!this.isRange&&!r.enableProgressSegments&&(r.segmentSize=r.calculateSegmentSize(r.trackWidth,o),e.setAttribute("stroke-dasharray",r.segmentSize))),i.appendChild(e),r.svgObject.appendChild(i)},O.prototype.renderLinearProgress=function(e,t){void 0===t&&(t=0);var r,i,o=this.progress,n=o.value>=o.maximum,a=o.progressRect.width*o.calculateProgressRange(o.value>o.maximum?o.maximum:o.value),s=o.calculateProgressRange(o.argsData.value>o.maximum?o.maximum:o.argsData.value),l=(this.linearProgressWidth=o.progressRect.width*(o.isIndeterminate&&!o.enableProgressSegments?1:s),i=e?k.getElement(o.element.id+"_LinearProgressGroup"):o.renderer.createGroup({id:o.element.id+"_LinearProgressGroup"}),o.progressThickness||o.themeStyle.linearProgressThickness),c=o.isStriped?"url(#"+o.element.id+"_LinearStriped)":this.checkingLinearProgressColor(),p="Round4px"===o.cornerRadius?new k.PathOption(o.element.id+"_Linearprogress",c,0,"none",o.themeStyle.progressOpacity,"0",this.cornerRadius(o.progressRect.x,o.progressRect.y,this.linearProgressWidth,l,4,n||o.isIndeterminate?"":"start")):new k.PathOption(o.element.id+"_Linearprogress","none",l,c,o.themeStyle.progressOpacity,"0",o.getPathLine(o.progressRect.x,this.linearProgressWidth,l));o.progressWidth=o.renderer.drawPath(p).getTotalLength(),o.segmentSize=o.enableProgressSegments?o.calculateSegmentSize(o.progressWidth,l):o.segmentSize,null===o.secondaryProgress||o.isIndeterminate||this.renderLinearBuffer(o),null!==o.argsData.value&&("Round4px"===o.cornerRadius?r=1<o.segmentCount?this.createRoundCornerSegment("_Linearprogress_",c,l,!1,this.linearProgressWidth,o,o.themeStyle.progressOpacity):o.renderer.drawPath(p):0===o.segmentColor.length||o.isIndeterminate||this.isRange?this.isRange&&!o.isIndeterminate?r=this.segment.createLinearRange(this.linearProgressWidth,o,s):(e?((r=k.getElement(o.element.id+"_Linearprogress")).setAttribute("d",o.getPathLine(o.progressRect.x,this.linearProgressWidth,l)),r.setAttribute("stroke",c)):r=o.renderer.drawPath(p),1<o.segmentCount&&r.setAttribute("stroke-dasharray",o.segmentSize),"Round"===o.cornerRadius&&s&&r.setAttribute("stroke-linecap","round")):(c=o.enableProgressSegments?o.progressWidth:o.trackWidth,r=this.segment.createLinearSegment(o,"_LinearProgressSegment",this.linearProgressWidth,o.themeStyle.progressOpacity,l,c)),i.appendChild(r),o.isStriped&&!o.isIndeterminate&&(p=this.checkingLinearProgressColor(),this.renderLinearStriped(p,i,o)),!o.isActive||o.isIndeterminate||o.isStriped||this.renderActiveState(i,s,this.linearProgressWidth,l,e),!(o.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)||o.isIndeterminate||o.isActive||o.isStriped||(c=null!==o.secondaryProgress?o.animation.delay+(this.bufferWidth-this.linearProgressWidth):o.animation.delay,this.delay=c,p=o.createClipPath(o.clipPath,s,null,e,l,!1,"Round4px"===o.cornerRadius&&n),i.appendChild(o.clipPath),r.style.clipPath="url(#"+o.element.id+"_clippath)",this.animation.doLinearAnimation(p,o,c,e?t:0)),o.isIndeterminate&&(n=o.createClipPath(o.clipPath,o.enableProgressSegments?1:s,null,e,l,o.enableProgressSegments),i.appendChild(o.clipPath),r.setAttribute("style","clip-path:url(#"+o.element.id+"_clippath)"),this.animation.doLinearIndeterminate(o.enableProgressSegments?r:n,this.linearProgressWidth,l,o,n)),o.svgObject.appendChild(i),o.previousWidth=a)},O.prototype.renderLinearBuffer=function(e){var t,r,i,o=e.secondaryProgress>=e.maximum,n=e.calculateProgressRange(e.secondaryProgress>e.maximum?e.maximum:e.secondaryProgress),a=(this.bufferWidth=r=e.progressRect.width*n,e.renderer.createGroup({id:e.element.id+"_LinearBufferGroup"})),s=e.secondaryProgressThickness||e.progressThickness||e.themeStyle.linearProgressThickness,l=e.secondaryProgressColor||e.themeStyle.bufferColor||this.checkingLinearProgressColor();"Round4px"===e.cornerRadius?t=1<e.segmentCount?this.createRoundCornerSegment("_Linearbuffer_",l,s,!1,r,e,e.themeStyle.bufferOpacity):(i=new k.PathOption(e.element.id+"_Linearbuffer",l,0,"none",e.themeStyle.bufferOpacity,"0",this.cornerRadius(e.progressRect.x,e.progressRect.y,r,s,4,o?"":"start")),e.renderer.drawPath(i)):(i=new k.PathOption(e.element.id+"_Linearbuffer","none",s,l,e.themeStyle.bufferOpacity,"0",e.getPathLine(e.progressRect.x,r,s)),0===e.segmentColor.length||e.isIndeterminate||this.isRange?(t=e.renderer.drawPath(i),1<e.segmentCount&&!this.isRange&&t.setAttribute("stroke-dasharray",e.segmentSize),"Round"!==e.cornerRadius||this.isRange||t.setAttribute("stroke-linecap","round")):(l=e.enableProgressSegments?e.progressWidth:e.trackWidth,t=this.segment.createLinearSegment(e,"_LinearBufferSegment",r,e.themeStyle.bufferOpacity,e.progressThickness||e.themeStyle.linearProgressThickness,l))),a.appendChild(t),(e.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)&&(i=e.createClipPath(e.bufferClipPath,n,null,!1,s,!1,"Round4px"===e.cornerRadius&&o),a.appendChild(e.bufferClipPath),t.setAttribute("style","clip-path:url(#"+e.element.id+"_clippathBuffer)"),this.animation.doLinearAnimation(i,e,e.animation.delay,0)),e.svgObject.appendChild(a)},O.prototype.renderLinearLabel=function(e){void 0===e&&(e=!1);var t,r,i,o=this.progress.progressThickness||this.progress.themeStyle.linearProgressThickness,n=this.progress,a=n.labelStyle.textAlignment,s=n.labelStyle.text,l=n.progressRect.width*n.calculateProgressRange(n.value>n.maximum?n.maximum:n.value),c=n.renderer.createGroup({id:n.element.id+"_LinearLabelGroup"}),p=(document.getElementById(c.id)&&document.getElementById(c.id).remove(),(n.value-n.minimum)/(n.maximum-n.minimum)*100),p=n.value<n.minimum?0:+p.toFixed(2),s={cancel:!1,text:s||String(p)+"%",color:n.labelStyle.color||this.progress.themeStyle.linearLabelFont.color};n.trigger("textRender",s),s.cancel||(p=k.measureText(s.text,n.labelStyle,n.themeStyle.linearLabelFont),r=n.enableRtl?n.progressRect.x+n.progressRect.width-p.width/2:n.progressRect.x+p.width/2,n.labelOnTrack?"Near"===a?t=r+(n.enableRtl?-5:5):(t="Center"===a?(i=n.enableRtl?n.progressRect.x+n.progressRect.width-l/2:n.progressRect.x+l/2,n.enableRtl,l<p.width/2?r:i):(i=n.enableRtl?n.progressRect.x+n.progressRect.width-l+p.width/2:n.progressRect.x+l-p.width/2,i+=n.enableRtl?5:-5,(n.enableRtl?i<=r:r<=i)?i:r),!l&&!n.enableRtl&&t/2<n.progressRect.x+5&&(t+=5)):"Near"===a?t=r+(n.enableRtl?-5:5):"Center"===a?t=(n.progressRect.x+n.progressRect.width)/2:(t=n.enableRtl?n.progressRect.x+p.width/2:n.progressRect.x+n.progressRect.width-p.width/2,t+=n.enableRtl?5:-5),i="Round4px"===this.progress.cornerRadius?n.progressRect.y+o/2+p.height/4:n.progressRect.y+n.progressRect.height/2+p.height/4,r=new U(n.element.id+"_linearLabel",n.labelStyle.size||n.themeStyle.linearLabelFont.size,n.labelStyle.fontStyle||n.themeStyle.linearLabelFont.fontStyle,n.labelStyle.fontFamily||n.themeStyle.linearLabelFont.fontFamily,n.labelStyle.fontWeight||n.themeStyle.linearLabelFont.fontWeight,"middle",s.color,t,i),a=n.renderer.createText(r,s.text),c.appendChild(a),(n.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)&&!n.isIndeterminate&&(o=n.renderer.createClipPath({id:n.element.id+"_clippathLabel"}),n.createClipPath(o,1,null,!1,n.progressThickness||n.themeStyle.linearProgressThickness,!0),c.appendChild(o),a.style.clipPath="url(#"+n.element.id+"_clippathLabel)",this.animation.doLabelAnimation(a,e?n.previousLabelWidth:0,l-(e?n.previousLabelWidth:0),n,this.delay,p.width)),n.svgObject.appendChild(c),n.previousLabelWidth=l)},O.prototype.renderActiveState=function(e,t,r,i,o){var n,a,s=this.progress,l=s.value===s.maximum,l=("Round4px"===s.cornerRadius?n=1<s.segmentCount?this.createRoundCornerSegment("_LinearActiveProgress_","#ffffff",i,!1,r,s,.5):(a=new k.PathOption(s.element.id+"_LinearActiveProgress","#ffffff",0,"none",.5,"0",this.cornerRadius(s.progressRect.x,s.progressRect.y,r,i,4,l?"":"start")),s.renderer.drawPath(a)):(o?(n=k.getElement(s.element.id+"_LinearActiveProgress")).setAttribute("d",s.getPathLine(s.progressRect.x,r,i)):(a=new k.PathOption(s.element.id+"_LinearActiveProgress","none",i,"#ffffff",.5,"",s.getPathLine(s.progressRect.x,r,i)),n=s.renderer.drawPath(a)),1<s.segmentCount&&!this.isRange&&n.setAttribute("stroke-dasharray",s.segmentSize),"Round"===s.cornerRadius&&t&&!this.isRange&&n.setAttribute("stroke-linecap","round")),s.createClipPath(s.clipPath,t,null,o,i,!1));n.setAttribute("style","clip-path:url(#"+s.element.id+"_clippath)"),e.appendChild(n),e.appendChild(s.clipPath),this.animation.doLinearAnimation(l,s,0,0,n)},O.prototype.renderLinearStriped=function(e,t,r){for(var i,o=r.renderer.createDefs(),n=document.createElementNS(ae,"linearGradient"),a=[{offset:"50%","stop-color":e,"stop-opacity":"1"},{offset:"50%","stop-color":e,"stop-opacity":"0.4"}],n=H({id:r.element.id+"_LinearStriped",x1:r.progressRect.x.toString(),x2:(r.progressRect.x+14).toString(),spreadMethod:"repeat",gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(-45)"},n),s=0;s<a.length;s++)i=document.createElementNS(ae,"stop"),i=H(a[s],i),n.appendChild(i);o.appendChild(n),t.appendChild(o),(r.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)&&this.animation.doStripedAnimation(n,r,0)},O.prototype.checkingLinearProgressColor=function(){var e,t=this.progress;switch(t.role){case"Success":e=t.themeStyle.success;break;case"Info":e=t.themeStyle.info;break;case"Warning":e=t.themeStyle.warning;break;case"Danger":e=t.themeStyle.danger;break;default:e=t.argsData.progressColor||t.themeStyle.linearProgressColor}return e},O.prototype.cornerRadius=function(e,t,r,i,o,n){var a="",s=r,l=o;switch(n){case"start":a="M"+e+","+t+" h"+r+" v"+i+" h"+-r+" a"+o+","+o+" 0 0 1 "+-o+","+-o+" v"+(2*o-i)+" a"+o+","+o+" 0 0 1 "+o+","+-o+" z";break;case"end":a="M"+e+","+t+" h"+(s-l)+" a"+l+","+l+" 0 0 1 "+l+","+l+" v"+(i-2*l)+" a"+l+","+l+" 0 0 1 "+-l+","+l+" h"+(o-s)+" v"+-i+" z";break;case"none":a="M"+e+","+t+" h"+r+" v"+i+" h"+-r+" v"+-i+" z";break;default:a="M"+e+","+t+" h"+(r-o)+" a"+o+","+o+" 0 0 1 "+o+","+o+" v"+(i-2*o)+" a"+o+","+o+" 0 0 1 "+-o+","+o+" h"+(o-r)+" a"+o+","+o+" 0 0 1 "+-o+","+-o+" v"+(2*o-i)+" a"+o+","+o+" 0 0 1 "+o+","+-o+" z"}return a},O.prototype.createRoundCornerSegment=function(e,t,r,i,o,n,a){for(var s,l,c,p=n.progressRect.x,h=n.progressRect.y,d=n.progressRect.width,u=n.gapWidth||n.themeStyle.linearGapWidth,g=(d-(n.segmentCount-1)*u)/n.segmentCount,m=n.renderer.createGroup({id:n.element.id+e+"SegmentGroup"}),y=1;y<=n.segmentCount;y++)if(l=1===y||y===n.segmentCount?1===y?"start":"end":"none",i)s=new k.PathOption(n.element.id+e+y,t,0,"none",n.themeStyle.trackOpacity,"0",this.cornerRadius(p,h,g,r,4,l)),c=n.renderer.drawPath(s),m.appendChild(c),p+=g+u;else if(s=new k.PathOption(n.element.id+e+y,t,0,"none",a,"0",this.cornerRadius(p,h,o<g?o:g,r,4,l)),c=n.renderer.drawPath(s),m.appendChild(c),p+=g+u,(o-=g+u)<=0)break;return m};var de=O;function O(e){this.segment=new he,this.animation=new P,this.progress=e}W.prototype.renderCircularTrack=function(){var e=this.progress,t=e.renderer.createGroup({id:e.element.id+"_CircularTrackGroup"}),r=e.startAngle,i=(e.totalAngle=(e.endAngle-e.startAngle)%360,e.totalAngle=e.totalAngle<=0?360+e.totalAngle:e.totalAngle,e.totalAngle-=360===e.totalAngle?.01:0,this.trackEndAngle=s=(e.startAngle+(e.enableRtl?-e.totalAngle:+e.totalAngle))%360,this.centerX=e.progressRect.x+e.progressRect.width/2,this.centerY=e.progressRect.y+e.progressRect.height/2,this.maxThickness=Math.max(e.trackThickness,e.progressThickness)||Math.max(e.themeStyle.circularProgressThickness,e.themeStyle.circularTrackThickness),this.availableSize=Math.min(e.progressRect.height,e.progressRect.width)/2-this.maxThickness/2,a=b(e.radius,this.availableSize),e.argsData.trackColor||e.themeStyle.circularTrackColor),o=e.enablePieProgress?e.argsData.trackColor||e.themeStyle.circularTrackColor:"none",n=e.enablePieProgress?0:e.trackThickness||e.themeStyle.circularTrackThickness,a=A(this.centerX,this.centerY,null===a?0:a,r,s,e.enableRtl,e.enablePieProgress),r=(this.isRange=""!==this.progress.rangeColors[0].color||null!==this.progress.rangeColors[0].start||null!==this.progress.rangeColors[0].end,new k.PathOption(e.element.id+"_Circulartrack",o,n,i,e.themeStyle.trackOpacity,"0",a)),s=e.renderer.drawPath(r);e.trackWidth=s.getTotalLength(),1<e.segmentCount&&!e.enableProgressSegments&&!e.enablePieProgress&&!this.isRange&&(e.segmentSize=e.calculateSegmentSize(e.trackWidth,n),s.setAttribute("stroke-dasharray",e.segmentSize)),"Round"!==e.cornerRadius||e.enablePieProgress||this.isRange||s.setAttribute("stroke-linecap","round"),t.appendChild(s),e.svgObject.appendChild(t)},W.prototype.renderCircularProgress=function(e,t,r){var i,o,n,a,s,l=this.progress,c=l.startAngle,p=r?k.getElement(l.element.id+"_CircularProgressGroup"):l.renderer.createGroup({id:l.element.id+"_CircularProgressGroup"}),h=b(l.innerRadius,this.availableSize),d=(h=null===h?0:h,l.previousTotalEnd=n=l.calculateProgressRange(l.argsData.value>l.maximum?l.maximum:l.argsData.value),(l.startAngle+(l.enableRtl?-n:n))%360),u=(l.previousEndAngle=s=l.isIndeterminate&&!l.enableProgressSegments?(l.startAngle+(l.enableRtl?-l.totalAngle:l.totalAngle))%360:d,o=(o=(n-l.startAngle)%360)<=0?360+o:o,o-=360==o?.01:0,A(this.centerX,this.centerY,h,c,s,l.enableRtl,l.enablePieProgress)),g=this.checkingCircularProgressColor(),m=l.enablePieProgress?g:"none",y=l.progressThickness||l.themeStyle.circularProgressThickness,f=l.enablePieProgress?0:y,m=new k.PathOption(l.element.id+"_Circularprogress",m,f,g,l.themeStyle.progressOpacity,"0",u);l.progressWidth=l.renderer.drawPath(m).getTotalLength(),l.segmentSize=this.validateSegmentSize(l,y),this.endPosition=T(this.centerX,this.centerY,h,s),null===l.secondaryProgress||l.isIndeterminate||this.renderCircularBuffer(l,h,o),null!==l.argsData.value&&(0===l.segmentColor.length||l.isIndeterminate||l.enablePieProgress?this.isRange&&!l.isIndeterminate?a=this.segment.createCircularRange(this.centerX,this.centerY,h,l):(r?(i=(a=k.getElement(l.element.id+"_Circularprogress")).getAttribute("d"),a.setAttribute("stroke",g),a.setAttribute("d",u)):a=l.renderer.drawPath(m),1<l.segmentCount&&!l.enablePieProgress&&a.setAttribute("stroke-dasharray",l.segmentSize),"Round"===l.cornerRadius&&c!==s&&a.setAttribute("stroke-linecap","round")):(g=l.enableProgressSegments?o:l.totalAngle,m=l.enableProgressSegments?l.progressWidth:l.trackWidth,a=this.segment.createCircularSegment(l,"_CircularProgressSegment",this.centerX,this.centerY,h,l.argsData.value,l.themeStyle.progressOpacity,y,g,m)),p.appendChild(a),!l.isActive||l.isIndeterminate||l.enablePieProgress||this.renderActiveState(p,h,f,u,d,n,r),(l.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode||l.isIndeterminate)&&(this.delay=null!==l.secondaryProgress?300:l.animation.delay,s=l.createClipPath(l.clipPath,null,r?i:"",r),p.appendChild(l.clipPath),!(l.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)||l.isIndeterminate||l.isActive||(a.style.clipPath="url(#"+l.element.id+"_clippath)",this.animation.doCircularAnimation(this.centerX,this.centerY,h,d,n,s,l,y,this.delay,r?e:null,r?t:null)),l.isIndeterminate)&&(l.enableProgressSegments&&s.setAttribute("d",A(this.centerX,this.centerY,h+y/2,l.startAngle,this.trackEndAngle,l.enableRtl,!0)),a.setAttribute("style","clip-path:url(#"+l.element.id+"_clippath)"),this.animation.doCircularIndeterminate(l.enableProgressSegments?a:s,l,c,d,this.centerX,this.centerY,h,y,s)),l.svgObject.appendChild(p))},W.prototype.renderCircularBuffer=function(e,t,r){var i,o=e.renderer.createGroup({id:e.element.id+"_ CircularBufferGroup"}),n=e.calculateProgressRange(e.secondaryProgress>e.maximum?e.maximum:e.secondaryProgress),a=(e.startAngle+(e.enableRtl?-n:n))%360,s=A(this.centerX,this.centerY,t,e.startAngle,a,e.enableRtl,e.enablePieProgress),l=(this.bufferEndPosition=T(this.centerX,this.centerY,t,a),e.secondaryProgressColor||e.themeStyle.bufferColor||this.checkingCircularProgressColor()),c=e.enablePieProgress?l:"none",p=e.enablePieProgress?0:e.secondaryProgressThickness||e.progressThickness||e.themeStyle.circularProgressThickness,c=new k.PathOption(e.element.id+"_Circularbuffer",c,p,l,e.themeStyle.bufferOpacity,"0",s);0===e.segmentColor.length||e.isIndeterminate||e.enablePieProgress||this.isRange?(i=e.renderer.drawPath(c),1<e.segmentCount&&!e.enablePieProgress&&!this.isRange&&i.setAttribute("stroke-dasharray",e.segmentSize),"Round"!==e.cornerRadius||this.isRange||i.setAttribute("stroke-linecap","round")):(l=e.enableProgressSegments?r:e.totalAngle,s=e.enableProgressSegments?e.progressWidth:e.trackWidth,i=this.segment.createCircularSegment(e,"_CircularBufferSegment",this.centerX,this.centerY,t,e.secondaryProgress>e.maximum?e.maximum:e.secondaryProgress,e.themeStyle.bufferOpacity,p,l,s)),o.appendChild(i),(e.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)&&!e.isActive&&(c=e.createClipPath(e.bufferClipPath,null,"",!1),o.appendChild(e.bufferClipPath),i.setAttribute("style","clip-path:url(#"+e.element.id+"_clippathBuffer)"),this.animation.doCircularAnimation(this.centerX,this.centerY,t,a,n,c,e,e.progressThickness||e.themeStyle.circularProgressThickness,e.animation.delay)),e.svgObject.appendChild(o)},W.prototype.renderCircularLabel=function(e){void 0===e&&(e=!1);var t,r=this.progress,i=r.labelStyle.text,o=r.renderer.createGroup({id:r.element.id+"_CircularLabelGroup"}),n=(document.getElementById(o.id)&&document.getElementById(o.id).remove(),(r.value-r.minimum)/(r.maximum-r.minimum)*100),n=r.value<r.minimum?0:+n.toFixed(2),i={cancel:!1,text:i||String(n)+"%",color:r.labelStyle.color||r.themeStyle.circularLabelFont.color};r.trigger("textRender",i),i.cancel||(n=k.measureText(i.text,r.labelStyle,r.themeStyle.circularLabelFont),n=this.centerY+n.height/2,n=new U(r.element.id+"_circularLabel",r.labelStyle.size||r.themeStyle.circularLabelFont.size,r.labelStyle.fontStyle||r.themeStyle.circularLabelFont.fontStyle,r.labelStyle.fontFamily||r.themeStyle.circularLabelFont.fontFamily,r.labelStyle.fontWeight||r.themeStyle.circularLabelFont.fontWeight,"middle",i.color,this.centerX,n,r.progressRect.width,r.progressRect.height),n=r.renderer.createText(n,i.text),o.appendChild(n),(r.animation.enable&&"Disable"!==S.animationMode||"Enable"===S.animationMode)&&!r.isIndeterminate&&(t=(r.value-r.minimum)/(r.maximum-r.minimum)*r.totalAngle,t=r.value<r.minimum?0:t,this.animation.doLabelAnimation(n,e?r.previousWidth:r.startAngle,t,r,this.delay)),r.svgObject.appendChild(o),r.previousWidth=t)},W.prototype.renderActiveState=function(e,t,r,i,o,n,a){var s,l=this.progress,r=r+1,i=(a?(s=k.getElement(l.element.id+"_CircularActiveProgress")).setAttribute("d",i):(i=new k.PathOption(l.element.id+"_CircularActiveProgress","none",r,"#ffffff",.5,"0",i),s=l.renderer.drawPath(i)),1<l.segmentCount&&s.setAttribute("stroke-dasharray",l.segmentSize),"Round"===l.cornerRadius&&s.setAttribute("stroke-linecap","round"),l.createClipPath(l.clipPath,null,"",a));s.setAttribute("style","clip-path:url(#"+l.element.id+"_clippath)"),e.appendChild(s),e.appendChild(l.clipPath),this.animation.doCircularAnimation(this.centerX,this.centerY,t,o,n,i,l,r,0,null,null,s)},W.prototype.validateSegmentSize=function(e,t){var r=parseInt(e.radius,10)-parseInt(e.innerRadius,10),e=0==r||e.enableProgressSegments?e.enableProgressSegments?e.calculateSegmentSize(e.progressWidth,t):e.segmentSize:(r=e.trackWidth+(r<0?e.trackWidth*Math.abs(r)/parseInt(e.radius,10):-(e.trackWidth*Math.abs(r))/parseInt(e.radius,10)),e.calculateSegmentSize(r,t));return e},W.prototype.checkingCircularProgressColor=function(){var e,t=this.progress;switch(t.role){case"Success":e=t.themeStyle.success;break;case"Info":e=t.themeStyle.info;break;case"Warning":e=t.themeStyle.warning;break;case"Danger":e=t.themeStyle.danger;break;default:e=t.argsData.progressColor||t.themeStyle.circularProgressColor}return e};var ue=W;function W(e){this.segment=new he,this.animation=new P,this.progress=e}ge=function(e,t){return(ge=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}))(e,t)};var ge,me,ye,fe=function(e,t){function r(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},D=function(e,t,r,i){var o,n=arguments.length,a=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;0<=s;s--)(o=e[s])&&(a=(n<3?o(a):3<n?o(t,r,a):o(t,r))||a);return 3<n&&a&&Object.defineProperty(t,r,a),a},fe=(me=S.Component,fe(I,me),(ye=I).prototype.getModuleName=function(){return"progressbar"},I.prototype.preRender=function(){this.unWireEvents(),this.initPrivateVariable(),this.wireEvents()},I.prototype.initPrivateVariable=function(){this.progressRect=new u(0,0,0,0),this.progressSize=new r(0,0)},I.prototype.render=function(){var e=this;this.trigger("load",{progressBar:this}),this.element.style.display="block",this.element.style.position="relative",this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin",this.minimum.toString()),this.element.setAttribute("aria-valuemax",this.maximum.toString()),this.element.setAttribute("aria-valuenow",this.value?this.value.toString():"0"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.labelStyle.text||"progress bar"),this.calculateProgressBarSize(),this.setTheme(),this.createSVG(),this.argsData={value:this.value,progressColor:this.progressColor,trackColor:this.trackColor},this.argsData.value===this.maximum?this.trigger(ne,this.argsData,function(){e.controlRendering()}):this.trigger(oe,this.argsData,function(){e.controlRendering()})},I.prototype.controlRendering=function(){this.renderElements(),this.trigger("loaded",{progressBar:this}),this.renderComplete(),this.controlRenderedTimeStamp=(new Date).getTime()},I.prototype.calculateProgressBarSize=function(){var e=this.element.clientWidth||this.element.offsetWidth,t=this.element.clientHeight,r="Linear"===this.type?200:120,i="Linear"===this.type?30:120,o=Math.max(this.progressThickness,this.trackThickness),i="Linear"===this.type&&i-10<o?o+10:i;this.progressSize.width=b(this.width,e)||e||r,this.progressSize.height=b(this.height,t)||t||i,this.progressRect.x=this.margin.left,this.progressRect.y=this.margin.top,this.progressRect.width=this.progressSize.width-(this.margin.left+this.margin.right),this.progressRect.height=this.progressSize.height-(this.margin.top+this.margin.bottom),this.initialClipRect=new u(this.progressRect.x,this.progressRect.y,this.progressSize.height,this.progressSize.width)},I.prototype.renderAnnotations=function(){this.renderAnnotation()},I.prototype.renderElements=function(){this.createSecondaryElement(),this.renderTrack(),this.renderProgress(),this.renderLabel(),0<this.annotations.length&&this.renderAnnotations(),this.setSecondaryElementPosition(),this.tooltip.enable&&!this.tooltip.showTooltipOnHover&&this.progressTooltipModule.tooltip()},I.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"Secondary_Element"),t=(this.tooltip.enable&&(this.tooltipElement=S.createElement("div",{id:this.element.id+"_tooltip",className:"ejSVGTooltip",styles:"pointer-events: none; position: absolute; zIndex: 1; visibility: visible"}),e)&&this.secElement.appendChild(this.tooltipElement),document.getElementById(this.element.id+"_tooltip"));e?(e.innerHTML="",this.secElement=t?e.appendChild(t):e):(this.secElement=S.createElement("div",{id:this.element.id+"Secondary_Element",styles:"position: absolute"}),this.element.appendChild(this.secElement),this.tooltipElement&&this.secElement.appendChild(this.tooltipElement))},I.prototype.setSecondaryElementPosition=function(){var e,t=this.secElement,r=this.element.getBoundingClientRect();k.getElement(this.svgObject.id)&&(e=k.getElement(this.svgObject.id).getBoundingClientRect(),t.style.left=Math.max(e.left-r.left,0)+"px",t.styl