vg-print 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,7 +124,7 @@ T* `):ze.join(` Tj
124
124
  `),$e}},Cross:{createAppearanceStream:function(_e){var $e={D:{Off:At.RadioButton.Cross.OffPushDown},N:{}};return $e.N[_e]=At.RadioButton.Cross.YesNormal,$e.D[_e]=At.RadioButton.Cross.YesPushDown,$e},getCA:function(){return"8"},YesNormal:function(_e){var $e=V$1(_e);$e.scope=_e.scope;var Ae=[],je=At.internal.calculateCross(_e);return Ae.push("q"),Ae.push("1 1 "+U$1(At.internal.getWidth(_e)-2)+" "+U$1(At.internal.getHeight(_e)-2)+" re"),Ae.push("W"),Ae.push("n"),Ae.push(U$1(je.x1.x)+" "+U$1(je.x1.y)+" m"),Ae.push(U$1(je.x2.x)+" "+U$1(je.x2.y)+" l"),Ae.push(U$1(je.x4.x)+" "+U$1(je.x4.y)+" m"),Ae.push(U$1(je.x3.x)+" "+U$1(je.x3.y)+" l"),Ae.push("s"),Ae.push("Q"),$e.stream=Ae.join(`
125
125
  `),$e},YesPushDown:function(_e){var $e=V$1(_e);$e.scope=_e.scope;var Ae=At.internal.calculateCross(_e),je=[];return je.push("0.749023 g"),je.push("0 0 "+U$1(At.internal.getWidth(_e))+" "+U$1(At.internal.getHeight(_e))+" re"),je.push("f"),je.push("q"),je.push("1 1 "+U$1(At.internal.getWidth(_e)-2)+" "+U$1(At.internal.getHeight(_e)-2)+" re"),je.push("W"),je.push("n"),je.push(U$1(Ae.x1.x)+" "+U$1(Ae.x1.y)+" m"),je.push(U$1(Ae.x2.x)+" "+U$1(Ae.x2.y)+" l"),je.push(U$1(Ae.x4.x)+" "+U$1(Ae.x4.y)+" m"),je.push(U$1(Ae.x3.x)+" "+U$1(Ae.x3.y)+" l"),je.push("s"),je.push("Q"),$e.stream=je.join(`
126
126
  `),$e},OffPushDown:function(_e){var $e=V$1(_e);$e.scope=_e.scope;var Ae=[];return Ae.push("0.749023 g"),Ae.push("0 0 "+U$1(At.internal.getWidth(_e))+" "+U$1(At.internal.getHeight(_e))+" re"),Ae.push("f"),$e.stream=Ae.join(`
127
- `),$e}}},createDefaultAppearanceStream:function(_e){var $e=_e.scope.internal.getFont(_e.fontName,_e.fontStyle).id,Ae=_e.scope.__private__.encodeColorString(_e.color);return"/"+$e+" "+_e.fontSize+" Tf "+Ae}};At.internal={Bezier_C:.551915024494,calculateCross:function(_e){var $e=At.internal.getWidth(_e),Ae=At.internal.getHeight(_e),je=Math.min($e,Ae);return{x1:{x:($e-je)/2,y:(Ae-je)/2+je},x2:{x:($e-je)/2+je,y:(Ae-je)/2},x3:{x:($e-je)/2,y:(Ae-je)/2},x4:{x:($e-je)/2+je,y:(Ae-je)/2+je}}}},At.internal.getWidth=function(_e){var $e=0;return _typeof$2(_e)==="object"&&($e=W(_e.Rect[2])),$e},At.internal.getHeight=function(_e){var $e=0;return _typeof$2(_e)==="object"&&($e=W(_e.Rect[3])),$e};var xt=q.addField=function(_e){if(at(this,_e),!(_e instanceof lt))throw new Error("Invalid argument passed to jsPDF.addField.");var $e;return($e=_e).scope.internal.acroformPlugin.printedOut&&($e.scope.internal.acroformPlugin.printedOut=!1,$e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),$e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push($e),_e.page=_e.scope.internal.getCurrentPageInfo().pageNumber,this};q.AcroFormChoiceField=ft,q.AcroFormListBox=dt,q.AcroFormComboBox=pt,q.AcroFormEditBox=gt,q.AcroFormButton=mt,q.AcroFormPushButton=vt,q.AcroFormRadioButton=bt,q.AcroFormCheckBox=wt,q.AcroFormTextField=Nt,q.AcroFormPasswordField=Lt,q.AcroFormAppearance=At,q.AcroForm={ChoiceField:ft,ListBox:dt,ComboBox:pt,EditBox:gt,Button:mt,PushButton:vt,RadioButton:bt,CheckBox:wt,TextField:Nt,PasswordField:Lt,Appearance:At},E$1.AcroForm={ChoiceField:ft,ListBox:dt,ComboBox:pt,EditBox:gt,Button:mt,PushButton:vt,RadioButton:bt,CheckBox:wt,TextField:Nt,PasswordField:Lt,Appearance:At};E$1.AcroForm;function _t(_e){return _e.reduce(function($e,Ae,je){return $e[Ae]=je,$e},{})}(function(_e){_e.__addimage__={};var $e="UNKNOWN",Ae={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},je=_e.__addimage__.getImageFileTypeByImageData=function(Ge,Je){var ir,ar,lr,dr,gr,hr=$e;if((Je=Je||$e)==="RGBA"||Ge.data!==void 0&&Ge.data instanceof Uint8ClampedArray&&"height"in Ge&&"width"in Ge)return"RGBA";if(Ze(Ge))for(gr in Ae)for(lr=Ae[gr],ir=0;ir<lr.length;ir+=1){for(dr=!0,ar=0;ar<lr[ir].length;ar+=1)if(lr[ir][ar]!==void 0&&lr[ir][ar]!==Ge[ar]){dr=!1;break}if(dr===!0){hr=gr;break}}else for(gr in Ae)for(lr=Ae[gr],ir=0;ir<lr.length;ir+=1){for(dr=!0,ar=0;ar<lr[ir].length;ar+=1)if(lr[ir][ar]!==void 0&&lr[ir][ar]!==Ge.charCodeAt(ar)){dr=!1;break}if(dr===!0){hr=gr;break}}return hr===$e&&Je!==$e&&(hr=Je),hr},ke=function Ge(Je){for(var ir=this.internal.write,ar=this.internal.putStream,lr=(0,this.internal.getFilters)();lr.indexOf("FlateEncode")!==-1;)lr.splice(lr.indexOf("FlateEncode"),1);Je.objectId=this.internal.newObject();var dr=[];if(dr.push({key:"Type",value:"/XObject"}),dr.push({key:"Subtype",value:"/Image"}),dr.push({key:"Width",value:Je.width}),dr.push({key:"Height",value:Je.height}),Je.colorSpace===Oe.INDEXED?dr.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(Je.palette.length/3-1)+" "+("sMask"in Je&&Je.sMask!==void 0?Je.objectId+2:Je.objectId+1)+" 0 R]"}):(dr.push({key:"ColorSpace",value:"/"+Je.colorSpace}),Je.colorSpace===Oe.DEVICE_CMYK&&dr.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),dr.push({key:"BitsPerComponent",value:Je.bitsPerComponent}),"decodeParameters"in Je&&Je.decodeParameters!==void 0&&dr.push({key:"DecodeParms",value:"<<"+Je.decodeParameters+">>"}),"transparency"in Je&&Array.isArray(Je.transparency)){for(var gr="",hr=0,kr=Je.transparency.length;hr<kr;hr++)gr+=Je.transparency[hr]+" "+Je.transparency[hr]+" ";dr.push({key:"Mask",value:"["+gr+"]"})}Je.sMask!==void 0&&dr.push({key:"SMask",value:Je.objectId+1+" 0 R"});var Ar=Je.filter!==void 0?["/"+Je.filter]:void 0;if(ar({data:Je.data,additionalKeyValues:dr,alreadyAppliedFilters:Ar,objectId:Je.objectId}),ir("endobj"),"sMask"in Je&&Je.sMask!==void 0){var Rr="/Predictor "+Je.predictor+" /Colors 1 /BitsPerComponent "+Je.bitsPerComponent+" /Columns "+Je.width,or={width:Je.width,height:Je.height,colorSpace:"DeviceGray",bitsPerComponent:Je.bitsPerComponent,decodeParameters:Rr,data:Je.sMask};"filter"in Je&&(or.filter=Je.filter),Ge.call(this,or)}if(Je.colorSpace===Oe.INDEXED){var pr=this.internal.newObject();ar({data:St(new Uint8Array(Je.palette)),objectId:pr}),ir("endobj")}},Ie=function(){var Ge=this.internal.collections.addImage_images;for(var Je in Ge)ke.call(this,Ge[Je])},xe=function(){var Ge,Je=this.internal.collections.addImage_images,ir=this.internal.write;for(var ar in Je)ir("/I"+(Ge=Je[ar]).index,Ge.objectId,"0","R")},Be=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",Ie),this.internal.events.subscribe("putXobjectDict",xe))},Ce=function(){var Ge=this.internal.collections.addImage_images;return Be.call(this),Ge},Ee=function(){return Object.keys(this.internal.collections.addImage_images).length},Se=function(Ge){return typeof _e["process"+Ge.toUpperCase()]=="function"},Pe=function(Ge){return _typeof$2(Ge)==="object"&&Ge.nodeType===1},Te=function(Ge,Je){if(Ge.nodeName==="IMG"&&Ge.hasAttribute("src")){var ir=""+Ge.getAttribute("src");if(ir.indexOf("data:image/")===0)return u$2(unescape(ir).split("base64,").pop());var ar=_e.loadFile(ir,!0);if(ar!==void 0)return ar}if(Ge.nodeName==="CANVAS"){if(Ge.width===0||Ge.height===0)throw new Error("Given canvas must have data. Canvas width: "+Ge.width+", height: "+Ge.height);var lr;switch(Je){case"PNG":lr="image/png";break;case"WEBP":lr="image/webp";break;case"JPEG":case"JPG":default:lr="image/jpeg"}return u$2(Ge.toDataURL(lr,1).split("base64,").pop())}},Me=function(Ge){var Je=this.internal.collections.addImage_images;if(Je){for(var ir in Je)if(Ge===Je[ir].alias)return Je[ir]}},Fe=function(Ge,Je,ir){return Ge||Je||(Ge=-96,Je=-96),Ge<0&&(Ge=-1*ir.width*72/Ge/this.internal.scaleFactor),Je<0&&(Je=-1*ir.height*72/Je/this.internal.scaleFactor),Ge===0&&(Ge=Je*ir.width/ir.height),Je===0&&(Je=Ge*ir.height/ir.width),[Ge,Je]},De=function(Ge,Je,ir,ar,lr,dr){var gr=Fe.call(this,ir,ar,lr),hr=this.internal.getCoordinateString,kr=this.internal.getVerticalCoordinateString,Ar=Ce.call(this);if(ir=gr[0],ar=gr[1],Ar[lr.index]=lr,dr){dr*=Math.PI/180;var Rr=Math.cos(dr),or=Math.sin(dr),pr=function(Br){return Br.toFixed(4)},jr=[pr(Rr),pr(or),pr(-1*or),pr(Rr),0,0,"cm"]}this.internal.write("q"),dr?(this.internal.write([1,"0","0",1,hr(Ge),kr(Je+ar),"cm"].join(" ")),this.internal.write(jr.join(" ")),this.internal.write([hr(ir),"0","0",hr(ar),"0","0","cm"].join(" "))):this.internal.write([hr(ir),"0","0",hr(ar),hr(Ge),kr(Je+ar),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+lr.index+" Do"),this.internal.write("Q")},Oe=_e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};_e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var Qe=_e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},We=_e.__addimage__.sHashCode=function(Ge){var Je,ir,ar=0;if(typeof Ge=="string")for(ir=Ge.length,Je=0;Je<ir;Je++)ar=(ar<<5)-ar+Ge.charCodeAt(Je),ar|=0;else if(Ze(Ge))for(ir=Ge.byteLength/2,Je=0;Je<ir;Je++)ar=(ar<<5)-ar+Ge[Je],ar|=0;return ar},Ye=_e.__addimage__.validateStringAsBase64=function(Ge){(Ge=Ge||"").toString().trim();var Je=!0;return Ge.length===0&&(Je=!1),Ge.length%4!=0&&(Je=!1),/^[A-Za-z0-9+/]+$/.test(Ge.substr(0,Ge.length-2))===!1&&(Je=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(Ge.substr(-2))===!1&&(Je=!1),Je},Xe=_e.__addimage__.extractImageFromDataUrl=function(Ge){var Je=(Ge=Ge||"").split("base64,"),ir=null;if(Je.length===2){var ar=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(Je[0]);Array.isArray(ar)&&(ir={mimeType:ar[1],charset:ar[2],data:Je[1]})}return ir},rr=_e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};_e.__addimage__.isArrayBuffer=function(Ge){return rr()&&Ge instanceof ArrayBuffer};var Ze=_e.__addimage__.isArrayBufferView=function(Ge){return rr()&&typeof Uint32Array<"u"&&(Ge instanceof Int8Array||Ge instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&Ge instanceof Uint8ClampedArray||Ge instanceof Int16Array||Ge instanceof Uint16Array||Ge instanceof Int32Array||Ge instanceof Uint32Array||Ge instanceof Float32Array||Ge instanceof Float64Array)},Ke=_e.__addimage__.binaryStringToUint8Array=function(Ge){for(var Je=Ge.length,ir=new Uint8Array(Je),ar=0;ar<Je;ar++)ir[ar]=Ge.charCodeAt(ar);return ir},St=_e.__addimage__.arrayBufferToBinaryString=function(Ge){for(var Je="",ir=Ze(Ge)?Ge:new Uint8Array(Ge),ar=0;ar<ir.length;ar+=8192)Je+=String.fromCharCode.apply(null,ir.subarray(ar,ar+8192));return Je};_e.addImage=function(){var Ge,Je,ir,ar,lr,dr,gr,hr,kr;if(typeof arguments[1]=="number"?(Je=$e,ir=arguments[1],ar=arguments[2],lr=arguments[3],dr=arguments[4],gr=arguments[5],hr=arguments[6],kr=arguments[7]):(Je=arguments[1],ir=arguments[2],ar=arguments[3],lr=arguments[4],dr=arguments[5],gr=arguments[6],hr=arguments[7],kr=arguments[8]),_typeof$2(Ge=arguments[0])==="object"&&!Pe(Ge)&&"imageData"in Ge){var Ar=Ge;Ge=Ar.imageData,Je=Ar.format||Je||$e,ir=Ar.x||ir||0,ar=Ar.y||ar||0,lr=Ar.w||Ar.width||lr,dr=Ar.h||Ar.height||dr,gr=Ar.alias||gr,hr=Ar.compression||hr,kr=Ar.rotation||Ar.angle||kr}var Rr=this.internal.getFilters();if(hr===void 0&&Rr.indexOf("FlateEncode")!==-1&&(hr="SLOW"),isNaN(ir)||isNaN(ar))throw new Error("Invalid coordinates passed to jsPDF.addImage");Be.call(this);var or=tr.call(this,Ge,Je,gr,hr);return De.call(this,ir,ar,lr,dr,or,kr),this};var tr=function(Ge,Je,ir,ar){var lr,dr,gr;if(typeof Ge=="string"&&je(Ge)===$e){Ge=unescape(Ge);var hr=qe(Ge,!1);(hr!==""||(hr=_e.loadFile(Ge,!0))!==void 0)&&(Ge=hr)}if(Pe(Ge)&&(Ge=Te(Ge,Je)),Je=je(Ge,Je),!Se(Je))throw new Error("addImage does not support files of type '"+Je+"', please ensure that a plugin for '"+Je+"' support is added.");if(((gr=ir)==null||gr.length===0)&&(ir=function(kr){return typeof kr=="string"||Ze(kr)?We(kr):Ze(kr.data)?We(kr.data):null}(Ge)),(lr=Me.call(this,ir))||(rr()&&(Ge instanceof Uint8Array||Je==="RGBA"||(dr=Ge,Ge=Ke(Ge))),lr=this["process"+Je.toUpperCase()](Ge,Ee.call(this),ir,function(kr){return kr&&typeof kr=="string"&&(kr=kr.toUpperCase()),kr in _e.image_compression?kr:Qe.NONE}(ar),dr)),!lr)throw new Error("An unknown error occurred whilst processing the image.");return lr},qe=_e.__addimage__.convertBase64ToBinaryString=function(Ge,Je){var ir;Je=typeof Je!="boolean"||Je;var ar,lr="";if(typeof Ge=="string"){ar=(ir=Xe(Ge))!==null?ir.data:Ge;try{lr=u$2(ar)}catch(dr){if(Je)throw Ye(ar)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+dr.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return lr};_e.getImageProperties=function(Ge){var Je,ir,ar="";if(Pe(Ge)&&(Ge=Te(Ge)),typeof Ge=="string"&&je(Ge)===$e&&((ar=qe(Ge,!1))===""&&(ar=_e.loadFile(Ge)||""),Ge=ar),ir=je(Ge),!Se(ir))throw new Error("addImage does not support files of type '"+ir+"', please ensure that a plugin for '"+ir+"' support is added.");if(!rr()||Ge instanceof Uint8Array||(Ge=Ke(Ge)),!(Je=this["process"+ir.toUpperCase()](Ge)))throw new Error("An unknown error occurred whilst processing the image");return Je.fileType=ir,Je}})(E$1.API),function(_e){var $e=function(Ae){if(Ae!==void 0&&Ae!="")return!0};E$1.API.events.push(["addPage",function(Ae){this.internal.getPageInfo(Ae.pageNumber).pageContext.annotations=[]}]),_e.events.push(["putPage",function(Ae){for(var je,ke,Ie,xe=this.internal.getCoordinateString,Be=this.internal.getVerticalCoordinateString,Ce=this.internal.getPageInfoByObjId(Ae.objId),Ee=Ae.pageContext.annotations,Se=!1,Pe=0;Pe<Ee.length&&!Se;Pe++)switch((je=Ee[Pe]).type){case"link":($e(je.options.url)||$e(je.options.pageNumber))&&(Se=!0);break;case"reference":case"text":case"freetext":Se=!0}if(Se!=0){this.internal.write("/Annots [");for(var Te=0;Te<Ee.length;Te++){je=Ee[Te];var Me=this.internal.pdfEscape,Fe=this.internal.getEncryptor(Ae.objId);switch(je.type){case"reference":this.internal.write(" "+je.object.objId+" 0 R ");break;case"text":var De=this.internal.newAdditionalObject(),Oe=this.internal.newAdditionalObject(),Qe=this.internal.getEncryptor(De.objId),We=je.title||"Note";Ie="<</Type /Annot /Subtype /Text "+(ke="/Rect ["+xe(je.bounds.x)+" "+Be(je.bounds.y+je.bounds.h)+" "+xe(je.bounds.x+je.bounds.w)+" "+Be(je.bounds.y)+"] ")+"/Contents ("+Me(Qe(je.contents))+")",Ie+=" /Popup "+Oe.objId+" 0 R",Ie+=" /P "+Ce.objId+" 0 R",Ie+=" /T ("+Me(Qe(We))+") >>",De.content=Ie;var Ye=De.objId+" 0 R";Ie="<</Type /Annot /Subtype /Popup "+(ke="/Rect ["+xe(je.bounds.x+30)+" "+Be(je.bounds.y+je.bounds.h)+" "+xe(je.bounds.x+je.bounds.w+30)+" "+Be(je.bounds.y)+"] ")+" /Parent "+Ye,je.open&&(Ie+=" /Open true"),Ie+=" >>",Oe.content=Ie,this.internal.write(De.objId,"0 R",Oe.objId,"0 R");break;case"freetext":ke="/Rect ["+xe(je.bounds.x)+" "+Be(je.bounds.y)+" "+xe(je.bounds.x+je.bounds.w)+" "+Be(je.bounds.y+je.bounds.h)+"] ";var Xe=je.color||"#000000";Ie="<</Type /Annot /Subtype /FreeText "+ke+"/Contents ("+Me(Fe(je.contents))+")",Ie+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+Xe+")",Ie+=" /Border [0 0 0]",Ie+=" >>",this.internal.write(Ie);break;case"link":if(je.options.name){var rr=this.annotations._nameMap[je.options.name];je.options.pageNumber=rr.page,je.options.top=rr.y}else je.options.top||(je.options.top=0);if(ke="/Rect ["+je.finalBounds.x+" "+je.finalBounds.y+" "+je.finalBounds.w+" "+je.finalBounds.h+"] ",Ie="",je.options.url)Ie="<</Type /Annot /Subtype /Link "+ke+"/Border [0 0 0] /A <</S /URI /URI ("+Me(Fe(je.options.url))+") >>";else if(je.options.pageNumber)switch(Ie="<</Type /Annot /Subtype /Link "+ke+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(je.options.pageNumber).objId+" 0 R",je.options.magFactor=je.options.magFactor||"XYZ",je.options.magFactor){case"Fit":Ie+=" /Fit]";break;case"FitH":Ie+=" /FitH "+je.options.top+"]";break;case"FitV":je.options.left=je.options.left||0,Ie+=" /FitV "+je.options.left+"]";break;case"XYZ":default:var Ze=Be(je.options.top);je.options.left=je.options.left||0,je.options.zoom===void 0&&(je.options.zoom=0),Ie+=" /XYZ "+je.options.left+" "+Ze+" "+je.options.zoom+"]"}Ie!=""&&(Ie+=" >>",this.internal.write(Ie))}}this.internal.write("]")}}]),_e.createAnnotation=function(Ae){var je=this.internal.getCurrentPageInfo();switch(Ae.type){case"link":this.link(Ae.bounds.x,Ae.bounds.y,Ae.bounds.w,Ae.bounds.h,Ae);break;case"text":case"freetext":je.pageContext.annotations.push(Ae)}},_e.link=function(Ae,je,ke,Ie,xe){var Be=this.internal.getCurrentPageInfo(),Ce=this.internal.getCoordinateString,Ee=this.internal.getVerticalCoordinateString;Be.pageContext.annotations.push({finalBounds:{x:Ce(Ae),y:Ee(je),w:Ce(Ae+ke),h:Ee(je+Ie)},options:xe,type:"link"})},_e.textWithLink=function(Ae,je,ke,Ie){var xe,Be,Ce=this.getTextWidth(Ae),Ee=this.internal.getLineHeight()/this.internal.scaleFactor;if(Ie.maxWidth!==void 0){Be=Ie.maxWidth;var Se=this.splitTextToSize(Ae,Be).length;xe=Math.ceil(Ee*Se)}else Be=Ce,xe=Ee;return this.text(Ae,je,ke,Ie),ke+=.2*Ee,Ie.align==="center"&&(je-=Ce/2),Ie.align==="right"&&(je-=Ce),this.link(je,ke-Ee,Be,xe,Ie),Ce},_e.getTextWidth=function(Ae){var je=this.internal.getFontSize();return this.getStringUnitWidth(Ae)*je/this.internal.scaleFactor}}(E$1.API),function(_e){var $e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},Ae={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},je={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},ke=[1570,1571,1573,1575];_e.__arabicParser__={};var Ie=_e.__arabicParser__.isInArabicSubstitutionA=function(De){return $e[De.charCodeAt(0)]!==void 0},xe=_e.__arabicParser__.isArabicLetter=function(De){return typeof De=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(De)},Be=_e.__arabicParser__.isArabicEndLetter=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length<=2},Ce=_e.__arabicParser__.isArabicAlfLetter=function(De){return xe(De)&&ke.indexOf(De.charCodeAt(0))>=0};_e.__arabicParser__.arabicLetterHasIsolatedForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length>=1};var Ee=_e.__arabicParser__.arabicLetterHasFinalForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length>=2};_e.__arabicParser__.arabicLetterHasInitialForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length>=3};var Se=_e.__arabicParser__.arabicLetterHasMedialForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length==4},Pe=_e.__arabicParser__.resolveLigatures=function(De){var Oe=0,Qe=Ae,We="",Ye=0;for(Oe=0;Oe<De.length;Oe+=1)Qe[De.charCodeAt(Oe)]!==void 0?(Ye++,typeof(Qe=Qe[De.charCodeAt(Oe)])=="number"&&(We+=String.fromCharCode(Qe),Qe=Ae,Ye=0),Oe===De.length-1&&(Qe=Ae,We+=De.charAt(Oe-(Ye-1)),Oe-=Ye-1,Ye=0)):(Qe=Ae,We+=De.charAt(Oe-Ye),Oe-=Ye,Ye=0);return We};_e.__arabicParser__.isArabicDiacritic=function(De){return De!==void 0&&je[De.charCodeAt(0)]!==void 0};var Te=_e.__arabicParser__.getCorrectForm=function(De,Oe,Qe){return xe(De)?Ie(De)===!1?-1:!Ee(De)||!xe(Oe)&&!xe(Qe)||!xe(Qe)&&Be(Oe)||Be(De)&&!xe(Oe)||Be(De)&&Ce(Oe)||Be(De)&&Be(Oe)?0:Se(De)&&xe(Oe)&&!Be(Oe)&&xe(Qe)&&Ee(Qe)?3:Be(De)||!xe(Qe)?1:2:-1},Me=function(De){var Oe=0,Qe=0,We=0,Ye="",Xe="",rr="",Ze=(De=De||"").split("\\s+"),Ke=[];for(Oe=0;Oe<Ze.length;Oe+=1){for(Ke.push(""),Qe=0;Qe<Ze[Oe].length;Qe+=1)Ye=Ze[Oe][Qe],Xe=Ze[Oe][Qe-1],rr=Ze[Oe][Qe+1],xe(Ye)?(We=Te(Ye,Xe,rr),Ke[Oe]+=We!==-1?String.fromCharCode($e[Ye.charCodeAt(0)][We]):Ye):Ke[Oe]+=Ye;Ke[Oe]=Pe(Ke[Oe])}return Ke.join(" ")},Fe=_e.__arabicParser__.processArabic=_e.processArabic=function(){var De,Oe=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,Qe=[];if(Array.isArray(Oe)){var We=0;for(Qe=[],We=0;We<Oe.length;We+=1)Array.isArray(Oe[We])?Qe.push([Me(Oe[We][0]),Oe[We][1],Oe[We][2]]):Qe.push([Me(Oe[We])]);De=Qe}else De=Me(Oe);return typeof arguments[0]=="string"?De:(arguments[0].text=De,arguments[0])};_e.events.push(["preProcessText",Fe])}(E$1.API),E$1.API.autoPrint=function(_e){var $e;switch((_e=_e||{}).variant=_e.variant||"non-conform",_e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){$e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+$e+" 0 R")})}return this},function(_e){var $e=function(){var Ae=void 0;Object.defineProperty(this,"pdf",{get:function(){return Ae},set:function(Be){Ae=Be}});var je=150;Object.defineProperty(this,"width",{get:function(){return je},set:function(Be){je=isNaN(Be)||Number.isInteger(Be)===!1||Be<0?150:Be,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=je+1)}});var ke=300;Object.defineProperty(this,"height",{get:function(){return ke},set:function(Be){ke=isNaN(Be)||Number.isInteger(Be)===!1||Be<0?300:Be,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=ke+1)}});var Ie=[];Object.defineProperty(this,"childNodes",{get:function(){return Ie},set:function(Be){Ie=Be}});var xe={};Object.defineProperty(this,"style",{get:function(){return xe},set:function(Be){xe=Be}}),Object.defineProperty(this,"parentNode",{})};$e.prototype.getContext=function(Ae,je){var ke;if((Ae=Ae||"2d")!=="2d")return null;for(ke in je)this.pdf.context2d.hasOwnProperty(ke)&&(this.pdf.context2d[ke]=je[ke]);return this.pdf.context2d._canvas=this,this.pdf.context2d},$e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},_e.events.push(["initialized",function(){this.canvas=new $e,this.canvas.pdf=this}])}(E$1.API),function(_e){var $e={left:0,top:0,bottom:0,right:0},Ae=!1,je=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},$e),this.internal.__cell__.margins.width=this.getPageWidth(),ke.call(this))},ke=function(){this.internal.__cell__.lastCell=new Ie,this.internal.__cell__.pages=1},Ie=function(){var Ce=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Ce},set:function(De){Ce=De}});var Ee=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Ee},set:function(De){Ee=De}});var Se=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return Se},set:function(De){Se=De}});var Pe=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return Pe},set:function(De){Pe=De}});var Te=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return Te},set:function(De){Te=De}});var Me=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return Me},set:function(De){Me=De}});var Fe=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return Fe},set:function(De){Fe=De}}),this};Ie.prototype.clone=function(){return new Ie(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},Ie.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},_e.setHeaderFunction=function(Ce){return je.call(this),this.internal.__cell__.headerFunction=typeof Ce=="function"?Ce:void 0,this},_e.getTextDimensions=function(Ce,Ee){je.call(this);var Se=(Ee=Ee||{}).fontSize||this.getFontSize(),Pe=Ee.font||this.getFont(),Te=Ee.scaleFactor||this.internal.scaleFactor,Me=0,Fe=0,De=0,Oe=this;if(!Array.isArray(Ce)&&typeof Ce!="string"){if(typeof Ce!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");Ce=String(Ce)}var Qe=Ee.maxWidth;Qe>0?typeof Ce=="string"?Ce=this.splitTextToSize(Ce,Qe):Object.prototype.toString.call(Ce)==="[object Array]"&&(Ce=Ce.reduce(function(Ye,Xe){return Ye.concat(Oe.splitTextToSize(Xe,Qe))},[])):Ce=Array.isArray(Ce)?Ce:[Ce];for(var We=0;We<Ce.length;We++)Me<(De=this.getStringUnitWidth(Ce[We],{font:Pe})*Se)&&(Me=De);return Me!==0&&(Fe=Ce.length),{w:Me/=Te,h:Math.max((Fe*Se*this.getLineHeightFactor()-Se*(this.getLineHeightFactor()-1))/Te,0)}},_e.cellAddPage=function(){je.call(this),this.addPage();var Ce=this.internal.__cell__.margins||$e;return this.internal.__cell__.lastCell=new Ie(Ce.left,Ce.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var xe=_e.cell=function(){var Ce;Ce=arguments[0]instanceof Ie?arguments[0]:new Ie(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),je.call(this);var Ee=this.internal.__cell__.lastCell,Se=this.internal.__cell__.padding,Pe=this.internal.__cell__.margins||$e,Te=this.internal.__cell__.tableHeaderRow,Me=this.internal.__cell__.printHeaders;return Ee.lineNumber!==void 0&&(Ee.lineNumber===Ce.lineNumber?(Ce.x=(Ee.x||0)+(Ee.width||0),Ce.y=Ee.y||0):Ee.y+Ee.height+Ce.height+Pe.bottom>this.getPageHeight()?(this.cellAddPage(),Ce.y=Pe.top,Me&&Te&&(this.printHeaderRow(Ce.lineNumber,!0),Ce.y+=Te[0].height)):Ce.y=Ee.y+Ee.height||Ce.y),Ce.text[0]!==void 0&&(this.rect(Ce.x,Ce.y,Ce.width,Ce.height,Ae===!0?"FD":void 0),Ce.align==="right"?this.text(Ce.text,Ce.x+Ce.width-Se,Ce.y+Se,{align:"right",baseline:"top"}):Ce.align==="center"?this.text(Ce.text,Ce.x+Ce.width/2,Ce.y+Se,{align:"center",baseline:"top",maxWidth:Ce.width-Se-Se}):this.text(Ce.text,Ce.x+Se,Ce.y+Se,{align:"left",baseline:"top",maxWidth:Ce.width-Se-Se})),this.internal.__cell__.lastCell=Ce,this};_e.table=function(Ce,Ee,Se,Pe,Te){if(je.call(this),!Se)throw new Error("No data for PDF table.");var Me,Fe,De,Oe,Qe=[],We=[],Ye=[],Xe={},rr={},Ze=[],Ke=[],St=(Te=Te||{}).autoSize||!1,tr=Te.printHeaders!==!1,qe=Te.css&&Te.css["font-size"]!==void 0?16*Te.css["font-size"]:Te.fontSize||12,Ge=Te.margins||Object.assign({width:this.getPageWidth()},$e),Je=typeof Te.padding=="number"?Te.padding:3,ir=Te.headerBackgroundColor||"#c8c8c8",ar=Te.headerTextColor||"#000";if(ke.call(this),this.internal.__cell__.printHeaders=tr,this.internal.__cell__.margins=Ge,this.internal.__cell__.table_font_size=qe,this.internal.__cell__.padding=Je,this.internal.__cell__.headerBackgroundColor=ir,this.internal.__cell__.headerTextColor=ar,this.setFontSize(qe),Pe==null)We=Qe=Object.keys(Se[0]),Ye=Qe.map(function(){return"left"});else if(Array.isArray(Pe)&&_typeof$2(Pe[0])==="object")for(Qe=Pe.map(function(Ar){return Ar.name}),We=Pe.map(function(Ar){return Ar.prompt||Ar.name||""}),Ye=Pe.map(function(Ar){return Ar.align||"left"}),Me=0;Me<Pe.length;Me+=1)rr[Pe[Me].name]=Pe[Me].width*(19.049976/25.4);else Array.isArray(Pe)&&typeof Pe[0]=="string"&&(We=Qe=Pe,Ye=Qe.map(function(){return"left"}));if(St||Array.isArray(Pe)&&typeof Pe[0]=="string")for(Me=0;Me<Qe.length;Me+=1){for(Xe[Oe=Qe[Me]]=Se.map(function(Ar){return Ar[Oe]}),this.setFont(void 0,"bold"),Ze.push(this.getTextDimensions(We[Me],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),Fe=Xe[Oe],this.setFont(void 0,"normal"),De=0;De<Fe.length;De+=1)Ze.push(this.getTextDimensions(Fe[De],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);rr[Oe]=Math.max.apply(null,Ze)+Je+Je,Ze=[]}if(tr){var lr={};for(Me=0;Me<Qe.length;Me+=1)lr[Qe[Me]]={},lr[Qe[Me]].text=We[Me],lr[Qe[Me]].align=Ye[Me];var dr=Be.call(this,lr,rr);Ke=Qe.map(function(Ar){return new Ie(Ce,Ee,rr[Ar],dr,lr[Ar].text,void 0,lr[Ar].align)}),this.setTableHeaderRow(Ke),this.printHeaderRow(1,!1)}var gr=Pe.reduce(function(Ar,Rr){return Ar[Rr.name]=Rr.align,Ar},{});for(Me=0;Me<Se.length;Me+=1){"rowStart"in Te&&Te.rowStart instanceof Function&&Te.rowStart({row:Me,data:Se[Me]},this);var hr=Be.call(this,Se[Me],rr);for(De=0;De<Qe.length;De+=1){var kr=Se[Me][Qe[De]];"cellStart"in Te&&Te.cellStart instanceof Function&&Te.cellStart({row:Me,col:De,data:kr},this),xe.call(this,new Ie(Ce,Ee,rr[Qe[De]],hr,kr,Me+2,gr[Qe[De]]))}}return this.internal.__cell__.table_x=Ce,this.internal.__cell__.table_y=Ee,this};var Be=function(Ce,Ee){var Se=this.internal.__cell__.padding,Pe=this.internal.__cell__.table_font_size,Te=this.internal.scaleFactor;return Object.keys(Ce).map(function(Me){var Fe=Ce[Me];return this.splitTextToSize(Fe.hasOwnProperty("text")?Fe.text:Fe,Ee[Me]-Se-Se)},this).map(function(Me){return this.getLineHeightFactor()*Me.length*Pe/Te+Se+Se},this).reduce(function(Me,Fe){return Math.max(Me,Fe)},0)};_e.setTableHeaderRow=function(Ce){je.call(this),this.internal.__cell__.tableHeaderRow=Ce},_e.printHeaderRow=function(Ce,Ee){if(je.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var Se;if(Ae=!0,typeof this.internal.__cell__.headerFunction=="function"){var Pe=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new Ie(Pe[0],Pe[1],Pe[2],Pe[3],void 0,-1)}this.setFont(void 0,"bold");for(var Te=[],Me=0;Me<this.internal.__cell__.tableHeaderRow.length;Me+=1){Se=this.internal.__cell__.tableHeaderRow[Me].clone(),Ee&&(Se.y=this.internal.__cell__.margins.top||0,Te.push(Se)),Se.lineNumber=Ce;var Fe=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),xe.call(this,Se),this.setTextColor(Fe)}Te.length>0&&this.setTableHeaderRow(Te),this.setFont(void 0,"normal"),Ae=!1}}(E$1.API);var Pt={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},kt=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],It=_t(kt),Ft=[100,200,300,400,500,600,700,800,900],Ct=_t(Ft);function jt(_e){var $e=_e.family.replace(/"|'/g,"").toLowerCase(),Ae=function(Ie){return Pt[Ie=Ie||"normal"]?Ie:"normal"}(_e.style),je=function(Ie){if(!Ie)return 400;if(typeof Ie=="number")return Ie>=100&&Ie<=900&&Ie%100==0?Ie:400;if(/^\d00$/.test(Ie))return parseInt(Ie);switch(Ie){case"bold":return 700;case"normal":default:return 400}}(_e.weight),ke=function(Ie){return typeof It[Ie=Ie||"normal"]=="number"?Ie:"normal"}(_e.stretch);return{family:$e,style:Ae,weight:je,stretch:ke,src:_e.src||[],ref:_e.ref||{name:$e,style:[ke,Ae,je].join(" ")}}}function Ot(_e,$e,Ae,je){var ke;for(ke=Ae;ke>=0&&ke<$e.length;ke+=je)if(_e[$e[ke]])return _e[$e[ke]];for(ke=Ae;ke>=0&&ke<$e.length;ke-=je)if(_e[$e[ke]])return _e[$e[ke]]}var Bt={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Mt={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Et(_e){return[_e.stretch,_e.style,_e.weight,_e.family].join(" ")}function qt(_e,$e,Ae){for(var je=(Ae=Ae||{}).defaultFontFamily||"times",ke=Object.assign({},Bt,Ae.genericFontFamilies||{}),Ie=null,xe=null,Be=0;Be<$e.length;++Be)if(ke[(Ie=jt($e[Be])).family]&&(Ie.family=ke[Ie.family]),_e.hasOwnProperty(Ie.family)){xe=_e[Ie.family];break}if(!(xe=xe||_e[je]))throw new Error("Could not find a font-family for the rule '"+Et(Ie)+"' and default family '"+je+"'.");if(xe=function(Ce,Ee){if(Ee[Ce])return Ee[Ce];var Se=It[Ce],Pe=Se<=It.normal?-1:1,Te=Ot(Ee,kt,Se,Pe);if(!Te)throw new Error("Could not find a matching font-stretch value for "+Ce);return Te}(Ie.stretch,xe),xe=function(Ce,Ee){if(Ee[Ce])return Ee[Ce];for(var Se=Pt[Ce],Pe=0;Pe<Se.length;++Pe)if(Ee[Se[Pe]])return Ee[Se[Pe]];throw new Error("Could not find a matching font-style for "+Ce)}(Ie.style,xe),!(xe=function(Ce,Ee){if(Ee[Ce])return Ee[Ce];if(Ce===400&&Ee[500])return Ee[500];if(Ce===500&&Ee[400])return Ee[400];var Se=Ct[Ce],Pe=Ot(Ee,Ft,Se,Ce<400?-1:1);if(!Pe)throw new Error("Could not find a matching font-weight for value "+Ce);return Pe}(Ie.weight,xe)))throw new Error("Failed to resolve a font for the rule '"+Et(Ie)+"'.");return xe}function Dt(_e){return _e.trimLeft()}function Rt(_e,$e){for(var Ae=0;Ae<_e.length;){if(_e.charAt(Ae)===$e)return[_e.substring(0,Ae),_e.substring(Ae+1)];Ae+=1}return null}function Tt(_e){var $e=_e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return $e===null?null:[$e[0],_e.substring($e[0].length)]}var Ut,zt,Ht,Wt=["times"];(function(_e){var $e,Ae,je,ke,Ie,xe,Be,Ce,Ee,Se=function(or){return or=or||{},this.isStrokeTransparent=or.isStrokeTransparent||!1,this.strokeOpacity=or.strokeOpacity||1,this.strokeStyle=or.strokeStyle||"#000000",this.fillStyle=or.fillStyle||"#000000",this.isFillTransparent=or.isFillTransparent||!1,this.fillOpacity=or.fillOpacity||1,this.font=or.font||"10px sans-serif",this.textBaseline=or.textBaseline||"alphabetic",this.textAlign=or.textAlign||"left",this.lineWidth=or.lineWidth||1,this.lineJoin=or.lineJoin||"miter",this.lineCap=or.lineCap||"butt",this.path=or.path||[],this.transform=or.transform!==void 0?or.transform.clone():new Ce,this.globalCompositeOperation=or.globalCompositeOperation||"normal",this.globalAlpha=or.globalAlpha||1,this.clip_path=or.clip_path||[],this.currentPoint=or.currentPoint||new xe,this.miterLimit=or.miterLimit||10,this.lastPoint=or.lastPoint||new xe,this.lineDashOffset=or.lineDashOffset||0,this.lineDash=or.lineDash||[],this.margin=or.margin||[0,0,0,0],this.prevPageLastElemOffset=or.prevPageLastElemOffset||0,this.ignoreClearRect=typeof or.ignoreClearRect!="boolean"||or.ignoreClearRect,this};_e.events.push(["initialized",function(){this.context2d=new Pe(this),$e=this.internal.f2,Ae=this.internal.getCoordinateString,je=this.internal.getVerticalCoordinateString,ke=this.internal.getHorizontalCoordinate,Ie=this.internal.getVerticalCoordinate,xe=this.internal.Point,Be=this.internal.Rectangle,Ce=this.internal.Matrix,Ee=new Se}]);var Pe=function(or){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var pr=or;Object.defineProperty(this,"pdf",{get:function(){return pr}});var jr=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return jr},set:function(Wr){jr=!!Wr}});var Br=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Br},set:function(Wr){Br=!!Wr}});var Mr=0;Object.defineProperty(this,"posX",{get:function(){return Mr},set:function(Wr){isNaN(Wr)||(Mr=Wr)}});var Fr=0;Object.defineProperty(this,"posY",{get:function(){return Fr},set:function(Wr){isNaN(Wr)||(Fr=Wr)}}),Object.defineProperty(this,"margin",{get:function(){return Ee.margin},set:function(Wr){var Cr;typeof Wr=="number"?Cr=[Wr,Wr,Wr,Wr]:((Cr=new Array(4))[0]=Wr[0],Cr[1]=Wr.length>=2?Wr[1]:Cr[0],Cr[2]=Wr.length>=3?Wr[2]:Cr[0],Cr[3]=Wr.length>=4?Wr[3]:Cr[1]),Ee.margin=Cr}});var Lr=!1;Object.defineProperty(this,"autoPaging",{get:function(){return Lr},set:function(Wr){Lr=Wr}});var Dr=0;Object.defineProperty(this,"lastBreak",{get:function(){return Dr},set:function(Wr){Dr=Wr}});var zr=[];Object.defineProperty(this,"pageBreaks",{get:function(){return zr},set:function(Wr){zr=Wr}}),Object.defineProperty(this,"ctx",{get:function(){return Ee},set:function(Wr){Wr instanceof Se&&(Ee=Wr)}}),Object.defineProperty(this,"path",{get:function(){return Ee.path},set:function(Wr){Ee.path=Wr}});var ti=[];Object.defineProperty(this,"ctxStack",{get:function(){return ti},set:function(Wr){ti=Wr}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Wr){var Cr;Cr=Te(Wr),this.ctx.fillStyle=Cr.style,this.ctx.isFillTransparent=Cr.a===0,this.ctx.fillOpacity=Cr.a,this.pdf.setFillColor(Cr.r,Cr.g,Cr.b,{a:Cr.a}),this.pdf.setTextColor(Cr.r,Cr.g,Cr.b,{a:Cr.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Wr){var Cr=Te(Wr);this.ctx.strokeStyle=Cr.style,this.ctx.isStrokeTransparent=Cr.a===0,this.ctx.strokeOpacity=Cr.a,Cr.a===0?this.pdf.setDrawColor(255,255,255):(Cr.a,this.pdf.setDrawColor(Cr.r,Cr.g,Cr.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Wr){["butt","round","square"].indexOf(Wr)!==-1&&(this.ctx.lineCap=Wr,this.pdf.setLineCap(Wr))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Wr){isNaN(Wr)||(this.ctx.lineWidth=Wr,this.pdf.setLineWidth(Wr))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Wr){["bevel","round","miter"].indexOf(Wr)!==-1&&(this.ctx.lineJoin=Wr,this.pdf.setLineJoin(Wr))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Wr){isNaN(Wr)||(this.ctx.miterLimit=Wr,this.pdf.setMiterLimit(Wr))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Wr){this.ctx.textBaseline=Wr}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Wr){["right","end","center","left","start"].indexOf(Wr)!==-1&&(this.ctx.textAlign=Wr)}});var pi=null;function ci(Wr,Cr){if(pi===null){var Ci=function(mi){var oi=[];return Object.keys(mi).forEach(function(ui){mi[ui].forEach(function(_i){var Ai=null;switch(_i){case"bold":Ai={family:ui,weight:"bold"};break;case"italic":Ai={family:ui,style:"italic"};break;case"bolditalic":Ai={family:ui,weight:"bold",style:"italic"};break;case"":case"normal":Ai={family:ui}}Ai!==null&&(Ai.ref={name:ui,style:_i},oi.push(Ai))})}),oi}(Wr.getFontList());pi=function(mi){for(var oi={},ui=0;ui<mi.length;++ui){var _i=jt(mi[ui]),Ai=_i.family,ki=_i.stretch,yi=_i.style,Hi=_i.weight;oi[Ai]=oi[Ai]||{},oi[Ai][ki]=oi[Ai][ki]||{},oi[Ai][ki][yi]=oi[Ai][ki][yi]||{},oi[Ai][ki][yi][Hi]=_i}return oi}(Ci.concat(Cr))}return pi}var wi=null;Object.defineProperty(this,"fontFaces",{get:function(){return wi},set:function(Wr){pi=null,wi=Wr}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Wr){var Cr;if(this.ctx.font=Wr,(Cr=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Wr))!==null){var Ci=Cr[1],mi=(Cr[2],Cr[3]),oi=Cr[4],ui=(Cr[5],Cr[6]),_i=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(oi)[2];oi=Math.floor(_i==="px"?parseFloat(oi)*this.pdf.internal.scaleFactor:_i==="em"?parseFloat(oi)*this.pdf.getFontSize():parseFloat(oi)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(oi);var Ai=function(xi){var Ti,vi,aa=[],Ki=xi.trim();if(Ki==="")return Wt;if(Ki in Mt)return[Mt[Ki]];for(;Ki!=="";){switch(vi=null,Ti=(Ki=Dt(Ki)).charAt(0)){case'"':case"'":vi=Rt(Ki.substring(1),Ti);break;default:vi=Tt(Ki)}if(vi===null||(aa.push(vi[0]),(Ki=Dt(vi[1]))!==""&&Ki.charAt(0)!==","))return Wt;Ki=Ki.replace(/^,/,"")}return aa}(ui);if(this.fontFaces){var ki=qt(ci(this.pdf,this.fontFaces),Ai.map(function(xi){return{family:xi,stretch:"normal",weight:mi,style:Ci}}));this.pdf.setFont(ki.ref.name,ki.ref.style)}else{var yi="";(mi==="bold"||parseInt(mi,10)>=700||Ci==="bold")&&(yi="bold"),Ci==="italic"&&(yi+="italic"),yi.length===0&&(yi="normal");for(var Hi="",Pi={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Ri=0;Ri<Ai.length;Ri++){if(this.pdf.internal.getFont(Ai[Ri],yi,{noFallback:!0,disableWarning:!0})!==void 0){Hi=Ai[Ri];break}if(yi==="bolditalic"&&this.pdf.internal.getFont(Ai[Ri],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Hi=Ai[Ri],yi="bold";else if(this.pdf.internal.getFont(Ai[Ri],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Hi=Ai[Ri],yi="normal";break}}if(Hi===""){for(var Vi=0;Vi<Ai.length;Vi++)if(Pi[Ai[Vi]]){Hi=Pi[Ai[Vi]];break}}Hi=Hi===""?"Times":Hi,this.pdf.setFont(Hi,yi)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Wr){this.ctx.globalCompositeOperation=Wr}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Wr){this.ctx.globalAlpha=Wr}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Wr){this.ctx.lineDashOffset=Wr,Rr.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Wr){this.ctx.lineDash=Wr,Rr.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Wr){this.ctx.ignoreClearRect=!!Wr}})};Pe.prototype.setLineDash=function(or){this.lineDash=or},Pe.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},Pe.prototype.fill=function(){Xe.call(this,"fill",!1)},Pe.prototype.stroke=function(){Xe.call(this,"stroke",!1)},Pe.prototype.beginPath=function(){this.path=[{type:"begin"}]},Pe.prototype.moveTo=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var jr=this.ctx.transform.applyToPoint(new xe(or,pr));this.path.push({type:"mt",x:jr.x,y:jr.y}),this.ctx.lastPoint=new xe(or,pr)},Pe.prototype.closePath=function(){var or=new xe(0,0),pr=0;for(pr=this.path.length-1;pr!==-1;pr--)if(this.path[pr].type==="begin"&&_typeof$2(this.path[pr+1])==="object"&&typeof this.path[pr+1].x=="number"){or=new xe(this.path[pr+1].x,this.path[pr+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new xe(or.x,or.y)},Pe.prototype.lineTo=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var jr=this.ctx.transform.applyToPoint(new xe(or,pr));this.path.push({type:"lt",x:jr.x,y:jr.y}),this.ctx.lastPoint=new xe(jr.x,jr.y)},Pe.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),Xe.call(this,null,!0)},Pe.prototype.quadraticCurveTo=function(or,pr,jr,Br){if(isNaN(jr)||isNaN(Br)||isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var Mr=this.ctx.transform.applyToPoint(new xe(jr,Br)),Fr=this.ctx.transform.applyToPoint(new xe(or,pr));this.path.push({type:"qct",x1:Fr.x,y1:Fr.y,x:Mr.x,y:Mr.y}),this.ctx.lastPoint=new xe(Mr.x,Mr.y)},Pe.prototype.bezierCurveTo=function(or,pr,jr,Br,Mr,Fr){if(isNaN(Mr)||isNaN(Fr)||isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var Lr=this.ctx.transform.applyToPoint(new xe(Mr,Fr)),Dr=this.ctx.transform.applyToPoint(new xe(or,pr)),zr=this.ctx.transform.applyToPoint(new xe(jr,Br));this.path.push({type:"bct",x1:Dr.x,y1:Dr.y,x2:zr.x,y2:zr.y,x:Lr.x,y:Lr.y}),this.ctx.lastPoint=new xe(Lr.x,Lr.y)},Pe.prototype.arc=function(or,pr,jr,Br,Mr,Fr){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br)||isNaN(Mr))throw a$2.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Fr=!!Fr,!this.ctx.transform.isIdentity){var Lr=this.ctx.transform.applyToPoint(new xe(or,pr));or=Lr.x,pr=Lr.y;var Dr=this.ctx.transform.applyToPoint(new xe(0,jr)),zr=this.ctx.transform.applyToPoint(new xe(0,0));jr=Math.sqrt(Math.pow(Dr.x-zr.x,2)+Math.pow(Dr.y-zr.y,2))}Math.abs(Mr-Br)>=2*Math.PI&&(Br=0,Mr=2*Math.PI),this.path.push({type:"arc",x:or,y:pr,radius:jr,startAngle:Br,endAngle:Mr,counterclockwise:Fr})},Pe.prototype.arcTo=function(or,pr,jr,Br,Mr){throw new Error("arcTo not implemented.")},Pe.prototype.rect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(or,pr),this.lineTo(or+jr,pr),this.lineTo(or+jr,pr+Br),this.lineTo(or,pr+Br),this.lineTo(or,pr),this.lineTo(or+jr,pr),this.lineTo(or,pr)},Pe.prototype.fillRect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!Me.call(this)){var Mr={};this.lineCap!=="butt"&&(Mr.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(Mr.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(or,pr,jr,Br),this.fill(),Mr.hasOwnProperty("lineCap")&&(this.lineCap=Mr.lineCap),Mr.hasOwnProperty("lineJoin")&&(this.lineJoin=Mr.lineJoin)}},Pe.prototype.strokeRect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");Fe.call(this)||(this.beginPath(),this.rect(or,pr,jr,Br),this.stroke())},Pe.prototype.clearRect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(or,pr,jr,Br))},Pe.prototype.save=function(or){or=typeof or!="boolean"||or;for(var pr=this.pdf.internal.getCurrentPageInfo().pageNumber,jr=0;jr<this.pdf.internal.getNumberOfPages();jr++)this.pdf.setPage(jr+1),this.pdf.internal.out("q");if(this.pdf.setPage(pr),or){this.ctx.fontSize=this.pdf.internal.getFontSize();var Br=new Se(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Br}},Pe.prototype.restore=function(or){or=typeof or!="boolean"||or;for(var pr=this.pdf.internal.getCurrentPageInfo().pageNumber,jr=0;jr<this.pdf.internal.getNumberOfPages();jr++)this.pdf.setPage(jr+1),this.pdf.internal.out("Q");this.pdf.setPage(pr),or&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},Pe.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var Te=function(or){var pr,jr,Br,Mr;if(or.isCanvasGradient===!0&&(or=or.getColor()),!or)return{r:0,g:0,b:0,a:0,style:or};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(or))pr=0,jr=0,Br=0,Mr=0;else{var Fr=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(or);if(Fr!==null)pr=parseInt(Fr[1]),jr=parseInt(Fr[2]),Br=parseInt(Fr[3]),Mr=1;else if((Fr=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(or))!==null)pr=parseInt(Fr[1]),jr=parseInt(Fr[2]),Br=parseInt(Fr[3]),Mr=parseFloat(Fr[4]);else{if(Mr=1,typeof or=="string"&&or.charAt(0)!=="#"){var Lr=new f$2(or);or=Lr.ok?Lr.toHex():"#000000"}or.length===4?(pr=or.substring(1,2),pr+=pr,jr=or.substring(2,3),jr+=jr,Br=or.substring(3,4),Br+=Br):(pr=or.substring(1,3),jr=or.substring(3,5),Br=or.substring(5,7)),pr=parseInt(pr,16),jr=parseInt(jr,16),Br=parseInt(Br,16)}}return{r:pr,g:jr,b:Br,a:Mr,style:or}},Me=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},Fe=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};Pe.prototype.fillText=function(or,pr,jr,Br){if(isNaN(pr)||isNaN(jr)||typeof or!="string")throw a$2.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Br=isNaN(Br)?void 0:Br,!Me.call(this)){var Mr=hr(this.ctx.transform.rotation),Fr=this.ctx.transform.scaleX;Je.call(this,{text:or,x:pr,y:jr,scale:Fr,angle:Mr,align:this.textAlign,maxWidth:Br})}},Pe.prototype.strokeText=function(or,pr,jr,Br){if(isNaN(pr)||isNaN(jr)||typeof or!="string")throw a$2.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!Fe.call(this)){Br=isNaN(Br)?void 0:Br;var Mr=hr(this.ctx.transform.rotation),Fr=this.ctx.transform.scaleX;Je.call(this,{text:or,x:pr,y:jr,scale:Fr,renderingMode:"stroke",angle:Mr,align:this.textAlign,maxWidth:Br})}},Pe.prototype.measureText=function(or){if(typeof or!="string")throw a$2.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var pr=this.pdf,jr=this.pdf.internal.scaleFactor,Br=pr.internal.getFontSize(),Mr=pr.getStringUnitWidth(or)*Br/pr.internal.scaleFactor,Fr=function(Lr){var Dr=(Lr=Lr||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return Dr}}),this};return new Fr({width:Mr*=Math.round(96*jr/72*1e4)/1e4})},Pe.prototype.scale=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var jr=new Ce(or,0,0,pr,0,0);this.ctx.transform=this.ctx.transform.multiply(jr)},Pe.prototype.rotate=function(or){if(isNaN(or))throw a$2.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var pr=new Ce(Math.cos(or),Math.sin(or),-Math.sin(or),Math.cos(or),0,0);this.ctx.transform=this.ctx.transform.multiply(pr)},Pe.prototype.translate=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var jr=new Ce(1,0,0,1,or,pr);this.ctx.transform=this.ctx.transform.multiply(jr)},Pe.prototype.transform=function(or,pr,jr,Br,Mr,Fr){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br)||isNaN(Mr)||isNaN(Fr))throw a$2.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var Lr=new Ce(or,pr,jr,Br,Mr,Fr);this.ctx.transform=this.ctx.transform.multiply(Lr)},Pe.prototype.setTransform=function(or,pr,jr,Br,Mr,Fr){or=isNaN(or)?1:or,pr=isNaN(pr)?0:pr,jr=isNaN(jr)?0:jr,Br=isNaN(Br)?1:Br,Mr=isNaN(Mr)?0:Mr,Fr=isNaN(Fr)?0:Fr,this.ctx.transform=new Ce(or,pr,jr,Br,Mr,Fr)};var De=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};Pe.prototype.drawImage=function(or,pr,jr,Br,Mr,Fr,Lr,Dr,zr){var ti=this.pdf.getImageProperties(or),pi=1,ci=1,wi=1,Wr=1;Br!==void 0&&Dr!==void 0&&(wi=Dr/Br,Wr=zr/Mr,pi=ti.width/Br*Dr/Br,ci=ti.height/Mr*zr/Mr),Fr===void 0&&(Fr=pr,Lr=jr,pr=0,jr=0),Br!==void 0&&Dr===void 0&&(Dr=Br,zr=Mr),Br===void 0&&Dr===void 0&&(Dr=ti.width,zr=ti.height);for(var Cr,Ci=this.ctx.transform.decompose(),mi=hr(Ci.rotate.shx),oi=new Ce,ui=(oi=(oi=(oi=oi.multiply(Ci.translate)).multiply(Ci.skew)).multiply(Ci.scale)).applyToRectangle(new Be(Fr-pr*wi,Lr-jr*Wr,Br*pi,Mr*ci)),_i=Oe.call(this,ui),Ai=[],ki=0;ki<_i.length;ki+=1)Ai.indexOf(_i[ki])===-1&&Ai.push(_i[ki]);if(Ye(Ai),this.autoPaging)for(var yi=Ai[0],Hi=Ai[Ai.length-1],Pi=yi;Pi<Hi+1;Pi++){this.pdf.setPage(Pi);var Ri=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Vi=Pi===1?this.posY+this.margin[0]:this.margin[0],xi=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ti=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],vi=Pi===1?0:xi+(Pi-2)*Ti;if(this.ctx.clip_path.length!==0){var aa=this.path;Cr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=We(Cr,this.posX+this.margin[3],-vi+Vi+this.ctx.prevPageLastElemOffset),rr.call(this,"fill",!0),this.path=aa}var Ki=JSON.parse(JSON.stringify(ui));Ki=We([Ki],this.posX+this.margin[3],-vi+Vi+this.ctx.prevPageLastElemOffset)[0];var na=(Pi>yi||Pi<Hi)&&De.call(this);na&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ri,Ti,null).clip().discardPath()),this.pdf.addImage(or,"JPEG",Ki.x,Ki.y,Ki.w,Ki.h,null,null,mi),na&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(or,"JPEG",ui.x,ui.y,ui.w,ui.h,null,null,mi)};var Oe=function(or,pr,jr){var Br=[];pr=pr||this.pdf.internal.pageSize.width,jr=jr||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var Mr=this.posY+this.ctx.prevPageLastElemOffset;switch(or.type){default:case"mt":case"lt":Br.push(Math.floor((or.y+Mr)/jr)+1);break;case"arc":Br.push(Math.floor((or.y+Mr-or.radius)/jr)+1),Br.push(Math.floor((or.y+Mr+or.radius)/jr)+1);break;case"qct":var Fr=kr(this.ctx.lastPoint.x,this.ctx.lastPoint.y,or.x1,or.y1,or.x,or.y);Br.push(Math.floor((Fr.y+Mr)/jr)+1),Br.push(Math.floor((Fr.y+Fr.h+Mr)/jr)+1);break;case"bct":var Lr=Ar(this.ctx.lastPoint.x,this.ctx.lastPoint.y,or.x1,or.y1,or.x2,or.y2,or.x,or.y);Br.push(Math.floor((Lr.y+Mr)/jr)+1),Br.push(Math.floor((Lr.y+Lr.h+Mr)/jr)+1);break;case"rect":Br.push(Math.floor((or.y+Mr)/jr)+1),Br.push(Math.floor((or.y+or.h+Mr)/jr)+1)}for(var Dr=0;Dr<Br.length;Dr+=1)for(;this.pdf.internal.getNumberOfPages()<Br[Dr];)Qe.call(this);return Br},Qe=function(){var or=this.fillStyle,pr=this.strokeStyle,jr=this.font,Br=this.lineCap,Mr=this.lineWidth,Fr=this.lineJoin;this.pdf.addPage(),this.fillStyle=or,this.strokeStyle=pr,this.font=jr,this.lineCap=Br,this.lineWidth=Mr,this.lineJoin=Fr},We=function(or,pr,jr){for(var Br=0;Br<or.length;Br++)switch(or[Br].type){case"bct":or[Br].x2+=pr,or[Br].y2+=jr;case"qct":or[Br].x1+=pr,or[Br].y1+=jr;case"mt":case"lt":case"arc":default:or[Br].x+=pr,or[Br].y+=jr}return or},Ye=function(or){return or.sort(function(pr,jr){return pr-jr})},Xe=function(or,pr){for(var jr,Br,Mr=this.fillStyle,Fr=this.strokeStyle,Lr=this.lineCap,Dr=this.lineWidth,zr=Math.abs(Dr*this.ctx.transform.scaleX),ti=this.lineJoin,pi=JSON.parse(JSON.stringify(this.path)),ci=JSON.parse(JSON.stringify(this.path)),wi=[],Wr=0;Wr<ci.length;Wr++)if(ci[Wr].x!==void 0)for(var Cr=Oe.call(this,ci[Wr]),Ci=0;Ci<Cr.length;Ci+=1)wi.indexOf(Cr[Ci])===-1&&wi.push(Cr[Ci]);for(var mi=0;mi<wi.length;mi++)for(;this.pdf.internal.getNumberOfPages()<wi[mi];)Qe.call(this);if(Ye(wi),this.autoPaging)for(var oi=wi[0],ui=wi[wi.length-1],_i=oi;_i<ui+1;_i++){this.pdf.setPage(_i),this.fillStyle=Mr,this.strokeStyle=Fr,this.lineCap=Lr,this.lineWidth=zr,this.lineJoin=ti;var Ai=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ki=_i===1?this.posY+this.margin[0]:this.margin[0],yi=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Hi=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Pi=_i===1?0:yi+(_i-2)*Hi;if(this.ctx.clip_path.length!==0){var Ri=this.path;jr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=We(jr,this.posX+this.margin[3],-Pi+ki+this.ctx.prevPageLastElemOffset),rr.call(this,or,!0),this.path=Ri}if(Br=JSON.parse(JSON.stringify(pi)),this.path=We(Br,this.posX+this.margin[3],-Pi+ki+this.ctx.prevPageLastElemOffset),pr===!1||_i===0){var Vi=(_i>oi||_i<ui)&&De.call(this);Vi&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ai,Hi,null).clip().discardPath()),rr.call(this,or,pr),Vi&&this.pdf.restoreGraphicsState()}this.lineWidth=Dr}else this.lineWidth=zr,rr.call(this,or,pr),this.lineWidth=Dr;this.path=pi},rr=function(or,pr){if((or!=="stroke"||pr||!Fe.call(this))&&(or==="stroke"||pr||!Me.call(this))){for(var jr,Br,Mr=[],Fr=this.path,Lr=0;Lr<Fr.length;Lr++){var Dr=Fr[Lr];switch(Dr.type){case"begin":Mr.push({begin:!0});break;case"close":Mr.push({close:!0});break;case"mt":Mr.push({start:Dr,deltas:[],abs:[]});break;case"lt":var zr=Mr.length;if(Fr[Lr-1]&&!isNaN(Fr[Lr-1].x)&&(jr=[Dr.x-Fr[Lr-1].x,Dr.y-Fr[Lr-1].y],zr>0)){for(;zr>=0;zr--)if(Mr[zr-1].close!==!0&&Mr[zr-1].begin!==!0){Mr[zr-1].deltas.push(jr),Mr[zr-1].abs.push(Dr);break}}break;case"bct":jr=[Dr.x1-Fr[Lr-1].x,Dr.y1-Fr[Lr-1].y,Dr.x2-Fr[Lr-1].x,Dr.y2-Fr[Lr-1].y,Dr.x-Fr[Lr-1].x,Dr.y-Fr[Lr-1].y],Mr[Mr.length-1].deltas.push(jr);break;case"qct":var ti=Fr[Lr-1].x+2/3*(Dr.x1-Fr[Lr-1].x),pi=Fr[Lr-1].y+2/3*(Dr.y1-Fr[Lr-1].y),ci=Dr.x+2/3*(Dr.x1-Dr.x),wi=Dr.y+2/3*(Dr.y1-Dr.y),Wr=Dr.x,Cr=Dr.y;jr=[ti-Fr[Lr-1].x,pi-Fr[Lr-1].y,ci-Fr[Lr-1].x,wi-Fr[Lr-1].y,Wr-Fr[Lr-1].x,Cr-Fr[Lr-1].y],Mr[Mr.length-1].deltas.push(jr);break;case"arc":Mr.push({deltas:[],abs:[],arc:!0}),Array.isArray(Mr[Mr.length-1].abs)&&Mr[Mr.length-1].abs.push(Dr)}}Br=pr?null:or==="stroke"?"stroke":"fill";for(var Ci=!1,mi=0;mi<Mr.length;mi++)if(Mr[mi].arc)for(var oi=Mr[mi].abs,ui=0;ui<oi.length;ui++){var _i=oi[ui];_i.type==="arc"?St.call(this,_i.x,_i.y,_i.radius,_i.startAngle,_i.endAngle,_i.counterclockwise,void 0,pr,!Ci):ir.call(this,_i.x,_i.y),Ci=!0}else if(Mr[mi].close===!0)this.pdf.internal.out("h"),Ci=!1;else if(Mr[mi].begin!==!0){var Ai=Mr[mi].start.x,ki=Mr[mi].start.y;ar.call(this,Mr[mi].deltas,Ai,ki),Ci=!0}Br&&tr.call(this,Br),pr&&qe.call(this)}},Ze=function(or){var pr=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,jr=pr*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return or-jr;case"top":return or+pr-jr;case"hanging":return or+pr-2*jr;case"middle":return or+pr/2-jr;case"ideographic":return or;case"alphabetic":default:return or}},Ke=function(or){return or+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};Pe.prototype.createLinearGradient=function(){var or=function(){};return or.colorStops=[],or.addColorStop=function(pr,jr){this.colorStops.push([pr,jr])},or.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},or.isCanvasGradient=!0,or},Pe.prototype.createPattern=function(){return this.createLinearGradient()},Pe.prototype.createRadialGradient=function(){return this.createLinearGradient()};var St=function(or,pr,jr,Br,Mr,Fr,Lr,Dr,zr){for(var ti=dr.call(this,jr,Br,Mr,Fr),pi=0;pi<ti.length;pi++){var ci=ti[pi];pi===0&&(zr?Ge.call(this,ci.x1+or,ci.y1+pr):ir.call(this,ci.x1+or,ci.y1+pr)),lr.call(this,or,pr,ci.x2,ci.y2,ci.x3,ci.y3,ci.x4,ci.y4)}Dr?qe.call(this):tr.call(this,Lr)},tr=function(or){switch(or){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},qe=function(){this.pdf.clip(),this.pdf.discardPath()},Ge=function(or,pr){this.pdf.internal.out(Ae(or)+" "+je(pr)+" m")},Je=function(or){var pr;switch(or.align){case"right":case"end":pr="right";break;case"center":pr="center";break;case"left":case"start":default:pr="left"}var jr=this.pdf.getTextDimensions(or.text),Br=Ze.call(this,or.y),Mr=Ke.call(this,Br)-jr.h,Fr=this.ctx.transform.applyToPoint(new xe(or.x,Br)),Lr=this.ctx.transform.decompose(),Dr=new Ce;Dr=(Dr=(Dr=Dr.multiply(Lr.translate)).multiply(Lr.skew)).multiply(Lr.scale);for(var zr,ti,pi,ci=this.ctx.transform.applyToRectangle(new Be(or.x,Br,jr.w,jr.h)),wi=Dr.applyToRectangle(new Be(or.x,Mr,jr.w,jr.h)),Wr=Oe.call(this,wi),Cr=[],Ci=0;Ci<Wr.length;Ci+=1)Cr.indexOf(Wr[Ci])===-1&&Cr.push(Wr[Ci]);if(Ye(Cr),this.autoPaging)for(var mi=Cr[0],oi=Cr[Cr.length-1],ui=mi;ui<oi+1;ui++){this.pdf.setPage(ui);var _i=ui===1?this.posY+this.margin[0]:this.margin[0],Ai=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ki=this.pdf.internal.pageSize.height-this.margin[2],yi=ki-this.margin[0],Hi=this.pdf.internal.pageSize.width-this.margin[1],Pi=Hi-this.margin[3],Ri=ui===1?0:Ai+(ui-2)*yi;if(this.ctx.clip_path.length!==0){var Vi=this.path;zr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=We(zr,this.posX+this.margin[3],-1*Ri+_i),rr.call(this,"fill",!0),this.path=Vi}var xi=We([JSON.parse(JSON.stringify(wi))],this.posX+this.margin[3],-Ri+_i+this.ctx.prevPageLastElemOffset)[0];or.scale>=.01&&(ti=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ti*or.scale),pi=this.lineWidth,this.lineWidth=pi*or.scale);var Ti=this.autoPaging!=="text";if(Ti||xi.y+xi.h<=ki){if(Ti||xi.y>=_i&&xi.x<=Hi){var vi=Ti?or.text:this.pdf.splitTextToSize(or.text,or.maxWidth||Hi-xi.x)[0],aa=We([JSON.parse(JSON.stringify(ci))],this.posX+this.margin[3],-Ri+_i+this.ctx.prevPageLastElemOffset)[0],Ki=Ti&&(ui>mi||ui<oi)&&De.call(this);Ki&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Pi,yi,null).clip().discardPath()),this.pdf.text(vi,aa.x,aa.y,{angle:or.angle,align:pr,renderingMode:or.renderingMode}),Ki&&this.pdf.restoreGraphicsState()}}else xi.y<ki&&(this.ctx.prevPageLastElemOffset+=ki-xi.y);or.scale>=.01&&(this.pdf.setFontSize(ti),this.lineWidth=pi)}else or.scale>=.01&&(ti=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ti*or.scale),pi=this.lineWidth,this.lineWidth=pi*or.scale),this.pdf.text(or.text,Fr.x+this.posX,Fr.y+this.posY,{angle:or.angle,align:pr,renderingMode:or.renderingMode,maxWidth:or.maxWidth}),or.scale>=.01&&(this.pdf.setFontSize(ti),this.lineWidth=pi)},ir=function(or,pr,jr,Br){jr=jr||0,Br=Br||0,this.pdf.internal.out(Ae(or+jr)+" "+je(pr+Br)+" l")},ar=function(or,pr,jr){return this.pdf.lines(or,pr,jr,null,null)},lr=function(or,pr,jr,Br,Mr,Fr,Lr,Dr){this.pdf.internal.out([$e(ke(jr+or)),$e(Ie(Br+pr)),$e(ke(Mr+or)),$e(Ie(Fr+pr)),$e(ke(Lr+or)),$e(Ie(Dr+pr)),"c"].join(" "))},dr=function(or,pr,jr,Br){for(var Mr=2*Math.PI,Fr=Math.PI/2;pr>jr;)pr-=Mr;var Lr=Math.abs(jr-pr);Lr<Mr&&Br&&(Lr=Mr-Lr);for(var Dr=[],zr=Br?-1:1,ti=pr;Lr>1e-5;){var pi=ti+zr*Math.min(Lr,Fr);Dr.push(gr.call(this,or,ti,pi)),Lr-=Math.abs(pi-ti),ti=pi}return Dr},gr=function(or,pr,jr){var Br=(jr-pr)/2,Mr=or*Math.cos(Br),Fr=or*Math.sin(Br),Lr=Mr,Dr=-Fr,zr=Lr*Lr+Dr*Dr,ti=zr+Lr*Mr+Dr*Fr,pi=4/3*(Math.sqrt(2*zr*ti)-ti)/(Lr*Fr-Dr*Mr),ci=Lr-pi*Dr,wi=Dr+pi*Lr,Wr=ci,Cr=-wi,Ci=Br+pr,mi=Math.cos(Ci),oi=Math.sin(Ci);return{x1:or*Math.cos(pr),y1:or*Math.sin(pr),x2:ci*mi-wi*oi,y2:ci*oi+wi*mi,x3:Wr*mi-Cr*oi,y3:Wr*oi+Cr*mi,x4:or*Math.cos(jr),y4:or*Math.sin(jr)}},hr=function(or){return 180*or/Math.PI},kr=function(or,pr,jr,Br,Mr,Fr){var Lr=or+.5*(jr-or),Dr=pr+.5*(Br-pr),zr=Mr+.5*(jr-Mr),ti=Fr+.5*(Br-Fr),pi=Math.min(or,Mr,Lr,zr),ci=Math.max(or,Mr,Lr,zr),wi=Math.min(pr,Fr,Dr,ti),Wr=Math.max(pr,Fr,Dr,ti);return new Be(pi,wi,ci-pi,Wr-wi)},Ar=function(or,pr,jr,Br,Mr,Fr,Lr,Dr){var zr,ti,pi,ci,wi,Wr,Cr,Ci,mi,oi,ui,_i,Ai,ki,yi=jr-or,Hi=Br-pr,Pi=Mr-jr,Ri=Fr-Br,Vi=Lr-Mr,xi=Dr-Fr;for(ti=0;ti<41;ti++)mi=(Cr=(pi=or+(zr=ti/40)*yi)+zr*((wi=jr+zr*Pi)-pi))+zr*(wi+zr*(Mr+zr*Vi-wi)-Cr),oi=(Ci=(ci=pr+zr*Hi)+zr*((Wr=Br+zr*Ri)-ci))+zr*(Wr+zr*(Fr+zr*xi-Wr)-Ci),ti==0?(ui=mi,_i=oi,Ai=mi,ki=oi):(ui=Math.min(ui,mi),_i=Math.min(_i,oi),Ai=Math.max(Ai,mi),ki=Math.max(ki,oi));return new Be(Math.round(ui),Math.round(_i),Math.round(Ai-ui),Math.round(ki-_i))},Rr=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var or,pr,jr=(or=this.ctx.lineDash,pr=this.ctx.lineDashOffset,JSON.stringify({lineDash:or,lineDashOffset:pr}));this.prevLineDash!==jr&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=jr)}}})(E$1.API),function(_e){var $e=function(Ie){var xe,Be,Ce,Ee,Se,Pe,Te,Me,Fe,De;for(Be=[],Ce=0,Ee=(Ie+=xe="\0\0\0\0".slice(Ie.length%4||4)).length;Ee>Ce;Ce+=4)(Se=(Ie.charCodeAt(Ce)<<24)+(Ie.charCodeAt(Ce+1)<<16)+(Ie.charCodeAt(Ce+2)<<8)+Ie.charCodeAt(Ce+3))!==0?(Pe=(Se=((Se=((Se=((Se=(Se-(De=Se%85))/85)-(Fe=Se%85))/85)-(Me=Se%85))/85)-(Te=Se%85))/85)%85,Be.push(Pe+33,Te+33,Me+33,Fe+33,De+33)):Be.push(122);return function(Oe,Qe){for(var We=Qe;We>0;We--)Oe.pop()}(Be,xe.length),String.fromCharCode.apply(String,Be)+"~>"},Ae=function(Ie){var xe,Be,Ce,Ee,Se,Pe=String,Te="length",Me=255,Fe="charCodeAt",De="slice",Oe="replace";for(Ie[De](-2),Ie=Ie[De](0,-2)[Oe](/\s/g,"")[Oe]("z","!!!!!"),Ce=[],Ee=0,Se=(Ie+=xe="uuuuu"[De](Ie[Te]%5||5))[Te];Se>Ee;Ee+=5)Be=52200625*(Ie[Fe](Ee)-33)+614125*(Ie[Fe](Ee+1)-33)+7225*(Ie[Fe](Ee+2)-33)+85*(Ie[Fe](Ee+3)-33)+(Ie[Fe](Ee+4)-33),Ce.push(Me&Be>>24,Me&Be>>16,Me&Be>>8,Me&Be);return function(Qe,We){for(var Ye=We;Ye>0;Ye--)Qe.pop()}(Ce,xe[Te]),Pe.fromCharCode.apply(Pe,Ce)},je=function(Ie){var xe=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((Ie=Ie.replace(/\s/g,"")).indexOf(">")!==-1&&(Ie=Ie.substr(0,Ie.indexOf(">"))),Ie.length%2&&(Ie+="0"),xe.test(Ie)===!1)return"";for(var Be="",Ce=0;Ce<Ie.length;Ce+=2)Be+=String.fromCharCode("0x"+(Ie[Ce]+Ie[Ce+1]));return Be},ke=function(Ie){for(var xe=new Uint8Array(Ie.length),Be=Ie.length;Be--;)xe[Be]=Ie.charCodeAt(Be);return Ie=(xe=zlibSync(xe)).reduce(function(Ce,Ee){return Ce+String.fromCharCode(Ee)},"")};_e.processDataByFilters=function(Ie,xe){var Be=0,Ce=Ie||"",Ee=[];for(typeof(xe=xe||[])=="string"&&(xe=[xe]),Be=0;Be<xe.length;Be+=1)switch(xe[Be]){case"ASCII85Decode":case"/ASCII85Decode":Ce=Ae(Ce),Ee.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":Ce=$e(Ce),Ee.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":Ce=je(Ce),Ee.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":Ce=Ce.split("").map(function(Se){return("0"+Se.charCodeAt().toString(16)).slice(-2)}).join("")+">",Ee.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":Ce=ke(Ce),Ee.push("/FlateDecode");break;default:throw new Error('The filter: "'+xe[Be]+'" is not implemented')}return{data:Ce,reverseChain:Ee.reverse().join(" ")}}}(E$1.API),function(_e){_e.loadFile=function($e,Ae,je){return function(ke,Ie,xe){Ie=Ie!==!1,xe=typeof xe=="function"?xe:function(){};var Be=void 0;try{Be=function(Ce,Ee,Se){var Pe=new XMLHttpRequest,Te=0,Me=function(Fe){var De=Fe.length,Oe=[],Qe=String.fromCharCode;for(Te=0;Te<De;Te+=1)Oe.push(Qe(255&Fe.charCodeAt(Te)));return Oe.join("")};if(Pe.open("GET",Ce,!Ee),Pe.overrideMimeType("text/plain; charset=x-user-defined"),Ee===!1&&(Pe.onload=function(){Pe.status===200?Se(Me(this.responseText)):Se(void 0)}),Pe.send(null),Ee&&Pe.status===200)return Me(Pe.responseText)}(ke,Ie,xe)}catch{}return Be}($e,Ae,je)},_e.loadImageFile=_e.loadFile}(E$1.API),function(_e){function $e(){return(n$1.html2canvas?Promise.resolve(n$1.html2canvas):Promise.resolve().then(()=>html2canvas_esm)).catch(function(xe){return Promise.reject(new Error("Could not load html2canvas: "+xe))}).then(function(xe){return xe.default?xe.default:xe})}function Ae(){return(n$1.DOMPurify?Promise.resolve(n$1.DOMPurify):Promise.resolve().then(()=>require("./purify.es-CYVvLED6.js"))).catch(function(xe){return Promise.reject(new Error("Could not load dompurify: "+xe))}).then(function(xe){return xe.default?xe.default:xe})}var je=function(xe){var Be=_typeof$2(xe);return Be==="undefined"?"undefined":Be==="string"||xe instanceof String?"string":Be==="number"||xe instanceof Number?"number":Be==="function"||xe instanceof Function?"function":xe&&xe.constructor===Array?"array":xe&&xe.nodeType===1?"element":Be==="object"?"object":"unknown"},ke=function(xe,Be){var Ce=document.createElement(xe);for(var Ee in Be.className&&(Ce.className=Be.className),Be.innerHTML&&Be.dompurify&&(Ce.innerHTML=Be.dompurify.sanitize(Be.innerHTML)),Be.style)Ce.style[Ee]=Be.style[Ee];return Ce},Ie=function xe(Be){var Ce=Object.assign(xe.convert(Promise.resolve()),JSON.parse(JSON.stringify(xe.template))),Ee=xe.convert(Promise.resolve(),Ce);return Ee=(Ee=Ee.setProgress(1,xe,1,[xe])).set(Be)};(Ie.prototype=Object.create(Promise.prototype)).constructor=Ie,Ie.convert=function(xe,Be){return xe.__proto__=Be||Ie.prototype,xe},Ie.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},Ie.prototype.from=function(xe,Be){return this.then(function(){switch(Be=Be||function(Ce){switch(je(Ce)){case"string":return"string";case"element":return Ce.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(xe)){case"string":return this.then(Ae).then(function(Ce){return this.set({src:ke("div",{innerHTML:xe,dompurify:Ce})})});case"element":return this.set({src:xe});case"canvas":return this.set({canvas:xe});case"img":return this.set({img:xe});default:return this.error("Unknown source type.")}})},Ie.prototype.to=function(xe){switch(xe){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},Ie.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var xe={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},Be=function Ce(Ee,Se){for(var Pe=Ee.nodeType===3?document.createTextNode(Ee.nodeValue):Ee.cloneNode(!1),Te=Ee.firstChild;Te;Te=Te.nextSibling)Se!==!0&&Te.nodeType===1&&Te.nodeName==="SCRIPT"||Pe.appendChild(Ce(Te,Se));return Ee.nodeType===1&&(Ee.nodeName==="CANVAS"?(Pe.width=Ee.width,Pe.height=Ee.height,Pe.getContext("2d").drawImage(Ee,0,0)):Ee.nodeName!=="TEXTAREA"&&Ee.nodeName!=="SELECT"||(Pe.value=Ee.value),Pe.addEventListener("load",function(){Pe.scrollTop=Ee.scrollTop,Pe.scrollLeft=Ee.scrollLeft},!0)),Pe}(this.prop.src,this.opt.html2canvas.javascriptEnabled);Be.tagName==="BODY"&&(xe.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=ke("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=ke("div",{className:"html2pdf__container",style:xe}),this.prop.container.appendChild(Be),this.prop.container.firstChild.appendChild(ke("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},Ie.prototype.toCanvas=function(){var xe=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(xe).then($e).then(function(Be){var Ce=Object.assign({},this.opt.html2canvas);return delete Ce.onrendered,Be(this.prop.container,Ce)}).then(function(Be){(this.opt.html2canvas.onrendered||function(){})(Be),this.prop.canvas=Be,document.body.removeChild(this.prop.overlay)})},Ie.prototype.toContext2d=function(){var xe=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(xe).then($e).then(function(Be){var Ce=this.opt.jsPDF,Ee=this.opt.fontFaces,Se=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,Pe=Object.assign({async:!0,allowTaint:!0,scale:Se,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete Pe.onrendered,Ce.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,Ce.context2d.posX=this.opt.x,Ce.context2d.posY=this.opt.y,Ce.context2d.margin=this.opt.margin,Ce.context2d.fontFaces=Ee,Ee)for(var Te=0;Te<Ee.length;++Te){var Me=Ee[Te],Fe=Me.src.find(function(De){return De.format==="truetype"});Fe&&Ce.addFont(Fe.url,Me.ref.name,Me.ref.style)}return Pe.windowHeight=Pe.windowHeight||0,Pe.windowHeight=Pe.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):Pe.windowHeight,Ce.context2d.save(!0),Be(this.prop.container,Pe)}).then(function(Be){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(Be),this.prop.canvas=Be,document.body.removeChild(this.prop.overlay)})},Ie.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var xe=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=xe})},Ie.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},Ie.prototype.output=function(xe,Be,Ce){return(Ce=Ce||"pdf").toLowerCase()==="img"||Ce.toLowerCase()==="image"?this.outputImg(xe,Be):this.outputPdf(xe,Be)},Ie.prototype.outputPdf=function(xe,Be){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(xe,Be)})},Ie.prototype.outputImg=function(xe){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(xe){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+xe+'" is not supported.'}})},Ie.prototype.save=function(xe){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(xe?{filename:xe}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},Ie.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},Ie.prototype.set=function(xe){if(je(xe)!=="object")return this;var Be=Object.keys(xe||{}).map(function(Ce){if(Ce in Ie.template.prop)return function(){this.prop[Ce]=xe[Ce]};switch(Ce){case"margin":return this.setMargin.bind(this,xe.margin);case"jsPDF":return function(){return this.opt.jsPDF=xe.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,xe.pageSize);default:return function(){this.opt[Ce]=xe[Ce]}}},this);return this.then(function(){return this.thenList(Be)})},Ie.prototype.get=function(xe,Be){return this.then(function(){var Ce=xe in Ie.template.prop?this.prop[xe]:this.opt[xe];return Be?Be(Ce):Ce})},Ie.prototype.setMargin=function(xe){return this.then(function(){switch(je(xe)){case"number":xe=[xe,xe,xe,xe];case"array":if(xe.length===2&&(xe=[xe[0],xe[1],xe[0],xe[1]]),xe.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=xe}).then(this.setPageSize)},Ie.prototype.setPageSize=function(xe){function Be(Ce,Ee){return Math.floor(Ce*Ee/72*96)}return this.then(function(){(xe=xe||E$1.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(xe.inner={width:xe.width-this.opt.margin[1]-this.opt.margin[3],height:xe.height-this.opt.margin[0]-this.opt.margin[2]},xe.inner.px={width:Be(xe.inner.width,xe.k),height:Be(xe.inner.height,xe.k)},xe.inner.ratio=xe.inner.height/xe.inner.width),this.prop.pageSize=xe})},Ie.prototype.setProgress=function(xe,Be,Ce,Ee){return xe!=null&&(this.progress.val=xe),Be!=null&&(this.progress.state=Be),Ce!=null&&(this.progress.n=Ce),Ee!=null&&(this.progress.stack=Ee),this.progress.ratio=this.progress.val/this.progress.state,this},Ie.prototype.updateProgress=function(xe,Be,Ce,Ee){return this.setProgress(xe?this.progress.val+xe:null,Be||null,Ce?this.progress.n+Ce:null,Ee?this.progress.stack.concat(Ee):null)},Ie.prototype.then=function(xe,Be){var Ce=this;return this.thenCore(xe,Be,function(Ee,Se){return Ce.updateProgress(null,null,1,[Ee]),Promise.prototype.then.call(this,function(Pe){return Ce.updateProgress(null,Ee),Pe}).then(Ee,Se).then(function(Pe){return Ce.updateProgress(1),Pe})})},Ie.prototype.thenCore=function(xe,Be,Ce){Ce=Ce||Promise.prototype.then,xe&&(xe=xe.bind(this)),Be&&(Be=Be.bind(this));var Ee=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:Ie.convert(Object.assign({},this),Promise.prototype),Se=Ce.call(Ee,xe,Be);return Ie.convert(Se,this.__proto__)},Ie.prototype.thenExternal=function(xe,Be){return Promise.prototype.then.call(this,xe,Be)},Ie.prototype.thenList=function(xe){var Be=this;return xe.forEach(function(Ce){Be=Be.thenCore(Ce)}),Be},Ie.prototype.catch=function(xe){xe&&(xe=xe.bind(this));var Be=Promise.prototype.catch.call(this,xe);return Ie.convert(Be,this)},Ie.prototype.catchExternal=function(xe){return Promise.prototype.catch.call(this,xe)},Ie.prototype.error=function(xe){return this.then(function(){throw new Error(xe)})},Ie.prototype.using=Ie.prototype.set,Ie.prototype.saveAs=Ie.prototype.save,Ie.prototype.export=Ie.prototype.output,Ie.prototype.run=Ie.prototype.then,E$1.getPageSize=function(xe,Be,Ce){if(_typeof$2(xe)==="object"){var Ee=xe;xe=Ee.orientation,Be=Ee.unit||Be,Ce=Ee.format||Ce}Be=Be||"mm",Ce=Ce||"a4",xe=(""+(xe||"P")).toLowerCase();var Se,Pe=(""+Ce).toLowerCase(),Te={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(Be){case"pt":Se=1;break;case"mm":Se=72/25.4;break;case"cm":Se=72/2.54;break;case"in":Se=72;break;case"px":Se=.75;break;case"pc":case"em":Se=12;break;case"ex":Se=6;break;default:throw"Invalid unit: "+Be}var Me,Fe=0,De=0;if(Te.hasOwnProperty(Pe))Fe=Te[Pe][1]/Se,De=Te[Pe][0]/Se;else try{Fe=Ce[1],De=Ce[0]}catch{throw new Error("Invalid format: "+Ce)}if(xe==="p"||xe==="portrait")xe="p",De>Fe&&(Me=De,De=Fe,Fe=Me);else{if(xe!=="l"&&xe!=="landscape")throw"Invalid orientation: "+xe;xe="l",Fe>De&&(Me=De,De=Fe,Fe=Me)}return{width:De,height:Fe,unit:Be,k:Se,orientation:xe}},_e.html=function(xe,Be){(Be=Be||{}).callback=Be.callback||function(){},Be.html2canvas=Be.html2canvas||{},Be.html2canvas.canvas=Be.html2canvas.canvas||this.canvas,Be.jsPDF=Be.jsPDF||this,Be.fontFaces=Be.fontFaces?Be.fontFaces.map(jt):null;var Ce=new Ie(Be);return Be.worker?Ce:Ce.from(xe).doCallback()}}(E$1.API),E$1.API.addJS=function(_e){return Ht=_e,this.internal.events.subscribe("postPutResources",function(){Ut=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Ut+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),zt=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Ht+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Ut!==void 0&&zt!==void 0&&this.internal.out("/Names <</JavaScript "+Ut+" 0 R>>")}),this},function(_e){var $e;_e.events.push(["postPutResources",function(){var Ae=this,je=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var ke=Ae.outline.render().split(/\r\n/),Ie=0;Ie<ke.length;Ie++){var xe=ke[Ie],Be=je.exec(xe);if(Be!=null){var Ce=Be[1];Ae.internal.newObjectDeferredBegin(Ce,!1)}Ae.internal.write(xe)}if(this.outline.createNamedDestinations){var Ee=this.internal.pages.length,Se=[];for(Ie=0;Ie<Ee;Ie++){var Pe=Ae.internal.newObject();Se.push(Pe);var Te=Ae.internal.getPageInfo(Ie+1);Ae.internal.write("<< /D["+Te.objId+" 0 R /XYZ null null null]>> endobj")}var Me=Ae.internal.newObject();for(Ae.internal.write("<< /Names [ "),Ie=0;Ie<Se.length;Ie++)Ae.internal.write("(page_"+(Ie+1)+")"+Se[Ie]+" 0 R");Ae.internal.write(" ] >>","endobj"),$e=Ae.internal.newObject(),Ae.internal.write("<< /Dests "+Me+" 0 R"),Ae.internal.write(">>","endobj")}}]),_e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+$e+" 0 R"))}]),_e.events.push(["initialized",function(){var Ae=this;Ae.outline={createNamedDestinations:!1,root:{children:[]}},Ae.outline.add=function(je,ke,Ie){var xe={title:ke,options:Ie,children:[]};return je==null&&(je=this.root),je.children.push(xe),xe},Ae.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=Ae,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},Ae.outline.genIds_r=function(je){je.id=Ae.internal.newObjectDeferred();for(var ke=0;ke<je.children.length;ke++)this.genIds_r(je.children[ke])},Ae.outline.renderRoot=function(je){this.objStart(je),this.line("/Type /Outlines"),je.children.length>0&&(this.line("/First "+this.makeRef(je.children[0])),this.line("/Last "+this.makeRef(je.children[je.children.length-1]))),this.line("/Count "+this.count_r({count:0},je)),this.objEnd()},Ae.outline.renderItems=function(je){for(var ke=this.ctx.pdf.internal.getVerticalCoordinateString,Ie=0;Ie<je.children.length;Ie++){var xe=je.children[Ie];this.objStart(xe),this.line("/Title "+this.makeString(xe.title)),this.line("/Parent "+this.makeRef(je)),Ie>0&&this.line("/Prev "+this.makeRef(je.children[Ie-1])),Ie<je.children.length-1&&this.line("/Next "+this.makeRef(je.children[Ie+1])),xe.children.length>0&&(this.line("/First "+this.makeRef(xe.children[0])),this.line("/Last "+this.makeRef(xe.children[xe.children.length-1])));var Be=this.count=this.count_r({count:0},xe);if(Be>0&&this.line("/Count "+Be),xe.options&&xe.options.pageNumber){var Ce=Ae.internal.getPageInfo(xe.options.pageNumber);this.line("/Dest ["+Ce.objId+" 0 R /XYZ 0 "+ke(0)+" 0]")}this.objEnd()}for(var Ee=0;Ee<je.children.length;Ee++)this.renderItems(je.children[Ee])},Ae.outline.line=function(je){this.ctx.val+=je+`\r
127
+ `),$e}}},createDefaultAppearanceStream:function(_e){var $e=_e.scope.internal.getFont(_e.fontName,_e.fontStyle).id,Ae=_e.scope.__private__.encodeColorString(_e.color);return"/"+$e+" "+_e.fontSize+" Tf "+Ae}};At.internal={Bezier_C:.551915024494,calculateCross:function(_e){var $e=At.internal.getWidth(_e),Ae=At.internal.getHeight(_e),je=Math.min($e,Ae);return{x1:{x:($e-je)/2,y:(Ae-je)/2+je},x2:{x:($e-je)/2+je,y:(Ae-je)/2},x3:{x:($e-je)/2,y:(Ae-je)/2},x4:{x:($e-je)/2+je,y:(Ae-je)/2+je}}}},At.internal.getWidth=function(_e){var $e=0;return _typeof$2(_e)==="object"&&($e=W(_e.Rect[2])),$e},At.internal.getHeight=function(_e){var $e=0;return _typeof$2(_e)==="object"&&($e=W(_e.Rect[3])),$e};var xt=q.addField=function(_e){if(at(this,_e),!(_e instanceof lt))throw new Error("Invalid argument passed to jsPDF.addField.");var $e;return($e=_e).scope.internal.acroformPlugin.printedOut&&($e.scope.internal.acroformPlugin.printedOut=!1,$e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),$e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push($e),_e.page=_e.scope.internal.getCurrentPageInfo().pageNumber,this};q.AcroFormChoiceField=ft,q.AcroFormListBox=dt,q.AcroFormComboBox=pt,q.AcroFormEditBox=gt,q.AcroFormButton=mt,q.AcroFormPushButton=vt,q.AcroFormRadioButton=bt,q.AcroFormCheckBox=wt,q.AcroFormTextField=Nt,q.AcroFormPasswordField=Lt,q.AcroFormAppearance=At,q.AcroForm={ChoiceField:ft,ListBox:dt,ComboBox:pt,EditBox:gt,Button:mt,PushButton:vt,RadioButton:bt,CheckBox:wt,TextField:Nt,PasswordField:Lt,Appearance:At},E$1.AcroForm={ChoiceField:ft,ListBox:dt,ComboBox:pt,EditBox:gt,Button:mt,PushButton:vt,RadioButton:bt,CheckBox:wt,TextField:Nt,PasswordField:Lt,Appearance:At};E$1.AcroForm;function _t(_e){return _e.reduce(function($e,Ae,je){return $e[Ae]=je,$e},{})}(function(_e){_e.__addimage__={};var $e="UNKNOWN",Ae={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},je=_e.__addimage__.getImageFileTypeByImageData=function(Ge,Je){var ir,ar,lr,dr,gr,hr=$e;if((Je=Je||$e)==="RGBA"||Ge.data!==void 0&&Ge.data instanceof Uint8ClampedArray&&"height"in Ge&&"width"in Ge)return"RGBA";if(Ze(Ge))for(gr in Ae)for(lr=Ae[gr],ir=0;ir<lr.length;ir+=1){for(dr=!0,ar=0;ar<lr[ir].length;ar+=1)if(lr[ir][ar]!==void 0&&lr[ir][ar]!==Ge[ar]){dr=!1;break}if(dr===!0){hr=gr;break}}else for(gr in Ae)for(lr=Ae[gr],ir=0;ir<lr.length;ir+=1){for(dr=!0,ar=0;ar<lr[ir].length;ar+=1)if(lr[ir][ar]!==void 0&&lr[ir][ar]!==Ge.charCodeAt(ar)){dr=!1;break}if(dr===!0){hr=gr;break}}return hr===$e&&Je!==$e&&(hr=Je),hr},ke=function Ge(Je){for(var ir=this.internal.write,ar=this.internal.putStream,lr=(0,this.internal.getFilters)();lr.indexOf("FlateEncode")!==-1;)lr.splice(lr.indexOf("FlateEncode"),1);Je.objectId=this.internal.newObject();var dr=[];if(dr.push({key:"Type",value:"/XObject"}),dr.push({key:"Subtype",value:"/Image"}),dr.push({key:"Width",value:Je.width}),dr.push({key:"Height",value:Je.height}),Je.colorSpace===Oe.INDEXED?dr.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(Je.palette.length/3-1)+" "+("sMask"in Je&&Je.sMask!==void 0?Je.objectId+2:Je.objectId+1)+" 0 R]"}):(dr.push({key:"ColorSpace",value:"/"+Je.colorSpace}),Je.colorSpace===Oe.DEVICE_CMYK&&dr.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),dr.push({key:"BitsPerComponent",value:Je.bitsPerComponent}),"decodeParameters"in Je&&Je.decodeParameters!==void 0&&dr.push({key:"DecodeParms",value:"<<"+Je.decodeParameters+">>"}),"transparency"in Je&&Array.isArray(Je.transparency)){for(var gr="",hr=0,kr=Je.transparency.length;hr<kr;hr++)gr+=Je.transparency[hr]+" "+Je.transparency[hr]+" ";dr.push({key:"Mask",value:"["+gr+"]"})}Je.sMask!==void 0&&dr.push({key:"SMask",value:Je.objectId+1+" 0 R"});var Ar=Je.filter!==void 0?["/"+Je.filter]:void 0;if(ar({data:Je.data,additionalKeyValues:dr,alreadyAppliedFilters:Ar,objectId:Je.objectId}),ir("endobj"),"sMask"in Je&&Je.sMask!==void 0){var Rr="/Predictor "+Je.predictor+" /Colors 1 /BitsPerComponent "+Je.bitsPerComponent+" /Columns "+Je.width,or={width:Je.width,height:Je.height,colorSpace:"DeviceGray",bitsPerComponent:Je.bitsPerComponent,decodeParameters:Rr,data:Je.sMask};"filter"in Je&&(or.filter=Je.filter),Ge.call(this,or)}if(Je.colorSpace===Oe.INDEXED){var pr=this.internal.newObject();ar({data:St(new Uint8Array(Je.palette)),objectId:pr}),ir("endobj")}},Ie=function(){var Ge=this.internal.collections.addImage_images;for(var Je in Ge)ke.call(this,Ge[Je])},xe=function(){var Ge,Je=this.internal.collections.addImage_images,ir=this.internal.write;for(var ar in Je)ir("/I"+(Ge=Je[ar]).index,Ge.objectId,"0","R")},Be=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",Ie),this.internal.events.subscribe("putXobjectDict",xe))},Ce=function(){var Ge=this.internal.collections.addImage_images;return Be.call(this),Ge},Ee=function(){return Object.keys(this.internal.collections.addImage_images).length},Se=function(Ge){return typeof _e["process"+Ge.toUpperCase()]=="function"},Pe=function(Ge){return _typeof$2(Ge)==="object"&&Ge.nodeType===1},Te=function(Ge,Je){if(Ge.nodeName==="IMG"&&Ge.hasAttribute("src")){var ir=""+Ge.getAttribute("src");if(ir.indexOf("data:image/")===0)return u$2(unescape(ir).split("base64,").pop());var ar=_e.loadFile(ir,!0);if(ar!==void 0)return ar}if(Ge.nodeName==="CANVAS"){if(Ge.width===0||Ge.height===0)throw new Error("Given canvas must have data. Canvas width: "+Ge.width+", height: "+Ge.height);var lr;switch(Je){case"PNG":lr="image/png";break;case"WEBP":lr="image/webp";break;case"JPEG":case"JPG":default:lr="image/jpeg"}return u$2(Ge.toDataURL(lr,1).split("base64,").pop())}},Me=function(Ge){var Je=this.internal.collections.addImage_images;if(Je){for(var ir in Je)if(Ge===Je[ir].alias)return Je[ir]}},Fe=function(Ge,Je,ir){return Ge||Je||(Ge=-96,Je=-96),Ge<0&&(Ge=-1*ir.width*72/Ge/this.internal.scaleFactor),Je<0&&(Je=-1*ir.height*72/Je/this.internal.scaleFactor),Ge===0&&(Ge=Je*ir.width/ir.height),Je===0&&(Je=Ge*ir.height/ir.width),[Ge,Je]},De=function(Ge,Je,ir,ar,lr,dr){var gr=Fe.call(this,ir,ar,lr),hr=this.internal.getCoordinateString,kr=this.internal.getVerticalCoordinateString,Ar=Ce.call(this);if(ir=gr[0],ar=gr[1],Ar[lr.index]=lr,dr){dr*=Math.PI/180;var Rr=Math.cos(dr),or=Math.sin(dr),pr=function(Br){return Br.toFixed(4)},jr=[pr(Rr),pr(or),pr(-1*or),pr(Rr),0,0,"cm"]}this.internal.write("q"),dr?(this.internal.write([1,"0","0",1,hr(Ge),kr(Je+ar),"cm"].join(" ")),this.internal.write(jr.join(" ")),this.internal.write([hr(ir),"0","0",hr(ar),"0","0","cm"].join(" "))):this.internal.write([hr(ir),"0","0",hr(ar),hr(Ge),kr(Je+ar),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+lr.index+" Do"),this.internal.write("Q")},Oe=_e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};_e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var Qe=_e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},We=_e.__addimage__.sHashCode=function(Ge){var Je,ir,ar=0;if(typeof Ge=="string")for(ir=Ge.length,Je=0;Je<ir;Je++)ar=(ar<<5)-ar+Ge.charCodeAt(Je),ar|=0;else if(Ze(Ge))for(ir=Ge.byteLength/2,Je=0;Je<ir;Je++)ar=(ar<<5)-ar+Ge[Je],ar|=0;return ar},Ye=_e.__addimage__.validateStringAsBase64=function(Ge){(Ge=Ge||"").toString().trim();var Je=!0;return Ge.length===0&&(Je=!1),Ge.length%4!=0&&(Je=!1),/^[A-Za-z0-9+/]+$/.test(Ge.substr(0,Ge.length-2))===!1&&(Je=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(Ge.substr(-2))===!1&&(Je=!1),Je},Xe=_e.__addimage__.extractImageFromDataUrl=function(Ge){var Je=(Ge=Ge||"").split("base64,"),ir=null;if(Je.length===2){var ar=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(Je[0]);Array.isArray(ar)&&(ir={mimeType:ar[1],charset:ar[2],data:Je[1]})}return ir},rr=_e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};_e.__addimage__.isArrayBuffer=function(Ge){return rr()&&Ge instanceof ArrayBuffer};var Ze=_e.__addimage__.isArrayBufferView=function(Ge){return rr()&&typeof Uint32Array<"u"&&(Ge instanceof Int8Array||Ge instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&Ge instanceof Uint8ClampedArray||Ge instanceof Int16Array||Ge instanceof Uint16Array||Ge instanceof Int32Array||Ge instanceof Uint32Array||Ge instanceof Float32Array||Ge instanceof Float64Array)},Ke=_e.__addimage__.binaryStringToUint8Array=function(Ge){for(var Je=Ge.length,ir=new Uint8Array(Je),ar=0;ar<Je;ar++)ir[ar]=Ge.charCodeAt(ar);return ir},St=_e.__addimage__.arrayBufferToBinaryString=function(Ge){for(var Je="",ir=Ze(Ge)?Ge:new Uint8Array(Ge),ar=0;ar<ir.length;ar+=8192)Je+=String.fromCharCode.apply(null,ir.subarray(ar,ar+8192));return Je};_e.addImage=function(){var Ge,Je,ir,ar,lr,dr,gr,hr,kr;if(typeof arguments[1]=="number"?(Je=$e,ir=arguments[1],ar=arguments[2],lr=arguments[3],dr=arguments[4],gr=arguments[5],hr=arguments[6],kr=arguments[7]):(Je=arguments[1],ir=arguments[2],ar=arguments[3],lr=arguments[4],dr=arguments[5],gr=arguments[6],hr=arguments[7],kr=arguments[8]),_typeof$2(Ge=arguments[0])==="object"&&!Pe(Ge)&&"imageData"in Ge){var Ar=Ge;Ge=Ar.imageData,Je=Ar.format||Je||$e,ir=Ar.x||ir||0,ar=Ar.y||ar||0,lr=Ar.w||Ar.width||lr,dr=Ar.h||Ar.height||dr,gr=Ar.alias||gr,hr=Ar.compression||hr,kr=Ar.rotation||Ar.angle||kr}var Rr=this.internal.getFilters();if(hr===void 0&&Rr.indexOf("FlateEncode")!==-1&&(hr="SLOW"),isNaN(ir)||isNaN(ar))throw new Error("Invalid coordinates passed to jsPDF.addImage");Be.call(this);var or=tr.call(this,Ge,Je,gr,hr);return De.call(this,ir,ar,lr,dr,or,kr),this};var tr=function(Ge,Je,ir,ar){var lr,dr,gr;if(typeof Ge=="string"&&je(Ge)===$e){Ge=unescape(Ge);var hr=qe(Ge,!1);(hr!==""||(hr=_e.loadFile(Ge,!0))!==void 0)&&(Ge=hr)}if(Pe(Ge)&&(Ge=Te(Ge,Je)),Je=je(Ge,Je),!Se(Je))throw new Error("addImage does not support files of type '"+Je+"', please ensure that a plugin for '"+Je+"' support is added.");if(((gr=ir)==null||gr.length===0)&&(ir=function(kr){return typeof kr=="string"||Ze(kr)?We(kr):Ze(kr.data)?We(kr.data):null}(Ge)),(lr=Me.call(this,ir))||(rr()&&(Ge instanceof Uint8Array||Je==="RGBA"||(dr=Ge,Ge=Ke(Ge))),lr=this["process"+Je.toUpperCase()](Ge,Ee.call(this),ir,function(kr){return kr&&typeof kr=="string"&&(kr=kr.toUpperCase()),kr in _e.image_compression?kr:Qe.NONE}(ar),dr)),!lr)throw new Error("An unknown error occurred whilst processing the image.");return lr},qe=_e.__addimage__.convertBase64ToBinaryString=function(Ge,Je){var ir;Je=typeof Je!="boolean"||Je;var ar,lr="";if(typeof Ge=="string"){ar=(ir=Xe(Ge))!==null?ir.data:Ge;try{lr=u$2(ar)}catch(dr){if(Je)throw Ye(ar)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+dr.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return lr};_e.getImageProperties=function(Ge){var Je,ir,ar="";if(Pe(Ge)&&(Ge=Te(Ge)),typeof Ge=="string"&&je(Ge)===$e&&((ar=qe(Ge,!1))===""&&(ar=_e.loadFile(Ge)||""),Ge=ar),ir=je(Ge),!Se(ir))throw new Error("addImage does not support files of type '"+ir+"', please ensure that a plugin for '"+ir+"' support is added.");if(!rr()||Ge instanceof Uint8Array||(Ge=Ke(Ge)),!(Je=this["process"+ir.toUpperCase()](Ge)))throw new Error("An unknown error occurred whilst processing the image");return Je.fileType=ir,Je}})(E$1.API),function(_e){var $e=function(Ae){if(Ae!==void 0&&Ae!="")return!0};E$1.API.events.push(["addPage",function(Ae){this.internal.getPageInfo(Ae.pageNumber).pageContext.annotations=[]}]),_e.events.push(["putPage",function(Ae){for(var je,ke,Ie,xe=this.internal.getCoordinateString,Be=this.internal.getVerticalCoordinateString,Ce=this.internal.getPageInfoByObjId(Ae.objId),Ee=Ae.pageContext.annotations,Se=!1,Pe=0;Pe<Ee.length&&!Se;Pe++)switch((je=Ee[Pe]).type){case"link":($e(je.options.url)||$e(je.options.pageNumber))&&(Se=!0);break;case"reference":case"text":case"freetext":Se=!0}if(Se!=0){this.internal.write("/Annots [");for(var Te=0;Te<Ee.length;Te++){je=Ee[Te];var Me=this.internal.pdfEscape,Fe=this.internal.getEncryptor(Ae.objId);switch(je.type){case"reference":this.internal.write(" "+je.object.objId+" 0 R ");break;case"text":var De=this.internal.newAdditionalObject(),Oe=this.internal.newAdditionalObject(),Qe=this.internal.getEncryptor(De.objId),We=je.title||"Note";Ie="<</Type /Annot /Subtype /Text "+(ke="/Rect ["+xe(je.bounds.x)+" "+Be(je.bounds.y+je.bounds.h)+" "+xe(je.bounds.x+je.bounds.w)+" "+Be(je.bounds.y)+"] ")+"/Contents ("+Me(Qe(je.contents))+")",Ie+=" /Popup "+Oe.objId+" 0 R",Ie+=" /P "+Ce.objId+" 0 R",Ie+=" /T ("+Me(Qe(We))+") >>",De.content=Ie;var Ye=De.objId+" 0 R";Ie="<</Type /Annot /Subtype /Popup "+(ke="/Rect ["+xe(je.bounds.x+30)+" "+Be(je.bounds.y+je.bounds.h)+" "+xe(je.bounds.x+je.bounds.w+30)+" "+Be(je.bounds.y)+"] ")+" /Parent "+Ye,je.open&&(Ie+=" /Open true"),Ie+=" >>",Oe.content=Ie,this.internal.write(De.objId,"0 R",Oe.objId,"0 R");break;case"freetext":ke="/Rect ["+xe(je.bounds.x)+" "+Be(je.bounds.y)+" "+xe(je.bounds.x+je.bounds.w)+" "+Be(je.bounds.y+je.bounds.h)+"] ";var Xe=je.color||"#000000";Ie="<</Type /Annot /Subtype /FreeText "+ke+"/Contents ("+Me(Fe(je.contents))+")",Ie+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+Xe+")",Ie+=" /Border [0 0 0]",Ie+=" >>",this.internal.write(Ie);break;case"link":if(je.options.name){var rr=this.annotations._nameMap[je.options.name];je.options.pageNumber=rr.page,je.options.top=rr.y}else je.options.top||(je.options.top=0);if(ke="/Rect ["+je.finalBounds.x+" "+je.finalBounds.y+" "+je.finalBounds.w+" "+je.finalBounds.h+"] ",Ie="",je.options.url)Ie="<</Type /Annot /Subtype /Link "+ke+"/Border [0 0 0] /A <</S /URI /URI ("+Me(Fe(je.options.url))+") >>";else if(je.options.pageNumber)switch(Ie="<</Type /Annot /Subtype /Link "+ke+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(je.options.pageNumber).objId+" 0 R",je.options.magFactor=je.options.magFactor||"XYZ",je.options.magFactor){case"Fit":Ie+=" /Fit]";break;case"FitH":Ie+=" /FitH "+je.options.top+"]";break;case"FitV":je.options.left=je.options.left||0,Ie+=" /FitV "+je.options.left+"]";break;case"XYZ":default:var Ze=Be(je.options.top);je.options.left=je.options.left||0,je.options.zoom===void 0&&(je.options.zoom=0),Ie+=" /XYZ "+je.options.left+" "+Ze+" "+je.options.zoom+"]"}Ie!=""&&(Ie+=" >>",this.internal.write(Ie))}}this.internal.write("]")}}]),_e.createAnnotation=function(Ae){var je=this.internal.getCurrentPageInfo();switch(Ae.type){case"link":this.link(Ae.bounds.x,Ae.bounds.y,Ae.bounds.w,Ae.bounds.h,Ae);break;case"text":case"freetext":je.pageContext.annotations.push(Ae)}},_e.link=function(Ae,je,ke,Ie,xe){var Be=this.internal.getCurrentPageInfo(),Ce=this.internal.getCoordinateString,Ee=this.internal.getVerticalCoordinateString;Be.pageContext.annotations.push({finalBounds:{x:Ce(Ae),y:Ee(je),w:Ce(Ae+ke),h:Ee(je+Ie)},options:xe,type:"link"})},_e.textWithLink=function(Ae,je,ke,Ie){var xe,Be,Ce=this.getTextWidth(Ae),Ee=this.internal.getLineHeight()/this.internal.scaleFactor;if(Ie.maxWidth!==void 0){Be=Ie.maxWidth;var Se=this.splitTextToSize(Ae,Be).length;xe=Math.ceil(Ee*Se)}else Be=Ce,xe=Ee;return this.text(Ae,je,ke,Ie),ke+=.2*Ee,Ie.align==="center"&&(je-=Ce/2),Ie.align==="right"&&(je-=Ce),this.link(je,ke-Ee,Be,xe,Ie),Ce},_e.getTextWidth=function(Ae){var je=this.internal.getFontSize();return this.getStringUnitWidth(Ae)*je/this.internal.scaleFactor}}(E$1.API),function(_e){var $e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},Ae={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},je={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},ke=[1570,1571,1573,1575];_e.__arabicParser__={};var Ie=_e.__arabicParser__.isInArabicSubstitutionA=function(De){return $e[De.charCodeAt(0)]!==void 0},xe=_e.__arabicParser__.isArabicLetter=function(De){return typeof De=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(De)},Be=_e.__arabicParser__.isArabicEndLetter=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length<=2},Ce=_e.__arabicParser__.isArabicAlfLetter=function(De){return xe(De)&&ke.indexOf(De.charCodeAt(0))>=0};_e.__arabicParser__.arabicLetterHasIsolatedForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length>=1};var Ee=_e.__arabicParser__.arabicLetterHasFinalForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length>=2};_e.__arabicParser__.arabicLetterHasInitialForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length>=3};var Se=_e.__arabicParser__.arabicLetterHasMedialForm=function(De){return xe(De)&&Ie(De)&&$e[De.charCodeAt(0)].length==4},Pe=_e.__arabicParser__.resolveLigatures=function(De){var Oe=0,Qe=Ae,We="",Ye=0;for(Oe=0;Oe<De.length;Oe+=1)Qe[De.charCodeAt(Oe)]!==void 0?(Ye++,typeof(Qe=Qe[De.charCodeAt(Oe)])=="number"&&(We+=String.fromCharCode(Qe),Qe=Ae,Ye=0),Oe===De.length-1&&(Qe=Ae,We+=De.charAt(Oe-(Ye-1)),Oe-=Ye-1,Ye=0)):(Qe=Ae,We+=De.charAt(Oe-Ye),Oe-=Ye,Ye=0);return We};_e.__arabicParser__.isArabicDiacritic=function(De){return De!==void 0&&je[De.charCodeAt(0)]!==void 0};var Te=_e.__arabicParser__.getCorrectForm=function(De,Oe,Qe){return xe(De)?Ie(De)===!1?-1:!Ee(De)||!xe(Oe)&&!xe(Qe)||!xe(Qe)&&Be(Oe)||Be(De)&&!xe(Oe)||Be(De)&&Ce(Oe)||Be(De)&&Be(Oe)?0:Se(De)&&xe(Oe)&&!Be(Oe)&&xe(Qe)&&Ee(Qe)?3:Be(De)||!xe(Qe)?1:2:-1},Me=function(De){var Oe=0,Qe=0,We=0,Ye="",Xe="",rr="",Ze=(De=De||"").split("\\s+"),Ke=[];for(Oe=0;Oe<Ze.length;Oe+=1){for(Ke.push(""),Qe=0;Qe<Ze[Oe].length;Qe+=1)Ye=Ze[Oe][Qe],Xe=Ze[Oe][Qe-1],rr=Ze[Oe][Qe+1],xe(Ye)?(We=Te(Ye,Xe,rr),Ke[Oe]+=We!==-1?String.fromCharCode($e[Ye.charCodeAt(0)][We]):Ye):Ke[Oe]+=Ye;Ke[Oe]=Pe(Ke[Oe])}return Ke.join(" ")},Fe=_e.__arabicParser__.processArabic=_e.processArabic=function(){var De,Oe=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,Qe=[];if(Array.isArray(Oe)){var We=0;for(Qe=[],We=0;We<Oe.length;We+=1)Array.isArray(Oe[We])?Qe.push([Me(Oe[We][0]),Oe[We][1],Oe[We][2]]):Qe.push([Me(Oe[We])]);De=Qe}else De=Me(Oe);return typeof arguments[0]=="string"?De:(arguments[0].text=De,arguments[0])};_e.events.push(["preProcessText",Fe])}(E$1.API),E$1.API.autoPrint=function(_e){var $e;switch((_e=_e||{}).variant=_e.variant||"non-conform",_e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){$e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+$e+" 0 R")})}return this},function(_e){var $e=function(){var Ae=void 0;Object.defineProperty(this,"pdf",{get:function(){return Ae},set:function(Be){Ae=Be}});var je=150;Object.defineProperty(this,"width",{get:function(){return je},set:function(Be){je=isNaN(Be)||Number.isInteger(Be)===!1||Be<0?150:Be,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=je+1)}});var ke=300;Object.defineProperty(this,"height",{get:function(){return ke},set:function(Be){ke=isNaN(Be)||Number.isInteger(Be)===!1||Be<0?300:Be,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=ke+1)}});var Ie=[];Object.defineProperty(this,"childNodes",{get:function(){return Ie},set:function(Be){Ie=Be}});var xe={};Object.defineProperty(this,"style",{get:function(){return xe},set:function(Be){xe=Be}}),Object.defineProperty(this,"parentNode",{})};$e.prototype.getContext=function(Ae,je){var ke;if((Ae=Ae||"2d")!=="2d")return null;for(ke in je)this.pdf.context2d.hasOwnProperty(ke)&&(this.pdf.context2d[ke]=je[ke]);return this.pdf.context2d._canvas=this,this.pdf.context2d},$e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},_e.events.push(["initialized",function(){this.canvas=new $e,this.canvas.pdf=this}])}(E$1.API),function(_e){var $e={left:0,top:0,bottom:0,right:0},Ae=!1,je=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},$e),this.internal.__cell__.margins.width=this.getPageWidth(),ke.call(this))},ke=function(){this.internal.__cell__.lastCell=new Ie,this.internal.__cell__.pages=1},Ie=function(){var Ce=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Ce},set:function(De){Ce=De}});var Ee=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Ee},set:function(De){Ee=De}});var Se=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return Se},set:function(De){Se=De}});var Pe=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return Pe},set:function(De){Pe=De}});var Te=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return Te},set:function(De){Te=De}});var Me=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return Me},set:function(De){Me=De}});var Fe=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return Fe},set:function(De){Fe=De}}),this};Ie.prototype.clone=function(){return new Ie(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},Ie.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},_e.setHeaderFunction=function(Ce){return je.call(this),this.internal.__cell__.headerFunction=typeof Ce=="function"?Ce:void 0,this},_e.getTextDimensions=function(Ce,Ee){je.call(this);var Se=(Ee=Ee||{}).fontSize||this.getFontSize(),Pe=Ee.font||this.getFont(),Te=Ee.scaleFactor||this.internal.scaleFactor,Me=0,Fe=0,De=0,Oe=this;if(!Array.isArray(Ce)&&typeof Ce!="string"){if(typeof Ce!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");Ce=String(Ce)}var Qe=Ee.maxWidth;Qe>0?typeof Ce=="string"?Ce=this.splitTextToSize(Ce,Qe):Object.prototype.toString.call(Ce)==="[object Array]"&&(Ce=Ce.reduce(function(Ye,Xe){return Ye.concat(Oe.splitTextToSize(Xe,Qe))},[])):Ce=Array.isArray(Ce)?Ce:[Ce];for(var We=0;We<Ce.length;We++)Me<(De=this.getStringUnitWidth(Ce[We],{font:Pe})*Se)&&(Me=De);return Me!==0&&(Fe=Ce.length),{w:Me/=Te,h:Math.max((Fe*Se*this.getLineHeightFactor()-Se*(this.getLineHeightFactor()-1))/Te,0)}},_e.cellAddPage=function(){je.call(this),this.addPage();var Ce=this.internal.__cell__.margins||$e;return this.internal.__cell__.lastCell=new Ie(Ce.left,Ce.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var xe=_e.cell=function(){var Ce;Ce=arguments[0]instanceof Ie?arguments[0]:new Ie(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),je.call(this);var Ee=this.internal.__cell__.lastCell,Se=this.internal.__cell__.padding,Pe=this.internal.__cell__.margins||$e,Te=this.internal.__cell__.tableHeaderRow,Me=this.internal.__cell__.printHeaders;return Ee.lineNumber!==void 0&&(Ee.lineNumber===Ce.lineNumber?(Ce.x=(Ee.x||0)+(Ee.width||0),Ce.y=Ee.y||0):Ee.y+Ee.height+Ce.height+Pe.bottom>this.getPageHeight()?(this.cellAddPage(),Ce.y=Pe.top,Me&&Te&&(this.printHeaderRow(Ce.lineNumber,!0),Ce.y+=Te[0].height)):Ce.y=Ee.y+Ee.height||Ce.y),Ce.text[0]!==void 0&&(this.rect(Ce.x,Ce.y,Ce.width,Ce.height,Ae===!0?"FD":void 0),Ce.align==="right"?this.text(Ce.text,Ce.x+Ce.width-Se,Ce.y+Se,{align:"right",baseline:"top"}):Ce.align==="center"?this.text(Ce.text,Ce.x+Ce.width/2,Ce.y+Se,{align:"center",baseline:"top",maxWidth:Ce.width-Se-Se}):this.text(Ce.text,Ce.x+Se,Ce.y+Se,{align:"left",baseline:"top",maxWidth:Ce.width-Se-Se})),this.internal.__cell__.lastCell=Ce,this};_e.table=function(Ce,Ee,Se,Pe,Te){if(je.call(this),!Se)throw new Error("No data for PDF table.");var Me,Fe,De,Oe,Qe=[],We=[],Ye=[],Xe={},rr={},Ze=[],Ke=[],St=(Te=Te||{}).autoSize||!1,tr=Te.printHeaders!==!1,qe=Te.css&&Te.css["font-size"]!==void 0?16*Te.css["font-size"]:Te.fontSize||12,Ge=Te.margins||Object.assign({width:this.getPageWidth()},$e),Je=typeof Te.padding=="number"?Te.padding:3,ir=Te.headerBackgroundColor||"#c8c8c8",ar=Te.headerTextColor||"#000";if(ke.call(this),this.internal.__cell__.printHeaders=tr,this.internal.__cell__.margins=Ge,this.internal.__cell__.table_font_size=qe,this.internal.__cell__.padding=Je,this.internal.__cell__.headerBackgroundColor=ir,this.internal.__cell__.headerTextColor=ar,this.setFontSize(qe),Pe==null)We=Qe=Object.keys(Se[0]),Ye=Qe.map(function(){return"left"});else if(Array.isArray(Pe)&&_typeof$2(Pe[0])==="object")for(Qe=Pe.map(function(Ar){return Ar.name}),We=Pe.map(function(Ar){return Ar.prompt||Ar.name||""}),Ye=Pe.map(function(Ar){return Ar.align||"left"}),Me=0;Me<Pe.length;Me+=1)rr[Pe[Me].name]=Pe[Me].width*(19.049976/25.4);else Array.isArray(Pe)&&typeof Pe[0]=="string"&&(We=Qe=Pe,Ye=Qe.map(function(){return"left"}));if(St||Array.isArray(Pe)&&typeof Pe[0]=="string")for(Me=0;Me<Qe.length;Me+=1){for(Xe[Oe=Qe[Me]]=Se.map(function(Ar){return Ar[Oe]}),this.setFont(void 0,"bold"),Ze.push(this.getTextDimensions(We[Me],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),Fe=Xe[Oe],this.setFont(void 0,"normal"),De=0;De<Fe.length;De+=1)Ze.push(this.getTextDimensions(Fe[De],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);rr[Oe]=Math.max.apply(null,Ze)+Je+Je,Ze=[]}if(tr){var lr={};for(Me=0;Me<Qe.length;Me+=1)lr[Qe[Me]]={},lr[Qe[Me]].text=We[Me],lr[Qe[Me]].align=Ye[Me];var dr=Be.call(this,lr,rr);Ke=Qe.map(function(Ar){return new Ie(Ce,Ee,rr[Ar],dr,lr[Ar].text,void 0,lr[Ar].align)}),this.setTableHeaderRow(Ke),this.printHeaderRow(1,!1)}var gr=Pe.reduce(function(Ar,Rr){return Ar[Rr.name]=Rr.align,Ar},{});for(Me=0;Me<Se.length;Me+=1){"rowStart"in Te&&Te.rowStart instanceof Function&&Te.rowStart({row:Me,data:Se[Me]},this);var hr=Be.call(this,Se[Me],rr);for(De=0;De<Qe.length;De+=1){var kr=Se[Me][Qe[De]];"cellStart"in Te&&Te.cellStart instanceof Function&&Te.cellStart({row:Me,col:De,data:kr},this),xe.call(this,new Ie(Ce,Ee,rr[Qe[De]],hr,kr,Me+2,gr[Qe[De]]))}}return this.internal.__cell__.table_x=Ce,this.internal.__cell__.table_y=Ee,this};var Be=function(Ce,Ee){var Se=this.internal.__cell__.padding,Pe=this.internal.__cell__.table_font_size,Te=this.internal.scaleFactor;return Object.keys(Ce).map(function(Me){var Fe=Ce[Me];return this.splitTextToSize(Fe.hasOwnProperty("text")?Fe.text:Fe,Ee[Me]-Se-Se)},this).map(function(Me){return this.getLineHeightFactor()*Me.length*Pe/Te+Se+Se},this).reduce(function(Me,Fe){return Math.max(Me,Fe)},0)};_e.setTableHeaderRow=function(Ce){je.call(this),this.internal.__cell__.tableHeaderRow=Ce},_e.printHeaderRow=function(Ce,Ee){if(je.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var Se;if(Ae=!0,typeof this.internal.__cell__.headerFunction=="function"){var Pe=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new Ie(Pe[0],Pe[1],Pe[2],Pe[3],void 0,-1)}this.setFont(void 0,"bold");for(var Te=[],Me=0;Me<this.internal.__cell__.tableHeaderRow.length;Me+=1){Se=this.internal.__cell__.tableHeaderRow[Me].clone(),Ee&&(Se.y=this.internal.__cell__.margins.top||0,Te.push(Se)),Se.lineNumber=Ce;var Fe=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),xe.call(this,Se),this.setTextColor(Fe)}Te.length>0&&this.setTableHeaderRow(Te),this.setFont(void 0,"normal"),Ae=!1}}(E$1.API);var Pt={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},kt=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],It=_t(kt),Ft=[100,200,300,400,500,600,700,800,900],Ct=_t(Ft);function jt(_e){var $e=_e.family.replace(/"|'/g,"").toLowerCase(),Ae=function(Ie){return Pt[Ie=Ie||"normal"]?Ie:"normal"}(_e.style),je=function(Ie){if(!Ie)return 400;if(typeof Ie=="number")return Ie>=100&&Ie<=900&&Ie%100==0?Ie:400;if(/^\d00$/.test(Ie))return parseInt(Ie);switch(Ie){case"bold":return 700;case"normal":default:return 400}}(_e.weight),ke=function(Ie){return typeof It[Ie=Ie||"normal"]=="number"?Ie:"normal"}(_e.stretch);return{family:$e,style:Ae,weight:je,stretch:ke,src:_e.src||[],ref:_e.ref||{name:$e,style:[ke,Ae,je].join(" ")}}}function Ot(_e,$e,Ae,je){var ke;for(ke=Ae;ke>=0&&ke<$e.length;ke+=je)if(_e[$e[ke]])return _e[$e[ke]];for(ke=Ae;ke>=0&&ke<$e.length;ke-=je)if(_e[$e[ke]])return _e[$e[ke]]}var Bt={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Mt={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Et(_e){return[_e.stretch,_e.style,_e.weight,_e.family].join(" ")}function qt(_e,$e,Ae){for(var je=(Ae=Ae||{}).defaultFontFamily||"times",ke=Object.assign({},Bt,Ae.genericFontFamilies||{}),Ie=null,xe=null,Be=0;Be<$e.length;++Be)if(ke[(Ie=jt($e[Be])).family]&&(Ie.family=ke[Ie.family]),_e.hasOwnProperty(Ie.family)){xe=_e[Ie.family];break}if(!(xe=xe||_e[je]))throw new Error("Could not find a font-family for the rule '"+Et(Ie)+"' and default family '"+je+"'.");if(xe=function(Ce,Ee){if(Ee[Ce])return Ee[Ce];var Se=It[Ce],Pe=Se<=It.normal?-1:1,Te=Ot(Ee,kt,Se,Pe);if(!Te)throw new Error("Could not find a matching font-stretch value for "+Ce);return Te}(Ie.stretch,xe),xe=function(Ce,Ee){if(Ee[Ce])return Ee[Ce];for(var Se=Pt[Ce],Pe=0;Pe<Se.length;++Pe)if(Ee[Se[Pe]])return Ee[Se[Pe]];throw new Error("Could not find a matching font-style for "+Ce)}(Ie.style,xe),!(xe=function(Ce,Ee){if(Ee[Ce])return Ee[Ce];if(Ce===400&&Ee[500])return Ee[500];if(Ce===500&&Ee[400])return Ee[400];var Se=Ct[Ce],Pe=Ot(Ee,Ft,Se,Ce<400?-1:1);if(!Pe)throw new Error("Could not find a matching font-weight for value "+Ce);return Pe}(Ie.weight,xe)))throw new Error("Failed to resolve a font for the rule '"+Et(Ie)+"'.");return xe}function Dt(_e){return _e.trimLeft()}function Rt(_e,$e){for(var Ae=0;Ae<_e.length;){if(_e.charAt(Ae)===$e)return[_e.substring(0,Ae),_e.substring(Ae+1)];Ae+=1}return null}function Tt(_e){var $e=_e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return $e===null?null:[$e[0],_e.substring($e[0].length)]}var Ut,zt,Ht,Wt=["times"];(function(_e){var $e,Ae,je,ke,Ie,xe,Be,Ce,Ee,Se=function(or){return or=or||{},this.isStrokeTransparent=or.isStrokeTransparent||!1,this.strokeOpacity=or.strokeOpacity||1,this.strokeStyle=or.strokeStyle||"#000000",this.fillStyle=or.fillStyle||"#000000",this.isFillTransparent=or.isFillTransparent||!1,this.fillOpacity=or.fillOpacity||1,this.font=or.font||"10px sans-serif",this.textBaseline=or.textBaseline||"alphabetic",this.textAlign=or.textAlign||"left",this.lineWidth=or.lineWidth||1,this.lineJoin=or.lineJoin||"miter",this.lineCap=or.lineCap||"butt",this.path=or.path||[],this.transform=or.transform!==void 0?or.transform.clone():new Ce,this.globalCompositeOperation=or.globalCompositeOperation||"normal",this.globalAlpha=or.globalAlpha||1,this.clip_path=or.clip_path||[],this.currentPoint=or.currentPoint||new xe,this.miterLimit=or.miterLimit||10,this.lastPoint=or.lastPoint||new xe,this.lineDashOffset=or.lineDashOffset||0,this.lineDash=or.lineDash||[],this.margin=or.margin||[0,0,0,0],this.prevPageLastElemOffset=or.prevPageLastElemOffset||0,this.ignoreClearRect=typeof or.ignoreClearRect!="boolean"||or.ignoreClearRect,this};_e.events.push(["initialized",function(){this.context2d=new Pe(this),$e=this.internal.f2,Ae=this.internal.getCoordinateString,je=this.internal.getVerticalCoordinateString,ke=this.internal.getHorizontalCoordinate,Ie=this.internal.getVerticalCoordinate,xe=this.internal.Point,Be=this.internal.Rectangle,Ce=this.internal.Matrix,Ee=new Se}]);var Pe=function(or){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var pr=or;Object.defineProperty(this,"pdf",{get:function(){return pr}});var jr=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return jr},set:function(Wr){jr=!!Wr}});var Br=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Br},set:function(Wr){Br=!!Wr}});var Mr=0;Object.defineProperty(this,"posX",{get:function(){return Mr},set:function(Wr){isNaN(Wr)||(Mr=Wr)}});var Fr=0;Object.defineProperty(this,"posY",{get:function(){return Fr},set:function(Wr){isNaN(Wr)||(Fr=Wr)}}),Object.defineProperty(this,"margin",{get:function(){return Ee.margin},set:function(Wr){var Cr;typeof Wr=="number"?Cr=[Wr,Wr,Wr,Wr]:((Cr=new Array(4))[0]=Wr[0],Cr[1]=Wr.length>=2?Wr[1]:Cr[0],Cr[2]=Wr.length>=3?Wr[2]:Cr[0],Cr[3]=Wr.length>=4?Wr[3]:Cr[1]),Ee.margin=Cr}});var Lr=!1;Object.defineProperty(this,"autoPaging",{get:function(){return Lr},set:function(Wr){Lr=Wr}});var Dr=0;Object.defineProperty(this,"lastBreak",{get:function(){return Dr},set:function(Wr){Dr=Wr}});var zr=[];Object.defineProperty(this,"pageBreaks",{get:function(){return zr},set:function(Wr){zr=Wr}}),Object.defineProperty(this,"ctx",{get:function(){return Ee},set:function(Wr){Wr instanceof Se&&(Ee=Wr)}}),Object.defineProperty(this,"path",{get:function(){return Ee.path},set:function(Wr){Ee.path=Wr}});var ti=[];Object.defineProperty(this,"ctxStack",{get:function(){return ti},set:function(Wr){ti=Wr}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Wr){var Cr;Cr=Te(Wr),this.ctx.fillStyle=Cr.style,this.ctx.isFillTransparent=Cr.a===0,this.ctx.fillOpacity=Cr.a,this.pdf.setFillColor(Cr.r,Cr.g,Cr.b,{a:Cr.a}),this.pdf.setTextColor(Cr.r,Cr.g,Cr.b,{a:Cr.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Wr){var Cr=Te(Wr);this.ctx.strokeStyle=Cr.style,this.ctx.isStrokeTransparent=Cr.a===0,this.ctx.strokeOpacity=Cr.a,Cr.a===0?this.pdf.setDrawColor(255,255,255):(Cr.a,this.pdf.setDrawColor(Cr.r,Cr.g,Cr.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Wr){["butt","round","square"].indexOf(Wr)!==-1&&(this.ctx.lineCap=Wr,this.pdf.setLineCap(Wr))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Wr){isNaN(Wr)||(this.ctx.lineWidth=Wr,this.pdf.setLineWidth(Wr))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Wr){["bevel","round","miter"].indexOf(Wr)!==-1&&(this.ctx.lineJoin=Wr,this.pdf.setLineJoin(Wr))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Wr){isNaN(Wr)||(this.ctx.miterLimit=Wr,this.pdf.setMiterLimit(Wr))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Wr){this.ctx.textBaseline=Wr}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Wr){["right","end","center","left","start"].indexOf(Wr)!==-1&&(this.ctx.textAlign=Wr)}});var pi=null;function ci(Wr,Cr){if(pi===null){var Ci=function(mi){var oi=[];return Object.keys(mi).forEach(function(ui){mi[ui].forEach(function(_i){var Ai=null;switch(_i){case"bold":Ai={family:ui,weight:"bold"};break;case"italic":Ai={family:ui,style:"italic"};break;case"bolditalic":Ai={family:ui,weight:"bold",style:"italic"};break;case"":case"normal":Ai={family:ui}}Ai!==null&&(Ai.ref={name:ui,style:_i},oi.push(Ai))})}),oi}(Wr.getFontList());pi=function(mi){for(var oi={},ui=0;ui<mi.length;++ui){var _i=jt(mi[ui]),Ai=_i.family,ki=_i.stretch,yi=_i.style,Hi=_i.weight;oi[Ai]=oi[Ai]||{},oi[Ai][ki]=oi[Ai][ki]||{},oi[Ai][ki][yi]=oi[Ai][ki][yi]||{},oi[Ai][ki][yi][Hi]=_i}return oi}(Ci.concat(Cr))}return pi}var wi=null;Object.defineProperty(this,"fontFaces",{get:function(){return wi},set:function(Wr){pi=null,wi=Wr}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Wr){var Cr;if(this.ctx.font=Wr,(Cr=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Wr))!==null){var Ci=Cr[1],mi=(Cr[2],Cr[3]),oi=Cr[4],ui=(Cr[5],Cr[6]),_i=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(oi)[2];oi=Math.floor(_i==="px"?parseFloat(oi)*this.pdf.internal.scaleFactor:_i==="em"?parseFloat(oi)*this.pdf.getFontSize():parseFloat(oi)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(oi);var Ai=function(xi){var Ti,vi,aa=[],Ki=xi.trim();if(Ki==="")return Wt;if(Ki in Mt)return[Mt[Ki]];for(;Ki!=="";){switch(vi=null,Ti=(Ki=Dt(Ki)).charAt(0)){case'"':case"'":vi=Rt(Ki.substring(1),Ti);break;default:vi=Tt(Ki)}if(vi===null||(aa.push(vi[0]),(Ki=Dt(vi[1]))!==""&&Ki.charAt(0)!==","))return Wt;Ki=Ki.replace(/^,/,"")}return aa}(ui);if(this.fontFaces){var ki=qt(ci(this.pdf,this.fontFaces),Ai.map(function(xi){return{family:xi,stretch:"normal",weight:mi,style:Ci}}));this.pdf.setFont(ki.ref.name,ki.ref.style)}else{var yi="";(mi==="bold"||parseInt(mi,10)>=700||Ci==="bold")&&(yi="bold"),Ci==="italic"&&(yi+="italic"),yi.length===0&&(yi="normal");for(var Hi="",Pi={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Ri=0;Ri<Ai.length;Ri++){if(this.pdf.internal.getFont(Ai[Ri],yi,{noFallback:!0,disableWarning:!0})!==void 0){Hi=Ai[Ri];break}if(yi==="bolditalic"&&this.pdf.internal.getFont(Ai[Ri],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Hi=Ai[Ri],yi="bold";else if(this.pdf.internal.getFont(Ai[Ri],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Hi=Ai[Ri],yi="normal";break}}if(Hi===""){for(var Vi=0;Vi<Ai.length;Vi++)if(Pi[Ai[Vi]]){Hi=Pi[Ai[Vi]];break}}Hi=Hi===""?"Times":Hi,this.pdf.setFont(Hi,yi)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Wr){this.ctx.globalCompositeOperation=Wr}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Wr){this.ctx.globalAlpha=Wr}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Wr){this.ctx.lineDashOffset=Wr,Rr.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Wr){this.ctx.lineDash=Wr,Rr.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Wr){this.ctx.ignoreClearRect=!!Wr}})};Pe.prototype.setLineDash=function(or){this.lineDash=or},Pe.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},Pe.prototype.fill=function(){Xe.call(this,"fill",!1)},Pe.prototype.stroke=function(){Xe.call(this,"stroke",!1)},Pe.prototype.beginPath=function(){this.path=[{type:"begin"}]},Pe.prototype.moveTo=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var jr=this.ctx.transform.applyToPoint(new xe(or,pr));this.path.push({type:"mt",x:jr.x,y:jr.y}),this.ctx.lastPoint=new xe(or,pr)},Pe.prototype.closePath=function(){var or=new xe(0,0),pr=0;for(pr=this.path.length-1;pr!==-1;pr--)if(this.path[pr].type==="begin"&&_typeof$2(this.path[pr+1])==="object"&&typeof this.path[pr+1].x=="number"){or=new xe(this.path[pr+1].x,this.path[pr+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new xe(or.x,or.y)},Pe.prototype.lineTo=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var jr=this.ctx.transform.applyToPoint(new xe(or,pr));this.path.push({type:"lt",x:jr.x,y:jr.y}),this.ctx.lastPoint=new xe(jr.x,jr.y)},Pe.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),Xe.call(this,null,!0)},Pe.prototype.quadraticCurveTo=function(or,pr,jr,Br){if(isNaN(jr)||isNaN(Br)||isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var Mr=this.ctx.transform.applyToPoint(new xe(jr,Br)),Fr=this.ctx.transform.applyToPoint(new xe(or,pr));this.path.push({type:"qct",x1:Fr.x,y1:Fr.y,x:Mr.x,y:Mr.y}),this.ctx.lastPoint=new xe(Mr.x,Mr.y)},Pe.prototype.bezierCurveTo=function(or,pr,jr,Br,Mr,Fr){if(isNaN(Mr)||isNaN(Fr)||isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var Lr=this.ctx.transform.applyToPoint(new xe(Mr,Fr)),Dr=this.ctx.transform.applyToPoint(new xe(or,pr)),zr=this.ctx.transform.applyToPoint(new xe(jr,Br));this.path.push({type:"bct",x1:Dr.x,y1:Dr.y,x2:zr.x,y2:zr.y,x:Lr.x,y:Lr.y}),this.ctx.lastPoint=new xe(Lr.x,Lr.y)},Pe.prototype.arc=function(or,pr,jr,Br,Mr,Fr){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br)||isNaN(Mr))throw a$2.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Fr=!!Fr,!this.ctx.transform.isIdentity){var Lr=this.ctx.transform.applyToPoint(new xe(or,pr));or=Lr.x,pr=Lr.y;var Dr=this.ctx.transform.applyToPoint(new xe(0,jr)),zr=this.ctx.transform.applyToPoint(new xe(0,0));jr=Math.sqrt(Math.pow(Dr.x-zr.x,2)+Math.pow(Dr.y-zr.y,2))}Math.abs(Mr-Br)>=2*Math.PI&&(Br=0,Mr=2*Math.PI),this.path.push({type:"arc",x:or,y:pr,radius:jr,startAngle:Br,endAngle:Mr,counterclockwise:Fr})},Pe.prototype.arcTo=function(or,pr,jr,Br,Mr){throw new Error("arcTo not implemented.")},Pe.prototype.rect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(or,pr),this.lineTo(or+jr,pr),this.lineTo(or+jr,pr+Br),this.lineTo(or,pr+Br),this.lineTo(or,pr),this.lineTo(or+jr,pr),this.lineTo(or,pr)},Pe.prototype.fillRect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!Me.call(this)){var Mr={};this.lineCap!=="butt"&&(Mr.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(Mr.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(or,pr,jr,Br),this.fill(),Mr.hasOwnProperty("lineCap")&&(this.lineCap=Mr.lineCap),Mr.hasOwnProperty("lineJoin")&&(this.lineJoin=Mr.lineJoin)}},Pe.prototype.strokeRect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");Fe.call(this)||(this.beginPath(),this.rect(or,pr,jr,Br),this.stroke())},Pe.prototype.clearRect=function(or,pr,jr,Br){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br))throw a$2.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(or,pr,jr,Br))},Pe.prototype.save=function(or){or=typeof or!="boolean"||or;for(var pr=this.pdf.internal.getCurrentPageInfo().pageNumber,jr=0;jr<this.pdf.internal.getNumberOfPages();jr++)this.pdf.setPage(jr+1),this.pdf.internal.out("q");if(this.pdf.setPage(pr),or){this.ctx.fontSize=this.pdf.internal.getFontSize();var Br=new Se(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Br}},Pe.prototype.restore=function(or){or=typeof or!="boolean"||or;for(var pr=this.pdf.internal.getCurrentPageInfo().pageNumber,jr=0;jr<this.pdf.internal.getNumberOfPages();jr++)this.pdf.setPage(jr+1),this.pdf.internal.out("Q");this.pdf.setPage(pr),or&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},Pe.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var Te=function(or){var pr,jr,Br,Mr;if(or.isCanvasGradient===!0&&(or=or.getColor()),!or)return{r:0,g:0,b:0,a:0,style:or};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(or))pr=0,jr=0,Br=0,Mr=0;else{var Fr=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(or);if(Fr!==null)pr=parseInt(Fr[1]),jr=parseInt(Fr[2]),Br=parseInt(Fr[3]),Mr=1;else if((Fr=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(or))!==null)pr=parseInt(Fr[1]),jr=parseInt(Fr[2]),Br=parseInt(Fr[3]),Mr=parseFloat(Fr[4]);else{if(Mr=1,typeof or=="string"&&or.charAt(0)!=="#"){var Lr=new f$2(or);or=Lr.ok?Lr.toHex():"#000000"}or.length===4?(pr=or.substring(1,2),pr+=pr,jr=or.substring(2,3),jr+=jr,Br=or.substring(3,4),Br+=Br):(pr=or.substring(1,3),jr=or.substring(3,5),Br=or.substring(5,7)),pr=parseInt(pr,16),jr=parseInt(jr,16),Br=parseInt(Br,16)}}return{r:pr,g:jr,b:Br,a:Mr,style:or}},Me=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},Fe=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};Pe.prototype.fillText=function(or,pr,jr,Br){if(isNaN(pr)||isNaN(jr)||typeof or!="string")throw a$2.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Br=isNaN(Br)?void 0:Br,!Me.call(this)){var Mr=hr(this.ctx.transform.rotation),Fr=this.ctx.transform.scaleX;Je.call(this,{text:or,x:pr,y:jr,scale:Fr,angle:Mr,align:this.textAlign,maxWidth:Br})}},Pe.prototype.strokeText=function(or,pr,jr,Br){if(isNaN(pr)||isNaN(jr)||typeof or!="string")throw a$2.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!Fe.call(this)){Br=isNaN(Br)?void 0:Br;var Mr=hr(this.ctx.transform.rotation),Fr=this.ctx.transform.scaleX;Je.call(this,{text:or,x:pr,y:jr,scale:Fr,renderingMode:"stroke",angle:Mr,align:this.textAlign,maxWidth:Br})}},Pe.prototype.measureText=function(or){if(typeof or!="string")throw a$2.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var pr=this.pdf,jr=this.pdf.internal.scaleFactor,Br=pr.internal.getFontSize(),Mr=pr.getStringUnitWidth(or)*Br/pr.internal.scaleFactor,Fr=function(Lr){var Dr=(Lr=Lr||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return Dr}}),this};return new Fr({width:Mr*=Math.round(96*jr/72*1e4)/1e4})},Pe.prototype.scale=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var jr=new Ce(or,0,0,pr,0,0);this.ctx.transform=this.ctx.transform.multiply(jr)},Pe.prototype.rotate=function(or){if(isNaN(or))throw a$2.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var pr=new Ce(Math.cos(or),Math.sin(or),-Math.sin(or),Math.cos(or),0,0);this.ctx.transform=this.ctx.transform.multiply(pr)},Pe.prototype.translate=function(or,pr){if(isNaN(or)||isNaN(pr))throw a$2.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var jr=new Ce(1,0,0,1,or,pr);this.ctx.transform=this.ctx.transform.multiply(jr)},Pe.prototype.transform=function(or,pr,jr,Br,Mr,Fr){if(isNaN(or)||isNaN(pr)||isNaN(jr)||isNaN(Br)||isNaN(Mr)||isNaN(Fr))throw a$2.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var Lr=new Ce(or,pr,jr,Br,Mr,Fr);this.ctx.transform=this.ctx.transform.multiply(Lr)},Pe.prototype.setTransform=function(or,pr,jr,Br,Mr,Fr){or=isNaN(or)?1:or,pr=isNaN(pr)?0:pr,jr=isNaN(jr)?0:jr,Br=isNaN(Br)?1:Br,Mr=isNaN(Mr)?0:Mr,Fr=isNaN(Fr)?0:Fr,this.ctx.transform=new Ce(or,pr,jr,Br,Mr,Fr)};var De=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};Pe.prototype.drawImage=function(or,pr,jr,Br,Mr,Fr,Lr,Dr,zr){var ti=this.pdf.getImageProperties(or),pi=1,ci=1,wi=1,Wr=1;Br!==void 0&&Dr!==void 0&&(wi=Dr/Br,Wr=zr/Mr,pi=ti.width/Br*Dr/Br,ci=ti.height/Mr*zr/Mr),Fr===void 0&&(Fr=pr,Lr=jr,pr=0,jr=0),Br!==void 0&&Dr===void 0&&(Dr=Br,zr=Mr),Br===void 0&&Dr===void 0&&(Dr=ti.width,zr=ti.height);for(var Cr,Ci=this.ctx.transform.decompose(),mi=hr(Ci.rotate.shx),oi=new Ce,ui=(oi=(oi=(oi=oi.multiply(Ci.translate)).multiply(Ci.skew)).multiply(Ci.scale)).applyToRectangle(new Be(Fr-pr*wi,Lr-jr*Wr,Br*pi,Mr*ci)),_i=Oe.call(this,ui),Ai=[],ki=0;ki<_i.length;ki+=1)Ai.indexOf(_i[ki])===-1&&Ai.push(_i[ki]);if(Ye(Ai),this.autoPaging)for(var yi=Ai[0],Hi=Ai[Ai.length-1],Pi=yi;Pi<Hi+1;Pi++){this.pdf.setPage(Pi);var Ri=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Vi=Pi===1?this.posY+this.margin[0]:this.margin[0],xi=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ti=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],vi=Pi===1?0:xi+(Pi-2)*Ti;if(this.ctx.clip_path.length!==0){var aa=this.path;Cr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=We(Cr,this.posX+this.margin[3],-vi+Vi+this.ctx.prevPageLastElemOffset),rr.call(this,"fill",!0),this.path=aa}var Ki=JSON.parse(JSON.stringify(ui));Ki=We([Ki],this.posX+this.margin[3],-vi+Vi+this.ctx.prevPageLastElemOffset)[0];var na=(Pi>yi||Pi<Hi)&&De.call(this);na&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ri,Ti,null).clip().discardPath()),this.pdf.addImage(or,"JPEG",Ki.x,Ki.y,Ki.w,Ki.h,null,null,mi),na&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(or,"JPEG",ui.x,ui.y,ui.w,ui.h,null,null,mi)};var Oe=function(or,pr,jr){var Br=[];pr=pr||this.pdf.internal.pageSize.width,jr=jr||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var Mr=this.posY+this.ctx.prevPageLastElemOffset;switch(or.type){default:case"mt":case"lt":Br.push(Math.floor((or.y+Mr)/jr)+1);break;case"arc":Br.push(Math.floor((or.y+Mr-or.radius)/jr)+1),Br.push(Math.floor((or.y+Mr+or.radius)/jr)+1);break;case"qct":var Fr=kr(this.ctx.lastPoint.x,this.ctx.lastPoint.y,or.x1,or.y1,or.x,or.y);Br.push(Math.floor((Fr.y+Mr)/jr)+1),Br.push(Math.floor((Fr.y+Fr.h+Mr)/jr)+1);break;case"bct":var Lr=Ar(this.ctx.lastPoint.x,this.ctx.lastPoint.y,or.x1,or.y1,or.x2,or.y2,or.x,or.y);Br.push(Math.floor((Lr.y+Mr)/jr)+1),Br.push(Math.floor((Lr.y+Lr.h+Mr)/jr)+1);break;case"rect":Br.push(Math.floor((or.y+Mr)/jr)+1),Br.push(Math.floor((or.y+or.h+Mr)/jr)+1)}for(var Dr=0;Dr<Br.length;Dr+=1)for(;this.pdf.internal.getNumberOfPages()<Br[Dr];)Qe.call(this);return Br},Qe=function(){var or=this.fillStyle,pr=this.strokeStyle,jr=this.font,Br=this.lineCap,Mr=this.lineWidth,Fr=this.lineJoin;this.pdf.addPage(),this.fillStyle=or,this.strokeStyle=pr,this.font=jr,this.lineCap=Br,this.lineWidth=Mr,this.lineJoin=Fr},We=function(or,pr,jr){for(var Br=0;Br<or.length;Br++)switch(or[Br].type){case"bct":or[Br].x2+=pr,or[Br].y2+=jr;case"qct":or[Br].x1+=pr,or[Br].y1+=jr;case"mt":case"lt":case"arc":default:or[Br].x+=pr,or[Br].y+=jr}return or},Ye=function(or){return or.sort(function(pr,jr){return pr-jr})},Xe=function(or,pr){for(var jr,Br,Mr=this.fillStyle,Fr=this.strokeStyle,Lr=this.lineCap,Dr=this.lineWidth,zr=Math.abs(Dr*this.ctx.transform.scaleX),ti=this.lineJoin,pi=JSON.parse(JSON.stringify(this.path)),ci=JSON.parse(JSON.stringify(this.path)),wi=[],Wr=0;Wr<ci.length;Wr++)if(ci[Wr].x!==void 0)for(var Cr=Oe.call(this,ci[Wr]),Ci=0;Ci<Cr.length;Ci+=1)wi.indexOf(Cr[Ci])===-1&&wi.push(Cr[Ci]);for(var mi=0;mi<wi.length;mi++)for(;this.pdf.internal.getNumberOfPages()<wi[mi];)Qe.call(this);if(Ye(wi),this.autoPaging)for(var oi=wi[0],ui=wi[wi.length-1],_i=oi;_i<ui+1;_i++){this.pdf.setPage(_i),this.fillStyle=Mr,this.strokeStyle=Fr,this.lineCap=Lr,this.lineWidth=zr,this.lineJoin=ti;var Ai=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ki=_i===1?this.posY+this.margin[0]:this.margin[0],yi=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Hi=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Pi=_i===1?0:yi+(_i-2)*Hi;if(this.ctx.clip_path.length!==0){var Ri=this.path;jr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=We(jr,this.posX+this.margin[3],-Pi+ki+this.ctx.prevPageLastElemOffset),rr.call(this,or,!0),this.path=Ri}if(Br=JSON.parse(JSON.stringify(pi)),this.path=We(Br,this.posX+this.margin[3],-Pi+ki+this.ctx.prevPageLastElemOffset),pr===!1||_i===0){var Vi=(_i>oi||_i<ui)&&De.call(this);Vi&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ai,Hi,null).clip().discardPath()),rr.call(this,or,pr),Vi&&this.pdf.restoreGraphicsState()}this.lineWidth=Dr}else this.lineWidth=zr,rr.call(this,or,pr),this.lineWidth=Dr;this.path=pi},rr=function(or,pr){if((or!=="stroke"||pr||!Fe.call(this))&&(or==="stroke"||pr||!Me.call(this))){for(var jr,Br,Mr=[],Fr=this.path,Lr=0;Lr<Fr.length;Lr++){var Dr=Fr[Lr];switch(Dr.type){case"begin":Mr.push({begin:!0});break;case"close":Mr.push({close:!0});break;case"mt":Mr.push({start:Dr,deltas:[],abs:[]});break;case"lt":var zr=Mr.length;if(Fr[Lr-1]&&!isNaN(Fr[Lr-1].x)&&(jr=[Dr.x-Fr[Lr-1].x,Dr.y-Fr[Lr-1].y],zr>0)){for(;zr>=0;zr--)if(Mr[zr-1].close!==!0&&Mr[zr-1].begin!==!0){Mr[zr-1].deltas.push(jr),Mr[zr-1].abs.push(Dr);break}}break;case"bct":jr=[Dr.x1-Fr[Lr-1].x,Dr.y1-Fr[Lr-1].y,Dr.x2-Fr[Lr-1].x,Dr.y2-Fr[Lr-1].y,Dr.x-Fr[Lr-1].x,Dr.y-Fr[Lr-1].y],Mr[Mr.length-1].deltas.push(jr);break;case"qct":var ti=Fr[Lr-1].x+2/3*(Dr.x1-Fr[Lr-1].x),pi=Fr[Lr-1].y+2/3*(Dr.y1-Fr[Lr-1].y),ci=Dr.x+2/3*(Dr.x1-Dr.x),wi=Dr.y+2/3*(Dr.y1-Dr.y),Wr=Dr.x,Cr=Dr.y;jr=[ti-Fr[Lr-1].x,pi-Fr[Lr-1].y,ci-Fr[Lr-1].x,wi-Fr[Lr-1].y,Wr-Fr[Lr-1].x,Cr-Fr[Lr-1].y],Mr[Mr.length-1].deltas.push(jr);break;case"arc":Mr.push({deltas:[],abs:[],arc:!0}),Array.isArray(Mr[Mr.length-1].abs)&&Mr[Mr.length-1].abs.push(Dr)}}Br=pr?null:or==="stroke"?"stroke":"fill";for(var Ci=!1,mi=0;mi<Mr.length;mi++)if(Mr[mi].arc)for(var oi=Mr[mi].abs,ui=0;ui<oi.length;ui++){var _i=oi[ui];_i.type==="arc"?St.call(this,_i.x,_i.y,_i.radius,_i.startAngle,_i.endAngle,_i.counterclockwise,void 0,pr,!Ci):ir.call(this,_i.x,_i.y),Ci=!0}else if(Mr[mi].close===!0)this.pdf.internal.out("h"),Ci=!1;else if(Mr[mi].begin!==!0){var Ai=Mr[mi].start.x,ki=Mr[mi].start.y;ar.call(this,Mr[mi].deltas,Ai,ki),Ci=!0}Br&&tr.call(this,Br),pr&&qe.call(this)}},Ze=function(or){var pr=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,jr=pr*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return or-jr;case"top":return or+pr-jr;case"hanging":return or+pr-2*jr;case"middle":return or+pr/2-jr;case"ideographic":return or;case"alphabetic":default:return or}},Ke=function(or){return or+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};Pe.prototype.createLinearGradient=function(){var or=function(){};return or.colorStops=[],or.addColorStop=function(pr,jr){this.colorStops.push([pr,jr])},or.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},or.isCanvasGradient=!0,or},Pe.prototype.createPattern=function(){return this.createLinearGradient()},Pe.prototype.createRadialGradient=function(){return this.createLinearGradient()};var St=function(or,pr,jr,Br,Mr,Fr,Lr,Dr,zr){for(var ti=dr.call(this,jr,Br,Mr,Fr),pi=0;pi<ti.length;pi++){var ci=ti[pi];pi===0&&(zr?Ge.call(this,ci.x1+or,ci.y1+pr):ir.call(this,ci.x1+or,ci.y1+pr)),lr.call(this,or,pr,ci.x2,ci.y2,ci.x3,ci.y3,ci.x4,ci.y4)}Dr?qe.call(this):tr.call(this,Lr)},tr=function(or){switch(or){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},qe=function(){this.pdf.clip(),this.pdf.discardPath()},Ge=function(or,pr){this.pdf.internal.out(Ae(or)+" "+je(pr)+" m")},Je=function(or){var pr;switch(or.align){case"right":case"end":pr="right";break;case"center":pr="center";break;case"left":case"start":default:pr="left"}var jr=this.pdf.getTextDimensions(or.text),Br=Ze.call(this,or.y),Mr=Ke.call(this,Br)-jr.h,Fr=this.ctx.transform.applyToPoint(new xe(or.x,Br)),Lr=this.ctx.transform.decompose(),Dr=new Ce;Dr=(Dr=(Dr=Dr.multiply(Lr.translate)).multiply(Lr.skew)).multiply(Lr.scale);for(var zr,ti,pi,ci=this.ctx.transform.applyToRectangle(new Be(or.x,Br,jr.w,jr.h)),wi=Dr.applyToRectangle(new Be(or.x,Mr,jr.w,jr.h)),Wr=Oe.call(this,wi),Cr=[],Ci=0;Ci<Wr.length;Ci+=1)Cr.indexOf(Wr[Ci])===-1&&Cr.push(Wr[Ci]);if(Ye(Cr),this.autoPaging)for(var mi=Cr[0],oi=Cr[Cr.length-1],ui=mi;ui<oi+1;ui++){this.pdf.setPage(ui);var _i=ui===1?this.posY+this.margin[0]:this.margin[0],Ai=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ki=this.pdf.internal.pageSize.height-this.margin[2],yi=ki-this.margin[0],Hi=this.pdf.internal.pageSize.width-this.margin[1],Pi=Hi-this.margin[3],Ri=ui===1?0:Ai+(ui-2)*yi;if(this.ctx.clip_path.length!==0){var Vi=this.path;zr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=We(zr,this.posX+this.margin[3],-1*Ri+_i),rr.call(this,"fill",!0),this.path=Vi}var xi=We([JSON.parse(JSON.stringify(wi))],this.posX+this.margin[3],-Ri+_i+this.ctx.prevPageLastElemOffset)[0];or.scale>=.01&&(ti=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ti*or.scale),pi=this.lineWidth,this.lineWidth=pi*or.scale);var Ti=this.autoPaging!=="text";if(Ti||xi.y+xi.h<=ki){if(Ti||xi.y>=_i&&xi.x<=Hi){var vi=Ti?or.text:this.pdf.splitTextToSize(or.text,or.maxWidth||Hi-xi.x)[0],aa=We([JSON.parse(JSON.stringify(ci))],this.posX+this.margin[3],-Ri+_i+this.ctx.prevPageLastElemOffset)[0],Ki=Ti&&(ui>mi||ui<oi)&&De.call(this);Ki&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Pi,yi,null).clip().discardPath()),this.pdf.text(vi,aa.x,aa.y,{angle:or.angle,align:pr,renderingMode:or.renderingMode}),Ki&&this.pdf.restoreGraphicsState()}}else xi.y<ki&&(this.ctx.prevPageLastElemOffset+=ki-xi.y);or.scale>=.01&&(this.pdf.setFontSize(ti),this.lineWidth=pi)}else or.scale>=.01&&(ti=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ti*or.scale),pi=this.lineWidth,this.lineWidth=pi*or.scale),this.pdf.text(or.text,Fr.x+this.posX,Fr.y+this.posY,{angle:or.angle,align:pr,renderingMode:or.renderingMode,maxWidth:or.maxWidth}),or.scale>=.01&&(this.pdf.setFontSize(ti),this.lineWidth=pi)},ir=function(or,pr,jr,Br){jr=jr||0,Br=Br||0,this.pdf.internal.out(Ae(or+jr)+" "+je(pr+Br)+" l")},ar=function(or,pr,jr){return this.pdf.lines(or,pr,jr,null,null)},lr=function(or,pr,jr,Br,Mr,Fr,Lr,Dr){this.pdf.internal.out([$e(ke(jr+or)),$e(Ie(Br+pr)),$e(ke(Mr+or)),$e(Ie(Fr+pr)),$e(ke(Lr+or)),$e(Ie(Dr+pr)),"c"].join(" "))},dr=function(or,pr,jr,Br){for(var Mr=2*Math.PI,Fr=Math.PI/2;pr>jr;)pr-=Mr;var Lr=Math.abs(jr-pr);Lr<Mr&&Br&&(Lr=Mr-Lr);for(var Dr=[],zr=Br?-1:1,ti=pr;Lr>1e-5;){var pi=ti+zr*Math.min(Lr,Fr);Dr.push(gr.call(this,or,ti,pi)),Lr-=Math.abs(pi-ti),ti=pi}return Dr},gr=function(or,pr,jr){var Br=(jr-pr)/2,Mr=or*Math.cos(Br),Fr=or*Math.sin(Br),Lr=Mr,Dr=-Fr,zr=Lr*Lr+Dr*Dr,ti=zr+Lr*Mr+Dr*Fr,pi=4/3*(Math.sqrt(2*zr*ti)-ti)/(Lr*Fr-Dr*Mr),ci=Lr-pi*Dr,wi=Dr+pi*Lr,Wr=ci,Cr=-wi,Ci=Br+pr,mi=Math.cos(Ci),oi=Math.sin(Ci);return{x1:or*Math.cos(pr),y1:or*Math.sin(pr),x2:ci*mi-wi*oi,y2:ci*oi+wi*mi,x3:Wr*mi-Cr*oi,y3:Wr*oi+Cr*mi,x4:or*Math.cos(jr),y4:or*Math.sin(jr)}},hr=function(or){return 180*or/Math.PI},kr=function(or,pr,jr,Br,Mr,Fr){var Lr=or+.5*(jr-or),Dr=pr+.5*(Br-pr),zr=Mr+.5*(jr-Mr),ti=Fr+.5*(Br-Fr),pi=Math.min(or,Mr,Lr,zr),ci=Math.max(or,Mr,Lr,zr),wi=Math.min(pr,Fr,Dr,ti),Wr=Math.max(pr,Fr,Dr,ti);return new Be(pi,wi,ci-pi,Wr-wi)},Ar=function(or,pr,jr,Br,Mr,Fr,Lr,Dr){var zr,ti,pi,ci,wi,Wr,Cr,Ci,mi,oi,ui,_i,Ai,ki,yi=jr-or,Hi=Br-pr,Pi=Mr-jr,Ri=Fr-Br,Vi=Lr-Mr,xi=Dr-Fr;for(ti=0;ti<41;ti++)mi=(Cr=(pi=or+(zr=ti/40)*yi)+zr*((wi=jr+zr*Pi)-pi))+zr*(wi+zr*(Mr+zr*Vi-wi)-Cr),oi=(Ci=(ci=pr+zr*Hi)+zr*((Wr=Br+zr*Ri)-ci))+zr*(Wr+zr*(Fr+zr*xi-Wr)-Ci),ti==0?(ui=mi,_i=oi,Ai=mi,ki=oi):(ui=Math.min(ui,mi),_i=Math.min(_i,oi),Ai=Math.max(Ai,mi),ki=Math.max(ki,oi));return new Be(Math.round(ui),Math.round(_i),Math.round(Ai-ui),Math.round(ki-_i))},Rr=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var or,pr,jr=(or=this.ctx.lineDash,pr=this.ctx.lineDashOffset,JSON.stringify({lineDash:or,lineDashOffset:pr}));this.prevLineDash!==jr&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=jr)}}})(E$1.API),function(_e){var $e=function(Ie){var xe,Be,Ce,Ee,Se,Pe,Te,Me,Fe,De;for(Be=[],Ce=0,Ee=(Ie+=xe="\0\0\0\0".slice(Ie.length%4||4)).length;Ee>Ce;Ce+=4)(Se=(Ie.charCodeAt(Ce)<<24)+(Ie.charCodeAt(Ce+1)<<16)+(Ie.charCodeAt(Ce+2)<<8)+Ie.charCodeAt(Ce+3))!==0?(Pe=(Se=((Se=((Se=((Se=(Se-(De=Se%85))/85)-(Fe=Se%85))/85)-(Me=Se%85))/85)-(Te=Se%85))/85)%85,Be.push(Pe+33,Te+33,Me+33,Fe+33,De+33)):Be.push(122);return function(Oe,Qe){for(var We=Qe;We>0;We--)Oe.pop()}(Be,xe.length),String.fromCharCode.apply(String,Be)+"~>"},Ae=function(Ie){var xe,Be,Ce,Ee,Se,Pe=String,Te="length",Me=255,Fe="charCodeAt",De="slice",Oe="replace";for(Ie[De](-2),Ie=Ie[De](0,-2)[Oe](/\s/g,"")[Oe]("z","!!!!!"),Ce=[],Ee=0,Se=(Ie+=xe="uuuuu"[De](Ie[Te]%5||5))[Te];Se>Ee;Ee+=5)Be=52200625*(Ie[Fe](Ee)-33)+614125*(Ie[Fe](Ee+1)-33)+7225*(Ie[Fe](Ee+2)-33)+85*(Ie[Fe](Ee+3)-33)+(Ie[Fe](Ee+4)-33),Ce.push(Me&Be>>24,Me&Be>>16,Me&Be>>8,Me&Be);return function(Qe,We){for(var Ye=We;Ye>0;Ye--)Qe.pop()}(Ce,xe[Te]),Pe.fromCharCode.apply(Pe,Ce)},je=function(Ie){var xe=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((Ie=Ie.replace(/\s/g,"")).indexOf(">")!==-1&&(Ie=Ie.substr(0,Ie.indexOf(">"))),Ie.length%2&&(Ie+="0"),xe.test(Ie)===!1)return"";for(var Be="",Ce=0;Ce<Ie.length;Ce+=2)Be+=String.fromCharCode("0x"+(Ie[Ce]+Ie[Ce+1]));return Be},ke=function(Ie){for(var xe=new Uint8Array(Ie.length),Be=Ie.length;Be--;)xe[Be]=Ie.charCodeAt(Be);return Ie=(xe=zlibSync(xe)).reduce(function(Ce,Ee){return Ce+String.fromCharCode(Ee)},"")};_e.processDataByFilters=function(Ie,xe){var Be=0,Ce=Ie||"",Ee=[];for(typeof(xe=xe||[])=="string"&&(xe=[xe]),Be=0;Be<xe.length;Be+=1)switch(xe[Be]){case"ASCII85Decode":case"/ASCII85Decode":Ce=Ae(Ce),Ee.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":Ce=$e(Ce),Ee.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":Ce=je(Ce),Ee.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":Ce=Ce.split("").map(function(Se){return("0"+Se.charCodeAt().toString(16)).slice(-2)}).join("")+">",Ee.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":Ce=ke(Ce),Ee.push("/FlateDecode");break;default:throw new Error('The filter: "'+xe[Be]+'" is not implemented')}return{data:Ce,reverseChain:Ee.reverse().join(" ")}}}(E$1.API),function(_e){_e.loadFile=function($e,Ae,je){return function(ke,Ie,xe){Ie=Ie!==!1,xe=typeof xe=="function"?xe:function(){};var Be=void 0;try{Be=function(Ce,Ee,Se){var Pe=new XMLHttpRequest,Te=0,Me=function(Fe){var De=Fe.length,Oe=[],Qe=String.fromCharCode;for(Te=0;Te<De;Te+=1)Oe.push(Qe(255&Fe.charCodeAt(Te)));return Oe.join("")};if(Pe.open("GET",Ce,!Ee),Pe.overrideMimeType("text/plain; charset=x-user-defined"),Ee===!1&&(Pe.onload=function(){Pe.status===200?Se(Me(this.responseText)):Se(void 0)}),Pe.send(null),Ee&&Pe.status===200)return Me(Pe.responseText)}(ke,Ie,xe)}catch{}return Be}($e,Ae,je)},_e.loadImageFile=_e.loadFile}(E$1.API),function(_e){function $e(){return(n$1.html2canvas?Promise.resolve(n$1.html2canvas):Promise.resolve().then(()=>html2canvas_esm)).catch(function(xe){return Promise.reject(new Error("Could not load html2canvas: "+xe))}).then(function(xe){return xe.default?xe.default:xe})}function Ae(){return(n$1.DOMPurify?Promise.resolve(n$1.DOMPurify):Promise.resolve().then(()=>require("./purify.es-CYVvLED6.cjs"))).catch(function(xe){return Promise.reject(new Error("Could not load dompurify: "+xe))}).then(function(xe){return xe.default?xe.default:xe})}var je=function(xe){var Be=_typeof$2(xe);return Be==="undefined"?"undefined":Be==="string"||xe instanceof String?"string":Be==="number"||xe instanceof Number?"number":Be==="function"||xe instanceof Function?"function":xe&&xe.constructor===Array?"array":xe&&xe.nodeType===1?"element":Be==="object"?"object":"unknown"},ke=function(xe,Be){var Ce=document.createElement(xe);for(var Ee in Be.className&&(Ce.className=Be.className),Be.innerHTML&&Be.dompurify&&(Ce.innerHTML=Be.dompurify.sanitize(Be.innerHTML)),Be.style)Ce.style[Ee]=Be.style[Ee];return Ce},Ie=function xe(Be){var Ce=Object.assign(xe.convert(Promise.resolve()),JSON.parse(JSON.stringify(xe.template))),Ee=xe.convert(Promise.resolve(),Ce);return Ee=(Ee=Ee.setProgress(1,xe,1,[xe])).set(Be)};(Ie.prototype=Object.create(Promise.prototype)).constructor=Ie,Ie.convert=function(xe,Be){return xe.__proto__=Be||Ie.prototype,xe},Ie.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},Ie.prototype.from=function(xe,Be){return this.then(function(){switch(Be=Be||function(Ce){switch(je(Ce)){case"string":return"string";case"element":return Ce.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(xe)){case"string":return this.then(Ae).then(function(Ce){return this.set({src:ke("div",{innerHTML:xe,dompurify:Ce})})});case"element":return this.set({src:xe});case"canvas":return this.set({canvas:xe});case"img":return this.set({img:xe});default:return this.error("Unknown source type.")}})},Ie.prototype.to=function(xe){switch(xe){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},Ie.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var xe={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},Be=function Ce(Ee,Se){for(var Pe=Ee.nodeType===3?document.createTextNode(Ee.nodeValue):Ee.cloneNode(!1),Te=Ee.firstChild;Te;Te=Te.nextSibling)Se!==!0&&Te.nodeType===1&&Te.nodeName==="SCRIPT"||Pe.appendChild(Ce(Te,Se));return Ee.nodeType===1&&(Ee.nodeName==="CANVAS"?(Pe.width=Ee.width,Pe.height=Ee.height,Pe.getContext("2d").drawImage(Ee,0,0)):Ee.nodeName!=="TEXTAREA"&&Ee.nodeName!=="SELECT"||(Pe.value=Ee.value),Pe.addEventListener("load",function(){Pe.scrollTop=Ee.scrollTop,Pe.scrollLeft=Ee.scrollLeft},!0)),Pe}(this.prop.src,this.opt.html2canvas.javascriptEnabled);Be.tagName==="BODY"&&(xe.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=ke("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=ke("div",{className:"html2pdf__container",style:xe}),this.prop.container.appendChild(Be),this.prop.container.firstChild.appendChild(ke("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},Ie.prototype.toCanvas=function(){var xe=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(xe).then($e).then(function(Be){var Ce=Object.assign({},this.opt.html2canvas);return delete Ce.onrendered,Be(this.prop.container,Ce)}).then(function(Be){(this.opt.html2canvas.onrendered||function(){})(Be),this.prop.canvas=Be,document.body.removeChild(this.prop.overlay)})},Ie.prototype.toContext2d=function(){var xe=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(xe).then($e).then(function(Be){var Ce=this.opt.jsPDF,Ee=this.opt.fontFaces,Se=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,Pe=Object.assign({async:!0,allowTaint:!0,scale:Se,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete Pe.onrendered,Ce.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,Ce.context2d.posX=this.opt.x,Ce.context2d.posY=this.opt.y,Ce.context2d.margin=this.opt.margin,Ce.context2d.fontFaces=Ee,Ee)for(var Te=0;Te<Ee.length;++Te){var Me=Ee[Te],Fe=Me.src.find(function(De){return De.format==="truetype"});Fe&&Ce.addFont(Fe.url,Me.ref.name,Me.ref.style)}return Pe.windowHeight=Pe.windowHeight||0,Pe.windowHeight=Pe.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):Pe.windowHeight,Ce.context2d.save(!0),Be(this.prop.container,Pe)}).then(function(Be){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(Be),this.prop.canvas=Be,document.body.removeChild(this.prop.overlay)})},Ie.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var xe=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=xe})},Ie.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},Ie.prototype.output=function(xe,Be,Ce){return(Ce=Ce||"pdf").toLowerCase()==="img"||Ce.toLowerCase()==="image"?this.outputImg(xe,Be):this.outputPdf(xe,Be)},Ie.prototype.outputPdf=function(xe,Be){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(xe,Be)})},Ie.prototype.outputImg=function(xe){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(xe){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+xe+'" is not supported.'}})},Ie.prototype.save=function(xe){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(xe?{filename:xe}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},Ie.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},Ie.prototype.set=function(xe){if(je(xe)!=="object")return this;var Be=Object.keys(xe||{}).map(function(Ce){if(Ce in Ie.template.prop)return function(){this.prop[Ce]=xe[Ce]};switch(Ce){case"margin":return this.setMargin.bind(this,xe.margin);case"jsPDF":return function(){return this.opt.jsPDF=xe.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,xe.pageSize);default:return function(){this.opt[Ce]=xe[Ce]}}},this);return this.then(function(){return this.thenList(Be)})},Ie.prototype.get=function(xe,Be){return this.then(function(){var Ce=xe in Ie.template.prop?this.prop[xe]:this.opt[xe];return Be?Be(Ce):Ce})},Ie.prototype.setMargin=function(xe){return this.then(function(){switch(je(xe)){case"number":xe=[xe,xe,xe,xe];case"array":if(xe.length===2&&(xe=[xe[0],xe[1],xe[0],xe[1]]),xe.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=xe}).then(this.setPageSize)},Ie.prototype.setPageSize=function(xe){function Be(Ce,Ee){return Math.floor(Ce*Ee/72*96)}return this.then(function(){(xe=xe||E$1.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(xe.inner={width:xe.width-this.opt.margin[1]-this.opt.margin[3],height:xe.height-this.opt.margin[0]-this.opt.margin[2]},xe.inner.px={width:Be(xe.inner.width,xe.k),height:Be(xe.inner.height,xe.k)},xe.inner.ratio=xe.inner.height/xe.inner.width),this.prop.pageSize=xe})},Ie.prototype.setProgress=function(xe,Be,Ce,Ee){return xe!=null&&(this.progress.val=xe),Be!=null&&(this.progress.state=Be),Ce!=null&&(this.progress.n=Ce),Ee!=null&&(this.progress.stack=Ee),this.progress.ratio=this.progress.val/this.progress.state,this},Ie.prototype.updateProgress=function(xe,Be,Ce,Ee){return this.setProgress(xe?this.progress.val+xe:null,Be||null,Ce?this.progress.n+Ce:null,Ee?this.progress.stack.concat(Ee):null)},Ie.prototype.then=function(xe,Be){var Ce=this;return this.thenCore(xe,Be,function(Ee,Se){return Ce.updateProgress(null,null,1,[Ee]),Promise.prototype.then.call(this,function(Pe){return Ce.updateProgress(null,Ee),Pe}).then(Ee,Se).then(function(Pe){return Ce.updateProgress(1),Pe})})},Ie.prototype.thenCore=function(xe,Be,Ce){Ce=Ce||Promise.prototype.then,xe&&(xe=xe.bind(this)),Be&&(Be=Be.bind(this));var Ee=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:Ie.convert(Object.assign({},this),Promise.prototype),Se=Ce.call(Ee,xe,Be);return Ie.convert(Se,this.__proto__)},Ie.prototype.thenExternal=function(xe,Be){return Promise.prototype.then.call(this,xe,Be)},Ie.prototype.thenList=function(xe){var Be=this;return xe.forEach(function(Ce){Be=Be.thenCore(Ce)}),Be},Ie.prototype.catch=function(xe){xe&&(xe=xe.bind(this));var Be=Promise.prototype.catch.call(this,xe);return Ie.convert(Be,this)},Ie.prototype.catchExternal=function(xe){return Promise.prototype.catch.call(this,xe)},Ie.prototype.error=function(xe){return this.then(function(){throw new Error(xe)})},Ie.prototype.using=Ie.prototype.set,Ie.prototype.saveAs=Ie.prototype.save,Ie.prototype.export=Ie.prototype.output,Ie.prototype.run=Ie.prototype.then,E$1.getPageSize=function(xe,Be,Ce){if(_typeof$2(xe)==="object"){var Ee=xe;xe=Ee.orientation,Be=Ee.unit||Be,Ce=Ee.format||Ce}Be=Be||"mm",Ce=Ce||"a4",xe=(""+(xe||"P")).toLowerCase();var Se,Pe=(""+Ce).toLowerCase(),Te={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(Be){case"pt":Se=1;break;case"mm":Se=72/25.4;break;case"cm":Se=72/2.54;break;case"in":Se=72;break;case"px":Se=.75;break;case"pc":case"em":Se=12;break;case"ex":Se=6;break;default:throw"Invalid unit: "+Be}var Me,Fe=0,De=0;if(Te.hasOwnProperty(Pe))Fe=Te[Pe][1]/Se,De=Te[Pe][0]/Se;else try{Fe=Ce[1],De=Ce[0]}catch{throw new Error("Invalid format: "+Ce)}if(xe==="p"||xe==="portrait")xe="p",De>Fe&&(Me=De,De=Fe,Fe=Me);else{if(xe!=="l"&&xe!=="landscape")throw"Invalid orientation: "+xe;xe="l",Fe>De&&(Me=De,De=Fe,Fe=Me)}return{width:De,height:Fe,unit:Be,k:Se,orientation:xe}},_e.html=function(xe,Be){(Be=Be||{}).callback=Be.callback||function(){},Be.html2canvas=Be.html2canvas||{},Be.html2canvas.canvas=Be.html2canvas.canvas||this.canvas,Be.jsPDF=Be.jsPDF||this,Be.fontFaces=Be.fontFaces?Be.fontFaces.map(jt):null;var Ce=new Ie(Be);return Be.worker?Ce:Ce.from(xe).doCallback()}}(E$1.API),E$1.API.addJS=function(_e){return Ht=_e,this.internal.events.subscribe("postPutResources",function(){Ut=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Ut+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),zt=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Ht+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Ut!==void 0&&zt!==void 0&&this.internal.out("/Names <</JavaScript "+Ut+" 0 R>>")}),this},function(_e){var $e;_e.events.push(["postPutResources",function(){var Ae=this,je=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var ke=Ae.outline.render().split(/\r\n/),Ie=0;Ie<ke.length;Ie++){var xe=ke[Ie],Be=je.exec(xe);if(Be!=null){var Ce=Be[1];Ae.internal.newObjectDeferredBegin(Ce,!1)}Ae.internal.write(xe)}if(this.outline.createNamedDestinations){var Ee=this.internal.pages.length,Se=[];for(Ie=0;Ie<Ee;Ie++){var Pe=Ae.internal.newObject();Se.push(Pe);var Te=Ae.internal.getPageInfo(Ie+1);Ae.internal.write("<< /D["+Te.objId+" 0 R /XYZ null null null]>> endobj")}var Me=Ae.internal.newObject();for(Ae.internal.write("<< /Names [ "),Ie=0;Ie<Se.length;Ie++)Ae.internal.write("(page_"+(Ie+1)+")"+Se[Ie]+" 0 R");Ae.internal.write(" ] >>","endobj"),$e=Ae.internal.newObject(),Ae.internal.write("<< /Dests "+Me+" 0 R"),Ae.internal.write(">>","endobj")}}]),_e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+$e+" 0 R"))}]),_e.events.push(["initialized",function(){var Ae=this;Ae.outline={createNamedDestinations:!1,root:{children:[]}},Ae.outline.add=function(je,ke,Ie){var xe={title:ke,options:Ie,children:[]};return je==null&&(je=this.root),je.children.push(xe),xe},Ae.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=Ae,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},Ae.outline.genIds_r=function(je){je.id=Ae.internal.newObjectDeferred();for(var ke=0;ke<je.children.length;ke++)this.genIds_r(je.children[ke])},Ae.outline.renderRoot=function(je){this.objStart(je),this.line("/Type /Outlines"),je.children.length>0&&(this.line("/First "+this.makeRef(je.children[0])),this.line("/Last "+this.makeRef(je.children[je.children.length-1]))),this.line("/Count "+this.count_r({count:0},je)),this.objEnd()},Ae.outline.renderItems=function(je){for(var ke=this.ctx.pdf.internal.getVerticalCoordinateString,Ie=0;Ie<je.children.length;Ie++){var xe=je.children[Ie];this.objStart(xe),this.line("/Title "+this.makeString(xe.title)),this.line("/Parent "+this.makeRef(je)),Ie>0&&this.line("/Prev "+this.makeRef(je.children[Ie-1])),Ie<je.children.length-1&&this.line("/Next "+this.makeRef(je.children[Ie+1])),xe.children.length>0&&(this.line("/First "+this.makeRef(xe.children[0])),this.line("/Last "+this.makeRef(xe.children[xe.children.length-1])));var Be=this.count=this.count_r({count:0},xe);if(Be>0&&this.line("/Count "+Be),xe.options&&xe.options.pageNumber){var Ce=Ae.internal.getPageInfo(xe.options.pageNumber);this.line("/Dest ["+Ce.objId+" 0 R /XYZ 0 "+ke(0)+" 0]")}this.objEnd()}for(var Ee=0;Ee<je.children.length;Ee++)this.renderItems(je.children[Ee])},Ae.outline.line=function(je){this.ctx.val+=je+`\r
128
128
  `},Ae.outline.makeRef=function(je){return je.id+" 0 R"},Ae.outline.makeString=function(je){return"("+Ae.internal.pdfEscape(je)+")"},Ae.outline.objStart=function(je){this.ctx.val+=`\r
129
129
  `+je.id+` 0 obj\r
130
130
  <<\r
@@ -2038,4 +2038,4 @@ ${i18n.__("转大小写")}
2038
2038
  <div class="hiprint-option-item-label hiprint-option-title">
2039
2039
  `+$e.title+`
2040
2040
  </div>
2041
- </div>`),Ie.forEach(function(Ce){Ce.submit=function(Ee){$e.callback(je.getValueByOptionItems(Ie))},Be.append(Ce.createTarget(je.printTemplate,$e.options,void 0)),Ce.setValue($e.options[Ce.name],$e.options,void 0)}),Be.find(".auto-submit").change(function(Ce){$e.callback(je.getValueByOptionItems(Ie))}),Be.find(".auto-submit:input").bind("keydown.submitOption",function(Ce){Ce.keyCode==13&&$e.callback(je.getValueByOptionItems(Ie))}),ke.append(Be)},_e.prototype.getValueByOptionItems=function($e){var Ae={};return $e.forEach(function(je){Ae[je.name]=je.getValue()}),Ae},_e}(),dt=function(){function _e($e,Ae){this.paginationContainer=$e,this.jqPaginationContainer=$$g(this.paginationContainer),this.template=Ae}return _e.prototype.buildPagination=function($e){var Ae=this.template.getPaneltotal(),je=this;this.jqPaginationContainer.html("");for(var ke=$$g('<ul class="hiprint-pagination"></ul>'),Ie=function(){var Ee=xe,Se=je.template.printPanels[Ee].name||Ee+1,Pe=$$g("<li><span>"+Se+'</span><a href="javascript:void(0);">x</a></li>');Pe.find("span").click(function(){je.template.selectPanel(Ee),Pe.siblings().removeClass("selected"),$$g(this).parent("li").addClass("selected")}),Pe.find("a").click(function(){je.template.deletePanel(Ee),je.buildPagination()}),ke.append(Pe)},xe=0;xe<Ae;xe++)Ie();var Be=$$g("<li><span>+</span></li>");ke.append(Be),this.jqPaginationContainer.append(ke),Be.click(function(){var Ce=function(Se){je.template.addPrintPanel(Se||void 0,!0),je.buildPagination(),$$g(".hiprint-pagination li").removeClass("selected"),$$g(".hiprint-pagination li:nth-last-child(2)").addClass("selected")};if(je.template.onPanelAddClick){var Ee={index:je.template.printPanels.length,paperType:"A4"};je.template.onPanelAddClick(Ee,Ce)}else Ce()})},_e.prototype.selectPanel=function($e){var Ae=$e||this.template.editingPanel.index,je=$$g(".hiprint-pagination li:nth("+Ae+")");je.length&&(je.siblings().removeClass("selected"),je.addClass("selected")),hinnn.event.trigger("onSelectPanel",this.template.editingPanel,Ae,je)},_e}(),ct=function(){function _e($e){var Ae=this;this.tempimageBase64={},this.id=s.a.instance.guid(),s.a.instance.setPrintTemplateById(this.id,this);var je=$e||{};this.printPanels=[],this.dataMode=je.dataMode||1,this.history=je.history!=null?je.history:!0,this.onDataChanged=je.onDataChanged,this.onUpdateError=je.onUpdateError,this.lastJson=je.template||{},this.historyList=[{id:s.a.instance.guid(),type:"初始",json:this.lastJson}],this.historyPos=0,this.defaultPanelName=je.defaultPanelName,this.designOptions={};var ke=new st(je.template||[]);je.template&&ke.panels.forEach(function(Ie){Ae.printPanels.push(new pt(Ie,Ae.id))}),je.fontList&&(this.fontList=je.fontList),je.fields&&(this.fields=je.fields),je.onImageChooseClick&&(this.onImageChooseClick=je.onImageChooseClick),je.onPanelAddClick&&(this.onPanelAddClick=je.onPanelAddClick),je.settingContainer&&new ut(this,je.settingContainer),je.paginationContainer&&(this.printPaginationCreator=new dt(je.paginationContainer,this),this.printPaginationCreator.buildPagination()),this.initAutoSave()}return _e.prototype.design=function($e,Ae){var je=this;if(Ae||(Ae={}),this.printPanels.length==0){var ke=this.createDefaultPanel();this.printPanels.push(ke)}if(!$e)throw new Error("options.container can not be empty");je.designOptions=Ae,this.createContainer($e),this.printPanels.forEach(function(Ie,xe){je.container.append(Ie.getTarget()),xe>0&&Ie.disable(),Ie.design(Ae)}),this.selectPanel(0)},_e.prototype.getSimpleHtml=function($e,Ae){var je=this;Ae||(Ae={});var ke=$$g('<div class="hiprint-printTemplate"></div>');return $e&&$e.constructor===Array?$e.forEach(function(Ie,xe){Ie&&je.printPanels.forEach(function(Be,Ce){ke.append(Be.getHtml(Ie,Ae)),xe==$e.length-1&&delete hinnn._paperList})}):this.printPanels.forEach(function(Ie,xe){ke.append(Ie.getHtml($e,Ae)),xe==je.printPanels.length-1&&delete hinnn._paperList}),Ae&&Ae.imgToBase64&&this.transformImg(ke.find("img")),ke},_e.prototype.getHtml=function($e,Ae){return $e||($e={}),this.getSimpleHtml($e,Ae)},_e.prototype.getJointHtml=function($e,Ae,je){var ke=$$g('<div class="hiprint-printTemplate"></div>'),Ie=[];return this.printPanels.forEach(function(xe,Be){ke.append(xe.getHtml($e,Ae,Ie,void 0,je))}),ke},_e.prototype.setPaper=function($e,Ae){if(/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test($e))this.editingPanel.resize(void 0,parseFloat($e),parseFloat(Ae),!1);else{var je=s.a.instance[$e];if(!je)throw new Error("not found pagetype:"+($e||""));this.editingPanel.resize($e,je.width,je.height,!1)}},_e.prototype.rotatePaper=function(){this.editingPanel.rotatePaper()},_e.prototype.zoom=function($e,Ae){this.editingPanel.zoom($e,Ae)},_e.prototype.addPrintPanel=function($e,Ae){var je=$e?new pt(new rt($e),this.id):this.createDefaultPanel();return $e&&($e.index=this.printPanels.length),Ae&&(this.container.append(je.getTarget()),je.design(this.designOptions)),this.printPanels.push(je),Ae&&this.selectPanel(je.index),je},_e.prototype.selectPanel=function($e){var Ae=this;$e>Ae.printPanels.length-1&&($e=Ae.printPanels.length-1),this.printPanels.forEach(function(je,ke){$e==ke?(je.enable(),Ae.editingPanel=je,Ae.printPaginationCreator&&Ae.printPaginationCreator.selectPanel($e)):je.disable()})},_e.prototype.deletePanel=function($e){this.printPanels[$e].clear(),this.printPanels[$e].getTarget().remove(),this.printPanels.splice($e,1)},_e.prototype.getPaneltotal=function(){return this.printPanels.length},_e.prototype.createDefaultPanel=function(){return new pt(new rt({index:this.printPanels.length,name:this.defaultPanelName,paperType:"A4"}),this.id)},_e.prototype.createContainer=function($e){$e?(this.container=$$g($e),this.container.addClass("hiprint-printTemplate")):this.container=$$g('<div class="hiprint-printTemplate"></div>')},_e.prototype.getJsonTid=function(){var $e=[];return this.printPanels.forEach(function(Ae){Ae.getPanelEntity().printElements.length&&$e.push(Ae.getPanelEntity())}),new st({panels:$e})},_e.prototype.getJson=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e.push(Ae.getPanelEntity(!0))}),new st({panels:$e})},_e.prototype.undo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"undo")},_e.prototype.redo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"redo")},_e.prototype.getPrintElementSelectEventKey=function(){return"PrintElementSelectEventKey_"+this.id},_e.prototype.getBuildCustomOptionSettingEventKey=function(){return"BuildCustomOptionSettingEventKey_"+this.id},_e.prototype.clear=function(){this.printPanels.forEach(function($e){if($e.clear(),$e.index>0){var Ae=$e.getTarget();Ae&&Ae.length&&Ae.remove()}}),this.printPanels=[this.printPanels[0]],this.printPaginationCreator&&this.printPaginationCreator.buildPagination()},_e.prototype.getPaperType=function($e){return this.printPanels[0].paperType},_e.prototype.getOrient=function($e){return $e==null&&($e=0),this.printPanels[$e].height>this.printPanels[$e].width?1:2},_e.prototype.getPrintStyle=function($e){return this.printPanels[$e].getPrintStyle()},_e.prototype.print=function($e,Ae,je){$e||($e={});try{if(typeof this.getHtmlStable=="function"){var ke=this;return this.getHtmlStable($e).then(function(Ie){var xe=$$g("<div></div>");xe.html(Ie),xe.hiwprint(je)}).catch(function(){ke.getHtml($e,Ae).hiwprint(je)})}}catch{}this.getHtml($e,Ae).hiwprint(je)},_e.prototype.print2=function($e,Ae){if($e||($e={}),Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]'),Be="";if(Ae.styleHandler&&(Be+=Ae.styleHandler()),xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Ce,Ee){var Se=new XMLHttpRequest;Se.open("GET",$$g(Ee).attr("href")),Se.onreadystatechange=function(){if(Se.readyState===4&&Se.status===200&&(Ie[Ce+""]='<style rel="stylesheet" type="text/css">'+Se.responseText+"</style>",++ke==xe.length)){for(var Pe="",Te=0;Te<xe.length;Te++)Pe+=Ie[Te+""];Be&&(Pe=Be+Pe),je.sentToClient(Pe,$e,Ae)}},Se.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.imageToBase64=function($e){var Ae=$$g($e).attr("src");if(Ae.indexOf("base64")==-1)try{if(!this.tempimageBase64[Ae]){var je=document.createElement("canvas"),ke=new Image;ke.src=$e.attr("src"),je.width=ke.width,je.height=ke.height,je.getContext("2d").drawImage(ke,0,0),Ae&&(this.tempimageBase64[Ae]=je.toDataURL("image/png"))}$e.attr("src",this.tempimageBase64[Ae])}catch{try{this.xhrLoadImage($e)}catch(xe){console.log(xe)}}},_e.prototype.xhrLoadImage=function($e){},_e.prototype.sentToClient=function($e,Ae,je){Ae||(Ae={});var ke=$$g.extend({},je||{});ke.imgToBase64=!0;var Ie=$e+this.getHtml(Ae,ke)[0].outerHTML;ke.id=s.a.instance.guid(),ke.html=Ie,ke.templateId=this.id,hiwebSocket.send(ke)},_e.prototype.printByHtml=function($e){$$g($e).hiwprint()},_e.prototype.printByHtml2=function($e,Ae){if(Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]');if(xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Be,Ce){var Ee=new XMLHttpRequest;Ee.open("GET",$$g(Ce).attr("href")),Ee.onreadystatechange=function(){if(Ee.readyState===4&&Ee.status===200&&(Ie[Be+""]='<style rel="stylesheet" type="text/css">'+Ee.responseText+"</style>",++ke==xe.length)){for(var Se="",Pe=0;Pe<xe.length;Pe++)Se+=Ie[Pe+""];var Te=Se+$$g($e)[0].outerHTML,Me=$$g.extend({},Ae||{});Me.id=s.a.instance.guid(),Me.html=Te,Me.templateId=je.id,hiwebSocket.send(Me)}},Ee.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.deletePrintElement=function($e){this.printPanels.forEach(function(Ae){Ae.deletePrintElement($e)})},_e.prototype.transformImg=function($e){var Ae=this;$e.map(function(je,ke){Ae.imageToBase64($$g(ke))})},_e.prototype.toPdf=function($e,Ae,je){var ke=this,Ie=$$g.Deferred(),xe=!0;if(this.printPanels.length){var Be=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Ce=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Ee=o.a.mm.toPt(Be),Se=o.a.mm.toPt(Ce),Pe=Ee,Te=Se,Me=this.getOrient(0)==1?"portrait":"landscape";if(je&&(je.paperWidth||je.paperHeight)){var Fe=je.paperWidth,De=je.paperHeight;Fe&&De&&(Pe=o.a.mm.toPt(Fe),Te=o.a.mm.toPt(De))}else if(je&&je.usePaperType===!0&&this.printPanels[0].paperType){var Oe=this.printPanels[0].paperType.toString().toLowerCase(),Qe=null,We=null;Oe==="a4"?(Qe=210,We=297):Oe==="a5"?(Qe=148,We=210):Oe==="a3"&&(Qe=297,We=420),Qe&&We&&(Pe=o.a.mm.toPt(Qe),Te=o.a.mm.toPt(We))}if(Me==="landscape"){var Ye=Pe;Pe=Te,Te=Ye}var Xe=$$g.extend({scale:2,width:o.a.pt.toPx(Pe),height:o.a.pt.toPx(Te),x:0,y:0,useCORS:!0},je||{});je&&typeof je.pixelRatio<"u"?Xe.scale=je.pixelRatio:je&&typeof je.scale<"u"&&(Xe.scale=je.scale),Xe.width=o.a.pt.toPx(Pe),Xe.height=o.a.pt.toPx(Te);var rr=new E$1({orientation:Me,unit:"pt",format:[Pe,Te]}),Ze=this.getHtml($e,je);je&&je.isDownload!=null&&(xe=je.isDownload),(!Ae||Ae===void 0)&&je&&je.name&&(Ae=je.name);var Ke=je&&typeof je.onProgress=="function"?je.onProgress:null;this.createTempContainer();var St=this.getTempContainer();this.svg2canvas(Ze),St.html(Ze[0]);var tr=[],qe=je&&typeof je.removeTransform<"u"?!!je.removeTransform:!0;if(qe)try{var Ge=St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");Ge.each(function(Mi,sr){tr[Mi]=sr.style.transform,sr.style.transform="",sr.style.zoom&&(sr.style.zoom=1)})}catch{}if(!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0))try{var Je=St.find(".hiprint-printPaper").eq(0)[0],ir=St.find(".hiprint-printPanel").eq(0)[0],ar=Je||ir;if(ar){var lr=ar.getBoundingClientRect();lr&&lr.width&&lr.height&&(Pe=o.a.px.toPt(Math.round(lr.width)),Te=o.a.px.toPt(Math.round(lr.height)),Xe.width=o.a.pt.toPx(Pe),Xe.height=o.a.pt.toPx(Te),rr=new E$1({orientation:Me,unit:"pt",format:[Pe,Te]}))}}catch{}var dr=St.find(".hiprint-printTemplate"),gr=dr.find(".hiprint-printPanel"),hr=$e&&$e.constructor===Array?$e.length:null,kr=hr!=null?Math.min(hr,gr.length):gr.length,Ar=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{};Ar.layoutType||je&&je.layoutType;var Rr=Number(Ar.layoutRowGap||je&&je.rowGapMm||0),or=Number(Ar.layoutColumnGap||je&&je.colGapMm||0),pr=o.a.pt.toMm(Pe),jr=o.a.pt.toMm(Te),Br=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||pr,Mr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||jr,Fr=Math.max(1,Math.floor((pr+or)/(Br+or))),Lr=Math.max(1,Math.floor((jr+Rr)/(Mr+Rr))),Dr=Math.max(1,Fr*Lr),zr=!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0);zr&&(Dr=1);var ti=Math.max(1,je&&je.perPage||Dr);if(ti=Math.min(ti,kr),ti>1&&kr>1){var pi=or;if(Fr>1){var ci=(pr-Fr*Br)/(Fr-1);ci>=0&&(pi=ci)}else pi=0;var wi=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");St.prepend($$g(wi));var dr=St.find(".hiprint-printTemplate");dr.css({width:pr+"mm",height:jr+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var Wr=Math.max(0,pi/2),Cr=Math.max(0,Rr/2),Ci=['<style type="text/css">',".hiprint-printTemplate{margin:-"+Cr+"mm -"+Wr+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+Cr+"mm "+Wr+"mm;}","</style>"].join("");St.prepend($$g(Ci)),$$g(Ze).css("position:fixed");var mi=je&&typeof je.leftOffset<"u"?Number(je.leftOffset):null,oi=je&&typeof je.topOffset<"u"?Number(je.topOffset):null;if(mi!==null||oi!==null){var ui=Fr*Br+(Fr-1)*pi,_i=Lr*Mr+(Lr-1)*Rr,Ai=0,ki=0;mi===-1?Ai=Math.max(0,(pr-ui)/2):mi>=0&&(Ai=mi),oi===-1?ki=Math.max(0,(jr-_i)/2):oi>=0&&(ki=oi),dr.css({paddingLeft:Ai+"mm",paddingTop:ki+"mm"})}for(var yi=Math.ceil(kr/ti),Hi=Promise.resolve(),Pi=0;Pi<yi;Pi++){var Ri=Pi*ti,Vi=Math.min(Ri+ti,kr);(function(sr,wr,br){Hi=Hi.then(function(){return console.log("处理页面",br+1,"数据范围:",sr,"到",wr-1),gr.hide(),gr.slice(sr,wr).show(),html2canvas(dr[0],Xe).then(function(Nr){var Pr=Nr.getContext("2d");Pr.mozImageSmoothingEnabled=!1,Pr.webkitImageSmoothingEnabled=!1,Pr.msImageSmoothingEnabled=!1,Pr.imageSmoothingEnabled=!1;var Yr=Nr.toDataURL("image/jpeg");rr.addImage(Yr,"JPEG",0,0,Pe,Te),br<yi-1&&rr.addPage(),Ke&&Ke(br+1,yi)})})})(Ri,Vi,Pi)}Hi.then(function(){gr.show();try{Ge.each(function(wr,br){br.style.transform=tr[wr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let wr=je.type||"blob";var sr=rr.output(wr);Ie.resolve(sr)}})}else{var xi=St.find(".hiprint-printPaper"),Ti=xi.length;Ti===0&&(xi=St.find(".hiprint-printTemplate"),Ti=xi.length||1);try{var vi=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!je||je.ignoreOffsets!==!1)&&vi.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var aa='<style type="text/css">'+vi.join("")+"</style>";St.prepend($$g(aa)),xi.each(function(Mi,sr){var wr=sr.getAttribute("original-height");wr&&(sr.style.height=wr+"mm")})}catch{}for(var Ki=Promise.resolve(),na=0;na<Ti;na++)(function(Mi){Ki=Ki.then(function(){var sr=xi.eq(Mi),wr=sr[0],br=$$g.extend({},Xe);return br.width=o.a.pt.toPx(Pe),br.height=o.a.pt.toPx(Te),html2canvas(wr,br).then(function(Nr){var Pr=Nr.getContext("2d");Pr.mozImageSmoothingEnabled=!1,Pr.webkitImageSmoothingEnabled=!1,Pr.msImageSmoothingEnabled=!1,Pr.imageSmoothingEnabled=!1;var Yr=Nr.toDataURL("image/jpeg");rr.addImage(Yr,"JPEG",0,0,Pe,Te),Mi<Ti-1&&rr.addPage(),Ke&&Ke(Mi+1,Ti)})})})(na);Ki.then(function(){if(qe)try{St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(sr,wr){wr.style.transform=tr[sr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let sr=je.type||"blob";var Mi=rr.output(sr);Ie.resolve(Mi)}})}}return Ie.promise()},_e.prototype.createTempContainer=function(){this.removeTempContainer(),$$g("body").prepend($$g('<div class="hiprint_temp_Container" style="overflow:hidden;height: 0px;box-sizing: border-box;"></div>'))},_e.prototype.removeTempContainer=function(){$$g(".hiprint_temp_Container").remove()},_e.prototype.getTempContainer=function(){return $$g(".hiprint_temp_Container")},_e.prototype.svg2canvas=function($e){var Ae=this;$e.find("svg").each(function(je,ke){var Ie=ke.parentNode,xe=Ae.parentWidthHeight(Ie),Be=document.createElement("canvas");Be.width=xe.width,Be.height=xe.height;var Ce=Be.getContext("2d"),Ee=new XMLSerializer().serializeToString(ke);Canvg.fromString(Ce,Ee).render(),$$g(ke).before(Be),Ie.removeChild(ke)})},_e.prototype.toImage=function($e,Ae){var je=this,ke=$$g.Deferred(),Ie=!1,xe=Ae&&Ae.name||"image",Be=Ae&&Ae.type||"image/jpeg",Ce=Ae&&typeof Ae.quality<"u"?Ae.quality:.92,Ee=Ae&&Ae.toType||"url",Se=Ae&&typeof Ae.limit<"u"?Number(Ae.limit):10,Pe=Se<=0?Number.MAX_SAFE_INTEGER:Se;if(Ae&&Ae.isDownload!=null&&(Ie=Ae.isDownload),this.printPanels.length){let Yr=function(){je.removeTempContainer();var Sr=[],Jr=[],xr="jpg";if(Be.indexOf("png")>-1?xr="png":Be.indexOf("webp")>-1?xr="webp":Be.indexOf("bmp")>-1&&(xr="bmp"),Dr){for(var Qr=Promise.resolve(),Zr=0;Zr<kr.length;Zr++)(function(Or){Qr=Qr.then(function(){var ni=kr[Or],Kr=xe;return Kr=Kr+"-"+(Or+1)+"."+xr,Jr.push(Kr),new Promise(function(ii){if(Ee==="blob")ni.toBlob(function(ji){Sr.push(ji),ii()},Be,Ce);else{var bi=ni.toDataURL(Be,Ce);Sr.push(bi),ii()}})})})(Zr);Qr.then(function(){if(Ie)for(var Or=0;Or<Sr.length;Or++){var ni=Sr[Or],Kr=ni;Ee==="blob"&&(Kr=URL.createObjectURL(ni));var ii=document.createElement("a");if(ii.href=Kr,ii.download=Jr[Or],document.body.appendChild(ii),ii.click(),document.body.removeChild(ii),Ee==="blob")try{URL.revokeObjectURL(Kr)}catch{}}ke.resolve(Sr)});return}for(var ai=[],Hr=0;Hr<kr.length;Hr+=Pe)ai.push(kr.slice(Hr,Math.min(Hr+Pe,kr.length)));for(var ri=Promise.resolve(),Vr=0;Vr<ai.length;Vr++)(function(Or){ri=ri.then(function(){for(var ni=ai[Or],Kr=document.createElement("canvas"),ii=0,bi=0,ji=0;ji<ni.length;ji++)ii=Math.max(ii,ni[ji].width),bi+=ni[ji].height;Kr.width=Math.max(1,ii),Kr.height=Math.max(1,bi);var Ui=Kr.getContext("2d");Ui.fillStyle="#ffffff",Ui.fillRect(0,0,Kr.width,Kr.height),Ui.mozImageSmoothingEnabled=!1,Ui.webkitImageSmoothingEnabled=!1,Ui.msImageSmoothingEnabled=!1,Ui.imageSmoothingEnabled=!1;for(var Wi=0,Qi=0;Qi<ni.length;Qi++){var li=ni[Qi];Ui.drawImage(li,0,Wi,li.width,li.height),Wi+=li.height}var Si=xe;return Si=Si+"-"+(Or+1)+"."+xr,Jr.push(Si),new Promise(function(Ei){if(Ee==="blob")Kr.toBlob(function(Xi){Sr.push(Xi),Ei()},Be,Ce);else{var Fi=Kr.toDataURL(Be,Ce);Sr.push(Fi),Ei()}})})})(Vr);ri.then(function(){if(Ie)for(var Or=0;Or<Sr.length;Or++){var ni=Sr[Or],Kr=ni;Ee==="blob"&&(Kr=URL.createObjectURL(ni));var ii=document.createElement("a");if(ii.href=Kr,ii.download=Jr[Or],document.body.appendChild(ii),ii.click(),document.body.removeChild(ii),Ee==="blob")try{URL.revokeObjectURL(Kr)}catch{}}ke.resolve(Sr)})};var Te=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Me=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Fe=o.a.mm.toPt(Te),De=o.a.mm.toPt(Me),Oe=Fe,Qe=De,We=this.getOrient(0)==1?"portrait":"landscape";if(Ae&&(Ae.paperWidth||Ae.paperHeight)){var Ye=Ae.paperWidth,Xe=Ae.paperHeight;Ye&&Xe&&(Oe=o.a.mm.toPt(Ye),Qe=o.a.mm.toPt(Xe))}else if(Ae&&Ae.usePaperType===!0&&this.printPanels[0].paperType){var rr=this.printPanels[0].paperType.toString().toLowerCase(),Ze=null,Ke=null;rr==="a4"?(Ze=210,Ke=297):rr==="a5"?(Ze=148,Ke=210):rr==="a3"&&(Ze=297,Ke=420),Ze&&Ke&&(Oe=o.a.mm.toPt(Ze),Qe=o.a.mm.toPt(Ke))}if(We==="landscape"){var St=Oe;Oe=Qe,Qe=St}var tr=$$g.extend({scale:2,width:o.a.pt.toPx(Oe),height:o.a.pt.toPx(Qe),x:0,y:0,useCORS:!0},Ae||{});Ae&&typeof Ae.pixelRatio<"u"?tr.scale=Ae.pixelRatio:Ae&&typeof Ae.scale<"u"&&(tr.scale=Ae.scale),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe);var qe=this.getHtml($e,Ae);this.createTempContainer();var Ge=this.getTempContainer();this.svg2canvas(qe),Ge.html(qe[0]);var Je=[],ir=Ae&&typeof Ae.removeTransform<"u"?!!Ae.removeTransform:!0;if(ir)try{var ar=Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");ar.each(function(Sr,Jr){Je[Sr]=Jr.style.transform,Jr.style.transform="",Jr.style.zoom&&(Jr.style.zoom=1)})}catch{}if(!(Ae&&(Ae.paperWidth||Ae.paperHeight))&&!(Ae&&Ae.usePaperType===!0))try{var lr=Ge.find(".hiprint-printPanel").eq(0)[0],dr=lr||Ge.find(".hiprint-printPaper").eq(0)[0];if(dr){var gr=dr.getBoundingClientRect();gr&&gr.width&&gr.height&&(Oe=o.a.px.toPt(Math.round(gr.width)),Qe=o.a.px.toPt(Math.round(gr.height)),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe))}}catch{}var hr=Ae&&typeof Ae.onProgress=="function"?Ae.onProgress:null,kr=[],Ar=o.a.pt.toPx(Oe),Rr=o.a.pt.toPx(Qe),or=Ge.find(".hiprint-printTemplate"),pr=or.find(".hiprint-printPanel"),jr=$e&&$e.constructor===Array?$e.length:null,Br=jr!=null?Math.min(jr,pr.length):pr.length,Mr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{},Fr=Number(Mr.layoutRowGap||Ae&&Ae.rowGapMm||0),Lr=Number(Mr.layoutColumnGap||Ae&&Ae.colGapMm||0),Dr=!!(Ae&&(Ae.paperWidth&&Ae.paperHeight||Ae.usePaperType===!0));if(Dr){var zr=o.a.pt.toMm(Oe),ti=o.a.pt.toMm(Qe),pi=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||zr,ci=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||ti,wi=Math.max(1,Math.floor((zr+Lr)/(pi+Lr))),Wr=Math.max(1,Math.floor((ti+Fr)/(ci+Fr))),Cr=Math.max(1,wi*Wr),Ci=Se>0?Math.max(1,Math.min(Se,Br)):Math.max(1,Cr),mi=Lr;if(wi>1){var oi=(zr-wi*pi)/(wi-1);oi>=0&&(mi=oi)}else mi=0;var ui=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");Ge.prepend($$g(ui)),or.css({width:zr+"mm",height:ti+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var _i=Math.max(0,mi/2),Ai=Math.max(0,Fr/2),ki=['<style type="text/css">',".hiprint-printTemplate{margin:-"+Ai+"mm -"+_i+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+Ai+"mm "+_i+"mm;}","</style>"].join("");Ge.prepend($$g(ki)),$$g(qe).css("position:fixed");var yi=Ae&&typeof Ae.leftOffset<"u"?Number(Ae.leftOffset):null,Hi=Ae&&typeof Ae.topOffset<"u"?Number(Ae.topOffset):null;if(yi!==null||Hi!==null){var Pi=wi*pi+(wi-1)*mi,Ri=Wr*ci+(Wr-1)*Fr,Vi=0,xi=0;yi===-1?Vi=Math.max(0,(zr-Pi)/2):yi>=0&&(Vi=yi),Hi===-1?xi=Math.max(0,(ti-Ri)/2):Hi>=0&&(xi=Hi),or.css({paddingLeft:Vi+"mm",paddingTop:xi+"mm"})}for(var Ti=Math.ceil(Br/Ci),vi=Promise.resolve(),aa=0;aa<Ti;aa++){var Ki=aa*Ci,na=Math.min(Ki+Ci,Br);(function(Sr,Jr,xr){vi=vi.then(function(){return pr.hide(),pr.slice(Sr,Jr).show(),html2canvas(or[0],tr).then(function(Qr){var Zr=Qr.getContext("2d");Zr.mozImageSmoothingEnabled=!1,Zr.webkitImageSmoothingEnabled=!1,Zr.msImageSmoothingEnabled=!1,Zr.imageSmoothingEnabled=!1,kr.push(Qr),hr&&hr(xr+1,Ti)})})})(Ki,na,aa)}vi.then(function(){if(pr.show(),ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Jr){Jr.style.transform=Je[Sr]||""})}catch{}Yr()})}else{var Mi=Ge.find(".hiprint-printPaper"),sr=Mi.length;sr===0&&(Mi=Ge.find(".hiprint-printTemplate"),sr=Mi.length||1);try{var wr=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!Ae||Ae.ignoreOffsets!==!1)&&wr.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var br='<style type="text/css">'+wr.join("")+"</style>";Ge.prepend($$g(br)),Mi.each(function(Sr,Jr){var xr=Jr.getAttribute("original-height");xr&&(Jr.style.height=xr+"mm")})}catch{}for(var Nr=Promise.resolve(),Pr=0;Pr<sr;Pr++)(function(Sr){Nr=Nr.then(function(){var Jr=Mi.eq(Sr),xr=Jr[0],Qr=$$g.extend({},tr);try{var Zr=xr.getBoundingClientRect(),ai=Math.max(1,Math.round(Zr.width)),Hr=Math.max(1,Math.round(Zr.height));Qr.width=ai,Qr.height=Hr}catch{Qr.width=Ar,Qr.height=Rr}return html2canvas(xr,Qr).then(function(ri){var Vr=ri.getContext("2d");Vr.mozImageSmoothingEnabled=!1,Vr.webkitImageSmoothingEnabled=!1,Vr.msImageSmoothingEnabled=!1,Vr.imageSmoothingEnabled=!1,kr.push(ri),hr&&hr(Sr+1,sr)})})})(Pr);Nr.then(function(){if(ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Jr){Jr.style.transform=Je[Sr]||""})}catch{}Yr()})}}return ke.promise()},_e.prototype.parentWidthHeight=function($e){return $e.style.width.endsWith("%")||$e.style.height.endsWith("%")?$e.className!="hiprint-printPaper-content"?this.parentWidthHeight($e.parentNode):{width:10,height:10}:{width:o.a.pt.toPx(parseFloat($e.style.width)),height:o.a.pt.toPx(parseFloat($e.style.height))}},_e.prototype.on=function($e,Ae){o.a.event.clear($e+"_"+this.id),o.a.event.on($e+"_"+this.id,Ae)},_e.prototype.clientIsOpened=function(){return hiwebSocket.opened},_e.prototype.getPrinterList=function(){var $e=hiwebSocket.getPrinterList();return $e||[]},_e.prototype.getElementByTid=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByTid($e)},_e.prototype.getElementByName=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByName($e)},_e.prototype.getPanel=function($e){return $e==null&&($e=0),this.printPanels[$e]},_e.prototype.loadAllImages=function($e,Ae,je){var ke=this;je==null&&(je=0);for(var Ie=$e[0].getElementsByTagName("img"),xe=!0,Be=0;Be<Ie.length;Be++){var Ce=Ie[Be];Ce.src&&Ce.src!==window.location.href&&Ce.src.indexOf("base64")==-1&&(Ce&&Ce.naturalWidth!==void 0&&Ce.naturalWidth!==0&&Ce.complete||(xe=!1))}je++,!xe&&je<10?setTimeout(function(){ke.loadAllImages($e,Ae,je)},500):Ae()},_e.prototype.setFontList=function($e){this.fontList=$e},_e.prototype.getFontList=function(){return this.fontList},_e.prototype.setFields=function($e){this.fields=$e},_e.prototype.getFields=function(){return this.fields},_e.prototype.setOnImageChooseClick=function($e){this.onImageChooseClick=$e},_e.prototype.getOnImageChooseClick=function(){return this.onImageChooseClick},_e.prototype.getHtmlStable=function($e){var Ae=this;return new Promise(function(je){var ke=$$g('<div style="position:fixed;left:-10000px;top:-10000px;visibility:hidden;z-index:-1;"></div>');$$g("body").append(ke);var Ie=Ae.getHtml($e);ke.html(Ie);var xe=function(Ee,Se){var Pe=0,Te=function(){for(var Me=Ee[0].getElementsByTagName("img"),Fe=!0,De=0;De<Me.length;De++){var Oe=Me[De];if(!Oe.complete||typeof Oe.naturalWidth<"u"&&Oe.naturalWidth===0){Fe=!1;break}}Pe++,!Fe&&Pe<20?setTimeout(Te,250):Se()};Te()},Be=function(Ee){try{document.fonts&&document.fonts.ready&&typeof document.fonts.ready.then=="function"?document.fonts.ready.then(function(){Ee()}).catch(function(){Ee()}):Ee()}catch{Ee()}},Ce=function(Ee,Se){var Pe=Date.now(),Te;try{Te=new ResizeObserver(function(){Pe=Date.now()}),Te.observe(Ee[0])}catch{Se();return}var Me=function(){if(Date.now()-Pe>=120){try{Te.disconnect()}catch{}Se()}else setTimeout(Me,60)};setTimeout(Me,120)};xe(ke,function(){Be(function(){Ce(ke,function(){var Ee=Ae.getHtml($e);ke.remove(),je(Ee)})})})})},_e.prototype.getFieldsInPanel=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e=$e.concat(Ae.getFieldsInPanel())}),$e},_e.prototype.getTestData=function(){var $e={};return this.printPanels.forEach(function(Ae){$e=Object.assign($e,Ae.getTestData())}),$e},_e.prototype.update=function($e,Ae){var je=this;try{if($e&&_typeof($e)=="object"&&$e.panels.length>0){var ke=je.printPanels.length-1;$e.panels.forEach(function(Ie,xe){if(xe>ke){je.printPanels.push(new pt(Ie,je.id));var Be=je.printPanels[xe];je.container.append(Be.getTarget()),xe>0&&Be.disable(),Be.design(je.designOptions),je.printPaginationCreator&&je.printPaginationCreator.buildPagination()}var Ce=new rt(Ie);je.editingPanel=je.printPanels[xe],je.editingPanel.update(Ce)}),je.selectPanel(Ae||0)}}catch(Ie){console.log(Ie),je.onUpdateError&&je.onUpdateError(Ie)}},_e.prototype.getSelectEls=function(){var $e=this,Ae=[];return $e.editingPanel.mouseRect&&$e.editingPanel.mouseRect.target&&$$g(".mouseRect").length?Ae=$e.editingPanel.getElementInRect($e.editingPanel.mouseRect):Ae=$e.editingPanel.printElements.filter(function(je){var ke=je&&je.designTarget&&je.designTarget.children&&je.designTarget.children().last(),Ie=ke&&ke.hasClass&&ke.hasClass("selected"),xe=ke&&ke.css&&ke.css("display")==="block",Be=je&&je.printElementType&&je.printElementType.type&&je.printElementType.type.includes("table");return!Be&&(xe||Ie)}),Ae},_e.prototype.updateOption=function($e,Ae){var je=this.getSelectEls();je&&je.length&&(je.forEach(function(ke){ke.updateOption($e,Ae,!0)}),o.a.event.trigger("hiprintTemplateDataChanged_"+this.id,"批量修改"))},_e.prototype.setElsAlign=function($e){var Ae=this,je=this.getSelectEls();if(je.length){var ke=this.editingPanel,Ie=ke&&ke.width,xe=ke&&ke.height,Be=["left","right","top","bottom","vertical","horizontal"].includes($e)&&Ie&&xe;if(Be)switch($e){case"left":je.forEach(function(Oe){Oe.updateSizeAndPositionOptions(0),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"vertical":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),Xe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,(Xe-Qe)/2);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"right":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),Xe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,Xe-Qe);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"top":je.forEach(function(Oe){var Qe=Ae.editingPanel&&Ae.editingPanel.paperHeader||0;Oe.updateSizeAndPositionOptions(void 0,Qe),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"horizontal":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperHeader||0,Ye=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,Xe=Math.max(0,Ye-We),rr=We+Math.max(0,(Xe-Qe)/2);Oe.updateSizeAndPositionOptions(void 0,rr),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"bottom":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,Ye=Math.max(0,We-Qe);Oe.updateSizeAndPositionOptions(void 0,Ye),Oe.designTarget.css("top",Oe.options.displayTop())});break}else{var Ce=Math.min.apply(null,je.map(function(Oe){return Oe.options.left})),Ee=Math.max.apply(null,je.map(function(Oe){return Oe.options.left+Oe.options.width})),Se=Math.min.apply(null,je.map(function(Oe){return Oe.options.top})),Pe=Math.max.apply(null,je.map(function(Oe){return Oe.options.top+Oe.options.height}));switch($e){case"distributeHor":var Te=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.width},0),Me=(Ee-Ce-Te)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.left-Qe.options.left}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(je[Qe-1].options.left+je[Qe-1].options.width+Me),Oe.designTarget.css("left",Oe.options.displayLeft()))});break;case"distributeVer":var Fe=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.height},0),De=(Pe-Se-Fe)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.top-Qe.options.top}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(void 0,je[Qe-1].options.top+je[Qe-1].options.height+De),Oe.designTarget.css("top",Oe.options.displayTop()))});break}}}},_e.prototype.setElsSpace=function($e,Ae){var je=this.getSelectEls();je.length&&(Ae?(je.sort(function(ke,Ie){return ke.options.left-Ie.options.left}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(je[Ie-1].options.left+je[Ie-1].options.width+$e),ke.designTarget.css("left",ke.options.displayLeft()))})):(je.sort(function(ke,Ie){return ke.options.top-Ie.options.top}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(void 0,je[Ie-1].options.top+je[Ie-1].options.height+$e),ke.designTarget.css("top",ke.options.displayTop()))})))},_e.prototype.setElsZIndex=function($e){var Ae=this.getSelectEls();if(!(!Ae||!Ae.length)){var je=function(Ce){var Ee=parseInt(Ce,10);return isNaN(Ee)?0:Ee},ke=function(Ce){if(!Ce)return 0;var Ee=Ce.options&&(Ce.options.zIndex||Ce.options["z-index"]);if(typeof Ee<"u")return je(Ee);var Se=Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index");return je(Se)},Ie=function(Ce,Ee){if(Ce&&(Ce.options&&(Ce.options.zIndex=Ee),Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index",Ee),typeof Ce.updateOption=="function"))try{Ce.updateOption("zIndex",Ee,!0)}catch{}},xe=999,Be=0;switch($e){case"top":Ae.forEach(function(Ce){Ie(Ce,xe)});break;case"bottom":Ae.forEach(function(Ce){Ie(Ce,Be)});break;case"up":Ae.forEach(function(Ce){Ie(Ce,ke(Ce)+1)});break;case"down":Ae.forEach(function(Ce){var Ee=ke(Ce)-1;Ie(Ce,Ee<0?0:Ee)});break;default:return}try{o.a.event.trigger("hiprintTemplateDataChanged_"+(this.id||this.templateId),"层级:"+$e)}catch{}}},_e.prototype.initAutoSave=function(){var $e=this;o.a.event.on("hiprintTemplateDataShortcutKey_"+this.id,function(Ae){if($e.history)switch(Ae){case"undo":if($e.historyPos>0){$e.historyPos-=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break;case"redo":if($e.historyPos<$e.historyList.length-1){$e.historyPos+=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break}}),o.a.event.on("hiprintTemplateDataChanged_"+this.id,function(Ae){if($e.history){var je=$e.dataMode==1?$e.getJson():$e.getJsonTid();$e.lastJson=je,$e.historyPos<$e.historyList.length-1&&($e.historyList=$e.historyList.slice(0,$e.historyPos+1)),$e.historyList.push({id:s.a.instance.guid(),type:Ae,json:je}),$e.historyList.length>50?$e.historyList=$e.historyList.slice(0,1).concat($e.historyList.slice(1,50)):$e.historyPos+=1,$e.onDataChanged&&$e.onDataChanged(Ae,je)}})},_e}();function ht(_e){this.getHtml(_e).hiwprint()}function ft(_e,$e,Ae){$$g.extend({},_e||{}).imgToBase64=!0;var je=new ct({});je.on("printSuccess",$e),je.on("printError",Ae),je.printByHtml2(this.getHtml(_e),_e.options)}function gt(_e){var $e=void 0;return _e&&_e.templates.forEach(function(Ae,je){var ke=$$g.extend({},Ae.options||{});_e.imgToBase64&&(ke.imgToBase64=!0),$e?$e.append(Ae.template.getHtml(Ae.data,ke).html()):$e=Ae.template.getHtml(Ae.data,ke)}),$e}function mt(_e){p.a.instance.init(_e),p.a.instance.providers&&p.a.instance.providers.forEach(function($e){$e.addElementTypes(a.instance)}),window.autoConnect&&(p.a.instance.host!=hiwebSocket.host||p.a.instance.token!=hiwebSocket.token)&&(hiwebSocket.stop(),p.a.instance.host&&(hiwebSocket.host=p.a.instance.host),p.a.instance.token&&(hiwebSocket.token=p.a.instance.token),hiwebSocket.start()),p.a.instance.lang&&Object.keys(languages).includes(p.a.instance.lang)?i18n.lang=p.a.instance.lang:i18n.lang="cn"}function cig(_e){_e?_e&&Object.keys(_e).forEach(function($e){if($e=="optionItems"&&_e.optionItems&&_e.optionItems.length)p.a.instance.registerItems(_e.optionItems);else if(_e[$e].tabs&&_e[$e].tabs.length)_e[$e].tabs.forEach(function(Ie,xe){if(Ie.replace)$$g.extend(p.a.instance[$e].tabs[xe],Ie);else{var Be=Ie.options,Ce=p.a.instance[$e].tabs[xe].options;Be.forEach(function(Ee){var Se=Ce.findIndex(function(Pe){return Pe.name==Ee.name});Se>-1?Ce[Se].hidden=Ee.hidden:Ee.after?(Se=Ce.findIndex(function(Pe){return Pe.name==Ee.after}),Se>-1&&Ce.splice(Se+1,0,Ee)):Ce.push(Ee)}),$$g.extend(p.a.instance[$e].tabs[xe],{name:Ie.name,options:Ce})}}),delete _e[$e].tabs;else if(_e[$e].supportOptions){var Ae=_e[$e].supportOptions,je=p.a.instance[$e].supportOptions;Ae.forEach(function(Ie){var xe=je.findIndex(function(Be){return Be.name==Ie.name});xe>-1?je[xe].hidden=Ie.hidden:Ie.after?(xe=je.findIndex(function(Be){return Be.name==Ie.after}),xe>-1&&je.splice(xe+1,0,Ie)):je.push(Ie)}),$$g.extend(p.a.instance[$e].supportOptions,je),delete _e[$e].supportOptions}else{var ke={};ke[$e]=_e[$e],$$g.extend(p.a.instance,ke)}}):$$g.extend(p.a.instance,HIPRINT_CONFIG)}function uep(_e,$e){return a.instance.updateElementType(_e,$e)}function rpl(_e){p.a.instance.clear("printerList"),p.a.instance.on("printerList",_e),hiwebSocket.refreshPrinterList()}function getClients(_e){p.a.instance.clear("clients"),p.a.instance.on("clients",_e),hiwebSocket.getClients()}function getClientInfo(_e){p.a.instance.clear("clientInfo"),p.a.instance.on("getClientInfo",_e),hiwebSocket.getClientInfo()}function getAddr(_e,$e,...Ae){p.a.instance.clear("address_"+_e),p.a.instance.on("address_"+_e,$e),hiwebSocket.getAddress(_e,...Ae)}function ippPrint(_e,$e,Ae){p.a.instance.clear("ippPrinterCallback"),p.a.instance.on("ippPrinterCallback",$e),p.a.instance.clear("ippPrinterConnected"),p.a.instance.on("ippPrinterConnected",Ae),hiwebSocket.ippPrint(_e)}function ippRequest(_e,$e){p.a.instance.clear("ippRequestCallback"),p.a.instance.on("ippRequestCallback",$e),hiwebSocket.ippRequest(_e)}n.d(e,"init",function(){return mt}),n.d(e,"setConfig",function(){return cig}),n.d(e,"updateElementType",function(){return uep}),n.d(e,"hiwebSocket",function(){return hiwebSocket}),n.d(e,"refreshPrinterList",function(){return rpl}),n.d(e,"getClients",function(){return getClients}),n.d(e,"getClientInfo",function(){return getClientInfo}),n.d(e,"getAddress",function(){return getAddr}),n.d(e,"ippPrint",function(){return ippPrint}),n.d(e,"ippRequest",function(){return ippRequest}),n.d(e,"PrintElementTypeManager",function(){return it}),n.d(e,"PrintElementTypeGroup",function(){return ot}),n.d(e,"PrintTemplate",function(){return ct}),n.d(e,"print",function(){return ht}),n.d(e,"print2",function(){return ft}),n.d(e,"getHtml",function(){return gt}),$$g(document).ready(function(){console.log("document ready"),console.log(window.autoConnect),hiwebSocket.hasIo()&&window.autoConnect&&hiwebSocket.start()})}]),defaultElementTypeProvider=defaultTypeProvider(hiprint);const version="1.0.14",_export_sfc=(_e,$e)=>{const Ae=_e.__vccOpts||_e;for(const[je,ke]of $e)Ae[je]=ke;return Ae},_hoisted_1$3={class:"vgp-designer-wrap"},_sfc_main$3={__name:"Designer",props:{template:{type:Object,default:()=>({})},printData:{type:Object,default:()=>({})},templateKey:{type:String,default:"default-template"},title:{type:String,default:""},designOptions:{type:Object,default:()=>({grid:!0,activePanel:!0})},autoConnect:{type:Boolean,default:!0},paperList:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},authKey:{type:String,default:""}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(null);function ke(Ee){setConfig(Ae.config),register({authKey:Ae.authKey,plugins:Ae.plugins}),je.value=createPrintTemplate({template:Ee}),je.value.design("#SVPrint",Ae.designOptions)}vue.onMounted(()=>{ke(Ae.template)}),vue.watch(()=>Ae.template,Ee=>{Ee&&ke(Ee)});function Ie(){return je.value}function xe(){return je.value?je.value.getJson():{}}function Be(Ee){je.value&&je.value.setJson(Ee)}function Ce(){return xe()}return $e({init:ke,getTarget:Ie,getTemplateJson:xe,setTemplateJson:Be,exportJson:Ce}),(Ee,Se)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[vue.renderSlot(Ee.$slots,"header",{},void 0,!0),Se[0]||(Se[0]=vue.createElementVNode("div",{id:"SVPrint",class:"vgp-designer-target"},null,-1)),vue.renderSlot(Ee.$slots,"other",{},void 0,!0)]))}},Designer=_export_sfc(_sfc_main$3,[["__scopeId","data-v-c3735ff8"]]),_hoisted_1$2={class:"vgp-header"},_hoisted_2$2={class:"left"},_hoisted_3$1=["innerHTML"],_hoisted_4$1={class:"title"},_hoisted_5={class:"center"},_hoisted_6={class:"right"},_sfc_main$2={__name:"Header",props:{logoHtml:{type:String,default:'<i class="svicon sv-print"></i>'},title:{type:String,default:"vg-print"},reEle:{type:[String,Boolean],default:!1},eleList:{type:Array,default:()=>[]},reMenu:{type:[String,Boolean],default:!1},menuList:{type:Array,default:()=>[]},onPreviewClick:{type:Function,default:null}},setup(_e,{expose:$e}){const Ae=_e;function je(ke){return typeof Ae.onPreviewClick=="function"?Ae.onPreviewClick(ke):!0}return $e({previewClick:je}),(ke,Ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[vue.renderSlot(ke.$slots,"headerLeft",{},()=>[vue.createElementVNode("span",{innerHTML:_e.logoHtml},null,8,_hoisted_3$1),vue.createElementVNode("span",_hoisted_4$1,vue.toDisplayString(_e.title),1)],!0)]),vue.createElementVNode("div",_hoisted_5,[vue.renderSlot(ke.$slots,"headerCenter",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(ke.$slots,"headerRight",{},void 0,!0)])]))}},Header=_export_sfc(_sfc_main$2,[["__scopeId","data-v-c71a08f5"]]),_hoisted_1$1={key:0,class:"vgp-preview-modal"},_hoisted_2$1={class:"vgp-preview-panel"},_hoisted_3={class:"tools"},_hoisted_4=["value"],_sfc_main$1={__name:"Preview",props:{printTemplate:{type:[Object],default:void 0},printData:{type:Object,default:void 0},printerList:{type:Array,default:()=>[]},selectedPrinter:{type:String,default:""},showPdf:{type:Boolean,default:!0},showImg:{type:Boolean,default:!0},showPrint2:{type:Boolean,default:!0},modalShow:{type:Boolean,default:!1}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(!1),ke=vue.ref(null),Ie=vue.ref([]),xe=vue.ref("");function Be(Qe,We){ke.value=Qe,Ce(We)}function Ce(Qe){if(!ke.value)return;const We=ke.value.getHtml(Qe),Ye=document.getElementById("preview_content_tasks");Ye&&(Ye.innerHTML=We)}function Ee(){je.value=!0}function Se(){je.value=!1}function Pe(){return ke.value}function Te(){ke.value&&ke.value.print(Ae.printData||{})}function Me(){ke.value&&ke.value.print2(Ae.printData||{},{printer:xe.value})}async function Fe(){ke.value&&await ke.value.toPdf(Ae.printData||{},"打印预览pdf")}async function De(){ke.value&&await ke.value.toImage(Ae.printData||{})}function Oe(){try{hiprint&&hiprint.hiwebSocket&&(Ie.value=hiprint.hiwebSocket.getPrinterList()||[])}catch{}}return $e({init:Be,show:Ee,hide:Se,getTarget:Pe,print:Te,directPrint:Me,toPdf:Fe,toImage:De,refreshPrinters:Oe}),vue.watch(()=>Ae.modalShow,Qe=>{je.value=!!Qe}),(Qe,We)=>je.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3,[_e.showPdf?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:Fe},"导出PDF")):vue.createCommentVNode("",!0),_e.showImg?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:De},"导出图片")):vue.createCommentVNode("",!0),_e.showPrint2?(vue.openBlock(),vue.createElementBlock("button",{key:2,onClick:Me},"直接打印")):vue.createCommentVNode("",!0),vue.createElementVNode("button",{onClick:Te},"浏览器打印"),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":We[0]||(We[0]=Ye=>xe.value=Ye)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ie.value,Ye=>(vue.openBlock(),vue.createElementBlock("option",{key:Ye.name,value:Ye.name},vue.toDisplayString(Ye.label||Ye.name),9,_hoisted_4))),128))],512),[[vue.vModelSelect,xe.value]]),vue.createElementVNode("button",{onClick:Oe},"刷新"),vue.createElementVNode("button",{onClick:Se},"关闭")]),We[1]||(We[1]=vue.createElementVNode("div",{id:"preview_content_tasks"},null,-1))])])):vue.createCommentVNode("",!0)}},Preview=_export_sfc(_sfc_main$1,[["__scopeId","data-v-9764769e"]]),_hoisted_1={class:"title"},_hoisted_2={class:"body"},_sfc_main={__name:"DragBox",props:{target:{type:String,default:"SVPrint"},dragKey:{type:String,default:"default"},dragStyle:{type:String,default:""},mode:{type:String,default:"default"},show:{type:Boolean,default:!1}},setup(_e){const $e=_e,Ae=vue.computed(()=>`mode-${$e.mode}`);return(je,ke)=>_e.show?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["vgp-dragbox",Ae.value]),style:vue.normalizeStyle(_e.dragStyle)},[vue.createElementVNode("div",_hoisted_1,[vue.renderSlot(je.$slots,"iconTitle",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2,[vue.renderSlot(je.$slots,"body",{},void 0,!0)])],6)):vue.createCommentVNode("",!0)}},DragBox=_export_sfc(_sfc_main,[["__scopeId","data-v-3bdcea45"]]);let autoConnect=function(_e){console.log("autoConnect"),window.autoConnect=!0,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.start(_e)},disAutoConnect=function(){console.log("disAutoConnect"),window.autoConnect=!1,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.stop()},hiPrintPlugin={disAutoConnect,install:function(_e,$e="$hiPrint",Ae=!0){Ae||disAutoConnect();let je=_e.prototype||_e.config.globalProperties;je[$e]=hiprint,je.$print=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print(...xe),Be},je.$print2=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print2(...xe),Be}}};hiprint.version=version;window.hiprint=hiprint;function register({authKey:_e="",plugins:$e=[]}={}){const Ae=$e.map(je=>typeof je=="function"?je():je).filter(Boolean);return Ae.length||Ae.push(new defaultElementTypeProvider),hiprint.init({providers:Ae}),hiprint.authKey=_e,hiprint}function setConfig(_e={}){return hiprint.config=_e,hiprint}function createPrintTemplate(_e={}){return new hiprint.PrintTemplate(_e)}function print({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print($e,Ae)}function print2({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print2($e,Ae)}async function toPdf({template:_e,data:$e,name:Ae,pdfOptions:je}={}){return _e.toPdf($e,Ae,je)}async function toImage({template:_e,data:$e,imageOptions:Ae}={}){return _e.toImage($e,Ae)}exports.Designer=Designer;exports.DragBox=DragBox;exports.Header=Header;exports.Preview=Preview;exports.autoConnect=autoConnect;exports.createPrintTemplate=createPrintTemplate;exports.defaultElementTypeProvider=defaultElementTypeProvider;exports.disAutoConnect=disAutoConnect;exports.hiPrintPlugin=hiPrintPlugin;exports.hiprint=hiprint;exports.print=print;exports.print2=print2;exports.register=register;exports.setConfig=setConfig;exports.toImage=toImage;exports.toPdf=toPdf;
2041
+ </div>`),Ie.forEach(function(Ce){Ce.submit=function(Ee){$e.callback(je.getValueByOptionItems(Ie))},Be.append(Ce.createTarget(je.printTemplate,$e.options,void 0)),Ce.setValue($e.options[Ce.name],$e.options,void 0)}),Be.find(".auto-submit").change(function(Ce){$e.callback(je.getValueByOptionItems(Ie))}),Be.find(".auto-submit:input").bind("keydown.submitOption",function(Ce){Ce.keyCode==13&&$e.callback(je.getValueByOptionItems(Ie))}),ke.append(Be)},_e.prototype.getValueByOptionItems=function($e){var Ae={};return $e.forEach(function(je){Ae[je.name]=je.getValue()}),Ae},_e}(),dt=function(){function _e($e,Ae){this.paginationContainer=$e,this.jqPaginationContainer=$$g(this.paginationContainer),this.template=Ae}return _e.prototype.buildPagination=function($e){var Ae=this.template.getPaneltotal(),je=this;this.jqPaginationContainer.html("");for(var ke=$$g('<ul class="hiprint-pagination"></ul>'),Ie=function(){var Ee=xe,Se=je.template.printPanels[Ee].name||Ee+1,Pe=$$g("<li><span>"+Se+'</span><a href="javascript:void(0);">x</a></li>');Pe.find("span").click(function(){je.template.selectPanel(Ee),Pe.siblings().removeClass("selected"),$$g(this).parent("li").addClass("selected")}),Pe.find("a").click(function(){je.template.deletePanel(Ee),je.buildPagination()}),ke.append(Pe)},xe=0;xe<Ae;xe++)Ie();var Be=$$g("<li><span>+</span></li>");ke.append(Be),this.jqPaginationContainer.append(ke),Be.click(function(){var Ce=function(Se){je.template.addPrintPanel(Se||void 0,!0),je.buildPagination(),$$g(".hiprint-pagination li").removeClass("selected"),$$g(".hiprint-pagination li:nth-last-child(2)").addClass("selected")};if(je.template.onPanelAddClick){var Ee={index:je.template.printPanels.length,paperType:"A4"};je.template.onPanelAddClick(Ee,Ce)}else Ce()})},_e.prototype.selectPanel=function($e){var Ae=$e||this.template.editingPanel.index,je=$$g(".hiprint-pagination li:nth("+Ae+")");je.length&&(je.siblings().removeClass("selected"),je.addClass("selected")),hinnn.event.trigger("onSelectPanel",this.template.editingPanel,Ae,je)},_e}(),ct=function(){function _e($e){var Ae=this;this.tempimageBase64={},this.id=s.a.instance.guid(),s.a.instance.setPrintTemplateById(this.id,this);var je=$e||{};this.printPanels=[],this.dataMode=je.dataMode||1,this.history=je.history!=null?je.history:!0,this.onDataChanged=je.onDataChanged,this.onUpdateError=je.onUpdateError,this.lastJson=je.template||{},this.historyList=[{id:s.a.instance.guid(),type:"初始",json:this.lastJson}],this.historyPos=0,this.defaultPanelName=je.defaultPanelName,this.designOptions={};var ke=new st(je.template||[]);je.template&&ke.panels.forEach(function(Ie){Ae.printPanels.push(new pt(Ie,Ae.id))}),je.fontList&&(this.fontList=je.fontList),je.fields&&(this.fields=je.fields),je.onImageChooseClick&&(this.onImageChooseClick=je.onImageChooseClick),je.onPanelAddClick&&(this.onPanelAddClick=je.onPanelAddClick),je.settingContainer&&new ut(this,je.settingContainer),je.paginationContainer&&(this.printPaginationCreator=new dt(je.paginationContainer,this),this.printPaginationCreator.buildPagination()),this.initAutoSave()}return _e.prototype.design=function($e,Ae){var je=this;if(Ae||(Ae={}),this.printPanels.length==0){var ke=this.createDefaultPanel();this.printPanels.push(ke)}if(!$e)throw new Error("options.container can not be empty");je.designOptions=Ae,this.createContainer($e),this.printPanels.forEach(function(Ie,xe){je.container.append(Ie.getTarget()),xe>0&&Ie.disable(),Ie.design(Ae)}),this.selectPanel(0)},_e.prototype.getSimpleHtml=function($e,Ae){var je=this;Ae||(Ae={});var ke=$$g('<div class="hiprint-printTemplate"></div>');return $e&&$e.constructor===Array?$e.forEach(function(Ie,xe){Ie&&je.printPanels.forEach(function(Be,Ce){ke.append(Be.getHtml(Ie,Ae)),xe==$e.length-1&&delete hinnn._paperList})}):this.printPanels.forEach(function(Ie,xe){ke.append(Ie.getHtml($e,Ae)),xe==je.printPanels.length-1&&delete hinnn._paperList}),Ae&&Ae.imgToBase64&&this.transformImg(ke.find("img")),ke},_e.prototype.getHtml=function($e,Ae){return $e||($e={}),this.getSimpleHtml($e,Ae)},_e.prototype.getJointHtml=function($e,Ae,je){var ke=$$g('<div class="hiprint-printTemplate"></div>'),Ie=[];return this.printPanels.forEach(function(xe,Be){ke.append(xe.getHtml($e,Ae,Ie,void 0,je))}),ke},_e.prototype.setPaper=function($e,Ae){if(/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test($e))this.editingPanel.resize(void 0,parseFloat($e),parseFloat(Ae),!1);else{var je=s.a.instance[$e];if(!je)throw new Error("not found pagetype:"+($e||""));this.editingPanel.resize($e,je.width,je.height,!1)}},_e.prototype.rotatePaper=function(){this.editingPanel.rotatePaper()},_e.prototype.zoom=function($e,Ae){this.editingPanel.zoom($e,Ae)},_e.prototype.addPrintPanel=function($e,Ae){var je=$e?new pt(new rt($e),this.id):this.createDefaultPanel();return $e&&($e.index=this.printPanels.length),Ae&&(this.container.append(je.getTarget()),je.design(this.designOptions)),this.printPanels.push(je),Ae&&this.selectPanel(je.index),je},_e.prototype.selectPanel=function($e){var Ae=this;$e>Ae.printPanels.length-1&&($e=Ae.printPanels.length-1),this.printPanels.forEach(function(je,ke){$e==ke?(je.enable(),Ae.editingPanel=je,Ae.printPaginationCreator&&Ae.printPaginationCreator.selectPanel($e)):je.disable()})},_e.prototype.deletePanel=function($e){this.printPanels[$e].clear(),this.printPanels[$e].getTarget().remove(),this.printPanels.splice($e,1)},_e.prototype.getPaneltotal=function(){return this.printPanels.length},_e.prototype.createDefaultPanel=function(){return new pt(new rt({index:this.printPanels.length,name:this.defaultPanelName,paperType:"A4"}),this.id)},_e.prototype.createContainer=function($e){$e?(this.container=$$g($e),this.container.addClass("hiprint-printTemplate")):this.container=$$g('<div class="hiprint-printTemplate"></div>')},_e.prototype.getJsonTid=function(){var $e=[];return this.printPanels.forEach(function(Ae){Ae.getPanelEntity().printElements.length&&$e.push(Ae.getPanelEntity())}),new st({panels:$e})},_e.prototype.getJson=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e.push(Ae.getPanelEntity(!0))}),new st({panels:$e})},_e.prototype.undo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"undo")},_e.prototype.redo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"redo")},_e.prototype.getPrintElementSelectEventKey=function(){return"PrintElementSelectEventKey_"+this.id},_e.prototype.getBuildCustomOptionSettingEventKey=function(){return"BuildCustomOptionSettingEventKey_"+this.id},_e.prototype.clear=function(){this.printPanels.forEach(function($e){if($e.clear(),$e.index>0){var Ae=$e.getTarget();Ae&&Ae.length&&Ae.remove()}}),this.printPanels=[this.printPanels[0]],this.printPaginationCreator&&this.printPaginationCreator.buildPagination()},_e.prototype.getPaperType=function($e){return this.printPanels[0].paperType},_e.prototype.getOrient=function($e){return $e==null&&($e=0),this.printPanels[$e].height>this.printPanels[$e].width?1:2},_e.prototype.getPrintStyle=function($e){return this.printPanels[$e].getPrintStyle()},_e.prototype.print=function($e,Ae,je){$e||($e={});try{if(typeof this.getHtmlStable=="function"){var ke=this;return this.getHtmlStable($e).then(function(Ie){var xe=$$g("<div></div>");xe.html(Ie),xe.hiwprint(je)}).catch(function(){ke.getHtml($e,Ae).hiwprint(je)})}}catch{}this.getHtml($e,Ae).hiwprint(je)},_e.prototype.print2=function($e,Ae){if($e||($e={}),Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]'),Be="";if(Ae.styleHandler&&(Be+=Ae.styleHandler()),xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Ce,Ee){var Se=new XMLHttpRequest;Se.open("GET",$$g(Ee).attr("href")),Se.onreadystatechange=function(){if(Se.readyState===4&&Se.status===200&&(Ie[Ce+""]='<style rel="stylesheet" type="text/css">'+Se.responseText+"</style>",++ke==xe.length)){for(var Pe="",Te=0;Te<xe.length;Te++)Pe+=Ie[Te+""];Be&&(Pe=Be+Pe),je.sentToClient(Pe,$e,Ae)}},Se.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.imageToBase64=function($e){var Ae=$$g($e).attr("src");if(Ae.indexOf("base64")==-1)try{if(!this.tempimageBase64[Ae]){var je=document.createElement("canvas"),ke=new Image;ke.src=$e.attr("src"),je.width=ke.width,je.height=ke.height,je.getContext("2d").drawImage(ke,0,0),Ae&&(this.tempimageBase64[Ae]=je.toDataURL("image/png"))}$e.attr("src",this.tempimageBase64[Ae])}catch{try{this.xhrLoadImage($e)}catch(xe){console.log(xe)}}},_e.prototype.xhrLoadImage=function($e){},_e.prototype.sentToClient=function($e,Ae,je){Ae||(Ae={});var ke=$$g.extend({},je||{});ke.imgToBase64=!0;var Ie=$e+this.getHtml(Ae,ke)[0].outerHTML;ke.id=s.a.instance.guid(),ke.html=Ie,ke.templateId=this.id,hiwebSocket.send(ke)},_e.prototype.printByHtml=function($e){$$g($e).hiwprint()},_e.prototype.printByHtml2=function($e,Ae){if(Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]');if(xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Be,Ce){var Ee=new XMLHttpRequest;Ee.open("GET",$$g(Ce).attr("href")),Ee.onreadystatechange=function(){if(Ee.readyState===4&&Ee.status===200&&(Ie[Be+""]='<style rel="stylesheet" type="text/css">'+Ee.responseText+"</style>",++ke==xe.length)){for(var Se="",Pe=0;Pe<xe.length;Pe++)Se+=Ie[Pe+""];var Te=Se+$$g($e)[0].outerHTML,Me=$$g.extend({},Ae||{});Me.id=s.a.instance.guid(),Me.html=Te,Me.templateId=je.id,hiwebSocket.send(Me)}},Ee.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.deletePrintElement=function($e){this.printPanels.forEach(function(Ae){Ae.deletePrintElement($e)})},_e.prototype.transformImg=function($e){var Ae=this;$e.map(function(je,ke){Ae.imageToBase64($$g(ke))})},_e.prototype.toPdf=function($e,Ae,je){var ke=this,Ie=$$g.Deferred(),xe=!0;if(this.printPanels.length){var Be=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Ce=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Ee=o.a.mm.toPt(Be),Se=o.a.mm.toPt(Ce),Pe=Ee,Te=Se,Me=this.getOrient(0)==1?"portrait":"landscape";if(je&&(je.paperWidth||je.paperHeight)){var Fe=je.paperWidth,De=je.paperHeight;Fe&&De&&(Pe=o.a.mm.toPt(Fe),Te=o.a.mm.toPt(De))}else if(je&&je.usePaperType===!0&&this.printPanels[0].paperType){var Oe=this.printPanels[0].paperType.toString().toLowerCase(),Qe=null,We=null;Oe==="a4"?(Qe=210,We=297):Oe==="a5"?(Qe=148,We=210):Oe==="a3"&&(Qe=297,We=420),Qe&&We&&(Pe=o.a.mm.toPt(Qe),Te=o.a.mm.toPt(We))}if(Me==="landscape"){var Ye=Pe;Pe=Te,Te=Ye}var Xe=$$g.extend({scale:2,width:o.a.pt.toPx(Pe),height:o.a.pt.toPx(Te),x:0,y:0,useCORS:!0},je||{});je&&typeof je.pixelRatio<"u"?Xe.scale=je.pixelRatio:je&&typeof je.scale<"u"&&(Xe.scale=je.scale),Xe.width=o.a.pt.toPx(Pe),Xe.height=o.a.pt.toPx(Te);var rr=new E$1({orientation:Me,unit:"pt",format:[Pe,Te]}),Ze=this.getHtml($e,je);je&&je.isDownload!=null&&(xe=je.isDownload),(!Ae||Ae===void 0)&&je&&je.name&&(Ae=je.name);var Ke=je&&typeof je.onProgress=="function"?je.onProgress:null;this.createTempContainer();var St=this.getTempContainer();this.svg2canvas(Ze),St.html(Ze[0]);var tr=[],qe=je&&typeof je.removeTransform<"u"?!!je.removeTransform:!0;if(qe)try{var Ge=St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");Ge.each(function(Mi,sr){tr[Mi]=sr.style.transform,sr.style.transform="",sr.style.zoom&&(sr.style.zoom=1)})}catch{}if(!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0))try{var Je=St.find(".hiprint-printPaper").eq(0)[0],ir=St.find(".hiprint-printPanel").eq(0)[0],ar=Je||ir;if(ar){var lr=ar.getBoundingClientRect();lr&&lr.width&&lr.height&&(Pe=o.a.px.toPt(Math.round(lr.width)),Te=o.a.px.toPt(Math.round(lr.height)),Xe.width=o.a.pt.toPx(Pe),Xe.height=o.a.pt.toPx(Te),rr=new E$1({orientation:Me,unit:"pt",format:[Pe,Te]}))}}catch{}var dr=St.find(".hiprint-printTemplate"),gr=dr.find(".hiprint-printPanel"),hr=$e&&$e.constructor===Array?$e.length:null,kr=hr!=null?Math.min(hr,gr.length):gr.length,Ar=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{};Ar.layoutType||je&&je.layoutType;var Rr=Number(Ar.layoutRowGap||je&&je.rowGapMm||0),or=Number(Ar.layoutColumnGap||je&&je.colGapMm||0),pr=o.a.pt.toMm(Pe),jr=o.a.pt.toMm(Te),Br=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||pr,Mr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||jr,Fr=Math.max(1,Math.floor((pr+or)/(Br+or))),Lr=Math.max(1,Math.floor((jr+Rr)/(Mr+Rr))),Dr=Math.max(1,Fr*Lr),zr=!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0);zr&&(Dr=1);var ti=Math.max(1,je&&je.perPage||Dr);if(ti=Math.min(ti,kr),ti>1&&kr>1){var pi=or;if(Fr>1){var ci=(pr-Fr*Br)/(Fr-1);ci>=0&&(pi=ci)}else pi=0;var wi=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");St.prepend($$g(wi));var dr=St.find(".hiprint-printTemplate");dr.css({width:pr+"mm",height:jr+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var Wr=Math.max(0,pi/2),Cr=Math.max(0,Rr/2),Ci=['<style type="text/css">',".hiprint-printTemplate{margin:-"+Cr+"mm -"+Wr+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+Cr+"mm "+Wr+"mm;}","</style>"].join("");St.prepend($$g(Ci)),$$g(Ze).css("position:fixed");var mi=je&&typeof je.leftOffset<"u"?Number(je.leftOffset):null,oi=je&&typeof je.topOffset<"u"?Number(je.topOffset):null;if(mi!==null||oi!==null){var ui=Fr*Br+(Fr-1)*pi,_i=Lr*Mr+(Lr-1)*Rr,Ai=0,ki=0;mi===-1?Ai=Math.max(0,(pr-ui)/2):mi>=0&&(Ai=mi),oi===-1?ki=Math.max(0,(jr-_i)/2):oi>=0&&(ki=oi),dr.css({paddingLeft:Ai+"mm",paddingTop:ki+"mm"})}for(var yi=Math.ceil(kr/ti),Hi=Promise.resolve(),Pi=0;Pi<yi;Pi++){var Ri=Pi*ti,Vi=Math.min(Ri+ti,kr);(function(sr,wr,br){Hi=Hi.then(function(){return console.log("处理页面",br+1,"数据范围:",sr,"到",wr-1),gr.hide(),gr.slice(sr,wr).show(),html2canvas(dr[0],Xe).then(function(Nr){var Pr=Nr.getContext("2d");Pr.mozImageSmoothingEnabled=!1,Pr.webkitImageSmoothingEnabled=!1,Pr.msImageSmoothingEnabled=!1,Pr.imageSmoothingEnabled=!1;var Yr=Nr.toDataURL("image/jpeg");rr.addImage(Yr,"JPEG",0,0,Pe,Te),br<yi-1&&rr.addPage(),Ke&&Ke(br+1,yi)})})})(Ri,Vi,Pi)}Hi.then(function(){gr.show();try{Ge.each(function(wr,br){br.style.transform=tr[wr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let wr=je.type||"blob";var sr=rr.output(wr);Ie.resolve(sr)}})}else{var xi=St.find(".hiprint-printPaper"),Ti=xi.length;Ti===0&&(xi=St.find(".hiprint-printTemplate"),Ti=xi.length||1);try{var vi=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!je||je.ignoreOffsets!==!1)&&vi.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var aa='<style type="text/css">'+vi.join("")+"</style>";St.prepend($$g(aa)),xi.each(function(Mi,sr){var wr=sr.getAttribute("original-height");wr&&(sr.style.height=wr+"mm")})}catch{}for(var Ki=Promise.resolve(),na=0;na<Ti;na++)(function(Mi){Ki=Ki.then(function(){var sr=xi.eq(Mi),wr=sr[0],br=$$g.extend({},Xe);return br.width=o.a.pt.toPx(Pe),br.height=o.a.pt.toPx(Te),html2canvas(wr,br).then(function(Nr){var Pr=Nr.getContext("2d");Pr.mozImageSmoothingEnabled=!1,Pr.webkitImageSmoothingEnabled=!1,Pr.msImageSmoothingEnabled=!1,Pr.imageSmoothingEnabled=!1;var Yr=Nr.toDataURL("image/jpeg");rr.addImage(Yr,"JPEG",0,0,Pe,Te),Mi<Ti-1&&rr.addPage(),Ke&&Ke(Mi+1,Ti)})})})(na);Ki.then(function(){if(qe)try{St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(sr,wr){wr.style.transform=tr[sr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let sr=je.type||"blob";var Mi=rr.output(sr);Ie.resolve(Mi)}})}}return Ie.promise()},_e.prototype.createTempContainer=function(){this.removeTempContainer(),$$g("body").prepend($$g('<div class="hiprint_temp_Container" style="overflow:hidden;height: 0px;box-sizing: border-box;"></div>'))},_e.prototype.removeTempContainer=function(){$$g(".hiprint_temp_Container").remove()},_e.prototype.getTempContainer=function(){return $$g(".hiprint_temp_Container")},_e.prototype.svg2canvas=function($e){var Ae=this;$e.find("svg").each(function(je,ke){var Ie=ke.parentNode,xe=Ae.parentWidthHeight(Ie),Be=document.createElement("canvas");Be.width=xe.width,Be.height=xe.height;var Ce=Be.getContext("2d"),Ee=new XMLSerializer().serializeToString(ke);Canvg.fromString(Ce,Ee).render(),$$g(ke).before(Be),Ie.removeChild(ke)})},_e.prototype.toImage=function($e,Ae){var je=this,ke=$$g.Deferred(),Ie=!1,xe=Ae&&Ae.name||"image",Be=Ae&&Ae.type||"image/jpeg",Ce=Ae&&typeof Ae.quality<"u"?Ae.quality:.92,Ee=Ae&&Ae.toType||"url",Se=Ae&&typeof Ae.limit<"u"?Number(Ae.limit):10,Pe=Se<=0?Number.MAX_SAFE_INTEGER:Se;if(Ae&&Ae.isDownload!=null&&(Ie=Ae.isDownload),this.printPanels.length){let Yr=function(){je.removeTempContainer();var Sr=[],Jr=[],xr="jpg";if(Be.indexOf("png")>-1?xr="png":Be.indexOf("webp")>-1?xr="webp":Be.indexOf("bmp")>-1&&(xr="bmp"),Dr){for(var Qr=Promise.resolve(),Zr=0;Zr<kr.length;Zr++)(function(Or){Qr=Qr.then(function(){var ni=kr[Or],Kr=xe;return Kr=Kr+"-"+(Or+1)+"."+xr,Jr.push(Kr),new Promise(function(ii){if(Ee==="blob")ni.toBlob(function(ji){Sr.push(ji),ii()},Be,Ce);else{var bi=ni.toDataURL(Be,Ce);Sr.push(bi),ii()}})})})(Zr);Qr.then(function(){if(Ie)for(var Or=0;Or<Sr.length;Or++){var ni=Sr[Or],Kr=ni;Ee==="blob"&&(Kr=URL.createObjectURL(ni));var ii=document.createElement("a");if(ii.href=Kr,ii.download=Jr[Or],document.body.appendChild(ii),ii.click(),document.body.removeChild(ii),Ee==="blob")try{URL.revokeObjectURL(Kr)}catch{}}ke.resolve(Sr)});return}for(var ai=[],Hr=0;Hr<kr.length;Hr+=Pe)ai.push(kr.slice(Hr,Math.min(Hr+Pe,kr.length)));for(var ri=Promise.resolve(),Vr=0;Vr<ai.length;Vr++)(function(Or){ri=ri.then(function(){for(var ni=ai[Or],Kr=document.createElement("canvas"),ii=0,bi=0,ji=0;ji<ni.length;ji++)ii=Math.max(ii,ni[ji].width),bi+=ni[ji].height;Kr.width=Math.max(1,ii),Kr.height=Math.max(1,bi);var Ui=Kr.getContext("2d");Ui.fillStyle="#ffffff",Ui.fillRect(0,0,Kr.width,Kr.height),Ui.mozImageSmoothingEnabled=!1,Ui.webkitImageSmoothingEnabled=!1,Ui.msImageSmoothingEnabled=!1,Ui.imageSmoothingEnabled=!1;for(var Wi=0,Qi=0;Qi<ni.length;Qi++){var li=ni[Qi];Ui.drawImage(li,0,Wi,li.width,li.height),Wi+=li.height}var Si=xe;return Si=Si+"-"+(Or+1)+"."+xr,Jr.push(Si),new Promise(function(Ei){if(Ee==="blob")Kr.toBlob(function(Xi){Sr.push(Xi),Ei()},Be,Ce);else{var Fi=Kr.toDataURL(Be,Ce);Sr.push(Fi),Ei()}})})})(Vr);ri.then(function(){if(Ie)for(var Or=0;Or<Sr.length;Or++){var ni=Sr[Or],Kr=ni;Ee==="blob"&&(Kr=URL.createObjectURL(ni));var ii=document.createElement("a");if(ii.href=Kr,ii.download=Jr[Or],document.body.appendChild(ii),ii.click(),document.body.removeChild(ii),Ee==="blob")try{URL.revokeObjectURL(Kr)}catch{}}ke.resolve(Sr)})};var Te=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Me=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Fe=o.a.mm.toPt(Te),De=o.a.mm.toPt(Me),Oe=Fe,Qe=De,We=this.getOrient(0)==1?"portrait":"landscape";if(Ae&&(Ae.paperWidth||Ae.paperHeight)){var Ye=Ae.paperWidth,Xe=Ae.paperHeight;Ye&&Xe&&(Oe=o.a.mm.toPt(Ye),Qe=o.a.mm.toPt(Xe))}else if(Ae&&Ae.usePaperType===!0&&this.printPanels[0].paperType){var rr=this.printPanels[0].paperType.toString().toLowerCase(),Ze=null,Ke=null;rr==="a4"?(Ze=210,Ke=297):rr==="a5"?(Ze=148,Ke=210):rr==="a3"&&(Ze=297,Ke=420),Ze&&Ke&&(Oe=o.a.mm.toPt(Ze),Qe=o.a.mm.toPt(Ke))}if(We==="landscape"){var St=Oe;Oe=Qe,Qe=St}var tr=$$g.extend({scale:2,width:o.a.pt.toPx(Oe),height:o.a.pt.toPx(Qe),x:0,y:0,useCORS:!0},Ae||{});Ae&&typeof Ae.pixelRatio<"u"?tr.scale=Ae.pixelRatio:Ae&&typeof Ae.scale<"u"&&(tr.scale=Ae.scale),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe);var qe=this.getHtml($e,Ae);this.createTempContainer();var Ge=this.getTempContainer();this.svg2canvas(qe),Ge.html(qe[0]);var Je=[],ir=Ae&&typeof Ae.removeTransform<"u"?!!Ae.removeTransform:!0;if(ir)try{var ar=Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");ar.each(function(Sr,Jr){Je[Sr]=Jr.style.transform,Jr.style.transform="",Jr.style.zoom&&(Jr.style.zoom=1)})}catch{}if(!(Ae&&(Ae.paperWidth||Ae.paperHeight))&&!(Ae&&Ae.usePaperType===!0))try{var lr=Ge.find(".hiprint-printPanel").eq(0)[0],dr=lr||Ge.find(".hiprint-printPaper").eq(0)[0];if(dr){var gr=dr.getBoundingClientRect();gr&&gr.width&&gr.height&&(Oe=o.a.px.toPt(Math.round(gr.width)),Qe=o.a.px.toPt(Math.round(gr.height)),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe))}}catch{}var hr=Ae&&typeof Ae.onProgress=="function"?Ae.onProgress:null,kr=[],Ar=o.a.pt.toPx(Oe),Rr=o.a.pt.toPx(Qe),or=Ge.find(".hiprint-printTemplate"),pr=or.find(".hiprint-printPanel"),jr=$e&&$e.constructor===Array?$e.length:null,Br=jr!=null?Math.min(jr,pr.length):pr.length,Mr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{},Fr=Number(Mr.layoutRowGap||Ae&&Ae.rowGapMm||0),Lr=Number(Mr.layoutColumnGap||Ae&&Ae.colGapMm||0),Dr=!!(Ae&&(Ae.paperWidth&&Ae.paperHeight||Ae.usePaperType===!0));if(Dr){var zr=o.a.pt.toMm(Oe),ti=o.a.pt.toMm(Qe),pi=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||zr,ci=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||ti,wi=Math.max(1,Math.floor((zr+Lr)/(pi+Lr))),Wr=Math.max(1,Math.floor((ti+Fr)/(ci+Fr))),Cr=Math.max(1,wi*Wr),Ci=Se>0?Math.max(1,Math.min(Se,Br)):Math.max(1,Cr),mi=Lr;if(wi>1){var oi=(zr-wi*pi)/(wi-1);oi>=0&&(mi=oi)}else mi=0;var ui=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");Ge.prepend($$g(ui)),or.css({width:zr+"mm",height:ti+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var _i=Math.max(0,mi/2),Ai=Math.max(0,Fr/2),ki=['<style type="text/css">',".hiprint-printTemplate{margin:-"+Ai+"mm -"+_i+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+Ai+"mm "+_i+"mm;}","</style>"].join("");Ge.prepend($$g(ki)),$$g(qe).css("position:fixed");var yi=Ae&&typeof Ae.leftOffset<"u"?Number(Ae.leftOffset):null,Hi=Ae&&typeof Ae.topOffset<"u"?Number(Ae.topOffset):null;if(yi!==null||Hi!==null){var Pi=wi*pi+(wi-1)*mi,Ri=Wr*ci+(Wr-1)*Fr,Vi=0,xi=0;yi===-1?Vi=Math.max(0,(zr-Pi)/2):yi>=0&&(Vi=yi),Hi===-1?xi=Math.max(0,(ti-Ri)/2):Hi>=0&&(xi=Hi),or.css({paddingLeft:Vi+"mm",paddingTop:xi+"mm"})}for(var Ti=Math.ceil(Br/Ci),vi=Promise.resolve(),aa=0;aa<Ti;aa++){var Ki=aa*Ci,na=Math.min(Ki+Ci,Br);(function(Sr,Jr,xr){vi=vi.then(function(){return pr.hide(),pr.slice(Sr,Jr).show(),html2canvas(or[0],tr).then(function(Qr){var Zr=Qr.getContext("2d");Zr.mozImageSmoothingEnabled=!1,Zr.webkitImageSmoothingEnabled=!1,Zr.msImageSmoothingEnabled=!1,Zr.imageSmoothingEnabled=!1,kr.push(Qr),hr&&hr(xr+1,Ti)})})})(Ki,na,aa)}vi.then(function(){if(pr.show(),ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Jr){Jr.style.transform=Je[Sr]||""})}catch{}Yr()})}else{var Mi=Ge.find(".hiprint-printPaper"),sr=Mi.length;sr===0&&(Mi=Ge.find(".hiprint-printTemplate"),sr=Mi.length||1);try{var wr=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!Ae||Ae.ignoreOffsets!==!1)&&wr.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var br='<style type="text/css">'+wr.join("")+"</style>";Ge.prepend($$g(br)),Mi.each(function(Sr,Jr){var xr=Jr.getAttribute("original-height");xr&&(Jr.style.height=xr+"mm")})}catch{}for(var Nr=Promise.resolve(),Pr=0;Pr<sr;Pr++)(function(Sr){Nr=Nr.then(function(){var Jr=Mi.eq(Sr),xr=Jr[0],Qr=$$g.extend({},tr);try{var Zr=xr.getBoundingClientRect(),ai=Math.max(1,Math.round(Zr.width)),Hr=Math.max(1,Math.round(Zr.height));Qr.width=ai,Qr.height=Hr}catch{Qr.width=Ar,Qr.height=Rr}return html2canvas(xr,Qr).then(function(ri){var Vr=ri.getContext("2d");Vr.mozImageSmoothingEnabled=!1,Vr.webkitImageSmoothingEnabled=!1,Vr.msImageSmoothingEnabled=!1,Vr.imageSmoothingEnabled=!1,kr.push(ri),hr&&hr(Sr+1,sr)})})})(Pr);Nr.then(function(){if(ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Jr){Jr.style.transform=Je[Sr]||""})}catch{}Yr()})}}return ke.promise()},_e.prototype.parentWidthHeight=function($e){return $e.style.width.endsWith("%")||$e.style.height.endsWith("%")?$e.className!="hiprint-printPaper-content"?this.parentWidthHeight($e.parentNode):{width:10,height:10}:{width:o.a.pt.toPx(parseFloat($e.style.width)),height:o.a.pt.toPx(parseFloat($e.style.height))}},_e.prototype.on=function($e,Ae){o.a.event.clear($e+"_"+this.id),o.a.event.on($e+"_"+this.id,Ae)},_e.prototype.clientIsOpened=function(){return hiwebSocket.opened},_e.prototype.getPrinterList=function(){var $e=hiwebSocket.getPrinterList();return $e||[]},_e.prototype.getElementByTid=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByTid($e)},_e.prototype.getElementByName=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByName($e)},_e.prototype.getPanel=function($e){return $e==null&&($e=0),this.printPanels[$e]},_e.prototype.loadAllImages=function($e,Ae,je){var ke=this;je==null&&(je=0);for(var Ie=$e[0].getElementsByTagName("img"),xe=!0,Be=0;Be<Ie.length;Be++){var Ce=Ie[Be];Ce.src&&Ce.src!==window.location.href&&Ce.src.indexOf("base64")==-1&&(Ce&&Ce.naturalWidth!==void 0&&Ce.naturalWidth!==0&&Ce.complete||(xe=!1))}je++,!xe&&je<10?setTimeout(function(){ke.loadAllImages($e,Ae,je)},500):Ae()},_e.prototype.setFontList=function($e){this.fontList=$e},_e.prototype.getFontList=function(){return this.fontList},_e.prototype.setFields=function($e){this.fields=$e},_e.prototype.getFields=function(){return this.fields},_e.prototype.setOnImageChooseClick=function($e){this.onImageChooseClick=$e},_e.prototype.getOnImageChooseClick=function(){return this.onImageChooseClick},_e.prototype.getHtmlStable=function($e){var Ae=this;return new Promise(function(je){var ke=$$g('<div style="position:fixed;left:-10000px;top:-10000px;visibility:hidden;z-index:-1;"></div>');$$g("body").append(ke);var Ie=Ae.getHtml($e);ke.html(Ie);var xe=function(Ee,Se){var Pe=0,Te=function(){for(var Me=Ee[0].getElementsByTagName("img"),Fe=!0,De=0;De<Me.length;De++){var Oe=Me[De];if(!Oe.complete||typeof Oe.naturalWidth<"u"&&Oe.naturalWidth===0){Fe=!1;break}}Pe++,!Fe&&Pe<20?setTimeout(Te,250):Se()};Te()},Be=function(Ee){try{document.fonts&&document.fonts.ready&&typeof document.fonts.ready.then=="function"?document.fonts.ready.then(function(){Ee()}).catch(function(){Ee()}):Ee()}catch{Ee()}},Ce=function(Ee,Se){var Pe=Date.now(),Te;try{Te=new ResizeObserver(function(){Pe=Date.now()}),Te.observe(Ee[0])}catch{Se();return}var Me=function(){if(Date.now()-Pe>=120){try{Te.disconnect()}catch{}Se()}else setTimeout(Me,60)};setTimeout(Me,120)};xe(ke,function(){Be(function(){Ce(ke,function(){var Ee=Ae.getHtml($e);ke.remove(),je(Ee)})})})})},_e.prototype.getFieldsInPanel=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e=$e.concat(Ae.getFieldsInPanel())}),$e},_e.prototype.getTestData=function(){var $e={};return this.printPanels.forEach(function(Ae){$e=Object.assign($e,Ae.getTestData())}),$e},_e.prototype.update=function($e,Ae){var je=this;try{if($e&&_typeof($e)=="object"&&$e.panels.length>0){var ke=je.printPanels.length-1;$e.panels.forEach(function(Ie,xe){if(xe>ke){je.printPanels.push(new pt(Ie,je.id));var Be=je.printPanels[xe];je.container.append(Be.getTarget()),xe>0&&Be.disable(),Be.design(je.designOptions),je.printPaginationCreator&&je.printPaginationCreator.buildPagination()}var Ce=new rt(Ie);je.editingPanel=je.printPanels[xe],je.editingPanel.update(Ce)}),je.selectPanel(Ae||0)}}catch(Ie){console.log(Ie),je.onUpdateError&&je.onUpdateError(Ie)}},_e.prototype.getSelectEls=function(){var $e=this,Ae=[];return $e.editingPanel.mouseRect&&$e.editingPanel.mouseRect.target&&$$g(".mouseRect").length?Ae=$e.editingPanel.getElementInRect($e.editingPanel.mouseRect):Ae=$e.editingPanel.printElements.filter(function(je){var ke=je&&je.designTarget&&je.designTarget.children&&je.designTarget.children().last(),Ie=ke&&ke.hasClass&&ke.hasClass("selected"),xe=ke&&ke.css&&ke.css("display")==="block",Be=je&&je.printElementType&&je.printElementType.type&&je.printElementType.type.includes("table");return!Be&&(xe||Ie)}),Ae},_e.prototype.updateOption=function($e,Ae){var je=this.getSelectEls();je&&je.length&&(je.forEach(function(ke){ke.updateOption($e,Ae,!0)}),o.a.event.trigger("hiprintTemplateDataChanged_"+this.id,"批量修改"))},_e.prototype.setElsAlign=function($e){var Ae=this,je=this.getSelectEls();if(je.length){var ke=this.editingPanel,Ie=ke&&ke.width,xe=ke&&ke.height,Be=["left","right","top","bottom","vertical","horizontal"].includes($e)&&Ie&&xe;if(Be)switch($e){case"left":je.forEach(function(Oe){Oe.updateSizeAndPositionOptions(0),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"vertical":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),Xe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,(Xe-Qe)/2);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"right":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),Xe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,Xe-Qe);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"top":je.forEach(function(Oe){var Qe=Ae.editingPanel&&Ae.editingPanel.paperHeader||0;Oe.updateSizeAndPositionOptions(void 0,Qe),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"horizontal":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperHeader||0,Ye=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,Xe=Math.max(0,Ye-We),rr=We+Math.max(0,(Xe-Qe)/2);Oe.updateSizeAndPositionOptions(void 0,rr),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"bottom":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,Ye=Math.max(0,We-Qe);Oe.updateSizeAndPositionOptions(void 0,Ye),Oe.designTarget.css("top",Oe.options.displayTop())});break}else{var Ce=Math.min.apply(null,je.map(function(Oe){return Oe.options.left})),Ee=Math.max.apply(null,je.map(function(Oe){return Oe.options.left+Oe.options.width})),Se=Math.min.apply(null,je.map(function(Oe){return Oe.options.top})),Pe=Math.max.apply(null,je.map(function(Oe){return Oe.options.top+Oe.options.height}));switch($e){case"distributeHor":var Te=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.width},0),Me=(Ee-Ce-Te)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.left-Qe.options.left}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(je[Qe-1].options.left+je[Qe-1].options.width+Me),Oe.designTarget.css("left",Oe.options.displayLeft()))});break;case"distributeVer":var Fe=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.height},0),De=(Pe-Se-Fe)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.top-Qe.options.top}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(void 0,je[Qe-1].options.top+je[Qe-1].options.height+De),Oe.designTarget.css("top",Oe.options.displayTop()))});break}}}},_e.prototype.setElsSpace=function($e,Ae){var je=this.getSelectEls();je.length&&(Ae?(je.sort(function(ke,Ie){return ke.options.left-Ie.options.left}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(je[Ie-1].options.left+je[Ie-1].options.width+$e),ke.designTarget.css("left",ke.options.displayLeft()))})):(je.sort(function(ke,Ie){return ke.options.top-Ie.options.top}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(void 0,je[Ie-1].options.top+je[Ie-1].options.height+$e),ke.designTarget.css("top",ke.options.displayTop()))})))},_e.prototype.setElsZIndex=function($e){var Ae=this.getSelectEls();if(!(!Ae||!Ae.length)){var je=function(Ce){var Ee=parseInt(Ce,10);return isNaN(Ee)?0:Ee},ke=function(Ce){if(!Ce)return 0;var Ee=Ce.options&&(Ce.options.zIndex||Ce.options["z-index"]);if(typeof Ee<"u")return je(Ee);var Se=Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index");return je(Se)},Ie=function(Ce,Ee){if(Ce&&(Ce.options&&(Ce.options.zIndex=Ee),Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index",Ee),typeof Ce.updateOption=="function"))try{Ce.updateOption("zIndex",Ee,!0)}catch{}},xe=999,Be=0;switch($e){case"top":Ae.forEach(function(Ce){Ie(Ce,xe)});break;case"bottom":Ae.forEach(function(Ce){Ie(Ce,Be)});break;case"up":Ae.forEach(function(Ce){Ie(Ce,ke(Ce)+1)});break;case"down":Ae.forEach(function(Ce){var Ee=ke(Ce)-1;Ie(Ce,Ee<0?0:Ee)});break;default:return}try{o.a.event.trigger("hiprintTemplateDataChanged_"+(this.id||this.templateId),"层级:"+$e)}catch{}}},_e.prototype.initAutoSave=function(){var $e=this;o.a.event.on("hiprintTemplateDataShortcutKey_"+this.id,function(Ae){if($e.history)switch(Ae){case"undo":if($e.historyPos>0){$e.historyPos-=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break;case"redo":if($e.historyPos<$e.historyList.length-1){$e.historyPos+=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break}}),o.a.event.on("hiprintTemplateDataChanged_"+this.id,function(Ae){if($e.history){var je=$e.dataMode==1?$e.getJson():$e.getJsonTid();$e.lastJson=je,$e.historyPos<$e.historyList.length-1&&($e.historyList=$e.historyList.slice(0,$e.historyPos+1)),$e.historyList.push({id:s.a.instance.guid(),type:Ae,json:je}),$e.historyList.length>50?$e.historyList=$e.historyList.slice(0,1).concat($e.historyList.slice(1,50)):$e.historyPos+=1,$e.onDataChanged&&$e.onDataChanged(Ae,je)}})},_e}();function ht(_e){this.getHtml(_e).hiwprint()}function ft(_e,$e,Ae){$$g.extend({},_e||{}).imgToBase64=!0;var je=new ct({});je.on("printSuccess",$e),je.on("printError",Ae),je.printByHtml2(this.getHtml(_e),_e.options)}function gt(_e){var $e=void 0;return _e&&_e.templates.forEach(function(Ae,je){var ke=$$g.extend({},Ae.options||{});_e.imgToBase64&&(ke.imgToBase64=!0),$e?$e.append(Ae.template.getHtml(Ae.data,ke).html()):$e=Ae.template.getHtml(Ae.data,ke)}),$e}function mt(_e){p.a.instance.init(_e),p.a.instance.providers&&p.a.instance.providers.forEach(function($e){$e.addElementTypes(a.instance)}),window.autoConnect&&(p.a.instance.host!=hiwebSocket.host||p.a.instance.token!=hiwebSocket.token)&&(hiwebSocket.stop(),p.a.instance.host&&(hiwebSocket.host=p.a.instance.host),p.a.instance.token&&(hiwebSocket.token=p.a.instance.token),hiwebSocket.start()),p.a.instance.lang&&Object.keys(languages).includes(p.a.instance.lang)?i18n.lang=p.a.instance.lang:i18n.lang="cn"}function cig(_e){_e?_e&&Object.keys(_e).forEach(function($e){if($e=="optionItems"&&_e.optionItems&&_e.optionItems.length)p.a.instance.registerItems(_e.optionItems);else if(_e[$e].tabs&&_e[$e].tabs.length)_e[$e].tabs.forEach(function(Ie,xe){if(Ie.replace)$$g.extend(p.a.instance[$e].tabs[xe],Ie);else{var Be=Ie.options,Ce=p.a.instance[$e].tabs[xe].options;Be.forEach(function(Ee){var Se=Ce.findIndex(function(Pe){return Pe.name==Ee.name});Se>-1?Ce[Se].hidden=Ee.hidden:Ee.after?(Se=Ce.findIndex(function(Pe){return Pe.name==Ee.after}),Se>-1&&Ce.splice(Se+1,0,Ee)):Ce.push(Ee)}),$$g.extend(p.a.instance[$e].tabs[xe],{name:Ie.name,options:Ce})}}),delete _e[$e].tabs;else if(_e[$e].supportOptions){var Ae=_e[$e].supportOptions,je=p.a.instance[$e].supportOptions;Ae.forEach(function(Ie){var xe=je.findIndex(function(Be){return Be.name==Ie.name});xe>-1?je[xe].hidden=Ie.hidden:Ie.after?(xe=je.findIndex(function(Be){return Be.name==Ie.after}),xe>-1&&je.splice(xe+1,0,Ie)):je.push(Ie)}),$$g.extend(p.a.instance[$e].supportOptions,je),delete _e[$e].supportOptions}else{var ke={};ke[$e]=_e[$e],$$g.extend(p.a.instance,ke)}}):$$g.extend(p.a.instance,HIPRINT_CONFIG)}function uep(_e,$e){return a.instance.updateElementType(_e,$e)}function rpl(_e){p.a.instance.clear("printerList"),p.a.instance.on("printerList",_e),hiwebSocket.refreshPrinterList()}function getClients(_e){p.a.instance.clear("clients"),p.a.instance.on("clients",_e),hiwebSocket.getClients()}function getClientInfo(_e){p.a.instance.clear("clientInfo"),p.a.instance.on("getClientInfo",_e),hiwebSocket.getClientInfo()}function getAddr(_e,$e,...Ae){p.a.instance.clear("address_"+_e),p.a.instance.on("address_"+_e,$e),hiwebSocket.getAddress(_e,...Ae)}function ippPrint(_e,$e,Ae){p.a.instance.clear("ippPrinterCallback"),p.a.instance.on("ippPrinterCallback",$e),p.a.instance.clear("ippPrinterConnected"),p.a.instance.on("ippPrinterConnected",Ae),hiwebSocket.ippPrint(_e)}function ippRequest(_e,$e){p.a.instance.clear("ippRequestCallback"),p.a.instance.on("ippRequestCallback",$e),hiwebSocket.ippRequest(_e)}n.d(e,"init",function(){return mt}),n.d(e,"setConfig",function(){return cig}),n.d(e,"updateElementType",function(){return uep}),n.d(e,"hiwebSocket",function(){return hiwebSocket}),n.d(e,"refreshPrinterList",function(){return rpl}),n.d(e,"getClients",function(){return getClients}),n.d(e,"getClientInfo",function(){return getClientInfo}),n.d(e,"getAddress",function(){return getAddr}),n.d(e,"ippPrint",function(){return ippPrint}),n.d(e,"ippRequest",function(){return ippRequest}),n.d(e,"PrintElementTypeManager",function(){return it}),n.d(e,"PrintElementTypeGroup",function(){return ot}),n.d(e,"PrintTemplate",function(){return ct}),n.d(e,"print",function(){return ht}),n.d(e,"print2",function(){return ft}),n.d(e,"getHtml",function(){return gt}),$$g(document).ready(function(){console.log("document ready"),console.log(window.autoConnect),hiwebSocket.hasIo()&&window.autoConnect&&hiwebSocket.start()})}]),defaultElementTypeProvider=defaultTypeProvider(hiprint);const version="1.0.15",_export_sfc=(_e,$e)=>{const Ae=_e.__vccOpts||_e;for(const[je,ke]of $e)Ae[je]=ke;return Ae},_hoisted_1$3={class:"vgp-designer-wrap"},_sfc_main$3={__name:"Designer",props:{template:{type:Object,default:()=>({})},printData:{type:Object,default:()=>({})},templateKey:{type:String,default:"default-template"},title:{type:String,default:""},designOptions:{type:Object,default:()=>({grid:!0,activePanel:!0})},autoConnect:{type:Boolean,default:!0},paperList:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},authKey:{type:String,default:""}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(null);function ke(Ee){setConfig(Ae.config),register({authKey:Ae.authKey,plugins:Ae.plugins}),je.value=createPrintTemplate({template:Ee}),je.value.design("#SVPrint",Ae.designOptions)}vue.onMounted(()=>{ke(Ae.template)}),vue.watch(()=>Ae.template,Ee=>{Ee&&ke(Ee)});function Ie(){return je.value}function xe(){return je.value?je.value.getJson():{}}function Be(Ee){je.value&&je.value.setJson(Ee)}function Ce(){return xe()}return $e({init:ke,getTarget:Ie,getTemplateJson:xe,setTemplateJson:Be,exportJson:Ce}),(Ee,Se)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[vue.renderSlot(Ee.$slots,"header",{},void 0,!0),Se[0]||(Se[0]=vue.createElementVNode("div",{id:"SVPrint",class:"vgp-designer-target"},null,-1)),vue.renderSlot(Ee.$slots,"other",{},void 0,!0)]))}},Designer=_export_sfc(_sfc_main$3,[["__scopeId","data-v-c3735ff8"]]),_hoisted_1$2={class:"vgp-header"},_hoisted_2$2={class:"left"},_hoisted_3$1=["innerHTML"],_hoisted_4$1={class:"title"},_hoisted_5={class:"center"},_hoisted_6={class:"right"},_sfc_main$2={__name:"Header",props:{logoHtml:{type:String,default:'<i class="svicon sv-print"></i>'},title:{type:String,default:"vg-print"},reEle:{type:[String,Boolean],default:!1},eleList:{type:Array,default:()=>[]},reMenu:{type:[String,Boolean],default:!1},menuList:{type:Array,default:()=>[]},onPreviewClick:{type:Function,default:null}},setup(_e,{expose:$e}){const Ae=_e;function je(ke){return typeof Ae.onPreviewClick=="function"?Ae.onPreviewClick(ke):!0}return $e({previewClick:je}),(ke,Ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[vue.renderSlot(ke.$slots,"headerLeft",{},()=>[vue.createElementVNode("span",{innerHTML:_e.logoHtml},null,8,_hoisted_3$1),vue.createElementVNode("span",_hoisted_4$1,vue.toDisplayString(_e.title),1)],!0)]),vue.createElementVNode("div",_hoisted_5,[vue.renderSlot(ke.$slots,"headerCenter",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(ke.$slots,"headerRight",{},void 0,!0)])]))}},Header=_export_sfc(_sfc_main$2,[["__scopeId","data-v-c71a08f5"]]),_hoisted_1$1={key:0,class:"vgp-preview-modal"},_hoisted_2$1={class:"vgp-preview-panel"},_hoisted_3={class:"tools"},_hoisted_4=["value"],_sfc_main$1={__name:"Preview",props:{printTemplate:{type:[Object],default:void 0},printData:{type:Object,default:void 0},printerList:{type:Array,default:()=>[]},selectedPrinter:{type:String,default:""},showPdf:{type:Boolean,default:!0},showImg:{type:Boolean,default:!0},showPrint2:{type:Boolean,default:!0},modalShow:{type:Boolean,default:!1}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(!1),ke=vue.ref(null),Ie=vue.ref([]),xe=vue.ref("");function Be(Qe,We){ke.value=Qe,Ce(We)}function Ce(Qe){if(!ke.value)return;const We=ke.value.getHtml(Qe),Ye=document.getElementById("preview_content_tasks");Ye&&(Ye.innerHTML=We)}function Ee(){je.value=!0}function Se(){je.value=!1}function Pe(){return ke.value}function Te(){ke.value&&ke.value.print(Ae.printData||{})}function Me(){ke.value&&ke.value.print2(Ae.printData||{},{printer:xe.value})}async function Fe(){ke.value&&await ke.value.toPdf(Ae.printData||{},"打印预览pdf")}async function De(){ke.value&&await ke.value.toImage(Ae.printData||{})}function Oe(){try{hiprint&&hiprint.hiwebSocket&&(Ie.value=hiprint.hiwebSocket.getPrinterList()||[])}catch{}}return $e({init:Be,show:Ee,hide:Se,getTarget:Pe,print:Te,directPrint:Me,toPdf:Fe,toImage:De,refreshPrinters:Oe}),vue.watch(()=>Ae.modalShow,Qe=>{je.value=!!Qe}),(Qe,We)=>je.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3,[_e.showPdf?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:Fe},"导出PDF")):vue.createCommentVNode("",!0),_e.showImg?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:De},"导出图片")):vue.createCommentVNode("",!0),_e.showPrint2?(vue.openBlock(),vue.createElementBlock("button",{key:2,onClick:Me},"直接打印")):vue.createCommentVNode("",!0),vue.createElementVNode("button",{onClick:Te},"浏览器打印"),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":We[0]||(We[0]=Ye=>xe.value=Ye)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ie.value,Ye=>(vue.openBlock(),vue.createElementBlock("option",{key:Ye.name,value:Ye.name},vue.toDisplayString(Ye.label||Ye.name),9,_hoisted_4))),128))],512),[[vue.vModelSelect,xe.value]]),vue.createElementVNode("button",{onClick:Oe},"刷新"),vue.createElementVNode("button",{onClick:Se},"关闭")]),We[1]||(We[1]=vue.createElementVNode("div",{id:"preview_content_tasks"},null,-1))])])):vue.createCommentVNode("",!0)}},Preview=_export_sfc(_sfc_main$1,[["__scopeId","data-v-9764769e"]]),_hoisted_1={class:"title"},_hoisted_2={class:"body"},_sfc_main={__name:"DragBox",props:{target:{type:String,default:"SVPrint"},dragKey:{type:String,default:"default"},dragStyle:{type:String,default:""},mode:{type:String,default:"default"},show:{type:Boolean,default:!1}},setup(_e){const $e=_e,Ae=vue.computed(()=>`mode-${$e.mode}`);return(je,ke)=>_e.show?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["vgp-dragbox",Ae.value]),style:vue.normalizeStyle(_e.dragStyle)},[vue.createElementVNode("div",_hoisted_1,[vue.renderSlot(je.$slots,"iconTitle",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2,[vue.renderSlot(je.$slots,"body",{},void 0,!0)])],6)):vue.createCommentVNode("",!0)}},DragBox=_export_sfc(_sfc_main,[["__scopeId","data-v-3bdcea45"]]);let autoConnect=function(_e){console.log("autoConnect"),window.autoConnect=!0,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.start(_e)},disAutoConnect=function(){console.log("disAutoConnect"),window.autoConnect=!1,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.stop()},hiPrintPlugin={disAutoConnect,install:function(_e,$e="$hiPrint",Ae=!0){Ae||disAutoConnect();let je=_e.prototype||_e.config.globalProperties;je[$e]=hiprint,je.$print=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print(...xe),Be},je.$print2=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print2(...xe),Be}}};hiprint.version=version;window.hiprint=hiprint;function register({authKey:_e="",plugins:$e=[]}={}){const Ae=$e.map(je=>typeof je=="function"?je():je).filter(Boolean);return Ae.length||Ae.push(new defaultElementTypeProvider),hiprint.init({providers:Ae}),hiprint.authKey=_e,hiprint}function setConfig(_e={}){return hiprint.config=_e,hiprint}function createPrintTemplate(_e={}){return new hiprint.PrintTemplate(_e)}function print({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print($e,Ae)}function print2({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print2($e,Ae)}async function toPdf({template:_e,data:$e,name:Ae,pdfOptions:je}={}){return _e.toPdf($e,Ae,je)}async function toImage({template:_e,data:$e,imageOptions:Ae}={}){return _e.toImage($e,Ae)}exports.Designer=Designer;exports.DragBox=DragBox;exports.Header=Header;exports.Preview=Preview;exports.autoConnect=autoConnect;exports.createPrintTemplate=createPrintTemplate;exports.defaultElementTypeProvider=defaultElementTypeProvider;exports.disAutoConnect=disAutoConnect;exports.hiPrintPlugin=hiPrintPlugin;exports.hiprint=hiprint;exports.print=print;exports.print2=print2;exports.register=register;exports.setConfig=setConfig;exports.toImage=toImage;exports.toPdf=toPdf;
@@ -56700,7 +56700,7 @@ ${i18n.__("转大小写")}
56700
56700
  console.log("document ready"), console.log(window.autoConnect), hiwebSocket.hasIo() && window.autoConnect && hiwebSocket.start();
56701
56701
  });
56702
56702
  }]), defaultElementTypeProvider = defaultTypeProvider(hiprint);
56703
- const version = "1.0.14", _export_sfc = (_e, $e) => {
56703
+ const version = "1.0.15", _export_sfc = (_e, $e) => {
56704
56704
  const Ae = _e.__vccOpts || _e;
56705
56705
  for (const [je, ke] of $e)
56706
56706
  Ae[je] = ke;
@@ -2038,6 +2038,6 @@ ${i18n.__("转大小写")}
2038
2038
  <div class="hiprint-option-item-label hiprint-option-title">
2039
2039
  `+$e.title+`
2040
2040
  </div>
2041
- </div>`),Ie.forEach(function(Ce){Ce.submit=function(Ee){$e.callback(je.getValueByOptionItems(Ie))},Be.append(Ce.createTarget(je.printTemplate,$e.options,void 0)),Ce.setValue($e.options[Ce.name],$e.options,void 0)}),Be.find(".auto-submit").change(function(Ce){$e.callback(je.getValueByOptionItems(Ie))}),Be.find(".auto-submit:input").bind("keydown.submitOption",function(Ce){Ce.keyCode==13&&$e.callback(je.getValueByOptionItems(Ie))}),ke.append(Be)},_e.prototype.getValueByOptionItems=function($e){var Ae={};return $e.forEach(function(je){Ae[je.name]=je.getValue()}),Ae},_e}(),dt=function(){function _e($e,Ae){this.paginationContainer=$e,this.jqPaginationContainer=$$g(this.paginationContainer),this.template=Ae}return _e.prototype.buildPagination=function($e){var Ae=this.template.getPaneltotal(),je=this;this.jqPaginationContainer.html("");for(var ke=$$g('<ul class="hiprint-pagination"></ul>'),Ie=function(){var Ee=xe,Se=je.template.printPanels[Ee].name||Ee+1,Pe=$$g("<li><span>"+Se+'</span><a href="javascript:void(0);">x</a></li>');Pe.find("span").click(function(){je.template.selectPanel(Ee),Pe.siblings().removeClass("selected"),$$g(this).parent("li").addClass("selected")}),Pe.find("a").click(function(){je.template.deletePanel(Ee),je.buildPagination()}),ke.append(Pe)},xe=0;xe<Ae;xe++)Ie();var Be=$$g("<li><span>+</span></li>");ke.append(Be),this.jqPaginationContainer.append(ke),Be.click(function(){var Ce=function(Se){je.template.addPrintPanel(Se||void 0,!0),je.buildPagination(),$$g(".hiprint-pagination li").removeClass("selected"),$$g(".hiprint-pagination li:nth-last-child(2)").addClass("selected")};if(je.template.onPanelAddClick){var Ee={index:je.template.printPanels.length,paperType:"A4"};je.template.onPanelAddClick(Ee,Ce)}else Ce()})},_e.prototype.selectPanel=function($e){var Ae=$e||this.template.editingPanel.index,je=$$g(".hiprint-pagination li:nth("+Ae+")");je.length&&(je.siblings().removeClass("selected"),je.addClass("selected")),hinnn.event.trigger("onSelectPanel",this.template.editingPanel,Ae,je)},_e}(),ct=function(){function _e($e){var Ae=this;this.tempimageBase64={},this.id=s.a.instance.guid(),s.a.instance.setPrintTemplateById(this.id,this);var je=$e||{};this.printPanels=[],this.dataMode=je.dataMode||1,this.history=je.history!=null?je.history:!0,this.onDataChanged=je.onDataChanged,this.onUpdateError=je.onUpdateError,this.lastJson=je.template||{},this.historyList=[{id:s.a.instance.guid(),type:"初始",json:this.lastJson}],this.historyPos=0,this.defaultPanelName=je.defaultPanelName,this.designOptions={};var ke=new st(je.template||[]);je.template&&ke.panels.forEach(function(Ie){Ae.printPanels.push(new pt(Ie,Ae.id))}),je.fontList&&(this.fontList=je.fontList),je.fields&&(this.fields=je.fields),je.onImageChooseClick&&(this.onImageChooseClick=je.onImageChooseClick),je.onPanelAddClick&&(this.onPanelAddClick=je.onPanelAddClick),je.settingContainer&&new ut(this,je.settingContainer),je.paginationContainer&&(this.printPaginationCreator=new dt(je.paginationContainer,this),this.printPaginationCreator.buildPagination()),this.initAutoSave()}return _e.prototype.design=function($e,Ae){var je=this;if(Ae||(Ae={}),this.printPanels.length==0){var ke=this.createDefaultPanel();this.printPanels.push(ke)}if(!$e)throw new Error("options.container can not be empty");je.designOptions=Ae,this.createContainer($e),this.printPanels.forEach(function(Ie,xe){je.container.append(Ie.getTarget()),xe>0&&Ie.disable(),Ie.design(Ae)}),this.selectPanel(0)},_e.prototype.getSimpleHtml=function($e,Ae){var je=this;Ae||(Ae={});var ke=$$g('<div class="hiprint-printTemplate"></div>');return $e&&$e.constructor===Array?$e.forEach(function(Ie,xe){Ie&&je.printPanels.forEach(function(Be,Ce){ke.append(Be.getHtml(Ie,Ae)),xe==$e.length-1&&delete hinnn._paperList})}):this.printPanels.forEach(function(Ie,xe){ke.append(Ie.getHtml($e,Ae)),xe==je.printPanels.length-1&&delete hinnn._paperList}),Ae&&Ae.imgToBase64&&this.transformImg(ke.find("img")),ke},_e.prototype.getHtml=function($e,Ae){return $e||($e={}),this.getSimpleHtml($e,Ae)},_e.prototype.getJointHtml=function($e,Ae,je){var ke=$$g('<div class="hiprint-printTemplate"></div>'),Ie=[];return this.printPanels.forEach(function(xe,Be){ke.append(xe.getHtml($e,Ae,Ie,void 0,je))}),ke},_e.prototype.setPaper=function($e,Ae){if(/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test($e))this.editingPanel.resize(void 0,parseFloat($e),parseFloat(Ae),!1);else{var je=s.a.instance[$e];if(!je)throw new Error("not found pagetype:"+($e||""));this.editingPanel.resize($e,je.width,je.height,!1)}},_e.prototype.rotatePaper=function(){this.editingPanel.rotatePaper()},_e.prototype.zoom=function($e,Ae){this.editingPanel.zoom($e,Ae)},_e.prototype.addPrintPanel=function($e,Ae){var je=$e?new pt(new rt($e),this.id):this.createDefaultPanel();return $e&&($e.index=this.printPanels.length),Ae&&(this.container.append(je.getTarget()),je.design(this.designOptions)),this.printPanels.push(je),Ae&&this.selectPanel(je.index),je},_e.prototype.selectPanel=function($e){var Ae=this;$e>Ae.printPanels.length-1&&($e=Ae.printPanels.length-1),this.printPanels.forEach(function(je,ke){$e==ke?(je.enable(),Ae.editingPanel=je,Ae.printPaginationCreator&&Ae.printPaginationCreator.selectPanel($e)):je.disable()})},_e.prototype.deletePanel=function($e){this.printPanels[$e].clear(),this.printPanels[$e].getTarget().remove(),this.printPanels.splice($e,1)},_e.prototype.getPaneltotal=function(){return this.printPanels.length},_e.prototype.createDefaultPanel=function(){return new pt(new rt({index:this.printPanels.length,name:this.defaultPanelName,paperType:"A4"}),this.id)},_e.prototype.createContainer=function($e){$e?(this.container=$$g($e),this.container.addClass("hiprint-printTemplate")):this.container=$$g('<div class="hiprint-printTemplate"></div>')},_e.prototype.getJsonTid=function(){var $e=[];return this.printPanels.forEach(function(Ae){Ae.getPanelEntity().printElements.length&&$e.push(Ae.getPanelEntity())}),new st({panels:$e})},_e.prototype.getJson=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e.push(Ae.getPanelEntity(!0))}),new st({panels:$e})},_e.prototype.undo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"undo")},_e.prototype.redo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"redo")},_e.prototype.getPrintElementSelectEventKey=function(){return"PrintElementSelectEventKey_"+this.id},_e.prototype.getBuildCustomOptionSettingEventKey=function(){return"BuildCustomOptionSettingEventKey_"+this.id},_e.prototype.clear=function(){this.printPanels.forEach(function($e){if($e.clear(),$e.index>0){var Ae=$e.getTarget();Ae&&Ae.length&&Ae.remove()}}),this.printPanels=[this.printPanels[0]],this.printPaginationCreator&&this.printPaginationCreator.buildPagination()},_e.prototype.getPaperType=function($e){return this.printPanels[0].paperType},_e.prototype.getOrient=function($e){return $e==null&&($e=0),this.printPanels[$e].height>this.printPanels[$e].width?1:2},_e.prototype.getPrintStyle=function($e){return this.printPanels[$e].getPrintStyle()},_e.prototype.print=function($e,Ae,je){$e||($e={});try{if(typeof this.getHtmlStable=="function"){var ke=this;return this.getHtmlStable($e).then(function(Ie){var xe=$$g("<div></div>");xe.html(Ie),xe.hiwprint(je)}).catch(function(){ke.getHtml($e,Ae).hiwprint(je)})}}catch{}this.getHtml($e,Ae).hiwprint(je)},_e.prototype.print2=function($e,Ae){if($e||($e={}),Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]'),Be="";if(Ae.styleHandler&&(Be+=Ae.styleHandler()),xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Ce,Ee){var Se=new XMLHttpRequest;Se.open("GET",$$g(Ee).attr("href")),Se.onreadystatechange=function(){if(Se.readyState===4&&Se.status===200&&(Ie[Ce+""]='<style rel="stylesheet" type="text/css">'+Se.responseText+"</style>",++ke==xe.length)){for(var Pe="",Me=0;Me<xe.length;Me++)Pe+=Ie[Me+""];Be&&(Pe=Be+Pe),je.sentToClient(Pe,$e,Ae)}},Se.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.imageToBase64=function($e){var Ae=$$g($e).attr("src");if(Ae.indexOf("base64")==-1)try{if(!this.tempimageBase64[Ae]){var je=document.createElement("canvas"),ke=new Image;ke.src=$e.attr("src"),je.width=ke.width,je.height=ke.height,je.getContext("2d").drawImage(ke,0,0),Ae&&(this.tempimageBase64[Ae]=je.toDataURL("image/png"))}$e.attr("src",this.tempimageBase64[Ae])}catch{try{this.xhrLoadImage($e)}catch(xe){console.log(xe)}}},_e.prototype.xhrLoadImage=function($e){},_e.prototype.sentToClient=function($e,Ae,je){Ae||(Ae={});var ke=$$g.extend({},je||{});ke.imgToBase64=!0;var Ie=$e+this.getHtml(Ae,ke)[0].outerHTML;ke.id=s.a.instance.guid(),ke.html=Ie,ke.templateId=this.id,hiwebSocket.send(ke)},_e.prototype.printByHtml=function($e){$$g($e).hiwprint()},_e.prototype.printByHtml2=function($e,Ae){if(Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]');if(xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Be,Ce){var Ee=new XMLHttpRequest;Ee.open("GET",$$g(Ce).attr("href")),Ee.onreadystatechange=function(){if(Ee.readyState===4&&Ee.status===200&&(Ie[Be+""]='<style rel="stylesheet" type="text/css">'+Ee.responseText+"</style>",++ke==xe.length)){for(var Se="",Pe=0;Pe<xe.length;Pe++)Se+=Ie[Pe+""];var Me=Se+$$g($e)[0].outerHTML,Te=$$g.extend({},Ae||{});Te.id=s.a.instance.guid(),Te.html=Me,Te.templateId=je.id,hiwebSocket.send(Te)}},Ee.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.deletePrintElement=function($e){this.printPanels.forEach(function(Ae){Ae.deletePrintElement($e)})},_e.prototype.transformImg=function($e){var Ae=this;$e.map(function(je,ke){Ae.imageToBase64($$g(ke))})},_e.prototype.toPdf=function($e,Ae,je){var ke=this,Ie=$$g.Deferred(),xe=!0;if(this.printPanels.length){var Be=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Ce=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Ee=o.a.mm.toPt(Be),Se=o.a.mm.toPt(Ce),Pe=Ee,Me=Se,Te=this.getOrient(0)==1?"portrait":"landscape";if(je&&(je.paperWidth||je.paperHeight)){var Fe=je.paperWidth,He=je.paperHeight;Fe&&He&&(Pe=o.a.mm.toPt(Fe),Me=o.a.mm.toPt(He))}else if(je&&je.usePaperType===!0&&this.printPanels[0].paperType){var Oe=this.printPanels[0].paperType.toString().toLowerCase(),Qe=null,We=null;Oe==="a4"?(Qe=210,We=297):Oe==="a5"?(Qe=148,We=210):Oe==="a3"&&(Qe=297,We=420),Qe&&We&&(Pe=o.a.mm.toPt(Qe),Me=o.a.mm.toPt(We))}if(Te==="landscape"){var Ye=Pe;Pe=Me,Me=Ye}var qe=$$g.extend({scale:2,width:o.a.pt.toPx(Pe),height:o.a.pt.toPx(Me),x:0,y:0,useCORS:!0},je||{});je&&typeof je.pixelRatio<"u"?qe.scale=je.pixelRatio:je&&typeof je.scale<"u"&&(qe.scale=je.scale),qe.width=o.a.pt.toPx(Pe),qe.height=o.a.pt.toPx(Me);var rr=new E$1({orientation:Te,unit:"pt",format:[Pe,Me]}),Ze=this.getHtml($e,je);je&&je.isDownload!=null&&(xe=je.isDownload),(!Ae||Ae===void 0)&&je&&je.name&&(Ae=je.name);var Ke=je&&typeof je.onProgress=="function"?je.onProgress:null;this.createTempContainer();var St=this.getTempContainer();this.svg2canvas(Ze),St.html(Ze[0]);var tr=[],Xe=je&&typeof je.removeTransform<"u"?!!je.removeTransform:!0;if(Xe)try{var Ge=St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");Ge.each(function(Ni,sr){tr[Ni]=sr.style.transform,sr.style.transform="",sr.style.zoom&&(sr.style.zoom=1)})}catch{}if(!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0))try{var Je=St.find(".hiprint-printPaper").eq(0)[0],ir=St.find(".hiprint-printPanel").eq(0)[0],ar=Je||ir;if(ar){var lr=ar.getBoundingClientRect();lr&&lr.width&&lr.height&&(Pe=o.a.px.toPt(Math.round(lr.width)),Me=o.a.px.toPt(Math.round(lr.height)),qe.width=o.a.pt.toPx(Pe),qe.height=o.a.pt.toPx(Me),rr=new E$1({orientation:Te,unit:"pt",format:[Pe,Me]}))}}catch{}var gr=St.find(".hiprint-printTemplate"),dr=gr.find(".hiprint-printPanel"),hr=$e&&$e.constructor===Array?$e.length:null,kr=hr!=null?Math.min(hr,dr.length):dr.length,Ar=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{};Ar.layoutType||je&&je.layoutType;var Qr=Number(Ar.layoutRowGap||je&&je.rowGapMm||0),or=Number(Ar.layoutColumnGap||je&&je.colGapMm||0),cr=o.a.pt.toMm(Pe),mr=o.a.pt.toMm(Me),wr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||cr,Tr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||mr,Pr=Math.max(1,Math.floor((cr+or)/(wr+or))),Lr=Math.max(1,Math.floor((mr+Qr)/(Tr+Qr))),Rr=Math.max(1,Pr*Lr),Vr=!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0);Vr&&(Rr=1);var Xr=Math.max(1,je&&je.perPage||Rr);if(Xr=Math.min(Xr,kr),Xr>1&&kr>1){var _i=or;if(Pr>1){var ui=(cr-Pr*wr)/(Pr-1);ui>=0&&(_i=ui)}else _i=0;var xi=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");St.prepend($$g(xi));var gr=St.find(".hiprint-printTemplate");gr.css({width:cr+"mm",height:mr+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var Wr=Math.max(0,_i/2),Cr=Math.max(0,Qr/2),Mi=['<style type="text/css">',".hiprint-printTemplate{margin:-"+Cr+"mm -"+Wr+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+Cr+"mm "+Wr+"mm;}","</style>"].join("");St.prepend($$g(Mi)),$$g(Ze).css("position:fixed");var wi=je&&typeof je.leftOffset<"u"?Number(je.leftOffset):null,si=je&&typeof je.topOffset<"u"?Number(je.topOffset):null;if(wi!==null||si!==null){var fi=Pr*wr+(Pr-1)*_i,gi=Lr*Tr+(Lr-1)*Qr,li=0,yi=0;wi===-1?li=Math.max(0,(cr-fi)/2):wi>=0&&(li=wi),si===-1?yi=Math.max(0,(mr-gi)/2):si>=0&&(yi=si),gr.css({paddingLeft:li+"mm",paddingTop:yi+"mm"})}for(var Ei=Math.ceil(kr/Xr),Li=Promise.resolve(),Fi=0;Fi<Ei;Fi++){var Oi=Fi*Xr,Vi=Math.min(Oi+Xr,kr);(function(sr,yr,jr){Li=Li.then(function(){return console.log("处理页面",jr+1,"数据范围:",sr,"到",yr-1),dr.hide(),dr.slice(sr,yr).show(),html2canvas(gr[0],qe).then(function(Fr){var Ur=Fr.getContext("2d");Ur.mozImageSmoothingEnabled=!1,Ur.webkitImageSmoothingEnabled=!1,Ur.msImageSmoothingEnabled=!1,Ur.imageSmoothingEnabled=!1;var Jr=Fr.toDataURL("image/jpeg");rr.addImage(Jr,"JPEG",0,0,Pe,Me),jr<Ei-1&&rr.addPage(),Ke&&Ke(jr+1,Ei)})})})(Oi,Vi,Fi)}Li.then(function(){dr.show();try{Ge.each(function(yr,jr){jr.style.transform=tr[yr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let yr=je.type||"blob";var sr=rr.output(yr);Ie.resolve(sr)}})}else{var Si=St.find(".hiprint-printPaper"),Di=Si.length;Di===0&&(Si=St.find(".hiprint-printTemplate"),Di=Si.length||1);try{var ji=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!je||je.ignoreOffsets!==!1)&&ji.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var oa='<style type="text/css">'+ji.join("")+"</style>";St.prepend($$g(oa)),Si.each(function(Ni,sr){var yr=sr.getAttribute("original-height");yr&&(sr.style.height=yr+"mm")})}catch{}for(var Xi=Promise.resolve(),na=0;na<Di;na++)(function(Ni){Xi=Xi.then(function(){var sr=Si.eq(Ni),yr=sr[0],jr=$$g.extend({},qe);return jr.width=o.a.pt.toPx(Pe),jr.height=o.a.pt.toPx(Me),html2canvas(yr,jr).then(function(Fr){var Ur=Fr.getContext("2d");Ur.mozImageSmoothingEnabled=!1,Ur.webkitImageSmoothingEnabled=!1,Ur.msImageSmoothingEnabled=!1,Ur.imageSmoothingEnabled=!1;var Jr=Fr.toDataURL("image/jpeg");rr.addImage(Jr,"JPEG",0,0,Pe,Me),Ni<Di-1&&rr.addPage(),Ke&&Ke(Ni+1,Di)})})})(na);Xi.then(function(){if(Xe)try{St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(sr,yr){yr.style.transform=tr[sr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let sr=je.type||"blob";var Ni=rr.output(sr);Ie.resolve(Ni)}})}}return Ie.promise()},_e.prototype.createTempContainer=function(){this.removeTempContainer(),$$g("body").prepend($$g('<div class="hiprint_temp_Container" style="overflow:hidden;height: 0px;box-sizing: border-box;"></div>'))},_e.prototype.removeTempContainer=function(){$$g(".hiprint_temp_Container").remove()},_e.prototype.getTempContainer=function(){return $$g(".hiprint_temp_Container")},_e.prototype.svg2canvas=function($e){var Ae=this;$e.find("svg").each(function(je,ke){var Ie=ke.parentNode,xe=Ae.parentWidthHeight(Ie),Be=document.createElement("canvas");Be.width=xe.width,Be.height=xe.height;var Ce=Be.getContext("2d"),Ee=new XMLSerializer().serializeToString(ke);Canvg.fromString(Ce,Ee).render(),$$g(ke).before(Be),Ie.removeChild(ke)})},_e.prototype.toImage=function($e,Ae){var je=this,ke=$$g.Deferred(),Ie=!1,xe=Ae&&Ae.name||"image",Be=Ae&&Ae.type||"image/jpeg",Ce=Ae&&typeof Ae.quality<"u"?Ae.quality:.92,Ee=Ae&&Ae.toType||"url",Se=Ae&&typeof Ae.limit<"u"?Number(Ae.limit):10,Pe=Se<=0?Number.MAX_SAFE_INTEGER:Se;if(Ae&&Ae.isDownload!=null&&(Ie=Ae.isDownload),this.printPanels.length){let Jr=function(){je.removeTempContainer();var Sr=[],Kr=[],Ir="jpg";if(Be.indexOf("png")>-1?Ir="png":Be.indexOf("webp")>-1?Ir="webp":Be.indexOf("bmp")>-1&&(Ir="bmp"),Rr){for(var Or=Promise.resolve(),Yr=0;Yr<kr.length;Yr++)(function(Gr){Or=Or.then(function(){var ni=kr[Gr],qr=xe;return qr=qr+"-"+(Gr+1)+"."+Ir,Kr.push(qr),new Promise(function(ai){if(Ee==="blob")ni.toBlob(function(Ii){Sr.push(Ii),ai()},Be,Ce);else{var mi=ni.toDataURL(Be,Ce);Sr.push(mi),ai()}})})})(Yr);Or.then(function(){if(Ie)for(var Gr=0;Gr<Sr.length;Gr++){var ni=Sr[Gr],qr=ni;Ee==="blob"&&(qr=URL.createObjectURL(ni));var ai=document.createElement("a");if(ai.href=qr,ai.download=Kr[Gr],document.body.appendChild(ai),ai.click(),document.body.removeChild(ai),Ee==="blob")try{URL.revokeObjectURL(qr)}catch{}}ke.resolve(Sr)});return}for(var $i=[],Hr=0;Hr<kr.length;Hr+=Pe)$i.push(kr.slice(Hr,Math.min(Hr+Pe,kr.length)));for(var ti=Promise.resolve(),Zr=0;Zr<$i.length;Zr++)(function(Gr){ti=ti.then(function(){for(var ni=$i[Gr],qr=document.createElement("canvas"),ai=0,mi=0,Ii=0;Ii<ni.length;Ii++)ai=Math.max(ai,ni[Ii].width),mi+=ni[Ii].height;qr.width=Math.max(1,ai),qr.height=Math.max(1,mi);var Hi=qr.getContext("2d");Hi.fillStyle="#ffffff",Hi.fillRect(0,0,qr.width,qr.height),Hi.mozImageSmoothingEnabled=!1,Hi.webkitImageSmoothingEnabled=!1,Hi.msImageSmoothingEnabled=!1,Hi.imageSmoothingEnabled=!1;for(var Zi=0,Gi=0;Gi<ni.length;Gi++){var Ai=ni[Gi];Hi.drawImage(Ai,0,Zi,Ai.width,Ai.height),Zi+=Ai.height}var Ti=xe;return Ti=Ti+"-"+(Gr+1)+"."+Ir,Kr.push(Ti),new Promise(function(Ui){if(Ee==="blob")qr.toBlob(function(ea){Sr.push(ea),Ui()},Be,Ce);else{var Ri=qr.toDataURL(Be,Ce);Sr.push(Ri),Ui()}})})})(Zr);ti.then(function(){if(Ie)for(var Gr=0;Gr<Sr.length;Gr++){var ni=Sr[Gr],qr=ni;Ee==="blob"&&(qr=URL.createObjectURL(ni));var ai=document.createElement("a");if(ai.href=qr,ai.download=Kr[Gr],document.body.appendChild(ai),ai.click(),document.body.removeChild(ai),Ee==="blob")try{URL.revokeObjectURL(qr)}catch{}}ke.resolve(Sr)})};var Me=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Te=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Fe=o.a.mm.toPt(Me),He=o.a.mm.toPt(Te),Oe=Fe,Qe=He,We=this.getOrient(0)==1?"portrait":"landscape";if(Ae&&(Ae.paperWidth||Ae.paperHeight)){var Ye=Ae.paperWidth,qe=Ae.paperHeight;Ye&&qe&&(Oe=o.a.mm.toPt(Ye),Qe=o.a.mm.toPt(qe))}else if(Ae&&Ae.usePaperType===!0&&this.printPanels[0].paperType){var rr=this.printPanels[0].paperType.toString().toLowerCase(),Ze=null,Ke=null;rr==="a4"?(Ze=210,Ke=297):rr==="a5"?(Ze=148,Ke=210):rr==="a3"&&(Ze=297,Ke=420),Ze&&Ke&&(Oe=o.a.mm.toPt(Ze),Qe=o.a.mm.toPt(Ke))}if(We==="landscape"){var St=Oe;Oe=Qe,Qe=St}var tr=$$g.extend({scale:2,width:o.a.pt.toPx(Oe),height:o.a.pt.toPx(Qe),x:0,y:0,useCORS:!0},Ae||{});Ae&&typeof Ae.pixelRatio<"u"?tr.scale=Ae.pixelRatio:Ae&&typeof Ae.scale<"u"&&(tr.scale=Ae.scale),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe);var Xe=this.getHtml($e,Ae);this.createTempContainer();var Ge=this.getTempContainer();this.svg2canvas(Xe),Ge.html(Xe[0]);var Je=[],ir=Ae&&typeof Ae.removeTransform<"u"?!!Ae.removeTransform:!0;if(ir)try{var ar=Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");ar.each(function(Sr,Kr){Je[Sr]=Kr.style.transform,Kr.style.transform="",Kr.style.zoom&&(Kr.style.zoom=1)})}catch{}if(!(Ae&&(Ae.paperWidth||Ae.paperHeight))&&!(Ae&&Ae.usePaperType===!0))try{var lr=Ge.find(".hiprint-printPanel").eq(0)[0],gr=lr||Ge.find(".hiprint-printPaper").eq(0)[0];if(gr){var dr=gr.getBoundingClientRect();dr&&dr.width&&dr.height&&(Oe=o.a.px.toPt(Math.round(dr.width)),Qe=o.a.px.toPt(Math.round(dr.height)),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe))}}catch{}var hr=Ae&&typeof Ae.onProgress=="function"?Ae.onProgress:null,kr=[],Ar=o.a.pt.toPx(Oe),Qr=o.a.pt.toPx(Qe),or=Ge.find(".hiprint-printTemplate"),cr=or.find(".hiprint-printPanel"),mr=$e&&$e.constructor===Array?$e.length:null,wr=mr!=null?Math.min(mr,cr.length):cr.length,Tr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{},Pr=Number(Tr.layoutRowGap||Ae&&Ae.rowGapMm||0),Lr=Number(Tr.layoutColumnGap||Ae&&Ae.colGapMm||0),Rr=!!(Ae&&(Ae.paperWidth&&Ae.paperHeight||Ae.usePaperType===!0));if(Rr){var Vr=o.a.pt.toMm(Oe),Xr=o.a.pt.toMm(Qe),_i=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||Vr,ui=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||Xr,xi=Math.max(1,Math.floor((Vr+Lr)/(_i+Lr))),Wr=Math.max(1,Math.floor((Xr+Pr)/(ui+Pr))),Cr=Math.max(1,xi*Wr),Mi=Se>0?Math.max(1,Math.min(Se,wr)):Math.max(1,Cr),wi=Lr;if(xi>1){var si=(Vr-xi*_i)/(xi-1);si>=0&&(wi=si)}else wi=0;var fi=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");Ge.prepend($$g(fi)),or.css({width:Vr+"mm",height:Xr+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var gi=Math.max(0,wi/2),li=Math.max(0,Pr/2),yi=['<style type="text/css">',".hiprint-printTemplate{margin:-"+li+"mm -"+gi+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+li+"mm "+gi+"mm;}","</style>"].join("");Ge.prepend($$g(yi)),$$g(Xe).css("position:fixed");var Ei=Ae&&typeof Ae.leftOffset<"u"?Number(Ae.leftOffset):null,Li=Ae&&typeof Ae.topOffset<"u"?Number(Ae.topOffset):null;if(Ei!==null||Li!==null){var Fi=xi*_i+(xi-1)*wi,Oi=Wr*ui+(Wr-1)*Pr,Vi=0,Si=0;Ei===-1?Vi=Math.max(0,(Vr-Fi)/2):Ei>=0&&(Vi=Ei),Li===-1?Si=Math.max(0,(Xr-Oi)/2):Li>=0&&(Si=Li),or.css({paddingLeft:Vi+"mm",paddingTop:Si+"mm"})}for(var Di=Math.ceil(wr/Mi),ji=Promise.resolve(),oa=0;oa<Di;oa++){var Xi=oa*Mi,na=Math.min(Xi+Mi,wr);(function(Sr,Kr,Ir){ji=ji.then(function(){return cr.hide(),cr.slice(Sr,Kr).show(),html2canvas(or[0],tr).then(function(Or){var Yr=Or.getContext("2d");Yr.mozImageSmoothingEnabled=!1,Yr.webkitImageSmoothingEnabled=!1,Yr.msImageSmoothingEnabled=!1,Yr.imageSmoothingEnabled=!1,kr.push(Or),hr&&hr(Ir+1,Di)})})})(Xi,na,oa)}ji.then(function(){if(cr.show(),ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Kr){Kr.style.transform=Je[Sr]||""})}catch{}Jr()})}else{var Ni=Ge.find(".hiprint-printPaper"),sr=Ni.length;sr===0&&(Ni=Ge.find(".hiprint-printTemplate"),sr=Ni.length||1);try{var yr=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!Ae||Ae.ignoreOffsets!==!1)&&yr.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var jr='<style type="text/css">'+yr.join("")+"</style>";Ge.prepend($$g(jr)),Ni.each(function(Sr,Kr){var Ir=Kr.getAttribute("original-height");Ir&&(Kr.style.height=Ir+"mm")})}catch{}for(var Fr=Promise.resolve(),Ur=0;Ur<sr;Ur++)(function(Sr){Fr=Fr.then(function(){var Kr=Ni.eq(Sr),Ir=Kr[0],Or=$$g.extend({},tr);try{var Yr=Ir.getBoundingClientRect(),$i=Math.max(1,Math.round(Yr.width)),Hr=Math.max(1,Math.round(Yr.height));Or.width=$i,Or.height=Hr}catch{Or.width=Ar,Or.height=Qr}return html2canvas(Ir,Or).then(function(ti){var Zr=ti.getContext("2d");Zr.mozImageSmoothingEnabled=!1,Zr.webkitImageSmoothingEnabled=!1,Zr.msImageSmoothingEnabled=!1,Zr.imageSmoothingEnabled=!1,kr.push(ti),hr&&hr(Sr+1,sr)})})})(Ur);Fr.then(function(){if(ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Kr){Kr.style.transform=Je[Sr]||""})}catch{}Jr()})}}return ke.promise()},_e.prototype.parentWidthHeight=function($e){return $e.style.width.endsWith("%")||$e.style.height.endsWith("%")?$e.className!="hiprint-printPaper-content"?this.parentWidthHeight($e.parentNode):{width:10,height:10}:{width:o.a.pt.toPx(parseFloat($e.style.width)),height:o.a.pt.toPx(parseFloat($e.style.height))}},_e.prototype.on=function($e,Ae){o.a.event.clear($e+"_"+this.id),o.a.event.on($e+"_"+this.id,Ae)},_e.prototype.clientIsOpened=function(){return hiwebSocket.opened},_e.prototype.getPrinterList=function(){var $e=hiwebSocket.getPrinterList();return $e||[]},_e.prototype.getElementByTid=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByTid($e)},_e.prototype.getElementByName=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByName($e)},_e.prototype.getPanel=function($e){return $e==null&&($e=0),this.printPanels[$e]},_e.prototype.loadAllImages=function($e,Ae,je){var ke=this;je==null&&(je=0);for(var Ie=$e[0].getElementsByTagName("img"),xe=!0,Be=0;Be<Ie.length;Be++){var Ce=Ie[Be];Ce.src&&Ce.src!==window.location.href&&Ce.src.indexOf("base64")==-1&&(Ce&&Ce.naturalWidth!==void 0&&Ce.naturalWidth!==0&&Ce.complete||(xe=!1))}je++,!xe&&je<10?setTimeout(function(){ke.loadAllImages($e,Ae,je)},500):Ae()},_e.prototype.setFontList=function($e){this.fontList=$e},_e.prototype.getFontList=function(){return this.fontList},_e.prototype.setFields=function($e){this.fields=$e},_e.prototype.getFields=function(){return this.fields},_e.prototype.setOnImageChooseClick=function($e){this.onImageChooseClick=$e},_e.prototype.getOnImageChooseClick=function(){return this.onImageChooseClick},_e.prototype.getHtmlStable=function($e){var Ae=this;return new Promise(function(je){var ke=$$g('<div style="position:fixed;left:-10000px;top:-10000px;visibility:hidden;z-index:-1;"></div>');$$g("body").append(ke);var Ie=Ae.getHtml($e);ke.html(Ie);var xe=function(Ee,Se){var Pe=0,Me=function(){for(var Te=Ee[0].getElementsByTagName("img"),Fe=!0,He=0;He<Te.length;He++){var Oe=Te[He];if(!Oe.complete||typeof Oe.naturalWidth<"u"&&Oe.naturalWidth===0){Fe=!1;break}}Pe++,!Fe&&Pe<20?setTimeout(Me,250):Se()};Me()},Be=function(Ee){try{document.fonts&&document.fonts.ready&&typeof document.fonts.ready.then=="function"?document.fonts.ready.then(function(){Ee()}).catch(function(){Ee()}):Ee()}catch{Ee()}},Ce=function(Ee,Se){var Pe=Date.now(),Me;try{Me=new ResizeObserver(function(){Pe=Date.now()}),Me.observe(Ee[0])}catch{Se();return}var Te=function(){if(Date.now()-Pe>=120){try{Me.disconnect()}catch{}Se()}else setTimeout(Te,60)};setTimeout(Te,120)};xe(ke,function(){Be(function(){Ce(ke,function(){var Ee=Ae.getHtml($e);ke.remove(),je(Ee)})})})})},_e.prototype.getFieldsInPanel=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e=$e.concat(Ae.getFieldsInPanel())}),$e},_e.prototype.getTestData=function(){var $e={};return this.printPanels.forEach(function(Ae){$e=Object.assign($e,Ae.getTestData())}),$e},_e.prototype.update=function($e,Ae){var je=this;try{if($e&&_typeof$1($e)=="object"&&$e.panels.length>0){var ke=je.printPanels.length-1;$e.panels.forEach(function(Ie,xe){if(xe>ke){je.printPanels.push(new pt(Ie,je.id));var Be=je.printPanels[xe];je.container.append(Be.getTarget()),xe>0&&Be.disable(),Be.design(je.designOptions),je.printPaginationCreator&&je.printPaginationCreator.buildPagination()}var Ce=new rt(Ie);je.editingPanel=je.printPanels[xe],je.editingPanel.update(Ce)}),je.selectPanel(Ae||0)}}catch(Ie){console.log(Ie),je.onUpdateError&&je.onUpdateError(Ie)}},_e.prototype.getSelectEls=function(){var $e=this,Ae=[];return $e.editingPanel.mouseRect&&$e.editingPanel.mouseRect.target&&$$g(".mouseRect").length?Ae=$e.editingPanel.getElementInRect($e.editingPanel.mouseRect):Ae=$e.editingPanel.printElements.filter(function(je){var ke=je&&je.designTarget&&je.designTarget.children&&je.designTarget.children().last(),Ie=ke&&ke.hasClass&&ke.hasClass("selected"),xe=ke&&ke.css&&ke.css("display")==="block",Be=je&&je.printElementType&&je.printElementType.type&&je.printElementType.type.includes("table");return!Be&&(xe||Ie)}),Ae},_e.prototype.updateOption=function($e,Ae){var je=this.getSelectEls();je&&je.length&&(je.forEach(function(ke){ke.updateOption($e,Ae,!0)}),o.a.event.trigger("hiprintTemplateDataChanged_"+this.id,"批量修改"))},_e.prototype.setElsAlign=function($e){var Ae=this,je=this.getSelectEls();if(je.length){var ke=this.editingPanel,Ie=ke&&ke.width,xe=ke&&ke.height,Be=["left","right","top","bottom","vertical","horizontal"].includes($e)&&Ie&&xe;if(Be)switch($e){case"left":je.forEach(function(Oe){Oe.updateSizeAndPositionOptions(0),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"vertical":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),qe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,(qe-Qe)/2);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"right":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),qe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,qe-Qe);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"top":je.forEach(function(Oe){var Qe=Ae.editingPanel&&Ae.editingPanel.paperHeader||0;Oe.updateSizeAndPositionOptions(void 0,Qe),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"horizontal":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperHeader||0,Ye=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,qe=Math.max(0,Ye-We),rr=We+Math.max(0,(qe-Qe)/2);Oe.updateSizeAndPositionOptions(void 0,rr),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"bottom":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,Ye=Math.max(0,We-Qe);Oe.updateSizeAndPositionOptions(void 0,Ye),Oe.designTarget.css("top",Oe.options.displayTop())});break}else{var Ce=Math.min.apply(null,je.map(function(Oe){return Oe.options.left})),Ee=Math.max.apply(null,je.map(function(Oe){return Oe.options.left+Oe.options.width})),Se=Math.min.apply(null,je.map(function(Oe){return Oe.options.top})),Pe=Math.max.apply(null,je.map(function(Oe){return Oe.options.top+Oe.options.height}));switch($e){case"distributeHor":var Me=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.width},0),Te=(Ee-Ce-Me)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.left-Qe.options.left}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(je[Qe-1].options.left+je[Qe-1].options.width+Te),Oe.designTarget.css("left",Oe.options.displayLeft()))});break;case"distributeVer":var Fe=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.height},0),He=(Pe-Se-Fe)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.top-Qe.options.top}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(void 0,je[Qe-1].options.top+je[Qe-1].options.height+He),Oe.designTarget.css("top",Oe.options.displayTop()))});break}}}},_e.prototype.setElsSpace=function($e,Ae){var je=this.getSelectEls();je.length&&(Ae?(je.sort(function(ke,Ie){return ke.options.left-Ie.options.left}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(je[Ie-1].options.left+je[Ie-1].options.width+$e),ke.designTarget.css("left",ke.options.displayLeft()))})):(je.sort(function(ke,Ie){return ke.options.top-Ie.options.top}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(void 0,je[Ie-1].options.top+je[Ie-1].options.height+$e),ke.designTarget.css("top",ke.options.displayTop()))})))},_e.prototype.setElsZIndex=function($e){var Ae=this.getSelectEls();if(!(!Ae||!Ae.length)){var je=function(Ce){var Ee=parseInt(Ce,10);return isNaN(Ee)?0:Ee},ke=function(Ce){if(!Ce)return 0;var Ee=Ce.options&&(Ce.options.zIndex||Ce.options["z-index"]);if(typeof Ee<"u")return je(Ee);var Se=Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index");return je(Se)},Ie=function(Ce,Ee){if(Ce&&(Ce.options&&(Ce.options.zIndex=Ee),Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index",Ee),typeof Ce.updateOption=="function"))try{Ce.updateOption("zIndex",Ee,!0)}catch{}},xe=999,Be=0;switch($e){case"top":Ae.forEach(function(Ce){Ie(Ce,xe)});break;case"bottom":Ae.forEach(function(Ce){Ie(Ce,Be)});break;case"up":Ae.forEach(function(Ce){Ie(Ce,ke(Ce)+1)});break;case"down":Ae.forEach(function(Ce){var Ee=ke(Ce)-1;Ie(Ce,Ee<0?0:Ee)});break;default:return}try{o.a.event.trigger("hiprintTemplateDataChanged_"+(this.id||this.templateId),"层级:"+$e)}catch{}}},_e.prototype.initAutoSave=function(){var $e=this;o.a.event.on("hiprintTemplateDataShortcutKey_"+this.id,function(Ae){if($e.history)switch(Ae){case"undo":if($e.historyPos>0){$e.historyPos-=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break;case"redo":if($e.historyPos<$e.historyList.length-1){$e.historyPos+=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break}}),o.a.event.on("hiprintTemplateDataChanged_"+this.id,function(Ae){if($e.history){var je=$e.dataMode==1?$e.getJson():$e.getJsonTid();$e.lastJson=je,$e.historyPos<$e.historyList.length-1&&($e.historyList=$e.historyList.slice(0,$e.historyPos+1)),$e.historyList.push({id:s.a.instance.guid(),type:Ae,json:je}),$e.historyList.length>50?$e.historyList=$e.historyList.slice(0,1).concat($e.historyList.slice(1,50)):$e.historyPos+=1,$e.onDataChanged&&$e.onDataChanged(Ae,je)}})},_e}();function ht(_e){this.getHtml(_e).hiwprint()}function ft(_e,$e,Ae){$$g.extend({},_e||{}).imgToBase64=!0;var je=new ct({});je.on("printSuccess",$e),je.on("printError",Ae),je.printByHtml2(this.getHtml(_e),_e.options)}function gt(_e){var $e=void 0;return _e&&_e.templates.forEach(function(Ae,je){var ke=$$g.extend({},Ae.options||{});_e.imgToBase64&&(ke.imgToBase64=!0),$e?$e.append(Ae.template.getHtml(Ae.data,ke).html()):$e=Ae.template.getHtml(Ae.data,ke)}),$e}function mt(_e){p.a.instance.init(_e),p.a.instance.providers&&p.a.instance.providers.forEach(function($e){$e.addElementTypes(a.instance)}),window.autoConnect&&(p.a.instance.host!=hiwebSocket.host||p.a.instance.token!=hiwebSocket.token)&&(hiwebSocket.stop(),p.a.instance.host&&(hiwebSocket.host=p.a.instance.host),p.a.instance.token&&(hiwebSocket.token=p.a.instance.token),hiwebSocket.start()),p.a.instance.lang&&Object.keys(languages).includes(p.a.instance.lang)?i18n.lang=p.a.instance.lang:i18n.lang="cn"}function cig(_e){_e?_e&&Object.keys(_e).forEach(function($e){if($e=="optionItems"&&_e.optionItems&&_e.optionItems.length)p.a.instance.registerItems(_e.optionItems);else if(_e[$e].tabs&&_e[$e].tabs.length)_e[$e].tabs.forEach(function(Ie,xe){if(Ie.replace)$$g.extend(p.a.instance[$e].tabs[xe],Ie);else{var Be=Ie.options,Ce=p.a.instance[$e].tabs[xe].options;Be.forEach(function(Ee){var Se=Ce.findIndex(function(Pe){return Pe.name==Ee.name});Se>-1?Ce[Se].hidden=Ee.hidden:Ee.after?(Se=Ce.findIndex(function(Pe){return Pe.name==Ee.after}),Se>-1&&Ce.splice(Se+1,0,Ee)):Ce.push(Ee)}),$$g.extend(p.a.instance[$e].tabs[xe],{name:Ie.name,options:Ce})}}),delete _e[$e].tabs;else if(_e[$e].supportOptions){var Ae=_e[$e].supportOptions,je=p.a.instance[$e].supportOptions;Ae.forEach(function(Ie){var xe=je.findIndex(function(Be){return Be.name==Ie.name});xe>-1?je[xe].hidden=Ie.hidden:Ie.after?(xe=je.findIndex(function(Be){return Be.name==Ie.after}),xe>-1&&je.splice(xe+1,0,Ie)):je.push(Ie)}),$$g.extend(p.a.instance[$e].supportOptions,je),delete _e[$e].supportOptions}else{var ke={};ke[$e]=_e[$e],$$g.extend(p.a.instance,ke)}}):$$g.extend(p.a.instance,HIPRINT_CONFIG)}function uep(_e,$e){return a.instance.updateElementType(_e,$e)}function rpl(_e){p.a.instance.clear("printerList"),p.a.instance.on("printerList",_e),hiwebSocket.refreshPrinterList()}function getClients(_e){p.a.instance.clear("clients"),p.a.instance.on("clients",_e),hiwebSocket.getClients()}function getClientInfo(_e){p.a.instance.clear("clientInfo"),p.a.instance.on("getClientInfo",_e),hiwebSocket.getClientInfo()}function getAddr(_e,$e,...Ae){p.a.instance.clear("address_"+_e),p.a.instance.on("address_"+_e,$e),hiwebSocket.getAddress(_e,...Ae)}function ippPrint(_e,$e,Ae){p.a.instance.clear("ippPrinterCallback"),p.a.instance.on("ippPrinterCallback",$e),p.a.instance.clear("ippPrinterConnected"),p.a.instance.on("ippPrinterConnected",Ae),hiwebSocket.ippPrint(_e)}function ippRequest(_e,$e){p.a.instance.clear("ippRequestCallback"),p.a.instance.on("ippRequestCallback",$e),hiwebSocket.ippRequest(_e)}n.d(e,"init",function(){return mt}),n.d(e,"setConfig",function(){return cig}),n.d(e,"updateElementType",function(){return uep}),n.d(e,"hiwebSocket",function(){return hiwebSocket}),n.d(e,"refreshPrinterList",function(){return rpl}),n.d(e,"getClients",function(){return getClients}),n.d(e,"getClientInfo",function(){return getClientInfo}),n.d(e,"getAddress",function(){return getAddr}),n.d(e,"ippPrint",function(){return ippPrint}),n.d(e,"ippRequest",function(){return ippRequest}),n.d(e,"PrintElementTypeManager",function(){return it}),n.d(e,"PrintElementTypeGroup",function(){return ot}),n.d(e,"PrintTemplate",function(){return ct}),n.d(e,"print",function(){return ht}),n.d(e,"print2",function(){return ft}),n.d(e,"getHtml",function(){return gt}),$$g(document).ready(function(){console.log("document ready"),console.log(window.autoConnect),hiwebSocket.hasIo()&&window.autoConnect&&hiwebSocket.start()})}]),defaultElementTypeProvider=defaultTypeProvider(hiprint);const version="1.0.14",_export_sfc=(_e,$e)=>{const Ae=_e.__vccOpts||_e;for(const[je,ke]of $e)Ae[je]=ke;return Ae},_hoisted_1$3={class:"vgp-designer-wrap"},_sfc_main$3={__name:"Designer",props:{template:{type:Object,default:()=>({})},printData:{type:Object,default:()=>({})},templateKey:{type:String,default:"default-template"},title:{type:String,default:""},designOptions:{type:Object,default:()=>({grid:!0,activePanel:!0})},autoConnect:{type:Boolean,default:!0},paperList:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},authKey:{type:String,default:""}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(null);function ke(Ee){setConfig(Ae.config),register({authKey:Ae.authKey,plugins:Ae.plugins}),je.value=createPrintTemplate({template:Ee}),je.value.design("#SVPrint",Ae.designOptions)}vue.onMounted(()=>{ke(Ae.template)}),vue.watch(()=>Ae.template,Ee=>{Ee&&ke(Ee)});function Ie(){return je.value}function xe(){return je.value?je.value.getJson():{}}function Be(Ee){je.value&&je.value.setJson(Ee)}function Ce(){return xe()}return $e({init:ke,getTarget:Ie,getTemplateJson:xe,setTemplateJson:Be,exportJson:Ce}),(Ee,Se)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[vue.renderSlot(Ee.$slots,"header",{},void 0,!0),Se[0]||(Se[0]=vue.createElementVNode("div",{id:"SVPrint",class:"vgp-designer-target"},null,-1)),vue.renderSlot(Ee.$slots,"other",{},void 0,!0)]))}},Designer=_export_sfc(_sfc_main$3,[["__scopeId","data-v-c3735ff8"]]),_hoisted_1$2={class:"vgp-header"},_hoisted_2$2={class:"left"},_hoisted_3$1=["innerHTML"],_hoisted_4$1={class:"title"},_hoisted_5={class:"center"},_hoisted_6={class:"right"},_sfc_main$2={__name:"Header",props:{logoHtml:{type:String,default:'<i class="svicon sv-print"></i>'},title:{type:String,default:"vg-print"},reEle:{type:[String,Boolean],default:!1},eleList:{type:Array,default:()=>[]},reMenu:{type:[String,Boolean],default:!1},menuList:{type:Array,default:()=>[]},onPreviewClick:{type:Function,default:null}},setup(_e,{expose:$e}){const Ae=_e;function je(ke){return typeof Ae.onPreviewClick=="function"?Ae.onPreviewClick(ke):!0}return $e({previewClick:je}),(ke,Ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[vue.renderSlot(ke.$slots,"headerLeft",{},()=>[vue.createElementVNode("span",{innerHTML:_e.logoHtml},null,8,_hoisted_3$1),vue.createElementVNode("span",_hoisted_4$1,vue.toDisplayString(_e.title),1)],!0)]),vue.createElementVNode("div",_hoisted_5,[vue.renderSlot(ke.$slots,"headerCenter",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(ke.$slots,"headerRight",{},void 0,!0)])]))}},Header=_export_sfc(_sfc_main$2,[["__scopeId","data-v-c71a08f5"]]),_hoisted_1$1={key:0,class:"vgp-preview-modal"},_hoisted_2$1={class:"vgp-preview-panel"},_hoisted_3={class:"tools"},_hoisted_4=["value"],_sfc_main$1={__name:"Preview",props:{printTemplate:{type:[Object],default:void 0},printData:{type:Object,default:void 0},printerList:{type:Array,default:()=>[]},selectedPrinter:{type:String,default:""},showPdf:{type:Boolean,default:!0},showImg:{type:Boolean,default:!0},showPrint2:{type:Boolean,default:!0},modalShow:{type:Boolean,default:!1}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(!1),ke=vue.ref(null),Ie=vue.ref([]),xe=vue.ref("");function Be(Qe,We){ke.value=Qe,Ce(We)}function Ce(Qe){if(!ke.value)return;const We=ke.value.getHtml(Qe),Ye=document.getElementById("preview_content_tasks");Ye&&(Ye.innerHTML=We)}function Ee(){je.value=!0}function Se(){je.value=!1}function Pe(){return ke.value}function Me(){ke.value&&ke.value.print(Ae.printData||{})}function Te(){ke.value&&ke.value.print2(Ae.printData||{},{printer:xe.value})}async function Fe(){ke.value&&await ke.value.toPdf(Ae.printData||{},"打印预览pdf")}async function He(){ke.value&&await ke.value.toImage(Ae.printData||{})}function Oe(){try{hiprint&&hiprint.hiwebSocket&&(Ie.value=hiprint.hiwebSocket.getPrinterList()||[])}catch{}}return $e({init:Be,show:Ee,hide:Se,getTarget:Pe,print:Me,directPrint:Te,toPdf:Fe,toImage:He,refreshPrinters:Oe}),vue.watch(()=>Ae.modalShow,Qe=>{je.value=!!Qe}),(Qe,We)=>je.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3,[_e.showPdf?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:Fe},"导出PDF")):vue.createCommentVNode("",!0),_e.showImg?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:He},"导出图片")):vue.createCommentVNode("",!0),_e.showPrint2?(vue.openBlock(),vue.createElementBlock("button",{key:2,onClick:Te},"直接打印")):vue.createCommentVNode("",!0),vue.createElementVNode("button",{onClick:Me},"浏览器打印"),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":We[0]||(We[0]=Ye=>xe.value=Ye)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ie.value,Ye=>(vue.openBlock(),vue.createElementBlock("option",{key:Ye.name,value:Ye.name},vue.toDisplayString(Ye.label||Ye.name),9,_hoisted_4))),128))],512),[[vue.vModelSelect,xe.value]]),vue.createElementVNode("button",{onClick:Oe},"刷新"),vue.createElementVNode("button",{onClick:Se},"关闭")]),We[1]||(We[1]=vue.createElementVNode("div",{id:"preview_content_tasks"},null,-1))])])):vue.createCommentVNode("",!0)}},Preview=_export_sfc(_sfc_main$1,[["__scopeId","data-v-9764769e"]]),_hoisted_1={class:"title"},_hoisted_2={class:"body"},_sfc_main={__name:"DragBox",props:{target:{type:String,default:"SVPrint"},dragKey:{type:String,default:"default"},dragStyle:{type:String,default:""},mode:{type:String,default:"default"},show:{type:Boolean,default:!1}},setup(_e){const $e=_e,Ae=vue.computed(()=>`mode-${$e.mode}`);return(je,ke)=>_e.show?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["vgp-dragbox",Ae.value]),style:vue.normalizeStyle(_e.dragStyle)},[vue.createElementVNode("div",_hoisted_1,[vue.renderSlot(je.$slots,"iconTitle",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2,[vue.renderSlot(je.$slots,"body",{},void 0,!0)])],6)):vue.createCommentVNode("",!0)}},DragBox=_export_sfc(_sfc_main,[["__scopeId","data-v-3bdcea45"]]);let autoConnect=function(_e){console.log("autoConnect"),window.autoConnect=!0,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.start(_e)},disAutoConnect=function(){console.log("disAutoConnect"),window.autoConnect=!1,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.stop()},hiPrintPlugin={disAutoConnect,install:function(_e,$e="$hiPrint",Ae=!0){Ae||disAutoConnect();let je=_e.prototype||_e.config.globalProperties;je[$e]=hiprint,je.$print=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print(...xe),Be},je.$print2=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print2(...xe),Be}}};hiprint.version=version,window.hiprint=hiprint;function register({authKey:_e="",plugins:$e=[]}={}){const Ae=$e.map(je=>typeof je=="function"?je():je).filter(Boolean);return Ae.length||Ae.push(new defaultElementTypeProvider),hiprint.init({providers:Ae}),hiprint.authKey=_e,hiprint}function setConfig(_e={}){return hiprint.config=_e,hiprint}function createPrintTemplate(_e={}){return new hiprint.PrintTemplate(_e)}function print({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print($e,Ae)}function print2({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print2($e,Ae)}async function toPdf({template:_e,data:$e,name:Ae,pdfOptions:je}={}){return _e.toPdf($e,Ae,je)}async function toImage({template:_e,data:$e,imageOptions:Ae}={}){return _e.toImage($e,Ae)}/*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */function _typeof(_e){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($e){return typeof $e}:function($e){return $e&&typeof Symbol=="function"&&$e.constructor===Symbol&&$e!==Symbol.prototype?"symbol":typeof $e},_typeof(_e)}function _setPrototypeOf(_e,$e){return _setPrototypeOf=Object.setPrototypeOf||function(je,ke){return je.__proto__=ke,je},_setPrototypeOf(_e,$e)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(_e,$e,Ae){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(ke,Ie,xe){var Be=[null];Be.push.apply(Be,Ie);var Ce=Function.bind.apply(ke,Be),Ee=new Ce;return xe&&_setPrototypeOf(Ee,xe.prototype),Ee},_construct.apply(null,arguments)}function _toConsumableArray(_e){return _arrayWithoutHoles(_e)||_iterableToArray(_e)||_unsupportedIterableToArray(_e)||_nonIterableSpread()}function _arrayWithoutHoles(_e){if(Array.isArray(_e))return _arrayLikeToArray(_e)}function _iterableToArray(_e){if(typeof Symbol<"u"&&_e[Symbol.iterator]!=null||_e["@@iterator"]!=null)return Array.from(_e)}function _unsupportedIterableToArray(_e,$e){if(_e){if(typeof _e=="string")return _arrayLikeToArray(_e,$e);var Ae=Object.prototype.toString.call(_e).slice(8,-1);if(Ae==="Object"&&_e.constructor&&(Ae=_e.constructor.name),Ae==="Map"||Ae==="Set")return Array.from(_e);if(Ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ae))return _arrayLikeToArray(_e,$e)}}function _arrayLikeToArray(_e,$e){($e==null||$e>_e.length)&&($e=_e.length);for(var Ae=0,je=new Array($e);Ae<$e;Ae++)je[Ae]=_e[Ae];return je}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2041
+ </div>`),Ie.forEach(function(Ce){Ce.submit=function(Ee){$e.callback(je.getValueByOptionItems(Ie))},Be.append(Ce.createTarget(je.printTemplate,$e.options,void 0)),Ce.setValue($e.options[Ce.name],$e.options,void 0)}),Be.find(".auto-submit").change(function(Ce){$e.callback(je.getValueByOptionItems(Ie))}),Be.find(".auto-submit:input").bind("keydown.submitOption",function(Ce){Ce.keyCode==13&&$e.callback(je.getValueByOptionItems(Ie))}),ke.append(Be)},_e.prototype.getValueByOptionItems=function($e){var Ae={};return $e.forEach(function(je){Ae[je.name]=je.getValue()}),Ae},_e}(),dt=function(){function _e($e,Ae){this.paginationContainer=$e,this.jqPaginationContainer=$$g(this.paginationContainer),this.template=Ae}return _e.prototype.buildPagination=function($e){var Ae=this.template.getPaneltotal(),je=this;this.jqPaginationContainer.html("");for(var ke=$$g('<ul class="hiprint-pagination"></ul>'),Ie=function(){var Ee=xe,Se=je.template.printPanels[Ee].name||Ee+1,Pe=$$g("<li><span>"+Se+'</span><a href="javascript:void(0);">x</a></li>');Pe.find("span").click(function(){je.template.selectPanel(Ee),Pe.siblings().removeClass("selected"),$$g(this).parent("li").addClass("selected")}),Pe.find("a").click(function(){je.template.deletePanel(Ee),je.buildPagination()}),ke.append(Pe)},xe=0;xe<Ae;xe++)Ie();var Be=$$g("<li><span>+</span></li>");ke.append(Be),this.jqPaginationContainer.append(ke),Be.click(function(){var Ce=function(Se){je.template.addPrintPanel(Se||void 0,!0),je.buildPagination(),$$g(".hiprint-pagination li").removeClass("selected"),$$g(".hiprint-pagination li:nth-last-child(2)").addClass("selected")};if(je.template.onPanelAddClick){var Ee={index:je.template.printPanels.length,paperType:"A4"};je.template.onPanelAddClick(Ee,Ce)}else Ce()})},_e.prototype.selectPanel=function($e){var Ae=$e||this.template.editingPanel.index,je=$$g(".hiprint-pagination li:nth("+Ae+")");je.length&&(je.siblings().removeClass("selected"),je.addClass("selected")),hinnn.event.trigger("onSelectPanel",this.template.editingPanel,Ae,je)},_e}(),ct=function(){function _e($e){var Ae=this;this.tempimageBase64={},this.id=s.a.instance.guid(),s.a.instance.setPrintTemplateById(this.id,this);var je=$e||{};this.printPanels=[],this.dataMode=je.dataMode||1,this.history=je.history!=null?je.history:!0,this.onDataChanged=je.onDataChanged,this.onUpdateError=je.onUpdateError,this.lastJson=je.template||{},this.historyList=[{id:s.a.instance.guid(),type:"初始",json:this.lastJson}],this.historyPos=0,this.defaultPanelName=je.defaultPanelName,this.designOptions={};var ke=new st(je.template||[]);je.template&&ke.panels.forEach(function(Ie){Ae.printPanels.push(new pt(Ie,Ae.id))}),je.fontList&&(this.fontList=je.fontList),je.fields&&(this.fields=je.fields),je.onImageChooseClick&&(this.onImageChooseClick=je.onImageChooseClick),je.onPanelAddClick&&(this.onPanelAddClick=je.onPanelAddClick),je.settingContainer&&new ut(this,je.settingContainer),je.paginationContainer&&(this.printPaginationCreator=new dt(je.paginationContainer,this),this.printPaginationCreator.buildPagination()),this.initAutoSave()}return _e.prototype.design=function($e,Ae){var je=this;if(Ae||(Ae={}),this.printPanels.length==0){var ke=this.createDefaultPanel();this.printPanels.push(ke)}if(!$e)throw new Error("options.container can not be empty");je.designOptions=Ae,this.createContainer($e),this.printPanels.forEach(function(Ie,xe){je.container.append(Ie.getTarget()),xe>0&&Ie.disable(),Ie.design(Ae)}),this.selectPanel(0)},_e.prototype.getSimpleHtml=function($e,Ae){var je=this;Ae||(Ae={});var ke=$$g('<div class="hiprint-printTemplate"></div>');return $e&&$e.constructor===Array?$e.forEach(function(Ie,xe){Ie&&je.printPanels.forEach(function(Be,Ce){ke.append(Be.getHtml(Ie,Ae)),xe==$e.length-1&&delete hinnn._paperList})}):this.printPanels.forEach(function(Ie,xe){ke.append(Ie.getHtml($e,Ae)),xe==je.printPanels.length-1&&delete hinnn._paperList}),Ae&&Ae.imgToBase64&&this.transformImg(ke.find("img")),ke},_e.prototype.getHtml=function($e,Ae){return $e||($e={}),this.getSimpleHtml($e,Ae)},_e.prototype.getJointHtml=function($e,Ae,je){var ke=$$g('<div class="hiprint-printTemplate"></div>'),Ie=[];return this.printPanels.forEach(function(xe,Be){ke.append(xe.getHtml($e,Ae,Ie,void 0,je))}),ke},_e.prototype.setPaper=function($e,Ae){if(/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test($e))this.editingPanel.resize(void 0,parseFloat($e),parseFloat(Ae),!1);else{var je=s.a.instance[$e];if(!je)throw new Error("not found pagetype:"+($e||""));this.editingPanel.resize($e,je.width,je.height,!1)}},_e.prototype.rotatePaper=function(){this.editingPanel.rotatePaper()},_e.prototype.zoom=function($e,Ae){this.editingPanel.zoom($e,Ae)},_e.prototype.addPrintPanel=function($e,Ae){var je=$e?new pt(new rt($e),this.id):this.createDefaultPanel();return $e&&($e.index=this.printPanels.length),Ae&&(this.container.append(je.getTarget()),je.design(this.designOptions)),this.printPanels.push(je),Ae&&this.selectPanel(je.index),je},_e.prototype.selectPanel=function($e){var Ae=this;$e>Ae.printPanels.length-1&&($e=Ae.printPanels.length-1),this.printPanels.forEach(function(je,ke){$e==ke?(je.enable(),Ae.editingPanel=je,Ae.printPaginationCreator&&Ae.printPaginationCreator.selectPanel($e)):je.disable()})},_e.prototype.deletePanel=function($e){this.printPanels[$e].clear(),this.printPanels[$e].getTarget().remove(),this.printPanels.splice($e,1)},_e.prototype.getPaneltotal=function(){return this.printPanels.length},_e.prototype.createDefaultPanel=function(){return new pt(new rt({index:this.printPanels.length,name:this.defaultPanelName,paperType:"A4"}),this.id)},_e.prototype.createContainer=function($e){$e?(this.container=$$g($e),this.container.addClass("hiprint-printTemplate")):this.container=$$g('<div class="hiprint-printTemplate"></div>')},_e.prototype.getJsonTid=function(){var $e=[];return this.printPanels.forEach(function(Ae){Ae.getPanelEntity().printElements.length&&$e.push(Ae.getPanelEntity())}),new st({panels:$e})},_e.prototype.getJson=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e.push(Ae.getPanelEntity(!0))}),new st({panels:$e})},_e.prototype.undo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"undo")},_e.prototype.redo=function($e){o.a.event.trigger("hiprintTemplateDataShortcutKey_"+this.id,"redo")},_e.prototype.getPrintElementSelectEventKey=function(){return"PrintElementSelectEventKey_"+this.id},_e.prototype.getBuildCustomOptionSettingEventKey=function(){return"BuildCustomOptionSettingEventKey_"+this.id},_e.prototype.clear=function(){this.printPanels.forEach(function($e){if($e.clear(),$e.index>0){var Ae=$e.getTarget();Ae&&Ae.length&&Ae.remove()}}),this.printPanels=[this.printPanels[0]],this.printPaginationCreator&&this.printPaginationCreator.buildPagination()},_e.prototype.getPaperType=function($e){return this.printPanels[0].paperType},_e.prototype.getOrient=function($e){return $e==null&&($e=0),this.printPanels[$e].height>this.printPanels[$e].width?1:2},_e.prototype.getPrintStyle=function($e){return this.printPanels[$e].getPrintStyle()},_e.prototype.print=function($e,Ae,je){$e||($e={});try{if(typeof this.getHtmlStable=="function"){var ke=this;return this.getHtmlStable($e).then(function(Ie){var xe=$$g("<div></div>");xe.html(Ie),xe.hiwprint(je)}).catch(function(){ke.getHtml($e,Ae).hiwprint(je)})}}catch{}this.getHtml($e,Ae).hiwprint(je)},_e.prototype.print2=function($e,Ae){if($e||($e={}),Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]'),Be="";if(Ae.styleHandler&&(Be+=Ae.styleHandler()),xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Ce,Ee){var Se=new XMLHttpRequest;Se.open("GET",$$g(Ee).attr("href")),Se.onreadystatechange=function(){if(Se.readyState===4&&Se.status===200&&(Ie[Ce+""]='<style rel="stylesheet" type="text/css">'+Se.responseText+"</style>",++ke==xe.length)){for(var Pe="",Me=0;Me<xe.length;Me++)Pe+=Ie[Me+""];Be&&(Pe=Be+Pe),je.sentToClient(Pe,$e,Ae)}},Se.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.imageToBase64=function($e){var Ae=$$g($e).attr("src");if(Ae.indexOf("base64")==-1)try{if(!this.tempimageBase64[Ae]){var je=document.createElement("canvas"),ke=new Image;ke.src=$e.attr("src"),je.width=ke.width,je.height=ke.height,je.getContext("2d").drawImage(ke,0,0),Ae&&(this.tempimageBase64[Ae]=je.toDataURL("image/png"))}$e.attr("src",this.tempimageBase64[Ae])}catch{try{this.xhrLoadImage($e)}catch(xe){console.log(xe)}}},_e.prototype.xhrLoadImage=function($e){},_e.prototype.sentToClient=function($e,Ae,je){Ae||(Ae={});var ke=$$g.extend({},je||{});ke.imgToBase64=!0;var Ie=$e+this.getHtml(Ae,ke)[0].outerHTML;ke.id=s.a.instance.guid(),ke.html=Ie,ke.templateId=this.id,hiwebSocket.send(ke)},_e.prototype.printByHtml=function($e){$$g($e).hiwprint()},_e.prototype.printByHtml2=function($e,Ae){if(Ae||(Ae={}),this.clientIsOpened()){var je=this,ke=0,Ie={},xe=$$g('link[media=print][href*="print-lock.css"]');if(xe.length<=0)throw new Error('请在 入口文件(index.html) 中引入 print-lock.css. 注意: link[media="print"]');xe.each(function(Be,Ce){var Ee=new XMLHttpRequest;Ee.open("GET",$$g(Ce).attr("href")),Ee.onreadystatechange=function(){if(Ee.readyState===4&&Ee.status===200&&(Ie[Be+""]='<style rel="stylesheet" type="text/css">'+Ee.responseText+"</style>",++ke==xe.length)){for(var Se="",Pe=0;Pe<xe.length;Pe++)Se+=Ie[Pe+""];var Me=Se+$$g($e)[0].outerHTML,Te=$$g.extend({},Ae||{});Te.id=s.a.instance.guid(),Te.html=Me,Te.templateId=je.id,hiwebSocket.send(Te)}},Ee.send()})}else alert(`${i18n.__("连接客户端失败")}`)},_e.prototype.deletePrintElement=function($e){this.printPanels.forEach(function(Ae){Ae.deletePrintElement($e)})},_e.prototype.transformImg=function($e){var Ae=this;$e.map(function(je,ke){Ae.imageToBase64($$g(ke))})},_e.prototype.toPdf=function($e,Ae,je){var ke=this,Ie=$$g.Deferred(),xe=!0;if(this.printPanels.length){var Be=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Ce=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Ee=o.a.mm.toPt(Be),Se=o.a.mm.toPt(Ce),Pe=Ee,Me=Se,Te=this.getOrient(0)==1?"portrait":"landscape";if(je&&(je.paperWidth||je.paperHeight)){var Fe=je.paperWidth,He=je.paperHeight;Fe&&He&&(Pe=o.a.mm.toPt(Fe),Me=o.a.mm.toPt(He))}else if(je&&je.usePaperType===!0&&this.printPanels[0].paperType){var Oe=this.printPanels[0].paperType.toString().toLowerCase(),Qe=null,We=null;Oe==="a4"?(Qe=210,We=297):Oe==="a5"?(Qe=148,We=210):Oe==="a3"&&(Qe=297,We=420),Qe&&We&&(Pe=o.a.mm.toPt(Qe),Me=o.a.mm.toPt(We))}if(Te==="landscape"){var Ye=Pe;Pe=Me,Me=Ye}var qe=$$g.extend({scale:2,width:o.a.pt.toPx(Pe),height:o.a.pt.toPx(Me),x:0,y:0,useCORS:!0},je||{});je&&typeof je.pixelRatio<"u"?qe.scale=je.pixelRatio:je&&typeof je.scale<"u"&&(qe.scale=je.scale),qe.width=o.a.pt.toPx(Pe),qe.height=o.a.pt.toPx(Me);var rr=new E$1({orientation:Te,unit:"pt",format:[Pe,Me]}),Ze=this.getHtml($e,je);je&&je.isDownload!=null&&(xe=je.isDownload),(!Ae||Ae===void 0)&&je&&je.name&&(Ae=je.name);var Ke=je&&typeof je.onProgress=="function"?je.onProgress:null;this.createTempContainer();var St=this.getTempContainer();this.svg2canvas(Ze),St.html(Ze[0]);var tr=[],Xe=je&&typeof je.removeTransform<"u"?!!je.removeTransform:!0;if(Xe)try{var Ge=St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");Ge.each(function(Ni,sr){tr[Ni]=sr.style.transform,sr.style.transform="",sr.style.zoom&&(sr.style.zoom=1)})}catch{}if(!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0))try{var Je=St.find(".hiprint-printPaper").eq(0)[0],ir=St.find(".hiprint-printPanel").eq(0)[0],ar=Je||ir;if(ar){var lr=ar.getBoundingClientRect();lr&&lr.width&&lr.height&&(Pe=o.a.px.toPt(Math.round(lr.width)),Me=o.a.px.toPt(Math.round(lr.height)),qe.width=o.a.pt.toPx(Pe),qe.height=o.a.pt.toPx(Me),rr=new E$1({orientation:Te,unit:"pt",format:[Pe,Me]}))}}catch{}var gr=St.find(".hiprint-printTemplate"),dr=gr.find(".hiprint-printPanel"),hr=$e&&$e.constructor===Array?$e.length:null,kr=hr!=null?Math.min(hr,dr.length):dr.length,Ar=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{};Ar.layoutType||je&&je.layoutType;var Qr=Number(Ar.layoutRowGap||je&&je.rowGapMm||0),or=Number(Ar.layoutColumnGap||je&&je.colGapMm||0),cr=o.a.pt.toMm(Pe),mr=o.a.pt.toMm(Me),wr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||cr,Tr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||mr,Pr=Math.max(1,Math.floor((cr+or)/(wr+or))),Lr=Math.max(1,Math.floor((mr+Qr)/(Tr+Qr))),Rr=Math.max(1,Pr*Lr),Vr=!(je&&(je.paperWidth||je.paperHeight))&&!(je&&je.usePaperType===!0);Vr&&(Rr=1);var Xr=Math.max(1,je&&je.perPage||Rr);if(Xr=Math.min(Xr,kr),Xr>1&&kr>1){var _i=or;if(Pr>1){var ui=(cr-Pr*wr)/(Pr-1);ui>=0&&(_i=ui)}else _i=0;var xi=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");St.prepend($$g(xi));var gr=St.find(".hiprint-printTemplate");gr.css({width:cr+"mm",height:mr+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var Wr=Math.max(0,_i/2),Cr=Math.max(0,Qr/2),Mi=['<style type="text/css">',".hiprint-printTemplate{margin:-"+Cr+"mm -"+Wr+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+Cr+"mm "+Wr+"mm;}","</style>"].join("");St.prepend($$g(Mi)),$$g(Ze).css("position:fixed");var wi=je&&typeof je.leftOffset<"u"?Number(je.leftOffset):null,si=je&&typeof je.topOffset<"u"?Number(je.topOffset):null;if(wi!==null||si!==null){var fi=Pr*wr+(Pr-1)*_i,gi=Lr*Tr+(Lr-1)*Qr,li=0,yi=0;wi===-1?li=Math.max(0,(cr-fi)/2):wi>=0&&(li=wi),si===-1?yi=Math.max(0,(mr-gi)/2):si>=0&&(yi=si),gr.css({paddingLeft:li+"mm",paddingTop:yi+"mm"})}for(var Ei=Math.ceil(kr/Xr),Li=Promise.resolve(),Fi=0;Fi<Ei;Fi++){var Oi=Fi*Xr,Vi=Math.min(Oi+Xr,kr);(function(sr,yr,jr){Li=Li.then(function(){return console.log("处理页面",jr+1,"数据范围:",sr,"到",yr-1),dr.hide(),dr.slice(sr,yr).show(),html2canvas(gr[0],qe).then(function(Fr){var Ur=Fr.getContext("2d");Ur.mozImageSmoothingEnabled=!1,Ur.webkitImageSmoothingEnabled=!1,Ur.msImageSmoothingEnabled=!1,Ur.imageSmoothingEnabled=!1;var Jr=Fr.toDataURL("image/jpeg");rr.addImage(Jr,"JPEG",0,0,Pe,Me),jr<Ei-1&&rr.addPage(),Ke&&Ke(jr+1,Ei)})})})(Oi,Vi,Fi)}Li.then(function(){dr.show();try{Ge.each(function(yr,jr){jr.style.transform=tr[yr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let yr=je.type||"blob";var sr=rr.output(yr);Ie.resolve(sr)}})}else{var Si=St.find(".hiprint-printPaper"),Di=Si.length;Di===0&&(Si=St.find(".hiprint-printTemplate"),Di=Si.length||1);try{var ji=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!je||je.ignoreOffsets!==!1)&&ji.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var oa='<style type="text/css">'+ji.join("")+"</style>";St.prepend($$g(oa)),Si.each(function(Ni,sr){var yr=sr.getAttribute("original-height");yr&&(sr.style.height=yr+"mm")})}catch{}for(var Xi=Promise.resolve(),na=0;na<Di;na++)(function(Ni){Xi=Xi.then(function(){var sr=Si.eq(Ni),yr=sr[0],jr=$$g.extend({},qe);return jr.width=o.a.pt.toPx(Pe),jr.height=o.a.pt.toPx(Me),html2canvas(yr,jr).then(function(Fr){var Ur=Fr.getContext("2d");Ur.mozImageSmoothingEnabled=!1,Ur.webkitImageSmoothingEnabled=!1,Ur.msImageSmoothingEnabled=!1,Ur.imageSmoothingEnabled=!1;var Jr=Fr.toDataURL("image/jpeg");rr.addImage(Jr,"JPEG",0,0,Pe,Me),Ni<Di-1&&rr.addPage(),Ke&&Ke(Ni+1,Di)})})})(na);Xi.then(function(){if(Xe)try{St.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(sr,yr){yr.style.transform=tr[sr]||""})}catch{}if(xe)ke.removeTempContainer(),Ae.indexOf(".pdf")>-1?rr.save(Ae):rr.save(Ae+".pdf");else{ke.removeTempContainer();let sr=je.type||"blob";var Ni=rr.output(sr);Ie.resolve(Ni)}})}}return Ie.promise()},_e.prototype.createTempContainer=function(){this.removeTempContainer(),$$g("body").prepend($$g('<div class="hiprint_temp_Container" style="overflow:hidden;height: 0px;box-sizing: border-box;"></div>'))},_e.prototype.removeTempContainer=function(){$$g(".hiprint_temp_Container").remove()},_e.prototype.getTempContainer=function(){return $$g(".hiprint_temp_Container")},_e.prototype.svg2canvas=function($e){var Ae=this;$e.find("svg").each(function(je,ke){var Ie=ke.parentNode,xe=Ae.parentWidthHeight(Ie),Be=document.createElement("canvas");Be.width=xe.width,Be.height=xe.height;var Ce=Be.getContext("2d"),Ee=new XMLSerializer().serializeToString(ke);Canvg.fromString(Ce,Ee).render(),$$g(ke).before(Be),Ie.removeChild(ke)})},_e.prototype.toImage=function($e,Ae){var je=this,ke=$$g.Deferred(),Ie=!1,xe=Ae&&Ae.name||"image",Be=Ae&&Ae.type||"image/jpeg",Ce=Ae&&typeof Ae.quality<"u"?Ae.quality:.92,Ee=Ae&&Ae.toType||"url",Se=Ae&&typeof Ae.limit<"u"?Number(Ae.limit):10,Pe=Se<=0?Number.MAX_SAFE_INTEGER:Se;if(Ae&&Ae.isDownload!=null&&(Ie=Ae.isDownload),this.printPanels.length){let Jr=function(){je.removeTempContainer();var Sr=[],Kr=[],Ir="jpg";if(Be.indexOf("png")>-1?Ir="png":Be.indexOf("webp")>-1?Ir="webp":Be.indexOf("bmp")>-1&&(Ir="bmp"),Rr){for(var Or=Promise.resolve(),Yr=0;Yr<kr.length;Yr++)(function(Gr){Or=Or.then(function(){var ni=kr[Gr],qr=xe;return qr=qr+"-"+(Gr+1)+"."+Ir,Kr.push(qr),new Promise(function(ai){if(Ee==="blob")ni.toBlob(function(Ii){Sr.push(Ii),ai()},Be,Ce);else{var mi=ni.toDataURL(Be,Ce);Sr.push(mi),ai()}})})})(Yr);Or.then(function(){if(Ie)for(var Gr=0;Gr<Sr.length;Gr++){var ni=Sr[Gr],qr=ni;Ee==="blob"&&(qr=URL.createObjectURL(ni));var ai=document.createElement("a");if(ai.href=qr,ai.download=Kr[Gr],document.body.appendChild(ai),ai.click(),document.body.removeChild(ai),Ee==="blob")try{URL.revokeObjectURL(qr)}catch{}}ke.resolve(Sr)});return}for(var $i=[],Hr=0;Hr<kr.length;Hr+=Pe)$i.push(kr.slice(Hr,Math.min(Hr+Pe,kr.length)));for(var ti=Promise.resolve(),Zr=0;Zr<$i.length;Zr++)(function(Gr){ti=ti.then(function(){for(var ni=$i[Gr],qr=document.createElement("canvas"),ai=0,mi=0,Ii=0;Ii<ni.length;Ii++)ai=Math.max(ai,ni[Ii].width),mi+=ni[Ii].height;qr.width=Math.max(1,ai),qr.height=Math.max(1,mi);var Hi=qr.getContext("2d");Hi.fillStyle="#ffffff",Hi.fillRect(0,0,qr.width,qr.height),Hi.mozImageSmoothingEnabled=!1,Hi.webkitImageSmoothingEnabled=!1,Hi.msImageSmoothingEnabled=!1,Hi.imageSmoothingEnabled=!1;for(var Zi=0,Gi=0;Gi<ni.length;Gi++){var Ai=ni[Gi];Hi.drawImage(Ai,0,Zi,Ai.width,Ai.height),Zi+=Ai.height}var Ti=xe;return Ti=Ti+"-"+(Gr+1)+"."+Ir,Kr.push(Ti),new Promise(function(Ui){if(Ee==="blob")qr.toBlob(function(ea){Sr.push(ea),Ui()},Be,Ce);else{var Ri=qr.toDataURL(Be,Ce);Sr.push(Ri),Ui()}})})})(Zr);ti.then(function(){if(Ie)for(var Gr=0;Gr<Sr.length;Gr++){var ni=Sr[Gr],qr=ni;Ee==="blob"&&(qr=URL.createObjectURL(ni));var ai=document.createElement("a");if(ai.href=qr,ai.download=Kr[Gr],document.body.appendChild(ai),ai.click(),document.body.removeChild(ai),Ee==="blob")try{URL.revokeObjectURL(qr)}catch{}}ke.resolve(Sr)})};var Me=this.printPanels[0].mmwidth!=null?this.printPanels[0].mmwidth:o.a.pt.toMm(this.printPanels[0].width),Te=this.printPanels[0].mmheight!=null?this.printPanels[0].mmheight:o.a.pt.toMm(this.printPanels[0].height),Fe=o.a.mm.toPt(Me),He=o.a.mm.toPt(Te),Oe=Fe,Qe=He,We=this.getOrient(0)==1?"portrait":"landscape";if(Ae&&(Ae.paperWidth||Ae.paperHeight)){var Ye=Ae.paperWidth,qe=Ae.paperHeight;Ye&&qe&&(Oe=o.a.mm.toPt(Ye),Qe=o.a.mm.toPt(qe))}else if(Ae&&Ae.usePaperType===!0&&this.printPanels[0].paperType){var rr=this.printPanels[0].paperType.toString().toLowerCase(),Ze=null,Ke=null;rr==="a4"?(Ze=210,Ke=297):rr==="a5"?(Ze=148,Ke=210):rr==="a3"&&(Ze=297,Ke=420),Ze&&Ke&&(Oe=o.a.mm.toPt(Ze),Qe=o.a.mm.toPt(Ke))}if(We==="landscape"){var St=Oe;Oe=Qe,Qe=St}var tr=$$g.extend({scale:2,width:o.a.pt.toPx(Oe),height:o.a.pt.toPx(Qe),x:0,y:0,useCORS:!0},Ae||{});Ae&&typeof Ae.pixelRatio<"u"?tr.scale=Ae.pixelRatio:Ae&&typeof Ae.scale<"u"&&(tr.scale=Ae.scale),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe);var Xe=this.getHtml($e,Ae);this.createTempContainer();var Ge=this.getTempContainer();this.svg2canvas(Xe),Ge.html(Xe[0]);var Je=[],ir=Ae&&typeof Ae.removeTransform<"u"?!!Ae.removeTransform:!0;if(ir)try{var ar=Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate");ar.each(function(Sr,Kr){Je[Sr]=Kr.style.transform,Kr.style.transform="",Kr.style.zoom&&(Kr.style.zoom=1)})}catch{}if(!(Ae&&(Ae.paperWidth||Ae.paperHeight))&&!(Ae&&Ae.usePaperType===!0))try{var lr=Ge.find(".hiprint-printPanel").eq(0)[0],gr=lr||Ge.find(".hiprint-printPaper").eq(0)[0];if(gr){var dr=gr.getBoundingClientRect();dr&&dr.width&&dr.height&&(Oe=o.a.px.toPt(Math.round(dr.width)),Qe=o.a.px.toPt(Math.round(dr.height)),tr.width=o.a.pt.toPx(Oe),tr.height=o.a.pt.toPx(Qe))}}catch{}var hr=Ae&&typeof Ae.onProgress=="function"?Ae.onProgress:null,kr=[],Ar=o.a.pt.toPx(Oe),Qr=o.a.pt.toPx(Qe),or=Ge.find(".hiprint-printTemplate"),cr=or.find(".hiprint-printPanel"),mr=$e&&$e.constructor===Array?$e.length:null,wr=mr!=null?Math.min(mr,cr.length):cr.length,Tr=this.printPanels&&this.printPanels[0]&&this.printPanels[0].panelLayoutOptions||{},Pr=Number(Tr.layoutRowGap||Ae&&Ae.rowGapMm||0),Lr=Number(Tr.layoutColumnGap||Ae&&Ae.colGapMm||0),Rr=!!(Ae&&(Ae.paperWidth&&Ae.paperHeight||Ae.usePaperType===!0));if(Rr){var Vr=o.a.pt.toMm(Oe),Xr=o.a.pt.toMm(Qe),_i=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmwidth||Vr,ui=this.printPanels&&this.printPanels[0]&&this.printPanels[0].mmheight||Xr,xi=Math.max(1,Math.floor((Vr+Lr)/(_i+Lr))),Wr=Math.max(1,Math.floor((Xr+Pr)/(ui+Pr))),Cr=Math.max(1,xi*Wr),Mi=Se>0?Math.max(1,Math.min(Se,wr)):Math.max(1,Cr),wi=Lr;if(xi>1){var si=(Vr-xi*_i)/(xi-1);si>=0&&(wi=si)}else wi=0;var fi=['<style type="text/css">',".hiprint-printTemplate{font-size:0;}",".hiprint-printTemplate .hiprint-printPanel{page-break-after:auto !important;}",".hiprint-printPanel .hiprint-printPaper{display:inline-block !important; vertical-align:top !important; page-break-after:auto !important;}","</style>"].join("");Ge.prepend($$g(fi)),or.css({width:Vr+"mm",height:Xr+"mm",overflow:"hidden",boxSizing:"border-box",background:"#fff"});var gi=Math.max(0,wi/2),li=Math.max(0,Pr/2),yi=['<style type="text/css">',".hiprint-printTemplate{margin:-"+li+"mm -"+gi+"mm;}",".hiprint-printTemplate .hiprint-printPanel{padding:"+li+"mm "+gi+"mm;}","</style>"].join("");Ge.prepend($$g(yi)),$$g(Xe).css("position:fixed");var Ei=Ae&&typeof Ae.leftOffset<"u"?Number(Ae.leftOffset):null,Li=Ae&&typeof Ae.topOffset<"u"?Number(Ae.topOffset):null;if(Ei!==null||Li!==null){var Fi=xi*_i+(xi-1)*wi,Oi=Wr*ui+(Wr-1)*Pr,Vi=0,Si=0;Ei===-1?Vi=Math.max(0,(Vr-Fi)/2):Ei>=0&&(Vi=Ei),Li===-1?Si=Math.max(0,(Xr-Oi)/2):Li>=0&&(Si=Li),or.css({paddingLeft:Vi+"mm",paddingTop:Si+"mm"})}for(var Di=Math.ceil(wr/Mi),ji=Promise.resolve(),oa=0;oa<Di;oa++){var Xi=oa*Mi,na=Math.min(Xi+Mi,wr);(function(Sr,Kr,Ir){ji=ji.then(function(){return cr.hide(),cr.slice(Sr,Kr).show(),html2canvas(or[0],tr).then(function(Or){var Yr=Or.getContext("2d");Yr.mozImageSmoothingEnabled=!1,Yr.webkitImageSmoothingEnabled=!1,Yr.msImageSmoothingEnabled=!1,Yr.imageSmoothingEnabled=!1,kr.push(Or),hr&&hr(Ir+1,Di)})})})(Xi,na,oa)}ji.then(function(){if(cr.show(),ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Kr){Kr.style.transform=Je[Sr]||""})}catch{}Jr()})}else{var Ni=Ge.find(".hiprint-printPaper"),sr=Ni.length;sr===0&&(Ni=Ge.find(".hiprint-printTemplate"),sr=Ni.length||1);try{var yr=[".hiprint-printPaper{overflow:visible !important;}",".hiprint-printPaper .hiprint-printPaper-content{overflow:visible !important;}"];(!Ae||Ae.ignoreOffsets!==!1)&&yr.push(".hiprint-printPaper .hiprint-printPaper-content{left:0 !important; top:0 !important;}");var jr='<style type="text/css">'+yr.join("")+"</style>";Ge.prepend($$g(jr)),Ni.each(function(Sr,Kr){var Ir=Kr.getAttribute("original-height");Ir&&(Kr.style.height=Ir+"mm")})}catch{}for(var Fr=Promise.resolve(),Ur=0;Ur<sr;Ur++)(function(Sr){Fr=Fr.then(function(){var Kr=Ni.eq(Sr),Ir=Kr[0],Or=$$g.extend({},tr);try{var Yr=Ir.getBoundingClientRect(),$i=Math.max(1,Math.round(Yr.width)),Hr=Math.max(1,Math.round(Yr.height));Or.width=$i,Or.height=Hr}catch{Or.width=Ar,Or.height=Qr}return html2canvas(Ir,Or).then(function(ti){var Zr=ti.getContext("2d");Zr.mozImageSmoothingEnabled=!1,Zr.webkitImageSmoothingEnabled=!1,Zr.msImageSmoothingEnabled=!1,Zr.imageSmoothingEnabled=!1,kr.push(ti),hr&&hr(Sr+1,sr)})})})(Ur);Fr.then(function(){if(ir)try{Ge.find(".hiprint-printPaper, .hiprint-printPanel, .hiprint-printTemplate").each(function(Sr,Kr){Kr.style.transform=Je[Sr]||""})}catch{}Jr()})}}return ke.promise()},_e.prototype.parentWidthHeight=function($e){return $e.style.width.endsWith("%")||$e.style.height.endsWith("%")?$e.className!="hiprint-printPaper-content"?this.parentWidthHeight($e.parentNode):{width:10,height:10}:{width:o.a.pt.toPx(parseFloat($e.style.width)),height:o.a.pt.toPx(parseFloat($e.style.height))}},_e.prototype.on=function($e,Ae){o.a.event.clear($e+"_"+this.id),o.a.event.on($e+"_"+this.id,Ae)},_e.prototype.clientIsOpened=function(){return hiwebSocket.opened},_e.prototype.getPrinterList=function(){var $e=hiwebSocket.getPrinterList();return $e||[]},_e.prototype.getElementByTid=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByTid($e)},_e.prototype.getElementByName=function($e,Ae){return Ae==null&&(Ae=0),this.printPanels[Ae].getElementByName($e)},_e.prototype.getPanel=function($e){return $e==null&&($e=0),this.printPanels[$e]},_e.prototype.loadAllImages=function($e,Ae,je){var ke=this;je==null&&(je=0);for(var Ie=$e[0].getElementsByTagName("img"),xe=!0,Be=0;Be<Ie.length;Be++){var Ce=Ie[Be];Ce.src&&Ce.src!==window.location.href&&Ce.src.indexOf("base64")==-1&&(Ce&&Ce.naturalWidth!==void 0&&Ce.naturalWidth!==0&&Ce.complete||(xe=!1))}je++,!xe&&je<10?setTimeout(function(){ke.loadAllImages($e,Ae,je)},500):Ae()},_e.prototype.setFontList=function($e){this.fontList=$e},_e.prototype.getFontList=function(){return this.fontList},_e.prototype.setFields=function($e){this.fields=$e},_e.prototype.getFields=function(){return this.fields},_e.prototype.setOnImageChooseClick=function($e){this.onImageChooseClick=$e},_e.prototype.getOnImageChooseClick=function(){return this.onImageChooseClick},_e.prototype.getHtmlStable=function($e){var Ae=this;return new Promise(function(je){var ke=$$g('<div style="position:fixed;left:-10000px;top:-10000px;visibility:hidden;z-index:-1;"></div>');$$g("body").append(ke);var Ie=Ae.getHtml($e);ke.html(Ie);var xe=function(Ee,Se){var Pe=0,Me=function(){for(var Te=Ee[0].getElementsByTagName("img"),Fe=!0,He=0;He<Te.length;He++){var Oe=Te[He];if(!Oe.complete||typeof Oe.naturalWidth<"u"&&Oe.naturalWidth===0){Fe=!1;break}}Pe++,!Fe&&Pe<20?setTimeout(Me,250):Se()};Me()},Be=function(Ee){try{document.fonts&&document.fonts.ready&&typeof document.fonts.ready.then=="function"?document.fonts.ready.then(function(){Ee()}).catch(function(){Ee()}):Ee()}catch{Ee()}},Ce=function(Ee,Se){var Pe=Date.now(),Me;try{Me=new ResizeObserver(function(){Pe=Date.now()}),Me.observe(Ee[0])}catch{Se();return}var Te=function(){if(Date.now()-Pe>=120){try{Me.disconnect()}catch{}Se()}else setTimeout(Te,60)};setTimeout(Te,120)};xe(ke,function(){Be(function(){Ce(ke,function(){var Ee=Ae.getHtml($e);ke.remove(),je(Ee)})})})})},_e.prototype.getFieldsInPanel=function(){var $e=[];return this.printPanels.forEach(function(Ae){$e=$e.concat(Ae.getFieldsInPanel())}),$e},_e.prototype.getTestData=function(){var $e={};return this.printPanels.forEach(function(Ae){$e=Object.assign($e,Ae.getTestData())}),$e},_e.prototype.update=function($e,Ae){var je=this;try{if($e&&_typeof$1($e)=="object"&&$e.panels.length>0){var ke=je.printPanels.length-1;$e.panels.forEach(function(Ie,xe){if(xe>ke){je.printPanels.push(new pt(Ie,je.id));var Be=je.printPanels[xe];je.container.append(Be.getTarget()),xe>0&&Be.disable(),Be.design(je.designOptions),je.printPaginationCreator&&je.printPaginationCreator.buildPagination()}var Ce=new rt(Ie);je.editingPanel=je.printPanels[xe],je.editingPanel.update(Ce)}),je.selectPanel(Ae||0)}}catch(Ie){console.log(Ie),je.onUpdateError&&je.onUpdateError(Ie)}},_e.prototype.getSelectEls=function(){var $e=this,Ae=[];return $e.editingPanel.mouseRect&&$e.editingPanel.mouseRect.target&&$$g(".mouseRect").length?Ae=$e.editingPanel.getElementInRect($e.editingPanel.mouseRect):Ae=$e.editingPanel.printElements.filter(function(je){var ke=je&&je.designTarget&&je.designTarget.children&&je.designTarget.children().last(),Ie=ke&&ke.hasClass&&ke.hasClass("selected"),xe=ke&&ke.css&&ke.css("display")==="block",Be=je&&je.printElementType&&je.printElementType.type&&je.printElementType.type.includes("table");return!Be&&(xe||Ie)}),Ae},_e.prototype.updateOption=function($e,Ae){var je=this.getSelectEls();je&&je.length&&(je.forEach(function(ke){ke.updateOption($e,Ae,!0)}),o.a.event.trigger("hiprintTemplateDataChanged_"+this.id,"批量修改"))},_e.prototype.setElsAlign=function($e){var Ae=this,je=this.getSelectEls();if(je.length){var ke=this.editingPanel,Ie=ke&&ke.width,xe=ke&&ke.height,Be=["left","right","top","bottom","vertical","horizontal"].includes($e)&&Ie&&xe;if(Be)switch($e){case"left":je.forEach(function(Oe){Oe.updateSizeAndPositionOptions(0),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"vertical":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),qe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,(qe-Qe)/2);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"right":je.forEach(function(Oe){var Qe=Oe.options.getWidth&&Oe.options.getWidth()||Oe.options.width,We=Oe.designTarget&&Oe.designTarget.parents&&Oe.designTarget.parents(".hiprint-printPaper-content").first(),Ye=We&&We.width&&We.width(),qe=Ye?window.hinnn&&window.hinnn.px&&window.hinnn.px.toPt(Ye):Ie,rr=Math.max(0,qe-Qe);Oe.updateSizeAndPositionOptions(rr),Oe.designTarget.css("left",Oe.options.displayLeft())});break;case"top":je.forEach(function(Oe){var Qe=Ae.editingPanel&&Ae.editingPanel.paperHeader||0;Oe.updateSizeAndPositionOptions(void 0,Qe),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"horizontal":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperHeader||0,Ye=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,qe=Math.max(0,Ye-We),rr=We+Math.max(0,(qe-Qe)/2);Oe.updateSizeAndPositionOptions(void 0,rr),Oe.designTarget.css("top",Oe.options.displayTop())});break;case"bottom":je.forEach(function(Oe){var Qe=Oe.options.getHeight&&Oe.options.getHeight()||Oe.options.height,We=Ae.editingPanel&&Ae.editingPanel.paperFooter||xe,Ye=Math.max(0,We-Qe);Oe.updateSizeAndPositionOptions(void 0,Ye),Oe.designTarget.css("top",Oe.options.displayTop())});break}else{var Ce=Math.min.apply(null,je.map(function(Oe){return Oe.options.left})),Ee=Math.max.apply(null,je.map(function(Oe){return Oe.options.left+Oe.options.width})),Se=Math.min.apply(null,je.map(function(Oe){return Oe.options.top})),Pe=Math.max.apply(null,je.map(function(Oe){return Oe.options.top+Oe.options.height}));switch($e){case"distributeHor":var Me=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.width},0),Te=(Ee-Ce-Me)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.left-Qe.options.left}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(je[Qe-1].options.left+je[Qe-1].options.width+Te),Oe.designTarget.css("left",Oe.options.displayLeft()))});break;case"distributeVer":var Fe=[].reduce.call(je,function(Oe,Qe){return Oe+Qe.options.height},0),He=(Pe-Se-Fe)/(je.length-1);je.sort(function(Oe,Qe){return Oe.options.top-Qe.options.top}),je.forEach(function(Oe,Qe){[0,je.length-1].includes(Qe)||(Oe.updateSizeAndPositionOptions(void 0,je[Qe-1].options.top+je[Qe-1].options.height+He),Oe.designTarget.css("top",Oe.options.displayTop()))});break}}}},_e.prototype.setElsSpace=function($e,Ae){var je=this.getSelectEls();je.length&&(Ae?(je.sort(function(ke,Ie){return ke.options.left-Ie.options.left}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(je[Ie-1].options.left+je[Ie-1].options.width+$e),ke.designTarget.css("left",ke.options.displayLeft()))})):(je.sort(function(ke,Ie){return ke.options.top-Ie.options.top}),je.forEach(function(ke,Ie){Ie>0&&(ke.updateSizeAndPositionOptions(void 0,je[Ie-1].options.top+je[Ie-1].options.height+$e),ke.designTarget.css("top",ke.options.displayTop()))})))},_e.prototype.setElsZIndex=function($e){var Ae=this.getSelectEls();if(!(!Ae||!Ae.length)){var je=function(Ce){var Ee=parseInt(Ce,10);return isNaN(Ee)?0:Ee},ke=function(Ce){if(!Ce)return 0;var Ee=Ce.options&&(Ce.options.zIndex||Ce.options["z-index"]);if(typeof Ee<"u")return je(Ee);var Se=Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index");return je(Se)},Ie=function(Ce,Ee){if(Ce&&(Ce.options&&(Ce.options.zIndex=Ee),Ce.designTarget&&Ce.designTarget.css&&Ce.designTarget.css("z-index",Ee),typeof Ce.updateOption=="function"))try{Ce.updateOption("zIndex",Ee,!0)}catch{}},xe=999,Be=0;switch($e){case"top":Ae.forEach(function(Ce){Ie(Ce,xe)});break;case"bottom":Ae.forEach(function(Ce){Ie(Ce,Be)});break;case"up":Ae.forEach(function(Ce){Ie(Ce,ke(Ce)+1)});break;case"down":Ae.forEach(function(Ce){var Ee=ke(Ce)-1;Ie(Ce,Ee<0?0:Ee)});break;default:return}try{o.a.event.trigger("hiprintTemplateDataChanged_"+(this.id||this.templateId),"层级:"+$e)}catch{}}},_e.prototype.initAutoSave=function(){var $e=this;o.a.event.on("hiprintTemplateDataShortcutKey_"+this.id,function(Ae){if($e.history)switch(Ae){case"undo":if($e.historyPos>0){$e.historyPos-=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break;case"redo":if($e.historyPos<$e.historyList.length-1){$e.historyPos+=1;var je=$e.historyList[$e.historyPos];$e.update(je.json)}break}}),o.a.event.on("hiprintTemplateDataChanged_"+this.id,function(Ae){if($e.history){var je=$e.dataMode==1?$e.getJson():$e.getJsonTid();$e.lastJson=je,$e.historyPos<$e.historyList.length-1&&($e.historyList=$e.historyList.slice(0,$e.historyPos+1)),$e.historyList.push({id:s.a.instance.guid(),type:Ae,json:je}),$e.historyList.length>50?$e.historyList=$e.historyList.slice(0,1).concat($e.historyList.slice(1,50)):$e.historyPos+=1,$e.onDataChanged&&$e.onDataChanged(Ae,je)}})},_e}();function ht(_e){this.getHtml(_e).hiwprint()}function ft(_e,$e,Ae){$$g.extend({},_e||{}).imgToBase64=!0;var je=new ct({});je.on("printSuccess",$e),je.on("printError",Ae),je.printByHtml2(this.getHtml(_e),_e.options)}function gt(_e){var $e=void 0;return _e&&_e.templates.forEach(function(Ae,je){var ke=$$g.extend({},Ae.options||{});_e.imgToBase64&&(ke.imgToBase64=!0),$e?$e.append(Ae.template.getHtml(Ae.data,ke).html()):$e=Ae.template.getHtml(Ae.data,ke)}),$e}function mt(_e){p.a.instance.init(_e),p.a.instance.providers&&p.a.instance.providers.forEach(function($e){$e.addElementTypes(a.instance)}),window.autoConnect&&(p.a.instance.host!=hiwebSocket.host||p.a.instance.token!=hiwebSocket.token)&&(hiwebSocket.stop(),p.a.instance.host&&(hiwebSocket.host=p.a.instance.host),p.a.instance.token&&(hiwebSocket.token=p.a.instance.token),hiwebSocket.start()),p.a.instance.lang&&Object.keys(languages).includes(p.a.instance.lang)?i18n.lang=p.a.instance.lang:i18n.lang="cn"}function cig(_e){_e?_e&&Object.keys(_e).forEach(function($e){if($e=="optionItems"&&_e.optionItems&&_e.optionItems.length)p.a.instance.registerItems(_e.optionItems);else if(_e[$e].tabs&&_e[$e].tabs.length)_e[$e].tabs.forEach(function(Ie,xe){if(Ie.replace)$$g.extend(p.a.instance[$e].tabs[xe],Ie);else{var Be=Ie.options,Ce=p.a.instance[$e].tabs[xe].options;Be.forEach(function(Ee){var Se=Ce.findIndex(function(Pe){return Pe.name==Ee.name});Se>-1?Ce[Se].hidden=Ee.hidden:Ee.after?(Se=Ce.findIndex(function(Pe){return Pe.name==Ee.after}),Se>-1&&Ce.splice(Se+1,0,Ee)):Ce.push(Ee)}),$$g.extend(p.a.instance[$e].tabs[xe],{name:Ie.name,options:Ce})}}),delete _e[$e].tabs;else if(_e[$e].supportOptions){var Ae=_e[$e].supportOptions,je=p.a.instance[$e].supportOptions;Ae.forEach(function(Ie){var xe=je.findIndex(function(Be){return Be.name==Ie.name});xe>-1?je[xe].hidden=Ie.hidden:Ie.after?(xe=je.findIndex(function(Be){return Be.name==Ie.after}),xe>-1&&je.splice(xe+1,0,Ie)):je.push(Ie)}),$$g.extend(p.a.instance[$e].supportOptions,je),delete _e[$e].supportOptions}else{var ke={};ke[$e]=_e[$e],$$g.extend(p.a.instance,ke)}}):$$g.extend(p.a.instance,HIPRINT_CONFIG)}function uep(_e,$e){return a.instance.updateElementType(_e,$e)}function rpl(_e){p.a.instance.clear("printerList"),p.a.instance.on("printerList",_e),hiwebSocket.refreshPrinterList()}function getClients(_e){p.a.instance.clear("clients"),p.a.instance.on("clients",_e),hiwebSocket.getClients()}function getClientInfo(_e){p.a.instance.clear("clientInfo"),p.a.instance.on("getClientInfo",_e),hiwebSocket.getClientInfo()}function getAddr(_e,$e,...Ae){p.a.instance.clear("address_"+_e),p.a.instance.on("address_"+_e,$e),hiwebSocket.getAddress(_e,...Ae)}function ippPrint(_e,$e,Ae){p.a.instance.clear("ippPrinterCallback"),p.a.instance.on("ippPrinterCallback",$e),p.a.instance.clear("ippPrinterConnected"),p.a.instance.on("ippPrinterConnected",Ae),hiwebSocket.ippPrint(_e)}function ippRequest(_e,$e){p.a.instance.clear("ippRequestCallback"),p.a.instance.on("ippRequestCallback",$e),hiwebSocket.ippRequest(_e)}n.d(e,"init",function(){return mt}),n.d(e,"setConfig",function(){return cig}),n.d(e,"updateElementType",function(){return uep}),n.d(e,"hiwebSocket",function(){return hiwebSocket}),n.d(e,"refreshPrinterList",function(){return rpl}),n.d(e,"getClients",function(){return getClients}),n.d(e,"getClientInfo",function(){return getClientInfo}),n.d(e,"getAddress",function(){return getAddr}),n.d(e,"ippPrint",function(){return ippPrint}),n.d(e,"ippRequest",function(){return ippRequest}),n.d(e,"PrintElementTypeManager",function(){return it}),n.d(e,"PrintElementTypeGroup",function(){return ot}),n.d(e,"PrintTemplate",function(){return ct}),n.d(e,"print",function(){return ht}),n.d(e,"print2",function(){return ft}),n.d(e,"getHtml",function(){return gt}),$$g(document).ready(function(){console.log("document ready"),console.log(window.autoConnect),hiwebSocket.hasIo()&&window.autoConnect&&hiwebSocket.start()})}]),defaultElementTypeProvider=defaultTypeProvider(hiprint);const version="1.0.15",_export_sfc=(_e,$e)=>{const Ae=_e.__vccOpts||_e;for(const[je,ke]of $e)Ae[je]=ke;return Ae},_hoisted_1$3={class:"vgp-designer-wrap"},_sfc_main$3={__name:"Designer",props:{template:{type:Object,default:()=>({})},printData:{type:Object,default:()=>({})},templateKey:{type:String,default:"default-template"},title:{type:String,default:""},designOptions:{type:Object,default:()=>({grid:!0,activePanel:!0})},autoConnect:{type:Boolean,default:!0},paperList:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},authKey:{type:String,default:""}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(null);function ke(Ee){setConfig(Ae.config),register({authKey:Ae.authKey,plugins:Ae.plugins}),je.value=createPrintTemplate({template:Ee}),je.value.design("#SVPrint",Ae.designOptions)}vue.onMounted(()=>{ke(Ae.template)}),vue.watch(()=>Ae.template,Ee=>{Ee&&ke(Ee)});function Ie(){return je.value}function xe(){return je.value?je.value.getJson():{}}function Be(Ee){je.value&&je.value.setJson(Ee)}function Ce(){return xe()}return $e({init:ke,getTarget:Ie,getTemplateJson:xe,setTemplateJson:Be,exportJson:Ce}),(Ee,Se)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$3,[vue.renderSlot(Ee.$slots,"header",{},void 0,!0),Se[0]||(Se[0]=vue.createElementVNode("div",{id:"SVPrint",class:"vgp-designer-target"},null,-1)),vue.renderSlot(Ee.$slots,"other",{},void 0,!0)]))}},Designer=_export_sfc(_sfc_main$3,[["__scopeId","data-v-c3735ff8"]]),_hoisted_1$2={class:"vgp-header"},_hoisted_2$2={class:"left"},_hoisted_3$1=["innerHTML"],_hoisted_4$1={class:"title"},_hoisted_5={class:"center"},_hoisted_6={class:"right"},_sfc_main$2={__name:"Header",props:{logoHtml:{type:String,default:'<i class="svicon sv-print"></i>'},title:{type:String,default:"vg-print"},reEle:{type:[String,Boolean],default:!1},eleList:{type:Array,default:()=>[]},reMenu:{type:[String,Boolean],default:!1},menuList:{type:Array,default:()=>[]},onPreviewClick:{type:Function,default:null}},setup(_e,{expose:$e}){const Ae=_e;function je(ke){return typeof Ae.onPreviewClick=="function"?Ae.onPreviewClick(ke):!0}return $e({previewClick:je}),(ke,Ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[vue.renderSlot(ke.$slots,"headerLeft",{},()=>[vue.createElementVNode("span",{innerHTML:_e.logoHtml},null,8,_hoisted_3$1),vue.createElementVNode("span",_hoisted_4$1,vue.toDisplayString(_e.title),1)],!0)]),vue.createElementVNode("div",_hoisted_5,[vue.renderSlot(ke.$slots,"headerCenter",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(ke.$slots,"headerRight",{},void 0,!0)])]))}},Header=_export_sfc(_sfc_main$2,[["__scopeId","data-v-c71a08f5"]]),_hoisted_1$1={key:0,class:"vgp-preview-modal"},_hoisted_2$1={class:"vgp-preview-panel"},_hoisted_3={class:"tools"},_hoisted_4=["value"],_sfc_main$1={__name:"Preview",props:{printTemplate:{type:[Object],default:void 0},printData:{type:Object,default:void 0},printerList:{type:Array,default:()=>[]},selectedPrinter:{type:String,default:""},showPdf:{type:Boolean,default:!0},showImg:{type:Boolean,default:!0},showPrint2:{type:Boolean,default:!0},modalShow:{type:Boolean,default:!1}},setup(_e,{expose:$e}){const Ae=_e,je=vue.ref(!1),ke=vue.ref(null),Ie=vue.ref([]),xe=vue.ref("");function Be(Qe,We){ke.value=Qe,Ce(We)}function Ce(Qe){if(!ke.value)return;const We=ke.value.getHtml(Qe),Ye=document.getElementById("preview_content_tasks");Ye&&(Ye.innerHTML=We)}function Ee(){je.value=!0}function Se(){je.value=!1}function Pe(){return ke.value}function Me(){ke.value&&ke.value.print(Ae.printData||{})}function Te(){ke.value&&ke.value.print2(Ae.printData||{},{printer:xe.value})}async function Fe(){ke.value&&await ke.value.toPdf(Ae.printData||{},"打印预览pdf")}async function He(){ke.value&&await ke.value.toImage(Ae.printData||{})}function Oe(){try{hiprint&&hiprint.hiwebSocket&&(Ie.value=hiprint.hiwebSocket.getPrinterList()||[])}catch{}}return $e({init:Be,show:Ee,hide:Se,getTarget:Pe,print:Me,directPrint:Te,toPdf:Fe,toImage:He,refreshPrinters:Oe}),vue.watch(()=>Ae.modalShow,Qe=>{je.value=!!Qe}),(Qe,We)=>je.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3,[_e.showPdf?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:Fe},"导出PDF")):vue.createCommentVNode("",!0),_e.showImg?(vue.openBlock(),vue.createElementBlock("button",{key:1,onClick:He},"导出图片")):vue.createCommentVNode("",!0),_e.showPrint2?(vue.openBlock(),vue.createElementBlock("button",{key:2,onClick:Te},"直接打印")):vue.createCommentVNode("",!0),vue.createElementVNode("button",{onClick:Me},"浏览器打印"),vue.withDirectives(vue.createElementVNode("select",{"onUpdate:modelValue":We[0]||(We[0]=Ye=>xe.value=Ye)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ie.value,Ye=>(vue.openBlock(),vue.createElementBlock("option",{key:Ye.name,value:Ye.name},vue.toDisplayString(Ye.label||Ye.name),9,_hoisted_4))),128))],512),[[vue.vModelSelect,xe.value]]),vue.createElementVNode("button",{onClick:Oe},"刷新"),vue.createElementVNode("button",{onClick:Se},"关闭")]),We[1]||(We[1]=vue.createElementVNode("div",{id:"preview_content_tasks"},null,-1))])])):vue.createCommentVNode("",!0)}},Preview=_export_sfc(_sfc_main$1,[["__scopeId","data-v-9764769e"]]),_hoisted_1={class:"title"},_hoisted_2={class:"body"},_sfc_main={__name:"DragBox",props:{target:{type:String,default:"SVPrint"},dragKey:{type:String,default:"default"},dragStyle:{type:String,default:""},mode:{type:String,default:"default"},show:{type:Boolean,default:!1}},setup(_e){const $e=_e,Ae=vue.computed(()=>`mode-${$e.mode}`);return(je,ke)=>_e.show?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["vgp-dragbox",Ae.value]),style:vue.normalizeStyle(_e.dragStyle)},[vue.createElementVNode("div",_hoisted_1,[vue.renderSlot(je.$slots,"iconTitle",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2,[vue.renderSlot(je.$slots,"body",{},void 0,!0)])],6)):vue.createCommentVNode("",!0)}},DragBox=_export_sfc(_sfc_main,[["__scopeId","data-v-3bdcea45"]]);let autoConnect=function(_e){console.log("autoConnect"),window.autoConnect=!0,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.start(_e)},disAutoConnect=function(){console.log("disAutoConnect"),window.autoConnect=!1,window.hiwebSocket&&window.hiwebSocket.hasIo()&&window.hiwebSocket.stop()},hiPrintPlugin={disAutoConnect,install:function(_e,$e="$hiPrint",Ae=!0){Ae||disAutoConnect();let je=_e.prototype||_e.config.globalProperties;je[$e]=hiprint,je.$print=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print(...xe),Be},je.$print2=function(ke=defaultElementTypeProvider,Ie,...xe){hiprint.init({providers:[new ke]});var Be=new hiprint.PrintTemplate({template:Ie});return Be.print2(...xe),Be}}};hiprint.version=version,window.hiprint=hiprint;function register({authKey:_e="",plugins:$e=[]}={}){const Ae=$e.map(je=>typeof je=="function"?je():je).filter(Boolean);return Ae.length||Ae.push(new defaultElementTypeProvider),hiprint.init({providers:Ae}),hiprint.authKey=_e,hiprint}function setConfig(_e={}){return hiprint.config=_e,hiprint}function createPrintTemplate(_e={}){return new hiprint.PrintTemplate(_e)}function print({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print($e,Ae)}function print2({templateJson:_e,data:$e={},options:Ae={},provider:je=defaultElementTypeProvider}={}){return hiprint.init({providers:[new je]}),new hiprint.PrintTemplate({template:_e}).print2($e,Ae)}async function toPdf({template:_e,data:$e,name:Ae,pdfOptions:je}={}){return _e.toPdf($e,Ae,je)}async function toImage({template:_e,data:$e,imageOptions:Ae}={}){return _e.toImage($e,Ae)}/*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */function _typeof(_e){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($e){return typeof $e}:function($e){return $e&&typeof Symbol=="function"&&$e.constructor===Symbol&&$e!==Symbol.prototype?"symbol":typeof $e},_typeof(_e)}function _setPrototypeOf(_e,$e){return _setPrototypeOf=Object.setPrototypeOf||function(je,ke){return je.__proto__=ke,je},_setPrototypeOf(_e,$e)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(_e,$e,Ae){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(ke,Ie,xe){var Be=[null];Be.push.apply(Be,Ie);var Ce=Function.bind.apply(ke,Be),Ee=new Ce;return xe&&_setPrototypeOf(Ee,xe.prototype),Ee},_construct.apply(null,arguments)}function _toConsumableArray(_e){return _arrayWithoutHoles(_e)||_iterableToArray(_e)||_unsupportedIterableToArray(_e)||_nonIterableSpread()}function _arrayWithoutHoles(_e){if(Array.isArray(_e))return _arrayLikeToArray(_e)}function _iterableToArray(_e){if(typeof Symbol<"u"&&_e[Symbol.iterator]!=null||_e["@@iterator"]!=null)return Array.from(_e)}function _unsupportedIterableToArray(_e,$e){if(_e){if(typeof _e=="string")return _arrayLikeToArray(_e,$e);var Ae=Object.prototype.toString.call(_e).slice(8,-1);if(Ae==="Object"&&_e.constructor&&(Ae=_e.constructor.name),Ae==="Map"||Ae==="Set")return Array.from(_e);if(Ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ae))return _arrayLikeToArray(_e,$e)}}function _arrayLikeToArray(_e,$e){($e==null||$e>_e.length)&&($e=_e.length);for(var Ae=0,je=new Array($e);Ae<$e;Ae++)je[Ae]=_e[Ae];return je}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2042
2042
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var hasOwnProperty=Object.hasOwnProperty,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf=Object.getPrototypeOf,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,freeze=Object.freeze,seal=Object.seal,create=Object.create,_ref=typeof Reflect<"u"&&Reflect,apply=_ref.apply,construct=_ref.construct;apply||(apply=function($e,Ae,je){return $e.apply(Ae,je)}),freeze||(freeze=function($e){return $e}),seal||(seal=function($e){return $e}),construct||(construct=function($e,Ae){return _construct($e,_toConsumableArray(Ae))});var arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(_e){return function($e){for(var Ae=arguments.length,je=new Array(Ae>1?Ae-1:0),ke=1;ke<Ae;ke++)je[ke-1]=arguments[ke];return apply(_e,$e,je)}}function unconstruct(_e){return function(){for(var $e=arguments.length,Ae=new Array($e),je=0;je<$e;je++)Ae[je]=arguments[je];return construct(_e,Ae)}}function addToSet(_e,$e,Ae){var je;Ae=(je=Ae)!==null&&je!==void 0?je:stringToLowerCase,setPrototypeOf&&setPrototypeOf(_e,null);for(var ke=$e.length;ke--;){var Ie=$e[ke];if(typeof Ie=="string"){var xe=Ae(Ie);xe!==Ie&&(isFrozen($e)||($e[ke]=xe),Ie=xe)}_e[Ie]=!0}return _e}function clone(_e){var $e=create(null),Ae;for(Ae in _e)apply(hasOwnProperty,_e,[Ae])===!0&&($e[Ae]=_e[Ae]);return $e}function lookupGetter(_e,$e){for(;_e!==null;){var Ae=getOwnPropertyDescriptor(_e,$e);if(Ae){if(Ae.get)return unapply(Ae.get);if(typeof Ae.value=="function")return unapply(Ae.value)}_e=getPrototypeOf(_e)}function je(ke){return console.warn("fallback value for",ke),null}return je}var html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\${[\w\W]*}/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i),getGlobal=function _e(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function _e($e,Ae){if(_typeof($e)!=="object"||typeof $e.createPolicy!="function")return null;var je=null,ke="data-tt-policy-suffix";Ae.currentScript&&Ae.currentScript.hasAttribute(ke)&&(je=Ae.currentScript.getAttribute(ke));var Ie="dompurify"+(je?"#"+je:"");try{return $e.createPolicy(Ie,{createHTML:function(Be){return Be},createScriptURL:function(Be){return Be}})}catch{return console.warn("TrustedTypes policy "+Ie+" could not be created."),null}};function createDOMPurify(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal(),$e=function(Mr){return createDOMPurify(Mr)};if($e.version="2.5.8",$e.removed=[],!_e||!_e.document||_e.document.nodeType!==9)return $e.isSupported=!1,$e;var Ae=_e.document,je=_e.document,ke=_e.DocumentFragment,Ie=_e.HTMLTemplateElement,xe=_e.Node,Be=_e.Element,Ce=_e.NodeFilter,Ee=_e.NamedNodeMap,Se=Ee===void 0?_e.NamedNodeMap||_e.MozNamedAttrMap:Ee,Pe=_e.HTMLFormElement,Me=_e.DOMParser,Te=_e.trustedTypes,Fe=Be.prototype,He=lookupGetter(Fe,"cloneNode"),Oe=lookupGetter(Fe,"nextSibling"),Qe=lookupGetter(Fe,"childNodes"),We=lookupGetter(Fe,"parentNode");if(typeof Ie=="function"){var Ye=je.createElement("template");Ye.content&&Ye.content.ownerDocument&&(je=Ye.content.ownerDocument)}var qe=_createTrustedTypesPolicy(Te,Ae),rr=qe?qe.createHTML(""):"",Ze=je,Ke=Ze.implementation,St=Ze.createNodeIterator,tr=Ze.createDocumentFragment,Xe=Ze.getElementsByTagName,Ge=Ae.importNode,Je={};try{Je=clone(je).documentMode?je.documentMode:{}}catch{}var ir={};$e.isSupported=typeof We=="function"&&Ke&&Ke.createHTMLDocument!==void 0&&Je!==9;var ar=MUSTACHE_EXPR,lr=ERB_EXPR,gr=TMPLIT_EXPR,dr=DATA_ATTR,hr=ARIA_ATTR,kr=IS_SCRIPT_OR_DATA,Ar=ATTR_WHITESPACE,Qr=CUSTOM_ELEMENT,or=IS_ALLOWED_URI,cr=null,mr=addToSet({},[].concat(_toConsumableArray(html$1),_toConsumableArray(svg$1),_toConsumableArray(svgFilters),_toConsumableArray(mathMl$1),_toConsumableArray(text))),wr=null,Tr=addToSet({},[].concat(_toConsumableArray(html),_toConsumableArray(svg),_toConsumableArray(mathMl),_toConsumableArray(xml))),Pr=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Lr=null,Rr=null,Vr=!0,Xr=!0,_i=!1,ui=!0,xi=!1,Wr=!0,Cr=!1,Mi=!1,wi=!1,si=!1,fi=!1,gi=!1,li=!0,yi=!1,Ei="user-content-",Li=!0,Fi=!1,Oi={},Vi=null,Si=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Di=null,ji=addToSet({},["audio","video","img","source","image","track"]),oa=null,Xi=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),na="http://www.w3.org/1998/Math/MathML",Ni="http://www.w3.org/2000/svg",sr="http://www.w3.org/1999/xhtml",yr=sr,jr=!1,Fr=null,Ur=addToSet({},[na,Ni,sr],stringToString),Jr,Sr=["application/xhtml+xml","text/html"],Kr="text/html",Ir,Or=null,Yr=je.createElement("form"),$i=function(Mr){return Mr instanceof RegExp||Mr instanceof Function},Hr=function(Mr){Or&&Or===Mr||((!Mr||_typeof(Mr)!=="object")&&(Mr={}),Mr=clone(Mr),Jr=Sr.indexOf(Mr.PARSER_MEDIA_TYPE)===-1?Jr=Kr:Jr=Mr.PARSER_MEDIA_TYPE,Ir=Jr==="application/xhtml+xml"?stringToString:stringToLowerCase,cr="ALLOWED_TAGS"in Mr?addToSet({},Mr.ALLOWED_TAGS,Ir):mr,wr="ALLOWED_ATTR"in Mr?addToSet({},Mr.ALLOWED_ATTR,Ir):Tr,Fr="ALLOWED_NAMESPACES"in Mr?addToSet({},Mr.ALLOWED_NAMESPACES,stringToString):Ur,oa="ADD_URI_SAFE_ATTR"in Mr?addToSet(clone(Xi),Mr.ADD_URI_SAFE_ATTR,Ir):Xi,Di="ADD_DATA_URI_TAGS"in Mr?addToSet(clone(ji),Mr.ADD_DATA_URI_TAGS,Ir):ji,Vi="FORBID_CONTENTS"in Mr?addToSet({},Mr.FORBID_CONTENTS,Ir):Si,Lr="FORBID_TAGS"in Mr?addToSet({},Mr.FORBID_TAGS,Ir):{},Rr="FORBID_ATTR"in Mr?addToSet({},Mr.FORBID_ATTR,Ir):{},Oi="USE_PROFILES"in Mr?Mr.USE_PROFILES:!1,Vr=Mr.ALLOW_ARIA_ATTR!==!1,Xr=Mr.ALLOW_DATA_ATTR!==!1,_i=Mr.ALLOW_UNKNOWN_PROTOCOLS||!1,ui=Mr.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xi=Mr.SAFE_FOR_TEMPLATES||!1,Wr=Mr.SAFE_FOR_XML!==!1,Cr=Mr.WHOLE_DOCUMENT||!1,si=Mr.RETURN_DOM||!1,fi=Mr.RETURN_DOM_FRAGMENT||!1,gi=Mr.RETURN_TRUSTED_TYPE||!1,wi=Mr.FORCE_BODY||!1,li=Mr.SANITIZE_DOM!==!1,yi=Mr.SANITIZE_NAMED_PROPS||!1,Li=Mr.KEEP_CONTENT!==!1,Fi=Mr.IN_PLACE||!1,or=Mr.ALLOWED_URI_REGEXP||or,yr=Mr.NAMESPACE||sr,Pr=Mr.CUSTOM_ELEMENT_HANDLING||{},Mr.CUSTOM_ELEMENT_HANDLING&&$i(Mr.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pr.tagNameCheck=Mr.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Mr.CUSTOM_ELEMENT_HANDLING&&$i(Mr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pr.attributeNameCheck=Mr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Mr.CUSTOM_ELEMENT_HANDLING&&typeof Mr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Pr.allowCustomizedBuiltInElements=Mr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xi&&(Xr=!1),fi&&(si=!0),Oi&&(cr=addToSet({},_toConsumableArray(text)),wr=[],Oi.html===!0&&(addToSet(cr,html$1),addToSet(wr,html)),Oi.svg===!0&&(addToSet(cr,svg$1),addToSet(wr,svg),addToSet(wr,xml)),Oi.svgFilters===!0&&(addToSet(cr,svgFilters),addToSet(wr,svg),addToSet(wr,xml)),Oi.mathMl===!0&&(addToSet(cr,mathMl$1),addToSet(wr,mathMl),addToSet(wr,xml))),Mr.ADD_TAGS&&(cr===mr&&(cr=clone(cr)),addToSet(cr,Mr.ADD_TAGS,Ir)),Mr.ADD_ATTR&&(wr===Tr&&(wr=clone(wr)),addToSet(wr,Mr.ADD_ATTR,Ir)),Mr.ADD_URI_SAFE_ATTR&&addToSet(oa,Mr.ADD_URI_SAFE_ATTR,Ir),Mr.FORBID_CONTENTS&&(Vi===Si&&(Vi=clone(Vi)),addToSet(Vi,Mr.FORBID_CONTENTS,Ir)),Li&&(cr["#text"]=!0),Cr&&addToSet(cr,["html","head","body"]),cr.table&&(addToSet(cr,["tbody"]),delete Lr.tbody),freeze&&freeze(Mr),Or=Mr)},ti=addToSet({},["mi","mo","mn","ms","mtext"]),Zr=addToSet({},["annotation-xml"]),Gr=addToSet({},["title","style","font","a","script"]),ni=addToSet({},svg$1);addToSet(ni,svgFilters),addToSet(ni,svgDisallowed);var qr=addToSet({},mathMl$1);addToSet(qr,mathMlDisallowed);var ai=function(Mr){var di=We(Mr);(!di||!di.tagName)&&(di={namespaceURI:yr,tagName:"template"});var ci=stringToLowerCase(Mr.tagName),Aa=stringToLowerCase(di.tagName);return Fr[Mr.namespaceURI]?Mr.namespaceURI===Ni?di.namespaceURI===sr?ci==="svg":di.namespaceURI===na?ci==="svg"&&(Aa==="annotation-xml"||ti[Aa]):!!ni[ci]:Mr.namespaceURI===na?di.namespaceURI===sr?ci==="math":di.namespaceURI===Ni?ci==="math"&&Zr[Aa]:!!qr[ci]:Mr.namespaceURI===sr?di.namespaceURI===Ni&&!Zr[Aa]||di.namespaceURI===na&&!ti[Aa]?!1:!qr[ci]&&(Gr[ci]||!ni[ci]):!!(Jr==="application/xhtml+xml"&&Fr[Mr.namespaceURI]):!1},mi=function(Mr){arrayPush($e.removed,{element:Mr});try{Mr.parentNode.removeChild(Mr)}catch{try{Mr.outerHTML=rr}catch{Mr.remove()}}},Ii=function(Mr,di){try{arrayPush($e.removed,{attribute:di.getAttributeNode(Mr),from:di})}catch{arrayPush($e.removed,{attribute:null,from:di})}if(di.removeAttribute(Mr),Mr==="is"&&!wr[Mr])if(si||fi)try{mi(di)}catch{}else try{di.setAttribute(Mr,"")}catch{}},Hi=function(Mr){var di,ci;if(wi)Mr="<remove></remove>"+Mr;else{var Aa=stringMatch(Mr,/^[\r\n\t ]+/);ci=Aa&&Aa[0]}Jr==="application/xhtml+xml"&&yr===sr&&(Mr='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Mr+"</body></html>");var va=qe?qe.createHTML(Mr):Mr;if(yr===sr)try{di=new Me().parseFromString(va,Jr)}catch{}if(!di||!di.documentElement){di=Ke.createDocument(yr,"template",null);try{di.documentElement.innerHTML=jr?rr:va}catch{}}var ua=di.body||di.documentElement;return Mr&&ci&&ua.insertBefore(je.createTextNode(ci),ua.childNodes[0]||null),yr===sr?Xe.call(di,Cr?"html":"body")[0]:Cr?di.documentElement:ua},Zi=function(Mr){return St.call(Mr.ownerDocument||Mr,Mr,Ce.SHOW_ELEMENT|Ce.SHOW_COMMENT|Ce.SHOW_TEXT|Ce.SHOW_PROCESSING_INSTRUCTION|Ce.SHOW_CDATA_SECTION,null,!1)},Gi=function(Mr){return Mr instanceof Pe&&(typeof Mr.nodeName!="string"||typeof Mr.textContent!="string"||typeof Mr.removeChild!="function"||!(Mr.attributes instanceof Se)||typeof Mr.removeAttribute!="function"||typeof Mr.setAttribute!="function"||typeof Mr.namespaceURI!="string"||typeof Mr.insertBefore!="function"||typeof Mr.hasChildNodes!="function")},Ai=function(Mr){return _typeof(xe)==="object"?Mr instanceof xe:Mr&&_typeof(Mr)==="object"&&typeof Mr.nodeType=="number"&&typeof Mr.nodeName=="string"},Ti=function(Mr,di,ci){ir[Mr]&&arrayForEach(ir[Mr],function(Aa){Aa.call($e,di,ci,Or)})},Ui=function(Mr){var di;if(Ti("beforeSanitizeElements",Mr,null),Gi(Mr)||regExpTest(/[\u0080-\uFFFF]/,Mr.nodeName))return mi(Mr),!0;var ci=Ir(Mr.nodeName);if(Ti("uponSanitizeElement",Mr,{tagName:ci,allowedTags:cr}),Mr.hasChildNodes()&&!Ai(Mr.firstElementChild)&&(!Ai(Mr.content)||!Ai(Mr.content.firstElementChild))&&regExpTest(/<[/\w]/g,Mr.innerHTML)&&regExpTest(/<[/\w]/g,Mr.textContent)||ci==="select"&&regExpTest(/<template/i,Mr.innerHTML)||Mr.nodeType===7||Wr&&Mr.nodeType===8&&regExpTest(/<[/\w]/g,Mr.data))return mi(Mr),!0;if(!cr[ci]||Lr[ci]){if(!Lr[ci]&&ea(ci)&&(Pr.tagNameCheck instanceof RegExp&&regExpTest(Pr.tagNameCheck,ci)||Pr.tagNameCheck instanceof Function&&Pr.tagNameCheck(ci)))return!1;if(Li&&!Vi[ci]){var Aa=We(Mr)||Mr.parentNode,va=Qe(Mr)||Mr.childNodes;if(va&&Aa)for(var ua=va.length,xa=ua-1;xa>=0;--xa){var Ga=He(va[xa],!0);Ga.__removalCount=(Mr.__removalCount||0)+1,Aa.insertBefore(Ga,Oe(Mr))}}return mi(Mr),!0}return Mr instanceof Be&&!ai(Mr)||(ci==="noscript"||ci==="noembed"||ci==="noframes")&&regExpTest(/<\/no(script|embed|frames)/i,Mr.innerHTML)?(mi(Mr),!0):(xi&&Mr.nodeType===3&&(di=Mr.textContent,di=stringReplace(di,ar," "),di=stringReplace(di,lr," "),di=stringReplace(di,gr," "),Mr.textContent!==di&&(arrayPush($e.removed,{element:Mr.cloneNode()}),Mr.textContent=di)),Ti("afterSanitizeElements",Mr,null),!1)},Ri=function(Mr,di,ci){if(li&&(di==="id"||di==="name")&&(ci in je||ci in Yr))return!1;if(!(Xr&&!Rr[di]&&regExpTest(dr,di))){if(!(Vr&&regExpTest(hr,di))){if(!wr[di]||Rr[di]){if(!(ea(Mr)&&(Pr.tagNameCheck instanceof RegExp&&regExpTest(Pr.tagNameCheck,Mr)||Pr.tagNameCheck instanceof Function&&Pr.tagNameCheck(Mr))&&(Pr.attributeNameCheck instanceof RegExp&&regExpTest(Pr.attributeNameCheck,di)||Pr.attributeNameCheck instanceof Function&&Pr.attributeNameCheck(di))||di==="is"&&Pr.allowCustomizedBuiltInElements&&(Pr.tagNameCheck instanceof RegExp&&regExpTest(Pr.tagNameCheck,ci)||Pr.tagNameCheck instanceof Function&&Pr.tagNameCheck(ci))))return!1}else if(!oa[di]){if(!regExpTest(or,stringReplace(ci,Ar,""))){if(!((di==="src"||di==="xlink:href"||di==="href")&&Mr!=="script"&&stringIndexOf(ci,"data:")===0&&Di[Mr])){if(!(_i&&!regExpTest(kr,stringReplace(ci,Ar,"")))){if(ci)return!1}}}}}}return!0},ea=function(Mr){return Mr!=="annotation-xml"&&stringMatch(Mr,Qr)},sa=function(Mr){var di,ci,Aa,va;Ti("beforeSanitizeAttributes",Mr,null);var ua=Mr.attributes;if(!(!ua||Gi(Mr))){var xa={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:wr};for(va=ua.length;va--;){di=ua[va];var Ga=di,wa=Ga.name,za=Ga.namespaceURI;if(ci=wa==="value"?di.value:stringTrim(di.value),Aa=Ir(wa),xa.attrName=Aa,xa.attrValue=ci,xa.keepAttr=!0,xa.forceKeepAttr=void 0,Ti("uponSanitizeAttribute",Mr,xa),ci=xa.attrValue,!xa.forceKeepAttr&&(Ii(wa,Mr),!!xa.keepAttr)){if(!ui&&regExpTest(/\/>/i,ci)){Ii(wa,Mr);continue}xi&&(ci=stringReplace(ci,ar," "),ci=stringReplace(ci,lr," "),ci=stringReplace(ci,gr," "));var Ra=Ir(Mr.nodeName);if(Ri(Ra,Aa,ci)){if(yi&&(Aa==="id"||Aa==="name")&&(Ii(wa,Mr),ci=Ei+ci),Wr&&regExpTest(/((--!?|])>)|<\/(style|title)/i,ci)){Ii(wa,Mr);continue}if(qe&&_typeof(Te)==="object"&&typeof Te.getAttributeType=="function"&&!za)switch(Te.getAttributeType(Ra,Aa)){case"TrustedHTML":{ci=qe.createHTML(ci);break}case"TrustedScriptURL":{ci=qe.createScriptURL(ci);break}}try{za?Mr.setAttributeNS(za,wa,ci):Mr.setAttribute(wa,ci),Gi(Mr)?mi(Mr):arrayPop($e.removed)}catch{}}}}Ti("afterSanitizeAttributes",Mr,null)}},ia=function Bi(Mr){var di,ci=Zi(Mr);for(Ti("beforeSanitizeShadowDOM",Mr,null);di=ci.nextNode();)Ti("uponSanitizeShadowNode",di,null),Ui(di),sa(di),di.content instanceof ke&&Bi(di.content);Ti("afterSanitizeShadowDOM",Mr,null)};return $e.sanitize=function(Bi){var Mr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},di,ci,Aa,va,ua;if(jr=!Bi,jr&&(Bi="<!-->"),typeof Bi!="string"&&!Ai(Bi))if(typeof Bi.toString=="function"){if(Bi=Bi.toString(),typeof Bi!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!$e.isSupported){if(_typeof(_e.toStaticHTML)==="object"||typeof _e.toStaticHTML=="function"){if(typeof Bi=="string")return _e.toStaticHTML(Bi);if(Ai(Bi))return _e.toStaticHTML(Bi.outerHTML)}return Bi}if(Mi||Hr(Mr),$e.removed=[],typeof Bi=="string"&&(Fi=!1),Fi){if(Bi.nodeName){var xa=Ir(Bi.nodeName);if(!cr[xa]||Lr[xa])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(Bi instanceof xe)di=Hi("<!---->"),ci=di.ownerDocument.importNode(Bi,!0),ci.nodeType===1&&ci.nodeName==="BODY"||ci.nodeName==="HTML"?di=ci:di.appendChild(ci);else{if(!si&&!xi&&!Cr&&Bi.indexOf("<")===-1)return qe&&gi?qe.createHTML(Bi):Bi;if(di=Hi(Bi),!di)return si?null:gi?rr:""}di&&wi&&mi(di.firstChild);for(var Ga=Zi(Fi?Bi:di);Aa=Ga.nextNode();)Aa.nodeType===3&&Aa===va||(Ui(Aa),sa(Aa),Aa.content instanceof ke&&ia(Aa.content),va=Aa);if(va=null,Fi)return Bi;if(si){if(fi)for(ua=tr.call(di.ownerDocument);di.firstChild;)ua.appendChild(di.firstChild);else ua=di;return(wr.shadowroot||wr.shadowrootmod)&&(ua=Ge.call(Ae,ua,!0)),ua}var wa=Cr?di.outerHTML:di.innerHTML;return Cr&&cr["!doctype"]&&di.ownerDocument&&di.ownerDocument.doctype&&di.ownerDocument.doctype.name&&regExpTest(DOCTYPE_NAME,di.ownerDocument.doctype.name)&&(wa="<!DOCTYPE "+di.ownerDocument.doctype.name+`>
2043
2043
  `+wa),xi&&(wa=stringReplace(wa,ar," "),wa=stringReplace(wa,lr," "),wa=stringReplace(wa,gr," ")),qe&&gi?qe.createHTML(wa):wa},$e.setConfig=function(Bi){Hr(Bi),Mi=!0},$e.clearConfig=function(){Or=null,Mi=!1},$e.isValidAttribute=function(Bi,Mr,di){Or||Hr({});var ci=Ir(Bi),Aa=Ir(Mr);return Ri(ci,Aa,di)},$e.addHook=function(Bi,Mr){typeof Mr=="function"&&(ir[Bi]=ir[Bi]||[],arrayPush(ir[Bi],Mr))},$e.removeHook=function(Bi){if(ir[Bi])return arrayPop(ir[Bi])},$e.removeHooks=function(Bi){ir[Bi]&&(ir[Bi]=[])},$e.removeAllHooks=function(){ir={}},$e}var purify=createDOMPurify();const purify_es=Object.freeze(Object.defineProperty({__proto__:null,default:purify},Symbol.toStringTag,{value:"Module"}));exports.Designer=Designer,exports.DragBox=DragBox,exports.Header=Header,exports.Preview=Preview,exports.autoConnect=autoConnect,exports.createPrintTemplate=createPrintTemplate,exports.defaultElementTypeProvider=defaultElementTypeProvider,exports.disAutoConnect=disAutoConnect,exports.hiPrintPlugin=hiPrintPlugin,exports.hiprint=hiprint,exports.print=print,exports.print2=print2,exports.register=register,exports.setConfig=setConfig,exports.toImage=toImage,exports.toPdf=toPdf,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vg-print",
3
3
  "description": "hiprint for Vue2.x / Vue3.x 支持拖拽(分页(不分页)、表头表脚、样式设置、复制粘贴、缩放、撤销重做)生成打印模板、导出json模板数据、静默打印/获取MAC地址(借助客户端)",
4
- "version": "1.0.14",
4
+ "version": "1.0.15",
5
5
  "author": "vgSimple",
6
6
  "license": "MIT",
7
7
  "main": "dist/vg-print.cjs.js",