UNPKG

@syncfusion/ej2-pdfviewer

Version:
10 lines 3.93 MB
/*! * filename: ej2-pdfviewer.umd.min.js * version : 34.2.2 * Copyright Syncfusion Inc. 2001 - 2025. 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-inputs"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-inplace-editor"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-pdf"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-pdf-data-extract")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-inputs","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-inplace-editor","@syncfusion/ej2-navigations","@syncfusion/ej2-notifications","@syncfusion/ej2-dropdowns","@syncfusion/ej2-pdf","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-lists","@syncfusion/ej2-pdf-data-extract"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Inputs,e.ej2Popups,e.ej2Splitbuttons,e.ej2InplaceEditor,e.ej2Navigations,e.ej2Notifications,e.ej2Dropdowns,e.ej2Pdf,e.ej2Buttons,e.ej2Data,e.ej2Lists,e.ej2PdfDataExtract)}(this,function(J,le,D,T,Q,F,k,P,R,de,O,L,U,z){"use strict";function H(e){switch(e.type){case"Linear":return ee;case"Radial":return ne;default:return ee}}Y=function(e,t){return(Y=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Y,K,e=function(e,t){function i(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},t=function(e,t,i,n){var o,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;0<=s;s--)(o=e[s])&&(r=(a<3?o(r):3<a?o(t,i,r):o(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r};K=le.ChildProperty,e(W,K),t([le.Property(0)],W.prototype,"left",void 0),t([le.Property(0)],W.prototype,"right",void 0),t([le.Property(0)],W.prototype,"top",void 0),t([le.Property(0)],W.prototype,"bottom",void 0);function W(){return null!==K&&K.apply(this,arguments)||this}_=le.ChildProperty,e(Z,_),Z.prototype.getClassName=function(){return"Stop"},t([le.Property("")],Z.prototype,"color",void 0),t([le.Property(0)],Z.prototype,"offset",void 0),t([le.Property(1)],Z.prototype,"opacity",void 0);var _,i=Z;function Z(){return null!==_&&_.apply(this,arguments)||this}X=le.ChildProperty,e(q,X),t([le.Collection([],i)],q.prototype,"stops",void 0),t([le.Property("None")],q.prototype,"type",void 0),t([le.Property("")],q.prototype,"id",void 0);var X,i=q;function q(){return null!==X&&X.apply(this,arguments)||this}e(te,$=i),t([le.Property(0)],te.prototype,"x1",void 0),t([le.Property(0)],te.prototype,"x2",void 0),t([le.Property(0)],te.prototype,"y1",void 0),t([le.Property(0)],te.prototype,"y2",void 0);var $,ee=te;function te(){return null!==$&&$.apply(this,arguments)||this}e(oe,ie=i),t([le.Property(0)],oe.prototype,"cx",void 0),t([le.Property(0)],oe.prototype,"cy",void 0),t([le.Property(0)],oe.prototype,"fx",void 0),t([le.Property(0)],oe.prototype,"fy",void 0),t([le.Property(50)],oe.prototype,"r",void 0);var ie,ne=oe;function oe(){return null!==ie&&ie.apply(this,arguments)||this}ae=le.ChildProperty,e(re,ae),t([le.Property("white")],re.prototype,"fill",void 0),t([le.Property("black")],re.prototype,"strokeColor",void 0),t([le.Property("")],re.prototype,"strokeDashArray",void 0),t([le.Property(1)],re.prototype,"strokeWidth",void 0),t([le.Property(1)],re.prototype,"opacity",void 0),t([le.ComplexFactory(H)],re.prototype,"gradient",void 0);var ae,i=re;function re(){return null!==ae&&ae.apply(this,arguments)||this}var se;e(Ae,se=i),t([le.Property("transparent")],Ae.prototype,"fill",void 0);function Ae(){return null!==se&&se.apply(this,arguments)||this}var he,pe,ce,ge;e(ue,he=i),t([le.Property("black")],ue.prototype,"color",void 0),t([le.Property("Arial")],ue.prototype,"fontFamily",void 0),t([le.Property(12)],ue.prototype,"fontSize",void 0),t([le.Property(!1)],ue.prototype,"italic",void 0),t([le.Property(!1)],ue.prototype,"bold",void 0),t([le.Property("CollapseSpace")],ue.prototype,"whiteSpace",void 0),t([le.Property("WrapWithOverflow")],ue.prototype,"textWrapping",void 0),t([le.Property("Center")],ue.prototype,"textAlign",void 0),t([le.Property("None")],ue.prototype,"textDecoration",void 0),t([le.Property("Wrap")],ue.prototype,"textOverflow",void 0),t([le.Property("transparent")],ue.prototype,"fill",void 0);function ue(){return null!==he&&he.apply(this,arguments)||this}(e=pe=pe||{})[e.Self=1]="Self",e[e.Parent=2]="Parent",(i=ce=ce||{})[i.None=0]="None",i[i.ElementIsPort=2]="ElementIsPort",i[i.ElementIsGroup=4]="ElementIsGroup",(t=ge=ge||{})[t.Rotate=2]="Rotate",t[t.ConnectorSource=4]="ConnectorSource",t[t.ConnectorTarget=8]="ConnectorTarget",t[t.ResizeNorthEast=16]="ResizeNorthEast",t[t.ResizeEast=32]="ResizeEast",t[t.ResizeSouthEast=64]="ResizeSouthEast",t[t.ResizeSouth=128]="ResizeSouth",t[t.ResizeSouthWest=256]="ResizeSouthWest",t[t.ResizeWest=512]="ResizeWest",t[t.ResizeNorthWest=1024]="ResizeNorthWest",t[t.ResizeNorth=2048]="ResizeNorth",t[t.Default=4094]="Default";me.prototype.clone=function(){return new me(this.width,this.height)};var fe=me;function me(e,t){this.width=e,this.height=t}Object.defineProperty(ye.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"topLeft",{get:function(){return{x:this.left,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"topRight",{get:function(){return{x:this.right,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"bottomLeft",{get:function(){return{x:this.left,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"bottomRight",{get:function(){return{x:this.right,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"middleLeft",{get:function(){return{x:this.left,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"middleRight",{get:function(){return{x:this.right,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"topCenter",{get:function(){return{x:this.x+this.width/2,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"bottomCenter",{get:function(){return{x:this.x+this.width/2,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"center",{get:function(){return{x:this.x+this.width/2,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),ye.prototype.equals=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},ye.prototype.uniteRect=function(e){var t=Math.max((Number.NaN===this.right||this.x===Number.MAX_VALUE?e:this).right,e.right),i=this.bottom;return this.x=Math.min(this.left,e.left),this.y=Math.min(this.top,e.top),this.width=t-this.x,this.height=i-this.y,this},ye.prototype.unitePoint=function(e){var t,i,n;this.x===Number.MAX_VALUE?(this.x=e.x,this.y=e.y):(t=Math.min(this.left,e.x),i=Math.min(this.top,e.y),n=Math.max(this.right,e.x),e=Math.max(this.bottom,e.y),this.x=t,this.y=i,this.width=n-this.x,this.height=e-this.y)},ye.prototype.intersection=function(e){var t,i;return this.intersects(e)?new ye(t=Math.max(this.left,e.left),i=Math.max(this.top,e.top),Math.min(this.right,e.right)-t,Math.min(this.bottom,e.bottom)-i):ye.empty},ye.prototype.Inflate=function(e){return this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e,this},ye.prototype.intersects=function(e){return!(this.right<e.left||this.left>e.right||this.top>e.bottom||this.bottom<e.top)},ye.prototype.containsRect=function(e){return this.left<=e.left&&this.right>=e.right&&this.top<=e.top&&this.bottom>=e.bottom},ye.prototype.containsPoint=function(e,t){return this.left-(t=void 0===t?0:t)<=e.x&&this.right+t>=e.x&&this.top-t<=e.y&&this.bottom+t>=e.y},ye.prototype.toPoints=function(){var e=[];return e.push(this.topLeft),e.push(this.topRight),e.push(this.bottomLeft),e.push(this.bottomRight),e},ye.toBounds=function(e){for(var t=new ye,i=0,n=e;i<n.length;i++){var o=n[i];t.unitePoint(o)}return t},ye.prototype.scale=function(e,t){this.width*=e,this.height*=t},ye.prototype.offset=function(e,t){this.x+=e,this.y+=t},ye.empty=new ye(Number.MAX_VALUE,Number.MIN_VALUE,0,0);var we,j=ye;function ye(e,t,i,n){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,void(this.height=0)===e||void 0===t?(e=t=Number.MAX_VALUE,i=n=0):(void 0===i&&(i=0),void 0===n&&(n=0)),this.x=e,this.y=t,this.width=i,this.height=n}(e=we=we||{})[e.Identity=0]="Identity",e[e.Translation=1]="Translation",e[e.Scaling=2]="Scaling",e[e.Unknown=4]="Unknown";var Ce=function(e,t,i,n,o,a,r){this.m11=e,this.m12=t,this.m21=i,this.m22=n,this.offsetX=o,this.offsetY=a,this.type=r};function Be(){return new Ce(1,0,0,1,0,0,we.Identity)}function S(e,t){e=function(e,t,i){switch(e.type){case we.Identity:break;case we.Translation:t+=e.offsetX,i+=e.offsetY;break;case we.Scaling:t*=e.m11,i*=e.m22;break;case we.Translation|we.Scaling:t=(t*=e.m11)+e.offsetX,i=(i*=e.m22)+e.offsetY;break;default:var n=i*e.m21+e.offsetX,o=t*e.m12+e.offsetY;t=(t*=e.m11)+n,i=(i*=e.m22)+o}return{x:t,y:i}}(e,t.x,t.y);return{x:Math.round(100*e.x)/100,y:Math.round(100*e.y)/100}}function Se(e,t,i,n){var o,a;Ee(e,(e=.017453292519943295*(t%=360),t=i||0,i=n||0,n=Be(),o=Math.sin(e),e=Math.cos(e),a=t*(1-e)+i*o,i=i*(1-e)-t*o,n.type=we.Unknown,be(n,e,o,-o,e,a,i),n))}function Ie(e,t,i,n,o){Ee(e,(e=t,t=i,i=n=void 0===n?0:n,n=o=void 0===o?0:o,(o=Be()).type=i||n?we.Scaling|we.Translation:we.Scaling,be(o,e,0,0,t,i-e*i,n-t*n),o))}function Ee(e,t){var i=e.type,n=t.type;if(n!==we.Identity)if(i===we.Identity)xe(e,t),e.type=t.type;else if(n===we.Translation)e.offsetX+=t.offsetX,e.offsetY+=t.offsetY,i!==we.Unknown&&(e.type|=we.Translation);else if(i!==we.Translation){var o=i<<4|n;switch(o){case 34:return e.m11*=t.m11,void(e.m22*=t.m22);case 35:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX=t.offsetX,e.offsetY=t.offsetY,void(e.type=we.Translation|we.Scaling);case 36:break;default:switch(o){case 50:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX*=t.m11,void(e.offsetY*=t.m22);case 51:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX=t.m11*e.offsetX+t.offsetX,void(e.offsetY=t.m22*e.offsetY+t.offsetY);case 52:break;default:switch(o){case 66:case 67:case 68:break;default:return}}}i=Be();be(i,e.m11*t.m11+e.m12*t.m21,e.m11*t.m12+e.m12*t.m22,e.m21*t.m11+e.m22*t.m21,e.m21*t.m12+e.m22*t.m22,e.offsetX*t.m11+e.offsetY*t.m21+t.offsetX,e.offsetX*t.m12+e.offsetY*t.m22+t.offsetY),i.m21||i.m12?i.type=we.Unknown:((i.m11&&1!==i.m11||i.m22&&1!==i.m22)&&(i.type=we.Scaling),(i.offsetX||i.offsetY)&&(i.type|=we.Translation),(i.type&(we.Translation|we.Scaling))===we.Identity&&(i.type=we.Identity),i.type=we.Scaling|we.Translation),xe(e,i),e.type=i.type}else{var i=e.offsetX,a=e.offsetY;e.offsetX=i*t.m11+a*t.m21+t.offsetX,e.offsetY=i*t.m12+a*t.m22+t.offsetY,n===we.Unknown?e.type=we.Unknown:e.type=we.Translation|we.Scaling}}function be(e,t,i,n,o,a,r){e.m11=t,e.m12=i,e.m21=n,e.m22=o,e.offsetX=a,e.offsetY=r}function xe(e,t){e.m11=t.m11,e.m12=t.m12,e.m21=t.m21,e.m22=t.m22,e.offsetX=t.offsetX,e.offsetY=t.offsetY,e.type=t.type}function ve(e){var t,i=[];if("msie"===le.Browser.info.name||"edge"===le.Browser.info.name)for(var n=0;n<e.childNodes.length;n++)1===(t=e.childNodes[parseInt(n.toString(),10)]).nodeType&&i.push(t);else i=e.children;return i}function Ve(e){var t,i,n,o="pathTable";return window[o]||(window[o]={}),e?(t="measureElement",window[t].style.visibility="visible",i=void(n=ve(window[t].children[2])[0]).setAttribute("d",e),window[o][e]?i=window[o][e]:(window[o][e]=i=n.getBBox(),0!==i.x&&0!==i.y||0!==i.width&&0!==i.height||(window[o][e]=i=function(e){var t,i=0,n=0,o=0,a=0,r=e;r=r.replace(/[a-z].*/g," ").replace(/[\sA-Z]+/gi," ").trim().split(" ");for(var s=0;s<r.length;s++)1<r[parseInt(s.toString(),10)].length&&(t=r[parseInt(s.toString(),10)].split(","),i=n=t[0],o=a=t[1]);for(s=0;s<r.length;s++)(t=r[parseInt(s.toString(),10)].split(","))[1]||(t[0]=i,t[1]=o),i=Math.min(i,t[0]),n=Math.max(n,t[0]),o=Math.min(o,t[1]),a=Math.max(a,t[1]);return{x:i,y:o,width:n-i,height:a-o}}(e))),n=new j(i.x,i.y,i.width,i.height),window[t].style.visibility="hidden",n):new j(0,0,0,0)}function Me(e,t,i){var n,o,a=[],r=0,s=t||e.content;if("nowrap"!==e.whiteSpace&&"pre"!==e.whiteSpace)if("breakall"===e.breakWord)for(n="",n+=s[0],r=0;r<s.length;r++)(o=Ue(n,e))>=e.width&&0<n.length?(a[a.length]={text:n,x:0,dy:0,width:o},n=""):(o=Ue(n+=s[r+1]||"",e),(Math.ceil(o)+2>=e.width&&0<n.length||-1<n.indexOf("\n"))&&(a[a.length]={text:n,x:0,dy:0,width:o},n=""),r===s.length-1&&0<n.length&&(a[a.length]={text:n,x:0,dy:0,width:o},n=""));else a=function(e,t,i){var n,o,a,r=[],s="",l=0,d=0,A="nowrap"!==e.whiteSpace,h=(t||e.content).split("\n"),p=0;for(l=0;l<h.length;l++)for(n="NoWrap"!==e.textWrapping?h[parseInt(l.toString(),10)].split(" "):h,d=0;d<n.length;d++){var c,g,u;Ue(n[parseInt(d.toString(),10)],e)>e.width&&0<n[parseInt(d.toString(),10)].length&&"NoWrap"!==e.textWrapping?(1<h.length&&(n[parseInt(d.toString(),10)]=n[parseInt(d.toString(),10)]+"\n"),g=e.content,e.content=n[parseInt(d.toString(),10)],c=function(e,t,i,n,o){var a,r=0,s=t||e.content;for(a="",a+=s[0],r=0;r<s.length;r++){var l,d;(l=Ue(a,e))>=e.width&&0<a.length?(d=1.2*e.fontSize-He(a,e),o=o+He(a,e)+d,(null==n||o<=n||n<o&&0===i.length)&&(i[i.length]={text:a,x:0,dy:0,width:l}),a=""):(l=Ue(a+=s[r+1]||"",e),Math.ceil(l)+2>=e.width&&0<a.length&&(a=a.slice(0,-1),d=1.2*e.fontSize-He(a,e),o=o+He(a,e)+d,l=Ue(a,e),(null==n||o<=n||n<o&&0===i.length)&&(i[i.length]={text:a,x:0,dy:0,width:l}),a=s[r+1]||""),r===s.length-1&&0<a.length&&(d=1.2*e.fontSize-He(a,e),o=o+He(a,e)+d,(null==n||o<=n||n<o&&0===i.length)&&(i[i.length]={text:a,x:0,dy:0,width:l}),a=""))}return{childNode:i,height:o}}(e,s,r,i,p),r=c.childNode,p=c.height,e.content=g):(s+=((0!==d||1===n.length)&&A&&0<s.length?" ":"")+n[parseInt(d.toString(),10)],g=Ue(c=s+(n[d+1]||""),e)," "===e.content[e.content.indexOf(s)+s.length]&&(g+=Ue(" ",e)),1<h.length&&d===n.length-1&&(s+="\n"),Math.floor(g)>e.width-2&&0<s.length?(t=s,u=1.2*e.fontSize-He(s,e),p=p+He(s,e)+u,(null==i||p<=i||i<p&&0===r.length)&&(r[r.length]={text:-1===s.indexOf("\n")&&d!==n.length-1?s+" ":t,x:0,dy:0,width:c===s?g:s===a?o:Ue(s,e)}),s=""):d===n.length-1&&(u=1.2*e.fontSize-He(s,e),p=p+He(s,e)+u,void 0===i||p<=i||i<p&&0===r.length)&&(r[r.length]={text:s,x:0,dy:0,width:g},s=""),a=c,o=g)}return r}(e,t,i);else a[a.length]={text:s,x:0,dy:0,width:Ue(s,e)};return a}function De(e,t,i){var n,o=[],a=0,r=t||e.content;if("nowrap"!==e.whiteSpace&&"pre"!==e.whiteSpace)if("breakall"===e.breakWord)for(n="",n+=r[0],a=0;a<r.length;a++){var s=Ue(n,e);"\n"===n&&(n=r[a+1],a++),s>=e.width&&0<n.length?(n="\n"===r[a+1]?n+r[a+1]:n,o[o.length]={text:n,x:0,dy:0,width:s},n=""):(s=Ue(n+=r[a+1]||"",e),(Math.ceil(s)+2>=e.width&&0<n.length||-1<n.indexOf("\n"))&&(s=Ue(n=n.slice(0,-1),e),n="\n"===r[a+1]?n+r[a+1]:n,o[o.length]={text:n,x:0,dy:0,width:s},n=r[a+1]||""),a===r.length-1&&0<n.length&&(n="\n"===r[a+1]?n+r[a+1]:n,o[o.length]={text:n,x:0,dy:0,width:s},n=""))}else o=function(e,t,i){var n,o,a,r=[],s="",l=0,d=0,A="nowrap"!==e.whiteSpace,h=(t||e.content).split("\n"),p=0,c=e.thickness*(96/72),g=void 0!==e.thickness?4*c:5;for(l=0;l<h.length&&!(0<r.length&&r.length*e.fontSize*1.2+g>i);l++){n="NoWrap"!==e.textWrapping?h[parseInt(l.toString(),10)].split(" "):h;var u=void 0!==e.thickness?Math.floor(i):i;for(d=0;d<n.length;d++){var f=void 0!==e.thickness?Math.ceil(p):p;if(m=Ue(n[parseInt(d.toString(),10)],e),(void 0!==e.thickness?4*c+m:m)>e.width&&0<n[parseInt(d.toString(),10)].length&&"NoWrap"!==e.textWrapping&&f<u)1<h.length&&(n[parseInt(d.toString(),10)]=n[parseInt(d.toString(),10)]+"\n"),e.content=n[parseInt(d.toString(),10)],r=function(e,t,i,n){var o,a=0,r=t||e.content,s=(o="",0),l=(o+=r[0],void 0!==e.thickness?4*Math.ceil(e.thickness*(96/72)):0);for(a=0;a<r.length;a++){var d;(d=Ue(o,e))+l>=e.width&&0<o.length?((null==n||s<n)&&(i[i.length]={text:o,x:0,dy:0,width:d}),s=s+He(o,e)+l,l=0,o=""):(d=Ue(o+=r[a+1]||"",e)+l,Math.ceil(d)+2>=e.width&&0<o.length&&(s=s+He(o,e)+l,l=0,o=o.slice(0,-1),d=Ue(o,e),(null==n||s<=n)&&(i[i.length]={text:o,x:0,dy:0,width:d}),o=r[a+1]||""),a===r.length-1&&0<o.length&&(1<e.strokeWidth&&"Point"===e.relativeMode&&(s=s+He(o,e)+l,l=0),(null==n||s<=n)&&(i[i.length]={text:o,x:0,dy:0,width:d}),o=""))}return i}(e,s,r,i);else{s+=((0!==d||1===n.length)&&A&&0<s.length?" ":"")+n[parseInt(d.toString(),10)];var m=void 0!==e.thickness&&d+1!==n.length?" ":"",w=Ue(m=s+m+(n[d+1]||""),e),y=(1<h.length&&d===n.length-1&&(s+="\n"),"\n"===s),C=d+1>=n.length&&""===h[parseInt((l+1).toString(),10)],B=void 0!==e.thickness?4*Math.ceil(c)+Math.ceil(w)+2:Math.ceil(w)+2,S=void 0!==e.thickness?2*c:0;if(0===r.length&&void 0!==e.thickness&&0!=g&&u<g){p=p+Qe(s)*He(s,e)+g;break}if((void 0!==e.thickness?Math.floor(e.width):e.width)<=B&&0<s.length){if(t=s,null==i||f<u||0===r.length&&1.2*e.fontSize>i)r[r.length]={text:-1===s.indexOf("\n")&&d!==n.length-1?s+" ":t,x:0,dy:0,width:m===s?w:s===a?o:Ue(s,e)},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));else if(void 0!==e.thickness&&u<=f&&He(s,e)>S){r[r.length]={text:-1===s.indexOf("\n")&&d!==n.length?s+" ":t,x:0,dy:0,width:m===s?w:s===a?o:Ue(s,e)},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));break}B=y||C?s:s.replace(/\n/g,"");p=p+Qe(B)*He(B,e)+S,s=""}else if(d===n.length-1){if(void 0===i||f<u||0===r.length&&1.2*e.fontSize>i)r[r.length]={text:s,x:0,dy:0,width:w},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));else if(void 0!==e.thickness&&u<=f&&He(s,e)>S){r[r.length]={text:s,x:0,dy:0,width:w},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));break}B=y||C?s:s.replace(/\n/g,"");p=p+Qe(B)*He(B,e)+S,s=""}a=m,o=w}}}return r}(e,t,i);else o[o.length]={text:r,x:0,dy:0,width:Ue(r,e)};return o}function Te(e,t,i){var n,o=[],a=0,r=t||e.content;if("nowrap"!==e.whiteSpace&&"pre"!==e.whiteSpace)if("breakall"===e.breakWord)for(n="",n+=r[0],a=0;a<r.length;a++){var s=ze(n,e);"\n"===n&&(n=r[a+1],a++),s>=e.width&&0<n.length?(n="\n"===r[a+1]?n+r[a+1]:n,o[o.length]={text:n,x:0,dy:0,width:s},n=""):(s=ze(n+=r[a+1]||"",e),(Math.ceil(s)+2>=e.width&&0<n.length||-1<n.indexOf("\n"))&&(s=ze(n=n.slice(0,-1),e),n="\n"===r[a+1]?n+r[a+1]:n,o[o.length]={text:n,x:0,dy:0,width:s},n=r[a+1]||""),a===r.length-1&&0<n.length&&(n="\n"===r[a+1]?n+r[a+1]:n,o[o.length]={text:n,x:0,dy:0,width:s},n=""))}else o=function(e,t,i){var n,o,a,r=[],s="",l=0,d=0,A="nowrap"!==e.whiteSpace,h=(t||e.content).split("\n"),p=0,c=e.thickness*(96/72),g=void 0!==e.thickness?1==c||0==c?4*c:4+c:5;for(l=0;l<h.length&&!(0<r.length&&r.length*e.fontSize*1.2+g>i);l++){n="NoWrap"!==e.textWrapping?h[parseInt(l.toString(),10)].split(" "):h;var u=void 0!==e.thickness?Math.floor(i):i;for(d=0;d<n.length;d++){var f=void 0!==e.thickness?Math.ceil(p):p;if(m=ze(n[parseInt(d.toString(),10)],e),(void 0!==e.thickness?1==c||0==c?2*c+m:2*c+4+m:m)>e.width&&0<n[parseInt(d.toString(),10)].length&&"NoWrap"!==e.textWrapping&&f<u){1<h.length&&(n[parseInt(d.toString(),10)]=n[parseInt(d.toString(),10)]+"\n");var m=e.content,w=(e.content=n[parseInt(d.toString(),10)],function(e,t,i,n,o){var a,r=0,s=t||e.content,l=(a="",a+=s[0],void 0===e.thickness||0!==e.thickness&&1!==e.thickness?Math.ceil(e.thickness*(96/72))+4:Math.ceil(e.thickness*(96/72)));for(r=0;r<s.length;r++){var d;(d=ze(a,e))+l>=e.width&&0<a.length?((null==n||o+l<n||0===i.length)&&(i[i.length]={text:a,x:0,dy:0,width:d}),o+=He(a,e),a=s[r+1]||""):(d=ze(a+=s[r+1]||"",e)+l,Math.ceil(d)+2>=e.width&&0<a.length&&(o+=He(a,e),a=a.slice(0,-1),d=ze(a,e),!(null==n||o+l<=n)&&0!==i.length||(i[i.length]={text:a,x:0,dy:0,width:d}),a=s[r+1]||""),r===s.length-1&&0<a.length&&(o+=He(a,e),!(null==n||o+l<=n)&&0!==i.length||(i[i.length]={text:a,x:0,dy:0,width:d}),a=""))}return{childNode:i,height:o}}(e,s,r,i,p));r=w.childNode,p=w.height,e.content=m}else{s+=((0!==d||1===n.length)&&A&&0<s.length?" ":"")+n[parseInt(d.toString(),10)];var w=void 0!==e.thickness&&d+1!==n.length?" ":"",y=ze(m=s+w+(n[d+1]||""),e),C=(1<h.length&&d===n.length-1&&(s+="\n"),"\n"===s),B=d+1>=n.length&&""===h[parseInt((l+1).toString(),10)],S=void 0!==e.thickness?1==c?Math.floor(c)+Math.ceil(y):2*Math.floor(c)+4+Math.ceil(y)+2:Math.ceil(y)+2;if(0===r.length&&void 0!==e.thickness&&0!=g&&u<g){p=p+Qe(s)*He(s,e)+g;break}if((void 0!==e.thickness?Math.floor(e.width):e.width)<=S+1&&0<s.length){if(t=s,null==i||f<u||0===r.length&&1.2*e.fontSize>i)r[r.length]={text:-1===s.indexOf("\n")&&d!==n.length-1?s+" ":t,x:0,dy:0,width:m===s?y:s===a?o:ze(s,e)},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));else if(void 0!==e.thickness&&u<=f){r[r.length]={text:-1===s.indexOf("\n")&&d!==n.length?s+" ":t,x:0,dy:0,width:m===s?y:s===a?o:ze(s,e)},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));break}S=C||B?s:s.replace(/\n/g,"");p+=Qe(S)*He(S,e),s=""}else if(d===n.length-1){if(void 0===i||f<u||0===r.length&&1.2*e.fontSize>i)r[r.length]={text:s,x:0,dy:0,width:y},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));else if(void 0!==e.thickness&&u<=f){r[r.length]={text:s,x:0,dy:0,width:y},"justify"===e.textAlign&&void 0!==e.thickness&&(r[r.length-1].width=Math.floor(e.width));break}S=C||B?s:s.replace(/\n/g,"");p+=Qe(S)*He(S,e),s=""}a=m,o=y}}}return r}(e,t,i);else o[o.length]={text:r,x:0,dy:0,width:ze(r,e)};return o}function Qe(e){e=e.split(/\r?\n/);return e.some(function(e){return 0<e.trim().length})?e.length:1}function Fe(e,t,i,n,o,a){var r,s,l=new fe(0,0),d=(r=n,(r={fill:(d=e).style.fill,stroke:d.style.strokeColor,angle:d.rotateAngle+d.parentTransform,pivotX:d.pivot.x,pivotY:d.pivot.y,strokeWidth:d.style.strokeWidth,dashArray:d.style.strokeDashArray,opacity:d.style.opacity,visible:d.visible,id:d.id,width:r||d.actualSize.width,height:d.actualSize.height,x:d.offsetX-d.actualSize.width*d.pivot.x+.5,y:d.offsetY-d.actualSize.height*d.pivot.y+.5,relativeMode:d.relativeMode}).fontSize=d.style.fontSize,r.fontFamily=d.style.fontFamily,r.textOverflow=d.style.textOverflow,r.textDecoration=d.style.textDecoration,r.doWrap=d.doWrap,r.whiteSpace=Ye(d.style.whiteSpace,d.style.textWrapping),r.content=d.content,r.textWrapping=d.style.textWrapping,r.breakWord=Le(d.style.textWrapping),r.textAlign=Oe(d.style.textAlign),r.color=d.style.color,r.italic=d.style.italic,r.bold=d.style.bold,void 0!==d.thickness&&(r.thickness=d.thickness),r.dashArray="",r.strokeWidth=d.style.strokeWidth,r.fill="",r);return!0===e.isEJ2&&!0===e.isFreeText?(s=3*(r=Math.ceil(d.strokeWidth||0))*1.8,d.width=Math.max(0,d.width-s+r),d.height=Math.max(0,d.height-s),null!=o&&(o=Math.max(0,o-s+r/1.5)),e.childNodes=s=Me(d,a,o)):!0===e.isFreeText?(e.freeTextSelectorWidth=d.width||0,e.childNodes=s=Te(d,a,o)):e.childNodes=s=De(d,a,o),e.wrapBounds=r=function(e,t,i){for(var n,o,a={x:0,width:0},r=0,r=0;r<t.length;r++)o=n=t[parseInt(r.toString(),10)].width,n=!0===i?"left"===e.textAlign||"justify"===e.textAlign?0:"center"===e.textAlign?n>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)?0:-n/2:"right"===e.textAlign?-n:1<t.length?0:-n/2:"left"===e.textAlign?0:"center"===e.textAlign?n>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)?0:-n/2:"right"===e.textAlign?-n:1<t.length?0:-n/2,t[parseInt(r.toString(),10)].dy=1.2*e.fontSize,t[parseInt(r.toString(),10)].x=n,a?(a.x=Math.min(a.x,n),a.width=Math.max(a.width,o)):a={x:n,width:o};return a}(d,s,e.isEJ2),l.width=r.width,e.wrapBounds.width>=n&&"Wrap"!==d.textOverflow&&(l.width=n),l.height=s.length*e.style.fontSize*1.2,l}function ke(e,t){var i;return(i=t&&"undefined"!=typeof document?document.getElementById(t):i)?i.querySelector("#"+e):"undefined"!=typeof document?document.getElementById(e):null}function Pe(e,t){for(var e=le.createElement(e),i=e,n=t,o=Object.keys(n),a=0;a<o.length;a++)"style"===o[parseInt(a.toString(),10)]?i.style.cssText=n[o[parseInt(a.toString(),10)]]:i.setAttribute(o[parseInt(a.toString(),10)],n[o[parseInt(a.toString(),10)]]);return e}function Ne(){for(var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<5;n++)e="crypto"in window&&"getRandomValues"in crypto?(e=new Uint16Array(1),(window.msCrypto||window.crypto).getRandomValues(e)[0]%(t.length-1)):Math.floor(Math.random()*t.length),0===n&&e<10?n--:i+=t.substring(e,e+1);return i}function Re(e){new j;var t=e.offsetY-e.actualSize.height*e.pivot.y,i=e.offsetY+e.actualSize.height*(1-e.pivot.y),n=e.offsetX-e.actualSize.width*e.pivot.x,e=e.offsetX+e.actualSize.width*(1-e.pivot.x);return j.toBounds([{x:n,y:t},{x:e,y:t},{x:n,y:i},{x:e,y:i}])}function Oe(e){var t="";switch(e){case"Center":t="center";break;case"Left":t="left";break;case"Right":t="right";break;case"Justify":t="justify"}return t}function Le(e){var t="";switch(e){case"Wrap":t="breakall";break;case"NoWrap":t="keepall";break;case"WrapWithOverflow":t="normal";break;case"LineThrough":t="line-through"}return t}function Ue(e,t){var i="measureElement";window[i].style.visibility="visible";var n=ve(window[i].children[2])[1],e=(n.textContent=e,n.style.cssText="font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+";\n font-weight: "+(t.bold?"bold":"normal"),n.getBBox().width);return window[i].style.visibility="hidden",e}function ze(e,t){var i="measureElement";window[i].style.visibility="visible";var n=ve(window[i].children[2])[1],e=(e=e,o=" ".repeat(o=void 0===(o=7)?7:o),e.replace(/\t/g,o)),o=(n.textContent=e,n.style.cssText="font-size:"+t.fontSize+"px; font-family:"+t.fontFamily+"; \n font-weight:"+(t.bold?"bold":"normal"),n.getBBox().width);return window[i].style.visibility="hidden",o}function He(e,t){var i="measureElement";window[i].style.visibility="visible";var n=ve(window[i].children[2])[1],e=(n.textContent=e,n.style.cssText="font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+";\n font-weight: "+(t.bold?"bold":"normal"),n.getBBox().height);return window[i].style.visibility="hidden",e}function Ye(e,t){if("NoWrap"===t&&"PreserveAll"===e)return"pre";var i="";switch(e){case"CollapseAll":i="nowrap";break;case"CollapseSpace":i="pre-line";break;case"PreserveAll":i="pre-wrap"}return i}function je(e,t,i,n){var o;return 0!==e?(Se(o=Be(),e,t,i),S(o,n)):n}Je.prototype.setOffsetWithRespectToBounds=function(e,t,i){this.unitMode=i,this.position={x:e,y:t}},Je.prototype.getAbsolutePosition=function(e){if(void 0!==this.position)return"Absolute"===this.unitMode?this.position:{x:this.position.x*e.width,y:this.position.y*e.height}},Object.defineProperty(Je.prototype,"outerBounds",{get:function(){return this.floatingBounds||this.bounds},set:function(e){this.floatingBounds=e},enumerable:!0,configurable:!0}),Je.prototype.measure=function(e){var t=void 0!==this.width?this.width:(e.width||0)-this.margin.left-this.margin.right,i=void 0!==this.height?this.height:(e.height||0)-this.margin.top-this.margin.bottom;return this.desiredSize=new fe(t,i),this.isCalculateDesiredSize&&(this.desiredSize=this.validateDesiredSize(this.desiredSize,e)),this.desiredSize},Je.prototype.arrange=function(e){return this.actualSize=e,this.updateBounds(),this.actualSize},Je.prototype.updateBounds=function(){var e,t,i,n,o,a,r,s,l,d;this.bounds=(e=this,new j,i=(d=Re(e)).middleLeft,n=d.topCenter,o=d.bottomCenter,a=d.middleRight,r=d.topLeft,s=d.topRight,l=d.bottomLeft,d=d.bottomRight,e.corners={topLeft:r,topCenter:n,topRight:s,middleLeft:i,middleRight:a,bottomLeft:l,bottomCenter:o,bottomRight:d},0===e.rotateAngle&&0===e.parentTransform||(Se(t=Be(),e.rotateAngle+e.parentTransform,e.offsetX,e.offsetY),e.corners.topLeft=r=S(t,r),e.corners.topCenter=S(t,n),e.corners.topRight=s=S(t,s),e.corners.middleLeft=S(t,i),e.corners.middleRight=S(t,a),e.corners.bottomLeft=l=S(t,l),e.corners.bottomCenter=S(t,o),e.corners.bottomRight=d=S(t,d)),n=j.toBounds([r,s,l,d]),e.corners.left=n.left,e.corners.right=n.right,e.corners.top=n.top,e.corners.bottom=n.bottom,e.corners.center=n.center,e.corners.width=n.width,e.corners.height=n.height,n)},Je.prototype.validateDesiredSize=function(e,t){return!this.isRectElement||this.width||this.minWidth||this.maxWidth||(e.width=50),!this.isRectElement||this.height||this.minHeight||this.maxHeight||(e.height=50),(void 0===e||void 0!==this.width&&void 0!==this.height)&&((e=e||new fe).width=void 0===this.width?(t.width||0)-this.margin.left-this.margin.right:this.width,e.height=void 0===this.height?(t.height||0)-this.margin.top-this.margin.bottom:this.height),void 0!==this.minWidth&&(e.width=Math.max(e.width,this.minWidth)),void 0!==this.minHeight&&(e.height=Math.max(e.height,this.minHeight)),void 0!==this.maxWidth&&(e.width=Math.min(e.width,this.maxWidth)),void 0!==this.maxHeight&&(e.height=Math.min(e.height,this.maxHeight)),e};var Ge=Je;function Je(){this.pivot={x:.5,y:.5},this.rotateValue={x:0,y:0,angle:0},this.isDirt=!0,this.offsetX=0,this.offsetY=0,this.cornerRadius=0,this.minHeight=void 0,this.minWidth=void 0,this.maxWidth=void 0,this.maxHeight=void 0,this.width=void 0,this.height=void 0,this.horizontalAlignment="Auto",this.verticalAlignment="Auto",this.visible=!0,this.rotateAngle=0,this.margin={left:0,right:0,top:0,bottom:0},this.relativeMode="Point",this.transform=pe.Self|pe.Parent,this.style={fill:"white",strokeColor:"black",opacity:1,strokeWidth:1},this.desiredSize=new fe,this.actualSize=new fe,this.parentTransform=0,this.preventContainer=!1,this.bounds=new j(0,0,0,0),this.staticSize=!1,this.isRectElement=!1,this.isCalculateDesiredSize=!0,this.elementActions=ce.None,this.annotationType=void 0,this.position=void 0,this.unitMode=void 0,this.float=!1,this.floatingBounds=void 0}Ke=function(e,t){return(Ke=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ke(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ze,We=Ge),Ze.prototype.hasChildren=function(){return void 0!==this.children&&0<this.children.length},Ze.prototype.measure=function(e){var t,i=this.desiredBounds=void 0;if(this.hasChildren()){for(var n,o=0;o<this.children.length;o++){"Stretch"!==(t=this.children[parseInt(o.toString(),10)]).horizontalAlignment||e.width||(e.width=t.bounds.width),"Stretch"!==t.verticalAlignment||e.height||(e.height=t.bounds.height);var a="Stretch"===t.horizontalAlignment||"Stretch"===t.verticalAlignment;(this.measureChildren||a||t instanceof Ze&&void 0!==t.measureChildren)&&t.measure(e),a=this.GetChildrenBounds(t),"Stretch"!==t.horizontalAlignment&&"Stretch"!==t.verticalAlignment?void 0===this.desiredBounds?this.desiredBounds=a:this.desiredBounds.uniteRect(a):!this.actualSize||this.actualSize.width||this.actualSize.height||t.preventContainer||"Stretch"!==t.horizontalAlignment||"Stretch"!==t.verticalAlignment||(void 0===this.desiredBounds?this.desiredBounds=t.bounds:this.desiredBounds.uniteRect(t.bounds))}void 0!==this.desiredBounds&&0!==this.rotateAngle&&(n={x:this.desiredBounds.x+this.desiredBounds.width*this.pivot.x,y:this.desiredBounds.y+this.desiredBounds.height*this.pivot.y},n=je(this.rotateAngle,void 0,void 0,n),this.desiredBounds.x=n.x-this.desiredBounds.width*this.pivot.x,this.desiredBounds.y=n.y-this.desiredBounds.height*this.pivot.y),this.desiredBounds&&(i=new fe(this.desiredBounds.width,this.desiredBounds.height))}return i=this.validateDesiredSize(i,e),this.stretchChildren(i),this.desiredSize=i},Ze.prototype.arrange=function(e){var t=this.desiredBounds;if(t){this.offsetX,this.offsetY;if(this.offsetX=t.x+t.width*this.pivot.x,this.offsetY=t.y+t.height*this.pivot.y,this.hasChildren())for(var i=0;i<this.children.length;i++){var n,o=!1;"Stretch"===(n=this.children[parseInt(i.toString(),10)]).horizontalAlignment&&(n.offsetX=this.offsetX,n.parentTransform=this.parentTransform+this.rotateAngle,o=!0),"Stretch"===n.verticalAlignment&&(n.offsetY=this.offsetY,n.parentTransform=this.parentTransform+this.rotateAngle,o=!0),(o||this.measureChildren||n instanceof Ze&&void 0!==n.measureChildren)&&n.arrange(n.desiredSize)}}return this.actualSize=e,this.updateBounds(),this.prevRotateAngle=this.rotateAngle,e},Ze.prototype.stretchChildren=function(e){if(this.hasChildren())for(var t=0,i=this.children;t<i.length;t++){var n=i[t];"Stretch"!==n.horizontalAlignment&&void 0!==n.desiredSize.width||(n.desiredSize.width=e.width-n.margin.left-n.margin.right),"Stretch"!==n.verticalAlignment&&void 0!==n.desiredSize.height||(n.desiredSize.height=e.height-n.margin.top-n.margin.bottom),n instanceof Ze&&n.stretchChildren(n.desiredSize)}},Ze.prototype.findChildOffsetFromCenter=function(e,t){var i={x:t.x-e.desiredSize.width/2,y:t.y-e.desiredSize.height/2},i={x:i.x+e.desiredSize.width*e.pivot.x,y:i.y+e.desiredSize.height*e.pivot.y},i=je(e.rotateAngle,t.x,t.y,i);i=je(this.rotateAngle+this.parentTransform,this.offsetX,this.offsetY,i),e.offsetX=i.x,e.offsetY=i.y},Ze.prototype.GetChildrenBounds=function(e){var t=e.desiredSize.clone(),i=(e.rotateAngle,this.rotateAngle,e.offsetX),n=e.offsetY,i=i-t.width*e.pivot.x,n=n-t.height*e.pivot.y,o=i+t.width,t=n+t.height,a={x:i,y:n},n={x:o,y:n},i={x:i,y:t},o={x:o,y:t},a=je(e.rotateAngle,e.offsetX,e.offsetY,a),n=je(e.rotateAngle,e.offsetX,e.offsetY,n),i=je(e.rotateAngle,e.offsetX,e.offsetY,i),o=je(e.rotateAngle,e.offsetX,e.offsetY,o);return 0!==this.rotateAngle&&(a=je(-this.rotateAngle,void 0,void 0,a),n=je(-this.rotateAngle,void 0,void 0,n),i=je(-this.rotateAngle,void 0,void 0,i),o=je(-this.rotateAngle,void 0,void 0,o)),j.toBounds([a,n,i,o])};var Ke,We,_e=Ze;function Ze(){var e=null!==We&&We.apply(this,arguments)||this;return e.desiredBounds=void 0,e.measureChildren=!0,e.thickness=void 0,e.isSharpEdge=void 0,e.annotationType=void 0,e.prevRotateAngle=0,e}Xe=function(e,t){return(Xe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Xe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(et,qe=Ge),Object.defineProperty(et.prototype,"content",{get:function(){return this.textContent},set:function(e){this.textContent!==e&&(this.textContent=e,this.isDirt=!0,this.doWrap=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(et.prototype,"childNodes",{get:function(){return this.textNodes},set:function(e){this.textNodes=e},enumerable:!0,configurable:!0}),Object.defineProperty(et.prototype,"wrapBounds",{get:function(){return this.textWrapBounds},set:function(e){this.textWrapBounds=e},enumerable:!0,configurable:!0}),et.prototype.refreshTextElement=function(){this.isDirt=!0},et.prototype.measure=function(e){var t=this.isDirt&&this.canMeasure?Fe(this,this.style,this.content,this.width||e.width,e.height):this.desiredSize;return void 0===this.width||void 0===this.height?this.desiredSize=new fe(t.width,t.height):this.desiredSize=new fe(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},et.prototype.arrange=function(e){return e.width===this.actualSize.width&&e.height===this.actualSize.height&&!this.isDirt||(this.doWrap=!0),this.actualSize=e,this.updateBounds(),this.isDirt=!1,this.actualSize};var Xe,qe,$e=et;function et(){var e=qe.call(this)||this;return e.textContent="",e.canMeasure=!0,e.canConsiderBounds=!0,e.doWrap=!0,e.textNodes=[],e.style={color:"black",fill:"transparent",strokeColor:"black",strokeWidth:1,fontFamily:"Arial",fontSize:12,whiteSpace:"CollapseSpace",textWrapping:"WrapWithOverflow",textAlign:"Center",italic:!1,bold:!1,textDecoration:"None",strokeDashArray:"",opacity:1,textOverflow:"Wrap"},e.style.fill="transparent",e.style.strokeColor="transparent",e}tt=function(e,t){return(tt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}tt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ot,it=_e),ot.prototype.measure=function(e){var t,i,n,o,a=void 0,r=void 0;if(this.hasChildren()){for(var s,l,d=0,A=this.children;d<A.length;d++){var h=A[d];if(void 0!==this.thickness&&(h.thickness=this.thickness),h instanceof $e){if(!h.canMeasure)break;e.width=e.width||this.maxWidth||this.minWidth,h.measure(e)}else h instanceof $e||h.measure(e);var p=h.desiredSize.clone(),c=(0!==h.rotateAngle&&(t=p,i=h.rotateAngle,o=n=u=g=c=void 0,Se(u=Be(),i,0,0),i=S(u,{x:0,y:0}),c=S(u,{x:t.width,y:0}),g=S(u,{x:0,y:t.height}),u=S(u,{x:t.width,y:t.height}),t=Math.min(i.x,c.x,g.x,u.x),n=Math.min(i.y,c.y,g.y,u.y),o=Math.max(i.x,c.x,g.x,u.x),i=Math.max(i.y,c.y,g.y,u.y),p=new fe(o-t,i-n)),p.width+h.margin.right),g=p.height+h.margin.bottom,u=new j(h.margin.left,h.margin.top,c,g);if(h.float)if(void 0!==h.getAbsolutePosition(p))continue;h instanceof $e&&!(h instanceof $e&&h.canConsiderBounds)||(void 0===r?r=u:r.uniteRect(u))}r&&(l=s=0,s=Math.max(r.left,0),l=Math.max(r.top,0),a=new fe(r.width+s,r.height+l))}return a=it.prototype.validateDesiredSize.call(this,a,e),it.prototype.stretchChildren.call(this,a),this.desiredSize=a},ot.prototype.arrange=function(e){if(this.outerBounds=new j,this.hasChildren())for(var t=this.offsetY-e.height*this.pivot.y,i=this.offsetX-e.width*this.pivot.x,n=0,o=this.children;n<o.length;n++){var a,r,s,l,d,A,h=o[n];0!=(h.transform&pe.Parent)&&(h.parentTransform=this.parentTransform+this.rotateAngle,a=h.desiredSize.clone(),A=void 0,r={x:0,y:0},l=i,d=t,"Point"===h.relativeMode&&void 0!==(s=h.getAbsolutePosition(e))&&(l+=s.x,d+=s.y),r={x:(A="Object"===h.relativeMode?this.alignChildBasedOnParent(h,a,e,l,d):this.alignChildBasedOnaPoint(h,l,d)).x+a.width/2,y:A.y+a.height/2},h.rotateValue&&(s={x:this.offsetX+(h.rotateValue.x||0),y:this.offsetY+(h.rotateValue.y||0)},l={x:this.offsetX,y:this.offsetY},d=0|h.rotateValue.angle,Se(A=Be(),d,l.x,l.y),r=S(A,s)),it.prototype.findChildOffsetFromCenter.call(this,h,r)),"Stretch"===h.horizontalAlignment||"Stretch"===h.verticalAlignment?h.arrange(e):!(h instanceof $e&&h.canMeasure)&&h instanceof $e||(h.arrange(h.desiredSize),this.outerBounds.uniteRect(h.outerBounds))}return this.actualSize=e,this.updateBounds(),this.outerBounds.uniteRect(this.bounds),e},ot.prototype.alignChildBasedOnParent=function(e,t,i,n,o){switch(e.horizontalAlignment){case"Auto":case"Left":n+=e.margin.left;break;case"Right":n+=i.width-t.width-e.margin.right;break;case"Stretch":case"Center":n+=i.width/2-t.width/2}switch(e.verticalAlignment){case"Auto":case"Top":o+=e.margin.top;break;case"Bottom":o+=i.height-t.height-e.margin.bottom;break;case"Stretch":case"Center":o+=i.height/2-t.height/2}return{x:n,y:o}},ot.prototype.alignChildBasedOnaPoint=function(e,t,i){switch(t+=e.margin.left-e.margin.right,i+=e.margin.top-e.margin.bottom,e.horizontalAlignment){case"Auto":case"Left":break;case"Stretch":case"Center":t-=e.desiredSize.width*e.pivot.x;break;case"Right":t-=e.desiredSize.width}switch(e.verticalAlignment){case"Auto":case"Top":break;case"Stretch":case"Center":i-=e.desiredSize.height*e.pivot.y;break;case"Bottom":i-=e.desiredSize.height}return{x:t,y:i}};var tt,it,nt=ot;function ot(){var e=null!==it&&it.apply(this,arguments)||this;return e.measureChildren=void 0,e}at=function(e,t){return(at=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}at(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lt,rt=Ge),Object.defineProperty(lt.prototype,"source",{get:function(){return this.imageSource},set:function(e){this.imageSource=e,this.isDirt=!0},enumerable:!0,configurable:!0}),lt.prototype.measure=function(e){var t,i,n;return this.isDirt&&("Stretch"!==this.stretch||void 0===this.width&&void 0===this.height)&&(this.contentSize=(t=this.source,this.contentSize,i="measureElement",window[i].style.visibility="visible",(n=window[i].children[1]).setAttribute("src",t),n=(t=n.getBoundingClientRect()).width,t=t.height,n=new fe(n,t),window[i].style.visibility="hidden",n),this.isDirt=!1),void 0!==this.width&&void 0!==this.height?(this.desiredSize=new fe(this.width,this.height),this.contentSize=this.desiredSize):this.desiredSize=this.contentSize,this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},lt.prototype.arrange=function(e){return this.actualSize=new fe(this.desiredSize.width,this.desiredSize.height),this.updateBounds(),this.actualSize};var at,rt,st=lt;function lt(){var e=rt.call(this)||this;return e.imageSource="",e.printID="",e.imageScale="None",e.imageAlign="None",e.stretch="Stretch",e}function dt(e){var t,i=[],n=function(e){var t=/([a-z]+)|([+-]?(?:\d+\.?\d*|\.\d+))/gi,i=[],n=[],o={},a=(t.lastIndex=0,!1);o=t.exec(e);for(;o;)a="e"===o[1]||(o[1]?i="zm"===o[1].toLowerCase()?(i.length&&n.push(i),n.push(["Z"]),[o[1].substring(1,2)]):(i.length&&n.push(i),[o[1]]):(i.length||(i=[]),a||i.push(Number(o[2]))),!1),o=t.exec(e);i.length&&n.push(i);return n}(e);if(0<n.length)for(var o=0;o<n.length;o++){var a=n[parseInt(o.toString(),10)],r="";switch((r=a[0]).toLowerCase()){case"m":for(t=1;t<a.length;t++)i.push({command:r,x:a[parseInt(t.toString(),10)],y:a[t+1]}),t+=1,"m"===r?r="l":"M"===r&&(r="L");break;case"l":case"t":for(t=1;t<a.length;t++)i.push({command:r,x:a[parseInt(t.toString(),10)],y:a[t+1]}),t+=1;break;case"h":for(t=1;t<a.length;t++)i.push({command:r,x:a[parseInt(t.toString(),10)]});break;case"v":for(t=1;t<a.length;t++)i.push({command:r,y:a[parseInt(t.toString(),10)]});break;case"z":i.push({command:r});break;case"c":for(t=1;t<a.length;t++)i.push({command:r,x1:a[parseInt(t.toString(),10)],y1:a[t+1],x2:a[t+2],y2:a[t+3],x:a[t+4],y:a[t+5]}),t+=5;break;case"s":for(t=1;t<a.length;t++)i.push({command:r,x2:a[parseInt(t.toString(),10)],y2:a[t+1],x:a[t+2],y:a[t+3]}),t+=3;break;case"q":for(t=1;t<a.length;t++)i.push({command:r,x1:a[parseInt(t.toString(),10)],y1:a[t+1],x:a[t+2],y:a[t+3]}),t+=3;break;case"a":for(t=1;t<a.length;t++)i.push({command:r,r1:a[parseInt(t.toString(),10)],r2:a[t+1],angle:a[t+2],largeArc:a[t+3],sweep:a[t+4],x:a[t+5],y:a[t+6]}),t+=6}}return i}function At(e,t,i){for(var n,o="",a=[{x:0+(e=i/2<(e=t/2<e?t/2:e)?i/2:e),y:0},{x:0+i-e,y:0},{x:0+i,y:0+e},{x:0+i,y:0+t-e},{x:0+i-e,y:0+t},{x:0+e,y:0+t},{x:0,y:0+t-e},{x:0,y:0+e}],r=[{x:0+i,y:0},{x:0+i,y:0+t},{x:0,y:0+t},{x:0,y:0}],s=0,o="M"+a[0].x+" "+a[0].y,l=0;l<a.length;l+=2)o=(o+="L"+(n=a[l+1]).x+" "+n.y)+"Q"+r[s].x+" "+r[s].y+" "+(n=a[l+2]||a[0]).x+" "+n.y,s++;return o}function ht(e){for(var t,i,n,o,a,r,s=[],l=0,d=0,A=0,h=e.length;A<h;++A){var p,c,g=e[parseInt(A.toString(),10)],u=g.command,f=("y1"in g&&(o=g.y1),"y2"in g&&(r=g.y2),"x1"in g&&(n=g.x1),"x2"in g&&(a=g.x2),"x"in g&&(l=g.x),"y"in g&&(d=g.y),s[s.length-1]);switch(u){case"M":s.push({command:"M",x:l,y:d});break;case"L":s.push({command:"L",x0:t,y0:i,x:l,y:d});break;case"H":s.push({command:"L",x0:t,y0:i,x:l,y:i});break;case"V":s.push({command:"L",x0:t,y0:i,x:t,y:d});break;case"C":s.push({command:"C",x0:t,y0:i,x1:n,y1:o,x2:a,y2:r,x:l,y:d});break;case"S":f&&(p=void 0,c={x:2*t-(p="C"===f.command||"S"===f.command?{x:f.x2,y:f.y2}:{x:t,y:i}).x,y:2*i-p.y},s.push({command:"C",x0:t,y0:i,x1:c.x,y1:c.y,x2:a,y2:r,x:l,y:d}));break;case"Q":s.push({command:"Q",x0:t,y0:i,x1:n,y1:o,x:l,y:d});break;case"T":f&&(p=void 0,c={x:2*t-(p="Q"===f.command?{x:f.x1,y:f.y1}:{x:t,y:i}).x,y:2*i-p.y},s.push({command:"Q",x0:t,y0:i,x1:c.x,y1:c.y,x:l,y:d}));break;case"A":var m=g;m.command="A",s.push(m);break;case"Z":case"z":s.push({command:"Z"}),l=t,d=i}t=l,i=d}return s}function pt(e,t,i,n,o,a,r,s){for(var l,d,A,h,p=0,c=0,g=0,u=e.length;g<u;++g){var f=e[parseInt(g.toString(),10)],m=f.command;"x"in f&&(p=f.x),"y"in f&&(c=f.y),"y1"in f&&(d=f.y1),"y2"in f&&(h=f.y2),"x1"in f&&(l=f.x1),"x2"in f&&(A=f.x2),n?(void 0!==p&&(p=ct(p,t,o,r)),void 0!==c&&(c=ct(c,i,a,s)),void 0!==l&&(l=ct(l,t,o,r)),void 0!==d&&(d=ct(d,i,a,s)),void 0!==A&&(A=ct(A,t,o,r)),void 0!==h&&(h=ct(h,i,a,s))):(void 0!==p&&(p=Number((p+t).toFixed(2))),void 0!==c&&(c=Number((c+i).toFixed(2))),void 0!==l&&(l=Number((l+t).toFixed(2))),void 0!==d&&(d=Number((d+i).toFixed(2))),void 0!==A&&(A=Number((A+t).toFixed(2))),void 0!==h&&(h=Number((h+i).toFixed(2)))),(m=function(e,t,i,n,o,a){switch(t){case"M":case"L":e.x=i.x,e.y=i.y;break;case"H":e.x=i.x;break;case"V":e.y=i.y;break;case"C":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1,e.x2=i.x2,e.y2=i.y2;break;case"S":e.x=i.x,e.y=i.y,e.x2=i.x2,e.y2=i.y2;break;case"Q":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1;break;case"T":e.x=i.x,e.y=i.y;break;case"A":var r=i.r1,s=i.r2;n&&(i.r1=r*=o,i.r2=s*=a),e.x=i.x,e.y=i.y,e.r1=i.r1,e.r2=i.r2;break;case"z":case"Z":e={command:"Z"}}return e}(f,m,{x:p,y:c,x1:l,y1:d,x2:A,y2:h,r1:f.r1,r2:f.r2},n,t,i))&&(e[parseInt(g.toString(),10)]=m)}return ut(e)}function ct(e,t,i,n){return e!==i?e=n!==i?e*t-(Number(i)*t-Number(i))+(n-Number(i)):Number(e)*t-(Number(i)*t-Number(i)):n!==i&&(e=n),Number(e.toFixed(2))}function gt(e){for(var t,i,n,o,a,r,s=0,l=0,d=0,A=e.length;d<A;++d){var h=e[parseInt(d.toString(),10)],p=h.command;if(/[MLHVCSQTA]/.test(p))"x"in h&&(h.x=s=h.x),"y"in h&&(h.y=l=h.y);else{"x1"in h&&(h.x1=n=s+h.x1),"x2"in h&&(h.x2=a=s+h.x2),"y1"in h&&(h.y1=o=l+h.y1),"y2"in h&&(h.y2=r=l+h.y2),"x"in h&&(h.x=s+=h.x),"y"in h&&(h.y=l+=h.y);var c=void 0;switch(p){case"m":case"M":c={command:"M",x:s,y:l};break;case"l":case"L":c={command:"L",x:s,y:l};break;case"h":case"H":c={command:"H",x:s};break;case"v":case"V":c={command:"V",y:l};break;case"c":case"C":c={command:"C",x:s,y:l,x1:n,y1:o,x2:a,y2:r};break;case"s":case"S":c={command:"S",x:s,y:l,x2:a,y2:r};break;case"q":case"Q":c={command:"Q",x:s,y:l,x1:n,y1:o};break;case"t":case"T":c={command:"T",x:s,y:l};break;case"a":case"A":(c={command:"A",x:s,y:l}).r1=h.r1,c.r2=h.r2,c.angle=h.angle,c.largeArc=h.largeArc,c.sweep=h.sweep;break;case"z":case"Z":c={command:"Z"},s=t,l=i,c=e[parseInt(d.toString(),10)]}c&&(e[parseInt(d.toString(),10)]=c)}"M"!==p&&"m"!==p||(t=s,i=l)}return e}function ut(e){for(var t="",i=0;i<e.length;i++)t+=0===i?ft(e[parseInt(i.toString(),10)]):" "+ft(e[parseInt(i.toString(),10)]);return t}function ft(e){var t="";switch(e.command){case"Z":case"z":t=e.command;break;case"M":case"m":case"L":case"l":t=e.command+" "+e.x+" "+e.y;break;case"C":case"c":t=e.command+" "+e.x1+" "+e.y1+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"Q":case"q":t=e.command+" "+e.x1+" "+e.y1+" "+e.x+" "+e.y;break;case"A":case"a":var i=e.command,n=e.angle,o=e.largeArc?"1":"0",a=e.sweep?"1":"0",t=i+" "+e.r1+" "+e.r2+" "+n+" "+o+" "+a+" "+e.x+" "+e.y;break;case"H":case"h":t=e.command+" "+e.x;break;case"V":case"v":t=e.command+" "+e.y;break;case"S":case"s":t=e.command+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"T":case"t":t=e.command+" "+e.x+" "+e.y}return t}mt=function(e,t){return(mt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}mt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ct,wt=Ge),Object.defineProperty(Ct.prototype,"data",{get:function(){return this.pathData},set:function(e){this.pathData!==e&&(this.pathData=e,this.isDirt=!0)},enumerable:!0,configurable:!0}),Ct.prototype.measure=function(e){return this.staticSize&&void 0!==this.width&&void 0!==this.height?this.absoluteBounds=new j(this.offsetX-this.width*this.pivot.x,this.offsetY-this.height*this.pivot.y,this.width,this.height):(!this.isDirt||!this.transformPath&&void 0!==this.width&&void 0!==this.height||this.absoluteBounds&&0!==this.absoluteBounds.height)&&!this.canMeasurePath||(this.absoluteBounds=Ve(this.data||"")),void 0===this.width?this.desiredSize=new fe(this.absoluteBounds.width,this.height||this.absoluteBounds.height):void 0===this.height?this.desiredSize=new fe(this.width||this.absoluteBounds.width,this.absoluteBounds.height):this.desiredSize=new fe(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.canMeasurePath=!1,this.desiredSize},Ct.prototype.arrange=function(e){return!this.isDirt&&this.actualSize.width===e.width&&this.actualSize.height===e.height||(this.isDirt=!0,this.absolutePath=this.updatePath(this.data,this.absoluteBounds,e),this.staticSize)||(this.points=null),this.actualSize=this.desiredSize,this.updateBounds(),this.isDirt=!1,this.actualSize},Ct.prototype.updatePath=function(e,t,i){var n=!1,o="",a=-t.x,r=-t.y;return i.width===t.width&&i.height===t.height||(a=i.width/Number(t.width||1),r=i.height/Number(t.height||1),n=!0),i=gt(dt(e)),o=(n||this.isDirt)&&this.transformPath?pt(i,a,r,n,t.x,t.y,0,0):ut(i),n=!1,o};var mt,wt,yt=Ct;function Ct(){var e=wt.call(this)||this;return e.pathData="",e.transformPath=!0,e.absolutePath="",e.canMeasurePath=!1,e.absoluteBounds=new j,e}Bt=function(e,t){return(Bt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Bt,St,i=function(e,t){function i(){this.constructor=e}Bt(e,t),e.prototype=null===t?Object.create(t):(i.pro