PageSourceSearch

https://cdn.enrollfirst.com/app-public/production/2026.4.231/js/app.js

js enrollfirst.com collected 2026-10-07 19:33:58 UTC 1,255,343 bytes, 464 lines download raw bytes

1(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o(((e,t)=>{(function(){var n,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=`__lodash_placeholder__`,o=1,s=2,c=8,l=16,u=32,d=64,f=128,p=256,m=512,h=1/0,g=9007199254740991,_=NaN,v=4294967295,y=v-1,b=v>>>1,x=[[`ary`,f],[`bind`,o],[`bindKey`,s],[`curry`,c],[`curryRight`,l],[`flip`,m],[`partial`,u],[`partialRight`,d],[`rearg`,p]],S=`[object Arguments]`,C=`[object Array]`,w=`[object AsyncFunction]`,T=`[object Boolean]`,E=`[object Date]`,D=`[object DOMException]`,O=`[object Error]`,k=`[object Function]`,A=`[object GeneratorFunction]`,j=`[object Map]`,M=`[object Number]`,N=`[object Null]`,P=`[object Object]`,ee=`[object Promise]`,te=`[object Proxy]`,ne=`[object RegExp]`,F=`[object Set]`,re=`[object String]`,ie=`[object Symbol]`,I=`[object Undefined]`,ae=`[object WeakMap]`,oe=`[object WeakSet]`,se=`[object ArrayBuffer]`,ce=`[object DataView]`,le=`[object Float32Array]`,ue=`[object Float64Array]`,de=`[object Int8Array]`,fe=`[object Int16Array]`,pe=`[object Int32Array]`,me=`[object Uint8Array]`,he=`[object Uint8ClampedArray]`,ge=`[object Uint16Array]`,_e=`[object Uint32Array]`,ve=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,Se=/[&<>"']/g,Ce=RegExp(xe.source),we=RegExp(Se.source),Te=/<%-([\s\S]+?)%>/g,Ee=/<%([\s\S]+?)%>/g,De=/<%=([\s\S]+?)%>/g,Oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ke=/^\w*$/,Ae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,je=/[\\^$.*+?()[\]{}|]/g,Me=RegExp(je.source),Ne=/^\s+/,Pe=/\s/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,L=/\{\n\/\* \[wrapped with (.+)\] \*/,Ie=/,? & /,Le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Re=/[()=,{}\[\]\/\s]/,ze=/\\(\\)?/g,Be=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,He=/^[-+]0x[0-9a-f]+$/i,Ue=/^0b[01]+$/i,R=/^\[object .+?Constructor\]$/,We=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Ke=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 62,361 bytes, lines 1-20
17f]/g,qe=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Ye=`\\ud800-\\udfff`,Xe=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Ze=`\\u2700-\\u27bf`,Qe=`a-z\\xdf-\\xf6\\xf8-\\xff`,$e=`\\xac\\xb1\\xd7\\xf7`,et=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,tt=`\\u2000-\\u206f`,z=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,nt=`A-Z\\xc0-\\xd6\\xd8-\\xde`,rt=`\\ufe0e\\ufe0f`,it=$e+et+tt+z,at=`['’]`,ot=`[`+Ye+`]`,B=`[`+it+`]`,st=`[`+Xe+`]`,ct=`\\d+`,lt=`[`+Ze+`]`,ut=`[`+Qe+`]`,dt=`[^`+Ye+it+ct+Ze+Qe+nt+`]`,ft=`\\ud83c[\\udffb-\\udfff]`,pt=`(?:`+st+`|`+ft+`)`,mt=`[^`+Ye+`]`,V=`(?:\\ud83c[\\udde6-\\uddff]){2}`,ht=`[\\ud800-\\udbff][\\udc00-\\udfff]`,gt=`[`+nt+`]`,_t=`\\u200d`,vt=`(?:`+ut+`|`+dt+`)`,yt=`(?:`+gt+`|`+dt+`)`,bt=`(?:`+at+`(?:d|ll|m|re|s|t|ve))?`,xt=`(?:`+at+`(?:D|LL|M|RE|S|T|VE))?`,St=pt+`?`,Ct=`[`+rt+`]?`,wt=`(?:`+_t+`(?:`+[mt,V,ht].join(`|`)+`)`+Ct+St+`)*`,Tt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Et=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Dt=Ct+St+wt,Ot=`(?:`+[lt,V,ht].join(`|`)+`)`+Dt,kt=`(?:`+[mt+st+`?`,st,V,ht,ot].join(`|`)+`)`,At=RegExp(at,`g`),jt=RegExp(st,`g`),Mt=RegExp(ft+`(?=`+ft+`)|`+kt+Dt,`g`),Nt=RegExp([gt+`?`+ut+`+`+bt+`(?=`+[B,gt,`$`].join(`|`)+`)`,yt+`+`+xt+`(?=`+[B,gt+vt,`$`].join(`|`)+`)`,gt+`?`+vt+`+`+bt,gt+`+`+xt,Et,Tt,ct,Ot].join(`|`),`g`),Pt=RegExp(`[`+_t+Ye+Xe+rt+`]`),Ft=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,It=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),Lt=-1,Rt={};Rt[le]=Rt[ue]=Rt[de]=Rt[fe]=Rt[pe]=Rt[me]=Rt[he]=Rt[ge]=Rt[_e]=!0,Rt[S]=Rt[C]=Rt[se]=Rt[T]=Rt[ce]=Rt[E]=Rt[O]=Rt[k]=Rt[j]=Rt[M]=Rt[P]=Rt[ne]=Rt[F]=Rt[re]=Rt[ae]=!1;var zt={};zt[S]=zt[C]=zt[se]=zt[ce]=zt[T]=zt[E]=zt[le]=zt[ue]=zt[de]=zt[fe]=zt[pe]=zt[j]=zt[M]=zt[P]=zt[ne]=zt[F]=zt[re]=zt[ie]=zt[me]=zt[he]=zt[ge]=zt[_e]=!0,zt[O]=zt[k]=zt[ae]=!1;var Bt={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`},Vt={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Ht={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`},Ut={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},Wt=parseFloat,Gt=parseInt,Kt=typeof global==`object`&&global&&global.Object===Object&&global,qt=typeof self==`object`&&self&&self.Object===Object&&self,Jt=Kt||qt||Function(`return this`)(),Yt=typeof e==`object`&&e&&!e.nodeType&&e,Xt=Yt&&typeof t==`object`&&t&&!t.nodeType&&t,Zt=Xt&&Xt.exports===Yt,H=Zt&&Kt.process,Qt=function(){try{return Xt&&Xt.require&&Xt.require(`util`).types||H&&H.binding&&H.binding(`util`)}catch{}}(),$t=Qt&&Qt.isArrayBuffer,en=Qt&&Qt.isDate,tn=Qt&&Qt.isMap,nn=Qt&&Qt.isRegExp,rn=Qt&&Qt.isSet,an=Qt&&Qt.isTypedArray;function on(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function sn(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function cn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function ln(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function un(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function dn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function fn(e,t){return!!(e!=null&&e.length)&&wn(e,t,0)>-1}function pn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function mn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function hn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function gn(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function _n(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var yn=On(`length`);function bn(e){return e.split(``)}function xn(e){return e.match(Le)||[]}function Sn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Cn(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function wn(e,t,n){return t===t?er(e,t,n):Cn(e,En,n)}function Tn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function En(e){return e!==e}function Dn(e,t){var n=e==null?0:e.length;return n?Mn(e,t)/n:_}function On(e){return function(t){return t==null?n:t[e]}}function kn(e){return function(t){return e==null?n:e[t]}}function An(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function jn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Mn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function Nn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Pn(e,t){return mn(t,function(t){return[t,e[t]]})}function Fn(e){return e&&e.slice(0,ir(e)+1).replace(Ne,``)}function In(e){return function(t){return e(t)}}function Ln(e,t){return mn(t,function(t){return e[t]})}function Rn(e,t){return e.has(t)}function zn(e,t){for(var n=-1,r=e.length;++n<r&&wn(t,e[n],0)>-1;);return n}function Bn(e,t){for(var n=e.length;n--&&wn(t,e[n],0)>-1;);return n}function Vn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Hn=kn(Bt),Un=kn(Vt);function Wn(e){return`\\`+Ut[e]}function Gn(e,t){return e==null?n:e[t]}function Kn(e){return Pt.test(e)}function qn(e){return Ft.test(e)}function Jn(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Yn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Xn(e,t){return function(n){return e(t(n))}}function Zn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===a)&&(e[n]=a,o[i++]=n)}return o}function Qn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function $n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function er(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function tr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function nr(e){return Kn(e)?or(e):yn(e)}function rr(e){return Kn(e)?sr(e):bn(e)}function ir(e){for(var t=e.length;t--&&Pe.test(e.charAt(t)););return t}var ar=kn(Ht);function or(e){for(var t=Mt.lastIndex=0;Mt.test(e);)++t;return t}function sr(e){return e.match(Mt)||[]}function cr(e){return e.match(Nt)||[]}var lr=(function e(t){t=t==null?Jt:lr.defaults(Jt.Object(),t,lr.pick(Jt,It));var Pe=t.Array,Le=t.Date,Ye=t.Error,Xe=t.Function,Ze=t.Math,Qe=t.Object,$e=t.RegExp,et=t.String,tt=t.TypeError,z=Pe.prototype,nt=Xe.prototype,rt=Qe.prototype,it=t[`__core-js_shared__`],at=nt.toString,ot=rt.hasOwnProperty,B=0,st=function(){var e=/[^.]+$/.exec(it&&it.keys&&it.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),ct=rt.toString,lt=at.call(Qe),ut=Jt._,dt=$e(`^`+at.call(ot).replace(je,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),ft=Zt?t.Buffer:n,pt=t.Symbol,mt=t.Uint8Array,V=ft?ft.allocUnsafe:n,ht=Xn(Qe.getPrototypeOf,Qe),gt=Qe.create,_t=rt.propertyIsEnumerable,vt=z.splice,yt=pt?pt.isConcatSpreadable:n,bt=pt?pt.iterator:n,xt=pt?pt.toStringTag:n,St=function(){try{var e=Lo(Qe,`defineProperty`);return e({},``,{}),e}catch{}}(),Ct=t.clearTimeout!==Jt.clearTimeout&&t.clearTimeout,wt=Le&&Le.now!==Jt.Date.now&&Le.now,Tt=t.setTimeout!==Jt.setTimeout&&t.setTimeout,Et=Ze.ceil,Dt=Ze.floor,Ot=Qe.getOwnPropertySymbols,kt=ft?ft.isBuffer:n,Mt=t.isFinite,Nt=z.join,Pt=Xn(Qe.keys,Qe),Ft=Ze.max,Bt=Ze.min,Vt=Le.now,Ht=t.parseInt,Ut=Ze.random,Kt=z.reverse,qt=Lo(t,`DataView`),Yt=Lo(t,`Map`),Xt=Lo(t,`Promise`),H=Lo(t,`Set`),Qt=Lo(t,`WeakMap`),yn=Lo(Qe,`create`),bn=Qt&&new Qt,kn={},er=Ss(qt),or=Ss(Yt),sr=Ss(Xt),ur=Ss(H),dr=Ss(Qt),fr=pt?pt.prototype:n,pr=fr?fr.valueOf:n,mr=fr?fr.toString:n;function U(e){if(pu(e)&&!Xl(e)&&!(e instanceof vr)){if(e instanceof _r)return e;if(ot.call(e,`__wrapped__`))return ws(e)}return new _r(e)}var hr=function(){function e(){}return function(t){if(!fu(t))return{};if(gt)return gt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function gr(){}function _r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}U.templateSettings={escape:Te,evaluate:Ee,interpolate:De,variable:``,imports:{_:U}},U.prototype=gr.prototype,U.prototype.constructor=U,_r.prototype=hr(gr.prototype),_r.prototype.constructor=_r;function vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function yr(){var e=new vr(this.__wrapped__);return e.__actions__=qa(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=qa(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=qa(this.__views__),e}function br(){if(this.__filtered__){var e=new vr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function xr(){var e=this.__wrapped__.value(),t=this.__dir__,n=Xl(e),r=t<0,i=n?e.length:0,a=Ho(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=Bt(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Oa(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==2)g=b;else if(!b){if(y==1)continue outer;break outer}}m[f++]=g}return m}vr.prototype=hr(gr.prototype),vr.prototype.constructor=vr;function Sr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Cr(){this.__data__=yn?yn(null):{},this.size=0}function wr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Tr(e){var t=this.__data__;if(yn){var r=t[e];return r===i?n:r}return ot.call(t,e)?t[e]:n}function Er(e){var t=this.__data__;return yn?t[e]!==n:ot.call(t,e)}function Dr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=yn&&t===n?i:t,this}Sr.prototype.clear=Cr,Sr.prototype.delete=wr,Sr.prototype.get=Tr,Sr.prototype.has=Er,Sr.prototype.set=Dr;function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function kr(){this.__data__=[],this.size=0}function Ar(e){var t=this.__data__,n=ti(t,e);return n<0?!1:(n==t.length-1?t.pop():vt.call(t,n,1),--this.size,!0)}function jr(e){var t=this.__data__,r=ti(t,e);return r<0?n:t[r][1]}function Mr(e){return ti(this.__data__,e)>-1}function Nr(e,t){var n=this.__data__,r=ti(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Or.prototype.clear=kr,Or.prototype.delete=Ar,Or.prototype.get=jr,Or.prototype.has=Mr,Or.prototype.set=Nr;function Pr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fr(){this.size=0,this.__data__={hash:new Sr,map:new(Yt||Or),string:new Sr}}function Ir(e){var t=Fo(this,e).delete(e);return this.size-=+!!t,t}function Lr(e){return Fo(this,e).get(e)}function Rr(e){return Fo(this,e).has(e)}function zr(e,t){var n=Fo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}Pr.prototype.clear=Fr,Pr.prototype.delete=Ir,Pr.prototype.get=Lr,Pr.prototype.has=Rr,Pr.prototype.set=zr;function Br(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Pr;++t<n;)this.add(e[t])}function Vr(e){return this.__data__.set(e,i),this}function Hr(e){return this.__data__.has(e)}Br.prototype.add=Br.prototype.push=Vr,Br.prototype.has=Hr;function Ur(e){var t=this.__data__=new Or(e);this.size=t.size}function Wr(){this.__data__=new Or,this.size=0}function Gr(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Kr(e){return this.__data__.get(e)}function qr(e){return this.__data__.has(e)}function Jr(e,t){var n=this.__data__;if(n instanceof Or){var r=n.__data__;if(!Yt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pr(r)}return n.set(e,t),this.size=n.size,this}Ur.prototype.clear=Wr,Ur.prototype.delete=Gr,Ur.prototype.get=Kr,Ur.prototype.has=qr,Ur.prototype.set=Jr;function Yr(e,t){var n=Xl(e),r=!n&&Yl(e),i=!n&&!r&&tu(e),a=!n&&!r&&!i&&Ou(e),o=n||r||i||a,s=o?Nn(e.length,et):[],c=s.length;for(var l in e)(t||ot.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Xo(l,c)))&&s.push(l);return s}function Xr(e){var t=e.length;return t?e[ca(0,t-1)]:n}function Zr(e,t){return ys(qa(e),si(t,0,e.length))}function Qr(e){return ys(qa(e))}function $r(e,t,r){(r!==n&&!Kl(e[t],r)||r===n&&!(t in e))&&ai(e,t,r)}function ei(e,t,r){var i=e[t];(!(ot.call(e,t)&&Kl(i,r))||r===n&&!(t in e))&&ai(e,t,r)}function ti(e,t){for(var n=e.length;n--;)if(Kl(e[n][0],t))return n;return-1}function ni(e,t,n,r){return pi(e,function(e,i,a){t(r,e,n(e),a)}),r}function ri(e,t){return e&&Ja(t,ld(t),e)}function ii(e,t){return e&&Ja(t,ud(t),e)}function ai(e,t,n){t==`__proto__`&&St?St(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function oi(e,t){for(var r=-1,i=t.length,a=Pe(i),o=e==null;++r<i;)a[r]=o?n:rd(e,t[r]);return a}function si(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function ci(e,t,r,i,a,o){var s,c=t&1,l=t&2,u=t&4;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!fu(e))return e;var d=Xl(e);if(d){if(s=Go(e),!c)return qa(e,s)}else{var f=Vo(e),p=f==k||f==A;if(tu(e))return La(e,c);if(f==P||f==S||p&&!a){if(s=l||p?{}:Ko(e),!c)return l?Xa(e,ii(s,e)):Ya(e,ri(s,e))}else{if(!zt[f])return a?e:{};s=qo(e,f,c)}}o||=new Ur;var m=o.get(e);if(m)return m;o.set(e,s),Tu(e)?e.forEach(function(n){s.add(ci(n,t,r,n,e,o))}):mu(e)&&e.forEach(function(n,i){s.set(i,ci(n,t,r,i,e,o))});var h=d?n:(u?l?jo:Ao:l?ud:ld)(e);return cn(h||e,function(n,i){h&&(i=n,n=e[i]),ei(s,i,ci(n,t,r,i,e,o))}),s}function li(e){var t=ld(e);return function(n){return ui(n,e,t)}}function ui(e,t,r){var i=r.length;if(e==null)return!i;for(e=Qe(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function di(e,t,i){if(typeof e!=`function`)throw new tt(r);return hs(function(){e.apply(n,i)},t)}function fi(e,t,n,r){var i=-1,a=fn,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=mn(t,In(n))),r?(a=pn,o=!1):t.length>=200&&(a=Rn,o=!1,t=new Br(t));outer:for(;++i<s;){var u=e[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d===d){for(var f=l;f--;)if(t[f]===d)continue outer;c.push(u)}else a(t,d,r)||c.push(u)}return c}var pi=$a(Si),mi=$a(Ci,!0);function hi(e,t){var n=!0;return pi(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function gi(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Du(s):r(s,c)))var c=s,l=o}return l}function _i(e,t,r,i){var a=e.length;for(r=J(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:J(i),i<0&&(i+=a),i=r>i?0:Iu(i);r<i;)e[r++]=t;return e}function vi(e,t){var n=[];return pi(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function yi(e,t,n,r,i){var a=-1,o=e.length;for(n||=Yo,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?yi(s,t-1,n,r,i):hn(i,s):r||(i[i.length]=s)}return i}var bi=eo(),xi=eo(!0);function Si(e,t){return e&&bi(e,t,ld)}function Ci(e,t){return e&&xi(e,t,ld)}function wi(e,t){return dn(t,function(t){return lu(e[t])})}function Ti(e,t){t=Na(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[xs(t[r++])];return r&&r==i?e:n}function Ei(e,t,n){var r=t(e);return Xl(e)?r:hn(r,n(e))}function Di(e){return e==null?e===n?I:N:xt&&xt in Qe(e)?Ro(e):ls(e)}function Oi(e,t){return e>t}function ki(e,t){return e!=null&&ot.call(e,t)}function Ai(e,t){return e!=null&&t in Qe(e)}function ji(e,t,n){return e>=Bt(t,n)&&e<Ft(t,n)}function Mi(e,t,r){for(var i=r?pn:fn,a=e[0].length,o=e.length,s=o,c=Pe(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=mn(d,In(t))),l=Bt(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new Br(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?Rn(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?Rn(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function Ni(e,t,n,r){return Si(e,function(e,i,a){t(r,n(e),i,a)}),r}function Pi(e,t,r){t=Na(t,e),e=ds(e,t);var i=e==null?e:e[xs(Ys(t))];return i==null?n:on(i,e,r)}function Fi(e){return pu(e)&&Di(e)==S}function Ii(e){return pu(e)&&Di(e)==se}function Li(e){return pu(e)&&Di(e)==E}function Ri(e,t,n,r,i){return e===t?!0:e==null||t==null||!pu(e)&&!pu(t)?e!==e&&t!==t:zi(e,t,n,r,Ri,i)}function zi(e,t,n,r,i,a){var o=Xl(e),s=Xl(t),c=o?C:Vo(e),l=s?C:Vo(t);c=c==S?P:c,l=l==S?P:l;var u=c==P,d=l==P,f=c==l;if(f&&tu(e)){if(!tu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Ur,o||Ou(e)?Eo(e,t,n,r,i,a):Do(e,t,c,n,r,i,a);if(!(n&1)){var p=u&&ot.call(e,`__wrapped__`),m=d&&ot.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Ur,i(h,g,n,r,a)}}return f?(a||=new Ur,Oo(e,t,n,r,i,a)):!1}function Bi(e){return pu(e)&&Vo(e)==j}function Vi(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=Qe(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new Ur;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?Ri(d,u,3,i,f):p))return!1}}return!0}function Hi(e){return!fu(e)||ts(e)?!1:(lu(e)?dt:R).test(Ss(e))}function Ui(e){return pu(e)&&Di(e)==ne}function Wi(e){return pu(e)&&Vo(e)==F}function Gi(e){return pu(e)&&du(e.length)&&!!Rt[Di(e)]}function Ki(e){return typeof e==`function`?e:e==null?Y:typeof e==`object`?Xl(e)?Qi(e[0],e[1]):Zi(e):Af(e)}function qi(e){if(!rs(e))return Pt(e);var t=[];for(var n in Qe(e))ot.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Ji(e){if(!fu(e))return cs(e);var t=rs(e),n=[];for(var r in e)r==`constructor`&&(t||!ot.call(e,r))||n.push(r);return n}function Yi(e,t){return e<t}function Xi(e,t){var n=-1,r=Ql(e)?Pe(e.length):[];return pi(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Zi(e){var t=Io(e);return t.length==1&&t[0][2]?as(t[0][0],t[0][1]):function(n){return n===e||Vi(n,e,t)}}function Qi(e,t){return Qo(e)&&is(t)?as(xs(e),t):function(r){var i=rd(r,e);return i===n&&i===t?ad(r,e):Ri(t,i,3)}}function $i(e,t,r,i,a){e!==t&&bi(t,function(o,s){if(a||=new Ur,fu(o))ea(e,t,s,r,$i,i,a);else{var c=i?i(ps(e,s),o,s+``,e,t,a):n;c===n&&(c=o),$r(e,s,c)}},ud)}function ea(e,t,r,i,a,o,s){var c=ps(e,r),l=ps(t,r),u=s.get(l);if(u){$r(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=Xl(l),m=!p&&tu(l),h=!p&&!m&&Ou(l);d=l,p||m||h?Xl(c)?d=c:$l(c)?d=qa(c):m?(f=!1,d=La(l,!0)):h?(f=!1,d=Ha(l,!0)):d=[]:Su(l)||Yl(l)?(d=c,Yl(c)?d=Ru(c):(!fu(c)||lu(c))&&(d=Ko(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),$r(e,r,d)}function ta(e,t){var r=e.length;if(r)return t+=t<0?r:0,Xo(t,r)?e[t]:n}function na(e,t,n){t=t.length?mn(t,function(e){return Xl(e)?function(t){return Ti(t,e.length===1?e[0]:e)}:e}):[Y];var r=-1;return t=mn(t,In(G())),jn(Xi(e,function(e,n,i){return{criteria:mn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Wa(e,t,n)})}function ra(e,t){return ia(e,t,function(t,n){return ad(e,n)})}function ia(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Ti(e,o);n(s,o)&&pa(a,Na(o,e),s)}return a}function aa(e){return function(t){return Ti(t,e)}}function oa(e,t,n,r){var i=r?Tn:wn,a=-1,o=t.length,s=e;for(e===t&&(t=qa(t)),n&&(s=mn(e,In(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&vt.call(s,c,1),vt.call(e,c,1);return e}function sa(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;Xo(i)?vt.call(e,i,1):Ta(e,i)}}return e}function ca(e,t){return e+Dt(Ut()*(t-e+1))}function W(e,t,n,r){for(var i=-1,a=Ft(Et((t-e)/(n||1)),0),o=Pe(a);a--;)o[r?a:++i]=e,e+=n;return o}function la(e,t){var n=``;if(!e||t<1||t>g)return n;do t%2&&(n+=e),t=Dt(t/2),t&&(e+=e);while(t);return n}function ua(e,t){return gs(us(e,t,Y),e+``)}function da(e){return Xr(Od(e))}function fa(e,t){var n=Od(e);return ys(n,si(t,0,n.length))}function pa(e,t,r,i){if(!fu(e))return e;t=Na(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=xs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=fu(d)?d:Xo(t[a+1])?[]:{})}ei(c,l,u),c=c[l]}return e}var ma=bn?function(e,t){return bn.set(e,t),e}:Y,ha=St?function(e,t){return St(e,`toString`,{configurable:!0,enumerable:!1,value:mf(t),writable:!0})}:Y;function ga(e){return ys(Od(e))}function _a(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Pe(i);++r<i;)a[r]=e[r+t];return a}function va(e,t){var n;return pi(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function ya(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=b){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Du(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return ba(e,t,Y,n)}function ba(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Du(t),u=t===n;a<o;){var d=Dt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Du(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return Bt(o,y)}function xa(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!Kl(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Sa(e){return typeof e==`number`?e:Du(e)?_:+e}function Ca(e){if(typeof e==`string`)return e;if(Xl(e))return mn(e,Ca)+``;if(Du(e))return mr?mr.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function wa(e,t,n){var r=-1,i=fn,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=pn;else if(a>=200){var l=t?null:bo(e);if(l)return Qn(l);o=!1,i=Rn,c=new Br}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}function Ta(e,t){t=Na(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=xs(t[n]);if(i===`__proto__`&&!ot.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ds(e,t);return a==null||delete a[xs(Ys(t))]}function Ea(e,t,n,r){return pa(e,t,n(Ti(e,t)),r)}function Da(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?_a(e,r?0:a,r?a+1:i):_a(e,r?a+1:0,r?i:a)}function Oa(e,t){var n=e;return n instanceof vr&&(n=n.value()),gn(t,function(e,t){return t.func.apply(t.thisArg,hn([e],t.args))},n)}function ka(e,t,n){var r=e.length;if(r<2)return r?wa(e[0]):[];for(var i=-1,a=Pe(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=fi(a[i]||o,e[s],t,n));return wa(yi(a,1),t,n)}function Aa(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function ja(e){return $l(e)?e:[]}function Ma(e){return typeof e==`function`?e:Y}function Na(e,t){return Xl(e)?e:Qo(e,t)?[e]:bs(Bu(e))}var Pa=ua;function Fa(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:_a(e,t,r)}var Ia=Ct||function(e){return Jt.clearTimeout(e)};function La(e,t){if(t)return e.slice();var n=e.length,r=V?V(n):new e.constructor(n);return e.copy(r),r}function Ra(e){var t=new e.constructor(e.byteLength);return new mt(t).set(new mt(e)),t}function za(e,t){var n=t?Ra(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Ba(e){var t=new e.constructor(e.source,Ve.exec(e));return t.lastIndex=e.lastIndex,t}function Va(e){return pr?Qe(pr.call(e)):{}}function Ha(e,t){var n=t?Ra(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ua(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Du(e),s=t!==n,c=t===null,l=t===t,u=Du(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function Wa(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Ua(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Ga(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=Ft(a-o,0),u=Pe(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function Ka(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=Ft(a-s,0),d=Pe(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function qa(e,t){var n=-1,r=e.length;for(t||=Pe(r);++n<r;)t[n]=e[n];return t}function Ja(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?ai(r,c,l):ei(r,c,l)}return r}function Ya(e,t){return Ja(e,zo(e),t)}function Xa(e,t){return Ja(e,Bo(e),t)}function Za(e,t){return function(n,r){var i=Xl(n)?sn:ni,a=t?t():{};return i(n,e,G(r,2),a)}}function Qa(e){return ua(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&Zo(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=Qe(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function $a(e,t){return function(n,r){if(n==null)return n;if(!Ql(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Qe(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function eo(e){return function(t,n,r){for(var i=-1,a=Qe(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function to(e,t,n){var r=t&o,i=ao(e);function a(){return(this&&this!==Jt&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function no(e){return function(t){t=Bu(t);var r=Kn(t)?rr(t):n,i=r?r[0]:t.charAt(0),a=r?Fa(r,1).join(``):t.slice(1);return i[e]()+a}}function ro(e){return function(t){return gn(lf(Fd(t).replace(At,``)),e,``)}}function ao(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=hr(e.prototype),r=e.apply(n,t);return fu(r)?r:n}}function oo(e,t,r){var i=ao(e);function a(){for(var o=arguments.length,s=Pe(o),c=o,l=Po(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:Zn(s,l);return o-=u.length,o<r?vo(e,t,lo,a.placeholder,n,s,u,n,n,r-o):on(this&&this!==Jt&&this instanceof a?i:e,this,s)}return a}function so(e){return function(t,r,i){var a=Qe(t);if(!Ql(t)){var o=G(r,3);t=ld(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function co(e){return ko(function(t){var i=t.length,a=i,o=_r.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!=`function`)throw new tt(r);if(o&&!l&&No(s)==`wrapper`)var l=new _r([],!0)}for(a=l?a:i;++a<i;){s=t[a];var d=No(s),m=d==`wrapper`?Mo(s):n;l=m&&es(m[0])&&m[1]==(f|c|u|p)&&!m[4].length&&m[9]==1?l[No(m[0])].apply(l,m[3]):s.length==1&&es(s)?l[d]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&e.length==1&&Xl(n))return l.plant(n).value();for(var r=0,a=i?t[r].apply(this,e):n;++r<i;)a=t[r].call(this,a);return a}})}function lo(e,t,r,i,a,u,d,p,h,g){var _=t&f,v=t&o,y=t&s,b=t&(c|l),x=t&m,S=y?n:ao(e);function C(){for(var n=arguments.length,o=Pe(n),s=n;s--;)o[s]=arguments[s];if(b)var c=Po(C),l=Vn(o,c);if(i&&(o=Ga(o,i,a,b)),u&&(o=Ka(o,u,d,b)),n-=l,b&&n<g){var f=Zn(o,c);return vo(e,t,lo,C.placeholder,r,o,f,p,h,g-n)}var m=v?r:this,w=y?m[e]:e;return n=o.length,p?o=fs(o,p):x&&n>1&&o.reverse(),_&&h<n&&(o.length=h),this&&this!==Jt&&this instanceof C&&(w=S||ao(w)),w.apply(m,o)}return C}function uo(e,t){return function(n,r){return Ni(n,e,t(r),{})}}function fo(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=Ca(r),i=Ca(i)):(r=Sa(r),i=Sa(i)),a=e(r,i)}return a}}function po(e){return ko(function(t){return t=mn(t,In(G())),ua(function(n){var r=this;return e(t,function(e){return on(e,r,n)})})})}function mo(e,t){t=t===n?` `:Ca(t);var r=t.length;if(r<2)return r?la(t,e):t;var i=la(t,Et(e/nr(t)));return Kn(t)?Fa(rr(i),0,e).join(``):i.slice(0,e)}function ho(e,t,n,r){var i=t&o,a=ao(e);function s(){for(var t=-1,o=arguments.length,c=-1,l=r.length,u=Pe(l+o),d=this&&this!==Jt&&this instanceof s?a:e;++c<l;)u[c]=r[c];for(;o--;)u[c++]=arguments[++t];return on(d,i?n:this,u)}return s}function go(e){return function(t,r,i){return i&&typeof i!=`number`&&Zo(t,r,i)&&(r=i=n),t=Fu(t),r===n?(r=t,t=0):r=Fu(r),i=i===n?t<r?1:-1:Fu(i),W(t,r,i,e)}}function _o(e){return function(t,n){return(typeof t!=`string`||typeof n!=`string`)&&(t=Lu(t),n=Lu(n)),e(t,n)}}function vo(e,t,r,i,a,l,f,p,m,h){var g=t&c,_=g?f:n,v=g?n:f,y=g?l:n,b=g?n:l;t|=g?u:d,t&=~(g?d:u),t&4||(t&=~(o|s));var x=[e,t,a,y,_,b,v,p,m,h],S=r.apply(n,x);return es(e)&&ms(S,x),S.placeholder=i,_s(S,e,t)}function yo(e){var t=Ze[e];return function(e,n){if(e=Lu(e),n=n==null?0:Bt(J(n),292),n&&Mt(e)){var r=(Bu(e)+`e`).split(`e`);return r=(Bu(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var bo=H&&1/Qn(new H([,-0]))[1]==h?function(e){return new H(e)}:Tf;function xo(e){return function(t){var n=Vo(t);return n==j?Yn(t):n==F?$n(t):Pn(t,e(t))}}function So(e,t,i,a,f,p,m,h){var g=t&s;if(!g&&typeof e!=`function`)throw new tt(r);var _=a?a.length:0;if(_||(t&=~(u|d),a=f=n),m=m===n?m:Ft(J(m),0),h=h===n?h:J(h),_-=f?f.length:0,t&d){var v=a,y=f;a=f=n}var b=g?n:Mo(e),x=[e,t,i,a,f,v,y,p,m,h];if(b&&ss(x,b),e=x[0],t=x[1],i=x[2],a=x[3],f=x[4],h=x[9]=x[9]===n?g?0:e.length:Ft(x[9]-_,0),!h&&t&(c|l)&&(t&=~(c|l)),!t||t==o)var S=to(e,t,i);else S=t==c||t==l?oo(e,t,h):(t==u||t==(o|u))&&!f.length?ho(e,t,i,a):lo.apply(n,x);return _s((b?ma:ms)(S,x),e,t)}function Co(e,t,r,i){return e===n||Kl(e,rt[r])&&!ot.call(i,r)?t:e}function wo(e,t,r,i,a,o){return fu(e)&&fu(t)&&(o.set(t,e),$i(e,t,n,wo,o),o.delete(t)),e}function To(e){return Su(e)?n:e}function Eo(e,t,r,i,a,o){var s=r&1,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&2?new Br:n;for(o.set(e,t),o.set(t,e);++f<c;){var h=e[f],g=t[f];if(i)var _=s?i(g,h,f,t,e,o):i(h,g,f,e,t,o);if(_!==n){if(_)continue;p=!1;break}if(m){if(!vn(t,function(e,t){if(!Rn(m,t)&&(h===e||a(h,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(h===g||a(h,g,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Do(e,t,n,r,i,a,o){switch(n){case ce:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case se:return!(e.byteLength!=t.byteLength||!a(new mt(e),new mt(t)));case T:case E:case M:return Kl(+e,+t);case O:return e.name==t.name&&e.message==t.message;case ne:case re:return e==t+``;case j:var s=Yn;case F:var c=r&1;if(s||=Qn,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=Eo(s(e),s(t),r,i,a,o);return o.delete(e),u;case ie:if(pr)return pr.call(e)==pr.call(t)}return!1}function Oo(e,t,r,i,a,o){var s=r&1,c=Ao(e),l=c.length;if(l!=Ao(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:ot.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var h=s;++u<l;){d=c[u];var g=e[d],_=t[d];if(i)var v=s?i(_,g,d,t,e,o):i(g,_,d,e,t,o);if(!(v===n?g===_||a(g,_,r,i,o):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return o.delete(e),o.delete(t),m}function ko(e){return gs(us(e,n,Rs),e+``)}function Ao(e){return Ei(e,ld,zo)}function jo(e){return Ei(e,ud,Bo)}var Mo=bn?function(e){return bn.get(e)}:Tf;function No(e){for(var t=e.name+``,n=kn[t],r=ot.call(kn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Po(e){return(ot.call(U,`placeholder`)?U:e).placeholder}function G(){var e=U.iteratee||vf;return e=e===vf?Ki:e,arguments.length?e(arguments[0],arguments[1]):e}function Fo(e,t){var n=e.__data__;return $o(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Io(e){for(var t=ld(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,is(i)]}return t}function Lo(e,t){var r=Gn(e,t);return Hi(r)?r:n}function Ro(e){var t=ot.call(e,xt),r=e[xt];try{e[xt]=n;var i=!0}catch{}var a=ct.call(e);return i&&(t?e[xt]=r:delete e[xt]),a}var zo=Ot?function(e){return e==null?[]:(e=Qe(e),dn(Ot(e),function(t){return _t.call(e,t)}))}:Pf,Bo=Ot?function(e){for(var t=[];e;)hn(t,zo(e)),e=ht(e);return t}:Pf,Vo=Di;(qt&&Vo(new qt(new ArrayBuffer(1)))!=ce||Yt&&Vo(new Yt)!=j||Xt&&Vo(Xt.resolve())!=ee||H&&Vo(new H)!=F||Qt&&Vo(new Qt)!=ae)&&(Vo=function(e){var t=Di(e),r=t==P?e.constructor:n,i=r?Ss(r):``;if(i)switch(i){case er:return ce;case or:return j;case sr:return ee;case ur:return F;case dr:return ae}return t});function Ho(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=Bt(t,e+o);break;case`takeRight`:e=Ft(e,t-o)}}return{start:e,end:t}}function Uo(e){var t=e.match(L);return t?t[1].split(Ie):[]}function Wo(e,t,n){t=Na(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=xs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&du(i)&&Xo(o,i)&&(Xl(e)||Yl(e)))}function Go(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&ot.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Ko(e){return typeof e.constructor==`function`&&!rs(e)?hr(ht(e)):{}}function qo(e,t,n){var r=e.constructor;switch(t){case se:return Ra(e);case T:case E:return new r(+e);case ce:return za(e,n);case le:case ue:case de:case fe:case pe:case me:case he:case ge:case _e:return Ha(e,n);case j:return new r;case M:case re:return new r(e);case ne:return Ba(e);case F:return new r;case ie:return Va(e)}}function Jo(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(Fe,`{
2/* [wrapped with `+t+`] */
3`)}function Yo(e){return Xl(e)||Yl(e)||!!(yt&&e&&e[yt])}function Xo(e,t){var n=typeof e;return t??=g,!!t&&(n==`number`||n!=`symbol`&&Ge.test(e))&&e>-1&&e%1==0&&e<t}function Zo(e,t,n){if(!fu(n))return!1;var r=typeof t;return(r==`number`?Ql(n)&&Xo(t,n.length):r==`string`&&t in n)?Kl(n[t],e):!1}function Qo(e,t){if(Xl(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Du(e)?!0:ke.test(e)||!Oe.test(e)||t!=null&&e in Qe(t)}function $o(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function es(e){var t=No(e),n=U[t];if(typeof n!=`function`||!(t in vr.prototype))return!1;if(e===n)return!0;var r=Mo(n);return!!r&&e===r[0]}function ts(e){return!!st&&st in e}var ns=it?lu:Ff;function rs(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||rt)}function is(e){return e===e&&!fu(e)}function as(e,t){return function(r){return r!=null&&r[e]===t&&(t!==n||e in Qe(r))}}function os(e){var t=Ol(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}function ss(e,t){var n=e[1],r=t[1],i=n|r,l=i<(o|s|f),u=r==f&&n==c||r==f&&n==p&&e[7].length<=t[8]||r==(f|p)&&t[7].length<=t[8]&&n==c;if(!(l||u))return e;r&o&&(e[2]=t[2],i|=n&o?0:4);var d=t[3];if(d){var m=e[3];e[3]=m?Ga(m,d,t[4]):d,e[4]=m?Zn(e[3],a):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?Ka(m,d,t[6]):d,e[6]=m?Zn(e[5],a):t[6]),d=t[7],d&&(e[7]=d),r&f&&(e[8]=e[8]==null?t[8]:Bt(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function cs(e){var t=[];if(e!=null)for(var n in Qe(e))t.push(n);return t}function ls(e){return ct.call(e)}function us(e,t,r){return t=Ft(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Ft(n.length-t,0),o=Pe(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Pe(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),on(e,this,s)}}function ds(e,t){return t.length<2?e:Ti(e,_a(t,0,-1))}function fs(e,t){for(var r=e.length,i=Bt(t.length,r),a=qa(e);i--;){var o=t[i];e[i]=Xo(o,r)?a[o]:n}return e}function ps(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var ms=vs(ma),hs=Tt||function(e,t){return Jt.setTimeout(e,t)},gs=vs(ha);function _s(e,t,n){var r=t+``;return gs(e,Jo(r,Cs(Uo(r),n)))}function vs(e){var t=0,r=0;return function(){var i=Vt(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function ys(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=ca(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var bs=os(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Ae,function(e,n,r,i){t.push(r?i.replace(ze,`$1`):n||e)}),t});function xs(e){if(typeof e==`string`||Du(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Ss(e){if(e!=null){try{return at.call(e)}catch{}try{return e+``}catch{}}return``}function Cs(e,t){return cn(x,function(n){var r=`_.`+n[0];t&n[1]&&!fn(e,r)&&e.push(r)}),e.sort()}function ws(e){if(e instanceof vr)return e.clone();var t=new _r(e.__wrapped__,e.__chain__);return t.__actions__=qa(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Ts(e,t,r){t=(r?Zo(e,t,r):t===n)?1:Ft(J(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=Pe(Et(i/t));a<i;)s[o++]=_a(e,a,a+=t);return s}function Es(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Ds(){var e=arguments.length;if(!e)return[];for(var t=Pe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return hn(Xl(n)?qa(n):[n],yi(t,1))}var Os=ua(function(e,t){return $l(e)?fi(e,yi(t,1,$l,!0)):[]}),ks=ua(function(e,t){var r=Ys(t);return $l(r)&&(r=n),$l(e)?fi(e,yi(t,1,$l,!0),G(r,2)):[]}),As=ua(function(e,t){var r=Ys(t);return $l(r)&&(r=n),$l(e)?fi(e,yi(t,1,$l,!0),n,r):[]});function js(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:J(t),_a(e,t<0?0:t,i)):[]}function Ms(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:J(t),t=i-t,_a(e,0,t<0?0:t)):[]}function Ns(e,t){return e&&e.length?Da(e,G(t,3),!0,!0):[]}function Ps(e,t){return e&&e.length?Da(e,G(t,3),!0):[]}function Fs(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&Zo(e,t,n)&&(n=0,r=i),_i(e,t,n,r)):[]}function Is(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:J(n);return i<0&&(i=Ft(r+i,0)),Cn(e,G(t,3),i)}function Ls(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=J(r),a=r<0?Ft(i+a,0):Bt(a,i-1)),Cn(e,G(t,3),a,!0)}function Rs(e){return e!=null&&e.length?yi(e,1):[]}function zs(e){return e!=null&&e.length?yi(e,h):[]}function Bs(e,t){return e!=null&&e.length?(t=t===n?1:J(t),yi(e,t)):[]}function Vs(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];ai(r,i[0],i[1])}return r}function Hs(e){return e&&e.length?e[0]:n}function Us(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:J(n);return i<0&&(i=Ft(r+i,0)),wn(e,t,i)}function Ws(e){return e!=null&&e.length?_a(e,0,-1):[]}var Gs=ua(function(e){var t=mn(e,ja);return t.length&&t[0]===e[0]?Mi(t):[]}),Ks=ua(function(e){var t=Ys(e),r=mn(e,ja);return t===Ys(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Mi(r,G(t,2)):[]}),qs=ua(function(e){var t=Ys(e),r=mn(e,ja);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Mi(r,n,t):[]});function Js(e,t){return e==null?``:Nt.call(e,t)}function Ys(e){var t=e==null?0:e.length;return t?e[t-1]:n}function Xs(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=J(r),a=a<0?Ft(i+a,0):Bt(a,i-1)),t===t?tr(e,t,a):Cn(e,En,a,!0)}function Zs(e,t){return e&&e.length?ta(e,J(t)):n}var K=ua(Qs);function Qs(e,t){return e&&e.length&&t&&t.length?oa(e,t):e}function $s(e,t,n){return e&&e.length&&t&&t.length?oa(e,t,G(n,2)):e}function ec(e,t,r){return e&&e.length&&t&&t.length?oa(e,t,n,r):e}var tc=ko(function(e,t){var n=e==null?0:e.length,r=oi(e,t);return sa(e,mn(t,function(e){return Xo(e,n)?+e:e}).sort(Ua)),r});function nc(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=G(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return sa(e,i),n}function rc(e){return e==null?e:Kt.call(e)}function ic(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&Zo(e,t,r)?(t=0,r=i):(t=t==null?0:J(t),r=r===n?i:J(r)),_a(e,t,r)):[]}function ac(e,t){return ya(e,t)}function oc(e,t,n){return ba(e,t,G(n,2))}function sc(e,t){var n=e==null?0:e.length;if(n){var r=ya(e,t);if(r<n&&Kl(e[r],t))return r}return-1}function cc(e,t){return ya(e,t,!0)}function lc(e,t,n){return ba(e,t,G(n,2),!0)}function uc(e,t){if(e!=null&&e.length){var n=ya(e,t,!0)-1;if(Kl(e[n],t))return n}return-1}function dc(e){return e&&e.length?xa(e):[]}function fc(e,t){return e&&e.length?xa(e,G(t,2)):[]}function pc(e){var t=e==null?0:e.length;return t?_a(e,1,t):[]}function mc(e,t,r){return e&&e.length?(t=r||t===n?1:J(t),_a(e,0,t<0?0:t)):[]}function hc(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:J(t),t=i-t,_a(e,t<0?0:t,i)):[]}function gc(e,t){return e&&e.length?Da(e,G(t,3),!1,!0):[]}function _c(e,t){return e&&e.length?Da(e,G(t,3)):[]}var vc=ua(function(e){return wa(yi(e,1,$l,!0))}),yc=ua(function(e){var t=Ys(e);return $l(t)&&(t=n),wa(yi(e,1,$l,!0),G(t,2))}),bc=ua(function(e){var t=Ys(e);return t=typeof t==`function`?t:n,wa(yi(e,1,$l,!0),n,t)});function xc(e){return e&&e.length?wa(e):[]}function Sc(e,t){return e&&e.length?wa(e,G(t,2)):[]}function Cc(e,t){return t=typeof t==`function`?t:n,e&&e.length?wa(e,n,t):[]}function wc(e){if(!(e&&e.length))return[];var t=0;return e=dn(e,function(e){if($l(e))return t=Ft(e.length,t),!0}),Nn(t,function(t){return mn(e,On(t))})}function Tc(e,t){if(!(e&&e.length))return[];var r=wc(e);return t==null?r:mn(r,function(e){return on(t,n,e)})}var Ec=ua(function(e,t){return $l(e)?fi(e,t):[]}),Dc=ua(function(e){return ka(dn(e,$l))}),Oc=ua(function(e){var t=Ys(e);return $l(t)&&(t=n),ka(dn(e,$l),G(t,2))}),kc=ua(function(e){var t=Ys(e);return t=typeof t==`function`?t:n,ka(dn(e,$l),n,t)}),Ac=ua(wc);function jc(e,t){return Aa(e||[],t||[],ei)}function Mc(e,t){return Aa(e||[],t||[],pa)}var Nc=ua(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,Tc(e,r)});function Pc(e){var t=U(e);return t.__chain__=!0,t}function Fc(e,t){return t(e),e}function Ic(e,t){return t(e)}var Lc=ko(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return oi(t,e)};return t>1||this.__actions__.length||!(i instanceof vr)||!Xo(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:Ic,args:[a],thisArg:n}),new _r(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function Rc(){return Pc(this)}function zc(){return new _r(this.value(),this.__chain__)}function Bc(){this.__values__===n&&(this.__values__=Pu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}}function Vc(){return this}function Hc(e){for(var t,r=this;r instanceof gr;){var i=ws(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t}function q(){var e=this.__wrapped__;if(e instanceof vr){var t=e;return this.__actions__.length&&(t=new vr(this)),t=t.reverse(),t.__actions__.push({func:Ic,args:[rc],thisArg:n}),new _r(t,this.__chain__)}return this.thru(rc)}function Uc(){return Oa(this.__wrapped__,this.__actions__)}var Wc=Za(function(e,t,n){ot.call(e,n)?++e[n]:ai(e,n,1)});function Gc(e,t,r){var i=Xl(e)?un:hi;return r&&Zo(e,t,r)&&(t=n),i(e,G(t,3))}function Kc(e,t){return(Xl(e)?dn:vi)(e,G(t,3))}var qc=so(Is),Jc=so(Ls);function Yc(e,t){return yi(il(e,t),1)}function Xc(e,t){return yi(il(e,t),h)}function Zc(e,t,r){return r=r===n?1:J(r),yi(il(e,t),r)}function Qc(e,t){return(Xl(e)?cn:pi)(e,G(t,3))}function $c(e,t){return(Xl(e)?ln:mi)(e,G(t,3))}var el=Za(function(e,t,n){ot.call(e,n)?e[n].push(t):ai(e,n,[t])});function tl(e,t,n,r){e=Ql(e)?e:Od(e),n=n&&!r?J(n):0;var i=e.length;return n<0&&(n=Ft(i+n,0)),Eu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&wn(e,t,n)>-1}var nl=ua(function(e,t,n){var r=-1,i=typeof t==`function`,a=Ql(e)?Pe(e.length):[];return pi(e,function(e){a[++r]=i?on(t,e,n):Pi(e,t,n)}),a}),rl=Za(function(e,t,n){ai(e,n,t)});function il(e,t){return(Xl(e)?mn:Xi)(e,G(t,3))}function al(e,t,r,i){return e==null?[]:(Xl(t)||(t=t==null?[]:[t]),r=i?n:r,Xl(r)||(r=r==null?[]:[r]),na(e,t,r))}var ol=Za(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function sl(e,t,n){var r=Xl(e)?gn:An,i=arguments.length<3;return r(e,G(t,4),n,i,pi)}function cl(e,t,n){var r=Xl(e)?_n:An,i=arguments.length<3;return r(e,G(t,4),n,i,mi)}function ll(e,t){return(Xl(e)?dn:vi)(e,kl(G(t,3)))}function ul(e){return(Xl(e)?Xr:da)(e)}function dl(e,t,r){return t=(r?Zo(e,t,r):t===n)?1:J(t),(Xl(e)?Zr:fa)(e,t)}function fl(e){return(Xl(e)?Qr:ga)(e)}function pl(e){if(e==null)return 0;if(Ql(e))return Eu(e)?nr(e):e.length;var t=Vo(e);return t==j||t==F?e.size:qi(e).length}function ml(e,t,r){var i=Xl(e)?vn:va;return r&&Zo(e,t,r)&&(t=n),i(e,G(t,3))}var hl=ua(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Zo(e,t[0],t[1])?t=[]:n>2&&Zo(t[0],t[1],t[2])&&(t=[t[0]]),na(e,yi(t,1),[])}),gl=wt||function(){return Jt.Date.now()};function _l(e,t){if(typeof t!=`function`)throw new tt(r);return e=J(e),function(){if(--e<1)return t.apply(this,arguments)}}function vl(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,So(e,f,n,n,n,n,t)}function yl(e,t){var i;if(typeof t!=`function`)throw new tt(r);return e=J(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var bl=ua(function(e,t,n){var r=o;if(n.length){var i=Zn(n,Po(bl));r|=u}return So(e,r,t,n,i)}),xl=ua(function(e,t,n){var r=o|s;if(n.length){var i=Zn(n,Po(xl));r|=u}return So(t,r,e,n,i)});function Sl(e,t,r){t=r?n:t;var i=So(e,c,n,n,n,n,n,t);return i.placeholder=Sl.placeholder,i}function Cl(e,t,r){t=r?n:t;var i=So(e,l,n,n,n,n,n,t);return i.placeholder=Cl.placeholder,i}function wl(e,t,i){var a,o,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new tt(r);t=Lu(t)||0,fu(i)&&(f=!!i.leading,p=`maxWait`in i,s=p?Ft(Lu(i.maxWait)||0,t):s,m=`trailing`in i?!!i.trailing:m);function h(t){var r=a,i=o;return a=o=n,d=t,c=e.apply(i,r),c}function g(e){return d=e,l=hs(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?Bt(i,s-r):i}function v(e){var r=e-u,i=e-d;return u===n||r>=t||r<0||p&&i>=s}function y(){var e=gl();if(v(e))return b(e);l=hs(y,_(e))}function b(e){return l=n,m&&a?h(e):(a=o=n,c)}function x(){l!==n&&Ia(l),d=0,a=u=o=l=n}function S(){return l===n?c:b(gl())}function C(){var e=gl(),r=v(e);if(a=arguments,o=this,u=e,r){if(l===n)return g(u);if(p)return Ia(l),l=hs(y,t),h(u)}return l===n&&(l=hs(y,t)),c}return C.cancel=x,C.flush=S,C}var Tl=ua(function(e,t){return di(e,1,t)}),El=ua(function(e,t,n){return di(e,Lu(t)||0,n)});function Dl(e){return So(e,m)}function Ol(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new tt(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Ol.Cache||Pr),n}Ol.Cache=Pr;function kl(e){if(typeof e!=`function`)throw new tt(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Al(e){return yl(2,e)}var jl=Pa(function(e,t){t=t.length==1&&Xl(t[0])?mn(t[0],In(G())):mn(yi(t,1),In(G()));var n=t.length;return ua(function(r){for(var i=-1,a=Bt(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return on(e,this,r)})}),Ml=ua(function(e,t){return So(e,u,n,t,Zn(t,Po(Ml)))}),Nl=ua(function(e,t){return So(e,d,n,t,Zn(t,Po(Nl)))}),Pl=ko(function(e,t){return So(e,p,n,n,n,t)});function Fl(e,t){if(typeof e!=`function`)throw new tt(r);return t=t===n?t:J(t),ua(e,t)}function Il(e,t){if(typeof e!=`function`)throw new tt(r);return t=t==null?0:Ft(J(t),0),ua(function(n){var r=n[t],i=Fa(n,0,t);return r&&hn(i,r),on(e,this,i)})}function Ll(e,t,n){var i=!0,a=!0;if(typeof e!=`function`)throw new tt(r);return fu(n)&&(i=`leading`in n?!!n.leading:i,a=`trailing`in n?!!n.trailing:a),wl(e,t,{leading:i,maxWait:t,trailing:a})}function Rl(e){return vl(e,1)}function zl(e,t){return Ml(Ma(t),e)}function Bl(){if(!arguments.length)return[];var e=arguments[0];return Xl(e)?e:[e]}function Vl(e){return ci(e,4)}function Hl(e,t){return t=typeof t==`function`?t:n,ci(e,4,t)}function Ul(e){return ci(e,5)}function Wl(e,t){return t=typeof t==`function`?t:n,ci(e,5,t)}function Gl(e,t){return t==null||ui(e,t,ld(t))}function Kl(e,t){return e===t||e!==e&&t!==t}var ql=_o(Oi),Jl=_o(function(e,t){return e>=t}),Yl=Fi(function(){return arguments}())?Fi:function(e){return pu(e)&&ot.call(e,`callee`)&&!_t.call(e,`callee`)},Xl=Pe.isArray,Zl=$t?In($t):Ii;function Ql(e){return e!=null&&du(e.length)&&!lu(e)}function $l(e){return pu(e)&&Ql(e)}function eu(e){return e===!0||e===!1||pu(e)&&Di(e)==T}var tu=kt||Ff,nu=en?In(en):Li;function ru(e){return pu(e)&&e.nodeType===1&&!Su(e)}function iu(e){if(e==null)return!0;if(Ql(e)&&(Xl(e)||typeof e==`string`||typeof e.splice==`function`||tu(e)||Ou(e)||Yl(e)))return!e.length;var t=Vo(e);if(t==j||t==F)return!e.size;if(rs(e))return!qi(e).length;for(var n in e)if(ot.call(e,n))return!1;return!0}function au(e,t){return Ri(e,t)}function ou(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?Ri(e,t,n,r):!!i}function su(e){if(!pu(e))return!1;var t=Di(e);return t==O||t==D||typeof e.message==`string`&&typeof e.name==`string`&&!Su(e)}function cu(e){return typeof e==`number`&&Mt(e)}function lu(e){if(!fu(e))return!1;var t=Di(e);return t==k||t==A||t==w||t==te}function uu(e){return typeof e==`number`&&e==J(e)}function du(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=g}function fu(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function pu(e){return typeof e==`object`&&!!e}var mu=tn?In(tn):Bi;function hu(e,t){return e===t||Vi(e,t,Io(t))}function gu(e,t,r){return r=typeof r==`function`?r:n,Vi(e,t,Io(t),r)}function _u(e){return xu(e)&&e!=+e}function vu(e){if(ns(e))throw new Ye(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Hi(e)}function yu(e){return e===null}function bu(e){return e==null}function xu(e){return typeof e==`number`||pu(e)&&Di(e)==M}function Su(e){if(!pu(e)||Di(e)!=P)return!1;var t=ht(e);if(t===null)return!0;var n=ot.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&at.call(n)==lt}var Cu=nn?In(nn):Ui;function wu(e){return uu(e)&&e>=-9007199254740991&&e<=g}var Tu=rn?In(rn):Wi;function Eu(e){return typeof e==`string`||!Xl(e)&&pu(e)&&Di(e)==re}function Du(e){return typeof e==`symbol`||pu(e)&&Di(e)==ie}var Ou=an?In(an):Gi;function ku(e){return e===n}function Au(e){return pu(e)&&Vo(e)==ae}function ju(e){return pu(e)&&Di(e)==oe}var Mu=_o(Yi),Nu=_o(function(e,t){return e<=t});function Pu(e){if(!e)return[];if(Ql(e))return Eu(e)?rr(e):qa(e);if(bt&&e[bt])return Jn(e[bt]());var t=Vo(e);return(t==j?Yn:t==F?Qn:Od)(e)}function Fu(e){return e?(e=Lu(e),e===h||e===-1/0?(e<0?-1:1)*17976931348623157e292:e===e?e:0):e===0?e:0}function J(e){var t=Fu(e),n=t%1;return t===t?n?t-n:t:0}function Iu(e){return e?si(J(e),0,v):0}function Lu(e){if(typeof e==`number`)return e;if(Du(e))return _;if(fu(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=fu(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Fn(e);var n=Ue.test(e);return n||We.test(e)?Gt(e.slice(2),n?2:8):He.test(e)?_:+e}function Ru(e){return Ja(e,ud(e))}function zu(e){return e?si(J(e),-9007199254740991,g):e===0?e:0}function Bu(e){return e==null?``:Ca(e)}var Vu=Qa(function(e,t){if(rs(t)||Ql(t)){Ja(t,ld(t),e);return}for(var n in t)ot.call(t,n)&&ei(e,n,t[n])}),Hu=Qa(function(e,t){Ja(t,ud(t),e)}),Uu=Qa(function(e,t,n,r){Ja(t,ud(t),e,r)}),Wu=Qa(function(e,t,n,r){Ja(t,ld(t),e,r)}),Gu=ko(oi);function Ku(e,t){var n=hr(e);return t==null?n:ri(n,t)}var qu=ua(function(e,t){e=Qe(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&Zo(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=ud(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||Kl(d,rt[u])&&!ot.call(e,u))&&(e[u]=o[u])}return e}),Ju=ua(function(e){return e.push(n,wo),on(md,n,e)});function Yu(e,t){return Sn(e,G(t,3),Si)}function Xu(e,t){return Sn(e,G(t,3),Ci)}function Zu(e,t){return e==null?e:bi(e,G(t,3),ud)}function Qu(e,t){return e==null?e:xi(e,G(t,3),ud)}function $u(e,t){return e&&Si(e,G(t,3))}function ed(e,t){return e&&Ci(e,G(t,3))}function td(e){return e==null?[]:wi(e,ld(e))}function nd(e){return e==null?[]:wi(e,ud(e))}function rd(e,t,r){var i=e==null?n:Ti(e,t);return i===n?r:i}function id(e,t){return e!=null&&Wo(e,t,ki)}function ad(e,t){return e!=null&&Wo(e,t,Ai)}var od=uo(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=ct.call(t)),e[t]=n},mf(Y)),sd=uo(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=ct.call(t)),ot.call(e,t)?e[t].push(n):e[t]=[n]},G),cd=ua(Pi);function ld(e){return Ql(e)?Yr(e):qi(e)}function ud(e){return Ql(e)?Yr(e,!0):Ji(e)}function dd(e,t){var n={};return t=G(t,3),Si(e,function(e,r,i){ai(n,t(e,r,i),e)}),n}function fd(e,t){var n={};return t=G(t,3),Si(e,function(e,r,i){ai(n,r,t(e,r,i))}),n}var pd=Qa(function(e,t,n){$i(e,t,n)}),md=Qa(function(e,t,n,r){$i(e,t,n,r)}),hd=ko(function(e,t){var n={};if(e==null)return n;var r=!1;t=mn(t,function(t){return t=Na(t,e),r||=t.length>1,t}),Ja(e,jo(e),n),r&&(n=ci(n,7,To));for(var i=t.length;i--;)Ta(n,t[i]);return n});function gd(e,t){return vd(e,kl(G(t)))}var _d=ko(function(e,t){return e==null?{}:ra(e,t)});function vd(e,t){if(e==null)return{};var n=mn(jo(e),function(e){return[e]});return t=G(t),ia(e,n,function(e,n){return t(e,n[0])})}function yd(e,t,r){t=Na(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[xs(t[i])];o===n&&(i=a,o=r),e=lu(o)?o.call(e):o}return e}function bd(e,t,n){return e==null?e:pa(e,t,n)}function xd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:pa(e,t,r,i)}var Sd=xo(ld),Cd=xo(ud);function wd(e,t,n){var r=Xl(e),i=r||tu(e)||Ou(e);if(t=G(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:fu(e)&&lu(a)?hr(ht(e)):{}}return(i?cn:Si)(e,function(e,r,i){return t(n,e,r,i)}),n}function Td(e,t){return e==null||Ta(e,t)}function Ed(e,t,n){return e==null?e:Ea(e,t,Ma(n))}function Dd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Ea(e,t,Ma(r),i)}function Od(e){return e==null?[]:Ln(e,ld(e))}function kd(e){return e==null?[]:Ln(e,ud(e))}function Ad(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=Lu(r),r=r===r?r:0),t!==n&&(t=Lu(t),t=t===t?t:0),si(Lu(e),t,r)}function jd(e,t,r){return t=Fu(t),r===n?(r=t,t=0):r=Fu(r),e=Lu(e),ji(e,t,r)}function Md(e,t,r){if(r&&typeof r!=`boolean`&&Zo(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Fu(e),t===n?(t=e,e=0):t=Fu(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=Ut();return Bt(e+a*(t-e+Wt(`1e-`+((a+``).length-1))),t)}return ca(e,t)}var Nd=ro(function(e,t,n){return t=t.toLowerCase(),e+(n?Pd(t):t)});function Pd(e){return cf(Bu(e).toLowerCase())}function Fd(e){return e=Bu(e),e&&e.replace(Ke,Hn).replace(jt,``)}function Id(e,t,r){e=Bu(e),t=Ca(t);var i=e.length;r=r===n?i:si(J(r),0,i);var a=r;return r-=t.length,r>=0&&e.slice(r,a)==t}function Ld(e){return e=Bu(e),e&&we.test(e)?e.replace(Se,Un):e}function Rd(e){return e=Bu(e),e&&Me.test(e)?e.replace(je,`\\$&`):e}var zd=ro(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),Bd=ro(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),Vd=no(`toLowerCase`);function Hd(e,t,n){e=Bu(e),t=J(t);var r=t?nr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return mo(Dt(i),n)+e+mo(Et(i),n)}function Ud(e,t,n){e=Bu(e),t=J(t);var r=t?nr(e):0;return t&&r<t?e+mo(t-r,n):e}function Wd(e,t,n){e=Bu(e),t=J(t);var r=t?nr(e):0;return t&&r<t?mo(t-r,n)+e:e}function Gd(e,t,n){return n||t==null?t=0:t&&=+t,Ht(Bu(e).replace(Ne,``),t||0)}function Kd(e,t,r){return t=(r?Zo(e,t,r):t===n)?1:J(t),la(Bu(e),t)}function qd(){var e=arguments,t=Bu(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Jd=ro(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function Yd(e,t,r){return r&&typeof r!=`number`&&Zo(e,t,r)&&(t=r=n),r=r===n?v:r>>>0,r?(e=Bu(e),e&&(typeof t==`string`||t!=null&&!Cu(t))&&(t=Ca(t),!t&&Kn(e))?Fa(rr(e),0,r):e.split(t,r)):[]}var Xd=ro(function(e,t,n){return e+(n?` `:``)+cf(t)});function Zd(e,t,n){return e=Bu(e),n=n==null?0:si(J(n),0,e.length),t=Ca(t),e.slice(n,n+t.length)==t}function Qd(e,t,r){var i=U.templateSettings;r&&Zo(e,t,r)&&(t=n),e=Bu(e),t=Wu({},t,i,Co);var a=Wu({},t.imports,i.imports,Co),o=ld(a),s=Ln(a,o);cn(o,function(e){if(Re.test(e))throw new Ye("Invalid `imports` option passed into `_.template`")});var c,l,u=0,d=t.interpolate||qe,f=`__p += '`,p=$e((t.escape||qe).source+`|`+d.source+`|`+(d===De?Be:qe).source+`|`+(t.evaluate||qe).source+`|$`,`g`),m=`//# sourceURL=`+(ot.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++Lt+`]`)+`
4`;e.replace(p,function(t,n,r,i,a,o){return r||=i,f+=e.slice(u,o).replace(Je,Wn),n&&(c=!0,f+=`' +
5__e(`+n+`) +
6'`),a&&(l=!0,f+=`';
7`+a+`;
8__p += '`),r&&(f+=`' +
9((__t = (`+r+`)) == null ? '' : __t) +
10'`),u=o+t.length,t}),f+=`';
11`;var h=ot.call(t,`variable`)&&t.variable;if(!h)f=`with (obj) {
12`+f+`
13}
14`;else if(Re.test(h))throw new Ye("Invalid `variable` option passed into `_.template`");f=(l?f.replace(ve,``):f).replace(ye,`$1`).replace(be,`$1;`),f=`function(`+(h||`obj`)+`) {
15`+(h?``:`obj || (obj = {});
16`)+`var __t, __p = ''`+(c?`, __e = _.escape`:``)+(l?`, __j = Array.prototype.join;
17function print() { __p += __j.call(arguments, '') }
18`:`;
19`)+f+`return __p
20}`;var g=uf(function(){return Xe(o,m+`return `+f).apply(n,s)});if(g.source=f,su(g))throw g;return g}function $d(e){return Bu(e).toLowerCase()}function ef(e){return Bu(e).toUpperCase()}function tf(e,t,r){if(e=Bu(e),e&&(r||t===n))return Fn(e);if(!e||!(t=Ca(t)))return e;var i=rr(e),a=rr(t);return Fa(i,zn(i,a),Bn(i,a)+1).join(``)}function nf(e,t,r){if(e=Bu(e),e&&(r||t===n))return e.slice(0,ir(e)+1);if(!e||!(t=Ca(t)))return e;var i=rr(e);return Fa(i,0,Bn(i,rr(t))+1).join(``)}function rf(e,t,r){if(e=Bu(e),e&&(r||t===n))return e.replace(Ne,``);if(!e||!(t=Ca(t)))return e;var i=rr(e);return Fa(i,zn(i,rr(t))).join(``)}function af(e,t){var r=30,i=`...`;if(fu(t)){var a=`separator`in t?t.separator:a;r=`length`in t?J(t.length):r,i=`omission`in t?Ca(t.omission):i}e=Bu(e);var o=e.length;if(Kn(e)){var s=rr(e);o=s.length}if(r>=o)return e;var c=r-nr(i);if(c<1)return i;var l=s?Fa(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),Cu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=$e(a.source,Bu(Ve.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Ca(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function of(e){return e=Bu(e),e&&Ce.test(e)?e.replace(xe,ar):e}var sf=ro(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),cf=no(`toUpperCase`);function lf(e,t,r){return e=Bu(e),t=r?n:t,t===n?qn(e)?cr(e):xn(e):e.match(t)||[]}var uf=ua(function(e,t){try{return on(e,n,t)}catch(e){return su(e)?e:new Ye(e)}}),df=ko(function(e,t){return cn(t,function(t){t=xs(t),ai(e,t,bl(e[t],e))}),e});function ff(e){var t=e==null?0:e.length,n=G();return e=t?mn(e,function(e){if(typeof e[1]!=`function`)throw new tt(r);return[n(e[0]),e[1]]}):[],ua(function(n){for(var r=-1;++r<t;){var i=e[r];if(on(i[0],this,n))return on(i[1],this,n)}})}function pf(e){return li(ci(e,1))}function mf(e){return function(){return e}}function hf(e,t){return e==null||e!==e?t:e}var gf=co(),_f=co(!0);function Y(e){return e}function vf(e){return Ki(typeof e==`function`?e:ci(e,1))}function yf(e){return Zi(ci(e,1))}function bf(e,t){return Qi(e,ci(t,1))}var xf=ua(function(e,t){return function(n){return Pi(n,e,t)}}),Sf=ua(function(e,t){return function(n){return Pi(e,n,t)}});function Cf(e,t,n){var r=ld(t),i=wi(t,r);n==null&&!(fu(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=wi(t,ld(t)));var a=!(fu(n)&&`chain`in n)||!!n.chain,o=lu(e);return cn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=qa(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,hn([this.value()],arguments))})}),e}function wf(){return Jt._===this&&(Jt._=ut),this}function Tf(){}function Ef(e){return e=J(e),ua(function(t){return ta(t,e)})}var Df=po(mn),Of=po(un),kf=po(vn);function Af(e){return Qo(e)?On(xs(e)):aa(e)}function jf(e){return function(t){return e==null?n:Ti(e,t)}}var Mf=go(),Nf=go(!0);function Pf(){return[]}function Ff(){return!1}function If(){return{}}function Lf(){return``}function Rf(){return!0}function zf(e,t){if(e=J(e),e<1||e>g)return[];var n=v,r=Bt(e,v);t=G(t),e-=v;for(var i=Nn(r,t);++n<e;)t(n);return i}function Bf(e){return Xl(e)?mn(e,xs):Du(e)?[e]:qa(bs(Bu(e)))}function Vf(e){var t=++B;return Bu(e)+t}var Hf=fo(function(e,t){return e+t},0),Uf=yo(`ceil`),Wf=fo(function(e,t){return e/t},1),Gf=yo(`floor`);function Kf(e){return e&&e.length?gi(e,Y,Oi):n}function qf(e,t){return e&&e.length?gi(e,G(t,2),Oi):n}function Jf(e){return Dn(e,Y)}function Yf(e,t){return Dn(e,G(t,2))}function Xf(e){return e&&e.length?gi(e,Y,Yi):n}function Zf(e,t){return e&&e.length?gi(e,G(t,2),Yi):n}var Qf=fo(function(e,t){return e*t},1),$f=yo(`round`),ep=fo(function(e,t){return e-t},0);function tp(e){return e&&e.length?Mn(e,Y):0}function np(e,t){return e&&e.length?Mn(e,G(t,2)):0}return U.after=_l,U.ary=vl,U.assign=Vu,U.assignIn=Hu,U.assignInWith=Uu,U.assignWith=Wu,U.at=Gu,U.before=yl,U.bind=bl,U.bindAll=df,U.bindKey=xl,U.c
20astArray=Bl,U.chain=Pc,U.chunk=Ts,U.compact=Es,U.concat=Ds,U.cond=ff,U.conforms=pf,U.constant=mf,U.countBy=Wc,U.create=Ku,U.curry=Sl,U.curryRight=Cl,U.debounce=wl,U.defaults=qu,U.defaultsDeep=Ju,U.defer=Tl,U.delay=El,U.difference=Os,U.differenceBy=ks,U.differenceWith=As,U.drop=js,U.dropRight=Ms,U.dropRightWhile=Ns,U.dropWhile=Ps,U.fill=Fs,U.filter=Kc,U.flatMap=Yc,U.flatMapDeep=Xc,U.flatMapDepth=Zc,U.flatten=Rs,U.flattenDeep=zs,U.flattenDepth=Bs,U.flip=Dl,U.flow=gf,U.flowRight=_f,U.fromPairs=Vs,U.functions=td,U.functionsIn=nd,U.groupBy=el,U.initial=Ws,U.intersection=Gs,U.intersectionBy=Ks,U.intersectionWith=qs,U.invert=od,U.invertBy=sd,U.invokeMap=nl,U.iteratee=vf,U.keyBy=rl,U.keys=ld,U.keysIn=ud,U.map=il,U.mapKeys=dd,U.mapValues=fd,U.matches=yf,U.matchesProperty=bf,U.memoize=Ol,U.merge=pd,U.mergeWith=md,U.method=xf,U.methodOf=Sf,U.mixin=Cf,U.negate=kl,U.nthArg=Ef,U.omit=hd,U.omitBy=gd,U.once=Al,U.orderBy=al,U.over=Df,U.overArgs=jl,U.overEvery=Of,U.overSome=kf,U.partial=Ml,U.partialRight=Nl,U.partition=ol,U.pick=_d,U.pickBy=vd,U.property=Af,U.propertyOf=jf,U.pull=K,U.pullAll=Qs,U.pullAllBy=$s,U.pullAllWith=ec,U.pullAt=tc,U.range=Mf,U.rangeRight=Nf,U.rearg=Pl,U.reject=ll,U.remove=nc,U.rest=Fl,U.reverse=rc,U.sampleSize=dl,U.set=bd,U.setWith=xd,U.shuffle=fl,U.slice=ic,U.sortBy=hl,U.sortedUniq=dc,U.sortedUniqBy=fc,U.split=Yd,U.spread=Il,U.tail=pc,U.take=mc,U.takeRight=hc,U.takeRightWhile=gc,U.takeWhile=_c,U.tap=Fc,U.throttle=Ll,U.thru=Ic,U.toArray=Pu,U.toPairs=Sd,U.toPairsIn=Cd,U.toPath=Bf,U.toPlainObject=Ru,U.transform=wd,U.unary=Rl,U.union=vc,U.unionBy=yc,U.unionWith=bc,U.uniq=xc,U.uniqBy=Sc,U.uniqWith=Cc,U.unset=Td,U.unzip=wc,U.unzipWith=Tc,U.update=Ed,U.updateWith=Dd,U.values=Od,U.valuesIn=kd,U.without=Ec,U.words=lf,U.wrap=zl,U.xor=Dc,U.xorBy=Oc,U.xorWith=kc,U.zip=Ac,U.zipObject=jc,U.zipObjectDeep=Mc,U.zipWith=Nc,U.entries=Sd,U.entriesIn=Cd,U.extend=Hu,U.extendWith=Uu,Cf(U,U),U.add=Hf,U.attempt=uf,U.camelCase=Nd,U.capitalize=Pd,U.ceil=Uf,U.clamp=Ad,U.clone=Vl,U.cloneDeep=Ul,U.cloneDeepWith=Wl,U.cloneWith=Hl,U.conformsTo=Gl,U.deburr=Fd,U.defaultTo=hf,U.divide=Wf,U.endsWith=Id,U.eq=Kl,U.escape=Ld,U.escapeRegExp=Rd,U.every=Gc,U.find=qc,U.findIndex=Is,U.findKey=Yu,U.findLast=Jc,U.findLastIndex=Ls,U.findLastKey=Xu,U.floor=Gf,U.forEach=Qc,U.forEac
vendor: 5,281 bytes, line 20
20hRight=$c,U.forIn=Zu,U.forInRight=Qu,U.forOwn=$u,U.forOwnRight=ed,U.get=rd,U.gt=ql,U.gte=Jl,U.has=id,U.hasIn=ad,U.head=Hs,U.identity=Y,U.includes=tl,U.indexOf=Us,U.inRange=jd,U.invoke=cd,U.isArguments=Yl,U.isArray=Xl,U.isArrayBuffer=Zl,U.isArrayLike=Ql,U.isArrayLikeObject=$l,U.isBoolean=eu,U.isBuffer=tu,U.isDate=nu,U.isElement=ru,U.isEmpty=iu,U.isEqual=au,U.isEqualWith=ou,U.isError=su,U.isFinite=cu,U.isFunction=lu,U.isInteger=uu,U.isLength=du,U.isMap=mu,U.isMatch=hu,U.isMatchWith=gu,U.isNaN=_u,U.isNative=vu,U.isNil=bu,U.isNull=yu,U.isNumber=xu,U.isObject=fu,U.isObjectLike=pu,U.isPlainObject=Su,U.isRegExp=Cu,U.isSafeInteger=wu,U.isSet=Tu,U.isString=Eu,U.isSymbol=Du,U.isTypedArray=Ou,U.isUndefined=ku,U.isWeakMap=Au,U.isWeakSet=ju,U.join=Js,U.kebabCase=zd,U.last=Ys,U.lastIndexOf=Xs,U.lowerCase=Bd,U.lowerFirst=Vd,U.lt=Mu,U.lte=Nu,U.max=Kf,U.maxBy=qf,U.mean=Jf,U.meanBy=Yf,U.min=Xf,U.minBy=Zf,U.stubArray=Pf,U.stubFalse=Ff,U.stubObject=If,U.stubString=Lf,U.stubTrue=Rf,U.multiply=Qf,U.nth=Zs,U.noConflict=wf,U.noop=Tf,U.now=gl,U.pad=Hd,U.padEnd=Ud,U.padStart=Wd,U.parseInt=Gd,U.random=Md,U.reduce=sl,U.reduceRight=cl,U.repeat=Kd,U.replace=qd,U.result=yd,U.round=$f,U.runInContext=e,U.sample=ul,U.size=pl,U.snakeCase=Jd,U.some=ml,U.sortedIndex=ac,U.sortedIndexBy=oc,U.sortedIndexOf=sc,U.sortedLastIndex=cc,U.sortedLastIndexBy=lc,U.sortedLastIndexOf=uc,U.startCase=Xd,U.startsWith=Zd,U.subtract=ep,U.sum=tp,U.sumBy=np,U.template=Qd,U.times=zf,U.toFinite=Fu,U.toInteger=J,U.toLength=Iu,U.toLower=$d,U.toNumber=Lu,U.toSafeInteger=zu,U.toString=Bu,U.toUpper=ef,U.trim=tf,U.trimEnd=nf,U.trimStart=rf,U.truncate=af,U.unescape=of,U.uniqueId=Vf,U.upperCase=sf,U.upperFirst=cf,U.each=Qc,U.eachRight=$c,U.first=Hs,Cf(U,function(){var e={};return Si(U,function(t,n){ot.call(U.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),U.VERSION=`4.18.1`,cn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){U[e].placeholder=U}),cn([`drop`,`take`],function(e,t){vr.prototype[e]=function(r){r=r===n?1:Ft(J(r),0);var i=this.__filtered__&&!t?new vr(this):this.clone();return i.__filtered__?i.__takeCount__=Bt(r,i.__takeCount__):i.__views__.push({size:Bt(r,v),type:e+(i.__dir__<0?`Right`:``)}),i},vr.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),cn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;vr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:G(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),cn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);vr.prototype[e]=function(){return this[n](1).value()[0]}}),cn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);vr.prototype[e]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Y)},vr.prototype.find=function(e){return this.filter(e).head()},vr.prototype.findLast=function(e){return this.reverse().find(e)},vr.prototype.invokeMap=ua(function(e,t){return typeof e==`function`?new vr(this):this.map(function(n){return Pi(n,e,t)})}),vr.prototype.reject=function(e){return this.filter(kl(G(e)))},vr.prototype.slice=function(e,t){e=J(e);var r=this;return r.__filtered__&&(e>0||t<0)?new vr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=J(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},vr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},vr.prototype.toArray=function(){return this.take(v)},Si(vr.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=U[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(U.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof vr,l=s[0],u=c||Xl(t),d=function(e){var t=a.apply(U,hn([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new vr(this);var g=e.apply(t,s);return g.__actions__.push({func:Ic,args:[d],thisArg:n}),new _r(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),cn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=z[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);U.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Xl(i)?i:[],e)}return this[n](function(n){return t.apply(Xl(n)?n:[],e)})}}),Si(vr.prototype,function(e,t){var n=U[t];if(n){var r=n.name+``;ot.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}}),kn[lo(n,s).name]=[{name:`wrapper`,func:n}],vr.prototype.clone=yr,vr.prototype.reverse=br,vr.prototype.value=xr,U.prototype.at=Lc,U.prototype.chain=Rc,U.prototype.commit=zc,U.prototype.next=Bc,U.prototype.plant=Hc,U.prototype.reverse=q,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=Uc,U.prototype.first=U.prototype.head,bt&&(U.prototype[bt]=Vc),U})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(Jt._=lr,define(function(){return lr})):Xt?((Xt.exports=lr)._=lr,Yt._=lr):Jt._=lr}).call(e)}));function d(e,t){return function(){return e.apply(t,arguments)}}var{toString:f}=Object.prototype,{getPrototypeOf:p}=Object,{iterator:m,toStringTag:h}=Symbol,g=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_=(e,t)=>
20{let n=e,r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),g(n,t))return!0;n=p(n)}return!1},v=(e,t)=>e!=null&&_(e,t)?e[t]:void 0,y=(e=>t=>{let n=f.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),b=e=>(e=e.toLowerCase(),t=>y(t)===e),x=e=>t=>typeof t===e,{isArray:S}=Array,C=x(`undefined`);function w(e){return e!==null&&!C(e)&&e.constructor!==null&&!C(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var T=b(`ArrayBuffer`);function E(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&T(e.buffer),t}var D=x(`string`),O=x(`function`),k=x(`number`),A=e=>typeof e==`object`&&!!e,j=e=>e===!0||e===!1,M=e=>{if(!A(e))return!1;let t=p(e);return(t===null||t===Object.prototype||p(t)===null)&&!_(e,h)&&!_(e,m)},N=e=>{if(!A(e)||w(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},P=b(`Date`),ee=b(`File`),te=e=>!!(e&&e.uri!==void 0),ne=e=>e&&e.getParts!==void 0,F=b(`Blob`),re=b(`FileList`),ie=b(`Set`),I=e=>A(e)&&O(e.pipe);function ae(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var oe=ae(),se=oe.FormData===void 0?void 0:oe.FormData,ce=e=>{if(!e)return!1;if(se&&e instanceof se)return!0;let t=p(e);if(!t||t===Object.prototype||!O(e.append))return!1;let n=y(e);return n===`formdata`||n===`object`&&O(e.toString)&&e.toString()===`[object FormData]`},le=b(`URLSearchParams`),[ue,de,fe,pe]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(b),me=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function he(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),S(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(w(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function ge(e,t){if(w(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-->0;)if(i=n[r],t===i.toLowerCase())return i;return null}var _e=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,ve=e=>!C(e)&&e!==_e;function ye(...e){let{caseless:t,skipUndefined:n}=ve(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&ge(r,i)||i,o=g(r,a)?r[a]:void 0;M(o)&&M(e)?r[a]=ye(o,e):M(e)?r[a]=ye({},e):S(e)?r[a]=e.slice():(!n||!C(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!n||w(n)||(he(n,i),typeof n!=`object`||S(n)))continue;let r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){let t=r[e];je.call(n,t)&&i(n[t],t)}}return r}var be=(e,t,n,{allOwnKeys:r}={})=>(he(t,(t,r)=>{n&&O(t)?Object.defineProperty(e,r,{__proto__:null,value:d(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),xe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Se=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Ce=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-->0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&p(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},we=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Te=e=>{if(!e)return null;if(S(e))return e;let t=e.length;if(!k(t))return null;let n=Array(t);for(;t-->0;)n[t]=e[t];return n},Ee=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&p(Uint8Array)),De=(e,t)=>{let n=(e&&e[m]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Oe=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ke=b(`HTMLFormElement`),Ae=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:je}=Object.prototype,Me=b(`RegExp`),Ne=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};he(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Pe=e=>{Ne(e,(t,n)=>{if(O(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(O(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Fe=(e,t)=>{let n={},r=e=>
20{e.forEach(e=>{n[e]=!0})};return S(e)?r(e):r(String(e).split(t)),n},L=()=>{},Ie=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Le(e){return!!(e&&O(e.append)&&e[h]===`FormData`&&e[m])}var Re=e=>{let t=new WeakSet,n=e=>{if(A(e)){if(t.has(e))return;if(w(e))return e;if(!(`toJSON`in e)){t.add(e);let r;if(ie(e)){r=[];for(let t of e){let e=n(t);!C(e)&&r.push(e)}}else r=S(e)?[]:{},he(e,(e,t)=>{let i=n(e);!C(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},ze=b(`AsyncFunction`),Be=e=>e&&(A(e)||O(e))&&O(e.then)&&O(e.catch),Ve=((e,t)=>e?setImmediate:t?((e,t)=>(_e.addEventListener(`message`,({source:n,data:r})=>{n===_e&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),_e.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,O(_e.postMessage)),He=typeof queueMicrotask<`u`?queueMicrotask.bind(_e):typeof process<`u`&&process.nextTick||Ve,Ue=e=>e!=null&&O(e[m]),R={isArray:S,isArrayBuffer:T,isBuffer:w,isFormData:ce,isArrayBufferView:E,isString:D,isNumber:k,isBoolean:j,isObject:A,isPlainObject:M,isEmptyObject:N,isReadableStream:ue,isRequest:de,isResponse:fe,isHeaders:pe,isUndefined:C,isDate:P,isFile:ee,isReactNativeBlob:te,isReactNative:ne,isBlob:F,isRegExp:Me,isFunction:O,isStream:I,isURLSearchParams:le,isTypedArray:Ee,isFileList:re,forEach:he,merge:ye,extend:be,trim:me,stripBOM:xe,inherits:Se,toFlatObject:Ce,kindOf:y,kindOfTest:b,endsWith:we,toArray:Te,forEachEntry:De,matchAll:Oe,isHTMLForm:ke,hasOwnProperty:g,hasOwnProp:g,hasOwnInPrototypeChain:_,getSafeProp:v,reduceDescriptors:Ne,freezeMethods:Pe,toObjectSet:Fe,toCamelCase:Ae,noop:L,toFiniteNumber:Ie,findKey:ge,global:_e,isContextDefined:ve,isSpecCompliantForm:Le,toJSONObject:Re,isAsyncFn:ze,isThenable:Be,setImmediate:Ve,asap:He,isIterable:Ue,isSafeIterable:e=>e!=null&&_(e,m)&&Ue(e)},We=R.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Ge=e=>{let t={},n,r,i;return e&&e.split(`
21`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim();let a=R.hasOwnProp(t,n);!n||a&&R.hasOwnProp(We,n)||(n===`set-cookie`?a?t[n].push(r):t[n]=[r]:t[n]=a?t[n]+`, `+r:r)}),t};function Ke(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var qe=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),Je=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function Ye(e,t){return R.isArray(e)?e.map(e=>Ye(e,t)):Ke(String(e).replace(t,``))}var Xe=e=>Ye(e,qe),Ze=e=>Ye(e,Je);function Qe(e){let t=Object.create(null);return R.forEach(e.toJSON(),(e,n)=>{t[n]=Ze(e)}),t}var $e=Symbol(`internals`);function et(e){return e&&String(e).trim().toLowerCase()}function tt(e){return e===!1||e==null?e:R.isArray(e)?e.map(tt):Xe(String(e))}function z(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var nt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function rt(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function it(e){let t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n=``;for(let r=1;r<t;r++){let i=e.charCodeAt(r);if(i===34||i===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function at(e){let t=Object.create(null),n=String(e),r=0,i=!1,a=!1;function o(e){let i=rt(n.slice(r,e)),a=i.indexOf(`=`);if(a<1)return;let o=rt(i.slice(0,a));if(!nt.test(o))return;let s=o.toLowerCase();if(s===`__proto__`||s===`constructor`||s===`prototype`)return;let c=rt(i.slice(a+1));t[s]=it(c)}for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);i?a?a=!1:t===92?a=!0:t===34&&(i=!1):t===34?i=!0:(t===44||t===59)&&(o(e),r=e+1)}return o(n.length),t}var ot=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function B(e,t,n,r,i){if(R.isFunction(r))return r.call(this,t,n);if(i&&(t=n),R.isString(t)){if(R.isString(r))return t.indexOf(r)!==-1;if(R.isRegExp(r))return r.test(t)}}function st(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function ct(e,t){let n=R.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var lt=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=et(t);if(!i)return;let a=R.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=tt(e))}let a=(e,t)=>
21R.forEach(e,(e,n)=>i(e,n,t));if(R.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(R.isString(e)&&(e=e.trim())&&!ot(e))a(Ge(e),t);else if(R.isObject(e)&&R.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!R.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],R.hasOwnProp(n,i)?(r=n[i],n[i]=R.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=et(e),e){let n=R.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return z(e);if(R.isFunction(t))return t.call(this,e,n);if(R.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=et(e),e){let n=R.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||B(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=et(e),e){let i=R.findKey(n,e);i&&(!t||B(n,n[i],i,t))&&(delete n[i],r=!0)}}return R.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||B(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return R.forEach(this,(r,i)=>{let a=R.findKey(n,i);if(a){t[a]=tt(r),delete t[i];return}let o=e?st(i):String(i).trim();o!==i&&delete t[i],t[o]=tt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return R.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&R.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
22`)}getSetCookie(){let e=this.get(`set-cookie`);return R.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return at(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[$e]=this[$e]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=et(e);t[r]||(ct(n,e),t[r]=!0)}return R.isArray(e)?e.forEach(r):r(e),this}};lt.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),R.reduceDescriptors(lt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),R.freezeMethods(lt);var ut=`[REDACTED ****]`;function dt(e){if(R.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(R.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function ft(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||R.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof lt&&(e=e.toJSON()),r.push(e);let t;if(R.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);R.isUndefined(r)||(t[n]=r)});else{if(!R.isPlainObject(e)&&dt(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?ut:i(a);R.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}function pt(e){try{return String(e)}catch{return``}}function mt(e){return e.errors.map(e=>{try{return e&&e.message?pt(e.message):pt(e)}catch{return``}}).filter(Boolean).join(`; `)||e.name||`AggregateError`}var V=class e extends Error{static from(t,n,r,i,a,o){let s=t.message;!s&&R.isArray(t.errors)&&t.errors.length&&(s=mt(t));let c=new e(s,n||t.code,r,i,a);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),o&&Object.assign(c,o),c}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&R.hasOwnProp(e,`redact`)?e.redact:void 0,n=R.isArray(t)&&t.length>0?ft(e,t):R.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,V.ERR_BAD_OPTION=`ERR_BAD_OPTION`,V.ECONNABORTED=`ECONNABORTED`,V.ETIMEDOUT=`ETIMEDOUT`,V.ECONNREFUSED=`ECONNREFUSED`,V.ERR_NETWORK=`E
22RR_NETWORK`,V.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,V.ERR_DEPRECATED=`ERR_DEPRECATED`,V.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,V.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,V.ERR_CANCELED=`ERR_CANCELED`,V.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,V.ERR_INVALID_URL=`ERR_INVALID_URL`,V.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function ht(e){return R.isPlainObject(e)||R.isArray(e)}function gt(e){return R.endsWith(e,`[]`)?e.slice(0,-2):e}function _t(e,t,n){return e?e.concat(t).map(function(e,t){return e=gt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function vt(e){return R.isArray(e)&&!e.some(ht)}var yt=R.toFlatObject(R,{},null,function(e){return/^is[A-Z]/.test(e)});function bt(e,t,n){if(!R.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=R.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!R.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||m,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&R.isSpecCompliantForm(t),u=[];if(!R.isFunction(i))throw TypeError(`visitor must be a function`);function d(e){if(e===null)return``;if(R.isDate(e))return e.toISOString();if(R.isBoolean(e))return e.toString();if(!l&&R.isBlob(e))throw new V(`Blob is not supported. Use a Buffer instead.`);if(R.isArrayBuffer(e)||R.isTypedArray(e)){if(l&&typeof s==`function`)return new s([e]);throw new V(`Blob is not supported. Use a Buffer instead.`,V.ERR_NOT_SUPPORT)}return e}function f(e){if(e>c)throw new V(`Object is too deeply nested (`+e+` levels). Max depth: `+c,V.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,t){if(c===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!R.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),f(t+n.length-1),r})}function m(e,n,i){let s=e;if(R.isReactNative(t)&&R.isReactNativeBlob(e))return t.append(_t(i,n,a),d(e)),!1;if(e&&!i&&typeof e==`object`){if(R.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=p(e,1);else if(R.isArray(e)&&vt(e)||(R.isFileList(e)||R.endsWith(n,`[]`))&&(s=R.toArray(e)))return n=gt(n),s.forEach(function(e,r){!(R.isUndefined(e)||e===null)&&t.append(o===!0?_t([n],r,a):o===null?n:n+`[]`,d(e))}),!1}return ht(e)?!0:(t.append(_t(i,n,a),d(e)),!1)}let h=Object.assign(yt,{defaultVisitor:m,convertValue:d,isVisitable:ht});function g(e,n,r=0){if(!R.isUndefined(e)){if(f(r),u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),R.forEach(e,function(e,a){(!(R.isUndefined(e)||e===null)&&i.call(t,e,R.isString(a)?a.trim():a,n,h))===!0&&g(e,n?n.concat(a):[a],r+1)}),u.pop()}}if(!R.isObject(e))throw TypeError(`data must be an object`);return g(e),t}function xt(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function St(e,t){this._pairs=[],e&&bt(e,this,t)}var Ct=St.prototype;Ct.append=function(e,t){this._pairs.push([e,t])},Ct.toString=function(e){let t=e?t=>e.call(this,t,xt):xt;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function wt(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Tt(e,t,n){if(!t)return e;e||=``;let r=R.isFunction(n)?{serialize:n}:n,i=R.getSafeProp(r,`encode`)||wt,a=R.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):R.isURLSearchParams(t)?t.toString():new St(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Et=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){R.forEach(this.handlers,function(t){t!==null&&e(t)})}},Dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Ot={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:St,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},kt=s({hasBrowserEnv:()=>At,hasStandardBrowserEnv:()=>Mt,hasStandardBrowserWebWorkerEnv:()=>Nt,navigator:()=>jt,origin:()=>Pt}),At=typeof window<`u`&&typeof document<`u`,jt=typeof navigator==`object`&&navigator||void 0,Mt=At&&(!jt||[`ReactNative`,`NativeScript`,`NS`].indexOf(jt.product)<0),Nt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Pt=At&&window.location.href||`http://localhost`,Ft={...kt,...Ot};function It(e,t){return bt(e,new Ft.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ft.
22isNode&&R.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}var Lt=100;function Rt(e){if(e>Lt)throw new V(`FormData field is too deeply nested (`+e+` levels). Max depth: `+Lt,V.ERR_FORM_DATA_DEPTH_EXCEEDED)}function zt(e){let t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g,r;for(;(r=n.exec(e))!==null;)Rt(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Bt(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Vt(e){function t(e,n,r,i){Rt(i);let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&R.isArray(r)?r.length:a,s?(R.hasOwnProp(r,a)?r[a]=R.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!R.hasOwnProp(r,a)||!R.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&R.isArray(r[a])&&(r[a]=Bt(r[a])),!o)}if(R.isFormData(e)&&R.isFunction(e.entries)){let n={};return R.forEachEntry(e,(e,r)=>{t(zt(e),r,n,0)}),n}return null}var Ht=(e,t)=>e!=null&&R.hasOwnProp(e,t)?e[t]:void 0;function Ut(e,t,n){if(R.isString(e))try{return(t||JSON.parse)(e),R.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var Wt={transitional:Dt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return r?JSON.stringify(Vt(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e)||R.isReadableStream(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Ht(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return It(e,t).toString();if((a=R.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Ht(this,`env`),r=n&&n.FormData;return bt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Ut(e)):e}],transformResponse:[function(e){let t=Ht(this,`transitional`)||Wt.transitional,n=t&&t.forcedJSONParsing,r=Ht(this,`responseType`),i=r===`json`;if(R.isResponse(e)||R.isReadableStream(e))return e;if(e&&R.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Ht(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?V.from(e,V.ERR_BAD_RESPONSE,this,null,Ht(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ft.classes.FormData,Blob:Ft.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};R.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{Wt.headers[e]={}});function Gt(e,t){let n=this||Wt,r=t||n,i=lt.from(r.headers),a=r.data;return R.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Kt(e){return!!(e&&e.__CANCEL__)}var qt=class extends V{constructor(e,t,n){super(e??`canceled`,V.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Jt(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new V(`Request failed with status code `+n.status,n.status>=400&&n.status<500?V.ERR_BAD_REQUEST:V.ERR_BAD_RESPONSE,n.config,n.request,n))}function Yt(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function Xt(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function Zt(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var H=(e,t,n=3)=>{let r=0,i=Xt(50,250);return Zt(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=Math.max(0,o==null?a:Math.min(a,o)),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Qt=(e,t)=>
22{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},$t=(e,t=R.asap)=>(...n)=>t(()=>e(...n)),en=Ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ft.origin),Ft.navigator&&/(msie|trident)/i.test(Ft.navigator.userAgent)):()=>!0,tn=Ft.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];R.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),R.isString(r)&&s.push(`path=${r}`),R.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),R.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function nn(e){return typeof e==`string`&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function rn(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+`/`+t.replace(/^\/+/,``)}var an=/^https?:(?!\/\/)/i,on=/[\t\n\r]/g;function sn(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function cn(e){return sn(e).replace(on,``)}function ln(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n=``)=>`${t}${n}${ut}`)}function un(e){let t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${ut}@`),n=t.indexOf(`#`),r=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${ut}`);return n===-1?r:`${r}#${ln(t.slice(n+1))}`}function dn(e,t){if(typeof e==`string`){let n=cn(e);if(an.test(n))throw new V(`Invalid URL ${JSON.stringify(un(n))}: missing "//" after protocol`,V.ERR_INVALID_URL,t)}}function fn(e,t,n,r){dn(t,r);let i=!nn(t);return e&&(i||n===!1)?(dn(e,r),rn(e,t)):t}var pn=e=>e instanceof lt?{...e}:e,mn=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function hn(e,t){e||={},t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return R.isPlainObject(e)&&R.isPlainObject(t)?R.merge.call({caseless:r},e,t):R.isPlainObject(t)?R.merge({},t):R.isArray(t)?t.slice():t}function i(e,t,n,i){if(!R.isUndefined(t))return r(e,t,n,i);if(!R.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!R.isUndefined(t))return r(void 0,t)}function o(e,t){if(!R.isUndefined(t))return r(void 0,t);if(!R.isUndefined(e))return r(void 0,e)}function s(n){let r=R.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!R.isUndefined(r))if(R.isPlainObject(r)){if(R.hasOwnProp(r,n))return r[n]}else return;let i=R.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(R.isPlainObject(i)&&R.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(R.hasOwnProp(t,a))return r(n,i);if(R.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(pn(e),pn(t),n,!0)};return R.forEach(mn({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=R.hasOwnProp(l,r)?l[r]:i,o=a(R.hasOwnProp(e,r)?e[r]:void 0,R.hasOwnProp(t,r)?t[r]:void 0,r);R.isUndefined(o)&&a!==c||(n[r]=o)}),R.hasOwnProp(t,`validateStatus`)&&R.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(R.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.val
22idateStatus),n}var gn=[`content-type`,`content-length`];function _n(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{gn.includes(t.toLowerCase())&&e.set(t,n)})}var vn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function yn(e){let t=hn({},e),n=e=>R.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=lt.from(s),t.url=Tt(fn(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=R.getSafeProp(c,`username`)||``,n=R.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?vn(n):``)))}catch(t){throw V.from(t,V.ERR_BAD_OPTION_VALUE,e)}}if(R.isFormData(r)&&(Ft.hasStandardBrowserEnv||Ft.hasStandardBrowserWebWorkerEnv||R.isReactNative(r)?s.setContentType(void 0):R.isFunction(r.getHeaders)&&_n(s,r.getHeaders(),n(`formDataHeaderPolicy`))),Ft.hasStandardBrowserEnv&&(R.isFunction(i)&&(i=i(t)),i===!0||i==null&&en(t.url))){let e=a&&o&&tn.read(o);e&&s.set(a,e)}return t}var bn=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=yn(e),i=r.data,a=lt.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=lt.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Jt(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new V(`Request aborted`,V.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new V(t&&t.message?t.message:`Network Error`,V.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Dt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new V(t,i.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&R.forEach(Qe(a),function(e,t){h.setRequestHeader(t,e)}),R.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=H(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=H(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new qt(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Yt(r.url);if(_&&!Ft.protocols.includes(_)){n(new V(`Unsupported protocol `+_+`:`,V.ERR_BAD_REQUEST,e)),m();return}h.send(i||null)})},xn=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof V?t:new qt(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new V(`timeout of ${t}ms exceeded`,V.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>{if(!r){if(e.aborted){i.call(e);return}e.addEventListener(`abort`,i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>R.asap(o),s},Sn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Cn=async function*(e,t){for await(let n of wn(e))yield*Sn(n,t)},wn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Tn=(e,t,n,r)=>{let i=Cn(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},En=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Dn=(e,t,n)=>t+2<n&&En(e.charCodeAt(t+1))&&En(e.charCodeAt(t+2)),On=e=>e<=57?e-48:(e&223)-55,kn=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,An=e=>e===9||e===10||e===12||e===13||e===32,jn=e=>{let t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},Mn=e=>{let t=e.length,n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},Nn=e=>{let t=e.length,n=0,r=0,i=!1;for(let a=0;a<t;a++){let o=e.charCodeAt(a);if(o===37&&Dn(e,a,t)&&(o=On(e.charCodeAt(a+1))*16+On(e.charCodeAt(a+2)),a+=2),!An(o)){if(o===61){r++;continue}if(!kn(o)||r>0){i=!0;continue}n++}}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?Mn(e):jn(n)},Pn=(e,t)=>{if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let n=e.indexOf(`,`);if(n<0)return 0;let r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(n===37&&Dn(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>
22=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a};function Fn(e){let t=typeof e==`string`?e.indexOf(`#`):-1;return Pn(t===-1?e:e.slice(0,t),Nn)}var In=`1.19.0`,Ln=65536,{isFunction:Rn}=R,zn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Bn=e=>{if(!R.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Vn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hn=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},Un=e=>{let t=R.global!==void 0&&R.global!==null?R.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=R.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?Rn(i):typeof fetch==`function`,c=Rn(a),l=Rn(o);if(!s)return!1;let u=s&&Rn(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Vn(()=>{let e=!1,t=new a(Ft.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Vn(()=>R.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(R.isBlob(e))return e.size;if(R.isSpecCompliantForm(e))return(await new a(Ft.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(R.isArrayBufferView(e)||R.isArrayBuffer(e))return e.byteLength;if(R.isURLSearchParams(e)&&(e+=``),R.isString(e))return(await d(e)).byteLength},g=async(e,t)=>R.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:S=`same-origin`,fetchOptions:C,maxContentLength:w,maxBodyLength:T}=yn(e),E=R.isNumber(w)&&w>-1,D=R.isNumber(T)&&T>-1,O=t=>R.hasOwnProp(e,t)?e[t]:void 0,k=i||fetch;b=b?(b+``).toLowerCase():`text`;let A=xn([l,d&&d.toAbortSignal()],_),j=null,M=A&&A.unsubscribe&&(()=>{A.unsubscribe()}),N,P=null,ee=()=>new V(`Request body larger than maxBodyLength limit`,V.ERR_BAD_REQUEST,e,j);try{let i,l=O(`auth`);if(l&&(i={username:R.getSafeProp(l,`username`)||``,password:R.getSafeProp(l,`password`)||``}),Hn(t)){let e=new URL(t,Ft.origin);!i&&(e.username||e.password)&&(i={username:Bn(e.username),password:Bn(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(zn((i.username||``)+`:`+(i.password||``))))),E&&typeof t==`string`&&t.startsWith(`data:`)&&Fn(t)>w)throw new V(`maxContentLength size of `+w+` exceeded`,V.ERR_BAD_RESPONSE,e,j);if(D&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(N=e,e>T))throw ee()}let d=D&&(R.isReadableStream(s)||R.isStream(s)),_=(e,t,n)=>Tn(e,Ln,e=>{if(D&&e>T)throw P=ee();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(N??=await g(x,s),N!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(R.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&Qt(N,H($t(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new V(`Stream request bodies are not supported by the current fetch implementation`,V.ERR_NOT_SUPPORT,e,j);R.isString(S)||(S=S?`include`:`omit`);let te=c&&`credentials`in a.prototype;if(R.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+In,!1);let ne={...C,signal:A,method:n.toUpperCase(),headers:Qe(x.normalize()),body:s,duplex:`half`,credentials:te?S:void 0};j=c&&new a(t,ne);let F=await(c?k(j,C):k(t,ne)),re=lt.from(F.headers);if(E){let t=R.toFiniteNumber(re.getContentLength());if(t!=null&&t>w)throw new V(`maxContentLength size of `+w+` exceeded`,V.ERR_BAD_RESPONSE,e,j)}let ie=p&&(b===`stream`||b===`response`);if(p&&F.body&&(v||E||ie&&M)){let t={};
22[`status`,`statusText`,`headers`].forEach(e=>{t[e]=F[e]});let n=R.toFiniteNumber(re.getContentLength()),[r,i]=v&&Qt(n,H($t(v),!0))||[],a=0;F=new o(Tn(F.body,Ln,t=>{if(E&&(a=t,a>w))throw new V(`maxContentLength size of `+w+` exceeded`,V.ERR_BAD_RESPONSE,e,j);r&&r(t)},()=>{i&&i(),M&&M()}),t)}b||=`text`;let I=await m[R.findKey(m,b)||`text`](F,e);if(E&&!p&&!ie){let t;if(I!=null&&(typeof I.byteLength==`number`?t=I.byteLength:typeof I.size==`number`?t=I.size:typeof I==`string`&&(t=typeof r==`function`?new r().encode(I).byteLength:I.length)),typeof t==`number`&&t>w)throw new V(`maxContentLength size of `+w+` exceeded`,V.ERR_BAD_RESPONSE,e,j)}return!ie&&M&&M(),await new Promise((t,n)=>{Jt(t,n,{data:I,headers:lt.from(F.headers),status:F.status,statusText:F.statusText,config:e,request:j})})}catch(t){if(M&&M(),A&&A.aborted&&A.reason instanceof V){let n=A.reason;throw n.config=e,j&&(n.request=j),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(P)throw j&&!P.request&&(P.request=j),P;if(t instanceof V)throw j&&!t.request&&(t.request=j),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new V(`Network Error`,V.ERR_NETWORK,e,j,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw V.from(t,t&&t.code,e,j,t&&t.response)}}},Wn=new Map,Gn=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Wn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Un(t)),l=c;return c};Gn();var Kn={http:null,xhr:bn,fetch:{get:Gn}};R.forEach(Kn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var qn=e=>`- ${e}`,Jn=e=>R.isFunction(e)||e===null||e===!1;function Yn(e,t){e=R.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!Jn(r)&&(i=Kn[(n=String(r)).toLowerCase()],i===void 0))throw new V(`Unknown adapter '${n}'`);if(i&&(R.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new V(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
23`+e.map(qn).join(`
24`):` `+qn(e[0]):`as no adapter specified`),V.ERR_NOT_SUPPORT)}return i}var Xn={getAdapter:Yn,adapters:Kn};function Zn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qt(null,e)}function Qn(e){return Zn(e),e.headers=lt.from(e.headers),e.data=Gt.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Xn.getAdapter(e.adapter||Wt.adapter,e)(e).then(function(t){Zn(e),e.response=t;try{t.data=Gt.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lt.from(t.headers),t},function(t){if(!Kt(t)&&(Zn(e),t&&t.response)){e.response=t.response;try{t.response.data=Gt.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lt.from(t.response.headers)}return Promise.reject(t)})}var $n={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{$n[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var er={};$n.transitional=function(e,t,n){function r(e,t){return`[Axios v`+In+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new V(r(i,` has been removed`+(t?` in `+t:``)),V.ERR_DEPRECATED);return t&&!er[i]&&(er[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),!e||e(n,i,a)}},$n.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function tr(e,t,n){if(typeof e!=`object`||!e)throw new V(`options must be an object`,V.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-->0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new V(`option `+a+` must be `+n,V.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new V(`Unknown option `+a,V.ERR_BAD_OPTION)}}var nr={assertOptions:tr,validators:$n},rr=nr.validators,ir=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Et,response:new Et}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>
24{if(!t.stack)return``;let e=t.stack.indexOf(`
25`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
26`),r=t===-1?-1:n.indexOf(`
27`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
28`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=hn(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&nr.assertOptions(n,{silentJSONParsing:rr.transitional(rr.boolean),forcedJSONParsing:rr.transitional(rr.boolean),clarifyTimeoutError:rr.transitional(rr.boolean),legacyInterceptorReqResOrdering:rr.transitional(rr.boolean),advertiseZstdAcceptEncoding:rr.transitional(rr.boolean),validateStatusUndefinedResolves:rr.transitional(rr.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:nr.assertOptions(r,{encode:rr.function,serialize:rr.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),nr.assertOptions(t,{baseUrl:rr.spelling(`baseURL`),withXsrfToken:rr.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&R.merge(i.common,i[t.method]);i&&R.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=lt.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Dt;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Qn.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{let n=t.call(this,e);R.isThenable(n)&&(l=Promise.resolve(n).then(()=>Qn.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Qn.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=hn(this.defaults,e),Tt(fn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};R.forEach([`delete`,`get`,`head`,`options`],function(e){ir.prototype[e]=function(t,n){return this.request(hn(n||{},{method:e,url:t,data:n&&R.hasOwnProp(n,`data`)?n.data:void 0}))}}),R.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(hn(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}ir.prototype[e]=t(),e!==`query`&&(ir.prototype[e+`Form`]=t(!0))});var ar=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new qt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function or(e){return function(t){return e.apply(null,t)}}function sr(e){return R.isObject(e)&&e.isAxiosError===!0}var cr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
28alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(cr).forEach(([e,t])=>{cr[t]=e});function lr(e){let t=new ir(e),n=d(ir.prototype.request,t);return R.extend(n,ir.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return lr(hn(e,t))},n}var ur=lr(Wt);ur.Axios=ir,ur.CanceledError=qt,ur.CancelToken=ar,ur.isCancel=Kt,ur.VERSION=In,ur.toFormData=bt,ur.AxiosError=V,ur.Cancel=ur.CanceledError,ur.all=function(e){return Promise.all(e)},ur.spread=or,ur.isAxiosError=sr,ur.mergeConfig=hn,ur.AxiosHeaders=lt,ur.formToJSON=e=>Vt(R.isHTMLForm(e)?new FormData(e):e),ur.getAdapter=Xn.getAdapter,ur.HttpStatusCode=cr,ur.default=ur;var dr=l(u());function fr(e){"@babel/helpers - typeof";return fr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fr(e)}function pr(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function U(e,t,n){return t&&mr(e.prototype,t),n&&mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hr(){return hr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}function gr(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vr(e,t)}function _r(e){return _r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_r(e)}function vr(e,t){return vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vr(e,t)}function yr(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function br(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function xr(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return br(e)}function Sr(e){var t=yr();return function(){var n=_r(e),r;if(t){var i=_r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xr(this,r)}}var Cr=function(){function e(){pr(this,e)}return U(e,[{key:`listenForWhisper`,value:function(e,t){return this.listen(`.client-`+e,t)}},{key:`notification`,value:function(e){return this.listen(`.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated`,e)}},{key:`stopListeningForWhisper`,value:function(e,t){return this.stopListening(`.client-`+e,t)}}]),e}(),wr=function(){function e(t){pr(this,e),this.namespace=t}return U(e,[{key:`format`,value:function(e){return[`.`,`\\`].includes(e.charAt(0))?e.substring(1):(this.namespace&&(e=this.namespace+`.`+e),e.replace(/\./g,`\\`))}},{key:`setNamespace`,value:function(e){this.namespace=e}}]),e}();function Tr(e){try{new e}catch(e){if(e.message.includes(`is not a constructor`))return!1}return!0}var Er=function(e){gr(n,e);var t=Sr(n);
28function n(e,r,i){var a;return pr(this,n),a=t.call(this),a.name=r,a.pusher=e,a.options=i,a.eventFormatter=new wr(a.options.namespace),a.subscribe(),a}return U(n,[{key:`subscribe`,value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:`unsubscribe`,value:function(){this.pusher.unsubscribe(this.name)}},{key:`listen`,value:function(e,t){return this.on(this.eventFormatter.format(e),t),this}},{key:`listenToAll`,value:function(e){var t=this;return this.subscription.bind_global(function(n,r){if(!n.startsWith(`pusher:`)){var i=t.options.namespace.replace(/\./g,`\\`);e(n.startsWith(i)?n.substring(i.length+1):`.`+n,r)}}),this}},{key:`stopListening`,value:function(e,t){return t?this.subscription.unbind(this.eventFormatter.format(e),t):this.subscription.unbind(this.eventFormatter.format(e)),this}},{key:`stopListeningToAll`,value:function(e){return e?this.subscription.unbind_global(e):this.subscription.unbind_global(),this}},{key:`subscribed`,value:function(e){return this.on(`pusher:subscription_succeeded`,function(){e()}),this}},{key:`error`,value:function(e){return this.on(`pusher:subscription_error`,function(t){e(t)}),this}},{key:`on`,value:function(e,t){return this.subscription.bind(e,t),this}}]),n}(Cr),Dr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`whisper`,value:function(e,t){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,t),this}}]),n}(Er),Or=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`whisper`,value:function(e,t){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,t),this}}]),n}(Er),kr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`here`,value:function(e){return this.on(`pusher:subscription_succeeded`,function(t){e(Object.keys(t.members).map(function(e){return t.members[e]}))}),this}},{key:`joining`,value:function(e){return this.on(`pusher:member_added`,function(t){e(t.info)}),this}},{key:`whisper`,value:function(e,t){return this.pusher.channels.channels[this.name].trigger(`client-${e}`,t),this}},{key:`leaving`,value:function(e){return this.on(`pusher:member_removed`,function(t){e(t.info)}),this}}]),n}(Dr),Ar=function(e){gr(n,e);var t=Sr(n);function n(e,r,i){var a;return pr(this,n),a=t.call(this),a.events={},a.listeners={},a.name=r,a.socket=e,a.options=i,a.eventFormatter=new wr(a.options.namespace),a.subscribe(),a}return U(n,[{key:`subscribe`,value:function(){this.socket.emit(`subscribe`,{channel:this.name,auth:this.options.auth||{}})}},{key:`unsubscribe`,value:function(){this.unbind(),this.socket.emit(`unsubscribe`,{channel:this.name,auth:this.options.auth||{}})}},{key:`listen`,value:function(e,t){return this.on(this.eventFormatter.format(e),t),this}},{key:`stopListening`,value:function(e,t){return this.unbindEvent(this.eventFormatter.format(e),t),this}},{key:`subscribed`,value:function(e){return this.on(`connect`,function(t){e(t)}),this}},{key:`error`,value:function(e){return this}},{key:`on`,value:function(e,t){var n=this;return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=function(t,r){n.name===t&&n.listeners[e]&&n.listeners[e].forEach(function(e){return e(r)})},this.socket.on(e,this.events[e])),this.listeners[e].push(t),this}},{key:`unbind`,value:function(){var e=this;Object.keys(this.events).forEach(function(t){e.unbindEvent(t)})}},{key:`unbindEvent`,value:function(e,t){this.listeners[e]=this.listeners[e]||[],t&&(this.listeners[e]=this.listeners[e].filter(function(e){return e!==t})),(!t||this.listeners[e].length===0)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}]),n}(Cr),jr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`whisper`,value:function(e,t){return this.socket.emit(`client event`,{channel:this.name,event:`client-${e}`,data:t}),this}}]),n}(Ar),Mr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`here`,value:function(e){return this.on(`presence:subscribed`,function(t){e(t.map(function(e){return e.user_info}))}),this}},{key:`joining`,value:function(e){return this.on(`presence:joining`,function(t){return e(t.user_info)}),this}},{key:`whisper`,value:function(e,t){return this.socket.emit(`client event`,{channel:this.name,event:`client-${e}`,data:t}),this}},{key:`leaving`,value:function(e){return this.on(`presence:leaving`,function(t){return e(t.user_info)}),this}}]),n}(jr),Nr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`subscribe`,value:function(){}},{key:`unsubscribe`,value:function(){}},{key:`listen`,value:function(e,t){return this}},{key:`listenToAll`,value:function(e){return this}},{key:`stopListening`,value:function(e,t){return this}},{key:`subscribed`,value:function(e){return this}},{key:`error`,value:function(e){return this}},{key:`on`,value:function(e,t){return this}}]),n}(Cr),Pr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`whisper`,value:function(e,t){return this}}]),n}(Nr),Fr=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`whisper`,value:function(e,t){return this}}]),n}(Nr),Ir=function(e){gr(n,e);var t=Sr(n);function n(){return pr(this,n),t.apply(this,arguments)}return U(n,[{key:`here`,value:function(e){return this}},{key:`joining`,value:function(e){return this}},{key:`whisper`,value:function(e,t){return this}},{key:`leaving`,value:function(e){return this}}]),n}(Pr),Lr=function(){function e(t){pr(this,e),this._defaultOptions={auth:{headers:{}},authEndpoint:`/broadcasting/auth`,userAuthentication:{endpoint:`/broadcasting/user-auth`,headers:{}}
28,broadcaster:`pusher`,csrfToken:null,bearerToken:null,host:null,key:null,namespace:`App.Events`},this.setOptions(t),this.connect()}return U(e,[{key:`setOptions`,value:function(e){this.options=hr(this._defaultOptions,e);var t=this.csrfToken();return t&&(this.options.auth.headers[`X-CSRF-TOKEN`]=t,this.options.userAuthentication.headers[`X-CSRF-TOKEN`]=t),t=this.options.bearerToken,t&&(this.options.auth.headers.Authorization=`Bearer `+t,this.options.userAuthentication.headers.Authorization=`Bearer `+t),e}},{key:`csrfToken`,value:function(){var e;return typeof window<`u`&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<`u`&&typeof document.querySelector==`function`&&(e=document.querySelector(`meta[name="csrf-token"]`))?e.getAttribute(`content`):null}}]),e}(),Rr=function(e){gr(n,e);var t=Sr(n);function n(){var e;return pr(this,n),e=t.apply(this,arguments),e.channels={},e}return U(n,[{key:`connect`,value:function(){this.pusher=this.options.client===void 0?this.options.Pusher?new this.options.Pusher(this.options.key,this.options):new Pusher(this.options.key,this.options):this.options.client}},{key:`signin`,value:function(){this.pusher.signin()}},{key:`listen`,value:function(e,t,n){return this.channel(e).listen(t,n)}},{key:`channel`,value:function(e){return this.channels[e]||(this.channels[e]=new Er(this.pusher,e,this.options)),this.channels[e]}},{key:`privateChannel`,value:function(e){return this.channels[`private-`+e]||(this.channels[`private-`+e]=new Dr(this.pusher,`private-`+e,this.options)),this.channels[`private-`+e]}},{key:`encryptedPrivateChannel`,value:function(e){return this.channels[`private-encrypted-`+e]||(this.channels[`private-encrypted-`+e]=new Or(this.pusher,`private-encrypted-`+e,this.options)),this.channels[`private-encrypted-`+e]}},{key:`presenceChannel`,value:function(e){return this.channels[`presence-`+e]||(this.channels[`presence-`+e]=new kr(this.pusher,`presence-`+e,this.options)),this.channels[`presence-`+e]}},{key:`leave`,value:function(e){var t=this;[e,`private-`+e,`private-encrypted-`+e,`presence-`+e].forEach(function(e,n){t.leaveChannel(e)})}},{key:`leaveChannel`,value:function(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}},{key:`socketId`,value:function(){return this.pusher.connection.socket_id}},{key:`disconnect`,value:function(){this.pusher.disconnect()}}]),n}(Lr),zr=function(e){gr(n,e);var t=Sr(n);function n(){var e;return pr(this,n),e=t.apply(this,arguments),e.channels={},e}return U(n,[{key:`connect`,value:function(){var e=this,t=this.getSocketIO();return this.socket=t(this.options.host,this.options),this.socket.on(`reconnect`,function(){Object.values(e.channels).forEach(function(e){e.subscribe()})}),this.socket}},{key:`getSocketIO`,value:function(){if(this.options.client!==void 0)return this.options.client;if(typeof io<`u`)return io;throw Error(`Socket.io client not found. Should be globally available or passed via options.client`)}},{key:`listen`,value:function(e,t,n){return this.channel(e).listen(t,n)}},{key:`channel`,value:function(e){return this.channels[e]||(this.channels[e]=new Ar(this.socket,e,this.options)),this.channels[e]}},{key:`privateChannel`,value:function(e){return this.channels[`private-`+e]||(this.channels[`private-`+e]=new jr(this.socket,`private-`+e,this.options)),this.channels[`private-`+e]}},{key:`presenceChannel`,value:function(e){return this.channels[`presence-`+e]||(this.channels[`presence-`+e]=new Mr(this.socket,`presence-`+e,this.options)),this.channels[`presence-`+e]}},{key:`leave`,value:function(e){var t=this;[e,`private-`+e,`presence-`+e].forEach(function(e){t.leaveChannel(e)})}},{key:`leaveChannel`,value:function(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}},{key:`socketId`,value:function(){return this.socket.id}},{key:`disconnect`,value:function(){this.socket.disconnect()}}]),n}(Lr),Br=function(e){gr(n,e);var t=Sr(n);function n(){var e;return pr(this,n),e=t.apply(this,arguments),e.channels={},e}return U(n,[{key:`connect`,value:function(){}},{key:`listen`,value:function(e,t,n){return new Nr}},{key:`channel`,value:function(e){return new Nr}},{key:`privateChannel`,value:function(e){return new Pr}},{key:`encryptedPrivateChannel`,value:function(e){return new Fr}},{key:`presenceChannel`,value:function(e){return new Ir}},{key:`leave`,value:function(e){}},{key:`leaveChannel`,value:function(e){}},{key:`socketId`,value:function(){return`fake-socket-id`}},{key:`disconnect`,value:function(){}}]),n}(Lr),Vr=function(){function e(t){pr(this,e),this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return U(e,[{key:`channel`,value:function(e){return this.connector.channel(e)}},{key:`connect`,value:function(){if(this.options.broadcaster==`reverb`)this.connector=new Rr(hr(hr({},this.options),{cluster:``}));else if(this.options.broadcaster==`pusher`)this.connector=new Rr(this.options);else if(this.options.broadcaster==`socket.io`)this.connector=new zr(this.options);else if(this.options.broadcaster==`null`)this.connector=new Br(this.options);else if(typeof this.options.broadcaster==`function`&&Tr(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw Error(`Broadcaster ${fr(this.options.broadcaster)} ${this.options.broadcaster} is not supported.`)}},{key:`disconnect`,value:function(){this.connector.disconnect()}},{key:`join`,value:function(e){return this.connector.presenceChannel(e)}},{key:`leave`,value:function(e){this.connector.leave(e)}},{key:`leaveChannel`,value:function(e){this.connector.leaveChannel(e)}},{key:`leaveAllChannels`,value:function(){for(var e in this.connector.channels)this.leaveChannel(e)}},{key:`listen`,value:function(e,t,n){return this.connector.listen(e,t,n
28)}},{key:`private`,value:function(e){return this.connector.privateChannel(e)}},{key:`encryptedPrivate`,value:function(e){if(this.connector instanceof zr)throw Error(`Broadcaster ${fr(this.options.broadcaster)} ${this.options.broadcaster} does not support encrypted private channels.`);return this.connector.encryptedPrivateChannel(e)}},{key:`socketId`,value:function(){return this.connector.socketId()}},{key:`registerInterceptors`,value:function(){typeof Vue==`function`&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios==`function`&&this.registerAxiosRequestInterceptor(),typeof jQuery==`function`&&this.registerjQueryAjaxSetup(),(typeof Turbo>`u`?`undefined`:fr(Turbo))===`object`&&this.registerTurboRequestInterceptor()}},{key:`registerVueRequestInterceptor`,value:function(){var e=this;Vue.http.interceptors.push(function(t,n){e.socketId()&&t.headers.set(`X-Socket-ID`,e.socketId()),n()})}},{key:`registerAxiosRequestInterceptor`,value:function(){var e=this;axios.interceptors.request.use(function(t){return e.socketId()&&(t.headers[`X-Socket-Id`]=e.socketId()),t})}},{key:`registerjQueryAjaxSetup`,value:function(){var e=this;jQuery.ajax!==void 0&&jQuery.ajaxPrefilter(function(t,n,r){e.socketId()&&r.setRequestHeader(`X-Socket-Id`,e.socketId())})}},{key:`registerTurboRequestInterceptor`,value:function(){var e=this;document.addEventListener(`turbo:before-fetch-request`,function(t){t.detail.fetchOptions.headers[`X-Socket-Id`]=e.socketId()})}}]),e}(),Hr=l(o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.Pusher=r():n.Pusher=r()})(window,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(t&1&&(e=n(e)),t&8||t&4&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),t&2&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=2)})([(function(e,t,n){"use strict";var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,"__esModule",{value:!0});var i=256,a=function(){function e(e){e===void 0&&(e=`=`),this._paddingCharacter=e}return e.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},e.prototype.encode=function(e){for(var t=``,n=0;n<e.length-2;n+=3){var r=e[n]<<16|e[n+1]<<8|e[n+2];t+=this._encodeByte(r>>>18&63),t+=this._encodeByte(r>>>12&63),t+=this._encodeByte(r>>>6&63),t+=this._encodeByte(r>>>0&63)}var i=e.length-n;if(i>0){var r=e[n]<<16|(i===2?e[n+1]<<8:0);t+=this._encodeByte(r>>>18&63),t+=this._encodeByte(r>>>12&63),t+=i===2?this._encodeByte(r>>>6&63):this._paddingCharacter||``,t+=this._paddingCharacter||``}return t},e.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},e.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},e.prototype.decode=function(e){if(e.length===0)return new Uint8Array;for(var t=this._getPaddingLength(e),n=e.length-t,r=new Uint8Array(this.maxDecodedLength(n)),a=0,o=0,s=0,c=0,l=0,u=0,d=0;o<n-4;o+=4)c=this._decodeChar(e.charCodeAt(o+0)),l=this._decodeChar(e.charCodeAt(o+1)),u=this._decodeChar(e.charCodeAt(o+2)),d=this._decodeChar(e.charCodeAt(o+3)),r[a++]=c<<2|l>>
28>4,r[a++]=l<<4|u>>>2,r[a++]=u<<6|d,s|=c&i,s|=l&i,s|=u&i,s|=d&i;if(o<n-1&&(c=this._decodeChar(e.charCodeAt(o)),l=this._decodeChar(e.charCodeAt(o+1)),r[a++]=c<<2|l>>>4,s|=c&i,s|=l&i),o<n-2&&(u=this._decodeChar(e.charCodeAt(o+2)),r[a++]=l<<4|u>>>2,s|=u&i),o<n-3&&(d=this._decodeChar(e.charCodeAt(o+3)),r[a++]=u<<6|d,s|=d&i),s!==0)throw Error(`Base64Coder: incorrect characters for decoding`);return r},e.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-15,t+=62-e>>>8&3,String.fromCharCode(t)},e.prototype._decodeChar=function(e){var t=i;return t+=(42-e&e-44)>>>8&-i+e-43+62,t+=(46-e&e-48)>>>8&-i+e-47+63,t+=(47-e&e-58)>>>8&-i+e-48+52,t+=(64-e&e-91)>>>8&-i+e-65+0,t+=(96-e&e-123)>>>8&-i+e-97+26,t},e.prototype._getPaddingLength=function(e){var t=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)t++;if(e.length<4||t>2)throw Error(`Base64Coder: incorrect padding`)}return t},e}();t.Coder=a;var o=new a;function s(e){return o.encode(e)}t.encode=s;function c(e){return o.decode(e)}t.decode=c;var l=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(e){var t=e;return t+=65,t+=25-e>>>8&6,t+=51-e>>>8&-75,t+=61-e>>>8&-13,t+=62-e>>>8&49,String.fromCharCode(t)},t.prototype._decodeChar=function(e){var t=i;return t+=(44-e&e-46)>>>8&-i+e-45+62,t+=(94-e&e-96)>>>8&-i+e-95+63,t+=(47-e&e-58)>>>8&-i+e-48+52,t+=(64-e&e-91)>>>8&-i+e-65+0,t+=(96-e&e-123)>>>8&-i+e-97+26,t},t}(a);t.URLSafeCoder=l;var u=new l;function d(e){return u.encode(e)}t.encodeURLSafe=d;function f(e){return u.decode(e)}t.decodeURLSafe=f,t.encodedLength=function(e){return o.encodedLength(e)},t.maxDecodedLength=function(e){return o.maxDecodedLength(e)},t.decodedLength=function(e){return o.decodedLength(e)}}),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=`utf8: invalid string`,i=`utf8: invalid source encoding`;function a(e){for(var t=new Uint8Array(o(e)),n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=192|i>>6,t[n++]=128|i&63):i<55296?(t[n++]=224|i>>12,t[n++]=128|i>>6&63,t[n++]=128|i&63):(r++,i=(i&1023)<<10,i|=e.charCodeAt(r)&1023,i+=65536,t[n++]=240|i>>18,t[n++]=128|i>>12&63,t[n++]=128|i>>6&63,t[n++]=128|i&63)}return t}t.encode=a;function o(e){for(var t=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)t+=1;else if(i<2048)t+=2;else if(i<55296)t+=3;else if(i<=57343){if(n>=e.length-1)throw Error(r);n++,t+=4}else throw Error(r)}return t}t.encodedLength=o;function s(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r&128){var a=void 0;if(r<224){if(n>=e.length)throw Error(i);var o=e[++n];if((o&192)!=128)throw Error(i);r=(r&31)<<6|o&63,a=128}else if(r<240){if(n>=e.length-1)throw Error(i);var o=e[++n],s=e[++n];if((o&192)!=128||(s&192)!=128)throw Error(i);r=(r&15)<<12|(o&63)<<6|s&63,a=2048}else if(r<248){if(n>=e.length-2)throw Error(i);var o=e[++n],s=e[++n],c=e[++n];if((o&192)!=128||(s&192)!=128||(c&192)!=128)throw Error(i);r=(r&15)<<18|(o&63)<<12|(s&63)<<6|c&63,a=65536}else throw Error(i);if(r<a||r>=55296&&r<=57343)throw Error(i);if(r>=65536){if(r>1114111)throw Error(i);r-=65536,t.push(String.fromCharCode(55296|r>>10)),r=56320|r&1023}}t.push(String.fromCharCode(r))}return t.join(``)}t.decode=s}),(function(e,t,n){e.exports=n(3).default}),(function(e,t,n){"use strict";n.r(t);var r=function(){function e(e,t){this.lastId=0,this.prefix=e,this.name=t}return e.prototype.create=function(e){this.lastId++;var t=this.lastId,n=this.prefix+t,r=this.name+`[`+t+`]`,i=!1,a=function(){i||=(e.apply(null,arguments),!0)};return this[t]=a,{number:t,id:n,name:r,callback:a}},e.prototype.remove=function(e){delete this[e.number]},e}(),i=new r(`_pusher_script_`,`Pusher.ScriptReceivers`),a={VERSION:`7.6.0`,PROTOCOL:7,wsPort:80,wssPort:443,wsPath:``,httpHost:`sockjs.pusher.com`,httpPort:80,httpsPort:443,httpPath:`/pusher`,stats_host:`stats.pusher.com`,authEndpoint:`/pusher/auth`,authTransport:`ajax`,activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:`mt1`,userAuthentication:{endpoint:`/pusher/user-auth`,transport:`ajax`},channelAuthorization:{endpoint:`/pusher/auth`,transport:`ajax`},cdn_http:`http://js.pusher.com`,cdn_https:`https://js.pusher.com`,dependency_suffix:``},o=function(){function e(e){this.options=e,this.receivers=e.receivers||i,this.loading={}}return e.prototype.load=function(e,t,n){var r=this;if(r.loading[e]&&r.loading[e].length>0)r.loading[e].push(n);else{r.loading[e]=[n];var i=H.createScriptRequest(r.getPath(e,t)),a=r.receivers.create(function(t){if(r.receivers.remove(a),r.loading[e]){var n=r.loading[e];delete r.loading[e];for(var o=function(e){e||i.cleanup()},s=0;s<n.length;s++)n[s](t,o)}});i.send(a)}},e.prototype.getRoot=function(e){var t,n=H.getDocument().location.protocol;return t=e&&e.useTLS||n===`https:`?this.options.cdn_https:this.options.cdn_http,t.replace(/\/*$/,``)+`/`+this.options.version},e.prototype.getPath=function(e,t){return this.getRoot(t)+`/`+e+this.options.suffix+`.js`},e}(),s=new r(`_pusher_dependencies`,`Pusher.DependenciesReceivers`),c=new o({cdn_http:a.cdn_http,cdn_https:a.cdn_https,version:a.VERSION,suffix:a.dependency_suffix,receivers:s}),l={baseUrl:`https://pusher.com`,urls:{authenticationEndpoint:{path:`/docs/channels/server_api/authenticating_users`},authorizationEndpoint:{path:`/docs/channels/server_api/authorizing-users/`},javascriptQuickStart:{path:`/docs/javascript_quick_start`},triggeringClientEvents:{path:`/docs/client_api_guide/client_events#trigger-events`},encryptedChannelSupport:{fullUrl:`https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support`}}},u={buildLogSuffix:function(e){var t=`See:`,n=l.urls[e];if(!n)return``;var r;return n.fullUrl?r=n.fullUrl:n.path&&(r=l.baseUrl+n.path),r?t+` `+r:``}},d;(function(e){e.UserAuthentication=`user-authentication`,e.ChannelAuthorization=`channel-authorization`})(d||={});var f=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}
28t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),p=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),m=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),h=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),g=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),_=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),v=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),y=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),b=function(e){f(t,e);function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return t}(Error),x=function(e){f(t,e);function t(t,n){var r=this.constructor,i=e.call(this,n)||this;return i.status=t,Object.setPrototypeOf(i,r.prototype),i}return t}(Error),S=function(e,t,n,r,i){var a=H.createXHR();for(var o in a.open(`POST`,n.endpoint,!0),a.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),n.headers)a.setRequestHeader(o,n.headers[o]);if(n.headersProvider!=null){var s=n.headersProvider();for(var o in s)a.setRequestHeader(o,s[o])}return a.onreadystatechange=function(){if(a.readyState===4)if(a.status===200){var e=void 0,t=!1;try{e=JSON.parse(a.responseText),t=!0}catch{i(new x(200,`JSON returned from `+r.toString()+` endpoint was invali
28d, yet status code was 200. Data was: `+a.responseText),null)}t&&i(null,e)}else{var o=``;switch(r){case d.UserAuthentication:o=u.buildLogSuffix(`authenticationEndpoint`);break;case d.ChannelAuthorization:o=`Clients must be authorized to join private or presence channels. `+u.buildLogSuffix(`authorizationEndpoint`)}i(new x(a.status,`Unable to retrieve auth string from `+r.toString()+` endpoint - `+(`received status: `+a.status+` from `+n.endpoint+`. `+o)),null)}},a.send(t),a};function C(e){return M(A(e))}for(var w=String.fromCharCode,T=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,E={},D=0,O=T.length;D<O;D++)E[T.charAt(D)]=D;var k=function(e){var t=e.charCodeAt(0);return t<128?e:t<2048?w(192|t>>>6)+w(128|t&63):w(224|t>>>12&15)+w(128|t>>>6&63)+w(128|t&63)},A=function(e){return e.replace(/[^\x00-\x7F]/g,k)},j=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[T.charAt(n>>>18),T.charAt(n>>>12&63),t>=2?`=`:T.charAt(n>>>6&63),t>=1?`=`:T.charAt(n&63)].join(``)},M=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,j)},N=function(){function e(e,t,n,r){var i=this;this.clear=t,this.timer=e(function(){i.timer&&=r(i.timer)},n)}return e.prototype.isRunning=function(){return this.timer!==null},e.prototype.ensureAborted=function(){this.timer&&=(this.clear(this.timer),null)},e}(),P=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();function ee(e){window.clearTimeout(e)}function te(e){window.clearInterval(e)}var ne=function(e){P(t,e);function t(t,n){return e.call(this,setTimeout,ee,t,function(e){return n(),null})||this}return t}(N),F=function(e){P(t,e);function t(t,n){return e.call(this,setInterval,te,t,function(e){return n(),e})||this}return t}(N),re={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(e){return new ne(0,e)},method:function(e){var t=Array.prototype.slice.call(arguments,1);return function(n){return n[e].apply(n,t.concat(arguments))}}};function ie(e){for(var t=[...arguments].slice(1),n=0;n<t.length;n++){var r=t[n];
28for(var i in r)e[i]=r[i]&&r[i].constructor&&r[i].constructor===Object?ie(e[i]||{},r[i]):r[i]}return e}function I(){for(var e=[`Pusher`],t=0;t<arguments.length;t++)typeof arguments[t]==`string`?e.push(arguments[t]):e.push(be(arguments[t]));return e.join(` : `)}function ae(e,t){var n=Array.prototype.indexOf;if(e===null)return-1;if(n&&e.indexOf===n)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}function oe(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n,e)}function se(e){var t=[];return oe(e,function(e,n){t.push(n)}),t}function ce(e){var t=[];return oe(e,function(e){t.push(e)}),t}function le(e,t,n){for(var r=0;r<e.length;r++)t.call(n||window,e[r],r,e)}function ue(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r,e,n));return n}function de(e,t){var n={};return oe(e,function(e,r){n[r]=t(e)}),n}function fe(e,t){t||=function(e){return!!e};for(var n=[],r=0;r<e.length;r++)t(e[r],r,e,n)&&n.push(e[r]);return n}function pe(e,t){var n={};return oe(e,function(r,i){(t&&t(r,i,e,n)||r)&&(n[i]=r)}),n}function me(e){var t=[];return oe(e,function(e,n){t.push([n,e])}),t}function he(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1}function ge(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0}function _e(e){return de(e,function(e){return typeof e==`object`&&(e=be(e)),encodeURIComponent(C(e.toString()))})}function ve(e){return ue(me(_e(pe(e,function(e){return e!==void 0}))),re.method(`join`,`=`)).join(`&`)}function ye(e){var t=[],n=[];return(function e(r,i){var a,o,s;switch(typeof r){case`object`:if(!r)return null;for(a=0;a<t.length;a+=1)if(t[a]===r)return{$ref:n[a]};if(t.push(r),n.push(i),Object.prototype.toString.apply(r)===`[object Array]`)for(s=[],a=0;a<r.length;a+=1)s[a]=e(r[a],i+`[`+a+`]`);else for(o in s={},r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=e(r[o],i+`[`+JSON.stringify(o)+`]`));return s;case`number`:case`string`:case`boolean`:return r}})(e,`$`)}function be(e){try{return JSON.stringify(e)}catch{return JSON.stringify(ye(e))}}var xe=new(function(){function e(){this.globalLog=function(e){window.console&&window.console.log&&window.console.log(e)}}return e.prototype.debug=function(){var e=[...arguments];this.log(this.globalLog,e)},e.prototype.warn=function(){var e=[...arguments];this.log(this.globalLogWarn,e)},e.prototype.error=function(){var e=[...arguments];this.log(this.globalLogError,e)},e.prototype.globalLogWarn=function(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)},e.prototype.globalLogError=function(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)},e.prototype.log=function(e){var t=I.apply(this,arguments);kn.log?kn.log(t):kn.logToConsole&&e.bind(this)(t)},e}()),Se=function(e,t,n,r,i){(n.headers!==void 0||n.headersProvider!=null)&&xe.warn(`To send headers with the `+r.toString()+` request, you must use AJAX, rather than JSONP.`);var a=e.nextAuthCallbackID.toString();e.nextAuthCallbackID++;var o=e.getDocument(),s=o.createElement(`script`);e.auth_callbacks[a]=function(e){i(null,e)};var c=`Pusher.auth_callbacks['`+a+`']`;s.src=n.endpoint+`?callback=`+encodeURIComponent(c)+`&`+t;var l=o.getElementsByTagName(`head`)[0]||o.documentElement;l.insertBefore(s,l.firstChild)},Ce=function(){function e(e){this.src=e}return e.prototype.send=function(e){var t=this,n=`Error loading `+t.src;t.script=document.createElement(`script`),t.script.id=e.id,t.script.src=t.src,t.script.type=`text/javascript`,t.script.charset=`UTF-8`,t.script.addEventListener?(t.script.onerror=function(){e.callback(n)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){(t.script.readyState===`loaded`||t.script.readyState===`complete`)&&e.callback(null)},t.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement(`script`),t.errorScript.id=e.id+`_error`,t.errorScript.text=e.name+`('`+n+`');`,t.script.async=t.errorScript.async=!1):t.script.async=!0;var r=document.getElementsByTagName(`head`)[0];r.insertBefore(t.script,r.firstChild),t.errorScript&&r.insertBefore(t.errorScript,t.script.nextSibling)},e.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},e}(),we=function(){function e(e,t){this.url=e,this.data=t}return e.prototype.send=function(e){if(!this.request){var t=ve(this.data),n=this.url+`/`+e.number+`?`+t;this.request=H.createScriptRequest(n),this.request.send(e)}},e.prototype.cleanup=function(){this.request&&this.request.cleanup()},e}(),Te={name:`jsonp`,getAgent:function(e,t){return function(n,r){var a=`http`+(t?`s`:``)+`://`+(e.host||e.options.host)+e.options.path,o=H.createJSONPRequest(a,n),s=H.ScriptReceivers.create(function(t,n){i.remove(s),o.cleanup(),n&&n.host&&(e.host=n.host),r&&r(t,n)});o.send(s)}}};function Ee(e,t,n){var r=e+(t.useTLS?`s`:``),i=t.useTLS?t.hostTLS:t.hostNonTLS;return r+`://`+i+n}function De(e,t){return`/app/`+e+(`?protocol=`+a.PROTOCOL+`&client=js&ver
28sion=`+a.VERSION+(t?`&`+t:``))}var Oe={getInitial:function(e,t){return Ee(`ws`,t,(t.httpPath||``)+De(e,`flash=false`))}},ke={getInitial:function(e,t){return Ee(`http`,t,(t.httpPath||`/pusher`)+De(e))}},Ae={getInitial:function(e,t){return Ee(`http`,t,t.httpPath||`/pusher`)},getPath:function(e,t){return De(e)}},je=function(){function e(){this._callbacks={}}return e.prototype.get=function(e){return this._callbacks[Me(e)]},e.prototype.add=function(e,t,n){var r=Me(e);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:t,context:n})},e.prototype.remove=function(e,t,n){if(!e&&!t&&!n){this._callbacks={};return}var r=e?[Me(e)]:se(this._callbacks);t||n?this.removeCallback(r,t,n):this.removeAllCallbacks(r)},e.prototype.removeCallback=function(e,t,n){le(e,function(e){this._callbacks[e]=fe(this._callbacks[e]||[],function(e){return t&&t!==e.fn||n&&n!==e.context}),this._callbacks[e].length===0&&delete this._callbacks[e]},this)},e.prototype.removeAllCallbacks=function(e){le(e,function(e){delete this._callbacks[e]},this)},e}();function Me(e){return`_`+e}var Ne=function(){function e(e){this.callbacks=new je,this.global_callbacks=[],this.failThrough=e}return e.prototype.bind=function(e,t,n){return this.callbacks.add(e,t,n),this},e.prototype.bind_global=function(e){return this.global_callbacks.push(e),this},e.prototype.unbind=function(e,t,n){return this.callbacks.remove(e,t,n),this},e.prototype.unbind_global=function(e){return e?(this.global_callbacks=fe(this.global_callbacks||[],function(t){return t!==e}),this):(this.global_callbacks=[],this)},e.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},e.prototype.emit=function(e,t,n){for(var r=0;r<this.global_callbacks.length;r++)this.global_callbacks[r](e,t);var i=this.callbacks.get(e),a=[];if(n?a.push(t,n):t&&a.push(t),i&&i.length>0)for(var r=0;r<i.length;r++)i[r].fn.apply(i[r].context||window,a);else this.failThrough&&this.failThrough(e,t);return this},e}(),Pe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Fe=function(e){Pe(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o.initialize=H.transportConnectionInitializer,o.hooks=t,o.name=n,o.priority=r,o.key=i,o.options=a,o.state=`new`,o.timeline=a.timeline,o.activityTimeout=a.activityTimeout,o.id=o.timeline.generateUniqueID(),o}return t.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},t.prototype.supportsPing=function(){return!!this.hooks.supportsPing},t.prototype.connect=function(){var e=this;if(this.socket||this.state!==`initialized`)return!1;var t=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(t,this.options)}catch(t){return re.defer(function(){e.onError(t),e.changeState(`closed`)}),!1}return this.bindListeners(),xe.debug(`Connecting`,{transport:this.name,url:t}),this.changeState(`connecting`),!0},t.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},t.prototype.send=function(e){var t=this;return this.state===`open`&&(re.defer(function(){t.socket&&t.socket.send(e)}),!0)},t.prototype.ping=function(){this.state===`open`&&this.supportsPing()&&this.socket.ping()},t.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState(`open`),this.socket.onopen=void 0},t.prototype.onError=function(e){this.emit(`error`,{type:`WebSocketError`,error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))},t.prototype.onClose=function(e){e?this.changeState(`closed`,{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState(`closed`),this.unbindListeners(),this.socket=void 0},t.prototype.onMessage=function(e){this.emit(`message`,e)},t.prototype.onActivity=function(){this.emit(`activity`)},t.prototype.bindListeners=function(){var e=this;this.socket.onopen=function(){e.onOpen()},this.socket.onerror=function(t){e.onError(t)},this.socket.onclose=function(t){e.onClose(t)},this.socket.onmessage=function(t){e.onMessage(t)},this.supportsPing()&&(this.socket.onactivity=function(){e.onActivity()})},t.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},t.prototype.changeState=function(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t}
28)),this.emit(e,t)},t.prototype.buildTimelineMessage=function(e){return ie({cid:this.id},e)},t}(Ne),L=function(){function e(e){this.hooks=e}return e.prototype.isSupported=function(e){return this.hooks.isSupported(e)},e.prototype.createConnection=function(e,t,n,r){return new Fe(this.hooks,e,t,n,r)},e}(),Ie=new L({urls:Oe,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!H.getWebSocketAPI()},isSupported:function(){return!!H.getWebSocketAPI()},getSocket:function(e){return H.createWebSocket(e)}}),Le={urls:ke,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Re=ie({getSocket:function(e){return H.HTTPFactory.createStreamingSocket(e)}},Le),ze=ie({getSocket:function(e){return H.HTTPFactory.createPollingSocket(e)}},Le),Be={isSupported:function(){return H.isXHRSupported()}},Ve={ws:Ie,xhr_streaming:new L(ie({},Re,Be)),xhr_polling:new L(ie({},ze,Be))},He=new L({file:`sockjs`,urls:Ae,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(e,t){return new window.SockJS(e,null,{js_path:c.getPath(`sockjs`,{useTLS:t.useTLS}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}}),Ue={isSupported:function(e){return H.isXDRSupported(e.useTLS)}},R=new L(ie({},Re,Ue)),We=new L(ie({},ze,Ue));Ve.xdr_streaming=R,Ve.xdr_polling=We,Ve.sockjs=He;var Ge=Ve,Ke=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),qe=new(function(e){Ke(t,e);function t(){var t=e.call(this)||this,n=t;return window.addEventListener!==void 0&&(window.addEventListener(`online`,function(){n.emit(`online`)},!1),window.addEventListener(`offline`,function(){n.emit(`offline`)},!1)),t}return t.prototype.isOnline=function(){return window.navigator.onLine===void 0||window.navigator.onLine},t}(Ne)),Je=function(){function e(e,t,n){this.manager=e,this.transport=t,this.minPingDelay=n.minPingDelay,this.maxPingDelay=n.maxPingDelay,this.pingDelay=void 0}return e.prototype.createConnection=function(e,t,n,r){var i=this;r=ie({},r,{activityTimeout:this.pingDelay});var a=this.transport.createConnection(e,t,n,r),o=null,s=function(){a.unbind(`open`,s),a.bind(`closed`,c),o=re.now()},c=function(e){if(a.unbind(`closed`,c),e.code===1002||e.code===1003)i.manager.reportDeath();else if(!e.wasClean&&o){var t=re.now()-o;t<2*i.maxPingDelay&&(i.manager.reportDeath(),i.pingDelay=Math.max(t/2,i.minPingDelay))}};return a.bind(`open`,s),a},e.prototype.isSupported=function(e){return this.manager.isAlive()&&this.transport.isSupported(e)},e}(),Ye={decodeMessage:function(e){try{var t=JSON.parse(e.data),n=t.data;if(typeof n==`string`)try{n=JSON.parse(t.data)}catch{}var r={event:t.event,channel:t.channel,data:n};return t.user_id&&(r.user_id=t.user_id),r}catch(t){throw{type:`MessageParseError`,error:t,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){var t=Ye.decodeMessage(e);if(t.event===`pusher:connection_established`){if(!t.data.activity_timeout)throw`No activity timeout specified in handshake`;return{action:`connected`,id:t.data.socket_id,activityTimeout:t.data.activity_timeout*1e3}}if(t.event===`pusher:error`)return{action:this.getCloseAction(t.data),error:this.getCloseError(t.data)};throw`Invalid handshake`},getCloseAction:function(e){return e.code<4e3?e.code>=1002&&e.code<=1004?`backoff`:null:e.code===4e3?`tls_only`:e.code<4100?`refused`:e.code<4200?`backoff`:e.code<4300?`retry`:`refused`},getCloseError:function(e){return e.code!==1e3&&e.code!==1001?{type:`PusherError`,data:{code:e.code,message:e.reason||e.message}}:null}},Xe=Ye,Ze=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}
28t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qe=function(e){Ze(t,e);function t(t,n){var r=e.call(this)||this;return r.id=t,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return t.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},t.prototype.send=function(e){return this.transport.send(e)},t.prototype.send_event=function(e,t,n){var r={event:e,data:t};return n&&(r.channel=n),xe.debug(`Event sent`,r),this.send(Xe.encodeMessage(r))},t.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event(`pusher:ping`,{})},t.prototype.close=function(){this.transport.close()},t.prototype.bindListeners=function(){var e=this,t={message:function(t){var n;try{n=Xe.decodeMessage(t)}catch(n){e.emit(`error`,{type:`MessageParseError`,error:n,data:t.data})}if(n!==void 0){switch(xe.debug(`Event recd`,n),n.event){case`pusher:error`:e.emit(`error`,{type:`PusherError`,data:n.data});break;case`pusher:ping`:e.emit(`ping`);break;case`pusher:pong`:e.emit(`pong`)}e.emit(`message`,n)}},activity:function(){e.emit(`activity`)},error:function(t){e.emit(`error`,t)},closed:function(t){n(),t&&t.code&&e.handleCloseEvent(t),e.transport=null,e.emit(`closed`)}},n=function(){oe(t,function(t,n){e.transport.unbind(n,t)})};oe(t,function(t,n){e.transport.bind(n,t)})},t.prototype.handleCloseEvent=function(e){var t=Xe.getCloseAction(e),n=Xe.getCloseError(e);
28n&&this.emit(`error`,n),t&&this.emit(t,{action:t,error:n})},t}(Ne),$e=function(){function e(e,t){this.transport=e,this.callback=t,this.bindListeners()}return e.prototype.close=function(){this.unbindListeners(),this.transport.close()},e.prototype.bindListeners=function(){var e=this;this.onMessage=function(t){e.unbindListeners();var n;try{n=Xe.processHandshake(t)}catch(t){e.finish(`error`,{error:t}),e.transport.close();return}n.action===`connected`?e.finish(`connected`,{connection:new Qe(n.id,e.transport),activityTimeout:n.activityTimeout}):(e.finish(n.action,{error:n.error}),e.transport.close())},this.onClosed=function(t){e.unbindListeners();var n=Xe.getCloseAction(t)||`backoff`,r=Xe.getCloseError(t);e.finish(n,{error:r})},this.transport.bind(`message`,this.onMessage),this.transport.bind(`closed`,this.onClosed)},e.prototype.unbindListeners=function(){this.transport.unbind(`message`,this.onMessage),this.transport.unbind(`closed`,this.onClosed)},e.prototype.finish=function(e,t){this.callback(ie({transport:this.transport,action:e},t))},e}(),et=function(){function e(e,t){this.timeline=e,this.options=t||{}}return e.prototype.send=function(e,t){this.timeline.isEmpty()||this.timeline.send(H.TimelineTransport.getAgent(this,e),t)},e}(),tt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),z=function(e){tt(t,e);function t(t,n){var r=e.call(this,function(e,n){xe.debug(`No callbacks on `+t+` for `+e)})||this;return r.name=t,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return t.prototype.authorize=function(e,t){return t(null,{auth:``})},t.prototype.trigger=function(e,t){if(e.indexOf(`client-`)!==0)throw new p(`Event '`+e+`' does not start with 'client-'`);if(!this.subscribed){var n=u.buildLogSuffix(`triggeringClientEvents`);xe.warn(`Client event triggered before channel 'subscription_succeeded' event . `+n)}return this.pusher.send_event(e,t,this.name)},t.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},t.prototype.handleEvent=function(e){var t=e.event,n=e.data;t===`pusher_internal:subscription_succeeded`?this.handleSubscriptionSucceededEvent(e):t===`pusher_internal:subscription_count`?this.handleSubscriptionCountEvent(e):t.indexOf(`pusher_internal:`)!==0&&this.emit(t,n,{})},t.prototype.handleSubscriptionSucceededEvent=function(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit(`pusher:subscription_succeeded`,e.data)},t.prototype.handleSubscriptionCountEvent=function(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit(`pusher:subscription_count`,e.data)},t.prototype.subscribe=function(){var e=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(t,n){t?(e.subscriptionPending=!1,xe.error(t.toString()),e.emit(`pusher:subscription_error`,Object.assign({},{type:`AuthError`,error:t.message},t instanceof x?{status:t.status}:{}))):e.pusher.send_event(`pusher:subscribe`,{auth:n.auth,channel_data:n.channel_data,channel:e.name})}))},t.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event(`pusher:unsubscribe`,{channel:this.name})},t.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},t.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},t}(Ne),nt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),rt=function(e){nt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.authorize=function(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)},t}(z),it=function(){function e(){this.reset()}return e.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null},e.prototype.each=function(e){var t=this;oe(this.members,function(n,r){e(t.get(r))})},e.prototype.setMyID=function(e){this.myID=e},e.prototype.onSubscription=function(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)},e.prototype.addMember=function(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)},e.prototype.removeMember=function(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t},e.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},e}(),at=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}
vendor: 1,071 bytes, line 28
28t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ot=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},B=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>
280&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},st=function(e){at(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.members=new it,r}return t.prototype.authorize=function(t,n){var r=this;e.prototype.authorize.call(this,t,function(e,t){return ot(r,void 0,void 0,function(){var r,i;return B(this,function(a){switch(a.label){case 0:return e?[3,3]:(t=t,t.channel_data==null?[3,1]:(r=JSON.parse(t.channel_data),this.members.setMyID(r.user_id),[3,3]));case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(a.sent(),this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else return i=u.buildLogSuffix(`authorizationEndpoint`),xe.error(`Invalid auth response for channel '`+this.name+`', `+(`expected 'channel_data' field. `+i+`, `)+`or the user should be signed in.`),n(`Invalid auth response`),[2];a.label=3;case 3:return n(e,t),[2]}})})})},t.prototype.handleEvent=function(e){var t=e.event;if(t.indexOf(`pusher_internal:`)===0)this.handleInternalEvent(e);else{var n=e.data,r={};e.user_id&&(r.user_id=e.user_id),this.emit(t,n,r)}},t.prototype.handleInternalEvent=function(e){var t=e.event,n=e.data;switch(t){case`pusher_internal:subscription_succeeded`:this.handleSubscriptionSucceededEvent(e);break;case`pusher_internal:subscription_count`:this.handleSubscriptionCountEvent(e);break;case`pusher_internal:member_added`:var r=this.members.addMember(n);this.emit(`pusher:member_added`,r);break;case`pusher_internal:member_removed`:var i=this.members.removeMember(n);i&&this.emit(`pusher:member_removed`,i)}},t.prototype.handleSubscriptionSucceededEvent=function(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit(`pusher:subscription_succeeded`,this.members))},t.prototype.disconnect=function(){this.members.reset(),e.prototype.disconnect.call(this)},t}(rt),ct=n(1),lt=n(0),ut=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),dt=function(e){ut(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.key=null,i.nacl=r,i}return t.prototype.authorize=function(t,n){var r=this;e.prototype.authorize.call(this,t,function(e,t){if(e){n(e,t);return}var i=t.shared_secret;if(!i){n(Error(`No shared_secret key in auth payload for encrypted channel: `+r.name),null);return}r.key=(0,lt.decode)(i),delete t.shared_secret,n(null,t)})},t.prototype.trigger=function(e,t){throw new v(`Client events are not currently supported for encrypted channels`)},t.prototype.handleEvent=function(t){var n=t.event,r=t.data;if(n.indexOf(`pusher_internal:`)===0||n.indexOf(`pusher:`)===0){e.prototype.handleEvent.call(this,t);return}this.handleEncryptedEvent(n,r)},t.prototype.handleEncryptedEvent=function(e,t){var n=this;if(!this.key){xe.debug(`Received encrypted event before key has been retrieved from the authEndpoint`);return}if(!t.ciphertext||!t.nonce){xe.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}var r=(0,lt.decode)(t.ciphertext);if(r.length<this.nacl.secretbox.overheadLength){xe.error(`Expected encrypted event ciphertext length to be `+this.nacl.secretbox.overheadLength+`, got: `+r.length);return}var i=(0,lt.decode)(t.nonce);if(i.length<this.nacl.secretbox.nonceLength){xe.error(`Expected encrypted event nonce length to be `+this.nacl.secretbox.nonceLength+`, got: `+i.length);return}var a=this.nacl.secretbox.open(r,i,this.key);if(a===null){xe.debug(`Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...`),this.authorize(this.pusher.connection.socket_id,function(t,o){if(t){xe.error(`Failed to make a request to the authEndpoint: `+o+`. Unable to fetch new key, so dropping encrypted event`);return}if(a=n.nacl.secretbox.open(r,i,n.key),a===null){xe.error(`Failed to decrypt event with new key. Dropping encrypted event`);return}n.emit(e,n.getDataToEmit(a))});return}
28this.emit(e,this.getDataToEmit(a))},t.prototype.getDataToEmit=function(e){var t=(0,ct.decode)(e);try{return JSON.parse(t)}catch{return t}},t}(rt),ft=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),pt=function(e){ft(t,e);function t(t,n){var r=e.call(this)||this;r.state=`initialized`,r.connection=null,r.key=t,r.options=n,r.timeline=r.options.timeline,r.usingTLS=r.options.useTLS,r.errorCallbacks=r.buildErrorCallbacks(),r.connectionCallbacks=r.buildConnectionCallbacks(r.errorCallbacks),r.handshakeCallbacks=r.buildHandshakeCallbacks(r.errorCallbacks);var i=H.getNetwork();return i.bind(`online`,function(){r.timeline.info({netinfo:`online`}),(r.state===`connecting`||r.state===`unavailable`)&&r.retryIn(0)}),i.bind(`offline`,function(){r.timeline.info({netinfo:`offline`}),r.connection&&r.sendActivityCheck()}),r.updateStrategy(),r}return t.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState(`failed`);return}this.updateState(`connecting`),this.startConnecting(),this.setUnavailableTimer()}},t.prototype.send=function(e){return this.connection?this.connection.send(e):!1},t.prototype.send_event=function(e,t,n){return this.connection?this.connection.send_event(e,t,n):!1},t.prototype.disconnect=function(){this.disconnectInternally(),this.updateState(`disconnected`)},t.prototype.isUsingTLS=function(){return this.usingTLS},t.prototype.startConnecting=function(){var e=this,t=function(n,r){n?e.runner=e.strategy.connect(0,t):r.action===`error`?(e.emit(`error`,{type:`HandshakeError`,error:r.error}),e.timeline.error({handshakeError:r.error})):(e.abortConnecting(),e.handshakeCallbacks[r.action](r))};this.runner=this.strategy.connect(0,t)},t.prototype.abortConnecting=function(){this.runner&&=(this.runner.abort(),null)},t.prototype.disconnectInternally=function(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()},t.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},t.prototype.retryIn=function(e){var t=this;this.timeline.info({action:`retry`,delay:e}),e>0&&this.emit(`connecting_in`,Math.round(e/1e3)),this.retryTimer=new ne(e||0,function(){t.disconnectInternally(),t.connect()})},t.prototype.clearRetryTimer=function(){this.retryTimer&&=(this.retryTimer.ensureAborted(),null)},t.prototype.setUnavailableTimer=function(){var e=this;this.unavailableTimer=new ne(this.options.unavailableTimeout,function(){e.updateState(`unavailable`)})},t.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},t.prototype.sendActivityCheck=function(){var e=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ne(this.options.pongTimeout,function(){e.timeline.error({pong_timed_out:e.options.pongTimeout}),e.retryIn(0)})},t.prototype.resetActivityCheck=function(){var e=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new ne(this.activityTimeout,function(){e.sendActivityCheck()}))},t.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},t.prototype.buildConnectionCallbacks=function(e){var t=this;return ie({},e,{message:function(e){t.resetActivityCheck(),t.emit(`message`,e)},ping:function(){t.send_event(`pusher:pong`,{})},activity:function(){t.resetActivityCheck()},error:function(e){t.emit(`error`,e)},closed:function(){t.abandonConnection(),t.shouldRetry()&&t.retryIn(1e3)}})},t.prototype.buildHandshakeCallbacks=function(e){var t=this;return ie({},e,{connected:function(e){t.activityTimeout=Math.min(t.options.activityTimeout,e.activityTimeout,e.connection.activityTimeout||1/0),t.clearUnavailableTimer(),t.setConnection(e.connection),t.socket_id=t.connection.id,t.updateState(`connected`,{socket_id:t.socket_id})}})},t.prototype.buildErrorCallbacks=function(){var e=this,t=function(t){return function(n){n.error&&e.emit(`error`,{type:`WebSocketError`,error:n.error}),t(n)}};return{tls_only:t(function(){e.usingTLS=!0,e.updateStrategy(),e.retryIn(0)}),refused:t(function(){e.disconnect()}),backoff:t(function(){e.retryIn(1e3)}),retry:t(function(){e.retryIn(0)})}},t.prototype.setConnection=function(e){for(var t in this.connection=e,this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()},t.prototype.abandonConnection=function(){if(this.connection){for(var e in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}},t.prototype.updateState=function(e,t){var n=this.state;if(this.state=e,n!==e){var r=e;r===`connected`&&(r+=` with new socket ID `+t.socket_id),xe.debug(`State changed`,n+` -> `+r),this.timeline.info({state:e,params:t}
28),this.emit(`state_change`,{previous:n,current:e}),this.emit(e,t)}},t.prototype.shouldRetry=function(){return this.state===`connecting`||this.state===`connected`},t}(Ne),mt=function(){function e(){this.channels={}}return e.prototype.add=function(e,t){return this.channels[e]||(this.channels[e]=V(e,t)),this.channels[e]},e.prototype.all=function(){return ce(this.channels)},e.prototype.find=function(e){return this.channels[e]},e.prototype.remove=function(e){var t=this.channels[e];return delete this.channels[e],t},e.prototype.disconnect=function(){oe(this.channels,function(e){e.disconnect()})},e}();function V(e,t){if(e.indexOf(`private-encrypted-`)===0){if(t.config.nacl)return ht.createEncryptedChannel(e,t,t.config.nacl);var n=`Tried to subscribe to a private-encrypted- channel but no nacl implementation available`,r=u.buildLogSuffix(`encryptedChannelSupport`);throw new v(n+`. `+r)}if(e.indexOf(`private-`)===0)return ht.createPrivateChannel(e,t);if(e.indexOf(`presence-`)===0)return ht.createPresenceChannel(e,t);if(e.indexOf(`#`)===0)throw new m(`Cannot create a channel with name "`+e+`".`);return ht.createChannel(e,t)}var ht={createChannels:function(){return new mt},createConnectionManager:function(e,t){return new pt(e,t)},createChannel:function(e,t){return new z(e,t)},createPrivateChannel:function(e,t){return new rt(e,t)},createPresenceChannel:function(e,t){return new st(e,t)},createEncryptedChannel:function(e,t,n){return new dt(e,t,n)},createTimelineSender:function(e,t){return new et(e,t)},createHandshake:function(e,t){return new $e(e,t)},createAssistantToTheTransportManager:function(e,t,n){return new Je(e,t,n)}},gt=function(){function e(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}return e.prototype.getAssistant=function(e){return ht.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},e.prototype.isAlive=function(){return this.livesLeft>0},e.prototype.reportDeath=function(){--this.livesLeft},e}(),_t=function(){function e(e,t){this.strategies=e,this.loop=!!t.loop,this.failFast=!!t.failFast,this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}return e.prototype.isSupported=function(){return he(this.strategies,re.method(`isSupported`))},e.prototype.connect=function(e,t){var n=this,r=this.strategies,i=0,a=this.timeout,o=null,s=function(c,l){l?t(null,l):(i+=1,n.loop&&(i%=r.length),i<r.length?(a&&(a*=2,n.timeoutLimit&&(a=Math.min(a,n.timeoutLimit))),o=n.tryStrategy(r[i],e,{timeout:a,failFast:n.failFast},s)):t(!0))};return o=this.tryStrategy(r[i],e,{timeout:a,failFast:this.failFast},s),{abort:function(){o.abort()},forceMinPriority:function(t){e=t,o&&o.forceMinPriority(t)}}},e.prototype.tryStrategy=function(e,t,n,r){var i=null,a=null;return n.timeout>0&&(i=new ne(n.timeout,function(){a.abort(),r(!0)})),a=e.connect(t,function(e,t){e&&i&&i.isRunning()&&!n.failFast||(i&&i.ensureAborted(),r(e,t))}),{abort:function(){i&&i.ensureAborted(),a.abort()},forceMinPriority:function(e){a.forceMinPriority(e)}}},e}(),vt=function(){function e(e){this.strategies=e}return e.prototype.isSupported=function(){return he(this.strategies,re.method(`isSupported`))},e.prototype.connect=function(e,t){return yt(this.strategies,e,function(e,n){return function(r,i){if(n[e].error=r,r){bt(n)&&t(!0);return}le(n,function(e){e.forceMinPriority(i.transport.priority)}),t(null,i)}})},e}();function yt(e,t,n){var r=ue(e,function(e,r,i,a){return e.connect(t,n(r,a))});return{abort:function(){le(r,xt)},forceMinPriority:function(e){le(r,function(t){t.forceMinPriority(e)})}}}function bt(e){return ge(e,function(e){return!!e.error})}function xt(e){!e.error&&!e.aborted&&(e.abort(),e.aborted=!0)}var St=function(){function e(e,t,n){this.strategy=e,this.transports=t,this.ttl=n.ttl||18e5,this.usingTLS=n.useTLS,this.timeline=n.timeline}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(e,t){var n=this.usingTLS,r=wt(n),i=[this.strategy];if(r&&r.timestamp+this.ttl>=re.now()){var a=this.transports[r.transport];a&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),i.push(new _t([a],{timeout:r.latency*2+1e3,failFast:!0})))}var o=re.now(),s=i.pop().connect(e,function r(a,c){a?(Et(n),i.length>0?(o=re.now(),s=i.pop().connect(e,r)):t(a)):(Tt(n,c.transport.name,re.now()-o),t(null,c))});return{abort:function(){s.abort()},forceMinPriority:function(t){e=t,s&&s.forceMinPriority(t)}}},e}();function Ct(e){return`pusherTransport`+(e?`TLS`:`NonTLS`)}function wt(e){var t=H.getLocalStorage();if(t)try{var n=t[Ct(e)];if(n)return JSON.parse(n)}catch{Et(e)}return null}function Tt(e,t,n){var r=H.getLocalStorage();
28if(r)try{r[Ct(e)]=be({timestamp:re.now(),transport:t,latency:n})}catch{}}function Et(e){var t=H.getLocalStorage();if(t)try{delete t[Ct(e)]}catch{}}var Dt=function(){function e(e,t){var n=t.delay;this.strategy=e,this.options={delay:n}}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(e,t){var n=this.strategy,r,i=new ne(this.options.delay,function(){r=n.connect(e,t)});return{abort:function(){i.ensureAborted(),r&&r.abort()},forceMinPriority:function(t){e=t,r&&r.forceMinPriority(t)}}},e}(),Ot=function(){function e(e,t,n){this.test=e,this.trueBranch=t,this.falseBranch=n}return e.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},e.prototype.connect=function(e,t){return(this.test()?this.trueBranch:this.falseBranch).connect(e,t)},e}(),kt=function(){function e(e){this.strategy=e}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(e,t){var n=this.strategy.connect(e,function(e,r){r&&n.abort(),t(e,r)});return n},e}();function At(e){return function(){return e.isSupported()}}var jt=function(e,t,n){var r={};function i(t,i,a,o,s){var c=n(e,t,i,a,o,s);return r[t]=c,c}var a=Object.assign({},t,{hostNonTLS:e.wsHost+`:`+e.wsPort,hostTLS:e.wsHost+`:`+e.wssPort,httpPath:e.wsPath}),o=Object.assign({},a,{useTLS:!0}),s=Object.assign({},t,{hostNonTLS:e.httpHost+`:`+e.httpPort,hostTLS:e.httpHost+`:`+e.httpsPort,httpPath:e.httpPath}),c={loop:!0,timeout:15e3,timeoutLimit:6e4},l=new gt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),u=new gt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),d=i(`ws`,`ws`,3,a,l),f=i(`wss`,`ws`,3,o,l),p=i(`sockjs`,`sockjs`,1,s),m=i(`xhr_streaming`,`xhr_streaming`,1,s,u),h=i(`xdr_streaming`,`xdr_streaming`,1,s,u),g=i(`xhr_polling`,`xhr_polling`,1,s),_=i(`xdr_polling`,`xdr_polling`,1,s),v=new _t([d],c),y=new _t([f],c),b=new _t([p],c),x=new _t([new Ot(At(m),m,h)],c),S=new _t([new Ot(At(g),g,_)],c),C=new _t([new Ot(At(x),new vt([x,new Dt(S,{delay:4e3})]),S)],c),w=new Ot(At(C),C,b),T=t.useTLS?new vt([v,new Dt(w,{delay:2e3})]):new vt([v,new Dt(y,{delay:2e3}),new Dt(w,{delay:5e3})]);return new St(new kt(new Ot(At(d),T,w)),r,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},Mt=(function(){var e=this;e.timeline.info(e.buildTimelineMessage({transport:e.name+(e.options.useTLS?`s`:``)})),e.hooks.isInitialized()?e.changeState(`initialized`):e.hooks.file?(e.changeState(`initializing`),c.load(e.hooks.file,{useTLS:e.options.useTLS},function(t,n){e.hooks.isInitialized()?(e.changeState(`initialized`),n(!0)):(t&&e.onError(t),e.onClose(),n(!1))})):e.onClose()}),Nt={getRequest:function(e){var t=new window.XDomainRequest;
28return t.ontimeout=function(){e.emit(`error`,new h),e.close()},t.onerror=function(t){e.emit(`error`,t),e.close()},t.onprogress=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText)},t.onload=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText),e.emit(`finished`,200),e.close()},t},abortRequest:function(e){e.ontimeout=e.onerror=e.onprogress=e.onload=null,e.abort()}},Pt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ft=262144,It=function(e){Pt(t,e);function t(t,n,r){var i=e.call(this)||this;return i.hooks=t,i.method=n,i.url=r,i}return t.prototype.start=function(e){var t=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){t.close()},H.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader(`Content-Type`,`application/json`),this.xhr.send(e)},t.prototype.close=function(){this.unloader&&=(H.removeUnloadListener(this.unloader),null),this.xhr&&=(this.hooks.abortRequest(this.xhr),null)},t.prototype.onChunk=function(e,t){for(;;){var n=this.advanceBuffer(t);if(n)this.emit(`chunk`,{status:e,data:n});else break}this.isBufferTooLong(t)&&this.emit(`buffer_too_long`)},t.prototype.advanceBuffer=function(e){var t=e.slice(this.position),n=t.indexOf(`
29`);return n===-1?null:(this.position+=n+1,t.slice(0,n))},t.prototype.isBufferTooLong=function(e){return this.position===e.length&&e.length>Ft},t}(Ne),Lt;(function(e){e[e.CONNECTING=0]=`CONNECTING`,e[e.OPEN=1]=`OPEN`,e[e.CLOSED=3]=`CLOSED`})(Lt||={});var Rt=Lt,zt=1,Bt=function(){function e(e,t){this.hooks=e,this.session=Gt(1e3)+`/`+Kt(8),this.location=Vt(t),this.readyState=Rt.CONNECTING,this.openStream()}return e.prototype.send=function(e){return this.sendRaw(JSON.stringify([e]))},e.prototype.ping=function(){this.hooks.sendHeartbeat(this)},e.prototype.close=function(e,t){this.onClose(e,t,!0)},e.prototype.sendRaw=function(e){if(this.readyState===Rt.OPEN)try{return H.createSocketRequest(`POST`,Ut(Ht(this.location,this.session))).start(e),!0}catch{return!1}return!1},e.prototype.reconnect=function(){this.closeStream(),this.openStream()},e.prototype.onClose=function(e,t,n){this.closeStream(),this.readyState=Rt.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:n})},e.prototype.onChunk=function(e){if(e.status===200){this.readyState===Rt.OPEN&&this.onActivity();var t;switch(e.data.slice(0,1)){case`o`:t=JSON.parse(e.data.slice(1)||`{}`),this.onOpen(t);break;case`a`:t=JSON.parse(e.data.slice(1)||`[]`);for(var n=0;n<t.length;n++)this.onEvent(t[n]);break;case`m`:t=JSON.parse(e.data.slice(1)||`null`),this.onEvent(t);break;case`h`:this.hooks.onHeartbeat(this);break;case`c`:t=JSON.parse(e.data.slice(1)||`[]`),this.onClose(t[0],t[1],!0)}}},e.prototype.onOpen=function(e){this.readyState===Rt.CONNECTING?(e&&e.hostname&&(this.location.base=Wt(this.location.base,e.hostname)),this.readyState=Rt.OPEN,this.onopen&&this.onopen()):this.onClose(1006,`Server lost session`,!0)},e.prototype.onEvent=function(e){this.readyState===Rt.OPEN&&this.onmessage&&this.onmessage({data:e})},e.prototype.onActivity=function(){this.onactivity&&this.onactivity()},e.prototype.onError=function(e){this.onerror&&this.onerror(e)},e.prototype.openStream=function(){var e=this;this.stream=H.createSocketRequest(`POST`,Ut(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind(`chunk`,function(t){e.onChunk(t)}),this.stream.bind(`finished`,function(t){e.hooks.onFinished(e,t)}),this.stream.bind(`buffer_too_long`,function(){e.reconnect()});try{this.stream.start()}catch(t){re.defer(function(){e.onError(t),e.onClose(1006,`Could not start streaming`,!1)})}},e.prototype.closeStream=function(){this.stream&&=(this.stream.unbind_all(),this.stream.close(),null)},e}();function Vt(e){var t=/([^\?]*)\/*(\??.*)/.exec(e);return{base:t[1],queryString:t[2]}}function Ht(e,t){return e.base+`/`+t+`/xhr_send`}function Ut(e){return e+(e.indexOf(`?`)===-1?`?`:`&`)+`t=`+ +new Date+`&n=`+zt++}function Wt(e,t){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);return n[1]+t+n[3]}function Gt(e){return H.randomInt(e)}function Kt(e){for(var t=[],n=0;n<e;n++)t.push(Gt(32).toString(32));return t.join(``)}var qt=Bt,Jt={getReceiveURL:function(e,t){return e.base+`/`+t+`/xhr_streaming`+e.queryString}
29,onHeartbeat:function(e){e.sendRaw(`[]`)},sendHeartbeat:function(e){e.sendRaw(`[]`)},onFinished:function(e,t){e.onClose(1006,`Connection interrupted (`+t+`)`,!1)}},Yt={getReceiveURL:function(e,t){return e.base+`/`+t+`/xhr`+e.queryString},onHeartbeat:function(){},sendHeartbeat:function(e){e.sendRaw(`[]`)},onFinished:function(e,t){t===200?e.reconnect():e.onClose(1006,`Connection interrupted (`+t+`)`,!1)}},Xt={getRequest:function(e){var t=new(H.getXHRAPI());return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&e.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&e.onChunk(t.status,t.responseText),e.emit(`finished`,t.status),e.close()}},t},abortRequest:function(e){e.onreadystatechange=null,e.abort()}},Zt={createStreamingSocket:function(e){return this.createSocket(Jt,e)},createPollingSocket:function(e){return this.createSocket(Yt,e)},createSocket:function(e,t){return new qt(e,t)},createXHR:function(e,t){return this.createRequest(Xt,e,t)},createRequest:function(e,t,n){return new It(e,t,n)}};Zt.createXDR=function(e,t){return this.createRequest(Nt,e,t)};var H={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:i,DependenciesReceivers:s,getDefaultStrategy:jt,Transports:Ge,transportConnectionInitializer:Mt,HTTPFactory:Zt,TimelineTransport:Te,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(e){var t=this;window.Pusher=e;var n=function(){t.onDocumentBody(e.ready)};window.JSON?n():c.load(`json2`,{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:S,jsonp:Se}},onDocumentBody:function(e){var t=this;document.body?e():setTimeout(function(){t.onDocumentBody(e)},0)},createJSONPRequest:function(e,t){return new we(e,t)},createScriptRequest:function(e){return new Ce(e)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject(`Microsoft.XMLHTTP`)},getNetwork:function(){return qe},createWebSocket:function(e){return new(this.getWebSocketAPI())(e)},createSocketRequest:function(e,t){if(this.isXHRSupported())return this.HTTPFactory.createXHR(e,t);if(this.isXDRSupported(t.indexOf(`https:`)===0))return this.HTTPFactory.createXDR(e,t);throw`Cross-origin HTTP requests are not supported`},isXHRSupported:function(){var e=this.getXHRAPI();return!!e&&new e().withCredentials!==void 0},isXDRSupported:function(e){var t=e?`https:`:`http:`,n=this.getProtocol();return!!window.XDomainRequest&&n===t},addUnloadListener:function(e){window.addEventListener===void 0?window.attachEvent!==void 0&&window.attachEvent(`onunload`,e):window.addEventListener(`unload`,e,!1)},removeUnloadListener:function(e){window.addEventListener===void 0?window.detachEvent!==void 0&&window.detachEvent(`onunload`,e):window.removeEventListener(`unload`,e,!1)},randomInt:function(e){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/2**32}()*e)}},Qt;(function(e){e[e.ERROR=3]=`ERROR`,e[e.INFO=6]=`INFO`,e[e.DEBUG=7]=`DEBUG`})(Qt||={});var $t=Qt,en=function(){function e(e,t,n){this.key=e,this.session=t,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return e.prototype.log=function(e,t){e<=this.options.level&&(this.events.push(ie({},t,{timestamp:re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},e.prototype.error=function(e){this.log($t.ERROR,e)},e.prototype.info=function(e){this.log($t.INFO,e)},e.prototype.debug=function(e){this.log($t.DEBUG,e)},e.prototype.isEmpty=function(){return this.events.length===0},e.prototype.send=function(e,t){var n=this,r=ie({session:this.session,bundle:this.sent+1,key:this.key,lib:`js`,version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(r,function(e,r){e||n.sent++,t&&t(e,r)}),!0},e.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},e}(),tn=function(){function e(e,t,n,r){this.name=e,this.priority=t,this.transport=n,this.options=r||{}}return e.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},e.prototype.connect=function(e,t){var n=this;if(!this.isSupported())return nn(new b,t);if(this.priority<e)return nn(new g,t);var r=!1,i=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),a=null,o=function(){i.unbind(`initialized`,o),i.connect()},s=function(){a=ht.createHandshake(i,function(e){r=!0,u(),t(null,e)})},c=function(e){u(),t(e)}
29,l=function(){u(),t(new _(be(i)))},u=function(){i.unbind(`initialized`,o),i.unbind(`open`,s),i.unbind(`error`,c),i.unbind(`closed`,l)};return i.bind(`initialized`,o),i.bind(`open`,s),i.bind(`error`,c),i.bind(`closed`,l),i.initialize(),{abort:function(){r||(u(),a?a.close():i.close())},forceMinPriority:function(e){r||n.priority<e&&(a?a.close():i.close())}}},e}();function nn(e,t){return re.defer(function(){t(e)}),{abort:function(){},forceMinPriority:function(){}}}var rn=H.Transports,an=function(e,t,n,r,i,a){var o=rn[n];if(!o)throw new y(n);var s=(!e.enabledTransports||ae(e.enabledTransports,t)!==-1)&&(!e.disabledTransports||ae(e.disabledTransports,t)===-1),c;return s?(i=Object.assign({ignoreNullOrigin:e.ignoreNullOrigin},i),c=new tn(t,r,a?a.getAssistant(o):o,i)):c=on,c},on={isSupported:function(){return!1},connect:function(e,t){var n=re.defer(function(){t(new b)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},sn=function(e,t){var n=`socket_id=`+encodeURIComponent(e.socketId);for(var r in t.params)n+=`&`+encodeURIComponent(r)+`=`+encodeURIComponent(t.params[r]);if(t.paramsProvider!=null){var i=t.paramsProvider();for(var r in i)n+=`&`+encodeURIComponent(r)+`=`+encodeURIComponent(i[r])}return n},cn=function(e){if(H.getAuthorizers()[e.transport]===void 0)throw`'`+e.transport+`' is not a recognized auth transport`;return function(t,n){var r=sn(t,e);H.getAuthorizers()[e.transport](H,r,e,d.UserAuthentication,n)}},ln=function(e,t){var n=`socket_id=`+encodeURIComponent(e.socketId);for(var r in n+=`&channel_name=`+encodeURIComponent(e.channelName),t.params)n+=`&`+encodeURIComponent(r)+`=`+encodeURIComponent(t.params[r]);if(t.paramsProvider!=null){var i=t.paramsProvider();for(var r in i)n+=`&`+encodeURIComponent(r)+`=`+encodeURIComponent(i[r])}return n},un=function(e){if(H.getAuthorizers()[e.transport]===void 0)throw`'`+e.transport+`' is not a recognized auth transport`;return function(t,n){var r=ln(t,e);H.getAuthorizers()[e.transport](H,r,e,d.ChannelAuthorization,n)}},dn=function(e,t,n){var r={authTransport:t.transport,authEndpoint:t.endpoint,auth:{params:t.params,headers:t.headers}};return function(t,i){n(e.channel(t.channelName),r).authorize(t.socketId,i)}},fn=function(){return fn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fn.apply(this,arguments)};function pn(e,t){var n={activityTimeout:e.activityTimeout||a.activityTimeout,cluster:e.cluster||a.cluster,httpPath:e.httpPath||a.httpPath,httpPort:e.httpPort||a.httpPort,httpsPort:e.httpsPort||a.httpsPort,pongTimeout:e.pongTimeout||a.pongTimeout,statsHost:e.statsHost||a.stats_host,unavailableTimeout:e.unavailableTimeout||a.unavailableTimeout,wsPath:e.wsPath||a.wsPath,wsPort:e.wsPort||a.wsPort,wssPort:e.wssPort||a.wssPort,enableStats:vn(e),httpHost:mn(e),useTLS:_n(e),wsHost:hn(e),userAuthenticator:yn(e),channelAuthorizer:xn(e,t)};return`disabledTransports`in e&&(n.disabledTransports=e.disabledTransports),`enabledTransports`in e&&(n.enabledTransports=e.enabledTransports),`ignoreNullOrigin`in e&&(n.ignoreNullOrigin=e.ignoreNullOrigin),`timelineParams`in e&&(n.timelineParams=e.timelineParams),`nacl`in e&&(n.nacl=e.nacl),n}function mn(e){return e.httpHost?e.httpHost:e.cluster?`sockjs-`+e.cluster+`.pusher.com`:a.httpHost}function hn(e){return e.wsHost?e.wsHost:e.cluster?gn(e.cluster):gn(a.cluster)}function gn(e){return`ws-`+e+`.pusher.com`}function _n(e){return H.getProtocol()===`https:`||e.forceTLS!==!1}function vn(e){return`enableStats`in e?e.enableStats:`disableStats`in e&&!e.disableStats}function yn(e){var t=fn(fn({},a.userAuthentication),e.userAuthentication);return`customHandler`in t&&t.customHandler!=null?t.customHandler:cn(t)}function bn(e,t){var n;return`channelAuthorization`in e?n=fn(fn({},a.channelAuthorization),e.channelAuthorization):(n={transport:e.authTransport||a.authTransport,endpoint:e.authEndpoint||a.authEndpoint},`auth`in e&&(`params`in e.auth&&(n.params=e.auth.params),`headers`in e.auth&&(n.headers=e.auth.headers)),`authorizer`in e&&(n.customHandler=dn(t,n,e.authorizer))),n}function xn(e,t){var n=bn(e,t);return`customHandler`in n&&n.customHandler!=null?n.customHandler:un(n)}var Sn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}
29t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Cn=function(e){Sn(t,e);function t(t){var n=e.call(this,function(e,t){xe.debug(`No callbacks on watchlist events for `+e)})||this;return n.pusher=t,n.bindWatchlistInternalEvent(),n}return t.prototype.handleEvent=function(e){var t=this;e.data.events.forEach(function(e){t.emit(e.name,e)})},t.prototype.bindWatchlistInternalEvent=function(){var e=this;this.pusher.connection.bind(`message`,function(t){t.event===`pusher_internal:watchlist_events`&&e.handleEvent(t)})},t}(Ne);function wn(){var e,t;return{promise:new Promise(function(n,r){e=n,t=r}),resolve:e,reject:t}}var Tn=wn,En=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Dn=function(e){En(t,e);function t(t){var n=e.call(this,function(e,t){xe.debug(`No callbacks on user for `+e)})||this;return n.signin_requested=!1,n.user_data=null,n.serverToUserChannel=null,n.signinDonePromise=null,n._signinDoneResolve=null,n._onAuthorize=function(e,t){if(e){xe.warn(`Error during signin: `+e),n._cleanup();return}n.pusher.send_event(`pusher:signin`,{auth:t.auth,user_data:t.user_data})},n.pusher=t,n.pusher.connection.bind(`state_change`,function(e){var t=e.previous,r=e.current;t!==`connected`&&r===`connected`&&n._signin(),t===`connected`&&r!==`connected`&&(n._cleanup(),n._newSigninPromiseIfNeeded())}),n.watchlist=new Cn(t),n.pusher.connection.bind(`message`,function(e){e.event===`pusher:signin_success`&&n._onSigninSuccess(e.data),n.serverToUserChannel&&n.serverToUserChannel.name===e.channel&&n.serverToUserChannel.handleEvent(e)}),n}return t.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},t.prototype._signin=function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state===`connected`&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))},t.prototype._onSigninSuccess=function(e){try{this.user_data=JSON.parse(e.user_data)}catch{xe.error(`Failed parsing user data after signin: `+e.user_data),this._cleanup();return}if(typeof this.user_data.id!=`string`||this.user_data.id===``){xe.error(`user_data doesn't contain an id. user_data: `+this.user_data),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()},t.prototype._subscribeChannels=function(){var e=this,t=function(t){t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&e.pusher.connection.state===`connected`&&t.subscribe()};this.serverToUserChannel=new z(`#server-to-user-`+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global(function(t,n){t.indexOf(`pusher_internal:`)!==0&&t.indexOf(`pusher:`)!==0&&e.emit(t,n)}),t(this.serverToUserChannel)},t.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&=(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),null),this.signin_requested&&this._signinDoneResolve()},t.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&!(this.signinDonePromise&&!this.signinDonePromise.done)){var e=Tn(),t=e.promise,n=e.resolve;e.reject,t.done=!1;var r=function(){t.done=!0};t.then(r).catch(r),this.signinDonePromise=t,this._signinDoneResolve=n}},t}(Ne),On=function(){function e(t,n){var r=this;if(An(t),n||={},!n.cluster&&!(n.wsHost||n.httpHost)){var i=u.buildLogSuffix(`javascriptQuickStart`);xe.warn(`You should always specify a cluster when connecting. `+i)}`disableStats`in n&&xe.warn(`The disableStats option is deprecated in favor of enableStats`),this.key=t,this.config=pn(n,this),this.channels=ht.createChannels(),this.global_emitter=new Ne,this.sessionID=H.randomInt(1e9),this.timeline=new en(this.key,this.sessionID,{cluster:this.config.cluster,features:e.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:$t.INFO,version:a.VERSION}),this.config.enableStats&&(this.timelineSender=ht.createTimelineSender(this.timeline,{host:this.config.statsHost,path:`/timeline/v2/`+H.TimelineTransport.name}));var o=function(e){return H.getDefaultStrategy(r.config,e,an)};this.connection=ht.createConnectionManager(this.key,{getStrategy:o,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind(`connected`,function(){r.subscribeAll(),r.timelineSender&&r.timelineSender.send(r.connection.isUsingTLS())}),this.connection.bind(`message`,function(e){var t=e.event.indexOf(`pusher_internal:`)===0;
29if(e.channel){var n=r.channel(e.channel);n&&n.handleEvent(e)}t||r.global_emitter.emit(e.event,e.data)}),this.connection.bind(`connecting`,function(){r.channels.disconnect()}),this.connection.bind(`disconnected`,function(){r.channels.disconnect()}),this.connection.bind(`error`,function(e){xe.warn(e)}),e.instances.push(this),this.timeline.info({instances:e.instances.length}),this.user=new Dn(this),e.isReady&&this.connect()}return e.ready=function(){e.isReady=!0;for(var t=0,n=e.instances.length;t<n;t++)e.instances[t].connect()},e.getClientFeatures=function(){return se(pe({ws:H.Transports.ws},function(e){return e.isSupported({})}))},e.prototype.channel=function(e){return this.channels.find(e)},e.prototype.allChannels=function(){return this.channels.all()},e.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new F(6e4,function(){t.send(e)})}},e.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&=(this.timelineSenderTimer.ensureAborted(),null)},e.prototype.bind=function(e,t,n){return this.global_emitter.bind(e,t,n),this},e.prototype.unbind=function(e,t,n){return this.global_emitter.unbind(e,t,n),this},e.prototype.bind_global=function(e){return this.global_emitter.bind_global(e),this},e.prototype.unbind_global=function(e){return this.global_emitter.unbind_global(e),this},e.prototype.unbind_all=function(e){return this.global_emitter.unbind_all(),this},e.prototype.subscribeAll=function(){for(var e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)},e.prototype.subscribe=function(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.connection.state===`connected`&&t.subscribe(),t},e.prototype.unsubscribe=function(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e),t&&t.subscribed&&t.unsubscribe())},e.prototype.send_event=function(e,t,n){return this.connection.send_event(e,t,n)},e.prototype.shouldUseTLS=function(){return this.config.useTLS},e.prototype.signin=function(){this.user.signin()},e.instances=[],e.isReady=!1,e.logToConsole=!1,e.Runtime=H,e.ScriptReceivers=H.ScriptReceivers,e.DependenciesReceivers=H.DependenciesReceivers,e.auth_callbacks=H.auth_callbacks,e}(),kn=t.default=On;function An(e){if(e==null)throw`You must pass your app key when you instantiate Pusher.`}H.setup(On)})])})}))());window._=dr.default,window.axios=ur,window.axios.defaults.headers.common[`X-Requested-With`]=`XMLHttpRequest`,window.Pusher=Hr.default;var Ur=document.querySelector(`meta[name='pusher:key']`)?.getAttribute(`content`)?.trim(),Wr=document.querySelector(`meta[name='pusher:cluster']`)?.getAttribute(`content`)?.trim();Ur&&Wr&&(window.Echo=new Vr({broadcaster:`pusher`,key:Ur,cluster:Wr,forceTLS:!0}));var Gr=(e=`info`)=>(e=String(e).toLowerCase(),e===`error`?`danger`:e===`warn`?`warning`:[`success`,`danger`,`warning`,`info`].includes(e)?e:`info`),Kr=(e=``,t=null,n=`info`,r=null)=>({type:Gr(n),title:t,message:e??``,...r==null?{}:{duration:r}}),qr=e=>{window.dispatchEvent(new CustomEvent(`toast`,{detail:e}))};(()=>{let e=typeof window.Toast,t=window.Toast&&[`object`,`function`].includes(e)?window.Toast:{};t.make=typeof t.make==`function`?t.make:(e,t,n,r)=>Kr(e,t,n,r),[`success`,`danger`,`warning`,`info`].forEach(e=>{typeof t[e]!=`function`&&(t[e]=(n,r=null,i=null)=>{qr(t.make(n,r,e,i))})}),t.error=typeof t.error==`function`?t.error:(e,n=null,r=null)=>{qr(t.make(e,n,`danger`,r))},t.warn=typeof t.warn==`function`?t.warn:(e,n=null,r=null)=>{qr(t.make(e,n,`warning`,r))},window.Toast=t})();var Jr=(e=[])=>({toasts:[],timers:{},limit:6,init(){e.forEach(e=>this.add(e))},add(e){let t=this.normalize(e);this.toasts.unshift(t),this.trim(),this.schedule(t)},remove(e){let t=this.toasts.find(t=>t.id===e);!t||t.removing||(t.removing=!0,t.show=!1,window.clearTimeout(this.timers[e]),delete this.timers[e],window.setTimeout(()=>{this.toasts=this.toasts.filter(t=>t.id!==e)},220))},pause(e){e.persistent||(e.paused=!0,e.remaining=Math.max(0,e.remaining-(Date.now()-e.startedAt)),window.clearTimeout(this.timers[e.id]))},resume(e){e.persistent||(e.paused=!1,this.schedule(e))},schedule(e){e.persistent||(e.startedAt=Date.now(),window.clearTimeout(this.timers[e.id]),this.timers[e.id]=window.setTimeout(()=>this.remove(e.id),e.remaining))}
29,trim(){this.toasts.slice(this.limit).forEach(e=>{window.clearTimeout(this.timers[e.id]),delete this.timers[e.id]}),this.toasts=this.toasts.slice(0,this.limit)},normalize(e){let t=e?.toast??e??{},n=this.normalizeType(t.type??`info`),r=Number(t.duration??5e3),i=Number.isFinite(r)?Math.max(r,5e3):5e3;return{id:t.id??`${Date.now()}-${Math.random().toString(16).slice(2)}`,type:n,title:t.title||this.defaultTitle(n),message:t.message||``,duration:i,remaining:i,startedAt:Date.now(),paused:!1,show:!0,removing:!1,persistent:!!t.persistent}},normalizeType(e){return e===`error`?`danger`:e===`warn`?`warning`:[`success`,`danger`,`warning`,`info`].includes(e)?e:`info`},defaultTitle(e){return{success:`Success`,danger:`Attention`,warning:`Warning`,info:`Notice`}[e]},tone(e){return{success:{panel:`border-success`,accent:`bg-success`,icon:`bg-gray-50 text-success`,progress:`bg-success`},danger:{panel:`border-danger`,accent:`bg-danger`,icon:`bg-gray-50 text-danger`,progress:`bg-danger`},warning:{panel:`border-warning`,accent:`bg-warning`,icon:`bg-gray-50 text-yellow-700`,progress:`bg-warning`},info:{panel:`border-info`,accent:`bg-info`,icon:`bg-gray-50 text-blue-700`,progress:`bg-info`}}[e]},progressStyle(e){return e.persistent?``:`animation: toast-progress ${e.duration}ms linear forwards; animation-play-state: ${e.paused?`paused`:`running`};`}});window.toastStack=Jr;var Yr=null,Xr=()=>{!window.Alpine||Yr===window.Alpine||(window.Alpine.data(`toastStack`,Jr),Yr=window.Alpine)};document.addEventListener(`alpine:init`,Xr),Xr();var Zr=`https://www.youtube.com/iframe_api`,Qr=15e3,$r=15e3,ei=null,ti=!1;function ni(){return document.fullscreenElement??document.webkitFullscreenElement??document.msFullscreenElement??null}function ri(e,t){let n=e?.requestFullscreen??e?.webkitRequestFullscreen??e?.msRequestFullscreen;if(n)try{Promise.resolve(n.call(e)).then(t).catch(()=>{})}catch{}}function ii(e){if(ni()!==e)return;let t=document.exitFullscreen??document.webkitExitFullscreen??document.msExitFullscreen;if(t)try{Promise.resolve(t.call(document)).catch(()=>{})}catch{}}function ai(){return window.YT?.Player?Promise.resolve(window.YT):ei||(ei=new Promise((e,t)=>{let n=!1,r=null,i=document.querySelector(`script[src="${Zr}"], script[data-prime-youtube-api="true"]`),a=window.onYouTubeIframeAPIReady,o=()=>{window.onYouTubeIframeAPIReady===l&&(typeof a==`function`?window.onYouTubeIframeAPIReady=a:delete window.onYouTubeIframeAPIReady)},s=()=>{c(t,Error(`The YouTube player API could not be loaded.`),!0)},c=(e,t,a=!1)=>{n||(n=!0,window.clearTimeout(r),i?.removeEventListener?.(`error`,s),o(),a&&!window.YT?.Player&&i?.remove(),e(t))},l=()=>{try{typeof a==`function`&&a()}finally{window.YT?.Player?c(e,window.YT):c(t,Error(`The YouTube player API did not initialize.`),!0)}};window.onYouTubeIframeAPIReady=l,i||(i=document.createElement(`script`),i.src=Zr,i.async=!0,i.dataset.primeYoutubeApi=`true`,document.head.appendChild(i)),i.addEventListener(`error`,s,{once:!0}),r=window.setTimeout(()=>{c(t,Error(`The YouTube player API timed out while loading.`),!0)},Qr)}).catch(e=>{throw ei=null,e}),ei)}function oi(e){try{e?.destroy?.()}catch(e){console.warn(`Prime App YouTube player cleanup failed.`,e)}}async function si(e,t,n){let r=await ai();return new Promise((i,a)=>{let o=null,s=!1,c=(e,t=o)=>{s||(s=!0,window.clearTimeout(l),oi(t),a(e))},l=window.setTimeout(()=>{c(Error(`The YouTube player timed out while loading.`))},Qr);try{o=new r.Player(e,{events:{onReady(e){let t=e.target??o;if(s){oi(t);return}s=!0,window.clearTimeout(l),i(t)},onError(e){oi(e.target??o),t(e.data),s||(s=!0,window.clearTimeout(l),a(Error(`The YouTube player returned error ${e.data}.`)))},onAutoplayBlocked(e){n(e.target??o)}}})}catch(e){c(e)}})}function ci(){ti||!window.Alpine||(ti=!0,window.Alpine.data(`primeAppMedia`,e=>{let t=null,n=null,r=null,i=0,a=0,o=null,s=null,c=!1,l=!1,u=!1,d=null,f=e=>{e&&r&&e.replaceChildren(r.cloneNode(!0))},p=e=>{e.videoError=!0,e.videoLoading=!1,e.videoPlaybackBlocked=!1,e.videoMuted=!1,e.$nextTick(()=>{e.videoOpen&&e.$refs.retryVideoButton?.focus()})},m=e=>{e.videoOpen&&(e.videoPlaybackBlocked=!0,e.$nextTick(()=>e.$refs.videoPlayButton?.focus()))},h=(e,n=t)=>{if(!(!e.videoOpen||!n?.playVideo)){e.videoPlaybackBlocked=!1;try{!c&&n.mute&&(n.mute(),e.videoMuted=!0),n.playVideo()}catch{m(e)}}},g=()=>{window.clearTimeout(d),d=null},_=e=>{g(),l=!1,u=!0,e.brochureLoading=!1,e.brochureError=!0,e.$refs.brochureFrame?.setAttribute(`tabindex`,`-1`),e.$nextTick(()=>{e.brochureOpen&&e.$refs.retryBrochureButton?.focus()})},v=(e,t=!1)=>{let n=e.$refs.brochureFrame;if(!n?.dataset.src){_(e);return}if(g(),t&&(l=!1,u=!1),u){_(e);return}if(e.brochureError=!1,n.removeAttribute(`tabindex`),l){e.brochureLoading=!1;return}e.brochureLoading=!0,(t||!n.getAttribute(`src`))&&(n.src=n.dataset.src),d=window.setTimeout(()=>{e.brochureOpen&&!l&&_(e)},$r)},y=e=>o===`video`&&e.videoOpen||o===`brochure`&&e.brochureOpen,b=(e,t)=>{o=t,ni()!==e.$root&&ri(e.$root,()=>{(o===null||o===t&&!y(e))&&(o=null,ii(e.$root))})},x=(e,t,n)=>{n||o!==t||(o=null,ii(e.$root))},S=async e=>{if(t)return e.videoError=!1,t;if(n)try{return await n}catch{return null}let a=e.$refs.youtubePlayerContainer,o=a?.querySelector(`iframe`);if(!r&&o&&(r=o.cloneNode(!0)),!o&&a&&r&&(o=r.cloneNode(!0),a.replaceChildren(o)),!o?.dataset.src)return p(e),null;e.videoError=!1,e.videoLoading=!0,o.getAttribute(`src`)||(o.src=o.dataset.src);let s=++i,c=si(o,n=>{s===i&&(t=null,f(a),p(e),console.warn(`Prime App YouTube player error: ${n}`))},()=>{s===i&&m(e)}
29);n=c;try{let e=await c;return s===i?(t=e,t):(oi(e),null)}catch(n){return s===i&&(t=null,f(a),p(e),console.warn(`Prime App YouTube player unavailable.`,n)),null}finally{n===c&&(n=null),s===i&&(e.videoLoading=!1)}};return{openModal:e,videoOpen:!1,videoLoading:!1,videoError:!1,videoPlaybackBlocked:!1,videoMuted:!1,brochureOpen:!1,brochureLoading:!1,brochureError:!1,init(){s=()=>{!y(this)&&ni()===this.$root&&(o=null,ii(this.$root))},document.addEventListener(`fullscreenchange`,s),document.addEventListener(`webkitfullscreenchange`,s)},async openVideo(){this.closeBrochure(!1,!0),this.openModal=!1,this.videoOpen=!0,this.videoPlaybackBlocked=!1;let e=++a,n=t;n&&h(this,n),b(this,`video`),await new Promise(e=>this.$nextTick(e)),this.$refs.videoClose?.focus();let r=await S(this);!n&&e===a&&this.videoOpen&&h(this,r)},async retryVideo(){let e=a,t=await S(this);e===a&&this.videoOpen&&h(this,t)},startVideo(){h(this)},enableVideoSound(){t?.unMute&&(c=!0,this.videoMuted=!1,this.videoPlaybackBlocked=!1,t.unMute(),t.playVideo?.())},closeVideo(e=!0,n=!1){a+=1,this.videoOpen=!1,this.videoPlaybackBlocked=!1,t?.pauseVideo&&t.pauseVideo(),x(this,`video`,n),e&&this.$nextTick(()=>this.$refs.watchVideoButton?.focus())},openBrochure(){this.closeVideo(!1,!0),this.openModal=!1,this.brochureOpen=!0,b(this,`brochure`),this.$nextTick(()=>{this.$refs.brochureClose?.focus(),v(this)})},brochureLoaded(){let e=this.$refs.brochureFrame;e?.getAttribute(`src`)&&(g(),l=!0,u=!1,this.brochureLoading=!1,this.brochureError=!1,e.removeAttribute(`tabindex`))},brochureFailed(){_(this)},retryBrochure(){v(this,!0)},closeBrochure(e=!0,t=!1){g(),this.brochureOpen=!1,this.brochureLoading=!1,x(this,`brochure`,t),e&&this.$nextTick(()=>this.$refs.viewBrochureButton?.focus())},openRegistration(){this.closeVideo(!1),this.closeBrochure(!1),this.openModal=!0},destroy(){i+=1,a+=1,o=null,g(),oi(t),ii(this.$root),document.removeEventListener?.(`fullscreenchange`,s),document.removeEventListener?.(`webkitfullscreenchange`,s),t=null,n=null}}}))}document.addEventListener(`alpine:init`,ci),ci(),window.portalSupportModal=()=>({opened:!1,closingTimer:null,previousOverflow:``,viewportHandler:null,cookieObserver:null,cookieResize:null,launcherResize:null,init(){this.launcherResize=()=>this.positionLauncher(),this.cookieObserver=new MutationObserver(this.launcherResize),this.cookieResize=new ResizeObserver(this.launcherResize),document.querySelectorAll(`.js-cookie-consent`).forEach(e=>{this.cookieObserver.observe(e,{attributes:!0,attributeFilter:[`style`,`class`,`hidden`]}),this.cookieResize.observe(e)}),window.addEventListener(`resize`,this.launcherResize),this.$nextTick(this.launcherResize)},positionLauncher(){let e=this.$refs.launcher.getBoundingClientRect(),t=window.innerWidth<640?16:24;document.querySelectorAll(`.js-cookie-consent`).forEach(n=>{let r=n.getBoundingClientRect();r.height>0&&r.right>e.left&&r.left<e.right&&(t=Math.max(t,window.innerHeight-r.top+12))}),this.$refs.launcher.style.setProperty(`--ps-launcher-bottom`,`${t}px`)},show(){this.opened||(this.previousOverflow=document.body.style.overflow,this.opened=!0,document.body.style.overflow=`hidden`,this.viewportHandler=()=>{let e=window.visualViewport;this.$refs.dialog.style.setProperty(`--ps-height`,`${e?.height??window.innerHeight}px`),this.$refs.dialog.style.setProperty(`--ps-top`,`${e?.offsetTop??0}px`)},this.viewportHandler(),window.visualViewport?.addEventListener(`resize`,this.viewportHandler),window.visualViewport?.addEventListener(`scroll`,this.viewportHandler),this.$refs.dialog.showModal(),this.$refs.dialog.querySelector(`.ps-surface`).scrollTop=0,this.$refs.heading.focus({preventScroll:!0}),window.renderReCaptcha?.())},hide(){if(!this.opened||this.closingTimer)return;this.$refs.dialog.setAttribute(`data-closing`,``);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:150;this.closingTimer=window.setTimeout(()=>{this.$refs.dialog.close(),this.$refs.dialog.removeAttribute(`data-closing`),this.closingTimer=null},e)},onClosed(){this.opened=!1,document.body.style.overflow=this.previousOverflow,window.visualVie
29wport?.removeEventListener(`resize`,this.viewportHandler),window.visualViewport?.removeEventListener(`scroll`,this.viewportHandler),this.$refs.launcher.focus({preventScroll:!0})},focusResult(){this.$nextTick(()=>{this.opened&&this.$el.querySelector(`[data-support-result]`)?.focus()})},destroy(){window.clearTimeout(this.closingTimer),window.visualViewport?.removeEventListener(`resize`,this.viewportHandler),window.visualViewport?.removeEventListener(`scroll`,this.viewportHandler),this.opened&&(document.body.style.overflow=this.previousOverflow),this.cookieObserver?.disconnect(),this.cookieResize?.disconnect(),window.removeEventListener(`resize`,this.launcherResize)}}),document.addEventListener(`alpine:init`,()=>{let e={initialized:!1,initError:!1,accountid:null,fee:null,fee_label:`Pay Method`,defaultPaymethod:`echeck`,charge_now:!1,charge_now_amount:null,loading:{customer:!0,paymethods:!0,newmethod:!1,label:!1,deleting:!1,setDefault:!1,payment:!1,charge:!1,post_charge:!1},paymentReceived:!1,dropdown:!1,adding:!1,new_label:null,update_label:!1,signature:null,signature_required:!1,has_signature:!1,checking_for_signature:!1,sending_signature_link:!1,signature_png:!1,signature_pad:null,signature_pad_canvas:null,signing_message:!1,allow_custom_draft_date:!1,default_draft_date:!0,confirm_default_draft_date:!1,draft_options:[],first_draft_selected:null,recurring_draft_selected:null,current_recurring_draft_day:null,force_draft_today:!1,last_four:null,toggle(){if(this.dropdown)return this.close();this.dropdown=!0},close(){this.dropdown&&=!1},updateFees(e){if(e==`echeck`){let e=merchant.payment.echeck_total();merchant.payment.charge_amount=e,merchant.payment.fee=merchant.payment.echeck_fee(),merchant.payment.method_type=`(eCheck)`,merchant.buttonLabel=`Pay `+merchant.money(e)}else{let e=merchant.payment.card_total();merchant.payment.charge_amount=e,merchant.payment.fee=merchant.payment.card_fee(),merchant.payment.method_type=`(Credit Card)`,merchant.buttonLabel=`Pay `+merchant.money(e)}},money(e){return window.Intl&&typeof Intl.NumberFormat==`function`?isNaN(e)||e==null?(console.error(`Invalid input for money formatting.`),e):new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`}).format(e):`$`+parseFloat(e).toFixed(2)},setPaymentMethod(e){merchant.checking_for_signature||(merchant.newmethod.method_type=e,merchant.updateFees(e),this.signature_required&&merchant.checkForSignature())},getFirstDraftExplanation(){let e=merchant.draft_options.first_draft_options.find(e=>e.value===merchant.first_draft_selected);return e?e.explanation:``},getRecurringDraftExplanation(){let e=merchant.draft_options.recurring_draft_options.find(e=>e.value===merchant.recurring_draft_selected);return e?e.explanation:``},cancelCustomDraftDate(){merchant.default_draft_date=!0,merchant.confirm_default_draft_date=!1,merchant.setDefaultDraftOptions()},customer:{token:null,status:null,name:null,first_name:null,last_name:null},checkout:!1,payment:{opportunity:null,subtotal:0,fee:0,charge_amount:0,method_type:`(eCheck)`,error:{message:null,desc:null},card_fee(){let e=parseFloat(this.subtotal);if(isNaN(e))return console.error(`Invalid subtotal for card fee calculation`),0;let t=4+Math.floor((e-.01)/100)*2;return merchant.fee===null?t>12?12:t:merchant.fee},card_total(){let e=this.card_fee(),t=parseFloat(this.subtotal);return isNaN(t)||isNaN(e)?(console.error(`Invalid subtotal or fee for card total calculation`),0):parseFloat((t+e).toFixed(2))},echeck_fee(){let e=parseFloat(this.subtotal);return isNaN(e)?(console.error(`Invalid subtotal for eCheck fee calculation`),0):merchant.fee===null?4:merchant.fee},echeck_total(){let e=this.echeck_fee(),t=parseFloat(this.subtotal);return isNaN(t)||isNaN(e)?(console.error(`Invalid subtotal or fee for eCheck total calculation`),0):parseFloat((t+e).toFixed(2))}},paymethod:null,paymethods:null,buttonLabel:`Add to Wallet!`,canPay(){return this.checkout&&!this.loading.newmethod&&!this.loading.payment&&(this.adding&&this.newmethod.method_valid||!this.adding&&this.paymethod)?!(!this.default_draft_date&&!this.confirm_default_draft_date||this.signature_required&&!this.has_signature||this.checking_for_signature):!1},charge(){if(!merchant.loading.charge&&!merchant.paymentReceived){merchant.payment.error.message=null,merchant.payment.error.desc=null,merchant.loading.charge=!0;let e={};e.default_method=merchant.checkout?!0:merchant.newmethod.default_method,e.save=merchant.newmethod.save,e.adding=merchant.adding,e.customer=merchant.customer,e.opportunity=merchant.payment.opportunity,e.amount=merchant.payment.charge_amount,e.subtotal=merchant.payment.subtotal,e.fee=merchant.payment.fee,e.accountid=merchant.accountid,e.default_draft_date=merchant.default_draft_date,merchant.default_draft_date||(e.force_draft_today=merchant.draft_options.force_draft_today,e.first_draft_selected=merchant.first_draft_selected,e.recurring_draft_day_selected=merchant.recurring_draft_selected,e.current_recurring_draft_day=merchant.current_recurring_draft_day),merchant.adding?(e.type=merchant.newmethod.method_type,merchant.newmethod.method_type==`card`?(e.notes=merchant.newmethod.name_on_card+` - `+merchant.newmethod.card_icon.toUpperCase(),e.payload={name_on_card:merchant.newmethod.name_on_card,card_type:merchant.newmethod.card_icon,account_number:merchant.newmethod.unformatted_card_number(),expire_month:merchant.newmethod.expire_month,expire_year:merchant.newmethod.expire_year,card_verification_value:merchant.newmethod.cvc},merchant.last_four=merchant.newmethod.unformatted_card_number().slice(-4),e.last_four=merchant.last_four):(e.notes=merchant.customer.name+` - eCheck `,e.payload={account_holder:merchant.customer.name,account_number:merchant.newmethod.account_number,routing_number:merchant.newmethod.routing_number,account_type:merchant.newmethod.account_type},merchant.last_four=merchant.newmethod.account_number.slice(-4),e.last_four=merchant.last_four)):(e.type=merchant.paymethod.card?`card`:`eCheck`,e.notes=null,e.payload={paymethod_token:merchant.paymethod.paymethod_token});let t={method:`post`,url:`/merchant/charge`,data:e};axios(t).then(t=>{if(t.data.status==`success`)merchant.loading.post_charge=!0,merchant.adding=!1,t.data.data.method_used=merchant.payment.method_type,e={response:t.data.data,customer:merchant.customer.token}
29,Livewire.dispatch(`checkoutResponse`,{payload:e}),merchant.paymentReceived=!0,merchant.loading.charge=!1;else if(t.data.status==`processing`)setTimeout(()=>{location.reload(!0)},2e3);else if(t.data.status==`fee-error`){console.log(`FEE ERROR`),console.log(t.data);let e=`System error: Invalid calculated fee amount`;merchant.loading.charge=!1,merchant.payment.error.message=e,merchant.payment.error.desc=`Please try refreshing the page.`,window.Toast?.danger?.(e,`Error`)}else{console.log(`ERROR`),console.log(t.data);let e=merchant.helpers.getError(t.data.data.response_code);merchant.loading.charge=!1,merchant.payment.error.message=e,merchant.payment.error.desc=t.data.data.response_code?t.data.data.response_code+`: `+t.data.data.message:null,window.Toast?.danger?.(e,`Error`)}}).catch(e=>{console.log(`ERROR`),console.log(e),window.Toast?.danger?.(`Oops. Something went wrong...`,`Error`),merchant.payment.error.message=`Oops. Something went wrong... Please confirm the information or refresh the page and try again.`,merchant.payment.error.desc=null,merchant.checkout&&(merchant.loading.charge=!1)})}},newmethod:{method_type:`echeck`,account_type:`checking`,default_method:!0,save:!0,routing_number:null,account_number:null,account_holder:null,name_on_card:null,card_number:null,cvc:null,card_number_error:!1,expire_month:new Date().getMonth()+1,expire_year:new Date().getFullYear()+2,method_valid:!1,card_icon:null,create_error:null,unformatted_card_number(){return merchant.newmethod.card_number?merchant.newmethod.card_number.replace(/\s+/g,``):merchant.newmethod.card_number},clearForm(){merchant.newmethod.method_type=`echeck`,merchant.newmethod.account_type=`checking`,merchant.newmethod.default_method=!0,merchant.newmethod.save=!0,merchant.newmethod.routing_number=null,merchant.newmethod.account_number=null,merchant.newmethod.account_holder=null,merchant.newmethod.name_on_card=null,merchant.newmethod.card_number=null,merchant.newmethod.cvc=null,merchant.newmethod.card_number_error=!1,merchant.newmethod.expire_month=new Date().getMonth()+1,merchant.newmethod.expire_year=new Date().getFullYear()+2,merchant.newmethod.method_valid=!1,merchant.newmethod.card_icon=null,merchant.newmethod.create_error=null},createPaymethod(){merchant.newmethod.create_error=null,merchant.loading.newmethod=!0;let e={};e.default_method=merchant.checkout?!0:merchant.newmethod.default_method,e.customer=merchant.customer.token,e.type=merchant.newmethod.method_type,merchant.newmethod.method_type==`card`?(e.notes=merchant.newmethod.name_on_card+` - `+merchant.newmethod.card_icon.toUpperCase(),e.payload={name_on_card:merchant.newmethod.name_on_card,card_type:merchant.newmethod.card_icon,account_number:merchant.newmethod.unformatted_card_number(),expire_month:merchant.newmethod.expire_month,expire_year:merchant.newmethod.expire_year,card_verification_value:merchant.newmethod.cvc}):(e.notes=merchant.customer.name+` - eCheck `,e.payload={account_holder:merchant.customer.name,account_number:merchant.newmethod.account_number,routing_number:merchant.newmethod.routing_number,account_type:merchant.newmethod.account_type});let t={method:`put`,url:`/merchant/paymethod`,data:e};axios(t).then(e=>{if(console.log(`ADD RESPONSE`),console.log(e.data),e.data.status==`success`)if(merchant.adding=!1,merchant.newmethod.clearForm(),merchant.checkout)merchant.loading.payment=!1;else if(merchant.charge_now)merchant.charge();else{merchant.refreshCustomer();let t={response:e.data.data,customer:merchant.customer.token};Livewire.dispatch(`paymethodAdded`,{payload:t})}else merchant.checkout&&(merchant.loading.payment=!1),window.Toast?.danger?.(e.data.data.response.response_desc,`Error`)}).catch(e=>{window.Toast?.danger?.(`Oops. Something went wrong...`,`Error`),merchant.checkout&&(merchant.loading.payment=!1),merchant.loading.newmethod=!1}).finally(function(){merchant.loading.newmethod=!1})},validate(){return merchant.newmethod.method_type==`card`&&merchant.newmethod.name_on_card&&merchant.newmethod.card_icon&&merchant.newmethod.card_number.length==19&&merchant.newmethod.expire_year&&merchant.newmethod.expire_month&&merchant.newmethod.cvc&&merchant.newmethod.cvc.length==3?!0:!!(merchant.newmethod.method_type==`echeck`&&merchant.newmethod.account_type&&merchant.newmethod.account_number&&merchant.newmethod.account_number.length>=2&&merchant.newmethod.routing_number&&merchant.newmethod.routing_number.length>=2)}},logos:[`checking`,`savings`,`visa`,`mast`,`disc`],select(e){this.paymethod=e,this.adding=!1,this.toggle()},add(){console.log(`Adding new payment method`),merchant.adding=!0,merchant.setPaymentMethod(merchant.defaultPaymethod
29),this.toggle()},setDefaultDraftOptions(){merchant.current_recurring_draft_day=merchant.draft_options.current_recurring_draft_day,merchant.force_draft_today=merchant.draft_options.force_draft_today;let e=merchant.draft_options.recurring_draft_options.find(e=>e.value==(merchant.current_recurring_draft_day??15));merchant.recurring_draft_selected=e?e.value:merchant.draft_options.recurring_draft_options[0].value,merchant.first_draft_selected=merchant.draft_options.first_draft_options[0].value},setAsDefault(){merchant.loading.setDefault=!0;let e={method:`post`,url:`/merchant/setDefaultPaymethod`,data:{customer:merchant.customer.token,token:merchant.paymethod.paymethod_token,type:merchant.paymethod.card?`Credit Card`:`eCheck`}};axios(e).then(e=>{e.data.status==`success`?(merchant.paymethods=e.data.data,merchant.paymethod.is_default=!0,window.Toast?.success?.(`Payment Method is set to Default`,`Success`)):window.Toast?.danger?.(`Unable to set Payment Method to default`,`Error`)}).catch(e=>{console.log(`ERROR: `+e)}).finally(function(){merchant.loading.setDefault=!1})},deletePayMethod(){merchant.loading.deleting=!0;let e={method:`delete`,url:`/merchant/paymethod`,data:{customer:merchant.customer.token,token:merchant.paymethod.paymethod_token}};axios(e).then(e=>{e.data.status==`success`?(merchant.paymethods=e.data.data,merchant.paymethod=merchant.paymethods[0],window.Toast?.success?.(`Payment Method has been deleted!`,`Success`)):window.Toast?.danger?.(`Unable to delete Payment Method`,`Error`)}).catch(e=>{console.log(`ERROR: `+e)}).finally(function(){merchant.loading.deleting=!1})},updateLabel(){merchant.loading.label=!0;let e={method:`post`,url:`/merchant/paymethod/updateLabel`,data:{token:merchant.paymethod.paymethod_token,new_label:merchant.new_label}};axios(e).then(e=>{e.data.status==`success`?(merchant.paymethod.label=merchant.new_label,merchant.paymethods.length>0&&merchant.paymethods.forEach(e=>{merchant.paymethod.paymethod_token==e.paymethod_token&&(e.label=merchant.new_label)}),window.Toast?.success?.(`Label has been updated!`,`Success`)):window.Toast?.danger?.(`Unable to update label`,`Error`)}).catch(e=>{console.log(`ERROR: `+e)}).finally(function(){merchant.new_label=null,merchant.update_label=!1,merchant.loading.label=!1})},refreshCustomer(){this.loading.customer=!0,this.getCustomer(this.accountid,this.payment.subtotal,this.payment.opportunity,this.checkout,this.defaultPaymethod,this.fee?{value:this.fee,label:this.fee_label}:null,this.signature_required,this.draft_options)},getCustomer(e=null,t=null,n=null,r=!1,i=null,a=null,o=!1,s=null){let c=this;c.payment.subtotal=t,c.payment.opportunity=n,c.checkout=r,c.newmethod.expire_year=new Date().getFullYear()+1,c.accountid=e,c.signature_required=o,c.draft_options=s,c.draft_options&&(merchant.allow_custom_draft_date=!0,merchant.setDefaultDraftOptions()),i&&merchant.setPaymentMethod(i),a!==null&&(c.fee=a.value,c.fee_label=a.label??`Pay Method`,merchant.updateFees(merchant.newmethod.method_type)),axios.get(`/merchant/customer/`+e).then(function(e){let t=e.data.data;t?(c.customer.token=t.token,c.customer.name=t.name,c.customer.first_name=t.first_name,c.customer.last_name=t.last_name,c.paymethod=t.paymethod,c.paymethods=t.paymethods,(!t.paymethod||!t.paymethod.paymethod_token)&&(merchant.adding=!0)):(c.initError=!0,console.log(`Init Error: No customer found`))}).catch(function(e){c.initError=!0,console.log(`Init Error: `+e)}
29).finally(function(){c.loading.customer=!1,c.signature_required&&c.checkForSignature()})},setTestingCreditCard(){merchant.newmethod.name_on_card=`John Doe`,merchant.newmethod.card_number=`4111 1111 1111 1111`,merchant.newmethod.expire_month=`12`,merchant.newmethod.expire_year=`2029`,merchant.newmethod.cvc=`123`,merchant.setPaymentMethod(`card`)},sendSignatureConfirmationLink(){if(!merchant.sending_signature_link){merchant.sending_signature_link=!0;let e={method:`post`,url:`/merchant/sendSignatureConfirmationLink`,data:{opportunity:merchant.payment.opportunity}};axios(e).then(e=>{e.data.status==`success`?(window.Toast?.success?.(`eSignature form sent to member.`,`Success`),merchant.checkForSignature()):window.Toast?.danger?.(`Unable to send eSignature form to member.`,`Error`)}).catch(e=>{console.log(`ERROR: `+e),window.Toast?.danger?.(`Oops. Something went wrong...`,`Error`)}).finally(function(){merchant.sending_signature_link=!1})}},checkForSignature(){if(merchant.checking_for_signature)return;this.signature=!1,merchant.has_signature=!1,merchant.paymethod&&!merchant.adding&&merchant.paymethod.paymethod_type===`echeck`||merchant.adding&&merchant.newmethod.method_type;let e=merchant.paymethod&&!merchant.adding&&merchant.paymethod.paymethod_type===`card`||merchant.adding&&merchant.newmethod.method_type===`card`,t=e?merchant.payment.card_fee():merchant.payment.echeck_fee(),n=e?merchant.payment.card_total():merchant.payment.echeck_total(),r={method:`post`,url:`/merchant/getSignature`,data:{opportunity:merchant.payment.opportunity,fee:t,total:n,subtotal:merchant.payment.subtotal}};merchant.checking_for_signature=!0,axios(r).then(e=>{e.data.status==`success`?(merchant.has_signature=e.data.data.has_signature,merchant.signing_message=e.data.data.signing_message,merchant.signature_png=e.data.data.signature_png):window.Toast?.danger?.(`Unable to check status of signature`,`Error`)}).catch(e=>{console.log(`ERROR: `+e),window.Toast?.danger?.(`Oops. Something went wrong...`,`Error`)}).finally(function(){merchant.checking_for_signature=!1,merchant.has_signature||merchant.initSignaturePad()})},async initSignaturePad(){if(this.signature_pad&&!this.signature_pad.isEmpty)return;if(!window.SignaturePad){console.error(`SignaturePad library not loaded`);return}let e=document.getElementById(`signature-canvas`);if(!e)return;e.classList.remove(`hidden`),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));let t=this.$refs.signature_pad_canvas;if(!t){console.error(`Signature canvas not found`);return}let n=e.clientWidth||500;n=Math.min(n,500);let r=Math.max(window.devicePixelRatio||1,1);t.width=Math.floor(n*r),t.height=Math.floor(180*r),t.style.width=n+`px`,t.style.height=`180px`,t.getContext(`2d`).setTransform(r,0,0,r,0,0),this.signature_pad=new window.SignaturePad(t,{penColor:`rgb(0,0,0)`});let i=()=>{try{this.signature=!0,this.signature_png=this.signature_pad.toDataURL(`image/png`)}catch(e){console.warn(`Could not create PNG from signature`,e)}};this.signature_pad.onEnd=i,window.addEventListener(`resize`,()=>this.resizeSignatureCanvas(),{passive:!0})},resizeSignatureCanvas(){let e=this.$refs.signature_pad_canvas,t=document.getElementById(`signature-canvas`);if(!e||!t)return;let n=t.clientWidth||384;n=Math.min(n,384);let r=Math.max(window.devicePixelRatio||1,1);e.width=Math.floor(n*r),e.height=Math.floor(180*r),e.style.width=n+`px`,e.style.height=`180px`,e.getContext(`2d`).setTransform(r,0,0,r,0,0),this.signature_pad&&this.signature_pad.clear(),this.signature=!1,this.signature_png=!1},resetSignature(){this.signature_pad?.clear(),this.signature=!1,this.signature_png=!1},async saveSignature(){if(!this.signature_pad||this.signature_pad.isEmpty()){window.Toast?.danger?.(`Please provide a signature first.`,`Error`);return}let e=this.signature_pad.toDataURL(`image/png`),t=new Image;t.src=e,await new Promise((e,n)=>{t.onload=e,t.onerror=n});let n=document.createElement(`canvas`);n.width=t.width,n.height=t.height;let r=n.getContext(`2d`);r.drawImage(t,0,0);let i=r.getImageData(0,0,n.width,n.height).data,a=0;for(let e=0;e<i.length;e+=4)i[e+3]!==0&&a++;if(a<1200){window.Toast?.danger?.(`Signature is too small. Please provide a full signature.`,`Error`);return}let o=document.getElementById(`merchant-summary`);if(!o){window.Toast?.danger?.(`Summary content not found.`,`Error`);return}let s=o.cloneNode(!0);s.style.cssText=`
30                position:absolute!important;left:-9999px!important;top:-9999px!important;
31                width:1100px!important;background:white!important;color:black!important;
32                max-height:none!important;height:auto!important;overflow:visible!important;
33                padding:50px!important;font-family:Arial, sans-serif!important;font-size:12pt!important;line-height:1.5!important;
34            `,document.body.appendChild(s),await new Promise(e=>setTimeout(e,150));let c=await html2canvas(s,{scale:2,useCORS:!0});document.body.removeChild(s);let{PDFDocument:l,StandardFonts:u,rgb:d}=PDFLib,f=c.width,p=c.height,m=612/f,h=p*m,g=await l.create(),_=Math.ceil(h/792);for(let t=0;t<_;t++){let n=document.createElement(`canvas`),r=n.getContext(`2d`);n.width=f,n.height=792/m,r.drawImage(c,0,t*n.height,f,n.height,0,0,f,n.height);let i=n.toDataURL(`image/png`),a=await fetch(i).then(e=>e.arrayBuffer()),o=await g.embedPng(a),s=g.addPage([612,792]);if(s.drawImage(o,{x:0,y:0,width:612,height:792}),t===_-1){let t=await fetch(e).then(e=>e.arrayBuffer()),n=await g.embedPng(t),r=await fetch(`https://cdn.enrollfirst.com/app-images/esign-stamp.png`).then(e=>e.arrayBuffer()),i=await g.embedPng(r),a=await g.embedFont(u.Helvetica
34Bold);s.drawImage(n,{x:36,y:18,width:250,height:100}),s.drawImage(i,{x:36,y:18,width:300,height:150});let o=new Date().toLocaleString(),c=(this.customer?.name||``).trim(),l=this.accountid?` ID(${this.accountid})`:``,f=this.ipAddress?` IP(${this.ipAddress})`:``;s.drawText(`Signed by ${c}${l}${f} on ${o}`,{x:66,y:33,size:10,font:a,color:d(0,0,0)})}}let v=await g.save(),y=new Blob([v],{type:`application/pdf`}),b=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result.split(`,`)[1]),n.onerror=t,n.readAsDataURL(y)});this.loading.payment=!0;try{(await axios.post(`/merchant/saveSignature`,{opportunity:this.payment.opportunity,signature_base64:e,page_pdf_base64:b})).data?.status===`success`?(window.Toast?.success?.(`Signature saved. You may proceed.`,`Success`),merchant.checkForSignature()):window.Toast?.danger?.(`Unable to save signature. Please try again.`,`Error`)}catch(e){console.error(e),window.Toast?.danger?.(`Oops. Something went wrong...`,`Error`)}finally{this.loading.payment=!1}},helpers:{detectCard(e){if(e&&e.length>0){let t=e.substring(0,1),n=e.substring(0,2),r=e.substring(0,4);if(t==4)return`visa`;if(n>=51&&n<=55)return`mast`;if(n==65||r==6011)return`disc`}return null},cardNumberError(e,t){return!!(e&&e.length>=4&&!t)},getError(e){let t=[{value:`U83`,text:`Transaction declined by your financial institution.  Please contact them directly or provide a new payment method and try again.`},{value:`U10`,text:`Transaction declined as a temporary caution by the payment gateway, which identified the request as a potential duplicate of another recent transaction.  Please try again in a few minutes.`},{value:`U80`,text:`Transaction declined.  The account information could not be validated. Please confirm the information or provide a new payment method and try again.`},{value:`U02`,text:`Transaction declined.  The account is not approved. Please confirm the information or provide a new payment method and try again.`},{value:`U19`,text:`The routing number provided is invalid. Please confirm the information or provide a new payment method and try again.`},{value:`U84`,text:`The transaction could not be completed because the financial institution is not responding. Please wait a few minutes or provide a new payment method and try again.`},{value:`U89`,text:`The transaction could not be completed because the financial institution is not responding. Please wait a few minutes or provide a new payment method and try again.`},{value:`U53`,text:`The transaction could not be completed at this time. Please confirm the information or provide a new payment method and try again.`}].find(t=>t.value===e);return t?t.text:`The transaction could not be completed at this time. Please confirm the information or provide a new payment method and try again.`}}};window.merchant=Alpine.reactive(e),Alpine.effect(()=>{merchant.newmethod.card_icon=merchant.helpers.detectCard(merchant.newmethod.card_number),merchant.newmethod.method_valid=merchant.newmethod.validate(),merchant.newmethod.card_number_error=merchant.helpers.cardNumberError(merchant.newmethod.card_number,merchant.newmethod.card_icon),merchant.buttonLabel=`Add to Wallet`;let e=merchant.paymethod&&!merchant.adding&&merchant.paymethod.paymethod_type===`echeck`||merchant.adding&&merchant.newmethod.method_type===`echeck`,t=merchant.paymethod&&!merchant.adding&&merchant.paymethod.paymethod_type===`card`||merchant.adding&&merchant.newmethod.method_type===`card`;if(e){let e=merchant.payment.echeck_total();merchant.payment.charge_amount=e,merchant.payment.fee=merchant.payment.echeck_fee(),merchant.payment.method_type=`(eCheck)`,merchant.buttonLabel=`Pay `+merchant.money(e)}else if(t){let e=merchant.payment.card_total();merchant.payment.charge_amount=e,merchant.payment.fee=merchant.payment.card_fee(),merchant.payment.method_type=`(Credit Card)`,merchant.buttonLabel=`Pay `+merchant.money(e)}}),document.addEventListener(`chargeComplete`,function(){window.Toast?.success?.(`Payment complete. Thank you.`,`Success`),merchant.loading.charge=!1})});function li(e,{merchant:t,http:n,dispatch:r}){return{...e,step:`manage`,selected:null,approved:!1,loading:!1,completed:!1,uncertain:!1,error:null,quote:null,quoteLoading:!1,quoteSequence:0,amountValue(){return Number(this.quote?.subtotal??this.amount??0)},feeValue(){return Number(this.quote?.fee??0)},includedFeeValue(){return Math.max(0,Number(this.quote?.fee_total??0)-this.feeValue())},totalValue(){return Number(this.quote?.total??0)},invalidateQuote(){this.quoteSequence++,this.quote=null,this.approved=!1,this.quoteLoading=!1},beginPayment(){!this.enabled||this.loading||this.uncertain||this.completed||(this.invalidateQuote(),this.error=null,this.step=`select`)},async select(e){!this.enabled||this.loading||this.uncertain||this.completed||(t.paymethod=e,t.adding=!1,t.dropdown=!1,this.selected=e,this.step=`amount`,await this.prepareQuote())},async prepareQuote(){if(!this.enabled||!this.selected||this.loading||this.uncertain||this.completed)return;this.invalidateQuote();let e=this.quoteSequence;this.quoteLoading=!0,this.error=null;try{let t=await n.post(`/merchant/member-wallet/preview`,{accountid:this.accountId,schedule_id:this.scheduleId,paymethod_token:this.selected.paymethod_token});if(e!==this.quoteSequence)return;if(t.data.status!==`success`){this.error=t.data.message||`We could not prepare your payment. No payment was submitted.`;return}this.quote=t.data.data,this.advanceSchedule=this.quote.advance_schedule??this.advanceSchedule,this.scheduleType=this.quote.payment_schedule_type??this.scheduleType,this.currentDraftDay=this.quote.current_draft_day??this.quote.recurring_draft_day??this.currentDraftDay}catch(t){if(e!==this.quoteSequence)return;this.error=t.response?.data?.message||`We could not prepare your payment. No payment was submitted. Please try again later.`}finally{e===this.quoteSequence&&(this.quoteLoading=!1)}},addNew(){this.loading||this.uncertain||this.completed||(this.backToManage(),t.adding=!0,t.dropdown=!1,t.setPaymentMethod(t.defaultPaymethod
34))},backToManage(){this.loading||this.uncertain||this.completed||(this.invalidateQuote(),this.step=`manage`,this.error=null)},backToSelect(){this.loading||this.uncertain||this.completed||(this.invalidateQuote(),this.step=`select`,this.error=null)},recurringDraftExplanation(){let e=Number(this.quote?.current_draft_day??this.quote?.recurring_draft_day??this.currentDraftDay);if(!Number.isInteger(e)||e<1||e>31)return``;let t=e%100>=11&&e%100<=13?`th`:{1:`st`,2:`nd`,3:`rd`}[e%10]||`th`;return`Your recurring draft day remains the `+e+t+` of the month.`+(e>28?` Shorter months use their last day.`:``)},isFailedOneTime(){return this.scheduleType===`failed_one_time`&&!this.advanceSchedule},amountLabel(){return this.isFailedOneTime()?`Failed one-time draft amount`:`Scheduled draft amount`},manageDescription(){return this.isFailedOneTime()?`Pay the failed one-time draft amount using a saved payment method.`:`Pay your scheduled draft amount using a saved payment method.`},canSubmit(){return!!(this.enabled&&this.quote?.context_version&&this.selected&&this.approved&&!this.loading&&!this.quoteLoading&&!this.completed&&!this.uncertain)},async charge(){if(this.canSubmit()){this.loading=!0,this.error=null;try{let e=await n.post(`/merchant/member-wallet/charge`,{accountid:this.accountId,schedule_id:this.scheduleId,paymethod_token:this.selected.paymethod_token,subtotal:this.quote.subtotal,fee:this.quote.fee,amount:this.quote.total,context_version:this.quote.context_version}),t=e.data.data;e.data.status===`success`&&t?.transaction_id?(this.completed=!0,r(t)):this.chargeFailure(e.data)}catch(e){this.chargeFailure(e.response?.data)}finally{this.loading=!1}}},chargeFailure(e){e?.no_charge===!0||e?.data?.no_charge===!0||e?.status===`declined`?(this.invalidateQuote(),this.error=e.message||`No payment was submitted. Refresh the payment amount and approve the updated details.`):(this.uncertain=!0,this.error=`We could not confirm your payment. Contact Billing before submitting another payment.`)}}}typeof window<`u`&&(window.createMemberPayment=li);var ui=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt((this.x-e.x)**2+(this.y-e.y)**2)}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time===e.time?0:this.distanceTo(e)/(this.time-e.time)}},di=class e{constructor(e,t,n,r,i,a){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=r,this.startWidth=i,this.endWidth=a}startPoint;control2;control1;endPoint;startWidth;endWidth;static fromPoints(t,n){let r=this.calculateControlPoints(t[0],t[1],t[2]).c2,i=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new e(t[1],r,i,t[2],n.start,n.end)}static calculateControlPoints(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=t.x-n.x,o=t.y-n.y,s={x:(e.x+t.x)/2,y:(e.y+t.y)/2},c={x:(t.x+n.x)/2,y:(t.y+n.y)/2},l=Math.sqrt(r*r+i*i),u=Math.sqrt(a*a+o*o),d=s.x-c.x,f=s.y-c.y,p=l+u==0?0:u/(l+u),m={x:c.x+d*p,y:c.y+f*p},h=t.x-m.x,g=t.y-m.y;return{c1:new ui(s.x+h,s.y+g),c2:new ui(c.x+h,c.y+g)}}length(){let e=0,t,n;for(let r=0;r<=10;r+=1){let i=r/10,a=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),o=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){let r=a-t,i=o-n;e+=Math.sqrt(r*r+i*i)}t=a,n=o}return e}point(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e}},fi=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function pi(e,t=250){let n=0,r=null,i,a,o,s=()=>{n=Date.now(),r=null,i=e.apply(a,o),r||(a=null,o=[])};return function(...c){let l=Date.now(),u=t-(l-n);return a=this,o=c,u<=0||u>t?(r&&=(clearTimeout(r),null),n=l,i=e.apply(a,o),r||(a=null,o=[])):r||=window.setTimeout(s,u),i}}var mi=class e extends fi{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||`black`,this.backgroundColor=n.backgroundColor||`rgba(0,0,0,0)`,this.compositeOperation=n.compositeOperation||`source-over`,this.canvasContextOptions=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?pi(e.prototype._strokeUpdate,this.throttle):e.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handlePointerCancel=this._handlePointerCancel.bind(this),this._handleTouchCancel=this._handleTouchCancel.bind(this),this._ctx=t.getContext(`2d`,this.canvasContextOptions),this.clear(),this.on()}canvas;dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;clear(){let{_ctx:e,canvas:t}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){let e=this._data,t=this._dataUrl,n=this._dataUrlOptions;this.clear(),t&&this.fromDataURL(t,n),this.fromData(e,{clear:!1})}fromDataURL(e,t={}){return new Promise((n,r)=>{let i=new Image,a=t.ratio||window.devicePixelRatio||1,o=t.width||this.canvas.width/a,s=t.height||this.canvas.height/a,c=t.xOffset||0,l=t.yOffset||0;this._reset(this._getPointGroupOptions()),i.onload=()=>{this._ctx.drawImage(i,c,l,o,s),n()},i.onerror=e=>{r(e)},i.crossOrigin=`anonymous`,i.src=e,this._isEmpty=!1,this._dataUrl=e,this._dataUrlOptions={...t}})}toDataURL(e=`image/png`,t){switch(e){case`image/svg+xml`:return typeof t!=`object`&&(t=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(t))}`;default:return typeof t!=`number`&&(t=void 0),this.canvas.toDataURL(e,t)}}on(){this.canvas.style.touchAction=`none`,this.canvas.style.msTouchAction=`none`,this.canvas.style.userSelect=`none`,this.canvas.style.webkitUserSelect=`none`;let e=/Macintosh/.test(navigator.userAgent)&&`ontouchstart`in document;window.PointerEvent&&!e?this._handlePointerEvents():(this._handleMouseEvents(),`ontouchstart`in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction=`auto`,this.canvas.style.msTouchAction=`auto`,this.canvas.style.userSelect=`auto`,this.canvas.style.webkitUserSelect=`auto`,this.canvas.removeEventListener(`pointerdown`,this._handlePointerDown),this.canvas.removeEventListener(`mousedown`,this._handleMouseDown),this.canvas.removeEventListener(`touchstart`,this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){let e=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}_removeMoveUpEventListeners(){let{removeEventListener:e}=this._getListenerFunctions();e(`pointermove`,this._handlePointerMove),e(`pointerup`,this._handlePointerUp),e(`pointercancel`,this._handlePointerCancel),e(`mousemove`,this._handleMouseMove),e(`mouseup`,this._handleMouseUp),e(`touchmove`,this._handleTouchMove),e(`touchend`,this._handleTouchEnd),e(`touchcancel`,this._handleTouchCancel)}isEmpty(){return this._isEmpty}fromData(e,{clear:t=!0}={}){t&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this),this._drawLine.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_isLeftButtonPressed(e,t){return t?e.buttons===1:(e.buttons&1)==1}_pointerEventToSignatureEvent(e){return{event:e,type:e.type,x:e.clientX,y:e.clientY,pressure:`pressure`in e?e.pressure:0}}_touchEventToSignatureEvent(e){let t=e.changedTouches[0];return{event:e,type:e.type,x:t.clientX,y:t.clientY,pressure:t.force}}_handleMouseDown(e){!this._isLeftButtonPressed(e,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(e))}
vendor: 5,952 bytes, line 34
34_handleMouseMove(e){if(!this._isLeftButtonPressed(e,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(e),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e))}_handleMouseUp(e){this._isLeftButtonPressed(e)||this._strokeEnd(this._pointerEventToSignatureEvent(e))}_handleTouchStart(e){e.targetTouches.length!==1||this._drawingStroke||(e.cancelable&&e.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(e)))}_handleTouchMove(e){if(e.targetTouches.length===1){if(e.cancelable&&e.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(e),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(e))}}_handleTouchEnd(e){e.targetTouches.length===0&&(e.cancelable&&e.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(e)))}_handlePointerCancel(e){this._allowPointerId(e)&&(e.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(e),!1))}_handleTouchCancel(e){e.cancelable&&e.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(e),!1)}_getPointerId(e){return e.persistentDeviceId||e.pointerId}_allowPointerId(e,t=!1){return this._strokePointerId===void 0?t:this._getPointerId(e)===this._strokePointerId}_handlePointerDown(e){this._drawingStroke||!this._isLeftButtonPressed(e)||!this._allowPointerId(e,!0)||(this._strokePointerId=this._getPointerId(e),e.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(e)))}_handlePointerMove(e){if(this._allowPointerId(e)){if(!this._isLeftButtonPressed(e,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(e),!1);return}e.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e))}}_handlePointerUp(e){this._isLeftButtonPressed(e)||!this._allowPointerId(e)||(e.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(e)))}_getPointGroupOptions(e){return{penColor:e&&`penColor`in e?e.penColor:this.penColor,dotSize:e&&`dotSize`in e?e.dotSize:this.dotSize,minWidth:e&&`minWidth`in e?e.minWidth:this.minWidth,maxWidth:e&&`maxWidth`in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&`velocityFilterWeight`in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&`compositeOperation`in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent(`beginStroke`,{detail:e,cancelable:!0})))return;let{addEventListener:t}=this._getListenerFunctions();switch(e.event.type){case`mousedown`:t(`mousemove`,this._handleMouseMove,{passive:!1}),t(`mouseup`,this._handleMouseUp,{passive:!1});break;case`touchstart`:t(`touchmove`,this._handleTouchMove,{passive:!1}),t(`touchend`,this._handleTouchEnd,{passive:!1}),t(`touchcancel`,this._handleTouchCancel,{passive:!1});break;case`pointerdown`:t(`pointermove`,this._handlePointerMove,{passive:!1}),t(`pointerup`,this._handlePointerUp,{passive:!1}),t(`pointercancel`,this._handlePointerCancel,{passive:!1})}this._drawingStroke=!0;let n=this._getPointGroupOptions(),r={...n,points:[]};this._data.push(r),this._reset(n),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(e);return}this.dispatchEvent(new CustomEvent(`beforeUpdateStroke`,{detail:e}));let t=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],r=n.points,i=r.length>0&&r[r.length-1],a=i?t.distanceTo(i)<=this.minDistance:!1,o=this._getPointGroupOptions(n);if(!i||!(i&&a)){let e=this._addPoint(t,o);i?e&&this._drawCurve(e,o):this._drawDot(t,o),r.push({time:t.time,x:t.x,y:t.y,pressure:t.pressure})}this.dispatchEvent(new CustomEvent(`afterUpdateStroke`,{detail:e}))}_strokeEnd(e,t=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent(`endStroke`,{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener(`pointerdown`,this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener(`mousedown`,this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener(`touchstart`,this._handleTouchStart,{passive:!1})}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,t,n){let r=this.canvas.getBoundingClientRect();return new ui(e-r.left,t-r.top,n,new Date().getTime())}_addPoint(e,t){let{_lastPoints:n}=this;if(n.push(e),n.length>2){n.length===3&&n.unshift(n[0]);let e=this._calculateCurveWidths(n[1],n[2],t),r=di.fromPoints(n,e);return n.shift(),r}return null}_calculateCurveWidths(e,t,n){let r=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(r,n),a={end:i,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=i,a}_strokeWidth(e,t){return Math.max(t.maxWidth/(e+1),t.minWidth)}_drawCurveSegment(e,t,n){let r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,t){let n=this._ctx,r=e.endWidth-e.startWidth,i=Math.ceil(e.length())*2;n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<i;n+=1){let a=n/i,o=a*a,s=o*a,c=1-a,l=c*c,u=l*c,d=u*e.startPoint.x;d+=3*l*a*e.control1.x,d+=3*c*o*e.control2.x,d+=s*e.endPoint.x;let f=u*e.startPoint.y;f+=3*l*a*e.control1.y,f+=3*c*o*e.control2.y,f+=s*e.endPoint.y;let p=Math.min(e.startWidth+s*r,t.maxWidth);this._drawCurveSegment(d,f,p)}n.closePath(),n.fill()}_getDotSize(e){return e.dotSize>0?e.dotSize:(e.minWidth+e.maxWidth)/2}_drawDot(e,t){let n=this._ctx,r=this._getDotSize(t);n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=t.penColor,n.fill()}_drawLine(e,t,n){let r=this._ctx;r.save(),r.beginPath(),r.moveTo(e.x,e.y),r.lineTo(t.x,t.y),r.lineWidth=this._getDotSize(n)*2,r.lineCap=`round`,r.strokeStyle=n.penColor,r.stroke(),r.restore(
34),this._isEmpty=!1}_fromData(e,t,n,r){for(let i of e){let{points:e}=i,a=this._getPointGroupOptions(i);if(e.length>2)for(let n=0;n<e.length;n+=1){let r=e[n],i=new ui(r.x,r.y,r.pressure,r.time);n===0&&this._reset(a);let o=this._addPoint(i,a);o&&t(o,a)}else e.length===2?(this._reset(a),r(e[0],e[1],a)):(this._reset(a),n(e[0],a))}}toSVG({includeBackgroundColor:e=!1,includeDataUrl:t=!1}={}){let n=this._data,r=Math.max(window.devicePixelRatio||1,1),i=this.canvas.width/r,a=this.canvas.height/r,o=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);if(o.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),o.setAttribute(`xmlns:xlink`,`http://www.w3.org/1999/xlink`),o.setAttribute(`viewBox`,`0 0 ${i} ${a}`),o.setAttribute(`width`,i.toString()),o.setAttribute(`height`,a.toString()),e&&this.backgroundColor){let e=document.createElement(`rect`);e.setAttribute(`width`,`100%`),e.setAttribute(`height`,`100%`),e.setAttribute(`fill`,this.backgroundColor),o.appendChild(e)}if(t&&this._dataUrl){let e=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,t=this._dataUrlOptions?.width||this.canvas.width/e,n=this._dataUrlOptions?.height||this.canvas.height/e,r=this._dataUrlOptions?.xOffset||0,i=this._dataUrlOptions?.yOffset||0,a=document.createElement(`image`);a.setAttribute(`x`,r.toString()),a.setAttribute(`y`,i.toString()),a.setAttribute(`width`,t.toString()),a.setAttribute(`height`,n.toString()),a.setAttribute(`preserveAspectRatio`,`none`),a.setAttribute(`href`,this._dataUrl),o.appendChild(a)}return this._fromData(n,(e,{penColor:t})=>{let n=document.createElement(`path`);if(!isNaN(e.control1.x)&&!isNaN(e.control1.y)&&!isNaN(e.control2.x)&&!isNaN(e.control2.y)){let r=`M ${e.startPoint.x.toFixed(3)},${e.startPoint.y.toFixed(3)} C ${e.control1.x.toFixed(3)},${e.control1.y.toFixed(3)} ${e.control2.x.toFixed(3)},${e.control2.y.toFixed(3)} ${e.endPoint.x.toFixed(3)},${e.endPoint.y.toFixed(3)}`;n.setAttribute(`d`,r),n.setAttribute(`stroke-width`,(e.endWidth*2.25).toFixed(3)),n.setAttribute(`stroke`,t),n.setAttribute(`fill`,`none`),n.setAttribute(`stroke-linecap`,`round`),o.appendChild(n)}},(e,{penColor:t,dotSize:n,minWidth:r,maxWidth:i})=>{let a=document.createElement(`circle`),s=n>0?n:(r+i)/2;a.setAttribute(`r`,s.toString()),a.setAttribute(`cx`,e.x.toString()),a.setAttribute(`cy`,e.y.toString()),a.setAttribute(`fill`,t),o.appendChild(a)},(e,t,n)=>{let r=document.createElement(`line`);r.setAttribute(`x1`,e.x.toString()),r.setAttribute(`y1`,e.y.toString()),r.setAttribute(`x2`,t.x.toString()),r.setAttribute(`y2`,t.y.toString()),r.setAttribute(`stroke`,n.penColor),r.setAttribute(`stroke-width`,(this._getDotSize(n)*2).toString()),r.setAttribute(`stroke-linecap`,`round`),o.appendChild(r)}),o.outerHTML}},hi=()=>Math.max(window.devicePixelRatio||1,1),gi=()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));function _i(e={}){return{cid:e.cid||null,lineWidth:e.lineWidth??2,penColor:e.penColor??`#111827`,bgColor:e.bgColor??`rgba(255,255,255,0)`,minPixelsThreshold:e.minPixelsThreshold??1200,disabled:!!e.disabled,preview:e.preview??!0,whiteBackgroundOnExport:!!e.whiteBackgroundOnExport,storageKey:e.storageKey||`ef.signature.default`,replaceSaved:!!e.replaceSaved,pad:null,value:``,isEmpty:!0,canvas:null,containerEl:null,previewEl:null,savedPreviewEl:null,savedContainerEl:null,hasSaved:!1,savedUrl:null,async init(){this.containerEl=this.$refs.canvasContainer||null,this.canvas=this.$refs.canvas,this.previewEl=this.$refs.preview,this.savedPreviewEl=this.$refs.savedPreview||null,this.savedContainerEl=this.$refs.savedContainer||null,await gi(),this._resizeCanvas(!1),this.pad=new mi(this.canvas,{minWidth:this.lineWidth,maxWidth:this.lineWidth+1,penColor:this.penColor,backgroundColor:this.bgColor,onEnd:()=>this.isEmpty=this.pad.isEmpty()}),this.disabled&&this.pad.off(),this._loadSavedFromStorage(),window.addEventListener(`resize`,()=>this._resizeCanvas(!0),{passive:!0}),window.addEventListener(`signature:clear`,e=>{e.detail?.id===this.cid&&this.clear()}),window.addEventListener(`signature:capture`,async e=>
34{e.detail?.id===this.cid&&await this._validateAndCapture()}),window.addEventListener(`signature:get-url`,e=>{e.detail?.id===this.cid&&window.dispatchEvent(new CustomEvent(`signature:response`,{detail:{id:this.cid,dataUrl:this._exportDataURL()}}))}),window.addEventListener(`signature:load`,e=>{if(e.detail?.id!==this.cid)return;let t=e.detail?.dataUrl||``;if(!t)return this.clear();try{this.pad.fromDataURL(t),this.isEmpty=this.pad.isEmpty(),this.value=t,this.preview&&this.previewEl&&(this.previewEl.src=t,this.previewEl.classList.remove(`hidden`),this._showInput(!1))}catch(e){console.error(`Invalid signature dataURL`,e)}}),window.addEventListener(`signature:render-image`,e=>{if(e.detail?.id!==this.cid||!this.preview||!this.previewEl)return;let t=e.detail?.dataUrl||``,n=!!t;this.previewEl.src=t,this.previewEl.classList.toggle(`hidden`,!n),this._showInput(!n)})},async applySaved(){if(this.savedUrl){this._showInput(!0),this.pad.clear();try{this.pad.fromDataURL(this.savedUrl)}catch(e){console.error(e)}await gi(),await this._validateAndCapture()}},clearSaved(){try{localStorage.removeItem(this.storageKey)}catch{}this.savedUrl=null,this.hasSaved=!1,this.savedPreviewEl&&(this.savedPreviewEl.src=``,this.savedPreviewEl.classList.add(`hidden`)),this.previewEl&&(this.previewEl.src=``,this.previewEl.classList.add(`hidden`)),this._showInput(!0),this.clear()},clear(){this.pad.clear(),this.value=``,this.isEmpty=!0,this.preview&&this.previewEl&&(this.previewEl.src=``,this.previewEl.classList.add(`hidden`)),this._showInput(!0),this.$dispatch(`signature-cleared`,{id:this.cid})},undo(){let e=this.pad.toData();e.pop(),this.pad.fromData(e),this.isEmpty=this.pad.isEmpty()},async _validateAndCapture(){if(this.pad.isEmpty()){this._emitInvalid(`empty`);return}if(this._countInkPixels()<this.minPixelsThreshold){this._emitInvalid(`too_small`);return}let e=this._exportDataURL();this.value=e,this.isEmpty=!1,this._maybePersistSaved(e),this.preview&&this.previewEl&&(this.previewEl.src=e,this.previewEl.classList.remove(`hidden`)),this._showInput(!1),window.dispatchEvent(new CustomEvent(`signature:captured`,{detail:{id:this.cid,dataUrl:e}}))},_emitInvalid(e){this._showInput(!0),this.$dispatch(`signature-too-small`,{id:this.cid,reason:e}),window.dispatchEvent(new CustomEvent(`signature:invalid`,{detail:{id:this.cid,reason:e}}))},_showInput(e){let t=e?`remove`:`add`;this.containerEl?this.containerEl.classList[t](`hidden`):this.canvas.classList[t](`hidden`)},_loadSavedFromStorage(){try{let e=localStorage.getItem(this.storageKey);e&&(this.savedUrl=e,this.hasSaved=!0,this.savedPreviewEl&&(this.savedPreviewEl.src=e,this.savedPreviewEl.classList.remove(`hidden`)),window.dispatchEvent(new CustomEvent(`signature:saved-available`,{detail:{id:this.cid,storageKey:this.storageKey}})))}catch{}},_maybePersistSaved(e){try{(!localStorage.getItem(this.storageKey)||this.replaceSaved)&&(localStorage.setItem(this.storageKey,e),this.savedUrl=e,this.hasSaved=!0,this.savedPreviewEl&&(this.savedPreviewEl.src=e,this.savedPreviewEl.classList.remove(`hidden`)),window.dispatchEvent(new CustomEvent(`signature:saved`,{detail:{id:this.cid,storageKey:this.storageKey}})))}catch{}},_resizeCanvas(e){let t=hi(),{width:n,height:r}=this.canvas.getBoundingClientRect(),i=e&&this.pad?this.pad.toData():null;this.canvas.width=Math.max(Math.floor(n*t),1),this.canvas.height=Math.max(Math.floor(r*t),1),this.canvas.getContext(`2d`).scale(t,t),e&&i&&this.pad&&(this.pad.clear(),this.pad.fromData(i))},_exportDataURL(){if(!this.whiteBackgroundOnExport)return this.canvas.toDataURL(`image/png`);let{width:e,height:t}=this.canvas.getBoundingClientRect(),n=document.createElement(`canvas`);n.width=this.canvas.width,n.height=this.canvas.height;let r=n.getContext(`2d`);r.fillStyle=`#ffffff`,r.fillRect(0,0,n.width,n.height),r.drawImage(this.canvas,0,0);let i=document.createElement(`canvas`);return i.width=Math.floor(e),i.height=Math.floor(t),i.getContext(`2d`).drawImage(n,0,0,i.width,i.height),i.toDataURL(`image/png`)},_countInkPixels(){let e=this.canvas.getContext(`2d`),t=this.canvas.width,n=this.canvas.height;if(!t||!n)return 0;let r=e.getImageData(0,0,t,n).data,i=0;for(let e=3;e<r.length;e+=4)r[e]!==0&&i++;return i}}}window.signaturePadComponent=_i;var vi=Object.prototype.toString;function yi(e){switch(vi.call(e)){case`[object Error]`:case`[object E
34xception]`:case`[object DOMException]`:return!0;default:return Pi(e,Error)}}function bi(e,t){return vi.call(e)===`[object ${t}]`}function xi(e){return bi(e,`ErrorEvent`)}function Si(e){return bi(e,`DOMError`)}function Ci(e){return bi(e,`DOMException`)}function wi(e){return bi(e,`String`)}function Ti(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function Ei(e){return e===null||Ti(e)||typeof e!=`object`&&typeof e!=`function`}function Di(e){return bi(e,`Object`)}function Oi(e){return typeof Event<`u`&&Pi(e,Event)}function ki(e){return typeof Element<`u`&&Pi(e,Element)}function Ai(e){return bi(e,`RegExp`)}function ji(e){return!!(e&&e.then&&typeof e.then==`function`)}function Mi(e){return Di(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function Ni(e){return typeof e==`number`&&e!==e}function Pi(e,t){try{return e instanceof t}catch{return!1}}function Fi(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue))}function Ii(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Li(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function Ri(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Fi(r)?n.push(`[VueViewModel]`):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function zi(e,t,n=!1){return wi(e)?Ai(t)?t.test(e):wi(t)?n?e===t:e.includes(t):!1:!1}function Bi(e,t=[],n=!1){return t.some(t=>zi(e,t,n))}function Vi(e,t,n=250,r,i,a,o){if(!a.exception||!a.exception.values||!o||!Pi(o.originalException,Error))return;let s=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;s&&(a.exception.values=Gi(Hi(e,t,i,o.originalException,r,a.exception.values,s,0),n))}function Hi(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Pi(r[i],Error)){Ui(o,s);let a=e(t,r[i]),l=c.length;Wi(a,i,l,s),c=Hi(e,t,n,r[i],i,[a,...c],a,l)}return Array.isArray(r.errors)&&r.errors.forEach((r,a)=>{if(Pi(r,Error)){Ui(o,s);let l=e(t,r),u=c.length;Wi(l,`errors[${a}]`,u,s),c=Hi(e,t,n,r,i,[l,...c],l,u)}}),c}function Ui(e,t){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,...e.type===`AggregateError`&&{is_exception_group:!0},exception_id:t}}function Wi(e,t,n,r){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Gi(e,t){return e.map(e=>(e.value&&=Ii(e.value,t),e))}function Ki(e){return e&&e.Math==Math?e:void 0}var qi=typeof globalThis==`object`&&Ki(globalThis)||typeof window==`object`&&Ki(window)||typeof self==`object`&&Ki(self)||typeof global==`object`&&Ki(global)||(function(){return this})()||{};function Ji(){return qi}function Yi(e,t,n){let r=n||qi,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}var Xi=Ji(),Zi=80;function Qi(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Zi;for(;n&&i++<5&&(o=$i(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function $i(e,t){let n=e,r=[],i,a,o,s,c;if(!n||!n.tagName)return``;if(Xi.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());let l=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(l&&l.length)l.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&wi(i))for(a=i.split(/\s+/),c=0;c<a.length;c++)r.push(`.${a[c]}`);let u=[`aria-label`,`type`,`name`,`title`,`alt`];for(c=0;c<u.length;c++)o=u[c],s=n.getAttribute(o),s&&r.push(`[${o}="${s}"]`);return r.join(``)}function ea(){try{return Xi.document.location.href}catch{return``}}function ta(e){return Xi.document&&Xi.document.querySelector?Xi.document.querySelector(e):null}function na(e){if(!Xi.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}var ra=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,ia=`Sentry Logger `,aa=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],oa={};function sa(e){if(!(`console`in qi))return e();let t=qi.console,n={},r=Object.keys(oa);
vendor: 12,101 bytes, lines 34-35
34r.forEach(e=>{let r=oa[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function ca(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return ra?aa.forEach(n=>{t[n]=(...t)=>{e&&sa(()=>{qi.console[n](`${ia}[${n}]:`,...t)})}}):aa.forEach(e=>{t[e]=()=>void 0}),t}var W=ca(),la=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ua(e){return e===`http`||e===`https`}function da(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function fa(e){let t=la.exec(e);if(!t){sa(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a,o=``,s]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return pa({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function pa(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function ma(e){if(!ra)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(W.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?ua(r)?t&&isNaN(parseInt(t,10))?(W.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(W.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(W.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function ha(e){let t=typeof e==`string`?fa(e):pa(e);if(!(!t||!ma(t)))return t}var ga=class extends Error{constructor(e,t=`warn`){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function _a(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);typeof i==`function`&&ya(i,r),e[t]=i}function va(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{ra&&W.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function ya(e,t){try{e.prototype=t.prototype=t.prototype||{},va(e,`__sentry_original__`,t)}catch{}}function ba(e){return e.__sentry_original__}function xa(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join(`&`)}function Sa(e){if(yi(e))return{message:e.message,name:e.name,stack:e.stack,...wa(e)};if(Oi(e)){let t={type:e.type,target:Ca(e.target),currentTarget:Ca(e.currentTarget),...wa(e)};return typeof CustomEvent<`u`&&Pi(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Ca(e){try{return ki(e)?Qi(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function wa(e){if(typeof e==`object`&&e){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ta(e,t=40){let n=Object.keys(Sa(e));if(n.sort(),!n.length)return`[object has no keys]`;if(n[0].length>=t)return Ii(n[0],t);for(let e=n.length;e>0;e--){let r=n.slice(0,e).join(`, `);if(!(r.length>t))return e===n.length?r:Ii(r,t)}return``}function Ea(e){return Da(e,new Map)}function Da(e,t){if(Oa(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let n of Object.keys(e))e[n]!==void 0&&(r[n]=Da(e[n],t));return r}if(Array.isArray(e)){let n=t.get(e);if(n!==void 0)return n;let r=[];return t.set(e,r),e.forEach(e=>{r.push(Da(e,t))}),r}return e}function Oa(e){if(!Di(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||t===`Object`}catch{return!0}}var ka=50,Aa=/\(error: (.*)\)/,ja=/captureMessage|captureException/;function Ma(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{let r=[],i=e.split(`
35`);for(let e=n;e<i.length;e++){let n=i[e];if(n.length>1024)continue;let a=Aa.test(n)?n.replace(Aa,`$1`):n;if(!a.match(/\S*Error: /)){for(let e of t){let t=e(a);if(t){r.push(t);break}}if(r.length>=ka)break}}return Pa(r)}}function Na(e){return Array.isArray(e)?Ma(...e):e}function Pa(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||``)&&t.pop(),t.reverse(),ja.test(t[t.length-1].function||``)&&(t.pop(),ja.test(t[t.length-1].function||``)&&t.pop()),t.slice(0,ka).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||`?`}))}var Fa=`<anonymous>`;function Ia(e){try{return!e||typeof e!=`function`?Fa:e.name||Fa}catch{return Fa}}var La={},Ra={};function za(e,t){La[e]=La[e]||[],La[e].push(t)}function Ba(e,t){Ra[e]||(t(),Ra[e]=!0)}function Va(e,t){let n=e&&La[e];if(n)for(let r of n)try{r(t)}catch(t){ra&&W.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ia(r)}\nError:`,t)}}function Ha(e){let t=`console`;za(t,e),Ba(t,Ua)}function Ua(){`console`in qi&&aa.forEach(function(e){e in qi.console&&_a(qi.console,e,function(t){return oa[e]=t,function(...t){Va(`console`,{args:t,level:e});let n=oa[e];n&&n.apply(qi.console,t)}})})}function Wa(){let e=qi,t=e.crypto||e.msCrypto,n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,``);t&&t.getRandomValues&&(n=()=>{let e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return`10000000100040008000100000000000`.replace(/[018]/g,e=>(e^(n()&15)>>e/4).toString(16))}function Ga(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ka(e){let{message:t,event_id:n}=e;if(t)return t;let r=Ga(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function qa(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function Ja(e,t){let n=Ga(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i&&i.data,...t.data};n.mechanism.data=e}}function Ya(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,i=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,i-n),i).map(e=>Li(e,0)),t.context_line=Li(e[Math.min(r-1,i)],t.colno||0),t.post_context=e.slice(Math.min(i+1,r),i+1+n).map(e=>Li(e,0))}function Xa(e){if(e&&e.__sentry_captured__)return!0;try{va(e,`__sentry_captured__`,!0)}catch{}return!1}function Za(e){return Array.isArray(e)?e:[e]}var Qa=qi,$a=1e3,eo,to,no;function ro(e){za(`dom`,e),Ba(`dom`,ao)}function ao(){if(!Qa.document)return;let e=Va.bind(null,`dom`),t=co(e,!0);Qa.document.addEventListener(`click`,t,!1),Qa.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Qa[t]&&Qa[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty(`addEventListener`)||(_a(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this,a=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=a[n]=a[n]||{refCount:0};if(!o.handler){let r=co(e);o.handler=r,t.call(this,n,r,i)}o.refCount++}catch{}return t.call(this,n,r,i)}}),_a(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this,i=n.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount--,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),Object.keys(i).length===0&&delete n.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function oo(e){if(e.type!==to)return!1;try{if(!e.target||e.target._sentryId!==no)return!1}catch{}return!0}function so(e,t){return e===`keypress`?!t||!t.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function co(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=lo(n);if(so(n.type,r))return;va(n,`_sentryCaptured`,!0),r&&!r._sentryId&&va(r,`_sentryId`,Wa());let i=n.type===`keypress`?`input`:n.type;oo(n)||(e({event:n,name:i,global:t}),to=n.type,no=r?r._sentryId:void 0),clearTimeout(eo),eo=Qa.setTimeout(()=>{no=void 0,to=void 0},$a)}}function lo(e){try{return e.target}catch{return null}}var uo=Ji();function fo(){if(!(`fetch`in uo))return!1;try{return new Headers,new Request(`http://www.example.com`),new Response,!0}catch{return!1}}function po(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function mo(){if(typeof EdgeRuntime==`string`)return!0;if(!fo())return!1;if(po(uo.fetch))return!0;let e=!1,t=uo.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=po(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){ra&&W.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function ho(){return`ReportingObserver`in uo}function go(e){let t=`fetch`;za(t,e),Ba(t,_o)}function _o(){mo()&&_a(qi,`fetch`,function(e){return function(...t){let{method:n,url:r}=bo(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Va(`fetch`,{...i}),e.apply(qi,t).then(e=>(Va(`fetch`,{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Va(`fetch`,{...i,endTimestamp:Date.now(),error:e}),e})}})}function vo(e,t){return!!e&&typeof e==`object`&&!!e[t]}function yo(e){return typeof e==`string`?e:e?vo(e,`url`)?e.url:e.toString?e.toString():``:``}function bo(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:yo(t),method:vo(n,`method`)?String(n.method).toUpperCase():`GET`}}let t=e[0];return{url:yo(t),method:vo(t,`method`)?String(t.method).toUpperCase():`GET`}}var xo=null;function So(e){let t=`error`;za(t,e),Ba(t,Co)}function Co(){xo=qi.onerror,qi.onerror=function(e,t,n,r,i){return Va(`error`,{column:r,error:i,line:n,msg:e,url:t}),xo&&!xo.__SENTRY_LOADER__?xo.apply(this,arguments):!1},qi.onerror.__SENTRY_INSTRUMENTED__=!0}var wo=null;function To(e){let t=`unhandledrejection`;za(t,e),Ba(t,Eo)}function Eo(){wo=qi.onunhandledrejection,qi.onunhandledrejection=function(e){return Va(`unhandledrejection`,e),wo&&!wo.__SENTRY_LOADER__?wo.apply(this,arguments):!0},qi.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Do=Ji();function Oo(){let e=Do.chrome,t=e&&e.app&&e.app.runtime,n=`history`in Do&&!!Do.history.pushState&&!!Do.history.replaceState;return!t&&n}var ko=qi,Ao;function jo(e){let t=`history`;za(t,e),Ba(t,Mo)}function Mo(){if(!Oo())return;let e=ko.onpopstate;ko.onpopstate=function(...t){let n=ko.location.href,r=Ao;if(Ao=n,Va(`history`,{from:r,to:n}),e)try{return e.apply(this,t)}catch{}};function t(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let e=Ao,t=String(n);Ao=t,Va(`history`,{from:e,to:t})}return e.apply(this,t)}}_a(ko.history,`pushState`,t),_a(ko.history,`replaceState`,t)}var No=qi,Po=`__sentry_xhr_v3__`;function G(e){za(`xhr`,e),Ba(`xhr`,Fo)}function Fo(){if(!No.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;_a(e,`open`,function(e){return function(...t){let n=Date.now(),r=wi(t[0])?t[0].toUpperCase():void 0,i=Io(t[1]);if(!r||!i)return e.apply(this,t);this[Po]={method:r,url:i,request_headers:{}},r===`POST`&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let a=()=>{let e=this[Po];if(e&&this.readyState===4){try{e.status_code=this.status}catch{}Va(`xhr`,{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return`onreadystatechange`in this&&typeof this.onreadystatechange==`function`?_a(this,`onreadystatechange`,function(e){return function(...t){return a(),e.apply(this,t)}}):this.addEventListener(`readystatechange`,a),_a(this,`setRequestHeader`,function(e){return function(...t){let[n,r]=t,i=this[Po];return i&&wi(n)&&wi(r)&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}}),e.apply(this,t)}}),_a(e,`send`,function(e){return function(...t){let n=this[Po];return n?(t[0]!==void 0&&(n.body=t[0]),Va(`xhr`,{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}})}function Io(e){if(wi(e))return e;try{return e.toString()}catch{}}function Lo(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function Ro(){return`npm`}function zo(){return!Lo()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function Bo(){return typeof window<`u`&&(!zo()||Vo())}function Vo(){return qi.process!==void 0&&qi.process.type===`renderer`}function Ho(){let e=typeof WeakSet==`function`,t=e?new WeakSet:[];
35function n(n){if(e)return t.has(n)?!0:(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1}function r(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}return[n,r]}function Uo(e,t=100,n=1/0){try{return Go(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Wo(e,t=3,n=102400){let r=Uo(e,t);return Yo(r)>n?Wo(e,t-1,n):r}function Go(e,t,n=1/0,r=1/0,i=Ho()){let[a,o]=i;if(t==null||[`number`,`boolean`,`string`].includes(typeof t)&&!Ni(t))return t;let s=Ko(e,t);if(!s.startsWith(`[object `))return s;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(c===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let l=t;if(l&&typeof l.toJSON==`function`)try{return Go(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=Sa(t);for(let e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(d>=r){u[e]=`[MaxProperties ~]`;break}let t=f[e];u[e]=Go(e,t,c-1,r,i),d++}return o(t),u}function Ko(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Fi(t))return`[VueViewModel]`;if(Mi(t))return`[SyntheticEvent]`;if(typeof t==`number`&&t!==t)return`[NaN]`;if(typeof t==`function`)return`[Function: ${Ia(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=qo(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function qo(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:`null prototype`}function Jo(e){return~-encodeURI(e).split(/%..|./).length}function Yo(e){return Jo(JSON.stringify(e))}function Xo(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];r===`.`?e.splice(t,1):r===`..`?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;)e.unshift(`..`);return e}var Zo=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Qo(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Zo.exec(t);return n?n.slice(1):[]}function $o(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:`/`;i&&(t=`${i}/${t}`,n=i.charAt(0)===`/`)}return t=Xo(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`}function es(e){let t=0;for(;t<e.length&&e[t]===``;t++);let n=e.length-1;for(;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}function ts(e,t){e=$o(e).slice(1),t=$o(t).slice(1);let n=es(e.split(`/`)),r=es(t.split(`/`)),i=Math.min(n.length,r.length),a=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){a=e;break}let o=[];for(let e=a;e<n.length;e++)o.push(`..`);return o=o.concat(r.slice(a)),o.join(`/`)}function ns(e,t){let n=Qo(e)[2];return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var rs;(function(e){e[e.PENDING=0]=`PENDING`,e[e.RESOLVED=1]=`RESOLVED`,e[e.REJECTED=2]=`REJECTED`})(rs||={});function is(e){return new os(t=>{t(e)})}function as(e){return new os((t,n)=>{n(e)})}var os=class e{constructor(t){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),this._state=rs.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(e){this._reject(e)}}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}__init(){this._resolve=e=>{this._setResult(rs.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(rs.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===rs.PENDING){if(ji(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>
35{if(this._state===rs.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===rs.RESOLVED&&e[1](this._value),this._state===rs.REJECTED&&e[2](this._value),!0)})}}};function ss(e){let t=[];function n(){return e===void 0||t.length<e}function r(e){return t.splice(t.indexOf(e),1)[0]}function i(e){if(!n())return as(new ga(`Not adding Promise because buffer limit was reached.`));let i=e();return t.indexOf(i)===-1&&t.push(i),i.then(()=>r(i)).then(null,()=>r(i).then(null,()=>{})),i}function a(e){return new os((n,r)=>{let i=t.length;if(!i)return n(!0);let a=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{is(e).then(()=>{--i||(clearTimeout(a),n(!0))},r)})})}return{$:t,add:i,drain:a}}function cs(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function ls(e){return e.split(/[\?#]/,1)[0]}var us=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function ds(e){return e===`warn`?`warning`:us.includes(e)?e:`log`}var fs=1e3;function ps(){return Date.now()/fs}function ms(){let{performance:e}=qi;if(!e||!e.now)return ps;let t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/fs}var hs=ms(),gs=(()=>{let{performance:e}=qi;if(!e||!e.now)return;let t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,a=i<t,o=e.timing&&e.timing.navigationStart,s=typeof o==`number`?Math.abs(o+n-r):t;return a||s<t?i<=s?e.timeOrigin:o:r})(),_s=`baggage`,vs=`sentry-`,ys=/^sentry-/;function bs(e){if(!wi(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((e,t)=>{let n=Ss(t);for(let t of Object.keys(n))e[t]=n[t];return e},{});else{if(!e)return;t=Ss(e)}let n=Object.entries(t).reduce((e,[t,n])=>{if(t.match(ys)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function xs(e){if(e)return Cs(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${vs}${t}`]=n),e),{}))}function Ss(e){return e.split(`,`).map(e=>e.split(`=`).map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(e[t]=n,e),{})}function Cs(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(ra&&W.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var ws=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function Ts(e){if(!e)return;let t=e.match(ws);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Es(e,t){let n=Ts(e),r=bs(t),{traceId:i,parentSpanId:a,parentSampled:o}=n||{};return n?{traceparentData:n,dynamicSamplingContext:r||{},propagationContext:{traceId:i||Wa(),parentSpanId:a||Wa().substring(16),spanId:Wa().substring(16),sampled:o,dsc:r||{}}}:{traceparentData:n,dynamicSamplingContext:void 0,propagationContext:{traceId:i||Wa(),spanId:Wa().substring(16)}}}function Ds(e,t){let n=Ts(e),r=bs(t),{traceId:i,parentSpanId:a,parentSampled:o}=n||{};return n?{traceId:i||Wa(),parentSpanId:a||Wa().substring(16),spanId:Wa().substring(16),sampled:o,dsc:r||{}}:{traceId:i||Wa(),spanId:Wa().substring(16)}}function Os(e=Wa(),t=Wa().substring(16),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function ks(e,t=[]){return[e,t]}function As(e,t){let[n,r]=e;return[n,[...r,t]]}function js(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function Ms(e,t){return js(e,(e,n)=>t.includes(n))}function Ns(e,t){return(t||new TextEncoder).encode(e)}function Ps(e,t){let[n,r]=e,i=JSON.stringify(n);function a(e){typeof i==`string`?i=typeof e==`string`?i+e:[Ns(i,t),e]:i.push(typeof e==`string`?Ns(e,t):e)}for(let e of r){let[t,n]=e;if(a(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)a(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(Uo(n))}a(e)}}return typeof i==`string`?i:Fs(i)}function Fs(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Is(e,t,n){let r=typeof e==`string`?t.encode(e):e;function i(e){let t=r.subarray(0,e);return r=r.subarray(e+1),t}function a(){let e=r.indexOf(10);return e<0&&(e=r.length),JSON.parse(n.decode(i(e)))}let o=a(),s=[];for(;r.length;){let e=a(),t=typeof e.length==`number`?e.length:void 0;s.push([e,t?i(t):a()])}return[o,s]}function Ls(e,t){let n=typeof e.data==`string`?Ns(e.data,t):e.data;return[Ea({type:`attachment`,length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}var Rs={session:`session`,sessions:`session`,attachment:`attachment`,transaction:`transaction`,event:`error`,client_report:`internal`,user_report:`default`,profile:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,feedback:`feedback`,span:`span`,statsd:`metric_bucket`};function zs(e){return Rs[e]}function Bs(e){if(!e||!e.sdk)return;
35let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Vs(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:da(r)},...i&&{trace:Ea({...i})}}}function Hs(e,t,n){let r=[{type:`client_report`},{timestamp:n||ps(),discarded_events:e}];return ks(t?{dsn:t}:{},[r])}var Us=6e4;function Ws(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?Us:r-t}function Gs(e,t){return e[t]||e.all||0}function Ks(e,t,n=Date.now()){return Gs(e,t)>n}function qs(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},a=n&&n[`x-sentry-rate-limits`],o=n&&n[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+Ws(o,r):t===429&&(i.all=r+6e4);return i}function Js(e,t){return e(t.stack||``,1)}function Ys(e,t){let n={type:t.name||t.constructor.name,value:t.message},r=Js(e,t);return r.length&&(n.stacktrace={frames:r}),n}function Xs(e,t){return e??t()}function Zs(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var K=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Qs=`production`;function $s(){return Yi(`globalEventProcessors`,()=>[])}function ec(e){$s().push(e)}function tc(e,t,n,r=0){return new os((i,a)=>{let o=e[r];if(t===null||typeof o!=`function`)i(t);else{let s=o({...t},n);K&&o.id&&s===null&&W.log(`Event processor "${o.id}" dropped event`),ji(s)?s.then(t=>tc(e,t,n,r+1).then(i)).then(null,a):tc(e,s,n,r+1).then(i).then(null,a)}})}function nc(e){let t=hs(),n={sid:Wa(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>ac(n)};return e&&rc(n,e),n}function rc(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||hs(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Wa()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ic(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),rc(e,n)}function ac(e){return Ea({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}function oc(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,tags:s,origin:c}=uc(e);return Ea({data:r,op:i,parent_span_id:a,span_id:t,status:o,tags:s,trace_id:n,origin:c})}function sc(e){let{traceId:t,spanId:n}=e.spanContext();return Os(t,n,fc(e))}function cc(e){return typeof e==`number`?lc(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?lc(e.getTime()):hs()}function lc(e){return e>9999999999?e/1e3:e}function uc(e){return dc(e)?e.getSpanJSON():typeof e.toJSON==`function`?e.toJSON():{}}function dc(e){return typeof e.getSpanJSON==`function`}function fc(e){let{traceFlags:t}=e.spanContext();return!!(t&1)}function pc(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Wa(),timestamp:t.timestamp||ps()},l=n.integrations||e.integrations.map(e=>e.name);mc(c,e),vc(c,l),t.type===void 0&&gc(c,e.stackParser);let u=bc(r,n.captureContext);n.mechanism&&Ja(c,n.mechanism);let d=i&&i.getEventProcessors?i.getEventProcessors():[],f=ll().getScopeData();
35a&&$c(f,a.getScopeData()),u&&$c(f,u.getScopeData());let p=[...n.attachments||[],...f.attachments];return p.length&&(n.attachments=p),Qc(c,f),tc([...d,...$s(),...f.eventProcessors],c,n).then(e=>(e&&_c(e),typeof o==`number`&&o>0?yc(e,o,s):e))}function mc(e,t){let{environment:n,release:r,dist:i,maxValueLength:a=250}=t;`environment`in e||(e.environment=`environment`in t?n:Qs),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&=Ii(e.message,a);let o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=Ii(o.value,a));let s=e.request;s&&s.url&&(s.url=Ii(s.url,a))}var hc=new WeakMap;function gc(e,t){let n=qi._sentryDebugIds;if(!n)return;let r,i=hc.get(t);i?r=i:(r=new Map,hc.set(t,r));let a=Object.keys(n).reduce((e,i)=>{let a,o=r.get(i);o?a=o:(a=t(i),r.set(i,a));for(let t=a.length-1;t>=0;t--){let r=a[t];if(r.filename){e[r.filename]=n[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=a[e.filename])})})}catch{}}function _c(e){let t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.keys(t).forEach(e=>{n.push({type:`sourcemap`,code_file:e,debug_id:t[e]})})}function vc(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function yc(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Uo(e.data,t,n)}}))},...e.user&&{user:Uo(e.user,t,n)},...e.contexts&&{contexts:Uo(e.contexts,t,n)},...e.extra&&{extra:Uo(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Uo(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>{let r=uc(e).data;return r&&(e.data=Uo(r,t,n)),e})),r}function bc(e,t){if(!t)return e;let n=e?e.clone():new cl;return n.update(t),n}function xc(e){if(e)return Sc(e)||wc(e)?{captureContext:e}:e}function Sc(e){return e instanceof cl||typeof e==`function`}var Cc=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`requestSession`,`propagationContext`];function wc(e){return Object.keys(e).some(e=>Cc.includes(e))}function Tc(e,t){return _l().captureException(e,xc(t))}function Ec(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return _l().captureMessage(e,n,r)}function Dc(e,t){return _l().captureEvent(e,t)}function Oc(e){_l().configureScope(e)}function kc(e,t){_l().addBreadcrumb(e,t)}function Ac(e,t){_l().setContext(e,t)}function jc(e){_l().setExtras(e)}function Mc(e,t){_l().setExtra(e,t)}function Nc(e){_l().setTags(e)}function Pc(e,t){_l().setTag(e,t)}function Fc(e){_l().setUser(e)}function Ic(...e){let t=_l();if(e.length===2){let[n,r]=e;return n?t.withScope(()=>(t.getStackTop().scope=n,r(n))):t.withScope(r)}return t.withScope(e[0])}function Lc(e){return bl(()=>e(vl()))}function Rc(e,t){return Ic(n=>(n.setSpan(e),t(n)))}function zc(e,t){return _l().startTransaction({...e},t)}async function Bc(e){let t=q();return t?t.flush(e):(K&&W.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}async function Vc(e){let t=q();return t?t.close(e):(K&&W.warn(`Cannot flush events and disable SDK. No client defined.`),Promise.resolve(!1))}function Hc(){return _l().lastEventId()}function q(){return _l().getClient()}function Uc(){return!!q()}function Wc(){return _l().getScope()}function Gc(e){let t=q(),n=vl(),r=Wc(),{release:i,environment:a=Qs}=t&&t.getOptions()||{},{userAgent:o}=qi.navigator||{},s=nc({release:i,environment:a,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession();return c&&c.status===`ok`&&rc(c,{status:`exited`}),Kc(),n.setSession(s),r.setSession(s),s}function Kc(){let e=vl(),t=Wc(),n=t.getSession()||e.getSession();n&&ic(n),qc(),e.setSession(),t.setSession()}function qc(){let e=vl(),t=Wc(),n=q(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}
vendor: 12,706 bytes, lines 35-38
35function Jc(e=!1){if(e){Kc();return}qc()}function Yc(e){return e.transaction}function Xc(e,t,n){let r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:a}=n&&n.getUser()||{},o=Ea({environment:r.environment||`production`,release:r.release,user_segment:a,public_key:i,trace_id:e});return t.emit&&t.emit(`createDsc`,o),o}function Zc(e){let t=q();if(!t)return{};let n=Xc(uc(e).trace_id||``,t,Wc()),r=Yc(e);if(!r)return n;let i=r&&r._frozenDynamicSamplingContext;if(i)return i;let{sampleRate:a,source:o}=r.metadata;a!=null&&(n.sample_rate=`${a}`);let s=uc(r);return o&&o!==`url`&&(n.transaction=s.description),n.sampled=String(fc(r)),t.emit&&t.emit(`createDsc`,n),n}function Qc(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;tl(e,t),r&&il(e,r),al(e,n),nl(e,i),rl(e,a)}function $c(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:f,transactionName:p,span:m}=t;el(e,`extra`,n),el(e,`tags`,r),el(e,`user`,i),el(e,`contexts`,a),el(e,`sdkProcessingMetadata`,s),o&&(e.level=o),p&&(e.transactionName=p),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...f}}function el(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}function tl(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t,c=Ea(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});let l=Ea(r);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});let u=Ea(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});let d=Ea(a);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),o&&(e.level=o),s&&(e.transaction=s)}function nl(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function rl(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function il(e,t){e.contexts={trace:oc(t),...e.contexts};let n=Yc(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:Zc(t),...e.sdkProcessingMetadata};let r=uc(n).description;r&&(e.tags={transaction:r,...e.tags})}}function al(e,t){e.fingerprint=e.fingerprint?Za(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}var ol=100,sl,cl=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ul()}static clone(t){return t?t.clone():new e}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},t._user=this._user,t._level=this._level,t._span=this._span,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&rc(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t;if(n instanceof e){let e=n.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(Di(n)){let e=t;this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=ul(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:ol;if(n<=0)return this;let r={timestamp:ps(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){let{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:a,_level:o,_fingerprint:s,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:u,_transactionName:d,_span:f}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:a,level:o,fingerprint:s||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:u,transactionName:d,span:f}}applyToEvent(e,t={},n=[]){return Qc(e,this.getScopeData()),tc([...n,...$s(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t&&t.event_id?t.event_id:Wa();if(!this._client)return W.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n&&n.event_id?n.event_id:Wa();if(!this._client)return W.warn(`No client configured on scope - will not capture message!`),r;let i=Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:Wa();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(W.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function ll(){return sl||=new cl,sl}function ul(){return{traceId:Wa(),spanId:Wa().substring(16)}}var dl=`7.120.4`,fl=parseFloat(dl),pl=100,ml=class{constructor(e,t,n,r=fl){this._version=r;let i;t?i=t:(i=new cl,i.setClient(e));let a;n?a=n:(a=new cl,a.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=a}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let t=this.pushScope(),n;try{n=e(t)}catch(e){throw this.popScope(),e}return ji(n)?n.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let n=this._lastEventId=t&&t.event_id?t.event_id:Wa(),r=Error(`Sentry syntheticException`);return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){let r=this._lastEventId=n&&n.event_id?n.event_id:Wa(),i=Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:Wa();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:n,client:r}=this.getStackTop();if(!r)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=pl}=r.getOptions&&r.getOptions()||{};if(a<=0)return;let o={timestamp:ps(),...e},s=i?sa(()=>i(o,t)):o;s!==null&&(r.emit&&r.emit(`beforeAddBreadcrumb`,s,t),n.addBreadcrumb(s,a))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){let{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){let t=gl(this);try{e(this)}finally{gl(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return K&&W.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let n=this._callExtensionMethod(`startTransaction`,e,t);return K&&!n&&(this.getClient()?W.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
36Sentry.addTracingExtensions();
37Sentry.init({...});
38`):W.warn(`Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'`)),n}traceHeaders(){return this._callExtensionMethod(`traceHeaders`)}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();t&&ic(t),this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Qs}=n&&n.getOptions()||{},{userAgent:a}=qi.navigator||{},o=nc({release:r,environment:i,user:t.getUser(),...a&&{userAgent:a},...e}),s=t.getSession&&t.getSession();return s&&s.status===`ok`&&rc(s,{status:`exited`}),this.endSession(),t.setSession(o),o}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){let n=hl().__SENTRY__;if(n&&n.extensions&&typeof n.extensions[e]==`function`)return n.extensions[e].apply(this,t);K&&W.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function hl(){return qi.__SENTRY__=qi.__SENTRY__||{extensions:{},hub:void 0},qi}function gl(e){let t=hl(),n=Sl(t);return Cl(t,e),n}function _l(){let e=hl();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return yl(e)}function vl(){return _l().getIsolationScope()}function yl(e=hl()){return(!xl(e)||Sl(e).isOlderThan(fl))&&Cl(e,new ml),Sl(e)}
38function bl(e,t={}){let n=hl();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(e,t):e()}function xl(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Sl(e){return Yi(`hub`,()=>new ml,e)}function Cl(e,t){if(!e)return!1;let n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}function wl(e){return(e||_l()).getScope().getTransaction()}var Tl=Ts,El=!1;function Dl(){El||(El=!0,So(Ol),To(Ol))}function Ol(){let e=wl();if(e){let t=`internal_error`;K&&W.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}Ol.tag=`sentry_tracingErrorCallback`;var kl;(function(e){e.Ok=`ok`,e.DeadlineExceeded=`deadline_exceeded`,e.Unauthenticated=`unauthenticated`,e.PermissionDenied=`permission_denied`,e.NotFound=`not_found`,e.ResourceExhausted=`resource_exhausted`,e.InvalidArgument=`invalid_argument`,e.Unimplemented=`unimplemented`,e.Unavailable=`unavailable`,e.InternalError=`internal_error`,e.UnknownError=`unknown_error`,e.Cancelled=`cancelled`,e.AlreadyExists=`already_exists`,e.FailedPrecondition=`failed_precondition`,e.Aborted=`aborted`,e.OutOfRange=`out_of_range`,e.DataLoss=`data_loss`})(kl||={});function Al(e){if(e<400&&e>=100)return`ok`;if(e>=400&&e<500)switch(e){case 401:return`unauthenticated`;case 403:return`permission_denied`;case 404:return`not_found`;case 409:return`already_exists`;case 413:return`failed_precondition`;case 429:return`resource_exhausted`;default:return`invalid_argument`}if(e>=500&&e<600)switch(e){case 501:return`unimplemented`;case 503:return`unavailable`;case 504:return`deadline_exceeded`;default:return`internal_error`}return`unknown_error`}var jl=Al;function Ml(e,t){e.setTag(`http.status_code`,String(t)),e.setData(`http.response.status_code`,t);let n=Al(t);n!==`unknown_error`&&e.setStatus(n)}function Nl(e,t,n=()=>{}){let r;try{r=e()}catch(e){throw t(e),n(),e}return Pl(r,t,n)}function Pl(e,t,n){return ji(e)?e.then(e=>(n(),e),e=>{throw t(e),n(),e}):(n(),e)}function Fl(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=q(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||`tracesSampleRate`in n||`tracesSampler`in n)}function Il(e,t,n=()=>{},r=()=>{}){let i=_l(),a=Wc(),o=a.getSpan(),s=Hl(i,{parentSpan:o,spanContext:Ul(e),forceTransaction:!1,scope:a});return a.setSpan(s),Nl(()=>t(s),e=>{s&&s.setStatus(`internal_error`),n(e,s)},()=>{s&&s.end(),a.setSpan(o),r()})}function Ll(e,t){let n=Ul(e);return bl(()=>Ic(e.scope,r=>{let i=_l(),a=r.getSpan(),o=e.onlyIfParent&&!a?void 0:Hl(i,{parentSpan:a,spanContext:n,forceTransaction:e.forceTransaction,scope:r});return Nl(()=>t(o),()=>{if(o){let{status:e}=uc(o);(!e||e===`ok`)&&o.setStatus(`internal_error`)}},()=>o&&o.end())}))}function Rl(e,t){let n=Ul(e);return bl(()=>Ic(e.scope,r=>{let i=_l(),a=r.getSpan(),o=e.onlyIfParent&&!a?void 0:Hl(i,{parentSpan:a,spanContext:n,forceTransaction:e.forceTransaction,scope:r});function s(){o&&o.end()}return Nl(()=>t(o,s),()=>{if(o&&o.isRecording()){let{status:e}=uc(o);(!e||e===`ok`)&&o.setStatus(`internal_error`)}})}))}function zl(e){if(!Fl())return;let t=Ul(e),n=_l(),r=e.scope?e.scope.getSpan():Bl();if(e.onlyIfParent&&!r)return;let i=(e.scope||Wc()).clone();return Hl(n,{parentSpan:r,spanContext:t,forceTransaction:e.forceTransaction,scope:i})}function Bl(){return Wc().getSpan()}var Vl=({sentryTrace:e,baggage:t},n)=>{let r=Wc(),{traceparentData:i,dynamicSamplingContext:a,propagationContext:o}=Es(e,t);r.setPropagationContext(o),K&&i&&W.log(`[Tracing] Continuing trace ${i.traceId}.`);let s={...i,metadata:Ea({dynamicSamplingContext:a})};return n?bl(()=>n(s)):s};function Hl(e,{parentSpan:t,spanContext:n,forceTransaction:r,scope:i}){if(!Fl())return;let a=vl(),o;if(t&&!r)o=t.startChild(n);else if(t){let r=Zc(t),{traceId:i,spanId:a}=t.spanContext(),s=fc(t);o=e.startTransaction({traceId:i,parentSpanId:a,parentSampled:s,...n,metadata:{dynamicSamplingContext:r,...n.metadata}})}else{let{traceId:t,dsc:r,parentSpanId:s,sampled:c}={...a.getPropagationContext(),...i.getPropagationContext()};o=e.startTransaction({traceId:t,parentSpanId:s,parentSampled:c,...n,metadata:{dynamicSamplingContext:r,...n.metadata}})}return i.setSpan(o),Kl(o,i,a),o}function Ul(e){if(e.startTime){let t={...e};return t.startTimestamp=cc(e.startTime),delete t.startTime,t}return e}var Wl=`_sentryScope`,Gl=`_sentryIsolationScope`;function Kl(e,t,n){e&&(va(e,Gl,n),va(e,Wl,t))}function ql(e){return{scope:e[Wl],isolationScope:e[Gl]}}var Jl;function Yl(e){return Jl?Jl.get(e):void 0}function Xl(e){let t=Yl(e);
38if(!t)return;let n={};for(let[,[e,r]]of t)n[e]||(n[e]=[]),n[e].push(Ea(r));return n}function Zl(e,t,n,r,i,a){let o=Bl();if(o){let s=Yl(o)||new Map,c=`${e}:${t}@${r}`,l=s.get(a);if(l){let[,e]=l;s.set(a,[c,{min:Math.min(e.min,n),max:Math.max(e.max,n),count:e.count+=1,sum:e.sum+=n,tags:e.tags}])}else s.set(a,[c,{min:n,max:n,count:1,sum:n,tags:i}]);Jl||=new WeakMap,Jl.set(o,s)}}var Ql=`sentry.source`,$l=`sentry.sample_rate`,eu=`sentry.op`,tu=`sentry.origin`,nu=`profile_id`,ru=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},iu=class e{constructor(e={}){this._traceId=e.traceId||Wa(),this._spanId=e.spanId||Wa().substring(16),this._startTime=e.startTimestamp||hs(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||`sentry`,this._attributes={},this.setAttributes({[tu]:e.origin||`manual`,[eu]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||``}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[eu]}set op(e){this.setAttribute(eu,e)}get origin(){return this._attributes[tu]}set origin(e){this.setAttribute(tu,e)}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}startChild(t){let n=new e({...t,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);let r=Yc(this);if(n.transaction=r,K&&r){let e=`[Tracing] Starting '${t&&t.op||`< unknown op >`}' span on transaction '${uc(n).description||`< unknown name >`}' (${r.spanContext().spanId}).`;W.log(e),this._logMessage=e}return n}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setAttribute(e,t){t===void 0?delete this._attributes[e]:this._attributes[e]=t}setAttributes(e){Object.keys(e).forEach(t=>this.setAttribute(t,e[t]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return Ml(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status===`ok`}finish(e){return this.end(e)}end(e){if(this._endTime)return;let t=Yc(this);if(K&&t&&t.spanContext().spanId!==this._spanId){let e=this._logMessage;e&&W.log(e.replace(`Starting`,`Finishing`))}this._endTime=cc(e)}toTraceparent(){return sc(this)}toContext(){return Ea({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return oc(this)}getSpanJSON(){return Ea({data:this._getData(),description:this._name,op:this._attributes[eu],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[tu],_metrics_summary:Xl(this),profile_id:this._attributes[nu],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}
38toJSON(){return this.getSpanJSON()}_getData(){let{data:e,_attributes:t}=this,n=Object.keys(e).length>0,r=Object.keys(t).length>0;if(!(!n&&!r))return n&&r?{...e,...t}:n?e:t}},au=class extends iu{constructor(e,t){super(e),this._contexts={},this._hub=t||_l(),this._name=e.name||``,this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;let n=this._metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:`custom`,spanMetadata:{},...this._metadata,...this._attributes[`sentry.source`]&&{source:this._attributes[`sentry.source`]},...this._attributes[`sentry.sample_rate`]&&{sampleRate:this._attributes[`sentry.sample_rate`]}}}set metadata(e){this._metadata=e}setName(e,t=`custom`){this._name=e,this.setAttribute(Ql,t)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||=new ru(e),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,n=``){this._measurements[e]={value:t,unit:n}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){let t=cc(e),n=this._finishTransaction(t);if(n)return this._hub.captureEvent(n)}toContext(){return Ea({...super.toContext(),name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||``,this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return Zc(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||=(K&&W.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`),super.end(e);let t=this._hub.getClient();if(t&&t.emit&&t.emit(`finishTransaction`,this),this._sampled!==!0){K&&W.log(`[Tracing] Discarding transaction because its trace was not chosen to be sampled.`),t&&t.recordDroppedEvent(`sample_rate`,`transaction`);return}let n=this.spanRecorder?this.spanRecorder.spans.filter(e=>e!==this&&uc(e).timestamp):[];if(this._trimEnd&&n.length>0){let e=n.map(e=>uc(e).timestamp).filter(Boolean);this._endTime=e.reduce((e,t)=>e>t?e:t)}let{scope:r,isolationScope:i}=ql(this),{metadata:a}=this,{source:o}=a,s={contexts:{...this._contexts,trace:oc(this)},spans:n,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{...a,capturedSpanScope:r,capturedSpanIsolationScope:i,...Ea({dynamicSamplingContext:Zc(this)})},_metrics_summary:Xl(this),...o&&{transaction_info:{source:o}}};return Object.keys(this._measurements).length>0&&(K&&W.log(`[Measurements] Adding measurements to transaction`,JSON.stringify(this._measurements,void 0,2)),s.measurements=this._measurements),K&&W.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),s}},ou={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},su=`finishReason`,cu=[`heartbeatFailed`,`idleTimeout`,`documentHidden`,`finalTimeout`,`externalFinish`,`cancelled`],lu=class extends ru{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){if(e.spanContext().spanId!==this.transactionSpanId){let t=e.end;e.end=(...n)=>(this._popActivity(e.spanContext().spanId),t.apply(e,n)),uc(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}},uu=class extends au{constructor(e,t,n=ou.idleTimeout,r=ou.finalTimeout,i=ou.heartbeatInterval,a=!1,o=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=i,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=cu[4],this._autoFinishAllowed=!o,a&&(K&&W.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),t.getScope().setSpan(this)),o||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus(`deadline_exceeded`),this._finishReason=cu[3],this.end())},this._finalTimeout)}end(e){let t=cc(e);if(this._finished=!0,this.activities={},this.op===`ui.action.click`&&this.setAttribute(su,this._finishReason),this.spanRecorder){K&&W.log(`[Tracing] finishing IdleTransaction`,new Date(t*1e3).toISOString(),this.op);for(let e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter(e=>{if(e.spanContext().spanId===this.spanContext().spanId)return!0;uc(e).timestamp||(e.setStatus(`cancelled`),e.end(t),K&&W.log(`[Tracing] cancelling span since transaction ended early`,JSON.stringify(e,void 0,2)));let{start_timestamp:n,timestamp:r}=uc(e),i=n&&n<t,a=(this._finalTimeout+this._idleTimeout)/1e3,o=r&&n&&r-n<a;if(K){let t=JSON.stringify(e,void 0,2);i?o||W.log(`[Tracing] discarding Span since it finished after Transaction final timeout`,t):W.log(`[Tracing] discarding Span since it happened after Transaction was finished`,t)}return i&&o}),K&&W.log(`[Tracing] flushing IdleTransaction`)}else K&&W.log(`[Tracing] No active IdleTransaction`);if(this._onScope){let e=this._idleHub.getScope();e.getTransaction()===this&&e.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let t=e=>{this._finished||this._pushActivity(e)},n=e=>{this._finished||this._popActivity(e)};this.spanRecorder=new lu(t,n,this.spanContext().spanId,e),K&&W.log(`Starting heartbeat`),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=t===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=cu[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||=(K&&W.log(`[Tracing] Received finish signal for idle transaction.`),this._restartIdleTimeout(),!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=cu[1],this.end(e))},this._idleTimeout)}
38_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),K&&W.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,K&&W.log(`[Tracing] new activities count`,Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(K&&W.log(`[Tracing] popActivity ${e}`),delete this.activities[e],K&&W.log(`[Tracing] new activities count`,Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let e=hs();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=cu[5],this.end(e)):this._restartIdleTimeout(e+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join(``);e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(K&&W.log(`[Tracing] Transaction finished because of no change for 3 heart beats`),this.setStatus(`deadline_exceeded`),this._finishReason=cu[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){K&&W.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function du(e,t,n){if(!Fl(t))return e.sampled=!1,e;if(e.sampled!==void 0)return e.setAttribute($l,Number(e.sampled)),e;let r;return typeof t.tracesSampler==`function`?(r=t.tracesSampler(n),e.setAttribute($l,Number(r))):n.parentSampled===void 0?t.tracesSampleRate===void 0?(r=1,e.setAttribute($l,r)):(r=t.tracesSampleRate,e.setAttribute($l,Number(r))):r=n.parentSampled,fu(r)?r?(e.sampled=Math.random()<r,e.sampled?(K&&W.log(`[Tracing] starting ${e.op} transaction - ${uc(e).description}`),e):(K&&W.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),e)):(K&&W.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),e.sampled=!1,e):(K&&W.warn(`[Tracing] Discarding transaction because of invalid sample rate.`),e.sampled=!1,e)}function fu(e){return Ni(e)||typeof e!=`number`&&typeof e!=`boolean`?(K&&W.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e<0||e>1?(K&&W.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function pu(){let e=this.getScope().getSpan();return e?{"sentry-trace":sc(e)}:{}}function mu(e,t){let n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||`sentry`,a=e.instrumenter||`sentry`;i!==a&&(K&&W.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${i}\` instrumenter.
39The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),e.sampled=!1);let o=new au(e,this);return o=du(o,r,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...t}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit(`startTransaction`,o),o}function hu(e,t,n,r,i,a,o,s=!1){let c=e.getClient(),l=c&&c.getOptions()||{},u=new uu(t,e,n,r,o,i,s);return u=du(u,l,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...a}),u.isRecording()&&u.initSpanRecorder(l._experiments&&l._experiments.maxSpans),c&&c.emit&&c.emit(`startTransaction`,u),u}function gu(){let e=hl();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=mu),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=pu),Dl())}function _u(e,t,n){let r=wl();r&&r.setMeasurement(e,t,n)}function vu(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]],e):e}function yu(e,t,n,r){let i=Bs(n);return ks({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:da(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function bu(e,t,n,r){let i=Bs(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;vu(e,n&&n.sdk);let o=Vs(e,i,r,t);return delete e.sdkProcessingMetadata,ks(o,[[{type:a},e]])}var xu=`7`;function Su(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Cu(e){return`${Su(e)}${e.projectId}/envelope/`}function wu(e,t){return xa({sentry_key:e.publicKey,sentry_version:xu,...t&&{sentry_client:`${t.name}/${t.version}`}})}function Tu(e,t={}){let n=typeof t==`string`?t:t.tunnel,r=typeof t==`string`||!t._metadata?void 0:t._metadata.sdk;return n||`${Cu(e)}?${wu(e,r)}`}function Eu(e,t){let n=ha(e);if(!n)return``;let r=`${Su(n)}embed/error-page/`,i=`dsn=${da(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`)if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}
39`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${i}`}var Du=[];function Ou(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.keys(t).map(e=>t[e])}function ku(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;r=Array.isArray(n)?[...t,...n]:typeof n==`function`?Za(n(t)):t;let i=Ou(r),a=Pu(i,e=>e.name===`Debug`);if(a!==-1){let[e]=i.splice(a,1);i.push(e)}return i}function Au(e,t){let n={};return t.forEach(t=>{t&&Mu(e,t,n)}),n}function ju(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Mu(e,t,n){if(n[t.name]){K&&W.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,Du.indexOf(t.name)===-1&&(t.setupOnce(ec,_l),Du.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),e.on&&typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(e.addEventProcessor&&typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=(t,r)=>n(t,r,e);r.id=t.name,e.addEventProcessor(r)}K&&W.log(`Integration installed: ${t.name}`)}function Nu(e){let t=q();if(!t||!t.addIntegration){K&&W.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Pu(e,t){for(let n=0;n<e.length;n++)if(t(e[n])===!0)return n;return-1}function Fu(e,t){let n=function(...e){return t(...e)};return n.id=e,n}function J(e){return e}function Iu(e,t,n,r){return`${e}${t}${n}${Object.entries(Ea(r)).sort((e,t)=>e[0].localeCompare(t[0]))}`}function Lu(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return t>>>0}function Ru(e){let t=``;for(let n of e){let e=Object.entries(n.tags),r=e.length>0?`|#${e.map(([e,t])=>`${e}:${t}`).join(`,`)}`:``;t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}function zu(e){return e.replace(/[^\w]+/gi,`_`)}function Bu(e){return e.replace(/[^\w\-.]+/gi,`_`)}function Vu(e){return e.replace(/[^\w\-./]+/gi,``)}var Hu=[[`
40`,`\\n`],[`\r`,`\\r`],[`	`,`\\t`],[`\\`,`\\\\`],[`|`,`\\u{7c}`],[`,`,`\\u{2c}`]];function Uu(e){for(let[t,n]of Hu)if(e===t)return n;return e}function Wu(e){return[...e].reduce((e,t)=>e+Uu(t),``)}function Gu(e){let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=Vu(n);t[r]=Wu(String(e[n]))}return t}function Ku(e,t,n,r){let i={sent_at:new Date().toISOString()};return n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(i.dsn=da(t)),ks(i,[qu(e)])}function qu(e){let t=Ru(e);return[{type:`statsd`,length:t.length},t]}var Ju=`Not capturing exception because it's already been captured.`,Yu=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ha(e.dsn):K&&W.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Tu(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(Xa(e)){K&&W.log(Ju);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id,a=Ti(e)?e:String(e),o=Ei(e)?this.eventFromMessage(a,t,n):this.eventFromException(e,n);return this._process(o.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&Xa(t.originalException)){K&&W.log(Ju);return}let r=t&&t.event_id,i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||n).then(e=>{r=e})),r}captureSession(e){typeof e.release==`string`?(this.sendSession(e),rc(e,{init:!1})):K&&W.warn(`Discarded session because of missing or non-string release`)}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isCl
vendor: 4,765 bytes, line 40
40ientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):is(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return K&&W.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){let t=this._integrations[e.name];Mu(this,e,this._integrations),t||ju(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=bu(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=As(n,Ls(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));let r=this._sendEnvelope(n);r&&r.then(t=>this.emit(`afterSendEvent`,e,t),null)}sendSession(e){let t=yu(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let r=typeof n==`number`?n:1,i=`${e}:${t}`;K&&W.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:``}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}captureAggregateMetrics(e){K&&W.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);let t=Ku(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Au(this,e),ju(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i){r=!0;for(let e of i){let t=e.mechanism;if(t&&t.handled===!1){n=!0;break}}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(rc(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new os(t=>{let n=0,r=setInterval(()=>{this._numProcessing==0?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r=vl()){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a.length>0&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),pc(i,e,t,n,this,r).then(e=>{if(e===null)return e;let t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){let{traceId:r,spanId:i,parentSpanId:a,dsc:o}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:a},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:o||Xc(r,this,n),...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if(K){let t=e;t.logLevel===`log`?W.log(t.message):W.warn(t)}})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r,a=$u(e),o=Qu(e),s=e.type||`error`,c=`before send for type \`${s}\``;if(o&&typeof i==`number`&&Math.random()>i)return this.recordDroppedEvent(`sample_rate`,`error`,e),as(new ga(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,`log`));let l=s===`replay_event`?`replay`:s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then(n=>{if(n===null)throw this.recordDroppedEvent(`event_processor`,l,e),new ga("An event processor returned `null`, will not send event.",`log`);return t.data&&t.data.__sentry__===!0?n:Xu(Zu(r,n,t),c)}).then(r=>{if(r===null){if(this.recordDroppedEvent(`before_send`,l,e),a){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw new ga(`${c} returned \`null\`, will not send event.`,`log`)}let i=n&&n.getSession();if(!a&&i&&this._updateSessionFromEvent(i,r),a){let e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let o=r.transaction_info;return a&&o&&r.transaction!==e.transaction&&(r.transaction_info={...o,source:`custom`}),this.sendEvent(r,t),r}).then(null,e=>{throw e instanceof ga?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new ga(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}
40_sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,e=>{K&&W.error(`Error while sending event:`,e)});K&&W.error(`Transport disabled`)}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[n,r]=t.split(`:`);return{reason:n,category:r,quantity:e[t]}})}};function Xu(e,t){let n=`${t} must return \`null\` or a valid event.`;if(ji(e))return e.then(e=>{if(!Di(e)&&e!==null)throw new ga(n);return e},e=>{throw new ga(`${t} rejected with ${e}`)});if(!Di(e)&&e!==null)throw new ga(n);return e}function Zu(e,t,n){let{beforeSend:r,beforeSendTransaction:i}=e;if(Qu(t)&&r)return r(t,n);if($u(t)&&i){if(t.spans){let e=t.spans.length;t.sdkProcessingMetadata={...t.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(t,n)}return t}function Qu(e){return e.type===void 0}function $u(e){return e.type===`transaction`}function ed(e){let t=q();!t||!t.addEventProcessor||t.addEventProcessor(e)}var td=5e3,nd={c:class{constructor(e){this._value=e}get weight(){return 1}add(e){this._value+=e}toString(){return`${this._value}`}},g:class{constructor(e){this._last=e,this._min=e,this._max=e,this._sum=e,this._count=1}get weight(){return 5}add(e){this._last=e,e<this._min&&(this._min=e),e>this._max&&(this._max=e),this._sum+=e,this._count++}toString(){return`${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`}},d:class{constructor(e){this._value=[e]}get weight(){return this._value.length}add(e){this._value.push(e)}toString(){return this._value.join(`:`)}},s:class{constructor(e){this.first=e,this._value=new Set([e])}get weight(){return this._value.size}add(e){this._value.add(e)}toString(){return Array.from(this._value).map(e=>typeof e==`string`?Lu(e):e).join(`:`)}}};function rd(e,t){t.debug===!0&&(K?W.enable():sa(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Wc().update(t.initialScope);let n=new e(t);id(n),ad(n)}function id(e){let t=_l().getStackTop();t.client=e,t.scope.setClient(e)}function ad(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}function od(e,t,n=ss(e.bufferSize||30)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(js(i,(t,n)=>{let i=zs(n);if(Ks(r,i)){let r=sd(t,n);e.recordDroppedEvent(`ratelimit_backoff`,i,r)}else a.push(t)}),a.length===0)return is();let o=ks(i[0],a),s=t=>{js(o,(n,r)=>{let i=sd(n,r);e.recordDroppedEvent(t,zs(r),i)})};return n.add(()=>t({body:Ps(o,e.textEncoder)}).then(e=>(e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&K&&W.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=qs(r,e),e),e=>{throw s(`network_error`),e})).then(e=>e,e=>{if(e instanceof ga)return K&&W.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),is();throw e})}return a.__sentry__baseTransport__=!0,{send:a,flush:i}}function sd(e,t){if(t===`event`||t===`transaction`)return Array.isArray(e)?e[1]:void 0}var cd=5e3,ld=36e5;function ud(e,t){K&&W.info(`[Offline]: ${e}`,t)}function dd(e){return t=>{let n=e(t),r=t.createStore?t.createStore(t):void 0,i=cd,a;function o(e,n,r){return Ms(e,[`replay_event`,`replay_recording`,`client_report`])?!1:!t.shouldStore||t.shouldStore(e,n,r)}function s(e){r&&(a&&clearTimeout(a),a=setTimeout(async()=>{a=void 0;let e=await r.pop();e&&(ud(`Attempting to send previously queued event`),l(e).catch(e=>{ud(`Failed to retry sending`,e)}))},e),typeof a!=`number`&&a.unref&&a.unref())}function c(){a||(s(i),i=Math.min(i*2,ld))}async function l(e){try{let t=await n.send(e),r=100;if(t){if(t.headers&&t.headers[`retry-after`])r=Ws(t.headers[`retry-after`]);else if((t.statusCode||0)>=400)return t}return s(r),i=cd,t}catch(t){if(r&&await o(e,t,i))return await r.insert(e),c(),ud(`Error sending. Event queued`,t),{};throw t}}return t.flushAtStartup&&c(),{send:l,flush:e=>n.flush(e)}}}function fd(e,t){let n;return js(e,(e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n)),n}function pd(e,t){return n=>{let r=e(n);return{...r,send:async e=>{let n=fd(e,[`event`,`transaction`,`profile`,`replay_event`]);return n&&(n.release=t),r.send(e)}}}}function md(e,t){return ks(t?{...e[0],dsn:t}:e[0],e[1])}function hd(e,t){return n=>{let r=e(n),i=new Map;function a(t,r){let a=r?`${t}:${r}`:t,o=i.get(a);if(!o){let s=fa(t);if(!s)return;let c=Tu(s,n.tunnel);o=r?pd(e,r)({...n,url:c}):e({...n,url:c}),i.set(a,o)}return[t,o]}async function o(e){function n(t){return fd(e,t&&t.length?t:[`event`])}let i=t({envelope:e,getEvent:n}).map(e=>typeof e==`string`?a(e,void 0):a(e.dsn,e.release)).filter(e=>!!e);return i.length===0&&i.push([``,r]),(await Promise.all(i.map(([t,n])=>n.send(md(e,t)))))[0]}async function s(e){let t=[await r.flush(e)];for(let[,n]of i)t.push(await n.flush(e));return t.every(e=>e)}return{send:o,flush:s}}}function gd(e,t){let n={sent_at:new Date().toISOString()};return t&&(n.dsn=da(t)),ks(n,e.map(_d))}function _d(e){return[{type:`span`},e]}function vd(e,t){let n=t&&Sd(t)?t.getClient():t,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return bd(e,r)||yd(e,i)}function yd(e,t){return t?xd(e)===xd(t):!1}function bd(e,t){return t?e.includes(t.host):!1}function xd(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function Sd(e){return e.getClient!==void 0}function Cd(e,...t){let n=new String(String.raw(e,...t));
40return n.__sentry_template_string__=e.join(`\0`).replace(/%/g,`%%`).replace(/\0/g,`%s`),n.__sentry_template_values__=t,n}function wd(e,t,n=[t],r=`npm`){let i=e._metadata||{};i.sdk||={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:dl})),version:dl},e._metadata=i}var Td=new Map,Ed=new Set;function Dd(e){if(qi._sentryModuleMetadata)for(let t of Object.keys(qi._sentryModuleMetadata)){let n=qi._sentryModuleMetadata[t];if(Ed.has(t))continue;Ed.add(t);let r=e(t);for(let e of r.reverse())if(e.filename){Td.set(e.filename,n);break}}}function Od(e,t){return Dd(e),Td.get(t)}function kd(e,t){try{t.exception.values.forEach(t=>{if(t.stacktrace)for(let n of t.stacktrace.frames||[]){if(!n.filename)continue;let t=Od(e,n.filename);t&&(n.module_metadata=t)}})}catch{}}function Ad(e){try{e.exception.values.forEach(e=>{if(e.stacktrace)for(let t of e.stacktrace.frames||[])delete t.module_metadata})}catch{}}var jd=`ModuleMetadata`,Md=J((()=>({name:jd,setupOnce(){},setup(e){typeof e.on==`function`&&e.on(`beforeEnvelope`,e=>{js(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(Ad(t),e[1]=t)}})})},processEvent(e,t,n){let r=n.getOptions().stackParser;return kd(r,e),e}}))),Nd=Fu(jd,Md),Pd=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Fd=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Id=`InboundFilters`,Ld=J(((e={})=>({name:Id,setupOnce(){},processEvent(t,n,r){return Bd(t,zd(e,r.getOptions()))?null:t}}))),Rd=Fu(Id,Ld);function zd(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Pd],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Fd],ignoreInternal:e.ignoreInternal===void 0||e.ignoreInternal}}function Bd(e,t){return t.ignoreInternal&&Kd(e)?(K&&W.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ka(e)}`),!0):Vd(e,t.ignoreErrors)?(K&&W.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ka(e)}`),!0):Hd(e,t.ignoreTransactions)?(K&&W.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Ka(e)}`),!0):Ud(e,t.denyUrls)?(K&&W.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ka(e)}.\nUrl: ${Jd(e)}`),!0):!Wd(e,t.allowUrls)&&(K&&W.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ka(e)}.\nUrl: ${Jd(e)}`),!0)}function Vd(e,t){return e.type||!t||!t.length?!1:Gd(e).some(e=>Bi(e,t))}function Hd(e,t){if(e.type!==`transaction`||!t||!t.length)return!1;let n=e.transaction;return n?Bi(n,t):!1}function Ud(e,t){if(!t||!t.length)return!1;let n=Jd(e);return n?Bi(n,t):!1}function Wd(e,t){if(!t||!t.length)return!0;let n=Jd(e);return!n||Bi(n,t)}function Gd(e){let t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),K&&t.length===0&&W.error(`Could not extract message for event ${Ka(e)}`),t}function Kd(e){try{return e.exception.values[0].type===`SentryError`}catch{}return!1}function qd(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function Jd(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?qd(t):null}catch{return K&&W.error(`Cannot extract url for event ${Ka(e)}`),null}}var Yd,Xd=`FunctionToString`,Zd=new WeakMap,Qd=J((()=>({name:Xd,setupOnce(){Yd=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=ba(this),n=Zd.has(q())&&t!==void 0?t:this;return Yd.apply(n,e)}}catch{}},setup(e){Zd.set(e,!0)}}))),$d=Fu(Xd,Qd),ef=`cause`,tf=5,nf=`LinkedErrors`,rf=Fu(nf,J(((e={})=>{let t=e.limit||tf,n=e.key||ef;return{name:nf,setupOnce(){},preprocessEvent(e,r,i){let a=i.getOptions();Vi(Ys,a.stackParser,a.maxValueLength,n,t,e,r)}}}))),af=s({FunctionToString:()=>$d,InboundFilters:()=>Rd,LinkedErrors:()=>rf}),of=class{constructor(e){this._client=e,this._buckets=new Map,this._interval=setInterval(()=>this.flush(),td)}add(e,t,n,r=`none`,i={},a=hs()){let o=Math.floor(a),s=Bu(t),c=Gu(i),l=zu(r),u=Iu(e,s,l,c),d=this._buckets.get(u),f=d&&e===`s`?d.metric.weight:0;d?(d.metric.add(n),d.timestamp<o&&(d.timestamp=o)):(d={metric:new nd[e](n),timestamp:o,metricType:e,name:s,unit:l,tags:c}
40,this._buckets.set(u,d)),Zl(e,s,typeof n==`string`?d.metric.weight-f:n,l,i,u)}flush(){if(this._buckets.size!==0){if(this._client.captureAggregateMetrics){let e=Array.from(this._buckets).map(([,e])=>e);this._client.captureAggregateMetrics(e)}this._buckets.clear()}}close(){clearInterval(this._interval),this.flush()}},sf=`MetricsAggregator`,cf=J((()=>({name:sf,setupOnce(){},setup(e){e.metricsAggregator=new of(e)}}))),lf=Fu(sf,cf);function uf(e,t,n,r={}){let i=q(),a=Wc();if(i){if(!i.metricsAggregator){K&&W.warn(`No metrics aggregator enabled. Please add the MetricsAggregator integration to use metrics APIs`);return}let{unit:o,tags:s,timestamp:c}=r,{release:l,environment:u}=i.getOptions(),d=a.getTransaction(),f={};l&&(f.release=l),u&&(f.environment=u),d&&(f.transaction=uc(d).description||``),K&&W.log(`Adding value of ${n} to ${e} metric ${t}`),i.metricsAggregator.add(e,t,n,o,{...f,...s},c)}}function df(e,t=1,n){uf(`c`,e,t,n)}function ff(e,t,n){uf(`d`,e,t,n)}function pf(e,t,n){uf(`s`,e,t,n)}function mf(e,t,n){uf(`g`,e,t,n)}var hf={increment:df,distribution:ff,set:pf,gauge:mf,MetricsAggregator:lf,metricsAggregatorIntegration:cf},gf=af,_f=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Y=qi;function vf(){Y.document?Y.document.addEventListener(`visibilitychange`,()=>{let e=wl();if(Y.document.hidden&&e){let t=`cancelled`,{op:n,status:r}=uc(e);_f&&W.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${n}`),r||e.setStatus(t),e.setTag(`visibilitychange`,`document.hidden`),e.end()}}):_f&&W.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var yf=(e,t,n)=>{let r,i;return a=>{t.value>=0&&(a||n)&&(i=t.value-(r||0),(i||r===void 0)&&(r=t.value,t.delta=i,e(t)))}},bf=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+0xe8d4a51000}`,xf=()=>{let e=Y.performance.timing,t=Y.performance.navigation.type,n={entryType:`navigation`,startTime:0,type:t==2?`back_forward`:t===1?`reload`:`navigate`};for(let t in e)t!==`navigationStart`&&t!==`toJSON`&&(n[t]=Math.max(e[t]-e.navigationStart,0));return n},Sf=()=>Y.__WEB_VITALS_POLYFILL__?Y.performance&&(performance.getEntriesByType&&performance.getEntriesByType(`navigation`)[0]||xf()):Y.performance&&performance.getEntriesByType&&performance.getEntriesByType(`navigation`)[0],Cf=()=>{let e=Sf();return e&&e.activationStart||0},wf=(e,t)=>{let n=Sf(),r=`navigate`;return n&&(r=Y.document&&Y.document.prerendering||Cf()>0?`prerender`:n.type.replace(/_/g,`-`)),{name:e,value:t===void 0?-1:t,rating:`good`,delta:0,entries:[],id:bf(),navigationType:r}},Tf=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{t(e.getEntries())});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Ef=(e,t)=>{let n=r=>{(r.type===`pagehide`||Y.document.visibilityState===`hidden`)&&(e(r),t&&(removeEventListener(`visibilitychange`,n,!0),removeEventListener(`pagehide`,n,!0)))};Y.document&&(addEventListener(`visibilitychange`,n,!0),addEventListener(`pagehide`,n,!0))},Df=(e,t={})=>{let n=wf(`CLS`,0),r,i=0,a=[],o=e=>{e.forEach(e=>{if(!e.hadRecentInput){let t=a[0],o=a[a.length-1];i&&a.length!==0&&e.startTime-o.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e]),i>n.value&&(n.value=i,n.entries=a,r&&r())}})},s=Tf(`layout-shift`,o);if(s){r=yf(e,n,t.reportAllChanges);let i=()=>{o(s.takeRecords()),r(!0)};return Ef(i),i}},Of=-1,kf=()=>{Y.document&&Y.document.visibilityState&&(Of=Y.document.visibilityState===`hidden`&&!Y.document.prerendering?0:1/0)},Af=()=>{Ef(({timeStamp:e})=>{Of=e},!0)},jf=()=>(Of<0&&(kf(),Af()),{get firstHiddenTime(){return Of}}),Mf=e=>{let t=jf(),n=wf(`FID`),r,i=e=>{e.startTime<t.firstHiddenTime&&(n.value=e.processingStart-e.startTime,n.entries.push(e),r(!0))},a=e=>{e.forEach(i)},o=Tf(`first-input`,a);r=yf(e,n),o&&Ef(()=>{a(o.takeRecords()),o.disconnect()},!0)},Nf=0,Pf=1/0,Ff=0,If=e=>{e.forEach(e=>{e.interactionId&&(Pf=Math.min(Pf,e.interactionId),Ff=Math.max(Ff,e.interactionId),Nf=Ff?(Ff-Pf)/7+1:0)})},Lf,Rf=()=>Lf?Nf:performance.interactionCount||0,zf=()=>{`interactionCount`in performance||Lf||(Lf=Tf(`event`,If,{type:`event`,buffered:!0,durationThreshold:0}))},Bf=()=>Rf(),Vf=10,Hf=[],Uf={},Wf=e=>{let t=Hf[Hf.length-1],n=Uf[e.interactionId];if(n||Hf.length<Vf||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{let t={id:e.interactionId,latency:e.duration,entries:[e]};Uf[t.id]=t,Hf.push(t)}Hf.sort((e,t)=>
40t.latency-e.latency),Hf.splice(Vf).forEach(e=>{delete Uf[e.id]})}},Gf=()=>Hf[Math.min(Hf.length-1,Math.floor(Bf()/50))],Kf=(e,t)=>{t||={},zf();let n=wf(`INP`),r,i=e=>{e.forEach(e=>{e.interactionId&&Wf(e),e.entryType===`first-input`&&(Hf.some(t=>t.entries.some(t=>e.duration===t.duration&&e.startTime===t.startTime))||Wf(e))});let t=Gf();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,r())},a=Tf(`event`,i,{durationThreshold:t.durationThreshold||40});r=yf(e,n,t.reportAllChanges),a&&(a.observe({type:`first-input`,buffered:!0}),Ef(()=>{i(a.takeRecords()),n.value<0&&Bf()>0&&(n.value=0,n.entries=[]),r(!0)}))},qf={},Jf=e=>{let t=jf(),n=wf(`LCP`),r,i=e=>{let i=e[e.length-1];if(i){let e=Math.max(i.startTime-Cf(),0);e<t.firstHiddenTime&&(n.value=e,n.entries=[i],r())}},a=Tf(`largest-contentful-paint`,i);if(a){r=yf(e,n);let t=()=>{qf[n.id]||(i(a.takeRecords()),a.disconnect(),qf[n.id]=!0,r(!0))};return[`keydown`,`click`].forEach(e=>{Y.document&&addEventListener(e,t,{once:!0,capture:!0})}),Ef(t,!0),t}},Yf=e=>{Y.document&&(Y.document.prerendering?addEventListener(`prerenderingchange`,()=>Yf(e),!0):Y.document.readyState===`complete`?setTimeout(e,0):addEventListener(`load`,()=>Yf(e),!0))},Xf=(e,t)=>{t||={};let n=wf(`TTFB`),r=yf(e,n,t.reportAllChanges);Yf(()=>{let e=Sf();if(e){if(n.value=Math.max(e.responseStart-Cf(),0),n.value<0||n.value>performance.now())return;n.entries=[e],r(!0)}})},Zf={},Qf={},$f,ep,tp,np,rp;function ip(e,t=!1){return gp(`cls`,e,dp,$f,t)}function ap(e,t=!1){return gp(`lcp`,e,pp,tp,t)}function op(e){return gp(`ttfb`,e,mp,np)}function sp(e){return gp(`fid`,e,fp,ep)}function cp(e){return gp(`inp`,e,hp,rp)}function lp(e,t){return vp(e,t),Qf[e]||(_p(e),Qf[e]=!0),yp(e,t)}function up(e,t){let n=Zf[e];if(!(!n||!n.length))for(let r of n)try{r(t)}catch(t){_f&&W.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ia(r)}\nError:`,t)}}function dp(){return Df(e=>{up(`cls`,{metric:e}),$f=e},{reportAllChanges:!0})}function fp(){return Mf(e=>{up(`fid`,{metric:e}),ep=e})}function pp(){return Jf(e=>{up(`lcp`,{metric:e}),tp=e})}function mp(){return Xf(e=>{up(`ttfb`,{metric:e}),np=e})}function hp(){return Kf(e=>{up(`inp`,{metric:e}),rp=e})}function gp(e,t,n,r,i=!1){vp(e,t);let a;return Qf[e]||(a=n(),Qf[e]=!0),r&&t({metric:r}),yp(e,t,i?a:void 0)}function _p(e){let t={};e===`event`&&(t.durationThreshold=0),Tf(e,t=>{up(e,{entries:t})},t)}function vp(e,t){Zf[e]=Zf[e]||[],Zf[e].push(t)}function yp(e,t,n){return()=>{n&&n();let r=Zf[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function bp(e){return typeof e==`number`&&isFinite(e)}function xp(e,{startTimestamp:t,...n}){return t&&e.startTimestamp>t&&(e.startTimestamp=t),e.startChild({startTimestamp:t,...n})}var Sp=2147483647;function Cp(e){return e/1e3}function wp(){return Y&&Y.addEventListener&&Y.performance}var Tp=0,Ep={},Dp,Op;function kp(){let e=wp();if(e&&gs){e.mark&&Y.performance.mark(`sentry-tracing-init`);let t=Fp(),n=Np(),r=Pp(),i=Ip();return()=>{t(),n(),r(),i()}}return()=>void 0}function Ap(){lp(`longtask`,({entries:e})=>{for(let t of e){let e=wl();if(!e)return;let n=Cp(gs+t.startTime),r=Cp(t.duration);e.startChild({description:`Main UI thread blocked`,op:`ui.long-task`,origin:`auto.ui.browser.metrics`,startTimestamp:n,endTimestamp:n+r})}})}function jp(){lp(`event`,({entries:e})=>{for(let t of e){let e=wl();if(!e)return;if(t.name===`click`){let n=Cp(gs+t.startTime),r=Cp(t.duration),i={description:Qi(t.target),op:`ui.interaction.${t.name}`,origin:`auto.ui.browser.metrics`,startTimestamp:n,endTimestamp:n+r},a=na(t.target);a&&(i.attributes={"ui.component_name":a}),e.startChild(i)}}})}function Mp(e,t){if(wp()&&gs){let n=Rp(e,t);return()=>{n()}}return()=>void 0}function Np(){return ip(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(_f&&W.log(`[Measurements] Adding CLS`),Ep.cls={value:e.value,unit:``},Op=t)},!0)}function Pp(){return ap(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(_f&&W.log(`[Measurements] Adding LCP`),Ep.lcp={value:e.value,unit:`millisecond`},Dp=t)},!0)}function Fp(){return sp(({metric:e})=>{let t=e.entries[e.entries.length-1];if(!t)return;let n=Cp(gs),r=Cp(t.startTime);_f&&W.log(`[Measurements] Adding FID`),Ep.fid={value:e.value,unit:`millisecond`},Ep[`mark.fid`]={value:n+r,unit:`second`}})}function Ip(){return op(({metric:e})=>{e.entries[e.entries.length-1]&&(_f&&W.log(`[Measurements] Adding TTFB`),Ep.ttfb={value:e.value,unit:`millisecond`})})}var Lp={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function Rp(e,t){return cp(({metric:n})=>{if(n.value===void 0)return;let r=n.entries.find(e=>e.duration===n.value&&Lp[e.name]!==void 0),i=q();if(!r||!i)return;let a=Lp[r.name],o=i.getOptions(),s=Cp(gs+r.startTime),c=Cp(n.value),l=r.
40interactionId===void 0?void 0:e[r.interactionId];if(l===void 0)return;let{routeName:u,parentContext:d,activeTransaction:f,user:p,replayId:m}=l,h=p===void 0?void 0:p.email||p.id||p.ip_address,g=f===void 0?void 0:f.getProfileId(),_=new iu({startTimestamp:s,endTimestamp:s+c,op:`ui.interaction.${a}`,name:Qi(r.target),attributes:{release:o.release,environment:o.environment,transaction:u,...h!==void 0&&h!==``?{user:h}:{},...g===void 0?{}:{profile_id:g},...m===void 0?{}:{replay_id:m}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:`millisecond`}}}),v=Yp(d,o,t);if(v&&Math.random()<v){let e=_?gd([_],i.getDsn()):void 0,t=i&&i.getTransport();t&&e&&t.send(e).then(null,e=>{_f&&W.error(`Error while sending interaction:`,e)});return}})}function zp(e){let t=wp();if(!t||!Y.performance.getEntries||!gs)return;_f&&W.log(`[Tracing] Adding & adjusting spans using Performance API`);let n=Cp(gs),r=t.getEntries(),{op:i,start_timestamp:a}=uc(e);if(r.slice(Tp).forEach(t=>{let r=Cp(t.startTime),i=Cp(t.duration);if(!(e.op===`navigation`&&a&&n+r<a))switch(t.entryType){case`navigation`:Vp(e,t,n);break;case`mark`:case`paint`:case`measure`:{Bp(e,t,r,i,n);let a=jf(),o=t.startTime<a.firstHiddenTime;t.name===`first-paint`&&o&&(_f&&W.log(`[Measurements] Adding FP`),Ep.fp={value:t.startTime,unit:`millisecond`}),t.name===`first-contentful-paint`&&o&&(_f&&W.log(`[Measurements] Adding FCP`),Ep.fcp={value:t.startTime,unit:`millisecond`});break}case`resource`:Wp(e,t,t.name,r,i,n)}}),Tp=Math.max(r.length-1,0),Gp(e),i===`pageload`){Jp(Ep),[`fcp`,`fp`,`lcp`].forEach(e=>{if(!Ep[e]||!a||n>=a)return;let t=Ep[e].value,r=n+Cp(t),i=Math.abs((r-a)*1e3),o=i-t;_f&&W.log(`[Measurements] Normalized ${e} from ${t} to ${i} (${o})`),Ep[e].value=i});let t=Ep[`mark.fid`];t&&Ep.fid&&(xp(e,{description:`first input delay`,endTimestamp:t.value+Cp(Ep.fid.value),op:`ui.action`,origin:`auto.ui.browser.metrics`,startTimestamp:t.value}),delete Ep[`mark.fid`]),`fcp`in Ep||delete Ep.cls,Object.keys(Ep).forEach(e=>{_u(e,Ep[e].value,Ep[e].unit)}),Kp(e)}Dp=void 0,Op=void 0,Ep={}}function Bp(e,t,n,r,i){let a=i+n,o=a+r;return xp(e,{description:t.name,endTimestamp:o,op:t.entryType,origin:`auto.resource.browser.metrics`,startTimestamp:a}),a}function Vp(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{Hp(e,t,r,n)}),Hp(e,t,`secureConnection`,n,`TLS/SSL`,`connectEnd`),Hp(e,t,`fetch`,n,`cache`,`domainLookupStart`),Hp(e,t,`domainLookup`,n,`DNS`),Up(e,t,n)}function Hp(e,t,n,r,i,a){let o=a?t[a]:t[`${n}End`],s=t[`${n}Start`];!s||!o||xp(e,{op:`browser`,origin:`auto.browser.browser.metrics`,description:i||n,startTimestamp:r+Cp(s),endTimestamp:r+Cp(o)})}function Up(e,t,n){t.responseEnd&&(xp(e,{op:`browser`,origin:`auto.browser.browser.metrics`,description:`request`,startTimestamp:n+Cp(t.requestStart),endTimestamp:n+Cp(t.responseEnd)}),xp(e,{op:`browser`,origin:`auto.browser.browser.metrics`,description:`response`,startTimestamp:n+Cp(t.responseStart),endTimestamp:n+Cp(t.responseEnd)}))}function Wp(e,t,n,r,i,a){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let o=cs(n),s={};qp(s,t,`transferSize`,`http.response_transfer_size`),qp(s,t,`encodedBodySize`,`http.response_content_length`),qp(s,t,`decodedBodySize`,`http.decoded_response_content_length`),`renderBlockingStatus`in t&&(s[`resource.render_blocking_status`]=t.renderBlockingStatus),o.protocol&&(s[`url.scheme`]=o.protocol.split(`:`).pop()),o.host&&(s[`server.address`]=o.host),s[`url.same_origin`]=n.includes(Y.location.origin);let c=a+r,l=c+i;xp(e,{description:n.replace(Y.location.origin,``),endTimestamp:l,op:t.initiatorType?`resource.${t.initiatorType}`:`resource.other`,origin:`auto.resource.browser.metrics`,startTimestamp:c,data:s})}function Gp(e){let t=Y.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setTag(`effectiveConnectionType`,n.effectiveType),n.type&&e.setTag(`connectionType`,n.type),bp(n.rtt)&&(Ep[`connection.rtt`]={value:n.rtt,unit:`millisecond`})),bp(t.deviceMemory)&&e.setTag(`deviceMemory`,`${t.deviceMemory} GB`),bp(t.hardwareConcurrency)&&e.setTag(`hardwareConcurrency`,String(t.hardwareConcurrency))}function Kp(e){Dp&&(_f&&W.log(`[Measurements] Adding LCP Data`),Dp.element&&e.setTag(`lcp.element`,Qi(Dp.element)),Dp.id&&e.setTag(`lcp.id`,Dp.id),Dp.url&&e.setTag(`lcp.url`,Dp.url.trim().slice(0,200)),e.setTag(`lcp.size`,Dp.size)),Op&&Op.sources&&(_f&&W.log(`[Measurements] Adding CLS Data`),Op.sources.forEac
40h((t,n)=>e.setTag(`cls.source.${n+1}`,Qi(t.node))))}function qp(e,t,n,r){let i=t[n];i!=null&&i<Sp&&(e[r]=i)}function Jp(e){let t=Sf();if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(_f&&W.log(`[Measurements] Adding TTFB Request Time`),e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}function Yp(e,t,n){if(!Fl(t))return!1;let r;return r=e!==void 0&&typeof t.tracesSampler==`function`?t.tracesSampler({transactionContext:e,name:e.name,parentSampled:e.parentSampled,attributes:{...e.data,...e.attributes},location:Y.location}):e!==void 0&&e.sampled!==void 0?e.sampled:t.tracesSampleRate===void 0?1:t.tracesSampleRate,fu(r)?r===!0?n:r===!1?0:r*n:(_f&&W.warn(`[Tracing] Discarding interaction span because of invalid sample rate.`),!1)}function Xp(e,t,n,r,i=`auto.http.browser`){if(!Fl()||!e.fetchData)return;let a=t(e.fetchData.url);if(e.endTimestamp&&a){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&($p(n,e),delete r[t]);return}let o=Wc(),s=q(),{method:c,url:l}=e.fetchData,u=Qp(l),d=u?cs(u).host:void 0,f=a?zl({name:`${c} ${l}`,onlyIfParent:!0,attributes:{url:l,type:`fetch`,"http.method":c,"http.url":u,"server.address":d,[tu]:i},op:`http.client`}):void 0;if(f&&(e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(e.fetchData.url)&&s){let t=e.args[0];e.args[1]=e.args[1]||{};let n=e.args[1];n.headers=Zp(t,s,o,n,f)}return f}function Zp(e,t,n,r,i){let a=i||n.getSpan(),{traceId:o,spanId:s,sampled:c,dsc:l}={...vl().getPropagationContext(),...n.getPropagationContext()},u=a?sc(a):Os(o,s,c),d=xs(l||(a?Zc(a):Xc(o,t,n))),f=r.headers||(typeof Request<`u`&&Pi(e,Request)?e.headers:void 0);if(!f)return{"sentry-trace":u,baggage:d};if(typeof Headers<`u`&&Pi(f,Headers)){let e=new Headers(f);return e.append(`sentry-trace`,u),d&&e.append(_s,d),e}if(Array.isArray(f)){let e=[...f,[`sentry-trace`,u]];return d&&e.push([_s,d]),e}{let e=`baggage`in f?f.baggage:void 0,t=[];return Array.isArray(e)?t.push(...e):e&&t.push(e),d&&t.push(d),{...f,"sentry-trace":u,baggage:t.length>0?t.join(`,`):void 0}}}function Qp(e){try{return new URL(e).href}catch{return}}function $p(e,t){if(t.response){Ml(e,t.response.status);let n=t.response&&t.response.headers&&t.response.headers.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus(`internal_error`);e.end()}var em=[`localhost`,/^\/(?!\/)/],tm={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:em,tracePropagationTargets:em};function nm(e){let{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:a,enableHTTPTimings:o}={traceFetch:tm.traceFetch,traceXHR:tm.traceXHR,...e},s=typeof a==`function`?a:e=>!0,c=e=>cm(e,r||i),l={};t&&go(e=>{let t=Xp(e,s,c,l);if(t){let n=dm(e.fetchData.url),r=n?cs(n).host:void 0;t.setAttributes({"http.url":n,"server.address":r})}o&&t&&im(t)}),n&&G(e=>{let t=lm(e,s,c,l);o&&t&&im(t)})}function rm(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function im(e){let{url:t}=uc(e).data||{};if(!t||typeof t!=`string`)return;let n=lp(`resource`,({entries:r})=>{r.forEach(r=>{rm(r)&&r.name.endsWith(t)&&(sm(r).forEach(t=>e.setAttribute(...t)),setTimeout(n))})})}function am(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function om(e=0){return((gs||performance.timeOrigin)+e)/1e3}function sm(e){let{name:t,version:n}=am(e.nextHopProtocol),r=[];return r.push([`network.protocol.version`,n],[`network.protocol.name`,t]),gs?[...r,[`http.request.redirect_start`,om(e.redirectStart)],[`http.request.fetch_start`,om(e.fetchStart)],[`http.request.domain_lookup_start`,om(e.domainLookupStart)],[`http.request.domain_lookup_end`,om(e.domainLookupEnd)],[`http.request.connect_start`,om(e.connectStart)],[`http.request.secure_connection_start`,om(e.secureConnectionStart)],[`http.request.connection_end`,om(e.connectEnd)],[`http.request.request_start`,om(e.requestStart)],[`http.request.response_start`,om(e.responseStart)],[`http.request.response_end`,om(e.responseEnd)]]:r}function cm(e,t){return Bi(e,t||em)}function lm(e,t,n,r){let i=e.xhr,a=i&&i.__sentry_xhr_v3__;if(!Fl()||!i||i.__sentry_own_request__||!a)return;let o=t(a.url);if(e.endTimestamp&&o){let e=i.__sentry_xhr_span_id__;if(!e)return;let t=r[e];t&&a.status_code!==void 0&&(Ml(t,a.status_code),t.end(),delete r[e]);return}let s=Wc(),c=vl(),l=dm(a.url),u=l?cs(l).host:void 0,d=o?zl({name:`${a.method} ${a.url}`,onlyIfParent:!0,attributes:{type:`xhr`,"http.method":a.method,"http.url":l,url:a.url,"server.address":u,[tu]:`auto.http.browser`},op:`http.client`}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);let f=q();if(i.setRequestHeader&&n(a.url)&&f){let{traceId:e,spanId:t,sampled:n,dsc:r}={...c.getPropagationContext(),...s.getPropagationContext()};
40um(i,d?sc(d):Os(e,t,n),xs(r||(d?Zc(d):Xc(e,f,s))))}return d}function um(e,t,n){try{e.setRequestHeader(`sentry-trace`,t),n&&e.setRequestHeader(_s,n)}catch{}}function dm(e){try{return new URL(e,Y.location.origin).href}catch{return}}function fm(e,t=!0,n=!0){if(!Y||!Y.location){_f&&W.warn(`Could not initialize routing instrumentation due to invalid location`);return}let r=Y.location.href,i;t&&(i=e({name:Y.location.pathname,startTimestamp:gs?gs/1e3:void 0,op:`pageload`,origin:`auto.pageload.browser`,metadata:{source:`url`}})),n&&jo(({to:t,from:n})=>{if(n===void 0&&r&&r.indexOf(t)!==-1){r=void 0;return}n!==t&&(r=void 0,i&&(_f&&W.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.end()),i=e({name:Y.location.pathname,op:`navigation`,origin:`auto.navigation.browser`,metadata:{source:`url`}}))})}var pm=`BrowserTracing`,mm={...ou,markBackgroundTransactions:!0,routingInstrumentation:fm,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...tm},hm=10,gm=class{constructor(e){this.name=pm,this._hasSetTracePropagationTargets=!1,gu(),_f&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...mm,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=kp(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&Mp(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&Ap(),this.options._experiments.enableInteractions&&jp(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,t){this._getCurrentHub=t;let n=t().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:a,startTransactionOnPageLoad:o,markBackgroundTransactions:s,traceFetch:c,traceXHR:l,shouldCreateSpanForRequest:u,enableHTTPTimings:d,_experiments:f}=this.options,p=r&&r.tracePropagationTargets,m=p||this.options.tracePropagationTargets;_f&&this._hasSetTracePropagationTargets&&p&&W.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),i(e=>{let n=this._createRouteTransaction(e);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,e,t),n},o,a),s&&vf(),f.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),nm({traceFetch:c,traceXHR:l,tracePropagationTargets:m,shouldCreateSpanForRequest:u,enableHTTPTimings:d})}_createRouteTransaction(e){if(!this._getCurrentHub){_f&&W.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:a}=this.options,o=e.op===`pageload`,s;if(o){let{traceId:t,dsc:n,parentSpanId:r,sampled:i}=Ds(o?_m(`sentry-trace`):``,o?_m(`baggage`):void 0);s={traceId:t,parentSpanId:r,parentSampled:i,...e,metadata:{...e.metadata,dynamicSamplingContext:n},trimEnd:!0}}else s={trimEnd:!0,...e};let c=typeof n==`function`?n(s):s,l=c===void 0?{...s,sampled:!1}:c;l.metadata=l.name===s.name?l.metadata:{...l.metadata,source:`custom`},this._latestRoute.name=l.name,this._latestRoute.context=l,l.sampled===!1&&_f&&W.log(`[Tracing] Will not send ${l.op} transaction because of beforeNavigate.`),_f&&W.log(`[Tracing] Starting ${l.op} transaction on scope`);let{location:u}=Y,d=hu(t,l,r,i,!0,{location:u},a,o);return o&&Y.document&&(Y.document.addEventListener(`readystatechange`,()=>{[`interactive`,`complete`].includes(Y.document.readyState)&&d.sendAutoFinishSignal()}),[`interactive`,`complete`].includes(Y.document.readyState)&&d.sendAutoFinishSignal()),d.registerBeforeFinishCallback(e=>{this._collectWebVitals(),zp(e)}),d}_registerInteractionListener(){let e,t=()=>{let{idleTimeout:t,finalTimeout:n,heartbeatInterval:r}=this.options,i=`ui.action.click`,a=wl();if(a&&a.op&&[`navigation`,`pageload`].includes(a.op)){_f&&W.warn(`[Tracing] Did not create ${i} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&=(e.setFinishReason(`interactionInterrupted`),e.end(),void 0),!this._getCurrentHub){_f&&W.warn(`[Tracing] Did not create ${i}
40 transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){_f&&W.warn(`[Tracing] Did not create ${i} transaction because _latestRouteName is missing.`);return}let o=this._getCurrentHub(),{location:s}=Y;e=hu(o,{name:this._latestRoute.name,op:i,trimEnd:!0,data:{[Ql]:this._latestRoute.context?vm(this._latestRoute.context):`url`}},t,n,!0,{location:s},r)};[`click`].forEach(e=>{Y.document&&addEventListener(e,t,{once:!1,capture:!0})})}_registerInpInteractionListener(){let e=({entries:e})=>{let t=q(),n=t!==void 0&&t.getIntegrationByName!==void 0?t.getIntegrationByName(`Replay`):void 0,r=n===void 0?void 0:n.getReplayId(),i=wl(),a=Wc(),o=a===void 0?void 0:a.getUser();e.forEach(e=>{if(ym(e)){let t=e.interactionId;if(t===void 0)return;let n=this._interactionIdToRouteNameMapping[t],a=e.duration,s=e.startTime,c=Object.keys(this._interactionIdToRouteNameMapping),l=c.length>0?c.reduce((e,t)=>this._interactionIdToRouteNameMapping[e].duration<this._interactionIdToRouteNameMapping[t].duration?e:t):void 0;if(e.entryType===`first-input`&&c.map(e=>this._interactionIdToRouteNameMapping[e]).some(e=>e.duration===a&&e.startTime===s)||!t)return;if(n)n.duration=Math.max(n.duration,a);else if(c.length<hm||l===void 0||a>this._interactionIdToRouteNameMapping[l].duration){let e=this._latestRoute.name,n=this._latestRoute.context;e&&n&&(l&&Object.keys(this._interactionIdToRouteNameMapping).length>=hm&&delete this._interactionIdToRouteNameMapping[l],this._interactionIdToRouteNameMapping[t]={routeName:e,duration:a,parentContext:n,user:o,activeTransaction:i,replayId:r,startTime:s})}}})};lp(`event`,e),lp(`first-input`,e)}};function _m(e){let t=ta(`meta[name=${e}]`);return t?t.getAttribute(`content`):void 0}function vm(e){let t=e.attributes&&e.attributes[`sentry.source`],n=e.data&&e.data[`sentry.source`],r=e.metadata&&e.metadata.source;return t||n||r}function ym(e){return`duration`in e}var bm=`BrowserTracing`,xm={...ou,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...tm},Sm=((e={})=>{let t=_f?!!(e.tracePropagationTargets||e.tracingOrigins):!1;gu(),!e.tracePropagationTargets&&e.tracingOrigins&&(e.tracePropagationTargets=e.tracingOrigins);let n={...xm,...e},r=kp(),i={};n.enableInp&&Mp(i,n.interactionsSampleRate),n.enableLongTask&&Ap(),n._experiments.enableInteractions&&jp();let a={name:void 0,context:void 0};function o(e){let t=_l(),{beforeStartSpan:i,idleTimeout:o,finalTimeout:s,heartbeatInterval:c}=n,l=e.op===`pageload`,u;if(l){let{traceId:t,dsc:n,parentSpanId:r,sampled:i}=Ds(l?Tm(`sentry-trace`):``,l?Tm(`baggage`):void 0);u={traceId:t,parentSpanId:r,parentSampled:i,...e,metadata:{...e.metadata,dynamicSamplingContext:n},trimEnd:!0}}else u={trimEnd:!0,...e};let d=i?i(u):u;d.metadata=d.name===u.name?d.metadata:{...d.metadata,source:`custom`},a.name=d.name,a.context=d,d.sampled===!1&&_f&&W.log(`[Tracing] Will not send ${d.op} transaction because of beforeNavigate.`),_f&&W.log(`[Tracing] Starting ${d.op} transaction on scope`);let{location:f}=Y,p=hu(t,d,o,s,!0,{location:f},c,l);return l&&Y.document&&(Y.document.addEventListener(`readystatechange`,()=>{[`interactive`,`complete`].includes(Y.document.readyState)&&p.sendAutoFinishSignal()}),[`interactive`,`complete`].includes(Y.document.readyState)&&p.sendAutoFinishSignal()),p.registerBeforeFinishCallback(e=>{r(),zp(e)}),p}return{name:bm,setupOnce:()=>{},afterAllSetup(e){let r=e.getOptions(),{markBackgroundSpan:s,traceFetch:c,traceXHR:l,shouldCreateSpanForRequest:u,enableHTTPTimings:d,_experiments:f}=n,p=r&&r.tracePropagationTargets,m=p||n.tracePropagationTargets;_f&&t&&p&&W.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let h,g=Y.location&&Y.location.href;e.on&&(e.on(`startNavigationSpan`,e=>{h&&(_f&&W.log(`[Tracing] Finishing current transaction with op: ${uc(h).op}`),h.end()),h=o({op:`navigation`,...e})}),e.on(`startPageLoadSpan`,e=>{h&&(_f&&W.log(`[Tracing] Finishing current transaction with op: ${uc(h).op}`),h.end()),h=o({op:`pageload`,...e})})),n.instrumentPageLoad&&e.emit&&Y.location&&Cm(e,{name:Y.location.pathname,startTimestamp:gs?gs/1e3:void 0,origin:`auto.pageload.browser`,attributes:{[Ql]:`url`}}),n.instrumentNavigation&&e.emit&&Y.location&&jo(({to:t,from:n})=>{if(n===void 0&&g&&g.indexOf(t)!==-1){g=void 0;return}n!==t&&(g=void 0,wm(e,{name:Y.location.pathname,origin:`auto.navigation.browser`,attributes:{[Ql]:`url`}}))}),s&&vf(),f.enableInteractions&&Em(n,a),n.enableInp&&km(i,a),nm({traceFetch:c,traceXHR:l,tracePropagationTargets:m,shouldCreateSpanForRequest:u,enableHTTPTimings:d})},options:n}});function Cm(e,t){if(!e.emit)return;e.emit(`startPageLoadSpan`,t);let n=Bl();return(n&&uc(n).op)===`pageload`?n:void 0}function wm(e,t){if(!e.emit)return;e.emit(`startNavigationSpan`,t);let n=Bl();return(n&&uc(n).op)===`navigation`?n:void 0}function Tm(e){let t=ta(`meta[name=${e}]`);return t?t.getAttribute(`content`):void 0}function Em(e,t){let n,r=()=>{let{idleTimeout:r,finalTimeout:i,heartbeatInterval:a}=e,o=`ui.action.click`,s=wl();if(s&&s.op&&[`navigation`,`pageload`].includes(s.op)){_f&&W.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&=(n.setFinishReason(`interactionInterrupted`),n.end(),void 0),!t.name){_f&&W.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}let{location:c}=Y,l={name:t.name,op:o,trimEnd:!0,data:{[Ql]:t.context?Am(t.context):`url`}};n=hu(_l(),l,r,i,!0,{location:c},a)};
40[`click`].forEach(e=>{Y.document&&addEventListener(e,r,{once:!1,capture:!0})})}function Dm(e){return`duration`in e}var Om=10;function km(e,t){let n=({entries:n})=>{let r=q(),i=r!==void 0&&r.getIntegrationByName!==void 0?r.getIntegrationByName(`Replay`):void 0,a=i===void 0?void 0:i.getReplayId(),o=wl(),s=Wc(),c=s===void 0?void 0:s.getUser();n.forEach(n=>{if(Dm(n)){let r=n.interactionId;if(r===void 0)return;let i=e[r],s=n.duration,l=n.startTime,u=Object.keys(e),d=u.length>0?u.reduce((t,n)=>e[t].duration<e[n].duration?t:n):void 0;if(n.entryType===`first-input`&&u.map(t=>e[t]).some(e=>e.duration===s&&e.startTime===l)||!r)return;if(i)i.duration=Math.max(i.duration,s);else if(u.length<Om||d===void 0||s>e[d].duration){let n=t.name,i=t.context;n&&i&&(d&&Object.keys(e).length>=Om&&delete e[d],e[r]={routeName:n,duration:s,parentContext:i,user:c,activeTransaction:o,replayId:a,startTime:l})}}})};lp(`event`,n),lp(`first-input`,n)}function Am(e){let t=e.attributes&&e.attributes[`sentry.source`],n=e.data&&e.data[`sentry.source`],r=e.metadata&&e.metadata.source;return t||n||r}var X=qi,jm=0;function Mm(){return jm>0}function Nm(){jm++,setTimeout(()=>{jm--})}function Pm(e,t={},n){if(typeof e!=`function`)return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(ba(e))return e}catch{return e}let r=function(){let r=Array.prototype.slice.call(arguments);try{n&&typeof n==`function`&&n.apply(this,arguments);let i=r.map(e=>Pm(e,t));return e.apply(this,i)}catch(e){throw Nm(),Ic(n=>{n.addEventProcessor(e=>(t.mechanism&&(qa(e,void 0,void 0),Ja(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),Tc(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}ya(r,e),va(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}var Fm=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function Im(e,t){let n=zm(e,t),r={type:t&&t.name,value:Hm(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function Lm(e,t,n,r){let i=q(),a=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:Oi(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:qm(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Wo(t,a)}};if(n){let t=zm(e,n);t.length&&(o.exception.values[0].stacktrace={frames:t})}return o}function Rm(e,t){return{exception:{values:[Im(e,t)]}}}function zm(e,t){let n=t.stacktrace||t.stack||``,r=Vm(t);try{return e(n,r)}catch{}return[]}var Bm=/Minified React error #\d+;/i;function Vm(e){if(e){if(typeof e.framesToPop==`number`)return e.framesToPop;if(Bm.test(e.message))return 1}return 0}function Hm(e){let t=e&&e.message;return t?t.error&&typeof t.error.message==`string`?t.error.message:t:`No error message`}function Um(e,t,n,r){let i=Gm(e,t,n&&n.syntheticException||void 0,r);return Ja(i),i.level=`error`,n&&n.event_id&&(i.event_id=n.event_id),is(i)}function Wm(e,t,n=`info`,r,i){let a=Km(e,t,r&&r.syntheticException||void 0,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),is(a)}function Gm(e,t,n,r,i){let a;if(xi(t)&&t.error)return Rm(e,t.error);if(Si(t)||Ci(t)){let i=t;if(`stack`in t)a=Rm(e,t);else{let t=i.name||(Si(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=Km(e,o,n,r),qa(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return yi(t)?Rm(e,t):Di(t)||Oi(t)?(a=Lm(e,t,n,i),Ja(a,{synthetic:!0}),a):(a=Km(e,t,n,r),qa(a,`${t}`,void 0),Ja(a,{synthetic:!0}),a)}function Km(e,t,n,r){let i={};if(r&&n){let r=zm(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(Ti(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function qm(e,{isUnhandledRejection:t}){let n=Ta(e),r=t?`promise rejection`:`exception`;return xi(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Oi(e)?`Event \`${Jm(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Jm(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ym(e,{metadata:t,tunnel:n,dsn:r}){return ks({event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:da(r)}},[Xm(e)])}function Xm(e){return[{type:`user_report`},e]}var Zm=class extends Yu{constructor(e){wd(e,`browser`,[`browser`],X.SENTRY_SDK_SOURCE||Ro()),super(e),e.sendClientReports&&X.document&&X.document.addEventListener(`visibilitychange`,()=>{X.document.visibilityState===`hidden`&&this._flushOutcomes()})}eventFromException(e,t){return Um(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return Wm(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Fm&&W.warn(`SDK not enabled, will not capture user feedback.`);return}let t=Ym(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){Fm&&W.log(`No outcomes to send`);return}if(!this._dsn){Fm&&W.log(`No dsn provided, will not send outcomes`);return}Fm&&W.log(`Sending outcomes:`,e);let t=Hs(e,this._options.tunnel&&da(this._dsn));this._sendEnvelope(t)}},Qm=void 0;function $m(){if(Qm)return Qm;if(po(X.fetch))return Qm=X.fetch.bind(X);let e=X.document,t=X.fetch;if(e&&typeof e.createElement==`function`)try{let n=e.createElement(`iframe`);n.hidden=!0,e.head.appendChild(n);let r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){Fm&&W.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return Qm=t.bind(X)}function eh(){Qm=void 0}function th(e,t=$m()){let n=0,r=0;function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,o).then(e=>(n-=a,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get(`X-Sentry-Rate-Limits`),"retry-after":e.headers.get(`Retry-After`)}}))}catch(e){return eh(),n-=a,r--,as(e)}}return od(e,i)}var nh=4;function rh(e){function t(t){return new os((n,r)=>{let i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{i.readyState===nh&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader(`X-Sentry-Rate-Limits`),"retry-after":i.getResponseHeader(`Retry-After`)}})},i.open(`POST`,e.url);for(let t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)})}return od(e,t)}var ih=`?`,ah=10,oh=20,sh=30,ch=40,lh=50;
vendor: 9,048 bytes, line 40
40function uh(e,t,n,r){let i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var dh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fh=/\((\S*)(?::(\d+))(?::(\d+))\)/,ph=[sh,e=>{let t=dh.exec(e);if(t){if(t[2]&&t[2].indexOf(`eval`)===0){let e=fh.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}let[e,n]=Th(t[1]||ih,t[2]);return uh(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],mh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,hh=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gh=[lh,e=>{let t=mh.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=hh.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||ih;return[n,e]=Th(n,e),uh(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],_h=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vh=[ch,e=>{let t=_h.exec(e);return t?uh(t[2],t[1]||ih,+t[3],t[4]?+t[4]:void 0):void 0}],yh=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,bh=[ah,e=>{let t=yh.exec(e);return t?uh(t[2],t[3]||ih,+t[1]):void 0}],xh=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Sh=[oh,e=>{let t=xh.exec(e);return t?uh(t[5],t[3]||t[4]||ih,+t[1],+t[2]):void 0}],Ch=[ph,gh,vh],wh=Ma(...Ch),Th=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?ih:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Eh=1024,Dh=`Breadcrumbs`,Oh=J(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Dh,setupOnce(){},setup(e){t.console&&Ha(Mh(e)),t.dom&&ro(jh(e,t.dom)),t.xhr&&G(Nh(e)),t.fetch&&go(Ph(e)),t.history&&jo(Fh(e)),t.sentry&&e.on&&e.on(`beforeSendEvent`,Ah(e))}}})),kh=Fu(Dh,Oh);function Ah(e){return function(t){q()===e&&kc({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:Ka(t)},{event:t})}}function jh(e,t){return function(n){if(q()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>Eh&&(Fm&&W.warn(`\`dom.maxStringLength\` cannot exceed ${Eh}, but a value of ${o} was configured. Sentry will use ${Eh} instead.`),o=Eh),typeof a==`string`&&(a=[a]);try{let e=n.event,t=Ih(e)?e.target:e;r=Qi(t,{keyAttrs:a,maxStringLength:o}),i=na(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),kc(s,{event:n.event,name:n.name,global:n.global})}}function Mh(e){return function(t){if(q()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:ds(t.level),message:Ri(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Ri(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;kc(n,{input:t.args,level:t.level})}}function Nh(e){return function(t){if(q()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[Po];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r};kc({category:`xhr`,data:l,type:`http`},u)}}function Ph(e){return function(t){if(q()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let e=t.fetchData,i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r};kc({category:`fetch`,data:e,level:`error`,type:`http`},i)}else{let e=t.response,i={...t.fetchData,status_code:e&&e.status},a={input:t.args,response:e,startTimestamp:n,endTimestamp:r};kc({category:`fetch`,data:i,type:`http`},a)}}}function Fh(e){return function(t){if(q()!==e)return;let n=t.from,r=t.to,i=cs(X.location.href),a=n?cs(n):void 0,o=cs(r);(!a||!a.path)&&(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),kc({category:`navigation`,data:{from:n,to:r}})}}function Ih(e){return!!e&&!!e.target}var Lh=`Dedupe`,Rh=J((()=>{let e;return{name:Lh,setupOnce(){},processEvent(t){if(t.type)return t;try{if(Bh(t,e))return Fm&&W.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}})),zh=Fu(Lh,Rh);function Bh(e,t){return t?!!(Vh(e,t)||Hh(e,t)):!1}function Vh(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Wh(e,t)||!Uh(e,t))}function Hh(e,t){let n=Gh(t),r=Gh(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Wh(e,t)||!Uh(e,t))}function Uh(e,t){let n=Kh(e),r=Kh(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Wh(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Gh(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Kh(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}var qh=`GlobalHandlers`,Jh=J(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:qh,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(Xh(e),ng(`onerror`)),t.onunhandledrejection&&(Zh(e),ng(`onunhandledrejection`))}}})),Yh=Fu(qh,Jh);function Xh(e){So(t=>{let{stackParser:n,attachStacktrace:r}=rg();if(q()!==e||Mm())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=c===void 0&&wi(i)?eg(i,a,o,s):tg(Gm(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,Dc(l,{originalException:c,mechanism:{handled:!1,type:`onerror`}})})}function Zh(e){To(t=>{let{stackParser:n,attachStacktrace:r}=rg();if(q()!==e||Mm())return;let i=Qh(t),a=Ei(i)?$h(i):Gm(n,i,void 0,r,!0);a.level=`error`,Dc(a,{originalException:i,mechanism:{handled:!1,type:`onunhandledrejection`}})})}function Qh(e){if(Ei(e))return e;let t=e;try{if(`reason`in t)return t.reason;if(`detail`in t&&`reason`in t.detail)return t.detail.reason}catch{}return e}function $h(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function eg(e,t,n,r){let i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,a=xi(e)?e.message:e,o=`Error`,s=a.match(i);return s&&(o=s[1],a=s[2]),tg({exception:{values:[{type:o,value:a}]}},t,n,r)}function tg(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=wi(t)&&t.length>0?t:ea();return c.length===0&&c.push({colno:l,filename:d,function:`?`,in_app:!0,lineno:u}),e}function ng(e){Fm&&W.log(`Global Handler attached: ${e}`)}function rg(){let e=q();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var ig=`HttpContext`,ag=J((()=>({name:ig,setupOnce(){},preprocessEvent(e){if(!X.navigator&&!X.location&&!X.document)return;let t=e.request&&e.request.url||X.location&&X.location.href,{referrer:n}=X.document||{},{userAgent:r}=X.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}};e.request={...e.request,...t&&{url:t},headers:i}}}))),og=Fu(ig,ag),sg=`cause`,cg=5,lg=`LinkedErrors`,ug=J(((e={})=>{let t=e.limit||cg,n=e.key||sg;return{name:lg,setupOnce(){},preprocessEvent(e,r,i){let a=i.getOptions();Vi(Im,a.stackParser,a.maxValueLength,n,t,e,r)}}})),dg=Fu(lg,ug),fg=`EventTarget.Window.Node.ApplicationCache.AudioTrackList.BroadcastChannel.ChannelMergerNode.CryptoOperation.EventSource.FileReader.HTMLUnknownElement.IDBDatabase.IDBRequest.IDBTransaction.KeyOperation.MediaController.MessagePort.ModalWindow.Notification.SVGElementInstance.Screen.SharedWorker.TextTrack.TextTrackCue.TextTrackList.WebSocket.WebSocketWorker.Worker.XMLHttpRequest.XMLHttpRequestEventTarget.XMLHttpRequestUpload`.split(`.`),pg=`TryCatch`,mg=J(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:pg,setupOnce(){t.setTimeout&&_a(X,`setTimeout`,gg),t.setInterval&&_a(X,`setInterval`,gg),t.requestAnimationFrame&&_a(X,`requestAnimationFrame`,_g),t.XMLHttpRequest&&`XMLHttpRequest`in X&&_a(XMLHttpRequest.prototype,`send`,vg);let e=t.eventTarget;e&&(Array.isArray(e)?e:fg).forEach(yg)}}})),hg=Fu(pg,mg);function gg(e){return function(...t){let n=t[0];return t[0]=Pm(n,{mechanism:{data:{function:Ia(e)},handled:!1,type:`instrument`}}),e.apply(this,t)}}function _g(e){return function(t){return e.apply(this,[Pm(t,{mechanism:{data:{function:`requestAnimationFrame`,handler:Ia(e)},handled:!1,type:`instrument`}})])}}function vg(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e
40=>{e in n&&typeof n[e]==`function`&&_a(n,e,function(t){let n={mechanism:{data:{function:e,handler:Ia(t)},handled:!1,type:`instrument`}},r=ba(t);return r&&(n.mechanism.data.handler=Ia(r)),Pm(t,n)})}),e.apply(this,t)}}function yg(e){let t=X,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty(`addEventListener`)||(_a(n,`addEventListener`,function(t){return function(n,r,i){try{typeof r.handleEvent==`function`&&(r.handleEvent=Pm(r.handleEvent,{mechanism:{data:{function:`handleEvent`,handler:Ia(r),target:e},handled:!1,type:`instrument`}}))}catch{}return t.apply(this,[n,Pm(r,{mechanism:{data:{function:`addEventListener`,handler:Ia(r),target:e},handled:!1,type:`instrument`}}),i])}}),_a(n,`removeEventListener`,function(e){return function(t,n,r){let i=n;try{let n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch{}return e.call(this,t,i,r)}}))}var bg=[Ld(),Qd(),mg(),Oh(),Jh(),ug(),Rh(),ag()];function xg(e){return[...bg]}function Sg(e={}){e.defaultIntegrations===void 0&&(e.defaultIntegrations=xg()),e.release===void 0&&(typeof __SENTRY_RELEASE__==`string`&&(e.release=__SENTRY_RELEASE__),X.SENTRY_RELEASE&&X.SENTRY_RELEASE.id&&(e.release=X.SENTRY_RELEASE.id)),e.autoSessionTracking===void 0&&(e.autoSessionTracking=!0),e.sendClientReports===void 0&&(e.sendClientReports=!0),rd(Zm,{...e,stackParser:Na(e.stackParser||wh),integrations:ku(e),transport:e.transport||(fo()?th:rh)}),e.autoSessionTracking&&Dg()}var Cg=(e={},t=_l())=>{if(!X.document){Fm&&W.error(`Global document not defined in showReportDialog call`);return}let{client:n,scope:r}=t.getStackTop(),i=e.dsn||n&&n.getDsn();if(!i){Fm&&W.error(`DSN not configured for showReportDialog call`);return}r&&(e.user={...r.getUser(),...e.user}),e.eventId||=t.lastEventId();let a=X.document.createElement(`script`);a.async=!0,a.crossOrigin=`anonymous`,a.src=Eu(i,e),e.onLoad&&(a.onload=e.onLoad);let{onClose:o}=e;if(o){let e=t=>{if(t.data===`__sentry_reportdialog_closed__`)try{o()}finally{X.removeEventListener(`message`,e)}};X.addEventListener(`message`,e)}let s=X.document.head||X.document.body;s?s.appendChild(a):Fm&&W.error(`Not injecting report dialog. No injection point found in HTML`)};function wg(){}function Tg(e){e()}function Eg(e){return Pm(e)()}function Dg(){if(X.document===void 0){Fm&&W.warn(`Session tracking in non-browser environment with @sentry/browser is not supported.`);return}Gc({ignoreDuration:!0}),Jc(),jo(({from:e,to:t})=>{e!==void 0&&e!==t&&(Gc({ignoreDuration:!0}),Jc())})}function Og(e){let t=q();t&&t.captureUserFeedback(e)}var kg=s({Breadcrumbs:()=>kh,Dedupe:()=>zh,GlobalHandlers:()=>Yh,HttpContext:()=>og,LinkedErrors:()=>dg,TryCatch:()=>hg}),Ag=qi,jg=`sentryReplaySession`,Mg=`replay_event`,Ng=`Unable to send Replay`,Pg=3e5,Fg=9e5,Ig=5e3,Lg=5500,Rg=6e4,zg=5e3,Bg=3,Vg=15e4,Hg=5e3,Ug=3e3,Wg=300,Gg=2e7,Kg=4999,qg=15e3,Jg=36e5;function Yg(e,t){return e??t()}function Xg(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var Zg;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})(Zg||={});function Qg(e){return e.nodeType===e.ELEMENT_NODE}function $g(e){return Xg([Xg([e,`optionalAccess`,e=>e.host]),`optionalAccess`,e=>e.shadowRoot])===e}function e_(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function t_(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(` background-clip: text;`,` -webkit-background-clip: text; background-clip: text;`)),e}function n_(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function r_(e){try{let t=e.rules||e.cssRules;return t?t_(Array.from(t,i_).join(``)):null}catch{return null}}function i_(e){let t;if(o_(e))try{t=r_(e.styleSheet)||n_(e)}catch{}else if(s_(e)&&e.selectorText.includes(`:`))return a_(e.cssText);return t||e.cssText}function a_(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function o_(e){return`styleSheet`in e}function s_(e){return`selectorText`in e}var c_=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){return e?Yg(Xg([this,`access`,e=>e.getMeta,`call`,t=>t(e),`optionalAccess`,e=>e.id]),()=>-1):-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);
40this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function l_(){return new c_}function u_({maskInputOptions:e,tagName:t,type:n}){return t===`OPTION`&&(t=`SELECT`),!!(e[t.toLowerCase()]||n&&e[n]||n===`password`||t===`INPUT`&&!n&&e.text)}function d_({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||``;return e?(r&&(i=r(i,t)),`*`.repeat(i.length)):i}function f_(e){return e.toLowerCase()}function p_(e){return e.toUpperCase()}var m_=`__rrweb_original__`;function h_(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=m_ in i?i[m_]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function g_(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?f_(t):null}function __(e,t,n){return t===`INPUT`&&(n===`radio`||n===`checkbox`)?e.getAttribute(`value`)||``:e.value}var v_=1,y_=RegExp(`[^a-z0-9-_:]`),b_=-2;function x_(){return v_++}function S_(e){if(e instanceof HTMLFormElement)return`form`;let t=f_(e.tagName);return y_.test(t)?`div`:t}function C_(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var w_,T_,E_=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D_=/^(?:[a-z+]+:)?\/\//i,O_=/^www\..*/i,k_=/^(data:)([^,]*),(.*)/i;function A_(e,t){return(e||``).replace(E_,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(D_.test(s)||O_.test(s)||k_.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${C_(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}var j_=/^[^ \t\n\r\u000c]+/,M_=/^[, \t\n\r\u000c]+/;function N_(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(M_),!(n>=t.length);){let a=r(j_);if(a.slice(-1)===`,`)a=P_(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=P_(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}function P_(e,t){if(!t||t.trim()===``)return t;let n=e.createElement(`a`);return n.href=t,n.href}function F_(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function I_(){let e=document.createElement(`a`);return e.href=``,e.href}function L_(e,t,n,r,i,a){return r&&(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`)?P_(e,r):n===`srcset`?N_(e,r):n===`style`?A_(r,I_()):t===`object`&&n===`data`?P_(e,r):typeof a==`function`?a(n,r,i):r)}function R_(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function z_(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function B_(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function V_(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:V_(e.parentNode,t,n,r+1)}function H_(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(B_(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function U_(e,t,n,r,i,a){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName===`INPUT`){let e=o.getAttribute(`autocomplete`);if([`current-password`,`new-password`,`cc-number`,`cc-exp`,`cc-exp-month`,`cc-exp-year`,`cc-csc`].includes(e))return!0}let s=-1,c=-1;if(a){if(c=V_(o,H_(r,i)),c<0)return!0;s=V_(o,H_(t,n),c>=0?c:1/0)}else{if(s=V_(o,H_(t,n)),s<0)return!1;c=V_(o,H_(r,i),s>=0?s:1/0)}return s>=0?c>=0?s<=c:!0:c>=0?!1:!!a}catch{}return!!a}function W_(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=setTimeout(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return setTimeout(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function G_(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let a=setTimeout(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(a),r=!0,t()})}function K_(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={}
40,maskTextFn:h,maskInputFn:g,dataURLOptions:_={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x=!1}=t,S=q_(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:Zg.Document,childNodes:[]}:{type:Zg.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:Zg.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Y_(e,{doc:n,blockClass:i,blockSelector:a,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:_,inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x,rootId:S,maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f});case e.TEXT_NODE:return J_(e,{maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:h,maskInputOptions:m,maskInputFn:g,rootId:S});case e.CDATA_SECTION_NODE:return{type:Zg.CDATA,textContent:``,rootId:S};case e.COMMENT_NODE:return{type:Zg.Comment,textContent:e.textContent||``,rootId:S};default:return!1}}function q_(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function J_(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:a,unmaskTextSelector:o,maskTextFn:s,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,f=e.textContent,p=d===`STYLE`||void 0,m=d===`SCRIPT`||void 0,h=d===`TEXTAREA`||void 0;if(p&&f){try{e.nextSibling||e.previousSibling||Xg([e,`access`,e=>e.parentNode,`access`,e=>e.sheet,`optionalAccess`,e=>e.cssRules])&&(f=r_(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}f=A_(f,I_())}m&&(f=`SCRIPT_PLACEHOLDER`);let g=U_(e,r,a,i,o,n);return!p&&!m&&!h&&f&&g&&(f=s?s(f,e.parentElement):f.replace(/[\S]/g,`*`)),h&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,`*`)),d===`OPTION`&&f&&(f=d_({isMasked:U_(e,r,a,i,o,u_({type:null,tagName:d,maskInputOptions:c})),element:e,value:f,maskInputFn:l})),{type:Zg.Text,textContent:f||``,isStyle:p,rootId:u}}function Y_(e,t){let{doc:n,blockClass:r,blockSelector:i,unblockSelector:a,inlineStylesheet:o,maskInputOptions:s={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskAllText:g,maskTextClass:_,unmaskTextClass:v,maskTextSelector:y,unmaskTextSelector:b}=t,x=z_(e,r,i,a),S=S_(e),C={},w=e.attributes.length;for(let t=0;t<w;t++){let r=e.attributes[t];r.name&&!R_(S,r.name,r.value)&&(C[r.name]=L_(n,S,f_(r.name),r.value,e,c))}if(S===`link`&&o){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=r_(t)),r&&(delete C.rel,delete C.href,C._cssText=A_(r,t.href))}if(S===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){let t=r_(e.sheet);t&&(C._cssText=A_(t,I_()))}if(S===`input`||S===`textarea`||S===`select`||S===`option`){let t=e,n=g_(t),r=__(t,p_(S),n),i=t.checked;if(n!==`submit`&&n!==`button`&&r){let e=U_(t,_,y,v,b,u_({type:n,tagName:p_(S),maskInputOptions:s}));C.value=d_({isMasked:e,element:t,value:r,maskInputFn:l})}i&&(C.checked=i)}if(S===`option`&&(e.selected&&!s.select?C.selected=!0:delete C.selected),S===`canvas`&&f){if(e.__context===`2d`)h_(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!(`__context`in e)){let t=e.toDataURL(u.type,u.quality),n=document.createElement(`canvas`);n.width=e.width,n.height=e.height,t!==n.toDataURL(u.type,u.quality)&&(C.rr_dataURL=t)}}if(S===`img`&&d){w_||(w_=n.createElement(`canvas`),T_=w_.getContext(`2d`));let t=e,r=t.crossOrigin;t.crossOrigin=`anonymous`;let i=()=>{t.removeEventListener(`load`,i);try{w_.width=t.naturalWidth,w_.height=t.naturalHeight,T_.drawImage(t,0,0),C.rr_dataURL=w_.toDataURL(u.type,u.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}r?C.crossOrigin=r:t.removeAttribute(`crossorigin`)};t.complete&&t.naturalWidth!==0?i():t.addEventListener(`load`,i)}if((S===`audio`||S===`video`)&&(C.rr_mediaState=e.paused?`paused`:`played`,C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${n}px`}}S===`iframe`&&!p(C.src)&&(e.contentDocument||(C.rr_src=C.src),delete C.src);let T;
40try{customElements.get(S)&&(T=!0)}catch{}return{type:Zg.Element,tagName:S,attributes:C,childNodes:[],isSVG:F_(e)||void 0,needBlock:x,rootId:h,isCustom:T}}function X_(e){return e==null?``:e.toLowerCase()}function Z_(e,t){return!!(t.comment&&e.type===Zg.Comment||e.type===Zg.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`||e.attributes.rel===`modulepreload`)&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&e.attributes.href.endsWith(`.js`))||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(X_(e.attributes.name).match(/^msapplication-tile(image|color)$/)||X_(e.attributes.name)===`application-name`||X_(e.attributes.rel)===`icon`||X_(e.attributes.rel)===`apple-touch-icon`||X_(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&X_(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(X_(e.attributes.property).match(/^(og|twitter|fb):/)||X_(e.attributes.name).match(/^(og|twitter):/)||X_(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(X_(e.attributes.name)===`robots`||X_(e.attributes.name)===`googlebot`||X_(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(X_(e.attributes.name)===`author`||X_(e.attributes.name)===`generator`||X_(e.attributes.name)===`framework`||X_(e.attributes.name)===`publisher`||X_(e.attributes.name)===`progid`||X_(e.attributes.property).match(/^article:/)||X_(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(X_(e.attributes.name)===`google-site-verification`||X_(e.attributes.name)===`yandex-verification`||X_(e.attributes.name)===`csrf-token`||X_(e.attributes.name)===`p:domain_verify`||X_(e.attributes.name)===`verify-v1`||X_(e.attributes.name)===`verification`||X_(e.attributes.name)===`shopify-checkout-api-token`))))}function Q_(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:x=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onStylesheetLoad:T,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:O=!1}=t,{preserveWhiteSpace:k=!0}=t,A=K_(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:x,keepIframeSrcFn:D,newlyAddedElement:O});if(!A)return console.warn(e,`not serialized`),null;let j;j=r.hasNode(e)?r.getId(e):Z_(A,v)||!k&&A.type===Zg.Text&&!A.isStyle&&!A.textContent.replace(/^\s+|\s+$/gm,``).length?b_:x_();let M=Object.assign(A,{id:j});if(r.add(e,M),j===b_)return null;S&&S(e);let N=!f;if(M.type===Zg.Element){N&&=!M.needBlock,delete M.needBlock;let t=e.shadowRoot;t&&e_(t)&&(M.isShadowHost=!0)}if((M.type===Zg.Document||M.type===Zg.Element)&&N){v.headWhitespace&&M.type===Zg.Element&&M.tagName===`head`&&(k=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:k,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:T,stylesheetLoadTimeout:E,keepIframeSrcFn:D};for(let n of Array.from(e.childNodes)){let e=Q_(n,t);e&&M.childNodes.push(e)}if(Qg(e)&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=Q_(n,t);r&&(e_(e.shadowRoot)&&(r.isShadow=!0),M.childNodes.push(r))}}return e.parentNode&&$g(e.parentNode)&&e_(e.parentNode)&&(M.isShadow=!0),M.type===Zg.Element&&M.tagName===`iframe`&&W_(e,()=>{let t=e.contentDocument;if(t&&C){let n=Q_(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:k,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:T,stylesheetLoadTimeout:E,keepIframeSrcFn:D});n&&C(e,n)}},w),M.type===Zg.Element&&M.tagName===`link`&&M.attributes.rel===`stylesheet`&&G_(e,()=>{if(T){let t=Q_(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:k,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:T,stylesheetLoadTimeout:E,keepIframeSrcFn:D});t&&T(e,t)}},E),M}function $_(e,t){let{mirror:n=new c_,blockClass:r=`rr-block`,blockSelector:i=null,unblockSelector:a=null,maskAllText:o=!1,maskTextClass:s=`rr-mask`,unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inl
40ineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onStylesheetLoad:w,stylesheetLoadTimeout:T,keepIframeSrcFn:E=()=>!1}=t||{};return Q_(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:s,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:p,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onStylesheetLoad:w,stylesheetLoadTimeout:T,keepIframeSrcFn:E,newlyAddedElement:!1})}function ev(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}function tv(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var nv=`Please stop import mirror directly. Instead of that,\r
41now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
42or you can use record.mirror to access the mirror instance during recording.`,rv={map:{},getId(){return console.error(nv),-1},getNode(){return console.error(nv),null},removeNodeFromMap(){console.error(nv)},has(){return console.error(nv),!1},reset(){console.error(nv)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(rv=new Proxy(rv,{get(e,t,n){return t===`map`&&console.error(nv),Reflect.get(e,t,n)}}));function iv(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(Av(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=kv(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function av(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){kv(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>av(e,t,a||{},!0)}function ov(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var sv=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(sv=()=>new Date().getTime());function cv(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?ev([t,`optionalAccess`,e=>e.documentElement,`access`,e=>e.scrollLeft])||ev([t,`optionalAccess`,e=>e.body,`optionalAccess`,e=>e.parentElement,`optionalAccess`,e=>e.scrollLeft])||ev([t,`optionalAccess`,e=>e.body,`optionalAccess`,e=>e.scrollLeft])||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?ev([t,`optionalAccess`,e=>e.documentElement,`access`,e=>e.scrollTop])||ev([t,`optionalAccess`,e=>e.body,`optionalAccess`,e=>e.parentElement,`optionalAccess`,e=>e.scrollTop])||ev([t,`optionalAccess`,e=>e.body,`optionalAccess`,e=>e.scrollTop])||0:e.pageYOffset}}function lv(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function uv(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function dv(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function fv(e,t,n,r,i){if(!e)return!1;let a=dv(e);if(!a)return!1;let o=H_(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=V_(a,o),c=-1;return s<0?!1:(r&&(c=V_(a,H_(null,r))),s>-1&&c<0||s<c)}function pv(e,t){return t.getId(e)!==-1}function mv(e,t){return t.getId(e)===b_}function hv(e,t){if($g(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:!e.parentNode||hv(e.parentNode,t):!0}
42function gv(e){return!!e.changedTouches}function _v(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError(`1 argument is required`);do if(this===t)return!0;while(t&&=t.parentNode);return!1})}function vv(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function yv(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function bv(e){return!!ev([e,`optionalAccess`,e=>e.shadowRoot])}var xv=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return Xs(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Sv(e){let t=null;return ev([e,`access`,e=>e.getRootNode,`optionalCall`,e=>e(),`optionalAccess`,e=>e.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Cv(e){let t=e,n;for(;n=Sv(t);)t=n;return t}function wv(e){let t=e.ownerDocument;if(!t)return!1;let n=Cv(e);return t.contains(n)}function Tv(e){let t=e.ownerDocument;return t?t.contains(e)||wv(e):!1}var Ev={};function Dv(e){let t=Ev[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return Ev[e]=r.bind(window)}function Ov(...e){return Dv(`requestAnimationFrame`)(...e)}function kv(...e){return Dv(`setTimeout`)(...e)}function Av(...e){return Dv(`clearTimeout`)(...e)}var jv=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(jv||{}),Mv=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(Mv||{}),Nv=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(Nv||{}),Pv=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(Pv||{});function Fv(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}function Iv(e){return`__ln`in e}var Lv=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=Fv([t,`optionalAccess`,e=>e.next])||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Iv(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Iv(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;
42this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Rv=(e,t)=>`${e}@${t}`,zv=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new Lv,r=e=>{let t=e,n=b_;for(;n===b_;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!Tv(i))return;let a=$g(i.parentNode)?this.mirror.getId(Sv(i)):this.mirror.getId(i.parentNode),o=r(i);if(a===-1||o===-1)return n.addNode(i);let s=Q_(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{vv(e,this.mirror)&&this.iframeManager.addIframe(e),yv(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),bv(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});s&&(e.push({parentId:a,nextId:o,node:s}),t.add(s.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)Vv(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(let e of this.addedSet)!Uv(this.droppedSet,e)&&!Vv(this.removes,e,this.mirror)||Uv(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(a.value.parentNode),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(r(n.value)===-1)continue;if(t!==-1){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(this.mirror.getId(r)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!mv(e.target,this.mirror))switch(e.type){case`characterData`:{let t=e.target.textContent;!fv(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:U_(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,dv(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let n=g_(t),i=t.tagName;r=__(t,i,n);let a=u_({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=d_({isMasked:U_(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a),element:t,value:r,maskInputFn:this.maskInputFn})}if(fv(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!t.contentDocument)n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}
42,this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!R_(t.tagName,n)&&(i.attributes[n]=L_(this.doc,f_(t.tagName),f_(n),r,t,this.maskAttributeFn),n===`style`)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||a!==n.style.getPropertyPriority(e)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}break}case`childList`:if(fv(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=$g(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);fv(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||mv(t,this.mirror)||!pv(t,this.mirror)||(this.addedSet.has(t)?(Bv(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||hv(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Rv(n,r)]?Bv(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:$g(e.target)&&e_(e.target)?!0:void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(mv(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[Rv(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);fv(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),bv(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){`mutationCb.blockClass.blockSelector.unblockSelector.maskAllText.maskTextClass.unmaskTextClass.maskTextSelector.unmaskTextSelector.inlineStylesheet.maskInputOptions.maskAttributeFn.maskTextFn.maskInputFn.keepIframeSrcFn.recordCanvas.inlineImages.slimDOMOptions.dataURLOptions.doc.mirror.iframeManager.stylesheetManager.shadowDomManager.canvasManager.processedNodeManager`.split(`.`).forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Bv(e,t){e.delete(t),t.childNodes.forEach(t=>Bv(e,t))}function Vv(e,t,n){return e.length!==0&&Hv(e,t,n)}function Hv(e,t,n){let{parentNode:r}=t;if(!r)return!1;let i=n.getId(r);return e.some(e=>e.id===i)?!0:Hv(e,r,n)}function Uv(e,t){return e.size!==0&&Wv(e,t)}function Wv(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:Wv(e,n):!1}var Gv;function Kv(e){Gv=e}function qv(){Gv=void 0}var Jv=e=>Gv?((...t)=>{try{return e(...t)}catch(e){if(Gv&&Gv(e)===!0)return()=>{};throw e}}):e;function Yv(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var Xv=[];function Zv(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Qv(e,t){let n=new zv;Xv.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=Yv([window,`optionalAccess`,e=>e.Zone,`optionalAccess`,e=>e.__symbol__,`optionalCall`,e=>e(`MutationObserver`)]);i&&window[i]&&(r=window[i]);let a=new r(Jv(t=>{e.onMutation&&e.onMutation(t)===!1||n.processMutations.bind(n)(t)}));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function $v({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=iv(Jv(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=Jv(iv(Jv(e=>{let t=Zv(e),{clientX:n,clientY:i}=gv(e)?e.changedTouches[0]:e;s||=sv(),o.push({x:n,y:i,id:r.getId(t),timeOffset:sv()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?Mv.Drag:e instanceof MouseEvent?Mv.MouseMove:Mv.TouchMove)}),i,{trailing:!1})),u=[tv(`mousemove`,l,n),tv(`touchmove`,l,n),tv(`drag`,l,n)];return Jv(()=>
42{u.forEach(e=>e())})}function ey({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],l=null,u=t=>o=>{let s=Zv(o);if(fv(s,r,i,a,!0))return;let c=null,u=t;if(`pointerType`in o){switch(o.pointerType){case`mouse`:c=Pv.Mouse;break;case`touch`:c=Pv.Touch;break;case`pen`:c=Pv.Pen}c===Pv.Touch?Nv[t]===Nv.MouseDown?u=`TouchStart`:Nv[t]===Nv.MouseUp&&(u=`TouchEnd`):Pv.Pen}else gv(o)&&(c=Pv.Touch);c===null?Nv[t]===Nv.Click&&(c=l,l=null):(l=c,(u.startsWith(`Touch`)&&c===Pv.Touch||u.startsWith(`Mouse`)&&c===Pv.Mouse)&&(c=null));let d=gv(o)?o.changedTouches[0]:o;if(!d)return;let f=n.getId(s),{clientX:p,clientY:m}=d;Jv(e)({type:Nv[u],id:f,x:p,y:m,...c!==null&&{pointerType:c}})};return Object.keys(Nv).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&s[e]!==!1).forEach(e=>{let n=f_(e),r=u(e);if(window.PointerEvent)switch(Nv[e]){case Nv.MouseDown:case Nv.MouseUp:n=n.replace(`mouse`,`pointer`);break;case Nv.TouchStart:case Nv.TouchEnd:return}c.push(tv(n,r,t))}),Jv(()=>{c.forEach(e=>e())})}function ty({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){return tv(`scroll`,Jv(iv(Jv(o=>{let s=Zv(o);if(!s||fv(s,r,i,a,!0))return;let c=n.getId(s);if(s===t&&t.defaultView){let n=cv(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function ny({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return tv(`resize`,Jv(iv(Jv(()=>{let t=lv(),i=uv();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var ry=[`INPUT`,`TEXTAREA`,`SELECT`],iy=new WeakMap;function ay({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(e){let n=Zv(e),u=e.isTrusted,g=n&&p_(n.tagName);if(g===`OPTION`&&(n=n.parentElement),!n||!g||ry.indexOf(g)<0||fv(n,r,i,a,!0))return;let v=n;if(v.classList.contains(o)||s&&v.matches(s))return;let y=g_(n),b=__(v,g,y),x=!1,S=u_({maskInputOptions:c,tagName:g,type:y}),C=U_(n,f,m,p,h,S);(y===`radio`||y===`checkbox`)&&(x=n.checked),b=d_({isMasked:C,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:x,userTriggered:u}:{text:b,isChecked:x});let w=n.name;y===`radio`&&w&&x&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(e=>{if(e!==n){let t=d_({isMasked:C,element:e,value:__(e,g,y),maskInputFn:l});_(e,d?{text:t,isChecked:!x,userTriggered:!1}:{text:t,isChecked:!x})}})}function _(t,r){let i=iy.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){iy.set(t,r);let i=n.getId(t);Jv(e)({...r,id:i})}}let v=(u.input===`last`?[`change`]:[`input`,`change`]).map(e=>tv(e,Jv(g),t)),y=t.defaultView;if(!y)return()=>{v.forEach(e=>e())};let b=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,`value`),x=[[y.HTMLInputElement.prototype,`value`],[y.HTMLInputElement.prototype,`checked`],[y.HTMLSelectElement.prototype,`value`],[y.HTMLTextAreaElement.prototype,`value`],[y.HTMLSelectElement.prototype,`selectedIndex`],[y.HTMLOptionElement.prototype,`selected`]];return b&&b.set&&v.push(...x.map(e=>av(e[0],e[1],{set(){Jv(g)({target:this,isTrusted:!1})}},!1,y))),Jv(()=>{v.forEach(e=>e())})}function oy(e){let t=[];function n(e,t){if(gy(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||gy(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||gy(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||gy(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function sy(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function cy({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Jv((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=sy(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Jv((r,i,a)=>{let[o]=a,{id:s,styleId:c}=sy(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})});let o;
42r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Jv((r,i,a)=>{let[o]=a,{id:s,styleId:c}=sy(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Jv((r,i,a)=>{let[o]=a,{id:s,styleId:c}=sy(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};_y(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(_y(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),_y(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),_y(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Jv((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=sy(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...oy(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Jv((r,i,a)=>{let[o]=a,{id:s,styleId:c}=sy(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...oy(i),o]}]}),r.apply(i,a)})})}),Jv(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function ly({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(n.host);let i=n.nodeName===`#document`?Yv([n,`access`,e=>e.defaultView,`optionalAccess`,e=>e.Document]):Yv([n,`access`,e=>e.ownerDocument,`optionalAccess`,e=>e.defaultView,`optionalAccess`,e=>e.ShadowRoot]),a=Yv([i,`optionalAccess`,e=>e.prototype])?Object.getOwnPropertyDescriptor(Yv([i,`optionalAccess`,e=>e.prototype]),`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return Yv([a,`access`,e=>e.get,`optionalAccess`,e=>e.call,`call`,e=>e(this)])},set(e){let n=Yv([a,`access`,e=>e.set,`optionalAccess`,e=>e.call,`call`,t=>t(this,e)]);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),Jv(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function uy({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jv((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=sy(Yv([o,`access`,e=>e.parentRule,`optionalAccess`,e=>e.parentStyleSheet]),t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:oy(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Jv((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=sy(Yv([a,`access`,e=>e.parentRule,`optionalAccess`,e=>e.parentStyleSheet]),t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:oy(a.parentRule)}),i.apply(a,s)})}),Jv(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function dy({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:a,doc:o}){let s=Jv(o=>iv(Jv(a=>{let s=Zv(a);if(!s||fv(s,t,n,r,!0))return;let{currentTime:c,volume:l,muted:u,playbackRate:d}=s;e({type:o,id:i.getId(s),currentTime:c,volume:l,muted:u,playbackRate:d})}),a.media||500)),c=[tv(`play`,s(0),o),tv(`pause`,s(1),o),tv(`seeked`,s(2),o),tv(`volumechange`,s(3),o),tv(`ratechange`,s(4),o)];return Jv(()=>
42{c.forEach(e=>e())})}function fy({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=ov(t.fonts,`add`,function(t){return function(n){return kv(Jv(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),Jv(()=>{r.forEach(e=>e())})}function py(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,selectionCb:o}=e,s=!0,c=Jv(()=>{let e=t.getSelection();if(!e||s&&Yv([e,`optionalAccess`,e=>e.isCollapsed]))return;s=e.isCollapsed||!1;let c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=e.getRangeAt(t);fv(o,r,i,a,!0)||fv(l,r,i,a,!0)||c.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:c})});return c(),tv(`selectionchange`,c)}function my({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:ov(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{}return e.apply(this,[n,r,i])}})}function hy(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r=Qv(e,e.doc),i=$v(e),a=ey(e),o=ty(e),s=ny(e,{win:n}),c=ay(e),l=dy(e),u=cy(e,{win:n}),d=ly(e,e.doc),f=uy(e,{win:n}),p=e.collectFonts?fy(e):()=>{},m=py(e),h=my(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return Jv(()=>{Xv.forEach(e=>e.reset()),r.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function gy(e){return window[e]!==void 0}function _y(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}var vy=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}
42getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}};function yy(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var by=class{constructor(){this.crossOriginIframeMirror=new vy(x_),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},xy=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new vy(x_),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vy(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),yy([this,`access`,e=>e.loadListener,`optionalCall`,t=>t(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case jv.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:jv.IncrementalSnapshot,data:{source:Mv.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case jv.Meta:case jv.Load:case jv.DomContentLoaded:return!1;case jv.Plugin:return t;case jv.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case jv.IncrementalSnapshot:switch(t.data.source){case Mv.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Mv.Drag:case Mv.TouchMove:case Mv.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Mv.ViewportResize:return!1;case Mv.MediaInteraction:case Mv.MouseInteraction:case Mv.Scroll:case Mv.CanvasMutation:case Mv.In
42put:return this.replaceIds(t.data,e,[`id`]),t;case Mv.StyleSheetRule:case Mv.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case Mv.Font:return t;case Mv.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case Mv.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),yy([t,`access`,e=>e.data,`access`,e=>e.styles,`optionalAccess`,e=>e.forEach,`call`,t=>t(t=>{this.replaceStyleIds(t,e,[`styleId`])})]),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==Zg.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Sy=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Cy=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!e_(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let n=Qv({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(ty({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),kv(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(ly({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(ov(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&Tv(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},wy=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}},Ty=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new xv,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:i_(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Ey=class{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){Ov(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}},Dy,Oy,ky=l_();function Ay(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,unblockSelector:o=null,ignoreClass:s=`rr-ignore`,ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u=`rr-mask`,unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,maxCanvasSize:x=null,packFn:S,sampling:C={},dataURLOptions:w={},mousemoveWait:T,recordCanvas:E=!1,recordCrossOriginIframes:D=!1,recordAfter:O=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:k=!1,collectFonts:A=!1,inlineImages:j=!1,plugins:M,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:ee,onMutation:te,getCanvasManager:ne}=e;Kv(ee);let F=!D||window.parent===window,re=!1;if(!F)try{window.parent.document&&(re=!1)}catch{re=!0}if(F&&!t)throw Error(`emit function is required`);
42T!==void 0&&C.mousemove===void 0&&(C.mousemove=T),ky.reset();let ie=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g===void 0?{}:g,I=_===!0||_===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_===`all`,headMetaDescKeywords:_===`all`}:_||{};_v();let ae,oe=0,se=e=>{for(let t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!re&&(e=S(e)),e};Dy=(e,i)=>{let a=e;if(a.timestamp=sv(),Zs([Xv,`access`,e=>e[0],`optionalAccess`,e=>e.isFrozen,`call`,e=>e()])&&a.type!==jv.FullSnapshot&&(a.type!==jv.IncrementalSnapshot||a.data.source!==Mv.Mutation)&&Xv.forEach(e=>e.unfreeze()),F)Zs([t,`optionalCall`,e=>e(se(a),i)]);else if(re){let e={type:`rrweb`,event:se(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===jv.FullSnapshot)ae=a,oe=0;else if(a.type===jv.IncrementalSnapshot){if(a.data.source===Mv.Mutation&&a.data.isAttachIframe)return;oe++;let e=r&&oe>=r,t=n&&ae&&a.timestamp-ae.timestamp>n;(e||t)&&ge(!0)}};let ce=e=>{Dy({type:jv.IncrementalSnapshot,data:{source:Mv.Mutation,...e}})},le=e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.Scroll,...e}}),ue=e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.CanvasMutation,...e}}),de=new Ty({mutationCb:ce,adoptedStyleSheetCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.AdoptedStyleSheet,...e}})}),fe=typeof __RRWEB_EXCLUDE_IFRAME__==`boolean`&&__RRWEB_EXCLUDE_IFRAME__?new by:new xy({mirror:ky,mutationCb:ce,stylesheetManager:de,recordCrossOriginIframes:D,wrappedEmit:Dy});for(let e of M||[])e.getMirror&&e.getMirror({nodeMirror:ky,crossOriginIframeMirror:fe.crossOriginIframeMirror,crossOriginIframeStyleMirror:fe.crossOriginIframeStyleMirror});let pe=new Ey,me=My(ne,{mirror:ky,win:window,mutationCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.CanvasMutation,...e}}),recordCanvas:E,blockClass:i,blockSelector:a,unblockSelector:o,maxCanvasSize:x,sampling:C.canvas,dataURLOptions:w,errorHandler:ee}),he=typeof __RRWEB_EXCLUDE_SHADOW_DOM__==`boolean`&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Sy:new Cy({mutationCb:ce,scrollCb:le,bypassOptions:{onMutation:te,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:ie,dataURLOptions:w,maskAttributeFn:v,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:j,sampling:C,slimDOMOptions:I,iframeManager:fe,stylesheetManager:de,canvasManager:me,keepIframeSrcFn:N,processedNodeManager:pe},mirror:ky}),ge=(e=!1)=>{Dy({type:jv.Meta,data:{href:window.location.href,width:uv(),height:lv()}},e),de.reset(),he.init(),Xv.forEach(e=>e.lock());let t=$_(document,{mirror:ky,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:ie,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,slimDOM:I,dataURLOptions:w,recordCanvas:E,inlineImages:j,onSerialize:e=>{vv(e,ky)&&fe.addIframe(e),yv(e,ky)&&de.trackLinkElement(e),bv(e)&&he.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{fe.attachIframe(e,t),he.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{de.attachLinkElement(e,t)},keepIframeSrcFn:N});if(!t)return console.warn(`Failed to snapshot the document`);Dy({type:jv.FullSnapshot,data:{node:t,initialOffset:cv(window)}}),Xv.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&de.adoptStyleSheets(document.adoptedStyleSheets,ky.getId(document))};Oy=ge;try{let e=[],t=e=>Jv(hy)({onMutation:te,mutationCb:ce,mousemoveCb:(e,t)=>Dy({type:jv.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.MouseInteraction,...e}}),scrollCb:le,viewportResizeCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.ViewportResize,...e}}),inputCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.Input,...e}}),mediaInteractionCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.MediaInteraction,...e}}),styleSheetRuleCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.StyleSheetRule,...e}}),styleDeclarationCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.StyleDeclaration,...e}}),canvasMutationCb:ue,fontCb:e=>Dy({type:jv.IncrementalSnapshot,data:{source:Mv.Font,...e}}),selectionCb:e=>{Dy({type:jv.IncrementalSnapshot,data:{source:Mv.Selection,...e}})},customElementCb:e=>{Dy({type:jv.IncrementalSnapshot,data:{source:Mv.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:ie,inlineStylesheet:m,sampling:C,recordCanvas:E,inlineImages:j,userTriggeredOnInput:k,collectFonts:A,doc:e,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,keepIframeSrcFn:N,blockSelector:a,unblockSelector:o,slimDOMOptions:I,dataURLOptions:w,mirror:ky,iframeManager:fe,stylesheetManager:de,shadowDomManager:he,processedNodeManager:pe,canvasManager:me,ignoreCSSAttributes:P,plugins:Zs([M,`optionalAccess`,e=>e.filter,`call`,e=>e(e=>e.observer),`optionalAccess`,e=>e.map,`call`,e=>e(e=>({observer:e.observer,options:e.options,callback:t=>Dy({type:jv.Plugin,data:{plugin:e.name,payload:t}}
42)}))])||[]},{});fe.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{ge(),e.push(t(document))};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(tv(`DOMContentLoaded`,()=>{Dy({type:jv.DomContentLoaded,data:{}}),O===`DOMContentLoaded`&&n()})),e.push(tv(`load`,()=>{Dy({type:jv.Load,data:{}}),O===`load`&&n()},window))),()=>{e.forEach(e=>e()),pe.destroy(),Oy=void 0,qv()}}catch(e){console.warn(e)}}function jy(e){if(!Oy)throw Error(`please take full snapshot after start recording`);Oy(e)}Ay.mirror=ky,Ay.takeFullSnapshot=jy;function My(e,t){try{return e?e(t):new wy}catch{return console.warn(`Unable to initialize CanvasManager`),new wy}}var Ny=3,Py=5;function Fy(e){return e>9999999999?e:e*1e3}function Iy(e){return e>9999999999?e/1e3:e}function Ly(e,t){t.category!==`sentry.transaction`&&([`ui.click`,`ui.input`].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:jv.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:`breadcrumb`,payload:Uo(t,10,1e3)}}),t.category===`console`)))}var Ry=`button,a`;function zy(e){return e.closest(Ry)||e}function By(e){let t=Vy(e);return!t||!(t instanceof Element)?t:zy(t)}function Vy(e){return Hy(e)?e.target:e}function Hy(e){return typeof e==`object`&&!!e&&`target`in e}var Uy;function Wy(e){return Uy||(Uy=[],Gy()),Uy.push(e),()=>{let t=Uy?Uy.indexOf(e):-1;t>-1&&Uy.splice(t,1)}}function Gy(){_a(Ag,`open`,function(e){return function(...t){if(Uy)try{Uy.forEach(e=>e())}catch{}return e.apply(Ag,t)}})}function Ky(e,t,n){e.handleClick(t,n)}var qy=class{constructor(e,t,n=Ly){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){let e=Wy(()=>{this._lastMutation=Zy()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(Yy(t,this._ignoreSelector)||!Xy(e))return;let n={timestamp:Iy(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=Iy(e)}registerScroll(e=Date.now()){this._lastScroll=Iy(e)}registerClick(e){let t=zy(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=Zy();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(let t of e){let e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(i){let n=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,r=n<this._timeout*1e3?`mutation`:`timeout`,i={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.slowClickDetected`,data:{...o.data,url:Ag.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,i);return}if(a>1){let e={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.multiClick`,data:{...o.data,url:Ag.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}},Jy=[`A`,`BUTTON`,`INPUT`];function Yy(e,t){return!!(!Jy.includes(e.tagName)||e.tagName===`INPUT`&&![`submit`,`button`].includes(e.getAttribute(`type`)||``)||e.tagName===`A`&&(e.hasAttribute(`download`)||e.hasAttribute(`target`)&&e.getAttribute(`target`)!==`_self`)||t&&e.matches(t))}
42function Xy(e){return!!(e.data&&typeof e.data.nodeId==`number`&&e.timestamp)}function Zy(){return Date.now()/1e3}function Qy(e,t){try{if(!$y(t))return;let{source:n}=t.data;if(n===Mv.Mutation&&e.registerMutation(t.timestamp),n===Mv.Scroll&&e.registerScroll(t.timestamp),eb(t)){let{type:n,id:r}=t.data,i=Ay.mirror.getNode(r);i instanceof HTMLElement&&n===Nv.Click&&e.registerClick(i)}}catch{}}function $y(e){return e.type===Ny}function eb(e){return e.data.source===Mv.MouseInteraction}function tb(e){return{timestamp:Date.now()/1e3,type:`default`,...e}}var nb;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})(nb||={});var rb=new Set([`id`,`class`,`aria-label`,`role`,`name`,`alt`,`title`,`data-test-id`,`data-testid`,`disabled`,`aria-disabled`,`data-sentry-component`]);function ib(e){let t={};for(let n in e)if(rb.has(n)){let r=n;(n===`data-testid`||n===`data-test-id`)&&(r=`testId`),t[r]=e[n]}return t}var ab=e=>t=>{if(!e.isEnabled())return;let n=sb(t);if(!n)return;let r=t.name===`click`,i=r?t.event:void 0;r&&e.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&Ky(e.clickDetector,n,By(t.event)),Ly(e,n)};function ob(e,t){let n=Ay.mirror.getId(e),r=n&&Ay.mirror.getNode(n),i=r&&Ay.mirror.getMeta(r),a=i&&lb(i)?i:null;return{message:t,data:a?{nodeId:n,node:{id:n,tagName:a.tagName,textContent:Array.from(a.childNodes).map(e=>e.type===nb.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(``),attributes:ib(a.attributes)}}:{}}}function sb(e){let{target:t,message:n}=cb(e);return tb({category:`ui.${e.name}`,...ob(t,n)})}function cb(e){let t=e.name===`click`,n,r=null;try{r=t?By(e.event):Vy(e.event),n=Qi(r,{maxStringLength:200})||`<unknown>`}catch{n=`<unknown>`}return{target:r,message:n}}function lb(e){return e.type===nb.Element}function ub(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=db(t);n&&Ly(e,n)}function db(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a,target:o}=e;if(!o||fb(o)||!a)return null;let s=t||r||i,c=a.length===1;if(!s&&c)return null;let l=Qi(o,{maxStringLength:200})||`<unknown>`;return tb({category:`ui.keyDown`,message:l,data:{...ob(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a}})}function fb(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}var pb={resource:yb,paint:_b,navigation:vb};function mb(e){return e.map(hb).filter(Boolean)}function hb(e){return pb[e.entryType]?pb[e.entryType](e):null}function gb(e){return((gs||Ag.performance.timeOrigin)+e)/1e3}function _b(e){let{duration:t,entryType:n,name:r,startTime:i}=e,a=gb(i);return{type:n,name:r,start:a,end:a+t,data:void 0}}function vb(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:a,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=e;return i===0?null:{type:`${t}.${h}`,start:gb(p),end:gb(a),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:a,redirectCount:f}}}function yb(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:a,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:l}=e;return[`fetch`,`xmlhttprequest`].includes(n)?null:{type:`${t}.${n}`,start:gb(a),end:gb(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:s}}}function bb(e){let t=e.entries,n=t[t.length-1],r=n?n.element:void 0,i=e.value,a=gb(i);return{type:`largest-contentful-paint`,name:`largest-contentful-paint`,start:a,end:a,data:{value:i,size:i,nodeId:r?Ay.mirror.getId(r):void 0}}}function xb(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return[`navigation`,`paint`,`resource`].forEach(e=>{r.push(lp(e,n))}),r.push(ap(({metric:t})=>{e.replayPerformanceEntries.push(bb(t))})),()=>{r.forEach(e=>e())}}var Sb=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Cb=`var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}
vendor: 5,353 bytes, line 42
42},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;
42++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;function wb(){let e=new Blob([Cb]);return URL.createObjectURL(e)}function Tb(e,t){Sb&&(W.info(e),t&&Db(e))}function Eb(e,t){Sb&&(W.info(e),t&&setTimeout(()=>{Db(e)},0))}function Db(e){kc({category:`console`,data:{logger:`replay`},level:`info`,message:e},{level:`info`})}
42var Ob=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Gg}.`)}},kb=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return`sync`}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>Gg)throw new Ob;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=this.events.map(e=>e.timestamp).sort()[0];return e?Fy(e):null}},Ab=class{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||=new Promise((e,t)=>{this._worker.addEventListener(`message`,({data:n})=>{n.success?e():t()},{once:!0}),this._worker.addEventListener(`error`,e=>{t(e)},{once:!0})}),this._ensureReadyPromise}destroy(){Tb(`[Replay] Destroying compression worker`),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{let a=({data:t})=>{let o=t;if(o.method===e&&o.id===n){if(this._worker.removeEventListener(`message`,a),!o.success){Sb&&W.error(`[Replay]`,o.response),i(Error(`Error in compression worker`));return}r(o.response)}};this._worker.addEventListener(`message`,a),this._worker.postMessage({id:n,method:e,arg:t})})}_getAndIncrementId(){return this._id++}},jb=class{constructor(e){this._worker=new Ab(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return`worker`}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=Fy(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>Gg?Promise.reject(new Ob):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage(`clear`).then(null,e=>{Sb&&W.warn(`[Replay] Sending "clear" message to worker failed`,e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage(`addEvent`,e)}async _finishRequest(){let e=await this._worker.postMessage(`finish`);return this._earliestTimestamp=null,this._totalSize=0,e}},Mb=class{constructor(e){this._fallback=new kb,this._compression=new jb(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{Tb(`[Replay] Failed to load the compression worker, falling back to simple buffer`);return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t}=this._fallback,n=[];for(let t of e)n.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n)}catch(e){Sb&&W.warn(`[Replay] Failed to add events when switching buffers.`,e)}}};function Nb({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=Pb(t);if(e)return e}return Tb(`[Replay] Using simple buffer`),new kb}function Pb(e){try{let t=e||Fb();return t?(Tb(`[Replay] Using compression worker${e?` from ${e}`:``}`),new Mb(new Worker(t))):void 0}catch{Tb(`[Replay] Failed to create compression worker`)}}function Fb(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>`u`||!__SENTRY_EXCLUDE_REPLAY_WORKER__?wb():``}function Ib(){try{return`sessionStorage`in Ag&&!!Ag.sessionStorage}catch{return!1}}
42function Lb(e){Rb(),e.session=void 0}function Rb(){if(Ib())try{Ag.sessionStorage.removeItem(jg)}catch{}}function zb(e){return e!==void 0&&Math.random()<e}function Bb(e){let t=Date.now();return{id:e.id||Wa(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId}}function Vb(e){if(Ib())try{Ag.sessionStorage.setItem(jg,JSON.stringify(e))}catch{}}function Hb(e,t){return zb(e)?`session`:t?`buffer`:!1}function Ub({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=Bb({sampled:Hb(e,t),previousSessionId:r});return n&&Vb(i),i}function Wb(e){if(!Ib())return null;try{let t=Ag.sessionStorage.getItem(jg);if(!t)return null;let n=JSON.parse(t);return Eb(`[Replay] Loading existing session`,e),Bb(n)}catch{return null}}function Gb(e,t,n=+new Date){return e===null||t===void 0||t<0||t!==0&&e+t<=n}function Kb(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Gb(e.started,t,r)||Gb(e.lastActivity,n,r)}function qb(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Kb(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled===`buffer`&&e.segmentId===0)}function Jb({traceInternals:e,sessionIdleExpire:t,maxReplayDuration:n,previousSessionId:r},i){let a=i.stickySession&&Wb(e);return a?qb(a,{sessionIdleExpire:t,maxReplayDuration:n})?(Eb(`[Replay] Session in sessionStorage is expired, creating new one...`),Ub(i,{previousSessionId:a.id})):a:(Eb(`[Replay] Creating new session`,e),Ub(i,{previousSessionId:r}))}function Yb(e){return e.type===jv.Custom}function Xb(e,t,n){return $b(e,t)?(Qb(e,t,n),!0):!1}function Zb(e,t,n){return $b(e,t)?Qb(e,t,n):Promise.resolve(null)}async function Qb(e,t,n){if(!e.eventBuffer)return null;try{n&&e.recordingMode===`buffer`&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);let r=ex(t,e.getOptions().beforeAddRecordingEvent);return r?await e.eventBuffer.addEvent(r):void 0}catch(t){let n=t&&t instanceof Ob?`addEventSizeExceeded`:`addEvent`;Sb&&W.error(t),await e.stop({reason:n});let r=q();r&&r.recordDroppedEvent(`internal_sdk_error`,`replay`)}}function $b(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=Fy(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Tb(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1):!0}function ex(e,t){try{if(typeof t==`function`&&Yb(e))return t(e)}catch(e){return Sb&&W.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",e),null}return e}function tx(e){return!e.type}function nx(e){return e.type===`transaction`}function rx(e){return e.type===`replay_event`}function ix(e){return e.type===`feedback`}function ax(e){let t=cx();return(n,r)=>{if(!e.isEnabled()||!tx(n)&&!nx(n))return;let i=r&&r.statusCode;if(!(t&&(!i||i<200||i>=300))){if(nx(n)){ox(e,n);return}sx(e,n)}}}function ox(e,t){let n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function sx(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!==`buffer`||!t.tags||!t.tags.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r==`function`&&!r(t)||setTimeout(()=>{e.sendBufferedReplayOrFlush()})}function cx(){let e=q();if(!e)return!1;let t=e.getTransport();return t&&t.send.__sentry__baseTransport__||!1}function lx(e){return t=>{!e.isEnabled()||!tx(t)||ux(e,t)}}function ux(e,t){let n=t.exception&&t.exception.values&&t.exception.values[0].value;typeof n==`string`&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&Ly(e,tb({category:`replay.hydrate-error`}))}function dx(e,t){return e.type||!e.exception||!e.exception.values||!e.exception.values.length?!1:!!(t.originalException&&t.originalException.__rrweb__)}function fx(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:jv.Custom,timestamp:t.timestamp*1e3,data:{tag:`breadcrumb`,payload:{timestamp:t.timestamp,type:`default`,category:`sentry.feedback`,data:{feedbackId:t.event_id}}}}),!1))}function px(e,t){return e.recordingMode!==`buffer`||t.message===Ng||!t.exception||t.type?!1:zb(e.getOptions().errorSampleRate)}function mx(e,t=!1){let n=t?ax(e):void 0;return Object.assign((t,r)=>e.isEnabled()?rx(t)?(delete t.breadcrumbs,t):!tx(t)&&!nx(t)&&!ix(t)||!e.checkAndHandleExpiredSession()?t:ix(t)?(e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),fx(e,t),t):dx(t,r)&&!e.getOptions()._experiments.captureExceptions?(Sb&&W.log(`[Replay] Ignoring error from rrweb internals`,t),null):((px(e,t)||e.recordingMode===`session`)&&(t.tags={...t.tags,replayId:e.getSessionId()}),n&&n(t,{statusCode:200}),t):t,{id:`Replay`})}function hx(e,t){return t.map(({type:t,start:n,end:r,name:i,data:a})=>{let o=e.throttledAddEvent({type:jv.Custom,timestamp:n,data:{tag:`performanceSpan`,payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:a}}});return typeof o==`string`?Promise.resolve(null):o})}function gx(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:`navigation.push`,start:r,end:r,name:n,data:{previous:t}}}function _x(e){return t=>{if(!e.isEnabled())return;let n=gx(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(hx(e,[n]),!1)))}}function vx(e,t){return Sb&&e.getOptions()._experiments.traceInternals?!1:vd(t,q())}function yx(e,t){e.isEnabled()&&t!==null&&(vx(e,t.name)||e.addUpdate(()=>(hx(e,[t]),!0)))}function bx(e){let{startTimestamp:t,endTimestamp:n,fetchData:r,response:i}=e;if(!n)return null;let{method:a,url:o}=r;return{type:`resource.fetch`,start:t/1e3,end:n/1e3,name:o,data:{method:a,statusCode:i?i.status:void 0}}}function xx(e){return t=>{e.isEnabled()&&yx(e,bx(t))}}function Sx(e){let{startTimestamp:t,endTimestamp:n,xhr:r}=e,i=r[Po];if(!t||!n||!i)return null;let{method:a,url:o,status_code:s}=i;return o===void 0?null:{type:`resource.xhr`,name:o,start:t/1e3,end:n/1e3,data:{method:a,statusCode:s}}}function Cx(e){return t=>{e.isEnabled()&&yx(e,Sx(t))}}function wx(e,t){if(e)try{if(typeof e==`string`)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=Mx(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Tx(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Ex(e){try{if(typeof e==`string`)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Mx(e)];if(!e)return[void 0]}catch{return Sb&&W.warn(`[Replay] Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Sb&&W.info(`[Replay] Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function Dx(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta};return n.warnings=[...n.warnings||[],t],e._meta=n,e}function Ox(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:a,statusCode:o,request:s,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:Ea({method:a,statusCode:o,request:s,response:c})}}function kx(e){return{headers:{},size:e,_meta:{warnings:[`URL_SKIPPED`]}}}function Ax(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:a}=Nx(n);return r.body=i,a&&a.length>0&&(r._meta={warnings:a}),r}function jx(e,t){return Object.keys(e).reduce((n,r)=>{let i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=e[r]),n},{})}function Mx(e){return new URLSearchParams(e).toString()}function Nx(e){if(!e||typeof e!=`string`)return{body:e};let t=e.length>Vg,n=Px(e);if(t){let t=e.slice(0,Vg);return n?{body:t,warnings:[`MAYBE_JSON_TRUNCATED`]}:{body:`${t}…`,warnings:[`TEXT_TRUNCATED`]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function Px(e){let t=e[0],n=e[e.length-1];return t===`[`&&n===`]`||t===`{`&&n===`}`}function Fx(e,t){return Bi(Ix(e),t)}function Ix(e,t=Ag.document.baseURI){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(Ag.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith(`/`)&&r.endsWith(`/`)?r.slice(0,-1):r}async function Lx(e,t,n){try{let r=Ox(`resource.fetch`,await zx(e,t,n));yx(n.replay,r)}catch(e){Sb&&W.error(`[Replay] Failed to capture fetch breadcrumb`,e)}}
42function Rx(e,t,n){let{input:r,response:i}=t,a=wx(r?Wx(r):void 0,n.textEncoder),o=i?Tx(i.headers.get(`content-length`)):void 0;a!==void 0&&(e.data.request_body_size=a),o!==void 0&&(e.data.response_body_size=o)}async function zx(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:s,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=Fx(o,n.networkDetailAllowUrls)&&!Fx(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:a,url:o,method:s,statusCode:c,request:d?Bx(n,t.input,l):kx(l),response:await Vx(d,n,t.response,u)}}function Bx({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?Kx(n,t):{};if(!e)return Ax(i,r,void 0);let[a,o]=Ex(Wx(n)),s=Ax(i,r,a);return o?Dx(s,o):s}async function Vx(e,{networkCaptureBodies:t,textEncoder:n,networkResponseHeaders:r},i,a){if(!e&&a!==void 0)return kx(a);let o=i?Gx(i.headers,r):{};if(!i||!t&&a!==void 0)return Ax(o,a,void 0);let[s,c]=await Ux(i),l=Hx(s,{networkCaptureBodies:t,textEncoder:n,responseBodySize:a,captureDetails:e,headers:o});return c?Dx(l,c):l}function Hx(e,{networkCaptureBodies:t,textEncoder:n,responseBodySize:r,captureDetails:i,headers:a}){try{let o=e&&e.length&&r===void 0?wx(e,n):r;return i?t?Ax(a,o,e):Ax(a,o,void 0):kx(o)}catch(e){return Sb&&W.warn(`[Replay] Failed to serialize response body`,e),Ax(a,r,void 0)}}async function Ux(e){let t=Jx(e);if(!t)return[void 0,`BODY_PARSE_ERROR`];try{return[await Yx(t)]}catch(e){return Sb&&W.warn(`[Replay] Failed to get text body from response`,e),[void 0,`BODY_PARSE_ERROR`]}}function Wx(e=[]){if(e.length===2&&typeof e[1]==`object`)return e[1].body}function Gx(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function Kx(e,t){return e.length===1&&typeof e[0]!=`string`?qx(e[0],t):e.length===2?qx(e[1],t):{}}function qx(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?Gx(n,t):Array.isArray(n)?{}:jx(n,t):{}}function Jx(e){try{return e.clone()}catch(e){Sb&&W.warn(`[Replay] Failed to clone response body`,e)}}function Yx(e){return new Promise((t,n)=>{let r=setTimeout(()=>n(Error(`Timeout while trying to read response body`)),500);Xx(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}async function Xx(e){return await e.text()}async function Zx(e,t,n){try{let r=Ox(`resource.xhr`,$x(e,t,n));yx(n.replay,r)}catch(e){Sb&&W.error(`[Replay] Failed to capture xhr breadcrumb`,e)}}function Qx(e,t,n){let{xhr:r,input:i}=t;if(!r)return;let a=wx(i,n.textEncoder),o=r.getResponseHeader(`content-length`)?Tx(r.getResponseHeader(`content-length`)):rS(r.response,r.responseType,n.textEncoder);a!==void 0&&(e.data.request_body_size=a),o!==void 0&&(e.data.response_body_size=o)}function $x(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:s}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=e.data;if(!c)return null;if(!s||!Fx(c,n.networkDetailAllowUrls)||Fx(c,n.networkDetailDenyUrls))return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:kx(d),response:kx(f)};let p=s[Po],m=p?jx(p.request_headers,n.networkRequestHeaders):{},h=jx(eS(s),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?Ex(o):[void 0],[v,y]=n.networkCaptureBodies?tS(s):[void 0],b=Ax(m,d,g),x=Ax(h,f,v);return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:_?Dx(b,_):b,response:y?Dx(x,y):x}}function eS(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
43`).reduce((e,t)=>{let[n,r]=t.split(`: `);return e[n.toLowerCase()]=r,e},{}):{}}function tS(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return nS(e.response,e.responseType)}catch(e){t.push(e)}return Sb&&W.warn(`[Replay] Failed to get xhr response body`,...t),[void 0]}function nS(e,t){try{if(typeof e==`string`)return[e];if(e instanceof Document)return[e.body.outerHTML];if(t===`json`&&e&&typeof e==`object`)return[JSON.stringify(e)];if(!e)return[void 0]}catch{return Sb&&W.warn(`[Replay] Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Sb&&W.info(`[Replay] Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function rS(e,t,n){try{return wx(t===`json`&&e&&typeof e==`object`?JSON.stringify(e):e,n)}catch{return}}function iS(e){let t=q();try{let n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:a,networkRequestHeaders:o,networkResponseHeaders:s}=e.getOptions(),c={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:a,networkRequestHeaders:o,networkResponseHeaders:s};t&&t.on?t.on(`beforeAddBreadcrumb`,(e,t)=>aS(c,e,t)):(go(xx(e)),G(Cx(e)))}catch{}}function aS(e,t,n){if(t.data)try{oS(t)&&cS(n)&&(Qx(t,n,e),Zx(t,n,e)),sS(t)&&lS(n)&&(Rx(t,n,e),Lx(t,n,e))}catch{Sb&&W.warn(`Error when enriching network breadcrumb`)}}function oS(e){return e.category===`xhr`}function sS(e){return e.category===`fetch`}function cS(e){return e&&e.xhr}function lS(e){return e&&e.response}var uS=null;function dS(e){return!!e.category}var fS=e=>t=>{if(!e.isEnabled())return;let n=pS(t);n&&Ly(e,n)};function pS(e){let t=e.getLastBreadcrumb&&e.getLastBreadcrumb();return uS===t||!t||(uS=t,!dS(t)||[`fetch`,`xhr`,`sentry.event`,`sentry.transaction`].includes(t.category)||t.category.startsWith(`ui.`))?null:t.category===`console`?mS(t):tb(t)}function mS(e){let t=e.data&&e.data.arguments;if(!Array.isArray(t)||t.length===0)return tb(e);let n=!1,r=t.map(e=>{if(!e)return e;if(typeof e==`string`)return e.length>Hg?(n=!0,`${e.slice(0,Hg)}…`):e;if(typeof e==`object`)try{let t=Uo(e,7);return JSON.stringify(t).length>Hg?(n=!0,`${JSON.stringify(t,null,2).slice(0,Hg)}…`):t}catch{}return e});return tb({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:[`CONSOLE_ARG_TRUNCATED`]}}:{}}})}function hS(e){let t=Wc(),n=q();t.addScopeListener(fS(e)),ro(ab(e)),jo(_x(e)),iS(e);let r=mx(e,!gS(n));n&&n.addEventProcessor?n.addEventProcessor(r):ed(r),gS(n)&&(n.on(`beforeSendEvent`,lx(e)),n.on(`afterSendEvent`,ax(e)),n.on(`createDsc`,t=>{let n=e.getSessionId();n&&e.isEnabled()&&e.recordingMode===`session`&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),n.on(`startTransaction`,t=>{e.lastTransaction=t}),n.on(`finishTransaction`,t=>{e.lastTransaction=t}),n.on(`beforeSendFeedback`,(t,n)=>{let r=e.getSessionId();n&&n.includeReplay&&e.isEnabled()&&r&&t.contexts&&t.contexts.feedback&&(t.contexts.feedback.replay_id=r)}))}function gS(e){return!!(e&&e.on)}async function _S(e){try{return Promise.all(hx(e,[vS(Ag.performance.memory)]))}catch{return[]}}function vS(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:`memory`,name:`memory`,start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function yS(e,t,n){let r,i,a,o=n&&n.maxWait?Math.max(n.maxWait,t):0;function s(){return c(),r=e(),r}function c(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function l(){return i!==void 0||a!==void 0?s():r}function u(){return i&&clearTimeout(i),i=setTimeout(s,t),o&&a===void 0&&(a=setTimeout(s,o)),r}return u.cancel=c,u.flush=l,u}function bS(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){Sb&&W.warn(`[Replay] Received replay event after session expired.`);return}let i=r||!t;t=!0,e.clickDetector&&Qy(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode===`buffer`&&i&&e.setInitialState(),!Xb(e,n,i))return!0;
43if(!i)return!1;if(SS(e,i),e.session&&e.session.previousSessionId)return!0;if(e.recordingMode===`buffer`&&e.session&&e.eventBuffer){let t=e.eventBuffer.getEarliestTimestamp();t&&(Tb(`[Replay] Updating session start time to earliest event in buffer to ${new Date(t)}`,e.getOptions()._experiments.traceInternals),e.session.started=t,e.getOptions().stickySession&&Vb(e.session))}return e.recordingMode===`session`&&e.flush(),!0})}}function xS(e){let t=e.getOptions();return{type:jv.Custom,timestamp:Date.now(),data:{tag:`options`,payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type===`worker`:!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function SS(e,t){!t||!e.session||e.session.segmentId!==0||Xb(e,xS(e),!1)}function CS(e,t,n,r){return ks(Vs(e,Bs(e),r,n),[[{type:`replay_event`},e],[{type:`replay_recording`,length:typeof t==`string`?new TextEncoder().encode(t).length:t.length},t]])}function wS({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
44`;if(typeof e==`string`)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}async function TS({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:typeof e._integrations==`object`&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit&&e.emit(`preprocessEvent`,r,i);let a=await pc(e.getOptions(),r,i,t,e,vl());if(!a)return null;a.platform=a.platform||`javascript`;let o=e.getSdkMetadata&&e.getSdkMetadata(),{name:s,version:c}=o&&o.sdk||{};return a.sdk={...a.sdk,name:s||`sentry.javascript.unknown`,version:c||`0.0.0`},a}async function ES({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:a}){let o=wS({recordingData:e,headers:{segment_id:n}}),{urls:s,errorIds:c,traceIds:l,initialTimestamp:u}=r,d=q(),f=Wc(),p=d&&d.getTransport(),m=d&&d.getDsn();if(!d||!p||!m||!a.sampled)return;let h={type:Mg,replay_start_timestamp:u/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,urls:s,replay_id:t,segment_id:n,replay_type:a.sampled},g=await TS({scope:f,client:d,replayId:t,event:h});if(!g){d.recordDroppedEvent(`event_processor`,`replay`,h),Tb("An event processor returned `null`, will not send event.");return}delete g.sdkProcessingMetadata;let _=CS(g,o,m,d.getOptions().tunnel),v;try{v=await p.send(_)}catch(e){let t=Error(Ng);try{t.cause=e}catch{}throw t}if(!v)return v;if(typeof v.statusCode==`number`&&(v.statusCode<200||v.statusCode>=300))throw new DS(v.statusCode);let y=qs({},v);if(Ks(y,`replay`))throw new OS(y);return v}var DS=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},OS=class extends Error{constructor(e){super(`Rate limit hit`),this.rateLimits=e}};async function kS(e,t={count:0,interval:zg}){let{recordingData:n,options:r}=e;if(n.length)try{return await ES(e),!0}catch(n){if(n instanceof DS||n instanceof OS)throw n;if(Ac(`Replays`,{_retryCount:t.count}),Sb&&r._experiments&&r._experiments.captureExceptions&&Tc(n),t.count>=Bg){let e=Error(`${Ng} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{setTimeout(async()=>{try{await kS(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}var AS=`__THROTTLED`,jS=`__SKIPPED`;function MS(e,t,n){let r=new Map,i=e=>{let t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})},a=()=>[...r.values()].reduce((e,t)=>e+t,0),o=!1;return(...n)=>{let s=Math.floor(Date.now()/1e3);if(i(s),a()>=t){let e=o;return o=!0,e?jS:AS}o=!1;let c=r.get(s)||0;return r.set(s,c+1),e(...n)}}var NS=class e{constructor({options:t,recordingOptions:n}){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this),e.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode=`session`,this.timeouts={sessionIdlePause:Pg,sessionIdleExpire:Fg},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:``},this._recordingOptions=n,this._options=t,this._debouncedFlush=yS(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=MS((e,t)=>Zb(this,e,t),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:i}=this.getOptions(),a=r?{threshold:Math.min(Ug,r),timeout:r,scrollTimeout:Wg,ignoreSelector:i?i.join(`,`):``}:void 0;a&&(this.clickDetector=new qy(this,a))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options;if(!(t<=0&&n<=0)){if(this._initializeSessionForSampling(e),!this.session){this._handleException(Error(`Unable to initialize and create session`));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled===`buffer`&&this.session.segmentId===0?`buffer`:`session`,Eb(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}
44start(){if(this._isEnabled&&this.recordingMode===`session`)throw Error(`Replay recording is already in progress`);if(this._isEnabled&&this.recordingMode===`buffer`)throw Error("Replay buffering is in progress, call `flush()` to save the replay");Eb(`[Replay] Starting replay in session mode`,this._options._experiments.traceInternals),this._updateUserActivity();let e=Jb({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw Error(`Replay recording is already in progress`);Eb(`[Replay] Starting replay in buffer mode`,this._options._experiments.traceInternals);let e=Jb({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode=`buffer`,this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=Ay({...this._recordingOptions,...this.recordingMode===`buffer`&&{checkoutEveryNms:Rg},emit:bS(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&=(this._stopRecording(),void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1;try{Tb(`[Replay] Stopping Replay${t?` triggered by ${t}`:``}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Lb(this)}catch(e){this._handleException(e)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Tb(`[Replay] Pausing replay`,this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Tb(`[Replay] Resuming replay`,this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode===`session`)return this.flushImmediate();let t=Date.now();Tb(`[Replay] Converting buffer to session`,this._options._experiments.traceInternals),await this.flushImmediate();let n=this.stopRecording();!e||!n||this.recordingMode!==`session`&&(this.recordingMode=`session`,this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){let t=e();this.recordingMode!==`buffer`&&t!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode===`buffer`?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&Gb(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled===`session`){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${Ag.location.pathname}${Ag.location.hash}${Ag.location.search}`,t=`${Ag.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===AS){let e=tb({category:`replay.throttled`});this.addUpdate(()=>!Xb(this,{type:Py,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastTransaction||Wc().getTransaction(),t=(e&&uc(e).data||{})[Ql];if(!(!e||!t||![`route`,`custom`].includes(t)))return uc(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Nb({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}
44_handleException(e){Sb&&W.error(`[Replay]`,e),Sb&&this._options._experiments&&this._options._experiments.captureExceptions&&Tc(e)}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=Jb({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!qb(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:`refresh session`}),this.initializeSampling(e.id))}_addListeners(){try{Ag.document.addEventListener(`visibilitychange`,this._handleVisibilityChange),Ag.addEventListener(`blur`,this._handleWindowBlur),Ag.addEventListener(`focus`,this._handleWindowFocus),Ag.addEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||=(hS(this),!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=xb(this)}_removeListeners(){try{Ag.document.removeEventListener(`visibilitychange`,this._handleVisibilityChange),Ag.removeEventListener(`blur`,this._handleWindowBlur),Ag.removeEventListener(`focus`,this._handleWindowFocus),Ag.removeEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{Ag.document.visibilityState===`visible`?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{let e=tb({category:`ui.blur`});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{let e=tb({category:`ui.focus`});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{ub(this,e)}}_doChangeToBackgroundTasks(e){this.session&&(Kb(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush()))}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){Tb(`[Replay] Document has become active, but session has expired`);return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:jv.Custom,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e}})})}_addPerformanceEntries(){let e=mb(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(hx(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}
44_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Sb&&W.error(`[Replay] No session or eventBuffer found to flush.`);return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await _S(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw Error(`Session is too long, not sending replay`);let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession(),await kS({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:t})}catch(e){this._handleException(e),this.stop({reason:`sendReplay`});let t=q();t&&t.recordDroppedEvent(`send_error`,`replay`)}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Sb&&W.error(`[Replay] Attempting to finish replay event after session expired.`);return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){Tb(`[Replay] Session duration (${Math.floor(n/1e3)}s) is too ${r?`short`:`long`}, not sending replay.`,this._options._experiments.traceInternals),r&&this._debouncedFlush();return}let a=this.eventBuffer;if(a&&this.session.segmentId===0&&!a.hasCheckout&&Tb(`[Replay] Flushing initial segment without checkout.`,this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(e){Sb&&W.error(e)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Vb(this.session)}__init6(){this._onMutationHandler=e=>{let t=e.length,n=this._options.mutationLimit,r=this._options.mutationBreadcrumbLimit,i=n&&t>n;if(t>r||i){let e=tb({category:`replay.mutations`,data:{count:t,limit:i}});this._createCustomBreadcrumb(e)}return!i||(this.stop({reason:`mutationLimit`,forceFlush:this.recordingMode===`session`}),!1)}}};function PS(e,t,n,r){let i=typeof r==`string`?r.split(`,`):[],a=[...e,...i,...t];return n!==void 0&&(typeof n==`string`&&a.push(`.${n}`),sa(()=>{console.warn(`[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.`)})),a.join(`,`)}function FS({mask:e,unmask:t,block:n,unblock:r,ignore:i,blockClass:a,blockSelector:o,maskTextClass:s,maskTextSelector:c,ignoreClass:l}){let u={maskTextSelector:PS(e,[`.sentry-mask`,`[data-sentry-mask]`],s,c),unmaskTextSelector:PS(t,[`.sentry-unmask`,`[data-sentry-unmask]`]),blockSelector:PS(n,[`.sentry-block`,`[data-sentry-block]`,`base[href="/"]`],a,o),unblockSelector:PS(r,[`.sentry-unblock`,`[data-sentry-unblock]`]),ignoreSelector:PS(i,[`.sentry-ignore`,`[data-sentry-ignore]`,`input[type="file"]`],l)};return a instanceof RegExp&&(u.blockClass=a),s instanceof RegExp&&(u.maskTextClass=s),u}function IS({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:a}){return!r||i.unmaskTextSelector&&e.matches(i.unmaskTextSelector)?a:n.includes(t)||t===`value`&&e.tagName===`INPUT`&&[`submit`,`button`].includes(e.getAttribute(`type`)||``)?a.replace(/[\S]/g,`*`):a}var LS=`img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]`,RS=[`content-length`,`content-type`,`accept`],zS=!1,BS=(e=>new VS(e)),VS=class e{static __initStatic(){this.id=`Replay`}constructor({flushMinDelay:t=Ig,flushMaxDelay:n=Lg,minReplayDuration:r=Kg,maxReplayDuration:i=Jg,stickySession:a=!0,useCompression:o=!0,workerUrl:s,_experiments:c={},sessionSampleRate:l,errorSampleRate:u,maskAllText:d=!0,maskAllInputs:f=!0,blockAllMedia:p=!0,mutationBreadcrumbLimit:m=750,mutationLimit:h=1e4,slowClickTimeout:g=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:y=[],networkCaptureBodies:b=!0,networkRequestHeaders:x=[],networkResponseHeaders:S=[],mask:C=[],maskAttributes:w=[`title`,`placeholder`],unmask:T=[],block:E=[],unblock:D=[],ignore:O=[],maskFn:k,beforeAddRecordingEvent:A,beforeErrorSampling:j,blockClass:M,blockSelector:N,maskInputOptions:P,maskTextClass:ee,maskTextSelector:te,ignoreClass:ne}={}){this.name=e.id;let F=FS({mask:C,unmask:T,block:E,unblock:D,ignore:O,blockClass:M,blockSelector:N,maskTextClass:ee,maskTextSelector:te,ignoreClass:ne});if(this._recordingOptions={maskAllInputs:f,maskAllText:d,maskInputOptions:{...P||{},password:!0},maskTextFn:k,maskInputFn:k,maskAttributeFn:(e,t,n)=>IS({maskAttributes:w,maskAllText:d,privacyOptions:F,key:e,value:t,el:n}),...F,slimDOMOptions:`all`,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,qg),maxReplayDuration:Math.min(i,Jg),stickySession:a,sessionSampleRate:l,errorSampleRate:u,useCompression:o,workerUrl:s,blockAllMedia:p,maskAllInputs:f,maskAllText:d,mutationBreadcrumbLimit:m,mutationLimit:h,slowClickTimeout:g,slowClickIgnoreSelectors:_,networkDetailAllowUrls:v,networkDetailDenyUrls:y,networkCaptureBodies:b,networkRequestHeaders:US(x),networkResponseHeaders:US(S),beforeAddRecordingEvent:A,beforeErrorSampling:j,_experiments:c},typeof l==`number`&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
45This option is deprecated and will be removed soon.
46Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
47Sentry.init({ replaysSessionSampleRate: ${l} })`),this._initialOptions.sessionSampleRate=l),typeof u==`number`&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
48This option is deprecated and will be removed soon.
49Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
50Sentry.init({ replaysOnErrorSampleRate: ${u} })`),this._initialOptions.errorSampleRate=u),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${LS}`:LS),this._isInitialized&&Bo())throw Error(`Multiple Sentry Session Replay instances are not supported`);this._isInitialized=!0}get _isInitialized(){return zS}set _isInitialized(e){zS=e}setupOnce(){Bo()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}
50startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode===`session`}):Promise.resolve()}flush(e){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(e)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){let e=HS(this._initialOptions);this._replay=new NS({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{let e=q().getIntegrationByName(`ReplayCanvas`);if(!e)return;this._replay._canvas=e.getOptions()}catch{}}};VS.__initStatic();function HS(e){let t=q(),n=t&&t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Ea(e)};return n?(e.sessionSampleRate==null&&e.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&sa(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate==`number`&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate==`number`&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(sa(()=>{console.warn(`SDK client is not available.`)}),r)}function US(e){return[...RS,...e.map(e=>e.toLowerCase())]}function WS(){let e=q();return e&&e.getIntegrationByName&&e.getIntegrationByName(`Replay`)}var GS;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})(GS||={});function KS(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function qS(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:qS(e.parentNode,t,n,r+1)}function JS(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(KS(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var YS=`Please stop import mirror directly. Instead of that,\r
51now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
52or you can use record.mirror to access the mirror instance during recording.`,XS={map:{},getId(){return console.error(YS),-1},getNode(){return console.error(YS),null},removeNodeFromMap(){console.error(YS)},has(){return console.error(YS),!1},reset(){console.error(YS)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(XS=new Proxy(XS,{get(e,t,n){return t===`map`&&console.error(YS),Reflect.get(e,t,n)}}));function ZS(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){iC(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>ZS(e,t,a||{},!0)}function QS(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString());function $S(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function eC(e,t,n,r,i){if(!e)return!1;let a=$S(e);if(!a)return!1;let o=JS(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=qS(a,o),c=-1;return s<0?!1:(r&&(c=qS(a,JS(null,r))),s>-1&&c<0||s<c)}var tC={};function nC(e){let t=tC[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return tC[e]=r.bind(window)}function rC(...e){return nC(`requestAnimationFrame`)(...e)}function iC(...e){return nC(`setTimeout`)(...e)}var aC=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(aC||{}),oC;function sC(e){oC=e}for(var cC=e=>oC?((...t)=>{try{return e(...t)}catch(e){if(oC&&oC(e)===!0)return()=>{};throw e}}):e,lC=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
52+/`,uC=typeof Uint8Array>`u`?[]:new Uint8Array(256),dC=0;dC<lC.length;dC++)uC[lC.charCodeAt(dC)]=dC;var fC=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=lC[t[n]>>2],i+=lC[(t[n]&3)<<4|t[n+1]>>4],i+=lC[(t[n+1]&15)<<2|t[n+2]>>6],i+=lC[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},pC=new Map;function mC(e,t){let n=pC.get(e);return n||(n=new Map,pC.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var hC=(e,t,n)=>{if(!e||!(vC(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=mC(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function gC(e,t,n){if(e instanceof Array)return e.map(e=>gC(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:fC(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gC(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[gC(e.data,t,n),e.width,e.height]}:vC(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:hC(e,t,n)}:e}var _C=(e,t,n)=>e.map(e=>gC(e,t,n)),vC=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function yC(e,t,n,r,i){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!=`function`)continue;let o=QS(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return eC(this.canvas,n,r,i,!0)||iC(()=>{let n=_C(o,t,this);e(this.canvas,{type:aC[`2D`],property:s,args:n})},0),a.apply(this,o)}});a.push(o)}catch{let n=ZS(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:aC[`2D`],property:s,args:[t],setter:!0})}});a.push(n)}return()=>{a.forEach(e=>e())}}function bC(e){return e===`experimental-webgl`?`webgl`:e}function xC(e,t,n,r,i){let a=[];try{let o=QS(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(a,...o){if(!eC(this,t,n,r,!0)){let e=bC(a);if(`__context`in this||(this.__context=e),i&&[`webgl`,`webgl2`].includes(e))if(o[0]&&typeof o[0]==`object`){let e=o[0];e.preserveDrawingBuffer||=!0}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{a.forEach(e=>e())}}function SC(e,t,n,r,i,a,o,s){let c=[],l=Object.getOwnPropertyNames(e);for(let o of l)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(o))try{if(typeof e[o]!=`function`)continue;let l=QS(e,o,function(e){return function(...c){let l=e.apply(this,c);if(hC(l,s,this),`tagName`in this.canvas&&!eC(this.canvas,r,i,a,!0)){let e=_C(c,s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{let r=ZS(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(r)}return c}function CC(e,t,n,r,i,a){let o=[];return o.push(...SC(t.WebGLRenderingContext.prototype,aC.WebGL,e,n,r,i,a,t)),t.WebGL2RenderingContext!==void 0&&o.push(...SC(t.WebGL2RenderingContext.prototype,aC.WebGL2,e,n,r,i,a,t)),()=>{o.forEach(e=>e())}}var wC=`for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;
52if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};`;function TC(){let e=new Blob([wC]);return URL.createObjectURL(e)}var EC=class{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};let{sampling:t=`all`,win:n,blockClass:r,blockSelector:i,unblockSelector:a,maxCanvasSize:o,recordCanvas:s,dataURLOptions:c,errorHandler:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,l&&sC(l),!e.enableManualSnapshot&&cC(()=>{s&&t===`all`&&this.initCanvasMutationObserver(n,r,i,a),s&&typeof t==`number`&&this.initCanvasFPSObserver(t,n,r,i,a,o,{dataURLOptions:c})})()}initCanvasFPSObserver(e,t,n,r,i,a,o){let s=xC(t,n,r,i,!0),c=this.takeSnapshot(!1,e,t,n,r,i,a,o.dataURLOptions);this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=xC(e,t,n,r,!1),a=yC(this.processMutation.bind(this),e,t,n,r),o=CC(this.processMutation.bind(this),e,t,n,r,this.mirror);this.resetObservers=()=>{i(),a(),o()}}snapshot(e){let{options:t}=this,n=this.takeSnapshot(!0,t.sampling===`all`?2:t.sampling||2,t.win,t.blockClass,t.blockSelector,t.unblockSelector,t.maxCanvasSize,t.dataURLOptions,e);this.resetObservers=()=>{cancelAnimationFrame(n)}}takeSnapshot(e,t,n,r,i,a,o,s,c){let l=new Map,u=new Worker(TC());u.onmessage=e=>{let t=e.data,{id:n}=t;if(l.set(n,!1),!(`base64`in t))return;let{base64:r,type:i,width:a,height:o}=t;this.mutationCb({id:n,type:aC[`2D`],commands:[{property:`clearRect`,args:[0,0,a,o]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:r}],type:i}]},0,0,a,o]}]})};let d=1e3/t,f=0,p,m=e=>{if(e)return[e];let t=[];return n.document.querySelectorAll(`canvas`).forEach(e=>{eC(e,r,i,a,!0)||t.push(e)}),t},h=t=>{if(f&&t-f<d){p=rC(h);return}f=t,m(c).forEach(t=>{let n=this.mirror.getId(t);if(!l.get(n)&&!(!t.width||!t.height)){if(l.set(n,!0),!e&&[`webgl`,`webgl2`].includes(t.__context)){let e=t.getContext(t.__context);Zs([e,`optionalAccess`,e=>e.getContextAttributes,`call`,e=>e(),`optionalAccess`,e=>e.preserveDrawingBuffer])===!1&&e.clear(e.COLOR_BUFFER_BIT)}createImageBitmap(t).then(e=>{u.postMessage({id:n,bitmap:e,width:t.width,height:t.height,dataURLOptions:s,maxCanvasSize:o},[e])}).catch(e=>{cC(()=>{throw e})()})}}),p=rC(h)};return p=rC(h),p}startPendingCanvasMutationFlusher(){rC(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,rC(e)};rC(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),rC(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},DC={low:{sampling:{canvas:1},dataURLOptions:{type:`image/webp`,quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:`image/webp`,quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:`image/webp`,quality:.5}}},OC=`ReplayCanvas`,kC=1280,AC=J(((e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||`medium`,enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,kC):kC,n?Math.min(n,kC):kC]},i,a=new Promise(e=>i=e);return{name:OC,setupOnce(){},getOptions(){let{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{let r=new EC({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{typeof e==`object`&&(e.__rrweb__=!0)}catch{}}});return i(r),r},...DC[e||`medium`]||DC.medium}},async snapshot(e){(await a).snapshot(e)}}})),jC=Fu(OC,AC),MC=qi,NC=`#ffffff`,PC=`inherit`,FC=`rgba(108, 95, 199, 1)`,IC={fontFamily:`system-ui, 'Helvetica Neue', Arial, sans-serif`,fontSize:`14px`,background:NC,backgroundHover:`#f6f6f7`,foreground:`#2b2233`,border:`1.5px solid rgba(41, 35, 47, 0.13)`,borderRadius:`25px`,boxShadow:`0px 4px 24px 0px rgba(43, 34, 51, 0.12)`,success:`#268d75`,error:`#df3338`,submitBackgroun
52d:`rgba(88, 74, 192, 1)`,submitBackgroundHover:FC,submitBorder:FC,submitOutlineFocus:`#29232f`,submitForeground:NC,submitForegroundHover:NC,cancelBackground:`transparent`,cancelBackgroundHover:`var(--background-hover)`,cancelBorder:`var(--border)`,cancelOutlineFocus:`var(--input-outline-focus)`,cancelForeground:`var(--foreground)`,cancelForegroundHover:`var(--foreground)`,inputBackground:PC,inputForeground:PC,inputBorder:`var(--border)`,inputOutlineFocus:FC,formBorderRadius:`20px`,formContentBorderRadius:`6px`},LC={light:IC,dark:{...IC,background:`#29232f`,backgroundHover:`#352f3b`,foreground:`#ebe6ef`,border:`1.5px solid rgba(235, 230, 239, 0.15)`,success:`#2da98c`,error:`#f55459`}},RC=`Report a Bug`,zC=`Cancel`,BC=`Send Bug Report`,VC=`Report a Bug`,HC=`[email protected]`,UC=`Email`,WC=`What's the bug? What did you expect?`,GC=`Description`,KC=`Your Name`,qC=`Name`,JC=`(required)`,YC=`Thank you for your report!`,XC=`widget`,ZC=`api`;async function QC({client:e,scope:t,event:n}){let r={};e.emit&&e.emit(`preprocessEvent`,n,r);let i=await pc(e.getOptions(),n,r,t,e,vl());return i===null?(e.recordDroppedEvent(`event_processor`,`feedback`,n),null):(i.platform=i.platform||`javascript`,i)}async function $C({feedback:{message:e,email:t,name:n,source:r,url:i}},{includeReplay:a=!0}={}){let o=q(),s=o&&o.getTransport(),c=o&&o.getDsn();if(!o||!s||!c)return;let l={contexts:{feedback:{contact_email:t,name:n,message:e,url:i,source:r}},type:`feedback`};return Ic(async e=>{e.clearBreadcrumbs(),[ZC,XC].includes(String(r))&&e.setLevel(`info`);let t=await QC({scope:e,client:o,event:l});if(!t)return;o.emit&&o.emit(`beforeSendFeedback`,t,{includeReplay:!!a});let n=bu(t,c,o.getOptions()._metadata,o.getOptions().tunnel),i;try{i=await s.send(n)}catch(e){let t=Error(`Unable to send Feedback`);try{t.cause=e}catch{}throw t}if(i){if(typeof i.statusCode==`number`&&(i.statusCode<200||i.statusCode>=300))throw Error(`Unable to send Feedback`);return i}})}function ew({name:e,email:t,message:n,source:r=ZC,url:i=ea()},a={}){if(!n)throw Error(`Unable to submit feedback with empty message`);return $C({feedback:{name:e,email:t,message:n,url:i,source:r}},a)}var tw=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function nw(e,t){return{...e,...t,themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function rw(e){let t=e.createElement(`style`);return t.textContent=`
53.widget__actor {
54  position: fixed;
55  left: var(--left);
56  right: var(--right);
57  bottom: var(--bottom);
58  top: var(--top);
59  z-index: var(--z-index);
60
61  line-height: 16px;
62
63  display: flex;
64  align-items: center;
65  gap: 8px;
66
67  border-radius: var(--border-radius);
68  cursor: pointer;
69  font-family: inherit;
70  font-size: var(--font-size);
71  font-weight: 600;
72  padding: 16px;
73  text-decoration: none;
74  z-index: 9000;
75
76  color: var(--foreground);
77  background-color: var(--background);
78  border: var(--border);
79  box-shadow: var(--box-shadow);
80  opacity: 1;
81  transition: opacity 0.1s ease-in-out;
82}
83
84.widget__actor:hover {
85  background-color: var(--background-hover);
86}
87
88.widget__actor svg {
89  width: 16px;
90  height: 16px;
91}
92
93.widget__actor--hidden {
94  opacity: 0;
95  pointer-events: none;
96  visibility: hidden;
97}
98
99.widget__actor__text {
100}
101
102@media (max-width: 600px) {
103  .widget__actor__text {
104    display: none;
105  }
106}
107
108.feedback-icon path {
109  fill: var(--foreground);
110}
111`,t}function iw(e){let t=e.createElement(`style`);return t.textContent=`
112.dialog {
113  line-height: 25px;
114  background-color: rgba(0, 0, 0, 0.05);
115  border: none;
116  position: fixed;
117  inset: 0;
118  z-index: 10000;
119  width: 100vw;
120  height: 100vh;
121  display: flex;
122  align-items: center;
123  justify-content: center;
124  opacity: 1;
125  transition: opacity 0.2s ease-in-out;
126}
127
128.dialog:not([open]) {
129  opacity: 0;
130  pointer-events: none;
131  visibility: hidden;
132}
133.dialog:not([open]) .dialog__content {
134  transform: translate(0, -16px) scale(0.98);
135}
136
137.dialog__content {
138  position: fixed;
139  left: var(--left);
140  right: var(--right);
141  bottom: var(--bottom);
142  top: var(--top);
143
144  border: var(--border);
145  border-radius: var(--form-border-radius);
146  background-color: var(--background);
147  color: var(--foreground);
148
149  width: 320px;
150  max-width: 100%;
151  max-height: calc(100% - 2rem);
152  display: flex;
153  flex-direction: column;
154  box-shadow: var(--box-shadow);
155  transition: transform 0.2s ease-in-out;
156  transform: translate(0, 0) scale(1);
157}
158
159.dialog__header {
160  display: flex;
161  align-items: center;
162  justify-content: space-between;
163  font-size: 20px;
164  font-weight: 600;
165  padding: 24px 24px 0 24px;
166  margin: 0;
167  margin-bottom: 16px;
168}
169
170.brand-link {
171  display: inline-flex;
172}
173
174.error {
175  color: var(--error);
176  margin-bottom: 16px;
177}
178
179.form {
180  display: grid;
181  overflow: auto;
182  flex-direction: column;
183  gap: 16px;
184  padding: 0 24px 24px;
185}
186
187.form__error-container {
188  color: var(--error);
189}
190
191.form__error-container--hidden {
192  display: none;
193}
194
195.form__label {
196  display: flex;
197  flex-direction: column;
198  gap: 4px;
199  margin: 0px;
200}
201
202.form__label__text {
203  display: grid;
204  gap: 4px;
205  align-items: center;
206  grid-auto-flow: column;
207  grid-auto-columns: max-content;
208}
209
210.form__label__text--required {
211  font-size: 0.85em;
212}
213
214.form__input {
215  line-height: inherit;
216  background-color: var(--input-background);
217  box-sizing: border-box;
218  border: var(--input-border);
219  border-radius: var(--form-content-border-radius);
220  color: var(--input-foreground);
221  font-family: inherit;
222  font-size: var(--font-size);
223  font-weight: 500;
224  padding: 6px 12px;
225}
226
227.form__input::placeholder {
228  color: var(--input-foreground);
229  opacity: 0.65;
230}
231
232.form__input:focus-visible {
233  outline: 1px auto var(--input-outline-focus);
234}
235
236.form__input--textarea {
237  font-family: inherit;
238  resize: vertical;
239}
240
241.btn-group {
242  display: grid;
243  gap: 8px;
244  margin-top: 8px;
245}
246
247.btn {
248  line-height: inherit;
249  border: var(--cancel-border);
250  border-radius: var(--form-content-border-radius);
251  cursor: pointer;
252  font-family: inherit;
253  font-size: var(--font-size);
254  font-weight: 600;
255  padding: 6px 16px;
256}
257.btn[disabled] {
258  opacity: 0.6;
259  pointer-events: none;
260}
261
262.btn--primary {
263  background-color: var(--submit-background);
264  border-color: var(--submit-border);
265  color: var(--submit-foreground);
266}
267.btn--primary:hover {
268  background-color: var(--submit-background-hover);
269  color: var(--submit-foreground-hover);
270}
271.btn--primary:focus-visible {
272  outline: 1px auto var(--submit-outline-focus);
273}
274
275.btn--default {
276  background-color: var(--cancel-background);
277  color: var(--cancel-foreground);
278  font-weight: 500;
279}
280.btn--default:hover {
281  background-color: var(--cancel-background-hover);
282  color: var(--cancel-foreground-hover);
283}
284.btn--default:focus-visible {
285  outline: 1px auto var(--cancel-outline-focus);
286}
287
288.success-message {
289  background-color: var(--background);
290  border: var(--border);
291  border-radius: var(--border-radius);
292  box-shadow: var(--box-shadow);
293  font-weight: 600;
294  color: var(--success);
295  padding: 12px 24px;
296  line-height: 25px;
297  display: grid;
298  align-items: center;
299  grid-auto-flow: column;
300  gap: 6px;
301  cursor: default;
302}
303
304.success-icon path {
305  fill: var(--success);
306}
307`,t}function aw(e){return`
308  --background: ${e.background};
309  --background-hover: ${e.backgroundHover};
310  --foreground: ${e.foreground};
311  --error: ${e.error};
312  --success: ${e.success};
313  --border: ${e.border};
314  --border-radius: ${e.borderRadius};
315  --box-shadow: ${e.boxShadow};
316
317  --submit-background: ${e.submitBackground};
318  --submit-background-hover: ${e.submitBackgroundHover};
319  --submit-border: ${e.submitBorder};
320  --submit-outline-focus: ${e.submitOutlineFocus};
321  --submit-foreground: ${e.submitForeground};
322  --submit-foreground-hover: ${e.submitForegroundHover};
323
324  --cancel-background: ${e.cancelBackground};
325  --cancel-background-hover: ${e.cancelBackgroundHover};
326  --cancel-border: ${e.cancelBorder};
327  --cancel-outline-focus: ${e.cancelOutlineFocus};
328  --cancel-foreground: ${e.cancelForeground};
329  --cancel-foreground-hover: ${e.cancelForegroundHover};
330
331  --input-background: ${e.inputBackground};
332  --input-foreground: ${e.inputForeground};
333  --input-border: ${e.inputBorder};
334  --input-outline-focus: ${e.inputOutlineFocus};
335
336  --form-border-radius: ${e.formBorderRadius};
337  --form-content-border-radius: ${e.formContentBorderRadius};
338  `}function ow(e,t,n){let r=e.createElement(`style`);return r.textContent=`
339:host {
340  --bottom: 1rem;
341  --right: 1rem;
342  --top: auto;
343  --left: auto;
344  --z-index: 100000;
345  --font-family: ${n.light.fontFamily};
346  --font-size: ${n.light.fontSize};
347
348  position: fixed;
349  left: var(--left);
350  right: var(--right);
351  bottom: var(--bottom);
352  top: var(--top);
353  z-index: var(--z-index);
354
355  font-family: var(--font-family);
356  font-size: var(--font-size);
357
358  ${aw(t===`dark`?n.dark:n.light)}
359}
360
361${t===`system`?`
362@media (prefers-color-scheme: dark) {
363  :host {
364    ${aw(n.dark)}
365  }
366}`:``}
367}`,r}function sw({id:e,colorScheme:t,themeDark:n,themeLight:r}){try{let i=MC.document,a=i.createElement(`div`);a.id=e;let o=a.attachShadow({mode:`open`});return o.appendChild(ow(i,t,{dark:n,light:r})),o.appendChild(iw(i)),{shadow:o,host:a}}catch{throw W.warn(`[Feedback] Browser does not support shadow DOM API`),Error(`Browser does not support shadow DOM API.`)}}async function cw(e,t,n){if(!e)return;let r=()=>{e&&e.showError(`There was a problem submitting feedback, please wait and try again.`)};e.hideError();try{return await ew({...t,source:XC},n)}catch(e){tw&&W.error(e),r()}}function lw(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}var uw=20,dw=`http://www.w3.org/2000/svg`;function fw(){let e=e=>MC.document.createElementNS(dw,e),t=lw(e(`svg`),{class:`feedback-icon`,width:`${uw}`,height:`${uw}`,viewBox:`0 0 ${uw} ${uw}`,fill:`none`}),n=lw(e(`g`),{clipPath:`url(#clip0_57_80)`}),r=lw(e(`path`),{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.45
36756 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z`});t.appendChild(n).appendChild(r);let i=e(`defs`),a=lw(e(`clipPath`),{id:`clip0_57_80`}),o=lw(e(`rect`),{width:`${uw}`,height:`${uw}`,fill:`white`});return a.appendChild(o),i.appendChild(a),t.appendChild(i).appendChild(a).appendChild(o),{get el(){return t}}}function pw(e,t,...n){let r=MC.document.createElement(e);t&&Object.entries(t).forEach(([e,t])=>{e===`className`&&typeof t==`string`?r.setAttribute(`class`,t):typeof t==`boolean`&&t?r.setAttribute(e,``):typeof t==`string`?r.setAttribute(e,t):e.startsWith(`on`)&&typeof t==`function`&&r.addEventListener(e.substring(2).toLowerCase(),t)});for(let e of n)mw(r,e);return r}function mw(e,t){let n=MC.document;if(t!=null)if(Array.isArray(t))for(let n of t)mw(e,n);else t===!1||(typeof t==`string`?e.appendChild(n.createTextNode(t)):t instanceof Node?e.appendChild(t):e.appendChild(n.createTextNode(String(t))))}function hw({buttonLabel:e,onClick:t}){function n(e){t&&t(e)}let r=pw(`button`,{type:`button`,className:`widget__actor`,"aria-label":e,"aria-hidden":`false`},fw().el,e?pw(`span`,{className:`widget__actor__text`},e):null);return r.addEventListener(`click`,n),{get el(){return r},show:()=>{r.classList.remove(`widget__actor--hidden`),r.setAttribute(`aria-hidden`,`false`)},hide:()=>{r.classList.add(`widget__actor--hidden`),r.setAttribute(`aria-hidden`,`true`)}}}function gw({label:e}){return{el:pw(`button`,{type:`submit`,className:`btn btn--primary`,"aria-label":e},e)}}function _w(e,t){let n=e.get(t);return typeof n==`string`?n.trim():``}function vw({nameLabel:e,namePlaceholder:t,emailLabel:n,emailPlaceholder:r,messageLabel:i,messagePlaceholder:a,isRequiredLabel:o,cancelButtonLabel:s,submitButtonLabel:c,showName:l,showEmail:u,isNameRequired:d,isEmailRequired:f,defaultName:p,defaultEmail:m,onCancel:h,onSubmit:g}){let{el:_}=gw({label:c});function v(e){if(e.preventDefault(),e.target instanceof HTMLFormElement)try{if(g){let t=new FormData(e.target);g({name:_w(t,`name`),email:_w(t,`email`),message:_w(t,`message`)})}}catch{}}let y=pw(`div`,{className:`form__error-container form__error-container--hidden`,"aria-hidden":`true`});function b(e){y.textContent=e,y.classList.remove(`form__error-container--hidden`),y.setAttribute(`aria-hidden`,`false`)}function x(){y.textContent=``,y.classList.add(`form__error-container--hidden`),y.setAttribute(`aria-hidden`,`true`)}let S=pw(`input`,{id:`name`,type:l?`text`:`hidden`,"aria-hidden":l?`false`:`true`,name:`name`,required:d,className:`form__input`,placeholder:t,value:p}),C=pw(`input`,{id:`email`,type:u?`text`:`hidden`,"aria-hidden":u?`false`:`true`,name:`email`,required:f,className:`form__input`,placeholder:r,value:m}),w=pw(`textarea`,{id:`message`,autoFocus:`true`,rows:`5`,name:`message`,required:!0,className:`form__input form__input--textarea`,placeholder:a}),T=pw(`button`,{type:`button`,className:`btn btn--default`,"aria-label":s,onClick:e=>{h&&h(e)}},s),E=pw(`form`,{className:`form`,onSubmit:v},[y,l&&pw(`label`,{htmlFor:`name`,className:`form__label`},[pw(`span`,{className:`form__label__text`},e,d&&pw(`span`,{className:`form__label__text--required`},` ${o}`)),S]),!l&&S,u&&pw(`label`,{htmlFor:`email`,className:`form__label`},[pw(`span`,{className:`form__label__text`},n,f&&pw(`span`,{className:`form__label__text--required`},` ${o}`)),C]),!u&&C,pw(`label`,{htmlFor:`message`,className:`form__label`},[pw(`span`,{className:`form__label__text`},i,pw(`span`,{className:`form__label__text--required`},` ${o}`)),w]),pw(`div`,{className:`btn-group`},[_,T])]);return{get el(){return E},showError:b,hideError:x}}var yw=`http://www.w3.org/2000/svg`;function bw({colorScheme:e}){let t=e=>MC.document.createElementNS(yw,e),n=lw(t(`svg`),{class:`sentry-logo`,width:`32`,height:`30`,viewBox:`0 0 72 66`,fill:`none`}),r=lw(t(`path`),{transform:`translate(11, 11)`,d:`M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z`});n.append(r);let i=t(`defs`),a=t(`style`);return a.textContent=`
368    path {
369      fill: ${e===`dark`?`#fff`:`#362d59`};
370    }`,e===`system`&&(a.textContent+=`
371    @media (prefers-color-scheme: dark) {
372      path: {
373        fill: '#fff';
374      }
375    }
376    `),i.append(a),n.append(i),{get el(){return n}}}
376function xw({formTitle:e,showBranding:t,showName:n,showEmail:r,isNameRequired:i,isEmailRequired:a,colorScheme:o,defaultName:s,defaultEmail:c,onClosed:l,onCancel:u,onSubmit:d,...f}){let p=null;function m(){h(),l&&l()}function h(){p&&(p.open=!1)}function g(){p&&(p.open=!0)}function _(){return p&&p.open===!0||!1}let{el:v,showError:y,hideError:b}=vw({showEmail:r,showName:n,isEmailRequired:a,isNameRequired:i,defaultName:s,defaultEmail:c,onSubmit:d,onCancel:u,...f});return p=pw(`dialog`,{className:`dialog`,open:!0,onClick:m},pw(`div`,{className:`dialog__content`,onClick:e=>{e.stopPropagation()}},pw(`h2`,{className:`dialog__header`},e,t&&pw(`a`,{className:`brand-link`,target:`_blank`,href:`https://sentry.io/welcome/`,title:`Powered by Sentry`,rel:`noopener noreferrer`},bw({colorScheme:o}).el)),v)),{get el(){return p},showError:y,hideError:b,open:g,close:h,checkIsOpen:_}}var Sw=16,Cw=17,ww=`http://www.w3.org/2000/svg`;function Tw(){let e=e=>MC.document.createElementNS(ww,e),t=lw(e(`svg`),{class:`success-icon`,width:`${Sw}`,height:`${Cw}`,viewBox:`0 0 ${Sw} ${Cw}`,fill:`none`}),n=lw(e(`g`),{clipPath:`url(#clip0_57_156)`}),r=lw(e(`path`),{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z`}),i=lw(e(`path`),{d:`M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z`});t.appendChild(n).append(i,r);let a=e(`defs`),o=lw(e(`clipPath`),{id:`clip0_57_156`}),s=lw(e(`rect`),{width:`${Sw}`,height:`${Sw}`,fill:`white`,transform:`translate(0 0.5)`});return o.appendChild(s),a.appendChild(o),t.appendChild(a).appendChild(o).appendChild(s),{get el(){return t}}}function Ew({message:e,onRemove:t}){function n(){r&&(r.remove(),t&&t())}let r=pw(`div`,{className:`success-message`,onClick:n},Tw().el,e);return{el:r,remove:n}}function Dw({shadow:e,options:{shouldCreateActor:t=!0,...n},attachTo:r}){let i,a,o=!1;function s(){if(e)try{let t=Ew({message:n.successMessageText,onRemove:()=>{r&&clearTimeout(r),u()}});if(!t.el)throw Error(`Unable to show success message`);e.appendChild(t.el);let r=setTimeout(()=>{t&&t.remove()},5e3)}catch(e){W.error(e)}}async function c(e){if(!a)return;let t=[];if(n.isNameRequired&&!e.name&&t.push(n.nameLabel),n.isEmailRequired&&!e.email&&t.push(n.emailLabel),e.message||t.push(n.messageLabel),t.length>0){a.showError(`Please enter in the following required fields: ${t.join(`, `)}`);return}if(!await cw(a,e)){n.onSubmitError&&n.onSubmitError();return}h(),s(),n.onSubmitSuccess&&n.onSubmitSuccess()}function l(){let e=q(),t=e&&e.getIntegrationByName&&e.getIntegrationByName(`Replay`);t&&t.flush().catch(e=>{tw&&W.error(e)})}function u(){i&&i.show()}function d(){i&&i.hide()}function f(){i&&i.el&&i.el.remove()}function p(){try{if(a){a.open(),o=!0,n.onFormOpen&&n.onFormOpen(),l();return}let t=n.useSentryUser,r=Wc(),i=r&&r.getUser();if(a=xw({colorScheme:n.colorScheme,showBranding:n.showBranding,showName:n.showName||n.isNameRequired,showEmail
376:n.showEmail||n.isEmailRequired,isNameRequired:n.isNameRequired,isEmailRequired:n.isEmailRequired,formTitle:n.formTitle,cancelButtonLabel:n.cancelButtonLabel,submitButtonLabel:n.submitButtonLabel,emailLabel:n.emailLabel,emailPlaceholder:n.emailPlaceholder,messageLabel:n.messageLabel,messagePlaceholder:n.messagePlaceholder,nameLabel:n.nameLabel,namePlaceholder:n.namePlaceholder,isRequiredLabel:n.isRequiredLabel,defaultName:t&&i&&i[t.name]||``,defaultEmail:t&&i&&i[t.email]||``,onClosed:()=>{u(),o=!1,n.onFormClose&&n.onFormClose()},onCancel:()=>{m(),u()},onSubmit:c}),!a.el)throw Error(`Unable to open Feedback dialog`);e.appendChild(a.el),d(),n.onFormOpen&&n.onFormOpen(),l()}catch(e){W.error(e)}}function m(){a&&(a.close(),o=!1,n.onFormClose&&n.onFormClose())}function h(){if(a){m();let e=a.el;e&&e.remove(),a=void 0}}function g(){o||p(),d()}return r?r.addEventListener(`click`,g):t&&(i=hw({buttonLabel:n.buttonLabel,onClick:g}),i.el&&e.appendChild(i.el)),{get actor(){return i},get dialog(){return a},showActor:u,hideActor:d,removeActor:f,openDialog:p,closeDialog:m,removeDialog:h}}var Ow=MC.document,kw=(e=>new Aw(e)),Aw=class e{static __initStatic(){this.id=`Feedback`}constructor({autoInject:t=!0,id:n=`sentry-feedback`,isEmailRequired:r=!1,isNameRequired:i=!1,showBranding:a=!0,showEmail:o=!0,showName:s=!0,useSentryUser:c={email:`email`,name:`username`},themeDark:l,themeLight:u,colorScheme:d=`system`,buttonLabel:f=RC,cancelButtonLabel:p=zC,submitButtonLabel:m=BC,formTitle:h=VC,emailPlaceholder:g=HC,emailLabel:_=UC,messagePlaceholder:v=WC,messageLabel:y=GC,namePlaceholder:b=KC,nameLabel:x=qC,isRequiredLabel:S=JC,successMessageText:C=YC,onFormClose:w,onFormOpen:T,onSubmitError:E,onSubmitSuccess:D}={}){this.name=e.id,this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1,this.options={autoInject:t,showBranding:a,id:n,isEmailRequired:r,isNameRequired:i,showEmail:o,showName:s,useSentryUser:c,colorScheme:d,themeDark:{...LC.dark,...l},themeLight:{...LC.light,...u},buttonLabel:f,cancelButtonLabel:p,submitButtonLabel:m,formTitle:h,emailLabel:_,emailPlaceholder:g,messageLabel:y,messagePlaceholder:v,nameLabel:x,namePlaceholder:b,isRequiredLabel:S,successMessageText:C,onFormClose:w,onFormOpen:T,onSubmitError:E,onSubmitSuccess:D}}setupOnce(){if(Bo())try{this._cleanupWidgetIfExists();let{autoInject:e}=this.options;if(!e)return;this._createWidget(this.options)}catch(e){tw&&W.error(e)}}openDialog(){this._widget||this._createWidget({...this.options,shouldCreateActor:!1}),this._widget&&this._widget.openDialog()}closeDialog(){this._widget&&this._widget.closeDialog()}attachTo(e,t){try{let n=nw(this.options,t||{});return this._ensureShadowHost(n,({shadow:t})=>{let r=typeof e==`string`?Ow.querySelector(e):typeof e.addEventListener==`function`?e:null;if(!r)return tw&&W.error(`[Feedback] Unable to attach to target element`),null;let i=Dw({shadow:t,options:n,attachTo:r});return this._widgets.add(i),this._widget||=i,i})}catch(e){return tw&&W.error(e),null}}createWidget(e){try{return this._createWidget(nw(this.options,e||{}))}catch(e){return tw&&W.error(e),null}}removeWidget(e){if(!e)return!1;try{if(this._widgets.has(e))return e.removeActor(),e.removeDialog(),this._widgets.delete(e),this._widget===e&&(this._widget=null),!0}catch(e){tw&&W.error(e)}return!1}getWidget(){return this._widget}remove(){this._host&&this._host.remove(),this._initialize()}_initialize(){this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1}_cleanupWidgetIfExists(){this._host&&this.remove();let e=Ow.querySelector(`#${this.options.id}`);e&&e.remove()}_createWidget(e){return this._ensureShadowHost(e,({shadow:t})=>{let n=Dw({shadow:t,options:e});return!this._hasInsertedActorStyles&&n.actor&&(t.appendChild(rw(Ow)),this._hasInsertedActorStyles=!0),this._widgets.add(n),this._widget||=n,n})}_ensureShadowHost(e,t){let n=!1;if(!this._shadow||!this._host){let{id:t,colorScheme:r,themeLight:i,themeDark:a}=e,{shadow:o,host:s}=sw({id:t,colorScheme:r,themeLight:i,themeDark:a});this._shadow=o,this._host=s,n=!0}this._host.dataset.sentryFeedbackColorscheme=e.colorScheme;let r=t({shadow:this._shadow,host:this._host});return n&&Ow.body.appendChild(this._host),r}};Aw.__initStatic();var jw=`CaptureConsole`,Mw=J(((e={})=>{let t=e.levels||aa;return{name:jw,setupOnce(){},setup(e){`console`in qi&&Ha(({args:n,level:r})=>{q()!==e||!t.includes(r)||Nw(n,r)})}}}));Fu(jw,Mw);function Nw(e,t){let n={level:ds(t),extra:{arguments:e}};Ic(r=>
376{if(r.addEventProcessor(e=>(e.logger=`console`,Ja(e,{handled:!1,type:`console`}),e)),t===`assert`&&e[0]===!1){let t=`Assertion failed: ${Ri(e.slice(1),` `)||`console.assert`}`;r.setExtra(`arguments`,e.slice(1)),Ec(t,n);return}let i=e.find(e=>e instanceof Error);if(t===`error`&&i){Tc(i,n);return}Ec(Ri(e,` `),n)})}var Pw=`Debug`,Fw=J(((e={})=>{let t={debugger:!1,stringify:!1,...e};return{name:Pw,setupOnce(){},setup(e){e.on&&e.on(`beforeSendEvent`,(e,n)=>{if(t.debugger)debugger;sa(()=>{t.stringify?(console.log(JSON.stringify(e,null,2)),n&&Object.keys(n).length&&console.log(JSON.stringify(n,null,2))):(console.log(e),n&&Object.keys(n).length&&console.log(n))})})}}}));Fu(Pw,Fw);var Iw=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Lw=`Dedupe`,Rw=J((()=>{let e;return{name:Lw,setupOnce(){},processEvent(t){if(t.type)return t;try{if(zw(t,e))return Iw&&W.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));Fu(Lw,Rw);function zw(e,t){return t?!!(Bw(e,t)||Vw(e,t)):!1}function Bw(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Uw(e,t)||!Hw(e,t))}function Vw(e,t){let n=Ww(t),r=Ww(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Uw(e,t)||!Hw(e,t))}function Hw(e,t){let n=Gw(e),r=Gw(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Uw(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Ww(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Gw(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}var Kw=`ExtraErrorData`,qw=J(((e={})=>{let t=e.depth||3,n=e.captureErrorCause||!1;return{name:Kw,setupOnce(){},processEvent(e,r){return Jw(e,r,t,n)}}}));Fu(Kw,qw);function Jw(e,t={},n,r){if(!t.originalException||!yi(t.originalException))return e;let i=t.originalException.name||t.originalException.constructor.name,a=Yw(t.originalException,r);if(a){let t={...e.contexts},r=Uo(a,n);return Di(r)&&(va(r,`__sentry_skip_normalization__`,!0),t[i]=r),{...e,contexts:t}}return e}function Yw(e,t){try{let n=[`name`,`message`,`stack`,`line`,`column`,`fileName`,`lineNumber`,`columnNumber`,`toJSON`],r={};for(let t of Object.keys(e)){if(n.indexOf(t)!==-1)continue;let i=e[t];r[t]=yi(i)?i.toString():i}if(t&&e.cause!==void 0&&(r.cause=yi(e.cause)?e.cause.toString():e.cause),typeof e.toJSON==`function`){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];r[e]=yi(n)?n.toString():n}}return r}catch(e){Iw&&W.error(`Unable to extract extra data from the Error object:`,e)}return null}var Xw=qi,Zw=`ReportingObserver`,Qw=new WeakMap,$w=J(((e={})=>{let t=e.types||[`crash`,`deprecation`,`intervention`];function n(e){if(Qw.has(q()))for(let t of e)Ic(e=>{e.setExtra(`url`,t.url);let n=`ReportingObserver [${t.type}]`,r=`No details available`;if(t.body){let n={};for(let e in t.body)n[e]=t.body[e];if(e.setExtra(`body`,n),t.type===`crash`){let e=t.body;r=[e.crashId||``,e.reason||``].join(` `).trim()||r}else r=t.body.message||r}Ec(`${n}: ${r}`)})}return{name:Zw,setupOnce(){ho()&&new Xw.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){Qw.set(e,!0)}}}));Fu(Zw,$w);var eT=`RewriteFrames`,tT=J(((e={})=>{let t=e.root,n=e.prefix||`app:///`,r=e.iteratee||(e=>{if(!e.filename)return e;let r=/^[a-zA-Z]:\\/.test(e.filename)||e.filename.includes(`\\`)&&!e.filename.includes(`/`),i=/^\//.test(e.filename);if(r||i){let i=r?e.filename.replace(/^[a-zA-Z]:/,``).replace(/\\/g,`/`):e.filename,a=t?ts(t,i):ns(i);e.filename=`${n}${a}`}return e});function i(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:a(e.stacktrace)}}))}}}catch{return e}}function a(e){return{...e,frames:e&&e.frames&&e.frames.map(e=>r(e))}}return{name:eT,setupOnce(){},processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=i(t)),t}}}));Fu(eT,tT);var nT=`SessionTiming`,rT=J((()=>{let e=Date.now();return{name:nT,setupOnce(){},processEvent(t){let n=Date.now();return{...t,extra:{...t.extra,"session:start":e,"session:duration":n-e,"session:end":n}}}}}));Fu(nT,rT);var iT=`HttpClient`,aT=J(((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:iT,setupOnce(){},setup(e){mT(e,t),hT(e,t)}}}));Fu(iT,aT);function oT(e,t,n,r){if(gT(e,n.status,n.url)){let e=vT(t,r),i,a,o,s;yT()&&([{headers:i,cookies:o},{headers:a,cookies:s}]=[{cookieHeader:`Cookie`,obj:e},{cookieHeader:`Set-Cookie`,obj:n}
376].map(({cookieHeader:e,obj:t})=>{let n=uT(t.headers),r;try{let t=n[e]||n[e.toLowerCase()]||void 0;t&&(r=lT(t))}catch{Iw&&W.log(`Could not extract cookies from header ${e}`)}return{headers:n,cookies:r}})),Dc(_T({url:e.url,method:e.method,status:n.status,requestHeaders:i,responseHeaders:a,requestCookies:o,responseCookies:s}))}}function sT(e,t,n,r){if(gT(e,t.status,t.responseURL)){let e,i,a;if(yT()){try{let e=t.getResponseHeader(`Set-Cookie`)||t.getResponseHeader(`set-cookie`)||void 0;e&&(i=lT(e))}catch{Iw&&W.log(`Could not extract cookies from response headers`)}try{a=dT(t)}catch{Iw&&W.log(`Could not extract headers from response`)}e=r}Dc(_T({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:a,responseCookies:i}))}}function cT(e){if(e){let t=e[`Content-Length`]||e[`content-length`];if(t)return parseInt(t,10)}}function lT(e){return e.split(`; `).reduce((e,t)=>{let[n,r]=t.split(`=`);return e[n]=r,e},{})}function uT(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}function dT(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
377`).reduce((e,t)=>{let[n,r]=t.split(`: `);return e[n]=r,e},{}):{}}function fT(e,t){return e.some(e=>typeof e==`string`?t.includes(e):e.test(t))}function pT(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}function mT(e,t){mo()&&go(n=>{if(q()!==e)return;let{response:r,args:i}=n,[a,o]=i;r&&oT(t,a,r,o)})}function hT(e,t){`XMLHttpRequest`in qi&&G(n=>{if(q()!==e)return;let r=n.xhr,i=r[Po];if(!i)return;let{method:a,request_headers:o}=i;try{sT(t,r,a,o)}catch(e){Iw&&W.warn(`Error while extracting response event form XHR response`,e)}})}function gT(e,t,n){return pT(e.failedRequestStatusCodes,t)&&fT(e.failedRequestTargets,n)&&!vd(n,q())}function _T(e){let t=`HTTP Client Error with status code: ${e.status}`,n={message:t,exception:{values:[{type:`Error`,value:t}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:cT(e.responseHeaders)}}};return Ja(n,{type:`http.client`,handled:!1}),n}function vT(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function yT(){let e=q();return e?!!e.getOptions().sendDefaultPii:!1}var bT=qi,xT=7,ST=`ContextLines`,CT=J(((e={})=>{let t=e.frameContextLines==null?xT:e.frameContextLines;return{name:ST,setupOnce(){},processEvent(e){return wT(e,t)}}}));Fu(ST,CT);function wT(e,t){let n=bT.document,r=bT.location&&ls(bT.location.href);if(!n||!r)return e;let i=e.exception&&e.exception.values;if(!i||!i.length)return e;let a=n.documentElement.innerHTML;if(!a)return e;let o=[`<!DOCTYPE html>`,`<html>`,...a.split(`
378`),`</html>`];return i.forEach(e=>{let n=e.stacktrace;n&&n.frames&&(n.frames=n.frames.map(e=>TT(e,o,r,t)))}),e}function TT(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Ya(t,e,r),e}function ET(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function DT(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=ET(n);return e=>r.then(n=>e(n.transaction(t,`readwrite`).objectStore(t)))}function OT(e){return ET(e.getAllKeys())}function kT(e,t,n){return e(e=>OT(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),ET(e.transaction)}))}function AT(e){return e(e=>OT(e).then(t=>{if(t.length!==0)return ET(e.get(t[0])).then(n=>(e.delete(t[0]),ET(e.transaction).then(()=>n)))}))}function jT(e){let t;function n(){return t??=DT(e.dbName||`sentry-offline`,e.storeName||`queue`),t}return{insert:async t=>{try{let r=await Ps(t,e.textEncoder);await kT(n(),r,e.maxQueueSize||30)}catch{}},pop:async()=>{try{let t=await AT(n());if(t)return Is(t,e.textEncoder||new TextEncoder,e.textDecoder||new TextDecoder)}catch{}}}}function MT(e){return t=>e({...t,createStore:jT})}function NT(e){return MT(dd(e))}var PT=1e6,FT=`0`,IT=`main`,LT=``,RT=``,zT=``,BT=X.navigator&&X.navigator.userAgent||``,VT=``,HT=X.navigator&&X.navigator.language||X.navigator&&X.navigator.languages&&X.navigator.languages[0]||``;function UT(e){return typeof e==`object`&&!!e&&`getHighEntropyValues`in e}var WT=X.navigator&&X.navigator.userAgentData;UT(WT)&&WT.getHighEntropyValues([`architecture`,`model`,`platform`,`platformVersion`,`fullVersionList`]).then(e=>{if(LT=e.platform||``,zT=e.architecture||``,VT=e.model||``,RT=e.platformVersion||``,e.fullVersionList&&e.fullVersionList.length>0){let t=e.fullVersionList[e.fullVersionList.length-1];BT=`${t.brand} ${t.version}`}}).catch(e=>void 0);function GT(e){return!(`thread_metadata`in e)}function KT(e){return GT(e)?XT(e):e}function qT(e){let t=e&&e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id;return typeof t==`string`&&t.length!==32&&Fm&&W.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t==`string`?t:``}function JT(e,t,n,r){if(r.type!==`transaction`)throw TypeError(`Profiling events may only be attached to transactions, this should never occur.`);if(n==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let i=qT(r),a=KT(n),o=t||(typeof r.start_timestamp==`number`?r.start_timestamp*1e3:Date.now()),s=typeof r.timestamp==`number`?r.timestamp*1e3:Date.now();return{event_id:e,timestamp:new Date(o).toISOString(),platform:`javascript`,version:`1`,release:r.release||``,environment:r.environment||`production`,runtime:{name:`javascript`,version:X.navigator.userAgent},os:{name:LT,version:RT,build_number:BT},device:{locale:HT,model:VT,manufacturer:BT,architecture:zT,is_emulator:!1},debug_meta:{images:eE(n.resources)},profile:a,transactions:[{name:r.transaction||``,id:r.event_id||Wa(),trace_id:i,active_thread_id:FT,relative_start_ns:`0`,relative_end_ns:((s-o)*1e6).toFixed(0)}]}}function YT(e){return e.op===`pageload`}function XT(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[FT]:{name:IT}}};if(!e.samples.length)return r;let i=e.samples[0].timestamp,a=typeof performance.timeOrigin==`number`?performance.timeOrigin:gs||0,o=a-(gs||a);for(let a=0;a<e.samples.length;a++){let s=e.samples[a];if(s.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[a]={elapsed_since_start_ns:((s.timestamp+o-i)*PT).toFixed(0),stack_id:t,thread_id:FT};continue}let c=e.stacks[s.stackId],l=[];for(;c;){l.push(c.frameId);let t=e.frames[c.frameId];r.frames[c.frameId]===void 0&&(r.frames[c.frameId]={function:t.name,abs_path:typeof t.resourceId==`number`?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),c=c.parentId===void 0?void 0:e.stacks[c.parentId]}let u={elapsed_since_start_ns:((s.timestamp+o-i)*PT).toFixed(0),stack_id:n,thread_id:FT};r.stacks[n]=l,r.samples[a]=u,n++}return r}function ZT(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:`profile`},n]);return e}function QT(e){let t=[];return js(e,(e,n)=>{if(n===`transaction`)for(let n=1;n<e.length;n++){let r=e[n];r&&r.contexts&&r.contexts.profile&&r.contexts.profile.profile_id&&t.pu
378sh(e[n])}}),t}var $T=new WeakMap;function eE(e){let t=qi._sentryDebugIds;if(!t)return[];let n=q(),r=n&&n.getOptions(),i=r&&r.stackParser;if(!i)return[];let a,o=$T.get(i);o?a=o:(a=new Map,$T.set(i,a));let s=Object.keys(t).reduce((e,n)=>{let r,o=a.get(n);o?r=o:(r=i(n),a.set(n,r));for(let i=r.length-1;i>=0;i--){let a=r[i],o=a&&a.filename;if(a&&o){e[o]=t[n];break}}return e},{}),c=[];for(let t of e)t&&s[t]&&c.push({type:`sourcemap`,code_file:t,debug_id:s[t]});return c}function tE(e){return typeof e!=`number`&&typeof e!=`boolean`||typeof e==`number`&&isNaN(e)?(Fm&&W.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(Fm&&W.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function nE(e){return e.samples.length<2?(Fm&&W.log(`[Profiling] Discarding profile because it contains less than 2 samples`),!1):e.frames.length?!0:(Fm&&W.log(`[Profiling] Discarding profile because it contains no frames`),!1)}var rE=!1,iE=3e4;function aE(e){return typeof e==`function`}function oE(){let e=X.Profiler;if(!aE(e)){Fm&&W.log(`[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.`);return}let t=Math.floor(iE/10);try{return new e({sampleInterval:10,maxBufferSize:t})}catch{Fm&&(W.log(`[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.`),W.log(`[Profiling] Disabling profiling for current user session.`)),rE=!0}}function sE(e){if(rE)return Fm&&W.log(`[Profiling] Profiling has been disabled for the duration of the current user session.`),!1;if(!e.isRecording())return Fm&&W.log(`[Profiling] Discarding profile because transaction was not sampled.`),!1;let t=q(),n=t&&t.getOptions();if(!n)return Fm&&W.log(`[Profiling] Profiling disabled, no options found.`),!1;let r=n.profilesSampleRate;return tE(r)?r?r===!0||Math.random()<r||(Fm&&W.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(Fm&&W.log(`[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0`),!1):(Fm&&W.warn(`[Profiling] Discarding profile because of invalid sample rate.`),!1)}function cE(e,t,n,r){return nE(n)?JT(e,t,n,r):null}var lE=new Map;function uE(){return lE.size}function dE(e){let t=lE.get(e);return t&&lE.delete(e),t}function fE(e,t){if(lE.set(e,t),lE.size>30){let e=lE.keys().next().value;lE.delete(e)}}function pE(e){return e?sE(e)?mE(e):e:(Fm&&W.log(`[Profiling] Transaction is undefined, skipping profiling`),e)}function mE(e){let t;YT(e)&&(t=hs()*1e3);let n=oE();if(!n)return e;Fm&&W.log(`[Profiling] started profiling transaction: ${uc(e).description}`);let r=Wa();async function i(){return!e||!n?null:n.stop().then(t=>(a&&=(X.clearTimeout(a),void 0),Fm&&W.log(`[Profiling] stopped profiling of transaction: ${uc(e).description}`),t?(fE(r,t),null):(Fm&&W.log(`[Profiling] profiler returned null profile for: ${uc(e).description}`,`this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started`),null))).catch(e=>(Fm&&W.log(`[Profiling] error while stopping profiler:`,e),null))}let a=X.setTimeout(()=>{Fm&&W.log(`[Profiling] max profile duration elapsed, stopping profiling for:`,uc(e).description),i()},iE),o=e.end.bind(e);function s(){return e?(i().then(()=>{e.setContext(`profile`,{profile_id:r,start_timestamp:t}),o()},()=>{o()}),e):o()}return e.end=s,e}var hE=`BrowserProfiling`,gE=J((()=>({name:hE,setupOnce(){},setup(e){let t=Wc().getTransaction();if(t&&YT(t)&&sE(t)&&mE(t),typeof e.on!=`function`){W.warn(`[Profiling] Client does not support hooks, profiling will be disabled`);return}e.on(`startTransaction`,e=>{sE(e)&&mE(e)}),e.on(`beforeEnvelope`,e=>{if(!uE())return;let t=QT(e);if(!t.length)return;let n=[];for(let e of t){let t=e&&e.contexts,r=t&&t.profile&&t.profile.profile_id,i=t&&t.profile&&t.profile.start_timestamp;if(typeof r!=`string`){Fm&&W.log(`[Profiling] cannot find profile for a transaction without a profile context`);continue}if(!r){Fm&&W.log(`[Profiling] cannot find profile for a transaction without a profile context`);continue}t&&t.profile&&delete t.profile;let a=dE(r);if(!a){Fm&&W.log(`[Profiling] Could not retrieve profile for transaction: ${r}`);continue}let o=cE(r,i,a,e);o&&n.push(o)}ZT(e,n)})}}))),_E=Fu(hE,gE),vE=s({Breadcrumbs:()=>kh,BrowserClient:()=>Zm,BrowserProfilingIntegration:()=>_E,BrowserTracing:()=>gm,Dedupe:()=>zh,Feedback:()=>Aw,FunctionToString:()=>$d,GlobalHandlers:()=>Yh,HttpContext:()=>og,Hub:()=>ml,InboundFilters:()=>Rd,Integrations:()=>bE,LinkedErrors:()=>dg,ModuleMetadata:()=>Nd,Replay:()=>VS,ReplayCanvas:()=>jC,SDK_VERSION:()=>dl,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>eu,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>tu,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>$l,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>Ql,Scope:()=>cl,TryCatch:()=>hg,WINDOW:()=>X,addBreadcrumb:()=>kc,addEventProcessor:()=>ed,addGlobalEventProcessor:()=>ec,addIntegration:()=>Nu,addTracingExtensions:()=>gu,breadcrumbsIntegration:()=>Oh,browserApiErrorsIntegration:()=>mg,browserProfilingIntegration:()=>gE,browserTracingIntegration:()=>Sm,captureConsoleIntegration:()=>Mw,captureEvent:()=>Dc,captureException:()=>Tc,captureMessage:()=>Ec,captureSession:()=>Jc,captureUserFeedback:()=>Og,chromeStackLineParser:()=>ph,close:()=>Vc,configureScope:()=>Oc,contextLinesIntegration:()=>CT,continueTrace:()=>Vl,createTransport:()=>od,createUserFeedbackEnvelope:()=>Ym,debugIntegration:()=>Fw,dedupeIntegration:()=>Rw,defaultIntegrations:()=>bg,defaultRequestInstrumentationOptions:()=>tm,defaultStackLineParsers:()=>Ch,defaultStackParser:()=>wh,endSession:()=>Kc,eventFromException:()=>Um,eventFromMessage:()=>Wm,exceptionFromError:()=>Im,extraErrorDataIntegration:()=>qw,extractTraceparentData:()=>Tl,feedbackIntegration:()=>kw,flush:()=>Bc,forceLoad:()=>wg,functionToStringIntegration:()=>Qd,geckoStackLineParser:()=>gh,getActiveSpan:()=>Bl,getActiveTransaction:()=>wl,getClient:()=>q,getCurrentHub:()=>_l,getCurrentScope:()=>Wc,getDefaultIntegrations:()=>xg,getHubFromCarrier:()=>Sl,getReplay:()=>WS,getSpanStatusFromHttpCode:()=>Al,globalHandlersIntegration:()=>Jh,httpClientIntegration:()=>aT,httpContextIntegration:()=>ag,inboundFiltersIntegration:()=>Ld,init:()=>Sg,instrumentOutgoingRequests:()=>nm,isInitialized:()=>Uc,lastEventId:()=>Hc,linkedErrorsIntegration:()=>ug,makeBrowserOfflineTransport:()=>NT,makeFetchTransport:()=>th,makeMain:()=>gl,makeMultiplexedTransport:()=>hd,makeXHRTransport:()=>rh,metrics:()=>hf,moduleMetadataIntegration:()=>Md,onLoad:()=>Tg,onProfilingStartRouteTransaction:()=>pE,opera10StackLineParser:()=>bh,opera11StackLineParser:()=>Sh,parameterize:()=>Cd,replayCanvasIntegration:()=>AC,replayIntegration:()=>BS,reportingObserverIntegration:()=>$w,rewriteFramesIntegration:()=>tT,sendFeedback:()=>ew,sessionTimingIntegration:()=>rT,setContext:()=>Ac,setCurrentClient:()=>id,setExtra:()=>Mc,setExtras:()=>jc,setHttpStatus:()=>Ml,setMeasurement:()=>_u,setTag:()=>Pc,setTags:()=>Nc,setUser:()=>Fc,showReportDialog:()=>Cg,spanStatusfromHttpCode:()=>jl,startBrowserTracingNavigationSpan:()=>wm,startBrowserTracingPageLoadSpan:()=>Cm,startInactiveSpan:()=>
vendor: 5,382 bytes, line 378
378zl,startSession:()=>Gc,startSpan:()=>Ll,startSpanManual:()=>Rl,startTransaction:()=>zc,trace:()=>Il,winjsStackLineParser:()=>vh,withActiveSpan:()=>Rc,withIsolationScope:()=>Lc,withScope:()=>Ic,wrap:()=>Eg}),yE={};X.Sentry&&X.Sentry.Integrations&&(yE=X.Sentry.Integrations);var bE={...yE,...gf,...kg};function xE(e){return typeof e==`object`&&!!e&&`constructor`in e&&e.constructor===Object}function SE(e={},t={}){let n=[`__proto__`,`constructor`,`prototype`];Object.keys(t).filter(e=>n.indexOf(e)<0).forEach(n=>{e[n]===void 0?e[n]=t[n]:xE(t[n])&&xE(e[n])&&Object.keys(t[n]).length>0&&SE(e[n],t[n])})}var CE={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:``},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:``,host:``,hostname:``,href:``,origin:``,pathname:``,protocol:``,search:``}};function wE(){let e=typeof document<`u`?document:{};return SE(e,CE),e}var TE={document:CE,navigator:{userAgent:``},location:{hash:``,host:``,hostname:``,href:``,origin:``,pathname:``,protocol:``,search:``},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return``}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>`u`?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>`u`||clearTimeout(e)}};function EE(){let e=typeof window<`u`?window:{};return SE(e,TE),e}function DE(e=``){return e.trim().split(` `).filter(e=>!!e.trim())}function OE(e){let t=e;Object.keys(t).forEach(e=>{try{t[e]=null}catch{}try{delete t[e]}catch{}})}function kE(e,t=0){return setTimeout(e,t)}function AE(){return Date.now()}function jE(e){let t=EE(),n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||=e.style,n}function ME(e,t=`x`){let n=EE(),r,i,a,o=jE(e);return n.WebKitCSSMatrix?(i=o.transform||o.webkitTransform,i.split(`,`).length>6&&(i=i.split(`, `).map(e=>e.replace(`,`,`.`)).join(`, `)),a=new n.WebKitCSSMatrix(i===`none`?``:i)):(a=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue(`transform`).replace(`translate(`,`matrix(1, 0, 0, 1,`),r=a.toString().split(`,`)),t===`x`&&(i=n.WebKitCSSMatrix?a.m41:r.length===16?parseFloat(r[12]):parseFloat(r[4])),t===`y`&&(i=n.WebKitCSSMatrix?a.m42:r.length===16?parseFloat(r[13]):parseFloat(r[5])),i||0}function NE(e){return typeof e==`object`&&!!e&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)===`Object`}function PE(e){return typeof window<`u`&&window.HTMLElement!==void 0?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function FE(...e){let t=Object(e[0]);for(let n=1;n<e.length;n+=1){let r=e[n];if(r!=null&&!PE(r)){let e=Object.keys(Object(r)).filter(e=>e!==`__proto__`&&e!==`constructor`&&e!==`prototype`);for(let n=0,i=e.length;n<i;n+=1){let i=e[n],a=Object.getOwnPropertyDescriptor(r,i);a!==void 0&&a.enumerable&&(NE(t[i])&&NE(r[i])?r[i].__swiper__?t[i]=r[i]:FE(t[i],r[i]):!NE(t[i])&&NE(r[i])?(t[i]={},r[i].__swiper__?t[i]=r[i]:FE(t[i],r[i])):t[i]=r[i])}}}return t}function IE(e,t,n){e.style.setProperty(t,n)}function LE({swiper:e,targetPosition:t,side:n}){let r=EE(),i=-e.translate,a=null,o,s=e.params.speed;e.wrapperEl.style.scrollSnapType=`none`,r.cancelAnimationFrame(e.cssModeFrameID);let c=t>i?`next`:`prev`,l=(e,t)=>c===`next`&&e>=t||c===`prev`&&e<=t,u=()=>{o=new Date().getTime(),a===null&&(a=o);let c=Math.max(Math.min((o-a)/s,1),0),d=.5-Math.cos(c*Math.PI)/2,f=i+d*(t-i);if(l(f,t)&&(f=t),e.wrapperEl.scrollTo({[n]:f}),l(f,t)){e.wrapperEl.style.overflow=`hidden`,e.wrapperEl.style.scrollSnapType=``,setTimeout(()=>{e.wrapperEl.style.overflow=``,e.wrapperEl.scrollTo({[n]:f})}),r.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=r.requestAnimationFrame(u)};u()}function RE(e,t=``){let n=EE(),r=[...e.children];return n.HTMLSlotElement&&e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(e=>e.matches(t)):r}function zE(e,t){let n=[t];for(;n.length>0;){let t=n.shift();if(e===t)return!0;n.push(...t.children,...t.shadowRoot?t.shadowRoot.children:[],...t.assignedElements?t.assignedElements():[])}}function BE(e,t){let n=EE(),r=t.contains(e);return!r&&n.HTMLSlotElement&&t instanceof HTMLSlotElement&&(r=[...t.assignedElements()].includes(e),r||=zE(e,t)),r}function VE(e){try{console.warn(e);return}catch{}}function HE(e,t=[]){let n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:DE(t)),n}function UE(e,t){let n=[];for(;e.previousElementSibling;){let r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function WE(e,t){let n=[];for(;e.nextElementSibling;){let r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function GE(e,t){return EE().getComputedStyle(e,null).getPropertyValue(t)}function KE(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function qE(e,t){let n=[],r=e.parentElement;for(;r;)t?r.matches(t)&&n.push(r):n.push(r),r=r.parentElement;return n}
vendor: 14,310 bytes, line 378
378function JE(e,t,n){let r=EE();return n?e[t===`width`?`offsetWidth`:`offsetHeight`]+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t===`width`?`margin-right`:`margin-top`))+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t===`width`?`margin-left`:`margin-bottom`)):e.offsetWidth}var YE;function XE(){let e=EE(),t=wE();return{smoothScroll:t.documentElement&&t.documentElement.style&&`scrollBehavior`in t.documentElement.style,touch:!!(`ontouchstart`in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function ZE(){return YE||=XE(),YE}var QE;function $E({userAgent:e}={}){let t=ZE(),n=EE(),r=n.navigator.platform,i=e||n.navigator.userAgent,a={ios:!1,android:!1},o=n.screen.width,s=n.screen.height,c=i.match(/(Android);?[\s\/]+([\d.]+)?/),l=i.match(/(iPad)(?!\1).*OS\s([\d_]+)/),u=i.match(/(iPod)(.*OS\s([\d_]+))?/),d=!l&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),f=r===`Win32`,p=r===`MacIntel`;return!l&&p&&t.touch&&[`1024x1366`,`1366x1024`,`834x1194`,`1194x834`,`834x1112`,`1112x834`,`768x1024`,`1024x768`,`820x1180`,`1180x820`,`810x1080`,`1080x810`].indexOf(`${o}x${s}`)>=0&&(l=i.match(/(Version)\/([\d.]+)/),l||=[0,1,`13_0_0`],p=!1),c&&!f&&(a.os=`android`,a.android=!0),(l||d||u)&&(a.os=`ios`,a.ios=!0),a}function eD(e={}){return QE||=$E(e),QE}var tD;function nD(){let e=EE(),t=eD(),n=!1;function r(){let t=e.navigator.userAgent.toLowerCase();return t.indexOf(`safari`)>=0&&t.indexOf(`chrome`)<0&&t.indexOf(`android`)<0}if(r()){let t=String(e.navigator.userAgent);if(t.includes(`Version/`)){let[e,r]=t.split(`Version/`)[1].split(` `)[0].split(`.`).map(e=>Number(e));n=e<16||e===16&&r<2}}let i=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),a=r(),o=a||i&&t.ios;return{isSafari:n||a,needPerspectiveFix:n,need3dFix:o,isWebView:i}}function rD(){return tD||=nD(),tD}function iD({swiper:e,on:t,emit:n}){let r=EE(),i=null,a=null,o=()=>{!e||e.destroyed||!e.initialized||(n(`beforeResize`),n(`resize`))},s=()=>{!e||e.destroyed||!e.initialized||(i=new ResizeObserver(t=>{a=r.requestAnimationFrame(()=>{let{width:n,height:r}=e,i=n,a=r;t.forEach(({contentBoxSize:t,contentRect:n,target:r})=>{r&&r!==e.el||(i=n?n.width:(t[0]||t).inlineSize,a=n?n.height:(t[0]||t).blockSize)}),(i!==n||a!==r)&&o()})}),i.observe(e.el))},c=()=>{a&&r.cancelAnimationFrame(a),i&&i.unobserve&&e.el&&(i.unobserve(e.el),i=null)},l=()=>{!e||e.destroyed||!e.initialized||n(`orientationchange`)};t(`init`,()=>{if(e.params.resizeObserver&&r.ResizeObserver!==void 0){s();return}r.addEventListener(`resize`,o),r.addEventListener(`orientationchange`,l)}),t(`destroy`,()=>{c(),r.removeEventListener(`resize`,o),r.removeEventListener(`orientationchange`,l)})}function aD({swiper:e,extendParams:t,on:n,emit:r}){let i=[],a=EE(),o=(t,n={})=>{let o=new(a.MutationObserver||a.WebkitMutationObserver)(t=>{if(e.__preventObserver__)return;if(t.length===1){r(`observerUpdate`,t[0]);return}let n=function(){r(`observerUpdate`,t[0])};a.requestAnimationFrame?a.requestAnimationFrame(n):a.setTimeout(n,0)});o.observe(t,{attributes:n.attributes===void 0||n.attributes,childList:e.isElement||(n.childList===void 0||n).childList,characterData:n.characterData===void 0||n.characterData}),i.push(o)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),n(`init`,()=>{if(e.params.observer){if(e.params.observeParents){let t=qE(e.hostEl);for(let e=0;e<t.length;e+=1)o(t[e])}o(e.hostEl,{childList:e.params.observeSlideChildren}),o(e.wrapperEl,{attributes:!1})}}),n(`destroy`,()=>{i.forEach(e=>{e.disconnect()}),i.splice(0,i.length)})}var oD={on(e,t,n){let r=this;if(!r.eventsListeners||r.destroyed||typeof t!=`function`)return r;let i=n?`unshift`:`push`;return e.split(` `).forEach(e=>{r.eventsListeners[e]||(r.eventsListeners[e]=[]),r.eventsListeners[e][i](t)}),r},once(e,t,n){let r=this;if(!r.eventsListeners||r.destroyed||typeof t!=`function`)return r;function i(...n){r.off(e,i),i.__emitterProxy&&delete i.__emitterProxy,t.apply(r,n)}return i.__emitterProxy=t,r.on(e,i,n)},onAny(e,t){let n=this;if(!n.eventsListeners||n.destroyed||typeof e!=`function`)return n;let r=t?`unshift`:`push`;return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){let t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;let n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){let n=this;return!n.eventsListeners||n.destroyed||!n.eventsListeners||e.split(` `).forEach(e=>{t===void 0?n.eventsListeners[e]=[]:n.eventsListeners[e]&&n.eventsListeners[e].forEach((r,i)=>{(r===t||r.__emitterProxy&&r.__emitterProxy===t)&&n.eventsListeners[e].splice(i,1)})}),n},emit(...e){let t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let n,r,i;return typeof e[0]==`string`||Array.isArray(e[0])?(n=e[0],r=e.slice(1,e.length),i=t):(n=e[0].events,r=e[0].data,i=e[0].context||t),r.unshift(i),(Array.isArray(n)?n:n.split(` `)).forEach(e=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(t=>{t.apply(i,[e,...r])}),t.eventsListeners&&t.eventsListeners[e]&&t.eventsListeners[e].forEach(e=>{e.apply(i,r)})}),t}};function sD(){let e=this,t,n,r=e.el;t=e.params.width!==void 0&&e.params.width!==null?e.params.width:r.clientWidth,n=e.params.height!==void 0&&e.params.height!==null?e.params.height:r.clientHeight,!(t===0&&e.isHorizontal()||n===0&&e.isVertical())&&(t=t-parseInt(GE(r,`padding-left`)||0,10)-parseInt(GE(r,`padding-right`)||0,10),n=n-parseInt(GE(r,`padding-top`)||0,10)-parseInt(GE(r,`padding-bottom`)||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))}function cD(){let e=this;function t(t,n){return parseFloat(t.getPropertyValue(e.getDirectionLabel(n))||0)}let n=e.params,{wrapperEl:r,slidesEl:i,rtlTranslate:a,wrongRTL:o}=e,s=e.virtual&&n.virtual.enabled,c=s?e.virtual.slides.length:e.slides.length,l=RE(i,`.${e.params.slideClass}, swiper-slide`),u=s?e.virtual.slides.length:l.length,d=[],f=[],p=[],m=n.slidesOffsetBefore;typeof m==`function`&&(m=n.slidesOffsetBefore.call(e));let h=n.slidesOffsetAfter;typeof h==`function`&&(h=n.slidesOffsetAfter.call(e));let g=e.snapGrid.length,_=e.slidesGrid.length,v=e.size-m-h,y=n.spaceBetween,b=-m,x=0,S=0;if(v===void 0)return;typeof y==`string`&&y.indexOf(`%`)>=0?y=parseFloat(y.replace(`%`,``))/100*v:typeof y==`string`&&(y=parseFloat(y)),e.virtualSize=-y-m-h,l.forEach(e=>{a?e.style.marginLeft=``:e.style.marginRight=``,e.style.marginBottom=``,e.style.marginTop=``}),n.centeredSlides&&n.cssMode&&(IE(r,`--swiper-centered-offset-before`,``),IE(r,`--swiper-centered-offset-after`,``)),n.cssMode&&(IE(r,`--swiper-slides-offset-before`,`${m}px`),IE(r,`--swiper-slides-offset-after`,`${h}px`));let C=n.grid&&n.grid.rows>1&&e.grid;C?e.grid.initSlides(l):e.grid&&e.grid.unsetSlides();let w,T=n.slidesPerView===`auto`&&n.breakpoints&&Object.keys(n.breakpoints).filter(e=>n.breakpoints[e].slidesPerView!==void 0).length>0;for(let r=0;r<u;r+=1){w=0;let i=l[r];if(!(i&&(C&&e.grid.updateSlide(r,i,l),GE(i,`display`)===`none`))){if(s&&n.slidesPerView===`auto`)n.virtual.slidesPerViewAutoSlideSize&&(w=n.virtual.slidesPerViewAutoSlideSize),w&&i&&(n.roundLengths&&(w=Math.floor(w)),i.style[e.getDirectionLabel(`width`)]=`${w}px`);else if(n.slidesPerView===`auto`){T&&(i.style[e.getDirectionLabel(`width`)]=``);let r=getComputedStyle(i),a=i.style.transform,o=i.style.webkitTransform;if(a&&(i.style.transform=`none`),o&&(i.style.webkitTransform=`none`),n.roundLengths)w=e.isHorizontal()?JE(i,`width`,!0):JE(i,`height`,!0);else{let e=t(r,`width`),n=t(r,`padding-left`),a=t(r,`padding-right`),o=t(r,`margin-left`),s=t(r,`margin-right`),c=r.getPropertyValue(`box-sizing`);if(c&&c===`border-box`)w=e+o+s;else{let{clientWidth:t,offsetWidth:r}=i;w=e+n+a+o+s+(r-t)}}a&&(i.style.transform=a),o&&(i.style.webkitTransform=o),n.roundLengths&&(w=Math.floor(w))}else w=(v-(n.slidesPerView-1)*y)/n.slidesPerView,n.roundLengths&&(w=Math.floor(w)),i&&(i.style[e.getDirectionLabel(`width`)]=`${w}px`);i&&(i.swiperSlideSize=w),p.push(w),n.centeredSlides?(b=b+w/2+x/2+y,x===0&&r!==0&&(b=b-v/2-y),r===0&&(b=b-v/2-y),Math.abs(b)<1/1e3&&(b=0),n.roundLengths&&(b=Math.floor(b)),S%n.slidesPerGroup===0&&d.push(b),f.push(b)):(n.roundLengths&&(b=Math.floor(b)),(S-Math.min(e.params.slidesPerGroupSkip,S))%e.params.slidesPerGroup===0&&d.push(b),f.push(b),b=b+w+y),e.virtualSize+=w+y,x=w,S+=1}}if(e.virtualSize=Math.max(e.virtualSize,v)+h,a&&o&&(n.effect===`slide`||n.effect===`coverflow`)&&(r.style.width=`${e.virtualSize+y}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel(`width`)]=`${e.virtualSize+y}px`),C&&e.grid.updateWrapperSize(w,d),!n.centeredSlides){let t=n.slidesPerView!==`auto`&&n.slidesPerView%1!=0,r=n.snapToSlideEdge&&!n.loop&&(n.slidesPerView===`auto`||t),i=d.length;if(r){let e;if(n.slidesPerView===`auto`){e=1;let t=0;for(let n=p.length-1;n>=0&&(t+=p[n]+(n<p.length-1?y:0),t<=v);--n)e=p.length-n}else e=Math.floor(n.slidesPerView);i=Math.max(u-e,0)}let a=[];for(let t=0;t<d.length;t+=1){let o=d[t];n.roundLengths&&(o=Math.floor(o)),r?t<=i&&a.push(o):d[t]<=e.virtualSize-v&&a.push(o)}d=a,Math.floor(e.virtualSize-v)-Math.floor(d[d.length-1])>1&&(r||d.push(e.virtualSize-v))}if(s&&n.loop){let t=p[0]+y;if(n.slidesPerGroup>1){let r=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),i=t*n.slidesPerGroup;for(let e=0;e<r;e+=1)d.push(d[d.length-1]+i)}for(let r=0;r<e.virtual.slidesBefore+e.virtual.slidesAfter;r+=1)n.slidesPerGroup===1&&d.push(d[d.length-1]+t),f.push(f[f.length-1]+t),e.virtualSize+=t}if(d.length===0&&(d=[0]),y!==0){let t=e.isHorizontal()&&a?`marginLeft`:e.getDirectionLabel(`marginRight`);l.filter((e,t)=>!n.cssMode||n.loop?!0:t!==l.length-1).forEach(e=>{e.style[t]=`${y}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let e=0;p.forEach(t=>{e+=t+(y||0)}),e-=y;let t=e>v?e-v:0;d=d.map(e=>e<=0?-m:e>t?t+h:e)}if(n.centerInsufficientSlides){let e=0;if(p.forEach(t=>{e+=t+(y||0)}),e-=y,e<v){let t=(v-e)/2;d.forEach((e,n)=>{d[n]=e-t}),f.forEach((e,n)=>{f[n]=e+t})}}if(Object.assign(e,{slides:l,snapGrid:d,slidesGrid:f,slidesSizesGrid:p}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){IE(r,`--swiper-centered-offset-before`,`${-d[0]}px`),IE(r,`--swiper-centered-offset-after`,`${e.size/2-p[p.length-1]/2}px`);let t=-e.snapGrid[0],n=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(e=>e+t),e.slidesGrid=e.slidesGrid.map(e=>e+n)}if(u!==c&&e.emit(`slidesLengthChange`),d.length!==g&&(e.params.watchOverflow&&e.checkOverflow(),e.emit(`snapGridLengthChange`)),f.length!==_&&e.emit(`slidesGridLengthChange`),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit(`slidesUpdated`),!s&&!n.cssMode&&(n.effect===`slide`||n.effect===`fade`)){let t=`${n.containerModifierClass}backface-hidden`,r=e.el.classList.contains(t);u<=n.maxBackfaceHiddenSlides?r||e.el.classList.add(t):r&&e.el.classList.remove(t)}}function lD(e){let t=this,n=[],r=t.virtual&&t.params.virtual.enabled,i=0,a;typeof e==`number`?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);let o=e=>r?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if(t.params.slidesPerView!==`auto`&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(e=>{n.push(e)});else for(a=0;a<Math.ceil(t.params.slidesPerView);a+=1){let e=t.activeIndex+a;if(e>t.slides.length&&!r)break;n.push(o(e))}else n.push(o(t.activeIndex));for(a=0;a<n.length;a+=1)if(n[a]!==void 0){let e=n[a].offsetHeight;i=e>i?e:i}(i||i===0)&&(t.wrapperEl.style.height=`${i}px`)}function uD(){let e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()}var dD=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function fD(e=this&&this.translate||0){let t=this,n=t.params,{slides:r,rtlTranslate:i,snapGrid:a}=t;if(r.length===0)return;r[0].swiperSlideOffset===void 0&&t.updateSlidesOffset();let o=-e;i&&(o=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let s=n.spaceBetween;typeof s==`string`&&s.indexOf(`%`)>=0?s=parseFloat(s.replace(`%`,``))/100*t.size:typeof s==`string`&&(s=parseFloat(s));for(let e=0;e<r.length;e+=1){let c=r[e],l=c.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(l-=r[0].swiperSlideOffset);let u=(o+(n.centeredSlides?t.minTranslate():0)-l)/(c.swiperSlideSize+s),d=(o-a[0]+(n.centeredSlides?t.minTranslate():0)-l)/(c.swiperSlideSize+s),f=-(o-l),p=f+t.slidesSizesGrid[e],m=f>=0&&f<=t.size-t.slidesSizesGrid[e],h=f>=0&&f<t.size-1||p>1&&p<=t.size||f<=0&&p>=t.size;h&&(t.visibleSlides.push(c),t.visibleSlidesIndexes.push(e)),dD(c,h,n.slideVisibleClass),dD(c,m,n.slideFullyVisibleClass),c.progress=i?-u:u,c.originalProgress=i?-d:d}}function pD(e){let t=this;if(e===void 0){let n=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*n||0}let n=t.params,r=t.maxTranslate()-t.minTranslate(),{progress:i,isBeginning:a,isEnd:o,progressLoop:s}=t,c=a,l=o;if(r===0)i=0,a=!0,o=!0;else{i=(e-t.minTranslate())/r;let n=Math.abs(e-t.minTranslate())<1,s=Math.abs(e-t.maxTranslate())<1;a=n||i<=0,o=s||i>=1,n&&(i=0),s&&(i=1)}if(n.loop){let n=t.getSlideIndexByData(0),r=t.getSlideIndexByData(t.slides.length-1),i=t.slidesGrid[n],a=t.slidesGrid[r],o=t.slidesGrid[t.slidesGrid.length-1],c=Math.abs(e);s=c>=i?(c-i)/o:(c+o-a)/o,s>1&&--s}Object.assign(t,{progress:i,progressLoop:s,isBeginning:a,isEnd:o}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),a&&!c&&t.emit(`reachBeginning toEdge`),o&&!l&&t.emit(`reachEnd toEdge`),(c&&!a||l&&!o)&&t.emit(`fromEdge`),t.emit(`progress`,i)}var mD=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function hD(){let e=this,{slides:t,params:n,slidesEl:r,activeIndex:i}=e,a=e.virtual&&n.virtual.enabled,o=e.grid&&n.grid&&n.grid.rows>1,s=e=>RE(r,`.${n.slideClass}${e}, swiper-slide${e}`)[0],c,l,u;if(a)if(n.loop){let t=i-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),c=s(`[data-swiper-slide-index="${t}"]`)}else c=s(`[data-swiper-slide-index="${i}"]`);else o?(c=t.find(e=>e.column===i),u=t.find(e=>e.column===i+1),l=t.find(e=>e.column===i-1)):c=t[i];c&&(o||(u=WE(c,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!u&&(u=t[0]),l=UE(c,`.${n.slideClass}
378, swiper-slide`)[0],n.loop)),t.forEach(e=>{mD(e,e===c,n.slideActiveClass),mD(e,e===u,n.slideNextClass),mD(e,e===l,n.slidePrevClass)}),e.emitSlidesClasses()}var gD=(e,t)=>{if(!e||e.destroyed||!e.params)return;let n=t.closest(e.isElement?`swiper-slide`:`.${e.params.slideClass}`);if(n){let t=n.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(n.shadowRoot?t=n.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{n.shadowRoot&&(t=n.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&!t.lazyPreloaderManaged&&t.remove())})),t&&!t.lazyPreloaderManaged&&t.remove()}},_D=(e,t)=>{if(!e.slides[t])return;let n=e.slides[t].querySelector(`[loading="lazy"]`);n&&n.removeAttribute(`loading`)},vD=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext,n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);let r=e.params.slidesPerView===`auto`?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){let n=i,a=[n-t];a.push(...Array.from({length:t}).map((e,t)=>n+r+t)),e.slides.forEach((t,n)=>{a.includes(t.column)&&_D(e,n)});return}let a=i+r-1;if(e.params.rewind||e.params.loop)for(let r=i-t;r<=a+t;r+=1){let t=(r%n+n)%n;(t<i||t>a)&&_D(e,t)}else for(let r=Math.max(i-t,0);r<=Math.min(a+t,n-1);r+=1)r!==i&&(r>a||r<i)&&_D(e,r)};function yD(e){let{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate,i;for(let e=0;e<t.length;e+=1)t[e+1]===void 0?r>=t[e]&&(i=e):r>=t[e]&&r<t[e+1]-(t[e+1]-t[e])/2?i=e:r>=t[e]&&r<t[e+1]&&(i=e+1);return n.normalizeSlideIndex&&(i<0||i===void 0)&&(i=0),i}function bD(e){let t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:i,activeIndex:a,realIndex:o,snapIndex:s}=t,c=e,l,u=e=>{let n=e-t.virtual.slidesBefore;return n<0&&(n=t.virtual.slides.length+n),n>=t.virtual.slides.length&&(n-=t.virtual.slides.length),n};if(c===void 0&&(c=yD(t)),r.indexOf(n)>=0)l=r.indexOf(n);else{let e=Math.min(i.slidesPerGroupSkip,c);l=e+Math.floor((c-e)/i.slidesPerGroup)}if(l>=r.length&&(l=r.length-1),c===a&&!t.params.loop){l!==s&&(t.snapIndex=l,t.emit(`snapIndexChange`));return}if(c===a&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=u(c);return}let d=t.grid&&i.grid&&i.grid.rows>1,f;if(t.virtual&&i.virtual.enabled)f=i.loop?u(c):c;else if(d){let e=t.slides.find(e=>e.column===c),n=parseInt(e.getAttribute(`data-swiper-slide-index`),10);Number.isNaN(n)&&(n=Math.max(t.slides.indexOf(e),0)),f=Math.floor(n/i.grid.rows)}else if(t.slides[c]){let e=t.slides[c].getAttribute(`data-swiper-slide-index`);f=e?parseInt(e,10):c}else f=c;Object.assign(t,{previousSnapIndex:s,snapIndex:l,previousRealIndex:o,realIndex:f,previousIndex:a,activeIndex:c}),t.initialized&&vD(t),t.emit(`activeIndexChange`),t.emit(`snapIndexChange`),(t.initialized||t.params.runCallbacksOnInit)&&(o!==f&&t.emit(`realIndexChange`),t.emit(`slideChange`))}function xD(e,t){let n=this,r=n.params,i=e.closest(`.${r.slideClass}, swiper-slide`);!i&&n.isElement&&t&&t.length>
vendor: 31,056 bytes, line 378
3781&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(e=>{!i&&e.matches&&e.matches(`.${r.slideClass}, swiper-slide`)&&(i=e)});let a=!1,o;if(i){for(let e=0;e<n.slides.length;e+=1)if(n.slides[e]===i){a=!0,o=e;break}}if(i&&a)n.clickedSlide=i,n.clickedIndex=n.virtual&&n.params.virtual.enabled?parseInt(i.getAttribute(`data-swiper-slide-index`),10):o;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var SD={updateSize:sD,updateSlides:cD,updateAutoHeight:lD,updateSlidesOffset:uD,updateSlidesProgress:fD,updateProgress:pD,updateSlidesClasses:hD,updateActiveIndex:bD,updateClickedSlide:xD};function CD(e=this.isHorizontal()?`x`:`y`){let t=this,{params:n,rtlTranslate:r,translate:i,wrapperEl:a}=t;if(n.virtualTranslate)return r?-i:i;if(n.cssMode)return i;let o=ME(a,e);return o+=t.cssOverflowAdjustment(),r&&(o=-o),o||0}function wD(e,t){let n=this,{rtlTranslate:r,params:i,wrapperEl:a,progress:o}=n,s=0,c=0;n.isHorizontal()?s=r?-e:e:c=e,i.roundLengths&&(s=Math.floor(s),c=Math.floor(c)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?s:c,i.cssMode?a[n.isHorizontal()?`scrollLeft`:`scrollTop`]=n.isHorizontal()?-s:-c:i.virtualTranslate||(n.isHorizontal()?s-=n.cssOverflowAdjustment():c-=n.cssOverflowAdjustment(),a.style.transform=`translate3d(${s}px, ${c}px, 0px)`);let l,u=n.maxTranslate()-n.minTranslate();l=u===0?0:(e-n.minTranslate())/u,l!==o&&n.updateProgress(e),n.emit(`setTranslate`,n.translate,t)}function TD(){return-this.snapGrid[0]}function ED(){return-this.snapGrid[this.snapGrid.length-1]}function DD(e=0,t=this.params.speed,n=!0,r=!0,i){let a=this,{params:o,wrapperEl:s}=a;if(a.animating&&o.preventInteractionOnTransition)return!1;let c=a.minTranslate(),l=a.maxTranslate(),u;if(u=r&&e>c?c:r&&e<l?l:e,a.updateProgress(u),o.cssMode){let e=a.isHorizontal();if(t===0)s[e?`scrollLeft`:`scrollTop`]=-u;else{if(!a.support.smoothScroll)return LE({swiper:a,targetPosition:-u,side:e?`left`:`top`}),!0;s.scrollTo({[e?`left`:`top`]:-u,behavior:`smooth`})}return!0}return t===0?(a.setTransition(0),a.setTranslate(u),n&&(a.emit(`beforeTransitionStart`,t,i),a.emit(`transitionEnd`))):(a.setTransition(t),a.setTranslate(u),n&&(a.emit(`beforeTransitionStart`,t,i),a.emit(`transitionStart`)),a.animating||(a.animating=!0,a.onTranslateToWrapperTransitionEnd||=function(e){!a||a.destroyed||e.target===this&&(a.wrapperEl.removeEventListener(`transitionend`,a.onTranslateToWrapperTransitionEnd),a.onTranslateToWrapperTransitionEnd=null,delete a.onTranslateToWrapperTransitionEnd,a.animating=!1,n&&a.emit(`transitionEnd`))},a.wrapperEl.addEventListener(`transitionend`,a.onTranslateToWrapperTransitionEnd))),!0}var OD={getTranslate:CD,setTranslate:wD,minTranslate:TD,maxTranslate:ED,translateTo:DD};function kD(e,t){let n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=e===0?`0ms`:``),n.emit(`setTransition`,e,t)}function AD({swiper:e,runCallbacks:t,direction:n,step:r}){let{activeIndex:i,previousIndex:a}=e,o=n;o||=i>a?`next`:i<a?`prev`:`reset`,e.emit(`transition${r}`),t&&o===`reset`?e.emit(`slideResetTransition${r}`):t&&i!==a&&(e.emit(`slideChangeTransition${r}`),o===`next`?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`))}function jD(e=!0,t){let n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),AD({swiper:n,runCallbacks:e,direction:t,step:`Start`}))}function MD(e=!0,t){let n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),AD({swiper:n,runCallbacks:e,direction:t,step:`End`}))}var ND={setTransition:kD,transitionStart:jD,transitionEnd:MD};function PD(e=0,t,n=!0,r,i){typeof e==`string`&&(e=parseInt(e,10));let a=this,o=e;o<0&&(o=0);let{params:s,snapGrid:c,slidesGrid:l,previousIndex:u,activeIndex:d,rtlTranslate:f,wrapperEl:p,enabled:m}=a;if(!m&&!r&&!i||a.destroyed||a.animating&&s.preventInteractionOnTransition)return!1;t===void 0&&(t=a.params.speed);let h=Math.min(a.params.slidesPerGroupSkip,o),g=h+Math.floor((o-h)/a.params.slidesPerGroup);g>=c.length&&(g=c.length-1);let _=-c[g];if(s.normalizeSlideIndex)for(let e=0;e<l.length;e+=1){let t=-Math.floor(_*100),n=Math.floor(l[e]*100),r=Math.floor(l[e+1]*100);l[e+1]===void 0?t>=n&&(o=e):t>=n&&t<r-(r-n)/2?o=e:t>=n&&t<r&&(o=e+1)}if(a.initialized&&o!==d&&(!a.allowSlideNext&&(f?_>a.translate&&_>a.minTranslate():_<a.translate&&_<a.minTranslate())||!a.allowSlidePrev&&_>a.translate&&_>a.maxTranslate()&&(d||0)!==o))return!1;o!==(u||0)&&n&&a.emit(`beforeSlideChangeStart`),a.updateProgress(_);let v;v=o>d?`next`:o<d?`prev`:`reset`;let y=a.virtual&&a.params.virtual.enabled;if(!(y&&i)&&(f&&-_===a.translate||!f&&_===a.translate))return a.updateActiveIndex(o),s.autoHeight&&a.updateAutoHeight(),a.updateSlidesClasses(),s.effect!==`slide`&&a.setTranslate(_),v!==`reset`&&(a.transitionStart(n,v),a.transitionEnd(n,v)),!1;if(s.cssMode){let e=a.isHorizontal(),n=f?_:-_;if(t===0)y&&(a.wrapperEl.style.scrollSnapType=`none`,a._immediateVirtual=!0),y&&!a._cssModeVirtualInitialSet&&a.params.initialSlide>0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{p[e?`scrollLeft`:`scrollTop`]=n})):p[e?`scrollLeft`:`scrollTop`]=n,y&&requestAnimationFrame(()=>{a.wrapperEl.style.scrollSnapType=``,a._immediateVirtual=!1});else{if(!a.support.smoothScroll)return LE({swiper:a,targetPosition:n,side:e?`left`:`top`}),!0;p.scrollTo({[e?`left`:`top`]:n,behavior:`smooth`})}return!0}let b=rD().isSafari;return y&&!i&&b&&a.isElement&&a.virtual.update(!1,!1,o),a.setTransition(t),a.setTranslate(_),a.updateActiveIndex(o),a.updateSlidesClasses(),a.emit(`beforeTransitionStart`,t,r),a.transitionStart(n,v),t===0?a.transitionEnd(n,v):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||=function(e){!a||a.destroyed||e.target===this&&(a.wrapperEl.removeEventListener(`transitionend`,a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(n,v))},a.wrapperEl.addEventListener(`transitionend`,a.onSlideToWrapperTransitionEnd)),!0}function FD(e=0,t,n=!0,r){typeof e==`string`&&(e=parseInt(e,10));let i=this;if(i.destroyed)return;t===void 0&&(t=i.params.speed);let a=i.grid&&i.params.grid&&i.params.grid.rows>1,o=e;if(i.params.loop)if(i.virtual&&i.params.virtual.enabled)o+=i.virtual.slidesBefore;else{let e;if(a){let t=o*i.params.grid.rows;e=i.slides.find(e=>e.getAttribute(`data-swiper-slide-index`)*1===t).column}else e=i.getSlideIndexByData(o);let t=a?Math.ceil(i.slides.length/i.params.grid.rows):i.slides.length,{centeredSlides:n,slidesOffsetBefore:s,slidesOffsetAfter:c}=i.params,l=n||!!s||!!c,u=i.params.slidesPerView;u===`auto`?u=i.slidesPerViewDynamic():(u=Math.ceil(parseFloat(i.params.slidesPerView,10)),l&&u%2==0&&(u+=1));let d=t-e<u;if(l&&(d||=e<Math.ceil(u/2)),r&&l&&i.params.slidesPerView!==`auto`&&!a&&(d=!1),d){let n=l?e<i.activeIndex?`prev`:`next`:e-i.activeIndex-1<i.params.slidesPerView?`next`:`prev`;i.loopFix({direction:n,slideTo:!0,activeSlideIndex:n===`next`?e+1:e-t+1,slideRealIndex:n===`next`?i.realIndex:void 0})}if(a){let e=o*i.params.grid.rows;o=i.slides.find(t=>t.getAttribute(`data-swiper-slide-index`)*1===e).column}else o=i.getSlideIndexByData(o)}return requestAnimationFrame(()=>{i.slideTo(o,t,n,r)}),i}function ID(e,t=!0,n){let r=this,{enabled:i,params:a,animating:o}=r;if(!i||r.destroyed)return r;e===void 0&&(e=r.params.speed);let s=a.slidesPerGroup;a.slidesPerView===`auto`&&a.slidesPerGroup===1&&a.slidesPerGroupAuto&&(s=Math.max(r.slidesPerViewDynamic(`current`,!0),1));let c=r.activeIndex<a.slidesPerGroupSkip?1:s,l=r.virtual&&a.virtual.enabled;if(a.loop){if(o&&!l&&a.loopPreventsSliding)return!1;if(r.loopFix({direction:`next`}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&a.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+c,e,t,n)}),!0}return a.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+c,e,t,n)}function LD(e,t=!0,n){let r=this,{params:i,snapGrid:a,slidesGrid:o,rtlTranslate:s,enabled:c,animating:l}=r;if(!c||r.destroyed)return r;e===void 0&&(e=r.params.speed);let u=r.virtual&&i.virtual.enabled;if(i.loop){if(l&&!u&&i.loopPreventsSliding)return!1;r.loopFix({direction:`prev`}),r._clientLeft=r.wrapperEl.clientLeft}let d=s?r.translate:-r.translate;function f(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}let p=f(d),m=a.map(e=>f(e)),h=i.freeMode&&i.freeMode.enabled,g=a[m.indexOf(p)-1];if(g===void 0&&(i.cssMode||h)){let e;a.forEach((t,n)=>{p>=t&&(e=n)}),e!==void 0&&(g=h?a[e]:a[e>0?e-1:e])}let _=0;if(g!==void 0&&(_=o.indexOf(g),_<0&&(_=r.activeIndex-1),i.slidesPerView===`auto`&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(_=_-r.slidesPerViewDynamic(`previous`,!0)+1,_=Math.max(_,0))),i.rewind&&r.isBeginning){let i=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(i,e,t,n)}return i.loop&&r.activeIndex===0&&i.cssMode?(requestAnimationFrame(()=>{r.slideTo(_,e,t,n)}),!0):r.slideTo(_,e,t,n)}function RD(e,t=!0,n){let r=this;if(!r.destroyed)return e===void 0&&(e=r.params.speed),r.slideTo(r.activeIndex,e,t,n)}function zD(e,t=!0,n,r=.5){let i=this;if(i.destroyed)return;e===void 0&&(e=i.params.speed);let a=i.activeIndex,o=Math.min(i.params.slidesPerGroupSkip,a),s=o+Math.floor((a-o)/i.params.slidesPerGroup),c=i.rtlTranslate?i.translate:-i.translate;if(c>=i.snapGrid[s]){let e=i.snapGrid[s],t=i.snapGrid[s+1];c-e>(t-e)*r&&(a+=i.params.slidesPerGroup)}else{let e=i.snapGrid[s-1],t=i.snapGrid[s];c-e<=(t-e)*r&&(a-=i.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,i.slidesGrid.length-1),i.slideTo(a,e,t,n)}function BD(){let e=this;if(e.destroyed)return;let{params:t,slidesEl:n}=e,r=t.slidesPerView===`auto`?e.slidesPerViewDynamic():t.slidesPerView,i=e.getSlideIndexWhenGrid(e.clickedIndex),a,o=e.isElement?`swiper-slide`:`.${t.slideClass}`,s=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;a=parseInt(e.clickedSlide.getAttribute(`data-swiper-slide-index`),10),t.centeredSlides?e.slideToLoop(a):i>(s?(e.slides.length-r)/2-(e.params.grid.rows-1):e.slides.length-r)?(e.loopFix(),i=e.getSlideIndex(RE(n,`${o}[data-swiper-slide-index="${a}"]`)[0]),kE(()=>{e.slideTo(i)})):e.slideTo(i)}else e.slideTo(i)}var VD={slideTo:PD,slideToLoop:FD,slideNext:ID,slidePrev:LD,slideReset:RD,slideToClosest:zD,slideToClickedSlide:BD};function HD(e,t){let n=this,{params:r,slidesEl:i}=n;if(!r.loop||n.virtual&&n.params.virtual.enabled)return;let a=()=>{RE(i,`.${r.slideClass}, swiper-slide`).forEach((e,t)=>{e.setAttribute(`data-swiper-slide-index`,t)})},o=()=>{let e=RE(i,`.${r.slideBlankClass}`);e.forEach(e=>{e.remove()}),e.length>0&&(n.recalcSlides(),n.updateSlides())},s=n.grid&&r.grid&&r.grid.rows>1;r.loopAddBlankSlides&&(r.slidesPerGroup>1||s)&&o();let c=r.slidesPerGroup*(s?r.grid.rows:1),l=n.slides.length%c!==0,u=s&&n.slides.length%r.grid.rows!==0,d=e=>{for(let t=0;t<e;t+=1){let e=n.isElement?HE(`swiper-slide`,[r.slideBlankClass]):HE(`div`,[r.slideClass,r.slideBlankClass]);n.slidesEl.append(e)}};l?(r.loopAddBlankSlides?(d(c-n.slides.length%c),n.recalcSlides(),n.updateSlides()):VE(`Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)`),a()):(u&&(r.loopAddBlankSlides?(d(r.grid.rows-n.slides.length%r.grid.rows),n.recalcSlides(),n.updateSlides()):VE(`Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)`)),a());let f=r.centeredSlides||!!r.slidesOffsetBefore||!!r.slidesOffsetAfter;n.loopFix({slideRealIndex:e,direction:f?void 0:`next`,initial:t})}function UD({slideRealIndex:e,slideTo:t=!0,direction:n,setTranslate:r,activeSlideIndex:i,initial:a,byController:o,byMousewheel:s}={}){let c=this;if(!c.params.loop)return;c.emit(`beforeLoopFix`);let{slides:l,allowSlidePrev:u,allowSlideNext:d,slidesEl:f,params:p}=c,{centeredSlides:m,slidesOffsetBefore:h,slidesOffsetAfter:g,initialSlide:_}=p,v=m||!!h||!!g;if(c.allowSlidePrev=!0,c.allowSlideNext=!0,c.virtual&&p.virtual.enabled){t&&(!v&&c.snapIndex===0?c.slideTo(c.virtual.slides.length,0,!1,!0):v&&c.snapIndex<p.slidesPerView?c.slideTo(c.virtual.slides.length+c.snapIndex,0,!1,!0):c.snapIndex===c.snapGrid.length-1&&c.slideTo(c.virtual.slidesBefore,0,!1,!0)),c.allowSlidePrev=u,c.allowSlideNext=d,c.emit(`loopFix`);return}let y=p.slidesPerView;y===`auto`?y=c.slidesPerViewDynamic():(y=Math.ceil(parseFloat(p.slidesPerView,10)),v&&y%2==0&&(y+=1));let b=p.slidesPerGroupAuto?y:p.slidesPerGroup,x=v?Math.max(b,Math.ceil(y/2)):b;x%b!==0&&(x+=b-x%b),x+=p.loopAdditionalSlides,c.loopedSlides=x;let S=c.grid&&p.grid&&p.grid.rows>1;l.length<y+x||c.params.effect===`cards`&&l.length<y+x*2?VE(`Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters`):S&&p.grid.fill===`row`&&VE("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");let C=[],w=[],T=S?Math.ceil(l.length/p.grid.rows):l.length,E=a&&T-_<y&&!v,D=E?_:c.activeIndex;i===void 0?i=c.getSlideIndex(l.find(e=>e.classList.contains(p.slideActiveClass))):D=i;let O=n===`next`||!n,k=n===`prev`||!n,A=0,j=0,M=(S?l[i].column:i)+(v&&r===void 0?-y/2+.5:0);if(M<x){A=Math.max(x-M,b);for(let e=0;e<x-M;e+=1){let t=e-Math.floor(e/T)*T;if(S){let e=T-t-1;for(let t=l.length-1;t>=0;--t)l[t].column===e&&C.push(t)}else C.push(T-t-1)}}else if(M+y>T-x){j=Math.max(M-(T-x*2),b),E&&(j=Math.max(j,y-T+_+1));for(let e=0;e<j;e+=1){let t=e-Math.floor(e/T)*T;S?l.forEach((e,n)=>{e.column===t&&w.push(n)}):w.push(t)}}if(c.__preventObserver__=!0,requestAnimationFrame(()=>{c.__preventObserver__=!1}),c.params.effect===`cards`&&l.length<y+x*2&&(w.includes(i)&&w.splice(w.indexOf(i),1),C.includes(i)&&C.splice(C.indexOf(i),1)),k&&C.forEach(e=>{l[e].swiperLoopMoveDOM=!0,f.prepend(l[e]),l[e].swiperLoopMoveDOM=!1}),O&&w.forEach(e=>{l[e].swiperLoopMoveDOM=!0,f.append(l[e]),l[e].swiperLoopMoveDOM=!1}),c.recalcSlides(),p.slidesPerView===`auto`?c.updateSlides():S&&(C.length>0&&k||w.length>0&&O)&&c.slides.forEach((e,t)=>{c.grid.updateSlide(t,e,c.slides)}),p.watchSlidesProgress&&c.updateSlidesOffset(),t){if(C.length>0&&k){if(e===void 0){let e=c.slidesGrid[D],t=c.slidesGrid[D+A]-e;s?c.setTranslate(c.translate-t):(c.slideTo(D+Math.ceil(A),0,!1,!0),r&&(c.touchEventsData.startTranslate=c.touchEventsData.startTranslate-t,c.touchEventsData.currentTranslate=c.touchEventsData.currentTranslate-t))}else if(r){let e=S?C.length/p.grid.rows:C.length;c.slideTo(c.activeIndex+e,0,!1,!0),c.touchEventsData.currentTranslate=c.translate}}else if(w.length>0&&O)if(e===void 0){let e=c.slidesGrid[D],t=c.slidesGrid[D-j]-e;s?c.setTranslate(c.translate-t):(c.slideTo(D-j,0,!1,!0),r&&(c.touchEventsData.startTranslate=c.touchEventsData.startTranslate-t,c.touchEventsData.currentTranslate=c.touchEventsData.currentTranslate-t))}else{let e=S?w.length/p.grid.rows:w.length;c.slideTo(c.activeIndex-e,0,!1,!0)}}if(c.allowSlidePrev=u,c.allowSlideNext=d,c.controller&&c.controller.control&&!o){let a={slideRealIndex:e,direction:n,setTranslate:r,activeSlideIndex:i,byController:!0};Array.isArray(c.controller.control)?c.controller.control.forEach(e=>{!e.destroyed&&e.params.loop&&e.loopFix({...a,slideTo:e.params.slidesPerView===p.slidesPerView&&t})}):c.controller.control instanceof c.constructor&&c.controller.control.params.loop&&c.controller.control.loopFix({...a,slideTo:c.controller.control.params.slidesPerView===p.slidesPerView&&t})}c.emit(`loopFix`)}function WD(){let e=this,{params:t,slidesEl:n}=e;if(!t.loop||!n||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();let r=[];e.slides.forEach(e=>{let t=e.swiperSlideIndex===void 0?e.getAttribute(`data-swiper-slide-index`)*1:e.swiperSlideIndex;r[t]=e}),e.slides.forEach(e=>{e.removeAttribute(`data-swiper-slide-index`)}),r.forEach(e=>{n.append(e)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}var GD={loopCreate:HD,loopFix:UD,loopDestroy:WD};function KD(e){let t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;let n=t.params.touchEventsTarget===`container`?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor=`move`,n.style.cursor=e?`grabbing`:`grab`,t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function qD(){let e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget===`container`?`el`:`wrapperEl`].style.cursor=``,e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var JD={setGrabCursor:KD,unsetGrabCursor:qD};function YD(e,t=this){function n(t){if(!t||t===wE()||t===EE())return null;t.assignedSlot&&(t=t.assignedSlot);let r=t.closest(e);return!r&&!t.getRootNode?null:r||n(t.getRootNode().host)}return n(t)}function XD(e,t,n){let r=EE(),{params:i}=e,a=i.edgeSwipeDetection,o=i.edgeSwipeThreshold;return a&&(n<=o||n>=r.innerWidth-o)?a===`prevent`&&(t.preventDefault(),!0):!0}function ZD(e){let t=this;if(t.destroyed)return;let n=wE(),r=e;r.originalEvent&&(r=r.originalEvent);let i=t.touchEventsData;if(r.type===`pointerdown`){if(i.pointerId!==null&&i.pointerId!==r.pointerId)return;i.pointerId=r.pointerId}else r.type===`touchstart`&&r.targetTouches.length===1&&(i.touchId=r.targetTouches[0].identifier);if(r.type===`touchstart`){XD(t,r,r.targetTouches[0].pageX);return}let{params:a,touches:o,enabled:s}=t;if(!s||!a.simulateTouch&&r.pointerType===`mouse`||t.animating&&a.preventInteractionOnTransition)return;!t.animating&&a.cssMode&&a.loop&&t.loopFix();let c=r.target;if(a.touchEventsTarget===`wrapper`&&!BE(c,t.wrapperEl)||`which`in r&&r.which===3||`button`in r&&r.button>0||i.isTouched&&i.isMoved)return;let l=!!a.noSwipingClass&&a.noSwipingClass!==``,u=r.composedPath?r.composedPath():r.path;l&&r.target&&r.target.shadowRoot&&u&&(c=u[0]);let d=a.noSwipingSelector?a.noSwipingSelector:`.${a.noSwipingClass}`,f=!!(r.target&&r.target.shadowRoot);if(a.noSwiping&&(f?YD(d,c):c.closest(d))){t.allowClick=!0;return}if(a.swipeHandler&&!c.closest(a.swipeHandler))return;o.currentX=r.pageX,o.currentY=r.pageY;let p=o.currentX,m=o.currentY;if(!XD(t,r,p))return;Object.assign(i,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=p,o.startY=m,i.touchStartTime=AE(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,a.threshold>0&&(i.allowThresholdMove=!1);let h=!0;c.matches(i.focusableElements)&&(h=!1,c.nodeName===`SELECT`&&(i.isTouched=!1)),n.activeElement&&n.activeElement.matches(i.focusableElements)&&n.activeElement!==c&&(r.pointerType===`mouse`||r.pointerType!==`mouse`&&!c.matches(i.focusableElements))&&n.activeElement.blur();let g=h&&t.allowTouchMove&&a.touchStartPreventDefault;(a.touchStartForcePreventDefault||g)&&!c.isContentEditable&&r.preventDefault(),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.animating&&!a.cssMode&&t.freeMode.onTouchStart(),t.emit(`touchStart`,r)}function QD(e){let t=wE(),n=this;if(n.destroyed)return;let r=n.touchEventsData,{params:i,touches:a,rtlTranslate:o,enabled:s}=n;if(!s||!i.simulateTouch&&e.pointerType===`mouse`)return;let c=e;if(c.originalEvent&&(c=c.originalEvent),c.type===`pointermove`&&(r.touchId!==null||c.pointerId!==r.pointerId))return;let l;if(c.type===`touchmove`){if(l=[...c.changedTouches].find(e=>e.identifier===r.touchId),!l||l.identifier!==r.touchId)return}else l=c;if(!r.isTouched){r.startMoving&&r.isScrolling&&n.emit(`touchMoveOpposite`,c);return}let u=l.pageX,d=l.pageY;if(c.preventedByNestedSwiper){a.startX=u,a.startY=d;return}if(!n.allowTouchMove){c.target.matches(r.focusableElements)||(n.allowClick=!1),r.isTouched&&(Object.assign(a,{startX:u,startY:d,currentX:u,currentY:d}),r.touchStartTime=AE());return}if(i.touchReleaseOnEdges&&!i.loop){if(n.isVertical()){if(d<a.startY&&n.translate<=n.maxTranslate()||d>a.startY&&n.translate>=n.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else if(o&&(u>a.startX&&-n.translate<=n.maxTranslate()||u<a.startX&&-n.translate>=n.minTranslate()))return;else if(!o&&(u<a.startX&&n.translate<=n.maxTranslate()||u>a.startX&&n.translate>=n.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==c.target&&c.pointerType!==`mouse`&&t.activeElement.blur(),t.activeElement&&c.target===t.activeElement&&c.target.matches(r.focusableElements)){r.isMoved=!0,n.allowClick=!1;return}r.allowTouchCallbacks&&n.emit(`touchMove`,c),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=u,a.currentY=d;let f=a.currentX-a.startX,p=a.currentY-a.startY;if(n.params.threshold&&Math.sqrt(f**2+p**2)<n.params.threshold)return;if(r.isScrolling===void 0){let e;n.isHorizontal()&&a.currentY===a.startY||n.isVertical()&&a.currentX===a.startX?r.isScrolling=!1:f*f+p*p>=25&&(e=Math.atan2(Math.abs(p),Math.abs(f))*180/Math.PI,r.isScrolling=n.isHorizontal()?e>i.touchAngle:90-e>i.touchAngle)}if(r.isScrolling&&n.emit(`touchMoveOpposite`,c),r.startMoving===void 0&&(a.currentX!==a.startX||a.currentY!==a.startY)&&(r.startMoving=!0),r.isScrolling||c.type===`touchmove`&&r.preventTouchMoveFromPointerMove){r.isTouched=!1;return}if(!r.startMoving)return;n.allowClick=!1,!i.cssMode&&c.cancelable&&c.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&c.stopPropagation();let m=n.isHorizontal()?f:p,h=n.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;i.oneWayMovement&&(m=Math.abs(m)*(o?1:-1),h=Math.abs(h)*(o?1:-1)),a.diff=m,m*=i.touchRatio,o&&(m=-m,h=-h);let g=n.touchesDirection;n.swipeDirection=m>0?`prev`:`next`,n.touchesDirection=h>0?`prev`:`next`;let _=n.params.loop&&!i.cssMode,v=n.touchesDirection===`next`&&n.allowSlideNext||n.touchesDirection===`prev`&&n.allowSlidePrev;if(!r.isMoved){if(_&&v&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){let e=new window.CustomEvent(`transitionend`,{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});n.wrapperEl.dispatchEvent(e)}r.allowMomentumBounce=!1,i.grabCursor&&(n.allowSlideNext===!0||n.allowSlidePrev===!0)&&n.setGrabCursor(!0),n.emit(`sliderFirstMove`,c)}if(new Date().getTime(),i._loopSwapReset!==!1&&r.isMoved&&r.allowThresholdMove&&g!==n.touchesDirection&&_&&v&&Math.abs(m)>=1){Object.assign(a,{startX:u,startY:d,currentX:u,currentY:d,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}n.emit(`sliderMove`,c),r.isMoved=!0,r.currentTranslate=m+r.startTranslate;let y=!0,b=i.resistanceRatio;if(i.touchReleaseOnEdges&&(b=0),m>0?(_&&v&&r.allowThresholdMove&&r.currentTranslate>(i.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]-(i.slidesPerView!==`auto`&&n.slides.length-i.slidesPerView>=2?n.slidesSizesGrid[n.activeIndex+1]+n.params.spaceBetween:0)-n.params.spaceBetween:n.minTranslate())&&n.loopFix({direction:`prev`,setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(y=!1,i.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+m)**b))):m<0&&(_&&v&&r.allowThresholdMove&&r.currentTranslate<(i.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween+(i.slidesPerView!==`auto`&&n.slides.length-i.slidesPerView>=2?n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween:0):n.maxTranslate())&&n.loopFix({direction:`next`,setTranslate:!0,activeSlideIndex:n.slides.length-(i.slidesPerView===`auto`?n.slidesPerViewDynamic():Math.ceil(parseFloat(i.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(y=!1,i.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-m)**b))),y&&(c.preventedByNestedSwiper=!0),!n.allowSlideNext&&n.swipeDirection===`next`&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&n.swipeDirection===`prev`&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(r.currentTranslate=r.startTranslate),i.threshold>0)if(Math.abs(m)>i.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,r.currentTranslate=r.startTranslate,a.diff=n.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY;return}}else{r.currentTranslate=r.startTranslate;return}!i.followFinger||i.cssMode||((i.freeMode&&i.freeMode.enabled&&n.freeMode||i.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),i.freeMode&&i.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function $D(e){let t=this;if(t.destroyed)return;let n=t.touchEventsData,r=e;r.originalEvent&&(r=r.originalEvent);let i;if(r.type!==`touchend`&&r.type!==`touchcancel`){if(n.touchId!==null||r.pointerId!==n.pointerId)return;i=r}else if(i=[...r.changedTouches].find(e=>e.identifier===n.touchId),!i||i.identifier!==n.touchId)return;if([`pointercancel`,`pointerout`,`pointerleave`,`contextmenu`].includes(r.type)&&!([`pointercancel`,`contextmenu`].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return;n.pointerId=null,n.touchId=null;let{params:a,touches:o,rtlTranslate:s,slidesGrid:c,enabled:l}=t;if(!l||!a.simulateTouch&&r.pointerType===`mouse`)return;if(n.allowTouchCallbacks&&t.emit(`touchEnd`,r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&a.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}a.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);let u=AE(),d=u-n.touchStartTime;if(t.allowClick){let e=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(e&&e[0]||r.target,e),t.emit(`tap click`,r),d<300&&u-n.lastClickTime<300&&t.emit(`doubleTap doubleClick`,r)}if(n.lastClickTime=AE(),kE(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||o.diff===0&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset){n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;return}n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;let f;if(f=a.followFinger?s?t.translate:-t.translate:-n.currentTranslate,a.cssMode)return;if(a.freeMode&&a.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:f});return}let p=f>=-t.maxTranslate()&&!t.params.loop,m=0,h=t.slidesSizesGrid[0];for(let e=0;e<c.length;e+=e<a.slidesPerGroupSkip?1:a.slidesPerGroup){let t=e<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;c[e+t]===void 0?(p||f>=c[e])&&(m=e,h=c[c.length-1]-c[c.length-2]):(p||f>=c[e]&&f<c[e+t])&&(m=e,h=c[e+t]-c[e])}let g=null,_=null;a.rewind&&(t.isBeginning?_=a.virtual&&a.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(g=0));let v=(f-c[m])/h,y=m<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;if(d>a.longSwipesMs){if(!a.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection===`next`&&(v>=a.longSwipesRatio?t.slideTo(a.rewind&&t.isEnd?g:m+y):t.slideTo(m)),t.swipeDirection===`prev`&&(v>1-a.longSwipesRatio?t.slideTo(m+y):_!==null&&v<0&&Math.abs(v)>a.longSwipesRatio?t.slideTo(_):t.slideTo(m))}else{if(!a.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(m+y):t.slideTo(m):(t.swipeDirection===`next`&&t.slideTo(g===null?m+y:g),t.swipeDirection===`prev`&&t.slideTo(_===null?m:_))}}function eO(){let e=this,{params:t,el:n}=e;if(n&&n.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();let{allowSlideNext:r,allowSlidePrev:i,snapGrid:a}=e,o=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();let s=o&&t.loop;if((t.slidesPerView===`auto`||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!s){let t=o?e.virtual.slides:e.slides;e.slideTo(t.length-1,0,!1,!0)}else e.params.loop&&!o?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0);e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=i,e.allowSlideNext=r,e.params.watchOverflow&&a!==e.snapGrid&&e.checkOverflow()}function tO(e){let t=this;t.destroyed||t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function nO(){let e=this;if(e.destroyed)return;let{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;e.previousTranslate=e.translate,e.translate=e.isHorizontal()?-t.scrollLeft:-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let i,a=e.maxTranslate()-e.minTranslate();i=a===0?0:(e.translate-e.minTranslate())/a,i!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit(`setTranslate`,e.translate,!1)}function rO(e){let t=this;t.destroyed||(gD(t,e.target),!(t.params.cssMode||t.params.slidesPerView!==`auto`&&!t.params.autoHeight)&&t.update())}function iO(){let e=this;e.destroyed||e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction=`auto`))}var aO=(e,t)=>{let n=wE(),{params:r,el:i,wrapperEl:a,device:o}=e,s=!!r.nested,c=t===`on`?`addEventListener`:`removeEventListener`,l=t;!i||typeof i==`string`||(n[c](`touchstart`,e.onDocumentTouchStart,{passive:!1,capture:s}),i[c](`touchstart`,e.onTouchStart,{passive:!1}),i[c](`pointerdown`,e.onTouchStart,{passive:!1}),n[c](`touchmove`,e.onTouchMove,{passive:!1,capture:s}),n[c](`pointermove`,e.onTouchMove,{passive:!1,capture:s}),n[c](`touchend`,e.onTouchEnd,{passive:!0}),n[c](`pointerup`,e.onTouchEnd,{passive:!0}),n[c](`pointercancel`,e.onTouchEnd,{passive:!0}),n[c](`touchcancel`,e.onTouchEnd,{passive:!0}),n[c](`pointerout`,e.onTouchEnd,{passive:!0}),n[c](`pointerleave`,e.onTouchEnd,{passive:!0}),n[c](`contextmenu`,e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&i[c](`click`,e.onClick,!0),r.cssMode&&a[c](`scroll`,e.onScroll),r.updateOnWindowResize?e[l](o.ios||o.android?`resize orientationchange observerUpdate`:`resize observerUpdate`,eO,!0):e[l](`observerUpdate`,eO,!0),i[c](`load`,e.onLoad,{capture:!0}))};function oO(){let e=this,{params:t}=e;e.onTouchStart=ZD.bind(e),e.onTouchMove=QD.bind(e),e.onTouchEnd=$D.bind(e),e.onDocumentTouchStart=iO.bind(e),t.cssMode&&(e.onScroll=nO.bind(e)),e.onClick=tO.bind(e),e.onLoad=rO.bind(e),aO(e,`on`)}function sO(){aO(this,`off`)}var cO={attachEvents:oO,detachEvents:sO},lO=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function uO(){let e=this,{realIndex:t,initialized:n,params:r,el:i}=e,a=r.breakpoints;if(!a||a&&Object.keys(a).length===0)return;let o=wE(),s=r.breakpointsBase===`window`||!r.breakpointsBase?r.breakpointsBase:`container`,c=[`window`,`container`].includes(r.breakpointsBase)||!r.breakpointsBase?e.el:o.querySelector(r.breakpointsBase),l=e.getBreakp
vendor: 6,195 bytes, line 378
378oint(a,s,c);if(!l||e.currentBreakpoint===l)return;let u=(l in a?a[l]:void 0)||e.originalParams,d=lO(e,r),f=lO(e,u),p=e.params.grabCursor,m=u.grabCursor,h=r.enabled;d&&!f?(i.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!d&&f&&(i.classList.add(`${r.containerModifierClass}grid`),(u.grid.fill&&u.grid.fill===`column`||!u.grid.fill&&r.grid.fill===`column`)&&i.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),p&&!m?e.unsetGrabCursor():!p&&m&&e.setGrabCursor(),[`navigation`,`pagination`,`scrollbar`].forEach(t=>{if(u[t]===void 0)return;let n=r[t]&&r[t].enabled,i=u[t]&&u[t].enabled;n&&!i&&e[t].disable(),!n&&i&&e[t].enable()});let g=u.direction&&u.direction!==r.direction,_=r.loop&&(u.slidesPerView!==r.slidesPerView||g),v=r.loop;g&&n&&e.changeDirection(),FE(e.params,u);let y=e.params.enabled,b=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),h&&!y?e.disable():!h&&y&&e.enable(),e.currentBreakpoint=l,e.emit(`_beforeBreakpoint`,u),n&&(_?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!v&&b?(e.loopCreate(t),e.updateSlides()):v&&!b&&e.loopDestroy()),e.emit(`breakpoint`,u)}function dO(e,t=`window`,n){if(!e||t===`container`&&!n)return;let r=!1,i=EE(),a=t===`window`?i.innerHeight:n.clientHeight,o=Object.keys(e).map(e=>{if(typeof e==`string`&&e.indexOf(`@`)===0){let t=parseFloat(e.substr(1));return{value:a*t,point:e}}return{value:e,point:e}});o.sort((e,t)=>parseInt(e.value,10)-parseInt(t.value,10));for(let e=0;e<o.length;e+=1){let{point:a,value:s}=o[e];t===`window`?i.matchMedia(`(min-width: ${s}px)`).matches&&(r=a):s<=n.clientWidth&&(r=a)}return r||`max`}var fO={setBreakpoint:uO,getBreakpoint:dO};function pO(e,t){let n=[];return e.forEach(e=>{typeof e==`object`?Object.keys(e).forEach(r=>{e[r]&&n.push(t+r)}):typeof e==`string`&&n.push(t+e)}),n}function mO(){let e=this,{classNames:t,params:n,rtl:r,el:i,device:a}=e,o=pO([`initialized`,n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&n.grid.fill===`column`},{android:a.android},{ios:a.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...o),i.classList.add(...t),e.emitContainerClasses()}function hO(){let e=this,{el:t,classNames:n}=e;!t||typeof t==`string`||(t.classList.remove(...n),e.emitContainerClasses())}var gO={addClasses:mO,removeClasses:hO};function _O(){let e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){let t=e.slides.length-1,n=e.slidesGrid[t]+e.slidesSizesGrid[t]+r*2;e.isLocked=e.size>n}else e.isLocked=e.snapGrid.length===1;n.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),n.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?`lock`:`unlock`)}var vO={checkOverflow:_O},yO={init:!0,direction:`horizontal`,oneWayMovement:!1,swiperElementNodeName:`SWIPER-CONTAINER`,touchEventsTarget:`wrapper`,initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:`swiper`,enabled:!0,focusableElements:`input, select, option, textarea, button, video, label`,width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:`slide`,breakpoints:void 0,breakpointsBase:`window`,spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:`swiper-no-swiping`,noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:`swiper-`,slideClass:`swiper-slide`,slideBlankClass:`swiper-slide-blank`,slideActiveClass:`swiper-slide-active`,slideVisibleClass:`swiper-slide-visible`,slideFullyVisibleClass:`swiper-slide-fully-visible`,slideNextClass:`swiper-slide-next`,slidePrevClass:`swiper-slide-prev`,wrapperClass:`swiper-wrapper`,lazyPreloaderClass:`swiper-lazy-preloader`,lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function bO(e,t){return function(n={}){let r=Object.keys(n)[0],i=n[r];if(typeof i!=`object`||!i){FE(t,n);return}if(e[r]===!0&&(e[r]={enabled:!0}),r===`navigation`&&e[r]&&e[r].enabled&&!e[r].prevEl&&!e[r].nextEl&&(e[r].auto=!0),[`pagination`,`scrollbar`].indexOf(r)>=0&&e[r]&&e[r].enabled&&!e[r].el&&(e[r].auto=!0),!(r in e&&`enabled`in i)){FE(t,n);return}typeof e[r]==`object`&&!(`enabled`in e[r])&&(e[r].enabled=!0),e[r]||(e[r]={enabled:!1}),FE(t,n)}}var xO={eventsEmitter:oD,update:SD,translate:OD,transition:ND,slide:VD,loop:GD,grabCursor:JD,events:cO,breakpoints:fO,checkOverflow:vO,classes:gO},SO={},CO=class e{constructor(...t){let n,r;t.length===1&&t[0].constructor&&Object.prototype.toString.call(t[0]).slice(8,-1)===`Object`?r=t[0]:[n,r]=t,r||={},r=FE({},r),n&&!r.el&&(r.el=n);let i=wE();if(r.el&&typeof r.el==`string`&&i.querySelectorAll(r.el).length>1){let t=[];return i.querySelectorAll(r.el).forEach(n=>{let i=FE({},r,{el:n});t.push(new e(i))}),t}let a=this;a.__swiper__=!0,a.support=ZE(),a.device=eD({userAgent:r.userAgent}),a.browser=rD(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__],r.modules&&Array.isArray(r.modules)&&r.modules.forEac
vendor: 7,103 bytes, line 378
378h(e=>{typeof e==`function`&&a.modules.indexOf(e)<0&&a.modules.push(e)});let o={};return a.modules.forEach(e=>{e({params:r,swiper:a,extendParams:bO(r,o),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})}),a.params=FE({},FE({},yO,o),SO,r),a.originalParams=FE({},a.params),a.passedParams=FE({},r),a.params&&a.params.on&&Object.keys(a.params.on).forEach(e=>{a.on(e,a.params.on[e])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),Object.assign(a,{enabled:a.params.enabled,el:n,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return a.params.direction===`horizontal`},isVertical(){return a.params.direction===`vertical`},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit(`_swiper`),a.params.init&&a.init(),a}getDirectionLabel(e){return this.isHorizontal()?e:{width:`height`,"margin-top":`margin-left`,"margin-bottom ":`margin-right`,"margin-left":`margin-top`,"margin-right":`margin-bottom`,"padding-left":`padding-top`,"padding-right":`padding-bottom`,marginRight:`marginBottom`}[e]}getSlideIndex(e){let{slidesEl:t,params:n}=this,r=KE(RE(t,`.${n.slideClass}, swiper-slide`)[0]);return KE(e)-r}getSlideIndexByData(e){return this.getSlideIndex(this.slides.find(t=>t.getAttribute(`data-swiper-slide-index`)*1===e))}getSlideIndexWhenGrid(e){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill===`column`?e=Math.floor(e/this.params.grid.rows):this.params.grid.fill===`row`&&(e%=Math.ceil(this.slides.length/this.params.grid.rows))),e}recalcSlides(){let e=this,{slidesEl:t,params:n}=e;e.slides=RE(t,`.${n.slideClass}, swiper-slide`)}enable(){let e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit(`enable`))}disable(){let e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit(`disable`))}setProgress(e,t){let n=this;e=Math.min(Math.max(e,0),1);let r=n.minTranslate(),i=(n.maxTranslate()-r)*e+r;n.translateTo(i,t===void 0?0:t),n.updateActiveIndex(),n.updateSlidesClasses()}emitContainerClasses(){let e=this;if(!e.params._emitClasses||!e.el)return;let t=e.el.className.split(` `).filter(t=>t.indexOf(`swiper`)===0||t.indexOf(e.params.containerModifierClass)===0);e.emit(`_containerClasses`,t.join(` `))}getSlideClasses(e){let t=this;return t.destroyed?``:e.className.split(` `).filter(e=>e.indexOf(`swiper-slide`)===0||e.indexOf(t.params.slideClass)===0).join(` `)}emitSlidesClasses(){let e=this;if(!e.params._emitClasses||!e.el)return;let t=[];e.slides.forEach(n=>{let r=e.getSlideClasses(n);t.push({slideEl:n,classNames:r}),e.emit(`_slideClass`,n,r)}),e.emit(`_slideClasses`,t)}slidesPerViewDynamic(e=`current`,t=!1){let{params:n,slides:r,slidesGrid:i,slidesSizesGrid:a,size:o,activeIndex:s}=this,c=1;if(typeof n.slidesPerView==`number`)return n.slidesPerView;if(n.centeredSlides){let e=r[s]?Math.ceil(r[s].swiperSlideSize):0,t;for(let n=s+1;n<r.length;n+=1)r[n]&&!t&&(e+=Math.ceil(r[n].swiperSlideSize),c+=1,e>o&&(t=!0));for(let n=s-1;n>=0;--n)r[n]&&!t&&(e+=r[n].swiperSlideSize,c+=1,e>o&&(t=!0))}else if(e===`current`)for(let e=s+1;e<r.length;e+=1)(t?i[e]+a[e]-i[s]<o:i[e]-i[s]<o)&&(c+=1);else for(let e=s-1;e>=0;--e)i[s]-i[e]<o&&(c+=1);return c}update(){let e=this;if(!e||e.destroyed)return;let{snapGrid:t,params:n}=e;n.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll(`[loading="lazy"]`)].forEach(t=>{t.complete&&gD(e,t)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function r(){let t=e.rtlTranslate?e.translate*-1:e.translate,n=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(n),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if(n.freeMode&&n.freeMode.enabled&&!n.cssMode)r(),n.autoHeight&&e.updateAutoHeight();else{if((n.slidesPerView===`auto`||n.slidesPerView>1)&&e.isEnd&&!n.centeredSlides){let t=e.virtual&&n.virtual.enabled?e.virtual.slides:e.slides;i=e.slideTo(t.length-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||r()}n.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit(`update`)}changeDirection(e,t=!0){let n=this,r=n.params.direction;return e||=r===`horizontal`?`vertical`:`horizontal`,e===r||e!==`horizontal`&&e!==`vertical`?n:(n.el.classList.remove(`${n.params.containerModifierClass}${r}`),n.el.classList.add(`${n.params.containerModifierClass}${e}`),n.emitContainerClasses(),n.params.direction=e,n.slides.forEach(t=>{e===`vertical`?t.style.width=``:t.style.height=``}),n.emit(`changeDirection`),t&&n.update(),n)}changeLanguageDirection(e){let t=this;t.rtl&&e===`rtl`||!t.rtl&&e===`ltr`||(t.rtl=e===`rtl`,t.rtlTranslate=t.params.direction===`horizontal`&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir=`rtl`):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir=`ltr`),t.update())}mount(e){let t=this;if(t.mounted)return!0;let n=e||t.params.el;if(typeof n==`string`&&(n=document.querySelector(n)),!n)return!1;n.swiper=t,n.parentNode&&n.parentNode.host&&n.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);let r=()=>`.${(t.params.wrapperClass||``).trim().split(` `).join(`.`)}`,i=n&&n.shadowRoot&&n.shadowRoot.querySelector?n.shadowRoot.querySelector(r()):RE(n,r())[0];return!i&&t.params.createElements&&(i=HE(`div`,t.params.wrapperClass),n.append(i),RE(n,`.${t.params.slideClass}`).forEach(e=>{i.append(e)})),Object.assign(t,{el:n,wrapperEl:i,slidesEl:t.isElement&&!n.parentNode.host.slideSlots?n.parentNode.host:i,hostEl:t.isElement?n.parentNode.host:n,mounted:!0,rtl:n.dir.toLowerCase()===`rtl`||GE(n,`direction`)===`rtl`,rtlTranslate:t.params.direction===`horizontal`&&(n.dir.toLowerCase()===`rtl`||GE(n,`direction`)===`rtl`),wrongRTL:GE(i,`display`)===`-webkit-box`}),!0}init(e){let t=this;if(t.initialized||t.mount(e)===!1)return t;t.emit(`beforeInit`),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(void 0,!0),t.attachEvents();let n=[...t.el.querySelectorAll(`[loading="lazy"]`)];return t.isElement&&n.push(...t.hostEl.querySelectorAll(`[loading="lazy"]`)),n.forEac
378h(e=>{e.complete?gD(t,e):e.addEventListener(`load`,e=>{gD(t,e.target)})}),vD(t),t.initialized=!0,vD(t),t.emit(`init`),t.emit(`afterInit`),t}destroy(e=!0,t=!0){let n=this,{params:r,el:i,wrapperEl:a,slides:o}=n;return n.params===void 0||n.destroyed?null:(n.emit(`beforeDestroy`),n.initialized=!1,n.detachEvents(),r.loop&&n.loopDestroy(),t&&(n.removeClasses(),i&&typeof i!=`string`&&i.removeAttribute(`style`),a&&a.removeAttribute(`style`),o&&o.length&&o.forEach(e=>{e.classList.remove(r.slideVisibleClass,r.slideFullyVisibleClass,r.slideActiveClass,r.slideNextClass,r.slidePrevClass),e.removeAttribute(`style`),e.removeAttribute(`data-swiper-slide-index`)})),n.emit(`destroy`),Object.keys(n.eventsListeners).forEach(e=>{n.off(e)}),e!==!1&&(n.el&&typeof n.el!=`string`&&(n.el.swiper=null),OE(n)),n.destroyed=!0,null)}static extendDefaults(e){FE(SO,e)}static get extendedDefaults(){return SO}static get defaults(){return yO}static installModule(t){e.prototype.__modules__||(e.prototype.__modules__=[]);let n=e.prototype.__modules__;typeof t==`function`&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(t=>e.installModule(t)),e):(e.installModule(t),e)}};Object.keys(xO).forEach(e=>{Object.keys(xO[e]).forEach(t=>{CO.prototype[t]=xO[e][t]})}),CO.use([iD,aD]);var wO=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],TO=wO.join(`,`),EO=typeof Element>`u`,DO=EO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,OO=!EO&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},kO=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):kO(e.parentNode))},AO=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},jO=function(e,t,n){if(kO(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(TO));return t&&DO.call(e,TO)&&r.unshift(e),r=r.filter(n),r},MO=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!kO(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=MO(o.length?o:a.children,!0,n);
vendor: 4,888 bytes, line 378
378n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{DO.call(a,TO)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!kO(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=MO(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},NO=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},PO=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||AO(e))&&!NO(e)?0:e.tabIndex},FO=function(e,t){var n=PO(e);return n<0&&t&&!NO(e)?0:n},IO=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},LO=function(e){return e.tagName===`INPUT`},RO=function(e){return LO(e)&&e.type===`hidden`},zO=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},BO=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},VO=function(e){if(!e.name)return!0;var t=e.form||OO(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=BO(r,e.form);return!i||i===e},HO=function(e){return LO(e)&&e.type===`radio`},UO=function(e){return HO(e)&&!VO(e)},WO=function(e){var t=e&&OO(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=OO(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},GO=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},KO=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=DO.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(DO.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=OO(e);if(o&&!o.shadowRoot&&r(o)===!0)return GO(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(WO(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return GO(e);return!1},qO=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return DO.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},JO=function(e,t){return!(t.disabled||RO(t)||KO(t,e)||zO(t)||qO(t))},YO=function(e,t){return!(UO(t)||PO(t)<0||!JO(e,t))},XO=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},ZO=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=FO(a,i),s=i?ZO(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(IO).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},QO=function(e,t){return t||={},ZO(t.getShadowRoot?MO([e],t.includeContainer,{filter:YO.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:XO}):jO(e,t.includeContainer,YO.bind(null,t)))},$O=function(e,t){return t||={},t.getShadowRoot?MO([e],t.includeContainer,{filter:JO.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):jO(e,t.includeContainer,JO.bind(null,t))},ek=function(e,t){if(t||={},!e)throw Error(`No node provided`);return DO.call(e,TO)!==!1&&YO(t,e)},tk=wO.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),nk=function(e,t){if(t||={},!e)throw Error(`No node provided`);return DO.call(e,tk)!==!1&&JO(t,e)};function rk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ik(e){if(Array.isArray(e))return rk(e)}function ak(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function ok(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){ak(a,r,i,o,s,`next`,e)}function s(e){ak(a,r,i,o,s,`throw`,e)}o(void 0)})}}function sk(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];
vendor: 6,211 bytes, lines 378-380
378if(!n){if(Array.isArray(e)||(n=vk(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
379In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function ck(e,t,n){return(t=_k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lk(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function uk(){throw TypeError(`Invalid attempt to spread non-iterable instance.
380In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dk(Object(n),!0).forEach(function(t){ck(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pk(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return mk(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(mk(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,mk(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,mk(d,`constructor`,l),mk(l,`constructor`,c),c.displayName=`GeneratorFunction`,mk(l,i,`GeneratorFunction`),mk(d),mk(d,i,`Generator`),mk(d,r,function(){return this}),mk(d,`toString`,function(){return`[object Generator]`}),(pk=function(){return{w:a,m:f}})()}function mk(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}mk=function(e,t,n,r){function a(t,n){mk(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},mk(e,t,n,r)}function hk(e){return ik(e)||lk(e)||vk(e)||uk()}function gk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _k(e){var t=gk(e,`string`);return typeof t==`symbol`?t:t+``}function vk(e,t){if(e){if(typeof e==`string`)return rk(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rk(e,t):void 0}}var yk={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){t!==yk.getActiveTrap(e)&&yk.pauseTrap(e);var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),yk.unpauseTrap(e)},pauseTrap:function(e){yk.getActiveTrap(e)?._setPausedState(!0)},unpauseTrap:function(e){var t=yk.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},bk=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},xk=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},Sk=function(e){return e?.key===`Tab`||e?.keyCode===9},Ck=function(e){return Sk(e)&&!e.shiftKey},wk=function(e){return Sk(e)&&e.shiftKey},Tk=function(e){return setTimeout(e,0)},Ek=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return typeof e==`function`?e.apply(void 0,n):e},Dk=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},Ok=[],kk=function(e,t){var n=t?.document||document,r=t?.trapStack||Ok,i=fk({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Ck,isKeyBackward:wk},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r!==void 0&&r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,hk(s))),c===!0&&(c=void 0),!c){
vendor: 6,304 bytes, line 380
380if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!nk(e,i.tabbableOptions))if(c(n.activeElement)>=0)e=n.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l(`fallbackFocus`)}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=QO(e,i.tabbableOptions),n=$O(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return ek(e)}),s=n.slice().reverse().find(function(e){return ek(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return PO(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return ek(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return ek(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)},f=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&t.shadowRoot.activeElement!==null?f(t.shadowRoot):t},p=function(e){if(e!==!1&&e!==f(document)){if(!e||!e.focus){p(u());return}e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,bk(e)&&e.select()}},m=function(e){var t=l(`setReturnFocus`,{params:[e]});return t||t!==!1&&e},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=r!==void 0&&r;t||=Dk(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),f=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var p=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(p<0&&(f.container===t||nk(t,i.tabbableOptions)&&!ek(t,i.tabbableOptions)&&!f.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=p===0?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];s=PO(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else Sk(n)||(s=f.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(f.container===t||nk(t,i.tabbableOptions)&&!ek(t,i.tabbableOptions)&&!f.nextTabbableNode(t))&&(g=u),g>=0){var _=g===a.tabbableGroups.length-1?0:g+1,v=a.tabbableGroups[_];s=PO(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else Sk(n)||(s=f.nextTabbableNode(t))}}else s=l(`fallbackFocus`);return s},g=function(e){if(!(c(Dk(e),e)>=0)){if(Ek(i.clickOutsideDeactivates,e)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Ek(i.allowOutsideClick,e)||e.preventDefault()}},_=function(e){var t=Dk(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var r,o=!0;if(a.mostRecentlyFocusedNode)if(PO(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return PO(e)>0})})||(o=!1);else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},v=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(Sk(e)&&e.preventDefault(),p(n))},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&v(e,i.isKeyBackward(e))},b=function(e){xk(e)&&Ek(i.escapeDeactivates,e)!==!1&&(e.preventDefault(),o.deactivate())},x=function(e){c(Dk(e),e)>=0||Ek(i.clickOutsideDeactivates,e)||Ek(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},S=function(){if(!a.active)return Promise.resolve();yk.activateTrap(r,o);var e;return i.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=Tk(function(){p(u()),e()})}):(e=Promise.resolve(),p(u())),n.addEventListener(`focusin`,_,!0),n.addEventListener(`mousedown`,g,{capture:!0,passive:!1}),n.addEventListener(`touchstart`,g,{capture:!0,passive:!1}),n.addEventListener(`click`,x,{capture:!0,passive:!1}),n.addEventListener(`keydown`,y,{capture:!0,passive:!1}),n.addEventListener(`keydown`,b),e},C=function(e){a.active&&!a.paused&&o._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t=new Set,n=new Set,r=sk(e),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;t.add(s);for(var c=typeof ShadowRoot<`u`&&s.getRootNode()instanceof ShadowRoot,l=s;l;){t.add(l);var u=l.parentElement,d=[];u?d=u.children:!u&&c&&(d=l.getRootNode().children,u=l.getRootNode().host,c=typeof ShadowRoot<`u`&&u.getRootNode()instanceof ShadowRoot);var f=sk(d),p;try{for(f.s();!(p=f.n()).done;){var m=p.value;n.add(m)}}catch(e){f.e(e)}finally{f.f()}l=u}}}catch(e){r.e(e)}finally{r.f()}t.forEach(function(e){n.delete(e)}),a.adjacentElements=n},w=function(){if(a.active)return n.removeEventListener(`focusin`,_,!0),n.removeEventListener(`mousedown`,g,!0),n.removeEventListener(`touchstart`,g,!0),n.removeEventListener(`click`,x,!0),n.removeEventListener(`keydown`,y,!0),n.removeEventListener(`keydown`,b),o},T=typeof window<`u`&&`MutationObserver`in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes
380).some(function(e){return e===a.mostRecentlyFocusedNode})})&&p(u())}):void 0,E=function(){T&&(T.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){T.observe(e,{subtree:!0,childList:!0})}))};return o={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,`onActivate`),i=s(e,`onPostActivate`),c=s(e,`checkCanFocusTrap`),l=yk.getActiveTrap(r),u=!1;if(l&&!l.paused){var p;(p=l._setSubtreeIsolation)==null||p.call(l,!1),u=!0}try{c||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=f(n),t?.();var m=function(){var e=ok(pk().m(function e(){return pk().w(function(e){for(;;)switch(e.n){case 0:return c&&d(),e.n=1,S();case 1:o._setSubtreeIsolation(!0),E(),i?.();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){if(l===yk.getActiveTrap(r)&&u){var h;(h=l._setSubtreeIsolation)==null||h.call(l,!0)}throw e}return this},deactivate:function(e){if(!a.active)return this;var t=fk({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||o._setSubtreeIsolation(!1),a.alreadySilent.clear(),w(),a.active=!1,a.paused=!1,E(),yk.deactivateTrap(r,o);var n=s(t,`onDeactivate`),c=s(t,`onPostDeactivate`),l=s(t,`checkCanReturnFocus`),u=s(t,`returnFocus`,`returnFocusOnDeactivate`);n?.();var d=function(){Tk(function(){u&&p(m(a.nodeFocusedBeforeActivation)),c?.()})};return u&&l?(l(m(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return!a.active||(a.manuallyPaused=!1,r[r.length-1]!==this)?this:this._setPausedState(!1,e)},updateContainerElements:function(e){return a.containers=[].concat(e).filter(
vendor: 4,401 bytes, line 380
380Boolean).map(function(e){return typeof e==`string`?n.querySelector(e):e}),i.isolateSubtrees&&C(a.containers),a.active&&(d(),a.paused||o._setSubtreeIsolation(!0)),E(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=s(t,`onPause`),r=s(t,`onPostPause`);n?.(),w(),o._setSubtreeIsolation(!1),E(),r?.()}else{var i=s(t,`onUnpause`),c=s(t,`onPostUnpause`);i?.(),(function(){var e=ok(pk().m(function e(){return pk().w(function(e){for(;;)switch(e.n){case 0:return d(),e.n=1,S();case 1:o._setSubtreeIsolation(!0),E(),c?.();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}})()()}return this}},_setSubtreeIsolation:{value:function(e){i.isolateSubtrees&&a.adjacentElements.forEach(function(t){if(e)switch(i.isolateSubtrees){case`aria-hidden`:(t.ariaHidden===`true`||t.getAttribute(`aria-hidden`)?.toLowerCase()===`true`)&&a.alreadySilent.add(t),t.setAttribute(`aria-hidden`,`true`);break;default:(t.inert||t.hasAttribute(`inert`))&&a.alreadySilent.add(t),t.setAttribute(`inert`,!0)}else if(!a.alreadySilent.has(t))switch(i.isolateSubtrees){case`aria-hidden`:t.removeAttribute(`aria-hidden`);break;default:t.removeAttribute(`inert`)}})}}}),o.updateContainerElements(e),o};function Ak(e){let t,n;window.addEventListener(`focusin`,()=>{t=n,n=document.activeElement}),e.magic(`focus`,e=>{let r=e;return{__noscroll:!1,__wrapAround:!1,within(e){return r=e,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(e){return nk(e)},previouslyFocused(){return t},lastFocused(){return t},focused(){return n},focusables(){return Array.isArray(r)?r:$O(r,{displayCheck:`none`})},all(){return this.focusables()},isFirst(e){let t=this.all();return t[0]&&t[0].isSameNode(e)},isLast(e){let t=this.all();return t.length&&t.slice(-1)[0].isSameNode(e)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let e=this.all(),t=document.activeElement;if(e.indexOf(t)!==-1)return this.__wrapAround&&e.indexOf(t)===e.length-1?e[0]:e[e.indexOf(t)+1]},getPrevious(){let e=this.all(),t=document.activeElement;if(e.indexOf(t)!==-1)return this.__wrapAround&&e.indexOf(t)===0?e.slice(-1)[0]:e[e.indexOf(t)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(e){e&&setTimeout(()=>{e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`),e.focus({preventScroll:this.__noscroll})})}}}),e.directive(`trap`,e.skipDuringClone((t,{expression:n,modifiers:r},{effect:i,evaluateLater:a,cleanup:o})=>{let s=a(n),c=!1,l={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>t},u=()=>{};if(r.includes(`noautofocus`))l.initialFocus=!1;else{let e=t.querySelector(`[autofocus]`);e&&(l.initialFocus=e)}r.includes(`inert`)&&(l.onPostActivate=()=>{e.nextTick(()=>{u=jk(t)})});let d=kk(t,l),f=()=>{},p=()=>{u(),u=()=>{},f(),f=()=>{},d.deactivate({returnFocus:!r.includes(`noreturn`)})};i(()=>s(e=>{c!==e&&(e&&!c&&(r.includes(`noscroll`)&&(f=Nk()),setTimeout(()=>{d.activate()},15)),!e&&c&&p(),c=!!e)})),o(p)},(e,{expression:t,modifiers:n},{evaluate:r})=>{n.includes(`inert`)&&r(t)&&jk(e)}))}function jk(e){let t=[];return Mk(e,e=>{let n=e.hasAttribute(`aria-hidden`);e.setAttribute(`aria-hidden`,`true`),t.push(()=>n||e.removeAttribute(`aria-hidden`))}),()=>{for(;t.length;)t.pop()()}}function Mk(e,t){e.isSameNode(document.body)||!e.parentNode||Array.from(e.parentNode.children).forEach(n=>{n.isSameNode(e)?Mk(e.parentNode,t):t(n)})}function Nk(){let e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth,r=window.getComputedStyle(document.documentElement).scrollbarGutter;return document.documentElement.style.overflow=`hidden`,r&&r!==`auto`?()=>{document.documentElement.style.overflow=e}:(document.documentElement.style.paddingRight=`${n}px`,()=>{document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t})}var Pk=Ak;function Fk(e){e.directive(`mask`,(t,{value:n,expression:r},{effect:i,evaluateLater:a,cleanup:o})=>{let s=()=>r,c=``;queueMicrotask(()=>
380{if([`function`,`dynamic`].includes(n)){let n=a(r);i(()=>{s=r=>{let i;return e.dontAutoEvaluateFunctions(()=>{n(e=>{i=typeof e==`function`?e(r):e},{scope:{$input:r,$money:zk.bind({el:t})}})}),i},u(t,!1)})}else u(t,!1);if(t._x_model){t._x_model.get()!==t.value&&(t._x_model.get()!==null||t.value!==``)&&t._x_model.set(t.value);let e=t._x_forceModelUpdate;t._x_forceModelUpdate=n=>{n=String(n);let r=s(n);r&&r!==`false`&&(n=Rk(r,n)),c=n,e(n),t._x_model.set(n)}}});let l=new AbortController;o(()=>{l.abort()}),t.addEventListener(`input`,()=>u(t),{signal:l.signal,capture:!0}),t.addEventListener(`blur`,()=>u(t,!1),{signal:l.signal});function u(e,t=!0){let n=e.value,r=s(n);if(!r||r===`false`)return!1;if(c.length-e.value.length===1)return c=e.value;let i=()=>{c=e.value=Rk(r,n)};t?Ik(e,r,()=>{i()}):i()}}).before(`model`)}function Ik(e,t,n){let r=e.selectionStart,i=e.value;n();let a=Rk(t,i.slice(0,r)).length;e.setSelectionRange(a,a)}var Lk={9:/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/};function Rk(e,t){let n=0,r=0,i=``;for(;n<e.length&&r<t.length;){let a=e[n],o=t[r];a in Lk?(Lk[a].test(o)&&(i+=o,n++),r++):(i+=a,n++,a===t[r]&&r++)}return i}function zk(e,t=`.`,n,r=2){if(e===`-`)return`-`;if(/^\D+$/.test(e))return`9`;n??=t===`,`?`.`:`,`;let i=(e,t)=>{let n=``,r=0;for(let i=e.length-1;i>=0;i--)e[i]!==t&&(r===3?(n=e[i]+t+n,r=0):n=e[i]+n,r++);return n},a=e.startsWith(`-`)?`-`:``,o=e.replaceAll(RegExp(`[^0-9\\${t}]`,`g`),``),s=Array.from({length:o.split(t)[0].length}).fill(`9`).join(``);return s=`${a}${i(s,n)}`,r>0&&e.includes(t)&&(s+=`${t}`+`9`.repeat(r)),queueMicrotask(()=>{this.el.value.endsWith(t)||this.el.value[this.el.selectionStart-1]===t&&this.el.setSelectionRange(this.el.selectionStart-1,this.el.selectionStart-1)}),s}var Bk=Fk,Vk=function(e,t,n){let r=Promise.resolve();function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Hk=s({AbortException:()=>EA,AnnotationEditorLayer:()=>AF,AnnotationEditorParamsType:()=>Qk,AnnotationEditorType:()=>Z,AnnotationEditorUIManager:()=>Pj,AnnotationLayer:()=>oF,AnnotationMode:()=>Xk,AnnotationType:()=>nA,CSSConstants:()=>hj,ColorPicker:()=>SP,DOMSVGFactory:()=>OP,DrawLayer:()=>jF,FeatureTest:()=>AA,GlobalWorkerOptions:()=>QN,ImageKind:()=>tA,InvalidPDFException:()=>CA,MathClamp:()=>VA,OPS:()=>aA,OutputScale:()=>fj,PDFDataRangeTransport:()=>pP,PDFDateString:()=>ij,PDFWorker:()=>gP,PasswordResponses:()=>sA,PermissionFlag:()=>$k,PixelsPerInch:()=>GA,RenderingCancelledException:()=>JA,ResponseException:()=>wA,SignatureExtractor:()=>TF,SupportedImageMimeTypes:()=>pj,TextLayer:()=>lP,TextLayerImages:()=>NF,TouchManager:()=>Lj,Util:()=>Q,VerbosityLevel:()=>iA,XfaLayer:()=>UA,applyOpacity:()=>gj,build:()=>xP,createValidAbsoluteUrl:()=>gA,fetchData:()=>KA,findContrastColor:()=>Sj,getDocument:()=>dP,getFilenameFromUrl:()=>ZA,getPdfFilenameFromUrl:()=>QA,getRGB:()=>sj,getRGBA:()=>oj,getUuid:()=>FA,getXfaPageViewport:()=>aj,isDataScheme:()=>YA,isPdfFile:()=>XA,isValidExplicitDest:()=>bM,makeArr:()=>RA,makeMap:()=>zA,makeObj:()=>BA,noContextMenu:()=>tj,normalizeUnicode:()=>PA,renderRichText:()=>Cj,setLayerDimensions:()=>dj,shadow:()=>yA,stopEvent:()=>nj,updateUrlHash:()=>_A,version:()=>bP}),Uk={};Uk.d=(e,t)=>{for(var n in t)Uk.o(t,n)&&!Uk.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Uk.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Wk=typeof process==`object`&&process+``==`[object process]`&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!==`browser`),Gk=[1/0,1/0,-1/0,-1/0],Kk=new Float32Array(Gk),qk=[.001,0,0,.001,0,0],Jk=1.35,Yk={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Xk={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Zk=`pdfjs_internal_editor_`,Z={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Qk={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},$k={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},eA={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},tA={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},nA={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},rA={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},iA={ERRORS:0,WARNINGS:1,INFOS:5},aA={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},oA={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},sA={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},cA=iA.WARNINGS;function lA(e){Number.isInteger(e)&&(cA=e)}function uA(){return cA}function dA(e){cA>=iA.INFOS&&console.info(`Info: ${e}`)}function fA(e){cA>=iA.WARNINGS&&console.warn(`Warning: ${e}`)}function pA(e){throw Error(e)}function mA(e,t){e||pA(t)}function hA(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function gA(e,t=null,n=null){if(!e)return null;if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=jA(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return hA(r)?r:null}function _A(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&gA(e,`http://example.com`)?e.split(`#`,1)[0]+`${t?`#${t}`:``}`:``}function vA(e){return e.substring(e.lastIndexOf(`/`)+1)}function yA(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var bA=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),xA=class extends bA{constructor(e,t){super(e,`PasswordException`),this.code=t}},SA=class extends bA{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},CA=class extends bA{constructor(e){super(e,`InvalidPDFException`)}},wA=class extends bA{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},TA=class extends bA{constructor(e){super(e,`FormatError`)}},EA=class extends bA{constructor(e){super(e,`AbortException`)}};function DA(e){(typeof e!=`object`||e?.length===void 0)&&pA(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);let r=[];for(let i=0;i<t;i+=n){let a=Math.min(i+n,t),o=e.subarray(i,a);
380r.push(String.fromCharCode.apply(null,o))}return r.join(``)}function OA(e){typeof e!=`string`&&pA(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r)&255;return n}function kA(){let e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}var AA=class{static get isLittleEndian(){return yA(this,`isLittleEndian`,kA())}static get isOffscreenCanvasSupported(){return yA(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return yA(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get isFloat16ArraySupported(){return yA(this,`isFloat16ArraySupported`,typeof Float16Array<`u`)}static get isSanitizerSupported(){return yA(this,`isSanitizerSupported`,typeof Sanitizer<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return yA(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCSSRoundSupported(){return yA(this,`isCSSRoundSupported`,globalThis.CSS?.supports?.(`width: round(1.5px, 1px)`))}static get isAlphaColorInputSupported(){return yA(this,`isAlphaColorInputSupported`,(()=>{if(typeof document>`u`)return!1;let e=document.createElement(`input`);return e.type=`color`,e.setAttribute(`alpha`,``),e.value=`#ff000080`,e.value!==`#ff0000`})())}},Q=class{static get hexNums(){return yA(this,`hexNums`,Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let r=e[n],i=e[n+1];e[n]=r*t[0]+i*t[2]+t[4],e[n+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];for(let t=0;t<6;t+=2){let l=e[n+t],u=e[n+t+1];e[n+t]=l*r+u*a+s,e[n+t+1]=l*i+u*o+c}}static applyInverseTransform(e,t){let n=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=e[0],u=e[1],d=e[2],f=e[3],p=r*l+s,m=p,h=r*d+s,g=h,_=o*u+c,v=_,y=o*f+c,b=y;if(i!==0||a!==0){let e=i*l,t=i*d,n=a*u,r=a*f;p+=n,g+=n,h+=r,m+=r,_+=e,b+=e,y+=t,v+=t}n[0]=Math.min(n[0],p,h,m,g),n[1]=Math.min(n[1],_,y,v,b),n[2]=Math.max(n[2],p,h,m,g),n[3]=Math.max(n[3],_,y,v,b)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n**2+r**2,s=n*i+r*a,c=i**2+a**2,l=(o+c)/2,u=Math.sqrt(l**2-(o*c-s**2));t[0]=Math.sqrt(l+u||1),t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,r,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,r),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,r)}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s),this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c)}};function jA(e){return decodeURIComponent(escape(e))}var MA=null,NA=null;function PA(e){return MA||(MA=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,NA=new Map([[`ſt`,`ſt`]])),e.replaceAll(MA,(e,t,n)=>t?t.normalize(`NFKC`):NA.get(n))}function FA(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),DA(e)}var IA=`pdfjs_internal_id_`;function LA(e,t,n){if(!Array.isArray(n)||n.length<2)return!1;let[r,i,...a]=n;if(!e(r)&&!Number.isInteger(r)||!t(i))return!1;let o=a.length,s=!0;switch(i.name){case`XYZ`:if(o<2||o>3)return!1;break;case`Fit`:case`FitB`:return o===0;case`FitH`:case`FitBH`:case`FitV`:case`FitBV`:if(o>1)return!1;break;case`FitR`:if(o!==4)return!1;s=!1;break;default:return!1}for(let e of a)if(!(typeof e==`number`||s&&e===null))return!1;return!0}var RA=()=>[],zA=()=>new Map,BA=()=>Object.create(null);function VA(e,t,n){return Math.min(Math.max(e,t),n)}var HA=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return e!==`textarea`&&e!==`input`&&e!==`option`&&e!==`select`}},UA=class{static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:Object.hasOwn(e.attributes,`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(n!=null)switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=document.createElement(r.name);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&HA.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=s?.attributes?.xmlns?document.createElementNS(s.attributes.xmlns,u):document.createElement(u);if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&HA.shouldBuildText(u)&&c.push(e),d.append(e)}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}},WA=`http://www.w3.org/2000/svg`,GA=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function KA(e,t=`text`){if(ej(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`blob`:return n.blob();case`bytes`:return n.bytes();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t===`bytes`?`arraybuffer`:t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`bytes`:n(new Uint8Array(i.response));return;case`blob`:case`json`:n(i.response);return}n(i.responseText);return}r(Error(i.statusText))}},i.send(null)})}var qA=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}
380o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let e=this.viewBox;return yA(this,`rawDims`,{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){let n=[e,t];return Q.applyTransform(n,this.transform),n}convertToViewportRectangle(e){let t=[e[0],e[1]];Q.applyTransform(t,this.transform);let n=[e[2],e[3]];return Q.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){let n=[e,t];return Q.applyInverseTransform(n,this.transform),n}},JA=class extends bA{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function YA(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function XA(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function ZA(e){return[e]=e.split(/[#?]/,1),vA(e)}function QA(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(YA(e))return fA(`getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.`),t;let n=(e=>{try{return new URL(e)}catch{try{return new URL(decodeURIComponent(e))}catch{try{return new URL(e,`https://foo.bar`)}catch{try{return new URL(decodeURIComponent(e),`https://foo.bar`)}catch{return null}}}}})(e);if(!n)return t;let r=e=>{try{let t=decodeURIComponent(e);return t.includes(`/`)&&(t=vA(t),/^\.pdf$/i.test(t))?e:t}catch{return e}},i=/\.pdf$/i,a=vA(n.pathname);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=e=>[...e].findLast(e=>i.test(e)),t=e(n.searchParams.values())??e(n.searchParams.keys());if(t)return r(t)}if(n.hash){let e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(e)return r(e[0])}return t}var $A=class{#e=new Map;times=[];time(e){this.#e.has(e)&&fA(`Timer is already running for ${e}`),this.#e.set(e,Date.now())}timeEnd(e){this.#e.has(e)||fA(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.#e.get(e),end:Date.now()}),this.#e.delete(e)}toString(){let e=Math.max(...this.times.map(e=>e.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms\n`).join(``)}};function ej(e,t){let n=t?URL.parse(e,t):URL.parse(e);return/https?:/.test(n?.protocol??``)}function tj(e){e.preventDefault()}function nj(e){e.preventDefault(),e.stopPropagation()}function rj(e){console.log(`Deprecated API usage: `+e)}var ij=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}};function aj(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new qA({viewBox:[0,0,parseInt(r,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}function oj(e){if(e.startsWith(`#`)){let t=e.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(e.startsWith(`rgb(`)){let[t,n,r]=e.slice(4,-1).split(`,`).map(e=>parseInt(e,10));return[t,n,r,1]}if(e.startsWith(`rgba(`)){let t=e.slice(5,-1).split(`,`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}let t=e.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!==`none`?parseFloat(t[4]):1]:null}function sj(e){let t=oj(e);return t?t.slice(0,3):(fA(`Not a valid color format: "${e}"`),[0,0,0])}function cj(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,t.style.colorScheme=`only light`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,sj(r))}t.remove()}function lj(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function uj(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function dj(e,t,n=!1,r=!0){if(t instanceof qA){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=AA.isCSSRoundSupported,s=`var(--total-scale-factor) * ${r}px`,c=`var(--total-scale-factor) * ${i}px`,l=o?`round(down, ${s}, var(--scale-round-x))`:`calc(${s})`,u=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!n||t.rotation%180==0?(a.width=l,a.height=u):(a.width=u,a.height=l)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var fj=class e{constructor(){let{pixelRatio:t}=e;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,n,r,i,a=-1){let o=1/0,s=1/0,c=1/0;r=e.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*n))),i!==-1&&(s=i/t,c=i/n);let l=Math.min(o,s,c);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>
vendor: 42,554 bytes, line 380
380=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},pj=[`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`],mj=class{static get isDarkMode(){return yA(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},hj=class{static get commentForegroundColor(){let e=document.createElement(`span`);e.classList.add(`comment`,`sidebar`);let{style:t}=e;t.width=t.height=`0`,t.display=`none`,t.color=`var(--comment-fg-color)`,document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),yA(this,`commentForegroundColor`,sj(n))}};function gj(e,t){t=VA(t??1,0,1);let n=255*(1-t);return e.map(e=>Math.round(e*t+n))}function _j(e,t){let n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{let e=a-o;switch(t[1]=s<.5?e/(a+o):e/(2-a-o),a){case n:t[0]=((r-i)/e+(r<i?6:0))*60;break;case r:t[0]=((i-n)/e+2)*60;break;case i:t[0]=((n-r)/e+4)*60}}t[2]=s}function vj(e,t){let n=e[0],r=e[1],i=e[2],a=(1-Math.abs(2*i-1))*r,o=a*(1-Math.abs(n/60%2-1)),s=i-a/2;switch(Math.floor(n/60)){case 0:t[0]=a+s,t[1]=o+s,t[2]=s;break;case 1:t[0]=o+s,t[1]=a+s,t[2]=s;break;case 2:t[0]=s,t[1]=a+s,t[2]=o+s;break;case 3:t[0]=s,t[1]=o+s,t[2]=a+s;break;case 4:t[0]=o+s,t[1]=s,t[2]=a+s;break;case 5:case 6:t[0]=a+s,t[1]=s,t[2]=o+s}}function yj(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function bj(e,t,n){vj(e,n),n.map(yj);let r=.2126*n[0]+.7152*n[1]+.0722*n[2];vj(t,n),n.map(yj);let i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}var xj=new Map;function Sj(e,t){let n=e[0]+e[1]*256+e[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=xj.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);_j(e,o);let s=i.subarray(6,9);_j(t,s);let c=s[2]<.5,l=c?12:4.5;if(o[2]=c?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),bj(o,s,a)<l){let e,t;for(c?(e=o[2],t=1):(e=0,t=o[2]);t-e>.005;){let n=o[2]=(e+t)/2;c===bj(o,s,a)<l?e=n:t=n}o[2]=c?t:e}return vj(o,a),r=Q.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),xj.set(n,r),r}function Cj({html:e,dir:t,className:n},r){let i=document.createDocumentFragment();if(typeof e==`string`){let n=document.createElement(`p`);n.dir=t||`auto`;let r=e.split(/(?:\r\n?|\n)/);for(let e=0,t=r.length;e<t;++e){let i=r[e];n.append(document.createTextNode(i)),e<t-1&&n.append(document.createElement(`br`))}i.append(n)}else UA.render({xfaHtml:e,div:i,intent:`richText`});i.firstElementChild.classList.add(`richText`,n),r.append(i)}function wj(e){let t=new Path2D;if(!e)return t;for(let n=0,r=e.length;n<r;)switch(e[n++]){case oA.moveTo:t.moveTo(e[n++],e[n++]);break;case oA.lineTo:t.lineTo(e[n++],e[n++]);break;case oA.curveTo:t.bezierCurveTo(e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]);break;case oA.quadraticCurveTo:t.quadraticCurveTo(e[n++],e[n++],e[n++],e[n++]);break;case oA.closePath:t.closePath();break;default:fA(`Unrecognized drawing path operator: ${e[n-1]}`)}return t}var Tj=class e{#e=null;#t=null;#n;#r=null;#i=null;#a=null;#o=null;#s=null;static#c=null;constructor(t){this.#n=t,e.#c||=Object.freeze({freetext:`pdfjs-editor-remove-freetext-button`,highlight:`pdfjs-editor-remove-highlight-button`,ink:`pdfjs-editor-remove-ink-button`,stamp:`pdfjs-editor-remove-stamp-button`,signature:`pdfjs-editor-remove-signature-button`})}render(){let t=this.#e=document.createElement(`div`);t.classList.add(`editToolbar`,`hidden`),t.setAttribute(`role`,`toolbar`);let n=this.#n._uiManager._signal;n instanceof AbortSignal&&!n.aborted&&(t.addEventListener(`contextmenu`,tj,{signal:n}),t.addEventListener(`pointerdown`,e.#l,{signal:n}));let r=this.#r=document.createElement(`div`);r.className=`buttons`,t.append(r);let i=this.#n.toolbarPosition;if(i){let{style:e}=t;e.insetInlineEnd=`${100*(this.#n._uiManager.direction===`ltr`?1-i[0]:i[0])}%`,e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#e}static#l(e){e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!1,nj(e)}#d(e){this.#n._focusEventsAllowed=!0,nj(e)}#f(e){let t=this.#n._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener(`focusin`,this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,tj,{signal:t}),!0)}hide(){this.#e.classList.add(`hidden`),this.#t?.hideDropdown()}show(){this.#e.classList.remove(`hidden`),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){let{editorType:t,_uiManager:n}=this.#n,r=document.createElement(`button`);r.classList.add(`basic`,`deleteButton`),r.tabIndex=0,r.setAttribute(`data-l10n-id`,e.#c[t]),this.#f(r)&&r.addEventListener(`click`,e=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#p(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#f(t),this.#r.append(t,this.#p),this.#i=e}addComment(e,t=null){if(this.#a)return;let n=e.renderForToolbar();if(!n)return;this.#f(n);let r=this.#o=this.#p;t?(this.#r.insertBefore(n,t),this.#r.insertBefore(r,t)):this.#r.append(n,r),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#f(t),this.#r.append(t,this.#p)}async addEditSignatureButton(e){let t=this.#s=await e.renderEditButton(this.#n);this.#f(t),this.#r.append(t,this.#p)}removeButton(e){e===`comment`&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#o?.remove(),this.#o=null)}async addButton(e,t){switch(e){case`colorPicker`:t&&this.addColorPicker(t);break;case`altText`:t&&await this.addAltText(t);break;case`editSignature`:t&&await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:t&&this.addComment(t)}}async addButtonBefore(e,t,n){if(!t&&e===`comment`)return;let r=this.#r.querySelector(n);r&&e===`comment`&&this.addComment(t,r)}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},Ej=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`);let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,tj,{signal:t});let n=this.#e=document.createElement(`div`);return n.className=`buttons`,e.append(n),this.#n.hasCommentManager()&&this.#a(`commentButton`,`pdfjs-comment-floating-button`,`pdfjs-comment-floating-button-label`,()=>{this.#n.commentSelection(`floating_button`)}),this.#a(`highlightButton`,`pdfjs-highlight-floating-button1`,`pdfjs-highlight-floating-button-label`,()=>{this.#n.highlightSelection(`floating_button`)}),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(e<n)continue;let a=i.x+(t?i.width:0);if(e>n){r=a,n=e;continue}t?a>r&&(r=a):a<r&&(r=a)}return[t?1-r:r,n]}show(e,t,n){let[r,i]=this.#i(t,n),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*r}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,t,n,r){let i=document.createElement(`button`);i.classList.add(`basic`,e),i.tabIndex=0,i.setAttribute(`data-l10n-id`,t);let a=document.createElement(`span`);i.append(a),a.className=`visuallyHidden`,a.setAttribute(`data-l10n-id`,n);let o=this.#n._signal;o instanceof AbortSignal&&!o.aborted&&(i.addEventListener(`contextmenu`,tj,{signal:o}),i.addEventListener(`click`,r,{signal:o})),this.#e.append(i)}};function Dj(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}var Oj=class e{static#e=NaN;static#t=null;static#n=NaN;static#r=null;static initializeAndAddPointerId(t){(e.#t||=new Set).add(t)}static setPointer(t,n){e.#e||=n,e.#r??=t}static setTimeStamp(t){e.#n=t}static isSamePointerId(t){return e.#e===t}static isSamePointerIdOrRemove(t){return e.#e===t||(e.#t?.delete(t),!1)}static isSamePointerType(t){return e.#r===t}static isInitializedAndDifferentPointerType(t){return e.#r!==null&&!e.isSamePointerType(t)}static isSameTimeStamp(t){return e.#n===t}static isUsingMultiplePointers(){return e.#t?.size>=1}static clearPointerType(){e.#r=null}static clearPointerIds(){e.#e=NaN,e.#t=null}static clearTimeStamp(){e.#n=NaN}},kj=class{#e=0;get id(){return`${Zk}${this.#e++}`}},Aj=class e{#e=FA();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),t=new Image;t.src=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`;let n=t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]===0));return yA(this,`_isSVGFittingCanvas`,n)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await KA(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){fA(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},jj=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(s)}undo(){if(this.#r===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1,--this.#r}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let t=this.#r;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},Mj=class{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=AA.platform;for(let[n,r,i={}]of e)for(let e of n){let n=e.startsWith(`mac+`);t&&n?(this.callbacks.set(e.slice(4),{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1))):!t&&!n&&(this.callbacks.set(e,{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1)))}}#e(e){e.altKey&&this.buffer.push(`alt`),e.ctrlKey&&this.buffer.push(`ctrl`),e.metaKey&&this.buffer.push(`meta`),e.shiftKey&&this.buffer.push(`shift`),this.buffer.push(e.key);let t=this.buffer.join(`+`);return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(this.#e(t));if(!n)return;let{callback:r,options:{bubbles:i=!1,args:a=[],checker:o=null}}=n;o&&!o(e,t)||(r.bind(e,...a,t)(),i||nj(t))}},Nj=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return cj(e),yA(this,`_colors`,e)}convert(t){let n=sj(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?Q.makeHexColor(...t):e}},Pj=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=null;#l=new jj;#u=null;#d=null;#f=null;#p=0;#m=new Set;#h=null;#g=null;#_=new Set;_editorUndoBar=null;#v=!1;#y=!1;#b=!1;#x=null;#S=null;#C=null;#w=null;#T=!1;#E=null;#D=new kj;#O=!1;#k=!1;#A=!1;#j=null;#M=null;#N=null;#P=null;#F=null;#I=Z.NONE;#L=new Set;#R=null;#z=null;#B=null;#V=null;#H=null;#U={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#W=[0,0];#G=null;#K=null;#q=null;#J=null;#Y=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#K.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return yA(this,`_keyboardManager`,new Mj([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`Backspace`,`alt+Backspace`,`ctrl+Backspace`,`shift+Backspace`,`mac+Backspace`,`mac+alt+Backspace`,`mac+ctrl+Backspace`,`Delete`,`ctrl+Delete`,`shift+Delete`,`mac+Delete`],t.delete,{checker:r}],[[`Enter`,`mac+Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#K.contains(t)&&!e.isEnterHandled}],[[` `,`mac+ `],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#K.contains(document.activeElement)}],[[`Escape`,`mac+Escape`],t.unselectAll],[[`ArrowLeft`,`mac+ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`,`mac+ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this._signal=this.#e.signal;this.#K=e,this.#q=t,this.#J=n,this.#o=r,this.#u=i,this.#z=a,this.#H=s,this._eventBus=o,o._on(`editingaction`,this.onEditingAction.bind(this),{signal:g}),o._on(`pagechanging`,this.onPageChanging.bind(this),{signal:g}),o._on(`scalechanging`,this.onScaleChanging.bind(this),{signal:g}),o._on(`rotationchanging`,this.onRotationChanging.bind(this),{signal:g}),o._on(`setpreference`,this.onSetPreference.bind(this),{signal:g}),o._on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),{signal:g}),window.addEventListener(`pointerdown`,()=>{this.#k=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#k=!1},{capture:!0,signal:g}),window.addEventListener(`beforeunload`,this.#Q.bind(this),{capture:!0,signal:g}),this.#ne(),this.#le(),this.#ae(),this.#s=s.annotationStorage,this.#x=s.filterFactory,this.#B=c,this.#w=l||null,this.#v=u,this.#y=d,this.#b=f,this.#F=p||null,this.viewParameters={realScale:GA.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=h!==!1,i?.setSidebarUiManager(this)}destroy(){this.#Y?.resolve(),this.#Y=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#_.clear(),this.#P?.clear(),this.#t=null,this.#L.clear(),this.#l.destroy(),this.#o?.destroy(),this.#u?.destroy(),this.#z?.destroy(),this.#E?.hide(),this.#E=null,this.#N?.destroy(),this.#N=null,this.#n=null,this.#S&&=(clearTimeout(this.#S),null),this.#G&&=(clearTimeout(this.#G),null),this._editorUndoBar?.destroy(),this.#H=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#F}get useNewAltTextFlow(){return this.#y}get useNewAltTextWhenAddingImage(){return this.#b}get hcmFilter(){return yA(this,`hcmFilter`,this.#B?this.#x.addHCMFilter(this.#B.foreground,this.#B.background):`none`)}get direction(){return yA(this,`direction`,getComputedStyle(this.#K).direction)}get _highlightColors(){return yA(this,`_highlightColors`,this.#w?new Map(this.#w.split(`,`).map(e=>(e=e.split(`=`).map(e=>e.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return yA(this,`highlightColors`,null);let t=new Map,n=!!this.#B;for(let[r,i]of e){let e=r.endsWith(`_HCM`);if(n&&e){t.set(r.replace(`_HCM`,``),i);continue}!n&&!e&&t.set(r,i)}return yA(this,`highlightColors`,t)}get highlightColorNames(){return yA(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#f=e}setMainHighlightColorPicker(e){this.#N=e}editAltText(e,t=!1){this.#o?.editAltText(this,e,t)}hasCommentManager(){return!!this.#u}editComment(e,t,n,r){this.#u?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#u?.updateComment(e.getData())}updatePopupColor(e){this.#u?.updatePopupColor(e)}removeComment(e){this.#u?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,`comment`),this.toggleComment(null),e.comment=null},undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){this.#u?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#u?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#u?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),r=n=>{n.pageNumber===e&&(this._eventBus._off(`editorsrendered`,r),t())};this._eventBus.on(`editorsrendered`,r),await n}getSignature(e){this.#z?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#z}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e===`enableNewAltTextWhenAddingImage`&&(this.#b=t)}onPageChanging({pageNumber:e}){this.#p=e-1}deletePage(e){for(let t of this.getEditors(e))t.remove();this.#i.delete(e),this.#p===e&&(this.#p=0)}focusMainContainer(){this.#K.focus()}findParent(e,t){for(let n of this.#i.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#q.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#_.add(e)}removeShouldRescale(e){this.#_.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*GA.PDF_TO_CSS_UNITS;for(let e of this.#_)e.onScaleChanging();this.#f?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#X({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Z(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#i.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``,t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=n,s=n.toString(),c=this.#X(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let u=this.#Z(c),d=this.#I===Z.NONE,f=()=>{let n=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o,text:s});d&&this.showAllEditors(`highlight`,!0,!0),t&&n?.editComment()};if(d){this.switchToMode(Z.HIGHLIGHT,f);return}f()}commentSelection(e=``){this.highlightSelection(e,!0)}#Q(e){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#$(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#X(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#E||=new Ej(this),this.#E.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#s)return null;let t=`${Zk}${e}`,n=this.#s.getRawValue(t);return n&&this.#s.remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#s&&!this.#s.has(e.id)&&this.#s.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#J;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#ee(){let e=document.getSelection();if(!e||e.isCollapsed){this.#R&&(this.#E?.hide(),this.#R=null,this.#ue({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#R)return;let n=this.#X(e).closest(`.textLayer`);if(!n){this.#R&&(this.#E?.hide(),this.#R=null,this.#ue({hasSelectedText:!1}));return}if(this.#E?.hide(),this.#R=t,this.#ue({hasSelectedText:!0}),(this.#I===Z.HIGHLIGHT||this.#I===Z.NONE)&&(this.#I===Z.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#T=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#I===Z.HIGHLIGHT?this.#Z(n):null;if(e?.toggleDrawing(),this.#k){let t=new AbortController,n=this.combinedSignal(t),r=n=>{(n.type!==`pointerup`||n.button===0)&&(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#te(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#te(`main_toolbar`)}}#te(e=``){this.#I===Z.HIGHLIGHT?this.highlightSelection(e):this.#v&&this.#$()}#ne(){document.addEventListener(`selectionchange`,this.#ee.bind(this),{signal:this._signal})}#re(){if(this.#C)return;this.#C=new AbortController;let e=this.combinedSignal(this.#C);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#ie(){this.#C?.abort(),this.#C=null}blur(){if(this.isShiftKeyDown=!1,this.#T&&(this.#T=!1,this.#te(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#L)if(t.div.contains(e)){this.#M=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#M)return;let[e,t]=this.#M;this.#M=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ae(){if(this.#j)return;this.#j=new AbortController;let e=this.combinedSignal(this.#j);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#oe(){this.#j?.abort(),this.#j=null}#se(){if(this.#d)return;this.#d=new AbortController;let e=this.combinedSignal(this.#d);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#ce(){this.#d?.abort(),this.#d=null}#le(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#ae(),this.setEditingState(!0)}removeEditListeners(){this.#oe(),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#g)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#g)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#L){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#g)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){fA(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#me(t);this.#_e(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){fA(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#I!==Z.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#T&&(this.#T=!1,this.#te(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`);break;case`commentSelection`:this.commentSelection(`context_menu`)}}updatePageIndex(e,t){for(let n of this.getEditors(e))n.pageIndex=t;let n=this.#a.get(e);n&&(n.pageIndex=t,this.#i.set(t,n),this.#O?n.enable():n.disable())}startUpdatePages(){this.#a=new Map(this.#i),this.#i.clear()}endUpdatePages(){this.#a=null}clonePage(e,t){for(let n of this.getEditors(e)){let e=n.serialize(n.mode!==Z.HIGHLIGHT);e&&(e.pageIndex=t,e.id=this.getId(),e.isClone=!0,delete e.popupRef,this.#s.setValue(e.id,e))}}findClonesForPage(e){let t=[],{pageIndex:n}=e;for(let[r,i]of this.#s)i.pageIndex===n&&i.isClone&&(this.#s.remove(r),t.push(e.deserialize(i).then(t=>{t&&(t.isClone=!0,e.addOrRebuild(t))})));return Promise.all(t)}#ue(e){Object.entries(e).some(([e,t])=>this.#U[e]!==t)&&(this._eventBus.dispatch(`editingstateschanged`,{source:this,details:Object.assign(this.#U,e)}),this.#I===Z.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#de([[Qk.HIGHLIGHT_FREE,!0]]))}#de(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#re(),this.#se(),this.#ue({isEditing:this.#I!==Z.NONE,isEmpty:this.#ge(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ie(),this.#ce(),this.#ue({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#g){this.#g=e;for(let e of this.#g)this.#de(e.defaultPropertiesToUpdate)}}getId(){return this.#D.id}get currentLayer(){return this.#i.get(this.#p)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#p}addLayer(e){this.#i.set(e.pageIndex,e),this.#O?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1,a=!1){if(this.#I!==e&&!(this.#Y&&(await this.#Y.promise,!this.#Y))){if(this.#Y=Promise.withResolvers(),this.#f?.commitOrRemove(),this.#I===Z.POPUP&&this.#u?.hideSidebar(),this.#u?.destroyPopup(),this.#I=e,e===Z.NONE){this.setEditingState(!1),this.#pe();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#Y.resolve();return}for(let e of this.#r.values())e.addStandaloneCommentButton();e===Z.SIGNATURE&&await this.#z?.loadSignatures(),n&&Oj.clearPointerType(),this.setEditingState(!0),await this.#fe(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===Z.POPUP){this.#n||=await this.#H.getAnnotationsByType(new Set(this.#g.map(e=>e._editorType)));let e=new Set,t=[];for(let n of this.#r.values()){let{annotationElementId:r,hasComment:i,deleted:a}=n;r&&e.add(r),i&&!a&&t.push(n.getData())}for(let n of this.#n){let{id:r,popupRef:i,contentsObj:a}=n;i&&a?.str&&!e.has(r)&&!this.#m.has(r)&&t.push(n)}this.#u?.showSidebar(t)}if(!t){r&&this.addNewEditorFromKeyboard(),this.#Y.resolve();return}for(let e of this.#r.values())e.uid===t?(this.setSelected(e),a?e.editComment():i?e.enterInEditMode():e.focus()):e.unselect();this.#Y.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#I&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#g){switch(e){case Qk.CREATE:this.currentLayer.addNewEditor(t);return;case Qk.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#V||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#L)n.updateParams(e,t);else for(let n of this.#g)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#V?.get(Qk.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#de([[Qk.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#A!==e){this.#A=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#fe(){if(!this.#O){this.#O=!0;let e=[];for(let t of this.#i.values())e.push(t.enable());await Promise.all(e);for(let e of this.#r.values())e.enable()}}#pe(){if(this.unselectAll(),this.#O){this.#O=!1;for(let e of this.#i.values())e.disable();for(let e of this.#r.values())e.disable()}}*getEditors(e){for(let t of this.#r.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#P?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#m.has(e.annotationElementId))&&this.#s?.remove(e.id)}addDeletedAnnotationElement(e){this.#m.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#m.has(e)}removeDeletedAnnotationElement(e){this.#m.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#me(e){let t=this.#i.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#de(e.propertiesToUpdate))}get#he(){let e=null;for(e of this.#L);return e}updateUI(e){this.#he===e&&this.#de(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#de(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#L.has(e)){this.#L.delete(e),e.unselect(),this.#ue({hasSelectedEditor:this.hasSelection});return}this.#L.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#f?.commitOrRemove();for(let t of this.#L)t!==e&&t.unselect();this.#u?.destroyPopup(),this.#L.clear(),this.#L.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0})}isSelected(e){return this.#L.has(e)}get firstSelectedEditor(){return this.#L.values().next().value}unselect(e){e.unselect(),this.#L.delete(e),this.#ue({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#L.size!==0}get isEnterHandled(){return this.#L.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#ue({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#ge()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#ge()})}addCommands(e){this.#l.add(e),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#ge()})}cleanUndoStack(e){this.#l.cleanType(e)}#ge(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#L],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#me(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#_e(e){for(let e of this.#L)e.unselect();this.#L.clear();for(let t of e)t.isEmpty()||(this.#L.add(t),t.select());this.#ue({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#L)e.commit();this.#_e(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#I!==Z.NONE))&&!this.#f?.commitOrRemove()&&(this.#u?.destroyPopup(),this.hasSelection)){for(let e of this.#L)e.unselect();this.#L.clear(),this.#ue({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#W[0]+=e,this.#W[1]+=t;let[r,i]=this.#W,a=[...this.#L];this.#G&&clearTimeout(this.#G),this.#G=setTimeout(()=>{this.#G=null,this.#W[0]=this.#W[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(r,i),e.translationDone())},undo:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(-r,-i),e.translationDone())},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t),n.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(let e of this.#L)this.#h.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);let e=this.#h;this.#h=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#r.has(e.id)){let i=this.#i.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#h)for(let n of this.#h.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#L.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#I}isEditingMode(){return this.#I!==Z.NONE}get imageManager(){return yA(this,`imageManager`,new Aj)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n<r;n++)if(!e.contains(t.getRangeAt(n).commonAncestorContainer))return null;let{x:n,y:r,width:i,height:a}=e.getBoundingClientRect(),o;switch(e.getAttribute(`data-main-rotation`)){case`90`:o=(e,t,o,s)=>({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a})}let s=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(!n.collapsed)for(let{x:e,y:t,width:r,height:i}of n.getClientRects())r!==0&&i!==0&&s.push(o(e,t,r,i))}return s.length===0?null:s}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#c||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#c?.delete(e)}renderAnnotationElement(e){let t=this.#c?.get(e.data.id);if(!t)return;let n=this.#s.getRawValue(t);n&&(this.#I===Z.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){let r=this.#P?.get(e);r&&(r.setCanvas(t,n),this.#P.delete(e))}addMissingCanvas(e,t){(this.#P||=new Map).set(e,t)}},Fj=class e{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#c=t,this.#d=t._uiManager.useNewAltTextFlow,e.#f||=Object.freeze({added:`pdfjs-editor-new-alt-text-added-button`,"added-label":`pdfjs-editor-new-alt-text-added-button-label`,missing:`pdfjs-editor-new-alt-text-missing-button`,"missing-label":`pdfjs-editor-new-alt-text-missing-button-label`,review:`pdfjs-editor-new-alt-text-to-review-button`,"review-label":`pdfjs-editor-new-alt-text-to-review-button-label`})}static initialize(t){e._l10n??=t}async render(){let t=this.#n=document.createElement(`button`);t.className=`altText`,t.tabIndex=`0`;let n=this.#r=document.createElement(`span`);t.append(n),this.#d?(t.classList.add(`new`),t.setAttribute(`data-l10n-id`,e.#f.missing),n.setAttribute(`data-l10n-id`,e.#f[`missing-label`])):(t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button`),n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button-label`));let r=this.#c._uiManager._signal;t.addEventListener(`contextmenu`,tj,{signal:r}),t.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e){this.#s?.remove(),this.#s=null;return}if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),(this.#e!==e||this.#t!==t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getElementForAltText()?.setAttribute(`aria-describedby`,n.id)}},Ij=class{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=null;constructor(e){this.#r=e}renderForToolbar(){let e=this.#t=document.createElement(`button`);return e.className=`comment`,this.#u(e,!1)}renderForStandalone(){let e=this.#e=document.createElement(`button`);e.className=`annotationCommentButton`;let t=this.#r.commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction===`ltr`?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let r=this.#r.commentButtonColor;r&&(n.backgroundColor=r)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;let e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#e)return null;let{x:e,y:t,height:n}=this.#e.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#r.parent.boundingClientRect;return[(e-r)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#e&&(this.#e.classList.toggle(`selected`,e),this.#e.ariaExpanded=t)}#u(e,t){if(!this.#r._uiManager.hasCommentManager())return null;
380e.tabIndex=`0`,e.ariaHasPopup=`dialog`,t?(e.ariaControls=`commentPopup`,e.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`)):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute(`data-l10n-id`,`pdfjs-editor-add-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,tj,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,nj(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,nj(e)},{capture:!0,signal:n})),e.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:n});let r=t=>{t.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener(`click`,r,{capture:!0,signal:n}),e.addEventListener(`keydown`,t=>{t.target===e&&t.key===`Enter`&&(this.#n=!0,r(t))},{signal:n}),e.addEventListener(`pointerenter`,()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener(`pointerleave`,()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){let t=this.commentPopupPositionInLayer,n,r;if(t)[n,r]=t;else{[n,r]=this.#r.commentButtonPosition;let{width:e,height:t,x:i,y:a}=this.#r;n=i+n*e,r=a+r*t}let i=this.#r.parent.boundingClientRect,{x:a,y:o,width:s,height:c}=i;this.#r._uiManager.editComment(this.#r,a+n*s,o+r*c,{...e,parentDimensions:i})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#c||this.#o===``}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#i}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#a,date:this.#s,deleted:this.isDeleted()}}set data(e){if(e!==this.#o&&(this.#a=null),e===null){this.#o=``,this.#c=!0;return}this.#o=e,this.#s=new Date,this.#c=!1}restoreData({text:e,richText:t,date:n}){this.#o=e,this.#a=t,this.#s=n,this.#c=!1}setInitialText(e,t=null){this.#i=e,this.data=e,this.#s=null,this.#a=t}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#o=``,this.#a=null,this.#s=null,this.#r=null,this.#n=!1,this.#c=!1}},Lj=class e{#e;#t=!1;#n=null;#r;#i;#a;#o;#s=null;#c;#l=null;#u;#d=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#u=new AbortController,this.#c=AbortSignal.any([o,this.#u.signal]),e.addEventListener(`touchstart`,this.#f.bind(this),{passive:!1,signal:this.#c})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/fj.pixelRatio}#f(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#s)return;let e=this.#s=new AbortController,t=AbortSignal.any([this.#c,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#s?.abort(),this.#s=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(nj(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r);return}if(!this.#d){this.#d=new AbortController;let e=AbortSignal.any([this.#c,this.#d.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#p.bind(this),n);let r=this.#m.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,nj,n),t.addEventListener(`pointermove`,nj,n),t.addEventListener(`pointercancel`,nj,n),t.addEventListener(`pointerup`,nj,n),this.#i?.()}if(nj(e),e.touches.length!==2||this.#n?.()){this.#l=null;return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#l={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#p(t){if(!this.#l||t.touches.length!==2)return;nj(t);let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);let{screenX:i,screenY:a}=n,{screenX:o,screenY:s}=r,c=this.#l,{touch0X:l,touch0Y:u,touch1X:d,touch1Y:f}=c,p=d-l,m=f-u,h=o-i,g=s-a,_=Math.hypot(h,g)||1,v=Math.hypot(p,m)||1;if(!this.#t&&Math.abs(v-_)<=e.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=a,c.touch1X=o,c.touch1Y=s,!this.#t){this.#t=!0;return}let y=[(i+o)/2,(a+s)/2];this.#a?.(y,v,_)}#m(e){e.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#o?.()),this.#l&&(nj(e),this.#l=null,this.#t=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#s?.abort(),this.#s=null}},Rj=class e{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;#s=``;#c=null;#l=null;#u=null;#d=null;#f=null;#p=``;#m=!1;#h=null;#g=!1;#_=!1;#v=!1;#y=null;
vendor: 41,664 bytes, line 380
380#b=0;#x=0;#S=null;#C=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new Nj;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=Pj.TRANSLATE_SMALL,r=Pj.TRANSLATE_BIG;return yA(this,`_resizerKeyboardManager`,new Mj([[[`ArrowLeft`,`mac+ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`,`mac+ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`,`mac+ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`,`mac+ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`,`mac+Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return yA(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new zj({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nResizer||=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){pA(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle(`draggable`,e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#W(),this.#d?.remove(),this.#d=null):(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#m?this.#m=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this._onTranslated()}#E([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#E(this.parentDimensions,e,t)}translateInPage(e,t){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#h||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),n.scrollIntoView({block:`nearest`})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=VA(i,0,n-o),a=VA(a,0,r-s);break;case 90:i=VA(i,0,n-s),a=VA(a,o,r);break;case 180:i=VA(i,o,n),a=VA(a,s,r);break;case 270:i=VA(i,s,n),a=VA(a,0,r-o)}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#D(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#D(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#D(t,n,360-this.parentRotation)}#O(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#k(){if(this.#c)return;this.#c=document.createElement(`div`),this.#c.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#c.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#A.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,tj,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=AA.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#N.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,nj,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,tj,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#M()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#j(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#M(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#u;this.#u=null;let i=this.x,a=this.y,o=this.width,s=this.height;(i!==e||a!==t||o!==n||s!==r)&&this.addCommands({cmd:this.#j.bind(this,i,a,o,s),undo:this.#j.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#O(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#O(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),C=e._round(o+x[1]),w=1,T=1,E,D;if(n.fromKeyboard)({deltaX:E,deltaY:D}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[E,D]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}if([E,D]=m(E/r,D/i),_){let e=Math.hypot(s,c);w=T=Math.max(Math.min(Math.hypot(b[0]-y[0]-E,b[1]-y[1]-D)/e,1/s,1/c),l/s,u/c)}else v?w=VA(Math.abs(b[0]-y[0]-E),l,1)/s:T=VA(Math.abs(b[1]-y[1]-D),u,1)/c;let O=e._round(s*w),k=e._round(c*T);x=f(...g(O,k));let A=S-x[0],j=C-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=O,this.height=k,this.x=A,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_)return this._editToolbar;this._editToolbar=new Tj(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton(`comment`,this.addCommentButton()),this._editToolbar.addButton(`delete`),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore(`comment`,this.addCommentButton(),`.deleteButton`)}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton(`comment`)}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(Fj.initialize(e._l10n),this.#n=new Fj(this),this.#e&&=(this.#n.data=this.#e,null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new Ij(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#i){this._uiManager.isEditingMode()&&this.#i.classList.remove(`hidden`);return}this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i))}}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add(`hidden`)}get comment(){if(!this.#r)return null;let{data:{richText:e,text:t,date:n,deleted:r}}=this.#r;return{text:t,richText:e,date:n,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new Ij(this),typeof e==`object`&&e?this.#r.restoreData(e):this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(this.#r||=new Ij(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new Ij(this),this.#r.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,t]=e.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,i=r+n+1,a=t-100,o=i+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[i,a,o,t]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#r.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement(`div`);e.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),e.className=this.name,e.setAttribute(`id`,this.id),e.tabIndex=this.#a?-1:0,e.setAttribute(`role`,`application`),this.defaultL10nId&&e.setAttribute(`data-l10n-id`,this.defaultL10nId),this._isVisible||e.classList.add(`hidden`),this.setInForeground(),this.#z();let[t,n]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[r,i]=this.getInitialTranslation();return this.translate(r,i),Dj(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#C||=new Lj({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#F(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#O(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#h||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=AA.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#m=!0,this._isDraggable){this.#R(e);return}this.#L(e)}#L(e){let{isMac:t}=AA.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#o=null,this.#m=!1,this._uiManager.endDragSession()||this.#L(e),n&&this._onStopDragging()};t&&(this.#b=e.clientX,this.#x=e.clientY,this.#o=e.pointerId,this.#s=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#o){nj(e);return}let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o)},a),window.addEventListener(`touchmove`,nj,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),nj(e)},a));let s=e=>{if(!this.#o||this.#o===e.pointerId){o(e);return}nj(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&e._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:r,deleted:i,richText:a},uid:o,pageIndex:s,creationDate:c,modificationDate:l}=this;return{id:o,pageIndex:s,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||l,popupRef:!i,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#_=!1,!0):!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t<a&&r>0&&e<i&&n>0}#z(){if(this.#f||!this.div)return;this.#f=new AbortController;let e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}rebuild(){this.#z()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||``}}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#e=e.accessibilityData,r._isCopy=e.isCopy||!1;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&=(clearTimeout(this.#y),null),this.#W(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#C?.destroy(),this.#C=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#k(),this.#c.classList.remove(`hidden`))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction===`ltr`?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,n]}=this,[r,i,a,o]=this.getPDFRect();return[e._round(r+(a-r)*t),e._round(i+(o-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#c.children;if(!this.#t){this.#t=Array.from(n);let t=this.#B.bind(this),r=this.#V.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#H.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let e=0;e<i-a;e++)this.#c.append(this.#c.firstElementChild);else if(a>i)for(let e=0;e<a-i;e++)this.#c.firstElementChild.before(this.#c.lastElementChild);let t=0;for(let r of n){let n=this.#t[t++].getAttribute(`data-resizer-name`);r.setAttribute(`data-l10n-id`,e._l10nResizer[n])}}this.#U(0),this.#v=!0,this.#c.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#B(t){e._resizerKeyboardManager.exec(this,t)}#V(e){this.#v&&e.relatedTarget?.parentNode!==this.#c&&this.#W()}#H(e){this.#p=this.#v?e:``}#U(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#v&&this.#N(this.#p,{deltaX:e,deltaY:t,fromKeyboard:!0})}#W(){this.#v=!1,this.#U(-1),this.#M()}_stopResizingWithKeyboard(){this.#W(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add(`selectedEditor`),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#c?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!==`BUTTON`&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#S||=new Map;let{action:n}=t,r=this.#S.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#S.delete(n),this.#S.size===0&&(this.#S=null)},e._telemetryTimeout),this.#S.set(n,r);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){if(!this.#d&&!this.deleted){this.#d=e.addFakeAnnotation(this);return}if(this.deleted){this.#d.remove(),this.#d=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},zj=class extends Rj{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},Bj=3285377520,Vj=4294901760,Hj=65535,Uj=class{constructor(e){this.h1=e?e&4294967295:Bj,this.h2=e?e&4294967295:Bj}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r<i;r++){let i=e.charCodeAt(r);i<=255?t[n++]=i:(t[n++]=i>>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e<r;e++)e&1?(o=a[e],o=o*u&Vj|o*f&Hj,o=o<<15|o>>>17,o=o*d&Vj|o*p&Hj,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&Vj|s*f&Hj,s=s<<15|s>>>17,s=s*d&Vj|s*p&Hj,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&Vj|o*f&Hj,o=o<<15|o>>>17,o=o*d&Vj|o*p&Hj,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Vj|e*36045&Hj,t=t*4283543511&Vj|((t<<16|e>>>16)*2950163797&Vj)>>>16,e^=t>>>1,e=e*444984403&Vj|e*60499&Hj,t=t*3301882366&Vj|((t<<16|e>>>16)*3120437893&Vj)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},Wj=Object.freeze({map:null,hash:``,transfer:void 0}),Gj=class{#e=!1;#t=null;#n=null;#r=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){let t=this.#r.get(e);t!==void 0&&(t instanceof Rj&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),!this.#r.values().some(e=>e instanceof Rj)&&this.onAnnotationEditor?.(null))}setValue(e,t){let n=this.#r.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#r.set(e,t);r&&this.#i(),t instanceof Rj&&((this.#n||=new Map).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,this.onSetModified?.())}resetModified(){this.#e&&(this.#e=!1,this.onResetModified?.())}get print(){return new Kj(this)}get serializable(){if(this.#r.size===0)return Wj;let e=new Map,t=new Uj,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof Rj?a.serialize(!1,r):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:Wj}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof Rj)){i.popup&&(i.popup.deleted?r+=1:n+=1);continue}i.isCommentDeleted?r+=1:i.hasEditedComment&&(n+=1);let a=i.telemetryFinalData;if(!a)continue;let{type:o}=a;t.has(o)||t.set(o,Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[o]||=new Map;for(let[e,t]of Object.entries(a)){if(e===`type`)continue;let n=s.getOrInsertComputed(e,zA);n.set(t,(n.get(t)??0)+1)}}if((r>0||n>0)&&(e||=Object.create(null),e.comments={deleted:r,edited:n}),!e)return null;for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,t){let n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;let e=[];if(this.#n)for(let t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);let t=``;if(e.length){let n=new Uj;n.update(e.join(`,`)),t=n.hexdigest()}return this.#t={ids:new Set(e),hash:t}}[Symbol.iterator](){return this.#r.entries()}},Kj=class extends Gj{#e=Wj;constructor(e){super();let{serializable:t}=e;if(t===Wj)return;let{map:n,hash:r,transfer:i}=t,a=structuredClone(n,i?{transfer:i}:null);this.#e={map:a,hash:r,transfer:[]}}get print(){pA(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return yA(this,`modifiedIds`,{ids:new Set,hash:``})}},qj=`__forcedDependency`,{floor:Jj,ceil:Yj}=Math;function Xj(e,t,n,r,i,a){e[t*4+0]=Math.min(e[t*4+0],n),e[t*4+1]=Math.min(e[t*4+1],r),e[t*4+2]=Math.max(e[t*4+2],i),e[t*4+3]=Math.max(e[t*4+3],a)}var Zj=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],Qj=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===Zj}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}},$j=(e,t)=>e?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),eM=class{#e=[[1,0,0,1,0,0]];#t=[-1/0,-1/0,1/0,1/0];#n=new Float64Array(Gk);_pendingBBoxIdx=-1;#r;#i;#a;#o;_savesStack=[];_markedContentStack=[];constructor(e,t){this.#r=e.width,this.#i=e.height,this.#s(t)}growOperationsCount(e){e>=this.#o.length&&this.#s(e,this.#o)}#s(e,t){let n=new ArrayBuffer(e*4);this.#a=new Uint8ClampedArray(n),this.#o=new Uint32Array(n),t&&t.length>0?(this.#o.set(t),this.#o.fill(Zj,t.length)):this.#o.fill(Zj)}get clipBox(){return this.#t}save(e){return this.#t={__proto__:this.#t},this._savesStack.push(e),this}restore(e,t){let n=Object.getPrototypeOf(this.#t);if(n===null)return this;this.#t=n;let r=this._savesStack.pop();return r!==void 0&&(t?.(r,e),this.#o[e]=this.#o[r]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){let n=this._savesStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){let n=this._markedContentStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}pushBaseTransform(e){return this.#e.push(Q.multiplyByDOMMatrix(this.#e.at(-1),e.getTransform())),this}popBaseTransform(){return this.#e.length>1&&this.#e.pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,this.#n.set(Gk,0)),this}recordClipBox(e,t,n,r,i,a){let o=Q.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform()),s=Gk.slice();Q.axialAlignedBoundingBox([n,i,r,a],o,s);let c=Q.intersect(this.#t,s);return c?(this.#t[0]=c[0],this.#t[1]=c[1],this.#t[2]=c[2],this.#t[3]=c[3]):(this.#t[0]=this.#t[1]=1/0,this.#t[2]=this.#t[3]=-1/0),this}recordBBox(e,t,n,r,i,a){let o=this.#t;if(o[0]===1/0)return this;let s=Q.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform());if(o[0]===-1/0)return Q.axialAlignedBoundingBox([n,i,r,a],s,this.#n),this;let c=Gk.slice();return Q.axialAlignedBoundingBox([n,i,r,a],s,c),this.#n[0]=VA(c[0],o[0],this.#n[0]),this.#n[1]=VA(c[1],o[1],this.#n[1]),this.#n[2]=VA(c[2],this.#n[2],o[2]),this.#n[3]=VA(c[3],this.#n[3],o[3]),this}recordFullPageBBox(e){return this.#n[0]=Math.max(0,this.#t[0]),this.#n[1]=Math.max(0,this.#t[1]),this.#n[2]=Math.min(this.#r,this.#t[2]),this.#n[3]=Math.min(this.#i,this.#t[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;let r=Jj(this.#n[0]*256/this.#r),i=Jj(this.#n[1]*256/this.#i),a=Yj(this.#n[2]*256/this.#r),o=Yj(this.#n[3]*256/this.#i);if(Xj(this.#a,e,r,i,a,o),n)for(let t of n)for(let n of t)n!==e&&Xj(this.#a,n,r,i,a,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,this.#t[0]=Math.max(this.#t[0],this.#n[0]),this.#t[1]=Math.max(this.#t[1],this.#n[1]),this.#t[2]=Math.min(this.#t[2],this.#n[2]),this.#t[3]=Math.min(this.#t[3],this.#n[3])),this}take(){return new Qj(this.#o,this.#a)}takeDebugMetadata(){throw Error(`Unreachable`)}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}},tM=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[qj]:[]};#n=new Map;#r=new Set;#i=new Map;#a;#o;#s;constructor(e,t=!1){this.#s=e,t&&(this.#a=new Map,this.#o=(e,t)=>{$j(this.#a,t).dependencies.add(e)})}get clipBox(){return this.#s.clipBox}growOperationsCount(e){this.#s.growOperationsCount(e)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[qj]:{__proto__:this.#t[qj]}},this.#s.save(e),this}restore(e){this.#s.restore(e,this.#o);let t=Object.getPrototypeOf(this.#e);return t===null?this:(this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this)}recordOpenMarker(e){return this.#s.recordOpenMarker(e,this.#o),this}getOpenMarker(){return this.#s.getOpenMarker()}recordCloseMarker(e){return this.#s.recordCloseMarker(e,this.#o),this}beginMarkedContent(e){return this.#s.beginMarkedContent(e),this}endMarkedContent(e){return this.#s.endMarkedContent(e,this.#o),this}pushBaseTransform(e){return this.#s.pushBaseTransform(e),this}popBaseTransform(){return this.#s.popBaseTransform(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,n){this.#e[e]=this.#n.get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(qj,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#r)this.recordFutureForcedDependency(qj,e);return this}resetBBox(e){return this.#s.resetBBox(e),this}recordClipBox(e,t,n,r,i,a){return this.#s.recordClipBox(e,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#s.recordBBox(e,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){let s=n.bbox,c,l;if(s&&(c=s[2]!==s[0]&&s[3]!==s[1]&&this.#i.get(n),c!==!1&&(l=[0,0,0,0],Q.axialAlignedBoundingBox(s,n.fontMatrix,l),(r!==1||i!==0||a!==0)&&Q.scaleMinMax([r,0,0,-r,i,a],l),c)))return this.recordBBox(e,t,l[0],l[2],l[1],l[3]);if(!o)return this.recordFullPageBBox(e);let u=o();return s&&l&&c===void 0&&(c=l[0]<=i-u.actualBoundingBoxLeft&&l[2]>=i+u.actualBoundingBoxRight&&l[1]<=a-u.actualBoundingBoxAscent&&l[3]>=a+u.actualBoundingBoxDescent,this.#i.set(n,c),c)?this.recordBBox(e,t,l[0],l[2],l[1],l[3]):this.recordBBox(e,t,i-u.actualBoundingBoxLeft,i+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#s.recordFullPageBBox(e),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#r,r=this.#e,i=this.#t;for(let e of t)e in this.#e?n.add(r[e]):e in i&&i[e].forEach(n.add,n);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#r.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[qj]),this.#a){let t=$j(this.#a,e),{dependencies:n}=t;this.#r.forEach(n.add,n),this.#s._savesStack.forEach(n.add,n),this.#s._markedContentStack.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.recordOperation(e,t,[this.#r,this.#s._savesStack,this.#s._markedContentStack]),n&&this.#r.clear(),this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#r);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.bboxToClipBoxDropOperation(e),n&&this.#r.clear(),this}take(){return this.#i.clear(),this.#s.take()}takeDebugMetadata(){return this.#a}},nM=class e{#e;#t;#n;#r=0;#i=0;constructor(t,n,r){if(t instanceof e&&t.#n===!!r)return t;this.#e=t,this.#t=n,this.#n=!!r}get clipBox(){return this.#e.clipBox}growOperationsCount(){throw Error(`Unreachable`)}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this.#e.recordSimpleDataFromNamed(e,t,this.#t),this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,t,n,r,i,a){return this.#n||this.#e.recordClipBox(this.#t,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#n||this.#e.recordBBox(this.#t,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r,i,a,o){return this.#n||this.#e.recordCharacterBBox(this.#t,t,n,r,i,a,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw Error(`Unreachable`)}takeDebugMetadata(){throw Error(`Unreachable`)}},rM={stroke:[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],fill:[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],imageXObject:[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],rawFillPath:[`filter`,`fillColor`,`fillAlpha`],showText:[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],transform:[`transform`],transformAndFill:[`transform`,`fillColor`]},iM=class e{#e;#t;#n=4;#r=0;#i=new e.#a(this.#n*6);static#a=AA.isFloat16ArraySupported?Float16Array:Float32Array;constructor(e){this.#e=e.width,this.#t=e.height}record(t,n,r,i){if(this.#r===this.#n){this.#n*=2;let t=new e.#a(this.#n*6);t.set(this.#i),this.#i=t}let a=Q.domMatrixToTransform(t.getTransform()),o;if(i[0]!==1/0){let e=Gk.slice();Q.axialAlignedBoundingBox([0,-r,n,0],a,e);let t=Q.intersect(i,e);if(!t)return;let[s,c,l,u]=t;if(s!==e[0]||c!==e[1]||l!==e[2]||u!==e[3]){let e=Math.atan2(a[1],a[0]),t=Math.abs(Math.sin(e)),n=Math.abs(Math.cos(e));if(t<1e-6||n<1e-6||Math.abs(t-n)<1e-6)o=[s,c,s,u,l,c];else{let e=l-s,r=u-c,i=t*t,a=n*n,d=n*t,f=a-i,p=(r*a-e*d)/f;o=[s+(r*d-e*i)/f,c,s,c+p,l,u-p]}}}
380o||(o=[0,-r,0,0,n,-r],Q.applyTransform(o,a,0),Q.applyTransform(o,a,2),Q.applyTransform(o,a,4)),o[0]/=this.#e,o[1]/=this.#t,o[2]/=this.#e,o[3]/=this.#t,o[4]/=this.#e,o[5]/=this.#t,this.#i.set(o,this.#r*6),this.#r++}take(){return this.#i.subarray(0,this.#r*6)}},aM=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(mA(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:t,src:r,style:i}=e,a=new FontFace(t,r,i);this.addNativeFontFace(a);try{await a.load(),this.#e.add(t),n?.(e)}catch{fA(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}pA(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw fA(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return yA(this,`isFontLoadingAPISupported`,e)}get isSyncFontLoadingSupported(){return yA(this,`isSyncFontLoadingSupported`,Wk||AA.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(mA(!r.done,`completeRequest() cannot be called twice.`),r.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.callback,0)}}let{loadingRequests:n}=this,r={done:!1,complete:t,callback:e};return n.push(r),r}get _loadTestFont(){let e=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`);return yA(this,`_loadTestFont`,e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function r(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function i(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let a,o,s=this._document.createElement(`canvas`);s.width=1,s.height=1;let c=s.getContext(`2d`),l=0;function u(e,t){if(++l>30){fA(`Load test font never loaded.`),t();return}if(c.font=`30px `+e,c.fillText(`.`,0,20),c.getImageData(0,0,1,1).data[3]>0){t();return}setTimeout(u.bind(null,e,t))}let d=`lt${Date.now()}${this.loadTestFontId++}`,f=this._loadTestFont;f=i(f,976,d.length,d);let p=1482184792,m=n(f,16);for(a=0,o=d.length-3;a<o;a+=4)m=m-p+n(d,a)|0;a<d.length&&(m=m-p+n(d+`XXX`,a)|0),f=i(f,16,4,r(m));let h=`@font-face {font-family:"${d}";src:${`url(data:font/opentype;base64,${btoa(f)});`}}`;this.insertRule(h);let g=this._document.createElement(`div`);g.style.visibility=`hidden`,g.style.width=g.style.height=`10px`,g.style.position=`absolute`,g.style.top=g.style.left=`0px`;for(let t of[e.loadedName,d]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,g.append(e)}this._document.body.append(g),u(d,()=>{g.remove(),t.complete()})}},oM=class{compiledGlyphs=Object.create(null);#e;
380constructor(e,t=null,n,r){this.#e=e,this._inspectFont=t,n&&(this.charProcOperatorList=n),r&&Object.assign(this,r)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){fA(`getPathGenerator - ignoring character: "${e}".`)}let i=wj(r?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace}set disableFontFace(e){yA(this,`disableFontFace`,!!e)}get fontExtraProperties(){return this.#e.fontExtraProperties}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}},sM=class{static strings=[`fontFamily`,`fontWeight`,`italicAngle`]},cM=class{static strings=[`css`,`loadedName`,`baseFontName`,`src`]},lM=class{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static OFFSET_NUMBERS=Math.ceil(this.bools.length*2/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+this.numbers.length*8;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6},uM=class{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16},dM=class{#e;#t=new TextDecoder;#n;constructor(e){this.#e=e,this.#n=new DataView(e)}#r(e){mA(e<sM.strings.length,`Invalid string index`);let t=0;for(let n=0;n<e;n++)t+=this.#n.getUint32(t)+4;let n=this.#n.getUint32(t);return this.#t.decode(new Uint8Array(this.#e,t+4,n))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}},fM=class{#e;#t=new TextDecoder;#n;constructor(e){this.#e=e,this.#n=new DataView(e)}get guessFallback(){return this.#n.getUint8(0)!==0}#r(e){mA(e<cM.strings.length,`Invalid string index`);let t=5;for(let n=0;n<e;n++)t+=this.#n.getUint32(t)+4;let n=this.#n.getUint32(t);return this.#t.decode(new Uint8Array(this.#e,t+4,n))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#n.getUint32(e);let t=this.#n.getUint32(e),n=this.#t.decode(new Uint8Array(this.#e,e+4,t));e+=4+t;let r=this.#n.getUint32(e);return{style:n,weight:this.#t.decode(new Uint8Array(this.#e,e+4,r))}}},pM=class{#e;#t=new TextDecoder;#n;constructor({buffer:e,extra:t}){this.#e=e,this.#n=new DataView(e),t&&Object.assign(this,t)}#r(e){mA(e<lM.bools.length,`Invalid boolean index`);let t=Math.floor(e/4),n=e*2%8,r=this.#n.getUint8(t)>>n&3;return r===0?void 0:r===2}get black(){return this.#r(0)}get bold(){return this.#r(1)}get disableFontFace(){return this.#r(2)}get fontExtraProperties(){return this.#r(3)}get isInvalidPDFjsFont(){return this.#r(4)}get isType3Font(){return this.#r(5)}get italic(){return this.#r(6)}get missingFile(){return this.#r(7)}get remeasure(){return this.#r(8)}get vertical(){return this.#r(9)}#i(e){return mA(e<lM.numbers.length,`Invalid number index`),this.#n.getFloat64(lM.OFFSET_NUMBERS+e*8)}get ascent(){return this.#i(0)}get defaultWidth(){return this.#i(1)}get descent(){return this.#i(2)}#a(e,t,n,r){let i=this.#n.getUint8(e);if(i===0)return;mA(i===t,`Invalid array length.`),e+=1;let a=Array(i);for(let t=0;t<i;t++)a[t]=this.#n[n](e,!0),e+=r;return a}get bbox(){return this.#a(lM.OFFSET_BBOX,4,`getInt16`,2)}get fontMatrix(){return this.#a(lM.OFFSET_FONT_MATRIX,6,`getFloat64`,8)}get defaultVMetrics(){return this.#a(lM.OFFSET_DEFAULT_VMETRICS,3,`getInt16`,2)}#o(e){mA(e<lM.strings.length,`Invalid string index`);let t=lM.OFFSET_STRINGS+4;for(let n=0;n<e;n++)t+=this.#n.getUint32(t)+4;let n=this.#n.getUint32(t);return this.#t.decode(new Uint8Array(this.#e,t+4,n))}get fallbackName(){return this.#o(0)}get loadedName(){return this.#o(1)}get mimetype(){return this.#o(2)}get name(){return this.#o(3)}#s(){let e=lM.OFFSET_STRINGS,t=this.#n.getUint32(e);e+=4+t;let n=this.#n.getUint32(e);e+=4+n;let r=this.#n.getUint32(e);e+=4+r;let i=this.#n.getUint32(e);return{offset:e,length:i}}get data(){let{offset:e,length:t}=this.#s();return t===0?void 0:new Uint8Array(this.#e,e+4,t)}clearData(){let{offset:e,length:t}=this.#s();t!==0&&(this.#n.setUint32(e,0),this.#e=new Uint8Array(this.#e,0,e+4).slice().buffer,this.#n=new DataView(this.#e))}get cssFontInfo(){let e=lM.OFFSET_STRINGS,t=this.#n.getUint32(e);e+=4+t;let n=this.#n.getUint32(e);e+=4+n;let r=this.#n.getUint32(e);if(r===0)return null;let i=new Uint8Array(r);return i.set(new Uint8Array(this.#e,e+4,r)),new dM(i.buffer)}get systemFontInfo(){let e=lM.OFFSET_STRINGS,t=this.#n.getUint32(e);e+=4+t;let n=this.#n.getUint32(e);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#e,e+4,n)),new fM(r.buffer)}},mM=class{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){let e=this.view,t=this.data[uM.KIND],n=!!this.data[uM.HAS_BBOX],r=!!this.data[uM.HAS_BACKGROUND],i=e.getUint32(uM.N_COORD,!0),a=e.getUint32(uM.N_COLOR,!0),o=e.getUint32(uM.N_STOP,!0),s=20,c=new Float32Array(this.buffer,s,i*2);s+=i*8;let l=new Uint8Array(this.buffer,s,a*4);s+=a*4;let u=[];for(let t=0;t<o;++t){let t=e.getFloat32(s,!0);s+=4;let n=e.getUint32(s,!0);s+=4,u.push([t,`#${n.toString(16).padStart(6,`0`)}`])}let d=null;if(n){d=[];for(let t=0;t<4;++t)d.push(e.getFloat32(s,!0)),s+=4}let f=null;
380if(r&&(f=new Uint8Array(this.buffer,s,3),s+=3),t===1)return[`RadialAxial`,`axial`,d,u,Array.from(c.slice(0,2)),Array.from(c.slice(2,4)),null,null];if(t===2)return[`RadialAxial`,`radial`,d,u,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(t===3){let e=this.data[uM.SHADING_TYPE],t=null;if(c.length>0){t=Gk.slice();for(let e=0,n=c.length;e<n;e+=2)Q.pointBoundingBox(c[e],c[e+1],t)}return[`Mesh`,e,c,l,i,t,d,f]}throw Error(`Unsupported pattern kind: ${t}`)}},hM=class{#e;constructor(e){this.#e=e}get path(){return AA.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}};function gM(e){if(e instanceof URL)return e;if(typeof e==`string`){if(Wk){if(/^[a-z][a-z0-9\-+.]+:/i.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}let t=URL.parse(e,window.location);if(t)return t}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}function _M(e){if(Wk&&typeof Buffer<`u`&&e instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e==`string`)return OA(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`object`&&!isNaN(e?.length))return new Uint8Array(e);throw Error(`Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.`)}function vM(e){if(typeof e!=`string`)return null;if(e.endsWith(`/`))return e;throw Error(`Invalid factory url: "${e}" must include trailing slash.`)}var yM=e=>typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,bM=LA.bind(null,yM,e=>typeof e==`object`&&typeof e?.name==`string`),xM=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){fA("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},SM={DATA:1,ERROR:2},CM={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function wM(){}function TM(e){if(e instanceof EA||e instanceof CA||e instanceof xA||e instanceof wA||e instanceof SA)return e;switch(e instanceof Error||typeof e==`object`&&e||pA(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new EA(e.message);case`InvalidPDFException`:return new CA(e.message);case`PasswordException`:return new xA(e.message,e.code);case`ResponseException`:return new wA(e.message,e.status,e.missing);case`UnknownErrorException`:return new SA(e.message,e.details)}return new SA(e.message,e.toString())}var EM=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===SM.DATA)n.resolve(e.data);else if(e.callback===SM.ERROR)n.reject(TM(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:SM.DATA,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:SM.ERROR,callbackId:e.callbackId,reason:TM(t)})});return}if(e.streamId){this.#n(e);return}t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}
380sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[i]={controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:CM.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{mA(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:CM.CANCEL,streamId:i,reason:TM(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:CM.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:CM.CLOSE,streamId:t}),delete a.streamSinks[t])},error(e){mA(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:CM.ERROR,streamId:t,reason:TM(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:CM.START_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:CM.START_COMPLETE,streamId:t,reason:TM(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case CM.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(TM(e.reason));break;case CM.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(TM(e.reason));break;case CM.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:CM.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||wM).then(function(){i.postMessage({sourceName:n,targetName:r,stream:CM.PULL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:CM.PULL_COMPLETE,streamId:t,reason:TM(e)})});break;case CM.ENQUEUE:if(mA(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case CM.CLOSE:if(mA(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case CM.ERROR:mA(a,`error should have stream controller`),a.controller.error(TM(e.reason)),this.#i(a,t);break;case CM.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(TM(e.reason)),this.#i(a,t);break;case CM.CANCEL:if(!o)break;let s=TM(e.reason);Promise.try(o.onCancel||wM,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:CM.CANCEL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:CM.CANCEL_COMPLETE,streamId:t,reason:TM(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},DM=class{#e=Object.freeze({cMapUrl:`CMap`,standardFontDataUrl:`font`,wasmUrl:`wasm`});constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case`cMapUrl`:case`standardFontDataUrl`:case`wasmUrl`:break;default:pA(`Not implemented: ${e}`)}let n=this[e];if(!n)throw Error(`Ensure that the \`${e}\` API parameter is provided.`);let r=`${n}${t}`;return this._fetch(r,e).catch(t=>{throw Error(`Unable to load ${this.#e[e]} data at: ${r}`)})}async _fetch(e,t){pA("Abstract method `_fetch` called.")}},OM=class extends DM{async _fetch(e,t){let n=await KA(e,t===`cMapUrl`&&!e.endsWith(`.bcmap`)?`text`:`bytes`);return n instanceof Uint8Array?n:OA(n)}},kM=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset({canvas:e},t,n){if(!e)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.width=t,e.height=n}destroy(e){let{canvas:t}=e;if(!t)throw Error(`Canvas is not specified`);t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){pA("Abstract method `_createCanvas` called.")}},AM=class extends kM{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},jM=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}destroy(e=!1){}},MM=class extends jM{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(WA,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(WA,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(YA(e)?fA(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=_A(e,``))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);
380if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=Q.makeHexColor(...a);let o=this.#v(t);if(t=Q.makeHexColor(...o),this.#l.style.color=``,e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array(256);for(let e=0;e<=255;e++){let t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let c=s.join(`,`),l=`g_${this.#r}_hcm_filter`,u=i.filter=this.#m(l);this.#g(c,c,c,u),this.#p(u);let d=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(d(0,5),d(1,5),d(2,5),u),i.url=this.#d(l),i.url}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#v.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#l.style.color=``;let p=(e,t,n)=>{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(WA,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0`),e.append(t)}#p(e){let t=this.#i.createElementNS(WA,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0`),e.append(t)}#m(e){let t=this.#i.createElementNS(WA,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(WA,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(WA,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(WA,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=e,sj(getComputedStyle(this.#l).getPropertyValue(`color`))}};Wk&&fA("Please use the `legacy` build in Node.js environments.");async function NM(e){let t=await process.getBuiltinModule(`fs/promises`).readFile(e);return new Uint8Array(t)}var PM=class extends jM{},FM=class extends kM{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire({}.url)(`@napi-rs/canvas`).createCanvas(e,t)}},IM=class extends DM{async _fetch(e,t){return NM(e)}},LM=`
381struct Uniforms {
382  offsetX      : f32,
383  offsetY      : f32,
384  scaleX       : f32,
385  scaleY       : f32,
386  paddedWidth  : f32,
387  paddedHeight : f32,
388  borderSize   : f32,
389  _pad         : f32,
390};
391
392@group(0) @binding(0) var<uniform> u : Uniforms;
393
394struct VertexInput {
395  @location(0) position : vec2<f32>,
396  @location(1) color    : vec4<f32>,
397};
398
399struct VertexOutput {
400  @builtin(position) position : vec4<f32>,
401  @location(0)       color    : vec3<f32>,
402};
403
404@vertex
405fn vs_main(in : VertexInput) -> VertexOutput {
406  var out : VertexOutput;
407  let cx = (in.position.x + u.offsetX) * u.scaleX;
408  let cy = (in.position.y + u.offsetY) * u.scaleY;
409  out.position = vec4<f32>(
410    ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
411    1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
412    0.0,
413    1.0
414  );
415  out.color = in.color.rgb;
416  return out;
417}
418
419@fragment
420fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
421  return vec4<f32>(in.color, 1.0);
422}
423`,RM=new class{#e=null;#t=null;#n=null;#r=null;async#i(){if(!globalThis.navigator?.gpu)return!1;try{let e=await navigator.gpu.requestAdapter();return e?(this.#r=navigator.gpu.getPreferredCanvasFormat(),this.#t=await e.requestDevice(),!0):!1}catch{return!1}}init(){return this.#e||=this.#i()}get isReady(){return this.#t!==null}loadMeshShader(){if(!this.#t||this.#n)return;let e=this.#t.createShaderModule({code:LM});this.#n=this.#t.createRenderPipeline({layout:`auto`,vertex:{module:e,entryPoint:`vs_main`,buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:`float32x2`}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:`unorm8x4`}]}]},fragment:{module:e,entryPoint:`fs_main`,targets:[{format:this.#r}]},primitive:{topology:`triangle-list`}})}draw(e,t,n,r,i,a,o,s){this.loadMeshShader();let c=this.#t,{offsetX:l,offsetY:u,scaleX:d,scaleY:f}=r,p=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(p,0,e);let m=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(m,0,t);let h=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(h,0,new Float32Array([l,u,d,f,a,o,s,0]));let g=c.createBindGroup({layout:this.#n.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:h}}]}),_=new OffscreenCanvas(a,o),v=_.getContext(`webgpu`);v.configure({device:c,format:this.#r,alphaMode:i?`opaque`:`premultiplied`});let y=i?{r:i[0]/255,g:i[1]/255,b:i[2]/255,a:1}:{r:0,g:0,b:0,a:0},b=c.createCommandEncoder(),x=b.beginRenderPass({colorAttachments:[{view:v.getCurrentTexture().createView(),clearValue:y,loadOp:`clear`,storeOp:`store`}]});return n>0&&(x.setPipeline(this.#n),x.setBindGroup(0,g),x.setVertexBuffer(0,p),x.setVertexBuffer(1,m),x.draw(n)),x.end(),c.queue.submit([b.finish()]),p.destroy(),m.destroy(),h.destroy(),_.transferToImageBitmap()}};function zM(){return RM.init()}function BM(){return RM.isReady}function VM(){RM.loadMeshShader()}function HM(e,t,n,r,i,a,o,s){return RM.draw(e,t,n,r,i,a,o,s)}var UM={FILL:`Fill`,STROKE:`Stroke`,SHADING:`Shading`};function WM(e,t){if(!t)return;let n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}var GM=class{isModifyingCurrentTransform(){return!1}getPattern(){pA("Abstract method `getPattern` called.")}},KM=class extends GM{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type===`radial`}areConic(){if(!this.isRadial())return!1;let e=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return e+this._r1>this._r0&&e+this._r0>this._r1}_createGradient(e,t=null){let n,r=this._p0,i=this._p1;if(t&&(r=r.slice(),i=i.slice(),Q.applyTransform(r,t),Q.applyTransform(i,t)),this._type===`axial`)n=e.createLinearGradient(r[0],r[1],i[0],i[1]);else if(this._type===`radial`){let a=this._r0,o=this._r1;if(t){let e=new Float32Array(2);Q.singularValueDecompose2dScale(t,e),a*=e[0],o*=e[0]}n=e.createRadialGradient(r[0],r[1],a,i[0],i[1],o)}for(let e of this._colorStops)n.addColorStop(e[0],e[1]);return n}_createReversedGradient(e,t=null){let n=this._p1,r=this._p0;t&&(n=n.slice(),r=r.slice(),Q.applyTransform(n,t),Q.applyTransform(r,t));let i=this._r1,a=this._r0;if(t){let e=new Float32Array(2);Q.singularValueDecompose2dScale(t,e),i*=e[0],a*=e[0]}let o=e.createRadialGradient(n[0],n[1],i,r[0],r[1],a),s=this._colorStops.map(([e,t])=>[1-e,t]).reverse();for(let[e,t]of s)o.addColorStop(e,t);return o}getPattern(e,t,n,r){let i;if(r===UM.STROKE||r===UM.FILL){if(this.isOriginBased()){let r=Q.transform(n,t.baseTransform);
423this.matrix&&(r=Q.transform(r,this.matrix));let i=.001,a=Math.hypot(r[0],r[1]),o=Math.hypot(r[2],r[3]),s=(r[0]*r[2]+r[1]*r[3])/(a*o);if(Math.abs(s)<i)if(this.isRadial()){if(Math.abs(a-o)<i)return this._createGradient(e,r)}else return this._createGradient(e,r)}let a=t.current.getClippedPathBoundingBox(r,lj(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,s=Math.ceil(a[3]-a[1])||1,c=t.canvasFactory.create(o,s),l=c.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-a[0],-a[1]),n=Q.transform(n,[1,0,0,1,a[0],a[1]]),l.transform(...t.baseTransform),this.matrix&&l.transform(...this.matrix),WM(l,this._bbox),this.areConic()&&(l.fillStyle=this._createReversedGradient(l),l.fill()),l.fillStyle=this._createGradient(l),l.fill(),i=e.createPattern(c.canvas,`no-repeat`),t.canvasFactory.destroy(c);let u=new DOMMatrix(n);i.setTransform(u)}else this.areConic()&&(e.save(),WM(e,this._bbox),e.fillStyle=this._createReversedGradient(e),e.fillRect(-1e10,-1e10,2e10,2e10),e.restore()),WM(e,this._bbox),i=this._createGradient(e);return i}};function qM(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=e.width*4,f;c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r*2+1]>c[i*2+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n*2]+t.offsetX)*t.scaleX,m=(c[n*2+1]+t.offsetY)*t.scaleY,h=(c[r*2]+t.offsetX)*t.scaleX,g=(c[r*2+1]+t.offsetY)*t.scaleY,_=(c[i*2]+t.offsetX)*t.scaleX,v=(c[i*2+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a*4],b=l[a*4+1],x=l[a*4+2],S=l[o*4],C=l[o*4+1],w=l[o*4+2],T=l[s*4],E=l[s*4+1],D=l[s*4+2],O=Math.round(m),k=Math.round(v),A,j,M,N,P,ee,te,ne;for(let e=O;e<=k;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);A=p-(p-h)*t,j=y-(y-S)*t,M=b-(b-C)*t,N=x-(x-w)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),A=h-(h-_)*t,j=S-(S-T)*t,M=C-(C-E)*t,N=w-(w-D)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),P=p-(p-_)*t,ee=y-(y-T)*t,te=b-(b-E)*t,ne=x-(x-D)*t;let n=Math.round(Math.min(A,P)),r=Math.round(Math.max(A,P)),i=d*e+n*4;for(let e=n;e<=r;e++)t=(A-e)/(A-P),t<0?t=0:t>1&&(t=1),u[i++]=j-(j-ee)*t|0,u[i++]=M-(M-te)*t|0,u[i++]=N-(N-ne)*t|0,u[i++]=255}}var JM=class extends GM{constructor(e){super(),this._posData=e[2],this._colData=e[3],this._vertexCount=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null,VM()}_createMeshCanvas(e,t,n){let r=1.1,i=3e3,a=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-a,c=Math.ceil(this._bounds[3])-o,l=Math.min(Math.ceil(Math.abs(s*e[0]*r)),i)||1,u=Math.min(Math.ceil(Math.abs(c*e[1]*r)),i)||1,d=s?s/l:1,f=c?c/u:1,p={coords:this._posData,colors:this._colData,offsetX:-a,offsetY:-o,scaleX:1/d,scaleY:1/f},m=l+4,h=u+4,g=n.create(m,h);if(BM()&&this._vertexCount>48)g.context.drawImage(HM(this._posData,this._colData,this._vertexCount,p,t,m,h,2),0,0);else{let e=g.context.createImageData(l,u);if(t){let n=e.data;for(let e=0,r=n.length;e<r;e+=4)n[e]=t[0],n[e+1]=t[1],n[e+2]=t[2],n[e+3]=255}for(let t=0,n=this._vertexCount;t<n;t+=3)qM(e,p,t,t+1,t+2,t,t+1,t+2);g.context.putImageData(e,2,2)}return{canvas:g.canvas,offsetX:a-2*d,offsetY:o-2*f,scaleX:d,scaleY:f}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,r){WM(e,this._bbox);let i=new Float32Array(2);if(r===UM.SHADING)Q.singularValueDecompose2dScale(lj(e),i);else if(this.matrix){Q.singularValueDecompose2dScale(this.matrix,i);let[e,n]=i;Q.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=e,i[1]*=n}else Q.singularValueDecompose2dScale(t.baseTransform,i);let a=this._createMeshCanvas(i,r===UM.SHADING?null:this._background,t.canvasFactory);r!==UM.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY);let o=e.createPattern(a.canvas,`no-repeat`);return t.canvasFactory.destroy(a),o}},YM=class extends GM{getPattern(){return`hotpink`}};function XM(e){switch(e[0]){case`RadialAxial`:return new KM(e);case`Mesh`:return new JM(e);case`Dummy`:return new YM}throw Error(`Unknown IR type: ${e[0]}`)}var ZM={COLORED:1,UNCOLORED:2},QM=class e{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,r){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.needsIsolation=e[9]??!0,this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=r,this.patternBaseMatrix=this.matrix?Q.transform(r,this.matrix
423):r}canSkipPatternCanvas([e,t,n,r]){let[i,a,o,s]=this.bbox,c=Math.abs(this.xstep),l=Math.abs(this.ystep);if(e>c+1e-6||t>l+1e-6)return null;let u=Math.floor((n-o)/c)+1,d=Math.ceil((n+e-i)/c)-1,f=Math.floor((r-s)/l)+1,p=Math.ceil((r+t-a)/l)-1;return d<=u&&p<=f?[u,f]:null}updatePatternDims(e,t){let n=Q.inverseTransform(this.patternBaseMatrix),r=[e[0],e[1]],i=[e[2],e[3]];Q.applyTransform(r,n),Q.applyTransform(i,n),t[0]=Math.abs(i[0]-r[0]),t[1]=Math.abs(i[1]-r[1]),t[2]=Math.min(r[0],i[0]),t[3]=Math.min(r[1],i[1])}_renderTileCanvas(e,t,n,r){let[i,a,o,s]=this.bbox,c=e.canvasFactory.create(n.size,r.size),l=c.context,u=this.canvasGraphicsFactory.createCanvasGraphics(l,t);return u.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(u,this.paintType,this.color),l.translate(-n.scale*i,-r.scale*a),u.transform(0,n.scale,0,0,r.scale,0,0),l.save(),u.dependencyTracker?.save(),this.clipBbox(u,i,a,o,s),u.baseTransform=lj(u.ctx),u.executeOperatorList(this.operatorList),u.endDrawing(),u.dependencyTracker?.restore(),l.restore(),c}_getCombinedScales(){let e=new Float32Array(2);Q.singularValueDecompose2dScale(this.matrix,e);let[t,n]=e;return Q.singularValueDecompose2dScale(this.baseTransform,e),[t*e[0],n*e[1]]}
423drawPattern(e,t,n=!1,[r,i],a){let[o,s,c,l]=this.bbox,u=e.dependencyTracker;if(u&&(e.dependencyTracker=new nM(u,a)),e.save(),n?e.ctx.clip(t,`evenodd`):e.ctx.clip(t),e.ctx.setTransform(...this.patternBaseMatrix),e.ctx.translate(r*this.xstep,i*this.ystep),this.needsIsolation||e.ctx.globalAlpha!==1||e.ctx.globalCompositeOperation!==`source-over`||e.inSMaskMode){let t=c-o,n=l-s,[r,i]=this._getCombinedScales(),u=this.getSizeAndScale(t,this.ctx.canvas.width,r),d=this.getSizeAndScale(n,this.ctx.canvas.height,i),f=this._renderTileCanvas(e,a,u,d);e.ctx.drawImage(f.canvas,o,s,t,n),e.canvasFactory.destroy(f)}else this.setFillAndStrokeStyleToContext(e,this.paintType,this.color),this.clipBbox(e,o,s,c,l),e.baseTransformStack.push(e.baseTransform),e.baseTransform=lj(e.ctx),e.executeOperatorList(this.operatorList),e.baseTransform=e.baseTransformStack.pop();e.restore(),u&&(e.dependencyTracker=u)}createPatternCanvas(e,t){let[n,r,i,a]=this.bbox,o=i-n,s=a-r,{xstep:c,ystep:l}=this;c=Math.abs(c),l=Math.abs(l),dA(`TilingType: `+this.tilingType);let[u,d]=this._getCombinedScales(),f=o,p=s,m=!1,h=!1;Math.ceil(c*u)>
423=Math.ceil(o*u)?f=c:m=!0,Math.ceil(l*d)>=Math.ceil(s*d)?p=l:h=!0;let g=this.getSizeAndScale(f,this.ctx.canvas.width,u),_=this.getSizeAndScale(p,this.ctx.canvas.height,d),v=this._renderTileCanvas(e,t,g,_);if(m||h){let t=v.canvas;m&&(f=c),h&&(p=l);let i=this.getSizeAndScale(f,this.ctx.canvas.width,u),a=this.getSizeAndScale(p,this.ctx.canvas.height,d),g=i.size,_=a.size,y=e.canvasFactory.create(g,_),b=y.context,x=m?Math.floor(o/c):0,S=h?Math.floor(s/l):0;for(let e=0;e<=x;e++)for(let n=0;n<=S;n++)b.drawImage(t,g*e,_*n,g,_,0,0,g,_);return e.canvasFactory.destroy(v),{canvas:y.canvas,canvasEntry:y,scaleX:i.scale,scaleY:a.scale,offsetX:n,offsetY:r}}return{canvas:v.canvas,canvasEntry:v,scaleX:g.scale,scaleY:_.scale,offsetX:n,offsetY:r}}getSizeAndScale(t,n,r){let i=Math.max(e.MAX_PATTERN_SIZE,n),a=Math.ceil(t*r);return a>=i?a=i:r=a/t,{scale:r,size:a}}clipBbox(e,t,n,r,i){let a=r-t,o=i-n,s=new Path2D;s.rect(t,n,a,o),Q.axialAlignedBoundingBox([t,n,r,i],lj(e.ctx),e.current.minMax),e.ctx.clip(s),e.current.updateClipFromPath()}setFillAndStrokeStyleToContext(e,t,n){let r=e.ctx,i=e.current;switch(i.patternFill=i.patternStroke=!1,t){case ZM.COLORED:let{fillStyle:e,strokeStyle:a}=this.ctx;r.fillStyle=i.fillColor=e,r.strokeStyle=i.strokeColor=a;break;case ZM.UNCOLORED:r.fillStyle=r.strokeStyle=n,i.fillColor=i.strokeColor=n;break;default:throw new TA(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,r,i){let a=r===UM.SHADING?n:Q.transform(n,this.patternBaseMatrix),o=this.createPatternCanvas(t,i),s=new DOMMatrix(a);s=s.translate(o.offsetX,o.offsetY),s=s.scale(1/o.scaleX,1/o.scaleY);let c=e.createPattern(o.canvas,`repeat`);return t.canvasFactory.destroy(o.canvasEntry),c.setTransform(s),c}};function $M({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=AA.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=c^l,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let r=0;r<i;++r){for(let r=t+u;t<r;++t,m+=8){let r=e[t];n[m]=c^-(r>>7&1)&f,n[m+1]=c^-(r>>6&1)&f,n[m+2]=c^-(r>>5&1)&f,n[m+3]=c^-(r>>4&1)&f,n[m+4]=c^-(r>>3&1)&f,n[m+5]=c^-(r>>2&1)&f,n[m+6]=c^-(r>>1&1)&f,n[m+7]=c^-(r&1)&f}if(d===0)continue;let r=t<p?e[t++]:255;for(let e=0;e<d;++e,++m)n[m]=c^-(r>>7-e&1)&f}return{srcPos:t,destPos:m}}var eN=16,tN=100,nN=15,rN=10,iN=16,aN=new DOMMatrix,oN=new Float32Array(2);function sN(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,a,o){t.transform(e,n,r,i,a,o),this.__originalTransform(e,n,r,i,a,o)},e.setTransform=function(e,n,r,i,a,o){n===void 0?(t.setTransform(e),this.__originalSetTransform(e)):(t.setTransform(e,n,r,i,a,o),this.__originalSetTransform(e,n,r,i,a,o))},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,a,o){t.bezierCurveTo(e,n,r,i,a,o),this.__originalBezierCurveTo(e,n,r,i,a,o)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}function cN(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=lj(e);if(d===0&&f===0){let g=o*u+m,_=Math.round(g),v=s*p+h,y=Math.round(v),b=(o+c)*u+m,x=Math.abs(Math.round(b)-_)||1,S=(s+l)*p+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),_,y),e.drawImage(t,n,r,i,a,0,0,x,C),e.setTransform(u,d,f,p,m,h),[x,C]}if(u===0&&p===0){let g=s*f+m,_=Math.round(g),v=o*d+h,y=Math.round(v),b=(s+l)*f+m,x=Math.abs(Math.round(b)-_)||1,S=(o+c)*d+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,_,y),e.drawImage(t,n,r,i,a,0,0,C,x),e.setTransform(u,d,f,p,m,h),[C,x]}e.drawImage(t,n,r,i,a,o,s,c,l);let g=Math.hypot(u,d),_=Math.hypot(f,p);return[g*c,_*l]}var lN=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=qk;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=eA.FILL;textRise=0;fillColor=`#000000`;strokeColor=`#000000`;tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;
423transferMaps=`none`;minMax=Kk.slice();constructor(e,t){this.clipBox=new Float32Array([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e.tilingPatternDims=this.tilingPatternDims?.slice(),e}getPathBoundingBox(e=UM.FILL,t=null){let n=this.minMax.slice();if(e===UM.STROKE){t||pA(`Stroke bounding box must include transform.`),Q.singularValueDecompose2dScale(t,oN);let e=oN[0]*this.lineWidth/2,r=oN[1]*this.lineWidth/2;n[0]-=e,n[1]-=r,n[2]+=e,n[3]+=r}return n}updateClipFromPath(){let e=Q.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(Kk,0)}getClippedPathBoundingBox(e=UM.FILL,t=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function uN(e,t){if(t instanceof ImageData){e.putImageData(t,0,0);return}let n=t.height,r=t.width,i=n%iN,a=(n-i)/iN,o=i===0?a:a+1,s=e.createImageData(r,iN),c=0,l,u=t.data,d=s.data,f,p,m,h;if(t.kind===tA.GRAYSCALE_1BPP){let t=u.byteLength,n=new Uint32Array(d.buffer,0,d.byteLength>>2),h=n.length,g=r+7>>3,_=4294967295,v=AA.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?iN:i,l=0,p=0;p<m;p++){let e=t-c,i=0,a=e>g?r:e*8-7,o=a&-8,s=0,d=0;for(;i<o;i+=8)d=u[c++],n[l++]=d&128?_:v,n[l++]=d&64?_:v,n[l++]=d&32?_:v,n[l++]=d&16?_:v,n[l++]=d&8?_:v,n[l++]=d&4?_:v,n[l++]=d&2?_:v,n[l++]=d&1?_:v;for(;i<a;i++)s===0&&(d=u[c++],s=128),n[l++]=d&s?_:v,s>>=1}for(;l<h;)n[l++]=0;e.putImageData(s,0,f*iN)}}else if(t.kind===tA.RGBA_32BPP){for(p=0,h=r*iN*4,f=0;f<a;f++)d.set(u.subarray(c,c+h)),c+=h,e.putImageData(s,0,p),p+=iN;f<o&&(h=r*i*4,d.set(u.subarray(c,c+h)),e.putImageData(s,0,p))}else if(t.kind===tA.RGB_24BPP)for(m=iN,h=r*m,f=0;f<o;f++){for(f>=a&&(m=i,h=r*m),l=0,p=h;p--;)d[l++]=u[c++],d[l++]=u[c++],d[l++]=u[c++],d[l++]=255;e.putImageData(s,0,f*iN)}else throw Error(`bad image kind: ${t.kind}`)}function dN(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}let n=t.height,r=t.width,i=n%iN,a=(n-i)/iN,o=i===0?a:a+1,s=e.createImageData(r,iN),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++){let n=t<a?iN:i;({srcPos:c}=$M({src:l,srcPos:c,dest:u,width:r,height:n,nonBlackColor:0})),e.putImageData(s,0,t*iN)}}function fN(e,t){for(let n of[`strokeStyle`,`fillStyle`,`fillRule`,`globalAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`globalCompositeOperation`,`font`,`filter`])e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function pN(e){e.strokeStyle=e.fillStyle=`#000000`,e.fillRule=`nonzero`,e.globalAlpha=1,e.lineWidth=1,e.lineCap=`butt`,e.lineJoin=`miter`,e.miterLimit=10,e.globalCompositeOperation=`source-over`,e.font=`10px sans-serif`,e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0);let{filter:t}=e;t!==`none`&&t!==``&&(e.filter=`none`)}function mN(e,t){if(t)return!0;Q.singularValueDecompose2dScale(e,oN);let n=Math.fround(fj.pixelRatio*GA.PDF_TO_CSS_UNITS);return oN[0]<=n&&oN[1]<=n}var hN=[`butt`,`round`,`square`],gN=[`miter`,`round`,`bevel`],_N={},vN={},yN=class e{constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c,l,u){this.ctx=e,this.current=new lN(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=l??null,this.imagesTracker=u??null}getObject(e,t,n=null){return typeof t==`string`?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith(`g_`)?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){let i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||`#ffffff`,this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){let e=this.transparentCanvasEntry=this.canvasFactory.create(i,a);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=e,this.ctx.save(),this.ctx.transform(...lj(this.compositeCtx))}this.ctx.save(),pN(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[3]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=lj(this.ctx)}executeOperatorList(e,t,n,r,i){let a=e.argsArray,o=e.fnArray,s=t||0,c=a.length;if(c===s)return s;let l=c-s>rN&&typeof n==`function`,u=l?Date.now()+nN:0,d=0,f=this.commonObjs,p=this.objs,m,h;for(;;){if(r!==void 0){if(s===r.nextBreakPoint)return r.breakIt(s,n),s;if(r.shouldSkip(s)){if(++s===c)return s;continue}}
423if(!i||i(s))if(m=o[s],h=a[s]??null,m!==aA.dependency)h===null?this[m](s):this[m](s,...h);else for(let e of h){this.dependencyTracker?.recordNamedData(e,s);let t=e.startsWith(`g_`)?f:p;if(!t.has(e))return t.get(e,n),s}if(s++,s===c)return s;if(l&&++d>rN){if(Date.now()>u)return n(),s;d=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)}endDrawing(){this.#e();for(let e of this.smaskGroupCanvases)this.canvasFactory.destroy(e);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0,this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!==`none`){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let n=e.width??e.displayWidth,r=e.height??e.displayHeight,i=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=[],s=i,c=a,l=n,u=r;for(;s>2&&l>1||c>2&&u>1;){let e=l,t=u;s>2&&l>1&&(e=Math.ceil(l/2),s/=l/e),c>2&&u>1&&(t=Math.ceil(u/2),c/=u/t),o.push({newWidth:e,newHeight:t}),l=e,u=t}if(o.length===0)return{img:e,paintWidth:n,paintHeight:r,tmpCanvas:null};if(o.length===1){let{newWidth:t,newHeight:i}=o[0],a=this.canvasFactory.create(t,i);return a.context.drawImage(e,0,0,n,r,0,0,t,i),{img:a.canvas,paintWidth:t,paintHeight:i,tmpCanvas:a}}let d=this.canvasFactory.create(1,1),f=this.canvasFactory.create(1,1),p=n,m=r,h=e;for(let{newWidth:e,newHeight:t}of o)this.canvasFactory.reset(f,e,t),f.context.drawImage(h,0,0,p,m,0,0,e,t),[d,f]=[f,d],h=d.canvas,p=e,m=t;return this.canvasFactory.destroy(f),{img:d.canvas,paintWidth:p,paintHeight:m,tmpCanvas:d}}_createMaskCanvas(e,t){let n=this.ctx,{width:r,height:i}=t,a=this.current.fillColor,o=this.current.patternFill,s=lj(n),c,l,u,d;if((t.bitmap||t.data)&&t.count>1){let n=t.bitmap||t.data.buffer;l=JSON.stringify(o?s:[s.slice(0,4),a]),c=this._cachedBitmapsMap.getOrInsertComputed(n,zA);let r=c.get(l);if(r&&!o){let t=Math.round(Math.min(s[0],s[2])+s[4]),n=Math.round(Math.min(s[1],s[3])+s[5]);return this.dependencyTracker?.recordDependencies(e,rM.transformAndFill),{canvas:r,offsetX:t,offsetY:n}}u=r}u||(d=this.canvasFactory.create(r,i),dN(d.context,t));let f=Q.transform(s,[1/r,0,0,-1/i,0,0]);f=Q.transform(f,[1,0,0,1,0,-i]);let p=Kk.slice();Q.axialAlignedBoundingBox([0,0,r,i],f,p);let[m,h,g,_]=p,v=Math.round(g-m)||1,y=Math.round(_-h)||1,b=this.canvasFactory.create(v,y),x=b.context,S=m,C=h;x.translate(-S,-C),x.transform(...f);let w=null;if(!u){let e=this._scaleImage(d.canvas,uj(x));u=e.img,w=e.tmpCanvas,u!==d.canvas&&(this.canvasFactory.destroy(d),d=null),c&&o&&(c.set(l,u),w=null,d=null)}x.imageSmoothingEnabled=mN(lj(x),t.interpolate),cN(x,u,0,0,u.width,u.height,0,0,r,i),w&&this.canvasFactory.destroy(w),d&&this.canvasFactory.destroy(d),x.globalCompositeOperation=`source-in`;let T=Q.transform(uj(x),[1,0,0,1,-S,-C]);return x.fillStyle=o?a.getPattern(n,this,T,UM.FILL,e):a,x.fillRect(0,0,r,i),c&&!o&&c.set(l,b.canvas),this.dependencyTracker?.recordDependencies(e,rM.transformAndFill),{canvas:b.canvas,canvasEntry:c&&!o?null:b,offsetX:Math.round(S),offsetY:Math.round(C)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData(`lineWidth`,e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData(`lineCap`,e),this.ctx.lineCap=hN[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData(`lineJoin`,e),this.ctx.lineJoin=gN[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData(`miterLimit`,e),this.ctx.miterLimit=t}setDash(e,t,n){this.dependencyTracker?.recordSimpleData(`dash`,e);let r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(t),r.lineDashOffset=n)}
423setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[n,r]of t)switch(n){case`LW`:this.setLineWidth(e,r);break;case`LC`:this.setLineCap(e,r);break;case`LJ`:this.setLineJoin(e,r);break;case`ML`:this.setMiterLimit(e,r);break;case`D`:this.setDash(e,r[0],r[1]);break;case`RI`:this.setRenderingIntent(e,r);break;case`FL`:this.setFlatness(e,r);break;case`Font`:this.setFont(e,r[0],r[1]);break;case`CA`:this.dependencyTracker?.recordSimpleData(`strokeAlpha`,e),this.current.strokeAlpha=r;break;case`ca`:this.dependencyTracker?.recordSimpleData(`fillAlpha`,e),this.ctx.globalAlpha=this.current.fillAlpha=r;break;case`BM`:this.dependencyTracker?.recordSimpleData(`globalCompositeOperation`,e),this.ctx.globalCompositeOperation=r;break;case`SMask`:this.dependencyTracker?.recordSimpleData(`SMask`,e),this.current.activeSMask=r?this.tempSMask:null,this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(e);break;case`TR`:this.dependencyTracker?.recordSimpleData(`filter`,e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){this.smaskPreparedEntry&&=(this.canvasFactory.destroy(this.smaskPreparedEntry),null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0}_ensurePreparedSMask(e,t,n){e!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(e,t,n))}checkSMaskState(e){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode(e):!this.current.activeSMask&&t?this.endSMaskMode():this.current.activeSMask&&t&&this._ensurePreparedSMask(this.current.activeSMask,this.ctx.canvas.width,this.ctx.canvas.height)}_prepareSMaskCanvas(e,t,n){let{canvas:r,subtype:i,backdrop:a,transferMap:o}=e,s=i===`Luminosity`||i===`Alpha`&&o;if(!a&&!s){this.smaskPreparedFor=e;return}let c,l,u;if(a&&s){let s=this.canvasFactory.create(t,n),d=s.context;d.drawImage(r,e.offsetX,e.offsetY),d.globalCompositeOperation=`destination-atop`,d.fillStyle=a,d.fillRect(0,0,t,n),d.globalCompositeOperation=`source-over`,c=this.canvasFactory.create(t,n);let f=c.context;f.filter=i===`Alpha`?this.filterFactory.addAlphaFilter(o):this.filterFactory.addLuminosityFilter(o),f.drawImage(s.canvas,0,0),f.filter=`none`,this.canvasFactory.destroy(s),l=u=0}else if(s){c=this.canvasFactory.create(r.width,r.height);let t=c.context;t.filter=i===`Alpha`?this.filterFactory.addAlphaFilter(o):this.filterFactory.addLuminosityFilter(o),t.drawImage(r,0,0),t.filter=`none`,{offsetX:l,offsetY:u}=e}else{c=this.canvasFactory.create(t,n);let i=c.context;i.drawImage(r,e.offsetX,e.offsetY),i.globalCompositeOperation=`destination-atop`,i.fillStyle=a,i.fillRect(0,0,t,n),i.globalCompositeOperation=`source-over`,l=u=0}this.smaskPreparedEntry=c,this.smaskPreparedFor=e,this.smaskPreparedOffsetX=l,this.smaskPreparedOffsetY=u}beginSMaskMode(e){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let{width:t,height:n}=this.ctx.canvas,r=this.canvasFactory.create(t,n);this.smaskScratchCanvas=r,this.suspendedCtx=this.ctx;let i=this.ctx=r.context;i.setTransform(this.suspendedCtx.getTransform()),fN(this.suspendedCtx,i),sN(i,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask,t,n),this.setGState(e,[[`BM`,`source-over`]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),fN(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.ctx.restore()}composeSMask(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;if(o===0||s===0)return;let c=this.smaskPreparedEntry;if(c){let e=i-this.smaskPreparedOffsetX,t=a-this.smaskPreparedOffsetY;n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0);let r=new Path2D;r.rect(i,a,o,s),n.clip(r),n.globalCompositeOperation=`destination-in`,n.drawImage(c.canvas,e,t,o,s,i,a,o,s),n.restore(
423)}else this.genericComposeSMask(t.context,n,o,s,i,a,t.offsetX,t.offsetY);e.save(),e.globalAlpha=1,e.globalCompositeOperation=t.blendMode||`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,i,a,o,s,i,a,o,s),e.restore()}genericComposeSMask(e,t,n,r,i,a,o,s){let c=e.canvas,l=i-o,u=a-s;t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let d=new Path2D;d.rect(i,a,n,r),t.clip(d),t.globalCompositeOperation=`destination-in`,t.drawImage(c,l,u,n,r,i,a,n,r),t.restore()}save(e){this.inSMaskMode&&fN(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(fN(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(e),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,n,r,i,a,o){this.dependencyTracker?.recordIncrementalData(`transform`,e),this.ctx.transform(t,n,r,i,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,r){let[i]=n;if(!r){i||=n[0]=new Path2D,t!==aA.stroke&&t!==aA.closeStroke&&(this.current.tilingPatternDims=null),this[t](e,i);return}if(this.dependencyTracker!==null){let n=t===aA.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,r[0]-n,r[2]+n,r[1]-n,r[3]+n).recordDependencies(e,[`transform`])}i instanceof Path2D||(i=n[0]=wj(i)),Q.axialAlignedBoundingBox(r,lj(this.ctx),this.current.minMax);let a=this.current.tilingPatternDims;if(a&&t!==aA.stroke&&t!==aA.closeStroke&&this.current.fillColor instanceof QM){let e=Q.intersect(this.current.clipBox,this.current.minMax);e?this.current.fillColor.updatePatternDims(e,a):this.current.tilingPatternDims=null}this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let r=this.ctx,i=this.current.strokeColor;if(r.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof i==`object`&&i?.getPattern){let n=i.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.strokeStyle=i.getPattern(r,this,uj(r),UM.STROKE,e),n){let e=new Path2D;e.addPath(t,r.getTransform().invertSelf().multiplySelf(n)),t=e}this.rescaleAndStroke(t,!1),r.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,rM.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(UM.STROKE,lj(this.ctx))),r.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let r=this.ctx,i=this.current.fillColor,a=this.current.patternFill,o=!1,s=this.current.getClippedPathBoundingBox();if(this.dependencyTracker?.recordDependencies(e,rM.fill),a){let a=this.current.tilingPatternDims,c=a&&i.canSkipPatternCanvas(a);if(c){i.drawPattern(this,t,this.pendingEOFill,c,e),this.pendingEOFill=!1,n&&this.consumePath(e,t,s),this.current.tilingPatternDims=null;return}let l=i.isModifyingCurrentTransform()?r.getTransform():null;if(this.dependencyTracker?.save(e),r.save(),r.fillStyle=i.getPattern(r,this,uj(r),UM.FILL,e),l){let e=new Path2D;e.addPath(t,r.getTransform().invertSelf().multiplySelf(l)),t=e}o=!0}this.contentVisible&&s!==null&&(this.pendingEOFill?(r.fill(t,`evenodd`),this.pendingEOFill=!1):r.fill(t)),o&&(r.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,s)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,rM.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=_N}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=vN}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData(`sameLineText`).resetIncrementalData(`moveText`,e)}endText(e){let t=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){let{dependencyTracker:n}=this;t!==void 0&&n.recordFutureForcedDependency(`textClip`,n.getOpenMarker()).recordFutureForcedDependency(`textClip`,e),n.recordCloseMarker(e)}if(t!==void 0){let e=new Path2D,r=n.getTransform().invertSelf();for(let{transform:n,x:i,y:a,fontSize:o,path:s}of t)s&&e.addPath(s,new DOMMatrix(n).preMultiplySelf(r).translate(i,a).scale(o,-o));n.clip(e)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData(`charSpacing`,e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData(`wordSpacing`,e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData(`hScale`,e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData(`leading`,e),this.current.leading=-t}setFont(e,t,n){this.dependencyTracker?.recordSimpleData(`font`,e).recordSimpleDataFromNamed(`fontObj`,t,e);let r=this.commonObjs.get(t),i=this.current;if(!r)throw Error(`Can't find font for ${t}`);if(i.fontMatrix=r.fontMatrix||qk,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&fA(`Invalid font matrix for font `+t),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;let a=r.loadedName||`sans-serif`,o=r.systemFontInfo?.css||`"${a}", ${r.fallbackName}`,s=`normal`;r.black?s=`900`:r.bold&&(s=`bold`);let c=r.italic?`italic`:`normal`,l=n;n<eN?l=eN:n>tN&&(l=tN),this.current.fontSizeScale=n/l,this.ctx.font=`${c} ${s} ${l}px ${o}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData(`textRenderingMode`,e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData(`textRise`,e),this.current.textRise=t}moveText(e,t,n){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordIncrementalData(`moveText`,e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordSimpleData(`textMatrix`,e);let{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData(`moveText`,this.dependencyTracker.getSimpleIndex(`leading`)??e)}
423#n(e,t,n){let r=new Path2D;return r.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),r}paintChar(e,t,n,r,i,a){let o=this.ctx,s=this.current,c=s.font,l=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=l&eA.FILL_STROKE_MASK,f=!!(l&eA.ADD_TO_PATH_FLAG),p=s.patternFill&&!c.missingFile,m=s.patternStroke&&!c.missingFile,h;if((c.disableFontFace||f||p||m)&&!c.missingFile&&(h=c.getPathGenerator(this.commonObjs,t)),h&&(c.disableFontFace||p||m)){o.save(),o.translate(n,r),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,o,c);let t;if(d===eA.FILL||d===eA.FILL_STROKE)if(i){t=o.getTransform(),o.setTransform(...i);let e=this.#n(h,t,i);o.fill(e)}else o.fill(h);if(d===eA.STROKE||d===eA.FILL_STROKE)if(a){t||=o.getTransform(),o.setTransform(...a);let{a:e,b:n,c:r,d:i}=t,s=Q.inverseTransform(a),c=Q.transform([e,n,r,i,0,0],s);Q.singularValueDecompose2dScale(c,oN),o.lineWidth*=Math.max(oN[0],oN[1])/u,o.stroke(this.#n(h,t,a))}else o.lineWidth/=u,o.stroke(h);o.restore()}else(d===eA.FILL||d===eA.FILL_STROKE)&&(o.fillText(t,n,r),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t))),(d===eA.STROKE||d===eA.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t)).recordDependencies(e,rM.stroke),o.strokeText(t,n,r));f&&((this.pendingTextPaths||=[]).push({transform:lj(o),x:n,y:r,fontSize:u,path:h}),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r))}get isFontSubpixelAAEnabled(){let e=this.canvasFactory.create(10,10),t=e.context;t.scale(1.5,1),t.fillText(`I`,0,10);let n=t.getImageData(0,0,10,10).data;this.canvasFactory.destroy(e);let r=!1;for(let e=3;e<n.length;e+=4)if(n[e]>0&&n[e]<255){r=!0;break}return yA(this,`isFontSubpixelAAEnabled`,r)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,rM.showText).resetBBox(e),this.current.textRenderingMode&eA.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency(`textClip`,e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,r=n.font;if(r.isType3Font){this.showType3Text(e,t),this.dependencyTracker?.recordShowTextOperation(e);return}let i=n.fontSize;if(i===0){this.dependencyTracker?.recordOperation(e);return}let a=this.ctx,o=n.fontSizeScale,s=n.charSpacing,c=n.wordSpacing,l=n.fontDirection,u=n.textHScale*l,d=t.length,f=r.vertical,p=f?1:-1,m=r.defaultVMetrics,h=i*n.fontMatrix[0],g=n.textRenderingMode===eA.FILL&&!r.disableFontFace&&!n.patternFill;a.save(),n.textMatrix&&a.transform(...n.textMatrix),a.translate(n.x,n.y+n.textRise),l>0?a.scale(u,-1):a.scale(u,1);let _,v,y=n.textRenderingMode&eA.FILL_STROKE_MASK,b=y===eA.FILL||y===eA.FILL_STROKE,x=y===eA.STROKE||y===eA.FILL_STROKE,S=n.lineWidth,C=n.textMatrixScale;if(C===0||S===0?x&&(S=this.getSinglePixelWidth()):S/=C,o!==1&&(a.scale(o,o),S/=o),a.lineWidth=S,b&&n.patternFill){a.save();let t=n.fillColor.getPattern(a,this,uj(a),UM.FILL,e);_=lj(a),a.restore(),a.fillStyle=t}if(x&&n.patternStroke){a.save();let t=n.strokeColor.getPattern(a,this,uj(a),UM.STROKE,e);v=lj(a),a.restore(),a.strokeStyle=t}if(r.isInvalidPDFjsFont){let r=[],i=0;for(let e of t)r.push(e.unicode),i+=e.width;let o=r.join(``);if(a.fillText(o,0,0),this.dependencyTracker!==null){let t=a.measureText(o);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}
423n.x+=i*h*u,a.restore(),this.compose();return}let w=0,T;for(T=0;T<d;++T){let n=t[T];if(typeof n==`number`){w+=p*n*i/1e3;continue}let u=!1,d=(n.isSpace?c:0)+s,y=n.fontChar,b=n.accent,x,S,C=n.width;if(f){let e=n.vmetric||m,t=-(n.vmetric?e[1]:C*.5)*h,r=e[2]*h;C=e?-e[0]:C,x=t/o,S=(w+r)/o}else x=w/o,S=0;let E;if(r.remeasure&&C>0){E=a.measureText(y);let e=E.width*1e3/i*o;if(C<e&&this.isFontSubpixelAAEnabled){let t=C/e;u=!0,a.save(),a.scale(t,1),x/=t}else C!==e&&(x+=(C-e)/2e3*i/o)}if(this.contentVisible&&(n.isInFont||r.missingFile)){if(g&&!b)a.fillText(y,x,S),this.dependencyTracker?.recordCharacterBBox(e,a,E?{bbox:null}:r,i/o,x,S,()=>E??a.measureText(y));else if(this.paintChar(e,y,x,S,_,v),b){let t=x+i*b.offset.x/o,n=S-i*b.offset.y/o;this.paintChar(e,b.fontChar,t,n,_,v)}}let D=f?C*h-d*l:C*h+d*l;w+=D,u&&a.restore()}f?n.y-=w:n.x+=w*u,a.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,t){let n=this.ctx,r=this.current,i=r.font,a=r.fontSize,o=r.fontDirection,s=i.vertical?1:-1,c=r.charSpacing,l=r.
423wordSpacing,u=r.textHScale*o,d=r.fontMatrix||qk,f=t.length,p=r.textRenderingMode===eA.INVISIBLE,m,h,g,_;if(p||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),r.textMatrix&&n.transform(...r.textMatrix),n.translate(r.x,r.y+r.textRise),n.scale(u,o);let v=this.dependencyTracker;for(this.dependencyTracker=v?new nM(v,e):null,m=0;m<f;++m){if(h=t[m],typeof h==`number`){_=s*h*a/1e3,this.ctx.translate(_,0),r.x+=_*u;continue}let e=(h.isSpace?l:0)+c,o=i.charProcOperatorList[h.operatorListId];o?this.contentVisible&&(this.save(),n.scale(a,a),n.transform(...d),this.executeOperatorList(o),this.restore()):fA(`Type3 character "${h.operatorListId}" is not available.`);let f=[h.width,0];Q.applyTransform(f,d),g=f[0]*a+e,n.translate(g,0),r.x+=g*u}n.restore(),v&&(this.dependencyTracker=v)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,r,i,a,o){let s=new Path2D;s.rect(r,i,a-r,o-i),this.ctx.clip(s),this.dependencyTracker?.recordBBox(e,this.ctx,r,a,i,o).recordClipBox(e,this.ctx,r,a,i,o),this.endPath(e)}getColorN_Pattern(t,n){let r;if(n[0]===`TilingPattern`){let t=this.baseTransform||lj(this.ctx);r=new QM(n,this.ctx,{createCanvasGraphics:(t,n)=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new nM(this.dependencyTracker,n,!0):null)},t)}else r=this._getPattern(t,n[1],n[2]);return r}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData(`fillColor`,e);let n=this.current.fillColor=this.getColorN_Pattern(e,t);this.current.patternFill=!0,this.current.tilingPatternDims=n instanceof QM?[0,0,0,0]:null}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}
423setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=`transparent`,this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(e){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(e,t,n=null){let r;return this.cachedPatterns.has(t)?r=this.cachedPatterns.get(t):(r=XM(this.getObject(e,t)),this.cachedPatterns.set(t,r)),n&&(r.matrix=n),r}shadingFill(e,t){if(!this.contentVisible)return;let n=this.ctx;this.save(e),n.fillStyle=this._getPattern(e,t).getPattern(n,this,uj(n),UM.SHADING,e);let r=uj(n);if(r){let{width:e,height:t}=n.canvas,i=Kk.slice();Q.axialAlignedBoundingBox([0,0,e,t],r,i);let[a,o,s,c]=i;this.ctx.fillRect(a,o,s-a,c-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,rM.transform).recordDependencies(e,rM.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){pA(`Should not call beginInlineImage`)}beginImageData(){pA(`Should not call beginImageData`)}paintFormXObjectBegin(e,t,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=lj(this.ctx),n)){Q.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);let[t,r,i,a]=n,o=new Path2D;o.rect(t,r,i-t,a-r),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,t,i,r,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e);let{inSMaskMode:n}=this;n&&(this.endSMaskMode(),this.current.activeSMask=null);let r=this.ctx;if(t.isolated||dA(`TODO: Support non-isolated groups.`),t.knockout&&fA(`Knockout groups not supported.`),!t.needsIsolation&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&!n){if(t.bbox){let e=new Path2D,[n,i,a,o]=t.bbox;if(e.rect(n,i,a-n,o-i),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}r.clip(e)}this.groupStack.push(null),this.groupLevel++;return}let i=lj(r);t.matrix&&r.transform(...t.matrix);let a=[0,0,r.canvas.width,r.canvas.height],o;t.bbox?(o=Kk.slice(),Q.axialAlignedBoundingBox(t.bbox,lj(r),o),o=Q.intersect(o,a)||[0,0,0,0]):o=a;let s=Math.floor(o[0]),c=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),u=Math.max(Math.ceil(o[3])-c,1);this.current.startNewPathAndClipBox([0,0,l,u]);let d=this.canvasFactory.create(l,u);t.smask&&this.smaskGroupCanvases.push(d);let f=d.context;if(f.translate(-s,-c),f.transform(...i),!t.isolated&&!t.smask&&n&&t.needsIsolation&&(f.save(),f.setTransform(1,0,0,1,0,0),f.drawImage(r.canvas,-s,-c),f.restore()),t.bbox){let e=new Path2D,[n,r,i,a]=t.bbox;if(e.rect(n,r,i-n,a-r),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}f.clip(e)}t.smask&&this.smaskStack.push({canvas:d.canvas,context:f,offsetX:s,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null}),(!t.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(s,c),r.save()),fN(r,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies([`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`]).pushBaseTransform(r),this.setGState(e,[[`BM`,`source-over`],[`ca`,1],[`CA`,1],[`TR`,null]]),this.groupStack.push(r),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,r=this.groupStack.pop();if(r===null){this.restore(e);return}if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&(this.ctx.restore(),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform()));
423else{this.ctx.restore();let t=lj(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...t);let r=Kk.slice();Q.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],t,r),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy({canvas:n.canvas,context:n}),this.compose(r)}}beginAnnotation(e,t,n,r,i,a){if(this.#e(),pN(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let i=n[2]-n[0],o=n[3]-n[1];if(a&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=i,n[3]=o,Q.singularValueDecompose2dScale(lj(this.ctx),oN);let{viewportScale:e}=this,a=Math.ceil(i*this.outputScaleX*e),s=Math.ceil(o*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(a,s);let{canvas:c,context:l}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=l,this.ctx.save(),this.ctx.setTransform(oN[0],0,0,-oN[1],0,o*oN[1]),pN(this.ctx)}else{pN(this.ctx),this.endPath(e);let t=new Path2D;t.rect(n[0],n[1],i,o),this.ctx.clip(t)}}this.current=new lN(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(e,...r),this.transform(e,...i),this.baseTransform=lj(this.ctx)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;t=this.getObject(e,t.data,t),t.count=n;let r=this.ctx,i=this._createMaskCanvas(e,t),a=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,i.offsetX,i.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,i.offsetX,i.offsetX+a.width,i.offsetY,i.offsetY+a.height).recordOperation(e),r.restore(),i.canvasEntry&&this.canvasFactory.destroy(i.canvasEntry),this.compose()}paintImageMaskXObjectRepeat(e,t,n,r=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let s=this.ctx;s.save();let c=lj(s);s.transform(n,r,i,a,0,0);let l=this._createMaskCanvas(e,t);s.setTransform(1,0,0,1,l.offsetX-c[4],l.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,u=o.length;t<u;t+=2){let u=Q.transform(c,[n,r,i,a,o[t],o[t+1]]);s.drawImage(l.canvas,u[4],u[5]),this.dependencyTracker?.recordBBox(e,this.ctx,u[4],u[4]+l.canvas.width,u[5],u[5]+l.canvas.height)}s.restore(),l.canvasEntry&&this.canvasFactory.destroy(l.canvasEntry),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,rM.transformAndFill);for(let a of t){let{data:t,width:o,height:s,transform:c}=a,l=this.canvasFactory.create(o,s),u=l.context;u.save(),dN(u,this.getObject(e,t,a)),u.globalCompositeOperation=`source-in`,u.fillStyle=i?r.getPattern(u,this,uj(n),UM.FILL,e):r,u.fillRect(0,0,o,s),u.restore(),n.save(),n.transform(...c),n.scale(1,-1),cN(n,l.canvas,0,0,o,s,0,-1,1,1),this.canvasFactory.destroy(l),this.dependencyTracker?.recordBBox(e,n,0,o,0,s),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);if(!n){fA(`Dependent image isn't ready yet`);return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,t,n,r,i){if(!this.contentVisible)return;let a=this.getObject(e,t);if(!a){fA(`Dependent image isn't ready yet`);return}let o=a.width,s=a.height,c=[];for(let e=0,t=i.length;e<t;e+=2)c.push({transform:[n,0,0,r,i[e],i[e+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(e,a,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!==`none`&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps===`none`)return{img:e.bitmap,canvasEntry:null};let{bitmap:t,width:n,height:r}=e,i=this.canvasFactory.create(n,r),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter=`none`,{img:i.canvas,canvasEntry:i}}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,r=t.height,i=this.ctx;this.save(e);let{filter:a}=i;a!==`none`&&a!==``&&(i.filter=`none`),i.scale(1/n,-1/r);let o,s=null;if(t.bitmap){let e=this.applyTransferMapsToBitmap(t);o=e.img,s=e.canvasEntry}else if(typeof HTMLElement==`function`&&t instanceof HTMLElement||!t.data)o=t;else{let e=this.canvasFactory.create(n,r);uN(e.context,t),o=this.applyTransferMapsToCanvas(e.context),s=e}let c=this._scaleImage(o,uj(i));i.imageSmoothingEnabled=mN(lj(i),t.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(e).recordBBox(e,i,0,n,-r,0).recordDependencies(e,rM.imageXObject).recordOperation(e),this.imagesTracker?.record(i,n,r,this.dependencyTracker.clipBox)),cN(i,c.img,0,0,c.paintWidth,c.paintHeight,0,-r,n,r),c.tmpCanvas&&this.canvasFactory.destroy(c.tmpCanvas),s&&this.canvasFactory.destroy(s),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let r=this.ctx,i,a=null;if(t.bitmap)i=t.bitmap;else{let e=t.width,n=t.height,r=this.canvasFactory.create(e,n);uN(r.context,t),i=this.applyTransferMapsToCanvas(r.context),a=r}this.dependencyTracker?.resetBBox(e);for(let t of n)r.save(),r.transform(...t.transform),r.scale(1,-1),cN(r,i,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,r,0,1,-1,0),r.restore(
423);a&&this.canvasFactory.destroy(a),this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,rM.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){this.dependencyTracker?.beginMarkedContent(e),t===`OC`?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,n){let r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);let i=this.ctx;this.pendingClip?(r||(this.pendingClip===vN?i.clip(t,`evenodd`):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency(`clipPath`,e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=lj(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,r)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:r,d:i}=this.ctx.getTransform(),a,o;if(n===0&&r===0){let n=Math.abs(t),r=Math.abs(i);if(n===r)if(e===0)a=o=1/n;else{let t=n*e;a=o=t<1?1/t:1}else if(e===0)a=1/n,o=1/r;else{let t=n*e,i=r*e;a=t<1?1/t:1,o=i<1?1/i:1}}else{let s=Math.abs(t*i-n*r),c=Math.hypot(t,n),l=Math.hypot(r,i);if(e===0)a=l/s,o=c/s;else{let t=e*s;a=l>t?l/t:1,o=c>t?c/t:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,t){let{ctx:n,current:{lineWidth:r}}=this,[i,a]=this.getScaleForStroking();if(i===a){n.lineWidth=(r||1)*i,n.stroke(e);return}let o=n.getLineDash();t&&n.save(),n.scale(i,a),aN.a=1/i,aN.d=1/a;let s=new Path2D;if(s.addPath(e,aN),o.length>0){let e=Math.max(i,a);n.setLineDash(o.map(t=>t/e)),n.lineDashOffset/=e}n.lineWidth=r||1,n.stroke(s),t&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let e in aA)yN.prototype[e]!==void 0&&(yN.prototype[aA[e]]=yN.prototype[e]);var bN=class{#e=null;#t=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(e,t,n){this._source=e,this.#e=t,this.#t=n}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return mA(!this._fullReader,`BasePDFStream.getFullReader can only be called once.`),this._fullReader=new this.#e(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new this.#t(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){this._fullReader?.cancel(e);for(let t of new Set(this._rangeReaders))t.cancel(e)}},xN=class{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(e){this._stream=e}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){pA("Abstract method `read` called")}cancel(e){pA("Abstract method `cancel` called")}},SN=class{_stream=null;constructor(e,t,n){this._stream=e}async read(){pA("Abstract method `read` called")}cancel(e){pA("Abstract method `cancel` called")}};function CN(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=c(e),e=l(e),a(e)}if(n=o(e),n)return a(l(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=s(n);return e=l(e),a(e)}function r(e,t){return RegExp(`(?:^|;)\\s*`+e+`\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)`,t)}function i(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{let r=new TextDecoder(e,{fatal:!0}),i=OA(n);n=r.decode(i),t=!1}catch{}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i(`utf-8`,e),t&&(e=i(`iso-8859-1`,e))),e}function o(e){let t=[],n,i=r(`filename\\*((?!0\\d)\\d+)(\\*?)`,`ig`);for(;(n=i.exec(e))!==null;){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(e===0)break;continue}t[e]=[r,i]}let a=[];for(let e=0;e<t.length&&e in t;++e){let[n,r]=t[e];r=s(r),n&&(r=unescape(r),e===0&&(r=c(r))),a.push(r)}return a.join(``)}function s(e){if(e.startsWith(`"`)){let t=e.slice(1).split(`\\"`);for(let e=0;e<t.length;++e){let n=t[e].indexOf(`"`);n!==-1&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,`$1`)}e=t.join(`"`)}return e}function c(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function l(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,n,r){if(n===`q`||n===`Q`)return r=r.replaceAll(`_`,` `),r=r.replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}),i(t,r);try{r=atob(r)}catch{}return i(t,r)}
423)}return``}function wN(e,t){let n=new Headers;if(!e||!t||typeof t!=`object`)return n;for(let e in t){let r=t[e];r!==void 0&&n.append(e,r)}return n}function TN(e){return URL.parse(e)?.origin??null}function EN({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={contentLength:0,isRangeSupported:!1},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.contentLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)===`identity`&&(i.isRangeSupported=!0),i}function DN(e){let t=e.get(`Content-Disposition`);if(t){let e=CN(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(XA(e))return e}return null}function ON(e,t){return new wA(`Unexpected server response (${e}) while retrieving PDF "${t.href}".`,e,e===404||e===0&&t.protocol===`file:`)}function kN(e,t){if(e!==t)throw Error(`Expected range response-origin "${e}" to match "${t}".`)}function AN(e,t,n,r){return fetch(e,{method:`GET`,headers:t,signal:r.signal,mode:`cors`,credentials:n?`include`:`same-origin`,redirect:`follow`})}function jN(e,t){if(e!==200&&e!==206)throw ON(e,t)}function MN(e){if(e instanceof Uint8Array)return e.buffer;if(e instanceof ArrayBuffer)return e;throw Error(`getArrayBuffer - unexpected data: ${e}`)}var NN=class extends bN{_responseOrigin=null;constructor(e){super(e,PN,FN);let{httpHeaders:t,url:n}=e;mA(/https?:/.test(n.protocol),`PDFFetchStream only supports http(s):// URLs.`),this.headers=wN(!0,t)}},PN=class extends xN{_abortController=new AbortController;_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i,withCredentials:a}=e._source;this._isStreamingSupported=!n,AN(i,new Headers(e.headers),a,this._abortController).then(n=>{e._responseOrigin=TN(n.url),jN(n.status,i),this._reader=n.body.getReader();let a=n.headers,{contentLength:o,isRangeSupported:s}=EN({responseHeaders:a,isHttp:!0,rangeChunkSize:r,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=DN(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new EA(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:MN(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},FN=class extends SN{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r,withCredentials:i}=e._source,a=new Headers(e.headers);a.append(`Range`,`bytes=${t}-${n-1}`),AN(r,a,i,this._abortController).then(t=>{kN(TN(t.url),e._responseOrigin),jN(t.status,r),this._reader=t.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:MN(e),done:!1}}cancel(e){this._reader?.cancel(e),this._abortController.abort()}};function IN(e){return e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function LN(){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}var RN=class extends bN{_progressiveDone=!1;_queuedChunks=[];constructor(e){super(e,zN,BN);let{pdfDataRangeTransport:t}=e,{initialData:n,progressiveDone:r}=t;if(n?.length>0){let e=IN(n);this._queuedChunks.push(e)}this._progressiveDone=r,t.transportReady(e=>{switch(e.type){case`range`:case`progressiveRead`:this.#e(e.begin,e.chunk);break;case`progressiveDone`:this._fullReader?.progressiveDone(),this._progressiveDone=!0}})}#e(e,t){let n=IN(t);if(e===void 0)this._fullReader?this._fullReader._enqueue(n):this._queuedChunks.push(n);else{let t=this._rangeReaders.keys().find(t=>t._begin===e);mA(t,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),t._enqueue(n)}}getFullReader(){let e=super.getFullReader();return this._queuedChunks=null,e}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onDone=()=>this._rangeReaders.delete(n),this._source.pdfDataRangeTransport.requestDataRange(e,t)),n}cancelAllRequests(e){super.cancelAllRequests(e),this._source.pdfDataRangeTransport.abort()}},zN=class extends xN{#e=LN.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(e){super(e);let{pdfDataRangeTransport:t,disableRange:n,disableStream:r}=e._source,{length:i,contentDispositionFilename:a}=t;this._queuedChunks=e._queuedChunks||[];for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._done=e._progressiveDone,this._contentLength=i,this._isStreamingSupported=!r,this._isRangeSupported=!n,XA(a)&&(this._filename=a),this._headersCapability.resolve();let o=this._loaded;Promise.resolve().then(()=>{o>0&&this._loaded===o&&this._callOnProgress()})}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e()}progressiveDone(){this._done||=!0,this._queuedChunks.length===0&&this.#e()}},BN=class extends SN{#e=LN.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(e,t,n){super(e,t,n),this._begin=t}_enqueue(e){this._done||(this._requests.length===0?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this.#e()),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this.onDone?.()}},VN=200,HN=206;function UN(e){return typeof e==`string`?OA(e).buffer:e}var WN=class extends bN{#e=new WeakMap;_responseOrigin=null;constructor(e){super(e,GN,KN);let{httpHeaders:t,url:n}=e;this.url=n,this.isHttp=/https?:/.test(n.protocol),this.headers=wN(this.isHttp,t)}_request(e){let t=new XMLHttpRequest,n={validateStatus:null,onHeadersReceived:e.onHeadersReceived,onDone:e.onDone,onError:e.onError,onProgress:e.onProgress};this.#e.set(t,n),t.open(`GET`,this.url),t.withCredentials=this._source.withCredentials;for(let[e,n]of this.headers)t.setRequestHeader(e,n);return this.isHttp&&`begin`in e&&`end`in e?(t.setRequestHeader(`Range`,`bytes=${e.begin}-${e.end-1}`),n.validateStatus=e=>e===HN||e===VN):n.validateStatus=e=>e===VN,t.responseType=`arraybuffer`,mA(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>e.onError(t.status),t.onreadystatechange=this.#n.bind(this,t),t.onprogress=this.#t.b
423ind(this,t),t.send(null),t}#t(e,t){this.#e.get(e)?.onProgress?.(t)}#n(e,t){let n=this.#e.get(e);if(!n||(e.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),e.readyState!==4)||!this.#e.has(e))return;if(this.#e.delete(e),e.status===0&&this.isHttp){n.onError(e.status);return}let r=e.status||VN;if(!n.validateStatus(r)){n.onError(e.status);return}let i=UN(e.response);if(r===HN){let t=e.getResponseHeader(`Content-Range`);/bytes (\d+)-(\d+)\/(\d+)/.test(t)?n.onDone(i):(fA(`Missing or invalid "Content-Range" header.`),n.onError(0))}else i?n.onDone(i):n.onError(e.status)}_abortRequest(e){this.#e.has(e)&&(this.#e.delete(e),e.abort())}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onClosed=()=>this._rangeReaders.delete(n)),n}},GN=class extends xN{#e=LN.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(e){super(e),this._fullRequestXhr=e._request({onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:this.#i.bind(this)})}#t(){let e=this._stream,{disableRange:t,rangeChunkSize:n}=e._source,r=this._fullRequestXhr;e._responseOrigin=TN(r.responseURL);let i=r.getAllResponseHeaders(),a=new Headers(i?i.trimStart().replace(/[^\S ]+$/,``).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{contentLength:o,isRangeSupported:s}=EN({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:n,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=DN(a),this._isRangeSupported&&e._abortRequest(r),this._headersCapability.resolve()}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._cachedChunks.push(e),this._done=!0,this._cachedChunks.length===0&&this.#e()}#r(e){this._storedError=ON(e,this._stream.url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}#i(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e),this.#e(),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}},KN=class extends SN{#e=LN.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(e,t,n){super(e,t,n),this._requestXhr=e._request({begin:t,end:n,onHeadersReceived:this.#t.b
423ind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:null})}#t(){let e=TN(this._requestXhr?.responseURL);try{kN(e,this._stream._responseOrigin)}catch(e){this._storedError=e,this.#r(0)}}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0,this.#e(),this.onClosed?.()}#r(e){this._storedError??=ON(e,this._stream.url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}};function qN(e,t=null){let n=process.getBuiltinModule(`fs`),{Readable:r}=process.getBuiltinModule(`stream`),i=n.createReadStream(e,t);return r.toWeb(i)}var JN=class extends bN{constructor(e){super(e,YN,XN);let{url:t}=e;mA(t.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`)}},YN=class extends xN{_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i}=e._source;this._isStreamingSupported=!n,process.getBuiltinModule(`fs/promises`).lstat(i).then(e=>{let n=qN(i);this._reader=n.getReader();let{size:a}=e;this._contentLength=a,this._isRangeSupported=!t&&a>2*r,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new EA(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(e=>{e.code===`ENOENT`&&(e=ON(0,i)),this._headersCapability.reject(e)})}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:MN(e),done:!1})}cancel(e){this._reader?.cancel(e)}},XN=class extends SN{_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r}=e._source;try{let e=qN(r,{start:t,end:n-1});this._reader=e.getReader(),this._readCapability.resolve()}catch(e){this._readCapability.reject(e)}}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:MN(e),done:!1}}cancel(e){this._reader?.cancel(e)}};function ZN(e){return ej(e)?NN:Wk?JN:WN}var QN=class{static#e=null;static#t=``;static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<`u`&&e instanceof Worker)&&e!==null)throw Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!=`string`)throw Error("Invalid `workerSrc` type.");this.#t=e}},$N=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}},eP=Symbol(`INTERNAL`),tP=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&Yk.DISPLAY),this.#t=!!(e&Yk.PRINT),this.name=t,this.intent=n,this.usage=r,this.rbGroups=i}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!==`OFF`:!this.#t||e?.printState!==`OFF`}_setVisible(e,t,n=!1){e!==eP&&pA("Internal method `_setVisible` called."),this.#n=n,this.#r=t}},nP=class{#e=null;#t=new Map;#n=null;#r=null;constructor(e,t=Yk.DISPLAY){if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(let n of e.groups)this.#t.set(n.id,new tP(t,n));if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(eP,!1);for(let t of e.on)this.#t.get(t)._setVisible(eP,!0);for(let t of e.off)this.#t.get(t)._setVisible(eP,!1);this.#n=this.getHash()}}#i(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let r=1;r<t;r++){let t=e[r],i;if(Array.isArray(t))i=this.#i(t);else if(this.#t.has(t))i=this.#t.get(t).visible;else return fA(`Optional content group not found: ${t}`),!0;switch(n){case`And`:if(!i)return!1;break;case`Or`:if(i)return!0;break;case`Not`:return!i;default:return!0}}return n===`And`}isVisible(e){if(this.#t.size===0)return!0;
423if(!e)return dA(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(fA(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#i(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return fA(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOn`){for(let t of e.ids){if(!this.#t.has(t))return fA(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}if(e.policy===`AnyOff`){for(let t of e.ids){if(!this.#t.has(t))return fA(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOff`){for(let t of e.ids){if(!this.#t.has(t))return fA(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return fA(`Unknown optional content policy ${e.policy}.`),!0}return fA(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(!r){fA(`Optional content group not found: ${e}`);return}if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(eP,!1,!0);r._setVisible(eP,!!t,!0),this.#e=null}setOCGState({state:e,preserveRB:t}){let n;for(let r of e){switch(r){case`ON`:case`OFF`:case`Toggle`:n=r;continue}let e=this.#t.get(r);if(e)switch(n){case`ON`:this.setVisibility(r,!0,t);break;case`OFF`:this.setVisibility(r,!1,t);break;case`Toggle`:this.setVisibility(r,!e.visible,t)}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new Uj;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}},rP=class{#e=null;#t=null;#n=0;#r=null;#i=null;get pagesNumber(){return this.#n}set pagesNumber(e){this.#n!==e&&(this.#n=e,this.#e=null,this.#t=null)}#a(){if(this.#e)return;let e=this.#n,t=this.#e=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=n+1;this.#t=new Int32Array(t)}#o(){let e=new Map,t=this.#e;for(let n=0,r=this.#n;n<r;n++){let r=t[n],i=e.get(r);i?i.push(n+1):e.set(r,[n+1])}return e}movePages(e,t,n){this.#a();let r=this.#e,i=this.#o(),a=t.length,o=new Uint32Array(a),s=0;for(let e=0;e<a;e++){let i=t[e]-1;o[e]=r[i],i<n&&s++}let c=this.#n,l=c-a,u=VA(n-s,0,l);for(let t=0,n=0;t<c;t++)e.has(t+1)||(r[n++]=r[t]);r.copyWithin(u+a,u,l),r.set(o,u),this.#s(i),r.every((e,t)=>e===t+1)&&(this.#e=null)}deletePages(e){this.#a();let t=this.#e,n=this.#o();this.#i={pageNumberToId:t.slice(),pagesNumber:this.#n,prevPageNumbers:this.#t.slice()};let r=this.#n-e.length;this.#n=r;let i=this.#e=new Uint32Array(r);this.#t=new Int32Array(r);let a=0,o=0;for(let n of e){let e=n-1;e!==a&&(i.set(t.subarray(a,e),o),o+=e-a),a=e+1}a<t.length&&i.set(t.subarray(a),o),this.#s(n,new Set(e))}cancelDelete(){this.#i&&=(this.#e=this.#i.pageNumberToId,this.#n=this.#i.pagesNumber,this.#t=this.#i.prevPageNumbers,null)}cleanSavedData(){this.#i=null}copyPages(e){this.#a(),this.#r={pageNumbers:e,pageIds:e.map(e=>this.#e[e-1])}}cancelCopy(){this.#r=null}pastePages(e){this.#a();let t=this.#e,n=this.#o(),{pageNumbers:r,pageIds:i}=this.#r,a=this.#n+r.length;this.#n=a;let o=this.#e=new Uint32Array(a);this.#t=new Int32Array(a),o.set(t.subarray(0,e),0),o.set(i,e),o.set(t.subarray(e),e+r.length),this.#s(n,null,e,r),this.#r=null}#s(e,t=null,n=-1,r=null){let i=this.#t,a=this.#e,o=n+(r?.length??0),s=new Map;for(let c=0,l=this.#n;c<l;c++){if(c>=n&&c<o){i[c]=-r[c-n];continue}let l=a[c],u=e.get(l),d=s.get(l)||0;if(t&&u)for(;d<u.length&&t.has(u[d]);)d++;i[c]=u?.[d],s.set(l,d+1)}}hasBeenAltered(){return this.#e!==null}getPageMappingForSaving(e=null){e??=this.#o();let t=0;for(let n of e.values())t=Math.max(t,n.length);let n=Array(t);for(let e=0;e<t;e++)n[e]={document:null,pageIndices:[],includePages:[]};for(let[t,r]of e)for(let e=0,i=r.length;e<i;e++)n[e].includePages.push([t-1,r[e]-1]);for(let{includePages:e,pageIndices:t}of n){e.sort((e,t)=>
423e[0]-t[0]);for(let n=0,r=e.length;n<r;n++)t.push(e[n][1]),e[n]=e[n][0]}return n}extractPages(e){e=Array.from(e).sort((e,t)=>e-t);let t=new Map;for(let n=0,r=e.length;n<r;n++){let r=this.getPageId(e[n]);t.getOrInsertComputed(r,RA).push(n+1)}return this.getPageMappingForSaving(t)}getPrevPageNumber(e){return this.#t?.[e-1]??0}getPageNumber(e){if(!this.#e)return e;let t=this.#e;for(let n=0,r=this.#n;n<r;n++)if(t[n]===e)return n+1;return 0}getPageId(e){return this.#e?.[e-1]??e}getMapping(){return this.#e?.subarray(0,this.pagesNumber)}},iP=Symbol(`INITIAL_DATA`),aP=()=>({...Promise.withResolvers(),data:iP}),oP=class{#e=new Map;get(e,t=null){if(t){let n=this.#e.getOrInsertComputed(e,aP);return n.promise.then(()=>t(n.data)),null}let n=this.#e.get(e);if(!n||n.data===iP)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e.get(e);return!!t&&t.data!==iP}delete(e){let t=this.#e.get(e);return!t||t.data===iP?!1:(this.#e.delete(e),!0)}resolve(e,t=null){let n=this.#e.getOrInsertComputed(e,aP);if(n.data!==iP)throw Error(`Object already resolved ${e}.`);n.data=t,n.resolve()}clear(){for(let{data:e}of this.#e.values())e?.bitmap?.close();this.#e.clear()}*[Symbol.iterator](){for(let[e,{data:t}]of this.#e)t!==iP&&(yield[e,t])}},sP=1e5,cP=30,lP=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=null;#s=0;#c=0;#l=null;#u=null;#d=0;#f=0;#p=Object.create(null);#m=[];#h=null;#g=[];#_=new WeakMap;#v=null;static#y=new Map;static#b=new Map;static#x=new WeakMap;static#S=null;static#C=new Set;constructor({textContentSource:t,images:n,container:r,viewport:i}){if(t instanceof ReadableStream)this.#h=t;else if(typeof t==`object`)this.#h=new ReadableStream({start(e){e.enqueue(t),e.close()}});else throw Error(`No "textContentSource" parameter specified.`);this.#t=this.#u=r,this.#i=n,this.#f=i.scale*fj.pixelRatio,this.#d=i.rotation,this.#o={div:null,properties:null,ctx:null};let{pageWidth:a,pageHeight:o,pageX:s,pageY:c}=i.rawDims;this.#v=[1,0,0,-1,-s,c+o],this.#c=a,this.#s=o,e.#k(),r.style.setProperty(`--min-font-size`,e.#S),dj(r,i),this.#e.promise.finally(()=>{e.#C.delete(this),this.#o=null,this.#p=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=AA.platform;return yA(this,`fontFamilyMap`,new Map([[`sans-serif`,`${e&&t?`Calibri, `:``}sans-serif`],[`monospace`,`${e&&t?`Lucida Console, `:``}monospace`]]))}render(){this.#i&&this.#t.append(this.#i.render());let t=()=>{this.#l.read().then(({value:e,done:n})=>{if(n){this.#e.resolve();return}this.#a??=e.lang,Object.assign(this.#p,e.styles),this.#w(e.items),t()},this.#e.reject)};return this.#l=this.#h.getReader(),e.#C.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*fj.pixelRatio,i=t.rotation;if(i!==this.#d&&(n?.(),this.#d=i,dj(this.#u,{rotation:i})),r!==this.#f){n?.(),this.#f=r;let t={div:null,properties:null,ctx:e.#D(this.#a)};for(let e of this.#g)t.properties=this.#_.get(e),t.div=e,this.#E(t)}}cancel(){let e=new EA(`TextLayer task cancelled.`);this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#g}get textContentItemsStr(){return this.#m}#w(t){if(this.#n)return;this.#o.ctx??=e.#D(this.#a);let n=this.#g,r=this.#m;for(let e of t){if(n.length>sP){fA(`Ignoring additional textDivs for performance reasons.`),this.#n=!0;return}if(e.str===void 0){if(e.type===`beginMarkedContentProps`||e.type===`beginMarkedContent`){let t=this.#t;this.#t=document.createElement(`span`),this.#t.classList.add(`markedContent`),e.id&&this.#t.setAttribute(`id`,`${e.id}`),e.tag===`Artifact`&&(this.#t.ariaHidden=!0),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode);continue}r.push(e.str),this.#T(e)}}#T(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#g.push(n);let i=Q.transform(this.#v,t.transform),a=Math.atan2(i[1],i[0]),o=this.#p[t.fontName];o.vertical&&(a+=Math.PI/2);let s=this.#r&&o.fontSubstitution||o.fontFamily;s=e.fontFamilyMap.get(s)||s;let c=Math.hypot(i[2],i[3]),l=c*e.#A(s,o,this.#a),u,d;a===0?(u=i[4],d=i[5]-l):(u=i[4]+l*Math.sin(a),d=i[5]-l*Math.cos(a));let f=n.style;f.left=`${(100*u/this.#c).toFixed(2)}%`,f.top=`${(100*d/this.#s).toFixed(2)}%`,f.setProperty(`--font-height`,`${c.toFixed(2)}px`),f.fontFamily=s,r.fontSize=c,n.setAttribute(`role`,`presentation`),n.textContent=t.str,n.dir=t.dir,this.#r&&(n.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),a!==0&&(r.angle=180/Math.PI*a);let p=!1;if(t.str.length>1)p=!0;else if(t.str!==` `&&t.transform[0]!==t.transform[3]){let e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(p=!0)}if(p&&(r.canvasWidth=o.vertical?t.height:t.width),this.#_.set(n,r),this.#o.div=n,this.#o.properties=r,this.#
423E(this.#o),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#E(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n;if(r.canvasWidth!==0&&r.hasText){let{fontFamily:t}=a,{canvasWidth:o,fontSize:s}=r;e.#O(i,s*this.#f,t);let{width:c}=i.measureText(n.textContent);c>0&&a.setProperty(`--scale-x`,o*this.#f/c)}r.angle!==0&&a.setProperty(`--rotate`,`${r.angle}deg`)}static cleanup(){if(!(this.#C.size>0)){this.#y.clear();for(let{canvas:e}of this.#b.values())e.remove();this.#b.clear()}}static#D(e=null){let t=this.#b.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.className=`hiddenCanvasElement`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#b.set(e,t),this.#x.set(t,{size:0,family:``})}return t}static#O(e,t,n){let r=this.#x.get(e);(t!==r.size||n!==r.family)&&(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#k(){if(this.#S!==null)return;let e=document.createElement(`div`);e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize=`1px`,e.style.position=`absolute`,e.textContent=`X`,document.body.append(e),this.#S=e.getBoundingClientRect().height,e.remove()}static#A(e,t,n){let r=this.#y.get(e);if(r)return r;let i=this.#D(n);i.canvas.width=i.canvas.height=cP,this.#O(i,cP,e);let a=i.measureText(``),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let c=.8;return o?c=o/(o+s):(AA.platform.isFirefox&&fA("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),this.#y.set(e,c),c}},uP=100;function dP(e={}){typeof e==`string`||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t=new fP,{docId:n}=t,r=e.url?gM(e.url):null,i=e.data?_M(e.data):null,a=e.httpHeaders||null,o=e.withCredentials===!0,s=e.password??null,c=e.range instanceof pP?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:2**16,u=e.worker instanceof gP?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl==`string`&&!YA(e.docBaseUrl)?e.docBaseUrl:null,p=vM(e.cMapUrl),m=e.cMapPacked!==!1,h=vM(e.iccUrl),g=vM(e.standardFontDataUrl),_=vM(e.wasmUrl),v=e.stopAtErrors!==!0,y=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,b=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!Wk,x=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!Wk&&(AA.platform.isFirefox||!globalThis.chrome),S=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,C=typeof e.disableFontFace==`boolean`?e.disableFontFace:Wk,w=e.fontExtraProperties===!0,T=e.enableXfa===!0,E=e.ownerDocument||globalThis.document,D=e.disableRange===!0,O=e.disableStream===!0,k=e.disableAutoFetch===!0,A=e.pdfBug===!0,j=e.CanvasFactory||(Wk?FM:AM),M=e.FilterFactory||(Wk?PM:MM),N=e.BinaryDataFactory||(Wk?IM:OM),P=e.enableHWA===!0,ee=e.enableWebGPU===!0?zM():Promise.resolve(!1),te=e.useWasm!==!1,ne=e.pagesMapper||new rP,F=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!Wk&&!C,re=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:!!(N===OM&&p&&m&&g&&_&&ej(p,document.baseURI)&&ej(g,document.baseURI)&&ej(_,document.baseURI));lA(d);let ie={canvasFactory:new j({ownerDocument:E,enableHWA:P}),filterFactory:new M({docId:n,ownerDocument:E}),binaryDataFactory:re?null:new N({cMapUrl:p,standardFontDataUrl:g,wasmUrl:_})};u||(u=gP.create({verbosity:d,port:QN.workerPort}),t._worker=u);let I={docId:n,apiVersion:`5.7.284`,data:i,password:s,disableAutoFetch:k,rangeChunkSize:l,docBaseUrl:f,enableXfa:T,evaluatorOptions:{maxImageSize:y,disableFontFace:C,ignoreErrors:v,isOffscreenCanvasSupported:b,isImageDecoderSupported:x,canvasMaxAreaInBytes:S,fontExtraProperties:w,useSystemFonts:F,useWasm:te,useWorkerFetch:re,cMapUrl:p,cMapPacked:m,iccUrl:h,standardFontDataUrl:g,wasmUrl:_,hasGPU:!1}},ae={ownerDocument:E,pdfBug:A,styleElement:null,enableHWA:P,loadingParams:{disableAutoFetch:k,enableXfa:T}};return Promise.all([u.promise,ee]).then(function([,e]){if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);I.evaluatorOptions.hasGPU=e;
423let s=u.messageHandler.sendWithPromise(`GetDocRequest`,I,i?[i.buffer]:null),d;if(!i)if(c)d=new RN({pdfDataRangeTransport:c,disableRange:D,disableStream:O});else if(r)d=new(ZN(r))({url:r,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:D,disableStream:O});else throw Error("getDocument - expected either `data`, `range`, or `url` parameter.");return s.then(e=>{if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let r=new EM(n,e,u.port),i=new _P(r,t,d,ae,ie,ne);t._transport=i,r.send(`Ready`,null)})}).catch(t._capability.reject),t}var fP=class e{static#e=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${e.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},pP=class{#e=Promise.withResolvers();#t=null;constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,Object.defineProperty(this,"onDataProgress",{value:()=>{rj("`PDFDataRangeTransport.prototype.onDataProgress` - method was removed, since loading progress is now reported automatically through the `PDFDataTransportStream` class (and related code).")}})}onDataRange(e,t){this.#t({type:`range`,begin:e,chunk:t})}onDataProgressiveRead(e){this.#e.promise.then(()=>{this.#t({type:`progressiveRead`,chunk:e})})}onDataProgressiveDone(){this.#e.promise.then(()=>{this.#t({type:`progressiveDone`})})}transportReady(e){this.#t=e,this.#e.resolve()}requestDataRange(e,t){pA(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},mP=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return yA(this,`isPureXfa`,!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}
423getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getRawData(e){return this._transport.getRawData(e)}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},hP=class e{#e=!1;#t=null;constructor(e,t,n,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new $A:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new oP,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,this.#t=r,this.imageCoordinates=null}clone(t){let n=new e(t,this._pageInfo,this._transport,this.#t,this._pdfBug);return n.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(n),n}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1,this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new qA({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return yA(this,`isPureXfa`,!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:r=`display`,annotationMode:i=Xk.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:c=null,pageColors:l=null,printAnnotationStorage:u=null,isEditing:d=!1,recordImages:f=!1,recordOperations:p=!1,operationsFilter:m=null}){this._stats?.time(`Overall`);let h=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:g,cacheKey:_}=h;this.#e=!1,s||=this._transport.getOptionalContentConfig(g);let v=this._intentStates.getOrInsertComputed(_,BA);v.streamReaderCancelTimeout&&=(clearTimeout(v.streamReaderCancelTimeout),null);let y=!!(g&Yk.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(h));let b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),x=!!t&&!this.recordedBBoxes&&(p||b),S=!!t&&!this.imageCoordinates&&f,C=e=>{if(v.renderTasks.delete(E),x){let e=E.gfx?.dependencyTracker.take();e&&(E.stepper?.setOperatorBBoxes(e,E.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=e))}S&&!e&&(this.imageCoordinates=E.gfx?.imagesTracker.take()),y&&(this.#e=!0),this.#n(),e?(E.capability.reject(e),this._abortOperatorList({intentState:v,reason:e instanceof Error?e:Error(e)})):E.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)
423)},w=null,T=null;(x||S)&&(T=new eM(t,v.operatorList.length)),x&&(w=new tM(T,b));let E=new yP({callback:C,params:{canvas:t,canvasContext:e,dependencyTracker:w??T,imagesTracker:S?new iM(t):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA,operationsFilter:m});(v.renderTasks||=new Set).add(E);let D=E.task;return Promise.all([v.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed){C();return}if(this._stats?.time(`Rendering`),!(t.renderingIntent&g))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");E.initializeGraphics({transparency:e,optionalContentConfig:t}),E.operatorListChanged()}).catch(C),D}getOperatorList({intent:e=`display`,annotationMode:t=Xk.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(s))}let a=this._transport.getRenderingIntent(e,t,n,r,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,BA),s;return o.opListReadCapability||(s=Object.create(null),s.operatorListChanged=i,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(s),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(e){return e.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>HA.textContent(e));let t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(let e of t)n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items);return n}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:Error(`Page was destroyed.`),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;let t=this.#n();return e&&t&&(this._stats&&=new $A),t}#n(){if(!this.#e||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd(`Page Request`),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n<r;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#n()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},void 0,a).getReader(),s=this._intentStates.get(t);s.streamReader=o;let c=()=>{o.read().then(({value:e,done:t})=>{if(t){s.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(e,s),c())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(let e of s.renderTasks)e.operatorListChanged();this.#n()}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else if(s.opListReadCapability)s.opListReadCapability.reject(e);else throw e}})};c()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&=(clearTimeout(e.streamReaderCancelTimeout),null),!n){if(e.renderTasks.size>0)return;if(t instanceof JA){let n=uP;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new EA(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}},gP=class e{#e=Promise.withResolvers();#t=null;#n=null;#r=null;static#i=0;static#a=!1;static#o=new WeakMap;static{Wk&&(this.#a=!0,QN.workerSrc||=`./pdf.worker.mjs`),this._isSameOrigin=(e,t)=>{let n=URL.parse(e);if(!n?.origin||n.origin===`null`)return!1;let r=new URL(t,n);return n.origin===r.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:`text/javascript`}))}}constructor({name:t=null,port:n=null,verbosity:r=uA()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=r,n){if(e.#o.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);e.#o.set(n,this),this.#c(n)}else this.#l()}get promise(){return this.#e.promise}#s(){this.#e.resolve(),this.#t.send(`configure`,{verbosity:this.verbosity})}get port(){return this.#n}get messageHandler(){return this.#t}#c(e){this.#n=e,this.#t=new EM(`main`,`worker`,e),this.#t.on(`ready`,()=>{}),this.#s()}#l(){if(e.#a||e.#d){this.#u();return}let{workerSrc:t}=e;
423try{e._isSameOrigin(window.location,t)||(t=e._createCDNWrapper(new URL(t,window.location).href));let n=new Worker(t,{type:`module`}),r=new EM(`main`,`worker`,n),i=()=>{a.abort(),r.destroy(),n.terminate(),this.destroyed?this.#e.reject(Error(`Worker was destroyed`)):this.#u()},a=new AbortController;n.addEventListener(`error`,()=>{this.#r||i()},{signal:a.signal}),r.on(`test`,e=>{if(a.abort(),this.destroyed||!e){i();return}this.#t=r,this.#n=n,this.#r=n,this.#s()}),r.on(`ready`,e=>{if(a.abort(),this.destroyed){i();return}try{o()}catch{this.#u()}});let o=()=>{let e=new Uint8Array;r.send(`test`,e,[e.buffer])};o();return}catch{dA(`The worker has been disabled.`)}this.#u()}#u(){e.#a||=(fA(`Setting up fake worker.`),!0),e._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this.#e.reject(Error(`Worker was destroyed`));return}let n=new xM;this.#n=n;let r=`fake${e.#i++}`,i=new EM(r+`_worker`,r,n);t.setup(i,n),this.#t=new EM(r,r+`_worker`,n),this.#s()}).catch(e=>{this.#e.reject(Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#r?.terminate(),this.#r=null,e.#o.delete(this.#n),this.#n=null,this.#t?.destroy(),this.#t=null}static create(t){let n=this.#o.get(t?.port);
423if(n){if(n._pendingDestroy)throw Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new e(t)}static get workerSrc(){if(QN.workerSrc)return QN.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return yA(this,`_setupFakeWorkerGlobal`,(async()=>this.#d?this.#d:(await Vk(()=>import(this.workerSrc),void 0)).WorkerMessageHandler)())}},_P=class{downloadInfoCapability=Promise.withResolvers();#e=null;#t=new Map;#n=null;#r=new Map;#i=new Map;#a=new Map;#o=null;constructor(e,t,n,r,i,a){this.messageHandler=e,this.loadingTask=t,this.#n=n,this.commonObjs=new oP,this.fontLoader=new aM({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.enableHWA=r.enableHWA,this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.binaryDataFactory=i.binaryDataFactory,this.pagesMapper=a,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(e){let{_pageIndex:t}=e;this.#r.set(t,e),this.#i.set(t,Promise.resolve(e))}#s(e,t=null){return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))}#c({loaded:e,total:t}){this.loadingTask.onProgress?.({loaded:e,total:t,percent:t?VA(Math.round(e/t*100),0,100):NaN})}get annotationStorage(){return yA(this,`annotationStorage`,new Gj)}getRenderingIntent(e,t=Xk.ENABLE,n=null,r=!1,i=!1){let a=Yk.DISPLAY,o=Wj;switch(e){case`any`:a=Yk.ANY;break;case`display`:break;case`print`:a=Yk.PRINT;break;default:fA(`getRenderingIntent - invalid intent: ${e}`)}let s=a&Yk.PRINT&&n instanceof Kj?n:this.annotationStorage;switch(t){case Xk.DISABLE:a+=Yk.ANNOTATIONS_DISABLE;break;case Xk.ENABLE:break;case Xk.ENABLE_FORMS:a+=Yk.ANNOTATIONS_FORMS;break;case Xk.ENABLE_STORAGE:a+=Yk.ANNOTATIONS_STORAGE,o=s.serializable;break;default:fA(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=Yk.IS_EDITING),i&&(a+=Yk.OPLIST);let{ids:c,hash:l}=s.modifiedIds,u=[a,o.hash,l];return{renderingIntent:a,cacheKey:u.join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#r.values())e.push(t._destroy());this.#r.clear(),this.#i.clear(),this.#a.clear(),Object.hasOwn(this,`annotationStorage`)&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise(`Terminate`,null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),lP.cleanup(),this.#n?.cancelAllRequests(new EA(`Worker was terminated.`)),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on(`GetReader`,(e,t)=>{mA(this.#n,"GetReader - no `BasePDFStream` instance available."),this.#e=this.#n.getFullReader(),this.#e.onProgress=e=>this.#c(e),t.onPull=()=>{this.#e.read().then(function({value:e,done:n}){if(n){t.close();return}mA(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e])}).catch(e=>{t.error(e)})},t.onCancel=e=>{this.#e.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this.#e.headersReady;let{isStreamingSupported:t,isRangeSupported:n,contentLength:r}=this.#e;return t&&n&&(this.#e.onProgress=null),{isStreamingSupported:t,isRangeSupported:n,contentLength:r}}),e.on(`GetRangeReader`,(e,t)=>{mA(this.#n,"GetRangeReader - no `BasePDFStream` instance available.");let n=this.#n.getRangeReader(e.begin,e.end);if(!n){t.close();return}t.onPull=()=>{n.read().then(function({value:e,done:n}){if(n){t.close();return}mA(e instanceof ArrayBuffer,`GetRangeReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e])}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`GetDoc`,({pdfInfo:e})=>{this.pagesMapper.pagesNumber=e.numPages,this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new mP(e,this))}),e.on(`DocException`,e=>{t._capability.reject(TM(e))}),e.on(`PasswordRequest`,e=>{this.#o=Promise.withResolvers();try{if(!t.onPassword)throw TM(e);t.onPassword(e=>{e instanceof Error?this.#o.reject(e):this.#o.resolve({password:e})},e.code)}catch(e){this.#o.reject(e)}return this.#o.promise}),e.on(`DataLoaded`,e=>{this.#c({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#r.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on(`commonobj`,([t,n,r])=>
423{if(this.destroyed||this.commonObjs.has(t))return null;switch(n){case`Font`:if(`error`in r){let e=r.error;fA(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let i=new oM(new pM(r),this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,r.charProcOperatorList,r.extra);this.fontLoader.bind(i).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{i.fontExtraProperties||i.clearData(),this.commonObjs.resolve(t,i)});break;case`CopyLocalImage`:let{imageRef:a}=r;mA(a,`The imageRef must be defined.`);for(let e of this.#r.values())for(let[,n]of e.objs){if(n?.ref!==a)continue;if(!n.dataLen)return null;let e=structuredClone(n);return this.commonObjs.resolve(t,e),n.dataLen}break;case`FontPath`:this.commonObjs.resolve(t,new hM(r));break;case`Image`:this.commonObjs.resolve(t,r);break;case`Pattern`:let o=new mM(r);this.commonObjs.resolve(t,o.getIR());break;default:throw Error(`Got unknown common object type ${n}`)}return null}),e.on(`obj`,([e,t,n,r])=>{if(this.destroyed)return;let i=this.#r.get(t);if(!i.objs.has(e)){if(i._intentStates.size===0){r?.bitmap?.close();return}switch(n){case`Image`:case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}}}),e.on(`DocProgress`,e=>{this.destroyed||this.#c(e)}),e.on(`FetchBinaryData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);if(!this.binaryDataFactory)throw Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(){this.annotationStorage.size<=0&&fA("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this.#e?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){let t={pageInfos:e},n;if(this.annotationStorage.size>0){let{map:e,transfer:r}=this.annotationStorage.serializable;t.annotationStorage=e,n=r}return this.messageHandler.sendWithPromise(`ExtractPages`,t,n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.pagesMapper.getPageId(e)-1,r=this.#i.get(t);if(r)return r;let i=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:n}).then(e=>{if(this.destroyed)throw Error(`Transport destroyed`);e.refStr&&this.#a.set(e.refStr,n);let r=new hP(t,e,this,this.pagesMapper,this._params.pdfBug);return this.#r.set(t,r),r});return this.#i.set(t,i),i}async getPageIndex(e){if(!yM(e))throw Error(`Invalid pageIndex request.`);let t=await this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw Error(`GetPageIndex: page has been removed.`);return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return this.#s(`GetFieldObjects`)}hasJSActions(){return this.#s(`HasJSActions`)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise(`GetCalculationOrderIds`,null)}getDestinations(){return this.messageHandler.sendWithPromise(`GetDestinations`,null)}getDestination(e){return typeof e==`string`?this.messageHandler.sendWithPromise(`GetDestination`,{id:e}):Promise.reject(Error(`Invalid destination request.`))}getPageLabels(){return this.messageHandler.sendWithPromise(`GetPageLabels`,null)}getPageLayout(){return this.messageHandler.sendWithPromise(`GetPageLayout`,null)}getPageMode(){return this.messageHandler.sendWithPromise(`GetPageMode`,null)}getViewerPreferences(){return this.messageHandler.sendWithPromise(`GetViewerPreferences`,null)}getOpenAction(){return this.messageHandler.sendWithPromise(`GetOpenAction`,null)}
423getAttachments(){return this.messageHandler.sendWithPromise(`GetAttachments`,null)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise(`GetAnnotationsByType`,{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#s(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#s(`GetOptionalContentConfig`).then(t=>new nP(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`;return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new $N(e[1]):null,contentDispositionFilename:this.#e?.filename??null,contentLength:this.#e?.contentLength??null,hasStructTree:e[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise(`GetMarkInfo`,null)}getRawData(e){return this.messageHandler.sendWithPromise(`GetRawData`,e)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise(`Cleanup`,null);for(let e of this.#r.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),lP.cleanup()}}cachedPageNumber(e){if(!yM(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=this.#a.get(t);if(n>=0){let e=this.pagesMapper.getPageNumber(n+1);if(e!==0)return e}return null}},vP=class{_internalRenderTask=null;onContinue=null;onError=null;constructor(e){this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&t?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}},yP=class e{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:s,filterFactory:c,useRequestAnimationFrame:l=!1,pdfBug:u=!1,pageColors:d=null,enableHWA:f=!1,operationsFilter:p=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=s,this.filterFactory=c,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=l===!0&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new vP(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._imagesTracker=t.imagesTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(e.#t.has(this._canvas))throw Error(`Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.`);e.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{viewport:r,transform:i,background:a,dependencyTracker:o,imagesTracker:s}=this.params,c=this._canvasContext||this._canvas.getContext(`2d`,{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new yN(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,o,s),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&=(window.cancelAnimationFrame(this.#e),null),e.#t.delete(this._canvas),t||=new JA(`Rendering cancelled, page ${this._pageIndex+1}`,n),this.callback(t),this.task.onError?.(t)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}
423):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),e.#t.delete(this._canvas),this.callback())))}},bP=`5.7.284`,xP=`7e5b36c2d`,SP=class e{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#o=null;#s;#c=null;#l=null;static#u=null;static get _keyboardManager(){return yA(this,`_keyboardManager`,new Mj([[[`Escape`,`mac+Escape`],e.prototype._hideDropdownFromKeyboard],[[` `,`mac+ `],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`,`mac+ArrowDown`,`mac+ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`,`mac+ArrowUp`,`mac+ArrowLeft`],e.prototype._moveToPrevious],[[`Home`,`mac+Home`],e.prototype._moveToBeginning],[[`End`,`mac+End`],e.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:n=null}){t?(this.#a=!1,this.#o=t):this.#a=!0,this.#l=t?._uiManager||n,this.#s=this.#l._eventBus,this.#n=t?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||`#FFFF98`,e.#u||=Object.freeze({blue:`pdfjs-editor-colorpicker-blue`,green:`pdfjs-editor-colorpicker-green`,pink:`pdfjs-editor-colorpicker-pink`,red:`pdfjs-editor-colorpicker-red`,yellow:`pdfjs-editor-colorpicker-yellow`})}renderButton(){let e=this.#e=document.createElement(`button`);e.className=`colorPicker`,e.tabIndex=`0`,e.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-button`),e.ariaHasPopup=`true`,this.#o&&(e.ariaControls=`${this.#o.id}_colorpicker_dropdown`);let t=this.#l._signal;e.addEventListener(`click`,this.#m.bind(this),{signal:t}),e.addEventListener(`keydown`,this.#p.bind(this),{signal:t});let n=this.#t=document.createElement(`span`);return n.className=`swatch`,n.ariaHidden=`true`,n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){let e=this.#r=this.#d();return e.ariaOrientation=`horizontal`,e.ariaLabelledBy=`highlightColorPickerLabel`,e}#d(){let t=document.createElement(`div`),n=this.#l._signal;t.addEventListener(`contextmenu`,tj,{signal:n}),t.className=`dropdown`,t.role=`listbox`,t.ariaMultiSelectable=`false`,t.ariaOrientation=`vertical`,t.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-dropdown`),this.#o&&(t.id=`${this.#o.id}_colorpicker_dropdown`);for(let[r,i]of this.#l.highlightColors){let a=document.createElement(`button`);a.tabIndex=`0`,a.role=`option`,a.setAttribute(`data-color`,i),a.title=r,a.setAttribute(`data-l10n-id`,e.#u[r]);let o=document.createElement(`span`);a.append(o),o.className=`swatch`,o.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener(`click`,this.#f.bind(this,i),{signal:n}),t.append(a)}return t.addEventListener(`keydown`,this.#p.bind(this),{signal:n}),t}#f(e,t){t.stopPropagation(),this.#s.dispatch(`switchannotationeditorparams`,{source:this,type:Qk.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#m(e);return}let t=e.target.getAttribute(`data-color`);t&&this.#f(t,e)}_moveToNext(e){if(!this.#g){this.#m(e);return}if(e.target===this.#e){this.#r.firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#r?.firstElementChild||e.target===this.#e){this.#g&&this._hideDropdownFromKeyboard();return}this.#g||this.#m(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#g){this.#m(e);return}this.#r.firstElementChild?.focus()}_moveToEnd(e){if(!this.#g){this.#m(e);return}this.#r.lastElementChild?.focus()}#p(t){e._keyboardManager.exec(this,t)}#m(e){if(this.#g){this.hideDropdown();return}if(this.#i=e.detail===0,this.#c||(this.#c=new AbortController,window.addEventListener(`pointerdown`,this.#h.bind(this),{signal:this.#l.combinedSignal(this.#c)})),this.#e.ariaExpanded=`true`,this.#r){this.#r.classList.remove(`hidden`);return}let t=this.#r=this.#d();this.#e.append(t)}#h(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add(`hidden`),this.#e.ariaExpanded=`false`,this.#c?.abort(),this.#c=null}get#g(){return this.#r&&!this.#r.classList.contains(`hidden`)}_hideDropdownFromKeyboard(){if(!this.#a){if(!this.#g){this.#o?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;let t=this.#l.highlightColors.values();for(let n of this.#r.children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}},CP=class e{#e=null;#t=!1;#n=null;#r=null;static#i=null;constructor(t){this.#n=t,this.#r=t._uiManager,e.#i||=Object.freeze({freetext:`pdfjs-editor-color-picker-free-text-input`,ink:`pdfjs-editor-color-picker-ink-input`})}renderButton(){if(this.#e)return this.#e;let{editorType:t,colorType:n,colorAndOpacityType:r,opacityType:i,color:a,opacity:o}=this.#n,s=this.#t=AA.isAlphaColorInputSupported&&i!==void 0,c=this.#e=document.createElement(`input`);if(c.type=`color`,s){c.setAttribute(`alpha`,``);let e=Q.hexNums[Math.round((o??1)*255)];c.value=(a||`#000000`)+e}else c.value=a||`#000000`;return c.className=`basicColorPicker`,c.tabIndex=0,c.setAttribute(`data-l10n-id`,e.#i[t]),c.addEventListener(`input`,()=>{if(s){let e=oj(c.value);if(!e)return;let[t,a,o,s]=e,l=Q.makeHexColor(t,a,o);r===void 0?(this.#r.updateParams(n,l),this.#r.updateParams(i,s)):this.#r.updateParams(r,{color:l,opacity:s})}else this.#r.updateParams(n,c.value)},{signal:this.#r._signal}),c}update(e){if(this.#e)if(this.#t){let t=Q.hexNums[Math.round(this.#n.opacity*255)];this.#e.value=e+t}else this.#e.value=e}updateOpacity(e){if(!this.#e||!this.#t)return;let t=Q.hexNums[Math.round(e*255)];this.#e.value=this.#n.color+t}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}};function wP(e){return Math.floor(VA(e,0,1)*255).toString(16).padStart(2,`0`)}function TP(e){return VA(e,0,1)*255}var EP=class{static CMYK_G([e,t,n,r]){return[`G`,1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return[`CMYK`,0,0,0,1-e]}static G_RGB([e]){return[`RGB`,e,e,e]}static G_rgb([e]){return e=TP(e),[e,e,e]}static G_HTML([e]){let t=wP(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return[`G`,.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(TP)}static RGB_HTML(e){return`#${e.map(wP).join(``)}`}static T_HTML(){return`#00000000`}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,r]){return[`RGB`,1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,n,r]){return[TP(1-Math.min(1,e+r)),TP(1-Math.min(1,n+r)),TP(1-Math.min(1,t+r))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let r=1-e,i=1-t,a=1-n;return[`CMYK`,r,i,a,Math.min(r,i,a)]}},DP=class{create(e,t,n=!1){if(e<=0||t<=0)throw Error(`Invalid SVG dimensions`);let r=this._createSVG(`svg:svg`);return r.setAttribute(`version`,`1.1`),n||(r.setAttribute(`width`,`${e}px`),r.setAttribute(`height`,`${t}px`)),r.setAttribute(`preserveAspectRatio`,`none`),r.setAttribute(`viewBox`,`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!=`string`)throw Error(`Invalid SVG element type`);return this._createSVG(e)}_createSVG(e){pA("Abstract method `_createSVG` called.")}},OP=class extends DP{_createSVG(e){return document.createElementNS(WA,e)}},kP=9,AP=new WeakSet,jP=new Date().getTimezoneOffset()*60*1e3,MP=class{static create(e){switch(e.data.annotationType){case nA.LINK:return new FP(e);case nA.TEXT:return new IP(e);case nA.WIDGET:switch(e.data.fieldType){case`Tx`:return new RP(e);case`Btn`:return e.data.radioButton?new VP(e):e.data.checkBox?new BP(e):new HP(e);case`Ch`:return new UP(e);case`Sig`:return new zP(e)}return new LP(e);case nA.POPUP:return new WP(e);case nA.FREETEXT:return new KP(e);case nA.LINE:return new qP(e);case nA.SQUARE:return new JP(e);case nA.CIRCLE:return new YP(e);case nA.POLYLINE:return new XP(e);case nA.CARET:return new QP(e);case nA.INK:return new $P(e);case nA.POLYGON:return new ZP(e);case nA.HIGHLIGHT:return new eF(e);case nA.UNDERLINE:return new tF(e);case nA.SQUIGGLY:return new nF(e);case nA.STRIKEOUT:return new rF(e);case nA.STAMP:return new iF(e);case nA.FILEATTACHMENT:return new aF(e);default:return new NP(e)}}},NP=class e{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return e._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}
423get commentButtonPosition(){let e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;let{quadPoints:t,inkLists:n,rect:r}=this.data,i=-1/0,a=-1/0;if(t?.length>=8){for(let e=0;e<t.length;e+=8)t[e+1]>a?(a=t[e+1],i=t[e+2]):t[e+1]===a&&(i=Math.max(i,t[e+2]));return[i,a]}if(n?.length>=1){for(let e of n)for(let t=0,n=e.length;t<n;t+=2)e[t+1]>a?(a=e[t+1],i=e[t]):e[t+1]===a&&(i=Math.max(i,e[t]));if(i!==1/0)return[i,a]}return r?[r[2],r[3]]:null}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-i)/n,e[1]=100*(e[1]-a)/r,e}get commentText(){let{data:e}=this;return this.annotationStorage.getRawValue(`${Zk}${e.id}`)?.popup?.contents||e.contentsObj?.str||``}set commentText(e){let{data:t}=this,n={deleted:!e,contents:e||``};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${Zk}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});let{rect:t,popup:n}=e;t&&this.#r(t);let r=this.#n?.popup||this.popup;!r&&n?.text&&(this._createPopup(n),r=this.#n.popup),r&&(r.updateEdited(e),n?.deleted&&(r.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#e&&=(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),null)}#r(e){let{container:{style:t},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:s}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-o)/i}%`,t.top=`${100*(a-e[3]+s)/a}%`,r===0?(t.width=`${100*(e[2]-e[0])/i}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(r)}_createContainer(e){let{data:t,parent:{page:n,viewport:r}}=this,i=document.createElement(`section`);i.setAttribute(`data-annotation-id`,t.id),!(this instanceof LP)&&!(this instanceof FP)&&(i.tabIndex=0);let{style:a}=i;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add(`norotate`),!t.rect||this instanceof WP){let{rotation:e}=t;return!t.hasOwnCanvas&&e!==0&&this.setRotation(e,i),i}let{width:o,height:s}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;let e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;switch(e>0||n>0?a.borderRadius=`calc(${e}px * var(--total-scale-factor)) / calc(${n}px * var(--total-scale-factor))`:this instanceof VP&&(a.borderRadius=`calc(${o}px * var(--total-scale-factor)) / calc(${s}px * var(--total-scale-factor))`),t.borderStyle.style){case rA.SOLID:a.borderStyle=`solid`;break;case rA.DASHED:a.borderStyle=`dashed`;break;case rA.BEVELED:fA(`Unimplemented border style: beveled`);break;case rA.INSET:fA(`Unimplemented border style: inset`);break;case rA.UNDERLINE:a.borderBottomStyle=`solid`}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=Q.makeHexColor(...r)):a.borderWidth=0}let c=Q.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:l,pageHeight:u,pageX:d,pageY:f}=r.rawDims;a.left=`${100*(c[0]-d)/l}%`,a.top=`${100*(c[1]-f)/u}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(a.width=`${100*o/l}%`,a.height=`${100*s/u}%`):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:i,height:a}=this;e%180!=0&&([i,a]=[a,i]),t.style.width=`${100*i/n}%`,t.style.height=`${100*a/r}%`,t.setAttribute(`data-main-rotation`,(360-e)%360)}get _commonActions(){let e=(e,t,n)=>{let r=n.detail[e],i=r[0],a=r.slice(1);n.target.style[t]=EP[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:EP[`${i}_rgb`](a)})};return yA(this,`_commonActions`,{display:e=>{let{display:t}=e.detail,n=t%2==1;this.container.style.visibility=n?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:t===1||t===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:t}=e.detail;this.container.style.visibility=t?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>
423e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e(`bgColor`,`backgroundColor`,t)},fillColor:t=>{e(`fillColor`,`backgroundColor`,t)},fgColor:t=>{e(`fgColor`,`color`,t)},textColor:t=>{e(`textColor`,`color`,t)},borderColor:t=>{e(`borderColor`,`borderColor`,t)},strokeColor:t=>{e(`strokeColor`,`borderColor`,t)},rotation:e=>{let t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let r of Object.keys(t.detail))(e[r]||n[r])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[r,i]of Object.entries(t)){let a=n[r];a&&(a({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,r,i]=this.data.rect.map(e=>Math.fround(e));if(e.length===8){let[a,o,s,c]=e.subarray(2,6);if(r===a&&i===o&&t===s&&n===c)return}let{style:a}=this.container,o;if(this.#t){let{borderColor:e,borderWidth:t}=a;a.borderWidth=0,o=[`url('data:image/svg+xml;utf8,`,`<svg xmlns="http://www.w3.org/2000/svg"`,` preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add(`hasBorder`)}let s=r-t,c=i-n,{svgFactory:l}=this,u=l.createElement(`svg`);u.classList.add(`quadrilateralsContainer`),u.setAttribute(`width`,0),u.setAttribute(`height`,0),u.role=`none`;let d=l.createElement(`defs`);u.append(d);let f=l.createElement(`clipPath`),p=`clippath_${this.data.id}`;f.setAttribute(`id`,p),f.setAttribute(`clipPathUnits`,`objectBoundingBox`),d.append(f);for(let n=2,r=e.length;n<r;n+=8){let r=e[n],a=e[n+1],u=e[n+2],d=e[n+3],p=l.createElement(`rect`),m=(u-t)/s,h=(i-a)/c,g=(r-u)/s,_=(a-d)/c;p.setAttribute(`x`,m),p.setAttribute(`y`,h),p.setAttribute(`width`,g),p.setAttribute(`height`,_),f.append(p),o?.push(`<rect vector-effect="non-scaling-stroke" x="${m}" y="${h}" width="${g}" height="${_}"/>`)}this.#t&&(o.push(`</g></svg>')`),a.backgroundImage=o.join(``)),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){let{data:t}=this,n,r;e?(n={str:e.text},r=e.date):(n=t.contentsObj,r=t.modificationDate),this.#n=new WP({data:{color:t.color,titleObj:t.titleObj,modificationDate:r,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){pA("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects[e];if(r)for(let{page:e,id:i,exportValues:a}of r){if(e===-1||i===t)continue;let r=typeof a==`string`?a:null,o=document.querySelector(`[data-element-id="${i}"]`);if(o&&!AP.has(o)){fA(`_getElementsByName - element not allowed: ${i}`);continue}n.push({id:i,exportValue:r,domElement:o})}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&AP.has(r)&&n.push({id:i,exportValue:e,domElement:r})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add(`highlightArea`);else e.classList.add(`highlightArea`)}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener(`dblclick`,()=>{this.linkService.eventBus?.dispatch(`switchannotationeditormode`,{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},PP=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className=`editorAnnotation`,this.container}createOrUpdatePopup(){let{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}
423get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},FP=class extends NP{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,n=document.createElement(`a`);n.setAttribute(`data-element-id`,e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),r=!0):e.attachment?(this.#t(n,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(this.#n(n,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.Action||e.actions[`Mouse Up`]||e.actions[`Mouse Down`])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,``),r=!0)),this.container.classList.add(`linkAnnotation`),r&&(this.contentElement=n,this.container.append(n)),this.container}#e(){this.container.setAttribute(`data-internal-link`,``)}_bindLink(e,t,n=``){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t===``)&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),n&&(e.title=n),this.#e()}#t(e,t,n=``,r=null){e.href=this.linkService.getAnchorUrl(``),t.description?e.title=t.description:n&&(e.title=n),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,r),!1),this.#e()}#n(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl(``);let n=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of Object.keys(t.actions)){let i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t.id,name:r}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),!this._fieldObjects){fA('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{n?.();let{fields:e,refs:r,include:i}=t,a=[];if(e.length!==0||r.length!==0){let t=new Set(r);for(let n of e){let e=this._fieldObjects[n]||[];for(let{id:n}of e)t.add(n)}for(let e of Object.values(this._fieldObjects))for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of Object.values(this._fieldObjects))a.push(...e);let o=this.annotationStorage,s=[];for(let e of a){let{id:t}=e;switch(s.push(t),e.type){case`text`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}case`checkbox`:case`radiobutton`:{let n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case`combobox`:case`listbox`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}default:continue}let n=document.querySelector(`[data-element-id="${t}"]`);if(n){if(!AP.has(n)){fA(`_bindResetFormAction - element not allowed: ${t}`);continue}n.dispatchEvent(new Event(`resetform`))}}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}}},IP=class extends NP{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add(`textAnnotation`);let e=document.createElement(`img`);return e.src=this.imageResourcesPath+`annotation-`+this.data.name.toLowerCase()+`.svg`,e.setAttribute(`data-l10n-id`,`pdfjs-text-annotation-type`),e.setAttribute(`data-l10n-args`,JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}}
423,LP=class extends NP{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName===`CANVAS`&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return AA.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,r,i){n.includes(`mouse`)?e.addEventListener(n,e=>{this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{if(n===`blur`){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if(n===`focus`){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e)}})})}_setEventListeners(e,t,n,r){for(let[i,a]of n)(a===`Action`||this.data.actions?.[a])&&((a===`Focus`||a===`Blur`)&&(t||={focused:!1}),this._setEventListener(e,t,i,a,r),a===`Focus`&&!this.data.actions?.Blur?this._setEventListener(e,t,`blur`,`Blur`,null):a===`Blur`&&!this.data.actions?.Focus&&this._setEventListener(e,t,`focus`,`Focus`,null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:Q.makeHexColor(...t)}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||kP,i=e.style,a,o=e=>Math.round(10*e)/10;if(this.data.multiLine){let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(Jk*r))||1);a=Math.min(r,o(t/Jk))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/Jk))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=Q.makeHexColor(...n),this.data.textAlignment!==null&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},RP=class extends LP{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,r){let i=this.annotationStorage;
423for(let a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[r]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add(`textWidgetAnnotation`);let n=null;if(this.renderForms){let r=e.getValue(t,{value:this.data.fieldValue}),i=r.value||``,a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));let o=r.formattedValue||this.data.textContent?.join(`
424`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,``));let s={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement(`textarea`),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY=`hidden`)):(n=document.createElement(`input`),n.type=this.data.password?`password`:`text`,n.setAttribute(`value`,o??i),this.data.doNotScroll&&(n.style.overflowX=`hidden`)),this.data.hasOwnCanvas&&(n.hidden=!0),AP.add(n),this.contentElement=n,n.setAttribute(`data-element-id`,t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;let{datetimeFormat:c,datetimeType:l,timeStep:u}=this.data,d=!!l&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener(`input`,r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,`value`,r.target.value,`value`),s.formattedValue=null}),n.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue??``;n.value=s.userValue=t,s.formattedValue=null});let f=e=>{let{formattedValue:t}=s;t!=null&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener(`focus`,e=>{if(s.focused)return;let{target:t}=e;if(d&&(t.type=l,u&&(t.step=u)),s.userValue){let e=s.userValue;if(d)if(l===`time`){let n=new Date(e);t.value=[n.getHours(),n.getMinutes(),n.getSeconds()].map(e=>e.toString().padStart(2,`0`)).join(`:`)}else t.value=new Date(e-jP).toISOString().split(l===`date`?`T`:`.`,1)[0];else t.value=e}s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.Focus||(s.focused=!0)}),n.addEventListener(`updatefromsandbox`,n=>{this.showElementAndHideCanvas(n.target),this._dispatchEventFromSandbox({value(n){s.userValue=n.detail.value??``,d||e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){let{formattedValue:r}=n.detail;s.formattedValue=r,r!=null&&n.target!==document.activeElement&&(n.target.value=r);let i={formattedValue:r};d&&(i.value=r),e.setValue(t,i)},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{let{charLimit:r}=n.detail,{target:i}=n;if(r===0){i.removeAttribute(`maxLength`);return}i.setAttribute(`maxLength`,r);let a=s.userValue;!a||a.length<=r||(a=a.slice(0,r),i.value=s.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}},n)}),n.addEventListener(`keydown`,e=>{s.commitKey=1;let n=-1;if(e.key===`Escape`?n=0:e.key===`Enter`&&!this.data.multiLine?n=2:e.key===`Tab`&&(s.commitKey=3),n===-1)return;let{value:r}=e.target;s.lastCommittedValue!==r&&(s.lastCommittedValue=r,s.userValue=r,this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});let r=f;f=null,n.addEventListener(`blur`,e=>{if(!s.focused||!e.relatedTarget)return;this.data.actions?.Blur||(s.focused=!1);let{target:n}=e,{value:i}=n;if(d){if(i&&l===`time`){let e=i.split(`:`).map(e=>parseInt(e,10));i=new Date(2e3,0,1,e[0],e[1],e[2]||0).valueOf(),n.step=``}else i.includes(`T`)||(i=`${i}T00:00`),i=new Date(i).valueOf();n.type=`text`}s.userValue=i,s.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,willCommit:!0,commitKey:s.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)}),this.data.actions?.Keystroke&&n.addEventListener(`beforeinput`,e=>{s.lastCommittedValue=null;let{data:n,target:r}=e,{value:i,selectionStart:a,selectionEnd:o}=r,c=a,l=o;switch(e.inputType){case`deleteWordBackward`:{let e=i.substring(0,a).match(/\w*[^\
424w]*$/);e&&(c-=e[0].length);break}case`deleteWordForward`:{let e=i.substring(a).match(/^[^\w]*\w*/);e&&(l+=e[0].length);break}case`deleteContentBackward`:a===o&&--c;break;case`deleteContentForward`:a===o&&(l+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,change:n||``,willCommit:!1,selStart:c,selEnd:l}})}),this._setEventListeners(n,s,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.value)}if(f&&n.addEventListener(`blur`,f),this.data.comb){let e=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add(`comb`),n.style.letterSpacing=`calc(${e}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement(`div`),n.textContent=this.data.fieldValue,n.style.verticalAlign=`middle`,n.style.display=`table-cell`,this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},zP=class extends LP{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},BP=class extends LP{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof r==`string`&&(r=r!==`Off`,e.setValue(n,{value:r})),this.container.classList.add(`buttonWidgetAnnotation`,`checkBox`);let i=document.createElement(`input`);return AP.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`checkbox`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.setAttribute(`exp
424ortValue`,t.exportValue),i.tabIndex=0,i.addEventListener(`change`,r=>{let{name:i,checked:a}=r.target;for(let r of this._getElementsByName(i,n)){let n=a&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:a})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue||`Off`;e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value(t){t.target.checked=t.detail.value!==`Off`,e.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},VP=class extends LP{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`buttonWidgetAnnotation`,`radioButton`);let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof r==`string`&&(r=r!==t.buttonValue,e.setValue(n,{value:r})),r)for(let r of this._getElementsByName(t.fieldName,n))e.setValue(r.id,{value:!1});let i=document.createElement(`input`);if(AP.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`radio`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.tabIndex=0,i.addEventListener(`change`,t=>{let{name:r,checked:i}=t.target;for(let t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue;e.target.checked=n!=null&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){let r=t.buttonValue;i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value:t=>{let i=r===t.detail.value;for(let r of this._getElementsByName(t.target.name)){let t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},HP=class extends FP{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add(`buttonWidgetAnnotation`,`pushButton`);let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener(`updatefromsandbox`,e=>{this._dispatchEventFromSandbox({},e)})),e}},UP=class extends LP{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`choiceWidgetAnnotation`);let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement(`select`);AP.add(r),r.setAttribute(`data-element-id`,t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue;for(let e of r.options)e.selected=e.value===t});let a=(e,t)=>{let n=t.replaceAll(` `,`\xA0`);e.textContent=n,n!==t&&e.setAttribute(`display-value`,t)};for(let e of this.data.options){let t=document.createElement(`option`);a(t,e.displayValue),t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute(`selected`,!0),i=!1),r.append(t)}let o=null;if(i){let e=document.createElement(`option`);e.value=` `,e.setAttribute(`hidden`,!0),e.setAttribute(`selected`,!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener(`input`,o),o=null},r.addEventListener(`input`,o)}let s=e=>{let t=e?`value`:`textContent`,{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):n.selectedIndex===-1?null:n[n.selectedIndex][t]},c=s(!1),l=e=>{let t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.getAttribute(`display-value`)||e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener(`updatefromsandbox`,n=>{this._dispatchEventFromSandbox({value(n){o?.();let i=n.detail.value,a=new Set(Array.isArray(i)?i:[i]);for(let e of r.options)e.selected=a.has(e.value);
424e.setValue(t,{value:s(!0)}),c=s(!1)},multipleSelection(e){r.multiple=!0},remove(n){let i=r.options,a=n.detail.remove;i[a].selected=!1,r.remove(a),i.length>0&&Array.prototype.findIndex.call(i,e=>e.selected)===-1&&(i[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},clear(n){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),c=s(!1)},insert(n){let{index:i,displayValue:o,exportValue:u}=n.detail.insert,d=r.children[i],f=document.createElement(`option`);a(f,o),f.value=u,d?d.before(f):r.append(f),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},items(n){let{items:i}=n.detail;for(;r.length!==0;)r.remove(0);for(let e of i){let{displayValue:t,exportValue:n}=e,i=document.createElement(`option`);a(i,t),i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},indices(n){let r=new Set(n.detail.indices);for(let e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(!0)}),c=s(!1)},editable(e){e.target.disabled=!e.detail.editable}},n)}),r.addEventListener(`input`,n=>{let r=s(!0),i=s(!1);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:c,change:i,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`],[`input`,`Action`],[`input`,`Validate`]],e=>e.target.value)):r.addEventListener(`input`,function(n){e.setValue(t,{value:s(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},WP=class extends NP{constructor(e){let{data:t,elements:n,parent:r}=e,i=!!r._commentManager;if(super(e,{isRenderable:!i&&NP._hasPopupData(t)}),this.elements=n,i&&NP._hasPopupData(t)){let e=this.popup=this.#e();for(let t of n)t.popup=e}else this.popup=null}#e(){return new GP({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){let{container:e}=this;e.classList.add(`popupAnnotation`),e.role=`comment`;let t=this.popup=this.#e(),n=[];for(let e of this.elements)e.popup=t,e.container.ariaHasPopup=`dialog`,n.push(e.data.id),e.addHighlightArea();return this.container.setAttribute(`aria-controls`,n.map(e=>`${IA}${e}`).join(`,`)),this.container}},GP=class{#e=null;#t=this.#P.bind(this);#n=this.#R.bind(this);#r=this.#L.bind(this);#i=this.#I.bind(this);#a=null;#o=null;#s=null;#c=null;#l=null;#u=null;#d=null;#f=!1;#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=!1;#w=null;#T=null;constructor({container:e,color:t,elements:n,titleObj:r,modificationDate:i,contentsObj:a,richText:o,parent:s,rect:c,parentRect:l,open:u,commentManager:d=null}){this.#o=e,this.#x=r,this.#s=a,this.#b=o,this.#u=s,this.#a=t,this.#y=c,this.#d=l,this.#l=n,this.#e=d,this.#w=n[0],this.#c=ij.toDateObject(i),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup()),d||(this.#E(),this.#o.hidden=!0,u&&this.#I())}#E(){if(this.#m)return;this.#m=new AbortController;let{signal:e}=this.#m;for(let t of this.trigger)t.addEventListener(`click`,this.#i,{signal:e}),t.addEventListener(`pointerenter`,this.#r,{signal:e}),t.addEventListener(`pointerleave`,this.#n,{signal:e}),t.classList.add(`popupTriggerArea`);for(let t of this.#l)t.container?.addEventListener(`keydown`,this.#t,{signal:e})}#D(){let e=this.#l.find(e=>e.hasCommentButton);e&&(this.#_=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#g){this.#g.parentNode||this.#w.container.after(this.#g);return}if(this.#_||this.#D(),!this.#_)return;let{signal:e}=this.#m=new AbortController,t=this.#w.hasOwnCommentButton,n=()=>{this.#e.toggleCommentPopup(this,!0,void 0,!t)},r=()=>
424{this.#e.toggleCommentPopup(this,!1,!0,!t)},i=()=>{this.#e.toggleCommentPopup(this,!1,!1)};if(t){this.#g=this.#w.container;for(let t of this.trigger)t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),t.classList.add(`popupTriggerArea`)}else{let t=this.#g=document.createElement(`button`);t.className=`annotationCommentButton`;let a=this.#w.container;t.style.zIndex=parseInt(a.style.zIndex,10)+1,t.tabIndex=0,t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`),this.#k(),this.#O(),t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),a.after(t)}}#O(){if(this.#w.extraPopupElement&&!this.#w.editor)return;this.#g||this.renderCommentButton();let[e,t]=this.#_,{style:n}=this.#g;n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`}#k(){this.#w.extraPopupElement||(this.#g||this.renderCommentButton(),this.#g.style.backgroundColor=this.commentButtonColor||``)}get commentButtonColor(){let{color:e,opacity:t}=this.#w.commentData;return e?this.#u._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{this.#g?.focus()},0)}
424getData(){let{richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}=this.#w.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}}get elementBeforePopup(){return this.#g}get comment(){return this.#T||=this.#w.commentText,this.#T}set comment(e){e!==this.comment&&(this.#w.commentText=this.#T=e)}focus(){this.#w.container?.focus()}get parentBoundingClientRect(){return this.#w.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){this.#g&&(this.#g.classList.toggle(`selected`,e),this.#g.ariaExpanded=t)}setSelectedCommentButton(e){this.#g.classList.toggle(`selected`,e)}get commentPopupPosition(){if(this.#v)return this.#v;let{x:e,y:t,height:n}=this.#g.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#w.layer.getBoundingClientRect();return[(e-r)/a,(t+n-i)/o]}set commentPopupPosition(e){this.#v=e}hasDefaultPopupPosition(){return this.#v===null}get commentButtonPosition(){return this.#_}get commentButtonWidth(){return this.#g.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=this.#v||this.commentButtonPosition.map(e=>e/100),r=this.parentBoundingClientRect,{x:i,y:a,width:o,height:s}=r;this.#e.showDialog(null,this,i+t*o,a+n*s,{...e,parentDimensions:r})}render(){if(this.#p)return;let e=this.#p=document.createElement(`div`);if(e.className=`popup`,this.#a){let t=e.style.outlineColor=Q.makeHexColor(...this.#a);e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`}let t=document.createElement(`span`);if(t.className=`header`,this.#x?.str){let e=document.createElement(`span`);e.className=`title`,t.append(e),{dir:e.dir,str:e.textContent}=this.#x}if(e.append(t),this.#c){let e=document.createElement(`time`);e.className=`popupDate`,e.setAttribute(`data-l10n-id`,`pdfjs-annotation-date-time-string`),e.setAttribute(`data-l10n-args`,JSON.stringify({dateObj:this.#c.valueOf()})),e.dateTime=this.#c.toISOString(),t.append(e)}Cj({html:this.#A||this.#s.str,dir:this.#s?.dir,className:`popupContent`},e),this.#o.append(e)}get#A(){let e=this.#b,t=this.#s;return e?.str&&(!t?.str||t.str===e.str)&&this.#b.html||null}get#j(){return this.#A?.attributes?.style?.fontSize||0}get#M(){return this.#A?.attributes?.style?.color||null}#N(e){let t=[],n={str:e,html:{name:`div`,attributes:{dir:`auto`},children:[{name:`p`,children:t}]}},r={style:{color:this.#M,fontSize:this.#j?`calc(${this.#j}px * var(--total-scale-factor))`:``}};for(let n of e.split(`
425`))t.push({name:`span`,value:n,attributes:r});return n}#P(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key===`Enter`||e.key===`Escape`&&this.#f)&&this.#I()}updateEdited({rect:e,popup:t,deleted:n}){if(this.#e){n?(this.remove(),this.#T=null):t&&(t.deleted?this.remove():(this.#k(),this.#T=t.text)),e&&(this.#_=null,this.#D(),this.#O());return}if(n||t?.deleted){this.remove();return}this.#E(),this.#S||={contentsObj:this.#s,richText:this.#b},e&&(this.#h=null),t&&t.text&&(this.#b=this.#N(t.text),this.#c=ij.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null}resetEdited(){this.#S&&({contentsObj:this.#s,richText:this.#b}=this.#S,this.#S=null,this.#p?.remove(),this.#p=null,this.#h=null)}remove(){if(this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#C=!1,this.#f=!1,this.#g?.remove(),this.#g=null,this.trigger)for(let e of this.trigger)e.classList.remove(`popupTriggerArea`)}#F(){if(this.#h!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:i}}}=this.#u,a=!!this.#d,o=a?this.#d:this.#y;for(let e of this.#l)if(!o||Q.intersect(e.data.rect,o)!==null){o=e.data.rect,a=!0;break}let s=Q.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),c=a?o[2]-o[0]+5:0,l=s[0]+c,u=s[1];this.#h=[100*(l-r)/t,100*(u-i)/n];let{style:d}=this.#o;d.left=`${this.#h[0]}%`,d.top=`${this.#h[1]}%`}#I(){if(this.#e){this.#e.toggleCommentPopup(this,!1);return}this.#f=!this.#f,this.#f?(this.#L(),this.#o.addEventListener(`click`,this.#i),this.#o.addEventListener(`keydown`,this.#t)):(this.#R(),this.#o.removeEventListener(`click`,this.#i),this.#o.removeEventListener(`ke
425ydown`,this.#t))}#L(){this.#p||this.render(),this.isVisible?this.#f&&this.#o.classList.add(`focused`):(this.#F(),this.#o.hidden=!1,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)+1e3)}#R(){this.#o.classList.remove(`focused`),!(this.#f||!this.isVisible)&&(this.#o.hidden=!0,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)-1e3)}forceHide(){this.#C=this.isVisible,this.#C&&(this.#o.hidden=!0)}maybeShow(){this.#e||(this.#E(),this.#C&&(this.#p||this.#L(),this.#C=!1,this.#o.hidden=!1))}get isVisible(){return!this.#e&&this.#o.hidden===!1}},KP=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Z.FREETEXT}render(){if(this.container.classList.add(`freeTextAnnotation`),this.textContent){let e=this.contentElement=document.createElement(`div`);e.classList.add(`annotationTextContent`),e.setAttribute(`role`,`comment`);for(let t of this.textContent){let n=document.createElement(`span`);n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},qP=class extends NP{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`lineAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement(`svg:line`);return i.setAttribute(`x1`,e.rect[2]-e.lineCoordinates[0]),i.setAttribute(`y1`,e.rect[3]-e.lineCoordinates[1]),i.setAttribute(`x2`,e.rect[2]-e.lineCoordinates[2]),i.setAttribute(`y2`,e.rect[3]-e.lineCoordinates[3]),i.setAttribute(`stroke-width`,e.borderStyle.width||1),i.setAttribute(`stroke`,`transparent`),i.setAttribute(`fill`,`transparent`),r.append(i),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},JP=class extends NP{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`squareAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:rect`);return a.setAttribute(`x`,i/2),a.setAttribute(`y`,i/2),a.setAttribute(`width`,t-i),a.setAttribute(`height`,n-i),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},YP=class extends NP{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`circleAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:ellipse`);return a.setAttribute(`cx`,t/2),a.setAttribute(`cy`,n/2),a.setAttribute(`rx`,t/2-i/2),a.setAttribute(`ry`,n/2-i/2),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},XP=class extends NP{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`polylineAnnotation`,this.svgElementName=`svg:polyline`}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:n,popupRef:r},width:i,height:a}=this;if(!t)return this.container;let o=this.svgFactory.create(i,a,!0),s=[];for(let n=0,r=t.length;n<r;n+=2){let r=t[n]-e[0],i=e[3]-t[n+1];s.push(`${r},${i}`)}s=s.join(` `);let c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute(`points`,s),c.setAttribute(`stroke-width`,n.width||1),c.setAttribute(`stroke`,`transparent`),c.setAttribute(`fill`,`transparent`),o.append(c),this.container.append(o),!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},ZP=class extends XP{constructor(e){super(e),this.containerClassName=`polygonAnnotation`,this.svgElementName=`svg:polygon`}},QP=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add(`caretAnnotation`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}}
425,$P=class extends NP{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`inkAnnotation`,this.svgElementName=`svg:polyline`,this.annotationEditorType=this.data.it===`InkHighlight`?Z.HIGHLIGHT:Z.INK}#n(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:n,borderStyle:r,popupRef:i}}=this,{transform:a,width:o,height:s}=this.#n(t,e),c=this.svgFactory.create(o,s,!0),l=this.#e=this.svgFactory.createElement(`svg:g`);c.append(l),l.setAttribute(`stroke-width`,r.width||1),l.setAttribute(`stroke-linecap`,`round`),l.setAttribute(`stroke-linejoin`,`round`),l.setAttribute(`stroke-miterlimit`,10),l.setAttribute(`stroke`,`transparent`),l.setAttribute(`fill`,`transparent`),l.setAttribute(`transform`,a);for(let e=0,t=n.length;e<t;e++){let t=this.svgFactory.createElement(this.svgElementName);this.#t.push(t),t.setAttribute(`points`,n[e].join(`,`)),l.append(t)}return!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:n,rect:r}=e,i=this.#e;if(t>=0&&i.setAttribute(`stroke-width`,t||1),n)for(let e=0,t=this.#t.length;e<t;e++)this.#t[e].setAttribute(`points`,n[e].join(`,`));if(r){let{transform:e,width:t,height:n}=this.#n(this.data.rotation,r);i.parentElement.setAttribute(`viewBox`,`0 0 ${t} ${n}`),i.setAttribute(`transform`,e)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add(`highlightArea`)}},eF=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Z.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`highlightAnnotation`),this._editOnDoubleClick(),e){let t=document.createElement(`mark`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},tF=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`underlineAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},nF=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`squigglyAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},rF=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`strikeoutAnnotation`),e){let t=document.createElement(`s`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},iF=class extends NP{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Z.STAMP}render(){return this.container.classList.add(`stampAnnotation`),this.container.setAttribute(`role`,`img`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}
425,aF=class extends NP{#e=null;constructor(e){super(e,{isRenderable:!0});let{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch(`fileattachmentannotation`,{source:this,...t})}render(){this.container.classList.add(`fileAttachmentAnnotation`);let{container:e,data:t}=this,n;t.hasAppearance||t.fillAlpha===0?n=document.createElement(`div`):(n=document.createElement(`img`),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?`paperclip`:`pushpin`}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener(`dblclick`,this.#t.bind(this)),this.#e=n;let{isMac:r}=AA.platform;return e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(r?e.metaKey:e.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):n.classList.add(`popupTriggerArea`),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},oF=class e{#e=null;#t=null;#n=null;#r=new Map;#i=null;#a=null;#o=[];#s=!1;zIndex=0;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:r,page:i,viewport:a,structTreeLayer:o,commentManager:s,linkService:c,annotationStorage:l}){this.div=e,this.#e=t,this.#t=n,this.#i=o||null,this.#a=c||null,this.#n=l||new Gj,this.page=i,this.viewport=a,this._annotationEditorUIManager=r,this._commentManager=s||null}hasEditableAnnotations(){return this.#r.size>0}async render(e){let{annotations:t}=e,n=this.div;dj(n,this.viewport);let r=new Map,i=[],a={data:null,layer:n,linkService:this.#a,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||``,renderForms:e.renderForms!==!1,svgFactory:new OP,annotationStorage:this.#n,enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let e of t){if(e.noHTML)continue;let t=e.annotationType===nA.POPUP;if(t){let t=r.get(e.id);if(!t)continue;if(!this._commentManager){i.push(e);continue}a.elements=t}else if(e.rect[2]===e.rect[0]||e.rect[3]===e.rect[1])continue;a.data=e;let n=MP.create(a);if(!n.isRenderable)continue;t||(this.#o.push(n),e.popupRef&&r.getOrInsertComputed(e.popupRef,RA).push(n));let o=n.render();e.hidden&&(o.style.visibility=`hidden`),n._isEditable&&(this.#r.set(n.data.id,n),this._annotationEditorUIManager?.renderAnnotationElement(n))}await this.#c();for(let e of i){let t=a.elements=r.get(e.id);a.data=e;let n=MP.create(a);if(!n.isRenderable)continue;let i=n.render();n.contentElement.id=`${IA}${e.id}`,e.hidden&&(i.style.visibility=`hidden`),t.at(-1).container.after(i)}this.#l()}async#c(){if(this.#o.length===0)return;this.div.replaceChildren();let e=[];
425if(!this.#s){this.#s=!0;for(let{contentElement:t,data:{id:n}}of this.#o){let r=t.id=`${IA}${n}`;e.push(this.#i?.getAriaAttributes(r).then(e=>{if(e)for(let[n,r]of e)t.setAttribute(n,r)}))}}this.#o.sort(({data:{rect:[e,t,n,r]}},{data:{rect:[i,a,o,s]}})=>{if(e===n&&t===r)return 1;if(i===o&&a===s)return-1;let c=r,l=t,u=(t+r)/2,d=s,f=a,p=(a+s)/2;return u>=d&&p<=l?-1:p>=c&&u<=f?1:(e+n)/2-(i+o)/2});let t=document.createDocumentFragment();for(let e of this.#o)t.append(e.container),this._commentManager?(e.extraPopupElement?.popup||e.popup)?.renderCommentButton():e.extraPopupElement&&t.append(e.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),this.#e)for(let e of this.#o)this.#e.addPointerInTextLayer(e.contentElement,!1)}async addLinkAnnotations(t){let n={data:null,layer:this.div,linkService:this.#a,svgFactory:new OP,parent:this};for(let r of t){r.borderStyle||=e._defaultBorderStyle,n.data=r;let t=MP.create(n);t.isRenderable&&(t.render(),t.contentElement.id=`${IA}${r.id}`,this.#o.push(t))}await this.#c()}update({viewport:e}){let t=this.div;this.viewport=e,dj(t,{rotation:e.rotation}),this.#l(),t.hidden=!1}#l(){if(!this.#t)return;let e=this.div;for(let[t,n]of this.#t){let r=e.querySelector(`[data-annotation-id="${t}"]`);if(!r)continue;n.className=`annotationContent`;let{firstChild:i}=r;i?i.nodeName===`CANVAS`?i.replaceWith(n):i.classList.contains(`annotationContent`)?i.after(n):i.before(n):r.append(n);let a=this.#r.get(t);a&&(a._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,r.id,n),a._hasNoCanvas=!1):a.canvas=n)}this.#t.clear()}getEditableAnnotations(){return this.#r.values()}getEditableAnnotation(e){return this.#r.get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:r}=e,i=new PP({data:{id:n,rect:e.getPDFRect(),rotation:r},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#a,annotationStorage:this.#n});return i.render(),i.contentElement.id=`${IA}${n}`,i.createOrUpdatePopup(),this.#o.push(i),i}removeAnnotation(e){let t=this.#o.findIndex(t=>t.data.id===e);if(t<0)return;let[n]=this.#o.splice(t,1);this.#e?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);this.#c()}}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}static get _defaultBorderStyle(){return yA(this,`_defaultBorderStyle`,Object.freeze({width:1,rawWidth:1,style:rA.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},sF=/\r\n?|\n/g,cF=class e extends Rj{#e=``;#t=`${this.id}-editor`;#n=null;#r;_colorPicker=null;static _freeTextDefaultContent=``;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.isEmpty(),r=Pj.TRANSLATE_SMALL,i=Pj.TRANSLATE_BIG;return yA(this,`_keyboardManager`,new Mj([[[`ctrl+s`,`mac+meta+s`,`ctrl+p`,`mac+meta+p`],t.commitOrRemove,{bubbles:!0}],[[`ctrl+Enter`,`mac+meta+Enter`,`Escape`,`mac+Escape`],t.commitOrRemove],[[`ArrowLeft`,`mac+ArrowLeft`],t._translateEmpty,{args:[-r,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t._translateEmpty,{args:[-i,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t._translateEmpty,{args:[r,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t._translateEmpty,{args:[i,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t._translateEmpty,{args:[0,-r],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t._translateEmpty,{args:[0,-i],checker:n}],[[`ArrowDown`,`mac+ArrowDown`],t._translateEmpty,{args:[0,r],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t._translateEmpty,{args:[0,i],checker:n}]]))}static _type=`freetext`;static _editorType=Z.FREETEXT;constructor(t){super({...t,name:`freeTextEditor`}),this.color=t.color||e._defaultColor||Rj._defaultLineColor,this.#r=t.fontSize||e._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-freetext-added-alert`),this.canAddComment=!1}static initialize(e,t){Rj.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue(`--freetext-padding`))}
425static updateDefaultParams(t,n){switch(t){case Qk.FREETEXT_SIZE:e._defaultFontSize=n;break;case Qk.FREETEXT_COLOR:e._defaultColor=n}}updateParams(e,t){switch(e){case Qk.FREETEXT_SIZE:this.#i(t);break;case Qk.FREETEXT_COLOR:this.#a(t)}}static get defaultPropertiesToUpdate(){return[[Qk.FREETEXT_SIZE,e._defaultFontSize],[Qk.FREETEXT_COLOR,e._defaultColor||Rj._defaultLineColor]]}get propertiesToUpdate(){return[[Qk.FREETEXT_SIZE,this.#r],[Qk.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new CP(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return Qk.FREETEXT_COLOR}#i(e){let t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--total-scale-factor))`,this.translate(0,-(e-this.#r)*this.parentScale),this.#r=e,this.#s()},n=this.#r;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Qk.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#a(e){let t=e=>{this.color=e,this.onUpdatedColor()},n=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Qk.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let t=this.parentScale;return[-e._internalPadding*t,-(e._internalPadding+this.#r)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove(`enabled`),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute(`aria-activedescendant`),this.#n=new AbortController;let e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener(`keydown`,this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener(`focus`,this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener(`blur`,this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener(`input`,this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener(`paste`,this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add(`enabled`),this.editorDiv.contentEditable=!1,this.div.setAttribute(`aria-activedescendant`,this.#t),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add(`freetextEditing`),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===``}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add(`freetextEditing`)),super.remove()}#o(){let t=[];this.editorDiv.normalize();let n=null;for(let r of this.editorDiv.childNodes)(n?.nodeType!==Node.TEXT_NODE||r.nodeName!==`BR`)&&(t.push(e.#c(r)),n=r);return t.join(`
426`)}#s(){let[e,t]=this.parentDimensions,n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{let{currentLayer:e,div:t}=this,r=t.style.display,i=t.classList.contains(`hidden`);t.classList.remove(`hidden`),t.style.display=`hidden`,e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r,t.classList.toggle(`hidden`,i)}this.rotation%180==this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#e,t=this.#e=this.#o().trimEnd();if(e===t)return;let n=e=>{if(this.#e=e,!e){this.remove();return}this.#l(),this._uiManager.rebuild(this),this.#s()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#s()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key===`Enter`&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(t){e._keyboardManager.exec(this,t)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle(`freetextEditing`,this.isEmpty())}disableEditing(){this.editorDiv.setAttribute(`role`,`comment`),this.editorDiv.removeAttribute(`aria-multiline`)}enableEditing(){this.editorDiv.setAttribute(`role`,`textbox`),this.editorDiv.setAttribute(`aria-multiline`,!0)}get canChangeContent(){return!0}
426render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement(`div`),this.editorDiv.className=`internal`,this.editorDiv.setAttribute(`id`,this.#t),this.editorDiv.setAttribute(`data-l10n-id`,`pdfjs-free-text2`),this.editorDiv.setAttribute(`data-l10n-attrs`,`default-content`),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement(`div`),this.overlayDiv.classList.add(`overlay`,`enabled`),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){let[n,r]=this.parentDimensions;if(this.annotationElementId){let{position:i}=this._initialData,[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);let[s,c]=this.pageDimensions,[l,u]=this.pageTranslation,d,f;switch(this.rotation){case 0:d=e+(i[0]-l)/s,f=t+this.height-(i[1]-u)/c;break;case 90:d=e+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[o,-a];break;case 180:d=e-this.width+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[-a,-o];break;case 270:d=e+(i[0]-l-this.height*c)/s,f=t+(i[1]-u-this.width*s)/c,[a,o]=[-o,a]}this.setAt(d*n,f*r,a,o)}else this._moveAfterPaste(e,t);this.#l(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(sF,``)}editorDivPaste(t){let n=t.clipboardData||window.clipboardData,{types:r}=n;if(r.length===1&&r[0]===`text/plain`)return;t.preventDefault();let i=e.#d(n.getData(`text`)||``).replaceAll(sF,`
427`);if(!i)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!i.includes(`
428`)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:s,startOffset:c}=o,l=[],u=[];if(s.nodeType===Node.TEXT_NODE){let t=s.parentElement;if(u.push(s.nodeValue.slice(c).replaceAll(sF,``)),t!==this.editorDiv){let n=l;for(let r of this.editorDiv.childNodes){if(r===t){n=u;continue}n.push(e.#c(r))}}l.push(s.nodeValue.slice(0,c).replaceAll(sF,``))}else if(s===this.editorDiv){let t=l,n=0;for(let r of this.editorDiv.childNodes)n++===c&&(t=u),t.push(e.#c(r))}this.#e=`${l.join(`
429`)}${i}${u.join(`
430`)}`,this.#l();let d=new Range,f=Math.sumPrecise(l.map(e=>e.length));for(let{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){let t=e.nodeValue.length;if(f<=t){d.setStart(e,f),d.setEnd(e,f);break}f-=t}a.removeAllRanges(),a.addRange(d)}#l(){if(this.editorDiv.replaceChildren(),this.#e)for(let e of this.#e.split(`
431`)){let t=document.createElement(`div`);t.append(e?document.createTextNode(e):document.createElement(`br`)),this.editorDiv.append(t)}}#u(){return this.#e.replaceAll(`\xA0`,` `)}static#d(e){return e.replaceAll(` `,`\xA0`)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=e._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,r){let i=null;if(t instanceof KP){let{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:r,rotation:a,id:o,popupRef:s,richText:c,contentsObj:l,creationDate:u,modificationDate:d},textContent:f,textPosition:p,parent:{page:{pageNumber:m}}}=t;if(!f||f.length===0)return null;i=t={annotationType:Z.FREETEXT,color:Array.from(n),fontSize:e,value:f.join(`
432`),position:p,pageIndex:m-1,rect:r.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,popupRef:s,comment:l?.str||null,richText:c,creationDate:u,modificationDate:d}}let a=await super.deserialize(t,n,r);return a.#r=t.fontSize,a.color=Q.makeHexColor(...t.color),a.#e=e.#d(t.value),a._initialData=i,t.comment&&a.setCommentData(t),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=Rj._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),n=Object.assign(super.serialize(e),{color:t,fontSize:this.#r,value:this.#u()});return this.addComment(n),e?(n.isCopy=!0,n):this.annotationElementId&&!this.#f(n)?null:(n.id=this.annotationElementId,n)}#f(e){let{value:t,fontSize:n,color:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==r[t])||e.pageIndex!==i}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);
432if(!t)return null;let{style:n}=t;n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,t.replaceChildren();for(let e of this.#e.split(`
433`)){let n=document.createElement(`div`);n.append(e?document.createTextNode(e):document.createElement(`br`)),t.append(n)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#e}}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},$=class{static PRECISION=1e-4;toSVGPath(){pA("Abstract method `toSVGPath` must be implemented.")}get box(){pA("Abstract getter `box` must be implemented.")}serialize(e,t){pA("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o]*r,a[o+1]=n+e[o+1]*i;return a}static _rescaleAndSwap(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o+1]*r,a[o+1]=n+e[o]*i;return a}static _translate(e,t,n,r){r||=new Float32Array(e.length);for(let i=0,a=e.length;i<a;i+=2)r[i]=t+e[i],r[i+1]=n+e[i+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,r,i){switch(i){case 90:return[1-t/n,e/r];case 180:return[1-e/n,1-t/r];case 270:return[t/n,1-e/r];default:return[e/n,t/r]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,r,i,a){return[(e+5*n)/6,(t+5*r)/6,(5*n+i)/6,(5*r+a)/6,(n+i)/2,(r+a)/2]}},lF=class e{#e;#t=[];#n;#r;#i=[];#a=new Float32Array(18);#o;#s;#c;#l;#u;#d;#f=[];static#p=8;static#m=2;static#h=e.#p+e.#m;constructor({x:t,y:n},r,i,a,o,s=0){this.#e=r,this.#d=a*i,this.#r=o,this.#a.set([NaN,NaN,NaN,NaN,t,n],6),this.#n=s,this.#l=e.#p*i,this.#c=e.#h*i,this.#u=i,this.#f.push(t,n)}isEmpty(){return isNaN(this.#a[8])}#g(){let e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,r,i,a]=this.#e;return[(this.#o+(e[0]-t[0])/2-n)/i,(this.#s+(e[1]-t[1])/2-r)/a,(this.#o+(t[0]-e[0])/2-n)/i,(this.#s+(t[1]-e[1])/2-r)/a]}add({x:e,y:t}){this.#o=e,this.#s=t;let[n,r,i,a]=this.#e,[o,s,c,l]=this.#a.subarray(8,12),u=e-c,d=t-l,f=Math.hypot(u,d);if(f<this.#c)return!1;let p=f-this.#l,m=p/f,h=m*u,g=m*d,_=o,v=s;o=c,s=l,c+=h,l+=g,this.#f?.push(e,t);let y=-g/p,b=h/p,x=y*this.#d,S=b*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+x,l+S],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-x,l-S],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+x,s+S],2),this.#i.push(NaN,NaN,NaN,NaN,(o+x-n)/i,(s+S-r)/a),this.#a.set([o-x,s-S],14),this.#t.push(NaN,NaN,NaN,NaN,(o-x-n)/i,(s-S-r)/a)),this.#a.set([_,v,o,s,c,l],6),!this.isEmpty()):(this.#a.set([_,v,o,s,c,l],6),Math.abs(Math.atan2(v-s,_-o)-Math.atan2(g,h))<Math.PI/2?([o,s,c,l]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((s+l)/2-r)/a),[o,s,_,v]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((_+o)/2-n)/i,((v+s)/2-r)/a),!0):([_,v,o,s,c,l]=this.#a.subarray(0,6),this.#i.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),[c,l,o,s,_,v]=this.#a.subarray(12,18),this.#t.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),!0))}toSVGPath(){if(this.isEmpty())return``;let e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#_();let n=[];n.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?n.push(`L${e[t+4]} ${e[t+5]}`):n.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#y(n);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?n.push(`L${t[e+4]} ${t[e+5]}`):n.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#v(n),n.join(` `)}#_(){let[e,t,n,r]=this.#e,[i,a,o,s]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/r} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/r} L${i} ${a} L${o} ${s} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/r} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/r} Z`}#v(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){let[t,n,r,i]=this.#e,a=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[s,c,l,u]=this.#g();e.push(`L${(a[0]-t)/r} ${(a[1]-n)/i} L${s} ${c} L${l} ${u} L${(o[0]-t)/r} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,r,i,a){return new uF(e,t,n,r,i,a)}getOutlines(){let e=this.#i,t=this.#t,n=this.#a,[r,i,a,o]=this.#e,s=new Float32Array((this.#f?.length??0)+2);for(let e=0,t=s.length-2;e<t;e+=2)s[e]=(this.#f[e]-r)/a,s[e+1]=(this.#f[e+1]-i)/o;if(s[s.length-2]=(this.#o-r)/a,s[s.length-1]=(this.#s-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#b(s);let c=new Float32Array(this.#i.length+24+this.#t.length),l=e.length;for(let t=0;t<l;t+=2){if(isNaN(e[t])){c[t]=c[t+1]=NaN;continue}c[t]=e[t],c[t+1]=e[t+1]}l=this.#S(c,l);for(let e=t.length-6;e>=6;e-=6)for(let n=0;n<6;n+=2){if(isNaN(t[e+n])){c[l]=c[l+1]=NaN,l+=2;continue}c[l]=t[e+n],c[l+1]=t[e+n+1],l+=2}return this.#x(c,l),this.newFreeDrawOutline(c,s,this.#e,this.#u,this.#n,this.#r)}#b(e){let t=this.#a,[n,r,i,a]=this.#e,[o,s,c,l]=this.#g(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-n)/i,(t[3]-r)/a,NaN,NaN,NaN,NaN,(t[4]-n)/i,(t[5]-r)/a,NaN,NaN,NaN,NaN,o,s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,(t[16]-n)/i,(t[17]-r)/a,NaN,NaN,NaN,NaN,(t[14]-n)/i,(t[15]-r)/a],0),this.newFreeDrawOutline(u,e,this.#e,this.#u,this.#n,this.#r)}#x(e,t){let n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#S(e,t){let n=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[i,a,o,s]=this.#e,[c,l,u,d]=this.#g();return e.set([NaN,NaN,NaN,NaN,(n[0]-i)/o,(n[1]-a)/s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(r[0]-i)/o,(r[1]-a)/s],t),t+=24}},uF=class extends ${#e;#t=new Float32Array(4);#n;#r;#i;#a;#o;constructor(e,t,n,r,i,a){super(),this.#o=e,this.#i=t,this.#e=n,this.#a=r,this.#n=i,this.#r=a,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#s(a);let[o,s,c,l]=this.#t;for(let t=0,n=e.length;t<n;
433t+=2)e[t]=(e[t]-o)/c,e[t+1]=(e[t+1]-s)/l;for(let e=0,n=t.length;e<n;e+=2)t[e]=(t[e]-o)/c,t[e+1]=(t[e+1]-s)/l}toSVGPath(){let e=[`M${this.#o[4]} ${this.#o[5]}`];for(let t=6,n=this.#o.length;t<n;t+=6){if(isNaN(this.#o[t])){e.push(`L${this.#o[t+4]} ${this.#o[t+5]}`);continue}e.push(`C${this.#o[t]} ${this.#o[t+1]} ${this.#o[t+2]} ${this.#o[t+3]} ${this.#o[t+4]} ${this.#o[t+5]}`)}return e.push(`Z`),e.join(` `)}serialize([e,t,n,r],i){let a=n-e,o=r-t,s,c;switch(i){case 0:s=$._rescale(this.#o,e,r,a,-o),c=$._rescale(this.#i,e,r,a,-o);break;case 90:s=$._rescaleAndSwap(this.#o,e,t,a,o),c=$._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=$._rescale(this.#o,n,t,-a,o),c=$._rescale(this.#i,n,t,-a,o);break;case 270:s=$._rescaleAndSwap(this.#o,n,r,-a,-o),c=$._rescaleAndSwap(this.#i,n,r,-a,-o)}return{outline:Array.from(s),points:[Array.from(c)]}}#s(e){let t=this.#o,n=t[4],r=t[5],i=[n,r,n,r],a=n,o=r,s=n,c=r,l=e?Math.max:Math.min,u=new Float32Array(4);for(let e=6,d=t.length;e<d;e+=6){let d=t[e+4],f=t[e+5];isNaN(t[e])?(Q.pointBoundingBox(d,f,i),o>f?(a=d,o=f):o===f&&(a=l(a,d)),c<f?(s=d,c=f):c===f&&(s=l(s,d))):(u.set(Gk,0),Q.bezierBoundingBox(n,r,...t.slice(e,e+6),u),Q.rectBoundingBox(...u,i),o>u[1]?(a=u[0],o=u[1]):o===u[1]&&(a=l(a,u[0])),c<u[3]?(s=u[2],c=u[3]):c===u[3]&&(s=l(s,u[2]))),n=d,r=f}let d=this.#t;d[0]=i[0]-this.#n,d[1]=i[1]-this.#n,d[2]=i[2]-i[0]+2*this.#n,d[3]=i[3]-i[1]+2*this.#n,this.firstPoint=[a,o],this.lastPoint=[s,c]}get box(){return this.#t}newOutliner(e,t,n,r,i,a=0){return new lF(e,t,n,r,i,a)}getNewOutline(e,t){let[n,r,i,a]=this.#t,[o,s,c,l]=this.#e,u=i*c,d=a*l,f=n*c+o,p=r*l+s,m=this.newOutliner({x:this.#i[0]*u+f,y:this.#i[1]*d+p},this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2;e<this.#i.length;e+=2)m.add({x:this.#i[e]*u+f,y:this.#i[e+1]*d+p});return m.getOutlines()}},dF=class{#e;#t;#n;#r=[];#i=[];constructor(e,t=0,n=0,r=!0){let i=Gk.slice(),a=10**-4;for(let{x:n,y:r,width:o,height:s}of e){let e=Math.floor((n-t)/a)*a,c=Math.ceil((n+o+t)/a)*a,l=Math.floor((r-t)/a)*a,u=Math.ceil((r+s+t)/a)*a,d=[e,l,u,!0],f=[c,l,u,!1];this.#r.push(d,f),Q.rectBoundingBox(e,l,c,u,i)}let o=i[2]-i[0]+2*n,s=i[3]-i[1]+2*n,c=i[0]-n,l=i[1]-n,u=r?-1/0:1/0,d=1/0,f=this.#r.at(r?-1:-2),p=[f[0],f[2]];for(let e of this.#r){let[t,n,i,a]=e;!a&&r?n<d?(d=n,u=t):n===d&&(u=Math.max(u,t)):a&&!r&&(n<d?(d=n,u=t):n===d&&(u=Math.min(u,t))),e[0]=(t-c)/o,e[1]=(n-l)/s,e[2]=(i-l)/s}this.#e=new Float32Array([c,l,o,s]),this.#t=[u,d],this.#n=p}getOutlines(){this.#r.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);let e=[];for(let t of this.#r)t[3]?(e.push(...this.#l(t)),this.#s(t)):(this.#c(t),e.push(...this.#l(t)));return this.#a(e)}#a(e){let t=[],n=new Set;for(let n of e){let[e,r,i]=n;t.push([e,r,n],[e,i,n])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,r=t.length;e<r;e+=2){let r=t[e][2],i=t[e+1][2];r.push(i),i.push(r),n.add(r),n.add(i)}let r=[],i;for(;n.size>0;){let e=n.values().next().value,[t,a,o,s,c]=e;n.delete(e);let l=t,u=a;for(i=[t,o],r.push(i);;){let e;if(n.has(s))e=s;else if(n.has(c))e=c;else break;n.delete(e),[t,a,o,s,c]=e,l!==t&&(i.push(l,u,t,u===a?a:o),l=t),u=u===a?o:a}i.push(l,u)}return new fF(r,this.#e,this.#t,this.#n)}#o(e){let t=this.#i,n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i][0];if(a===e)return i;a<e?n=i+1:r=i-1}return r+1}#s([,e,t]){let n=this.#o(e);this.#i.splice(n,0,[e,t])}#c([,e,t]){let n=this.#o(e);for(let r=n;r<this.#i.length;r++){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}for(let r=n-1;r>=0;r--){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}}#l(e){let[t,n,r]=e,i=[[t,n,r]],a=this.#o(r);for(let e=0;e<a;e++){let[n,r]=this.#i[e];for(let e=0,a=i.length;e<a;e++){let[,o,s]=i[e];if(!(r<=o||s<=n)){if(o>=n){if(s>r)i[e][1]=r;else{if(a===1)return[];i.splice(e,1),e--,a--}continue}i[e][2]=n,s>r&&i.push([t,r,s])}}}return i}},fF=class extends ${#e;#t;constructor(e,t,n,r){super(),this.#t=e,this.#e=t,this.firstPoint=n,this.lastPoint=r}toSVGPath(){let e=[];for(let t of this.#t){let[n,r]=t;e.push(`M${n} ${r}`);for(let i=2;i<t.length;i+=2){let a=t[i],o=t[i+1];a===n?(e.push(`V${o}`),r=o):o===r&&(e.push(`H${a}`),n=a)}e.push(`Z`)}return e.join(` `)}serialize([e,t,n,r],i){let a=[],o=n-e,s=r-t;for(let t of this.#t){let n=Array(t.length);for(let i=0;i<t.length;i+=2)n[i]=e+t[i]*o,n[i+1]=r-t[i+1]*s;a.push(n)}return a}get box(){return this.#e}
vendor: 6,994 bytes, line 433
433get classNamesForOutlining(){return[`highlightOutline`]}},pF=class extends lF{newFreeDrawOutline(e,t,n,r,i,a){return new mF(e,t,n,r,i,a)}},mF=class extends uF{newOutliner(e,t,n,r,i,a=0){return new pF(e,t,n,r,i,a)}},hF=class e extends Rj{#e=null;#t=0;#n;#r=null;#i=null;#a=null;#o=null;#s=0;#c=null;#l=null;#u=null;#d=!1;#f=null;#p=null;#m=null;#h=``;#g;#_=``;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type=`highlight`;static _editorType=Z.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId=``;static get _keyboardManager(){let t=e.prototype;return yA(this,`_keyboardManager`,new Mj([[[`ArrowLeft`,`mac+ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`,`mac+ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`,`mac+ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`,`mac+ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:`highlightEditor`}),this.color=t.color||e._defaultColor,this.#g=t.thickness||e._defaultThickness,this.opacity=t.opacity||e._defaultOpacity,this.#n=t.boxes||null,this.#_=t.methodOfCreation||``,this.#h=t.text||``,this._isDraggable=!1,this.defaultL10nId=`pdfjs-editor-highlight-editor`,t.highlightId>-1?(this.#d=!0,this.#y(t),this.#w()):this.#n&&(this.#e=t.anchorNode,this.#t=t.anchorOffset,this.#o=t.focusNode,this.#s=t.focusOffset,this.#v(),this.#w(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-highlight-added-alert`)}get telemetryInitialData(){return{action:`added`,type:this.#d?`free_highlight`:`highlight`,color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#g,methodOfCreation:this.#_}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}#v(){let e=new dF(this.#n,.001);this.#l=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;let t=new dF(this.#n,.0025,.001,this._uiManager.direction===`ltr`);this.#a=t.getOutlines();let{firstPoint:n}=this.#l;this.#f=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height];let{lastPoint:r}=this.#a;this.#p=[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]}#y({highlightOutlines:t,highlightId:n,clipPathId:r}){if(this.#l=t,this.#a=t.getNewOutline(this.#g/2+1.5,.0025),n>=0)this.#u=n,this.#r=r,this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#m=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},!0);else if(this.parent){let n=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:e.#T(this.#l.box,(n-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#m,{bbox:e.#T(this.#a.box,n),path:{d:this.#a.toSVGPath()}})}let[i,a,o,s]=t.box;switch(this.rotation){case 0:this.x=i,this.y=a,this.width=o,this.height=s;break;case 90:{let[e,t]=this.parentDimensions;this.x=a,this.y=1-i,this.width=o*t/e,this.height=s*e/t;break}case 180:this.x=1-i,this.y=1-a,this.width=o,this.height=s;break;case 270:{let[e,t]=this.parentDimensions;this.x=1-a,this.y=i,this.width=o*t/e,this.height=s*e/t;break}}let{firstPoint:c}=t;this.#f=[(c[0]-i)/o,(c[1]-a)/s];let{lastPoint:l}=this.#a;this.#p=[(l[0]-i)/o,(l[1]-a)/s]}static initialize(t,n){Rj.initialize(t,n),e._defaultColor||=n.highlightColors?.values().next().value||`#fff066`}static updateDefaultParams(t,n){switch(t){case Qk.HIGHLIGHT_COLOR:e._defaultColor=n;break;case Qk.HIGHLIGHT_THICKNESS:e._defaultThickness=n}}translateInPage(e,t){}get toolbarPosition(){return this.#p}get commentButtonPosition(){return this.#f}updateParams(e,t){switch(e){case Qk.HIGHLIGHT_COLOR:this.#b(t);break;case Qk.HIGHLIGHT_THICKNESS:this.#x(t)}}static get defaultPropertiesToUpdate(){return[[Qk.HIGHLIGHT_COLOR,e._defaultColor],[Qk.HIGHLIGHT_THICKNESS,e._defaultThickness]]}get propertiesToUpdate(){return[[Qk.HIGHLIGHT_COLOR,this.color||e._defaultColor],[Qk.HIGHLIGHT_THICKNESS,this.#g||e._defaultThickness],[Qk.HIGHLIGHT_FREE,this.#d]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#i?.updateColor(this.color),super.onUpdatedColor()}#b(t){let n=(e,t)=>{this.color=e,this.opacity=t,this.onUpdatedColor()},r=this.color,i=this.opacity;this.addCommands({cmd:n.bind(this,t,e._defaultOpacity),undo:n.bind(this,r,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Qk.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`color_changed`,color:this._uiManager.getNonHCMColorName(t)},!0)}#x(e){let t=this.#g,n=e=>{this.#g=e,this.#S(e)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Qk.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`thickness_changed`,thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[[`colorPicker`,this.#i=new SP({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#O())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#O())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#C(),this._reportTelemetry({action:`deleted`}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#w(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#C():e&&(this.#w(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.show(this._isVisible),t&&this.select()}#S(e){this.#d&&(this.#y({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims())}#C(){this.#u===null||!this.parent||(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#m),this.#m=null)}#w(e=this.parent){this.#u===null&&({id:this.#u,clipPathId:this.#r}=e.drawLayer.draw({bbox:this.#l.box,root:{viewBox:`0 0 1 1`,fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#d},path:{d:this.#l.toSVGPath()}},!1,!0),this.#m=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#d},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},this.#d),this.#c&&(this.#c.style.clipPath=this.#r))}static#T([e,t,n,r],i){switch(i){case 90:return[1-t-r,e,r,n];case 180:return[1-e-n,1-t-r,n,r];case 270:return[t,1-e-n,r,n]}return[e,t,n,r]}rotate(t){let{drawLayer:n}=this.parent,r;this.#d?(t=(t-this.rotation+360)%360,r=e.#T(this.#l.box,t)):r=e.#T([this.x,this.y,this.width,this.height],t),n.updateProperties(this.#u,{bbox:r,root:{"data-main-rotation":t}}),n.updateProperties(this.#m,{bbox:e.#T(this.#a.box,t),root:{"data-main-rotation":t}})}
433render(){if(this.div)return this.div;let e=super.render();this.#h&&(e.setAttribute(`aria-label`,this.#h),e.setAttribute(`role`,`mark`)),this.#d?e.classList.add(`free`):this.div.addEventListener(`keydown`,this.#E.bind(this),{signal:this._uiManager._signal});let t=this.#c=document.createElement(`div`);return e.append(t),t.setAttribute(`aria-hidden`,`true`),t.className=`internal`,t.style.clipPath=this.#r,this.setDims(),Dj(this,this.#c,[`pointerover`,`pointerleave`]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1}})}#E(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#D(!0);break;case 1:case 3:this.#D(!1)}}#D(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#o,this.#s)}select(){super.select(),this.#m&&this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#m&&(this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{selected:!1}}),this.#d||this.#D(!1))}get _mustFixPosition(){return!this.#d}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#m,{rootClass:{hidden:!e}}))}#O(){return this.#d?this.rotation:0}#k(){if(this.#d)return null;let[e,t]=this.pageDimensions,[n,r]=this.pageTranslation,i=this.#n,a=new Float32Array(i.length*8),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*e+n,d=(1-c)*t+r;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*e,a[o+5]=a[o+7]=d-u*t,o+=8}return a}#A(e){return this.#l.serialize(e,this.#O())}static startHighlighting(e,t,{target:n,x:r,y:i}){let{x:a,y:o,width:s,height:c}=n.getBoundingClientRect(),l=new AbortController,u=e.combinedSignal(l),d=t=>{l.abort(),this.#M(e,t)};window.addEventListener(`blur`,d,{signal:u}),window.addEventListener(`pointerup`,d,{signal:u}),window.addEventListener(`pointerdown`,nj,{capture:!0,passive:!1,signal:u}),window.addEventListener(`contextmenu`,tj,{signal:u}),n.addEventListener(`pointermove`,this.#j.bind(this,e),{signal:u}),this._freeHighlight=new pF({x:r,y:i},[a,o,s,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#j(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#M(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:`main_toolbar`}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=``}static async deserialize(e,t,n){let r=null;if(e instanceof eF){let{data:{quadPoints:t,rect:n,rotation:i,id:a,color:o,opacity:s,popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:Z.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,boxes:null,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}else if(e instanceof $P){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,borderStyle:{rawWidth:s},popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:Z.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,boxes:null,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}let{color:i,quadPoints:a,inkLists:o,outlines:s,opacity:c}=e,l=await super.deserialize(e,t,n);l.color=Q.makeHexColor(...i),l.opacity=c||1,o&&(l.#g=e.thickness),l._initialData=r,e.comment&&l.setCommentData(e);let[u,d]=l.pageDimensions,[f,p]=l.pageTranslation;if(a){let e=l.#n=[];for(let t=0;t<a.length;t+=8)e.push({x:(a[t]-f)/u,y:1-(a[t+1]-p)/d,width:(a[t+2]-a[t])/u,height:(a[t+1]-a[t+5])/d});l.#v(),l.#w(),l.rotate(l.rotation)}else if(o||s){l.#d=!0;let e=(o||s.points)[0],n={x:e[0]-f,y:d-(e[1]-p)},r=new pF(n,[0,0,u,d],1,l.#g/2,!0,.001);for(let t=0,i=e.length;t<i;t+=2)n.x=e[t]-f,n.y=d-(e[t+1]-p),r.add(n);let{id:i,clipPathId:a}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:r.toSVGPath()}},!0,!0);l.#y({highlightOutlines:r.getOutlines(),highlightId:i,clipPathId:a}),l.#w(),l.rotate(l.parentRotation)}return l}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=Rj._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n=super.serialize(e);
433return Object.assign(n,{color:t,opacity:this.opacity,thickness:this.#g,quadPoints:this.#k(),outlines:this.#A(n.rect)}),this.addComment(n),this.annotationElementId&&!this.#N(n)?null:(n.id=this.annotationElementId,n)}#N(e){let{color:t}=this._initialData;return this.hasEditedComment||e.color.some((e,n)=>e!==t[n])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}},gF=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))t.startsWith(`_`)||this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){pA(`Not implemented`)}},_F=class e extends Rj{#e=null;#t;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(e){e.drawOutlines&&(this.#a(e),this.#c())}#a({drawOutlines:e,drawId:t,drawingOptions:n}){this.#e=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#o(e,this.parent),this.#d(e.box)}#o(t,n){let{id:r}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return r}static _mergeSVGProperties(e,t){let n=new Set(Object.keys(e));for(let[r,i]of Object.entries(t))n.has(r)?Object.assign(e[r],i):e[r]=i;return e}static getDefaultDrawingOptions(e){pA(`Not implemented`)}static get typesMap(){pA(`Not implemented`)}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,n){let r=this.typesMap.get(t);r&&this._defaultDrawingOptions.updateProperty(r,n),this._currentParent&&(e.#n.updateProperty(r,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[n,r]of this.typesMap)e.push([n,t[r]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[n,r]of this.constructor.typesMap)e.push([n,t[r]]);return e}_updateProperty(e,t,n){let r=this._drawingOptions,i=r[t],a=n=>{r.updateProperty(t,n);let i=this.#e.updateProperty(t,n);i&&this.#d(i),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType?this.onUpdatedColor():e===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(e,t){let n=this.constructor.typesMap.get(this.colorType),r=this.constructor.typesMap.get(this.opacityType),i=this._drawingOptions,a=i[n],o=i[r],s=(e,t)=>{i.updateProperty(n,e),i.updateProperty(r,t),this.#e.updateProperty(n,e),this.#e.updateProperty(r,t),this.parent?.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:s.bind(this,e,t),undo:s.bind(this,a,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Qk.INK_COLOR_AND_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#u()),{bbox:this.#f()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#u()),{bbox:this.#f()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#f()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#u(),this.parentDimensions),{bbox:this.#f()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#s(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#c(),this.#d(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#s()):e&&(this._uiManager.addShouldRescale(this),this.#c(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),t&&this.select()}#s(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#c(e=this.parent){if(this._drawId===null||this.parent!==e){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#o(this.#e,e)}}#l([e,t,n,r]){let{parentDimensions:[i,a],rotation:o}=this;switch(o){case 90:return[t,1-e,a/i*n,i/a*r];case 180:return[1-e,1-t,n,r];case 270:return[1-t,e,a/i*n,i/a*r];default:return[e,t,n,r]}}#u(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],rotation:o}=this;switch(o){case 90:return[1-t,e,i/a*n,a/i*r];case 180:return[1-e,1-t,n,r];case 270:return[t,1-e,i/a*n,a/i*r];default:return[e,t,n,r]}}#d(e){[this.x,this.y,this.width,this.height]=this.#l(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#f(){let{x:e,y:t,width:n,height:r,rotation:i,parentRotation:a,parentDimensions:[o,s]}=this;switch((i*4+a)/90){case 1:return[1-t-r,e,r,n];case 2:return[1-e-n,1-t-r,n,r];case 3:return[t,1-e-n,r,n];case 4:return[e,t-o/s*n,s/o*r,o/s*n];case 5:return[1-t,e,o/s*n,s/o*r];case 6:return[1-e-s/o*r,1-t,s/o*r,o/s*n];case 7:return[t-o/s*n,1-e-s/o*r,o/s*n,s/o*r];case 8:return[e-n,t-r,n,r];case 9:return[1-t,e-n,r,n];case 10:return[1-e,1-t,n,r];case 11:return[t-r,1-e,r,n];case 12:return[e-s/o*r,t,s/o*r,o/s*n];case 13:return[1-t-o/s*n,e-s/o*r,o/s*n,s/o*r];case 14:return[1-e,1-t-o/s*n,s/o*r,o/s*n];case 15:return[t,1-e,o/s*n,s/o*r];default:return[e,t,n,r]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#f()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#d(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
433render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let n=super.render();n.classList.add(`draw`);let r=document.createElement(`div`);return n.append(r),r.setAttribute(`aria-hidden`,`true`),r.className=`internal`,this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e,t,n,r,i){pA(`Not implemented`)}static startDrawing(t,n,r,i){let{target:a,offsetX:o,offsetY:s,pointerId:c,pointerType:l}=i;if(Oj.isInitializedAndDifferentPointerType(l))return;let{viewport:{rotation:u}}=t,{width:d,height:f}=a.getBoundingClientRect(),p=e.#r=new AbortController,m=t.combinedSignal(p);if(Oj.setPointer(l,c),window.addEventListener(`pointerup`,e=>{Oj.isSamePointerIdOrRemove(e.pointerId)&&this._endDraw(e)},{signal:m}),window.addEventListener(`pointercancel`,e=>{Oj.isSamePointerIdOrRemove(e.pointerId)&&this._currentParent.endDrawingSession()},{signal:m}),window.addEventListener(`pointerdown`,t=>{Oj.isSamePointerType(t.pointerType)&&(Oj.initializeAndAddPointerId(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:m}),window.addEventListener(`contextmenu`,tj,{signal:m}),a.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:m}),a.addEventListener(`touchmove`,e=>{Oj.isSameTimeStamp(e.timeStamp)&&nj(e)},{signal:m}),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n){t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(o,s,d,f,u));return}n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance(o,s,d,f,u),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,!1)}static _drawMove(t){if(Oj.isSameTimeStamp(t.timeStamp),!e.#n)return;let{offsetX:n,offsetY:r,pointerId:i}=t;if(Oj.isSamePointerId(i)){if(Oj.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,e.#n.add(n,r)),Oj.setTimeStamp(t.timeStamp),nj(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,Oj.clearTimeStamp()),e.#r&&(e.#r.abort(),e.#r=null,Oj.clearPointerIds())}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),t?.target===n.div&&n.drawLayer.updateProperties(this._currentDrawId,e.#n.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){let t=e.#n,r=this._currentDrawId,i=t.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,t.setLastElement(i))},undo:()=>{n.drawLayer.updateProperties(r,t.removeLastElement())},mustExec:!1,type:Qk.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(Qk.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:e.#n.getOutlines(r*a,i*a,a,this._INNER_MARGIN),drawingOptions:e.#i,mustBeCommitted:!t});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,r,i,a){pA(`Not implemented`)}static async deserialize(e,t,n){let{rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}=t.viewport,s=this.deserializeDraw(a,o,r,i,this._INNER_MARGIN,e),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#a({drawOutlines:s}),c.#c(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this.#e.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},vF=class{#e=new Float64Array(6);#t;#n;#r;#i;#a;#o=``;#s=0;#c=new yF;#l;#u;constructor(e,t,n,r,i,a){this.#l=n,this.#u=r,this.#r=i,this.#i=a,[e,t]=this.#d(e,t);let o=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t],this.#n=[{line:o,points:this.#a}],this.#e.set(o,0)}updateProperty(e,t){e===`stroke-width`&&(this.#i=t)}#d(e,t){return $._normalizePoint(e,t,this.#l,this.#u,this.#r)}isEmpty(){return!this.#n||this.#n.length===0}isCancellable(){return this.#a.length<=10}add(e,t){[e,t]=this.#d(e,t);
433let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#l*o,this.#u*s)<=2?null:(this.#a.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#t.push(...$.createBezierPoints(n,r,i,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(this.#a.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,r,i){this.#l=n,this.#u=r,this.#r=i,[e,t]=this.#d(e,t);let a=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t];let o=this.#n.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#n.push({line:a,points:this.#a}),this.#e.set(a,0),this.#s=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(e){return this.#n?(this.#n.push(e),this.#t=e.line,this.#a=e.points,this.#s=0,{path:{d:this.toSVGPath()}}):this.#c.setLastElement(e)}removeLastElement(){if(!this.#n)return this.#c.removeLastElement();this.#n.pop(),this.#o=``;for(let e=0,t=this.#n.length;e<t;e++){let{line:t,points:n}=this.#n[e];this.#t=t,this.#a=n,this.#s=0,this.toSVGPath()}return{path:{d:this.#o}}}toSVGPath(){let e=$.svgRound(this.#t[4]),t=$.svgRound(this.#t[5]);if(this.#a.length===2)return this.#o=`${this.#o} M ${e} ${t} Z`,this.#o;if(this.#a.length<=6){let n=this.#o.lastIndexOf(`M`);this.#o=`${this.#o.slice(0,n)} M ${e} ${t}`,this.#s=6}if(this.#a.length===4){let e=$.svgRound(this.#t[10]),t=$.svgRound(this.#t[11]);return this.#o=`${this.#o} L ${e} ${t}`,this.#s=12,this.#o}let n=[];this.#s===0&&(n.push(`M ${e} ${t}`),this.#s=6);for(let e=this.#s,t=this.#t.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#t.slice(e,e+6).map($.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#o+=n.join(` `),this.#s=this.#t.length,this.#o}getOutlines(e,t,n,r){let i=this.#n.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#c.build(this.#n,e,t,n,this.#r,this.#i,r),this.#e=null,this.#t=null,this.#n=null,this.#o=null,this.#c}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},yF=class extends ${#e;#t=0;#n;#r;#i;#a;#o;#s;#c;build(e,t,n,r,i,a,o){this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a,this.#n=o??0,this.#r=e,this.#d()}get thickness(){return this.#c}setLastElement(e){return this.#r.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#r.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#r){if(e.push(`M${$.svgRound(t[4])} ${$.svgRound(t[5])}`),t.length===6){e.push(`Z`);continue}if(t.length===12&&isNaN(t[6])){e.push(`L${$.svgRound(t[10])} ${$.svgRound(t[11])}`);continue}for(let n=6,r=t.length;n<r;n+=6){let[r,i,a,o,s,c]=t.subarray(n,n+6).map($.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}}return e.join(``)}serialize([e,t,n,r],i){let a=[],o=[],[s,c,l,u]=this.#u(),d,f,p,m,h,g,_,v,y;switch(this.#s){case 0:y=$._rescale,d=e,f=t+r,p=n,m=-r,h=e+s*n,g=t+(1-c-u)*r,_=e+(s+l)*n,v=t+(1-c)*r;break;case 90:y=$._rescaleAndSwap,d=e,f=t,p=n,m=r,h=e+c*n,g=t+s*r,_=e+(c+u)*n,v=t+(s+l)*r;break;case 180:y=$._rescale,d=e+n,f=t,p=-n,m=r,h=e+(1-s-l)*n,g=t+c*r,_=e+(1-s)*n,v=t+(c+u)*r;break;case 270:y=$._rescaleAndSwap,d=e+n,f=t+r,p=-n,m=-r,h=e+(1-c-u)*n,g=t+(1-s-l)*r,_=e+(1-c)*n,v=t+(1-s)*r}for(let{line:e,points:t}of this.#r)a.push(y(e,d,f,p,m,i?Array(e.length):null)),o.push(y(t,d,f,p,m,i?Array(t.length):null));return{lines:a,points:o,rect:[h,g,_,v]}}static deserialize(e,t,n,r,i,{paths:{lines:a,points:o},rotation:s,thickness:c}){let l=[],u,d,f,p,m;switch(s){case 0:m=$._rescale,u=-e/n,d=t/r+1,f=1/n,p=-1/r;break;case 90:m=$._rescaleAndSwap,u=-t/r,d=-e/n,f=1/r,p=1/n;break;case 180:m=$._rescale,u=e/n+1,d=-t/r,f=-1/n,p=1/r;break;case 270:m=$._rescaleAndSwap,u=t/r+1,d=e/n+1,f=-1/r,p=-1/n}if(!a){a=[];for(let e of o){let t=e.length;if(t===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(t===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}let n=new Float32Array(3*(t-2));a.push(n);let[r,i,o,s]=e.subarray(0,4);n.set([NaN,NaN,NaN,NaN,r,i],0);for(let a=4;a<t;a+=2){let t=e[a],c=e[a+1];n.set($.createBezierPoints(r,i,o,s,t,c),(a-2)*3),[r,i,o,s]=[o,s,t,c]}}}for(let e=0,t=a.length;e<t;e++)l.push({line:m(a[e].map(e=>e??NaN),u,d,f,p),points:m(o[e].map(e=>e??NaN),u,d,f,p)});let h=new this.prototype.constructor;return h.build(l,n,r,1,s,c,i),h}#l(e=this.#c){let t=this.#n+e/2*this.#o;return this.#s%180==0?[t/this.#i,t/this.#a]:[t/this.#a,t/this.#i]}#u(){let[e,t,n,r]=this.#e,[i,a]=this.#l(0);return[e+i,t+a,n-2*i,r-2*a]}#d(){let e=this.#e=Kk.slice();for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6)Q.pointBoundingBox(t[n],t[n+1],e);continue}let n=t[4],r=t[5];for(let i=6,a=t.length;i<a;i+=6){let[a,o,s,c,l,u]=t.subarray(i,i+6);Q.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=VA(e[0]-t,0,1),e[1]=VA(e[1]-n,0,1),e[2]=VA(e[2]+t,0,1),e[3]=VA(e[3]+n,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e===`stroke-width`?this.#f(t):null}#f(e){let[t,n]=this.#l();this.#c=e;let[r,i]=this.#l(),[a,o]=[r-t,i-n],s=this.#e;return s[0]-=a,s[1]-=o,s[2]+=2*a,s[3]+=2*o,s}updateParentDimensions([e,t],n){let[r,i]=this.#l();this.#i=e,this.#a=t,this.#o=n;let[a,o]=this.#l(),s=a-r,c=o-i,l=this.#e;return l[0]-=s,l[1]-=c,l[2]+=2*s,l[3]+=2*c,l}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map($.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,n=0,r=0,i=0,a=0,o=0,s=0;switch(this.#t){case 90:r=t/e,i=-e/t,o=e;break;case 180:n=-1,a=-1,o=e,s=t;break;case 270:r=-t/e,i=e/t,s=t;break;default:return``}return`matrix(${n} ${r} ${i} ${a} ${$.svgRound(o)} ${$.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=$.PRECISION||Math.abs(l-a)<=$.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`,transform:`${this.rotationTransform} translate(${i} ${a})`}}}let u=(n-2*i)/(c-2*i),d=(r-2*a)/(l-2*a),f=c/n,p=l/r;return{path:{"transform-origin":`${$.svgRound(o)} ${$.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${$.svgRound(i)} ${$.svgRound(a)}) scale(${u} ${d}) translate(${$.svgRound(-i)} ${$.svgRound(-a)})`}}}getPathResizedSVGProperties([e,t,n,r]){let[i,a]=this.#l(),o=this.#e,[s,c,l,u]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=r,Math.abs(l-i)<=$.PRECISION||Math.abs(u-a)<=$.PRECISION){let i=e+n/2-(s+l/2),a=t+r/2-(c+u/2);for(let{line:e,points:t}of this.#r)$._translate(e,i,a,e),$._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let d=(n-2*i)/(l-2*i),f=(r-2*a)/(u-2*a),p=-d*(s+i)+e+i,m=-f*(c+a)+t+a;if(d!==1||f!==1||p!==0||m!==0)for(let{line:e,points:t}of this.#r)$._rescale(e,p,m,d,f,e),$._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){let[r,i]=n,a=this.#e,o=e-a[0],s=t-a[1];if(this.#i===r&&this.#a===i)for(let{line:e,points:t}of this.#r)$._translate(e,o,s,e),$._translate(t,o,s,t);else{let e=this.#i/r,t=this.#a/i;this.#i=r,this.#a=i;for(let{line:n,points:r}of this.#r)$._rescale(n,o,s,e,t,n),$._rescale(r,o,s,e,t,r);a[2]*=e,a[3]*=t}return a[0]=e,a[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${$.svgRound(e[0])} ${$.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},bF=class e extends gF{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:`none`,stroke:Rj._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":10})}updateSVGProperty(e,t){e===`stroke-width`&&(t??=this[`stroke-width`],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},xF=class e extends _F{static _type=`ink`;static _editorType=Z.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0,this.defaultL10nId=`pdfjs-editor-ink-editor`}static initialize(e,t){Rj.initialize(e,t),this._defaultDrawingOptions=new bF(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return yA(this,`typesMap`,new Map([[Qk.INK_THICKNESS,`stroke-width`],[Qk.INK_COLOR,`stroke`],[Qk.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance(e,t,n,r,i){return new vF(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return yF.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof $P){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,opacity:s,borderStyle:{rawWidth:c},popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},parent:{page:{pageNumber:m}}}=e;r=e={annotationType:Z.INK,color:Array.from(o),thickness:c,opacity:s,paths:{points:t},boxes:null,pageIndex:m-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}get toolbarButtons(){return this._colorPicker||=new CP(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return Qk.INK_COLOR}get colorAndOpacityType(){return Qk.INK_COLOR_AND_OPACITY}get opacityType(){return Qk.INK_OPACITY}updateParams(e,t){if(e===Qk.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(t.color,t.opacity);return}super.updateParams(e,t)}static updateDefaultParams(e,t){if(e===Qk.INK_COLOR_AND_OPACITY){super.updateDefaultParams(Qk.INK_COLOR,t.color),super.updateDefaultParams(Qk.INK_OPACITY,t.opacity);return}super.updateDefaultParams(e,t)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions[`stroke-opacity`]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty(`stroke-width`),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty(`stroke-width`),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:r}){this._drawingOptions=e.getDefaultDrawingOptions({stroke:Q.makeHexColor(...t),"stroke-width":n,"stroke-opacity":r})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":i,"stroke-width":a}}
433=this,o=Object.assign(super.serialize(e),{color:Rj._colorManager.convert(r),opacity:i,thickness:a,paths:{lines:t,points:n}});return this.addComment(o),e?(o.isCopy=!0,o):this.annotationElementId&&!this.#e(o)?null:(o.id=this.annotationElementId,o)}#e(e){let{color:t,thickness:n,opacity:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((e,n)=>e!==t[n])||e.thickness!==n||e.opacity!==r||e.pageIndex!==i}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions[`stroke-width`],points:t,popup:this.comment}),null}},SF=class extends yF{toSVGPath(){let e=super.toSVGPath();return e.endsWith(`Z`)||(e+=`Z`),e}},CF=8,wF=3,TF=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,r){return n-=e,r-=t,n===0?r>0?0:4:n===1?r+6:2-r}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#r(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(-i+s-o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#i(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(i+s+o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#a(e,t,n,r){let i=e.length,a=new Int32Array(i);for(let t=0;t<i;t++)a[t]=+(e[t]<=r);for(let e=1;e<n-1;e++)a[e*t]=a[e*t+t-1]=0;for(let e=0;e<t;e++)a[e]=a[t*n-1-e]=0;let o=1,s,c=[];for(let e=1;e<n-1;e++){s=1;for(let n=1;n<t-1;n++){let r=e*t+n,i=a[r];if(i===0)continue;let l=e,u=n;if(i===1&&a[r-1]===0)o+=1,--u;else if(i>=1&&a[r+1]===0)o+=1,u+=1,i>1&&(s=i);else{i!==1&&(s=Math.abs(i));continue}let d=[n,e],f=u===n+1,p={isHole:f,points:d,id:o,parent:0};c.push(p);let m;for(let e of c)if(e.id===s){m=e;break}p.parent=m?m.isHole?f?m.parent:s:f?s:m.parent:f?s:0;let h=this.#r(a,t,e,n,l,u,0);if(h===-1){a[r]=-o,a[r]!==1&&(s=Math.abs(a[r]));continue}let g=this.#n[2*h],_=this.#n[2*h+1],v=e+g,y=n+_;l=v,u=y;let b=e,x=n;for(;;){let i=this.#i(a,t,b,x,l,u,1);g=this.#n[2*i],_=this.#n[2*i+1];let c=b+g,f=x+_;d.push(f,c);let p=b*t+x;if(a[p+1]===0?a[p]=-o:a[p]===1&&(a[p]=o),c===e&&f===n&&b===v&&x===y){a[r]!==1&&(s=Math.abs(a[r]));break}l=b,u=x,b=c,x=f}}}return c}static#o(e,t,n,r){if(n-t<=4){for(let i=t;i<n-2;i+=2)r.push(e[i],e[i+1]);return}let i=e[t],a=e[t+1],o=e[n-4]-i,s=e[n-3]-a,c=Math.hypot(o,s),l=o/c,u=s/c,d=l*a-u*i,f=s/o,p=1/c,m=Math.atan(f),h=Math.cos(m),g=Math.sin(m),_=p*(Math.abs(h)+Math.abs(g)),v=p*(1-_+_**2),y=Math.max(Math.atan(Math.abs(g+h)*v),Math.atan(Math.abs(g-h)*v)),b=0,x=t;for(let r=t+2;r<n-2;r+=2){let t=Math.abs(d-l*e[r+1]+u*e[r]);t>b&&(x=r,b=t)}b>(c*y)**2?(this.#o(e,t,x+2,r),this.#o(e,x,n,r)):r.push(i,a)}static#s(e){let t=[],n=e.length;return this.#o(e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t}static#c(e,t,n,r,i,a){let o=new Float32Array(a**2),s=-2*r**2,c=a>>1;for(let e=0;e<a;e++){let t=(e-c)**2;for(let n=0;n<a;n++)o[e*a+n]=Math.exp((t+(n-c)**2)/s)}let l=new Float32Array(256),u=-2*i**2;for(let e=0;e<256;e++)l[e]=Math.exp(e**2/u);let d=e.length,f=new Uint8Array(d),p=new Uint32Array(256);for(let r=0;r<n;r++)for(let i=0;i<t;i++){let s=r*t+i,u=e[s],d=0,m=0;for(let s=0;s<a;s++){let f=r+s-c;if(!(f<0||f>=n))for(let n=0;n<a;n++){let r=i+n-c;if(r<0||r>=t)continue;let p=e[f*t+r],h=o[s*a+n]*l[Math.abs(p-u)];d+=p*h,m+=h}}let h=f[s]=Math.round(d/m);p[h]++}return[f,p]}static#l(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t}static#u(e){let t=e.length,n=new Uint8ClampedArray(t>>2),r=-1/0,i=1/0;for(let t=0,a=n.length;t<a;t++){let a=n[t]=e[t<<2];r=Math.max(r,a),i=Math.min(i,a)}let a=255/(r-i);for(let e=0,t=n.length;e<t;e++)n[e]=(n[e]-i)*a;return n}static#d(e){let t,n=-1/0,r=-1/0,i=e.findIndex(e=>e!==0),a=i,o=i;for(t=i;t<256;t++){let i=e[t];i>n&&(t-a>r&&(r=t-a,o=t-1),n=i,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#f(e){let t=e,{width:n,height:r}=e,{maxDim:i}=this.#e,a=n,o=r;if(n>i||r>i){let s=n,c=r,l=Math.log2(Math.max(n,r)/i),u=Math.floor(l);l=l===u?u-1:u;for(let n=0;n<l;n++){a=Math.ceil(s/2),o=Math.ceil(c/2);let n=new OffscreenCanvas(a,o);n.getContext(`2d`).drawImage(e,0,0,s,c,0,0,a,o),s=a,c=o,e!==t&&e.close(),e=n.transferToImageBitmap()}let d=Math.min(i/a,i/o);a=Math.round(a*d),o=Math.round(o*d)}let s=new OffscreenCanvas(a,o).getContext(`2d`,{willReadFrequently:!0});s.fillStyle=`white`,s.fillRect(0,0,a,o),s.filter=`grayscale(1)`,s.drawImage(e,0,0,e.width,e.height,0,0,a,o);let c=s.getImageData(0,0,a,o).data;return[this.#u(c),a,o]}static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:r},i,a,o,s){let c=new OffscreenCanvas(1,1),l=c.getContext(`2d`,{alpha:!1}),u=l.font=`${n} ${r} 200px ${t}`,{actualBoundingBoxLeft:d,actualBoundingBoxRight:f,actualBoundingBoxAscent:p,actualBoundingBoxDescent:m,fontBoundingBoxAscent:h,fontBoundingBoxDescent:g,width:_}=l.measureText(e),v=1.5,y=Math.ceil(Math.max(Math.abs(d)+Math.abs(f)||0,_)*v),b=Math.ceil(Math.max(Math.abs(p)+Math.abs(m)||200,Math.abs(h)+Math.abs(g)||200)*v);c=new OffscreenCanvas(y,b),l=c.getContext(`2d`,{alpha:!0,willReadFrequently:!0}),l.font=u,l.filter=`grayscale(1)`,l.fillStyle=`white`,l.fillRect(0,0,y,b),l.fillStyle=`black`,l.fillText(e,y*.5/2,b*1.5/2);let x=this.#u(l.getImageData(0,0,y,b).data),S=this.#l(x),C=this.#d(S),w=this.#a(x,y,b,C);return this.processDrawnLines({lines:{curves:w,width:y,height:b},pageWidth:i,pageHeight:a,rotation:o,innerMargin:s,mustSmooth:!0,areContours:!0})}static process(e,t,n,r,i){let[a,o,s]=this.#f(e),[c,l]=this.#c(a,o,s,Math.hypot(o,s)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),u=this.#d(l),d=this.#a(c,o,s,u);return this.processDrawnLines({lines:{curves:d,width:o,height:s},pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:a,areContours:o}){r%180!=0&&([t,n]=[n,t]);let{curves:s,width:c,height:l}=e,u=e.thickness??0,d=[],f=Math.min(t/c,n/l),p=f/t,m=f/n,h=[];for(let{points:e}of s){let t=a?this.#s(e):e;if(!t)continue;h.push(t);let n=t.length,r=new Float32Array(n),i=new Float32Array(3*(n===2?2:n-2));if(d.push({line:i,points:r}),n===2){r[0]=t[0]*p,r[1]=t[1]*m,i.set([NaN,NaN,NaN,NaN,r[0],r[1]],0
433);continue}let[o,s,c,l]=t;o*=p,s*=m,c*=p,l*=m,r.set([o,s,c,l],0),i.set([NaN,NaN,NaN,NaN,o,s],0);for(let e=4;e<n;e+=2){let n=r[e]=t[e]*p,a=r[e+1]=t[e+1]*m;i.set($.createBezierPoints(o,s,c,l,n,a),(e-2)*3),[o,s,c,l]=[c,l,n,a]}}if(d.length===0)return null;let g=o?new SF:new yF;return g.build(d,t,n,1,r,o?0:u,i),{outline:g,newCurves:h,areContours:o,thickness:u,width:c,height:l}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:r,height:i}){let a=1/0,o=-1/0,s=0;for(let t of e){s+=t.length;for(let e=2,n=t.length;e<n;e++){let n=t[e]-t[e-2];a=Math.min(a,n),o=Math.max(o,n)}}let c;c=a>=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;let l=e.length,u=CF+wF*l,d=new Uint32Array(u),f=0;d[f++]=u*Uint32Array.BYTES_PER_ELEMENT+(s-2*l)*c.BYTES_PER_ELEMENT,d[f++]=0,d[f++]=r,d[f++]=i,d[f++]=+!t,d[f++]=Math.max(0,Math.floor(n??0)),d[f++]=l,d[f++]=c.BYTES_PER_ELEMENT;for(let t of e)d[f++]=t.length-2,d[f++]=t[0],d[f++]=t[1];let p=new CompressionStream(`deflate-raw`),m=p.writable.getWriter();await m.ready,m.write(d);let h=c.prototype.constructor;for(let t of e){let e=new h(t.length-2);for(let n=2,r=t.length;n<r;n++)e[n-2]=t[n]-t[n-2];m.write(e)}return m.close(),(await new Response(p.readable).bytes()).toBase64()}static async decompressSignature(e){try{let t=Uint8Array.fromBase64(e),{readable:n,writable:r}=new DecompressionStream(`deflate-raw`),i=r.getWriter();await i.ready,i.write(t).then(async()=>{await i.ready,await i.close()}).catch(()=>{});let a=null,o=0;for await(let e of n)a||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),a.set(e,o),o+=e.length;let s=new Uint32Array(a.buffer,0,a.length>>2),c=s[1];if(c!==0)throw Error(`Invalid version: ${c}`);let l=s[2],u=s[3],d=s[4]===0,f=s[5],p=s[6],m=s[7],h=[],g=(CF+wF*p)*Uint32Array.BYTES_PER_ELEMENT,_;switch(m){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(a.buffer,g);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(a.buffer,g);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(a.buffer,g)}o=0;for(let e=0;e<p;e++){let t=s[wF*e+CF],n=new Float32Array(t+2);h.push(n);for(let t=0;t<2;t++)n[t]=s[wF*e+CF+t+1];for(let e=0;e<t;e++)n[e+2]=n[e]+_[o++]}return{areContours:d,thickness:f,outlines:h,width:l,height:u}}catch(e){return fA(`decompressSignature: ${e}`),null}}},EF=class e extends gF{constructor(){super(),super.updateProperties({fill:Rj._defaultLineColor,"stroke-width":0})}clone(){let t=new e;return t.updateAll(this),t}},DF=class e extends bF{constructor(e){super(e),super.updateProperties({stroke:Rj._defaultLineColor,"stroke-width":1})}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},OF=class e extends _F{#e=!1;#t=null;#n=null;#r=null;static _type=`signature`;static _editorType=Z.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:`signatureEditor`}),this._willKeepAspectRatio=!0,this.#n=e.signatureData||null,this.#t=null,this.defaultL10nId=`pdfjs-editor-signature-editor1`}static initialize(e,t){Rj.initialize(e,t),this._defaultDrawingOptions=new EF,this._defaultDrawnSignatureOptions=new DF(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return yA(this,`typesMap`,new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:`signature`,hasDescription:!!this.#t}}static computeTelemetryFinalData(e){let t=e.get(`hasDescription`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n,{_isCopy:r}=this;if(r&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null)if(this.#n){let{lines:t,mustSmooth:n,areContours:r,description:i,uuid:a,heightInPage:o}=this.#n,{rawDims:{pageWidth:s,pageHeight:c},rotation:l}=this.parent.viewport,u=TF.processDrawnLines({lines:t,pageWidth:s,pageHeight:c,rotation:l,innerMargin:e._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(u,o,i,a)}else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:``})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:this.#t||``}));return r&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(e){this.#r=e,this.addEditToolbar()}getUuid(){return this.#r}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:t,thickness:n,width:r,height:i}
433=this.#n,a=Math.max(r,i);return{areContours:t,outline:TF.processDrawnLines({lines:{curves:e.map(e=>({points:e})),thickness:n,width:r,height:i},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[[`editSignature`,this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,r,i){let{x:a,y:o}=this,{outline:s}=this.#n=t;this.#e=s instanceof SF,this.description=r;let c;this.#e?c=e.getDefaultDrawingOptions():(c=e._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":s.thickness})),this._addOutlines({drawOutlines:s,drawingOptions:c});let[,l]=this.pageDimensions,u=n/l;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:`pdfjs.signature.inserted`,data:{hasBeenSaved:!!i,hasDescription:!!r}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return TF.process(t,n,r,i,e._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:r,pageHeight:i},rotation:a}=this.parent.viewport;return TF.extractContoursFromText(t,n,r,i,a,e._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return TF.processDrawnLines({lines:t,pageWidth:n,pageHeight:r,rotation:i,innerMargin:e._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=e.getDefaultDrawingOptions():(this._drawingOptions=e._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,i=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:r});return this.addComment(i),e?(i.paths={lines:t,points:n},i.uuid=this.#r,i.isCopy=!0):i.lines=t,this.#t&&(i.accessibilityData={type:`Figure`,alt:this.#t}),i}static deserializeDraw(e,t,n,r,i,a){return a.areContours?SF.deserialize(e,t,n,r,i,a):yF.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=await super.deserialize(e,t,n);return r.#e=e.areContours,r.description=e.accessibilityData?.alt||``,r.#r=e.uuid,r}},kF=class extends Rj{#e=null;#t=null;#n=null;#r=null;#i=null;#a=``;#o=null;#s=!1;#c=null;#l=!1;#u=!1;static _type=`stamp`;static _editorType=Z.STAMP;constructor(e){super({...e,name:`stampEditor`}),this.#r=e.bitmapUrl,this.#i=e.bitmapFile,this.defaultL10nId=`pdfjs-editor-stamp-editor`}static initialize(e,t){Rj.initialize(e,t)}static isHandlingMimeForPasting(e){return pj.includes(e)}static paste(e,t){t.pasteEditor({mode:Z.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:`stamp`,hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get(`hasAltText`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#d(e,t=!1){if(!e){this.remove();return}this.#e=e.bitmap,t||(this.#t=e.id,this.#l=e.isSvg),e.file&&(this.#a=e.file.name),this.#m()}#f(){if(this.#n=null,this._uiManager.enableWaiting(!1),this.#o){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:`pdfjs.image.image_added`,data:{alt_text_modal:!1,alt_text_type:`empty`}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw Error(`No ML.`);if(!await n.isEnabledFor(`altText`))throw Error(`ML isn't enabled for alt text.`);let{data:r,width:i,height:a}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:`altText`,request:{data:r,width:i,height:a,channels:r.length/(i*a)}});if(!o)throw Error(`No response from the AI service.`);if(o.error)throw Error(`Error from the AI service.`);
433if(o.cancel)return null;if(!o.output)throw Error(`No valid response from the AI service.`);let s=o.output;return await this.setGuessedAltText(s),t&&!this.hasAltTextData()&&(this.altTextData={alt:s,decorative:!1}),s}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#d(e,!0)).finally(()=>this.#f());return}if(this.#r){let e=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#d(e)).finally(()=>this.#f());return}if(this.#i){let e=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(e).then(e=>this.#d(e)).finally(()=>this.#f());return}let e=document.createElement(`input`);e.type=`file`,e.accept=pj.join(`,`);let t=this._uiManager._signal;this.#n=new Promise(n=>{e.addEventListener(`change`,async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:`pdfjs.image.image_selected`,data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#d(t)}n()},{signal:t}),e.addEventListener(`cancel`,()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#f()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#o?.remove(),this.#o=null,this.#c&&=(clearTimeout(this.#c),null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#o===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#i||this.#t||this.#s)}get toolbarButtons(){return[[`altText`,this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#s||(this.#e?this.#m():this.#p()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){let{id:n,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(this.#t=n,r&&(this.#e=r),this.#s=!1,this.#m())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>{this.#c=null,this.#g()},200))}#m(){let{div:e}=this,{width:t,height:n}=this.#e,[r,i]=this.pageDimensions,a=.75;if(this.width)t=this.width*r,n=this.height*i;else if(t>a*r||n>a*i){let e=Math.min(a*r/t,a*i/n);t*=e,n*=e}this._uiManager.enableWaiting(!1);let o=this.#o=document.createElement(`canvas`);o.setAttribute(`role`,`img`),this.addContainer(o),this.width=t/r,this.height=n/i,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#g(),this.#u||=(this.parent.addUndoableEditor(this),!0),this._reportTelemetry({action:`inserted_image`}),this.#a&&this.div.setAttribute(`aria-description`,this.#a),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-stamp-added-alert`)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new fj,o=this.#e,s=r,c=i,l=null;if(t){if(r>t||i>t){let e=Math.min(t/r,t/i);s=Math.floor(r*e),c=Math.floor(i*e)}l=document.createElement(`canvas`);let e=l.width=Math.ceil(s*a.sx),n=l.height=Math.ceil(c*a.sy);this.#l||(o=this.#h(e,n));let u=l.getContext(`2d`);u.filter=this._uiManager.hcmFilter;let d=`white`,f=`#cfcfd8`;this._uiManager.hcmFilter===`none`?mj.isDarkMode&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(p*2,m*2),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,p*2,m*2),g.fillStyle=f,g.fillRect(0,0,p,m),g.fillRect(p,m,p,m),u.fillStyle=u.createPattern(h,`repeat`),u.fillRect(0,0,e,n),u.drawImage(o,0,0,o.width,o.height,0,0,e,n)}let u=null;if(n){let t,n;if(a.symmetric&&o.width<e&&o.height<e)t=o.width,n=o.height;else if(o=this.#e,r>e||i>e){let a=Math.min(e/r,e/i);
433t=Math.floor(r*a),n=Math.floor(i*a),this.#l||(o=this.#h(t,n))}let s=new OffscreenCanvas(t,n).getContext(`2d`,{willReadFrequently:!0});s.drawImage(o,0,0,o.width,o.height,0,0,t,n),u={width:t,height:n,data:s.getImageData(0,0,t,n).data}}return{canvas:l,width:s,height:c,imageData:u}}#h(e,t){let{width:n,height:r}=this.#e,i=n,a=r,o=this.#e;for(;i>2*e||a>2*t;){let n=i,r=a;i>2*e&&(i=Math.ceil(i/2)),a>2*t&&(a=Math.ceil(a/2));let s=new OffscreenCanvas(i,a);s.getContext(`2d`).drawImage(o,0,0,n,r,0,0,i,a),o=s.transferToImageBitmap()}return o}#g(){let[e,t]=this.parentDimensions,{width:n,height:r}=this,i=new fj,a=Math.ceil(n*e*i.sx),o=Math.ceil(r*t*i.sy),s=this.#o;if(!s||s.width===a&&s.height===o)return;s.width=a,s.height=o;let c=this.#l?this.#e:this.#h(a,o),l=s.getContext(`2d`);l.filter=this._uiManager.hcmFilter,l.drawImage(c,0,0,c.width,c.height,0,0,a,o)}#_(e){if(e){if(this.#l){let e=this._uiManager.imageManager.getSvgUrl(this.#t);if(e)return e}let e=document.createElement(`canvas`);return{width:e.width,height:e.height}=this.#e,e.getContext(`2d`).drawImage(this.#e,0,0),e.toDataURL()}if(this.#l){let[e,t]=this.pageDimensions,n=Math.round(this.width*e*GA.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*GA.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext(`2d`).drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,n,r),i.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let r=null,i=!1;if(e instanceof iF){let{data:{rect:a,rotation:o,id:s,structParent:c,popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},container:m,parent:{page:{pageNumber:h}},canvas:g}=e,_,v;g?(delete e.canvas,{id:_,bitmap:v}=n.imageManager.getFromCanvas(m.id,g),g.remove()):(i=!0,e._hasNoCanvas=!0);let y=(await t._structTree.getAriaAttributes(`${IA}${s}`))?.get(`aria-label`)||``;r=e={annotationType:Z.STAMP,bitmapId:_,bitmap:v,pageIndex:h-1,rect:a.slice(0),rotation:o,annotationElementId:s,id:s,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:c,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let a=await super.deserialize(e,t,n),{rect:o,bitmap:s,bitmapUrl:c,bitmapId:l,isSvg:u,accessibilityData:d}=e;i?(n.addMissingCanvas(e.id,a),a.#s=!0):l&&n.imageManager.isValidId(l)?(a.#t=l,s&&(a.#e=s)):a.#r=c,a.#l=u;let[f,p]=a.pageDimensions;return a.width=(o[2]-o[0])/f,a.height=(o[3]-o[1])/p,d&&(a.altTextData=d),a._initialData=r,e.comment&&a.setCommentData(e),a.#u=!!r,a}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=Object.assign(super.serialize(e),{bitmapId:this.#t,isSvg:this.#l});if(this.addComment(n),e)return n.bitmapUrl=this.#_(!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;let{decorative:r,altText:i}=this.serializeAltText(!1);if(!r&&i&&(n.accessibilityData={type:`Figure`,alt:i}),this.annotationElementId){let e=this.#v(n);return e.isSame?null:(e.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1,n.id=this.annotationElementId,delete n.bitmapId,n)}if(t===null)return n;t.stamps||=new Map;let a=this.#l?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:a,serialized:n}),n.bitmap=this.#_(!1);else if(this.#l){let e=t.stamps.get(this.#t);a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=this.#_(!1))}return n}#v(e){let{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,r=e.pageIndex===t,i=(e.accessibilityData?.alt||``)===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&i,isSameAltText:i}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},AF=class e{#e;#t=!1;#n=null;#r=null;#i=null;#a=new Map;#o=!1;#s=!1;#c=!1;#l=null;#u=null;#d=null;#f=null;#p=null;#m=-1;#h;static _initialized=!1;static#g=new Map([cF,xF,kF,hF,OF].map(e=>[e._editorType,e]));constructor({uiManager:t,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:a,annotationLayer:o,drawLayer:s,textLayer:c,viewport:l,l10n:u}){let d=[...e.#g.values()];if(!e._initialized){e._initialized=!0;for(let e of d)e.initialize(u,t)}
433t.registerEditorTypes(d),this.#h=t,this.pageIndex=n,this.div=r,this.#e=a,this.#n=o,this.viewport=l,this.#d=c,this.drawLayer=s,this._structTree=i,this.#h.addLayer(this)}get isEmpty(){return this.#a.size===0}get isInvisible(){return this.isEmpty&&this.#h.getMode()===Z.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(t=this.#h.getMode()){switch(this.#S(),t){case Z.NONE:this.div.classList.toggle(`nonEditing`,!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Z.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Z.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:n}=this.div;if(n.toggle(`nonEditing`,!1),t===Z.POPUP)n.toggle(`commentEditing`,!0);else{n.toggle(`commentEditing`,!1);for(let r of e.#g.values())n.toggle(`${r._type}Editing`,t===r._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===this.#d?.div}setEditingState(e){this.#h.setEditingState(e)}addCommands(e){this.#h.addCommands(e)}cleanUndoStack(e){this.#h.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle(`drawing`,!e)}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.togglePointerEvents(e)}get#_(){return this.#a.size===0?this.#h.getEditors(this.pageIndex):this.#a.values()}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle(`nonEditing`,!1),this.#p?.abort(),this.#p=null;let e=new Set;for(let t of this.#_)t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#h.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));let t=this.#n;if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),this.#h.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}this.#c=!1,this.#h._eventBus.dispatch(`editorsrendered`,{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#s=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle(`nonEditing`,!0),this.#d&&!this.#p){this.#p=new AbortController;let e=this.#h.combinedSignal(this.#p);this.#d.div.addEventListener(`pointerdown`,e=>{let{clientX:t,clientY:n,timeStamp:r}=e;if(r-this.#m>500){this.#m=r;return}this.#m=-1;let{classList:i}=this.div;i.toggle(`getElements`,!0);let a=document.elementsFromPoint(t,n);if(i.toggle(`getElements`,!1),!this.div.contains(a[0]))return;let o,s=RegExp(`^${Zk}[0-9]+$`);for(let e of a)if(s.test(e.id)){o=e.id;break}if(!o)return;let c=this.#a.get(o);c?.annotationElementId===null&&(nj(e),c.dblclick(e))},{signal:e,capture:!0})}let t=this.#n,n=[];if(t){let e=new Map,r=new Map;for(let t of this.#_){if(t.disableEditing(),!t.annotationElementId){n.push(t);continue}if(t.serialize()!==null){e.set(t.annotationElementId,t);continue}r.set(t.annotationElementId,t),this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()}for(let n of t.getEditableAnnotations()){let{id:t}=n.data;if(this.#h.isDeletedAnnotationElement(t)){n.updateEdited({deleted:!0});continue}let i=r.get(t);if(i){i.resetAnnotationElement(n),i.show(!1),n.show();continue}i=e.get(t),i&&(this.#h.addChangedExistingAnnotation(i),i.renderAnnotationElement(n)&&i.show(!1)),n.show()}}this.#S(),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let t of e.#g.values())r.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(n),this.#s=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#h.getActive()!==e&&this.#h.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;let e=this.#h.combinedSignal(this.#f);this.#d.div.addEventListener(`pointerdown`,this.#v.bind(this),{signal:e}),this.#d.div.classList.add(`highlighting`)}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove(`highlighting`))}#v(e){this.#h.unselectAll();let{target:t}=e;if(t===this.#d.div||(t.getAttribute(`role`)===`img`||t.classList.contains(`endOfContent`)||t.classList.contains(`textLayerImagePlaceholder`))&&this.#d.div.contains(t)){let{isMac:t}=AA.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#h.showAllEditors(`highlight`,!0,!0),this.#d.div.classList.add(`free`),this.toggleDrawing(),hF.startHighlighting(this,this.#h.direction===`ltr`,{target:this.#d.div,x:e.x,y:e.y}),this.#d.div.addEventListener(`pointerup`,()=>{this.#d.div.classList.remove(`free`),this.toggleDrawing(!0)},{once:!0,signal:this.#h._signal}),e.preventDefault()}}enableClick(){if(this.#r)return;this.#r=new AbortController;let e=this.#h.combinedSignal(this.#r);this.div.addEventListener(`pointerdown`,this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener(`pointerup`,t,{signal:e}),this.div.addEventListener(`pointercancel`,t,{signal:e})}disableClick(){this.#r?.abort(),this.#r=null}attach(e){this.#a.set(e.id,e);let{annotationElementId:t}=e;t&&this.#h.isDeletedAnnotationElement(t)&&this.#h.removeDeletedAnnotationElement(e)}detach(e){this.#a.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#s&&e.annotationElementId&&this.#h.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#h.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#h.addDeletedAnnotationElement(e),Rj.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}
433add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#h.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#c),this.#h.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#i&&(e._focusEventsAllowed=!1,this.#i=setTimeout(()=>{this.#i=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#h._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getEditorByUID(e){for(let t of this.#a.values())if(t.uid===e)return t;return null}get#y(){return e.#g.get(this.#h.getMode())}combinedSignal(e){return this.#h.combinedSignal(e)}#b(e){let t=this.#y;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#h.updateMode(e.mode);let{offsetX:n,offsetY:r}=this.#x(),i=this.#h.getId(),a=this.#b({parent:this,id:i,x:n,y:r,uiManager:this.#h,isCentered:!0,...t});a&&this.add(a)}async deserialize(t){return await e.#g.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#h)||null}createAndAddNewEditor(e,t,n={}){let r=this.#h.getId(),i=this.#b({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#h,isCentered:t,...n});return i&&this.add(i),i}get boundingClientRect(){return this.div.getBoundingClientRect()}#x(){let{x:e,y:t,width:n,height:r}=this.boundingClientRect,i=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),s=Math.min(window.innerHeight,t+r),c=(i+o)/2-e,l=(a+s)/2-t,[u,d]=this.viewport.rotation%180==0?[c,l]:[l,c];return{offsetX:u,offsetY:d}}addNewEditor(e={}){this.createAndAddNewEditor(this.#x(),!0,e)}setSelected(e){this.#h.setSelected(e)}toggleSelected(e){this.#h.toggleSelected(e)}unselect(e){this.#h.unselect(e)}pointerup(e){let{isMac:t}=AA.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!this.#o||(this.#o=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}let n=this.#h.getMode();if(n===Z.STAMP||n===Z.POPUP||n===Z.SIGNATURE){this.#h.unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(this.#h.getMode()===Z.HIGHLIGHT&&this.enableTextSelection(),this.#o){this.#o=!1;return}let{isMac:t}=AA.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer){this.startDrawingSession(e);return}let n=this.#h.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l){this.#y.startDrawing(this,this.#h,!1,e);return}this.#h.setCurrentDrawingSession(this),this.#l=new AbortController;let t=this.#h.combinedSignal(this.#l);this.div.addEventListener(`blur`,({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#u=null,this.commitOrRemove())},{signal:t}),this.#y.startDrawing(this,this.#h,!1,e)}pause(e){if(e){let{activeElement:e}=document;this.div.contains(e)&&(this.#u=e);return}this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(e=!1){return this.#l?(this.#h.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#y.endDrawing(e)):null}findNewParent(e,t,n){let r=this.#h.findParent(t,n);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#h.getActive()?.parent===this&&(this.#h.commitOrRemove(),this.#h.setActiveEditor(null)),this.#i&&=(clearTimeout(this.#i),null);for(let e of this.#a.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#a.clear(),this.#h.removeLayer(this)}#S(){for(let e of this.#a.values())e.isEmpty()&&e.remove()}async render({viewport:e}){this.viewport=e,dj(this.div,e);for(let e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();await this.#h.findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#S();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,dj(this.div,{rotation:n}),t!==n)for(let e of this.#a.values())e.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#h.viewParameters.realScale}},jF=class e{#e=null;#t=new Map;#n=new Map;static#r=0;setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#t.size>0)for(let t of this.#t.values())t.remove(),e.append(t);this.#e=e}}static get _svgFactory(){return yA(this,`_svgFactory`,new OP)}static#i(e,[t,n,r,i]){let{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*r}%`,a.height=`${100*i}%`}#a(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,!0),t}#o(t,n){let r=e._svgFactory.createElement(`clipPath`);t.append(r);let i=`clip_${n}`;r.setAttribute(`id`,i),r.setAttribute(`clipPathUnits`,`objectBoundingBox`);let a=e._svgFactory.createElement(`use`);return r.append(a),a.setAttribute(`href`,`#${n}`),a.classList.add(`clip`),i}#s(e,t){for(let[n,r]of Object.entries(t))r===null?e.removeAttribute(n):e.setAttribute(n,r)}draw(t,n=!1,r=!1){let i=e.#r++,a=this.#a(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#n.set(i,s);let l=r?this.#o(o,c):null,u=e._svgFactory.createElement(`use`);return a.append(u),u.setAttribute(`href`,`#${c}`),this.updateProperties(a,t),this.#t.set(i,a),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,n){let r=e.#r++,i=this.#a(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_${r}`;o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`);let c;if(n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_${r}`,t.setAttribute(`id`,c),t.setAttribute(`maskUnits`,`objectBoundingBox`);let n=e._svgFactory.createElement(`rect`);t.append(n),n.setAttribute(`width`,`1`),n.setAttribute(`height`,`1`),n.setAttribute(`fill`,`white`);let i=e._svgFactory.createElement(`use`);t.append(i),i.setAttribute(`href`,`#${s}`),i.setAttribute(`stroke`,`none`),i.setAttribute(`fill`,`black`),i.setAttribute(`fill-rule`,`nonzero`),i.classList.add(`mask`)}let l=e._svgFactory.createElement(`use`);i.append(l),l.setAttribute(`href`,`#${s}`),c&&l.setAttribute(`mask`,`url(#${c})`);let u=l.cloneNode();return i.append(u),l.classList.add(`mainOutline`),u.classList.add(`secondaryOutline`),this.updateProperties(i,t),this.#t.set(r,i),r}finalizeDraw(e,t){this.#n.delete(e),this.updateProperties(e,t)}updateProperties(t,n){if(!n)return;let{root:r,bbox:i,rootClass:a,path:o}=n,s=typeof t==`number`?this.#t.get(t):t;if(s){if(r&&this.#s(s,r),i&&e.#i(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstElementChild.firstElementChild;this.#s(e,o)}}}updateParent(e,t){if(t===this)return;let n=this.#t.get(e);n&&(t.#e.append(n),this.#t.delete(e),t.#t.set(e,n))}remove(e){this.#n.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(let e of this.#t.values())e.remove();this.#t.clear(),this.#n.clear()}};function MF(e){return`${(e*100).toFixed(2)}%`}var NF=class e{#e=[];#t=new Map;#n=null;#r=0;#i=0;#a=0;static#o=null;constructor(e,t,n,r){this.#r=e,this.#e=t,this.#i=n.rawDims.pageWidth,this.#a=n.rawDims.pageHeight,this.#n=r}render(){let t=document.createElement(`div`);t.className=`textLayerImages`;for(let e=0;e<this.#e.length;e+=6){let n=this.#s(this.#e.subarray(e,e+6));n&&t.append(n)}return t.addEventListener(`contextmenu`,t=>{if(!(t.target instanceof HTMLCanvasElement))return;let n=t.target,r=this.#t.get(n);if(!r)return;let i=e.#o?.deref();if(i===n)return;i&&(i.width=0,i.height=0),e.#o=new WeakRef(n);let{inverseTransform:a,x1:o,y1:s,width:c,height:l}=r,u=this.#n(),d=Math.ceil(o*u.width),f=Math.ceil(s*u.height),p=Math.floor((o+c/this.#i)*u.width),m=Math.floor((s+l/this.#a)*u.height);n.width=p-d,n.height=m-f;let h=n.getContext(`2d`);h.setTransform(...a),h.translate(-d,-f),h.drawImage(u,0,0)}),t}#s([e,t,n,r,i,a]){let o=Math.hypot((i-e)*this.#i,(a-t)*this.#a),s=Math.hypot((n-e)*this.#i,(r-t)*this.#a);if(o<this.#r||s<this.#r)return null;
433let c=[(i-e)*this.#i/o,(a-t)*this.#a/o,(n-e)*this.#i/s,(r-t)*this.#a/s,0,0],l=Q.inverseTransform(c),u=document.createElement(`canvas`);return u.className=`textLayerImagePlaceholder`,u.width=0,u.height=0,Object.assign(u.style,{opacity:0,position:`absolute`,left:MF(e),top:MF(t),width:MF(o/this.#i),height:MF(s/this.#a),transformOrigin:`0% 0%`,transform:`matrix(${c.join(`,`)})`}),this.#t.set(u,{inverseTransform:l,width:o,height:s,x1:e,y1:t}),u}};globalThis._pdfjsTestingUtils={HighlightOutliner:dF},globalThis.pdfjsLib={AbortException:EA,AnnotationEditorLayer:AF,AnnotationEditorParamsType:Qk,AnnotationEditorType:Z,AnnotationEditorUIManager:Pj,AnnotationLayer:oF,AnnotationMode:Xk,AnnotationType:nA,applyOpacity:gj,build:xP,ColorPicker:SP,createValidAbsoluteUrl:gA,CSSConstants:hj,DOMSVGFactory:OP,DrawLayer:jF,FeatureTest:AA,fetchData:KA,findContrastColor:Sj,getDocument:dP,getFilenameFromUrl:ZA,getPdfFilenameFromUrl:QA,getRGB:sj,getRGBA:oj,getUuid:FA,getXfaPageViewport:aj,GlobalWorkerOptions:QN,ImageKind:tA,InvalidPDFException:CA,isDataScheme:YA,isPdfFile:XA,isValidExplicitDest:bM,makeArr:RA,makeMap:zA,makeObj:BA,MathClamp:VA,noContextMenu:tj,normalizeUnicode:PA,OPS:aA,OutputScale:fj,PasswordResponses:sA,PDFDataRangeTransport:pP,PDFDateString:ij,PDFWorker:gP,PermissionFlag:$k,PixelsPerInch:GA,RenderingCancelledException:JA,renderRichText:Cj,ResponseException:wA,setLayerDimensions:dj,shadow:yA,SignatureExtractor:TF,stopEvent:nj,SupportedImageMimeTypes:pj,TextLayer:lP,TextLayerImages:NF,TouchManager:Lj,updateUrlHash:_A,Util:Q,VerbosityLevel:iA,version:bP,XfaLayer:UA};var PF=o(((e,t)=>{function n(e,t){return function(){return e.apply(t,arguments)}}var{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:a,toStringTag:o}=Symbol,s=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=(e,t)=>{let n=e,r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),s(n,t))return!0;n=i(n)}return!1},l=(e,t)=>
433e!=null&&c(e,t)?e[t]:void 0,u=(e=>t=>{let n=r.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),d=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:p}=Array,m=f(`undefined`);function h(e){return e!==null&&!m(e)&&e.constructor!==null&&!m(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var g=d(`ArrayBuffer`);function _(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t}var v=f(`string`),y=f(`function`),b=f(`number`),x=e=>typeof e==`object`&&!!e,S=e=>e===!0||e===!1,C=e=>{if(!x(e))return!1;let t=i(e);return(t===null||t===Object.prototype||i(t)===null)&&!c(e,o)&&!c(e,a)},w=e=>{if(!x(e)||h(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},T=d(`Date`),E=d(`File`),D=e=>!!(e&&e.uri!==void 0),O=e=>e&&e.getParts!==void 0,k=d(`Blob`),A=d(`FileList`),j=d(`Set`),M=e=>x(e)&&y(e.pipe);function N(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var P=N(),ee=P.FormData===void 0?void 0:P.FormData,te=e=>{if(!e)return!1;if(ee&&e instanceof ee)return!0;let t=i(e);if(!t||t===Object.prototype||!y(e.append))return!1;let n=u(e);return n===`formdata`||n===`object`&&y(e.toString)&&e.toString()===`[object FormData]`},ne=d(`URLSearchParams`),[F,re,ie,I]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(d),ae=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function oe(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),p(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(h(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function se(e,t){if(h(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-->0;)if(i=n[r],t===i.toLowerCase())return i;return null}var ce=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,le=e=>!m(e)&&e!==ce;function ue(...e){let{caseless:t,skipUndefined:n}=le(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&se(r,i)||i,o=s(r,a)?r[a]:void 0;C(o)&&C(e)?r[a]=ue(o,e):C(e)?r[a]=ue({},e):p(e)?r[a]=e.slice():(!n||!m(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!n||h(n)||(oe(n,i),typeof n!=`object`||p(n)))continue;let r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){let t=r[e];Se.call(n,t)&&i(n[t],t)}}return r}var de=(e,t,r,{allOwnKeys:i}={})=>(oe(t,(t,i)=>{r&&y(t)?Object.defineProperty(e,i,{__proto__:null,value:n(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),fe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},me=(e,t,n,r)=>{let a,o,s,c={};if(t||={},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-->0;)s=a[o],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},he=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},ge=e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!b(t))return null;let n=Array(t);for(;t-->0;)n[t]=e[t];return n},_e=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&i(Uint8Array)),ve=(e,t)=>{let n=(e&&e[a]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},ye=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},be=d(`HTMLFormElement`),xe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:Se}=Object.prototype,Ce=d(`RegExp`),we=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};oe(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Te=e=>{we(e,(t,n)=>{if(y(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(y(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Ee=(e,t)=>{let n={},r=e=>
433{e.forEach(e=>{n[e]=!0})};return p(e)?r(e):r(String(e).split(t)),n},De=()=>{},Oe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ke(e){return!!(e&&y(e.append)&&e[o]===`FormData`&&e[a])}var Ae=e=>{let t=new WeakSet,n=e=>{if(x(e)){if(t.has(e))return;if(h(e))return e;if(!(`toJSON`in e)){t.add(e);let r;if(j(e)){r=[];for(let t of e){let e=n(t);!m(e)&&r.push(e)}}else r=p(e)?[]:{},oe(e,(e,t)=>{let i=n(e);!m(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},je=d(`AsyncFunction`),Me=e=>e&&(x(e)||y(e))&&y(e.then)&&y(e.catch),Ne=((e,t)=>e?setImmediate:t?((e,t)=>(ce.addEventListener(`message`,({source:n,data:r})=>{n===ce&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),ce.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,y(ce.postMessage)),Pe=typeof queueMicrotask<`u`?queueMicrotask.bind(ce):typeof process<`u`&&process.nextTick||Ne,Fe=e=>e!=null&&y(e[a]),L={isArray:p,isArrayBuffer:g,isBuffer:h,isFormData:te,isArrayBufferView:_,isString:v,isNumber:b,isBoolean:S,isObject:x,isPlainObject:C,isEmptyObject:w,isReadableStream:F,isRequest:re,isResponse:ie,isHeaders:I,isUndefined:m,isDate:T,isFile:E,isReactNativeBlob:D,isReactNative:O,isBlob:k,isRegExp:Ce,isFunction:y,isStream:M,isURLSearchParams:ne,isTypedArray:_e,isFileList:A,forEach:oe,merge:ue,extend:de,trim:ae,stripBOM:fe,inherits:pe,toFlatObject:me,kindOf:u,kindOfTest:d,endsWith:he,toArray:ge,forEachEntry:ve,matchAll:ye,isHTMLForm:be,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:c,getSafeProp:l,reduceDescriptors:we,freezeMethods:Te,toObjectSet:Ee,toCamelCase:xe,noop:De,toFiniteNumber:Oe,findKey:se,global:ce,isContextDefined:le,isSpecCompliantForm:ke,toJSONObject:Ae,isAsyncFn:je,isThenable:Me,setImmediate:Ne,asap:Pe,isIterable:Fe,isSafeIterable:e=>e!=null&&c(e,a)&&Fe(e)},Ie=L.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Le=e=>{let t={},n,r,i;return e&&e.split(`
434`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim();let a=L.hasOwnProp(t,n);!n||a&&L.hasOwnProp(Ie,n)||(n===`set-cookie`?a?t[n].push(r):t[n]=[r]:t[n]=a?t[n]+`, `+r:r)}),t};function Re(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var ze=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),Be=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function Ve(e,t){return L.isArray(e)?e.map(e=>Ve(e,t)):Re(String(e).replace(t,``))}var He=e=>Ve(e,ze),Ue=e=>Ve(e,Be);function R(e){let t=Object.create(null);return L.forEach(e.toJSON(),(e,n)=>{t[n]=Ue(e)}),t}var We=Symbol(`internals`);function Ge(e){return e&&String(e).trim().toLowerCase()}function Ke(e){return e===!1||e==null?e:L.isArray(e)?e.map(Ke):He(String(e))}function qe(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var Je=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Ye(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function Xe(e){let t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n=``;for(let r=1;r<t;r++){let i=e.charCodeAt(r);if(i===34||i===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function Ze(e){let t=Object.create(null),n=String(e),r=0,i=!1,a=!1;function o(e){let i=Ye(n.slice(r,e)),a=i.indexOf(`=`);if(a<1)return;let o=Ye(i.slice(0,a));if(!Je.test(o))return;let s=o.toLowerCase();if(s===`__proto__`||s===`constructor`||s===`prototype`)return;let c=Ye(i.slice(a+1));t[s]=Xe(c)}for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);i?a?a=!1:t===92?a=!0:t===34&&(i=!1):t===34?i=!0:(t===44||t===59)&&(o(e),r=e+1)}return o(n.length),t}var Qe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function $e(e,t,n,r,i){if(L.isFunction(r))return r.call(this,t,n);if(i&&(t=n),L.isString(t)){if(L.isString(r))return t.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(t)}}function et(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function tt(e,t){let n=L.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var z=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=Ge(t);if(!i)return;let a=L.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Ke(e))}let a=(e,t)=>L.forEach(e,(e,n)=>i(e,n,t));if(L.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(L.isString(e)&&(e=e.trim())&&!Qe(e))a(Le(e),t);else if(L.isObject(e)&&L.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!L.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],L.hasOwnProp(n,i)?(r=n[i],n[i]=L.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Ge(e),e){let n=L.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return qe(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=Ge(e),e){let n=L.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||$e(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=Ge(e),e){let i=L.findKey(n,e);i&&(!t||$e(n,n[i],i,t))&&(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||$e(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};
434return L.forEach(this,(r,i)=>{let a=L.findKey(n,i);if(a){t[a]=Ke(r),delete t[i];return}let o=e?et(i):String(i).trim();o!==i&&delete t[i],t[o]=Ke(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return L.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&L.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
435`)}getSetCookie(){let e=this.get(`set-cookie`);return L.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return Ze(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[We]=this[We]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=Ge(e);t[r]||(tt(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};z.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),L.reduceDescriptors(z.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),L.freezeMethods(z);var nt=`[REDACTED ****]`;function rt(e){if(L.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function it(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||L.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof z&&(e=e.toJSON()),r.push(e);let t;if(L.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);L.isUndefined(r)||(t[n]=r)});else{if(!L.isPlainObject(e)&&rt(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?nt:i(a);L.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}function at(e){try{return String(e)}catch{return``}}function ot(e){return e.errors.map(e=>{try{return e&&e.message?at(e.message):at(e)}catch{return``}}).filter(Boolean).join(`; `)||e.name||`AggregateError`}var B=class e extends Error{static from(t,n,r,i,a,o){let s=t.message;!s&&L.isArray(t.errors)&&t.errors.length&&(s=ot(t));let c=new e(s,n||t.code,r,i,a);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),o&&Object.assign(c,o),c}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&L.hasOwnProp(e,`redact`)?e.redact:void 0,n=L.isArray(t)&&t.length>0?it(e,t):L.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};B.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,B.ERR_BAD_OPTION=`ERR_BAD_OPTION`,B.ECONNABORTED=`ECONNABORTED`,B.ETIMEDOUT=`ETIMEDOUT`,B.ECONNREFUSED=`ECONNREFUSED`,B.ERR_NETWORK=`ERR_NETWORK`,B.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,B.ERR_DEPRECATED=`ERR_DEPRECATED`,B.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,B.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,B.ERR_CANCELED=`ERR_CANCELED`,B.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,B.ERR_INVALID_URL=`ERR_INVALID_URL`,B.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;var st=null,ct=100;function lt(e){return L.isPlainObject(e)||L.isArray(e)}function ut(e){return L.endsWith(e,`[]`)?e.slice(0,-2):e}function dt(e,t,n){return e?e.concat(t).map(function(e,t){return e=ut(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function ft(e){return L.isArray(e)&&!e.some(lt)}var pt=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function mt(e,t,n){if(!L.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!L.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||m,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?ct:n.maxDepth,l=s&&L.isS
435pecCompliantForm(t),u=[];if(!L.isFunction(i))throw TypeError(`visitor must be a function`);function d(e){if(e===null)return``;if(L.isDate(e))return e.toISOString();if(L.isBoolean(e))return e.toString();if(!l&&L.isBlob(e))throw new B(`Blob is not supported. Use a Buffer instead.`);if(L.isArrayBuffer(e)||L.isTypedArray(e)){if(l&&typeof s==`function`)return new s([e]);throw new B(`Blob is not supported. Use a Buffer instead.`,B.ERR_NOT_SUPPORT)}return e}function f(e){if(e>c)throw new B(`Object is too deeply nested (`+e+` levels). Max depth: `+c,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,t){if(c===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!L.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),f(t+n.length-1),r})}function m(e,n,i){let s=e;if(L.isReactNative(t)&&L.isReactNativeBlob(e))return t.append(dt(i,n,a),d(e)),!1;if(e&&!i&&typeof e==`object`){if(L.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=p(e,1);else if(L.isArray(e)&&ft(e)||(L.isFileList(e)||L.endsWith(n,`[]`))&&(s=L.toArray(e)))return n=ut(n),s.forEach(function(e,r){!(L.isUndefined(e)||e===null)&&t.append(o===!0?dt([n],r,a):o===null?n:n+`[]`,d(e))}),!1}return lt(e)?!0:(t.append(dt(i,n,a),d(e)),!1)}let h=Object.assign(pt,{defaultVisitor:m,convertValue:d,isVisitable:lt});function g(e,n,r=0){if(!L.isUndefined(e)){if(f(r),u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),L.forEach(e,function(e,a){(!(L.isUndefined(e)||e===null)&&i.call(t,e,L.isString(a)?a.trim():a,n,h))===!0&&g(e,n?n.concat(a):[a],r+1)}),u.pop()}}if(!L.isObject(e))throw TypeError(`data must be an object`);return g(e),t}function V(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ht(e,t){this._pairs=[],e&&mt(e,this,t)}var gt=ht.prototype;gt.append=function(e,t){this._pairs.push([e,t])},gt.toString=function(e){let t=e?t=>e.call(this,t,V):V;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function _t(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function vt(e,t,n){if(!t)return e;e||=``;let r=L.isFunction(n)?{serialize:n}:n,i=L.getSafeProp(r,`encode`)||_t,a=L.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):L.isURLSearchParams(t)?t.toString():new ht(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var yt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){L.forEach(this.handlers,function(t){t!==null&&e(t)})}},bt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},xt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:ht,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},St=typeof window<`u`&&typeof document<`u`,Ct=typeof navigator==`object`&&navigator||void 0,wt=St&&(!Ct||[`ReactNative`,`NativeScript`,`NS`].indexOf(Ct.product)<0),Tt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Et=St&&window.location.href||`http://localhost`,Dt={...Object.freeze({__proto__:null,hasBrowserEnv:St,hasStandardBrowserEnv:wt,hasStandardBrowserWebWorkerEnv:Tt,navigator:Ct,origin:Et}),...xt};function Ot(e,t){return mt(e,new Dt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Dt.isNode&&L.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}var kt=ct;function At(e){if(e>kt)throw new B(`FormData field is too deeply nested (`+e+` levels). Max depth: 100`,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function jt(e){let t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g,r;for(;(r=n.exec(e))!==null;)At(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Mt(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Nt(e){function t(e,n,r,i){At(i);let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&L.isArray(r)?r.length:a,s?(L.hasOwnProp(r,a)?r[a]=L.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!L.hasOwnProp(r,a)||!L.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=Mt(r[a])),!o)}if(L.isFormData(e)&&L.isFunction(e.entries)){let n={};
435return L.forEachEntry(e,(e,r)=>{t(jt(e),r,n,0)}),n}return null}var Pt=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function Ft(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var It={transitional:bt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r?JSON.stringify(Nt(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Pt(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Ot(e,t).toString();if((a=L.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Pt(this,`env`),r=n&&n.FormData;return mt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Ft(e)):e}],transformResponse:[function(e){let t=Pt(this,`transitional`)||It.transitional,n=t&&t.forcedJSONParsing,r=Pt(this,`responseType`),i=r===`json`;if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Pt(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?B.from(e,B.ERR_BAD_RESPONSE,this,null,Pt(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dt.classes.FormData,Blob:Dt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{It.headers[e]={}});function Lt(e,t){let n=this||It,r=t||n,i=z.from(r.headers),a=r.data;return L.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Rt(e){return!!(e&&e.__CANCEL__)}var zt=class extends B{constructor(e,t,n){super(e??`canceled`,B.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Bt(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new B(`Request failed with status code `+n.status,n.status>=400&&n.status<500?B.ERR_BAD_REQUEST:B.ERR_BAD_RESPONSE,n.config,n.request,n))}function Vt(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function Ht(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function Ut(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var Wt=(e,t,n=3)=>{let r=0,i=Ht(50,250);return Ut(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=Math.max(0,o==null?a:Math.min(a,o)),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Gt=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Kt=(e,t=L.asap)=>(...n)=>t(()=>e(...n)),qt=Dt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Dt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Dt.origin),Dt.navigator&&/(msie|trident)/i.test(Dt.navigator.userAgent)):()=>!0,Jt=Dt.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&s.push(`path=${r}`),L.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),L.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);
435if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function Yt(e){return typeof e==`string`&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Xt(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+`/`+t.replace(/^\/+/,``)}var Zt=/^https?:(?!\/\/)/i,H=/[\t\n\r]/g;function Qt(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function $t(e){return Qt(e).replace(H,``)}function en(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n=``)=>`${t}${n}${nt}`)}function tn(e){let t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${nt}@`),n=t.indexOf(`#`),r=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${nt}`);return n===-1?r:`${r}#${en(t.slice(n+1))}`}function nn(e,t){if(typeof e==`string`){let n=$t(e);if(Zt.test(n))throw new B(`Invalid URL ${JSON.stringify(tn(n))}: missing "//" after protocol`,B.ERR_INVALID_URL,t)}}function rn(e,t,n,r){nn(t,r);let i=!Yt(t);return e&&(i||n===!1)?(nn(e,r),Xt(e,t)):t}var an=e=>e instanceof z?{...e}:e,on=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function sn(e,t){e||={},t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:r},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n,i){if(!L.isUndefined(t))return r(e,t,n,i);if(!L.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){if(!L.isUndefined(t))return r(void 0,t);if(!L.isUndefined(e))return r(void 0,e)}function s(n){let r=L.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!L.isUndefined(r))if(L.isPlainObject(r)){if(L.hasOwnProp(r,n))return r[n]}else return;let i=L.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(L.isPlainObject(i)&&L.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(L.hasOwnProp(t,a))return r(n,i);if(L.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(an(e),an(t),n,!0)};return L.forEach(on({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=L.hasOwnProp(l,r)?l[r]:i,o=a(L.hasOwnProp(e,r)?e[r]:void 0,L.hasOwnProp(t,r)?t[r]:void 0,r);L.isUndefined(o)&&a!==c||(n[r]=o)}),L.hasOwnProp(t,`validateStatus`)&&L.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(L.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.val
435idateStatus),n}var cn=[`content-type`,`content-length`];function ln(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{cn.includes(t.toLowerCase())&&e.set(t,n)})}var un=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function dn(e){let t=sn({},e),n=e=>L.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=z.from(s),t.url=vt(rn(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=L.getSafeProp(c,`username`)||``,n=L.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?un(n):``)))}catch(t){throw B.from(t,B.ERR_BAD_OPTION_VALUE,e)}}if(L.isFormData(r)&&(Dt.hasStandardBrowserEnv||Dt.hasStandardBrowserWebWorkerEnv||L.isReactNative(r)?s.setContentType(void 0):L.isFunction(r.getHeaders)&&ln(s,r.getHeaders(),n(`formDataHeaderPolicy`))),Dt.hasStandardBrowserEnv&&(L.isFunction(i)&&(i=i(t)),i===!0||i==null&&qt(t.url))){let e=a&&o&&Jt.read(o);e&&s.set(a,e)}return t}var fn=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=dn(e),i=r.data,a=z.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=z.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Bt(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new B(`Request aborted`,B.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new B(t&&t.message?t.message:`Network Error`,B.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||bt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new B(t,i.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&L.forEach(R(a),function(e,t){h.setRequestHeader(t,e)}),L.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=Wt(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=Wt(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new zt(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Vt(r.url);if(_&&!Dt.protocols.includes(_)){n(new B(`Unsupported protocol `+_+`:`,B.ERR_BAD_REQUEST,e)),m();return}h.send(i||null)})},pn=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof B?t:new zt(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new B(`timeout of ${t}ms exceeded`,B.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>{if(!r){if(e.aborted){i.call(e);return}e.addEventListener(`abort`,i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>L.asap(o),s},mn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},hn=async function*(e,t){for await(let n of gn(e))yield*mn(n,t)},gn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},_n=(e,t,n,r)=>{let i=hn(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},vn=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,yn=(e,t,n)=>t+2<n&&vn(e.charCodeAt(t+1))&&vn(e.charCodeAt(t+2)),bn=e=>e<=57?e-48:(e&223)-55,xn=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Sn=e=>e===9||e===10||e===12||e===13||e===32,Cn=e=>{let t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},wn=e=>{let t=e.length,n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},Tn=e=>{let t=e.length,n=0,r=0,i=!1;for(let a=0;a<t;a++){let o=e.charCodeAt(a);if(o===37&&yn(e,a,t)&&(o=bn(e.charCodeAt(a+1))*16+bn(e.charCodeAt(a+2)),a+=2),!Sn(o)){if(o===61){r++;continue}if(!xn(o)||r>0){i=!0;continue}n++}}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?wn(e):Cn(n)},En=(e,t)=>{if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let n=e.indexOf(`,`);if(n<0)return 0;let r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(n===37&&yn(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>
435=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a};function Dn(e){let t=typeof e==`string`?e.indexOf(`#`):-1;return En(t===-1?e:e.slice(0,t),Tn)}var On=`1.19.0`,kn=65536,{isFunction:An}=L,jn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Mn=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Nn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Pn=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},Fn=e=>{let t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?An(i):typeof fetch==`function`,c=An(a),l=An(o);if(!s)return!1;let u=s&&An(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Nn(()=>{let e=!1,t=new a(Dt.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Nn(()=>L.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new B(`Response type '${e}' is not supported`,B.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(L.isBlob(e))return e.size;if(L.isSpecCompliantForm(e))return(await new a(Dt.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(L.isArrayBufferView(e)||L.isArrayBuffer(e))return e.byteLength;if(L.isURLSearchParams(e)&&(e+=``),L.isString(e))return(await d(e)).byteLength},g=async(e,t)=>L.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:S=`same-origin`,fetchOptions:C,maxContentLength:w,maxBodyLength:T}=dn(e),E=L.isNumber(w)&&w>-1,D=L.isNumber(T)&&T>-1,O=t=>L.hasOwnProp(e,t)?e[t]:void 0,k=i||fetch;b=b?(b+``).toLowerCase():`text`;let A=pn([l,d&&d.toAbortSignal()],_),j=null,M=A&&A.unsubscribe&&(()=>{A.unsubscribe()}),N,P=null,ee=()=>new B(`Request body larger than maxBodyLength limit`,B.ERR_BAD_REQUEST,e,j);try{let i,l=O(`auth`);if(l&&(i={username:L.getSafeProp(l,`username`)||``,password:L.getSafeProp(l,`password`)||``}),Pn(t)){let e=new URL(t,Dt.origin);!i&&(e.username||e.password)&&(i={username:Mn(e.username),password:Mn(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(jn((i.username||``)+`:`+(i.password||``))))),E&&typeof t==`string`&&t.startsWith(`data:`)&&Dn(t)>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,j);if(D&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(N=e,e>T))throw ee()}let d=D&&(L.isReadableStream(s)||L.isStream(s)),_=(e,t,n)=>_n(e,kn,e=>{if(D&&e>T)throw P=ee();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(N??=await g(x,s),N!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(L.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&Gt(N,Wt(Kt(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new B(`Stream request bodies are not supported by the current fetch implementation`,B.ERR_NOT_SUPPORT,e,j);L.isString(S)||(S=S?`include`:`omit`);let te=c&&`credentials`in a.prototype;if(L.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/1.19.0`,!1);let ne={...C,signal:A,method:n.toUpperCase(),headers:R(x.normalize()),body:s,duplex:`half`,credentials:te?S:void 0};j=c&&new a(t,ne);let F=await(c?k(j,C):k(t,ne)),re=z.from(F.headers);if(E){let t=L.toFiniteNumber(re.getContentLength());if(t!=null&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,j)}let ie=p&&(b===`stream`||b===`response`);if(p&&F.body&&(v||E||ie&&M)){let t={};
435[`status`,`statusText`,`headers`].forEach(e=>{t[e]=F[e]});let n=L.toFiniteNumber(re.getContentLength()),[r,i]=v&&Gt(n,Wt(Kt(v),!0))||[],a=0;F=new o(_n(F.body,kn,t=>{if(E&&(a=t,a>w))throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,j);r&&r(t)},()=>{i&&i(),M&&M()}),t)}b||=`text`;let I=await m[L.findKey(m,b)||`text`](F,e);if(E&&!p&&!ie){let t;if(I!=null&&(typeof I.byteLength==`number`?t=I.byteLength:typeof I.size==`number`?t=I.size:typeof I==`string`&&(t=typeof r==`function`?new r().encode(I).byteLength:I.length)),typeof t==`number`&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,j)}return!ie&&M&&M(),await new Promise((t,n)=>{Bt(t,n,{data:I,headers:z.from(F.headers),status:F.status,statusText:F.statusText,config:e,request:j})})}catch(t){if(M&&M(),A&&A.aborted&&A.reason instanceof B){let n=A.reason;throw n.config=e,j&&(n.request=j),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(P)throw j&&!P.request&&(P.request=j),P;if(t instanceof B)throw j&&!t.request&&(t.request=j),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new B(`Network Error`,B.ERR_NETWORK,e,j,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw B.from(t,t&&t.code,e,j,t&&t.response)}}},In=new Map,Ln=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=In;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Fn(t)),l=c;return c};Ln();var Rn={http:st,xhr:fn,fetch:{get:Ln}};L.forEach(Rn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var zn=e=>`- ${e}`,Bn=e=>L.isFunction(e)||e===null||e===!1;function Vn(e,t){e=L.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!Bn(r)&&(i=Rn[(n=String(r)).toLowerCase()],i===void 0))throw new B(`Unknown adapter '${n}'`);if(i&&(L.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new B(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
436`+e.map(zn).join(`
437`):` `+zn(e[0]):`as no adapter specified`),B.ERR_NOT_SUPPORT)}return i}var Hn={getAdapter:Vn,adapters:Rn};function Un(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new zt(null,e)}function Wn(e){return Un(e),e.headers=z.from(e.headers),e.data=Lt.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Hn.getAdapter(e.adapter||It.adapter,e)(e).then(function(t){Un(e),e.response=t;try{t.data=Lt.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=z.from(t.headers),t},function(t){if(!Rt(t)&&(Un(e),t&&t.response)){e.response=t.response;try{t.response.data=Lt.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=z.from(t.response.headers)}return Promise.reject(t)})}var Gn={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Gn[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Kn={};Gn.transitional=function(e,t,n){function r(e,t){return`[Axios v1.19.0] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new B(r(i,` has been removed`+(t?` in `+t:``)),B.ERR_DEPRECATED);return t&&!Kn[i]&&(Kn[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),!e||e(n,i,a)}},Gn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function qn(e,t,n){if(typeof e!=`object`||!e)throw new B(`options must be an object`,B.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-->0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new B(`option `+a+` must be `+n,B.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new B(`Unknown option `+a,B.ERR_BAD_OPTION)}}var Jn={assertOptions:qn,validators:Gn},Yn=Jn.validators,Xn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new yt,response:new yt}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>
437{if(!t.stack)return``;let e=t.stack.indexOf(`
438`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
439`),r=t===-1?-1:n.indexOf(`
440`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
441`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=sn(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Jn.assertOptions(n,{silentJSONParsing:Yn.transitional(Yn.boolean),forcedJSONParsing:Yn.transitional(Yn.boolean),clarifyTimeoutError:Yn.transitional(Yn.boolean),legacyInterceptorReqResOrdering:Yn.transitional(Yn.boolean),advertiseZstdAcceptEncoding:Yn.transitional(Yn.boolean),validateStatusUndefinedResolves:Yn.transitional(Yn.boolean)},!1),r!=null&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Jn.assertOptions(r,{encode:Yn.function,serialize:Yn.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Jn.assertOptions(t,{baseUrl:Yn.spelling(`baseURL`),withXsrfToken:Yn.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&L.merge(i.common,i[t.method]);i&&L.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=z.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||bt;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Wn.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{let n=t.call(this,e);L.isThenable(n)&&(l=Promise.resolve(n).then(()=>Wn.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Wn.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=sn(this.defaults,e),vt(rn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};L.forEach([`delete`,`get`,`head`,`options`],function(e){Xn.prototype[e]=function(t,n){return this.request(sn(n||{},{method:e,url:t,data:n&&L.hasOwnProp(n,`data`)?n.data:void 0}))}}),L.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(sn(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Xn.prototype[e]=t(),e!==`query`&&(Xn.prototype[e+`Form`]=t(!0))});var Zn=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new zt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Qn(e){return function(t){return e.apply(null,t)}}function $n(e){return L.isObject(e)&&e.isAxiosError===!0}var er={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
441alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(er).forEach(([e,t])=>{er[t]=e});function tr(e){let t=new Xn(e),r=n(Xn.prototype.request,t);return L.extend(r,Xn.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(t){return tr(sn(e,t))},r}var nr=tr(It);nr.Axios=Xn,nr.CanceledError=zt,nr.CancelToken=Zn,nr.isCancel=Rt,nr.VERSION=On,nr.toFormData=mt,nr.AxiosError=B,nr.Cancel=nr.CanceledError,nr.all=function(e){return Promise.all(e)},nr.spread=Qn,nr.isAxiosError=$n,nr.mergeConfig=sn,nr.AxiosHeaders=z,nr.formToJSON=e=>Nt(L.isHTMLForm(e)?new FormData(e):e),nr.getAdapter=Hn.getAdapter,nr.HttpStatusCode=er,nr.default=nr,t.exports=nr})),FF=l(o(((e,t)=>{function n(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var r=n(PF());function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var a=function(){try{return{}.MIX_VAPOR_ASSET_URL?{}.MIX_VAPOR_ASSET_URL:``}catch(e){throw console.error(`Unable to automatically resolve the asset URL. Use Vapor.withBaseAssetUrl() to specify it manually.`),e}};t.exports=new(function(){function e(){}var t=e.prototype;return t.asset=function(e){return a()+`/`+e},t.withBaseAssetUrl=function(e){a=function(){return e||``}},t.store=function(e,t){t===void 0&&(t={});try{return Promise.resolve(r.default.post(t.signedStorageUrl?t.signedStorageUrl:`/vapor/signed-storage-url`,i({bucket:t.bucket||``,content_type:t.contentType||e.type,expires:t.expires||``,visibility:t.visibility||``},t.data),i({baseURL:t.baseURL||null,headers:t.headers||{}},t.options))).then(function(n){var i=n.data.headers;return`Host`in i&&delete i.Host,t.progress===void 0&&(t.progress=function(){}),Promise.resolve(r.default.put(n.data.url,e,{cancelToken:t.cancelToken||``,headers:i,onUploadProgress:function(e){t.progress(e.loaded/e.total)}})).then(function(){return n.data.extension=e.name.split(`.`).pop(),n.data})})}catch(e){return Promise.reject(e)}},e}())}))());window.Sentry=vE,window.Swiper=CO;var IF=!1,LF=()=>{!window.Alpine||IF||(window.Alpine.plugin(Pk),window.Alpine.plugin(Bk),IF=!0)};document.addEventListener(`alpine:init`,LF),LF();var RF=document.currentScript?.src;QN.workerSrc=window.pdfjsWorkerUrl||(RF?new URL(`../assets/pdf.worker.js`,RF).toString():`/assets/pdf.worker.js`),window.pdfjsLib=Hk,window.Vapor=FF.default,`serviceWorker`in navigator&&navigator.serviceWorker.register(`/service-worker`,{scope:`/`}).catch(e=>{console.warn(`Service worker registration failed:`,e)}),window.Components={inputSelect(e){return{init(){this.$refs.listbox.focus(),this.optionCount=this.$refs.listbox.children.length,this.$watch(`selected`,e=>{if(this.open){if(this.selected===null){this.activeDescendant=``;return}this.activeDescendant=this.$refs.listbox.children[this.selected-1].id}}),this.setOption(this.getOption())},element:null,activeDescendant:null,optionCount:null,open:!1,selected:null,value:1,setOption(e){this.value=e,this.open=!1},getOption(){let e=document.getElementById(this.element+`-select`);return e?e.options[e.selectedIndex].getAttribute(`key`):!1},updateOption(e,t){let n=document.getElementById(this.element+`-select`);n&&(n.value=t,n.dispatchEvent(new Event(`change`)),this.setOption(e))},search(e){let t=document.querySelectorAll(`.`+this.element+`-option`);for(var n=0;n<t.length;n++)t[n].dataset.name.toLowerCase().startsWith(e.toLowerCase())?t[n].classList.remove(`hidden`):t[n].classList.add(`hidden`)},onButtonClick(){this.open||(this.selected=this.value,this.open=!0,this.$nextTick(()=>{this.$refs.listbox.focus(),this.$refs.listbox.children[this.selected-1].scrollIntoView({block:`nearest`})}))},onOptionSelect(){this.selected!==null&&(this.value=this.selected),this.open=!1,this.$refs.button.focus()},onEscape(){this.open=!1,this.$refs.button.focus()},onArrowUp(){this.selected=this.selected-1<1?this.optionCount:this.selected-1,this.$refs.listbox.children[this.selected-1].scrollIntoView({block:`nearest`})},onArrowDown(){this.selected=this.selected+1>this.optionCount?1:this.selected+1,this.$refs.listbox.children[this.selected-1].scrollIntoView({block:`nearest`})},...e}},liveSelect(e){return{init(){this.$refs.listbox.focus(),this.optionCount=this.$refs.listbox.children.length,this.$watch(`selected`,e=>{if(this.open){if(this.selected===null){this.activeDescendant=``;return}this.activeDescendant=this.$refs.listbox.children[this.selected-1].id}})},listener:null,activeDescendant:null,optionCount:null,open:!1,selected:null,value:1,choose(e,t){this.value=e,this.open=!1,window.livewire.dispatch(this.listener,{value:t})},onButtonClick(){this.open||(this.selected=this.value,this.open=!0,this.$nextTick(()=>{this.$refs.listbox.focus(),this.$refs.listbox.children[this.selected-1].scrollIntoView({block:`nearest`})}))},onOptionSelect(){this.selected!==null&&(this.value=this.selected),this.open=!1,this.$refs.button.focus()},onEscape(){this.open=!1,this.$refs.button.focus()},onArrowUp(){this.selected=this.selected-1<1?this.optionCount:this.selected-1,this.$refs.listbox.children[this.selected-1].scrollIntoView({block:`nearest`})},onArrowDown(){this.selected=this.selected+1>this.optionCount?1:this.selected+1,this.$refs.listbox.children[this.selected-1].scrollIntoView({block:`nearest`})},...e}}};function zF(e){if(window.CryptoJS?.MD5)return window.CryptoJS.MD5(e).toString();let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(`000000`+(t&16777215).toString(16)).slice(-6)}function BF(e){let t=zF(e)||``;return`#`+(t.length>=6?t.slice(0,6):(`000000`+t).slice(-6))}window.addEventListener(`logout`,()=>{setTimeout(()=>{window.location.href=`/`},200)}),window.addEventListener(`setPageTitle`,e=>{e.detail&&e.detail[0]&&(document.title=e.detail[0])});var VF=document.title,HF=0;window.addEventListener(`newNotification`,()=>{let e=new Audio(`https://cdn.enrollfirst.com/audio/ding.mp3`);e.volume=.2,e.play().catch(()=>{console.error(`Failed to play audio`)})}),window.addEventListener(`clearNotifications`,()=>{document.title=VF,HF=0}),window.addEventListener(`setChatNotificationCount`,e=>{e.detail>0?(HF=e.detail,document.title=`(${HF}) New Messages - ${VF}`):document.title=VF});function UF(e){let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.top=`-1000px`,document.body.appendChild(t),t.focu
441s(),t.select();try{document.execCommand(`copy`)}catch(e){console.error(`Fallback copy failed`,e)}finally{document.body.removeChild(t)}}window.copyToClipboard=function(e,t){navigator.clipboard?navigator.clipboard.writeText(t).catch(()=>{UF(t)}):UF(t);let n=document.getElementById(e);if(!n)return;let r=n.innerHTML;n.innerHTML=`Copied!`,setTimeout(function(){n.innerHTML=r},1500)},window.money=function(e){return window.Intl&&typeof Intl.NumberFormat==`function`?isNaN(e)||e==null?(console.error(`Invalid input for money formatting.`),e):new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`}).format(e):`$`+parseFloat(e).toFixed(2)},Object.defineProperty(String.prototype,"capitalize",{value:function(){return this.charAt(0).toUpperCase()+this.slice(1)},enumerable:!1}),window.addEventListener(`focusInput`,e=>{setTimeout(()=>{let t=document.getElementById(e.detail);t&&t.focus()},300)});function WF(e,t){var n=document.getElementById(e);if(n&&n.innerHTML)try{var r=JSON.parse(n.innerHTML);console.log(t+`:`),console.log(r)}catch(t){console.error(`Error parsing JSON from element #`+e,t)}}window.productsDebug=function(){WF(`productsDebug`,`Available Products`)},window.subscriptionsDebug=function(){WF(`subscriptionsDebug`,`Subscriptions`)},window.quoteDebugLog=function(){WF(`quoteDebug`,`Quote`)},window.primaryDebug=function(){WF(`primaryDebug`,`Primary`)},window.portalDebug=function(){WF(`portalDebug`,`Portal Session Object`)},window.saasDebug=function(){WF(`saasDebug`,`SaaS Config Object`)},window.serviceDebug=function(){WF(`serviceDebug`,`Service Debug`)},window.contributionDebug=function(){WF(`contributionDebug`,`Contribution Model`)},window.rateTableDebug=function(){WF(`primaryRateDebug`,`Primary Rate variables`),WF(`spouseRateDebug`,`Spouse Rate variables`)},window.runDebug=function(){WF(`debug`,`Debug`)},window.portalSessionDebug=function(){window.portalDebug(),window.saasDebug()},window.quoteDebug=function(){window.primaryDebug(),window.quoteDebugLog(),window.subscriptionsDebug(),window.productsDebug(),window.portalDebug(),window.saasDebug(),window.serviceDebug()};function GF(e,t,n,r,i=``){let a=document.getElementById(e);if(!a)return;a.chart&&a.chart.destroy();let o=t===`doughnut`,s=Array.isArray(r)&&typeof r[0]==`object`?r:[{label:i||void 0,data:r,...o?{}:{backgroundColor:`rgba(99, 102, 241, 0.1)`,borderColor:`#1d4ed8`,borderWidth:1}}];a.chart=new Chart(a,{type:t,data:{labels:n,datasets:s},options:{scales:{y:{beginAtZero:!0}},plugins:{legend:{display:s.length>1||!!i,position:`bottom`,labels:{boxWidth:10}}},responsive:!0,maintainAspectRatio:!1}})}window.renderActivityChart=function(e,t){let n=document.getElementById(e);if(!n)return;let r=n.getContext(`2d`);n.chartInstance&&n.chartInstance.destroy();let i=Object.keys(t),a=Object.values(t);n.chartInstance=new Chart(r,{type:`line`,data:{labels:i,datasets:[{label:`per Day`,data:a,borderColor:`#1d4ed8`,backgroundColor:`rgba(99, 102, 241, 0.1)`,fill:!0,tension:.3,pointRadius:3}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,ticks:{precision:0}}},plugins:{legend:{display:!1}}}})},window.renderMultiLineChart=function(e,t,n=``,r=!1){let i=document.getElementById(e);if(!i)return;i.chartInstance&&i.chartInstance.destroy();let a=i.getContext(`2d`);i.chartInstance=new Chart(a,{type:`line`,data:{labels:t.labels,datasets:t.datasets},options:{responsive:!0,spanGaps:!0,maintainAspectRatio:!1,plugins:{legend:{position:`bottom`,labels:{boxWidth:10}},tooltip:{mode:`index`,intersect:!1,callbacks:{label:function(e){let t=e.dataset.label||``,n=e.parsed.y||0;return r?`${t}: $${n.toLocaleString()}`:`${t}: ${n}`}}},title:{display:!!n,text:n}},interaction:{mode:`index`,intersect:!1},scales:{y:{beginAtZero:!0,ticks:{precision:0,callback:function(e){return r?`$${e.toLocaleString()}`:e}}}}}})},window.renderCampaignDailySnapshotChart=function(e,t){let n=document.getElementById(e);if(!n)return;n.chartInstance&&n.chartInstance.destroy();let r=(t.datasets||[]).map(e=>{let t=e.borderColor||BF(e.label||``);return{...e,type:`line`,borderColor:t,backgroundColor:`transparent`,fill:!1,tension:.3,pointRadius:2,borderWidth:2}}),i=n.getContext(`2d`);n.chartInstance=new Chart(i,{type:`line`,data:{labels:t.labels,datasets:r},options:{responsive:!0,spanGaps:!0,maintainAspectRatio:!1,plugins:{legend:{position:`bottom`,labels:{boxWidth:10}},tooltip:{mode:`index`,intersect:!1,callbacks:{title:function(e){return e?.[0]?.label||``},label:function(e){return`${e.dataset.label||`Total`}: ${e.parsed.y||0}`},afterLabel:function(e){let t=e.dataset?.meta?.breakdowns?.[e.dataIndex]||{};return[`Quoting: ${t.Quoting??0}`,`Quoted: ${t.Quoted??0}`,`Enrolling: ${t.Enrolling??0}`,`Checkout: ${t.Checkout??0}`,`Enrolled: ${t.Enrolled??0}`].join(` • `)}}}},interaction:{mode:`index`,intersect:!1},scales:{y:{beginAtZero:!0,ticks:{precision:0}}}}})},window.renderMultiBarChart=function(e,t,n=``,r=!1){let i=document.getElementById(e);if(!i)return;i.chartInstance&&i.chartInstance.destroy();let a=i.getContext(`2d`);i.chartInstance=new Chart(a,{type:`bar`,data:{labels:t.labels,datasets:t.datasets},options:{responsive:!0,spanGaps:!0,maintainAspectRatio:!1,plugins:{legend:{position:`bottom`,labels:{boxWidth:10}},tooltip:{mode:`index`,intersect:!1,callbacks:{label:function(e){let t=e.dataset.label||``,n=e.parsed.y||0;return r?`${t}
441: $${n.toLocaleString()}`:`${t}: ${n}`}}},title:{display:!!n,text:n}},interaction:{mode:`index`,intersect:!1},scales:{x:{stacked:!1},y:{beginAtZero:!0,stacked:!1,ticks:{precision:0,callback:function(e){return r?`$${e.toLocaleString()}`:e}}}}}})},window.renderDoughnutChart=function(e,t,n=``){let r=document.getElementById(e);if(!r)return;r.chartInstance&&r.chartInstance.destroy();let i=r.getContext(`2d`),a=t.values||[],o=a.reduce((e,t)=>e+t,0);r.chartInstance=new Chart(i,{type:`doughnut`,data:{labels:t.labels,datasets:[{data:a,backgroundColor:[`#3B82F6`,`#A855F7`,`#9CA3AF`],borderWidth:1}]},options:{responsive:!0,cutout:`70%`,plugins:{legend:{position:`right`},tooltip:{callbacks:{label:function(e){let t=e.label||``,n=e.parsed,r=o>0?(n/o*100).toFixed(2):`0.00`;return`${t}: $${n.toLocaleString()} (${r}%)`}}},title:{display:!!n,text:n}}}})},window.renderHorizontalBarChart=function(e,t,n=``,r=`Value`,i=`#3B82F6`){let a=document.getElementById(e);if(!a)return;a.chartInstance&&a.chartInstance.destroy();let o=document.getElementById(`${e}-wrapper`);if(o){let e=t.labels.length*30;o.style.height=`${e}px`,a.height=e}let s=a.getContext(`2d`),c=t.datasets??[{label:r,data:t.data,backgroundColor:i,borderWidth:1}];a.chartInstance=new Chart(s,{type:`bar`,data:{labels:t.labels,datasets:c},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!!r},tooltip:{callbacks:{label:function(e){let t=e.parsed.x??0;return`${e.dataset.label}: ${t.toLocaleString()}`}}},title:{display:!!n,text:n}},scales:{x:{beginAtZero:!0,ticks:{precision:0,callback:function(e){return`${e>=1e3?(e/1e3).toFixed(1)+`k`:e}`}}},y:{ticks:{autoSkip:!1}}}}})},window.addEventListener(`superChart`,function(e){setTimeout(()=>{let t=async(e,t,n)=>{try{let r=await(await fetch(t)).json(),i=document.getElementById(`${e}-container`);i&&i.classList.remove(`hidden`);let a=document.getElementById(`${e}-loading`);a&&a.classList.add(`hidden`),n(r)}catch(t){console.error(`Error fetching ${e} data:`,t)}};if(e.detail.quoteLineActivity&&window.renderMultiLineChart(`quoteLineActivity`,{labels:e.detail.quoteLineActivity.dates,datasets:Object.values(e.detail.quoteLineActivity.plans).map(e=>({label:e.name,data:e.counts,borderColor:e.color||BF(e.name),backgroundColor:`transparent`,fill:!1,tension:.3,pointRadius:2,borderWidth:2}))}),e.detail.dailyKPIsStatic&&t(`dailyKPIsStatic`,e.detail.dailyKPIsStatic,e=>{window.renderMultiLineChart(`dailyKPIsStatic`,{labels:e.labels,datasets:e.datasets},``,!0)}),e.detail.dailyCampaignSnapshot&&t(`dailyCampaignSnapshot`,e.detail.dailyCampaignSnapshot,e=>{window.renderCampaignDailySnapshotChart(`dailyCampaignSnapshot`,e)}),e.detail.netSalesTrends&&window.renderMultiBarChart(`netSalesTrends`,{labels:e.detail.netSalesTrends.labels,datasets:e.detail.netSalesTrends.datasets},``,!0),e.detail.transactionVolume&&window.renderHorizontalBarChart(`transactionVolume`,e.detail.transactionVolume,``,`Total Transactions`,`#3B82F6`),e.detail.gainVsLoss&&window.renderDoughnutChart(`gainVsLoss`,e.detail.gainVsLoss,``),e.detail.salesByProduct&&window.renderHorizontalBarChart(`salesByProduct`,e.detail.salesByProduct,``,`Sales By Product`,`#3B82F6`),e.detail.salesByProductAndAction&&window.renderHorizontalBarChart(`salesByProductAndAction`,e.detail.salesByProductAndAction,``,`Product By Action`,`#3B82F6`),e.detail.salesByAgent&&window.renderHorizontalBarChart(`salesByAgent`,e.detail.salesByAgent,``,`Sales By Agent`,`#3B82F6`),e.detail.salesByAgentAndAction&&window.renderHorizontalBarChart(`salesByAgentAndAction`,e.detail.salesByAgentAndAction,``,`Agent By Action`,`#3B82F6`),e.detail.salesByGroup&&window.renderHorizontalBarChart(`salesByGroup`,e.detail.salesByGroup,``,`Sales By Group`,`#3B82F6`),e.detail.salesByGroupAndAction&&window.renderHorizontalBarChart(`salesByGroupAndAction`,e.detail.salesByGroupAndAction,``,`Group By Action`,`#3B82F6`),e.detail.salesByAffiliation&&window.renderHorizontalBarChart(`salesByAffiliation`,e.detail.salesByAffiliation,``,`Sales By Affiliation`,`#3B82F6`),e.detail.salesByAffiliationAndAction&&window.renderHorizontalBarChart(`salesByAffiliationAndAction`,e.detail.salesByAffiliationAndAction,``,`Affiliation By Action`,`#3B82F6`),e.detail.salesByOwner&&window.renderHorizontalBarChart(`salesByOwner`,e.detail.salesByOwner,``,`Sales By Owner`,`#3B82F6`),e.detail.salesByOwnerAndAction&&window.renderHorizontalBarChart(`salesByOwnerAndAction`,e.detail.salesByOwnerAndAction,``,`Owner By Action`,`#3B82F6`),e.detail.quoting&&GF(`quoting`,`bar`,e.detail.quoting.labels,e.detail.quoting.datasets),e.detail.quoted&&GF(`quoted`,`bar`,e.detail.quoted.labels,e.detail.quoted.datasets),e.detail.enrolling&&GF(`enrolling`,`bar`,e.detail.enrolling.labels,e.detail.enrolling.datasets,``),e.detail.checkout&&GF(`checkout`,`bar`,e.detail.checkout.labels,e.detail.checkout.datasets,``),e.detail.enrolled&&GF(`enrolled`,`bar`,e.detail.enrolled.labels,e.detail.enrolled.datasets,``),e.detail.callRecordingData&&t(`callRecordingData`,e.detail.callRecordingData,e=>{GF(`callVolume`,`bar`,e.callVolume.labels,e.callVolume.data,`Call Volume`),GF(`callDuration`,`bar`,e.callDuration.labels,e.callDuration.data,`Total Duration (min)`),GF(`callSkills`,`bar`,e.callSkills.labels,e.callSkills.data,`Calls by Skill`),window.renderMultiLineChart(`callDirectionTrends`,{labels:e.callDirectionTrends.labels,datasets:e.callDirectionTrends.datasets}),window.renderMultiLineChart(`callAgentTrends`,{labels:e.callAgentTrends.labels,datasets:e.callAgentTrends.datasets})}),e.detail.brokerActions&&t(`brokerActions`,e.detail.brokerActions,e=>{window.renderActivityChart(`brokerActions`,e)}),e.detail.recruitingActivity&&t(`recruitingActivity`,e.detail.recruitingActivity,e=>{window.renderActivityChart(`recruitingActivity`,e)}),e.detail.brokerQuoteActivity&&t(`brokerQuoteActivity`,e.detail.brokerQuoteActivity,e=>{window.renderActivityChart(`brokerQuoteActivity`,e)}),e.detail.guestActivity&&t(`guestActivity`,e.detail.guestActivity,e=>{window.renderMultiLineChart(`guestActivity`,e,``)}),e.detail.importActivity&&t(`importActivity`,e.detail.importActivity,e=>{GF(`importActivity`,`bar`,e.labels,e.data,``)}),e.detail.registrations&&t(`registrations`,e.detail.registrations,e=>{GF(`registrations`,`bar`,e.labels,e.data,``)}),e.detail.processedCampaignEvents&&t(`processedCampaignEvents`,e.detail.processedCampaignEvents,e=>{GF(`processedCampaignEvents`,`bar`,e.labels,e.data,``)}),e.detail.memberActions&&t(`memberActions`,e.detail.memberActions,e=>{window.renderActivityChart(`memberActions`,e)}),e.detail.adminActions&&t(`adminActions`,e.detail.adminActions,e=>{window.renderActivityChart(`adminActions`,e)}),e.detail.appDeployments&&t(`appDeployments`,e.detail.appDeployments,e=>{window.renderMultiLineChart(`appDeployments`,{labels:e.labels,datasets:e.datasets})}),e.detail.sObjectPollActivity){let t=e.detail.sObjectPollActivity,n=[{label:`Updates`,data:t.data.map(e=>e.updates),backgroundColor:`rgba(54, 162, 235, 0.2)`,borderColor:`rgba(54, 162, 235, 1)`,borderWidth:1},{label:`Refreshes`,data:t.data.map(e=>e.refresh),backgroundColor:`rgba(255, 99, 132, 0.2)`,borderColor:`rgba(255, 99, 132, 1)`,borderWidth:1}];GF(`sObjectPollActivity`,`bar`,t.labels,n)}e.detail.selectedJobInvocations&&GF(`selectedJobInvocations`,`bar`,e.detail.selectedJobInvocations.labels,e.detail.selectedJobInvocations.data,`Job Invocations:`),e.detail.jobInvocations&&GF(`jobInvocations`,`bar`,e.detail.jobInvocations.labels,e.detail.jobInvocations.data,`Job Invocations:`),e.detail.sObjectPollLogs&&GF(`sObjectPollLogs`,`bar`,e.detail.sObjectPollLogs.labels,e.detail.sObjectPollLogs.data,`SObject Poll Logs:`)},300)}),window.adjustSlot=function(){let e=document.getElementById(`efi-nav-container`),t=document.querySelector(`.efi-slot-container`);e&&t&&(t.style.marginTop=`${e.offsetHeight}px`)},window.onload=window.adjustSlot,window.onresize=window.adjustSlot,window.addEventListener(`browserRedirect`,function(e){console.log(`Redirecting to:`,e.detail.url),e.detail.url&&e.detail.new_window?window.open(e.detail.url,`_blank`):window.location.href=e.detail.url}),window.addEventListener(`scrollTo`,function(e){let t=document.getElementById(e.detail.containerId);t&&t.scrollIntoView({behavior:`smooth`})}),window.addEventListener(`scrollTop`,e=>{let t=e?.detail?.containerId||`content`,n=document.getElementById(t);(n&&n.scrollHeight>n.clientHeight?n:document.scrollingElement||document.documentElement).scrollTo({top:0,behavior:`smooth`})}),window.exportAuditToPDF=function(){let e=document.getElementById(`audit-log-container`);html2pdf().set({margin:[0,0,0,0],filename:`{{ $opportunityId }}-audit-log.pdf`,html2canvas:{scale:1},jsPDF:{unit:`in`,format:[20,16],orientation:`portrait`}}
441).from(e).toPdf().get(`pdf`).then(e=>{window.open(e.output(`bloburl`),`_blank`)}).finally(()=>{console.log(`PDF generated for share`)})},window.setModelWrapperTab=function(e){let t=document.getElementById(e+`-icon`),n=document.getElementById(e+`-icon-loading`);!t||!n||(t.style.display=`none`,n.style.display=`block`)},window.toggleFullscreen=function(e){let t=document.getElementById(e);t&&(document.fullscreenElement?document.exitFullscreen():t.requestFullscreen().catch(e=>{console.error(`Error attempting to enable fullscreen: ${e.message}`)}))},window.__audioPlayers||(window.__audioPlayers=[]),window.audioPlayer=function(e){return{howl:null,playing:!1,progress:0,durationFormatted:`00:00`,init(){this.howl=new Howl({src:[e],html5:!0,onload:()=>{let e=Math.floor(this.howl.duration()),t=String(Math.floor(e/60)).padStart(2,`0`),n=String(e%60).padStart(2,`0`);this.durationFormatted=`${t}:${n}`},onend:()=>this.playing=!1}),window.__audioPlayers.push(this),this.howl.on(`play`,()=>{this.playing=!0,this.track()}),this.howl.on(`pause`,()=>{this.playing=!1}),this.howl.on(`stop`,()=>{this.playing=!1,this.progress=0}),this.howl.on(`seek`,()=>{let e=this.howl.seek()||0;this.progress=e/this.howl.duration()*100})},play(){window.__audioPlayers.forEach(e=>{e!==this&&e.playing&&e.stop()}),this.howl.play(),this.playing=!0,this.track()},pause(){this.howl.pause(),this.playing=!1},stop(){this.howl.stop(),this.playing=!1,this.progress=0},seek(e){let t=this.howl.duration();this.howl.seek(e/100*t)},track(){let e=()=>{if(this.playing){let t=this.howl.seek()||0;this.progress=t/this.howl.duration()*100,requestAnimationFrame(e)}};e()}}},document.addEventListener(`alpine:init`,()=>{let e=.8,t=.95;Alpine.data(`contractAgreementComponent`,(n,r,i)=>({agreementDate:n,broker:r,ipAddress:i,loading:!1,brokerSigDataUrl:null,init(){window.html2canvas||console.warn(`html2canvas not loaded`),!window.jspdf&&!window.jsPDF&&console.warn(`jsPDF not loaded`)},async saveAndContinue(){try{let n=await this._requireSignature(`sig-main`);this.brokerSigDataUrl=n,this.loading=`Preparing document...`;let r=document.getElementById(`contract-agreement`);if(!r)throw Error(`Contract element not found`);let i=r.cloneNode(!0);i.id=`contract-agreement-clone`,i.style.cssText=`
442            position:absolute!important;left:-9999px!important;top:-9999px!important;
443            width:${r.scrollWidth||r.clientWidth}px!important;
444            background:#fff!important;color:#000!important;
445            overflow:visible!important;max-height:none!important;height:auto!important;
446            padding:0!important;margin:0!important;border:none!important;
447          `,document.body.appendChild(i),await(document.fonts?.ready??Promise.resolve()),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));let a=await html2canvas(i,{scale:1,useCORS:!0,backgroundColor:`#ffffff`,windowWidth:i.scrollWidth,windowHeight:i.scrollHeight});document.body.removeChild(i);let o=new((window.jspdf?.jsPDF)||window.jsPDF)({unit:`pt`,format:`letter`,orientation:`p`,compress:!0}),s=o.internal.pageSize.getWidth(),c=o.internal.pageSize.getHeight(),l=s-48,u=c-48,d=a.width,f=a.height,p=Math.max(1,Math.floor(u/l*d)),m=document.createElement(`canvas`),h=m.getContext(`2d`,{willReadFrequently:!0}),g=0,_=0;for(;g<f;){let n=Math.min(p,f-g),r=Math.max(1,Math.round(d*e)),i=Math.max(1,Math.round(n*e));m.width=r,m.height=i,h.clearRect(0,0,r,i),h.drawImage(a,0,g,d,n,0,0,r,i);let s=m.toDataURL(`image/jpeg`,t),c=n/d*l;_>0&&o.addPage(),o.addImage(s,`JPEG`,24,24,l,c,void 0,`FAST`),g+=n,_++}o.setFont(`helvetica`,`normal`),o.setFontSize(9);let v=`Signed by ${(this.broker?.name??``).trim()||`${this.broker?.firstname??``} ${this.broker?.lastname??``}`.trim()} on ${new Date().toLocaleString()}${this.ipAddress?` • IP ${this.ipAddress}`:``}`;o.setPage(_),o.text(v,24,c-8);let y=o.output(`blob`),b=await this._blobToBase64(y);this.loading=`Saving document...`,await this.$wire.savePdf({base64:b})}catch{this.loading=!1,window.Toast?.danger?.(`Please provide a valid signature and try again.`,`Error`)}},_requireSignature(e){return new Promise((t,n)=>{let r=null,i=()=>{window.removeEventListener(`signature:captured`,a),window.removeEventListener(`signature:invalid`,o),r!==null&&clearTimeout(r)},a=n=>
447{n?.detail?.id===e&&(i(),t(n.detail.dataUrl))},o=t=>{t?.detail?.id===e&&(i(),n(Error(`signature_invalid:${t.detail?.reason||`unknown`}`)))};window.addEventListener(`signature:captured`,a),window.addEventListener(`signature:invalid`,o),Promise.resolve().then(()=>{window.dispatchEvent(new CustomEvent(`signature:capture`,{detail:{id:e}}))}),r=setTimeout(()=>{i(),n(Error(`signature_timeout`))},8e3)})},_blobToBase64(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}})),Alpine.data(`achAuth`,(n,r,i,a)=>({fullName:n,legalName:r,ipAddress:a,bankAccountType:null,routingNumber:``,accountNumber:``,bankName:``,remittanceEmail:i||``,foreignDestination:!1,loading:!1,errors:{},init(){window.html2canvas||console.warn(`html2canvas not loaded`),!window.jspdf&&!window.jsPDF&&console.warn(`jsPDF not loaded`)},inputClass(e){return`mt-1 block w-full rounded-md shadow-sm ${this.errors[e]?`border-red-500 focus:border-red-500 focus:ring-red-500`:`border-gray-300 focus:border-blue-500 focus:ring-blue-500`}`},fieldsetClass(e){return`mt-3 grid gap-3 sm:grid-cols-3 rounded-md p-1 ${this.errors[e]?`ring-1 ring-red-500`:``}`},onlyDigits(e){return(e||``).replace(/\D+/g,``)},setError(e,t){this.errors[e]=t||`Invalid`},clearError(e){this.errors[e]&&delete this.errors[e]},firstErrorKey(){return Object.keys(this.errors)[0]||null},validate(){this.errors={},this.bankAccountType||this.setError(`bank_account_type`,`Select an account type.`),this.routingNumber=this.onlyDigits(this.routingNumber),(!/^\d{9}$/.test(this.routingNumber)||!this._validAba(this.routingNumber))&&this.setError(`routing_number`,`Enter a valid 9-digit routing number.`),this.accountNumber=this.onlyDigits(this.accountNumber),/^\d{4,17}$/.test(this.accountNumber)||this.setError(`account_number`,`Enter a valid account number (4–17 digits).`),this.bankName.trim()||this.setError(`bank_name`,`Enter the name of the bank.`);let e=(this.remittanceEmail||``).trim();return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)||this.setError(`remittance_email`,`Enter a valid email for remittance.`),Object.keys(this.errors).length===0},_validAba(e){let t=e.split(``).map(e=>+e);return(3*(t[0]+t[3]+t[6])+7*(t[1]+t[4]+t[7])+(t[2]+t[5]+t[8]))%10==0},focusFirstError(){let e=this.firstErrorKey();e&&(document.getElementById({bank_account_type:`bankTypeGroup`,routing_number:`routing_number`,account_number:`account_number`,remittance_email:`remittance_email`}[e])?.focus?.(),window.Toast?.danger?.(this.errors[e]||`Please review the highlighted fields.`,`Error`))},_makeRenderClone(e){let t=typeof e==`string`?document.querySelector(e):e,n=t.cloneNode(!0);n.id=(t.id||`print`)+`-clone`,n.classList.add(`pdf-capture`),n.setAttribute(`x-ignore`,``);let r=e=>e.startsWith(`x-`)||e.startsWith(`@`)||e.startsWith(`:`)||e.startsWith(`wire:`)||e.startsWith(`wire-`);return n.querySelectorAll(`*`).forEach(e=>{[...e.attributes].forEach(t=>{r(t.name)&&e.removeAttribute(t.name)})}),n.style.cssText=`
448        position:absolute!important;left:-9999px!important;top:-9999px!important;
449        width:${t.scrollWidth||t.clientWidth}px!important;
450        background:#fff!important;color:#000!important;
451        overflow:visible!important;max-height:none!important;height:auto!important;
452        padding:0!important;margin:0!important;border:none!important;
453      `,n},async saveAndContinue(){if(!this.validate()){this.focusFirstError();return}try{await this._requireSignature(`sig-main`),this.loading=`Preparing document...`;let n=document.getElementById(`ach-authorization`);if(!n)throw Error(`Form element not found`);let r=this._makeRenderClone(n);r.classList.add(`pdf-capture`),document.body.appendChild(r),await(document.fonts?.ready??Promise.resolve()),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));let i=await html2canvas(r,{scale:1,useCORS:!0,backgroundColor:`#ffffff`,windowWidth:r.scrollWidth,windowHeight:r.scrollHeight});document.body.removeChild(r);let a=new((window.jspdf?.jsPDF)||window.jsPDF)({unit:`pt`,format:`letter`,orientation:`p`,compress:!0}),o=a.internal.pageSize.getWidth(),s=a.internal.pageSize.getHeight(),c=o-48,l=s-48,u=i.width,d=i.height,f=Math.max(1,Math.floor(l/c*u)),p=document.createElement(`canvas`),m=p.getContext(`2d`,{willReadFrequently:!0}),h=()=>{a.setFont(`helvetica`,`normal`),a.setFontSize(9);
453let e=(this.fullName||``).trim(),t=new Date().toLocaleString(),n=this.ipAddress?` • IP ${this.ipAddress}`:``;a.text(`Signed by ${e} on ${t}${n}`,24,s-10)},g=0,_=0;for(;g<d;){let n=Math.min(f,d-g),r=Math.max(1,Math.round(u*e)),o=Math.max(1,Math.round(n*e));p.width=r,p.height=o,m.clearRect(0,0,r,o),m.drawImage(i,0,g,u,n,0,0,r,o);let s=p.toDataURL(`image/jpeg`,t),l=n/u*c;_>0&&a.addPage(),a.addImage(s,`JPEG`,24,24,c,l,void 0,`FAST`),h(),g+=n,_++}this.loading=`Saving document...`;let v=a.output(`blob`),y=await this._blobToBase64(v);await this.$wire.savePdf({base64:y})}catch(e){this.loading=!1,String(e?.message||``).startsWith(`signature_`)?window.Toast?.danger?.(`Please provide a valid signature and try again.`,`Error`):(console.log(e),window.Toast?.danger?.(`Unable to save. Please try again.`,`Error`))}},_requireSignature(e){return new Promise((t,n)=>{let r=null,i=()=>{window.removeEventListener(`signature:captured`,a),window.removeEventListener(`signature:invalid`,o),r!==null&&clearTimeout(r)},a=n=>{n?.detail?.id===e&&(i(),t(n.detail.dataUrl))},o=t=>{t?.detail?.id===e&&(i(),n(Error(`signature_invalid:${t.detail?.reason||`unknown`}`)))};window.addEventListener(`signature:captured`,a),window.addEventListener(`signature:invalid`,o),Promise.resolve().then(()=>window.dispatchEvent(new CustomEvent(`signature:capture`,{detail:{id:e}}))),r=setTimeout(()=>{i(),n(Error(`signature_timeout`))},8e3)})},_blobToBase64(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>
453t(r.result),r.onerror=n,r.readAsDataURL(e)})}})),Alpine.data(`scheduleAComponent`,(n,r,i)=>({agreementDate:n,broker:r,ipAddress:i,loading:!1,init(){window.html2canvas||console.warn(`html2canvas not loaded`),!window.jspdf&&!window.jsPDF&&console.warn(`jsPDF not loaded`)},async saveAndContinue(){try{await this._requireSignature(`sig-main-schedule-a`),this.loading=`Preparing document...`;let n=document.getElementById(`schedule-a`);if(!n)throw Error(`Schedule A element not found`);let r=this._makeRenderClone(n);r.classList.add(`pdf-capture`),document.body.appendChild(r),await(document.fonts?.ready??Promise.resolve()),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));let i=await html2canvas(r,{scale:1,useCORS:!0,backgroundColor:`#ffffff`,windowWidth:r.scrollWidth,windowHeight:r.scrollHeight});document.body.removeChild(r);let a=new((window.jspdf?.jsPDF)||window.jsPDF)({unit:`pt`,format:`letter`,orientation:`p`,compress:!0}),o=a.internal.pageSize.getWidth(),s=a.internal.pageSize.getHeight(),c=o-48,l=s-48,u=i.width,d=i.height,f=Math.max(1,Math.floor(l/c*u)),p=document.createElement(`canvas`),m=p.getContext(`2d`,{willReadFrequently:!0}),h=()=>{a.setFont(`helvetica`,`normal`),a.setFontSize(9);let e=(this.broker?.name??``).trim()||`${this.broker?.firstname??``} ${this.broker?.lastname??``}`.trim(),t=new Date().toLocaleString(),n=this.ipAddress?` • IP ${this.ipAddress}`:``;a.text(`Signed by ${e} on ${t}${n}`,24,s-10)},g=0,_=0;for(;g<d;){let n=Math.min(f,d-g),r=Math.max(1,Math.round(u*e)),o=Math.max(1,Math.round(n*e));p.width=r,p.height=o,m.clearRect(0,0,r,o),m.drawImage(i,0,g,u,n,0,0,r,o);let s=p.toDataURL(`image/jpeg`,t),l=n/u*c;_>0&&a.addPage(),a.addImage(s,`JPEG`,24,24,c,l,void 0,`FAST`),h(),g+=n,_++}this.loading=`Saving document...`;let v=a.output(`blob`),y=await this._blobToBase64(v);await this.$wire.savePdf({base64:y})}catch(e){this.loading=!1,String(e?.message||``).startsWith(`signature_`)?window.Toast?.danger?.(`Please provide a valid signature and try again.`,`Error`):(console.error(e),window.Toast?.danger?.(`Unable to save. Please try again.`,`Error`))}},_makeRenderClone(e){let t=typeof e==`string`?document.querySelector(e):e,n=t.cloneNode(!0);n.classList.add(`pdf-capture`),n.id=(t.id||`schedule-a`)+`-clone`;let r=e=>{[...e.attributes||[]].forEach(t=>{/^(x-|@|:|wire:|wire-)/.test(t.name)&&e.removeAttribute(t.name)})};return r(n),n.querySelectorAll(`*`).forEach(r),n.setAttribute(`x-ignore`,``),n.setAttribute(`wire:ignore`,``),n.setAttribute(`data-livewire-ignore`,``),n.style.cssText=`
454        position:absolute!important;left:-9999px!important;top:-9999px!important;
455        width:${t.scrollWidth||t.clientWidth}px!important;
456        background:#fff!important;color:#000!important;
457        overflow:visible!important;max-height:none!important;height:auto!important;
458        padding:0!important;margin:0!important;border:none!important;
459      `,n},_requireSignature(e){return new Promise((t,n)=>{let r=null,i=()=>{window.removeEventListener(`signature:captured`,a),window.removeEventListener(`signature:invalid`,o),r!==null&&clearTimeout(r)},a=n=>{n?.detail?.id===e&&(i(),t(n.detail.dataUrl))},o=t=>{t?.detail?.id===e&&(i(),n(Error(`signature_invalid:${t.detail?.reason||`unknown`}`)))};window.addEventListener(`signature:captured`,a),window.addEventListener(`signature:invalid`,o),Promise.resolve().then(()=>{window.dispatchEvent(new CustomEvent(`signature:capture`,{detail:{id:e}}))}),r=setTimeout(()=>{i(),n(Error(`signature_timeout`))},8e3)})},_blobToBase64(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>
vendor: 5,984 bytes, line 459
459t(r.result),r.onerror=n,r.readAsDataURL(e)})}}))});var KF=`bottom`,qF=`right`,JF=`left`,YF=`auto`,XF=[`top`,KF,qF,JF],ZF=`start`,QF=`clippingParents`,$F=`viewport`,eI=`popper`,tI=`reference`,nI=XF.reduce(function(e,t){return e.concat([t+`-`+ZF,t+`-end`])},[]),rI=[].concat(XF,[YF]).reduce(function(e,t){return e.concat([t,t+`-`+ZF,t+`-end`])},[]),iI=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function aI(e){return e?(e.nodeName||``).toLowerCase():null}function oI(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function sI(e){return e instanceof oI(e).Element||e instanceof Element}function cI(e){return e instanceof oI(e).HTMLElement||e instanceof HTMLElement}function lI(e){return typeof ShadowRoot>`u`?!1:e instanceof oI(e).ShadowRoot||e instanceof ShadowRoot}function uI(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!cI(i)||!aI(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function dI(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!cI(r)||!aI(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var fI={name:`applyStyles`,enabled:!0,phase:`write`,fn:uI,effect:dI,requires:[`computeStyles`]};function pI(e){return e.split(`-`)[0]}var mI=Math.max,hI=Math.min,gI=Math.round;function _I(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function vI(){return!/^((?!chrome|android).)*safari/i.test(_I())}function yI(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&cI(e)&&(i=e.offsetWidth>0&&gI(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&gI(r.height)/e.offsetHeight||1);var o=(sI(e)?oI(e):window).visualViewport,s=!vI()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function bI(e){var t=yI(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function xI(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&lI(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function SI(e){return oI(e).getComputedStyle(e)}function CI(e){return[`table`,`td`,`th`].indexOf(aI(e))>=0}function wI(e){return((sI(e)?e.ownerDocument:e.document)||window.document).documentElement}function TI(e){return aI(e)===`html`?e:e.assignedSlot||e.parentNode||(lI(e)?e.host:null)||wI(e)}function EI(e){return!cI(e)||SI(e).position===`fixed`?null:e.offsetParent}function DI(e){var t=/firefox/i.test(_I());if(/Trident/i.test(_I())&&cI(e)&&SI(e).position===`fixed`)return null;var n=TI(e);for(lI(n)&&(n=n.host);cI(n)&&[`html`,`body`].indexOf(aI(n))<0;){var r=SI(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function OI(e){for(var t=oI(e),n=EI(e);n&&CI(n)&&SI(n).position===`static`;)n=EI(n);return n&&(aI(n)===`html`||aI(n)===`body`&&SI(n).position===`static`)?t:n||DI(e)||t}function kI(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function AI(e,t,n){return mI(e,hI(t,n))}function jI(e,t,n){var r=AI(e,t,n);return r>n?n:r}function MI(){return{top:0,right:0,bottom:0,left:0}}function NI(e){return Object.assign({},MI(),e)}function PI(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var FI=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,NI(typeof e==`number`?PI(e,XF):e)};function II(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=pI(n.placement),c=kI(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=FI(i.padding,n),d=bI(a),f=c===`y`?`top`:JF,p=c===`y`?KF:qF,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=OI(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=AI(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function LI(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||xI(t.elements.popper,r)&&(t.elements.arrow=r))}var RI={name:`arrow`,enabled:!0,phase:`main`,fn:II,effect:LI,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function zI(e){return e.split(`-`)[1]}var BI={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function VI(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:gI(n*i)/i||0,y:gI(r*i)/i||0}}function HI(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=JF,b=`top`,x=window;if(l){var S=OI(n),C=`clientHeight`,w=`clientWidth`;if(S===oI(n)&&(S=wI(n),SI(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=KF;
vendor: 4,964 bytes, line 459
459var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=qF;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&BI),O=u===!0?VI({x:p,y:h},oI(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function UI(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:pI(t.placement),variation:zI(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,HI(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,HI(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var WI={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:UI,data:{}},GI={passive:!0};function KI(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=oI(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,GI)}),s&&c.addEventListener(`resize`,n.update,GI),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,GI)}),s&&c.removeEventListener(`resize`,n.update,GI)}}var qI={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:KI,data:{}},JI={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function YI(e){return e.replace(/left|right|bottom|top/g,function(e){return JI[e]})}var XI={start:`end`,end:`start`};function ZI(e){return e.replace(/start|end/g,function(e){return XI[e]})}function QI(e){var t=oI(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $I(e){return yI(wI(e)).left+QI(e).scrollLeft}function eL(e,t){var n=oI(e),r=wI(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=vI();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+$I(e),y:c}}function tL(e){var t=wI(e),n=QI(e),r=e.ownerDocument?.body,i=mI(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=mI(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+$I(e),s=-n.scrollTop;return SI(r||t).direction===`rtl`&&(o+=mI(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function nL(e){var t=SI(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function rL(e){return[`html`,`body`,`#document`].indexOf(aI(e))>=0?e.ownerDocument.body:cI(e)&&nL(e)?e:rL(TI(e))}function iL(e,t){t===void 0&&(t=[]);var n=rL(e),r=n===e.ownerDocument?.body,i=oI(n),a=r?[i].concat(i.visualViewport||[],nL(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(iL(TI(a)))}function aL(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oL(e,t){var n=yI(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function sL(e,t,n){return t===`viewport`?aL(eL(e,n)):sI(t)?oL(t,n):aL(tL(wI(e)))}function cL(e){var t=iL(TI(e)),n=[`absolute`,`fixed`].indexOf(SI(e).position)>=0&&cI(e)?OI(e):e;return sI(n)?t.filter(function(e){return sI(e)&&xI(e,n)&&aI(e)!==`body`}):[]}function lL(e,t,n,r){var i=t===`clippingParents`?cL(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=sL(e,n,r);return t.top=mI(i.top,t.top),t.right=hI(i.right,t.right),t.bottom=hI(i.bottom,t.bottom),t.left=mI(i.left,t.left),t},sL(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function uL(e){var t=e.reference,n=e.element,r=e.placement,i=r?pI(r):null,a=r?zI(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case KF:c={x:o,y:t.y+t.height};break;case qF:c={x:t.x+t.width,y:s};break;case JF:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?kI(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case ZF:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2)}}return c}function dL(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?QF:s,l=n.rootBoundary,u=l===void 0?$F:l,d=n.elementContext,f
vendor: 4,283 bytes, line 459
459=d===void 0?eI:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=NI(typeof g==`number`?PI(g,XF):g),v=f===`popper`?tI:eI,y=e.rects.popper,b=e.elements[m?v:f],x=lL(sI(b)?b:b.contextElement||wI(e.elements.popper),c,u,o),S=yI(e.elements.reference),C=uL({reference:S,element:y,strategy:`absolute`,placement:i}),w=aL(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function fL(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?rI:c,u=zI(r),d=u?s?nI:nI.filter(function(e){return zI(e)===u}):XF,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=dL(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[pI(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function pL(e){if(pI(e)===`auto`)return[];var t=YI(e);return[ZI(e),t,ZI(t)]}function mL(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=pI(g)===g,v=c||(_||!m?[YI(g)]:pL(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(pI(n)===`auto`?fL(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=pI(E),O=zI(E)===ZF,k=[`top`,KF].indexOf(D)>=0,A=k?`width`:`height`,j=dL(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?qF:JF:O?KF:`top`;b[A]>x[A]&&(M=YI(M));var N=YI(M),P=[];if(a&&P.push(j[D]<=0),s&&P.push(j[M]<=0,j[N]<=0),P.every(function(e){return e})){w=E,C=!1;break}S.set(E,P)}if(C)for(var ee=m?3:1,te=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},ne=ee;ne>0&&te(ne)!==`break`;ne--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var hL={name:`flip`,enabled:!0,phase:`main`,fn:mL,requiresIfExists:[`offset`],data:{_skip:!1}};function gL(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function _L(e){return[`top`,qF,KF,JF].some(function(t){return e[t]>=0})}function vL(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=dL(t,{elementContext:`reference`}),s=dL(t,{altBoundary:!0}),c=gL(o,r),l=gL(s,i,a),u=_L(c),d=_L(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var yL={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:vL};function bL(e,t,n){var r=pI(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function xL(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=rI.reduce(function(e,n){return e[n]=bL(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var SL={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:xL};function CL(e){var t=e.state,n=e.name;t.modifiersData[n]=uL({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var wL={name:`popperOffsets`,enabled:!0,phase:`read`,fn:CL,data:{}};function TL(e){return e===`x`?`y`:`x`}function EL(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f
vendor: 4,514 bytes, line 459
459=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=dL(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=pI(t.placement),v=zI(t.placement),y=!v,b=kI(_),x=TL(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:JF,A=b===`y`?KF:qF,j=b===`y`?`height`:`width`,M=S[b],N=M+g[k],P=M-g[A],ee=p?-w[j]/2:0,te=v===`start`?C[j]:w[j],ne=v===`start`?-w[j]:-C[j],F=t.elements.arrow,re=p&&F?bI(F):{width:0,height:0},ie=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:MI(),I=ie[k],ae=ie[A],oe=AI(0,C[j],re[j]),se=y?C[j]/2-ee-oe-I-E.mainAxis:te-oe-I-E.mainAxis,ce=y?-C[j]/2+ee+oe+ae+E.mainAxis:ne+oe+ae+E.mainAxis,le=t.elements.arrow&&OI(t.elements.arrow),ue=le?b===`y`?le.clientTop||0:le.clientLeft||0:0,de=D?.[b]??0,fe=M+se-de-ue,pe=M+ce-de,me=AI(p?hI(N,fe):N,M,p?mI(P,pe):P);S[b]=me,O[b]=me-M}if(s){var he=b===`x`?`top`:JF,ge=b===`x`?KF:qF,_e=S[x],ve=x===`y`?`height`:`width`,ye=_e+g[he],be=_e-g[ge],xe=[`top`,JF].indexOf(_)!==-1,Se=D?.[x]??0,Ce=xe?ye:_e-C[ve]-w[ve]-Se+E.altAxis,we=xe?_e+C[ve]+w[ve]-Se-E.altAxis:be,Te=p&&xe?jI(Ce,_e,we):AI(p?Ce:ye,_e,p?we:be);S[x]=Te,O[x]=Te-_e}t.modifiersData[r]=O}}var DL={name:`preventOverflow`,enabled:!0,phase:`main`,fn:EL,requiresIfExists:[`offset`]};function OL(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function kL(e){return e===oI(e)||!cI(e)?QI(e):OL(e)}function AL(e){var t=e.getBoundingClientRect(),n=gI(t.width)/e.offsetWidth||1,r=gI(t.height)/e.offsetHeight||1;return n!==1||r!==1}function jL(e,t,n){n===void 0&&(n=!1);var r=cI(t),i=cI(t)&&AL(t),a=wI(t),o=yI(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((aI(t)!==`body`||nL(a))&&(s=kL(t)),cI(t)?(c=yI(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=$I(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function ML(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function NL(e){var t=ML(e);return iI.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function PL(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function FL(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var IL={placement:`bottom`,modifiers:[],strategy:`absolute`};function LL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function RL(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?IL:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},IL,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:sI(e)?iL(e):e.contextElement?iL(e.contextElement):[],popper:iL(t)};var s=NL(FL([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(LL(t,n)){i.rects={reference:jL(t,OI(n),i.options.strategy===`fixed`),popper:bI(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:PL(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!LL(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});
459function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var zL=RL({defaultModifiers:[qI,wL,WI,fI,SL,hL,DL,RI,yL]});window.initTooltip=function(e){let t=document.querySelector(`[data-tooltip-target="`+e+`"]`),n=document.getElementById(e);if(!t||!n)return;n._tooltipCleanup?.();let r=n.getAttribute(`data-tooltip-placement`)||`top`,i=n.getAttribute(`data-tooltip-trigger`)||`hover`,a,o=zL(t,n,{placement:r,modifiers:[{name:`offset`,options:{offset:[0,8]}}]});function s(){clearTimeout(a),n.classList.remove(`opacity-0`,`invisible`),n.classList.add(`opacity-100`,`visible`),o.setOptions(e=>({...e,modifiers:[...e.modifiers,{name:`eventListeners`,enabled:!0}]})),o.update()}function c(){clearTimeout(a),a=setTimeout(()=>{n.classList.remove(`opacity-100`,`visible`),n.classList.add(`opacity-0`,`invisible`),o.setOptions(e=>({...e,modifiers:[...e.modifiers,{name:`eventListeners`,enabled:!1}]}))},150)}let l=[],u=[];switch(i){case`hover`:l=[`mouseenter`,`focus`],u=[`mouseleave`,`blur`];break;case`click`:l=[`click`,`focus`],u=[`focusout`,`blur`];break;default:l=[`mouseenter`,`focus`],u=[`mouseleave`,`blur`]}l.forEach(e=>{t.addEventListener(e,s)}),u.forEach(e=>{t.addEventListener(e,c)}),n.addEventListener(`mouseenter`,s),n.addEventListener(`mouseleave`,c);function d(e){e.key===`Escape`&&c()}document.addEventListener(`keydown`,d),n._tooltipCleanup=()=>{clearTimeout(a),l.forEach(e=>t.removeEventListener(e,s)),u.forEach(e=>t.removeEventListener(e,c)),document.removeEventListener(`keydown`,d),n.removeEventListener(`mouseenter`,s),n.removeEventListener(`mouseleave`,c),o.destroy(),delete n._tooltipCleanup}};function BL(e){Sentry.init({dsn:e.dsn,environment:e.env,debug:!1,beforeSend(e){return VL(e)||GL(e)||WL(e)?null:e},replaysSessionSampleRate:1,integrations:[new Sentry.Replay({maskAllText:!1,maskAllInputs:!0,blockAllMedia:!1,stickySession:!0})]}),Sentry.setUser(e.user),Array.isArray(e.tags)&&e.tags.forEach(e=>{Sentry.setTag(e[0],e[1])})}function VL(e){if(!HL(e?.extra?.__serialized__))return!1;let t=e?.exception?.values||[];return!t.some(e=>(e?.value||``).includes(`Object captured as promise rejection with keys: body, errors, json, status`))||!t.some(e=>e?.mechanism?.type===`onunhandledrejection`)?!1:UL(e)}function HL(e){if(!e||typeof e!=`object`)return!1;let t=[`body`,`errors`,`json`,`status`];return Object.keys(e).length===t.length&&t.every(t=>Object.prototype.hasOwnProperty.call(e,t)&&e[t]===null)}function UL(e){return(e?.breadcrumbs||[]).some(e=>{let t=e?.data?.url||e?.message||``;return t.includes(`/portal/lw_update`)||t.includes(`/livewire/update`)||t.includes(`/portal/livewire-script`)||t.includes(`/portal/livewire-csp-script`)})}function WL(e){return(e?.exception?.values||[]).some(e=>{if(e.type!==`TypeError`||e.value!==`Cannot set properties of undefined (setting 'unknown')`)return!1;let t=e?.stacktrace?.frames||[],n=t.some(e=>(e?.function||``).includes(`formValues.reduce.credentials`)),r=t.some(e=>{let t=[e?.filename,e?.abs_path,e?.module].filter(Boolean).join(` `);return t.includes(`/js/app`)||t.includes(`app-public/`)});return n||r})}function GL(e){return(e?.exception?.values||[]).some(e=>e.type===`TypeError`&&e.value===`Failed to fetch`)?(e?.breadcrumbs||[]).some(e=>{let t=e?.data?.url||e?.message||``;return t.includes(`pusher.com`)||t.includes(`sockjs`)||t.includes(`/cdn-cgi/rum`)}):!1}window.sentryData&&BL(window.sentryData),document.addEventListener(`livewire:init`,function(){window.renderReCaptcha(),window.registerScriptRelay(),window.registerScriptAcknowledgedRelay(),document.querySelectorAll(`[data-tooltip-target]`).forEach(e=>{let t=e.getAttribute(`data-tooltip-target`);initTooltip(t)})}),document.addEventListener(`livewire:update`,function(){window.renderReCaptcha(),document.querySelectorAll(`[data-tooltip-target]`).forEach(e=>{let t=e.getAttribute(`data-tooltip-target`);initTooltip(t)})}),window.renderReCaptcha=function(){let e=document.querySelectorAll(`[data-recaptcha-container]`),t=document.querySelector(`meta[name="recaptcha-site-key"]`)?.getAttribute(`content`);!t||e.length===0||(typeof grecaptcha<`u`&&grecaptcha&&typeof grecaptcha.render==`function`?e.forEach((e,n)=>{if(e.dataset.widgetId)return;let r=document.createElement(`div`);r.id=`recaptcha-element-${n}`,e.appendChild(r),e.dataset.widgetId=grecaptcha.render(r,{sitekey:t,size:e.dataset.recaptchaSize||`normal`,callback:window.onReCaptchaCallback,"expired-callback":window.onReCaptchaExpired,"error-callback":window.onReCaptchaExpired})}):setTimeout(window.renderReCaptcha,500))},window.onReCaptchaCallback=function(e){Livewire.dispatch(`captchaResponse`,{recaptcha:e})},window.onReCaptchaExpired=function(){Livewire.dispatch(`captchaResponse`,{recaptcha:null})}
459,window.registerScriptRelay=function(){if(window.scriptRelayRegistered||typeof Livewire>`u`){console.warn(`Livewire is not available or script relay is already registered.`);return}window.scriptRelayRegistered=!0,Livewire.on(`scriptRelay`,(e=[])=>{let t=Array.isArray(e)?e:[e?.for,e?.isPlanScript,e?.discardable,e?.forceScriptId];setTimeout(()=>{Livewire.dispatch(`script`,[t[0]??null,t[1]??!0,t[2]??!0,t[3]??null])},150)})},window.registerScriptAcknowledgedRelay=function(){if(window.scriptAcknowledgedRelayRegistered||typeof Livewire>`u`){console.warn(`Livewire is not available or script acknowledged relay is already registered.`);return}window.scriptAcknowledgedRelayRegistered=!0,Livewire.on(`scriptAcknowledgedRelay`,(e=[])=>{let t=Array.isArray(e)?e:[e?.acknowledged,e?.scriptId,e?.for];setTimeout(()=>{Livewire.dispatch(`scriptAcknowledged`,[t[0]??!1,t[1]??null,t[2]??null])},150)})},window.scriptScroll=function(){let e=document.querySelector(`#script`);if(!e)return;let t=e.offsetHeight,n=e.scrollTop,r=e.scrollHeight,i=e.getAttribute(`acknowledged`),a=document.getElementById(`acknowledge`),o=document.getElementById(`acknowledge-disabled`),s=document.getElementById(`scroll-me`);t+n>=r?(e.setAttribute(`acknowledged`,!0),a?.classList.remove(`hidden`),o?.classList.add(`hidden`),s?.classList.add(`hidden`)):i||(o?.classList.remove(`hidden`),a?.classList.add(`hidden`))},window.scriptReady=function(){let e=document.getElementById(`acknowledge-loader`),t=document.getElementById(`acknowledge-buttons`);e?.classList.add(`hidden`),t?.classList.remove(`hidden`),e&&t&&window.scriptScroll()},window.addEventListener(`scriptReady`,()=>{setTimeout(window.scriptReady,700)}),window.renderReCaptcha();var KL=document.querySelector(`[data-vector-app]`);if(KL){let e=new WeakMap,t=null;KL.addEventListener(`click`,e=>{let n=e.target instanceof Element?e.target.closest(`button, a`):null;n&&(t=n)},!0);let n=e=>{window.requestAnimationFrame(()=>{!e.isConnected||e.contains(document.activeElement)||e.querySelector(`[autofocus], button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])`)?.focus({preventScroll:!0})})};new MutationObserver(r=>{r.forEach(r=>{r.addedNodes.forEach(r=>{r instanceof Element&&(r.matches(`[role='dialog']`)?[r]:[...r.querySelectorAll(`[role='dialog']`)]).forEach(r=>{t?.isConnected&&e.set(r,t),n(r)})}),r.removedNodes.forEach(t=>{t instanceof Element&&(t.matches(`[role='dialog']`)?[t]:[...t.querySelectorAll(`[role='dialog']`)]).forEach(t=>{let n=e.get(t);n?.isConnected&&window.requestAnimationFrame(()=>n.focus({preventScroll:!0}))})})})}).observe(KL,{childList:!0,subtree:!0})}var qL=o(((e,t)=>{(function(e){"use strict";let n=`[data-website-editor]`,r=`[data-editor-command]`,i=new WeakMap,a=new WeakMap,o=0,s=[`bold`,`italic`,`underline`,`strike`,`code`,`link`],c={B:`bold`,STRONG:`bold`,I:`italic`,EM:`italic`,U:`underline`,S:`strike`,STRIKE:`strike`,DEL:`strike`,CODE:`code`},l={bold:`strong`,italic:`em`,underline:`u`,strike:`s`,code:`code`,link:`a`},u={bold:`Bold`,italic:`Italic`,underline:`Underline`,strike:`Strikethrough`,"inline-code":`Inline code`,link:`Add or edit link`,unlink:`Remove link`,"paste-plain":`Paste as plain text`,paragraph:`Paragraph`,"heading-2":`Heading 2`,"heading-3":`Heading 3`,"heading-4":`Heading 4`,"heading-5":`Heading 5`,"heading-6":`Heading 6`,blockquote:`Block quote`,"code-block":`Code block`,"bullet-list":`Bulleted list`,"ordered-list":`Numbered list`,"horizontal-rule":`Horizontal rule`,"insert-table":`Insert table`,"table-add-row":`Add table row`,"table-delete-row":`Delete table row`,"table-add-column":`Add table column`,"table-delete-column":`Delete table column`,"clear-formatting":`Clear formatting`,undo:`Undo`,redo:`Redo`},d={bold:`Control+B Meta+B`,italic:`Control+I Meta+I`,underline:`Control+U Meta+U`,undo:`Control+Z Meta+Z`,redo:`Control+Shift+Z Meta+Shift+Z Control+Y Meta+Y`};function f(){return{version:1,type:`doc`,content:[{type:`paragraph`,content:[]}]}}function p(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function m(e,t,n,r){let i=Number(e);return Number.isInteger(i)?Math.min(n,Math.max(t,i)):r}function h(e,t=1e4){return typeof e==`string`?e.slice(0,t):``}function g(e){let t=h(e,2048).trim();if(t===``||/[\u0000-\u0020\u007f\\]/u.test(t)||t.startsWith(`//`))return null;if(t.startsWith(`/`)||t.startsWith(`#`))return t;let n=t.match(/^([a-z][a-z0-9+.-]*):/iu)?.[1]?.toLowerCase();if(!n||![`https`,`mailto`,`tel`].includes(n))return null;if(n===`https`)try{let e=new URL(t);if(e.protocol!==`https:`||e.hostname===``||e.username!==``||e.password!==``||e.port!==``)return null}catch{return null}return t}function _(e){let t=h(e,4096).trim(),n;try{n=new URL(t)}catch{return null}return n.protocol!==`https:`||n.hostname===``||n.username!==``||n.password!==``||n.port!==``||n.hash!==``||/[\u0000-\u0020\u007f\\]/u.test(t)?null:n.toString()}function v(e){let t=p(e)?e:{},n={images:Object.create(null),videos:Object.create(null)};
459return[`images`,`videos`].forEach(e=>{Object.entries(p(t[e])?t[e]:{}).slice(0,200).forEach(([t,r])=>{let i=w(t);if(!i||!p(r))return;let a={title:h(r.title,500),alt:h(r.alt,1e3),width:w(r.width),height:w(r.height)};if(e===`images`){if(a.url=_(r.url),!a.url)return}else a.poster_url=_(r.poster_url??r.posterUrl);n[e][String(i)]=a})}),n}function y(e){let t=e?.querySelector?.(`[data-editor-media-registry]`);if(!t)return v({});try{return v(JSON.parse(t.textContent||`{}`))}catch{return v({})}}function b(e,t){let n=w(t?.database_id??t?.databaseId);if(!n||t?.kind!==`image`)return!1;let r=v({images:{[n]:{url:t.url,title:t.title,alt:t.alt_text??t.alt,width:t.width,height:t.height}}}).images[String(n)];if(!r)return!1;let i=Object.keys(e.images);return!Object.hasOwn(e.images,String(n))&&i.length>=200&&delete e.images[i[0]],e.images[String(n)]=r,!0}function x(e){if(!p(e)||!s.includes(e.type))return null;if(e.type!==`link`)return{type:e.type};let t=g(e.attrs?.href);return t?{type:`link`,attrs:{href:t,target:e.attrs?.target===`_blank`?`_blank`:`_self`}}:null}function S(e){let t=new Map;
459return(Array.isArray(e)?e:[]).forEach(e=>{let n=x(e);n&&t.set(n.type,n)}),s.filter(e=>t.has(e)).map(e=>t.get(e))}function C(e,t){return JSON.stringify(e??[])===JSON.stringify(t??[])}function w(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0?t:null}function T(e,t){let n=h(e,t).trim();return n===``?null:n}function E(e){let t={managed_image:`image`,managed_video:`video`}[e.type]??e.type,n=w(e.attrs?.media_id??e.attrs?.mediaId);if([`image`,`video`].includes(t)&&n){if(t===`image`){let r={media_id:n,alt:h(e.attrs?.alt,1e3),decorative:e.attrs?.decorative===!0||e.attrs?.decorative===1||e.attrs?.decorative===`1`,caption:T(e.attrs?.caption,2e3),alignment:[`left`,`center`,`right`,`wide`].includes(e.attrs?.alignment)?e.attrs.alignment:`center`,link:g(e.attrs?.link)};return r.decorative&&(r.alt=``),r.link||delete r.link,{type:t,attrs:r}}return{type:t,attrs:{media_id:n,poster_media_id:w(e.attrs?.poster_media_id??e.attrs?.posterMediaId),title:h(e.attrs?.title,500),caption:T(e.attrs?.caption,2e3)}}}if(t===`youtube`){let t=h(e.attrs?.video_id??e.attrs?.videoId,32).trim();if(/^[A-Za-z0-9_-]{11}$/u.test(t))return{type:`youtube`,attrs:{video_id:t,start_seconds:m(e.attrs?.start_seconds??e.attrs?.startSeconds,0,86400,0),title:h(e.attrs?.title,500),caption:T(e.attrs?.caption,2e3)}}}return null}function D(e){let t=[];
459return(Array.isArray(e)?e:[]).forEach(e=>{if(!p(e))return;if(e.type===`hard_break`){t.push({type:`hard_break`});return}if(e.type!==`text`)return;let n=h(e.text,1e6).replace(/\r\n?/gu,`
460`);if(n===``)return;let r=S(e.marks);n.split(`
461`).forEach((e,n)=>{if(n>0&&t.push({type:`hard_break`}),e===``)return;let i=t.at(-1);if(i?.type===`text`&&C(i.marks,r)){i.text+=e;return}t.push({type:`text`,text:e,...r.length?{marks:r}:{}})})}),t}function O(e,t=0){if(!p(e)||t>8)return null;if(t===0){let t=E(e);if(t)return t}if(e.type===`paragraph`)return{type:`paragraph`,content:D(e.content)};if(e.type===`heading`)return{type:`heading`,attrs:{level:m(e.attrs?.level,2,6,2)},content:D(e.content)};if(e.type===`code_block`)return{type:`code_block`,text:h(e.text??(Array.isArray(e.content)?e.content.map(e=>h(e?.text)).join(``):``),1e6)};if(e.type===`horizontal_rule`)return{type:`horizontal_rule`};if(e.type===`blockquote`){let n=(Array.isArray(e.content)?e.content:[]).map(e=>O(e,t+1)).filter(Boolean).filter(e=>[`paragraph`,`heading`,`code_block`].includes(e.type));return{type:`blockquote`,content:n.length>0?n:[{type:`paragraph`,content:[]}]}}if([`bullet_list`,`ordered_list`].includes(e.type)){let n=(Array.isArray(e.content)?e.content:[]).map(e=>{if(!p(e)||e.type!==`list_item`)return null;let n=(Array.isArray(e.content)?e.content:[]).map(e=>O(e,t+1)).filter(Boolean).filter(e=>[`paragraph`,`heading`,`blockquote`,`code_block`,`bullet_list`,`ordered_list`].includes(e.type));return{type:`list_item`,content:n.length>0?n:[{type:`paragraph`,content:[]}]}}).filter(Boolean);if(n.length===0)return null;let r={type:e.type,content:n};return e.type===`ordered_list`&&(r.attrs={start:m(e.attrs?.start,1,9999,1)}),r}if(e.type===`table`){let t=(Array.isArray(e.content)?e.content:[]).slice(0,50).map(e=>{if(!p(e)||e.type!==`table_row`)return null;let t=(Array.isArray(e.content)?e.content:[]).slice(0,12).map(e=>!p(e)||e.type!==`table_cell`?null:{type:`table_cell`,content:D(e.content)}).filter(Boolean);return t.length>0?{type:`table_row`,content:t}:null}).filter(Boolean),n=t[0]?.content?.length??0;return t.length===0||n===0||t.some(e=>e.content.length!==n)?null:{type:`table`,attrs:{header_row:e.attrs?.header_row!==!1},content:t}}return null}function k(e){let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return f()}if(!p(t)||t.type!==`doc`)return f();let n=(Array.isArray(t.content)?t.content:[]).map(e=>O(e)).filter(Boolean);return{version:1,type:`doc`,content:n.length>0?n:[{type:`paragraph`,content:[]}]}}function A(e){return JSON.stringify(k(e))}function j(e){let t=[],n=e=>{if(Array.isArray(e)){e.forEach(n);return}p(e)&&((e.type===`text`&&typeof e.text==`string`||e.type===`code_block`&&typeof e.text==`string`)&&t.push(e.text),n(e.content))};n(k(e).content);let r=t.join(` `).match(/[\p{L}\p{N}]+(?:['’.-][\p{L}\p{N}]+)*/gu)??[];return{wordCount:r.length,readingTimeMinutes:Math.max(1,Math.ceil(r.length/225))}}function M(e){return String(e?.tagName??e?.nodeName??``).toUpperCase()}function N(e){return Array.from(e?.childNodes??[])}function P(e,t){return typeof e?.getAttribute==`function`?e.getAttribute(t):e?.attributes?.[t]??null}function ee(e,t=[]){let n=[],r=Array.from(e??[]).filter(e=>e?.nodeType===1||e?.nodeType===3);return r.length===1&&r[0]?.nodeType===1&&M(r[0])===`BR`?n:(r.forEach(e=>{if(e?.nodeType===3){n.push({type:`text`,text:e.nodeValue??e.textContent??``,...t.length?{marks:t}:{}});return}if(e?.nodeType!==1)return;let r=M(e);if([`SCRIPT`,`STYLE`,`NOSCRIPT`,`IFRAME`,`OBJECT`,`EMBED`,`FORM`,`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`,`META`,`LINK`,`BASE`,`SVG`,`MATH`].includes(r))return;if(r===`BR`){n.push({type:`hard_break`});return}if(P(e,`data-editor-node`))return;let i=[...t],a=c[r];a&&i.push({type:a}),r===`A`&&i.push({type:`link`,attrs:{href:P(e,`href`),target:P(e,`target`)}}),n.push(...ee(N(e),S(i)))}),D(n))}function te(e){return N(e).some(e=>e?.nodeType===1&&/^(P|DIV|H[2-6]|BLOCKQUOTE|UL|OL|PRE|HR|TABLE)$/u.test(M(e)))}function ne(e){let t=[];return N(e).forEach(e=>{if(e?.nodeType===1){if(M(e)===`TR`){t.push(e);return}
461[`THEAD`,`TBODY`,`TFOOT`].includes(M(e))&&N(e).forEach(e=>{e?.nodeType===1&&M(e)===`TR`&&t.push(e)})}}),t}function F(e){let t=ne(e).slice(0,50).map(e=>{let t=N(e).filter(e=>e?.nodeType===1&&[`TH`,`TD`].includes(M(e))).slice(0,12).map(e=>({type:`table_cell`,content:ee(N(e))}));return t.length>0?{type:`table_row`,content:t}:null}).filter(Boolean),n=t[0]?.content?.length??0;if(t.length===0||n===0||t.some(e=>e.content.length!==n))return null;let r=ne(e)[0];return{type:`table`,attrs:{header_row:!!(r&&N(r).some(e=>e?.nodeType===1&&M(e)===`TH`))},content:t}}function re(e){let t=[],n=[],r=()=>{let e=ee(n);e.length>0&&t.push({type:`paragraph`,content:e}),n=[]};return N(e).forEach(e=>{if(e?.nodeType===3){(e.nodeValue??``).length>0&&n.push(e);return}if(e?.nodeType!==1)return;let i=M(e),a=P(e,`data-editor-node`);if(a){r();let n=E({type:a,attrs:{media_id:P(e,`data-media-id`),video_id:P(e,`data-video-id`),poster_media_id:P(e,`data-poster-media-id`),start_seconds:P(e,`data-start-seconds`),title:P(e,`data-title`),alt:P(e,`data-alt`),decorative:P(e,`data-decorative`)===`true`,caption:P(e,`data-caption`),alignment:P(e,`data-alignment`),link:P(e,`data-link`)}});n&&t.push(n);return}if(!/^(P|DIV|H[2-6]|BLOCKQUOTE|UL|OL|PRE|HR|TABLE)$/u.test(i)){n.push(e);return}if(r(),i===`P`||i===`DIV`){te(e)?t.push(...re(e)):t.push({type:`paragraph`,content:ee(N(e))});return}if(/^H[2-6]$/u.test(i)){t.push({type:`heading`,attrs:{level:Number(i.slice(1))},content:ee(N(e))});return}if(i===`PRE`){t.push({type:`code_block`,text:e.textContent??``});return}if(i===`HR`){t.push({type:`horizontal_rule`});return}if(i===`TABLE`){let n=F(e);n&&t.push(n);return}if(i===`BLOCKQUOTE`){let n=re(e);t.push({type:`blockquote`,content:n.length>0?n:[{type:`paragraph`,content:ee(N(e))}]});return}if(i===`UL`||i===`OL`){let n=N(e).filter(e=>e?.nodeType===1&&M(e)===`LI`).map(e=>({type:`list_item`,content:te(e)?re(e):[{type:`paragraph`,content:ee(N(e))}]}));n.length>0&&t.push({type:i===`UL`?`bullet_list`:`ordered_list`,...i===`OL`?{attrs:{start:m(P(e,`start`),1,9999,1)}}:{},content:n})}}),r(),t}function ie(e){return k({version:1,type:`doc`,content:re(e)})}function I(e,t,n){let r=l[n.type];if(!r)return t;let i=e.createElement(r);return n.type===`link`&&(i.setAttribute(`href`,n.attrs.href),n.attrs.target===`_blank`&&(i.setAttribute(`target`,`_blank`),i.setAttribute(`rel`,`noopener noreferrer`))),t.appendChild(i),i}function ae(e,t,n,r){let i=e.createElement(`label`),a=e.createElement(`span`);i.setAttribute(`class`,`grid gap-1 text-xs font-semibold text-gray-700`),a.textContent=n,i.appendChild(a),i.appendChild(r),t.appendChild(i)}function oe(e,t,n,r=`text`){let i=e.createElement(`input`);return i.setAttribute(`type`,r),i.setAttribute(`data-editor-node-field`,t),i.setAttribute(`class`,`block w-full rounded-md border-gray-300 text-sm font-normal text-gray-900`),i.value=n??``,i}function se(e,t,n,r){let i=e.createElement(`details`),a=e.createElement(`summary`),o=e.createElement(`div`),s=e.createElement(`div`);if(i.setAttribute(`data-editor-node-inspector`,``),i.setAttribute(`class`,`mt-3 rounded-md border border-blue-200 bg-white p-3 text-left`),a.setAttribute(`class`,`cursor-pointer text-xs font-bold text-blue-900`),a.textContent=`Edit ${n.type} block`,o.setAttribute(`class`,`mt-3 grid gap-3 md:grid-cols-2`),n.type===`image`){ae(e,o,`Alternative text`,oe(e,`alt`,n.attrs.alt));let t=oe(e,`decorative`,``,`checkbox`);t.checked=n.attrs.decorative===!0,ae(e,o,`Decorative image`,t),ae(e,o,`Caption`,oe(e,`caption`,n.attrs.caption));let r=e.createElement(`select`);r.setAttribute(`data-editor-node-field`,`alignment`),r.setAttribute(`class`,`block w-full rounded-md border-gray-300 text-sm font-normal text-gray-900`),[`left`,`center`,`right`,`wide`].forEach(t=>{let n=e.createElement(`option`);n.setAttribute(`value`,t),n.textContent=t.charAt(0).toUpperCase()+t.slice(1),r.appendChild(n)}),r.value=n.attrs.alignment,ae(e,o,`Alignment`,r),ae(e,o,`Safe image link`,oe(e,`link`,n.attrs.link))}else if(ae(e,o,`Accessible title`,oe(e,`title`,n.attrs.title)),ae(e,o,`Caption`,oe(e,`caption`,n.attrs.caption)),n.type===`video`){let t=e.createElement(`select`),i=e.createElement(`option`);t.setAttribute(`data-editor-node-field`,`poster_media_id`),t.setAttribute(`class`,`block w-full rounded-md border-gray-300 text-sm font-normal text-gray-900`),i.setAttribute(`value`,``),i.textContent=`Use generated video poster`,t.appendChild(i),Object.entries(r.images).forEac
461h(([n,r])=>{let i=e.createElement(`option`);i.setAttribute(`value`,n),i.textContent=r.title||`Managed image ${n}`,t.appendChild(i)}),t.value=n.attrs.poster_media_id?String(n.attrs.poster_media_id):``,ae(e,o,`Poster image`,t)}else{let t=oe(e,`start_seconds`,String(n.attrs.start_seconds),`number`);t.setAttribute(`min`,`0`),t.setAttribute(`max`,`86400`),t.setAttribute(`step`,`1`),ae(e,o,`Start seconds`,t)}s.setAttribute(`class`,`mt-3 flex flex-wrap gap-2`),[[`move-up`,`Move up`],[`move-down`,`Move down`],[`remove`,`Remove block`]].forEach(([t,n])=>{let r=e.createElement(`button`);r.setAttribute(`type`,`button`),r.setAttribute(`data-editor-node-action`,t),r.setAttribute(`class`,t===`remove`?`rounded-md border border-red-300 bg-red-50 px-3 py-1.5 text-xs font-semibold text-red-800`:`rounded-md border border-gray-300 bg-white px-3 py-1.5 text-xs font-semibold text-gray-700`),r.textContent=n,s.appendChild(r)}),i.appendChild(a),i.appendChild(o),i.appendChild(s),t.appendChild(i)}function ce(e,t,n={}){let r=e.createElement(`figure`),i=n.mediaRegistry??v({}),a={image:`Managed image`,video:`Managed video`,youtube:`YouTube video`}[t.type];r.setAttribute(`contenteditable`,`false`),r.setAttribute(`data-editor-node`,t.type),r.setAttribute(`role`,`group`),r.setAttribute(`aria-label`,t.attrs.title||t.attrs.alt||a),r.setAttribute(`data-title`,t.attrs.title||``),t.attrs.media_id&&r.setAttribute(`data-media-id`,t.attrs.media_id),t.attrs.video_id&&r.setAttribute(`data-video-id`,t.attrs.video_id),t.attrs.poster_media_id&&r.setAttribute(`data-poster-media-id`,t.attrs.poster_media_id),t.attrs.start_seconds&&r.setAttribute(`data-start-seconds`,t.attrs.start_seconds),t.type===`image`&&r.setAttribute(`data-decorative`,t.attrs.decorative?`true`:`false`),[`alt`,`caption`,`alignment`,`link`].forEach(e=>{t.attrs[e]!==null&&t.attrs[e]!==``&&r.setAttribute(`data-${e.replace(`_`,`-`)}`,t.attrs[e])});let o=e.createElement(`div`);if(o.setAttribute(`data-editor-node-preview`,t.type),o.setAttribute(`class`,`overflow-hidden rounded-md bg-slate-100 text-center font-normal text-slate-700`),t.type===`image`){let n=i.images[String(t.attrs.media_id)];if(r.setAttribute(`style`,{left:`max-width:50%;margin-right:auto;`,center:`max-width:48rem;margin-left:auto;margin-right:auto;`,right:`max-width:50%;margin-left:auto;`,wide:`width:100%;`}[t.attrs.alignment]),n?.url){let r=e.createElement(`img`);r.setAttribute(`data-editor-preview-image`,``),r.setAttribute(`src`,n.url),r.setAttribute(`alt`,t.attrs.decorative?``:t.attrs.alt),r.setAttribute(`loading`,`eager`),r.setAttribute(`class`,`block h-auto w-full object-contain`),n.width&&n.height&&(r.setAttribute(`width`,n.width),r.setAttribute(`height`,n.height)),o.appendChild(r)}else o.textContent=`[${a}: ${t.attrs.alt||`managed asset`}]`;if(t.attrs.link){let n=e.createElement(`p`);n.setAttribute(`class`,`break-all px-3 py-2 text-xs text-blue-800`),n.textContent=`Linked to ${t.attrs.link}`,o.appendChild(n)}}else if(t.type===`video`){let n=i.videos[String(t.attrs.media_id)],r=(t.attrs.poster_media_id?i.images[String(t.attrs.poster_media_id)]:null)?.url??n?.poster_url;if(r){let t=e.createElement(`img`);t.setAttribute(`data-editor-preview-poster`,``),t.setAttribute(`src`,r),t.setAttribute(`alt`,``),t.setAttribute(`class`,`block h-auto w-full object-contain`),o.appendChild(t)}let a=e.createElement(`p`);a.setAttribute(`class`,`px-4 py-3 text-sm font-semibold`),a.textContent=`▶ ${t.attrs.title||`Managed MP4`} (preview image only)`,o.appendChild(a)}else{o.setAttribute(`style`,`aspect-ratio:16/9;display:grid;place-items:center;`);let n=e.createElement(`p`);n.setAttribute(`data-editor-preview-youtube`,``),n.setAttribute(`class`,`px-4 py-3 text-sm font-semibold`),n.textContent=`▶ ${t.attrs.title||`YouTube video`} — ${t.attrs.video_id}${t.attrs.start_seconds>0?` from ${t.attrs.start_seconds}s`:``}`,o.appendChild(n)}if(r.appendChild(o),t.attrs.caption){let n=e.createElement(`figcaption`);n.setAttribute(`class`,`mt-2 text-center text-sm font-normal text-slate-700`),n.textContent=t.attrs.caption,r.appendChild(n)}return n.readOnly||se(e,r,t,i),r}
461function le(e,t,n){n.forEach(n=>{if(n.type===`hard_break`){t.appendChild(e.createElement(`br`));return}if(n.type!==`text`)return;let r=t;(n.marks??[]).forEach(t=>{r=I(e,r,t)}),r.appendChild(e.createTextNode(n.text))})}function ue(e,t,n={}){let r;if(t.type===`heading`)return r=e.createElement(`h${t.attrs.level}`),le(e,r,t.content),r;if(t.type===`paragraph`)return r=e.createElement(`p`),le(e,r,t.content),t.content.length===0&&r.appendChild(e.createElement(`br`)),r;if(t.type===`code_block`)return r=e.createElement(`pre`),r.appendChild(e.createTextNode(t.text)),r;if(t.type===`horizontal_rule`)return e.createElement(`hr`);if([`image`,`video`,`youtube`].includes(t.type))return ce(e,t,n);if(t.type===`table`){r=e.createElement(`table`);let n=t.attrs.header_row?e.createElement(`thead`):null,i=e.createElement(`tbody`);return t.content.forEach((r,a)=>{let o=e.createElement(`tr`),s=t.attrs.header_row&&a===0;r.content.forEach(t=>{let n=e.createElement(s?`th`:`td`);s&&n.setAttribute(`scope`,`col`),le(e,n,t.content),t.content.length===0&&n.appendChild(e.createElement(`br`)),o.appendChild(n)}),(s?n:i).appendChild(o)}),n&&r.appendChild(n),i.childNodes.length>0&&r.appendChild(i),r}return t.type===`blockquote`?(r=e.createElement(`blockquote`),t.content.forEach(t=>r.appendChild(ue(e,t,n))),r):[`bullet_list`,`ordered_list`].includes(t.type)?(r=e.createElement(t.type===`bullet_list`?`ul`:`ol`),t.type===`ordered_list`&&t.attrs.start!==1&&r.setAttribute(`start`,t.attrs.start),t.content.forEach(t=>{let i=e.createElement(`li`);t.content.forEach(t=>i.appendChild(ue(e,t,n))),r.appendChild(i)}),r):null}function de(t,n,r=null){let i=k(n),o=t.ownerDocument??e.document,s=o.createDocumentFragment(),c=r??a.get(t)??{mediaRegistry:v({}),readOnly:!1};return r&&a.set(t,c),i.content.forEach(e=>{let t=ue(o,e,c);t&&s.appendChild(t)}),t.replaceChildren(s),i}function fe(t,n){let r=n??e.document??e.window?.document;if(!r?.createElement)return f();let i=r.createElement(`template`);i.innerHTML=h(t,2e6);let a=ie(i.content??i);return a.content=a.content.filter(e=>![`image`,`video`,`youtube`].includes(e.type)),k(a)}function pe(t){let n=(t.ownerDocument??e.document)?.getSelection?.()??e.getSelection?.();return!n||n.rangeCount===0||!t.contains(n.anchorNode)||!t.contains(n.focusNode)?null:n}
461function me(e,t,n){let r=e?.nodeType===1?e:e?.parentElement;for(;r&&r!==t;){if(n.includes(M(r)))return r;r=r.parentElement}return null}function he(e,t){e.removeAllRanges(),e.addRange(t)}function ge(e,t){let n=e?.parentNode;if(!n)return!1;let r=e.ownerDocument.createRange(),i=e.firstChild,a=e.lastChild;for(;e.firstChild;)n.insertBefore(e.firstChild,e);return n.removeChild(e),i&&a&&(r.setStartBefore(i),r.setEndAfter(a),he(t,r)),!0}function _e(e,t,n={}){let r=pe(e);if(!r||r.isCollapsed)return!1;let i=e.ownerDocument,a=t.toUpperCase(),o=me(r.anchorNode,e,a===`STRONG`?[`STRONG`,`B`]:[a]);if(o&&o.contains(r.focusNode)&&a!==`A`)return ge(o,r);let s=r.getRangeAt(0),c=i.createElement(t);return Object.entries(n).forEach(([e,t])=>{t!=null&&t!==``&&c.setAttribute(e,t)}),c.appendChild(s.extractContents()),s.insertNode(c),s.selectNodeContents(c),he(r,s),e.normalize?.(),!0}function ve(e,t){if(!e?.parentNode||M(e)===t.toUpperCase())return e;let n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return e.parentNode.replaceChild(n,e),n}function ye(e,t){let n=e?.nodeType===1?e:e?.parentElement;for(;n?.parentElement&&n.parentElement!==t;)n=n.parentElement;return n?.parentElement===t?n:null}function be(e){let t=pe(e);if(!t)return[];let n=t.getRangeAt(0);return Array.from(e.children??[]).filter(t=>{try{return n.intersectsNode(t)}catch{let r=ye(n.startContainer,e),i=ye(n.endContainer,e);return t===r||t===i}})}function xe(e,t){let n=be(e);if(n.length===0)return!1;if(t===`blockquote`){if(n.length===1&&M(n[0])===`BLOCKQUOTE`){let e=n[0],t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);return t.removeChild(e),!0}let t=e.ownerDocument.createElement(`blockquote`);return n[0].parentNode.insertBefore(t,n[0]),n.forEach(e=>t.appendChild(e)),!0}let r={paragraph:`p`,"heading-2":`h2`,"heading-3":`h3`,"heading-4":`h4`,"heading-5":`h5`,"heading-6":`h6`,"code-block":`pre`}[t];return r?(n.forEach(e=>{[`UL`,`OL`,`HR`].includes(M(e))||ve(e,r)}),!0):!1}function Se(e,t){let n=pe(e);if(!n)return!1;let r=me(n.anchorNode,e,[`UL`,`OL`]);if(r&&r.contains(n.focusNode)){if(M(r)!==t.toUpperCase())return ve(r,t),!0;let e=r.parentNode;return N(r).forEach(t=>{if(M(t)!==`LI`)return;let n=N(t).length===1&&/^(P|DIV)$/u.test(M(t.firstChild))?t.firstChild:null,i=n??t.ownerDocument.createElement(`p`);if(!n)for(;t.firstChild;)i.appendChild(t.firstChild);e.insertBefore(i,r)}),e.removeChild(r),!0}let i=be(e).filter(e=>![`UL`,`OL`,`HR`].includes(M(e)));if(i.length===0)return!1;let a=e.ownerDocument.createElement(t);
461return i[0].parentNode.insertBefore(a,i[0]),i.forEach(t=>{let n=e.ownerDocument.createElement(`li`);n.appendChild(t),a.appendChild(n)}),!0}function Ce(e,t){let n=pe(e);if(!n)return t.lastChild?(e.appendChild(t),e.focus?.(),!0):!1;let r=n.getRangeAt(0),i=t.lastChild;return r.deleteContents(),r.insertNode(t),i&&(r.setStartAfter(i),r.collapse(!0),he(n,r)),!0}function we(e,t){let n=e.ownerDocument,r=n.createDocumentFragment();return h(t,2e6).replace(/\r\n?/gu,`
462`).split(`
463`).forEach((e,t)=>{t>0&&r.appendChild(n.createElement(`br`)),r.appendChild(n.createTextNode(e))}),Ce(e,r)}function Te(e,t){let n=e.ownerDocument,r=n.createDocumentFragment(),i=k(t),o=a.get(e)??{mediaRegistry:v({}),readOnly:!1};return i.content.forEach(e=>{let t=ue(n,e,o);t&&r.appendChild(t)}),Ce(e,r)}function Ee(t,n){if(!t?.dispatchEvent)return;let r=t.ownerDocument?.defaultView?.Event??e.Event;typeof r==`function`&&t.dispatchEvent(new r(n,{bubbles:!0,composed:!0}))}function De(t,n,r){if(!t?.dispatchEvent)return;let i=j(n);t.querySelectorAll?.(`[data-editor-word-count]`).forEach(e=>{e.textContent=String(i.wordCount)}),t.querySelectorAll?.(`[data-editor-reading-time]`).forEach(e=>{e.textContent=String(i.readingTimeMinutes)});let a=t.ownerDocument?.defaultView?.CustomEvent??e.CustomEvent;typeof a==`function`&&t.dispatchEvent(new a(`website-editor:change`,{bubbles:!0,detail:{document:n,json:r,metrics:i}}))}function Oe(t,n={}){if(!t)return null;if(i.has(t))return i.get(t);let s=n.surface??t.querySelector?.(`[data-website-editor-surface]`),c=n.toolbar??t.querySelector?.(`[data-website-editor-toolbar]`),l=n.input??t.querySelector?.(`[data-website-editor-input]`);if(!s||!l)return null;let f=s.ownerDocument??e.document,_=typeof e.AbortController==`function`?new e.AbortController:null,x=_?{signal:_.signal}:void 0,S=!1,C=!1,T=[],D=-1,O=null,P=!1,ee=null,te=null,F=null,re=null,I=n.readOnly===!0||t.getAttribute?.(`data-website-editor-readonly`)===`true`,ae=v(n.mediaRegistry??y(t)),oe={mediaRegistry:ae,readOnly:I};a.set(s,oe),o+=1,s.id||=`website-editor-surface-${o}`,s.setAttribute(`contenteditable`,I?`false`:`true`),s.setAttribute(`role`,`textbox`),s.setAttribute(`aria-multiline`,`true`),s.setAttribute(`aria-readonly`,I?`true`:`false`),s.setAttribute(`aria-label`,s.getAttribute(`aria-label`)??t.getAttribute?.(`data-editor-label`)??`Article body`),s.setAttribute(`spellcheck`,`true`),c&&(c.setAttribute(`role`,`toolbar`),c.setAttribute(`aria-label`,c.getAttribute(`aria-label`)??`Text formatting`),c.setAttribute(`aria-controls`,s.id),c.querySelectorAll?.(r).forEach(e=>{let t=e.getAttribute(`data-editor-command`);M(e)===`BUTTON`&&e.setAttribute(`type`,`button`),e.getAttribute(`aria-label`)||e.setAttribute(`aria-label`,u[t]??t),d[t]&&!e.getAttribute(`aria-keyshortcuts`)&&e.setAttribute(`aria-keyshortcuts`,d[t]),I&&(e.disabled=!0)}),I&&c.querySelectorAll?.(`[data-editor-link-url], [data-editor-link-target]`).forEach(e=>{e.disabled=!0}));let se=l.value?k(l.value):ie(s);de(s,se);let ce=()=>A(ie(s)),le=(e=ce())=>T[D]===e?e:(T=T.slice(0,D+1),T.push(e),T.length>100&&T.shift(),D=T.length-1,e),ue=({notify:e=!0,record:n=!0}={})=>{let r=ie(s),i=A(r),a=l.value!==i;return l.value=i,n&&le(i),e&&a&&!I&&(Ee(l,`input`),Ee(l,`change`),De(t,r,i)),Me(),r},ve=e=>I||e<0||e>=T.length?!1:(D=e,de(s,T[D]),ue({record:!1}),s.focus?.(),!0),ye=()=>ve(D-1),be=()=>ve(D+1),Ce=e=>N(s).indexOf(e),Oe=(e,t)=>{if(I)return!1;let n=ie(s),r=n.content[e];if(!r||![`image`,`video`,`youtube`].includes(r.type))return!1;let i=E({type:r.type,attrs:{...r.attrs,...p(t)?t:{}}});return i?(n.content[e]=i,de(s,n),ue(),!0):!1},ke=(e,t)=>{if(I||![-1,1].includes(t))return!1;let n=ie(s),r=e+t,i=n.content[e];return!i||![`image`,`video`,`youtube`].includes(i.type)||r<0||r>=n.content.length?!1:(n.content.splice(e,1),n.content.splice(r,0,i),de(s,n),ue(),!0)},Ae=e=>{if(I)return!1;let t=ie(s),n=t.content[e];return!n||![`image`,`video`,`youtube`].includes(n.type)?!1:(t.content.splice(e,1),de(s,t),ue(),!0)},je=e=>{let t=pe(s);return!!(t&&me(t.anchorNode,s,e))};function Me(){if(!c)return;let e={bold:je([`STRONG`,`B`]),italic:je([`EM`,`I`]),underline:je([`U`]),strike:je([`S`,`STRIKE`,`DEL`]),"inline-code":je([`CODE`]),link:je([`A`]),"bullet-list":je([`UL`]),"ordered-list":je([`OL`])};c.querySelectorAll?.(r).forEach(t=>{let n=t.getAttribute(`data-editor-command`);Object.hasOwn(e,n)&&t.setAttribute(`aria-pressed`,e[n]?`true`:`false`),I?t.disabled=!0:n===`undo`?t.disabled=D<=0:n===`redo`&&(t.disabled=D>=T.length-1)})}let Ne=()=>{let e=pe(s);if(!e||e.isCollapsed)return!1;let t=e.getRangeAt(0),n=t.toString();t.deleteContents();let r=f.createTextNode(n);
463return t.insertNode(r),t.selectNodeContents(r),he(e,t),!0},Pe=()=>{let e=pe(s);if(!e)return!1;let t=e.getRangeAt(0),n=f.createElement(`hr`);return t.deleteContents(),t.insertNode(n),t.setStartAfter(n),t.collapse(!0),he(e,t),!0},Fe=()=>{let e=pe(s),t=e&&me(e.anchorNode,s,[`A`]);return t?ge(t,e):!1},L=()=>{let e=pe(s);return e&&me(e.anchorNode,s,[`TH`,`TD`])},Ie=(e={})=>{let t=m(e.rows,1,50,3),n=m(e.columns,1,12,3),r={version:1,type:`doc`,content:[{type:`table`,attrs:{header_row:e.headerRow!==!1},content:Array.from({length:t},()=>({type:`table_row`,content:Array.from({length:n},()=>({type:`table_cell`,content:[]}))}))}]};return Te(s,r)},Le=()=>{let e=L()?.parentElement,t=e&&me(e,s,[`TABLE`]);if(!e||!t||ne(t).length>=50)return!1;let n=e.parentNode.childNodes[e.parentNode.childNodes.indexOf(e)+1],r=f.createElement(`tr`),i=N(e).filter(e=>[`TH`,`TD`].includes(M(e))).length;return Array.from({length:i},()=>{let e=f.createElement(`td`);e.appendChild(f.createElement(`br`)),r.appendChild(e)}),e.parentNode.insertBefore(r,n??null),!0},Re=()=>{let e=L()?.parentElement,t=e&&me(e,s,[`TABLE`]);return!e||!t||ne(t).length<=1?!1:(e.parentNode.removeChild(e),!0)},ze=()=>{let e=L(),t=e?.parentElement,n=t&&me(t,s,[`TABLE`]),r=t?N(t).filter(e=>[`TH`,`TD`].includes(M(e))):[],i=r.indexOf(e);return!e||!n||i<0||r.length>=12?!1:(ne(n).forEach(e=>{let t=N(e).filter(e=>[`TH`,`TD`].includes(M(e))),n=t[i+1]??null,r=f.createElement(M(t[i])===`TH`?`th`:`td`);M(r)===`TH`&&r.setAttribute(`scope`,`col`),r.appendChild(f.createElement(`br`)),e.insertBefore(r,n)}),!0)},Be=()=>{let e=pe(s),t=L(),n=t?.parentElement,r=n&&me(n,s,[`TABLE`]),i=n?N(n).filter(e=>[`TH`,`TD`].includes(M(e))):[],a=i.indexOf(t);if(!t||!r||a<0||i.length<=1)return!1;ne(r).forEach(e=>{let t=N(e).filter(e=>[`TH`,`TD`].includes(M(e)))[a];t&&e.removeChild(t)});let o=N(n).filter(e=>[`TH`,`TD`].includes(M(e))),c=o[Math.min(a,o.length-1)];if(e&&c){let t=f.createRange();t.selectNodeContents(c),t.collapse(!0),he(e,t)}return!0},Ve=(n,r=null,i={})=>{if(I)return!1;let a=!1;if(O&&!pe(s)&&![`undo`,`redo`,`paste-plain`].includes(n)){let t=f?.getSelection?.()??e.getSelection?.();try{he(t,typeof O.cloneRange==`function`?O.cloneRange():O)}catch{O=null}}if(n===`undo`)return ye();if(n===`redo`)return be();if(n===`bold`)a=_e(s,`strong`);else if(n===`italic`)a=_e(s,`em`);else if(n===`underline`)a=_e(s,`u`);else if(n===`strike`)a=_e(s,`s`);else if(n===`inline-code`)a=_e(s,`code`);else if(n===`paste-plain`){P=!0,t.setAttribute?.(`data-editor-plain-paste-ready`,`true`);let e=t.querySelector?.(`[data-editor-paste-status]`);return e&&(e.textContent=`Plain-text mode is ready for the next paste.`),s.focus?.(),!0}else if(n===`link`){let t=g(r??i.href??e.prompt?.(`Enter a web, email, telephone, or site-relative URL`,`https://`));if(t){let e=i.target===`_blank`?`_blank`:null,n=pe(s),r=n&&me(n.anchorNode,s,[`A`]);r&&r.contains(n.focusNode)?(r.setAttribute(`href`,t),e===`_blank`?(r.setAttribute(`target`,`_blank`),r.setAttribute(`rel`,`noopener noreferrer`)):(r.removeAttribute(`target`),r.removeAttribute(`rel`)),a=!0):a=_e(s,`a`,{href:t,target:e,rel:e===`_blank`?`noopener noreferrer`:null})}}else n===`unlink`?a=Fe():[`paragraph`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`blockquote`,`code-block`].includes(n)?a=xe(s,n):n===`bullet-list`?a=Se(s,`ul`):n===`ordered-list`?a=Se(s,`ol`):n===`horizontal-rule`?a=Pe():n===`insert-table`?a=Ie(i):n===`table-add-row`?a=Le():n===`table-delete-row`?a=Re():n===`table-add-column`?a=ze():n===`table-delete-column`?a=Be():n===`clear-formatting`&&(a=Ne());return a&&(ue(),s.focus?.()),a},He=e=>{e.target?.closest?.(r)&&e.preventDefault()},Ue=e=>{let t=e.target?.closest?.(r);!t||!c.contains(t)||Ve(t.getAttribute(`data-editor-command`),t.getAttribute(`data-editor-value`),{href:t.getAttribute(`data-editor-href`)||c.querySelector?.(`[data-editor-link-url]`)?.value,target:t.getAttribute(`data-editor-target`)||(c.querySelector?.(`[data-editor-link-target]`)?.checked?`_blank`:`_self`)})},R=e=>{if(I){e.preventDefault();return}e.inputType===`historyUndo`?(e.preventDefault(),ye()):e.inputType===`historyRedo`&&(e.preventDefault(),be())},We=()=>{if(I){de(s,l.value);return}S||ue()},Ge=()=>{I||(S=!0)},Ke=()=>{if(I){de(s,l.value);return}S=!1,ue()},qe=t.querySelector?.(`[data-editor-upload-image]`),Je=t.querySelector?.(`[data-editor-upload-cancel]`),Ye=t.querySelector?.(`[data-editor-upload-retry]`),Xe=t.querySelector?.(`[data-editor-upload-progress-wrap]`),Ze=t.querySelector?.(`[data-editor-upload-progress]`),Qe=t.querySelector?.(`[data-editor-upload-progress-label]`),$e=t.querySelector?.(`[data-editor-upload-progress-value]`),et=(e,t)=>{e&&(e.classList?.toggle?e.classList.toggle(`hidden`,t):e.setAttribute?.(`data-hidden`,t?`true`:`false`))},tt=(e,t)=>{let n=Math.max(0,Math.min(100,Math.round(Number(e)||0)));et(Xe,!1),Ze&&(Ze.value=n,Ze.textContent=`${n}%`),Qe&&(Qe.textContent=t),$e&&($e.textContent=`${n}%`)},z=(e,n=`idle`)=>{let r=t.querySelector?.(`[data-editor-upload-status]`);r&&(r.textContent=e,r.setAttribute(`data-state`,n))},nt=e=>{re=null,et(Ye,!0),et(Je,!1),qe&&(qe.disabled=!0),tt(0,e)},rt=({retry:e=null}={})=>{F=null,re=e,et(Je,!0),et(Ye,typeof e!=`function`),qe&&(qe.disabled=I)},it=()=>{re=null,et(Ye,!0),et(Je,!0),et(Xe,!0),qe&&(qe.disabled=I)},at=e=>{let n=String(e?.type??``);if(I||!e||![`image/jpeg`,`image/png`,`image/webp`].includes(n))return!1;let r=Number(t.getAttribute?.(`data-editor-image-max-bytes`)??0);if(Number.isFinite(r)&&r>0&&Number(e.size??0)>r)return z(`The selected image exceeds the upload limit.`,`error`),!1;ee=e,te=null,t.setAttribute?.(`data-editor-image-pending`,`true`),t.removeAttribute?.(`data-editor-video-pending`),it();let i=t.querySelector?.(`[data-editor-upload-title]`);return i&&String(i.value??``).trim()===``&&(i.value=h(String(e.name??`Article image`).replace(/\.[^.]+$/u,``).replace(/[-_]+/gu,` `),255)),z(`${e.name||`Image`} is ready. Add alternative text or mark it decorative, then upload and insert.`,`pending`),!0},ot=e=>{if(I||!e||String(e.type??``)!==`video/mp4`)return!1;let n=Number(t.getAttribute?.(`data-editor-video-max-bytes`)??0);if(Number.isFinite(n)&&n>0&&Number(e.size??0)>n)return z(`The selected MP4 exceeds the upload limit.`,`error`),!1;te=e,ee=null,t.setAttribute?.(`data-editor-video-pending`,`true`),t.removeAttribute?.(`data-editor-image-pending`),it();let r=t.querySelector?.(`[data-editor-upload-title]`);return r&&String(r.value??``).trim()===``&&(r.value=h(String(e.name??`Article video`).replace(/\.[^.]+$/u,``).replace(/[-_]+/gu,` `),255)),z(`${e.name||`Video`} is ready. Confirm its title and rights, then upload it to the managed video pipeline.`,`pending`),!0},B=e=>Array.from(e?.files??[]),st=e=>{let t=B(e),n=t.find(e=>{let t=String(e?.type??``);return[`image/jpeg`,`image/png`,`image/webp`].includes(t)||t===`video/mp4`});return n?String(n.type).startsWith(`image/`)?at(n):ot(n):(t.length>0&&z(`Only JPEG, PNG, WebP, and MP4 files can be uploaded here.`,`error`),!1)},ct=async()=>
463{if(I)return!1;if(!ee)return z(`Paste, drop, or choose an image first.`,`error`),!1;let n=t.getAttribute?.(`data-editor-image-upload-url`),r=f?.location?.origin??e.location?.origin,i;try{i=new URL(n,r)}catch{return z(`The image upload endpoint is invalid.`,`error`),!1}if(!r||i.origin!==r||i.username!==``||i.password!==``||i.search!==``||i.hash!==``||!i.pathname.endsWith(`/website/media/image`))return z(`The image upload endpoint is invalid.`,`error`),!1;let a=e=>h(t.querySelector?.(e)?.value??``,5e3).trim(),o=!!t.querySelector?.(`[data-editor-upload-decorative]`)?.checked,c=a(`[data-editor-upload-alt]`);if(!o&&c===``)return z(`Add alternative text or mark the image decorative.`,`error`),!1;let l=f?.defaultView?.FormData??e.FormData,u=e.EnrollmentFirstWebsiteMedia;if(typeof l!=`function`||typeof u?.uploadImageMultipart!=`function`)return z(`Image upload is unavailable.`,`error`),!1;let d=new l;d.append(`image`,ee),d.append(`title`,a(`[data-editor-upload-title]`)||`Article image`),d.append(`alt_text`,o?``:c),d.append(`is_decorative`,o?`1`:`0`),d.append(`caption`,a(`[data-editor-upload-caption]`)),d.append(`credit`,a(`[data-editor-upload-credit]`)),d.append(`rights_source`,a(`[data-editor-upload-rights-source]`)),d.append(`rights_scope`,a(`[data-editor-upload-rights-scope]`));let p=f?.defaultView?.AbortController??e.AbortController;F=typeof p==`function`?new p:null,nt(`Uploading image`),z(`Uploading and preparing the image…`,`uploading`);try{let n=await u.uploadImageMultipart(i.toString(),d,{origin:r,csrf:f?.querySelector?.(`meta[name="csrf-token"]`)?.getAttribute?.(`content`)??``,signal:F?.signal,onProgress(e){tt(e.percent,`Uploading image`)}}),l=w(n?.media?.database_id);if(!l)throw Error(`The uploaded image response was incomplete.`);if(b(ae,n.media),!Te(s,{version:1,type:`doc`,content:[{type:`image`,attrs:{media_id:l,alt:o?``:c,decorative:o,caption:a(`[data-editor-upload-caption]`)||null,alignment:`center`,link:null}}]}))throw Error(`Place the cursor in the article before inserting.`);ee=null,t.removeAttribute?.(`data-editor-image-pending`),ue(),tt(100,`Image upload complete`),rt(),z(`The managed image was uploaded and inserted.`,`success`);let p=f?.defaultView?.CustomEvent??e.CustomEvent;return typeof p==`function`&&t.dispatchEvent?.(new p(`website-media-uploaded`,{bubbles:!0,detail:n.media})),!0}catch(e){let t=F?.signal?.aborted||[`AbortError`,`UploadCancelledError`].includes(e?.name);return rt({retry:ct}),z(t?`Image upload cancelled. The staged file is ready to retry.`:e?.message||`The image upload failed.`,t?`cancelled`:`error`),!1}},lt=async()=>{if(I)return!1;if(!te)return z(`Paste, drop, or choose an MP4 first.`,`error`),!1;let n=e.EnrollmentFirstWebsiteMedia;if(typeof n?.requestVideoUploadAuthorization!=`function`||typeof n?.uploadFileInChunks!=`function`||typeof n?.sendChunkWithXhr!=`function`)return z(`Video upload is unavailable.`,`error`),!1;let r=e=>h(t.querySelector?.(e)?.value??``,5e3).trim(),i=r(`[data-editor-upload-title]`),a=r(`[data-editor-upload-rights-source]`),o=r(`[data-editor-upload-rights-scope]`);if(i===``||a===``||o===``)return z(`Add a title, rights source, and rights scope before uploading the MP4.`,`error`),!1;let s=t.getAttribute?.(`data-editor-video-authorization-url`),c=f?.defaultView?.AbortController??e.AbortController;F=typeof c==`function`?new c:null,nt(`Authorizing video upload`),z(`Authorizing the managed video upload…`,`uploading`);try{let c=await n.requestVideoUploadAuthorization(s,{original_name:te.name||`website-video.mp4`,title:i,credit:r(`[data-editor-upload-credit]`)||null,rights_source:a,rights_scope:o},{origin:f?.location?.origin??e.location?.origin,csrf:f?.querySelector?.(`meta[name="csrf-token"]`)?.getAttribute?.(`content`)??``});z(`Uploading the MP4 directly in resumable chunks…`,`uploading`),await n.uploadFileInChunks(te,c,{signal:F?.signal,sendChunk:n.sendChunkWithXhr,onProgress(e){tt(e.percent,`Uploading chunk ${e.chunk} of ${e.chunks}`)},onRetry(e){z(`Retrying chunk ${e.chunk} of ${e.chunks}…`,`uploading`)}}),tt(100,`MP4 upload complete`),te=null,t.removeAttribute?.(`data-editor-video-pending`),rt(),z(`Video received. Processing and EFI CDN verification will continue automatically; insert it from managed media when ready.`,`success`);let l=f?.defaultView?.CustomEvent??e.CustomEvent;return typeof l==`function`&&t.dispatchEvent?.(new l(`website-media-uploaded`,{bubbles:!0,detail:c.media??null})),!0}catch(e){let t=F?.signal?.aborted||e?.name===`UploadCancelledError`;return rt({retry:lt}),z(t?`Video upload cancelled. The staged MP4 is ready to retry.`:e?.message||`The video upload failed after automatic retries.`,t?`cancelled`:`error`),!1}},ut=e=>{if(I){e.preventDefault?.();return}let t=e.target?.closest?.(`[data-editor-node-field]`),n=t?.closest?.(`[data-editor-node]`),r=Ce(n),i=t?.getAttribute?.(`data-editor-node-field`);if(r<0||!i)return;let a=t.value;i===`decorative`?a=!!t.checked:i===`poster_media_id`?a=w(a):i===`start_seconds`&&(a=Number(a)),Oe(r,{[i]:a})},dt=e=>{let t=e.target?.closest?.(`[data-editor-node-action]`);
463if(!t||(e.preventDefault?.(),I))return;let n=t.closest?.(`[data-editor-node]`),r=Ce(n),i=t.getAttribute(`data-editor-node-action`);i===`move-up`?ke(r,-1):i===`move-down`?ke(r,1):i===`remove`&&Ae(r)},ft=e=>{let n=e.clipboardData;if(!n)return;if(I){e.preventDefault();return}if(B(n).length>0){e.preventDefault(),st(n);return}e.preventDefault();let r=P||t.getAttribute?.(`data-editor-paste`)===`plain`?``:n.getData(`text/html`),i=r?Te(s,fe(r,f)):we(s,n.getData(`text/plain`));if(P){P=!1,t.removeAttribute?.(`data-editor-plain-paste-ready`);let e=t.querySelector?.(`[data-editor-paste-status]`);e&&(e.textContent=`Pasted as plain text.`)}i&&ue()},pt=e=>{(I||B(e.dataTransfer).length>0)&&e.preventDefault()},mt=e=>{let t=B(e.dataTransfer);(I||t.length>0)&&e.preventDefault(),!I&&t.length>0&&st(e.dataTransfer)},V=e=>{e.preventDefault(),te?lt():ct()},ht=e=>{e.preventDefault(),F?.abort?.()},gt=e=>{e.preventDefault(),typeof re==`function`&&re()},_t=e=>{if(I||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=String(e.key).toLowerCase(),n=null;t===`b`?n=`bold`:t===`i`?n=`italic`:t===`u`?n=`underline`:t===`z`?n=e.shiftKey?`redo`:`undo`:t===`y`&&(n=`redo`),n&&(e.preventDefault(),Ve(n))},vt=()=>{let e=pe(s);if(e){let t=e.getRangeAt(0);O=typeof t.cloneRange==`function`?t.cloneRange():t,Me()}},yt=t.querySelector?.(`[data-editor-upload-file]`),bt=()=>{let e=yt?.files?.[0]??null;e&&(String(e.type??``)===`video/mp4`?ot(e):at(e)||z(`Only JPEG, PNG, WebP, and MP4 files can be uploaded here.`,`error`))},xt=e=>{if(!e.detail)return;let t=e.detail.document??e.detail.value??e.detail;de(s,t),ue({notify:!I})},St=e=>{if(I||!e.detail)return;let t=e.detail.document??e.detail.value??e.detail;Te(s,t)&&(ue(),s.focus?.())};c?.addEventListener(`mousedown`,He,x),c?.addEventListener(`click`,Ue,x),s.addEventListener(`beforeinput`,R,x),s.addEventListener(`input`,We,x),s.addEventListener(`compositionstart`,Ge,x),s.addEventListener(`compositionend`,Ke,x),s.addEventListener(`paste`,ft,x),s.addEventListener(`dragover`,pt,x),s.addEventListener(`drop`,mt,x),s.addEventListener(`keydown`,_t,x),s.addEventListener(`change`,ut,x),s.addEventListener(`click`,dt,x),yt?.addEventListener(`change`,bt,x),qe?.addEventListener(`click`,V,x),Je?.addEventListener(`click`,ht,x),Ye?.addEventListener(`click`,gt,x),f?.addEventListener?.(`selectionchange`,vt,x),t.addEventListener?.(`website-editor:set-document`,xt,x),t.addEventListener?.(`website-editor:insert-document`,St,x),l.value=A(se),le(l.value);let Ct=j(se);t.querySelectorAll?.(`[data-editor-word-count]`).forEach(e=>{e.textContent=String(Ct.wordCount)}),t.querySelectorAll?.(`[data-editor-reading-time]`).forEach(e=>{e.textContent=String(Ct.readingTimeMinutes)}
463),Me(),it(),I&&[yt,qe,Je,Ye,...Array.from(t.querySelectorAll?.(`[data-editor-upload-title], [data-editor-upload-alt], [data-editor-upload-decorative], [data-editor-upload-caption], [data-editor-upload-credit], [data-editor-upload-rights-source], [data-editor-upload-rights-scope]`)??[])].forEach(e=>{e&&(e.disabled=!0)});let wt={container:t,surface:s,toolbar:c,input:l,getDocument(){return ie(s)},getJSON(){return ce()},getMetrics(){return j(ie(s))},setDocument(e,{notify:t=!0}={}){return de(s,e),ue({notify:!I&&t})},runCommand:Ve,undo:ye,redo:be,updateManagedNode:Oe,moveManagedNode:ke,removeManagedNode:Ae,insertPlainText(e){if(I)return!1;let t=we(s,e);return t&&ue(),t},insertDocument(e){if(I)return!1;let t=Te(s,e);return t&&ue(),t},stageImageFile:at,stageVideoFile:ot,uploadPendingImage:ct,uploadPendingVideo:lt,cancelUpload(){return F?(F.abort(),!0):!1},retryUpload(){return typeof re==`function`&&re()},sync:I?()=>(de(s,l.value),k(l.value)):ue,destroy(){C||(C=!0,F?.abort?.(),_?.abort(),_||(c?.removeEventListener(`mousedown`,He),c?.removeEventListener(`click`,Ue),s.removeEventListener(`beforeinput`,R),s.removeEventListener(`input`,We),s.removeEventListener(`compositionstart`,Ge),s.removeEventListener(`compositionend`,Ke),s.removeEventListener(`paste`,ft),s.removeEventListener(`dragover`,pt),s.removeEventListener(`drop`,mt),s.removeEventListener(`keydown`,_t),s.removeEventListener(`change`,ut),s.removeEventListener(`click`,dt),yt?.removeEventListener(`change`,bt),qe?.removeEventListener(`click`,V),Je?.removeEventListener(`click`,ht),Ye?.removeEventListener(`click`,gt),f?.removeEventListener?.(`selectionchange`,vt),t.removeEventListener?.(`website-editor:set-document`,xt),t.removeEventListener?.(`website-editor:insert-document`,St)),i.delete(t),a.delete(s),t.removeAttribute?.(`data-website-editor-initialized`))}};return i.set(t,wt),t.setAttribute?.(`data-website-editor-initialized`,`true`),wt}function ke(t=e.document){if(!t)return[];let r=[];return t.matches?.(n)&&r.push(t),t.querySelectorAll?.(n).forEach(e=>{r.push(e)}),[...new Set(r)].map(e=>Oe(e)).filter(Boolean)}let Ae={DOCUMENT_VERSION:1,emptyDocument:f,normalizeDocument:k,documentMetrics:j,sanitizeUrl:g,sanitizeMediaPreviewUrl:_,normalizeMediaPreviewRegistry:v,serializeEditable:ie,stringifyDocument:A,renderCanonicalDocument:de,canonicalDocumentFromHtml:fe,initializeWebsiteEditor:Oe,initializeWebsiteEditors:ke};if(t!==void 0&&t.exports&&(t.exports=Ae),e.window&&(e.window.WebsiteEditor=Ae,!e.window.__websiteEditorAutoInit)){e.window.__websiteEditorAutoInit=!0;let t=()=>ke(e.document);e.document?.readyState===`loading`?e.document.addEventListener(`DOMContentLoaded`,t,{once:!0}):t(),e.document?.addEventListener?.(`livewire:navigated`,t)}})(typeof globalThis<`u`?globalThis:e)})),JL=o(((e,t)=>{(function(e){"use strict";let n=20971520,r=new WeakSet,i=new WeakSet;class a extends Error{constructor(){super(`Upload cancelled.`),this.name=`UploadCancelledError`}}function o(e,t=n){let r=Number(e),i=Number(t);if(!Number.isSafeInteger(r)||r<1||!Number.isSafeInteger(i)||i<1)throw TypeError(`A positive file and chunk size are required.`);let a=[];for(let e=0;e<r;e+=i){let t=Math.min(r,e+i);a.push({start:e,endExclusive:t,endInclusive:t-1,total:r})}return a}function s(e){let t=e?.upload,n=e?.constraints,r=t?.upload_url,i;try{i=new URL(r)}catch{throw Error(`The video upload authorization was invalid.`)}if(i.protocol!==`https:`||i.hostname!==`api.cloudinary.com`||i.port!==``||i.username!==``||i.password!==``||i.search!==``||i.hash!==``||!/^\/v1_1\/[A-Za-z0-9_-]+\/video\/upload$/u.test(i.pathname))throw Error(`The video upload authorization was invalid.`);let a=t?.parameters;if(!a||typeof a!=`object`||Array.isArray(a)||`api_secret`in a||`cloud_url`in a||typeof a.api_key!=`string`||a.api_key.trim()===``||typeof a.signature!=`string`||a.signature.trim()===``||typeof a.public_id!=`string`||a.public_id.trim()===``)throw Error(`The video upload authorization was invalid.`);let o={};Object.entries(a).forEach(([e,t])=>{if(!/^[a-z][a-z0-9_]*$/u.test(e)||![`string`,`number`,`boolean`].includes(typeof t))throw Error(`The video upload authorization was invali
463d.`);o[e]=t});let s=Number(n?.maximum_bytes),c=Array.isArray(n?.accepted_mime_types)?n.accepted_mime_types:[];if(!Number.isSafeInteger(s)||s<1||c.length!==1||c[0]!==`video/mp4`)throw Error(`The video upload constraints were invalid.`);return{uploadUrl:i.toString(),parameters:o,maximumBytes:s,acceptedMimeTypes:c,expiresAt:String(t.expires_at??``)}}function c(){if(typeof e.crypto?.randomUUID==`function`)return e.crypto.randomUUID();let t=new Uint8Array(16);if(e.crypto?.getRandomValues?.(t),t.every(e=>e===0))throw Error(`A secure upload identifier could not be created.`);return Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function l(t,n){return new Promise((r,i)=>{if(n?.aborted){i(new a);return}let o=e.setTimeout(r,t);n?.addEventListener(`abort`,()=>{e.clearTimeout(o),i(new a)},{once:!0})})}async function u(e,t,r={}){if(!e||!Number.isSafeInteger(e.size)||e.size<1||typeof e.slice!=`function`)throw TypeError(`A valid video file is required.`);if(!t.acceptedMimeTypes.includes(e.type)||e.size>t.maximumBytes)throw Error(`The selected MP4 does not meet upload limits.`);let i=r.sendChunk;if(typeof i!=`function`)throw TypeError(`A chunk transport is required.`);let s=o(e.size,r.chunkBytes??n),u=Number.isSafeInteger(r.retries)?Math.max(0,r.retries):2,d=r.signal,f=r.uploadId??c();for(let n=0;n<s.length;n+=1){let o=s[n],c=e.slice(o.start,o.endExclusive),p=0;for(;;){if(d?.aborted)throw new a;try{await i({authorization:t,chunk:c,fileName:e.name??`website-video.mp4`,index:n,range:o,uploadId:f,signal:d,onProgress(t){let i=Math.min(o.endExclusive-o.start,Math.max(0,Number(t)||0));r.onProgress?.({bytesUploaded:o.start+i,totalBytes:e.size,percent:Math.min(100,Math.round((o.start+i)/e.size*100)),chunk:n+1,chunks:s.length})}});break}catch(e){if(d?.aborted||e instanceof a)throw new a;if(p>=u)throw e;p+=1,r.onRetry?.({attempt:p,chunk:n+1,chunks:s.length}),await l(Math.min(4e3,500*2**(p-1)),d)}}}r.onProgress?.({bytesUploaded:e.size,totalBytes:e.size,percent:100,chunk:s.length,chunks:s.length})}function d({authorization:e,chunk:t,fileName:n,range:r,uploadId:i,signal:o,onProgress:s}){return new Promise((c,l)=>{let u=new XMLHttpRequest,d=new FormData;Object.entries(e.parameters).forEach(([e,t])=>d.append(e,String(t))),d.append(`file`,t,n),u.open(`POST`,e.uploadUrl,!0),(r.start>0||r.endExclusive<r.total)&&(u.setRequestHeader(`X-Unique-Upload-Id`,i),u.setRequestHeader(`Content-Range`,`bytes ${r.start}-${r.endInclusive}/${r.total}`)),u.setRequestHeader(`Accept`,`application/json`);let f=()=>u.abort();o?.addEventListener(`abort`,f,{once:!0}),u.upload.addEventListener(`progress`,e=>{s(e.loaded)}),u.addEventListener(`load`,()=>{if(o?.removeEventListener(`abort`,f),u.status>=200&&u.status<300){c();return}l(Error(`Cloudinary rejected the video chunk.`))}),u.addEventListener(`error`,()=>{o?.removeEventListener(`abort`,f),l(Error(`The video chunk could not be uploaded.`))}),u.addEventListener(`abort`,()=>{o?.removeEventListener(`abort`,f),l(new a)}),u.send(d)})}function f(){return e.document?.querySelector(`meta[name="csrf-token"]`)?.getAttribute(`content`)??``}async function p(e){let t={};try{t=await e.json()}catch{}if(!e.ok){let e=Object.values(t?.errors??{}).flat()[0];throw Error(typeof e==`string`?e:t?.message||`The media request could not be completed.`)}return t}async function m(t,n,r={}){let i=r.origin??e.location?.origin??`https://designer.enrollfirst.com`,a;try{a=new URL(t,i)}catch{throw Error(`The video upload authorization endpoint was invali
463d.`)}if(a.origin!==i||a.username!==``||a.password!==``||a.search!==``||a.hash!==``||!a.pathname.endsWith(`/website/media/video/upload-authorization`))throw Error(`The video upload authorization endpoint was invalid.`);let o=r.fetchImplementation??e.fetch;if(typeof o!=`function`)throw Error(`Video upload is unavailable.`);let c=await p(await o(a.toString(),{method:`POST`,credentials:`same-origin`,headers:{Accept:`application/json`,"Content-Type":`application/json`,"X-CSRF-TOKEN":r.csrf??f()},body:JSON.stringify(n??{})}));return{...s(c),media:c?.media??null}}function h(t,n,r){return new Promise((i,o)=>{if(r.signal?.aborted){o(new a);return}let s=r.xhrFactory?r.xhrFactory():new e.XMLHttpRequest;s.open(`POST`,t,!0),s.withCredentials=!0,s.setRequestHeader(`Accept`,`application/json`),s.setRequestHeader(`X-CSRF-TOKEN`,r.csrf??f());let c=()=>s.abort(),l=()=>r.signal?.removeEventListener(`abort`,c);r.signal?.addEventListener(`abort`,c,{once:!0}),s.upload?.addEventListener?.(`progress`,e=>{let t=Math.max(0,Number(e.loaded)||0),n=Math.max(0,Number(e.total)||0);r.onProgress?.({loaded:t,total:n,percent:n>0?Math.min(100,Math.round(t/n*100)):0})}),s.addEventListener(`load`,()=>{l();let e={};try{e=g(s.response)?s.response:JSON.parse(s.responseText||`{}`)}catch{}p({ok:s.status>=200&&s.status<300,async json(){return e}}).then(i,o)}),s.addEventListener(`error`,()=>{l(),o(Error(`The image upload could not be completed.`))}),s.addEventListener(`abort`,()=>{l(),o(new a)}),s.send(n)})}function g(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function _(t,n,r={}){let i=r.origin??e.location?.origin??`https://designer.enrollfirst.com`,a;try{a=new URL(t,i)}
463catch{throw Error(`The image upload endpoint was invalid.`)}if(a.origin!==i||a.username!==``||a.password!==``||a.search!==``||a.hash!==``||!a.pathname.endsWith(`/website/media/image`))throw Error(`The image upload endpoint was invalid.`);if(r.onProgress||r.signal||r.xhrFactory){if(!r.xhrFactory&&typeof e.XMLHttpRequest!=`function`)throw Error(`Image upload is unavailable.`);return h(a.toString(),n,r)}let o=r.fetchImplementation??e.fetch;if(typeof o!=`function`)throw Error(`Image upload is unavailable.`);return p(await o(a.toString(),{method:`POST`,credentials:`same-origin`,headers:{Accept:`application/json`,"X-CSRF-TOKEN":r.csrf??f()},body:n,signal:r.signal}))}function v(e,t){let n;try{n=new URL(e,t)}catch{throw Error(`The caption-track endpoint was invalid.`)}if(n.origin!==t||n.username!==``||n.password!==``||n.search!==``||n.hash!==``||!/\/website\/media\/video\/[0-9a-f-]{36}\/captions$/iu.test(n.pathname))throw Error(`The caption-track endpoint was invalid.`);return n.toString()}async function y(t,n,r={}){let i=r.origin??e.location?.origin??`https://designer.enrollfirst.com`,a=r.fetchImplementation??e.fetch;if(typeof a!=`function`)throw Error(`Caption-track upload is unavailable.`);return p(await a(v(t,i),{method:`POST`,credentials:`same-origin`,headers:{Accept:`application/json`,"X-CSRF-TOKEN":r.csrf??f()},body:n}))}async function b(t,n={}){let r=n.origin??e.location?.origin??`https://designer.enrollfirst.com`,i=n.fetchImplementation??e.fetch;if(typeof i!=`function`)throw Error(`Caption-track removal is unavailable.`);return p(await i(v(t,r),{method:`DELETE`,credentials:`same-origin`,headers:{Accept:`application/json`,"X-CSRF-TOKEN":n.csrf??f()}}))}function x(e,t,n){if(!e)return;let r={info:`border-blue-200 bg-blue-50 text-blue-900`,success:`border-emerald-200 bg-emerald-50 text-emerald-900`,error:`border-red-200 bg-red-50 text-red-900`};e.className=`rounded-md border px-3 py-2 text-sm ${r[t]??r.info}`,e.textContent=n}function S(){e.Livewire?.dispatch?.(`website-media-uploaded`)}function C(e){let t=e.querySelector(`[data-media-image-form]`);if(!t)return;let n=t.querySelector(`[data-media-image-decorative]`),r=t.querySelector(`[data-media-image-alt]`),i=t.querySelector(`[data-media-upload-status]`),a=t.querySelector(`[data-media-submit]`),o=()=>{r&&(r.disabled=!!n?.checked,r.required=!n?.checked,n?.checked&&(r.value=``))};n?.addEventListener(`change`,o),o(),t.addEventListener(`submit`,async n=>{if(n.preventDefault(),!t.reportValidity())return;let r=t.elements.image?.files?.[0],s=Number(e.dataset.imageMaximumBytes);if(!r||![`image/jpeg`,`image/png`,`image/webp`].includes(r.type)){x(i,`error`,`Choose a JPEG, PNG, or WebP image.`);return}if(r.size>s){x(i,`error`,`The selected image exceeds the upload limit.`);return}a.disabled=!0,x(i,`info`,`Optimizing and verifying the image…`);try{await _(e.dataset.imageUploadUrl,new FormData(t)),t.reset(),o(),x(i,`success`,`Image uploaded and verified on the EFI CDN.`),S()}catch(e){x(i,`error`,e?.message||`The image upload failed.`)}finally{a.disabled=!1}})}function w(e){let t=e.querySelector(`[data-media-video-form]`);if(!t)return;let n=t.querySelector(`[data-media-upload-status]`),r=t.querySelector(`[data-media-submit]`),i=t.querySelector(`[data-media-cancel]`),o=t.querySelector(`[data-media-retry]`),s=t.querySelector(`[data-media-progress-wrap]`),c=t.querySelector(`[data-media-progress]`),l=t.querySelector(`[data-media-progress-label]`),f=t.querySelector(`[data-media-progress-value]`),p=null,h=null,g=(e,t)=>{s?.classList.remove(`hidden`),c&&(c.value=e,c.textContent=`${e}%`),f&&(f.textContent=`${e}%`),l&&(l.textContent=t)},_=async n=>{let r=Object.fromEntries(new FormData(t).entries());return delete r.video,r.original_name=n.name,m(e.dataset.videoAuthorizationUrl,r)},v=async(e,s)=>{p=new AbortController,r.disabled=!0,i?.classList.remove(`hidden`),o?.classList.add(`hidden`),x(n,`info`,`Uploading video directly…`);try{await u(e,s,{signal:p.signal,sendChunk:d,onProgress(e){g(e.percent,`Uploading chunk ${e.chunk} of ${e.chunks}`)},onRetry(e){x(n,`info`,`Retrying chunk ${e.chunk} of ${e.chunks}…`)}}),g(100,`Upload complete`),x(n,`success`,`Video received. Processing and EFI CDN verification will continue automatically.`),t.reset(),h=null,S()}catch(t){t instanceof a?(x(n,`info`,`Video upload cancelled.`),h=()=>v(e,s)):(x(n,`error`,`The video upload failed after automatic retries.`),h=()=>v(e,s)),o?.classList.remove(`hidden`)}finally{p=null,r.disabled=!1,i?.classList.add(`hidden`)}};t.addEventListener(`submit`,async i=>{if(i.preventDefault(),!t.reportValidity())return;let a=t.elements.video?.files?.[0],s=Number(e.dataset.videoMaximumBytes);if(!a||a.type!==`video/mp4`){x(n,`error`,`Choose an MP4 video.`);return}if(a.size>s){x(n,`error`,`The selected video exceeds the upload limit.`);return}r.disabled=!0,o?.classList.add(`hidden`),g(0,`Requesting secure upload authorization`),x(n,`info`,`Preparing secure video upload…`);try{let e=await _(a);S(),h=()=>v(a,e),await v(a,e)}catch(e){x(n,`error`,e?.message||`The video upload could not be authorized.`),h=null,r.disabled=!1}}),i?.addEventListener(`click`,()=>p?.abort()),o?.addEventListener(`click`,()=>h?.())}function T(t){if(!t||i.has(t))return;i.add(t);let n=t.querySelector(`[data-media-caption-status]`),r=t.querySelector(`[data-media-caption-submit]`),a=t.querySelector(`[data-media-caption-remove]`);t.addEventListener(`submit`,async e=>{if(e.preventDefault(),!t.reportValidity())return;
463let i=t.elements.caption?.files?.[0],a=Number(t.dataset.captionMaximumBytes);if(!i||!/\.vtt$/iu.test(i.name??``)||!Number.isSafeInteger(i.size)||i.size<1){x(n,`error`,`Choose a non-empty .vtt caption file.`);return}if(!Number.isSafeInteger(a)||a<1||i.size>a){x(n,`error`,`The selected caption file exceeds the upload limit.`);return}r.disabled=!0,x(n,`info`,`Validating and attaching the WebVTT caption track…`);try{await y(t.dataset.captionUploadUrl,new FormData(t)),t.reset(),x(n,`success`,`Caption track verified and attached from the EFI CDN.`),S()}catch(e){x(n,`error`,e?.message||`The caption track could not be attached.`)}finally{r.disabled=!1}}),a?.addEventListener(`click`,async()=>{if(!(typeof e.confirm==`function`&&!e.confirm(`Remove this caption track? Its verified CDN bytes will be retained.`))){a.disabled=!0,x(n,`info`,`Removing the caption track…`);try{await b(a.dataset.captionRemoveUrl),x(n,`success`,`Caption track removed. Its CDN bytes were retained.`),S()}catch(e){x(n,`error`,e?.message||`The caption track could not be removed.`)}finally{a.disabled=!1}}})}function E(e){!e||r.has(e)||(r.add(e),C(e),w(e))}function D(t=e.document){t?.querySelectorAll?.(`[data-website-media-library]`)?.forEach(e=>E(e)),t?.querySelectorAll?.(`[data-media-caption-form]`)?.forEach(e=>T(e))}e.document&&(e.document.readyState===`loading`?e.document.addEventListener(`DOMContentLoaded`,()=>D(),{once:!0}):D(),e.document.addEventListener(`livewire:navigated`,()=>D()),e.document.addEventListener(`livewire:init`,()=>{e.Livewire?.hook?.(`morph.updated`,()=>D())},{once:!0}));let O={UploadCancelledError:a,chunkRanges:o,normalizeVideoAuthorization:s,requestVideoUploadAuthorization:m,sendChunkWithXhr:d,uploadImageMultipart:_,uploadCaptionMultipart:y,removeCaptionTrack:b,uploadFileInChunks:u,boot:D};t!==void 0&&t.exports&&(t.exports=O),e.EnrollmentFirstWebsiteMedia=O})(typeof window<`u`?window:globalThis)}));qL(),JL()})();
464//# sourceMappingURL=app.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.