@persona/relay 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/index.d.ts +125 -0
- package/dist/relay.cjs +5 -0
- package/dist/relay.cjs.map +1 -0
- package/dist/relay.js +1966 -0
- package/dist/relay.js.map +1 -0
- package/dist/relay.umd.js +5 -0
- package/dist/relay.umd.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(function(ve,Oe){typeof exports=="object"&&typeof module<"u"?module.exports=Oe():typeof define=="function"&&define.amd?define(Oe):(ve=typeof globalThis<"u"?globalThis:ve||self,ve.Relay=Oe())})(this,(function(){"use strict";var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oe(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var a=e.default;if(typeof a=="function"){var f=function l(){var g=!1;try{g=this instanceof l}catch{}return g?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};f.prototype=a.prototype}else f={};return Object.defineProperty(f,"__esModule",{value:!0}),Object.keys(e).forEach(function(l){var g=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(f,l,g.get?g:{enumerable:!0,get:function(){return e[l]}})}),f}var De,Wr;function he(){return Wr||(Wr=1,De=TypeError),De}const an=Oe(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ce,kr;function _e(){if(kr)return Ce;kr=1;var e=typeof Map=="function"&&Map.prototype,a=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,f=e&&a&&typeof a.get=="function"?a.get:null,l=e&&Map.prototype.forEach,g=typeof Set=="function"&&Set.prototype,b=Object.getOwnPropertyDescriptor&&g?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,P=g&&b&&typeof b.get=="function"?b.get:null,v=g&&Set.prototype.forEach,O=typeof WeakMap=="function"&&WeakMap.prototype,y=O?WeakMap.prototype.has:null,m=typeof WeakSet=="function"&&WeakSet.prototype,d=m?WeakSet.prototype.has:null,F=typeof WeakRef=="function"&&WeakRef.prototype,A=F?WeakRef.prototype.deref:null,n=Boolean.prototype.valueOf,u=Object.prototype.toString,i=Function.prototype.toString,I=String.prototype.match,w=String.prototype.slice,E=String.prototype.replace,M=String.prototype.toUpperCase,h=String.prototype.toLowerCase,R=RegExp.prototype.test,o=Array.prototype.concat,c=Array.prototype.join,p=Array.prototype.slice,S=Math.floor,_=typeof BigInt=="function"?BigInt.prototype.valueOf:null,x=Object.getOwnPropertySymbols,B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,N=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===N||!0)?Symbol.toStringTag:null,D=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function s(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||R.call(/e/,t))return t;var C=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var L=r<0?-S(-r):S(r);if(L!==r){var U=String(L),q=w.call(t,U.length+1);return E.call(U,C,"$&_")+"."+E.call(E.call(q,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(t,C,"$&_")}var $=an,j=$.custom,X=H(j)?j:null,se={__proto__:null,double:'"',single:"'"},me={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ce=function r(t,C,L,U){var q=C||{};if(W(q,"quoteStyle")&&!W(se,q.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(q,"maxStringLength")&&(typeof q.maxStringLength=="number"?q.maxStringLength<0&&q.maxStringLength!==1/0:q.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var ue=W(q,"customInspect")?q.customInspect:!0;if(typeof ue!="boolean"&&ue!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(q,"indent")&&q.indent!==null&&q.indent!==" "&&!(parseInt(q.indent,10)===q.indent&&q.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(q,"numericSeparator")&&typeof q.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var de=q.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Qt(t,q);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var Y=String(t);return de?s(t,Y):Y}if(typeof t=="bigint"){var fe=String(t)+"n";return de?s(t,fe):fe}var $r=typeof q.depth>"u"?5:q.depth;if(typeof L>"u"&&(L=0),L>=$r&&$r>0&&typeof t=="object")return ae(t)?"[Array]":"[Object]";var be=Yn(q,L);if(typeof U>"u")U=[];else if(pe(U,t)>=0)return"[Circular]";function te(Ee,Me,Zn){if(Me&&(U=p.call(U),U.push(Me)),Zn){var nn={depth:q.depth};return W(q,"quoteStyle")&&(nn.quoteStyle=q.quoteStyle),r(Ee,nn,L+1,U)}return r(Ee,q,L+1,U)}if(typeof t=="function"&&!oe(t)){var Jt=Re(t),Yt=Fe(t,te);return"[Function"+(Jt?": "+Jt:" (anonymous)")+"]"+(Yt.length>0?" { "+c.call(Yt,", ")+" }":"")}if(H(t)){var Xt=N?E.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(t);return typeof t=="object"&&!N?Pe(Xt):Xt}if(Qn(t)){for(var Ie="<"+h.call(String(t.nodeName)),Nr=t.attributes||[],qe=0;qe<Nr.length;qe++)Ie+=" "+Nr[qe].name+"="+ee(ne(Nr[qe].value),"double",q);return Ie+=">",t.childNodes&&t.childNodes.length&&(Ie+="..."),Ie+="</"+h.call(String(t.nodeName))+">",Ie}if(ae(t)){if(t.length===0)return"[]";var Tr=Fe(t,te);return be&&!Jn(Tr)?"["+Cr(Tr,be)+"]":"[ "+c.call(Tr,", ")+" ]"}if(Q(t)){var Lr=Fe(t,te);return!("cause"in Error.prototype)&&"cause"in t&&!D.call(t,"cause")?"{ ["+String(t)+"] "+c.call(o.call("[cause]: "+te(t.cause),Lr),", ")+" }":Lr.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+c.call(Lr,", ")+" }"}if(typeof t=="object"&&ue){if(X&&typeof t[X]=="function"&&$)return $(t,{depth:$r-L});if(ue!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(ye(t)){var Zt=[];return l&&l.call(t,function(Ee,Me){Zt.push(te(Me,t,!0)+" => "+te(Ee,t))}),Vt("Map",f.call(t),Zt,be)}if(we(t)){var en=[];return v&&v.call(t,function(Ee){en.push(te(Ee,t))}),Vt("Set",P.call(t),en,be)}if(re(t))return Dr("WeakMap");if(Se(t))return Dr("WeakSet");if(ge(t))return Dr("WeakRef");if(G(t))return Pe(te(Number(t)));if(V(t))return Pe(te(_.call(t)));if(z(t))return Pe(n.call(t));if(T(t))return Pe(te(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof ve<"u"&&t===ve)return"{ [object globalThis] }";if(!ie(t)&&!oe(t)){var Br=Fe(t,te),rn=K?K(t)===Object.prototype:t instanceof Object||t.constructor===Object,Ur=t instanceof Object?"":"null prototype",tn=!rn&&k&&Object(t)===t&&k in t?w.call(J(t),8,-1):Ur?"Object":"",Xn=rn||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",zr=Xn+(tn||Ur?"["+c.call(o.call([],tn||[],Ur||[]),": ")+"] ":"");return Br.length===0?zr+"{}":be?zr+"{"+Cr(Br,be)+"}":zr+"{ "+c.call(Br,", ")+" }"}return String(t)};function ee(r,t,C){var L=C.quoteStyle||t,U=se[L];return U+r+U}function ne(r){return E.call(String(r),/"/g,""")}function Z(r){return!k||!(typeof r=="object"&&(k in r||typeof r[k]<"u"))}function ae(r){return J(r)==="[object Array]"&&Z(r)}function ie(r){return J(r)==="[object Date]"&&Z(r)}function oe(r){return J(r)==="[object RegExp]"&&Z(r)}function Q(r){return J(r)==="[object Error]"&&Z(r)}function T(r){return J(r)==="[object String]"&&Z(r)}function G(r){return J(r)==="[object Number]"&&Z(r)}function z(r){return J(r)==="[object Boolean]"&&Z(r)}function H(r){if(N)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!B)return!1;try{return B.call(r),!0}catch{}return!1}function V(r){if(!r||typeof r!="object"||!_)return!1;try{return _.call(r),!0}catch{}return!1}var le=Object.prototype.hasOwnProperty||function(r){return r in this};function W(r,t){return le.call(r,t)}function J(r){return u.call(r)}function Re(r){if(r.name)return r.name;var t=I.call(i.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function pe(r,t){if(r.indexOf)return r.indexOf(t);for(var C=0,L=r.length;C<L;C++)if(r[C]===t)return C;return-1}function ye(r){if(!f||!r||typeof r!="object")return!1;try{f.call(r);try{P.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function re(r){if(!y||!r||typeof r!="object")return!1;try{y.call(r,y);try{d.call(r,d)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function ge(r){if(!A||!r||typeof r!="object")return!1;try{return A.call(r),!0}catch{}return!1}function we(r){if(!P||!r||typeof r!="object")return!1;try{P.call(r);try{f.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Se(r){if(!d||!r||typeof r!="object")return!1;try{d.call(r,d);try{y.call(r,y)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Qn(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Qt(r,t){if(r.length>t.maxStringLength){var C=r.length-t.maxStringLength,L="... "+C+" more character"+(C>1?"s":"");return Qt(w.call(r,0,t.maxStringLength),t)+L}var U=me[t.quoteStyle||"single"];U.lastIndex=0;var q=E.call(E.call(r,U,"\\$1"),/[\x00-\x1f]/g,Vn);return ee(q,"single",t)}function Vn(r){var t=r.charCodeAt(0),C={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return C?"\\"+C:"\\x"+(t<16?"0":"")+M.call(t.toString(16))}function Pe(r){return"Object("+r+")"}function Dr(r){return r+" { ? }"}function Vt(r,t,C,L){var U=L?Cr(C,L):c.call(C,", ");return r+" ("+t+") {"+U+"}"}function Jn(r){for(var t=0;t<r.length;t++)if(pe(r[t],`
|
|
2
|
+
`)>=0)return!1;return!0}function Yn(r,t){var C;if(r.indent===" ")C=" ";else if(typeof r.indent=="number"&&r.indent>0)C=c.call(Array(r.indent+1)," ");else return null;return{base:C,prev:c.call(Array(t+1),C)}}function Cr(r,t){if(r.length===0)return"";var C=`
|
|
3
|
+
`+t.prev+t.base;return C+c.call(r,","+C)+`
|
|
4
|
+
`+t.prev}function Fe(r,t){var C=ae(r),L=[];if(C){L.length=r.length;for(var U=0;U<r.length;U++)L[U]=W(r,U)?t(r[U],r):""}var q=typeof x=="function"?x(r):[],ue;if(N){ue={};for(var de=0;de<q.length;de++)ue["$"+q[de]]=q[de]}for(var Y in r)W(r,Y)&&(C&&String(Number(Y))===Y&&Y<r.length||N&&ue["$"+Y]instanceof Symbol||(R.call(/[^\w$]/,Y)?L.push(t(Y,r)+": "+t(r[Y],r)):L.push(Y+": "+t(r[Y],r))));if(typeof x=="function")for(var fe=0;fe<q.length;fe++)D.call(r,q[fe])&&L.push("["+t(q[fe])+"]: "+t(r[q[fe]],r));return L}return Ce}var $e,Gr;function on(){if(Gr)return $e;Gr=1;var e=_e(),a=he(),f=function(v,O,y){for(var m=v,d;(d=m.next)!=null;m=d)if(d.key===O)return m.next=d.next,y||(d.next=v.next,v.next=d),d},l=function(v,O){if(v){var y=f(v,O);return y&&y.value}},g=function(v,O,y){var m=f(v,O);m?m.value=y:v.next={key:O,next:v.next,value:y}},b=function(v,O){return v?!!f(v,O):!1},P=function(v,O){if(v)return f(v,O,!0)};return $e=function(){var O,y={assert:function(m){if(!y.has(m))throw new a("Side channel does not contain "+e(m))},delete:function(m){var d=O&&O.next,F=P(O,m);return F&&d&&d===F&&(O=void 0),!!F},get:function(m){return l(O,m)},has:function(m){return b(O,m)},set:function(m,d){O||(O={next:void 0}),g(O,m,d)}};return y},$e}var Ne,Hr;function jr(){return Hr||(Hr=1,Ne=Object),Ne}var Te,Kr;function ln(){return Kr||(Kr=1,Te=Error),Te}var Le,Qr;function un(){return Qr||(Qr=1,Le=EvalError),Le}var Be,Vr;function fn(){return Vr||(Vr=1,Be=RangeError),Be}var Ue,Jr;function cn(){return Jr||(Jr=1,Ue=ReferenceError),Ue}var ze,Yr;function sn(){return Yr||(Yr=1,ze=SyntaxError),ze}var We,Xr;function pn(){return Xr||(Xr=1,We=URIError),We}var ke,Zr;function yn(){return Zr||(Zr=1,ke=Math.abs),ke}var Ge,et;function dn(){return et||(et=1,Ge=Math.floor),Ge}var He,rt;function vn(){return rt||(rt=1,He=Math.max),He}var je,tt;function hn(){return tt||(tt=1,je=Math.min),je}var Ke,nt;function mn(){return nt||(nt=1,Ke=Math.pow),Ke}var Qe,at;function gn(){return at||(at=1,Qe=Math.round),Qe}var Ve,it;function wn(){return it||(it=1,Ve=Number.isNaN||function(a){return a!==a}),Ve}var Je,ot;function Sn(){if(ot)return Je;ot=1;var e=wn();return Je=function(f){return e(f)||f===0?f:f<0?-1:1},Je}var Ye,lt;function bn(){return lt||(lt=1,Ye=Object.getOwnPropertyDescriptor),Ye}var Xe,ut;function ft(){if(ut)return Xe;ut=1;var e=bn();if(e)try{e([],"length")}catch{e=null}return Xe=e,Xe}var Ze,ct;function En(){if(ct)return Ze;ct=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Ze=e,Ze}var er,st;function On(){return st||(st=1,er=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},f=Symbol("test"),l=Object(f);if(typeof f=="string"||Object.prototype.toString.call(f)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var g=42;a[f]=g;for(var b in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var P=Object.getOwnPropertySymbols(a);if(P.length!==1||P[0]!==f||!Object.prototype.propertyIsEnumerable.call(a,f))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var v=Object.getOwnPropertyDescriptor(a,f);if(v.value!==g||v.enumerable!==!0)return!1}return!0}),er}var rr,pt;function An(){if(pt)return rr;pt=1;var e=typeof Symbol<"u"&&Symbol,a=On();return rr=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:a()},rr}var tr,yt;function dt(){return yt||(yt=1,tr=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),tr}var nr,vt;function ht(){if(vt)return nr;vt=1;var e=jr();return nr=e.getPrototypeOf||null,nr}var ar,mt;function Rn(){if(mt)return ar;mt=1;var e="Function.prototype.bind called on incompatible ",a=Object.prototype.toString,f=Math.max,l="[object Function]",g=function(O,y){for(var m=[],d=0;d<O.length;d+=1)m[d]=O[d];for(var F=0;F<y.length;F+=1)m[F+O.length]=y[F];return m},b=function(O,y){for(var m=[],d=y,F=0;d<O.length;d+=1,F+=1)m[F]=O[d];return m},P=function(v,O){for(var y="",m=0;m<v.length;m+=1)y+=v[m],m+1<v.length&&(y+=O);return y};return ar=function(O){var y=this;if(typeof y!="function"||a.apply(y)!==l)throw new TypeError(e+y);for(var m=b(arguments,1),d,F=function(){if(this instanceof d){var I=y.apply(this,g(m,arguments));return Object(I)===I?I:this}return y.apply(O,g(m,arguments))},A=f(0,y.length-m.length),n=[],u=0;u<A;u++)n[u]="$"+u;if(d=Function("binder","return function ("+P(n,",")+"){ return binder.apply(this,arguments); }")(F),y.prototype){var i=function(){};i.prototype=y.prototype,d.prototype=new i,i.prototype=null}return d},ar}var ir,gt;function xe(){if(gt)return ir;gt=1;var e=Rn();return ir=Function.prototype.bind||e,ir}var or,wt;function lr(){return wt||(wt=1,or=Function.prototype.call),or}var ur,St;function bt(){return St||(St=1,ur=Function.prototype.apply),ur}var fr,Et;function Pn(){return Et||(Et=1,fr=typeof Reflect<"u"&&Reflect&&Reflect.apply),fr}var cr,Ot;function In(){if(Ot)return cr;Ot=1;var e=xe(),a=bt(),f=lr(),l=Pn();return cr=l||e.call(f,a),cr}var sr,At;function Rt(){if(At)return sr;At=1;var e=xe(),a=he(),f=lr(),l=In();return sr=function(b){if(b.length<1||typeof b[0]!="function")throw new a("a function is required");return l(e,f,b)},sr}var pr,Pt;function _n(){if(Pt)return pr;Pt=1;var e=Rt(),a=ft(),f;try{f=[].__proto__===Array.prototype}catch(P){if(!P||typeof P!="object"||!("code"in P)||P.code!=="ERR_PROTO_ACCESS")throw P}var l=!!f&&a&&a(Object.prototype,"__proto__"),g=Object,b=g.getPrototypeOf;return pr=l&&typeof l.get=="function"?e([l.get]):typeof b=="function"?function(v){return b(v==null?v:g(v))}:!1,pr}var yr,It;function xn(){if(It)return yr;It=1;var e=dt(),a=ht(),f=_n();return yr=e?function(g){return e(g)}:a?function(g){if(!g||typeof g!="object"&&typeof g!="function")throw new TypeError("getProto: not an object");return a(g)}:f?function(g){return f(g)}:null,yr}var dr,_t;function Fn(){if(_t)return dr;_t=1;const e=(async function(){}).constructor;return dr=()=>e,dr}var vr,xt;function qn(){if(xt)return vr;xt=1;const e=(function*(){}).constructor;return vr=()=>e,vr}var hr,Ft;function Mn(){if(Ft)return hr;Ft=1;const e=(async function*(){}).constructor;return hr=()=>e,hr}var mr,qt;function Dn(){if(qt)return mr;qt=1;var e=Function.prototype.call,a=Object.prototype.hasOwnProperty,f=xe();return mr=f.call(e,a),mr}var gr,Mt;function wr(){if(Mt)return gr;Mt=1;var e,a=jr(),f=ln(),l=un(),g=fn(),b=cn(),P=sn(),v=he(),O=pn(),y=yn(),m=dn(),d=vn(),F=hn(),A=mn(),n=gn(),u=Sn(),i=ft(),I=En(),w=function(){throw new v},E=i?(function(){try{return arguments.callee,w}catch{try{return i(arguments,"callee").get}catch{return w}}})():w,M=An()(),h=xn(),R=ht(),o=dt(),c=bt(),p=lr(),S={},_=typeof Uint8Array>"u"||!h?e:h(Uint8Array),x={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&h?h([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":f,"%eval%":eval,"%EvalError%":l,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&h?h(h([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!h?e:h(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":a,"%Object.getOwnPropertyDescriptor%":i,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":g,"%ReferenceError%":b,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!h?e:h(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&h?h(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":P,"%ThrowTypeError%":E,"%TypedArray%":_,"%TypeError%":v,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":O,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":p,"%Function.prototype.apply%":c,"%Object.defineProperty%":I,"%Object.getPrototypeOf%":R,"%Math.abs%":y,"%Math.floor%":m,"%Math.max%":d,"%Math.min%":F,"%Math.pow%":A,"%Math.round%":n,"%Math.sign%":u,"%Reflect.getPrototypeOf%":o};if(h)try{null.error}catch(Q){var B=h(h(Q));x["%Error.prototype%"]=B}var N=Fn(),k=qn(),D=Mn(),K=function Q(T){var G;if(T==="%AsyncFunction%")G=N()||void 0;else if(T==="%GeneratorFunction%")G=k()||void 0;else if(T==="%AsyncGeneratorFunction%")G=D()||void 0;else if(T==="%AsyncGenerator%"){var z=Q("%AsyncGeneratorFunction%");z&&(G=z.prototype)}else if(T==="%AsyncIteratorPrototype%"){var H=Q("%AsyncGenerator%");H&&h&&(G=h(H.prototype))}return x[T]=G,G},s={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$=xe(),j=Dn(),X=$.call(p,Array.prototype.concat),se=$.call(c,Array.prototype.splice),me=$.call(p,String.prototype.replace),ee=$.call(p,String.prototype.slice),ne=$.call(p,RegExp.prototype.exec),Z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,ie=function(T){var G=ee(T,0,1),z=ee(T,-1);if(G==="%"&&z!=="%")throw new P("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&G!=="%")throw new P("invalid intrinsic syntax, expected opening `%`");var H=[];return me(T,Z,function(V,le,W,J){H[H.length]=W?me(J,ae,"$1"):le||V}),H},oe=function(T,G){var z=T,H;if(j(s,z)&&(H=s[z],z="%"+H[0]+"%"),j(x,z)){var V=x[z];if(V===S&&(V=K(z)),typeof V>"u"&&!G)throw new v("intrinsic "+T+" exists, but is not available. Please file an issue!");return{alias:H,name:z,value:V}}throw new P("intrinsic "+T+" does not exist!")};return gr=function(T,G){if(typeof T!="string"||T.length===0)throw new v("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof G!="boolean")throw new v('"allowMissing" argument must be a boolean');if(ne(/^%?[^%]*%?$/,T)===null)throw new P("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=ie(T),H=z.length>0?z[0]:"",V=oe("%"+H+"%",G),le=V.name,W=V.value,J=!1,Re=V.alias;Re&&(H=Re[0],se(z,X([0,1],Re)));for(var pe=1,ye=!0;pe<z.length;pe+=1){var re=z[pe],ge=ee(re,0,1),we=ee(re,-1);if((ge==='"'||ge==="'"||ge==="`"||we==='"'||we==="'"||we==="`")&&ge!==we)throw new P("property names with quotes must have matching quotes");if((re==="constructor"||!ye)&&(J=!0),H+="."+re,le="%"+H+"%",j(x,le))W=x[le];else if(W!=null){if(!(re in W)){if(!G)throw new v("base intrinsic for "+T+" exists, but the property is not available.");return}if(i&&pe+1>=z.length){var Se=i(W,re);ye=!!Se,ye&&"get"in Se&&!("originalValue"in Se.get)?W=Se.get:W=W[re]}else ye=j(W,re),W=W[re];ye&&!J&&(x[le]=W)}}return W},gr}var Sr,Dt;function Ct(){if(Dt)return Sr;Dt=1;var e=wr(),a=Rt(),f=a([e("%String.prototype.indexOf%")]);return Sr=function(g,b){var P=e(g,!!b);return typeof P=="function"&&f(g,".prototype.")>-1?a([P]):P},Sr}var br,$t;function Nt(){if($t)return br;$t=1;var e=wr(),a=Ct(),f=_e(),l=he(),g=e("%Map%",!0),b=a("Map.prototype.get",!0),P=a("Map.prototype.set",!0),v=a("Map.prototype.has",!0),O=a("Map.prototype.delete",!0),y=a("Map.prototype.size",!0);return br=!!g&&function(){var d,F={assert:function(A){if(!F.has(A))throw new l("Side channel does not contain "+f(A))},delete:function(A){if(d){var n=O(d,A);return y(d)===0&&(d=void 0),n}return!1},get:function(A){if(d)return b(d,A)},has:function(A){return d?v(d,A):!1},set:function(A,n){d||(d=new g),P(d,A,n)}};return F},br}var Er,Tt;function Cn(){if(Tt)return Er;Tt=1;var e=wr(),a=Ct(),f=_e(),l=Nt(),g=he(),b=e("%WeakMap%",!0),P=a("WeakMap.prototype.get",!0),v=a("WeakMap.prototype.set",!0),O=a("WeakMap.prototype.has",!0),y=a("WeakMap.prototype.delete",!0);return Er=b?function(){var d,F,A={assert:function(n){if(!A.has(n))throw new g("Side channel does not contain "+f(n))},delete:function(n){if(b&&n&&(typeof n=="object"||typeof n=="function")){if(d)return y(d,n)}else if(l&&F)return F.delete(n);return!1},get:function(n){return b&&n&&(typeof n=="object"||typeof n=="function")&&d?P(d,n):F&&F.get(n)},has:function(n){return b&&n&&(typeof n=="object"||typeof n=="function")&&d?O(d,n):!!F&&F.has(n)},set:function(n,u){b&&n&&(typeof n=="object"||typeof n=="function")?(d||(d=new b),v(d,n,u)):l&&(F||(F=l()),F.set(n,u))}};return A}:l,Er}var Or,Lt;function Bt(){if(Lt)return Or;Lt=1;var e=he(),a=_e(),f=on(),l=Nt(),g=Cn(),b=g||l||f;return Or=function(){var v,O={assert:function(y){if(!O.has(y))throw new e("Side channel does not contain "+a(y))},delete:function(y){return!!v&&v.delete(y)},get:function(y){return v&&v.get(y)},has:function(y){return!!v&&v.has(y)},set:function(y,m){v||(v=b()),v.set(y,m)}};return O},Or}var Ar,Ut;function Rr(){if(Ut)return Ar;Ut=1;var e=String.prototype.replace,a=/%20/g,f={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Ar={default:f.RFC3986,formatters:{RFC1738:function(l){return e.call(l,a,"+")},RFC3986:function(l){return String(l)}},RFC1738:f.RFC1738,RFC3986:f.RFC3986},Ar}var Pr,zt;function Wt(){if(zt)return Pr;zt=1;var e=Rr(),a=Bt(),f=Object.prototype.hasOwnProperty,l=Array.isArray,g=a(),b=function(o,c){return g.set(o,c),o},P=function(o){return g.has(o)},v=function(o){return g.get(o)},O=function(o,c){g.set(o,c)},y=(function(){for(var R=[],o=0;o<256;++o)R[R.length]="%"+((o<16?"0":"")+o.toString(16)).toUpperCase();return R})(),m=function(o){for(;o.length>1;){var c=o.pop(),p=c.obj[c.prop];if(l(p)){for(var S=[],_=0;_<p.length;++_)typeof p[_]<"u"&&(S[S.length]=p[_]);c.obj[c.prop]=S}}},d=function(o,c){for(var p=c&&c.plainObjects?{__proto__:null}:{},S=0;S<o.length;++S)typeof o[S]<"u"&&(p[S]=o[S]);return p},F=function R(o,c,p){if(!c)return o;if(typeof c!="object"&&typeof c!="function"){if(l(o)){var S=o.length;if(p&&typeof p.arrayLimit=="number"&&S>p.arrayLimit)return b(d(o.concat(c),p),S);o[S]=c}else if(o&&typeof o=="object")if(P(o)){var _=v(o)+1;o[_]=c,O(o,_)}else{if(p&&p.strictMerge)return[o,c];(p&&(p.plainObjects||p.allowPrototypes)||!f.call(Object.prototype,c))&&(o[c]=!0)}else return[o,c];return o}if(!o||typeof o!="object"){if(P(c)){for(var x=Object.keys(c),B=p&&p.plainObjects?{__proto__:null,0:o}:{0:o},N=0;N<x.length;N++){var k=parseInt(x[N],10);B[k+1]=c[x[N]]}return b(B,v(c)+1)}var D=[o].concat(c);return p&&typeof p.arrayLimit=="number"&&D.length>p.arrayLimit?b(d(D,p),D.length-1):D}var K=o;return l(o)&&!l(c)&&(K=d(o,p)),l(o)&&l(c)?(c.forEach(function(s,$){if(f.call(o,$)){var j=o[$];j&&typeof j=="object"&&s&&typeof s=="object"?o[$]=R(j,s,p):o[o.length]=s}else o[$]=s}),o):Object.keys(c).reduce(function(s,$){var j=c[$];if(f.call(s,$)?s[$]=R(s[$],j,p):s[$]=j,P(c)&&!P(s)&&b(s,v(c)),P(s)){var X=parseInt($,10);String(X)===$&&X>=0&&X>v(s)&&O(s,X)}return s},K)},A=function(o,c){return Object.keys(c).reduce(function(p,S){return p[S]=c[S],p},o)},n=function(R,o,c){var p=R.replace(/\+/g," ");if(c==="iso-8859-1")return p.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(p)}catch{return p}},u=1024,i=function(o,c,p,S,_){if(o.length===0)return o;var x=o;if(typeof o=="symbol"?x=Symbol.prototype.toString.call(o):typeof o!="string"&&(x=String(o)),p==="iso-8859-1")return escape(x).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var B="",N=0;N<x.length;N+=u){for(var k=x.length>=u?x.slice(N,N+u):x,D=[],K=0;K<k.length;++K){var s=k.charCodeAt(K);if(s===45||s===46||s===95||s===126||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||_===e.RFC1738&&(s===40||s===41)){D[D.length]=k.charAt(K);continue}if(s<128){D[D.length]=y[s];continue}if(s<2048){D[D.length]=y[192|s>>6]+y[128|s&63];continue}if(s<55296||s>=57344){D[D.length]=y[224|s>>12]+y[128|s>>6&63]+y[128|s&63];continue}K+=1,s=65536+((s&1023)<<10|k.charCodeAt(K)&1023),D[D.length]=y[240|s>>18]+y[128|s>>12&63]+y[128|s>>6&63]+y[128|s&63]}B+=D.join("")}return B},I=function(o){for(var c=[{obj:{o},prop:"o"}],p=[],S=0;S<c.length;++S)for(var _=c[S],x=_.obj[_.prop],B=Object.keys(x),N=0;N<B.length;++N){var k=B[N],D=x[k];typeof D=="object"&&D!==null&&p.indexOf(D)===-1&&(c[c.length]={obj:x,prop:k},p[p.length]=D)}return m(c),o},w=function(o){return Object.prototype.toString.call(o)==="[object RegExp]"},E=function(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))},M=function(o,c,p,S){if(P(o)){var _=v(o)+1;return o[_]=c,O(o,_),o}var x=[].concat(o,c);return x.length>p?b(d(x,{plainObjects:S}),x.length-1):x},h=function(o,c){if(l(o)){for(var p=[],S=0;S<o.length;S+=1)p[p.length]=c(o[S]);return p}return c(o)};return Pr={arrayToObject:d,assign:A,combine:M,compact:I,decode:n,encode:i,isBuffer:E,isOverflow:P,isRegExp:w,markOverflow:b,maybeMap:h,merge:F},Pr}var Ir,kt;function $n(){if(kt)return Ir;kt=1;var e=Bt(),a=Wt(),f=Rr(),l=Object.prototype.hasOwnProperty,g={brackets:function(i){return i+"[]"},comma:"comma",indices:function(i,I){return i+"["+I+"]"},repeat:function(i){return i}},b=Array.isArray,P=Array.prototype.push,v=function(u,i){P.apply(u,b(i)?i:[i])},O=Date.prototype.toISOString,y=f.default,m={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:a.encode,encodeValuesOnly:!1,filter:void 0,format:y,formatter:f.formatters[y],indices:!1,serializeDate:function(i){return O.call(i)},skipNulls:!1,strictNullHandling:!1},d=function(i){return typeof i=="string"||typeof i=="number"||typeof i=="boolean"||typeof i=="symbol"||typeof i=="bigint"},F={},A=function u(i,I,w,E,M,h,R,o,c,p,S,_,x,B,N,k,D,K){for(var s=i,$=K,j=0,X=!1;($=$.get(F))!==void 0&&!X;){var se=$.get(i);if(j+=1,typeof se<"u"){if(se===j)throw new RangeError("Cyclic object value");X=!0}typeof $.get(F)>"u"&&(j=0)}if(typeof p=="function"?s=p(I,s):s instanceof Date?s=x(s):w==="comma"&&b(s)&&(s=a.maybeMap(s,function(V){return V instanceof Date?x(V):V})),s===null){if(h)return c&&!k?c(I,m.encoder,D,"key",B):I;s=""}if(d(s)||a.isBuffer(s)){if(c){var me=k?I:c(I,m.encoder,D,"key",B);return[N(me)+"="+N(c(s,m.encoder,D,"value",B))]}return[N(I)+"="+N(String(s))]}var ee=[];if(typeof s>"u")return ee;var ne;if(w==="comma"&&b(s))k&&c&&(s=a.maybeMap(s,c)),ne=[{value:s.length>0?s.join(",")||null:void 0}];else if(b(p))ne=p;else{var Z=Object.keys(s);ne=S?Z.sort(S):Z}var ae=o?String(I).replace(/\./g,"%2E"):String(I),ie=E&&b(s)&&s.length===1?ae+"[]":ae;if(M&&b(s)&&s.length===0)return ie+"[]";for(var oe=0;oe<ne.length;++oe){var Q=ne[oe],T=typeof Q=="object"&&Q&&typeof Q.value<"u"?Q.value:s[Q];if(!(R&&T===null)){var G=_&&o?String(Q).replace(/\./g,"%2E"):String(Q),z=b(s)?typeof w=="function"?w(ie,G):ie:ie+(_?"."+G:"["+G+"]");K.set(i,j);var H=e();H.set(F,K),v(ee,u(T,z,w,E,M,h,R,o,w==="comma"&&k&&b(s)?null:c,p,S,_,x,B,N,k,D,H))}}return ee},n=function(i){if(!i)return m;if(typeof i.allowEmptyArrays<"u"&&typeof i.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof i.encodeDotInKeys<"u"&&typeof i.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(i.encoder!==null&&typeof i.encoder<"u"&&typeof i.encoder!="function")throw new TypeError("Encoder has to be a function.");var I=i.charset||m.charset;if(typeof i.charset<"u"&&i.charset!=="utf-8"&&i.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=f.default;if(typeof i.format<"u"){if(!l.call(f.formatters,i.format))throw new TypeError("Unknown format option provided.");w=i.format}var E=f.formatters[w],M=m.filter;(typeof i.filter=="function"||b(i.filter))&&(M=i.filter);var h;if(i.arrayFormat in g?h=i.arrayFormat:"indices"in i?h=i.indices?"indices":"repeat":h=m.arrayFormat,"commaRoundTrip"in i&&typeof i.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var R=typeof i.allowDots>"u"?i.encodeDotInKeys===!0?!0:m.allowDots:!!i.allowDots;return{addQueryPrefix:typeof i.addQueryPrefix=="boolean"?i.addQueryPrefix:m.addQueryPrefix,allowDots:R,allowEmptyArrays:typeof i.allowEmptyArrays=="boolean"?!!i.allowEmptyArrays:m.allowEmptyArrays,arrayFormat:h,charset:I,charsetSentinel:typeof i.charsetSentinel=="boolean"?i.charsetSentinel:m.charsetSentinel,commaRoundTrip:!!i.commaRoundTrip,delimiter:typeof i.delimiter>"u"?m.delimiter:i.delimiter,encode:typeof i.encode=="boolean"?i.encode:m.encode,encodeDotInKeys:typeof i.encodeDotInKeys=="boolean"?i.encodeDotInKeys:m.encodeDotInKeys,encoder:typeof i.encoder=="function"?i.encoder:m.encoder,encodeValuesOnly:typeof i.encodeValuesOnly=="boolean"?i.encodeValuesOnly:m.encodeValuesOnly,filter:M,format:w,formatter:E,serializeDate:typeof i.serializeDate=="function"?i.serializeDate:m.serializeDate,skipNulls:typeof i.skipNulls=="boolean"?i.skipNulls:m.skipNulls,sort:typeof i.sort=="function"?i.sort:null,strictNullHandling:typeof i.strictNullHandling=="boolean"?i.strictNullHandling:m.strictNullHandling}};return Ir=function(u,i){var I=u,w=n(i),E,M;typeof w.filter=="function"?(M=w.filter,I=M("",I)):b(w.filter)&&(M=w.filter,E=M);var h=[];if(typeof I!="object"||I===null)return"";var R=g[w.arrayFormat],o=R==="comma"&&w.commaRoundTrip;E||(E=Object.keys(I)),w.sort&&E.sort(w.sort);for(var c=e(),p=0;p<E.length;++p){var S=E[p],_=I[S];w.skipNulls&&_===null||v(h,A(_,S,R,o,w.allowEmptyArrays,w.strictNullHandling,w.skipNulls,w.encodeDotInKeys,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,c))}var x=h.join(w.delimiter),B=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B&":B+="utf8=%E2%9C%93&"),x.length>0?B+x:""},Ir}var _r,Gt;function Nn(){if(Gt)return _r;Gt=1;var e=Wt(),a=Object.prototype.hasOwnProperty,f=Array.isArray,l={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},g=function(A){return A.replace(/&#(\d+);/g,function(n,u){return String.fromCharCode(parseInt(u,10))})},b=function(A,n,u){if(A&&typeof A=="string"&&n.comma&&A.indexOf(",")>-1)return A.split(",");if(n.throwOnLimitExceeded&&u>=n.arrayLimit)throw new RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(n.arrayLimit===1?"":"s")+" allowed in an array.");return A},P="utf8=%26%2310003%3B",v="utf8=%E2%9C%93",O=function(n,u){var i={__proto__:null},I=u.ignoreQueryPrefix?n.replace(/^\?/,""):n;I=I.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=u.parameterLimit===1/0?void 0:u.parameterLimit,E=I.split(u.delimiter,u.throwOnLimitExceeded?w+1:w);if(u.throwOnLimitExceeded&&E.length>w)throw new RangeError("Parameter limit exceeded. Only "+w+" parameter"+(w===1?"":"s")+" allowed.");var M=-1,h,R=u.charset;if(u.charsetSentinel)for(h=0;h<E.length;++h)E[h].indexOf("utf8=")===0&&(E[h]===v?R="utf-8":E[h]===P&&(R="iso-8859-1"),M=h,h=E.length);for(h=0;h<E.length;++h)if(h!==M){var o=E[h],c=o.indexOf("]="),p=c===-1?o.indexOf("="):c+1,S,_;if(p===-1?(S=u.decoder(o,l.decoder,R,"key"),_=u.strictNullHandling?null:""):(S=u.decoder(o.slice(0,p),l.decoder,R,"key"),S!==null&&(_=e.maybeMap(b(o.slice(p+1),u,f(i[S])?i[S].length:0),function(B){return u.decoder(B,l.decoder,R,"value")}))),_&&u.interpretNumericEntities&&R==="iso-8859-1"&&(_=g(String(_))),o.indexOf("[]=")>-1&&(_=f(_)?[_]:_),u.comma&&f(_)&&_.length>u.arrayLimit){if(u.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+u.arrayLimit+" element"+(u.arrayLimit===1?"":"s")+" allowed in an array.");_=e.combine([],_,u.arrayLimit,u.plainObjects)}if(S!==null){var x=a.call(i,S);x&&(u.duplicates==="combine"||o.indexOf("[]=")>-1)?i[S]=e.combine(i[S],_,u.arrayLimit,u.plainObjects):(!x||u.duplicates==="last")&&(i[S]=_)}}return i},y=function(A,n,u,i){var I=0;if(A.length>0&&A[A.length-1]==="[]"){var w=A.slice(0,-1).join("");I=Array.isArray(n)&&n[w]?n[w].length:0}for(var E=i?n:b(n,u,I),M=A.length-1;M>=0;--M){var h,R=A[M];if(R==="[]"&&u.parseArrays)e.isOverflow(E)?h=E:h=u.allowEmptyArrays&&(E===""||u.strictNullHandling&&E===null)?[]:e.combine([],E,u.arrayLimit,u.plainObjects);else{h=u.plainObjects?{__proto__:null}:{};var o=R.charAt(0)==="["&&R.charAt(R.length-1)==="]"?R.slice(1,-1):R,c=u.decodeDotInKeys?o.replace(/%2E/g,"."):o,p=parseInt(c,10),S=!isNaN(p)&&R!==c&&String(p)===c&&p>=0&&u.parseArrays;if(!u.parseArrays&&c==="")h={0:E};else if(S&&p<u.arrayLimit)h=[],h[p]=E;else{if(S&&u.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+u.arrayLimit+" element"+(u.arrayLimit===1?"":"s")+" allowed in an array.");S?(h[p]=E,e.markOverflow(h,p)):c!=="__proto__"&&(h[c]=E)}}E=h}return E},m=function(n,u){var i=u.allowDots?n.replace(/\.([^.[]+)/g,"[$1]"):n;if(u.depth<=0)return!u.plainObjects&&a.call(Object.prototype,i)&&!u.allowPrototypes?void 0:[i];var I=/(\[[^[\]]*])/,w=/(\[[^[\]]*])/g,E=I.exec(i),M=E?i.slice(0,E.index):i,h=[];if(M){if(!u.plainObjects&&a.call(Object.prototype,M)&&!u.allowPrototypes)return;h[h.length]=M}for(var R=0;(E=w.exec(i))!==null&&R<u.depth;){R+=1;var o=E[1].slice(1,-1);if(!u.plainObjects&&a.call(Object.prototype,o)&&!u.allowPrototypes)return;h[h.length]=E[1]}if(E){if(u.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+u.depth+" and strictDepth is true");h[h.length]="["+i.slice(E.index)+"]"}return h},d=function(n,u,i,I){if(n){var w=m(n,i);if(w)return y(w,u,i,I)}},F=function(n){if(!n)return l;if(typeof n.allowEmptyArrays<"u"&&typeof n.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof n.decodeDotInKeys<"u"&&typeof n.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(n.decoder!==null&&typeof n.decoder<"u"&&typeof n.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof n.charset<"u"&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof n.throwOnLimitExceeded<"u"&&typeof n.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var u=typeof n.charset>"u"?l.charset:n.charset,i=typeof n.duplicates>"u"?l.duplicates:n.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var I=typeof n.allowDots>"u"?n.decodeDotInKeys===!0?!0:l.allowDots:!!n.allowDots;return{allowDots:I,allowEmptyArrays:typeof n.allowEmptyArrays=="boolean"?!!n.allowEmptyArrays:l.allowEmptyArrays,allowPrototypes:typeof n.allowPrototypes=="boolean"?n.allowPrototypes:l.allowPrototypes,allowSparse:typeof n.allowSparse=="boolean"?n.allowSparse:l.allowSparse,arrayLimit:typeof n.arrayLimit=="number"?n.arrayLimit:l.arrayLimit,charset:u,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:l.charsetSentinel,comma:typeof n.comma=="boolean"?n.comma:l.comma,decodeDotInKeys:typeof n.decodeDotInKeys=="boolean"?n.decodeDotInKeys:l.decodeDotInKeys,decoder:typeof n.decoder=="function"?n.decoder:l.decoder,delimiter:typeof n.delimiter=="string"||e.isRegExp(n.delimiter)?n.delimiter:l.delimiter,depth:typeof n.depth=="number"||n.depth===!1?+n.depth:l.depth,duplicates:i,ignoreQueryPrefix:n.ignoreQueryPrefix===!0,interpretNumericEntities:typeof n.interpretNumericEntities=="boolean"?n.interpretNumericEntities:l.interpretNumericEntities,parameterLimit:typeof n.parameterLimit=="number"?n.parameterLimit:l.parameterLimit,parseArrays:n.parseArrays!==!1,plainObjects:typeof n.plainObjects=="boolean"?n.plainObjects:l.plainObjects,strictDepth:typeof n.strictDepth=="boolean"?!!n.strictDepth:l.strictDepth,strictMerge:typeof n.strictMerge=="boolean"?!!n.strictMerge:l.strictMerge,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:l.strictNullHandling,throwOnLimitExceeded:typeof n.throwOnLimitExceeded=="boolean"?n.throwOnLimitExceeded:!1}};return _r=function(A,n){var u=F(n);if(A===""||A===null||typeof A>"u")return u.plainObjects?{__proto__:null}:{};for(var i=typeof A=="string"?O(A,u):A,I=u.plainObjects?{__proto__:null}:{},w=Object.keys(i),E=0;E<w.length;++E){var M=w[E],h=d(M,i[M],u,typeof A=="string");I=e.merge(I,h,u)}return u.allowSparse===!0?I:e.compact(I)},_r}var xr,Ht;function Tn(){if(Ht)return xr;Ht=1;var e=$n(),a=Nn(),f=Rr();return xr={formats:f,parse:a,stringify:e},xr}var Ln=Tn(),ce=(e=>(e.Complete="complete",e.Error="error",e.WidgetResize="widget-resize",e.PopoverResize="popover-resize",e.FullscreenResize="fullscreen-resize",e.Expire="expire",e))(ce||{}),Fr=(e=>(e.Resize="resize",e.Destroy="destroy",e))(Fr||{}),Ae=(e=>(e.Development="http://localhost:3000",e.Staging="https://relay.withpersona-staging.com",e.Production="https://relay.withpersona.com",e))(Ae||{});function Bn(e){try{const a=new URL(e);return a.hostname==="localhost"?!0:!(a.protocol!=="https:"||!a.hostname||!a.hostname.includes("."))}catch{return!1}}function qr(e){switch(e){case"development":return Ae.Development;case"staging":return Ae.Staging;case"production":case void 0:case null:return Ae.Production;default:if(typeof e=="string"){const a=e.startsWith("localhost")?`http://${e}`:`https://${e}`;if(Bn(a))return a.replace(/\/$/,"")}return console.warn(`[PersonaRelay] Invalid host: "${e}". Expected 'development', 'staging', 'production', or a valid hostname/URL. Falling back to 'production'.`),Ae.Production}}const Un="0.1.2",zn=["allow-scripts","allow-same-origin","allow-popups"],Wn=["allow-forms","allow-modals","allow-top-navigation-by-user-activation"];function Mr(e,a,{accessToken:f,host:l,theme:g},b="/relay-widget"){if(!f)throw new Error("[PersonaRelay] accessToken is required to initialize the relay widget");const P=qr(l),v=Ln.stringify({"client-version":Un,"container-id":a,"relay-session-access-token":f,theme:g},{addQueryPrefix:!0,skipNulls:!0});return b==="/relay-popover"?(e.title="Relay popover",e.className="relay-widget__popover-iframe",e.allow="clipboard-write"):b==="/relay-fullscreen"?(e.title="Relay fullscreen",e.className="relay-widget__fullscreen-iframe",e.allow="camera;microphone;clipboard-write"):(e.title="Verify via Relay",e.className="relay-widget__iframe",e.allow="clipboard-write"),e.setAttribute("sandbox",zn.concat(Wn).join(" ")),e.referrerPolicy="no-referrer",e.src=P+b+v,e}function jt(e){if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e))return e;const a=e.split(".");return a.length<=1?e:a.slice(-2).join(".")}function kn(e,{onComplete:a,onError:f,onExpire:l,onWidgetResize:g,onPopoverResize:b,onFullscreenResize:P,host:v}){const O=y=>{const m=qr(v??"production");if(y.origin!=="")try{const F=jt(new URL(y.origin).host),A=jt(new URL(m).host);if(F!==A)return}catch{return}if(e!==y.data.containerId)return;const d=y.data;switch(d.name){case ce.Complete:a?.();break;case ce.Error:f?.(d.error);break;case ce.WidgetResize:g?.(d.metadata);break;case ce.PopoverResize:b?.(d.metadata);break;case ce.FullscreenResize:P?.(d.metadata);break;case ce.Expire:l?.();break}};return window.addEventListener("message",O),()=>{window.removeEventListener("message",O)}}function Gn(){return"relay-widget-"+crypto.randomUUID()}class Hn{constructor(a){this.id=a}isMounted(){return document.getElementById(this.id)!=null}mount(a){if(document.getElementById(this.id)){console.warn(`[PersonaRelay] Stylesheet ${this.id} already appended. Skipping.`);return}const f=Kt("style",{id:this.id},[document.createTextNode(a)]);document.head.appendChild(f)}unmount(){const a=document.getElementById(this.id);if(a==null){console.warn(`[PersonaRelay] No stylesheet ${this.id} to remove. Skipping.`);return}a.parentNode?.removeChild(a)}}function Kt(e,a,f=[]){const l=document.createElement(e);for(let[g,b]of Object.entries(a))g==="className"&&(g="class"),l.setAttribute(g,b);for(const g of f)g!==!1&&(typeof g=="string"?l.appendChild(document.createTextNode(g)):l.appendChild(g));return l}const jn=".relay-widget__container{position:relative;width:100%;color-scheme:light dark}.relay-widget__iframe{border:none;background:transparent;display:block;width:100%;height:0px}.relay-widget__popover-iframe{border:none;background:transparent;display:block;position:absolute;bottom:100%;left:-32px;transform:translateY(28px);width:calc(100% + 64px);height:0px}.relay-widget__fullscreen-iframe{border:none;background:transparent;display:none;height:0px}.relay-widget__fullscreen-iframe--visible{display:block;position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483647}.relay-widget__scroll-locked{overflow:hidden!important}";class Kn{constructor(a,f){this.relayCSS=new Hn("relay-widget-styles"),this.resizeObserver=null,this.removeResizeListener=null,this.options=f,this.baseUrl=qr(this.options.host),this.containerParent=this.resolveContainer(a),this.containerId=Gn(),this.containerElement=Kt("div",{class:"relay-widget__container",id:this.containerId}),this.iframeElement=document.createElement("iframe"),this.popoverIframeElement=document.createElement("iframe"),this.fullscreenIframeElement=document.createElement("iframe"),this.unsubscribeFromEvents=kn(this.containerId,{onComplete:this.options.onComplete??null,onError:this.options.onError??null,onExpire:this.options.onExpire??null,onWidgetResize:l=>this.handleWidgetResize(l),onPopoverResize:l=>this.handlePopoverResize(l),onFullscreenResize:l=>this.handleFullscreenResize(l),host:this.options.host??null}),this.containerElement.appendChild(this.iframeElement),this.containerElement.appendChild(this.popoverIframeElement),this.containerParent.appendChild(this.containerElement),document.body.appendChild(this.fullscreenIframeElement),this.relayCSS.mount(jn);try{Mr(this.iframeElement,this.containerId,this.options,"/relay-widget"),Mr(this.popoverIframeElement,this.containerId,this.options,"/relay-popover"),Mr(this.fullscreenIframeElement,this.containerId,this.options,"/relay-fullscreen")}catch(l){throw console.error("[PersonaRelay]",l),this.destroy(),l}this.setupResizeObserver()}resolveContainer(a){if(a instanceof HTMLElement)return a;const f=document.querySelector(a);if(!f)throw new Error(`[PersonaRelay] Container element not found for selector: "${a}"`);return f}handleWidgetResize({height:a}){this.iframeElement.style.height=`${a}px`}handlePopoverResize({height:a}){const f=a>0?a+64:0;this.popoverIframeElement.style.height=`${f}px`}handleFullscreenResize({fullscreen:a}){a?(this.lockScroll(),this.fullscreenIframeElement.classList.add("relay-widget__fullscreen-iframe--visible")):(this.fullscreenIframeElement.classList.remove("relay-widget__fullscreen-iframe--visible"),this.unlockScroll())}lockScroll(){document.body.classList.add("relay-widget__scroll-locked")}unlockScroll(){document.body.classList.remove("relay-widget__scroll-locked")}sendResize(){const{clientWidth:a,clientHeight:f}=document.body,l={action:Fr.Resize,containerId:this.containerId,metadata:{width:a,height:f}};this.iframeElement.contentWindow?.postMessage(l,this.baseUrl),this.popoverIframeElement.contentWindow?.postMessage(l,this.baseUrl),this.fullscreenIframeElement.contentWindow?.postMessage(l,this.baseUrl)}setupResizeObserver(){this.iframeElement.addEventListener("load",()=>this.sendResize(),{once:!0});const a=()=>this.sendResize();window.addEventListener("resize",a),this.removeResizeListener=()=>window.removeEventListener("resize",a)}destroy(){const a={action:Fr.Destroy,metadata:{}};this.iframeElement.contentWindow?.postMessage(a,this.baseUrl),this.popoverIframeElement.contentWindow?.postMessage(a,this.baseUrl),this.fullscreenIframeElement.contentWindow?.postMessage(a,this.baseUrl),this.relayCSS.unmount(),this.unlockScroll(),this.resizeObserver?.disconnect(),this.resizeObserver=null,this.removeResizeListener?.(),this.removeResizeListener=null,this.containerElement.parentNode&&this.containerParent.removeChild(this.containerElement),this.fullscreenIframeElement.parentNode&&this.fullscreenIframeElement.parentNode.removeChild(this.fullscreenIframeElement),this.unsubscribeFromEvents()}}return Kn}));
|
|
5
|
+
//# sourceMappingURL=relay.umd.js.map
|