@aitmed/aitmed-document-template 1.28.0 → 1.29.0

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.
@@ -73,7 +73,7 @@ function print() { __p += __j.call(arguments, '') }
73
73
  *
74
74
  * @author Feross Aboukhadijeh <https://feross.org>
75
75
  * @license MIT
76
- */(function(e){const r=Ia,o=ql,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=T,e.INSPECT_MAX_BYTES=50;const l=2147483647;e.kMaxLength=l,f.TYPED_ARRAY_SUPPORT=c(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const x=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(x,p),x.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function u(x){if(x>l)throw new RangeError('The value "'+x+'" is invalid for option "size"');const p=new Uint8Array(x);return Object.setPrototypeOf(p,f.prototype),p}function f(x,p,h){if(typeof x=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(x)}return m(x,p,h)}f.poolSize=8192;function m(x,p,h){if(typeof x=="string")return b(x,p);if(ArrayBuffer.isView(x))return E(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(st(x,ArrayBuffer)||x&&st(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(st(x,SharedArrayBuffer)||x&&st(x.buffer,SharedArrayBuffer)))return S(x,p,h);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const k=x.valueOf&&x.valueOf();if(k!=null&&k!==x)return f.from(k,p,h);const P=v(x);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return f.from(x[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}f.from=function(x,p,h){return m(x,p,h)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function y(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function g(x,p,h){return y(x),x<=0?u(x):p!==void 0?typeof h=="string"?u(x).fill(p,h):u(x).fill(p):u(x)}f.alloc=function(x,p,h){return g(x,p,h)};function w(x){return y(x),u(x<0?0:M(x)|0)}f.allocUnsafe=function(x){return w(x)},f.allocUnsafeSlow=function(x){return w(x)};function b(x,p){if((typeof p!="string"||p==="")&&(p="utf8"),!f.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=B(x,p)|0;let k=u(h);const P=k.write(x,p);return P!==h&&(k=k.slice(0,P)),k}function A(x){const p=x.length<0?0:M(x.length)|0,h=u(p);for(let k=0;k<p;k+=1)h[k]=x[k]&255;return h}function E(x){if(st(x,Uint8Array)){const p=new Uint8Array(x);return S(p.buffer,p.byteOffset,p.byteLength)}return A(x)}function S(x,p,h){if(p<0||x.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let k;return p===void 0&&h===void 0?k=new Uint8Array(x):h===void 0?k=new Uint8Array(x,p):k=new Uint8Array(x,p,h),Object.setPrototypeOf(k,f.prototype),k}function v(x){if(f.isBuffer(x)){const p=M(x.length)|0,h=u(p);return h.length===0||x.copy(h,0,0,p),h}if(x.length!==void 0)return typeof x.length!="number"||Lt(x.length)?u(0):A(x);if(x.type==="Buffer"&&Array.isArray(x.data))return A(x.data)}function M(x){if(x>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return x|0}function T(x){return+x!=x&&(x=0),f.alloc(+x)}f.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==f.prototype},f.compare=function(p,h){if(st(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),st(h,Uint8Array)&&(h=f.from(h,h.offset,h.byteLength)),!f.isBuffer(p)||!f.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let k=p.length,P=h.length;for(let U=0,ee=Math.min(k,P);U<ee;++U)if(p[U]!==h[U]){k=p[U],P=h[U];break}return k<P?-1:P<k?1:0},f.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return f.alloc(0);let k;if(h===void 0)for(h=0,k=0;k<p.length;++k)h+=p[k].length;const P=f.allocUnsafe(h);let U=0;for(k=0;k<p.length;++k){let ee=p[k];if(st(ee,Uint8Array))U+ee.length>P.length?(f.isBuffer(ee)||(ee=f.from(ee)),ee.copy(P,U)):Uint8Array.prototype.set.call(P,ee,U);else if(f.isBuffer(ee))ee.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=ee.length}return P};function B(x,p){if(f.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||st(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const h=x.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&h===0)return 0;let P=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return De(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return mt(x).length;default:if(P)return k?-1:De(x).length;p=(""+p).toLowerCase(),P=!0}}f.byteLength=B;function Y(x,p,h){let k=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(x||(x="utf8");;)switch(x){case"hex":return se(this,p,h);case"utf8":case"utf-8":return ae(this,p,h);case"ascii":return z(this,p,h);case"latin1":case"binary":return j(this,p,h);case"base64":return he(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,p,h);default:if(k)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),k=!0}}f.prototype._isBuffer=!0;function O(x,p,h){const k=x[p];x[p]=x[h],x[h]=k}f.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<p;h+=2)O(this,h,h+1);return this},f.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<p;h+=4)O(this,h,h+3),O(this,h+1,h+2);return this},f.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<p;h+=8)O(this,h,h+7),O(this,h+1,h+6),O(this,h+2,h+5),O(this,h+3,h+4);return this},f.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?ae(this,0,p):Y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(p){if(!f.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:f.compare(this,p)===0},f.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},a&&(f.prototype[a]=f.prototype.inspect),f.prototype.compare=function(p,h,k,P,U){if(st(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),!f.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),k===void 0&&(k=p?p.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),h<0||k>p.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&h>=k)return 0;if(P>=U)return-1;if(h>=k)return 1;if(h>>>=0,k>>>=0,P>>>=0,U>>>=0,this===p)return 0;let ee=U-P,ve=k-h;const Ze=Math.min(ee,ve),Ge=this.slice(P,U),Xe=p.slice(h,k);for(let He=0;He<Ze;++He)if(Ge[He]!==Xe[He]){ee=Ge[He],ve=Xe[He];break}return ee<ve?-1:ve<ee?1:0};function Q(x,p,h,k,P){if(x.length===0)return-1;if(typeof h=="string"?(k=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Lt(h)&&(h=P?0:x.length-1),h<0&&(h=x.length+h),h>=x.length){if(P)return-1;h=x.length-1}else if(h<0)if(P)h=0;else return-1;if(typeof p=="string"&&(p=f.from(p,k)),f.isBuffer(p))return p.length===0?-1:W(x,p,h,k,P);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(x,p,h):Uint8Array.prototype.lastIndexOf.call(x,p,h):W(x,[p],h,k,P);throw new TypeError("val must be string, number or Buffer")}function W(x,p,h,k,P){let U=1,ee=x.length,ve=p.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(x.length<2||p.length<2)return-1;U=2,ee/=2,ve/=2,h/=2}function Ze(Xe,He){return U===1?Xe[He]:Xe.readUInt16BE(He*U)}let Ge;if(P){let Xe=-1;for(Ge=h;Ge<ee;Ge++)if(Ze(x,Ge)===Ze(p,Xe===-1?0:Ge-Xe)){if(Xe===-1&&(Xe=Ge),Ge-Xe+1===ve)return Xe*U}else Xe!==-1&&(Ge-=Ge-Xe),Xe=-1}else for(h+ve>ee&&(h=ee-ve),Ge=h;Ge>=0;Ge--){let Xe=!0;for(let He=0;He<ve;He++)if(Ze(x,Ge+He)!==Ze(p,He)){Xe=!1;break}if(Xe)return Ge}return-1}f.prototype.includes=function(p,h,k){return this.indexOf(p,h,k)!==-1},f.prototype.indexOf=function(p,h,k){return Q(this,p,h,k,!0)},f.prototype.lastIndexOf=function(p,h,k){return Q(this,p,h,k,!1)};function ne(x,p,h,k){h=Number(h)||0;const P=x.length-h;k?(k=Number(k),k>P&&(k=P)):k=P;const U=p.length;k>U/2&&(k=U/2);let ee;for(ee=0;ee<k;++ee){const ve=parseInt(p.substr(ee*2,2),16);if(Lt(ve))return ee;x[h+ee]=ve}return ee}function q(x,p,h,k){return nt(De(p,x.length-h),x,h,k)}function G(x,p,h,k){return nt(ht(p),x,h,k)}function F(x,p,h,k){return nt(mt(p),x,h,k)}function te(x,p,h,k){return nt(kt(p,x.length-h),x,h,k)}f.prototype.write=function(p,h,k,P){if(h===void 0)P="utf8",k=this.length,h=0;else if(k===void 0&&typeof h=="string")P=h,k=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(k)?(k=k>>>0,P===void 0&&(P="utf8")):(P=k,k=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-h;if((k===void 0||k>U)&&(k=U),p.length>0&&(k<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let ee=!1;for(;;)switch(P){case"hex":return ne(this,p,h,k);case"utf8":case"utf-8":return q(this,p,h,k);case"ascii":case"latin1":case"binary":return G(this,p,h,k);case"base64":return F(this,p,h,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,p,h,k);default:if(ee)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),ee=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function he(x,p,h){return p===0&&h===x.length?r.fromByteArray(x):r.fromByteArray(x.slice(p,h))}function ae(x,p,h){h=Math.min(x.length,h);const k=[];let P=p;for(;P<h;){const U=x[P];let ee=null,ve=U>239?4:U>223?3:U>191?2:1;if(P+ve<=h){let Ze,Ge,Xe,He;switch(ve){case 1:U<128&&(ee=U);break;case 2:Ze=x[P+1],(Ze&192)===128&&(He=(U&31)<<6|Ze&63,He>127&&(ee=He));break;case 3:Ze=x[P+1],Ge=x[P+2],(Ze&192)===128&&(Ge&192)===128&&(He=(U&15)<<12|(Ze&63)<<6|Ge&63,He>2047&&(He<55296||He>57343)&&(ee=He));break;case 4:Ze=x[P+1],Ge=x[P+2],Xe=x[P+3],(Ze&192)===128&&(Ge&192)===128&&(Xe&192)===128&&(He=(U&15)<<18|(Ze&63)<<12|(Ge&63)<<6|Xe&63,He>65535&&He<1114112&&(ee=He))}}ee===null?(ee=65533,ve=1):ee>65535&&(ee-=65536,k.push(ee>>>10&1023|55296),ee=56320|ee&1023),k.push(ee),P+=ve}return D(k)}const R=4096;function D(x){const p=x.length;if(p<=R)return String.fromCharCode.apply(String,x);let h="",k=0;for(;k<p;)h+=String.fromCharCode.apply(String,x.slice(k,k+=R));return h}function z(x,p,h){let k="";h=Math.min(x.length,h);for(let P=p;P<h;++P)k+=String.fromCharCode(x[P]&127);return k}function j(x,p,h){let k="";h=Math.min(x.length,h);for(let P=p;P<h;++P)k+=String.fromCharCode(x[P]);return k}function se(x,p,h){const k=x.length;(!p||p<0)&&(p=0),(!h||h<0||h>k)&&(h=k);let P="";for(let U=p;U<h;++U)P+=qt[x[U]];return P}function me(x,p,h){const k=x.slice(p,h);let P="";for(let U=0;U<k.length-1;U+=2)P+=String.fromCharCode(k[U]+k[U+1]*256);return P}f.prototype.slice=function(p,h){const k=this.length;p=~~p,h=h===void 0?k:~~h,p<0?(p+=k,p<0&&(p=0)):p>k&&(p=k),h<0?(h+=k,h<0&&(h=0)):h>k&&(h=k),h<p&&(h=p);const P=this.subarray(p,h);return Object.setPrototypeOf(P,f.prototype),P};function de(x,p,h){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+p>h)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)P+=this[p+ee]*U;return P},f.prototype.readUintBE=f.prototype.readUIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=this[p+--h],U=1;for(;h>0&&(U*=256);)P+=this[p+--h]*U;return P},f.prototype.readUint8=f.prototype.readUInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]|this[p+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]<<8|this[p+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},f.prototype.readBigUInt64LE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,U=this[++p]+this[++p]*2**8+this[++p]*2**16+k*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),f.prototype.readBigUInt64BE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],U=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k;return(BigInt(P)<<BigInt(32))+BigInt(U)}),f.prototype.readIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)P+=this[p+ee]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*h)),P},f.prototype.readIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=h,U=1,ee=this[p+--P];for(;P>0&&(U*=256);)ee+=this[p+--P]*U;return U*=128,ee>=U&&(ee-=Math.pow(2,8*h)),ee},f.prototype.readInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},f.prototype.readInt16LE=function(p,h){p=p>>>0,h||de(p,2,this.length);const k=this[p]|this[p+1]<<8;return k&32768?k|4294901760:k},f.prototype.readInt16BE=function(p,h){p=p>>>0,h||de(p,2,this.length);const k=this[p+1]|this[p]<<8;return k&32768?k|4294901760:k},f.prototype.readInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},f.prototype.readInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},f.prototype.readBigInt64LE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(k<<24);return(BigInt(P)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),f.prototype.readBigInt64BE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(P)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k)}),f.prototype.readFloatLE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!0,23,4)},f.prototype.readFloatBE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!1,23,4)},f.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!0,52,8)},f.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!1,52,8)};function we(x,p,h,k,P,U){if(!f.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>P||p<U)throw new RangeError('"value" argument is out of bounds');if(h+k>x.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(p,h,k,P){if(p=+p,h=h>>>0,k=k>>>0,!P){const ve=Math.pow(2,8*k)-1;we(this,p,h,k,ve,0)}let U=1,ee=0;for(this[h]=p&255;++ee<k&&(U*=256);)this[h+ee]=p/U&255;return h+k},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(p,h,k,P){if(p=+p,h=h>>>0,k=k>>>0,!P){const ve=Math.pow(2,8*k)-1;we(this,p,h,k,ve,0)}let U=k-1,ee=1;for(this[h+U]=p&255;--U>=0&&(ee*=256);)this[h+U]=p/ee&255;return h+k},f.prototype.writeUint8=f.prototype.writeUInt8=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,1,255,0),this[h]=p&255,h+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function ke(x,p,h,k,P){at(p,k,P,x,h,7);let U=Number(p&BigInt(4294967295));x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,h}function Se(x,p,h,k,P){at(p,k,P,x,h,7);let U=Number(p&BigInt(4294967295));x[h+7]=U,U=U>>8,x[h+6]=U,U=U>>8,x[h+5]=U,U=U>>8,x[h+4]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h+3]=ee,ee=ee>>8,x[h+2]=ee,ee=ee>>8,x[h+1]=ee,ee=ee>>8,x[h]=ee,h+8}f.prototype.writeBigUInt64LE=ie(function(p,h=0){return ke(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=ie(function(p,h=0){return Se(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(p,h,k,P){if(p=+p,h=h>>>0,!P){const Ze=Math.pow(2,8*k-1);we(this,p,h,k,Ze-1,-Ze)}let U=0,ee=1,ve=0;for(this[h]=p&255;++U<k&&(ee*=256);)p<0&&ve===0&&this[h+U-1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+k},f.prototype.writeIntBE=function(p,h,k,P){if(p=+p,h=h>>>0,!P){const Ze=Math.pow(2,8*k-1);we(this,p,h,k,Ze-1,-Ze)}let U=k-1,ee=1,ve=0;for(this[h+U]=p&255;--U>=0&&(ee*=256);)p<0&&ve===0&&this[h+U+1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+k},f.prototype.writeInt8=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},f.prototype.writeInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},f.prototype.writeInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},f.prototype.writeBigInt64LE=ie(function(p,h=0){return ke(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=ie(function(p,h=0){return Se(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(x,p,h,k,P,U){if(h+k>x.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function ue(x,p,h,k,P){return p=+p,h=h>>>0,P||ce(x,p,h,4),o.write(x,p,h,k,23,4),h+4}f.prototype.writeFloatLE=function(p,h,k){return ue(this,p,h,!0,k)},f.prototype.writeFloatBE=function(p,h,k){return ue(this,p,h,!1,k)};function Ee(x,p,h,k,P){return p=+p,h=h>>>0,P||ce(x,p,h,8),o.write(x,p,h,k,52,8),h+8}f.prototype.writeDoubleLE=function(p,h,k){return Ee(this,p,h,!0,k)},f.prototype.writeDoubleBE=function(p,h,k){return Ee(this,p,h,!1,k)},f.prototype.copy=function(p,h,k,P){if(!f.isBuffer(p))throw new TypeError("argument should be a Buffer");if(k||(k=0),!P&&P!==0&&(P=this.length),h>=p.length&&(h=p.length),h||(h=0),P>0&&P<k&&(P=k),P===k||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),p.length-h<P-k&&(P=p.length-h+k);const U=P-k;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,k,P):Uint8Array.prototype.set.call(p,this.subarray(k,P),h),U},f.prototype.fill=function(p,h,k,P){if(typeof p=="string"){if(typeof h=="string"?(P=h,h=0,k=this.length):typeof k=="string"&&(P=k,k=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!f.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(p.length===1){const ee=p.charCodeAt(0);(P==="utf8"&&ee<128||P==="latin1")&&(p=ee)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<k)throw new RangeError("Out of range index");if(k<=h)return this;h=h>>>0,k=k===void 0?this.length:k>>>0,p||(p=0);let U;if(typeof p=="number")for(U=h;U<k;++U)this[U]=p;else{const ee=f.isBuffer(p)?p:f.from(p,P),ve=ee.length;if(ve===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(U=0;U<k-h;++U)this[U+h]=ee[U%ve]}return this};const ye={};function Me(x,p,h){ye[x]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}Me("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Me("ERR_INVALID_ARG_TYPE",function(x,p){return`The "${x}" argument must be of type number. Received type ${typeof p}`},TypeError),Me("ERR_OUT_OF_RANGE",function(x,p,h){let k=`The value of "${x}" is out of range.`,P=h;return Number.isInteger(h)&&Math.abs(h)>2**32?P=Pe(String(h)):typeof h=="bigint"&&(P=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(P=Pe(P)),P+="n"),k+=` It must be ${p}. Received ${P}`,k},RangeError);function Pe(x){let p="",h=x.length;const k=x[0]==="-"?1:0;for(;h>=k+4;h-=3)p=`_${x.slice(h-3,h)}${p}`;return`${x.slice(0,h)}${p}`}function Ve(x,p,h){et(p,"offset"),(x[p]===void 0||x[p+h]===void 0)&&tt(p,x.length-(h+1))}function at(x,p,h,k,P,U){if(x>h||x<p){const ee=typeof p=="bigint"?"n":"";let ve;throw p===0||p===BigInt(0)?ve=`>= 0${ee} and < 2${ee} ** ${(U+1)*8}${ee}`:ve=`>= -(2${ee} ** ${(U+1)*8-1}${ee}) and < 2 ** ${(U+1)*8-1}${ee}`,new ye.ERR_OUT_OF_RANGE("value",ve,x)}Ve(k,P,U)}function et(x,p){if(typeof x!="number")throw new ye.ERR_INVALID_ARG_TYPE(p,"number",x)}function tt(x,p,h){throw Math.floor(x)!==x?(et(x,h),new ye.ERR_OUT_OF_RANGE("offset","an integer",x)):p<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,x)}const H=/[^+/0-9A-Za-z-_]/g;function pe(x){if(x=x.split("=")[0],x=x.trim().replace(H,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function De(x,p){p=p||1/0;let h;const k=x.length;let P=null;const U=[];for(let ee=0;ee<k;++ee){if(h=x.charCodeAt(ee),h>55295&&h<57344){if(!P){if(h>56319){(p-=3)>-1&&U.push(239,191,189);continue}else if(ee+1===k){(p-=3)>-1&&U.push(239,191,189);continue}P=h;continue}if(h<56320){(p-=3)>-1&&U.push(239,191,189),P=h;continue}h=(P-55296<<10|h-56320)+65536}else P&&(p-=3)>-1&&U.push(239,191,189);if(P=null,h<128){if((p-=1)<0)break;U.push(h)}else if(h<2048){if((p-=2)<0)break;U.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;U.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;U.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return U}function ht(x){const p=[];for(let h=0;h<x.length;++h)p.push(x.charCodeAt(h)&255);return p}function kt(x,p){let h,k,P;const U=[];for(let ee=0;ee<x.length&&!((p-=2)<0);++ee)h=x.charCodeAt(ee),k=h>>8,P=h%256,U.push(P),U.push(k);return U}function mt(x){return r.toByteArray(pe(x))}function nt(x,p,h,k){let P;for(P=0;P<k&&!(P+h>=p.length||P>=x.length);++P)p[P+h]=x[P];return P}function st(x,p){return x instanceof p||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===p.name}function Lt(x){return x!==x}const qt=function(){const x="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const k=h*16;for(let P=0;P<16;++P)p[k+P]=x[h]+x[P]}return p}();function ie(x){return typeof BigInt>"u"?Ae:x}function Ae(){throw new Error("BigInt not supported")}})(ah);const W4=e=>{const r=atob(e),o=r.length,a=new Uint8Array(o);for(let l=0;l<o;l++)a[l]=r.charCodeAt(l);return a},H4=({type:e,data:r})=>`data:${e};base64,${r}`,Y4=e=>W4(e),lh=(e,r)=>{const o=Y4(e),a=ah.Buffer.from(o.buffer);return new Blob([a.buffer],{type:r})},ch="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16.828'%20height='16.828'%20viewBox='0%200%2016.828%2016.828'%3e%3cg%20id='组_10025'%20data-name='组%2010025'%20transform='translate(0.914%201.414)'%3e%3cline%20id='直线_1370'%20data-name='直线%201370'%20x2='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3cline%20id='直线_1371'%20data-name='直线%201371'%20x1='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3c/g%3e%3c/svg%3e",G4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%20id='组_11460'%20data-name='组%2011460'%20transform='translate(-1070%20-577)'%3e%3cpath%20id='路径_9629'%20data-name='路径%209629'%20d='M8,14.625A6.625,6.625,0,1,0,1.375,8,6.625,6.625,0,0,0,8,14.625ZM8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16Z'%20transform='translate(1070%20577)'%20fill='%23999'/%3e%3cpath%20id='路径_9630'%20data-name='路径%209630'%20d='M449.688,212.688a.687.687,0,1,0-1.375,0v5.3a.687.687,0,1,0,1.375,0ZM449,219.375a1,1,0,1,0,1,1A1,1,0,0,0,449,219.375Z'%20transform='translate(629%20368.313)'%20fill='%23999'/%3e%3c/g%3e%3c/svg%3e",Ma=e=>(t.pushScopeId("data-v-be2f3157"),e=e(),t.popScopeId(),e),K4={class:"signature_box"},q4=Ma(()=>t.createElementVNode("div",{class:"signature_tilte"},"Signature",-1)),Q4=Ma(()=>t.createElementVNode("div",{class:"subtitle"},"Click on the signature box below to finger sign",-1)),Z4=Ma(()=>t.createElementVNode("div",{class:"label"},"X",-1)),X4=Ma(()=>t.createElementVNode("div",{class:"signature_tips"},[t.createElementVNode("img",{class:"signature_icon",src:G4}),t.createElementVNode("div",{class:"tips"},"The signature is saved for later use.")],-1)),J4={class:"signature_operate"},eM=mi(t.defineComponent({__name:"SignaturePad",setup(e){t.useCssVars(q=>({c10de988:ne.width,"35d96271":ne.height,fcbcf76a:ne.top,"9ae9885e":ne.left}));const r=t.ref(hi()),a=Nr().getDocumentTemplate(),l=t.ref(null),c=t.ref(null),u=t.ref(null),m=_s().getSignaturePad(),y=m.confirm,g=t.reactive({status:!1,ctx:null,originSignature:"",saveSignature:"",points:new Array,beginPoint:null}),w=t.reactive({x:0,y:0}),b=q=>{let[G,F]=[q.offsetLeft,q.offsetTop];const te=he=>{F+=he.offsetTop,G+=he.offsetLeft,he.offsetParent&&te(he.offsetParent)};return q.offsetParent&&te(q.offsetParent),{left:G,top:F}},A=q=>{let{left:G,top:F}=q.getBoundingClientRect();return{left:G,top:F}},E=q=>{const G=document.createElement("canvas");G.width=q.width,G.height=q.height;const F=G.getContext("2d");return F==null||F.putImageData(q,0,0),G.toDataURL().split(",")[1]},S=q=>{if(c.value)if(q.preventDefault(),q.stopPropagation(),g.status=!0,r.value){const{left:G,top:F}=A(c.value);q=q,w.x=q.targetTouches[0].clientX-G,w.y=q.targetTouches[0].clientY-F,g.points.push({x:w.x,y:w.y})}else{const{left:G,top:F}=b(c.value);q=q,w.x=q.clientX-G,w.y=q.clientY-F,g.points.push({x:w.x,y:w.y})}},v=(q,G,F)=>{const te=g.ctx;te.beginPath(),te.moveTo(q.x,q.y),te.quadraticCurveTo(G.x,G.y,F.x,F.y),te.stroke(),te.closePath()},M=q=>{if(c.value&&(q.preventDefault(),q.stopPropagation(),g.status&&g.ctx)){if(r.value){const{left:G,top:F}=A(c.value);q=q;const te=q.targetTouches[0].clientX-G,he=q.targetTouches[0].clientY-F;g.points.push({x:te,y:he})}else{const{left:G,top:F}=b(c.value);q=q;const te=q.clientX-G,he=q.clientY-F;g.points.push({x:te,y:he})}if(g.points.length>3){const G=g.points.slice(-2),F=G[0],te={x:(G[0].x+G[1].x)/2,y:(G[0].y+G[1].y)/2};g.beginPoint&&v(g.beginPoint,F,te),g.beginPoint=te}}},T=q=>{if(c.value){q.preventDefault(),q.stopPropagation();const G=c.value;if(G.style.cursor="auto",g.status){if(r.value){const{left:he,top:ae}=A(c.value);q=q;const R=q.changedTouches[0].clientX-he,D=q.changedTouches[0].clientY-ae;g.points.push({x:R,y:D})}else{const{left:he,top:ae}=b(c.value);q=q;const R=q.clientX-he,D=q.clientY-ae;g.points.push({x:R,y:D})}if(g.points.length>3){const he=g.points.slice(-2),ae=he[0],R=he[1];g.beginPoint&&v(g.beginPoint,ae,R)}g.beginPoint=null,g.points=[];const F=g.ctx;F==null||F.closePath();const te=F==null?void 0:F.getImageData(0,0,G.width,G.height);g.saveSignature=E(te)}}g.status=!1},B=()=>{m.close()},Y=()=>{g.ctx&&(r.value?g.ctx.clearRect(0,0,g.ctx.canvas.height,g.ctx.canvas.width):g.ctx.clearRect(0,0,g.ctx.canvas.width,g.ctx.canvas.height),g.saveSignature="")},O=q=>{q.target===u.value&&m.close()},Q=async()=>{if(g.saveSignature!==g.originSignature){const q=da.service({target:a.relatedDom||document.body});await y(m.options.dataKey,g.saveSignature,m.options.isGuardian?465921:345601,m.options.type),q.close(),m.close()}},W=()=>{B()},ne=t.reactive({top:"",left:"",width:"",height:""});return t.onMounted(async()=>{var G;r.value?(ne.top="calc((100vh - 100vw) / 2)",ne.left="calc((100vw - 100vh) / 2)",ne.width="100vh",ne.height="100vw"):a.relatedDom?(ne.top=`${a.relatedDom.offsetTop}px`,ne.left=`${a.relatedDom.offsetLeft}px`,ne.width=`${a.relatedDom.clientWidth}px`,ne.height=`${a.relatedDom.clientHeight}px`):(ne.top="0",ne.left="0",ne.width="100vw",ne.height="100vh");const q=da.service({target:a.relatedDom||document.body});if(c.value&&l.value){const F=c.value,te=F.getContext("2d",{willReadFrequently:!0});g.ctx=te,r.value?t.nextTick(()=>{var ae,R;F.width=((ae=l.value)==null?void 0:ae.clientWidth)||0,F.height=((R=l.value)==null?void 0:R.clientHeight)||0,te.translate(F.width/2,F.height/2),te.rotate(-Math.PI/2),te.translate(-F.height/2,-F.width/2),te.lineWidth=5}):(F.width=l.value.clientWidth,F.height=l.value.clientHeight,te.lineWidth=3),te.lineJoin="round",te.lineCap="round";const he=m.options;if(he.dataKey)if(Rn.get(he.formData,he.dataKey)){const R=((G=m.options)==null?void 0:G.value)||"";if(R){const D=new Image;D.src=R,D.onload=()=>{te.drawImage(D,0,0,D.width,D.height);const z=te==null?void 0:te.getImageData(0,0,F.width,F.height);g.originSignature=E(z),g.saveSignature=g.originSignature}}else g.originSignature="",g.saveSignature=""}else g.originSignature="",g.saveSignature=""}q.close()}),(q,G)=>{const F=yr;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"signatureView",ref:u,class:t.normalizeClass(r.value?"signature_view signature_view_mobile":"signature_view signature_view_ps"),onClick:O},[t.createElementVNode("div",K4,[t.createElementVNode("img",{class:"signature_close",src:ch,onClick:B}),q4,t.createElementVNode("div",{class:"signature_subtitle"},[Q4,t.createElementVNode("div",{class:"signature_clear",onClick:Y},"Clear")]),t.createElementVNode("div",{class:"signature_pad",ref_key:"signatureBox",ref:l},[t.createElementVNode("canvas",{class:"pad",ref_key:"signaturePad",ref:c,onMousedown:G[0]||(G[0]=te=>!r.value&&S(te)),onMouseup:G[1]||(G[1]=te=>!r.value&&T(te)),onMousemoveCapture:G[2]||(G[2]=te=>!r.value&&M(te)),onMouseleave:G[3]||(G[3]=te=>!r.value&&T(te)),onTouchstart:G[4]||(G[4]=te=>r.value&&S(te)),onTouchend:G[5]||(G[5]=te=>r.value&&T(te)),onTouchmoveCapture:G[6]||(G[6]=te=>r.value&&M(te)),onTouchcancel:G[7]||(G[7]=te=>r.value&&T(te))},null,544),Z4],512),X4,t.createElementVNode("div",J4,[t.createVNode(F,{class:"signature_chioce_button signature_cancel",onClick:W},{default:t.withCtx(()=>[t.createTextVNode("Cancel")]),_:1}),t.createVNode(F,{class:"signature_chioce_button signature_confirm",onClick:Q},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1})])])],2)])}}}),[["__scopeId","data-v-be2f3157"]]),tM="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20.002'%20viewBox='0%200%2020%2020.002'%3e%3cg%20id='组_22313'%20data-name='组%2022313'%20transform='translate(-106.404%20-80.254)'%3e%3cpath%20id='路径_23519'%20data-name='路径%2023519'%20d='M209.607,82.221a1.53,1.53,0,0,1,2.154.006l1.077,1.077a1.533,1.533,0,0,1,.006,2.154L201.509,96.794h1.079l-4.316-4.316v1.079l11.335-11.335Zm-1.079-1.079L197.193,92.477a.763.763,0,0,0,0,1.079l4.316,4.316a.763.763,0,0,0,1.079,0l11.335-11.335a3.059,3.059,0,0,0-.006-4.312l-1.077-1.077a3.056,3.056,0,0,0-4.312-.006Zm-1.623,2.7,4.316,4.316,1.079-1.079-4.316-4.316L206.9,83.845Z'%20transform='translate(-88.406)'%20fill='%23333'/%3e%3cpath%20id='路径_23520'%20data-name='路径%2023520'%20d='M108.6,583.993l-2.158,6.475a.763.763,0,0,0,.965.965l6.474-2.158a.763.763,0,0,0,.3-1.263l-4.316-4.316a.763.763,0,0,0-1.263.3Zm1.448.483-1.263.3,4.316,4.316.3-1.263-6.474,2.158.965.965,2.158-6.474Z'%20transform='translate(0%20-491.217)'%20fill='%23333'/%3e%3c/g%3e%3c/svg%3e",nM={clearIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMC4yMDEiIHZpZXdCb3g9IjAgMCAyMCAyMC4yMDEiPjxnIGRhdGEtbmFtZT0i57uEIDIyMzYzIj48ZyBkYXRhLW5hbWU9Iue7hCAyMjM2MiIgZmlsbD0iIzMzMyIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9Ii40Ij48cGF0aCBkYXRhLW5hbWU9Iui3r+W+hCAyMzUzNyIgZD0iTTE4LjM4NCAxMC45MDRoLS4zNTd2NS40NDFhMTIuOTUyIDEyLjk1MiAwIDAgMCAuMzU3IDIuOTQzLjcxNi43MTYgMCAwIDEtLjcxNC43MTRIMi4zM2EuNzE2LjcxNiAwIDAgMS0uNzEzLS43MTQgMTIuMTI4IDEyLjEyOCAwIDAgMCAuMzU3LTIuODcydi01LjUxMmgtLjM1N2EuNzE2LjcxNiAwIDAgMS0uNzE0LS43MTRWNi42MjNhLjcxNi43MTYgMCAwIDEgLjcxNC0uNzE0aDYuMDY1VjEuOTg1QT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WU9Iue7hCAyMjM2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZGF0YS1uYW1lPSLot6/lvoQgMjM1MjYiIGQ9Ik02LjkgNC40MzRoNy4zNzlsLTIuMjA3LTEuNDU4YS42ODYuNjg2IDAgMCAxLS4yMDctLjk3Mi42NzYuNjc2IDAgMCAxIC45NjUtLjIwOGw0LjEzOCAyLjc3OGEuNjMzLjYzMyAwIDAgMSAuMjc2LjU1Ni44Ni44NiAwIDAgMS0uMjc2LjU1NkwxMi44MyA4LjQ2NGMtLjA2OS4xMzktLjIwNy4xMzktLjM0NS4xMzlhLjg0OS44NDkgMCAwIDEtLjU1Mi0uMjc4LjY4Ni42ODYgMCAwIDEgLjIwNy0uOTcybDIuMjc2LTEuNTI4SDYuOWE1LjU1NiA1LjU1NiAwIDAgMCAwIDExLjExMmgxMi40MWEuNjk1LjY5NSAwIDAgMSAwIDEuMzg5SDYuOWE2Ljk0NSA2Ljk0NSAwIDAgMSAwLTEzLjg5eiIgZmlsbD0iI2MxYzFjMSIvPjxwYXRoIGRhdGEtbmFtZT0i55+p5b2iIDIzMTQ5IiBmaWxsPSJub25lIiBkPSJNMCAwaDIwdjIwSDB6Ii8+PC9zdmc+"},Kt=e=>nM[e],rM=e=>(t.pushScopeId("data-v-516516a5"),e=e(),t.popScopeId(),e),oM={class:"image-editor-box"},iM={key:0,class:"image-editor-controler"},aM={key:0,class:"image-editor-no_edit"},sM={key:1,class:"image-editor-editing"},lM={class:"left"},cM=["src"],uM=["src"],fM=["src"],dM=[rM(()=>t.createElementVNode("div",null,"Confirm",-1))],pM=mi(t.defineComponent({__name:"ImageEditor",setup(e){t.useCssVars(R=>({"455fdd5f":v.width,"4cccd4ae":v.height,b366f9a4:v.top,"2340194e":v.left}));const r=t.ref(hi()),a=Is().getImageEditor(),c=Nr().getDocumentTemplate(),u=a.confirm,f=t.ref(null),m=t.ref(null),y=t.ref(null),g=t.reactive({x:0,y:0,width:0,height:0}),w=t.reactive({x:0,y:0}),b=t.reactive({isEditable:!1,clearIcon:Kt("clearDisableIcon"),undoIcon:Kt("undoDisableIcon"),redoIcon:Kt("redoDisableIcon"),ctx:null,isDrawing:!1,color:"#ff0000",stroke:"2",originImg:void 0,index:0,operateList:new Array,redoList:new Array,originImage:"",currentImage:"",saveImage:"",type:"",points:new Array,beginPoint:null}),A=R=>{let[D,z]=[R.offsetLeft,R.offsetTop];const j=se=>{z+=se.offsetTop,D+=se.offsetLeft,se.offsetParent&&j(se.offsetParent)};return R.offsetParent&&j(R.offsetParent),{left:D,top:z}},E=R=>{let{left:D,top:z}=R.getBoundingClientRect();return{left:D,top:z}},S=({i_width:R,i_height:D,c_width:z,c_height:j})=>{const se=R/D,me=z/j;switch(!0){case se>me:R=z,D=R/se;break;case se<me:D=j,R=D*se;break;case se==me:R=z,D=j;break}return{width:R,height:D}},v=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{let R=a.options.src;const D=R.split(/[:;]/);if(D.length===3?b.type=D[1]:b.type="image/png",r.value?(v.top="0",v.left="0",v.width="100vw",v.height="100vh"):c.relatedDom?(v.top=`${c.relatedDom.offsetTop}px`,v.left=`${c.relatedDom.offsetLeft}px`,v.width=`${c.relatedDom.clientWidth}px`,v.height=`${c.relatedDom.clientHeight}px`):(v.top="0",v.left="0",v.width="100vw",v.height="100vh"),f.value&&y.value){const z=f.value,j=z.getContext("2d",{willReadFrequently:!0});b.ctx=j,z.width=y.value.clientWidth,z.height=y.value.clientHeight;const se=z.width,me=z.height,de=new Image;de.src=R,de.onload=()=>{j.clearRect(0,0,z.width,z.height);const we=de.width,ke=de.height,Se=S({i_width:we,i_height:ke,c_width:se,c_height:me});g.width=Se.width,g.height=Se.height,z.width=g.width,z.height=g.height,g.x=(z.width-g.width)/2,g.y=(z.height-g.height)/2,j==null||j.drawImage(de,g.x,g.y,g.width,g.height);const ce=j==null?void 0:j.getImageData(0,0,z.width,z.height);ce&&(b.originImg=ce,b.operateList.push(ce),b.originImage=O(ce),b.currentImage=b.originImage,b.saveImage=b.originImage)}}});const M=async()=>{if(b.saveImage!==b.originImage){const R=da.service({target:c.relatedDom||document.body});await u(a.options.dataKey,b.saveImage,b.type),R.close()}a.close()},T=R=>{R.target===m.value&&a.close()},B=()=>{b.operateList[b.index]!==b.originImg?b.clearIcon=Kt("clearIcon"):b.clearIcon=Kt("clearDisableIcon"),b.index>0?b.undoIcon=Kt("undoIcon"):b.undoIcon=Kt("undoDisableIcon"),b.redoList.length>0?b.redoIcon=Kt("redoIcon"):b.redoIcon=Kt("redoDisableIcon")},Y=()=>{var D;const R=(D=b.ctx)==null?void 0:D.getImageData(g.x,g.y,g.width,g.height);b.currentImage=O(R),B()},O=R=>{const D=document.createElement("canvas");D.width=R.width,D.height=R.height;const z=D.getContext("2d");return z==null||z.putImageData(R,0,0),D.toDataURL().split(",")[1]},Q=R=>{if(f.value){R.preventDefault(),R.stopPropagation();const D=b.ctx;if(D.strokeStyle=b.color,D.lineWidth=parseInt(b.stroke),b.isDrawing=!0,r.value){const{left:z,top:j}=E(f.value);R=R,w.x=R.targetTouches[0].clientX-z,w.y=R.targetTouches[0].clientY-j,b.points.push({x:w.x,y:w.y})}else{const{left:z,top:j}=A(f.value);R=R,w.x=R.clientX-z,w.y=R.clientY-j,b.points.push({x:w.x,y:w.y})}}},W=(R,D,z)=>{const j=b.ctx;j.beginPath(),j.moveTo(R.x,R.y),j.quadraticCurveTo(D.x,D.y,z.x,z.y),j.stroke(),j.closePath()},ne=R=>{var D;if(f.value&&(R.preventDefault(),R.stopPropagation(),f.value.style.cursor="auto",b.isDrawing)){if(r.value){const{left:se,top:me}=E(f.value);R=R;const de=R.changedTouches[0].clientX-se,we=R.changedTouches[0].clientY-me;b.points.push({x:de,y:we})}else{const{left:se,top:me}=A(f.value);R=R;const de=R.clientX-se,we=R.clientY-me;b.points.push({x:de,y:we})}if(b.points.length>3){const se=b.points.slice(-2),me=se[0],de=se[1];b.beginPoint&&W(b.beginPoint,me,de)}b.beginPoint=null,b.points=[];const z=b.ctx;z==null||z.closePath();const j=(D=b.ctx)==null?void 0:D.getImageData(g.x,g.y,g.width,g.height);b.operateList.push(j),b.redoList=new Array,b.index++}b.isDrawing=!1,Y()},q=R=>{if(f.value&&(R.preventDefault(),R.stopPropagation(),b.isDrawing)){if(r.value){const{left:D,top:z}=E(f.value);R=R;const j=R.targetTouches[0].clientX-D,se=R.targetTouches[0].clientY-z;b.points.push({x:j,y:se})}else{const{left:D,top:z}=A(f.value);R=R;const j=R.clientX-D,se=R.clientY-z;b.points.push({x:j,y:se})}if(b.points.length>3){const D=b.points.slice(-2),z=D[0],j={x:(D[0].x+D[1].x)/2,y:(D[0].y+D[1].y)/2};b.beginPoint&&W(b.beginPoint,z,j),b.beginPoint=j}}},G=()=>{if(f.value){const R=f.value;r.value?(R.addEventListener("touchstart",Q),R.addEventListener("touchend",ne),R.addEventListener("touchcancel",ne),R.addEventListener("touchmove",q)):(R.addEventListener("mousedown",Q),R.addEventListener("mouseup",ne),R.addEventListener("mouseleave",ne),R.addEventListener("mousemove",q)),b.isEditable=!0}},F=()=>{if(f.value){const R=f.value;R.removeEventListener("mousedown",Q),R.removeEventListener("mouseup",ne),R.removeEventListener("mouseleave",ne),R.removeEventListener("mousemove",q),b.isEditable=!1,b.saveImage=b.currentImage}},te=()=>{const R=b.ctx;R&&b.originImg&&(b.index++,b.operateList.push(b.originImg),b.redoList=new Array,R.putImageData(b.originImg,g.x,g.y),Y())},he=()=>{var D;const R=b.operateList.pop();b.redoList.push(R),b.index--,b.redoIcon=Kt("redoIcon"),(D=b.ctx)==null||D.putImageData(b.operateList[b.index],g.x,g.y),Y()},ae=()=>{var D;const R=b.redoList.pop();b.operateList.push(R),b.index++,(D=b.ctx)==null||D.putImageData(R,g.x,g.y),Y()};return(R,D)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"editorView",ref:m,class:t.normalizeClass(r.value?"image-editor-view image-editor-view-mobile":"image-editor-view image-editor-view-ps"),onClick:T},[t.createElementVNode("div",oM,[t.createElementVNode("img",{class:"image-editor-close_icon",src:ih,onClick:M}),t.createElementVNode("div",{ref_key:"editorBox",ref:y,class:"image-editor-console-box"},[t.createElementVNode("canvas",{class:"image-editor-console",ref_key:"editorDom",ref:f},null,512)],512),t.unref(a).options.markable?(t.openBlock(),t.createElementBlock("div",iM,[b.isEditable?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",aM,[t.createElementVNode("img",{src:tM,class:"image-editor-editImg",onClick:G})])),b.isEditable?(t.openBlock(),t.createElementBlock("div",sM,[t.createElementVNode("div",lM,[t.withDirectives(t.createElementVNode("input",{class:"image-editor-color",type:"color","onUpdate:modelValue":D[0]||(D[0]=z=>b.color=z)},null,512),[[t.vModelText,b.color]]),t.withDirectives(t.createElementVNode("input",{class:"image-editor-stroke",type:"range",min:"1",max:"15","onUpdate:modelValue":D[1]||(D[1]=z=>b.stroke=z)},null,512),[[t.vModelText,b.stroke]]),t.createElementVNode("img",{class:"image-editor-clear",src:b.clearIcon,onClick:D[2]||(D[2]=z=>b.clearIcon==t.unref(Kt)("clearIcon")&&te())},null,8,cM),t.createElementVNode("img",{class:"image-editor-undo",src:b.undoIcon,onClick:D[3]||(D[3]=z=>b.undoIcon==t.unref(Kt)("undoIcon")&&he())},null,8,uM),t.createElementVNode("img",{class:"image-editor-redo",src:b.redoIcon,onClick:D[4]||(D[4]=z=>b.redoIcon==t.unref(Kt)("redoIcon")&&ae())},null,8,fM)]),t.createElementVNode("div",{class:"right"},[t.createElementVNode("div",{class:"image-editor-comfirm",onClick:F},dM)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],2)]))}}),[["__scopeId","data-v-516516a5"]]),hM="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='6'%20height='6'%20viewBox='0%200%206%206'%3e%3ccircle%20id='椭圆_711'%20data-name='椭圆%20711'%20cx='3'%20cy='3'%20r='3'%20fill='%23005795'/%3e%3c/svg%3e",uh=e=>(t.pushScopeId("data-v-5ee3d8d8"),e=e(),t.popScopeId(),e),mM={class:"recommend-diagnoses"},gM=uh(()=>t.createElementVNode("div",{class:"header"},null,-1)),yM=uh(()=>t.createElementVNode("div",{class:"recommend-diagnoses-title"},[t.createElementVNode("img",{class:"recommend-diagnoses-title_icon",src:hM}),t.createElementVNode("span",{class:"recommend-diagnoses-title_text"},"Recommend Diagnoses")],-1)),bM={class:"recommend-diagnoses-list"},wM={class:"recommend-diagnoses-item"},EM={class:"recommend-diagnoses-item-code"},CM={class:"recommend-diagnosis-item-comment"},SM={class:"recommend-diagnoses-confirm"},xM=mi(t.defineComponent({__name:"RecommendDiagnosis",setup(e){t.useCssVars(T=>({"67c4d826":E.width,c4742040:E.height,"6282853c":E.top,"246b4e00":E.left}));const r=t.ref(hi()),a=Nr().getDocumentTemplate(),l=a.ecos,c=a.info,f=Ms().getRecommendDiagnosis(),m=t.reactive([]),y=t.reactive(f.options.formData),g=t.ref(!1),w=t.ref(null),b=f.cache;let A="";const E=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{const B=Nr().getDocumentTemplate();B.relatedDom?(E.top=`${B.relatedDom.offsetTop}px`,E.left=`${B.relatedDom.offsetLeft}px`,E.width=`${B.relatedDom.clientWidth}px`,E.height=`${B.relatedDom.clientHeight}px`):(E.top="0",E.left="0",E.width="100vw",E.height="100vh");const Y=da.service({target:B.relatedDom||document.body}),O=y.Diagnosis,Q=new Set(O.map(q=>q.code));let W=[];if(b.hasCache)W=b.list;else{const q=await l.retrieveDocument({idList:[c.facilityId,...c.locationIds,c.patientId],options:{ObjType:28,sfname:'{"result":"D.*", "join": "INNER JOIN Edge E on E.id=D.reid INNER JOIN Edge E2 on E.refid=E2.id"}',xfname:"(E.bvid,E2.Bvid) | (E.evid,E2.Bvid)",scondition:"E.type=40000 AND E.subtype&0xff=6 AND E2.type=40000 AND E2.subtype&0xff in(1,9) AND D.type=186881",asc:!1,obfname:"D.ctime",maxcount:100}});if(q.code===0){let G=[];q.document.forEach(F=>{const te=F.name.data.diagnosis.descriptiveList;G=G.concat(te)}),b.hasCache=!0,b.list=Rn.cloneDeep(G),W=G}else b.hasCache=!0,b.list=[],W=[]}W.forEach(q=>{Q.has(q.code)?q.isChecked=!0:q.isChecked=!1});let ne=new Set;W=W.filter(q=>ne.has(q.code)?!1:(ne.add(q.code),!0)),W.forEach(q=>{q.isChecked?A+="1":A+="0",m.push(q)}),Y.close()}),t.watch(m,()=>{let T="";m.forEach(B=>{B.isChecked?T+="1":T+="0"}),g.value=A!==T});const S=()=>{f.close()},v=T=>{T.target===w.value&&f.close()},M=async()=>{};return(T,B)=>{const Y=sp,O=yr;return t.openBlock(),t.createElementBlock("div",{ref_key:"diagnosisView",ref:w,class:t.normalizeClass(r.value?"recommend-diagnoses-view recommend-diagnoses-mobile":"recommend-diagnoses-view"),onClick:v},[t.createElementVNode("div",mM,[gM,t.createElementVNode("div",{class:"recommend-diagnoses-close"},[t.createElementVNode("img",{class:"recommend-diagnoses-close_icon",src:ch,onClick:S})]),yM,t.createElementVNode("div",bM,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,Q=>(t.openBlock(),t.createElementBlock("div",wM,[t.createElementVNode("div",EM,[t.createVNode(Y,{modelValue:Q.isChecked,"onUpdate:modelValue":W=>Q.isChecked=W},null,8,["modelValue","onUpdate:modelValue"]),t.createTextVNode(" "+t.toDisplayString(Q.code)+" - "+t.toDisplayString(Q.description),1)]),t.createElementVNode("div",CM,t.toDisplayString(Q.comment),1)]))),256))]),t.createElementVNode("div",SM,[t.createVNode(O,{class:t.normalizeClass(`
76
+ */(function(e){const r=Ia,o=ql,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=T,e.INSPECT_MAX_BYTES=50;const l=2147483647;e.kMaxLength=l,f.TYPED_ARRAY_SUPPORT=c(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const x=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(x,p),x.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function u(x){if(x>l)throw new RangeError('The value "'+x+'" is invalid for option "size"');const p=new Uint8Array(x);return Object.setPrototypeOf(p,f.prototype),p}function f(x,p,h){if(typeof x=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(x)}return m(x,p,h)}f.poolSize=8192;function m(x,p,h){if(typeof x=="string")return b(x,p);if(ArrayBuffer.isView(x))return E(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(st(x,ArrayBuffer)||x&&st(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(st(x,SharedArrayBuffer)||x&&st(x.buffer,SharedArrayBuffer)))return S(x,p,h);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const k=x.valueOf&&x.valueOf();if(k!=null&&k!==x)return f.from(k,p,h);const P=v(x);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return f.from(x[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}f.from=function(x,p,h){return m(x,p,h)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function y(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function g(x,p,h){return y(x),x<=0?u(x):p!==void 0?typeof h=="string"?u(x).fill(p,h):u(x).fill(p):u(x)}f.alloc=function(x,p,h){return g(x,p,h)};function w(x){return y(x),u(x<0?0:M(x)|0)}f.allocUnsafe=function(x){return w(x)},f.allocUnsafeSlow=function(x){return w(x)};function b(x,p){if((typeof p!="string"||p==="")&&(p="utf8"),!f.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=B(x,p)|0;let k=u(h);const P=k.write(x,p);return P!==h&&(k=k.slice(0,P)),k}function A(x){const p=x.length<0?0:M(x.length)|0,h=u(p);for(let k=0;k<p;k+=1)h[k]=x[k]&255;return h}function E(x){if(st(x,Uint8Array)){const p=new Uint8Array(x);return S(p.buffer,p.byteOffset,p.byteLength)}return A(x)}function S(x,p,h){if(p<0||x.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let k;return p===void 0&&h===void 0?k=new Uint8Array(x):h===void 0?k=new Uint8Array(x,p):k=new Uint8Array(x,p,h),Object.setPrototypeOf(k,f.prototype),k}function v(x){if(f.isBuffer(x)){const p=M(x.length)|0,h=u(p);return h.length===0||x.copy(h,0,0,p),h}if(x.length!==void 0)return typeof x.length!="number"||Lt(x.length)?u(0):A(x);if(x.type==="Buffer"&&Array.isArray(x.data))return A(x.data)}function M(x){if(x>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return x|0}function T(x){return+x!=x&&(x=0),f.alloc(+x)}f.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==f.prototype},f.compare=function(p,h){if(st(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),st(h,Uint8Array)&&(h=f.from(h,h.offset,h.byteLength)),!f.isBuffer(p)||!f.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let k=p.length,P=h.length;for(let U=0,ee=Math.min(k,P);U<ee;++U)if(p[U]!==h[U]){k=p[U],P=h[U];break}return k<P?-1:P<k?1:0},f.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return f.alloc(0);let k;if(h===void 0)for(h=0,k=0;k<p.length;++k)h+=p[k].length;const P=f.allocUnsafe(h);let U=0;for(k=0;k<p.length;++k){let ee=p[k];if(st(ee,Uint8Array))U+ee.length>P.length?(f.isBuffer(ee)||(ee=f.from(ee)),ee.copy(P,U)):Uint8Array.prototype.set.call(P,ee,U);else if(f.isBuffer(ee))ee.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=ee.length}return P};function B(x,p){if(f.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||st(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const h=x.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&h===0)return 0;let P=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return De(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return mt(x).length;default:if(P)return k?-1:De(x).length;p=(""+p).toLowerCase(),P=!0}}f.byteLength=B;function Y(x,p,h){let k=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(x||(x="utf8");;)switch(x){case"hex":return se(this,p,h);case"utf8":case"utf-8":return ae(this,p,h);case"ascii":return z(this,p,h);case"latin1":case"binary":return j(this,p,h);case"base64":return he(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,p,h);default:if(k)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),k=!0}}f.prototype._isBuffer=!0;function O(x,p,h){const k=x[p];x[p]=x[h],x[h]=k}f.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<p;h+=2)O(this,h,h+1);return this},f.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<p;h+=4)O(this,h,h+3),O(this,h+1,h+2);return this},f.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<p;h+=8)O(this,h,h+7),O(this,h+1,h+6),O(this,h+2,h+5),O(this,h+3,h+4);return this},f.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?ae(this,0,p):Y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(p){if(!f.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:f.compare(this,p)===0},f.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},a&&(f.prototype[a]=f.prototype.inspect),f.prototype.compare=function(p,h,k,P,U){if(st(p,Uint8Array)&&(p=f.from(p,p.offset,p.byteLength)),!f.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),k===void 0&&(k=p?p.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),h<0||k>p.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&h>=k)return 0;if(P>=U)return-1;if(h>=k)return 1;if(h>>>=0,k>>>=0,P>>>=0,U>>>=0,this===p)return 0;let ee=U-P,ve=k-h;const Ze=Math.min(ee,ve),Ge=this.slice(P,U),Xe=p.slice(h,k);for(let He=0;He<Ze;++He)if(Ge[He]!==Xe[He]){ee=Ge[He],ve=Xe[He];break}return ee<ve?-1:ve<ee?1:0};function Q(x,p,h,k,P){if(x.length===0)return-1;if(typeof h=="string"?(k=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Lt(h)&&(h=P?0:x.length-1),h<0&&(h=x.length+h),h>=x.length){if(P)return-1;h=x.length-1}else if(h<0)if(P)h=0;else return-1;if(typeof p=="string"&&(p=f.from(p,k)),f.isBuffer(p))return p.length===0?-1:W(x,p,h,k,P);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(x,p,h):Uint8Array.prototype.lastIndexOf.call(x,p,h):W(x,[p],h,k,P);throw new TypeError("val must be string, number or Buffer")}function W(x,p,h,k,P){let U=1,ee=x.length,ve=p.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(x.length<2||p.length<2)return-1;U=2,ee/=2,ve/=2,h/=2}function Ze(Xe,He){return U===1?Xe[He]:Xe.readUInt16BE(He*U)}let Ge;if(P){let Xe=-1;for(Ge=h;Ge<ee;Ge++)if(Ze(x,Ge)===Ze(p,Xe===-1?0:Ge-Xe)){if(Xe===-1&&(Xe=Ge),Ge-Xe+1===ve)return Xe*U}else Xe!==-1&&(Ge-=Ge-Xe),Xe=-1}else for(h+ve>ee&&(h=ee-ve),Ge=h;Ge>=0;Ge--){let Xe=!0;for(let He=0;He<ve;He++)if(Ze(x,Ge+He)!==Ze(p,He)){Xe=!1;break}if(Xe)return Ge}return-1}f.prototype.includes=function(p,h,k){return this.indexOf(p,h,k)!==-1},f.prototype.indexOf=function(p,h,k){return Q(this,p,h,k,!0)},f.prototype.lastIndexOf=function(p,h,k){return Q(this,p,h,k,!1)};function ne(x,p,h,k){h=Number(h)||0;const P=x.length-h;k?(k=Number(k),k>P&&(k=P)):k=P;const U=p.length;k>U/2&&(k=U/2);let ee;for(ee=0;ee<k;++ee){const ve=parseInt(p.substr(ee*2,2),16);if(Lt(ve))return ee;x[h+ee]=ve}return ee}function q(x,p,h,k){return nt(De(p,x.length-h),x,h,k)}function G(x,p,h,k){return nt(ht(p),x,h,k)}function F(x,p,h,k){return nt(mt(p),x,h,k)}function te(x,p,h,k){return nt(kt(p,x.length-h),x,h,k)}f.prototype.write=function(p,h,k,P){if(h===void 0)P="utf8",k=this.length,h=0;else if(k===void 0&&typeof h=="string")P=h,k=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(k)?(k=k>>>0,P===void 0&&(P="utf8")):(P=k,k=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-h;if((k===void 0||k>U)&&(k=U),p.length>0&&(k<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let ee=!1;for(;;)switch(P){case"hex":return ne(this,p,h,k);case"utf8":case"utf-8":return q(this,p,h,k);case"ascii":case"latin1":case"binary":return G(this,p,h,k);case"base64":return F(this,p,h,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,p,h,k);default:if(ee)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),ee=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function he(x,p,h){return p===0&&h===x.length?r.fromByteArray(x):r.fromByteArray(x.slice(p,h))}function ae(x,p,h){h=Math.min(x.length,h);const k=[];let P=p;for(;P<h;){const U=x[P];let ee=null,ve=U>239?4:U>223?3:U>191?2:1;if(P+ve<=h){let Ze,Ge,Xe,He;switch(ve){case 1:U<128&&(ee=U);break;case 2:Ze=x[P+1],(Ze&192)===128&&(He=(U&31)<<6|Ze&63,He>127&&(ee=He));break;case 3:Ze=x[P+1],Ge=x[P+2],(Ze&192)===128&&(Ge&192)===128&&(He=(U&15)<<12|(Ze&63)<<6|Ge&63,He>2047&&(He<55296||He>57343)&&(ee=He));break;case 4:Ze=x[P+1],Ge=x[P+2],Xe=x[P+3],(Ze&192)===128&&(Ge&192)===128&&(Xe&192)===128&&(He=(U&15)<<18|(Ze&63)<<12|(Ge&63)<<6|Xe&63,He>65535&&He<1114112&&(ee=He))}}ee===null?(ee=65533,ve=1):ee>65535&&(ee-=65536,k.push(ee>>>10&1023|55296),ee=56320|ee&1023),k.push(ee),P+=ve}return D(k)}const R=4096;function D(x){const p=x.length;if(p<=R)return String.fromCharCode.apply(String,x);let h="",k=0;for(;k<p;)h+=String.fromCharCode.apply(String,x.slice(k,k+=R));return h}function z(x,p,h){let k="";h=Math.min(x.length,h);for(let P=p;P<h;++P)k+=String.fromCharCode(x[P]&127);return k}function j(x,p,h){let k="";h=Math.min(x.length,h);for(let P=p;P<h;++P)k+=String.fromCharCode(x[P]);return k}function se(x,p,h){const k=x.length;(!p||p<0)&&(p=0),(!h||h<0||h>k)&&(h=k);let P="";for(let U=p;U<h;++U)P+=qt[x[U]];return P}function me(x,p,h){const k=x.slice(p,h);let P="";for(let U=0;U<k.length-1;U+=2)P+=String.fromCharCode(k[U]+k[U+1]*256);return P}f.prototype.slice=function(p,h){const k=this.length;p=~~p,h=h===void 0?k:~~h,p<0?(p+=k,p<0&&(p=0)):p>k&&(p=k),h<0?(h+=k,h<0&&(h=0)):h>k&&(h=k),h<p&&(h=p);const P=this.subarray(p,h);return Object.setPrototypeOf(P,f.prototype),P};function de(x,p,h){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+p>h)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)P+=this[p+ee]*U;return P},f.prototype.readUintBE=f.prototype.readUIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=this[p+--h],U=1;for(;h>0&&(U*=256);)P+=this[p+--h]*U;return P},f.prototype.readUint8=f.prototype.readUInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]|this[p+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||de(p,2,this.length),this[p]<<8|this[p+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},f.prototype.readBigUInt64LE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,U=this[++p]+this[++p]*2**8+this[++p]*2**16+k*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),f.prototype.readBigUInt64BE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],U=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k;return(BigInt(P)<<BigInt(32))+BigInt(U)}),f.prototype.readIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=this[p],U=1,ee=0;for(;++ee<h&&(U*=256);)P+=this[p+ee]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*h)),P},f.prototype.readIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||de(p,h,this.length);let P=h,U=1,ee=this[p+--P];for(;P>0&&(U*=256);)ee+=this[p+--P]*U;return U*=128,ee>=U&&(ee-=Math.pow(2,8*h)),ee},f.prototype.readInt8=function(p,h){return p=p>>>0,h||de(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},f.prototype.readInt16LE=function(p,h){p=p>>>0,h||de(p,2,this.length);const k=this[p]|this[p+1]<<8;return k&32768?k|4294901760:k},f.prototype.readInt16BE=function(p,h){p=p>>>0,h||de(p,2,this.length);const k=this[p+1]|this[p]<<8;return k&32768?k|4294901760:k},f.prototype.readInt32LE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},f.prototype.readInt32BE=function(p,h){return p=p>>>0,h||de(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},f.prototype.readBigInt64LE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(k<<24);return(BigInt(P)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),f.prototype.readBigInt64BE=ie(function(p){p=p>>>0,et(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&tt(p,this.length-8);const P=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(P)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k)}),f.prototype.readFloatLE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!0,23,4)},f.prototype.readFloatBE=function(p,h){return p=p>>>0,h||de(p,4,this.length),o.read(this,p,!1,23,4)},f.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!0,52,8)},f.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||de(p,8,this.length),o.read(this,p,!1,52,8)};function we(x,p,h,k,P,U){if(!f.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>P||p<U)throw new RangeError('"value" argument is out of bounds');if(h+k>x.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(p,h,k,P){if(p=+p,h=h>>>0,k=k>>>0,!P){const ve=Math.pow(2,8*k)-1;we(this,p,h,k,ve,0)}let U=1,ee=0;for(this[h]=p&255;++ee<k&&(U*=256);)this[h+ee]=p/U&255;return h+k},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(p,h,k,P){if(p=+p,h=h>>>0,k=k>>>0,!P){const ve=Math.pow(2,8*k)-1;we(this,p,h,k,ve,0)}let U=k-1,ee=1;for(this[h+U]=p&255;--U>=0&&(ee*=256);)this[h+U]=p/ee&255;return h+k},f.prototype.writeUint8=f.prototype.writeUInt8=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,1,255,0),this[h]=p&255,h+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function ke(x,p,h,k,P){at(p,k,P,x,h,7);let U=Number(p&BigInt(4294967295));x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U,U=U>>8,x[h++]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,ee=ee>>8,x[h++]=ee,h}function Se(x,p,h,k,P){at(p,k,P,x,h,7);let U=Number(p&BigInt(4294967295));x[h+7]=U,U=U>>8,x[h+6]=U,U=U>>8,x[h+5]=U,U=U>>8,x[h+4]=U;let ee=Number(p>>BigInt(32)&BigInt(4294967295));return x[h+3]=ee,ee=ee>>8,x[h+2]=ee,ee=ee>>8,x[h+1]=ee,ee=ee>>8,x[h]=ee,h+8}f.prototype.writeBigUInt64LE=ie(function(p,h=0){return ke(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=ie(function(p,h=0){return Se(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(p,h,k,P){if(p=+p,h=h>>>0,!P){const Ze=Math.pow(2,8*k-1);we(this,p,h,k,Ze-1,-Ze)}let U=0,ee=1,ve=0;for(this[h]=p&255;++U<k&&(ee*=256);)p<0&&ve===0&&this[h+U-1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+k},f.prototype.writeIntBE=function(p,h,k,P){if(p=+p,h=h>>>0,!P){const Ze=Math.pow(2,8*k-1);we(this,p,h,k,Ze-1,-Ze)}let U=k-1,ee=1,ve=0;for(this[h+U]=p&255;--U>=0&&(ee*=256);)p<0&&ve===0&&this[h+U+1]!==0&&(ve=1),this[h+U]=(p/ee>>0)-ve&255;return h+k},f.prototype.writeInt8=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},f.prototype.writeInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},f.prototype.writeInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},f.prototype.writeInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},f.prototype.writeInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||we(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},f.prototype.writeBigInt64LE=ie(function(p,h=0){return ke(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=ie(function(p,h=0){return Se(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(x,p,h,k,P,U){if(h+k>x.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function ue(x,p,h,k,P){return p=+p,h=h>>>0,P||ce(x,p,h,4),o.write(x,p,h,k,23,4),h+4}f.prototype.writeFloatLE=function(p,h,k){return ue(this,p,h,!0,k)},f.prototype.writeFloatBE=function(p,h,k){return ue(this,p,h,!1,k)};function Ee(x,p,h,k,P){return p=+p,h=h>>>0,P||ce(x,p,h,8),o.write(x,p,h,k,52,8),h+8}f.prototype.writeDoubleLE=function(p,h,k){return Ee(this,p,h,!0,k)},f.prototype.writeDoubleBE=function(p,h,k){return Ee(this,p,h,!1,k)},f.prototype.copy=function(p,h,k,P){if(!f.isBuffer(p))throw new TypeError("argument should be a Buffer");if(k||(k=0),!P&&P!==0&&(P=this.length),h>=p.length&&(h=p.length),h||(h=0),P>0&&P<k&&(P=k),P===k||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),p.length-h<P-k&&(P=p.length-h+k);const U=P-k;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,k,P):Uint8Array.prototype.set.call(p,this.subarray(k,P),h),U},f.prototype.fill=function(p,h,k,P){if(typeof p=="string"){if(typeof h=="string"?(P=h,h=0,k=this.length):typeof k=="string"&&(P=k,k=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!f.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(p.length===1){const ee=p.charCodeAt(0);(P==="utf8"&&ee<128||P==="latin1")&&(p=ee)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<k)throw new RangeError("Out of range index");if(k<=h)return this;h=h>>>0,k=k===void 0?this.length:k>>>0,p||(p=0);let U;if(typeof p=="number")for(U=h;U<k;++U)this[U]=p;else{const ee=f.isBuffer(p)?p:f.from(p,P),ve=ee.length;if(ve===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(U=0;U<k-h;++U)this[U+h]=ee[U%ve]}return this};const ye={};function Me(x,p,h){ye[x]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}Me("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Me("ERR_INVALID_ARG_TYPE",function(x,p){return`The "${x}" argument must be of type number. Received type ${typeof p}`},TypeError),Me("ERR_OUT_OF_RANGE",function(x,p,h){let k=`The value of "${x}" is out of range.`,P=h;return Number.isInteger(h)&&Math.abs(h)>2**32?P=Pe(String(h)):typeof h=="bigint"&&(P=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(P=Pe(P)),P+="n"),k+=` It must be ${p}. Received ${P}`,k},RangeError);function Pe(x){let p="",h=x.length;const k=x[0]==="-"?1:0;for(;h>=k+4;h-=3)p=`_${x.slice(h-3,h)}${p}`;return`${x.slice(0,h)}${p}`}function Ve(x,p,h){et(p,"offset"),(x[p]===void 0||x[p+h]===void 0)&&tt(p,x.length-(h+1))}function at(x,p,h,k,P,U){if(x>h||x<p){const ee=typeof p=="bigint"?"n":"";let ve;throw p===0||p===BigInt(0)?ve=`>= 0${ee} and < 2${ee} ** ${(U+1)*8}${ee}`:ve=`>= -(2${ee} ** ${(U+1)*8-1}${ee}) and < 2 ** ${(U+1)*8-1}${ee}`,new ye.ERR_OUT_OF_RANGE("value",ve,x)}Ve(k,P,U)}function et(x,p){if(typeof x!="number")throw new ye.ERR_INVALID_ARG_TYPE(p,"number",x)}function tt(x,p,h){throw Math.floor(x)!==x?(et(x,h),new ye.ERR_OUT_OF_RANGE("offset","an integer",x)):p<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,x)}const H=/[^+/0-9A-Za-z-_]/g;function pe(x){if(x=x.split("=")[0],x=x.trim().replace(H,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function De(x,p){p=p||1/0;let h;const k=x.length;let P=null;const U=[];for(let ee=0;ee<k;++ee){if(h=x.charCodeAt(ee),h>55295&&h<57344){if(!P){if(h>56319){(p-=3)>-1&&U.push(239,191,189);continue}else if(ee+1===k){(p-=3)>-1&&U.push(239,191,189);continue}P=h;continue}if(h<56320){(p-=3)>-1&&U.push(239,191,189),P=h;continue}h=(P-55296<<10|h-56320)+65536}else P&&(p-=3)>-1&&U.push(239,191,189);if(P=null,h<128){if((p-=1)<0)break;U.push(h)}else if(h<2048){if((p-=2)<0)break;U.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;U.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;U.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return U}function ht(x){const p=[];for(let h=0;h<x.length;++h)p.push(x.charCodeAt(h)&255);return p}function kt(x,p){let h,k,P;const U=[];for(let ee=0;ee<x.length&&!((p-=2)<0);++ee)h=x.charCodeAt(ee),k=h>>8,P=h%256,U.push(P),U.push(k);return U}function mt(x){return r.toByteArray(pe(x))}function nt(x,p,h,k){let P;for(P=0;P<k&&!(P+h>=p.length||P>=x.length);++P)p[P+h]=x[P];return P}function st(x,p){return x instanceof p||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===p.name}function Lt(x){return x!==x}const qt=function(){const x="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const k=h*16;for(let P=0;P<16;++P)p[k+P]=x[h]+x[P]}return p}();function ie(x){return typeof BigInt>"u"?Ae:x}function Ae(){throw new Error("BigInt not supported")}})(ah);const W4=e=>{const r=atob(e),o=r.length,a=new Uint8Array(o);for(let l=0;l<o;l++)a[l]=r.charCodeAt(l);return a},H4=({type:e,data:r})=>`data:${e};base64,${r}`,Y4=e=>W4(e),lh=(e,r)=>{const o=Y4(e),a=ah.Buffer.from(o.buffer);return new Blob([a.buffer],{type:r})},ch="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16.828'%20height='16.828'%20viewBox='0%200%2016.828%2016.828'%3e%3cg%20id='组_10025'%20data-name='组%2010025'%20transform='translate(0.914%201.414)'%3e%3cline%20id='直线_1370'%20data-name='直线%201370'%20x2='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3cline%20id='直线_1371'%20data-name='直线%201371'%20x1='14'%20y2='14'%20transform='translate(0.5)'%20fill='none'%20stroke='%23c1c1c1'%20stroke-linecap='round'%20stroke-width='2'/%3e%3c/g%3e%3c/svg%3e",G4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%20id='组_11460'%20data-name='组%2011460'%20transform='translate(-1070%20-577)'%3e%3cpath%20id='路径_9629'%20data-name='路径%209629'%20d='M8,14.625A6.625,6.625,0,1,0,1.375,8,6.625,6.625,0,0,0,8,14.625ZM8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16Z'%20transform='translate(1070%20577)'%20fill='%23999'/%3e%3cpath%20id='路径_9630'%20data-name='路径%209630'%20d='M449.688,212.688a.687.687,0,1,0-1.375,0v5.3a.687.687,0,1,0,1.375,0ZM449,219.375a1,1,0,1,0,1,1A1,1,0,0,0,449,219.375Z'%20transform='translate(629%20368.313)'%20fill='%23999'/%3e%3c/g%3e%3c/svg%3e",Ma=e=>(t.pushScopeId("data-v-50a3cf13"),e=e(),t.popScopeId(),e),K4={class:"signature_box"},q4=Ma(()=>t.createElementVNode("div",{class:"signature_tilte"},"Signature",-1)),Q4=Ma(()=>t.createElementVNode("div",{class:"subtitle"},"Click on the signature box below to finger sign",-1)),Z4=Ma(()=>t.createElementVNode("div",{class:"label"},"X",-1)),X4=Ma(()=>t.createElementVNode("div",{class:"signature_tips"},[t.createElementVNode("img",{class:"signature_icon",src:G4}),t.createElementVNode("div",{class:"tips"},"The signature is saved for later use.")],-1)),J4={class:"signature_operate"},eM=mi(t.defineComponent({__name:"SignaturePad",setup(e){t.useCssVars(q=>({"68ae9541":ne.width,d955cde8:ne.height,"4c4bcb90":ne.top,"3d29dd2c":ne.left}));const r=t.ref(hi()),a=Nr().getDocumentTemplate(),l=t.ref(null),c=t.ref(null),u=t.ref(null),m=_s().getSignaturePad(),y=m.confirm,g=t.reactive({status:!1,ctx:null,originSignature:"",saveSignature:"",points:new Array,beginPoint:null}),w=t.reactive({x:0,y:0}),b=q=>{let[G,F]=[q.offsetLeft,q.offsetTop];const te=he=>{F+=he.offsetTop,G+=he.offsetLeft,he.offsetParent&&te(he.offsetParent)};return q.offsetParent&&te(q.offsetParent),{left:G,top:F}},A=q=>{let{left:G,top:F}=q.getBoundingClientRect();return{left:G,top:F}},E=q=>{const G=document.createElement("canvas");G.width=q.width,G.height=q.height;const F=G.getContext("2d");return F==null||F.putImageData(q,0,0),G.toDataURL().split(",")[1]},S=q=>{if(c.value)if(q.preventDefault(),q.stopPropagation(),g.status=!0,r.value){const{left:G,top:F}=A(c.value);q=q,w.x=q.targetTouches[0].clientX-G,w.y=q.targetTouches[0].clientY-F,g.points.push({x:w.x,y:w.y})}else{const{left:G,top:F}=b(c.value);q=q,w.x=q.clientX-G,w.y=q.clientY-F,g.points.push({x:w.x,y:w.y})}},v=(q,G,F)=>{const te=g.ctx;te.beginPath(),te.moveTo(q.x,q.y),te.quadraticCurveTo(G.x,G.y,F.x,F.y),te.stroke(),te.closePath()},M=q=>{if(c.value&&(q.preventDefault(),q.stopPropagation(),g.status&&g.ctx)){if(r.value){const{left:G,top:F}=A(c.value);q=q;const te=q.targetTouches[0].clientX-G,he=q.targetTouches[0].clientY-F;g.points.push({x:te,y:he})}else{const{left:G,top:F}=b(c.value);q=q;const te=q.clientX-G,he=q.clientY-F;g.points.push({x:te,y:he})}if(g.points.length>3){const G=g.points.slice(-2),F=G[0],te={x:(G[0].x+G[1].x)/2,y:(G[0].y+G[1].y)/2};g.beginPoint&&v(g.beginPoint,F,te),g.beginPoint=te}}},T=q=>{if(c.value){q.preventDefault(),q.stopPropagation();const G=c.value;if(G.style.cursor="auto",g.status){if(r.value){const{left:he,top:ae}=A(c.value);q=q;const R=q.changedTouches[0].clientX-he,D=q.changedTouches[0].clientY-ae;g.points.push({x:R,y:D})}else{const{left:he,top:ae}=b(c.value);q=q;const R=q.clientX-he,D=q.clientY-ae;g.points.push({x:R,y:D})}if(g.points.length>3){const he=g.points.slice(-2),ae=he[0],R=he[1];g.beginPoint&&v(g.beginPoint,ae,R)}g.beginPoint=null,g.points=[];const F=g.ctx;F==null||F.closePath();const te=F==null?void 0:F.getImageData(0,0,G.width,G.height);g.saveSignature=E(te)}}g.status=!1},B=()=>{m.close()},Y=()=>{g.ctx&&(r.value?g.ctx.clearRect(0,0,g.ctx.canvas.height,g.ctx.canvas.width):g.ctx.clearRect(0,0,g.ctx.canvas.width,g.ctx.canvas.height),g.saveSignature="")},O=q=>{q.target===u.value&&m.close()},Q=async()=>{if(g.saveSignature!==g.originSignature){const q=da.service({target:a.relatedDom||document.body});await y(m.options.dataKey,g.saveSignature,m.options.isGuardian?465921:345601,m.options.type),q.close(),m.close()}},W=()=>{B()},ne=t.reactive({top:"",left:"",width:"",height:""});return t.onMounted(async()=>{var G;r.value?(ne.top="calc((100vh - 100vw) / 2)",ne.left="calc((100vw - 100vh) / 2)",ne.width="100vh",ne.height="100vw"):a.relatedDom?(ne.top=`${a.relatedDom.offsetTop}px`,ne.left=`${a.relatedDom.offsetLeft}px`,ne.width=`${a.relatedDom.clientWidth}px`,ne.height=`${a.relatedDom.clientHeight}px`):(ne.top="0",ne.left="0",ne.width="100vw",ne.height="100vh");const q=da.service({target:a.relatedDom||document.body});if(c.value&&l.value){const F=c.value,te=F.getContext("2d",{willReadFrequently:!0});g.ctx=te,r.value?t.nextTick(()=>{var ae,R;F.width=((ae=l.value)==null?void 0:ae.clientWidth)||0,F.height=((R=l.value)==null?void 0:R.clientHeight)||0,te.translate(F.width/2,F.height/2),te.rotate(-Math.PI/2),te.translate(-F.height/2,-F.width/2),te.lineWidth=5}):(F.width=l.value.clientWidth,F.height=l.value.clientHeight,te.lineWidth=3),te.lineJoin="round",te.lineCap="round";const he=m.options;if(he.dataKey)if(Rn.get(he.formData,he.dataKey)){const R=((G=m.options)==null?void 0:G.value)||"";if(R){const D=new Image;D.src=R,D.onload=()=>{te.drawImage(D,0,0,D.width,D.height);const z=te==null?void 0:te.getImageData(0,0,F.width,F.height);g.originSignature=E(z),g.saveSignature=g.originSignature}}else g.originSignature="",g.saveSignature=""}else g.originSignature="",g.saveSignature=""}q.close()}),(q,G)=>{const F=yr;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"signatureView",ref:u,class:t.normalizeClass(r.value?"signature_view signature_view_mobile":"signature_view signature_view_ps"),onClick:O},[t.createElementVNode("div",K4,[t.createElementVNode("img",{class:"signature_close",src:ch,onClick:B}),q4,t.createElementVNode("div",{class:"signature_subtitle"},[Q4,t.createElementVNode("div",{class:"signature_clear",onClick:Y},"Clear")]),t.createElementVNode("div",{class:"signature_pad",ref_key:"signatureBox",ref:l},[t.createElementVNode("canvas",{class:"pad",ref_key:"signaturePad",ref:c,onMousedown:G[0]||(G[0]=te=>!r.value&&S(te)),onMouseup:G[1]||(G[1]=te=>!r.value&&T(te)),onMousemoveCapture:G[2]||(G[2]=te=>!r.value&&M(te)),onMouseleave:G[3]||(G[3]=te=>!r.value&&T(te)),onTouchstart:G[4]||(G[4]=te=>S(te)),onTouchend:G[5]||(G[5]=te=>T(te)),onTouchmoveCapture:G[6]||(G[6]=te=>M(te)),onTouchcancel:G[7]||(G[7]=te=>T(te))},null,544),Z4],512),X4,t.createElementVNode("div",J4,[t.createVNode(F,{class:"signature_chioce_button signature_cancel",onClick:W},{default:t.withCtx(()=>[t.createTextVNode("Cancel")]),_:1}),t.createVNode(F,{class:"signature_chioce_button signature_confirm",onClick:Q},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1})])])],2)])}}}),[["__scopeId","data-v-50a3cf13"]]),tM="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20.002'%20viewBox='0%200%2020%2020.002'%3e%3cg%20id='组_22313'%20data-name='组%2022313'%20transform='translate(-106.404%20-80.254)'%3e%3cpath%20id='路径_23519'%20data-name='路径%2023519'%20d='M209.607,82.221a1.53,1.53,0,0,1,2.154.006l1.077,1.077a1.533,1.533,0,0,1,.006,2.154L201.509,96.794h1.079l-4.316-4.316v1.079l11.335-11.335Zm-1.079-1.079L197.193,92.477a.763.763,0,0,0,0,1.079l4.316,4.316a.763.763,0,0,0,1.079,0l11.335-11.335a3.059,3.059,0,0,0-.006-4.312l-1.077-1.077a3.056,3.056,0,0,0-4.312-.006Zm-1.623,2.7,4.316,4.316,1.079-1.079-4.316-4.316L206.9,83.845Z'%20transform='translate(-88.406)'%20fill='%23333'/%3e%3cpath%20id='路径_23520'%20data-name='路径%2023520'%20d='M108.6,583.993l-2.158,6.475a.763.763,0,0,0,.965.965l6.474-2.158a.763.763,0,0,0,.3-1.263l-4.316-4.316a.763.763,0,0,0-1.263.3Zm1.448.483-1.263.3,4.316,4.316.3-1.263-6.474,2.158.965.965,2.158-6.474Z'%20transform='translate(0%20-491.217)'%20fill='%23333'/%3e%3c/g%3e%3c/svg%3e",nM={clearIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMC4yMDEiIHZpZXdCb3g9IjAgMCAyMCAyMC4yMDEiPjxnIGRhdGEtbmFtZT0i57uEIDIyMzYzIj48ZyBkYXRhLW5hbWU9Iue7hCAyMjM2MiIgZmlsbD0iIzMzMyIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9Ii40Ij48cGF0aCBkYXRhLW5hbWU9Iui3r+W+hCAyMzUzNyIgZD0iTTE4LjM4NCAxMC45MDRoLS4zNTd2NS40NDFhMTIuOTUyIDEyLjk1MiAwIDAgMCAuMzU3IDIuOTQzLjcxNi43MTYgMCAwIDEtLjcxNC43MTRIMi4zM2EuNzE2LjcxNiAwIDAgMS0uNzEzLS43MTQgMTIuMTI4IDEyLjEyOCAwIDAgMCAuMzU3LTIuODcydi01LjUxMmgtLjM1N2EuNzE2LjcxNiAwIDAgMS0uNzE0LS43MTRWNi42MjNhLjcxNi43MTYgMCAwIDEgLjcxNC0uNzE0aDYuMDY1VjEuOTg1QTEuNzg5IDEuNzg5IDAgMCAxIDkuNDY2LjIwMWgxLjA3YTEuNzg5IDEuNzg5IDAgMCAxIDEuNzg0IDEuNzg0djMuOTI0aDYuMDY1YS43MTYuNzE2IDAgMCAxIC43MTQuNzE0djMuNTY4YS43MTYuNzE2IDAgMCAxLS43MTQuNzE0em0tMTIuMzEgOC4zODR2LTQuNzI3YS4yNzQuMjc0IDAgMCAxIC4yNjgtLjI2N2guMTc4YS4yNzQuMjc0IDAgMCAxIC4yNjguMjY3djQuNzI3SDkuODJ2LTQuNzI3YS4yNzQuMjc0IDAgMCAxIC4yNj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jU1Ni44Ni44NiAwIDAgMS0uMjc2LjU1NkwxMi44MyA4LjQ2NGMtLjA2OS4xMzktLjIwNy4xMzktLjM0NS4xMzlhLjg0OS44NDkgMCAwIDEtLjU1Mi0uMjc4LjY4Ni42ODYgMCAwIDEgLjIwNy0uOTcybDIuMjc2LTEuNTI4SDYuOWE1LjU1NiA1LjU1NiAwIDAgMCAwIDExLjExMmgxMi40MWEuNjk1LjY5NSAwIDAgMSAwIDEuMzg5SDYuOWE2Ljk0NSA2Ljk0NSAwIDAgMSAwLTEzLjg5eiIgZmlsbD0iI2MxYzFjMSIvPjxwYXRoIGRhdGEtbmFtZT0i55+p5b2iIDIzMTQ5IiBmaWxsPSJub25lIiBkPSJNMCAwaDIwdjIwSDB6Ii8+PC9zdmc+"},Kt=e=>nM[e],rM=e=>(t.pushScopeId("data-v-516516a5"),e=e(),t.popScopeId(),e),oM={class:"image-editor-box"},iM={key:0,class:"image-editor-controler"},aM={key:0,class:"image-editor-no_edit"},sM={key:1,class:"image-editor-editing"},lM={class:"left"},cM=["src"],uM=["src"],fM=["src"],dM=[rM(()=>t.createElementVNode("div",null,"Confirm",-1))],pM=mi(t.defineComponent({__name:"ImageEditor",setup(e){t.useCssVars(R=>({"455fdd5f":v.width,"4cccd4ae":v.height,b366f9a4:v.top,"2340194e":v.left}));const r=t.ref(hi()),a=Is().getImageEditor(),c=Nr().getDocumentTemplate(),u=a.confirm,f=t.ref(null),m=t.ref(null),y=t.ref(null),g=t.reactive({x:0,y:0,width:0,height:0}),w=t.reactive({x:0,y:0}),b=t.reactive({isEditable:!1,clearIcon:Kt("clearDisableIcon"),undoIcon:Kt("undoDisableIcon"),redoIcon:Kt("redoDisableIcon"),ctx:null,isDrawing:!1,color:"#ff0000",stroke:"2",originImg:void 0,index:0,operateList:new Array,redoList:new Array,originImage:"",currentImage:"",saveImage:"",type:"",points:new Array,beginPoint:null}),A=R=>{let[D,z]=[R.offsetLeft,R.offsetTop];const j=se=>{z+=se.offsetTop,D+=se.offsetLeft,se.offsetParent&&j(se.offsetParent)};return R.offsetParent&&j(R.offsetParent),{left:D,top:z}},E=R=>{let{left:D,top:z}=R.getBoundingClientRect();return{left:D,top:z}},S=({i_width:R,i_height:D,c_width:z,c_height:j})=>{const se=R/D,me=z/j;switch(!0){case se>me:R=z,D=R/se;break;case se<me:D=j,R=D*se;break;case se==me:R=z,D=j;break}return{width:R,height:D}},v=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{let R=a.options.src;const D=R.split(/[:;]/);if(D.length===3?b.type=D[1]:b.type="image/png",r.value?(v.top="0",v.left="0",v.width="100vw",v.height="100vh"):c.relatedDom?(v.top=`${c.relatedDom.offsetTop}px`,v.left=`${c.relatedDom.offsetLeft}px`,v.width=`${c.relatedDom.clientWidth}px`,v.height=`${c.relatedDom.clientHeight}px`):(v.top="0",v.left="0",v.width="100vw",v.height="100vh"),f.value&&y.value){const z=f.value,j=z.getContext("2d",{willReadFrequently:!0});b.ctx=j,z.width=y.value.clientWidth,z.height=y.value.clientHeight;const se=z.width,me=z.height,de=new Image;de.src=R,de.onload=()=>{j.clearRect(0,0,z.width,z.height);const we=de.width,ke=de.height,Se=S({i_width:we,i_height:ke,c_width:se,c_height:me});g.width=Se.width,g.height=Se.height,z.width=g.width,z.height=g.height,g.x=(z.width-g.width)/2,g.y=(z.height-g.height)/2,j==null||j.drawImage(de,g.x,g.y,g.width,g.height);const ce=j==null?void 0:j.getImageData(0,0,z.width,z.height);ce&&(b.originImg=ce,b.operateList.push(ce),b.originImage=O(ce),b.currentImage=b.originImage,b.saveImage=b.originImage)}}});const M=async()=>{if(b.saveImage!==b.originImage){const R=da.service({target:c.relatedDom||document.body});await u(a.options.dataKey,b.saveImage,b.type),R.close()}a.close()},T=R=>{R.target===m.value&&a.close()},B=()=>{b.operateList[b.index]!==b.originImg?b.clearIcon=Kt("clearIcon"):b.clearIcon=Kt("clearDisableIcon"),b.index>0?b.undoIcon=Kt("undoIcon"):b.undoIcon=Kt("undoDisableIcon"),b.redoList.length>0?b.redoIcon=Kt("redoIcon"):b.redoIcon=Kt("redoDisableIcon")},Y=()=>{var D;const R=(D=b.ctx)==null?void 0:D.getImageData(g.x,g.y,g.width,g.height);b.currentImage=O(R),B()},O=R=>{const D=document.createElement("canvas");D.width=R.width,D.height=R.height;const z=D.getContext("2d");return z==null||z.putImageData(R,0,0),D.toDataURL().split(",")[1]},Q=R=>{if(f.value){R.preventDefault(),R.stopPropagation();const D=b.ctx;if(D.strokeStyle=b.color,D.lineWidth=parseInt(b.stroke),b.isDrawing=!0,r.value){const{left:z,top:j}=E(f.value);R=R,w.x=R.targetTouches[0].clientX-z,w.y=R.targetTouches[0].clientY-j,b.points.push({x:w.x,y:w.y})}else{const{left:z,top:j}=A(f.value);R=R,w.x=R.clientX-z,w.y=R.clientY-j,b.points.push({x:w.x,y:w.y})}}},W=(R,D,z)=>{const j=b.ctx;j.beginPath(),j.moveTo(R.x,R.y),j.quadraticCurveTo(D.x,D.y,z.x,z.y),j.stroke(),j.closePath()},ne=R=>{var D;if(f.value&&(R.preventDefault(),R.stopPropagation(),f.value.style.cursor="auto",b.isDrawing)){if(r.value){const{left:se,top:me}=E(f.value);R=R;const de=R.changedTouches[0].clientX-se,we=R.changedTouches[0].clientY-me;b.points.push({x:de,y:we})}else{const{left:se,top:me}=A(f.value);R=R;const de=R.clientX-se,we=R.clientY-me;b.points.push({x:de,y:we})}if(b.points.length>3){const se=b.points.slice(-2),me=se[0],de=se[1];b.beginPoint&&W(b.beginPoint,me,de)}b.beginPoint=null,b.points=[];const z=b.ctx;z==null||z.closePath();const j=(D=b.ctx)==null?void 0:D.getImageData(g.x,g.y,g.width,g.height);b.operateList.push(j),b.redoList=new Array,b.index++}b.isDrawing=!1,Y()},q=R=>{if(f.value&&(R.preventDefault(),R.stopPropagation(),b.isDrawing)){if(r.value){const{left:D,top:z}=E(f.value);R=R;const j=R.targetTouches[0].clientX-D,se=R.targetTouches[0].clientY-z;b.points.push({x:j,y:se})}else{const{left:D,top:z}=A(f.value);R=R;const j=R.clientX-D,se=R.clientY-z;b.points.push({x:j,y:se})}if(b.points.length>3){const D=b.points.slice(-2),z=D[0],j={x:(D[0].x+D[1].x)/2,y:(D[0].y+D[1].y)/2};b.beginPoint&&W(b.beginPoint,z,j),b.beginPoint=j}}},G=()=>{if(f.value){const R=f.value;r.value?(R.addEventListener("touchstart",Q),R.addEventListener("touchend",ne),R.addEventListener("touchcancel",ne),R.addEventListener("touchmove",q)):(R.addEventListener("mousedown",Q),R.addEventListener("mouseup",ne),R.addEventListener("mouseleave",ne),R.addEventListener("mousemove",q)),b.isEditable=!0}},F=()=>{if(f.value){const R=f.value;R.removeEventListener("mousedown",Q),R.removeEventListener("mouseup",ne),R.removeEventListener("mouseleave",ne),R.removeEventListener("mousemove",q),b.isEditable=!1,b.saveImage=b.currentImage}},te=()=>{const R=b.ctx;R&&b.originImg&&(b.index++,b.operateList.push(b.originImg),b.redoList=new Array,R.putImageData(b.originImg,g.x,g.y),Y())},he=()=>{var D;const R=b.operateList.pop();b.redoList.push(R),b.index--,b.redoIcon=Kt("redoIcon"),(D=b.ctx)==null||D.putImageData(b.operateList[b.index],g.x,g.y),Y()},ae=()=>{var D;const R=b.redoList.pop();b.operateList.push(R),b.index++,(D=b.ctx)==null||D.putImageData(R,g.x,g.y),Y()};return(R,D)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{ref_key:"editorView",ref:m,class:t.normalizeClass(r.value?"image-editor-view image-editor-view-mobile":"image-editor-view image-editor-view-ps"),onClick:T},[t.createElementVNode("div",oM,[t.createElementVNode("img",{class:"image-editor-close_icon",src:ih,onClick:M}),t.createElementVNode("div",{ref_key:"editorBox",ref:y,class:"image-editor-console-box"},[t.createElementVNode("canvas",{class:"image-editor-console",ref_key:"editorDom",ref:f},null,512)],512),t.unref(a).options.markable?(t.openBlock(),t.createElementBlock("div",iM,[b.isEditable?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",aM,[t.createElementVNode("img",{src:tM,class:"image-editor-editImg",onClick:G})])),b.isEditable?(t.openBlock(),t.createElementBlock("div",sM,[t.createElementVNode("div",lM,[t.withDirectives(t.createElementVNode("input",{class:"image-editor-color",type:"color","onUpdate:modelValue":D[0]||(D[0]=z=>b.color=z)},null,512),[[t.vModelText,b.color]]),t.withDirectives(t.createElementVNode("input",{class:"image-editor-stroke",type:"range",min:"1",max:"15","onUpdate:modelValue":D[1]||(D[1]=z=>b.stroke=z)},null,512),[[t.vModelText,b.stroke]]),t.createElementVNode("img",{class:"image-editor-clear",src:b.clearIcon,onClick:D[2]||(D[2]=z=>b.clearIcon==t.unref(Kt)("clearIcon")&&te())},null,8,cM),t.createElementVNode("img",{class:"image-editor-undo",src:b.undoIcon,onClick:D[3]||(D[3]=z=>b.undoIcon==t.unref(Kt)("undoIcon")&&he())},null,8,uM),t.createElementVNode("img",{class:"image-editor-redo",src:b.redoIcon,onClick:D[4]||(D[4]=z=>b.redoIcon==t.unref(Kt)("redoIcon")&&ae())},null,8,fM)]),t.createElementVNode("div",{class:"right"},[t.createElementVNode("div",{class:"image-editor-comfirm",onClick:F},dM)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],2)]))}}),[["__scopeId","data-v-516516a5"]]),hM="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='6'%20height='6'%20viewBox='0%200%206%206'%3e%3ccircle%20id='椭圆_711'%20data-name='椭圆%20711'%20cx='3'%20cy='3'%20r='3'%20fill='%23005795'/%3e%3c/svg%3e",uh=e=>(t.pushScopeId("data-v-5ee3d8d8"),e=e(),t.popScopeId(),e),mM={class:"recommend-diagnoses"},gM=uh(()=>t.createElementVNode("div",{class:"header"},null,-1)),yM=uh(()=>t.createElementVNode("div",{class:"recommend-diagnoses-title"},[t.createElementVNode("img",{class:"recommend-diagnoses-title_icon",src:hM}),t.createElementVNode("span",{class:"recommend-diagnoses-title_text"},"Recommend Diagnoses")],-1)),bM={class:"recommend-diagnoses-list"},wM={class:"recommend-diagnoses-item"},EM={class:"recommend-diagnoses-item-code"},CM={class:"recommend-diagnosis-item-comment"},SM={class:"recommend-diagnoses-confirm"},xM=mi(t.defineComponent({__name:"RecommendDiagnosis",setup(e){t.useCssVars(T=>({"67c4d826":E.width,c4742040:E.height,"6282853c":E.top,"246b4e00":E.left}));const r=t.ref(hi()),a=Nr().getDocumentTemplate(),l=a.ecos,c=a.info,f=Ms().getRecommendDiagnosis(),m=t.reactive([]),y=t.reactive(f.options.formData),g=t.ref(!1),w=t.ref(null),b=f.cache;let A="";const E=t.reactive({top:"",left:"",width:"",height:""});t.onMounted(async()=>{const B=Nr().getDocumentTemplate();B.relatedDom?(E.top=`${B.relatedDom.offsetTop}px`,E.left=`${B.relatedDom.offsetLeft}px`,E.width=`${B.relatedDom.clientWidth}px`,E.height=`${B.relatedDom.clientHeight}px`):(E.top="0",E.left="0",E.width="100vw",E.height="100vh");const Y=da.service({target:B.relatedDom||document.body}),O=y.Diagnosis,Q=new Set(O.map(q=>q.code));let W=[];if(b.hasCache)W=b.list;else{const q=await l.retrieveDocument({idList:[c.facilityId,...c.locationIds,c.patientId],options:{ObjType:28,sfname:'{"result":"D.*", "join": "INNER JOIN Edge E on E.id=D.reid INNER JOIN Edge E2 on E.refid=E2.id"}',xfname:"(E.bvid,E2.Bvid) | (E.evid,E2.Bvid)",scondition:"E.type=40000 AND E.subtype&0xff=6 AND E2.type=40000 AND E2.subtype&0xff in(1,9) AND D.type=186881",asc:!1,obfname:"D.ctime",maxcount:100}});if(q.code===0){let G=[];q.document.forEach(F=>{const te=F.name.data.diagnosis.descriptiveList;G=G.concat(te)}),b.hasCache=!0,b.list=Rn.cloneDeep(G),W=G}else b.hasCache=!0,b.list=[],W=[]}W.forEach(q=>{Q.has(q.code)?q.isChecked=!0:q.isChecked=!1});let ne=new Set;W=W.filter(q=>ne.has(q.code)?!1:(ne.add(q.code),!0)),W.forEach(q=>{q.isChecked?A+="1":A+="0",m.push(q)}),Y.close()}),t.watch(m,()=>{let T="";m.forEach(B=>{B.isChecked?T+="1":T+="0"}),g.value=A!==T});const S=()=>{f.close()},v=T=>{T.target===w.value&&f.close()},M=async()=>{};return(T,B)=>{const Y=sp,O=yr;return t.openBlock(),t.createElementBlock("div",{ref_key:"diagnosisView",ref:w,class:t.normalizeClass(r.value?"recommend-diagnoses-view recommend-diagnoses-mobile":"recommend-diagnoses-view"),onClick:v},[t.createElementVNode("div",mM,[gM,t.createElementVNode("div",{class:"recommend-diagnoses-close"},[t.createElementVNode("img",{class:"recommend-diagnoses-close_icon",src:ch,onClick:S})]),yM,t.createElementVNode("div",bM,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,Q=>(t.openBlock(),t.createElementBlock("div",wM,[t.createElementVNode("div",EM,[t.createVNode(Y,{modelValue:Q.isChecked,"onUpdate:modelValue":W=>Q.isChecked=W},null,8,["modelValue","onUpdate:modelValue"]),t.createTextVNode(" "+t.toDisplayString(Q.code)+" - "+t.toDisplayString(Q.description),1)]),t.createElementVNode("div",CM,t.toDisplayString(Q.comment),1)]))),256))]),t.createElementVNode("div",SM,[t.createVNode(O,{class:t.normalizeClass(`
77
77
  recommend-diagnoses-button
78
78
  ${g.value?"recommend-diagnoses-button-able":"recommend-diagnoses-button-disable"}
79
79
  `),onClick:M},{default:t.withCtx(()=>[t.createTextVNode("Confirm")]),_:1},8,["class"])])])],2)}}}),[["__scopeId","data-v-5ee3d8d8"]]),fh=t.defineComponent({__name:"DocumentTemplate",props:{json:{type:Array,required:!0,default:{}},formData:{type:Object,require:!0,default:{}},isEditable:{type:Boolean,default:!0,required:!0}},setup(e){const o=Nr().getDocumentTemplate(),l=xs().getCalendarPciker(),u=_s().getSignaturePad(),m=Is().getImageEditor(),g=Ms().getRecommendDiagnosis(),w=e,b=w.formData,A=w.json,E=w.isEditable,S=o.ecos,v=o.role,M=o.docType,T=o.info;u.confirm=async(q,G,F=345601,te)=>{var me,de,we,ke,Se,ce;const ae=lh(G,"image/png");let R="",D="",z="",j="";if(te===bn.provider){R=((me=T.providerSignatureInfo)==null?void 0:me.eid)||"",z=((de=T.providerSignatureInfo)==null?void 0:de.fid)||"",D=Rn.get(b,q);const ue=await S.retrieveDocument({idList:[D]});ue.code===0&&ue.document.length&&(j=ue.document[0].name.title),await S.createEdge({bvid:(we=T.providerSignatureInfo)==null?void 0:we.vid,type:1030})}else te===bn.patient&&(R=((ke=T.patientSignatureInfo)==null?void 0:ke.eid)||"",z=((Se=T.patientSignatureInfo)==null?void 0:Se.fid)||"",await S.createEdge({bvid:(ce=T.patientSignatureInfo)==null?void 0:ce.vid,type:1030}));const se=await S.createDocument({atimes:-10,id:D,eid:R,type:F,name:{data:ae,title:j}});if(se.code===0){const ue=se.document;Rn.set(b,q,ue.id),te===bn.provider?(await S.createEdge({bvid:z,type:1030}),B.otherData.providerSignature=await W(ue.id)):te===bn.patient&&(B.otherData.patientSignature=await W(ue.id))}},m.confirm=async(q,G,F)=>{const te=lh(G,F),he=await S.createDocument({atimes:-10,eid:T.rootNotebookID,type:430081,name:{data:te,type:F},subtype:{isEditable:!0}});if(he.code===0){const ae=he.document;Rn.set(b,q,ae.id)}};const B=t.reactive({formData:b,json:A,isEditable:E,role:v,docType:M,otherData:{providerSignature:"",patientSignature:""},otherTableInfo:{}});P0(B.formData);const Y=t.ref(B.role.toString()===B.docType.toString()),O=t.ref(B.role===bn.provider),Q=t.ref(B.role===bn.patient),W=async q=>{if(S){const G=await S.retrieveDocument({idList:[q]});if(G.code===0&&G.document.length>0){const F=G.document[0];return H4({type:F.name.type,data:F.name.data})}else return""}else return""},ne=(q,G)=>{const F=new Array,te=he=>{if(vl.isArray(he))he.forEach(ae=>{te(ae)});else if(vl.isObject(he)&&"type"in he){switch(he.type){case"atblock":case"sharpblock":case"table":case"image":break;case"paragraph":default:te(he.children)}he.type===G&&F.push(he)}};return te(q),F};return t.onBeforeMount(()=>{ne(B.json,"image").forEach(async F=>{B.otherData[F.alt]=await W(B.formData[F.alt]),t.watch(()=>B.formData[F.alt],async te=>{B.otherData[F.alt]=await W(te)})}),ne(B.json,"table").forEach(F=>{const he=(F.width==="auto"?F.width:Cp.fullWidth)==="auto"?0:100,ae=new Array,R=F.children[0].children;if(B.otherTableInfo[F.key]={tableWidthArray:new Array,flexShrinks:new Array},R.forEach(D=>{he===0?ae.push(D!=null&&D.width&&(D==null?void 0:D.width)!=="auto"?parseFloat(D.width):30):ae.push(D!=null&&D.width&&(D==null?void 0:D.width)!=="auto"?parseFloat(D.width):Math.floor(1e4/R.length)/100)}),he===0){let D=0;ae.forEach(z=>{D+=z}),ae.forEach((z,j)=>{z===30?(B.otherTableInfo[F.key].tableWidthArray[j]=`${b.atrribute.noodl_font.tableMinWidth}`,B.otherTableInfo[F.key].flexShrinks[j]=0):(B.otherTableInfo[F.key].tableWidthArray[j]=`${100*Math.floor(100*z/D)/100}%`,B.otherTableInfo[F.key].flexShrinks[j]=1)})}else{let D=0,z=1;ae.forEach(j=>{j===Math.floor(1e4/R.length)/100?z-=j/100:D+=j}),ae.forEach((j,se)=>{j===Math.floor(1e4/R.length)/100?(B.otherTableInfo[F.key].tableWidthArray[se]=`calc(${j}%)`,B.otherTableInfo[F.key].flexShrinks[se]=0):(B.otherTableInfo[F.key].tableWidthArray[se]=`calc(${Math.floor(1e4*z*j/D)/100}%)`,B.otherTableInfo[F.key].flexShrinks[se]=1)})}}),vl.isArray(B.formData.Diagnosis)||(B.formData.Diagnosis=[])}),t.onMounted(async()=>{B.otherData.providerSignature=await W(B.formData.signatureId),B.otherData.patientSignature=await W(B.formData.patdSignatureId)}),(q,G)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(Gl,{node:t.unref(A),formData:t.unref(b),isEditable:B.isEditable&&Y.value,providerEditability:B.isEditable&&O.value,patientEditability:B.isEditable&&Q.value,otherData:B.otherData,otherTableInfo:B.otherTableInfo},null,8,["node","formData","isEditable","providerEditability","patientEditability","otherData","otherTableInfo"]),t.unref(l).status?(t.openBlock(),t.createBlock(O4,{key:0})):t.createCommentVNode("",!0),t.unref(u).status?(t.openBlock(),t.createBlock(eM,{key:1})):t.createCommentVNode("",!0),t.unref(m).status?(t.openBlock(),t.createBlock(pM,{key:2})):t.createCommentVNode("",!0),t.unref(g).status?(t.openBlock(),t.createBlock(xM,{key:3})):t.createCommentVNode("",!0)]))}}),_M=vn.createPinia(),dh=e=>{e.use(_M),e.component("DocumentTemplate",fh)},IM={install:dh};yt.DocumentTemplate=fh,yt.aitmedTemplateRole=bn,yt.aitmedTemplateType=mu,yt.default=IM,yt.install=dh,yt.useDocumentTemplateStore=Nr,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});