@joclaim/browser-extension-sdk 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,5 +7,5 @@ t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,l=c>>1,u=-7,f=r?o-1:0,p=
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
9
  */
10
- const n=r(7526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?a(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),a(e<0?0:0|d(e))}function p(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function E(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){let i,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<a;i++)if(l(e,i)===l(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===c)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){let r=!0;for(let n=0;n<c;n++)if(l(e,i+n)!==l(t,n)){r=!1;break}if(r)return i}return-1}function b(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function O(e,t,r,n){return W(X(t,e.length-r),e,r,n)}function I(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return W(H(t),e,r,n)}function T(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function w(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function L(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?L(this,0,e):E.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(i,s),l=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){i=l[e],s=u[e];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":case"latin1":case"binary":return I(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function C(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Q[e[n]];return o}function P(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n,o){V(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,o){V(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function k(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||k(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||k(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=z(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=z(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=z(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=z(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),s=i.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%s]}return this};const B={};function G(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||q(t,e.length-(r+1))}(n,o,i)}function Y(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,r){if(Math.floor(e)!==e)throw Y(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=j(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=j(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function z(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>Ye});var e=r(8287),t=r(5606),o=r.n(t),i=r(3153);function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof l?n:l,u=Object.create(s.prototype);return a(u,"_invoke",function(r,n,o){var i,s,a,l=0,u=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,s=0,a=e,p.n=r,c}};function h(r,n){for(s=r,a=n,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],h=p.p,d=i[2];r>3?(o=d===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,s=0))}if(o||r>1)return c;throw f=!0,n}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),s=u,a=d;(t=s<2?e:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(l=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?a:r.call(n,p))!==c)break}catch(t){i=e,s=1,a=t}finally{l=1}}return{value:t,done:f}}}(r,o,i),!0),u}var c={};function l(){}function u(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),h=f.prototype=l.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=f,a(h,"constructor",f),a(f,"constructor",u),u.displayName="GeneratorFunction",a(f,o,"GeneratorFunction"),a(h),a(h,o,"Generator"),a(h,n,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:i,m:d}})()}function a(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,r,n){function i(t,r){a(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},a(e,t,r,n)}function c(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){c(i,n,o,s,a,"next",e)}function a(e){c(i,n,o,s,a,"throw",e)}s(void 0)})}}var u,f,p,h="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==h?h:Function("return this")(),d="undefined"==typeof window,y="undefined"!=typeof document&&void 0!==document.contentType;if(h.Buffer=h.Buffer||e.hp,h.process=h.process||o(),void 0!==h.WebSocket||y)y?i.w9.info(i.Ey.POLYFILLS,"Skipping WebSocket in content script context"):i.w9.info(i.Ey.POLYFILLS,"Using native WebSocket implementation");else try{var E=r(3296).WebSocket;h.WebSocket=E,i.w9.info(i.Ey.POLYFILLS,"WebSocket polyfill added to global")}catch(e){i.w9.warn(i.Ey.POLYFILLS,"Failed to load WebSocket polyfill:",e)}if(h.process&&(h.process.browser=!0),"function"!=typeof h.require)h.require=function(e){switch(e){case"ws":if(y)return i.w9.info(i.Ey.POLYFILLS,"Blocking ws module in content script"),{};try{return{WebSocket:r(3296).WebSocket}}catch(e){return i.w9.warn(i.Ey.POLYFILLS,"Failed to load WebSocket for ws module:",e),{}}case"fs":return h.fs;case"path":return h.path;case"os":return h.os;case"crypto":return h.crypto;case"worker_threads":case"koffi":case"re2":return{};default:return console.warn("Mock require called for module: ".concat(e)),{}}};else{var g=h.require;h.require=function(e){if("ws"===e){if(y)return i.w9.info(i.Ey.POLYFILLS,"Blocking ws module in content script"),{};try{return{WebSocket:r(3296).WebSocket}}catch(e){return i.w9.warn(i.Ey.POLYFILLS,"Failed to load WebSocket for ws module:",e),{}}}try{return g(e)}catch(t){return i.w9.warn(i.Ey.POLYFILLS,"Failed to require module: ".concat(e)),{}}}}if(void 0!==o()&&(o().browser=!0,o().version||(o().version="v16.0.0"),o().cwd||(o().cwd=function(){return"/"})),void 0===h.global&&(h.global=h),void 0===h.crypto&&(h.crypto={}),void 0===h.crypto.getRandomValues&&(h.crypto.getRandomValues=function(e){for(var t=new Uint8Array(e.length),r=0;r<t.length;r++)t[r]=Math.floor(256*Math.random());return t}),void 0===h.crypto.subtle&&(i.w9.warn(i.Ey.POLYFILLS,"WebCrypto subtle API not available. Some functionality may not work."),h.crypto.subtle={digest:(u=l(s().m(function e(t,r){var n,o,a;return s().w(function(e){for(;;)if(0===e.n){for(i.w9.warn(i.Ey.POLYFILLS,"Crypto subtle digest (".concat(t,") called with browser fallback")),n=Array.from(new Uint8Array(r)).reduce(function(e,t){return 31*e+t&4294967295},0),o=new Uint8Array(32),a=0;a<32;a++)o[a]=n>>8*a&255;return e.a(2,o.buffer)}},e)})),function(e,t){return u.apply(this,arguments)})}),!d){var m=function(e,t){return"string"==typeof e&&e.startsWith("node:")&&(e=e.replace(/^node:/,"")),new v(e,t)};void 0===h.domain&&(h.domain={create:function(){return{run:function(e){return e()},on:function(){},bind:function(e){return e}}}});var v=h.URL;m.prototype=v.prototype;try{Object.getOwnPropertyNames(v).forEach(function(e){if("prototype"!==e&&"constructor"!==e)try{m[e]=v[e]}catch(e){}})}catch(e){i.w9.warn(i.Ey.POLYFILLS,"Could not copy all URL static properties:",e)}try{h.URL=m}catch(e){i.w9.warn(i.Ey.POLYFILLS,"Could not override URL constructor:",e)}}void 0===h.module&&(h.module={exports:{}}),h.fs=h.fs||{readFileSync:function(e){throw i.w9.warn(i.Ey.POLYFILLS,"Attempted to readFileSync: ".concat(e)),new Error("fs.readFileSync is not available in this environment")},writeFileSync:function(e,t){i.w9.warn(i.Ey.POLYFILLS,"Attempted to writeFileSync: ".concat(e))},existsSync:function(e){return i.w9.warn(i.Ey.POLYFILLS,"Attempted to check if file exists: ".concat(e)),!1},promises:{readFile:(p=l(s().m(function e(t){return s().w(function(e){for(;;)switch(e.n){case 0:throw i.w9.warn(i.Ey.POLYFILLS,"Attempted to readFile: ".concat(t)),new Error("fs.promises.readFile is not available in this environment");case 1:return e.a(2)}},e)})),function(e){return p.apply(this,arguments)}),writeFile:(f=l(s().m(function e(t,r){return s().w(function(e){for(;;)switch(e.n){case 0:i.w9.warn(i.Ey.POLYFILLS,"Attempted to writeFile: ".concat(t));case 1:return e.a(2)}},e)})),function(e,t){return f.apply(this,arguments)})}},h.os=h.os||{tmpdir:function(){return"/tmp"},homedir:function(){return"/home/user"},platform:function(){return"browser"},type:function(){return"Browser"},cpus:function(){return[{model:"Browser CPU",speed:1e3}]},totalmem:function(){return 8589934592},freemem:function(){return 4294967296}},h.path=h.path||{join:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.join("/").replace(/\/+/g,"/")},resolve:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.join("/").replace(/\/+/g,"/")},dirname:function(e){return e.split("/").slice(0,-1).join("/")||"."},basename:function(e,t){var r=e.split("/").pop()||"";return t&&r.endsWith(t)&&(r=r.slice(0,-t.length)),r},extname:function(e){var t=e.split("/").pop()||"",r=t.lastIndexOf(".");return r<0?"":t.slice(r)},sep:"/"};e.hp,o();var b={CHECK_EXTENSION:"JOCLAIM_EXTENSION_CHECK",EXTENSION_RESPONSE:"JOCLAIM_EXTENSION_RESPONSE",START_VERIFICATION:"JOCLAIM_START_VERIFICATION",VERIFICATION_STARTED:"JOCLAIM_VERIFICATION_STARTED",VERIFICATION_COMPLETED:"JOCLAIM_VERIFICATION_COMPLETED",VERIFICATION_FAILED:"JOCLAIM_VERIFICATION_FAILED",CANCEL_VERIFICATION:"JOCLAIM_CANCEL_VERIFICATION",SET_PUBLIC_DATA:"JOCLAIM_SET_PUBLIC_DATA",PARAMETERS_UPDATE:"JOCLAIM_PARAMETERS_UPDATE",PARAMETERS_GET:"JOCLAIM_PARAMETERS_GET",REPORT_PROVIDER_ERROR:"JOCLAIM_REPORT_PROVIDER_ERROR",SET_EXPECT_MANY_CLAIMS:"JOCLAIM_SET_EXPECT_MANY_CLAIMS",REQUEST_CLAIM:"JOCLAIM_REQUEST_CLAIM",SET_LOG_CONFIG:"JOCLAIM_SET_LOG_CONFIG"},O="content-script",I="background",_="offscreen",T="START_VERIFICATION",w="CANCEL_VERIFICATION",L="CLAIM_CREATION_REQUESTED",S="CLAIM_CREATION_SUCCESS",A="CLAIM_CREATION_FAILED",C="PROOF_GENERATION_STARTED",R="PROOF_GENERATION_SUCCESS",P="PROOF_GENERATION_FAILED",N="PROOF_SUBMITTED",x="PROOF_SUBMISSION_FAILED",F="SHOW_PROVIDER_VERIFICATION_POPUP",D="OFFSCREEN_DOCUMENT_READY",k="REQUEST_PROVIDER_DATA",M="PROVIDER_DATA_READY",U="CONTENT_SCRIPT_LOADED",B="SHOULD_INITIALIZE",G="CHECK_IF_MANAGED_TAB",j="FILTERED_REQUEST_FOUND",V="INTERCEPTED_REQUEST_AND_RESPONSE",Y="UPDATE_PUBLIC_DATA",q="UPDATE_EXPECT_MANY_CLAIMS",$="GET_PARAMETERS",X="REPORT_PROVIDER_ERROR",H="REQUEST_CLAIM",W="INJECT_VIA_SCRIPTING";function K(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof a?n:a,l=Object.create(c.prototype);return J(l,"_invoke",function(r,n,o){var i,a,c,l=0,u=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function h(r,n){for(a=r,c=n,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],h=p.p,d=i[2];r>3?(o=d===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=r<2&&h<i[1])?(a=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),a=u,c=d;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),h(a,c)):p.n=c:p.v=c);try{if(l=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{l=1}}return{value:t,done:f}}}(r,o,i),!0),l}var s={};function a(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(J(t={},n,function(){return this}),t),f=l.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,J(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=l,J(f,"constructor",l),J(l,"constructor",c),c.displayName="GeneratorFunction",J(l,o,"GeneratorFunction"),J(f),J(f,o,"Generator"),J(f,n,function(){return this}),J(f,"toString",function(){return"[object Generator]"}),(K=function(){return{w:i,m:p}})()}function J(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}J=function(e,t,r,n){function i(t,r){J(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},J(e,t,r,n)}function Q(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function z(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){Q(i,n,o,s,a,"next",e)}function a(e){Q(i,n,o,s,a,"throw",e)}s(void 0)})}}function Z(e,t,r,n){!function(){c.apply(this,arguments)}();var o=document.createElement("div");o.id="reclaim-protocol-popup",o.className="reclaim-popup",o.style.animation="reclaim-appear 0.3s ease-out";var i={totalClaims:0,completedClaims:0,proofSubmitted:!1,inProgress:!1,error:null},s=!1,a={x:0,y:0};function c(){return(c=z(K().m(function e(){var t,r,n,o,i,s;return K().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!document.getElementById("reclaim-popup-styles")){e.n=1;break}return e.a(2);case 1:return e.p=1,t=chrome.runtime.getURL("reclaim-browser-extension-sdk/content/components/reclaim-provider-verification-popup.css"),e.n=2,fetch(t);case 2:return r=e.v,e.n=3,r.text();case 3:n=e.v,(o=document.createElement("style")).id="reclaim-popup-styles",o.textContent=n,(i=function(){document.head?document.head.appendChild(o):document.body?document.body.appendChild(o):setTimeout(i,10)})(),e.n=5;break;case 4:e.p=4,s=e.v,console.error("Failed to load Reclaim popup CSS:",s);case 5:return e.a(2)}},e,null,[[1,4]])}))).apply(this,arguments)}function l(){return u.apply(this,arguments)}function u(){return(u=z(K().m(function e(){var t,r,n,o;return K().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=chrome.runtime.getURL("reclaim-browser-extension-sdk/content/components/reclaim-provider-verification-popup.html"),e.n=1,fetch(t);case 1:return r=e.v,e.n=2,r.text();case 2:return n=e.v,e.a(2,n);case 3:return e.p=3,o=e.v,console.error("Failed to load Reclaim popup HTML template:",o),e.a(2,"")}},e,null,[[0,3]])}))).apply(this,arguments)}function f(){return(f=z(K().m(function i(){var s,a;return K().w(function(i){for(;;)switch(i.n){case 0:return i.n=1,l();case 1:if(s=i.v){i.n=2;break}return console.error("Failed to load HTML template - popup will not render correctly"),i.a(2);case 2:a=s.replace(/\{\{providerName\}\}/g,e).replace(/\{\{description\}\}/g,t).replace(/\{\{dataRequired\}\}/g,r).replace(/\{\{sessionId\}\}/g,n),o.innerHTML=a;case 3:return i.a(2)}},i)}))).apply(this,arguments)}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Generating verification proof...",t=o.querySelector("#reclaim-steps-container"),r=o.querySelector("#reclaim-status-container"),n=o.querySelector("#reclaim-circular-loader"),s=o.querySelector("#reclaim-status-progress"),a=o.querySelector("#reclaim-status-text"),c=o.querySelector("#reclaim-success-icon"),l=o.querySelector("#reclaim-error-icon"),u=o.querySelector(".reclaim-popup-content");t&&t.classList.add("hidden"),c&&(c.style.display="none"),l&&(l.style.display="none"),r.classList.add("visible"),u.classList.add("status-active"),n.style.display="flex",s.style.display="block",a.textContent=e,i.inProgress=!0,h()}function h(){var e=o.querySelector("#reclaim-progress-bar"),t=o.querySelector("#reclaim-progress-counter");if(i.totalClaims>0){var r=i.completedClaims/i.totalClaims;e.style.transform="scaleX(".concat(r,")"),t.textContent="".concat(i.completedClaims,"/").concat(i.totalClaims)}else e.style.transform="scaleX(1)",e.style.animation="reclaim-progress-pulse 2s infinite",t.textContent=""}function d(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=o.querySelector("#reclaim-status-message");r.textContent=e,r.style.color=t?"#ef4444":"rgba(255, 255, 255, 0.8)"}function y(){var e=o.querySelector("#reclaim-steps-container"),t=o.querySelector("#reclaim-status-container"),r=o.querySelector("#reclaim-circular-loader"),n=o.querySelector("#reclaim-status-progress"),s=o.querySelector("#reclaim-status-text"),a=o.querySelector("#reclaim-progress-bar"),c=o.querySelector("#reclaim-progress-counter"),l=o.querySelector(".reclaim-popup-content");e&&e.classList.add("hidden"),r.style.display="none",t.classList.add("visible"),l.classList.add("status-active"),n.style.display="block",s.textContent="Verification complete!",requestAnimationFrame(function(){a.style.width="100%",a.style.transform="scaleX(1)",a.classList.add("success"),a.style.animation="none"}),i.totalClaims>0?c.textContent="".concat(i.totalClaims,"/").concat(i.totalClaims):c.textContent="100%",d("You will be redirected to the original page shortly.");var u=o.querySelector("#reclaim-success-icon"),f=o.querySelector("#reclaim-error-icon");u&&(u.style.display="flex"),f&&(f.style.display="none")}function E(e){var t=o.querySelector("#reclaim-steps-container"),r=o.querySelector("#reclaim-status-container"),n=o.querySelector("#reclaim-circular-loader"),i=o.querySelector("#reclaim-status-progress"),s=o.querySelector("#reclaim-status-text"),a=o.querySelector("#reclaim-progress-bar"),c=o.querySelector(".reclaim-popup-content");t&&t.classList.add("hidden"),n.style.display="none",r.classList.add("visible"),c.classList.add("status-active"),i.style.display="block",s.textContent="Verification failed",a.style.transform="scaleX(1)",a.classList.add("error"),a.style.animation="none",d(e,!0);var l=o.querySelector("#reclaim-error-icon"),u=o.querySelector("#reclaim-success-icon");l&&(l.style.display="flex"),u&&(u.style.display="none")}function g(){i.totalClaims+=1,h()}function m(){i.completedClaims+=1,h()}return function(){return f.apply(this,arguments)}().then(function(){!function(){var e=o.querySelector(".reclaim-popup-header");function t(e){if(0===e.button){s=!0,o.classList.add("dragging");var t=o.getBoundingClientRect();a.x=e.clientX-t.left,a.y=e.clientY-t.top,e.preventDefault(),document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}}function r(e){if(s){e.preventDefault();var t=e.clientX-a.x,r=e.clientY-a.y,n=window.innerWidth,i=window.innerHeight,c=o.offsetWidth,l=o.offsetHeight;t=Math.max(0,Math.min(t,n-c)),r=Math.max(0,Math.min(r,i-l)),o.style.left=t+"px",o.style.top=r+"px",o.style.right="auto",o.style.bottom="auto"}}function n(e){s&&(s=!1,o.classList.remove("dragging"),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n))}e.addEventListener("mousedown",t),e.addEventListener("contextmenu",function(e){e.preventDefault()})}(),function(){var e=o.querySelector(".reclaim-copy-icon"),t=o.querySelector("#reclaim-copy-feedback");e&&e.addEventListener("click",function(){var t=z(K().m(function t(n){var i,s,a,c;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:if(n.preventDefault(),n.stopPropagation(),i=e.getAttribute("data-copy-target"),!(s=o.querySelector("#".concat(i)))){t.n=6;break}if(t.p=1,a=s.textContent.trim(),!navigator.clipboard||!navigator.clipboard.writeText){t.n=3;break}return t.n=2,navigator.clipboard.writeText(a);case 2:r("Copied!"),t.n=4;break;case 3:(c=document.createElement("textarea")).value=a,c.style.position="fixed",c.style.left="-9999px",c.style.top="-9999px",document.body.appendChild(c),c.focus(),c.select();try{document.execCommand("copy")?r("Copied!"):r("Failed to copy",!0)}catch(e){r("Failed to copy",!0)}document.body.removeChild(c);case 4:t.n=6;break;case 5:t.p=5,t.v,r("Failed to copy",!0);case 6:return t.a(2)}},t,null,[[1,5]])}));return function(e){return t.apply(this,arguments)}}());function r(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(t.textContent=e,t.style.color="#ffffff",t.style.background=r?"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)":"linear-gradient(135deg, #10b981 0%, #059669 100%)",t.classList.add("show"),setTimeout(function(){t.classList.remove("show")},2e3))}}(),o.querySelectorAll(".reclaim-info-value[data-tooltip]").forEach(function(e){var t=e.getAttribute("data-tooltip");if(e.textContent.trim(),t&&t.length>25){var r=function(){o||((o=document.createElement("div")).className="reclaim-info-tooltip",o.textContent=t,e.appendChild(o)),o.classList.add("show")},n=function(){o&&o.classList.remove("show")},o=null,i=null;e.addEventListener("mouseenter",function(){clearTimeout(i),i=setTimeout(r,500)}),e.addEventListener("mouseleave",function(){clearTimeout(i),n()}),e.addEventListener("click",function(e){e.stopPropagation(),o&&o.classList.contains("show")?n():r()})}}),document.addEventListener("click",function(){o.querySelectorAll(".reclaim-info-tooltip.show").forEach(function(e){e.classList.remove("show")})})}),{element:o,showLoader:p,updateStatusMessage:d,showSuccess:y,showError:E,incrementTotalClaims:g,incrementCompletedClaims:m,handleClaimCreationRequested:function(e){g(),p("Creating verification claim...")},handleClaimCreationSuccess:function(e){d("Claim created successfully. Generating proof...")},handleClaimCreationFailed:function(e){E("Failed to create claim. Please try again.")},handleProofGenerationStarted:function(e){d("Generating cryptographic proof...")},handleProofGenerationSuccess:function(e){m(),d("Proof generated (".concat(i.completedClaims,"/").concat(i.totalClaims,")"))},handleProofGenerationFailed:function(e){E("Failed to generate proof. Please try again.")},handleProofSubmitted:function(){i.proofSubmitted=!0,y()},handleProofSubmissionFailed:function(e){E("Failed to submit proof: ".concat(e))}}}class ee{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+ee.version}static addUnaryOp(e){return ee.max_unop_len=Math.max(e.length,ee.max_unop_len),ee.unary_ops[e]=1,ee}static addBinaryOp(e,t,r){return ee.max_binop_len=Math.max(e.length,ee.max_binop_len),ee.binary_ops[e]=t,r?ee.right_associative.add(e):ee.right_associative.delete(e),ee}static addIdentifierChar(e){return ee.additional_identifier_chars.add(e),ee}static addLiteral(e,t){return ee.literals[e]=t,ee}static removeUnaryOp(e){return delete ee.unary_ops[e],e.length===ee.max_unop_len&&(ee.max_unop_len=ee.getMaxKeyLen(ee.unary_ops)),ee}static removeAllUnaryOps(){return ee.unary_ops={},ee.max_unop_len=0,ee}static removeIdentifierChar(e){return ee.additional_identifier_chars.delete(e),ee}static removeBinaryOp(e){return delete ee.binary_ops[e],e.length===ee.max_binop_len&&(ee.max_binop_len=ee.getMaxKeyLen(ee.binary_ops)),ee.right_associative.delete(e),ee}static removeAllBinaryOps(){return ee.binary_ops={},ee.max_binop_len=0,ee}static removeLiteral(e){return delete ee.literals[e],ee}static removeAllLiterals(){return ee.literals={},ee}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new ee(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return ee.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!ee.binary_ops[String.fromCharCode(e)]||ee.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return ee.isIdentifierStart(e)||ee.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(ee.hooks[e]){const r={context:this,node:t};return ee.hooks.run(e,r),r.node}return t}searchHook(e){if(ee.hooks[e]){const t={context:this};return ee.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===ee.SPACE_CODE||e===ee.TAB_CODE||e===ee.LF_CODE||e===ee.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:ee.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,r,n=[];for(;this.index<this.expr.length;)if(t=this.code,t===ee.SEMCOL_CODE||t===ee.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,ee.max_binop_len),t=e.length;for(;t>0;){if(ee.binary_ops.hasOwnProperty(e)&&(!ee.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!ee.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,o,i,s,a,c;if(i=this.gobbleToken(),!i)return i;if(t=this.gobbleBinaryOp(),!t)return i;for(o={value:t,prec:ee.binaryPrecedence(t),right_a:ee.right_associative.has(t)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+t),n=[i,o,s];t=this.gobbleBinaryOp();){if(r=ee.binaryPrecedence(t),0===r){this.index-=t.length;break}o={value:t,prec:r,right_a:ee.right_associative.has(t)},c=t;const a=e=>o.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&a(n[n.length-2]);)s=n.pop(),t=n.pop().value,i=n.pop(),e={type:ee.BINARY_EXP,operator:t,left:i,right:s},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),n.push(o,e)}for(a=n.length-1,e=n[a];a>1;)e={type:ee.BINARY_EXP,operator:n[a-1].value,left:n[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,ee.isDecimalDigit(e)||e===ee.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===ee.SQUOTE_CODE||e===ee.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===ee.OBRACK_CODE)n=this.gobbleArray();else{for(t=this.expr.substr(this.index,ee.max_unop_len),r=t.length;r>0;){if(ee.unary_ops.hasOwnProperty(t)&&(!ee.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!ee.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;const e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:ee.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}ee.isIdentifierStart(e)?(n=this.gobbleIdentifier(),ee.literals.hasOwnProperty(n.name)?n={type:ee.LITERAL,value:ee.literals[n.name],raw:n.name}:n.name===ee.this_str&&(n={type:ee.THIS_EXP})):e===ee.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===ee.PERIOD_CODE||t===ee.OBRACK_CODE||t===ee.OPAREN_CODE||t===ee.QUMARK_CODE;){let r;if(t===ee.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==ee.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===ee.OBRACK_CODE?((e={type:ee.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==ee.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===ee.OPAREN_CODE?e={type:ee.CALL_EXP,arguments:this.gobbleArguments(ee.CPAREN_CODE),callee:e}:(t===ee.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:ee.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,r="";for(;ee.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(this.code===ee.PERIOD_CODE)for(r+=this.expr.charAt(this.index++);ee.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(r+=this.expr.charAt(this.index++),e=this.char,"+"!==e&&"-"!==e||(r+=this.expr.charAt(this.index++));ee.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);ee.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")")}return t=this.code,ee.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+r+this.char+")"):(t===ee.PERIOD_CODE||1===r.length&&r.charCodeAt(0)===ee.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:ee.LITERAL,value:parseFloat(r),raw:r}}gobbleStringLiteral(){let e="";const t=this.index,r=this.expr.charAt(this.index++);let n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:ee.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(ee.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,ee.isIdentifierPart(e));)this.index++;return{type:ee.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===e){r=!0,this.index++,e===ee.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(o===ee.COMMA_CODE){if(this.index++,n++,n!==t.length)if(e===ee.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===ee.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{const e=this.gobbleExpression();e&&e.type!==ee.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(ee.CPAREN_CODE);if(this.code===ee.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:ee.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:ee.ARRAY_EXP,elements:this.gobbleArguments(ee.CBRACK_CODE)}}}const te=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}};Object.assign(ee,{hooks:te,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(ee),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),ee.max_unop_len=ee.getMaxKeyLen(ee.unary_ops),ee.max_binop_len=ee.getMaxKeyLen(ee.binary_ops);const re=e=>new ee(e).parse(),ne=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(ee).filter(e=>!ne.includes(e)&&void 0===re[e]).forEach(e=>{re[e]=ee[e]}),re.Jsep=ee;var oe={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:o},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};re.plugins.register(oe);var ie={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){const n=this.expr.slice(r,this.index);let o,i="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{o=new RegExp(n,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const se={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){se.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}se.assignmentOperators.forEach(t=>e.addBinaryOp(t,se.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;se.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;se.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};re.plugins.register(ie,se),re.addUnaryOp("typeof"),re.addLiteral("null",null),re.addLiteral("undefined",void 0);const ae=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),ce={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return ce.evalBinaryExpression(e,t);case"Compound":return ce.evalCompound(e,t);case"ConditionalExpression":return ce.evalConditionalExpression(e,t);case"Identifier":return ce.evalIdentifier(e,t);case"Literal":return ce.evalLiteral(e,t);case"MemberExpression":return ce.evalMemberExpression(e,t);case"UnaryExpression":return ce.evalUnaryExpression(e,t);case"ArrayExpression":return ce.evalArrayExpression(e,t);case"CallExpression":return ce.evalCallExpression(e,t);case"AssignmentExpression":return ce.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](ce.evalAst(e.left,t),()=>ce.evalAst(e.right,t))),evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){"Identifier"===e.body[n].type&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&"AssignmentExpression"===e.body[n+1].type&&(n+=1);const o=e.body[n];r=ce.evalAst(o,t)}return r},evalConditionalExpression:(e,t)=>ce.evalAst(e.test,t)?ce.evalAst(e.consequent,t):ce.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?ce.evalAst(e.property):e.property.name),n=ce.evalAst(e.object,t);if(null==n)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&ae.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const o=n[r];return"function"==typeof o?o.bind(n):o},evalUnaryExpression:(e,t)=>({"-":e=>-ce.evalAst(e,t),"!":e=>!ce.evalAst(e,t),"~":e=>~ce.evalAst(e,t),"+":e=>+ce.evalAst(e,t),typeof:e=>typeof ce.evalAst(e,t)}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>ce.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>ce.evalAst(e,t));return ce.evalAst(e.callee,t)(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,n=ce.evalAst(e.right,t);return t[r]=n,t[r]}};function le(e,t){return(e=e.slice()).push(t),e}function ue(e,t){return(t=t.slice()).unshift(e),t}class fe extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function pe(e,t,r,n,o){if(!(this instanceof pe))try{return new pe(e,t,r,n,o)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(o=n,n=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const n={path:i?e.path:t};i?"json"in e&&(n.json=e.json):n.json=r;const o=this.evaluate(n);if(!o||"object"!=typeof o)throw new fe(o);return o}}pe.prototype.evaluate=function(e,t,r,n){let o=this.parent,i=this.parentProperty,{flatten:s,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),s=Object.hasOwn(e,"flatten")?e.flatten:s,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(e,"parent")?e.parent:o,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(o=o||null,i=i||null,Array.isArray(e)&&(e=pe.toPathString(e)),!e&&""!==e||!t)return;const c=pe.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;const l=this._trace(c,t,["$"],o,i,r).filter(function(e){return e&&!e.isParentSelector});return l.length?a||1!==l.length||l[0].hasArrExpr?l.reduce((e,t)=>{const r=this._getPreferredOutput(t);return s&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[]):this._getPreferredOutput(l[0]):a?[]:void 0},pe.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:pe.toPathArray(e.path);return e.pointer=pe.toPointer(t),e.path="string"==typeof e.path?e.path:pe.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return pe.toPathString(e[t]);case"pointer":return pe.toPointer(e.path);default:throw new TypeError("Unknown result type")}},pe.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:pe.toPathString(e.path),t(n,r,e)}},pe.prototype._trace=function(e,t,r,n,o,i,s,a){let c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:o,hasArrExpr:s},this._handleCallback(c,i,"value"),c;const l=e[0],u=e.slice(1),f=[];function p(e){Array.isArray(e)?e.forEach(e=>{f.push(e)}):f.push(e)}if(("string"!=typeof l||a)&&t&&Object.hasOwn(t,l))p(this._trace(u,t[l],le(r,l),t,l,i,s));else if("*"===l)this._walk(t,e=>{p(this._trace(u,t[e],le(r,e),t,e,i,!0,!0))});else if(".."===l)p(this._trace(u,t,r,n,o,i,s)),this._walk(t,n=>{"object"==typeof t[n]&&p(this._trace(e.slice(),t[n],le(r,n),t,n,i,!0))});else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if("~"===l)return c={path:le(r,l),value:o,parent:n,parentProperty:null},this._handleCallback(c,i,"property"),c;if("$"===l)p(this._trace(u,t,r,null,null,i,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))p(this._slice(l,u,t,r,n,o,i));else if(0===l.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1"),s=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);s?this._walk(t,e=>{const a=[s[2]],c=s[1]?t[e][s[1]]:t[e];this._trace(a,c,r,n,o,i,!0).length>0&&p(this._trace(u,t[e],le(r,e),t,e,i,!0))}):this._walk(t,s=>{this._eval(e,t[s],s,r,n,o)&&p(this._trace(u,t[s],le(r,s),t,s,i,!0))})}else if("("===l[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(ue(this._eval(l,t,r.at(-1),r.slice(0,-1),n,o),u),t,r,n,o,i,s))}else if("@"===l[0]){let e=!1;const s=l.slice(1,-2);switch(s){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===s&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===s&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,n,o);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+s)}if(e)return c={path:r,value:t,parent:n,parentProperty:o},this._handleCallback(c,i,"value"),c}else if("`"===l[0]&&t&&Object.hasOwn(t,l.slice(1))){const e=l.slice(1);p(this._trace(u,t[e],le(r,e),t,e,i,s,!0))}else if(l.includes(",")){const e=l.split(",");for(const s of e)p(this._trace(ue(s,u),t,r,n,o,i,!0))}else!a&&t&&Object.hasOwn(t,l)&&p(this._trace(u,t[l],le(r,l),t,l,i,s,!0))}if(this._hasParentSelector)for(let e=0;e<f.length;e++){const r=f[e];if(r&&r.isParentSelector){const a=this._trace(r.expr,t,r.path,n,o,i,s);if(Array.isArray(a)){f[e]=a[0];const t=a.length;for(let r=1;r<t;r++)e++,f.splice(e,0,a[r])}else f[e]=a}}return f},pe.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let e=0;e<r;e++)t(e)}else e&&"object"==typeof e&&Object.keys(e).forEach(e=>{t(e)})},pe.prototype._slice=function(e,t,r,n,o,i,s){if(!Array.isArray(r))return;const a=r.length,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1;let u=c[0]&&Number.parseInt(c[0])||0,f=c[1]&&Number.parseInt(c[1])||a;u=u<0?Math.max(0,u+a):Math.min(a,u),f=f<0?Math.max(0,f+a):Math.min(a,f);const p=[];for(let e=u;e<f;e+=l){this._trace(ue(e,t),r,n,o,i,s,!0).forEach(e=>{p.push(e)})}return p},pe.prototype._eval=function(e,t,r,n,o,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=o,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const s=e.includes("@path");s&&(this.currSandbox._$_path=pe.toPathString(n.concat([r])));const a=this.currEval+"Script:"+e;if(!pe.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(s&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)pe.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)pe.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;pe.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);pe.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return pe.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},pe.cache={},pe.toPathString=function(e){const t=e,r=t.length;let n="$";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+=/^[0-9*]+$/u.test(t[e])?"["+t[e]+"]":"['"+t[e]+"']");return n},pe.toPointer=function(e){const t=e,r=t.length;let n="";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+="/"+t[e].toString().replaceAll("~","~0").replaceAll("/","~1"));return n},pe.toPathArray=function(e){const{cache:t}=pe;if(t[e])return t[e].concat();const r=[],n=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(e,t){return"[#"+(r.push(t)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(e,t){return"['"+t.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(e,t){return";"+t.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(e){const t=e.match(/#(\d+)/u);return t&&t[1]?r[t[1]]:e});return t[e]=n,t[e].concat()},pe.prototype.safeVm={Script:class{constructor(e){this.code=e,this.ast=re(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return ce.evalAst(this.ast,t)}}};pe.prototype.vm={Script:class{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const r=Object.keys(e),n=[];!function(e,t,r){const n=e.length;for(let o=0;o<n;o++)r(e[o])&&t.push(e.splice(o--,1)[0])}(r,n,t=>"function"==typeof e[t]);const o=r.map(t=>e[t]);t=n.reduce((t,r)=>{let n=e[r].toString();return/function/u.test(n)||(n="function "+n),"var "+r+"="+n+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),s=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,s)(...o)}}};var he=function(e,t){try{var r=pe({path:t,json:e}),n=null==r?void 0:r[0];if(void 0===n)return;return null===n?"null":n}catch(e){return void i.w9.error(i.Ey.CLAIM,"[PARAMS-EXTRACTOR-UTILS] Error extracting JSON value with path ".concat(t,":"),e)}},de=function(e,t){try{var r=t.replace(/^\/\//,"").replace(/\/@/," ").split("/"),n=r[r.length-1],o=new RegExp("<".concat(n,"[^>]*>(.*?)</").concat(n,">"),"i"),s=e.match(o);return s?s[1]:void 0}catch(e){return void i.w9.error(i.Ey.CLAIM,"[PARAMS-EXTRACTOR-UTILS] Error extracting HTML value with XPath ".concat(t,":"),e)}};function ye(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ee(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ge(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.replace(/[[\]()*+?.,\\^$|#]/g,"\\$&"),o=function(e){for(var t,r=/{{(\w+)}}/g,n=[];null!==(t=r.exec(e));)n.push(t[1]);return n}(e),i=[],s=ye(o);try{for(s.s();!(t=s.n()).done;){var a=t.value;if(r[a])n=n.replace("{{".concat(a,"}}"),r[a]);else{i.push(a);var c=a.endsWith("GRD")?"(.*)":"(.*?)";n=n.replace("{{".concat(a,"}}"),c)}}}catch(e){s.e(e)}finally{s.f()}return{pattern:n,allVars:o,unsubstitutedVars:i}}function me(e,t,r){if(!t||0===t.length)return!0;var n=null,o=function(e){if(!e||"string"!=typeof e)return!1;var t=e.trim();return t.startsWith("{")||t.startsWith("[")}(e);o&&(n=function(e){try{return JSON.parse(e)}catch(e){return i.w9.warn(i.Ey.CLAIM,"[PARAMS-EXTRACTOR-UTILS] Response looks like JSON but couldn't be parsed"),null}}(e));var s,a=ye(t);try{for(a.s();!(s=a.n()).done;){var c=s.value;if(c.jsonPath&&n)try{if(void 0===he(n,c.jsonPath))return!1}catch(e){return r.error({message:"[NETWORK-FILTER] Error checking jsonPath ".concat(c.jsonPath,":"),logLevel:i.E$.INFO,type:i.D_.CONTENT,eventType:i.Ru.JSON_PATH_MATCH_REQUIREMENT_FAILED}),!1}else if(c.xPath&&!o)try{if(!de(e,c.xPath))return!1}catch(e){return r.error({message:"[NETWORK-FILTER] Error checking xPath ".concat(c.xPath,":"),logLevel:i.E$.INFO,type:i.D_.CONTENT,eventType:i.Ru.X_PATH_MATCH_REQUIREMENT_FAILED}),!1}else if(c.regex)try{if(!new RegExp(c.regex).test(e))return!1}catch(e){return r.error({message:"[NETWORK-FILTER] Error checking regex ".concat(c.regex,":"),logLevel:i.E$.INFO,type:i.D_.CONTENT,eventType:i.Ru.REGEX_MATCH_REQUIREMENT_FAILED}),!1}}}catch(e){a.e(e)}finally{a.f()}return!0}var ve=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;try{return!!function(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(!t||!e)&&!!function(){var r=t.url,n=t.urlType;if(!r)return!1;var i=(n||"EXACT").toUpperCase();if("EXACT"===i)return r===e.url;if("REGEX"===i||"TEMPLATE"===i){var s=ge(r,o).pattern;return new RegExp(s).test(e.url)}return!1}()&&(null===(r=e.method)||void 0===r?void 0:r.toUpperCase())===(null===(n=t.method)||void 0===n?void 0:n.toUpperCase())&&function(r,n){var i=t.bodySniff;if(!i||!i.enabled)return!0;var s=null!==(r=i.template)&&void 0!==r?r:"",a="string"==typeof e.body?e.body:JSON.stringify(null!==(n=e.body)&&void 0!==n?n:{});if(s===a)return!0;var c=ge(s,o).pattern;return new RegExp(c).test(a)}()}(e,t,r)&&(!(e.responseText&&t.responseMatches&&!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||0===t.length)return!0;var n,o=ye(t);try{for(o.s();!(n=o.n()).done;){var i=n.value,s=void 0;s="regex"===i.type?i.value:ge(i.value,r).pattern;var a=new RegExp(s).test(e);if(!(i.invert?!a:a))return!1}}catch(e){o.e(e)}finally{o.f()}return!0}(e.responseText,t.responseMatches,r))&&!(e.responseText&&t.responseRedactions&&!me(e.responseText,t.responseRedactions,n)))}catch(e){return n.error({message:"[NETWORK-FILTER] Error filtering request:",logLevel:i.E$.ERROR,type:i.D_.CONTENT,eventType:i.Ru.FILTER_REQUEST_ERROR,meta:{error:e}}),!1}};var be=r(7770),Oe=r(3859);var Ie=(0,be.y8)({sessionId:"unknown",providerId:"unknown",appId:"unknown",source:"reclaim-extension-sdk",type:Oe.LOG_TYPES.OFFSCREEN}),_e=null,Te=function(e){(null==e?void 0:e.action)===D&&(null==e?void 0:e.source)===_&&(null==e?void 0:e.target)===I&&(Ie.info({message:"[OFFSCREEN-MANAGER] Received offscreen ready signal (global listener).",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.OFFSCREEN}),_e&&(clearTimeout(_e),_e=null))},we=function(){"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.onMessage&&chrome.runtime.onMessage.addListener&&chrome.runtime.onMessage.hasListener&&(chrome.runtime.onMessage.hasListener(Te)||chrome.runtime.onMessage.addListener(Te))};"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.onMessage&&we(),we();function Le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return a}}(e,t)||Ae(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Se(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ae(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function Ae(e,t){if(e){if("string"==typeof e)return Ce(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ne(n.key),n)}}function Ne(e){var t=function(e,t){if("object"!=Re(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Re(t)?t:t+""}function xe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof a?n:a,l=Object.create(c.prototype);return Fe(l,"_invoke",function(r,n,o){var i,a,c,l=0,u=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function h(r,n){for(a=r,c=n,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],h=p.p,d=i[2];r>3?(o=d===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=r<2&&h<i[1])?(a=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),a=u,c=d;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),h(a,c)):p.n=c:p.v=c);try{if(l=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{l=1}}return{value:t,done:f}}}(r,o,i),!0),l}var s={};function a(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Fe(t={},n,function(){return this}),t),f=l.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Fe(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=l,Fe(f,"constructor",l),Fe(l,"constructor",c),c.displayName="GeneratorFunction",Fe(l,o,"GeneratorFunction"),Fe(f),Fe(f,o,"Generator"),Fe(f,n,function(){return this}),Fe(f,"toString",function(){return"[object Generator]"}),(xe=function(){return{w:i,m:p}})()}function Fe(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Fe=function(e,t,r,n){function i(t,r){Fe(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Fe(e,t,r,n)}function De(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}var ke=(0,be.y8)({sessionId:"unknown",providerId:"unknown",appId:"unknown",source:"reclaim-extension-sdk"}),Me=!1,Ue=!1,Be=!1,Ge=function(){if(!Ue)try{var e=document.createElement("script"),t=chrome.runtime.getURL("reclaim-browser-extension-sdk/interceptor/network-interceptor.bundle.js");e.src=t,e.type="text/javascript",e.async=!1,e.defer=!1;var r=!1,n=function(){r||(document.documentElement?(document.documentElement.insertBefore(e,document.documentElement.firstChild),r=!0,Ue=!0):document.head?(document.head.insertBefore(e,document.head.firstChild),r=!0,Ue=!0):document&&(document.appendChild(e),r=!0,Ue=!0))};if(n(),!r){var o=new MutationObserver(function(){r||!document.documentElement&&!document.head||(n(),r&&o.disconnect())});o.observe(document,{childList:!0,subtree:!0})}return e}catch(e){return null}},je=function(){if(!Be)try{var e=document.createElement("script");e.src=chrome.runtime.getURL("reclaim-browser-extension-sdk/interceptor/injection-scripts.bundle.js"),e.type="text/javascript",e.async=!1,e.defer=!1;var t=!1,r=function(){t||(document.documentElement?(document.documentElement.insertBefore(e,document.documentElement.firstChild),t=!0,Be=!0):document.head?(document.head.insertBefore(e,document.head.firstChild),t=!0,Be=!0):document&&(document.appendChild(e),t=!0,Be=!0))};if(r(),!t){var n=new MutationObserver(function(){t||!document.documentElement&&!document.head||(r(),t&&n.disconnect())});n.observe(document,{childList:!0,subtree:!0})}return e}catch(e){return null}};try{chrome.runtime.onMessage.addListener(function(e,t,r){var n=e||{},o=n.action,i=n.data;if(o===N){try{var s=(null==i?void 0:i.formattedProofs)||(null==i?void 0:i.proof)||i;window.postMessage({action:b.VERIFICATION_COMPLETED,messageId:null==i?void 0:i.sessionId,data:{proofs:s}},"*")}catch(e){}return ke.info({message:"[CONTENT] Proof submitted",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),null==r||r({success:!0}),!0}if(o===x||o===P){try{window.postMessage({action:b.VERIFICATION_FAILED,messageId:null==i?void 0:i.sessionId,error:(null==i?void 0:i.error)||"Verification failed"},"*")}catch(e){}return ke.info({message:"[CONTENT] Proof submission failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),null==r||r({success:!0}),!0}return!1})}catch(e){}!function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){De(i,n,o,s,a,"next",e)}function a(e){De(i,n,o,s,a,"throw",e)}s(void 0)})}}(xe().m(function e(){return xe().w(function(e){for(;;)switch(e.n){case 0:try{try{chrome.runtime.sendMessage({action:G,source:O,target:I,data:{}},function(e){null!=e&&e.success&&e.isManaged&&(Me=!0,Ge(),je())})}catch(e){}chrome.runtime.sendMessage({action:U,source:O,target:I,data:{url:window.location.href}}),chrome.runtime.onMessage.addListener(function(e,t,r){var n=e.action,o=e.data;return n===B&&((Me=o.shouldInitialize)&&(Ge(),je(),window.reclaimContentScript=new Ve),r({success:!0})),!0})}catch(e){}case 1:return e.a(2)}},e)}))();var Ve=function(){return e=function e(){var t,n=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init(),this.verificationPopup=null,this.providerName=null,this.credentialType=null,this.dataRequired=null,this.interceptedRequestResponses=new Map,this.providerData=null,this.parameters={},this.sessionId=null,this.providerId=null,this.appId=null,this.filteringInterval=null,this.filteringStartTime=null,this.filteredRequests=[],this.isFiltering=!1,this.stopStoringInterceptions=!1,this.isManagedTab=!1,this._mode="undefined"!=typeof chrome&&chrome.runtime&&"chrome-extension:"===(null===(t=location)||void 0===t?void 0:t.protocol)?"extension":"web","extension"===this._mode){this._boundChromeHandler=function(e){var t=e||{},r=t.action,o=t.data,i=t.error,s=null==o?void 0:o.sessionId;if(r&&(!n.sessionId||n.sessionId===s))if("PROOF_SUBMITTED"===r){var a=(null==o?void 0:o.formattedProofs)||(null==o?void 0:o.proof)||o;n._emit("completed",a)}else"PROOF_SUBMISSION_FAILED"!==r&&"PROOF_GENERATION_FAILED"!==r||n._emit("error",i||new Error("Verification failed"))};try{chrome.runtime.onMessage.addListener(this._boundChromeHandler)}catch(e){}try{var o=r(3859).LOG_CONFIG_STORAGE_KEY;chrome.storage.local.get([o],function(e){var t=null==e?void 0:e[o];t&&"object"===Re(t)&&be.Ow.setConfig(t)}),chrome.storage.onChanged.addListener(function(e,t){if("local"===t&&e[o]){var r=e[o].newValue||{};be.Ow.setConfig(r)}})}catch(e){}}else this._boundWindowHandler=this.handleWindowMessage.bind(this),window.addEventListener("message",this._boundWindowHandler)},t=[{key:"init",value:function(){var e=this;Me&&(chrome.runtime.onMessage.addListener(this.handleMessage.bind(this)),chrome.runtime.sendMessage({action:G,source:O,target:I,data:{}},function(t){t.success&&t.isManaged?(e.isManagedTab=!0,chrome.runtime.sendMessage({action:k,source:O,target:I,data:{url:window.location.href}},function(t){var r,n,o,i;t.success&&(e.providerData=t.data.providerData,e.parameters=t.data.parameters,e.sessionId=t.data.sessionId,e.providerId=t.data.providerId||"unknown",e.appId=t.data.appId||"unknown",ke.setContext({sessionId:e.sessionId,providerId:e.providerId,appId:e.appId,type:Oe.LOG_TYPES.CONTENT}),ke.info({message:"[Content] Provider data received from background script and will proceed with network filtering.",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),null!==(r=e.providerData)&&void 0!==r&&r.disableRequestReplay||chrome.runtime.sendMessage({action:W,source:O,target:I,data:{op:"REPLAY_PAGE_FETCH",showAlert:!1}}),localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(e.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:e.parameters||{}}},"*"),e.setProviderIdInLocalStorage(e.providerId),null!==(n=e.providerData)&&void 0!==n&&null!==(n=n.customInjection)&&void 0!==n&&n.length&&null!==(o=e.providerData)&&void 0!==o&&null!==(o=o.extensionConfig)&&void 0!==o&&o.allowInjectionsViaChromeScritpting?chrome.runtime.sendMessage({action:W,source:O,target:I,data:{op:"RUN_CUSTOM_INJECTION",code:e.providerData.customInjection}}):e.setProviderInjectionScriptInLocalStorage(e.providerId,null===(i=e.providerData)||void 0===i?void 0:i.customInjection),e.isFiltering||e.startNetworkFiltering(),e.setupUrlListener())})):e.isManagedTab=!1}))}},{key:"handleMessage",value:function(e,t,r){var n=this,o=e.action,i=e.data;switch(e.source,ke.setContext({sessionId:this.sessionId,providerId:this.providerId,appId:this.appId,type:Oe.LOG_TYPES.CONTENT}),o){case B:break;case M:if(!this.isManagedTab){ke.info({message:"[Content] Tab is not managed by extension",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.TAB_NOT_MANAGED_BY_EXTENSION_EXCEPTION}),r({success:!1,message:"Tab is not managed by extension"});break}this.providerData=i.providerData,this.parameters=i.parameters,this.sessionId=i.sessionId,this.providerId=i.providerId||"unknown",this.appId=i.appId||"unknown",localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(this.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:this.parameters||{}}},"*"),this.setProviderIdInLocalStorage(this.providerId),this.setProviderInjectionScriptInLocalStorage(this.providerId,null==i?void 0:i.customInjection),this.isFiltering||this.startNetworkFiltering(),this.setupUrlListener(),ke.info({message:"[Content] Provider data received from background script and starting network filtering.",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case F:chrome.runtime.sendMessage({action:G,source:O,target:I,data:{}},function(e){if(!e.success||!e.isManaged)return ke.info({message:"[Content] Tab is not managed by extension",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.TAB_NOT_MANAGED_BY_EXTENSION_EXCEPTION}),void r({success:!1,message:"Tab is not managed by extension"});if(n.verificationPopup){try{ke.info({message:"[Content] Removing existing popup",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),document.body.removeChild(n.verificationPopup.element)}catch(e){}n.verificationPopup=null}n.providerName=(null==i?void 0:i.providerName)||n.providerName,n.description=(null==i?void 0:i.description)||n.description,n.dataRequired=(null==i?void 0:i.dataRequired)||n.dataRequired,n.sessionId=(null==i?void 0:i.sessionId)||n.sessionId;var t=function(){if(document.body){try{n.verificationPopup=Z(n.providerName,n.description,n.dataRequired,n.sessionId)}catch(e){return}try{setTimeout(function(){document.body.appendChild(n.verificationPopup.element)},500)}catch(e){return}}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){t()},{once:!0}):t(),r({success:!0,message:"Popup display process initiated and will proceed on DOM readiness."})});break;case L:this.verificationPopup&&this.verificationPopup.handleClaimCreationRequested(i.requestHash),ke.info({message:"[Content] Claim creation requested",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case S:this.verificationPopup&&this.verificationPopup.handleClaimCreationSuccess(i.requestHash),ke.info({message:"[Content] Claim creation success",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case A:this.verificationPopup&&this.verificationPopup.handleClaimCreationFailed(i.requestHash),ke.info({message:"[Content] Claim creation failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case C:this.verificationPopup&&this.verificationPopup.handleProofGenerationStarted(i.requestHash),ke.info({message:"[Content] Proof generation started",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case R:this.verificationPopup&&this.verificationPopup.handleProofGenerationSuccess(i.requestHash),ke.info({message:"[Content] Proof generation success",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case P:try{window.postMessage({action:b.VERIFICATION_FAILED,messageId:null==i?void 0:i.sessionId,error:(null==i?void 0:i.error)||"Verification failed"},"*")}catch(e){}this.verificationPopup&&this.verificationPopup.handleProofGenerationFailed(i.requestHash),ke.info({message:"[Content] Proof generation failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case N:try{var s=(null==i?void 0:i.formattedProofs)||(null==i?void 0:i.proof)||i;window.postMessage({action:b.VERIFICATION_COMPLETED,messageId:null==i?void 0:i.sessionId,data:{proofs:s}},"*")}catch(e){}this.verificationPopup&&this.verificationPopup.handleProofSubmitted(),ke.info({message:"[Content] Proof submitted",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case x:try{window.postMessage({action:b.VERIFICATION_FAILED,messageId:null==i?void 0:i.sessionId,error:(null==i?void 0:i.error)||"Proof submission failed"},"*")}catch(e){}this.verificationPopup&&this.verificationPopup.handleProofSubmissionFailed(i.error),ke.info({message:"[Content] Proof submission failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;default:r({success:!1,error:"Unknown action"})}return!0}},{key:"checkExtensionId",value:function(e){try{var t="undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.id?chrome.runtime.id:null;return e?!!t&&e===t:!!t}catch(e){return!1}}},{key:"handleWindowMessage",value:function(e){var t=this;if(e.source===window){var n=e.data,o=n.action,i=n.data,s=n.messageId,a=n.extensionID;if(o===b.CHECK_EXTENSION){if(!this.checkExtensionId(a))return;window.postMessage({action:b.EXTENSION_RESPONSE,messageId:s,installed:!0},"*")}if(o===b.SET_LOG_CONFIG&&null!=i&&i.config){if(!this.checkExtensionId(a))return;try{be.Ow.setConfig(i.config)}catch(e){}try{var c=r(3859).LOG_CONFIG_STORAGE_KEY;chrome.storage.local.set((l={},u=c,f=i.config,(u=Ne(u))in l?Object.defineProperty(l,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):l[u]=f,l))}catch(e){}}else{var l,u,f;if("RECLAIM_GET_PROVIDER_ID"!==o||"injection-script"!==e.data.source){if(o===V&&i){var p="".concat(i.request.method,"_").concat(i.request.url,"_").concat(i.timestamp||Date.now());this.interceptedRequestResponses.set(p,i),this.isFiltering&&this.startNetworkFiltering()}if(o===b.START_VERIFICATION&&i){if(!this.checkExtensionId(a))return;ke.info({message:"[Content] Starting verification with data from SDK: "+JSON.stringify(i),logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,meta:{data:i}}),chrome.runtime.sendMessage({action:T,source:O,target:I,data:i},function(e){i.parameters&&(t.parameters=i.parameters,localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(t.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:t.parameters||{}}},"*")),i.sessionId&&(t.sessionId=i.sessionId),e&&e.success?window.postMessage({action:b.VERIFICATION_STARTED,messageId:s,sessionId:i.sessionId},"*"):(window.postMessage({action:b.VERIFICATION_FAILED,messageId:s,error:(null==e?void 0:e.error)||"Failed to start verification"},"*"),ke.info({message:"[Content] Verification failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,meta:{error:(null==e?void 0:e.error)||"Failed to start verification"}}))})}if(o===b.CANCEL_VERIFICATION){if(!this.checkExtensionId(a))return;chrome.runtime.sendMessage({action:w,source:O,target:I,data:{sessionId:this.sessionId}},function(){}),ke.info({message:"[Content] Verification cancelled",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}if(o===b.SET_PUBLIC_DATA&&null!==(null==i?void 0:i.publicData))return this.publicData=String(null==i?void 0:i.publicData),chrome.runtime.sendMessage({action:Y,source:O,target:I,data:{publicData:this.publicData}},function(){}),void ke.info({message:"[Content] Public data set",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.SET_EXPECT_MANY_CLAIMS&&"boolean"==typeof(null==i?void 0:i.expectMany))return chrome.runtime.sendMessage({action:q,source:O,target:I,data:{expectMany:!!i.expectMany}},function(){}),void ke.info({message:"[Content] Expect many claims set",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.PARAMETERS_GET)return chrome.runtime.sendMessage({action:$,source:O,target:I,data:{}},function(e){var r=null!=e&&e.success?e.parameters||{}:t.parameters||{};t.parameters=r,localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(t.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:r}},"*")}),void ke.info({message:"[Content] Parameters get",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.SET_PARAMETERS&&(this.parameters=(null==i?void 0:i.parameters)||{},localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(this.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:this.parameters||{}}},"*")),o===b.REPORT_PROVIDER_ERROR&&null!=i&&i.message)return chrome.runtime.sendMessage({action:X,source:O,target:I,data:{message:String(i.message)}},function(){}),void ke.info({message:"[Content] Provider error reported",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.REQUEST_CLAIM&&null!=i&&i.rdObject){var h;if(!this.sessionId)return;var d=i.rdObject||{},y="rc-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)),E={url:String((null==d?void 0:d.url)||""),method:String((null==d?void 0:d.method)||"GET"),headers:(null==d?void 0:d.headers)||{},body:null!=(null==d?void 0:d.requestBody)?String(null==d?void 0:d.requestBody):"",extractedParams:(null==d?void 0:d.extractedParams)||{}},g={url:String((null==d?void 0:d.url)||""),expectedPageUrl:"",urlType:"TEMPLATE",method:String((null==d?void 0:d.method)||"GET"),responseMatches:Array.isArray(null==d?void 0:d.responseMatches)?null==d?void 0:d.responseMatches:[],responseRedactions:Array.isArray(null==d?void 0:d.responseRedactions)?null==d?void 0:d.responseRedactions:[],bodySniff:{enabled:!1,template:""},additionalClientOptions:{},requestHash:y};return chrome.runtime.sendMessage({action:H,source:O,target:I,data:{request:E,criteria:g,sessionId:this.sessionId,loginUrl:(null===(h=this.providerData)||void 0===h?void 0:h.loginUrl)||""}},function(){}),void ke.info({message:"[Content] Claim requested",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}}else window.postMessage({action:"RECLAIM_PROVIDER_ID_RESPONSE",providerId:this.providerId||null,source:"content-script"},"*")}}}},{key:"cleanupInterceptedData",value:function(){var e,t=Date.now(),r=Se(this.interceptedRequestResponses.entries());try{for(r.s();!(e=r.n()).done;){var n=Le(e.value,2),o=n[0];t-n[1].timestamp>12e4&&this.interceptedRequestResponses.delete(o)}}catch(e){r.e(e)}finally{r.f()}}},{key:"startNetworkFiltering",value:function(){var e,t=this;this.providerData&&"NONE"!==(null===(e=this.providerData)||void 0===e?void 0:e.injectionType)&&(this.isFiltering=!0,this.filteringStartTime=Date.now(),this.stopStoringInterceptions=!1,this.filterInterceptedRequests(),this.filteringInterval&&clearInterval(this.filteringInterval),this.filteringInterval=setInterval(function(){t.stopStoringInterceptions?t.stopNetworkFiltering():(t.filterInterceptedRequests(),Date.now()-t.filteringStartTime>6e5&&t.stopNetworkFiltering())},1e3))}},{key:"stopNetworkFiltering",value:function(){var e;this.filteringInterval&&(clearInterval(this.filteringInterval),this.filteringInterval=null),this.isFiltering=!1,this.filteredRequests.length>=((null===(e=this.providerData)||void 0===e||null===(e=e.requestData)||void 0===e?void 0:e.length)||0)&&(this.stopStoringInterceptions=!0,this.interceptedRequestResponses.clear())}},{key:"filterInterceptedRequests",value:function(){if(this.providerData&&this.providerData.requestData){var e,t=Se(this.interceptedRequestResponses.entries());try{for(t.s();!(e=t.n()).done;){var r=Le(e.value,2),n=r[0],o=r[1];if(!this.filteredRequests.includes(n)){var i,s=o.request,a=o.response.body,c={url:s.url,method:s.method,body:s.body||null,headers:s.headers||{},responseText:a},l=Se(this.providerData.requestData);try{for(l.s();!(i=l.n()).done;){var u=i.value;ve(c,u,this.parameters,ke)&&(ke.info({message:"[Content] Matching request found: "+c.method+" "+c.url,logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),this.filteredRequests.push(n),this.sendFilteredRequestToBackground(c,u,this.providerData.loginUrl))}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){t.e(e)}finally{t.f()}this.filteredRequests.length>=this.providerData.requestData.length&&(this.stopStoringInterceptions=!0,this.isFiltering=!1,this.filteringInterval&&(clearInterval(this.filteringInterval),this.filteringInterval=null),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.interceptedRequestResponses.clear())}}},{key:"sendFilteredRequestToBackground",value:function(e,t,r){ke.info({message:"[Content] Sending filtered request to background script: "+JSON.stringify(e.url),logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),chrome.runtime.sendMessage({action:j,source:O,target:I,data:{request:e,criteria:t,loginUrl:r,sessionId:this.sessionId}},function(e){})}},{key:"setProviderIdInLocalStorage",value:function(e){var t="reclaimBrowserExtensionProviderId";if(!e||"unknown"===e)return localStorage.removeItem(t),void ke.info({message:"[Content] Skipping localStorage storage for invalid provider ID: "+e,logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});try{localStorage.setItem(t,e),ke.info({message:"[Content] Provider ID "+e+" stored in localStorage.",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}catch(r){localStorage.removeItem(t),ke.error({message:"[Content] Failed to store provider ID "+e+" in localStorage: "+r.message,logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT})}}},{key:"setProviderInjectionScriptInLocalStorage",value:function(e,t){var r="reclaimBrowserExtensionInjectionScript:".concat(e);if(!e||"unknown"===e)return localStorage.removeItem(r),void ke.error({message:"[Content] Failed to store provider ID "+e+" in localStorage: ",logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.INJECTION_SCRIPT_SET_IN_LOCAL_STORAGE_FAILED});if(null==t||!t.length)return localStorage.removeItem(r),void ke.error({message:"[Content] Skipping localStorage storage for injection script",logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.INJECTION_SCRIPT_SET_IN_LOCAL_STORAGE_FAILED});try{localStorage.setItem(r,t),ke.info({message:"[Content] Injection script stored in localStorage...",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}catch(e){localStorage.removeItem(r),ke.error({message:"[Content] Failed to store injection script in localStorage: "+e.message,logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.INJECTION_SCRIPT_SET_IN_LOCAL_STORAGE_FAILED})}}},{key:"setupUrlListener",value:function(){var e=this,t=window.location.href;new MutationObserver(function(){var r,n=window.location.href;n!==t&&(t=n,null!==(r=e.providerData)&&void 0!==r&&r.disableRequestReplay||chrome.runtime.sendMessage({action:W,source:O,target:I,data:{op:"REPLAY_PAGE_FETCH",showAlert:!1}}))}).observe(document.documentElement,{childList:!0,subtree:!0})}}],t&&Pe(e.prototype,t),n&&Pe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();const Ye=new Ve})(),n})());
10
+ const n=r(7526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?a(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),a(e<0?0:0|d(e))}function p(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function E(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){let i,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<a;i++)if(l(e,i)===l(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===c)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){let r=!0;for(let n=0;n<c;n++)if(l(e,i+n)!==l(t,n)){r=!1;break}if(r)return i}return-1}function b(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function O(e,t,r,n){return W(X(t,e.length-r),e,r,n)}function I(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return W(H(t),e,r,n)}function T(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function w(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function L(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?L(this,0,e):E.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(i,s),l=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){i=l[e],s=u[e];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":case"latin1":case"binary":return I(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function C(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Q[e[n]];return o}function P(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n,o){V(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,o){V(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function k(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||k(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||k(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=z(function(e){Y(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=z(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=z(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=z(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=z(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),s=i.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%s]}return this};const B={};function G(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||q(t,e.length-(r+1))}(n,o,i)}function Y(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,r){if(Math.floor(e)!==e)throw Y(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=j(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=j(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function z(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>Ye});var e=r(8287),t=r(5606),o=r.n(t),i=r(3153);function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof l?n:l,u=Object.create(s.prototype);return a(u,"_invoke",function(r,n,o){var i,s,a,l=0,u=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,s=0,a=e,p.n=r,c}};function h(r,n){for(s=r,a=n,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],h=p.p,d=i[2];r>3?(o=d===n)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=r<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,s=0))}if(o||r>1)return c;throw f=!0,n}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),s=u,a=d;(t=s<2?e:a)||!f;){i||(s?s<3?(s>1&&(p.n=-1),h(s,a)):p.n=a:p.v=a);try{if(l=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?a:r.call(n,p))!==c)break}catch(t){i=e,s=1,a=t}finally{l=1}}return{value:t,done:f}}}(r,o,i),!0),u}var c={};function l(){}function u(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),h=f.prototype=l.prototype=Object.create(p);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=f,a(h,"constructor",f),a(f,"constructor",u),u.displayName="GeneratorFunction",a(f,o,"GeneratorFunction"),a(h),a(h,o,"Generator"),a(h,n,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(s=function(){return{w:i,m:d}})()}function a(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,r,n){function i(t,r){a(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},a(e,t,r,n)}function c(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){c(i,n,o,s,a,"next",e)}function a(e){c(i,n,o,s,a,"throw",e)}s(void 0)})}}var u,f,p,h="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==h?h:Function("return this")(),d="undefined"==typeof window,y="undefined"!=typeof document&&void 0!==document.contentType;if(h.Buffer=h.Buffer||e.hp,h.process=h.process||o(),void 0!==h.WebSocket||y)y?i.w9.info(i.Ey.POLYFILLS,"Skipping WebSocket in content script context"):i.w9.info(i.Ey.POLYFILLS,"Using native WebSocket implementation");else try{var E=r(3296).WebSocket;h.WebSocket=E,i.w9.info(i.Ey.POLYFILLS,"WebSocket polyfill added to global")}catch(e){i.w9.warn(i.Ey.POLYFILLS,"Failed to load WebSocket polyfill:",e)}if(h.process&&(h.process.browser=!0),"function"!=typeof h.require)h.require=function(e){switch(e){case"ws":if(y)return i.w9.info(i.Ey.POLYFILLS,"Blocking ws module in content script"),{};try{return{WebSocket:r(3296).WebSocket}}catch(e){return i.w9.warn(i.Ey.POLYFILLS,"Failed to load WebSocket for ws module:",e),{}}case"fs":return h.fs;case"path":return h.path;case"os":return h.os;case"crypto":return h.crypto;case"worker_threads":case"koffi":case"re2":return{};default:return console.warn("Mock require called for module: ".concat(e)),{}}};else{var g=h.require;h.require=function(e){if("ws"===e){if(y)return i.w9.info(i.Ey.POLYFILLS,"Blocking ws module in content script"),{};try{return{WebSocket:r(3296).WebSocket}}catch(e){return i.w9.warn(i.Ey.POLYFILLS,"Failed to load WebSocket for ws module:",e),{}}}try{return g(e)}catch(t){return i.w9.warn(i.Ey.POLYFILLS,"Failed to require module: ".concat(e)),{}}}}if(void 0!==o()&&(o().browser=!0,o().version||(o().version="v16.0.0"),o().cwd||(o().cwd=function(){return"/"})),void 0===h.global&&(h.global=h),void 0===h.crypto&&(h.crypto={}),void 0===h.crypto.getRandomValues&&(h.crypto.getRandomValues=function(e){for(var t=new Uint8Array(e.length),r=0;r<t.length;r++)t[r]=Math.floor(256*Math.random());return t}),void 0===h.crypto.subtle&&(i.w9.warn(i.Ey.POLYFILLS,"WebCrypto subtle API not available. Some functionality may not work."),h.crypto.subtle={digest:(u=l(s().m(function e(t,r){var n,o,a;return s().w(function(e){for(;;)if(0===e.n){for(i.w9.warn(i.Ey.POLYFILLS,"Crypto subtle digest (".concat(t,") called with browser fallback")),n=Array.from(new Uint8Array(r)).reduce(function(e,t){return 31*e+t&4294967295},0),o=new Uint8Array(32),a=0;a<32;a++)o[a]=n>>8*a&255;return e.a(2,o.buffer)}},e)})),function(e,t){return u.apply(this,arguments)})}),!d){var m=function(e,t){return"string"==typeof e&&e.startsWith("node:")&&(e=e.replace(/^node:/,"")),new v(e,t)};void 0===h.domain&&(h.domain={create:function(){return{run:function(e){return e()},on:function(){},bind:function(e){return e}}}});var v=h.URL;m.prototype=v.prototype;try{Object.getOwnPropertyNames(v).forEach(function(e){if("prototype"!==e&&"constructor"!==e)try{m[e]=v[e]}catch(e){}})}catch(e){i.w9.warn(i.Ey.POLYFILLS,"Could not copy all URL static properties:",e)}try{h.URL=m}catch(e){i.w9.warn(i.Ey.POLYFILLS,"Could not override URL constructor:",e)}}void 0===h.module&&(h.module={exports:{}}),h.fs=h.fs||{readFileSync:function(e){throw i.w9.warn(i.Ey.POLYFILLS,"Attempted to readFileSync: ".concat(e)),new Error("fs.readFileSync is not available in this environment")},writeFileSync:function(e,t){i.w9.warn(i.Ey.POLYFILLS,"Attempted to writeFileSync: ".concat(e))},existsSync:function(e){return i.w9.warn(i.Ey.POLYFILLS,"Attempted to check if file exists: ".concat(e)),!1},promises:{readFile:(p=l(s().m(function e(t){return s().w(function(e){for(;;)switch(e.n){case 0:throw i.w9.warn(i.Ey.POLYFILLS,"Attempted to readFile: ".concat(t)),new Error("fs.promises.readFile is not available in this environment");case 1:return e.a(2)}},e)})),function(e){return p.apply(this,arguments)}),writeFile:(f=l(s().m(function e(t,r){return s().w(function(e){for(;;)switch(e.n){case 0:i.w9.warn(i.Ey.POLYFILLS,"Attempted to writeFile: ".concat(t));case 1:return e.a(2)}},e)})),function(e,t){return f.apply(this,arguments)})}},h.os=h.os||{tmpdir:function(){return"/tmp"},homedir:function(){return"/home/user"},platform:function(){return"browser"},type:function(){return"Browser"},cpus:function(){return[{model:"Browser CPU",speed:1e3}]},totalmem:function(){return 8589934592},freemem:function(){return 4294967296}},h.path=h.path||{join:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.join("/").replace(/\/+/g,"/")},resolve:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.join("/").replace(/\/+/g,"/")},dirname:function(e){return e.split("/").slice(0,-1).join("/")||"."},basename:function(e,t){var r=e.split("/").pop()||"";return t&&r.endsWith(t)&&(r=r.slice(0,-t.length)),r},extname:function(e){var t=e.split("/").pop()||"",r=t.lastIndexOf(".");return r<0?"":t.slice(r)},sep:"/"};e.hp,o();var b={CHECK_EXTENSION:"JOCLAIM_EXTENSION_CHECK",EXTENSION_RESPONSE:"JOCLAIM_EXTENSION_RESPONSE",START_VERIFICATION:"JOCLAIM_START_VERIFICATION",VERIFICATION_STARTED:"JOCLAIM_VERIFICATION_STARTED",VERIFICATION_COMPLETED:"JOCLAIM_VERIFICATION_COMPLETED",VERIFICATION_FAILED:"JOCLAIM_VERIFICATION_FAILED",CANCEL_VERIFICATION:"JOCLAIM_CANCEL_VERIFICATION",SET_PUBLIC_DATA:"JOCLAIM_SET_PUBLIC_DATA",PARAMETERS_UPDATE:"JOCLAIM_PARAMETERS_UPDATE",PARAMETERS_GET:"JOCLAIM_PARAMETERS_GET",REPORT_PROVIDER_ERROR:"JOCLAIM_REPORT_PROVIDER_ERROR",SET_EXPECT_MANY_CLAIMS:"JOCLAIM_SET_EXPECT_MANY_CLAIMS",REQUEST_CLAIM:"JOCLAIM_REQUEST_CLAIM",SET_LOG_CONFIG:"JOCLAIM_SET_LOG_CONFIG"},O="content-script",I="background",_="offscreen",T="START_VERIFICATION",w="CANCEL_VERIFICATION",L="CLAIM_CREATION_REQUESTED",S="CLAIM_CREATION_SUCCESS",A="CLAIM_CREATION_FAILED",C="PROOF_GENERATION_STARTED",R="PROOF_GENERATION_SUCCESS",P="PROOF_GENERATION_FAILED",N="PROOF_SUBMITTED",x="PROOF_SUBMISSION_FAILED",F="SHOW_PROVIDER_VERIFICATION_POPUP",D="OFFSCREEN_DOCUMENT_READY",k="REQUEST_PROVIDER_DATA",M="PROVIDER_DATA_READY",U="CONTENT_SCRIPT_LOADED",B="SHOULD_INITIALIZE",G="CHECK_IF_MANAGED_TAB",j="FILTERED_REQUEST_FOUND",V="INTERCEPTED_REQUEST_AND_RESPONSE",Y="UPDATE_PUBLIC_DATA",q="UPDATE_EXPECT_MANY_CLAIMS",$="GET_PARAMETERS",X="REPORT_PROVIDER_ERROR",H="REQUEST_CLAIM",W="INJECT_VIA_SCRIPTING";function K(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof a?n:a,l=Object.create(c.prototype);return J(l,"_invoke",function(r,n,o){var i,a,c,l=0,u=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function h(r,n){for(a=r,c=n,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],h=p.p,d=i[2];r>3?(o=d===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=r<2&&h<i[1])?(a=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),a=u,c=d;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),h(a,c)):p.n=c:p.v=c);try{if(l=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{l=1}}return{value:t,done:f}}}(r,o,i),!0),l}var s={};function a(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(J(t={},n,function(){return this}),t),f=l.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,J(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=l,J(f,"constructor",l),J(l,"constructor",c),c.displayName="GeneratorFunction",J(l,o,"GeneratorFunction"),J(f),J(f,o,"Generator"),J(f,n,function(){return this}),J(f,"toString",function(){return"[object Generator]"}),(K=function(){return{w:i,m:p}})()}function J(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}J=function(e,t,r,n){function i(t,r){J(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},J(e,t,r,n)}function Q(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function z(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){Q(i,n,o,s,a,"next",e)}function a(e){Q(i,n,o,s,a,"throw",e)}s(void 0)})}}function Z(e,t,r,n){!function(){c.apply(this,arguments)}();var o=document.createElement("div");o.id="reclaim-protocol-popup",o.className="reclaim-popup",o.style.animation="reclaim-appear 0.3s ease-out";var i={totalClaims:0,completedClaims:0,proofSubmitted:!1,inProgress:!1,error:null},s=!1,a={x:0,y:0};function c(){return(c=z(K().m(function e(){var t,r,n,o,i,s;return K().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!document.getElementById("reclaim-popup-styles")){e.n=1;break}return e.a(2);case 1:return e.p=1,t=chrome.runtime.getURL("joclaim-browser-extension-sdk/content/components/reclaim-provider-verification-popup.css"),e.n=2,fetch(t);case 2:return r=e.v,e.n=3,r.text();case 3:n=e.v,(o=document.createElement("style")).id="reclaim-popup-styles",o.textContent=n,(i=function(){document.head?document.head.appendChild(o):document.body?document.body.appendChild(o):setTimeout(i,10)})(),e.n=5;break;case 4:e.p=4,s=e.v,console.error("Failed to load Reclaim popup CSS:",s);case 5:return e.a(2)}},e,null,[[1,4]])}))).apply(this,arguments)}function l(){return u.apply(this,arguments)}function u(){return(u=z(K().m(function e(){var t,r,n,o;return K().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=chrome.runtime.getURL("joclaim-browser-extension-sdk/content/components/reclaim-provider-verification-popup.html"),e.n=1,fetch(t);case 1:return r=e.v,e.n=2,r.text();case 2:return n=e.v,e.a(2,n);case 3:return e.p=3,o=e.v,console.error("Failed to load Reclaim popup HTML template:",o),e.a(2,"")}},e,null,[[0,3]])}))).apply(this,arguments)}function f(){return(f=z(K().m(function i(){var s,a;return K().w(function(i){for(;;)switch(i.n){case 0:return i.n=1,l();case 1:if(s=i.v){i.n=2;break}return console.error("Failed to load HTML template - popup will not render correctly"),i.a(2);case 2:a=s.replace(/\{\{providerName\}\}/g,e).replace(/\{\{description\}\}/g,t).replace(/\{\{dataRequired\}\}/g,r).replace(/\{\{sessionId\}\}/g,n),o.innerHTML=a;case 3:return i.a(2)}},i)}))).apply(this,arguments)}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Generating verification proof...",t=o.querySelector("#reclaim-steps-container"),r=o.querySelector("#reclaim-status-container"),n=o.querySelector("#reclaim-circular-loader"),s=o.querySelector("#reclaim-status-progress"),a=o.querySelector("#reclaim-status-text"),c=o.querySelector("#reclaim-success-icon"),l=o.querySelector("#reclaim-error-icon"),u=o.querySelector(".reclaim-popup-content");t&&t.classList.add("hidden"),c&&(c.style.display="none"),l&&(l.style.display="none"),r.classList.add("visible"),u.classList.add("status-active"),n.style.display="flex",s.style.display="block",a.textContent=e,i.inProgress=!0,h()}function h(){var e=o.querySelector("#reclaim-progress-bar"),t=o.querySelector("#reclaim-progress-counter");if(i.totalClaims>0){var r=i.completedClaims/i.totalClaims;e.style.transform="scaleX(".concat(r,")"),t.textContent="".concat(i.completedClaims,"/").concat(i.totalClaims)}else e.style.transform="scaleX(1)",e.style.animation="reclaim-progress-pulse 2s infinite",t.textContent=""}function d(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=o.querySelector("#reclaim-status-message");r.textContent=e,r.style.color=t?"#ef4444":"rgba(255, 255, 255, 0.8)"}function y(){var e=o.querySelector("#reclaim-steps-container"),t=o.querySelector("#reclaim-status-container"),r=o.querySelector("#reclaim-circular-loader"),n=o.querySelector("#reclaim-status-progress"),s=o.querySelector("#reclaim-status-text"),a=o.querySelector("#reclaim-progress-bar"),c=o.querySelector("#reclaim-progress-counter"),l=o.querySelector(".reclaim-popup-content");e&&e.classList.add("hidden"),r.style.display="none",t.classList.add("visible"),l.classList.add("status-active"),n.style.display="block",s.textContent="Verification complete!",requestAnimationFrame(function(){a.style.width="100%",a.style.transform="scaleX(1)",a.classList.add("success"),a.style.animation="none"}),i.totalClaims>0?c.textContent="".concat(i.totalClaims,"/").concat(i.totalClaims):c.textContent="100%",d("You will be redirected to the original page shortly.");var u=o.querySelector("#reclaim-success-icon"),f=o.querySelector("#reclaim-error-icon");u&&(u.style.display="flex"),f&&(f.style.display="none")}function E(e){var t=o.querySelector("#reclaim-steps-container"),r=o.querySelector("#reclaim-status-container"),n=o.querySelector("#reclaim-circular-loader"),i=o.querySelector("#reclaim-status-progress"),s=o.querySelector("#reclaim-status-text"),a=o.querySelector("#reclaim-progress-bar"),c=o.querySelector(".reclaim-popup-content");t&&t.classList.add("hidden"),n.style.display="none",r.classList.add("visible"),c.classList.add("status-active"),i.style.display="block",s.textContent="Verification failed",a.style.transform="scaleX(1)",a.classList.add("error"),a.style.animation="none",d(e,!0);var l=o.querySelector("#reclaim-error-icon"),u=o.querySelector("#reclaim-success-icon");l&&(l.style.display="flex"),u&&(u.style.display="none")}function g(){i.totalClaims+=1,h()}function m(){i.completedClaims+=1,h()}return function(){return f.apply(this,arguments)}().then(function(){!function(){var e=o.querySelector(".reclaim-popup-header");function t(e){if(0===e.button){s=!0,o.classList.add("dragging");var t=o.getBoundingClientRect();a.x=e.clientX-t.left,a.y=e.clientY-t.top,e.preventDefault(),document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}}function r(e){if(s){e.preventDefault();var t=e.clientX-a.x,r=e.clientY-a.y,n=window.innerWidth,i=window.innerHeight,c=o.offsetWidth,l=o.offsetHeight;t=Math.max(0,Math.min(t,n-c)),r=Math.max(0,Math.min(r,i-l)),o.style.left=t+"px",o.style.top=r+"px",o.style.right="auto",o.style.bottom="auto"}}function n(e){s&&(s=!1,o.classList.remove("dragging"),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n))}e.addEventListener("mousedown",t),e.addEventListener("contextmenu",function(e){e.preventDefault()})}(),function(){var e=o.querySelector(".reclaim-copy-icon"),t=o.querySelector("#reclaim-copy-feedback");e&&e.addEventListener("click",function(){var t=z(K().m(function t(n){var i,s,a,c;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:if(n.preventDefault(),n.stopPropagation(),i=e.getAttribute("data-copy-target"),!(s=o.querySelector("#".concat(i)))){t.n=6;break}if(t.p=1,a=s.textContent.trim(),!navigator.clipboard||!navigator.clipboard.writeText){t.n=3;break}return t.n=2,navigator.clipboard.writeText(a);case 2:r("Copied!"),t.n=4;break;case 3:(c=document.createElement("textarea")).value=a,c.style.position="fixed",c.style.left="-9999px",c.style.top="-9999px",document.body.appendChild(c),c.focus(),c.select();try{document.execCommand("copy")?r("Copied!"):r("Failed to copy",!0)}catch(e){r("Failed to copy",!0)}document.body.removeChild(c);case 4:t.n=6;break;case 5:t.p=5,t.v,r("Failed to copy",!0);case 6:return t.a(2)}},t,null,[[1,5]])}));return function(e){return t.apply(this,arguments)}}());function r(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(t.textContent=e,t.style.color="#ffffff",t.style.background=r?"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)":"linear-gradient(135deg, #10b981 0%, #059669 100%)",t.classList.add("show"),setTimeout(function(){t.classList.remove("show")},2e3))}}(),o.querySelectorAll(".reclaim-info-value[data-tooltip]").forEach(function(e){var t=e.getAttribute("data-tooltip");if(e.textContent.trim(),t&&t.length>25){var r=function(){o||((o=document.createElement("div")).className="reclaim-info-tooltip",o.textContent=t,e.appendChild(o)),o.classList.add("show")},n=function(){o&&o.classList.remove("show")},o=null,i=null;e.addEventListener("mouseenter",function(){clearTimeout(i),i=setTimeout(r,500)}),e.addEventListener("mouseleave",function(){clearTimeout(i),n()}),e.addEventListener("click",function(e){e.stopPropagation(),o&&o.classList.contains("show")?n():r()})}}),document.addEventListener("click",function(){o.querySelectorAll(".reclaim-info-tooltip.show").forEach(function(e){e.classList.remove("show")})})}),{element:o,showLoader:p,updateStatusMessage:d,showSuccess:y,showError:E,incrementTotalClaims:g,incrementCompletedClaims:m,handleClaimCreationRequested:function(e){g(),p("Creating verification claim...")},handleClaimCreationSuccess:function(e){d("Claim created successfully. Generating proof...")},handleClaimCreationFailed:function(e){E("Failed to create claim. Please try again.")},handleProofGenerationStarted:function(e){d("Generating cryptographic proof...")},handleProofGenerationSuccess:function(e){m(),d("Proof generated (".concat(i.completedClaims,"/").concat(i.totalClaims,")"))},handleProofGenerationFailed:function(e){E("Failed to generate proof. Please try again.")},handleProofSubmitted:function(){i.proofSubmitted=!0,y()},handleProofSubmissionFailed:function(e){E("Failed to submit proof: ".concat(e))}}}class ee{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+ee.version}static addUnaryOp(e){return ee.max_unop_len=Math.max(e.length,ee.max_unop_len),ee.unary_ops[e]=1,ee}static addBinaryOp(e,t,r){return ee.max_binop_len=Math.max(e.length,ee.max_binop_len),ee.binary_ops[e]=t,r?ee.right_associative.add(e):ee.right_associative.delete(e),ee}static addIdentifierChar(e){return ee.additional_identifier_chars.add(e),ee}static addLiteral(e,t){return ee.literals[e]=t,ee}static removeUnaryOp(e){return delete ee.unary_ops[e],e.length===ee.max_unop_len&&(ee.max_unop_len=ee.getMaxKeyLen(ee.unary_ops)),ee}static removeAllUnaryOps(){return ee.unary_ops={},ee.max_unop_len=0,ee}static removeIdentifierChar(e){return ee.additional_identifier_chars.delete(e),ee}static removeBinaryOp(e){return delete ee.binary_ops[e],e.length===ee.max_binop_len&&(ee.max_binop_len=ee.getMaxKeyLen(ee.binary_ops)),ee.right_associative.delete(e),ee}static removeAllBinaryOps(){return ee.binary_ops={},ee.max_binop_len=0,ee}static removeLiteral(e){return delete ee.literals[e],ee}static removeAllLiterals(){return ee.literals={},ee}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new ee(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return ee.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!ee.binary_ops[String.fromCharCode(e)]||ee.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return ee.isIdentifierStart(e)||ee.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(ee.hooks[e]){const r={context:this,node:t};return ee.hooks.run(e,r),r.node}return t}searchHook(e){if(ee.hooks[e]){const t={context:this};return ee.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===ee.SPACE_CODE||e===ee.TAB_CODE||e===ee.LF_CODE||e===ee.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:ee.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,r,n=[];for(;this.index<this.expr.length;)if(t=this.code,t===ee.SEMCOL_CODE||t===ee.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,ee.max_binop_len),t=e.length;for(;t>0;){if(ee.binary_ops.hasOwnProperty(e)&&(!ee.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!ee.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,o,i,s,a,c;if(i=this.gobbleToken(),!i)return i;if(t=this.gobbleBinaryOp(),!t)return i;for(o={value:t,prec:ee.binaryPrecedence(t),right_a:ee.right_associative.has(t)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+t),n=[i,o,s];t=this.gobbleBinaryOp();){if(r=ee.binaryPrecedence(t),0===r){this.index-=t.length;break}o={value:t,prec:r,right_a:ee.right_associative.has(t)},c=t;const a=e=>o.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&a(n[n.length-2]);)s=n.pop(),t=n.pop().value,i=n.pop(),e={type:ee.BINARY_EXP,operator:t,left:i,right:s},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),n.push(o,e)}for(a=n.length-1,e=n[a];a>1;)e={type:ee.BINARY_EXP,operator:n[a-1].value,left:n[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,ee.isDecimalDigit(e)||e===ee.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===ee.SQUOTE_CODE||e===ee.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===ee.OBRACK_CODE)n=this.gobbleArray();else{for(t=this.expr.substr(this.index,ee.max_unop_len),r=t.length;r>0;){if(ee.unary_ops.hasOwnProperty(t)&&(!ee.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!ee.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;const e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:ee.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}ee.isIdentifierStart(e)?(n=this.gobbleIdentifier(),ee.literals.hasOwnProperty(n.name)?n={type:ee.LITERAL,value:ee.literals[n.name],raw:n.name}:n.name===ee.this_str&&(n={type:ee.THIS_EXP})):e===ee.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===ee.PERIOD_CODE||t===ee.OBRACK_CODE||t===ee.OPAREN_CODE||t===ee.QUMARK_CODE;){let r;if(t===ee.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==ee.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===ee.OBRACK_CODE?((e={type:ee.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==ee.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===ee.OPAREN_CODE?e={type:ee.CALL_EXP,arguments:this.gobbleArguments(ee.CPAREN_CODE),callee:e}:(t===ee.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:ee.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,r="";for(;ee.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(this.code===ee.PERIOD_CODE)for(r+=this.expr.charAt(this.index++);ee.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(r+=this.expr.charAt(this.index++),e=this.char,"+"!==e&&"-"!==e||(r+=this.expr.charAt(this.index++));ee.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);ee.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")")}return t=this.code,ee.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+r+this.char+")"):(t===ee.PERIOD_CODE||1===r.length&&r.charCodeAt(0)===ee.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:ee.LITERAL,value:parseFloat(r),raw:r}}gobbleStringLiteral(){let e="";const t=this.index,r=this.expr.charAt(this.index++);let n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:ee.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(ee.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,ee.isIdentifierPart(e));)this.index++;return{type:ee.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===e){r=!0,this.index++,e===ee.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(o===ee.COMMA_CODE){if(this.index++,n++,n!==t.length)if(e===ee.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===ee.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{const e=this.gobbleExpression();e&&e.type!==ee.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(ee.CPAREN_CODE);if(this.code===ee.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:ee.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:ee.ARRAY_EXP,elements:this.gobbleArguments(ee.CBRACK_CODE)}}}const te=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}};Object.assign(ee,{hooks:te,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(ee),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),ee.max_unop_len=ee.getMaxKeyLen(ee.unary_ops),ee.max_binop_len=ee.getMaxKeyLen(ee.binary_ops);const re=e=>new ee(e).parse(),ne=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(ee).filter(e=>!ne.includes(e)&&void 0===re[e]).forEach(e=>{re[e]=ee[e]}),re.Jsep=ee;var oe={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const o=this.gobbleExpression();if(o||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:o},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};re.plugins.register(oe);var ie={name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){const r=++this.index;let n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){const n=this.expr.slice(r,this.index);let o,i="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;i+=this.char}try{o=new RegExp(n,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}};const se={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){se.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach(e=>{e&&"object"==typeof e&&r(e)})}se.assignmentOperators.forEach(t=>e.addBinaryOp(t,se.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(e){const r=this.code;se.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add("after-token",function(e){if(e.node){const r=this.code;se.updateOperators.some(e=>e===r&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}}),e.hooks.add("after-expression",function(e){e.node&&r(e.node)})}};re.plugins.register(ie,se),re.addUnaryOp("typeof"),re.addLiteral("null",null),re.addLiteral("undefined",void 0);const ae=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),ce={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return ce.evalBinaryExpression(e,t);case"Compound":return ce.evalCompound(e,t);case"ConditionalExpression":return ce.evalConditionalExpression(e,t);case"Identifier":return ce.evalIdentifier(e,t);case"Literal":return ce.evalLiteral(e,t);case"MemberExpression":return ce.evalMemberExpression(e,t);case"UnaryExpression":return ce.evalUnaryExpression(e,t);case"ArrayExpression":return ce.evalArrayExpression(e,t);case"CallExpression":return ce.evalCallExpression(e,t);case"AssignmentExpression":return ce.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](ce.evalAst(e.left,t),()=>ce.evalAst(e.right,t))),evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){"Identifier"===e.body[n].type&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&"AssignmentExpression"===e.body[n+1].type&&(n+=1);const o=e.body[n];r=ce.evalAst(o,t)}return r},evalConditionalExpression:(e,t)=>ce.evalAst(e.test,t)?ce.evalAst(e.consequent,t):ce.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?ce.evalAst(e.property):e.property.name),n=ce.evalAst(e.object,t);if(null==n)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&ae.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const o=n[r];return"function"==typeof o?o.bind(n):o},evalUnaryExpression:(e,t)=>({"-":e=>-ce.evalAst(e,t),"!":e=>!ce.evalAst(e,t),"~":e=>~ce.evalAst(e,t),"+":e=>+ce.evalAst(e,t),typeof:e=>typeof ce.evalAst(e,t)}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map(e=>ce.evalAst(e,t)),evalCallExpression(e,t){const r=e.arguments.map(e=>ce.evalAst(e,t));return ce.evalAst(e.callee,t)(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,n=ce.evalAst(e.right,t);return t[r]=n,t[r]}};function le(e,t){return(e=e.slice()).push(t),e}function ue(e,t){return(t=t.slice()).unshift(e),t}class fe extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function pe(e,t,r,n,o){if(!(this instanceof pe))try{return new pe(e,t,r,n,o)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(o=n,n=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const n={path:i?e.path:t};i?"json"in e&&(n.json=e.json):n.json=r;const o=this.evaluate(n);if(!o||"object"!=typeof o)throw new fe(o);return o}}pe.prototype.evaluate=function(e,t,r,n){let o=this.parent,i=this.parentProperty,{flatten:s,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),s=Object.hasOwn(e,"flatten")?e.flatten:s,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(e,"parent")?e.parent:o,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(o=o||null,i=i||null,Array.isArray(e)&&(e=pe.toPathString(e)),!e&&""!==e||!t)return;const c=pe.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;const l=this._trace(c,t,["$"],o,i,r).filter(function(e){return e&&!e.isParentSelector});return l.length?a||1!==l.length||l[0].hasArrExpr?l.reduce((e,t)=>{const r=this._getPreferredOutput(t);return s&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[]):this._getPreferredOutput(l[0]):a?[]:void 0},pe.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:pe.toPathArray(e.path);return e.pointer=pe.toPointer(t),e.path="string"==typeof e.path?e.path:pe.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return pe.toPathString(e[t]);case"pointer":return pe.toPointer(e.path);default:throw new TypeError("Unknown result type")}},pe.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:pe.toPathString(e.path),t(n,r,e)}},pe.prototype._trace=function(e,t,r,n,o,i,s,a){let c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:o,hasArrExpr:s},this._handleCallback(c,i,"value"),c;const l=e[0],u=e.slice(1),f=[];function p(e){Array.isArray(e)?e.forEach(e=>{f.push(e)}):f.push(e)}if(("string"!=typeof l||a)&&t&&Object.hasOwn(t,l))p(this._trace(u,t[l],le(r,l),t,l,i,s));else if("*"===l)this._walk(t,e=>{p(this._trace(u,t[e],le(r,e),t,e,i,!0,!0))});else if(".."===l)p(this._trace(u,t,r,n,o,i,s)),this._walk(t,n=>{"object"==typeof t[n]&&p(this._trace(e.slice(),t[n],le(r,n),t,n,i,!0))});else{if("^"===l)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if("~"===l)return c={path:le(r,l),value:o,parent:n,parentProperty:null},this._handleCallback(c,i,"property"),c;if("$"===l)p(this._trace(u,t,r,null,null,i,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))p(this._slice(l,u,t,r,n,o,i));else if(0===l.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1"),s=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);s?this._walk(t,e=>{const a=[s[2]],c=s[1]?t[e][s[1]]:t[e];this._trace(a,c,r,n,o,i,!0).length>0&&p(this._trace(u,t[e],le(r,e),t,e,i,!0))}):this._walk(t,s=>{this._eval(e,t[s],s,r,n,o)&&p(this._trace(u,t[s],le(r,s),t,s,i,!0))})}else if("("===l[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(ue(this._eval(l,t,r.at(-1),r.slice(0,-1),n,o),u),t,r,n,o,i,s))}else if("@"===l[0]){let e=!1;const s=l.slice(1,-2);switch(s){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===s&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===s&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,n,o);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+s)}if(e)return c={path:r,value:t,parent:n,parentProperty:o},this._handleCallback(c,i,"value"),c}else if("`"===l[0]&&t&&Object.hasOwn(t,l.slice(1))){const e=l.slice(1);p(this._trace(u,t[e],le(r,e),t,e,i,s,!0))}else if(l.includes(",")){const e=l.split(",");for(const s of e)p(this._trace(ue(s,u),t,r,n,o,i,!0))}else!a&&t&&Object.hasOwn(t,l)&&p(this._trace(u,t[l],le(r,l),t,l,i,s,!0))}if(this._hasParentSelector)for(let e=0;e<f.length;e++){const r=f[e];if(r&&r.isParentSelector){const a=this._trace(r.expr,t,r.path,n,o,i,s);if(Array.isArray(a)){f[e]=a[0];const t=a.length;for(let r=1;r<t;r++)e++,f.splice(e,0,a[r])}else f[e]=a}}return f},pe.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let e=0;e<r;e++)t(e)}else e&&"object"==typeof e&&Object.keys(e).forEach(e=>{t(e)})},pe.prototype._slice=function(e,t,r,n,o,i,s){if(!Array.isArray(r))return;const a=r.length,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1;let u=c[0]&&Number.parseInt(c[0])||0,f=c[1]&&Number.parseInt(c[1])||a;u=u<0?Math.max(0,u+a):Math.min(a,u),f=f<0?Math.max(0,f+a):Math.min(a,f);const p=[];for(let e=u;e<f;e+=l){this._trace(ue(e,t),r,n,o,i,s,!0).forEach(e=>{p.push(e)})}return p},pe.prototype._eval=function(e,t,r,n,o,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=o,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const s=e.includes("@path");s&&(this.currSandbox._$_path=pe.toPathString(n.concat([r])));const a=this.currEval+"Script:"+e;if(!pe.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(s&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)pe.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)pe.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;pe.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);pe.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return pe.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},pe.cache={},pe.toPathString=function(e){const t=e,r=t.length;let n="$";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+=/^[0-9*]+$/u.test(t[e])?"["+t[e]+"]":"['"+t[e]+"']");return n},pe.toPointer=function(e){const t=e,r=t.length;let n="";for(let e=1;e<r;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(n+="/"+t[e].toString().replaceAll("~","~0").replaceAll("/","~1"));return n},pe.toPathArray=function(e){const{cache:t}=pe;if(t[e])return t[e].concat();const r=[],n=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(e,t){return"[#"+(r.push(t)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(e,t){return"['"+t.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(e,t){return";"+t.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(e){const t=e.match(/#(\d+)/u);return t&&t[1]?r[t[1]]:e});return t[e]=n,t[e].concat()},pe.prototype.safeVm={Script:class{constructor(e){this.code=e,this.ast=re(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return ce.evalAst(this.ast,t)}}};pe.prototype.vm={Script:class{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const r=Object.keys(e),n=[];!function(e,t,r){const n=e.length;for(let o=0;o<n;o++)r(e[o])&&t.push(e.splice(o--,1)[0])}(r,n,t=>"function"==typeof e[t]);const o=r.map(t=>e[t]);t=n.reduce((t,r)=>{let n=e[r].toString();return/function/u.test(n)||(n="function "+n),"var "+r+"="+n+";"+t},"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),s=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,s)(...o)}}};var he=function(e,t){try{var r=pe({path:t,json:e}),n=null==r?void 0:r[0];if(void 0===n)return;return null===n?"null":n}catch(e){return void i.w9.error(i.Ey.CLAIM,"[PARAMS-EXTRACTOR-UTILS] Error extracting JSON value with path ".concat(t,":"),e)}},de=function(e,t){try{var r=t.replace(/^\/\//,"").replace(/\/@/," ").split("/"),n=r[r.length-1],o=new RegExp("<".concat(n,"[^>]*>(.*?)</").concat(n,">"),"i"),s=e.match(o);return s?s[1]:void 0}catch(e){return void i.w9.error(i.Ey.CLAIM,"[PARAMS-EXTRACTOR-UTILS] Error extracting HTML value with XPath ".concat(t,":"),e)}};function ye(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ee(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ge(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.replace(/[[\]()*+?.,\\^$|#]/g,"\\$&"),o=function(e){for(var t,r=/{{(\w+)}}/g,n=[];null!==(t=r.exec(e));)n.push(t[1]);return n}(e),i=[],s=ye(o);try{for(s.s();!(t=s.n()).done;){var a=t.value;if(r[a])n=n.replace("{{".concat(a,"}}"),r[a]);else{i.push(a);var c=a.endsWith("GRD")?"(.*)":"(.*?)";n=n.replace("{{".concat(a,"}}"),c)}}}catch(e){s.e(e)}finally{s.f()}return{pattern:n,allVars:o,unsubstitutedVars:i}}function me(e,t,r){if(!t||0===t.length)return!0;var n=null,o=function(e){if(!e||"string"!=typeof e)return!1;var t=e.trim();return t.startsWith("{")||t.startsWith("[")}(e);o&&(n=function(e){try{return JSON.parse(e)}catch(e){return i.w9.warn(i.Ey.CLAIM,"[PARAMS-EXTRACTOR-UTILS] Response looks like JSON but couldn't be parsed"),null}}(e));var s,a=ye(t);try{for(a.s();!(s=a.n()).done;){var c=s.value;if(c.jsonPath&&n)try{if(void 0===he(n,c.jsonPath))return!1}catch(e){return r.error({message:"[NETWORK-FILTER] Error checking jsonPath ".concat(c.jsonPath,":"),logLevel:i.E$.INFO,type:i.D_.CONTENT,eventType:i.Ru.JSON_PATH_MATCH_REQUIREMENT_FAILED}),!1}else if(c.xPath&&!o)try{if(!de(e,c.xPath))return!1}catch(e){return r.error({message:"[NETWORK-FILTER] Error checking xPath ".concat(c.xPath,":"),logLevel:i.E$.INFO,type:i.D_.CONTENT,eventType:i.Ru.X_PATH_MATCH_REQUIREMENT_FAILED}),!1}else if(c.regex)try{if(!new RegExp(c.regex).test(e))return!1}catch(e){return r.error({message:"[NETWORK-FILTER] Error checking regex ".concat(c.regex,":"),logLevel:i.E$.INFO,type:i.D_.CONTENT,eventType:i.Ru.REGEX_MATCH_REQUIREMENT_FAILED}),!1}}}catch(e){a.e(e)}finally{a.f()}return!0}var ve=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;try{return!!function(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!(!t||!e)&&!!function(){var r=t.url,n=t.urlType;if(!r)return!1;var i=(n||"EXACT").toUpperCase();if("EXACT"===i)return r===e.url;if("REGEX"===i||"TEMPLATE"===i){var s=ge(r,o).pattern;return new RegExp(s).test(e.url)}return!1}()&&(null===(r=e.method)||void 0===r?void 0:r.toUpperCase())===(null===(n=t.method)||void 0===n?void 0:n.toUpperCase())&&function(r,n){var i=t.bodySniff;if(!i||!i.enabled)return!0;var s=null!==(r=i.template)&&void 0!==r?r:"",a="string"==typeof e.body?e.body:JSON.stringify(null!==(n=e.body)&&void 0!==n?n:{});if(s===a)return!0;var c=ge(s,o).pattern;return new RegExp(c).test(a)}()}(e,t,r)&&(!(e.responseText&&t.responseMatches&&!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||0===t.length)return!0;var n,o=ye(t);try{for(o.s();!(n=o.n()).done;){var i=n.value,s=void 0;s="regex"===i.type?i.value:ge(i.value,r).pattern;var a=new RegExp(s).test(e);if(!(i.invert?!a:a))return!1}}catch(e){o.e(e)}finally{o.f()}return!0}(e.responseText,t.responseMatches,r))&&!(e.responseText&&t.responseRedactions&&!me(e.responseText,t.responseRedactions,n)))}catch(e){return n.error({message:"[NETWORK-FILTER] Error filtering request:",logLevel:i.E$.ERROR,type:i.D_.CONTENT,eventType:i.Ru.FILTER_REQUEST_ERROR,meta:{error:e}}),!1}};var be=r(7770),Oe=r(3859);var Ie=(0,be.y8)({sessionId:"unknown",providerId:"unknown",appId:"unknown",source:"reclaim-extension-sdk",type:Oe.LOG_TYPES.OFFSCREEN}),_e=null,Te=function(e){(null==e?void 0:e.action)===D&&(null==e?void 0:e.source)===_&&(null==e?void 0:e.target)===I&&(Ie.info({message:"[OFFSCREEN-MANAGER] Received offscreen ready signal (global listener).",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.OFFSCREEN}),_e&&(clearTimeout(_e),_e=null))},we=function(){"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.onMessage&&chrome.runtime.onMessage.addListener&&chrome.runtime.onMessage.hasListener&&(chrome.runtime.onMessage.hasListener(Te)||chrome.runtime.onMessage.addListener(Te))};"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.onMessage&&we(),we();function Le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return a}}(e,t)||Ae(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Se(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ae(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function Ae(e,t){if(e){if("string"==typeof e)return Ce(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ne(n.key),n)}}function Ne(e){var t=function(e,t){if("object"!=Re(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Re(t)?t:t+""}function xe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof a?n:a,l=Object.create(c.prototype);return Fe(l,"_invoke",function(r,n,o){var i,a,c,l=0,u=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function h(r,n){for(a=r,c=n,t=0;!f&&l&&!o&&t<u.length;t++){var o,i=u[t],h=p.p,d=i[2];r>3?(o=d===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=r<2&&h<i[1])?(a=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),a=u,c=d;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),h(a,c)):p.n=c:p.v=c);try{if(l=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{l=1}}return{value:t,done:f}}}(r,o,i),!0),l}var s={};function a(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Fe(t={},n,function(){return this}),t),f=l.prototype=a.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Fe(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=l,Fe(f,"constructor",l),Fe(l,"constructor",c),c.displayName="GeneratorFunction",Fe(l,o,"GeneratorFunction"),Fe(f),Fe(f,o,"Generator"),Fe(f,n,function(){return this}),Fe(f,"toString",function(){return"[object Generator]"}),(xe=function(){return{w:i,m:p}})()}function Fe(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Fe=function(e,t,r,n){function i(t,r){Fe(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Fe(e,t,r,n)}function De(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}var ke=(0,be.y8)({sessionId:"unknown",providerId:"unknown",appId:"unknown",source:"reclaim-extension-sdk"}),Me=!1,Ue=!1,Be=!1,Ge=function(){if(!Ue)try{var e=document.createElement("script"),t=chrome.runtime.getURL("joclaim-browser-extension-sdk/interceptor/network-interceptor.bundle.js");e.src=t,e.type="text/javascript",e.async=!1,e.defer=!1;var r=!1,n=function(){r||(document.documentElement?(document.documentElement.insertBefore(e,document.documentElement.firstChild),r=!0,Ue=!0):document.head?(document.head.insertBefore(e,document.head.firstChild),r=!0,Ue=!0):document&&(document.appendChild(e),r=!0,Ue=!0))};if(n(),!r){var o=new MutationObserver(function(){r||!document.documentElement&&!document.head||(n(),r&&o.disconnect())});o.observe(document,{childList:!0,subtree:!0})}return e}catch(e){return null}},je=function(){if(!Be)try{var e=document.createElement("script");e.src=chrome.runtime.getURL("joclaim-browser-extension-sdk/interceptor/injection-scripts.bundle.js"),e.type="text/javascript",e.async=!1,e.defer=!1;var t=!1,r=function(){t||(document.documentElement?(document.documentElement.insertBefore(e,document.documentElement.firstChild),t=!0,Be=!0):document.head?(document.head.insertBefore(e,document.head.firstChild),t=!0,Be=!0):document&&(document.appendChild(e),t=!0,Be=!0))};if(r(),!t){var n=new MutationObserver(function(){t||!document.documentElement&&!document.head||(r(),t&&n.disconnect())});n.observe(document,{childList:!0,subtree:!0})}return e}catch(e){return null}};try{chrome.runtime.onMessage.addListener(function(e,t,r){var n=e||{},o=n.action,i=n.data;if(o===N){try{var s=(null==i?void 0:i.formattedProofs)||(null==i?void 0:i.proof)||i;window.postMessage({action:b.VERIFICATION_COMPLETED,messageId:null==i?void 0:i.sessionId,data:{proofs:s}},"*")}catch(e){}return ke.info({message:"[CONTENT] Proof submitted",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),null==r||r({success:!0}),!0}if(o===x||o===P){try{window.postMessage({action:b.VERIFICATION_FAILED,messageId:null==i?void 0:i.sessionId,error:(null==i?void 0:i.error)||"Verification failed"},"*")}catch(e){}return ke.info({message:"[CONTENT] Proof submission failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),null==r||r({success:!0}),!0}return!1})}catch(e){}!function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(e){De(i,n,o,s,a,"next",e)}function a(e){De(i,n,o,s,a,"throw",e)}s(void 0)})}}(xe().m(function e(){return xe().w(function(e){for(;;)switch(e.n){case 0:try{try{chrome.runtime.sendMessage({action:G,source:O,target:I,data:{}},function(e){null!=e&&e.success&&e.isManaged&&(Me=!0,Ge(),je())})}catch(e){}chrome.runtime.sendMessage({action:U,source:O,target:I,data:{url:window.location.href}}),chrome.runtime.onMessage.addListener(function(e,t,r){var n=e.action,o=e.data;return n===B&&((Me=o.shouldInitialize)&&(Ge(),je(),window.reclaimContentScript=new Ve),r({success:!0})),!0})}catch(e){}case 1:return e.a(2)}},e)}))();var Ve=function(){return e=function e(){var t,n=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init(),this.verificationPopup=null,this.providerName=null,this.credentialType=null,this.dataRequired=null,this.interceptedRequestResponses=new Map,this.providerData=null,this.parameters={},this.sessionId=null,this.providerId=null,this.appId=null,this.filteringInterval=null,this.filteringStartTime=null,this.filteredRequests=[],this.isFiltering=!1,this.stopStoringInterceptions=!1,this.isManagedTab=!1,this._mode="undefined"!=typeof chrome&&chrome.runtime&&"chrome-extension:"===(null===(t=location)||void 0===t?void 0:t.protocol)?"extension":"web","extension"===this._mode){this._boundChromeHandler=function(e){var t=e||{},r=t.action,o=t.data,i=t.error,s=null==o?void 0:o.sessionId;if(r&&(!n.sessionId||n.sessionId===s))if("PROOF_SUBMITTED"===r){var a=(null==o?void 0:o.formattedProofs)||(null==o?void 0:o.proof)||o;n._emit("completed",a)}else"PROOF_SUBMISSION_FAILED"!==r&&"PROOF_GENERATION_FAILED"!==r||n._emit("error",i||new Error("Verification failed"))};try{chrome.runtime.onMessage.addListener(this._boundChromeHandler)}catch(e){}try{var o=r(3859).LOG_CONFIG_STORAGE_KEY;chrome.storage.local.get([o],function(e){var t=null==e?void 0:e[o];t&&"object"===Re(t)&&be.Ow.setConfig(t)}),chrome.storage.onChanged.addListener(function(e,t){if("local"===t&&e[o]){var r=e[o].newValue||{};be.Ow.setConfig(r)}})}catch(e){}}else this._boundWindowHandler=this.handleWindowMessage.bind(this),window.addEventListener("message",this._boundWindowHandler)},t=[{key:"init",value:function(){var e=this;Me&&(chrome.runtime.onMessage.addListener(this.handleMessage.bind(this)),chrome.runtime.sendMessage({action:G,source:O,target:I,data:{}},function(t){t.success&&t.isManaged?(e.isManagedTab=!0,chrome.runtime.sendMessage({action:k,source:O,target:I,data:{url:window.location.href}},function(t){var r,n,o,i;t.success&&(e.providerData=t.data.providerData,e.parameters=t.data.parameters,e.sessionId=t.data.sessionId,e.providerId=t.data.providerId||"unknown",e.appId=t.data.appId||"unknown",ke.setContext({sessionId:e.sessionId,providerId:e.providerId,appId:e.appId,type:Oe.LOG_TYPES.CONTENT}),ke.info({message:"[Content] Provider data received from background script and will proceed with network filtering.",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),null!==(r=e.providerData)&&void 0!==r&&r.disableRequestReplay||chrome.runtime.sendMessage({action:W,source:O,target:I,data:{op:"REPLAY_PAGE_FETCH",showAlert:!1}}),localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(e.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:e.parameters||{}}},"*"),e.setProviderIdInLocalStorage(e.providerId),null!==(n=e.providerData)&&void 0!==n&&null!==(n=n.customInjection)&&void 0!==n&&n.length&&null!==(o=e.providerData)&&void 0!==o&&null!==(o=o.extensionConfig)&&void 0!==o&&o.allowInjectionsViaChromeScritpting?chrome.runtime.sendMessage({action:W,source:O,target:I,data:{op:"RUN_CUSTOM_INJECTION",code:e.providerData.customInjection}}):e.setProviderInjectionScriptInLocalStorage(e.providerId,null===(i=e.providerData)||void 0===i?void 0:i.customInjection),e.isFiltering||e.startNetworkFiltering(),e.setupUrlListener())})):e.isManagedTab=!1}))}},{key:"handleMessage",value:function(e,t,r){var n=this,o=e.action,i=e.data;switch(e.source,ke.setContext({sessionId:this.sessionId,providerId:this.providerId,appId:this.appId,type:Oe.LOG_TYPES.CONTENT}),o){case B:break;case M:if(!this.isManagedTab){ke.info({message:"[Content] Tab is not managed by extension",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.TAB_NOT_MANAGED_BY_EXTENSION_EXCEPTION}),r({success:!1,message:"Tab is not managed by extension"});break}this.providerData=i.providerData,this.parameters=i.parameters,this.sessionId=i.sessionId,this.providerId=i.providerId||"unknown",this.appId=i.appId||"unknown",localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(this.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:this.parameters||{}}},"*"),this.setProviderIdInLocalStorage(this.providerId),this.setProviderInjectionScriptInLocalStorage(this.providerId,null==i?void 0:i.customInjection),this.isFiltering||this.startNetworkFiltering(),this.setupUrlListener(),ke.info({message:"[Content] Provider data received from background script and starting network filtering.",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case F:chrome.runtime.sendMessage({action:G,source:O,target:I,data:{}},function(e){if(!e.success||!e.isManaged)return ke.info({message:"[Content] Tab is not managed by extension",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.TAB_NOT_MANAGED_BY_EXTENSION_EXCEPTION}),void r({success:!1,message:"Tab is not managed by extension"});if(n.verificationPopup){try{ke.info({message:"[Content] Removing existing popup",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),document.body.removeChild(n.verificationPopup.element)}catch(e){}n.verificationPopup=null}n.providerName=(null==i?void 0:i.providerName)||n.providerName,n.description=(null==i?void 0:i.description)||n.description,n.dataRequired=(null==i?void 0:i.dataRequired)||n.dataRequired,n.sessionId=(null==i?void 0:i.sessionId)||n.sessionId;var t=function(){if(document.body){try{n.verificationPopup=Z(n.providerName,n.description,n.dataRequired,n.sessionId)}catch(e){return}try{setTimeout(function(){document.body.appendChild(n.verificationPopup.element)},500)}catch(e){return}}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){t()},{once:!0}):t(),r({success:!0,message:"Popup display process initiated and will proceed on DOM readiness."})});break;case L:this.verificationPopup&&this.verificationPopup.handleClaimCreationRequested(i.requestHash),ke.info({message:"[Content] Claim creation requested",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case S:this.verificationPopup&&this.verificationPopup.handleClaimCreationSuccess(i.requestHash),ke.info({message:"[Content] Claim creation success",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case A:this.verificationPopup&&this.verificationPopup.handleClaimCreationFailed(i.requestHash),ke.info({message:"[Content] Claim creation failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case C:this.verificationPopup&&this.verificationPopup.handleProofGenerationStarted(i.requestHash),ke.info({message:"[Content] Proof generation started",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case R:this.verificationPopup&&this.verificationPopup.handleProofGenerationSuccess(i.requestHash),ke.info({message:"[Content] Proof generation success",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case P:try{window.postMessage({action:b.VERIFICATION_FAILED,messageId:null==i?void 0:i.sessionId,error:(null==i?void 0:i.error)||"Verification failed"},"*")}catch(e){}this.verificationPopup&&this.verificationPopup.handleProofGenerationFailed(i.requestHash),ke.info({message:"[Content] Proof generation failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case N:try{var s=(null==i?void 0:i.formattedProofs)||(null==i?void 0:i.proof)||i;window.postMessage({action:b.VERIFICATION_COMPLETED,messageId:null==i?void 0:i.sessionId,data:{proofs:s}},"*")}catch(e){}this.verificationPopup&&this.verificationPopup.handleProofSubmitted(),ke.info({message:"[Content] Proof submitted",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;case x:try{window.postMessage({action:b.VERIFICATION_FAILED,messageId:null==i?void 0:i.sessionId,error:(null==i?void 0:i.error)||"Proof submission failed"},"*")}catch(e){}this.verificationPopup&&this.verificationPopup.handleProofSubmissionFailed(i.error),ke.info({message:"[Content] Proof submission failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),r({success:!0});break;default:r({success:!1,error:"Unknown action"})}return!0}},{key:"checkExtensionId",value:function(e){try{var t="undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.id?chrome.runtime.id:null;return e?!!t&&e===t:!!t}catch(e){return!1}}},{key:"handleWindowMessage",value:function(e){var t=this;if(e.source===window){var n=e.data,o=n.action,i=n.data,s=n.messageId,a=n.extensionID;if(o===b.CHECK_EXTENSION){if(!this.checkExtensionId(a))return;window.postMessage({action:b.EXTENSION_RESPONSE,messageId:s,installed:!0},"*")}if(o===b.SET_LOG_CONFIG&&null!=i&&i.config){if(!this.checkExtensionId(a))return;try{be.Ow.setConfig(i.config)}catch(e){}try{var c=r(3859).LOG_CONFIG_STORAGE_KEY;chrome.storage.local.set((l={},u=c,f=i.config,(u=Ne(u))in l?Object.defineProperty(l,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):l[u]=f,l))}catch(e){}}else{var l,u,f;if("RECLAIM_GET_PROVIDER_ID"!==o||"injection-script"!==e.data.source){if(o===V&&i){var p="".concat(i.request.method,"_").concat(i.request.url,"_").concat(i.timestamp||Date.now());this.interceptedRequestResponses.set(p,i),this.isFiltering&&this.startNetworkFiltering()}if(o===b.START_VERIFICATION&&i){if(!this.checkExtensionId(a))return;ke.info({message:"[Content] Starting verification with data from SDK: "+JSON.stringify(i),logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,meta:{data:i}}),chrome.runtime.sendMessage({action:T,source:O,target:I,data:i},function(e){i.parameters&&(t.parameters=i.parameters,localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(t.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:t.parameters||{}}},"*")),i.sessionId&&(t.sessionId=i.sessionId),e&&e.success?window.postMessage({action:b.VERIFICATION_STARTED,messageId:s,sessionId:i.sessionId},"*"):(window.postMessage({action:b.VERIFICATION_FAILED,messageId:s,error:(null==e?void 0:e.error)||"Failed to start verification"},"*"),ke.info({message:"[Content] Verification failed",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT,meta:{error:(null==e?void 0:e.error)||"Failed to start verification"}}))})}if(o===b.CANCEL_VERIFICATION){if(!this.checkExtensionId(a))return;chrome.runtime.sendMessage({action:w,source:O,target:I,data:{sessionId:this.sessionId}},function(){}),ke.info({message:"[Content] Verification cancelled",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}if(o===b.SET_PUBLIC_DATA&&null!==(null==i?void 0:i.publicData))return this.publicData=String(null==i?void 0:i.publicData),chrome.runtime.sendMessage({action:Y,source:O,target:I,data:{publicData:this.publicData}},function(){}),void ke.info({message:"[Content] Public data set",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.SET_EXPECT_MANY_CLAIMS&&"boolean"==typeof(null==i?void 0:i.expectMany))return chrome.runtime.sendMessage({action:q,source:O,target:I,data:{expectMany:!!i.expectMany}},function(){}),void ke.info({message:"[Content] Expect many claims set",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.PARAMETERS_GET)return chrome.runtime.sendMessage({action:$,source:O,target:I,data:{}},function(e){var r=null!=e&&e.success?e.parameters||{}:t.parameters||{};t.parameters=r,localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(t.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:r}},"*")}),void ke.info({message:"[Content] Parameters get",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.SET_PARAMETERS&&(this.parameters=(null==i?void 0:i.parameters)||{},localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(this.parameters||{})),window.postMessage({action:b.PARAMETERS_UPDATE,data:{parameters:this.parameters||{}}},"*")),o===b.REPORT_PROVIDER_ERROR&&null!=i&&i.message)return chrome.runtime.sendMessage({action:X,source:O,target:I,data:{message:String(i.message)}},function(){}),void ke.info({message:"[Content] Provider error reported",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});if(o===b.REQUEST_CLAIM&&null!=i&&i.rdObject){var h;if(!this.sessionId)return;var d=i.rdObject||{},y="rc-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)),E={url:String((null==d?void 0:d.url)||""),method:String((null==d?void 0:d.method)||"GET"),headers:(null==d?void 0:d.headers)||{},body:null!=(null==d?void 0:d.requestBody)?String(null==d?void 0:d.requestBody):"",extractedParams:(null==d?void 0:d.extractedParams)||{}},g={url:String((null==d?void 0:d.url)||""),expectedPageUrl:"",urlType:"TEMPLATE",method:String((null==d?void 0:d.method)||"GET"),responseMatches:Array.isArray(null==d?void 0:d.responseMatches)?null==d?void 0:d.responseMatches:[],responseRedactions:Array.isArray(null==d?void 0:d.responseRedactions)?null==d?void 0:d.responseRedactions:[],bodySniff:{enabled:!1,template:""},additionalClientOptions:{},requestHash:y};return chrome.runtime.sendMessage({action:H,source:O,target:I,data:{request:E,criteria:g,sessionId:this.sessionId,loginUrl:(null===(h=this.providerData)||void 0===h?void 0:h.loginUrl)||""}},function(){}),void ke.info({message:"[Content] Claim requested",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}}else window.postMessage({action:"RECLAIM_PROVIDER_ID_RESPONSE",providerId:this.providerId||null,source:"content-script"},"*")}}}},{key:"cleanupInterceptedData",value:function(){var e,t=Date.now(),r=Se(this.interceptedRequestResponses.entries());try{for(r.s();!(e=r.n()).done;){var n=Le(e.value,2),o=n[0];t-n[1].timestamp>12e4&&this.interceptedRequestResponses.delete(o)}}catch(e){r.e(e)}finally{r.f()}}},{key:"startNetworkFiltering",value:function(){var e,t=this;this.providerData&&"NONE"!==(null===(e=this.providerData)||void 0===e?void 0:e.injectionType)&&(this.isFiltering=!0,this.filteringStartTime=Date.now(),this.stopStoringInterceptions=!1,this.filterInterceptedRequests(),this.filteringInterval&&clearInterval(this.filteringInterval),this.filteringInterval=setInterval(function(){t.stopStoringInterceptions?t.stopNetworkFiltering():(t.filterInterceptedRequests(),Date.now()-t.filteringStartTime>6e5&&t.stopNetworkFiltering())},1e3))}},{key:"stopNetworkFiltering",value:function(){var e;this.filteringInterval&&(clearInterval(this.filteringInterval),this.filteringInterval=null),this.isFiltering=!1,this.filteredRequests.length>=((null===(e=this.providerData)||void 0===e||null===(e=e.requestData)||void 0===e?void 0:e.length)||0)&&(this.stopStoringInterceptions=!0,this.interceptedRequestResponses.clear())}},{key:"filterInterceptedRequests",value:function(){if(this.providerData&&this.providerData.requestData){var e,t=Se(this.interceptedRequestResponses.entries());try{for(t.s();!(e=t.n()).done;){var r=Le(e.value,2),n=r[0],o=r[1];if(!this.filteredRequests.includes(n)){var i,s=o.request,a=o.response.body,c={url:s.url,method:s.method,body:s.body||null,headers:s.headers||{},responseText:a},l=Se(this.providerData.requestData);try{for(l.s();!(i=l.n()).done;){var u=i.value;ve(c,u,this.parameters,ke)&&(ke.info({message:"[Content] Matching request found: "+c.method+" "+c.url,logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),this.filteredRequests.push(n),this.sendFilteredRequestToBackground(c,u,this.providerData.loginUrl))}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){t.e(e)}finally{t.f()}this.filteredRequests.length>=this.providerData.requestData.length&&(this.stopStoringInterceptions=!0,this.isFiltering=!1,this.filteringInterval&&(clearInterval(this.filteringInterval),this.filteringInterval=null),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.interceptedRequestResponses.clear())}}},{key:"sendFilteredRequestToBackground",value:function(e,t,r){ke.info({message:"[Content] Sending filtered request to background script: "+JSON.stringify(e.url),logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT}),chrome.runtime.sendMessage({action:j,source:O,target:I,data:{request:e,criteria:t,loginUrl:r,sessionId:this.sessionId}},function(e){})}},{key:"setProviderIdInLocalStorage",value:function(e){var t="reclaimBrowserExtensionProviderId";if(!e||"unknown"===e)return localStorage.removeItem(t),void ke.info({message:"[Content] Skipping localStorage storage for invalid provider ID: "+e,logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT});try{localStorage.setItem(t,e),ke.info({message:"[Content] Provider ID "+e+" stored in localStorage.",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}catch(r){localStorage.removeItem(t),ke.error({message:"[Content] Failed to store provider ID "+e+" in localStorage: "+r.message,logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT})}}},{key:"setProviderInjectionScriptInLocalStorage",value:function(e,t){var r="reclaimBrowserExtensionInjectionScript:".concat(e);if(!e||"unknown"===e)return localStorage.removeItem(r),void ke.error({message:"[Content] Failed to store provider ID "+e+" in localStorage: ",logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.INJECTION_SCRIPT_SET_IN_LOCAL_STORAGE_FAILED});if(null==t||!t.length)return localStorage.removeItem(r),void ke.error({message:"[Content] Skipping localStorage storage for injection script",logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.INJECTION_SCRIPT_SET_IN_LOCAL_STORAGE_FAILED});try{localStorage.setItem(r,t),ke.info({message:"[Content] Injection script stored in localStorage...",logLevel:Oe.LOG_LEVEL.INFO,type:Oe.LOG_TYPES.CONTENT})}catch(e){localStorage.removeItem(r),ke.error({message:"[Content] Failed to store injection script in localStorage: "+e.message,logLevel:Oe.LOG_LEVEL.ERROR,type:Oe.LOG_TYPES.CONTENT,eventType:Oe.EVENT_TYPES.INJECTION_SCRIPT_SET_IN_LOCAL_STORAGE_FAILED})}}},{key:"setupUrlListener",value:function(){var e=this,t=window.location.href;new MutationObserver(function(){var r,n=window.location.href;n!==t&&(t=n,null!==(r=e.providerData)&&void 0!==r&&r.disableRequestReplay||chrome.runtime.sendMessage({action:W,source:O,target:I,data:{op:"REPLAY_PAGE_FETCH",showAlert:!1}}))}).observe(document.documentElement,{childList:!0,subtree:!0})}}],t&&Pe(e.prototype,t),n&&Pe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();const Ye=new Ve})(),n})());
11
11
  //# sourceMappingURL=content.bundle.js.map