watermark-js-plus 1.6.4 → 1.6.6
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.
- package/dist/es/src/core/blind-decode.js +16 -0
- package/dist/es/src/core/blind.js +9 -5
- package/dist/es/src/core/watermark.js +49 -46
- package/dist/ie/es/src/compat/ie/blind-decode.js +155 -0
- package/dist/ie/es/src/core/blind-decode.js +28 -0
- package/dist/ie/es/src/core/blind.js +9 -5
- package/dist/ie/es/src/core/watermark.js +49 -46
- package/dist/ie/es/src/index.ie.js +4 -0
- package/dist/ie/index.cjs.js +241 -52
- package/dist/ie/index.cjs.js.map +1 -1
- package/dist/ie/index.cjs.min.js +1 -1
- package/dist/ie/index.esm.js +241 -52
- package/dist/ie/index.esm.js.map +1 -1
- package/dist/ie/index.esm.min.js +1 -1
- package/dist/ie/index.iife.js +241 -52
- package/dist/ie/index.iife.js.map +1 -1
- package/dist/ie/index.iife.min.js +1 -1
- package/dist/ie/index.umd.js +241 -52
- package/dist/ie/index.umd.js.map +1 -1
- package/dist/ie/index.umd.min.js +1 -1
- package/dist/index.cjs.js +73 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.esm.js +73 -52
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.iife.js +73 -52
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.umd.js +73 -52
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/types/compat/ie/blind-decode.d.ts +3 -0
- package/dist/types/core/blind-decode.d.ts +15 -0
- package/dist/types/core/watermark.d.ts +3 -2
- package/package.json +20 -20
package/dist/ie/index.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WatermarkPlus={})}(this,function(t){"use strict";var e,n,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={};function o(){if(n)return e;n=1;var t=function(t){return t&&t.Math===Math&&t};return e=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")()}var a,s,u,c,l,d,f,h,p={};function v(){return s?a:(s=1,a=function(t){try{return!!t()}catch(t){return!0}})}function y(){if(c)return u;c=1;var t=v();return u=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function m(){if(d)return l;d=1;var t=v();return l=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function g(){if(h)return f;h=1;var t=m(),e=Function.prototype.call;return f=t?e.bind(e):function(){return e.apply(e,arguments)},f}var w,b,x,S,O,P,E,T,k,C,A,j,_,R,L,D,I,B,H,N,U,M,F,W,z,G,q,V,X,Y,$,J,K,Z,Q,tt,et,nt,rt,it,ot,at={};function st(){return x?b:(x=1,b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function ut(){if(O)return S;O=1;var t=m(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return S=t?r:function(t){return function(){return n.apply(t,arguments)}},S}function ct(){if(E)return P;E=1;var t=ut(),e=t({}.toString),n=t("".slice);return P=function(t){return n(e(t),8,-1)}}function lt(){return A?C:(A=1,C=function(t){return null==t})}function dt(){if(_)return j;_=1;var t=lt(),e=TypeError;return j=function(n){if(t(n))throw new e("Can't call method on "+n);return n}}function ft(){if(L)return R;L=1;var t=function(){if(k)return T;k=1;var t=ut(),e=v(),n=ct(),r=Object,i=t("".split);return T=e(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?i(t,""):r(t)}:r}(),e=dt();return R=function(n){return t(e(n))}}function ht(){if(I)return D;I=1;var t="object"==typeof document&&document.all;return D=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}function pt(){if(H)return B;H=1;var t=ht();return B=function(e){return"object"==typeof e?null!==e:t(e)}}function vt(){if(U)return N;U=1;var t=o(),e=ht();return N=function(n,r){return arguments.length<2?(i=t[n],e(i)?i:void 0):t[n]&&t[n][r];var i},N}function yt(){if(F)return M;F=1;var t=ut();return M=t({}.isPrototypeOf)}function mt(){if(z)return W;z=1;var t=o().navigator,e=t&&t.userAgent;return W=e?String(e):""}function gt(){if(q)return G;q=1;var t,e,n=o(),r=mt(),i=n.process,a=n.Deno,s=i&&i.versions||a&&a.version,u=s&&s.v8;return u&&(e=(t=u.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(e=+t[1]),G=e}function wt(){if(X)return V;X=1;var t=gt(),e=v(),n=o().String;return V=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function bt(){if($)return Y;$=1;var t=wt();return Y=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function xt(){if(K)return J;K=1;var t=vt(),e=ht(),n=yt(),r=bt(),i=Object;return J=r?function(t){return"symbol"==typeof t}:function(r){var o=t("Symbol");return e(o)&&n(o.prototype,i(r))}}function St(){if(Q)return Z;Q=1;var t=String;return Z=function(e){try{return t(e)}catch(t){return"Object"}}}function Ot(){if(et)return tt;et=1;var t=ht(),e=St(),n=TypeError;return tt=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")}}function Pt(){if(rt)return nt;rt=1;var t=Ot(),e=lt();return nt=function(n,r){var i=n[r];return e(i)?void 0:t(i)}}function Et(){if(ot)return it;ot=1;var t=g(),e=ht(),n=pt(),r=TypeError;return it=function(i,o){var a,s;if("string"===o&&e(a=i.toString)&&!n(s=t(a,i)))return s;if(e(a=i.valueOf)&&!n(s=t(a,i)))return s;if("string"!==o&&e(a=i.toString)&&!n(s=t(a,i)))return s;throw new r("Can't convert object to primitive value")}}var Tt,kt,Ct,At,jt,_t,Rt,Lt,Dt,It,Bt,Ht,Nt,Ut,Mt,Ft,Wt,zt,Gt,qt,Vt,Xt,Yt,$t,Jt={exports:{}};function Kt(){return kt?Tt:(kt=1,Tt=!1)}function Zt(){if(At)return Ct;At=1;var t=o(),e=Object.defineProperty;return Ct=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch(e){t[n]=r}return r}}function Qt(){if(jt)return Jt.exports;jt=1;var t=Kt(),e=o(),n=Zt(),r="__core-js_shared__",i=Jt.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.49.0",mode:t?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Jt.exports}function te(){if(Rt)return _t;Rt=1;var t=Qt();return _t=function(e,n){return t[e]||(t[e]=n||{})}}function ee(){if(Dt)return Lt;Dt=1;var t=dt(),e=Object;return Lt=function(n){return e(t(n))}}function ne(){if(Bt)return It;Bt=1;var t=ut(),e=ee(),n=t({}.hasOwnProperty);return It=Object.hasOwn||function(t,r){return n(e(t),r)}}function re(){if(Nt)return Ht;Nt=1;var t=ut(),e=0,n=Math.random(),r=t(1.1.toString);return Ht=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++e+n,36)}}function ie(){if(Mt)return Ut;Mt=1;var t=o(),e=te(),n=ne(),r=re(),i=wt(),a=bt(),s=t.Symbol,u=e("wks"),c=a?s.for||s:s&&s.withoutSetter||r;return Ut=function(t){return n(u,t)||(u[t]=i&&n(s,t)?s[t]:c("Symbol."+t)),u[t]}}function oe(){if(Wt)return Ft;Wt=1;var t=g(),e=pt(),n=xt(),r=Pt(),i=Et(),o=ie(),a=TypeError,s=o("toPrimitive");return Ft=function(o,u){if(!e(o)||n(o))return o;var c,l=r(o,s);if(l){if(void 0===u&&(u="default"),c=t(l,o,u),!e(c)||n(c))return c;throw new a("Can't convert object to primitive value")}return void 0===u&&(u="number"),i(o,u)}}function ae(){if(Gt)return zt;Gt=1;var t=oe(),e=xt();return zt=function(n){var r=t(n,"string");return e(r)?r:r+""}}function se(){if(Vt)return qt;Vt=1;var t=o(),e=pt(),n=t.document,r=e(n)&&e(n.createElement);return qt=function(t){return r?n.createElement(t):{}}}function ue(){if(Yt)return Xt;Yt=1;var t=y(),e=v(),n=se();return Xt=!t&&!e(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function ce(){if($t)return p;$t=1;var t=y(),e=g(),n=function(){if(w)return at;w=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return at.f=n?function(t){var n=e(this,t);return!!n&&n.enumerable}:t,at}(),r=st(),i=ft(),o=ae(),a=ne(),s=ue(),u=Object.getOwnPropertyDescriptor;return p.f=t?u:function(t,c){if(t=i(t),c=o(c),s)try{return u(t,c)}catch(t){}if(a(t,c))return r(!e(n.f,t,c),t[c])},p}var le,de,fe,he,pe,ve,ye,me={};function ge(){if(de)return le;de=1;var t=y(),e=v();return le=t&&e(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function we(){if(he)return fe;he=1;var t=pt(),e=String,n=TypeError;return fe=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")}}function be(){if(pe)return me;pe=1;var t=y(),e=ue(),n=ge(),r=we(),i=ae(),o=TypeError,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return me.f=t?n?function(t,e,n){if(r(t),e=i(e),r(n),"function"==typeof t&&"prototype"===e&&"value"in n&&l in n&&!n[l]){var o=s(t,e);o&&o[l]&&(t[e]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:u in n?n[u]:o[u],writable:!1})}return a(t,e,n)}:a:function(t,n,s){if(r(t),n=i(n),r(s),e)try{return a(t,n,s)}catch(t){}if("get"in s||"set"in s)throw new o("Accessors not supported");return"value"in s&&(t[n]=s.value),t},me}function xe(){if(ye)return ve;ye=1;var t=y(),e=be(),n=st();return ve=t?function(t,r,i){return e.f(t,r,n(1,i))}:function(t,e,n){return t[e]=n,t}}var Se,Oe,Pe,Ee,Te,ke,Ce,Ae,je,_e,Re,Le,De,Ie,Be,He={exports:{}};function Ne(){if(Ee)return Pe;Ee=1;var t=ut(),e=ht(),n=Qt(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(t){return r(t)}),Pe=n.inspectSource}function Ue(){if(Ae)return Ce;Ae=1;var t=te(),e=re(),n=t("keys");return Ce=function(t){return n[t]||(n[t]=e(t))}}function Me(){return _e?je:(_e=1,je={})}function Fe(){if(Le)return Re;Le=1;var t,e,n,r=function(){if(ke)return Te;ke=1;var t=o(),e=ht(),n=t.WeakMap;return Te=e(n)&&/native code/.test(String(n))}(),i=o(),a=pt(),s=xe(),u=ne(),c=Qt(),l=Ue(),d=Me(),f="Object already initialized",h=i.TypeError,p=i.WeakMap;if(r||c.state){var v=c.state||(c.state=new p);v.get=v.get,v.has=v.has,v.set=v.set,t=function(t,e){if(v.has(t))throw new h(f);return e.facade=t,v.set(t,e),e},e=function(t){return v.get(t)||{}},n=function(t){return v.has(t)}}else{var y=l("state");d[y]=!0,t=function(t,e){if(u(t,y))throw new h(f);return e.facade=t,s(t,y,e),e},e=function(t){return u(t,y)?t[y]:{}},n=function(t){return u(t,y)}}return Re={set:t,get:e,has:n,enforce:function(r){return n(r)?e(r):t(r,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=e(n)).type!==t)throw new h("Incompatible receiver, "+t+" required");return r}}}}function We(){if(De)return He.exports;De=1;var t=ut(),e=v(),n=ht(),r=ne(),i=y(),o=function(){if(Oe)return Se;Oe=1;var t=y(),e=ne(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&"something"===function(){}.name,a=i&&(!t||t&&r(n,"name").configurable);return Se={EXISTS:i,PROPER:o,CONFIGURABLE:a}}().CONFIGURABLE,a=Ne(),s=Fe(),u=s.enforce,c=s.get,l=String,d=Object.defineProperty,f=t("".slice),h=t("".replace),p=t([].join),m=i&&!e(function(){return 8!==d(function(){},"length",{value:8}).length}),g=String(String).split("String"),w=He.exports=function(t,e,n){"Symbol("===f(l(e),0,7)&&(e="["+h(l(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!r(t,"name")||o&&t.name!==e)&&(i?d(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&r(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var a=u(t);return r(a,"source")||(a.source=p(g,"string"==typeof e?e:"")),t};return Function.prototype.toString=w(function(){return n(this)&&c(this).source||a(this)},"toString"),He.exports}function ze(){if(Be)return Ie;Be=1;var t=ht(),e=be(),n=We(),r=Zt();return Ie=function(i,o,a,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:o;if(t(a)&&n(a,c,s),s.global)u?i[o]=a:r(o,a);else{try{s.unsafe?i[o]&&(u=!0):delete i[o]}catch(t){}u?i[o]=a:e.f(i,o,{value:a,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return i}}var Ge,qe,Ve,Xe,Ye,$e,Je,Ke,Ze,Qe,tn,en,nn,rn,on,an,sn,un={};function cn(){if(Xe)return Ve;Xe=1;var t=function(){if(qe)return Ge;qe=1;var t=Math.ceil,e=Math.floor;return Ge=Math.trunc||function(n){var r=+n;return(r>0?e:t)(r)}}();return Ve=function(e){var n=+e;return n!=n||0===n?0:t(n)}}function ln(){if($e)return Ye;$e=1;var t=cn(),e=Math.max,n=Math.min;return Ye=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)}}function dn(){if(Ke)return Je;Ke=1;var t=cn(),e=Math.min;return Je=function(n){var r=t(n);return r>0?e(r,9007199254740991):0}}function fn(){if(Qe)return Ze;Qe=1;var t=dn();return Ze=function(e){return t(e.length)}}function hn(){if(en)return tn;en=1;var t=ft(),e=ln(),n=fn(),r=function(r){return function(i,o,a){var s=t(i),u=n(s);if(0===u)return!r&&-1;var c,l=e(a,u);if(r&&o!=o){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((r||l in s)&&s[l]===o)return r||l||0;return!r&&-1}};return tn={includes:r(!0),indexOf:r(!1)}}function pn(){if(rn)return nn;rn=1;var t=ut(),e=ne(),n=ft(),r=hn().indexOf,i=Me(),o=t([].push);return nn=function(t,a){var s,u=n(t),c=0,l=[];for(s in u)!e(i,s)&&e(u,s)&&o(l,s);for(;a.length>c;)e(u,s=a[c++])&&(~r(l,s)||o(l,s));return l}}function vn(){return an?on:(an=1,on=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var yn,mn,gn,wn,bn,xn,Sn,On,Pn,En,Tn,kn,Cn,An,jn,_n,Rn,Ln,Dn,In,Bn,Hn,Nn,Un,Mn,Fn,Wn,zn,Gn,qn,Vn,Xn,Yn,$n,Jn,Kn,Zn,Qn,tr,er,nr,rr,ir={};function or(){if(gn)return mn;gn=1;var t=vt(),e=ut(),n=function(){if(sn)return un;sn=1;var t=pn(),e=vn().concat("length","prototype");return un.f=Object.getOwnPropertyNames||function(n){return t(n,e)},un}(),r=(yn||(yn=1,ir.f=Object.getOwnPropertySymbols),ir),i=we(),o=e([].concat);return mn=t("Reflect","ownKeys")||function(t){var e=n.f(i(t)),a=r.f;return a?o(e,a(t)):e}}function ar(){if(bn)return wn;bn=1;var t=ne(),e=or(),n=ce(),r=be();return wn=function(i,o,a){for(var s=e(o),u=r.f,c=n.f,l=0;l<s.length;l++){var d=s[l];t(i,d)||a&&t(a,d)||u(i,d,c(o,d))}}}function sr(){if(Sn)return xn;Sn=1;var t=v(),e=ht(),n=/#|\.prototype\./,r=function(n,r){var u=o[i(n)];return u===s||u!==a&&(e(r)?t(r):!!r)},i=r.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return xn=r}function ur(){if(Pn)return On;Pn=1;var t=o(),e=ce().f,n=xe(),r=ze(),i=Zt(),a=ar(),s=sr();return On=function(o,u){var c,l,d,f,h,p=o.target,v=o.global,y=o.stat;if(c=v?t:y?t[p]||i(p,{}):t[p]&&t[p].prototype)for(l in u){if(f=u[l],d=o.dontCallGetSet?(h=e(c,l))&&h.value:c[l],!s(v?l:p+(y?".":"#")+l,o.forced)&&void 0!==d){if(typeof f==typeof d)continue;a(f,d)}(o.sham||d&&d.sham)&&n(f,"sham",!0),r(c,l,f,o)}}}function cr(){if(Cn)return kn;Cn=1;var t=function(){if(Tn)return En;Tn=1;var t=ct(),e=ut();return En=function(n){if("Function"===t(n))return e(n)}}(),e=Ot(),n=m(),r=t(t.bind);return kn=function(t,i){return e(t),void 0===i?t:n?r(t,i):function(){return t.apply(i,arguments)}},kn}function lr(){if(jn)return An;jn=1;var t=g(),e=we(),n=Pt();return An=function(r,i,o){var a,s;e(r);try{if(!(a=n(r,"return"))){if("throw"===i)throw o;return o}a=t(a,r)}catch(t){s=!0,a=t}if("throw"===i)throw o;if(s)throw a;return e(a),o}}function dr(){if(Rn)return _n;Rn=1;var t=we(),e=lr();return _n=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(t){e(n,"throw",t)}}}function fr(){return Dn?Ln:(Dn=1,Ln={})}function hr(){if(Bn)return In;Bn=1;var t=ie(),e=fr(),n=t("iterator"),r=Array.prototype;return In=function(t){return void 0!==t&&(e.Array===t||r[n]===t)}}function pr(){if(Mn)return Un;Mn=1;var t=function(){if(Nn)return Hn;Nn=1;var t={};return t[ie()("toStringTag")]="z",Hn="[object z]"===String(t)}(),e=ht(),n=ct(),r=ie()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Un=t?n:function(t){var a,s,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(s=function(t,e){try{return t[e]}catch(t){}}(a=i(t),r))?s:o?n(a):"Object"===(u=n(a))&&e(a.callee)?"Arguments":u}}function vr(){if(Wn)return Fn;Wn=1;var t=ut(),e=v(),n=ht(),r=pr(),i=vt(),o=Ne(),a=function(){},s=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=t(u.exec),l=!u.test(a),d=function(t){if(!n(t))return!1;try{return s(a,[],t),!0}catch(t){return!1}},f=function(t){if(!n(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,o(t))}catch(t){return!0}};return f.sham=!0,Fn=!s||e(function(){var t;return d(d.call)||!d(Object)||!d(function(){t=!0})||t})?f:d}function yr(){if(Gn)return zn;Gn=1;var t=y(),e=be(),n=st();return zn=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o}}function mr(){if(Vn)return qn;Vn=1;var t=ct();return qn=Array.isArray||function(e){return"Array"===t(e)}}function gr(){if(Jn)return $n;Jn=1;var t=pr(),e=Pt(),n=lt(),r=fr(),i=ie()("iterator");return $n=function(o){if(!n(o))return e(o,i)||e(o,"@@iterator")||r[t(o)]}}function wr(){if(Zn)return Kn;Zn=1;var t=g(),e=Ot(),n=we(),r=St(),i=gr(),o=TypeError;return Kn=function(a,s){var u=arguments.length<2?i(a):s;if(e(u))return n(t(u,a));throw new o(r(a)+" is not iterable")},Kn}function br(){if(tr)return Qn;tr=1;var t=cr(),e=g(),n=ee(),r=dr(),i=hr(),o=vr(),a=fn(),s=yr(),u=function(){if(Yn)return Xn;Yn=1;var t=y(),e=mr(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return Xn=i?function(t,i){if(e(t)&&!r(t,"length").writable)throw new n("Cannot set read only .length");return t.length=i}:function(t,e){return t.length=e}}(),c=wr(),l=gr(),d=lr(),f=Array;return Qn=function(h){var p=o(this),v=arguments.length,y=v>1?arguments[1]:void 0,m=void 0!==y;m&&(y=t(y,v>2?arguments[2]:void 0));var g,w,b,x,S,O,P=n(h),E=l(P),T=0;if(!E||this===f&&i(E))for(g=a(P),w=p?new this(g):f(g);g>T;T++)O=m?y(P[T],T):P[T],s(w,T,O);else for(w=p?new this:[],S=(x=c(P,E)).next;!(b=e(S,x)).done;T++){O=m?r(x,y,[b.value,T],!0):b.value;try{s(w,T,O)}catch(t){d(x,"throw",t)}}return u(w,T),w},Qn}function xr(){if(nr)return er;nr=1;var t=ie()("iterator"),e=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){e=!0}};r[t]=function(){return this},Array.from(r,function(){throw 2})}catch(t){}return er=function(n,r){try{if(!r&&!e)return!1}catch(t){return!1}var i=!1;try{var o={};o[t]=function(){return{next:function(){return{done:i=!0}}}},n(o)}catch(t){}return i}}!function(){if(rr)return i;rr=1;var t=ur(),e=br();t({target:"Array",stat:!0,forced:!xr()(function(t){Array.from(t)})},{from:e})}();var Sr,Or,Pr,Er,Tr,kr,Cr,Ar,jr,_r,Rr,Lr,Dr,Ir,Br,Hr,Nr,Ur,Mr,Fr,Wr,zr,Gr,qr,Vr,Xr,Yr,$r,Jr,Kr,Zr,Qr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,li,di,fi,hi,pi,vi,yi,mi,gi,wi,bi,xi,Si,Oi,Pi={};function Ei(){if(Or)return Sr;Or=1;var t=o(),e=mt(),n=ct(),r=function(t){return e.slice(0,t.length)===t};return Sr=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function Ti(){if(Er)return Pr;Er=1;var t=Ei();return Pr="NODE"===t}function ki(){if(kr)return Tr;kr=1;var t=o();return Tr=t}function Ci(){if(_r)return jr;_r=1;var t=pt();return jr=function(e){return t(e)||null===e}}function Ai(){if(Lr)return Rr;Lr=1;var t=Ci(),e=String,n=TypeError;return Rr=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function ji(){if(Ir)return Dr;Ir=1;var t=function(){if(Ar)return Cr;Ar=1;var t=ut(),e=Ot();return Cr=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(t){}}}(),e=pt(),n=dt(),r=Ai();return Dr=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,a={};try{(i=t(Object.prototype,"__proto__","set"))(a,[]),o=a instanceof Array}catch(t){}return function(t,a){return n(t),r(a),e(t)?(o?i(t,a):t.__proto__=a,t):t}}():void 0)}function _i(){if(Hr)return Br;Hr=1;var t=be().f,e=ne(),n=ie()("toStringTag");return Br=function(r,i,o){r&&!o&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:i})}}function Ri(){if(Ur)return Nr;Ur=1;var t=We(),e=be();return Nr=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)}}function Li(){if(Fr)return Mr;Fr=1;var t=vt(),e=Ri(),n=ie(),r=y(),i=n("species");return Mr=function(n){var o=t(n);r&&o&&!o[i]&&e(o,i,{configurable:!0,get:function(){return this}})}}function Di(){if(zr)return Wr;zr=1;var t=yt(),e=TypeError;return Wr=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")}}function Ii(){if(qr)return Gr;qr=1;var t=vr(),e=St(),n=TypeError;return Gr=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}function Bi(){if(Xr)return Vr;Xr=1;var t=we(),e=Ii(),n=lt(),r=ie()("species");return Vr=function(i,o){var a,s=t(i).constructor;return void 0===s||n(a=t(s)[r])?o:e(a)}}function Hi(){if($r)return Yr;$r=1;var t=m(),e=Function.prototype,n=e.apply,r=e.call;return Yr="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Yr}function Ni(){if(Kr)return Jr;Kr=1;var t=vt();return Jr=t("document","documentElement")}function Ui(){if(Qr)return Zr;Qr=1;var t=ut();return Zr=t([].slice)}function Mi(){if(ei)return ti;ei=1;var t=TypeError;return ti=function(e,n){if(e<n)throw new t("Not enough arguments");return e}}function Fi(){if(ri)return ni;ri=1;var t=mt();return ni=/ipad|iphone|ipod/i.test(t)&&/applewebkit/i.test(t)}function Wi(){if(oi)return ii;oi=1;var t,e,n,r,i=o(),a=Hi(),s=cr(),u=ht(),c=ne(),l=v(),d=Ni(),f=Ui(),h=se(),p=Mi(),y=Fi(),m=Ti(),g=i.setImmediate,w=i.clearImmediate,b=i.process,x=i.Dispatch,S=i.Function,O=i.MessageChannel,P=i.String,E=0,T={},k="onreadystatechange";l(function(){t=i.location});var C=function(t){if(c(T,t)){var e=T[t];delete T[t],e()}},A=function(t){return function(){C(t)}},j=function(t){C(t.data)},_=function(e){i.postMessage(P(e),t.protocol+"//"+t.host)};return g&&w||(g=function(t){p(arguments.length,1);var n=u(t)?t:S(t),r=f(arguments,1);return T[++E]=function(){a(n,void 0,r)},e(E),E},w=function(t){delete T[t]},m?e=function(t){b.nextTick(A(t))}:x&&x.now?e=function(t){x.now(A(t))}:O&&!y?(r=(n=new O).port2,n.port1.onmessage=j,e=s(r.postMessage,r)):i.addEventListener&&u(i.postMessage)&&!i.importScripts&&t&&"file:"!==t.protocol&&!l(_)?(e=_,i.addEventListener("message",j,!1)):e=k in h("script")?function(t){d.appendChild(h("script"))[k]=function(){d.removeChild(this),C(t)}}:function(t){setTimeout(A(t),0)}),ii={set:g,clear:w}}function zi(){if(si)return ai;si=1;var t=o(),e=y(),n=Object.getOwnPropertyDescriptor;return ai=function(r){if(!e)return t[r];var i=n(t,r);return i&&i.value}}function Gi(){if(ci)return ui;ci=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},ui=t}function qi(){if(vi)return pi;vi=1;var t,e,n,r,i,a=o(),s=zi(),u=cr(),c=Wi().set,l=Gi(),d=Fi(),f=function(){if(di)return li;di=1;var t=mt();return li=/ipad|iphone|ipod/i.test(t)&&"undefined"!=typeof Pebble}(),h=function(){if(hi)return fi;hi=1;var t=mt();return fi=/web0s(?!.*chrome)/i.test(t)}(),p=Ti(),v=a.MutationObserver||a.WebKitMutationObserver,y=a.document,m=a.process,g=a.Promise,w=s("queueMicrotask");if(!w){var b=new l,x=function(){var e,n;for(p&&(e=m.domain)&&e.exit();n=b.get();)try{n()}catch(e){throw b.head&&t(),e}e&&e.enter()};d||p||h||!v||!y?!f&&g&&g.resolve?((r=g.resolve(void 0)).constructor=g,i=u(r.then,r),t=function(){i(x)}):p?t=function(){m.nextTick(x)}:(c=u(c,a),t=function(){c(x)}):(e=!0,n=y.createTextNode(""),new v(x).observe(n,{characterData:!0}),t=function(){n.data=e=!e}),w=function(e){b.head||t(),b.add(e)}}return pi=w}function Vi(){return mi?yi:(mi=1,yi=function(t,e){})}function Xi(){return wi?gi:(wi=1,gi=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}})}function Yi(){if(xi)return bi;xi=1;var t=o();return bi=t.Promise}function $i(){if(Oi)return Si;Oi=1;var t=o(),e=Yi(),n=ht(),r=sr(),i=Ne(),a=ie(),s=Ei(),u=Kt(),c=gt(),l=e&&e.prototype,d=a("species"),f=!1,h=n(t.PromiseRejectionEvent),p=r("Promise",function(){var t=i(e),n=t!==String(e);if(!n&&66===c)return!0;if(u&&(!l.catch||!l.finally))return!0;if(!c||c<51||!/native code/.test(t)){var r=new e(function(t){t(1)}),o=function(t){t(function(){},function(){})};if((r.constructor={})[d]=o,!(f=r.then(function(){})instanceof o))return!0}return!(n||"BROWSER"!==s&&"DENO"!==s||h)});return Si={CONSTRUCTOR:p,REJECTION_EVENT:h,SUBCLASSING:f}}var Ji,Ki,Zi={};function Qi(){if(Ji)return Zi;Ji=1;var t=Ot(),e=TypeError,n=function(n){var r,i;this.promise=new n(function(t,n){if(void 0!==r||void 0!==i)throw new e("Bad Promise constructor");r=t,i=n}),this.resolve=t(r),this.reject=t(i)};return Zi.f=function(t){return new n(t)},Zi}var to,eo,no,ro,io,oo={};function ao(){if(eo)return to;eo=1;var t=cr(),e=g(),n=we(),r=St(),i=hr(),o=fn(),a=yt(),s=wr(),u=gr(),c=lr(),l=TypeError,d=function(t,e){this.stopped=t,this.result=e},f=d.prototype;return to=function(h,p,v){var y,m,g,w,b,x,S,O=v&&v.that,P=!(!v||!v.AS_ENTRIES),E=!(!v||!v.IS_RECORD),T=!(!v||!v.IS_ITERATOR),k=!(!v||!v.INTERRUPTED),C=t(p,O),A=function(t){var e=y;return y=void 0,e&&c(e,"normal"),new d(!0,t)},j=function(t){return P?(n(t),k?C(t[0],t[1],A):C(t[0],t[1])):k?C(t,A):C(t)};if(E)y=h.iterator;else if(T)y=h;else{if(!(m=u(h)))throw new l(r(h)+" is not iterable");if(i(m)){for(g=0,w=o(h);w>g;g++)if((b=j(h[g]))&&a(f,b))return b;return new d(!1)}y=s(h,m)}for(x=E?h.next:y.next;!(S=e(x,y)).done;){var _=S.value;try{b=j(_)}catch(t){if(!y)throw t;c(y,"throw",t)}if("object"==typeof b&&b&&a(f,b))return b}return new d(!1)}}function so(){if(ro)return no;ro=1;var t=Yi(),e=xr(),n=$i().CONSTRUCTOR;return no=n||!e(function(e){t.all(e).then(void 0,function(){})})}var uo,co={};var lo,fo={};var ho,po={};var vo,yo,mo,go,wo={};function bo(){if(yo)return vo;yo=1;var t=we(),e=pt(),n=Qi();return vo=function(r,i){if(t(r),e(i)&&i.constructor===r)return i;var o=n.f(r);return(0,o.resolve)(i),o.promise}}go||(go=1,function(){if(Ki)return Pi;Ki=1;var t,e,n,r,i=ur(),a=Kt(),s=Ti(),u=o(),c=ki(),l=g(),d=ze(),f=ji(),h=_i(),p=Li(),v=Ot(),y=ht(),m=pt(),w=Di(),b=Bi(),x=Wi().set,S=qi(),O=Vi(),P=Xi(),E=Gi(),T=Fe(),k=Yi(),C=$i(),A=Qi(),j="Promise",_=C.CONSTRUCTOR,R=C.REJECTION_EVENT,L=C.SUBCLASSING,D=T.getterFor(j),I=T.set,B=k&&k.prototype,H=k,N=B,U=u.TypeError,M=u.document,F=u.process,W=A.f,z=W,G=!!(M&&M.createEvent&&u.dispatchEvent),q="unhandledrejection",V=function(t){var e;return!(!m(t)||!y(e=t.then))&&e},X=function(t,e){var n,r,i,o=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,d=t.domain;try{s?(a||(2===e.rejection&&Z(e),e.rejection=1),!0===s?n=o:(d&&d.enter(),n=s(o),d&&(d.exit(),i=!0)),n===t.promise?c(new U("Promise-chain cycle")):(r=V(n))?l(r,n,u,c):u(n)):c(o)}catch(t){d&&!i&&d.exit(),c(t)}},Y=function(t,e){t.notified||(t.notified=!0,S(function(){for(var n,r=t.reactions;n=r.get();)X(n,t);t.notified=!1,e&&!t.rejection&&J(t)}))},$=function(t,e,n){var r,i;G?((r=M.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},!R&&(i=u["on"+t])?i(r):t===q&&O("Unhandled promise rejection",n)},J=function(t){l(x,u,function(){var e,n=t.facade,r=t.value;if(K(t)&&(e=P(function(){s?F.emit("unhandledRejection",r,n):$(q,n,r)}),t.rejection=s||K(t)?2:1,e.error))throw e.value})},K=function(t){return 1!==t.rejection&&!t.parent},Z=function(t){l(x,u,function(){var e=t.facade;s?F.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)})},Q=function(t,e,n){return function(r){t(e,r,n)}},tt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Y(t,!0))},et=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new U("Promise can't be resolved itself");var r=V(e);r?S(function(){var n={done:!1};try{l(r,e,Q(et,n,t),Q(tt,n,t))}catch(e){tt(n,e,t)}}):(t.value=e,t.state=1,Y(t,!1))}catch(e){tt({done:!1},e,t)}}};if(_&&(N=(H=function(e){w(this,N),v(e),l(t,this);var n=D(this);try{e(Q(et,n),Q(tt,n))}catch(t){tt(n,t)}}).prototype,(t=function(t){I(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=d(N,"then",function(t,e){var n=D(this),r=W(b(this,H));return n.parent=!0,r.ok=!y(t)||t,r.fail=y(e)&&e,r.domain=s?F.domain:void 0,0===n.state?n.reactions.add(r):S(function(){X(r,n)}),r.promise}),e=function(){var e=new t,n=D(e);this.promise=e,this.resolve=Q(et,n),this.reject=Q(tt,n)},A.f=W=function(t){return t===H||t===n?new e(t):z(t)},!a&&y(k)&&B!==Object.prototype)){r=B.then,L||d(B,"then",function(t,e){var n=this;return new H(function(t,e){l(r,n,t,e)}).then(t,e)},{unsafe:!0});try{delete B.constructor}catch(t){}f&&f(B,N)}i({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:H}),n=c.Promise,h(H,j,!1,!0),p(j)}(),function(){if(io)return oo;io=1;var t=ur(),e=g(),n=Ot(),r=Qi(),i=Xi(),o=ao();t({target:"Promise",stat:!0,forced:so()},{all:function(t){var a=this,s=r.f(a),u=s.resolve,c=s.reject,l=i(function(){var r=n(a.resolve),i=[],s=0,l=1;o(t,function(t){var n=s++,o=!1;l++,e(r,a,t).then(function(t){o||(o=!0,i[n]=t,--l||u(i))},c)}),--l||u(i)});return l.error&&c(l.value),s.promise}})}(),function(){if(uo)return co;uo=1;var t=ur(),e=Kt(),n=$i().CONSTRUCTOR,r=Yi(),i=vt(),o=ht(),a=ze(),s=r&&r.prototype;if(t({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(t){return this.then(void 0,t)}}),!e&&o(r)){var u=i("Promise").prototype.catch;s.catch!==u&&a(s,"catch",u,{unsafe:!0})}}(),function(){if(lo)return fo;lo=1;var t=ur(),e=g(),n=Ot(),r=Qi(),i=Xi(),o=ao();t({target:"Promise",stat:!0,forced:so()},{race:function(t){var a=this,s=r.f(a),u=s.reject,c=i(function(){var r=n(a.resolve);o(t,function(t){e(r,a,t).then(s.resolve,u)})});return c.error&&u(c.value),s.promise}})}(),function(){if(ho)return po;ho=1;var t=ur(),e=Qi();t({target:"Promise",stat:!0,forced:$i().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(mo)return wo;mo=1;var t=ur(),e=vt(),n=Kt(),r=Yi(),i=$i().CONSTRUCTOR,o=bo(),a=e("Promise"),s=n&&!i;t({target:"Promise",stat:!0,forced:n||i},{resolve:function(t){return o(s&&this===a?r:this,t)}})}());var xo,So,Oo,Po,Eo,To,ko,Co,Ao={},jo={};function _o(){if(So)return xo;So=1;var t=pn(),e=vn();return xo=Object.keys||function(n){return t(n,e)}}function Ro(){if(Eo)return Po;Eo=1;var t,e=we(),n=function(){if(Oo)return jo;Oo=1;var t=y(),e=ge(),n=be(),r=we(),i=ft(),o=_o();return jo.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var a,s=i(e),u=o(e),c=u.length,l=0;c>l;)n.f(t,a=u[l++],s[a]);return t},jo}(),r=vn(),i=Me(),o=Ni(),a=se(),s=Ue(),u="prototype",c="script",l=s("IE_PROTO"),d=function(){},f=function(t){return"<"+c+">"+t+"</"+c+">"},h=function(t){t.write(f("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,i;p="undefined"!=typeof document?document.domain&&t?h(t):(n=a("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(e=n.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):h(t);for(var s=r.length;s--;)delete p[u][r[s]];return p()};return i[l]=!0,Po=Object.create||function(t,r){var i;return null!==t?(d[u]=e(t),i=new d,d[u]=null,i[l]=t):i=p(),void 0===r?i:n.f(i,r)}}function Lo(){if(ko)return To;ko=1;var t=ie(),e=Ro(),n=be().f,r=t("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:e(null)}),To=function(t){i[r][t]=!0}}!function(){if(Co)return Ao;Co=1;var t=ur(),e=hn().includes,n=v(),r=Lo(),i=n(function(){return!Array(1).includes()}),o=n(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:i||o},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")}();var Do,Io,Bo,Ho={};!function(){if(Bo)return Ho;Bo=1;var t=ur(),e=function(){if(Io)return Do;Io=1;var t=ee(),e=ln(),n=fn();return Do=function(r){for(var i=t(this),o=n(i),a=arguments.length,s=e(a>1?arguments[1]:void 0,o),u=a>2?arguments[2]:void 0,c=void 0===u?o:e(u,o);c>s;)i[s++]=r;return i},Do}(),n=Lo();t({target:"Array",proto:!0},{fill:e}),n("fill")}();var No="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Uo="URLSearchParams"in No,Mo="Symbol"in No&&"iterator"in Symbol,Fo="FileReader"in No&&"Blob"in No&&function(){try{return new Blob,!0}catch(t){return!1}}(),Wo="FormData"in No,zo="ArrayBuffer"in No;if(zo)var Go=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],qo=ArrayBuffer.isView||function(t){return t&&Go.indexOf(Object.prototype.toString.call(t))>-1};function Vo(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Xo(t){return"string"!=typeof t&&(t=String(t)),t}function Yo(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return Mo&&(e[Symbol.iterator]=function(){return e}),e}function $o(t){this.map={},t instanceof $o?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function Jo(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function Ko(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function Zo(t){var e=new FileReader,n=Ko(e);return e.readAsArrayBuffer(t),n}function Qo(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function ta(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Fo&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Wo&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Uo&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():zo&&Fo&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Qo(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):zo&&(ArrayBuffer.prototype.isPrototypeOf(t)||qo(t))?this._bodyArrayBuffer=Qo(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Uo&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Fo&&(this.blob=function(){var t=Jo(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=Jo(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Fo)return this.blob().then(Zo);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,o=Jo(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=Ko(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8",e.readAsText(t,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Wo&&(this.formData=function(){return this.text().then(ra)}),this.json=function(){return this.text().then(JSON.parse)},this}$o.prototype.append=function(t,e){t=Vo(t),e=Xo(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},$o.prototype.delete=function(t){delete this.map[Vo(t)]},$o.prototype.get=function(t){return t=Vo(t),this.has(t)?this.map[t]:null},$o.prototype.has=function(t){return this.map.hasOwnProperty(Vo(t))},$o.prototype.set=function(t,e){this.map[Vo(t)]=Xo(e)},$o.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},$o.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),Yo(t)},$o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),Yo(t)},$o.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),Yo(t)},Mo&&($o.prototype[Symbol.iterator]=$o.prototype.entries);var ea=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function na(t,e){if(!(this instanceof na))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(e=e||{}).body;if(t instanceof na){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new $o(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new $o(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),ea.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in No)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function ra(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function ia(t,e){if(!(this instanceof ia))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new $o(e.headers),this.url=e.url||"",this._initBody(t)}na.prototype.clone=function(){return new na(this,{body:this._bodyInit})},ta.call(na.prototype),ta.call(ia.prototype),ia.prototype.clone=function(){return new ia(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new $o(this.headers),url:this.url})},ia.error=function(){var t=new ia(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var oa=[301,302,303,307,308];ia.redirect=function(t,e){if(-1===oa.indexOf(e))throw new RangeError("Invalid status code");return new ia(null,{status:e,headers:{location:t}})};var aa=No.DOMException;try{new aa}catch(t){(aa=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),aa.prototype.constructor=aa}function sa(t,e){return new Promise(function(n,r){var i=new na(t,e);if(i.signal&&i.signal.aborted)return r(new aa("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}if(o.onload=function(){var t,e,r={statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new $o,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{e.append(r,i)}catch(t){}}}),e)};0===i.url.indexOf("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;setTimeout(function(){n(new ia(a,r))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new aa("Aborted","AbortError"))},0)},o.open(i.method,function(t){try{return""===t&&No.location.href?No.location.href:t}catch(e){return t}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Fo?o.responseType="blob":zo&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof $o||No.Headers&&e.headers instanceof No.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach(function(t){s.push(Vo(t)),o.setRequestHeader(t,Xo(e.headers[t]))}),i.headers.forEach(function(t,e){-1===s.indexOf(e)&&o.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){o.setRequestHeader(e,t)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})}sa.polyfill=!0,No.fetch||(No.fetch=sa,No.Headers=$o,No.Request=na,No.Response=ia),"undefined"==typeof CanvasRenderingContext2D||CanvasRenderingContext2D.prototype.resetTransform||(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)});!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("@keyframes watermark{0%{background-position:0 0}25%{background-position:100% 100%}50%{background-position:100% 0}75%{background-position:0 100%}to{background-position:0 0}}@keyframes watermark-horizontal{0%{background-position-x:0}to{background-position-x:100%}}@keyframes watermark-vertical{0%{background-position-y:0}to{background-position-y:100%}}");var ua=function(t,e){return ua=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ua(t,e)};var ca=function(){return ca=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ca.apply(this,arguments)};function la(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}u((r=r.apply(t,e||[])).next())})}function da(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var fa=function(t){return t.toDataURL("image/png",1)},ha=function(t){return"function"==typeof t},pa=function(t){return void 0===t},va=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n="http://www.w3.org/2000/svg");var r=document.createElementNS(n,t);for(var i in e)r.setAttribute(i,e[i]);return r},ya=function(t,e){return la(void 0,void 0,void 0,function(){var n,r,i,o,a,s,u,c,l;return da(this,function(d){switch(d.label){case 0:return n=va("svg",{xmlns:"http://www.w3.org/2000/svg"}),(r=document.createElement("div")).setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.style.cssText="\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n font: ".concat(t.font,";\n color: ").concat(e.fontColor,";\n"),r.innerHTML="<div class='rich-text-content'>".concat(e.content,"</div>"),document.body.appendChild(r),[4,ma(r)];case 1:return d.sent(),i=null===(l=r.querySelector(".rich-text-content"))||void 0===l?void 0:l.getBoundingClientRect(),o=null==i?void 0:i.width,a=null==i?void 0:i.height,document.body.removeChild(r),s=e.richTextWidth||o||e.width,u=e.richTextHeight||a||e.height,n.setAttribute("width",s.toString()),n.setAttribute("height",u.toString()),(c=va("foreignObject",{width:s.toString(),height:u.toString()})).appendChild(r),n.appendChild(c),[2,{element:n,width:s,height:u}]}})})};function ma(t){return la(this,void 0,void 0,function(){var e,n,r,i,o;return da(this,function(a){switch(a.label){case 0:e=t.querySelectorAll("img"),n=function(t){var e,n,r,i;return da(this,function(o){switch(o.label){case 0:if(!(e=t.getAttribute("src")))return[3,6];o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(e)];case 2:return[4,o.sent().blob()];case 3:return n=o.sent(),[4,new Promise(function(t,e){var r=new FileReader;r.onloadend=function(){return t(r.result)},r.onerror=e,r.readAsDataURL(n)})];case 4:return r=o.sent(),"string"==typeof r&&t.setAttribute("src",r),[3,6];case 5:return i=o.sent(),console.error("Error converting ".concat(e," to base64:"),i),[3,6];case 6:return[2]}})},r=0,i=Array.from(e),a.label=1;case 1:return r<i.length?(o=i[r],[5,n(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[2]}})})}var ga=function(t,e){return pa(t)?e:t},wa=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=void 0);var r=new Image;return r.setAttribute("crossOrigin","anonymous"),!pa(e)&&(r.width=e),!pa(n)&&(r.height=n),r.src=t,new Promise(function(t){r.onload=function(){t(r)}})},ba={width:300,height:300,rotate:45,layout:"default",auxiliaryLine:!1,translatePlacement:"middle",contentType:"text",content:"hello watermark-js-plus",textType:"fill",imageWidth:0,imageHeight:0,lineHeight:30,zIndex:2147483647,backgroundPosition:"0 0",backgroundRepeat:"repeat",fontSize:"20px",fontFamily:"sans-serif",fontStyle:"",fontVariant:"",fontColor:"#000",fontWeight:"normal",filter:"none",letterSpacing:"0px",wordSpacing:"0px",globalAlpha:.5,mode:"default",mutationObserve:!0,monitorProtection:!1,movable:!1,parent:"body",onSuccess:function(){},onBeforeDestroy:function(){},onDestroyed:function(){},onObserveError:function(){}},xa=function(t){"undefined"!=typeof window&&t&&Object.defineProperty(window,"MutationObserver",{writable:!1,configurable:!1})},Sa=function(){function t(e,n){this.props=e,this.options=n,this.canvas=t.createCanvas(this.options.width,this.options.height),this.recommendOptions=function(t,e,n){var r=t.getContext("2d");if(null===r)throw new Error("get context error");r.font="".concat(e.fontStyle," ").concat(e.fontVariant," ").concat(e.fontWeight," ").concat(e.fontSize," ").concat(e.fontFamily),r.filter=e.filter,r.letterSpacing=e.letterSpacing,r.wordSpacing=e.wordSpacing,(null==e?void 0:e.rotate)&&(e.rotate=(360-e.rotate%360)*(Math.PI/180)),pa(n.textRowMaxWidth)&&(e.textRowMaxWidth=e.width);var i={image:{rect:{width:e.imageWidth,height:e.imageHeight},position:{x:0,y:0}},textLine:{data:[],yOffsetValue:0},advancedStyleParams:{linear:{x0:0,x1:0},radial:{x0:0,y0:0,r0:0,x1:0,y1:0,r1:0},conic:{x:0,y:0,startAngle:0},pattern:{}}};switch(e.contentType){case"text":i.textLine.data=[e.content];break;case"multi-line-text":i.textLine.data=function(t,e,n){for(var r=[],i="",o="",a=0,s=e.length;a<s;a++)"\n"!==(o=e.charAt(a))?(i+=o,t.measureText(i).width>n&&(r.push(i.substring(0,i.length-1)),i="",a--)):(r.push(i),i="");return r.push(i),r}(r,e.content,e.textRowMaxWidth)}var o=e.width/2,a=e.height/2,s="middle",u="center";switch(pa(null==n?void 0:n.translateX)||pa(null==n?void 0:n.translateY)?(i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.r0=0,i.advancedStyleParams.radial.r1=e.width/2):(o=null==n?void 0:n.translateX,a=null==n?void 0:n.translateY,s="top",u="left"),n.translatePlacement){case"top":o=e.width/2,a=0,s="top",i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"top-start":o=0,a=0,s="top",u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"top-end":o=e.width,a=0,s="top",u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"bottom":o=e.width/2,a=e.height,s="bottom",i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=0,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"bottom-start":o=0,a=e.height,s="bottom",u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"bottom-end":o=e.width,a=e.height,s="bottom",u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"left":o=0,a=e.height/2,u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=0;break;case"right":o=e.width,a=e.height/2,u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=0}if(e.translateX=o,e.translateY=a,pa(null==n?void 0:n.textBaseline)&&(e.textBaseline=s),pa(null==n?void 0:n.textAlign)&&(e.textAlign=u),["text","multi-line-text"].includes(e.contentType))switch(e.textBaseline){case"middle":i.textLine.yOffsetValue=(i.textLine.data.length-1)*e.lineHeight/2;break;case"bottom":case"alphabetic":case"ideographic":i.textLine.yOffsetValue=(i.textLine.data.length-1)*e.lineHeight+(e.lineHeight-parseInt(e.fontSize))/2;break;case"top":case"hanging":i.textLine.yOffsetValue=-e.lineHeight/2+parseInt(e.fontSize)/2}return i}(this.canvas,this.options,this.props)}return t.createCanvas=function(t,e){var n,r=window.devicePixelRatio||1,i=document.createElement("canvas");return i.width=t*r,i.height=e*r,i.style.width="".concat(t,"px"),i.style.height="".concat(e,"px"),null===(n=i.getContext("2d"))||void 0===n||n.setTransform(r,0,0,r,0,0),i},t.clearCanvas=function(t){var e=t.getContext("2d");if(null===e)throw new Error("get context error");e.restore(),e.resetTransform(),e.clearRect(0,0,t.width,t.height);var n=window.devicePixelRatio||1;e.setTransform(n,0,0,n,0,0)},t.prototype.getCanvas=function(){return this.canvas},t.prototype.clear=function(){t.clearCanvas(this.canvas)},t.prototype.draw=function(){var t=this,e=this.canvas.getContext("2d");if(null===e)throw new Error("get context error");return this.options.auxiliaryLine&&(e.beginPath(),e.rect(0,0,this.options.width,this.options.height),e.lineWidth=1,e.strokeStyle="#000",e.stroke(),e.closePath(),e.beginPath(),e.rect(this.options.translateX,this.options.translateY,1,1),e.lineWidth=1,e.strokeStyle="#f00",e.stroke(),e.closePath()),this.setStyle(e),e.save(),e.translate(this.options.translateX,this.options.translateY),e.rotate(this.options.rotate),new Promise(function(n){switch(t.options.contentType){case"text":t.drawText(e,n);break;case"image":t.drawImage(e,n);break;case"multi-line-text":t.drawMultiLineText(e,n);break;case"rich-text":t.drawRichText(e,n)}})},t.prototype.setStyle=function(t){var e,n="fillStyle";"stroke"===this.options.textType&&(n="strokeStyle");var r=this.options.fontColor;if(null===(e=this.options)||void 0===e?void 0:e.advancedStyle)switch(this.options.advancedStyle.type){case"linear":r=this.createLinearGradient(t);break;case"radial":r=this.createRadialGradient(t);break;case"conic":r=this.createConicGradient(t);break;case"pattern":r=this.createPattern(t)}t[n]&&r&&(t[n]=r),this.options.textAlign&&(t.textAlign=this.options.textAlign),this.options.textBaseline&&(t.textBaseline=this.options.textBaseline),t.globalAlpha=this.options.globalAlpha,this.options.shadowStyle&&(t.shadowBlur=ga(this.options.shadowStyle.shadowBlur,0),t.shadowColor=ga(this.options.shadowStyle.shadowColor,"#00000000"),t.shadowOffsetX=ga(this.options.shadowStyle.shadowOffsetX,0),t.shadowOffsetY=ga(this.options.shadowStyle.shadowOffsetY,0)),ha(this.options.extraDrawFunc)&&this.options.extraDrawFunc(t)},t.prototype.createLinearGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y=t.createLinearGradient(ga(null===(r=null===(n=null===(e=this.options.advancedStyle)||void 0===e?void 0:e.params)||void 0===n?void 0:n.linear)||void 0===r?void 0:r.x0,this.recommendOptions.advancedStyleParams.linear.x0),ga(null===(a=null===(o=null===(i=this.options.advancedStyle)||void 0===i?void 0:i.params)||void 0===o?void 0:o.linear)||void 0===a?void 0:a.y0,0),ga(null===(c=null===(u=null===(s=this.options.advancedStyle)||void 0===s?void 0:s.params)||void 0===u?void 0:u.linear)||void 0===c?void 0:c.x1,this.recommendOptions.advancedStyleParams.linear.x1),ga(null===(f=null===(d=null===(l=this.options.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.linear)||void 0===f?void 0:f.y1,0));return null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.colorStops)||void 0===v||v.forEach(function(t){y.addColorStop(t.offset,t.color)}),y},t.prototype.createConicGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y=t.createConicGradient(ga(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.conic)||void 0===i?void 0:i.startAngle,0),ga(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.conic)||void 0===u?void 0:u.x,this.recommendOptions.advancedStyleParams.conic.x),ga(null===(f=null===(d=null===(l=null===(c=this.options)||void 0===c?void 0:c.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.conic)||void 0===f?void 0:f.y,this.recommendOptions.advancedStyleParams.conic.y));return null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.colorStops)||void 0===v||v.forEach(function(t){y.addColorStop(t.offset,t.color)}),y},t.prototype.createRadialGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y,m,g,w,b,x,S,O,P,E,T,k,C=t.createRadialGradient(ga(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.radial)||void 0===i?void 0:i.x0,this.recommendOptions.advancedStyleParams.radial.x0),ga(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.radial)||void 0===u?void 0:u.y0,this.recommendOptions.advancedStyleParams.radial.y0),ga(null===(f=null===(d=null===(l=null===(c=this.options)||void 0===c?void 0:c.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.radial)||void 0===f?void 0:f.r0,this.recommendOptions.advancedStyleParams.radial.r0),ga(null===(y=null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.params)||void 0===v?void 0:v.radial)||void 0===y?void 0:y.x1,this.recommendOptions.advancedStyleParams.radial.x1),ga(null===(b=null===(w=null===(g=null===(m=this.options)||void 0===m?void 0:m.advancedStyle)||void 0===g?void 0:g.params)||void 0===w?void 0:w.radial)||void 0===b?void 0:b.y1,this.recommendOptions.advancedStyleParams.radial.y1),ga(null===(P=null===(O=null===(S=null===(x=this.options)||void 0===x?void 0:x.advancedStyle)||void 0===S?void 0:S.params)||void 0===O?void 0:O.radial)||void 0===P?void 0:P.r1,this.recommendOptions.advancedStyleParams.radial.r1));return null===(k=null===(T=null===(E=this.options)||void 0===E?void 0:E.advancedStyle)||void 0===T?void 0:T.colorStops)||void 0===k||k.forEach(function(t){C.addColorStop(t.offset,t.color)}),C},t.prototype.createPattern=function(t){var e,n,r,i,o,a,s,u;return t.createPattern(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.pattern)||void 0===i?void 0:i.image,(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.pattern)||void 0===u?void 0:u.repetition)||"")},t.prototype.setText=function(t,e){var n="fillText";"stroke"===this.options.textType&&(n="strokeText"),t[n]&&t[n](e.text,e.x,e.y,e.maxWidth)},t.prototype.drawText=function(t,e){this.setText(t,{text:this.options.content,x:0,y:0-this.recommendOptions.textLine.yOffsetValue,maxWidth:this.options.textRowMaxWidth||this.options.width}),e(t.canvas)},t.prototype.drawImage=function(t,e){var n=this;wa(this.options.image).then(function(r){var i=n.getImageRect(r),o=i.width,a=i.height,s=n.getDrawImagePosition(o,a);t.drawImage(r,s.x,s.y,o,a),e(t.canvas)})},t.prototype.drawMultiLineText=function(t,e){var n=this,r=this.recommendOptions.textLine.data,i=this.recommendOptions.textLine.yOffsetValue;r.forEach(function(e,r){n.setText(t,{text:e,x:0,y:n.options.lineHeight*r-i,maxWidth:n.options.textRowMaxWidth||n.options.width})}),e(t.canvas)},t.prototype.drawRichText=function(t,e){return la(this,void 0,void 0,function(){var n,r=this;return da(this,function(i){switch(i.label){case 0:return[4,ya(t,this.options)];case 1:return n=i.sent(),wa((o=n.element,a=o.outerHTML.replace(/<(img|br|input|hr|embed)(.*?)>/g,"<$1$2/>").replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23"),"data:image/svg+xml;charset=utf-8,".concat(a)),n.width,n.height).then(function(n){var i=r.getDrawImagePosition(n.width,n.height);t.drawImage(n,i.x,i.y,n.width,n.height),e(t.canvas)}),[2]}var o,a})})},t.prototype.getImageRect=function(t){var e={width:this.options.imageWidth||0,height:this.options.imageHeight||0};switch(!0){case 0!==e.width&&0===e.height:e.height=e.width*t.height/t.width;break;case 0===e.width&&0!==e.height:e.width=e.height*t.width/t.height;break;case 0===e.width&&0===e.height:e.width=t.width,e.height=t.height}return e},t.prototype.getDrawImagePosition=function(t,e){var n,r,i={x:-t/2,y:-e/2};switch(this.options.translatePlacement){case"top":i.x=-t/2,i.y=0;break;case"top-start":i.x=0,i.y=0;break;case"top-end":i.x=-t,i.y=0;break;case"bottom":i.x=-t/2,i.y=-e;break;case"bottom-start":i.x=0,i.y=-e;break;case"bottom-end":i.x=-t,i.y=-e;break;case"left":i.x=0,i.y=-e/2;break;case"right":i.x=-t,i.y=-e/2}return!pa(null===(n=this.props)||void 0===n?void 0:n.translateX)&&(i.x=0),!pa(null===(r=this.props)||void 0===r?void 0:r.translateY)&&(i.y=0),i},t}(),Oa=function(){function t(t,e){var n,r,i,o,a,s,u;this.options=t,this.partialWidth=this.options.width,this.partialHeight=this.options.height,this.rows=(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,this.cols=(null===(r=this.options.gridLayoutOptions)||void 0===r?void 0:r.cols)||1,this.matrix=(null===(i=this.options.gridLayoutOptions)||void 0===i?void 0:i.matrix)||(a=this.rows,s=this.cols,u=1,Array.from({length:a},function(){return new Array(s).fill(u)})),this.gap=(null===(o=this.options.gridLayoutOptions)||void 0===o?void 0:o.gap)||[0,0],this.partialCanvas=e}return t.prototype.draw=function(){var t,e,n,r,i,o,a,s,u=Sa.createCanvas((null===(t=this.options.gridLayoutOptions)||void 0===t?void 0:t.width)||this.partialWidth*this.cols+this.gap[0]*this.cols,(null===(e=this.options.gridLayoutOptions)||void 0===e?void 0:e.height)||this.partialHeight*this.rows+this.gap[1]*this.rows),c=u.getContext("2d");(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.backgroundImage)&&(null==c||c.drawImage(null===(r=this.options.gridLayoutOptions)||void 0===r?void 0:r.backgroundImage,0,0,null===(i=this.options.gridLayoutOptions)||void 0===i?void 0:i.width,null===(o=this.options.gridLayoutOptions)||void 0===o?void 0:o.height));for(var l=0;l<this.rows;l++)for(var d=0;d<this.cols;d++)(null===(s=null===(a=this.matrix)||void 0===a?void 0:a[l])||void 0===s?void 0:s[d])&&(null==c||c.drawImage(this.partialCanvas,this.partialWidth*d+this.gap[0]*d,this.partialHeight*l+this.gap[1]*l,this.partialWidth,this.partialHeight));return u},t}(),Pa=function(t,e){return"grid"===t.layout?new Oa(t,e).draw():e},Ea=function(){function t(t){void 0===t&&(t={}),this.parentElement=document.body,this.isCreating=!1,this.props=t,this.options=ca(ca({},ba),t),this.changeParentElement(this.options.parent),this.watermarkCanvas=new Sa(this.props,this.options),xa(this.options.monitorProtection)}return t.prototype.changeOptions=function(){return la(this,arguments,void 0,function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),da(this,function(r){switch(r.label){case 0:return this.initConfigData(t,e),xa(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},t.prototype.create=function(){return la(this,void 0,void 0,function(){var t,e,n,r,i,o,a,s,u,c,l,d;return da(this,function(f){switch(f.label){case 0:return this.isCreating?[2]:(this.isCreating=!0,this.validateUnique()&&this.validateContent()?(t=pa(this.watermarkDom),[4,null===(o=this.watermarkCanvas)||void 0===o?void 0:o.draw()]):(this.isCreating=!1,[2]));case 1:if(f.sent(),this.layoutCanvas=Pa(this.options,null===(a=this.watermarkCanvas)||void 0===a?void 0:a.getCanvas()),e=fa(this.layoutCanvas),null===(s=this.watermarkCanvas)||void 0===s||s.clear(),this.watermarkDom=document.createElement("div"),n=document.createElement("div"),this.watermarkDom.__WATERMARK__="watermark",this.watermarkDom.__WATERMARK__INSTANCE__=this,r=this.checkParentElementType(),this.watermarkDom.style.cssText="\n z-index:".concat(this.options.zIndex,"!important;display:block!important;visibility:visible!important;transform:none!important;scale:none!important;\n ").concat("custom"===r?"top:0!important;bottom:0!important;left:0!important;right:0!important;height:100%!important;pointer-events:none!important;position:absolute!important;":"position:relative!important;","\n "),i=function(t){var e,n,r;if("grid"===t.layout){var i=(null===(e=t.gridLayoutOptions)||void 0===e?void 0:e.cols)||1,o=(null===(n=t.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,a=(null===(r=t.gridLayoutOptions)||void 0===r?void 0:r.gap)||[0,0];return[t.width*i+a[0]*i,t.height*o+a[1]*o]}return[t.width,t.height]}(this.options),n.style.cssText="\n display:block!important;visibility:visible!important;pointer-events:none;top:0;bottom:0;left:0;right:0;transform:none!important;scale:none!important;\n position:".concat("root"===r?"fixed":"absolute","!important;-webkit-print-color-adjust:exact!important;width:100%!important;height:100%!important;\n z-index:").concat(this.options.zIndex,"!important;background-image:url(").concat(e,")!important;background-repeat:").concat(this.options.backgroundRepeat,"!important;\n background-size:").concat(i[0],"px ").concat(i[1],"px!important;background-position:").concat(this.options.backgroundPosition,";\n ").concat(function(t,e){if(!t)return"";var n=6*Math.random()+2,r=2*Math.random()+2;switch(e){case"repeat":return"animation: 200s linear 0s infinite alternate watermark !important;";case"repeat-x":return"animation: ".concat(n,"s linear 0s infinite alternate watermark-vertical !important;'");case"repeat-y":return"animation: ".concat(r,"s linear 0s infinite alternate watermark-horizontal !important;'");case"no-repeat":return"animation: ".concat(n,"s linear 0s infinite alternate watermark-horizontal, ").concat(r,"s linear 0s infinite alternate watermark-vertical !important;");default:return""}}(this.options.movable,this.options.backgroundRepeat),"\n "),this.watermarkDom.appendChild(n),this.parentElement.appendChild(this.watermarkDom),this.options.mutationObserve)try{this.bindMutationObserve()}catch(t){null===(c=(u=this.options).onObserveError)||void 0===c||c.call(u)}return t&&(null===(d=(l=this.options).onSuccess)||void 0===d||d.call(l)),this.isCreating=!1,[2]}})})},t.prototype.destroy=function(){this.remove(),this.watermarkDom=void 0},t.prototype.check=function(){return la(this,void 0,void 0,function(){return da(this,function(t){return[2,this.parentElement.contains(this.watermarkDom)]})})},t.prototype.remove=function(){var t,e,n,r,i,o,a,s;null===(e=(t=this.options).onBeforeDestroy)||void 0===e||e.call(t),null===(n=this.observer)||void 0===n||n.disconnect(),null===(r=this.parentObserve)||void 0===r||r.disconnect(),null===(o=null===(i=this.watermarkDom)||void 0===i?void 0:i.parentNode)||void 0===o||o.removeChild(this.watermarkDom),null===(s=(a=this.options).onDestroyed)||void 0===s||s.call(a)},t.prototype.initConfigData=function(t,e){var n=this;void 0===e&&(e="overwrite"),"append"===e?Object.keys(t).forEach(function(e){n.props&&(n.props[e]=t[e])}):this.props=t,this.options=ca(ca({},ba),this.props),this.changeParentElement(this.options.parent),this.watermarkCanvas=new Sa(this.props,this.options)},t.prototype.changeParentElement=function(t){if("string"==typeof t){var e=document.querySelector(t);e&&(this.parentElement=e)}else this.parentElement=t;this.parentElement||console.error("[WatermarkJsPlus]: please pass a valid parent element.")},t.prototype.validateUnique=function(){var t=!0;return Array.from(this.parentElement.childNodes).forEach(function(e){t&&Object.hasOwnProperty.call(e,"__WATERMARK__")&&(t=!1)}),t},t.prototype.validateContent=function(){switch(this.options.contentType){case"image":return Object.hasOwnProperty.call(this.options,"image");case"multi-line-text":case"rich-text":case"text":return this.options.content.length>0}},t.prototype.checkParentElementType=function(){return["html","body"].includes(this.parentElement.tagName.toLocaleLowerCase())?"root":"custom"},t.prototype.bindMutationObserve=function(){var t=this;this.watermarkDom&&(this.observer=new MutationObserver(function(e){return la(t,void 0,void 0,function(){return da(this,function(t){switch(t.label){case 0:return e.length>0?(this.remove(),[4,this.create()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.observer.observe(this.watermarkDom,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),this.parentObserve=new MutationObserver(function(e){return la(t,void 0,void 0,function(){var t,n,r;return da(this,function(i){switch(i.label){case 0:t=0,n=e,i.label=1;case 1:return t<n.length?(r=n[t],Array.from(r.removedNodes).includes(this.watermarkDom)?(this.remove(),[4,this.create()]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}),this.parentObserve.observe(this.parentElement,{childList:!0}))},t}(),Ta=function(t){function e(e){void 0===e&&(e={});return t.call(this,ca(ca({},e),{globalAlpha:.005,mode:"blind"}))||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ua(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.changeOptions=function(){return la(this,arguments,void 0,function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),da(this,function(r){switch(r.label){case 0:return t.globalAlpha=.005,t.mode="blind",this.initConfigData(t,e),xa(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},e.decode=function(t){var e=t.url,n=void 0===e?"":e,r=t.fillColor,i=void 0===r?"#000":r,o=t.compositeOperation,a=void 0===o?"color-burn":o,s=t.mode,u=void 0===s?"canvas":s,c=t.compositeTimes,l=void 0===c?3:c,d=t.onSuccess;if(n&&"canvas"===u){var f=new Image;f.src=n,f.addEventListener("load",function(){var t=f.width,e=f.height,n=Sa.createCanvas(t,e),r=n.getContext("2d");if(!r)throw new Error("get context error");r.drawImage(f,0,0,t,e),r.globalCompositeOperation=a,r.fillStyle=i;for(var o=0;o<l;o++)r.fillRect(0,0,t,e);var s=fa(n);ha(d)&&(null==d||d(s))})}},e}(Ea),ka=function(){function t(t){var e,n;void 0===t&&(t={}),this.drew=!1,this.props=t,this.options=ca(ca({},ba),t),this.props.crossOrigin&&(null===(e=this.props.dom)||void 0===e||e.setAttribute("crossOrigin","anonymous")),this.watermarkCanvas=new Sa(this.props,this.options),this.originalSrc=null===(n=this.props.dom)||void 0===n?void 0:n.src,this.backgroundImage=this.getBackgroundImage()}return t.prototype.create=function(){return la(this,void 0,void 0,function(){var t,e,n,r,i;return da(this,function(o){switch(o.label){case 0:return this.drew?[2]:[4,null===(t=this.watermarkCanvas)||void 0===t?void 0:t.draw()];case 1:return o.sent(),this.options.layout="grid",this.options.gridLayoutOptions=ca(ca({},this.options.gridLayoutOptions),{width:null===(e=this.backgroundImage)||void 0===e?void 0:e.width,height:null===(n=this.backgroundImage)||void 0===n?void 0:n.height,backgroundImage:this.backgroundImage}),this.layoutCanvas=Pa(this.options,null===(r=this.watermarkCanvas)||void 0===r?void 0:r.getCanvas()),this.options.dom.src=fa(this.layoutCanvas),null===(i=this.watermarkCanvas)||void 0===i||i.clear(),this.drew=!0,[2]}})})},t.prototype.destroy=function(){this.options.dom.src=this.originalSrc,this.drew=!1},t.prototype.getBackgroundImage=function(){if(this.options.dom)return this.options.dom},t}();t.BlindWatermark=Ta,t.ImageWatermark=ka,t.Watermark=Ea});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WatermarkPlus={})}(this,function(t){"use strict";var e,n,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={};function o(){if(n)return e;n=1;var t=function(t){return t&&t.Math===Math&&t};return e=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")()}var a,s,u,c,l,d,f,h,p={};function v(){return s?a:(s=1,a=function(t){try{return!!t()}catch(t){return!0}})}function y(){if(c)return u;c=1;var t=v();return u=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function m(){if(d)return l;d=1;var t=v();return l=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function g(){if(h)return f;h=1;var t=m(),e=Function.prototype.call;return f=t?e.bind(e):function(){return e.apply(e,arguments)},f}var w,b,x,S,O,P,E,T,k,C,A,j,_,R,L,D,I,B,M,N,H,U,F,W,z,G,q,V,X,Y,$,J,K,Z,Q,tt,et,nt,rt,it,ot,at={};function st(){return x?b:(x=1,b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function ut(){if(O)return S;O=1;var t=m(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return S=t?r:function(t){return function(){return n.apply(t,arguments)}},S}function ct(){if(E)return P;E=1;var t=ut(),e=t({}.toString),n=t("".slice);return P=function(t){return n(e(t),8,-1)}}function lt(){return A?C:(A=1,C=function(t){return null==t})}function dt(){if(_)return j;_=1;var t=lt(),e=TypeError;return j=function(n){if(t(n))throw new e("Can't call method on "+n);return n}}function ft(){if(L)return R;L=1;var t=function(){if(k)return T;k=1;var t=ut(),e=v(),n=ct(),r=Object,i=t("".split);return T=e(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?i(t,""):r(t)}:r}(),e=dt();return R=function(n){return t(e(n))}}function ht(){if(I)return D;I=1;var t="object"==typeof document&&document.all;return D=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}function pt(){if(M)return B;M=1;var t=ht();return B=function(e){return"object"==typeof e?null!==e:t(e)}}function vt(){if(H)return N;H=1;var t=o(),e=ht();return N=function(n,r){return arguments.length<2?(i=t[n],e(i)?i:void 0):t[n]&&t[n][r];var i},N}function yt(){if(F)return U;F=1;var t=ut();return U=t({}.isPrototypeOf)}function mt(){if(z)return W;z=1;var t=o().navigator,e=t&&t.userAgent;return W=e?String(e):""}function gt(){if(q)return G;q=1;var t,e,n=o(),r=mt(),i=n.process,a=n.Deno,s=i&&i.versions||a&&a.version,u=s&&s.v8;return u&&(e=(t=u.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(e=+t[1]),G=e}function wt(){if(X)return V;X=1;var t=gt(),e=v(),n=o().String;return V=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function bt(){if($)return Y;$=1;var t=wt();return Y=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function xt(){if(K)return J;K=1;var t=vt(),e=ht(),n=yt(),r=bt(),i=Object;return J=r?function(t){return"symbol"==typeof t}:function(r){var o=t("Symbol");return e(o)&&n(o.prototype,i(r))}}function St(){if(Q)return Z;Q=1;var t=String;return Z=function(e){try{return t(e)}catch(t){return"Object"}}}function Ot(){if(et)return tt;et=1;var t=ht(),e=St(),n=TypeError;return tt=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")}}function Pt(){if(rt)return nt;rt=1;var t=Ot(),e=lt();return nt=function(n,r){var i=n[r];return e(i)?void 0:t(i)}}function Et(){if(ot)return it;ot=1;var t=g(),e=ht(),n=pt(),r=TypeError;return it=function(i,o){var a,s;if("string"===o&&e(a=i.toString)&&!n(s=t(a,i)))return s;if(e(a=i.valueOf)&&!n(s=t(a,i)))return s;if("string"!==o&&e(a=i.toString)&&!n(s=t(a,i)))return s;throw new r("Can't convert object to primitive value")}}var Tt,kt,Ct,At,jt,_t,Rt,Lt,Dt,It,Bt,Mt,Nt,Ht,Ut,Ft,Wt,zt,Gt,qt,Vt,Xt,Yt,$t,Jt={exports:{}};function Kt(){return kt?Tt:(kt=1,Tt=!1)}function Zt(){if(At)return Ct;At=1;var t=o(),e=Object.defineProperty;return Ct=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch(e){t[n]=r}return r}}function Qt(){if(jt)return Jt.exports;jt=1;var t=Kt(),e=o(),n=Zt(),r="__core-js_shared__",i=Jt.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.49.0",mode:t?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Jt.exports}function te(){if(Rt)return _t;Rt=1;var t=Qt();return _t=function(e,n){return t[e]||(t[e]=n||{})}}function ee(){if(Dt)return Lt;Dt=1;var t=dt(),e=Object;return Lt=function(n){return e(t(n))}}function ne(){if(Bt)return It;Bt=1;var t=ut(),e=ee(),n=t({}.hasOwnProperty);return It=Object.hasOwn||function(t,r){return n(e(t),r)}}function re(){if(Nt)return Mt;Nt=1;var t=ut(),e=0,n=Math.random(),r=t(1.1.toString);return Mt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++e+n,36)}}function ie(){if(Ut)return Ht;Ut=1;var t=o(),e=te(),n=ne(),r=re(),i=wt(),a=bt(),s=t.Symbol,u=e("wks"),c=a?s.for||s:s&&s.withoutSetter||r;return Ht=function(t){return n(u,t)||(u[t]=i&&n(s,t)?s[t]:c("Symbol."+t)),u[t]}}function oe(){if(Wt)return Ft;Wt=1;var t=g(),e=pt(),n=xt(),r=Pt(),i=Et(),o=ie(),a=TypeError,s=o("toPrimitive");return Ft=function(o,u){if(!e(o)||n(o))return o;var c,l=r(o,s);if(l){if(void 0===u&&(u="default"),c=t(l,o,u),!e(c)||n(c))return c;throw new a("Can't convert object to primitive value")}return void 0===u&&(u="number"),i(o,u)}}function ae(){if(Gt)return zt;Gt=1;var t=oe(),e=xt();return zt=function(n){var r=t(n,"string");return e(r)?r:r+""}}function se(){if(Vt)return qt;Vt=1;var t=o(),e=pt(),n=t.document,r=e(n)&&e(n.createElement);return qt=function(t){return r?n.createElement(t):{}}}function ue(){if(Yt)return Xt;Yt=1;var t=y(),e=v(),n=se();return Xt=!t&&!e(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function ce(){if($t)return p;$t=1;var t=y(),e=g(),n=function(){if(w)return at;w=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return at.f=n?function(t){var n=e(this,t);return!!n&&n.enumerable}:t,at}(),r=st(),i=ft(),o=ae(),a=ne(),s=ue(),u=Object.getOwnPropertyDescriptor;return p.f=t?u:function(t,c){if(t=i(t),c=o(c),s)try{return u(t,c)}catch(t){}if(a(t,c))return r(!e(n.f,t,c),t[c])},p}var le,de,fe,he,pe,ve,ye,me={};function ge(){if(de)return le;de=1;var t=y(),e=v();return le=t&&e(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function we(){if(he)return fe;he=1;var t=pt(),e=String,n=TypeError;return fe=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")}}function be(){if(pe)return me;pe=1;var t=y(),e=ue(),n=ge(),r=we(),i=ae(),o=TypeError,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return me.f=t?n?function(t,e,n){if(r(t),e=i(e),r(n),"function"==typeof t&&"prototype"===e&&"value"in n&&l in n&&!n[l]){var o=s(t,e);o&&o[l]&&(t[e]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:u in n?n[u]:o[u],writable:!1})}return a(t,e,n)}:a:function(t,n,s){if(r(t),n=i(n),r(s),e)try{return a(t,n,s)}catch(t){}if("get"in s||"set"in s)throw new o("Accessors not supported");return"value"in s&&(t[n]=s.value),t},me}function xe(){if(ye)return ve;ye=1;var t=y(),e=be(),n=st();return ve=t?function(t,r,i){return e.f(t,r,n(1,i))}:function(t,e,n){return t[e]=n,t}}var Se,Oe,Pe,Ee,Te,ke,Ce,Ae,je,_e,Re,Le,De,Ie,Be,Me={exports:{}};function Ne(){if(Ee)return Pe;Ee=1;var t=ut(),e=ht(),n=Qt(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(t){return r(t)}),Pe=n.inspectSource}function He(){if(Ae)return Ce;Ae=1;var t=te(),e=re(),n=t("keys");return Ce=function(t){return n[t]||(n[t]=e(t))}}function Ue(){return _e?je:(_e=1,je={})}function Fe(){if(Le)return Re;Le=1;var t,e,n,r=function(){if(ke)return Te;ke=1;var t=o(),e=ht(),n=t.WeakMap;return Te=e(n)&&/native code/.test(String(n))}(),i=o(),a=pt(),s=xe(),u=ne(),c=Qt(),l=He(),d=Ue(),f="Object already initialized",h=i.TypeError,p=i.WeakMap;if(r||c.state){var v=c.state||(c.state=new p);v.get=v.get,v.has=v.has,v.set=v.set,t=function(t,e){if(v.has(t))throw new h(f);return e.facade=t,v.set(t,e),e},e=function(t){return v.get(t)||{}},n=function(t){return v.has(t)}}else{var y=l("state");d[y]=!0,t=function(t,e){if(u(t,y))throw new h(f);return e.facade=t,s(t,y,e),e},e=function(t){return u(t,y)?t[y]:{}},n=function(t){return u(t,y)}}return Re={set:t,get:e,has:n,enforce:function(r){return n(r)?e(r):t(r,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=e(n)).type!==t)throw new h("Incompatible receiver, "+t+" required");return r}}}}function We(){if(De)return Me.exports;De=1;var t=ut(),e=v(),n=ht(),r=ne(),i=y(),o=function(){if(Oe)return Se;Oe=1;var t=y(),e=ne(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&"something"===function(){}.name,a=i&&(!t||t&&r(n,"name").configurable);return Se={EXISTS:i,PROPER:o,CONFIGURABLE:a}}().CONFIGURABLE,a=Ne(),s=Fe(),u=s.enforce,c=s.get,l=String,d=Object.defineProperty,f=t("".slice),h=t("".replace),p=t([].join),m=i&&!e(function(){return 8!==d(function(){},"length",{value:8}).length}),g=String(String).split("String"),w=Me.exports=function(t,e,n){"Symbol("===f(l(e),0,7)&&(e="["+h(l(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!r(t,"name")||o&&t.name!==e)&&(i?d(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&r(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var a=u(t);return r(a,"source")||(a.source=p(g,"string"==typeof e?e:"")),t};return Function.prototype.toString=w(function(){return n(this)&&c(this).source||a(this)},"toString"),Me.exports}function ze(){if(Be)return Ie;Be=1;var t=ht(),e=be(),n=We(),r=Zt();return Ie=function(i,o,a,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:o;if(t(a)&&n(a,c,s),s.global)u?i[o]=a:r(o,a);else{try{s.unsafe?i[o]&&(u=!0):delete i[o]}catch(t){}u?i[o]=a:e.f(i,o,{value:a,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return i}}var Ge,qe,Ve,Xe,Ye,$e,Je,Ke,Ze,Qe,tn,en,nn,rn,on,an,sn,un={};function cn(){if(Xe)return Ve;Xe=1;var t=function(){if(qe)return Ge;qe=1;var t=Math.ceil,e=Math.floor;return Ge=Math.trunc||function(n){var r=+n;return(r>0?e:t)(r)}}();return Ve=function(e){var n=+e;return n!=n||0===n?0:t(n)}}function ln(){if($e)return Ye;$e=1;var t=cn(),e=Math.max,n=Math.min;return Ye=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)}}function dn(){if(Ke)return Je;Ke=1;var t=cn(),e=Math.min;return Je=function(n){var r=t(n);return r>0?e(r,9007199254740991):0}}function fn(){if(Qe)return Ze;Qe=1;var t=dn();return Ze=function(e){return t(e.length)}}function hn(){if(en)return tn;en=1;var t=ft(),e=ln(),n=fn(),r=function(r){return function(i,o,a){var s=t(i),u=n(s);if(0===u)return!r&&-1;var c,l=e(a,u);if(r&&o!=o){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((r||l in s)&&s[l]===o)return r||l||0;return!r&&-1}};return tn={includes:r(!0),indexOf:r(!1)}}function pn(){if(rn)return nn;rn=1;var t=ut(),e=ne(),n=ft(),r=hn().indexOf,i=Ue(),o=t([].push);return nn=function(t,a){var s,u=n(t),c=0,l=[];for(s in u)!e(i,s)&&e(u,s)&&o(l,s);for(;a.length>c;)e(u,s=a[c++])&&(~r(l,s)||o(l,s));return l}}function vn(){return an?on:(an=1,on=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var yn,mn,gn,wn,bn,xn,Sn,On,Pn,En,Tn,kn,Cn,An,jn,_n,Rn,Ln,Dn,In,Bn,Mn,Nn,Hn,Un,Fn,Wn,zn,Gn,qn,Vn,Xn,Yn,$n,Jn,Kn,Zn,Qn,tr,er,nr,rr,ir={};function or(){if(gn)return mn;gn=1;var t=vt(),e=ut(),n=function(){if(sn)return un;sn=1;var t=pn(),e=vn().concat("length","prototype");return un.f=Object.getOwnPropertyNames||function(n){return t(n,e)},un}(),r=(yn||(yn=1,ir.f=Object.getOwnPropertySymbols),ir),i=we(),o=e([].concat);return mn=t("Reflect","ownKeys")||function(t){var e=n.f(i(t)),a=r.f;return a?o(e,a(t)):e}}function ar(){if(bn)return wn;bn=1;var t=ne(),e=or(),n=ce(),r=be();return wn=function(i,o,a){for(var s=e(o),u=r.f,c=n.f,l=0;l<s.length;l++){var d=s[l];t(i,d)||a&&t(a,d)||u(i,d,c(o,d))}}}function sr(){if(Sn)return xn;Sn=1;var t=v(),e=ht(),n=/#|\.prototype\./,r=function(n,r){var u=o[i(n)];return u===s||u!==a&&(e(r)?t(r):!!r)},i=r.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return xn=r}function ur(){if(Pn)return On;Pn=1;var t=o(),e=ce().f,n=xe(),r=ze(),i=Zt(),a=ar(),s=sr();return On=function(o,u){var c,l,d,f,h,p=o.target,v=o.global,y=o.stat;if(c=v?t:y?t[p]||i(p,{}):t[p]&&t[p].prototype)for(l in u){if(f=u[l],d=o.dontCallGetSet?(h=e(c,l))&&h.value:c[l],!s(v?l:p+(y?".":"#")+l,o.forced)&&void 0!==d){if(typeof f==typeof d)continue;a(f,d)}(o.sham||d&&d.sham)&&n(f,"sham",!0),r(c,l,f,o)}}}function cr(){if(Cn)return kn;Cn=1;var t=function(){if(Tn)return En;Tn=1;var t=ct(),e=ut();return En=function(n){if("Function"===t(n))return e(n)}}(),e=Ot(),n=m(),r=t(t.bind);return kn=function(t,i){return e(t),void 0===i?t:n?r(t,i):function(){return t.apply(i,arguments)}},kn}function lr(){if(jn)return An;jn=1;var t=g(),e=we(),n=Pt();return An=function(r,i,o){var a,s;e(r);try{if(!(a=n(r,"return"))){if("throw"===i)throw o;return o}a=t(a,r)}catch(t){s=!0,a=t}if("throw"===i)throw o;if(s)throw a;return e(a),o}}function dr(){if(Rn)return _n;Rn=1;var t=we(),e=lr();return _n=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(t){e(n,"throw",t)}}}function fr(){return Dn?Ln:(Dn=1,Ln={})}function hr(){if(Bn)return In;Bn=1;var t=ie(),e=fr(),n=t("iterator"),r=Array.prototype;return In=function(t){return void 0!==t&&(e.Array===t||r[n]===t)}}function pr(){if(Un)return Hn;Un=1;var t=function(){if(Nn)return Mn;Nn=1;var t={};return t[ie()("toStringTag")]="z",Mn="[object z]"===String(t)}(),e=ht(),n=ct(),r=ie()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Hn=t?n:function(t){var a,s,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(s=function(t,e){try{return t[e]}catch(t){}}(a=i(t),r))?s:o?n(a):"Object"===(u=n(a))&&e(a.callee)?"Arguments":u}}function vr(){if(Wn)return Fn;Wn=1;var t=ut(),e=v(),n=ht(),r=pr(),i=vt(),o=Ne(),a=function(){},s=i("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=t(u.exec),l=!u.test(a),d=function(t){if(!n(t))return!1;try{return s(a,[],t),!0}catch(t){return!1}},f=function(t){if(!n(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,o(t))}catch(t){return!0}};return f.sham=!0,Fn=!s||e(function(){var t;return d(d.call)||!d(Object)||!d(function(){t=!0})||t})?f:d}function yr(){if(Gn)return zn;Gn=1;var t=y(),e=be(),n=st();return zn=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o}}function mr(){if(Vn)return qn;Vn=1;var t=ct();return qn=Array.isArray||function(e){return"Array"===t(e)}}function gr(){if(Jn)return $n;Jn=1;var t=pr(),e=Pt(),n=lt(),r=fr(),i=ie()("iterator");return $n=function(o){if(!n(o))return e(o,i)||e(o,"@@iterator")||r[t(o)]}}function wr(){if(Zn)return Kn;Zn=1;var t=g(),e=Ot(),n=we(),r=St(),i=gr(),o=TypeError;return Kn=function(a,s){var u=arguments.length<2?i(a):s;if(e(u))return n(t(u,a));throw new o(r(a)+" is not iterable")},Kn}function br(){if(tr)return Qn;tr=1;var t=cr(),e=g(),n=ee(),r=dr(),i=hr(),o=vr(),a=fn(),s=yr(),u=function(){if(Yn)return Xn;Yn=1;var t=y(),e=mr(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return Xn=i?function(t,i){if(e(t)&&!r(t,"length").writable)throw new n("Cannot set read only .length");return t.length=i}:function(t,e){return t.length=e}}(),c=wr(),l=gr(),d=lr(),f=Array;return Qn=function(h){var p=o(this),v=arguments.length,y=v>1?arguments[1]:void 0,m=void 0!==y;m&&(y=t(y,v>2?arguments[2]:void 0));var g,w,b,x,S,O,P=n(h),E=l(P),T=0;if(!E||this===f&&i(E))for(g=a(P),w=p?new this(g):f(g);g>T;T++)O=m?y(P[T],T):P[T],s(w,T,O);else for(w=p?new this:[],S=(x=c(P,E)).next;!(b=e(S,x)).done;T++){O=m?r(x,y,[b.value,T],!0):b.value;try{s(w,T,O)}catch(t){d(x,"throw",t)}}return u(w,T),w},Qn}function xr(){if(nr)return er;nr=1;var t=ie()("iterator"),e=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){e=!0}};r[t]=function(){return this},Array.from(r,function(){throw 2})}catch(t){}return er=function(n,r){try{if(!r&&!e)return!1}catch(t){return!1}var i=!1;try{var o={};o[t]=function(){return{next:function(){return{done:i=!0}}}},n(o)}catch(t){}return i}}!function(){if(rr)return i;rr=1;var t=ur(),e=br();t({target:"Array",stat:!0,forced:!xr()(function(t){Array.from(t)})},{from:e})}();var Sr,Or,Pr,Er,Tr,kr,Cr,Ar,jr,_r,Rr,Lr,Dr,Ir,Br,Mr,Nr,Hr,Ur,Fr,Wr,zr,Gr,qr,Vr,Xr,Yr,$r,Jr,Kr,Zr,Qr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,li,di,fi,hi,pi,vi,yi,mi,gi,wi,bi,xi,Si,Oi,Pi={};function Ei(){if(Or)return Sr;Or=1;var t=o(),e=mt(),n=ct(),r=function(t){return e.slice(0,t.length)===t};return Sr=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function Ti(){if(Er)return Pr;Er=1;var t=Ei();return Pr="NODE"===t}function ki(){if(kr)return Tr;kr=1;var t=o();return Tr=t}function Ci(){if(_r)return jr;_r=1;var t=pt();return jr=function(e){return t(e)||null===e}}function Ai(){if(Lr)return Rr;Lr=1;var t=Ci(),e=String,n=TypeError;return Rr=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function ji(){if(Ir)return Dr;Ir=1;var t=function(){if(Ar)return Cr;Ar=1;var t=ut(),e=Ot();return Cr=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(t){}}}(),e=pt(),n=dt(),r=Ai();return Dr=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,a={};try{(i=t(Object.prototype,"__proto__","set"))(a,[]),o=a instanceof Array}catch(t){}return function(t,a){return n(t),r(a),e(t)?(o?i(t,a):t.__proto__=a,t):t}}():void 0)}function _i(){if(Mr)return Br;Mr=1;var t=be().f,e=ne(),n=ie()("toStringTag");return Br=function(r,i,o){r&&!o&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:i})}}function Ri(){if(Hr)return Nr;Hr=1;var t=We(),e=be();return Nr=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)}}function Li(){if(Fr)return Ur;Fr=1;var t=vt(),e=Ri(),n=ie(),r=y(),i=n("species");return Ur=function(n){var o=t(n);r&&o&&!o[i]&&e(o,i,{configurable:!0,get:function(){return this}})}}function Di(){if(zr)return Wr;zr=1;var t=yt(),e=TypeError;return Wr=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")}}function Ii(){if(qr)return Gr;qr=1;var t=vr(),e=St(),n=TypeError;return Gr=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}function Bi(){if(Xr)return Vr;Xr=1;var t=we(),e=Ii(),n=lt(),r=ie()("species");return Vr=function(i,o){var a,s=t(i).constructor;return void 0===s||n(a=t(s)[r])?o:e(a)}}function Mi(){if($r)return Yr;$r=1;var t=m(),e=Function.prototype,n=e.apply,r=e.call;return Yr="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Yr}function Ni(){if(Kr)return Jr;Kr=1;var t=vt();return Jr=t("document","documentElement")}function Hi(){if(Qr)return Zr;Qr=1;var t=ut();return Zr=t([].slice)}function Ui(){if(ei)return ti;ei=1;var t=TypeError;return ti=function(e,n){if(e<n)throw new t("Not enough arguments");return e}}function Fi(){if(ri)return ni;ri=1;var t=mt();return ni=/ipad|iphone|ipod/i.test(t)&&/applewebkit/i.test(t)}function Wi(){if(oi)return ii;oi=1;var t,e,n,r,i=o(),a=Mi(),s=cr(),u=ht(),c=ne(),l=v(),d=Ni(),f=Hi(),h=se(),p=Ui(),y=Fi(),m=Ti(),g=i.setImmediate,w=i.clearImmediate,b=i.process,x=i.Dispatch,S=i.Function,O=i.MessageChannel,P=i.String,E=0,T={},k="onreadystatechange";l(function(){t=i.location});var C=function(t){if(c(T,t)){var e=T[t];delete T[t],e()}},A=function(t){return function(){C(t)}},j=function(t){C(t.data)},_=function(e){i.postMessage(P(e),t.protocol+"//"+t.host)};return g&&w||(g=function(t){p(arguments.length,1);var n=u(t)?t:S(t),r=f(arguments,1);return T[++E]=function(){a(n,void 0,r)},e(E),E},w=function(t){delete T[t]},m?e=function(t){b.nextTick(A(t))}:x&&x.now?e=function(t){x.now(A(t))}:O&&!y?(r=(n=new O).port2,n.port1.onmessage=j,e=s(r.postMessage,r)):i.addEventListener&&u(i.postMessage)&&!i.importScripts&&t&&"file:"!==t.protocol&&!l(_)?(e=_,i.addEventListener("message",j,!1)):e=k in h("script")?function(t){d.appendChild(h("script"))[k]=function(){d.removeChild(this),C(t)}}:function(t){setTimeout(A(t),0)}),ii={set:g,clear:w}}function zi(){if(si)return ai;si=1;var t=o(),e=y(),n=Object.getOwnPropertyDescriptor;return ai=function(r){if(!e)return t[r];var i=n(t,r);return i&&i.value}}function Gi(){if(ci)return ui;ci=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},ui=t}function qi(){if(vi)return pi;vi=1;var t,e,n,r,i,a=o(),s=zi(),u=cr(),c=Wi().set,l=Gi(),d=Fi(),f=function(){if(di)return li;di=1;var t=mt();return li=/ipad|iphone|ipod/i.test(t)&&"undefined"!=typeof Pebble}(),h=function(){if(hi)return fi;hi=1;var t=mt();return fi=/web0s(?!.*chrome)/i.test(t)}(),p=Ti(),v=a.MutationObserver||a.WebKitMutationObserver,y=a.document,m=a.process,g=a.Promise,w=s("queueMicrotask");if(!w){var b=new l,x=function(){var e,n;for(p&&(e=m.domain)&&e.exit();n=b.get();)try{n()}catch(e){throw b.head&&t(),e}e&&e.enter()};d||p||h||!v||!y?!f&&g&&g.resolve?((r=g.resolve(void 0)).constructor=g,i=u(r.then,r),t=function(){i(x)}):p?t=function(){m.nextTick(x)}:(c=u(c,a),t=function(){c(x)}):(e=!0,n=y.createTextNode(""),new v(x).observe(n,{characterData:!0}),t=function(){n.data=e=!e}),w=function(e){b.head||t(),b.add(e)}}return pi=w}function Vi(){return mi?yi:(mi=1,yi=function(t,e){})}function Xi(){return wi?gi:(wi=1,gi=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}})}function Yi(){if(xi)return bi;xi=1;var t=o();return bi=t.Promise}function $i(){if(Oi)return Si;Oi=1;var t=o(),e=Yi(),n=ht(),r=sr(),i=Ne(),a=ie(),s=Ei(),u=Kt(),c=gt(),l=e&&e.prototype,d=a("species"),f=!1,h=n(t.PromiseRejectionEvent),p=r("Promise",function(){var t=i(e),n=t!==String(e);if(!n&&66===c)return!0;if(u&&(!l.catch||!l.finally))return!0;if(!c||c<51||!/native code/.test(t)){var r=new e(function(t){t(1)}),o=function(t){t(function(){},function(){})};if((r.constructor={})[d]=o,!(f=r.then(function(){})instanceof o))return!0}return!(n||"BROWSER"!==s&&"DENO"!==s||h)});return Si={CONSTRUCTOR:p,REJECTION_EVENT:h,SUBCLASSING:f}}var Ji,Ki,Zi={};function Qi(){if(Ji)return Zi;Ji=1;var t=Ot(),e=TypeError,n=function(n){var r,i;this.promise=new n(function(t,n){if(void 0!==r||void 0!==i)throw new e("Bad Promise constructor");r=t,i=n}),this.resolve=t(r),this.reject=t(i)};return Zi.f=function(t){return new n(t)},Zi}var to,eo,no,ro,io,oo={};function ao(){if(eo)return to;eo=1;var t=cr(),e=g(),n=we(),r=St(),i=hr(),o=fn(),a=yt(),s=wr(),u=gr(),c=lr(),l=TypeError,d=function(t,e){this.stopped=t,this.result=e},f=d.prototype;return to=function(h,p,v){var y,m,g,w,b,x,S,O=v&&v.that,P=!(!v||!v.AS_ENTRIES),E=!(!v||!v.IS_RECORD),T=!(!v||!v.IS_ITERATOR),k=!(!v||!v.INTERRUPTED),C=t(p,O),A=function(t){var e=y;return y=void 0,e&&c(e,"normal"),new d(!0,t)},j=function(t){return P?(n(t),k?C(t[0],t[1],A):C(t[0],t[1])):k?C(t,A):C(t)};if(E)y=h.iterator;else if(T)y=h;else{if(!(m=u(h)))throw new l(r(h)+" is not iterable");if(i(m)){for(g=0,w=o(h);w>g;g++)if((b=j(h[g]))&&a(f,b))return b;return new d(!1)}y=s(h,m)}for(x=E?h.next:y.next;!(S=e(x,y)).done;){var _=S.value;try{b=j(_)}catch(t){if(!y)throw t;c(y,"throw",t)}if("object"==typeof b&&b&&a(f,b))return b}return new d(!1)}}function so(){if(ro)return no;ro=1;var t=Yi(),e=xr(),n=$i().CONSTRUCTOR;return no=n||!e(function(e){t.all(e).then(void 0,function(){})})}var uo,co={};var lo,fo={};var ho,po={};var vo,yo,mo,go,wo={};function bo(){if(yo)return vo;yo=1;var t=we(),e=pt(),n=Qi();return vo=function(r,i){if(t(r),e(i)&&i.constructor===r)return i;var o=n.f(r);return(0,o.resolve)(i),o.promise}}go||(go=1,function(){if(Ki)return Pi;Ki=1;var t,e,n,r,i=ur(),a=Kt(),s=Ti(),u=o(),c=ki(),l=g(),d=ze(),f=ji(),h=_i(),p=Li(),v=Ot(),y=ht(),m=pt(),w=Di(),b=Bi(),x=Wi().set,S=qi(),O=Vi(),P=Xi(),E=Gi(),T=Fe(),k=Yi(),C=$i(),A=Qi(),j="Promise",_=C.CONSTRUCTOR,R=C.REJECTION_EVENT,L=C.SUBCLASSING,D=T.getterFor(j),I=T.set,B=k&&k.prototype,M=k,N=B,H=u.TypeError,U=u.document,F=u.process,W=A.f,z=W,G=!!(U&&U.createEvent&&u.dispatchEvent),q="unhandledrejection",V=function(t){var e;return!(!m(t)||!y(e=t.then))&&e},X=function(t,e){var n,r,i,o=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,d=t.domain;try{s?(a||(2===e.rejection&&Z(e),e.rejection=1),!0===s?n=o:(d&&d.enter(),n=s(o),d&&(d.exit(),i=!0)),n===t.promise?c(new H("Promise-chain cycle")):(r=V(n))?l(r,n,u,c):u(n)):c(o)}catch(t){d&&!i&&d.exit(),c(t)}},Y=function(t,e){t.notified||(t.notified=!0,S(function(){for(var n,r=t.reactions;n=r.get();)X(n,t);t.notified=!1,e&&!t.rejection&&J(t)}))},$=function(t,e,n){var r,i;G?((r=U.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},!R&&(i=u["on"+t])?i(r):t===q&&O("Unhandled promise rejection",n)},J=function(t){l(x,u,function(){var e,n=t.facade,r=t.value;if(K(t)&&(e=P(function(){s?F.emit("unhandledRejection",r,n):$(q,n,r)}),t.rejection=s||K(t)?2:1,e.error))throw e.value})},K=function(t){return 1!==t.rejection&&!t.parent},Z=function(t){l(x,u,function(){var e=t.facade;s?F.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)})},Q=function(t,e,n){return function(r){t(e,r,n)}},tt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Y(t,!0))},et=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new H("Promise can't be resolved itself");var r=V(e);r?S(function(){var n={done:!1};try{l(r,e,Q(et,n,t),Q(tt,n,t))}catch(e){tt(n,e,t)}}):(t.value=e,t.state=1,Y(t,!1))}catch(e){tt({done:!1},e,t)}}};if(_&&(N=(M=function(e){w(this,N),v(e),l(t,this);var n=D(this);try{e(Q(et,n),Q(tt,n))}catch(t){tt(n,t)}}).prototype,(t=function(t){I(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=d(N,"then",function(t,e){var n=D(this),r=W(b(this,M));return n.parent=!0,r.ok=!y(t)||t,r.fail=y(e)&&e,r.domain=s?F.domain:void 0,0===n.state?n.reactions.add(r):S(function(){X(r,n)}),r.promise}),e=function(){var e=new t,n=D(e);this.promise=e,this.resolve=Q(et,n),this.reject=Q(tt,n)},A.f=W=function(t){return t===M||t===n?new e(t):z(t)},!a&&y(k)&&B!==Object.prototype)){r=B.then,L||d(B,"then",function(t,e){var n=this;return new M(function(t,e){l(r,n,t,e)}).then(t,e)},{unsafe:!0});try{delete B.constructor}catch(t){}f&&f(B,N)}i({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:M}),n=c.Promise,h(M,j,!1,!0),p(j)}(),function(){if(io)return oo;io=1;var t=ur(),e=g(),n=Ot(),r=Qi(),i=Xi(),o=ao();t({target:"Promise",stat:!0,forced:so()},{all:function(t){var a=this,s=r.f(a),u=s.resolve,c=s.reject,l=i(function(){var r=n(a.resolve),i=[],s=0,l=1;o(t,function(t){var n=s++,o=!1;l++,e(r,a,t).then(function(t){o||(o=!0,i[n]=t,--l||u(i))},c)}),--l||u(i)});return l.error&&c(l.value),s.promise}})}(),function(){if(uo)return co;uo=1;var t=ur(),e=Kt(),n=$i().CONSTRUCTOR,r=Yi(),i=vt(),o=ht(),a=ze(),s=r&&r.prototype;if(t({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(t){return this.then(void 0,t)}}),!e&&o(r)){var u=i("Promise").prototype.catch;s.catch!==u&&a(s,"catch",u,{unsafe:!0})}}(),function(){if(lo)return fo;lo=1;var t=ur(),e=g(),n=Ot(),r=Qi(),i=Xi(),o=ao();t({target:"Promise",stat:!0,forced:so()},{race:function(t){var a=this,s=r.f(a),u=s.reject,c=i(function(){var r=n(a.resolve);o(t,function(t){e(r,a,t).then(s.resolve,u)})});return c.error&&u(c.value),s.promise}})}(),function(){if(ho)return po;ho=1;var t=ur(),e=Qi();t({target:"Promise",stat:!0,forced:$i().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(mo)return wo;mo=1;var t=ur(),e=vt(),n=Kt(),r=Yi(),i=$i().CONSTRUCTOR,o=bo(),a=e("Promise"),s=n&&!i;t({target:"Promise",stat:!0,forced:n||i},{resolve:function(t){return o(s&&this===a?r:this,t)}})}());var xo,So,Oo,Po,Eo,To,ko,Co,Ao={},jo={};function _o(){if(So)return xo;So=1;var t=pn(),e=vn();return xo=Object.keys||function(n){return t(n,e)}}function Ro(){if(Eo)return Po;Eo=1;var t,e=we(),n=function(){if(Oo)return jo;Oo=1;var t=y(),e=ge(),n=be(),r=we(),i=ft(),o=_o();return jo.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var a,s=i(e),u=o(e),c=u.length,l=0;c>l;)n.f(t,a=u[l++],s[a]);return t},jo}(),r=vn(),i=Ue(),o=Ni(),a=se(),s=He(),u="prototype",c="script",l=s("IE_PROTO"),d=function(){},f=function(t){return"<"+c+">"+t+"</"+c+">"},h=function(t){t.write(f("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,i;p="undefined"!=typeof document?document.domain&&t?h(t):(n=a("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(e=n.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):h(t);for(var s=r.length;s--;)delete p[u][r[s]];return p()};return i[l]=!0,Po=Object.create||function(t,r){var i;return null!==t?(d[u]=e(t),i=new d,d[u]=null,i[l]=t):i=p(),void 0===r?i:n.f(i,r)}}function Lo(){if(ko)return To;ko=1;var t=ie(),e=Ro(),n=be().f,r=t("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:e(null)}),To=function(t){i[r][t]=!0}}!function(){if(Co)return Ao;Co=1;var t=ur(),e=hn().includes,n=v(),r=Lo(),i=n(function(){return!Array(1).includes()}),o=n(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:i||o},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")}();var Do,Io,Bo,Mo={};!function(){if(Bo)return Mo;Bo=1;var t=ur(),e=function(){if(Io)return Do;Io=1;var t=ee(),e=ln(),n=fn();return Do=function(r){for(var i=t(this),o=n(i),a=arguments.length,s=e(a>1?arguments[1]:void 0,o),u=a>2?arguments[2]:void 0,c=void 0===u?o:e(u,o);c>s;)i[s++]=r;return i},Do}(),n=Lo();t({target:"Array",proto:!0},{fill:e}),n("fill")}();var No="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Ho="URLSearchParams"in No,Uo="Symbol"in No&&"iterator"in Symbol,Fo="FileReader"in No&&"Blob"in No&&function(){try{return new Blob,!0}catch(t){return!1}}(),Wo="FormData"in No,zo="ArrayBuffer"in No;if(zo)var Go=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],qo=ArrayBuffer.isView||function(t){return t&&Go.indexOf(Object.prototype.toString.call(t))>-1};function Vo(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Xo(t){return"string"!=typeof t&&(t=String(t)),t}function Yo(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return Uo&&(e[Symbol.iterator]=function(){return e}),e}function $o(t){this.map={},t instanceof $o?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function Jo(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function Ko(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function Zo(t){var e=new FileReader,n=Ko(e);return e.readAsArrayBuffer(t),n}function Qo(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function ta(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Fo&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Wo&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Ho&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():zo&&Fo&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Qo(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):zo&&(ArrayBuffer.prototype.isPrototypeOf(t)||qo(t))?this._bodyArrayBuffer=Qo(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ho&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Fo&&(this.blob=function(){var t=Jo(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=Jo(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Fo)return this.blob().then(Zo);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,o=Jo(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=Ko(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8",e.readAsText(t,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Wo&&(this.formData=function(){return this.text().then(ra)}),this.json=function(){return this.text().then(JSON.parse)},this}$o.prototype.append=function(t,e){t=Vo(t),e=Xo(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},$o.prototype.delete=function(t){delete this.map[Vo(t)]},$o.prototype.get=function(t){return t=Vo(t),this.has(t)?this.map[t]:null},$o.prototype.has=function(t){return this.map.hasOwnProperty(Vo(t))},$o.prototype.set=function(t,e){this.map[Vo(t)]=Xo(e)},$o.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},$o.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),Yo(t)},$o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),Yo(t)},$o.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),Yo(t)},Uo&&($o.prototype[Symbol.iterator]=$o.prototype.entries);var ea=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function na(t,e){if(!(this instanceof na))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(e=e||{}).body;if(t instanceof na){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new $o(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new $o(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),ea.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in No)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function ra(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function ia(t,e){if(!(this instanceof ia))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new $o(e.headers),this.url=e.url||"",this._initBody(t)}na.prototype.clone=function(){return new na(this,{body:this._bodyInit})},ta.call(na.prototype),ta.call(ia.prototype),ia.prototype.clone=function(){return new ia(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new $o(this.headers),url:this.url})},ia.error=function(){var t=new ia(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var oa=[301,302,303,307,308];ia.redirect=function(t,e){if(-1===oa.indexOf(e))throw new RangeError("Invalid status code");return new ia(null,{status:e,headers:{location:t}})};var aa,sa=No.DOMException;try{new sa}catch(t){(sa=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),sa.prototype.constructor=sa}function ua(t,e){return new Promise(function(n,r){var i=new na(t,e);if(i.signal&&i.signal.aborted)return r(new sa("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}if(o.onload=function(){var t,e,r={statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new $o,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{e.append(r,i)}catch(t){}}}),e)};0===i.url.indexOf("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var a="response"in o?o.response:o.responseText;setTimeout(function(){n(new ia(a,r))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new sa("Aborted","AbortError"))},0)},o.open(i.method,function(t){try{return""===t&&No.location.href?No.location.href:t}catch(e){return t}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Fo?o.responseType="blob":zo&&(o.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof $o||No.Headers&&e.headers instanceof No.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach(function(t){s.push(Vo(t)),o.setRequestHeader(t,Xo(e.headers[t]))}),i.headers.forEach(function(t,e){-1===s.indexOf(e)&&o.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){o.setRequestHeader(e,t)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})}ua.polyfill=!0,No.fetch||(No.fetch=ua,No.Headers=$o,No.Request=na,No.Response=ia),"undefined"==typeof CanvasRenderingContext2D||CanvasRenderingContext2D.prototype.resetTransform||(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)});var ca=255,la=function(t,e){return t<=.5?2*t*e:1-2*(1-t)*(1-e)},da=function(t,e){return 1===t?1:0===e?0:1-Math.min(1,(1-t)/e)},fa=function(t,e){var n=(t.canvas.ownerDocument||document).createElement("canvas");n.width=1,n.height=1;var r=n.getContext("2d");if(!r)throw new Error("get context error");if(r.fillStyle=e,"string"==typeof r.fillStyle){var i=function(t){var e=/^#([\da-f]{6})$/i.exec(t);if(e)return{color:[parseInt(e[1].slice(0,2),16),parseInt(e[1].slice(2,4),16),parseInt(e[1].slice(4,6),16)],alpha:1};var n=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/i.exec(t);return n?{color:[Number(n[1]),Number(n[2]),Number(n[3])],alpha:void 0===n[4]?1:Math.max(0,Math.min(1,Number(n[4])))}:void 0}(r.fillStyle);if(i)return i}r.fillRect(0,0,1,1);var o=r.getImageData(0,0,1,1).data;return{color:[o[0],o[1],o[2]],alpha:o[3]/ca}};!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("@keyframes watermark{0%{background-position:0 0}25%{background-position:100% 100%}50%{background-position:100% 0}75%{background-position:0 100%}to{background-position:0 0}}@keyframes watermark-horizontal{0%{background-position-x:0}to{background-position-x:100%}}@keyframes watermark-vertical{0%{background-position-y:0}to{background-position-y:100%}}");var ha=function(t,e){return ha=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ha(t,e)};var pa=function(){return pa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},pa.apply(this,arguments)};function va(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}u((r=r.apply(t,e||[])).next())})}function ya(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var ma=function(t){return t.toDataURL("image/png",1)},ga=function(t){return"function"==typeof t},wa=function(t){return void 0===t},ba=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n="http://www.w3.org/2000/svg");var r=document.createElementNS(n,t);for(var i in e)r.setAttribute(i,e[i]);return r},xa=function(t,e){return va(void 0,void 0,void 0,function(){var n,r,i,o,a,s,u,c,l;return ya(this,function(d){switch(d.label){case 0:return n=ba("svg",{xmlns:"http://www.w3.org/2000/svg"}),(r=document.createElement("div")).setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.style.cssText="\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n font: ".concat(t.font,";\n color: ").concat(e.fontColor,";\n"),r.innerHTML="<div class='rich-text-content'>".concat(e.content,"</div>"),document.body.appendChild(r),[4,Sa(r)];case 1:return d.sent(),i=null===(l=r.querySelector(".rich-text-content"))||void 0===l?void 0:l.getBoundingClientRect(),o=null==i?void 0:i.width,a=null==i?void 0:i.height,document.body.removeChild(r),s=e.richTextWidth||o||e.width,u=e.richTextHeight||a||e.height,n.setAttribute("width",s.toString()),n.setAttribute("height",u.toString()),(c=ba("foreignObject",{width:s.toString(),height:u.toString()})).appendChild(r),n.appendChild(c),[2,{element:n,width:s,height:u}]}})})};function Sa(t){return va(this,void 0,void 0,function(){var e,n,r,i,o;return ya(this,function(a){switch(a.label){case 0:e=t.querySelectorAll("img"),n=function(t){var e,n,r,i;return ya(this,function(o){switch(o.label){case 0:if(!(e=t.getAttribute("src")))return[3,6];o.label=1;case 1:return o.trys.push([1,5,,6]),[4,fetch(e)];case 2:return[4,o.sent().blob()];case 3:return n=o.sent(),[4,new Promise(function(t,e){var r=new FileReader;r.onloadend=function(){return t(r.result)},r.onerror=e,r.readAsDataURL(n)})];case 4:return r=o.sent(),"string"==typeof r&&t.setAttribute("src",r),[3,6];case 5:return i=o.sent(),console.error("Error converting ".concat(e," to base64:"),i),[3,6];case 6:return[2]}})},r=0,i=Array.from(e),a.label=1;case 1:return r<i.length?(o=i[r],[5,n(o)]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[2]}})})}var Oa=function(t,e){return wa(t)?e:t},Pa=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=void 0);var r=new Image;return r.setAttribute("crossOrigin","anonymous"),!wa(e)&&(r.width=e),!wa(n)&&(r.height=n),r.src=t,new Promise(function(t){r.onload=function(){t(r)}})},Ea={width:300,height:300,rotate:45,layout:"default",auxiliaryLine:!1,translatePlacement:"middle",contentType:"text",content:"hello watermark-js-plus",textType:"fill",imageWidth:0,imageHeight:0,lineHeight:30,zIndex:2147483647,backgroundPosition:"0 0",backgroundRepeat:"repeat",fontSize:"20px",fontFamily:"sans-serif",fontStyle:"",fontVariant:"",fontColor:"#000",fontWeight:"normal",filter:"none",letterSpacing:"0px",wordSpacing:"0px",globalAlpha:.5,mode:"default",mutationObserve:!0,monitorProtection:!1,movable:!1,parent:"body",onSuccess:function(){},onBeforeDestroy:function(){},onDestroyed:function(){},onObserveError:function(){}},Ta=function(t){"undefined"!=typeof window&&t&&Object.defineProperty(window,"MutationObserver",{writable:!1,configurable:!1})},ka=function(){function t(e,n){this.props=e,this.options=n,this.canvas=t.createCanvas(this.options.width,this.options.height),this.recommendOptions=function(t,e,n){var r=t.getContext("2d");if(null===r)throw new Error("get context error");r.font="".concat(e.fontStyle," ").concat(e.fontVariant," ").concat(e.fontWeight," ").concat(e.fontSize," ").concat(e.fontFamily),r.filter=e.filter,r.letterSpacing=e.letterSpacing,r.wordSpacing=e.wordSpacing,(null==e?void 0:e.rotate)&&(e.rotate=(360-e.rotate%360)*(Math.PI/180)),wa(n.textRowMaxWidth)&&(e.textRowMaxWidth=e.width);var i={image:{rect:{width:e.imageWidth,height:e.imageHeight},position:{x:0,y:0}},textLine:{data:[],yOffsetValue:0},advancedStyleParams:{linear:{x0:0,x1:0},radial:{x0:0,y0:0,r0:0,x1:0,y1:0,r1:0},conic:{x:0,y:0,startAngle:0},pattern:{}}};switch(e.contentType){case"text":i.textLine.data=[e.content];break;case"multi-line-text":i.textLine.data=function(t,e,n){for(var r=[],i="",o="",a=0,s=e.length;a<s;a++)"\n"!==(o=e.charAt(a))?(i+=o,t.measureText(i).width>n&&(r.push(i.substring(0,i.length-1)),i="",a--)):(r.push(i),i="");return r.push(i),r}(r,e.content,e.textRowMaxWidth)}var o=e.width/2,a=e.height/2,s="middle",u="center";switch(wa(null==n?void 0:n.translateX)||wa(null==n?void 0:n.translateY)?(i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.r0=0,i.advancedStyleParams.radial.r1=e.width/2):(o=null==n?void 0:n.translateX,a=null==n?void 0:n.translateY,s="top",u="left"),n.translatePlacement){case"top":o=e.width/2,a=0,s="top",i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"top-start":o=0,a=0,s="top",u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"top-end":o=e.width,a=0,s="top",u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.y0=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.radial.y1=i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=i.textLine.data.length*e.lineHeight/2;break;case"bottom":o=e.width/2,a=e.height,s="bottom",i.advancedStyleParams.linear.x0=-e.width/2,i.advancedStyleParams.linear.x1=e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=0,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"bottom-start":o=0,a=e.height,s="bottom",u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"bottom-end":o=e.width,a=e.height,s="bottom",u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.y0=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.radial.y1=-i.textLine.data.length*e.lineHeight/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=-i.textLine.data.length*e.lineHeight/2;break;case"left":o=0,a=e.height/2,u="start",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=e.width,i.advancedStyleParams.radial.x0=e.width/2,i.advancedStyleParams.radial.x1=e.width/2,i.advancedStyleParams.conic.x=e.width/2,i.advancedStyleParams.conic.y=0;break;case"right":o=e.width,a=e.height/2,u="end",i.advancedStyleParams.linear.x0=0,i.advancedStyleParams.linear.x1=-e.width,i.advancedStyleParams.radial.x0=-e.width/2,i.advancedStyleParams.radial.x1=-e.width/2,i.advancedStyleParams.conic.x=-e.width/2,i.advancedStyleParams.conic.y=0}if(e.translateX=o,e.translateY=a,wa(null==n?void 0:n.textBaseline)&&(e.textBaseline=s),wa(null==n?void 0:n.textAlign)&&(e.textAlign=u),["text","multi-line-text"].includes(e.contentType))switch(e.textBaseline){case"middle":i.textLine.yOffsetValue=(i.textLine.data.length-1)*e.lineHeight/2;break;case"bottom":case"alphabetic":case"ideographic":i.textLine.yOffsetValue=(i.textLine.data.length-1)*e.lineHeight+(e.lineHeight-parseInt(e.fontSize))/2;break;case"top":case"hanging":i.textLine.yOffsetValue=-e.lineHeight/2+parseInt(e.fontSize)/2}return i}(this.canvas,this.options,this.props)}return t.createCanvas=function(t,e){var n,r=window.devicePixelRatio||1,i=document.createElement("canvas");return i.width=t*r,i.height=e*r,i.style.width="".concat(t,"px"),i.style.height="".concat(e,"px"),null===(n=i.getContext("2d"))||void 0===n||n.setTransform(r,0,0,r,0,0),i},t.clearCanvas=function(t){var e=t.getContext("2d");if(null===e)throw new Error("get context error");e.restore(),e.resetTransform(),e.clearRect(0,0,t.width,t.height);var n=window.devicePixelRatio||1;e.setTransform(n,0,0,n,0,0)},t.prototype.getCanvas=function(){return this.canvas},t.prototype.clear=function(){t.clearCanvas(this.canvas)},t.prototype.draw=function(){var t=this,e=this.canvas.getContext("2d");if(null===e)throw new Error("get context error");return this.options.auxiliaryLine&&(e.beginPath(),e.rect(0,0,this.options.width,this.options.height),e.lineWidth=1,e.strokeStyle="#000",e.stroke(),e.closePath(),e.beginPath(),e.rect(this.options.translateX,this.options.translateY,1,1),e.lineWidth=1,e.strokeStyle="#f00",e.stroke(),e.closePath()),this.setStyle(e),e.save(),e.translate(this.options.translateX,this.options.translateY),e.rotate(this.options.rotate),new Promise(function(n){switch(t.options.contentType){case"text":t.drawText(e,n);break;case"image":t.drawImage(e,n);break;case"multi-line-text":t.drawMultiLineText(e,n);break;case"rich-text":t.drawRichText(e,n)}})},t.prototype.setStyle=function(t){var e,n="fillStyle";"stroke"===this.options.textType&&(n="strokeStyle");var r=this.options.fontColor;if(null===(e=this.options)||void 0===e?void 0:e.advancedStyle)switch(this.options.advancedStyle.type){case"linear":r=this.createLinearGradient(t);break;case"radial":r=this.createRadialGradient(t);break;case"conic":r=this.createConicGradient(t);break;case"pattern":r=this.createPattern(t)}t[n]&&r&&(t[n]=r),this.options.textAlign&&(t.textAlign=this.options.textAlign),this.options.textBaseline&&(t.textBaseline=this.options.textBaseline),t.globalAlpha=this.options.globalAlpha,this.options.shadowStyle&&(t.shadowBlur=Oa(this.options.shadowStyle.shadowBlur,0),t.shadowColor=Oa(this.options.shadowStyle.shadowColor,"#00000000"),t.shadowOffsetX=Oa(this.options.shadowStyle.shadowOffsetX,0),t.shadowOffsetY=Oa(this.options.shadowStyle.shadowOffsetY,0)),ga(this.options.extraDrawFunc)&&this.options.extraDrawFunc(t)},t.prototype.createLinearGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y=t.createLinearGradient(Oa(null===(r=null===(n=null===(e=this.options.advancedStyle)||void 0===e?void 0:e.params)||void 0===n?void 0:n.linear)||void 0===r?void 0:r.x0,this.recommendOptions.advancedStyleParams.linear.x0),Oa(null===(a=null===(o=null===(i=this.options.advancedStyle)||void 0===i?void 0:i.params)||void 0===o?void 0:o.linear)||void 0===a?void 0:a.y0,0),Oa(null===(c=null===(u=null===(s=this.options.advancedStyle)||void 0===s?void 0:s.params)||void 0===u?void 0:u.linear)||void 0===c?void 0:c.x1,this.recommendOptions.advancedStyleParams.linear.x1),Oa(null===(f=null===(d=null===(l=this.options.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.linear)||void 0===f?void 0:f.y1,0));return null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.colorStops)||void 0===v||v.forEach(function(t){y.addColorStop(t.offset,t.color)}),y},t.prototype.createConicGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y=t.createConicGradient(Oa(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.conic)||void 0===i?void 0:i.startAngle,0),Oa(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.conic)||void 0===u?void 0:u.x,this.recommendOptions.advancedStyleParams.conic.x),Oa(null===(f=null===(d=null===(l=null===(c=this.options)||void 0===c?void 0:c.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.conic)||void 0===f?void 0:f.y,this.recommendOptions.advancedStyleParams.conic.y));return null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.colorStops)||void 0===v||v.forEach(function(t){y.addColorStop(t.offset,t.color)}),y},t.prototype.createRadialGradient=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,h,p,v,y,m,g,w,b,x,S,O,P,E,T,k,C=t.createRadialGradient(Oa(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.radial)||void 0===i?void 0:i.x0,this.recommendOptions.advancedStyleParams.radial.x0),Oa(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.radial)||void 0===u?void 0:u.y0,this.recommendOptions.advancedStyleParams.radial.y0),Oa(null===(f=null===(d=null===(l=null===(c=this.options)||void 0===c?void 0:c.advancedStyle)||void 0===l?void 0:l.params)||void 0===d?void 0:d.radial)||void 0===f?void 0:f.r0,this.recommendOptions.advancedStyleParams.radial.r0),Oa(null===(y=null===(v=null===(p=null===(h=this.options)||void 0===h?void 0:h.advancedStyle)||void 0===p?void 0:p.params)||void 0===v?void 0:v.radial)||void 0===y?void 0:y.x1,this.recommendOptions.advancedStyleParams.radial.x1),Oa(null===(b=null===(w=null===(g=null===(m=this.options)||void 0===m?void 0:m.advancedStyle)||void 0===g?void 0:g.params)||void 0===w?void 0:w.radial)||void 0===b?void 0:b.y1,this.recommendOptions.advancedStyleParams.radial.y1),Oa(null===(P=null===(O=null===(S=null===(x=this.options)||void 0===x?void 0:x.advancedStyle)||void 0===S?void 0:S.params)||void 0===O?void 0:O.radial)||void 0===P?void 0:P.r1,this.recommendOptions.advancedStyleParams.radial.r1));return null===(k=null===(T=null===(E=this.options)||void 0===E?void 0:E.advancedStyle)||void 0===T?void 0:T.colorStops)||void 0===k||k.forEach(function(t){C.addColorStop(t.offset,t.color)}),C},t.prototype.createPattern=function(t){var e,n,r,i,o,a,s,u;return t.createPattern(null===(i=null===(r=null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedStyle)||void 0===n?void 0:n.params)||void 0===r?void 0:r.pattern)||void 0===i?void 0:i.image,(null===(u=null===(s=null===(a=null===(o=this.options)||void 0===o?void 0:o.advancedStyle)||void 0===a?void 0:a.params)||void 0===s?void 0:s.pattern)||void 0===u?void 0:u.repetition)||"")},t.prototype.setText=function(t,e){var n="fillText";"stroke"===this.options.textType&&(n="strokeText"),t[n]&&t[n](e.text,e.x,e.y,e.maxWidth)},t.prototype.drawText=function(t,e){this.setText(t,{text:this.options.content,x:0,y:0-this.recommendOptions.textLine.yOffsetValue,maxWidth:this.options.textRowMaxWidth||this.options.width}),e(t.canvas)},t.prototype.drawImage=function(t,e){var n=this;Pa(this.options.image).then(function(r){var i=n.getImageRect(r),o=i.width,a=i.height,s=n.getDrawImagePosition(o,a);t.drawImage(r,s.x,s.y,o,a),e(t.canvas)})},t.prototype.drawMultiLineText=function(t,e){var n=this,r=this.recommendOptions.textLine.data,i=this.recommendOptions.textLine.yOffsetValue;r.forEach(function(e,r){n.setText(t,{text:e,x:0,y:n.options.lineHeight*r-i,maxWidth:n.options.textRowMaxWidth||n.options.width})}),e(t.canvas)},t.prototype.drawRichText=function(t,e){return va(this,void 0,void 0,function(){var n,r=this;return ya(this,function(i){switch(i.label){case 0:return[4,xa(t,this.options)];case 1:return n=i.sent(),Pa((o=n.element,a=o.outerHTML.replace(/<(img|br|input|hr|embed)(.*?)>/g,"<$1$2/>").replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23"),"data:image/svg+xml;charset=utf-8,".concat(a)),n.width,n.height).then(function(n){var i=r.getDrawImagePosition(n.width,n.height);t.drawImage(n,i.x,i.y,n.width,n.height),e(t.canvas)}),[2]}var o,a})})},t.prototype.getImageRect=function(t){var e={width:this.options.imageWidth||0,height:this.options.imageHeight||0};switch(!0){case 0!==e.width&&0===e.height:e.height=e.width*t.height/t.width;break;case 0===e.width&&0!==e.height:e.width=e.height*t.width/t.height;break;case 0===e.width&&0===e.height:e.width=t.width,e.height=t.height}return e},t.prototype.getDrawImagePosition=function(t,e){var n,r,i={x:-t/2,y:-e/2};switch(this.options.translatePlacement){case"top":i.x=-t/2,i.y=0;break;case"top-start":i.x=0,i.y=0;break;case"top-end":i.x=-t,i.y=0;break;case"bottom":i.x=-t/2,i.y=-e;break;case"bottom-start":i.x=0,i.y=-e;break;case"bottom-end":i.x=-t,i.y=-e;break;case"left":i.x=0,i.y=-e/2;break;case"right":i.x=-t,i.y=-e/2}return!wa(null===(n=this.props)||void 0===n?void 0:n.translateX)&&(i.x=0),!wa(null===(r=this.props)||void 0===r?void 0:r.translateY)&&(i.y=0),i},t}(),Ca=function(){function t(t,e){var n,r,i,o,a,s,u;this.options=t,this.partialWidth=this.options.width,this.partialHeight=this.options.height,this.rows=(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,this.cols=(null===(r=this.options.gridLayoutOptions)||void 0===r?void 0:r.cols)||1,this.matrix=(null===(i=this.options.gridLayoutOptions)||void 0===i?void 0:i.matrix)||(a=this.rows,s=this.cols,u=1,Array.from({length:a},function(){return new Array(s).fill(u)})),this.gap=(null===(o=this.options.gridLayoutOptions)||void 0===o?void 0:o.gap)||[0,0],this.partialCanvas=e}return t.prototype.draw=function(){var t,e,n,r,i,o,a,s,u=ka.createCanvas((null===(t=this.options.gridLayoutOptions)||void 0===t?void 0:t.width)||this.partialWidth*this.cols+this.gap[0]*this.cols,(null===(e=this.options.gridLayoutOptions)||void 0===e?void 0:e.height)||this.partialHeight*this.rows+this.gap[1]*this.rows),c=u.getContext("2d");(null===(n=this.options.gridLayoutOptions)||void 0===n?void 0:n.backgroundImage)&&(null==c||c.drawImage(null===(r=this.options.gridLayoutOptions)||void 0===r?void 0:r.backgroundImage,0,0,null===(i=this.options.gridLayoutOptions)||void 0===i?void 0:i.width,null===(o=this.options.gridLayoutOptions)||void 0===o?void 0:o.height));for(var l=0;l<this.rows;l++)for(var d=0;d<this.cols;d++)(null===(s=null===(a=this.matrix)||void 0===a?void 0:a[l])||void 0===s?void 0:s[d])&&(null==c||c.drawImage(this.partialCanvas,this.partialWidth*d+this.gap[0]*d,this.partialHeight*l+this.gap[1]*l,this.partialWidth,this.partialHeight));return u},t}(),Aa=function(t,e){return"grid"===t.layout?new Ca(t,e).draw():e},ja=function(){function t(t){void 0===t&&(t={}),this.parentElement=document.body,this.isCreating=!1,this.props=t,this.options=pa(pa({},Ea),t),this.changeParentElement(this.options.parent),this.watermarkCanvas=new ka(this.props,this.options),Ta(this.options.monitorProtection)}return t.prototype.changeOptions=function(){return va(this,arguments,void 0,function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),ya(this,function(r){switch(r.label){case 0:return this.initConfigData(t,e),Ta(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},t.prototype.create=function(){return va(this,void 0,void 0,function(){var t,e,n,r,i,o,a,s,u,c,l,d;return ya(this,function(f){switch(f.label){case 0:if(this.isCreating)return[2];this.isCreating=!0,f.label=1;case 1:return f.trys.push([1,,3,4]),this.validateUnique()?this.validateContent()?(t=wa(this.watermarkDom),[4,null===(o=this.watermarkCanvas)||void 0===o?void 0:o.draw()]):[2]:[2];case 2:if(f.sent(),this.layoutCanvas=Aa(this.options,null===(a=this.watermarkCanvas)||void 0===a?void 0:a.getCanvas()),e=ma(this.layoutCanvas),null===(s=this.watermarkCanvas)||void 0===s||s.clear(),this.watermarkDom=document.createElement("div"),n=document.createElement("div"),this.watermarkDom.__WATERMARK__="watermark",this.watermarkDom.__WATERMARK__INSTANCE__=this,r=this.checkParentElementType(),this.watermarkDom.style.cssText="\n z-index:".concat(this.options.zIndex,"!important;display:block!important;visibility:visible!important;transform:none!important;scale:none!important;\n ").concat("custom"===r?"top:0!important;bottom:0!important;left:0!important;right:0!important;height:100%!important;pointer-events:none!important;position:absolute!important;":"position:relative!important;","\n "),i=function(t){var e,n,r;if("grid"===t.layout){var i=(null===(e=t.gridLayoutOptions)||void 0===e?void 0:e.cols)||1,o=(null===(n=t.gridLayoutOptions)||void 0===n?void 0:n.rows)||1,a=(null===(r=t.gridLayoutOptions)||void 0===r?void 0:r.gap)||[0,0];return[t.width*i+a[0]*i,t.height*o+a[1]*o]}return[t.width,t.height]}(this.options),n.style.cssText="\n display:block!important;visibility:visible!important;pointer-events:none;top:0;bottom:0;left:0;right:0;transform:none!important;scale:none!important;\n position:".concat("root"===r?"fixed":"absolute","!important;-webkit-print-color-adjust:exact!important;width:100%!important;height:100%!important;\n z-index:").concat(this.options.zIndex,"!important;background-image:url(").concat(e,")!important;background-repeat:").concat(this.options.backgroundRepeat,"!important;\n background-size:").concat(i[0],"px ").concat(i[1],"px!important;background-position:").concat(this.options.backgroundPosition,";\n ").concat(function(t,e){if(!t)return"";var n=6*Math.random()+2,r=2*Math.random()+2;switch(e){case"repeat":return"animation: 200s linear 0s infinite alternate watermark !important;";case"repeat-x":return"animation: ".concat(n,"s linear 0s infinite alternate watermark-vertical !important;'");case"repeat-y":return"animation: ".concat(r,"s linear 0s infinite alternate watermark-horizontal !important;'");case"no-repeat":return"animation: ".concat(n,"s linear 0s infinite alternate watermark-horizontal, ").concat(r,"s linear 0s infinite alternate watermark-vertical !important;");default:return""}}(this.options.movable,this.options.backgroundRepeat),"\n "),this.watermarkDom.appendChild(n),this.parentElement.appendChild(this.watermarkDom),this.options.mutationObserve)try{this.bindMutationObserver()}catch(t){null===(c=(u=this.options).onObserveError)||void 0===c||c.call(u)}return t&&(null===(d=(l=this.options).onSuccess)||void 0===d||d.call(l)),[3,4];case 3:return this.isCreating=!1,[7];case 4:return[2]}})})},t.prototype.destroy=function(){this.remove(),this.watermarkDom=void 0},t.prototype.check=function(){return va(this,void 0,void 0,function(){return ya(this,function(t){return[2,this.parentElement.contains(this.watermarkDom)]})})},t.prototype.remove=function(){var t,e,n,r,i,o,a,s;null===(e=(t=this.options).onBeforeDestroy)||void 0===e||e.call(t),null===(n=this.observer)||void 0===n||n.disconnect(),null===(r=this.parentObserver)||void 0===r||r.disconnect(),null===(o=null===(i=this.watermarkDom)||void 0===i?void 0:i.parentNode)||void 0===o||o.removeChild(this.watermarkDom),null===(s=(a=this.options).onDestroyed)||void 0===s||s.call(a)},t.prototype.initConfigData=function(t,e){var n=this;void 0===e&&(e="overwrite"),"append"===e?Object.keys(t).forEach(function(e){n.props&&(n.props[e]=t[e])}):this.props=t,this.options=pa(pa({},Ea),this.props),this.changeParentElement(this.options.parent),this.watermarkCanvas=new ka(this.props,this.options)},t.prototype.changeParentElement=function(t){if("string"==typeof t){var e=document.querySelector(t);e&&(this.parentElement=e)}else this.parentElement=t;this.parentElement||console.error("[WatermarkJsPlus]: please pass a valid parent element.")},t.prototype.validateUnique=function(){var t=!0;return Array.from(this.parentElement.childNodes).forEach(function(e){t&&Object.hasOwnProperty.call(e,"__WATERMARK__")&&(t=!1)}),t},t.prototype.validateContent=function(){switch(this.options.contentType){case"image":return Object.hasOwnProperty.call(this.options,"image");case"multi-line-text":case"rich-text":case"text":return this.options.content.length>0}},t.prototype.checkParentElementType=function(){return["html","body"].includes(this.parentElement.tagName.toLocaleLowerCase())?"root":"custom"},t.prototype.recreateOnMutation=function(){return va(this,void 0,void 0,function(){var t,e;return ya(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.remove(),[4,this.create()];case 1:return n.sent(),[3,3];case 2:return n.sent(),null===(e=(t=this.options).onObserveError)||void 0===e||e.call(t),[3,3];case 3:return[2]}})})},t.prototype.bindMutationObserver=function(){var t=this;this.watermarkDom&&(this.observer=new MutationObserver(function(e){e.length>0&&t.recreateOnMutation()}),this.observer.observe(this.watermarkDom,{attributes:!0,attributeFilter:["style","class","hidden","id"],childList:!0,subtree:!0,characterData:!0}),this.parentObserver=new MutationObserver(function(e){var n=t.watermarkDom;n&&(e.some(function(t){return Array.from(t.removedNodes).includes(n)})&&t.recreateOnMutation())}),this.parentObserver.observe(this.parentElement,{childList:!0}))},t}(),_a=function(t){function e(e){void 0===e&&(e={});return t.call(this,pa(pa({},e),{globalAlpha:.005,mode:"blind"}))||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ha(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.changeOptions=function(){return va(this,arguments,void 0,function(t,e,n){return void 0===t&&(t={}),void 0===e&&(e="overwrite"),void 0===n&&(n=!0),ya(this,function(r){switch(r.label){case 0:return t.globalAlpha=.005,t.mode="blind",this.initConfigData(t,e),Ta(this.options.monitorProtection),n?(this.remove(),[4,this.create()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},e.decode=function(t){var e=t.url,n=void 0===e?"":e,r=t.fillColor,i=void 0===r?"#000":r,o=t.compositeOperation,a=void 0===o?"color-burn":o,s=t.mode,u=void 0===s?"canvas":s,c=t.compositeTimes,l=void 0===c?3:c,d=t.onSuccess;if(n&&"canvas"===u){var f=new Image;f.src=n,f.addEventListener("load",function(){var t=f.width,e=f.height,n=ka.createCanvas(t,e),r=n.getContext("2d");if(!r)throw new Error("get context error");r.drawImage(f,0,0,t,e),function(t){var e=t.ctx,n=t.width,r=t.height,i=t.fillColor,o=t.compositeOperation,a=t.compositeTimes;if(a>0){var s=e.globalCompositeOperation;if(e.globalCompositeOperation=o,e.globalCompositeOperation!==o&&aa)return e.globalCompositeOperation=s,void aa({ctx:e,fillColor:i,compositeOperation:o,compositeTimes:a});e.fillStyle=i;for(var u=0;u<a;u++)e.fillRect(0,0,n,r)}}({ctx:r,width:t,height:e,fillColor:i,compositeOperation:a,compositeTimes:l});var o=ma(n);ga(d)&&(null==d||d(o))})}},e}(ja),Ra=function(){function t(t){var e,n;void 0===t&&(t={}),this.drew=!1,this.props=t,this.options=pa(pa({},Ea),t),this.props.crossOrigin&&(null===(e=this.props.dom)||void 0===e||e.setAttribute("crossOrigin","anonymous")),this.watermarkCanvas=new ka(this.props,this.options),this.originalSrc=null===(n=this.props.dom)||void 0===n?void 0:n.src,this.backgroundImage=this.getBackgroundImage()}return t.prototype.create=function(){return va(this,void 0,void 0,function(){var t,e,n,r,i;return ya(this,function(o){switch(o.label){case 0:return this.drew?[2]:[4,null===(t=this.watermarkCanvas)||void 0===t?void 0:t.draw()];case 1:return o.sent(),this.options.layout="grid",this.options.gridLayoutOptions=pa(pa({},this.options.gridLayoutOptions),{width:null===(e=this.backgroundImage)||void 0===e?void 0:e.width,height:null===(n=this.backgroundImage)||void 0===n?void 0:n.height,backgroundImage:this.backgroundImage}),this.layoutCanvas=Aa(this.options,null===(r=this.watermarkCanvas)||void 0===r?void 0:r.getCanvas()),this.options.dom.src=ma(this.layoutCanvas),null===(i=this.watermarkCanvas)||void 0===i||i.clear(),this.drew=!0,[2]}})})},t.prototype.destroy=function(){this.options.dom.src=this.originalSrc,this.drew=!1},t.prototype.getBackgroundImage=function(){if(this.options.dom)return this.options.dom},t}();aa=function(t){var e=t.ctx,n=t.fillColor,r=t.compositeOperation,i=t.compositeTimes,o=function(t){switch(t){case"overlay":return la;case"color-burn":return da;default:throw new Error("Unsupported blind watermark composite operation: ".concat(t))}}(r),a=fa(e,n),s=a.color,u=a.alpha;if(0!==u&&i>0){var c=e.getImageData(0,0,e.canvas.width,e.canvas.height),l=[s[0]/ca,s[1]/ca,s[2]/ca];1===u&&function(t){for(var e=3;e<t.length;e+=4)if(t[e]!==ca)return!1;return!0}(c.data)?function(t,e,n,r){var i=0===e[0]&&0===e[1]&&0===e[2],o=1===e[0]&&1===e[1]&&1===e[2];if("color-burn"===n&&(i||o)){if(i)for(var a=0;a<t.length;a+=4)for(var s=0;s<3;s++)t[a+s]=t[a+s]===ca?ca:0;return!0}if("overlay"!==n||!i&&!o)return!1;var u=Math.ceil(r),c=Math.pow(2,Math.min(u,8));for(a=0;a<t.length;a+=4)for(s=0;s<3;s++){var l=t[a+s];t[a+s]=i?Math.max(0,c*l-ca*(c-1)):Math.min(ca,c*l)}return!0}(c.data,l,r,i)||function(t,e,n,r){for(var i=0;i<n;i++)for(var o=0;o<t.length;o+=4)for(var a=0;a<3;a++)t[o+a]=r(t[o+a]/ca,e[a])*ca}(c.data,l,i,o):function(t,e,n,r,i){for(var o=0;o<r;o++)for(var a=0;a<t.length;a+=4){for(var s=t[a+3]/ca,u=n+s*(1-n),c=0;c<3;c++){var l=t[a+c]/ca,d=n*((1-s)*e[c]+s*i(l,e[c]))+s*(1-n)*l;t[a+c]=0===u?0:d/u*ca}t[a+3]=u*ca}}(c.data,l,u,i,o),e.putImageData(c,0,0)}},t.BlindWatermark=_a,t.ImageWatermark=Ra,t.Watermark=ja});
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* watermark-js-plus v1.6.
|
|
2
|
+
* watermark-js-plus v1.6.6
|
|
3
3
|
* (c) 2022-2024 Michael Sun
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1009,17 +1009,18 @@ var Watermark = /** @class */ (function () {
|
|
|
1009
1009
|
return [2 /*return*/];
|
|
1010
1010
|
}
|
|
1011
1011
|
this.isCreating = true;
|
|
1012
|
+
_h.label = 1;
|
|
1013
|
+
case 1:
|
|
1014
|
+
_h.trys.push([1, , 3, 4]);
|
|
1012
1015
|
if (!this.validateUnique()) {
|
|
1013
|
-
this.isCreating = false;
|
|
1014
1016
|
return [2 /*return*/];
|
|
1015
1017
|
}
|
|
1016
1018
|
if (!this.validateContent()) {
|
|
1017
|
-
this.isCreating = false;
|
|
1018
1019
|
return [2 /*return*/];
|
|
1019
1020
|
}
|
|
1020
1021
|
firstDraw = isUndefined(this.watermarkDom);
|
|
1021
1022
|
return [4 /*yield*/, ((_a = this.watermarkCanvas) === null || _a === void 0 ? void 0 : _a.draw())];
|
|
1022
|
-
case
|
|
1023
|
+
case 2:
|
|
1023
1024
|
_h.sent();
|
|
1024
1025
|
this.layoutCanvas = renderLayout(this.options, (_b = this.watermarkCanvas) === null || _b === void 0 ? void 0 : _b.getCanvas());
|
|
1025
1026
|
image = convertImage(this.layoutCanvas);
|
|
@@ -1029,22 +1030,25 @@ var Watermark = /** @class */ (function () {
|
|
|
1029
1030
|
this.watermarkDom.__WATERMARK__ = 'watermark';
|
|
1030
1031
|
this.watermarkDom.__WATERMARK__INSTANCE__ = this;
|
|
1031
1032
|
parentElementType = this.checkParentElementType();
|
|
1032
|
-
this.watermarkDom.style.cssText = "\n
|
|
1033
|
+
this.watermarkDom.style.cssText = "\n z-index:".concat(this.options.zIndex, "!important;display:block!important;visibility:visible!important;transform:none!important;scale:none!important;\n ").concat(parentElementType === 'custom' ? 'top:0!important;bottom:0!important;left:0!important;right:0!important;height:100%!important;pointer-events:none!important;position:absolute!important;' : 'position:relative!important;', "\n ");
|
|
1033
1034
|
backgroundSize = generateBackgroundSize(this.options);
|
|
1034
|
-
watermarkInnerDom.style.cssText = "\n
|
|
1035
|
+
watermarkInnerDom.style.cssText = "\n display:block!important;visibility:visible!important;pointer-events:none;top:0;bottom:0;left:0;right:0;transform:none!important;scale:none!important;\n position:".concat(parentElementType === 'root' ? 'fixed' : 'absolute', "!important;-webkit-print-color-adjust:exact!important;width:100%!important;height:100%!important;\n z-index:").concat(this.options.zIndex, "!important;background-image:url(").concat(image, ")!important;background-repeat:").concat(this.options.backgroundRepeat, "!important;\n background-size:").concat(backgroundSize[0], "px ").concat(backgroundSize[1], "px!important;background-position:").concat(this.options.backgroundPosition, ";\n ").concat(generateAnimationStyle(this.options.movable, this.options.backgroundRepeat), "\n ");
|
|
1035
1036
|
this.watermarkDom.appendChild(watermarkInnerDom);
|
|
1036
1037
|
this.parentElement.appendChild(this.watermarkDom);
|
|
1037
1038
|
if (this.options.mutationObserve) {
|
|
1038
1039
|
try {
|
|
1039
|
-
this.
|
|
1040
|
+
this.bindMutationObserver();
|
|
1040
1041
|
}
|
|
1041
1042
|
catch (_j) {
|
|
1042
1043
|
(_e = (_d = this.options).onObserveError) === null || _e === void 0 ? void 0 : _e.call(_d);
|
|
1043
1044
|
}
|
|
1044
1045
|
}
|
|
1045
1046
|
firstDraw && ((_g = (_f = this.options).onSuccess) === null || _g === void 0 ? void 0 : _g.call(_f));
|
|
1047
|
+
return [3 /*break*/, 4];
|
|
1048
|
+
case 3:
|
|
1046
1049
|
this.isCreating = false;
|
|
1047
|
-
return [
|
|
1050
|
+
return [7 /*endfinally*/];
|
|
1051
|
+
case 4: return [2 /*return*/];
|
|
1048
1052
|
}
|
|
1049
1053
|
});
|
|
1050
1054
|
});
|
|
@@ -1067,7 +1071,7 @@ var Watermark = /** @class */ (function () {
|
|
|
1067
1071
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1068
1072
|
(_b = (_a = this.options).onBeforeDestroy) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1069
1073
|
(_c = this.observer) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
1070
|
-
(_d = this.
|
|
1074
|
+
(_d = this.parentObserver) === null || _d === void 0 ? void 0 : _d.disconnect();
|
|
1071
1075
|
(_f = (_e = this.watermarkDom) === null || _e === void 0 ? void 0 : _e.parentNode) === null || _f === void 0 ? void 0 : _f.removeChild(this.watermarkDom);
|
|
1072
1076
|
(_h = (_g = this.options).onDestroyed) === null || _h === void 0 ? void 0 : _h.call(_g);
|
|
1073
1077
|
};
|
|
@@ -1127,62 +1131,76 @@ var Watermark = /** @class */ (function () {
|
|
|
1127
1131
|
}
|
|
1128
1132
|
return 'custom';
|
|
1129
1133
|
};
|
|
1130
|
-
Watermark.prototype.
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
return
|
|
1134
|
-
|
|
1135
|
-
this.observer = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
|
|
1136
|
-
return __generator(this, function (_a) {
|
|
1137
|
-
switch (_a.label) {
|
|
1134
|
+
Watermark.prototype.recreateOnMutation = function () {
|
|
1135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1136
|
+
var _b, _c;
|
|
1137
|
+
return __generator(this, function (_d) {
|
|
1138
|
+
switch (_d.label) {
|
|
1138
1139
|
case 0:
|
|
1139
|
-
|
|
1140
|
+
_d.trys.push([0, 2, , 3]);
|
|
1140
1141
|
this.remove();
|
|
1141
1142
|
return [4 /*yield*/, this.create()];
|
|
1142
1143
|
case 1:
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
case 2:
|
|
1144
|
+
_d.sent();
|
|
1145
|
+
return [3 /*break*/, 3];
|
|
1146
|
+
case 2:
|
|
1147
|
+
_d.sent();
|
|
1148
|
+
(_c = (_b = this.options).onObserveError) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
1149
|
+
return [3 /*break*/, 3];
|
|
1150
|
+
case 3: return [2 /*return*/];
|
|
1146
1151
|
}
|
|
1147
1152
|
});
|
|
1148
|
-
});
|
|
1153
|
+
});
|
|
1154
|
+
};
|
|
1155
|
+
Watermark.prototype.bindMutationObserver = function () {
|
|
1156
|
+
var _this = this;
|
|
1157
|
+
if (!this.watermarkDom) {
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
this.observer = new MutationObserver(function (mutationsList) {
|
|
1161
|
+
if (mutationsList.length > 0) {
|
|
1162
|
+
void _this.recreateOnMutation();
|
|
1163
|
+
}
|
|
1164
|
+
});
|
|
1149
1165
|
this.observer.observe(this.watermarkDom, {
|
|
1150
1166
|
attributes: true, // 属性的变动
|
|
1167
|
+
attributeFilter: ['style', 'class', 'hidden', 'id'], // 仅监听会影响水印展示或标识的属性
|
|
1151
1168
|
childList: true, // 子节点的变动(指新增,删除或者更改)
|
|
1152
1169
|
subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
|
|
1153
1170
|
characterData: true, // 节点内容或节点文本的变动。
|
|
1154
1171
|
});
|
|
1155
|
-
this.
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
if (!watermarkRemoved) return [3 /*break*/, 3];
|
|
1167
|
-
this.remove();
|
|
1168
|
-
return [4 /*yield*/, this.create()];
|
|
1169
|
-
case 2:
|
|
1170
|
-
_a.sent();
|
|
1171
|
-
_a.label = 3;
|
|
1172
|
-
case 3:
|
|
1173
|
-
_i++;
|
|
1174
|
-
return [3 /*break*/, 1];
|
|
1175
|
-
case 4: return [2 /*return*/];
|
|
1176
|
-
}
|
|
1177
|
-
});
|
|
1178
|
-
}); });
|
|
1179
|
-
this.parentObserve.observe(this.parentElement, {
|
|
1172
|
+
this.parentObserver = new MutationObserver(function (mutationsList) {
|
|
1173
|
+
var watermarkDom = _this.watermarkDom;
|
|
1174
|
+
if (!watermarkDom) {
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
var watermarkRemoved = mutationsList.some(function (item) { return Array.from(item.removedNodes).includes(watermarkDom); });
|
|
1178
|
+
if (watermarkRemoved) {
|
|
1179
|
+
void _this.recreateOnMutation();
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
this.parentObserver.observe(this.parentElement, {
|
|
1180
1183
|
childList: true, // 子节点的变动(指新增,删除或者更改)
|
|
1181
1184
|
});
|
|
1182
1185
|
};
|
|
1183
1186
|
return Watermark;
|
|
1184
1187
|
}());
|
|
1185
1188
|
|
|
1189
|
+
var blindDecodeFallback;
|
|
1190
|
+
var applyBlindDecodeComposite = function (_a) {
|
|
1191
|
+
var ctx = _a.ctx, width = _a.width, height = _a.height, fillColor = _a.fillColor, compositeOperation = _a.compositeOperation, compositeTimes = _a.compositeTimes;
|
|
1192
|
+
if (!(compositeTimes > 0)) {
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
ctx.globalCompositeOperation;
|
|
1196
|
+
ctx.globalCompositeOperation = compositeOperation;
|
|
1197
|
+
if (ctx.globalCompositeOperation !== compositeOperation && blindDecodeFallback) ;
|
|
1198
|
+
ctx.fillStyle = fillColor;
|
|
1199
|
+
for (var i = 0; i < compositeTimes; i++) {
|
|
1200
|
+
ctx.fillRect(0, 0, width, height);
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1186
1204
|
/**
|
|
1187
1205
|
* BlindWatermark class
|
|
1188
1206
|
*/
|
|
@@ -1243,11 +1261,14 @@ var BlindWatermark = /** @class */ (function (_super) {
|
|
|
1243
1261
|
throw new Error('get context error');
|
|
1244
1262
|
}
|
|
1245
1263
|
ctx.drawImage(img_1, 0, 0, width, height);
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1264
|
+
applyBlindDecodeComposite({
|
|
1265
|
+
ctx: ctx,
|
|
1266
|
+
width: width,
|
|
1267
|
+
height: height,
|
|
1268
|
+
fillColor: fillColor,
|
|
1269
|
+
compositeOperation: compositeOperation,
|
|
1270
|
+
compositeTimes: compositeTimes,
|
|
1271
|
+
});
|
|
1251
1272
|
var resultImage = convertImage(canvas);
|
|
1252
1273
|
if (isFunction(onSuccess)) {
|
|
1253
1274
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(resultImage);
|